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.
Files changed (203) hide show
  1. package/README.md +27 -2
  2. package/dist/Avatar-C6WxBgjS.cjs +1 -0
  3. package/dist/{Avatar-D-QA0RE5.js → Avatar-ifVlxbx_.js} +18 -17
  4. package/dist/{Button-D5enZ0Qz.js → Button-DIw804CX.js} +1 -1
  5. package/dist/{Button-Dbi5P05r.cjs → Button-DTm1WDzp.cjs} +1 -1
  6. package/dist/Dropdown-1OAJvS1f.js +1000 -0
  7. package/dist/Dropdown-Bl4OXCf9.cjs +1 -0
  8. package/dist/{ListItem-CjnrSbka.js → ListItem-DizNUBT8.js} +1 -1
  9. package/dist/{ListItem-CHTR-GLd.cjs → ListItem-DwBb-I1D.cjs} +1 -1
  10. package/dist/{ProgressBar-BvT1dyFo.js → ProgressBar-B3xACTV2.js} +1 -1
  11. package/dist/{ProgressBar-DfFz0fFB.cjs → ProgressBar-OpSMnDBz.cjs} +1 -1
  12. package/dist/{Radio-DMI1B7o5.js → Radio-BEAztmPu.js} +1 -1
  13. package/dist/{Radio-xmHgGHQO.cjs → Radio-Dx6b4SYZ.cjs} +1 -1
  14. package/dist/ResizeHandle-B1MuHTNA.cjs +1 -0
  15. package/dist/{ResizeHandle-C1kQ3MYR.js → ResizeHandle-B30OYZxS.js} +56 -55
  16. package/dist/Shortcut-Bp9iDdQg.js +73 -0
  17. package/dist/Shortcut-N8TELGPI.cjs +1 -0
  18. package/dist/{TintedIconTile-4BGa8g8n.js → TintedIconTile-B1XDtGrF.js} +1 -1
  19. package/dist/{TintedIconTile-CU2hCerq.cjs → TintedIconTile-DO1XJXCQ.cjs} +1 -1
  20. package/dist/components/__stories__/reading-direction/DirectionalLayoutExample.d.ts +3 -1
  21. package/dist/components/code-editor.cjs +1 -1
  22. package/dist/components/code-editor.mjs +52 -51
  23. package/dist/components/data-display.cjs +1 -1
  24. package/dist/components/data-display.mjs +2 -2
  25. package/dist/components/feedback.cjs +1 -1
  26. package/dist/components/feedback.mjs +1 -1
  27. package/dist/components/input/CountrySelect/CountrySelect.d.ts +5 -2
  28. package/dist/components/input/CountrySelect/__stories__/CountrySelectPartsExample.d.ts +11 -0
  29. package/dist/components/input/CountrySelect/internal/CountrySelectComponent.d.ts +2 -0
  30. package/dist/components/input/CountrySelect/internal/CountrySelectContext.d.ts +2 -0
  31. package/dist/components/input/CountrySelect/internal/CountrySelectContextValue.d.ts +11 -0
  32. package/dist/components/input/CountrySelect/internal/CountrySelectDropdown.d.ts +4 -0
  33. package/dist/components/input/CountrySelect/internal/CountrySelectOptions.d.ts +2 -11
  34. package/dist/components/input/CountrySelect/internal/CountrySelectOptionsContent.d.ts +2 -0
  35. package/dist/components/input/CountrySelect/internal/CountrySelectRoot.d.ts +2 -0
  36. package/dist/components/input/CountrySelect/internal/CountrySelectTrigger.d.ts +2 -0
  37. package/dist/components/input/CountrySelect/internal/NO_COUNTRY_SELECTION_VALUE.d.ts +1 -0
  38. package/dist/components/input/CountrySelect/internal/PreparedCountryChoice.d.ts +5 -0
  39. package/dist/components/input/CountrySelect/internal/getCountrySelectionValue.d.ts +1 -0
  40. package/dist/components/input/CountrySelect/internal/useCountrySelectContextOrThrow.d.ts +1 -0
  41. package/dist/components/input/CountrySelect/types/CountryChoice.d.ts +1 -0
  42. package/dist/components/input/CountrySelect/types/CountrySelectOptionsProps.d.ts +10 -0
  43. package/dist/components/input/CountrySelect/types/CountrySelectOptionsState.d.ts +4 -0
  44. package/dist/components/input/CountrySelect/types/CountrySelectProps.d.ts +7 -13
  45. package/dist/components/input/CountrySelect/types/CountrySelectRootProps.d.ts +12 -0
  46. package/dist/components/input/CountrySelect/types/CountrySelectTriggerProps.d.ts +6 -0
  47. package/dist/components/input/CurrencyPicker/CurrencyPicker.d.ts +4 -3
  48. package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerChangingDefaultExample.d.ts +5 -0
  49. package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerControlledExample.d.ts +5 -0
  50. package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerControlledSearchExample.d.ts +5 -0
  51. package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerExample.d.ts +3 -4
  52. package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerListLabelExample.d.ts +1 -0
  53. package/dist/components/input/CurrencyPicker/__stories__/CurrencyPickerRootStateExample.d.ts +1 -0
  54. package/dist/components/input/CurrencyPicker/internal/CurrencyPickerContext.d.ts +11 -0
  55. package/dist/components/input/CurrencyPicker/internal/CurrencyPickerOptions.d.ts +1 -1
  56. package/dist/components/input/CurrencyPicker/internal/CurrencyPickerRoot.d.ts +2 -0
  57. package/dist/components/input/CurrencyPicker/internal/CurrencyPickerShorthand.d.ts +2 -0
  58. package/dist/components/input/CurrencyPicker/internal/CurrencyPickerTrigger.d.ts +1 -1
  59. package/dist/components/input/CurrencyPicker/internal/PreparedCurrencyPickerOption.d.ts +7 -0
  60. package/dist/components/input/CurrencyPicker/internal/getCurrencyPickerSearchText.d.ts +2 -0
  61. package/dist/components/input/CurrencyPicker/internal/useCurrencyPickerContextOrThrow.d.ts +7 -0
  62. package/dist/components/input/CurrencyPicker/types/CurrencyPickerChangeEventDetails.d.ts +2 -0
  63. package/dist/components/input/CurrencyPicker/types/CurrencyPickerOption.d.ts +1 -0
  64. package/dist/components/input/CurrencyPicker/types/CurrencyPickerOptionsProps.d.ts +6 -5
  65. package/dist/components/input/CurrencyPicker/types/CurrencyPickerProps.d.ts +10 -0
  66. package/dist/components/input/CurrencyPicker/types/CurrencyPickerRootProps.d.ts +17 -0
  67. package/dist/components/input/CurrencyPicker/types/CurrencyPickerState.d.ts +6 -0
  68. package/dist/components/input/CurrencyPicker/types/CurrencyPickerTriggerProps.d.ts +3 -2
  69. package/dist/components/input/IconButton/__stories__/IconButtonExample.d.ts +7 -0
  70. package/dist/components/input/PhoneCountryPicker/PhoneCountryPicker.d.ts +5 -3
  71. package/dist/components/input/PhoneCountryPicker/__stories__/PhoneCountryPickerExample.d.ts +7 -3
  72. package/dist/components/input/PhoneCountryPicker/__stories__/testDisabledPhoneCountryPicker.d.ts +5 -0
  73. package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountryCallingCodeDirection.d.ts +3 -0
  74. package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountryNullSelection.d.ts +5 -0
  75. package/dist/components/input/PhoneCountryPicker/__stories__/testPhoneCountrySelection.d.ts +5 -0
  76. package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerContext.d.ts +9 -0
  77. package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerOptions.d.ts +1 -1
  78. package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerRoot.d.ts +2 -0
  79. package/dist/components/input/PhoneCountryPicker/internal/PhoneCountryPickerTrigger.d.ts +1 -1
  80. package/dist/components/input/PhoneCountryPicker/internal/PreparedPhoneCountryOption.d.ts +5 -0
  81. package/dist/components/input/PhoneCountryPicker/internal/getPhoneCountryOptionTooltipLabel.d.ts +2 -0
  82. package/dist/components/input/PhoneCountryPicker/internal/matchesPhoneCountrySearch.d.ts +6 -0
  83. package/dist/components/input/PhoneCountryPicker/internal/usePhoneCountryPickerContextOrThrow.d.ts +7 -0
  84. package/dist/components/input/PhoneCountryPicker/types/PhoneCountryOption.d.ts +1 -0
  85. package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerOptionsProps.d.ts +4 -5
  86. package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerProps.d.ts +10 -0
  87. package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerRootProps.d.ts +12 -0
  88. package/dist/components/input/PhoneCountryPicker/types/PhoneCountryPickerTriggerProps.d.ts +1 -3
  89. package/dist/components/input/index.d.ts +10 -0
  90. package/dist/components/input.cjs +1 -1
  91. package/dist/components/input.mjs +13 -13
  92. package/dist/components/layout/OverflowingList/internal/measureItemWidths.d.ts +1 -2
  93. package/dist/components/layout/OverflowingList/internal/measureOverflowingListLayout.d.ts +1 -2
  94. package/dist/components/layout.cjs +1 -1
  95. package/dist/components/layout.mjs +1 -1
  96. package/dist/components/navigation/Dropdown/Dropdown.d.ts +2 -1
  97. package/dist/components/navigation/Dropdown/__stories__/DropdownIconGridExample.d.ts +3 -0
  98. package/dist/components/navigation/Dropdown/__stories__/DropdownSelectionGroupsExample.d.ts +1 -0
  99. package/dist/components/navigation/Dropdown/internal/DropdownContextValue.d.ts +6 -1
  100. package/dist/components/navigation/Dropdown/internal/DropdownOptionItem.d.ts +1 -1
  101. package/dist/components/navigation/Dropdown/internal/DropdownOptionItemOwner.d.ts +7 -0
  102. package/dist/components/navigation/Dropdown/internal/DropdownSelectionContext.d.ts +2 -0
  103. package/dist/components/navigation/Dropdown/internal/DropdownSelectionContextValue.d.ts +9 -0
  104. package/dist/components/navigation/Dropdown/internal/DropdownSelectionGroup.d.ts +2 -0
  105. package/dist/components/navigation/Dropdown/internal/DropdownSelectionGroupEffect.d.ts +11 -0
  106. package/dist/components/navigation/Dropdown/internal/createDropdownSelectionEventDetails.d.ts +5 -0
  107. package/dist/components/navigation/Dropdown/internal/dropdownItemActivation.d.ts +11 -0
  108. package/dist/components/navigation/Dropdown/internal/getDropdownItemExplicitId.d.ts +2 -2
  109. package/dist/components/navigation/Dropdown/internal/getDropdownOptionItemRole.d.ts +9 -0
  110. package/dist/components/navigation/Dropdown/internal/getDropdownSelectionGroupState.d.ts +6 -0
  111. package/dist/components/navigation/Dropdown/internal/getTrailingFocusGuard.d.ts +1 -0
  112. package/dist/components/navigation/Dropdown/internal/isDropdownOptionItemSelected.d.ts +6 -0
  113. package/dist/components/navigation/Dropdown/internal/useDropdownSelections.d.ts +12 -0
  114. package/dist/components/navigation/Dropdown/types/DropdownOptionItemProps.d.ts +7 -2
  115. package/dist/components/navigation/Dropdown/types/DropdownOptionItemSelectEventDetails.d.ts +2 -0
  116. package/dist/components/navigation/Dropdown/types/DropdownOptionItemState.d.ts +5 -0
  117. package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupChangeEventDetails.d.ts +7 -0
  118. package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupProps.d.ts +21 -0
  119. package/dist/components/navigation/Dropdown/types/DropdownSelectionGroupState.d.ts +7 -0
  120. package/dist/components/navigation/index.d.ts +5 -0
  121. package/dist/components/navigation.cjs +1 -1
  122. package/dist/components/navigation.mjs +2 -2
  123. package/dist/components/settings.cjs +1 -1
  124. package/dist/components/settings.mjs +1 -1
  125. package/dist/components.cjs +1 -1
  126. package/dist/components.mjs +22 -22
  127. package/dist/data-display-BSKGlijb.cjs +1 -0
  128. package/dist/{data-display-KyZbLLy-.js → data-display-BtXCGOGw.js} +81 -80
  129. package/dist/{data-display-0QO_WDSs.js → data-display-DtXIhJ4B.js} +45 -44
  130. package/dist/data-display-XV3ht1rC.cjs +2 -0
  131. package/dist/doNotTranslate-BSVT8Xyd.js +4 -0
  132. package/dist/doNotTranslate-CHE7WmRS.cjs +1 -0
  133. package/dist/feedback-Cs-38OH4.cjs +1 -0
  134. package/dist/{feedback-CM6fatE8.js → feedback-DTyVVcTb.js} +198 -197
  135. package/dist/index.cjs +1 -1
  136. package/dist/index.mjs +42 -42
  137. package/dist/{input-CJDYNwoO.cjs → input-B_rBplmn.cjs} +1 -1
  138. package/dist/input-BrjD91wv.js +785 -0
  139. package/dist/input-ChlFcqIS.cjs +1 -0
  140. package/dist/{input-DRpDiMRi.js → input-D1oyk0tD.js} +2 -2
  141. package/dist/layout-CthYckvl.cjs +1 -0
  142. package/dist/layout-DQcjBu08.js +439 -0
  143. package/dist/{navigation-B1SRvzKK.js → navigation-B6nka3bW.js} +125 -128
  144. package/dist/navigation-CIVYqPc5.js +132 -0
  145. package/dist/navigation-CflGBYv-.cjs +1 -0
  146. package/dist/navigation-DoInK0Sp.cjs +1 -0
  147. package/dist/preventDismissingClickActivation-AaqHBLnW.js +45 -0
  148. package/dist/preventDismissingClickActivation-CIhWvKCu.cjs +1 -0
  149. package/dist/primitives/data-display.cjs +1 -1
  150. package/dist/primitives/data-display.mjs +2 -2
  151. package/dist/primitives/feedback.cjs +1 -1
  152. package/dist/primitives/feedback.mjs +1 -1
  153. package/dist/primitives/input/Radio/__stories__/RadioCardContent.d.ts +8 -0
  154. package/dist/primitives/input.cjs +1 -1
  155. package/dist/primitives/input.mjs +3 -3
  156. package/dist/primitives/layout/ResizeHandle/__stories__/ResizableNotesExample.d.ts +2 -0
  157. package/dist/primitives/layout.cjs +1 -1
  158. package/dist/primitives/layout.mjs +1 -1
  159. package/dist/primitives/navigation.cjs +1 -1
  160. package/dist/primitives/navigation.mjs +2 -2
  161. package/dist/primitives/typography.cjs +1 -1
  162. package/dist/primitives/typography.mjs +2 -2
  163. package/dist/primitives.cjs +1 -1
  164. package/dist/primitives.mjs +11 -11
  165. package/dist/{settings-BjEZiHXE.js → settings-BgVuLpg9.js} +1 -1
  166. package/dist/{settings-BAYsnlZJ.cjs → settings-CPXhrmbK.cjs} +1 -1
  167. package/dist/style.css +1 -1
  168. package/dist/testing/GroupedCatalog.d.ts +14 -0
  169. package/dist/testing/index.d.ts +1 -0
  170. package/dist/testing.cjs +1 -1
  171. package/dist/testing.mjs +96 -66
  172. package/dist/{typography-fOTFr0jS.js → typography-DT2eKLvd.js} +1 -1
  173. package/dist/{typography-B5QEuPaL.cjs → typography-bKeSMuJd.cjs} +1 -1
  174. package/dist/useIsMobile-Byp9AIq-.cjs +1 -0
  175. package/dist/useIsMobile-D1ImfQnE.js +38 -0
  176. package/dist/utilities/internal/doNotTranslate.d.ts +1 -0
  177. package/dist/utilities-BKCMZyqZ.js +53 -0
  178. package/dist/utilities-xZh8D2gd.cjs +1 -0
  179. package/dist/utilities.cjs +1 -1
  180. package/dist/utilities.mjs +3 -3
  181. package/package.json +3 -3
  182. package/dist/Avatar-CQhIEazb.cjs +0 -1
  183. package/dist/Dropdown-BKjAaZS0.cjs +0 -1
  184. package/dist/Dropdown-C2hXrjvD.js +0 -820
  185. package/dist/ResizeHandle-DI4LHIQm.cjs +0 -1
  186. package/dist/Shortcut-BvWUZ3pb.js +0 -72
  187. package/dist/Shortcut-CgrdLv_L.cjs +0 -1
  188. package/dist/data-display-CPmTJAWJ.cjs +0 -1
  189. package/dist/data-display-DjhAHvj1.cjs +0 -2
  190. package/dist/feedback-ybO4n69s.cjs +0 -1
  191. package/dist/input-3D2lXywH.cjs +0 -1
  192. package/dist/input-TM3nUdu6.js +0 -554
  193. package/dist/layout-BszCDxAO.js +0 -441
  194. package/dist/layout-VaIq7Sjr.cjs +0 -1
  195. package/dist/navigation-CYAs2LnR.js +0 -131
  196. package/dist/navigation-CthkGHJ8.cjs +0 -1
  197. package/dist/navigation-DrOV5E67.cjs +0 -1
  198. package/dist/preventDismissingClickActivation-CzWqpjiX.js +0 -44
  199. package/dist/preventDismissingClickActivation-DZxTSLV3.cjs +0 -1
  200. package/dist/useIsMobile-DxOPI2_E.cjs +0 -1
  201. package/dist/useIsMobile-nrufFzMb.js +0 -37
  202. package/dist/utilities-BeLfNQ0Q.cjs +0 -1
  203. package/dist/utilities-CEi9I09B.js +0 -52
