@arc-ui/components 12.0.0-alpha.0 → 12.0.0-beta.4
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 +11 -15
- package/dist/Alert/Alert.esm.js +9 -13
- package/dist/Align/Align.cjs.js +6 -6
- package/dist/Align/Align.esm.js +2 -2
- package/dist/AppButton/AppButton.cjs.js +73 -0
- package/dist/AppButton/AppButton.esm.js +65 -0
- package/dist/AppButton/package.json +7 -0
- package/dist/Avatar/Avatar.cjs.js +18 -0
- package/dist/Avatar/Avatar.esm.js +10 -0
- package/dist/Avatar/package.json +7 -0
- package/dist/AvatarGroup/AvatarGroup.cjs.js +38 -0
- package/dist/AvatarGroup/AvatarGroup.esm.js +30 -0
- package/dist/AvatarGroup/package.json +7 -0
- package/dist/Badge/Badge.cjs.js +6 -21
- package/dist/Badge/Badge.esm.js +6 -21
- package/dist/Box/Box.cjs.js +6 -7
- package/dist/Box/Box.esm.js +3 -4
- package/dist/BrandLogo/BrandLogo.cjs.js +4 -4
- package/dist/BrandLogo/BrandLogo.esm.js +4 -4
- package/dist/Breadcrumbs/Breadcrumbs.cjs.js +7 -6
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +7 -6
- package/dist/Button/Button.cjs.js +6 -6
- package/dist/Button/Button.esm.js +6 -6
- package/dist/ButtonV2/ButtonV2.cjs.js +16 -0
- package/dist/ButtonV2/ButtonV2.esm.js +8 -0
- package/dist/ButtonV2/package.json +7 -0
- package/dist/Calendar/Calendar.cjs.js +22 -0
- package/dist/Calendar/Calendar.esm.js +14 -0
- package/dist/Calendar/package.json +7 -0
- package/dist/Checkbox/Checkbox.cjs.js +9 -8
- package/dist/Checkbox/Checkbox.esm.js +9 -8
- package/dist/Columns/Columns.cjs.js +3 -3
- package/dist/Columns/Columns.esm.js +3 -3
- package/dist/DatePicker/DatePicker.cjs.js +40 -0
- package/dist/DatePicker/DatePicker.esm.js +27 -0
- package/dist/DatePicker/package.json +7 -0
- package/dist/Disclosure/Disclosure.cjs.js +15 -12
- package/dist/Disclosure/Disclosure.esm.js +12 -9
- package/dist/DisclosureMini/DisclosureMini.cjs.js +6 -6
- package/dist/DisclosureMini/DisclosureMini.esm.js +6 -6
- package/dist/Elevation/Elevation.cjs.js +5 -5
- package/dist/Elevation/Elevation.esm.js +1 -1
- package/dist/Filter/Filter.cjs.js +4 -3
- package/dist/Filter/Filter.esm.js +4 -3
- package/dist/FormControl/FormControl.cjs.js +8 -7
- package/dist/FormControl/FormControl.esm.js +8 -7
- package/dist/Grid/Grid.cjs.js +13 -0
- package/dist/Grid/Grid.esm.js +5 -0
- package/dist/Grid/package.json +7 -0
- package/dist/Group/Group.cjs.js +3 -3
- package/dist/Group/Group.esm.js +3 -3
- package/dist/Heading/Heading.cjs.js +4 -4
- package/dist/Heading/Heading.esm.js +4 -4
- package/dist/HeroButton/HeroButton.cjs.js +16 -0
- package/dist/HeroButton/HeroButton.esm.js +8 -0
- package/dist/HeroButton/package.json +7 -0
- package/dist/Hidden/Hidden.cjs.js +24 -0
- package/dist/Hidden/Hidden.esm.js +16 -0
- package/dist/Hidden/package.json +7 -0
- package/dist/Icon/Icon.cjs.js +4 -4
- package/dist/Icon/Icon.esm.js +4 -4
- package/dist/Image/Image.cjs.js +3 -3
- package/dist/Image/Image.esm.js +3 -3
- package/dist/ImpactCard/ImpactCard.cjs.js +44 -0
- package/dist/ImpactCard/ImpactCard.esm.js +36 -0
- package/dist/ImpactCard/package.json +7 -0
- package/dist/InformationCard/InformationCard.cjs.js +74 -0
- package/dist/InformationCard/InformationCard.esm.js +66 -0
- package/dist/InformationCard/package.json +7 -0
- package/dist/Link/Link.cjs.js +76 -0
- package/dist/Link/Link.esm.js +68 -0
- package/dist/Link/package.json +7 -0
- package/dist/Markup/Markup.cjs.js +6 -6
- package/dist/Markup/Markup.esm.js +2 -2
- package/dist/MediaCard/MediaCard.cjs.js +26 -0
- package/dist/MediaCard/MediaCard.esm.js +18 -0
- package/dist/MediaCard/package.json +7 -0
- package/dist/Modal/Modal.cjs.js +1478 -527
- package/dist/Modal/Modal.esm.js +1455 -523
- package/dist/Pagination/Pagination.cjs.js +14 -17
- package/dist/Pagination/Pagination.esm.js +7 -10
- package/dist/PaginationSimple/PaginationSimple.cjs.js +24 -27
- package/dist/PaginationSimple/PaginationSimple.esm.js +22 -25
- package/dist/Poster/Poster.cjs.js +5 -5
- package/dist/Poster/Poster.esm.js +5 -5
- package/dist/ProgressBar/ProgressBar.cjs.js +21 -18
- package/dist/ProgressBar/ProgressBar.esm.js +17 -14
- package/dist/ProgressStepper/ProgressStepper.cjs.js +6 -7
- package/dist/ProgressStepper/ProgressStepper.esm.js +6 -7
- package/dist/RadioGroup/RadioGroup.cjs.js +10 -8
- package/dist/RadioGroup/RadioGroup.esm.js +9 -8
- package/dist/Rule/Rule.cjs.js +14 -4
- package/dist/Rule/Rule.esm.js +15 -5
- package/dist/ScrollToTop/ScrollToTop.cjs.js +12 -11
- package/dist/ScrollToTop/ScrollToTop.esm.js +7 -6
- package/dist/Section/Section.cjs.js +2 -2
- package/dist/Section/Section.esm.js +2 -2
- package/dist/Select/Select.cjs.js +358 -931
- package/dist/Select/Select.esm.js +304 -858
- package/dist/SiteFooter/SiteFooter.cjs.js +10 -33
- package/dist/SiteFooter/SiteFooter.esm.js +10 -33
- package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +25 -0
- package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +17 -0
- package/dist/SiteHeaderV2/package.json +7 -0
- package/dist/SkipLink/SkipLink.cjs.js +24 -0
- package/dist/SkipLink/SkipLink.esm.js +16 -0
- package/dist/SkipLink/package.json +7 -0
- package/dist/Surface/Surface.cjs.js +2 -2
- package/dist/Surface/Surface.esm.js +2 -2
- package/dist/Switch/Switch.cjs.js +28 -73
- package/dist/Switch/Switch.esm.js +16 -61
- package/dist/Tabs/Tabs.cjs.js +11 -10
- package/dist/Tabs/Tabs.esm.js +11 -10
- package/dist/Tag/Tag.cjs.js +9 -43
- package/dist/Tag/Tag.esm.js +8 -42
- package/dist/Text/Text.cjs.js +4 -4
- package/dist/Text/Text.esm.js +4 -4
- package/dist/TextArea/TextArea.cjs.js +66 -46
- package/dist/TextArea/TextArea.esm.js +64 -44
- package/dist/TextInput/TextInput.cjs.js +10 -9
- package/dist/TextInput/TextInput.esm.js +10 -9
- package/dist/Theme/Theme.cjs.js +15 -4
- package/dist/Theme/Theme.esm.js +15 -4
- package/dist/ThemeIcon/ThemeIcon.cjs.js +14 -0
- package/dist/ThemeIcon/ThemeIcon.esm.js +6 -0
- package/dist/ThemeIcon/package.json +7 -0
- package/dist/Toast/Toast.cjs.js +10 -9
- package/dist/Toast/Toast.esm.js +10 -9
- package/dist/Truncate/Truncate.cjs.js +3 -3
- package/dist/Truncate/Truncate.esm.js +1 -1
- package/dist/TypographyCard/TypographyCard.cjs.js +41 -0
- package/dist/TypographyCard/TypographyCard.esm.js +33 -0
- package/dist/TypographyCard/package.json +7 -0
- package/dist/UniversalHeader/UniversalHeader.cjs.js +3 -3
- package/dist/UniversalHeader/UniversalHeader.esm.js +3 -3
- package/dist/VerticalSpace/VerticalSpace.cjs.js +2 -2
- package/dist/VerticalSpace/VerticalSpace.esm.js +2 -2
- package/dist/VideoPlayer/VideoPlayer.cjs.js +3013 -0
- package/dist/VideoPlayer/VideoPlayer.esm.js +3005 -0
- package/dist/VideoPlayer/package.json +7 -0
- package/dist/Visible/Visible.cjs.js +24 -0
- package/dist/Visible/Visible.esm.js +16 -0
- package/dist/Visible/package.json +7 -0
- package/dist/VisuallyHidden/VisuallyHidden.cjs.js +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.esm.js +1 -1
- package/dist/_shared/cjs/ArcIconEclipse.esm-ac777a76.js +28 -0
- package/dist/_shared/cjs/Avatar-fc0d9b8b.js +49 -0
- package/dist/_shared/cjs/{BrandLogo-aea340c8.js → BrandLogo-1d2ca2c7.js} +7 -7
- package/dist/_shared/cjs/{Breadcrumbs-f3385e2e.js → Breadcrumbs-7af0af2c.js} +16 -16
- package/dist/_shared/cjs/BtIconArrowRight.esm-5989f2ca.js +38 -0
- package/dist/_shared/cjs/BtIconChevronRightMid.esm-3e8d18a9.js +28 -0
- package/dist/_shared/cjs/BtIconPlayFill.esm-b8997cfc.js +30 -0
- package/dist/_shared/cjs/{Button-5c958ce9.js → Button-7d891a89.js} +12 -12
- package/dist/_shared/cjs/ButtonV2-b2db3f46.js +48 -0
- package/dist/_shared/cjs/Calendar-4a63f28d.js +1927 -0
- package/dist/_shared/cjs/CardFooter-5414bc4f.js +79 -0
- package/dist/_shared/cjs/{Checkbox-5f14bb0d.js → Checkbox-0e423653.js} +18 -14
- package/dist/_shared/cjs/{Columns-ae4f8cef.js → Columns-1224bdff.js} +9 -16
- package/dist/_shared/cjs/Combination-3a639f6d.js +2974 -0
- package/dist/_shared/cjs/ConditionalWrapper-be3b2625.js +14 -0
- package/dist/_shared/cjs/DatePicker-cd21e362.js +550 -0
- package/dist/_shared/cjs/{DisclosureMini-145105a4.js → DisclosureMini-c01ecce0.js} +12 -15
- package/dist/_shared/cjs/{Filter-1bde635c.js → Filter-3b897d92.js} +32 -24
- package/dist/_shared/cjs/{FormControl-30f2330f.js → FormControl-88d48f42.js} +32 -17
- package/dist/_shared/cjs/Grid-9e91fb3d.js +46 -0
- package/dist/_shared/cjs/{Group-0429741a.js → Group-3d5ea240.js} +9 -16
- package/dist/_shared/cjs/{Heading-27cba320.js → Heading-fb63844f.js} +7 -7
- package/dist/_shared/cjs/HeroButton-0586a7c4.js +126 -0
- package/dist/_shared/cjs/{Icon-a47b6c0a.js → Icon-0ec0c1fb.js} +12 -8
- package/dist/_shared/cjs/Image-e9a5a326.js +56 -0
- package/dist/_shared/cjs/MediaCard-4ccbb3ee.js +65 -0
- package/dist/_shared/cjs/{Poster-499b78da.js → Poster-b7242b37.js} +14 -14
- package/dist/_shared/cjs/Preview-0bf3f6e8.js +167 -0
- package/dist/_shared/cjs/ProgressStepper-fb8405c2.js +121 -0
- package/dist/_shared/cjs/RadioGroup-a4186267.js +85 -0
- package/dist/_shared/cjs/{Section-59804166.js → Section-ecfc659b.js} +5 -5
- package/dist/_shared/cjs/{SiteFooter-0638c27c.js → SiteFooter-e344da9f.js} +13 -12
- package/dist/_shared/cjs/SiteHeaderV2-cd793f59.js +689 -0
- package/dist/_shared/cjs/{Surface-038db6e1.js → Surface-8599dbe4.js} +23 -23
- package/dist/_shared/cjs/{Tabs-ade6d6b6.js → Tabs-75c34f43.js} +35 -39
- package/dist/_shared/cjs/Tag-452048f6.js +44 -0
- package/dist/_shared/cjs/{Text-606ca3a2.js → Text-1c1110a4.js} +7 -7
- package/dist/_shared/cjs/TextInput-762e2309.js +103 -0
- package/dist/_shared/cjs/{ThemeIcon-9534f091.js → ThemeIcon-ee814862.js} +8 -8
- package/dist/_shared/cjs/{Toast-6d4021d7.js → Toast-d06a89e0.js} +283 -44
- package/dist/_shared/cjs/UniversalHeader-f6d9c63a.js +29 -0
- package/dist/_shared/cjs/{VerticalSpace-dc53bb70.js → VerticalSpace-e128ec68.js} +5 -5
- package/dist/_shared/cjs/{VisuallyHidden-e2c8b291.js → VisuallyHidden-b0de4c7b.js} +1 -1
- package/dist/_shared/cjs/_commonjsHelpers-56412ec5.js +21 -0
- package/dist/_shared/cjs/{index-38d3848e.js → component-df82bc05.js} +154 -435
- package/dist/_shared/cjs/{debounce-123468fb.js → debounce-a74c28cf.js} +2 -2
- package/dist/_shared/cjs/index-039a9d35.js +23 -0
- package/dist/_shared/cjs/{index-23b4f49f.js → index-0c6319ec.js} +1 -1
- package/dist/_shared/cjs/index-28447df0.js +23 -0
- package/dist/_shared/cjs/index-3d629205.js +26 -0
- package/dist/_shared/cjs/{index.module-7d7228b3.js → index-3dd54df1.js} +47 -49
- package/dist/_shared/cjs/index-41b09e85.js +53 -0
- package/dist/_shared/cjs/{index-d75774a9.js → index-7aa7f96a.js} +1 -1
- package/dist/_shared/cjs/index-7e31a45b.js +2206 -0
- package/dist/_shared/cjs/index-996dec94.js +131 -0
- package/dist/_shared/cjs/index-dcfdd5da.js +11 -0
- package/dist/_shared/cjs/{filter-data-attrs-1c9a530c.js → index-df60851b.js} +17 -57
- package/dist/_shared/cjs/index.es-1299e41d.js +13 -0
- package/dist/_shared/cjs/{suffix-modifier-64dcd338.js → suffix-modifier-c8a34402.js} +2 -2
- package/dist/_shared/cjs/{index.es-77def0c9.js → use-media-query-d34c83b9.js} +0 -9
- package/dist/_shared/esm/ArcIconEclipse.esm-bb48b82a.js +22 -0
- package/dist/_shared/esm/Avatar-38cc0595.js +43 -0
- package/dist/_shared/esm/{BrandLogo-1af78f76.js → BrandLogo-7ed8aeda.js} +3 -3
- package/dist/_shared/esm/{Breadcrumbs-c4b65cff.js → Breadcrumbs-9078b68e.js} +8 -8
- package/dist/_shared/esm/BtIconArrowRight.esm-6a17d0ce.js +31 -0
- package/dist/_shared/esm/BtIconChevronRightMid.esm-4764708f.js +22 -0
- package/dist/_shared/esm/BtIconPlayFill.esm-05fc0344.js +24 -0
- package/dist/_shared/esm/{Button-c3348ed8.js → Button-dde2b46a.js} +6 -6
- package/dist/_shared/esm/ButtonV2-49cd0615.js +42 -0
- package/dist/_shared/esm/Calendar-4813cac2.js +1918 -0
- package/dist/_shared/esm/CardFooter-c79fb2db.js +73 -0
- package/dist/_shared/esm/{Checkbox-2a623386.js → Checkbox-0baca464.js} +14 -10
- package/dist/_shared/esm/{Columns-d96b7425.js → Columns-6a8f6fbb.js} +3 -10
- package/dist/_shared/esm/Combination-ae3a3f08.js +2942 -0
- package/dist/_shared/esm/ConditionalWrapper-59be8f35.js +8 -0
- package/dist/_shared/esm/DatePicker-fa18bb81.js +539 -0
- package/dist/_shared/esm/{DisclosureMini-bf95a9db.js → DisclosureMini-38f4c459.js} +8 -11
- package/dist/_shared/esm/{Filter-58a42358.js → Filter-49dcf5ce.js} +24 -16
- package/dist/_shared/esm/{FormControl-433228f5.js → FormControl-d873f7fa.js} +29 -14
- package/dist/_shared/esm/Grid-fb9fc522.js +40 -0
- package/dist/_shared/esm/{Group-73fdb896.js → Group-66196f07.js} +3 -10
- package/dist/_shared/esm/{Heading-d16e0e53.js → Heading-906c7c7c.js} +3 -3
- package/dist/_shared/esm/HeroButton-7ea692bf.js +120 -0
- package/dist/_shared/esm/{Icon-9ecaaeab.js → Icon-512f834f.js} +9 -5
- package/dist/_shared/esm/{Image-12fbd327.js → Image-57d08939.js} +15 -5
- package/dist/_shared/esm/MediaCard-f4758794.js +59 -0
- package/dist/_shared/esm/{Poster-699dc89b.js → Poster-e05a8b45.js} +6 -6
- package/dist/_shared/esm/Preview-43b2a75d.js +161 -0
- package/dist/_shared/esm/ProgressStepper-189ed0f9.js +115 -0
- package/dist/_shared/esm/RadioGroup-8ff17cbb.js +78 -0
- package/dist/_shared/esm/{Section-73781b56.js → Section-1acbc06a.js} +1 -1
- package/dist/_shared/esm/{SiteFooter-d21da7ab.js → SiteFooter-299646d9.js} +9 -8
- package/dist/_shared/esm/SiteHeaderV2-8208ddb7.js +683 -0
- package/dist/_shared/esm/{Surface-0ca6817d.js → Surface-71d21a9e.js} +17 -17
- package/dist/_shared/esm/{Tabs-39d24a7d.js → Tabs-21ac7dfe.js} +11 -15
- package/dist/_shared/esm/Tag-2513c185.js +38 -0
- package/dist/_shared/esm/{Text-14f586ac.js → Text-a46fb76b.js} +3 -3
- package/dist/_shared/esm/TextInput-94c7b1a4.js +96 -0
- package/dist/_shared/esm/{ThemeIcon-eab5a4d0.js → ThemeIcon-c2dc41a6.js} +3 -3
- package/dist/_shared/esm/{Toast-dce2d01e.js → Toast-de6ca2f3.js} +261 -23
- package/dist/_shared/esm/{UniversalHeader-b4c1577c.js → UniversalHeader-456ad60c.js} +8 -13
- package/dist/_shared/esm/{VerticalSpace-43cd9138.js → VerticalSpace-b07cd8e6.js} +1 -1
- package/dist/_shared/esm/{VisuallyHidden-b9eebf71.js → VisuallyHidden-06692fd3.js} +1 -1
- package/dist/_shared/esm/_commonjsHelpers-0109d574.js +18 -0
- package/dist/_shared/esm/{index-ffd720d0.js → component-d0a555cf.js} +144 -432
- package/dist/_shared/esm/{debounce-6fed6b84.js → debounce-c8e41002.js} +1 -1
- package/dist/_shared/esm/{filter-data-attrs-ea8f4ed4.js → index-288c66b5.js} +17 -55
- package/dist/_shared/esm/index-4e58de24.js +51 -0
- package/dist/_shared/esm/index-5113ed53.js +24 -0
- package/dist/_shared/esm/index-6028d797.js +21 -0
- package/dist/_shared/esm/index-605031ca.js +2197 -0
- package/dist/_shared/esm/index-69089474.js +21 -0
- package/dist/_shared/esm/{index-3147c5b0.js → index-7740883c.js} +1 -1
- package/dist/_shared/esm/index-a624de47.js +9 -0
- package/dist/_shared/esm/{index.module-50b2c98a.js → index-cace3545.js} +43 -45
- package/dist/_shared/esm/{index-65264b4e.js → index-f97466e9.js} +1 -1
- package/dist/_shared/esm/index-fa93ec97.js +129 -0
- package/dist/_shared/esm/index.es-28a91edf.js +9 -0
- package/dist/_shared/esm/{suffix-modifier-3d548e45.js → suffix-modifier-1ce05abe.js} +2 -2
- package/dist/_shared/esm/{index.es-00cb3bcb.js → use-media-query-d3622da8.js} +1 -8
- package/dist/index.es.js +18330 -38186
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +18317 -38162
- package/dist/index.js.map +1 -1
- package/dist/styles.css +7 -38
- package/dist/types/components/Alert/Alert.d.ts +1 -1
- package/dist/types/components/AppButton/AppButton.d.ts +9 -0
- package/dist/types/components/AppButton/icons/AppStore.d.ts +2 -0
- package/dist/types/components/AppButton/icons/GooglePlay.d.ts +2 -0
- package/dist/types/components/AppButton/index.d.ts +1 -0
- package/dist/types/components/Avatar/Avatar.d.ts +14 -0
- package/dist/types/components/Avatar/components/AvatarContent/AvatarContent.d.ts +9 -0
- package/dist/types/components/Avatar/index.d.ts +1 -0
- package/dist/types/components/Avatar/types/avatar-icon-size.d.ts +1 -0
- package/dist/types/components/Avatar/types/avatar-image.d.ts +2 -0
- package/dist/types/components/Avatar/types/avatar-size.d.ts +1 -0
- package/dist/types/components/Avatar/types/avatar-text-size.d.ts +2 -0
- package/dist/types/components/AvatarGroup/AvatarGroup.d.ts +14 -0
- package/dist/types/components/AvatarGroup/index.d.ts +1 -0
- package/dist/types/components/AvatarGroup/types/group-avatar.d.ts +2 -0
- package/dist/types/components/AvatarGroup/utils/get-avatars.d.ts +2 -0
- package/dist/types/components/Badge/Badge.d.ts +1 -9
- package/dist/types/components/Button/Button.d.ts +1 -1
- package/dist/types/components/ButtonV2/ButtonV2.d.ts +79 -0
- package/dist/types/components/ButtonV2/index.d.ts +1 -0
- package/dist/types/components/Calendar/Calendar.d.ts +50 -0
- package/dist/types/components/Calendar/Calendar.provider.d.ts +21 -0
- package/dist/types/components/Calendar/components/CalendarDateSelect/CalendarDateSelect.d.ts +15 -0
- package/dist/types/components/Calendar/components/CalendarDateSelect/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarDayGrid/CalendarDayGrid.d.ts +6 -0
- package/dist/types/components/Calendar/components/CalendarDayGrid/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarDayNumber/CalendarDayNumber.d.ts +8 -0
- package/dist/types/components/Calendar/components/CalendarDayNumber/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarDoubleMonthView/CalendarDoubleMonthView.d.ts +9 -0
- package/dist/types/components/Calendar/components/CalendarDoubleMonthView/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarFooter/CalendarFooter.d.ts +6 -0
- package/dist/types/components/Calendar/components/CalendarFooter/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarMonthView/CalendarMonthView.d.ts +9 -0
- package/dist/types/components/Calendar/components/CalendarMonthView/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarMonthYearView/CalendarMonthYearView.d.ts +11 -0
- package/dist/types/components/Calendar/components/CalendarMonthYearView/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarNavButton/CalendarNavButton.d.ts +10 -0
- package/dist/types/components/Calendar/components/CalendarNavButton/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarWrapper/CalendarWrapper.d.ts +5 -0
- package/dist/types/components/Calendar/components/CalendarWrapper/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/index.d.ts +6 -0
- package/dist/types/components/Calendar/constants/day-names.d.ts +5 -0
- package/dist/types/components/Calendar/constants/index.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/contains-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/contains-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/date-without-time.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/date-without-time.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-calendar-type.d.ts +2 -0
- package/dist/types/components/Calendar/helpers/get-calendar-type.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-dates-in-month.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-dates-in-month.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-double-month-display-range.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-double-month-display-range.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-focus-date.d.ts +5 -0
- package/dist/types/components/Calendar/helpers/get-focus-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-highlighted-range.d.ts +6 -0
- package/dist/types/components/Calendar/helpers/get-highlighted-range.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-keydown-date.d.ts +6 -0
- package/dist/types/components/Calendar/helpers/get-keydown-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/index.d.ts +13 -0
- package/dist/types/components/Calendar/helpers/is-day.d.ts +2 -0
- package/dist/types/components/Calendar/helpers/is-day.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-disabled-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-disabled-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-after-max-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-after-max-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-before-min-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-before-min-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/process-selected-range.d.ts +9 -0
- package/dist/types/components/Calendar/helpers/process-selected-range.test.d.ts +1 -0
- package/dist/types/components/Calendar/index.d.ts +2 -0
- package/dist/types/components/Calendar/state/handlers/calendar-keydown-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/day-grid-leave-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/day-number-select-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/default-handler.d.ts +2 -0
- package/dist/types/components/Calendar/state/handlers/dropdown-change-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/dropdown-change-year-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/highlight-range-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/index.d.ts +12 -0
- package/dist/types/components/Calendar/state/handlers/range-select-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-next-double-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-next-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-previous-double-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-previous-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/index.d.ts +2 -0
- package/dist/types/components/Calendar/state/reducer.d.ts +3 -0
- package/dist/types/components/Calendar/state/reducer.test.d.ts +1 -0
- package/dist/types/components/Calendar/state/types/actions.d.ts +81 -0
- package/dist/types/components/Calendar/state/types/state-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/types/state.d.ts +5 -0
- package/dist/types/components/Calendar/types/calendar-type.d.ts +1 -0
- package/dist/types/components/Calendar/types/date-select-value.d.ts +2 -0
- package/dist/types/components/Calendar/types/index.d.ts +6 -0
- package/dist/types/components/Calendar/types/key-names.d.ts +13 -0
- package/dist/types/components/Calendar/types/range-selection.d.ts +10 -0
- package/dist/types/components/Calendar/types/selection-type.d.ts +1 -0
- package/dist/types/components/Calendar/types/week-days.d.ts +18 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts +7 -4
- package/dist/types/components/DatePicker/DatePicker.d.ts +20 -0
- package/dist/types/components/DatePicker/constants/date-format.d.ts +1 -0
- package/dist/types/components/DatePicker/constants/index.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-date-string-to-date.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-date-string-to-date.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-range-string-to-dates.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-range-string-to-dates.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/format-date.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/format-date.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/index.d.ts +8 -0
- package/dist/types/components/DatePicker/helpers/is-date-valid.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-date-valid.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-disabled-date.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-disabled-date.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-range-valid.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-range-valid.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/parse-date-string.d.ts +5 -0
- package/dist/types/components/DatePicker/helpers/parse-date-string.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/parse-range-string.d.ts +14 -0
- package/dist/types/components/DatePicker/helpers/parse-range-string.test.d.ts +1 -0
- package/dist/types/components/DatePicker/index.d.ts +6 -0
- package/dist/types/components/Disclosure/Disclosure.d.ts +1 -2
- package/dist/types/components/DisclosureMini/DisclosureMini.d.ts +1 -2
- package/dist/types/components/Filter/Filter.d.ts +1 -1
- package/dist/types/components/Filter/FilterItems/FilterItems.d.ts +4 -0
- package/dist/types/components/FormControl/FormControl.d.ts +5 -1
- package/dist/types/components/Grid/Grid.constants.d.ts +1 -0
- package/dist/types/components/Grid/Grid.d.ts +28 -0
- package/dist/types/components/Grid/Grid.types.d.ts +10 -0
- package/dist/types/components/Grid/components/Col/Col.d.ts +10 -0
- package/dist/types/components/Grid/components/Col/index.d.ts +1 -0
- package/dist/types/components/Grid/components/Row/Row.d.ts +10 -0
- package/dist/types/components/Grid/components/Row/index.d.ts +1 -0
- package/dist/types/components/Grid/index.d.ts +2 -0
- package/dist/types/components/HeroButton/HeroButton.d.ts +66 -0
- package/dist/types/components/HeroButton/index.d.ts +1 -0
- package/dist/types/components/Hidden/Hidden.d.ts +11 -0
- package/dist/types/components/Hidden/index.d.ts +1 -0
- package/dist/types/components/Icon/Icon.d.ts +4 -0
- package/dist/types/components/Image/Image.d.ts +4 -0
- package/dist/types/components/ImpactCard/ImpactCard.d.ts +58 -0
- package/dist/types/components/ImpactCard/index.d.ts +1 -0
- package/dist/types/components/InformationCard/InformationCard.d.ts +62 -0
- package/dist/types/components/InformationCard/index.d.ts +1 -0
- package/dist/types/components/Link/Link.d.ts +52 -0
- package/dist/types/components/Link/index.d.ts +1 -0
- package/dist/types/components/MediaCard/MediaCard.d.ts +27 -28
- package/dist/types/components/MediaCard/types/index.d.ts +2 -0
- package/dist/types/components/MediaCard/types/media-card-image.d.ts +4 -0
- package/dist/types/components/MediaCard/types/media-card-video.d.ts +4 -0
- package/dist/types/components/Modal/Modal.d.ts +3 -3
- package/dist/types/components/Pagination/Pagination.d.ts +1 -1
- package/dist/types/components/PaginationSimple/PaginationSimple.d.ts +12 -4
- package/dist/types/components/Poster/Poster.d.ts +1 -1
- package/dist/types/components/ProgressBar/ProgressBar.d.ts +4 -0
- package/dist/types/components/ProgressStepper/ProgressStepper.d.ts +2 -2
- package/dist/types/components/ProgressStepper/ProgressStepperItem/ProgressStepperItem.d.ts +3 -7
- package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Complete.d.ts +2 -0
- package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Current.d.ts +2 -0
- package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Error.d.ts +2 -0
- package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Todo.d.ts +2 -0
- package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Warning.d.ts +2 -0
- package/dist/types/components/RadioGroup/RadioButton/RadioButton.d.ts +17 -23
- package/dist/types/components/RadioGroup/RadioButtonGroupInput/RadioButtonGroupInput.d.ts +36 -0
- package/dist/types/components/RadioGroup/RadioButtonGroupInput/index.d.ts +1 -0
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +11 -3
- package/dist/types/components/RadioGroup/context.d.ts +1 -1
- package/dist/types/components/RadioGroup/index.d.ts +1 -0
- package/dist/types/components/Rule/Rule.d.ts +2 -1
- package/dist/types/components/Select/Select.d.ts +53 -0
- package/dist/types/components/SiteFooter/index.d.ts +0 -1
- package/dist/types/components/SiteHeaderV2/SiteHeaderV2.d.ts +82 -0
- package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/BackButton/BackButton.d.ts +1 -0
- package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/Column/Column.d.ts +1 -1
- package/dist/types/components/SiteHeaderV2/components/HorizontalPanel/HorizontalPanel.d.ts +13 -0
- package/dist/types/components/SiteHeaderV2/components/HorizontalPanel/index.d.ts +1 -0
- package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/ItemGroup/ItemGroup.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/ItemGroup/index.d.ts +1 -0
- package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/NavItem/NavItem.d.ts +5 -6
- package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/NavItem/NavItemWithSubNav.d.ts +13 -4
- package/dist/types/components/SiteHeaderV2/components/NavItem/index.d.ts +2 -0
- package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/NodeItem/NodeItem.d.ts +1 -1
- package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/Panel/Panel.d.ts +8 -2
- package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/SubNavItem/SubNavItem.d.ts +5 -7
- package/dist/types/components/SiteHeaderV2/components/SubNavItem/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/VerticalDivider/VerticalDivider.d.ts +2 -0
- package/dist/types/components/SiteHeaderV2/components/VerticalDivider/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/index.d.ts +1 -0
- package/dist/types/components/SkipLink/SkipLink.d.ts +12 -0
- package/dist/types/components/SkipLink/SkipLinkItem/SkipLinkItem.d.ts +16 -0
- package/dist/types/components/SkipLink/index.d.ts +1 -0
- package/dist/types/components/Surface/Surface.d.ts +3 -3
- package/dist/types/components/Switch/Switch.d.ts +2 -2
- package/dist/types/components/Tabs/Tabs.d.ts +1 -0
- package/dist/types/components/Tag/Tag.d.ts +5 -1
- package/dist/types/components/TextArea/TextArea.d.ts +17 -0
- package/dist/types/components/TextInput/TextInput.d.ts +46 -6
- package/dist/types/components/Theme/Theme.d.ts +11 -3
- package/dist/types/components/Theme/index.d.ts +1 -1
- package/dist/types/components/ThemeIcon/icon-names.d.ts +1 -1
- package/dist/types/components/Toast/Toast.d.ts +1 -1
- package/dist/types/components/TypographyCard/TypographyCard.d.ts +58 -0
- package/dist/types/components/TypographyCard/index.d.ts +1 -0
- package/dist/types/components/UniversalHeader/UniversalHeader.d.ts +4 -0
- package/dist/types/components/VideoPlayer/VideoPlayer.d.ts +18 -0
- package/dist/types/components/VideoPlayer/index.d.ts +1 -0
- package/dist/types/components/Visible/Visible.d.ts +11 -0
- package/dist/types/components/Visible/index.d.ts +1 -0
- package/dist/types/components/VisuallyHidden/VisuallyHidden.d.ts +1 -1
- package/dist/types/components/index.d.ts +17 -5
- package/dist/types/helpers/get-theme-img.d.ts +6 -0
- package/dist/types/helpers/index.d.ts +1 -0
- package/dist/types/hooks/index.d.ts +2 -4
- package/dist/types/hooks/private/index.d.ts +5 -0
- package/dist/types/hooks/private/use-aria-describedby/index.d.ts +1 -0
- package/dist/types/hooks/private/use-interaction-mode/index.d.ts +1 -0
- package/dist/types/hooks/private/use-numeric-input/index.d.ts +1 -0
- package/dist/types/hooks/{use-numeric-input.d.ts → private/use-numeric-input/use-numeric-input.d.ts} +3 -3
- package/dist/types/hooks/private/use-pagination/index.d.ts +1 -0
- package/dist/types/hooks/private/use-theme-element/index.d.ts +1 -0
- package/dist/types/hooks/public/index.d.ts +1 -0
- package/dist/types/hooks/public/use-media-query/index.d.ts +1 -0
- package/dist/types/hooks/{use-media-query.d.ts → public/use-media-query/use-media-query.d.ts} +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/private-components/CardFooter/CardFooter.d.ts +11 -0
- package/dist/types/private-components/CardFooter/index.d.ts +1 -0
- package/dist/types/private-components/CardHeading/CardHeading.d.ts +19 -0
- package/dist/types/private-components/CardHeading/index.d.ts +1 -0
- package/dist/types/private-components/ConditionalWrapper/ConditionalWrapper.d.ts +7 -0
- package/dist/types/private-components/ConditionalWrapper/index.d.ts +1 -0
- package/dist/types/private-components/index.d.ts +3 -0
- package/dist/types/styles.d.ts +22 -5
- package/dist/types/types/auto-complete-types.d.ts +1 -0
- package/dist/use-media-query/package.json +7 -0
- package/dist/use-media-query/use-media-query.cjs.js +10 -0
- package/dist/use-media-query/use-media-query.esm.js +2 -0
- package/package.json +53 -37
- package/dist/Base/Base.cjs.js +0 -11
- package/dist/Base/Base.esm.js +0 -3
- package/dist/Base/package.json +0 -7
- package/dist/Card/Card.cjs.js +0 -18
- package/dist/Card/Card.esm.js +0 -10
- package/dist/Card/package.json +0 -7
- package/dist/Clock/Clock.cjs.js +0 -43
- package/dist/Clock/Clock.esm.js +0 -34
- package/dist/Clock/package.json +0 -7
- package/dist/SiteHeader/SiteHeader.cjs.js +0 -22
- package/dist/SiteHeader/SiteHeader.esm.js +0 -13
- package/dist/SiteHeader/package.json +0 -7
- package/dist/_shared/cjs/Base-f5a86eed.js +0 -22
- package/dist/_shared/cjs/Card-eb1c20c1.js +0 -121
- package/dist/_shared/cjs/Image-e873b8fc.js +0 -46
- package/dist/_shared/cjs/ProgressStepper-74ee1eec.js +0 -88
- package/dist/_shared/cjs/RadioGroup-9bc96f6a.js +0 -69
- package/dist/_shared/cjs/SiteHeader.rehydrator-42c4a0e0.js +0 -670
- package/dist/_shared/cjs/TextInput-a5f72f6f.js +0 -81
- package/dist/_shared/cjs/UniversalHeader-5e43d320.js +0 -34
- package/dist/_shared/cjs/extends-8c5e4b48.js +0 -18
- package/dist/_shared/cjs/index-4aa11039.js +0 -490
- package/dist/_shared/cjs/index-4dd46cbe.js +0 -289
- package/dist/_shared/esm/Base-f200653c.js +0 -15
- package/dist/_shared/esm/Card-45e8e10a.js +0 -115
- package/dist/_shared/esm/ProgressStepper-5de34269.js +0 -82
- package/dist/_shared/esm/RadioGroup-002a32ba.js +0 -63
- package/dist/_shared/esm/SiteHeader.rehydrator-97900e11.js +0 -663
- package/dist/_shared/esm/TextInput-28f18769.js +0 -75
- package/dist/_shared/esm/extends-8cc61aad.js +0 -16
- package/dist/_shared/esm/index-4f8d3888.js +0 -280
- package/dist/_shared/esm/index-87a828b8.js +0 -479
- package/dist/types/components/Base/Base.d.ts +0 -16
- package/dist/types/components/Base/index.d.ts +0 -1
- package/dist/types/components/Card/Card.d.ts +0 -128
- package/dist/types/components/Card/index.d.ts +0 -1
- package/dist/types/components/Clock/Clock.d.ts +0 -12
- package/dist/types/components/Clock/Clock.rehydrator.d.ts +0 -2
- package/dist/types/components/Clock/index.d.ts +0 -2
- package/dist/types/components/MediaCard/MediaCard.stories-wip.d.ts +0 -15
- package/dist/types/components/SiteFooter/SiteFooter.rehydrator.d.ts +0 -2
- package/dist/types/components/SiteHeader/SiteHeader.d.ts +0 -75
- package/dist/types/components/SiteHeader/SiteHeader.rehydrator.d.ts +0 -8
- package/dist/types/components/SiteHeader/components/ItemGroup/ItemGroup.rehydrator.d.ts +0 -2
- package/dist/types/components/SiteHeader/components/ItemGroup/index.d.ts +0 -2
- package/dist/types/components/SiteHeader/components/NavItem/NavItem.rehydrator.d.ts +0 -2
- package/dist/types/components/SiteHeader/components/NavItem/NavItemWithSubNav.rehydrator.d.ts +0 -2
- package/dist/types/components/SiteHeader/components/NavItem/index.d.ts +0 -4
- package/dist/types/components/SiteHeader/components/SubNavItem/SubNavItem.rehydrator.d.ts +0 -2
- package/dist/types/components/SiteHeader/components/SubNavItem/index.d.ts +0 -2
- package/dist/types/components/SiteHeader/index.d.ts +0 -2
- /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/BackButton/index.d.ts +0 -0
- /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/Column/index.d.ts +0 -0
- /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/Item/Item.d.ts +0 -0
- /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/Item/index.d.ts +0 -0
- /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/MenuButton/MenuButton.d.ts +0 -0
- /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/MenuButton/index.d.ts +0 -0
- /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/Panel/index.d.ts +0 -0
- /package/dist/types/hooks/{use-aria-describedby.d.ts → private/use-aria-describedby/use-aria-describedby.d.ts} +0 -0
- /package/dist/types/hooks/{use-interaction-mode.d.ts → private/use-interaction-mode/use-interaction-mode.d.ts} +0 -0
- /package/dist/types/hooks/{use-pagination.d.ts → private/use-pagination/use-pagination.d.ts} +0 -0
|
@@ -2,699 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var index$
|
|
5
|
+
var index$6 = require('../_shared/cjs/index-df60851b.js');
|
|
6
|
+
var index$7 = require('../_shared/cjs/index-9947ac13.js');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var index = require('../_shared/cjs/index-
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
require('../_shared/cjs/
|
|
17
|
-
require('../_shared/cjs/
|
|
18
|
-
require('../_shared/cjs/
|
|
8
|
+
var index$1 = require('../_shared/cjs/index-3dd54df1.js');
|
|
9
|
+
var ReactDOM = require('react-dom');
|
|
10
|
+
var index = require('../_shared/cjs/index-0c6319ec.js');
|
|
11
|
+
var index$2 = require('../_shared/cjs/index-dcfdd5da.js');
|
|
12
|
+
var Combination = require('../_shared/cjs/Combination-3a639f6d.js');
|
|
13
|
+
var index$3 = require('../_shared/cjs/index-7aa7f96a.js');
|
|
14
|
+
var index$4 = require('../_shared/cjs/index-28447df0.js');
|
|
15
|
+
var index$5 = require('../_shared/cjs/index-3d629205.js');
|
|
16
|
+
var component = require('../_shared/cjs/component-df82bc05.js');
|
|
17
|
+
var FormControl = require('../_shared/cjs/FormControl-88d48f42.js');
|
|
18
|
+
var Surface = require('../_shared/cjs/Surface-8599dbe4.js');
|
|
19
|
+
var ThemeIcon = require('../_shared/cjs/ThemeIcon-ee814862.js');
|
|
20
|
+
require('../_shared/cjs/index-039a9d35.js');
|
|
21
|
+
require('../_shared/cjs/index-41b09e85.js');
|
|
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');
|
|
19
26
|
|
|
20
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
28
|
|
|
22
|
-
function _interopNamespace(e) {
|
|
23
|
-
if (e && e.__esModule) return e;
|
|
24
|
-
var n = Object.create(null);
|
|
25
|
-
if (e) {
|
|
26
|
-
Object.keys(e).forEach(function (k) {
|
|
27
|
-
if (k !== 'default') {
|
|
28
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
29
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function () { return e[k]; }
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
n["default"] = e;
|
|
37
|
-
return Object.freeze(n);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
29
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
41
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
42
|
-
var $7SXl2$reactdom__default = /*#__PURE__*/_interopDefaultLegacy($7SXl2$reactdom);
|
|
43
30
|
|
|
44
31
|
function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(value, [min, max]) {
|
|
45
32
|
return Math.min(max, Math.max(min, value));
|
|
46
33
|
}
|
|
47
34
|
|
|
48
|
-
// We have resorted to returning slots directly rather than exposing primitives that can then
|
|
49
|
-
// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
|
|
50
|
-
// This is because we encountered issues with generic types that cannot be statically analysed
|
|
51
|
-
// due to creating them dynamically via createCollection.
|
|
52
|
-
function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
53
|
-
/* -----------------------------------------------------------------------------------------------
|
|
54
|
-
* CollectionProvider
|
|
55
|
-
* ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
|
|
56
|
-
const [createCollectionContext, createCollectionScope] = index_module.$c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
|
|
57
|
-
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
58
|
-
collectionRef: {
|
|
59
|
-
current: null
|
|
60
|
-
},
|
|
61
|
-
itemMap: new Map()
|
|
62
|
-
});
|
|
63
|
-
const CollectionProvider = (props)=>{
|
|
64
|
-
const { scope: scope , children: children } = props;
|
|
65
|
-
const ref = React__default["default"].useRef(null);
|
|
66
|
-
const itemMap = React__default["default"].useRef(new Map()).current;
|
|
67
|
-
return /*#__PURE__*/ React__default["default"].createElement(CollectionProviderImpl, {
|
|
68
|
-
scope: scope,
|
|
69
|
-
itemMap: itemMap,
|
|
70
|
-
collectionRef: ref
|
|
71
|
-
}, children);
|
|
72
|
-
};
|
|
73
|
-
/* -----------------------------------------------------------------------------------------------
|
|
74
|
-
* CollectionSlot
|
|
75
|
-
* ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot';
|
|
76
|
-
const CollectionSlot = /*#__PURE__*/ React__default["default"].forwardRef((props, forwardedRef)=>{
|
|
77
|
-
const { scope: scope , children: children } = props;
|
|
78
|
-
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
79
|
-
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
|
|
80
|
-
return /*#__PURE__*/ React__default["default"].createElement(index_module.$5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
81
|
-
ref: composedRefs
|
|
82
|
-
}, children);
|
|
83
|
-
});
|
|
84
|
-
/* -----------------------------------------------------------------------------------------------
|
|
85
|
-
* CollectionItem
|
|
86
|
-
* ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot';
|
|
87
|
-
const ITEM_DATA_ATTR = 'data-radix-collection-item';
|
|
88
|
-
const CollectionItemSlot = /*#__PURE__*/ React__default["default"].forwardRef((props, forwardedRef)=>{
|
|
89
|
-
const { scope: scope , children: children , ...itemData } = props;
|
|
90
|
-
const ref = React__default["default"].useRef(null);
|
|
91
|
-
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
92
|
-
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
93
|
-
React__default["default"].useEffect(()=>{
|
|
94
|
-
context.itemMap.set(ref, {
|
|
95
|
-
ref: ref,
|
|
96
|
-
...itemData
|
|
97
|
-
});
|
|
98
|
-
return ()=>void context.itemMap.delete(ref)
|
|
99
|
-
;
|
|
100
|
-
});
|
|
101
|
-
return /*#__PURE__*/ React__default["default"].createElement(index_module.$5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
102
|
-
[ITEM_DATA_ATTR]: '',
|
|
103
|
-
ref: composedRefs
|
|
104
|
-
}, children);
|
|
105
|
-
});
|
|
106
|
-
/* -----------------------------------------------------------------------------------------------
|
|
107
|
-
* useCollection
|
|
108
|
-
* ---------------------------------------------------------------------------------------------*/ function useCollection(scope) {
|
|
109
|
-
const context = useCollectionContext(name + 'CollectionConsumer', scope);
|
|
110
|
-
const getItems = React__default["default"].useCallback(()=>{
|
|
111
|
-
const collectionNode = context.collectionRef.current;
|
|
112
|
-
if (!collectionNode) return [];
|
|
113
|
-
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
114
|
-
const items = Array.from(context.itemMap.values());
|
|
115
|
-
const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
116
|
-
);
|
|
117
|
-
return orderedItems;
|
|
118
|
-
}, [
|
|
119
|
-
context.collectionRef,
|
|
120
|
-
context.itemMap
|
|
121
|
-
]);
|
|
122
|
-
return getItems;
|
|
123
|
-
}
|
|
124
|
-
return [
|
|
125
|
-
{
|
|
126
|
-
Provider: CollectionProvider,
|
|
127
|
-
Slot: CollectionSlot,
|
|
128
|
-
ItemSlot: CollectionItemSlot
|
|
129
|
-
},
|
|
130
|
-
useCollection,
|
|
131
|
-
createCollectionScope
|
|
132
|
-
];
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ React.createContext(undefined);
|
|
136
|
-
/* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
|
|
137
|
-
const globalDir = React.useContext($f631663db3294ace$var$DirectionContext);
|
|
138
|
-
return localDir || globalDir || 'ltr';
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Listens for when the escape key is down
|
|
143
|
-
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
144
|
-
const onEscapeKeyDown = index_module.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
145
|
-
React.useEffect(()=>{
|
|
146
|
-
const handleKeyDown = (event)=>{
|
|
147
|
-
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
148
|
-
};
|
|
149
|
-
ownerDocument.addEventListener('keydown', handleKeyDown);
|
|
150
|
-
return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
|
|
151
|
-
;
|
|
152
|
-
}, [
|
|
153
|
-
onEscapeKeyDown,
|
|
154
|
-
ownerDocument
|
|
155
|
-
]);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
159
|
-
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
160
|
-
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
161
|
-
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
162
|
-
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ React.createContext({
|
|
163
|
-
layers: new Set(),
|
|
164
|
-
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
165
|
-
branches: new Set()
|
|
166
|
-
});
|
|
167
|
-
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
168
|
-
var _node$ownerDocument;
|
|
169
|
-
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
170
|
-
const context = React.useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
171
|
-
const [node1, setNode] = React.useState(null);
|
|
172
|
-
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;
|
|
173
|
-
const [, force] = React.useState({});
|
|
174
|
-
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
175
|
-
);
|
|
176
|
-
const layers = Array.from(context.layers);
|
|
177
|
-
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
178
|
-
...context.layersWithOutsidePointerEventsDisabled
|
|
179
|
-
].slice(-1); // prettier-ignore
|
|
180
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
|
|
181
|
-
const index = node1 ? layers.indexOf(node1) : -1;
|
|
182
|
-
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
183
|
-
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
184
|
-
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
185
|
-
const target = event.target;
|
|
186
|
-
const isPointerDownOnBranch = [
|
|
187
|
-
...context.branches
|
|
188
|
-
].some((branch)=>branch.contains(target)
|
|
189
|
-
);
|
|
190
|
-
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
191
|
-
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
192
|
-
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
193
|
-
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
194
|
-
}, ownerDocument);
|
|
195
|
-
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
196
|
-
const target = event.target;
|
|
197
|
-
const isFocusInBranch = [
|
|
198
|
-
...context.branches
|
|
199
|
-
].some((branch)=>branch.contains(target)
|
|
200
|
-
);
|
|
201
|
-
if (isFocusInBranch) return;
|
|
202
|
-
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
|
|
203
|
-
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
204
|
-
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
205
|
-
}, ownerDocument);
|
|
206
|
-
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
207
|
-
const isHighestLayer = index === context.layers.size - 1;
|
|
208
|
-
if (!isHighestLayer) return;
|
|
209
|
-
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
210
|
-
if (!event.defaultPrevented && onDismiss) {
|
|
211
|
-
event.preventDefault();
|
|
212
|
-
onDismiss();
|
|
213
|
-
}
|
|
214
|
-
}, ownerDocument);
|
|
215
|
-
React.useEffect(()=>{
|
|
216
|
-
if (!node1) return;
|
|
217
|
-
if (disableOutsidePointerEvents) {
|
|
218
|
-
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
219
|
-
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
220
|
-
ownerDocument.body.style.pointerEvents = 'none';
|
|
221
|
-
}
|
|
222
|
-
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
223
|
-
}
|
|
224
|
-
context.layers.add(node1);
|
|
225
|
-
$5cb92bef7577960e$var$dispatchUpdate();
|
|
226
|
-
return ()=>{
|
|
227
|
-
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
228
|
-
};
|
|
229
|
-
}, [
|
|
230
|
-
node1,
|
|
231
|
-
ownerDocument,
|
|
232
|
-
disableOutsidePointerEvents,
|
|
233
|
-
context
|
|
234
|
-
]);
|
|
235
|
-
/**
|
|
236
|
-
* We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
|
|
237
|
-
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
|
238
|
-
* and add it to the end again so the layering order wouldn't be _creation order_.
|
|
239
|
-
* We only want them to be removed from context stacks when unmounted.
|
|
240
|
-
*/ React.useEffect(()=>{
|
|
241
|
-
return ()=>{
|
|
242
|
-
if (!node1) return;
|
|
243
|
-
context.layers.delete(node1);
|
|
244
|
-
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
245
|
-
$5cb92bef7577960e$var$dispatchUpdate();
|
|
246
|
-
};
|
|
247
|
-
}, [
|
|
248
|
-
node1,
|
|
249
|
-
context
|
|
250
|
-
]);
|
|
251
|
-
React.useEffect(()=>{
|
|
252
|
-
const handleUpdate = ()=>force({})
|
|
253
|
-
;
|
|
254
|
-
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
255
|
-
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
256
|
-
;
|
|
257
|
-
}, []);
|
|
258
|
-
return /*#__PURE__*/ React.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends._extends({}, layerProps, {
|
|
259
|
-
ref: composedRefs,
|
|
260
|
-
style: {
|
|
261
|
-
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
262
|
-
...props.style
|
|
263
|
-
},
|
|
264
|
-
onFocusCapture: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
265
|
-
onBlurCapture: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
266
|
-
onPointerDownCapture: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
267
|
-
}));
|
|
268
|
-
});
|
|
269
|
-
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
270
|
-
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
271
|
-
* to mimic layer dismissing behaviour present in OS.
|
|
272
|
-
* Returns props to pass to the node we want to check for outside events.
|
|
273
|
-
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
274
|
-
const handlePointerDownOutside = index_module.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
275
|
-
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
276
|
-
const handleClickRef = React.useRef(()=>{});
|
|
277
|
-
React.useEffect(()=>{
|
|
278
|
-
const handlePointerDown = (event)=>{
|
|
279
|
-
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
280
|
-
const eventDetail = {
|
|
281
|
-
originalEvent: event
|
|
282
|
-
};
|
|
283
|
-
function handleAndDispatchPointerDownOutsideEvent() {
|
|
284
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
285
|
-
discrete: true
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* On touch devices, we need to wait for a click event because browsers implement
|
|
290
|
-
* a ~350ms delay between the time the user stops touching the display and when the
|
|
291
|
-
* browser executres events. We need to ensure we don't reactivate pointer-events within
|
|
292
|
-
* this timeframe otherwise the browser may execute events that should have been prevented.
|
|
293
|
-
*
|
|
294
|
-
* Additionally, this also lets us deal automatically with cancellations when a click event
|
|
295
|
-
* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
|
|
296
|
-
*
|
|
297
|
-
* This is why we also continuously remove the previous listener, because we cannot be
|
|
298
|
-
* certain that it was raised, and therefore cleaned-up.
|
|
299
|
-
*/ if (event.pointerType === 'touch') {
|
|
300
|
-
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
301
|
-
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
302
|
-
ownerDocument.addEventListener('click', handleClickRef.current, {
|
|
303
|
-
once: true
|
|
304
|
-
});
|
|
305
|
-
} else handleAndDispatchPointerDownOutsideEvent();
|
|
306
|
-
}
|
|
307
|
-
isPointerInsideReactTreeRef.current = false;
|
|
308
|
-
};
|
|
309
|
-
/**
|
|
310
|
-
* if this hook executes in a component that mounts via a `pointerdown` event, the event
|
|
311
|
-
* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
|
|
312
|
-
* this by delaying the event listener registration on the document.
|
|
313
|
-
* This is not React specific, but rather how the DOM works, ie:
|
|
314
|
-
* ```
|
|
315
|
-
* button.addEventListener('pointerdown', () => {
|
|
316
|
-
* console.log('I will log');
|
|
317
|
-
* document.addEventListener('pointerdown', () => {
|
|
318
|
-
* console.log('I will also log');
|
|
319
|
-
* })
|
|
320
|
-
* });
|
|
321
|
-
*/ const timerId = window.setTimeout(()=>{
|
|
322
|
-
ownerDocument.addEventListener('pointerdown', handlePointerDown);
|
|
323
|
-
}, 0);
|
|
324
|
-
return ()=>{
|
|
325
|
-
window.clearTimeout(timerId);
|
|
326
|
-
ownerDocument.removeEventListener('pointerdown', handlePointerDown);
|
|
327
|
-
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
328
|
-
};
|
|
329
|
-
}, [
|
|
330
|
-
ownerDocument,
|
|
331
|
-
handlePointerDownOutside
|
|
332
|
-
]);
|
|
333
|
-
return {
|
|
334
|
-
// ensures we check React component tree (not just DOM tree)
|
|
335
|
-
onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Listens for when focus happens outside a react subtree.
|
|
340
|
-
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
341
|
-
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
342
|
-
const handleFocusOutside = index_module.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
343
|
-
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
344
|
-
React.useEffect(()=>{
|
|
345
|
-
const handleFocus = (event)=>{
|
|
346
|
-
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
347
|
-
const eventDetail = {
|
|
348
|
-
originalEvent: event
|
|
349
|
-
};
|
|
350
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
351
|
-
discrete: false
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
ownerDocument.addEventListener('focusin', handleFocus);
|
|
356
|
-
return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
|
|
357
|
-
;
|
|
358
|
-
}, [
|
|
359
|
-
ownerDocument,
|
|
360
|
-
handleFocusOutside
|
|
361
|
-
]);
|
|
362
|
-
return {
|
|
363
|
-
onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
|
|
364
|
-
,
|
|
365
|
-
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
366
|
-
};
|
|
367
|
-
}
|
|
368
|
-
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
369
|
-
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
370
|
-
document.dispatchEvent(event);
|
|
371
|
-
}
|
|
372
|
-
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
373
|
-
const target = detail.originalEvent.target;
|
|
374
|
-
const event = new CustomEvent(name, {
|
|
375
|
-
bubbles: false,
|
|
376
|
-
cancelable: true,
|
|
377
|
-
detail: detail
|
|
378
|
-
});
|
|
379
|
-
if (handler) target.addEventListener(name, handler, {
|
|
380
|
-
once: true
|
|
381
|
-
});
|
|
382
|
-
if (discrete) index_module.$8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
383
|
-
else target.dispatchEvent(event);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
|
|
387
|
-
/**
|
|
388
|
-
* Injects a pair of focus guards at the edges of the whole DOM tree
|
|
389
|
-
* to ensure `focusin` & `focusout` events can be caught consistently.
|
|
390
|
-
*/ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
391
|
-
React.useEffect(()=>{
|
|
392
|
-
var _edgeGuards$, _edgeGuards$2;
|
|
393
|
-
const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
|
|
394
|
-
document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
395
|
-
document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
396
|
-
$3db38b7d1fb3fe6a$var$count++;
|
|
397
|
-
return ()=>{
|
|
398
|
-
if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
|
|
399
|
-
);
|
|
400
|
-
$3db38b7d1fb3fe6a$var$count--;
|
|
401
|
-
};
|
|
402
|
-
}, []);
|
|
403
|
-
}
|
|
404
|
-
function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
405
|
-
const element = document.createElement('span');
|
|
406
|
-
element.setAttribute('data-radix-focus-guard', '');
|
|
407
|
-
element.tabIndex = 0;
|
|
408
|
-
element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
|
|
409
|
-
return element;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
|
|
413
|
-
const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
|
|
414
|
-
const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
415
|
-
bubbles: false,
|
|
416
|
-
cancelable: true
|
|
417
|
-
};
|
|
418
|
-
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
419
|
-
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
420
|
-
const [container1, setContainer] = React.useState(null);
|
|
421
|
-
const onMountAutoFocus = index_module.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
422
|
-
const onUnmountAutoFocus = index_module.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
423
|
-
const lastFocusedElementRef = React.useRef(null);
|
|
424
|
-
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
|
425
|
-
);
|
|
426
|
-
const focusScope = React.useRef({
|
|
427
|
-
paused: false,
|
|
428
|
-
pause () {
|
|
429
|
-
this.paused = true;
|
|
430
|
-
},
|
|
431
|
-
resume () {
|
|
432
|
-
this.paused = false;
|
|
433
|
-
}
|
|
434
|
-
}).current; // Takes care of trapping focus if focus is moved outside programmatically for example
|
|
435
|
-
React.useEffect(()=>{
|
|
436
|
-
if (trapped) {
|
|
437
|
-
function handleFocusIn(event) {
|
|
438
|
-
if (focusScope.paused || !container1) return;
|
|
439
|
-
const target = event.target;
|
|
440
|
-
if (container1.contains(target)) lastFocusedElementRef.current = target;
|
|
441
|
-
else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
442
|
-
select: true
|
|
443
|
-
});
|
|
444
|
-
}
|
|
445
|
-
function handleFocusOut(event) {
|
|
446
|
-
if (focusScope.paused || !container1) return;
|
|
447
|
-
if (!container1.contains(event.relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
448
|
-
select: true
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
document.addEventListener('focusin', handleFocusIn);
|
|
452
|
-
document.addEventListener('focusout', handleFocusOut);
|
|
453
|
-
return ()=>{
|
|
454
|
-
document.removeEventListener('focusin', handleFocusIn);
|
|
455
|
-
document.removeEventListener('focusout', handleFocusOut);
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
}, [
|
|
459
|
-
trapped,
|
|
460
|
-
container1,
|
|
461
|
-
focusScope.paused
|
|
462
|
-
]);
|
|
463
|
-
React.useEffect(()=>{
|
|
464
|
-
if (container1) {
|
|
465
|
-
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
|
|
466
|
-
const previouslyFocusedElement = document.activeElement;
|
|
467
|
-
const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
|
|
468
|
-
if (!hasFocusedCandidate) {
|
|
469
|
-
const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
470
|
-
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
471
|
-
container1.dispatchEvent(mountEvent);
|
|
472
|
-
if (!mountEvent.defaultPrevented) {
|
|
473
|
-
$d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
|
|
474
|
-
select: true
|
|
475
|
-
});
|
|
476
|
-
if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
return ()=>{
|
|
480
|
-
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
|
|
481
|
-
// We need to delay the focus a little to get around it for now.
|
|
482
|
-
// See: https://github.com/facebook/react/issues/17894
|
|
483
|
-
setTimeout(()=>{
|
|
484
|
-
const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
485
|
-
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
486
|
-
container1.dispatchEvent(unmountEvent);
|
|
487
|
-
if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
|
|
488
|
-
select: true
|
|
489
|
-
});
|
|
490
|
-
// we need to remove the listener after we `dispatchEvent`
|
|
491
|
-
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
492
|
-
$d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
|
|
493
|
-
}, 0);
|
|
494
|
-
};
|
|
495
|
-
}
|
|
496
|
-
}, [
|
|
497
|
-
container1,
|
|
498
|
-
onMountAutoFocus,
|
|
499
|
-
onUnmountAutoFocus,
|
|
500
|
-
focusScope
|
|
501
|
-
]); // Takes care of looping focus (when tabbing whilst at the edges)
|
|
502
|
-
const handleKeyDown = React.useCallback((event)=>{
|
|
503
|
-
if (!loop && !trapped) return;
|
|
504
|
-
if (focusScope.paused) return;
|
|
505
|
-
const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
506
|
-
const focusedElement = document.activeElement;
|
|
507
|
-
if (isTabKey && focusedElement) {
|
|
508
|
-
const container = event.currentTarget;
|
|
509
|
-
const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container);
|
|
510
|
-
const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges
|
|
511
|
-
if (!hasTabbableElementsInside) {
|
|
512
|
-
if (focusedElement === container) event.preventDefault();
|
|
513
|
-
} else {
|
|
514
|
-
if (!event.shiftKey && focusedElement === last) {
|
|
515
|
-
event.preventDefault();
|
|
516
|
-
if (loop) $d3863c46a17e8a28$var$focus(first, {
|
|
517
|
-
select: true
|
|
518
|
-
});
|
|
519
|
-
} else if (event.shiftKey && focusedElement === first) {
|
|
520
|
-
event.preventDefault();
|
|
521
|
-
if (loop) $d3863c46a17e8a28$var$focus(last, {
|
|
522
|
-
select: true
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
}, [
|
|
528
|
-
loop,
|
|
529
|
-
trapped,
|
|
530
|
-
focusScope.paused
|
|
531
|
-
]);
|
|
532
|
-
return /*#__PURE__*/ React.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends._extends({
|
|
533
|
-
tabIndex: -1
|
|
534
|
-
}, scopeProps, {
|
|
535
|
-
ref: composedRefs,
|
|
536
|
-
onKeyDown: handleKeyDown
|
|
537
|
-
}));
|
|
538
|
-
});
|
|
539
|
-
/* -------------------------------------------------------------------------------------------------
|
|
540
|
-
* Utils
|
|
541
|
-
* -----------------------------------------------------------------------------------------------*/ /**
|
|
542
|
-
* Attempts focusing the first element in a list of candidates.
|
|
543
|
-
* Stops when focus has actually moved.
|
|
544
|
-
*/ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) {
|
|
545
|
-
const previouslyFocusedElement = document.activeElement;
|
|
546
|
-
for (const candidate of candidates){
|
|
547
|
-
$d3863c46a17e8a28$var$focus(candidate, {
|
|
548
|
-
select: select
|
|
549
|
-
});
|
|
550
|
-
if (document.activeElement !== previouslyFocusedElement) return;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
/**
|
|
554
|
-
* Returns the first and last tabbable elements inside a container.
|
|
555
|
-
*/ function $d3863c46a17e8a28$var$getTabbableEdges(container) {
|
|
556
|
-
const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container);
|
|
557
|
-
const first = $d3863c46a17e8a28$var$findVisible(candidates, container);
|
|
558
|
-
const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container);
|
|
559
|
-
return [
|
|
560
|
-
first,
|
|
561
|
-
last
|
|
562
|
-
];
|
|
563
|
-
}
|
|
564
|
-
/**
|
|
565
|
-
* Returns a list of potential tabbable candidates.
|
|
566
|
-
*
|
|
567
|
-
* NOTE: This is only a close approximation. For example it doesn't take into account cases like when
|
|
568
|
-
* elements are not visible. This cannot be worked out easily by just reading a property, but rather
|
|
569
|
-
* necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.
|
|
570
|
-
*
|
|
571
|
-
* See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
|
|
572
|
-
* Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
|
|
573
|
-
*/ function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
|
|
574
|
-
const nodes = [];
|
|
575
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
576
|
-
acceptNode: (node)=>{
|
|
577
|
-
const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';
|
|
578
|
-
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
|
|
579
|
-
// runtime's understanding of tabbability, so this automatically accounts
|
|
580
|
-
// for any kind of element that could be tabbed to.
|
|
581
|
-
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
582
|
-
}
|
|
583
|
-
});
|
|
584
|
-
while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it
|
|
585
|
-
// hinders accessibility to have tab order different from visual order.
|
|
586
|
-
return nodes;
|
|
587
|
-
}
|
|
588
|
-
/**
|
|
589
|
-
* Returns the first visible element in a list.
|
|
590
|
-
* NOTE: Only checks visibility up to the `container`.
|
|
591
|
-
*/ function $d3863c46a17e8a28$var$findVisible(elements, container) {
|
|
592
|
-
for (const element of elements){
|
|
593
|
-
// we stop checking if it's hidden at the `container` level (excluding)
|
|
594
|
-
if (!$d3863c46a17e8a28$var$isHidden(element, {
|
|
595
|
-
upTo: container
|
|
596
|
-
})) return element;
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) {
|
|
600
|
-
if (getComputedStyle(node).visibility === 'hidden') return true;
|
|
601
|
-
while(node){
|
|
602
|
-
// we stop at `upTo` (excluding it)
|
|
603
|
-
if (upTo !== undefined && node === upTo) return false;
|
|
604
|
-
if (getComputedStyle(node).display === 'none') return true;
|
|
605
|
-
node = node.parentElement;
|
|
606
|
-
}
|
|
607
|
-
return false;
|
|
608
|
-
}
|
|
609
|
-
function $d3863c46a17e8a28$var$isSelectableInput(element) {
|
|
610
|
-
return element instanceof HTMLInputElement && 'select' in element;
|
|
611
|
-
}
|
|
612
|
-
function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) {
|
|
613
|
-
// only focus if that element is focusable
|
|
614
|
-
if (element && element.focus) {
|
|
615
|
-
const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users
|
|
616
|
-
element.focus({
|
|
617
|
-
preventScroll: true
|
|
618
|
-
}); // only select if its not the same element, it supports selection and we need to select
|
|
619
|
-
if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select();
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
/* -------------------------------------------------------------------------------------------------
|
|
623
|
-
* FocusScope stack
|
|
624
|
-
* -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
|
|
625
|
-
function $d3863c46a17e8a28$var$createFocusScopesStack() {
|
|
626
|
-
/** A stack of focus scopes, with the active one at the top */ let stack = [];
|
|
627
|
-
return {
|
|
628
|
-
add (focusScope) {
|
|
629
|
-
// pause the currently active focus scope (at the top of the stack)
|
|
630
|
-
const activeFocusScope = stack[0];
|
|
631
|
-
if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
|
|
632
|
-
// remove in case it already exists (because we'll re-add it at the top of the stack)
|
|
633
|
-
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
634
|
-
stack.unshift(focusScope);
|
|
635
|
-
},
|
|
636
|
-
remove (focusScope) {
|
|
637
|
-
var _stack$;
|
|
638
|
-
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
639
|
-
(_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
|
|
640
|
-
}
|
|
641
|
-
};
|
|
642
|
-
}
|
|
643
|
-
function $d3863c46a17e8a28$var$arrayRemove(array, item) {
|
|
644
|
-
const updatedArray = [
|
|
645
|
-
...array
|
|
646
|
-
];
|
|
647
|
-
const index = updatedArray.indexOf(item);
|
|
648
|
-
if (index !== -1) updatedArray.splice(index, 1);
|
|
649
|
-
return updatedArray;
|
|
650
|
-
}
|
|
651
|
-
function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
652
|
-
return items.filter((item)=>item.tagName !== 'A'
|
|
653
|
-
);
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
const $1746a345f3d73bb7$var$useReactId = React__namespace['useId'.toString()] || (()=>undefined
|
|
657
|
-
);
|
|
658
|
-
let $1746a345f3d73bb7$var$count = 0;
|
|
659
|
-
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
660
|
-
const [id, setId] = React__namespace.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
|
|
661
|
-
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
662
|
-
if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
|
|
663
|
-
);
|
|
664
|
-
}, [
|
|
665
|
-
deterministicId
|
|
666
|
-
]);
|
|
667
|
-
return deterministicId || (id ? `radix-${id}` : '');
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
671
|
-
var _globalThis$document;
|
|
672
|
-
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;
|
|
673
|
-
return container ? /*#__PURE__*/ $7SXl2$reactdom__default["default"].createPortal(/*#__PURE__*/ React.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends._extends({}, portalProps, {
|
|
674
|
-
ref: forwardedRef
|
|
675
|
-
})), container) : null;
|
|
676
|
-
});
|
|
677
|
-
|
|
678
|
-
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
679
|
-
return /*#__PURE__*/ React.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends._extends({}, props, {
|
|
680
|
-
ref: forwardedRef,
|
|
681
|
-
style: {
|
|
682
|
-
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
683
|
-
position: 'absolute',
|
|
684
|
-
border: 0,
|
|
685
|
-
width: 1,
|
|
686
|
-
height: 1,
|
|
687
|
-
padding: 0,
|
|
688
|
-
margin: -1,
|
|
689
|
-
overflow: 'hidden',
|
|
690
|
-
clip: 'rect(0, 0, 0, 0)',
|
|
691
|
-
whiteSpace: 'nowrap',
|
|
692
|
-
wordWrap: 'normal',
|
|
693
|
-
...props.style
|
|
694
|
-
}
|
|
695
|
-
}));
|
|
696
|
-
});
|
|
697
|
-
|
|
698
35
|
const $cc7e05a45900e73f$var$OPEN_KEYS = [
|
|
699
36
|
' ',
|
|
700
37
|
'Enter',
|
|
@@ -708,24 +45,27 @@ const $cc7e05a45900e73f$var$SELECTION_KEYS = [
|
|
|
708
45
|
/* -------------------------------------------------------------------------------------------------
|
|
709
46
|
* Select
|
|
710
47
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SELECT_NAME = 'Select';
|
|
711
|
-
const [$cc7e05a45900e73f$var$Collection, $cc7e05a45900e73f$var$useCollection, $cc7e05a45900e73f$var$createCollectionScope] =
|
|
712
|
-
const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] =
|
|
713
|
-
$cc7e05a45900e73f$var$createCollectionScope
|
|
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$1.$c512c27ab02ef895$export$50c7b4e9d9f19c1($cc7e05a45900e73f$var$SELECT_NAME, [
|
|
50
|
+
$cc7e05a45900e73f$var$createCollectionScope,
|
|
51
|
+
Combination.$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
714
52
|
]);
|
|
53
|
+
const $cc7e05a45900e73f$var$usePopperScope = Combination.$cf1ac5d9fe0e8206$export$722aac194ae923();
|
|
715
54
|
const [$cc7e05a45900e73f$var$SelectProvider, $cc7e05a45900e73f$var$useSelectContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
|
|
716
55
|
const [$cc7e05a45900e73f$var$SelectNativeOptionsProvider, $cc7e05a45900e73f$var$useSelectNativeOptionsContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
|
|
717
56
|
const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
718
57
|
const { __scopeSelect: __scopeSelect , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , value: valueProp , defaultValue: defaultValue , onValueChange: onValueChange , dir: dir , name: name , autoComplete: autoComplete , disabled: disabled , required: required } = props;
|
|
58
|
+
const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
|
|
719
59
|
const [trigger, setTrigger] = React.useState(null);
|
|
720
60
|
const [valueNode, setValueNode] = React.useState(null);
|
|
721
61
|
const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);
|
|
722
|
-
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
723
|
-
const [open = false, setOpen] =
|
|
62
|
+
const direction = index$2.$f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
63
|
+
const [open = false, setOpen] = index$1.$71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
724
64
|
prop: openProp,
|
|
725
65
|
defaultProp: defaultOpen,
|
|
726
66
|
onChange: onOpenChange
|
|
727
67
|
});
|
|
728
|
-
const [value, setValue] =
|
|
68
|
+
const [value, setValue] = index$1.$71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
729
69
|
prop: valueProp,
|
|
730
70
|
defaultProp: defaultValue,
|
|
731
71
|
onChange: onValueChange
|
|
@@ -739,7 +79,7 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
739
79
|
// each time the options change.
|
|
740
80
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option)=>option.props.value
|
|
741
81
|
).join(';');
|
|
742
|
-
return /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectProvider, {
|
|
82
|
+
return /*#__PURE__*/ React.createElement(Combination.$cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectProvider, {
|
|
743
83
|
required: required,
|
|
744
84
|
scope: __scopeSelect,
|
|
745
85
|
trigger: trigger,
|
|
@@ -748,7 +88,7 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
748
88
|
onValueNodeChange: setValueNode,
|
|
749
89
|
valueNodeHasChildren: valueNodeHasChildren,
|
|
750
90
|
onValueNodeHasChildrenChange: setValueNodeHasChildren,
|
|
751
|
-
contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
91
|
+
contentId: index$3.$1746a345f3d73bb7$export$f680877a34711e37(),
|
|
752
92
|
value: value,
|
|
753
93
|
onValueChange: setValue,
|
|
754
94
|
open: open,
|
|
@@ -785,16 +125,17 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
785
125
|
disabled: disabled
|
|
786
126
|
}, value === undefined ? /*#__PURE__*/ React.createElement("option", {
|
|
787
127
|
value: ""
|
|
788
|
-
}) : null, Array.from(nativeOptionsSet)) : null);
|
|
128
|
+
}) : null, Array.from(nativeOptionsSet)) : null));
|
|
789
129
|
};
|
|
790
130
|
/* -------------------------------------------------------------------------------------------------
|
|
791
131
|
* SelectTrigger
|
|
792
132
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$TRIGGER_NAME = 'SelectTrigger';
|
|
793
133
|
const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
794
134
|
const { __scopeSelect: __scopeSelect , disabled: disabled = false , ...triggerProps } = props;
|
|
135
|
+
const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
|
|
795
136
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$TRIGGER_NAME, __scopeSelect);
|
|
796
137
|
const isDisabled = context.disabled || disabled;
|
|
797
|
-
const composedRefs =
|
|
138
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onTriggerChange);
|
|
798
139
|
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
799
140
|
const [searchRef, handleTypeaheadSearch, resetTypeahead] = $cc7e05a45900e73f$var$useTypeaheadSearch((search)=>{
|
|
800
141
|
const enabledItems = getItems().filter((item)=>!item.disabled
|
|
@@ -810,7 +151,9 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
810
151
|
resetTypeahead();
|
|
811
152
|
}
|
|
812
153
|
};
|
|
813
|
-
return /*#__PURE__*/ React.createElement(
|
|
154
|
+
return /*#__PURE__*/ React.createElement(Combination.$cf1ac5d9fe0e8206$export$b688253958b8dfe7, index$1._extends({
|
|
155
|
+
asChild: true
|
|
156
|
+
}, popperScope), /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.button, index$1._extends({
|
|
814
157
|
type: "button",
|
|
815
158
|
role: "combobox",
|
|
816
159
|
"aria-controls": context.contentId,
|
|
@@ -821,11 +164,11 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
821
164
|
"data-state": context.open ? 'open' : 'closed',
|
|
822
165
|
disabled: isDisabled,
|
|
823
166
|
"data-disabled": isDisabled ? '' : undefined,
|
|
824
|
-
"data-placeholder": context.value
|
|
167
|
+
"data-placeholder": $cc7e05a45900e73f$var$shouldShowPlaceholder(context.value) ? '' : undefined
|
|
825
168
|
}, triggerProps, {
|
|
826
169
|
ref: composedRefs // Enable compatibility with native label or custom `Label` "click" for Safari:
|
|
827
170
|
,
|
|
828
|
-
onClick:
|
|
171
|
+
onClick: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onClick, (event)=>{
|
|
829
172
|
// Whilst browsers generally have no issue focusing the trigger when clicking
|
|
830
173
|
// on a label, Safari seems to struggle with the fact that there's no `onClick`.
|
|
831
174
|
// We force `focus` in this case. Note: this doesn't create any other side-effect
|
|
@@ -833,7 +176,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
833
176
|
// this only runs for a label "click"
|
|
834
177
|
event.currentTarget.focus();
|
|
835
178
|
}),
|
|
836
|
-
onPointerDown:
|
|
179
|
+
onPointerDown: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onPointerDown, (event)=>{
|
|
837
180
|
// prevent implicit pointer capture
|
|
838
181
|
// https://www.w3.org/TR/pointerevents3/#implicit-pointer-capture
|
|
839
182
|
const target = event.target;
|
|
@@ -849,7 +192,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
849
192
|
event.preventDefault();
|
|
850
193
|
}
|
|
851
194
|
}),
|
|
852
|
-
onKeyDown:
|
|
195
|
+
onKeyDown: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onKeyDown, (event)=>{
|
|
853
196
|
const isTypingAhead = searchRef.current !== '';
|
|
854
197
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
855
198
|
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
|
@@ -859,42 +202,42 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React.forwardRef(
|
|
|
859
202
|
event.preventDefault();
|
|
860
203
|
}
|
|
861
204
|
})
|
|
862
|
-
}));
|
|
205
|
+
})));
|
|
863
206
|
});
|
|
864
207
|
/* -------------------------------------------------------------------------------------------------
|
|
865
208
|
* SelectValue
|
|
866
209
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$VALUE_NAME = 'SelectValue';
|
|
867
210
|
const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
868
211
|
// We ignore `className` and `style` as this part shouldn't be styled.
|
|
869
|
-
const { __scopeSelect: __scopeSelect , className: className , style: style , children: children , placeholder: placeholder , ...valueProps } = props;
|
|
212
|
+
const { __scopeSelect: __scopeSelect , className: className , style: style , children: children , placeholder: placeholder = '' , ...valueProps } = props;
|
|
870
213
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$VALUE_NAME, __scopeSelect);
|
|
871
214
|
const { onValueNodeHasChildrenChange: onValueNodeHasChildrenChange } = context;
|
|
872
215
|
const hasChildren = children !== undefined;
|
|
873
|
-
const composedRefs =
|
|
874
|
-
|
|
216
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onValueNodeChange);
|
|
217
|
+
index$1.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
875
218
|
onValueNodeHasChildrenChange(hasChildren);
|
|
876
219
|
}, [
|
|
877
220
|
onValueNodeHasChildrenChange,
|
|
878
221
|
hasChildren
|
|
879
222
|
]);
|
|
880
|
-
return /*#__PURE__*/ React.createElement(
|
|
223
|
+
return /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index$1._extends({}, valueProps, {
|
|
881
224
|
ref: composedRefs // we don't want events from the portalled `SelectValue` children to bubble
|
|
882
225
|
,
|
|
883
226
|
style: {
|
|
884
227
|
pointerEvents: 'none'
|
|
885
228
|
}
|
|
886
|
-
}), context.value
|
|
229
|
+
}), $cc7e05a45900e73f$var$shouldShowPlaceholder(context.value) ? /*#__PURE__*/ React.createElement(React.Fragment, null, placeholder) : children);
|
|
887
230
|
});
|
|
888
231
|
const $cc7e05a45900e73f$export$99b400cabb58c515 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
889
232
|
const { __scopeSelect: __scopeSelect , children: children , ...iconProps } = props;
|
|
890
|
-
return /*#__PURE__*/ React.createElement(
|
|
233
|
+
return /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index$1._extends({
|
|
891
234
|
"aria-hidden": true
|
|
892
235
|
}, iconProps, {
|
|
893
236
|
ref: forwardedRef
|
|
894
237
|
}), children || '▼');
|
|
895
238
|
});
|
|
896
239
|
const $cc7e05a45900e73f$export$b2af6c9944296213 = (props)=>{
|
|
897
|
-
return /*#__PURE__*/ React.createElement(
|
|
240
|
+
return /*#__PURE__*/ React.createElement(Combination.$f1701beae083dbae$export$602eac185826482c, index$1._extends({
|
|
898
241
|
asChild: true
|
|
899
242
|
}, props));
|
|
900
243
|
};
|
|
@@ -904,47 +247,47 @@ const $cc7e05a45900e73f$export$b2af6c9944296213 = (props)=>{
|
|
|
904
247
|
const $cc7e05a45900e73f$export$c973a4b3cb86a03d = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
905
248
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, props.__scopeSelect);
|
|
906
249
|
const [fragment, setFragment] = React.useState(); // setting the fragment in `useLayoutEffect` as `DocumentFragment` doesn't exist on the server
|
|
907
|
-
|
|
250
|
+
index$1.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
908
251
|
setFragment(new DocumentFragment());
|
|
909
252
|
}, []);
|
|
910
|
-
|
|
253
|
+
if (!context.open) {
|
|
254
|
+
const frag = fragment;
|
|
255
|
+
return frag ? /*#__PURE__*/ ReactDOM.createPortal(/*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectContentProvider, {
|
|
256
|
+
scope: props.__scopeSelect
|
|
257
|
+
}, /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
258
|
+
scope: props.__scopeSelect
|
|
259
|
+
}, /*#__PURE__*/ React.createElement("div", null, props.children))), frag) : null;
|
|
260
|
+
}
|
|
261
|
+
return /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectContentImpl, index$1._extends({}, props, {
|
|
911
262
|
ref: forwardedRef
|
|
912
|
-
}))
|
|
913
|
-
scope: props.__scopeSelect
|
|
914
|
-
}, /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
915
|
-
scope: props.__scopeSelect
|
|
916
|
-
}, /*#__PURE__*/ React.createElement("div", null, props.children))), fragment) : null);
|
|
263
|
+
}));
|
|
917
264
|
});
|
|
918
|
-
|
|
265
|
+
/* -------------------------------------------------------------------------------------------------
|
|
266
|
+
* SelectContentImpl
|
|
267
|
+
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$CONTENT_MARGIN = 10;
|
|
919
268
|
const [$cc7e05a45900e73f$var$SelectContentProvider, $cc7e05a45900e73f$var$useSelectContentContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$CONTENT_NAME);
|
|
920
269
|
const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
921
|
-
const { __scopeSelect: __scopeSelect , onCloseAutoFocus: onCloseAutoFocus ,
|
|
270
|
+
const { __scopeSelect: __scopeSelect , position: position = 'item-aligned' , onCloseAutoFocus: onCloseAutoFocus , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , side: //
|
|
271
|
+
// PopperContent props
|
|
272
|
+
side , sideOffset: sideOffset , align: align , alignOffset: alignOffset , arrowPadding: arrowPadding , collisionBoundary: collisionBoundary , collisionPadding: collisionPadding , sticky: sticky , hideWhenDetached: hideWhenDetached , avoidCollisions: avoidCollisions , //
|
|
273
|
+
...contentProps } = props;
|
|
922
274
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
|
|
923
|
-
const [contentWrapper, setContentWrapper] = React.useState(null);
|
|
924
275
|
const [content, setContent] = React.useState(null);
|
|
925
276
|
const [viewport, setViewport] = React.useState(null);
|
|
926
|
-
const composedRefs =
|
|
277
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
927
278
|
);
|
|
928
279
|
const [selectedItem, setSelectedItem] = React.useState(null);
|
|
929
280
|
const [selectedItemText, setSelectedItemText] = React.useState(null);
|
|
930
281
|
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
931
282
|
const [isPositioned, setIsPositioned] = React.useState(false);
|
|
932
|
-
const shouldRepositionRef = React.useRef(true);
|
|
933
|
-
const shouldExpandOnScrollRef = React.useRef(false);
|
|
934
283
|
const firstValidItemFoundRef = React.useRef(false); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
|
|
935
284
|
React.useEffect(()=>{
|
|
936
|
-
if (content) return
|
|
285
|
+
if (content) return component.hideOthers(content);
|
|
937
286
|
}, [
|
|
938
287
|
content
|
|
939
288
|
]); // Make sure the whole tree has focus guards as our `Select` may be
|
|
940
289
|
// the last element in the DOM (because of the `Portal`)
|
|
941
|
-
|
|
942
|
-
const [contentZIndex, setContentZIndex] = React.useState();
|
|
943
|
-
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
944
|
-
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
945
|
-
}, [
|
|
946
|
-
content
|
|
947
|
-
]);
|
|
290
|
+
Combination.$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
948
291
|
const focusFirst = React.useCallback((candidates)=>{
|
|
949
292
|
const [firstItem, ...restItems] = getItems().map((item)=>item.ref.current
|
|
950
293
|
);
|
|
@@ -965,101 +308,6 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
965
308
|
getItems,
|
|
966
309
|
viewport
|
|
967
310
|
]);
|
|
968
|
-
const position = React.useCallback(()=>{
|
|
969
|
-
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
970
|
-
const triggerRect = context.trigger.getBoundingClientRect(); // -----------------------------------------------------------------------------------------
|
|
971
|
-
// Horizontal positioning
|
|
972
|
-
// -----------------------------------------------------------------------------------------
|
|
973
|
-
const contentRect = content.getBoundingClientRect();
|
|
974
|
-
const valueNodeRect = context.valueNode.getBoundingClientRect();
|
|
975
|
-
const itemTextRect = selectedItemText.getBoundingClientRect();
|
|
976
|
-
if (context.dir !== 'rtl') {
|
|
977
|
-
const itemTextOffset = itemTextRect.left - contentRect.left;
|
|
978
|
-
const left = valueNodeRect.left - itemTextOffset;
|
|
979
|
-
const leftDelta = triggerRect.left - left;
|
|
980
|
-
const minContentWidth = triggerRect.width + leftDelta;
|
|
981
|
-
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
982
|
-
const rightEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
983
|
-
const clampedLeft = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(left, [
|
|
984
|
-
$cc7e05a45900e73f$var$CONTENT_MARGIN,
|
|
985
|
-
rightEdge - contentWidth
|
|
986
|
-
]);
|
|
987
|
-
contentWrapper.style.minWidth = minContentWidth + 'px';
|
|
988
|
-
contentWrapper.style.left = clampedLeft + 'px';
|
|
989
|
-
} else {
|
|
990
|
-
const itemTextOffset = contentRect.right - itemTextRect.right;
|
|
991
|
-
const right = window.innerWidth - valueNodeRect.right - itemTextOffset;
|
|
992
|
-
const rightDelta = window.innerWidth - triggerRect.right - right;
|
|
993
|
-
const minContentWidth = triggerRect.width + rightDelta;
|
|
994
|
-
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
995
|
-
const leftEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
996
|
-
const clampedRight = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(right, [
|
|
997
|
-
$cc7e05a45900e73f$var$CONTENT_MARGIN,
|
|
998
|
-
leftEdge - contentWidth
|
|
999
|
-
]);
|
|
1000
|
-
contentWrapper.style.minWidth = minContentWidth + 'px';
|
|
1001
|
-
contentWrapper.style.right = clampedRight + 'px';
|
|
1002
|
-
} // -----------------------------------------------------------------------------------------
|
|
1003
|
-
// Vertical positioning
|
|
1004
|
-
// -----------------------------------------------------------------------------------------
|
|
1005
|
-
const items = getItems();
|
|
1006
|
-
const availableHeight = window.innerHeight - $cc7e05a45900e73f$var$CONTENT_MARGIN * 2;
|
|
1007
|
-
const itemsHeight = viewport.scrollHeight;
|
|
1008
|
-
const contentStyles = window.getComputedStyle(content);
|
|
1009
|
-
const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);
|
|
1010
|
-
const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);
|
|
1011
|
-
const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);
|
|
1012
|
-
const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);
|
|
1013
|
-
const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth; // prettier-ignore
|
|
1014
|
-
const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);
|
|
1015
|
-
const viewportStyles = window.getComputedStyle(viewport);
|
|
1016
|
-
const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);
|
|
1017
|
-
const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);
|
|
1018
|
-
const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
1019
|
-
const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;
|
|
1020
|
-
const selectedItemHalfHeight = selectedItem.offsetHeight / 2;
|
|
1021
|
-
const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;
|
|
1022
|
-
const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;
|
|
1023
|
-
const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;
|
|
1024
|
-
const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;
|
|
1025
|
-
if (willAlignWithoutTopOverflow) {
|
|
1026
|
-
const isLastItem = selectedItem === items[items.length - 1].ref.current;
|
|
1027
|
-
contentWrapper.style.bottom = "0px";
|
|
1028
|
-
const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;
|
|
1029
|
-
const clampedTriggerMiddleToBottomEdge = Math.max(triggerMiddleToBottomEdge, selectedItemHalfHeight + (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth);
|
|
1030
|
-
const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;
|
|
1031
|
-
contentWrapper.style.height = height + 'px';
|
|
1032
|
-
} else {
|
|
1033
|
-
const isFirstItem = selectedItem === items[0].ref.current;
|
|
1034
|
-
contentWrapper.style.top = "0px";
|
|
1035
|
-
const clampedTopEdgeToTriggerMiddle = Math.max(topEdgeToTriggerMiddle, contentBorderTopWidth + viewport.offsetTop + (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight);
|
|
1036
|
-
const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;
|
|
1037
|
-
contentWrapper.style.height = height + 'px';
|
|
1038
|
-
viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;
|
|
1039
|
-
}
|
|
1040
|
-
contentWrapper.style.margin = `${$cc7e05a45900e73f$var$CONTENT_MARGIN}px 0`;
|
|
1041
|
-
contentWrapper.style.minHeight = minContentHeight + 'px';
|
|
1042
|
-
contentWrapper.style.maxHeight = availableHeight + 'px'; // -----------------------------------------------------------------------------------------
|
|
1043
|
-
setIsPositioned(true); // we don't want the initial scroll position adjustment to trigger "expand on scroll"
|
|
1044
|
-
// so we explicitly turn it on only after they've registered.
|
|
1045
|
-
requestAnimationFrame(()=>shouldExpandOnScrollRef.current = true
|
|
1046
|
-
);
|
|
1047
|
-
}
|
|
1048
|
-
}, [
|
|
1049
|
-
getItems,
|
|
1050
|
-
context.trigger,
|
|
1051
|
-
context.valueNode,
|
|
1052
|
-
contentWrapper,
|
|
1053
|
-
content,
|
|
1054
|
-
viewport,
|
|
1055
|
-
selectedItem,
|
|
1056
|
-
selectedItemText,
|
|
1057
|
-
context.dir
|
|
1058
|
-
]);
|
|
1059
|
-
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>position()
|
|
1060
|
-
, [
|
|
1061
|
-
position
|
|
1062
|
-
]);
|
|
1063
311
|
const focusSelectedItem = React.useCallback(()=>focusFirst([
|
|
1064
312
|
selectedItem,
|
|
1065
313
|
content
|
|
@@ -1075,19 +323,6 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
1075
323
|
}, [
|
|
1076
324
|
isPositioned,
|
|
1077
325
|
focusSelectedItem
|
|
1078
|
-
]); // When the viewport becomes scrollable at the top, the scroll up button will mount.
|
|
1079
|
-
// Because it is part of the normal flow, it will push down the viewport, thus throwing our
|
|
1080
|
-
// trigger => selectedItem alignment off by the amount the viewport was pushed down.
|
|
1081
|
-
// We wait for this to happen and then re-run the positining logic one more time to account for it.
|
|
1082
|
-
const handleScrollButtonChange = React.useCallback((node)=>{
|
|
1083
|
-
if (node && shouldRepositionRef.current === true) {
|
|
1084
|
-
position();
|
|
1085
|
-
focusSelectedItem();
|
|
1086
|
-
shouldRepositionRef.current = false;
|
|
1087
|
-
}
|
|
1088
|
-
}, [
|
|
1089
|
-
position,
|
|
1090
|
-
focusSelectedItem
|
|
1091
326
|
]); // prevent selecting items on `pointerup` in some cases after opening from `pointerdown`
|
|
1092
327
|
// and close on `pointerup` outside.
|
|
1093
328
|
const { onOpenChange: onOpenChange , triggerPointerDownPosRef: triggerPointerDownPosRef } = context;
|
|
@@ -1176,9 +411,21 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
1176
411
|
}, [
|
|
1177
412
|
context.value
|
|
1178
413
|
]);
|
|
414
|
+
const SelectPosition = position === 'popper' ? $cc7e05a45900e73f$var$SelectPopperPosition : $cc7e05a45900e73f$var$SelectItemAlignedPosition; // Silently ignore props that are not supported by `SelectItemAlignedPosition`
|
|
415
|
+
const popperContentProps = SelectPosition === $cc7e05a45900e73f$var$SelectPopperPosition ? {
|
|
416
|
+
side: side,
|
|
417
|
+
sideOffset: sideOffset,
|
|
418
|
+
align: align,
|
|
419
|
+
alignOffset: alignOffset,
|
|
420
|
+
arrowPadding: arrowPadding,
|
|
421
|
+
collisionBoundary: collisionBoundary,
|
|
422
|
+
collisionPadding: collisionPadding,
|
|
423
|
+
sticky: sticky,
|
|
424
|
+
hideWhenDetached: hideWhenDetached,
|
|
425
|
+
avoidCollisions: avoidCollisions
|
|
426
|
+
} : {};
|
|
1179
427
|
return /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectContentProvider, {
|
|
1180
428
|
scope: __scopeSelect,
|
|
1181
|
-
contentWrapper: contentWrapper,
|
|
1182
429
|
content: content,
|
|
1183
430
|
viewport: viewport,
|
|
1184
431
|
onViewportChange: setViewport,
|
|
@@ -1186,23 +433,15 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
1186
433
|
selectedItem: selectedItem,
|
|
1187
434
|
onItemLeave: handleItemLeave,
|
|
1188
435
|
itemTextRefCallback: itemTextRefCallback,
|
|
436
|
+
focusSelectedItem: focusSelectedItem,
|
|
1189
437
|
selectedItemText: selectedItemText,
|
|
1190
|
-
|
|
438
|
+
position: position,
|
|
1191
439
|
isPositioned: isPositioned,
|
|
1192
|
-
shouldExpandOnScrollRef: shouldExpandOnScrollRef,
|
|
1193
440
|
searchRef: searchRef
|
|
1194
|
-
}, /*#__PURE__*/ React.createElement(
|
|
1195
|
-
as:
|
|
441
|
+
}, /*#__PURE__*/ React.createElement(Combination.$01b9c$RemoveScroll, {
|
|
442
|
+
as: index$1.$5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
1196
443
|
allowPinchZoom: true
|
|
1197
|
-
}, /*#__PURE__*/ React.createElement(
|
|
1198
|
-
ref: setContentWrapper,
|
|
1199
|
-
style: {
|
|
1200
|
-
display: 'flex',
|
|
1201
|
-
flexDirection: 'column',
|
|
1202
|
-
position: 'fixed',
|
|
1203
|
-
zIndex: contentZIndex
|
|
1204
|
-
}
|
|
1205
|
-
}, /*#__PURE__*/ React.createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
444
|
+
}, /*#__PURE__*/ React.createElement(Combination.$d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
1206
445
|
asChild: true // we make sure we're not trapping once it's been closed
|
|
1207
446
|
,
|
|
1208
447
|
trapped: context.open,
|
|
@@ -1210,38 +449,41 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
1210
449
|
// we prevent open autofocus because we manually focus the selected item
|
|
1211
450
|
event.preventDefault();
|
|
1212
451
|
},
|
|
1213
|
-
onUnmountAutoFocus:
|
|
452
|
+
onUnmountAutoFocus: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(onCloseAutoFocus, (event)=>{
|
|
1214
453
|
var _context$trigger;
|
|
1215
454
|
(_context$trigger = context.trigger) === null || _context$trigger === void 0 || _context$trigger.focus({
|
|
1216
455
|
preventScroll: true
|
|
1217
456
|
});
|
|
1218
457
|
event.preventDefault();
|
|
1219
458
|
})
|
|
1220
|
-
}, /*#__PURE__*/ React.createElement(
|
|
459
|
+
}, /*#__PURE__*/ React.createElement(Combination.$5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
460
|
+
asChild: true,
|
|
461
|
+
disableOutsidePointerEvents: true,
|
|
462
|
+
onEscapeKeyDown: onEscapeKeyDown,
|
|
463
|
+
onPointerDownOutside: onPointerDownOutside // When focus is trapped, a focusout event may still happen.
|
|
464
|
+
,
|
|
465
|
+
onFocusOutside: (event)=>event.preventDefault()
|
|
466
|
+
,
|
|
467
|
+
onDismiss: ()=>context.onOpenChange(false)
|
|
468
|
+
}, /*#__PURE__*/ React.createElement(SelectPosition, index$1._extends({
|
|
1221
469
|
role: "listbox",
|
|
1222
470
|
id: context.contentId,
|
|
1223
471
|
"data-state": context.open ? 'open' : 'closed',
|
|
1224
472
|
dir: context.dir,
|
|
1225
473
|
onContextMenu: (event)=>event.preventDefault()
|
|
1226
|
-
}, contentProps, {
|
|
474
|
+
}, contentProps, popperContentProps, {
|
|
475
|
+
onPlaced: ()=>setIsPositioned(true)
|
|
476
|
+
,
|
|
1227
477
|
ref: composedRefs,
|
|
1228
478
|
style: {
|
|
479
|
+
// flex layout so we can place the scroll buttons properly
|
|
1229
480
|
display: 'flex',
|
|
1230
481
|
flexDirection: 'column',
|
|
1231
|
-
//
|
|
1232
|
-
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
1233
|
-
boxSizing: 'border-box',
|
|
1234
|
-
maxHeight: '100%',
|
|
482
|
+
// reset the outline by default as the content MAY get focused
|
|
1235
483
|
outline: 'none',
|
|
1236
484
|
...contentProps.style
|
|
1237
485
|
},
|
|
1238
|
-
|
|
1239
|
-
,
|
|
1240
|
-
onFocusOutside: (event)=>event.preventDefault()
|
|
1241
|
-
,
|
|
1242
|
-
onDismiss: ()=>context.onOpenChange(false)
|
|
1243
|
-
,
|
|
1244
|
-
onKeyDown: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event)=>{
|
|
486
|
+
onKeyDown: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event)=>{
|
|
1245
487
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; // select should not be navigated using tab key so we prevent it
|
|
1246
488
|
if (event.key === 'Tab') event.preventDefault();
|
|
1247
489
|
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
|
@@ -1277,13 +519,186 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React.forwardRef((
|
|
|
1277
519
|
})
|
|
1278
520
|
}))))));
|
|
1279
521
|
});
|
|
522
|
+
const $cc7e05a45900e73f$var$SelectItemAlignedPosition = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
523
|
+
const { __scopeSelect: __scopeSelect , onPlaced: onPlaced , ...popperProps } = props;
|
|
524
|
+
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
|
|
525
|
+
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
|
|
526
|
+
const [contentWrapper, setContentWrapper] = React.useState(null);
|
|
527
|
+
const [content, setContent] = React.useState(null);
|
|
528
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
529
|
+
);
|
|
530
|
+
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
531
|
+
const shouldExpandOnScrollRef = React.useRef(false);
|
|
532
|
+
const shouldRepositionRef = React.useRef(true);
|
|
533
|
+
const { viewport: viewport , selectedItem: selectedItem , selectedItemText: selectedItemText , focusSelectedItem: focusSelectedItem } = contentContext;
|
|
534
|
+
const position = React.useCallback(()=>{
|
|
535
|
+
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
536
|
+
const triggerRect = context.trigger.getBoundingClientRect(); // -----------------------------------------------------------------------------------------
|
|
537
|
+
// Horizontal positioning
|
|
538
|
+
// -----------------------------------------------------------------------------------------
|
|
539
|
+
const contentRect = content.getBoundingClientRect();
|
|
540
|
+
const valueNodeRect = context.valueNode.getBoundingClientRect();
|
|
541
|
+
const itemTextRect = selectedItemText.getBoundingClientRect();
|
|
542
|
+
if (context.dir !== 'rtl') {
|
|
543
|
+
const itemTextOffset = itemTextRect.left - contentRect.left;
|
|
544
|
+
const left = valueNodeRect.left - itemTextOffset;
|
|
545
|
+
const leftDelta = triggerRect.left - left;
|
|
546
|
+
const minContentWidth = triggerRect.width + leftDelta;
|
|
547
|
+
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
548
|
+
const rightEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
549
|
+
const clampedLeft = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(left, [
|
|
550
|
+
$cc7e05a45900e73f$var$CONTENT_MARGIN,
|
|
551
|
+
rightEdge - contentWidth
|
|
552
|
+
]);
|
|
553
|
+
contentWrapper.style.minWidth = minContentWidth + 'px';
|
|
554
|
+
contentWrapper.style.left = clampedLeft + 'px';
|
|
555
|
+
} else {
|
|
556
|
+
const itemTextOffset = contentRect.right - itemTextRect.right;
|
|
557
|
+
const right = window.innerWidth - valueNodeRect.right - itemTextOffset;
|
|
558
|
+
const rightDelta = window.innerWidth - triggerRect.right - right;
|
|
559
|
+
const minContentWidth = triggerRect.width + rightDelta;
|
|
560
|
+
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
561
|
+
const leftEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
562
|
+
const clampedRight = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(right, [
|
|
563
|
+
$cc7e05a45900e73f$var$CONTENT_MARGIN,
|
|
564
|
+
leftEdge - contentWidth
|
|
565
|
+
]);
|
|
566
|
+
contentWrapper.style.minWidth = minContentWidth + 'px';
|
|
567
|
+
contentWrapper.style.right = clampedRight + 'px';
|
|
568
|
+
} // -----------------------------------------------------------------------------------------
|
|
569
|
+
// Vertical positioning
|
|
570
|
+
// -----------------------------------------------------------------------------------------
|
|
571
|
+
const items = getItems();
|
|
572
|
+
const availableHeight = window.innerHeight - $cc7e05a45900e73f$var$CONTENT_MARGIN * 2;
|
|
573
|
+
const itemsHeight = viewport.scrollHeight;
|
|
574
|
+
const contentStyles = window.getComputedStyle(content);
|
|
575
|
+
const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);
|
|
576
|
+
const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);
|
|
577
|
+
const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);
|
|
578
|
+
const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);
|
|
579
|
+
const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth; // prettier-ignore
|
|
580
|
+
const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);
|
|
581
|
+
const viewportStyles = window.getComputedStyle(viewport);
|
|
582
|
+
const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);
|
|
583
|
+
const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);
|
|
584
|
+
const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
585
|
+
const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;
|
|
586
|
+
const selectedItemHalfHeight = selectedItem.offsetHeight / 2;
|
|
587
|
+
const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;
|
|
588
|
+
const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;
|
|
589
|
+
const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;
|
|
590
|
+
const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;
|
|
591
|
+
if (willAlignWithoutTopOverflow) {
|
|
592
|
+
const isLastItem = selectedItem === items[items.length - 1].ref.current;
|
|
593
|
+
contentWrapper.style.bottom = "0px";
|
|
594
|
+
const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;
|
|
595
|
+
const clampedTriggerMiddleToBottomEdge = Math.max(triggerMiddleToBottomEdge, selectedItemHalfHeight + (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth);
|
|
596
|
+
const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;
|
|
597
|
+
contentWrapper.style.height = height + 'px';
|
|
598
|
+
} else {
|
|
599
|
+
const isFirstItem = selectedItem === items[0].ref.current;
|
|
600
|
+
contentWrapper.style.top = "0px";
|
|
601
|
+
const clampedTopEdgeToTriggerMiddle = Math.max(topEdgeToTriggerMiddle, contentBorderTopWidth + viewport.offsetTop + (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight);
|
|
602
|
+
const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;
|
|
603
|
+
contentWrapper.style.height = height + 'px';
|
|
604
|
+
viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;
|
|
605
|
+
}
|
|
606
|
+
contentWrapper.style.margin = `${$cc7e05a45900e73f$var$CONTENT_MARGIN}px 0`;
|
|
607
|
+
contentWrapper.style.minHeight = minContentHeight + 'px';
|
|
608
|
+
contentWrapper.style.maxHeight = availableHeight + 'px'; // -----------------------------------------------------------------------------------------
|
|
609
|
+
onPlaced === null || onPlaced === void 0 || onPlaced(); // we don't want the initial scroll position adjustment to trigger "expand on scroll"
|
|
610
|
+
// so we explicitly turn it on only after they've registered.
|
|
611
|
+
requestAnimationFrame(()=>shouldExpandOnScrollRef.current = true
|
|
612
|
+
);
|
|
613
|
+
}
|
|
614
|
+
}, [
|
|
615
|
+
getItems,
|
|
616
|
+
context.trigger,
|
|
617
|
+
context.valueNode,
|
|
618
|
+
contentWrapper,
|
|
619
|
+
content,
|
|
620
|
+
viewport,
|
|
621
|
+
selectedItem,
|
|
622
|
+
selectedItemText,
|
|
623
|
+
context.dir,
|
|
624
|
+
onPlaced
|
|
625
|
+
]);
|
|
626
|
+
index$1.$9f79659886946c16$export$e5c5a5f917a5871c(()=>position()
|
|
627
|
+
, [
|
|
628
|
+
position
|
|
629
|
+
]); // copy z-index from content to wrapper
|
|
630
|
+
const [contentZIndex, setContentZIndex] = React.useState();
|
|
631
|
+
index$1.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
632
|
+
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
633
|
+
}, [
|
|
634
|
+
content
|
|
635
|
+
]); // When the viewport becomes scrollable at the top, the scroll up button will mount.
|
|
636
|
+
// Because it is part of the normal flow, it will push down the viewport, thus throwing our
|
|
637
|
+
// trigger => selectedItem alignment off by the amount the viewport was pushed down.
|
|
638
|
+
// We wait for this to happen and then re-run the positining logic one more time to account for it.
|
|
639
|
+
const handleScrollButtonChange = React.useCallback((node)=>{
|
|
640
|
+
if (node && shouldRepositionRef.current === true) {
|
|
641
|
+
position();
|
|
642
|
+
focusSelectedItem === null || focusSelectedItem === void 0 || focusSelectedItem();
|
|
643
|
+
shouldRepositionRef.current = false;
|
|
644
|
+
}
|
|
645
|
+
}, [
|
|
646
|
+
position,
|
|
647
|
+
focusSelectedItem
|
|
648
|
+
]);
|
|
649
|
+
return /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectViewportProvider, {
|
|
650
|
+
scope: __scopeSelect,
|
|
651
|
+
contentWrapper: contentWrapper,
|
|
652
|
+
shouldExpandOnScrollRef: shouldExpandOnScrollRef,
|
|
653
|
+
onScrollButtonChange: handleScrollButtonChange
|
|
654
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
655
|
+
ref: setContentWrapper,
|
|
656
|
+
style: {
|
|
657
|
+
display: 'flex',
|
|
658
|
+
flexDirection: 'column',
|
|
659
|
+
position: 'fixed',
|
|
660
|
+
zIndex: contentZIndex
|
|
661
|
+
}
|
|
662
|
+
}, /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index$1._extends({}, popperProps, {
|
|
663
|
+
ref: composedRefs,
|
|
664
|
+
style: {
|
|
665
|
+
// When we get the height of the content, it includes borders. If we were to set
|
|
666
|
+
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
667
|
+
boxSizing: 'border-box',
|
|
668
|
+
// We need to ensure the content doesn't get taller than the wrapper
|
|
669
|
+
maxHeight: '100%',
|
|
670
|
+
...popperProps.style
|
|
671
|
+
}
|
|
672
|
+
}))));
|
|
673
|
+
});
|
|
674
|
+
const $cc7e05a45900e73f$var$SelectPopperPosition = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
675
|
+
const { __scopeSelect: __scopeSelect , align: align = 'start' , collisionPadding: collisionPadding = $cc7e05a45900e73f$var$CONTENT_MARGIN , ...popperProps } = props;
|
|
676
|
+
const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
|
|
677
|
+
return /*#__PURE__*/ React.createElement(Combination.$cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, index$1._extends({}, popperScope, popperProps, {
|
|
678
|
+
ref: forwardedRef,
|
|
679
|
+
align: align,
|
|
680
|
+
collisionPadding: collisionPadding,
|
|
681
|
+
style: {
|
|
682
|
+
// Ensure border-box for floating-ui calculations
|
|
683
|
+
boxSizing: 'border-box',
|
|
684
|
+
...popperProps.style,
|
|
685
|
+
'--radix-select-content-transform-origin': 'var(--radix-popper-transform-origin)',
|
|
686
|
+
'--radix-select-content-available-width': 'var(--radix-popper-available-width)',
|
|
687
|
+
'--radix-select-content-available-height': 'var(--radix-popper-available-height)',
|
|
688
|
+
'--radix-select-trigger-width': 'var(--radix-popper-anchor-width)',
|
|
689
|
+
'--radix-select-trigger-height': 'var(--radix-popper-anchor-height)'
|
|
690
|
+
}
|
|
691
|
+
}));
|
|
692
|
+
});
|
|
1280
693
|
/* -------------------------------------------------------------------------------------------------
|
|
1281
694
|
* SelectViewport
|
|
1282
|
-
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$
|
|
695
|
+
* -----------------------------------------------------------------------------------------------*/ const [$cc7e05a45900e73f$var$SelectViewportProvider, $cc7e05a45900e73f$var$useSelectViewportContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, {});
|
|
696
|
+
const $cc7e05a45900e73f$var$VIEWPORT_NAME = 'SelectViewport';
|
|
1283
697
|
const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
1284
698
|
const { __scopeSelect: __scopeSelect , ...viewportProps } = props;
|
|
1285
699
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
|
|
1286
|
-
const
|
|
700
|
+
const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
|
|
701
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onViewportChange);
|
|
1287
702
|
const prevScrollTopRef = React.useRef(0);
|
|
1288
703
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("style", {
|
|
1289
704
|
dangerouslySetInnerHTML: {
|
|
@@ -1291,7 +706,7 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React.forwardRef
|
|
|
1291
706
|
}
|
|
1292
707
|
}), /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
1293
708
|
scope: __scopeSelect
|
|
1294
|
-
}, /*#__PURE__*/ React.createElement(
|
|
709
|
+
}, /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index$1._extends({
|
|
1295
710
|
"data-radix-select-viewport": "",
|
|
1296
711
|
role: "presentation"
|
|
1297
712
|
}, viewportProps, {
|
|
@@ -1305,9 +720,9 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React.forwardRef
|
|
|
1305
720
|
overflow: 'auto',
|
|
1306
721
|
...viewportProps.style
|
|
1307
722
|
},
|
|
1308
|
-
onScroll:
|
|
723
|
+
onScroll: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(viewportProps.onScroll, (event)=>{
|
|
1309
724
|
const viewport = event.currentTarget;
|
|
1310
|
-
const { contentWrapper: contentWrapper , shouldExpandOnScrollRef: shouldExpandOnScrollRef } =
|
|
725
|
+
const { contentWrapper: contentWrapper , shouldExpandOnScrollRef: shouldExpandOnScrollRef } = viewportContext;
|
|
1311
726
|
if (shouldExpandOnScrollRef !== null && shouldExpandOnScrollRef !== void 0 && shouldExpandOnScrollRef.current && contentWrapper) {
|
|
1312
727
|
const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);
|
|
1313
728
|
if (scrolledBy > 0) {
|
|
@@ -1346,17 +761,18 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
1346
761
|
const isSelected = context.value === value;
|
|
1347
762
|
const [textValue, setTextValue] = React.useState(textValueProp !== null && textValueProp !== void 0 ? textValueProp : '');
|
|
1348
763
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
1349
|
-
const composedRefs =
|
|
764
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>{
|
|
1350
765
|
var _contentContext$itemR;
|
|
1351
766
|
return (_contentContext$itemR = contentContext.itemRefCallback) === null || _contentContext$itemR === void 0 ? void 0 : _contentContext$itemR.call(contentContext, node, value, disabled);
|
|
1352
767
|
});
|
|
1353
|
-
const textId = $1746a345f3d73bb7$export$f680877a34711e37();
|
|
768
|
+
const textId = index$3.$1746a345f3d73bb7$export$f680877a34711e37();
|
|
1354
769
|
const handleSelect = ()=>{
|
|
1355
770
|
if (!disabled) {
|
|
1356
771
|
context.onValueChange(value);
|
|
1357
772
|
context.onOpenChange(false);
|
|
1358
773
|
}
|
|
1359
774
|
};
|
|
775
|
+
if (value === '') throw new Error('A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.');
|
|
1360
776
|
return /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectItemContextProvider, {
|
|
1361
777
|
scope: __scopeSelect,
|
|
1362
778
|
value: value,
|
|
@@ -1374,7 +790,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
1374
790
|
value: value,
|
|
1375
791
|
disabled: disabled,
|
|
1376
792
|
textValue: textValue
|
|
1377
|
-
}, /*#__PURE__*/ React.createElement(
|
|
793
|
+
}, /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index$1._extends({
|
|
1378
794
|
role: "option",
|
|
1379
795
|
"aria-labelledby": textId,
|
|
1380
796
|
"data-highlighted": isFocused ? '' : undefined // `isFocused` caveat fixes stuttering in VoiceOver
|
|
@@ -1386,12 +802,12 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
1386
802
|
tabIndex: disabled ? undefined : -1
|
|
1387
803
|
}, itemProps, {
|
|
1388
804
|
ref: composedRefs,
|
|
1389
|
-
onFocus:
|
|
805
|
+
onFocus: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onFocus, ()=>setIsFocused(true)
|
|
1390
806
|
),
|
|
1391
|
-
onBlur:
|
|
807
|
+
onBlur: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onBlur, ()=>setIsFocused(false)
|
|
1392
808
|
),
|
|
1393
|
-
onPointerUp:
|
|
1394
|
-
onPointerMove:
|
|
809
|
+
onPointerUp: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerUp, handleSelect),
|
|
810
|
+
onPointerMove: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerMove, (event)=>{
|
|
1395
811
|
if (disabled) {
|
|
1396
812
|
var _contentContext$onIte;
|
|
1397
813
|
(_contentContext$onIte = contentContext.onItemLeave) === null || _contentContext$onIte === void 0 || _contentContext$onIte.call(contentContext);
|
|
@@ -1401,13 +817,13 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React.forwardRef
|
|
|
1401
817
|
preventScroll: true
|
|
1402
818
|
});
|
|
1403
819
|
}),
|
|
1404
|
-
onPointerLeave:
|
|
820
|
+
onPointerLeave: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerLeave, (event)=>{
|
|
1405
821
|
if (event.currentTarget === document.activeElement) {
|
|
1406
822
|
var _contentContext$onIte2;
|
|
1407
823
|
(_contentContext$onIte2 = contentContext.onItemLeave) === null || _contentContext$onIte2 === void 0 || _contentContext$onIte2.call(contentContext);
|
|
1408
824
|
}
|
|
1409
825
|
}),
|
|
1410
|
-
onKeyDown:
|
|
826
|
+
onKeyDown: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onKeyDown, (event)=>{
|
|
1411
827
|
var _contentContext$searc;
|
|
1412
828
|
const isTypingAhead = ((_contentContext$searc = contentContext.searchRef) === null || _contentContext$searc === void 0 ? void 0 : _contentContext$searc.current) !== '';
|
|
1413
829
|
if (isTypingAhead && event.key === ' ') return;
|
|
@@ -1427,7 +843,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React.forwardRef
|
|
|
1427
843
|
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
1428
844
|
const nativeOptionsContext = $cc7e05a45900e73f$var$useSelectNativeOptionsContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
1429
845
|
const [itemTextNode, setItemTextNode] = React.useState(null);
|
|
1430
|
-
const composedRefs =
|
|
846
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setItemTextNode(node)
|
|
1431
847
|
, itemContext.onItemTextChange, (node)=>{
|
|
1432
848
|
var _contentContext$itemT;
|
|
1433
849
|
return (_contentContext$itemT = contentContext.itemTextRefCallback) === null || _contentContext$itemT === void 0 ? void 0 : _contentContext$itemT.call(contentContext, node, itemContext.value, itemContext.disabled);
|
|
@@ -1444,7 +860,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React.forwardRef
|
|
|
1444
860
|
textContent
|
|
1445
861
|
]);
|
|
1446
862
|
const { onNativeOptionAdd: onNativeOptionAdd , onNativeOptionRemove: onNativeOptionRemove } = nativeOptionsContext;
|
|
1447
|
-
|
|
863
|
+
index$1.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1448
864
|
onNativeOptionAdd(nativeOption);
|
|
1449
865
|
return ()=>onNativeOptionRemove(nativeOption)
|
|
1450
866
|
;
|
|
@@ -1453,11 +869,11 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React.forwardRef
|
|
|
1453
869
|
onNativeOptionRemove,
|
|
1454
870
|
nativeOption
|
|
1455
871
|
]);
|
|
1456
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(
|
|
872
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index$1._extends({
|
|
1457
873
|
id: itemContext.textId
|
|
1458
874
|
}, itemTextProps, {
|
|
1459
875
|
ref: composedRefs
|
|
1460
|
-
})), itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? /*#__PURE__*/
|
|
876
|
+
})), itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? /*#__PURE__*/ ReactDOM.createPortal(itemTextProps.children, context.valueNode) : null);
|
|
1461
877
|
});
|
|
1462
878
|
/* -------------------------------------------------------------------------------------------------
|
|
1463
879
|
* SelectItemIndicator
|
|
@@ -1465,7 +881,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React.forwardRef
|
|
|
1465
881
|
const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
1466
882
|
const { __scopeSelect: __scopeSelect , ...itemIndicatorProps } = props;
|
|
1467
883
|
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_INDICATOR_NAME, __scopeSelect);
|
|
1468
|
-
return itemContext.isSelected ? /*#__PURE__*/ React.createElement(
|
|
884
|
+
return itemContext.isSelected ? /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index$1._extends({
|
|
1469
885
|
"aria-hidden": true
|
|
1470
886
|
}, itemIndicatorProps, {
|
|
1471
887
|
ref: forwardedRef
|
|
@@ -1476,9 +892,10 @@ const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ React.forwardRef
|
|
|
1476
892
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME = 'SelectScrollUpButton';
|
|
1477
893
|
const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
1478
894
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
895
|
+
const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
1479
896
|
const [canScrollUp1, setCanScrollUp] = React.useState(false);
|
|
1480
|
-
const composedRefs =
|
|
1481
|
-
|
|
897
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, viewportContext.onScrollButtonChange);
|
|
898
|
+
index$1.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1482
899
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
1483
900
|
const viewport = contentContext.viewport;
|
|
1484
901
|
function handleScroll() {
|
|
@@ -1494,7 +911,7 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React.forwardRef
|
|
|
1494
911
|
contentContext.viewport,
|
|
1495
912
|
contentContext.isPositioned
|
|
1496
913
|
]);
|
|
1497
|
-
return canScrollUp1 ? /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl,
|
|
914
|
+
return canScrollUp1 ? /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, index$1._extends({}, props, {
|
|
1498
915
|
ref: composedRefs,
|
|
1499
916
|
onAutoScroll: ()=>{
|
|
1500
917
|
const { viewport: viewport , selectedItem: selectedItem } = contentContext;
|
|
@@ -1507,9 +924,10 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React.forwardRef
|
|
|
1507
924
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME = 'SelectScrollDownButton';
|
|
1508
925
|
const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
1509
926
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
927
|
+
const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
1510
928
|
const [canScrollDown1, setCanScrollDown] = React.useState(false);
|
|
1511
|
-
const composedRefs =
|
|
1512
|
-
|
|
929
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, viewportContext.onScrollButtonChange);
|
|
930
|
+
index$1.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1513
931
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
1514
932
|
const viewport = contentContext.viewport;
|
|
1515
933
|
function handleScroll() {
|
|
@@ -1527,7 +945,7 @@ const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React.forwardRef(
|
|
|
1527
945
|
contentContext.viewport,
|
|
1528
946
|
contentContext.isPositioned
|
|
1529
947
|
]);
|
|
1530
|
-
return canScrollDown1 ? /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl,
|
|
948
|
+
return canScrollDown1 ? /*#__PURE__*/ React.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, index$1._extends({}, props, {
|
|
1531
949
|
ref: composedRefs,
|
|
1532
950
|
onAutoScroll: ()=>{
|
|
1533
951
|
const { viewport: viewport , selectedItem: selectedItem } = contentContext;
|
|
@@ -1555,7 +973,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
1555
973
|
// Because it is part of the normal flow, it will push down (top button) or shrink (bottom button)
|
|
1556
974
|
// the viewport, potentially causing the active item to now be partially out of view.
|
|
1557
975
|
// We re-run the `scrollIntoView` logic to make sure it stays within the viewport.
|
|
1558
|
-
|
|
976
|
+
index$1.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1559
977
|
var _activeItem$ref$curre;
|
|
1560
978
|
const activeItem = getItems().find((item)=>item.ref.current === document.activeElement
|
|
1561
979
|
);
|
|
@@ -1565,7 +983,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
1565
983
|
}, [
|
|
1566
984
|
getItems
|
|
1567
985
|
]);
|
|
1568
|
-
return /*#__PURE__*/ React.createElement(
|
|
986
|
+
return /*#__PURE__*/ React.createElement(index$1.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index$1._extends({
|
|
1569
987
|
"aria-hidden": true
|
|
1570
988
|
}, scrollIndicatorProps, {
|
|
1571
989
|
ref: forwardedRef,
|
|
@@ -1573,21 +991,27 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
1573
991
|
flexShrink: 0,
|
|
1574
992
|
...scrollIndicatorProps.style
|
|
1575
993
|
},
|
|
1576
|
-
|
|
994
|
+
onPointerDown: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerDown, ()=>{
|
|
995
|
+
if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
996
|
+
}),
|
|
997
|
+
onPointerMove: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerMove, ()=>{
|
|
1577
998
|
var _contentContext$onIte3;
|
|
1578
999
|
(_contentContext$onIte3 = contentContext.onItemLeave) === null || _contentContext$onIte3 === void 0 || _contentContext$onIte3.call(contentContext);
|
|
1579
1000
|
if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
1580
1001
|
}),
|
|
1581
|
-
onPointerLeave:
|
|
1002
|
+
onPointerLeave: index$1.$e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerLeave, ()=>{
|
|
1582
1003
|
clearAutoScrollTimer();
|
|
1583
1004
|
})
|
|
1584
1005
|
}));
|
|
1585
1006
|
});
|
|
1586
|
-
/* -----------------------------------------------------------------------------------------------*/
|
|
1007
|
+
/* -----------------------------------------------------------------------------------------------*/ function $cc7e05a45900e73f$var$shouldShowPlaceholder(value) {
|
|
1008
|
+
return value === '' || value === undefined;
|
|
1009
|
+
}
|
|
1010
|
+
const $cc7e05a45900e73f$var$BubbleSelect = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
1587
1011
|
const { value: value , ...selectProps } = props;
|
|
1588
1012
|
const ref = React.useRef(null);
|
|
1589
|
-
const composedRefs =
|
|
1590
|
-
const prevValue =
|
|
1013
|
+
const composedRefs = index$1.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
1014
|
+
const prevValue = index$4.$010c2913dbd2fe3d$export$5cae361ad82dce8b(value); // Bubble value change to parents (e.g form change event)
|
|
1591
1015
|
React.useEffect(()=>{
|
|
1592
1016
|
const select = ref.current;
|
|
1593
1017
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
@@ -1615,16 +1039,16 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React.forward
|
|
|
1615
1039
|
*
|
|
1616
1040
|
* We use `VisuallyHidden` rather than `display: "none"` because Safari autofill
|
|
1617
1041
|
* won't work otherwise.
|
|
1618
|
-
*/ return /*#__PURE__*/ React.createElement($ea1ef594cf570d83$export$439d29a4e110a164, {
|
|
1042
|
+
*/ return /*#__PURE__*/ React.createElement(index$5.$ea1ef594cf570d83$export$439d29a4e110a164, {
|
|
1619
1043
|
asChild: true
|
|
1620
|
-
}, /*#__PURE__*/ React.createElement("select",
|
|
1044
|
+
}, /*#__PURE__*/ React.createElement("select", index$1._extends({}, selectProps, {
|
|
1621
1045
|
ref: composedRefs,
|
|
1622
1046
|
defaultValue: value
|
|
1623
1047
|
})));
|
|
1624
1048
|
});
|
|
1625
1049
|
$cc7e05a45900e73f$var$BubbleSelect.displayName = 'BubbleSelect';
|
|
1626
1050
|
function $cc7e05a45900e73f$var$useTypeaheadSearch(onSearchChange) {
|
|
1627
|
-
const handleSearchChange =
|
|
1051
|
+
const handleSearchChange = index$1.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onSearchChange);
|
|
1628
1052
|
const searchRef = React.useRef('');
|
|
1629
1053
|
const timerRef = React.useRef(0);
|
|
1630
1054
|
const handleTypeaheadSearch = React.useCallback((key)=>{
|
|
@@ -1705,14 +1129,16 @@ const $cc7e05a45900e73f$export$bf1aedc3039c8d63 = $cc7e05a45900e73f$export$ff951
|
|
|
1705
1129
|
/** Use `Select` to choose from a dropdown list of options. */
|
|
1706
1130
|
var Select = function (_a) {
|
|
1707
1131
|
var _b;
|
|
1708
|
-
var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, _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, name = _a.name, 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 =
|
|
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 = index$6.__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"]);
|
|
1709
1133
|
var id = React.useId();
|
|
1710
|
-
var
|
|
1134
|
+
var _e = component.useThemeElement(), themeElement = _e[0], setThemeElement = _e[1];
|
|
1711
1135
|
var surface = React.useContext(Surface.Context).surface;
|
|
1712
|
-
var
|
|
1136
|
+
var _f = React.useState(defaultValue), uncontrolledValue = _f[0], setUncontrolledValue = _f[1];
|
|
1137
|
+
var isControlled = typeof value !== "undefined";
|
|
1138
|
+
var selectValue = isControlled ? value : uncontrolledValue;
|
|
1713
1139
|
var onValueChange = function (value) {
|
|
1714
1140
|
onChange && onChange(value);
|
|
1715
|
-
|
|
1141
|
+
setUncontrolledValue(value);
|
|
1716
1142
|
};
|
|
1717
1143
|
var getSelectedValueName = function (value) {
|
|
1718
1144
|
var _a;
|
|
@@ -1728,35 +1154,36 @@ var Select = function (_a) {
|
|
|
1728
1154
|
return 20;
|
|
1729
1155
|
}
|
|
1730
1156
|
};
|
|
1731
|
-
return (React__default["default"].createElement(FormControl.FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", isDisabled: isDisabled, disclosureText: disclosureText, disclosureTitle: disclosureTitle, onClickDisclosure: onClickDisclosure },
|
|
1732
|
-
React__default["default"].createElement($cc7e05a45900e73f$export$be92b6f5f03c0fe9, { name: name, required: isRequired, disabled: isDisabled, defaultOpen: isDefaultOpen, value:
|
|
1733
|
-
React__default["default"].createElement(
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
React__default["default"].createElement(
|
|
1743
|
-
|
|
1744
|
-
React__default["default"].createElement($cc7e05a45900e73f$export$
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
React__default["default"].createElement(
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
React__default["default"].createElement(
|
|
1753
|
-
React__default["default"].createElement(
|
|
1754
|
-
React__default["default"].createElement(
|
|
1755
|
-
|
|
1756
|
-
React__default["default"].createElement(
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
React__default["default"].createElement(
|
|
1157
|
+
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
|
+
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
|
+
React__default["default"].createElement("div", { ref: setThemeElement, className: "arc-Select-wrapper" },
|
|
1160
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$41fb9f06171c75f4, index$6.__assign({ id: id, name: name, onBlur: onBlur, "aria-label": ariaLabel, style: { width: width }, className: index$7.classNames("arc-Select-trigger", (_b = {
|
|
1161
|
+
"arc-Select-trigger--constrained": !isFluid,
|
|
1162
|
+
"arc-Select-trigger--onDarkSurface": surface === "dark",
|
|
1163
|
+
"arc-Select-trigger--invalid": errorMessage
|
|
1164
|
+
},
|
|
1165
|
+
_b["arc-Select-trigger--size".concat(selectSize && selectSize.toUpperCase())] = selectSize && selectSize !== "m",
|
|
1166
|
+
_b)), "aria-describedby": "".concat(id, "-helper") }, index$6.filterDataAttrs(props)),
|
|
1167
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$4c8d1a57a761ef94, { className: "arc-Select-triggerText", placeholder: placeholder, "aria-label": getSelectedValueName(uncontrolledValue) }),
|
|
1168
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$f04a61298a47a40f, { className: "arc-Select-triggerIcon" },
|
|
1169
|
+
React__default["default"].createElement(ThemeIcon.ThemeIcon, { size: getIconSize(selectSize), icon: "selectTrigger" }))),
|
|
1170
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$602eac185826482c, { container: themeElement },
|
|
1171
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$7c6e2c02157bb7d2, { sideOffset: 5, position: "popper", className: index$7.classNames("arc-Select-content", {
|
|
1172
|
+
"arc-Select-content--onDarkSurface": surface === "dark"
|
|
1173
|
+
}) },
|
|
1174
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$2f60d3ec9ad468f2, { className: "arc-Select-scrollButton" },
|
|
1175
|
+
React__default["default"].createElement(ThemeIcon.ThemeIcon, { size: 16, icon: "selectScrollUp" })),
|
|
1176
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$d5c6c08dc2d3ca7, null, options.map(function (_a, i) {
|
|
1177
|
+
var name = _a.name, value = _a.value;
|
|
1178
|
+
return (React__default["default"].createElement($cc7e05a45900e73f$export$6d08773d2e66f8f2, { className: "arc-Select-item", key: "select-item-".concat(i), value: value },
|
|
1179
|
+
React__default["default"].createElement("div", { className: "arc-Select-itemTextWrapper" },
|
|
1180
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$d6e5bf9c43ea9319, { asChild: true },
|
|
1181
|
+
React__default["default"].createElement("span", { className: "arc-Select-itemText" }, name))),
|
|
1182
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$c3468e2714d175fa, null,
|
|
1183
|
+
React__default["default"].createElement(ThemeIcon.ThemeIcon, { size: 20, icon: "selectIndicator" }))));
|
|
1184
|
+
})),
|
|
1185
|
+
React__default["default"].createElement($cc7e05a45900e73f$export$bf1aedc3039c8d63, { className: "arc-Select-scrollButton" },
|
|
1186
|
+
React__default["default"].createElement(ThemeIcon.ThemeIcon, { size: 16, icon: "selectScrollDown" }))))))));
|
|
1760
1187
|
};
|
|
1761
1188
|
|
|
1762
1189
|
exports.Select = Select;
|