@clasing/ui 0.1.123 → 0.1.125
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/badge-BnerQ2lF.js +85 -0
- package/dist/badge-Czof3oqL.cjs +1 -0
- package/dist/button-Cegl49Yi.cjs +1 -0
- package/dist/button-DddHyyHa.js +504 -0
- package/dist/calendar-BAQkzm4v.js +117 -0
- package/dist/calendar-DL8gqdRp.cjs +1 -0
- package/dist/card-BCgtou88.cjs +1 -0
- package/dist/card-BfBXE5Kq.js +90 -0
- package/dist/chip-A32aAc-8.cjs +1 -0
- package/dist/chip-ZZHZ8i1Q.js +127 -0
- package/dist/command-BGCSJ9vX.js +506 -0
- package/dist/command-D9M8dk1M.cjs +1 -0
- package/dist/components/accordion.cjs.js +1 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.es.js +70 -0
- package/dist/components/alert-dialog.cjs.js +1 -0
- package/dist/components/alert-dialog.d.ts +14 -0
- package/dist/components/alert-dialog.es.js +146 -0
- package/dist/components/alert.cjs.js +1 -0
- package/dist/components/alert.d.ts +15 -0
- package/dist/components/alert.es.js +97 -0
- package/dist/components/avatar.cjs.js +1 -0
- package/dist/components/avatar.d.ts +6 -0
- package/dist/components/avatar.es.js +53 -0
- package/dist/components/badge.cjs.js +1 -0
- package/dist/components/badge.d.ts +18 -0
- package/dist/components/badge.es.js +4 -0
- package/dist/components/blocks/date-picker.cjs.js +1 -0
- package/dist/components/blocks/date-picker.d.ts +30 -0
- package/dist/components/blocks/date-picker.es.js +181 -0
- package/dist/components/blocks/date-range-picker.cjs.js +1 -0
- package/dist/components/blocks/date-range-picker.d.ts +29 -0
- package/dist/components/blocks/date-range-picker.es.js +238 -0
- package/dist/components/blocks/interactive-card.cjs.js +1 -0
- package/dist/components/blocks/interactive-card.d.ts +26 -0
- package/dist/components/blocks/interactive-card.es.js +138 -0
- package/dist/components/blocks/selectable-chips.cjs.js +1 -0
- package/dist/components/blocks/selectable-chips.d.ts +16 -0
- package/dist/components/blocks/selectable-chips.es.js +57 -0
- package/dist/components/breadcrumb.cjs.js +1 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.es.js +106 -0
- package/dist/components/button.cjs.js +1 -0
- package/dist/components/button.d.ts +39 -0
- package/dist/components/button.es.js +7 -0
- package/dist/components/calendar.cjs.js +1 -0
- package/dist/components/calendar.d.ts +15 -0
- package/dist/components/calendar.es.js +4 -0
- package/dist/components/card.cjs.js +1 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.es.js +10 -0
- package/dist/components/chart.cjs.js +7 -0
- package/dist/components/chart.d.ts +43 -0
- package/dist/components/chart.es.js +213 -0
- package/dist/components/checkbox.cjs.js +1 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.es.js +31 -0
- package/dist/components/chip.cjs.js +1 -0
- package/dist/components/chip.d.ts +25 -0
- package/dist/components/chip.es.js +5 -0
- package/dist/components/collapsible.cjs.js +1 -0
- package/dist/components/collapsible.d.ts +5 -0
- package/dist/components/collapsible.es.js +34 -0
- package/dist/components/command.cjs.js +1 -0
- package/dist/components/command.d.ts +18 -0
- package/dist/components/command.es.js +12 -0
- package/dist/components/context-menu.cjs.js +1 -0
- package/dist/components/context-menu.d.ts +25 -0
- package/dist/components/context-menu.es.js +229 -0
- package/dist/components/dialog.cjs.js +1 -0
- package/dist/components/dialog.d.ts +15 -0
- package/dist/components/dialog.es.js +13 -0
- package/dist/components/divider.cjs.js +1 -0
- package/dist/components/divider.d.ts +6 -0
- package/dist/components/divider.es.js +21 -0
- package/dist/components/drawer.cjs.js +3 -0
- package/dist/components/drawer.d.ts +13 -0
- package/dist/components/drawer.es.js +1161 -0
- package/dist/components/dropdown-menu.cjs.js +1 -0
- package/dist/components/dropdown-menu.d.ts +25 -0
- package/dist/components/dropdown-menu.es.js +237 -0
- package/dist/components/hover-card.cjs.js +1 -0
- package/dist/components/hover-card.d.ts +6 -0
- package/dist/components/hover-card.es.js +38 -0
- package/dist/components/icon-component.cjs.js +1 -0
- package/dist/components/icon-component.d.ts +12 -0
- package/dist/components/icon-component.es.js +4 -0
- package/dist/components/input-otp.cjs.js +20 -0
- package/dist/components/input-otp.d.ts +11 -0
- package/dist/components/input-otp.es.js +253 -0
- package/dist/components/input.cjs.js +1 -0
- package/dist/components/input.d.ts +32 -0
- package/dist/components/input.es.js +4 -0
- package/dist/components/label.cjs.js +1 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.es.js +4 -0
- package/dist/components/menubar.cjs.js +1 -0
- package/dist/components/menubar.d.ts +26 -0
- package/dist/components/menubar.es.js +257 -0
- package/dist/components/multi-select.cjs.js +1 -0
- package/dist/components/multi-select.d.ts +32 -0
- package/dist/components/multi-select.es.js +233 -0
- package/dist/components/navigation-menu.cjs.js +1 -0
- package/dist/components/navigation-menu.d.ts +14 -0
- package/dist/components/navigation-menu.es.js +171 -0
- package/dist/components/phone-input.cjs.js +1 -0
- package/dist/components/phone-input.d.ts +14 -0
- package/dist/components/phone-input.es.js +253 -0
- package/dist/components/popover.cjs.js +1 -0
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.es.js +7 -0
- package/dist/components/progress.cjs.js +1 -0
- package/dist/components/progress.d.ts +4 -0
- package/dist/components/progress.es.js +31 -0
- package/dist/components/resizable.cjs.js +1 -0
- package/dist/components/resizable.d.ts +8 -0
- package/dist/components/resizable.es.js +1551 -0
- package/dist/components/scroll-area.cjs.js +1 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.es.js +5 -0
- package/dist/components/select.cjs.js +1 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.es.js +179 -0
- package/dist/components/sheet.cjs.js +1 -0
- package/dist/components/sheet.d.ts +13 -0
- package/dist/components/sheet.es.js +126 -0
- package/dist/components/skeleton.cjs.js +1 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.es.js +15 -0
- package/dist/components/slider.cjs.js +1 -0
- package/dist/components/slider.d.ts +4 -0
- package/dist/components/slider.es.js +63 -0
- package/dist/components/sonner.cjs.js +1 -0
- package/dist/components/sonner.d.ts +3 -0
- package/dist/components/sonner.es.js +68 -0
- package/dist/components/switch.cjs.js +1 -0
- package/dist/components/switch.d.ts +11 -0
- package/dist/components/switch.es.js +82 -0
- package/dist/components/table.cjs.js +1 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.es.js +114 -0
- package/dist/components/toggle-group.cjs.js +1 -0
- package/dist/components/toggle-group.d.ts +7 -0
- package/dist/components/toggle-group.es.js +62 -0
- package/dist/components/toggle.cjs.js +1 -0
- package/dist/components/toggle.d.ts +9 -0
- package/dist/components/toggle.es.js +5 -0
- package/dist/components/tooltip.cjs.js +1 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.es.js +7 -0
- package/dist/dialog-BKm2PZl2.cjs +1 -0
- package/dist/dialog-DZpF7OXg.js +136 -0
- package/dist/entries/accordion.d.ts +2 -0
- package/dist/entries/alert-dialog.d.ts +2 -0
- package/dist/entries/alert.d.ts +2 -0
- package/dist/entries/avatar.d.ts +2 -0
- package/dist/entries/badge.d.ts +2 -0
- package/dist/entries/blocks/date-picker.d.ts +2 -0
- package/dist/entries/blocks/date-range-picker.d.ts +2 -0
- package/dist/entries/blocks/interactive-card.d.ts +2 -0
- package/dist/entries/blocks/selectable-chips.d.ts +2 -0
- package/dist/entries/breadcrumb.d.ts +2 -0
- package/dist/entries/button.d.ts +2 -0
- package/dist/entries/calendar.d.ts +2 -0
- package/dist/entries/card.d.ts +2 -0
- package/dist/entries/chart.d.ts +2 -0
- package/dist/entries/checkbox.d.ts +2 -0
- package/dist/entries/chip.d.ts +2 -0
- package/dist/entries/collapsible.d.ts +2 -0
- package/dist/entries/command.d.ts +2 -0
- package/dist/entries/context-menu.d.ts +2 -0
- package/dist/entries/dialog.d.ts +2 -0
- package/dist/entries/divider.d.ts +2 -0
- package/dist/entries/drawer.d.ts +2 -0
- package/dist/entries/dropdown-menu.d.ts +2 -0
- package/dist/entries/hooks/useOutsideClick.d.ts +2 -0
- package/dist/entries/hover-card.d.ts +2 -0
- package/dist/entries/icon-component.d.ts +2 -0
- package/dist/entries/input-otp.d.ts +2 -0
- package/dist/entries/input.d.ts +2 -0
- package/dist/entries/label.d.ts +2 -0
- package/dist/entries/menubar.d.ts +2 -0
- package/dist/entries/multi-select.d.ts +2 -0
- package/dist/entries/navigation-menu.d.ts +2 -0
- package/dist/entries/phone-input.d.ts +2 -0
- package/dist/entries/popover.d.ts +2 -0
- package/dist/entries/progress.d.ts +2 -0
- package/dist/entries/resizable.d.ts +2 -0
- package/dist/entries/scroll-area.d.ts +2 -0
- package/dist/entries/select.d.ts +2 -0
- package/dist/entries/sheet.d.ts +2 -0
- package/dist/entries/skeleton.d.ts +2 -0
- package/dist/entries/slider.d.ts +2 -0
- package/dist/entries/sonner.d.ts +2 -0
- package/dist/entries/switch.d.ts +2 -0
- package/dist/entries/table.d.ts +2 -0
- package/dist/entries/toggle-group.d.ts +2 -0
- package/dist/entries/toggle.d.ts +2 -0
- package/dist/entries/tooltip.d.ts +2 -0
- package/dist/entries/utils/types.d.ts +2 -0
- package/dist/hooks/useOutsideClick.cjs.js +1 -0
- package/dist/hooks/useOutsideClick.d.ts +6 -0
- package/dist/hooks/useOutsideClick.es.js +14 -0
- package/dist/icon-component-BZ-4FDV6.js +49 -0
- package/dist/icon-component-LY_vGYHZ.cjs +1 -0
- package/dist/index-BqtVL8d-.js +34 -0
- package/dist/index-C8P6Mn4U.cjs +1 -0
- package/dist/index-CRiPKpXj.js +2743 -0
- package/dist/index-DoxiiusW.cjs +1 -0
- package/dist/input-DFPJ_mtM.cjs +1 -0
- package/dist/input-DwPDvbRE.js +174 -0
- package/dist/jsx-runtime-C5mzlN2N.js +284 -0
- package/dist/jsx-runtime-DUiatUiq.cjs +22 -0
- package/dist/label-BpDUqtrC.js +22 -0
- package/dist/label-CbzkBbPT.cjs +1 -0
- package/dist/popover-B8wp2cHF.cjs +1 -0
- package/dist/popover-BoDRCUh2.js +44 -0
- package/dist/scroll-area-CNsThIs_.js +60 -0
- package/dist/scroll-area-Dr-7opp_.cjs +1 -0
- package/dist/style-BNIXVvBA.js +1172 -0
- package/dist/style-CA5976Oh.cjs +1 -0
- package/dist/tests/setup.d.ts +1 -0
- package/dist/toggle-Dgd7L2Mq.cjs +1 -0
- package/dist/toggle-DjbiWYXD.js +44 -0
- package/dist/tooltip-Btr9ROSo.js +55 -0
- package/dist/tooltip-W9iE1O--.cjs +1 -0
- package/dist/ui.css +427 -16
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/types/index.d.ts +36 -0
- package/dist/utils/types.cjs.js +1 -0
- package/dist/utils/types.es.js +1 -0
- package/package.json +301 -38
- package/dist/index.d.ts +0 -566
- package/dist/index.es.js +0 -7538
- package/dist/index.umd.js +0 -22
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { j as t } from "../jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import { B as I } from "../badge-BnerQ2lF.js";
|
|
3
|
+
import { C as k, f as z, d as O, b as R, c as A, e as _, g as W } from "../command-BGCSJ9vX.js";
|
|
4
|
+
import { P as F, b as G, c as B } from "../popover-BoDRCUh2.js";
|
|
5
|
+
import { c as S } from "../index-CRiPKpXj.js";
|
|
6
|
+
import { createContext as L, useState as j, useCallback as E, useEffect as b, useRef as v, useLayoutEffect as T, useContext as X } from "react";
|
|
7
|
+
import { I as C } from "../icon-component-BZ-4FDV6.js";
|
|
8
|
+
const V = L(null);
|
|
9
|
+
function Y({
|
|
10
|
+
children: e,
|
|
11
|
+
values: n,
|
|
12
|
+
defaultValues: s,
|
|
13
|
+
onValuesChange: i
|
|
14
|
+
}) {
|
|
15
|
+
const [x, d] = j(!1), [g, m] = j(
|
|
16
|
+
new Set(n ?? s)
|
|
17
|
+
), [w, p] = j(/* @__PURE__ */ new Map());
|
|
18
|
+
function y(c) {
|
|
19
|
+
const r = (l) => {
|
|
20
|
+
const a = new Set(l);
|
|
21
|
+
return a.has(c) ? a.delete(c) : a.add(c), a;
|
|
22
|
+
};
|
|
23
|
+
m(r), i?.([...r(g)]);
|
|
24
|
+
}
|
|
25
|
+
const f = E((c, r) => {
|
|
26
|
+
p((l) => l.get(c) === r ? l : new Map(l).set(c, r));
|
|
27
|
+
}, []);
|
|
28
|
+
return /* @__PURE__ */ t.jsx(
|
|
29
|
+
V,
|
|
30
|
+
{
|
|
31
|
+
value: {
|
|
32
|
+
open: x,
|
|
33
|
+
setOpen: d,
|
|
34
|
+
selectedValues: n ? new Set(n) : g,
|
|
35
|
+
toggleValue: y,
|
|
36
|
+
items: w,
|
|
37
|
+
onItemAdded: f
|
|
38
|
+
},
|
|
39
|
+
children: /* @__PURE__ */ t.jsx(F, { open: x, onOpenChange: d, children: e })
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function Z({
|
|
44
|
+
className: e,
|
|
45
|
+
children: n,
|
|
46
|
+
...s
|
|
47
|
+
}) {
|
|
48
|
+
const { open: i } = M();
|
|
49
|
+
return /* @__PURE__ */ t.jsx(B, { asChild: !0, children: /* @__PURE__ */ t.jsxs(
|
|
50
|
+
"button",
|
|
51
|
+
{
|
|
52
|
+
...s,
|
|
53
|
+
role: s.role ?? "combobox",
|
|
54
|
+
"aria-expanded": s["aria-expanded"] ?? i,
|
|
55
|
+
className: S(
|
|
56
|
+
"border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='text-'])]:text-muted-foreground flex h-auto min-h-9 w-fit items-center justify-between gap-2 overflow-hidden rounded-md border bg-transparent px-3 py-1.5 text-sm 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",
|
|
57
|
+
e
|
|
58
|
+
),
|
|
59
|
+
children: [
|
|
60
|
+
n,
|
|
61
|
+
/* @__PURE__ */ t.jsx(
|
|
62
|
+
C,
|
|
63
|
+
{
|
|
64
|
+
iconName: "IconSelector",
|
|
65
|
+
className: "size-4 shrink-0 opacity-50"
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
) });
|
|
71
|
+
}
|
|
72
|
+
function $({
|
|
73
|
+
placeholder: e,
|
|
74
|
+
clickToRemove: n = !0,
|
|
75
|
+
className: s,
|
|
76
|
+
overflowBehavior: i = "wrap-when-open",
|
|
77
|
+
...x
|
|
78
|
+
}) {
|
|
79
|
+
const { selectedValues: d, toggleValue: g, items: m, open: w } = M(), [p, y] = j(0), f = v(null), c = v(null), r = v(/* @__PURE__ */ new Set()), l = i === "wrap" || i === "wrap-when-open" && w;
|
|
80
|
+
b(() => {
|
|
81
|
+
l && r.current.forEach((o) => o.style.removeProperty("display"));
|
|
82
|
+
}, [l]);
|
|
83
|
+
const a = E(() => {
|
|
84
|
+
if (f.current == null) return;
|
|
85
|
+
const o = f.current, u = c.current;
|
|
86
|
+
u != null && (u.style.display = "none"), r.current.forEach((h) => h.style.removeProperty("display"));
|
|
87
|
+
let N = 0;
|
|
88
|
+
for (let h = r.current.size - 1; h >= 0; h--) {
|
|
89
|
+
const P = [...r.current][h];
|
|
90
|
+
if (o.scrollWidth <= o.clientWidth)
|
|
91
|
+
break;
|
|
92
|
+
N = r.current.size - h, P.style.display = "none", u?.style.removeProperty("display");
|
|
93
|
+
}
|
|
94
|
+
y(N);
|
|
95
|
+
}, []);
|
|
96
|
+
return b(() => {
|
|
97
|
+
if (f.current == null) return;
|
|
98
|
+
const o = new ResizeObserver(a);
|
|
99
|
+
return o.observe(f.current), () => o.disconnect();
|
|
100
|
+
}, [a]), T(() => {
|
|
101
|
+
a();
|
|
102
|
+
}, [d, a]), d.size === 0 && e ? /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground font-normal", children: e }) : /* @__PURE__ */ t.jsxs(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
...x,
|
|
106
|
+
ref: f,
|
|
107
|
+
className: S(
|
|
108
|
+
"flex w-full gap-1.5 overflow-hidden",
|
|
109
|
+
l && "h-full flex-wrap",
|
|
110
|
+
s
|
|
111
|
+
),
|
|
112
|
+
children: [
|
|
113
|
+
[...d].filter((o) => m.has(o)).map((o) => /* @__PURE__ */ t.jsxs(
|
|
114
|
+
I,
|
|
115
|
+
{
|
|
116
|
+
ref: (u) => {
|
|
117
|
+
if (u != null)
|
|
118
|
+
return r.current.add(u), () => {
|
|
119
|
+
r.current.delete(u);
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
variant: "outline",
|
|
123
|
+
className: "group flex items-center gap-1",
|
|
124
|
+
onClick: n ? (u) => {
|
|
125
|
+
u.stopPropagation(), g(o);
|
|
126
|
+
} : void 0,
|
|
127
|
+
children: [
|
|
128
|
+
m.get(o),
|
|
129
|
+
n && /* @__PURE__ */ t.jsx(
|
|
130
|
+
C,
|
|
131
|
+
{
|
|
132
|
+
iconName: "IconX",
|
|
133
|
+
className: "text-muted-foreground group-hover:text-destructive size-2"
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
o
|
|
139
|
+
)),
|
|
140
|
+
/* @__PURE__ */ t.jsxs(
|
|
141
|
+
I,
|
|
142
|
+
{
|
|
143
|
+
style: {
|
|
144
|
+
display: p > 0 && !l ? "block" : "none"
|
|
145
|
+
},
|
|
146
|
+
variant: "outline",
|
|
147
|
+
ref: c,
|
|
148
|
+
children: [
|
|
149
|
+
"+",
|
|
150
|
+
p
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
function ee({
|
|
159
|
+
search: e = !0,
|
|
160
|
+
children: n,
|
|
161
|
+
...s
|
|
162
|
+
}) {
|
|
163
|
+
const i = typeof e == "object" ? !0 : e;
|
|
164
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
165
|
+
/* @__PURE__ */ t.jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ t.jsx(k, { children: /* @__PURE__ */ t.jsx(z, { children: n }) }) }),
|
|
166
|
+
/* @__PURE__ */ t.jsx(G, { className: "min-w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ t.jsxs(k, { ...s, children: [
|
|
167
|
+
i ? /* @__PURE__ */ t.jsx(
|
|
168
|
+
O,
|
|
169
|
+
{
|
|
170
|
+
placeholder: typeof e == "object" ? e.placeholder : void 0
|
|
171
|
+
}
|
|
172
|
+
) : /* @__PURE__ */ t.jsx("button", { autoFocus: !0, "aria-hidden": "true", className: "sr-only" }),
|
|
173
|
+
/* @__PURE__ */ t.jsxs(z, { children: [
|
|
174
|
+
i && /* @__PURE__ */ t.jsx(R, { children: typeof e == "object" ? e.emptyMessage : void 0 }),
|
|
175
|
+
n
|
|
176
|
+
] })
|
|
177
|
+
] }) })
|
|
178
|
+
] });
|
|
179
|
+
}
|
|
180
|
+
function te({
|
|
181
|
+
value: e,
|
|
182
|
+
children: n,
|
|
183
|
+
badgeLabel: s,
|
|
184
|
+
onSelect: i,
|
|
185
|
+
...x
|
|
186
|
+
}) {
|
|
187
|
+
const { toggleValue: d, selectedValues: g, onItemAdded: m } = M(), w = g.has(e);
|
|
188
|
+
return b(() => {
|
|
189
|
+
m(e, s ?? n);
|
|
190
|
+
}, [e, n, m, s]), /* @__PURE__ */ t.jsxs(
|
|
191
|
+
_,
|
|
192
|
+
{
|
|
193
|
+
...x,
|
|
194
|
+
value: e,
|
|
195
|
+
onSelect: (p) => {
|
|
196
|
+
d(p), i?.(p);
|
|
197
|
+
},
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ t.jsx(
|
|
200
|
+
C,
|
|
201
|
+
{
|
|
202
|
+
iconName: "IconCheck",
|
|
203
|
+
className: S("mr-2 size-4", w ? "opacity-100" : "opacity-0")
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
n
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
function ne(e) {
|
|
212
|
+
return /* @__PURE__ */ t.jsx(A, { ...e });
|
|
213
|
+
}
|
|
214
|
+
function re(e) {
|
|
215
|
+
return /* @__PURE__ */ t.jsx(W, { ...e });
|
|
216
|
+
}
|
|
217
|
+
function M() {
|
|
218
|
+
const e = X(V);
|
|
219
|
+
if (e == null)
|
|
220
|
+
throw new Error(
|
|
221
|
+
"useMultiSelectContext must be used within a MultiSelectContext"
|
|
222
|
+
);
|
|
223
|
+
return e;
|
|
224
|
+
}
|
|
225
|
+
export {
|
|
226
|
+
Y as MultiSelect,
|
|
227
|
+
ee as MultiSelectContent,
|
|
228
|
+
ne as MultiSelectGroup,
|
|
229
|
+
te as MultiSelectItem,
|
|
230
|
+
re as MultiSelectSeparator,
|
|
231
|
+
Z as MultiSelectTrigger,
|
|
232
|
+
$ as MultiSelectValue
|
|
233
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../jsx-runtime-DUiatUiq.cjs"),d=require("@radix-ui/react-navigation-menu"),c=require("../index-C8P6Mn4U.cjs"),o=require("../index-DoxiiusW.cjs"),g=require("../icon-component-LY_vGYHZ.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 inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm 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 flex flex-col gap-1 rounded-sm p-2 text-sm 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;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function NavigationMenu({ className, children, viewport, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
4
|
+
viewport?: boolean;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function NavigationMenuList({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function NavigationMenuItem({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const navigationMenuTriggerStyle: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
9
|
+
declare function NavigationMenuTrigger({ className, children, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function NavigationMenuContent({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function NavigationMenuViewport({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function NavigationMenuLink({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function NavigationMenuIndicator({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerStyle, NavigationMenuViewport, };
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { j as e } from "../jsx-runtime-C5mzlN2N.js";
|
|
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-BZ-4FDV6.js";
|
|
6
|
+
function f({
|
|
7
|
+
className: t,
|
|
8
|
+
children: a,
|
|
9
|
+
viewport: i = !0,
|
|
10
|
+
...r
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ e.jsxs(
|
|
13
|
+
n.Root,
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "navigation-menu",
|
|
16
|
+
"data-viewport": i,
|
|
17
|
+
className: o(
|
|
18
|
+
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
19
|
+
t
|
|
20
|
+
),
|
|
21
|
+
...r,
|
|
22
|
+
children: [
|
|
23
|
+
a,
|
|
24
|
+
i && /* @__PURE__ */ e.jsx(l, {})
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function p({
|
|
30
|
+
className: t,
|
|
31
|
+
...a
|
|
32
|
+
}) {
|
|
33
|
+
return /* @__PURE__ */ e.jsx(
|
|
34
|
+
n.List,
|
|
35
|
+
{
|
|
36
|
+
"data-slot": "navigation-menu-list",
|
|
37
|
+
className: o(
|
|
38
|
+
"group flex flex-1 list-none items-center justify-center gap-1",
|
|
39
|
+
t
|
|
40
|
+
),
|
|
41
|
+
...a
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function x({
|
|
46
|
+
className: t,
|
|
47
|
+
...a
|
|
48
|
+
}) {
|
|
49
|
+
return /* @__PURE__ */ e.jsx(
|
|
50
|
+
n.Item,
|
|
51
|
+
{
|
|
52
|
+
"data-slot": "navigation-menu-item",
|
|
53
|
+
className: o("relative", t),
|
|
54
|
+
...a
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
const d = s(
|
|
59
|
+
"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 inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50"
|
|
60
|
+
);
|
|
61
|
+
function w({
|
|
62
|
+
className: t,
|
|
63
|
+
children: a,
|
|
64
|
+
...i
|
|
65
|
+
}) {
|
|
66
|
+
return /* @__PURE__ */ e.jsxs(
|
|
67
|
+
n.Trigger,
|
|
68
|
+
{
|
|
69
|
+
"data-slot": "navigation-menu-trigger",
|
|
70
|
+
className: o(d(), "group", t),
|
|
71
|
+
...i,
|
|
72
|
+
children: [
|
|
73
|
+
a,
|
|
74
|
+
" ",
|
|
75
|
+
/* @__PURE__ */ e.jsx(
|
|
76
|
+
u,
|
|
77
|
+
{
|
|
78
|
+
iconName: "IconChevronDown",
|
|
79
|
+
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
80
|
+
"aria-hidden": "true"
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
function b({
|
|
88
|
+
className: t,
|
|
89
|
+
...a
|
|
90
|
+
}) {
|
|
91
|
+
return /* @__PURE__ */ e.jsx(
|
|
92
|
+
n.Content,
|
|
93
|
+
{
|
|
94
|
+
"data-slot": "navigation-menu-content",
|
|
95
|
+
className: o(
|
|
96
|
+
"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",
|
|
97
|
+
"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",
|
|
98
|
+
t
|
|
99
|
+
),
|
|
100
|
+
...a
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function l({
|
|
105
|
+
className: t,
|
|
106
|
+
...a
|
|
107
|
+
}) {
|
|
108
|
+
return /* @__PURE__ */ e.jsx(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
className: o(
|
|
112
|
+
"absolute top-full left-0 isolate z-50 flex justify-center"
|
|
113
|
+
),
|
|
114
|
+
children: /* @__PURE__ */ e.jsx(
|
|
115
|
+
n.Viewport,
|
|
116
|
+
{
|
|
117
|
+
"data-slot": "navigation-menu-viewport",
|
|
118
|
+
className: o(
|
|
119
|
+
"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)]",
|
|
120
|
+
t
|
|
121
|
+
),
|
|
122
|
+
...a
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
function h({
|
|
129
|
+
className: t,
|
|
130
|
+
...a
|
|
131
|
+
}) {
|
|
132
|
+
return /* @__PURE__ */ e.jsx(
|
|
133
|
+
n.Link,
|
|
134
|
+
{
|
|
135
|
+
"data-slot": "navigation-menu-link",
|
|
136
|
+
className: o(
|
|
137
|
+
"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 flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
|
|
138
|
+
t
|
|
139
|
+
),
|
|
140
|
+
...a
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
function N({
|
|
145
|
+
className: t,
|
|
146
|
+
...a
|
|
147
|
+
}) {
|
|
148
|
+
return /* @__PURE__ */ e.jsx(
|
|
149
|
+
n.Indicator,
|
|
150
|
+
{
|
|
151
|
+
"data-slot": "navigation-menu-indicator",
|
|
152
|
+
className: o(
|
|
153
|
+
"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",
|
|
154
|
+
t
|
|
155
|
+
),
|
|
156
|
+
...a,
|
|
157
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" })
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
export {
|
|
162
|
+
f as NavigationMenu,
|
|
163
|
+
b as NavigationMenuContent,
|
|
164
|
+
N as NavigationMenuIndicator,
|
|
165
|
+
x as NavigationMenuItem,
|
|
166
|
+
h as NavigationMenuLink,
|
|
167
|
+
p as NavigationMenuList,
|
|
168
|
+
w as NavigationMenuTrigger,
|
|
169
|
+
l as NavigationMenuViewport,
|
|
170
|
+
d as navigationMenuTriggerStyle
|
|
171
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jsx-runtime-DUiatUiq.cjs"),q=require("react"),I=require("react-phone-number-input"),P=require("react-phone-number-input/flags"),v=require("react-phone-number-input/locale/en"),O=require("react-phone-number-input/locale/es"),w=require("react-phone-number-input/locale/fr"),_=require("../button-Cegl49Yi.cjs"),p=require("../command-D9M8dk1M.cjs"),z=require("../input-DFPJ_mtM.cjs"),T=require("../label-CbzkBbPT.cjs"),g=require("../popover-B8wp2cHF.cjs"),A=require("../scroll-area-Dr-7opp_.cjs"),d=require("../index-DoxiiusW.cjs"),C=require("../icon-component-LY_vGYHZ.cjs");function N(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const j=N(q),y=N(I),b=j.forwardRef(({className:t,onChange:n,value:o,variant:s="md",rounded:r="default",label:c,helperText:a,locale:x="en",error:u,touched:m,...l},R)=>(console.log(s),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-3",children:[c&&e.jsxRuntimeExports.jsx(T.Label,{htmlFor:l.id,className:d.cn({"text-neutral-700":l.disabled}),children:c}),e.jsxRuntimeExports.jsx(y.default,{ref:R,className:d.cn("flex",t),flagComponent:E,countrySelectComponent:D,inputComponent:S,smartCaret:!1,labels:x==="es"?O:x==="fr"?w:v,value:o||void 0,onChange:f=>n?.(f||""),countrySelectProps:{variant:s,rounded:r,error:u,touched:m},numberInputProps:{variant:s,rounded:r,error:u,touched:m},...l}),u&&m?e.jsxRuntimeExports.jsx("span",{id:l.id&&`${l.id}-error-text`,"aria-invalid":!0,className:"text-destructive text-label-md -mt-1",children:u}):a?e.jsxRuntimeExports.jsx("span",{id:l.id&&`${l.id}-helper-text`,className:d.cn("text-label-md -mt-1",{"text-muted-foreground":!u&&!m,"text-destructive":u&&m,"text-neutral-700":l.disabled}),children:a}):null]})));b.displayName="PhoneInput";const S=j.forwardRef(({className:t,rounded:n="default",error:o,touched:s,variant:r,...c},a)=>{const{"data-country":x,...u}=c;return e.jsxRuntimeExports.jsx(z.Input,{variant:r,className:d.cn(n==="default"?"rounded-s-none rounded-e-lg":"rounded-s-none rounded-e-full",{"border-destructive":o&&s,"border-blue-800":s&&!o,"rounded-e-sm":r==="sm","rounded-e-md":r==="md","rounded-e-lg":r==="lg"},t),...u,ref:a})});S.displayName="InputComponent";const D=({disabled:t,value:n,options:o,onChange:s,variant:r="md",rounded:c="default",error:a,touched:x})=>{const u=j.useRef(null),[m,l]=j.useState(""),[R,f]=j.useState(!1);return e.jsxRuntimeExports.jsxs(g.Popover,{open:R,modal:!0,onOpenChange:i=>{f(i),i&&l("")},children:[e.jsxRuntimeExports.jsx(g.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs(_.Button,{type:"button",variant:"outline",className:d.cn("outline-r-0 outline-input text-secondary flex gap-1 px-3 focus:z-10",c==="default"?"rounded-e-none":"rounded-s-full rounded-e-none",{"outline-destructive":a&&x,"outline-blue-800":x&&!a,"h-8 rounded-s-sm":r==="sm","h-12 rounded-s-md":r==="md","h-16 rounded-s-lg":r==="lg"}),disabled:t,children:[e.jsxRuntimeExports.jsx(E,{country:n,countryName:n,disabled:t}),e.jsxRuntimeExports.jsx(C.IconComponent,{iconName:"IconChevronDown",className:d.cn("-mr-2 size-4 opacity-50",t?"hidden":"opacity-100")})]})}),e.jsxRuntimeExports.jsx(g.PopoverContent,{className:"w-[300px] p-0",children:e.jsxRuntimeExports.jsxs(p.Command,{children:[e.jsxRuntimeExports.jsx(p.CommandInput,{value:m,onValueChange:i=>{l(i),setTimeout(()=>{if(u.current){const h=u.current.querySelector("[data-radix-scroll-area-viewport]");h&&(h.scrollTop=0)}},0)},placeholder:"Search country..."}),e.jsxRuntimeExports.jsx(p.CommandList,{children:e.jsxRuntimeExports.jsxs(A.ScrollArea,{ref:u,className:"h-72",children:[e.jsxRuntimeExports.jsx(p.CommandEmpty,{children:"No country found."}),e.jsxRuntimeExports.jsx(p.CommandGroup,{children:o.map(({value:i,label:h})=>i?e.jsxRuntimeExports.jsx(F,{country:i,countryName:h,selectedCountry:n,onChange:s,onSelectComplete:()=>f(!1)},i):null)})]})})]})})]})},F=({country:t,countryName:n,selectedCountry:o,onChange:s,onSelectComplete:r})=>{const c=()=>{s(t),r()};return e.jsxRuntimeExports.jsxs(p.CommandItem,{className:"gap-2",onSelect:c,children:[e.jsxRuntimeExports.jsx(E,{country:t,countryName:n}),e.jsxRuntimeExports.jsx("span",{className:"flex-1 text-sm",children:n}),e.jsxRuntimeExports.jsx("span",{className:"text-foreground/50 text-sm",children:`+${y.getCountryCallingCode(t)}`}),e.jsxRuntimeExports.jsx(C.IconComponent,{iconName:"IconCheck",className:`ml-auto size-4 ${t===o?"opacity-100":"opacity-0"}`})]})},E=({country:t,countryName:n,disabled:o})=>{const s=P[t];return e.jsxRuntimeExports.jsx("span",{className:d.cn("bg-foreground/20 flex h-4 w-6 overflow-hidden rounded-[4px] [&_svg:not([class*='size-'])]:size-full",{"opacity-50":o}),children:s&&e.jsxRuntimeExports.jsx(s,{title:n})})};exports.PhoneInput=b;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RPNInput from 'react-phone-number-input';
|
|
3
|
+
type PhoneInputProps = Omit<React.ComponentProps<'input'>, 'onChange' | 'value' | 'ref'> & Omit<RPNInput.Props<typeof RPNInput.default>, 'onChange'> & {
|
|
4
|
+
onChange?: (value: RPNInput.Value) => void;
|
|
5
|
+
variant?: 'sm' | 'md' | 'lg';
|
|
6
|
+
rounded?: 'default' | 'full';
|
|
7
|
+
label?: string;
|
|
8
|
+
helperText?: string;
|
|
9
|
+
locale?: 'en' | 'es' | 'fr';
|
|
10
|
+
error?: string;
|
|
11
|
+
touched?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const PhoneInput: React.ForwardRefExoticComponent<PhoneInputProps>;
|
|
14
|
+
export { PhoneInput };
|