{"_id":"@rc-component/collapse@1.3.0","bugs":{"url":"https://github.com/react-component/collapse/issues"},"dist":{"shasum":"2afd82116c590b07c5b852981e258ca1b4d8eeb3","tarball":"http://registry-npm.ywwl.com/@rc-component/collapse/download/@rc-component/collapse-1.3.0.tgz","fileCount":30,"integrity":"sha512-1pFv7V080Y2ba+MlW6R5arBbxz4EipC7YZmbyHT9ecfWtb1FPCBz9aOKKuX5cBBqdpM+jGDSNORuW4OM/QWIcg==","signatures":[{"sig":"MEQCICrs1y4E02N3BIP0aerVNc5l+GxmVXoW02MecIbXeHcxAiBrRMaVoBomnECiUFLBC/EPYiNo9UfH7wATEUi9Spaj2w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCvfW0ju2krfN5q6FpJTgf97Ij07poQlKikjWnyDqcEawIgFu8Cp+zojIqP27TccWjR/ycefzgIaTHBWkSsmBMBugI="}],"unpackedSize":51915,"size":10900,"noattachment":false,"key":"/@rc-component/collapse/-/@rc-component/collapse-1.3.0.tgz"},"main":"./lib/index","name":"@rc-component/collapse","types":"./es/index.d.ts","module":"./es/index","gitHead":"5b797c44ca9ef19ad317f048ab311b06e855012a","license":"MIT","scripts":{"tsc":"tsc --noEmit","lint":"eslint src/ --ext .ts,.tsx,.jsx,.js,.md","test":"rc-test","build":"npm run docs:build","start":"dumi dev","compile":"father build && lessc assets/index.less assets/index.css","prepare":"husky","coverage":"rc-test --coverage","prettier":"prettier --write --ignore-unknown .","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","postpublish":"npm run docs:build:gh-pages && npm run docs:deploy","prepublishOnly":"npm run compile && rc-np","docs:build:gh-pages":"GH_PAGES=1 npm run docs:build"},"version":"1.3.0","_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"homepage":"https://react-component.github.io/collapse","keywords":["react","react-component","react-rc-collapse","rc-collapse","collapse","accordion"],"repository":{"url":"git+https://github.com/react-component/collapse.git","type":"git"},"_npmVersion":"11.19.1","description":"rc-collapse ui component for react","directories":{},"lint-staged":{"*":"prettier --write --ignore-unknown"},"maintainers":[{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"afc163","email":"afc163@gmail.com"},{"name":"madccc","email":"1075746765@qq.com"},{"name":"peachscript","email":"scdzwyxst@gmail.com"},{"name":"chenshuai2144","email":"wasd2144@hotmail.com"}],"_nodeVersion":"26.9.0","dependencies":{"clsx":"^2.1.1","@babel/runtime":"^8.0.0","@rc-component/util":"^1.13.0","@rc-component/motion":"^1.1.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.4.38","jest":"^30.4.2","less":"^4.6.7","husky":"^9.1.7","react":"^19.2.7","eslint":"^10.6.0","father":"^4.6.24","globals":"^17.7.0","rc-test":"^7.1.3","gh-pages":"^6.3.0","prettier":"^3.9.4","react-dom":"^19.2.7","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/jest":"^30.0.0","@types/node":"^26.0.1","lint-staged":"^17.0.8","@types/react":"^19.2.17","@eslint/compat":"^2.1.0","@rc-component/np":"^1.0.4","@types/react-dom":"^19.2.3","typescript-eslint":"^8.62.1","eslint-plugin-jest":"^29.15.4","eslint-plugin-react":"^7.37.5","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","eslint-config-prettier":"^10.1.8","@testing-library/jest-dom":"^6.9.1","eslint-plugin-react-hooks":"^7.1.1","@rc-component/father-plugin":"^2.2.0"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/collapse_1.3.0_1793632571110_0.7625273959923711"},"readme":"<div align=\"center\">\n  <h1>@rc-component/collapse</h1>\n  <p><sub><a href=\"https://ant.design\"><img alt=\"Ant Design\" height=\"14\" src=\"https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg\" style=\"vertical-align: -0.125em;\" /></a> Ant Design 生态的一部分。</sub></p>\n  <p>🪗 灵活的 React 折叠面板和手风琴组件。</p>\n\n  <p>\n    <a href=\"https://npmjs.org/package/@rc-component/collapse\"><img alt=\"NPM version\" src=\"https://img.shields.io/npm/v/@rc-component/collapse.svg?style=flat-square\"></a>\n    <a href=\"https://npmjs.org/package/@rc-component/collapse\"><img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/@rc-component/collapse.svg?style=flat-square\"></a>\n    <a href=\"https://github.com/react-component/collapse/actions/workflows/react-component-ci.yml\"><img alt=\"build status\" src=\"https://github.com/react-component/collapse/actions/workflows/react-component-ci.yml/badge.svg\"></a>\n    <a href=\"https://app.codecov.io/gh/react-component/collapse\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/react-component/collapse/master.svg?style=flat-square\"></a>\n    <a href=\"https://bundlephobia.com/package/@rc-component/collapse\"><img alt=\"bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@rc-component/collapse?style=flat-square\"></a>\n    <a href=\"https://github.com/umijs/dumi\"><img alt=\"dumi\" src=\"https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square\"></a>\n  </p>\n</div>\n\n<p align=\"center\"><a href=\"./README.md\">English</a> | 简体中文</p>\n\n## 特性\n\n- 支持手风琴和多面板折叠模式。\n- 推荐使用 `items` API 声明式配置面板。\n- 保留 `Collapse.Panel` 以实现兼容性。它已被弃用，并将在 v4 中删除。\n- 支持自定义展开图标、语义化类名、语义样式和动画。\n\n## 安装\n\n```bash\nnpm install @rc-component/collapse\n```\n\n## 使用\n\n```tsx | pure\nimport Collapse from '@rc-component/collapse';\nimport '@rc-component/collapse/assets/index.css';\n\nexport default function App() {\n  return (\n    <Collapse\n      defaultActiveKey=\"1\"\n      items={[\n        {\n          key: '1',\n          label: 'First panel',\n          children: 'First panel content',\n        },\n        {\n          key: '2',\n          label: 'Second panel',\n          children: 'Second panel content',\n        },\n      ]}\n    />\n  );\n}\n```\n\n## 示例\n\n运行本地 dumi 站点：\n\n```bash\nnpm install\nnpm start\n```\n\n然后打开 `http://localhost:8000`。\n\n## API\n\n### Collapse\n\n| 参数 | 说明 | 类型 | 默认值 |\n| --- | --- | --- | --- |\n| accordion | 一次只能打开一个面板 | boolean | false |\n| activeKey | 当前活动面板键 | `React.Key \\| React.Key[]` | - |\n| className | 附加 className | string | - |\n| classNames | 语义化类名 | `Partial<Record<SemanticName, string>>` | - |\n| collapsible | 指定面板触发区域是否可折叠 | `header` \\| `icon` \\| `disabled` | - |\n| defaultActiveKey | 初始活动面板键 | `React.Key \\| React.Key[]` | - |\n| destroyOnHidden | 销毁非活动面板内容 | boolean | false |\n| expandIcon | 自定义展开图标 | `(props: object) => React.ReactNode` | - |\n| items | 折叠条目内容 | `ItemType[]` | - |\n| openMotion | 自定义展开动画 | `CSSMotionProps` | - |\n| prefixCls | 组件 className 前缀 | string | `rc-collapse` |\n| style | 内联样式 | object | - |\n| styles | 语义化样式 | `Partial<Record<SemanticName, React.CSSProperties>>` | - |\n| onChange | 活动面板更改时的回调 | `(key: React.Key[]) => void` | - |\n\n### ItemType\n\n| 参数 | 说明 | 类型 | 默认值 |\n| --- | --- | --- | --- |\n| key | 面板键值 | `React.Key` | - |\n| label | 面板标题内容 | `React.ReactNode` | - |\n| ref | 面板 DOM 引用 | `React.RefObject<HTMLDivElement>` | - |\n| children | 面板主体内容 | `React.ReactNode` | - |\n| className | 附加面板 className | string | - |\n| classNames | 语义化类名 | `Partial<Record<SemanticName, string>>` | - |\n| collapsible | 指定面板是否可折叠 | `header` \\| `icon` \\| `disabled` | - |\n| destroyOnHidden | 销毁非活动面板内容 | boolean | false |\n| extra | 面板标题中的额外内容 | `React.ReactNode` | - |\n| forceRender | 在打开面板之前渲染面板内容 | boolean | false |\n| showArrow | 在标题旁边显示箭头 | boolean | true |\n| style | 内联面板样式 | object | - |\n| styles | 语义化样式 | `Partial<Record<SemanticName, React.CSSProperties>>` | - |\n| onItemClick | 点击该面板时的回调 | `(panelKey: React.Key) => void` | - |\n\n### 折叠面板\n\n`Collapse.Panel` 已弃用。请改用 `items`。\n\n## 本地开发\n\n```bash\nnpm install\nnpm start\n```\n\ndumi 站点默认运行在 `http://localhost:8000`。\n\n```bash\nnpm test\nnpm run tsc\nnpm run lint\nnpm run compile\nnpm run build\n```\n\n## 发布\n\n```bash\nnpm run prepublishOnly\n```\n\n包构建完成后，发布流程由 `@rc-component/np` 通过 `rc-np` 命令处理。\n\n## 许可证\n\n@rc-component/collapse 基于 [MIT](./LICENSE) 许可证发布。\n","publish_time":1793632571202,"_cnpm_publish_time":1793632571202,"dist-tags":{"latest":"1.3.0"}}