{"name":"react-accessible-accordion","version":"4.0.0","description":"Accessible Accordion component for React","main":"dist/umd/index.js","module":"dist/es/index.js","jsnext:main":"dist/es/index.js","types":"dist/types/index.d.ts","scripts":{"test":"jest","test:integration":"yarn build:integration && yarn jest --config=integration/jest.config.js integration","test:watch":"jest --watch","test:coverage":"jest --coverage","test:coverage:watch":"jest --coverage --watch","coveralls":"cat ./coverage/lcov.info | coveralls","lint":"eslint src","typecheck":"tsc --project .","build":"rimraf \"dist/**/*\" && yarn build:rollup && yarn build:types && yarn build:css","build:css":"cp src/css/*.css dist","build:rollup":"rollup -c","build:types":"yarn tsc --project tsconfig.declaration.json","build:demo":"rimraf \"demo/dist/**/*\" && yarn webpack --context=demo --mode=production --progress --output-path=demo/dist && cp demo/src/CNAME demo/dist/CNAME","build:integration":"rimraf \"integration/dist/**/*\" && yarn webpack --context=integration --mode=production --progress --output-path=integration/dist","start-demo":"webpack-dev-server --context=demo --mode=development --hot","pages":"yarn build:demo && yarn gh-pages -d demo/dist","deploy":"yarn pages && ./bin/deploy.sh","format":"prettier \"**/*\" --write","prepublishOnly":"yarn typecheck && yarn lint && yarn test && yarn build"},"repository":{"type":"git","url":"git+https://github.com/springload/react-accessible-accordion.git"},"keywords":["react","component","accordion","collapse","accessible","accessibility","wai-aria","aria","a11y"],"contributors":[{"name":"Vincent Audebert","url":"https://github.com/vincentaudebert"},{"name":"Mitch Ryan","url":"https://github.com/ryami333"},{"name":"Samantha Sanders","url":"https://github.com/samanthaksanders"},{"name":"Thibaud Colas","url":"https://github.com/thibaudcolas"},{"name":"Cate Palmer","url":"https://github.com/catepalmer"},{"name":"Janzen Zarzoso","url":"https://github.com/janzenz"},{"name":"Emilia Zapata","url":"https://github.com/synecdokey"}],"license":"MIT","bugs":{"url":"https://github.com/springload/react-accessible-accordion/issues"},"homepage":"https://github.com/springload/react-accessible-accordion#readme","devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/plugin-proposal-nullish-coalescing-operator":"^7.10.1","@babel/polyfill":"^7.4.4","@babel/preset-env":"^7.4.5","@babel/preset-react":"^7.0.0","@babel/preset-typescript":"^7.1.0","@testing-library/react":"^8.0.4","@types/jest":"^24.0.15","@types/react":"^16.8.22","@types/react-dom":"^16.8.4","@types/react-syntax-highlighter":"^11.0.4","@types/react-test-renderer":"^16.8.2","@types/uuid":"^3.4.4","@typescript-eslint/eslint-plugin":"^3.6.0","@typescript-eslint/parser":"^3.6.0","babel-core":"^7.0.0-bridge.0","babel-jest":"^24.8.0","babel-loader":"^8.0.6","coveralls":"^3.0.3","css-loader":"^3.0.0","eslint":"^7.4.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.3","file-loader":"^4.0.0","gh-pages":"^2.0.1","html-webpack-plugin":"^3.2.0","husky":"^2.4.1","jest":"^24.5.0","lint-staged":"^8.1.5","mini-css-extract-plugin":"^0.7.0","prettier":"^2.0.5","puppeteer":"2.0.0","react":"16.8.0","react-dom":"16.8.0","react-syntax-highlighter":"^12.2.1","react-test-renderer":"^16.8.6","rimraf":"^2.6.3","rollup":"^1.7.4","rollup-plugin-babel":"^4.2.0","rollup-plugin-commonjs":"^10.0.0","rollup-plugin-node-resolve":"^5.1.0","rollup-plugin-replace":"^2.1.1","style-loader":"^0.23.1","typescript":"^3.9.5","uuid":"^3.3.2","webpack":"^4.29.6","webpack-cli":"^3.3.0","webpack-dev-server":"^3.2.1"},"peerDependencies":{"react":"^16.3.2 || ^17.0.0","react-dom":"^16.3.3 || ^17.0.0"},"husky":{"hooks":{"pre-commit":"lint-staged && yarn typecheck"}},"lint-staged":{"linters":{"*.{ts,tsx}":["yarn lint"]}},"gitHead":"c9aded3f0241418e06af352c0536eaf4d7751abe","_id":"react-accessible-accordion@4.0.0","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-MovuWj2Uweo57LSgTIPpB83IYq8BNdZJ44j4NmDKYxaHC/H0JjYiqt8OfNMt+YK+XN8qRON13ERQnLfM73vmqw==","shasum":"83bf0c3e403e7627dbf3109c628b597142923937","tarball":"http://registry-npm.ywwl.com/react-accessible-accordion/download/react-accessible-accordion-4.0.0.tgz","fileCount":21,"unpackedSize":82508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh24DCCRA9TVsSAnZWagAAJawP/0UmMYLV2r1zgj04Pjyj\nSgAoquZrSq4OxtXp5nXHXGPUqUrHAeQYDBSI034CcB12Djwz8Qijeeh9+2sW\nXVVHPHp0ImKKl1zm1LIwYr8f4aUGdTWGODiWFQlySmlIr+JNYobVyIaVQCKf\n3pue2E5eG/ZU8QDQtz1dpqHN3XTvbeNqq9486CE5NVivErPO6gkkAVuc4adC\nXkdBqEKYgHCe8RzcjBxen9IKXxNvj/5X6A/dednWwaZY9eLv2tmPNMngGS1t\naTT3neId/jLqx4GM3L8jzLmUigI36h/YIAqHGig18Qayv7NcZWDTpBLG1wKx\n2Z1q4VTGdKFnPEYSB2ov42Oycjey4D7Yb2RvooQmlLtnp8gP6fLbbqNWgJUq\nfo1l4cf9CnjCKaxwtAJtZmyKB2NXxPnohWBkAP7tOTceN5Peqd/ZrysPFJG/\nHSoeX/ZKkoGDhU1LZ6Cmzi/rTtZo+j85gMBB7f26g2D6iQBWReVTPDM9P4rw\n/pe0AKq5iXJrzoCIB3UoBqpOrfJqLSAgfdI9zSNEJ8moWG4ULzPTSD2uXv0z\nDUWw/LOVmi6NoOESiMcUruJ4IXLVb0hqGk7ybh2FI4MPGfxTMk8wYlHMKJ41\nYFznBVlcMmQOc1A7wBoHfzOwT4FDRSlonBZ/U25NPoKS6Lh86+/9I85G5HNb\nizZ/\r\n=Aeuf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDC9ENz+K/Rm3Jrxp6SLMP0CRcZEOxFZg0vigvNd+4k/AIhAKVe192pI/J97KLdag7bPucBDrLQRt63XZrCwjP1HGLx"}],"size":16352,"noattachment":false,"key":"/react-accessible-accordion/-/react-accessible-accordion-4.0.0.tgz"},"_npmUser":{"name":"synecdokey","email":"emilia@springload.co.nz"},"directories":{},"maintainers":[{"name":"springloaders","email":"hello@springload.co.nz"},{"name":"thibaudcolas","email":"thibaudcolas@gmail.com"},{"name":"holloway","email":"matthew@holloway.co.nz"},{"name":"synecdokey","email":"emilia@springload.co.nz"},{"name":"yuzima","email":"yuzi.ma1990@gmail.com"},{"name":"ryami333","email":"mitch@mitch-ryan.com"},{"name":"vincentaudebert","email":"vincent.audebert@yahoo.fr"},{"name":"samanthaksanders","email":"samantha.k.sanders@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-accessible-accordion_4.0.0_1633054328150_0.8126607294812827"},"_hasShrinkwrap":false,"readme":"[react-accessible-accordion](https://springload.github.io/react-accessible-accordion/)\n[![npm](https://img.shields.io/npm/v/react-accessible-accordion.svg?style=flat-square)](https://www.npmjs.com/package/react-accessible-accordion)\n[![Dependency Status](https://david-dm.org/springload/react-accessible-accordion.svg?style=flat-square)](https://david-dm.org/springload/react-accessible-accordion)\n[![devDependency Status](https://david-dm.org/springload/react-accessible-accordion/dev-status.svg?style=flat-square)](https://david-dm.org/springload/react-accessible-accordion#info=devDependencies)\n[![Accessibility status](https://img.shields.io/badge/a11y-tested-brightgreen.svg)](http://wave.webaim.org/report#/https://springload.github.io/react-accessible-accordion/)\n=========\n\n## Demo\n\n[Try a demo now](https://springload.github.io/react-accessible-accordion/).\n\n## Usage\n\nFirst, grab the package from npm:\n\n```sh\nnpm install --save react-accessible-accordion\n```\n\nThen, import the editor and use it in your code. Here is a\n[basic example](https://springload.github.io/react-accessible-accordion/):\n\n```jsx\nimport React from 'react';\n\nimport {\n    Accordion,\n    AccordionItem,\n    AccordionItemHeading,\n    AccordionItemButton,\n    AccordionItemPanel,\n} from 'react-accessible-accordion';\n\n// Demo styles, see 'Styles' section below for some notes on use.\nimport 'react-accessible-accordion/dist/fancy-example.css';\n\nexport default function Example() {\n    return (\n        <Accordion>\n            <AccordionItem>\n                <AccordionItemHeading>\n                    <AccordionItemButton>\n                        What harsh truths do you prefer to ignore?\n                    </AccordionItemButton>\n                </AccordionItemHeading>\n                <AccordionItemPanel>\n                    <p>\n                        Exercitation in fugiat est ut ad ea cupidatat ut in\n                        cupidatat occaecat ut occaecat consequat est minim minim\n                        esse tempor laborum consequat esse adipisicing eu\n                        reprehenderit enim.\n                    </p>\n                </AccordionItemPanel>\n            </AccordionItem>\n            <AccordionItem>\n                <AccordionItemHeading>\n                    <AccordionItemButton>\n                        Is free will real or just an illusion?\n                    </AccordionItemButton>\n                </AccordionItemHeading>\n                <AccordionItemPanel>\n                    <p>\n                        In ad velit in ex nostrud dolore cupidatat consectetur\n                        ea in ut nostrud velit in irure cillum tempor laboris\n                        sed adipisicing eu esse duis nulla non.\n                    </p>\n                </AccordionItemPanel>\n            </AccordionItem>\n        </Accordion>\n    );\n}\n```\n\n### Styles\n\nWe strongly encourage you to write your own styles for your accordions, but\nwe've published the styles used on our demo page to help you get up and running:\n\n```js\nimport 'react-accessible-accordion/dist/fancy-example.css';\n```\n\nWe recommend that you copy them into your own app and modify them to suit your\nneeds, particularly if you're using your own `className`s.\n\n## Component API\n\n### Accordion\n\n#### allowMultipleExpanded : `boolean` [*optional*, default: `false`]\n\nDon't autocollapse items when expanding other items.\n\n#### allowZeroExpanded : `boolean` [*optional*, default: `false`]\n\nAllow the only remaining expanded item to be collapsed.\n\n#### preExpanded: `string[]` [_optional_, default: `[]`]\n\nAccepts an array of strings and any `AccordionItem` whose `uuid` prop matches\nany one of these strings will be expanded on mount.\n\n#### className : `string` [*optional*, default: `'accordion'`]\n\nClass(es) to apply to element.\n\n#### onChange : `(string[]) => void` [*optional*]\n\nCallback which is invoked when items are expanded or collapsed. Gets passed\n`uuid`s of the currently expanded `AccordionItem`s.\n\n---\n\n### AccordionItem\n\n#### className : `string` [*optional*, default: `accordion__item`]\n\nClass(es) to apply to element.\n\n#### uuid : `string|number` [*optional*]\n\nRecommended for use with `onChange`. Will be auto-generated if not provided.\n\n#### dangerouslySetExpanded: `boolean` [*optional*]\n\nEnables external control of the expansion.\n\n> Warning: This may impact accessibility negatively, use at your own risk\n\n---\n\n### AccordionItemHeading\n\n#### className : `string` [*optional*, default: `'accordion__heading'`]\n\nClass(es) to apply to the 'heading' element.\n\n#### aria-level : `number` [*optional*, default: `3`]\n\nSemantics to apply to the 'heading' element. A value of `1` would make your\nheading element hierarchically equivalent to an `<h1>` tag, and likewise a value\nof `6` would make it equivalent to an `<h6>` tag.\n\n### AccordionItemButton\n\n#### className : `string` [*optional*, default: `'accordion__button'`]\n\nClass(es) to apply to the 'button' element.\n\n---\n\n### AccordionItemPanel\n\n#### className : `string` [*optional*, default: `'accordion__panel'`]\n\nClass(es) to apply to element.\n\n#### region: `boolean`\n\nMake the element have a region role.\n\n---\n\n### AccordionItemState\n\n#### children : `({ expanded: boolean, disabled: boolean }): JSX.Element` [**required**]\n\n---\n\n## Helpers\n\n### resetNextUuid : `(): void`\n\nResets the internal counter for Accordion items' identifiers (including `id`\nattributes). For use in test suites and isomorphic frameworks.\n\n---\n\n## Accessibility Best-Practice\n\nAuthoring an 'accordion' component to the\n[WAI ARIA spec](https://www.w3.org/TR/wai-aria-practices-1.1/#accordion) can be\ncomplex, but `React Accessible Accordion` does most of the heavy lifting for\nyou, including:\n\n-   Applying appropriate aria attributes (`aria-expanded`, `aria-controls`,\n    `aria-disabled`, `aria-hidden` and `aria-labelledby`).\n-   Applying appropriate `role` attributes (`button`, `heading`, `region`).\n-   Applying appropriate `tabindex` attributes.\n-   Applying keyboard interactivity ('space', 'end', 'tab', 'up', 'down', 'home'\n    and 'end' keys).\n\nHowever, there's still a couple of things you need to keep in mind to remain\nspec-compliant:\n\n-   Only ever use\n    [phrasing content](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content)\n    inside of your `AccordionItemHeading` component. If in doubt, use text only.\n-   Always provide an `aria-level` prop to your `AccordionItemHeading`\n    component, _especially_ if you are nesting accordions. This attribute is a\n    signal used by assistive technologies (eg. screenreaders) to determine which\n    heading level (ie. `h1`-`h6`) to treat your heading as.\n\nIf you have any questions about your implementation, then please don't be afraid\nto get in touch via our\n[issues](https://github.com/springload/react-accessible-accordion/issues).\n\n## FAQs\n\n### React 18?\n\nRAA supports React 18, and the new out-of-order streaming feature. See the\nCHANGELOG for details.\n\n### Which design patterns does this component aim to solve?\n\nThose described by the WAI ARIA spec's description of an 'accordion':\n\n> An accordion is a vertically stacked set of interactive headings that each\n> contain a title, content snippet, or thumbnail representing a section of\n> content. The headings function as controls that enable users to reveal or hide\n> their associated sections of content. Accordions are commonly used to reduce\n> the need to scroll when presenting multiple sections of content on a single\n> page.\n\n### Which design patterns does this component NOT aim to solve?\n\nComponents which are \"accordion-like\" but do not match the WAI ARIA spec's\ndescription, as written above. By \"accordion-like\", we mean components which\nhave collapsible items but require bespoke interactive mechanisms in order to\nexpand, collapse and 'disable' them. This includes (but is not limited to)\nmulti-step forms, like those seen in many cart/checkout flows, which we believe\nrequire (other) complex markup in order to be considered 'accessible'. This also\nincludes disclosure widgets.\n\n### How do I disable an item?\n\nSee \"Which design patterns does this component NOT aim to solve?\".\n\n## Browser Support\n\n**Supported browser / device versions:**\n\n| Browser       | Device/OS | Version |\n| ------------- | --------- | ------- |\n| Mobile Safari | iOS       | latest  |\n| Chrome        | Android   | latest  |\n| IE            | Windows   | 11      |\n| MS Edge       | Windows   | latest  |\n| Chrome        | Desktop   | latest  |\n| Firefox       | Desktop   | latest  |\n| Safari        | OSX       | latest  |\n","publish_time":1633054328288,"_cnpm_publish_time":1633054328288,"dist-tags":{"latest":"5.0.1","next":"2.4.4-beta.1"}}