@@ -1,554 +0,0 @@
1
- import { t as N } from "./isDefined-fMi6eQ4r.js";
2
- import { Pn as Ie, So as we, Tn as he, Uc as xe, Wo as Fe, Zc as $e, gl as Me, js as ze, ml as Be, ts as De } from "./icon-CUE-QGQK.js";
3
- import { r as ye } from "./theme-B2EaXhye.js";
4
- import { t as M } from "./mergeClassNames-ClFMR1v0.js";
5
- import { n as Z } from "./preventDismissingClickActivation-CzWqpjiX.js";
6
- import { r as Ne, t as F } from "./Button-D5enZ0Qz.js";
7
- import { t as de } from "./isRenderableSlot-DT_depzM.js";
8
- import { t as ve } from "./OverflowingTextWithTooltip-BmUROIah.js";
9
- import { t as d } from "./Dropdown-C2hXrjvD.js";
10
- import { n as te, t as Ve } from "./Input-DZWl81G_.js";
11
- import { i as ue, n as Ae, r as ae, t as Ge } from "./Radio-DMI1B7o5.js";
12
- import { useRender as Se } from "@base-ui/react/use-render";
13
- import { isFunction as ge, isNonEmptyArray as Q, isNonEmptyString as C } from "@sniptt/guards";
14
- import { clsx as A } from "clsx";
15
- import { useContext as Oe, useEffect as Le, useId as oe, useRef as je, useState as $ } from "react";
16
- import { Fragment as Y, jsx as e, jsxs as h } from "react/jsx-runtime";
17
- import { useMergedRefs as Ue } from "@base-ui/utils/useMergedRefs";
18
- import { useStableCallback as qe } from "@base-ui/utils/useStableCallback";
19
- import { useControlled as We } from "@base-ui/utils/useControlled";
20
- import { useValueAsRef as He } from "@base-ui/utils/useValueAsRef";
21
- import { formatNumber as fe } from "@base-ui/utils/formatNumber";
22
- import { RadioGroup as Ke } from "@base-ui/react/radio-group";
23
- var Xe = "_root_1x3d7_1", Ze = "_label_1x3d7_6", Je = "_flag_1x3d7_14", J = {
24
- root: Xe,
25
- label: Ze,
26
- flag: Je
27
- }, Qe = ({ disabled: r, open: a, onOpenChange: t }) => {
28
- const n = qe(t);
29
- return Le(() => {
30
- !r || !a || n(!1);
31
- }, [
32
- r,
33
- a,
34
- n
35
- ]), null;
36
- }, Ye = ({ countries: r, value: a, onValueChange: t, searchLabel: n, noCountryLabel: i, noResultsLabel: o }) => {
37
- const [u, s] = $(""), c = Z(u.trim()), m = C(c), f = r.filter((_) => Z(_.label).includes(c)), l = Z(i).includes(c), v = l || Q(f), b = l && /* @__PURE__ */ e(d.OptionItem, {
38
- selected: !C(a),
39
- startIcon: /* @__PURE__ */ e("span", {
40
- className: J.flag,
41
- "aria-hidden": "true",
42
- children: /* @__PURE__ */ e(Ie, {})
43
- }),
44
- onSelect: () => t(""),
45
- children: i
46
- });
47
- return /* @__PURE__ */ h(Y, { children: [
48
- /* @__PURE__ */ e(d.Search, {
49
- value: u,
50
- onValueChange: s,
51
- placeholder: n,
52
- "aria-label": n
53
- }),
54
- v && /* @__PURE__ */ e(d.Separator, {}),
55
- v && /* @__PURE__ */ h(d.Section, {
56
- scrollable: !0,
57
- children: [
58
- !m && b,
59
- f.map((_) => /* @__PURE__ */ e(d.OptionItem, {
60
- selected: _.value === a,
61
- startIcon: /* @__PURE__ */ e("span", {
62
- className: J.flag,
63
- "aria-hidden": "true",
64
- children: _.flag
65
- }),
66
- onSelect: () => t(_.value),
67
- children: _.label
68
- }, _.value)),
69
- m && b
70
- ]
71
- }),
72
- !v && /* @__PURE__ */ e(d.Empty, { children: o })
73
- ] });
74
- }, er = ({ ariaLabelledBy: r, ariaLabel: a, visibleLabelId: t }) => {
75
- if (C(r)) return r;
76
- if (!C(a))
77
- return t;
78
- }, K = (r) => r.preventBaseUIHandler?.(), ma = ({ countries: r, value: a, onValueChange: t, label: n, searchLabel: i = "Search", noCountryLabel: o = "No country", noResultsLabel: u = "No results", open: s, onOpenChange: c, popupProps: m, disabled: f = !1, className: l, style: v, render: b, onClick: _, onMouseDown: O, onPointerDown: k, onKeyDown: p, onKeyUp: G, id: z, "aria-label": E, "aria-labelledby": T, "aria-describedby": L, ...S }) => {
79
- const y = oe(), j = z ?? y, ee = `${y}-label`, U = `${y}-value`, q = C(n), P = C(E) ? E : void 0, B = er({
80
- ariaLabelledBy: T,
81
- ariaLabel: P,
82
- visibleLabelId: q ? ee : void 0
83
- }), w = [L, N(B) || N(P) ? U : void 0].filter(C), [ie, le] = $(!1), g = f || !Q(r), W = s ?? ie, x = !g && W, [H, re] = $(x), [_e, Te] = $(0);
84
- H !== x && (re(x), x && Te(_e + 1));
85
- const se = r.find((I) => I.value === a), Pe = se?.label ?? o, Re = N(se) ? se.flag : /* @__PURE__ */ e(Ie, {}), ce = (I) => ({
86
- ...I,
87
- disabled: g
88
- }), ke = M(A(te.input, te.md, ue.trigger), l), be = (I) => {
89
- I && g || (le(I), c?.(I));
90
- };
91
- return /* @__PURE__ */ h("div", {
92
- className: J.root,
93
- children: [
94
- /* @__PURE__ */ e(Qe, {
95
- disabled: g,
96
- open: W,
97
- onOpenChange: be
98
- }),
99
- q && /* @__PURE__ */ e("label", {
100
- id: ee,
101
- className: J.label,
102
- htmlFor: j,
103
- children: n
104
- }),
105
- /* @__PURE__ */ h(d.Root, {
106
- type: "picker",
107
- open: x,
108
- onOpenChange: be,
109
- children: [/* @__PURE__ */ h(d.Trigger, {
110
- ...S,
111
- id: j,
112
- "aria-label": P,
113
- "aria-labelledby": B,
114
- "aria-describedby": Q(w) ? w.join(" ") : void 0,
115
- "aria-disabled": g || void 0,
116
- "data-disabled": g ? "" : void 0,
117
- onClick: g ? K : _,
118
- onMouseDown: g ? K : O,
119
- onPointerDown: g ? K : k,
120
- onKeyDown: g ? K : p,
121
- onKeyUp: g ? K : G,
122
- className: (I) => ke(ce(I)),
123
- style: ge(v) ? (I) => v(ce(I)) : v,
124
- render: ge(b) ? (I, Ee) => b(I, ce(Ee)) : b,
125
- children: [
126
- /* @__PURE__ */ e("span", {
127
- className: J.flag,
128
- "aria-hidden": "true",
129
- children: Re
130
- }),
131
- /* @__PURE__ */ e("span", {
132
- className: ue.value,
133
- id: U,
134
- children: /* @__PURE__ */ e(ve, { text: Pe })
135
- }),
136
- /* @__PURE__ */ e("span", {
137
- className: ue.icon,
138
- "aria-hidden": "true",
139
- children: /* @__PURE__ */ e(he, {})
140
- })
141
- ]
142
- }), /* @__PURE__ */ e(d.Content, {
143
- ...m,
144
- "aria-label": P,
145
- "aria-labelledby": B,
146
- children: /* @__PURE__ */ e(Ye, {
147
- countries: r,
148
- value: a,
149
- onValueChange: t,
150
- searchLabel: i,
151
- noCountryLabel: o,
152
- noResultsLabel: u
153
- }, _e)
154
- })]
155
- })
156
- ]
157
- });
158
- }, rr = "_trigger_18tlx_1", ar = "_chevron_18tlx_40", tr = "_options_18tlx_45", nr = "_emptyStatus_18tlx_51", ne = {
159
- trigger: rr,
160
- chevron: ar,
161
- options: tr,
162
- emptyStatus: nr
163
- }, Ce = ({ code: r, name: a }) => `${a} (${r})`, or = ({ currencies: r, value: a, onValueChange: t, disabled: n = !1, searchLabel: i = "Search", emptyLabel: o = "No results", className: u, render: s, ref: c, ...m }) => {
164
- const [f, l] = $(""), v = f.trim().toLowerCase(), b = r.filter((p) => Ce(p).toLowerCase().includes(v)), _ = Q(b), O = b.find(({ code: p }) => p === a), k = N(O) ? [O, ...b.filter(({ code: p }) => p !== a)] : b;
165
- return Se({
166
- render: s,
167
- ref: c,
168
- props: {
169
- ...m,
170
- className: A(ne.options, u),
171
- children: /* @__PURE__ */ h(Y, { children: [
172
- /* @__PURE__ */ e(d.Search, {
173
- value: f,
174
- placeholder: i,
175
- "aria-label": i,
176
- onValueChange: l,
177
- disabled: n
178
- }),
179
- /* @__PURE__ */ e(d.Separator, {}),
180
- _ && /* @__PURE__ */ e(d.Section, {
181
- scrollable: !0,
182
- children: k.map((p) => /* @__PURE__ */ e(d.OptionItem, {
183
- selected: p.code === a,
184
- disabled: n || p.disabled,
185
- onSelect: () => t(p.code),
186
- children: /* @__PURE__ */ e(ve, { text: Ce(p) })
187
- }, p.code))
188
- }),
189
- /* @__PURE__ */ e(d.Empty, {
190
- className: ne.emptyStatus,
191
- children: _ ? null : o
192
- })
193
- ] })
194
- }
195
- });
196
- }, ir = ({ value: r, className: a, ...t }) => /* @__PURE__ */ h(d.Trigger, {
197
- ...t,
198
- className: M(ne.trigger, a),
199
- children: [r, /* @__PURE__ */ e(he, {
200
- "aria-hidden": "true",
201
- className: ne.chevron
202
- })]
203
- }), pa = {
204
- Trigger: ir,
205
- Options: or
206
- }, lr = "_root_u3myi_1", sr = "_preview_u3myi_6", cr = "_image_u3myi_35", dr = "_fileInput_u3myi_48", ur = "_content_u3myi_58", mr = "_actions_u3myi_67", pr = "_helperText_u3myi_73", hr = "_errorMessage_u3myi_78", R = {
207
- root: lr,
208
- preview: sr,
209
- image: cr,
210
- fileInput: dr,
211
- content: ur,
212
- actions: mr,
213
- helperText: pr,
214
- errorMessage: hr
215
- }, vr = ({ src: r }) => {
216
- const a = ye(), [t, n] = $(!1);
217
- return !C(r) || t ? /* @__PURE__ */ e(Fe, {
218
- size: a.icon.size.lg,
219
- "aria-hidden": !0
220
- }) : /* @__PURE__ */ e("img", {
221
- className: R.image,
222
- src: r,
223
- alt: "",
224
- onError: () => n(!0)
225
- });
226
- }, _r = "image/*", ha = ({ src: r, onFileSelect: a, onRemove: t, onAbort: n, disabled: i = !1, isUploading: o = !1, helperText: u, errorMessage: s, uploadLabel: c = "Upload", removeLabel: m = "Remove", abortLabel: f = "Abort", accept: l = _r, inputRef: v, onChange: b, "aria-describedby": _, className: O, style: k, dir: p, render: G, ref: z, ...E }) => {
227
- const T = je(null), L = Ue(T, v), S = oe(), y = `${S}-helper`, j = `${S}-error`, ee = C(r), U = C(u), q = C(s), P = i || !N(a), B = i || !ee || !N(t), w = P || o, ie = B || o, le = o && N(n), g = [
228
- _,
229
- U && y,
230
- q && j
231
- ].filter(C).join(" ") || void 0, W = () => {
232
- w || T.current?.click();
233
- }, x = (H) => {
234
- const re = H.currentTarget.files?.[0];
235
- try {
236
- b?.(H);
237
- } finally {
238
- H.currentTarget.value = "";
239
- }
240
- w || !N(re) || a?.(re);
241
- };
242
- return Se({
243
- render: G,
244
- ref: z,
245
- props: {
246
- className: A(R.root, O),
247
- style: k,
248
- dir: p,
249
- "aria-busy": o || E["aria-busy"],
250
- children: /* @__PURE__ */ h(Y, { children: [/* @__PURE__ */ e("button", {
251
- className: R.preview,
252
- type: "button",
253
- disabled: P,
254
- "aria-disabled": o || void 0,
255
- "aria-label": c,
256
- "aria-describedby": g,
257
- onClick: W,
258
- children: /* @__PURE__ */ e(vr, { src: r }, r)
259
- }), /* @__PURE__ */ h("div", {
260
- className: R.content,
261
- children: [
262
- /* @__PURE__ */ h("div", {
263
- className: R.actions,
264
- children: [
265
- /* @__PURE__ */ e("input", {
266
- "aria-label": c,
267
- ...E,
268
- ref: L,
269
- className: R.fileInput,
270
- dir: p,
271
- children: void 0,
272
- dangerouslySetInnerHTML: void 0,
273
- type: "file",
274
- multiple: !1,
275
- value: void 0,
276
- defaultValue: void 0,
277
- accept: l,
278
- disabled: w,
279
- "aria-describedby": g,
280
- hidden: !0,
281
- onChange: x
282
- }),
283
- le ? /* @__PURE__ */ e(F, {
284
- type: "button",
285
- startIcon: /* @__PURE__ */ e(Me, {}),
286
- onClick: n,
287
- disabled: i,
288
- variant: "outline",
289
- children: f
290
- }) : /* @__PURE__ */ e(F, {
291
- type: "button",
292
- startIcon: /* @__PURE__ */ e($e, {}),
293
- onClick: W,
294
- disabled: w,
295
- focusableWhenDisabled: o && !P,
296
- "aria-describedby": g,
297
- variant: "outline",
298
- children: c
299
- }),
300
- /* @__PURE__ */ e(F, {
301
- type: "button",
302
- startIcon: /* @__PURE__ */ e(xe, {}),
303
- onClick: t,
304
- disabled: ie,
305
- focusableWhenDisabled: o && !B,
306
- variant: "outline",
307
- children: m
308
- })
309
- ]
310
- }),
311
- U && /* @__PURE__ */ e("span", {
312
- className: R.helperText,
313
- id: y,
314
- children: u
315
- }),
316
- q && /* @__PURE__ */ e("span", {
317
- className: R.errorMessage,
318
- id: j,
319
- role: "alert",
320
- children: s
321
- })
322
- ]
323
- })] })
324
- }
325
- });
326
- }, br = "_button_k3e4y_1", gr = { button: br }, va = ({ className: r, emphasis: a = "standard", size: t, variant: n, ...i }) => {
327
- const o = Oe(Ne), u = t ?? o?.size ?? "sm", s = n ?? o?.variant ?? "ghost";
328
- return /* @__PURE__ */ e(F, {
329
- ...i,
330
- size: u,
331
- variant: s,
332
- "data-emphasis": a,
333
- className: M(gr.button, r)
334
- });
335
- }, fr = "_button_1fwx7_1", Cr = { button: fr }, _a = ({ className: r, elevated: a = !0, variant: t, ...n }) => {
336
- const i = Oe(Ne), o = t ?? i?.variant ?? "solid";
337
- return /* @__PURE__ */ e(F, {
338
- ...n,
339
- elevated: a,
340
- variant: o,
341
- className: M(Cr.button, r)
342
- });
343
- }, pe = {
344
- maximumFractionDigits: 15,
345
- numberingSystem: "latn",
346
- useGrouping: "min2"
347
- }, Ir = ({ nextValue: r, currentValue: a, reason: t }) => t === "input-blur" && fe(r, void 0, pe) === fe(a, void 0, pe), yr = "_root_17bio_1", Nr = "_valueInput_17bio_7", Sr = "_button_17bio_14", Or = "_icon_17bio_32", D = {
348
- root: yr,
349
- valueInput: Nr,
350
- button: Sr,
351
- icon: Or
352
- }, ba = ({ value: r, defaultValue: a, onValueChange: t, onValueCommitted: n, allowOutOfRange: i = !1, min: o, max: u, step: s = 1, disabled: c, readOnly: m, required: f, name: l, form: v, id: b, showButtons: _ = !0, decrementLabel: O = "Decrease value", incrementLabel: k = "Increase value", className: p, ...G }) => {
353
- const [z, E] = We({
354
- controlled: r,
355
- default: a ?? null,
356
- name: "NumberStepper",
357
- state: "value"
358
- }), T = He(z), L = (S, y) => {
359
- if (S !== T.current) {
360
- if (Ir({
361
- nextValue: S,
362
- currentValue: T.current,
363
- reason: y.reason
364
- })) {
365
- y.cancel();
366
- return;
367
- }
368
- t?.(S, y), !y.isCanceled && (T.current = S, E(S));
369
- }
370
- };
371
- return /* @__PURE__ */ h(ae.Root, {
372
- value: z,
373
- onValueChange: L,
374
- onValueCommitted: n,
375
- min: o,
376
- max: u,
377
- allowOutOfRange: i,
378
- step: s,
379
- smallStep: s,
380
- largeStep: s,
381
- disabled: c,
382
- readOnly: m,
383
- required: f,
384
- name: l,
385
- form: v,
386
- id: b,
387
- format: pe,
388
- className: D.root,
389
- children: [
390
- _ && /* @__PURE__ */ e(ae.Decrement, {
391
- "aria-label": O,
392
- render: /* @__PURE__ */ e(F, {
393
- type: "button",
394
- size: "sm",
395
- className: D.button,
396
- startIcon: /* @__PURE__ */ e("span", {
397
- className: D.icon,
398
- children: /* @__PURE__ */ e(we, {})
399
- })
400
- })
401
- }),
402
- /* @__PURE__ */ e(ae.Input, {
403
- ...G,
404
- form: v,
405
- className: M(A(te.input, te.sm, D.valueInput), p)
406
- }),
407
- _ && /* @__PURE__ */ e(ae.Increment, {
408
- "aria-label": k,
409
- render: /* @__PURE__ */ e(F, {
410
- type: "button",
411
- size: "sm",
412
- className: D.button,
413
- startIcon: /* @__PURE__ */ e("span", {
414
- className: D.icon,
415
- children: /* @__PURE__ */ e(De, {})
416
- })
417
- })
418
- })
419
- ]
420
- });
421
- }, Tr = "_trigger_s8ccg_1", Pr = "_triggerFlag_s8ccg_35", Rr = "_optionFlag_s8ccg_36", kr = "_chevron_s8ccg_56", Er = "_selectedCountryLabel_s8ccg_61", X = {
422
- trigger: Tr,
423
- triggerFlag: Pr,
424
- optionFlag: Rr,
425
- chevron: kr,
426
- selectedCountryLabel: Er
427
- }, wr = ({ label: r, callingCode: a }) => `${r} (+${a})`, xr = ({ countries: r, value: a, onValueChange: t, searchLabel: n = "Search", emptyLabel: i = "No results" }) => {
428
- const [o, u] = $(""), s = Z(o), c = r.filter(({ label: l }) => Z(l).includes(s)), m = c.find((l) => l.value === a), f = N(m) ? [m, ...c.filter((l) => l.value !== a)] : c;
429
- return /* @__PURE__ */ h(Y, { children: [
430
- /* @__PURE__ */ e(d.Search, {
431
- value: o,
432
- onValueChange: u,
433
- placeholder: n,
434
- "aria-label": n
435
- }),
436
- /* @__PURE__ */ e(d.Separator, {}),
437
- /* @__PURE__ */ h(d.Section, {
438
- scrollable: !0,
439
- children: [!Q(f) && /* @__PURE__ */ e(d.Empty, { children: i }), f.map((l) => {
440
- const v = wr(l);
441
- return /* @__PURE__ */ e(d.OptionItem, {
442
- "aria-label": v,
443
- selected: l.value === a,
444
- onSelect: () => t(l.value),
445
- startIcon: /* @__PURE__ */ e("span", {
446
- className: X.optionFlag,
447
- "aria-hidden": !0,
448
- children: l.flag
449
- }),
450
- children: /* @__PURE__ */ e(ve, {
451
- text: /* @__PURE__ */ h(Y, { children: [
452
- l.label,
453
- " (",
454
- /* @__PURE__ */ h("bdi", {
455
- dir: "ltr",
456
- children: ["+", l.callingCode]
457
- }),
458
- ")"
459
- ] }),
460
- tooltipContent: v
461
- })
462
- }, l.value);
463
- })]
464
- })
465
- ] });
466
- }, Fr = ({ country: r, className: a, "aria-describedby": t, ...n }) => {
467
- const i = oe(), o = [N(r) && i, t].filter(C).join(" ") || void 0;
468
- return /* @__PURE__ */ h(d.Trigger, {
469
- ...n,
470
- "aria-describedby": o,
471
- className: M(X.trigger, a),
472
- children: [
473
- /* @__PURE__ */ e("span", {
474
- className: X.triggerFlag,
475
- "aria-hidden": !0,
476
- children: r?.flag ?? /* @__PURE__ */ e(Be, {})
477
- }),
478
- N(r) && /* @__PURE__ */ e("span", {
479
- id: i,
480
- className: X.selectedCountryLabel,
481
- children: r.label
482
- }),
483
- /* @__PURE__ */ e(he, {
484
- className: X.chevron,
485
- "aria-hidden": !0
486
- })
487
- ]
488
- });
489
- }, ga = {
490
- Trigger: Fr,
491
- Options: xr
492
- }, $r = "_wrapper_c0mqd_1", Mr = "_inputGroup_c0mqd_8", zr = "_searchIcon_c0mqd_14", me = {
493
- wrapper: $r,
494
- inputGroup: Mr,
495
- searchIcon: zr
496
- }, fa = ({ placeholder: r, actions: a, size: t = "md", id: n, "aria-label": i, "aria-labelledby": o, ...u }) => {
497
- const s = ye(), c = oe(), m = n ?? c;
498
- return /* @__PURE__ */ h("div", {
499
- className: me.wrapper,
500
- children: [/* @__PURE__ */ e(Ae, {
501
- className: me.inputGroup,
502
- size: t,
503
- startElement: /* @__PURE__ */ e(ze, {
504
- className: me.searchIcon,
505
- size: s.icon.size.md,
506
- "aria-hidden": !0
507
- }),
508
- children: /* @__PURE__ */ e(Ve, {
509
- ...u,
510
- id: m,
511
- placeholder: r,
512
- "aria-label": C(o) ? void 0 : i ?? r,
513
- "aria-labelledby": o
514
- })
515
- }), a]
516
- });
517
- }, Br = "_container_1eoop_1", Dr = "_sm_1eoop_20", Vr = "_md_1eoop_26", Ar = "_item_1eoop_32", Gr = "_iconOnly_1eoop_72", Lr = "_icon_1eoop_72", jr = "_label_1eoop_91", V = {
518
- container: Br,
519
- sm: Dr,
520
- md: Vr,
521
- item: Ar,
522
- iconOnly: Gr,
523
- icon: Lr,
524
- label: jr
525
- }, Ca = ({ className: r, itemWidth: a = "equal", options: t, size: n = "md", ...i }) => /* @__PURE__ */ e(Ke, {
526
- ...i,
527
- className: M(A(V.container, V[n]), r),
528
- "data-item-width": a,
529
- children: t.map(({ "aria-label": o, disabled: u, label: s, startIcon: c, value: m }) => /* @__PURE__ */ h(Ge.Root, {
530
- value: m,
531
- disabled: u,
532
- "aria-label": o,
533
- className: A(V.item, !de(s) && V.iconOnly),
534
- children: [de(c) && /* @__PURE__ */ e("span", {
535
- className: V.icon,
536
- "aria-hidden": !0,
537
- children: c
538
- }), de(s) && /* @__PURE__ */ e("span", {
539
- className: V.label,
540
- children: s
541
- })]
542
- }, m))
543
- });
544
- export {
545
- _a as a,
546
- pa as c,
547
- ba as i,
548
- ma as l,
549
- fa as n,
550
- va as o,
551
- ga as r,
552
- ha as s,
553
- Ca as t
554
- };