react-country-kit 1.0.0 → 1.1.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 (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -235
  3. package/dist/components/CountryMultiSelect/CountryMultiSelect.d.ts +2 -2
  4. package/dist/components/CountryPicker/CountryPicker.d.ts +2 -2
  5. package/dist/components/CurrencyMultiSelect/CurrencyMultiSelect.d.ts +2 -2
  6. package/dist/components/CurrencyPicker/CurrencyPicker.d.ts +2 -2
  7. package/dist/components/DivisionPicker/DivisionPicker.d.ts +2 -2
  8. package/dist/components/LanguagePicker/LanguagePicker.d.ts +2 -2
  9. package/dist/components/PhoneInput/PhoneInput.d.ts +2 -2
  10. package/dist/components/TimezonePicker/TimezonePicker.d.ts +2 -2
  11. package/dist/components/shared/Flag.d.ts +15 -0
  12. package/dist/components/shared/PickerBase.d.ts +2 -1
  13. package/dist/index.d.ts +1 -13
  14. package/dist/react-country-kit.cjs.js +1 -1
  15. package/dist/react-country-kit.cjs.js.map +1 -1
  16. package/dist/react-country-kit.d.ts +1 -354
  17. package/dist/react-country-kit.es.js +354 -362
  18. package/dist/react-country-kit.es.js.map +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/ui/components/CountryMultiSelect.d.ts +2 -1
  21. package/dist/ui/components/CountryPicker.d.ts +2 -1
  22. package/dist/ui/components/CurrencyMultiSelect.d.ts +2 -1
  23. package/dist/ui/components/CurrencyPicker.d.ts +2 -1
  24. package/dist/ui/components/DivisionPicker.d.ts +2 -1
  25. package/dist/ui/components/LanguagePicker.d.ts +2 -1
  26. package/dist/ui/components/PhoneInput.d.ts +3 -3
  27. package/dist/ui/components/TimezonePicker.d.ts +2 -1
  28. package/dist/ui/components/primitives.d.ts +11 -1
  29. package/dist/ui/index.d.ts +12 -12
  30. package/dist/ui/lib/utils.d.ts +2 -1
  31. package/dist/ui.cjs.js +1 -1
  32. package/dist/ui.cjs.js.map +1 -1
  33. package/dist/ui.d.ts +1 -413
  34. package/dist/ui.es.js +370 -350
  35. package/dist/ui.es.js.map +1 -1
  36. package/package.json +11 -2
  37. package/dist/data/countries.d.ts +0 -10
  38. package/dist/data/languages.d.ts +0 -3
  39. package/dist/hooks/useBasePicker.d.ts +0 -6
  40. package/dist/hooks/useCountryPicker.d.ts +0 -2
  41. package/dist/hooks/useCurrencyPicker.d.ts +0 -2
  42. package/dist/hooks/useDivisionPicker.d.ts +0 -2
  43. package/dist/hooks/useLanguagePicker.d.ts +0 -2
  44. package/dist/hooks/useMultiSelect.d.ts +0 -6
  45. package/dist/hooks/usePhoneInput.d.ts +0 -17
  46. package/dist/hooks/useTimezonePicker.d.ts +0 -2
  47. package/dist/types/index.d.ts +0 -185
  48. package/dist/useTimezonePicker-BMFPsn3E.mjs +0 -36086
  49. package/dist/useTimezonePicker-BMFPsn3E.mjs.map +0 -1
  50. package/dist/useTimezonePicker-zHCM2pUC.js +0 -2
  51. package/dist/useTimezonePicker-zHCM2pUC.js.map +0 -1
  52. package/dist/utils/countries.d.ts +0 -46
  53. package/dist/utils/currencies.d.ts +0 -13
  54. package/dist/utils/languages.d.ts +0 -13
  55. package/dist/utils/timezones.d.ts +0 -13
package/dist/ui.es.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import { jsx as e, jsxs as n, Fragment as R } from "react/jsx-runtime";
2
- import v, { useState as C, useEffect as F } from "react";
2
+ import L, { useState as w, useEffect as G } from "react";
3
3
  import * as V from "@radix-ui/react-popover";
4
- import { clsx as Z } from "clsx";
5
- import { twMerge as K } from "tailwind-merge";
6
- import { s as G, g as W, p as $, b as H, c as q, v as A, k as ee, y as te, x as ne, j as I, q as re, h as oe } from "./useTimezonePicker-BMFPsn3E.mjs";
7
- import { l as ye, m as ke, n as we, o as Ce, r as ve, t as Le, w as Pe, a as Se, d as Be, e as Oe, f as _e, u as Re, i as je } from "./useTimezonePicker-BMFPsn3E.mjs";
8
- function k(...t) {
9
- return K(Z(t));
4
+ import { clsx as K } from "clsx";
5
+ import { twMerge as ee } from "tailwind-merge";
6
+ import { searchCountries as H, getAllCountries as Q, getCurrencyByCountry as U, searchCurrencies as J, getAllCurrencies as W, getTimezonesByCountry as $, getAllTimezones as te, searchTimezones as ne, searchLanguages as re, getAllLanguages as I, getDivisionsByCountry as oe, usePhoneInput as se } from "react-country-kit-core";
7
+ import { getAllCountries as Ce, getAllCurrencies as ke, getAllLanguages as we, getAllTimezones as Le, getCountryByIso2 as ve, getCountryByIso3 as Pe, getCountryByName as Se, getCurrencyByCode as _e, getCurrencyByCountry as Be, getDivisionsByCountry as Oe, getLanguageByCode as Re, getTimezoneByName as Te, getTimezonesByCountry as je, iso2ToFlag as ze, searchCountries as Ee, searchCurrencies as Ve, searchLanguages as Ae, searchTimezones as Qe, useCountryPicker as We, useCurrencyPicker as qe, useDivisionPicker as De, useLanguagePicker as Me, useMultiSelect as Ue, usePhoneInput as $e, useTimezonePicker as Ie } from "react-country-kit-core";
8
+ function y(...t) {
9
+ return ee(K(t));
10
10
  }
11
- const J = V.Root, Y = V.Trigger, T = ({ className: t }) => /* @__PURE__ */ e(
11
+ const Y = V.Root, Z = V.Trigger, z = ({ className: t }) => /* @__PURE__ */ e(
12
12
  "svg",
13
13
  {
14
- className: k("h-4 w-4 text-primary", t),
14
+ className: y("h-4 w-4 text-primary", t),
15
15
  viewBox: "0 0 20 20",
16
16
  fill: "none",
17
17
  stroke: "currentColor",
@@ -21,42 +21,62 @@ const J = V.Root, Y = V.Trigger, T = ({ className: t }) => /* @__PURE__ */ e(
21
21
  children: /* @__PURE__ */ e("polyline", { points: "4 10 8 14 16 6" })
22
22
  }
23
23
  );
24
- T.displayName = "CheckIcon";
25
- const E = ({
24
+ z.displayName = "CheckIcon";
25
+ const q = ({
26
26
  children: t,
27
27
  className: r
28
28
  }) => /* @__PURE__ */ e(
29
29
  "label",
30
30
  {
31
- className: k(
31
+ className: y(
32
32
  "text-[0.65rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/80 ml-1 mb-1.5 block",
33
33
  r
34
34
  ),
35
35
  children: t
36
36
  }
37
37
  );
38
- E.displayName = "FieldLabel";
39
- const L = ({ children: t, className: r }) => /* @__PURE__ */ e(
38
+ q.displayName = "FieldLabel";
39
+ const v = ({ children: t, className: r }) => /* @__PURE__ */ e(
40
40
  "span",
41
41
  {
42
- className: k(
42
+ className: y(
43
43
  "inline-flex items-center rounded-full bg-primary/20 px-2.5 py-0.5 text-[0.7rem] font-bold text-primary tracking-tight",
44
44
  r
45
45
  ),
46
46
  children: t
47
47
  }
48
48
  );
49
- L.displayName = "Badge";
50
- const M = v.forwardRef(({ className: t, align: r = "start", sideOffset: p = 6, onCloseAutoFocus: l, ...a }, d) => /* @__PURE__ */ e(V.Portal, { children: /* @__PURE__ */ e(
49
+ v.displayName = "Badge";
50
+ const j = ({
51
+ iso2: t,
52
+ flag: r,
53
+ flagUrl: p,
54
+ className: l
55
+ }) => /* @__PURE__ */ e("span", { className: y("inline-flex items-center justify-center shrink-0 overflow-hidden", l), children: /* @__PURE__ */ e(
56
+ "img",
57
+ {
58
+ src: p,
59
+ alt: t,
60
+ className: "h-[1em] w-[1.5em] object-cover rounded-[1px] shadow-[0_0_0_1px_rgba(0,0,0,0.05)]",
61
+ onError: (i) => {
62
+ if (i.target.style.display = "none", i.target.parentElement) {
63
+ const c = document.createElement("span");
64
+ c.textContent = r, i.target.parentElement.appendChild(c);
65
+ }
66
+ }
67
+ }
68
+ ) });
69
+ j.displayName = "Flag";
70
+ const D = L.forwardRef(({ className: t, align: r = "start", sideOffset: p = 6, onCloseAutoFocus: l, ...i }, c) => /* @__PURE__ */ e(V.Portal, { children: /* @__PURE__ */ e(
51
71
  V.Content,
52
72
  {
53
- ref: d,
73
+ ref: c,
54
74
  align: r,
55
75
  sideOffset: p,
56
76
  onCloseAutoFocus: (g) => {
57
77
  g.preventDefault(), l == null || l(g);
58
78
  },
59
- className: k(
79
+ className: y(
60
80
  "z-50 w-[var(--radix-popover-trigger-width)] rounded-xl border border-border bg-popover p-0 shadow-lg",
61
81
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
62
82
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
@@ -64,15 +84,15 @@ const M = v.forwardRef(({ className: t, align: r = "start", sideOffset: p = 6, o
64
84
  "data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
65
85
  t
66
86
  ),
67
- ...a
87
+ ...i
68
88
  }
69
89
  ) }));
70
- M.displayName = "PopoverContent";
71
- const P = v.forwardRef(({ className: t, ...r }, p) => /* @__PURE__ */ e(
90
+ D.displayName = "PopoverContent";
91
+ const P = L.forwardRef(({ className: t, ...r }, p) => /* @__PURE__ */ e(
72
92
  "div",
73
93
  {
74
94
  ref: p,
75
- className: k(
95
+ className: y(
76
96
  "flex h-full w-full flex-col overflow-hidden rounded-xl bg-popover text-popover-foreground",
77
97
  t
78
98
  ),
@@ -80,8 +100,8 @@ const P = v.forwardRef(({ className: t, ...r }, p) => /* @__PURE__ */ e(
80
100
  }
81
101
  ));
82
102
  P.displayName = "CommandRoot";
83
- const S = v.forwardRef(
84
- ({ className: t, onValueChange: r, ...p }, l) => /* @__PURE__ */ e("div", { className: "px-3 pt-3 pb-2 border-b border-border", children: /* @__PURE__ */ n("div", { className: k(
103
+ const S = L.forwardRef(
104
+ ({ className: t, onValueChange: r, ...p }, l) => /* @__PURE__ */ e("div", { className: "px-3 pt-3 pb-2 border-b border-border", children: /* @__PURE__ */ n("div", { className: y(
85
105
  "flex items-center gap-2 px-3 py-1.5 rounded-lg border border-border bg-muted/40 transition-colors",
86
106
  "focus-within:border-primary/50 focus-within:ring-2 focus-within:ring-primary/10"
87
107
  ), children: [
@@ -107,29 +127,29 @@ const S = v.forwardRef(
107
127
  autoComplete: "off",
108
128
  autoCorrect: "off",
109
129
  spellCheck: !1,
110
- className: k(
130
+ className: y(
111
131
  "flex h-8 w-full bg-transparent text-sm outline-none",
112
132
  "placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
113
133
  t
114
134
  ),
115
- onChange: (a) => r == null ? void 0 : r(a.target.value),
135
+ onChange: (i) => r == null ? void 0 : r(i.target.value),
116
136
  ...p
117
137
  }
118
138
  )
119
139
  ] }) })
120
140
  );
121
141
  S.displayName = "CommandInput";
122
- const B = v.forwardRef(({ className: t, ...r }, p) => /* @__PURE__ */ e(
142
+ const _ = L.forwardRef(({ className: t, ...r }, p) => /* @__PURE__ */ e(
123
143
  "div",
124
144
  {
125
145
  ref: p,
126
146
  role: "listbox",
127
- className: k("max-h-72 overflow-y-auto overflow-x-hidden p-1", t),
147
+ className: y("max-h-72 overflow-y-auto overflow-x-hidden p-1", t),
128
148
  ...r
129
149
  }
130
150
  ));
131
- B.displayName = "CommandList";
132
- const O = v.forwardRef((t, r) => /* @__PURE__ */ e(
151
+ _.displayName = "CommandList";
152
+ const B = L.forwardRef((t, r) => /* @__PURE__ */ e(
133
153
  "div",
134
154
  {
135
155
  ref: r,
@@ -137,40 +157,40 @@ const O = v.forwardRef((t, r) => /* @__PURE__ */ e(
137
157
  ...t
138
158
  }
139
159
  ));
140
- O.displayName = "CommandEmpty";
141
- const _ = v.forwardRef(
142
- ({ className: t, onSelect: r, onMouseDown: p, onKeyDown: l, disabled: a, selected: d, value: g, ...w }, x) => /* @__PURE__ */ e(
160
+ B.displayName = "CommandEmpty";
161
+ const O = L.forwardRef(
162
+ ({ className: t, onSelect: r, onMouseDown: p, onKeyDown: l, disabled: i, selected: c, value: g, ...k }, x) => /* @__PURE__ */ e(
143
163
  "div",
144
164
  {
145
165
  ref: x,
146
166
  role: "option",
147
- "aria-disabled": a || void 0,
148
- "aria-selected": d,
149
- "data-disabled": a || void 0,
150
- "data-selected": d || void 0,
151
- tabIndex: a ? void 0 : 0,
152
- className: k(
167
+ "aria-disabled": i || void 0,
168
+ "aria-selected": c,
169
+ "data-disabled": i || void 0,
170
+ "data-selected": c || void 0,
171
+ tabIndex: i ? void 0 : 0,
172
+ className: y(
153
173
  "relative flex cursor-pointer select-none items-center gap-2 rounded-lg px-2 py-2 text-sm outline-none",
154
174
  "focus:bg-accent focus:text-accent-foreground",
155
175
  "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
156
176
  "hover:bg-accent/50 transition-colors",
157
- d && "bg-accent text-accent-foreground font-semibold",
177
+ c && "bg-accent text-accent-foreground font-semibold",
158
178
  t
159
179
  ),
160
180
  onMouseDown: (s) => {
161
181
  s.preventDefault(), p == null || p(s);
162
182
  },
163
- onClick: a ? void 0 : () => r == null ? void 0 : r(),
183
+ onClick: i ? void 0 : () => r == null ? void 0 : r(),
164
184
  onKeyDown: (s) => {
165
- !a && s.key === "Enter" && (s.preventDefault(), r == null || r()), l == null || l(s);
185
+ !i && s.key === "Enter" && (s.preventDefault(), r == null || r()), l == null || l(s);
166
186
  },
167
- ...w
187
+ ...k
168
188
  }
169
189
  )
170
190
  );
171
- _.displayName = "CommandItem";
172
- const z = v.forwardRef(
173
- ({ className: t, isOpen: r, children: p, placeholder: l, hasValue: a, ...d }, g) => /* @__PURE__ */ n(
191
+ O.displayName = "CommandItem";
192
+ const E = L.forwardRef(
193
+ ({ className: t, isOpen: r, children: p, placeholder: l, hasValue: i, ...c }, g) => /* @__PURE__ */ n(
174
194
  "button",
175
195
  {
176
196
  ref: g,
@@ -178,22 +198,22 @@ const z = v.forwardRef(
178
198
  role: "combobox",
179
199
  "aria-expanded": r,
180
200
  "aria-haspopup": "listbox",
181
- className: k(
201
+ className: y(
182
202
  "flex h-12 w-full items-center justify-between gap-3 rounded-xl border border-input bg-background px-4 py-2 text-sm ring-offset-background",
183
203
  "placeholder:text-muted-foreground",
184
204
  "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
185
205
  "disabled:cursor-not-allowed disabled:opacity-50",
186
206
  "hover:bg-accent/10 transition-all",
187
- !a && "text-muted-foreground",
207
+ !i && "text-muted-foreground",
188
208
  t
189
209
  ),
190
- ...d,
210
+ ...c,
191
211
  children: [
192
212
  /* @__PURE__ */ e("span", { className: "flex min-w-0 flex-1 items-center gap-2 truncate", children: p || /* @__PURE__ */ e("span", { children: l }) }),
193
213
  /* @__PURE__ */ e(
194
214
  "svg",
195
215
  {
196
- className: k(
216
+ className: y(
197
217
  "h-4 w-4 shrink-0 text-muted-foreground/60 transition-transform duration-200",
198
218
  r && "rotate-180"
199
219
  ),
@@ -210,65 +230,65 @@ const z = v.forwardRef(
210
230
  }
211
231
  )
212
232
  );
213
- z.displayName = "PickerTrigger";
214
- const j = v.forwardRef(
215
- ({ label: t, trigger: r, children: p, open: l, onOpenChange: a, className: d }, g) => /* @__PURE__ */ n("div", { ref: g, className: k("flex flex-col gap-0", d), children: [
216
- t && /* @__PURE__ */ e(E, { children: t }),
217
- /* @__PURE__ */ n(J, { open: l, onOpenChange: a, children: [
218
- /* @__PURE__ */ e(Y, { asChild: !0, children: r }),
219
- /* @__PURE__ */ e(M, { className: "p-0", children: p })
233
+ E.displayName = "PickerTrigger";
234
+ const T = L.forwardRef(
235
+ ({ label: t, trigger: r, children: p, open: l, onOpenChange: i, className: c }, g) => /* @__PURE__ */ n("div", { ref: g, className: y("flex flex-col gap-0", c), children: [
236
+ t && /* @__PURE__ */ e(q, { children: t }),
237
+ /* @__PURE__ */ n(Y, { open: l, onOpenChange: i, children: [
238
+ /* @__PURE__ */ e(Z, { asChild: !0, children: r }),
239
+ /* @__PURE__ */ e(D, { className: "p-0", children: p })
220
240
  ] })
221
241
  ] })
222
242
  );
223
- j.displayName = "BasePicker";
224
- const D = v.forwardRef(
243
+ T.displayName = "BasePicker";
244
+ const M = L.forwardRef(
225
245
  ({
226
246
  value: t,
227
247
  onRemove: r,
228
248
  onClear: p,
229
249
  isOpen: l,
230
- placeholder: a,
231
- renderChip: d,
250
+ placeholder: i,
251
+ renderChip: c,
232
252
  maxVisible: g = 3,
233
- className: w,
253
+ className: k,
234
254
  disabled: x,
235
255
  ...s
236
- }, c) => {
256
+ }, d) => {
237
257
  const u = t.slice(0, g), N = t.length - g;
238
258
  return /* @__PURE__ */ n(
239
259
  "button",
240
260
  {
241
- ref: c,
261
+ ref: d,
242
262
  type: "button",
243
263
  "aria-haspopup": "listbox",
244
264
  "aria-expanded": l,
245
265
  disabled: x,
246
- className: k(
266
+ className: y(
247
267
  "flex min-h-[3rem] w-full items-center gap-3 rounded-xl border border-input bg-background px-4 py-2",
248
268
  "text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
249
269
  "disabled:cursor-not-allowed disabled:opacity-50 hover:bg-accent/10 transition-all text-start",
250
270
  l && "ring-2 ring-ring ring-offset-2",
251
- w
271
+ k
252
272
  ),
253
273
  ...s,
254
274
  children: [
255
- /* @__PURE__ */ e("div", { className: "flex flex-1 flex-wrap gap-1.5 min-w-0 items-center", children: t.length === 0 ? /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: a }) : /* @__PURE__ */ n(R, { children: [
256
- u.map((h, b) => /* @__PURE__ */ n(
275
+ /* @__PURE__ */ e("div", { className: "flex flex-1 flex-wrap gap-1.5 min-w-0 items-center", children: t.length === 0 ? /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: i }) : /* @__PURE__ */ n(R, { children: [
276
+ u.map((f, b) => /* @__PURE__ */ n(
257
277
  "span",
258
278
  {
259
279
  className: "inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-[0.75rem] font-semibold text-primary",
260
280
  children: [
261
- d(h),
281
+ c(f),
262
282
  /* @__PURE__ */ e(
263
283
  "span",
264
284
  {
265
285
  role: "button",
266
286
  tabIndex: x ? -1 : 0,
267
287
  onClick: (m) => {
268
- m.stopPropagation(), x || r(h, m);
288
+ m.stopPropagation(), x || r(f, m);
269
289
  },
270
290
  onKeyDown: (m) => {
271
- (m.key === "Enter" || m.key === " ") && (m.preventDefault(), m.stopPropagation(), x || r(h, m));
291
+ (m.key === "Enter" || m.key === " ") && (m.preventDefault(), m.stopPropagation(), x || r(f, m));
272
292
  },
273
293
  className: "ml-0.5 rounded-full text-primary/60 hover:text-primary transition-colors cursor-pointer",
274
294
  "aria-label": "Remove",
@@ -282,7 +302,7 @@ const D = v.forwardRef(
282
302
  },
283
303
  b
284
304
  )),
285
- N > 0 && /* @__PURE__ */ n(L, { className: "bg-muted text-muted-foreground/80 px-2", children: [
305
+ N > 0 && /* @__PURE__ */ n(v, { className: "bg-muted text-muted-foreground/80 px-2", children: [
286
306
  "+",
287
307
  N
288
308
  ] })
@@ -293,11 +313,11 @@ const D = v.forwardRef(
293
313
  {
294
314
  role: "button",
295
315
  tabIndex: x ? -1 : 0,
296
- onClick: (h) => {
297
- h.stopPropagation(), x || p(h);
316
+ onClick: (f) => {
317
+ f.stopPropagation(), x || p(f);
298
318
  },
299
- onKeyDown: (h) => {
300
- (h.key === "Enter" || h.key === " ") && (h.preventDefault(), h.stopPropagation(), x || p(h));
319
+ onKeyDown: (f) => {
320
+ (f.key === "Enter" || f.key === " ") && (f.preventDefault(), f.stopPropagation(), x || p(f));
301
321
  },
302
322
  className: "rounded p-0.5 text-muted-foreground hover:text-foreground hover:bg-accent/30 transition-colors cursor-pointer",
303
323
  "aria-label": "Clear all",
@@ -310,7 +330,7 @@ const D = v.forwardRef(
310
330
  /* @__PURE__ */ e(
311
331
  "svg",
312
332
  {
313
- className: k("h-4 w-4 text-muted-foreground/60 transition-transform duration-200", l && "rotate-180"),
333
+ className: y("h-4 w-4 text-muted-foreground/60 transition-transform duration-200", l && "rotate-180"),
314
334
  viewBox: "0 0 20 20",
315
335
  fill: "none",
316
336
  stroke: "currentColor",
@@ -326,42 +346,42 @@ const D = v.forwardRef(
326
346
  );
327
347
  }
328
348
  );
329
- D.displayName = "MultiSelectTrigger";
330
- function me({
349
+ M.displayName = "MultiSelectTrigger";
350
+ function pe({
331
351
  value: t,
332
352
  onChange: r,
333
353
  placeholder: p = "Select a country...",
334
354
  searchable: l = !0,
335
- showFlag: a = !0,
336
- showPhoneCode: d = !1,
355
+ showFlag: i = !0,
356
+ showPhoneCode: c = !1,
337
357
  disabled: g = !1,
338
- className: w,
358
+ className: k,
339
359
  label: x
340
360
  }) {
341
- const [s, c] = C(!1), [u, N] = C(""), h = u ? G(u) : W(), b = (m) => {
342
- const i = W().find(
343
- (f) => f.iso2.toLowerCase() === m.toLowerCase()
361
+ const [s, d] = w(!1), [u, N] = w(""), f = u ? H(u) : Q(), b = (m) => {
362
+ const a = Q().find(
363
+ (h) => h.iso2.toLowerCase() === m.toLowerCase()
344
364
  );
345
- i && (r(i), c(!1), N(""));
365
+ a && (r(a), d(!1), N(""));
346
366
  };
347
367
  return /* @__PURE__ */ e(
348
- j,
368
+ T,
349
369
  {
350
370
  label: x,
351
- className: w,
371
+ className: k,
352
372
  open: s,
353
- onOpenChange: c,
373
+ onOpenChange: d,
354
374
  trigger: /* @__PURE__ */ e(
355
- z,
375
+ E,
356
376
  {
357
377
  isOpen: s,
358
378
  hasValue: !!t,
359
379
  placeholder: p,
360
380
  disabled: g,
361
381
  children: t && /* @__PURE__ */ n(R, { children: [
362
- a && /* @__PURE__ */ e("span", { className: "text-lg leading-none", children: t.flag }),
382
+ i && /* @__PURE__ */ e(j, { iso2: t.iso2, flag: t.flag, flagUrl: t.flag_url }),
363
383
  /* @__PURE__ */ e("span", { className: "flex-1 text-start truncate", children: t.name }),
364
- d && /* @__PURE__ */ n(L, { children: [
384
+ c && /* @__PURE__ */ n(v, { children: [
365
385
  "+",
366
386
  t.phone_code
367
387
  ] })
@@ -377,20 +397,20 @@ function me({
377
397
  onValueChange: N
378
398
  }
379
399
  ),
380
- /* @__PURE__ */ n(B, { children: [
381
- h.length === 0 && /* @__PURE__ */ n(O, { children: [
400
+ /* @__PURE__ */ n(_, { children: [
401
+ f.length === 0 && /* @__PURE__ */ n(B, { children: [
382
402
  /* @__PURE__ */ e("span", { className: "text-2xl opacity-40", children: "🌍" }),
383
403
  /* @__PURE__ */ e("span", { children: "No countries found" })
384
404
  ] }),
385
- h.map((m) => {
386
- const i = (t == null ? void 0 : t.iso2) === m.iso2;
405
+ f.map((m) => {
406
+ const a = (t == null ? void 0 : t.iso2) === m.iso2;
387
407
  return /* @__PURE__ */ n(
388
- _,
408
+ O,
389
409
  {
390
410
  onSelect: () => b(m.iso2),
391
- selected: i,
411
+ selected: a,
392
412
  children: [
393
- a && /* @__PURE__ */ e("span", { className: "text-lg leading-none", children: m.flag }),
413
+ i && /* @__PURE__ */ e(j, { iso2: m.iso2, flag: m.flag, flagUrl: m.flag_url }),
394
414
  /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col gap-0 min-w-0", children: [
395
415
  /* @__PURE__ */ e("span", { className: "truncate font-medium", children: m.name }),
396
416
  /* @__PURE__ */ n("span", { className: "text-[0.7rem] text-muted-foreground", children: [
@@ -400,11 +420,11 @@ function me({
400
420
  ] })
401
421
  ] }),
402
422
  /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 ml-auto shrink-0", children: [
403
- d && /* @__PURE__ */ n("span", { className: "text-[0.7rem] text-muted-foreground tabular-nums bg-muted px-1.5 py-0.5 rounded", children: [
423
+ c && /* @__PURE__ */ n("span", { className: "text-[0.7rem] text-muted-foreground tabular-nums bg-muted px-1.5 py-0.5 rounded", children: [
404
424
  "+",
405
425
  m.phone_code
406
426
  ] }),
407
- i && /* @__PURE__ */ e(T, {})
427
+ a && /* @__PURE__ */ e(z, {})
408
428
  ] })
409
429
  ]
410
430
  },
@@ -416,53 +436,53 @@ function me({
416
436
  }
417
437
  );
418
438
  }
419
- function pe({
439
+ function fe({
420
440
  value: t,
421
441
  onChange: r,
422
442
  placeholder: p = "Select a currency...",
423
443
  searchable: l = !0,
424
- showSymbol: a = !0,
425
- countryIso2: d,
444
+ showSymbol: i = !0,
445
+ countryIso2: c,
426
446
  autoSelect: g = !0,
427
- disabled: w = !1,
447
+ disabled: k = !1,
428
448
  className: x,
429
449
  label: s
430
450
  }) {
431
- const [c, u] = C(!1), [N, h] = C("");
432
- F(() => {
433
- if (d && g && !t) {
434
- const f = $(d);
435
- f && r(f);
451
+ const [d, u] = w(!1), [N, f] = w("");
452
+ G(() => {
453
+ if (c && g && !t) {
454
+ const h = U(c);
455
+ h && r(h);
436
456
  }
437
- }, [d, g, t, r]);
438
- const m = N ? H(N, d) : (() => {
439
- if (d) {
440
- const f = $(d);
441
- return f ? [f] : [];
457
+ }, [c, g, t, r]);
458
+ const m = N ? J(N, c) : (() => {
459
+ if (c) {
460
+ const h = U(c);
461
+ return h ? [h] : [];
442
462
  }
443
- return q();
444
- })(), i = (f) => {
445
- const o = q().find(
446
- (y) => y.code.toLowerCase() === f.toLowerCase()
463
+ return W();
464
+ })(), a = (h) => {
465
+ const o = W().find(
466
+ (C) => C.code.toLowerCase() === h.toLowerCase()
447
467
  );
448
- o && (r(o), u(!1), h(""));
468
+ o && (r(o), u(!1), f(""));
449
469
  };
450
470
  return /* @__PURE__ */ e(
451
- j,
471
+ T,
452
472
  {
453
473
  label: s,
454
474
  className: x,
455
- open: c,
475
+ open: d,
456
476
  onOpenChange: u,
457
477
  trigger: /* @__PURE__ */ e(
458
- z,
478
+ E,
459
479
  {
460
- isOpen: c,
480
+ isOpen: d,
461
481
  hasValue: !!t,
462
482
  placeholder: p,
463
- disabled: w,
483
+ disabled: k,
464
484
  children: t && /* @__PURE__ */ n(R, { children: [
465
- a && /* @__PURE__ */ e("span", { className: "min-w-[1.5rem] text-center font-bold text-primary text-base", children: t.symbol }),
485
+ i && /* @__PURE__ */ e("span", { className: "min-w-[1.5rem] text-center font-bold text-primary text-base", children: t.symbol }),
466
486
  /* @__PURE__ */ n("span", { className: "flex-1 text-start truncate", children: [
467
487
  t.code,
468
488
  " — ",
@@ -477,31 +497,31 @@ function pe({
477
497
  {
478
498
  placeholder: "Search currency...",
479
499
  value: N,
480
- onValueChange: h
500
+ onValueChange: f
481
501
  }
482
502
  ),
483
- /* @__PURE__ */ n(B, { children: [
484
- m.length === 0 && /* @__PURE__ */ n(O, { children: [
503
+ /* @__PURE__ */ n(_, { children: [
504
+ m.length === 0 && /* @__PURE__ */ n(B, { children: [
485
505
  /* @__PURE__ */ e("span", { className: "text-2xl opacity-40", children: "💰" }),
486
506
  /* @__PURE__ */ e("span", { children: "No currencies found" })
487
507
  ] }),
488
- m.map((f) => {
489
- const o = (t == null ? void 0 : t.code) === f.code;
508
+ m.map((h) => {
509
+ const o = (t == null ? void 0 : t.code) === h.code;
490
510
  return /* @__PURE__ */ n(
491
- _,
511
+ O,
492
512
  {
493
- onSelect: () => i(f.code),
513
+ onSelect: () => a(h.code),
494
514
  selected: o,
495
515
  children: [
496
- a && /* @__PURE__ */ e("span", { className: "min-w-[1.5rem] text-center font-bold text-primary", children: f.symbol }),
516
+ i && /* @__PURE__ */ e("span", { className: "min-w-[1.5rem] text-center font-bold text-primary", children: h.symbol }),
497
517
  /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col gap-0 min-w-0", children: [
498
- /* @__PURE__ */ e("span", { className: "truncate font-medium", children: f.name }),
499
- /* @__PURE__ */ e("span", { className: "text-[0.7rem] text-muted-foreground", children: f.code })
518
+ /* @__PURE__ */ e("span", { className: "truncate font-medium", children: h.name }),
519
+ /* @__PURE__ */ e("span", { className: "text-[0.7rem] text-muted-foreground", children: h.code })
500
520
  ] }),
501
- o && /* @__PURE__ */ e(T, { className: "ml-auto shrink-0" })
521
+ o && /* @__PURE__ */ e(z, { className: "ml-auto shrink-0" })
502
522
  ]
503
523
  },
504
- f.code
524
+ h.code
505
525
  );
506
526
  })
507
527
  ] })
@@ -514,32 +534,32 @@ function he({
514
534
  onChange: r,
515
535
  placeholder: p = "Select a timezone...",
516
536
  searchable: l = !0,
517
- countryIso2: a,
518
- autoSelect: d = !0,
537
+ countryIso2: i,
538
+ autoSelect: c = !0,
519
539
  disabled: g = !1,
520
- className: w,
540
+ className: k,
521
541
  label: x
522
542
  }) {
523
- const [s, c] = C(!1), [u, N] = C("");
524
- F(() => {
525
- if (a && d && !t) {
526
- const i = A(a);
527
- i && i.length > 0 && r(i[0]);
543
+ const [s, d] = w(!1), [u, N] = w("");
544
+ G(() => {
545
+ if (i && c && !t) {
546
+ const a = $(i);
547
+ a && a.length > 0 && r(a[0]);
528
548
  }
529
- }, [a, d, t, r]);
530
- const h = a ? A(a) : ee(), b = u ? te(u, a) : h, m = (i) => {
531
- const f = h.find((o) => o.name === i);
532
- f && (r(f), c(!1), N(""));
549
+ }, [i, c, t, r]);
550
+ const f = i ? $(i) : te(), b = u ? ne(u, i) : f, m = (a) => {
551
+ const h = f.find((o) => o.name === a);
552
+ h && (r(h), d(!1), N(""));
533
553
  };
534
554
  return /* @__PURE__ */ e(
535
- j,
555
+ T,
536
556
  {
537
557
  label: x,
538
- className: w,
558
+ className: k,
539
559
  open: s,
540
- onOpenChange: c,
560
+ onOpenChange: d,
541
561
  trigger: /* @__PURE__ */ e(
542
- z,
562
+ E,
543
563
  {
544
564
  isOpen: s,
545
565
  hasValue: !!t,
@@ -547,7 +567,7 @@ function he({
547
567
  disabled: g,
548
568
  children: t && /* @__PURE__ */ n(R, { children: [
549
569
  /* @__PURE__ */ e("span", { className: "flex-1 text-start truncate", children: t.name }),
550
- /* @__PURE__ */ e(L, { children: t.offset_name })
570
+ /* @__PURE__ */ e(v, { children: t.offset_name })
551
571
  ] })
552
572
  }
553
573
  ),
@@ -560,34 +580,34 @@ function he({
560
580
  onValueChange: N
561
581
  }
562
582
  ),
563
- /* @__PURE__ */ n(B, { children: [
564
- b.length === 0 && /* @__PURE__ */ n(O, { children: [
583
+ /* @__PURE__ */ n(_, { children: [
584
+ b.length === 0 && /* @__PURE__ */ n(B, { children: [
565
585
  /* @__PURE__ */ e("span", { className: "text-2xl opacity-40", children: "🕐" }),
566
586
  /* @__PURE__ */ e("span", { children: "No timezones found" })
567
587
  ] }),
568
- b.map((i) => {
569
- const f = (t == null ? void 0 : t.name) === i.name;
588
+ b.map((a) => {
589
+ const h = (t == null ? void 0 : t.name) === a.name;
570
590
  return /* @__PURE__ */ n(
571
- _,
591
+ O,
572
592
  {
573
- onSelect: () => m(i.name),
574
- selected: f,
593
+ onSelect: () => m(a.name),
594
+ selected: h,
575
595
  children: [
576
596
  /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col gap-0 min-w-0", children: [
577
- /* @__PURE__ */ e("span", { className: "truncate font-medium", children: i.name }),
597
+ /* @__PURE__ */ e("span", { className: "truncate font-medium", children: a.name }),
578
598
  /* @__PURE__ */ n("span", { className: "text-[0.7rem] text-muted-foreground", children: [
579
- i.tzName,
599
+ a.tzName,
580
600
  " · ",
581
- i.abbreviation
601
+ a.abbreviation
582
602
  ] })
583
603
  ] }),
584
604
  /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 ml-auto shrink-0", children: [
585
- /* @__PURE__ */ e(L, { className: "tabular-nums text-[0.65rem]", children: i.offset_name }),
586
- f && /* @__PURE__ */ e(T, {})
605
+ /* @__PURE__ */ e(v, { className: "tabular-nums text-[0.65rem]", children: a.offset_name }),
606
+ h && /* @__PURE__ */ e(z, {})
587
607
  ] })
588
608
  ]
589
609
  },
590
- i.name
610
+ a.name
591
611
  );
592
612
  })
593
613
  ] })
@@ -595,39 +615,39 @@ function he({
595
615
  }
596
616
  );
597
617
  }
598
- function fe({
618
+ function ue({
599
619
  value: t,
600
620
  onChange: r,
601
621
  placeholder: p = "Select a language...",
602
622
  searchable: l = !0,
603
- showNativeName: a = !0,
604
- disabled: d = !1,
623
+ showNativeName: i = !0,
624
+ disabled: c = !1,
605
625
  className: g,
606
- label: w
626
+ label: k
607
627
  }) {
608
- const [x, s] = C(!1), [c, u] = C(""), N = c ? ne(c) : I(), h = (b) => {
628
+ const [x, s] = w(!1), [d, u] = w(""), N = d ? re(d) : I(), f = (b) => {
609
629
  const m = I().find(
610
- (i) => i.code.toLowerCase() === b.toLowerCase()
630
+ (a) => a.code.toLowerCase() === b.toLowerCase()
611
631
  );
612
632
  m && (r(m), s(!1), u(""));
613
633
  };
614
634
  return /* @__PURE__ */ e(
615
- j,
635
+ T,
616
636
  {
617
- label: w,
637
+ label: k,
618
638
  className: g,
619
639
  open: x,
620
640
  onOpenChange: s,
621
641
  trigger: /* @__PURE__ */ e(
622
- z,
642
+ E,
623
643
  {
624
644
  isOpen: x,
625
645
  hasValue: !!t,
626
646
  placeholder: p,
627
- disabled: d,
647
+ disabled: c,
628
648
  children: t && /* @__PURE__ */ n(R, { children: [
629
649
  /* @__PURE__ */ e("span", { className: "flex-1 text-start truncate", children: t.english_name }),
630
- a && t.native_name !== t.english_name && /* @__PURE__ */ e("span", { className: "text-xs italic text-muted-foreground shrink-0", children: t.native_name })
650
+ i && t.native_name !== t.english_name && /* @__PURE__ */ e("span", { className: "text-xs italic text-muted-foreground shrink-0", children: t.native_name })
631
651
  ] })
632
652
  }
633
653
  ),
@@ -636,30 +656,30 @@ function fe({
636
656
  S,
637
657
  {
638
658
  placeholder: "Search language...",
639
- value: c,
659
+ value: d,
640
660
  onValueChange: u
641
661
  }
642
662
  ),
643
- /* @__PURE__ */ n(B, { children: [
644
- N.length === 0 && /* @__PURE__ */ n(O, { children: [
663
+ /* @__PURE__ */ n(_, { children: [
664
+ N.length === 0 && /* @__PURE__ */ n(B, { children: [
645
665
  /* @__PURE__ */ e("span", { className: "text-2xl opacity-40", children: "🌐" }),
646
666
  /* @__PURE__ */ e("span", { children: "No languages found" })
647
667
  ] }),
648
668
  N.map((b) => {
649
669
  const m = (t == null ? void 0 : t.code) === b.code;
650
670
  return /* @__PURE__ */ n(
651
- _,
671
+ O,
652
672
  {
653
- onSelect: () => h(b.code),
673
+ onSelect: () => f(b.code),
654
674
  selected: m,
655
675
  children: [
656
676
  /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col gap-0 min-w-0", children: [
657
677
  /* @__PURE__ */ e("span", { className: "truncate font-medium", children: b.english_name }),
658
- a && b.native_name !== b.english_name && /* @__PURE__ */ e("span", { className: "text-[0.7rem] text-muted-foreground italic", children: b.native_name })
678
+ i && b.native_name !== b.english_name && /* @__PURE__ */ e("span", { className: "text-[0.7rem] text-muted-foreground italic", children: b.native_name })
659
679
  ] }),
660
680
  /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 ml-auto shrink-0", children: [
661
- /* @__PURE__ */ e(L, { className: "text-[0.6rem]", children: b.code }),
662
- m && /* @__PURE__ */ e(T, {})
681
+ /* @__PURE__ */ e(v, { className: "text-[0.6rem]", children: b.code }),
682
+ m && /* @__PURE__ */ e(z, {})
663
683
  ] })
664
684
  ]
665
685
  },
@@ -671,31 +691,31 @@ function fe({
671
691
  }
672
692
  );
673
693
  }
674
- function ue({
694
+ function ge({
675
695
  countryIso2: t,
676
696
  value: r,
677
697
  onChange: p,
678
698
  placeholder: l = "Select a division...",
679
- searchable: a = !0,
680
- disabled: d = !1,
699
+ searchable: i = !0,
700
+ disabled: c = !1,
681
701
  className: g,
682
- label: w
702
+ label: k
683
703
  }) {
684
- const [x, s] = C(!1), [c, u] = C(""), N = re(t), h = c ? N.filter(
685
- (i) => i.name.toLowerCase().includes(c.toLowerCase()) || i.iso2.toLowerCase().includes(c.toLowerCase()) || i.timezone.toLowerCase().includes(c.toLowerCase())
686
- ) : N, b = d || !t || N.length === 0, m = (i) => {
687
- const f = N.find((o) => o.name === i);
688
- f && (p(f), s(!1), u(""));
704
+ const [x, s] = w(!1), [d, u] = w(""), N = oe(t), f = d ? N.filter(
705
+ (a) => a.name.toLowerCase().includes(d.toLowerCase()) || a.iso2.toLowerCase().includes(d.toLowerCase()) || a.timezone.toLowerCase().includes(d.toLowerCase())
706
+ ) : N, b = c || !t || N.length === 0, m = (a) => {
707
+ const h = N.find((o) => o.name === a);
708
+ h && (p(h), s(!1), u(""));
689
709
  };
690
710
  return /* @__PURE__ */ e(
691
- j,
711
+ T,
692
712
  {
693
- label: w,
713
+ label: k,
694
714
  className: g,
695
715
  open: x,
696
- onOpenChange: (i) => !b && s(i),
716
+ onOpenChange: (a) => !b && s(a),
697
717
  trigger: /* @__PURE__ */ e(
698
- z,
718
+ E,
699
719
  {
700
720
  isOpen: x,
701
721
  hasValue: !!r,
@@ -703,43 +723,43 @@ function ue({
703
723
  disabled: b,
704
724
  children: r && /* @__PURE__ */ n(R, { children: [
705
725
  /* @__PURE__ */ e("span", { className: "flex-1 text-start truncate", children: r.name }),
706
- /* @__PURE__ */ e(L, { children: r.iso2 })
726
+ /* @__PURE__ */ e(v, { children: r.iso2 })
707
727
  ] })
708
728
  }
709
729
  ),
710
730
  children: /* @__PURE__ */ n(P, { children: [
711
- a && /* @__PURE__ */ e(
731
+ i && /* @__PURE__ */ e(
712
732
  S,
713
733
  {
714
734
  placeholder: "Search division...",
715
- value: c,
735
+ value: d,
716
736
  onValueChange: u
717
737
  }
718
738
  ),
719
- /* @__PURE__ */ n(B, { children: [
720
- h.length === 0 && /* @__PURE__ */ n(O, { children: [
739
+ /* @__PURE__ */ n(_, { children: [
740
+ f.length === 0 && /* @__PURE__ */ n(B, { children: [
721
741
  /* @__PURE__ */ e("span", { className: "text-2xl opacity-40", children: "🗺️" }),
722
742
  /* @__PURE__ */ e("span", { children: "No divisions found" })
723
743
  ] }),
724
- h.map((i) => {
725
- const f = (r == null ? void 0 : r.iso2) === i.iso2 && (r == null ? void 0 : r.name) === i.name;
744
+ f.map((a) => {
745
+ const h = (r == null ? void 0 : r.iso2) === a.iso2 && (r == null ? void 0 : r.name) === a.name;
726
746
  return /* @__PURE__ */ n(
727
- _,
747
+ O,
728
748
  {
729
- onSelect: () => m(i.name),
730
- selected: f,
749
+ onSelect: () => m(a.name),
750
+ selected: h,
731
751
  children: [
732
752
  /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col gap-0 min-w-0", children: [
733
- /* @__PURE__ */ e("span", { className: "truncate font-medium", children: i.name }),
734
- /* @__PURE__ */ e("span", { className: "text-[0.7rem] text-muted-foreground truncate", children: i.timezone })
753
+ /* @__PURE__ */ e("span", { className: "truncate font-medium", children: a.name }),
754
+ /* @__PURE__ */ e("span", { className: "text-[0.7rem] text-muted-foreground truncate", children: a.timezone })
735
755
  ] }),
736
756
  /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 ml-auto shrink-0", children: [
737
- /* @__PURE__ */ e(L, { children: i.iso2 }),
738
- f && /* @__PURE__ */ e(T, {})
757
+ /* @__PURE__ */ e(v, { children: a.iso2 }),
758
+ h && /* @__PURE__ */ e(z, {})
739
759
  ] })
740
760
  ]
741
761
  },
742
- `${i.iso2}-${i.name}`
762
+ `${a.iso2}-${a.name}`
743
763
  );
744
764
  })
745
765
  ] })
@@ -747,53 +767,53 @@ function ue({
747
767
  }
748
768
  );
749
769
  }
750
- const se = v.forwardRef(
770
+ const ie = L.forwardRef(
751
771
  ({
752
772
  value: t,
753
773
  onChange: r,
754
774
  defaultCountryIso2: p = "US",
755
775
  placeholder: l = "Phone number",
756
- showFlag: a = !0,
757
- disabled: d = !1,
776
+ showFlag: i = !0,
777
+ disabled: c = !1,
758
778
  className: g,
759
- label: w
779
+ label: k
760
780
  }, x) => {
761
- const s = oe(t, r, p);
762
- return /* @__PURE__ */ n("div", { ref: x, className: k("flex flex-col gap-0", g), children: [
763
- w && /* @__PURE__ */ e(E, { children: w }),
781
+ const s = se(t, r, p);
782
+ return /* @__PURE__ */ n("div", { ref: x, className: y("flex flex-col gap-0", g), children: [
783
+ k && /* @__PURE__ */ e(q, { children: k }),
764
784
  /* @__PURE__ */ n(
765
785
  "div",
766
786
  {
767
- className: k(
787
+ className: y(
768
788
  "flex h-12 items-stretch overflow-hidden rounded-xl border border-input bg-background ring-offset-background",
769
789
  "focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
770
790
  "transition-shadow",
771
- d && "opacity-50 pointer-events-none"
791
+ c && "opacity-50 pointer-events-none"
772
792
  ),
773
793
  children: [
774
794
  /* @__PURE__ */ n(
775
- J,
795
+ Y,
776
796
  {
777
797
  open: s.isOpen,
778
- onOpenChange: (c) => c ? s.toggle() : s.close(),
798
+ onOpenChange: (d) => d ? s.toggle() : s.close(),
779
799
  children: [
780
- /* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ n(
800
+ /* @__PURE__ */ e(Z, { asChild: !0, children: /* @__PURE__ */ n(
781
801
  "button",
782
802
  {
783
803
  type: "button",
784
- disabled: d,
785
- className: k(
804
+ disabled: c,
805
+ className: y(
786
806
  "flex h-full shrink-0 items-center gap-1.5 border-r border-input bg-muted px-3",
787
807
  "text-sm font-semibold text-foreground transition-colors outline-none",
788
808
  "hover:bg-accent/30 focus-visible:bg-accent/30"
789
809
  ),
790
810
  children: [
791
- a && s.country && /* @__PURE__ */ e("span", { className: "text-lg leading-none", children: s.country.flag }),
811
+ i && s.country && /* @__PURE__ */ e(j, { iso2: s.country.iso2, flag: s.country.flag, flagUrl: s.country.flag_url }),
792
812
  /* @__PURE__ */ e("span", { className: "tabular-nums text-primary", children: s.country ? `+${s.country.phone_code}` : "+?" }),
793
813
  /* @__PURE__ */ e(
794
814
  "svg",
795
815
  {
796
- className: k(
816
+ className: y(
797
817
  "h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform duration-200",
798
818
  s.isOpen && "rotate-180"
799
819
  ),
@@ -809,7 +829,7 @@ const se = v.forwardRef(
809
829
  }
810
830
  ) }),
811
831
  /* @__PURE__ */ e(
812
- M,
832
+ D,
813
833
  {
814
834
  align: "start",
815
835
  side: "bottom",
@@ -824,29 +844,29 @@ const se = v.forwardRef(
824
844
  onValueChange: s.setSearchQuery
825
845
  }
826
846
  ),
827
- /* @__PURE__ */ n(B, { children: [
828
- s.filteredCountries.length === 0 && /* @__PURE__ */ n(O, { children: [
847
+ /* @__PURE__ */ n(_, { children: [
848
+ s.filteredCountries.length === 0 && /* @__PURE__ */ n(B, { children: [
829
849
  /* @__PURE__ */ e("span", { className: "text-2xl opacity-40", children: "🌍" }),
830
850
  /* @__PURE__ */ e("span", { children: "No countries found" })
831
851
  ] }),
832
- s.filteredCountries.map((c) => {
852
+ s.filteredCountries.map((d) => {
833
853
  var N;
834
- const u = ((N = s.country) == null ? void 0 : N.iso2) === c.iso2;
854
+ const u = ((N = s.country) == null ? void 0 : N.iso2) === d.iso2;
835
855
  return /* @__PURE__ */ n(
836
- _,
856
+ O,
837
857
  {
838
- onSelect: () => s.selectCountry(c),
858
+ onSelect: () => s.selectCountry(d),
839
859
  selected: u,
840
860
  children: [
841
- /* @__PURE__ */ e("span", { className: "text-lg leading-none", children: c.flag }),
842
- /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col min-w-0", children: /* @__PURE__ */ e("span", { className: "truncate font-medium text-sm", children: c.name }) }),
843
- /* @__PURE__ */ n(L, { className: "ml-auto tabular-nums text-[0.7rem]", children: [
861
+ /* @__PURE__ */ e(j, { iso2: d.iso2, flag: d.flag, flagUrl: d.flag_url }),
862
+ /* @__PURE__ */ e("div", { className: "flex flex-1 flex-col min-w-0", children: /* @__PURE__ */ e("span", { className: "truncate font-medium text-sm", children: d.name }) }),
863
+ /* @__PURE__ */ n(v, { className: "ml-auto tabular-nums text-[0.7rem]", children: [
844
864
  "+",
845
- c.phone_code
865
+ d.phone_code
846
866
  ] })
847
867
  ]
848
868
  },
849
- c.iso2
869
+ d.iso2
850
870
  );
851
871
  })
852
872
  ] })
@@ -861,14 +881,14 @@ const se = v.forwardRef(
861
881
  {
862
882
  type: "tel",
863
883
  value: s.number,
864
- onChange: (c) => s.setNumber(c.target.value),
884
+ onChange: (d) => s.setNumber(d.target.value),
865
885
  placeholder: l,
866
- disabled: d,
886
+ disabled: c,
867
887
  minLength: s.minLength,
868
888
  maxLength: s.maxLength,
869
889
  inputMode: "numeric",
870
890
  autoComplete: "tel-national",
871
- className: k(
891
+ className: y(
872
892
  "flex-1 min-w-0 bg-transparent px-3 text-sm text-foreground",
873
893
  "placeholder:text-muted-foreground",
874
894
  "focus:outline-none"
@@ -886,74 +906,74 @@ const se = v.forwardRef(
886
906
  ] });
887
907
  }
888
908
  );
889
- se.displayName = "PhoneInput";
890
- const X = 3;
891
- function ge({
909
+ ie.displayName = "PhoneInput";
910
+ const F = 3;
911
+ function xe({
892
912
  value: t,
893
913
  onChange: r,
894
914
  placeholder: p = "Select countries...",
895
915
  maxItems: l,
896
- showFlags: a = !0,
897
- searchable: d = !0,
916
+ showFlags: i = !0,
917
+ searchable: c = !0,
898
918
  disabled: g = !1,
899
- className: w,
919
+ className: k,
900
920
  label: x
901
921
  }) {
902
- const [s, c] = C(!1), [u, N] = C(""), h = u ? G(u) : W(), b = (o) => t.some((y) => y.iso2 === o.iso2), m = (o) => {
922
+ const [s, d] = w(!1), [u, N] = w(""), f = u ? H(u) : Q(), b = (o) => t.some((C) => C.iso2 === o.iso2), m = (o) => {
903
923
  if (b(o))
904
- r(t.filter((y) => y.iso2 !== o.iso2));
924
+ r(t.filter((C) => C.iso2 !== o.iso2));
905
925
  else {
906
926
  if (l !== void 0 && t.length >= l) return;
907
927
  r([...t, o]);
908
928
  }
909
- }, i = (o, y) => {
910
- y.stopPropagation(), r(t.filter((Q) => Q.iso2 !== o.iso2));
911
- }, f = (o) => {
929
+ }, a = (o, C) => {
930
+ C.stopPropagation(), r(t.filter((A) => A.iso2 !== o.iso2));
931
+ }, h = (o) => {
912
932
  o.stopPropagation(), r([]);
913
933
  };
914
- return t.slice(0, X), t.length - X, /* @__PURE__ */ n(
915
- j,
934
+ return t.slice(0, F), t.length - F, /* @__PURE__ */ n(
935
+ T,
916
936
  {
917
937
  label: x,
918
- className: w,
938
+ className: k,
919
939
  open: s,
920
- onOpenChange: c,
940
+ onOpenChange: d,
921
941
  trigger: /* @__PURE__ */ e(
922
- D,
942
+ M,
923
943
  {
924
944
  value: t,
925
- onRemove: i,
926
- onClear: f,
945
+ onRemove: a,
946
+ onClear: h,
927
947
  isOpen: s,
928
948
  placeholder: p,
929
949
  disabled: g,
930
950
  renderChip: (o) => /* @__PURE__ */ n(R, { children: [
931
- a && /* @__PURE__ */ e("span", { children: o.flag }),
951
+ i && /* @__PURE__ */ e(j, { iso2: o.iso2, flag: o.flag, flagUrl: o.flag_url }),
932
952
  /* @__PURE__ */ e("span", { className: "max-w-[80px] truncate", children: o.name })
933
953
  ] })
934
954
  }
935
955
  ),
936
956
  children: [
937
957
  /* @__PURE__ */ n(P, { children: [
938
- d && /* @__PURE__ */ e(S, { placeholder: "Search countries...", value: u, onValueChange: N }),
939
- /* @__PURE__ */ n(B, { children: [
940
- h.length === 0 && /* @__PURE__ */ n(O, { children: [
958
+ c && /* @__PURE__ */ e(S, { placeholder: "Search countries...", value: u, onValueChange: N }),
959
+ /* @__PURE__ */ n(_, { children: [
960
+ f.length === 0 && /* @__PURE__ */ n(B, { children: [
941
961
  /* @__PURE__ */ e("span", { className: "text-2xl opacity-40", children: "🌍" }),
942
962
  /* @__PURE__ */ e("span", { children: "No countries found" })
943
963
  ] }),
944
- h.map((o) => {
945
- const y = b(o);
964
+ f.map((o) => {
965
+ const C = b(o);
946
966
  return /* @__PURE__ */ n(
947
- _,
967
+ O,
948
968
  {
949
969
  onSelect: () => m(o),
950
- selected: y,
970
+ selected: C,
951
971
  children: [
952
- /* @__PURE__ */ e("div", { className: k(
972
+ /* @__PURE__ */ e("div", { className: y(
953
973
  "h-4 w-4 shrink-0 rounded-full border border-border flex items-center justify-center",
954
- y && "bg-primary border-primary"
955
- ), children: y && /* @__PURE__ */ e("svg", { className: "h-2.5 w-2.5 stroke-white", viewBox: "0 0 20 20", fill: "none", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("polyline", { points: "4 10 8 14 16 6" }) }) }),
956
- a && /* @__PURE__ */ e("span", { className: "text-lg leading-none", children: o.flag }),
974
+ C && "bg-primary border-primary"
975
+ ), children: C && /* @__PURE__ */ e("svg", { className: "h-2.5 w-2.5 stroke-white", viewBox: "0 0 20 20", fill: "none", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("polyline", { points: "4 10 8 14 16 6" }) }) }),
976
+ i && /* @__PURE__ */ e(j, { iso2: o.iso2, flag: o.flag, flagUrl: o.flag_url }),
957
977
  /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col min-w-0", children: [
958
978
  /* @__PURE__ */ e("span", { className: "truncate font-medium", children: o.name }),
959
979
  /* @__PURE__ */ n("span", { className: "text-[0.7rem] text-muted-foreground", children: [
@@ -980,7 +1000,7 @@ function ge({
980
1000
  {
981
1001
  type: "button",
982
1002
  onClick: () => {
983
- r([]), c(!1);
1003
+ r([]), d(!1);
984
1004
  },
985
1005
  className: "text-destructive hover:underline font-medium",
986
1006
  children: "Clear all"
@@ -991,73 +1011,73 @@ function ge({
991
1011
  }
992
1012
  );
993
1013
  }
994
- const U = 3;
995
- function xe({
1014
+ const X = 3;
1015
+ function Ne({
996
1016
  value: t,
997
1017
  onChange: r,
998
1018
  placeholder: p = "Select currencies...",
999
1019
  maxItems: l,
1000
- showSymbol: a = !0,
1001
- searchable: d = !0,
1020
+ showSymbol: i = !0,
1021
+ searchable: c = !0,
1002
1022
  disabled: g = !1,
1003
- className: w,
1023
+ className: k,
1004
1024
  label: x
1005
1025
  }) {
1006
- const [s, c] = C(!1), [u, N] = C(""), h = u ? H(u) : q(), b = (o) => t.some((y) => y.code === o.code), m = (o) => {
1026
+ const [s, d] = w(!1), [u, N] = w(""), f = u ? J(u) : W(), b = (o) => t.some((C) => C.code === o.code), m = (o) => {
1007
1027
  if (b(o))
1008
- r(t.filter((y) => y.code !== o.code));
1028
+ r(t.filter((C) => C.code !== o.code));
1009
1029
  else {
1010
1030
  if (l !== void 0 && t.length >= l) return;
1011
1031
  r([...t, o]);
1012
1032
  }
1013
- }, i = (o, y) => {
1014
- y.stopPropagation(), r(t.filter((Q) => Q.code !== o.code));
1015
- }, f = (o) => {
1033
+ }, a = (o, C) => {
1034
+ C.stopPropagation(), r(t.filter((A) => A.code !== o.code));
1035
+ }, h = (o) => {
1016
1036
  o.stopPropagation(), r([]);
1017
1037
  };
1018
- return t.slice(0, U), t.length - U, /* @__PURE__ */ n(
1019
- j,
1038
+ return t.slice(0, X), t.length - X, /* @__PURE__ */ n(
1039
+ T,
1020
1040
  {
1021
1041
  label: x,
1022
- className: w,
1042
+ className: k,
1023
1043
  open: s,
1024
- onOpenChange: c,
1044
+ onOpenChange: d,
1025
1045
  trigger: /* @__PURE__ */ e(
1026
- D,
1046
+ M,
1027
1047
  {
1028
1048
  value: t,
1029
- onRemove: i,
1030
- onClear: f,
1049
+ onRemove: a,
1050
+ onClear: h,
1031
1051
  isOpen: s,
1032
1052
  placeholder: p,
1033
1053
  disabled: g,
1034
1054
  renderChip: (o) => /* @__PURE__ */ n(R, { children: [
1035
- a && /* @__PURE__ */ e("span", { className: "font-bold", children: o.symbol }),
1055
+ i && /* @__PURE__ */ e("span", { className: "font-bold", children: o.symbol }),
1036
1056
  /* @__PURE__ */ e("span", { children: o.code })
1037
1057
  ] })
1038
1058
  }
1039
1059
  ),
1040
1060
  children: [
1041
1061
  /* @__PURE__ */ n(P, { children: [
1042
- d && /* @__PURE__ */ e(S, { placeholder: "Search currencies...", value: u, onValueChange: N }),
1043
- /* @__PURE__ */ n(B, { children: [
1044
- h.length === 0 && /* @__PURE__ */ n(O, { children: [
1062
+ c && /* @__PURE__ */ e(S, { placeholder: "Search currencies...", value: u, onValueChange: N }),
1063
+ /* @__PURE__ */ n(_, { children: [
1064
+ f.length === 0 && /* @__PURE__ */ n(B, { children: [
1045
1065
  /* @__PURE__ */ e("span", { className: "text-2xl opacity-40", children: "💰" }),
1046
1066
  /* @__PURE__ */ e("span", { children: "No currencies found" })
1047
1067
  ] }),
1048
- h.map((o) => {
1049
- const y = b(o);
1068
+ f.map((o) => {
1069
+ const C = b(o);
1050
1070
  return /* @__PURE__ */ n(
1051
- _,
1071
+ O,
1052
1072
  {
1053
1073
  onSelect: () => m(o),
1054
- selected: y,
1074
+ selected: C,
1055
1075
  children: [
1056
- /* @__PURE__ */ e("div", { className: k(
1076
+ /* @__PURE__ */ e("div", { className: y(
1057
1077
  "h-4 w-4 shrink-0 rounded-full border border-border flex items-center justify-center",
1058
- y && "bg-primary border-primary"
1059
- ), children: y && /* @__PURE__ */ e("svg", { className: "h-2.5 w-2.5 stroke-white", viewBox: "0 0 20 20", fill: "none", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("polyline", { points: "4 10 8 14 16 6" }) }) }),
1060
- a && /* @__PURE__ */ e("span", { className: "min-w-[1.5rem] text-center font-bold text-primary", children: o.symbol }),
1078
+ C && "bg-primary border-primary"
1079
+ ), children: C && /* @__PURE__ */ e("svg", { className: "h-2.5 w-2.5 stroke-white", viewBox: "0 0 20 20", fill: "none", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("polyline", { points: "4 10 8 14 16 6" }) }) }),
1080
+ i && /* @__PURE__ */ e("span", { className: "min-w-[1.5rem] text-center font-bold text-primary", children: o.symbol }),
1061
1081
  /* @__PURE__ */ n("div", { className: "flex flex-1 flex-col min-w-0", children: [
1062
1082
  /* @__PURE__ */ e("span", { className: "truncate font-medium", children: o.name }),
1063
1083
  /* @__PURE__ */ e("span", { className: "text-[0.7rem] text-muted-foreground", children: o.code })
@@ -1080,7 +1100,7 @@ function xe({
1080
1100
  {
1081
1101
  type: "button",
1082
1102
  onClick: () => {
1083
- r([]), c(!1);
1103
+ r([]), d(!1);
1084
1104
  },
1085
1105
  className: "text-destructive hover:underline font-medium",
1086
1106
  children: "Clear all"
@@ -1092,50 +1112,50 @@ function xe({
1092
1112
  );
1093
1113
  }
1094
1114
  export {
1095
- L as Badge,
1096
- T as CheckIcon,
1097
- O as CommandEmpty,
1115
+ v as Badge,
1116
+ z as CheckIcon,
1117
+ B as CommandEmpty,
1098
1118
  S as CommandInput,
1099
- _ as CommandItem,
1100
- B as CommandList,
1119
+ O as CommandItem,
1120
+ _ as CommandList,
1101
1121
  P as CommandRoot,
1102
- ge as CountryMultiSelect,
1103
- me as CountryPicker,
1104
- xe as CurrencyMultiSelect,
1105
- pe as CurrencyPicker,
1106
- ue as DivisionPicker,
1107
- fe as LanguagePicker,
1108
- se as PhoneInput,
1109
- z as PickerTrigger,
1110
- J as Popover,
1111
- M as PopoverContent,
1112
- Y as PopoverTrigger,
1122
+ xe as CountryMultiSelect,
1123
+ pe as CountryPicker,
1124
+ Ne as CurrencyMultiSelect,
1125
+ fe as CurrencyPicker,
1126
+ ge as DivisionPicker,
1127
+ ue as LanguagePicker,
1128
+ ie as PhoneInput,
1129
+ E as PickerTrigger,
1130
+ Y as Popover,
1131
+ D as PopoverContent,
1132
+ Z as PopoverTrigger,
1113
1133
  he as TimezonePicker,
1114
- k as cn,
1115
- W as getAllCountries,
1116
- q as getAllCurrencies,
1117
- I as getAllLanguages,
1118
- ee as getAllTimezones,
1119
- ye as getCountryByIso2,
1120
- ke as getCountryByIso3,
1121
- we as getCountryByName,
1122
- Ce as getCurrencyByCode,
1123
- $ as getCurrencyByCountry,
1124
- re as getDivisionsByCountry,
1125
- ve as getLanguageByCode,
1126
- Le as getTimezoneByName,
1127
- A as getTimezonesByCountry,
1128
- Pe as iso2ToFlag,
1129
- G as searchCountries,
1130
- H as searchCurrencies,
1131
- ne as searchLanguages,
1132
- te as searchTimezones,
1133
- Se as useCountryPicker,
1134
- Be as useCurrencyPicker,
1135
- Oe as useDivisionPicker,
1136
- _e as useLanguagePicker,
1137
- Re as useMultiSelect,
1138
- oe as usePhoneInput,
1139
- je as useTimezonePicker
1134
+ y as cn,
1135
+ Ce as getAllCountries,
1136
+ ke as getAllCurrencies,
1137
+ we as getAllLanguages,
1138
+ Le as getAllTimezones,
1139
+ ve as getCountryByIso2,
1140
+ Pe as getCountryByIso3,
1141
+ Se as getCountryByName,
1142
+ _e as getCurrencyByCode,
1143
+ Be as getCurrencyByCountry,
1144
+ Oe as getDivisionsByCountry,
1145
+ Re as getLanguageByCode,
1146
+ Te as getTimezoneByName,
1147
+ je as getTimezonesByCountry,
1148
+ ze as iso2ToFlag,
1149
+ Ee as searchCountries,
1150
+ Ve as searchCurrencies,
1151
+ Ae as searchLanguages,
1152
+ Qe as searchTimezones,
1153
+ We as useCountryPicker,
1154
+ qe as useCurrencyPicker,
1155
+ De as useDivisionPicker,
1156
+ Me as useLanguagePicker,
1157
+ Ue as useMultiSelect,
1158
+ $e as usePhoneInput,
1159
+ Ie as useTimezonePicker
1140
1160
  };
1141
1161
  //# sourceMappingURL=ui.es.js.map