@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
|
@@ -2,21 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var filterDataAttrs = require('../_shared/cjs/filter-data-attrs-a30dcf5f.js');
|
|
6
|
+
var index$1 = require('../_shared/cjs/index-45bfb67b.js');
|
|
6
7
|
var React$1 = require('react');
|
|
7
|
-
var
|
|
8
|
+
var _extends = require('../_shared/cjs/extends-bb8ffacd.js');
|
|
8
9
|
var $7SXl2$reactdom = require('react-dom');
|
|
10
|
+
var index_module = require('../_shared/cjs/index.module-bbcc4e18.js');
|
|
11
|
+
var index = require('../_shared/cjs/index-ec260f5e.js');
|
|
9
12
|
var BtIconChevronDown2Px = require('../_shared/cjs/BtIconChevronDown2Px-8fb4e2eb.js');
|
|
10
13
|
var BtIconTickAlt2Px = require('../_shared/cjs/BtIconTickAlt2Px-bdf06f8c.js');
|
|
11
|
-
var Icon = require('../_shared/cjs/Icon-
|
|
12
|
-
var FormControl = require('../_shared/cjs/FormControl-
|
|
13
|
-
var Surface = require('../_shared/cjs/Surface-
|
|
14
|
+
var Icon = require('../_shared/cjs/Icon-e1dd45eb.js');
|
|
15
|
+
var FormControl = require('../_shared/cjs/FormControl-1e1bf2bf.js');
|
|
16
|
+
var Surface = require('../_shared/cjs/Surface-b7c51b2b.js');
|
|
14
17
|
var Base = require('../_shared/cjs/Base-569e4334.js');
|
|
15
|
-
require('../_shared/cjs/filter-data-attrs-a30dcf5f.js');
|
|
16
18
|
require('../_shared/cjs/suffix-modifier-1ee2da04.js');
|
|
17
19
|
require('../_shared/cjs/BtIconAlert-637db790.js');
|
|
18
|
-
require('../_shared/cjs/DisclosureMini-
|
|
19
|
-
require('../_shared/cjs/Text-
|
|
20
|
+
require('../_shared/cjs/DisclosureMini-52706ee6.js');
|
|
21
|
+
require('../_shared/cjs/Text-fa447e2d.js');
|
|
20
22
|
|
|
21
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
24
|
|
|
@@ -46,6 +48,133 @@ function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(value, [min, max]) {
|
|
|
46
48
|
return Math.min(max, Math.max(min, value));
|
|
47
49
|
}
|
|
48
50
|
|
|
51
|
+
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
|
|
52
|
+
return function handleEvent(event) {
|
|
53
|
+
originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
|
|
54
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* -------------------------------------------------------------------------------------------------
|
|
59
|
+
* createContextScope
|
|
60
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
|
|
61
|
+
let defaultContexts = [];
|
|
62
|
+
/* -----------------------------------------------------------------------------------------------
|
|
63
|
+
* createContext
|
|
64
|
+
* ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
|
|
65
|
+
const BaseContext = /*#__PURE__*/ React$1.createContext(defaultContext);
|
|
66
|
+
const index = defaultContexts.length;
|
|
67
|
+
defaultContexts = [
|
|
68
|
+
...defaultContexts,
|
|
69
|
+
defaultContext
|
|
70
|
+
];
|
|
71
|
+
function Provider(props) {
|
|
72
|
+
const { scope: scope , children: children , ...context } = props;
|
|
73
|
+
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
|
|
74
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
75
|
+
const value = React$1.useMemo(()=>context
|
|
76
|
+
, Object.values(context));
|
|
77
|
+
return /*#__PURE__*/ React$1.createElement(Context.Provider, {
|
|
78
|
+
value: value
|
|
79
|
+
}, children);
|
|
80
|
+
}
|
|
81
|
+
function useContext(consumerName, scope) {
|
|
82
|
+
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
|
|
83
|
+
const context = React$1.useContext(Context);
|
|
84
|
+
if (context) return context;
|
|
85
|
+
if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
|
|
86
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
87
|
+
}
|
|
88
|
+
Provider.displayName = rootComponentName + 'Provider';
|
|
89
|
+
return [
|
|
90
|
+
Provider,
|
|
91
|
+
useContext
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
/* -----------------------------------------------------------------------------------------------
|
|
95
|
+
* createScope
|
|
96
|
+
* ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
|
|
97
|
+
const scopeContexts = defaultContexts.map((defaultContext)=>{
|
|
98
|
+
return /*#__PURE__*/ React$1.createContext(defaultContext);
|
|
99
|
+
});
|
|
100
|
+
return function useScope(scope) {
|
|
101
|
+
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
|
|
102
|
+
return React$1.useMemo(()=>({
|
|
103
|
+
[`__scope${scopeName}`]: {
|
|
104
|
+
...scope,
|
|
105
|
+
[scopeName]: contexts
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
, [
|
|
109
|
+
scope,
|
|
110
|
+
contexts
|
|
111
|
+
]);
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
createScope.scopeName = scopeName;
|
|
115
|
+
return [
|
|
116
|
+
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
117
|
+
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
/* -------------------------------------------------------------------------------------------------
|
|
121
|
+
* composeContextScopes
|
|
122
|
+
* -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
|
123
|
+
const baseScope = scopes[0];
|
|
124
|
+
if (scopes.length === 1) return baseScope;
|
|
125
|
+
const createScope1 = ()=>{
|
|
126
|
+
const scopeHooks = scopes.map((createScope)=>({
|
|
127
|
+
useScope: createScope(),
|
|
128
|
+
scopeName: createScope.scopeName
|
|
129
|
+
})
|
|
130
|
+
);
|
|
131
|
+
return function useComposedScopes(overrideScopes) {
|
|
132
|
+
const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
|
|
133
|
+
// We are calling a hook inside a callback which React warns against to avoid inconsistent
|
|
134
|
+
// renders, however, scoping doesn't have render side effects so we ignore the rule.
|
|
135
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
136
|
+
const scopeProps = useScope(overrideScopes);
|
|
137
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
138
|
+
return {
|
|
139
|
+
...nextScopes,
|
|
140
|
+
...currentScope
|
|
141
|
+
};
|
|
142
|
+
}, {});
|
|
143
|
+
return React$1.useMemo(()=>({
|
|
144
|
+
[`__scope${baseScope.scopeName}`]: nextScopes1
|
|
145
|
+
})
|
|
146
|
+
, [
|
|
147
|
+
nextScopes1
|
|
148
|
+
]);
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
createScope1.scopeName = baseScope.scopeName;
|
|
152
|
+
return createScope1;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Set a given ref to a given value
|
|
157
|
+
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
158
|
+
*/ function $6ed0406888f73fc4$var$setRef$1(ref, value) {
|
|
159
|
+
if (typeof ref === 'function') ref(value);
|
|
160
|
+
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* A utility to compose multiple refs together
|
|
164
|
+
* Accepts callback refs and RefObject(s)
|
|
165
|
+
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af$1(...refs) {
|
|
166
|
+
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef$1(ref, node)
|
|
167
|
+
)
|
|
168
|
+
;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* A custom hook that composes multiple refs
|
|
172
|
+
* Accepts callback refs and RefObject(s)
|
|
173
|
+
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(...refs) {
|
|
174
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
175
|
+
return React$1.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af$1(...refs), refs);
|
|
176
|
+
}
|
|
177
|
+
|
|
49
178
|
// We have resorted to returning slots directly rather than exposing primitives that can then
|
|
50
179
|
// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
|
|
51
180
|
// This is because we encountered issues with generic types that cannot be statically analysed
|
|
@@ -54,7 +183,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
54
183
|
/* -----------------------------------------------------------------------------------------------
|
|
55
184
|
* CollectionProvider
|
|
56
185
|
* ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
|
|
57
|
-
const [createCollectionContext, createCollectionScope] =
|
|
186
|
+
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
|
|
58
187
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
59
188
|
collectionRef: {
|
|
60
189
|
current: null
|
|
@@ -77,7 +206,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
77
206
|
const CollectionSlot = /*#__PURE__*/ React__default["default"].forwardRef((props, forwardedRef)=>{
|
|
78
207
|
const { scope: scope , children: children } = props;
|
|
79
208
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
80
|
-
const composedRefs =
|
|
209
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.collectionRef);
|
|
81
210
|
return /*#__PURE__*/ React__default["default"].createElement(index_module.$5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
82
211
|
ref: composedRefs
|
|
83
212
|
}, children);
|
|
@@ -89,7 +218,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
89
218
|
const CollectionItemSlot = /*#__PURE__*/ React__default["default"].forwardRef((props, forwardedRef)=>{
|
|
90
219
|
const { scope: scope , children: children , ...itemData } = props;
|
|
91
220
|
const ref = React__default["default"].useRef(null);
|
|
92
|
-
const composedRefs =
|
|
221
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
93
222
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
94
223
|
React__default["default"].useEffect(()=>{
|
|
95
224
|
context.itemMap.set(ref, {
|
|
@@ -139,10 +268,104 @@ const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ React$1.createConte
|
|
|
139
268
|
return localDir || globalDir || 'ltr';
|
|
140
269
|
}
|
|
141
270
|
|
|
271
|
+
const $8927f6f2acc4f386$var$NODES$2 = [
|
|
272
|
+
'a',
|
|
273
|
+
'button',
|
|
274
|
+
'div',
|
|
275
|
+
'h2',
|
|
276
|
+
'h3',
|
|
277
|
+
'img',
|
|
278
|
+
'label',
|
|
279
|
+
'li',
|
|
280
|
+
'nav',
|
|
281
|
+
'ol',
|
|
282
|
+
'p',
|
|
283
|
+
'span',
|
|
284
|
+
'svg',
|
|
285
|
+
'ul'
|
|
286
|
+
]; // Temporary while we await merge of this fix:
|
|
287
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
|
|
288
|
+
// prettier-ignore
|
|
289
|
+
/* -------------------------------------------------------------------------------------------------
|
|
290
|
+
* Primitive
|
|
291
|
+
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034$2 = $8927f6f2acc4f386$var$NODES$2.reduce((primitive, node)=>{
|
|
292
|
+
const Node = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
293
|
+
const { asChild: asChild , ...primitiveProps } = props;
|
|
294
|
+
const Comp = asChild ? index_module.$5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
295
|
+
React$1.useEffect(()=>{
|
|
296
|
+
window[Symbol.for('radix-ui')] = true;
|
|
297
|
+
}, []);
|
|
298
|
+
return /*#__PURE__*/ React$1.createElement(Comp, _extends._extends({}, primitiveProps, {
|
|
299
|
+
ref: forwardedRef
|
|
300
|
+
}));
|
|
301
|
+
});
|
|
302
|
+
Node.displayName = `Primitive.${node}`;
|
|
303
|
+
return {
|
|
304
|
+
...primitive,
|
|
305
|
+
[node]: Node
|
|
306
|
+
};
|
|
307
|
+
}, {});
|
|
308
|
+
/* -------------------------------------------------------------------------------------------------
|
|
309
|
+
* Utils
|
|
310
|
+
* -----------------------------------------------------------------------------------------------*/ /**
|
|
311
|
+
* Flush custom event dispatch
|
|
312
|
+
* https://github.com/radix-ui/primitives/pull/1378
|
|
313
|
+
*
|
|
314
|
+
* React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.
|
|
315
|
+
*
|
|
316
|
+
* Internally, React prioritises events in the following order:
|
|
317
|
+
* - discrete
|
|
318
|
+
* - continuous
|
|
319
|
+
* - default
|
|
320
|
+
*
|
|
321
|
+
* https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350
|
|
322
|
+
*
|
|
323
|
+
* `discrete` is an important distinction as updates within these events are applied immediately.
|
|
324
|
+
* React however, is not able to infer the priority of custom event types due to how they are detected internally.
|
|
325
|
+
* Because of this, it's possible for updates from custom events to be unexpectedly batched when
|
|
326
|
+
* dispatched by another `discrete` event.
|
|
327
|
+
*
|
|
328
|
+
* In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.
|
|
329
|
+
* This utility should be used when dispatching a custom event from within another `discrete` event, this utility
|
|
330
|
+
* is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.
|
|
331
|
+
* For example:
|
|
332
|
+
*
|
|
333
|
+
* dispatching a known click 👎
|
|
334
|
+
* target.dispatchEvent(new Event(‘click’))
|
|
335
|
+
*
|
|
336
|
+
* dispatching a custom type within a non-discrete event 👎
|
|
337
|
+
* onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}
|
|
338
|
+
*
|
|
339
|
+
* dispatching a custom type within a `discrete` event 👍
|
|
340
|
+
* onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}
|
|
341
|
+
*
|
|
342
|
+
* Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
|
|
343
|
+
* this utility with them. This is because it's possible for those handlers to be called implicitly during render
|
|
344
|
+
* e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
|
|
345
|
+
*/ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
|
|
346
|
+
if (target) $7SXl2$reactdom.flushSync(()=>target.dispatchEvent(event)
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
352
|
+
* prop or avoid re-executing effects when passed as a dependency
|
|
353
|
+
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(callback) {
|
|
354
|
+
const callbackRef = React$1.useRef(callback);
|
|
355
|
+
React$1.useEffect(()=>{
|
|
356
|
+
callbackRef.current = callback;
|
|
357
|
+
}); // https://github.com/facebook/react/issues/19240
|
|
358
|
+
return React$1.useMemo(()=>(...args)=>{
|
|
359
|
+
var _callbackRef$current;
|
|
360
|
+
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
361
|
+
}
|
|
362
|
+
, []);
|
|
363
|
+
}
|
|
364
|
+
|
|
142
365
|
/**
|
|
143
366
|
* Listens for when the escape key is down
|
|
144
367
|
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
145
|
-
const onEscapeKeyDown =
|
|
368
|
+
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onEscapeKeyDownProp);
|
|
146
369
|
React$1.useEffect(()=>{
|
|
147
370
|
const handleKeyDown = (event)=>{
|
|
148
371
|
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
@@ -172,7 +395,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$1.forwardR
|
|
|
172
395
|
const [node1, setNode] = React$1.useState(null);
|
|
173
396
|
const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
|
|
174
397
|
const [, force] = React$1.useState({});
|
|
175
|
-
const composedRefs =
|
|
398
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setNode(node)
|
|
176
399
|
);
|
|
177
400
|
const layers = Array.from(context.layers);
|
|
178
401
|
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
@@ -256,15 +479,15 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$1.forwardR
|
|
|
256
479
|
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
257
480
|
;
|
|
258
481
|
}, []);
|
|
259
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
482
|
+
return /*#__PURE__*/ React$1.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$2.div, _extends._extends({}, layerProps, {
|
|
260
483
|
ref: composedRefs,
|
|
261
484
|
style: {
|
|
262
485
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
263
486
|
...props.style
|
|
264
487
|
},
|
|
265
|
-
onFocusCapture:
|
|
266
|
-
onBlurCapture:
|
|
267
|
-
onPointerDownCapture:
|
|
488
|
+
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
489
|
+
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
490
|
+
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
268
491
|
}));
|
|
269
492
|
});
|
|
270
493
|
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
@@ -272,7 +495,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$1.forwardR
|
|
|
272
495
|
* to mimic layer dismissing behaviour present in OS.
|
|
273
496
|
* Returns props to pass to the node we want to check for outside events.
|
|
274
497
|
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
275
|
-
const handlePointerDownOutside =
|
|
498
|
+
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onPointerDownOutside);
|
|
276
499
|
const isPointerInsideReactTreeRef = React$1.useRef(false);
|
|
277
500
|
const handleClickRef = React$1.useRef(()=>{});
|
|
278
501
|
React$1.useEffect(()=>{
|
|
@@ -340,7 +563,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$1.forwardR
|
|
|
340
563
|
* Listens for when focus happens outside a react subtree.
|
|
341
564
|
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
342
565
|
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
343
|
-
const handleFocusOutside =
|
|
566
|
+
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onFocusOutside);
|
|
344
567
|
const isFocusInsideReactTreeRef = React$1.useRef(false);
|
|
345
568
|
React$1.useEffect(()=>{
|
|
346
569
|
const handleFocus = (event)=>{
|
|
@@ -380,7 +603,7 @@ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detai
|
|
|
380
603
|
if (handler) target.addEventListener(name, handler, {
|
|
381
604
|
once: true
|
|
382
605
|
});
|
|
383
|
-
if (discrete)
|
|
606
|
+
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
384
607
|
else target.dispatchEvent(event);
|
|
385
608
|
}
|
|
386
609
|
|
|
@@ -410,6 +633,82 @@ function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
|
410
633
|
return element;
|
|
411
634
|
}
|
|
412
635
|
|
|
636
|
+
/**
|
|
637
|
+
* Set a given ref to a given value
|
|
638
|
+
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
639
|
+
*/ function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
640
|
+
if (typeof ref === 'function') ref(value);
|
|
641
|
+
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* A utility to compose multiple refs together
|
|
645
|
+
* Accepts callback refs and RefObject(s)
|
|
646
|
+
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
647
|
+
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
|
|
648
|
+
)
|
|
649
|
+
;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* A custom hook that composes multiple refs
|
|
653
|
+
* Accepts callback refs and RefObject(s)
|
|
654
|
+
*/ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
655
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
656
|
+
return React$1.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
const $8927f6f2acc4f386$var$NODES$1 = [
|
|
660
|
+
'a',
|
|
661
|
+
'button',
|
|
662
|
+
'div',
|
|
663
|
+
'h2',
|
|
664
|
+
'h3',
|
|
665
|
+
'img',
|
|
666
|
+
'label',
|
|
667
|
+
'li',
|
|
668
|
+
'nav',
|
|
669
|
+
'ol',
|
|
670
|
+
'p',
|
|
671
|
+
'span',
|
|
672
|
+
'svg',
|
|
673
|
+
'ul'
|
|
674
|
+
]; // Temporary while we await merge of this fix:
|
|
675
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
|
|
676
|
+
// prettier-ignore
|
|
677
|
+
/* -------------------------------------------------------------------------------------------------
|
|
678
|
+
* Primitive
|
|
679
|
+
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034$1 = $8927f6f2acc4f386$var$NODES$1.reduce((primitive, node)=>{
|
|
680
|
+
const Node = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
681
|
+
const { asChild: asChild , ...primitiveProps } = props;
|
|
682
|
+
const Comp = asChild ? index_module.$5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
683
|
+
React$1.useEffect(()=>{
|
|
684
|
+
window[Symbol.for('radix-ui')] = true;
|
|
685
|
+
}, []);
|
|
686
|
+
return /*#__PURE__*/ React$1.createElement(Comp, _extends._extends({}, primitiveProps, {
|
|
687
|
+
ref: forwardedRef
|
|
688
|
+
}));
|
|
689
|
+
});
|
|
690
|
+
Node.displayName = `Primitive.${node}`;
|
|
691
|
+
return {
|
|
692
|
+
...primitive,
|
|
693
|
+
[node]: Node
|
|
694
|
+
};
|
|
695
|
+
}, {});
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
699
|
+
* prop or avoid re-executing effects when passed as a dependency
|
|
700
|
+
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
701
|
+
const callbackRef = React$1.useRef(callback);
|
|
702
|
+
React$1.useEffect(()=>{
|
|
703
|
+
callbackRef.current = callback;
|
|
704
|
+
}); // https://github.com/facebook/react/issues/19240
|
|
705
|
+
return React$1.useMemo(()=>(...args)=>{
|
|
706
|
+
var _callbackRef$current;
|
|
707
|
+
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
708
|
+
}
|
|
709
|
+
, []);
|
|
710
|
+
}
|
|
711
|
+
|
|
413
712
|
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
|
|
414
713
|
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
|
|
415
714
|
const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
@@ -419,10 +718,10 @@ const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
|
419
718
|
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
420
719
|
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
421
720
|
const [container1, setContainer] = React$1.useState(null);
|
|
422
|
-
const onMountAutoFocus =
|
|
423
|
-
const onUnmountAutoFocus =
|
|
721
|
+
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
722
|
+
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
424
723
|
const lastFocusedElementRef = React$1.useRef(null);
|
|
425
|
-
const composedRefs =
|
|
724
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
|
426
725
|
);
|
|
427
726
|
const focusScope = React$1.useRef({
|
|
428
727
|
paused: false,
|
|
@@ -530,7 +829,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React$1.forwardR
|
|
|
530
829
|
trapped,
|
|
531
830
|
focusScope.paused
|
|
532
831
|
]);
|
|
533
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
832
|
+
return /*#__PURE__*/ React$1.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends._extends({
|
|
534
833
|
tabIndex: -1
|
|
535
834
|
}, scopeProps, {
|
|
536
835
|
ref: composedRefs,
|
|
@@ -671,13 +970,94 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
|
671
970
|
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
672
971
|
var _globalThis$document;
|
|
673
972
|
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
|
|
674
|
-
return container ? /*#__PURE__*/ $7SXl2$reactdom__default["default"].createPortal(/*#__PURE__*/ React$1.createElement(
|
|
973
|
+
return container ? /*#__PURE__*/ $7SXl2$reactdom__default["default"].createPortal(/*#__PURE__*/ React$1.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$2.div, _extends._extends({}, portalProps, {
|
|
675
974
|
ref: forwardedRef
|
|
676
975
|
})), container) : null;
|
|
677
976
|
});
|
|
678
977
|
|
|
978
|
+
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
|
|
979
|
+
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
980
|
+
defaultProp: defaultProp,
|
|
981
|
+
onChange: onChange
|
|
982
|
+
});
|
|
983
|
+
const isControlled = prop !== undefined;
|
|
984
|
+
const value1 = isControlled ? prop : uncontrolledProp;
|
|
985
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onChange);
|
|
986
|
+
const setValue = React$1.useCallback((nextValue)=>{
|
|
987
|
+
if (isControlled) {
|
|
988
|
+
const setter = nextValue;
|
|
989
|
+
const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
|
|
990
|
+
if (value !== prop) handleChange(value);
|
|
991
|
+
} else setUncontrolledProp(nextValue);
|
|
992
|
+
}, [
|
|
993
|
+
isControlled,
|
|
994
|
+
prop,
|
|
995
|
+
setUncontrolledProp,
|
|
996
|
+
handleChange
|
|
997
|
+
]);
|
|
998
|
+
return [
|
|
999
|
+
value1,
|
|
1000
|
+
setValue
|
|
1001
|
+
];
|
|
1002
|
+
}
|
|
1003
|
+
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
|
1004
|
+
const uncontrolledState = React$1.useState(defaultProp);
|
|
1005
|
+
const [value] = uncontrolledState;
|
|
1006
|
+
const prevValueRef = React$1.useRef(value);
|
|
1007
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onChange);
|
|
1008
|
+
React$1.useEffect(()=>{
|
|
1009
|
+
if (prevValueRef.current !== value) {
|
|
1010
|
+
handleChange(value);
|
|
1011
|
+
prevValueRef.current = value;
|
|
1012
|
+
}
|
|
1013
|
+
}, [
|
|
1014
|
+
value,
|
|
1015
|
+
prevValueRef,
|
|
1016
|
+
handleChange
|
|
1017
|
+
]);
|
|
1018
|
+
return uncontrolledState;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
const $8927f6f2acc4f386$var$NODES = [
|
|
1022
|
+
'a',
|
|
1023
|
+
'button',
|
|
1024
|
+
'div',
|
|
1025
|
+
'h2',
|
|
1026
|
+
'h3',
|
|
1027
|
+
'img',
|
|
1028
|
+
'label',
|
|
1029
|
+
'li',
|
|
1030
|
+
'nav',
|
|
1031
|
+
'ol',
|
|
1032
|
+
'p',
|
|
1033
|
+
'span',
|
|
1034
|
+
'svg',
|
|
1035
|
+
'ul'
|
|
1036
|
+
]; // Temporary while we await merge of this fix:
|
|
1037
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
|
|
1038
|
+
// prettier-ignore
|
|
1039
|
+
/* -------------------------------------------------------------------------------------------------
|
|
1040
|
+
* Primitive
|
|
1041
|
+
* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
|
|
1042
|
+
const Node = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
1043
|
+
const { asChild: asChild , ...primitiveProps } = props;
|
|
1044
|
+
const Comp = asChild ? index_module.$5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
1045
|
+
React$1.useEffect(()=>{
|
|
1046
|
+
window[Symbol.for('radix-ui')] = true;
|
|
1047
|
+
}, []);
|
|
1048
|
+
return /*#__PURE__*/ React$1.createElement(Comp, _extends._extends({}, primitiveProps, {
|
|
1049
|
+
ref: forwardedRef
|
|
1050
|
+
}));
|
|
1051
|
+
});
|
|
1052
|
+
Node.displayName = `Primitive.${node}`;
|
|
1053
|
+
return {
|
|
1054
|
+
...primitive,
|
|
1055
|
+
[node]: Node
|
|
1056
|
+
};
|
|
1057
|
+
}, {});
|
|
1058
|
+
|
|
679
1059
|
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
680
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
1060
|
+
return /*#__PURE__*/ React$1.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends._extends({}, props, {
|
|
681
1061
|
ref: forwardedRef,
|
|
682
1062
|
style: {
|
|
683
1063
|
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
@@ -696,849 +1076,6 @@ const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ React$1.forwardR
|
|
|
696
1076
|
}));
|
|
697
1077
|
});
|
|
698
1078
|
|
|
699
|
-
var getDefaultParent = function (originalTarget) {
|
|
700
|
-
if (typeof document === 'undefined') {
|
|
701
|
-
return null;
|
|
702
|
-
}
|
|
703
|
-
var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
|
|
704
|
-
return sampleTarget.ownerDocument.body;
|
|
705
|
-
};
|
|
706
|
-
var counterMap = new WeakMap();
|
|
707
|
-
var uncontrolledNodes = new WeakMap();
|
|
708
|
-
var markerMap = {};
|
|
709
|
-
var lockCount = 0;
|
|
710
|
-
var unwrapHost = function (node) {
|
|
711
|
-
return node && (node.host || unwrapHost(node.parentNode));
|
|
712
|
-
};
|
|
713
|
-
var correctTargets = function (parent, targets) {
|
|
714
|
-
return targets.map(function (target) {
|
|
715
|
-
if (parent.contains(target)) {
|
|
716
|
-
return target;
|
|
717
|
-
}
|
|
718
|
-
var correctedTarget = unwrapHost(target);
|
|
719
|
-
if (correctedTarget && parent.contains(correctedTarget)) {
|
|
720
|
-
return correctedTarget;
|
|
721
|
-
}
|
|
722
|
-
console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing');
|
|
723
|
-
return null;
|
|
724
|
-
}).filter(function (x) { return Boolean(x); });
|
|
725
|
-
};
|
|
726
|
-
/**
|
|
727
|
-
* Marks everything except given node(or nodes) as aria-hidden
|
|
728
|
-
* @param {Element | Element[]} originalTarget - elements to keep on the page
|
|
729
|
-
* @param [parentNode] - top element, defaults to document.body
|
|
730
|
-
* @param {String} [markerName] - a special attribute to mark every node
|
|
731
|
-
* @param {String} [controlAttribute] - html Attribute to control
|
|
732
|
-
* @return {Undo} undo command
|
|
733
|
-
*/
|
|
734
|
-
var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) {
|
|
735
|
-
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
736
|
-
if (!markerMap[markerName]) {
|
|
737
|
-
markerMap[markerName] = new WeakMap();
|
|
738
|
-
}
|
|
739
|
-
var markerCounter = markerMap[markerName];
|
|
740
|
-
var hiddenNodes = [];
|
|
741
|
-
var elementsToKeep = new Set();
|
|
742
|
-
var elementsToStop = new Set(targets);
|
|
743
|
-
var keep = function (el) {
|
|
744
|
-
if (!el || elementsToKeep.has(el)) {
|
|
745
|
-
return;
|
|
746
|
-
}
|
|
747
|
-
elementsToKeep.add(el);
|
|
748
|
-
keep(el.parentNode);
|
|
749
|
-
};
|
|
750
|
-
targets.forEach(keep);
|
|
751
|
-
var deep = function (parent) {
|
|
752
|
-
if (!parent || elementsToStop.has(parent)) {
|
|
753
|
-
return;
|
|
754
|
-
}
|
|
755
|
-
Array.prototype.forEach.call(parent.children, function (node) {
|
|
756
|
-
if (elementsToKeep.has(node)) {
|
|
757
|
-
deep(node);
|
|
758
|
-
}
|
|
759
|
-
else {
|
|
760
|
-
var attr = node.getAttribute(controlAttribute);
|
|
761
|
-
var alreadyHidden = attr !== null && attr !== 'false';
|
|
762
|
-
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
763
|
-
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
764
|
-
counterMap.set(node, counterValue);
|
|
765
|
-
markerCounter.set(node, markerValue);
|
|
766
|
-
hiddenNodes.push(node);
|
|
767
|
-
if (counterValue === 1 && alreadyHidden) {
|
|
768
|
-
uncontrolledNodes.set(node, true);
|
|
769
|
-
}
|
|
770
|
-
if (markerValue === 1) {
|
|
771
|
-
node.setAttribute(markerName, 'true');
|
|
772
|
-
}
|
|
773
|
-
if (!alreadyHidden) {
|
|
774
|
-
node.setAttribute(controlAttribute, 'true');
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
});
|
|
778
|
-
};
|
|
779
|
-
deep(parentNode);
|
|
780
|
-
elementsToKeep.clear();
|
|
781
|
-
lockCount++;
|
|
782
|
-
return function () {
|
|
783
|
-
hiddenNodes.forEach(function (node) {
|
|
784
|
-
var counterValue = counterMap.get(node) - 1;
|
|
785
|
-
var markerValue = markerCounter.get(node) - 1;
|
|
786
|
-
counterMap.set(node, counterValue);
|
|
787
|
-
markerCounter.set(node, markerValue);
|
|
788
|
-
if (!counterValue) {
|
|
789
|
-
if (!uncontrolledNodes.has(node)) {
|
|
790
|
-
node.removeAttribute(controlAttribute);
|
|
791
|
-
}
|
|
792
|
-
uncontrolledNodes.delete(node);
|
|
793
|
-
}
|
|
794
|
-
if (!markerValue) {
|
|
795
|
-
node.removeAttribute(markerName);
|
|
796
|
-
}
|
|
797
|
-
});
|
|
798
|
-
lockCount--;
|
|
799
|
-
if (!lockCount) {
|
|
800
|
-
// clear
|
|
801
|
-
counterMap = new WeakMap();
|
|
802
|
-
counterMap = new WeakMap();
|
|
803
|
-
uncontrolledNodes = new WeakMap();
|
|
804
|
-
markerMap = {};
|
|
805
|
-
}
|
|
806
|
-
};
|
|
807
|
-
};
|
|
808
|
-
/**
|
|
809
|
-
* Marks everything except given node(or nodes) as aria-hidden
|
|
810
|
-
* @param {Element | Element[]} originalTarget - elements to keep on the page
|
|
811
|
-
* @param [parentNode] - top element, defaults to document.body
|
|
812
|
-
* @param {String} [markerName] - a special attribute to mark every node
|
|
813
|
-
* @return {Undo} undo command
|
|
814
|
-
*/
|
|
815
|
-
var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
816
|
-
if (markerName === void 0) { markerName = 'data-aria-hidden'; }
|
|
817
|
-
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
818
|
-
var activeParentNode = parentNode || getDefaultParent(originalTarget);
|
|
819
|
-
if (!activeParentNode) {
|
|
820
|
-
return function () { return null; };
|
|
821
|
-
}
|
|
822
|
-
// we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10
|
|
823
|
-
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]')));
|
|
824
|
-
return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
|
|
825
|
-
};
|
|
826
|
-
|
|
827
|
-
/******************************************************************************
|
|
828
|
-
Copyright (c) Microsoft Corporation.
|
|
829
|
-
|
|
830
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
831
|
-
purpose with or without fee is hereby granted.
|
|
832
|
-
|
|
833
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
834
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
835
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
836
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
837
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
838
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
839
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
840
|
-
***************************************************************************** */
|
|
841
|
-
|
|
842
|
-
var __assign$1 = function() {
|
|
843
|
-
__assign$1 = Object.assign || function __assign(t) {
|
|
844
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
845
|
-
s = arguments[i];
|
|
846
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
847
|
-
}
|
|
848
|
-
return t;
|
|
849
|
-
};
|
|
850
|
-
return __assign$1.apply(this, arguments);
|
|
851
|
-
};
|
|
852
|
-
|
|
853
|
-
function __rest$1(s, e) {
|
|
854
|
-
var t = {};
|
|
855
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
856
|
-
t[p] = s[p];
|
|
857
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
858
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
859
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
860
|
-
t[p[i]] = s[p[i]];
|
|
861
|
-
}
|
|
862
|
-
return t;
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
function __spreadArray(to, from, pack) {
|
|
866
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
867
|
-
if (ar || !(i in from)) {
|
|
868
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
869
|
-
ar[i] = from[i];
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
var zeroRightClassName = 'right-scroll-bar-position';
|
|
876
|
-
var fullWidthClassName = 'width-before-scroll-bar';
|
|
877
|
-
var noScrollbarsClassName = 'with-scroll-bars-hidden';
|
|
878
|
-
/**
|
|
879
|
-
* Name of a CSS variable containing the amount of "hidden" scrollbar
|
|
880
|
-
* ! might be undefined ! use will fallback!
|
|
881
|
-
*/
|
|
882
|
-
var removedBarSizeVariable = '--removed-body-scroll-bar-size';
|
|
883
|
-
|
|
884
|
-
/**
|
|
885
|
-
* Assigns a value for a given ref, no matter of the ref format
|
|
886
|
-
* @param {RefObject} ref - a callback function or ref object
|
|
887
|
-
* @param value - a new value
|
|
888
|
-
*
|
|
889
|
-
* @see https://github.com/theKashey/use-callback-ref#assignref
|
|
890
|
-
* @example
|
|
891
|
-
* const refObject = useRef();
|
|
892
|
-
* const refFn = (ref) => {....}
|
|
893
|
-
*
|
|
894
|
-
* assignRef(refObject, "refValue");
|
|
895
|
-
* assignRef(refFn, "refValue");
|
|
896
|
-
*/
|
|
897
|
-
function assignRef(ref, value) {
|
|
898
|
-
if (typeof ref === 'function') {
|
|
899
|
-
ref(value);
|
|
900
|
-
}
|
|
901
|
-
else if (ref) {
|
|
902
|
-
ref.current = value;
|
|
903
|
-
}
|
|
904
|
-
return ref;
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
/**
|
|
908
|
-
* creates a MutableRef with ref change callback
|
|
909
|
-
* @param initialValue - initial ref value
|
|
910
|
-
* @param {Function} callback - a callback to run when value changes
|
|
911
|
-
*
|
|
912
|
-
* @example
|
|
913
|
-
* const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);
|
|
914
|
-
* ref.current = 1;
|
|
915
|
-
* // prints 0 -> 1
|
|
916
|
-
*
|
|
917
|
-
* @see https://reactjs.org/docs/hooks-reference.html#useref
|
|
918
|
-
* @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref
|
|
919
|
-
* @returns {MutableRefObject}
|
|
920
|
-
*/
|
|
921
|
-
function useCallbackRef(initialValue, callback) {
|
|
922
|
-
var ref = React$1.useState(function () { return ({
|
|
923
|
-
// value
|
|
924
|
-
value: initialValue,
|
|
925
|
-
// last callback
|
|
926
|
-
callback: callback,
|
|
927
|
-
// "memoized" public interface
|
|
928
|
-
facade: {
|
|
929
|
-
get current() {
|
|
930
|
-
return ref.value;
|
|
931
|
-
},
|
|
932
|
-
set current(value) {
|
|
933
|
-
var last = ref.value;
|
|
934
|
-
if (last !== value) {
|
|
935
|
-
ref.value = value;
|
|
936
|
-
ref.callback(value, last);
|
|
937
|
-
}
|
|
938
|
-
},
|
|
939
|
-
},
|
|
940
|
-
}); })[0];
|
|
941
|
-
// update callback
|
|
942
|
-
ref.callback = callback;
|
|
943
|
-
return ref.facade;
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
/**
|
|
947
|
-
* Merges two or more refs together providing a single interface to set their value
|
|
948
|
-
* @param {RefObject|Ref} refs
|
|
949
|
-
* @returns {MutableRefObject} - a new ref, which translates all changes to {refs}
|
|
950
|
-
*
|
|
951
|
-
* @see {@link mergeRefs} a version without buit-in memoization
|
|
952
|
-
* @see https://github.com/theKashey/use-callback-ref#usemergerefs
|
|
953
|
-
* @example
|
|
954
|
-
* const Component = React.forwardRef((props, ref) => {
|
|
955
|
-
* const ownRef = useRef();
|
|
956
|
-
* const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together
|
|
957
|
-
* return <div ref={domRef}>...</div>
|
|
958
|
-
* }
|
|
959
|
-
*/
|
|
960
|
-
function useMergeRefs(refs, defaultValue) {
|
|
961
|
-
return useCallbackRef(defaultValue || null, function (newValue) { return refs.forEach(function (ref) { return assignRef(ref, newValue); }); });
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
/*! *****************************************************************************
|
|
965
|
-
Copyright (c) Microsoft Corporation.
|
|
966
|
-
|
|
967
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
968
|
-
purpose with or without fee is hereby granted.
|
|
969
|
-
|
|
970
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
971
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
972
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
973
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
974
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
975
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
976
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
977
|
-
***************************************************************************** */
|
|
978
|
-
|
|
979
|
-
var __assign = function() {
|
|
980
|
-
__assign = Object.assign || function __assign(t) {
|
|
981
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
982
|
-
s = arguments[i];
|
|
983
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
984
|
-
}
|
|
985
|
-
return t;
|
|
986
|
-
};
|
|
987
|
-
return __assign.apply(this, arguments);
|
|
988
|
-
};
|
|
989
|
-
|
|
990
|
-
function __rest(s, e) {
|
|
991
|
-
var t = {};
|
|
992
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
993
|
-
t[p] = s[p];
|
|
994
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
995
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
996
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
997
|
-
t[p[i]] = s[p[i]];
|
|
998
|
-
}
|
|
999
|
-
return t;
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
function ItoI(a) {
|
|
1003
|
-
return a;
|
|
1004
|
-
}
|
|
1005
|
-
function innerCreateMedium(defaults, middleware) {
|
|
1006
|
-
if (middleware === void 0) { middleware = ItoI; }
|
|
1007
|
-
var buffer = [];
|
|
1008
|
-
var assigned = false;
|
|
1009
|
-
var medium = {
|
|
1010
|
-
read: function () {
|
|
1011
|
-
if (assigned) {
|
|
1012
|
-
throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');
|
|
1013
|
-
}
|
|
1014
|
-
if (buffer.length) {
|
|
1015
|
-
return buffer[buffer.length - 1];
|
|
1016
|
-
}
|
|
1017
|
-
return defaults;
|
|
1018
|
-
},
|
|
1019
|
-
useMedium: function (data) {
|
|
1020
|
-
var item = middleware(data, assigned);
|
|
1021
|
-
buffer.push(item);
|
|
1022
|
-
return function () {
|
|
1023
|
-
buffer = buffer.filter(function (x) { return x !== item; });
|
|
1024
|
-
};
|
|
1025
|
-
},
|
|
1026
|
-
assignSyncMedium: function (cb) {
|
|
1027
|
-
assigned = true;
|
|
1028
|
-
while (buffer.length) {
|
|
1029
|
-
var cbs = buffer;
|
|
1030
|
-
buffer = [];
|
|
1031
|
-
cbs.forEach(cb);
|
|
1032
|
-
}
|
|
1033
|
-
buffer = {
|
|
1034
|
-
push: function (x) { return cb(x); },
|
|
1035
|
-
filter: function () { return buffer; },
|
|
1036
|
-
};
|
|
1037
|
-
},
|
|
1038
|
-
assignMedium: function (cb) {
|
|
1039
|
-
assigned = true;
|
|
1040
|
-
var pendingQueue = [];
|
|
1041
|
-
if (buffer.length) {
|
|
1042
|
-
var cbs = buffer;
|
|
1043
|
-
buffer = [];
|
|
1044
|
-
cbs.forEach(cb);
|
|
1045
|
-
pendingQueue = buffer;
|
|
1046
|
-
}
|
|
1047
|
-
var executeQueue = function () {
|
|
1048
|
-
var cbs = pendingQueue;
|
|
1049
|
-
pendingQueue = [];
|
|
1050
|
-
cbs.forEach(cb);
|
|
1051
|
-
};
|
|
1052
|
-
var cycle = function () { return Promise.resolve().then(executeQueue); };
|
|
1053
|
-
cycle();
|
|
1054
|
-
buffer = {
|
|
1055
|
-
push: function (x) {
|
|
1056
|
-
pendingQueue.push(x);
|
|
1057
|
-
cycle();
|
|
1058
|
-
},
|
|
1059
|
-
filter: function (filter) {
|
|
1060
|
-
pendingQueue = pendingQueue.filter(filter);
|
|
1061
|
-
return buffer;
|
|
1062
|
-
},
|
|
1063
|
-
};
|
|
1064
|
-
},
|
|
1065
|
-
};
|
|
1066
|
-
return medium;
|
|
1067
|
-
}
|
|
1068
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
1069
|
-
function createSidecarMedium(options) {
|
|
1070
|
-
if (options === void 0) { options = {}; }
|
|
1071
|
-
var medium = innerCreateMedium(null);
|
|
1072
|
-
medium.options = __assign({ async: true, ssr: false }, options);
|
|
1073
|
-
return medium;
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
var SideCar$1 = function (_a) {
|
|
1077
|
-
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
1078
|
-
if (!sideCar) {
|
|
1079
|
-
throw new Error('Sidecar: please provide `sideCar` property to import the right car');
|
|
1080
|
-
}
|
|
1081
|
-
var Target = sideCar.read();
|
|
1082
|
-
if (!Target) {
|
|
1083
|
-
throw new Error('Sidecar medium not found');
|
|
1084
|
-
}
|
|
1085
|
-
return React__namespace.createElement(Target, __assign({}, rest));
|
|
1086
|
-
};
|
|
1087
|
-
SideCar$1.isSideCarExport = true;
|
|
1088
|
-
function exportSidecar(medium, exported) {
|
|
1089
|
-
medium.useMedium(exported);
|
|
1090
|
-
return SideCar$1;
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
var effectCar = createSidecarMedium();
|
|
1094
|
-
|
|
1095
|
-
var nothing = function () {
|
|
1096
|
-
return;
|
|
1097
|
-
};
|
|
1098
|
-
/**
|
|
1099
|
-
* Removes scrollbar from the page and contain the scroll within the Lock
|
|
1100
|
-
*/
|
|
1101
|
-
var RemoveScroll = React__namespace.forwardRef(function (props, parentRef) {
|
|
1102
|
-
var ref = React__namespace.useRef(null);
|
|
1103
|
-
var _a = React__namespace.useState({
|
|
1104
|
-
onScrollCapture: nothing,
|
|
1105
|
-
onWheelCapture: nothing,
|
|
1106
|
-
onTouchMoveCapture: nothing,
|
|
1107
|
-
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
1108
|
-
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, rest = __rest$1(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]);
|
|
1109
|
-
var SideCar = sideCar;
|
|
1110
|
-
var containerRef = useMergeRefs([ref, parentRef]);
|
|
1111
|
-
var containerProps = __assign$1(__assign$1({}, rest), callbacks);
|
|
1112
|
-
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
1113
|
-
enabled && (React__namespace.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })),
|
|
1114
|
-
forwardProps ? (React__namespace.cloneElement(React__namespace.Children.only(children), __assign$1(__assign$1({}, containerProps), { ref: containerRef }))) : (React__namespace.createElement(Container, __assign$1({}, containerProps, { className: className, ref: containerRef }), children))));
|
|
1115
|
-
});
|
|
1116
|
-
RemoveScroll.defaultProps = {
|
|
1117
|
-
enabled: true,
|
|
1118
|
-
removeScrollBar: true,
|
|
1119
|
-
inert: false,
|
|
1120
|
-
};
|
|
1121
|
-
RemoveScroll.classNames = {
|
|
1122
|
-
fullWidth: fullWidthClassName,
|
|
1123
|
-
zeroRight: zeroRightClassName,
|
|
1124
|
-
};
|
|
1125
|
-
|
|
1126
|
-
var getNonce = function () {
|
|
1127
|
-
if (typeof __webpack_nonce__ !== 'undefined') {
|
|
1128
|
-
return __webpack_nonce__;
|
|
1129
|
-
}
|
|
1130
|
-
return undefined;
|
|
1131
|
-
};
|
|
1132
|
-
|
|
1133
|
-
function makeStyleTag() {
|
|
1134
|
-
if (!document)
|
|
1135
|
-
return null;
|
|
1136
|
-
var tag = document.createElement('style');
|
|
1137
|
-
tag.type = 'text/css';
|
|
1138
|
-
var nonce = getNonce();
|
|
1139
|
-
if (nonce) {
|
|
1140
|
-
tag.setAttribute('nonce', nonce);
|
|
1141
|
-
}
|
|
1142
|
-
return tag;
|
|
1143
|
-
}
|
|
1144
|
-
function injectStyles(tag, css) {
|
|
1145
|
-
// @ts-ignore
|
|
1146
|
-
if (tag.styleSheet) {
|
|
1147
|
-
// @ts-ignore
|
|
1148
|
-
tag.styleSheet.cssText = css;
|
|
1149
|
-
}
|
|
1150
|
-
else {
|
|
1151
|
-
tag.appendChild(document.createTextNode(css));
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
function insertStyleTag(tag) {
|
|
1155
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
1156
|
-
head.appendChild(tag);
|
|
1157
|
-
}
|
|
1158
|
-
var stylesheetSingleton = function () {
|
|
1159
|
-
var counter = 0;
|
|
1160
|
-
var stylesheet = null;
|
|
1161
|
-
return {
|
|
1162
|
-
add: function (style) {
|
|
1163
|
-
if (counter == 0) {
|
|
1164
|
-
if ((stylesheet = makeStyleTag())) {
|
|
1165
|
-
injectStyles(stylesheet, style);
|
|
1166
|
-
insertStyleTag(stylesheet);
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
counter++;
|
|
1170
|
-
},
|
|
1171
|
-
remove: function () {
|
|
1172
|
-
counter--;
|
|
1173
|
-
if (!counter && stylesheet) {
|
|
1174
|
-
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
|
|
1175
|
-
stylesheet = null;
|
|
1176
|
-
}
|
|
1177
|
-
},
|
|
1178
|
-
};
|
|
1179
|
-
};
|
|
1180
|
-
|
|
1181
|
-
/**
|
|
1182
|
-
* creates a hook to control style singleton
|
|
1183
|
-
* @see {@link styleSingleton} for a safer component version
|
|
1184
|
-
* @example
|
|
1185
|
-
* ```tsx
|
|
1186
|
-
* const useStyle = styleHookSingleton();
|
|
1187
|
-
* ///
|
|
1188
|
-
* useStyle('body { overflow: hidden}');
|
|
1189
|
-
*/
|
|
1190
|
-
var styleHookSingleton = function () {
|
|
1191
|
-
var sheet = stylesheetSingleton();
|
|
1192
|
-
return function (styles, isDynamic) {
|
|
1193
|
-
React__namespace.useEffect(function () {
|
|
1194
|
-
sheet.add(styles);
|
|
1195
|
-
return function () {
|
|
1196
|
-
sheet.remove();
|
|
1197
|
-
};
|
|
1198
|
-
}, [styles && isDynamic]);
|
|
1199
|
-
};
|
|
1200
|
-
};
|
|
1201
|
-
|
|
1202
|
-
/**
|
|
1203
|
-
* create a Component to add styles on demand
|
|
1204
|
-
* - styles are added when first instance is mounted
|
|
1205
|
-
* - styles are removed when the last instance is unmounted
|
|
1206
|
-
* - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
|
|
1207
|
-
*/
|
|
1208
|
-
var styleSingleton = function () {
|
|
1209
|
-
var useStyle = styleHookSingleton();
|
|
1210
|
-
var Sheet = function (_a) {
|
|
1211
|
-
var styles = _a.styles, dynamic = _a.dynamic;
|
|
1212
|
-
useStyle(styles, dynamic);
|
|
1213
|
-
return null;
|
|
1214
|
-
};
|
|
1215
|
-
return Sheet;
|
|
1216
|
-
};
|
|
1217
|
-
|
|
1218
|
-
var zeroGap = {
|
|
1219
|
-
left: 0,
|
|
1220
|
-
top: 0,
|
|
1221
|
-
right: 0,
|
|
1222
|
-
gap: 0,
|
|
1223
|
-
};
|
|
1224
|
-
var parse = function (x) { return parseInt(x || '', 10) || 0; };
|
|
1225
|
-
var getOffset = function (gapMode) {
|
|
1226
|
-
var cs = window.getComputedStyle(document.body);
|
|
1227
|
-
var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft'];
|
|
1228
|
-
var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop'];
|
|
1229
|
-
var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight'];
|
|
1230
|
-
return [parse(left), parse(top), parse(right)];
|
|
1231
|
-
};
|
|
1232
|
-
var getGapWidth = function (gapMode) {
|
|
1233
|
-
if (gapMode === void 0) { gapMode = 'margin'; }
|
|
1234
|
-
if (typeof window === 'undefined') {
|
|
1235
|
-
return zeroGap;
|
|
1236
|
-
}
|
|
1237
|
-
var offsets = getOffset(gapMode);
|
|
1238
|
-
var documentWidth = document.documentElement.clientWidth;
|
|
1239
|
-
var windowWidth = window.innerWidth;
|
|
1240
|
-
return {
|
|
1241
|
-
left: offsets[0],
|
|
1242
|
-
top: offsets[1],
|
|
1243
|
-
right: offsets[2],
|
|
1244
|
-
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]),
|
|
1245
|
-
};
|
|
1246
|
-
};
|
|
1247
|
-
|
|
1248
|
-
var Style = styleSingleton();
|
|
1249
|
-
// important tip - once we measure scrollBar width and remove them
|
|
1250
|
-
// we could not repeat this operation
|
|
1251
|
-
// thus we are using style-singleton - only the first "yet correct" style will be applied.
|
|
1252
|
-
var getStyles = function (_a, allowRelative, gapMode, important) {
|
|
1253
|
-
var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
|
|
1254
|
-
if (gapMode === void 0) { gapMode = 'margin'; }
|
|
1255
|
-
return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
|
|
1256
|
-
allowRelative && "position: relative ".concat(important, ";"),
|
|
1257
|
-
gapMode === 'margin' &&
|
|
1258
|
-
"\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
|
|
1259
|
-
gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";"),
|
|
1260
|
-
]
|
|
1261
|
-
.filter(Boolean)
|
|
1262
|
-
.join(''), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
|
|
1263
|
-
};
|
|
1264
|
-
/**
|
|
1265
|
-
* Removes page scrollbar and blocks page scroll when mounted
|
|
1266
|
-
*/
|
|
1267
|
-
var RemoveScrollBar = function (props) {
|
|
1268
|
-
var noRelative = props.noRelative, noImportant = props.noImportant, _a = props.gapMode, gapMode = _a === void 0 ? 'margin' : _a;
|
|
1269
|
-
/*
|
|
1270
|
-
gap will be measured on every component mount
|
|
1271
|
-
however it will be used only by the "first" invocation
|
|
1272
|
-
due to singleton nature of <Style
|
|
1273
|
-
*/
|
|
1274
|
-
var gap = React__namespace.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]);
|
|
1275
|
-
return React__namespace.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') });
|
|
1276
|
-
};
|
|
1277
|
-
|
|
1278
|
-
var passiveSupported = false;
|
|
1279
|
-
if (typeof window !== 'undefined') {
|
|
1280
|
-
try {
|
|
1281
|
-
var options = Object.defineProperty({}, 'passive', {
|
|
1282
|
-
get: function () {
|
|
1283
|
-
passiveSupported = true;
|
|
1284
|
-
return true;
|
|
1285
|
-
},
|
|
1286
|
-
});
|
|
1287
|
-
// @ts-ignore
|
|
1288
|
-
window.addEventListener('test', options, options);
|
|
1289
|
-
// @ts-ignore
|
|
1290
|
-
window.removeEventListener('test', options, options);
|
|
1291
|
-
}
|
|
1292
|
-
catch (err) {
|
|
1293
|
-
passiveSupported = false;
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
1297
|
-
|
|
1298
|
-
var alwaysContainsScroll = function (node) {
|
|
1299
|
-
// textarea will always _contain_ scroll inside self. It only can be hidden
|
|
1300
|
-
return node.tagName === 'TEXTAREA';
|
|
1301
|
-
};
|
|
1302
|
-
var elementCanBeScrolled = function (node, overflow) {
|
|
1303
|
-
var styles = window.getComputedStyle(node);
|
|
1304
|
-
return (
|
|
1305
|
-
// not-not-scrollable
|
|
1306
|
-
styles[overflow] !== 'hidden' &&
|
|
1307
|
-
// contains scroll inside self
|
|
1308
|
-
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
|
|
1309
|
-
};
|
|
1310
|
-
var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
|
|
1311
|
-
var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
|
|
1312
|
-
var locationCouldBeScrolled = function (axis, node) {
|
|
1313
|
-
var current = node;
|
|
1314
|
-
do {
|
|
1315
|
-
// Skip over shadow root
|
|
1316
|
-
if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
|
|
1317
|
-
current = current.host;
|
|
1318
|
-
}
|
|
1319
|
-
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
1320
|
-
if (isScrollable) {
|
|
1321
|
-
var _a = getScrollVariables(axis, current), s = _a[1], d = _a[2];
|
|
1322
|
-
if (s > d) {
|
|
1323
|
-
return true;
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
current = current.parentNode;
|
|
1327
|
-
} while (current && current !== document.body);
|
|
1328
|
-
return false;
|
|
1329
|
-
};
|
|
1330
|
-
var getVScrollVariables = function (_a) {
|
|
1331
|
-
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
1332
|
-
return [
|
|
1333
|
-
scrollTop,
|
|
1334
|
-
scrollHeight,
|
|
1335
|
-
clientHeight,
|
|
1336
|
-
];
|
|
1337
|
-
};
|
|
1338
|
-
var getHScrollVariables = function (_a) {
|
|
1339
|
-
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
1340
|
-
return [
|
|
1341
|
-
scrollLeft,
|
|
1342
|
-
scrollWidth,
|
|
1343
|
-
clientWidth,
|
|
1344
|
-
];
|
|
1345
|
-
};
|
|
1346
|
-
var elementCouldBeScrolled = function (axis, node) {
|
|
1347
|
-
return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
1348
|
-
};
|
|
1349
|
-
var getScrollVariables = function (axis, node) {
|
|
1350
|
-
return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
1351
|
-
};
|
|
1352
|
-
var getDirectionFactor = function (axis, direction) {
|
|
1353
|
-
/**
|
|
1354
|
-
* If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
|
|
1355
|
-
* and then increasingly negative as you scroll towards the end of the content.
|
|
1356
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
|
|
1357
|
-
*/
|
|
1358
|
-
return axis === 'h' && direction === 'rtl' ? -1 : 1;
|
|
1359
|
-
};
|
|
1360
|
-
var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
1361
|
-
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
1362
|
-
var delta = directionFactor * sourceDelta;
|
|
1363
|
-
// find scrollable target
|
|
1364
|
-
var target = event.target;
|
|
1365
|
-
var targetInLock = endTarget.contains(target);
|
|
1366
|
-
var shouldCancelScroll = false;
|
|
1367
|
-
var isDeltaPositive = delta > 0;
|
|
1368
|
-
var availableScroll = 0;
|
|
1369
|
-
var availableScrollTop = 0;
|
|
1370
|
-
do {
|
|
1371
|
-
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
1372
|
-
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
1373
|
-
if (position || elementScroll) {
|
|
1374
|
-
if (elementCouldBeScrolled(axis, target)) {
|
|
1375
|
-
availableScroll += elementScroll;
|
|
1376
|
-
availableScrollTop += position;
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
target = target.parentNode;
|
|
1380
|
-
} while (
|
|
1381
|
-
// portaled content
|
|
1382
|
-
(!targetInLock && target !== document.body) ||
|
|
1383
|
-
// self content
|
|
1384
|
-
(targetInLock && (endTarget.contains(target) || endTarget === target)));
|
|
1385
|
-
if (isDeltaPositive && ((noOverscroll && availableScroll === 0) || (!noOverscroll && delta > availableScroll))) {
|
|
1386
|
-
shouldCancelScroll = true;
|
|
1387
|
-
}
|
|
1388
|
-
else if (!isDeltaPositive &&
|
|
1389
|
-
((noOverscroll && availableScrollTop === 0) || (!noOverscroll && -delta > availableScrollTop))) {
|
|
1390
|
-
shouldCancelScroll = true;
|
|
1391
|
-
}
|
|
1392
|
-
return shouldCancelScroll;
|
|
1393
|
-
};
|
|
1394
|
-
|
|
1395
|
-
var getTouchXY = function (event) {
|
|
1396
|
-
return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
|
|
1397
|
-
};
|
|
1398
|
-
var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };
|
|
1399
|
-
var extractRef = function (ref) {
|
|
1400
|
-
return ref && 'current' in ref ? ref.current : ref;
|
|
1401
|
-
};
|
|
1402
|
-
var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };
|
|
1403
|
-
var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); };
|
|
1404
|
-
var idCounter = 0;
|
|
1405
|
-
var lockStack = [];
|
|
1406
|
-
function RemoveScrollSideCar(props) {
|
|
1407
|
-
var shouldPreventQueue = React__namespace.useRef([]);
|
|
1408
|
-
var touchStartRef = React__namespace.useRef([0, 0]);
|
|
1409
|
-
var activeAxis = React__namespace.useRef();
|
|
1410
|
-
var id = React__namespace.useState(idCounter++)[0];
|
|
1411
|
-
var Style = React__namespace.useState(function () { return styleSingleton(); })[0];
|
|
1412
|
-
var lastProps = React__namespace.useRef(props);
|
|
1413
|
-
React__namespace.useEffect(function () {
|
|
1414
|
-
lastProps.current = props;
|
|
1415
|
-
}, [props]);
|
|
1416
|
-
React__namespace.useEffect(function () {
|
|
1417
|
-
if (props.inert) {
|
|
1418
|
-
document.body.classList.add("block-interactivity-".concat(id));
|
|
1419
|
-
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
1420
|
-
allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); });
|
|
1421
|
-
return function () {
|
|
1422
|
-
document.body.classList.remove("block-interactivity-".concat(id));
|
|
1423
|
-
allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); });
|
|
1424
|
-
};
|
|
1425
|
-
}
|
|
1426
|
-
return;
|
|
1427
|
-
}, [props.inert, props.lockRef.current, props.shards]);
|
|
1428
|
-
var shouldCancelEvent = React__namespace.useCallback(function (event, parent) {
|
|
1429
|
-
if ('touches' in event && event.touches.length === 2) {
|
|
1430
|
-
return !lastProps.current.allowPinchZoom;
|
|
1431
|
-
}
|
|
1432
|
-
var touch = getTouchXY(event);
|
|
1433
|
-
var touchStart = touchStartRef.current;
|
|
1434
|
-
var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
|
|
1435
|
-
var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
|
|
1436
|
-
var currentAxis;
|
|
1437
|
-
var target = event.target;
|
|
1438
|
-
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
|
|
1439
|
-
// allow horizontal touch move on Range inputs. They will not cause any scroll
|
|
1440
|
-
if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
|
|
1441
|
-
return false;
|
|
1442
|
-
}
|
|
1443
|
-
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1444
|
-
if (!canBeScrolledInMainDirection) {
|
|
1445
|
-
return true;
|
|
1446
|
-
}
|
|
1447
|
-
if (canBeScrolledInMainDirection) {
|
|
1448
|
-
currentAxis = moveDirection;
|
|
1449
|
-
}
|
|
1450
|
-
else {
|
|
1451
|
-
currentAxis = moveDirection === 'v' ? 'h' : 'v';
|
|
1452
|
-
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1453
|
-
// other axis might be not scrollable
|
|
1454
|
-
}
|
|
1455
|
-
if (!canBeScrolledInMainDirection) {
|
|
1456
|
-
return false;
|
|
1457
|
-
}
|
|
1458
|
-
if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
|
|
1459
|
-
activeAxis.current = currentAxis;
|
|
1460
|
-
}
|
|
1461
|
-
if (!currentAxis) {
|
|
1462
|
-
return true;
|
|
1463
|
-
}
|
|
1464
|
-
var cancelingAxis = activeAxis.current || currentAxis;
|
|
1465
|
-
return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);
|
|
1466
|
-
}, []);
|
|
1467
|
-
var shouldPrevent = React__namespace.useCallback(function (_event) {
|
|
1468
|
-
var event = _event;
|
|
1469
|
-
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
|
|
1470
|
-
// not the last active
|
|
1471
|
-
return;
|
|
1472
|
-
}
|
|
1473
|
-
var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
|
|
1474
|
-
var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); })[0];
|
|
1475
|
-
// self event, and should be canceled
|
|
1476
|
-
if (sourceEvent && sourceEvent.should) {
|
|
1477
|
-
if (event.cancelable) {
|
|
1478
|
-
event.preventDefault();
|
|
1479
|
-
}
|
|
1480
|
-
return;
|
|
1481
|
-
}
|
|
1482
|
-
// outside or shard event
|
|
1483
|
-
if (!sourceEvent) {
|
|
1484
|
-
var shardNodes = (lastProps.current.shards || [])
|
|
1485
|
-
.map(extractRef)
|
|
1486
|
-
.filter(Boolean)
|
|
1487
|
-
.filter(function (node) { return node.contains(event.target); });
|
|
1488
|
-
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
|
|
1489
|
-
if (shouldStop) {
|
|
1490
|
-
if (event.cancelable) {
|
|
1491
|
-
event.preventDefault();
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1495
|
-
}, []);
|
|
1496
|
-
var shouldCancel = React__namespace.useCallback(function (name, delta, target, should) {
|
|
1497
|
-
var event = { name: name, delta: delta, target: target, should: should };
|
|
1498
|
-
shouldPreventQueue.current.push(event);
|
|
1499
|
-
setTimeout(function () {
|
|
1500
|
-
shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
|
|
1501
|
-
}, 1);
|
|
1502
|
-
}, []);
|
|
1503
|
-
var scrollTouchStart = React__namespace.useCallback(function (event) {
|
|
1504
|
-
touchStartRef.current = getTouchXY(event);
|
|
1505
|
-
activeAxis.current = undefined;
|
|
1506
|
-
}, []);
|
|
1507
|
-
var scrollWheel = React__namespace.useCallback(function (event) {
|
|
1508
|
-
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
1509
|
-
}, []);
|
|
1510
|
-
var scrollTouchMove = React__namespace.useCallback(function (event) {
|
|
1511
|
-
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
1512
|
-
}, []);
|
|
1513
|
-
React__namespace.useEffect(function () {
|
|
1514
|
-
lockStack.push(Style);
|
|
1515
|
-
props.setCallbacks({
|
|
1516
|
-
onScrollCapture: scrollWheel,
|
|
1517
|
-
onWheelCapture: scrollWheel,
|
|
1518
|
-
onTouchMoveCapture: scrollTouchMove,
|
|
1519
|
-
});
|
|
1520
|
-
document.addEventListener('wheel', shouldPrevent, nonPassive);
|
|
1521
|
-
document.addEventListener('touchmove', shouldPrevent, nonPassive);
|
|
1522
|
-
document.addEventListener('touchstart', scrollTouchStart, nonPassive);
|
|
1523
|
-
return function () {
|
|
1524
|
-
lockStack = lockStack.filter(function (inst) { return inst !== Style; });
|
|
1525
|
-
document.removeEventListener('wheel', shouldPrevent, nonPassive);
|
|
1526
|
-
document.removeEventListener('touchmove', shouldPrevent, nonPassive);
|
|
1527
|
-
document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
|
|
1528
|
-
};
|
|
1529
|
-
}, []);
|
|
1530
|
-
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
1531
|
-
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
1532
|
-
inert ? React__namespace.createElement(Style, { styles: generateStyle(id) }) : null,
|
|
1533
|
-
removeScrollBar ? React__namespace.createElement(RemoveScrollBar, { gapMode: "margin" }) : null));
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
|
-
var SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
1537
|
-
|
|
1538
|
-
var ReactRemoveScroll = React__namespace.forwardRef(function (props, ref) { return (React__namespace.createElement(RemoveScroll, __assign$1({}, props, { ref: ref, sideCar: SideCar }))); });
|
|
1539
|
-
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
1540
|
-
var $01b9c$RemoveScroll = ReactRemoveScroll;
|
|
1541
|
-
|
|
1542
1079
|
const $cc7e05a45900e73f$var$OPEN_KEYS = [
|
|
1543
1080
|
' ',
|
|
1544
1081
|
'Enter',
|
|
@@ -1553,7 +1090,7 @@ const $cc7e05a45900e73f$var$SELECTION_KEYS = [
|
|
|
1553
1090
|
* Select
|
|
1554
1091
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SELECT_NAME = 'Select';
|
|
1555
1092
|
const [$cc7e05a45900e73f$var$Collection, $cc7e05a45900e73f$var$useCollection, $cc7e05a45900e73f$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($cc7e05a45900e73f$var$SELECT_NAME);
|
|
1556
|
-
const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] =
|
|
1093
|
+
const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cc7e05a45900e73f$var$SELECT_NAME, [
|
|
1557
1094
|
$cc7e05a45900e73f$var$createCollectionScope
|
|
1558
1095
|
]);
|
|
1559
1096
|
const [$cc7e05a45900e73f$var$SelectProvider, $cc7e05a45900e73f$var$useSelectContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
|
|
@@ -1564,12 +1101,12 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
1564
1101
|
const [valueNode, setValueNode] = React$1.useState(null);
|
|
1565
1102
|
const [valueNodeHasChildren, setValueNodeHasChildren] = React$1.useState(false);
|
|
1566
1103
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
1567
|
-
const [open = false, setOpen] =
|
|
1104
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
1568
1105
|
prop: openProp,
|
|
1569
1106
|
defaultProp: defaultOpen,
|
|
1570
1107
|
onChange: onOpenChange
|
|
1571
1108
|
});
|
|
1572
|
-
const [value, setValue] =
|
|
1109
|
+
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
1573
1110
|
prop: valueProp,
|
|
1574
1111
|
defaultProp: defaultValue,
|
|
1575
1112
|
onChange: onValueChange
|
|
@@ -1638,7 +1175,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$1.forwardRe
|
|
|
1638
1175
|
const { __scopeSelect: __scopeSelect , disabled: disabled = false , ...triggerProps } = props;
|
|
1639
1176
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$TRIGGER_NAME, __scopeSelect);
|
|
1640
1177
|
const isDisabled = context.disabled || disabled;
|
|
1641
|
-
const composedRefs =
|
|
1178
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.onTriggerChange);
|
|
1642
1179
|
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
1643
1180
|
const [searchRef, handleTypeaheadSearch, resetTypeahead] = $cc7e05a45900e73f$var$useTypeaheadSearch((search)=>{
|
|
1644
1181
|
const enabledItems = getItems().filter((item)=>!item.disabled
|
|
@@ -1654,7 +1191,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$1.forwardRe
|
|
|
1654
1191
|
resetTypeahead();
|
|
1655
1192
|
}
|
|
1656
1193
|
};
|
|
1657
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
1194
|
+
return /*#__PURE__*/ React$1.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$2.button, _extends._extends({
|
|
1658
1195
|
type: "button",
|
|
1659
1196
|
role: "combobox",
|
|
1660
1197
|
"aria-controls": context.contentId,
|
|
@@ -1669,7 +1206,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$1.forwardRe
|
|
|
1669
1206
|
}, triggerProps, {
|
|
1670
1207
|
ref: composedRefs // Enable compatibility with native label or custom `Label` "click" for Safari:
|
|
1671
1208
|
,
|
|
1672
|
-
onClick:
|
|
1209
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onClick, (event)=>{
|
|
1673
1210
|
// Whilst browsers generally have no issue focusing the trigger when clicking
|
|
1674
1211
|
// on a label, Safari seems to struggle with the fact that there's no `onClick`.
|
|
1675
1212
|
// We force `focus` in this case. Note: this doesn't create any other side-effect
|
|
@@ -1677,7 +1214,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$1.forwardRe
|
|
|
1677
1214
|
// this only runs for a label "click"
|
|
1678
1215
|
event.currentTarget.focus();
|
|
1679
1216
|
}),
|
|
1680
|
-
onPointerDown:
|
|
1217
|
+
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onPointerDown, (event)=>{
|
|
1681
1218
|
// prevent implicit pointer capture
|
|
1682
1219
|
// https://www.w3.org/TR/pointerevents3/#implicit-pointer-capture
|
|
1683
1220
|
const target = event.target;
|
|
@@ -1693,7 +1230,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$1.forwardRe
|
|
|
1693
1230
|
event.preventDefault();
|
|
1694
1231
|
}
|
|
1695
1232
|
}),
|
|
1696
|
-
onKeyDown:
|
|
1233
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onKeyDown, (event)=>{
|
|
1697
1234
|
const isTypingAhead = searchRef.current !== '';
|
|
1698
1235
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
1699
1236
|
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
|
@@ -1714,14 +1251,14 @@ const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ React$1.forwardR
|
|
|
1714
1251
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$VALUE_NAME, __scopeSelect);
|
|
1715
1252
|
const { onValueNodeHasChildrenChange: onValueNodeHasChildrenChange } = context;
|
|
1716
1253
|
const hasChildren = children !== undefined;
|
|
1717
|
-
const composedRefs =
|
|
1254
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.onValueNodeChange);
|
|
1718
1255
|
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1719
1256
|
onValueNodeHasChildrenChange(hasChildren);
|
|
1720
1257
|
}, [
|
|
1721
1258
|
onValueNodeHasChildrenChange,
|
|
1722
1259
|
hasChildren
|
|
1723
1260
|
]);
|
|
1724
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
1261
|
+
return /*#__PURE__*/ React$1.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$2.span, _extends._extends({}, valueProps, {
|
|
1725
1262
|
ref: composedRefs // we don't want events from the portalled `SelectValue` children to bubble
|
|
1726
1263
|
,
|
|
1727
1264
|
style: {
|
|
@@ -1731,14 +1268,14 @@ const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ React$1.forwardR
|
|
|
1731
1268
|
});
|
|
1732
1269
|
const $cc7e05a45900e73f$export$99b400cabb58c515 = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
1733
1270
|
const { __scopeSelect: __scopeSelect , children: children , ...iconProps } = props;
|
|
1734
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
1271
|
+
return /*#__PURE__*/ React$1.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$2.span, _extends._extends({
|
|
1735
1272
|
"aria-hidden": true
|
|
1736
1273
|
}, iconProps, {
|
|
1737
1274
|
ref: forwardedRef
|
|
1738
1275
|
}), children || '▼');
|
|
1739
1276
|
});
|
|
1740
1277
|
const $cc7e05a45900e73f$export$b2af6c9944296213 = (props)=>{
|
|
1741
|
-
return /*#__PURE__*/ React$1.createElement($f1701beae083dbae$export$602eac185826482c,
|
|
1278
|
+
return /*#__PURE__*/ React$1.createElement($f1701beae083dbae$export$602eac185826482c, _extends._extends({
|
|
1742
1279
|
asChild: true
|
|
1743
1280
|
}, props));
|
|
1744
1281
|
};
|
|
@@ -1751,7 +1288,7 @@ const $cc7e05a45900e73f$export$c973a4b3cb86a03d = /*#__PURE__*/ React$1.forwardR
|
|
|
1751
1288
|
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1752
1289
|
setFragment(new DocumentFragment());
|
|
1753
1290
|
}, []);
|
|
1754
|
-
return /*#__PURE__*/ React$1.createElement(React$1.Fragment, null, context.open ? /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectContentImpl,
|
|
1291
|
+
return /*#__PURE__*/ React$1.createElement(React$1.Fragment, null, context.open ? /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectContentImpl, _extends._extends({}, props, {
|
|
1755
1292
|
ref: forwardedRef
|
|
1756
1293
|
})) : fragment ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectContentProvider, {
|
|
1757
1294
|
scope: props.__scopeSelect
|
|
@@ -1767,7 +1304,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
1767
1304
|
const [contentWrapper, setContentWrapper] = React$1.useState(null);
|
|
1768
1305
|
const [content, setContent] = React$1.useState(null);
|
|
1769
1306
|
const [viewport, setViewport] = React$1.useState(null);
|
|
1770
|
-
const composedRefs =
|
|
1307
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContent(node)
|
|
1771
1308
|
);
|
|
1772
1309
|
const [selectedItem, setSelectedItem] = React$1.useState(null);
|
|
1773
1310
|
const [selectedItemText, setSelectedItemText] = React$1.useState(null);
|
|
@@ -1777,7 +1314,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
1777
1314
|
const shouldExpandOnScrollRef = React$1.useRef(false);
|
|
1778
1315
|
const firstValidItemFoundRef = React$1.useRef(false); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
1779
1316
|
React$1.useEffect(()=>{
|
|
1780
|
-
if (content) return hideOthers(content);
|
|
1317
|
+
if (content) return index.hideOthers(content);
|
|
1781
1318
|
}, [
|
|
1782
1319
|
content
|
|
1783
1320
|
]); // Make sure the whole tree has focus guards as our `Select` may be
|
|
@@ -2035,7 +1572,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
2035
1572
|
isPositioned: isPositioned,
|
|
2036
1573
|
shouldExpandOnScrollRef: shouldExpandOnScrollRef,
|
|
2037
1574
|
searchRef: searchRef
|
|
2038
|
-
}, /*#__PURE__*/ React$1.createElement(
|
|
1575
|
+
}, /*#__PURE__*/ React$1.createElement(index.$01b9c$RemoveScroll, {
|
|
2039
1576
|
as: index_module.$5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
2040
1577
|
allowPinchZoom: true
|
|
2041
1578
|
}, /*#__PURE__*/ React$1.createElement("div", {
|
|
@@ -2054,14 +1591,14 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
2054
1591
|
// we prevent open autofocus because we manually focus the selected item
|
|
2055
1592
|
event.preventDefault();
|
|
2056
1593
|
},
|
|
2057
|
-
onUnmountAutoFocus:
|
|
1594
|
+
onUnmountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onCloseAutoFocus, (event)=>{
|
|
2058
1595
|
var _context$trigger;
|
|
2059
1596
|
(_context$trigger = context.trigger) === null || _context$trigger === void 0 || _context$trigger.focus({
|
|
2060
1597
|
preventScroll: true
|
|
2061
1598
|
});
|
|
2062
1599
|
event.preventDefault();
|
|
2063
1600
|
})
|
|
2064
|
-
}, /*#__PURE__*/ React$1.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22,
|
|
1601
|
+
}, /*#__PURE__*/ React$1.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends._extends({
|
|
2065
1602
|
role: "listbox",
|
|
2066
1603
|
id: context.contentId,
|
|
2067
1604
|
"data-state": context.open ? 'open' : 'closed',
|
|
@@ -2085,7 +1622,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
2085
1622
|
,
|
|
2086
1623
|
onDismiss: ()=>context.onOpenChange(false)
|
|
2087
1624
|
,
|
|
2088
|
-
onKeyDown:
|
|
1625
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event)=>{
|
|
2089
1626
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; // select should not be navigated using tab key so we prevent it
|
|
2090
1627
|
if (event.key === 'Tab') event.preventDefault();
|
|
2091
1628
|
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
|
@@ -2127,7 +1664,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
2127
1664
|
const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
2128
1665
|
const { __scopeSelect: __scopeSelect , ...viewportProps } = props;
|
|
2129
1666
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
|
|
2130
|
-
const composedRefs =
|
|
1667
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, contentContext.onViewportChange);
|
|
2131
1668
|
const prevScrollTopRef = React$1.useRef(0);
|
|
2132
1669
|
return /*#__PURE__*/ React$1.createElement(React$1.Fragment, null, /*#__PURE__*/ React$1.createElement("style", {
|
|
2133
1670
|
dangerouslySetInnerHTML: {
|
|
@@ -2135,7 +1672,7 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React$1.forwardR
|
|
|
2135
1672
|
}
|
|
2136
1673
|
}), /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
2137
1674
|
scope: __scopeSelect
|
|
2138
|
-
}, /*#__PURE__*/ React$1.createElement(
|
|
1675
|
+
}, /*#__PURE__*/ React$1.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$2.div, _extends._extends({
|
|
2139
1676
|
"data-radix-select-viewport": "",
|
|
2140
1677
|
role: "presentation"
|
|
2141
1678
|
}, viewportProps, {
|
|
@@ -2149,7 +1686,7 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React$1.forwardR
|
|
|
2149
1686
|
overflow: 'auto',
|
|
2150
1687
|
...viewportProps.style
|
|
2151
1688
|
},
|
|
2152
|
-
onScroll:
|
|
1689
|
+
onScroll: $e42e1063c40fb3ef$export$b9ecd428b558ff10(viewportProps.onScroll, (event)=>{
|
|
2153
1690
|
const viewport = event.currentTarget;
|
|
2154
1691
|
const { contentWrapper: contentWrapper , shouldExpandOnScrollRef: shouldExpandOnScrollRef } = contentContext;
|
|
2155
1692
|
if (shouldExpandOnScrollRef !== null && shouldExpandOnScrollRef !== void 0 && shouldExpandOnScrollRef.current && contentWrapper) {
|
|
@@ -2190,7 +1727,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React$1.forwardR
|
|
|
2190
1727
|
const isSelected = context.value === value;
|
|
2191
1728
|
const [textValue, setTextValue] = React$1.useState(textValueProp !== null && textValueProp !== void 0 ? textValueProp : '');
|
|
2192
1729
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
2193
|
-
const composedRefs =
|
|
1730
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>{
|
|
2194
1731
|
var _contentContext$itemR;
|
|
2195
1732
|
return (_contentContext$itemR = contentContext.itemRefCallback) === null || _contentContext$itemR === void 0 ? void 0 : _contentContext$itemR.call(contentContext, node, value, disabled);
|
|
2196
1733
|
});
|
|
@@ -2218,7 +1755,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React$1.forwardR
|
|
|
2218
1755
|
value: value,
|
|
2219
1756
|
disabled: disabled,
|
|
2220
1757
|
textValue: textValue
|
|
2221
|
-
}, /*#__PURE__*/ React$1.createElement(
|
|
1758
|
+
}, /*#__PURE__*/ React$1.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$2.div, _extends._extends({
|
|
2222
1759
|
role: "option",
|
|
2223
1760
|
"aria-labelledby": textId,
|
|
2224
1761
|
"data-highlighted": isFocused ? '' : undefined // `isFocused` caveat fixes stuttering in VoiceOver
|
|
@@ -2230,12 +1767,12 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React$1.forwardR
|
|
|
2230
1767
|
tabIndex: disabled ? undefined : -1
|
|
2231
1768
|
}, itemProps, {
|
|
2232
1769
|
ref: composedRefs,
|
|
2233
|
-
onFocus:
|
|
1770
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onFocus, ()=>setIsFocused(true)
|
|
2234
1771
|
),
|
|
2235
|
-
onBlur:
|
|
1772
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onBlur, ()=>setIsFocused(false)
|
|
2236
1773
|
),
|
|
2237
|
-
onPointerUp:
|
|
2238
|
-
onPointerMove:
|
|
1774
|
+
onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerUp, handleSelect),
|
|
1775
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerMove, (event)=>{
|
|
2239
1776
|
if (disabled) {
|
|
2240
1777
|
var _contentContext$onIte;
|
|
2241
1778
|
(_contentContext$onIte = contentContext.onItemLeave) === null || _contentContext$onIte === void 0 || _contentContext$onIte.call(contentContext);
|
|
@@ -2245,13 +1782,13 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React$1.forwardR
|
|
|
2245
1782
|
preventScroll: true
|
|
2246
1783
|
});
|
|
2247
1784
|
}),
|
|
2248
|
-
onPointerLeave:
|
|
1785
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerLeave, (event)=>{
|
|
2249
1786
|
if (event.currentTarget === document.activeElement) {
|
|
2250
1787
|
var _contentContext$onIte2;
|
|
2251
1788
|
(_contentContext$onIte2 = contentContext.onItemLeave) === null || _contentContext$onIte2 === void 0 || _contentContext$onIte2.call(contentContext);
|
|
2252
1789
|
}
|
|
2253
1790
|
}),
|
|
2254
|
-
onKeyDown:
|
|
1791
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onKeyDown, (event)=>{
|
|
2255
1792
|
var _contentContext$searc;
|
|
2256
1793
|
const isTypingAhead = ((_contentContext$searc = contentContext.searchRef) === null || _contentContext$searc === void 0 ? void 0 : _contentContext$searc.current) !== '';
|
|
2257
1794
|
if (isTypingAhead && event.key === ' ') return;
|
|
@@ -2271,7 +1808,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React$1.forwardR
|
|
|
2271
1808
|
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
2272
1809
|
const nativeOptionsContext = $cc7e05a45900e73f$var$useSelectNativeOptionsContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
2273
1810
|
const [itemTextNode, setItemTextNode] = React$1.useState(null);
|
|
2274
|
-
const composedRefs =
|
|
1811
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setItemTextNode(node)
|
|
2275
1812
|
, itemContext.onItemTextChange, (node)=>{
|
|
2276
1813
|
var _contentContext$itemT;
|
|
2277
1814
|
return (_contentContext$itemT = contentContext.itemTextRefCallback) === null || _contentContext$itemT === void 0 ? void 0 : _contentContext$itemT.call(contentContext, node, itemContext.value, itemContext.disabled);
|
|
@@ -2297,7 +1834,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React$1.forwardR
|
|
|
2297
1834
|
onNativeOptionRemove,
|
|
2298
1835
|
nativeOption
|
|
2299
1836
|
]);
|
|
2300
|
-
return /*#__PURE__*/ React$1.createElement(React$1.Fragment, null, /*#__PURE__*/ React$1.createElement(
|
|
1837
|
+
return /*#__PURE__*/ React$1.createElement(React$1.Fragment, null, /*#__PURE__*/ React$1.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$2.span, _extends._extends({
|
|
2301
1838
|
id: itemContext.textId
|
|
2302
1839
|
}, itemTextProps, {
|
|
2303
1840
|
ref: composedRefs
|
|
@@ -2309,7 +1846,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React$1.forwardR
|
|
|
2309
1846
|
const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
2310
1847
|
const { __scopeSelect: __scopeSelect , ...itemIndicatorProps } = props;
|
|
2311
1848
|
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_INDICATOR_NAME, __scopeSelect);
|
|
2312
|
-
return itemContext.isSelected ? /*#__PURE__*/ React$1.createElement(
|
|
1849
|
+
return itemContext.isSelected ? /*#__PURE__*/ React$1.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$2.span, _extends._extends({
|
|
2313
1850
|
"aria-hidden": true
|
|
2314
1851
|
}, itemIndicatorProps, {
|
|
2315
1852
|
ref: forwardedRef
|
|
@@ -2321,7 +1858,7 @@ const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ React$1.forwardR
|
|
|
2321
1858
|
const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
2322
1859
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
2323
1860
|
const [canScrollUp1, setCanScrollUp] = React$1.useState(false);
|
|
2324
|
-
const composedRefs =
|
|
1861
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, contentContext.onScrollButtonChange);
|
|
2325
1862
|
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
2326
1863
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
2327
1864
|
const viewport = contentContext.viewport;
|
|
@@ -2338,7 +1875,7 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React$1.forwardR
|
|
|
2338
1875
|
contentContext.viewport,
|
|
2339
1876
|
contentContext.isPositioned
|
|
2340
1877
|
]);
|
|
2341
|
-
return canScrollUp1 ? /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl,
|
|
1878
|
+
return canScrollUp1 ? /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, _extends._extends({}, props, {
|
|
2342
1879
|
ref: composedRefs,
|
|
2343
1880
|
onAutoScroll: ()=>{
|
|
2344
1881
|
const { viewport: viewport , selectedItem: selectedItem } = contentContext;
|
|
@@ -2352,7 +1889,7 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React$1.forwardR
|
|
|
2352
1889
|
const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
2353
1890
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
2354
1891
|
const [canScrollDown1, setCanScrollDown] = React$1.useState(false);
|
|
2355
|
-
const composedRefs =
|
|
1892
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, contentContext.onScrollButtonChange);
|
|
2356
1893
|
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
2357
1894
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
2358
1895
|
const viewport = contentContext.viewport;
|
|
@@ -2371,7 +1908,7 @@ const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React$1.forwardRe
|
|
|
2371
1908
|
contentContext.viewport,
|
|
2372
1909
|
contentContext.isPositioned
|
|
2373
1910
|
]);
|
|
2374
|
-
return canScrollDown1 ? /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl,
|
|
1911
|
+
return canScrollDown1 ? /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, _extends._extends({}, props, {
|
|
2375
1912
|
ref: composedRefs,
|
|
2376
1913
|
onAutoScroll: ()=>{
|
|
2377
1914
|
const { viewport: viewport , selectedItem: selectedItem } = contentContext;
|
|
@@ -2409,7 +1946,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$1.forwa
|
|
|
2409
1946
|
}, [
|
|
2410
1947
|
getItems
|
|
2411
1948
|
]);
|
|
2412
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
1949
|
+
return /*#__PURE__*/ React$1.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$2.div, _extends._extends({
|
|
2413
1950
|
"aria-hidden": true
|
|
2414
1951
|
}, scrollIndicatorProps, {
|
|
2415
1952
|
ref: forwardedRef,
|
|
@@ -2417,12 +1954,12 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$1.forwa
|
|
|
2417
1954
|
flexShrink: 0,
|
|
2418
1955
|
...scrollIndicatorProps.style
|
|
2419
1956
|
},
|
|
2420
|
-
onPointerMove:
|
|
1957
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerMove, ()=>{
|
|
2421
1958
|
var _contentContext$onIte3;
|
|
2422
1959
|
(_contentContext$onIte3 = contentContext.onItemLeave) === null || _contentContext$onIte3 === void 0 || _contentContext$onIte3.call(contentContext);
|
|
2423
1960
|
if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
2424
1961
|
}),
|
|
2425
|
-
onPointerLeave:
|
|
1962
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerLeave, ()=>{
|
|
2426
1963
|
clearAutoScrollTimer();
|
|
2427
1964
|
})
|
|
2428
1965
|
}));
|
|
@@ -2430,7 +1967,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$1.forwa
|
|
|
2430
1967
|
/* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$BubbleSelect = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
2431
1968
|
const { value: value , ...selectProps } = props;
|
|
2432
1969
|
const ref = React$1.useRef(null);
|
|
2433
|
-
const composedRefs =
|
|
1970
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
|
|
2434
1971
|
const prevValue = index_module.$010c2913dbd2fe3d$export$5cae361ad82dce8b(value); // Bubble value change to parents (e.g form change event)
|
|
2435
1972
|
React$1.useEffect(()=>{
|
|
2436
1973
|
const select = ref.current;
|
|
@@ -2461,14 +1998,14 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$1.forwa
|
|
|
2461
1998
|
* won't work otherwise.
|
|
2462
1999
|
*/ return /*#__PURE__*/ React$1.createElement($ea1ef594cf570d83$export$439d29a4e110a164, {
|
|
2463
2000
|
asChild: true
|
|
2464
|
-
}, /*#__PURE__*/ React$1.createElement("select",
|
|
2001
|
+
}, /*#__PURE__*/ React$1.createElement("select", _extends._extends({}, selectProps, {
|
|
2465
2002
|
ref: composedRefs,
|
|
2466
2003
|
defaultValue: value
|
|
2467
2004
|
})));
|
|
2468
2005
|
});
|
|
2469
2006
|
$cc7e05a45900e73f$var$BubbleSelect.displayName = 'BubbleSelect';
|
|
2470
2007
|
function $cc7e05a45900e73f$var$useTypeaheadSearch(onSearchChange) {
|
|
2471
|
-
const handleSearchChange =
|
|
2008
|
+
const handleSearchChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onSearchChange);
|
|
2472
2009
|
const searchRef = React$1.useRef('');
|
|
2473
2010
|
const timerRef = React$1.useRef(0);
|
|
2474
2011
|
const handleTypeaheadSearch = React$1.useCallback((key)=>{
|
|
@@ -2568,7 +2105,7 @@ var BtIconChevronUp2Px_2 = BtIconChevronUp2Px;
|
|
|
2568
2105
|
|
|
2569
2106
|
/** Use `Select` to choose from a dropdown list of options. */
|
|
2570
2107
|
var Select = function (_a) {
|
|
2571
|
-
var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, name = _a.name, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure;
|
|
2108
|
+
var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, name = _a.name, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, props = filterDataAttrs.__rest(_a, ["isRequired", "isDisabled", "placeholder", "label", "options", "onOpenChange", "isDefaultOpen", "defaultValue", "errorMessage", "labelSize", "helper", "name", "isFluid", "onBlur", "onChange", "disclosureTitle", "disclosureText", "onClickDisclosure"]);
|
|
2572
2109
|
var id = React$1.useId();
|
|
2573
2110
|
var arcRootElement = React$1.useContext(Base.ArcRootElementContext);
|
|
2574
2111
|
var surface = React$1.useContext(Surface.Context).surface;
|
|
@@ -2583,16 +2120,16 @@ var Select = function (_a) {
|
|
|
2583
2120
|
};
|
|
2584
2121
|
return (React__default["default"].createElement(FormControl.FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", isDisabled: isDisabled, disclosureText: disclosureText, disclosureTitle: disclosureTitle, onClickDisclosure: onClickDisclosure },
|
|
2585
2122
|
React__default["default"].createElement($cc7e05a45900e73f$export$be92b6f5f03c0fe9, { name: name, required: isRequired, disabled: isDisabled, defaultOpen: isDefaultOpen, value: selectedValue, onOpenChange: onOpenChange, onValueChange: function (value) { return onValueChange(value); } },
|
|
2586
|
-
React__default["default"].createElement($cc7e05a45900e73f$export$41fb9f06171c75f4, { id: id, name: name, onBlur: onBlur, className: index.classNames("arc-Select-trigger", {
|
|
2123
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$41fb9f06171c75f4, filterDataAttrs.__assign({ id: id, name: name, onBlur: onBlur, className: index$1.classNames("arc-Select-trigger", {
|
|
2587
2124
|
"arc-Select-trigger--constrained": !isFluid,
|
|
2588
2125
|
"arc-Select-trigger--onDarkSurface": surface === "dark",
|
|
2589
2126
|
"arc-Select-trigger--invalid": errorMessage
|
|
2590
|
-
}) },
|
|
2127
|
+
}) }, filterDataAttrs.filterDataAttrs(props)),
|
|
2591
2128
|
React__default["default"].createElement($cc7e05a45900e73f$export$4c8d1a57a761ef94, { asChild: true, "aria-label": getSelectedValueName(selectedValue) }, !selectedValue ? (React__default["default"].createElement("span", { "aria-hidden": true, className: "arc-Select-placeHolder" }, placeholder)) : (React__default["default"].createElement("span", { className: "arc-Select-valueItem" }, getSelectedValueName(selectedValue)))),
|
|
2592
2129
|
React__default["default"].createElement($cc7e05a45900e73f$export$f04a61298a47a40f, { className: "arc-Select-triggerIcon" },
|
|
2593
2130
|
React__default["default"].createElement(Icon.Icon, { icon: BtIconChevronDown2Px.BtIconChevronDown2Px_2, size: 20 }))),
|
|
2594
2131
|
React__default["default"].createElement($cc7e05a45900e73f$export$602eac185826482c, { container: arcRootElement },
|
|
2595
|
-
React__default["default"].createElement($cc7e05a45900e73f$export$7c6e2c02157bb7d2, { className: index.classNames("arc-Select-content", {
|
|
2132
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$7c6e2c02157bb7d2, { className: index$1.classNames("arc-Select-content", {
|
|
2596
2133
|
"arc-Select-content--onDarkSurface": surface === "dark"
|
|
2597
2134
|
}) },
|
|
2598
2135
|
React__default["default"].createElement($cc7e05a45900e73f$export$2f60d3ec9ad468f2, { className: "arc-Select-scrollButton" },
|