@clasing/ui 2.0.6 → 2.0.8

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 (142) hide show
  1. package/dist/{badge-DgjaD6g5.js → badge-B4oRxQ-G.js} +9 -10
  2. package/dist/badge-CS2XfLYQ.cjs +1 -0
  3. package/dist/{button-D8hlW1CJ.js → button-DiOH2ngV.js} +12 -13
  4. package/dist/button-t0WrANXO.cjs +1 -0
  5. package/dist/{card-DPaMJS2f.js → card-BNTyYiyA.js} +15 -16
  6. package/dist/card-Dj2wgH-P.cjs +1 -0
  7. package/dist/{chip-C5OWe3FG.js → chip-CK2VBBsV.js} +10 -11
  8. package/dist/chip-DVKpteyL.cjs +1 -0
  9. package/dist/{command-RWDkdfba.js → command-CGUB58ej.js} +43 -44
  10. package/dist/command-CHisYTN-.cjs +1 -0
  11. package/dist/components/accordion.cjs.js +1 -1
  12. package/dist/components/accordion.es.js +22 -23
  13. package/dist/components/alert-dialog.cjs.js +1 -1
  14. package/dist/components/alert-dialog.es.js +26 -27
  15. package/dist/components/alert.cjs.js +1 -1
  16. package/dist/components/alert.es.js +15 -16
  17. package/dist/components/avatar.cjs.js +1 -1
  18. package/dist/components/avatar.es.js +13 -14
  19. package/dist/components/badge.cjs.js +1 -1
  20. package/dist/components/badge.es.js +1 -1
  21. package/dist/components/blocks/interactive-card.cjs.js +1 -1
  22. package/dist/components/blocks/interactive-card.es.js +38 -39
  23. package/dist/components/blocks/selectable-chips.cjs.js +1 -1
  24. package/dist/components/blocks/selectable-chips.es.js +8 -9
  25. package/dist/components/breadcrumb.cjs.js +1 -1
  26. package/dist/components/breadcrumb.es.js +14 -15
  27. package/dist/components/button.cjs.js +1 -1
  28. package/dist/components/button.es.js +1 -1
  29. package/dist/components/calendar.cjs.js +1 -1
  30. package/dist/components/calendar.es.js +5 -6
  31. package/dist/components/card.cjs.js +1 -1
  32. package/dist/components/card.es.js +1 -1
  33. package/dist/components/chart.cjs.js +3 -3
  34. package/dist/components/chart.es.js +11 -12
  35. package/dist/components/checkbox.cjs.js +1 -1
  36. package/dist/components/checkbox.es.js +4 -5
  37. package/dist/components/chip.cjs.js +1 -1
  38. package/dist/components/chip.es.js +1 -1
  39. package/dist/components/collapsible.cjs.js +1 -1
  40. package/dist/components/collapsible.d.ts +1 -1
  41. package/dist/components/collapsible.es.js +23 -18
  42. package/dist/components/command.cjs.js +1 -1
  43. package/dist/components/command.es.js +1 -1
  44. package/dist/components/context-menu.cjs.js +1 -1
  45. package/dist/components/context-menu.es.js +32 -33
  46. package/dist/components/dialog.cjs.js +1 -1
  47. package/dist/components/dialog.es.js +1 -1
  48. package/dist/components/divider.cjs.js +1 -1
  49. package/dist/components/divider.es.js +7 -8
  50. package/dist/components/drawer.cjs.js +1 -1
  51. package/dist/components/drawer.es.js +17 -18
  52. package/dist/components/dropdown-menu.cjs.js +1 -1
  53. package/dist/components/dropdown-menu.es.js +32 -33
  54. package/dist/components/form.cjs.js +1 -1
  55. package/dist/components/form.es.js +29 -30
  56. package/dist/components/hover-card.cjs.js +1 -1
  57. package/dist/components/hover-card.es.js +17 -18
  58. package/dist/components/icon-component.cjs.js +1 -1
  59. package/dist/components/icon-component.es.js +1 -1
  60. package/dist/components/input-otp.cjs.js +1 -1
  61. package/dist/components/input-otp.es.js +19 -20
  62. package/dist/components/input.cjs.js +1 -1
  63. package/dist/components/input.es.js +1 -1
  64. package/dist/components/label.cjs.js +1 -1
  65. package/dist/components/label.es.js +1 -1
  66. package/dist/components/menubar.cjs.js +1 -1
  67. package/dist/components/menubar.es.js +32 -33
  68. package/dist/components/multi-select.cjs.js +1 -1
  69. package/dist/components/multi-select.d.ts +5 -1
  70. package/dist/components/multi-select.es.js +174 -150
  71. package/dist/components/navigation-menu.cjs.js +1 -1
  72. package/dist/components/navigation-menu.es.js +17 -18
  73. package/dist/components/phone-input.cjs.js +1 -1
  74. package/dist/components/phone-input.es.js +20 -21
  75. package/dist/components/popover.cjs.js +1 -1
  76. package/dist/components/popover.es.js +1 -1
  77. package/dist/components/progress.cjs.js +1 -1
  78. package/dist/components/progress.es.js +3 -4
  79. package/dist/components/resizable.cjs.js +1 -1
  80. package/dist/components/resizable.es.js +8 -9
  81. package/dist/components/scroll-area.cjs.js +1 -1
  82. package/dist/components/scroll-area.es.js +1 -1
  83. package/dist/components/select.cjs.js +1 -1
  84. package/dist/components/select.es.js +16 -17
  85. package/dist/components/sheet.cjs.js +1 -1
  86. package/dist/components/sheet.es.js +18 -19
  87. package/dist/components/skeleton.cjs.js +1 -1
  88. package/dist/components/skeleton.es.js +6 -7
  89. package/dist/components/slider.cjs.js +1 -1
  90. package/dist/components/slider.es.js +9 -10
  91. package/dist/components/sonner.cjs.js +1 -1
  92. package/dist/components/sonner.es.js +13 -14
  93. package/dist/components/switch.cjs.js +1 -1
  94. package/dist/components/switch.es.js +7 -8
  95. package/dist/components/table.cjs.js +1 -1
  96. package/dist/components/table.es.js +15 -16
  97. package/dist/components/textarea.cjs.js +1 -1
  98. package/dist/components/textarea.es.js +10 -11
  99. package/dist/components/toggle-group.cjs.js +1 -1
  100. package/dist/components/toggle-group.es.js +21 -22
  101. package/dist/components/toggle.cjs.js +1 -1
  102. package/dist/components/toggle.es.js +1 -1
  103. package/dist/components/tooltip.cjs.js +1 -1
  104. package/dist/components/tooltip.es.js +1 -1
  105. package/dist/{dialog-BSEMFrzb.js → dialog-CEttcpWT.js} +16 -17
  106. package/dist/dialog-Chh5qAxR.cjs +1 -0
  107. package/dist/icon-component-DGImZz3K.js +49 -0
  108. package/dist/icon-component-DTlgy__B.cjs +1 -0
  109. package/dist/{index-C8P6Mn4U.cjs → index-BVmT9wZC.cjs} +1 -1
  110. package/dist/{index-BqtVL8d-.js → index-CwXB7YIx.js} +1 -1
  111. package/dist/{index-CRiPKpXj.js → index-DBpnlzOP.js} +759 -477
  112. package/dist/index-DSjHHn1r.cjs +22 -0
  113. package/dist/{input-CUpmfQgR.js → input-B6wjJM4O.js} +14 -15
  114. package/dist/input-Dpz3zGIU.cjs +1 -0
  115. package/dist/{label-CKObiJEl.js → label-Bp4qkqFq.js} +7 -8
  116. package/dist/label-eHraXPfy.cjs +1 -0
  117. package/dist/popover-BnLx2OY6.cjs +1 -0
  118. package/dist/{popover-CHAUhJda.js → popover-C6pozFVL.js} +13 -14
  119. package/dist/scroll-area-CJpVshOm.cjs +1 -0
  120. package/dist/{scroll-area-DwBiu3Jn.js → scroll-area-Dj0Szbw6.js} +3 -4
  121. package/dist/toggle-CJLDdFRo.cjs +1 -0
  122. package/dist/{toggle-DkQSX3ux.js → toggle-owj9AHVO.js} +9 -10
  123. package/dist/tooltip-BvdeurjC.cjs +1 -0
  124. package/dist/{tooltip-DgWl3klK.js → tooltip-CUaxcngn.js} +7 -8
  125. package/package.json +1 -1
  126. package/dist/badge-DuEEk3J_.cjs +0 -1
  127. package/dist/button-U1793OQ4.cjs +0 -1
  128. package/dist/card-BJMc0row.cjs +0 -1
  129. package/dist/chip-CXa6E8Cf.cjs +0 -1
  130. package/dist/command-B7wbtmbM.cjs +0 -1
  131. package/dist/dialog-aYmcf_6q.cjs +0 -1
  132. package/dist/icon-component-4lyl8wE_.cjs +0 -1
  133. package/dist/icon-component-Db_44zX2.js +0 -50
  134. package/dist/index-DoxiiusW.cjs +0 -1
  135. package/dist/input-belq5zLm.cjs +0 -1
  136. package/dist/jsx-runtime-BuHQgaKs.cjs +0 -22
  137. package/dist/jsx-runtime-DywqP_6a.js +0 -284
  138. package/dist/label-RxaHfl3U.cjs +0 -1
  139. package/dist/popover-4V87msIT.cjs +0 -1
  140. package/dist/scroll-area-hg-bGoRe.cjs +0 -1
  141. package/dist/toggle-v18XjPC4.cjs +0 -1
  142. package/dist/tooltip-__VfWmJD.cjs +0 -1
