@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,669 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/esm/filter-data-attrs-afdb7d32.js';
|
|
2
|
+
import React__default, { forwardRef, useState, useRef, useEffect, useCallback, createElement, Children, isValidElement, cloneElement, Fragment, useContext } from 'react';
|
|
3
|
+
import { c as classNames } from '../_shared/esm/index-2ae58626.js';
|
|
4
|
+
import { B as BtIconCrossAlt2Px_2 } from '../_shared/esm/BtIconCrossAlt2Px-a6a9f431.js';
|
|
5
|
+
import { _ as _extends } from '../_shared/esm/extends-4575346e.js';
|
|
6
|
+
import { $ as $b1b2314f5f9a1d84$export$25bec8c6f54ee79a, a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, b as $8927f6f2acc4f386$export$250ffa63cdc0d034, c as $6ed0406888f73fc4$export$43e446d32b3d21af, d as $c512c27ab02ef895$export$50c7b4e9d9f19c1, e as $71cd76cc60e0454e$export$6f32135080cb4c3, f as $921a889cee6df7e8$export$99c2b779aa4e8b8b, g as $e42e1063c40fb3ef$export$b9ecd428b558ff10 } from '../_shared/esm/index-22aad354.js';
|
|
7
|
+
import { $ as $1746a345f3d73bb7$export$f680877a34711e37 } from '../_shared/esm/index-bed18a88.js';
|
|
8
|
+
import { $ as $f1701beae083dbae$export$602eac185826482c, a as $5cb92bef7577960e$export$177fb62ff3ec1f22 } from '../_shared/esm/index-94ecc5f8.js';
|
|
9
|
+
import { $ as $01b9c$RemoveScroll, h as hideOthers } from '../_shared/esm/index-369dce7f.js';
|
|
10
|
+
import { I as Icon } from '../_shared/esm/Icon-c1af47bc.js';
|
|
11
|
+
import { A as ArcRootElementContext } from '../_shared/esm/Base-6c01e0ec.js';
|
|
12
|
+
import { H as Heading } from '../_shared/esm/Heading-0f629151.js';
|
|
13
|
+
import { B as Button } from '../_shared/esm/Button-d1dbcf79.js';
|
|
14
|
+
import { T as Text } from '../_shared/esm/Text-40457811.js';
|
|
15
|
+
import { V as VerticalSpace } from '../_shared/esm/VerticalSpace-93980c9c.js';
|
|
16
|
+
import 'react-dom';
|
|
17
|
+
import '../_shared/esm/suffix-modifier-7e640670.js';
|
|
18
|
+
import '../_shared/esm/Surface-dde51789.js';
|
|
19
|
+
import '../_shared/esm/BtIconChevronLeftMid-9f4f3a3d.js';
|
|
20
|
+
import '../_shared/esm/BtIconChevronRightMid-d9b11761.js';
|
|
21
|
+
|
|
22
|
+
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
|
|
23
|
+
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
|
|
24
|
+
const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
25
|
+
bubbles: false,
|
|
26
|
+
cancelable: true
|
|
27
|
+
};
|
|
28
|
+
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
29
|
+
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
30
|
+
const [container1, setContainer] = useState(null);
|
|
31
|
+
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
32
|
+
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
33
|
+
const lastFocusedElementRef = useRef(null);
|
|
34
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
|
35
|
+
);
|
|
36
|
+
const focusScope = useRef({
|
|
37
|
+
paused: false,
|
|
38
|
+
pause () {
|
|
39
|
+
this.paused = true;
|
|
40
|
+
},
|
|
41
|
+
resume () {
|
|
42
|
+
this.paused = false;
|
|
43
|
+
}
|
|
44
|
+
}).current; // Takes care of trapping focus if focus is moved outside programmatically for example
|
|
45
|
+
useEffect(()=>{
|
|
46
|
+
if (trapped) {
|
|
47
|
+
function handleFocusIn(event) {
|
|
48
|
+
if (focusScope.paused || !container1) return;
|
|
49
|
+
const target = event.target;
|
|
50
|
+
if (container1.contains(target)) lastFocusedElementRef.current = target;
|
|
51
|
+
else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
52
|
+
select: true
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function handleFocusOut(event) {
|
|
56
|
+
if (focusScope.paused || !container1) return;
|
|
57
|
+
const relatedTarget = event.relatedTarget; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:
|
|
58
|
+
//
|
|
59
|
+
// 1. When the user switches app/tabs/windows/the browser itself loses focus.
|
|
60
|
+
// 2. In Google Chrome, when the focused element is removed from the DOM.
|
|
61
|
+
//
|
|
62
|
+
// We let the browser do its thing here because:
|
|
63
|
+
//
|
|
64
|
+
// 1. The browser already keeps a memory of what's focused for when the page gets refocused.
|
|
65
|
+
// 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it
|
|
66
|
+
// throws the CPU to 100%, so we avoid doing anything for this reason here too.
|
|
67
|
+
if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)
|
|
68
|
+
// that is outside the container, we move focus to the last valid focused element inside.
|
|
69
|
+
if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
70
|
+
select: true
|
|
71
|
+
});
|
|
72
|
+
} // When the focused element gets removed from the DOM, browsers move focus
|
|
73
|
+
// back to the document.body. In this case, we move focus to the container
|
|
74
|
+
// to keep focus trapped correctly.
|
|
75
|
+
function handleMutations(mutations) {
|
|
76
|
+
const focusedElement = document.activeElement;
|
|
77
|
+
for (const mutation of mutations){
|
|
78
|
+
if (mutation.removedNodes.length > 0) {
|
|
79
|
+
if (!(container1 !== null && container1 !== void 0 && container1.contains(focusedElement))) $d3863c46a17e8a28$var$focus(container1);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
document.addEventListener('focusin', handleFocusIn);
|
|
84
|
+
document.addEventListener('focusout', handleFocusOut);
|
|
85
|
+
const mutationObserver = new MutationObserver(handleMutations);
|
|
86
|
+
if (container1) mutationObserver.observe(container1, {
|
|
87
|
+
childList: true,
|
|
88
|
+
subtree: true
|
|
89
|
+
});
|
|
90
|
+
return ()=>{
|
|
91
|
+
document.removeEventListener('focusin', handleFocusIn);
|
|
92
|
+
document.removeEventListener('focusout', handleFocusOut);
|
|
93
|
+
mutationObserver.disconnect();
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}, [
|
|
97
|
+
trapped,
|
|
98
|
+
container1,
|
|
99
|
+
focusScope.paused
|
|
100
|
+
]);
|
|
101
|
+
useEffect(()=>{
|
|
102
|
+
if (container1) {
|
|
103
|
+
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
|
|
104
|
+
const previouslyFocusedElement = document.activeElement;
|
|
105
|
+
const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
|
|
106
|
+
if (!hasFocusedCandidate) {
|
|
107
|
+
const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
108
|
+
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
109
|
+
container1.dispatchEvent(mountEvent);
|
|
110
|
+
if (!mountEvent.defaultPrevented) {
|
|
111
|
+
$d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
|
|
112
|
+
select: true
|
|
113
|
+
});
|
|
114
|
+
if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return ()=>{
|
|
118
|
+
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
|
|
119
|
+
// We need to delay the focus a little to get around it for now.
|
|
120
|
+
// See: https://github.com/facebook/react/issues/17894
|
|
121
|
+
setTimeout(()=>{
|
|
122
|
+
const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
123
|
+
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
124
|
+
container1.dispatchEvent(unmountEvent);
|
|
125
|
+
if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
|
|
126
|
+
select: true
|
|
127
|
+
});
|
|
128
|
+
// we need to remove the listener after we `dispatchEvent`
|
|
129
|
+
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
130
|
+
$d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
|
|
131
|
+
}, 0);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}, [
|
|
135
|
+
container1,
|
|
136
|
+
onMountAutoFocus,
|
|
137
|
+
onUnmountAutoFocus,
|
|
138
|
+
focusScope
|
|
139
|
+
]); // Takes care of looping focus (when tabbing whilst at the edges)
|
|
140
|
+
const handleKeyDown = useCallback((event)=>{
|
|
141
|
+
if (!loop && !trapped) return;
|
|
142
|
+
if (focusScope.paused) return;
|
|
143
|
+
const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
144
|
+
const focusedElement = document.activeElement;
|
|
145
|
+
if (isTabKey && focusedElement) {
|
|
146
|
+
const container = event.currentTarget;
|
|
147
|
+
const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container);
|
|
148
|
+
const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges
|
|
149
|
+
if (!hasTabbableElementsInside) {
|
|
150
|
+
if (focusedElement === container) event.preventDefault();
|
|
151
|
+
} else {
|
|
152
|
+
if (!event.shiftKey && focusedElement === last) {
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
if (loop) $d3863c46a17e8a28$var$focus(first, {
|
|
155
|
+
select: true
|
|
156
|
+
});
|
|
157
|
+
} else if (event.shiftKey && focusedElement === first) {
|
|
158
|
+
event.preventDefault();
|
|
159
|
+
if (loop) $d3863c46a17e8a28$var$focus(last, {
|
|
160
|
+
select: true
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}, [
|
|
166
|
+
loop,
|
|
167
|
+
trapped,
|
|
168
|
+
focusScope.paused
|
|
169
|
+
]);
|
|
170
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
171
|
+
tabIndex: -1
|
|
172
|
+
}, scopeProps, {
|
|
173
|
+
ref: composedRefs,
|
|
174
|
+
onKeyDown: handleKeyDown
|
|
175
|
+
}));
|
|
176
|
+
});
|
|
177
|
+
/* -------------------------------------------------------------------------------------------------
|
|
178
|
+
* Utils
|
|
179
|
+
* -----------------------------------------------------------------------------------------------*/ /**
|
|
180
|
+
* Attempts focusing the first element in a list of candidates.
|
|
181
|
+
* Stops when focus has actually moved.
|
|
182
|
+
*/ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) {
|
|
183
|
+
const previouslyFocusedElement = document.activeElement;
|
|
184
|
+
for (const candidate of candidates){
|
|
185
|
+
$d3863c46a17e8a28$var$focus(candidate, {
|
|
186
|
+
select: select
|
|
187
|
+
});
|
|
188
|
+
if (document.activeElement !== previouslyFocusedElement) return;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Returns the first and last tabbable elements inside a container.
|
|
193
|
+
*/ function $d3863c46a17e8a28$var$getTabbableEdges(container) {
|
|
194
|
+
const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container);
|
|
195
|
+
const first = $d3863c46a17e8a28$var$findVisible(candidates, container);
|
|
196
|
+
const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container);
|
|
197
|
+
return [
|
|
198
|
+
first,
|
|
199
|
+
last
|
|
200
|
+
];
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Returns a list of potential tabbable candidates.
|
|
204
|
+
*
|
|
205
|
+
* NOTE: This is only a close approximation. For example it doesn't take into account cases like when
|
|
206
|
+
* elements are not visible. This cannot be worked out easily by just reading a property, but rather
|
|
207
|
+
* necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.
|
|
208
|
+
*
|
|
209
|
+
* See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
|
|
210
|
+
* Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
|
|
211
|
+
*/ function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
|
|
212
|
+
const nodes = [];
|
|
213
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
214
|
+
acceptNode: (node)=>{
|
|
215
|
+
const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';
|
|
216
|
+
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
|
|
217
|
+
// runtime's understanding of tabbability, so this automatically accounts
|
|
218
|
+
// for any kind of element that could be tabbed to.
|
|
219
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it
|
|
223
|
+
// hinders accessibility to have tab order different from visual order.
|
|
224
|
+
return nodes;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Returns the first visible element in a list.
|
|
228
|
+
* NOTE: Only checks visibility up to the `container`.
|
|
229
|
+
*/ function $d3863c46a17e8a28$var$findVisible(elements, container) {
|
|
230
|
+
for (const element of elements){
|
|
231
|
+
// we stop checking if it's hidden at the `container` level (excluding)
|
|
232
|
+
if (!$d3863c46a17e8a28$var$isHidden(element, {
|
|
233
|
+
upTo: container
|
|
234
|
+
})) return element;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) {
|
|
238
|
+
if (getComputedStyle(node).visibility === 'hidden') return true;
|
|
239
|
+
while(node){
|
|
240
|
+
// we stop at `upTo` (excluding it)
|
|
241
|
+
if (upTo !== undefined && node === upTo) return false;
|
|
242
|
+
if (getComputedStyle(node).display === 'none') return true;
|
|
243
|
+
node = node.parentElement;
|
|
244
|
+
}
|
|
245
|
+
return false;
|
|
246
|
+
}
|
|
247
|
+
function $d3863c46a17e8a28$var$isSelectableInput(element) {
|
|
248
|
+
return element instanceof HTMLInputElement && 'select' in element;
|
|
249
|
+
}
|
|
250
|
+
function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) {
|
|
251
|
+
// only focus if that element is focusable
|
|
252
|
+
if (element && element.focus) {
|
|
253
|
+
const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users
|
|
254
|
+
element.focus({
|
|
255
|
+
preventScroll: true
|
|
256
|
+
}); // only select if its not the same element, it supports selection and we need to select
|
|
257
|
+
if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
/* -------------------------------------------------------------------------------------------------
|
|
261
|
+
* FocusScope stack
|
|
262
|
+
* -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
|
|
263
|
+
function $d3863c46a17e8a28$var$createFocusScopesStack() {
|
|
264
|
+
/** A stack of focus scopes, with the active one at the top */ let stack = [];
|
|
265
|
+
return {
|
|
266
|
+
add (focusScope) {
|
|
267
|
+
// pause the currently active focus scope (at the top of the stack)
|
|
268
|
+
const activeFocusScope = stack[0];
|
|
269
|
+
if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
|
|
270
|
+
// remove in case it already exists (because we'll re-add it at the top of the stack)
|
|
271
|
+
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
272
|
+
stack.unshift(focusScope);
|
|
273
|
+
},
|
|
274
|
+
remove (focusScope) {
|
|
275
|
+
var _stack$;
|
|
276
|
+
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
277
|
+
(_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
function $d3863c46a17e8a28$var$arrayRemove(array, item) {
|
|
282
|
+
const updatedArray = [
|
|
283
|
+
...array
|
|
284
|
+
];
|
|
285
|
+
const index = updatedArray.indexOf(item);
|
|
286
|
+
if (index !== -1) updatedArray.splice(index, 1);
|
|
287
|
+
return updatedArray;
|
|
288
|
+
}
|
|
289
|
+
function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
290
|
+
return items.filter((item)=>item.tagName !== 'A'
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
|
|
295
|
+
/**
|
|
296
|
+
* Injects a pair of focus guards at the edges of the whole DOM tree
|
|
297
|
+
* to ensure `focusin` & `focusout` events can be caught consistently.
|
|
298
|
+
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
299
|
+
useEffect(()=>{
|
|
300
|
+
var _edgeGuards$, _edgeGuards$2;
|
|
301
|
+
const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
|
|
302
|
+
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
303
|
+
document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
304
|
+
$3db38b7d1fb3fe6a$var$count++;
|
|
305
|
+
return ()=>{
|
|
306
|
+
if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
|
|
307
|
+
);
|
|
308
|
+
$3db38b7d1fb3fe6a$var$count--;
|
|
309
|
+
};
|
|
310
|
+
}, []);
|
|
311
|
+
}
|
|
312
|
+
function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
313
|
+
const element = document.createElement('span');
|
|
314
|
+
element.setAttribute('data-radix-focus-guard', '');
|
|
315
|
+
element.tabIndex = 0;
|
|
316
|
+
element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
|
|
317
|
+
return element;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* -------------------------------------------------------------------------------------------------
|
|
321
|
+
* Slot
|
|
322
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
323
|
+
const { children: children , ...slotProps } = props;
|
|
324
|
+
const childrenArray = Children.toArray(children);
|
|
325
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
326
|
+
if (slottable) {
|
|
327
|
+
// the new element to render is the one passed as a child of `Slottable`
|
|
328
|
+
const newElement = slottable.props.children;
|
|
329
|
+
const newChildren = childrenArray.map((child)=>{
|
|
330
|
+
if (child === slottable) {
|
|
331
|
+
// because the new element will be the one rendered, we are only interested
|
|
332
|
+
// in grabbing its children (`newElement.props.children`)
|
|
333
|
+
if (Children.count(newElement) > 1) return Children.only(null);
|
|
334
|
+
return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null;
|
|
335
|
+
} else return child;
|
|
336
|
+
});
|
|
337
|
+
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
338
|
+
ref: forwardedRef
|
|
339
|
+
}), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null);
|
|
340
|
+
}
|
|
341
|
+
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
342
|
+
ref: forwardedRef
|
|
343
|
+
}), children);
|
|
344
|
+
});
|
|
345
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
|
346
|
+
/* -------------------------------------------------------------------------------------------------
|
|
347
|
+
* SlotClone
|
|
348
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
349
|
+
const { children: children , ...slotProps } = props;
|
|
350
|
+
if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
|
|
351
|
+
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
352
|
+
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
|
353
|
+
});
|
|
354
|
+
return Children.count(children) > 1 ? Children.only(null) : null;
|
|
355
|
+
});
|
|
356
|
+
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
|
|
357
|
+
/* -------------------------------------------------------------------------------------------------
|
|
358
|
+
* Slottable
|
|
359
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
|
|
360
|
+
return /*#__PURE__*/ createElement(Fragment, null, children);
|
|
361
|
+
};
|
|
362
|
+
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
363
|
+
return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
364
|
+
}
|
|
365
|
+
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
366
|
+
// all child props should override
|
|
367
|
+
const overrideProps = {
|
|
368
|
+
...childProps
|
|
369
|
+
};
|
|
370
|
+
for(const propName in childProps){
|
|
371
|
+
const slotPropValue = slotProps[propName];
|
|
372
|
+
const childPropValue = childProps[propName];
|
|
373
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
374
|
+
if (isHandler) {
|
|
375
|
+
// if the handler exists on both, we compose them
|
|
376
|
+
if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{
|
|
377
|
+
childPropValue(...args);
|
|
378
|
+
slotPropValue(...args);
|
|
379
|
+
};
|
|
380
|
+
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
381
|
+
} else if (propName === 'style') overrideProps[propName] = {
|
|
382
|
+
...slotPropValue,
|
|
383
|
+
...childPropValue
|
|
384
|
+
};
|
|
385
|
+
else if (propName === 'className') overrideProps[propName] = [
|
|
386
|
+
slotPropValue,
|
|
387
|
+
childPropValue
|
|
388
|
+
].filter(Boolean).join(' ');
|
|
389
|
+
}
|
|
390
|
+
return {
|
|
391
|
+
...slotProps,
|
|
392
|
+
...overrideProps
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* -------------------------------------------------------------------------------------------------
|
|
397
|
+
* Dialog
|
|
398
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DIALOG_NAME = 'Dialog';
|
|
399
|
+
const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
400
|
+
const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
|
|
401
|
+
const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{
|
|
402
|
+
const { __scopeDialog: __scopeDialog , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
|
|
403
|
+
const triggerRef = useRef(null);
|
|
404
|
+
const contentRef = useRef(null);
|
|
405
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
406
|
+
prop: openProp,
|
|
407
|
+
defaultProp: defaultOpen,
|
|
408
|
+
onChange: onOpenChange
|
|
409
|
+
});
|
|
410
|
+
return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogProvider, {
|
|
411
|
+
scope: __scopeDialog,
|
|
412
|
+
triggerRef: triggerRef,
|
|
413
|
+
contentRef: contentRef,
|
|
414
|
+
contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
415
|
+
titleId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
416
|
+
descriptionId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
417
|
+
open: open,
|
|
418
|
+
onOpenChange: setOpen,
|
|
419
|
+
onOpenToggle: useCallback(()=>setOpen((prevOpen)=>!prevOpen
|
|
420
|
+
)
|
|
421
|
+
, [
|
|
422
|
+
setOpen
|
|
423
|
+
]),
|
|
424
|
+
modal: modal
|
|
425
|
+
}, children);
|
|
426
|
+
};
|
|
427
|
+
/* -------------------------------------------------------------------------------------------------
|
|
428
|
+
* DialogPortal
|
|
429
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$PORTAL_NAME = 'DialogPortal';
|
|
430
|
+
const [$5d3850c4d0b4e6c7$var$PortalProvider, $5d3850c4d0b4e6c7$var$usePortalContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, {
|
|
431
|
+
forceMount: undefined
|
|
432
|
+
});
|
|
433
|
+
const $5d3850c4d0b4e6c7$export$dad7c95542bacce0 = (props)=>{
|
|
434
|
+
const { __scopeDialog: __scopeDialog , forceMount: forceMount , children: children , container: container } = props;
|
|
435
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, __scopeDialog);
|
|
436
|
+
return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$PortalProvider, {
|
|
437
|
+
scope: __scopeDialog,
|
|
438
|
+
forceMount: forceMount
|
|
439
|
+
}, Children.map(children, (child)=>/*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
440
|
+
present: forceMount || context.open
|
|
441
|
+
}, /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c, {
|
|
442
|
+
asChild: true,
|
|
443
|
+
container: container
|
|
444
|
+
}, child))
|
|
445
|
+
));
|
|
446
|
+
};
|
|
447
|
+
/* -------------------------------------------------------------------------------------------------
|
|
448
|
+
* DialogOverlay
|
|
449
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$OVERLAY_NAME = 'DialogOverlay';
|
|
450
|
+
const $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
451
|
+
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
|
|
452
|
+
const { forceMount: forceMount = portalContext.forceMount , ...overlayProps } = props;
|
|
453
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
|
|
454
|
+
return context.modal ? /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
455
|
+
present: forceMount || context.open
|
|
456
|
+
}, /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogOverlayImpl, _extends({}, overlayProps, {
|
|
457
|
+
ref: forwardedRef
|
|
458
|
+
}))) : null;
|
|
459
|
+
});
|
|
460
|
+
const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
461
|
+
const { __scopeDialog: __scopeDialog , ...overlayProps } = props;
|
|
462
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, __scopeDialog);
|
|
463
|
+
return(/*#__PURE__*/ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
464
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
465
|
+
createElement($01b9c$RemoveScroll, {
|
|
466
|
+
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
467
|
+
allowPinchZoom: true,
|
|
468
|
+
shards: [
|
|
469
|
+
context.contentRef
|
|
470
|
+
]
|
|
471
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
472
|
+
"data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
|
|
473
|
+
}, overlayProps, {
|
|
474
|
+
ref: forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.
|
|
475
|
+
,
|
|
476
|
+
style: {
|
|
477
|
+
pointerEvents: 'auto',
|
|
478
|
+
...overlayProps.style
|
|
479
|
+
}
|
|
480
|
+
}))));
|
|
481
|
+
});
|
|
482
|
+
/* -------------------------------------------------------------------------------------------------
|
|
483
|
+
* DialogContent
|
|
484
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CONTENT_NAME = 'DialogContent';
|
|
485
|
+
const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
486
|
+
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
487
|
+
const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
|
|
488
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
489
|
+
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
490
|
+
present: forceMount || context.open
|
|
491
|
+
}, context.modal ? /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentModal, _extends({}, contentProps, {
|
|
492
|
+
ref: forwardedRef
|
|
493
|
+
})) : /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentNonModal, _extends({}, contentProps, {
|
|
494
|
+
ref: forwardedRef
|
|
495
|
+
})));
|
|
496
|
+
});
|
|
497
|
+
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
498
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
499
|
+
const contentRef = useRef(null);
|
|
500
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
501
|
+
useEffect(()=>{
|
|
502
|
+
const content = contentRef.current;
|
|
503
|
+
if (content) return hideOthers(content);
|
|
504
|
+
}, []);
|
|
505
|
+
return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
|
|
506
|
+
ref: composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed
|
|
507
|
+
,
|
|
508
|
+
trapFocus: context.open,
|
|
509
|
+
disableOutsidePointerEvents: true,
|
|
510
|
+
onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onCloseAutoFocus, (event)=>{
|
|
511
|
+
var _context$triggerRef$c;
|
|
512
|
+
event.preventDefault();
|
|
513
|
+
(_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
|
|
514
|
+
}),
|
|
515
|
+
onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownOutside, (event)=>{
|
|
516
|
+
const originalEvent = event.detail.originalEvent;
|
|
517
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
518
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because
|
|
519
|
+
// it is effectively as if we right-clicked the `Overlay`.
|
|
520
|
+
if (isRightClick) event.preventDefault();
|
|
521
|
+
}) // When focus is trapped, a `focusout` event may still happen.
|
|
522
|
+
,
|
|
523
|
+
onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusOutside, (event)=>event.preventDefault()
|
|
524
|
+
)
|
|
525
|
+
}));
|
|
526
|
+
});
|
|
527
|
+
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentNonModal = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
528
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
|
|
529
|
+
const hasInteractedOutsideRef = useRef(false);
|
|
530
|
+
const hasPointerDownOutsideRef = useRef(false);
|
|
531
|
+
return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
|
|
532
|
+
ref: forwardedRef,
|
|
533
|
+
trapFocus: false,
|
|
534
|
+
disableOutsidePointerEvents: false,
|
|
535
|
+
onCloseAutoFocus: (event)=>{
|
|
536
|
+
var _props$onCloseAutoFoc;
|
|
537
|
+
(_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event);
|
|
538
|
+
if (!event.defaultPrevented) {
|
|
539
|
+
var _context$triggerRef$c2;
|
|
540
|
+
if (!hasInteractedOutsideRef.current) (_context$triggerRef$c2 = context.triggerRef.current) === null || _context$triggerRef$c2 === void 0 || _context$triggerRef$c2.focus(); // Always prevent auto focus because we either focus manually or want user agent focus
|
|
541
|
+
event.preventDefault();
|
|
542
|
+
}
|
|
543
|
+
hasInteractedOutsideRef.current = false;
|
|
544
|
+
hasPointerDownOutsideRef.current = false;
|
|
545
|
+
},
|
|
546
|
+
onInteractOutside: (event)=>{
|
|
547
|
+
var _props$onInteractOuts, _context$triggerRef$c3;
|
|
548
|
+
(_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
|
|
549
|
+
if (!event.defaultPrevented) {
|
|
550
|
+
hasInteractedOutsideRef.current = true;
|
|
551
|
+
if (event.detail.originalEvent.type === 'pointerdown') hasPointerDownOutsideRef.current = true;
|
|
552
|
+
} // Prevent dismissing when clicking the trigger.
|
|
553
|
+
// As the trigger is already setup to close, without doing so would
|
|
554
|
+
// cause it to close and immediately open.
|
|
555
|
+
const target = event.target;
|
|
556
|
+
const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target);
|
|
557
|
+
if (targetIsTrigger) event.preventDefault(); // On Safari if the trigger is inside a container with tabIndex={0}, when clicked
|
|
558
|
+
// we will get the pointer down outside event on the trigger, but then a subsequent
|
|
559
|
+
// focus outside event on the container, we ignore any focus outside event when we've
|
|
560
|
+
// already had a pointer down outside event.
|
|
561
|
+
if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) event.preventDefault();
|
|
562
|
+
}
|
|
563
|
+
}));
|
|
564
|
+
});
|
|
565
|
+
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentImpl = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
566
|
+
const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
|
|
567
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, __scopeDialog);
|
|
568
|
+
const contentRef = useRef(null);
|
|
569
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
|
|
570
|
+
// the last element in the DOM (beacuse of the `Portal`)
|
|
571
|
+
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
572
|
+
return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
573
|
+
asChild: true,
|
|
574
|
+
loop: true,
|
|
575
|
+
trapped: trapFocus,
|
|
576
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
577
|
+
onUnmountAutoFocus: onCloseAutoFocus
|
|
578
|
+
}, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends({
|
|
579
|
+
role: "dialog",
|
|
580
|
+
id: context.contentId,
|
|
581
|
+
"aria-describedby": context.descriptionId,
|
|
582
|
+
"aria-labelledby": context.titleId,
|
|
583
|
+
"data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
|
|
584
|
+
}, contentProps, {
|
|
585
|
+
ref: composedRefs,
|
|
586
|
+
onDismiss: ()=>context.onOpenChange(false)
|
|
587
|
+
}))), false);
|
|
588
|
+
});
|
|
589
|
+
/* -------------------------------------------------------------------------------------------------
|
|
590
|
+
* DialogTitle
|
|
591
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TITLE_NAME = 'DialogTitle';
|
|
592
|
+
const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
593
|
+
const { __scopeDialog: __scopeDialog , ...titleProps } = props;
|
|
594
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TITLE_NAME, __scopeDialog);
|
|
595
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.h2, _extends({
|
|
596
|
+
id: context.titleId
|
|
597
|
+
}, titleProps, {
|
|
598
|
+
ref: forwardedRef
|
|
599
|
+
}));
|
|
600
|
+
});
|
|
601
|
+
/* -------------------------------------------------------------------------------------------------
|
|
602
|
+
* DialogDescription
|
|
603
|
+
* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME = 'DialogDescription';
|
|
604
|
+
const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
605
|
+
const { __scopeDialog: __scopeDialog , ...descriptionProps } = props;
|
|
606
|
+
const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$DESCRIPTION_NAME, __scopeDialog);
|
|
607
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.p, _extends({
|
|
608
|
+
id: context.descriptionId
|
|
609
|
+
}, descriptionProps, {
|
|
610
|
+
ref: forwardedRef
|
|
611
|
+
}));
|
|
612
|
+
});
|
|
613
|
+
/* -----------------------------------------------------------------------------------------------*/ function $5d3850c4d0b4e6c7$var$getState(open) {
|
|
614
|
+
return open ? 'open' : 'closed';
|
|
615
|
+
}
|
|
616
|
+
const $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9 = $5d3850c4d0b4e6c7$export$3ddf2d174ce01153;
|
|
617
|
+
const $5d3850c4d0b4e6c7$export$602eac185826482c = $5d3850c4d0b4e6c7$export$dad7c95542bacce0;
|
|
618
|
+
const $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff = $5d3850c4d0b4e6c7$export$bd1d06c79be19e17;
|
|
619
|
+
const $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2 = $5d3850c4d0b4e6c7$export$b6d9565de1e068cf;
|
|
620
|
+
const $5d3850c4d0b4e6c7$export$f99233281efd08a0 = $5d3850c4d0b4e6c7$export$16f7638e4a34b909;
|
|
621
|
+
const $5d3850c4d0b4e6c7$export$393edc798c47379d = $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5;
|
|
622
|
+
|
|
623
|
+
/** Use `Modal` to focus a user's attention to an urgent or required prompt for interaction or input. */
|
|
624
|
+
var Modal = function (_a) {
|
|
625
|
+
var title = _a.title, description = _a.description, ariaDescribedBy = _a.ariaDescribedBy, isOpen = _a.isOpen, actions = _a.actions, onRequestClose = _a.onRequestClose, children = _a.children, _b = _a.role, role = _b === void 0 ? "dialog" : _b, _c = _a.shouldReturnFocus, shouldReturnFocus = _c === void 0 ? true : _c, _d = _a.isContentScrollable, isContentScrollable = _d === void 0 ? false : _d, _e = _a.size, size = _e === void 0 ? "l" : _e, props = __rest(_a, ["title", "description", "ariaDescribedBy", "isOpen", "actions", "onRequestClose", "children", "role", "shouldReturnFocus", "isContentScrollable", "size"]);
|
|
626
|
+
var arcRootElement = useContext(ArcRootElementContext);
|
|
627
|
+
var triggerRef = useRef(null);
|
|
628
|
+
var setTriggerElement = function () {
|
|
629
|
+
return shouldReturnFocus &&
|
|
630
|
+
(triggerRef.current = document.activeElement);
|
|
631
|
+
};
|
|
632
|
+
var focusTriggerElement = function () {
|
|
633
|
+
if (triggerRef.current) {
|
|
634
|
+
triggerRef.current.focus();
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
var canShowClose = role !== "alertdialog" && onRequestClose;
|
|
638
|
+
var hasContent = description || children;
|
|
639
|
+
var ariaProps = __assign({}, (ariaDescribedBy ? { "aria-describedby": ariaDescribedBy } : {}));
|
|
640
|
+
var closeModal = function () {
|
|
641
|
+
if (role !== "alertdialog" && onRequestClose) {
|
|
642
|
+
onRequestClose();
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
return (React__default.createElement($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, { open: isOpen },
|
|
646
|
+
React__default.createElement($5d3850c4d0b4e6c7$export$602eac185826482c, { container: arcRootElement },
|
|
647
|
+
React__default.createElement($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, { className: "arc-Modal-overlay" },
|
|
648
|
+
React__default.createElement($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, __assign({}, ariaProps, { role: role, onOpenAutoFocus: setTriggerElement, onCloseAutoFocus: focusTriggerElement, onEscapeKeyDown: closeModal, onInteractOutside: closeModal, className: classNames("arc-Modal-dialog", "arc-Modal-dialog--".concat(size), {
|
|
649
|
+
"arc-Modal-dialog--maxHeightWindow": isContentScrollable
|
|
650
|
+
}) }, filterDataAttrs(props)),
|
|
651
|
+
React__default.createElement("div", { className: "arc-Modal-section" },
|
|
652
|
+
React__default.createElement($5d3850c4d0b4e6c7$export$f99233281efd08a0, { asChild: true },
|
|
653
|
+
React__default.createElement(Heading, { level: "1", size: "m" }, title))),
|
|
654
|
+
React__default.createElement(VerticalSpace, { size: "12" }),
|
|
655
|
+
hasContent && (React__default.createElement("div", { className: "arc-Modal-content" },
|
|
656
|
+
React__default.createElement("div", { className: "arc-Modal-section" },
|
|
657
|
+
description && (React__default.createElement($5d3850c4d0b4e6c7$export$393edc798c47379d, { asChild: true },
|
|
658
|
+
React__default.createElement(Text, null, description))),
|
|
659
|
+
description && children && (React__default.createElement(VerticalSpace, { "data-testid": "arc-modal-vertical-space", size: "20" })),
|
|
660
|
+
children))),
|
|
661
|
+
actions && (React__default.createElement("div", { className: "arc-Modal-section" },
|
|
662
|
+
React__default.createElement("div", { className: "arc-Modal-actions" }, actions.map(function (props, i) { return (React__default.createElement("div", { key: "arc-modal-button-".concat(i), className: "arc-Modal-actionButton" },
|
|
663
|
+
React__default.createElement(Button, __assign({ isFullWidth: true }, props)))); })))),
|
|
664
|
+
canShowClose && (React__default.createElement("div", { className: "arc-Modal-iconContainer" },
|
|
665
|
+
React__default.createElement("button", { "aria-label": "close", onClick: closeModal, className: "arc-Modal-closeButton" },
|
|
666
|
+
React__default.createElement(Icon, { size: 32, icon: BtIconCrossAlt2Px_2 })))))))));
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
export { Modal };
|