{"name":"react-accessible-accordion","version":"2.4.5","description":"Accessible Accordion component for React","main":"dist/umd/index.js","jsnext:main":"dist/es/index.js","scripts":{"test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","test:coverage:watch":"jest --coverage --watch","coveralls":"cat ./coverage/lcov.info | coveralls","lint":"eslint .","build:css":"cp src/css/*.css dist","build:clean":"mkdir dist || true & rm -rf dist/*","build:rollup":"rollup -c","build:flow":"flow-copy-source src dist/es -i \"**/*.spec.js\"","build":"npm run build:clean && npm run build:css && npm run build:flow && npm run build:rollup","start-demo":"webpack-dev-server --mode=development","pages":"rm -rf pages && webpack --mode=production --progress && cp demo/*.css pages && cp demo/*.ico pages","deploy":"npm run pages && ./bin/deploy.sh","prettier":"prettier **/*.js --write","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/springload/react-accessible-accordion.git"},"jest":{"setupFiles":["./src/setupTests.js"],"setupTestFrameworkScriptFile":"./src/setupTestFramework.js","testPathIgnorePatterns":["/node_modules/","/dist/"]},"keywords":["react","component","accordion","collapse","accessible","accessibility"],"authors":["Vincent Audebert <vincent@springload.co.nz>"],"contributors":[{"name":"Mitch Ryan","url":"https://github.com/ryami333"},{"name":"Samantha Sanders"},{"name":"Thibaud Colas"}],"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.0.0","@babel/core":"7.0.0","@babel/plugin-proposal-class-properties":"7.0.0","@babel/polyfill":"7.0.0","@babel/preset-env":"7.0.0","@babel/preset-flow":"7.0.0","@babel/preset-react":"7.0.0","babel-core":"^7.0.0-bridge.0","babel-eslint":"^8.2.2","babel-jest":"^23.4.2","babel-loader":"^8.0.0","coveralls":"^3.0.0","css-loader":"^1.0.0","enzyme":"^3.3.0","enzyme-adapter-react-16":"^1.1.1","enzyme-to-json":"^3.3.4","eslint":"^5.1.0","eslint-config-airbnb":"^17.0.0","eslint-config-prettier":"^2.9.0","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-flowtype-errors":"^3.6.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^6.1.1","eslint-plugin-react":"^7.10.0","flow-bin":"^0.76.0","flow-copy-source":"^2.0.2","html-webpack-plugin":"^3.2.0","jest":"^23.5.0","prettier":"^1.12.0","raf":"^3.4.0","react":"^16.4.0","react-dom":"^16.4.0","react-test-renderer":"^16.4.0","rollup":"^0.59.4","rollup-plugin-babel":"^4.0.2","rollup-plugin-commonjs":"^9.1.0","rollup-plugin-eslint":"^4.0.0","rollup-plugin-node-resolve":"^3.3.0","rollup-plugin-replace":"^2.0.0","style-loader":"^0.21.0","webpack":"^4.5.0","webpack-cli":"^3.1.0","webpack-dev-server":"^3.1.3"},"dependencies":{"classnames":"^2.2.5","consecutive":"^5.0.4","recompose":"^0.30.0"},"peerDependencies":{"react":"^15.4.0 || ^16.0.0","react-dom":"^15.4.0 || ^16.0.0"},"gitHead":"e137e91b8b59619a16f8334c39dd554137a438df","_id":"react-accessible-accordion@2.4.5","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"ryami333","email":"mitch@mitch-ryan.com"},"dist":{"integrity":"sha512-lG9E1bfqcRwLbdWRQewuQXHOp10RS8e9YDLdcXdRPDdsissn8df9R2nCnhS881eim+vLxZ94sonrKjqE/OBSXQ==","shasum":"4fd619dd012994b7e7fd2bbf715e251a0de87caf","tarball":"http://registry-npm.ywwl.com/react-accessible-accordion/download/react-accessible-accordion-2.4.5.tgz","fileCount":32,"unpackedSize":151904,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbyJHeCRA9TVsSAnZWagAAcAEP/0MB0ZIw7V9cZ/xR5hjN\nUkCLFShNPuYZ1q+W/1SVTKNtl8wk4OnLsRXIKigDtQ3gK+7bFj1NWI6lEqNf\nQsOCKdNV3A/DOKUuCbVHLPzWZt3sy2xY7eiuDXulpJDmjlX8uEMxHtO+VS8v\njQSnPGeyWRP0lQ68JrQ5+J9EQyZP/14ONiWMrdegOrOzfPrQaL/D8TknoUiW\ns7jpecvjp27gd+buB3RP1qs6W3TFjOveu1RXO27giHN6TZSA/9nhMwJN5DmM\ngaLkfsfSuoJMJy5zqzo01sVt01MlnoxLuWhcfKsvljIKFAjRXMxrsKlAaZpV\n6vbMxRbuu7C8xiXuESfJ3YK70VJdeKmznEW6Lh5XmfhOwUzCrhOLFhAfm3dy\nFN5BUsQRjq83z1/vTZ3l4sQcDVTOLloCnrvkyVSS2ibSUQc9HymiHm0Y0sq+\nax1iUHMKmwTfkqFip6YRp8AjQFGCNs6KaFcjBkxBmrZltwkEUsTByhhabi50\nBl3zr9zJnulsfIc7iePYirgeP3ZdKXt2dKU4IPLDEAIJeOgkKhnt1uus1Hb3\nMQ+OL1uxZwzQWgur+qTUhzrXxk5s5RpZBa9AU5V0SwZ2yhDhWvMS5mxubAZy\n3WhSGkeBc0EdGsHQ7bjwiGQC7DdZJW5UNj+DHD7Ay2gLFTNX0pr6l/W+biDt\nqZcU\r\n=N0jK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqW3cMpDw23/AfG1+nb+zMF+H8HEX6h1flbEcvyqIHuAIhANcpj6ZJR4jx6Up0W840ssS/QDjoua7dzeHN8O9Au1BA"}],"size":34476,"noattachment":false,"key":"/react-accessible-accordion/-/react-accessible-accordion-2.4.5.tgz"},"maintainers":[{"name":"ryami333","email":"mitch.ryan@outlook.co.nz"},{"name":"samanthaksanders","email":"samantha.k.sanders@gmail.com"},{"name":"thibaudcolas","email":"thibaudcolas@gmail.com"},{"name":"vincentaudebert","email":"vincent.audebert@yahoo.fr"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-accessible-accordion_2.4.5_1539871197582_0.96730041002368"},"_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":1539871197825,"_cnpm_publish_time":1539871197825,"dist-tags":{"latest":"5.0.1","next":"2.4.4-beta.1"}}