{"name":"react-accessible-accordion","version":"0.1.2","description":"Accessible Accordion component for React","main":"dist/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","js":"babel -d dist src","css":"cp src/react-accessible-accordion.css dist","build":"npm run js -s && npm run css -s","start":"webpack --config ./webpack/webpack.config.dev.js","start-demo":"webpack-dev-server --config ./webpack/webpack.config.demo.js","pages":"rm -rf pages && cp -R demo pages && webpack --config=./webpack/webpack.config.pages.js","deploy":"npm run pages && ./bin/deploy.sh"},"repository":{"type":"git","url":"git+https://github.com/springload/react-accessible-accordion.git"},"babel":{"presets":["es2015","react"]},"jest":{"testPathIgnorePatterns":["/node_modules/","/dist/"]},"keywords":["react","component","accordion","collapse","accessible","accessibility"],"authors":["Vincent Audebert <vincent@springload.co.nz>"],"contributors":[{"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.24.0","babel-eslint":"^7.2.1","babel-loader":"^6.4.1","babel-preset-es2015":"^6.24.0","babel-preset-react":"^6.23.0","coveralls":"^2.12.0","css-loader":"^0.27.3","eslint":"^3.18.0","eslint-config-airbnb":"^14.1.0","eslint-plugin-import":"^2.2.0","eslint-plugin-jsx-a11y":"^4.0.0","eslint-plugin-react":"^6.10.3","jest":"^19.0.2","react":"^15.4.2","react-addons-test-utils":"^15.4.2","react-dom":"^15.4.2","react-test-renderer":"^15.4.2","style-loader":"^0.16.1","webpack":"^2.3.2","webpack-dev-server":"^2.4.2"},"dependencies":{"classnames":"^2.2.5","uuid":"^3.0.1"},"peerDependencies":{"react":"^15.4.2","react-dom":"^15.4.2"},"gitHead":"7ad7c6c3a495b6a6b43957e98b68c85a49856fe1","_id":"react-accessible-accordion@0.1.2","_shasum":"d4faa281186e523886d58507a902e29f64ee938e","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"vincentaudebert","email":"vincent.audebert@yahoo.fr"},"dist":{"shasum":"d4faa281186e523886d58507a902e29f64ee938e","tarball":"http://registry-npm.ywwl.com/react-accessible-accordion/download/react-accessible-accordion-0.1.2.tgz","integrity":"sha512-UbdAMV/TJt9xRrtefKtG6SyjX5ytAnrz2D9ZlGHSPAMsCbqnNUeJNDZBRhxOItqpM/zM8gJSHNX3tklp7td4QA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDA72zxtX+BrhUdKKuZ+ZNftG1za7VfBdov/YxqASkPiAiBCBXR1ICk14hsRvNQ9lDzxR52Zy8BeJOm7Aveg7hpm5Q=="}],"size":7930,"noattachment":false,"key":"/react-accessible-accordion/-/react-accessible-accordion-0.1.2.tgz"},"maintainers":[{"name":"vincentaudebert","email":"vincent.audebert@yahoo.fr"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/react-accessible-accordion-0.1.2.tgz_1491199448990_0.40216140961274505"},"directories":{},"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":1491199450940,"_cnpm_publish_time":1491199450940,"dist-tags":{"latest":"5.0.1","next":"2.4.4-beta.1"}}