@arc-ui/components 11.6.0 → 11.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Alert/Alert.cjs.d.ts +1 -1
- package/dist/Alert/Alert.cjs.js +12 -91
- package/dist/Alert/Alert.esm.d.ts +1 -1
- package/dist/Alert/Alert.esm.js +5 -84
- package/dist/Badge/Badge.cjs.js +4 -4
- package/dist/Badge/Badge.esm.js +5 -5
- package/dist/Box/Box.cjs.d.ts +40 -0
- package/dist/Box/Box.cjs.js +32 -0
- package/dist/Box/Box.esm.d.ts +40 -0
- package/dist/Box/Box.esm.js +24 -0
- package/dist/Box/package.json +7 -0
- package/dist/BrandLogo/BrandLogo.cjs.d.ts +1 -1
- package/dist/BrandLogo/BrandLogo.cjs.js +2 -2
- package/dist/BrandLogo/BrandLogo.esm.d.ts +1 -1
- package/dist/BrandLogo/BrandLogo.esm.js +2 -2
- package/dist/Breadcrumbs/Breadcrumbs.cjs.d.ts +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.cjs.js +4 -4
- package/dist/Breadcrumbs/Breadcrumbs.esm.d.ts +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +4 -4
- package/dist/Button/Button.cjs.d.ts +1 -1
- package/dist/Button/Button.cjs.js +3 -3
- package/dist/Button/Button.esm.d.ts +1 -1
- package/dist/Button/Button.esm.js +3 -3
- package/dist/Card/Card.cjs.d.ts +1 -1
- package/dist/Card/Card.cjs.js +5 -5
- package/dist/Card/Card.esm.d.ts +1 -1
- package/dist/Card/Card.esm.js +5 -5
- package/dist/Checkbox/Checkbox.cjs.d.ts +1 -1
- package/dist/Checkbox/Checkbox.cjs.js +5 -5
- package/dist/Checkbox/Checkbox.esm.d.ts +1 -1
- package/dist/Checkbox/Checkbox.esm.js +5 -5
- package/dist/Columns/Columns.cjs.d.ts +1 -1
- package/dist/Columns/Columns.esm.d.ts +1 -1
- package/dist/Curve/Curve.cjs.d.ts +1 -1
- package/dist/Curve/Curve.cjs.js +1 -1
- package/dist/Curve/Curve.esm.d.ts +1 -1
- package/dist/Curve/Curve.esm.js +1 -1
- package/dist/Disclosure/Disclosure.cjs.d.ts +1 -1
- package/dist/Disclosure/Disclosure.cjs.js +2 -2
- package/dist/Disclosure/Disclosure.esm.d.ts +1 -1
- package/dist/Disclosure/Disclosure.esm.js +2 -2
- package/dist/DisclosureMini/DisclosureMini.cjs.d.ts +1 -1
- package/dist/DisclosureMini/DisclosureMini.cjs.js +3 -3
- package/dist/DisclosureMini/DisclosureMini.esm.d.ts +1 -1
- package/dist/DisclosureMini/DisclosureMini.esm.js +3 -3
- package/dist/Filter/Filter.cjs.d.ts +1 -1
- package/dist/Filter/Filter.cjs.js +2 -2
- package/dist/Filter/Filter.esm.d.ts +1 -1
- package/dist/Filter/Filter.esm.js +2 -2
- package/dist/FormControl/FormControl.cjs.d.ts +1 -1
- package/dist/FormControl/FormControl.cjs.js +4 -4
- package/dist/FormControl/FormControl.esm.d.ts +1 -1
- package/dist/FormControl/FormControl.esm.js +4 -4
- package/dist/Group/Group.cjs.d.ts +1 -1
- package/dist/Group/Group.cjs.js +2 -2
- package/dist/Group/Group.esm.d.ts +1 -1
- package/dist/Group/Group.esm.js +2 -2
- package/dist/Heading/Heading.cjs.d.ts +1 -1
- package/dist/Heading/Heading.cjs.js +2 -2
- package/dist/Heading/Heading.esm.d.ts +1 -1
- package/dist/Heading/Heading.esm.js +2 -2
- package/dist/Icon/Icon.cjs.d.ts +1 -1
- package/dist/Icon/Icon.cjs.js +2 -2
- package/dist/Icon/Icon.esm.d.ts +1 -1
- package/dist/Icon/Icon.esm.js +2 -2
- package/dist/Image/Image.cjs.d.ts +1 -1
- package/dist/Image/Image.cjs.js +2 -1
- package/dist/Image/Image.esm.d.ts +1 -1
- package/dist/Image/Image.esm.js +1 -1
- package/dist/Markup/Markup.cjs.js +1 -1
- package/dist/Markup/Markup.esm.js +1 -1
- package/dist/Modal/Modal.cjs.d.ts +53 -0
- package/dist/Modal/Modal.cjs.js +677 -0
- package/dist/Modal/Modal.esm.d.ts +53 -0
- package/dist/Modal/Modal.esm.js +669 -0
- package/dist/Modal/package.json +7 -0
- package/dist/Pagination/Pagination.cjs.js +6 -6
- package/dist/Pagination/Pagination.esm.js +6 -6
- package/dist/PaginationSimple/PaginationSimple.cjs.js +6 -6
- package/dist/PaginationSimple/PaginationSimple.esm.js +6 -6
- package/dist/Poster/Poster.cjs.d.ts +1 -1
- package/dist/Poster/Poster.cjs.js +3 -3
- package/dist/Poster/Poster.esm.d.ts +1 -1
- package/dist/Poster/Poster.esm.js +3 -3
- package/dist/ProgressBar/ProgressBar.cjs.js +7 -7
- package/dist/ProgressBar/ProgressBar.esm.js +8 -8
- package/dist/ProgressStepper/ProgressStepper.cjs.d.ts +89 -0
- package/dist/ProgressStepper/ProgressStepper.cjs.js +152 -0
- package/dist/ProgressStepper/ProgressStepper.esm.d.ts +89 -0
- package/dist/ProgressStepper/ProgressStepper.esm.js +144 -0
- package/dist/ProgressStepper/package.json +7 -0
- package/dist/RadioGroup/RadioGroup.cjs.d.ts +1 -1
- package/dist/RadioGroup/RadioGroup.cjs.js +5 -5
- package/dist/RadioGroup/RadioGroup.esm.d.ts +1 -1
- package/dist/RadioGroup/RadioGroup.esm.js +5 -5
- package/dist/Rule/Rule.cjs.js +1 -1
- package/dist/Rule/Rule.esm.js +1 -1
- package/dist/ScrollToTop/ScrollToTop.cjs.js +2 -2
- package/dist/ScrollToTop/ScrollToTop.esm.js +2 -2
- package/dist/Select/Select.cjs.d.ts +1 -1
- package/dist/Select/Select.cjs.js +453 -916
- package/dist/Select/Select.esm.d.ts +1 -1
- package/dist/Select/Select.esm.js +419 -882
- package/dist/SiteFooter/SiteFooter.cjs.d.ts +1 -1
- package/dist/SiteFooter/SiteFooter.cjs.js +4 -4
- package/dist/SiteFooter/SiteFooter.esm.d.ts +1 -1
- package/dist/SiteFooter/SiteFooter.esm.js +5 -5
- package/dist/SiteHeader/SiteHeader.cjs.d.ts +1 -1
- package/dist/SiteHeader/SiteHeader.cjs.js +6 -6
- package/dist/SiteHeader/SiteHeader.esm.d.ts +1 -1
- package/dist/SiteHeader/SiteHeader.esm.js +6 -6
- package/dist/Surface/Surface.cjs.d.ts +1 -1
- package/dist/Surface/Surface.cjs.js +1 -1
- package/dist/Surface/Surface.esm.d.ts +1 -1
- package/dist/Surface/Surface.esm.js +1 -1
- package/dist/Switch/Switch.cjs.d.ts +1 -1
- package/dist/Switch/Switch.cjs.js +242 -18
- package/dist/Switch/Switch.esm.d.ts +1 -1
- package/dist/Switch/Switch.esm.js +236 -12
- package/dist/Tabs/Tabs.cjs.d.ts +75 -0
- package/dist/Tabs/Tabs.cjs.js +514 -0
- package/dist/Tabs/Tabs.esm.d.ts +75 -0
- package/dist/Tabs/Tabs.esm.js +506 -0
- package/dist/Tabs/package.json +7 -0
- package/dist/Tag/Tag.cjs.js +2 -2
- package/dist/Tag/Tag.esm.js +2 -2
- package/dist/Text/Text.cjs.d.ts +1 -1
- package/dist/Text/Text.cjs.js +2 -2
- package/dist/Text/Text.esm.d.ts +1 -1
- package/dist/Text/Text.esm.js +2 -2
- package/dist/TextArea/TextArea.cjs.d.ts +4 -1
- package/dist/TextArea/TextArea.cjs.js +22 -21
- package/dist/TextArea/TextArea.esm.d.ts +4 -1
- package/dist/TextArea/TextArea.esm.js +22 -21
- package/dist/TextInput/TextInput.cjs.d.ts +1 -1
- package/dist/TextInput/TextInput.cjs.js +5 -5
- package/dist/TextInput/TextInput.esm.d.ts +1 -1
- package/dist/TextInput/TextInput.esm.js +5 -5
- package/dist/Toast/Toast.cjs.d.ts +52 -0
- package/dist/Toast/Toast.cjs.js +743 -0
- package/dist/Toast/Toast.esm.d.ts +52 -0
- package/dist/Toast/Toast.esm.js +735 -0
- package/dist/Toast/package.json +7 -0
- package/dist/Truncate/Truncate.cjs.js +3 -2
- package/dist/Truncate/Truncate.esm.js +3 -2
- package/dist/UniversalHeader/UniversalHeader.cjs.d.ts +1 -1
- package/dist/UniversalHeader/UniversalHeader.cjs.js +2 -2
- package/dist/UniversalHeader/UniversalHeader.esm.d.ts +1 -1
- package/dist/UniversalHeader/UniversalHeader.esm.js +2 -2
- package/dist/_shared/cjs/{BrandLogo-8008f0c4.js → BrandLogo-8107d59f.js} +1 -1
- package/dist/_shared/cjs/{Breadcrumbs-8b554370.js → Breadcrumbs-0906dd10.js} +10 -10
- package/dist/_shared/cjs/BtIconTick-42fcc5ec.js +91 -0
- package/dist/_shared/cjs/{Button-27512fee.d.ts → Button-5aaa6776.d.ts} +4 -0
- package/dist/_shared/cjs/{Button-27512fee.js → Button-5aaa6776.js} +4 -4
- package/dist/_shared/cjs/{Card-804ab0e5.js → Card-fd189ba8.js} +4 -4
- package/dist/_shared/cjs/{Checkbox-21d3c4f6.js → Checkbox-02c546ca.js} +2 -2
- package/dist/_shared/cjs/Columns-e90798f8.d.ts +1 -1
- package/dist/_shared/cjs/{Curve-b05589d8.d.ts → Curve-781ef633.d.ts} +5 -2
- package/dist/_shared/cjs/{Curve-b05589d8.js → Curve-781ef633.js} +5 -2
- package/dist/_shared/cjs/{DisclosureMini-067e0319.js → DisclosureMini-52706ee6.js} +2 -2
- package/dist/_shared/cjs/{Filter-f7d2fbda.js → Filter-a7574fe7.js} +1 -1
- package/dist/_shared/cjs/{FormControl-9aaddd54.js → FormControl-1e1bf2bf.js} +2 -2
- package/dist/_shared/cjs/{Group-d83f8c2e.js → Group-f85dd4c0.js} +1 -1
- package/dist/_shared/cjs/{Heading-d45f6a7f.d.ts → Heading-e3332dcf.d.ts} +4 -0
- package/dist/_shared/cjs/{Heading-d45f6a7f.js → Heading-e3332dcf.js} +3 -3
- package/dist/_shared/cjs/{Icon-9ae8dbe1.js → Icon-e1dd45eb.js} +1 -1
- package/dist/_shared/cjs/{Image-3bf4b4f3.js → Image-0e393cbf.js} +2 -0
- package/dist/_shared/cjs/{Poster-e05bbe13.d.ts → Poster-faea1ad3.d.ts} +1 -1
- package/dist/_shared/cjs/{Poster-e05bbe13.js → Poster-faea1ad3.js} +2 -2
- package/dist/_shared/{esm/RadioGroup-1fd0f389.d.ts → cjs/RadioGroup-d7664b0c.d.ts} +1 -1
- package/dist/_shared/cjs/{RadioGroup-81805ef9.js → RadioGroup-d7664b0c.js} +2 -2
- package/dist/_shared/cjs/{SiteFooter-c540b5f1.js → SiteFooter-5da774e1.js} +3 -3
- package/dist/_shared/cjs/SiteHeader-c25ee36e.d.ts +3 -3
- package/dist/_shared/cjs/{SiteHeader.rehydrator-f7fa2efe.js → SiteHeader.rehydrator-acc9d8c4.js} +4 -4
- package/dist/_shared/cjs/{Surface-6da0a78e.d.ts → Surface-b7c51b2b.d.ts} +3 -2
- package/dist/_shared/cjs/{Surface-6da0a78e.js → Surface-b7c51b2b.js} +1 -1
- package/dist/_shared/{esm/Text-00e9743b.d.ts → cjs/Text-fa447e2d.d.ts} +4 -0
- package/dist/_shared/cjs/{Text-6f2827e6.js → Text-fa447e2d.js} +3 -3
- package/dist/_shared/{esm/TextInput-7ed03a48.d.ts → cjs/TextInput-13050538.d.ts} +3 -1
- package/dist/_shared/{esm/TextInput-1631dbc4.d.ts → cjs/TextInput-f4549637.d.ts} +1 -1
- package/dist/_shared/cjs/{TextInput-33314fc4.js → TextInput-f4549637.js} +2 -2
- package/dist/_shared/cjs/{UniversalHeader-cc1d9e5a.js → UniversalHeader-da622e1a.js} +1 -1
- package/dist/_shared/cjs/extends-bb8ffacd.js +21 -0
- package/dist/_shared/cjs/index-27b53d49.js +174 -0
- package/dist/_shared/cjs/index-699086a7.d.ts +1 -1
- package/dist/_shared/cjs/index-74488a9f.d.ts +1 -1
- package/dist/_shared/cjs/{index.module-af7c85f2.js → index-952918c9.js} +199 -110
- package/dist/_shared/cjs/index-96c4d581.js +289 -0
- package/dist/_shared/cjs/index-c81c9401.d.ts +3 -3
- package/dist/_shared/cjs/index-e340924e.d.ts +1 -1
- package/dist/_shared/cjs/index-e6d20018.d.ts +1 -1
- package/dist/_shared/cjs/index-eb06f640.d.ts +1 -1
- package/dist/_shared/cjs/index-ec260f5e.js +869 -0
- package/dist/_shared/cjs/index-f419cf04.d.ts +1 -1
- package/dist/_shared/cjs/index-fb4b8fda.js +47 -0
- package/dist/_shared/cjs/index.module-bbcc4e18.js +126 -0
- package/dist/_shared/esm/{BrandLogo-56699561.js → BrandLogo-9ec620e8.js} +1 -1
- package/dist/_shared/esm/{Breadcrumbs-04590057.js → Breadcrumbs-dafa8dde.js} +10 -10
- package/dist/_shared/esm/BtIconTick-5fe50cc7.js +83 -0
- package/dist/_shared/esm/{Button-d319fa11.d.ts → Button-d1dbcf79.d.ts} +4 -0
- package/dist/_shared/esm/{Button-d319fa11.js → Button-d1dbcf79.js} +4 -4
- package/dist/_shared/esm/{Card-e79eb6c8.js → Card-e62c3ff6.js} +4 -4
- package/dist/_shared/esm/{Checkbox-94300d8c.js → Checkbox-d8891198.js} +2 -2
- package/dist/_shared/esm/Columns-8704515b.d.ts +1 -1
- package/dist/_shared/esm/{Curve-3e87b1bc.d.ts → Curve-bbc5589c.d.ts} +5 -2
- package/dist/_shared/esm/{Curve-3e87b1bc.js → Curve-bbc5589c.js} +5 -2
- package/dist/_shared/esm/{DisclosureMini-022beae3.js → DisclosureMini-9b819941.js} +2 -2
- package/dist/_shared/esm/{Filter-41b391e3.js → Filter-a01aed11.js} +1 -1
- package/dist/_shared/esm/{FormControl-5e3fdca3.js → FormControl-f18e2f59.js} +2 -2
- package/dist/_shared/esm/{Group-d62c3f56.js → Group-fb26fd32.js} +1 -1
- package/dist/_shared/esm/{Heading-b61432fb.d.ts → Heading-0f629151.d.ts} +4 -0
- package/dist/_shared/esm/{Heading-b61432fb.js → Heading-0f629151.js} +3 -3
- package/dist/_shared/esm/{Icon-fd247973.js → Icon-c1af47bc.js} +1 -1
- package/dist/_shared/esm/{Image-3596ce55.js → Image-3ed3863c.js} +2 -1
- package/dist/_shared/esm/{Poster-107d6954.d.ts → Poster-a83ae770.d.ts} +1 -1
- package/dist/_shared/esm/{Poster-107d6954.js → Poster-a83ae770.js} +2 -2
- package/dist/_shared/{cjs/RadioGroup-81805ef9.d.ts → esm/RadioGroup-be16d5d3.d.ts} +1 -1
- package/dist/_shared/esm/{RadioGroup-1fd0f389.js → RadioGroup-be16d5d3.js} +2 -2
- package/dist/_shared/esm/{SiteFooter-8075a9bd.js → SiteFooter-a182cb18.js} +3 -3
- package/dist/_shared/esm/SiteHeader-c25ee36e.d.ts +3 -3
- package/dist/_shared/esm/{SiteHeader.rehydrator-4da8ac64.js → SiteHeader.rehydrator-023b7b76.js} +4 -4
- package/dist/_shared/esm/{Surface-bb100ef8.d.ts → Surface-dde51789.d.ts} +3 -2
- package/dist/_shared/esm/{Surface-bb100ef8.js → Surface-dde51789.js} +1 -1
- package/dist/_shared/{cjs/Text-6f2827e6.d.ts → esm/Text-40457811.d.ts} +4 -0
- package/dist/_shared/esm/{Text-00e9743b.js → Text-40457811.js} +3 -3
- package/dist/_shared/{cjs/TextInput-7ed03a48.d.ts → esm/TextInput-13050538.d.ts} +3 -1
- package/dist/_shared/{cjs/TextInput-33314fc4.d.ts → esm/TextInput-4424c195.d.ts} +1 -1
- package/dist/_shared/esm/{TextInput-1631dbc4.js → TextInput-4424c195.js} +2 -2
- package/dist/_shared/esm/{UniversalHeader-7926abde.js → UniversalHeader-1c5a886d.js} +1 -1
- package/dist/_shared/esm/extends-4575346e.js +19 -0
- package/dist/_shared/esm/{index.module-599b86dd.js → index-22aad354.js} +196 -105
- package/dist/_shared/esm/index-369dce7f.js +847 -0
- package/dist/_shared/esm/index-699086a7.d.ts +1 -1
- package/dist/_shared/esm/index-74488a9f.d.ts +1 -1
- package/dist/_shared/esm/index-8000d9e3.js +168 -0
- package/dist/_shared/esm/index-94ecc5f8.js +280 -0
- package/dist/_shared/esm/index-bed18a88.js +26 -0
- package/dist/_shared/esm/index-c81c9401.d.ts +3 -3
- package/dist/_shared/esm/index-e340924e.d.ts +1 -1
- package/dist/_shared/esm/index-e6d20018.d.ts +1 -1
- package/dist/_shared/esm/index-eb06f640.d.ts +1 -1
- package/dist/_shared/esm/index-f419cf04.d.ts +1 -1
- package/dist/_shared/esm/index.module-5ed90b21.js +122 -0
- package/dist/index.es.js +2808 -1035
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +3015 -1241
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/Box/Box.d.ts +36 -0
- package/dist/types/components/Box/index.d.ts +1 -0
- package/dist/types/components/Button/Button.d.ts +4 -0
- package/dist/types/components/Columns/Columns.d.ts +1 -1
- package/dist/types/components/Columns/index.d.ts +1 -1
- package/dist/types/components/Curve/Curve.d.ts +5 -2
- package/dist/types/components/Heading/Heading.d.ts +4 -0
- package/dist/types/components/Image/index.d.ts +1 -1
- package/dist/types/components/MediaCard/MediaCard.d.ts +57 -0
- package/dist/types/components/MediaCard/index.d.ts +1 -0
- package/dist/types/components/Modal/Modal.d.ts +31 -9
- package/dist/types/components/ProgressStepper/ProgressStepper.d.ts +28 -0
- package/dist/types/components/ProgressStepper/ProgressStepperItem/ProgressStepperItem.d.ts +62 -0
- package/dist/types/components/ProgressStepper/index.d.ts +1 -0
- package/dist/types/components/ProgressStepper/progressStatus.d.ts +1 -0
- package/dist/types/components/Surface/Surface.d.ts +2 -1
- package/dist/types/components/Surface/index.d.ts +1 -1
- package/dist/types/components/Tabs/Tab/Tab.d.ts +22 -0
- package/dist/types/components/Tabs/Tab/index.d.ts +1 -0
- package/dist/types/components/Tabs/TabContent/TabContent.d.ts +12 -0
- package/dist/types/components/Tabs/TabContent/index.d.ts +1 -0
- package/dist/types/components/Tabs/Tabs.d.ts +27 -0
- package/dist/types/components/Tabs/TabsList/TabsList.d.ts +20 -0
- package/dist/types/components/Tabs/TabsList/index.d.ts +1 -0
- package/dist/types/components/Tabs/index.d.ts +1 -0
- package/dist/types/components/Text/Text.d.ts +4 -0
- package/dist/types/components/TextArea/TextArea.d.ts +3 -0
- package/dist/types/components/TextInput/TextInput.d.ts +2 -0
- package/dist/types/components/Toast/Toast.d.ts +14 -0
- package/dist/types/components/Toast/ToastNotification.d.ts +39 -0
- package/dist/types/components/Toast/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/styles.d.ts +6 -0
- package/package.json +8 -6
- /package/dist/_shared/cjs/{BrandLogo-8008f0c4.d.ts → BrandLogo-8107d59f.d.ts} +0 -0
- /package/dist/_shared/cjs/{Breadcrumbs-8b554370.d.ts → Breadcrumbs-0906dd10.d.ts} +0 -0
- /package/dist/_shared/cjs/{Card-804ab0e5.d.ts → Card-fd189ba8.d.ts} +0 -0
- /package/dist/_shared/cjs/{Checkbox-21d3c4f6.d.ts → Checkbox-02c546ca.d.ts} +0 -0
- /package/dist/_shared/cjs/{DisclosureMini-067e0319.d.ts → DisclosureMini-52706ee6.d.ts} +0 -0
- /package/dist/_shared/cjs/{Filter-f7d2fbda.d.ts → Filter-a7574fe7.d.ts} +0 -0
- /package/dist/_shared/cjs/{FormControl-9aaddd54.d.ts → FormControl-1e1bf2bf.d.ts} +0 -0
- /package/dist/_shared/cjs/{Group-d83f8c2e.d.ts → Group-f85dd4c0.d.ts} +0 -0
- /package/dist/_shared/cjs/{Icon-9ae8dbe1.d.ts → Icon-e1dd45eb.d.ts} +0 -0
- /package/dist/_shared/cjs/{Image-3bf4b4f3.d.ts → Image-0e393cbf.d.ts} +0 -0
- /package/dist/_shared/cjs/{SiteFooter-c540b5f1.d.ts → SiteFooter-5da774e1.d.ts} +0 -0
- /package/dist/_shared/cjs/{SiteHeader.rehydrator-f7fa2efe.d.ts → SiteHeader.rehydrator-acc9d8c4.d.ts} +0 -0
- /package/dist/_shared/cjs/{UniversalHeader-cc1d9e5a.d.ts → UniversalHeader-da622e1a.d.ts} +0 -0
- /package/dist/_shared/esm/{BrandLogo-56699561.d.ts → BrandLogo-9ec620e8.d.ts} +0 -0
- /package/dist/_shared/esm/{Breadcrumbs-04590057.d.ts → Breadcrumbs-dafa8dde.d.ts} +0 -0
- /package/dist/_shared/esm/{Card-e79eb6c8.d.ts → Card-e62c3ff6.d.ts} +0 -0
- /package/dist/_shared/esm/{Checkbox-94300d8c.d.ts → Checkbox-d8891198.d.ts} +0 -0
- /package/dist/_shared/esm/{DisclosureMini-022beae3.d.ts → DisclosureMini-9b819941.d.ts} +0 -0
- /package/dist/_shared/esm/{Filter-41b391e3.d.ts → Filter-a01aed11.d.ts} +0 -0
- /package/dist/_shared/esm/{FormControl-5e3fdca3.d.ts → FormControl-f18e2f59.d.ts} +0 -0
- /package/dist/_shared/esm/{Group-d62c3f56.d.ts → Group-fb26fd32.d.ts} +0 -0
- /package/dist/_shared/esm/{Icon-fd247973.d.ts → Icon-c1af47bc.d.ts} +0 -0
- /package/dist/_shared/esm/{Image-3596ce55.d.ts → Image-3ed3863c.d.ts} +0 -0
- /package/dist/_shared/esm/{SiteFooter-8075a9bd.d.ts → SiteFooter-a182cb18.d.ts} +0 -0
- /package/dist/_shared/esm/{SiteHeader.rehydrator-4da8ac64.d.ts → SiteHeader.rehydrator-023b7b76.d.ts} +0 -0
- /package/dist/_shared/esm/{UniversalHeader-7926abde.d.ts → UniversalHeader-1c5a886d.d.ts} +0 -0
|
@@ -0,0 +1,735 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/esm/filter-data-attrs-afdb7d32.js';
|
|
2
|
+
import React__default, { useLayoutEffect, forwardRef, createElement, useState, useRef, useCallback, useEffect, useMemo, Fragment } from 'react';
|
|
3
|
+
import { _ as _extends } from '../_shared/esm/extends-4575346e.js';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
import { b as $8927f6f2acc4f386$export$250ffa63cdc0d034, d as $c512c27ab02ef895$export$50c7b4e9d9f19c1, a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, $ as $b1b2314f5f9a1d84$export$25bec8c6f54ee79a, g as $e42e1063c40fb3ef$export$b9ecd428b558ff10, h as $8927f6f2acc4f386$export$6d1a0317bde7de7f, e as $71cd76cc60e0454e$export$6f32135080cb4c3, f as $921a889cee6df7e8$export$99c2b779aa4e8b8b } from '../_shared/esm/index-22aad354.js';
|
|
6
|
+
import { $ as $e02a7d9cb1dc128c$export$c74125a8e3af6bb2 } from '../_shared/esm/index-8000d9e3.js';
|
|
7
|
+
import { b as $5cb92bef7577960e$export$aecb2ddcb55c95be, c as $5cb92bef7577960e$export$be92b6f5f03c0fe9, $ as $f1701beae083dbae$export$602eac185826482c } from '../_shared/esm/index-94ecc5f8.js';
|
|
8
|
+
import { c as classNames } from '../_shared/esm/index-2ae58626.js';
|
|
9
|
+
import { B as BtIconCrossAlt2Px_2 } from '../_shared/esm/BtIconCrossAlt2Px-a6a9f431.js';
|
|
10
|
+
import { B as BtIconNotification_2, a as BtIconAlertTriangle_2, b as BtIconTick_2 } from '../_shared/esm/BtIconTick-5fe50cc7.js';
|
|
11
|
+
import { B as BtIconAlert_2 } from '../_shared/esm/BtIconAlert-55a6ed5c.js';
|
|
12
|
+
import { I as Icon } from '../_shared/esm/Icon-c1af47bc.js';
|
|
13
|
+
import '../_shared/esm/suffix-modifier-7e640670.js';
|
|
14
|
+
import '../_shared/esm/Surface-dde51789.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
18
|
+
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
19
|
+
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
20
|
+
*
|
|
21
|
+
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
22
|
+
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
|
|
23
|
+
|
|
24
|
+
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
25
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
|
|
26
|
+
ref: forwardedRef,
|
|
27
|
+
style: {
|
|
28
|
+
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
border: 0,
|
|
31
|
+
width: 1,
|
|
32
|
+
height: 1,
|
|
33
|
+
padding: 0,
|
|
34
|
+
margin: -1,
|
|
35
|
+
overflow: 'hidden',
|
|
36
|
+
clip: 'rect(0, 0, 0, 0)',
|
|
37
|
+
whiteSpace: 'nowrap',
|
|
38
|
+
wordWrap: 'normal',
|
|
39
|
+
...props.style
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/* -------------------------------------------------------------------------------------------------
|
|
45
|
+
* ToastProvider
|
|
46
|
+
* -----------------------------------------------------------------------------------------------*/ const $054eb8030ebde76e$var$PROVIDER_NAME = 'ToastProvider';
|
|
47
|
+
const [$054eb8030ebde76e$var$Collection, $054eb8030ebde76e$var$useCollection, $054eb8030ebde76e$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2('Toast');
|
|
48
|
+
const [$054eb8030ebde76e$var$createToastContext, $054eb8030ebde76e$export$8a359da18fbc9073] = $c512c27ab02ef895$export$50c7b4e9d9f19c1('Toast', [
|
|
49
|
+
$054eb8030ebde76e$var$createCollectionScope
|
|
50
|
+
]);
|
|
51
|
+
const [$054eb8030ebde76e$var$ToastProviderProvider, $054eb8030ebde76e$var$useToastProviderContext] = $054eb8030ebde76e$var$createToastContext($054eb8030ebde76e$var$PROVIDER_NAME);
|
|
52
|
+
const $054eb8030ebde76e$export$f5d03d415824e0e = (props)=>{
|
|
53
|
+
const { __scopeToast: __scopeToast , label: label = 'Notification' , duration: duration = 5000 , swipeDirection: swipeDirection = 'right' , swipeThreshold: swipeThreshold = 50 , children: children } = props;
|
|
54
|
+
const [viewport, setViewport] = useState(null);
|
|
55
|
+
const [toastCount, setToastCount] = useState(0);
|
|
56
|
+
const isFocusedToastEscapeKeyDownRef = useRef(false);
|
|
57
|
+
const isClosePausedRef = useRef(false);
|
|
58
|
+
return /*#__PURE__*/ createElement($054eb8030ebde76e$var$Collection.Provider, {
|
|
59
|
+
scope: __scopeToast
|
|
60
|
+
}, /*#__PURE__*/ createElement($054eb8030ebde76e$var$ToastProviderProvider, {
|
|
61
|
+
scope: __scopeToast,
|
|
62
|
+
label: label,
|
|
63
|
+
duration: duration,
|
|
64
|
+
swipeDirection: swipeDirection,
|
|
65
|
+
swipeThreshold: swipeThreshold,
|
|
66
|
+
toastCount: toastCount,
|
|
67
|
+
viewport: viewport,
|
|
68
|
+
onViewportChange: setViewport,
|
|
69
|
+
onToastAdd: useCallback(()=>setToastCount((prevCount)=>prevCount + 1
|
|
70
|
+
)
|
|
71
|
+
, []),
|
|
72
|
+
onToastRemove: useCallback(()=>setToastCount((prevCount)=>prevCount - 1
|
|
73
|
+
)
|
|
74
|
+
, []),
|
|
75
|
+
isFocusedToastEscapeKeyDownRef: isFocusedToastEscapeKeyDownRef,
|
|
76
|
+
isClosePausedRef: isClosePausedRef
|
|
77
|
+
}, children));
|
|
78
|
+
};
|
|
79
|
+
$054eb8030ebde76e$export$f5d03d415824e0e.propTypes = {
|
|
80
|
+
label (props) {
|
|
81
|
+
if (props.label && typeof props.label === 'string' && !props.label.trim()) {
|
|
82
|
+
const error = `Invalid prop \`label\` supplied to \`${$054eb8030ebde76e$var$PROVIDER_NAME}\`. Expected non-empty \`string\`.`;
|
|
83
|
+
return new Error(error);
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
/* -------------------------------------------------------------------------------------------------
|
|
89
|
+
* ToastViewport
|
|
90
|
+
* -----------------------------------------------------------------------------------------------*/ const $054eb8030ebde76e$var$VIEWPORT_NAME = 'ToastViewport';
|
|
91
|
+
const $054eb8030ebde76e$var$VIEWPORT_DEFAULT_HOTKEY = [
|
|
92
|
+
'F8'
|
|
93
|
+
];
|
|
94
|
+
const $054eb8030ebde76e$var$VIEWPORT_PAUSE = 'toast.viewportPause';
|
|
95
|
+
const $054eb8030ebde76e$var$VIEWPORT_RESUME = 'toast.viewportResume';
|
|
96
|
+
const $054eb8030ebde76e$export$6192c2425ecfd989 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
97
|
+
const { __scopeToast: __scopeToast , hotkey: hotkey = $054eb8030ebde76e$var$VIEWPORT_DEFAULT_HOTKEY , label: label = 'Notifications ({hotkey})' , ...viewportProps } = props;
|
|
98
|
+
const context = $054eb8030ebde76e$var$useToastProviderContext($054eb8030ebde76e$var$VIEWPORT_NAME, __scopeToast);
|
|
99
|
+
const getItems = $054eb8030ebde76e$var$useCollection(__scopeToast);
|
|
100
|
+
const wrapperRef = useRef(null);
|
|
101
|
+
const headFocusProxyRef = useRef(null);
|
|
102
|
+
const tailFocusProxyRef = useRef(null);
|
|
103
|
+
const ref = useRef(null);
|
|
104
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref, context.onViewportChange);
|
|
105
|
+
const hotkeyLabel = hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, '');
|
|
106
|
+
const hasToasts = context.toastCount > 0;
|
|
107
|
+
useEffect(()=>{
|
|
108
|
+
const handleKeyDown = (event)=>{
|
|
109
|
+
var _ref$current;
|
|
110
|
+
// we use `event.code` as it is consistent regardless of meta keys that were pressed.
|
|
111
|
+
// for example, `event.key` for `Control+Alt+t` is `†` and `t !== †`
|
|
112
|
+
const isHotkeyPressed = hotkey.every((key)=>event[key] || event.code === key
|
|
113
|
+
);
|
|
114
|
+
if (isHotkeyPressed) (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus();
|
|
115
|
+
};
|
|
116
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
117
|
+
return ()=>document.removeEventListener('keydown', handleKeyDown)
|
|
118
|
+
;
|
|
119
|
+
}, [
|
|
120
|
+
hotkey
|
|
121
|
+
]);
|
|
122
|
+
useEffect(()=>{
|
|
123
|
+
const wrapper = wrapperRef.current;
|
|
124
|
+
const viewport = ref.current;
|
|
125
|
+
if (hasToasts && wrapper && viewport) {
|
|
126
|
+
const handlePause = ()=>{
|
|
127
|
+
if (!context.isClosePausedRef.current) {
|
|
128
|
+
const pauseEvent = new CustomEvent($054eb8030ebde76e$var$VIEWPORT_PAUSE);
|
|
129
|
+
viewport.dispatchEvent(pauseEvent);
|
|
130
|
+
context.isClosePausedRef.current = true;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const handleResume = ()=>{
|
|
134
|
+
if (context.isClosePausedRef.current) {
|
|
135
|
+
const resumeEvent = new CustomEvent($054eb8030ebde76e$var$VIEWPORT_RESUME);
|
|
136
|
+
viewport.dispatchEvent(resumeEvent);
|
|
137
|
+
context.isClosePausedRef.current = false;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const handleFocusOutResume = (event)=>{
|
|
141
|
+
const isFocusMovingOutside = !wrapper.contains(event.relatedTarget);
|
|
142
|
+
if (isFocusMovingOutside) handleResume();
|
|
143
|
+
};
|
|
144
|
+
const handlePointerLeaveResume = ()=>{
|
|
145
|
+
const isFocusInside = wrapper.contains(document.activeElement);
|
|
146
|
+
if (!isFocusInside) handleResume();
|
|
147
|
+
}; // Toasts are not in the viewport React tree so we need to bind DOM events
|
|
148
|
+
wrapper.addEventListener('focusin', handlePause);
|
|
149
|
+
wrapper.addEventListener('focusout', handleFocusOutResume);
|
|
150
|
+
wrapper.addEventListener('pointermove', handlePause);
|
|
151
|
+
wrapper.addEventListener('pointerleave', handlePointerLeaveResume);
|
|
152
|
+
window.addEventListener('blur', handlePause);
|
|
153
|
+
window.addEventListener('focus', handleResume);
|
|
154
|
+
return ()=>{
|
|
155
|
+
wrapper.removeEventListener('focusin', handlePause);
|
|
156
|
+
wrapper.removeEventListener('focusout', handleFocusOutResume);
|
|
157
|
+
wrapper.removeEventListener('pointermove', handlePause);
|
|
158
|
+
wrapper.removeEventListener('pointerleave', handlePointerLeaveResume);
|
|
159
|
+
window.removeEventListener('blur', handlePause);
|
|
160
|
+
window.removeEventListener('focus', handleResume);
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}, [
|
|
164
|
+
hasToasts,
|
|
165
|
+
context.isClosePausedRef
|
|
166
|
+
]);
|
|
167
|
+
const getSortedTabbableCandidates = useCallback(({ tabbingDirection: tabbingDirection })=>{
|
|
168
|
+
const toastItems = getItems();
|
|
169
|
+
const tabbableCandidates = toastItems.map((toastItem)=>{
|
|
170
|
+
const toastNode = toastItem.ref.current;
|
|
171
|
+
const toastTabbableCandidates = [
|
|
172
|
+
toastNode,
|
|
173
|
+
...$054eb8030ebde76e$var$getTabbableCandidates(toastNode)
|
|
174
|
+
];
|
|
175
|
+
return tabbingDirection === 'forwards' ? toastTabbableCandidates : toastTabbableCandidates.reverse();
|
|
176
|
+
});
|
|
177
|
+
return (tabbingDirection === 'forwards' ? tabbableCandidates.reverse() : tabbableCandidates).flat();
|
|
178
|
+
}, [
|
|
179
|
+
getItems
|
|
180
|
+
]);
|
|
181
|
+
useEffect(()=>{
|
|
182
|
+
const viewport = ref.current; // We programmatically manage tabbing as we are unable to influence
|
|
183
|
+
// the source order with portals, this allows us to reverse the
|
|
184
|
+
// tab order so that it runs from most recent toast to least
|
|
185
|
+
if (viewport) {
|
|
186
|
+
const handleKeyDown = (event)=>{
|
|
187
|
+
const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;
|
|
188
|
+
const isTabKey = event.key === 'Tab' && !isMetaKey;
|
|
189
|
+
if (isTabKey) {
|
|
190
|
+
const focusedElement = document.activeElement;
|
|
191
|
+
const isTabbingBackwards = event.shiftKey;
|
|
192
|
+
const targetIsViewport = event.target === viewport; // If we're back tabbing after jumping to the viewport then we simply
|
|
193
|
+
// proxy focus out to the preceding document
|
|
194
|
+
if (targetIsViewport && isTabbingBackwards) {
|
|
195
|
+
var _headFocusProxyRef$cu;
|
|
196
|
+
(_headFocusProxyRef$cu = headFocusProxyRef.current) === null || _headFocusProxyRef$cu === void 0 || _headFocusProxyRef$cu.focus();
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const tabbingDirection = isTabbingBackwards ? 'backwards' : 'forwards';
|
|
200
|
+
const sortedCandidates = getSortedTabbableCandidates({
|
|
201
|
+
tabbingDirection: tabbingDirection
|
|
202
|
+
});
|
|
203
|
+
const index = sortedCandidates.findIndex((candidate)=>candidate === focusedElement
|
|
204
|
+
);
|
|
205
|
+
if ($054eb8030ebde76e$var$focusFirst(sortedCandidates.slice(index + 1))) event.preventDefault();
|
|
206
|
+
else {
|
|
207
|
+
var _headFocusProxyRef$cu2, _tailFocusProxyRef$cu;
|
|
208
|
+
// If we can't focus that means we're at the edges so we
|
|
209
|
+
// proxy to the corresponding exit point and let the browser handle
|
|
210
|
+
// tab/shift+tab keypress and implicitly pass focus to the next valid element in the document
|
|
211
|
+
isTabbingBackwards ? (_headFocusProxyRef$cu2 = headFocusProxyRef.current) === null || _headFocusProxyRef$cu2 === void 0 || _headFocusProxyRef$cu2.focus() : (_tailFocusProxyRef$cu = tailFocusProxyRef.current) === null || _tailFocusProxyRef$cu === void 0 || _tailFocusProxyRef$cu.focus();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}; // Toasts are not in the viewport React tree so we need to bind DOM events
|
|
215
|
+
viewport.addEventListener('keydown', handleKeyDown);
|
|
216
|
+
return ()=>viewport.removeEventListener('keydown', handleKeyDown)
|
|
217
|
+
;
|
|
218
|
+
}
|
|
219
|
+
}, [
|
|
220
|
+
getItems,
|
|
221
|
+
getSortedTabbableCandidates
|
|
222
|
+
]);
|
|
223
|
+
return /*#__PURE__*/ createElement($5cb92bef7577960e$export$aecb2ddcb55c95be, {
|
|
224
|
+
ref: wrapperRef,
|
|
225
|
+
role: "region",
|
|
226
|
+
"aria-label": label.replace('{hotkey}', hotkeyLabel) // Ensure virtual cursor from landmarks menus triggers focus/blur for pause/resume
|
|
227
|
+
,
|
|
228
|
+
tabIndex: -1 // incase list has size when empty (e.g. padding), we remove pointer events so
|
|
229
|
+
,
|
|
230
|
+
style: {
|
|
231
|
+
pointerEvents: hasToasts ? undefined : 'none'
|
|
232
|
+
}
|
|
233
|
+
}, hasToasts && /*#__PURE__*/ createElement($054eb8030ebde76e$var$FocusProxy, {
|
|
234
|
+
ref: headFocusProxyRef,
|
|
235
|
+
onFocusFromOutsideViewport: ()=>{
|
|
236
|
+
const tabbableCandidates = getSortedTabbableCandidates({
|
|
237
|
+
tabbingDirection: 'forwards'
|
|
238
|
+
});
|
|
239
|
+
$054eb8030ebde76e$var$focusFirst(tabbableCandidates);
|
|
240
|
+
}
|
|
241
|
+
}), /*#__PURE__*/ createElement($054eb8030ebde76e$var$Collection.Slot, {
|
|
242
|
+
scope: __scopeToast
|
|
243
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.ol, _extends({
|
|
244
|
+
tabIndex: -1
|
|
245
|
+
}, viewportProps, {
|
|
246
|
+
ref: composedRefs
|
|
247
|
+
}))), hasToasts && /*#__PURE__*/ createElement($054eb8030ebde76e$var$FocusProxy, {
|
|
248
|
+
ref: tailFocusProxyRef,
|
|
249
|
+
onFocusFromOutsideViewport: ()=>{
|
|
250
|
+
const tabbableCandidates = getSortedTabbableCandidates({
|
|
251
|
+
tabbingDirection: 'backwards'
|
|
252
|
+
});
|
|
253
|
+
$054eb8030ebde76e$var$focusFirst(tabbableCandidates);
|
|
254
|
+
}
|
|
255
|
+
}));
|
|
256
|
+
});
|
|
257
|
+
/* -----------------------------------------------------------------------------------------------*/ const $054eb8030ebde76e$var$FOCUS_PROXY_NAME = 'ToastFocusProxy';
|
|
258
|
+
const $054eb8030ebde76e$var$FocusProxy = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
259
|
+
const { __scopeToast: __scopeToast , onFocusFromOutsideViewport: onFocusFromOutsideViewport , ...proxyProps } = props;
|
|
260
|
+
const context = $054eb8030ebde76e$var$useToastProviderContext($054eb8030ebde76e$var$FOCUS_PROXY_NAME, __scopeToast);
|
|
261
|
+
return /*#__PURE__*/ createElement($ea1ef594cf570d83$export$439d29a4e110a164, _extends({
|
|
262
|
+
"aria-hidden": true,
|
|
263
|
+
tabIndex: 0
|
|
264
|
+
}, proxyProps, {
|
|
265
|
+
ref: forwardedRef // Avoid page scrolling when focus is on the focus proxy
|
|
266
|
+
,
|
|
267
|
+
style: {
|
|
268
|
+
position: 'fixed'
|
|
269
|
+
},
|
|
270
|
+
onFocus: (event)=>{
|
|
271
|
+
var _context$viewport;
|
|
272
|
+
const prevFocusedElement = event.relatedTarget;
|
|
273
|
+
const isFocusFromOutsideViewport = !((_context$viewport = context.viewport) !== null && _context$viewport !== void 0 && _context$viewport.contains(prevFocusedElement));
|
|
274
|
+
if (isFocusFromOutsideViewport) onFocusFromOutsideViewport();
|
|
275
|
+
}
|
|
276
|
+
}));
|
|
277
|
+
});
|
|
278
|
+
/* -------------------------------------------------------------------------------------------------
|
|
279
|
+
* Toast
|
|
280
|
+
* -----------------------------------------------------------------------------------------------*/ const $054eb8030ebde76e$var$TOAST_NAME = 'Toast';
|
|
281
|
+
const $054eb8030ebde76e$var$TOAST_SWIPE_START = 'toast.swipeStart';
|
|
282
|
+
const $054eb8030ebde76e$var$TOAST_SWIPE_MOVE = 'toast.swipeMove';
|
|
283
|
+
const $054eb8030ebde76e$var$TOAST_SWIPE_CANCEL = 'toast.swipeCancel';
|
|
284
|
+
const $054eb8030ebde76e$var$TOAST_SWIPE_END = 'toast.swipeEnd';
|
|
285
|
+
const $054eb8030ebde76e$export$8d8dc7d5f743331b = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
286
|
+
const { forceMount: forceMount , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , ...toastProps } = props;
|
|
287
|
+
const [open = true, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
288
|
+
prop: openProp,
|
|
289
|
+
defaultProp: defaultOpen,
|
|
290
|
+
onChange: onOpenChange
|
|
291
|
+
});
|
|
292
|
+
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
293
|
+
present: forceMount || open
|
|
294
|
+
}, /*#__PURE__*/ createElement($054eb8030ebde76e$var$ToastImpl, _extends({
|
|
295
|
+
open: open
|
|
296
|
+
}, toastProps, {
|
|
297
|
+
ref: forwardedRef,
|
|
298
|
+
onClose: ()=>setOpen(false)
|
|
299
|
+
,
|
|
300
|
+
onPause: $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(props.onPause),
|
|
301
|
+
onResume: $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(props.onResume),
|
|
302
|
+
onSwipeStart: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onSwipeStart, (event)=>{
|
|
303
|
+
event.currentTarget.setAttribute('data-swipe', 'start');
|
|
304
|
+
}),
|
|
305
|
+
onSwipeMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onSwipeMove, (event)=>{
|
|
306
|
+
const { x: x , y: y } = event.detail.delta;
|
|
307
|
+
event.currentTarget.setAttribute('data-swipe', 'move');
|
|
308
|
+
event.currentTarget.style.setProperty('--radix-toast-swipe-move-x', `${x}px`);
|
|
309
|
+
event.currentTarget.style.setProperty('--radix-toast-swipe-move-y', `${y}px`);
|
|
310
|
+
}),
|
|
311
|
+
onSwipeCancel: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onSwipeCancel, (event)=>{
|
|
312
|
+
event.currentTarget.setAttribute('data-swipe', 'cancel');
|
|
313
|
+
event.currentTarget.style.removeProperty('--radix-toast-swipe-move-x');
|
|
314
|
+
event.currentTarget.style.removeProperty('--radix-toast-swipe-move-y');
|
|
315
|
+
event.currentTarget.style.removeProperty('--radix-toast-swipe-end-x');
|
|
316
|
+
event.currentTarget.style.removeProperty('--radix-toast-swipe-end-y');
|
|
317
|
+
}),
|
|
318
|
+
onSwipeEnd: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onSwipeEnd, (event)=>{
|
|
319
|
+
const { x: x , y: y } = event.detail.delta;
|
|
320
|
+
event.currentTarget.setAttribute('data-swipe', 'end');
|
|
321
|
+
event.currentTarget.style.removeProperty('--radix-toast-swipe-move-x');
|
|
322
|
+
event.currentTarget.style.removeProperty('--radix-toast-swipe-move-y');
|
|
323
|
+
event.currentTarget.style.setProperty('--radix-toast-swipe-end-x', `${x}px`);
|
|
324
|
+
event.currentTarget.style.setProperty('--radix-toast-swipe-end-y', `${y}px`);
|
|
325
|
+
setOpen(false);
|
|
326
|
+
})
|
|
327
|
+
})));
|
|
328
|
+
});
|
|
329
|
+
/* -----------------------------------------------------------------------------------------------*/ const [$054eb8030ebde76e$var$ToastInteractiveProvider, $054eb8030ebde76e$var$useToastInteractiveContext] = $054eb8030ebde76e$var$createToastContext($054eb8030ebde76e$var$TOAST_NAME, {
|
|
330
|
+
onClose () {}
|
|
331
|
+
});
|
|
332
|
+
const $054eb8030ebde76e$var$ToastImpl = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
333
|
+
const { __scopeToast: __scopeToast , type: type = 'foreground' , duration: durationProp , open: open , onClose: onClose , onEscapeKeyDown: onEscapeKeyDown , onPause: onPause , onResume: onResume , onSwipeStart: onSwipeStart , onSwipeMove: onSwipeMove , onSwipeCancel: onSwipeCancel , onSwipeEnd: onSwipeEnd , ...toastProps } = props;
|
|
334
|
+
const context = $054eb8030ebde76e$var$useToastProviderContext($054eb8030ebde76e$var$TOAST_NAME, __scopeToast);
|
|
335
|
+
const [node1, setNode] = useState(null);
|
|
336
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
337
|
+
);
|
|
338
|
+
const pointerStartRef = useRef(null);
|
|
339
|
+
const swipeDeltaRef = useRef(null);
|
|
340
|
+
const duration1 = durationProp || context.duration;
|
|
341
|
+
const closeTimerStartTimeRef = useRef(0);
|
|
342
|
+
const closeTimerRemainingTimeRef = useRef(duration1);
|
|
343
|
+
const closeTimerRef = useRef(0);
|
|
344
|
+
const { onToastAdd: onToastAdd , onToastRemove: onToastRemove } = context;
|
|
345
|
+
const handleClose = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(()=>{
|
|
346
|
+
var _context$viewport2;
|
|
347
|
+
// focus viewport if focus is within toast to read the remaining toast
|
|
348
|
+
// count to SR users and ensure focus isn't lost
|
|
349
|
+
const isFocusInToast = node1 === null || node1 === void 0 ? void 0 : node1.contains(document.activeElement);
|
|
350
|
+
if (isFocusInToast) (_context$viewport2 = context.viewport) === null || _context$viewport2 === void 0 || _context$viewport2.focus();
|
|
351
|
+
onClose();
|
|
352
|
+
});
|
|
353
|
+
const startTimer = useCallback((duration)=>{
|
|
354
|
+
if (!duration || duration === Infinity) return;
|
|
355
|
+
window.clearTimeout(closeTimerRef.current);
|
|
356
|
+
closeTimerStartTimeRef.current = new Date().getTime();
|
|
357
|
+
closeTimerRef.current = window.setTimeout(handleClose, duration);
|
|
358
|
+
}, [
|
|
359
|
+
handleClose
|
|
360
|
+
]);
|
|
361
|
+
useEffect(()=>{
|
|
362
|
+
const viewport = context.viewport;
|
|
363
|
+
if (viewport) {
|
|
364
|
+
const handleResume = ()=>{
|
|
365
|
+
startTimer(closeTimerRemainingTimeRef.current);
|
|
366
|
+
onResume === null || onResume === void 0 || onResume();
|
|
367
|
+
};
|
|
368
|
+
const handlePause = ()=>{
|
|
369
|
+
const elapsedTime = new Date().getTime() - closeTimerStartTimeRef.current;
|
|
370
|
+
closeTimerRemainingTimeRef.current = closeTimerRemainingTimeRef.current - elapsedTime;
|
|
371
|
+
window.clearTimeout(closeTimerRef.current);
|
|
372
|
+
onPause === null || onPause === void 0 || onPause();
|
|
373
|
+
};
|
|
374
|
+
viewport.addEventListener($054eb8030ebde76e$var$VIEWPORT_PAUSE, handlePause);
|
|
375
|
+
viewport.addEventListener($054eb8030ebde76e$var$VIEWPORT_RESUME, handleResume);
|
|
376
|
+
return ()=>{
|
|
377
|
+
viewport.removeEventListener($054eb8030ebde76e$var$VIEWPORT_PAUSE, handlePause);
|
|
378
|
+
viewport.removeEventListener($054eb8030ebde76e$var$VIEWPORT_RESUME, handleResume);
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
}, [
|
|
382
|
+
context.viewport,
|
|
383
|
+
duration1,
|
|
384
|
+
onPause,
|
|
385
|
+
onResume,
|
|
386
|
+
startTimer
|
|
387
|
+
]); // start timer when toast opens or duration changes.
|
|
388
|
+
// we include `open` in deps because closed !== unmounted when animating
|
|
389
|
+
// so it could reopen before being completely unmounted
|
|
390
|
+
useEffect(()=>{
|
|
391
|
+
if (open && !context.isClosePausedRef.current) startTimer(duration1);
|
|
392
|
+
}, [
|
|
393
|
+
open,
|
|
394
|
+
duration1,
|
|
395
|
+
context.isClosePausedRef,
|
|
396
|
+
startTimer
|
|
397
|
+
]);
|
|
398
|
+
useEffect(()=>{
|
|
399
|
+
onToastAdd();
|
|
400
|
+
return ()=>onToastRemove()
|
|
401
|
+
;
|
|
402
|
+
}, [
|
|
403
|
+
onToastAdd,
|
|
404
|
+
onToastRemove
|
|
405
|
+
]);
|
|
406
|
+
const announceTextContent = useMemo(()=>{
|
|
407
|
+
return node1 ? $054eb8030ebde76e$var$getAnnounceTextContent(node1) : null;
|
|
408
|
+
}, [
|
|
409
|
+
node1
|
|
410
|
+
]);
|
|
411
|
+
if (!context.viewport) return null;
|
|
412
|
+
return /*#__PURE__*/ createElement(Fragment, null, announceTextContent && /*#__PURE__*/ createElement($054eb8030ebde76e$var$ToastAnnounce, {
|
|
413
|
+
__scopeToast: __scopeToast // Toasts are always role=status to avoid stuttering issues with role=alert in SRs.
|
|
414
|
+
,
|
|
415
|
+
role: "status",
|
|
416
|
+
"aria-live": type === 'foreground' ? 'assertive' : 'polite',
|
|
417
|
+
"aria-atomic": true
|
|
418
|
+
}, announceTextContent), /*#__PURE__*/ createElement($054eb8030ebde76e$var$ToastInteractiveProvider, {
|
|
419
|
+
scope: __scopeToast,
|
|
420
|
+
onClose: handleClose
|
|
421
|
+
}, /*#__PURE__*/ createPortal(/*#__PURE__*/ createElement($054eb8030ebde76e$var$Collection.ItemSlot, {
|
|
422
|
+
scope: __scopeToast
|
|
423
|
+
}, /*#__PURE__*/ createElement($5cb92bef7577960e$export$be92b6f5f03c0fe9, {
|
|
424
|
+
asChild: true,
|
|
425
|
+
onEscapeKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onEscapeKeyDown, ()=>{
|
|
426
|
+
if (!context.isFocusedToastEscapeKeyDownRef.current) handleClose();
|
|
427
|
+
context.isFocusedToastEscapeKeyDownRef.current = false;
|
|
428
|
+
})
|
|
429
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.li, _extends({
|
|
430
|
+
// Ensure toasts are announced as status list or status when focused
|
|
431
|
+
role: "status",
|
|
432
|
+
"aria-live": "off",
|
|
433
|
+
"aria-atomic": true,
|
|
434
|
+
tabIndex: 0,
|
|
435
|
+
"data-state": open ? 'open' : 'closed',
|
|
436
|
+
"data-swipe-direction": context.swipeDirection
|
|
437
|
+
}, toastProps, {
|
|
438
|
+
ref: composedRefs,
|
|
439
|
+
style: {
|
|
440
|
+
userSelect: 'none',
|
|
441
|
+
touchAction: 'none',
|
|
442
|
+
...props.style
|
|
443
|
+
},
|
|
444
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
445
|
+
if (event.key !== 'Escape') return;
|
|
446
|
+
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event.nativeEvent);
|
|
447
|
+
if (!event.nativeEvent.defaultPrevented) {
|
|
448
|
+
context.isFocusedToastEscapeKeyDownRef.current = true;
|
|
449
|
+
handleClose();
|
|
450
|
+
}
|
|
451
|
+
}),
|
|
452
|
+
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDown, (event)=>{
|
|
453
|
+
if (event.button !== 0) return;
|
|
454
|
+
pointerStartRef.current = {
|
|
455
|
+
x: event.clientX,
|
|
456
|
+
y: event.clientY
|
|
457
|
+
};
|
|
458
|
+
}),
|
|
459
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, (event)=>{
|
|
460
|
+
if (!pointerStartRef.current) return;
|
|
461
|
+
const x = event.clientX - pointerStartRef.current.x;
|
|
462
|
+
const y = event.clientY - pointerStartRef.current.y;
|
|
463
|
+
const hasSwipeMoveStarted = Boolean(swipeDeltaRef.current);
|
|
464
|
+
const isHorizontalSwipe = [
|
|
465
|
+
'left',
|
|
466
|
+
'right'
|
|
467
|
+
].includes(context.swipeDirection);
|
|
468
|
+
const clamp = [
|
|
469
|
+
'left',
|
|
470
|
+
'up'
|
|
471
|
+
].includes(context.swipeDirection) ? Math.min : Math.max;
|
|
472
|
+
const clampedX = isHorizontalSwipe ? clamp(0, x) : 0;
|
|
473
|
+
const clampedY = !isHorizontalSwipe ? clamp(0, y) : 0;
|
|
474
|
+
const moveStartBuffer = event.pointerType === 'touch' ? 10 : 2;
|
|
475
|
+
const delta = {
|
|
476
|
+
x: clampedX,
|
|
477
|
+
y: clampedY
|
|
478
|
+
};
|
|
479
|
+
const eventDetail = {
|
|
480
|
+
originalEvent: event,
|
|
481
|
+
delta: delta
|
|
482
|
+
};
|
|
483
|
+
if (hasSwipeMoveStarted) {
|
|
484
|
+
swipeDeltaRef.current = delta;
|
|
485
|
+
$054eb8030ebde76e$var$handleAndDispatchCustomEvent($054eb8030ebde76e$var$TOAST_SWIPE_MOVE, onSwipeMove, eventDetail, {
|
|
486
|
+
discrete: false
|
|
487
|
+
});
|
|
488
|
+
} else if ($054eb8030ebde76e$var$isDeltaInDirection(delta, context.swipeDirection, moveStartBuffer)) {
|
|
489
|
+
swipeDeltaRef.current = delta;
|
|
490
|
+
$054eb8030ebde76e$var$handleAndDispatchCustomEvent($054eb8030ebde76e$var$TOAST_SWIPE_START, onSwipeStart, eventDetail, {
|
|
491
|
+
discrete: false
|
|
492
|
+
});
|
|
493
|
+
event.target.setPointerCapture(event.pointerId);
|
|
494
|
+
} else if (Math.abs(x) > moveStartBuffer || Math.abs(y) > moveStartBuffer) // User is swiping in wrong direction so we disable swipe gesture
|
|
495
|
+
// for the current pointer down interaction
|
|
496
|
+
pointerStartRef.current = null;
|
|
497
|
+
}),
|
|
498
|
+
onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerUp, (event1)=>{
|
|
499
|
+
const delta = swipeDeltaRef.current;
|
|
500
|
+
const target = event1.target;
|
|
501
|
+
if (target.hasPointerCapture(event1.pointerId)) target.releasePointerCapture(event1.pointerId);
|
|
502
|
+
swipeDeltaRef.current = null;
|
|
503
|
+
pointerStartRef.current = null;
|
|
504
|
+
if (delta) {
|
|
505
|
+
const toast = event1.currentTarget;
|
|
506
|
+
const eventDetail = {
|
|
507
|
+
originalEvent: event1,
|
|
508
|
+
delta: delta
|
|
509
|
+
};
|
|
510
|
+
if ($054eb8030ebde76e$var$isDeltaInDirection(delta, context.swipeDirection, context.swipeThreshold)) $054eb8030ebde76e$var$handleAndDispatchCustomEvent($054eb8030ebde76e$var$TOAST_SWIPE_END, onSwipeEnd, eventDetail, {
|
|
511
|
+
discrete: true
|
|
512
|
+
});
|
|
513
|
+
else $054eb8030ebde76e$var$handleAndDispatchCustomEvent($054eb8030ebde76e$var$TOAST_SWIPE_CANCEL, onSwipeCancel, eventDetail, {
|
|
514
|
+
discrete: true
|
|
515
|
+
});
|
|
516
|
+
// Prevent click event from triggering on items within the toast when
|
|
517
|
+
// pointer up is part of a swipe gesture
|
|
518
|
+
toast.addEventListener('click', (event)=>event.preventDefault()
|
|
519
|
+
, {
|
|
520
|
+
once: true
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
})
|
|
524
|
+
})))), context.viewport)));
|
|
525
|
+
});
|
|
526
|
+
$054eb8030ebde76e$var$ToastImpl.propTypes = {
|
|
527
|
+
type (props) {
|
|
528
|
+
if (props.type && ![
|
|
529
|
+
'foreground',
|
|
530
|
+
'background'
|
|
531
|
+
].includes(props.type)) {
|
|
532
|
+
const error = `Invalid prop \`type\` supplied to \`${$054eb8030ebde76e$var$TOAST_NAME}\`. Expected \`foreground | background\`.`;
|
|
533
|
+
return new Error(error);
|
|
534
|
+
}
|
|
535
|
+
return null;
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
/* -----------------------------------------------------------------------------------------------*/ const $054eb8030ebde76e$var$ToastAnnounce = (props)=>{
|
|
539
|
+
const { __scopeToast: __scopeToast , children: children , ...announceProps } = props;
|
|
540
|
+
const context = $054eb8030ebde76e$var$useToastProviderContext($054eb8030ebde76e$var$TOAST_NAME, __scopeToast);
|
|
541
|
+
const [renderAnnounceText, setRenderAnnounceText] = useState(false);
|
|
542
|
+
const [isAnnounced, setIsAnnounced] = useState(false); // render text content in the next frame to ensure toast is announced in NVDA
|
|
543
|
+
$054eb8030ebde76e$var$useNextFrame(()=>setRenderAnnounceText(true)
|
|
544
|
+
); // cleanup after announcing
|
|
545
|
+
useEffect(()=>{
|
|
546
|
+
const timer = window.setTimeout(()=>setIsAnnounced(true)
|
|
547
|
+
, 1000);
|
|
548
|
+
return ()=>window.clearTimeout(timer)
|
|
549
|
+
;
|
|
550
|
+
}, []);
|
|
551
|
+
return isAnnounced ? null : /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c, {
|
|
552
|
+
asChild: true
|
|
553
|
+
}, /*#__PURE__*/ createElement($ea1ef594cf570d83$export$439d29a4e110a164, announceProps, renderAnnounceText && /*#__PURE__*/ createElement(Fragment, null, context.label, " ", children)));
|
|
554
|
+
};
|
|
555
|
+
const $054eb8030ebde76e$export$16d42d7c29b95a4 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
556
|
+
const { __scopeToast: __scopeToast , ...titleProps } = props;
|
|
557
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, titleProps, {
|
|
558
|
+
ref: forwardedRef
|
|
559
|
+
}));
|
|
560
|
+
});
|
|
561
|
+
/* -------------------------------------------------------------------------------------------------
|
|
562
|
+
* ToastAction
|
|
563
|
+
* -----------------------------------------------------------------------------------------------*/ const $054eb8030ebde76e$var$ACTION_NAME = 'ToastAction';
|
|
564
|
+
const $054eb8030ebde76e$export$3019feecfda683d2 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
565
|
+
const { altText: altText , ...actionProps } = props;
|
|
566
|
+
if (!altText) return null;
|
|
567
|
+
return /*#__PURE__*/ createElement($054eb8030ebde76e$var$ToastAnnounceExclude, {
|
|
568
|
+
altText: altText,
|
|
569
|
+
asChild: true
|
|
570
|
+
}, /*#__PURE__*/ createElement($054eb8030ebde76e$export$811e70f61c205839, _extends({}, actionProps, {
|
|
571
|
+
ref: forwardedRef
|
|
572
|
+
})));
|
|
573
|
+
});
|
|
574
|
+
$054eb8030ebde76e$export$3019feecfda683d2.propTypes = {
|
|
575
|
+
altText (props) {
|
|
576
|
+
if (!props.altText) return new Error(`Missing prop \`altText\` expected on \`${$054eb8030ebde76e$var$ACTION_NAME}\``);
|
|
577
|
+
return null;
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
/* -------------------------------------------------------------------------------------------------
|
|
581
|
+
* ToastClose
|
|
582
|
+
* -----------------------------------------------------------------------------------------------*/ const $054eb8030ebde76e$var$CLOSE_NAME = 'ToastClose';
|
|
583
|
+
const $054eb8030ebde76e$export$811e70f61c205839 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
584
|
+
const { __scopeToast: __scopeToast , ...closeProps } = props;
|
|
585
|
+
const interactiveContext = $054eb8030ebde76e$var$useToastInteractiveContext($054eb8030ebde76e$var$CLOSE_NAME, __scopeToast);
|
|
586
|
+
return /*#__PURE__*/ createElement($054eb8030ebde76e$var$ToastAnnounceExclude, {
|
|
587
|
+
asChild: true
|
|
588
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
589
|
+
type: "button"
|
|
590
|
+
}, closeProps, {
|
|
591
|
+
ref: forwardedRef,
|
|
592
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, interactiveContext.onClose)
|
|
593
|
+
})));
|
|
594
|
+
});
|
|
595
|
+
/* ---------------------------------------------------------------------------------------------- */ const $054eb8030ebde76e$var$ToastAnnounceExclude = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
596
|
+
const { __scopeToast: __scopeToast , altText: altText , ...announceExcludeProps } = props;
|
|
597
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
598
|
+
"data-radix-toast-announce-exclude": "",
|
|
599
|
+
"data-radix-toast-announce-alt": altText || undefined
|
|
600
|
+
}, announceExcludeProps, {
|
|
601
|
+
ref: forwardedRef
|
|
602
|
+
}));
|
|
603
|
+
});
|
|
604
|
+
function $054eb8030ebde76e$var$getAnnounceTextContent(container) {
|
|
605
|
+
const textContent = [];
|
|
606
|
+
const childNodes = Array.from(container.childNodes);
|
|
607
|
+
childNodes.forEach((node)=>{
|
|
608
|
+
if (node.nodeType === node.TEXT_NODE && node.textContent) textContent.push(node.textContent);
|
|
609
|
+
if ($054eb8030ebde76e$var$isHTMLElement(node)) {
|
|
610
|
+
const isHidden = node.ariaHidden || node.hidden || node.style.display === 'none';
|
|
611
|
+
const isExcluded = node.dataset.radixToastAnnounceExclude === '';
|
|
612
|
+
if (!isHidden) {
|
|
613
|
+
if (isExcluded) {
|
|
614
|
+
const altText = node.dataset.radixToastAnnounceAlt;
|
|
615
|
+
if (altText) textContent.push(altText);
|
|
616
|
+
} else textContent.push(...$054eb8030ebde76e$var$getAnnounceTextContent(node));
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}); // We return a collection of text rather than a single concatenated string.
|
|
620
|
+
// This allows SR VO to naturally pause break between nodes while announcing.
|
|
621
|
+
return textContent;
|
|
622
|
+
}
|
|
623
|
+
/* ---------------------------------------------------------------------------------------------- */ function $054eb8030ebde76e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
624
|
+
const currentTarget = detail.originalEvent.currentTarget;
|
|
625
|
+
const event = new CustomEvent(name, {
|
|
626
|
+
bubbles: true,
|
|
627
|
+
cancelable: true,
|
|
628
|
+
detail: detail
|
|
629
|
+
});
|
|
630
|
+
if (handler) currentTarget.addEventListener(name, handler, {
|
|
631
|
+
once: true
|
|
632
|
+
});
|
|
633
|
+
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(currentTarget, event);
|
|
634
|
+
else currentTarget.dispatchEvent(event);
|
|
635
|
+
}
|
|
636
|
+
const $054eb8030ebde76e$var$isDeltaInDirection = (delta, direction, threshold = 0)=>{
|
|
637
|
+
const deltaX = Math.abs(delta.x);
|
|
638
|
+
const deltaY = Math.abs(delta.y);
|
|
639
|
+
const isDeltaX = deltaX > deltaY;
|
|
640
|
+
if (direction === 'left' || direction === 'right') return isDeltaX && deltaX > threshold;
|
|
641
|
+
else return !isDeltaX && deltaY > threshold;
|
|
642
|
+
};
|
|
643
|
+
function $054eb8030ebde76e$var$useNextFrame(callback = ()=>{}) {
|
|
644
|
+
const fn = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback);
|
|
645
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
646
|
+
let raf1 = 0;
|
|
647
|
+
let raf2 = 0;
|
|
648
|
+
raf1 = window.requestAnimationFrame(()=>raf2 = window.requestAnimationFrame(fn)
|
|
649
|
+
);
|
|
650
|
+
return ()=>{
|
|
651
|
+
window.cancelAnimationFrame(raf1);
|
|
652
|
+
window.cancelAnimationFrame(raf2);
|
|
653
|
+
};
|
|
654
|
+
}, [
|
|
655
|
+
fn
|
|
656
|
+
]);
|
|
657
|
+
}
|
|
658
|
+
function $054eb8030ebde76e$var$isHTMLElement(node) {
|
|
659
|
+
return node.nodeType === node.ELEMENT_NODE;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Returns a list of potential tabbable candidates.
|
|
663
|
+
*
|
|
664
|
+
* NOTE: This is only a close approximation. For example it doesn't take into account cases like when
|
|
665
|
+
* elements are not visible. This cannot be worked out easily by just reading a property, but rather
|
|
666
|
+
* necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.
|
|
667
|
+
*
|
|
668
|
+
* See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
|
|
669
|
+
* Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
|
|
670
|
+
*/ function $054eb8030ebde76e$var$getTabbableCandidates(container) {
|
|
671
|
+
const nodes = [];
|
|
672
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
673
|
+
acceptNode: (node)=>{
|
|
674
|
+
const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';
|
|
675
|
+
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
|
|
676
|
+
// runtime's understanding of tabbability, so this automatically accounts
|
|
677
|
+
// for any kind of element that could be tabbed to.
|
|
678
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it
|
|
682
|
+
// hinders accessibility to have tab order different from visual order.
|
|
683
|
+
return nodes;
|
|
684
|
+
}
|
|
685
|
+
function $054eb8030ebde76e$var$focusFirst(candidates) {
|
|
686
|
+
const previouslyFocusedElement = document.activeElement;
|
|
687
|
+
return candidates.some((candidate)=>{
|
|
688
|
+
// if focus is already where we want to go, we don't want to keep going through the candidates
|
|
689
|
+
if (candidate === previouslyFocusedElement) return true;
|
|
690
|
+
candidate.focus();
|
|
691
|
+
return document.activeElement !== previouslyFocusedElement;
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
const $054eb8030ebde76e$export$2881499e37b75b9a = $054eb8030ebde76e$export$f5d03d415824e0e;
|
|
695
|
+
const $054eb8030ebde76e$export$d5c6c08dc2d3ca7 = $054eb8030ebde76e$export$6192c2425ecfd989;
|
|
696
|
+
const $054eb8030ebde76e$export$be92b6f5f03c0fe9 = $054eb8030ebde76e$export$8d8dc7d5f743331b;
|
|
697
|
+
const $054eb8030ebde76e$export$f99233281efd08a0 = $054eb8030ebde76e$export$16d42d7c29b95a4;
|
|
698
|
+
const $054eb8030ebde76e$export$e19cd5f9376f8cee = $054eb8030ebde76e$export$3019feecfda683d2;
|
|
699
|
+
const $054eb8030ebde76e$export$f39c2d165cd861fe = $054eb8030ebde76e$export$811e70f61c205839;
|
|
700
|
+
|
|
701
|
+
var ToastNotification = function (_a) {
|
|
702
|
+
var link = _a.link, title = _a.title, isOpen = _a.isOpen, onOpenChange = _a.onOpenChange, _b = _a.isStatusIconVisible, isStatusIconVisible = _b === void 0 ? true : _b, _c = _a.isCloseButtonVisible, isCloseButtonVisible = _c === void 0 ? true : _c, _d = _a.status, status = _d === void 0 ? "general" : _d, props = __rest(_a, ["link", "title", "isOpen", "onOpenChange", "isStatusIconVisible", "isCloseButtonVisible", "status"]);
|
|
703
|
+
var statusIcons = {
|
|
704
|
+
general: BtIconNotification_2,
|
|
705
|
+
error: BtIconAlertTriangle_2,
|
|
706
|
+
warning: BtIconAlert_2,
|
|
707
|
+
success: BtIconTick_2
|
|
708
|
+
};
|
|
709
|
+
var handleLinkClick = function (handler) { return function (event) {
|
|
710
|
+
event.preventDefault();
|
|
711
|
+
handler();
|
|
712
|
+
}; };
|
|
713
|
+
return (React__default.createElement($054eb8030ebde76e$export$be92b6f5f03c0fe9, __assign({ className: "arc-Toast-root", open: isOpen, onOpenChange: onOpenChange }, filterDataAttrs(props)),
|
|
714
|
+
React__default.createElement("div", { "data-testid": "toast-notification-wrapper", className: classNames("arc-Toast", "arc-Toast-status--".concat(status)) },
|
|
715
|
+
isStatusIconVisible && (React__default.createElement("div", { "data-testid": "status-icon", className: "arc-Toast-icon" },
|
|
716
|
+
React__default.createElement(Icon, { size: 24, icon: statusIcons[status] }))),
|
|
717
|
+
React__default.createElement($054eb8030ebde76e$export$f99233281efd08a0, { className: "arc-Toast-title" },
|
|
718
|
+
React__default.createElement("span", null, title)),
|
|
719
|
+
link && (React__default.createElement($054eb8030ebde76e$export$e19cd5f9376f8cee, { className: "arc-Toast-action", asChild: true, altText: link.text },
|
|
720
|
+
React__default.createElement("a", __assign({ className: "arc-Toast-link", href: link.href, "aria-label": link.ariaLabel }, (link.onClick && { onClick: handleLinkClick(link.onClick) })), link.text))),
|
|
721
|
+
isCloseButtonVisible && !link && (React__default.createElement($054eb8030ebde76e$export$f39c2d165cd861fe, { className: "arc-Toast-dismiss", "aria-label": "Close" },
|
|
722
|
+
React__default.createElement(Icon, { icon: BtIconCrossAlt2Px_2, size: 24 }))))));
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
/** Use `Toast` to display temporary messages at the bottom of the viewport. */
|
|
726
|
+
var Toast = function (_a) {
|
|
727
|
+
var children = _a.children, _b = _a.pathway, pathway = _b === void 0 ? "light" : _b, props = __rest(_a, ["children", "pathway"]);
|
|
728
|
+
return (React__default.createElement($054eb8030ebde76e$export$2881499e37b75b9a, { swipeDirection: "right", duration: 6000 },
|
|
729
|
+
React__default.createElement($054eb8030ebde76e$export$d5c6c08dc2d3ca7, { asChild: true, className: "arc-Toast-viewport" },
|
|
730
|
+
React__default.createElement("div", __assign({ className: "arc-Toast-pathway--".concat(pathway) }, filterDataAttrs(props)), children))));
|
|
731
|
+
};
|
|
732
|
+
Toast.Notification = ToastNotification;
|
|
733
|
+
ToastNotification.displayName = "Toast.Notification";
|
|
734
|
+
|
|
735
|
+
export { Toast };
|