{"name":"@reach/alert","version":"0.18.0-pre.4","description":"Screen-reader-friendly alert messages.","author":{"name":"React Training","email":"hello@reacttraining.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/reach/reach-ui.git","directory":"packages/alert"},"dependencies":{"@reach/polymorphic":"0.18.0-pre.4","@reach/utils":"0.18.0-pre.4","@reach/visually-hidden":"0.18.0-pre.4"},"devDependencies":{"@reach-internal/dev":"0.0.0","@reach-internal/test":"0.0.0","@reach-internal/tsconfig":"0.0.0","react":"^17.0.2","react-dom":"^17.0.2","tsup":"^6.1.3"},"peerDependencies":{"react":"^16.8.0 || 17.x","react-dom":"^16.8.0 || 17.x"},"main":"./dist/reach-alert.cjs.js","types":"./dist/reach-alert.d.ts","publishConfig":{"access":"public"},"module":"./dist/reach-alert.mjs","scripts":{"build":"tsup"},"readme":"# @reach/alert\n\n[![Stable release](https://img.shields.io/npm/v/@reach/alert.svg)](https://npm.im/@reach/alert) ![MIT license](https://badgen.now.sh/badge/license/MIT)\n\n[Docs](https://reach.tech/alert) | [Source](https://github.com/reach/reach-ui/tree/main/packages/alert) | [WAI-ARIA](https://www.w3.org/TR/wai-aria-practices-1.2/#alert)\n\nScreen-reader-friendly alert messages. In many apps developers add \"alert\" messages when network events or other things happen. Users with assistive technologies may not know about the message unless you develop for it.\n\nThe Alert component will announce to assistive technologies whatever you render to the screen. If you don't have a screen reader on you won't notice a difference between rendering `<Alert>` vs. a `<div>`.\n\n```jsx\nfunction Example(props) {\n\tconst [messages, setMessages] = React.useState([]);\n\treturn (\n\t\t<div>\n\t\t\t<button\n\t\t\t\tonClick={() => {\n\t\t\t\t\tsetMessages((prevMessages) =>\n\t\t\t\t\t\tprevMessages.concat([`Message #${prevMessages.length + 1}`])\n\t\t\t\t\t);\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tsetMessages((prevMessages) => prevMessages.slice(1));\n\t\t\t\t\t}, 5000);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\tAdd a message\n\t\t\t</button>\n\t\t\t<div>\n\t\t\t\t{messages.map((message, index) => (\n\t\t\t\t\t<Alert key={index}>{message}</Alert>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/reach/reach-ui/issues"},"homepage":"https://github.com/reach/reach-ui#readme","_id":"@reach/alert@0.18.0-pre.4","_integrity":"sha512-+QSq72HD0avJ+3fNR6yOnrC47zlvE+MT9oiWt5Fcx/Zu5amaCZ2nRj9mfPwjz7r8ZTz9YRfy5Vzl6erTx9nl9w==","_resolved":"/tmp/868857984bb6e72fcf9f9088ae5c8b61/reach-alert-0.18.0-pre.4.tgz","_from":"file:reach-alert-0.18.0-pre.4.tgz","_nodeVersion":"18.10.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-+QSq72HD0avJ+3fNR6yOnrC47zlvE+MT9oiWt5Fcx/Zu5amaCZ2nRj9mfPwjz7r8ZTz9YRfy5Vzl6erTx9nl9w==","shasum":"907c56cb2dfd5634fc0fd50207be1f6986bfd0fa","tarball":"http://registry-npm.ywwl.com/@reach/alert/download/@reach/alert-0.18.0-pre.4.tgz","fileCount":10,"unpackedSize":28942,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDepK34S1oh/0LQJtb239cFdEcvDWoihCxvtOAjSSmBIAIgLmmj76r8AbwS/GrOEEQBJEamR1ZcdP/WZQ85gEWVQyM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRh/IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNnA/8C0fMlaD1iI7h876sr6Q48U1FLjimDAYRuiGbhhTGIBz3gcbl\r\n66eOgApDv8XSemjxgbdBJuJLaiQc7uQfuZlWe5UZErGKhmu5KuVPe5INx9b3\r\n/0PHvL+amBSS9r/hL9Nf1amyuyVKi8/2OqufZOF8b2DpV0BYdFCwWpZJJPPo\r\nRQ4E+/z92lmvFHvoVB2CXzML+QzKU5IOUtHeQ5DxdLtGJcnfCklMVogmkR6E\r\npg+3g6vowC+eLloSvMcmqShz8KjvNBRV/I79YN6XYQouXA4TtbOFME2+TNG8\r\nKo+f7r2pULIR/shcCDid4c9q2HLvme3ytJzFwlp6ngudnphf4I3eShAjd4um\r\n61HGqjPqyy3T2lvmhCvoDGwfUgF2cs2IgxRw1Dl+i5JisE4S8uADzQzYZYxv\r\ndtMK6T5NNuJoYL0/UG+lRDkedK73BtONlm+UOv3UUQMFAF6UW0k1ko6Fy3vv\r\nTVxPjs+A0AYHIyyQSijsb+L12c6lQiuYYUxQeItpNhw4nL1wfZfJW1m2FXUV\r\nCdQqGwtb+tw2FrLafwOmWDF7D8ZOgDnSGIi2CV+CiyIzgpvDsv53m3YqPR56\r\nPaHPacYkzdafA6g/bJHwMiAD6SyKG0JzxbF4MYVXE/UY6Nhj5SALso0Z230l\r\ndynJFWJE1a+UotEqn4tLiY9JrQCFYEpSbbs=\r\n=8Yuv\r\n-----END PGP SIGNATURE-----\r\n","size":8960,"noattachment":false,"key":"/@reach/alert/-/@reach/alert-0.18.0-pre.4.tgz"},"_npmUser":{"name":"chancestrickland","email":"hi@chance.dev"},"directories":{},"maintainers":[{"name":"ryanflorence","email":"rpflorence@gmail.com"},{"name":"mjackson","email":"npm@mjackson.me"},{"name":"chancestrickland","email":"hi@chance.dev"},{"name":"blainekasten","email":"blainekasten@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/alert_0.18.0-pre.4_1665540040461_0.2853831632863524"},"_hasShrinkwrap":false,"publish_time":1665540040616,"_cnpm_publish_time":1665540040616,"dist-tags":{"latest":"0.18.0","next":"0.4.0-beta.0","pre":"0.18.0-pre.5"}}