{"name":"react-accessible-accordion","version":"2.4.2","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":"rm -rf dist/*","build:rollup":"NODE_ENV=production 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":"npm run js:watch","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"},"babel":{"presets":[["es2015",{"modules":false}],"react","stage-2"],"env":{"test":{"presets":["es2015","react","stage-2"]}}},"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":"^6.26.0","babel-eslint":"^8.2.2","babel-jest":"^23.0.1","babel-loader":"^7.1.4","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-2":"^6.24.1","coveralls":"^3.0.0","css-loader":"^0.28.11","enzyme":"^3.3.0","enzyme-adapter-react-16":"^1.1.1","enzyme-to-json":"^3.3.4","eslint":"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-config-prettier":"^2.9.0","eslint-plugin-flowtype":"^2.47.1","eslint-plugin-flowtype-errors":"^3.5.1","eslint-plugin-import":"^2.7.0","eslint-plugin-jsx-a11y":"^6.0.3","eslint-plugin-react":"^7.4.0","flow-bin":"^0.73.0","flow-copy-source":"^1.3.0","html-webpack-plugin":"^3.2.0","jest":"^23.0.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":"^3.0.3","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":"^2.0.14","webpack-dev-server":"^3.1.3"},"dependencies":{"classnames":"^2.2.5","consecutive":"^5.0.4","unstated":"^2.1.1"},"peerDependencies":{"react":"^15.4.0 || ^16.0.0","react-dom":"^15.4.0 || ^16.0.0"},"gitHead":"fb0347da7474da6f0fcb85491e518fc0c50ba111","_id":"react-accessible-accordion@2.4.2","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"vincentaudebert","email":"vincent.audebert@yahoo.fr"},"dist":{"integrity":"sha512-lrxRUOL6YMNbV2/V7TCR8XgJ7nqGu5M9QYLR05lTrhiWgngKo0aeYlws/MLEUMA6z2NssfxrqNB6aipvgpt1Vg==","shasum":"4f231a012c4f6020f83cbd3ffcb9b578eea22244","tarball":"http://registry-npm.ywwl.com/react-accessible-accordion/download/react-accessible-accordion-2.4.2.tgz","fileCount":30,"unpackedSize":532699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFDPxCRA9TVsSAnZWagAAV6UP/jeFQg2EtQ6GuuvczTMp\nSE/YCZx9Ffr9AYZXs1/Q9UjNTPoYflH9hcKlT/suJkcRhYUA5kBvpoYlgxj8\nZHa6PeB+/dXYw8S3ofX9paH6hWUNwubT2pmUfhG67Zo4rKlaSoWwBxUlJYH2\nJzRjejtzvzd5b0q+dOwe2W1qynh8lXkelt11eviX0PajuxFPyiombdn6ilQU\nCaPyjTM0H3a7Si1abzkAXrujHudcoIvGP511s7bDg2f5hhGCdQwWKwDVGnZ1\ng4uktOzWlYxo8o5tqGsmho6ww3odqCXSKViBEL6GLxOKLAe3fC8EHnBTEzBH\nkMNSWhsqM8zzNh653U17lnps6Mbm56WyzC42SU0qXJTdkPi1qpypd6tzW3cC\nioLsfmuR24VVR7cIRP65zCKeg6K8v4pX0v577vLJCQjpwKjN6tEdMH4e8emB\nUVrmVDoDEVrwztiqbPD+qkYNwmBaCbrRg2wpCPmP4UY08XpQRO7jQfKAKqTg\naLbuR2UCz9DXqV+XjjE3ChuOIwTZbuBvN64i/ICuAniuVzshywCpdV8OAqQV\nRgjRqlR9ZL8GhpI2XNj5XMos0wMK63iyHboZOEd2R4A0tkC2k48r/n6IOVN9\nz8S+rRx2P74k0CyuX3YumcU7uC5XDqI0jutUl1j5zW+BGMneiGtK3pDEVhg+\nqkQY\r\n=DqQo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAr0Q2NoU59/eI/CtVm2Pf9XwrSMg20BdHc/SEEVOFbCAiEA/ovElqSV4thXfH79u4De/QKkyIFtwuUgws7TLv4kJhY="}],"size":129646,"noattachment":false,"key":"/react-accessible-accordion/-/react-accessible-accordion-2.4.2.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.2_1528050672178_0.5046200152209288"},"_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":1528050672310,"_cnpm_publish_time":1528050672310,"dist-tags":{"latest":"5.0.1","next":"2.4.4-beta.1"}}