@arc-ui/components 11.6.0 → 11.7.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 +4 -4
- package/dist/Alert/Alert.esm.d.ts +1 -1
- package/dist/Alert/Alert.esm.js +4 -4
- package/dist/Badge/Badge.cjs.js +2 -2
- package/dist/Badge/Badge.esm.js +2 -2
- package/dist/Box/Box.cjs.d.ts +1 -0
- package/dist/Box/Box.cjs.js +13 -0
- package/dist/Box/Box.esm.d.ts +1 -0
- package/dist/Box/Box.esm.js +5 -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 +3 -3
- package/dist/Breadcrumbs/Breadcrumbs.esm.d.ts +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +3 -3
- 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/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/MediaCard/MediaCard.cjs.d.ts +61 -0
- package/dist/MediaCard/MediaCard.cjs.js +31 -0
- package/dist/MediaCard/MediaCard.esm.d.ts +61 -0
- package/dist/MediaCard/MediaCard.esm.js +23 -0
- package/dist/MediaCard/package.json +7 -0
- package/dist/Modal/Modal.cjs.d.ts +31 -0
- package/dist/Modal/Modal.cjs.js +388 -0
- package/dist/Modal/Modal.esm.d.ts +31 -0
- package/dist/Modal/Modal.esm.js +380 -0
- package/dist/Modal/package.json +7 -0
- package/dist/Pagination/Pagination.cjs.js +2 -2
- package/dist/Pagination/Pagination.esm.js +2 -2
- package/dist/PaginationSimple/PaginationSimple.cjs.js +2 -2
- package/dist/PaginationSimple/PaginationSimple.esm.js +2 -2
- 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 +4 -4
- package/dist/ProgressBar/ProgressBar.esm.js +4 -4
- 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 +20 -1418
- package/dist/Select/Select.esm.d.ts +1 -1
- package/dist/Select/Select.esm.js +10 -1389
- package/dist/SiteFooter/SiteFooter.cjs.d.ts +1 -1
- package/dist/SiteFooter/SiteFooter.cjs.js +3 -3
- package/dist/SiteFooter/SiteFooter.esm.d.ts +1 -1
- package/dist/SiteFooter/SiteFooter.esm.js +4 -4
- 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 +8 -7
- package/dist/Switch/Switch.esm.d.ts +1 -1
- package/dist/Switch/Switch.esm.js +7 -6
- 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 +1 -1
- package/dist/TextArea/TextArea.cjs.js +20 -20
- package/dist/TextArea/TextArea.esm.d.ts +1 -1
- package/dist/TextArea/TextArea.esm.js +20 -20
- package/dist/TextInput/TextInput.cjs.js +5 -5
- package/dist/TextInput/TextInput.esm.js +5 -5
- 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/Box-ebe2b7be.d.ts +39 -0
- package/dist/_shared/cjs/Box-ebe2b7be.js +30 -0
- package/dist/_shared/cjs/{BrandLogo-8008f0c4.js → BrandLogo-8107d59f.js} +1 -1
- package/dist/_shared/cjs/{Breadcrumbs-8b554370.js → Breadcrumbs-9f580f69.js} +1 -1
- package/dist/_shared/cjs/{Button-27512fee.js → Button-b4d6ccc8.js} +2 -2
- package/dist/_shared/cjs/{Card-804ab0e5.js → Card-f1108bfe.js} +4 -4
- package/dist/_shared/cjs/{Checkbox-21d3c4f6.js → Checkbox-c927b62f.js} +2 -2
- package/dist/_shared/cjs/{DisclosureMini-067e0319.js → DisclosureMini-2a10006e.js} +2 -2
- package/dist/_shared/cjs/{Filter-f7d2fbda.js → Filter-a7574fe7.js} +1 -1
- package/dist/_shared/cjs/{FormControl-9aaddd54.js → FormControl-78b007b7.js} +2 -2
- package/dist/_shared/cjs/{Group-d83f8c2e.js → Group-f85dd4c0.js} +1 -1
- package/dist/_shared/cjs/{Heading-d45f6a7f.js → Heading-ed1cb455.js} +1 -1
- 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-8e17de70.d.ts} +1 -1
- package/dist/_shared/cjs/{RadioGroup-81805ef9.js → RadioGroup-8e17de70.js} +2 -2
- package/dist/_shared/cjs/{SiteFooter-c540b5f1.js → SiteFooter-9f7f9c2d.js} +2 -2
- package/dist/_shared/cjs/SiteHeader-c25ee36e.d.ts +3 -3
- package/dist/_shared/cjs/{SiteHeader.rehydrator-f7fa2efe.js → SiteHeader.rehydrator-ccbebde6.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/cjs/{Text-6f2827e6.js → Text-555a29a4.js} +1 -1
- package/dist/_shared/cjs/TextInput-7ed03a48.d.ts +1 -1
- package/dist/_shared/{esm/TextInput-1631dbc4.d.ts → cjs/TextInput-b768e346.d.ts} +2 -2
- package/dist/_shared/cjs/{TextInput-33314fc4.js → TextInput-b768e346.js} +2 -2
- package/dist/_shared/cjs/{UniversalHeader-cc1d9e5a.js → UniversalHeader-da622e1a.js} +1 -1
- package/dist/_shared/cjs/index-31fbb076.js +1416 -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-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-f419cf04.d.ts +1 -1
- package/dist/_shared/cjs/index.module-5ea728f4.js +23 -0
- package/dist/_shared/cjs/{index.module-af7c85f2.js → index.module-9b87a34d.js} +84 -103
- package/dist/_shared/esm/Box-06d99d8a.d.ts +39 -0
- package/dist/_shared/esm/Box-06d99d8a.js +24 -0
- package/dist/_shared/esm/{BrandLogo-56699561.js → BrandLogo-9ec620e8.js} +1 -1
- package/dist/_shared/esm/{Breadcrumbs-04590057.js → Breadcrumbs-5dc0afa7.js} +1 -1
- package/dist/_shared/esm/{Button-d319fa11.js → Button-9c3b0b11.js} +2 -2
- package/dist/_shared/esm/{Card-e79eb6c8.js → Card-79b6eae0.js} +4 -4
- package/dist/_shared/esm/{Checkbox-94300d8c.js → Checkbox-2d144384.js} +2 -2
- package/dist/_shared/esm/{DisclosureMini-022beae3.js → DisclosureMini-78a8f392.js} +2 -2
- package/dist/_shared/esm/{Filter-41b391e3.js → Filter-a01aed11.js} +1 -1
- package/dist/_shared/esm/{FormControl-5e3fdca3.js → FormControl-2fa7aae5.js} +2 -2
- package/dist/_shared/esm/{Group-d62c3f56.js → Group-fb26fd32.js} +1 -1
- package/dist/_shared/esm/{Heading-b61432fb.js → Heading-ee6bec51.js} +1 -1
- 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-65b8c8bf.d.ts} +1 -1
- package/dist/_shared/esm/{RadioGroup-1fd0f389.js → RadioGroup-65b8c8bf.js} +2 -2
- package/dist/_shared/esm/{SiteFooter-8075a9bd.js → SiteFooter-51bdc7df.js} +2 -2
- package/dist/_shared/esm/SiteHeader-c25ee36e.d.ts +3 -3
- package/dist/_shared/esm/{SiteHeader.rehydrator-4da8ac64.js → SiteHeader.rehydrator-382d1c03.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/esm/{Text-00e9743b.js → Text-14deb70e.js} +1 -1
- package/dist/_shared/esm/{TextInput-1631dbc4.js → TextInput-62bb7dee.js} +2 -2
- package/dist/_shared/esm/TextInput-7ed03a48.d.ts +1 -1
- package/dist/_shared/esm/{UniversalHeader-7926abde.js → UniversalHeader-1c5a886d.js} +1 -1
- package/dist/_shared/esm/index-4fa635bd.js +1386 -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-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-599b86dd.js → index.module-216016b5.js} +86 -104
- package/dist/_shared/esm/index.module-88179159.js +21 -0
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- 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/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.stories-wip.d.ts +9 -0
- 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/styles.d.ts +5 -0
- package/package.json +4 -4
- /package/dist/_shared/cjs/{BrandLogo-8008f0c4.d.ts → BrandLogo-8107d59f.d.ts} +0 -0
- /package/dist/_shared/cjs/{Breadcrumbs-8b554370.d.ts → Breadcrumbs-9f580f69.d.ts} +0 -0
- /package/dist/_shared/cjs/{Button-27512fee.d.ts → Button-b4d6ccc8.d.ts} +0 -0
- /package/dist/_shared/cjs/{Card-804ab0e5.d.ts → Card-f1108bfe.d.ts} +0 -0
- /package/dist/_shared/cjs/{Checkbox-21d3c4f6.d.ts → Checkbox-c927b62f.d.ts} +0 -0
- /package/dist/_shared/cjs/{DisclosureMini-067e0319.d.ts → DisclosureMini-2a10006e.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-78b007b7.d.ts} +0 -0
- /package/dist/_shared/cjs/{Group-d83f8c2e.d.ts → Group-f85dd4c0.d.ts} +0 -0
- /package/dist/_shared/cjs/{Heading-d45f6a7f.d.ts → Heading-ed1cb455.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-9f7f9c2d.d.ts} +0 -0
- /package/dist/_shared/cjs/{SiteHeader.rehydrator-f7fa2efe.d.ts → SiteHeader.rehydrator-ccbebde6.d.ts} +0 -0
- /package/dist/_shared/cjs/{Text-6f2827e6.d.ts → Text-555a29a4.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-5dc0afa7.d.ts} +0 -0
- /package/dist/_shared/esm/{Button-d319fa11.d.ts → Button-9c3b0b11.d.ts} +0 -0
- /package/dist/_shared/esm/{Card-e79eb6c8.d.ts → Card-79b6eae0.d.ts} +0 -0
- /package/dist/_shared/esm/{Checkbox-94300d8c.d.ts → Checkbox-2d144384.d.ts} +0 -0
- /package/dist/_shared/esm/{DisclosureMini-022beae3.d.ts → DisclosureMini-78a8f392.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-2fa7aae5.d.ts} +0 -0
- /package/dist/_shared/esm/{Group-d62c3f56.d.ts → Group-fb26fd32.d.ts} +0 -0
- /package/dist/_shared/esm/{Heading-b61432fb.d.ts → Heading-ee6bec51.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-51bdc7df.d.ts} +0 -0
- /package/dist/_shared/esm/{SiteHeader.rehydrator-4da8ac64.d.ts → SiteHeader.rehydrator-382d1c03.d.ts} +0 -0
- /package/dist/_shared/esm/{Text-00e9743b.d.ts → Text-14deb70e.d.ts} +0 -0
- /package/dist/_shared/{cjs/TextInput-33314fc4.d.ts → esm/TextInput-62bb7dee.d.ts} +0 -0
- /package/dist/_shared/esm/{UniversalHeader-7926abde.d.ts → UniversalHeader-1c5a886d.d.ts} +0 -0
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { c as classNames } from '../_shared/esm/index-2ae58626.js';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import $
|
|
2
|
+
import React__default, { useContext, createContext, forwardRef, createElement, useState, useRef, useCallback, Fragment, useEffect, useMemo, useId } from 'react';
|
|
3
|
+
import { b as $c512c27ab02ef895$export$50c7b4e9d9f19c1, $ as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, d as $5e63c961fc1ce211$export$8c6ed5c666ac1360, e as $8927f6f2acc4f386$export$250ffa63cdc0d034, _ as _extends, c as $71cd76cc60e0454e$export$6f32135080cb4c3, f as $e42e1063c40fb3ef$export$b9ecd428b558ff10, a as $9f79659886946c16$export$e5c5a5f917a5871c, g as $b1b2314f5f9a1d84$export$25bec8c6f54ee79a } from '../_shared/esm/index.module-216016b5.js';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
import { $ as $1746a345f3d73bb7$export$f680877a34711e37, a as $f1701beae083dbae$export$602eac185826482c, h as hideOthers, c as $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c, b as $01b9c$RemoveScroll, d as $d3863c46a17e8a28$export$20e40289641fbbb6, e as $5cb92bef7577960e$export$177fb62ff3ec1f22 } from '../_shared/esm/index-4fa635bd.js';
|
|
6
|
+
import { $ as $010c2913dbd2fe3d$export$5cae361ad82dce8b } from '../_shared/esm/index.module-88179159.js';
|
|
6
7
|
import { B as BtIconChevronDown2Px_2 } from '../_shared/esm/BtIconChevronDown2Px-782876e2.js';
|
|
7
8
|
import { B as BtIconTickAlt2Px_2 } from '../_shared/esm/BtIconTickAlt2Px-da97e9ae.js';
|
|
8
|
-
import { I as Icon } from '../_shared/esm/Icon-
|
|
9
|
-
import { F as FormControl } from '../_shared/esm/FormControl-
|
|
10
|
-
import { C as Context } from '../_shared/esm/Surface-
|
|
9
|
+
import { I as Icon } from '../_shared/esm/Icon-c1af47bc.js';
|
|
10
|
+
import { F as FormControl } from '../_shared/esm/FormControl-2fa7aae5.js';
|
|
11
|
+
import { C as Context } from '../_shared/esm/Surface-dde51789.js';
|
|
11
12
|
import { A as ArcRootElementContext } from '../_shared/esm/Base-6c01e0ec.js';
|
|
12
13
|
import '../_shared/esm/filter-data-attrs-afdb7d32.js';
|
|
13
14
|
import '../_shared/esm/suffix-modifier-7e640670.js';
|
|
14
15
|
import '../_shared/esm/BtIconAlert-55a6ed5c.js';
|
|
15
|
-
import '../_shared/esm/DisclosureMini-
|
|
16
|
-
import '../_shared/esm/Text-
|
|
16
|
+
import '../_shared/esm/DisclosureMini-78a8f392.js';
|
|
17
|
+
import '../_shared/esm/Text-14deb70e.js';
|
|
17
18
|
|
|
18
19
|
function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(value, [min, max]) {
|
|
19
20
|
return Math.min(max, Math.max(min, value));
|
|
@@ -112,543 +113,6 @@ const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ createContext(undef
|
|
|
112
113
|
return localDir || globalDir || 'ltr';
|
|
113
114
|
}
|
|
114
115
|
|
|
115
|
-
/**
|
|
116
|
-
* Listens for when the escape key is down
|
|
117
|
-
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
118
|
-
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
119
|
-
useEffect(()=>{
|
|
120
|
-
const handleKeyDown = (event)=>{
|
|
121
|
-
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
122
|
-
};
|
|
123
|
-
ownerDocument.addEventListener('keydown', handleKeyDown);
|
|
124
|
-
return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
|
|
125
|
-
;
|
|
126
|
-
}, [
|
|
127
|
-
onEscapeKeyDown,
|
|
128
|
-
ownerDocument
|
|
129
|
-
]);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
133
|
-
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
134
|
-
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
135
|
-
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
136
|
-
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ createContext({
|
|
137
|
-
layers: new Set(),
|
|
138
|
-
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
139
|
-
branches: new Set()
|
|
140
|
-
});
|
|
141
|
-
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
142
|
-
var _node$ownerDocument;
|
|
143
|
-
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
144
|
-
const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
145
|
-
const [node1, setNode] = useState(null);
|
|
146
|
-
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;
|
|
147
|
-
const [, force] = useState({});
|
|
148
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
149
|
-
);
|
|
150
|
-
const layers = Array.from(context.layers);
|
|
151
|
-
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
152
|
-
...context.layersWithOutsidePointerEventsDisabled
|
|
153
|
-
].slice(-1); // prettier-ignore
|
|
154
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
|
|
155
|
-
const index = node1 ? layers.indexOf(node1) : -1;
|
|
156
|
-
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
157
|
-
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
158
|
-
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
159
|
-
const target = event.target;
|
|
160
|
-
const isPointerDownOnBranch = [
|
|
161
|
-
...context.branches
|
|
162
|
-
].some((branch)=>branch.contains(target)
|
|
163
|
-
);
|
|
164
|
-
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
165
|
-
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
166
|
-
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
167
|
-
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
168
|
-
}, ownerDocument);
|
|
169
|
-
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
170
|
-
const target = event.target;
|
|
171
|
-
const isFocusInBranch = [
|
|
172
|
-
...context.branches
|
|
173
|
-
].some((branch)=>branch.contains(target)
|
|
174
|
-
);
|
|
175
|
-
if (isFocusInBranch) return;
|
|
176
|
-
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
|
|
177
|
-
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
178
|
-
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
179
|
-
}, ownerDocument);
|
|
180
|
-
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
181
|
-
const isHighestLayer = index === context.layers.size - 1;
|
|
182
|
-
if (!isHighestLayer) return;
|
|
183
|
-
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
184
|
-
if (!event.defaultPrevented && onDismiss) {
|
|
185
|
-
event.preventDefault();
|
|
186
|
-
onDismiss();
|
|
187
|
-
}
|
|
188
|
-
}, ownerDocument);
|
|
189
|
-
useEffect(()=>{
|
|
190
|
-
if (!node1) return;
|
|
191
|
-
if (disableOutsidePointerEvents) {
|
|
192
|
-
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
193
|
-
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
194
|
-
ownerDocument.body.style.pointerEvents = 'none';
|
|
195
|
-
}
|
|
196
|
-
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
197
|
-
}
|
|
198
|
-
context.layers.add(node1);
|
|
199
|
-
$5cb92bef7577960e$var$dispatchUpdate();
|
|
200
|
-
return ()=>{
|
|
201
|
-
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
202
|
-
};
|
|
203
|
-
}, [
|
|
204
|
-
node1,
|
|
205
|
-
ownerDocument,
|
|
206
|
-
disableOutsidePointerEvents,
|
|
207
|
-
context
|
|
208
|
-
]);
|
|
209
|
-
/**
|
|
210
|
-
* We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
|
|
211
|
-
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
|
212
|
-
* and add it to the end again so the layering order wouldn't be _creation order_.
|
|
213
|
-
* We only want them to be removed from context stacks when unmounted.
|
|
214
|
-
*/ useEffect(()=>{
|
|
215
|
-
return ()=>{
|
|
216
|
-
if (!node1) return;
|
|
217
|
-
context.layers.delete(node1);
|
|
218
|
-
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
219
|
-
$5cb92bef7577960e$var$dispatchUpdate();
|
|
220
|
-
};
|
|
221
|
-
}, [
|
|
222
|
-
node1,
|
|
223
|
-
context
|
|
224
|
-
]);
|
|
225
|
-
useEffect(()=>{
|
|
226
|
-
const handleUpdate = ()=>force({})
|
|
227
|
-
;
|
|
228
|
-
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
229
|
-
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
230
|
-
;
|
|
231
|
-
}, []);
|
|
232
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
|
233
|
-
ref: composedRefs,
|
|
234
|
-
style: {
|
|
235
|
-
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
236
|
-
...props.style
|
|
237
|
-
},
|
|
238
|
-
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
239
|
-
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
240
|
-
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
241
|
-
}));
|
|
242
|
-
});
|
|
243
|
-
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
244
|
-
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
245
|
-
* to mimic layer dismissing behaviour present in OS.
|
|
246
|
-
* Returns props to pass to the node we want to check for outside events.
|
|
247
|
-
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
248
|
-
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
249
|
-
const isPointerInsideReactTreeRef = useRef(false);
|
|
250
|
-
const handleClickRef = useRef(()=>{});
|
|
251
|
-
useEffect(()=>{
|
|
252
|
-
const handlePointerDown = (event)=>{
|
|
253
|
-
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
254
|
-
const eventDetail = {
|
|
255
|
-
originalEvent: event
|
|
256
|
-
};
|
|
257
|
-
function handleAndDispatchPointerDownOutsideEvent() {
|
|
258
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
259
|
-
discrete: true
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* On touch devices, we need to wait for a click event because browsers implement
|
|
264
|
-
* a ~350ms delay between the time the user stops touching the display and when the
|
|
265
|
-
* browser executres events. We need to ensure we don't reactivate pointer-events within
|
|
266
|
-
* this timeframe otherwise the browser may execute events that should have been prevented.
|
|
267
|
-
*
|
|
268
|
-
* Additionally, this also lets us deal automatically with cancellations when a click event
|
|
269
|
-
* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
|
|
270
|
-
*
|
|
271
|
-
* This is why we also continuously remove the previous listener, because we cannot be
|
|
272
|
-
* certain that it was raised, and therefore cleaned-up.
|
|
273
|
-
*/ if (event.pointerType === 'touch') {
|
|
274
|
-
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
275
|
-
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
276
|
-
ownerDocument.addEventListener('click', handleClickRef.current, {
|
|
277
|
-
once: true
|
|
278
|
-
});
|
|
279
|
-
} else handleAndDispatchPointerDownOutsideEvent();
|
|
280
|
-
}
|
|
281
|
-
isPointerInsideReactTreeRef.current = false;
|
|
282
|
-
};
|
|
283
|
-
/**
|
|
284
|
-
* if this hook executes in a component that mounts via a `pointerdown` event, the event
|
|
285
|
-
* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
|
|
286
|
-
* this by delaying the event listener registration on the document.
|
|
287
|
-
* This is not React specific, but rather how the DOM works, ie:
|
|
288
|
-
* ```
|
|
289
|
-
* button.addEventListener('pointerdown', () => {
|
|
290
|
-
* console.log('I will log');
|
|
291
|
-
* document.addEventListener('pointerdown', () => {
|
|
292
|
-
* console.log('I will also log');
|
|
293
|
-
* })
|
|
294
|
-
* });
|
|
295
|
-
*/ const timerId = window.setTimeout(()=>{
|
|
296
|
-
ownerDocument.addEventListener('pointerdown', handlePointerDown);
|
|
297
|
-
}, 0);
|
|
298
|
-
return ()=>{
|
|
299
|
-
window.clearTimeout(timerId);
|
|
300
|
-
ownerDocument.removeEventListener('pointerdown', handlePointerDown);
|
|
301
|
-
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
302
|
-
};
|
|
303
|
-
}, [
|
|
304
|
-
ownerDocument,
|
|
305
|
-
handlePointerDownOutside
|
|
306
|
-
]);
|
|
307
|
-
return {
|
|
308
|
-
// ensures we check React component tree (not just DOM tree)
|
|
309
|
-
onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Listens for when focus happens outside a react subtree.
|
|
314
|
-
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
315
|
-
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
316
|
-
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
317
|
-
const isFocusInsideReactTreeRef = useRef(false);
|
|
318
|
-
useEffect(()=>{
|
|
319
|
-
const handleFocus = (event)=>{
|
|
320
|
-
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
321
|
-
const eventDetail = {
|
|
322
|
-
originalEvent: event
|
|
323
|
-
};
|
|
324
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
325
|
-
discrete: false
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
};
|
|
329
|
-
ownerDocument.addEventListener('focusin', handleFocus);
|
|
330
|
-
return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
|
|
331
|
-
;
|
|
332
|
-
}, [
|
|
333
|
-
ownerDocument,
|
|
334
|
-
handleFocusOutside
|
|
335
|
-
]);
|
|
336
|
-
return {
|
|
337
|
-
onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
|
|
338
|
-
,
|
|
339
|
-
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
343
|
-
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
344
|
-
document.dispatchEvent(event);
|
|
345
|
-
}
|
|
346
|
-
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
347
|
-
const target = detail.originalEvent.target;
|
|
348
|
-
const event = new CustomEvent(name, {
|
|
349
|
-
bubbles: false,
|
|
350
|
-
cancelable: true,
|
|
351
|
-
detail: detail
|
|
352
|
-
});
|
|
353
|
-
if (handler) target.addEventListener(name, handler, {
|
|
354
|
-
once: true
|
|
355
|
-
});
|
|
356
|
-
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
357
|
-
else target.dispatchEvent(event);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
|
|
361
|
-
/**
|
|
362
|
-
* Injects a pair of focus guards at the edges of the whole DOM tree
|
|
363
|
-
* to ensure `focusin` & `focusout` events can be caught consistently.
|
|
364
|
-
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
365
|
-
useEffect(()=>{
|
|
366
|
-
var _edgeGuards$, _edgeGuards$2;
|
|
367
|
-
const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
|
|
368
|
-
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
369
|
-
document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
370
|
-
$3db38b7d1fb3fe6a$var$count++;
|
|
371
|
-
return ()=>{
|
|
372
|
-
if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
|
|
373
|
-
);
|
|
374
|
-
$3db38b7d1fb3fe6a$var$count--;
|
|
375
|
-
};
|
|
376
|
-
}, []);
|
|
377
|
-
}
|
|
378
|
-
function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
379
|
-
const element = document.createElement('span');
|
|
380
|
-
element.setAttribute('data-radix-focus-guard', '');
|
|
381
|
-
element.tabIndex = 0;
|
|
382
|
-
element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
|
|
383
|
-
return element;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
|
|
387
|
-
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
|
|
388
|
-
const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
389
|
-
bubbles: false,
|
|
390
|
-
cancelable: true
|
|
391
|
-
};
|
|
392
|
-
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
393
|
-
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
394
|
-
const [container1, setContainer] = useState(null);
|
|
395
|
-
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
396
|
-
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
397
|
-
const lastFocusedElementRef = useRef(null);
|
|
398
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
|
399
|
-
);
|
|
400
|
-
const focusScope = useRef({
|
|
401
|
-
paused: false,
|
|
402
|
-
pause () {
|
|
403
|
-
this.paused = true;
|
|
404
|
-
},
|
|
405
|
-
resume () {
|
|
406
|
-
this.paused = false;
|
|
407
|
-
}
|
|
408
|
-
}).current; // Takes care of trapping focus if focus is moved outside programmatically for example
|
|
409
|
-
useEffect(()=>{
|
|
410
|
-
if (trapped) {
|
|
411
|
-
function handleFocusIn(event) {
|
|
412
|
-
if (focusScope.paused || !container1) return;
|
|
413
|
-
const target = event.target;
|
|
414
|
-
if (container1.contains(target)) lastFocusedElementRef.current = target;
|
|
415
|
-
else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
416
|
-
select: true
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
function handleFocusOut(event) {
|
|
420
|
-
if (focusScope.paused || !container1) return;
|
|
421
|
-
if (!container1.contains(event.relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
422
|
-
select: true
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
document.addEventListener('focusin', handleFocusIn);
|
|
426
|
-
document.addEventListener('focusout', handleFocusOut);
|
|
427
|
-
return ()=>{
|
|
428
|
-
document.removeEventListener('focusin', handleFocusIn);
|
|
429
|
-
document.removeEventListener('focusout', handleFocusOut);
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
}, [
|
|
433
|
-
trapped,
|
|
434
|
-
container1,
|
|
435
|
-
focusScope.paused
|
|
436
|
-
]);
|
|
437
|
-
useEffect(()=>{
|
|
438
|
-
if (container1) {
|
|
439
|
-
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
|
|
440
|
-
const previouslyFocusedElement = document.activeElement;
|
|
441
|
-
const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
|
|
442
|
-
if (!hasFocusedCandidate) {
|
|
443
|
-
const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
444
|
-
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
445
|
-
container1.dispatchEvent(mountEvent);
|
|
446
|
-
if (!mountEvent.defaultPrevented) {
|
|
447
|
-
$d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
|
|
448
|
-
select: true
|
|
449
|
-
});
|
|
450
|
-
if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
return ()=>{
|
|
454
|
-
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
|
|
455
|
-
// We need to delay the focus a little to get around it for now.
|
|
456
|
-
// See: https://github.com/facebook/react/issues/17894
|
|
457
|
-
setTimeout(()=>{
|
|
458
|
-
const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
459
|
-
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
460
|
-
container1.dispatchEvent(unmountEvent);
|
|
461
|
-
if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
|
|
462
|
-
select: true
|
|
463
|
-
});
|
|
464
|
-
// we need to remove the listener after we `dispatchEvent`
|
|
465
|
-
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
466
|
-
$d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
|
|
467
|
-
}, 0);
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
}, [
|
|
471
|
-
container1,
|
|
472
|
-
onMountAutoFocus,
|
|
473
|
-
onUnmountAutoFocus,
|
|
474
|
-
focusScope
|
|
475
|
-
]); // Takes care of looping focus (when tabbing whilst at the edges)
|
|
476
|
-
const handleKeyDown = useCallback((event)=>{
|
|
477
|
-
if (!loop && !trapped) return;
|
|
478
|
-
if (focusScope.paused) return;
|
|
479
|
-
const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
480
|
-
const focusedElement = document.activeElement;
|
|
481
|
-
if (isTabKey && focusedElement) {
|
|
482
|
-
const container = event.currentTarget;
|
|
483
|
-
const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container);
|
|
484
|
-
const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges
|
|
485
|
-
if (!hasTabbableElementsInside) {
|
|
486
|
-
if (focusedElement === container) event.preventDefault();
|
|
487
|
-
} else {
|
|
488
|
-
if (!event.shiftKey && focusedElement === last) {
|
|
489
|
-
event.preventDefault();
|
|
490
|
-
if (loop) $d3863c46a17e8a28$var$focus(first, {
|
|
491
|
-
select: true
|
|
492
|
-
});
|
|
493
|
-
} else if (event.shiftKey && focusedElement === first) {
|
|
494
|
-
event.preventDefault();
|
|
495
|
-
if (loop) $d3863c46a17e8a28$var$focus(last, {
|
|
496
|
-
select: true
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
}, [
|
|
502
|
-
loop,
|
|
503
|
-
trapped,
|
|
504
|
-
focusScope.paused
|
|
505
|
-
]);
|
|
506
|
-
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
507
|
-
tabIndex: -1
|
|
508
|
-
}, scopeProps, {
|
|
509
|
-
ref: composedRefs,
|
|
510
|
-
onKeyDown: handleKeyDown
|
|
511
|
-
}));
|
|
512
|
-
});
|
|
513
|
-
/* -------------------------------------------------------------------------------------------------
|
|
514
|
-
* Utils
|
|
515
|
-
* -----------------------------------------------------------------------------------------------*/ /**
|
|
516
|
-
* Attempts focusing the first element in a list of candidates.
|
|
517
|
-
* Stops when focus has actually moved.
|
|
518
|
-
*/ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) {
|
|
519
|
-
const previouslyFocusedElement = document.activeElement;
|
|
520
|
-
for (const candidate of candidates){
|
|
521
|
-
$d3863c46a17e8a28$var$focus(candidate, {
|
|
522
|
-
select: select
|
|
523
|
-
});
|
|
524
|
-
if (document.activeElement !== previouslyFocusedElement) return;
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* Returns the first and last tabbable elements inside a container.
|
|
529
|
-
*/ function $d3863c46a17e8a28$var$getTabbableEdges(container) {
|
|
530
|
-
const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container);
|
|
531
|
-
const first = $d3863c46a17e8a28$var$findVisible(candidates, container);
|
|
532
|
-
const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container);
|
|
533
|
-
return [
|
|
534
|
-
first,
|
|
535
|
-
last
|
|
536
|
-
];
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Returns a list of potential tabbable candidates.
|
|
540
|
-
*
|
|
541
|
-
* NOTE: This is only a close approximation. For example it doesn't take into account cases like when
|
|
542
|
-
* elements are not visible. This cannot be worked out easily by just reading a property, but rather
|
|
543
|
-
* necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.
|
|
544
|
-
*
|
|
545
|
-
* See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
|
|
546
|
-
* Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
|
|
547
|
-
*/ function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
|
|
548
|
-
const nodes = [];
|
|
549
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
550
|
-
acceptNode: (node)=>{
|
|
551
|
-
const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';
|
|
552
|
-
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
|
|
553
|
-
// runtime's understanding of tabbability, so this automatically accounts
|
|
554
|
-
// for any kind of element that could be tabbed to.
|
|
555
|
-
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
556
|
-
}
|
|
557
|
-
});
|
|
558
|
-
while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it
|
|
559
|
-
// hinders accessibility to have tab order different from visual order.
|
|
560
|
-
return nodes;
|
|
561
|
-
}
|
|
562
|
-
/**
|
|
563
|
-
* Returns the first visible element in a list.
|
|
564
|
-
* NOTE: Only checks visibility up to the `container`.
|
|
565
|
-
*/ function $d3863c46a17e8a28$var$findVisible(elements, container) {
|
|
566
|
-
for (const element of elements){
|
|
567
|
-
// we stop checking if it's hidden at the `container` level (excluding)
|
|
568
|
-
if (!$d3863c46a17e8a28$var$isHidden(element, {
|
|
569
|
-
upTo: container
|
|
570
|
-
})) return element;
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) {
|
|
574
|
-
if (getComputedStyle(node).visibility === 'hidden') return true;
|
|
575
|
-
while(node){
|
|
576
|
-
// we stop at `upTo` (excluding it)
|
|
577
|
-
if (upTo !== undefined && node === upTo) return false;
|
|
578
|
-
if (getComputedStyle(node).display === 'none') return true;
|
|
579
|
-
node = node.parentElement;
|
|
580
|
-
}
|
|
581
|
-
return false;
|
|
582
|
-
}
|
|
583
|
-
function $d3863c46a17e8a28$var$isSelectableInput(element) {
|
|
584
|
-
return element instanceof HTMLInputElement && 'select' in element;
|
|
585
|
-
}
|
|
586
|
-
function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) {
|
|
587
|
-
// only focus if that element is focusable
|
|
588
|
-
if (element && element.focus) {
|
|
589
|
-
const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users
|
|
590
|
-
element.focus({
|
|
591
|
-
preventScroll: true
|
|
592
|
-
}); // only select if its not the same element, it supports selection and we need to select
|
|
593
|
-
if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select();
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
/* -------------------------------------------------------------------------------------------------
|
|
597
|
-
* FocusScope stack
|
|
598
|
-
* -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
|
|
599
|
-
function $d3863c46a17e8a28$var$createFocusScopesStack() {
|
|
600
|
-
/** A stack of focus scopes, with the active one at the top */ let stack = [];
|
|
601
|
-
return {
|
|
602
|
-
add (focusScope) {
|
|
603
|
-
// pause the currently active focus scope (at the top of the stack)
|
|
604
|
-
const activeFocusScope = stack[0];
|
|
605
|
-
if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
|
|
606
|
-
// remove in case it already exists (because we'll re-add it at the top of the stack)
|
|
607
|
-
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
608
|
-
stack.unshift(focusScope);
|
|
609
|
-
},
|
|
610
|
-
remove (focusScope) {
|
|
611
|
-
var _stack$;
|
|
612
|
-
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
613
|
-
(_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
|
|
614
|
-
}
|
|
615
|
-
};
|
|
616
|
-
}
|
|
617
|
-
function $d3863c46a17e8a28$var$arrayRemove(array, item) {
|
|
618
|
-
const updatedArray = [
|
|
619
|
-
...array
|
|
620
|
-
];
|
|
621
|
-
const index = updatedArray.indexOf(item);
|
|
622
|
-
if (index !== -1) updatedArray.splice(index, 1);
|
|
623
|
-
return updatedArray;
|
|
624
|
-
}
|
|
625
|
-
function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
626
|
-
return items.filter((item)=>item.tagName !== 'A'
|
|
627
|
-
);
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
const $1746a345f3d73bb7$var$useReactId = React$1['useId'.toString()] || (()=>undefined
|
|
631
|
-
);
|
|
632
|
-
let $1746a345f3d73bb7$var$count = 0;
|
|
633
|
-
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
634
|
-
const [id, setId] = React$1.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
|
|
635
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
636
|
-
if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
|
|
637
|
-
);
|
|
638
|
-
}, [
|
|
639
|
-
deterministicId
|
|
640
|
-
]);
|
|
641
|
-
return deterministicId || (id ? `radix-${id}` : '');
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
645
|
-
var _globalThis$document;
|
|
646
|
-
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;
|
|
647
|
-
return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
648
|
-
ref: forwardedRef
|
|
649
|
-
})), container) : null;
|
|
650
|
-
});
|
|
651
|
-
|
|
652
116
|
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
653
117
|
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
|
|
654
118
|
ref: forwardedRef,
|
|
@@ -669,849 +133,6 @@ const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ forwardRef((prop
|
|
|
669
133
|
}));
|
|
670
134
|
});
|
|
671
135
|
|
|
672
|
-
var getDefaultParent = function (originalTarget) {
|
|
673
|
-
if (typeof document === 'undefined') {
|
|
674
|
-
return null;
|
|
675
|
-
}
|
|
676
|
-
var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
|
|
677
|
-
return sampleTarget.ownerDocument.body;
|
|
678
|
-
};
|
|
679
|
-
var counterMap = new WeakMap();
|
|
680
|
-
var uncontrolledNodes = new WeakMap();
|
|
681
|
-
var markerMap = {};
|
|
682
|
-
var lockCount = 0;
|
|
683
|
-
var unwrapHost = function (node) {
|
|
684
|
-
return node && (node.host || unwrapHost(node.parentNode));
|
|
685
|
-
};
|
|
686
|
-
var correctTargets = function (parent, targets) {
|
|
687
|
-
return targets.map(function (target) {
|
|
688
|
-
if (parent.contains(target)) {
|
|
689
|
-
return target;
|
|
690
|
-
}
|
|
691
|
-
var correctedTarget = unwrapHost(target);
|
|
692
|
-
if (correctedTarget && parent.contains(correctedTarget)) {
|
|
693
|
-
return correctedTarget;
|
|
694
|
-
}
|
|
695
|
-
console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing');
|
|
696
|
-
return null;
|
|
697
|
-
}).filter(function (x) { return Boolean(x); });
|
|
698
|
-
};
|
|
699
|
-
/**
|
|
700
|
-
* Marks everything except given node(or nodes) as aria-hidden
|
|
701
|
-
* @param {Element | Element[]} originalTarget - elements to keep on the page
|
|
702
|
-
* @param [parentNode] - top element, defaults to document.body
|
|
703
|
-
* @param {String} [markerName] - a special attribute to mark every node
|
|
704
|
-
* @param {String} [controlAttribute] - html Attribute to control
|
|
705
|
-
* @return {Undo} undo command
|
|
706
|
-
*/
|
|
707
|
-
var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) {
|
|
708
|
-
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
709
|
-
if (!markerMap[markerName]) {
|
|
710
|
-
markerMap[markerName] = new WeakMap();
|
|
711
|
-
}
|
|
712
|
-
var markerCounter = markerMap[markerName];
|
|
713
|
-
var hiddenNodes = [];
|
|
714
|
-
var elementsToKeep = new Set();
|
|
715
|
-
var elementsToStop = new Set(targets);
|
|
716
|
-
var keep = function (el) {
|
|
717
|
-
if (!el || elementsToKeep.has(el)) {
|
|
718
|
-
return;
|
|
719
|
-
}
|
|
720
|
-
elementsToKeep.add(el);
|
|
721
|
-
keep(el.parentNode);
|
|
722
|
-
};
|
|
723
|
-
targets.forEach(keep);
|
|
724
|
-
var deep = function (parent) {
|
|
725
|
-
if (!parent || elementsToStop.has(parent)) {
|
|
726
|
-
return;
|
|
727
|
-
}
|
|
728
|
-
Array.prototype.forEach.call(parent.children, function (node) {
|
|
729
|
-
if (elementsToKeep.has(node)) {
|
|
730
|
-
deep(node);
|
|
731
|
-
}
|
|
732
|
-
else {
|
|
733
|
-
var attr = node.getAttribute(controlAttribute);
|
|
734
|
-
var alreadyHidden = attr !== null && attr !== 'false';
|
|
735
|
-
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
736
|
-
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
737
|
-
counterMap.set(node, counterValue);
|
|
738
|
-
markerCounter.set(node, markerValue);
|
|
739
|
-
hiddenNodes.push(node);
|
|
740
|
-
if (counterValue === 1 && alreadyHidden) {
|
|
741
|
-
uncontrolledNodes.set(node, true);
|
|
742
|
-
}
|
|
743
|
-
if (markerValue === 1) {
|
|
744
|
-
node.setAttribute(markerName, 'true');
|
|
745
|
-
}
|
|
746
|
-
if (!alreadyHidden) {
|
|
747
|
-
node.setAttribute(controlAttribute, 'true');
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
});
|
|
751
|
-
};
|
|
752
|
-
deep(parentNode);
|
|
753
|
-
elementsToKeep.clear();
|
|
754
|
-
lockCount++;
|
|
755
|
-
return function () {
|
|
756
|
-
hiddenNodes.forEach(function (node) {
|
|
757
|
-
var counterValue = counterMap.get(node) - 1;
|
|
758
|
-
var markerValue = markerCounter.get(node) - 1;
|
|
759
|
-
counterMap.set(node, counterValue);
|
|
760
|
-
markerCounter.set(node, markerValue);
|
|
761
|
-
if (!counterValue) {
|
|
762
|
-
if (!uncontrolledNodes.has(node)) {
|
|
763
|
-
node.removeAttribute(controlAttribute);
|
|
764
|
-
}
|
|
765
|
-
uncontrolledNodes.delete(node);
|
|
766
|
-
}
|
|
767
|
-
if (!markerValue) {
|
|
768
|
-
node.removeAttribute(markerName);
|
|
769
|
-
}
|
|
770
|
-
});
|
|
771
|
-
lockCount--;
|
|
772
|
-
if (!lockCount) {
|
|
773
|
-
// clear
|
|
774
|
-
counterMap = new WeakMap();
|
|
775
|
-
counterMap = new WeakMap();
|
|
776
|
-
uncontrolledNodes = new WeakMap();
|
|
777
|
-
markerMap = {};
|
|
778
|
-
}
|
|
779
|
-
};
|
|
780
|
-
};
|
|
781
|
-
/**
|
|
782
|
-
* Marks everything except given node(or nodes) as aria-hidden
|
|
783
|
-
* @param {Element | Element[]} originalTarget - elements to keep on the page
|
|
784
|
-
* @param [parentNode] - top element, defaults to document.body
|
|
785
|
-
* @param {String} [markerName] - a special attribute to mark every node
|
|
786
|
-
* @return {Undo} undo command
|
|
787
|
-
*/
|
|
788
|
-
var hideOthers = function (originalTarget, parentNode, markerName) {
|
|
789
|
-
if (markerName === void 0) { markerName = 'data-aria-hidden'; }
|
|
790
|
-
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
791
|
-
var activeParentNode = parentNode || getDefaultParent(originalTarget);
|
|
792
|
-
if (!activeParentNode) {
|
|
793
|
-
return function () { return null; };
|
|
794
|
-
}
|
|
795
|
-
// we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10
|
|
796
|
-
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]')));
|
|
797
|
-
return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
|
|
798
|
-
};
|
|
799
|
-
|
|
800
|
-
/******************************************************************************
|
|
801
|
-
Copyright (c) Microsoft Corporation.
|
|
802
|
-
|
|
803
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
804
|
-
purpose with or without fee is hereby granted.
|
|
805
|
-
|
|
806
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
807
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
808
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
809
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
810
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
811
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
812
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
813
|
-
***************************************************************************** */
|
|
814
|
-
|
|
815
|
-
var __assign$1 = function() {
|
|
816
|
-
__assign$1 = Object.assign || function __assign(t) {
|
|
817
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
818
|
-
s = arguments[i];
|
|
819
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
820
|
-
}
|
|
821
|
-
return t;
|
|
822
|
-
};
|
|
823
|
-
return __assign$1.apply(this, arguments);
|
|
824
|
-
};
|
|
825
|
-
|
|
826
|
-
function __rest$1(s, e) {
|
|
827
|
-
var t = {};
|
|
828
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
829
|
-
t[p] = s[p];
|
|
830
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
831
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
832
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
833
|
-
t[p[i]] = s[p[i]];
|
|
834
|
-
}
|
|
835
|
-
return t;
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
function __spreadArray(to, from, pack) {
|
|
839
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
840
|
-
if (ar || !(i in from)) {
|
|
841
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
842
|
-
ar[i] = from[i];
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
var zeroRightClassName = 'right-scroll-bar-position';
|
|
849
|
-
var fullWidthClassName = 'width-before-scroll-bar';
|
|
850
|
-
var noScrollbarsClassName = 'with-scroll-bars-hidden';
|
|
851
|
-
/**
|
|
852
|
-
* Name of a CSS variable containing the amount of "hidden" scrollbar
|
|
853
|
-
* ! might be undefined ! use will fallback!
|
|
854
|
-
*/
|
|
855
|
-
var removedBarSizeVariable = '--removed-body-scroll-bar-size';
|
|
856
|
-
|
|
857
|
-
/**
|
|
858
|
-
* Assigns a value for a given ref, no matter of the ref format
|
|
859
|
-
* @param {RefObject} ref - a callback function or ref object
|
|
860
|
-
* @param value - a new value
|
|
861
|
-
*
|
|
862
|
-
* @see https://github.com/theKashey/use-callback-ref#assignref
|
|
863
|
-
* @example
|
|
864
|
-
* const refObject = useRef();
|
|
865
|
-
* const refFn = (ref) => {....}
|
|
866
|
-
*
|
|
867
|
-
* assignRef(refObject, "refValue");
|
|
868
|
-
* assignRef(refFn, "refValue");
|
|
869
|
-
*/
|
|
870
|
-
function assignRef(ref, value) {
|
|
871
|
-
if (typeof ref === 'function') {
|
|
872
|
-
ref(value);
|
|
873
|
-
}
|
|
874
|
-
else if (ref) {
|
|
875
|
-
ref.current = value;
|
|
876
|
-
}
|
|
877
|
-
return ref;
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
/**
|
|
881
|
-
* creates a MutableRef with ref change callback
|
|
882
|
-
* @param initialValue - initial ref value
|
|
883
|
-
* @param {Function} callback - a callback to run when value changes
|
|
884
|
-
*
|
|
885
|
-
* @example
|
|
886
|
-
* const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);
|
|
887
|
-
* ref.current = 1;
|
|
888
|
-
* // prints 0 -> 1
|
|
889
|
-
*
|
|
890
|
-
* @see https://reactjs.org/docs/hooks-reference.html#useref
|
|
891
|
-
* @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref
|
|
892
|
-
* @returns {MutableRefObject}
|
|
893
|
-
*/
|
|
894
|
-
function useCallbackRef(initialValue, callback) {
|
|
895
|
-
var ref = useState(function () { return ({
|
|
896
|
-
// value
|
|
897
|
-
value: initialValue,
|
|
898
|
-
// last callback
|
|
899
|
-
callback: callback,
|
|
900
|
-
// "memoized" public interface
|
|
901
|
-
facade: {
|
|
902
|
-
get current() {
|
|
903
|
-
return ref.value;
|
|
904
|
-
},
|
|
905
|
-
set current(value) {
|
|
906
|
-
var last = ref.value;
|
|
907
|
-
if (last !== value) {
|
|
908
|
-
ref.value = value;
|
|
909
|
-
ref.callback(value, last);
|
|
910
|
-
}
|
|
911
|
-
},
|
|
912
|
-
},
|
|
913
|
-
}); })[0];
|
|
914
|
-
// update callback
|
|
915
|
-
ref.callback = callback;
|
|
916
|
-
return ref.facade;
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
/**
|
|
920
|
-
* Merges two or more refs together providing a single interface to set their value
|
|
921
|
-
* @param {RefObject|Ref} refs
|
|
922
|
-
* @returns {MutableRefObject} - a new ref, which translates all changes to {refs}
|
|
923
|
-
*
|
|
924
|
-
* @see {@link mergeRefs} a version without buit-in memoization
|
|
925
|
-
* @see https://github.com/theKashey/use-callback-ref#usemergerefs
|
|
926
|
-
* @example
|
|
927
|
-
* const Component = React.forwardRef((props, ref) => {
|
|
928
|
-
* const ownRef = useRef();
|
|
929
|
-
* const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together
|
|
930
|
-
* return <div ref={domRef}>...</div>
|
|
931
|
-
* }
|
|
932
|
-
*/
|
|
933
|
-
function useMergeRefs(refs, defaultValue) {
|
|
934
|
-
return useCallbackRef(defaultValue || null, function (newValue) { return refs.forEach(function (ref) { return assignRef(ref, newValue); }); });
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
/*! *****************************************************************************
|
|
938
|
-
Copyright (c) Microsoft Corporation.
|
|
939
|
-
|
|
940
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
941
|
-
purpose with or without fee is hereby granted.
|
|
942
|
-
|
|
943
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
944
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
945
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
946
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
947
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
948
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
949
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
950
|
-
***************************************************************************** */
|
|
951
|
-
|
|
952
|
-
var __assign = function() {
|
|
953
|
-
__assign = Object.assign || function __assign(t) {
|
|
954
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
955
|
-
s = arguments[i];
|
|
956
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
957
|
-
}
|
|
958
|
-
return t;
|
|
959
|
-
};
|
|
960
|
-
return __assign.apply(this, arguments);
|
|
961
|
-
};
|
|
962
|
-
|
|
963
|
-
function __rest(s, e) {
|
|
964
|
-
var t = {};
|
|
965
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
966
|
-
t[p] = s[p];
|
|
967
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
968
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
969
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
970
|
-
t[p[i]] = s[p[i]];
|
|
971
|
-
}
|
|
972
|
-
return t;
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
function ItoI(a) {
|
|
976
|
-
return a;
|
|
977
|
-
}
|
|
978
|
-
function innerCreateMedium(defaults, middleware) {
|
|
979
|
-
if (middleware === void 0) { middleware = ItoI; }
|
|
980
|
-
var buffer = [];
|
|
981
|
-
var assigned = false;
|
|
982
|
-
var medium = {
|
|
983
|
-
read: function () {
|
|
984
|
-
if (assigned) {
|
|
985
|
-
throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');
|
|
986
|
-
}
|
|
987
|
-
if (buffer.length) {
|
|
988
|
-
return buffer[buffer.length - 1];
|
|
989
|
-
}
|
|
990
|
-
return defaults;
|
|
991
|
-
},
|
|
992
|
-
useMedium: function (data) {
|
|
993
|
-
var item = middleware(data, assigned);
|
|
994
|
-
buffer.push(item);
|
|
995
|
-
return function () {
|
|
996
|
-
buffer = buffer.filter(function (x) { return x !== item; });
|
|
997
|
-
};
|
|
998
|
-
},
|
|
999
|
-
assignSyncMedium: function (cb) {
|
|
1000
|
-
assigned = true;
|
|
1001
|
-
while (buffer.length) {
|
|
1002
|
-
var cbs = buffer;
|
|
1003
|
-
buffer = [];
|
|
1004
|
-
cbs.forEach(cb);
|
|
1005
|
-
}
|
|
1006
|
-
buffer = {
|
|
1007
|
-
push: function (x) { return cb(x); },
|
|
1008
|
-
filter: function () { return buffer; },
|
|
1009
|
-
};
|
|
1010
|
-
},
|
|
1011
|
-
assignMedium: function (cb) {
|
|
1012
|
-
assigned = true;
|
|
1013
|
-
var pendingQueue = [];
|
|
1014
|
-
if (buffer.length) {
|
|
1015
|
-
var cbs = buffer;
|
|
1016
|
-
buffer = [];
|
|
1017
|
-
cbs.forEach(cb);
|
|
1018
|
-
pendingQueue = buffer;
|
|
1019
|
-
}
|
|
1020
|
-
var executeQueue = function () {
|
|
1021
|
-
var cbs = pendingQueue;
|
|
1022
|
-
pendingQueue = [];
|
|
1023
|
-
cbs.forEach(cb);
|
|
1024
|
-
};
|
|
1025
|
-
var cycle = function () { return Promise.resolve().then(executeQueue); };
|
|
1026
|
-
cycle();
|
|
1027
|
-
buffer = {
|
|
1028
|
-
push: function (x) {
|
|
1029
|
-
pendingQueue.push(x);
|
|
1030
|
-
cycle();
|
|
1031
|
-
},
|
|
1032
|
-
filter: function (filter) {
|
|
1033
|
-
pendingQueue = pendingQueue.filter(filter);
|
|
1034
|
-
return buffer;
|
|
1035
|
-
},
|
|
1036
|
-
};
|
|
1037
|
-
},
|
|
1038
|
-
};
|
|
1039
|
-
return medium;
|
|
1040
|
-
}
|
|
1041
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
1042
|
-
function createSidecarMedium(options) {
|
|
1043
|
-
if (options === void 0) { options = {}; }
|
|
1044
|
-
var medium = innerCreateMedium(null);
|
|
1045
|
-
medium.options = __assign({ async: true, ssr: false }, options);
|
|
1046
|
-
return medium;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
var SideCar$1 = function (_a) {
|
|
1050
|
-
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
1051
|
-
if (!sideCar) {
|
|
1052
|
-
throw new Error('Sidecar: please provide `sideCar` property to import the right car');
|
|
1053
|
-
}
|
|
1054
|
-
var Target = sideCar.read();
|
|
1055
|
-
if (!Target) {
|
|
1056
|
-
throw new Error('Sidecar medium not found');
|
|
1057
|
-
}
|
|
1058
|
-
return React$1.createElement(Target, __assign({}, rest));
|
|
1059
|
-
};
|
|
1060
|
-
SideCar$1.isSideCarExport = true;
|
|
1061
|
-
function exportSidecar(medium, exported) {
|
|
1062
|
-
medium.useMedium(exported);
|
|
1063
|
-
return SideCar$1;
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
var effectCar = createSidecarMedium();
|
|
1067
|
-
|
|
1068
|
-
var nothing = function () {
|
|
1069
|
-
return;
|
|
1070
|
-
};
|
|
1071
|
-
/**
|
|
1072
|
-
* Removes scrollbar from the page and contain the scroll within the Lock
|
|
1073
|
-
*/
|
|
1074
|
-
var RemoveScroll = React$1.forwardRef(function (props, parentRef) {
|
|
1075
|
-
var ref = React$1.useRef(null);
|
|
1076
|
-
var _a = React$1.useState({
|
|
1077
|
-
onScrollCapture: nothing,
|
|
1078
|
-
onWheelCapture: nothing,
|
|
1079
|
-
onTouchMoveCapture: nothing,
|
|
1080
|
-
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
1081
|
-
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"]);
|
|
1082
|
-
var SideCar = sideCar;
|
|
1083
|
-
var containerRef = useMergeRefs([ref, parentRef]);
|
|
1084
|
-
var containerProps = __assign$1(__assign$1({}, rest), callbacks);
|
|
1085
|
-
return (React$1.createElement(React$1.Fragment, null,
|
|
1086
|
-
enabled && (React$1.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })),
|
|
1087
|
-
forwardProps ? (React$1.cloneElement(React$1.Children.only(children), __assign$1(__assign$1({}, containerProps), { ref: containerRef }))) : (React$1.createElement(Container, __assign$1({}, containerProps, { className: className, ref: containerRef }), children))));
|
|
1088
|
-
});
|
|
1089
|
-
RemoveScroll.defaultProps = {
|
|
1090
|
-
enabled: true,
|
|
1091
|
-
removeScrollBar: true,
|
|
1092
|
-
inert: false,
|
|
1093
|
-
};
|
|
1094
|
-
RemoveScroll.classNames = {
|
|
1095
|
-
fullWidth: fullWidthClassName,
|
|
1096
|
-
zeroRight: zeroRightClassName,
|
|
1097
|
-
};
|
|
1098
|
-
|
|
1099
|
-
var getNonce = function () {
|
|
1100
|
-
if (typeof __webpack_nonce__ !== 'undefined') {
|
|
1101
|
-
return __webpack_nonce__;
|
|
1102
|
-
}
|
|
1103
|
-
return undefined;
|
|
1104
|
-
};
|
|
1105
|
-
|
|
1106
|
-
function makeStyleTag() {
|
|
1107
|
-
if (!document)
|
|
1108
|
-
return null;
|
|
1109
|
-
var tag = document.createElement('style');
|
|
1110
|
-
tag.type = 'text/css';
|
|
1111
|
-
var nonce = getNonce();
|
|
1112
|
-
if (nonce) {
|
|
1113
|
-
tag.setAttribute('nonce', nonce);
|
|
1114
|
-
}
|
|
1115
|
-
return tag;
|
|
1116
|
-
}
|
|
1117
|
-
function injectStyles(tag, css) {
|
|
1118
|
-
// @ts-ignore
|
|
1119
|
-
if (tag.styleSheet) {
|
|
1120
|
-
// @ts-ignore
|
|
1121
|
-
tag.styleSheet.cssText = css;
|
|
1122
|
-
}
|
|
1123
|
-
else {
|
|
1124
|
-
tag.appendChild(document.createTextNode(css));
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
function insertStyleTag(tag) {
|
|
1128
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
1129
|
-
head.appendChild(tag);
|
|
1130
|
-
}
|
|
1131
|
-
var stylesheetSingleton = function () {
|
|
1132
|
-
var counter = 0;
|
|
1133
|
-
var stylesheet = null;
|
|
1134
|
-
return {
|
|
1135
|
-
add: function (style) {
|
|
1136
|
-
if (counter == 0) {
|
|
1137
|
-
if ((stylesheet = makeStyleTag())) {
|
|
1138
|
-
injectStyles(stylesheet, style);
|
|
1139
|
-
insertStyleTag(stylesheet);
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
counter++;
|
|
1143
|
-
},
|
|
1144
|
-
remove: function () {
|
|
1145
|
-
counter--;
|
|
1146
|
-
if (!counter && stylesheet) {
|
|
1147
|
-
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
|
|
1148
|
-
stylesheet = null;
|
|
1149
|
-
}
|
|
1150
|
-
},
|
|
1151
|
-
};
|
|
1152
|
-
};
|
|
1153
|
-
|
|
1154
|
-
/**
|
|
1155
|
-
* creates a hook to control style singleton
|
|
1156
|
-
* @see {@link styleSingleton} for a safer component version
|
|
1157
|
-
* @example
|
|
1158
|
-
* ```tsx
|
|
1159
|
-
* const useStyle = styleHookSingleton();
|
|
1160
|
-
* ///
|
|
1161
|
-
* useStyle('body { overflow: hidden}');
|
|
1162
|
-
*/
|
|
1163
|
-
var styleHookSingleton = function () {
|
|
1164
|
-
var sheet = stylesheetSingleton();
|
|
1165
|
-
return function (styles, isDynamic) {
|
|
1166
|
-
React$1.useEffect(function () {
|
|
1167
|
-
sheet.add(styles);
|
|
1168
|
-
return function () {
|
|
1169
|
-
sheet.remove();
|
|
1170
|
-
};
|
|
1171
|
-
}, [styles && isDynamic]);
|
|
1172
|
-
};
|
|
1173
|
-
};
|
|
1174
|
-
|
|
1175
|
-
/**
|
|
1176
|
-
* create a Component to add styles on demand
|
|
1177
|
-
* - styles are added when first instance is mounted
|
|
1178
|
-
* - styles are removed when the last instance is unmounted
|
|
1179
|
-
* - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
|
|
1180
|
-
*/
|
|
1181
|
-
var styleSingleton = function () {
|
|
1182
|
-
var useStyle = styleHookSingleton();
|
|
1183
|
-
var Sheet = function (_a) {
|
|
1184
|
-
var styles = _a.styles, dynamic = _a.dynamic;
|
|
1185
|
-
useStyle(styles, dynamic);
|
|
1186
|
-
return null;
|
|
1187
|
-
};
|
|
1188
|
-
return Sheet;
|
|
1189
|
-
};
|
|
1190
|
-
|
|
1191
|
-
var zeroGap = {
|
|
1192
|
-
left: 0,
|
|
1193
|
-
top: 0,
|
|
1194
|
-
right: 0,
|
|
1195
|
-
gap: 0,
|
|
1196
|
-
};
|
|
1197
|
-
var parse = function (x) { return parseInt(x || '', 10) || 0; };
|
|
1198
|
-
var getOffset = function (gapMode) {
|
|
1199
|
-
var cs = window.getComputedStyle(document.body);
|
|
1200
|
-
var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft'];
|
|
1201
|
-
var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop'];
|
|
1202
|
-
var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight'];
|
|
1203
|
-
return [parse(left), parse(top), parse(right)];
|
|
1204
|
-
};
|
|
1205
|
-
var getGapWidth = function (gapMode) {
|
|
1206
|
-
if (gapMode === void 0) { gapMode = 'margin'; }
|
|
1207
|
-
if (typeof window === 'undefined') {
|
|
1208
|
-
return zeroGap;
|
|
1209
|
-
}
|
|
1210
|
-
var offsets = getOffset(gapMode);
|
|
1211
|
-
var documentWidth = document.documentElement.clientWidth;
|
|
1212
|
-
var windowWidth = window.innerWidth;
|
|
1213
|
-
return {
|
|
1214
|
-
left: offsets[0],
|
|
1215
|
-
top: offsets[1],
|
|
1216
|
-
right: offsets[2],
|
|
1217
|
-
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]),
|
|
1218
|
-
};
|
|
1219
|
-
};
|
|
1220
|
-
|
|
1221
|
-
var Style = styleSingleton();
|
|
1222
|
-
// important tip - once we measure scrollBar width and remove them
|
|
1223
|
-
// we could not repeat this operation
|
|
1224
|
-
// thus we are using style-singleton - only the first "yet correct" style will be applied.
|
|
1225
|
-
var getStyles = function (_a, allowRelative, gapMode, important) {
|
|
1226
|
-
var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
|
|
1227
|
-
if (gapMode === void 0) { gapMode = 'margin'; }
|
|
1228
|
-
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([
|
|
1229
|
-
allowRelative && "position: relative ".concat(important, ";"),
|
|
1230
|
-
gapMode === 'margin' &&
|
|
1231
|
-
"\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 "),
|
|
1232
|
-
gapMode === 'padding' && "padding-right: ".concat(gap, "px ").concat(important, ";"),
|
|
1233
|
-
]
|
|
1234
|
-
.filter(Boolean)
|
|
1235
|
-
.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");
|
|
1236
|
-
};
|
|
1237
|
-
/**
|
|
1238
|
-
* Removes page scrollbar and blocks page scroll when mounted
|
|
1239
|
-
*/
|
|
1240
|
-
var RemoveScrollBar = function (props) {
|
|
1241
|
-
var noRelative = props.noRelative, noImportant = props.noImportant, _a = props.gapMode, gapMode = _a === void 0 ? 'margin' : _a;
|
|
1242
|
-
/*
|
|
1243
|
-
gap will be measured on every component mount
|
|
1244
|
-
however it will be used only by the "first" invocation
|
|
1245
|
-
due to singleton nature of <Style
|
|
1246
|
-
*/
|
|
1247
|
-
var gap = React$1.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]);
|
|
1248
|
-
return React$1.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') });
|
|
1249
|
-
};
|
|
1250
|
-
|
|
1251
|
-
var passiveSupported = false;
|
|
1252
|
-
if (typeof window !== 'undefined') {
|
|
1253
|
-
try {
|
|
1254
|
-
var options = Object.defineProperty({}, 'passive', {
|
|
1255
|
-
get: function () {
|
|
1256
|
-
passiveSupported = true;
|
|
1257
|
-
return true;
|
|
1258
|
-
},
|
|
1259
|
-
});
|
|
1260
|
-
// @ts-ignore
|
|
1261
|
-
window.addEventListener('test', options, options);
|
|
1262
|
-
// @ts-ignore
|
|
1263
|
-
window.removeEventListener('test', options, options);
|
|
1264
|
-
}
|
|
1265
|
-
catch (err) {
|
|
1266
|
-
passiveSupported = false;
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
1270
|
-
|
|
1271
|
-
var alwaysContainsScroll = function (node) {
|
|
1272
|
-
// textarea will always _contain_ scroll inside self. It only can be hidden
|
|
1273
|
-
return node.tagName === 'TEXTAREA';
|
|
1274
|
-
};
|
|
1275
|
-
var elementCanBeScrolled = function (node, overflow) {
|
|
1276
|
-
var styles = window.getComputedStyle(node);
|
|
1277
|
-
return (
|
|
1278
|
-
// not-not-scrollable
|
|
1279
|
-
styles[overflow] !== 'hidden' &&
|
|
1280
|
-
// contains scroll inside self
|
|
1281
|
-
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
|
|
1282
|
-
};
|
|
1283
|
-
var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
|
|
1284
|
-
var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
|
|
1285
|
-
var locationCouldBeScrolled = function (axis, node) {
|
|
1286
|
-
var current = node;
|
|
1287
|
-
do {
|
|
1288
|
-
// Skip over shadow root
|
|
1289
|
-
if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
|
|
1290
|
-
current = current.host;
|
|
1291
|
-
}
|
|
1292
|
-
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
1293
|
-
if (isScrollable) {
|
|
1294
|
-
var _a = getScrollVariables(axis, current), s = _a[1], d = _a[2];
|
|
1295
|
-
if (s > d) {
|
|
1296
|
-
return true;
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
current = current.parentNode;
|
|
1300
|
-
} while (current && current !== document.body);
|
|
1301
|
-
return false;
|
|
1302
|
-
};
|
|
1303
|
-
var getVScrollVariables = function (_a) {
|
|
1304
|
-
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
1305
|
-
return [
|
|
1306
|
-
scrollTop,
|
|
1307
|
-
scrollHeight,
|
|
1308
|
-
clientHeight,
|
|
1309
|
-
];
|
|
1310
|
-
};
|
|
1311
|
-
var getHScrollVariables = function (_a) {
|
|
1312
|
-
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
1313
|
-
return [
|
|
1314
|
-
scrollLeft,
|
|
1315
|
-
scrollWidth,
|
|
1316
|
-
clientWidth,
|
|
1317
|
-
];
|
|
1318
|
-
};
|
|
1319
|
-
var elementCouldBeScrolled = function (axis, node) {
|
|
1320
|
-
return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
1321
|
-
};
|
|
1322
|
-
var getScrollVariables = function (axis, node) {
|
|
1323
|
-
return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
1324
|
-
};
|
|
1325
|
-
var getDirectionFactor = function (axis, direction) {
|
|
1326
|
-
/**
|
|
1327
|
-
* If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
|
|
1328
|
-
* and then increasingly negative as you scroll towards the end of the content.
|
|
1329
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
|
|
1330
|
-
*/
|
|
1331
|
-
return axis === 'h' && direction === 'rtl' ? -1 : 1;
|
|
1332
|
-
};
|
|
1333
|
-
var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
1334
|
-
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
1335
|
-
var delta = directionFactor * sourceDelta;
|
|
1336
|
-
// find scrollable target
|
|
1337
|
-
var target = event.target;
|
|
1338
|
-
var targetInLock = endTarget.contains(target);
|
|
1339
|
-
var shouldCancelScroll = false;
|
|
1340
|
-
var isDeltaPositive = delta > 0;
|
|
1341
|
-
var availableScroll = 0;
|
|
1342
|
-
var availableScrollTop = 0;
|
|
1343
|
-
do {
|
|
1344
|
-
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
1345
|
-
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
1346
|
-
if (position || elementScroll) {
|
|
1347
|
-
if (elementCouldBeScrolled(axis, target)) {
|
|
1348
|
-
availableScroll += elementScroll;
|
|
1349
|
-
availableScrollTop += position;
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
target = target.parentNode;
|
|
1353
|
-
} while (
|
|
1354
|
-
// portaled content
|
|
1355
|
-
(!targetInLock && target !== document.body) ||
|
|
1356
|
-
// self content
|
|
1357
|
-
(targetInLock && (endTarget.contains(target) || endTarget === target)));
|
|
1358
|
-
if (isDeltaPositive && ((noOverscroll && availableScroll === 0) || (!noOverscroll && delta > availableScroll))) {
|
|
1359
|
-
shouldCancelScroll = true;
|
|
1360
|
-
}
|
|
1361
|
-
else if (!isDeltaPositive &&
|
|
1362
|
-
((noOverscroll && availableScrollTop === 0) || (!noOverscroll && -delta > availableScrollTop))) {
|
|
1363
|
-
shouldCancelScroll = true;
|
|
1364
|
-
}
|
|
1365
|
-
return shouldCancelScroll;
|
|
1366
|
-
};
|
|
1367
|
-
|
|
1368
|
-
var getTouchXY = function (event) {
|
|
1369
|
-
return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
|
|
1370
|
-
};
|
|
1371
|
-
var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };
|
|
1372
|
-
var extractRef = function (ref) {
|
|
1373
|
-
return ref && 'current' in ref ? ref.current : ref;
|
|
1374
|
-
};
|
|
1375
|
-
var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };
|
|
1376
|
-
var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); };
|
|
1377
|
-
var idCounter = 0;
|
|
1378
|
-
var lockStack = [];
|
|
1379
|
-
function RemoveScrollSideCar(props) {
|
|
1380
|
-
var shouldPreventQueue = React$1.useRef([]);
|
|
1381
|
-
var touchStartRef = React$1.useRef([0, 0]);
|
|
1382
|
-
var activeAxis = React$1.useRef();
|
|
1383
|
-
var id = React$1.useState(idCounter++)[0];
|
|
1384
|
-
var Style = React$1.useState(function () { return styleSingleton(); })[0];
|
|
1385
|
-
var lastProps = React$1.useRef(props);
|
|
1386
|
-
React$1.useEffect(function () {
|
|
1387
|
-
lastProps.current = props;
|
|
1388
|
-
}, [props]);
|
|
1389
|
-
React$1.useEffect(function () {
|
|
1390
|
-
if (props.inert) {
|
|
1391
|
-
document.body.classList.add("block-interactivity-".concat(id));
|
|
1392
|
-
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
1393
|
-
allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); });
|
|
1394
|
-
return function () {
|
|
1395
|
-
document.body.classList.remove("block-interactivity-".concat(id));
|
|
1396
|
-
allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); });
|
|
1397
|
-
};
|
|
1398
|
-
}
|
|
1399
|
-
return;
|
|
1400
|
-
}, [props.inert, props.lockRef.current, props.shards]);
|
|
1401
|
-
var shouldCancelEvent = React$1.useCallback(function (event, parent) {
|
|
1402
|
-
if ('touches' in event && event.touches.length === 2) {
|
|
1403
|
-
return !lastProps.current.allowPinchZoom;
|
|
1404
|
-
}
|
|
1405
|
-
var touch = getTouchXY(event);
|
|
1406
|
-
var touchStart = touchStartRef.current;
|
|
1407
|
-
var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
|
|
1408
|
-
var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
|
|
1409
|
-
var currentAxis;
|
|
1410
|
-
var target = event.target;
|
|
1411
|
-
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
|
|
1412
|
-
// allow horizontal touch move on Range inputs. They will not cause any scroll
|
|
1413
|
-
if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
|
|
1414
|
-
return false;
|
|
1415
|
-
}
|
|
1416
|
-
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1417
|
-
if (!canBeScrolledInMainDirection) {
|
|
1418
|
-
return true;
|
|
1419
|
-
}
|
|
1420
|
-
if (canBeScrolledInMainDirection) {
|
|
1421
|
-
currentAxis = moveDirection;
|
|
1422
|
-
}
|
|
1423
|
-
else {
|
|
1424
|
-
currentAxis = moveDirection === 'v' ? 'h' : 'v';
|
|
1425
|
-
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1426
|
-
// other axis might be not scrollable
|
|
1427
|
-
}
|
|
1428
|
-
if (!canBeScrolledInMainDirection) {
|
|
1429
|
-
return false;
|
|
1430
|
-
}
|
|
1431
|
-
if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
|
|
1432
|
-
activeAxis.current = currentAxis;
|
|
1433
|
-
}
|
|
1434
|
-
if (!currentAxis) {
|
|
1435
|
-
return true;
|
|
1436
|
-
}
|
|
1437
|
-
var cancelingAxis = activeAxis.current || currentAxis;
|
|
1438
|
-
return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);
|
|
1439
|
-
}, []);
|
|
1440
|
-
var shouldPrevent = React$1.useCallback(function (_event) {
|
|
1441
|
-
var event = _event;
|
|
1442
|
-
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
|
|
1443
|
-
// not the last active
|
|
1444
|
-
return;
|
|
1445
|
-
}
|
|
1446
|
-
var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
|
|
1447
|
-
var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); })[0];
|
|
1448
|
-
// self event, and should be canceled
|
|
1449
|
-
if (sourceEvent && sourceEvent.should) {
|
|
1450
|
-
if (event.cancelable) {
|
|
1451
|
-
event.preventDefault();
|
|
1452
|
-
}
|
|
1453
|
-
return;
|
|
1454
|
-
}
|
|
1455
|
-
// outside or shard event
|
|
1456
|
-
if (!sourceEvent) {
|
|
1457
|
-
var shardNodes = (lastProps.current.shards || [])
|
|
1458
|
-
.map(extractRef)
|
|
1459
|
-
.filter(Boolean)
|
|
1460
|
-
.filter(function (node) { return node.contains(event.target); });
|
|
1461
|
-
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
|
|
1462
|
-
if (shouldStop) {
|
|
1463
|
-
if (event.cancelable) {
|
|
1464
|
-
event.preventDefault();
|
|
1465
|
-
}
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
}, []);
|
|
1469
|
-
var shouldCancel = React$1.useCallback(function (name, delta, target, should) {
|
|
1470
|
-
var event = { name: name, delta: delta, target: target, should: should };
|
|
1471
|
-
shouldPreventQueue.current.push(event);
|
|
1472
|
-
setTimeout(function () {
|
|
1473
|
-
shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
|
|
1474
|
-
}, 1);
|
|
1475
|
-
}, []);
|
|
1476
|
-
var scrollTouchStart = React$1.useCallback(function (event) {
|
|
1477
|
-
touchStartRef.current = getTouchXY(event);
|
|
1478
|
-
activeAxis.current = undefined;
|
|
1479
|
-
}, []);
|
|
1480
|
-
var scrollWheel = React$1.useCallback(function (event) {
|
|
1481
|
-
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
1482
|
-
}, []);
|
|
1483
|
-
var scrollTouchMove = React$1.useCallback(function (event) {
|
|
1484
|
-
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
1485
|
-
}, []);
|
|
1486
|
-
React$1.useEffect(function () {
|
|
1487
|
-
lockStack.push(Style);
|
|
1488
|
-
props.setCallbacks({
|
|
1489
|
-
onScrollCapture: scrollWheel,
|
|
1490
|
-
onWheelCapture: scrollWheel,
|
|
1491
|
-
onTouchMoveCapture: scrollTouchMove,
|
|
1492
|
-
});
|
|
1493
|
-
document.addEventListener('wheel', shouldPrevent, nonPassive);
|
|
1494
|
-
document.addEventListener('touchmove', shouldPrevent, nonPassive);
|
|
1495
|
-
document.addEventListener('touchstart', scrollTouchStart, nonPassive);
|
|
1496
|
-
return function () {
|
|
1497
|
-
lockStack = lockStack.filter(function (inst) { return inst !== Style; });
|
|
1498
|
-
document.removeEventListener('wheel', shouldPrevent, nonPassive);
|
|
1499
|
-
document.removeEventListener('touchmove', shouldPrevent, nonPassive);
|
|
1500
|
-
document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
|
|
1501
|
-
};
|
|
1502
|
-
}, []);
|
|
1503
|
-
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
1504
|
-
return (React$1.createElement(React$1.Fragment, null,
|
|
1505
|
-
inert ? React$1.createElement(Style, { styles: generateStyle(id) }) : null,
|
|
1506
|
-
removeScrollBar ? React$1.createElement(RemoveScrollBar, { gapMode: "margin" }) : null));
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
var SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
1510
|
-
|
|
1511
|
-
var ReactRemoveScroll = React$1.forwardRef(function (props, ref) { return (React$1.createElement(RemoveScroll, __assign$1({}, props, { ref: ref, sideCar: SideCar }))); });
|
|
1512
|
-
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
1513
|
-
var $01b9c$RemoveScroll = ReactRemoveScroll;
|
|
1514
|
-
|
|
1515
136
|
const $cc7e05a45900e73f$var$OPEN_KEYS = [
|
|
1516
137
|
' ',
|
|
1517
138
|
'Enter',
|