{"_id":"@accessible/accordion","_rev":"3-bd9bf2d52923ee3e6d751934fc5f8146","name":"@accessible/accordion","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@accessible/accordion","version":"1.0.0","homepage":"https://github.com/accessible-ui/accordion#readme","repository":{"type":"git","url":"https://github.com/accessible-ui/accordion.git"},"bugs":{"url":"https://github.com/accessible-ui/accordion/issues"},"author":{"name":"Jared Lunde","email":"jared.lunde@gmail.com","url":"https://jaredLunde.com"},"license":"MIT","description":"An accessible and versatile accordion component for React","keywords":["react","react component","accordion","accessible accordion","a11y accordion","react a11y accordion","react accessible accordion","react accordion","react accordion component","a11y","react aria accordion","aria","aria accordion"],"main":"dist/cjs/index.js","module":"dist/es/index.js","sideEffects":false,"scripts":{"build":"npm run build:cjs && npm run build:es && npm run build:types","build:cjs":"babel src -d dist/cjs -x .ts,.tsx --ignore \"**/*.test.ts\",\"**/test.ts\",\"**/*.test.tsx\",\"**/test.tsx\" --delete-dir-on-start","build:es":"cross-env BABEL_ENV=es babel src -d dist/es -x .ts,.tsx --ignore \"**/*.test.ts\",\"**/test.ts\",\"**/*.test.tsx\",\"**/test.tsx\" --delete-dir-on-start","build:types":"tsc -p tsconfig.json -d --outDir dist/es --emitDeclarationOnly && mkdir -p dist/cjs && cp -R dist/es/**.d.ts dist/cjs && rimraf dist/**/*.test.d.ts","check-types":"tsc --noEmit -p tsconfig.json","format":"prettier --write \"**/*.{ts,tsx,js,jsx,md,yml,json,babelrc,eslintrc,prettierrc}\"","lint":"eslint . --ext .ts,.tsx","prepublishOnly":"npm run lint && npm run test && npm run build && npm run format","test":"jest","validate":"npm run check-types && npm run lint && npm run test -- --coverage"},"husky":{"hooks":{"pre-commit":"lint-staged && npm run build:types"}},"lint-staged":{"**/*.{ts,tsx,js,jsx}":["eslint","prettier --write"],"**/*.{md,yml,json,babelrc,eslintrc,prettierrc}":["prettier --write"]},"devDependencies":{"@babel/preset-react":"latest","@lunde/babel-preset-es":"latest","@testing-library/jest-dom":"latest","@testing-library/react":"latest","@testing-library/react-hooks":"latest","@types/jest":"latest","@types/react":"latest","@types/react-dom":"latest","@typescript-eslint/eslint-plugin":"latest","@typescript-eslint/parser":"latest","babel-plugin-optimize-react":"latest","babel-plugin-typescript-to-proptypes":"latest","cross-env":"latest","eslint":"latest","eslint-import-resolver-jest":"latest","eslint-plugin-jest":"latest","eslint-plugin-react":"latest","eslint-plugin-react-hooks":"latest","husky":"latest","jest":"latest","lint-staged":"latest","prettier":"latest","react":"latest","react-dom":"latest","react-test-renderer":"latest","rimraf":"^2.6.3","ts-jest":"latest","typescript":"latest"},"dependencies":{"@accessible/button":"^1.0.2","@accessible/use-conditional-focus":"^1.0.1","@accessible/use-id":"^1.0.3","@accessible/use-keycode":"^3.0.1","@react-hook/merged-ref":"^1.0.8","@react-hook/passive-layout-effect":"^1.0.2","clsx":"^1.0.4"},"peerDependencies":{"prop-types":">=15.6","react":">=16.8","react-dom":">=16.8"},"licenseText":"MIT License\n\nCopyright (c) 2019 Jared Lunde\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@accessible/accordion@1.0.0","dist":{"shasum":"7ceb5f8ce9958f649dad6fceb5b0a8e9396becbc","integrity":"sha512-cACHMpUVqqVTvU3e4o2mrCtW1eOu8mfjlg+aH89+hN3pna72Hk0HBk1eBpuls7h5eezv2etG+wg0jQ7K9gUDKA==","tarball":"https://registry.npmjs.org/@accessible/accordion/-/accordion-1.0.0.tgz","fileCount":11,"unpackedSize":50003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeDTWFCRA9TVsSAnZWagAAe20P/RXyPO9gzhnKRbnZ7rfm\njQxAzSRNRnd97RzZIhrvOXmhWwM42HRJyKEoYxVfBVnoLv/9F7VvVWO07qRg\n3xOvEvGHK2xONSgXSN1vJgnXecgA9RhOs4mR3Edpj20JiBR0zi9UIl7kWFxa\n8vCMzQyQWqgQPjvqFHsvmwpYc+s5Lh2ip58v4iJ2Ii4ojhS66h3tMzyvtytY\nomGCk4u/E6RpH6Ww2zifaeAql+/blTOwgt+c2gRWKCkPE/B6A4um+CSBAXcC\nJVjE6NvZ2svwGcZbFSRxPdvpDflVGF4jFaruXuqlpX5PA/mFB+2Fyk1OnP+6\n4CH1AN2FD+mLhvU83S2BDYWxbdVLinoVmT0pUbhhV4b062YPO/RoXeBAxaxj\ntHL5WLn1vw6/2fS0GPqX8j7lTlQ+/dz7UIFOtCng9s5AbT5XFVCFg8u58ml0\nva3pqk/ZBVTpN0bx3Rf3rZF0aJEeriIV8u25VDHS+dXRsm2nQGx8IWHD9FM0\nuJXFi0h9pyoY5JFY4ugpp6Gdhp/oKvAq/RG3D9B0FIEzZfPREv4TTC11gfIn\nFcCj9fayA0Uup5u/arTk6Vznx+0lE8tozU/WWZBBu3cTL5+KuifcM8ORUwT7\nN5lxQScUFmAXUJ55z1YEN2YfN1/Kx0/rfUmzZpu99e/RCER60oZawI/oFvwu\n8L5b\r\n=w3fP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHwUkOAfPWf72dUogD46OHkW+pPbZ+W+gKYW0Jo5ncVHAiEAlVDa7KISuxeuUMEcVRSecEicUEEDGqZI65oj3yN1nXk="}]},"maintainers":[{"name":"jaredlunde","email":"jared.lunde@gmail.com"}],"_npmUser":{"name":"jaredlunde","email":"jared.lunde@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/accordion_1.0.0_1577923973429_0.34050571052745426"},"_hasShrinkwrap":false},"1.0.1":{"name":"@accessible/accordion","version":"1.0.1","homepage":"https://github.com/accessible-ui/accordion#readme","repository":{"type":"git","url":"https://github.com/accessible-ui/accordion.git"},"bugs":{"url":"https://github.com/accessible-ui/accordion/issues"},"author":{"name":"Jared Lunde","email":"jared.lunde@gmail.com","url":"https://jaredLunde.com"},"license":"MIT","description":"An accessible and versatile accordion component for React","keywords":["react","react component","accordion","accessible accordion","a11y accordion","react a11y accordion","react accessible accordion","react accordion","react accordion component","a11y","react aria accordion","aria","aria accordion"],"main":"dist/cjs/index.js","module":"dist/es/index.js","sideEffects":false,"scripts":{"build":"npm run build:cjs && npm run build:es && npm run build:types","build:cjs":"babel src -d dist/cjs -x .ts,.tsx --ignore \"**/*.test.ts\",\"**/test.ts\",\"**/*.test.tsx\",\"**/test.tsx\" --delete-dir-on-start","build:es":"cross-env BABEL_ENV=es babel src -d dist/es -x .ts,.tsx --ignore \"**/*.test.ts\",\"**/test.ts\",\"**/*.test.tsx\",\"**/test.tsx\" --delete-dir-on-start","build:types":"tsc -p tsconfig.json -d --outDir dist/es --emitDeclarationOnly && mkdir -p dist/cjs && cp -R dist/es/**.d.ts dist/cjs && rimraf dist/**/*.test.d.ts","check-types":"tsc --noEmit -p tsconfig.json","format":"prettier --write \"**/*.{ts,tsx,js,jsx,md,yml,json,babelrc,eslintrc,prettierrc}\"","lint":"eslint . --ext .ts,.tsx","prepublishOnly":"npm run lint && npm run test && npm run build && npm run format","test":"jest","validate":"npm run check-types && npm run lint && npm run test -- --coverage"},"husky":{"hooks":{"pre-commit":"lint-staged && npm run build:types"}},"lint-staged":{"**/*.{ts,tsx,js,jsx}":["eslint","prettier --write"],"**/*.{md,yml,json,babelrc,eslintrc,prettierrc}":["prettier --write"]},"devDependencies":{"@babel/preset-react":"latest","@lunde/babel-preset-es":"latest","@testing-library/jest-dom":"latest","@testing-library/react":"latest","@testing-library/react-hooks":"latest","@types/jest":"latest","@types/react":"latest","@types/react-dom":"latest","@typescript-eslint/eslint-plugin":"latest","@typescript-eslint/parser":"latest","babel-plugin-optimize-react":"latest","babel-plugin-typescript-to-proptypes":"latest","cross-env":"latest","eslint":"latest","eslint-import-resolver-jest":"latest","eslint-plugin-jest":"latest","eslint-plugin-react":"latest","eslint-plugin-react-hooks":"latest","husky":"latest","jest":"latest","lint-staged":"latest","prettier":"latest","react":"latest","react-dom":"latest","react-test-renderer":"latest","rimraf":"^2.6.3","ts-jest":"latest","typescript":"latest"},"dependencies":{"@accessible/button":"^1.0.4","@accessible/use-conditional-focus":"^2.1.1","@accessible/use-id":"^1.0.3","@accessible/use-keycode":"^4.0.0","@react-hook/merged-ref":"^1.0.8","@react-hook/passive-layout-effect":"^1.0.2","clsx":"^1.0.4"},"peerDependencies":{"prop-types":">=15.6","react":">=16.8","react-dom":">=16.8"},"licenseText":"MIT License\n\nCopyright (c) 2019 Jared Lunde\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@accessible/accordion@1.0.1","dist":{"shasum":"6265cff00b3ff3c3a4871617844d8f9370a745f7","integrity":"sha512-QxaLNmTWe38X526yVfp0x1jxnEB2v5eoCnYN8hgr9mNbxIrPfg/pUJ0CA/FlFF+05hOGPeW0VhBy7gml8SEjMw==","tarball":"https://registry.npmjs.org/@accessible/accordion/-/accordion-1.0.1.tgz","fileCount":11,"unpackedSize":49767,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJey/8FCRA9TVsSAnZWagAAyfMP/3/ipHXM7MmBXro0iw8K\nWoKKCGTo5QijrRBF/ZWBT38dU745VvDYnn1JJsYlW/66anupFys2ZfKdbcBp\ntljd0xkpYaVbXIE0J883Urqh/qcpgtBSxrixKfJ5zdp/BjHaV2Yy2w02RA6P\nXu+Wp4IcaoNLBdVDYd/01GkCa0NYSrycdc216YEbHk+N4nK9FZ6AlXRwh75P\nWCD/dFQO65FIQ/j+oUZzV+fQKICWaXhrh/Eraiy2EQ7R/yzq3foWF01YGfi8\niDsQQfrMIxUJwxagnVo1sDGVRLVRN+W4bmWVNvyn36A9aVlqQNBTqTsuSb9N\nyQSvWkUb5D7t0Wb+/LdeMlt2kiJSlZuz6K9AsA1rmOlXzU1VLPL+vt8LYOiM\nwltQC+U563Hweh/gMuKYy6aDfNYwZDAjvGEGXaHeOUhNClEHNPPQy7zuxqR5\nMmjMesx9pSNALxVByjF+myvmnws9n7um1lzt4QwwK3fQKZakMa4RHnVQdptW\nF7BjOKScq2O06rNCKBuTWhRGLrWaeiTyPVkajkLKfy3Lo2i/Gi9Gx6G62Dus\nVaRDlyjj1PY/MO4UIGGukkboX4LevfSZ5JLcdsNnzS2N54pesTj8VXO18oAW\nJ4RhnN09ZWWLqqnPkdaBYLyD8pkV2agk2FTDpoQRAzNAhR/Va3sWfRmx85q2\nhZWx\r\n=GE2c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNloHJCvqWhVIjuH6V17+BAmj+Px61NdQsN8Ti5+EDZgIhAKZIhEEcGO1M5llBjCNKg/F/c62jJkTVOQkGRUsOAynt"}]},"maintainers":[{"name":"jaredlunde","email":"jared.lunde@gmail.com"}],"_npmUser":{"name":"jaredlunde","email":"jared.lunde@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/accordion_1.0.1_1590427396323_0.5219605305562194"},"_hasShrinkwrap":false},"2.0.0":{"name":"@accessible/accordion","version":"2.0.0","homepage":"https://github.com/accessible-ui/accordion#readme","repository":{"type":"git","url":"https://github.com/accessible-ui/accordion.git"},"bugs":{"url":"https://github.com/accessible-ui/accordion/issues"},"author":{"name":"Jared Lunde","email":"jared.lunde@gmail.com","url":"https://jaredLunde.com"},"license":"MIT","description":"An accessible and versatile accordion component for React","keywords":["react","react component","accordion","accessible accordion","a11y accordion","react a11y accordion","react accessible accordion","react accordion","react accordion component","a11y","react aria accordion","aria","aria accordion"],"main":"dist/main/index.js","module":"dist/module/index.js","source":"src/index.tsx","types":"types/index.d.ts","exports":{".":{"browser":"./dist/module/index.js","import":"./dist/esm/index.mjs","require":"./dist/main/index.js","source":"./src/index.tsx","types":"./types/index.d.ts","default":"./dist/main/index.js"},"./package.json":"./package.json","./":"./"},"sideEffects":false,"scripts":{"build":"npm run build-esm && npm run build-main && npm run build-module && npm run build-types","build-esm":"npm run compile -- -d dist/esm --env-name esm --out-file-extension .mjs","build-main":"npm run compile -- -d dist/main --env-name main","build-module":"npm run compile -- -d dist/module --env-name module","build-types":"tsc -p tsconfig.json -d --outDir types --emitDeclarationOnly","check-types":"tsc --noEmit -p tsconfig.json","compile":"babel src -x .ts,.tsx --ignore \"**/*.test.ts\",\"**/*.test.tsx\" --delete-dir-on-start","format":"prettier --write \"**/*.{ts,tsx,js,jsx,md,yml,json,eslintrc,prettierrc}\"","lint":"eslint . --ext .ts,.tsx","prepublishOnly":"npm run lint && npm run test && npm run build && npm run format","test":"jest","validate":"npm run check-types && npm run lint && npm run test -- --coverage"},"husky":{"hooks":{"pre-commit":"npm run build-types && git add types && lint-staged"}},"lint-staged":{"**/*.{ts,tsx,js,jsx}":["eslint","prettier --write"],"**/*.{md,yml,json,eslintrc,prettierrc}":["prettier --write"]},"devDependencies":{"@babel/preset-react":"latest","@lunde/babel-preset-es":"latest","@testing-library/jest-dom":"latest","@testing-library/react":"latest","@testing-library/react-hooks":"latest","@testing-library/user-event":"latest","@types/jest":"latest","@types/react":"latest","@types/react-dom":"latest","@typescript-eslint/eslint-plugin":"latest","@typescript-eslint/parser":"latest","babel-plugin-annotate-pure-calls":"latest","babel-plugin-optimize-react":"latest","eslint":"latest","eslint-import-resolver-jest":"latest","eslint-plugin-jest":"latest","eslint-plugin-react":"latest","eslint-plugin-react-hooks":"latest","husky":"^4.2.5","jest":"latest","lint-staged":"latest","prettier":"latest","react":"latest","react-dom":"latest","react-test-renderer":"latest","ts-jest":"latest","typescript":"latest"},"dependencies":{"@accessible/button":"^1.1.1","@accessible/use-conditional-focus":"^2.2.0","@accessible/use-id":"^1.1.0","@accessible/use-keycode":"^4.0.1","@react-hook/merged-ref":"^1.1.1","@react-hook/passive-layout-effect":"^1.0.3","clsx":"^1.1.1"},"peerDependencies":{"react":">=16.8","react-dom":">=16.8"},"licenseText":"MIT License\n\nCopyright (c) 2019 Jared Lunde\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","_id":"@accessible/accordion@2.0.0","dist":{"shasum":"f2c4c79453edfa1efd1762564b0557f1a80cc5e3","integrity":"sha512-C+PYVeSuDyS05kZ49bYEqzaRhx3kiqCGWkCaurMjog4bKGjFREB20UXvUub1250ZDaqXwslREdBTlppPnYNwtg==","tarball":"https://registry.npmjs.org/@accessible/accordion/-/accordion-2.0.0.tgz","fileCount":18,"unpackedSize":108504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0rh/CRA9TVsSAnZWagAAaloP/inS/DyS/Jt1Sb3KZNjs\n0sCusOkMghO0Oa5cRdqRHxv4tPBUP7tpCpLTltEiF137bQ5Lm6YYGi7Ou1En\nPjJYWtAv/IebkT/5qZSV3Ju5J4z58+DNvIZSm3hrGLTpsJ8Cgbwq712hgM+d\nNWNox+LnGynDQzEzy7EllSJ869MiUX6hHtfIzKwPw8AaKngexly9nGENIU+A\nuhyAAMLRLiE7ZK/lz4FWh1gfXMKYwgF1Jv6nbp91jY0cbp10afVHxkBiXPD+\nHBpPRHkmJmnTU29wW9sxcshRmRJ6GPCxarLhTDKhlabGm7xapuW5k00gPUyu\nt9+V1PmFxC5VMHNU21hEUV5SILKqa/v2spgQL/VIIaVG8DS8lrDwA8O8pmZv\nmSTVZqmBiBs4YLEUhO/PRFKGc/4McIWadR7ARhoNFWCw4udAncp7hWbR3rmy\nGbh8GpMkeeq0k66PDVVg+fwzBO22wVw+7fpjoxIa9qH+NuKlqM/v39ocwwZT\n5F+FxDLAXvS73VLMJAbMi/lXFs2ZbrEfmMA4NL515IaCB6sAyUczmUhDA0G4\nBsBviyTIX4kV52BFAMg6FCjxtz4ndGM2uku6S8UOnJmVr2mLsudHlsu6GIvW\ncGPROCMWgoE/bRla0LEgiJuEZ6AQVrvOUxNj/WhpXD2uYLnEX7z9Ko2YqCtd\naPPN\r\n=tMUP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgxLhN0AIynvzzIJnK+KlMZtpLaztdQrFgo8K0Mmc2VQIgduwUxTX52hGymK80r8FGJhk0vh/RdtaZOaVLEcGiuGc="}]},"maintainers":[{"name":"jaredlunde","email":"jared.lunde@gmail.com"}],"_npmUser":{"name":"jaredlunde","email":"jared.lunde@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/accordion_2.0.0_1590868094800_0.9685935573779345"},"_hasShrinkwrap":false}},"time":{"created":"2020-01-02T00:12:53.199Z","1.0.0":"2020-01-02T00:12:53.535Z","modified":"2022-04-04T11:07:05.783Z","1.0.1":"2020-05-25T17:23:16.475Z","2.0.0":"2020-05-30T19:48:14.897Z"},"maintainers":[{"name":"jaredlunde","email":"jared.lunde@gmail.com"}],"description":"An accessible and versatile accordion component for React","homepage":"https://github.com/accessible-ui/accordion#readme","keywords":["react","react component","accordion","accessible accordion","a11y accordion","react a11y accordion","react accessible accordion","react accordion","react accordion component","a11y","react aria accordion","aria","aria accordion"],"repository":{"type":"git","url":"https://github.com/accessible-ui/accordion.git"},"author":{"name":"Jared Lunde","email":"jared.lunde@gmail.com","url":"https://jaredLunde.com"},"bugs":{"url":"https://github.com/accessible-ui/accordion/issues"},"license":"MIT","readme":"<hr>\n<div align=\"center\">\n  <h1 align=\"center\">\n    &lt;Accordion&gt;\n  </h1>\n</div>\n\n<p align=\"center\">\n  <a href=\"https://bundlephobia.com/result?p=@accessible/accordion\">\n    <img alt=\"Bundlephobia\" src=\"https://img.shields.io/bundlephobia/minzip/@accessible/accordion?style=for-the-badge&labelColor=24292e\">\n  </a>\n  <a aria-label=\"Types\" href=\"https://www.npmjs.com/package/@accessible/accordion\">\n    <img alt=\"Types\" src=\"https://img.shields.io/npm/types/@accessible/accordion?style=for-the-badge&labelColor=24292e\">\n  </a>\n  <a aria-label=\"Code coverage report\" href=\"https://codecov.io/gh/accessible-ui/accordion\">\n    <img alt=\"Code coverage\" src=\"https://img.shields.io/codecov/c/gh/accessible-ui/accordion?style=for-the-badge&labelColor=24292e\">\n  </a>\n  <a aria-label=\"Build status\" href=\"https://travis-ci.org/accessible-ui/accordion\">\n    <img alt=\"Build status\" src=\"https://img.shields.io/travis/accessible-ui/accordion?style=for-the-badge&labelColor=24292e\">\n  </a>\n  <a aria-label=\"NPM version\" href=\"https://www.npmjs.com/package/@accessible/accordion\">\n    <img alt=\"NPM Version\" src=\"https://img.shields.io/npm/v/@accessible/accordion?style=for-the-badge&labelColor=24292e\">\n  </a>\n  <a aria-label=\"License\" href=\"https://jaredlunde.mit-license.org/\">\n    <img alt=\"MIT License\" src=\"https://img.shields.io/npm/l/@accessible/accordion?style=for-the-badge&labelColor=24292e\">\n  </a>\n</p>\n\n<pre align=\"center\">npm i @accessible/accordion</pre>\n<hr>\n\nAn accessible and versatile accordion for React with keyboard navigation and labeling features taught in\n[w3.org's WAI-ARIA accordion best practices example](https://www.w3.org/TR/wai-aria-practices/examples/accordion/accordion.html).\n\n## Features\n\n- **Style-agnostic** You can use this component with the styling library of your choice. It\n  works with CSS-in-JS, SASS, plain CSS, plain `style` objects, anything!\n- **a11y/aria-compliant** This component works with screen readers out of the box and manages\n  focus for you.\n\n## Quick Start\n\n[Check out the example on CodeSandbox](https://codesandbox.io/s/accessibleaccordion-example-7ylck)\n\n```jsx harmony\nimport {Accordion, Section, Trigger, Panel} from '@accessible/accordion'\n\nconst Component = () => (\n  <Accordion defaultOpen={0}>\n    <Section>\n      <h3>\n        <Trigger>\n          <button>Section 1</button>\n        </Trigger>\n      </h3>\n      <Panel>\n        <div className=\"panel\">Section 1 content</div>\n      </Panel>\n    </Section>\n\n    <Section>\n      <h3>\n        <Trigger>\n          <button>Section 2</button>\n        </Trigger>\n      </h3>\n      <Panel>\n        <div className=\"panel\">Section 2 content</div>\n      </Panel>\n    </Section>\n  </Accordion>\n)\n```\n\n## API\n\n### Components\n\n| Component                   | Description                                                                                                                                                      |\n| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [`<Accordion>`](#accordion) | This component creates the context for your accordion section and contains some configuration options.                                                           |\n| [`<Section>`](#section)     | This component creates the context for the accordion panel and trigger contained in this section. It must be a direct descendent of [`<Accordion>`](#accordion). |\n| [`<Trigger>`](#trigger)     | This component clones any React element and turns it into a accordion trigger that controls the visible state of the panel.                                      |\n| [`<Panel>`](#panel)         | This component clones any React element and turns it into a accordion panel.                                                                                     |\n| [`<Close>`](#close)         | This is a convenience component that clones any React element and adds an onClick handler to close its parent panel.                                             |  |\n\n### Hooks\n\n| Hook                              | Description                                                                                                           |\n| --------------------------------- | --------------------------------------------------------------------------------------------------------------------- |\n| [`useAccordion()`](#useaccordion) | This hook returns the value of the accordion's [AccordionContext object](#accordioncontextvalue).                     |\n| [`useSection()`](#usesection)     | This hook returns the value of the accordion [`<Section>`'s](#section) [SectionContext object](#sectioncontextvalue). |\n| [`useControls()`](#usecontrols)   | This hook returns the accordion [`<Section>`'s](#section) `open`, `close`, and `toggle` functions.                    |\n| [`useDisabled()`](#usedisabled)   | This hook returns the accordion [`<Section>`'s](#section) `disabled` value.                                           |\n| [`useIsOpen()`](#useisopen)       | This hook returns the accordion [`<Section>`'s](#section) `isOpen` value.                                             |\n\n### `<Accordion>`\n\nThis component creates the context for your accordion section and contains some configuration options.\n[`<Section>`s](#section) are the only type of children allowed.\n\n#### Props\n\n| Prop              | Type                                                  | Default     | Required? | Description                                                                                                                                                                      |\n| ----------------- | ----------------------------------------------------- | ----------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| defaultOpen       | <code>number &#124; number[]</code>                   | `undefined` | No        | The section by index (or sections if `allowMultipleOpen`) you want opened by default.                                                                                            |\n| open              | <code>number &#124; number[]</code>                   | `undefined` | No        | Makes this a controlled component where `open`, `close`, `toggle`, controls have no effect. The sections defined here are always the ones that are open.                         |\n| allowMultipleOpen | `boolean`                                             | `false`     | No        | Allows multiple sections to be opened at one time.                                                                                                                               |\n| allowAllClosed    | `boolean`                                             | `false`     | No        | Allows all of the sections to be closed. If `false`, you must define either the `open` or `defaultOpen` property.                                                                |\n| onChange          | <code>(opened: number &#124; number[]) => void</code> | `undefined` | No        | Called each time the open sections change. If `allowMultipleOpen`, the argument will be an array, otherwise a single number. The number corresponds to the open section's index. |\n| children          | `React.ReactElement<SectionProps>[]`                  | `undefined` | Yes       | The only children allowed by this component are [`<Section>`s](#section).                                                                                                        |\n\n### `<Section>`\n\nThis component creates the context for the accordion panel and trigger contained in this section. It must be a direct\ndescendent of [`<Accordion>`](#accordion).\n\n#### Props\n\n| Prop     | Type                                                                                    | Default     | Required? | Description                                                                                                      |\n| -------- | --------------------------------------------------------------------------------------- | ----------- | --------- | ---------------------------------------------------------------------------------------------------------------- |\n| id       | `string`                                                                                | `undefined` | No        | Overrides the ID that is auto-generated by this component.                                                       |\n| disabled | `boolean`                                                                               | `false`     | No        | `true` if the section should not be allowed to have its `open` state changed.                                    |\n| children | <code>React.ReactNode &#124; ((context: SectionContextValue) => React.ReactNode)</code> | `undefined` | Yes       | Sections must include a [`<Trigger>`](#trigger) and a [`Panel`](#panel) in addition to anything else you'd like. |\n\n### `<Trigger>`\n\nThis component clones any React element and turns it into a accordion trigger that controls the visible state of\nthe [`<Panel>`](#panel). It must be a child of [`<Section>`](#section).\n\n#### Props\n\n| Prop        | Type                  | Default     | Required? | Description                                                                                                                                                                                             |\n| ----------- | --------------------- | ----------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| openClass   | `string`              | `undefined` | No        | This class name will be applied to the child element when the section is `open`.                                                                                                                        |\n| closedClass | `string`              | `undefined` | No        | This class name will be applied to the child element when the section is `closed`.                                                                                                                      |\n| openStyle   | `React.CSSProperties` | `undefined` | No        | These styles will be applied to the child element when the section is `open`.                                                                                                                           |\n| closedStyle | `React.CSSProperties` | `undefined` | No        | These styles will be applied to the child element when the section is `closed`.                                                                                                                         |\n| children    | `React.ReactElement`  | `undefined` | Yes       | The child is cloned by this component and has aria attributes injected into its props as well as keyboard events for opening the section with `space` and `enter` keys and navigating between sections. |\n\n### `<Panel>`\n\nThis component clones any React element and turns it into a accordion section panel. It must be\na child of [`<Section>`](#section).\n\n#### Props\n\n| Prop        | Type                  | Default     | Required? | Description                                                                                                                                                     |\n| ----------- | --------------------- | ----------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| openClass   | `string`              | `undefined` | No        | This class name will be applied to the child element when the section is `open`.                                                                                |\n| closedClass | `string`              | `undefined` | No        | This class name will be applied to the child element when the section is `closed`.                                                                              |\n| openStyle   | `React.CSSProperties` | `undefined` | No        | These styles will be applied to the child element when the section is `open`.                                                                                   |\n| closedStyle | `React.CSSProperties` | `undefined` | No        | These styles will be applied to the child element when the section is `closed`.                                                                                 |\n| children    | `React.ReactElement`  | `undefined` | Yes       | The child is cloned by this component and has aria attributes injected into its props as well as keyboard events for closing the section with the `escape` key. |\n\n### `<Close>`\n\nThis is a convenience component that clones any React element and adds an onClick handler to close its parent panel. It\nmust be a child of [`<Section>`](#section).\n\n#### Props\n\n| Prop     | Type                 | Default     | Required? | Description                                                                                                                                                                    |\n| -------- | -------------------- | ----------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| children | `React.ReactElement` | `undefined` | Yes       | The child is cloned by this component and has aria attributes injected into its props as keyboard events to ensure it acts like a button even if it isn't a native `<button>`. |\n\n### `useAccordion()`\n\nThis hook returns the value of the accordion's [AccordionContext object](#accordioncontextvalue). This hook\nmust be within a child of [`<Accordion>`](#accordion).\n\n### `AccordionContextValue`\n\n```typescript jsx\ninterface AccordionContextValue {\n  // DOM references to the accordion sections\n  sections: (HTMLElement | undefined)[]\n  // Registers a new accordion section\n  registerSection: (index: number, trigger: HTMLElement) => () => void\n  // The indexes of the open sections\n  opened: number[]\n  // Opens a section\n  open: (section: number | undefined) => void\n  // Closes a section\n  close: (section: number | undefined) => void\n  // Returns true if a section is open\n  isOpen: (section: number | undefined) => boolean\n  // Does the accordion allow all of its sections to be closed?\n  allowAllClosed: boolean\n}\n```\n\n### `useSection()`\n\nThis hook returns the value of the accordion sections's [SectionContextValue object](#sectioncontextvalue). This hook\nmust be within a child of [`<Section>`](#section).\n\n### `SectionContextValue`\n\n```typescript jsx\ninterface SectionContextValue {\n  // Is this section open?\n  isOpen: boolean\n  // Opens this section if not disabled\n  open: () => void\n  // Closes this section if possible\n  close: () => void\n  // Toggles the visible state of this section if possible\n  toggle: () => void\n  // The id of this section\n  id?: string\n  // The index of this section\n  index: number\n  // Is the section disabled?\n  disabled: boolean\n  // The DOM reference to the section's <Trigger>\n  triggerRef: React.MutableRefObject<HTMLElement | null>\n}\n```\n\n### `useControls()`\n\nThis hook returns the accordion sections's `open`, `close`, and `toggle` functions. This hook\nmust be within a child of [`<Section>`](#section).\n\n### `useDisabled()`\n\nThis hook returns the accordion sections's `disabled` value. This hook\nmust be within a child of [`<Section>`](#section).\n\n### `useIsOpen()`\n\nThis hook returns the accordion sections's `isOpen` value. This hook\nmust be within a child of [`<Section>`](#section).\n\n## LICENSE\n\nMIT\n","readmeFilename":"README.md"}