twenty-ui 2.48.0 → 2.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -2
- package/dist/Avatar-C6WxBgjS.cjs +1 -0
- package/dist/{Avatar-D-QA0RE5.js → Avatar-ifVlxbx_.js} +18 -17
- package/dist/{Button-D5enZ0Qz.js → Button-DIw804CX.js} +1 -1
- package/dist/{Button-Dbi5P05r.cjs → Button-DTm1WDzp.cjs} +1 -1
- package/dist/Dropdown-1OAJvS1f.js +1000 -0
- package/dist/Dropdown-Bl4OXCf9.cjs +1 -0
- package/dist/{ListItem-CjnrSbka.js → ListItem-DizNUBT8.js} +1 -1
- package/dist/{ListItem-CHTR-GLd.cjs → ListItem-DwBb-I1D.cjs} +1 -1
- package/dist/{ProgressBar-BvT1dyFo.js → ProgressBar-B3xACTV2.js} +1 -1
- package/dist/{ProgressBar-DfFz0fFB.cjs → ProgressBar-OpSMnDBz.cjs} +1 -1
- package/dist/{Radio-DMI1B7o5.js → Radio-BEAztmPu.js} +1 -1
- package/dist/{Radio-xmHgGHQO.cjs → Radio-Dx6b4SYZ.cjs} +1 -1
- package/dist/ResizeHandle-B1MuHTNA.cjs +1 -0
- package/dist/{ResizeHandle-C1kQ3MYR.js → ResizeHandle-B30OYZxS.js} +56 -55
- package/dist/Shortcut-Bp9iDdQg.js +73 -0
- package/dist/Shortcut-N8TELGPI.cjs +1 -0
- package/dist/{TintedIconTile-4BGa8g8n.js → TintedIconTile-B1XDtGrF.js} +1 -1
- package/dist/{TintedIconTile-CU2hCerq.cjs → TintedIconTile-DO1XJXCQ.cjs} +1 -1
- package/dist/components/__stories__/reading-direction/DirectionalLayoutExample.d.ts +3 -1
- package/dist/components/code-editor.cjs +1 -1
- package/dist/components/code-editor.mjs +52 -51
- package/dist/components/data-display.cjs +1 -1
- package/dist/components/data-display.mjs +2 -2
- package/dist/components/feedback.cjs +1 -1
- package/dist/components/feedback.mjs +1 -1
- package/dist/components/input/CountrySelect/CountrySelect.d.ts +5 -2
- package/dist/components/input/CountrySelect/__stories__/CountrySelectPartsExample.d.ts +11 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectComponent.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectContext.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectContextValue.d.ts +11 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectDropdown.d.ts +4 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectOptions.d.ts +2 -11
- package/dist/components/input/CountrySelect/internal/CountrySelectOptionsContent.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectRoot.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/CountrySelectTrigger.d.ts +2 -0
- package/dist/components/input/CountrySelect/internal/NO_COUNTRY_SELECTION_VALUE.d.ts +1 -0
- package/dist/components/input/CountrySelect/internal/PreparedCountryChoice.d.ts +5 -0
- package/dist/components/input/CountrySelect/internal/getCountrySelectionValue.d.ts +1 -0
- package/dist/components/input/CountrySelect/internal/useCountrySelectContextOrThrow.d.ts +1 -0
- package/dist/components/input/CountrySelect/types/CountryChoice.d.ts +1 -0
- package/dist/components/input/CountrySelect/types/CountrySelectOptionsProps.d.ts +10 -0
- package/dist/components/input/CountrySelect/types/CountrySelectOptionsState.d.ts +4 -0
- package/dist/components/input/CountrySelect/types/CountrySelectProps.d.ts +7 -13
- package/dist/components/input/CountrySelect/types/CountrySelectRootProps.d.ts +12 -0
- package/dist/components/input/CountrySelect/types/CountrySelectTriggerProps.d.ts +6 -0
- package/dist/components/input/CurrencyPicker/CurrencyPicker.d.ts +4 -3
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerChangingDefaultExample.d.ts +5 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerControlledExample.d.ts +5 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerControlledSearchExample.d.ts +5 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerExample.d.ts +3 -4
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerListLabelExample.d.ts +1 -0
- package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerRootStateExample.d.ts +1 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerContext.d.ts +11 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerOptions.d.ts +1 -1
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerRoot.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerShorthand.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/internal/CurrencyPickerTrigger.d.ts +1 -1
- package/dist/components/input/CurrencyPicker/internal/PreparedCurrencyPickerOption.d.ts +7 -0
- package/dist/components/input/CurrencyPicker/internal/getCurrencyPickerSearchText.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/internal/useCurrencyPickerContextOrThrow.d.ts +7 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerChangeEventDetails.d.ts +2 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerOption.d.ts +1 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerOptionsProps.d.ts +6 -5
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerProps.d.ts +10 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerRootProps.d.ts +17 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerState.d.ts +6 -0
- package/dist/components/input/CurrencyPicker/types/CurrencyPickerTriggerProps.d.ts +3 -2
- package/dist/components/input/IconButton/__stories__/IconButtonExample.d.ts +7 -0
- package/dist/components/input/PhoneCountryPicker/PhoneCountryPicker.d.ts +5 -3
- package/dist/components/input/PhoneCountryPicker/__stories__/PhoneCountryPickerExample.d.ts +7 -3
- package/dist/components/input/PhoneCountryPicker/__stories__/testDisabledPhoneCountryPicker.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountryCallingCodeDirection.d.ts +3 -0
- package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountryNullSelection.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountrySelection.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerContext.d.ts +9 -0
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerOptions.d.ts +1 -1
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerRoot.d.ts +2 -0
- package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerTrigger.d.ts +1 -1
- package/dist/components/input/PhoneCountryPicker/internal/PreparedPhoneCountryOption.d.ts +5 -0
- package/dist/components/input/PhoneCountryPicker/internal/getPhoneCountryOptionTooltipLabel.d.ts +2 -0
- package/dist/components/input/PhoneCountryPicker/internal/matchesPhoneCountrySearch.d.ts +6 -0
- package/dist/components/input/PhoneCountryPicker/internal/usePhoneCountryPickerContextOrThrow.d.ts +7 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryOption.d.ts +1 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerOptionsProps.d.ts +4 -5
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerProps.d.ts +10 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerRootProps.d.ts +12 -0
- package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerTriggerProps.d.ts +1 -3
- package/dist/components/input/index.d.ts +10 -0
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.mjs +13 -13
- package/dist/components/layout/OverflowingList/internal/measureItemWidths.d.ts +1 -2
- package/dist/components/layout/OverflowingList/internal/measureOverflowingListLayout.d.ts +1 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.mjs +1 -1
- package/dist/components/navigation/Dropdown/Dropdown.d.ts +2 -1
- package/dist/components/navigation/Dropdown/__stories__/DropdownIconGridExample.d.ts +3 -0
- package/dist/components/navigation/Dropdown/__stories__/DropdownSelectionGroupsExample.d.ts +1 -0
- package/dist/components/navigation/Dropdown/internal/DropdownContextValue.d.ts +6 -1
- package/dist/components/navigation/Dropdown/internal/DropdownOptionItem.d.ts +1 -1
- package/dist/components/navigation/Dropdown/internal/DropdownOptionItemOwner.d.ts +7 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionContext.d.ts +2 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionContextValue.d.ts +9 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionGroup.d.ts +2 -0
- package/dist/components/navigation/Dropdown/internal/DropdownSelectionGroupEffect.d.ts +11 -0
- package/dist/components/navigation/Dropdown/internal/createDropdownSelectionEventDetails.d.ts +5 -0
- package/dist/components/navigation/Dropdown/internal/dropdownItemActivation.d.ts +11 -0
- package/dist/components/navigation/Dropdown/internal/getDropdownItemExplicitId.d.ts +2 -2
- package/dist/components/navigation/Dropdown/internal/getDropdownOptionItemRole.d.ts +9 -0
- package/dist/components/navigation/Dropdown/internal/getDropdownSelectionGroupState.d.ts +6 -0
- package/dist/components/navigation/Dropdown/internal/getTrailingFocusGuard.d.ts +1 -0
- package/dist/components/navigation/Dropdown/internal/isDropdownOptionItemSelected.d.ts +6 -0
- package/dist/components/navigation/Dropdown/internal/useDropdownSelections.d.ts +12 -0
- package/dist/components/navigation/Dropdown/types/DropdownOptionItemProps.d.ts +7 -2
- package/dist/components/navigation/Dropdown/types/DropdownOptionItemSelectEventDetails.d.ts +2 -0
- package/dist/components/navigation/Dropdown/types/DropdownOptionItemState.d.ts +5 -0
- package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupChangeEventDetails.d.ts +7 -0
- package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupProps.d.ts +21 -0
- package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupState.d.ts +7 -0
- package/dist/components/navigation/index.d.ts +5 -0
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.mjs +2 -2
- package/dist/components/settings.cjs +1 -1
- package/dist/components/settings.mjs +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.mjs +22 -22
- package/dist/data-display-BSKGlijb.cjs +1 -0
- package/dist/{data-display-KyZbLLy-.js → data-display-BtXCGOGw.js} +81 -80
- package/dist/{data-display-0QO_WDSs.js → data-display-DtXIhJ4B.js} +45 -44
- package/dist/data-display-XV3ht1rC.cjs +2 -0
- package/dist/doNotTranslate-BSVT8Xyd.js +4 -0
- package/dist/doNotTranslate-CHE7WmRS.cjs +1 -0
- package/dist/feedback-Cs-38OH4.cjs +1 -0
- package/dist/{feedback-CM6fatE8.js → feedback-DTyVVcTb.js} +198 -197
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +42 -42
- package/dist/{input-CJDYNwoO.cjs → input-B_rBplmn.cjs} +1 -1
- package/dist/input-BrjD91wv.js +785 -0
- package/dist/input-ChlFcqIS.cjs +1 -0
- package/dist/{input-DRpDiMRi.js → input-D1oyk0tD.js} +2 -2
- package/dist/layout-CthYckvl.cjs +1 -0
- package/dist/layout-DQcjBu08.js +439 -0
- package/dist/{navigation-B1SRvzKK.js → navigation-B6nka3bW.js} +125 -128
- package/dist/navigation-CIVYqPc5.js +132 -0
- package/dist/navigation-CflGBYv-.cjs +1 -0
- package/dist/navigation-DoInK0Sp.cjs +1 -0
- package/dist/preventDismissingClickActivation-AaqHBLnW.js +45 -0
- package/dist/preventDismissingClickActivation-CIhWvKCu.cjs +1 -0
- package/dist/primitives/data-display.cjs +1 -1
- package/dist/primitives/data-display.mjs +2 -2
- package/dist/primitives/feedback.cjs +1 -1
- package/dist/primitives/feedback.mjs +1 -1
- package/dist/primitives/input/Radio/__stories__/RadioCardContent.d.ts +8 -0
- package/dist/primitives/input.cjs +1 -1
- package/dist/primitives/input.mjs +3 -3
- package/dist/primitives/layout/ResizeHandle/__stories__/ResizableNotesExample.d.ts +2 -0
- package/dist/primitives/layout.cjs +1 -1
- package/dist/primitives/layout.mjs +1 -1
- package/dist/primitives/navigation.cjs +1 -1
- package/dist/primitives/navigation.mjs +2 -2
- package/dist/primitives/typography.cjs +1 -1
- package/dist/primitives/typography.mjs +2 -2
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.mjs +11 -11
- package/dist/{settings-BjEZiHXE.js → settings-BgVuLpg9.js} +1 -1
- package/dist/{settings-BAYsnlZJ.cjs → settings-CPXhrmbK.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/testing/GroupedCatalog.d.ts +14 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.mjs +96 -66
- package/dist/{typography-fOTFr0jS.js → typography-DT2eKLvd.js} +1 -1
- package/dist/{typography-B5QEuPaL.cjs → typography-bKeSMuJd.cjs} +1 -1
- package/dist/useIsMobile-Byp9AIq-.cjs +1 -0
- package/dist/useIsMobile-D1ImfQnE.js +38 -0
- package/dist/utilities/internal/doNotTranslate.d.ts +1 -0
- package/dist/utilities-BKCMZyqZ.js +53 -0
- package/dist/utilities-xZh8D2gd.cjs +1 -0
- package/dist/utilities.cjs +1 -1
- package/dist/utilities.mjs +3 -3
- package/package.json +3 -3
- package/dist/Avatar-CQhIEazb.cjs +0 -1
- package/dist/Dropdown-BKjAaZS0.cjs +0 -1
- package/dist/Dropdown-C2hXrjvD.js +0 -820
- package/dist/ResizeHandle-DI4LHIQm.cjs +0 -1
- package/dist/Shortcut-BvWUZ3pb.js +0 -72
- package/dist/Shortcut-CgrdLv_L.cjs +0 -1
- package/dist/data-display-CPmTJAWJ.cjs +0 -1
- package/dist/data-display-DjhAHvj1.cjs +0 -2
- package/dist/feedback-ybO4n69s.cjs +0 -1
- package/dist/input-3D2lXywH.cjs +0 -1
- package/dist/input-TM3nUdu6.js +0 -554
- package/dist/layout-BszCDxAO.js +0 -441
- package/dist/layout-VaIq7Sjr.cjs +0 -1
- package/dist/navigation-CYAs2LnR.js +0 -131
- package/dist/navigation-CthkGHJ8.cjs +0 -1
- package/dist/navigation-DrOV5E67.cjs +0 -1
- package/dist/preventDismissingClickActivation-CzWqpjiX.js +0 -44
- package/dist/preventDismissingClickActivation-DZxTSLV3.cjs +0 -1
- package/dist/useIsMobile-DxOPI2_E.cjs +0 -1
- package/dist/useIsMobile-nrufFzMb.js +0 -37
- package/dist/utilities-BeLfNQ0Q.cjs +0 -1
- package/dist/utilities-CEi9I09B.js +0 -52
|
@@ -0,0 +1,785 @@
|
|
|
1
|
+
import { t as y } from "./isDefined-fMi6eQ4r.js";
|
|
2
|
+
import { Pn as Se, So as je, Tn as he, Uc as He, Wo as We, Zc as Ke, gl as Xe, js as Ye, ml as Ze, ts as Je } from "./icon-CUE-QGQK.js";
|
|
3
|
+
import { t as P } from "./doNotTranslate-BSVT8Xyd.js";
|
|
4
|
+
import { r as Ie } from "./theme-B2EaXhye.js";
|
|
5
|
+
import { t as U } from "./mergeClassNames-ClFMR1v0.js";
|
|
6
|
+
import { n as K } from "./preventDismissingClickActivation-AaqHBLnW.js";
|
|
7
|
+
import { r as Ne, t as z } from "./Button-DIw804CX.js";
|
|
8
|
+
import { t as de } from "./isRenderableSlot-DT_depzM.js";
|
|
9
|
+
import { t as ve } from "./OverflowingTextWithTooltip-BmUROIah.js";
|
|
10
|
+
import { n as Qe, o as J, r as ea, t as _ } from "./Dropdown-1OAJvS1f.js";
|
|
11
|
+
import { n as ne, t as aa } from "./Input-DZWl81G_.js";
|
|
12
|
+
import { i as ue, n as ra, r as te, t as ta } from "./Radio-BEAztmPu.js";
|
|
13
|
+
import { useRender as be } from "@base-ui/react/use-render";
|
|
14
|
+
import { isFunction as oe, isNonEmptyArray as Q, isNonEmptyString as R, isNull as Oe, isString as na, isUndefined as le } from "@sniptt/guards";
|
|
15
|
+
import { clsx as G } from "clsx";
|
|
16
|
+
import { createContext as _e, createElement as oa, useContext as ee, useEffect as la, useId as M, useMemo as Ce, useRef as ia, useState as D } from "react";
|
|
17
|
+
import { Fragment as L, jsx as e, jsxs as S } from "react/jsx-runtime";
|
|
18
|
+
import { useMergedRefs as sa } from "@base-ui/utils/useMergedRefs";
|
|
19
|
+
import { useControlled as Te } from "@base-ui/utils/useControlled";
|
|
20
|
+
import { useStableCallback as ca } from "@base-ui/utils/useStableCallback";
|
|
21
|
+
import { useValueAsRef as da } from "@base-ui/utils/useValueAsRef";
|
|
22
|
+
import { formatNumber as ye } from "@base-ui/utils/formatNumber";
|
|
23
|
+
import { RadioGroup as ua } from "@base-ui/react/radio-group";
|
|
24
|
+
var Pe = _e(void 0), ma = "country:", ke = (a) => `${ma}${a}`, Re = ({ countries: a, value: r, defaultValue: t = null, onValueChange: o, disabled: l = !1, noCountryLabel: n = P("No country"), children: i }) => {
|
|
25
|
+
const d = M(), [c, u] = Te({
|
|
26
|
+
controlled: r,
|
|
27
|
+
default: t,
|
|
28
|
+
name: P("CountrySelect"),
|
|
29
|
+
state: "value"
|
|
30
|
+
}), v = Ce(() => a.map((m) => ({
|
|
31
|
+
...m,
|
|
32
|
+
selectionValue: ke(m.value),
|
|
33
|
+
searchText: K(m.label)
|
|
34
|
+
})), [a]), p = Ce(() => new Map(v.map((m) => [m.value, m])), [v]), h = l || !Q(v);
|
|
35
|
+
return /* @__PURE__ */ e(Pe.Provider, {
|
|
36
|
+
value: {
|
|
37
|
+
countries: v,
|
|
38
|
+
selectedCountry: Oe(c) ? void 0 : p.get(c),
|
|
39
|
+
value: c,
|
|
40
|
+
disabled: h,
|
|
41
|
+
noCountryLabel: n,
|
|
42
|
+
selectionGroupId: d,
|
|
43
|
+
changeValue: (m, C) => {
|
|
44
|
+
if (h) {
|
|
45
|
+
C.cancel();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
o?.(m, C), C.isCanceled || u(m);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
children: i
|
|
52
|
+
});
|
|
53
|
+
}, Ee = ({ disabled: a, open: r, onOpenChange: t }) => {
|
|
54
|
+
const o = ca(t);
|
|
55
|
+
return la(() => {
|
|
56
|
+
!a || !r || o(!1);
|
|
57
|
+
}, [
|
|
58
|
+
a,
|
|
59
|
+
r,
|
|
60
|
+
o
|
|
61
|
+
]), null;
|
|
62
|
+
}, pa = "_root_1x3d7_1", ha = "_label_1x3d7_6", va = "_flag_1x3d7_14", Z = {
|
|
63
|
+
root: pa,
|
|
64
|
+
label: ha,
|
|
65
|
+
flag: va
|
|
66
|
+
}, ba = ({ ariaLabelledBy: a, ariaLabel: r, visibleLabelId: t }) => {
|
|
67
|
+
if (R(a)) return a;
|
|
68
|
+
if (!R(r))
|
|
69
|
+
return t;
|
|
70
|
+
}, ge = () => {
|
|
71
|
+
const a = ee(Pe);
|
|
72
|
+
if (!y(a)) throw new Error(P("CountrySelect parts must be inside CountrySelect.Root"));
|
|
73
|
+
return a;
|
|
74
|
+
}, Y = (a) => a.preventBaseUIHandler?.(), we = ({ label: a, wrapperProps: r, children: t, className: o, style: l, render: n, onClick: i, onMouseDown: d, onPointerDown: c, onKeyDown: u, onKeyUp: v, openOnHover: p, id: h, "aria-label": m, "aria-labelledby": C, "aria-describedby": O, ...I }) => {
|
|
75
|
+
const { selectedCountry: f, disabled: b, noCountryLabel: T } = ge(), { open: N, setOpen: g } = J(), s = M(), k = h ?? s, E = `${s}-label`, V = `${s}-value`, B = R(a), A = R(m) ? m : void 0, w = ba({
|
|
76
|
+
ariaLabelledBy: C,
|
|
77
|
+
ariaLabel: A,
|
|
78
|
+
visibleLabelId: B ? E : void 0
|
|
79
|
+
}), $ = [O, (y(w) || y(A)) && !y(t) ? V : void 0].filter(R), ae = f?.label ?? T, j = y(f) ? f.flag : /* @__PURE__ */ e(Se, {}), X = (x) => ({
|
|
80
|
+
...x,
|
|
81
|
+
disabled: b
|
|
82
|
+
}), se = U(G(ne.input, ne.md, ue.trigger), o);
|
|
83
|
+
return /* @__PURE__ */ S("div", {
|
|
84
|
+
...r,
|
|
85
|
+
className: G(Z.root, r?.className),
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ e(Ee, {
|
|
88
|
+
disabled: b,
|
|
89
|
+
open: N,
|
|
90
|
+
onOpenChange: g
|
|
91
|
+
}),
|
|
92
|
+
B && /* @__PURE__ */ e("label", {
|
|
93
|
+
id: E,
|
|
94
|
+
className: Z.label,
|
|
95
|
+
htmlFor: k,
|
|
96
|
+
children: a
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ e(_.Trigger, {
|
|
99
|
+
...I,
|
|
100
|
+
id: k,
|
|
101
|
+
"aria-label": A,
|
|
102
|
+
"aria-labelledby": w,
|
|
103
|
+
"aria-describedby": Q($) ? $.join(" ") : void 0,
|
|
104
|
+
"aria-disabled": b || void 0,
|
|
105
|
+
openOnHover: b ? !1 : p,
|
|
106
|
+
"data-disabled": b ? "" : void 0,
|
|
107
|
+
onClick: b ? Y : i,
|
|
108
|
+
onMouseDown: b ? Y : d,
|
|
109
|
+
onPointerDown: b ? Y : c,
|
|
110
|
+
onKeyDown: b ? Y : u,
|
|
111
|
+
onKeyUp: b ? Y : v,
|
|
112
|
+
className: (x) => se(X(x)),
|
|
113
|
+
style: oe(l) ? (x) => l(X(x)) : l,
|
|
114
|
+
render: oe(n) ? (x, re) => n(x, X(re)) : n,
|
|
115
|
+
children: t ?? /* @__PURE__ */ S(L, { children: [
|
|
116
|
+
/* @__PURE__ */ e("span", {
|
|
117
|
+
className: Z.flag,
|
|
118
|
+
"aria-hidden": "true",
|
|
119
|
+
children: j
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ e("span", {
|
|
122
|
+
className: ue.value,
|
|
123
|
+
id: V,
|
|
124
|
+
children: /* @__PURE__ */ e(ve, { text: ae })
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ e("span", {
|
|
127
|
+
className: ue.icon,
|
|
128
|
+
"aria-hidden": "true",
|
|
129
|
+
children: /* @__PURE__ */ e(he, {})
|
|
130
|
+
})
|
|
131
|
+
] })
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
});
|
|
135
|
+
}, _a = "no-country", ga = ({ searchLabel: a = P("Search"), noResultsLabel: r = P("No results"), searchProps: t, render: o, ...l }) => {
|
|
136
|
+
const { countries: n, value: i, changeValue: d, disabled: c, noCountryLabel: u, selectionGroupId: v } = ge(), { titleId: p, triggerId: h } = J(), m = y(l["aria-label"]) || y(l["aria-labelledby"]) ? void 0 : p ?? h, [C, O] = D(""), I = K(C.trim()), f = R(I), b = n.filter((s) => s.searchText.includes(I)), T = K(u).includes(I), N = T || Q(b), g = T && /* @__PURE__ */ e(_.OptionItem, {
|
|
137
|
+
value: "no-country",
|
|
138
|
+
disabled: c,
|
|
139
|
+
startIcon: /* @__PURE__ */ e("span", {
|
|
140
|
+
className: Z.flag,
|
|
141
|
+
"aria-hidden": "true",
|
|
142
|
+
children: /* @__PURE__ */ e(Se, {})
|
|
143
|
+
}),
|
|
144
|
+
children: u
|
|
145
|
+
});
|
|
146
|
+
return /* @__PURE__ */ S(L, { children: [
|
|
147
|
+
/* @__PURE__ */ e(_.Search, {
|
|
148
|
+
placeholder: a,
|
|
149
|
+
"aria-label": a,
|
|
150
|
+
...t,
|
|
151
|
+
value: C,
|
|
152
|
+
onValueChange: O,
|
|
153
|
+
disabled: c || t?.disabled
|
|
154
|
+
}),
|
|
155
|
+
N && /* @__PURE__ */ e(_.Separator, {}),
|
|
156
|
+
/* @__PURE__ */ S(_.SelectionGroup, {
|
|
157
|
+
...l,
|
|
158
|
+
"aria-labelledby": l["aria-labelledby"] ?? m,
|
|
159
|
+
render: oe(o) ? (s) => o(s, {
|
|
160
|
+
value: i,
|
|
161
|
+
multiple: !1
|
|
162
|
+
}) : o,
|
|
163
|
+
id: v,
|
|
164
|
+
value: Oe(i) ? _a : ke(i),
|
|
165
|
+
onValueChange: (s, k) => {
|
|
166
|
+
d(n.find((E) => E.selectionValue === s)?.value ?? null, k);
|
|
167
|
+
},
|
|
168
|
+
children: [N && /* @__PURE__ */ S(_.Section, {
|
|
169
|
+
scrollable: !0,
|
|
170
|
+
children: [
|
|
171
|
+
!f && g,
|
|
172
|
+
b.map((s) => /* @__PURE__ */ e(_.OptionItem, {
|
|
173
|
+
value: s.selectionValue,
|
|
174
|
+
disabled: c || s.disabled,
|
|
175
|
+
startIcon: /* @__PURE__ */ e("span", {
|
|
176
|
+
className: Z.flag,
|
|
177
|
+
"aria-hidden": "true",
|
|
178
|
+
children: s.flag
|
|
179
|
+
}),
|
|
180
|
+
children: s.label
|
|
181
|
+
}, s.value)),
|
|
182
|
+
f && g
|
|
183
|
+
]
|
|
184
|
+
}), !N && /* @__PURE__ */ e(_.Empty, { children: r })]
|
|
185
|
+
})
|
|
186
|
+
] });
|
|
187
|
+
}, xe = (a) => {
|
|
188
|
+
const { open: r } = J(), [t, o] = D(r), [l, n] = D(0);
|
|
189
|
+
return t !== r && (o(r), r && n(l + 1)), /* @__PURE__ */ oa(ga, {
|
|
190
|
+
...a,
|
|
191
|
+
key: l
|
|
192
|
+
});
|
|
193
|
+
}, fa = ({ open: a, defaultOpen: r = !1, onOpenChange: t, onEscapeKeyDown: o, onInteractOutside: l, defaultPage: n, popupProps: i, optionsProps: d, searchLabel: c, noResultsLabel: u, searchProps: v, closeOnSelect: p, ...h }) => {
|
|
194
|
+
const { disabled: m } = ge(), [C, O] = D(r), I = a ?? C, f = !m && I, b = (s) => {
|
|
195
|
+
s && m || (O(s), t?.(s));
|
|
196
|
+
}, T = [h["aria-label"], h.label].find(R), N = y(i?.["aria-label"]) || y(i?.["aria-labelledby"]), g = y(d?.["aria-label"]) || y(d?.["aria-labelledby"]);
|
|
197
|
+
return /* @__PURE__ */ S(L, { children: [/* @__PURE__ */ e(Ee, {
|
|
198
|
+
disabled: m,
|
|
199
|
+
open: I,
|
|
200
|
+
onOpenChange: b
|
|
201
|
+
}), /* @__PURE__ */ S(_.Root, {
|
|
202
|
+
type: "picker",
|
|
203
|
+
open: f,
|
|
204
|
+
onOpenChange: b,
|
|
205
|
+
onEscapeKeyDown: o,
|
|
206
|
+
onInteractOutside: l,
|
|
207
|
+
defaultPage: n,
|
|
208
|
+
children: [/* @__PURE__ */ e(we, { ...h }), /* @__PURE__ */ e(_.Content, {
|
|
209
|
+
"aria-label": N ? void 0 : T,
|
|
210
|
+
"aria-labelledby": N ? void 0 : h["aria-labelledby"],
|
|
211
|
+
...i,
|
|
212
|
+
children: /* @__PURE__ */ e(xe, {
|
|
213
|
+
"aria-label": g ? void 0 : T,
|
|
214
|
+
"aria-labelledby": g ? void 0 : h["aria-labelledby"],
|
|
215
|
+
...d,
|
|
216
|
+
searchLabel: c,
|
|
217
|
+
noResultsLabel: u,
|
|
218
|
+
searchProps: v,
|
|
219
|
+
closeOnSelect: p
|
|
220
|
+
})
|
|
221
|
+
})]
|
|
222
|
+
})] });
|
|
223
|
+
}, Ca = ({ countries: a, value: r, defaultValue: t, onValueChange: o, disabled: l, noCountryLabel: n, ...i }) => /* @__PURE__ */ e(Re, {
|
|
224
|
+
countries: a,
|
|
225
|
+
value: r,
|
|
226
|
+
defaultValue: t,
|
|
227
|
+
onValueChange: o,
|
|
228
|
+
disabled: l,
|
|
229
|
+
noCountryLabel: n,
|
|
230
|
+
children: /* @__PURE__ */ e(fa, { ...i })
|
|
231
|
+
}), Gr = Object.assign(Ca, {
|
|
232
|
+
Root: Re,
|
|
233
|
+
Trigger: we,
|
|
234
|
+
Options: xe
|
|
235
|
+
}), ya = "_trigger_18tlx_1", Sa = "_chevron_18tlx_40", Ia = "_options_18tlx_45", Na = "_emptyStatus_18tlx_51", ie = {
|
|
236
|
+
trigger: ya,
|
|
237
|
+
chevron: Sa,
|
|
238
|
+
options: Ia,
|
|
239
|
+
emptyStatus: Na
|
|
240
|
+
}, $e = _e(void 0), Le = () => {
|
|
241
|
+
const a = ee($e);
|
|
242
|
+
if (!y(a)) throw new Error(P("CurrencyPicker parts must be inside CurrencyPicker.Root"));
|
|
243
|
+
return a;
|
|
244
|
+
}, Ve = ({ disabled: a = !1, searchable: r = !0, searchLabel: t = P("Search"), listLabel: o, emptyLabel: l = P("No results"), searchProps: n, className: i, render: d, ref: c, ...u }) => {
|
|
245
|
+
const { state: v, groupId: p, options: h, selectionProps: m } = Le(), { titleId: C, triggerId: O } = J(), { value: I, defaultValue: f = "", onValueChange: b, ...T } = n ?? {}, [N, g] = D(f), s = I ?? N, k = r ? String(s).trim().toLowerCase() : "", E = h.filter(({ searchText: w }) => w.includes(k)), V = Q(E), B = v.disabled || a, A = y(o) ? void 0 : C ?? O;
|
|
246
|
+
return be({
|
|
247
|
+
render: d,
|
|
248
|
+
ref: c,
|
|
249
|
+
props: {
|
|
250
|
+
...u,
|
|
251
|
+
className: G(ie.options, i),
|
|
252
|
+
children: /* @__PURE__ */ S(L, { children: [
|
|
253
|
+
r && /* @__PURE__ */ S(L, { children: [/* @__PURE__ */ e(_.Search, {
|
|
254
|
+
placeholder: t,
|
|
255
|
+
"aria-label": t,
|
|
256
|
+
...T,
|
|
257
|
+
value: s,
|
|
258
|
+
onValueChange: (w) => {
|
|
259
|
+
b?.(w), le(I) && g(w);
|
|
260
|
+
},
|
|
261
|
+
disabled: B || n?.disabled
|
|
262
|
+
}), /* @__PURE__ */ e(_.Separator, {})] }),
|
|
263
|
+
/* @__PURE__ */ e(_.SelectionGroup, {
|
|
264
|
+
...m,
|
|
265
|
+
id: p,
|
|
266
|
+
"aria-label": o,
|
|
267
|
+
"aria-labelledby": A,
|
|
268
|
+
children: V && /* @__PURE__ */ e(_.Section, {
|
|
269
|
+
scrollable: !0,
|
|
270
|
+
children: E.map(({ currency: w, label: $ }) => /* @__PURE__ */ e(_.OptionItem, {
|
|
271
|
+
value: w.code,
|
|
272
|
+
disabled: B || w.disabled,
|
|
273
|
+
children: na($) ? /* @__PURE__ */ e(ve, { text: $ }) : $
|
|
274
|
+
}, w.code))
|
|
275
|
+
})
|
|
276
|
+
}),
|
|
277
|
+
/* @__PURE__ */ e(_.Empty, {
|
|
278
|
+
className: ie.emptyStatus,
|
|
279
|
+
children: V ? null : l
|
|
280
|
+
})
|
|
281
|
+
] })
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}, Ae = ({ code: a, name: r }) => `${r} (${a})`, Oa = (a) => `${Ae(a)} ${a.symbol ?? ""}`, Fe = ({ currencies: a, value: r, defaultValue: t = null, onValueChange: o, closeOnSelect: l, disabled: n = !1, selectedFirst: i = !1, getOptionLabel: d = Ae, getSearchText: c = Oa, renderValue: u, children: v }) => {
|
|
285
|
+
const p = M(), { selections: h, initializeSelection: m } = J(), C = {
|
|
286
|
+
value: r,
|
|
287
|
+
defaultValue: t,
|
|
288
|
+
onValueChange: o,
|
|
289
|
+
closeOnSelect: l
|
|
290
|
+
}, O = Qe({
|
|
291
|
+
props: {
|
|
292
|
+
...C,
|
|
293
|
+
id: p
|
|
294
|
+
},
|
|
295
|
+
storedState: h.get(p)
|
|
296
|
+
}), I = O.multiple ? null : O.value, f = a.map((g) => ({
|
|
297
|
+
currency: g,
|
|
298
|
+
label: d(g),
|
|
299
|
+
searchText: c(g).toLowerCase()
|
|
300
|
+
})), b = f.find(({ currency: g }) => g.code === I), T = i && y(b) ? [b, ...f.filter((g) => g !== b)] : f, N = {
|
|
301
|
+
value: I,
|
|
302
|
+
selectedCurrency: b?.currency,
|
|
303
|
+
disabled: n
|
|
304
|
+
};
|
|
305
|
+
return /* @__PURE__ */ S($e.Provider, {
|
|
306
|
+
value: {
|
|
307
|
+
state: N,
|
|
308
|
+
groupId: p,
|
|
309
|
+
options: T,
|
|
310
|
+
selectionProps: C,
|
|
311
|
+
renderValue: u
|
|
312
|
+
},
|
|
313
|
+
children: [le(r) && /* @__PURE__ */ e(ea, {
|
|
314
|
+
id: p,
|
|
315
|
+
initialState: O,
|
|
316
|
+
initializeSelection: m
|
|
317
|
+
}), oe(v) ? v(N) : v]
|
|
318
|
+
});
|
|
319
|
+
}, Ge = ({ children: a, placeholder: r, disabled: t = !1, className: o, ...l }) => {
|
|
320
|
+
const { state: n, renderValue: i } = Le(), d = y(n.value) ? n.value : r;
|
|
321
|
+
return /* @__PURE__ */ S(_.Trigger, {
|
|
322
|
+
...l,
|
|
323
|
+
disabled: n.disabled || t,
|
|
324
|
+
className: U(ie.trigger, o),
|
|
325
|
+
children: [a ?? (y(i) ? i(n) : d), /* @__PURE__ */ e(he, {
|
|
326
|
+
"aria-hidden": "true",
|
|
327
|
+
className: ie.chevron
|
|
328
|
+
})]
|
|
329
|
+
});
|
|
330
|
+
}, Ta = ({ currencies: a, value: r, defaultValue: t, onValueChange: o, closeOnSelect: l, disabled: n, selectedFirst: i, getOptionLabel: d, getSearchText: c, renderValue: u, open: v, defaultOpen: p, onOpenChange: h, onEscapeKeyDown: m, onInteractOutside: C, triggerProps: O, contentProps: I, optionsProps: f, ...b }) => /* @__PURE__ */ e(_.Root, {
|
|
331
|
+
type: "picker",
|
|
332
|
+
open: v,
|
|
333
|
+
defaultOpen: p,
|
|
334
|
+
onOpenChange: h,
|
|
335
|
+
onEscapeKeyDown: m,
|
|
336
|
+
onInteractOutside: C,
|
|
337
|
+
children: /* @__PURE__ */ S(Fe, {
|
|
338
|
+
currencies: a,
|
|
339
|
+
value: r,
|
|
340
|
+
defaultValue: t,
|
|
341
|
+
onValueChange: o,
|
|
342
|
+
closeOnSelect: l,
|
|
343
|
+
disabled: n,
|
|
344
|
+
selectedFirst: i,
|
|
345
|
+
getOptionLabel: d,
|
|
346
|
+
getSearchText: c,
|
|
347
|
+
renderValue: u,
|
|
348
|
+
children: [/* @__PURE__ */ e(Ge, {
|
|
349
|
+
...b,
|
|
350
|
+
...O
|
|
351
|
+
}), /* @__PURE__ */ e(_.Content, {
|
|
352
|
+
...I,
|
|
353
|
+
children: /* @__PURE__ */ e(Ve, { ...f })
|
|
354
|
+
})]
|
|
355
|
+
})
|
|
356
|
+
}), Dr = Object.assign(Ta, {
|
|
357
|
+
Root: Fe,
|
|
358
|
+
Trigger: Ge,
|
|
359
|
+
Options: Ve
|
|
360
|
+
}), Pa = "_root_u3myi_1", ka = "_preview_u3myi_6", Ra = "_image_u3myi_35", Ea = "_fileInput_u3myi_48", wa = "_content_u3myi_58", xa = "_actions_u3myi_67", $a = "_helperText_u3myi_73", La = "_errorMessage_u3myi_78", F = {
|
|
361
|
+
root: Pa,
|
|
362
|
+
preview: ka,
|
|
363
|
+
image: Ra,
|
|
364
|
+
fileInput: Ea,
|
|
365
|
+
content: wa,
|
|
366
|
+
actions: xa,
|
|
367
|
+
helperText: $a,
|
|
368
|
+
errorMessage: La
|
|
369
|
+
}, Va = ({ src: a }) => {
|
|
370
|
+
const r = Ie(), [t, o] = D(!1);
|
|
371
|
+
return !R(a) || t ? /* @__PURE__ */ e(We, {
|
|
372
|
+
size: r.icon.size.lg,
|
|
373
|
+
"aria-hidden": !0
|
|
374
|
+
}) : /* @__PURE__ */ e("img", {
|
|
375
|
+
className: F.image,
|
|
376
|
+
src: a,
|
|
377
|
+
alt: "",
|
|
378
|
+
onError: () => o(!0)
|
|
379
|
+
});
|
|
380
|
+
}, Aa = "image/*", Mr = ({ src: a, onFileSelect: r, onRemove: t, onAbort: o, disabled: l = !1, isUploading: n = !1, helperText: i, errorMessage: d, uploadLabel: c = P("Upload"), removeLabel: u = P("Remove"), abortLabel: v = P("Abort"), accept: p = Aa, inputRef: h, onChange: m, "aria-describedby": C, className: O, style: I, dir: f, render: b, ref: T, ...N }) => {
|
|
381
|
+
const g = ia(null), s = sa(g, h), k = M(), E = `${k}-helper`, V = `${k}-error`, B = R(a), A = R(i), w = R(d), $ = l || !y(r), ae = l || !B || !y(t), j = $ || n, X = ae || n, se = n && y(o), x = [
|
|
382
|
+
C,
|
|
383
|
+
A && E,
|
|
384
|
+
w && V
|
|
385
|
+
].filter(R).join(" ") || void 0, re = () => {
|
|
386
|
+
j || g.current?.click();
|
|
387
|
+
}, Ue = (ce) => {
|
|
388
|
+
const fe = ce.currentTarget.files?.[0];
|
|
389
|
+
try {
|
|
390
|
+
m?.(ce);
|
|
391
|
+
} finally {
|
|
392
|
+
ce.currentTarget.value = "";
|
|
393
|
+
}
|
|
394
|
+
j || !y(fe) || r?.(fe);
|
|
395
|
+
};
|
|
396
|
+
return be({
|
|
397
|
+
render: b,
|
|
398
|
+
ref: T,
|
|
399
|
+
props: {
|
|
400
|
+
className: G(F.root, O),
|
|
401
|
+
style: I,
|
|
402
|
+
dir: f,
|
|
403
|
+
"aria-busy": n || N["aria-busy"],
|
|
404
|
+
children: /* @__PURE__ */ S(L, { children: [/* @__PURE__ */ e("button", {
|
|
405
|
+
className: F.preview,
|
|
406
|
+
type: "button",
|
|
407
|
+
disabled: $,
|
|
408
|
+
"aria-disabled": n || void 0,
|
|
409
|
+
"aria-label": c,
|
|
410
|
+
"aria-describedby": x,
|
|
411
|
+
onClick: re,
|
|
412
|
+
children: /* @__PURE__ */ e(Va, { src: a }, a)
|
|
413
|
+
}), /* @__PURE__ */ S("div", {
|
|
414
|
+
className: F.content,
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ S("div", {
|
|
417
|
+
className: F.actions,
|
|
418
|
+
children: [
|
|
419
|
+
/* @__PURE__ */ e("input", {
|
|
420
|
+
"aria-label": c,
|
|
421
|
+
...N,
|
|
422
|
+
ref: s,
|
|
423
|
+
className: F.fileInput,
|
|
424
|
+
dir: f,
|
|
425
|
+
children: void 0,
|
|
426
|
+
dangerouslySetInnerHTML: void 0,
|
|
427
|
+
type: "file",
|
|
428
|
+
multiple: !1,
|
|
429
|
+
value: void 0,
|
|
430
|
+
defaultValue: void 0,
|
|
431
|
+
accept: p,
|
|
432
|
+
disabled: j,
|
|
433
|
+
"aria-describedby": x,
|
|
434
|
+
hidden: !0,
|
|
435
|
+
onChange: Ue
|
|
436
|
+
}),
|
|
437
|
+
se ? /* @__PURE__ */ e(z, {
|
|
438
|
+
type: "button",
|
|
439
|
+
startIcon: /* @__PURE__ */ e(Xe, {}),
|
|
440
|
+
onClick: o,
|
|
441
|
+
disabled: l,
|
|
442
|
+
variant: "outline",
|
|
443
|
+
children: v
|
|
444
|
+
}) : /* @__PURE__ */ e(z, {
|
|
445
|
+
type: "button",
|
|
446
|
+
startIcon: /* @__PURE__ */ e(Ke, {}),
|
|
447
|
+
onClick: re,
|
|
448
|
+
disabled: j,
|
|
449
|
+
focusableWhenDisabled: n && !$,
|
|
450
|
+
"aria-describedby": x,
|
|
451
|
+
variant: "outline",
|
|
452
|
+
children: c
|
|
453
|
+
}),
|
|
454
|
+
/* @__PURE__ */ e(z, {
|
|
455
|
+
type: "button",
|
|
456
|
+
startIcon: /* @__PURE__ */ e(He, {}),
|
|
457
|
+
onClick: t,
|
|
458
|
+
disabled: X,
|
|
459
|
+
focusableWhenDisabled: n && !ae,
|
|
460
|
+
variant: "outline",
|
|
461
|
+
children: u
|
|
462
|
+
})
|
|
463
|
+
]
|
|
464
|
+
}),
|
|
465
|
+
A && /* @__PURE__ */ e("span", {
|
|
466
|
+
className: F.helperText,
|
|
467
|
+
id: E,
|
|
468
|
+
children: i
|
|
469
|
+
}),
|
|
470
|
+
w && /* @__PURE__ */ e("span", {
|
|
471
|
+
className: F.errorMessage,
|
|
472
|
+
id: V,
|
|
473
|
+
role: "alert",
|
|
474
|
+
children: d
|
|
475
|
+
})
|
|
476
|
+
]
|
|
477
|
+
})] })
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
}, Fa = "_button_k3e4y_1", Ga = { button: Fa }, Br = ({ className: a, emphasis: r = "standard", size: t, variant: o, ...l }) => {
|
|
481
|
+
const n = ee(Ne), i = t ?? n?.size ?? "sm", d = o ?? n?.variant ?? "ghost";
|
|
482
|
+
return /* @__PURE__ */ e(z, {
|
|
483
|
+
...l,
|
|
484
|
+
size: i,
|
|
485
|
+
variant: d,
|
|
486
|
+
"data-emphasis": r,
|
|
487
|
+
className: U(Ga.button, a)
|
|
488
|
+
});
|
|
489
|
+
}, Da = "_button_1fwx7_1", Ma = { button: Da }, qr = ({ className: a, elevated: r = !0, variant: t, ...o }) => {
|
|
490
|
+
const l = ee(Ne), n = t ?? l?.variant ?? "solid";
|
|
491
|
+
return /* @__PURE__ */ e(z, {
|
|
492
|
+
...o,
|
|
493
|
+
elevated: r,
|
|
494
|
+
variant: n,
|
|
495
|
+
className: U(Ma.button, a)
|
|
496
|
+
});
|
|
497
|
+
}, pe = {
|
|
498
|
+
maximumFractionDigits: 15,
|
|
499
|
+
numberingSystem: "latn",
|
|
500
|
+
useGrouping: "min2"
|
|
501
|
+
}, Ba = ({ nextValue: a, currentValue: r, reason: t }) => t === "input-blur" && ye(a, void 0, pe) === ye(r, void 0, pe), qa = "_root_17bio_1", za = "_valueInput_17bio_7", Ua = "_button_17bio_14", ja = "_icon_17bio_32", H = {
|
|
502
|
+
root: qa,
|
|
503
|
+
valueInput: za,
|
|
504
|
+
button: Ua,
|
|
505
|
+
icon: ja
|
|
506
|
+
}, zr = ({ value: a, defaultValue: r, onValueChange: t, onValueCommitted: o, allowOutOfRange: l = !1, min: n, max: i, step: d = 1, disabled: c, readOnly: u, required: v, name: p, form: h, id: m, showButtons: C = !0, decrementLabel: O = P("Decrease value"), incrementLabel: I = P("Increase value"), className: f, ...b }) => {
|
|
507
|
+
const [T, N] = Te({
|
|
508
|
+
controlled: a,
|
|
509
|
+
default: r ?? null,
|
|
510
|
+
name: P("NumberStepper"),
|
|
511
|
+
state: "value"
|
|
512
|
+
}), g = da(T), s = (k, E) => {
|
|
513
|
+
if (k !== g.current) {
|
|
514
|
+
if (Ba({
|
|
515
|
+
nextValue: k,
|
|
516
|
+
currentValue: g.current,
|
|
517
|
+
reason: E.reason
|
|
518
|
+
})) {
|
|
519
|
+
E.cancel();
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
t?.(k, E), !E.isCanceled && (g.current = k, N(k));
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
return /* @__PURE__ */ S(te.Root, {
|
|
526
|
+
value: T,
|
|
527
|
+
onValueChange: s,
|
|
528
|
+
onValueCommitted: o,
|
|
529
|
+
min: n,
|
|
530
|
+
max: i,
|
|
531
|
+
allowOutOfRange: l,
|
|
532
|
+
step: d,
|
|
533
|
+
smallStep: d,
|
|
534
|
+
largeStep: d,
|
|
535
|
+
disabled: c,
|
|
536
|
+
readOnly: u,
|
|
537
|
+
required: v,
|
|
538
|
+
name: p,
|
|
539
|
+
form: h,
|
|
540
|
+
id: m,
|
|
541
|
+
format: pe,
|
|
542
|
+
className: H.root,
|
|
543
|
+
children: [
|
|
544
|
+
C && /* @__PURE__ */ e(te.Decrement, {
|
|
545
|
+
"aria-label": O,
|
|
546
|
+
render: /* @__PURE__ */ e(z, {
|
|
547
|
+
type: "button",
|
|
548
|
+
size: "sm",
|
|
549
|
+
className: H.button,
|
|
550
|
+
startIcon: /* @__PURE__ */ e("span", {
|
|
551
|
+
className: H.icon,
|
|
552
|
+
children: /* @__PURE__ */ e(je, {})
|
|
553
|
+
})
|
|
554
|
+
})
|
|
555
|
+
}),
|
|
556
|
+
/* @__PURE__ */ e(te.Input, {
|
|
557
|
+
...b,
|
|
558
|
+
form: h,
|
|
559
|
+
className: U(G(ne.input, ne.sm, H.valueInput), f)
|
|
560
|
+
}),
|
|
561
|
+
C && /* @__PURE__ */ e(te.Increment, {
|
|
562
|
+
"aria-label": I,
|
|
563
|
+
render: /* @__PURE__ */ e(z, {
|
|
564
|
+
type: "button",
|
|
565
|
+
size: "sm",
|
|
566
|
+
className: H.button,
|
|
567
|
+
startIcon: /* @__PURE__ */ e("span", {
|
|
568
|
+
className: H.icon,
|
|
569
|
+
children: /* @__PURE__ */ e(Je, {})
|
|
570
|
+
})
|
|
571
|
+
})
|
|
572
|
+
})
|
|
573
|
+
]
|
|
574
|
+
});
|
|
575
|
+
}, Ha = "_trigger_kh8iq_1", Wa = "_triggerFlag_kh8iq_35", Ka = "_optionFlag_kh8iq_36", Xa = "_chevron_kh8iq_56", Ya = "_selectedCountryLabel_kh8iq_61", Za = "_options_kh8iq_70", Ja = "_emptyStatus_kh8iq_76", q = {
|
|
576
|
+
trigger: Ha,
|
|
577
|
+
triggerFlag: Wa,
|
|
578
|
+
optionFlag: Ka,
|
|
579
|
+
chevron: Xa,
|
|
580
|
+
selectedCountryLabel: Ya,
|
|
581
|
+
options: Za,
|
|
582
|
+
emptyStatus: Ja
|
|
583
|
+
}, Qa = ({ label: a, callingCode: r }) => `${a} (+${r})`, er = "", ar = "", rr = ({ label: a, callingCode: r }) => `${a} (${er}+${r}${ar})`, tr = ({ country: a, normalizedSearch: r, callingCodeSearch: t }) => a.searchLabel.includes(r) || a.searchValue.includes(r) || R(t) && a.callingCode.includes(t), De = _e(null), Me = () => {
|
|
584
|
+
const a = ee(De);
|
|
585
|
+
if (!y(a)) throw new Error(P("PhoneCountryPicker parts require PhoneCountryPicker.Root."));
|
|
586
|
+
return a;
|
|
587
|
+
}, Be = ({ searchLabel: a = P("Search"), listLabel: r = P("Countries"), emptyLabel: t = P("No results"), disabled: o = !1, className: l, render: n, ref: i, ...d }) => {
|
|
588
|
+
const { countries: c, value: u, onValueChange: v, disabled: p, closeOnSelect: h } = Me(), m = p || o, C = M(), [O, I] = D(""), f = K(O).trim(), b = f.startsWith("+") ? f.slice(1) : f, T = c.filter((s) => tr({
|
|
589
|
+
country: s,
|
|
590
|
+
normalizedSearch: f,
|
|
591
|
+
callingCodeSearch: b
|
|
592
|
+
})), N = T.find((s) => s.value === u), g = y(N) ? [N, ...T.filter((s) => s.value !== u)] : T;
|
|
593
|
+
return be({
|
|
594
|
+
render: n,
|
|
595
|
+
ref: i,
|
|
596
|
+
props: {
|
|
597
|
+
...d,
|
|
598
|
+
className: G(q.options, l),
|
|
599
|
+
children: /* @__PURE__ */ S(L, { children: [
|
|
600
|
+
/* @__PURE__ */ e(_.Search, {
|
|
601
|
+
value: O,
|
|
602
|
+
onValueChange: I,
|
|
603
|
+
placeholder: a,
|
|
604
|
+
"aria-label": a,
|
|
605
|
+
disabled: m
|
|
606
|
+
}),
|
|
607
|
+
/* @__PURE__ */ e(_.Separator, {}),
|
|
608
|
+
/* @__PURE__ */ e(_.Section, {
|
|
609
|
+
scrollable: !0,
|
|
610
|
+
children: /* @__PURE__ */ e(_.SelectionGroup, {
|
|
611
|
+
id: C,
|
|
612
|
+
"aria-label": r,
|
|
613
|
+
value: u,
|
|
614
|
+
onValueChange: v,
|
|
615
|
+
closeOnSelect: h,
|
|
616
|
+
children: g.map((s) => {
|
|
617
|
+
const k = Qa(s);
|
|
618
|
+
return /* @__PURE__ */ e(_.OptionItem, {
|
|
619
|
+
value: s.value,
|
|
620
|
+
"aria-label": k,
|
|
621
|
+
disabled: m || s.disabled,
|
|
622
|
+
startIcon: /* @__PURE__ */ e("span", {
|
|
623
|
+
className: q.optionFlag,
|
|
624
|
+
"aria-hidden": !0,
|
|
625
|
+
children: s.flag
|
|
626
|
+
}),
|
|
627
|
+
children: /* @__PURE__ */ e(ve, {
|
|
628
|
+
text: /* @__PURE__ */ S(L, { children: [
|
|
629
|
+
s.label,
|
|
630
|
+
" (",
|
|
631
|
+
/* @__PURE__ */ S("bdi", {
|
|
632
|
+
dir: "ltr",
|
|
633
|
+
children: ["+", s.callingCode]
|
|
634
|
+
}),
|
|
635
|
+
")"
|
|
636
|
+
] }),
|
|
637
|
+
tooltipContent: rr(s)
|
|
638
|
+
})
|
|
639
|
+
}, s.value);
|
|
640
|
+
})
|
|
641
|
+
})
|
|
642
|
+
}),
|
|
643
|
+
/* @__PURE__ */ e(_.Empty, {
|
|
644
|
+
className: q.emptyStatus,
|
|
645
|
+
children: Q(g) ? null : t
|
|
646
|
+
})
|
|
647
|
+
] })
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
}, qe = ({ children: a, countries: r, value: t, defaultValue: o = null, onValueChange: l, disabled: n = !1, closeOnSelect: i = !0 }) => {
|
|
651
|
+
const [d, c] = D(o), u = le(t) ? d : t, v = r.map((p) => ({
|
|
652
|
+
...p,
|
|
653
|
+
searchLabel: K(p.label),
|
|
654
|
+
searchValue: K(p.value)
|
|
655
|
+
}));
|
|
656
|
+
return /* @__PURE__ */ e(De.Provider, {
|
|
657
|
+
value: {
|
|
658
|
+
countries: v,
|
|
659
|
+
value: u,
|
|
660
|
+
disabled: n,
|
|
661
|
+
closeOnSelect: i,
|
|
662
|
+
onValueChange: (p, h) => {
|
|
663
|
+
l?.(p, h), !h.isCanceled && le(t) && c(p);
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
children: a
|
|
667
|
+
});
|
|
668
|
+
}, ze = ({ children: a, disabled: r = !1, className: t, "aria-describedby": o, ...l }) => {
|
|
669
|
+
const { countries: n, value: i, disabled: d } = Me(), c = n.find((p) => p.value === i), u = M(), v = [y(c) && u, o].filter(R).join(" ") || void 0;
|
|
670
|
+
return /* @__PURE__ */ S(_.Trigger, {
|
|
671
|
+
...l,
|
|
672
|
+
disabled: d || r,
|
|
673
|
+
"aria-describedby": v,
|
|
674
|
+
className: U(q.trigger, t),
|
|
675
|
+
children: [a ?? /* @__PURE__ */ S(L, { children: [/* @__PURE__ */ e("span", {
|
|
676
|
+
className: q.triggerFlag,
|
|
677
|
+
"aria-hidden": !0,
|
|
678
|
+
children: c?.flag ?? /* @__PURE__ */ e(Ze, {})
|
|
679
|
+
}), /* @__PURE__ */ e(he, {
|
|
680
|
+
className: q.chevron,
|
|
681
|
+
"aria-hidden": !0
|
|
682
|
+
})] }), y(c) && /* @__PURE__ */ e("span", {
|
|
683
|
+
id: u,
|
|
684
|
+
className: q.selectedCountryLabel,
|
|
685
|
+
children: c.label
|
|
686
|
+
})]
|
|
687
|
+
});
|
|
688
|
+
}, nr = ({ countries: a, value: r, defaultValue: t, onValueChange: o, disabled: l, closeOnSelect: n, dropdownProps: i, contentProps: d, optionsProps: c, ...u }) => /* @__PURE__ */ e(qe, {
|
|
689
|
+
countries: a,
|
|
690
|
+
value: r,
|
|
691
|
+
defaultValue: t,
|
|
692
|
+
onValueChange: o,
|
|
693
|
+
disabled: l,
|
|
694
|
+
closeOnSelect: n,
|
|
695
|
+
children: /* @__PURE__ */ S(_.Root, {
|
|
696
|
+
...i,
|
|
697
|
+
type: "picker",
|
|
698
|
+
children: [/* @__PURE__ */ e(ze, { ...u }), /* @__PURE__ */ e(_.Content, {
|
|
699
|
+
width: 280,
|
|
700
|
+
...d,
|
|
701
|
+
children: /* @__PURE__ */ e(Be, { ...c })
|
|
702
|
+
})]
|
|
703
|
+
})
|
|
704
|
+
}), Ur = Object.assign(nr, {
|
|
705
|
+
Root: qe,
|
|
706
|
+
Trigger: ze,
|
|
707
|
+
Options: Be
|
|
708
|
+
}), or = "_wrapper_c0mqd_1", lr = "_inputGroup_c0mqd_8", ir = "_searchIcon_c0mqd_14", me = {
|
|
709
|
+
wrapper: or,
|
|
710
|
+
inputGroup: lr,
|
|
711
|
+
searchIcon: ir
|
|
712
|
+
}, jr = ({ placeholder: a, actions: r, size: t = "md", id: o, "aria-label": l, "aria-labelledby": n, ...i }) => {
|
|
713
|
+
const d = Ie(), c = M(), u = o ?? c;
|
|
714
|
+
return /* @__PURE__ */ S("div", {
|
|
715
|
+
className: me.wrapper,
|
|
716
|
+
children: [/* @__PURE__ */ e(ra, {
|
|
717
|
+
className: me.inputGroup,
|
|
718
|
+
size: t,
|
|
719
|
+
startElement: /* @__PURE__ */ e(Ye, {
|
|
720
|
+
className: me.searchIcon,
|
|
721
|
+
size: d.icon.size.md,
|
|
722
|
+
"aria-hidden": !0
|
|
723
|
+
}),
|
|
724
|
+
children: /* @__PURE__ */ e(aa, {
|
|
725
|
+
...i,
|
|
726
|
+
id: u,
|
|
727
|
+
placeholder: a,
|
|
728
|
+
"aria-label": R(n) ? void 0 : l ?? a,
|
|
729
|
+
"aria-labelledby": n
|
|
730
|
+
})
|
|
731
|
+
}), r]
|
|
732
|
+
});
|
|
733
|
+
}, sr = "_container_1eoop_1", cr = "_sm_1eoop_20", dr = "_md_1eoop_26", ur = "_item_1eoop_32", mr = "_iconOnly_1eoop_72", pr = "_icon_1eoop_72", hr = "_label_1eoop_91", W = {
|
|
734
|
+
container: sr,
|
|
735
|
+
sm: cr,
|
|
736
|
+
md: dr,
|
|
737
|
+
item: ur,
|
|
738
|
+
iconOnly: mr,
|
|
739
|
+
icon: pr,
|
|
740
|
+
label: hr
|
|
741
|
+
}, Hr = ({ className: a, itemWidth: r = "equal", options: t, size: o = "md", ...l }) => {
|
|
742
|
+
const n = M();
|
|
743
|
+
return /* @__PURE__ */ e(ua, {
|
|
744
|
+
...l,
|
|
745
|
+
className: U(G(W.container, W[o]), a),
|
|
746
|
+
"data-item-width": r,
|
|
747
|
+
children: t.map(({ "aria-label": i, disabled: d, label: c, startIcon: u, value: v }, p) => {
|
|
748
|
+
const h = `${n}-${p}`, m = R(i);
|
|
749
|
+
return /* @__PURE__ */ S(ta.Root, {
|
|
750
|
+
value: v,
|
|
751
|
+
disabled: d,
|
|
752
|
+
"aria-labelledby": h,
|
|
753
|
+
className: G(W.item, !de(c) && W.iconOnly),
|
|
754
|
+
children: [
|
|
755
|
+
de(u) && /* @__PURE__ */ e("span", {
|
|
756
|
+
className: W.icon,
|
|
757
|
+
"aria-hidden": !0,
|
|
758
|
+
children: u
|
|
759
|
+
}),
|
|
760
|
+
de(c) && /* @__PURE__ */ e("span", {
|
|
761
|
+
id: m ? void 0 : h,
|
|
762
|
+
className: W.label,
|
|
763
|
+
children: c
|
|
764
|
+
}),
|
|
765
|
+
m && /* @__PURE__ */ e("span", {
|
|
766
|
+
id: h,
|
|
767
|
+
hidden: !0,
|
|
768
|
+
children: i
|
|
769
|
+
})
|
|
770
|
+
]
|
|
771
|
+
}, v);
|
|
772
|
+
})
|
|
773
|
+
});
|
|
774
|
+
};
|
|
775
|
+
export {
|
|
776
|
+
qr as a,
|
|
777
|
+
Dr as c,
|
|
778
|
+
zr as i,
|
|
779
|
+
Gr as l,
|
|
780
|
+
jr as n,
|
|
781
|
+
Br as o,
|
|
782
|
+
Ur as r,
|
|
783
|
+
Mr as s,
|
|
784
|
+
Hr as t
|
|
785
|
+
};
|