@arc-ui/components 11.24.1 → 12.0.0-beta.3
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.js +18 -29
- package/dist/Alert/Alert.esm.js +17 -28
- package/dist/Align/Align.cjs.js +6 -6
- package/dist/Align/Align.esm.js +2 -2
- package/dist/AppButton/AppButton.cjs.js +73 -0
- package/dist/AppButton/AppButton.esm.js +65 -0
- package/dist/AppButton/package.json +7 -0
- package/dist/Avatar/Avatar.cjs.js +7 -7
- package/dist/Avatar/Avatar.esm.js +7 -7
- package/dist/AvatarGroup/AvatarGroup.cjs.js +14 -14
- package/dist/AvatarGroup/AvatarGroup.esm.js +7 -7
- package/dist/Badge/Badge.cjs.js +5 -22
- package/dist/Badge/Badge.esm.js +5 -22
- package/dist/Box/Box.cjs.js +6 -6
- package/dist/Box/Box.esm.js +3 -3
- package/dist/BrandLogo/BrandLogo.cjs.js +4 -4
- package/dist/BrandLogo/BrandLogo.esm.js +4 -4
- package/dist/Breadcrumbs/Breadcrumbs.cjs.js +7 -7
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +7 -7
- package/dist/Button/Button.cjs.js +7 -8
- package/dist/Button/Button.esm.js +7 -8
- package/dist/ButtonV2/ButtonV2.cjs.js +16 -0
- package/dist/ButtonV2/ButtonV2.esm.js +8 -0
- package/dist/ButtonV2/package.json +7 -0
- package/dist/Calendar/Calendar.cjs.js +11 -10
- package/dist/Calendar/Calendar.esm.js +11 -10
- package/dist/Checkbox/Checkbox.cjs.js +8 -10
- package/dist/Checkbox/Checkbox.esm.js +8 -10
- package/dist/Columns/Columns.cjs.js +3 -3
- package/dist/Columns/Columns.esm.js +3 -3
- package/dist/DatePicker/DatePicker.cjs.js +35 -563
- package/dist/DatePicker/DatePicker.esm.js +26 -554
- package/dist/Disclosure/Disclosure.cjs.js +10 -10
- package/dist/Disclosure/Disclosure.esm.js +6 -6
- package/dist/DisclosureMini/DisclosureMini.cjs.js +6 -6
- package/dist/DisclosureMini/DisclosureMini.esm.js +6 -6
- package/dist/Elevation/Elevation.cjs.js +5 -5
- package/dist/Elevation/Elevation.esm.js +1 -1
- package/dist/Filter/Filter.cjs.js +3 -3
- package/dist/Filter/Filter.esm.js +3 -3
- package/dist/FormControl/FormControl.cjs.js +7 -8
- package/dist/FormControl/FormControl.esm.js +7 -8
- package/dist/Grid/Grid.cjs.js +3 -3
- package/dist/Grid/Grid.esm.js +3 -3
- package/dist/Group/Group.cjs.js +3 -3
- package/dist/Group/Group.esm.js +3 -3
- package/dist/Heading/Heading.cjs.js +4 -4
- package/dist/Heading/Heading.esm.js +4 -4
- package/dist/HeroButton/HeroButton.cjs.js +16 -0
- package/dist/HeroButton/HeroButton.esm.js +8 -0
- package/dist/HeroButton/package.json +7 -0
- package/dist/Hidden/Hidden.cjs.js +5 -5
- package/dist/Hidden/Hidden.esm.js +1 -1
- package/dist/Icon/Icon.cjs.js +5 -5
- package/dist/Icon/Icon.esm.js +5 -5
- package/dist/Image/Image.cjs.js +3 -3
- package/dist/Image/Image.esm.js +3 -3
- package/dist/ImpactCard/ImpactCard.cjs.js +18 -16
- package/dist/ImpactCard/ImpactCard.esm.js +14 -12
- package/dist/InformationCard/InformationCard.cjs.js +28 -26
- package/dist/InformationCard/InformationCard.esm.js +20 -18
- package/dist/Link/Link.cjs.js +13 -13
- package/dist/Link/Link.esm.js +6 -6
- package/dist/Markup/Markup.cjs.js +6 -6
- package/dist/Markup/Markup.esm.js +2 -2
- package/dist/MediaCard/MediaCard.cjs.js +19 -47
- package/dist/MediaCard/MediaCard.esm.js +18 -46
- package/dist/Modal/Modal.cjs.js +1496 -250
- package/dist/Modal/Modal.esm.js +1475 -248
- package/dist/Pagination/Pagination.cjs.js +15 -20
- package/dist/Pagination/Pagination.esm.js +8 -13
- package/dist/PaginationSimple/PaginationSimple.cjs.js +12 -16
- package/dist/PaginationSimple/PaginationSimple.esm.js +7 -11
- package/dist/Poster/Poster.cjs.js +5 -5
- package/dist/Poster/Poster.esm.js +5 -5
- package/dist/ProgressBar/ProgressBar.cjs.js +17 -43
- package/dist/ProgressBar/ProgressBar.esm.js +13 -39
- package/dist/ProgressStepper/ProgressStepper.cjs.js +5 -5
- package/dist/ProgressStepper/ProgressStepper.esm.js +5 -5
- package/dist/RadioGroup/RadioGroup.cjs.js +8 -9
- package/dist/RadioGroup/RadioGroup.esm.js +8 -9
- package/dist/Rule/Rule.cjs.js +5 -5
- package/dist/Rule/Rule.esm.js +2 -2
- package/dist/ScrollToTop/ScrollToTop.cjs.js +14 -28
- package/dist/ScrollToTop/ScrollToTop.esm.js +10 -24
- package/dist/Section/Section.cjs.js +2 -2
- package/dist/Section/Section.esm.js +2 -2
- package/dist/Select/Select.cjs.js +58 -96
- package/dist/Select/Select.esm.js +25 -63
- package/dist/SiteFooter/SiteFooter.cjs.js +10 -34
- package/dist/SiteFooter/SiteFooter.esm.js +10 -34
- package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +14 -13
- package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +14 -13
- package/dist/SkipLink/SkipLink.cjs.js +3 -3
- package/dist/SkipLink/SkipLink.esm.js +1 -1
- package/dist/Surface/Surface.cjs.js +2 -2
- package/dist/Surface/Surface.esm.js +2 -2
- package/dist/Switch/Switch.cjs.js +26 -399
- package/dist/Switch/Switch.esm.js +13 -386
- package/dist/Tabs/Tabs.cjs.js +10 -11
- package/dist/Tabs/Tabs.esm.js +10 -11
- package/dist/Tag/Tag.cjs.js +6 -5
- package/dist/Tag/Tag.esm.js +6 -5
- package/dist/Text/Text.cjs.js +4 -4
- package/dist/Text/Text.esm.js +4 -4
- package/dist/TextArea/TextArea.cjs.js +62 -57
- package/dist/TextArea/TextArea.esm.js +58 -53
- package/dist/TextInput/TextInput.cjs.js +9 -10
- package/dist/TextInput/TextInput.esm.js +9 -10
- package/dist/Theme/Theme.cjs.js +30 -0
- package/dist/Theme/Theme.esm.js +21 -0
- package/dist/Theme/package.json +7 -0
- package/dist/ThemeIcon/ThemeIcon.cjs.js +14 -0
- package/dist/ThemeIcon/ThemeIcon.esm.js +6 -0
- package/dist/ThemeIcon/package.json +7 -0
- package/dist/Toast/Toast.cjs.js +10 -14
- package/dist/Toast/Toast.esm.js +10 -14
- package/dist/Truncate/Truncate.cjs.js +3 -3
- package/dist/Truncate/Truncate.esm.js +1 -1
- package/dist/TypographyCard/TypographyCard.cjs.js +16 -14
- package/dist/TypographyCard/TypographyCard.esm.js +13 -11
- package/dist/UniversalHeader/UniversalHeader.cjs.js +3 -3
- package/dist/UniversalHeader/UniversalHeader.esm.js +3 -3
- package/dist/VerticalSpace/VerticalSpace.cjs.js +2 -2
- package/dist/VerticalSpace/VerticalSpace.esm.js +2 -2
- package/dist/VideoPlayer/VideoPlayer.cjs.js +3013 -0
- package/dist/VideoPlayer/VideoPlayer.esm.js +3005 -0
- package/dist/VideoPlayer/package.json +7 -0
- package/dist/Visible/Visible.cjs.js +5 -5
- package/dist/Visible/Visible.esm.js +1 -1
- package/dist/_shared/cjs/ArcIconEclipse.esm-ac777a76.js +28 -0
- package/dist/_shared/cjs/Avatar-fc0d9b8b.js +49 -0
- package/dist/_shared/cjs/{BrandLogo-aea340c8.js → BrandLogo-1d2ca2c7.js} +7 -7
- package/dist/_shared/cjs/{Breadcrumbs-c6eaf5c4.js → Breadcrumbs-7af0af2c.js} +15 -16
- package/dist/_shared/cjs/BtIconArrowRight.esm-5989f2ca.js +38 -0
- package/dist/_shared/cjs/{BtIconAlert.esm-1a0ff9f0.js → BtIconPlayFill.esm-b8997cfc.js} +4 -8
- package/dist/_shared/cjs/{Button-6ba21d3b.js → Button-7d891a89.js} +13 -16
- package/dist/_shared/cjs/ButtonV2-b2db3f46.js +48 -0
- package/dist/_shared/cjs/Calendar-780bb071.js +1927 -0
- package/dist/_shared/cjs/{CardFooter-ff015d7d.js → CardFooter-5414bc4f.js} +9 -12
- package/dist/_shared/cjs/Checkbox-0e423653.js +65 -0
- package/dist/_shared/cjs/{Columns-ae4f8cef.js → Columns-1224bdff.js} +9 -16
- package/dist/_shared/cjs/{index-77ab5c6a.js → Combination-3a639f6d.js} +877 -83
- package/dist/_shared/cjs/DatePicker-e27ea988.js +550 -0
- package/dist/_shared/cjs/{DisclosureMini-09c749e5.js → DisclosureMini-c01ecce0.js} +12 -14
- package/dist/_shared/cjs/{Filter-f9506dfa.js → Filter-3b897d92.js} +13 -13
- package/dist/_shared/cjs/{FormControl-68258ce1.js → FormControl-88d48f42.js} +21 -18
- package/dist/_shared/cjs/Grid-9e91fb3d.js +46 -0
- package/dist/_shared/cjs/{Group-0429741a.js → Group-3d5ea240.js} +9 -16
- package/dist/_shared/cjs/{Heading-27cba320.js → Heading-fb63844f.js} +7 -7
- package/dist/_shared/cjs/HeroButton-0586a7c4.js +126 -0
- package/dist/_shared/cjs/Icon-0ec0c1fb.js +37 -0
- package/dist/_shared/cjs/Image-e9a5a326.js +56 -0
- package/dist/_shared/cjs/MediaCard-e1648705.js +65 -0
- package/dist/_shared/cjs/{Poster-9b48fd61.js → Poster-b7242b37.js} +15 -15
- package/dist/_shared/cjs/Preview-0bf3f6e8.js +167 -0
- package/dist/_shared/cjs/{ProgressStepper-491f0286.js → ProgressStepper-fb8405c2.js} +40 -19
- package/dist/_shared/cjs/{RadioGroup-26dc00fc.js → RadioGroup-a4186267.js} +14 -14
- package/dist/_shared/cjs/{Section-59804166.js → Section-ecfc659b.js} +5 -5
- package/dist/_shared/cjs/{SiteFooter-20d5a9fa.js → SiteFooter-b4247527.js} +14 -15
- package/dist/_shared/cjs/{SiteHeaderV2-ce1c8737.js → SiteHeaderV2-c2d651bc.js} +115 -83
- package/dist/_shared/cjs/{Surface-038db6e1.js → Surface-8599dbe4.js} +23 -23
- package/dist/_shared/cjs/{Tabs-bc9fac46.js → Tabs-75c34f43.js} +31 -49
- package/dist/_shared/cjs/{Tag-73a59171.js → Tag-452048f6.js} +9 -49
- package/dist/_shared/cjs/{Text-606ca3a2.js → Text-1c1110a4.js} +7 -7
- package/dist/_shared/cjs/{TextInput-8d139489.js → TextInput-762e2309.js} +11 -11
- package/dist/_shared/cjs/ThemeIcon-ee814862.js +27 -0
- package/dist/_shared/cjs/{Toast-26207fef.js → Toast-d06a89e0.js} +34 -38
- package/dist/_shared/cjs/{UniversalHeader-b8389447.js → UniversalHeader-f6d9c63a.js} +7 -14
- package/dist/_shared/cjs/{VerticalSpace-dc53bb70.js → VerticalSpace-e128ec68.js} +5 -5
- package/dist/_shared/cjs/_commonjsHelpers-56412ec5.js +21 -0
- package/dist/_shared/cjs/component-df82bc05.js +505 -0
- package/dist/_shared/cjs/{debounce-123468fb.js → debounce-a74c28cf.js} +2 -2
- package/dist/_shared/cjs/{index-74004a9c.js → index-039a9d35.js} +1 -1
- package/dist/_shared/cjs/{index-9f99d686.js → index-0c6319ec.js} +1 -1
- package/dist/_shared/cjs/index-28447df0.js +23 -0
- package/dist/_shared/cjs/{index-a31e64a9.js → index-3d629205.js} +2 -3
- package/dist/_shared/cjs/{index-dd1d18ea.js → index-3dd54df1.js} +21 -6
- package/dist/_shared/cjs/index-41b09e85.js +53 -0
- package/dist/_shared/cjs/{index-6eb396a3.js → index-7aa7f96a.js} +1 -1
- package/dist/_shared/{esm/Calendar-ea232839.js → cjs/index-7e31a45b.js} +54 -1942
- package/dist/_shared/cjs/{index-d38f1bd0.js → index-996dec94.js} +3 -3
- package/dist/_shared/cjs/{filter-data-attrs-1c9a530c.js → index-df60851b.js} +17 -57
- package/dist/_shared/cjs/index.es-8b018b0d.js +13 -0
- package/dist/_shared/cjs/{suffix-modifier-64dcd338.js → suffix-modifier-c8a34402.js} +2 -2
- package/dist/_shared/cjs/{use-media-query-e61881d8.js → use-media-query-d34c83b9.js} +0 -11
- package/dist/_shared/esm/ArcIconEclipse.esm-bb48b82a.js +22 -0
- package/dist/_shared/esm/{Avatar-320313f0.js → Avatar-38cc0595.js} +6 -23
- package/dist/_shared/esm/{BrandLogo-1af78f76.js → BrandLogo-7ed8aeda.js} +3 -3
- package/dist/_shared/esm/{Breadcrumbs-7d55e1a6.js → Breadcrumbs-9078b68e.js} +5 -6
- package/dist/_shared/esm/BtIconArrowRight.esm-6a17d0ce.js +31 -0
- package/dist/_shared/esm/BtIconPlayFill.esm-05fc0344.js +24 -0
- package/dist/_shared/esm/{Button-a7d134c6.js → Button-dde2b46a.js} +7 -10
- package/dist/_shared/esm/ButtonV2-49cd0615.js +42 -0
- package/dist/_shared/esm/Calendar-f81052f4.js +1918 -0
- package/dist/_shared/esm/{CardFooter-e13f77b0.js → CardFooter-c79fb2db.js} +7 -10
- package/dist/_shared/esm/{Checkbox-588619c7.js → Checkbox-0baca464.js} +15 -12
- package/dist/_shared/esm/{Columns-d96b7425.js → Columns-6a8f6fbb.js} +3 -10
- package/dist/_shared/esm/{index-b84a20c6.js → Combination-ae3a3f08.js} +853 -66
- package/dist/_shared/esm/DatePicker-2260f260.js +539 -0
- package/dist/_shared/esm/{DisclosureMini-56719716.js → DisclosureMini-38f4c459.js} +8 -10
- package/dist/_shared/esm/{Filter-258ba675.js → Filter-49dcf5ce.js} +2 -2
- package/dist/_shared/esm/{FormControl-8e836656.js → FormControl-d873f7fa.js} +14 -11
- package/dist/_shared/esm/{Grid-07dbf4bd.js → Grid-fb9fc522.js} +5 -4
- package/dist/_shared/esm/{Group-73fdb896.js → Group-66196f07.js} +3 -10
- package/dist/_shared/esm/{Heading-d16e0e53.js → Heading-906c7c7c.js} +3 -3
- package/dist/_shared/esm/HeroButton-7ea692bf.js +120 -0
- package/dist/_shared/esm/{Icon-15799695.js → Icon-512f834f.js} +6 -23
- package/dist/_shared/esm/{Image-12fbd327.js → Image-57d08939.js} +15 -5
- package/dist/_shared/esm/MediaCard-01250268.js +59 -0
- package/dist/_shared/esm/{Poster-4ec2f679.js → Poster-e05a8b45.js} +7 -7
- package/dist/_shared/esm/Preview-43b2a75d.js +161 -0
- package/dist/_shared/esm/{ProgressStepper-7eba3a6a.js → ProgressStepper-189ed0f9.js} +33 -12
- package/dist/_shared/esm/{RadioGroup-427652ac.js → RadioGroup-8ff17cbb.js} +5 -5
- package/dist/_shared/esm/{Section-73781b56.js → Section-1acbc06a.js} +1 -1
- package/dist/_shared/esm/{SiteFooter-86f910b4.js → SiteFooter-ef6f0cdc.js} +11 -12
- package/dist/_shared/esm/{SiteHeaderV2-a7c1b1cb.js → SiteHeaderV2-a041b889.js} +64 -32
- package/dist/_shared/esm/{Surface-0ca6817d.js → Surface-71d21a9e.js} +17 -17
- package/dist/_shared/esm/{Tabs-9485cab6.js → Tabs-21ac7dfe.js} +11 -29
- package/dist/_shared/esm/{Tag-cb35d57b.js → Tag-2513c185.js} +6 -46
- package/dist/_shared/esm/{Text-14f586ac.js → Text-a46fb76b.js} +3 -3
- package/dist/_shared/esm/{TextInput-c0388103.js → TextInput-94c7b1a4.js} +4 -4
- package/dist/_shared/esm/ThemeIcon-c2dc41a6.js +21 -0
- package/dist/_shared/esm/{Toast-fcbfc194.js → Toast-de6ca2f3.js} +15 -19
- package/dist/_shared/esm/{UniversalHeader-80c7313f.js → UniversalHeader-456ad60c.js} +4 -11
- package/dist/_shared/esm/{VerticalSpace-43cd9138.js → VerticalSpace-b07cd8e6.js} +1 -1
- package/dist/_shared/esm/_commonjsHelpers-0109d574.js +18 -0
- package/dist/_shared/esm/component-d0a555cf.js +476 -0
- package/dist/_shared/esm/{debounce-6fed6b84.js → debounce-c8e41002.js} +1 -1
- package/dist/_shared/esm/{filter-data-attrs-ea8f4ed4.js → index-288c66b5.js} +17 -55
- package/dist/_shared/esm/index-4e58de24.js +51 -0
- package/dist/_shared/esm/{index-25a5b393.js → index-5113ed53.js} +1 -2
- package/dist/_shared/esm/{index-2cfab9f2.js → index-6028d797.js} +1 -1
- package/dist/_shared/{cjs/Calendar-b022545c.js → esm/index-605031ca.js} +44 -1954
- package/dist/_shared/esm/index-69089474.js +21 -0
- package/dist/_shared/esm/{index-efa9be1a.js → index-7740883c.js} +1 -1
- package/dist/_shared/esm/{index-7b531fa7.js → index-cace3545.js} +16 -2
- package/dist/_shared/esm/{index-044da8d0.js → index-f97466e9.js} +1 -1
- package/dist/_shared/esm/{index-ca72c9d5.js → index-fa93ec97.js} +1 -1
- package/dist/_shared/esm/index.es-3139cf9e.js +9 -0
- package/dist/_shared/esm/{suffix-modifier-3d548e45.js → suffix-modifier-1ce05abe.js} +2 -2
- package/dist/_shared/esm/{use-media-query-4c807227.js → use-media-query-d3622da8.js} +1 -9
- package/dist/index.es.js +17418 -40573
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +17825 -40979
- package/dist/index.js.map +1 -1
- package/dist/styles.css +13 -11
- package/dist/types/components/Alert/Alert.d.ts +3 -5
- package/dist/types/components/AppButton/AppButton.d.ts +9 -0
- package/dist/types/components/AppButton/icons/AppStore.d.ts +2 -0
- package/dist/types/components/AppButton/icons/GooglePlay.d.ts +2 -0
- package/dist/types/components/AppButton/index.d.ts +1 -0
- package/dist/types/components/Avatar/types/avatar-image.d.ts +1 -1
- package/dist/types/components/Badge/Badge.d.ts +0 -8
- package/dist/types/components/BrandLogo/BrandLogo.d.ts +2 -2
- package/dist/types/components/ButtonV2/ButtonV2.d.ts +79 -0
- package/dist/types/components/ButtonV2/index.d.ts +1 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts +7 -4
- package/dist/types/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/types/components/FormControl/FormControl.d.ts +1 -1
- package/dist/types/components/Grid/Grid.types.d.ts +2 -0
- package/dist/types/components/Grid/components/Col/Col.d.ts +2 -1
- package/dist/types/components/Grid/components/Row/Row.d.ts +2 -1
- package/dist/types/components/Grid/index.d.ts +1 -1
- package/dist/types/components/HeroButton/HeroButton.d.ts +66 -0
- package/dist/types/components/HeroButton/index.d.ts +1 -0
- package/dist/types/components/Image/Image.d.ts +4 -0
- package/dist/types/components/ImpactCard/ImpactCard.d.ts +8 -3
- package/dist/types/components/InformationCard/InformationCard.d.ts +5 -5
- package/dist/types/components/MediaCard/MediaCard.d.ts +7 -6
- package/dist/types/components/MediaCard/types/index.d.ts +2 -0
- package/dist/types/components/MediaCard/types/media-card-image.d.ts +4 -0
- package/dist/types/components/MediaCard/types/media-card-video.d.ts +4 -0
- package/dist/types/components/Modal/Modal.d.ts +2 -2
- package/dist/types/components/Poster/Poster.d.ts +2 -2
- package/dist/types/components/ProgressBar/constants/progress-bar-icon-map.d.ts +2 -2
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +9 -1
- package/dist/types/components/SiteFooter/SiteFooter.d.ts +0 -4
- package/dist/types/components/SiteFooter/index.d.ts +0 -1
- package/dist/types/components/SiteHeaderV2/components/Panel/Panel.d.ts +1 -1
- package/dist/types/components/SiteHeaderV2/components/VerticalDivider/VerticalDivider.d.ts +1 -0
- package/dist/types/components/Surface/Surface.d.ts +3 -3
- package/dist/types/components/Switch/Switch.d.ts +1 -1
- package/dist/types/components/TextArea/TextArea.d.ts +8 -0
- package/dist/types/components/TextInput/TextInput.d.ts +4 -2
- package/dist/types/components/Theme/Theme.d.ts +21 -0
- package/dist/types/components/Theme/index.d.ts +1 -0
- package/dist/types/components/ThemeIcon/ThemeIcon.d.ts +18 -0
- package/dist/types/components/ThemeIcon/icon-names.d.ts +1 -0
- package/dist/types/components/ThemeIcon/index.d.ts +1 -0
- package/dist/types/components/TypographyCard/TypographyCard.d.ts +9 -4
- package/dist/types/components/VideoPlayer/VideoPlayer.d.ts +18 -0
- package/dist/types/components/VideoPlayer/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +8 -6
- package/dist/types/helpers/get-theme-img.d.ts +6 -0
- package/dist/types/helpers/index.d.ts +1 -0
- package/dist/types/hooks/index.d.ts +2 -4
- package/dist/types/hooks/private/index.d.ts +5 -0
- package/dist/types/hooks/private/use-aria-describedby/index.d.ts +1 -0
- package/dist/types/hooks/private/use-interaction-mode/index.d.ts +1 -0
- package/dist/types/hooks/private/use-numeric-input/index.d.ts +1 -0
- package/dist/types/hooks/{use-numeric-input.d.ts → private/use-numeric-input/use-numeric-input.d.ts} +3 -3
- package/dist/types/hooks/private/use-pagination/index.d.ts +1 -0
- package/dist/types/hooks/private/use-theme-element/index.d.ts +1 -0
- package/dist/types/hooks/public/index.d.ts +1 -0
- package/dist/types/hooks/public/use-media-query/index.d.ts +1 -0
- package/dist/types/hooks/{use-media-query.d.ts → public/use-media-query/use-media-query.d.ts} +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/private-components/CardFooter/CardFooter.d.ts +1 -1
- package/dist/types/private-components/CardFooter/index.d.ts +1 -1
- package/dist/types/private-components/CardHeading/CardHeading.d.ts +3 -3
- package/dist/types/private-components/index.d.ts +1 -2
- package/dist/types/styles.d.ts +7 -30
- package/dist/use-media-query/package.json +7 -0
- package/dist/use-media-query/use-media-query.cjs.js +10 -0
- package/dist/use-media-query/use-media-query.esm.js +2 -0
- package/package.json +48 -38
- package/dist/Base/Base.cjs.js +0 -11
- package/dist/Base/Base.esm.js +0 -3
- package/dist/Base/package.json +0 -7
- package/dist/Card/Card.cjs.js +0 -19
- package/dist/Card/Card.esm.js +0 -11
- package/dist/Card/package.json +0 -7
- package/dist/Clock/Clock.cjs.js +0 -48
- package/dist/Clock/Clock.esm.js +0 -39
- package/dist/Clock/package.json +0 -7
- package/dist/Curve/Curve.cjs.js +0 -13
- package/dist/Curve/Curve.esm.js +0 -5
- package/dist/Curve/package.json +0 -7
- package/dist/SiteHeader/SiteHeader.cjs.js +0 -25
- package/dist/SiteHeader/SiteHeader.esm.js +0 -16
- package/dist/SiteHeader/package.json +0 -7
- package/dist/_shared/cjs/Avatar-f1b1c129.js +0 -66
- package/dist/_shared/cjs/Base-f5a86eed.js +0 -22
- package/dist/_shared/cjs/BtIconArrowRight.esm-50d96943.js +0 -54
- package/dist/_shared/cjs/BtIconArrowRightFill.esm-435cf4bd.js +0 -26
- package/dist/_shared/cjs/BtIconChevronDown2Px.esm-39030ee0.js +0 -26
- package/dist/_shared/cjs/BtIconChevronLeftMid.esm-0aaa6770.js +0 -28
- package/dist/_shared/cjs/BtIconChevronRight2Px.esm-dbf8cbee.js +0 -44
- package/dist/_shared/cjs/BtIconCrossAlt2Px.esm-1452b14b.js +0 -26
- package/dist/_shared/cjs/BtIconTick.esm-844eac6c.js +0 -80
- package/dist/_shared/cjs/BtIconTickAlt2Px.esm-57c89acc.js +0 -26
- package/dist/_shared/cjs/Card-78a70e63.js +0 -126
- package/dist/_shared/cjs/Checkbox-0253327b.js +0 -62
- package/dist/_shared/cjs/Combination-9974f2e2.js +0 -1330
- package/dist/_shared/cjs/Curve-b5117889.js +0 -33
- package/dist/_shared/cjs/Grid-da776e77.js +0 -45
- package/dist/_shared/cjs/Icon-b46897a3.js +0 -54
- package/dist/_shared/cjs/Image-e873b8fc.js +0 -46
- package/dist/_shared/cjs/SiteHeader.rehydrator-9d8f3dad.js +0 -669
- package/dist/_shared/cjs/extends-8c5e4b48.js +0 -18
- package/dist/_shared/esm/Base-f200653c.js +0 -15
- package/dist/_shared/esm/BtIconAlert.esm-a4608d47.js +0 -28
- package/dist/_shared/esm/BtIconArrowRight.esm-9b181878.js +0 -46
- package/dist/_shared/esm/BtIconArrowRightFill.esm-99019d1a.js +0 -20
- package/dist/_shared/esm/BtIconChevronDown2Px.esm-217276c2.js +0 -20
- package/dist/_shared/esm/BtIconChevronLeftMid.esm-1ed8330b.js +0 -22
- package/dist/_shared/esm/BtIconChevronRight2Px.esm-75e92636.js +0 -37
- package/dist/_shared/esm/BtIconCrossAlt2Px.esm-7165ab1a.js +0 -20
- package/dist/_shared/esm/BtIconTick.esm-e265098f.js +0 -72
- package/dist/_shared/esm/BtIconTickAlt2Px.esm-0bc2ded0.js +0 -20
- package/dist/_shared/esm/Card-a4b78406.js +0 -120
- package/dist/_shared/esm/Combination-e9f7e64e.js +0 -1301
- package/dist/_shared/esm/Curve-e05b3c3f.js +0 -27
- package/dist/_shared/esm/SiteHeader.rehydrator-2ec02ee7.js +0 -662
- package/dist/_shared/esm/extends-8cc61aad.js +0 -16
- package/dist/types/components/Base/Base.d.ts +0 -16
- package/dist/types/components/Base/index.d.ts +0 -1
- package/dist/types/components/Card/Card.d.ts +0 -132
- package/dist/types/components/Card/index.d.ts +0 -1
- package/dist/types/components/Clock/Clock.d.ts +0 -17
- package/dist/types/components/Clock/Clock.rehydrator.d.ts +0 -2
- package/dist/types/components/Clock/index.d.ts +0 -2
- package/dist/types/components/Curve/Curve.d.ts +0 -34
- package/dist/types/components/Curve/index.d.ts +0 -1
- package/dist/types/components/SiteFooter/SiteFooter.rehydrator.d.ts +0 -2
- package/dist/types/components/SiteHeader/SiteHeader.d.ts +0 -79
- package/dist/types/components/SiteHeader/SiteHeader.rehydrator.d.ts +0 -8
- package/dist/types/components/SiteHeader/components/BackButton/BackButton.d.ts +0 -5
- package/dist/types/components/SiteHeader/components/BackButton/index.d.ts +0 -1
- package/dist/types/components/SiteHeader/components/Column/Column.d.ts +0 -8
- package/dist/types/components/SiteHeader/components/Column/index.d.ts +0 -1
- package/dist/types/components/SiteHeader/components/Item/Item.d.ts +0 -20
- package/dist/types/components/SiteHeader/components/Item/index.d.ts +0 -1
- package/dist/types/components/SiteHeader/components/ItemGroup/ItemGroup.d.ts +0 -26
- package/dist/types/components/SiteHeader/components/ItemGroup/ItemGroup.rehydrator.d.ts +0 -2
- package/dist/types/components/SiteHeader/components/ItemGroup/index.d.ts +0 -2
- package/dist/types/components/SiteHeader/components/MenuButton/MenuButton.d.ts +0 -6
- package/dist/types/components/SiteHeader/components/MenuButton/index.d.ts +0 -1
- package/dist/types/components/SiteHeader/components/NavItem/NavItem.d.ts +0 -42
- package/dist/types/components/SiteHeader/components/NavItem/NavItem.rehydrator.d.ts +0 -2
- package/dist/types/components/SiteHeader/components/NavItem/NavItemWithSubNav.d.ts +0 -47
- package/dist/types/components/SiteHeader/components/NavItem/NavItemWithSubNav.rehydrator.d.ts +0 -2
- package/dist/types/components/SiteHeader/components/NavItem/index.d.ts +0 -4
- package/dist/types/components/SiteHeader/components/NodeItem/NodeItem.d.ts +0 -8
- package/dist/types/components/SiteHeader/components/Panel/Panel.d.ts +0 -22
- package/dist/types/components/SiteHeader/components/Panel/index.d.ts +0 -1
- package/dist/types/components/SiteHeader/components/SubNavItem/SubNavItem.d.ts +0 -47
- package/dist/types/components/SiteHeader/components/SubNavItem/SubNavItem.rehydrator.d.ts +0 -2
- package/dist/types/components/SiteHeader/components/SubNavItem/index.d.ts +0 -2
- package/dist/types/components/SiteHeader/index.d.ts +0 -2
- package/dist/types/private-components/CardLabel/CardLabel.d.ts +0 -10
- package/dist/types/private-components/CardLabel/index.d.ts +0 -1
- /package/dist/_shared/cjs/{BtIconChevronRightMid.esm-d01ebbd4.js → BtIconChevronRightMid.esm-3e8d18a9.js} +0 -0
- /package/dist/_shared/esm/{BtIconChevronRightMid.esm-32268f1a.js → BtIconChevronRightMid.esm-4764708f.js} +0 -0
- /package/dist/types/hooks/{use-aria-describedby.d.ts → private/use-aria-describedby/use-aria-describedby.d.ts} +0 -0
- /package/dist/types/hooks/{use-interaction-mode.d.ts → private/use-interaction-mode/use-interaction-mode.d.ts} +0 -0
- /package/dist/types/hooks/{use-pagination.d.ts → private/use-pagination/use-pagination.d.ts} +0 -0
|
@@ -1,30 +1,561 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var index$1 = require('./index-3dd54df1.js');
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var $
|
|
6
|
-
var
|
|
5
|
+
var index$2 = require('./index-039a9d35.js');
|
|
6
|
+
var ReactDOM = require('react-dom');
|
|
7
|
+
var index$3 = require('./index-41b09e85.js');
|
|
8
|
+
var index$4 = require('./index-df60851b.js');
|
|
9
|
+
var component = require('./component-df82bc05.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
12
|
|
|
8
13
|
function _interopNamespace(e) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
if (e && e.__esModule) return e;
|
|
15
|
+
var n = Object.create(null);
|
|
16
|
+
if (e) {
|
|
17
|
+
Object.keys(e).forEach(function (k) {
|
|
18
|
+
if (k !== 'default') {
|
|
19
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return e[k]; }
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
n["default"] = e;
|
|
28
|
+
return Object.freeze(n);
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
-
var
|
|
32
|
+
var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
|
|
33
|
+
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
34
|
+
|
|
35
|
+
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
36
|
+
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
37
|
+
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
38
|
+
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
39
|
+
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ React.createContext({
|
|
40
|
+
layers: new Set(),
|
|
41
|
+
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
42
|
+
branches: new Set()
|
|
43
|
+
});
|
|
44
|
+
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
45
|
+
var _node$ownerDocument;
|
|
46
|
+
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
47
|
+
const context = React.useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
48
|
+
const [node1, setNode] = React.useState(null);
|
|
49
|
+
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;
|
|
50
|
+
const [, force] = React.useState({});
|
|
51
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
52
|
+
);
|
|
53
|
+
const layers = Array.from(context.layers);
|
|
54
|
+
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
55
|
+
...context.layersWithOutsidePointerEventsDisabled
|
|
56
|
+
].slice(-1); // prettier-ignore
|
|
57
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
|
|
58
|
+
const index = node1 ? layers.indexOf(node1) : -1;
|
|
59
|
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
60
|
+
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
61
|
+
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
62
|
+
const target = event.target;
|
|
63
|
+
const isPointerDownOnBranch = [
|
|
64
|
+
...context.branches
|
|
65
|
+
].some((branch)=>branch.contains(target)
|
|
66
|
+
);
|
|
67
|
+
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
68
|
+
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
69
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
70
|
+
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
71
|
+
}, ownerDocument);
|
|
72
|
+
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
73
|
+
const target = event.target;
|
|
74
|
+
const isFocusInBranch = [
|
|
75
|
+
...context.branches
|
|
76
|
+
].some((branch)=>branch.contains(target)
|
|
77
|
+
);
|
|
78
|
+
if (isFocusInBranch) return;
|
|
79
|
+
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
|
|
80
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
81
|
+
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
82
|
+
}, ownerDocument);
|
|
83
|
+
index$2.$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
84
|
+
const isHighestLayer = index === context.layers.size - 1;
|
|
85
|
+
if (!isHighestLayer) return;
|
|
86
|
+
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
87
|
+
if (!event.defaultPrevented && onDismiss) {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
onDismiss();
|
|
90
|
+
}
|
|
91
|
+
}, ownerDocument);
|
|
92
|
+
React.useEffect(()=>{
|
|
93
|
+
if (!node1) return;
|
|
94
|
+
if (disableOutsidePointerEvents) {
|
|
95
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
96
|
+
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
97
|
+
ownerDocument.body.style.pointerEvents = 'none';
|
|
98
|
+
}
|
|
99
|
+
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
100
|
+
}
|
|
101
|
+
context.layers.add(node1);
|
|
102
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
103
|
+
return ()=>{
|
|
104
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
105
|
+
};
|
|
106
|
+
}, [
|
|
107
|
+
node1,
|
|
108
|
+
ownerDocument,
|
|
109
|
+
disableOutsidePointerEvents,
|
|
110
|
+
context
|
|
111
|
+
]);
|
|
112
|
+
/**
|
|
113
|
+
* We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
|
|
114
|
+
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
|
115
|
+
* and add it to the end again so the layering order wouldn't be _creation order_.
|
|
116
|
+
* We only want them to be removed from context stacks when unmounted.
|
|
117
|
+
*/ React.useEffect(()=>{
|
|
118
|
+
return ()=>{
|
|
119
|
+
if (!node1) return;
|
|
120
|
+
context.layers.delete(node1);
|
|
121
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
122
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
123
|
+
};
|
|
124
|
+
}, [
|
|
125
|
+
node1,
|
|
126
|
+
context
|
|
127
|
+
]);
|
|
128
|
+
React.useEffect(()=>{
|
|
129
|
+
const handleUpdate = ()=>force({})
|
|
130
|
+
;
|
|
131
|
+
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
132
|
+
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
133
|
+
;
|
|
134
|
+
}, []);
|
|
135
|
+
return /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index$1._extends({}, layerProps, {
|
|
136
|
+
ref: composedRefs,
|
|
137
|
+
style: {
|
|
138
|
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
139
|
+
...props.style
|
|
140
|
+
},
|
|
141
|
+
onFocusCapture: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
142
|
+
onBlurCapture: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
143
|
+
onPointerDownCapture: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
144
|
+
}));
|
|
145
|
+
});
|
|
146
|
+
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
147
|
+
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
148
|
+
* to mimic layer dismissing behaviour present in OS.
|
|
149
|
+
* Returns props to pass to the node we want to check for outside events.
|
|
150
|
+
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
151
|
+
const handlePointerDownOutside = index$1.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
152
|
+
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
153
|
+
const handleClickRef = React.useRef(()=>{});
|
|
154
|
+
React.useEffect(()=>{
|
|
155
|
+
const handlePointerDown = (event)=>{
|
|
156
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
157
|
+
const eventDetail = {
|
|
158
|
+
originalEvent: event
|
|
159
|
+
};
|
|
160
|
+
function handleAndDispatchPointerDownOutsideEvent() {
|
|
161
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
162
|
+
discrete: true
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* On touch devices, we need to wait for a click event because browsers implement
|
|
167
|
+
* a ~350ms delay between the time the user stops touching the display and when the
|
|
168
|
+
* browser executres events. We need to ensure we don't reactivate pointer-events within
|
|
169
|
+
* this timeframe otherwise the browser may execute events that should have been prevented.
|
|
170
|
+
*
|
|
171
|
+
* Additionally, this also lets us deal automatically with cancellations when a click event
|
|
172
|
+
* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
|
|
173
|
+
*
|
|
174
|
+
* This is why we also continuously remove the previous listener, because we cannot be
|
|
175
|
+
* certain that it was raised, and therefore cleaned-up.
|
|
176
|
+
*/ if (event.pointerType === 'touch') {
|
|
177
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
178
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
179
|
+
ownerDocument.addEventListener('click', handleClickRef.current, {
|
|
180
|
+
once: true
|
|
181
|
+
});
|
|
182
|
+
} else handleAndDispatchPointerDownOutsideEvent();
|
|
183
|
+
} else // We need to remove the event listener in case the outside click has been canceled.
|
|
184
|
+
// See: https://github.com/radix-ui/primitives/issues/2171
|
|
185
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
186
|
+
isPointerInsideReactTreeRef.current = false;
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* if this hook executes in a component that mounts via a `pointerdown` event, the event
|
|
190
|
+
* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
|
|
191
|
+
* this by delaying the event listener registration on the document.
|
|
192
|
+
* This is not React specific, but rather how the DOM works, ie:
|
|
193
|
+
* ```
|
|
194
|
+
* button.addEventListener('pointerdown', () => {
|
|
195
|
+
* console.log('I will log');
|
|
196
|
+
* document.addEventListener('pointerdown', () => {
|
|
197
|
+
* console.log('I will also log');
|
|
198
|
+
* })
|
|
199
|
+
* });
|
|
200
|
+
*/ const timerId = window.setTimeout(()=>{
|
|
201
|
+
ownerDocument.addEventListener('pointerdown', handlePointerDown);
|
|
202
|
+
}, 0);
|
|
203
|
+
return ()=>{
|
|
204
|
+
window.clearTimeout(timerId);
|
|
205
|
+
ownerDocument.removeEventListener('pointerdown', handlePointerDown);
|
|
206
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
207
|
+
};
|
|
208
|
+
}, [
|
|
209
|
+
ownerDocument,
|
|
210
|
+
handlePointerDownOutside
|
|
211
|
+
]);
|
|
212
|
+
return {
|
|
213
|
+
// ensures we check React component tree (not just DOM tree)
|
|
214
|
+
onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Listens for when focus happens outside a react subtree.
|
|
219
|
+
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
220
|
+
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
221
|
+
const handleFocusOutside = index$1.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
222
|
+
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
223
|
+
React.useEffect(()=>{
|
|
224
|
+
const handleFocus = (event)=>{
|
|
225
|
+
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
226
|
+
const eventDetail = {
|
|
227
|
+
originalEvent: event
|
|
228
|
+
};
|
|
229
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
230
|
+
discrete: false
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
ownerDocument.addEventListener('focusin', handleFocus);
|
|
235
|
+
return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
|
|
236
|
+
;
|
|
237
|
+
}, [
|
|
238
|
+
ownerDocument,
|
|
239
|
+
handleFocusOutside
|
|
240
|
+
]);
|
|
241
|
+
return {
|
|
242
|
+
onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
|
|
243
|
+
,
|
|
244
|
+
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
248
|
+
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
249
|
+
document.dispatchEvent(event);
|
|
250
|
+
}
|
|
251
|
+
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
252
|
+
const target = detail.originalEvent.target;
|
|
253
|
+
const event = new CustomEvent(name, {
|
|
254
|
+
bubbles: false,
|
|
255
|
+
cancelable: true,
|
|
256
|
+
detail: detail
|
|
257
|
+
});
|
|
258
|
+
if (handler) target.addEventListener(name, handler, {
|
|
259
|
+
once: true
|
|
260
|
+
});
|
|
261
|
+
if (discrete) index$1.$8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
262
|
+
else target.dispatchEvent(event);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
|
|
266
|
+
/**
|
|
267
|
+
* Injects a pair of focus guards at the edges of the whole DOM tree
|
|
268
|
+
* to ensure `focusin` & `focusout` events can be caught consistently.
|
|
269
|
+
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
270
|
+
React.useEffect(()=>{
|
|
271
|
+
var _edgeGuards$, _edgeGuards$2;
|
|
272
|
+
const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
|
|
273
|
+
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
274
|
+
document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
275
|
+
$3db38b7d1fb3fe6a$var$count++;
|
|
276
|
+
return ()=>{
|
|
277
|
+
if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
|
|
278
|
+
);
|
|
279
|
+
$3db38b7d1fb3fe6a$var$count--;
|
|
280
|
+
};
|
|
281
|
+
}, []);
|
|
282
|
+
}
|
|
283
|
+
function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
284
|
+
const element = document.createElement('span');
|
|
285
|
+
element.setAttribute('data-radix-focus-guard', '');
|
|
286
|
+
element.tabIndex = 0;
|
|
287
|
+
element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
|
|
288
|
+
return element;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
|
|
292
|
+
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
|
|
293
|
+
const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
294
|
+
bubbles: false,
|
|
295
|
+
cancelable: true
|
|
296
|
+
};
|
|
297
|
+
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
298
|
+
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
299
|
+
const [container1, setContainer] = React.useState(null);
|
|
300
|
+
const onMountAutoFocus = index$1.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
301
|
+
const onUnmountAutoFocus = index$1.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
302
|
+
const lastFocusedElementRef = React.useRef(null);
|
|
303
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
|
304
|
+
);
|
|
305
|
+
const focusScope = React.useRef({
|
|
306
|
+
paused: false,
|
|
307
|
+
pause () {
|
|
308
|
+
this.paused = true;
|
|
309
|
+
},
|
|
310
|
+
resume () {
|
|
311
|
+
this.paused = false;
|
|
312
|
+
}
|
|
313
|
+
}).current; // Takes care of trapping focus if focus is moved outside programmatically for example
|
|
314
|
+
React.useEffect(()=>{
|
|
315
|
+
if (trapped) {
|
|
316
|
+
function handleFocusIn(event) {
|
|
317
|
+
if (focusScope.paused || !container1) return;
|
|
318
|
+
const target = event.target;
|
|
319
|
+
if (container1.contains(target)) lastFocusedElementRef.current = target;
|
|
320
|
+
else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
321
|
+
select: true
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
function handleFocusOut(event) {
|
|
325
|
+
if (focusScope.paused || !container1) return;
|
|
326
|
+
const relatedTarget = event.relatedTarget; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:
|
|
327
|
+
//
|
|
328
|
+
// 1. When the user switches app/tabs/windows/the browser itself loses focus.
|
|
329
|
+
// 2. In Google Chrome, when the focused element is removed from the DOM.
|
|
330
|
+
//
|
|
331
|
+
// We let the browser do its thing here because:
|
|
332
|
+
//
|
|
333
|
+
// 1. The browser already keeps a memory of what's focused for when the page gets refocused.
|
|
334
|
+
// 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it
|
|
335
|
+
// throws the CPU to 100%, so we avoid doing anything for this reason here too.
|
|
336
|
+
if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)
|
|
337
|
+
// that is outside the container, we move focus to the last valid focused element inside.
|
|
338
|
+
if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
339
|
+
select: true
|
|
340
|
+
});
|
|
341
|
+
} // When the focused element gets removed from the DOM, browsers move focus
|
|
342
|
+
// back to the document.body. In this case, we move focus to the container
|
|
343
|
+
// to keep focus trapped correctly.
|
|
344
|
+
function handleMutations(mutations) {
|
|
345
|
+
const focusedElement = document.activeElement;
|
|
346
|
+
if (focusedElement !== document.body) return;
|
|
347
|
+
for (const mutation of mutations)if (mutation.removedNodes.length > 0) $d3863c46a17e8a28$var$focus(container1);
|
|
348
|
+
}
|
|
349
|
+
document.addEventListener('focusin', handleFocusIn);
|
|
350
|
+
document.addEventListener('focusout', handleFocusOut);
|
|
351
|
+
const mutationObserver = new MutationObserver(handleMutations);
|
|
352
|
+
if (container1) mutationObserver.observe(container1, {
|
|
353
|
+
childList: true,
|
|
354
|
+
subtree: true
|
|
355
|
+
});
|
|
356
|
+
return ()=>{
|
|
357
|
+
document.removeEventListener('focusin', handleFocusIn);
|
|
358
|
+
document.removeEventListener('focusout', handleFocusOut);
|
|
359
|
+
mutationObserver.disconnect();
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
}, [
|
|
363
|
+
trapped,
|
|
364
|
+
container1,
|
|
365
|
+
focusScope.paused
|
|
366
|
+
]);
|
|
367
|
+
React.useEffect(()=>{
|
|
368
|
+
if (container1) {
|
|
369
|
+
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
|
|
370
|
+
const previouslyFocusedElement = document.activeElement;
|
|
371
|
+
const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
|
|
372
|
+
if (!hasFocusedCandidate) {
|
|
373
|
+
const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
374
|
+
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
375
|
+
container1.dispatchEvent(mountEvent);
|
|
376
|
+
if (!mountEvent.defaultPrevented) {
|
|
377
|
+
$d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
|
|
378
|
+
select: true
|
|
379
|
+
});
|
|
380
|
+
if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
return ()=>{
|
|
384
|
+
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
|
|
385
|
+
// We need to delay the focus a little to get around it for now.
|
|
386
|
+
// See: https://github.com/facebook/react/issues/17894
|
|
387
|
+
setTimeout(()=>{
|
|
388
|
+
const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
389
|
+
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
390
|
+
container1.dispatchEvent(unmountEvent);
|
|
391
|
+
if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
|
|
392
|
+
select: true
|
|
393
|
+
});
|
|
394
|
+
// we need to remove the listener after we `dispatchEvent`
|
|
395
|
+
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
396
|
+
$d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
|
|
397
|
+
}, 0);
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
}, [
|
|
401
|
+
container1,
|
|
402
|
+
onMountAutoFocus,
|
|
403
|
+
onUnmountAutoFocus,
|
|
404
|
+
focusScope
|
|
405
|
+
]); // Takes care of looping focus (when tabbing whilst at the edges)
|
|
406
|
+
const handleKeyDown = React.useCallback((event)=>{
|
|
407
|
+
if (!loop && !trapped) return;
|
|
408
|
+
if (focusScope.paused) return;
|
|
409
|
+
const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
410
|
+
const focusedElement = document.activeElement;
|
|
411
|
+
if (isTabKey && focusedElement) {
|
|
412
|
+
const container = event.currentTarget;
|
|
413
|
+
const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container);
|
|
414
|
+
const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges
|
|
415
|
+
if (!hasTabbableElementsInside) {
|
|
416
|
+
if (focusedElement === container) event.preventDefault();
|
|
417
|
+
} else {
|
|
418
|
+
if (!event.shiftKey && focusedElement === last) {
|
|
419
|
+
event.preventDefault();
|
|
420
|
+
if (loop) $d3863c46a17e8a28$var$focus(first, {
|
|
421
|
+
select: true
|
|
422
|
+
});
|
|
423
|
+
} else if (event.shiftKey && focusedElement === first) {
|
|
424
|
+
event.preventDefault();
|
|
425
|
+
if (loop) $d3863c46a17e8a28$var$focus(last, {
|
|
426
|
+
select: true
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}, [
|
|
432
|
+
loop,
|
|
433
|
+
trapped,
|
|
434
|
+
focusScope.paused
|
|
435
|
+
]);
|
|
436
|
+
return /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index$1._extends({
|
|
437
|
+
tabIndex: -1
|
|
438
|
+
}, scopeProps, {
|
|
439
|
+
ref: composedRefs,
|
|
440
|
+
onKeyDown: handleKeyDown
|
|
441
|
+
}));
|
|
442
|
+
});
|
|
443
|
+
/* -------------------------------------------------------------------------------------------------
|
|
444
|
+
* Utils
|
|
445
|
+
* -----------------------------------------------------------------------------------------------*/ /**
|
|
446
|
+
* Attempts focusing the first element in a list of candidates.
|
|
447
|
+
* Stops when focus has actually moved.
|
|
448
|
+
*/ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) {
|
|
449
|
+
const previouslyFocusedElement = document.activeElement;
|
|
450
|
+
for (const candidate of candidates){
|
|
451
|
+
$d3863c46a17e8a28$var$focus(candidate, {
|
|
452
|
+
select: select
|
|
453
|
+
});
|
|
454
|
+
if (document.activeElement !== previouslyFocusedElement) return;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Returns the first and last tabbable elements inside a container.
|
|
459
|
+
*/ function $d3863c46a17e8a28$var$getTabbableEdges(container) {
|
|
460
|
+
const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container);
|
|
461
|
+
const first = $d3863c46a17e8a28$var$findVisible(candidates, container);
|
|
462
|
+
const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container);
|
|
463
|
+
return [
|
|
464
|
+
first,
|
|
465
|
+
last
|
|
466
|
+
];
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Returns a list of potential tabbable candidates.
|
|
470
|
+
*
|
|
471
|
+
* NOTE: This is only a close approximation. For example it doesn't take into account cases like when
|
|
472
|
+
* elements are not visible. This cannot be worked out easily by just reading a property, but rather
|
|
473
|
+
* necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.
|
|
474
|
+
*
|
|
475
|
+
* See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
|
|
476
|
+
* Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
|
|
477
|
+
*/ function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
|
|
478
|
+
const nodes = [];
|
|
479
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
480
|
+
acceptNode: (node)=>{
|
|
481
|
+
const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';
|
|
482
|
+
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
|
|
483
|
+
// runtime's understanding of tabbability, so this automatically accounts
|
|
484
|
+
// for any kind of element that could be tabbed to.
|
|
485
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it
|
|
489
|
+
// hinders accessibility to have tab order different from visual order.
|
|
490
|
+
return nodes;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Returns the first visible element in a list.
|
|
494
|
+
* NOTE: Only checks visibility up to the `container`.
|
|
495
|
+
*/ function $d3863c46a17e8a28$var$findVisible(elements, container) {
|
|
496
|
+
for (const element of elements){
|
|
497
|
+
// we stop checking if it's hidden at the `container` level (excluding)
|
|
498
|
+
if (!$d3863c46a17e8a28$var$isHidden(element, {
|
|
499
|
+
upTo: container
|
|
500
|
+
})) return element;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) {
|
|
504
|
+
if (getComputedStyle(node).visibility === 'hidden') return true;
|
|
505
|
+
while(node){
|
|
506
|
+
// we stop at `upTo` (excluding it)
|
|
507
|
+
if (upTo !== undefined && node === upTo) return false;
|
|
508
|
+
if (getComputedStyle(node).display === 'none') return true;
|
|
509
|
+
node = node.parentElement;
|
|
510
|
+
}
|
|
511
|
+
return false;
|
|
512
|
+
}
|
|
513
|
+
function $d3863c46a17e8a28$var$isSelectableInput(element) {
|
|
514
|
+
return element instanceof HTMLInputElement && 'select' in element;
|
|
515
|
+
}
|
|
516
|
+
function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) {
|
|
517
|
+
// only focus if that element is focusable
|
|
518
|
+
if (element && element.focus) {
|
|
519
|
+
const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users
|
|
520
|
+
element.focus({
|
|
521
|
+
preventScroll: true
|
|
522
|
+
}); // only select if its not the same element, it supports selection and we need to select
|
|
523
|
+
if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select();
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
/* -------------------------------------------------------------------------------------------------
|
|
527
|
+
* FocusScope stack
|
|
528
|
+
* -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
|
|
529
|
+
function $d3863c46a17e8a28$var$createFocusScopesStack() {
|
|
530
|
+
/** A stack of focus scopes, with the active one at the top */ let stack = [];
|
|
531
|
+
return {
|
|
532
|
+
add (focusScope) {
|
|
533
|
+
// pause the currently active focus scope (at the top of the stack)
|
|
534
|
+
const activeFocusScope = stack[0];
|
|
535
|
+
if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
|
|
536
|
+
// remove in case it already exists (because we'll re-add it at the top of the stack)
|
|
537
|
+
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
538
|
+
stack.unshift(focusScope);
|
|
539
|
+
},
|
|
540
|
+
remove (focusScope) {
|
|
541
|
+
var _stack$;
|
|
542
|
+
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
543
|
+
(_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
function $d3863c46a17e8a28$var$arrayRemove(array, item) {
|
|
548
|
+
const updatedArray = [
|
|
549
|
+
...array
|
|
550
|
+
];
|
|
551
|
+
const index = updatedArray.indexOf(item);
|
|
552
|
+
if (index !== -1) updatedArray.splice(index, 1);
|
|
553
|
+
return updatedArray;
|
|
554
|
+
}
|
|
555
|
+
function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
556
|
+
return items.filter((item)=>item.tagName !== 'A'
|
|
557
|
+
);
|
|
558
|
+
}
|
|
28
559
|
|
|
29
560
|
const sides = ['top', 'right', 'bottom', 'left'];
|
|
30
561
|
const min = Math.min;
|
|
@@ -959,7 +1490,7 @@ function isOverflowElement(element) {
|
|
|
959
1490
|
overflowX,
|
|
960
1491
|
overflowY,
|
|
961
1492
|
display
|
|
962
|
-
} = getComputedStyle(element);
|
|
1493
|
+
} = getComputedStyle$1(element);
|
|
963
1494
|
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
|
|
964
1495
|
}
|
|
965
1496
|
function isTableElement(element) {
|
|
@@ -967,7 +1498,7 @@ function isTableElement(element) {
|
|
|
967
1498
|
}
|
|
968
1499
|
function isContainingBlock(element) {
|
|
969
1500
|
const webkit = isWebKit();
|
|
970
|
-
const css = getComputedStyle(element);
|
|
1501
|
+
const css = getComputedStyle$1(element);
|
|
971
1502
|
|
|
972
1503
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
973
1504
|
return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
|
|
@@ -990,7 +1521,7 @@ function isWebKit() {
|
|
|
990
1521
|
function isLastTraversableNode(node) {
|
|
991
1522
|
return ['html', 'body', '#document'].includes(getNodeName(node));
|
|
992
1523
|
}
|
|
993
|
-
function getComputedStyle(element) {
|
|
1524
|
+
function getComputedStyle$1(element) {
|
|
994
1525
|
return getWindow(element).getComputedStyle(element);
|
|
995
1526
|
}
|
|
996
1527
|
function getNodeScroll(element) {
|
|
@@ -1048,7 +1579,7 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
1048
1579
|
}
|
|
1049
1580
|
|
|
1050
1581
|
function getCssDimensions(element) {
|
|
1051
|
-
const css = getComputedStyle(element);
|
|
1582
|
+
const css = getComputedStyle$1(element);
|
|
1052
1583
|
// In testing environments, the `width` and `height` properties are empty
|
|
1053
1584
|
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
1054
1585
|
let width = parseFloat(css.width) || 0;
|
|
@@ -1152,7 +1683,7 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1152
1683
|
while (currentIFrame && offsetParent && offsetWin !== win) {
|
|
1153
1684
|
const iframeScale = getScale(currentIFrame);
|
|
1154
1685
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1155
|
-
const css = getComputedStyle(currentIFrame);
|
|
1686
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
1156
1687
|
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1157
1688
|
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1158
1689
|
x *= iframeScale.x;
|
|
@@ -1228,7 +1759,7 @@ function getDocumentRect(element) {
|
|
|
1228
1759
|
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1229
1760
|
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1230
1761
|
const y = -scroll.scrollTop;
|
|
1231
|
-
if (getComputedStyle(body).direction === 'rtl') {
|
|
1762
|
+
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
1232
1763
|
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1233
1764
|
}
|
|
1234
1765
|
return {
|
|
@@ -1304,7 +1835,7 @@ function hasFixedPositionAncestor(element, stopNode) {
|
|
|
1304
1835
|
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1305
1836
|
return false;
|
|
1306
1837
|
}
|
|
1307
|
-
return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1838
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1308
1839
|
}
|
|
1309
1840
|
|
|
1310
1841
|
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
@@ -1317,12 +1848,12 @@ function getClippingElementAncestors(element, cache) {
|
|
|
1317
1848
|
}
|
|
1318
1849
|
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1319
1850
|
let currentContainingBlockComputedStyle = null;
|
|
1320
|
-
const elementIsFixed = getComputedStyle(element).position === 'fixed';
|
|
1851
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
1321
1852
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1322
1853
|
|
|
1323
1854
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1324
1855
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1325
|
-
const computedStyle = getComputedStyle(currentNode);
|
|
1856
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
1326
1857
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1327
1858
|
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
1328
1859
|
currentContainingBlockComputedStyle = null;
|
|
@@ -1404,7 +1935,7 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1404
1935
|
}
|
|
1405
1936
|
|
|
1406
1937
|
function getTrueOffsetParent(element, polyfill) {
|
|
1407
|
-
if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
|
|
1938
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
1408
1939
|
return null;
|
|
1409
1940
|
}
|
|
1410
1941
|
if (polyfill) {
|
|
@@ -1421,10 +1952,10 @@ function getOffsetParent(element, polyfill) {
|
|
|
1421
1952
|
return window;
|
|
1422
1953
|
}
|
|
1423
1954
|
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1424
|
-
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
|
|
1955
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
|
|
1425
1956
|
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1426
1957
|
}
|
|
1427
|
-
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
1958
|
+
if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
|
|
1428
1959
|
return window;
|
|
1429
1960
|
}
|
|
1430
1961
|
return offsetParent || getContainingBlock(element) || window;
|
|
@@ -1449,7 +1980,7 @@ const getElementRects = async function (_ref) {
|
|
|
1449
1980
|
};
|
|
1450
1981
|
|
|
1451
1982
|
function isRTL(element) {
|
|
1452
|
-
return getComputedStyle(element).direction === 'rtl';
|
|
1983
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
1453
1984
|
}
|
|
1454
1985
|
|
|
1455
1986
|
const platform = {
|
|
@@ -1821,7 +2352,7 @@ function useFloating(options) {
|
|
|
1821
2352
|
};
|
|
1822
2353
|
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
1823
2354
|
dataRef.current = fullData;
|
|
1824
|
-
|
|
2355
|
+
ReactDOM__namespace.flushSync(() => {
|
|
1825
2356
|
setData(fullData);
|
|
1826
2357
|
});
|
|
1827
2358
|
}
|
|
@@ -1899,53 +2430,6 @@ function useFloating(options) {
|
|
|
1899
2430
|
}), [data, update, refs, elements, floatingStyles]);
|
|
1900
2431
|
}
|
|
1901
2432
|
|
|
1902
|
-
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
1903
|
-
const [size, setSize] = React.useState(undefined);
|
|
1904
|
-
index$1.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1905
|
-
if (element) {
|
|
1906
|
-
// provide size as early as possible
|
|
1907
|
-
setSize({
|
|
1908
|
-
width: element.offsetWidth,
|
|
1909
|
-
height: element.offsetHeight
|
|
1910
|
-
});
|
|
1911
|
-
const resizeObserver = new ResizeObserver((entries)=>{
|
|
1912
|
-
if (!Array.isArray(entries)) return;
|
|
1913
|
-
// Since we only observe the one element, we don't need to loop over the
|
|
1914
|
-
// array
|
|
1915
|
-
if (!entries.length) return;
|
|
1916
|
-
const entry = entries[0];
|
|
1917
|
-
let width;
|
|
1918
|
-
let height;
|
|
1919
|
-
if ('borderBoxSize' in entry) {
|
|
1920
|
-
const borderSizeEntry = entry['borderBoxSize']; // iron out differences between browsers
|
|
1921
|
-
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
1922
|
-
width = borderSize['inlineSize'];
|
|
1923
|
-
height = borderSize['blockSize'];
|
|
1924
|
-
} else {
|
|
1925
|
-
// for browsers that don't support `borderBoxSize`
|
|
1926
|
-
// we calculate it ourselves to get the correct border box.
|
|
1927
|
-
width = element.offsetWidth;
|
|
1928
|
-
height = element.offsetHeight;
|
|
1929
|
-
}
|
|
1930
|
-
setSize({
|
|
1931
|
-
width: width,
|
|
1932
|
-
height: height
|
|
1933
|
-
});
|
|
1934
|
-
});
|
|
1935
|
-
resizeObserver.observe(element, {
|
|
1936
|
-
box: 'border-box'
|
|
1937
|
-
});
|
|
1938
|
-
return ()=>resizeObserver.unobserve(element)
|
|
1939
|
-
;
|
|
1940
|
-
} else // We only want to reset to `undefined` when the element becomes `null`,
|
|
1941
|
-
// not if it changes to another element.
|
|
1942
|
-
setSize(undefined);
|
|
1943
|
-
}, [
|
|
1944
|
-
element
|
|
1945
|
-
]);
|
|
1946
|
-
return size;
|
|
1947
|
-
}
|
|
1948
|
-
|
|
1949
2433
|
/* -------------------------------------------------------------------------------------------------
|
|
1950
2434
|
* Popper
|
|
1951
2435
|
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME = 'Popper';
|
|
@@ -1974,7 +2458,7 @@ const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/ React.forwardRef(
|
|
|
1974
2458
|
// `anchorRef` with their virtual ref in this case.
|
|
1975
2459
|
context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
|
|
1976
2460
|
});
|
|
1977
|
-
return virtualRef ? null : /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div,
|
|
2461
|
+
return virtualRef ? null : /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index$1._extends({}, anchorProps, {
|
|
1978
2462
|
ref: composedRefs
|
|
1979
2463
|
}));
|
|
1980
2464
|
});
|
|
@@ -1990,7 +2474,7 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef(
|
|
|
1990
2474
|
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
1991
2475
|
);
|
|
1992
2476
|
const [arrow$1, setArrow] = React.useState(null);
|
|
1993
|
-
const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(arrow$1);
|
|
2477
|
+
const arrowSize = index$3.$db6c3485150b8e66$export$1ab7ae714698c4b8(arrow$1);
|
|
1994
2478
|
const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
|
|
1995
2479
|
const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
|
|
1996
2480
|
const desiredPlacement = side + (align !== 'center' ? '-' + align : '');
|
|
@@ -2103,7 +2587,7 @@ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef(
|
|
|
2103
2587
|
arrowX: arrowX,
|
|
2104
2588
|
arrowY: arrowY,
|
|
2105
2589
|
shouldHideArrow: cannotCenterArrow
|
|
2106
|
-
}, /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div,
|
|
2590
|
+
}, /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index$1._extends({
|
|
2107
2591
|
"data-side": placedSide,
|
|
2108
2592
|
"data-align": placedAlign
|
|
2109
2593
|
}, contentProps, {
|
|
@@ -2174,7 +2658,317 @@ const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac
|
|
|
2174
2658
|
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
2175
2659
|
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
2176
2660
|
|
|
2661
|
+
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
2662
|
+
var _globalThis$document;
|
|
2663
|
+
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;
|
|
2664
|
+
return container ? /*#__PURE__*/ ReactDOM__default["default"].createPortal(/*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index$1._extends({}, portalProps, {
|
|
2665
|
+
ref: forwardedRef
|
|
2666
|
+
})), container) : null;
|
|
2667
|
+
});
|
|
2668
|
+
|
|
2669
|
+
var effectCar = component.createSidecarMedium();
|
|
2670
|
+
|
|
2671
|
+
var nothing = function () {
|
|
2672
|
+
return;
|
|
2673
|
+
};
|
|
2674
|
+
/**
|
|
2675
|
+
* Removes scrollbar from the page and contain the scroll within the Lock
|
|
2676
|
+
*/
|
|
2677
|
+
var RemoveScroll = React__namespace.forwardRef(function (props, parentRef) {
|
|
2678
|
+
var ref = React__namespace.useRef(null);
|
|
2679
|
+
var _a = React__namespace.useState({
|
|
2680
|
+
onScrollCapture: nothing,
|
|
2681
|
+
onWheelCapture: nothing,
|
|
2682
|
+
onTouchMoveCapture: nothing,
|
|
2683
|
+
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
2684
|
+
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 = index$4.__rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]);
|
|
2685
|
+
var SideCar = sideCar;
|
|
2686
|
+
var containerRef = component.useMergeRefs([ref, parentRef]);
|
|
2687
|
+
var containerProps = index$4.__assign(index$4.__assign({}, rest), callbacks);
|
|
2688
|
+
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
2689
|
+
enabled && (React__namespace.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })),
|
|
2690
|
+
forwardProps ? (React__namespace.cloneElement(React__namespace.Children.only(children), index$4.__assign(index$4.__assign({}, containerProps), { ref: containerRef }))) : (React__namespace.createElement(Container, index$4.__assign({}, containerProps, { className: className, ref: containerRef }), children))));
|
|
2691
|
+
});
|
|
2692
|
+
RemoveScroll.defaultProps = {
|
|
2693
|
+
enabled: true,
|
|
2694
|
+
removeScrollBar: true,
|
|
2695
|
+
inert: false,
|
|
2696
|
+
};
|
|
2697
|
+
RemoveScroll.classNames = {
|
|
2698
|
+
fullWidth: component.fullWidthClassName,
|
|
2699
|
+
zeroRight: component.zeroRightClassName,
|
|
2700
|
+
};
|
|
2701
|
+
|
|
2702
|
+
var passiveSupported = false;
|
|
2703
|
+
if (typeof window !== 'undefined') {
|
|
2704
|
+
try {
|
|
2705
|
+
var options = Object.defineProperty({}, 'passive', {
|
|
2706
|
+
get: function () {
|
|
2707
|
+
passiveSupported = true;
|
|
2708
|
+
return true;
|
|
2709
|
+
},
|
|
2710
|
+
});
|
|
2711
|
+
// @ts-ignore
|
|
2712
|
+
window.addEventListener('test', options, options);
|
|
2713
|
+
// @ts-ignore
|
|
2714
|
+
window.removeEventListener('test', options, options);
|
|
2715
|
+
}
|
|
2716
|
+
catch (err) {
|
|
2717
|
+
passiveSupported = false;
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
2721
|
+
|
|
2722
|
+
var alwaysContainsScroll = function (node) {
|
|
2723
|
+
// textarea will always _contain_ scroll inside self. It only can be hidden
|
|
2724
|
+
return node.tagName === 'TEXTAREA';
|
|
2725
|
+
};
|
|
2726
|
+
var elementCanBeScrolled = function (node, overflow) {
|
|
2727
|
+
var styles = window.getComputedStyle(node);
|
|
2728
|
+
return (
|
|
2729
|
+
// not-not-scrollable
|
|
2730
|
+
styles[overflow] !== 'hidden' &&
|
|
2731
|
+
// contains scroll inside self
|
|
2732
|
+
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
|
|
2733
|
+
};
|
|
2734
|
+
var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
|
|
2735
|
+
var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
|
|
2736
|
+
var locationCouldBeScrolled = function (axis, node) {
|
|
2737
|
+
var current = node;
|
|
2738
|
+
do {
|
|
2739
|
+
// Skip over shadow root
|
|
2740
|
+
if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
|
|
2741
|
+
current = current.host;
|
|
2742
|
+
}
|
|
2743
|
+
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
2744
|
+
if (isScrollable) {
|
|
2745
|
+
var _a = getScrollVariables(axis, current), s = _a[1], d = _a[2];
|
|
2746
|
+
if (s > d) {
|
|
2747
|
+
return true;
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
current = current.parentNode;
|
|
2751
|
+
} while (current && current !== document.body);
|
|
2752
|
+
return false;
|
|
2753
|
+
};
|
|
2754
|
+
var getVScrollVariables = function (_a) {
|
|
2755
|
+
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
2756
|
+
return [
|
|
2757
|
+
scrollTop,
|
|
2758
|
+
scrollHeight,
|
|
2759
|
+
clientHeight,
|
|
2760
|
+
];
|
|
2761
|
+
};
|
|
2762
|
+
var getHScrollVariables = function (_a) {
|
|
2763
|
+
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
2764
|
+
return [
|
|
2765
|
+
scrollLeft,
|
|
2766
|
+
scrollWidth,
|
|
2767
|
+
clientWidth,
|
|
2768
|
+
];
|
|
2769
|
+
};
|
|
2770
|
+
var elementCouldBeScrolled = function (axis, node) {
|
|
2771
|
+
return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
2772
|
+
};
|
|
2773
|
+
var getScrollVariables = function (axis, node) {
|
|
2774
|
+
return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
2775
|
+
};
|
|
2776
|
+
var getDirectionFactor = function (axis, direction) {
|
|
2777
|
+
/**
|
|
2778
|
+
* If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
|
|
2779
|
+
* and then increasingly negative as you scroll towards the end of the content.
|
|
2780
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
|
|
2781
|
+
*/
|
|
2782
|
+
return axis === 'h' && direction === 'rtl' ? -1 : 1;
|
|
2783
|
+
};
|
|
2784
|
+
var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
2785
|
+
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
2786
|
+
var delta = directionFactor * sourceDelta;
|
|
2787
|
+
// find scrollable target
|
|
2788
|
+
var target = event.target;
|
|
2789
|
+
var targetInLock = endTarget.contains(target);
|
|
2790
|
+
var shouldCancelScroll = false;
|
|
2791
|
+
var isDeltaPositive = delta > 0;
|
|
2792
|
+
var availableScroll = 0;
|
|
2793
|
+
var availableScrollTop = 0;
|
|
2794
|
+
do {
|
|
2795
|
+
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
2796
|
+
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
2797
|
+
if (position || elementScroll) {
|
|
2798
|
+
if (elementCouldBeScrolled(axis, target)) {
|
|
2799
|
+
availableScroll += elementScroll;
|
|
2800
|
+
availableScrollTop += position;
|
|
2801
|
+
}
|
|
2802
|
+
}
|
|
2803
|
+
target = target.parentNode;
|
|
2804
|
+
} while (
|
|
2805
|
+
// portaled content
|
|
2806
|
+
(!targetInLock && target !== document.body) ||
|
|
2807
|
+
// self content
|
|
2808
|
+
(targetInLock && (endTarget.contains(target) || endTarget === target)));
|
|
2809
|
+
if (isDeltaPositive && ((noOverscroll && availableScroll === 0) || (!noOverscroll && delta > availableScroll))) {
|
|
2810
|
+
shouldCancelScroll = true;
|
|
2811
|
+
}
|
|
2812
|
+
else if (!isDeltaPositive &&
|
|
2813
|
+
((noOverscroll && availableScrollTop === 0) || (!noOverscroll && -delta > availableScrollTop))) {
|
|
2814
|
+
shouldCancelScroll = true;
|
|
2815
|
+
}
|
|
2816
|
+
return shouldCancelScroll;
|
|
2817
|
+
};
|
|
2818
|
+
|
|
2819
|
+
var getTouchXY = function (event) {
|
|
2820
|
+
return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
|
|
2821
|
+
};
|
|
2822
|
+
var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };
|
|
2823
|
+
var extractRef = function (ref) {
|
|
2824
|
+
return ref && 'current' in ref ? ref.current : ref;
|
|
2825
|
+
};
|
|
2826
|
+
var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };
|
|
2827
|
+
var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); };
|
|
2828
|
+
var idCounter = 0;
|
|
2829
|
+
var lockStack = [];
|
|
2830
|
+
function RemoveScrollSideCar(props) {
|
|
2831
|
+
var shouldPreventQueue = React__namespace.useRef([]);
|
|
2832
|
+
var touchStartRef = React__namespace.useRef([0, 0]);
|
|
2833
|
+
var activeAxis = React__namespace.useRef();
|
|
2834
|
+
var id = React__namespace.useState(idCounter++)[0];
|
|
2835
|
+
var Style = React__namespace.useState(function () { return component.styleSingleton(); })[0];
|
|
2836
|
+
var lastProps = React__namespace.useRef(props);
|
|
2837
|
+
React__namespace.useEffect(function () {
|
|
2838
|
+
lastProps.current = props;
|
|
2839
|
+
}, [props]);
|
|
2840
|
+
React__namespace.useEffect(function () {
|
|
2841
|
+
if (props.inert) {
|
|
2842
|
+
document.body.classList.add("block-interactivity-".concat(id));
|
|
2843
|
+
var allow_1 = index$4.__spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
2844
|
+
allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); });
|
|
2845
|
+
return function () {
|
|
2846
|
+
document.body.classList.remove("block-interactivity-".concat(id));
|
|
2847
|
+
allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); });
|
|
2848
|
+
};
|
|
2849
|
+
}
|
|
2850
|
+
return;
|
|
2851
|
+
}, [props.inert, props.lockRef.current, props.shards]);
|
|
2852
|
+
var shouldCancelEvent = React__namespace.useCallback(function (event, parent) {
|
|
2853
|
+
if ('touches' in event && event.touches.length === 2) {
|
|
2854
|
+
return !lastProps.current.allowPinchZoom;
|
|
2855
|
+
}
|
|
2856
|
+
var touch = getTouchXY(event);
|
|
2857
|
+
var touchStart = touchStartRef.current;
|
|
2858
|
+
var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
|
|
2859
|
+
var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
|
|
2860
|
+
var currentAxis;
|
|
2861
|
+
var target = event.target;
|
|
2862
|
+
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
|
|
2863
|
+
// allow horizontal touch move on Range inputs. They will not cause any scroll
|
|
2864
|
+
if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
|
|
2865
|
+
return false;
|
|
2866
|
+
}
|
|
2867
|
+
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
2868
|
+
if (!canBeScrolledInMainDirection) {
|
|
2869
|
+
return true;
|
|
2870
|
+
}
|
|
2871
|
+
if (canBeScrolledInMainDirection) {
|
|
2872
|
+
currentAxis = moveDirection;
|
|
2873
|
+
}
|
|
2874
|
+
else {
|
|
2875
|
+
currentAxis = moveDirection === 'v' ? 'h' : 'v';
|
|
2876
|
+
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
2877
|
+
// other axis might be not scrollable
|
|
2878
|
+
}
|
|
2879
|
+
if (!canBeScrolledInMainDirection) {
|
|
2880
|
+
return false;
|
|
2881
|
+
}
|
|
2882
|
+
if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
|
|
2883
|
+
activeAxis.current = currentAxis;
|
|
2884
|
+
}
|
|
2885
|
+
if (!currentAxis) {
|
|
2886
|
+
return true;
|
|
2887
|
+
}
|
|
2888
|
+
var cancelingAxis = activeAxis.current || currentAxis;
|
|
2889
|
+
return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);
|
|
2890
|
+
}, []);
|
|
2891
|
+
var shouldPrevent = React__namespace.useCallback(function (_event) {
|
|
2892
|
+
var event = _event;
|
|
2893
|
+
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
|
|
2894
|
+
// not the last active
|
|
2895
|
+
return;
|
|
2896
|
+
}
|
|
2897
|
+
var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
|
|
2898
|
+
var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); })[0];
|
|
2899
|
+
// self event, and should be canceled
|
|
2900
|
+
if (sourceEvent && sourceEvent.should) {
|
|
2901
|
+
if (event.cancelable) {
|
|
2902
|
+
event.preventDefault();
|
|
2903
|
+
}
|
|
2904
|
+
return;
|
|
2905
|
+
}
|
|
2906
|
+
// outside or shard event
|
|
2907
|
+
if (!sourceEvent) {
|
|
2908
|
+
var shardNodes = (lastProps.current.shards || [])
|
|
2909
|
+
.map(extractRef)
|
|
2910
|
+
.filter(Boolean)
|
|
2911
|
+
.filter(function (node) { return node.contains(event.target); });
|
|
2912
|
+
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
|
|
2913
|
+
if (shouldStop) {
|
|
2914
|
+
if (event.cancelable) {
|
|
2915
|
+
event.preventDefault();
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
}, []);
|
|
2920
|
+
var shouldCancel = React__namespace.useCallback(function (name, delta, target, should) {
|
|
2921
|
+
var event = { name: name, delta: delta, target: target, should: should };
|
|
2922
|
+
shouldPreventQueue.current.push(event);
|
|
2923
|
+
setTimeout(function () {
|
|
2924
|
+
shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
|
|
2925
|
+
}, 1);
|
|
2926
|
+
}, []);
|
|
2927
|
+
var scrollTouchStart = React__namespace.useCallback(function (event) {
|
|
2928
|
+
touchStartRef.current = getTouchXY(event);
|
|
2929
|
+
activeAxis.current = undefined;
|
|
2930
|
+
}, []);
|
|
2931
|
+
var scrollWheel = React__namespace.useCallback(function (event) {
|
|
2932
|
+
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
2933
|
+
}, []);
|
|
2934
|
+
var scrollTouchMove = React__namespace.useCallback(function (event) {
|
|
2935
|
+
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
2936
|
+
}, []);
|
|
2937
|
+
React__namespace.useEffect(function () {
|
|
2938
|
+
lockStack.push(Style);
|
|
2939
|
+
props.setCallbacks({
|
|
2940
|
+
onScrollCapture: scrollWheel,
|
|
2941
|
+
onWheelCapture: scrollWheel,
|
|
2942
|
+
onTouchMoveCapture: scrollTouchMove,
|
|
2943
|
+
});
|
|
2944
|
+
document.addEventListener('wheel', shouldPrevent, nonPassive);
|
|
2945
|
+
document.addEventListener('touchmove', shouldPrevent, nonPassive);
|
|
2946
|
+
document.addEventListener('touchstart', scrollTouchStart, nonPassive);
|
|
2947
|
+
return function () {
|
|
2948
|
+
lockStack = lockStack.filter(function (inst) { return inst !== Style; });
|
|
2949
|
+
document.removeEventListener('wheel', shouldPrevent, nonPassive);
|
|
2950
|
+
document.removeEventListener('touchmove', shouldPrevent, nonPassive);
|
|
2951
|
+
document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
|
|
2952
|
+
};
|
|
2953
|
+
}, []);
|
|
2954
|
+
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
2955
|
+
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
2956
|
+
inert ? React__namespace.createElement(Style, { styles: generateStyle(id) }) : null,
|
|
2957
|
+
removeScrollBar ? React__namespace.createElement(component.RemoveScrollBar, { gapMode: "margin" }) : null));
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
var SideCar = component.exportSidecar(effectCar, RemoveScrollSideCar);
|
|
2961
|
+
|
|
2962
|
+
var ReactRemoveScroll = React__namespace.forwardRef(function (props, ref) { return (React__namespace.createElement(RemoveScroll, index$4.__assign({}, props, { ref: ref, sideCar: SideCar }))); });
|
|
2963
|
+
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
2964
|
+
var $01b9c$RemoveScroll = ReactRemoveScroll;
|
|
2965
|
+
|
|
2966
|
+
exports.$01b9c$RemoveScroll = $01b9c$RemoveScroll;
|
|
2967
|
+
exports.$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c = $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c;
|
|
2968
|
+
exports.$5cb92bef7577960e$export$177fb62ff3ec1f22 = $5cb92bef7577960e$export$177fb62ff3ec1f22;
|
|
2177
2969
|
exports.$cf1ac5d9fe0e8206$export$722aac194ae923 = $cf1ac5d9fe0e8206$export$722aac194ae923;
|
|
2178
2970
|
exports.$cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2;
|
|
2179
2971
|
exports.$cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$b688253958b8dfe7;
|
|
2180
2972
|
exports.$cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9;
|
|
2973
|
+
exports.$d3863c46a17e8a28$export$20e40289641fbbb6 = $d3863c46a17e8a28$export$20e40289641fbbb6;
|
|
2974
|
+
exports.$f1701beae083dbae$export$602eac185826482c = $f1701beae083dbae$export$602eac185826482c;
|