@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,253 @@
|
|
|
1
|
+
import { j as e } from "../jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import * as g from "react-phone-number-input";
|
|
4
|
+
import I from "react-phone-number-input/flags";
|
|
5
|
+
import S from "react-phone-number-input/locale/en";
|
|
6
|
+
import b from "react-phone-number-input/locale/es";
|
|
7
|
+
import v from "react-phone-number-input/locale/fr";
|
|
8
|
+
import { B as P } from "../button-DddHyyHa.js";
|
|
9
|
+
import { C as w, d as R, f as z, b as O, c as $, e as E } from "../command-BGCSJ9vX.js";
|
|
10
|
+
import { I as F } from "../input-DwPDvbRE.js";
|
|
11
|
+
import { L } from "../label-BpDUqtrC.js";
|
|
12
|
+
import { P as V, c as A, b as B } from "../popover-BoDRCUh2.js";
|
|
13
|
+
import { S as T } from "../scroll-area-CNsThIs_.js";
|
|
14
|
+
import { c as u } from "../index-CRiPKpXj.js";
|
|
15
|
+
import { I as N } from "../icon-component-BZ-4FDV6.js";
|
|
16
|
+
const _ = f.forwardRef(
|
|
17
|
+
({
|
|
18
|
+
className: n,
|
|
19
|
+
onChange: s,
|
|
20
|
+
value: r,
|
|
21
|
+
variant: t = "md",
|
|
22
|
+
rounded: o = "default",
|
|
23
|
+
label: m,
|
|
24
|
+
helperText: c,
|
|
25
|
+
locale: p = "en",
|
|
26
|
+
error: l,
|
|
27
|
+
touched: i,
|
|
28
|
+
...a
|
|
29
|
+
}, j) => (console.log(t), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
30
|
+
m && /* @__PURE__ */ e.jsx(
|
|
31
|
+
L,
|
|
32
|
+
{
|
|
33
|
+
htmlFor: a.id,
|
|
34
|
+
className: u({
|
|
35
|
+
"text-neutral-700": a.disabled
|
|
36
|
+
}),
|
|
37
|
+
children: m
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
/* @__PURE__ */ e.jsx(
|
|
41
|
+
g.default,
|
|
42
|
+
{
|
|
43
|
+
ref: j,
|
|
44
|
+
className: u("flex", n),
|
|
45
|
+
flagComponent: C,
|
|
46
|
+
countrySelectComponent: k,
|
|
47
|
+
inputComponent: y,
|
|
48
|
+
smartCaret: !1,
|
|
49
|
+
labels: p === "es" ? b : p === "fr" ? v : S,
|
|
50
|
+
value: r || void 0,
|
|
51
|
+
onChange: (x) => s?.(x || ""),
|
|
52
|
+
countrySelectProps: {
|
|
53
|
+
variant: t,
|
|
54
|
+
rounded: o,
|
|
55
|
+
error: l,
|
|
56
|
+
touched: i
|
|
57
|
+
},
|
|
58
|
+
numberInputProps: {
|
|
59
|
+
variant: t,
|
|
60
|
+
rounded: o,
|
|
61
|
+
error: l,
|
|
62
|
+
touched: i
|
|
63
|
+
},
|
|
64
|
+
...a
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
l && i ? /* @__PURE__ */ e.jsx(
|
|
68
|
+
"span",
|
|
69
|
+
{
|
|
70
|
+
id: a.id && `${a.id}-error-text`,
|
|
71
|
+
"aria-invalid": !0,
|
|
72
|
+
className: "text-destructive text-label-md -mt-1",
|
|
73
|
+
children: l
|
|
74
|
+
}
|
|
75
|
+
) : c ? /* @__PURE__ */ e.jsx(
|
|
76
|
+
"span",
|
|
77
|
+
{
|
|
78
|
+
id: a.id && `${a.id}-helper-text`,
|
|
79
|
+
className: u("text-label-md -mt-1", {
|
|
80
|
+
"text-muted-foreground": !l && !i,
|
|
81
|
+
"text-destructive": l && i,
|
|
82
|
+
"text-neutral-700": a.disabled
|
|
83
|
+
}),
|
|
84
|
+
children: c
|
|
85
|
+
}
|
|
86
|
+
) : null
|
|
87
|
+
] }))
|
|
88
|
+
);
|
|
89
|
+
_.displayName = "PhoneInput";
|
|
90
|
+
const y = f.forwardRef(
|
|
91
|
+
({ className: n, rounded: s = "default", error: r, touched: t, variant: o, ...m }, c) => {
|
|
92
|
+
const { "data-country": p, ...l } = m;
|
|
93
|
+
return /* @__PURE__ */ e.jsx(
|
|
94
|
+
F,
|
|
95
|
+
{
|
|
96
|
+
variant: o,
|
|
97
|
+
className: u(
|
|
98
|
+
s === "default" ? "rounded-s-none rounded-e-lg" : "rounded-s-none rounded-e-full",
|
|
99
|
+
{
|
|
100
|
+
"border-destructive": r && t,
|
|
101
|
+
"border-blue-800": t && !r,
|
|
102
|
+
"rounded-e-sm": o === "sm",
|
|
103
|
+
"rounded-e-md": o === "md",
|
|
104
|
+
"rounded-e-lg": o === "lg"
|
|
105
|
+
},
|
|
106
|
+
n
|
|
107
|
+
),
|
|
108
|
+
...l,
|
|
109
|
+
ref: c
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
y.displayName = "InputComponent";
|
|
115
|
+
const k = ({
|
|
116
|
+
disabled: n,
|
|
117
|
+
value: s,
|
|
118
|
+
options: r,
|
|
119
|
+
onChange: t,
|
|
120
|
+
variant: o = "md",
|
|
121
|
+
rounded: m = "default",
|
|
122
|
+
error: c,
|
|
123
|
+
touched: p
|
|
124
|
+
}) => {
|
|
125
|
+
const l = f.useRef(null), [i, a] = f.useState(""), [j, x] = f.useState(!1);
|
|
126
|
+
return /* @__PURE__ */ e.jsxs(
|
|
127
|
+
V,
|
|
128
|
+
{
|
|
129
|
+
open: j,
|
|
130
|
+
modal: !0,
|
|
131
|
+
onOpenChange: (d) => {
|
|
132
|
+
x(d), d && a("");
|
|
133
|
+
},
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ e.jsx(A, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
|
|
136
|
+
P,
|
|
137
|
+
{
|
|
138
|
+
type: "button",
|
|
139
|
+
variant: "outline",
|
|
140
|
+
className: u(
|
|
141
|
+
"outline-r-0 outline-input text-secondary flex gap-1 px-3 focus:z-10",
|
|
142
|
+
m === "default" ? "rounded-e-none" : "rounded-s-full rounded-e-none",
|
|
143
|
+
{
|
|
144
|
+
"outline-destructive": c && p,
|
|
145
|
+
"outline-blue-800": p && !c,
|
|
146
|
+
"h-8 rounded-s-sm": o === "sm",
|
|
147
|
+
"h-12 rounded-s-md": o === "md",
|
|
148
|
+
"h-16 rounded-s-lg": o === "lg"
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
disabled: n,
|
|
152
|
+
children: [
|
|
153
|
+
/* @__PURE__ */ e.jsx(
|
|
154
|
+
C,
|
|
155
|
+
{
|
|
156
|
+
country: s,
|
|
157
|
+
countryName: s,
|
|
158
|
+
disabled: n
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
/* @__PURE__ */ e.jsx(
|
|
162
|
+
N,
|
|
163
|
+
{
|
|
164
|
+
iconName: "IconChevronDown",
|
|
165
|
+
className: u(
|
|
166
|
+
"-mr-2 size-4 opacity-50",
|
|
167
|
+
n ? "hidden" : "opacity-100"
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
) }),
|
|
174
|
+
/* @__PURE__ */ e.jsx(B, { className: "w-[300px] p-0", children: /* @__PURE__ */ e.jsxs(w, { children: [
|
|
175
|
+
/* @__PURE__ */ e.jsx(
|
|
176
|
+
R,
|
|
177
|
+
{
|
|
178
|
+
value: i,
|
|
179
|
+
onValueChange: (d) => {
|
|
180
|
+
a(d), setTimeout(() => {
|
|
181
|
+
if (l.current) {
|
|
182
|
+
const h = l.current.querySelector(
|
|
183
|
+
"[data-radix-scroll-area-viewport]"
|
|
184
|
+
);
|
|
185
|
+
h && (h.scrollTop = 0);
|
|
186
|
+
}
|
|
187
|
+
}, 0);
|
|
188
|
+
},
|
|
189
|
+
placeholder: "Search country..."
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
/* @__PURE__ */ e.jsx(z, { children: /* @__PURE__ */ e.jsxs(T, { ref: l, className: "h-72", children: [
|
|
193
|
+
/* @__PURE__ */ e.jsx(O, { children: "No country found." }),
|
|
194
|
+
/* @__PURE__ */ e.jsx($, { children: r.map(
|
|
195
|
+
({ value: d, label: h }) => d ? /* @__PURE__ */ e.jsx(
|
|
196
|
+
q,
|
|
197
|
+
{
|
|
198
|
+
country: d,
|
|
199
|
+
countryName: h,
|
|
200
|
+
selectedCountry: s,
|
|
201
|
+
onChange: t,
|
|
202
|
+
onSelectComplete: () => x(!1)
|
|
203
|
+
},
|
|
204
|
+
d
|
|
205
|
+
) : null
|
|
206
|
+
) })
|
|
207
|
+
] }) })
|
|
208
|
+
] }) })
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
}, q = ({
|
|
213
|
+
country: n,
|
|
214
|
+
countryName: s,
|
|
215
|
+
selectedCountry: r,
|
|
216
|
+
onChange: t,
|
|
217
|
+
onSelectComplete: o
|
|
218
|
+
}) => {
|
|
219
|
+
const m = () => {
|
|
220
|
+
t(n), o();
|
|
221
|
+
};
|
|
222
|
+
return /* @__PURE__ */ e.jsxs(E, { className: "gap-2", onSelect: m, children: [
|
|
223
|
+
/* @__PURE__ */ e.jsx(C, { country: n, countryName: s }),
|
|
224
|
+
/* @__PURE__ */ e.jsx("span", { className: "flex-1 text-sm", children: s }),
|
|
225
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-foreground/50 text-sm", children: `+${g.getCountryCallingCode(n)}` }),
|
|
226
|
+
/* @__PURE__ */ e.jsx(
|
|
227
|
+
N,
|
|
228
|
+
{
|
|
229
|
+
iconName: "IconCheck",
|
|
230
|
+
className: `ml-auto size-4 ${n === r ? "opacity-100" : "opacity-0"}`
|
|
231
|
+
}
|
|
232
|
+
)
|
|
233
|
+
] });
|
|
234
|
+
}, C = ({
|
|
235
|
+
country: n,
|
|
236
|
+
countryName: s,
|
|
237
|
+
disabled: r
|
|
238
|
+
}) => {
|
|
239
|
+
const t = I[n];
|
|
240
|
+
return /* @__PURE__ */ e.jsx(
|
|
241
|
+
"span",
|
|
242
|
+
{
|
|
243
|
+
className: u(
|
|
244
|
+
"bg-foreground/20 flex h-4 w-6 overflow-hidden rounded-[4px] [&_svg:not([class*='size-'])]:size-full",
|
|
245
|
+
{ "opacity-50": r }
|
|
246
|
+
),
|
|
247
|
+
children: t && /* @__PURE__ */ e.jsx(t, { title: s })
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
};
|
|
251
|
+
export {
|
|
252
|
+
_ as PhoneInput
|
|
253
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../popover-B8wp2cHF.cjs");exports.Popover=o.Popover;exports.PopoverAnchor=o.PopoverAnchor;exports.PopoverContent=o.PopoverContent;exports.PopoverTrigger=o.PopoverTrigger;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../jsx-runtime-DUiatUiq.cjs"),i=require("@radix-ui/react-progress"),l=require("../index-DoxiiusW.cjs");function a(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const n=a(i);function u({className:e,value:t,...r}){return o.jsxRuntimeExports.jsx(n.Root,{"data-slot":"progress",className:l.cn("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...r,children:o.jsxRuntimeExports.jsx(n.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}exports.Progress=u;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Progress({ className, value, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Progress };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { j as r } from "../jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import * as s from "@radix-ui/react-progress";
|
|
3
|
+
import { c as l } from "../index-CRiPKpXj.js";
|
|
4
|
+
function n({
|
|
5
|
+
className: o,
|
|
6
|
+
value: t,
|
|
7
|
+
...a
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ r.jsx(
|
|
10
|
+
s.Root,
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "progress",
|
|
13
|
+
className: l(
|
|
14
|
+
"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
|
|
15
|
+
o
|
|
16
|
+
),
|
|
17
|
+
...a,
|
|
18
|
+
children: /* @__PURE__ */ r.jsx(
|
|
19
|
+
s.Indicator,
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "progress-indicator",
|
|
22
|
+
className: "bg-primary h-full w-full flex-1 transition-all",
|
|
23
|
+
style: { transform: `translateX(-${100 - (t || 0)}%)` }
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
n as Progress
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ze=require("../jsx-runtime-DUiatUiq.cjs"),f=require("react"),Je=require("../index-DoxiiusW.cjs"),bn=require("../icon-component-LY_vGYHZ.cjs");function Sn(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const Pn=Sn(f),Ee=f.createContext(null);Ee.displayName="PanelGroupContext";const k={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},$e=10,ne=f.useLayoutEffect,Oe=Pn.useId,wn=typeof Oe=="function"?Oe:()=>null;let En=0;function _e(e=null){const n=wn(),t=f.useRef(e||n||null);return t.current===null&&(t.current=""+En++),e??t.current}function Ye({children:e,className:n="",collapsedSize:t,collapsible:r,defaultSize:i,forwardedRef:o,id:l,maxSize:a,minSize:s,onCollapse:z,onExpand:w,onResize:p,order:u,style:v,tagName:h="div",...C}){const E=f.useContext(Ee);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:S,expandPanel:L,getPanelSize:D,getPanelStyle:N,groupId:q,isPanelCollapsed:I,reevaluatePanelConstraints:P,registerPanel:F,resizePanel:X,unregisterPanel:B}=E,G=_e(l),M=f.useRef({callbacks:{onCollapse:z,onExpand:w,onResize:p},constraints:{collapsedSize:t,collapsible:r,defaultSize:i,maxSize:a,minSize:s},id:G,idIsFromProps:l!==void 0,order:u});f.useRef({didLogMissingDefaultSizeWarning:!1}),ne(()=>{const{callbacks:_,constraints:$}=M.current,j={...$};M.current.id=G,M.current.idIsFromProps=l!==void 0,M.current.order=u,_.onCollapse=z,_.onExpand=w,_.onResize=p,$.collapsedSize=t,$.collapsible=r,$.defaultSize=i,$.maxSize=a,$.minSize=s,(j.collapsedSize!==$.collapsedSize||j.collapsible!==$.collapsible||j.maxSize!==$.maxSize||j.minSize!==$.minSize)&&P(M.current,j)}),ne(()=>{const _=M.current;return F(_),()=>{B(_)}},[u,G,F,B]),f.useImperativeHandle(o,()=>({collapse:()=>{S(M.current)},expand:_=>{L(M.current,_)},getId(){return G},getSize(){return D(M.current)},isCollapsed(){return I(M.current)},isExpanded(){return!I(M.current)},resize:_=>{X(M.current,_)}}),[S,L,D,I,G,X]);const Q=N(M.current,i);return f.createElement(h,{...C,children:e,className:n,id:G,style:{...Q,...v},[k.groupId]:q,[k.panel]:"",[k.panelCollapsible]:r||void 0,[k.panelId]:G,[k.panelSize]:parseFloat(""+Q.flexGrow).toFixed(1)})}const Ze=f.forwardRef((e,n)=>f.createElement(Ye,{...e,forwardedRef:n}));Ye.displayName="Panel";Ze.displayName="forwardRef(Panel)";let Ne=null,Se=-1,Y=null;function Cn(e,n){if(n){const t=(n&rn)!==0,r=(n&on)!==0,i=(n&ln)!==0,o=(n&an)!==0;if(t)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Rn(){Y!==null&&(document.head.removeChild(Y),Ne=null,Y=null,Se=-1)}function Ae(e,n){var t,r;const i=Cn(e,n);if(Ne!==i){if(Ne=i,Y===null&&(Y=document.createElement("style"),document.head.appendChild(Y)),Se>=0){var o;(o=Y.sheet)===null||o===void 0||o.removeRule(Se)}Se=(t=(r=Y.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&t!==void 0?t:-1}}function Qe(e){return e.type==="keydown"}function en(e){return e.type.startsWith("pointer")}function nn(e){return e.type.startsWith("mouse")}function Ce(e){if(en(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(nn(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function In(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Ln(e,n,t){return e.x<n.x+n.width&&e.x+e.width>n.x&&e.y<n.y+n.height&&e.y+e.height>n.y}function An(e,n){if(e===n)throw new Error("Cannot compare node with itself");const t={a:We(e),b:We(n)};let r;for(;t.a.at(-1)===t.b.at(-1);)e=t.a.pop(),n=t.b.pop(),r=e;x(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ve(Fe(t.a)),b:Ve(Fe(t.b))};if(i.a===i.b){const o=r.childNodes,l={a:t.a.at(-1),b:t.b.at(-1)};let a=o.length;for(;a--;){const s=o[a];if(s===l.a)return 1;if(s===l.b)return-1}}return Math.sign(i.a-i.b)}const kn=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Mn(e){var n;const t=getComputedStyle((n=tn(e))!==null&&n!==void 0?n:e).display;return t==="flex"||t==="inline-flex"}function Dn(e){const n=getComputedStyle(e);return!!(n.position==="fixed"||n.zIndex!=="auto"&&(n.position!=="static"||Mn(e))||+n.opacity<1||"transform"in n&&n.transform!=="none"||"webkitTransform"in n&&n.webkitTransform!=="none"||"mixBlendMode"in n&&n.mixBlendMode!=="normal"||"filter"in n&&n.filter!=="none"||"webkitFilter"in n&&n.webkitFilter!=="none"||"isolation"in n&&n.isolation==="isolate"||kn.test(n.willChange)||n.webkitOverflowScrolling==="touch")}function Fe(e){let n=e.length;for(;n--;){const t=e[n];if(x(t,"Missing node"),Dn(t))return t}return null}function Ve(e){return e&&Number(getComputedStyle(e).zIndex)||0}function We(e){const n=[];for(;e;)n.push(e),e=tn(e);return n}function tn(e){const{parentNode:n}=e;return n&&n instanceof ShadowRoot?n.host:n}const rn=1,on=2,ln=4,an=8,Hn=In()==="coarse";let W=[],ae=!1,Z=new Map,Re=new Map;const he=new Set;function Nn(e,n,t,r,i){var o;const{ownerDocument:l}=n,a={direction:t,element:n,hitAreaMargins:r,setResizeHandlerState:i},s=(o=Z.get(l))!==null&&o!==void 0?o:0;return Z.set(l,s+1),he.add(a),Pe(),function(){var w;Re.delete(e),he.delete(a);const p=(w=Z.get(l))!==null&&w!==void 0?w:1;if(Z.set(l,p-1),Pe(),p===1&&Z.delete(l),W.includes(a)){const u=W.indexOf(a);u>=0&&W.splice(u,1),je(),i("up",!0,null)}}}function $n(e){const{target:n}=e,{x:t,y:r}=Ce(e);ae=!0,Ge({target:n,x:t,y:r}),Pe(),W.length>0&&(we("down",e),e.preventDefault(),sn(n)||e.stopImmediatePropagation())}function ke(e){const{x:n,y:t}=Ce(e);if(ae&&e.buttons===0&&(ae=!1,we("up",e)),!ae){const{target:r}=e;Ge({target:r,x:n,y:t})}we("move",e),je(),W.length>0&&e.preventDefault()}function Me(e){const{target:n}=e,{x:t,y:r}=Ce(e);Re.clear(),ae=!1,W.length>0&&(e.preventDefault(),sn(n)||e.stopImmediatePropagation()),we("up",e),Ge({target:n,x:t,y:r}),je(),Pe()}function sn(e){let n=e;for(;n;){if(n.hasAttribute(k.resizeHandle))return!0;n=n.parentElement}return!1}function Ge({target:e,x:n,y:t}){W.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),he.forEach(i=>{const{element:o,hitAreaMargins:l}=i,a=o.getBoundingClientRect(),{bottom:s,left:z,right:w,top:p}=a,u=Hn?l.coarse:l.fine;if(n>=z-u&&n<=w+u&&t>=p-u&&t<=s+u){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&An(r,o)>0){let h=r,C=!1;for(;h&&!h.contains(o);){if(Ln(h.getBoundingClientRect(),a)){C=!0;break}h=h.parentElement}if(C)return}W.push(i)}})}function De(e,n){Re.set(e,n)}function je(){let e=!1,n=!1;W.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:n=!0});let t=0;Re.forEach(r=>{t|=r}),e&&n?Ae("intersection",t):e?Ae("horizontal",t):n?Ae("vertical",t):Rn()}let He;function Pe(){var e;(e=He)===null||e===void 0||e.abort(),He=new AbortController;const n={capture:!0,signal:He.signal};he.size&&(ae?(W.length>0&&Z.forEach((t,r)=>{const{body:i}=r;t>0&&(i.addEventListener("contextmenu",Me,n),i.addEventListener("pointerleave",ke,n),i.addEventListener("pointermove",ke,n))}),Z.forEach((t,r)=>{const{body:i}=r;i.addEventListener("pointerup",Me,n),i.addEventListener("pointercancel",Me,n)})):Z.forEach((t,r)=>{const{body:i}=r;t>0&&(i.addEventListener("pointerdown",$n,n),i.addEventListener("pointermove",ke,n))}))}function we(e,n){he.forEach(t=>{const{setResizeHandlerState:r}=t,i=W.includes(t);r(e,i,n)})}function _n(){const[e,n]=f.useState(0);return f.useCallback(()=>n(t=>t+1),[])}function x(e,n){if(!e)throw console.error(n),Error(n)}function te(e,n,t=$e){return e.toFixed(t)===n.toFixed(t)?0:e>n?1:-1}function J(e,n,t=$e){return te(e,n,t)===0}function O(e,n,t){return te(e,n,t)===0}function Gn(e,n,t){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++){const i=e[r],o=n[r];if(!O(i,o,t))return!1}return!0}function le({panelConstraints:e,panelIndex:n,size:t}){const r=e[n];x(r!=null,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:o,maxSize:l=100,minSize:a=0}=r;if(te(t,a)<0)if(o){const s=(i+a)/2;te(t,s)<0?t=i:t=a}else t=a;return t=Math.min(l,t),t=parseFloat(t.toFixed($e)),t}function ge({delta:e,initialLayout:n,panelConstraints:t,pivotIndices:r,prevLayout:i,trigger:o}){if(O(e,0))return n;const l=[...n],[a,s]=r;x(a!=null,"Invalid first pivot index"),x(s!=null,"Invalid second pivot index");let z=0;if(o==="keyboard"){{const p=e<0?s:a,u=t[p];x(u,`Panel constraints not found for index ${p}`);const{collapsedSize:v=0,collapsible:h,minSize:C=0}=u;if(h){const E=n[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),O(E,v)){const S=C-E;te(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}{const p=e<0?a:s,u=t[p];x(u,`No panel constraints found for index ${p}`);const{collapsedSize:v=0,collapsible:h,minSize:C=0}=u;if(h){const E=n[p];if(x(E!=null,`Previous layout not found for panel index ${p}`),O(E,C)){const S=E-v;te(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}}{const p=e<0?1:-1;let u=e<0?s:a,v=0;for(;;){const C=n[u];x(C!=null,`Previous layout not found for panel index ${u}`);const S=le({panelConstraints:t,panelIndex:u,size:100})-C;if(v+=S,u+=p,u<0||u>=t.length)break}const h=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-h:h}{let u=e<0?a:s;for(;u>=0&&u<t.length;){const v=Math.abs(e)-Math.abs(z),h=n[u];x(h!=null,`Previous layout not found for panel index ${u}`);const C=h-v,E=le({panelConstraints:t,panelIndex:u,size:C});if(!O(h,E)&&(z+=h-E,l[u]=E,z.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?u--:u++}}if(Gn(i,l))return i;{const p=e<0?s:a,u=n[p];x(u!=null,`Previous layout not found for panel index ${p}`);const v=u+z,h=le({panelConstraints:t,panelIndex:p,size:v});if(l[p]=h,!O(h,v)){let C=v-h,S=e<0?s:a;for(;S>=0&&S<t.length;){const L=l[S];x(L!=null,`Previous layout not found for panel index ${S}`);const D=L+C,N=le({panelConstraints:t,panelIndex:S,size:D});if(O(L,N)||(C-=N-L,l[S]=N),O(C,0))break;e>0?S--:S++}}}const w=l.reduce((p,u)=>u+p,0);return O(w,100)?l:i}function jn({layout:e,panelsArray:n,pivotIndices:t}){let r=0,i=100,o=0,l=0;const a=t[0];x(a!=null,"No pivot index found"),n.forEach((p,u)=>{const{constraints:v}=p,{maxSize:h=100,minSize:C=0}=v;u===a?(r=C,i=h):(o+=C,l+=h)});const s=Math.min(i,100-o),z=Math.max(r,100-l),w=e[a];return{valueMax:s,valueMin:z,valueNow:w}}function ye(e,n=document){return Array.from(n.querySelectorAll(`[${k.resizeHandleId}][data-panel-group-id="${e}"]`))}function un(e,n,t=document){const i=ye(e,t).findIndex(o=>o.getAttribute(k.resizeHandleId)===n);return i??null}function cn(e,n,t){const r=un(e,n,t);return r!=null?[r,r+1]:[-1,-1]}function Tn(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function fn(e,n=document){if(Tn(n)&&n.dataset.panelGroupId==e)return n;const t=n.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function Ie(e,n=document){const t=n.querySelector(`[${k.resizeHandleId}="${e}"]`);return t||null}function Bn(e,n,t,r=document){var i,o,l,a;const s=Ie(n,r),z=ye(e,r),w=s?z.indexOf(s):-1,p=(i=(o=t[w])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,u=(l=(a=t[w+1])===null||a===void 0?void 0:a.id)!==null&&l!==void 0?l:null;return[p,u]}function On({committedValuesRef:e,eagerValuesRef:n,groupId:t,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:l}){f.useRef({didWarnAboutMissingResizeHandle:!1}),ne(()=>{if(!o)return;const a=ye(t,o);for(let s=0;s<i.length-1;s++){const{valueMax:z,valueMin:w,valueNow:p}=jn({layout:r,panelsArray:i,pivotIndices:[s,s+1]}),u=a[s];if(u!=null){const v=i[s];x(v,`No panel data found for index "${s}"`),u.setAttribute("aria-controls",v.id),u.setAttribute("aria-valuemax",""+Math.round(z)),u.setAttribute("aria-valuemin",""+Math.round(w)),u.setAttribute("aria-valuenow",p!=null?""+Math.round(p):"")}}return()=>{a.forEach((s,z)=>{s.removeAttribute("aria-controls"),s.removeAttribute("aria-valuemax"),s.removeAttribute("aria-valuemin"),s.removeAttribute("aria-valuenow")})}},[t,r,i,o]),f.useEffect(()=>{if(!o)return;const a=n.current;x(a,"Eager values not found");const{panelDataArray:s}=a,z=fn(t,o);x(z!=null,`No group found for id "${t}"`);const w=ye(t,o);x(w,`No resize handles found for group id "${t}"`);const p=w.map(u=>{const v=u.getAttribute(k.resizeHandleId);x(v,"Resize handle element has no handle id attribute");const[h,C]=Bn(t,v,s,o);if(h==null||C==null)return()=>{};const E=S=>{if(!S.defaultPrevented)switch(S.key){case"Enter":{S.preventDefault();const L=s.findIndex(D=>D.id===h);if(L>=0){const D=s[L];x(D,`No panel data found for index ${L}`);const N=r[L],{collapsedSize:q=0,collapsible:I,minSize:P=0}=D.constraints;if(N!=null&&I){const F=ge({delta:O(N,q)?P-q:q-N,initialLayout:r,panelConstraints:s.map(X=>X.constraints),pivotIndices:cn(t,v,o),prevLayout:r,trigger:"keyboard"});r!==F&&l(F)}}break}}};return u.addEventListener("keydown",E),()=>{u.removeEventListener("keydown",E)}});return()=>{p.forEach(u=>u())}},[o,e,n,t,r,i,l])}function qe(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function dn(e,n){const t=e==="horizontal",{x:r,y:i}=Ce(n);return t?r:i}function Fn(e,n,t,r,i){const o=t==="horizontal",l=Ie(n,i);x(l,`No resize handle element found for id "${n}"`);const a=l.getAttribute(k.groupId);x(a,"Resize handle element has no group id attribute");let{initialCursorPosition:s}=r;const z=dn(t,e),w=fn(a,i);x(w,`No group element found for id "${a}"`);const p=w.getBoundingClientRect(),u=o?p.width:p.height;return(z-s)/u*100}function Vn(e,n,t,r,i,o){if(Qe(e)){const l=t==="horizontal";let a=0;e.shiftKey?a=100:i!=null?a=i:a=10;let s=0;switch(e.key){case"ArrowDown":s=l?0:a;break;case"ArrowLeft":s=l?-a:0;break;case"ArrowRight":s=l?a:0;break;case"ArrowUp":s=l?0:-a;break;case"End":s=100;break;case"Home":s=-100;break}return s}else return r==null?0:Fn(e,n,t,r,o)}function Wn({panelDataArray:e}){const n=Array(e.length),t=e.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<e.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;a!=null&&(r++,n[o]=a,i-=a)}for(let o=0;o<e.length;o++){const l=t[o];x(l,`Panel constraints not found for index ${o}`);const{defaultSize:a}=l;if(a!=null)continue;const s=e.length-r,z=i/s;r++,n[o]=z,i-=z}return n}function oe(e,n,t){n.forEach((r,i)=>{const o=e[i];x(o,`Panel data not found for index ${i}`);const{callbacks:l,constraints:a,id:s}=o,{collapsedSize:z=0,collapsible:w}=a,p=t[s];if(p==null||r!==p){t[s]=r;const{onCollapse:u,onExpand:v,onResize:h}=l;h&&h(r,p),w&&(u||v)&&(v&&(p==null||J(p,z))&&!J(r,z)&&v(),u&&(p==null||!J(p,z))&&J(r,z)&&u())}})}function be(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!=n[t])return!1;return!0}function qn({defaultSize:e,dragState:n,layout:t,panelData:r,panelIndex:i,precision:o=3}){const l=t[i];let a;return l==null?a=e!=null?e.toPrecision(o):"1":r.length===1?a="1":a=l.toPrecision(o),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:n!==null?"none":void 0}}function Kn(e,n=10){let t=null;return(...i)=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{e(...i)},n)}}function Ke(e){try{if(typeof localStorage<"u")e.getItem=n=>localStorage.getItem(n),e.setItem=(n,t)=>{localStorage.setItem(n,t)};else throw new Error("localStorage not supported in this environment")}catch(n){console.error(n),e.getItem=()=>null,e.setItem=()=>{}}}function pn(e){return`react-resizable-panels:${e}`}function gn(e){return e.map(n=>{const{constraints:t,id:r,idIsFromProps:i,order:o}=n;return i?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((n,t)=>n.localeCompare(t)).join(",")}function mn(e,n){try{const t=pn(e),r=n.getItem(t);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Un(e,n,t){var r,i;const o=(r=mn(e,t))!==null&&r!==void 0?r:{},l=gn(n);return(i=o[l])!==null&&i!==void 0?i:null}function Xn(e,n,t,r,i){var o;const l=pn(e),a=gn(n),s=(o=mn(e,i))!==null&&o!==void 0?o:{};s[a]={expandToSizes:Object.fromEntries(t.entries()),layout:r};try{i.setItem(l,JSON.stringify(s))}catch(z){console.error(z)}}function Ue({layout:e,panelConstraints:n}){const t=[...e],r=t.reduce((o,l)=>o+l,0);if(t.length!==n.length)throw Error(`Invalid ${n.length} panel layout: ${t.map(o=>`${o}%`).join(", ")}`);if(!O(r,100)&&t.length>0)for(let o=0;o<n.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=100/r*l;t[o]=a}let i=0;for(let o=0;o<n.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=le({panelConstraints:n,panelIndex:o,size:l});l!=a&&(i+=l-a,t[o]=a)}if(!O(i,0))for(let o=0;o<n.length;o++){const l=t[o];x(l!=null,`No layout data found for index ${o}`);const a=l+i,s=le({panelConstraints:n,panelIndex:o,size:a});if(l!==s&&(i-=s-l,t[o]=s,O(i,0)))break}return t}const Jn=100,me={getItem:e=>(Ke(me),me.getItem(e)),setItem:(e,n)=>{Ke(me),me.setItem(e,n)}},Xe={};function zn({autoSaveId:e=null,children:n,className:t="",direction:r,forwardedRef:i,id:o=null,onLayout:l=null,keyboardResizeBy:a=null,storage:s=me,style:z,tagName:w="div",...p}){const u=_e(o),v=f.useRef(null),[h,C]=f.useState(null),[E,S]=f.useState([]),L=_n(),D=f.useRef({}),N=f.useRef(new Map),q=f.useRef(0),I=f.useRef({autoSaveId:e,direction:r,dragState:h,id:u,keyboardResizeBy:a,onLayout:l,storage:s}),P=f.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});f.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),f.useImperativeHandle(i,()=>({getId:()=>I.current.id,getLayout:()=>{const{layout:c}=P.current;return c},setLayout:c=>{const{onLayout:m}=I.current,{layout:b,panelDataArray:g}=P.current,d=Ue({layout:c,panelConstraints:g.map(y=>y.constraints)});qe(b,d)||(S(d),P.current.layout=d,m&&m(d),oe(g,d,D.current))}}),[]),ne(()=>{I.current.autoSaveId=e,I.current.direction=r,I.current.dragState=h,I.current.id=u,I.current.onLayout=l,I.current.storage=s}),On({committedValuesRef:I,eagerValuesRef:P,groupId:u,layout:E,panelDataArray:P.current.panelDataArray,setLayout:S,panelGroupElement:v.current}),f.useEffect(()=>{const{panelDataArray:c}=P.current;if(e){if(E.length===0||E.length!==c.length)return;let m=Xe[e];m==null&&(m=Kn(Xn,Jn),Xe[e]=m);const b=[...c],g=new Map(N.current);m(e,b,g,E,s)}},[e,E,s]),f.useEffect(()=>{});const F=f.useCallback(c=>{const{onLayout:m}=I.current,{layout:b,panelDataArray:g}=P.current;if(c.constraints.collapsible){const d=g.map(K=>K.constraints),{collapsedSize:y=0,panelSize:R,pivotIndices:H}=ee(g,c,b);if(x(R!=null,`Panel size not found for panel "${c.id}"`),!J(R,y)){N.current.set(c.id,R);const U=ie(g,c)===g.length-1?R-y:y-R,A=ge({delta:U,initialLayout:b,panelConstraints:d,pivotIndices:H,prevLayout:b,trigger:"imperative-api"});be(b,A)||(S(A),P.current.layout=A,m&&m(A),oe(g,A,D.current))}}},[]),X=f.useCallback((c,m)=>{const{onLayout:b}=I.current,{layout:g,panelDataArray:d}=P.current;if(c.constraints.collapsible){const y=d.map(V=>V.constraints),{collapsedSize:R=0,panelSize:H=0,minSize:K=0,pivotIndices:U}=ee(d,c,g),A=m??K;if(J(H,R)){const V=N.current.get(c.id),de=V!=null&&V>=A?V:A,Le=ie(d,c)===d.length-1?H-de:de-H,T=ge({delta:Le,initialLayout:g,panelConstraints:y,pivotIndices:U,prevLayout:g,trigger:"imperative-api"});be(g,T)||(S(T),P.current.layout=T,b&&b(T),oe(d,T,D.current))}}},[]),B=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{panelSize:g}=ee(b,c,m);return x(g!=null,`Panel size not found for panel "${c.id}"`),g},[]),G=f.useCallback((c,m)=>{const{panelDataArray:b}=P.current,g=ie(b,c);return qn({defaultSize:m,dragState:h,layout:E,panelData:b,panelIndex:g})},[h,E]),M=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=ee(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),d===!0&&J(y,g)},[]),Q=f.useCallback(c=>{const{layout:m,panelDataArray:b}=P.current,{collapsedSize:g=0,collapsible:d,panelSize:y}=ee(b,c,m);return x(y!=null,`Panel size not found for panel "${c.id}"`),!d||te(y,g)>0},[]),_=f.useCallback(c=>{const{panelDataArray:m}=P.current;m.push(c),m.sort((b,g)=>{const d=b.order,y=g.order;return d==null&&y==null?0:d==null?-1:y==null?1:d-y}),P.current.panelDataArrayChanged=!0,L()},[L]);ne(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:c,onLayout:m,storage:b}=I.current,{layout:g,panelDataArray:d}=P.current;let y=null;if(c){const H=Un(c,d,b);H&&(N.current=new Map(Object.entries(H.expandToSizes)),y=H.layout)}y==null&&(y=Wn({panelDataArray:d}));const R=Ue({layout:y,panelConstraints:d.map(H=>H.constraints)});qe(g,R)||(S(R),P.current.layout=R,m&&m(R),oe(d,R,D.current))}}),ne(()=>{const c=P.current;return()=>{c.layout=[]}},[]);const $=f.useCallback(c=>{let m=!1;const b=v.current;return b&&window.getComputedStyle(b,null).getPropertyValue("direction")==="rtl"&&(m=!0),function(d){d.preventDefault();const y=v.current;if(!y)return()=>null;const{direction:R,dragState:H,id:K,keyboardResizeBy:U,onLayout:A}=I.current,{layout:V,panelDataArray:de}=P.current,{initialLayout:ve}=H??{},Le=cn(K,c,y);let T=Vn(d,c,R,H,U,y);const Te=R==="horizontal";Te&&m&&(T=-T);const xn=de.map(vn=>vn.constraints),pe=ge({delta:T,initialLayout:ve??V,panelConstraints:xn,pivotIndices:Le,prevLayout:V,trigger:Qe(d)?"keyboard":"mouse-or-touch"}),Be=!be(V,pe);(en(d)||nn(d))&&q.current!=T&&(q.current=T,!Be&&T!==0?Te?De(c,T<0?rn:on):De(c,T<0?ln:an):De(c,0)),Be&&(S(pe),P.current.layout=pe,A&&A(pe),oe(de,pe,D.current))}},[]),j=f.useCallback((c,m)=>{const{onLayout:b}=I.current,{layout:g,panelDataArray:d}=P.current,y=d.map(V=>V.constraints),{panelSize:R,pivotIndices:H}=ee(d,c,g);x(R!=null,`Panel size not found for panel "${c.id}"`);const U=ie(d,c)===d.length-1?R-m:m-R,A=ge({delta:U,initialLayout:g,panelConstraints:y,pivotIndices:H,prevLayout:g,trigger:"imperative-api"});be(g,A)||(S(A),P.current.layout=A,b&&b(A),oe(d,A,D.current))},[]),se=f.useCallback((c,m)=>{const{layout:b,panelDataArray:g}=P.current,{collapsedSize:d=0,collapsible:y}=m,{collapsedSize:R=0,collapsible:H,maxSize:K=100,minSize:U=0}=c.constraints,{panelSize:A}=ee(g,c,b);A!=null&&(y&&H&&J(A,d)?J(d,R)||j(c,R):A<U?j(c,U):A>K&&j(c,K))},[j]),ue=f.useCallback((c,m)=>{const{direction:b}=I.current,{layout:g}=P.current;if(!v.current)return;const d=Ie(c,v.current);x(d,`Drag handle element not found for id "${c}"`);const y=dn(b,m);C({dragHandleId:c,dragHandleRect:d.getBoundingClientRect(),initialCursorPosition:y,initialLayout:g})},[]),ce=f.useCallback(()=>{C(null)},[]),xe=f.useCallback(c=>{const{panelDataArray:m}=P.current,b=ie(m,c);b>=0&&(m.splice(b,1),delete D.current[c.id],P.current.panelDataArrayChanged=!0,L())},[L]),re=f.useMemo(()=>({collapsePanel:F,direction:r,dragState:h,expandPanel:X,getPanelSize:B,getPanelStyle:G,groupId:u,isPanelCollapsed:M,isPanelExpanded:Q,reevaluatePanelConstraints:se,registerPanel:_,registerResizeHandle:$,resizePanel:j,startDragging:ue,stopDragging:ce,unregisterPanel:xe,panelGroupElement:v.current}),[F,h,r,X,B,G,u,M,Q,se,_,$,j,ue,ce,xe]),fe={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return f.createElement(Ee.Provider,{value:re},f.createElement(w,{...p,children:n,className:t,id:o,ref:v,style:{...fe,...z},[k.group]:"",[k.groupDirection]:r,[k.groupId]:u}))}const hn=f.forwardRef((e,n)=>f.createElement(zn,{...e,forwardedRef:n}));zn.displayName="PanelGroup";hn.displayName="forwardRef(PanelGroup)";function ie(e,n){return e.findIndex(t=>t===n||t.id===n.id)}function ee(e,n,t){const r=ie(e,n),o=r===e.length-1?[r-1,r]:[r,r+1],l=t[r];return{...n.constraints,panelSize:l,pivotIndices:o}}function Yn({disabled:e,handleId:n,resizeHandler:t,panelGroupElement:r}){f.useEffect(()=>{if(e||t==null||r==null)return;const i=Ie(n,r);if(i==null)return;const o=l=>{if(!l.defaultPrevented)switch(l.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{l.preventDefault(),t(l);break}case"F6":{l.preventDefault();const a=i.getAttribute(k.groupId);x(a,`No group element found for id "${a}"`);const s=ye(a,r),z=un(a,n,r);x(z!==null,`No resize element found for id "${n}"`);const w=l.shiftKey?z>0?z-1:s.length-1:z+1<s.length?z+1:0;s[w].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,e,n,t])}function yn({children:e=null,className:n="",disabled:t=!1,hitAreaMargins:r,id:i,onBlur:o,onClick:l,onDragging:a,onFocus:s,onPointerDown:z,onPointerUp:w,style:p={},tabIndex:u=0,tagName:v="div",...h}){var C,E;const S=f.useRef(null),L=f.useRef({onClick:l,onDragging:a,onPointerDown:z,onPointerUp:w});f.useEffect(()=>{L.current.onClick=l,L.current.onDragging=a,L.current.onPointerDown=z,L.current.onPointerUp=w});const D=f.useContext(Ee);if(D===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:N,groupId:q,registerResizeHandle:I,startDragging:P,stopDragging:F,panelGroupElement:X}=D,B=_e(i),[G,M]=f.useState("inactive"),[Q,_]=f.useState(!1),[$,j]=f.useState(null),se=f.useRef({state:G});ne(()=>{se.current.state=G}),f.useEffect(()=>{if(t)j(null);else{const re=I(B);j(()=>re)}},[t,B,I]);const ue=(C=r?.coarse)!==null&&C!==void 0?C:15,ce=(E=r?.fine)!==null&&E!==void 0?E:5;f.useEffect(()=>{if(t||$==null)return;const re=S.current;x(re,"Element ref not attached");let fe=!1;return Nn(B,re,N,{coarse:ue,fine:ce},(m,b,g)=>{if(!b){M("inactive");return}switch(m){case"down":{M("drag"),fe=!1,x(g,'Expected event to be defined for "down" action'),P(B,g);const{onDragging:d,onPointerDown:y}=L.current;d?.(!0),y?.();break}case"move":{const{state:d}=se.current;fe=!0,d!=="drag"&&M("hover"),x(g,'Expected event to be defined for "move" action'),$(g);break}case"up":{M("hover"),F();const{onClick:d,onDragging:y,onPointerUp:R}=L.current;y?.(!1),R?.(),fe||d?.();break}}})},[ue,N,t,ce,I,B,$,P,F]),Yn({disabled:t,handleId:B,resizeHandler:$,panelGroupElement:X});const xe={touchAction:"none",userSelect:"none"};return f.createElement(v,{...h,children:e,className:n,id:i,onBlur:()=>{_(!1),o?.()},onFocus:()=>{_(!0),s?.()},ref:S,role:"separator",style:{...xe,...p},tabIndex:u,[k.groupDirection]:N,[k.groupId]:q,[k.resizeHandle]:"",[k.resizeHandleActive]:G==="drag"?"pointer":Q?"keyboard":void 0,[k.resizeHandleEnabled]:!t,[k.resizeHandleId]:B,[k.resizeHandleState]:G})}yn.displayName="PanelResizeHandle";function Zn({className:e,...n}){return ze.jsxRuntimeExports.jsx(hn,{"data-slot":"resizable-panel-group",className:Je.cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...n})}function Qn({...e}){return ze.jsxRuntimeExports.jsx(Ze,{"data-slot":"resizable-panel",...e})}function et({withHandle:e,className:n,...t}){return ze.jsxRuntimeExports.jsx(yn,{"data-slot":"resizable-handle",className:Je.cn("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),...t,children:e&&ze.jsxRuntimeExports.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:ze.jsxRuntimeExports.jsx(bn.IconComponent,{iconName:"IconGripVertical",className:"size-2.5"})})})}exports.ResizableHandle=et;exports.ResizablePanel=Qn;exports.ResizablePanelGroup=Zn;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
3
|
+
declare function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ResizablePanel({ ...props }: React.ComponentProps<typeof ResizablePrimitive.Panel>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function ResizableHandle({ withHandle, className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
6
|
+
withHandle?: boolean;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
|