twenty-ui 2.49.0 → 2.51.1
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/CHANGELOG.md +23 -0
- package/README.md +36 -32
- package/dist/{AllIcons-Cyd7721G.cjs → AllIcons-1tBWXXrE.cjs} +1 -1
- package/dist/{AllIcons-D132B8_i.js → AllIcons-ayl8BCtV.js} +1 -1
- package/dist/Button-CU8BS-Yd.js +75 -0
- package/dist/Button-iVyxlrwO.cjs +1 -0
- package/dist/Dropdown-D_hFndP5.cjs +1 -0
- package/dist/Dropdown-xXsGBv57.js +1056 -0
- package/dist/Heading-CHvEXL6n.cjs +1 -0
- package/dist/{Heading-pXllCJCO.js → Heading-Nj5BlPqB.js} +3 -3
- package/dist/Input-D1sIHUZ5.js +25 -0
- package/dist/Input-D69M4UwD.cjs +1 -0
- package/dist/ListItem-B-SFWJZb.cjs +1 -0
- package/dist/ListItem-WLONJMo5.js +91 -0
- package/dist/ListItem.module-B31VK9XZ.js +34 -0
- package/dist/ListItem.module-DiUK6-0Z.cjs +1 -0
- package/dist/OverflowingTextWithTooltip-ClpPsdpP.cjs +1 -0
- package/dist/OverflowingTextWithTooltip-D4eZc-7P.js +96 -0
- package/dist/ProgressBar-8pjpGrmZ.js +99 -0
- package/dist/ProgressBar-goqxS9NE.cjs +1 -0
- package/dist/Radio-CpQPRHXa.cjs +1 -0
- package/dist/Radio-VTjpEz8M.js +175 -0
- package/dist/Skeleton-BbIF780H.js +31 -0
- package/dist/Skeleton-tXeIy4qq.cjs +1 -0
- package/dist/TablerIcons-B-5Ua_Ne.js +460 -0
- package/dist/TabsTabContent-6rkARU9F.cjs +1 -0
- package/dist/TabsTabContent-DPkLTBi2.js +39 -0
- package/dist/Tooltip-08dDawT_.cjs +1 -0
- package/dist/Tooltip-C7zc16gI.js +132 -0
- package/dist/components/data-display/DetailsRow/DetailsRow.d.ts +2 -0
- package/dist/components/data-display/DetailsRow/types/DetailsRowProps.d.ts +9 -0
- package/dist/components/data-display/index.d.ts +2 -0
- package/dist/components/data-display.cjs +1 -1
- package/dist/components/data-display.mjs +9 -9
- package/dist/components/feedback/InlineBanner/InlineBanner.d.ts +2 -2
- package/dist/components/feedback/InlineBanner/internal/InlineBannerComponent.d.ts +1 -1
- package/dist/components/feedback/InlineBanner/types/InlineBannerProps.d.ts +2 -1
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.mjs +1 -1
- package/dist/components/input/DatePicker/DatePicker.d.ts +2 -0
- package/dist/components/input/DatePicker/__stories__/DatePickerCssVariableThemeExample.d.ts +1 -0
- package/dist/components/input/DatePicker/__stories__/DatePickerExample.d.ts +5 -0
- package/dist/components/input/DatePicker/__stories__/DatePickerExternalMonthExample.d.ts +4 -0
- package/dist/components/input/DatePicker/__stories__/DatePickerNavigationUnmountExample.d.ts +2 -0
- package/dist/components/input/DatePicker/__stories__/datePickerWeekdayLabels.d.ts +1 -0
- package/dist/components/input/DatePicker/internal/DatePickerException.d.ts +5 -0
- package/dist/components/input/DatePicker/internal/DatePickerHeader.d.ts +3 -0
- package/dist/components/input/DatePicker/internal/DatePickerSelect.d.ts +15 -0
- package/dist/components/input/DatePicker/internal/DatePickerSelectLifecycleEffect.d.ts +7 -0
- package/dist/components/input/DatePicker/internal/DatePickerViewedMonthEffect.d.ts +9 -0
- package/dist/components/input/DatePicker/internal/ReactDatePickerLibrary.d.ts +2 -0
- package/dist/components/input/DatePicker/internal/datePickerConstants.d.ts +6 -0
- package/dist/components/input/DatePicker/internal/formatDatePickerLocalDate.d.ts +1 -0
- package/dist/components/input/DatePicker/internal/parseDatePickerDateOrThrow.d.ts +1 -0
- package/dist/components/input/DatePicker/internal/parseDatePickerLocalDateOrThrow.d.ts +1 -0
- package/dist/components/input/DatePicker/internal/validateDatePickerHighlightedRangeOrThrow.d.ts +4 -0
- package/dist/components/input/DatePicker/types/DatePickerHeaderProps.d.ts +9 -0
- package/dist/components/input/DatePicker/types/DatePickerProps.d.ts +42 -0
- package/dist/components/input/EmojiPicker/EmojiPicker.d.ts +2 -0
- package/dist/components/input/EmojiPicker/__stories__/EmojiPickerExample.d.ts +4 -0
- package/dist/components/input/EmojiPicker/__stories__/emojiPickerStoryData.d.ts +30 -0
- package/dist/components/input/EmojiPicker/__stories__/emojiPickerStoryEmojibaseUrl.d.ts +1 -0
- package/dist/components/input/EmojiPicker/__stories__/mockEmojiPickerStoryData.d.ts +5 -0
- package/dist/components/input/EmojiPicker/internal/EmojiPickerEmoji.d.ts +2 -0
- package/dist/components/input/EmojiPicker/internal/EmojiPickerRow.d.ts +2 -0
- package/dist/components/input/EmojiPicker/internal/EmojiPickerScrollEffect.d.ts +6 -0
- package/dist/components/input/EmojiPicker/internal/scrollActiveEmojiIntoView.d.ts +1 -0
- package/dist/components/input/EmojiPicker/types/EmojiPickerProps.d.ts +11 -0
- package/dist/components/input/FormFieldRow/FormFieldRow.d.ts +2 -0
- package/dist/components/input/FormFieldRow/types/FormFieldRowProps.d.ts +12 -0
- package/dist/components/input/ReactionButton/ReactionButton.d.ts +2 -0
- package/dist/components/input/ReactionButton/__stories__/ReactionButtonExample.d.ts +2 -0
- package/dist/components/input/ReactionButton/types/ReactionButtonProps.d.ts +14 -0
- package/dist/components/input/SearchInput/SearchInput.d.ts +1 -1
- package/dist/components/input/SearchInput/types/SearchInputProps.d.ts +1 -1
- package/dist/components/input/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/components/input/SegmentedControl/types/SegmentedControlProps.d.ts +3 -1
- package/dist/components/input/SegmentedControl/types/SegmentedControlVariant.d.ts +1 -0
- package/dist/components/input/index.d.ts +10 -0
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.mjs +17 -13
- package/dist/components/layout/LabeledSeparator/LabeledSeparator.d.ts +2 -0
- package/dist/components/layout/LabeledSeparator/types/LabeledSeparatorProps.d.ts +7 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.mjs +5 -4
- package/dist/components/navigation/CountPager/CountPager.d.ts +2 -0
- package/dist/components/navigation/CountPager/__stories__/CountPagerCollectionExample.d.ts +3 -0
- package/dist/components/navigation/CountPager/__stories__/CountPagerExample.d.ts +2 -0
- package/dist/components/navigation/CountPager/types/CountPagerProps.d.ts +11 -0
- package/dist/components/navigation/Dropdown/Dropdown.d.ts +4 -4
- package/dist/components/navigation/Dropdown/__stories__/DropdownControlledPageSessionExample.d.ts +1 -0
- package/dist/components/navigation/Dropdown/__stories__/DropdownNestedPageSessionExample.d.ts +6 -0
- package/dist/components/navigation/Dropdown/__stories__/DropdownPageActivityExample.d.ts +1 -0
- package/dist/components/navigation/Dropdown/__stories__/DropdownPageSessionExample.d.ts +5 -0
- package/dist/components/navigation/Dropdown/__stories__/DropdownPickerPageSessionExample.d.ts +1 -0
- package/dist/components/navigation/Dropdown/hooks/useDropdownPage.d.ts +1 -0
- package/dist/components/navigation/Dropdown/internal/DropdownContent.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownContextValue.d.ts +3 -0
- package/dist/components/navigation/Dropdown/internal/DropdownEmpty.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownLoading.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownPageEffect.d.ts +8 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSearch.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownSearchEffect.d.ts +8 -0
- package/dist/components/navigation/Dropdown/internal/isActiveDropdownElement.d.ts +1 -0
- package/dist/components/navigation/Dropdown/types/DropdownSearchProps.d.ts +1 -1
- package/dist/components/navigation/ListItemButton/ListItemButton.d.ts +1 -1
- package/dist/components/navigation/ListItemButton/types/ListItemButtonProps.d.ts +1 -1
- package/dist/components/navigation/index.d.ts +2 -11
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.mjs +7 -11
- package/dist/components/settings.cjs +1 -1
- package/dist/components/settings.mjs +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.mjs +42 -41
- package/dist/data-display-DUMj_z1t.js +252 -0
- package/dist/data-display-D_kbXJJd.cjs +2 -0
- package/dist/data-display-DzHM5j7j.cjs +1 -0
- package/dist/data-display-b-9s0RTe.js +422 -0
- package/dist/feedback-B50I0C35.cjs +1 -0
- package/dist/feedback-BQFSnMjh.js +10 -0
- package/dist/feedback-BzR4ggrP.cjs +1 -0
- package/dist/{feedback-DTyVVcTb.js → feedback-EaZszoXf.js} +225 -224
- package/dist/icon/components/TablerIcons.d.ts +1 -1
- package/dist/icon/constants/TwentyIconDictionary.d.ts +9 -0
- package/dist/icon/index.d.ts +1 -1
- package/dist/{icon-CUE-QGQK.js → icon-ICz2_dVB.js} +550 -944
- package/dist/icon-TSBamkxk.cjs +1 -0
- package/dist/icon.cjs +1 -1
- package/dist/icon.mjs +510 -504
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +666 -658
- package/dist/input-BQABEELu.cjs +1 -0
- package/dist/input-CuySKbhm.js +2356 -0
- package/dist/input-DxoXgI5-.js +373 -0
- package/dist/input-ExCbk62Y.cjs +1 -0
- package/dist/layout-B1Iwc9ku.cjs +1 -0
- package/dist/layout-B2KvJ900.js +479 -0
- package/dist/{navigation-CIVYqPc5.js → navigation-BY8X2w04.js} +31 -31
- package/dist/navigation-ByYN6NgX.cjs +1 -0
- package/dist/navigation-DP5Edsq_.cjs +1 -0
- package/dist/navigation-DXMjQMPm.js +134 -0
- package/dist/normalizeSearchText-DLmPiBUZ.js +19 -0
- package/dist/normalizeSearchText-Do0MELpQ.cjs +1 -0
- package/dist/preventDismissingClickActivation-BEBrL9aB.cjs +1 -0
- package/dist/preventDismissingClickActivation-BQFMKRey.js +29 -0
- package/dist/primitives/accessibility.cjs +1 -1
- package/dist/primitives/accessibility.mjs +1 -1
- package/dist/primitives/data-display/Avatar/constants/AvatarPropertiesBySize.d.ts +4 -0
- package/dist/primitives/data-display/Avatar/types/AvatarSize.d.ts +1 -1
- package/dist/primitives/data-display/Badge/types/BadgeColor.d.ts +1 -1
- package/dist/primitives/data-display/Chip/types/ChipVariant.d.ts +1 -1
- package/dist/primitives/data-display.cjs +1 -1
- package/dist/primitives/data-display.mjs +7 -8
- package/dist/primitives/feedback/Banner/Banner.d.ts +2 -2
- package/dist/primitives/feedback/Banner/internal/BannerAction.d.ts +1 -1
- package/dist/primitives/feedback/Banner/internal/BannerComponent.d.ts +1 -1
- package/dist/primitives/feedback/Banner/types/BannerProps.d.ts +2 -0
- package/dist/primitives/feedback.cjs +1 -1
- package/dist/primitives/feedback.mjs +9 -8
- package/dist/primitives/input/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/primitives/input/Autocomplete/internal/AutocompleteInput.d.ts +1 -1
- package/dist/primitives/input/Autocomplete/types/AutocompleteInputProps.d.ts +8 -1
- package/dist/primitives/input/Autocomplete/types/AutocompleteItemProps.d.ts +3 -1
- package/dist/primitives/input/Button/types/ButtonColor.d.ts +1 -1
- package/dist/primitives/input/Input/Input.d.ts +1 -1
- package/dist/primitives/input/Input/types/InputProps.d.ts +3 -0
- package/dist/primitives/input/InputGroup/InputGroup.d.ts +1 -1
- package/dist/primitives/input/InputGroup/types/InputGroupProps.d.ts +1 -0
- package/dist/primitives/input/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/primitives/input/RadioGroup/types/RadioGroupProps.d.ts +3 -1
- package/dist/primitives/input/Textarea/Textarea.d.ts +1 -1
- package/dist/primitives/input/Textarea/internal/TextareaAutoResizeEffect.d.ts +8 -0
- package/dist/primitives/input/Textarea/types/TextareaProps.d.ts +2 -0
- package/dist/primitives/input/index.d.ts +1 -0
- package/dist/primitives/input/types/InputVariant.d.ts +1 -0
- package/dist/primitives/input.cjs +1 -1
- package/dist/primitives/input.mjs +15 -15
- package/dist/primitives/navigation/ListItem/ListItem.d.ts +1 -1
- package/dist/primitives/navigation/ListItem/__stories__/ListItemMultilineExample.d.ts +7 -0
- package/dist/primitives/navigation/ListItem/types/ListItemDescriptionPlacement.d.ts +1 -1
- package/dist/primitives/navigation/ListItem/types/ListItemProps.d.ts +3 -0
- package/dist/primitives/navigation/ListItem/types/ListItemState.d.ts +1 -0
- package/dist/primitives/navigation/Tabs/types/TabsSize.d.ts +1 -1
- package/dist/primitives/navigation.cjs +1 -1
- package/dist/primitives/navigation.mjs +2 -2
- package/dist/primitives/surfaces/Card/Card.d.ts +3 -1
- package/dist/primitives/surfaces/Card/internal/CardAction.d.ts +2 -0
- package/dist/primitives/surfaces/Card/internal/CardControl.d.ts +2 -0
- package/dist/primitives/surfaces/Card/internal/CardRoot.d.ts +1 -1
- package/dist/primitives/surfaces/Card/types/CardActionProps.d.ts +2 -0
- package/dist/primitives/surfaces/Card/types/CardControlProps.d.ts +2 -0
- package/dist/primitives/surfaces/Card/types/CardRootProps.d.ts +0 -1
- package/dist/primitives/surfaces/Tooltip/Tooltip.d.ts +1 -0
- package/dist/primitives/surfaces/Tooltip/__stories__/findTooltip.d.ts +1 -0
- package/dist/primitives/surfaces/Tooltip/internal/TooltipBody.d.ts +2 -8
- package/dist/primitives/surfaces/Tooltip/types/TooltipBodyProps.d.ts +6 -0
- package/dist/primitives/surfaces/index.d.ts +3 -0
- package/dist/primitives/surfaces.cjs +1 -1
- package/dist/primitives/surfaces.mjs +2 -2
- package/dist/primitives/typography/Heading/types/HeadingProps.d.ts +4 -2
- package/dist/primitives/typography/OverflowingTextWithTooltip/types/OverflowingTextWithTooltipProps.d.ts +2 -1
- package/dist/primitives/typography/Text/Text.d.ts +1 -1
- package/dist/primitives/typography/Text/internal/TextTypographyProps.d.ts +7 -0
- package/dist/primitives/typography/Text/types/TextProps.d.ts +2 -1
- package/dist/primitives/typography/internal/TypographyColor.d.ts +2 -0
- package/dist/primitives/typography/internal/TypographyFontSize.d.ts +2 -0
- package/dist/primitives/typography.cjs +1 -1
- package/dist/primitives/typography.mjs +3 -3
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.mjs +40 -40
- package/dist/{settings-BgVuLpg9.js → settings-BTFAqYrD.js} +1 -1
- package/dist/{settings-CPXhrmbK.cjs → settings-D_iT1ngl.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/surfaces-DtZwsfms.cjs +1 -0
- package/dist/surfaces-v0kQLZYO.js +224 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/utils/waitForStorybookFontsLoaded.d.ts +1 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.mjs +87 -77
- package/dist/{typography-bKeSMuJd.cjs → typography-B05olPwL.cjs} +1 -1
- package/dist/{typography-DT2eKLvd.js → typography-BwyZEDDi.js} +1 -1
- package/dist/utilities/color/utils/themeColorSchema.d.ts +15 -15
- package/dist/utilities.cjs +1 -1
- package/dist/utilities.mjs +11 -10
- package/package.json +3 -1
- package/dist/Avatar-C6WxBgjS.cjs +0 -1
- package/dist/Avatar-ifVlxbx_.js +0 -73
- package/dist/Button-DIw804CX.js +0 -72
- package/dist/Button-DTm1WDzp.cjs +0 -1
- package/dist/Dropdown-1OAJvS1f.js +0 -1000
- package/dist/Dropdown-Bl4OXCf9.cjs +0 -1
- package/dist/Heading-CTRYClCO.cjs +0 -1
- package/dist/Input-DZWl81G_.js +0 -23
- package/dist/Input-DvL77rvu.cjs +0 -1
- package/dist/ListItem-DizNUBT8.js +0 -86
- package/dist/ListItem-DwBb-I1D.cjs +0 -1
- package/dist/ListItem.module-BJ9Ttjrc.js +0 -34
- package/dist/ListItem.module-CO4u2oeF.cjs +0 -1
- package/dist/OverflowingTextWithTooltip-BmUROIah.js +0 -90
- package/dist/OverflowingTextWithTooltip-Z2daM0_x.cjs +0 -1
- package/dist/ProgressBar-B3xACTV2.js +0 -84
- package/dist/ProgressBar-OpSMnDBz.cjs +0 -1
- package/dist/Radio-BEAztmPu.js +0 -103
- package/dist/Radio-Dx6b4SYZ.cjs +0 -1
- package/dist/TabsTabContent-Co27Y2TU.cjs +0 -1
- package/dist/TabsTabContent-DVcObDp6.js +0 -39
- package/dist/TintedIconTile-B1XDtGrF.js +0 -40
- package/dist/TintedIconTile-DO1XJXCQ.cjs +0 -1
- package/dist/Tooltip-Bg9Uk01p.cjs +0 -1
- package/dist/Tooltip-cLCgtFBF.js +0 -124
- package/dist/components/navigation/MenuItem/MenuItem.d.ts +0 -2
- package/dist/components/navigation/MenuItem/parts/MenuItemIcon.d.ts +0 -9
- package/dist/components/navigation/MenuItem/parts/MenuItemIconBoxContainer.d.ts +0 -7
- package/dist/components/navigation/MenuItem/parts/MenuItemIconWithGripSwap.d.ts +0 -8
- package/dist/components/navigation/MenuItem/parts/MenuItemLeftContent.d.ts +0 -19
- package/dist/components/navigation/MenuItem/parts/StyledMenuItemBase.d.ts +0 -25
- package/dist/components/navigation/MenuItem/types/MenuItemDraggableGripMode.d.ts +0 -1
- package/dist/components/navigation/MenuItem/types/MenuItemProps.d.ts +0 -33
- package/dist/components/navigation/MenuItemAvatar/MenuItemAvatar.d.ts +0 -2
- package/dist/components/navigation/MenuItemAvatar/types/MenuItemAvatarProps.d.ts +0 -18
- package/dist/components/navigation/MenuItemDraggable/MenuItemDraggable.d.ts +0 -2
- package/dist/components/navigation/MenuItemDraggable/types/MenuItemDraggableProps.d.ts +0 -20
- package/dist/components/navigation/MenuItemSuggestion/MenuItemSuggestion.d.ts +0 -2
- package/dist/components/navigation/MenuItemSuggestion/types/MenuItemSuggestionProps.d.ts +0 -12
- package/dist/components/navigation/MenuPicker/MenuPicker.d.ts +0 -2
- package/dist/components/navigation/MenuPicker/types/MenuPickerProps.d.ts +0 -15
- package/dist/data-display-BSKGlijb.cjs +0 -1
- package/dist/data-display-BtXCGOGw.js +0 -345
- package/dist/data-display-DtXIhJ4B.js +0 -184
- package/dist/data-display-XV3ht1rC.cjs +0 -2
- package/dist/feedback-Cs-38OH4.cjs +0 -1
- package/dist/feedback-DA-AU5z5.js +0 -38
- package/dist/feedback-DNLERYY9.cjs +0 -1
- package/dist/icon-BNcdwwdl.cjs +0 -1
- package/dist/input-B_rBplmn.cjs +0 -1
- package/dist/input-BrjD91wv.js +0 -785
- package/dist/input-ChlFcqIS.cjs +0 -1
- package/dist/input-D1oyk0tD.js +0 -421
- package/dist/layout-CthYckvl.cjs +0 -1
- package/dist/layout-DQcjBu08.js +0 -439
- package/dist/navigation-B6nka3bW.js +0 -400
- package/dist/navigation-CflGBYv-.cjs +0 -1
- package/dist/navigation-DoInK0Sp.cjs +0 -1
- package/dist/preventDismissingClickActivation-AaqHBLnW.js +0 -45
- package/dist/preventDismissingClickActivation-CIhWvKCu.cjs +0 -1
- package/dist/primitives/typography/internal/Label/Label.d.ts +0 -8
- package/dist/surfaces-0rL5DoHt.cjs +0 -1
- package/dist/surfaces-BLsR5ka0.js +0 -202
- /package/dist/{handleClickableElementKeyDown-C8Uz61XJ.js → accessibility-C8Uz61XJ.js} +0 -0
- /package/dist/{handleClickableElementKeyDown-CByqtBhO.cjs → accessibility-CByqtBhO.cjs} +0 -0
|
@@ -0,0 +1,2356 @@
|
|
|
1
|
+
import { t as S } from "./isDefined-fMi6eQ4r.js";
|
|
2
|
+
import { t as pe } from "./isRenderableSlot-DT_depzM.js";
|
|
3
|
+
import { Cc as xr, Da as Dr, Dt as tt, It as jt, Lo as Or, Ot as Ar, Xa as Hr, Xs as $r, ic as Mr, kt as Fr, so as Vr, xc as Lr } from "./TablerIcons-B-5Ua_Ne.js";
|
|
4
|
+
import { t as P } from "./doNotTranslate-BSVT8Xyd.js";
|
|
5
|
+
import { l as zr, r as kt } from "./theme-B2EaXhye.js";
|
|
6
|
+
import { t as he } from "./mergeClassNames-ClFMR1v0.js";
|
|
7
|
+
import { t as be } from "./normalizeSearchText-DLmPiBUZ.js";
|
|
8
|
+
import { r as Rt, t as oe } from "./Button-CU8BS-Yd.js";
|
|
9
|
+
import { r as Ur, t as rt } from "./OverflowingTextWithTooltip-D4eZc-7P.js";
|
|
10
|
+
import { t as Yr } from "./Separator-0LzwPfOn.js";
|
|
11
|
+
import { i as ct, n as qr, o as Ne, r as Br, t as N } from "./Dropdown-xXsGBv57.js";
|
|
12
|
+
import { n as Fe, t as Nt } from "./Input-D1sIHUZ5.js";
|
|
13
|
+
import { a as Be, i as Q, n as Gr, r as $e, t as Wr } from "./Radio-VTjpEz8M.js";
|
|
14
|
+
import { t as Kr } from "./Skeleton-BbIF780H.js";
|
|
15
|
+
import { useRender as Te } from "@base-ui/react/use-render";
|
|
16
|
+
import { isFunction as Ve, isNonEmptyArray as Pe, isNonEmptyString as L, isNull as Tt, isNumber as Pt, isString as Jr, isUndefined as Le } from "@sniptt/guards";
|
|
17
|
+
import { clsx as G } from "clsx";
|
|
18
|
+
import { Fragment as Xr, Suspense as Zr, createContext as Ye, createElement as Qr, forwardRef as xe, lazy as en, memo as De, useCallback as z, useContext as ye, useDebugValue as tn, useDeferredValue as rn, useEffect as te, useId as ae, useImperativeHandle as qe, useLayoutEffect as nn, useMemo as me, useRef as U, useState as K } from "react";
|
|
19
|
+
import { Fragment as Z, jsx as i, jsxs as I } from "react/jsx-runtime";
|
|
20
|
+
import { useMergedRefs as xt } from "@base-ui/utils/useMergedRefs";
|
|
21
|
+
import { useControlled as Dt } from "@base-ui/utils/useControlled";
|
|
22
|
+
import { useDirection as on } from "@base-ui/react/direction-provider";
|
|
23
|
+
import { useStableCallback as Ot } from "@base-ui/utils/useStableCallback";
|
|
24
|
+
import { useValueAsRef as an } from "@base-ui/utils/useValueAsRef";
|
|
25
|
+
import { formatNumber as ut } from "@base-ui/utils/formatNumber";
|
|
26
|
+
import { RadioGroup as ln } from "@base-ui/react/radio-group";
|
|
27
|
+
var At = Ye(void 0), sn = "country:", Ht = (e) => `${sn}${e}`, $t = ({ countries: e, value: t, defaultValue: r = null, onValueChange: n, disabled: a = !1, noCountryLabel: o = P("No country"), children: s }) => {
|
|
28
|
+
const c = ae(), [l, u] = Dt({
|
|
29
|
+
controlled: t,
|
|
30
|
+
default: r,
|
|
31
|
+
name: P("CountrySelect"),
|
|
32
|
+
state: "value"
|
|
33
|
+
}), h = me(() => e.map((m) => ({
|
|
34
|
+
...m,
|
|
35
|
+
selectionValue: Ht(m.value),
|
|
36
|
+
searchText: be(m.label)
|
|
37
|
+
})), [e]), d = me(() => new Map(h.map((m) => [m.value, m])), [h]), g = a || !Pe(h);
|
|
38
|
+
return /* @__PURE__ */ i(At.Provider, {
|
|
39
|
+
value: {
|
|
40
|
+
countries: h,
|
|
41
|
+
selectedCountry: Tt(l) ? void 0 : d.get(l),
|
|
42
|
+
value: l,
|
|
43
|
+
disabled: g,
|
|
44
|
+
noCountryLabel: o,
|
|
45
|
+
selectionGroupId: c,
|
|
46
|
+
changeValue: (m, p) => {
|
|
47
|
+
if (g) {
|
|
48
|
+
p.cancel();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
n?.(m, p), p.isCanceled || u(m);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
children: s
|
|
55
|
+
});
|
|
56
|
+
}, Mt = ({ disabled: e, open: t, onOpenChange: r }) => {
|
|
57
|
+
const n = Ot(r);
|
|
58
|
+
return te(() => {
|
|
59
|
+
!e || !t || n(!1);
|
|
60
|
+
}, [
|
|
61
|
+
e,
|
|
62
|
+
t,
|
|
63
|
+
n
|
|
64
|
+
]), null;
|
|
65
|
+
}, cn = "_root_1x3d7_1", un = "_label_1x3d7_6", dn = "_flag_1x3d7_14", je = {
|
|
66
|
+
root: cn,
|
|
67
|
+
label: un,
|
|
68
|
+
flag: dn
|
|
69
|
+
}, mn = ({ ariaLabelledBy: e, ariaLabel: t, visibleLabelId: r }) => {
|
|
70
|
+
if (L(e)) return e;
|
|
71
|
+
if (!L(t))
|
|
72
|
+
return r;
|
|
73
|
+
}, nt = () => {
|
|
74
|
+
const e = ye(At);
|
|
75
|
+
if (!S(e)) throw new Error(P("CountrySelect parts must be inside CountrySelect.Root"));
|
|
76
|
+
return e;
|
|
77
|
+
}, we = (e) => e.preventBaseUIHandler?.(), Ft = ({ label: e, wrapperProps: t, children: r, className: n, style: a, render: o, onClick: s, onMouseDown: c, onPointerDown: l, onKeyDown: u, onKeyUp: h, openOnHover: d, id: g, "aria-label": m, "aria-labelledby": p, "aria-describedby": b, ...y }) => {
|
|
78
|
+
const { selectedCountry: w, disabled: v, noCountryLabel: j } = nt(), { open: k, setOpen: C } = Ne(), f = ae(), E = g ?? f, _ = `${f}-label`, T = `${f}-value`, H = L(e), M = L(m) ? m : void 0, O = mn({
|
|
79
|
+
ariaLabelledBy: p,
|
|
80
|
+
ariaLabel: M,
|
|
81
|
+
visibleLabelId: H ? _ : void 0
|
|
82
|
+
}), $ = [b, (S(O) || S(M)) && !S(r) ? T : void 0].filter(L), x = w?.label ?? j, R = S(w) ? w.flag : /* @__PURE__ */ i(jt, {}), A = (Y) => ({
|
|
83
|
+
...Y,
|
|
84
|
+
disabled: v
|
|
85
|
+
}), re = he(G(Fe.input, Fe.md, Be.trigger), n);
|
|
86
|
+
return /* @__PURE__ */ I("div", {
|
|
87
|
+
...t,
|
|
88
|
+
className: G(je.root, t?.className),
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ i(Mt, {
|
|
91
|
+
disabled: v,
|
|
92
|
+
open: k,
|
|
93
|
+
onOpenChange: C
|
|
94
|
+
}),
|
|
95
|
+
H && /* @__PURE__ */ i("label", {
|
|
96
|
+
id: _,
|
|
97
|
+
className: je.label,
|
|
98
|
+
htmlFor: E,
|
|
99
|
+
children: e
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ i(N.Trigger, {
|
|
102
|
+
...y,
|
|
103
|
+
id: E,
|
|
104
|
+
"aria-label": M,
|
|
105
|
+
"aria-labelledby": O,
|
|
106
|
+
"aria-describedby": Pe($) ? $.join(" ") : void 0,
|
|
107
|
+
"aria-disabled": v || void 0,
|
|
108
|
+
openOnHover: v ? !1 : d,
|
|
109
|
+
"data-disabled": v ? "" : void 0,
|
|
110
|
+
onClick: v ? we : s,
|
|
111
|
+
onMouseDown: v ? we : c,
|
|
112
|
+
onPointerDown: v ? we : l,
|
|
113
|
+
onKeyDown: v ? we : u,
|
|
114
|
+
onKeyUp: v ? we : h,
|
|
115
|
+
className: (Y) => re(A(Y)),
|
|
116
|
+
style: Ve(a) ? (Y) => a(A(Y)) : a,
|
|
117
|
+
render: Ve(o) ? (Y, ge) => o(Y, A(ge)) : o,
|
|
118
|
+
children: r ?? /* @__PURE__ */ I(Z, { children: [
|
|
119
|
+
/* @__PURE__ */ i("span", {
|
|
120
|
+
className: je.flag,
|
|
121
|
+
"aria-hidden": "true",
|
|
122
|
+
children: R
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ i("span", {
|
|
125
|
+
className: Be.value,
|
|
126
|
+
id: T,
|
|
127
|
+
children: /* @__PURE__ */ i(rt, { text: x })
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ i("span", {
|
|
130
|
+
className: Be.icon,
|
|
131
|
+
"aria-hidden": "true",
|
|
132
|
+
children: /* @__PURE__ */ i(tt, {})
|
|
133
|
+
})
|
|
134
|
+
] })
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
});
|
|
138
|
+
}, hn = "no-country", gn = ({ searchLabel: e = P("Search"), noResultsLabel: t = P("No results"), searchProps: r, render: n, ...a }) => {
|
|
139
|
+
const { countries: o, value: s, changeValue: c, disabled: l, noCountryLabel: u, selectionGroupId: h } = nt(), { titleId: d, triggerId: g } = Ne(), m = S(a["aria-label"]) || S(a["aria-labelledby"]) ? void 0 : d ?? g, [p, b] = K(""), y = be(p.trim()), w = L(y), v = o.filter((f) => f.searchText.includes(y)), j = be(u).includes(y), k = j || Pe(v), C = j && /* @__PURE__ */ i(N.OptionItem, {
|
|
140
|
+
value: "no-country",
|
|
141
|
+
disabled: l,
|
|
142
|
+
startIcon: /* @__PURE__ */ i("span", {
|
|
143
|
+
className: je.flag,
|
|
144
|
+
"aria-hidden": "true",
|
|
145
|
+
children: /* @__PURE__ */ i(jt, {})
|
|
146
|
+
}),
|
|
147
|
+
children: u
|
|
148
|
+
});
|
|
149
|
+
return /* @__PURE__ */ I(Z, { children: [
|
|
150
|
+
/* @__PURE__ */ i(N.Search, {
|
|
151
|
+
placeholder: e,
|
|
152
|
+
"aria-label": e,
|
|
153
|
+
...r,
|
|
154
|
+
value: p,
|
|
155
|
+
onValueChange: b,
|
|
156
|
+
disabled: l || r?.disabled
|
|
157
|
+
}),
|
|
158
|
+
k && /* @__PURE__ */ i(N.Separator, {}),
|
|
159
|
+
/* @__PURE__ */ I(N.SelectionGroup, {
|
|
160
|
+
...a,
|
|
161
|
+
"aria-labelledby": a["aria-labelledby"] ?? m,
|
|
162
|
+
render: Ve(n) ? (f) => n(f, {
|
|
163
|
+
value: s,
|
|
164
|
+
multiple: !1
|
|
165
|
+
}) : n,
|
|
166
|
+
id: h,
|
|
167
|
+
value: Tt(s) ? hn : Ht(s),
|
|
168
|
+
onValueChange: (f, E) => {
|
|
169
|
+
c(o.find((_) => _.selectionValue === f)?.value ?? null, E);
|
|
170
|
+
},
|
|
171
|
+
children: [k && /* @__PURE__ */ I(N.Section, {
|
|
172
|
+
scrollable: !0,
|
|
173
|
+
children: [
|
|
174
|
+
!w && C,
|
|
175
|
+
v.map((f) => /* @__PURE__ */ i(N.OptionItem, {
|
|
176
|
+
value: f.selectionValue,
|
|
177
|
+
disabled: l || f.disabled,
|
|
178
|
+
startIcon: /* @__PURE__ */ i("span", {
|
|
179
|
+
className: je.flag,
|
|
180
|
+
"aria-hidden": "true",
|
|
181
|
+
children: f.flag
|
|
182
|
+
}),
|
|
183
|
+
children: f.label
|
|
184
|
+
}, f.value)),
|
|
185
|
+
w && C
|
|
186
|
+
]
|
|
187
|
+
}), !k && /* @__PURE__ */ i(N.Empty, { children: t })]
|
|
188
|
+
})
|
|
189
|
+
] });
|
|
190
|
+
}, Vt = (e) => {
|
|
191
|
+
const { open: t } = Ne(), [r, n] = K(t), [a, o] = K(0);
|
|
192
|
+
return r !== t && (n(t), t && o(a + 1)), /* @__PURE__ */ Qr(gn, {
|
|
193
|
+
...e,
|
|
194
|
+
key: a
|
|
195
|
+
});
|
|
196
|
+
}, fn = ({ open: e, defaultOpen: t = !1, onOpenChange: r, onEscapeKeyDown: n, onInteractOutside: a, defaultPage: o, popupProps: s, optionsProps: c, searchLabel: l, noResultsLabel: u, searchProps: h, closeOnSelect: d, ...g }) => {
|
|
197
|
+
const { disabled: m } = nt(), [p, b] = K(t), y = e ?? p, w = !m && y, v = (f) => {
|
|
198
|
+
f && m || (b(f), r?.(f));
|
|
199
|
+
}, j = [g["aria-label"], g.label].find(L), k = S(s?.["aria-label"]) || S(s?.["aria-labelledby"]), C = S(c?.["aria-label"]) || S(c?.["aria-labelledby"]);
|
|
200
|
+
return /* @__PURE__ */ I(Z, { children: [/* @__PURE__ */ i(Mt, {
|
|
201
|
+
disabled: m,
|
|
202
|
+
open: y,
|
|
203
|
+
onOpenChange: v
|
|
204
|
+
}), /* @__PURE__ */ I(N.Root, {
|
|
205
|
+
type: "picker",
|
|
206
|
+
open: w,
|
|
207
|
+
onOpenChange: v,
|
|
208
|
+
onEscapeKeyDown: n,
|
|
209
|
+
onInteractOutside: a,
|
|
210
|
+
defaultPage: o,
|
|
211
|
+
children: [/* @__PURE__ */ i(Ft, { ...g }), /* @__PURE__ */ i(N.Content, {
|
|
212
|
+
"aria-label": k ? void 0 : j,
|
|
213
|
+
"aria-labelledby": k ? void 0 : g["aria-labelledby"],
|
|
214
|
+
...s,
|
|
215
|
+
children: /* @__PURE__ */ i(Vt, {
|
|
216
|
+
"aria-label": C ? void 0 : j,
|
|
217
|
+
"aria-labelledby": C ? void 0 : g["aria-labelledby"],
|
|
218
|
+
...c,
|
|
219
|
+
searchLabel: l,
|
|
220
|
+
noResultsLabel: u,
|
|
221
|
+
searchProps: h,
|
|
222
|
+
closeOnSelect: d
|
|
223
|
+
})
|
|
224
|
+
})]
|
|
225
|
+
})] });
|
|
226
|
+
}, vn = ({ countries: e, value: t, defaultValue: r, onValueChange: n, disabled: a, noCountryLabel: o, ...s }) => /* @__PURE__ */ i($t, {
|
|
227
|
+
countries: e,
|
|
228
|
+
value: t,
|
|
229
|
+
defaultValue: r,
|
|
230
|
+
onValueChange: n,
|
|
231
|
+
disabled: a,
|
|
232
|
+
noCountryLabel: o,
|
|
233
|
+
children: /* @__PURE__ */ i(fn, { ...s })
|
|
234
|
+
}), pi = Object.assign(vn, {
|
|
235
|
+
Root: $t,
|
|
236
|
+
Trigger: Ft,
|
|
237
|
+
Options: Vt
|
|
238
|
+
}), pn = "_trigger_18tlx_1", bn = "_chevron_18tlx_40", yn = "_options_18tlx_45", wn = "_emptyStatus_18tlx_51", ze = {
|
|
239
|
+
trigger: pn,
|
|
240
|
+
chevron: bn,
|
|
241
|
+
options: yn,
|
|
242
|
+
emptyStatus: wn
|
|
243
|
+
}, Lt = Ye(void 0), zt = () => {
|
|
244
|
+
const e = ye(Lt);
|
|
245
|
+
if (!S(e)) throw new Error(P("CurrencyPicker parts must be inside CurrencyPicker.Root"));
|
|
246
|
+
return e;
|
|
247
|
+
}, Ut = ({ disabled: e = !1, searchable: t = !0, searchLabel: r = P("Search"), listLabel: n, emptyLabel: a = P("No results"), searchProps: o, className: s, render: c, ref: l, ...u }) => {
|
|
248
|
+
const { state: h, groupId: d, options: g, selectionProps: m } = zt(), { titleId: p, triggerId: b } = Ne(), { value: y, defaultValue: w = "", onValueChange: v, ...j } = o ?? {}, [k, C] = K(w), f = y ?? k, E = t ? String(f).trim().toLowerCase() : "", _ = g.filter(({ searchText: O }) => O.includes(E)), T = Pe(_), H = h.disabled || e, M = S(n) ? void 0 : p ?? b;
|
|
249
|
+
return Te({
|
|
250
|
+
render: c,
|
|
251
|
+
ref: l,
|
|
252
|
+
props: {
|
|
253
|
+
...u,
|
|
254
|
+
className: G(ze.options, s),
|
|
255
|
+
children: /* @__PURE__ */ I(Z, { children: [
|
|
256
|
+
t && /* @__PURE__ */ I(Z, { children: [/* @__PURE__ */ i(N.Search, {
|
|
257
|
+
placeholder: r,
|
|
258
|
+
"aria-label": r,
|
|
259
|
+
...j,
|
|
260
|
+
value: f,
|
|
261
|
+
onValueChange: (O) => {
|
|
262
|
+
v?.(O), Le(y) && C(O);
|
|
263
|
+
},
|
|
264
|
+
disabled: H || o?.disabled
|
|
265
|
+
}), /* @__PURE__ */ i(N.Separator, {})] }),
|
|
266
|
+
/* @__PURE__ */ i(N.SelectionGroup, {
|
|
267
|
+
...m,
|
|
268
|
+
id: d,
|
|
269
|
+
"aria-label": n,
|
|
270
|
+
"aria-labelledby": M,
|
|
271
|
+
children: T && /* @__PURE__ */ i(N.Section, {
|
|
272
|
+
scrollable: !0,
|
|
273
|
+
children: _.map(({ currency: O, label: $ }) => /* @__PURE__ */ i(N.OptionItem, {
|
|
274
|
+
value: O.code,
|
|
275
|
+
disabled: H || O.disabled,
|
|
276
|
+
children: Jr($) ? /* @__PURE__ */ i(rt, { text: $ }) : $
|
|
277
|
+
}, O.code))
|
|
278
|
+
})
|
|
279
|
+
}),
|
|
280
|
+
/* @__PURE__ */ i(N.Empty, {
|
|
281
|
+
className: ze.emptyStatus,
|
|
282
|
+
children: T ? null : a
|
|
283
|
+
})
|
|
284
|
+
] })
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}, Yt = ({ code: e, name: t }) => `${t} (${e})`, _n = (e) => `${Yt(e)} ${e.symbol ?? ""}`, qt = ({ currencies: e, value: t, defaultValue: r = null, onValueChange: n, closeOnSelect: a, disabled: o = !1, selectedFirst: s = !1, getOptionLabel: c = Yt, getSearchText: l = _n, renderValue: u, children: h }) => {
|
|
288
|
+
const d = ae(), { selections: g, initializeSelection: m } = Ne(), p = {
|
|
289
|
+
value: t,
|
|
290
|
+
defaultValue: r,
|
|
291
|
+
onValueChange: n,
|
|
292
|
+
closeOnSelect: a
|
|
293
|
+
}, b = qr({
|
|
294
|
+
props: {
|
|
295
|
+
...p,
|
|
296
|
+
id: d
|
|
297
|
+
},
|
|
298
|
+
storedState: g.get(d)
|
|
299
|
+
}), y = b.multiple ? null : b.value, w = e.map((C) => ({
|
|
300
|
+
currency: C,
|
|
301
|
+
label: c(C),
|
|
302
|
+
searchText: l(C).toLowerCase()
|
|
303
|
+
})), v = w.find(({ currency: C }) => C.code === y), j = s && S(v) ? [v, ...w.filter((C) => C !== v)] : w, k = {
|
|
304
|
+
value: y,
|
|
305
|
+
selectedCurrency: v?.currency,
|
|
306
|
+
disabled: o
|
|
307
|
+
};
|
|
308
|
+
return /* @__PURE__ */ I(Lt.Provider, {
|
|
309
|
+
value: {
|
|
310
|
+
state: k,
|
|
311
|
+
groupId: d,
|
|
312
|
+
options: j,
|
|
313
|
+
selectionProps: p,
|
|
314
|
+
renderValue: u
|
|
315
|
+
},
|
|
316
|
+
children: [Le(t) && /* @__PURE__ */ i(Br, {
|
|
317
|
+
id: d,
|
|
318
|
+
initialState: b,
|
|
319
|
+
initializeSelection: m
|
|
320
|
+
}), Ve(h) ? h(k) : h]
|
|
321
|
+
});
|
|
322
|
+
}, Bt = ({ children: e, placeholder: t, disabled: r = !1, className: n, ...a }) => {
|
|
323
|
+
const { state: o, renderValue: s } = zt(), c = S(o.value) ? o.value : t;
|
|
324
|
+
return /* @__PURE__ */ I(N.Trigger, {
|
|
325
|
+
...a,
|
|
326
|
+
disabled: o.disabled || r,
|
|
327
|
+
className: he(ze.trigger, n),
|
|
328
|
+
children: [e ?? (S(s) ? s(o) : c), /* @__PURE__ */ i(tt, {
|
|
329
|
+
"aria-hidden": "true",
|
|
330
|
+
className: ze.chevron
|
|
331
|
+
})]
|
|
332
|
+
});
|
|
333
|
+
}, Cn = ({ currencies: e, value: t, defaultValue: r, onValueChange: n, closeOnSelect: a, disabled: o, selectedFirst: s, getOptionLabel: c, getSearchText: l, renderValue: u, open: h, defaultOpen: d, onOpenChange: g, onEscapeKeyDown: m, onInteractOutside: p, triggerProps: b, contentProps: y, optionsProps: w, ...v }) => /* @__PURE__ */ i(N.Root, {
|
|
334
|
+
type: "picker",
|
|
335
|
+
open: h,
|
|
336
|
+
defaultOpen: d,
|
|
337
|
+
onOpenChange: g,
|
|
338
|
+
onEscapeKeyDown: m,
|
|
339
|
+
onInteractOutside: p,
|
|
340
|
+
children: /* @__PURE__ */ I(qt, {
|
|
341
|
+
currencies: e,
|
|
342
|
+
value: t,
|
|
343
|
+
defaultValue: r,
|
|
344
|
+
onValueChange: n,
|
|
345
|
+
closeOnSelect: a,
|
|
346
|
+
disabled: o,
|
|
347
|
+
selectedFirst: s,
|
|
348
|
+
getOptionLabel: c,
|
|
349
|
+
getSearchText: l,
|
|
350
|
+
renderValue: u,
|
|
351
|
+
children: [/* @__PURE__ */ i(Bt, {
|
|
352
|
+
...v,
|
|
353
|
+
...b
|
|
354
|
+
}), /* @__PURE__ */ i(N.Content, {
|
|
355
|
+
...y,
|
|
356
|
+
children: /* @__PURE__ */ i(Ut, { ...w })
|
|
357
|
+
})]
|
|
358
|
+
})
|
|
359
|
+
}), bi = Object.assign(Cn, {
|
|
360
|
+
Root: qt,
|
|
361
|
+
Trigger: Bt,
|
|
362
|
+
Options: Ut
|
|
363
|
+
}), En = "_calendar_s1e8i_1", Sn = "_header_s1e8i_9", In = "_monthSelect_s1e8i_18", jn = "_yearSelect_s1e8i_23", kn = "_navigation_s1e8i_28", Rn = "_chevron_s1e8i_33", le = {
|
|
364
|
+
calendar: En,
|
|
365
|
+
header: Sn,
|
|
366
|
+
monthSelect: In,
|
|
367
|
+
yearSelect: jn,
|
|
368
|
+
navigation: kn,
|
|
369
|
+
chevron: Rn
|
|
370
|
+
}, ke = {
|
|
371
|
+
MIN_YEAR: 1,
|
|
372
|
+
MAX_YEAR: 9999,
|
|
373
|
+
DAYS_PER_WEEK: 7,
|
|
374
|
+
MONTHS_PER_YEAR: 12
|
|
375
|
+
}, Nn = ({ isOpenRef: e, onOpenChange: t }) => {
|
|
376
|
+
const r = Ot(t);
|
|
377
|
+
return te(() => () => {
|
|
378
|
+
e.current && (e.current = !1, r(!1));
|
|
379
|
+
}, [e, r]), null;
|
|
380
|
+
}, dt = ({ value: e, items: t, onValueChange: r, label: n, disabled: a, portalContainer: o, onOpenChange: s }) => {
|
|
381
|
+
const c = U(!1);
|
|
382
|
+
return /* @__PURE__ */ I(Q.Root, {
|
|
383
|
+
value: e,
|
|
384
|
+
items: t,
|
|
385
|
+
disabled: a,
|
|
386
|
+
onOpenChange: (l) => {
|
|
387
|
+
l && (c.current = !0, s?.(!0));
|
|
388
|
+
},
|
|
389
|
+
onOpenChangeComplete: (l) => {
|
|
390
|
+
!l && c.current && (c.current = !1, s?.(!1));
|
|
391
|
+
},
|
|
392
|
+
onValueChange: (l) => {
|
|
393
|
+
Pt(l) && r(l);
|
|
394
|
+
},
|
|
395
|
+
children: [
|
|
396
|
+
/* @__PURE__ */ i(Nn, {
|
|
397
|
+
isOpenRef: c,
|
|
398
|
+
onOpenChange: s
|
|
399
|
+
}),
|
|
400
|
+
/* @__PURE__ */ I(Q.Trigger, {
|
|
401
|
+
"aria-label": n,
|
|
402
|
+
children: [/* @__PURE__ */ i(Q.Value, {}), /* @__PURE__ */ i(Q.Icon, {})]
|
|
403
|
+
}),
|
|
404
|
+
/* @__PURE__ */ i(Q.Portal, {
|
|
405
|
+
container: o,
|
|
406
|
+
children: /* @__PURE__ */ i(Q.Positioner, {
|
|
407
|
+
sideOffset: zr.spacingMultiplicator,
|
|
408
|
+
alignItemWithTrigger: !1,
|
|
409
|
+
children: /* @__PURE__ */ i(Q.Popup, { children: t.map(({ value: l, label: u }) => /* @__PURE__ */ I(Q.Item, {
|
|
410
|
+
value: l,
|
|
411
|
+
children: [/* @__PURE__ */ i(Q.ItemText, { children: u }), /* @__PURE__ */ i(Q.ItemIndicator, {})]
|
|
412
|
+
}, l)) })
|
|
413
|
+
})
|
|
414
|
+
})
|
|
415
|
+
]
|
|
416
|
+
});
|
|
417
|
+
}, Xe = class extends RangeError {
|
|
418
|
+
constructor({ message: e }) {
|
|
419
|
+
super(e), this.name = P("DatePickerException");
|
|
420
|
+
}
|
|
421
|
+
}, Tn = /^(\d{4})-(\d{2})-(\d{2})$/, Pn = 10, Ue = (e) => {
|
|
422
|
+
const t = e.match(Tn);
|
|
423
|
+
if (!S(t) || e.length !== Pn) throw new Xe({ message: P("Calendar dates must use the YYYY-MM-DD format.") });
|
|
424
|
+
const [, r, n, a] = t, o = Number(r), s = Number(n), c = Number(a), l = /* @__PURE__ */ new Date(0);
|
|
425
|
+
if (l.setUTCFullYear(o, s - 1, c), !(o >= ke.MIN_YEAR && o <= ke.MAX_YEAR && l.getUTCFullYear() === o && l.getUTCMonth() === s - 1 && l.getUTCDate() === c)) throw new Xe({ message: P("Calendar dates must be valid dates in years 0001 through 9999.") });
|
|
426
|
+
return l;
|
|
427
|
+
}, mt = 100, xn = ({ viewedMonth: e, onPreviousMonth: t, onNextMonth: r, onMonthChange: n, onYearChange: a, isPreviousMonthDisabled: o, isNextMonthDisabled: s, locale: c, previousMonthLabel: l, nextMonthLabel: u, monthLabel: h, yearLabel: d, portalContainer: g, onNavigationOpenChange: m, disabled: p }) => {
|
|
428
|
+
const b = Ue(`${e}-01`), y = b.getUTCFullYear(), w = b.getUTCMonth() + 1, v = new Intl.DateTimeFormat(c, {
|
|
429
|
+
month: "long",
|
|
430
|
+
calendar: "gregory",
|
|
431
|
+
timeZone: P("UTC")
|
|
432
|
+
}), j = new Intl.NumberFormat(c, { useGrouping: !1 }), k = [];
|
|
433
|
+
for (let _ = 1; _ <= ke.MONTHS_PER_YEAR; _++) {
|
|
434
|
+
const T = new Date(b);
|
|
435
|
+
T.setUTCMonth(_ - 1), k.push({
|
|
436
|
+
value: _,
|
|
437
|
+
label: v.format(T)
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
const C = [], f = Math.max(ke.MIN_YEAR, y - mt), E = Math.min(ke.MAX_YEAR, y + mt);
|
|
441
|
+
for (let _ = f; _ <= E; _++) C.push({
|
|
442
|
+
value: _,
|
|
443
|
+
label: j.format(_)
|
|
444
|
+
});
|
|
445
|
+
return /* @__PURE__ */ I("div", {
|
|
446
|
+
className: le.header,
|
|
447
|
+
children: [
|
|
448
|
+
/* @__PURE__ */ i("div", {
|
|
449
|
+
className: le.monthSelect,
|
|
450
|
+
children: /* @__PURE__ */ i(dt, {
|
|
451
|
+
value: w,
|
|
452
|
+
items: k,
|
|
453
|
+
disabled: p,
|
|
454
|
+
label: h,
|
|
455
|
+
portalContainer: g,
|
|
456
|
+
onOpenChange: (_) => m?.({
|
|
457
|
+
open: _,
|
|
458
|
+
control: "month"
|
|
459
|
+
}),
|
|
460
|
+
onValueChange: n
|
|
461
|
+
})
|
|
462
|
+
}),
|
|
463
|
+
/* @__PURE__ */ i("div", {
|
|
464
|
+
className: le.yearSelect,
|
|
465
|
+
children: /* @__PURE__ */ i(dt, {
|
|
466
|
+
value: y,
|
|
467
|
+
items: C,
|
|
468
|
+
disabled: p,
|
|
469
|
+
label: d,
|
|
470
|
+
portalContainer: g,
|
|
471
|
+
onOpenChange: (_) => m?.({
|
|
472
|
+
open: _,
|
|
473
|
+
control: "year"
|
|
474
|
+
}),
|
|
475
|
+
onValueChange: a
|
|
476
|
+
})
|
|
477
|
+
}),
|
|
478
|
+
/* @__PURE__ */ I("div", {
|
|
479
|
+
className: le.navigation,
|
|
480
|
+
children: [/* @__PURE__ */ i(ct, {
|
|
481
|
+
size: "md",
|
|
482
|
+
disabled: p || o,
|
|
483
|
+
"aria-label": l,
|
|
484
|
+
onClick: t,
|
|
485
|
+
children: /* @__PURE__ */ i(Ar, { className: le.chevron })
|
|
486
|
+
}), /* @__PURE__ */ i(ct, {
|
|
487
|
+
size: "md",
|
|
488
|
+
disabled: p || s,
|
|
489
|
+
"aria-label": u,
|
|
490
|
+
onClick: r,
|
|
491
|
+
children: /* @__PURE__ */ i(Fr, { className: le.chevron })
|
|
492
|
+
})]
|
|
493
|
+
})
|
|
494
|
+
]
|
|
495
|
+
});
|
|
496
|
+
}, se = (e) => {
|
|
497
|
+
const t = Ue(e), r = /* @__PURE__ */ new Date(0);
|
|
498
|
+
return r.setFullYear(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate()), r.setHours(0, 0, 0, 0), r;
|
|
499
|
+
}, Dn = ({ calendarRef: e, engineViewedMonthRef: t, viewedMonth: r }) => (te(() => {
|
|
500
|
+
t.current !== r && (e.current?.setPreSelection(se(`${r}-01`)), t.current = r);
|
|
501
|
+
}, [
|
|
502
|
+
e,
|
|
503
|
+
t,
|
|
504
|
+
r
|
|
505
|
+
]), null), _e = (e) => [
|
|
506
|
+
e.getFullYear().toString().padStart(4, "0"),
|
|
507
|
+
(e.getMonth() + 1).toString().padStart(2, "0"),
|
|
508
|
+
e.getDate().toString().padStart(2, "0")
|
|
509
|
+
].join("-"), ht = en(async () => {
|
|
510
|
+
const e = (await import("react-datepicker")).default;
|
|
511
|
+
return { default: "default" in e ? e.default : e };
|
|
512
|
+
}), On = ({ start: e, end: t }) => {
|
|
513
|
+
if (Ue(e), Ue(t), e > t) throw new Xe({ message: P("Calendar highlighted ranges must end on or after their start date.") });
|
|
514
|
+
}, An = 300, yi = ({ value: e, onValueChange: t, onValueSelect: r, viewedMonth: n, onViewedMonthChange: a, highlightedRange: o, readOnly: s = !1, isGridHidden: c = !1, weekStart: l, locale: u, weekdayLabels: h, previousMonthLabel: d, nextMonthLabel: g, monthLabel: m, yearLabel: p, portalContainer: b, onNavigationOpenChange: y, isDateUnavailable: w, disabled: v = !1, isKeyboardNavigationDisabled: j = !1, renderHeader: k, loadingFallback: C, dir: f, render: E, ref: _, className: T, ...H }) => {
|
|
515
|
+
const M = U(null), O = U(null), $ = U(e?.slice(0, 7) ?? n), x = on(), R = f === "rtl" || f === "ltr" ? f : x;
|
|
516
|
+
S(o) && On(o);
|
|
517
|
+
const A = (D) => {
|
|
518
|
+
const B = _e(D).slice(0, 7);
|
|
519
|
+
$.current = B, B !== n && a(B);
|
|
520
|
+
}, re = (D) => {
|
|
521
|
+
s || v || !S(D) || t(_e(D));
|
|
522
|
+
}, Y = {
|
|
523
|
+
ref: M,
|
|
524
|
+
open: !0,
|
|
525
|
+
onClickOutside: (D) => {
|
|
526
|
+
O.current === D && D.preventDefault();
|
|
527
|
+
},
|
|
528
|
+
minDate: se("0001-01-01"),
|
|
529
|
+
maxDate: se("9999-12-31"),
|
|
530
|
+
disabled: v,
|
|
531
|
+
disabledKeyboardNavigation: j,
|
|
532
|
+
openToDate: se(`${n}-01`),
|
|
533
|
+
calendarStartDay: l,
|
|
534
|
+
onMonthChange: A,
|
|
535
|
+
onYearChange: A,
|
|
536
|
+
filterDate: (D) => !w?.(_e(D)),
|
|
537
|
+
onSelect: (D) => {
|
|
538
|
+
if (s || v || !S(D)) return;
|
|
539
|
+
const B = _e(D);
|
|
540
|
+
S(o) && B !== e && t(B), r?.(B);
|
|
541
|
+
},
|
|
542
|
+
renderCustomDayName: S(h) ? ({ day: D }) => /* @__PURE__ */ i("span", {
|
|
543
|
+
title: new Intl.DateTimeFormat(u, { weekday: "long" }).format(D),
|
|
544
|
+
children: h[D.getDay()]
|
|
545
|
+
}) : void 0,
|
|
546
|
+
renderCustomHeader: ({ monthDate: D, decreaseMonth: B, increaseMonth: Oe, changeMonth: Rr, changeYear: Nr, prevMonthButtonDisabled: Tr, nextMonthButtonDisabled: Pr }) => {
|
|
547
|
+
const st = {
|
|
548
|
+
viewedMonth: _e(D).slice(0, 7),
|
|
549
|
+
onPreviousMonth: B,
|
|
550
|
+
onNextMonth: Oe,
|
|
551
|
+
onMonthChange: (Ae) => Rr(Ae - 1),
|
|
552
|
+
onYearChange: (Ae) => {
|
|
553
|
+
const He = new Date(D);
|
|
554
|
+
if (He.setFullYear(Ae), He.getMonth() === D.getMonth()) {
|
|
555
|
+
Nr(Ae);
|
|
556
|
+
return;
|
|
557
|
+
}
|
|
558
|
+
He.setDate(0), M.current?.setPreSelection(He);
|
|
559
|
+
},
|
|
560
|
+
isPreviousMonthDisabled: v || Tr,
|
|
561
|
+
isNextMonthDisabled: v || Pr
|
|
562
|
+
};
|
|
563
|
+
return S(k) ? /* @__PURE__ */ i(Z, { children: k(st) }) : /* @__PURE__ */ i(xn, {
|
|
564
|
+
...st,
|
|
565
|
+
locale: u,
|
|
566
|
+
previousMonthLabel: d,
|
|
567
|
+
nextMonthLabel: g,
|
|
568
|
+
monthLabel: m,
|
|
569
|
+
yearLabel: p,
|
|
570
|
+
portalContainer: b,
|
|
571
|
+
onNavigationOpenChange: y,
|
|
572
|
+
disabled: v
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
}, ge = () => S(o) ? /* @__PURE__ */ i(ht, {
|
|
576
|
+
...Y,
|
|
577
|
+
selectsRange: !0,
|
|
578
|
+
startDate: se(o.start),
|
|
579
|
+
endDate: se(o.end),
|
|
580
|
+
onChange: () => {
|
|
581
|
+
}
|
|
582
|
+
}) : /* @__PURE__ */ i(ht, {
|
|
583
|
+
...Y,
|
|
584
|
+
selected: S(e) ? se(e) : null,
|
|
585
|
+
onChange: re
|
|
586
|
+
});
|
|
587
|
+
return Te({
|
|
588
|
+
render: E,
|
|
589
|
+
ref: _,
|
|
590
|
+
props: {
|
|
591
|
+
role: "group",
|
|
592
|
+
...H,
|
|
593
|
+
dir: R,
|
|
594
|
+
onMouseDownCapture: (D) => {
|
|
595
|
+
H.onMouseDownCapture?.(D), O.current = D.nativeEvent;
|
|
596
|
+
},
|
|
597
|
+
className: G(le.calendar, T),
|
|
598
|
+
"data-readonly": s || void 0,
|
|
599
|
+
"data-hide-grid": c || void 0,
|
|
600
|
+
children: /* @__PURE__ */ I(Zr, {
|
|
601
|
+
fallback: C ?? /* @__PURE__ */ i(Kr, { height: An }),
|
|
602
|
+
children: [/* @__PURE__ */ i(Dn, {
|
|
603
|
+
calendarRef: M,
|
|
604
|
+
engineViewedMonthRef: $,
|
|
605
|
+
viewedMonth: n
|
|
606
|
+
}), ge()]
|
|
607
|
+
})
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
}, Hn = Object.defineProperty, $n = (e, t) => {
|
|
611
|
+
for (var r in t) Hn(e, r, {
|
|
612
|
+
get: t[r],
|
|
613
|
+
enumerable: !0
|
|
614
|
+
});
|
|
615
|
+
}, ce = {};
|
|
616
|
+
$n(ce, {
|
|
617
|
+
ActiveEmoji: () => _r,
|
|
618
|
+
Empty: () => wr,
|
|
619
|
+
List: () => pr,
|
|
620
|
+
Loading: () => yr,
|
|
621
|
+
Root: () => ur,
|
|
622
|
+
Search: () => dr,
|
|
623
|
+
SkinTone: () => Cr,
|
|
624
|
+
SkinToneSelector: () => br,
|
|
625
|
+
Viewport: () => mr
|
|
626
|
+
});
|
|
627
|
+
var Gt = "'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif", ot = [
|
|
628
|
+
"none",
|
|
629
|
+
"light",
|
|
630
|
+
"medium-light",
|
|
631
|
+
"medium",
|
|
632
|
+
"medium-dark",
|
|
633
|
+
"dark"
|
|
634
|
+
];
|
|
635
|
+
function Ge(e) {
|
|
636
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
637
|
+
}
|
|
638
|
+
var J = 2, V = null;
|
|
639
|
+
function gt(e) {
|
|
640
|
+
try {
|
|
641
|
+
V ??= document.createElement("canvas").getContext("2d", { willReadFrequently: !0 });
|
|
642
|
+
} catch {
|
|
643
|
+
}
|
|
644
|
+
if (!V || (queueMicrotask(() => {
|
|
645
|
+
V && (V = null);
|
|
646
|
+
}), V.canvas.width = J, V.canvas.height = J, V.font = `2px ${Gt}`, V.textBaseline = "middle", V.measureText(e).width >= J * 2)) return !1;
|
|
647
|
+
V.fillStyle = "#00f", V.fillText(e, 0, 0);
|
|
648
|
+
let t = V.getImageData(0, 0, J, J).data;
|
|
649
|
+
V.clearRect(0, 0, J, J), V.fillStyle = "#f00", V.fillText(e, 0, 0);
|
|
650
|
+
let r = V.getImageData(0, 0, J, J).data;
|
|
651
|
+
for (let n = 0; n < J * J * 4; n += 4) if (t[n] !== r[n] || t[n + 1] !== r[n + 1] || t[n + 2] !== r[n + 2]) return !1;
|
|
652
|
+
return !0;
|
|
653
|
+
}
|
|
654
|
+
function Wt(e, t, r) {
|
|
655
|
+
try {
|
|
656
|
+
let n = e.getItem(t);
|
|
657
|
+
if (!n) throw new Error(`No value found for "${t}".`);
|
|
658
|
+
return r(JSON.parse(n));
|
|
659
|
+
} catch {
|
|
660
|
+
return null;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
function Kt(e, t, r) {
|
|
664
|
+
e.setItem(t, JSON.stringify(r));
|
|
665
|
+
}
|
|
666
|
+
function Re(e) {
|
|
667
|
+
return (t) => t === void 0 ? void 0 : e(t);
|
|
668
|
+
}
|
|
669
|
+
function F(e) {
|
|
670
|
+
if (typeof e != "string") throw new Error();
|
|
671
|
+
return e;
|
|
672
|
+
}
|
|
673
|
+
function Me(e) {
|
|
674
|
+
if (typeof e != "number") throw new Error();
|
|
675
|
+
return e;
|
|
676
|
+
}
|
|
677
|
+
function Jt(e) {
|
|
678
|
+
if (typeof e != "boolean") throw new Error();
|
|
679
|
+
return e;
|
|
680
|
+
}
|
|
681
|
+
function ue(e) {
|
|
682
|
+
return (t) => {
|
|
683
|
+
if (typeof t != "object" || t === null) throw new Error();
|
|
684
|
+
let r = {};
|
|
685
|
+
for (let n in e) {
|
|
686
|
+
let a = t[n];
|
|
687
|
+
a === void 0 && e[n](void 0), r[n] = e[n](a);
|
|
688
|
+
}
|
|
689
|
+
return r;
|
|
690
|
+
};
|
|
691
|
+
}
|
|
692
|
+
function Ie(e) {
|
|
693
|
+
return (t) => {
|
|
694
|
+
if (!Array.isArray(t)) throw new Error();
|
|
695
|
+
return t.length > 0 && e(t[0]), t;
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
var Mn = "frimousse/data", Fn = ue({
|
|
699
|
+
locale: F,
|
|
700
|
+
emojis: Ie(ue({
|
|
701
|
+
emoji: F,
|
|
702
|
+
category: Me,
|
|
703
|
+
label: F,
|
|
704
|
+
version: Me,
|
|
705
|
+
tags: Ie(F),
|
|
706
|
+
aliases: Re(Ie(F)),
|
|
707
|
+
countryFlag: Re(Jt),
|
|
708
|
+
skins: Re(ue({
|
|
709
|
+
light: F,
|
|
710
|
+
"medium-light": F,
|
|
711
|
+
medium: F,
|
|
712
|
+
"medium-dark": F,
|
|
713
|
+
dark: F
|
|
714
|
+
}))
|
|
715
|
+
})),
|
|
716
|
+
categories: Ie(ue({
|
|
717
|
+
index: Me,
|
|
718
|
+
label: F
|
|
719
|
+
})),
|
|
720
|
+
skinTones: ue({
|
|
721
|
+
light: F,
|
|
722
|
+
"medium-light": F,
|
|
723
|
+
medium: F,
|
|
724
|
+
"medium-dark": F,
|
|
725
|
+
dark: F
|
|
726
|
+
})
|
|
727
|
+
});
|
|
728
|
+
function Vn({ name: e = Mn } = {}) {
|
|
729
|
+
let t = `${e}/`, r = ue({
|
|
730
|
+
data: Fn,
|
|
731
|
+
metadata: (n) => n
|
|
732
|
+
});
|
|
733
|
+
return {
|
|
734
|
+
get(n) {
|
|
735
|
+
try {
|
|
736
|
+
return Wt(localStorage, `${t}${n}`, r);
|
|
737
|
+
} catch {
|
|
738
|
+
return null;
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
set(n, a, ...[o]) {
|
|
742
|
+
try {
|
|
743
|
+
Kt(localStorage, `${t}${n}`, {
|
|
744
|
+
data: a,
|
|
745
|
+
metadata: o
|
|
746
|
+
});
|
|
747
|
+
} catch {
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
delete(n) {
|
|
751
|
+
try {
|
|
752
|
+
localStorage.removeItem(`${t}${n}`);
|
|
753
|
+
} catch {
|
|
754
|
+
}
|
|
755
|
+
},
|
|
756
|
+
clear() {
|
|
757
|
+
try {
|
|
758
|
+
for (let n of Object.keys(localStorage)) n.startsWith(t) && localStorage.removeItem(n);
|
|
759
|
+
} catch {
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
var Xt = /* @__PURE__ */ new Map(), Ze = /* @__PURE__ */ new WeakMap(), Ln = /* @__PURE__ */ new Set();
|
|
765
|
+
function Zt({ emojiVersion: e, emojibaseUrl: t }) {
|
|
766
|
+
return t ?? (typeof e == "number" ? `https://cdn.jsdelivr.net/npm/emojibase-data@${Math.floor(e)}` : "https://cdn.jsdelivr.net/npm/emojibase-data@latest");
|
|
767
|
+
}
|
|
768
|
+
function zn(e, t) {
|
|
769
|
+
return (t.resolveEmojiData ? Ze.get(t.resolveEmojiData) : Xt)?.get(er(e, t))?.data;
|
|
770
|
+
}
|
|
771
|
+
function Qt(e, t, r) {
|
|
772
|
+
let n = Yn(e, t), a = n.load?.status === "pending" ? n.load : void 0;
|
|
773
|
+
n.data = r, n.load = void 0, a?.complete();
|
|
774
|
+
for (let o of Ln) o();
|
|
775
|
+
}
|
|
776
|
+
async function Un(e, t, r) {
|
|
777
|
+
r.signal?.throwIfAborted();
|
|
778
|
+
let n = await e(t, r);
|
|
779
|
+
return r.signal?.throwIfAborted(), Qt(t, {
|
|
780
|
+
...r,
|
|
781
|
+
resolveEmojiData: e
|
|
782
|
+
}, n), n;
|
|
783
|
+
}
|
|
784
|
+
function er(e, t) {
|
|
785
|
+
return t.resolveEmojiData ? JSON.stringify([
|
|
786
|
+
e,
|
|
787
|
+
t.emojibaseUrl,
|
|
788
|
+
t.emojiVersion
|
|
789
|
+
]) : JSON.stringify([e, Zt(t)]);
|
|
790
|
+
}
|
|
791
|
+
function Yn(e, t) {
|
|
792
|
+
let r = Xt;
|
|
793
|
+
if (t.resolveEmojiData) {
|
|
794
|
+
let o = Ze.get(t.resolveEmojiData);
|
|
795
|
+
r = o ?? /* @__PURE__ */ new Map(), o || Ze.set(t.resolveEmojiData, r);
|
|
796
|
+
}
|
|
797
|
+
let n = er(e, t), a = r.get(n);
|
|
798
|
+
return a || (a = {}, r.set(n, a)), a;
|
|
799
|
+
}
|
|
800
|
+
var at = (e, t) => `${e}/${t}/data.json`, tr = (e, t) => `${e}/${t}/messages.json`, qn = [
|
|
801
|
+
"bn",
|
|
802
|
+
"da",
|
|
803
|
+
"de",
|
|
804
|
+
"en-gb",
|
|
805
|
+
"en",
|
|
806
|
+
"es-mx",
|
|
807
|
+
"es",
|
|
808
|
+
"et",
|
|
809
|
+
"fi",
|
|
810
|
+
"fr",
|
|
811
|
+
"hi",
|
|
812
|
+
"hu",
|
|
813
|
+
"it",
|
|
814
|
+
"ja",
|
|
815
|
+
"ko",
|
|
816
|
+
"lt",
|
|
817
|
+
"ms",
|
|
818
|
+
"nb",
|
|
819
|
+
"nl",
|
|
820
|
+
"pl",
|
|
821
|
+
"pt",
|
|
822
|
+
"ru",
|
|
823
|
+
"sv",
|
|
824
|
+
"th",
|
|
825
|
+
"uk",
|
|
826
|
+
"vi",
|
|
827
|
+
"zh-hant",
|
|
828
|
+
"zh"
|
|
829
|
+
], ft = "en", rr = (e) => `frimousse/metadata/${e}`, Ce = /* @__PURE__ */ new Map();
|
|
830
|
+
function nr(e) {
|
|
831
|
+
return Vn({ name: `frimousse/data/${e}` });
|
|
832
|
+
}
|
|
833
|
+
async function vt(e, t) {
|
|
834
|
+
try {
|
|
835
|
+
return (await fetch(e, {
|
|
836
|
+
method: "HEAD",
|
|
837
|
+
signal: t
|
|
838
|
+
})).headers.get("etag");
|
|
839
|
+
} catch {
|
|
840
|
+
return null;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
async function Bn(e, t, r) {
|
|
844
|
+
let [{ emojis: n, emojisEtag: a }, { messages: o, messagesEtag: s }] = await Promise.all([fetch(at(e, t), { signal: r }).then(async (c) => ({
|
|
845
|
+
emojis: await c.json(),
|
|
846
|
+
emojisEtag: c.headers.get("etag")
|
|
847
|
+
})), fetch(tr(e, t), { signal: r }).then(async (c) => ({
|
|
848
|
+
messages: await c.json(),
|
|
849
|
+
messagesEtag: c.headers.get("etag")
|
|
850
|
+
}))]);
|
|
851
|
+
return {
|
|
852
|
+
emojis: n,
|
|
853
|
+
messages: o,
|
|
854
|
+
emojisEtag: a,
|
|
855
|
+
messagesEtag: s
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
async function Gn(e, t, r) {
|
|
859
|
+
let [n, a] = await Promise.all([vt(at(e, t), r), vt(tr(e, t), r)]);
|
|
860
|
+
return {
|
|
861
|
+
emojisEtag: n,
|
|
862
|
+
messagesEtag: a
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
function Wn(e) {
|
|
866
|
+
return e.skins ? e.skins.filter((t) => typeof t.tone == "number").reduce((t, r) => {
|
|
867
|
+
let n = ot[r.tone];
|
|
868
|
+
return t[n] = r.emoji, t;
|
|
869
|
+
}, {}) : void 0;
|
|
870
|
+
}
|
|
871
|
+
async function pt(e, t, r) {
|
|
872
|
+
let { emojis: n, emojisEtag: a, messages: o, messagesEtag: s } = await Bn(e, t, r);
|
|
873
|
+
r?.throwIfAborted();
|
|
874
|
+
let c = o.subgroups.find((m) => m.key === "country-flag" || m.key === "subdivision-flag"), l = o.groups.filter((m) => m.key !== "component"), u = n.filter((m) => "group" in m), h = l.map((m) => ({
|
|
875
|
+
index: m.order,
|
|
876
|
+
label: Ge(m.message)
|
|
877
|
+
})), d = o.skinTones.reduce((m, p) => (m[p.key] = Ge(p.message), m), {}), g = {
|
|
878
|
+
locale: t,
|
|
879
|
+
emojis: u.map((m) => {
|
|
880
|
+
let p = m.skins?.filter((b) => Array.isArray(b.tone)).map((b) => b.emoji);
|
|
881
|
+
return {
|
|
882
|
+
emoji: m.emoji,
|
|
883
|
+
category: m.group,
|
|
884
|
+
version: m.version,
|
|
885
|
+
label: Ge(m.label),
|
|
886
|
+
tags: m.tags ?? [],
|
|
887
|
+
countryFlag: c && m.subgroup === c.order || void 0,
|
|
888
|
+
skins: Wn(m),
|
|
889
|
+
aliases: p?.length ? p : void 0
|
|
890
|
+
};
|
|
891
|
+
}),
|
|
892
|
+
categories: h,
|
|
893
|
+
skinTones: d
|
|
894
|
+
};
|
|
895
|
+
return nr(e).set(t, g, {
|
|
896
|
+
emojisEtag: a,
|
|
897
|
+
messagesEtag: s
|
|
898
|
+
}), g;
|
|
899
|
+
}
|
|
900
|
+
function Kn(e) {
|
|
901
|
+
let t = /* @__PURE__ */ new Map();
|
|
902
|
+
for (let o of e) t.has(o.version) || t.set(o.version, o.emoji);
|
|
903
|
+
let r = [...t.keys()].sort((o, s) => s - o), n = r[0] ?? 0, a = gt("🇪🇺");
|
|
904
|
+
for (let o of r) if (gt(t.get(o))) return {
|
|
905
|
+
emojiVersion: o,
|
|
906
|
+
countryFlags: a
|
|
907
|
+
};
|
|
908
|
+
return {
|
|
909
|
+
emojiVersion: n,
|
|
910
|
+
countryFlags: a
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
var Jn = ue({
|
|
914
|
+
emojiVersion: Re(Me),
|
|
915
|
+
countryFlags: Re(Jt),
|
|
916
|
+
revalidated: Ie(F)
|
|
917
|
+
});
|
|
918
|
+
function Qe(e) {
|
|
919
|
+
try {
|
|
920
|
+
return Wt(sessionStorage, rr(e), Jn);
|
|
921
|
+
} catch {
|
|
922
|
+
return null;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
function or(e, t) {
|
|
926
|
+
try {
|
|
927
|
+
Kt(sessionStorage, rr(e), t);
|
|
928
|
+
} catch {
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
function Xn(e, t, r) {
|
|
932
|
+
if (r?.aborted) return Promise.reject(r.reason);
|
|
933
|
+
let n = at(e, t), a = zn(t, { emojibaseUrl: e });
|
|
934
|
+
if (a) return Promise.resolve(a);
|
|
935
|
+
let o = Ce.get(n);
|
|
936
|
+
if (!o || o.controller.signal.aborted) {
|
|
937
|
+
let l = new AbortController(), u = Zn(e, t, l.signal).then((h) => (l.signal.throwIfAborted(), Qt(t, { emojibaseUrl: e }, h), h)).finally(() => {
|
|
938
|
+
Ce.get(n)?.promise === u && Ce.delete(n);
|
|
939
|
+
});
|
|
940
|
+
o = {
|
|
941
|
+
promise: u,
|
|
942
|
+
controller: l,
|
|
943
|
+
callers: 0
|
|
944
|
+
}, Ce.set(n, o);
|
|
945
|
+
}
|
|
946
|
+
let s = o;
|
|
947
|
+
s.callers++;
|
|
948
|
+
let c;
|
|
949
|
+
return new Promise((l, u) => {
|
|
950
|
+
c = () => u(r?.reason), r?.addEventListener("abort", c, { once: !0 }), s.promise.then(l, u);
|
|
951
|
+
}).finally(() => {
|
|
952
|
+
r?.removeEventListener("abort", c), s.callers--, s.callers === 0 && Ce.get(n) === s && s.controller.abort();
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
async function Zn(e, t, r) {
|
|
956
|
+
let n = Qe(e), a = nr(e).get(t), o;
|
|
957
|
+
if (!a) o = await pt(e, t, r);
|
|
958
|
+
else if (n?.revalidated.includes(t)) o = a.data;
|
|
959
|
+
else try {
|
|
960
|
+
let { emojisEtag: l, messagesEtag: u } = await Gn(e, t, r);
|
|
961
|
+
r.throwIfAborted(), o = !l || !u || l !== a.metadata?.emojisEtag || u !== a.metadata?.messagesEtag ? await pt(e, t, r) : a.data;
|
|
962
|
+
} catch {
|
|
963
|
+
r.throwIfAborted(), o = a.data;
|
|
964
|
+
}
|
|
965
|
+
r.throwIfAborted();
|
|
966
|
+
let s = Qe(e), c = s?.revalidated ?? [];
|
|
967
|
+
return or(e, {
|
|
968
|
+
...s,
|
|
969
|
+
revalidated: c.includes(t) ? c : [...c, t]
|
|
970
|
+
}), o;
|
|
971
|
+
}
|
|
972
|
+
var We = async (e, { emojiVersion: t, emojibaseUrl: r, signal: n } = {}) => {
|
|
973
|
+
let a = Qn(e), o = Zt({
|
|
974
|
+
emojiVersion: t,
|
|
975
|
+
emojibaseUrl: r
|
|
976
|
+
}), s = await Xn(o, a, n);
|
|
977
|
+
n?.throwIfAborted();
|
|
978
|
+
let c = Qe(o), l = c?.emojiVersion !== void 0 && c.countryFlags !== void 0 ? {
|
|
979
|
+
emojiVersion: c.emojiVersion,
|
|
980
|
+
countryFlags: c.countryFlags
|
|
981
|
+
} : Kn(s.emojis);
|
|
982
|
+
return or(o, {
|
|
983
|
+
...l,
|
|
984
|
+
revalidated: c?.revalidated ?? [a]
|
|
985
|
+
}), {
|
|
986
|
+
locale: a,
|
|
987
|
+
emojis: s.emojis.filter((u) => {
|
|
988
|
+
let h = u.version <= (t ?? l.emojiVersion);
|
|
989
|
+
return u.countryFlag ? h && l.countryFlags : h;
|
|
990
|
+
}),
|
|
991
|
+
categories: s.categories,
|
|
992
|
+
skinTones: s.skinTones
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
function Qn(e) {
|
|
996
|
+
return qn.find((t) => t === e) || (console.warn(`Locale "${e}" is not supported, using "${ft}" instead.`), ft);
|
|
997
|
+
}
|
|
998
|
+
function bt(e) {
|
|
999
|
+
return ot.includes(e) ? e : (console.warn(`Skin tone "${e}" is not valid, using "none" instead.`), "none");
|
|
1000
|
+
}
|
|
1001
|
+
function eo(e, t) {
|
|
1002
|
+
let r = [];
|
|
1003
|
+
if (t <= 0) return r;
|
|
1004
|
+
for (let n = 0, a = e.length; n < a; n += t) r.push(e.slice(n, n + t));
|
|
1005
|
+
return r;
|
|
1006
|
+
}
|
|
1007
|
+
function to(e, t) {
|
|
1008
|
+
if (!t) return e;
|
|
1009
|
+
let r = t.toLowerCase().trim(), n = /* @__PURE__ */ new WeakMap();
|
|
1010
|
+
return e.filter((a) => {
|
|
1011
|
+
let o = 0;
|
|
1012
|
+
a.label.toLowerCase().includes(r) && (o += 10);
|
|
1013
|
+
for (let s of a.tags) s.toLowerCase().includes(r) && (o += 1);
|
|
1014
|
+
return o > 0 ? (n.set(a, o), !0) : !1;
|
|
1015
|
+
}).sort((a, o) => (n.get(o) ?? 0) - (n.get(a) ?? 0));
|
|
1016
|
+
}
|
|
1017
|
+
function ro(e, t, r, n) {
|
|
1018
|
+
let a = to(e.emojis, n), o = [], s = [], c = [], l = {}, u = 0, h = 0;
|
|
1019
|
+
for (let d of a) l[d.category] || (l[d.category] = []), l[d.category].push({
|
|
1020
|
+
emoji: r && r !== "none" && d.skins ? d.skins[r] : d.emoji,
|
|
1021
|
+
label: d.label
|
|
1022
|
+
});
|
|
1023
|
+
for (let d of e.categories) {
|
|
1024
|
+
let g = l[d.index];
|
|
1025
|
+
if (!g || g.length === 0) continue;
|
|
1026
|
+
let m = eo(Array.from(g), t).map((p) => ({
|
|
1027
|
+
categoryIndex: u,
|
|
1028
|
+
emojis: p
|
|
1029
|
+
}));
|
|
1030
|
+
o.push(...m), s.push({
|
|
1031
|
+
label: d.label,
|
|
1032
|
+
rowsCount: m.length,
|
|
1033
|
+
startRowIndex: h
|
|
1034
|
+
}), c.push(h), u++, h += m.length;
|
|
1035
|
+
}
|
|
1036
|
+
return {
|
|
1037
|
+
count: a.length,
|
|
1038
|
+
categories: s,
|
|
1039
|
+
categoriesStartRowIndices: c,
|
|
1040
|
+
rows: o,
|
|
1041
|
+
skinTones: e.skinTones
|
|
1042
|
+
};
|
|
1043
|
+
}
|
|
1044
|
+
function no(e) {
|
|
1045
|
+
let t = {}, r = null, n = null, a = /* @__PURE__ */ new Set(), o = () => {
|
|
1046
|
+
if (r) {
|
|
1047
|
+
t = r, r = null;
|
|
1048
|
+
for (let u of a) u(t);
|
|
1049
|
+
}
|
|
1050
|
+
n = null;
|
|
1051
|
+
}, s = () => r ?? t, c = (u) => {
|
|
1052
|
+
r ??= t, Object.assign(r, typeof u == "function" ? u(s()) : u), n || (n = requestAnimationFrame(o));
|
|
1053
|
+
}, l = (u) => (a.add(u), () => a.delete(u));
|
|
1054
|
+
return t = e(c, s), {
|
|
1055
|
+
get: s,
|
|
1056
|
+
set: c,
|
|
1057
|
+
subscribe: l
|
|
1058
|
+
};
|
|
1059
|
+
}
|
|
1060
|
+
function oo(e) {
|
|
1061
|
+
let [t] = K(e);
|
|
1062
|
+
return t;
|
|
1063
|
+
}
|
|
1064
|
+
function ao(e) {
|
|
1065
|
+
let t = Ye(null);
|
|
1066
|
+
return {
|
|
1067
|
+
useStore: () => {
|
|
1068
|
+
let r = ye(t);
|
|
1069
|
+
if (!r) throw new Error(e);
|
|
1070
|
+
return r;
|
|
1071
|
+
},
|
|
1072
|
+
Provider: ({ store: r, children: n }) => i(t.Provider, {
|
|
1073
|
+
value: r,
|
|
1074
|
+
children: n
|
|
1075
|
+
})
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
function W(e, t, r = Object.is) {
|
|
1079
|
+
let [n, a] = K(() => t(e.get()));
|
|
1080
|
+
return te(() => e.subscribe(() => {
|
|
1081
|
+
let o = t(e.get());
|
|
1082
|
+
a((s) => r(s, o) ? s : o);
|
|
1083
|
+
}), [
|
|
1084
|
+
e,
|
|
1085
|
+
t,
|
|
1086
|
+
r
|
|
1087
|
+
]), tn(n), n;
|
|
1088
|
+
}
|
|
1089
|
+
function ee(e, t, r) {
|
|
1090
|
+
return W(e, z((n) => n[t], [t]), r);
|
|
1091
|
+
}
|
|
1092
|
+
var yt = 2;
|
|
1093
|
+
function io(e, t, r, n, a) {
|
|
1094
|
+
let o = 0;
|
|
1095
|
+
return no((s, c) => ({
|
|
1096
|
+
locale: t,
|
|
1097
|
+
columns: r,
|
|
1098
|
+
sticky: n,
|
|
1099
|
+
skinTone: a,
|
|
1100
|
+
onEmojiSelect: e,
|
|
1101
|
+
data: null,
|
|
1102
|
+
search: "",
|
|
1103
|
+
interaction: "none",
|
|
1104
|
+
activeColumnIndex: 0,
|
|
1105
|
+
activeRowIndex: 0,
|
|
1106
|
+
rowHeight: null,
|
|
1107
|
+
categoryHeaderHeight: null,
|
|
1108
|
+
viewportWidth: null,
|
|
1109
|
+
viewportHeight: null,
|
|
1110
|
+
viewportCurrentCategoryIndex: null,
|
|
1111
|
+
viewportStartCategoryIndex: 0,
|
|
1112
|
+
viewportStartRowIndex: 0,
|
|
1113
|
+
viewportEndRowIndex: 0,
|
|
1114
|
+
rootRef: null,
|
|
1115
|
+
searchRef: null,
|
|
1116
|
+
viewportRef: null,
|
|
1117
|
+
listRef: null,
|
|
1118
|
+
updateViewportState: (l) => {
|
|
1119
|
+
let u = c(), h = l?.data ?? u.data, d = l?.categoryHeaderHeight ?? u.categoryHeaderHeight, g = l?.rowHeight ?? u.rowHeight, m = l?.viewportHeight ?? u.viewportHeight;
|
|
1120
|
+
if (!h || h.rows.length === 0 || !d || !g || !m) return s({
|
|
1121
|
+
...l,
|
|
1122
|
+
viewportStartCategoryIndex: 0,
|
|
1123
|
+
viewportStartRowIndex: 0,
|
|
1124
|
+
viewportEndRowIndex: 0
|
|
1125
|
+
});
|
|
1126
|
+
let p = 0, b = 0;
|
|
1127
|
+
for (let _ of h.categories) if (b++ * d + _.startRowIndex * g < o) p += d;
|
|
1128
|
+
else break;
|
|
1129
|
+
let y = h.categories.length * d + h.rows.length * g, w = Math.floor(yt * g / 2), v = Math.ceil(yt * g / 2), j = Math.min(o - p - w, y - m), k = j + m + v, C = Math.max(0, Math.floor(j / g)), f = Math.min(h.rows.length - 1, Math.ceil(k / g)), E = h.rows[C]?.categoryIndex;
|
|
1130
|
+
return s(E === void 0 && l ? l : {
|
|
1131
|
+
...l,
|
|
1132
|
+
viewportStartCategoryIndex: E,
|
|
1133
|
+
viewportStartRowIndex: C,
|
|
1134
|
+
viewportEndRowIndex: f
|
|
1135
|
+
});
|
|
1136
|
+
},
|
|
1137
|
+
onDataChange: (l) => {
|
|
1138
|
+
c().updateViewportState({
|
|
1139
|
+
data: l,
|
|
1140
|
+
activeColumnIndex: 0,
|
|
1141
|
+
activeRowIndex: 0
|
|
1142
|
+
});
|
|
1143
|
+
},
|
|
1144
|
+
onSearchChange: (l) => {
|
|
1145
|
+
s({
|
|
1146
|
+
search: l,
|
|
1147
|
+
interaction: l ? "keyboard" : "none"
|
|
1148
|
+
});
|
|
1149
|
+
},
|
|
1150
|
+
onActiveEmojiChange: (l, u, h) => {
|
|
1151
|
+
if (s({
|
|
1152
|
+
interaction: l,
|
|
1153
|
+
activeColumnIndex: u,
|
|
1154
|
+
activeRowIndex: h
|
|
1155
|
+
}), l !== "keyboard") return;
|
|
1156
|
+
let { listRef: d, viewportRef: g, sticky: m, rowHeight: p, viewportHeight: b, categoryHeaderHeight: y } = c(), w = d?.current, v = g?.current;
|
|
1157
|
+
if (!w || !v || !p || !y || !b) return;
|
|
1158
|
+
let j = h;
|
|
1159
|
+
j === 0 && v.scrollTo({
|
|
1160
|
+
top: 0,
|
|
1161
|
+
behavior: "instant"
|
|
1162
|
+
});
|
|
1163
|
+
let k = w.querySelector(`[aria-rowindex="${j}"]`);
|
|
1164
|
+
if (!(k instanceof HTMLElement)) return;
|
|
1165
|
+
let C = k.offsetTop, f = getComputedStyle(k), E = Number.parseFloat(f.scrollMarginTop), _ = Number.parseFloat(f.scrollMarginBottom), T = o + E;
|
|
1166
|
+
m && C < o + b / 2 && (T += y);
|
|
1167
|
+
let H = T + b - _;
|
|
1168
|
+
(C < T || C + p > H) && v.scrollTo({
|
|
1169
|
+
top: Math.max(C < T + y ? C - Math.max(m ? y : 0, E) : C - b + p + _, 0),
|
|
1170
|
+
behavior: "instant"
|
|
1171
|
+
});
|
|
1172
|
+
},
|
|
1173
|
+
onActiveEmojiReset: () => {
|
|
1174
|
+
s({
|
|
1175
|
+
interaction: "none",
|
|
1176
|
+
activeColumnIndex: 0,
|
|
1177
|
+
activeRowIndex: 0
|
|
1178
|
+
});
|
|
1179
|
+
},
|
|
1180
|
+
onRowHeightChange: (l) => {
|
|
1181
|
+
c().updateViewportState({ rowHeight: l });
|
|
1182
|
+
},
|
|
1183
|
+
onCategoryHeaderHeightChange: (l) => {
|
|
1184
|
+
c().updateViewportState({ categoryHeaderHeight: l });
|
|
1185
|
+
},
|
|
1186
|
+
onViewportSizeChange: (l, u) => {
|
|
1187
|
+
c().updateViewportState({
|
|
1188
|
+
viewportWidth: l,
|
|
1189
|
+
viewportHeight: u
|
|
1190
|
+
});
|
|
1191
|
+
},
|
|
1192
|
+
onViewportScroll: (l) => {
|
|
1193
|
+
o = l, c().updateViewportState();
|
|
1194
|
+
}
|
|
1195
|
+
}));
|
|
1196
|
+
}
|
|
1197
|
+
var { useStore: q, Provider: lo } = ao("EmojiPicker.Root is missing.");
|
|
1198
|
+
function so(e) {
|
|
1199
|
+
return e.search;
|
|
1200
|
+
}
|
|
1201
|
+
function it(e) {
|
|
1202
|
+
return e.interaction === "none" ? void 0 : e.data?.rows[e.activeRowIndex]?.emojis[e.activeColumnIndex];
|
|
1203
|
+
}
|
|
1204
|
+
function co(e) {
|
|
1205
|
+
return e.data === void 0 || typeof e.data?.count == "number" && e.data.count === 0;
|
|
1206
|
+
}
|
|
1207
|
+
function uo(e) {
|
|
1208
|
+
return e.data === null || e.viewportHeight === null || e.rowHeight === null || e.categoryHeaderHeight === null;
|
|
1209
|
+
}
|
|
1210
|
+
function ar(e) {
|
|
1211
|
+
return e.data?.rows.length;
|
|
1212
|
+
}
|
|
1213
|
+
function mo(e) {
|
|
1214
|
+
return e.data?.categories.length;
|
|
1215
|
+
}
|
|
1216
|
+
function ho(e) {
|
|
1217
|
+
return e.data?.categoriesStartRowIndices;
|
|
1218
|
+
}
|
|
1219
|
+
function go(e) {
|
|
1220
|
+
return e.data?.skinTones;
|
|
1221
|
+
}
|
|
1222
|
+
function ir(e, t) {
|
|
1223
|
+
return e?.emoji === t?.emoji;
|
|
1224
|
+
}
|
|
1225
|
+
function fo(e, t) {
|
|
1226
|
+
return e?.categoryIndex !== t?.categoryIndex || e?.emojis.length !== t?.emojis.length ? !1 : !!e?.emojis.every((r, n) => ir(r, t?.emojis[n]));
|
|
1227
|
+
}
|
|
1228
|
+
var Ee = "", wt = new RegExp("\\p{Emoji_Modifier_Base}", "u"), vo = /\uFE0F$/, po = /\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu, bo = {
|
|
1229
|
+
light: "🏻",
|
|
1230
|
+
"medium-light": "🏼",
|
|
1231
|
+
medium: "🏽",
|
|
1232
|
+
"medium-dark": "🏾",
|
|
1233
|
+
dark: "🏿"
|
|
1234
|
+
};
|
|
1235
|
+
function yo(e, t) {
|
|
1236
|
+
if (!e.split(Ee).some((n) => wt.test(n))) return e;
|
|
1237
|
+
let r = e.split(Ee).map((n) => n.replace(po, "")).join(Ee);
|
|
1238
|
+
return t === "none" ? r : r.split(Ee).map((n, a, o) => {
|
|
1239
|
+
let s = o.length > 1;
|
|
1240
|
+
return !wt.test(n) || s && n === "🤝" ? n : n.replace(vo, "") + bo[t];
|
|
1241
|
+
}).join(Ee);
|
|
1242
|
+
}
|
|
1243
|
+
function wo(e) {
|
|
1244
|
+
return ot.map((t) => ({
|
|
1245
|
+
skinTone: t,
|
|
1246
|
+
emoji: yo(e, t)
|
|
1247
|
+
}));
|
|
1248
|
+
}
|
|
1249
|
+
function lr() {
|
|
1250
|
+
return rn(W(q(), it, ir));
|
|
1251
|
+
}
|
|
1252
|
+
function sr(e = "✋") {
|
|
1253
|
+
let t = q(), r = ee(t, "skinTone"), n = me(() => wo(e), [e]);
|
|
1254
|
+
return [
|
|
1255
|
+
r,
|
|
1256
|
+
z((a) => {
|
|
1257
|
+
t.set({ skinTone: a });
|
|
1258
|
+
}, []),
|
|
1259
|
+
n
|
|
1260
|
+
];
|
|
1261
|
+
}
|
|
1262
|
+
function lt(e, t) {
|
|
1263
|
+
if (Object.is(e, t)) return !0;
|
|
1264
|
+
if (typeof e != "object" || typeof t != "object" || e === null || t === null || Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1265
|
+
let r = Object.keys(e), n = Object.keys(t);
|
|
1266
|
+
return r.length !== n.length ? !1 : r.every((a) => a in t && e[a] === t[a]);
|
|
1267
|
+
}
|
|
1268
|
+
function _o(...e) {
|
|
1269
|
+
}
|
|
1270
|
+
function Co(e, t) {
|
|
1271
|
+
let r = null;
|
|
1272
|
+
if (typeof window.requestIdleCallback == "function") r = window.requestIdleCallback(e, t);
|
|
1273
|
+
else {
|
|
1274
|
+
let n = Date.now();
|
|
1275
|
+
r = window.setTimeout(() => {
|
|
1276
|
+
e({
|
|
1277
|
+
didTimeout: !1,
|
|
1278
|
+
timeRemaining: () => Math.max(0, (t?.timeout ?? 50) - (Date.now() - n))
|
|
1279
|
+
});
|
|
1280
|
+
}, 10);
|
|
1281
|
+
}
|
|
1282
|
+
return () => {
|
|
1283
|
+
typeof window.cancelIdleCallback == "function" ? window.cancelIdleCallback(r) : window.clearTimeout(r);
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
var X = typeof window < "u" ? nn : te;
|
|
1287
|
+
function cr(e) {
|
|
1288
|
+
let t = U(e);
|
|
1289
|
+
return X(() => {
|
|
1290
|
+
t.current = e;
|
|
1291
|
+
}), z((...r) => t.current(...r), []);
|
|
1292
|
+
}
|
|
1293
|
+
function Eo({ emojiVersion: e, emojibaseUrl: t, resolveEmojiData: r = We }) {
|
|
1294
|
+
let [n, a] = K(void 0), o = q(), s = ee(o, "locale"), c = ee(o, "columns"), l = ee(o, "skinTone"), u = ee(o, "search"), h = cr((d, g) => r === We ? We(d, g) : Un(r, d, g));
|
|
1295
|
+
return te(() => {
|
|
1296
|
+
let d = new AbortController(), g = d.signal;
|
|
1297
|
+
return Promise.resolve().then(() => h(s, {
|
|
1298
|
+
emojiVersion: e,
|
|
1299
|
+
emojibaseUrl: t,
|
|
1300
|
+
signal: g
|
|
1301
|
+
})).then((m) => {
|
|
1302
|
+
g.aborted || a(m);
|
|
1303
|
+
}).catch((m) => {
|
|
1304
|
+
g.aborted || console.error(m);
|
|
1305
|
+
}), () => {
|
|
1306
|
+
d.abort();
|
|
1307
|
+
};
|
|
1308
|
+
}, [
|
|
1309
|
+
e,
|
|
1310
|
+
t,
|
|
1311
|
+
s,
|
|
1312
|
+
h
|
|
1313
|
+
]), te(() => {
|
|
1314
|
+
if (n) return Co(() => {
|
|
1315
|
+
o.get().onDataChange(ro(n, c, l, u));
|
|
1316
|
+
}, { timeout: 100 });
|
|
1317
|
+
}, [
|
|
1318
|
+
n,
|
|
1319
|
+
c,
|
|
1320
|
+
l,
|
|
1321
|
+
u
|
|
1322
|
+
]), null;
|
|
1323
|
+
}
|
|
1324
|
+
var ur = xe(({ locale: e = "en", columns: t = 9, skinTone: r = "none", onEmojiSelect: n = _o, emojiVersion: a, emojibaseUrl: o, resolveEmojiData: s, onFocusCapture: c, onBlurCapture: l, children: u, style: h, sticky: d = !0, ...g }, m) => {
|
|
1325
|
+
let p = cr(n), b = oo(() => io(p, e, t, d, bt(r))), [y, w] = K(!1), v = U(null), j = z((f) => {
|
|
1326
|
+
f && (v.current = f, b.set({ rootRef: v }));
|
|
1327
|
+
}, []);
|
|
1328
|
+
X(() => {
|
|
1329
|
+
b.set({ locale: e });
|
|
1330
|
+
}, [e]), X(() => {
|
|
1331
|
+
b.set({ columns: t });
|
|
1332
|
+
}, [t]), X(() => {
|
|
1333
|
+
b.set({ sticky: d });
|
|
1334
|
+
}, [d]), X(() => {
|
|
1335
|
+
b.set({ skinTone: bt(r) });
|
|
1336
|
+
}, [r]);
|
|
1337
|
+
let k = z((f) => {
|
|
1338
|
+
c?.(f);
|
|
1339
|
+
let { searchRef: E, viewportRef: _ } = b.get(), T = f.target === E?.current || f.target.hasAttribute("frimousse-search"), H = f.target === _?.current || f.target.hasAttribute("frimousse-viewport");
|
|
1340
|
+
f.isDefaultPrevented() || (w(T || H), f.isDefaultPrevented() || (w(T || H), H ? b.get().onActiveEmojiChange("keyboard", 0, 0) : T && b.get().search === "" && b.set({ interaction: "none" })));
|
|
1341
|
+
}, [c]), C = z((f) => {
|
|
1342
|
+
l?.(f), !f.isDefaultPrevented() && !f.currentTarget.contains(f.relatedTarget) && w(!1);
|
|
1343
|
+
}, [l]);
|
|
1344
|
+
return X(() => {
|
|
1345
|
+
y || b.get().onActiveEmojiReset();
|
|
1346
|
+
}, [y]), qe(m, () => v.current), te(() => {
|
|
1347
|
+
if (!y) return;
|
|
1348
|
+
function f(E) {
|
|
1349
|
+
if (E.defaultPrevented || !E.key.startsWith("Arrow") && E.key !== "Enter") return;
|
|
1350
|
+
let { data: _, onEmojiSelect: T, onActiveEmojiChange: H, interaction: M, activeColumnIndex: O, activeRowIndex: $ } = b.get();
|
|
1351
|
+
if (E.key === "Enter") {
|
|
1352
|
+
let x = it(b.get());
|
|
1353
|
+
x && (E.preventDefault(), T(x));
|
|
1354
|
+
}
|
|
1355
|
+
if (E.key.startsWith("Arrow")) {
|
|
1356
|
+
let x = O, R = $;
|
|
1357
|
+
if (E.preventDefault(), M !== "none") {
|
|
1358
|
+
if (_?.rows && _.rows.length > 0) switch (E.key) {
|
|
1359
|
+
case "ArrowLeft":
|
|
1360
|
+
if (x === 0) {
|
|
1361
|
+
let A = R - 1, re = _.rows[A];
|
|
1362
|
+
re && (R = A, x = re.emojis.length - 1);
|
|
1363
|
+
} else x -= 1;
|
|
1364
|
+
break;
|
|
1365
|
+
case "ArrowRight":
|
|
1366
|
+
if (x === _.rows[R].emojis.length - 1) {
|
|
1367
|
+
let A = R + 1;
|
|
1368
|
+
_.rows[A] && (R = A, x = 0);
|
|
1369
|
+
} else x += 1;
|
|
1370
|
+
break;
|
|
1371
|
+
case "ArrowUp": {
|
|
1372
|
+
let A = _.rows[R - 1];
|
|
1373
|
+
A && (R -= 1, A.emojis[x] || (x = A.emojis.length - 1));
|
|
1374
|
+
break;
|
|
1375
|
+
}
|
|
1376
|
+
case "ArrowDown": {
|
|
1377
|
+
let A = _.rows[R + 1];
|
|
1378
|
+
A && (R += 1, A.emojis[x] || (x = A.emojis.length - 1));
|
|
1379
|
+
break;
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
H("keyboard", x, R);
|
|
1383
|
+
} else H("keyboard", 0, 0);
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
return document.addEventListener("keydown", f), () => {
|
|
1387
|
+
document.removeEventListener("keydown", f);
|
|
1388
|
+
};
|
|
1389
|
+
}, [y]), X(() => {
|
|
1390
|
+
let f = null, E = null, _ = null, T = null, H = b.subscribe((R) => {
|
|
1391
|
+
v.current && (f !== R.viewportWidth && (f = R.viewportWidth, v.current.style.setProperty("--frimousse-viewport-width", `${R.viewportWidth}px`)), E !== R.viewportHeight && (E = R.viewportHeight, v.current.style.setProperty("--frimousse-viewport-height", `${R.viewportHeight}px`)), _ !== R.rowHeight && (_ = R.rowHeight, v.current.style.setProperty("--frimousse-row-height", `${R.rowHeight}px`)), T !== R.categoryHeaderHeight && (T = R.categoryHeaderHeight, v.current.style.setProperty("--frimousse-category-header-height", `${R.categoryHeaderHeight}px`)));
|
|
1392
|
+
}), { viewportWidth: M, viewportHeight: O, rowHeight: $, categoryHeaderHeight: x } = b.get();
|
|
1393
|
+
return M && v.current.style.setProperty("--frimousse-viewport-width", `${M}px`), O && v.current.style.setProperty("--frimousse-viewport-height", `${O}px`), $ && v.current.style.setProperty("--frimousse-row-height", `${$}px`), x && v.current.style.setProperty("--frimousse-category-header-height", `${x}px`), H;
|
|
1394
|
+
}, []), i("div", {
|
|
1395
|
+
"data-focused": y ? "" : void 0,
|
|
1396
|
+
"frimousse-root": "",
|
|
1397
|
+
onBlurCapture: C,
|
|
1398
|
+
onFocusCapture: k,
|
|
1399
|
+
...g,
|
|
1400
|
+
ref: j,
|
|
1401
|
+
style: {
|
|
1402
|
+
"--frimousse-emoji-font": Gt,
|
|
1403
|
+
...h
|
|
1404
|
+
},
|
|
1405
|
+
children: I(lo, {
|
|
1406
|
+
store: b,
|
|
1407
|
+
children: [i(Eo, {
|
|
1408
|
+
emojibaseUrl: o,
|
|
1409
|
+
emojiVersion: a,
|
|
1410
|
+
resolveEmojiData: s
|
|
1411
|
+
}), u]
|
|
1412
|
+
})
|
|
1413
|
+
});
|
|
1414
|
+
}), dr = xe(({ value: e, defaultValue: t, onChange: r, ...n }, a) => {
|
|
1415
|
+
let o = q(), s = U(null), c = z((d) => {
|
|
1416
|
+
d && (s.current = d, o.set({ searchRef: s }));
|
|
1417
|
+
}, []), l = typeof e == "string", u = U(l);
|
|
1418
|
+
te(() => {
|
|
1419
|
+
process.env.NODE_ENV !== "production" && u.current !== l && console.warn(`EmojiPicker.Search is changing from ${u ? "controlled" : "uncontrolled"} to ${l ? "controlled" : "uncontrolled"}.`), u.current = l;
|
|
1420
|
+
}, [l]), X(() => {
|
|
1421
|
+
o.set({ search: typeof e == "string" ? e : typeof t == "string" ? t : "" });
|
|
1422
|
+
}, []), X(() => {
|
|
1423
|
+
typeof e == "string" && o.get().onSearchChange(e);
|
|
1424
|
+
}, [e]);
|
|
1425
|
+
let h = z((d) => {
|
|
1426
|
+
r?.(d), d.isDefaultPrevented() || o.get().onSearchChange(d.target.value);
|
|
1427
|
+
}, [r]);
|
|
1428
|
+
return qe(a, () => s.current), i("input", {
|
|
1429
|
+
autoCapitalize: "off",
|
|
1430
|
+
autoComplete: "off",
|
|
1431
|
+
autoCorrect: "off",
|
|
1432
|
+
enterKeyHint: "done",
|
|
1433
|
+
"frimousse-search": "",
|
|
1434
|
+
placeholder: "Search…",
|
|
1435
|
+
spellCheck: !1,
|
|
1436
|
+
type: "search",
|
|
1437
|
+
...n,
|
|
1438
|
+
defaultValue: t,
|
|
1439
|
+
onChange: h,
|
|
1440
|
+
ref: c,
|
|
1441
|
+
value: e
|
|
1442
|
+
});
|
|
1443
|
+
}), So = De(() => {
|
|
1444
|
+
let e = lr();
|
|
1445
|
+
return e ? i("div", {
|
|
1446
|
+
"aria-live": "polite",
|
|
1447
|
+
style: {
|
|
1448
|
+
border: 0,
|
|
1449
|
+
clip: "rect(0, 0, 0, 0)",
|
|
1450
|
+
height: 1,
|
|
1451
|
+
margin: -1,
|
|
1452
|
+
overflow: "hidden",
|
|
1453
|
+
padding: 0,
|
|
1454
|
+
position: "absolute",
|
|
1455
|
+
whiteSpace: "nowrap",
|
|
1456
|
+
width: 1,
|
|
1457
|
+
wordWrap: "normal"
|
|
1458
|
+
},
|
|
1459
|
+
children: e.label
|
|
1460
|
+
}) : null;
|
|
1461
|
+
}), mr = xe(({ children: e, onScroll: t, onKeyDown: r, style: n, ...a }, o) => {
|
|
1462
|
+
let s = q(), c = U(null), l = z((g) => {
|
|
1463
|
+
g && (c.current = g, s.set({ viewportRef: c }));
|
|
1464
|
+
}, []), u = W(s, ar), h = W(s, mo), d = z((g) => {
|
|
1465
|
+
t?.(g), s.get().onViewportScroll(g.currentTarget.scrollTop);
|
|
1466
|
+
}, [t]);
|
|
1467
|
+
return X(() => {
|
|
1468
|
+
if (!c.current) return;
|
|
1469
|
+
let g = new ResizeObserver(([m]) => {
|
|
1470
|
+
let p = m?.borderBoxSize[0]?.inlineSize ?? 0, b = m?.borderBoxSize[0]?.blockSize ?? 0, { onViewportSizeChange: y, viewportHeight: w, viewportWidth: v } = s.get();
|
|
1471
|
+
(w !== b || v !== p) && y(p, b);
|
|
1472
|
+
});
|
|
1473
|
+
return g.observe(c.current), s.get().onViewportSizeChange(c.current.offsetWidth, c.current.clientHeight), () => {
|
|
1474
|
+
g.disconnect();
|
|
1475
|
+
};
|
|
1476
|
+
}, []), qe(o, () => c.current), I("div", {
|
|
1477
|
+
"frimousse-viewport": "",
|
|
1478
|
+
...a,
|
|
1479
|
+
onScroll: d,
|
|
1480
|
+
ref: l,
|
|
1481
|
+
style: {
|
|
1482
|
+
position: "relative",
|
|
1483
|
+
boxSizing: "border-box",
|
|
1484
|
+
contain: "layout paint",
|
|
1485
|
+
containIntrinsicSize: typeof u == "number" && typeof h == "number" ? `var(--frimousse-viewport-width, auto) calc(${u} * var(--frimousse-row-height) + ${h} * var(--frimousse-category-header-height))` : void 0,
|
|
1486
|
+
overflowY: "auto",
|
|
1487
|
+
overscrollBehavior: "contain",
|
|
1488
|
+
scrollbarGutter: "stable",
|
|
1489
|
+
willChange: "scroll-position",
|
|
1490
|
+
...n
|
|
1491
|
+
},
|
|
1492
|
+
children: [i(So, {}), e]
|
|
1493
|
+
});
|
|
1494
|
+
});
|
|
1495
|
+
function hr(e, t, r) {
|
|
1496
|
+
return {
|
|
1497
|
+
emoji: {
|
|
1498
|
+
...e,
|
|
1499
|
+
isActive: r
|
|
1500
|
+
},
|
|
1501
|
+
role: "gridcell",
|
|
1502
|
+
"aria-colindex": t,
|
|
1503
|
+
"aria-selected": r || void 0,
|
|
1504
|
+
"aria-label": e.label,
|
|
1505
|
+
"data-active": r ? "" : void 0,
|
|
1506
|
+
"frimousse-emoji": "",
|
|
1507
|
+
style: { fontFamily: "var(--frimousse-emoji-font)" },
|
|
1508
|
+
tabIndex: -1
|
|
1509
|
+
};
|
|
1510
|
+
}
|
|
1511
|
+
function gr(e, t = !1) {
|
|
1512
|
+
return {
|
|
1513
|
+
role: t ? void 0 : "row",
|
|
1514
|
+
"aria-rowindex": t ? void 0 : e,
|
|
1515
|
+
"frimousse-row": "",
|
|
1516
|
+
style: {
|
|
1517
|
+
contain: t ? void 0 : "content",
|
|
1518
|
+
height: t ? void 0 : "var(--frimousse-row-height)",
|
|
1519
|
+
display: "flex"
|
|
1520
|
+
}
|
|
1521
|
+
};
|
|
1522
|
+
}
|
|
1523
|
+
function fr(e, t) {
|
|
1524
|
+
return {
|
|
1525
|
+
"frimousse-category": "",
|
|
1526
|
+
style: {
|
|
1527
|
+
contain: "content",
|
|
1528
|
+
top: t ? `calc(${e} * var(--frimousse-category-header-height) + ${t.startRowIndex} * var(--frimousse-row-height))` : void 0,
|
|
1529
|
+
height: t ? `calc(var(--frimousse-category-header-height) + ${t.rowsCount} * var(--frimousse-row-height))` : void 0,
|
|
1530
|
+
width: "100%",
|
|
1531
|
+
pointerEvents: "none",
|
|
1532
|
+
position: "absolute"
|
|
1533
|
+
}
|
|
1534
|
+
};
|
|
1535
|
+
}
|
|
1536
|
+
function vr(e, t = !1, r = !0) {
|
|
1537
|
+
return {
|
|
1538
|
+
category: e,
|
|
1539
|
+
"frimousse-category-header": "",
|
|
1540
|
+
style: {
|
|
1541
|
+
contain: t ? void 0 : "layout paint",
|
|
1542
|
+
height: t ? void 0 : "var(--frimousse-category-header-height)",
|
|
1543
|
+
pointerEvents: "auto",
|
|
1544
|
+
position: r ? "sticky" : void 0,
|
|
1545
|
+
top: 0
|
|
1546
|
+
}
|
|
1547
|
+
};
|
|
1548
|
+
}
|
|
1549
|
+
function _t(e, t, r, n) {
|
|
1550
|
+
return {
|
|
1551
|
+
"frimousse-list-sizer": "",
|
|
1552
|
+
style: {
|
|
1553
|
+
position: "relative",
|
|
1554
|
+
boxSizing: "border-box",
|
|
1555
|
+
height: `calc(${e} * var(--frimousse-row-height) + ${t} * var(--frimousse-category-header-height))`,
|
|
1556
|
+
paddingTop: `calc(${r} * var(--frimousse-row-height) + ${n} * var(--frimousse-category-header-height))`
|
|
1557
|
+
}
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1560
|
+
function Ct(e, t, r) {
|
|
1561
|
+
return {
|
|
1562
|
+
"aria-colcount": e,
|
|
1563
|
+
"aria-rowcount": t,
|
|
1564
|
+
"frimousse-list": "",
|
|
1565
|
+
style: {
|
|
1566
|
+
"--frimousse-list-columns": e,
|
|
1567
|
+
...r
|
|
1568
|
+
},
|
|
1569
|
+
role: "grid"
|
|
1570
|
+
};
|
|
1571
|
+
}
|
|
1572
|
+
function Io(e) {
|
|
1573
|
+
e.preventDefault();
|
|
1574
|
+
}
|
|
1575
|
+
var jo = De(({ Emoji: e, emoji: t, columnIndex: r, rowIndex: n }) => {
|
|
1576
|
+
let a = q(), o = W(a, (u) => it(u)?.emoji === t.emoji), s = z(() => {
|
|
1577
|
+
a.get().onEmojiSelect(t);
|
|
1578
|
+
}, [t]), c = z(() => {
|
|
1579
|
+
a.get().onActiveEmojiChange("pointer", r, n);
|
|
1580
|
+
}, [r, n]), l = z(() => {
|
|
1581
|
+
a.get().onActiveEmojiReset();
|
|
1582
|
+
}, []);
|
|
1583
|
+
return i(e, {
|
|
1584
|
+
...hr(t, r, o),
|
|
1585
|
+
onClick: s,
|
|
1586
|
+
onPointerDown: Io,
|
|
1587
|
+
onPointerEnter: c,
|
|
1588
|
+
onPointerLeave: l
|
|
1589
|
+
});
|
|
1590
|
+
}), ko = De(({ Row: e, Emoji: t, rowIndex: r }) => {
|
|
1591
|
+
let n = W(q(), (a) => a.data?.rows[r], fo);
|
|
1592
|
+
return n ? i(e, {
|
|
1593
|
+
...gr(r),
|
|
1594
|
+
children: n.emojis.map((a, o) => i(jo, {
|
|
1595
|
+
columnIndex: o,
|
|
1596
|
+
Emoji: t,
|
|
1597
|
+
emoji: a,
|
|
1598
|
+
rowIndex: r
|
|
1599
|
+
}, a.label))
|
|
1600
|
+
}) : null;
|
|
1601
|
+
}), Ro = De(({ CategoryHeader: e, categoryIndex: t }) => {
|
|
1602
|
+
let r = q(), n = W(r, (o) => o.data?.categories[t], lt), a = ee(r, "sticky");
|
|
1603
|
+
return n ? i("div", {
|
|
1604
|
+
...fr(t, n),
|
|
1605
|
+
children: i(e, { ...vr({ label: n.label }, !1, a) })
|
|
1606
|
+
}) : null;
|
|
1607
|
+
}), Et = De(({ CategoryHeader: e, Row: t, Emoji: r }) => {
|
|
1608
|
+
let n = U(null), a = q(), o = ee(a, "columns"), s = me(() => Array(o).fill({
|
|
1609
|
+
emoji: "🙂",
|
|
1610
|
+
label: ""
|
|
1611
|
+
}), [o]), c = me(() => ({ label: "Category" }), []), l = U(null), u = U(null);
|
|
1612
|
+
return X(() => {
|
|
1613
|
+
let h = n.current?.parentElement?.parentElement;
|
|
1614
|
+
if (!h || !l.current || !u.current) return;
|
|
1615
|
+
let d = new ResizeObserver((p) => {
|
|
1616
|
+
for (let b of p) {
|
|
1617
|
+
let y = b.contentRect.height, { onRowHeightChange: w, onCategoryHeaderHeightChange: v, rowHeight: j, categoryHeaderHeight: k } = a.get();
|
|
1618
|
+
b.target === l.current && j !== y && w(y), b.target === u.current && k !== y && v(y);
|
|
1619
|
+
}
|
|
1620
|
+
});
|
|
1621
|
+
d.observe(h), d.observe(l.current), d.observe(u.current);
|
|
1622
|
+
let { onRowHeightChange: g, onCategoryHeaderHeightChange: m } = a.get();
|
|
1623
|
+
return g(l.current.clientHeight), m(u.current.clientHeight), () => {
|
|
1624
|
+
d.disconnect();
|
|
1625
|
+
};
|
|
1626
|
+
}, []), I("div", {
|
|
1627
|
+
"aria-hidden": !0,
|
|
1628
|
+
ref: n,
|
|
1629
|
+
style: {
|
|
1630
|
+
height: 0,
|
|
1631
|
+
visibility: "hidden"
|
|
1632
|
+
},
|
|
1633
|
+
children: [i("div", {
|
|
1634
|
+
"frimousse-row-sizer": "",
|
|
1635
|
+
ref: l,
|
|
1636
|
+
children: i(t, {
|
|
1637
|
+
...gr(-1, !0),
|
|
1638
|
+
children: s.map((h, d) => i(r, { ...hr(h, d, !1) }, d))
|
|
1639
|
+
})
|
|
1640
|
+
}), i("div", {
|
|
1641
|
+
...fr(-1),
|
|
1642
|
+
children: i("div", {
|
|
1643
|
+
"frimousse-category-header-sizer": "",
|
|
1644
|
+
ref: u,
|
|
1645
|
+
children: i(e, { ...vr(c, !0) })
|
|
1646
|
+
})
|
|
1647
|
+
})]
|
|
1648
|
+
});
|
|
1649
|
+
});
|
|
1650
|
+
function No({ category: e, ...t }) {
|
|
1651
|
+
return i("div", {
|
|
1652
|
+
...t,
|
|
1653
|
+
children: e.label
|
|
1654
|
+
});
|
|
1655
|
+
}
|
|
1656
|
+
function To({ emoji: e, ...t }) {
|
|
1657
|
+
return i("button", {
|
|
1658
|
+
type: "button",
|
|
1659
|
+
...t,
|
|
1660
|
+
children: e.emoji
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
function Po({ ...e }) {
|
|
1664
|
+
return i("div", { ...e });
|
|
1665
|
+
}
|
|
1666
|
+
var pr = xe(({ style: e, components: t, ...r }, n) => {
|
|
1667
|
+
let a = q(), o = U(null), s = z((w) => {
|
|
1668
|
+
w && (o.current = w, a.set({ listRef: o }));
|
|
1669
|
+
}, []), c = t?.CategoryHeader ?? No, l = t?.Emoji ?? To, u = t?.Row ?? Po, h = ee(a, "columns"), d = ee(a, "viewportStartRowIndex"), g = ee(a, "viewportEndRowIndex"), m = W(a, ar), p = W(a, ho, lt), b = me(() => p?.filter((w) => w < d).length ?? 0, [p, d]), y = p?.length ?? 0;
|
|
1670
|
+
return qe(n, () => o.current), !m || !p || y === 0 ? i("div", {
|
|
1671
|
+
...Ct(h, 0, e),
|
|
1672
|
+
...r,
|
|
1673
|
+
children: i("div", {
|
|
1674
|
+
..._t(0, 0, 0, 0),
|
|
1675
|
+
children: i(Et, {
|
|
1676
|
+
CategoryHeader: c,
|
|
1677
|
+
Emoji: l,
|
|
1678
|
+
Row: u
|
|
1679
|
+
})
|
|
1680
|
+
})
|
|
1681
|
+
}) : i("div", {
|
|
1682
|
+
...Ct(h, m, e),
|
|
1683
|
+
...r,
|
|
1684
|
+
ref: s,
|
|
1685
|
+
children: I("div", {
|
|
1686
|
+
..._t(m, y, d, b),
|
|
1687
|
+
children: [
|
|
1688
|
+
i(Et, {
|
|
1689
|
+
CategoryHeader: c,
|
|
1690
|
+
Emoji: l,
|
|
1691
|
+
Row: u
|
|
1692
|
+
}),
|
|
1693
|
+
Array.from({ length: g - d + 1 }, (w, v) => {
|
|
1694
|
+
let j = d + v;
|
|
1695
|
+
return I(Xr, { children: [p.indexOf(j) >= 0 && i("div", { style: { height: "var(--frimousse-category-header-height)" } }), i(ko, {
|
|
1696
|
+
Emoji: l,
|
|
1697
|
+
Row: u,
|
|
1698
|
+
rowIndex: j
|
|
1699
|
+
})] }, j);
|
|
1700
|
+
}),
|
|
1701
|
+
Array.from({ length: y }, (w, v) => i(Ro, {
|
|
1702
|
+
CategoryHeader: c,
|
|
1703
|
+
categoryIndex: v
|
|
1704
|
+
}, v))
|
|
1705
|
+
]
|
|
1706
|
+
})
|
|
1707
|
+
});
|
|
1708
|
+
}), br = xe(({ emoji: e, onClick: t, "aria-label": r = "Change skin tone", ...n }, a) => {
|
|
1709
|
+
let o = W(q(), go, lt), [s, c, l] = sr(e), u = me(() => Math.max(0, l.findIndex((p) => p.skinTone === s)), [s, l]), h = l[u], d = l[(u + 1) % l.length].skinTone, g = d === "none" ? void 0 : o?.[d], m = z((p) => {
|
|
1710
|
+
t?.(p), p.isDefaultPrevented() || c(d);
|
|
1711
|
+
}, [
|
|
1712
|
+
t,
|
|
1713
|
+
c,
|
|
1714
|
+
d
|
|
1715
|
+
]);
|
|
1716
|
+
return i("button", {
|
|
1717
|
+
type: "button",
|
|
1718
|
+
...n,
|
|
1719
|
+
"aria-label": r + (g ? ` (${g})` : ""),
|
|
1720
|
+
"aria-live": "polite",
|
|
1721
|
+
"frimousse-skin-tone-selector": "",
|
|
1722
|
+
onClick: m,
|
|
1723
|
+
ref: a,
|
|
1724
|
+
children: h.emoji
|
|
1725
|
+
});
|
|
1726
|
+
});
|
|
1727
|
+
function yr({ children: e, ...t }) {
|
|
1728
|
+
return W(q(), uo) ? i("span", {
|
|
1729
|
+
"frimousse-loading": "",
|
|
1730
|
+
...t,
|
|
1731
|
+
children: e
|
|
1732
|
+
}) : null;
|
|
1733
|
+
}
|
|
1734
|
+
function xo({ children: e }) {
|
|
1735
|
+
return e({ search: W(q(), so) });
|
|
1736
|
+
}
|
|
1737
|
+
function wr({ children: e, ...t }) {
|
|
1738
|
+
return W(q(), co) ? i("span", {
|
|
1739
|
+
"frimousse-empty": "",
|
|
1740
|
+
...t,
|
|
1741
|
+
children: typeof e == "function" ? i(xo, { children: e }) : e
|
|
1742
|
+
}) : null;
|
|
1743
|
+
}
|
|
1744
|
+
function _r({ children: e }) {
|
|
1745
|
+
return e({ emoji: lr() });
|
|
1746
|
+
}
|
|
1747
|
+
function Cr({ children: e, emoji: t }) {
|
|
1748
|
+
let [r, n, a] = sr(t);
|
|
1749
|
+
return e({
|
|
1750
|
+
skinTone: r,
|
|
1751
|
+
setSkinTone: n,
|
|
1752
|
+
skinToneVariations: a
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
1755
|
+
ur.displayName = "EmojiPicker.Root";
|
|
1756
|
+
dr.displayName = "EmojiPicker.Search";
|
|
1757
|
+
mr.displayName = "EmojiPicker.Viewport";
|
|
1758
|
+
pr.displayName = "EmojiPicker.List";
|
|
1759
|
+
yr.displayName = "EmojiPicker.Loading";
|
|
1760
|
+
wr.displayName = "EmojiPicker.Empty";
|
|
1761
|
+
br.displayName = "EmojiPicker.SkinToneSelector";
|
|
1762
|
+
_r.displayName = "EmojiPicker.ActiveEmoji";
|
|
1763
|
+
Cr.displayName = "EmojiPicker.SkinTone";
|
|
1764
|
+
var Do = "_root_1elk3_1", Oo = "_search_1elk3_29", Ao = "_viewport_1elk3_33", Ho = "_message_1elk3_42", Se = {
|
|
1765
|
+
root: Do,
|
|
1766
|
+
search: Oo,
|
|
1767
|
+
viewport: Ao,
|
|
1768
|
+
message: Ho
|
|
1769
|
+
}, $o = ({ emoji: e, "aria-colindex": t, ...r }) => /* @__PURE__ */ i("button", {
|
|
1770
|
+
...r,
|
|
1771
|
+
type: "button",
|
|
1772
|
+
role: "gridcell",
|
|
1773
|
+
"aria-colindex": S(t) ? t + 1 : void 0,
|
|
1774
|
+
children: e.emoji
|
|
1775
|
+
}), Mo = ({ "aria-rowindex": e, ...t }) => /* @__PURE__ */ i("div", {
|
|
1776
|
+
...t,
|
|
1777
|
+
"aria-rowindex": S(e) ? e + 1 : void 0
|
|
1778
|
+
}), Fo = "[frimousse-viewport]", Vo = "[frimousse-emoji][data-active]", Lo = "--frimousse-category-header-height", zo = (e) => {
|
|
1779
|
+
const t = e.querySelector(Fo), r = t?.querySelector(Vo);
|
|
1780
|
+
if (!S(t) || !S(r)) return;
|
|
1781
|
+
const n = t.getBoundingClientRect(), a = r.getBoundingClientRect(), o = Number.parseFloat(getComputedStyle(t).getPropertyValue(Lo)), s = a.top - n.top - o;
|
|
1782
|
+
if (s < 0) {
|
|
1783
|
+
t.scrollTop += s;
|
|
1784
|
+
return;
|
|
1785
|
+
}
|
|
1786
|
+
const c = a.bottom - n.bottom;
|
|
1787
|
+
c > 0 && (t.scrollTop += c);
|
|
1788
|
+
}, Uo = P("Arrow"), St = P("keydown"), It = P("pointerover"), Yo = ({ rootRef: e }) => (te(() => {
|
|
1789
|
+
const t = e.current;
|
|
1790
|
+
if (!S(t)) return;
|
|
1791
|
+
let r;
|
|
1792
|
+
const n = () => {
|
|
1793
|
+
S(r) && (cancelAnimationFrame(r), r = void 0);
|
|
1794
|
+
}, a = (o) => {
|
|
1795
|
+
o.defaultPrevented || !o.key.startsWith(Uo) || (n(), r = requestAnimationFrame(() => {
|
|
1796
|
+
r = requestAnimationFrame(() => {
|
|
1797
|
+
r = void 0, zo(t);
|
|
1798
|
+
});
|
|
1799
|
+
}));
|
|
1800
|
+
};
|
|
1801
|
+
return t.addEventListener(St, a, !0), t.addEventListener(It, n, !0), () => {
|
|
1802
|
+
n(), t.removeEventListener(St, a, !0), t.removeEventListener(It, n, !0);
|
|
1803
|
+
};
|
|
1804
|
+
}, [e]), null), qo = 8, wi = ({ emojibaseUrl: e, locale: t = "en", searchLabel: r, searchPlaceholder: n = r, loadingLabel: a, emptyLabel: o, onEmojiSelect: s, autoFocus: c = !1, className: l, ref: u, ...h }) => {
|
|
1805
|
+
const d = U(null), g = xt(d, u);
|
|
1806
|
+
return /* @__PURE__ */ I(ce.Root, {
|
|
1807
|
+
...h,
|
|
1808
|
+
ref: g,
|
|
1809
|
+
className: G(Se.root, l),
|
|
1810
|
+
emojibaseUrl: e,
|
|
1811
|
+
locale: t,
|
|
1812
|
+
columns: qo,
|
|
1813
|
+
onEmojiSelect: ({ emoji: m }) => s(m),
|
|
1814
|
+
children: [
|
|
1815
|
+
/* @__PURE__ */ i("div", {
|
|
1816
|
+
className: Se.search,
|
|
1817
|
+
children: /* @__PURE__ */ i(Nt, {
|
|
1818
|
+
render: /* @__PURE__ */ i(ce.Search, {}),
|
|
1819
|
+
"aria-label": r,
|
|
1820
|
+
placeholder: n,
|
|
1821
|
+
autoFocus: c
|
|
1822
|
+
})
|
|
1823
|
+
}),
|
|
1824
|
+
/* @__PURE__ */ I(ce.Viewport, {
|
|
1825
|
+
className: Se.viewport,
|
|
1826
|
+
tabIndex: 0,
|
|
1827
|
+
children: [
|
|
1828
|
+
/* @__PURE__ */ i(ce.Loading, {
|
|
1829
|
+
className: Se.message,
|
|
1830
|
+
children: a
|
|
1831
|
+
}),
|
|
1832
|
+
/* @__PURE__ */ i(ce.Empty, {
|
|
1833
|
+
className: Se.message,
|
|
1834
|
+
children: o
|
|
1835
|
+
}),
|
|
1836
|
+
/* @__PURE__ */ i(ce.List, { components: {
|
|
1837
|
+
Row: Mo,
|
|
1838
|
+
Emoji: $o
|
|
1839
|
+
} })
|
|
1840
|
+
]
|
|
1841
|
+
}),
|
|
1842
|
+
/* @__PURE__ */ i(Yo, { rootRef: d })
|
|
1843
|
+
]
|
|
1844
|
+
});
|
|
1845
|
+
}, Bo = "_root_138q3_1", Go = "_surface_138q3_17", Wo = "_icon_138q3_28", Ko = "_label_138q3_35", Jo = "_content_138q3_42", Xo = "_trailing_138q3_53", Zo = "_divider_138q3_60", ie = {
|
|
1846
|
+
root: Bo,
|
|
1847
|
+
surface: Go,
|
|
1848
|
+
icon: Wo,
|
|
1849
|
+
label: Ko,
|
|
1850
|
+
content: Jo,
|
|
1851
|
+
trailing: Xo,
|
|
1852
|
+
divider: Zo
|
|
1853
|
+
}, _i = ({ label: e, startIcon: t, trailing: r, trailingProps: n, children: a, labelWidth: o = 80, isHoverable: s = !1, hasDivider: c = !0, render: l, ref: u, className: h, style: d, ...g }) => {
|
|
1854
|
+
const m = {
|
|
1855
|
+
"--form-field-row-label-width": Pt(o) ? `${o}px` : o,
|
|
1856
|
+
...d
|
|
1857
|
+
};
|
|
1858
|
+
return Te({
|
|
1859
|
+
render: l,
|
|
1860
|
+
ref: u,
|
|
1861
|
+
props: {
|
|
1862
|
+
role: "group",
|
|
1863
|
+
"aria-label": e,
|
|
1864
|
+
...g,
|
|
1865
|
+
"data-clickable": S(g.onClick) || void 0,
|
|
1866
|
+
"data-hoverable": s || void 0,
|
|
1867
|
+
className: G(ie.root, h),
|
|
1868
|
+
style: m,
|
|
1869
|
+
children: /* @__PURE__ */ I(Z, { children: [/* @__PURE__ */ I("div", {
|
|
1870
|
+
className: ie.surface,
|
|
1871
|
+
children: [
|
|
1872
|
+
pe(t) && /* @__PURE__ */ i("span", {
|
|
1873
|
+
className: ie.icon,
|
|
1874
|
+
"aria-hidden": "true",
|
|
1875
|
+
children: t
|
|
1876
|
+
}),
|
|
1877
|
+
pe(e) && /* @__PURE__ */ i(Ur, {
|
|
1878
|
+
render: /* @__PURE__ */ i("span", {}),
|
|
1879
|
+
className: ie.label,
|
|
1880
|
+
size: "md",
|
|
1881
|
+
weight: "regular",
|
|
1882
|
+
color: "tertiary",
|
|
1883
|
+
"aria-hidden": "true",
|
|
1884
|
+
children: e
|
|
1885
|
+
}),
|
|
1886
|
+
/* @__PURE__ */ i("div", {
|
|
1887
|
+
className: ie.content,
|
|
1888
|
+
children: a
|
|
1889
|
+
}),
|
|
1890
|
+
pe(r) && /* @__PURE__ */ i("div", {
|
|
1891
|
+
...n,
|
|
1892
|
+
className: G(ie.trailing, n?.className),
|
|
1893
|
+
children: r
|
|
1894
|
+
})
|
|
1895
|
+
]
|
|
1896
|
+
}), c && /* @__PURE__ */ i(Yr, {
|
|
1897
|
+
className: ie.divider,
|
|
1898
|
+
"aria-hidden": "true"
|
|
1899
|
+
})] })
|
|
1900
|
+
}
|
|
1901
|
+
});
|
|
1902
|
+
}, Qo = "_root_u3myi_1", ea = "_preview_u3myi_6", ta = "_image_u3myi_35", ra = "_fileInput_u3myi_48", na = "_content_u3myi_58", oa = "_actions_u3myi_67", aa = "_helperText_u3myi_73", ia = "_errorMessage_u3myi_78", ne = {
|
|
1903
|
+
root: Qo,
|
|
1904
|
+
preview: ea,
|
|
1905
|
+
image: ta,
|
|
1906
|
+
fileInput: ra,
|
|
1907
|
+
content: na,
|
|
1908
|
+
actions: oa,
|
|
1909
|
+
helperText: aa,
|
|
1910
|
+
errorMessage: ia
|
|
1911
|
+
}, la = ({ src: e }) => {
|
|
1912
|
+
const t = kt(), [r, n] = K(!1);
|
|
1913
|
+
return !L(e) || r ? /* @__PURE__ */ i(Hr, {
|
|
1914
|
+
size: t.icon.size.lg,
|
|
1915
|
+
"aria-hidden": !0
|
|
1916
|
+
}) : /* @__PURE__ */ i("img", {
|
|
1917
|
+
className: ne.image,
|
|
1918
|
+
src: e,
|
|
1919
|
+
alt: "",
|
|
1920
|
+
onError: () => n(!0)
|
|
1921
|
+
});
|
|
1922
|
+
}, sa = "image/*", Ci = ({ src: e, onFileSelect: t, onRemove: r, onAbort: n, disabled: a = !1, isUploading: o = !1, helperText: s, errorMessage: c, uploadLabel: l = P("Upload"), removeLabel: u = P("Remove"), abortLabel: h = P("Abort"), accept: d = sa, inputRef: g, onChange: m, "aria-describedby": p, className: b, style: y, dir: w, render: v, ref: j, ...k }) => {
|
|
1923
|
+
const C = U(null), f = xt(C, g), E = ae(), _ = `${E}-helper`, T = `${E}-error`, H = L(e), M = L(s), O = L(c), $ = a || !S(t), x = a || !H || !S(r), R = $ || o, A = x || o, re = o && S(n), Y = [
|
|
1924
|
+
p,
|
|
1925
|
+
M && _,
|
|
1926
|
+
O && T
|
|
1927
|
+
].filter(L).join(" ") || void 0, ge = () => {
|
|
1928
|
+
R || C.current?.click();
|
|
1929
|
+
}, D = (B) => {
|
|
1930
|
+
const Oe = B.currentTarget.files?.[0];
|
|
1931
|
+
try {
|
|
1932
|
+
m?.(B);
|
|
1933
|
+
} finally {
|
|
1934
|
+
B.currentTarget.value = "";
|
|
1935
|
+
}
|
|
1936
|
+
R || !S(Oe) || t?.(Oe);
|
|
1937
|
+
};
|
|
1938
|
+
return Te({
|
|
1939
|
+
render: v,
|
|
1940
|
+
ref: j,
|
|
1941
|
+
props: {
|
|
1942
|
+
className: G(ne.root, b),
|
|
1943
|
+
style: y,
|
|
1944
|
+
dir: w,
|
|
1945
|
+
"aria-busy": o || k["aria-busy"],
|
|
1946
|
+
children: /* @__PURE__ */ I(Z, { children: [/* @__PURE__ */ i("button", {
|
|
1947
|
+
className: ne.preview,
|
|
1948
|
+
type: "button",
|
|
1949
|
+
disabled: $,
|
|
1950
|
+
"aria-disabled": o || void 0,
|
|
1951
|
+
"aria-label": l,
|
|
1952
|
+
"aria-describedby": Y,
|
|
1953
|
+
onClick: ge,
|
|
1954
|
+
children: /* @__PURE__ */ i(la, { src: e }, e)
|
|
1955
|
+
}), /* @__PURE__ */ I("div", {
|
|
1956
|
+
className: ne.content,
|
|
1957
|
+
children: [
|
|
1958
|
+
/* @__PURE__ */ I("div", {
|
|
1959
|
+
className: ne.actions,
|
|
1960
|
+
children: [
|
|
1961
|
+
/* @__PURE__ */ i("input", {
|
|
1962
|
+
"aria-label": l,
|
|
1963
|
+
...k,
|
|
1964
|
+
ref: f,
|
|
1965
|
+
className: ne.fileInput,
|
|
1966
|
+
dir: w,
|
|
1967
|
+
children: void 0,
|
|
1968
|
+
dangerouslySetInnerHTML: void 0,
|
|
1969
|
+
type: "file",
|
|
1970
|
+
multiple: !1,
|
|
1971
|
+
value: void 0,
|
|
1972
|
+
defaultValue: void 0,
|
|
1973
|
+
accept: d,
|
|
1974
|
+
disabled: R,
|
|
1975
|
+
"aria-describedby": Y,
|
|
1976
|
+
hidden: !0,
|
|
1977
|
+
onChange: D
|
|
1978
|
+
}),
|
|
1979
|
+
re ? /* @__PURE__ */ i(oe, {
|
|
1980
|
+
type: "button",
|
|
1981
|
+
startIcon: /* @__PURE__ */ i(xr, {}),
|
|
1982
|
+
onClick: n,
|
|
1983
|
+
disabled: a,
|
|
1984
|
+
variant: "outline",
|
|
1985
|
+
children: h
|
|
1986
|
+
}) : /* @__PURE__ */ i(oe, {
|
|
1987
|
+
type: "button",
|
|
1988
|
+
startIcon: /* @__PURE__ */ i(Mr, {}),
|
|
1989
|
+
onClick: ge,
|
|
1990
|
+
disabled: R,
|
|
1991
|
+
focusableWhenDisabled: o && !$,
|
|
1992
|
+
"aria-describedby": Y,
|
|
1993
|
+
variant: "outline",
|
|
1994
|
+
children: l
|
|
1995
|
+
}),
|
|
1996
|
+
/* @__PURE__ */ i(oe, {
|
|
1997
|
+
type: "button",
|
|
1998
|
+
startIcon: /* @__PURE__ */ i($r, {}),
|
|
1999
|
+
onClick: r,
|
|
2000
|
+
disabled: A,
|
|
2001
|
+
focusableWhenDisabled: o && !x,
|
|
2002
|
+
variant: "outline",
|
|
2003
|
+
children: u
|
|
2004
|
+
})
|
|
2005
|
+
]
|
|
2006
|
+
}),
|
|
2007
|
+
M && /* @__PURE__ */ i("span", {
|
|
2008
|
+
className: ne.helperText,
|
|
2009
|
+
id: _,
|
|
2010
|
+
children: s
|
|
2011
|
+
}),
|
|
2012
|
+
O && /* @__PURE__ */ i("span", {
|
|
2013
|
+
className: ne.errorMessage,
|
|
2014
|
+
id: T,
|
|
2015
|
+
role: "alert",
|
|
2016
|
+
children: c
|
|
2017
|
+
})
|
|
2018
|
+
]
|
|
2019
|
+
})] })
|
|
2020
|
+
}
|
|
2021
|
+
});
|
|
2022
|
+
}, ca = "_button_k3e4y_1", ua = { button: ca }, Ei = ({ className: e, emphasis: t = "standard", size: r, variant: n, ...a }) => {
|
|
2023
|
+
const o = ye(Rt), s = r ?? o?.size ?? "sm", c = n ?? o?.variant ?? "ghost";
|
|
2024
|
+
return /* @__PURE__ */ i(oe, {
|
|
2025
|
+
...a,
|
|
2026
|
+
size: s,
|
|
2027
|
+
variant: c,
|
|
2028
|
+
"data-emphasis": t,
|
|
2029
|
+
className: he(ua.button, e)
|
|
2030
|
+
});
|
|
2031
|
+
}, da = "_button_1mfb6_1", ma = { button: da }, Si = ({ className: e, elevated: t = !0, variant: r, ...n }) => {
|
|
2032
|
+
const a = ye(Rt), o = r ?? a?.variant ?? "solid";
|
|
2033
|
+
return /* @__PURE__ */ i(oe, {
|
|
2034
|
+
...n,
|
|
2035
|
+
elevated: t,
|
|
2036
|
+
variant: o,
|
|
2037
|
+
className: he(ma.button, e)
|
|
2038
|
+
});
|
|
2039
|
+
}, et = {
|
|
2040
|
+
maximumFractionDigits: 15,
|
|
2041
|
+
numberingSystem: "latn",
|
|
2042
|
+
useGrouping: "min2"
|
|
2043
|
+
}, ha = ({ nextValue: e, currentValue: t, reason: r }) => r === "input-blur" && ut(e, void 0, et) === ut(t, void 0, et), ga = "_root_17bio_1", fa = "_valueInput_17bio_7", va = "_button_17bio_14", pa = "_icon_17bio_32", fe = {
|
|
2044
|
+
root: ga,
|
|
2045
|
+
valueInput: fa,
|
|
2046
|
+
button: va,
|
|
2047
|
+
icon: pa
|
|
2048
|
+
}, Ii = ({ value: e, defaultValue: t, onValueChange: r, onValueCommitted: n, allowOutOfRange: a = !1, min: o, max: s, step: c = 1, disabled: l, readOnly: u, required: h, name: d, form: g, id: m, showButtons: p = !0, decrementLabel: b = P("Decrease value"), incrementLabel: y = P("Increase value"), className: w, ...v }) => {
|
|
2049
|
+
const [j, k] = Dt({
|
|
2050
|
+
controlled: e,
|
|
2051
|
+
default: t ?? null,
|
|
2052
|
+
name: P("NumberStepper"),
|
|
2053
|
+
state: "value"
|
|
2054
|
+
}), C = an(j), f = (E, _) => {
|
|
2055
|
+
if (E !== C.current) {
|
|
2056
|
+
if (ha({
|
|
2057
|
+
nextValue: E,
|
|
2058
|
+
currentValue: C.current,
|
|
2059
|
+
reason: _.reason
|
|
2060
|
+
})) {
|
|
2061
|
+
_.cancel();
|
|
2062
|
+
return;
|
|
2063
|
+
}
|
|
2064
|
+
r?.(E, _), !_.isCanceled && (C.current = E, k(E));
|
|
2065
|
+
}
|
|
2066
|
+
};
|
|
2067
|
+
return /* @__PURE__ */ I($e.Root, {
|
|
2068
|
+
value: j,
|
|
2069
|
+
onValueChange: f,
|
|
2070
|
+
onValueCommitted: n,
|
|
2071
|
+
min: o,
|
|
2072
|
+
max: s,
|
|
2073
|
+
allowOutOfRange: a,
|
|
2074
|
+
step: c,
|
|
2075
|
+
smallStep: c,
|
|
2076
|
+
largeStep: c,
|
|
2077
|
+
disabled: l,
|
|
2078
|
+
readOnly: u,
|
|
2079
|
+
required: h,
|
|
2080
|
+
name: d,
|
|
2081
|
+
form: g,
|
|
2082
|
+
id: m,
|
|
2083
|
+
format: et,
|
|
2084
|
+
className: fe.root,
|
|
2085
|
+
children: [
|
|
2086
|
+
p && /* @__PURE__ */ i($e.Decrement, {
|
|
2087
|
+
"aria-label": b,
|
|
2088
|
+
render: /* @__PURE__ */ i(oe, {
|
|
2089
|
+
type: "button",
|
|
2090
|
+
size: "sm",
|
|
2091
|
+
className: fe.button,
|
|
2092
|
+
startIcon: /* @__PURE__ */ i("span", {
|
|
2093
|
+
className: fe.icon,
|
|
2094
|
+
children: /* @__PURE__ */ i(Dr, {})
|
|
2095
|
+
})
|
|
2096
|
+
})
|
|
2097
|
+
}),
|
|
2098
|
+
/* @__PURE__ */ i($e.Input, {
|
|
2099
|
+
...v,
|
|
2100
|
+
form: g,
|
|
2101
|
+
className: he(G(Fe.input, Fe.sm, fe.valueInput), w)
|
|
2102
|
+
}),
|
|
2103
|
+
p && /* @__PURE__ */ i($e.Increment, {
|
|
2104
|
+
"aria-label": y,
|
|
2105
|
+
render: /* @__PURE__ */ i(oe, {
|
|
2106
|
+
type: "button",
|
|
2107
|
+
size: "sm",
|
|
2108
|
+
className: fe.button,
|
|
2109
|
+
startIcon: /* @__PURE__ */ i("span", {
|
|
2110
|
+
className: fe.icon,
|
|
2111
|
+
children: /* @__PURE__ */ i(Vr, {})
|
|
2112
|
+
})
|
|
2113
|
+
})
|
|
2114
|
+
})
|
|
2115
|
+
]
|
|
2116
|
+
});
|
|
2117
|
+
}, ba = "_trigger_kh8iq_1", ya = "_triggerFlag_kh8iq_35", wa = "_optionFlag_kh8iq_36", _a = "_chevron_kh8iq_56", Ca = "_selectedCountryLabel_kh8iq_61", Ea = "_options_kh8iq_70", Sa = "_emptyStatus_kh8iq_76", de = {
|
|
2118
|
+
trigger: ba,
|
|
2119
|
+
triggerFlag: ya,
|
|
2120
|
+
optionFlag: wa,
|
|
2121
|
+
chevron: _a,
|
|
2122
|
+
selectedCountryLabel: Ca,
|
|
2123
|
+
options: Ea,
|
|
2124
|
+
emptyStatus: Sa
|
|
2125
|
+
}, Ia = ({ label: e, callingCode: t }) => `${e} (+${t})`, ja = "", ka = "", Ra = ({ label: e, callingCode: t }) => `${e} (${ja}+${t}${ka})`, Na = ({ country: e, normalizedSearch: t, callingCodeSearch: r }) => e.searchLabel.includes(t) || e.searchValue.includes(t) || L(r) && e.callingCode.includes(r), Er = Ye(null), Sr = () => {
|
|
2126
|
+
const e = ye(Er);
|
|
2127
|
+
if (!S(e)) throw new Error(P("PhoneCountryPicker parts require PhoneCountryPicker.Root."));
|
|
2128
|
+
return e;
|
|
2129
|
+
}, Ir = ({ searchLabel: e = P("Search"), listLabel: t = P("Countries"), emptyLabel: r = P("No results"), disabled: n = !1, className: a, render: o, ref: s, ...c }) => {
|
|
2130
|
+
const { countries: l, value: u, onValueChange: h, disabled: d, closeOnSelect: g } = Sr(), m = d || n, p = ae(), [b, y] = K(""), w = be(b).trim(), v = w.startsWith("+") ? w.slice(1) : w, j = l.filter((f) => Na({
|
|
2131
|
+
country: f,
|
|
2132
|
+
normalizedSearch: w,
|
|
2133
|
+
callingCodeSearch: v
|
|
2134
|
+
})), k = j.find((f) => f.value === u), C = S(k) ? [k, ...j.filter((f) => f.value !== u)] : j;
|
|
2135
|
+
return Te({
|
|
2136
|
+
render: o,
|
|
2137
|
+
ref: s,
|
|
2138
|
+
props: {
|
|
2139
|
+
...c,
|
|
2140
|
+
className: G(de.options, a),
|
|
2141
|
+
children: /* @__PURE__ */ I(Z, { children: [
|
|
2142
|
+
/* @__PURE__ */ i(N.Search, {
|
|
2143
|
+
value: b,
|
|
2144
|
+
onValueChange: y,
|
|
2145
|
+
placeholder: e,
|
|
2146
|
+
"aria-label": e,
|
|
2147
|
+
disabled: m
|
|
2148
|
+
}),
|
|
2149
|
+
/* @__PURE__ */ i(N.Separator, {}),
|
|
2150
|
+
/* @__PURE__ */ i(N.Section, {
|
|
2151
|
+
scrollable: !0,
|
|
2152
|
+
children: /* @__PURE__ */ i(N.SelectionGroup, {
|
|
2153
|
+
id: p,
|
|
2154
|
+
"aria-label": t,
|
|
2155
|
+
value: u,
|
|
2156
|
+
onValueChange: h,
|
|
2157
|
+
closeOnSelect: g,
|
|
2158
|
+
children: C.map((f) => {
|
|
2159
|
+
const E = Ia(f);
|
|
2160
|
+
return /* @__PURE__ */ i(N.OptionItem, {
|
|
2161
|
+
value: f.value,
|
|
2162
|
+
"aria-label": E,
|
|
2163
|
+
disabled: m || f.disabled,
|
|
2164
|
+
startIcon: /* @__PURE__ */ i("span", {
|
|
2165
|
+
className: de.optionFlag,
|
|
2166
|
+
"aria-hidden": !0,
|
|
2167
|
+
children: f.flag
|
|
2168
|
+
}),
|
|
2169
|
+
children: /* @__PURE__ */ i(rt, {
|
|
2170
|
+
text: /* @__PURE__ */ I(Z, { children: [
|
|
2171
|
+
f.label,
|
|
2172
|
+
" (",
|
|
2173
|
+
/* @__PURE__ */ I("bdi", {
|
|
2174
|
+
dir: "ltr",
|
|
2175
|
+
children: ["+", f.callingCode]
|
|
2176
|
+
}),
|
|
2177
|
+
")"
|
|
2178
|
+
] }),
|
|
2179
|
+
tooltipContent: Ra(f)
|
|
2180
|
+
})
|
|
2181
|
+
}, f.value);
|
|
2182
|
+
})
|
|
2183
|
+
})
|
|
2184
|
+
}),
|
|
2185
|
+
/* @__PURE__ */ i(N.Empty, {
|
|
2186
|
+
className: de.emptyStatus,
|
|
2187
|
+
children: Pe(C) ? null : r
|
|
2188
|
+
})
|
|
2189
|
+
] })
|
|
2190
|
+
}
|
|
2191
|
+
});
|
|
2192
|
+
}, jr = ({ children: e, countries: t, value: r, defaultValue: n = null, onValueChange: a, disabled: o = !1, closeOnSelect: s = !0 }) => {
|
|
2193
|
+
const [c, l] = K(n), u = Le(r) ? c : r, h = t.map((d) => ({
|
|
2194
|
+
...d,
|
|
2195
|
+
searchLabel: be(d.label),
|
|
2196
|
+
searchValue: be(d.value)
|
|
2197
|
+
}));
|
|
2198
|
+
return /* @__PURE__ */ i(Er.Provider, {
|
|
2199
|
+
value: {
|
|
2200
|
+
countries: h,
|
|
2201
|
+
value: u,
|
|
2202
|
+
disabled: o,
|
|
2203
|
+
closeOnSelect: s,
|
|
2204
|
+
onValueChange: (d, g) => {
|
|
2205
|
+
a?.(d, g), !g.isCanceled && Le(r) && l(d);
|
|
2206
|
+
}
|
|
2207
|
+
},
|
|
2208
|
+
children: e
|
|
2209
|
+
});
|
|
2210
|
+
}, kr = ({ children: e, disabled: t = !1, className: r, "aria-describedby": n, ...a }) => {
|
|
2211
|
+
const { countries: o, value: s, disabled: c } = Sr(), l = o.find((d) => d.value === s), u = ae(), h = [S(l) && u, n].filter(L).join(" ") || void 0;
|
|
2212
|
+
return /* @__PURE__ */ I(N.Trigger, {
|
|
2213
|
+
...a,
|
|
2214
|
+
disabled: c || t,
|
|
2215
|
+
"aria-describedby": h,
|
|
2216
|
+
className: he(de.trigger, r),
|
|
2217
|
+
children: [e ?? /* @__PURE__ */ I(Z, { children: [/* @__PURE__ */ i("span", {
|
|
2218
|
+
className: de.triggerFlag,
|
|
2219
|
+
"aria-hidden": !0,
|
|
2220
|
+
children: l?.flag ?? /* @__PURE__ */ i(Lr, {})
|
|
2221
|
+
}), /* @__PURE__ */ i(tt, {
|
|
2222
|
+
className: de.chevron,
|
|
2223
|
+
"aria-hidden": !0
|
|
2224
|
+
})] }), S(l) && /* @__PURE__ */ i("span", {
|
|
2225
|
+
id: u,
|
|
2226
|
+
className: de.selectedCountryLabel,
|
|
2227
|
+
children: l.label
|
|
2228
|
+
})]
|
|
2229
|
+
});
|
|
2230
|
+
}, Ta = ({ countries: e, value: t, defaultValue: r, onValueChange: n, disabled: a, closeOnSelect: o, dropdownProps: s, contentProps: c, optionsProps: l, ...u }) => /* @__PURE__ */ i(jr, {
|
|
2231
|
+
countries: e,
|
|
2232
|
+
value: t,
|
|
2233
|
+
defaultValue: r,
|
|
2234
|
+
onValueChange: n,
|
|
2235
|
+
disabled: a,
|
|
2236
|
+
closeOnSelect: o,
|
|
2237
|
+
children: /* @__PURE__ */ I(N.Root, {
|
|
2238
|
+
...s,
|
|
2239
|
+
type: "picker",
|
|
2240
|
+
children: [/* @__PURE__ */ i(kr, { ...u }), /* @__PURE__ */ i(N.Content, {
|
|
2241
|
+
width: 280,
|
|
2242
|
+
...c,
|
|
2243
|
+
children: /* @__PURE__ */ i(Ir, { ...l })
|
|
2244
|
+
})]
|
|
2245
|
+
})
|
|
2246
|
+
}), ji = Object.assign(Ta, {
|
|
2247
|
+
Root: jr,
|
|
2248
|
+
Trigger: kr,
|
|
2249
|
+
Options: Ir
|
|
2250
|
+
}), Pa = "_button_arlbx_1", xa = "_content_arlbx_15", Da = "_emoji_arlbx_21", Ke = {
|
|
2251
|
+
button: Pa,
|
|
2252
|
+
content: xa,
|
|
2253
|
+
emoji: Da
|
|
2254
|
+
}, ki = ({ emoji: e, count: t, pressed: r, onPressedChange: n, onClick: a, className: o, ...s }) => /* @__PURE__ */ i(oe, {
|
|
2255
|
+
...s,
|
|
2256
|
+
type: "button",
|
|
2257
|
+
size: "sm",
|
|
2258
|
+
variant: "ghost",
|
|
2259
|
+
color: "neutral",
|
|
2260
|
+
"aria-pressed": r,
|
|
2261
|
+
className: G(Ke.button, o),
|
|
2262
|
+
onClick: (c) => {
|
|
2263
|
+
a?.(c), !c.defaultPrevented && n(!r);
|
|
2264
|
+
},
|
|
2265
|
+
children: /* @__PURE__ */ I("span", {
|
|
2266
|
+
className: Ke.content,
|
|
2267
|
+
"aria-hidden": !0,
|
|
2268
|
+
children: [/* @__PURE__ */ i("span", {
|
|
2269
|
+
className: Ke.emoji,
|
|
2270
|
+
children: e
|
|
2271
|
+
}), /* @__PURE__ */ i("span", { children: t })]
|
|
2272
|
+
})
|
|
2273
|
+
}), Oa = "_wrapper_c0mqd_1", Aa = "_inputGroup_c0mqd_8", Ha = "_searchIcon_c0mqd_14", Je = {
|
|
2274
|
+
wrapper: Oa,
|
|
2275
|
+
inputGroup: Aa,
|
|
2276
|
+
searchIcon: Ha
|
|
2277
|
+
}, Ri = ({ placeholder: e, actions: t, size: r = "md", hasFocusRing: n = !1, id: a, "aria-label": o, "aria-labelledby": s, ...c }) => {
|
|
2278
|
+
const l = kt(), u = ae(), h = a ?? u;
|
|
2279
|
+
return /* @__PURE__ */ I("div", {
|
|
2280
|
+
className: Je.wrapper,
|
|
2281
|
+
children: [/* @__PURE__ */ i(Gr, {
|
|
2282
|
+
className: Je.inputGroup,
|
|
2283
|
+
size: r,
|
|
2284
|
+
hasFocusRing: n,
|
|
2285
|
+
startElement: /* @__PURE__ */ i(Or, {
|
|
2286
|
+
className: Je.searchIcon,
|
|
2287
|
+
size: l.icon.size.md,
|
|
2288
|
+
"aria-hidden": !0
|
|
2289
|
+
}),
|
|
2290
|
+
children: /* @__PURE__ */ i(Nt, {
|
|
2291
|
+
...c,
|
|
2292
|
+
id: h,
|
|
2293
|
+
placeholder: e,
|
|
2294
|
+
"aria-label": L(s) ? void 0 : o ?? e,
|
|
2295
|
+
"aria-labelledby": s
|
|
2296
|
+
})
|
|
2297
|
+
}), t]
|
|
2298
|
+
});
|
|
2299
|
+
}, $a = "_container_17hek_1", Ma = "_item_17hek_24", Fa = "_sm_17hek_38", Va = "_md_17hek_44", La = "_iconOnly_17hek_90", za = "_icon_17hek_90", Ua = "_label_17hek_109", ve = {
|
|
2300
|
+
container: $a,
|
|
2301
|
+
item: Ma,
|
|
2302
|
+
sm: Fa,
|
|
2303
|
+
md: Va,
|
|
2304
|
+
iconOnly: La,
|
|
2305
|
+
icon: za,
|
|
2306
|
+
label: Ua
|
|
2307
|
+
}, Ni = ({ className: e, itemWidth: t = "equal", options: r, size: n = "md", variant: a = "round", ...o }) => {
|
|
2308
|
+
const s = ae();
|
|
2309
|
+
return /* @__PURE__ */ i(ln, {
|
|
2310
|
+
...o,
|
|
2311
|
+
className: he(G(ve.container, ve[n]), e),
|
|
2312
|
+
"data-item-width": t,
|
|
2313
|
+
"data-variant": a,
|
|
2314
|
+
children: r.map(({ "aria-label": c, disabled: l, label: u, startIcon: h, value: d }, g) => {
|
|
2315
|
+
const m = `${s}-${g}`, p = L(c);
|
|
2316
|
+
return /* @__PURE__ */ I(Wr.Root, {
|
|
2317
|
+
value: d,
|
|
2318
|
+
disabled: l,
|
|
2319
|
+
"aria-labelledby": m,
|
|
2320
|
+
className: G(ve.item, !pe(u) && ve.iconOnly),
|
|
2321
|
+
children: [
|
|
2322
|
+
pe(h) && /* @__PURE__ */ i("span", {
|
|
2323
|
+
className: ve.icon,
|
|
2324
|
+
"aria-hidden": !0,
|
|
2325
|
+
children: h
|
|
2326
|
+
}),
|
|
2327
|
+
pe(u) && /* @__PURE__ */ i("span", {
|
|
2328
|
+
id: p ? void 0 : m,
|
|
2329
|
+
className: ve.label,
|
|
2330
|
+
children: u
|
|
2331
|
+
}),
|
|
2332
|
+
p && /* @__PURE__ */ i("span", {
|
|
2333
|
+
id: m,
|
|
2334
|
+
hidden: !0,
|
|
2335
|
+
children: c
|
|
2336
|
+
})
|
|
2337
|
+
]
|
|
2338
|
+
}, d);
|
|
2339
|
+
})
|
|
2340
|
+
});
|
|
2341
|
+
};
|
|
2342
|
+
export {
|
|
2343
|
+
Ii as a,
|
|
2344
|
+
Ci as c,
|
|
2345
|
+
yi as d,
|
|
2346
|
+
bi as f,
|
|
2347
|
+
ji as i,
|
|
2348
|
+
_i as l,
|
|
2349
|
+
Ri as n,
|
|
2350
|
+
Si as o,
|
|
2351
|
+
pi as p,
|
|
2352
|
+
ki as r,
|
|
2353
|
+
Ei as s,
|
|
2354
|
+
Ni as t,
|
|
2355
|
+
wi as u
|
|
2356
|
+
};
|