@@ -1,71 +1,84 @@
1
- import { j as t } from "../jsx-runtime-DywqP_6a.js";
2
- import { B as I } from "../badge-DgjaD6g5.js";
3
- import { C as k, f as E, d as O, b as R, c as _, e as A, g as W } from "../command-RWDkdfba.js";
4
- import { P as F, b as G, c as B } from "../popover-CHAUhJda.js";
5
- import { c as S } from "../index-CRiPKpXj.js";
6
- import { createContext as L, useState as y, useCallback as V, useEffect as v, useRef as j, useLayoutEffect as T, useContext as X } from "react";
7
- import { I as C } from "../icon-component-Db_44zX2.js";
8
- const z = L(null);
9
- function Y({
10
- children: e,
11
- values: n,
12
- defaultValues: r,
13
- onValuesChange: o
1
+ import { j as e, c as z } from "../index-DBpnlzOP.js";
2
+ import { B as E } from "../badge-B4oRxQ-G.js";
3
+ import { C as P, f as R, d as _, b as A, c as L, e as F, g as W } from "../command-CGUB58ej.js";
4
+ import { P as G, b as T, c as B } from "../popover-C6pozFVL.js";
5
+ import { createContext as X, useState as y, useCallback as I, useEffect as k, useRef as V, useLayoutEffect as q, useContext as D } from "react";
6
+ import { I as N } from "../icon-component-DGImZz3K.js";
7
+ const O = X(null);
8
+ function Z({
9
+ children: t,
10
+ values: r,
11
+ defaultValues: o,
12
+ onValuesChange: a,
13
+ isLoading: u,
14
+ onSearchChange: l,
15
+ loadingText: p = "Loading...",
16
+ noResultsText: c = "No results found"
14
17
  }) {
15
- const [d, m] = y(!1), [g, p] = y(
16
- new Set(n ?? r)
17
- ), [w, f] = y(/* @__PURE__ */ new Map());
18
- function b(a) {
19
- const s = (l) => {
20
- const c = new Set(l);
21
- return c.has(a) ? c.delete(a) : c.add(a), c;
18
+ const [h, m] = y(!1), [b, f] = y(
19
+ new Set(r ?? o)
20
+ ), [v, d] = y(/* @__PURE__ */ new Map()), [g, j] = y("");
21
+ function s(n) {
22
+ const x = (w) => {
23
+ const C = new Set(w);
24
+ return C.has(n) ? C.delete(n) : C.add(n), C;
22
25
  };
23
- p(s), o?.([...s(g)]);
26
+ f(x), a?.([...x(b)]);
24
27
  }
25
- const x = V((a, s) => {
26
- f((l) => l.get(a) === s ? l : new Map(l).set(a, s));
27
- }, []);
28
- return /* @__PURE__ */ t.jsx(
29
- z,
28
+ const i = I((n, x) => {
29
+ d((w) => w.get(n) === x ? w : new Map(w).set(n, x));
30
+ }, []), S = I(
31
+ (n) => {
32
+ j(n), l?.(n);
33
+ },
34
+ [l]
35
+ );
36
+ return /* @__PURE__ */ e.jsx(
37
+ O,
30
38
  {
31
39
  value: {
32
- open: d,
40
+ open: h,
33
41
  setOpen: m,
34
- selectedValues: n ? new Set(n) : g,
35
- toggleValue: b,
36
- items: w,
37
- onItemAdded: x
42
+ selectedValues: r ? new Set(r) : b,
43
+ toggleValue: s,
44
+ items: v,
45
+ onItemAdded: i,
46
+ isLoading: u,
47
+ searchValue: g,
48
+ onSearchChange: S,
49
+ loadingText: p,
50
+ noResultsText: c
38
51
  },
39
- children: /* @__PURE__ */ t.jsx(F, { open: d, onOpenChange: m, children: e })
52
+ children: /* @__PURE__ */ e.jsx(G, { open: h, onOpenChange: m, children: t })
40
53
  }
41
54
  );
42
55
  }
43
- function Z({
44
- className: e,
45
- children: n,
46
- size: r = "md",
47
- ...o
56
+ function $({
57
+ className: t,
58
+ children: r,
59
+ size: o = "md",
60
+ ...a
48
61
  }) {
49
- const { open: d } = M();
50
- return /* @__PURE__ */ t.jsx(B, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
62
+ const { open: u } = M();
63
+ return /* @__PURE__ */ e.jsx(B, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
51
64
  "button",
52
65
  {
53
- ...o,
54
- role: o.role ?? "combobox",
55
- "aria-expanded": o["aria-expanded"] ?? d,
56
- "data-size": r,
57
- className: S(
66
+ ...a,
67
+ role: a.role ?? "combobox",
68
+ "aria-expanded": a["aria-expanded"] ?? u,
69
+ "data-size": o,
70
+ className: z(
58
71
  "border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-fit items-center justify-between gap-2 overflow-hidden rounded-md border bg-transparent whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
59
- r === "xs" && 'label-sm h-7 px-2 py-1 [&_svg:not([class*="size-"])]:size-3.5',
60
- r === "sm" && "label-md h-8 px-2 py-1",
61
- r === "md" && "label-lg h-12 px-3 py-1",
62
- r === "lg" && "label-xl h-16 px-4 py-2",
63
- e
72
+ o === "xs" && 'label-sm h-7 px-2 py-1 [&_svg:not([class*="size-"])]:size-3.5',
73
+ o === "sm" && "label-md h-8 px-2 py-1",
74
+ o === "md" && "label-lg h-12 px-3 py-1",
75
+ o === "lg" && "label-xl h-16 px-4 py-2",
76
+ t
64
77
  ),
65
78
  children: [
66
- n,
67
- /* @__PURE__ */ t.jsx(
68
- C,
79
+ r,
80
+ /* @__PURE__ */ e.jsx(
81
+ N,
69
82
  {
70
83
  iconName: "IconSelector",
71
84
  className: "size-4 shrink-0 opacity-50"
@@ -75,65 +88,65 @@ function Z({
75
88
  }
76
89
  ) });
77
90
  }
78
- function $({
79
- placeholder: e,
80
- clickToRemove: n = !0,
81
- className: r,
82
- overflowBehavior: o = "wrap-when-open",
83
- ...d
91
+ function ee({
92
+ placeholder: t,
93
+ clickToRemove: r = !0,
94
+ className: o,
95
+ overflowBehavior: a = "wrap-when-open",
96
+ ...u
84
97
  }) {
85
- const { selectedValues: m, toggleValue: g, items: p, open: w } = M(), [f, b] = y(0), x = j(null), a = j(null), s = j(/* @__PURE__ */ new Set()), l = o === "wrap" || o === "wrap-when-open" && w;
86
- v(() => {
87
- l && s.current.forEach((i) => i.style.removeProperty("display"));
88
- }, [l]);
89
- const c = V(() => {
90
- if (x.current == null) return;
91
- const i = x.current, u = a.current;
92
- u != null && (u.style.display = "none"), s.current.forEach((h) => h.style.removeProperty("display"));
93
- let N = 0;
94
- for (let h = s.current.size - 1; h >= 0; h--) {
95
- const P = [...s.current][h];
96
- if (i.scrollWidth <= i.clientWidth)
98
+ const { selectedValues: l, toggleValue: p, items: c, open: h } = M(), [m, b] = y(0), f = V(null), v = V(null), d = V(/* @__PURE__ */ new Set()), g = a === "wrap" || a === "wrap-when-open" && h;
99
+ k(() => {
100
+ g && d.current.forEach((s) => s.style.removeProperty("display"));
101
+ }, [g]);
102
+ const j = I(() => {
103
+ if (f.current == null) return;
104
+ const s = f.current, i = v.current;
105
+ i != null && (i.style.display = "none"), d.current.forEach((n) => n.style.removeProperty("display"));
106
+ let S = 0;
107
+ for (let n = d.current.size - 1; n >= 0; n--) {
108
+ const x = [...d.current][n];
109
+ if (s.scrollWidth <= s.clientWidth)
97
110
  break;
98
- N = s.current.size - h, P.style.display = "none", u?.style.removeProperty("display");
111
+ S = d.current.size - n, x.style.display = "none", i?.style.removeProperty("display");
99
112
  }
100
- b(N);
113
+ b(S);
101
114
  }, []);
102
- return v(() => {
103
- if (x.current == null) return;
104
- const i = new ResizeObserver(c);
105
- return i.observe(x.current), () => i.disconnect();
106
- }, [c]), T(() => {
107
- c();
108
- }, [m, c]), m.size === 0 && e ? /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground font-normal", children: e }) : /* @__PURE__ */ t.jsxs(
115
+ return k(() => {
116
+ if (f.current == null) return;
117
+ const s = new ResizeObserver(j);
118
+ return s.observe(f.current), () => s.disconnect();
119
+ }, [j]), q(() => {
120
+ j();
121
+ }, [l, j]), l.size === 0 && t ? /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground font-normal", children: t }) : /* @__PURE__ */ e.jsxs(
109
122
  "div",
110
123
  {
111
- ...d,
112
- ref: x,
113
- className: S(
124
+ ...u,
125
+ ref: f,
126
+ className: z(
114
127
  "flex min-h-[1.75rem] w-full gap-1.5 overflow-hidden",
115
- l && "flex-wrap",
116
- r
128
+ g && "flex-wrap",
129
+ o
117
130
  ),
118
131
  children: [
119
- [...m].filter((i) => p.has(i)).map((i) => /* @__PURE__ */ t.jsxs(
120
- I,
132
+ [...l].filter((s) => c.has(s)).map((s) => /* @__PURE__ */ e.jsxs(
133
+ E,
121
134
  {
122
- ref: (u) => {
123
- if (u != null)
124
- return s.current.add(u), () => {
125
- s.current.delete(u);
135
+ ref: (i) => {
136
+ if (i != null)
137
+ return d.current.add(i), () => {
138
+ d.current.delete(i);
126
139
  };
127
140
  },
128
141
  variant: "outline",
129
142
  className: "group flex items-center gap-1",
130
- onClick: n ? (u) => {
131
- u.stopPropagation(), g(i);
143
+ onClick: r ? (i) => {
144
+ i.stopPropagation(), p(s);
132
145
  } : void 0,
133
146
  children: [
134
- p.get(i),
135
- n && /* @__PURE__ */ t.jsx(
136
- C,
147
+ c.get(s),
148
+ r && /* @__PURE__ */ e.jsx(
149
+ N,
137
150
  {
138
151
  iconName: "IconX",
139
152
  className: "text-muted-foreground group-hover:text-destructive size-2"
@@ -141,19 +154,19 @@ function $({
141
154
  )
142
155
  ]
143
156
  },
144
- i
157
+ s
145
158
  )),
146
- /* @__PURE__ */ t.jsxs(
147
- I,
159
+ /* @__PURE__ */ e.jsxs(
160
+ E,
148
161
  {
149
162
  style: {
150
- display: f > 0 && !l ? "block" : "none"
163
+ display: m > 0 && !g ? "block" : "none"
151
164
  },
152
165
  variant: "outline",
153
- ref: a,
166
+ ref: v,
154
167
  children: [
155
168
  "+",
156
- f
169
+ m
157
170
  ]
158
171
  }
159
172
  )
@@ -161,79 +174,90 @@ function $({
161
174
  }
162
175
  );
163
176
  }
164
- function ee({
165
- search: e = !0,
166
- children: n,
167
- ...r
177
+ function te({
178
+ search: t = !0,
179
+ children: r,
180
+ ...o
168
181
  }) {
169
- const o = typeof e == "object" ? !0 : e;
170
- return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
171
- /* @__PURE__ */ t.jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ t.jsx(k, { children: /* @__PURE__ */ t.jsx(E, { children: n }) }) }),
172
- /* @__PURE__ */ t.jsx(G, { className: "min-w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ t.jsxs(k, { ...r, children: [
173
- o ? /* @__PURE__ */ t.jsx(
174
- O,
182
+ const { isLoading: a, onSearchChange: u, searchValue: l, noResultsText: p } = M(), c = typeof t == "object" ? !0 : t;
183
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
184
+ /* @__PURE__ */ e.jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ e.jsx(P, { children: /* @__PURE__ */ e.jsx(R, { children: r }) }) }),
185
+ /* @__PURE__ */ e.jsx(T, { className: "min-w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ e.jsxs(P, { ...o, children: [
186
+ c ? /* @__PURE__ */ e.jsx(
187
+ _,
175
188
  {
176
- placeholder: typeof e == "object" ? e.placeholder : void 0
189
+ placeholder: typeof t == "object" ? t.placeholder : void 0,
190
+ value: l,
191
+ onValueChange: u
177
192
  }
178
- ) : /* @__PURE__ */ t.jsx("button", { autoFocus: !0, "aria-hidden": "true", className: "sr-only" }),
179
- /* @__PURE__ */ t.jsxs(E, { children: [
180
- o && /* @__PURE__ */ t.jsx(R, { children: typeof e == "object" ? e.emptyMessage : void 0 }),
181
- n
182
- ] })
193
+ ) : /* @__PURE__ */ e.jsx("button", { autoFocus: !0, "aria-hidden": "true", className: "sr-only" }),
194
+ /* @__PURE__ */ e.jsx(R, { children: a ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center py-6", children: [
195
+ /* @__PURE__ */ e.jsx(
196
+ N,
197
+ {
198
+ iconName: "IconLoader2",
199
+ className: "text-muted-foreground size-4 animate-spin"
200
+ }
201
+ ),
202
+ /* @__PURE__ */ e.jsx("span", { className: "text-muted-foreground ml-2 text-sm", children: a })
203
+ ] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
204
+ c && /* @__PURE__ */ e.jsx(A, { children: p }),
205
+ r
206
+ ] }) })
183
207
  ] }) })
184
208
  ] });
185
209
  }
186
- function te({
187
- value: e,
188
- children: n,
189
- badgeLabel: r,
190
- onSelect: o,
191
- ...d
210
+ function ne({
211
+ value: t,
212
+ children: r,
213
+ badgeLabel: o,
214
+ onSelect: a,
215
+ ...u
192
216
  }) {
193
- const { toggleValue: m, selectedValues: g, onItemAdded: p } = M(), w = g.has(e);
194
- return v(() => {
195
- p(e, r ?? n);
196
- }, [e, n, p, r]), /* @__PURE__ */ t.jsxs(
197
- A,
217
+ const { toggleValue: l, selectedValues: p, onItemAdded: c } = M(), h = p.has(t);
218
+ return k(() => {
219
+ c(t, o ?? r);
220
+ }, [t, r, c, o]), /* @__PURE__ */ e.jsxs(
221
+ F,
198
222
  {
199
- ...d,
200
- value: e,
201
- onSelect: (f) => {
202
- m(f), o?.(f);
223
+ ...u,
224
+ value: t,
225
+ onSelect: (m) => {
226
+ l(m), a?.(m);
203
227
  },
204
228
  children: [
205
- /* @__PURE__ */ t.jsx(
206
- C,
229
+ /* @__PURE__ */ e.jsx(
230
+ N,
207
231
  {
208
232
  iconName: "IconCheck",
209
- className: S("mr-2 size-4", w ? "opacity-100" : "opacity-0")
233
+ className: z("mr-2 size-4", h ? "opacity-100" : "opacity-0")
210
234
  }
211
235
  ),
212
- n
236
+ r
213
237
  ]
214
238
  }
215
239
  );
216
240
  }
217
- function ne(e) {
218
- return /* @__PURE__ */ t.jsx(_, { ...e });
241
+ function re(t) {
242
+ return /* @__PURE__ */ e.jsx(L, { ...t });
219
243
  }
220
- function re(e) {
221
- return /* @__PURE__ */ t.jsx(W, { ...e });
244
+ function se(t) {
245
+ return /* @__PURE__ */ e.jsx(W, { ...t });
222
246
  }
223
247
  function M() {
224
- const e = X(z);
225
- if (e == null)
248
+ const t = D(O);
249
+ if (t == null)
226
250
  throw new Error(
227
251
  "useMultiSelectContext must be used within a MultiSelectContext"
228
252
  );
229
- return e;
253
+ return t;
230
254
  }
231
255
  export {
232
- Y as MultiSelect,
233
- ee as MultiSelectContent,
234
- ne as MultiSelectGroup,
235
- te as MultiSelectItem,
236
- re as MultiSelectSeparator,
237
- Z as MultiSelectTrigger,
238
- $ as MultiSelectValue
256
+ Z as MultiSelect,
257
+ te as MultiSelectContent,
258
+ re as MultiSelectGroup,
259
+ ne as MultiSelectItem,
260
+ se as MultiSelectSeparator,
261
+ $ as MultiSelectTrigger,
262
+ ee as MultiSelectValue
239
263
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../jsx-runtime-BuHQgaKs.cjs"),d=require("@radix-ui/react-navigation-menu"),c=require("../index-C8P6Mn4U.cjs"),o=require("../index-DoxiiusW.cjs"),g=require("../icon-component-4lyl8wE_.cjs");function l(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const i=l(d);function m({className:t,children:e,viewport:n=!0,...r}){return a.jsxRuntimeExports.jsxs(i.Root,{"data-slot":"navigation-menu","data-viewport":n,className:o.cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",t),...r,children:[e,n&&a.jsxRuntimeExports.jsx(u,{})]})}function v({className:t,...e}){return a.jsxRuntimeExports.jsx(i.List,{"data-slot":"navigation-menu-list",className:o.cn("group flex flex-1 list-none items-center justify-center gap-1",t),...e})}function p({className:t,...e}){return a.jsxRuntimeExports.jsx(i.Item,{"data-slot":"navigation-menu-item",className:o.cn("relative",t),...e})}const s=c.cva("group bg-background hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 paragraph-sm inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 font-medium transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50");function f({className:t,children:e,...n}){return a.jsxRuntimeExports.jsxs(i.Trigger,{"data-slot":"navigation-menu-trigger",className:o.cn(s(),"group",t),...n,children:[e," ",a.jsxRuntimeExports.jsx(g.IconComponent,{iconName:"IconChevronDown",className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function x({className:t,...e}){return a.jsxRuntimeExports.jsx(i.Content,{"data-slot":"navigation-menu-content",className:o.cn("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",t),...e})}function u({className:t,...e}){return a.jsxRuntimeExports.jsx("div",{className:o.cn("absolute top-full left-0 isolate z-50 flex justify-center"),children:a.jsxRuntimeExports.jsx(i.Viewport,{"data-slot":"navigation-menu-viewport",className:o.cn("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",t),...e})})}function b({className:t,...e}){return a.jsxRuntimeExports.jsx(i.Link,{"data-slot":"navigation-menu-link",className:o.cn("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground paragraph-sm flex flex-col gap-1 rounded-sm p-2 transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",t),...e})}function w({className:t,...e}){return a.jsxRuntimeExports.jsx(i.Indicator,{"data-slot":"navigation-menu-indicator",className:o.cn("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",t),...e,children:a.jsxRuntimeExports.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}exports.NavigationMenu=m;exports.NavigationMenuContent=x;exports.NavigationMenuIndicator=w;exports.NavigationMenuItem=p;exports.NavigationMenuLink=b;exports.NavigationMenuList=v;exports.NavigationMenuTrigger=f;exports.NavigationMenuViewport=u;exports.navigationMenuTriggerStyle=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-DSjHHn1r.cjs"),u=require("@radix-ui/react-navigation-menu"),d=require("../index-BVmT9wZC.cjs"),c=require("../icon-component-DTlgy__B.cjs");function g(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,i.get?i:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const o=g(u);function l({className:t,children:a,viewport:n=!0,...i}){return e.jsxRuntimeExports.jsxs(o.Root,{"data-slot":"navigation-menu","data-viewport":n,className:e.cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",t),...i,children:[a,n&&e.jsxRuntimeExports.jsx(s,{})]})}function m({className:t,...a}){return e.jsxRuntimeExports.jsx(o.List,{"data-slot":"navigation-menu-list",className:e.cn("group flex flex-1 list-none items-center justify-center gap-1",t),...a})}function v({className:t,...a}){return e.jsxRuntimeExports.jsx(o.Item,{"data-slot":"navigation-menu-item",className:e.cn("relative",t),...a})}const r=d.cva("group bg-background hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 paragraph-sm inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 font-medium transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50");function p({className:t,children:a,...n}){return e.jsxRuntimeExports.jsxs(o.Trigger,{"data-slot":"navigation-menu-trigger",className:e.cn(r(),"group",t),...n,children:[a," ",e.jsxRuntimeExports.jsx(c.IconComponent,{iconName:"IconChevronDown",className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function f({className:t,...a}){return e.jsxRuntimeExports.jsx(o.Content,{"data-slot":"navigation-menu-content",className:e.cn("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",t),...a})}function s({className:t,...a}){return e.jsxRuntimeExports.jsx("div",{className:e.cn("absolute top-full left-0 isolate z-50 flex justify-center"),children:e.jsxRuntimeExports.jsx(o.Viewport,{"data-slot":"navigation-menu-viewport",className:e.cn("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",t),...a})})}function x({className:t,...a}){return e.jsxRuntimeExports.jsx(o.Link,{"data-slot":"navigation-menu-link",className:e.cn("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground paragraph-sm flex flex-col gap-1 rounded-sm p-2 transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",t),...a})}function b({className:t,...a}){return e.jsxRuntimeExports.jsx(o.Indicator,{"data-slot":"navigation-menu-indicator",className:e.cn("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",t),...a,children:e.jsxRuntimeExports.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}exports.NavigationMenu=l;exports.NavigationMenuContent=f;exports.NavigationMenuIndicator=b;exports.NavigationMenuItem=v;exports.NavigationMenuLink=x;exports.NavigationMenuList=m;exports.NavigationMenuTrigger=p;exports.NavigationMenuViewport=s;exports.navigationMenuTriggerStyle=r;
@@ -1,9 +1,8 @@
1
- import { j as e } from "../jsx-runtime-DywqP_6a.js";
1
+ import { j as e, c as o } from "../index-DBpnlzOP.js";
2
2
  import * as n from "@radix-ui/react-navigation-menu";
3
- import { c as s } from "../index-BqtVL8d-.js";
4
- import { c as o } from "../index-CRiPKpXj.js";
5
- import { I as u } from "../icon-component-Db_44zX2.js";
6
- function f({
3
+ import { c as s } from "../index-CwXB7YIx.js";
4
+ import { I as u } from "../icon-component-DGImZz3K.js";
5
+ function v({
7
6
  className: t,
8
7
  children: a,
9
8
  viewport: i = !0,
@@ -26,7 +25,7 @@ function f({
26
25
  }
27
26
  );
28
27
  }
29
- function p({
28
+ function f({
30
29
  className: t,
31
30
  ...a
32
31
  }) {
@@ -42,7 +41,7 @@ function p({
42
41
  }
43
42
  );
44
43
  }
45
- function x({
44
+ function p({
46
45
  className: t,
47
46
  ...a
48
47
  }) {
@@ -58,7 +57,7 @@ function x({
58
57
  const d = s(
59
58
  "group bg-background hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 paragraph-sm inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 font-medium transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50"
60
59
  );
61
- function w({
60
+ function x({
62
61
  className: t,
63
62
  children: a,
64
63
  ...i
@@ -84,7 +83,7 @@ function w({
84
83
  }
85
84
  );
86
85
  }
87
- function h({
86
+ function w({
88
87
  className: t,
89
88
  ...a
90
89
  }) {
@@ -125,7 +124,7 @@ function l({
125
124
  }
126
125
  );
127
126
  }
128
- function b({
127
+ function h({
129
128
  className: t,
130
129
  ...a
131
130
  }) {
@@ -141,7 +140,7 @@ function b({
141
140
  }
142
141
  );
143
142
  }
144
- function N({
143
+ function b({
145
144
  className: t,
146
145
  ...a
147
146
  }) {
@@ -159,13 +158,13 @@ function N({
159
158
  );
160
159
  }
161
160
  export {
162
- f as NavigationMenu,
163
- h as NavigationMenuContent,
164
- N as NavigationMenuIndicator,
165
- x as NavigationMenuItem,
166
- b as NavigationMenuLink,
167
- p as NavigationMenuList,
168
- w as NavigationMenuTrigger,
161
+ v as NavigationMenu,
162
+ w as NavigationMenuContent,
163
+ b as NavigationMenuIndicator,
164
+ p as NavigationMenuItem,
165
+ h as NavigationMenuLink,
166
+ f as NavigationMenuList,
167
+ x as NavigationMenuTrigger,
169
168
  l as NavigationMenuViewport,
170
169
  d as navigationMenuTriggerStyle
171
170
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jsx-runtime-BuHQgaKs.cjs"),c=require("../command-B7wbtmbM.cjs"),S=require("../input-belq5zLm.cjs"),f=require("../popover-4V87msIT.cjs"),I=require("../scroll-area-hg-bGoRe.cjs"),m=require("../index-DoxiiusW.cjs"),q=require("react"),w=require("react-phone-number-input"),P=require("react-phone-number-input/flags"),O=require("react-phone-number-input/locale/en"),_=require("react-phone-number-input/locale/es"),T=require("react-phone-number-input/locale/fr"),b=require("../icon-component-4lyl8wE_.cjs");function R(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>n[o]})}}return t.default=n,Object.freeze(t)}const d=R(q),y=R(w),C=d.forwardRef(({className:n,onChange:t,value:o,size:r="md",rounded:s="default",locale:l="en",...i},p)=>e.jsxRuntimeExports.jsx(y.default,{ref:p,className:m.cn("flex",n),flagComponent:j,countrySelectComponent:k,inputComponent:E,smartCaret:!1,labels:l==="es"?_:l==="fr"?T:O,value:o||void 0,onChange:u=>t?.(u||""),countrySelectProps:{size:r,rounded:s},numberInputProps:{size:r,rounded:s},...i}));C.displayName="PhoneInput";const E=d.forwardRef(({className:n,rounded:t="default",error:o,touched:r,size:s,...l},i)=>{const{"data-country":p,...u}=l;return e.jsxRuntimeExports.jsx(S.Input,{size:s,className:m.cn("w-full",{"border-destructive":o&&r,"border-blue-800":r&&!o,"rounded-s-none rounded-e-lg":t!=="full","rounded-s-none rounded-e-full":t==="full","rounded-e-sm":s==="sm","rounded-e-md":s==="md","rounded-e-lg":s==="lg"},n),...u,ref:i})});E.displayName="InputComponent";const k=({disabled:n,value:t,options:o,onChange:r,size:s="md",rounded:l="default",error:i,touched:p})=>{const u=d.useRef(null),[v,g]=d.useState(""),[N,h]=d.useState(!1);return e.jsxRuntimeExports.jsxs(f.Popover,{open:N,modal:!0,onOpenChange:a=>{h(a),a&&g("")},children:[e.jsxRuntimeExports.jsx(f.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:m.cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 file:paragraph-sm md:paragraph-sm paragraph-md flex w-fit min-w-0 items-center justify-center border border-r-0 bg-transparent transition-[color,box-shadow] outline-none file:inline-flex file:border-0 file:bg-transparent file:font-semibold focus-visible:z-1 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",l==="default"?"rounded-e-none":"rounded-s-full rounded-e-none",{"outline-destructive":i&&p,"outline-blue-800":p&&!i,"label-md h-8 rounded-s-sm px-2 py-1":s==="sm","label-lg h-12 rounded-s-md px-3 py-1":s==="md","label-xl h-16 rounded-s-lg px-4 py-2":s==="lg"}),disabled:n,children:[e.jsxRuntimeExports.jsx(j,{country:t,countryName:t,disabled:n}),e.jsxRuntimeExports.jsx(b.IconComponent,{iconName:"IconChevronDown",className:m.cn("-mr-2 size-4 opacity-50",n?"hidden":"opacity-100")})]})}),e.jsxRuntimeExports.jsx(f.PopoverContent,{className:"w-[300px] p-0",children:e.jsxRuntimeExports.jsxs(c.Command,{children:[e.jsxRuntimeExports.jsx(c.CommandInput,{value:v,onValueChange:a=>{g(a),setTimeout(()=>{if(u.current){const x=u.current.querySelector("[data-radix-scroll-area-viewport]");x&&(x.scrollTop=0)}},0)},placeholder:"Search country..."}),e.jsxRuntimeExports.jsx(c.CommandList,{children:e.jsxRuntimeExports.jsxs(I.ScrollArea,{ref:u,className:"h-72",children:[e.jsxRuntimeExports.jsx(c.CommandEmpty,{children:"No country found."}),e.jsxRuntimeExports.jsx(c.CommandGroup,{children:o.map(({value:a,label:x})=>a?e.jsxRuntimeExports.jsx(A,{country:a,countryName:x,selectedCountry:t,onChange:r,onSelectComplete:()=>h(!1)},a):null)})]})})]})})]})},A=({country:n,countryName:t,selectedCountry:o,onChange:r,onSelectComplete:s})=>{const l=()=>{r(n),s()};return e.jsxRuntimeExports.jsxs(c.CommandItem,{className:"gap-2",onSelect:l,children:[e.jsxRuntimeExports.jsx(j,{country:n,countryName:t}),e.jsxRuntimeExports.jsx("span",{className:"paragraph-sm flex-1",children:t}),e.jsxRuntimeExports.jsx("span",{className:"text-foreground/50 paragraph-sm",children:`+${y.getCountryCallingCode(n)}`}),e.jsxRuntimeExports.jsx(b.IconComponent,{iconName:"IconCheck",className:`ml-auto size-4 ${n===o?"opacity-100":"opacity-0"}`})]})},j=({country:n,countryName:t,disabled:o})=>{const r=P[n];return e.jsxRuntimeExports.jsx("span",{className:m.cn("bg-foreground/20 flex h-4 w-6 overflow-hidden rounded-[4px] [&_svg:not([class*='size-'])]:size-full",{"opacity-50":o}),children:r&&e.jsxRuntimeExports.jsx(r,{title:t})})};exports.PhoneInput=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-DSjHHn1r.cjs"),c=require("../command-CHisYTN-.cjs"),N=require("../input-Dpz3zGIU.cjs"),x=require("../popover-BnLx2OY6.cjs"),S=require("../scroll-area-CJpVshOm.cjs"),I=require("react"),w=require("react-phone-number-input"),P=require("react-phone-number-input/flags"),q=require("react-phone-number-input/locale/en"),O=require("react-phone-number-input/locale/es"),_=require("react-phone-number-input/locale/fr"),h=require("../icon-component-DTlgy__B.cjs");function b(n){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>n[o]})}}return t.default=n,Object.freeze(t)}const d=b(I),R=b(w),y=d.forwardRef(({className:n,onChange:t,value:o,size:r="md",rounded:s="default",locale:l="en",...i},p)=>e.jsxRuntimeExports.jsx(R.default,{ref:p,className:e.cn("flex",n),flagComponent:f,countrySelectComponent:T,inputComponent:C,smartCaret:!1,labels:l==="es"?O:l==="fr"?_:q,value:o||void 0,onChange:u=>t?.(u||""),countrySelectProps:{size:r,rounded:s},numberInputProps:{size:r,rounded:s},...i}));y.displayName="PhoneInput";const C=d.forwardRef(({className:n,rounded:t="default",error:o,touched:r,size:s,...l},i)=>{const{"data-country":p,...u}=l;return e.jsxRuntimeExports.jsx(N.Input,{size:s,className:e.cn("w-full",{"border-destructive":o&&r,"border-blue-800":r&&!o,"rounded-s-none rounded-e-lg":t!=="full","rounded-s-none rounded-e-full":t==="full","rounded-e-sm":s==="sm","rounded-e-md":s==="md","rounded-e-lg":s==="lg"},n),...u,ref:i})});C.displayName="InputComponent";const T=({disabled:n,value:t,options:o,onChange:r,size:s="md",rounded:l="default",error:i,touched:p})=>{const u=d.useRef(null),[E,j]=d.useState(""),[v,g]=d.useState(!1);return e.jsxRuntimeExports.jsxs(x.Popover,{open:v,modal:!0,onOpenChange:a=>{g(a),a&&j("")},children:[e.jsxRuntimeExports.jsx(x.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 file:paragraph-sm md:paragraph-sm paragraph-md flex w-fit min-w-0 items-center justify-center border border-r-0 bg-transparent transition-[color,box-shadow] outline-none file:inline-flex file:border-0 file:bg-transparent file:font-semibold focus-visible:z-1 focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",l==="default"?"rounded-e-none":"rounded-s-full rounded-e-none",{"outline-destructive":i&&p,"outline-blue-800":p&&!i,"label-md h-8 rounded-s-sm px-2 py-1":s==="sm","label-lg h-12 rounded-s-md px-3 py-1":s==="md","label-xl h-16 rounded-s-lg px-4 py-2":s==="lg"}),disabled:n,children:[e.jsxRuntimeExports.jsx(f,{country:t,countryName:t,disabled:n}),e.jsxRuntimeExports.jsx(h.IconComponent,{iconName:"IconChevronDown",className:e.cn("-mr-2 size-4 opacity-50",n?"hidden":"opacity-100")})]})}),e.jsxRuntimeExports.jsx(x.PopoverContent,{className:"w-[300px] p-0",children:e.jsxRuntimeExports.jsxs(c.Command,{children:[e.jsxRuntimeExports.jsx(c.CommandInput,{value:E,onValueChange:a=>{j(a),setTimeout(()=>{if(u.current){const m=u.current.querySelector("[data-radix-scroll-area-viewport]");m&&(m.scrollTop=0)}},0)},placeholder:"Search country..."}),e.jsxRuntimeExports.jsx(c.CommandList,{children:e.jsxRuntimeExports.jsxs(S.ScrollArea,{ref:u,className:"h-72",children:[e.jsxRuntimeExports.jsx(c.CommandEmpty,{children:"No country found."}),e.jsxRuntimeExports.jsx(c.CommandGroup,{children:o.map(({value:a,label:m})=>a?e.jsxRuntimeExports.jsx(k,{country:a,countryName:m,selectedCountry:t,onChange:r,onSelectComplete:()=>g(!1)},a):null)})]})})]})})]})},k=({country:n,countryName:t,selectedCountry:o,onChange:r,onSelectComplete:s})=>{const l=()=>{r(n),s()};return e.jsxRuntimeExports.jsxs(c.CommandItem,{className:"gap-2",onSelect:l,children:[e.jsxRuntimeExports.jsx(f,{country:n,countryName:t}),e.jsxRuntimeExports.jsx("span",{className:"paragraph-sm flex-1",children:t}),e.jsxRuntimeExports.jsx("span",{className:"text-foreground/50 paragraph-sm",children:`+${R.getCountryCallingCode(n)}`}),e.jsxRuntimeExports.jsx(h.IconComponent,{iconName:"IconCheck",className:`ml-auto size-4 ${n===o?"opacity-100":"opacity-0"}`})]})},f=({country:n,countryName:t,disabled:o})=>{const r=P[n];return e.jsxRuntimeExports.jsx("span",{className:e.cn("bg-foreground/20 flex h-4 w-6 overflow-hidden rounded-[4px] [&_svg:not([class*='size-'])]:size-full",{"opacity-50":o}),children:r&&e.jsxRuntimeExports.jsx(r,{title:t})})};exports.PhoneInput=y;