react-country-kit 2.1.2 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ui.es.js CHANGED
@@ -3,12 +3,12 @@ import * as M from "@radix-ui/react-popover";
3
3
  import { clsx as Z } from "clsx";
4
4
  import { twMerge as ee } from "tailwind-merge";
5
5
  import { Fragment as R, jsx as e, jsxs as t } from "react/jsx-runtime";
6
- import { getAllCountries as z, getAllCurrencies as A, getAllLanguages as U, getAllTimezones as ne, getCurrencyByCountry as $, getDivisionsByCountry as te, getTimezonesByCountry as F, searchCountries as H, searchCurrencies as I, searchLanguages as re, searchTimezones as oe, useCountry as ae, usePhoneInput as le } from "react-country-kit-core";
6
+ import { getAllCountries as z, getAllCurrencies as A, getAllLanguages as U, getAllTimezones as ne, getCurrencyByCountry as $, getDivisionsByCountry as te, getTimezonesByCountry as F, searchCountries as H, searchCurrencies as I, searchLanguages as re, searchTimezones as oe, usePhoneInput as ae } from "react-country-kit-core";
7
7
  export * from "react-country-kit-core";
8
8
  function y(...n) {
9
9
  return ee(Z(n));
10
10
  }
11
- var J = M.Root, Y = M.Trigger, V = ({ className: n }) => /* @__PURE__ */ e("svg", {
11
+ var J = M.Root, Y = M.Trigger, D = ({ className: n }) => /* @__PURE__ */ e("svg", {
12
12
  className: y("h-4 w-4 text-primary", n),
13
13
  viewBox: "0 0 20 20",
14
14
  fill: "none",
@@ -18,7 +18,7 @@ var J = M.Root, Y = M.Trigger, V = ({ className: n }) => /* @__PURE__ */ e("svg"
18
18
  strokeLinejoin: "round",
19
19
  children: /* @__PURE__ */ e("polyline", { points: "4 10 8 14 16 6" })
20
20
  });
21
- V.displayName = "CheckIcon";
21
+ D.displayName = "CheckIcon";
22
22
  var Q = ({ children: n, className: r }) => /* @__PURE__ */ e("label", {
23
23
  className: y("text-[0.65rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/80 ml-1 mb-1.5 block", r),
24
24
  children: n
@@ -29,7 +29,7 @@ var S = ({ children: n, className: r }) => /* @__PURE__ */ e("span", {
29
29
  children: n
30
30
  });
31
31
  S.displayName = "Badge";
32
- var D = ({ iso2: n, flag: r, flagUrl: p, className: m }) => /* @__PURE__ */ e("span", {
32
+ var V = ({ iso2: n, flag: r, flagUrl: p, className: m }) => /* @__PURE__ */ e("span", {
33
33
  className: y("inline-flex items-center justify-center shrink-0 overflow-hidden", m),
34
34
  children: /* @__PURE__ */ e("img", {
35
35
  src: p,
@@ -43,13 +43,13 @@ var D = ({ iso2: n, flag: r, flagUrl: p, className: m }) => /* @__PURE__ */ e("s
43
43
  }
44
44
  })
45
45
  });
46
- D.displayName = "Flag";
46
+ V.displayName = "Flag";
47
47
  var W = C.forwardRef(({ className: n, align: r = "start", sideOffset: p = 6, onCloseAutoFocus: m, ...l }, s) => /* @__PURE__ */ e(M.Portal, { children: /* @__PURE__ */ e(M.Content, {
48
48
  ref: s,
49
49
  align: r,
50
50
  sideOffset: p,
51
- onCloseAutoFocus: (g) => {
52
- g.preventDefault(), m?.(g);
51
+ onCloseAutoFocus: (u) => {
52
+ u.preventDefault(), m?.(u);
53
53
  },
54
54
  className: y("z-50 w-[var(--radix-popover-trigger-width)] rounded-xl border border-border bg-popover p-0 shadow-lg", "data-[state=open]:animate-in data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", "data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2", n),
55
55
  ...l
@@ -105,8 +105,8 @@ var O = C.forwardRef((n, r) => /* @__PURE__ */ e("div", {
105
105
  ...n
106
106
  }));
107
107
  O.displayName = "CommandEmpty";
108
- var B = C.forwardRef(({ className: n, onSelect: r, onMouseDown: p, onKeyDown: m, disabled: l, selected: s, value: g, ...v }, x) => /* @__PURE__ */ e("div", {
109
- ref: x,
108
+ var B = C.forwardRef(({ className: n, onSelect: r, onMouseDown: p, onKeyDown: m, disabled: l, selected: s, value: u, ...v }, g) => /* @__PURE__ */ e("div", {
109
+ ref: g,
110
110
  role: "option",
111
111
  "aria-disabled": l || void 0,
112
112
  "aria-selected": s,
@@ -124,8 +124,8 @@ var B = C.forwardRef(({ className: n, onSelect: r, onMouseDown: p, onKeyDown: m,
124
124
  ...v
125
125
  }));
126
126
  B.displayName = "CommandItem";
127
- var E = C.forwardRef(({ className: n, isOpen: r, children: p, placeholder: m, hasValue: l, ...s }, g) => /* @__PURE__ */ t("button", {
128
- ref: g,
127
+ var E = C.forwardRef(({ className: n, isOpen: r, children: p, placeholder: m, hasValue: l, ...s }, u) => /* @__PURE__ */ t("button", {
128
+ ref: u,
129
129
  type: "button",
130
130
  role: "combobox",
131
131
  "aria-expanded": r,
@@ -147,8 +147,8 @@ var E = C.forwardRef(({ className: n, isOpen: r, children: p, placeholder: m, ha
147
147
  })]
148
148
  }));
149
149
  E.displayName = "PickerTrigger";
150
- var j = C.forwardRef(({ label: n, trigger: r, children: p, open: m, onOpenChange: l, className: s }, g) => /* @__PURE__ */ t("div", {
151
- ref: g,
150
+ var j = C.forwardRef(({ label: n, trigger: r, children: p, open: m, onOpenChange: l, className: s }, u) => /* @__PURE__ */ t("div", {
151
+ ref: u,
152
152
  className: y("flex flex-col gap-0", s),
153
153
  children: [n && /* @__PURE__ */ e(Q, { children: n }), /* @__PURE__ */ t(J, {
154
154
  open: m,
@@ -163,14 +163,14 @@ var j = C.forwardRef(({ label: n, trigger: r, children: p, open: m, onOpenChange
163
163
  })]
164
164
  }));
165
165
  j.displayName = "BasePicker";
166
- var q = C.forwardRef(({ value: n, onRemove: r, onClear: p, isOpen: m, placeholder: l, renderChip: s, maxVisible: g = 3, className: v, disabled: x, ...a }, u) => {
167
- const c = n.slice(0, g), N = n.length - g;
166
+ var q = C.forwardRef(({ value: n, onRemove: r, onClear: p, isOpen: m, placeholder: l, renderChip: s, maxVisible: u = 3, className: v, disabled: g, ...a }, c) => {
167
+ const b = n.slice(0, u), N = n.length - u;
168
168
  return /* @__PURE__ */ t("button", {
169
- ref: u,
169
+ ref: c,
170
170
  type: "button",
171
171
  "aria-haspopup": "listbox",
172
172
  "aria-expanded": m,
173
- disabled: x,
173
+ disabled: g,
174
174
  className: y("flex min-h-[3rem] w-full items-center gap-3 rounded-xl border border-input bg-background px-4 py-2", "text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", "disabled:cursor-not-allowed disabled:opacity-50 hover:bg-accent/10 transition-all text-start", m && "ring-2 ring-ring ring-offset-2", v),
175
175
  ...a,
176
176
  children: [/* @__PURE__ */ e("div", {
@@ -178,16 +178,16 @@ var q = C.forwardRef(({ value: n, onRemove: r, onClear: p, isOpen: m, placeholde
178
178
  children: n.length === 0 ? /* @__PURE__ */ e("span", {
179
179
  className: "text-muted-foreground",
180
180
  children: l
181
- }) : /* @__PURE__ */ t(R, { children: [c.map((f, b) => /* @__PURE__ */ t("span", {
181
+ }) : /* @__PURE__ */ t(R, { children: [b.map((f, x) => /* @__PURE__ */ t("span", {
182
182
  className: "inline-flex items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-[0.75rem] font-semibold text-primary",
183
183
  children: [s(f), /* @__PURE__ */ e("span", {
184
184
  role: "button",
185
- tabIndex: x ? -1 : 0,
185
+ tabIndex: g ? -1 : 0,
186
186
  onClick: (d) => {
187
- d.stopPropagation(), x || r(f, d);
187
+ d.stopPropagation(), g || r(f, d);
188
188
  },
189
189
  onKeyDown: (d) => {
190
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), d.stopPropagation(), x || r(f, d));
190
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), d.stopPropagation(), g || r(f, d));
191
191
  },
192
192
  className: "ml-0.5 rounded-full text-primary/60 hover:text-primary transition-colors cursor-pointer",
193
193
  "aria-label": "Remove",
@@ -212,7 +212,7 @@ var q = C.forwardRef(({ value: n, onRemove: r, onClear: p, isOpen: m, placeholde
212
212
  })]
213
213
  })
214
214
  })]
215
- }, b)), N > 0 && /* @__PURE__ */ t(S, {
215
+ }, x)), N > 0 && /* @__PURE__ */ t(S, {
216
216
  className: "bg-muted text-muted-foreground/80 px-2",
217
217
  children: ["+", N]
218
218
  })] })
@@ -220,12 +220,12 @@ var q = C.forwardRef(({ value: n, onRemove: r, onClear: p, isOpen: m, placeholde
220
220
  className: "flex shrink-0 items-center gap-1 ml-auto",
221
221
  children: [n.length > 0 && /* @__PURE__ */ e("span", {
222
222
  role: "button",
223
- tabIndex: x ? -1 : 0,
223
+ tabIndex: g ? -1 : 0,
224
224
  onClick: (f) => {
225
- f.stopPropagation(), x || p(f);
225
+ f.stopPropagation(), g || p(f);
226
226
  },
227
227
  onKeyDown: (f) => {
228
- (f.key === "Enter" || f.key === " ") && (f.preventDefault(), f.stopPropagation(), x || p(f));
228
+ (f.key === "Enter" || f.key === " ") && (f.preventDefault(), f.stopPropagation(), g || p(f));
229
229
  },
230
230
  className: "rounded p-0.5 text-muted-foreground hover:text-foreground hover:bg-accent/30 transition-colors cursor-pointer",
231
231
  "aria-label": "Clear all",
@@ -264,9 +264,9 @@ var q = C.forwardRef(({ value: n, onRemove: r, onClear: p, isOpen: m, placeholde
264
264
  });
265
265
  q.displayName = "MultiSelectTrigger";
266
266
  var K = 3;
267
- function fe({ value: n, onChange: r, placeholder: p = "Select countries...", maxItems: m, showFlags: l = !0, searchable: s = !0, disabled: g = !1, className: v, label: x }) {
268
- const [a, u] = k(!1), [c, N] = k(""), f = c ? H(c) : z(), b = (o) => n.some((w) => w.iso2 === o.iso2), d = (o) => {
269
- if (b(o)) r(n.filter((w) => w.iso2 !== o.iso2));
267
+ function pe({ value: n, onChange: r, placeholder: p = "Select countries...", maxItems: m, showFlags: l = !0, searchable: s = !0, disabled: u = !1, className: v, label: g }) {
268
+ const [a, c] = k(!1), [b, N] = k(""), f = b ? H(b) : z(), x = (o) => n.some((w) => w.iso2 === o.iso2), d = (o) => {
269
+ if (x(o)) r(n.filter((w) => w.iso2 !== o.iso2));
270
270
  else {
271
271
  if (m !== void 0 && n.length >= m) return;
272
272
  r([...n, o]);
@@ -277,18 +277,18 @@ function fe({ value: n, onChange: r, placeholder: p = "Select countries...", max
277
277
  o.stopPropagation(), r([]);
278
278
  };
279
279
  return n.slice(0, K), n.length - K, /* @__PURE__ */ t(j, {
280
- label: x,
280
+ label: g,
281
281
  className: v,
282
282
  open: a,
283
- onOpenChange: u,
283
+ onOpenChange: c,
284
284
  trigger: /* @__PURE__ */ e(q, {
285
285
  value: n,
286
286
  onRemove: i,
287
287
  onClear: h,
288
288
  isOpen: a,
289
289
  placeholder: p,
290
- disabled: g,
291
- renderChip: (o) => /* @__PURE__ */ t(R, { children: [l && /* @__PURE__ */ e(D, {
290
+ disabled: u,
291
+ renderChip: (o) => /* @__PURE__ */ t(R, { children: [l && /* @__PURE__ */ e(V, {
292
292
  iso2: o.iso2,
293
293
  flag: o.flag,
294
294
  flagUrl: o.flag_url
@@ -299,13 +299,13 @@ function fe({ value: n, onChange: r, placeholder: p = "Select countries...", max
299
299
  }),
300
300
  children: [/* @__PURE__ */ t(L, { children: [s && /* @__PURE__ */ e(P, {
301
301
  placeholder: "Search countries...",
302
- value: c,
302
+ value: b,
303
303
  onValueChange: N
304
304
  }), /* @__PURE__ */ t(_, { children: [f.length === 0 && /* @__PURE__ */ t(O, { children: [/* @__PURE__ */ e("span", {
305
305
  className: "text-2xl opacity-40",
306
306
  children: "🌍"
307
307
  }), /* @__PURE__ */ e("span", { children: "No countries found" })] }), f.map((o) => {
308
- const w = b(o);
308
+ const w = x(o);
309
309
  return /* @__PURE__ */ t(B, {
310
310
  onSelect: () => d(o),
311
311
  selected: w,
@@ -322,7 +322,7 @@ function fe({ value: n, onChange: r, placeholder: p = "Select countries...", max
322
322
  children: /* @__PURE__ */ e("polyline", { points: "4 10 8 14 16 6" })
323
323
  })
324
324
  }),
325
- l && /* @__PURE__ */ e(D, {
325
+ l && /* @__PURE__ */ e(V, {
326
326
  iso2: o.iso2,
327
327
  flag: o.flag,
328
328
  flagUrl: o.flag_url
@@ -352,7 +352,7 @@ function fe({ value: n, onChange: r, placeholder: p = "Select countries...", max
352
352
  ] }), /* @__PURE__ */ e("button", {
353
353
  type: "button",
354
354
  onClick: () => {
355
- r([]), u(!1);
355
+ r([]), c(!1);
356
356
  },
357
357
  className: "text-destructive hover:underline font-medium",
358
358
  children: "Clear all"
@@ -360,23 +360,23 @@ function fe({ value: n, onChange: r, placeholder: p = "Select countries...", max
360
360
  })]
361
361
  });
362
362
  }
363
- function he({ value: n, onChange: r, placeholder: p = "Select a country...", searchable: m = !0, showFlag: l = !0, showPhoneCode: s = !1, disabled: g = !1, className: v, label: x }) {
364
- const [a, u] = k(!1), [c, N] = k(""), f = c ? H(c) : z(), b = (d) => {
363
+ function fe({ value: n, onChange: r, placeholder: p = "Select a country...", searchable: m = !0, showFlag: l = !0, showPhoneCode: s = !1, disabled: u = !1, className: v, label: g }) {
364
+ const [a, c] = k(!1), [b, N] = k(""), f = b ? H(b) : z(), x = (d) => {
365
365
  const i = z().find((h) => h.iso2.toLowerCase() === d.toLowerCase());
366
- i && (r(i), u(!1), N(""));
366
+ i && (r(i), c(!1), N(""));
367
367
  };
368
368
  return /* @__PURE__ */ e(j, {
369
- label: x,
369
+ label: g,
370
370
  className: v,
371
371
  open: a,
372
- onOpenChange: u,
372
+ onOpenChange: c,
373
373
  trigger: /* @__PURE__ */ e(E, {
374
374
  isOpen: a,
375
375
  hasValue: !!n,
376
376
  placeholder: p,
377
- disabled: g,
377
+ disabled: u,
378
378
  children: n && /* @__PURE__ */ t(R, { children: [
379
- l && /* @__PURE__ */ e(D, {
379
+ l && /* @__PURE__ */ e(V, {
380
380
  iso2: n.iso2,
381
381
  flag: n.flag,
382
382
  flagUrl: n.flag_url
@@ -390,7 +390,7 @@ function he({ value: n, onChange: r, placeholder: p = "Select a country...", sea
390
390
  }),
391
391
  children: /* @__PURE__ */ t(L, { children: [m && /* @__PURE__ */ e(P, {
392
392
  placeholder: "Search country...",
393
- value: c,
393
+ value: b,
394
394
  onValueChange: N
395
395
  }), /* @__PURE__ */ t(_, { children: [f.length === 0 && /* @__PURE__ */ t(O, { children: [/* @__PURE__ */ e("span", {
396
396
  className: "text-2xl opacity-40",
@@ -398,10 +398,10 @@ function he({ value: n, onChange: r, placeholder: p = "Select a country...", sea
398
398
  }), /* @__PURE__ */ e("span", { children: "No countries found" })] }), f.map((d) => {
399
399
  const i = n?.iso2 === d.iso2;
400
400
  return /* @__PURE__ */ t(B, {
401
- onSelect: () => b(d.iso2),
401
+ onSelect: () => x(d.iso2),
402
402
  selected: i,
403
403
  children: [
404
- l && /* @__PURE__ */ e(D, {
404
+ l && /* @__PURE__ */ e(V, {
405
405
  iso2: d.iso2,
406
406
  flag: d.flag,
407
407
  flagUrl: d.flag_url
@@ -425,7 +425,7 @@ function he({ value: n, onChange: r, placeholder: p = "Select a country...", sea
425
425
  children: [s && /* @__PURE__ */ t("span", {
426
426
  className: "text-[0.7rem] text-muted-foreground tabular-nums bg-muted px-1.5 py-0.5 rounded",
427
427
  children: ["+", d.phone_code]
428
- }), i && /* @__PURE__ */ e(V, {})]
428
+ }), i && /* @__PURE__ */ e(D, {})]
429
429
  })
430
430
  ]
431
431
  }, d.iso2);
@@ -433,9 +433,9 @@ function he({ value: n, onChange: r, placeholder: p = "Select a country...", sea
433
433
  });
434
434
  }
435
435
  var X = 3;
436
- function ue({ value: n, onChange: r, placeholder: p = "Select currencies...", maxItems: m, showSymbol: l = !0, searchable: s = !0, disabled: g = !1, className: v, label: x }) {
437
- const [a, u] = k(!1), [c, N] = k(""), f = c ? I(c) : A(), b = (o) => n.some((w) => w.code === o.code), d = (o) => {
438
- if (b(o)) r(n.filter((w) => w.code !== o.code));
436
+ function he({ value: n, onChange: r, placeholder: p = "Select currencies...", maxItems: m, showSymbol: l = !0, searchable: s = !0, disabled: u = !1, className: v, label: g }) {
437
+ const [a, c] = k(!1), [b, N] = k(""), f = b ? I(b) : A(), x = (o) => n.some((w) => w.code === o.code), d = (o) => {
438
+ if (x(o)) r(n.filter((w) => w.code !== o.code));
439
439
  else {
440
440
  if (m !== void 0 && n.length >= m) return;
441
441
  r([...n, o]);
@@ -446,17 +446,17 @@ function ue({ value: n, onChange: r, placeholder: p = "Select currencies...", ma
446
446
  o.stopPropagation(), r([]);
447
447
  };
448
448
  return n.slice(0, X), n.length - X, /* @__PURE__ */ t(j, {
449
- label: x,
449
+ label: g,
450
450
  className: v,
451
451
  open: a,
452
- onOpenChange: u,
452
+ onOpenChange: c,
453
453
  trigger: /* @__PURE__ */ e(q, {
454
454
  value: n,
455
455
  onRemove: i,
456
456
  onClear: h,
457
457
  isOpen: a,
458
458
  placeholder: p,
459
- disabled: g,
459
+ disabled: u,
460
460
  renderChip: (o) => /* @__PURE__ */ t(R, { children: [l && /* @__PURE__ */ e("span", {
461
461
  className: "font-bold",
462
462
  children: o.symbol
@@ -464,13 +464,13 @@ function ue({ value: n, onChange: r, placeholder: p = "Select currencies...", ma
464
464
  }),
465
465
  children: [/* @__PURE__ */ t(L, { children: [s && /* @__PURE__ */ e(P, {
466
466
  placeholder: "Search currencies...",
467
- value: c,
467
+ value: b,
468
468
  onValueChange: N
469
469
  }), /* @__PURE__ */ t(_, { children: [f.length === 0 && /* @__PURE__ */ t(O, { children: [/* @__PURE__ */ e("span", {
470
470
  className: "text-2xl opacity-40",
471
471
  children: "💰"
472
472
  }), /* @__PURE__ */ e("span", { children: "No currencies found" })] }), f.map((o) => {
473
- const w = b(o);
473
+ const w = x(o);
474
474
  return /* @__PURE__ */ t(B, {
475
475
  onSelect: () => d(o),
476
476
  selected: w,
@@ -512,7 +512,7 @@ function ue({ value: n, onChange: r, placeholder: p = "Select currencies...", ma
512
512
  ] }), /* @__PURE__ */ e("button", {
513
513
  type: "button",
514
514
  onClick: () => {
515
- r([]), u(!1);
515
+ r([]), c(!1);
516
516
  },
517
517
  className: "text-destructive hover:underline font-medium",
518
518
  children: "Clear all"
@@ -520,16 +520,16 @@ function ue({ value: n, onChange: r, placeholder: p = "Select currencies...", ma
520
520
  })]
521
521
  });
522
522
  }
523
- function ge({ value: n, onChange: r, placeholder: p = "Select a currency...", searchable: m = !0, showSymbol: l = !0, countryIso2: s, autoSelect: g = !0, disabled: v = !1, className: x, label: a }) {
524
- const [u, c] = k(!1), [N, f] = k("");
523
+ function ue({ value: n, onChange: r, placeholder: p = "Select a currency...", searchable: m = !0, showSymbol: l = !0, countryIso2: s, autoSelect: u = !0, disabled: v = !1, className: g, label: a }) {
524
+ const [c, b] = k(!1), [N, f] = k("");
525
525
  G(() => {
526
- if (s && g && !n) {
526
+ if (s && u && !n) {
527
527
  const h = $(s);
528
528
  h && r(h);
529
529
  }
530
530
  }, [
531
531
  s,
532
- g,
532
+ u,
533
533
  n,
534
534
  r
535
535
  ]);
@@ -541,15 +541,15 @@ function ge({ value: n, onChange: r, placeholder: p = "Select a currency...", se
541
541
  return A();
542
542
  })(), i = (h) => {
543
543
  const o = A().find((w) => w.code.toLowerCase() === h.toLowerCase());
544
- o && (r(o), c(!1), f(""));
544
+ o && (r(o), b(!1), f(""));
545
545
  };
546
546
  return /* @__PURE__ */ e(j, {
547
547
  label: a,
548
- className: x,
549
- open: u,
550
- onOpenChange: c,
548
+ className: g,
549
+ open: c,
550
+ onOpenChange: b,
551
551
  trigger: /* @__PURE__ */ e(E, {
552
- isOpen: u,
552
+ isOpen: c,
553
553
  hasValue: !!n,
554
554
  placeholder: p,
555
555
  disabled: v,
@@ -592,27 +592,27 @@ function ge({ value: n, onChange: r, placeholder: p = "Select a currency...", se
592
592
  children: h.code
593
593
  })]
594
594
  }),
595
- o && /* @__PURE__ */ e(V, { className: "ml-auto shrink-0" })
595
+ o && /* @__PURE__ */ e(D, { className: "ml-auto shrink-0" })
596
596
  ]
597
597
  }, h.code);
598
598
  })] })] })
599
599
  });
600
600
  }
601
- function xe({ countryIso2: n, value: r, onChange: p, placeholder: m = "Select a division...", searchable: l = !0, disabled: s = !1, className: g, label: v }) {
602
- const [x, a] = k(!1), [u, c] = k(""), N = te(n), f = u ? N.filter((i) => i.name.toLowerCase().includes(u.toLowerCase()) || i.iso2.toLowerCase().includes(u.toLowerCase()) || i.timezone.toLowerCase().includes(u.toLowerCase())) : N, b = s || !n || N.length === 0, d = (i) => {
601
+ function ge({ countryIso2: n, value: r, onChange: p, placeholder: m = "Select a division...", searchable: l = !0, disabled: s = !1, className: u, label: v }) {
602
+ const [g, a] = k(!1), [c, b] = k(""), N = te(n), f = c ? N.filter((i) => i.name.toLowerCase().includes(c.toLowerCase()) || i.iso2.toLowerCase().includes(c.toLowerCase()) || i.timezone.toLowerCase().includes(c.toLowerCase())) : N, x = s || !n || N.length === 0, d = (i) => {
603
603
  const h = N.find((o) => o.name === i);
604
- h && (p(h), a(!1), c(""));
604
+ h && (p(h), a(!1), b(""));
605
605
  };
606
606
  return /* @__PURE__ */ e(j, {
607
607
  label: v,
608
- className: g,
609
- open: x,
610
- onOpenChange: (i) => !b && a(i),
608
+ className: u,
609
+ open: g,
610
+ onOpenChange: (i) => !x && a(i),
611
611
  trigger: /* @__PURE__ */ e(E, {
612
- isOpen: x,
612
+ isOpen: g,
613
613
  hasValue: !!r,
614
614
  placeholder: n ? m : "Select a country first",
615
- disabled: b,
615
+ disabled: x,
616
616
  children: r && /* @__PURE__ */ t(R, { children: [/* @__PURE__ */ e("span", {
617
617
  className: "flex-1 text-start truncate",
618
618
  children: r.name
@@ -620,8 +620,8 @@ function xe({ countryIso2: n, value: r, onChange: p, placeholder: m = "Select a
620
620
  }),
621
621
  children: /* @__PURE__ */ t(L, { children: [l && /* @__PURE__ */ e(P, {
622
622
  placeholder: "Search division...",
623
- value: u,
624
- onValueChange: c
623
+ value: c,
624
+ onValueChange: b
625
625
  }), /* @__PURE__ */ t(_, { children: [f.length === 0 && /* @__PURE__ */ t(O, { children: [/* @__PURE__ */ e("span", {
626
626
  className: "text-2xl opacity-40",
627
627
  children: "🗺️"
@@ -641,24 +641,24 @@ function xe({ countryIso2: n, value: r, onChange: p, placeholder: m = "Select a
641
641
  })]
642
642
  }), /* @__PURE__ */ t("div", {
643
643
  className: "flex items-center gap-1.5 ml-auto shrink-0",
644
- children: [/* @__PURE__ */ e(S, { children: i.iso2 }), h && /* @__PURE__ */ e(V, {})]
644
+ children: [/* @__PURE__ */ e(S, { children: i.iso2 }), h && /* @__PURE__ */ e(D, {})]
645
645
  })]
646
646
  }, `${i.iso2}-${i.name}`);
647
647
  })] })] })
648
648
  });
649
649
  }
650
- function be({ value: n, onChange: r, placeholder: p = "Select a language...", searchable: m = !0, showNativeName: l = !0, disabled: s = !1, className: g, label: v }) {
651
- const [x, a] = k(!1), [u, c] = k(""), N = u ? re(u) : U(), f = (b) => {
652
- const d = U().find((i) => i.code.toLowerCase() === b.toLowerCase());
653
- d && (r(d), a(!1), c(""));
650
+ function xe({ value: n, onChange: r, placeholder: p = "Select a language...", searchable: m = !0, showNativeName: l = !0, disabled: s = !1, className: u, label: v }) {
651
+ const [g, a] = k(!1), [c, b] = k(""), N = c ? re(c) : U(), f = (x) => {
652
+ const d = U().find((i) => i.code.toLowerCase() === x.toLowerCase());
653
+ d && (r(d), a(!1), b(""));
654
654
  };
655
655
  return /* @__PURE__ */ e(j, {
656
656
  label: v,
657
- className: g,
658
- open: x,
657
+ className: u,
658
+ open: g,
659
659
  onOpenChange: a,
660
660
  trigger: /* @__PURE__ */ e(E, {
661
- isOpen: x,
661
+ isOpen: g,
662
662
  hasValue: !!n,
663
663
  placeholder: p,
664
664
  disabled: s,
@@ -672,41 +672,41 @@ function be({ value: n, onChange: r, placeholder: p = "Select a language...", se
672
672
  }),
673
673
  children: /* @__PURE__ */ t(L, { children: [m && /* @__PURE__ */ e(P, {
674
674
  placeholder: "Search language...",
675
- value: u,
676
- onValueChange: c
675
+ value: c,
676
+ onValueChange: b
677
677
  }), /* @__PURE__ */ t(_, { children: [N.length === 0 && /* @__PURE__ */ t(O, { children: [/* @__PURE__ */ e("span", {
678
678
  className: "text-2xl opacity-40",
679
679
  children: "🌐"
680
- }), /* @__PURE__ */ e("span", { children: "No languages found" })] }), N.map((b) => {
681
- const d = n?.code === b.code;
680
+ }), /* @__PURE__ */ e("span", { children: "No languages found" })] }), N.map((x) => {
681
+ const d = n?.code === x.code;
682
682
  return /* @__PURE__ */ t(B, {
683
- onSelect: () => f(b.code),
683
+ onSelect: () => f(x.code),
684
684
  selected: d,
685
685
  children: [/* @__PURE__ */ t("div", {
686
686
  className: "flex flex-1 flex-col gap-0 min-w-0",
687
687
  children: [/* @__PURE__ */ e("span", {
688
688
  className: "truncate font-medium",
689
- children: b.english_name
690
- }), l && b.native_name !== b.english_name && /* @__PURE__ */ e("span", {
689
+ children: x.english_name
690
+ }), l && x.native_name !== x.english_name && /* @__PURE__ */ e("span", {
691
691
  className: "text-[0.7rem] text-muted-foreground italic",
692
- children: b.native_name
692
+ children: x.native_name
693
693
  })]
694
694
  }), /* @__PURE__ */ t("div", {
695
695
  className: "flex items-center gap-1.5 ml-auto shrink-0",
696
696
  children: [/* @__PURE__ */ e(S, {
697
697
  className: "text-[0.6rem]",
698
- children: b.code
699
- }), d && /* @__PURE__ */ e(V, {})]
698
+ children: x.code
699
+ }), d && /* @__PURE__ */ e(D, {})]
700
700
  })]
701
- }, b.code);
701
+ }, x.code);
702
702
  })] })] })
703
703
  });
704
704
  }
705
- var ie = C.forwardRef(({ value: n, onChange: r, defaultCountryIso2: p = "US", placeholder: m = "Phone number", showFlag: l = !0, disabled: s = !1, className: g, label: v }, x) => {
706
- const a = le(n, r, p), u = ae(a.country?.iso2);
705
+ var le = C.forwardRef(({ value: n, onChange: r, defaultCountryIso2: p = "US", placeholder: m = "Phone number", showFlag: l = !0, disabled: s = !1, className: u, label: v }, g) => {
706
+ const a = ae(n, r, p);
707
707
  return /* @__PURE__ */ t("div", {
708
- ref: x,
709
- className: y("flex flex-col gap-0", g),
708
+ ref: g,
709
+ className: y("flex flex-col gap-0", u),
710
710
  children: [
711
711
  v && /* @__PURE__ */ e(Q, { children: v }),
712
712
  /* @__PURE__ */ t("div", {
@@ -721,7 +721,7 @@ var ie = C.forwardRef(({ value: n, onChange: r, defaultCountryIso2: p = "US", pl
721
721
  disabled: s,
722
722
  className: y("flex h-full shrink-0 items-center gap-1.5 border-r border-input bg-muted px-3", "text-sm font-semibold text-foreground transition-colors outline-none", "hover:bg-accent/30 focus-visible:bg-accent/30"),
723
723
  children: [
724
- l && a.country && /* @__PURE__ */ e(D, {
724
+ l && a.country && /* @__PURE__ */ e(V, {
725
725
  iso2: a.country.iso2,
726
726
  flag: a.country.flag,
727
727
  flagUrl: a.country.flag_url
@@ -757,7 +757,7 @@ var ie = C.forwardRef(({ value: n, onChange: r, defaultCountryIso2: p = "US", pl
757
757
  onSelect: () => a.selectCountry(c),
758
758
  selected: a.country?.iso2 === c.iso2,
759
759
  children: [
760
- /* @__PURE__ */ e(D, {
760
+ /* @__PURE__ */ e(V, {
761
761
  iso2: c.iso2,
762
762
  flag: c.flag,
763
763
  flagUrl: c.flag_url
@@ -782,8 +782,8 @@ var ie = C.forwardRef(({ value: n, onChange: r, defaultCountryIso2: p = "US", pl
782
782
  onChange: (c) => a.setNumber(c.target.value),
783
783
  placeholder: m,
784
784
  disabled: s,
785
- minLength: u.phoneLengths.min,
786
- maxLength: u.phoneLengths.max,
785
+ minLength: a.validation?.minLength,
786
+ maxLength: a.validation?.maxLength,
787
787
  inputMode: "numeric",
788
788
  autoComplete: "tel-national",
789
789
  className: y("flex-1 min-w-0 bg-transparent px-3 text-sm text-foreground", "placeholder:text-muted-foreground", "focus:outline-none")
@@ -803,9 +803,9 @@ var ie = C.forwardRef(({ value: n, onChange: r, defaultCountryIso2: p = "US", pl
803
803
  ]
804
804
  });
805
805
  });
806
- ie.displayName = "PhoneInput";
807
- function Ne({ value: n, onChange: r, placeholder: p = "Select a timezone...", searchable: m = !0, countryIso2: l, autoSelect: s = !0, disabled: g = !1, className: v, label: x }) {
808
- const [a, u] = k(!1), [c, N] = k("");
806
+ le.displayName = "PhoneInput";
807
+ function be({ value: n, onChange: r, placeholder: p = "Select a timezone...", searchable: m = !0, countryIso2: l, autoSelect: s = !0, disabled: u = !1, className: v, label: g }) {
808
+ const [a, c] = k(!1), [b, N] = k("");
809
809
  G(() => {
810
810
  if (l && s && !n) {
811
811
  const i = F(l);
@@ -817,20 +817,20 @@ function Ne({ value: n, onChange: r, placeholder: p = "Select a timezone...", se
817
817
  n,
818
818
  r
819
819
  ]);
820
- const f = l ? F(l) : ne(), b = c ? oe(c, l) : f, d = (i) => {
820
+ const f = l ? F(l) : ne(), x = b ? oe(b, l) : f, d = (i) => {
821
821
  const h = f.find((o) => o.name === i);
822
- h && (r(h), u(!1), N(""));
822
+ h && (r(h), c(!1), N(""));
823
823
  };
824
824
  return /* @__PURE__ */ e(j, {
825
- label: x,
825
+ label: g,
826
826
  className: v,
827
827
  open: a,
828
- onOpenChange: u,
828
+ onOpenChange: c,
829
829
  trigger: /* @__PURE__ */ e(E, {
830
830
  isOpen: a,
831
831
  hasValue: !!n,
832
832
  placeholder: p,
833
- disabled: g,
833
+ disabled: u,
834
834
  children: n && /* @__PURE__ */ t(R, { children: [/* @__PURE__ */ e("span", {
835
835
  className: "flex-1 text-start truncate",
836
836
  children: n.name
@@ -838,12 +838,12 @@ function Ne({ value: n, onChange: r, placeholder: p = "Select a timezone...", se
838
838
  }),
839
839
  children: /* @__PURE__ */ t(L, { children: [m && /* @__PURE__ */ e(P, {
840
840
  placeholder: "Search timezone...",
841
- value: c,
841
+ value: b,
842
842
  onValueChange: N
843
- }), /* @__PURE__ */ t(_, { children: [b.length === 0 && /* @__PURE__ */ t(O, { children: [/* @__PURE__ */ e("span", {
843
+ }), /* @__PURE__ */ t(_, { children: [x.length === 0 && /* @__PURE__ */ t(O, { children: [/* @__PURE__ */ e("span", {
844
844
  className: "text-2xl opacity-40",
845
845
  children: "🕐"
846
- }), /* @__PURE__ */ e("span", { children: "No timezones found" })] }), b.map((i) => {
846
+ }), /* @__PURE__ */ e("span", { children: "No timezones found" })] }), x.map((i) => {
847
847
  const h = n?.name === i.name;
848
848
  return /* @__PURE__ */ t(B, {
849
849
  onSelect: () => d(i.name),
@@ -866,7 +866,7 @@ function Ne({ value: n, onChange: r, placeholder: p = "Select a timezone...", se
866
866
  children: [/* @__PURE__ */ e(S, {
867
867
  className: "tabular-nums text-[0.65rem]",
868
868
  children: i.offset_name
869
- }), h && /* @__PURE__ */ e(V, {})]
869
+ }), h && /* @__PURE__ */ e(D, {})]
870
870
  })]
871
871
  }, i.name);
872
872
  })] })] })
@@ -874,25 +874,25 @@ function Ne({ value: n, onChange: r, placeholder: p = "Select a timezone...", se
874
874
  }
875
875
  export {
876
876
  S as Badge,
877
- V as CheckIcon,
877
+ D as CheckIcon,
878
878
  O as CommandEmpty,
879
879
  P as CommandInput,
880
880
  B as CommandItem,
881
881
  _ as CommandList,
882
882
  L as CommandRoot,
883
- fe as CountryMultiSelect,
884
- he as CountryPicker,
885
- ue as CurrencyMultiSelect,
886
- ge as CurrencyPicker,
887
- xe as DivisionPicker,
888
- D as Flag,
889
- be as LanguagePicker,
890
- ie as PhoneInput,
883
+ pe as CountryMultiSelect,
884
+ fe as CountryPicker,
885
+ he as CurrencyMultiSelect,
886
+ ue as CurrencyPicker,
887
+ ge as DivisionPicker,
888
+ V as Flag,
889
+ xe as LanguagePicker,
890
+ le as PhoneInput,
891
891
  E as PickerTrigger,
892
892
  J as Popover,
893
893
  W as PopoverContent,
894
894
  Y as PopoverTrigger,
895
- Ne as TimezonePicker,
895
+ be as TimezonePicker,
896
896
  y as cn
897
897
  };
898
898