@arc-ui/components 12.0.0-beta.5 → 12.0.0-beta.6
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 +9 -10
- package/dist/Alert/Alert.esm.js +4 -5
- package/dist/Alert/styles.css +1 -0
- package/dist/Align/Align.cjs.js +7 -8
- package/dist/Align/Align.esm.js +1 -2
- package/dist/Align/styles.css +1 -0
- package/dist/AppButton/AppButton.cjs.js +4 -3
- package/dist/AppButton/AppButton.esm.js +4 -3
- package/dist/AppButton/styles.css +1 -0
- package/dist/Avatar/Avatar.cjs.js +7 -8
- package/dist/Avatar/Avatar.esm.js +7 -8
- package/dist/Avatar/styles.css +1 -0
- package/dist/AvatarGroup/AvatarGroup.cjs.js +14 -15
- package/dist/AvatarGroup/AvatarGroup.esm.js +7 -8
- package/dist/AvatarGroup/styles.css +1 -0
- package/dist/Badge/Badge.cjs.js +4 -5
- package/dist/Badge/Badge.esm.js +1 -2
- package/dist/Badge/styles.css +1 -0
- package/dist/Box/Box.cjs.js +6 -6
- package/dist/Box/Box.esm.js +2 -2
- package/dist/Box/styles.css +1 -0
- package/dist/BrandLogo/BrandLogo.cjs.js +3 -4
- package/dist/BrandLogo/BrandLogo.esm.js +3 -4
- package/dist/BrandLogo/styles.css +1 -0
- package/dist/Breadcrumbs/Breadcrumbs.cjs.js +4 -5
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +4 -5
- package/dist/Breadcrumbs/styles.css +1 -0
- package/dist/Button/Button.cjs.js +5 -6
- package/dist/Button/Button.esm.js +5 -6
- package/dist/Button/styles.css +1 -0
- package/dist/ButtonV2/ButtonV2.cjs.js +4 -5
- package/dist/ButtonV2/ButtonV2.esm.js +4 -5
- package/dist/ButtonV2/styles.css +1 -0
- package/dist/Calendar/Calendar.cjs.js +9 -10
- package/dist/Calendar/Calendar.esm.js +9 -10
- package/dist/Calendar/styles.css +1 -0
- package/dist/CardFooter/CardFooter.cjs.js +17 -0
- package/dist/CardFooter/CardFooter.esm.js +9 -0
- package/dist/CardFooter/package.json +7 -0
- package/dist/CardFooter/styles.css +1 -0
- package/dist/CardHeading/CardHeading.cjs.js +14 -0
- package/dist/CardHeading/CardHeading.esm.js +6 -0
- package/dist/CardHeading/package.json +7 -0
- package/dist/CardHeading/styles.css +1 -0
- package/dist/Checkbox/Checkbox.cjs.js +8 -9
- package/dist/Checkbox/Checkbox.esm.js +8 -9
- package/dist/Checkbox/styles.css +1 -0
- package/dist/Columns/Columns.cjs.js +2 -3
- package/dist/Columns/Columns.esm.js +2 -3
- package/dist/Columns/styles.css +1 -0
- package/dist/ConditionalWrapper/ConditionalWrapper.cjs.js +10 -0
- package/dist/ConditionalWrapper/ConditionalWrapper.esm.js +2 -0
- package/dist/ConditionalWrapper/package.json +7 -0
- package/dist/DatePicker/DatePicker.cjs.js +18 -22
- package/dist/DatePicker/DatePicker.esm.js +18 -22
- package/dist/DatePicker/styles.css +1 -0
- package/dist/Disclosure/Disclosure.cjs.js +8 -9
- package/dist/Disclosure/Disclosure.esm.js +4 -5
- package/dist/Disclosure/styles.css +1 -0
- package/dist/DisclosureMini/DisclosureMini.cjs.js +5 -6
- package/dist/DisclosureMini/DisclosureMini.esm.js +5 -6
- package/dist/DisclosureMini/styles.css +1 -0
- package/dist/Elevation/Elevation.cjs.js +5 -5
- package/dist/Elevation/Elevation.esm.js +1 -1
- package/dist/Elevation/styles.css +1 -0
- package/dist/Filter/Filter.cjs.js +4 -4
- package/dist/Filter/Filter.esm.js +4 -4
- package/dist/Filter/styles.css +1 -0
- package/dist/FormControl/FormControl.cjs.js +7 -8
- package/dist/FormControl/FormControl.esm.js +7 -8
- package/dist/FormControl/styles.css +1 -0
- package/dist/Grid/Grid.cjs.js +2 -3
- package/dist/Grid/Grid.esm.js +2 -3
- package/dist/Grid/styles.css +1 -0
- package/dist/Group/Group.cjs.js +3 -3
- package/dist/Group/Group.esm.js +3 -3
- package/dist/Group/styles.css +1 -0
- package/dist/Heading/Heading.cjs.js +3 -4
- package/dist/Heading/Heading.esm.js +3 -4
- package/dist/Heading/styles.css +1 -0
- package/dist/HeroButton/HeroButton.cjs.js +4 -5
- package/dist/HeroButton/HeroButton.esm.js +4 -5
- package/dist/HeroButton/styles.css +1 -0
- package/dist/Hidden/Hidden.cjs.js +5 -5
- package/dist/Hidden/Hidden.esm.js +1 -1
- package/dist/Hidden/styles.css +1 -0
- package/dist/Icon/Icon.cjs.js +3 -4
- package/dist/Icon/Icon.esm.js +3 -4
- package/dist/Icon/styles.css +1 -0
- package/dist/Image/Image.cjs.js +2 -3
- package/dist/Image/Image.esm.js +2 -3
- package/dist/Image/styles.css +1 -0
- package/dist/ImpactCard/ImpactCard.cjs.js +15 -15
- package/dist/ImpactCard/ImpactCard.esm.js +9 -9
- package/dist/ImpactCard/styles.css +1 -0
- package/dist/InformationCard/InformationCard.cjs.js +25 -25
- package/dist/InformationCard/InformationCard.esm.js +13 -13
- package/dist/InformationCard/styles.css +1 -0
- package/dist/Link/Link.cjs.js +11 -12
- package/dist/Link/Link.esm.js +4 -5
- package/dist/Link/styles.css +1 -0
- package/dist/Markup/Markup.cjs.js +6 -6
- package/dist/Markup/Markup.esm.js +2 -2
- package/dist/Markup/styles.css +1 -0
- package/dist/MediaCard/MediaCard.cjs.js +14 -14
- package/dist/MediaCard/MediaCard.esm.js +14 -14
- package/dist/MediaCard/styles.css +1 -0
- package/dist/Modal/Modal.cjs.js +43 -1200
- package/dist/Modal/Modal.esm.js +12 -1168
- package/dist/Modal/styles.css +1 -0
- package/dist/Pagination/Pagination.cjs.js +12 -13
- package/dist/Pagination/Pagination.esm.js +3 -4
- package/dist/Pagination/styles.css +1 -0
- package/dist/PaginationSimple/PaginationSimple.cjs.js +9 -10
- package/dist/PaginationSimple/PaginationSimple.esm.js +3 -4
- package/dist/PaginationSimple/styles.css +1 -0
- package/dist/Poster/Poster.cjs.js +4 -5
- package/dist/Poster/Poster.esm.js +4 -5
- package/dist/Poster/styles.css +1 -0
- package/dist/ProgressBar/ProgressBar.cjs.js +12 -13
- package/dist/ProgressBar/ProgressBar.esm.js +6 -7
- package/dist/ProgressBar/styles.css +1 -0
- package/dist/ProgressStepper/ProgressStepper.cjs.js +5 -6
- package/dist/ProgressStepper/ProgressStepper.esm.js +5 -6
- package/dist/ProgressStepper/styles.css +1 -0
- package/dist/RadioGroup/RadioGroup.cjs.js +8 -9
- package/dist/RadioGroup/RadioGroup.esm.js +8 -9
- package/dist/RadioGroup/styles.css +1 -0
- package/dist/Rule/Rule.cjs.js +5 -5
- package/dist/Rule/Rule.esm.js +2 -2
- package/dist/Rule/styles.css +1 -0
- package/dist/ScrollToTop/ScrollToTop.cjs.js +8 -9
- package/dist/ScrollToTop/ScrollToTop.esm.js +3 -4
- package/dist/ScrollToTop/styles.css +1 -0
- package/dist/Section/Section.cjs.js +2 -2
- package/dist/Section/Section.esm.js +2 -2
- package/dist/Section/styles.css +1 -0
- package/dist/Select/Select.cjs.js +1165 -91
- package/dist/Select/Select.esm.js +1076 -21
- package/dist/Select/styles.css +1 -0
- package/dist/SiteFooter/SiteFooter.cjs.js +7 -8
- package/dist/SiteFooter/SiteFooter.esm.js +7 -8
- package/dist/SiteFooter/styles.css +1 -0
- package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +10 -12
- package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +10 -12
- package/dist/SiteHeaderV2/styles.css +1 -0
- package/dist/SkipLink/SkipLink.cjs.js +4 -4
- package/dist/SkipLink/SkipLink.esm.js +3 -3
- package/dist/SkipLink/styles.css +1 -0
- package/dist/Surface/Surface.cjs.js +2 -2
- package/dist/Surface/Surface.esm.js +2 -2
- package/dist/Surface/styles.css +1 -0
- package/dist/Switch/Switch.cjs.js +16 -18
- package/dist/Switch/Switch.esm.js +12 -14
- package/dist/Switch/styles.css +1 -0
- package/dist/Tabs/Tabs.cjs.js +9 -11
- package/dist/Tabs/Tabs.esm.js +9 -11
- package/dist/Tabs/styles.css +1 -0
- package/dist/Tag/Tag.cjs.js +5 -6
- package/dist/Tag/Tag.esm.js +5 -6
- package/dist/Tag/styles.css +1 -0
- package/dist/Text/Text.cjs.js +3 -4
- package/dist/Text/Text.esm.js +3 -4
- package/dist/Text/styles.css +1 -0
- package/dist/TextArea/TextArea.cjs.js +55 -56
- package/dist/TextArea/TextArea.esm.js +51 -52
- package/dist/TextArea/styles.css +1 -0
- package/dist/TextInput/TextInput.cjs.js +9 -10
- package/dist/TextInput/TextInput.esm.js +9 -10
- package/dist/TextInput/styles.css +1 -0
- package/dist/Theme/Theme.cjs.js +5 -5
- package/dist/Theme/Theme.esm.js +1 -1
- package/dist/Theme/styles.css +1 -0
- package/dist/ThemeIcon/ThemeIcon.cjs.js +3 -4
- package/dist/ThemeIcon/ThemeIcon.esm.js +3 -4
- package/dist/ThemeIcon/styles.css +1 -0
- package/dist/Toast/Toast.cjs.js +8 -10
- package/dist/Toast/Toast.esm.js +8 -10
- package/dist/Toast/styles.css +1 -0
- package/dist/Truncate/Truncate.cjs.js +3 -3
- package/dist/Truncate/Truncate.esm.js +1 -1
- package/dist/Truncate/styles.css +1 -0
- package/dist/TypographyCard/TypographyCard.cjs.js +13 -13
- package/dist/TypographyCard/TypographyCard.esm.js +8 -8
- package/dist/TypographyCard/styles.css +1 -0
- package/dist/UniversalHeader/UniversalHeader.cjs.js +3 -3
- package/dist/UniversalHeader/UniversalHeader.esm.js +3 -3
- package/dist/UniversalHeader/styles.css +1 -0
- package/dist/VerticalSpace/VerticalSpace.cjs.js +2 -2
- package/dist/VerticalSpace/VerticalSpace.esm.js +2 -2
- package/dist/VerticalSpace/styles.css +1 -0
- package/dist/VideoPlayer/VideoPlayer.cjs.js +11 -12
- package/dist/VideoPlayer/VideoPlayer.esm.js +8 -9
- package/dist/VideoPlayer/styles.css +1 -0
- package/dist/Visible/Visible.cjs.js +5 -5
- package/dist/Visible/Visible.esm.js +1 -1
- package/dist/Visible/styles.css +1 -0
- package/dist/VisuallyHidden/VisuallyHidden.cjs.js +2 -1
- package/dist/VisuallyHidden/VisuallyHidden.esm.js +2 -1
- package/dist/VisuallyHidden/styles.css +1 -0
- package/dist/_shared/cjs/{Avatar-fc0d9b8b.js → Avatar-9277512a.js} +11 -12
- package/dist/_shared/cjs/{BrandLogo-1d2ca2c7.js → BrandLogo-ce65cd74.js} +7 -8
- package/dist/_shared/cjs/{Breadcrumbs-7af0af2c.js → Breadcrumbs-c7821aa9.js} +12 -12
- package/dist/_shared/cjs/{BtIconArrowRight.esm-5989f2ca.js → BtIconArrowRight.esm-6053bb79.js} +0 -8
- package/dist/_shared/cjs/{Button-7d891a89.js → Button-ea665c9c.js} +12 -13
- package/dist/_shared/cjs/{ButtonV2-b2db3f46.js → ButtonV2-373877da.js} +11 -11
- package/dist/_shared/cjs/{Calendar-649cc139.js → Calendar-e5184158.js} +912 -912
- package/dist/_shared/cjs/{CardFooter-5414bc4f.js → CardFooter-a1bb3ded.js} +3 -3
- package/dist/_shared/cjs/CardHeading-3ddcf774.js +16 -0
- package/dist/_shared/cjs/{Checkbox-0e423653.js → Checkbox-850dcf99.js} +11 -11
- package/dist/_shared/cjs/{Columns-1224bdff.js → Columns-5c6bab74.js} +9 -10
- package/dist/_shared/cjs/Combination-854a36ce.js +1203 -0
- package/dist/_shared/cjs/DatePicker-2bf10a10.js +956 -0
- package/dist/_shared/cjs/{DisclosureMini-c01ecce0.js → DisclosureMini-c730c24d.js} +10 -10
- package/dist/_shared/cjs/{Filter-3b897d92.js → Filter-c42eee70.js} +14 -14
- package/dist/_shared/cjs/{FormControl-88d48f42.js → FormControl-5c963e6e.js} +12 -12
- package/dist/_shared/cjs/{Grid-9e91fb3d.js → Grid-69ed0e5c.js} +10 -11
- package/dist/_shared/cjs/{Group-3d5ea240.js → Group-5233a907.js} +9 -9
- package/dist/_shared/cjs/{Heading-fb63844f.js → Heading-14378b72.js} +7 -8
- package/dist/_shared/cjs/{HeroButton-0586a7c4.js → HeroButton-db7d03d6.js} +11 -11
- package/dist/_shared/cjs/{Icon-0ec0c1fb.js → Icon-7f1e8a19.js} +8 -9
- package/dist/_shared/cjs/{Image-e9a5a326.js → Image-c8969ad9.js} +9 -10
- package/dist/_shared/cjs/{MediaCard-8f41b411.js → MediaCard-4ff9f5c0.js} +18 -18
- package/dist/_shared/cjs/{Poster-b7242b37.js → Poster-8fba5492.js} +13 -14
- package/dist/_shared/cjs/{ProgressStepper-fb8405c2.js → ProgressStepper-aaff6b51.js} +13 -13
- package/dist/_shared/cjs/{RadioGroup-a4186267.js → RadioGroup-6142dceb.js} +14 -14
- package/dist/_shared/cjs/{Section-ecfc659b.js → Section-46646353.js} +5 -5
- package/dist/_shared/cjs/{SiteFooter-7c4072b5.js → SiteFooter-cfe7163f.js} +11 -11
- package/dist/_shared/cjs/{SiteHeaderV2-94687999.js → SiteHeaderV2-043d976a.js} +63 -65
- package/dist/_shared/cjs/Surface-7500f314.js +174 -0
- package/dist/_shared/cjs/{Tabs-75c34f43.js → Tabs-bd1f208d.js} +24 -25
- package/dist/_shared/cjs/{Tag-452048f6.js → Tag-4eb2ed9e.js} +8 -8
- package/dist/_shared/cjs/{Text-1c1110a4.js → Text-284a7314.js} +7 -8
- package/dist/_shared/cjs/{TextInput-762e2309.js → TextInput-bcc3f86c.js} +12 -12
- package/dist/_shared/cjs/{ThemeIcon-ee814862.js → ThemeIcon-c3dc056d.js} +8 -9
- package/dist/_shared/cjs/{Toast-d06a89e0.js → Toast-69020185.js} +16 -17
- package/dist/_shared/cjs/{UniversalHeader-f6d9c63a.js → UniversalHeader-07be88fd.js} +6 -6
- package/dist/_shared/cjs/{VerticalSpace-e128ec68.js → VerticalSpace-973deefe.js} +5 -5
- package/dist/_shared/cjs/{VisuallyHidden-b0de4c7b.js → VisuallyHidden-25393f58.js} +3 -2
- package/dist/_shared/cjs/{component-df82bc05.js → component-4e71e3d3.js} +4 -4
- package/dist/_shared/cjs/{Combination-3a639f6d.js → floating-ui.react-dom-08b8b87c.js} +37 -1103
- package/dist/_shared/cjs/{index-7aa7f96a.js → index-568bc1da.js} +8 -1
- package/dist/_shared/cjs/{index-0c6319ec.js → index-677557a4.js} +1 -1
- package/dist/_shared/cjs/{index-3d629205.js → index-6cbaf5e0.js} +19 -1
- package/dist/_shared/cjs/{index-41b09e85.js → index-c137700a.js} +20 -1
- package/dist/_shared/cjs/{index-996dec94.js → index-dbab0ad6.js} +1 -1
- package/dist/_shared/cjs/{index.es-16759329.js → index.es-ba095ee5.js} +1 -1
- package/dist/_shared/cjs/{index-df60851b.js → index.es-c26e8978.js} +20 -6
- package/dist/_shared/esm/{Avatar-38cc0595.js → Avatar-b5ac0a89.js} +5 -6
- package/dist/_shared/esm/{BrandLogo-7ed8aeda.js → BrandLogo-fb863b5b.js} +2 -3
- package/dist/_shared/esm/{Breadcrumbs-9078b68e.js → Breadcrumbs-01ebed9b.js} +8 -8
- package/dist/_shared/esm/BtIconArrowRight.esm-93da96bb.js +24 -0
- package/dist/_shared/esm/{Button-dde2b46a.js → Button-1491784f.js} +4 -5
- package/dist/_shared/esm/{ButtonV2-49cd0615.js → ButtonV2-f9019e00.js} +3 -3
- package/dist/_shared/esm/{Calendar-60591442.js → Calendar-5c2fb044.js} +889 -889
- package/dist/_shared/esm/{CardFooter-c79fb2db.js → CardFooter-e4380cda.js} +3 -3
- package/dist/_shared/esm/CardHeading-4223432d.js +10 -0
- package/dist/_shared/esm/{Checkbox-0baca464.js → Checkbox-97def257.js} +5 -5
- package/dist/_shared/esm/{Columns-6a8f6fbb.js → Columns-9aa5df4a.js} +1 -2
- package/dist/_shared/esm/Combination-2af75870.js +1163 -0
- package/dist/_shared/esm/DatePicker-2d891441.js +927 -0
- package/dist/_shared/esm/{DisclosureMini-38f4c459.js → DisclosureMini-6292f721.js} +4 -4
- package/dist/_shared/esm/{Filter-49dcf5ce.js → Filter-71e06965.js} +11 -11
- package/dist/_shared/esm/{FormControl-d873f7fa.js → FormControl-e0acdf7a.js} +5 -5
- package/dist/_shared/esm/{Grid-fb9fc522.js → Grid-727d05d6.js} +1 -2
- package/dist/_shared/esm/{Group-66196f07.js → Group-b1b14ab4.js} +2 -2
- package/dist/_shared/esm/{Heading-906c7c7c.js → Heading-0dfbdb24.js} +2 -3
- package/dist/_shared/esm/{HeroButton-7ea692bf.js → HeroButton-bb983125.js} +3 -3
- package/dist/_shared/esm/{Icon-512f834f.js → Icon-428e8061.js} +2 -3
- package/dist/_shared/esm/{Image-57d08939.js → Image-c1dc10b5.js} +1 -2
- package/dist/_shared/esm/{MediaCard-c12d89ea.js → MediaCard-d83b5561.js} +10 -10
- package/dist/_shared/esm/{Poster-e05a8b45.js → Poster-ac72059a.js} +4 -5
- package/dist/_shared/esm/{ProgressStepper-189ed0f9.js → ProgressStepper-e3e7b392.js} +4 -4
- package/dist/_shared/esm/{RadioGroup-8ff17cbb.js → RadioGroup-0d337240.js} +7 -7
- package/dist/_shared/esm/{Section-1acbc06a.js → Section-c1dc6e37.js} +1 -1
- package/dist/_shared/esm/{SiteFooter-b65497e8.js → SiteFooter-7e924fb4.js} +6 -6
- package/dist/_shared/esm/{SiteHeaderV2-784b3bf8.js → SiteHeaderV2-94b9a407.js} +9 -11
- package/dist/_shared/esm/Surface-c425e5e6.js +164 -0
- package/dist/_shared/esm/{Tabs-21ac7dfe.js → Tabs-028cee5d.js} +10 -11
- package/dist/_shared/esm/{Tag-2513c185.js → Tag-1ae027ee.js} +4 -4
- package/dist/_shared/esm/{Text-a46fb76b.js → Text-96d8a35f.js} +2 -3
- package/dist/_shared/esm/{TextInput-94c7b1a4.js → TextInput-8e3b81bf.js} +5 -5
- package/dist/_shared/esm/{ThemeIcon-c2dc41a6.js → ThemeIcon-9fac63d0.js} +2 -3
- package/dist/_shared/esm/{Toast-de6ca2f3.js → Toast-ebe2cd97.js} +6 -7
- package/dist/_shared/esm/{UniversalHeader-456ad60c.js → UniversalHeader-22ff848b.js} +3 -3
- package/dist/_shared/esm/{VerticalSpace-b07cd8e6.js → VerticalSpace-6a3533db.js} +1 -1
- package/dist/_shared/esm/VisuallyHidden-cf45ac18.js +12 -0
- package/dist/_shared/esm/{component-d0a555cf.js → component-3e60a45e.js} +1 -1
- package/dist/_shared/esm/{Combination-ae3a3f08.js → floating-ui.react-dom-1bb71aae.js} +15 -1079
- package/dist/_shared/esm/{index-cace3545.js → index-3a2c1ceb.js} +25 -25
- package/dist/_shared/esm/{index-f97466e9.js → index-61497bd9.js} +1 -1
- package/dist/_shared/esm/{index-605031ca.js → index-ce6dee84.js} +53 -53
- package/dist/_shared/esm/{index-4e58de24.js → index-cf208294.js} +21 -3
- package/dist/_shared/esm/{index-fa93ec97.js → index-d083425f.js} +1 -1
- package/dist/_shared/esm/index-f6cc48d2.js +41 -0
- package/dist/_shared/esm/{index-7740883c.js → index-fb8b9df7.js} +9 -2
- package/dist/_shared/esm/{index-288c66b5.js → index.es-5496ec12.js} +20 -6
- package/dist/_shared/esm/{index.es-1b6d33c2.js → index.es-974af4a2.js} +1 -1
- package/dist/index.es.js +8433 -7929
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +8417 -7913
- package/dist/index.js.map +1 -1
- package/dist/styles.css +3 -3
- package/dist/types/components/CardHeading/index.d.ts +1 -0
- package/dist/types/components/ImpactCard/ImpactCard.d.ts +2 -2
- package/dist/types/components/MediaCard/MediaCard.d.ts +1 -1
- package/dist/types/components/Switch/Switch.d.ts +4 -0
- package/dist/types/components/TypographyCard/TypographyCard.d.ts +2 -2
- package/dist/types/helpers/index.d.ts +0 -2
- package/dist/types/styles.d.ts +3 -3
- package/package.json +17 -12
- package/dist/_shared/cjs/DatePicker-2417e55b.js +0 -550
- package/dist/_shared/cjs/Surface-8599dbe4.js +0 -57
- package/dist/_shared/cjs/index-039a9d35.js +0 -23
- package/dist/_shared/cjs/index-28447df0.js +0 -23
- package/dist/_shared/cjs/index-dcfdd5da.js +0 -11
- package/dist/_shared/cjs/suffix-modifier-c8a34402.js +0 -19
- package/dist/_shared/esm/BtIconArrowRight.esm-6a17d0ce.js +0 -31
- package/dist/_shared/esm/DatePicker-c7bb178e.js +0 -539
- package/dist/_shared/esm/Surface-71d21a9e.js +0 -48
- package/dist/_shared/esm/VisuallyHidden-06692fd3.js +0 -11
- package/dist/_shared/esm/index-5113ed53.js +0 -24
- package/dist/_shared/esm/index-6028d797.js +0 -21
- package/dist/_shared/esm/index-69089474.js +0 -21
- package/dist/_shared/esm/index-a624de47.js +0 -9
- package/dist/_shared/esm/suffix-modifier-1ce05abe.js +0 -17
- package/dist/types/helpers/filter-data-attrs.d.ts +0 -1
- package/dist/types/helpers/suffix-modifier.d.ts +0 -9
- package/dist/types/private-components/CardHeading/index.d.ts +0 -1
- package/dist/types/private-components/index.d.ts +0 -3
- package/dist/_shared/cjs/{ConditionalWrapper-be3b2625.js → ConditionalWrapper-bf944594.js} +0 -0
- package/dist/_shared/cjs/{index-7e31a45b.js → index-28fbfd5b.js} +52 -52
- package/dist/_shared/cjs/{index-3dd54df1.js → index-6f33b8c0.js} +23 -23
- /package/dist/_shared/esm/{ConditionalWrapper-59be8f35.js → ConditionalWrapper-b85979de.js} +0 -0
- /package/dist/types/{private-components → components}/CardFooter/CardFooter.d.ts +0 -0
- /package/dist/types/{private-components → components}/CardFooter/index.d.ts +0 -0
- /package/dist/types/{private-components → components}/CardHeading/CardHeading.d.ts +0 -0
- /package/dist/types/{private-components → components}/ConditionalWrapper/ConditionalWrapper.d.ts +0 -0
- /package/dist/types/{private-components → components}/ConditionalWrapper/index.d.ts +0 -0
|
@@ -2,36 +2,1110 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var index$
|
|
5
|
+
var index_es = require('../_shared/cjs/index.es-c26e8978.js');
|
|
6
|
+
var index$5 = require('../_shared/cjs/index-9947ac13.js');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var index
|
|
8
|
+
var index = require('../_shared/cjs/index-6f33b8c0.js');
|
|
9
9
|
var ReactDOM = require('react-dom');
|
|
10
|
-
var index = require('../_shared/cjs/index-
|
|
11
|
-
var index$
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var index$
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
require('../_shared/cjs/
|
|
21
|
-
require('../_shared/cjs/
|
|
22
|
-
require('../_shared/cjs/DisclosureMini-c01ecce0.js');
|
|
23
|
-
require('../_shared/cjs/Text-1c1110a4.js');
|
|
24
|
-
require('../_shared/cjs/suffix-modifier-c8a34402.js');
|
|
25
|
-
require('../_shared/cjs/VisuallyHidden-b0de4c7b.js');
|
|
10
|
+
var index$3 = require('../_shared/cjs/index-677557a4.js');
|
|
11
|
+
var index$4 = require('../_shared/cjs/index-568bc1da.js');
|
|
12
|
+
var index$1 = require('../_shared/cjs/index-6cbaf5e0.js');
|
|
13
|
+
var floatingUi_reactDom = require('../_shared/cjs/floating-ui.react-dom-08b8b87c.js');
|
|
14
|
+
var index$2 = require('../_shared/cjs/index-c137700a.js');
|
|
15
|
+
var component = require('../_shared/cjs/component-4e71e3d3.js');
|
|
16
|
+
var FormControl = require('../_shared/cjs/FormControl-5c963e6e.js');
|
|
17
|
+
var Surface = require('../_shared/cjs/Surface-7500f314.js');
|
|
18
|
+
var ThemeIcon = require('../_shared/cjs/ThemeIcon-c3dc056d.js');
|
|
19
|
+
require('../_shared/cjs/DisclosureMini-c730c24d.js');
|
|
20
|
+
require('../_shared/cjs/Text-284a7314.js');
|
|
21
|
+
require('../_shared/cjs/VisuallyHidden-25393f58.js');
|
|
26
22
|
|
|
27
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
24
|
|
|
25
|
+
function _interopNamespace(e) {
|
|
26
|
+
if (e && e.__esModule) return e;
|
|
27
|
+
var n = Object.create(null);
|
|
28
|
+
if (e) {
|
|
29
|
+
Object.keys(e).forEach(function (k) {
|
|
30
|
+
if (k !== 'default') {
|
|
31
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
32
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () { return e[k]; }
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
n["default"] = e;
|
|
40
|
+
return Object.freeze(n);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
29
44
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
45
|
+
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
30
46
|
|
|
31
47
|
function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(value, [min, max]) {
|
|
32
48
|
return Math.min(max, Math.max(min, value));
|
|
33
49
|
}
|
|
34
50
|
|
|
51
|
+
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
52
|
+
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
53
|
+
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
54
|
+
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
55
|
+
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ React.createContext({
|
|
56
|
+
layers: new Set(),
|
|
57
|
+
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
58
|
+
branches: new Set()
|
|
59
|
+
});
|
|
60
|
+
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
61
|
+
var _node$ownerDocument;
|
|
62
|
+
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
63
|
+
const context = React.useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
64
|
+
const [node1, setNode] = React.useState(null);
|
|
65
|
+
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;
|
|
66
|
+
const [, force] = React.useState({});
|
|
67
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
68
|
+
);
|
|
69
|
+
const layers = Array.from(context.layers);
|
|
70
|
+
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
71
|
+
...context.layersWithOutsidePointerEventsDisabled
|
|
72
|
+
].slice(-1); // prettier-ignore
|
|
73
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
|
|
74
|
+
const index$2 = node1 ? layers.indexOf(node1) : -1;
|
|
75
|
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
76
|
+
const isPointerEventsEnabled = index$2 >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
77
|
+
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
78
|
+
const target = event.target;
|
|
79
|
+
const isPointerDownOnBranch = [
|
|
80
|
+
...context.branches
|
|
81
|
+
].some((branch)=>branch.contains(target)
|
|
82
|
+
);
|
|
83
|
+
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
84
|
+
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
85
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
86
|
+
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
87
|
+
}, ownerDocument);
|
|
88
|
+
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
89
|
+
const target = event.target;
|
|
90
|
+
const isFocusInBranch = [
|
|
91
|
+
...context.branches
|
|
92
|
+
].some((branch)=>branch.contains(target)
|
|
93
|
+
);
|
|
94
|
+
if (isFocusInBranch) return;
|
|
95
|
+
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
|
|
96
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
97
|
+
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
98
|
+
}, ownerDocument);
|
|
99
|
+
index$1.$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
100
|
+
const isHighestLayer = index$2 === context.layers.size - 1;
|
|
101
|
+
if (!isHighestLayer) return;
|
|
102
|
+
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
103
|
+
if (!event.defaultPrevented && onDismiss) {
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
onDismiss();
|
|
106
|
+
}
|
|
107
|
+
}, ownerDocument);
|
|
108
|
+
React.useEffect(()=>{
|
|
109
|
+
if (!node1) return;
|
|
110
|
+
if (disableOutsidePointerEvents) {
|
|
111
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
112
|
+
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
113
|
+
ownerDocument.body.style.pointerEvents = 'none';
|
|
114
|
+
}
|
|
115
|
+
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
116
|
+
}
|
|
117
|
+
context.layers.add(node1);
|
|
118
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
119
|
+
return ()=>{
|
|
120
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
121
|
+
};
|
|
122
|
+
}, [
|
|
123
|
+
node1,
|
|
124
|
+
ownerDocument,
|
|
125
|
+
disableOutsidePointerEvents,
|
|
126
|
+
context
|
|
127
|
+
]);
|
|
128
|
+
/**
|
|
129
|
+
* We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
|
|
130
|
+
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
|
131
|
+
* and add it to the end again so the layering order wouldn't be _creation order_.
|
|
132
|
+
* We only want them to be removed from context stacks when unmounted.
|
|
133
|
+
*/ React.useEffect(()=>{
|
|
134
|
+
return ()=>{
|
|
135
|
+
if (!node1) return;
|
|
136
|
+
context.layers.delete(node1);
|
|
137
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
138
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
139
|
+
};
|
|
140
|
+
}, [
|
|
141
|
+
node1,
|
|
142
|
+
context
|
|
143
|
+
]);
|
|
144
|
+
React.useEffect(()=>{
|
|
145
|
+
const handleUpdate = ()=>force({})
|
|
146
|
+
;
|
|
147
|
+
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
148
|
+
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
149
|
+
;
|
|
150
|
+
}, []);
|
|
151
|
+
return /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index._extends({}, layerProps, {
|
|
152
|
+
ref: composedRefs,
|
|
153
|
+
style: {
|
|
154
|
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
155
|
+
...props.style
|
|
156
|
+
},
|
|
157
|
+
onFocusCapture: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
158
|
+
onBlurCapture: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
159
|
+
onPointerDownCapture: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
160
|
+
}));
|
|
161
|
+
});
|
|
162
|
+
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
163
|
+
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
164
|
+
* to mimic layer dismissing behaviour present in OS.
|
|
165
|
+
* Returns props to pass to the node we want to check for outside events.
|
|
166
|
+
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
167
|
+
const handlePointerDownOutside = index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
168
|
+
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
169
|
+
const handleClickRef = React.useRef(()=>{});
|
|
170
|
+
React.useEffect(()=>{
|
|
171
|
+
const handlePointerDown = (event)=>{
|
|
172
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
173
|
+
const eventDetail = {
|
|
174
|
+
originalEvent: event
|
|
175
|
+
};
|
|
176
|
+
function handleAndDispatchPointerDownOutsideEvent() {
|
|
177
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
178
|
+
discrete: true
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* On touch devices, we need to wait for a click event because browsers implement
|
|
183
|
+
* a ~350ms delay between the time the user stops touching the display and when the
|
|
184
|
+
* browser executres events. We need to ensure we don't reactivate pointer-events within
|
|
185
|
+
* this timeframe otherwise the browser may execute events that should have been prevented.
|
|
186
|
+
*
|
|
187
|
+
* Additionally, this also lets us deal automatically with cancellations when a click event
|
|
188
|
+
* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
|
|
189
|
+
*
|
|
190
|
+
* This is why we also continuously remove the previous listener, because we cannot be
|
|
191
|
+
* certain that it was raised, and therefore cleaned-up.
|
|
192
|
+
*/ if (event.pointerType === 'touch') {
|
|
193
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
194
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
195
|
+
ownerDocument.addEventListener('click', handleClickRef.current, {
|
|
196
|
+
once: true
|
|
197
|
+
});
|
|
198
|
+
} else handleAndDispatchPointerDownOutsideEvent();
|
|
199
|
+
} else // We need to remove the event listener in case the outside click has been canceled.
|
|
200
|
+
// See: https://github.com/radix-ui/primitives/issues/2171
|
|
201
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
202
|
+
isPointerInsideReactTreeRef.current = false;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* if this hook executes in a component that mounts via a `pointerdown` event, the event
|
|
206
|
+
* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
|
|
207
|
+
* this by delaying the event listener registration on the document.
|
|
208
|
+
* This is not React specific, but rather how the DOM works, ie:
|
|
209
|
+
* ```
|
|
210
|
+
* button.addEventListener('pointerdown', () => {
|
|
211
|
+
* console.log('I will log');
|
|
212
|
+
* document.addEventListener('pointerdown', () => {
|
|
213
|
+
* console.log('I will also log');
|
|
214
|
+
* })
|
|
215
|
+
* });
|
|
216
|
+
*/ const timerId = window.setTimeout(()=>{
|
|
217
|
+
ownerDocument.addEventListener('pointerdown', handlePointerDown);
|
|
218
|
+
}, 0);
|
|
219
|
+
return ()=>{
|
|
220
|
+
window.clearTimeout(timerId);
|
|
221
|
+
ownerDocument.removeEventListener('pointerdown', handlePointerDown);
|
|
222
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
223
|
+
};
|
|
224
|
+
}, [
|
|
225
|
+
ownerDocument,
|
|
226
|
+
handlePointerDownOutside
|
|
227
|
+
]);
|
|
228
|
+
return {
|
|
229
|
+
// ensures we check React component tree (not just DOM tree)
|
|
230
|
+
onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Listens for when focus happens outside a react subtree.
|
|
235
|
+
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
236
|
+
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
237
|
+
const handleFocusOutside = index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
238
|
+
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
239
|
+
React.useEffect(()=>{
|
|
240
|
+
const handleFocus = (event)=>{
|
|
241
|
+
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
242
|
+
const eventDetail = {
|
|
243
|
+
originalEvent: event
|
|
244
|
+
};
|
|
245
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
246
|
+
discrete: false
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
ownerDocument.addEventListener('focusin', handleFocus);
|
|
251
|
+
return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
|
|
252
|
+
;
|
|
253
|
+
}, [
|
|
254
|
+
ownerDocument,
|
|
255
|
+
handleFocusOutside
|
|
256
|
+
]);
|
|
257
|
+
return {
|
|
258
|
+
onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
|
|
259
|
+
,
|
|
260
|
+
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
264
|
+
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
265
|
+
document.dispatchEvent(event);
|
|
266
|
+
}
|
|
267
|
+
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
268
|
+
const target = detail.originalEvent.target;
|
|
269
|
+
const event = new CustomEvent(name, {
|
|
270
|
+
bubbles: false,
|
|
271
|
+
cancelable: true,
|
|
272
|
+
detail: detail
|
|
273
|
+
});
|
|
274
|
+
if (handler) target.addEventListener(name, handler, {
|
|
275
|
+
once: true
|
|
276
|
+
});
|
|
277
|
+
if (discrete) index.$8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
278
|
+
else target.dispatchEvent(event);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
|
|
282
|
+
/**
|
|
283
|
+
* Injects a pair of focus guards at the edges of the whole DOM tree
|
|
284
|
+
* to ensure `focusin` & `focusout` events can be caught consistently.
|
|
285
|
+
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
286
|
+
React.useEffect(()=>{
|
|
287
|
+
var _edgeGuards$, _edgeGuards$2;
|
|
288
|
+
const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
|
|
289
|
+
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
290
|
+
document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
291
|
+
$3db38b7d1fb3fe6a$var$count++;
|
|
292
|
+
return ()=>{
|
|
293
|
+
if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
|
|
294
|
+
);
|
|
295
|
+
$3db38b7d1fb3fe6a$var$count--;
|
|
296
|
+
};
|
|
297
|
+
}, []);
|
|
298
|
+
}
|
|
299
|
+
function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
300
|
+
const element = document.createElement('span');
|
|
301
|
+
element.setAttribute('data-radix-focus-guard', '');
|
|
302
|
+
element.tabIndex = 0;
|
|
303
|
+
element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
|
|
304
|
+
return element;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
|
|
308
|
+
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
|
|
309
|
+
const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
310
|
+
bubbles: false,
|
|
311
|
+
cancelable: true
|
|
312
|
+
};
|
|
313
|
+
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
314
|
+
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
315
|
+
const [container1, setContainer] = React.useState(null);
|
|
316
|
+
const onMountAutoFocus = index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
317
|
+
const onUnmountAutoFocus = index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
318
|
+
const lastFocusedElementRef = React.useRef(null);
|
|
319
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
|
320
|
+
);
|
|
321
|
+
const focusScope = React.useRef({
|
|
322
|
+
paused: false,
|
|
323
|
+
pause () {
|
|
324
|
+
this.paused = true;
|
|
325
|
+
},
|
|
326
|
+
resume () {
|
|
327
|
+
this.paused = false;
|
|
328
|
+
}
|
|
329
|
+
}).current; // Takes care of trapping focus if focus is moved outside programmatically for example
|
|
330
|
+
React.useEffect(()=>{
|
|
331
|
+
if (trapped) {
|
|
332
|
+
function handleFocusIn(event) {
|
|
333
|
+
if (focusScope.paused || !container1) return;
|
|
334
|
+
const target = event.target;
|
|
335
|
+
if (container1.contains(target)) lastFocusedElementRef.current = target;
|
|
336
|
+
else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
337
|
+
select: true
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
function handleFocusOut(event) {
|
|
341
|
+
if (focusScope.paused || !container1) return;
|
|
342
|
+
const relatedTarget = event.relatedTarget; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:
|
|
343
|
+
//
|
|
344
|
+
// 1. When the user switches app/tabs/windows/the browser itself loses focus.
|
|
345
|
+
// 2. In Google Chrome, when the focused element is removed from the DOM.
|
|
346
|
+
//
|
|
347
|
+
// We let the browser do its thing here because:
|
|
348
|
+
//
|
|
349
|
+
// 1. The browser already keeps a memory of what's focused for when the page gets refocused.
|
|
350
|
+
// 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it
|
|
351
|
+
// throws the CPU to 100%, so we avoid doing anything for this reason here too.
|
|
352
|
+
if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)
|
|
353
|
+
// that is outside the container, we move focus to the last valid focused element inside.
|
|
354
|
+
if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
355
|
+
select: true
|
|
356
|
+
});
|
|
357
|
+
} // When the focused element gets removed from the DOM, browsers move focus
|
|
358
|
+
// back to the document.body. In this case, we move focus to the container
|
|
359
|
+
// to keep focus trapped correctly.
|
|
360
|
+
function handleMutations(mutations) {
|
|
361
|
+
const focusedElement = document.activeElement;
|
|
362
|
+
if (focusedElement !== document.body) return;
|
|
363
|
+
for (const mutation of mutations)if (mutation.removedNodes.length > 0) $d3863c46a17e8a28$var$focus(container1);
|
|
364
|
+
}
|
|
365
|
+
document.addEventListener('focusin', handleFocusIn);
|
|
366
|
+
document.addEventListener('focusout', handleFocusOut);
|
|
367
|
+
const mutationObserver = new MutationObserver(handleMutations);
|
|
368
|
+
if (container1) mutationObserver.observe(container1, {
|
|
369
|
+
childList: true,
|
|
370
|
+
subtree: true
|
|
371
|
+
});
|
|
372
|
+
return ()=>{
|
|
373
|
+
document.removeEventListener('focusin', handleFocusIn);
|
|
374
|
+
document.removeEventListener('focusout', handleFocusOut);
|
|
375
|
+
mutationObserver.disconnect();
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
}, [
|
|
379
|
+
trapped,
|
|
380
|
+
container1,
|
|
381
|
+
focusScope.paused
|
|
382
|
+
]);
|
|
383
|
+
React.useEffect(()=>{
|
|
384
|
+
if (container1) {
|
|
385
|
+
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
|
|
386
|
+
const previouslyFocusedElement = document.activeElement;
|
|
387
|
+
const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
|
|
388
|
+
if (!hasFocusedCandidate) {
|
|
389
|
+
const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
390
|
+
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
391
|
+
container1.dispatchEvent(mountEvent);
|
|
392
|
+
if (!mountEvent.defaultPrevented) {
|
|
393
|
+
$d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
|
|
394
|
+
select: true
|
|
395
|
+
});
|
|
396
|
+
if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
return ()=>{
|
|
400
|
+
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
|
|
401
|
+
// We need to delay the focus a little to get around it for now.
|
|
402
|
+
// See: https://github.com/facebook/react/issues/17894
|
|
403
|
+
setTimeout(()=>{
|
|
404
|
+
const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
405
|
+
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
406
|
+
container1.dispatchEvent(unmountEvent);
|
|
407
|
+
if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
|
|
408
|
+
select: true
|
|
409
|
+
});
|
|
410
|
+
// we need to remove the listener after we `dispatchEvent`
|
|
411
|
+
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
412
|
+
$d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
|
|
413
|
+
}, 0);
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
}, [
|
|
417
|
+
container1,
|
|
418
|
+
onMountAutoFocus,
|
|
419
|
+
onUnmountAutoFocus,
|
|
420
|
+
focusScope
|
|
421
|
+
]); // Takes care of looping focus (when tabbing whilst at the edges)
|
|
422
|
+
const handleKeyDown = React.useCallback((event)=>{
|
|
423
|
+
if (!loop && !trapped) return;
|
|
424
|
+
if (focusScope.paused) return;
|
|
425
|
+
const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
426
|
+
const focusedElement = document.activeElement;
|
|
427
|
+
if (isTabKey && focusedElement) {
|
|
428
|
+
const container = event.currentTarget;
|
|
429
|
+
const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container);
|
|
430
|
+
const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges
|
|
431
|
+
if (!hasTabbableElementsInside) {
|
|
432
|
+
if (focusedElement === container) event.preventDefault();
|
|
433
|
+
} else {
|
|
434
|
+
if (!event.shiftKey && focusedElement === last) {
|
|
435
|
+
event.preventDefault();
|
|
436
|
+
if (loop) $d3863c46a17e8a28$var$focus(first, {
|
|
437
|
+
select: true
|
|
438
|
+
});
|
|
439
|
+
} else if (event.shiftKey && focusedElement === first) {
|
|
440
|
+
event.preventDefault();
|
|
441
|
+
if (loop) $d3863c46a17e8a28$var$focus(last, {
|
|
442
|
+
select: true
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}, [
|
|
448
|
+
loop,
|
|
449
|
+
trapped,
|
|
450
|
+
focusScope.paused
|
|
451
|
+
]);
|
|
452
|
+
return /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index._extends({
|
|
453
|
+
tabIndex: -1
|
|
454
|
+
}, scopeProps, {
|
|
455
|
+
ref: composedRefs,
|
|
456
|
+
onKeyDown: handleKeyDown
|
|
457
|
+
}));
|
|
458
|
+
});
|
|
459
|
+
/* -------------------------------------------------------------------------------------------------
|
|
460
|
+
* Utils
|
|
461
|
+
* -----------------------------------------------------------------------------------------------*/ /**
|
|
462
|
+
* Attempts focusing the first element in a list of candidates.
|
|
463
|
+
* Stops when focus has actually moved.
|
|
464
|
+
*/ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) {
|
|
465
|
+
const previouslyFocusedElement = document.activeElement;
|
|
466
|
+
for (const candidate of candidates){
|
|
467
|
+
$d3863c46a17e8a28$var$focus(candidate, {
|
|
468
|
+
select: select
|
|
469
|
+
});
|
|
470
|
+
if (document.activeElement !== previouslyFocusedElement) return;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Returns the first and last tabbable elements inside a container.
|
|
475
|
+
*/ function $d3863c46a17e8a28$var$getTabbableEdges(container) {
|
|
476
|
+
const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container);
|
|
477
|
+
const first = $d3863c46a17e8a28$var$findVisible(candidates, container);
|
|
478
|
+
const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container);
|
|
479
|
+
return [
|
|
480
|
+
first,
|
|
481
|
+
last
|
|
482
|
+
];
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Returns a list of potential tabbable candidates.
|
|
486
|
+
*
|
|
487
|
+
* NOTE: This is only a close approximation. For example it doesn't take into account cases like when
|
|
488
|
+
* elements are not visible. This cannot be worked out easily by just reading a property, but rather
|
|
489
|
+
* necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.
|
|
490
|
+
*
|
|
491
|
+
* See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
|
|
492
|
+
* Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
|
|
493
|
+
*/ function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
|
|
494
|
+
const nodes = [];
|
|
495
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
496
|
+
acceptNode: (node)=>{
|
|
497
|
+
const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';
|
|
498
|
+
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
|
|
499
|
+
// runtime's understanding of tabbability, so this automatically accounts
|
|
500
|
+
// for any kind of element that could be tabbed to.
|
|
501
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it
|
|
505
|
+
// hinders accessibility to have tab order different from visual order.
|
|
506
|
+
return nodes;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Returns the first visible element in a list.
|
|
510
|
+
* NOTE: Only checks visibility up to the `container`.
|
|
511
|
+
*/ function $d3863c46a17e8a28$var$findVisible(elements, container) {
|
|
512
|
+
for (const element of elements){
|
|
513
|
+
// we stop checking if it's hidden at the `container` level (excluding)
|
|
514
|
+
if (!$d3863c46a17e8a28$var$isHidden(element, {
|
|
515
|
+
upTo: container
|
|
516
|
+
})) return element;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) {
|
|
520
|
+
if (getComputedStyle(node).visibility === 'hidden') return true;
|
|
521
|
+
while(node){
|
|
522
|
+
// we stop at `upTo` (excluding it)
|
|
523
|
+
if (upTo !== undefined && node === upTo) return false;
|
|
524
|
+
if (getComputedStyle(node).display === 'none') return true;
|
|
525
|
+
node = node.parentElement;
|
|
526
|
+
}
|
|
527
|
+
return false;
|
|
528
|
+
}
|
|
529
|
+
function $d3863c46a17e8a28$var$isSelectableInput(element) {
|
|
530
|
+
return element instanceof HTMLInputElement && 'select' in element;
|
|
531
|
+
}
|
|
532
|
+
function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) {
|
|
533
|
+
// only focus if that element is focusable
|
|
534
|
+
if (element && element.focus) {
|
|
535
|
+
const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users
|
|
536
|
+
element.focus({
|
|
537
|
+
preventScroll: true
|
|
538
|
+
}); // only select if its not the same element, it supports selection and we need to select
|
|
539
|
+
if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select();
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
/* -------------------------------------------------------------------------------------------------
|
|
543
|
+
* FocusScope stack
|
|
544
|
+
* -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
|
|
545
|
+
function $d3863c46a17e8a28$var$createFocusScopesStack() {
|
|
546
|
+
/** A stack of focus scopes, with the active one at the top */ let stack = [];
|
|
547
|
+
return {
|
|
548
|
+
add (focusScope) {
|
|
549
|
+
// pause the currently active focus scope (at the top of the stack)
|
|
550
|
+
const activeFocusScope = stack[0];
|
|
551
|
+
if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
|
|
552
|
+
// remove in case it already exists (because we'll re-add it at the top of the stack)
|
|
553
|
+
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
554
|
+
stack.unshift(focusScope);
|
|
555
|
+
},
|
|
556
|
+
remove (focusScope) {
|
|
557
|
+
var _stack$;
|
|
558
|
+
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
559
|
+
(_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
function $d3863c46a17e8a28$var$arrayRemove(array, item) {
|
|
564
|
+
const updatedArray = [
|
|
565
|
+
...array
|
|
566
|
+
];
|
|
567
|
+
const index = updatedArray.indexOf(item);
|
|
568
|
+
if (index !== -1) updatedArray.splice(index, 1);
|
|
569
|
+
return updatedArray;
|
|
570
|
+
}
|
|
571
|
+
function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
572
|
+
return items.filter((item)=>item.tagName !== 'A'
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/* -------------------------------------------------------------------------------------------------
|
|
577
|
+
* Popper
|
|
578
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME = 'Popper';
|
|
579
|
+
const [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = index.$c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
580
|
+
const [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
581
|
+
const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props)=>{
|
|
582
|
+
const { __scopePopper: __scopePopper , children: children } = props;
|
|
583
|
+
const [anchor, setAnchor] = React.useState(null);
|
|
584
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperProvider, {
|
|
585
|
+
scope: __scopePopper,
|
|
586
|
+
anchor: anchor,
|
|
587
|
+
onAnchorChange: setAnchor
|
|
588
|
+
}, children);
|
|
589
|
+
};
|
|
590
|
+
/* -------------------------------------------------------------------------------------------------
|
|
591
|
+
* PopperAnchor
|
|
592
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME = 'PopperAnchor';
|
|
593
|
+
const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
594
|
+
const { __scopePopper: __scopePopper , virtualRef: virtualRef , ...anchorProps } = props;
|
|
595
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
|
|
596
|
+
const ref = React.useRef(null);
|
|
597
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
598
|
+
React.useEffect(()=>{
|
|
599
|
+
// Consumer can anchor the popper to something that isn't
|
|
600
|
+
// a DOM node e.g. pointer position, so we override the
|
|
601
|
+
// `anchorRef` with their virtual ref in this case.
|
|
602
|
+
context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
|
|
603
|
+
});
|
|
604
|
+
return virtualRef ? null : /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index._extends({}, anchorProps, {
|
|
605
|
+
ref: composedRefs
|
|
606
|
+
}));
|
|
607
|
+
});
|
|
608
|
+
/* -------------------------------------------------------------------------------------------------
|
|
609
|
+
* PopperContent
|
|
610
|
+
* -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME = 'PopperContent';
|
|
611
|
+
const [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
|
|
612
|
+
const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
613
|
+
var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$trans, _middlewareData$trans2, _middlewareData$hide;
|
|
614
|
+
const { __scopePopper: __scopePopper , side: side = 'bottom' , sideOffset: sideOffset = 0 , align: align = 'center' , alignOffset: alignOffset = 0 , arrowPadding: arrowPadding = 0 , avoidCollisions: avoidCollisions = true , collisionBoundary: collisionBoundary = [] , collisionPadding: collisionPaddingProp = 0 , sticky: sticky = 'partial' , hideWhenDetached: hideWhenDetached = false , updatePositionStrategy: updatePositionStrategy = 'optimized' , onPlaced: onPlaced , ...contentProps } = props;
|
|
615
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
|
|
616
|
+
const [content, setContent] = React.useState(null);
|
|
617
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
618
|
+
);
|
|
619
|
+
const [arrow, setArrow] = React.useState(null);
|
|
620
|
+
const arrowSize = index$2.$db6c3485150b8e66$export$1ab7ae714698c4b8(arrow);
|
|
621
|
+
const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
|
|
622
|
+
const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
|
|
623
|
+
const desiredPlacement = side + (align !== 'center' ? '-' + align : '');
|
|
624
|
+
const collisionPadding = typeof collisionPaddingProp === 'number' ? collisionPaddingProp : {
|
|
625
|
+
top: 0,
|
|
626
|
+
right: 0,
|
|
627
|
+
bottom: 0,
|
|
628
|
+
left: 0,
|
|
629
|
+
...collisionPaddingProp
|
|
630
|
+
};
|
|
631
|
+
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [
|
|
632
|
+
collisionBoundary
|
|
633
|
+
];
|
|
634
|
+
const hasExplicitBoundaries = boundary.length > 0;
|
|
635
|
+
const detectOverflowOptions = {
|
|
636
|
+
padding: collisionPadding,
|
|
637
|
+
boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull),
|
|
638
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
639
|
+
altBoundary: hasExplicitBoundaries
|
|
640
|
+
};
|
|
641
|
+
const { refs: refs , floatingStyles: floatingStyles , placement: placement , isPositioned: isPositioned , middlewareData: middlewareData } = floatingUi_reactDom.useFloating({
|
|
642
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
643
|
+
strategy: 'fixed',
|
|
644
|
+
placement: desiredPlacement,
|
|
645
|
+
whileElementsMounted: (...args)=>{
|
|
646
|
+
const cleanup = floatingUi_reactDom.autoUpdate(...args, {
|
|
647
|
+
animationFrame: updatePositionStrategy === 'always'
|
|
648
|
+
});
|
|
649
|
+
return cleanup;
|
|
650
|
+
},
|
|
651
|
+
elements: {
|
|
652
|
+
reference: context.anchor
|
|
653
|
+
},
|
|
654
|
+
middleware: [
|
|
655
|
+
floatingUi_reactDom.offset({
|
|
656
|
+
mainAxis: sideOffset + arrowHeight,
|
|
657
|
+
alignmentAxis: alignOffset
|
|
658
|
+
}),
|
|
659
|
+
avoidCollisions && floatingUi_reactDom.shift({
|
|
660
|
+
mainAxis: true,
|
|
661
|
+
crossAxis: false,
|
|
662
|
+
limiter: sticky === 'partial' ? floatingUi_reactDom.limitShift() : undefined,
|
|
663
|
+
...detectOverflowOptions
|
|
664
|
+
}),
|
|
665
|
+
avoidCollisions && floatingUi_reactDom.flip({
|
|
666
|
+
...detectOverflowOptions
|
|
667
|
+
}),
|
|
668
|
+
floatingUi_reactDom.size({
|
|
669
|
+
...detectOverflowOptions,
|
|
670
|
+
apply: ({ elements: elements , rects: rects , availableWidth: availableWidth , availableHeight: availableHeight })=>{
|
|
671
|
+
const { width: anchorWidth , height: anchorHeight } = rects.reference;
|
|
672
|
+
const contentStyle = elements.floating.style;
|
|
673
|
+
contentStyle.setProperty('--radix-popper-available-width', `${availableWidth}px`);
|
|
674
|
+
contentStyle.setProperty('--radix-popper-available-height', `${availableHeight}px`);
|
|
675
|
+
contentStyle.setProperty('--radix-popper-anchor-width', `${anchorWidth}px`);
|
|
676
|
+
contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);
|
|
677
|
+
}
|
|
678
|
+
}),
|
|
679
|
+
arrow && floatingUi_reactDom.arrow({
|
|
680
|
+
element: arrow,
|
|
681
|
+
padding: arrowPadding
|
|
682
|
+
}),
|
|
683
|
+
$cf1ac5d9fe0e8206$var$transformOrigin({
|
|
684
|
+
arrowWidth: arrowWidth,
|
|
685
|
+
arrowHeight: arrowHeight
|
|
686
|
+
}),
|
|
687
|
+
hideWhenDetached && floatingUi_reactDom.hide({
|
|
688
|
+
strategy: 'referenceHidden',
|
|
689
|
+
...detectOverflowOptions
|
|
690
|
+
})
|
|
691
|
+
]
|
|
692
|
+
});
|
|
693
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
694
|
+
const handlePlaced = index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPlaced);
|
|
695
|
+
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
696
|
+
if (isPositioned) handlePlaced === null || handlePlaced === void 0 || handlePlaced();
|
|
697
|
+
}, [
|
|
698
|
+
isPositioned,
|
|
699
|
+
handlePlaced
|
|
700
|
+
]);
|
|
701
|
+
const arrowX = (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x;
|
|
702
|
+
const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y;
|
|
703
|
+
const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0;
|
|
704
|
+
const [contentZIndex, setContentZIndex] = React.useState();
|
|
705
|
+
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
706
|
+
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
707
|
+
}, [
|
|
708
|
+
content
|
|
709
|
+
]);
|
|
710
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
711
|
+
ref: refs.setFloating,
|
|
712
|
+
"data-radix-popper-content-wrapper": "",
|
|
713
|
+
style: {
|
|
714
|
+
...floatingStyles,
|
|
715
|
+
transform: isPositioned ? floatingStyles.transform : 'translate(0, -200%)',
|
|
716
|
+
// keep off the page when measuring
|
|
717
|
+
minWidth: 'max-content',
|
|
718
|
+
zIndex: contentZIndex,
|
|
719
|
+
['--radix-popper-transform-origin']: [
|
|
720
|
+
(_middlewareData$trans = middlewareData.transformOrigin) === null || _middlewareData$trans === void 0 ? void 0 : _middlewareData$trans.x,
|
|
721
|
+
(_middlewareData$trans2 = middlewareData.transformOrigin) === null || _middlewareData$trans2 === void 0 ? void 0 : _middlewareData$trans2.y
|
|
722
|
+
].join(' ')
|
|
723
|
+
} // Floating UI interally calculates logical alignment based the `dir` attribute on
|
|
724
|
+
,
|
|
725
|
+
dir: props.dir
|
|
726
|
+
}, /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$var$PopperContentProvider, {
|
|
727
|
+
scope: __scopePopper,
|
|
728
|
+
placedSide: placedSide,
|
|
729
|
+
onArrowChange: setArrow,
|
|
730
|
+
arrowX: arrowX,
|
|
731
|
+
arrowY: arrowY,
|
|
732
|
+
shouldHideArrow: cannotCenterArrow
|
|
733
|
+
}, /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index._extends({
|
|
734
|
+
"data-side": placedSide,
|
|
735
|
+
"data-align": placedAlign
|
|
736
|
+
}, contentProps, {
|
|
737
|
+
ref: composedRefs,
|
|
738
|
+
style: {
|
|
739
|
+
...contentProps.style,
|
|
740
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
741
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
742
|
+
animation: !isPositioned ? 'none' : undefined,
|
|
743
|
+
// hide the content if using the hide middleware and should be hidden
|
|
744
|
+
opacity: (_middlewareData$hide = middlewareData.hide) !== null && _middlewareData$hide !== void 0 && _middlewareData$hide.referenceHidden ? 0 : undefined
|
|
745
|
+
}
|
|
746
|
+
}))));
|
|
747
|
+
});
|
|
748
|
+
/* -----------------------------------------------------------------------------------------------*/ function $cf1ac5d9fe0e8206$var$isNotNull(value) {
|
|
749
|
+
return value !== null;
|
|
750
|
+
}
|
|
751
|
+
const $cf1ac5d9fe0e8206$var$transformOrigin = (options)=>({
|
|
752
|
+
name: 'transformOrigin',
|
|
753
|
+
options: options,
|
|
754
|
+
fn (data) {
|
|
755
|
+
var _middlewareData$arrow4, _middlewareData$arrow5, _middlewareData$arrow6, _middlewareData$arrow7, _middlewareData$arrow8;
|
|
756
|
+
const { placement: placement , rects: rects , middlewareData: middlewareData } = data;
|
|
757
|
+
const cannotCenterArrow = ((_middlewareData$arrow4 = middlewareData.arrow) === null || _middlewareData$arrow4 === void 0 ? void 0 : _middlewareData$arrow4.centerOffset) !== 0;
|
|
758
|
+
const isArrowHidden = cannotCenterArrow;
|
|
759
|
+
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
760
|
+
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
761
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
762
|
+
const noArrowAlign = {
|
|
763
|
+
start: '0%',
|
|
764
|
+
center: '50%',
|
|
765
|
+
end: '100%'
|
|
766
|
+
}[placedAlign];
|
|
767
|
+
const arrowXCenter = ((_middlewareData$arrow5 = (_middlewareData$arrow6 = middlewareData.arrow) === null || _middlewareData$arrow6 === void 0 ? void 0 : _middlewareData$arrow6.x) !== null && _middlewareData$arrow5 !== void 0 ? _middlewareData$arrow5 : 0) + arrowWidth / 2;
|
|
768
|
+
const arrowYCenter = ((_middlewareData$arrow7 = (_middlewareData$arrow8 = middlewareData.arrow) === null || _middlewareData$arrow8 === void 0 ? void 0 : _middlewareData$arrow8.y) !== null && _middlewareData$arrow7 !== void 0 ? _middlewareData$arrow7 : 0) + arrowHeight / 2;
|
|
769
|
+
let x = '';
|
|
770
|
+
let y = '';
|
|
771
|
+
if (placedSide === 'bottom') {
|
|
772
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
773
|
+
y = `${-arrowHeight}px`;
|
|
774
|
+
} else if (placedSide === 'top') {
|
|
775
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
776
|
+
y = `${rects.floating.height + arrowHeight}px`;
|
|
777
|
+
} else if (placedSide === 'right') {
|
|
778
|
+
x = `${-arrowHeight}px`;
|
|
779
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
780
|
+
} else if (placedSide === 'left') {
|
|
781
|
+
x = `${rects.floating.width + arrowHeight}px`;
|
|
782
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
783
|
+
}
|
|
784
|
+
return {
|
|
785
|
+
data: {
|
|
786
|
+
x: x,
|
|
787
|
+
y: y
|
|
788
|
+
}
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
})
|
|
792
|
+
;
|
|
793
|
+
function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement) {
|
|
794
|
+
const [side, align = 'center'] = placement.split('-');
|
|
795
|
+
return [
|
|
796
|
+
side,
|
|
797
|
+
align
|
|
798
|
+
];
|
|
799
|
+
}
|
|
800
|
+
const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9;
|
|
801
|
+
const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
802
|
+
const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
803
|
+
|
|
804
|
+
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
805
|
+
var _globalThis$document;
|
|
806
|
+
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;
|
|
807
|
+
return container ? /*#__PURE__*/ ReactDOM__default["default"].createPortal(/*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index._extends({}, portalProps, {
|
|
808
|
+
ref: forwardedRef
|
|
809
|
+
})), container) : null;
|
|
810
|
+
});
|
|
811
|
+
|
|
812
|
+
var effectCar = component.createSidecarMedium();
|
|
813
|
+
|
|
814
|
+
var nothing = function () {
|
|
815
|
+
return;
|
|
816
|
+
};
|
|
817
|
+
/**
|
|
818
|
+
* Removes scrollbar from the page and contain the scroll within the Lock
|
|
819
|
+
*/
|
|
820
|
+
var RemoveScroll = React__namespace.forwardRef(function (props, parentRef) {
|
|
821
|
+
var ref = React__namespace.useRef(null);
|
|
822
|
+
var _a = React__namespace.useState({
|
|
823
|
+
onScrollCapture: nothing,
|
|
824
|
+
onWheelCapture: nothing,
|
|
825
|
+
onTouchMoveCapture: nothing,
|
|
826
|
+
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
827
|
+
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_es.__rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]);
|
|
828
|
+
var SideCar = sideCar;
|
|
829
|
+
var containerRef = component.useMergeRefs([ref, parentRef]);
|
|
830
|
+
var containerProps = index_es.__assign(index_es.__assign({}, rest), callbacks);
|
|
831
|
+
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
832
|
+
enabled && (React__namespace.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })),
|
|
833
|
+
forwardProps ? (React__namespace.cloneElement(React__namespace.Children.only(children), index_es.__assign(index_es.__assign({}, containerProps), { ref: containerRef }))) : (React__namespace.createElement(Container, index_es.__assign({}, containerProps, { className: className, ref: containerRef }), children))));
|
|
834
|
+
});
|
|
835
|
+
RemoveScroll.defaultProps = {
|
|
836
|
+
enabled: true,
|
|
837
|
+
removeScrollBar: true,
|
|
838
|
+
inert: false,
|
|
839
|
+
};
|
|
840
|
+
RemoveScroll.classNames = {
|
|
841
|
+
fullWidth: component.fullWidthClassName,
|
|
842
|
+
zeroRight: component.zeroRightClassName,
|
|
843
|
+
};
|
|
844
|
+
|
|
845
|
+
var passiveSupported = false;
|
|
846
|
+
if (typeof window !== 'undefined') {
|
|
847
|
+
try {
|
|
848
|
+
var options = Object.defineProperty({}, 'passive', {
|
|
849
|
+
get: function () {
|
|
850
|
+
passiveSupported = true;
|
|
851
|
+
return true;
|
|
852
|
+
},
|
|
853
|
+
});
|
|
854
|
+
// @ts-ignore
|
|
855
|
+
window.addEventListener('test', options, options);
|
|
856
|
+
// @ts-ignore
|
|
857
|
+
window.removeEventListener('test', options, options);
|
|
858
|
+
}
|
|
859
|
+
catch (err) {
|
|
860
|
+
passiveSupported = false;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
864
|
+
|
|
865
|
+
var alwaysContainsScroll = function (node) {
|
|
866
|
+
// textarea will always _contain_ scroll inside self. It only can be hidden
|
|
867
|
+
return node.tagName === 'TEXTAREA';
|
|
868
|
+
};
|
|
869
|
+
var elementCanBeScrolled = function (node, overflow) {
|
|
870
|
+
var styles = window.getComputedStyle(node);
|
|
871
|
+
return (
|
|
872
|
+
// not-not-scrollable
|
|
873
|
+
styles[overflow] !== 'hidden' &&
|
|
874
|
+
// contains scroll inside self
|
|
875
|
+
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
|
|
876
|
+
};
|
|
877
|
+
var elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };
|
|
878
|
+
var elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };
|
|
879
|
+
var locationCouldBeScrolled = function (axis, node) {
|
|
880
|
+
var current = node;
|
|
881
|
+
do {
|
|
882
|
+
// Skip over shadow root
|
|
883
|
+
if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
|
|
884
|
+
current = current.host;
|
|
885
|
+
}
|
|
886
|
+
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
887
|
+
if (isScrollable) {
|
|
888
|
+
var _a = getScrollVariables(axis, current), s = _a[1], d = _a[2];
|
|
889
|
+
if (s > d) {
|
|
890
|
+
return true;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
current = current.parentNode;
|
|
894
|
+
} while (current && current !== document.body);
|
|
895
|
+
return false;
|
|
896
|
+
};
|
|
897
|
+
var getVScrollVariables = function (_a) {
|
|
898
|
+
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
899
|
+
return [
|
|
900
|
+
scrollTop,
|
|
901
|
+
scrollHeight,
|
|
902
|
+
clientHeight,
|
|
903
|
+
];
|
|
904
|
+
};
|
|
905
|
+
var getHScrollVariables = function (_a) {
|
|
906
|
+
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
907
|
+
return [
|
|
908
|
+
scrollLeft,
|
|
909
|
+
scrollWidth,
|
|
910
|
+
clientWidth,
|
|
911
|
+
];
|
|
912
|
+
};
|
|
913
|
+
var elementCouldBeScrolled = function (axis, node) {
|
|
914
|
+
return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
915
|
+
};
|
|
916
|
+
var getScrollVariables = function (axis, node) {
|
|
917
|
+
return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
918
|
+
};
|
|
919
|
+
var getDirectionFactor = function (axis, direction) {
|
|
920
|
+
/**
|
|
921
|
+
* If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
|
|
922
|
+
* and then increasingly negative as you scroll towards the end of the content.
|
|
923
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
|
|
924
|
+
*/
|
|
925
|
+
return axis === 'h' && direction === 'rtl' ? -1 : 1;
|
|
926
|
+
};
|
|
927
|
+
var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
928
|
+
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
929
|
+
var delta = directionFactor * sourceDelta;
|
|
930
|
+
// find scrollable target
|
|
931
|
+
var target = event.target;
|
|
932
|
+
var targetInLock = endTarget.contains(target);
|
|
933
|
+
var shouldCancelScroll = false;
|
|
934
|
+
var isDeltaPositive = delta > 0;
|
|
935
|
+
var availableScroll = 0;
|
|
936
|
+
var availableScrollTop = 0;
|
|
937
|
+
do {
|
|
938
|
+
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
939
|
+
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
940
|
+
if (position || elementScroll) {
|
|
941
|
+
if (elementCouldBeScrolled(axis, target)) {
|
|
942
|
+
availableScroll += elementScroll;
|
|
943
|
+
availableScrollTop += position;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
target = target.parentNode;
|
|
947
|
+
} while (
|
|
948
|
+
// portaled content
|
|
949
|
+
(!targetInLock && target !== document.body) ||
|
|
950
|
+
// self content
|
|
951
|
+
(targetInLock && (endTarget.contains(target) || endTarget === target)));
|
|
952
|
+
if (isDeltaPositive && ((noOverscroll && availableScroll === 0) || (!noOverscroll && delta > availableScroll))) {
|
|
953
|
+
shouldCancelScroll = true;
|
|
954
|
+
}
|
|
955
|
+
else if (!isDeltaPositive &&
|
|
956
|
+
((noOverscroll && availableScrollTop === 0) || (!noOverscroll && -delta > availableScrollTop))) {
|
|
957
|
+
shouldCancelScroll = true;
|
|
958
|
+
}
|
|
959
|
+
return shouldCancelScroll;
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
var getTouchXY = function (event) {
|
|
963
|
+
return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
|
|
964
|
+
};
|
|
965
|
+
var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };
|
|
966
|
+
var extractRef = function (ref) {
|
|
967
|
+
return ref && 'current' in ref ? ref.current : ref;
|
|
968
|
+
};
|
|
969
|
+
var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };
|
|
970
|
+
var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); };
|
|
971
|
+
var idCounter = 0;
|
|
972
|
+
var lockStack = [];
|
|
973
|
+
function RemoveScrollSideCar(props) {
|
|
974
|
+
var shouldPreventQueue = React__namespace.useRef([]);
|
|
975
|
+
var touchStartRef = React__namespace.useRef([0, 0]);
|
|
976
|
+
var activeAxis = React__namespace.useRef();
|
|
977
|
+
var id = React__namespace.useState(idCounter++)[0];
|
|
978
|
+
var Style = React__namespace.useState(function () { return component.styleSingleton(); })[0];
|
|
979
|
+
var lastProps = React__namespace.useRef(props);
|
|
980
|
+
React__namespace.useEffect(function () {
|
|
981
|
+
lastProps.current = props;
|
|
982
|
+
}, [props]);
|
|
983
|
+
React__namespace.useEffect(function () {
|
|
984
|
+
if (props.inert) {
|
|
985
|
+
document.body.classList.add("block-interactivity-".concat(id));
|
|
986
|
+
var allow_1 = index_es.__spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
987
|
+
allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); });
|
|
988
|
+
return function () {
|
|
989
|
+
document.body.classList.remove("block-interactivity-".concat(id));
|
|
990
|
+
allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); });
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
return;
|
|
994
|
+
}, [props.inert, props.lockRef.current, props.shards]);
|
|
995
|
+
var shouldCancelEvent = React__namespace.useCallback(function (event, parent) {
|
|
996
|
+
if ('touches' in event && event.touches.length === 2) {
|
|
997
|
+
return !lastProps.current.allowPinchZoom;
|
|
998
|
+
}
|
|
999
|
+
var touch = getTouchXY(event);
|
|
1000
|
+
var touchStart = touchStartRef.current;
|
|
1001
|
+
var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
|
|
1002
|
+
var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
|
|
1003
|
+
var currentAxis;
|
|
1004
|
+
var target = event.target;
|
|
1005
|
+
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
|
|
1006
|
+
// allow horizontal touch move on Range inputs. They will not cause any scroll
|
|
1007
|
+
if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
|
|
1008
|
+
return false;
|
|
1009
|
+
}
|
|
1010
|
+
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1011
|
+
if (!canBeScrolledInMainDirection) {
|
|
1012
|
+
return true;
|
|
1013
|
+
}
|
|
1014
|
+
if (canBeScrolledInMainDirection) {
|
|
1015
|
+
currentAxis = moveDirection;
|
|
1016
|
+
}
|
|
1017
|
+
else {
|
|
1018
|
+
currentAxis = moveDirection === 'v' ? 'h' : 'v';
|
|
1019
|
+
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
1020
|
+
// other axis might be not scrollable
|
|
1021
|
+
}
|
|
1022
|
+
if (!canBeScrolledInMainDirection) {
|
|
1023
|
+
return false;
|
|
1024
|
+
}
|
|
1025
|
+
if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
|
|
1026
|
+
activeAxis.current = currentAxis;
|
|
1027
|
+
}
|
|
1028
|
+
if (!currentAxis) {
|
|
1029
|
+
return true;
|
|
1030
|
+
}
|
|
1031
|
+
var cancelingAxis = activeAxis.current || currentAxis;
|
|
1032
|
+
return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);
|
|
1033
|
+
}, []);
|
|
1034
|
+
var shouldPrevent = React__namespace.useCallback(function (_event) {
|
|
1035
|
+
var event = _event;
|
|
1036
|
+
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
|
|
1037
|
+
// not the last active
|
|
1038
|
+
return;
|
|
1039
|
+
}
|
|
1040
|
+
var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
|
|
1041
|
+
var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); })[0];
|
|
1042
|
+
// self event, and should be canceled
|
|
1043
|
+
if (sourceEvent && sourceEvent.should) {
|
|
1044
|
+
if (event.cancelable) {
|
|
1045
|
+
event.preventDefault();
|
|
1046
|
+
}
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
// outside or shard event
|
|
1050
|
+
if (!sourceEvent) {
|
|
1051
|
+
var shardNodes = (lastProps.current.shards || [])
|
|
1052
|
+
.map(extractRef)
|
|
1053
|
+
.filter(Boolean)
|
|
1054
|
+
.filter(function (node) { return node.contains(event.target); });
|
|
1055
|
+
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
|
|
1056
|
+
if (shouldStop) {
|
|
1057
|
+
if (event.cancelable) {
|
|
1058
|
+
event.preventDefault();
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}, []);
|
|
1063
|
+
var shouldCancel = React__namespace.useCallback(function (name, delta, target, should) {
|
|
1064
|
+
var event = { name: name, delta: delta, target: target, should: should };
|
|
1065
|
+
shouldPreventQueue.current.push(event);
|
|
1066
|
+
setTimeout(function () {
|
|
1067
|
+
shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
|
|
1068
|
+
}, 1);
|
|
1069
|
+
}, []);
|
|
1070
|
+
var scrollTouchStart = React__namespace.useCallback(function (event) {
|
|
1071
|
+
touchStartRef.current = getTouchXY(event);
|
|
1072
|
+
activeAxis.current = undefined;
|
|
1073
|
+
}, []);
|
|
1074
|
+
var scrollWheel = React__namespace.useCallback(function (event) {
|
|
1075
|
+
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
1076
|
+
}, []);
|
|
1077
|
+
var scrollTouchMove = React__namespace.useCallback(function (event) {
|
|
1078
|
+
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
1079
|
+
}, []);
|
|
1080
|
+
React__namespace.useEffect(function () {
|
|
1081
|
+
lockStack.push(Style);
|
|
1082
|
+
props.setCallbacks({
|
|
1083
|
+
onScrollCapture: scrollWheel,
|
|
1084
|
+
onWheelCapture: scrollWheel,
|
|
1085
|
+
onTouchMoveCapture: scrollTouchMove,
|
|
1086
|
+
});
|
|
1087
|
+
document.addEventListener('wheel', shouldPrevent, nonPassive);
|
|
1088
|
+
document.addEventListener('touchmove', shouldPrevent, nonPassive);
|
|
1089
|
+
document.addEventListener('touchstart', scrollTouchStart, nonPassive);
|
|
1090
|
+
return function () {
|
|
1091
|
+
lockStack = lockStack.filter(function (inst) { return inst !== Style; });
|
|
1092
|
+
document.removeEventListener('wheel', shouldPrevent, nonPassive);
|
|
1093
|
+
document.removeEventListener('touchmove', shouldPrevent, nonPassive);
|
|
1094
|
+
document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
|
|
1095
|
+
};
|
|
1096
|
+
}, []);
|
|
1097
|
+
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
1098
|
+
return (React__namespace.createElement(React__namespace.Fragment, null,
|
|
1099
|
+
inert ? React__namespace.createElement(Style, { styles: generateStyle(id) }) : null,
|
|
1100
|
+
removeScrollBar ? React__namespace.createElement(component.RemoveScrollBar, { gapMode: "margin" }) : null));
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
var SideCar = component.exportSidecar(effectCar, RemoveScrollSideCar);
|
|
1104
|
+
|
|
1105
|
+
var ReactRemoveScroll = React__namespace.forwardRef(function (props, ref) { return (React__namespace.createElement(RemoveScroll, index_es.__assign({}, props, { ref: ref, sideCar: SideCar }))); });
|
|
1106
|
+
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
1107
|
+
var $01b9c$RemoveScroll = ReactRemoveScroll;
|
|
1108
|
+
|
|
35
1109
|
const $cc7e05a45900e73f$var$OPEN_KEYS = [
|
|
36
1110
|
' ',
|
|
37
1111
|
'Enter',
|
|
@@ -45,12 +1119,12 @@ const $cc7e05a45900e73f$var$SELECTION_KEYS = [
|
|
|
45
1119
|
/* -------------------------------------------------------------------------------------------------
|
|
46
1120
|
* Select
|
|
47
1121
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SELECT_NAME = 'Select';
|
|
48
|
-
const [$cc7e05a45900e73f$var$Collection, $cc7e05a45900e73f$var$useCollection, $cc7e05a45900e73f$var$createCollectionScope] = index.$e02a7d9cb1dc128c$export$c74125a8e3af6bb2($cc7e05a45900e73f$var$SELECT_NAME);
|
|
49
|
-
const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] = index
|
|
1122
|
+
const [$cc7e05a45900e73f$var$Collection, $cc7e05a45900e73f$var$useCollection, $cc7e05a45900e73f$var$createCollectionScope] = index$3.$e02a7d9cb1dc128c$export$c74125a8e3af6bb2($cc7e05a45900e73f$var$SELECT_NAME);
|
|
1123
|
+
const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] = index.$c512c27ab02ef895$export$50c7b4e9d9f19c1($cc7e05a45900e73f$var$SELECT_NAME, [
|
|
50
1124
|
$cc7e05a45900e73f$var$createCollectionScope,
|
|
51
|
-
|
|
1125
|
+
$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
52
1126
|
]);
|
|
53
|
-
const $cc7e05a45900e73f$var$usePopperScope =
|
|
1127
|
+
const $cc7e05a45900e73f$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
|
|
54
1128
|
const [$cc7e05a45900e73f$var$SelectProvider, $cc7e05a45900e73f$var$useSelectContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
|
|
55
1129
|
const [$cc7e05a45900e73f$var$SelectNativeOptionsProvider, $cc7e05a45900e73f$var$useSelectNativeOptionsContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
|
|
56
1130
|
const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
@@ -59,13 +1133,13 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
59
1133
|
const [trigger, setTrigger] = React.useState(null);
|
|
60
1134
|
const [valueNode, setValueNode] = React.useState(null);
|
|
61
1135
|
const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);
|
|
62
|
-
const direction = index$
|
|
63
|
-
const [open = false, setOpen] = index
|
|
1136
|
+
const direction = index$4.$f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
1137
|
+
const [open = false, setOpen] = index.$71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
64
1138
|
prop: openProp,
|
|
65
1139
|
defaultProp: defaultOpen,
|
|
66
1140
|
onChange: onOpenChange
|
|
67
1141
|
});
|
|
68
|
-
const [value, setValue] = index
|
|
1142
|
+
const [value, setValue] = index.$71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
69
1143
|
prop: valueProp,
|
|
70
1144
|
defaultProp: defaultValue,
|
|
71
1145
|
onChange: onValueChange
|
|
@@ -79,7 +1153,7 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
79
1153
|
// each time the options change.
|
|
80
1154
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option)=>option.props.value
|
|
81
1155
|
).join(';');
|
|
82
|
-
return /*#__PURE__*/ React.createElement(
|
|
1156
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectProvider, {
|
|
83
1157
|
required: required,
|
|
84
1158
|
scope: __scopeSelect,
|
|
85
1159
|
trigger: trigger,
|
|
@@ -88,7 +1162,7 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
88
1162
|
onValueNodeChange: setValueNode,
|
|
89
1163
|
valueNodeHasChildren: valueNodeHasChildren,
|
|
90
1164
|
onValueNodeHasChildrenChange: setValueNodeHasChildren,
|
|
91
|
-
contentId: index$
|
|
1165
|
+
contentId: index$4.$1746a345f3d73bb7$export$f680877a34711e37(),
|
|
92
1166
|
value: value,
|
|
93
1167
|
onValueChange: setValue,
|
|
94
1168
|
open: open,
|
|
@@ -135,7 +1209,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
135
1209
|
const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
|
|
136
1210
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$TRIGGER_NAME, __scopeSelect);
|
|
137
1211
|
const isDisabled = context.disabled || disabled;
|
|
138
|
-
const composedRefs = index
|
|
1212
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onTriggerChange);
|
|
139
1213
|
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
140
1214
|
const [searchRef, handleTypeaheadSearch, resetTypeahead] = $cc7e05a45900e73f$var$useTypeaheadSearch((search)=>{
|
|
141
1215
|
const enabledItems = getItems().filter((item)=>!item.disabled
|
|
@@ -151,9 +1225,9 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
151
1225
|
resetTypeahead();
|
|
152
1226
|
}
|
|
153
1227
|
};
|
|
154
|
-
return /*#__PURE__*/ React.createElement(
|
|
1228
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, index._extends({
|
|
155
1229
|
asChild: true
|
|
156
|
-
}, popperScope), /*#__PURE__*/ React.createElement(index
|
|
1230
|
+
}, popperScope), /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.button, index._extends({
|
|
157
1231
|
type: "button",
|
|
158
1232
|
role: "combobox",
|
|
159
1233
|
"aria-controls": context.contentId,
|
|
@@ -168,7 +1242,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
168
1242
|
}, triggerProps, {
|
|
169
1243
|
ref: composedRefs // Enable compatibility with native label or custom `Label` "click" for Safari:
|
|
170
1244
|
,
|
|
171
|
-
onClick: index
|
|
1245
|
+
onClick: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onClick, (event)=>{
|
|
172
1246
|
// Whilst browsers generally have no issue focusing the trigger when clicking
|
|
173
1247
|
// on a label, Safari seems to struggle with the fact that there's no `onClick`.
|
|
174
1248
|
// We force `focus` in this case. Note: this doesn't create any other side-effect
|
|
@@ -176,7 +1250,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
176
1250
|
// this only runs for a label "click"
|
|
177
1251
|
event.currentTarget.focus();
|
|
178
1252
|
}),
|
|
179
|
-
onPointerDown: index
|
|
1253
|
+
onPointerDown: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onPointerDown, (event)=>{
|
|
180
1254
|
// prevent implicit pointer capture
|
|
181
1255
|
// https://www.w3.org/TR/pointerevents3/#implicit-pointer-capture
|
|
182
1256
|
const target = event.target;
|
|
@@ -192,7 +1266,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
192
1266
|
event.preventDefault();
|
|
193
1267
|
}
|
|
194
1268
|
}),
|
|
195
|
-
onKeyDown: index
|
|
1269
|
+
onKeyDown: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onKeyDown, (event)=>{
|
|
196
1270
|
const isTypingAhead = searchRef.current !== '';
|
|
197
1271
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
198
1272
|
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
|
@@ -213,14 +1287,14 @@ const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ React.forwardRef
|
|
|
213
1287
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$VALUE_NAME, __scopeSelect);
|
|
214
1288
|
const { onValueNodeHasChildrenChange: onValueNodeHasChildrenChange } = context;
|
|
215
1289
|
const hasChildren = children !== undefined;
|
|
216
|
-
const composedRefs = index
|
|
217
|
-
index
|
|
1290
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onValueNodeChange);
|
|
1291
|
+
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
218
1292
|
onValueNodeHasChildrenChange(hasChildren);
|
|
219
1293
|
}, [
|
|
220
1294
|
onValueNodeHasChildrenChange,
|
|
221
1295
|
hasChildren
|
|
222
1296
|
]);
|
|
223
|
-
return /*#__PURE__*/ React.createElement(index
|
|
1297
|
+
return /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index._extends({}, valueProps, {
|
|
224
1298
|
ref: composedRefs // we don't want events from the portalled `SelectValue` children to bubble
|
|
225
1299
|
,
|
|
226
1300
|
style: {
|
|
@@ -230,14 +1304,14 @@ const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ React.forwardRef
|
|
|
230
1304
|
});
|
|
231
1305
|
const $cc7e05a45900e73f$export$99b400cabb58c515 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
232
1306
|
const { __scopeSelect: __scopeSelect , children: children , ...iconProps } = props;
|
|
233
|
-
return /*#__PURE__*/ React.createElement(index
|
|
1307
|
+
return /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index._extends({
|
|
234
1308
|
"aria-hidden": true
|
|
235
1309
|
}, iconProps, {
|
|
236
1310
|
ref: forwardedRef
|
|
237
1311
|
}), children || '▼');
|
|
238
1312
|
});
|
|
239
1313
|
const $cc7e05a45900e73f$export$b2af6c9944296213 = (props)=>{
|
|
240
|
-
return /*#__PURE__*/ React.createElement(
|
|
1314
|
+
return /*#__PURE__*/ React.createElement($f1701beae083dbae$export$602eac185826482c, index._extends({
|
|
241
1315
|
asChild: true
|
|
242
1316
|
}, props));
|
|
243
1317
|
};
|
|
@@ -247,7 +1321,7 @@ const $cc7e05a45900e73f$export$b2af6c9944296213 = (props)=>{
|
|
|
247
1321
|
const $cc7e05a45900e73f$export$c973a4b3cb86a03d = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
248
1322
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, props.__scopeSelect);
|
|
249
1323
|
const [fragment, setFragment] = React.useState(); // setting the fragment in `useLayoutEffect` as `DocumentFragment` doesn't exist on the server
|
|
250
|
-
index
|
|
1324
|
+
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
251
1325
|
setFragment(new DocumentFragment());
|
|
252
1326
|
}, []);
|
|
253
1327
|
if (!context.open) {
|
|
@@ -258,7 +1332,7 @@ const $cc7e05a45900e73f$export$c973a4b3cb86a03d = /*#__PURE__*/ React.forwardRef
|
|
|
258
1332
|
scope: props.__scopeSelect
|
|
259
1333
|
}, /*#__PURE__*/ React.createElement("div", null, props.children))), frag) : null;
|
|
260
1334
|
}
|
|
261
|
-
return /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectContentImpl, index
|
|
1335
|
+
return /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectContentImpl, index._extends({}, props, {
|
|
262
1336
|
ref: forwardedRef
|
|
263
1337
|
}));
|
|
264
1338
|
});
|
|
@@ -274,7 +1348,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
274
1348
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
|
|
275
1349
|
const [content, setContent] = React.useState(null);
|
|
276
1350
|
const [viewport, setViewport] = React.useState(null);
|
|
277
|
-
const composedRefs = index
|
|
1351
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
278
1352
|
);
|
|
279
1353
|
const [selectedItem, setSelectedItem] = React.useState(null);
|
|
280
1354
|
const [selectedItemText, setSelectedItemText] = React.useState(null);
|
|
@@ -287,7 +1361,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
287
1361
|
content
|
|
288
1362
|
]); // Make sure the whole tree has focus guards as our `Select` may be
|
|
289
1363
|
// the last element in the DOM (because of the `Portal`)
|
|
290
|
-
|
|
1364
|
+
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
291
1365
|
const focusFirst = React.useCallback((candidates)=>{
|
|
292
1366
|
const [firstItem, ...restItems] = getItems().map((item)=>item.ref.current
|
|
293
1367
|
);
|
|
@@ -438,10 +1512,10 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
438
1512
|
position: position,
|
|
439
1513
|
isPositioned: isPositioned,
|
|
440
1514
|
searchRef: searchRef
|
|
441
|
-
}, /*#__PURE__*/ React.createElement(
|
|
442
|
-
as: index
|
|
1515
|
+
}, /*#__PURE__*/ React.createElement($01b9c$RemoveScroll, {
|
|
1516
|
+
as: index.$5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
443
1517
|
allowPinchZoom: true
|
|
444
|
-
}, /*#__PURE__*/ React.createElement(
|
|
1518
|
+
}, /*#__PURE__*/ React.createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
445
1519
|
asChild: true // we make sure we're not trapping once it's been closed
|
|
446
1520
|
,
|
|
447
1521
|
trapped: context.open,
|
|
@@ -449,14 +1523,14 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
449
1523
|
// we prevent open autofocus because we manually focus the selected item
|
|
450
1524
|
event.preventDefault();
|
|
451
1525
|
},
|
|
452
|
-
onUnmountAutoFocus: index
|
|
1526
|
+
onUnmountAutoFocus: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(onCloseAutoFocus, (event)=>{
|
|
453
1527
|
var _context$trigger;
|
|
454
1528
|
(_context$trigger = context.trigger) === null || _context$trigger === void 0 || _context$trigger.focus({
|
|
455
1529
|
preventScroll: true
|
|
456
1530
|
});
|
|
457
1531
|
event.preventDefault();
|
|
458
1532
|
})
|
|
459
|
-
}, /*#__PURE__*/ React.createElement(
|
|
1533
|
+
}, /*#__PURE__*/ React.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
460
1534
|
asChild: true,
|
|
461
1535
|
disableOutsidePointerEvents: true,
|
|
462
1536
|
onEscapeKeyDown: onEscapeKeyDown,
|
|
@@ -465,7 +1539,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
465
1539
|
onFocusOutside: (event)=>event.preventDefault()
|
|
466
1540
|
,
|
|
467
1541
|
onDismiss: ()=>context.onOpenChange(false)
|
|
468
|
-
}, /*#__PURE__*/ React.createElement(SelectPosition, index
|
|
1542
|
+
}, /*#__PURE__*/ React.createElement(SelectPosition, index._extends({
|
|
469
1543
|
role: "listbox",
|
|
470
1544
|
id: context.contentId,
|
|
471
1545
|
"data-state": context.open ? 'open' : 'closed',
|
|
@@ -483,7 +1557,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
483
1557
|
outline: 'none',
|
|
484
1558
|
...contentProps.style
|
|
485
1559
|
},
|
|
486
|
-
onKeyDown: index
|
|
1560
|
+
onKeyDown: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event)=>{
|
|
487
1561
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; // select should not be navigated using tab key so we prevent it
|
|
488
1562
|
if (event.key === 'Tab') event.preventDefault();
|
|
489
1563
|
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
|
@@ -525,7 +1599,7 @@ const $cc7e05a45900e73f$var$SelectItemAlignedPosition = /*#__PURE__*/ React.forw
|
|
|
525
1599
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
|
|
526
1600
|
const [contentWrapper, setContentWrapper] = React.useState(null);
|
|
527
1601
|
const [content, setContent] = React.useState(null);
|
|
528
|
-
const composedRefs = index
|
|
1602
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
529
1603
|
);
|
|
530
1604
|
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
531
1605
|
const shouldExpandOnScrollRef = React.useRef(false);
|
|
@@ -623,12 +1697,12 @@ const $cc7e05a45900e73f$var$SelectItemAlignedPosition = /*#__PURE__*/ React.forw
|
|
|
623
1697
|
context.dir,
|
|
624
1698
|
onPlaced
|
|
625
1699
|
]);
|
|
626
|
-
index
|
|
1700
|
+
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>position()
|
|
627
1701
|
, [
|
|
628
1702
|
position
|
|
629
1703
|
]); // copy z-index from content to wrapper
|
|
630
1704
|
const [contentZIndex, setContentZIndex] = React.useState();
|
|
631
|
-
index
|
|
1705
|
+
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
632
1706
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
633
1707
|
}, [
|
|
634
1708
|
content
|
|
@@ -659,7 +1733,7 @@ const $cc7e05a45900e73f$var$SelectItemAlignedPosition = /*#__PURE__*/ React.forw
|
|
|
659
1733
|
position: 'fixed',
|
|
660
1734
|
zIndex: contentZIndex
|
|
661
1735
|
}
|
|
662
|
-
}, /*#__PURE__*/ React.createElement(index
|
|
1736
|
+
}, /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index._extends({}, popperProps, {
|
|
663
1737
|
ref: composedRefs,
|
|
664
1738
|
style: {
|
|
665
1739
|
// When we get the height of the content, it includes borders. If we were to set
|
|
@@ -674,7 +1748,7 @@ const $cc7e05a45900e73f$var$SelectItemAlignedPosition = /*#__PURE__*/ React.forw
|
|
|
674
1748
|
const $cc7e05a45900e73f$var$SelectPopperPosition = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
675
1749
|
const { __scopeSelect: __scopeSelect , align: align = 'start' , collisionPadding: collisionPadding = $cc7e05a45900e73f$var$CONTENT_MARGIN , ...popperProps } = props;
|
|
676
1750
|
const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
|
|
677
|
-
return /*#__PURE__*/ React.createElement(
|
|
1751
|
+
return /*#__PURE__*/ React.createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, index._extends({}, popperScope, popperProps, {
|
|
678
1752
|
ref: forwardedRef,
|
|
679
1753
|
align: align,
|
|
680
1754
|
collisionPadding: collisionPadding,
|
|
@@ -698,7 +1772,7 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React.forwardRef
|
|
|
698
1772
|
const { __scopeSelect: __scopeSelect , ...viewportProps } = props;
|
|
699
1773
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
|
|
700
1774
|
const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
|
|
701
|
-
const composedRefs = index
|
|
1775
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onViewportChange);
|
|
702
1776
|
const prevScrollTopRef = React.useRef(0);
|
|
703
1777
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("style", {
|
|
704
1778
|
dangerouslySetInnerHTML: {
|
|
@@ -706,7 +1780,7 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React.forwardRef
|
|
|
706
1780
|
}
|
|
707
1781
|
}), /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
708
1782
|
scope: __scopeSelect
|
|
709
|
-
}, /*#__PURE__*/ React.createElement(index
|
|
1783
|
+
}, /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index._extends({
|
|
710
1784
|
"data-radix-select-viewport": "",
|
|
711
1785
|
role: "presentation"
|
|
712
1786
|
}, viewportProps, {
|
|
@@ -720,7 +1794,7 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React.forwardRef
|
|
|
720
1794
|
overflow: 'auto',
|
|
721
1795
|
...viewportProps.style
|
|
722
1796
|
},
|
|
723
|
-
onScroll: index
|
|
1797
|
+
onScroll: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(viewportProps.onScroll, (event)=>{
|
|
724
1798
|
const viewport = event.currentTarget;
|
|
725
1799
|
const { contentWrapper: contentWrapper , shouldExpandOnScrollRef: shouldExpandOnScrollRef } = viewportContext;
|
|
726
1800
|
if (shouldExpandOnScrollRef !== null && shouldExpandOnScrollRef !== void 0 && shouldExpandOnScrollRef.current && contentWrapper) {
|
|
@@ -761,11 +1835,11 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
761
1835
|
const isSelected = context.value === value;
|
|
762
1836
|
const [textValue, setTextValue] = React.useState(textValueProp !== null && textValueProp !== void 0 ? textValueProp : '');
|
|
763
1837
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
764
|
-
const composedRefs = index
|
|
1838
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>{
|
|
765
1839
|
var _contentContext$itemR;
|
|
766
1840
|
return (_contentContext$itemR = contentContext.itemRefCallback) === null || _contentContext$itemR === void 0 ? void 0 : _contentContext$itemR.call(contentContext, node, value, disabled);
|
|
767
1841
|
});
|
|
768
|
-
const textId = index$
|
|
1842
|
+
const textId = index$4.$1746a345f3d73bb7$export$f680877a34711e37();
|
|
769
1843
|
const handleSelect = ()=>{
|
|
770
1844
|
if (!disabled) {
|
|
771
1845
|
context.onValueChange(value);
|
|
@@ -790,7 +1864,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
790
1864
|
value: value,
|
|
791
1865
|
disabled: disabled,
|
|
792
1866
|
textValue: textValue
|
|
793
|
-
}, /*#__PURE__*/ React.createElement(index
|
|
1867
|
+
}, /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index._extends({
|
|
794
1868
|
role: "option",
|
|
795
1869
|
"aria-labelledby": textId,
|
|
796
1870
|
"data-highlighted": isFocused ? '' : undefined // `isFocused` caveat fixes stuttering in VoiceOver
|
|
@@ -802,12 +1876,12 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
802
1876
|
tabIndex: disabled ? undefined : -1
|
|
803
1877
|
}, itemProps, {
|
|
804
1878
|
ref: composedRefs,
|
|
805
|
-
onFocus: index
|
|
1879
|
+
onFocus: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onFocus, ()=>setIsFocused(true)
|
|
806
1880
|
),
|
|
807
|
-
onBlur: index
|
|
1881
|
+
onBlur: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onBlur, ()=>setIsFocused(false)
|
|
808
1882
|
),
|
|
809
|
-
onPointerUp: index
|
|
810
|
-
onPointerMove: index
|
|
1883
|
+
onPointerUp: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerUp, handleSelect),
|
|
1884
|
+
onPointerMove: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerMove, (event)=>{
|
|
811
1885
|
if (disabled) {
|
|
812
1886
|
var _contentContext$onIte;
|
|
813
1887
|
(_contentContext$onIte = contentContext.onItemLeave) === null || _contentContext$onIte === void 0 || _contentContext$onIte.call(contentContext);
|
|
@@ -817,13 +1891,13 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
817
1891
|
preventScroll: true
|
|
818
1892
|
});
|
|
819
1893
|
}),
|
|
820
|
-
onPointerLeave: index
|
|
1894
|
+
onPointerLeave: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerLeave, (event)=>{
|
|
821
1895
|
if (event.currentTarget === document.activeElement) {
|
|
822
1896
|
var _contentContext$onIte2;
|
|
823
1897
|
(_contentContext$onIte2 = contentContext.onItemLeave) === null || _contentContext$onIte2 === void 0 || _contentContext$onIte2.call(contentContext);
|
|
824
1898
|
}
|
|
825
1899
|
}),
|
|
826
|
-
onKeyDown: index
|
|
1900
|
+
onKeyDown: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onKeyDown, (event)=>{
|
|
827
1901
|
var _contentContext$searc;
|
|
828
1902
|
const isTypingAhead = ((_contentContext$searc = contentContext.searchRef) === null || _contentContext$searc === void 0 ? void 0 : _contentContext$searc.current) !== '';
|
|
829
1903
|
if (isTypingAhead && event.key === ' ') return;
|
|
@@ -843,7 +1917,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React.forwardRef
|
|
|
843
1917
|
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
844
1918
|
const nativeOptionsContext = $cc7e05a45900e73f$var$useSelectNativeOptionsContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
845
1919
|
const [itemTextNode, setItemTextNode] = React.useState(null);
|
|
846
|
-
const composedRefs = index
|
|
1920
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setItemTextNode(node)
|
|
847
1921
|
, itemContext.onItemTextChange, (node)=>{
|
|
848
1922
|
var _contentContext$itemT;
|
|
849
1923
|
return (_contentContext$itemT = contentContext.itemTextRefCallback) === null || _contentContext$itemT === void 0 ? void 0 : _contentContext$itemT.call(contentContext, node, itemContext.value, itemContext.disabled);
|
|
@@ -860,7 +1934,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React.forwardRef
|
|
|
860
1934
|
textContent
|
|
861
1935
|
]);
|
|
862
1936
|
const { onNativeOptionAdd: onNativeOptionAdd , onNativeOptionRemove: onNativeOptionRemove } = nativeOptionsContext;
|
|
863
|
-
index
|
|
1937
|
+
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
864
1938
|
onNativeOptionAdd(nativeOption);
|
|
865
1939
|
return ()=>onNativeOptionRemove(nativeOption)
|
|
866
1940
|
;
|
|
@@ -869,7 +1943,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React.forwardRef
|
|
|
869
1943
|
onNativeOptionRemove,
|
|
870
1944
|
nativeOption
|
|
871
1945
|
]);
|
|
872
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(index
|
|
1946
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index._extends({
|
|
873
1947
|
id: itemContext.textId
|
|
874
1948
|
}, itemTextProps, {
|
|
875
1949
|
ref: composedRefs
|
|
@@ -881,7 +1955,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React.forwardRef
|
|
|
881
1955
|
const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
882
1956
|
const { __scopeSelect: __scopeSelect , ...itemIndicatorProps } = props;
|
|
883
1957
|
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_INDICATOR_NAME, __scopeSelect);
|
|
884
|
-
return itemContext.isSelected ? /*#__PURE__*/ React.createElement(index
|
|
1958
|
+
return itemContext.isSelected ? /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index._extends({
|
|
885
1959
|
"aria-hidden": true
|
|
886
1960
|
}, itemIndicatorProps, {
|
|
887
1961
|
ref: forwardedRef
|
|
@@ -894,8 +1968,8 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React.forwardRef
|
|
|
894
1968
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
895
1969
|
const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
896
1970
|
const [canScrollUp1, setCanScrollUp] = React.useState(false);
|
|
897
|
-
const composedRefs = index
|
|
898
|
-
index
|
|
1971
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, viewportContext.onScrollButtonChange);
|
|
1972
|
+
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
899
1973
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
900
1974
|
const viewport = contentContext.viewport;
|
|
901
1975
|
function handleScroll() {
|
|
@@ -911,7 +1985,7 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React.forwardRef
|
|
|
911
1985
|
contentContext.viewport,
|
|
912
1986
|
contentContext.isPositioned
|
|
913
1987
|
]);
|
|
914
|
-
return canScrollUp1 ? /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, index
|
|
1988
|
+
return canScrollUp1 ? /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, index._extends({}, props, {
|
|
915
1989
|
ref: composedRefs,
|
|
916
1990
|
onAutoScroll: ()=>{
|
|
917
1991
|
const { viewport: viewport , selectedItem: selectedItem } = contentContext;
|
|
@@ -926,8 +2000,8 @@ const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React.forwardRef(
|
|
|
926
2000
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
927
2001
|
const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
928
2002
|
const [canScrollDown1, setCanScrollDown] = React.useState(false);
|
|
929
|
-
const composedRefs = index
|
|
930
|
-
index
|
|
2003
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, viewportContext.onScrollButtonChange);
|
|
2004
|
+
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
931
2005
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
932
2006
|
const viewport = contentContext.viewport;
|
|
933
2007
|
function handleScroll() {
|
|
@@ -945,7 +2019,7 @@ const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React.forwardRef(
|
|
|
945
2019
|
contentContext.viewport,
|
|
946
2020
|
contentContext.isPositioned
|
|
947
2021
|
]);
|
|
948
|
-
return canScrollDown1 ? /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, index
|
|
2022
|
+
return canScrollDown1 ? /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, index._extends({}, props, {
|
|
949
2023
|
ref: composedRefs,
|
|
950
2024
|
onAutoScroll: ()=>{
|
|
951
2025
|
const { viewport: viewport , selectedItem: selectedItem } = contentContext;
|
|
@@ -973,7 +2047,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
973
2047
|
// Because it is part of the normal flow, it will push down (top button) or shrink (bottom button)
|
|
974
2048
|
// the viewport, potentially causing the active item to now be partially out of view.
|
|
975
2049
|
// We re-run the `scrollIntoView` logic to make sure it stays within the viewport.
|
|
976
|
-
index
|
|
2050
|
+
index.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
977
2051
|
var _activeItem$ref$curre;
|
|
978
2052
|
const activeItem = getItems().find((item)=>item.ref.current === document.activeElement
|
|
979
2053
|
);
|
|
@@ -983,7 +2057,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
983
2057
|
}, [
|
|
984
2058
|
getItems
|
|
985
2059
|
]);
|
|
986
|
-
return /*#__PURE__*/ React.createElement(index
|
|
2060
|
+
return /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index._extends({
|
|
987
2061
|
"aria-hidden": true
|
|
988
2062
|
}, scrollIndicatorProps, {
|
|
989
2063
|
ref: forwardedRef,
|
|
@@ -991,15 +2065,15 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
991
2065
|
flexShrink: 0,
|
|
992
2066
|
...scrollIndicatorProps.style
|
|
993
2067
|
},
|
|
994
|
-
onPointerDown: index
|
|
2068
|
+
onPointerDown: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerDown, ()=>{
|
|
995
2069
|
if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
996
2070
|
}),
|
|
997
|
-
onPointerMove: index
|
|
2071
|
+
onPointerMove: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerMove, ()=>{
|
|
998
2072
|
var _contentContext$onIte3;
|
|
999
2073
|
(_contentContext$onIte3 = contentContext.onItemLeave) === null || _contentContext$onIte3 === void 0 || _contentContext$onIte3.call(contentContext);
|
|
1000
2074
|
if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
1001
2075
|
}),
|
|
1002
|
-
onPointerLeave: index
|
|
2076
|
+
onPointerLeave: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerLeave, ()=>{
|
|
1003
2077
|
clearAutoScrollTimer();
|
|
1004
2078
|
})
|
|
1005
2079
|
}));
|
|
@@ -1010,8 +2084,8 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
1010
2084
|
const $cc7e05a45900e73f$var$BubbleSelect = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
1011
2085
|
const { value: value , ...selectProps } = props;
|
|
1012
2086
|
const ref = React.useRef(null);
|
|
1013
|
-
const composedRefs = index
|
|
1014
|
-
const prevValue = index$
|
|
2087
|
+
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
2088
|
+
const prevValue = index$2.$010c2913dbd2fe3d$export$5cae361ad82dce8b(value); // Bubble value change to parents (e.g form change event)
|
|
1015
2089
|
React.useEffect(()=>{
|
|
1016
2090
|
const select = ref.current;
|
|
1017
2091
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
@@ -1039,16 +2113,16 @@ const $cc7e05a45900e73f$var$BubbleSelect = /*#__PURE__*/ React.forwardRef((props
|
|
|
1039
2113
|
*
|
|
1040
2114
|
* We use `VisuallyHidden` rather than `display: "none"` because Safari autofill
|
|
1041
2115
|
* won't work otherwise.
|
|
1042
|
-
*/ return /*#__PURE__*/ React.createElement(index$
|
|
2116
|
+
*/ return /*#__PURE__*/ React.createElement(index$1.$ea1ef594cf570d83$export$439d29a4e110a164, {
|
|
1043
2117
|
asChild: true
|
|
1044
|
-
}, /*#__PURE__*/ React.createElement("select", index
|
|
2118
|
+
}, /*#__PURE__*/ React.createElement("select", index._extends({}, selectProps, {
|
|
1045
2119
|
ref: composedRefs,
|
|
1046
2120
|
defaultValue: value
|
|
1047
2121
|
})));
|
|
1048
2122
|
});
|
|
1049
2123
|
$cc7e05a45900e73f$var$BubbleSelect.displayName = 'BubbleSelect';
|
|
1050
2124
|
function $cc7e05a45900e73f$var$useTypeaheadSearch(onSearchChange) {
|
|
1051
|
-
const handleSearchChange = index
|
|
2125
|
+
const handleSearchChange = index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onSearchChange);
|
|
1052
2126
|
const searchRef = React.useRef('');
|
|
1053
2127
|
const timerRef = React.useRef(0);
|
|
1054
2128
|
const handleTypeaheadSearch = React.useCallback((key)=>{
|
|
@@ -1129,7 +2203,7 @@ const $cc7e05a45900e73f$export$bf1aedc3039c8d63 = $cc7e05a45900e73f$export$ff951
|
|
|
1129
2203
|
/** Use `Select` to choose from a dropdown list of options. */
|
|
1130
2204
|
var Select = function (_a) {
|
|
1131
2205
|
var _b;
|
|
1132
|
-
var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, value = _a.value, _c = _a.ariaLabel, ariaLabel = _c === void 0 ? label : _c, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, hideLabel = _a.hideLabel, name = _a.name, width = _a.width, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, _d = _a.selectSize, selectSize = _d === void 0 ? "m" : _d, props =
|
|
2206
|
+
var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, value = _a.value, _c = _a.ariaLabel, ariaLabel = _c === void 0 ? label : _c, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, hideLabel = _a.hideLabel, name = _a.name, width = _a.width, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, _d = _a.selectSize, selectSize = _d === void 0 ? "m" : _d, props = index_es.__rest(_a, ["isRequired", "isDisabled", "placeholder", "label", "value", "ariaLabel", "options", "onOpenChange", "isDefaultOpen", "defaultValue", "errorMessage", "labelSize", "helper", "hideLabel", "name", "width", "isFluid", "onBlur", "onChange", "disclosureTitle", "disclosureText", "onClickDisclosure", "selectSize"]);
|
|
1133
2207
|
var id = React.useId();
|
|
1134
2208
|
var _e = component.useThemeElement(), themeElement = _e[0], setThemeElement = _e[1];
|
|
1135
2209
|
var surface = React.useContext(Surface.Context).surface;
|
|
@@ -1157,18 +2231,18 @@ var Select = function (_a) {
|
|
|
1157
2231
|
return (React__default["default"].createElement(FormControl.FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, label: label, hideLabel: hideLabel, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", isDisabled: isDisabled, disclosureText: disclosureText, disclosureTitle: disclosureTitle, onClickDisclosure: onClickDisclosure },
|
|
1158
2232
|
React__default["default"].createElement($cc7e05a45900e73f$export$be92b6f5f03c0fe9, { name: name, required: isRequired, disabled: isDisabled, defaultOpen: isDefaultOpen, value: selectValue, onOpenChange: onOpenChange, onValueChange: function (value) { return onValueChange(value); } },
|
|
1159
2233
|
React__default["default"].createElement("div", { ref: setThemeElement, className: "arc-Select-wrapper" },
|
|
1160
|
-
React__default["default"].createElement($cc7e05a45900e73f$export$41fb9f06171c75f4,
|
|
2234
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$41fb9f06171c75f4, index_es.__assign({ id: id, name: name, onBlur: onBlur, "aria-label": ariaLabel, style: { width: width }, className: index$5.classNames("arc-Select-trigger", (_b = {
|
|
1161
2235
|
"arc-Select-trigger--constrained": !isFluid,
|
|
1162
2236
|
"arc-Select-trigger--onDarkSurface": surface === "dark",
|
|
1163
2237
|
"arc-Select-trigger--invalid": errorMessage
|
|
1164
2238
|
},
|
|
1165
2239
|
_b["arc-Select-trigger--size".concat(selectSize && selectSize.toUpperCase())] = selectSize && selectSize !== "m",
|
|
1166
|
-
_b)), "aria-describedby": ""
|
|
2240
|
+
_b)), "aria-describedby": id + (disclosureText ? "-disclosure" : "-helper") }, index_es.filterDataAttrs(props)),
|
|
1167
2241
|
React__default["default"].createElement($cc7e05a45900e73f$export$4c8d1a57a761ef94, { className: "arc-Select-triggerText", placeholder: placeholder, "aria-label": getSelectedValueName(uncontrolledValue) }),
|
|
1168
2242
|
React__default["default"].createElement($cc7e05a45900e73f$export$f04a61298a47a40f, { className: "arc-Select-triggerIcon" },
|
|
1169
2243
|
React__default["default"].createElement(ThemeIcon.ThemeIcon, { size: getIconSize(selectSize), icon: "selectTrigger" }))),
|
|
1170
2244
|
React__default["default"].createElement($cc7e05a45900e73f$export$602eac185826482c, { container: themeElement },
|
|
1171
|
-
React__default["default"].createElement($cc7e05a45900e73f$export$7c6e2c02157bb7d2, { sideOffset: 5, position: "popper", className: index$
|
|
2245
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$7c6e2c02157bb7d2, { sideOffset: 5, position: "popper", className: index$5.classNames("arc-Select-content", {
|
|
1172
2246
|
"arc-Select-content--onDarkSurface": surface === "dark"
|
|
1173
2247
|
}) },
|
|
1174
2248
|
React__default["default"].createElement($cc7e05a45900e73f$export$2f60d3ec9ad468f2, { className: "arc-Select-scrollButton" },
|