@moondreamsdev/dreamer-ui 1.7.7-test.13 → 1.7.7-test.15
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/Toast-BnDLmjXs.cjs +2 -0
- package/dist/Toast-BnDLmjXs.cjs.map +1 -0
- package/dist/{Toast-cdFf2Gbf.js → Toast-Dux71f5k.js} +55 -53
- package/dist/Toast-Dux71f5k.js.map +1 -0
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +1255 -801
- package/dist/components.esm.js.map +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.esm.js +1 -1
- package/dist/src/components/accordion/AccordionItem.d.ts +0 -1
- package/dist/src/components/clickable/Clickable.d.ts +0 -1
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/components/radiogroup/RadioGroupItem.d.ts +0 -1
- package/dist/src/components/scroll-area/ScrollArea.d.ts +1 -1
- package/dist/src/components/scroll-area/hooks.d.ts +0 -1
- package/dist/src/components/select/Select.d.ts +22 -0
- package/dist/src/components/select/hooks.d.ts +35 -0
- package/dist/src/components/select/index.d.ts +2 -0
- package/dist/src/components/select/variants.d.ts +15 -0
- package/dist/src/components/tabs/TabsContent.d.ts +0 -1
- package/dist/src/components/tabs/TabsContext.d.ts +0 -1
- package/dist/src/components/tabs/TabsList.d.ts +0 -1
- package/dist/src/components/tabs/TabsTrigger.d.ts +0 -1
- package/dist/src/components/tooltip/hooks.d.ts +0 -1
- package/dist/src/hooks/useActionModal.d.ts +0 -1
- package/dist/src/hooks/useToast.d.ts +0 -1
- package/dist/src/symbols/index.d.ts +0 -1
- package/package.json +3 -3
- package/dist/Toast-BabLpwoU.cjs +0 -2
- package/dist/Toast-BabLpwoU.cjs.map +0 -1
- package/dist/Toast-cdFf2Gbf.js.map +0 -1
package/dist/components.esm.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { join as
|
|
4
|
-
import { d as
|
|
5
|
-
import { n as
|
|
6
|
-
import { A as
|
|
7
|
-
import { E as
|
|
8
|
-
import { createPortal as
|
|
9
|
-
function
|
|
10
|
-
id:
|
|
11
|
-
title:
|
|
1
|
+
import { jsxs as T, jsx as c, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import W, { useId as F, useState as k, createElement as be, useEffect as $, useCallback as C, useMemo as Q, useRef as V, isValidElement as we, cloneElement as xe } from "react";
|
|
3
|
+
import { join as x } from "./utils.esm.js";
|
|
4
|
+
import { d as he, C as ve, a as Ne, g as Ee, E as Te, Q as Ae, b as ke, e as Ie, f as Ce, c as $e } from "./QuestionMarkCircled-CY81euqP.js";
|
|
5
|
+
import { n as R, a as De, u as ae } from "./Toast-Dux71f5k.js";
|
|
6
|
+
import { A as Wt, T as Ut } from "./Toast-Dux71f5k.js";
|
|
7
|
+
import { E as ze, X as oe } from "./X-CIoyLewf.js";
|
|
8
|
+
import { createPortal as se } from "react-dom";
|
|
9
|
+
function ee({
|
|
10
|
+
id: r,
|
|
11
|
+
title: a,
|
|
12
12
|
content: t,
|
|
13
|
-
children:
|
|
13
|
+
children: n,
|
|
14
14
|
className: e = "",
|
|
15
|
-
disabled:
|
|
15
|
+
disabled: o = !1,
|
|
16
16
|
isOpen: s = !1,
|
|
17
17
|
onToggle: i,
|
|
18
18
|
triggerClassName: u = "",
|
|
19
19
|
bodyClassName: d = ""
|
|
20
20
|
}) {
|
|
21
|
-
const
|
|
22
|
-
!
|
|
23
|
-
},
|
|
24
|
-
(
|
|
21
|
+
const f = F(), l = r || `accordion-item-${f}`, b = `${l}-header`, m = `${l}-panel`, v = () => {
|
|
22
|
+
!o && i && i();
|
|
23
|
+
}, h = (p) => {
|
|
24
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), v());
|
|
25
25
|
};
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ T("div", { className: x("border-b border-gray-200", o && "opacity-60 cursor-not-allowed", e), children: [
|
|
27
|
+
/* @__PURE__ */ T(
|
|
28
28
|
"button",
|
|
29
29
|
{
|
|
30
|
-
id:
|
|
30
|
+
id: b,
|
|
31
31
|
type: "button",
|
|
32
|
-
className:
|
|
32
|
+
className: x(
|
|
33
33
|
"w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",
|
|
34
|
-
|
|
34
|
+
o ? "cursor-not-allowed" : "hover:bg-gray-50/10 cursor-pointer",
|
|
35
35
|
u
|
|
36
36
|
),
|
|
37
37
|
"aria-expanded": s,
|
|
38
|
-
"aria-controls":
|
|
39
|
-
disabled:
|
|
40
|
-
onClick:
|
|
41
|
-
onKeyDown:
|
|
38
|
+
"aria-controls": m,
|
|
39
|
+
disabled: o,
|
|
40
|
+
onClick: v,
|
|
41
|
+
onKeyDown: h,
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */ c("span", { children:
|
|
43
|
+
/* @__PURE__ */ c("span", { children: a }),
|
|
44
44
|
/* @__PURE__ */ c(
|
|
45
45
|
"span",
|
|
46
46
|
{
|
|
47
|
-
className:
|
|
47
|
+
className: x(
|
|
48
48
|
"transform transition-transform duration-300 ease-linear",
|
|
49
49
|
s ? "rotate-180" : "rotate-0"
|
|
50
50
|
),
|
|
51
51
|
"aria-hidden": "true",
|
|
52
|
-
children: /* @__PURE__ */ c(
|
|
52
|
+
children: /* @__PURE__ */ c(he, { size: 18 })
|
|
53
53
|
}
|
|
54
54
|
)
|
|
55
55
|
]
|
|
@@ -58,69 +58,69 @@ function Z({
|
|
|
58
58
|
/* @__PURE__ */ c(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
|
-
id:
|
|
61
|
+
id: m,
|
|
62
62
|
role: "region",
|
|
63
|
-
"aria-labelledby":
|
|
64
|
-
className:
|
|
63
|
+
"aria-labelledby": b,
|
|
64
|
+
className: x(
|
|
65
65
|
"transition-all duration-300 ease-linear px-4",
|
|
66
66
|
s ? "max-h-96 opacity-100 overflow-auto py-3" : "max-h-0 opacity-0 overflow-hidden",
|
|
67
67
|
d
|
|
68
68
|
),
|
|
69
|
-
children: s && (
|
|
69
|
+
children: s && (n || t)
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
72
|
] });
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
id:
|
|
76
|
-
items:
|
|
74
|
+
function xt({
|
|
75
|
+
id: r,
|
|
76
|
+
items: a = [],
|
|
77
77
|
children: t,
|
|
78
|
-
className:
|
|
78
|
+
className: n = "",
|
|
79
79
|
itemClassName: e = "",
|
|
80
|
-
allowMultiple:
|
|
80
|
+
allowMultiple: o = !1,
|
|
81
81
|
defaultOpenItems: s = [],
|
|
82
82
|
triggersClassName: i = "",
|
|
83
83
|
bodiesClassName: u = ""
|
|
84
84
|
}) {
|
|
85
|
-
const d =
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
return
|
|
85
|
+
const d = F(), f = r || `accordion-group-${d}`, [l, b] = k(new Set(s)), m = (p) => {
|
|
86
|
+
b((y) => {
|
|
87
|
+
const g = new Set(y);
|
|
88
|
+
return g.has(p) ? g.delete(p) : (o || g.clear(), g.add(p)), g;
|
|
89
89
|
});
|
|
90
|
-
},
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
|
|
93
|
-
const
|
|
90
|
+
}, v = (p) => `${d}-item-${p}`, h = (p) => l.has(p);
|
|
91
|
+
return /* @__PURE__ */ T("div", { id: f, className: n, children: [
|
|
92
|
+
a.length > 0 && a.map((p, y) => {
|
|
93
|
+
const g = p.id || v(y);
|
|
94
94
|
return /* @__PURE__ */ c(
|
|
95
|
-
|
|
95
|
+
ee,
|
|
96
96
|
{
|
|
97
|
-
id:
|
|
98
|
-
title:
|
|
99
|
-
content:
|
|
100
|
-
disabled:
|
|
101
|
-
isOpen:
|
|
102
|
-
onToggle: () =>
|
|
97
|
+
id: g,
|
|
98
|
+
title: p.title,
|
|
99
|
+
content: p.content,
|
|
100
|
+
disabled: p.disabled,
|
|
101
|
+
isOpen: h(g),
|
|
102
|
+
onToggle: () => m(g),
|
|
103
103
|
className: e,
|
|
104
104
|
triggerClassName: i,
|
|
105
105
|
bodyClassName: u
|
|
106
106
|
},
|
|
107
|
-
|
|
107
|
+
g
|
|
108
108
|
);
|
|
109
109
|
}),
|
|
110
|
-
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
|
|
110
|
+
a.length === 0 && t && W.Children.map(t, (p, y) => {
|
|
111
|
+
if (W.isValidElement(p) && p.type === ee) {
|
|
112
|
+
const g = p.props.id || v(y);
|
|
113
|
+
return /* @__PURE__ */ be(
|
|
114
|
+
ee,
|
|
115
115
|
{
|
|
116
|
-
...
|
|
117
|
-
key:
|
|
118
|
-
id:
|
|
119
|
-
className:
|
|
120
|
-
isOpen:
|
|
121
|
-
onToggle: () =>
|
|
122
|
-
triggerClassName:
|
|
123
|
-
bodyClassName:
|
|
116
|
+
...p.props,
|
|
117
|
+
key: g,
|
|
118
|
+
id: g,
|
|
119
|
+
className: x(e, p.props.className),
|
|
120
|
+
isOpen: h(g),
|
|
121
|
+
onToggle: () => m(g),
|
|
122
|
+
triggerClassName: x(i, p.props.triggerClassName),
|
|
123
|
+
bodyClassName: x(u, p.props.bodyClassName)
|
|
124
124
|
}
|
|
125
125
|
);
|
|
126
126
|
}
|
|
@@ -128,25 +128,25 @@ function dt({
|
|
|
128
128
|
})
|
|
129
129
|
] });
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
const [
|
|
131
|
+
function Re() {
|
|
132
|
+
const [r, a] = k(0);
|
|
133
133
|
return $(() => {
|
|
134
134
|
const t = setInterval(() => {
|
|
135
|
-
|
|
135
|
+
a((n) => (n + 1) % 3);
|
|
136
136
|
}, 500);
|
|
137
137
|
return () => clearInterval(t);
|
|
138
138
|
}, []), /* @__PURE__ */ c("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((t) => /* @__PURE__ */ c(
|
|
139
139
|
"div",
|
|
140
140
|
{
|
|
141
|
-
className:
|
|
141
|
+
className: x(
|
|
142
142
|
"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
|
|
143
|
-
|
|
143
|
+
r === t && "transform -translate-y-1"
|
|
144
144
|
)
|
|
145
145
|
},
|
|
146
146
|
t
|
|
147
147
|
)) });
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const Se = {
|
|
150
150
|
base: "",
|
|
151
151
|
primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
|
|
152
152
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
@@ -154,7 +154,7 @@ const Ie = {
|
|
|
154
154
|
outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
|
|
155
155
|
link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
|
|
156
156
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
|
|
157
|
-
},
|
|
157
|
+
}, Le = {
|
|
158
158
|
stripped: "",
|
|
159
159
|
fitted: "size-fit",
|
|
160
160
|
sm: "px-2 py-1 text-sm",
|
|
@@ -162,60 +162,60 @@ const Ie = {
|
|
|
162
162
|
lg: "px-6 py-3 text-lg",
|
|
163
163
|
icon: "p-1 w-fit aspect-square",
|
|
164
164
|
full: "p-2 w-full"
|
|
165
|
-
},
|
|
165
|
+
}, Ve = {
|
|
166
166
|
none: "rounded-none",
|
|
167
167
|
sm: "rounded-sm",
|
|
168
168
|
md: "rounded-md",
|
|
169
169
|
lg: "rounded-lg",
|
|
170
170
|
full: "rounded-full"
|
|
171
|
-
},
|
|
171
|
+
}, te = {
|
|
172
172
|
variant: "primary",
|
|
173
173
|
size: "md",
|
|
174
174
|
rounded: "md"
|
|
175
175
|
};
|
|
176
|
-
function
|
|
177
|
-
variant:
|
|
178
|
-
size:
|
|
179
|
-
rounded: t =
|
|
180
|
-
loading:
|
|
176
|
+
function Be({
|
|
177
|
+
variant: r = te.variant,
|
|
178
|
+
size: a,
|
|
179
|
+
rounded: t = te.rounded,
|
|
180
|
+
loading: n,
|
|
181
181
|
linkTo: e,
|
|
182
|
-
linkProps:
|
|
182
|
+
linkProps: o,
|
|
183
183
|
type: s = "button",
|
|
184
184
|
className: i,
|
|
185
185
|
...u
|
|
186
186
|
}) {
|
|
187
187
|
let d;
|
|
188
|
-
|
|
189
|
-
const l =
|
|
188
|
+
r === "link" && !a ? d = "fitted" : d = a || te.size;
|
|
189
|
+
const l = x(
|
|
190
190
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
Se[r],
|
|
192
|
+
Le[d],
|
|
193
|
+
Ve[t],
|
|
194
|
+
n && "relative pointer-events-none",
|
|
195
195
|
e && "relative",
|
|
196
196
|
i
|
|
197
197
|
);
|
|
198
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ T(
|
|
199
199
|
"button",
|
|
200
200
|
{
|
|
201
201
|
...u,
|
|
202
202
|
role: e ? "link" : u.role,
|
|
203
|
-
"aria-label": u["aria-label"] || (
|
|
204
|
-
"aria-description": u["aria-description"] || (
|
|
205
|
-
"aria-disabled": u.disabled ||
|
|
206
|
-
"aria-busy":
|
|
203
|
+
"aria-label": u["aria-label"] || (o == null ? void 0 : o["aria-label"]),
|
|
204
|
+
"aria-description": u["aria-description"] || (o == null ? void 0 : o["aria-description"]),
|
|
205
|
+
"aria-disabled": u.disabled || n,
|
|
206
|
+
"aria-busy": n,
|
|
207
207
|
type: s,
|
|
208
208
|
className: l,
|
|
209
209
|
children: [
|
|
210
|
-
|
|
211
|
-
/* @__PURE__ */ c("span", { className:
|
|
210
|
+
n && /* @__PURE__ */ c(Re, {}),
|
|
211
|
+
/* @__PURE__ */ c("span", { className: x(n && "invisible"), children: u.children }),
|
|
212
212
|
e && !u.disabled && /* @__PURE__ */ c(
|
|
213
213
|
"a",
|
|
214
214
|
{
|
|
215
|
-
...
|
|
215
|
+
...o,
|
|
216
216
|
"aria-hidden": !0,
|
|
217
217
|
href: e,
|
|
218
|
-
rel: (
|
|
218
|
+
rel: (o == null ? void 0 : o.rel) || "noreferrer",
|
|
219
219
|
className: "absolute inset-0"
|
|
220
220
|
}
|
|
221
221
|
)
|
|
@@ -223,47 +223,47 @@ function $e({
|
|
|
223
223
|
}
|
|
224
224
|
);
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
const [
|
|
228
|
-
let
|
|
229
|
-
for (;
|
|
230
|
-
const i = window.getComputedStyle(
|
|
231
|
-
i && i !== "transparent" && i !== "rgba(0, 0, 0, 0)" && (s = i),
|
|
226
|
+
function He(r) {
|
|
227
|
+
const [a, t] = k(""), n = C((e) => {
|
|
228
|
+
let o = e, s = "";
|
|
229
|
+
for (; o && !s; ) {
|
|
230
|
+
const i = window.getComputedStyle(o).backgroundColor;
|
|
231
|
+
i && i !== "transparent" && i !== "rgba(0, 0, 0, 0)" && (s = i), o = o.parentElement;
|
|
232
232
|
}
|
|
233
233
|
return s || "transparent";
|
|
234
234
|
}, []);
|
|
235
235
|
return $(() => {
|
|
236
|
-
const e = document.getElementById(
|
|
236
|
+
const e = document.getElementById(r);
|
|
237
237
|
if (e) {
|
|
238
|
-
const
|
|
239
|
-
t(
|
|
238
|
+
const o = n(e.parentElement);
|
|
239
|
+
t(o);
|
|
240
240
|
}
|
|
241
|
-
}, [
|
|
241
|
+
}, [r, n]), a;
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
ref:
|
|
245
|
-
id:
|
|
243
|
+
function Nt({
|
|
244
|
+
ref: r,
|
|
245
|
+
id: a,
|
|
246
246
|
size: t = 20,
|
|
247
|
-
color:
|
|
247
|
+
color: n,
|
|
248
248
|
filled: e = !1,
|
|
249
|
-
rounded:
|
|
249
|
+
rounded: o = !0,
|
|
250
250
|
checked: s = !1,
|
|
251
251
|
onCheckedChange: i,
|
|
252
252
|
disabled: u,
|
|
253
253
|
className: d = "",
|
|
254
|
-
...
|
|
254
|
+
...f
|
|
255
255
|
}) {
|
|
256
|
-
const l =
|
|
256
|
+
const l = F(), b = Q(() => a || `checkbox-${l}`, [a, l]), m = He(b), [v, h] = k(s);
|
|
257
257
|
$(() => {
|
|
258
|
-
|
|
258
|
+
h(s);
|
|
259
259
|
}, [s]);
|
|
260
|
-
const
|
|
261
|
-
u || (
|
|
262
|
-
}, y = (
|
|
263
|
-
|
|
264
|
-
},
|
|
260
|
+
const p = () => {
|
|
261
|
+
u || (h(!v), i == null || i(!v));
|
|
262
|
+
}, y = (w) => {
|
|
263
|
+
w.key === " " && (w.preventDefault(), p());
|
|
264
|
+
}, g = x(
|
|
265
265
|
"flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",
|
|
266
|
-
|
|
266
|
+
o && "rounded",
|
|
267
267
|
u && "opacity-40 cursor-not-allowed",
|
|
268
268
|
!u && "cursor-pointer",
|
|
269
269
|
d
|
|
@@ -271,175 +271,175 @@ function ut({
|
|
|
271
271
|
return /* @__PURE__ */ c(
|
|
272
272
|
"button",
|
|
273
273
|
{
|
|
274
|
-
id:
|
|
274
|
+
id: b,
|
|
275
275
|
type: "button",
|
|
276
|
-
ref:
|
|
276
|
+
ref: r,
|
|
277
277
|
tabIndex: 0,
|
|
278
278
|
role: "checkbox",
|
|
279
|
-
onClick:
|
|
280
|
-
"aria-checked":
|
|
279
|
+
onClick: p,
|
|
280
|
+
"aria-checked": v,
|
|
281
281
|
"aria-disabled": u,
|
|
282
282
|
onKeyDownCapture: y,
|
|
283
283
|
style: {
|
|
284
284
|
width: t,
|
|
285
285
|
height: t,
|
|
286
|
-
color:
|
|
287
|
-
backgroundColor:
|
|
286
|
+
color: n,
|
|
287
|
+
backgroundColor: v && e ? "currentcolor" : "transparent"
|
|
288
288
|
},
|
|
289
|
-
className:
|
|
290
|
-
...
|
|
291
|
-
children:
|
|
289
|
+
className: g,
|
|
290
|
+
...f,
|
|
291
|
+
children: v && /* @__PURE__ */ c(ve, { size: t, color: e ? m : void 0 })
|
|
292
292
|
}
|
|
293
293
|
);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
children:
|
|
297
|
-
className:
|
|
295
|
+
function Et({
|
|
296
|
+
children: r,
|
|
297
|
+
className: a,
|
|
298
298
|
linkTo: t,
|
|
299
|
-
linkProps:
|
|
299
|
+
linkProps: n,
|
|
300
300
|
onButtonClick: e,
|
|
301
|
-
buttonProps:
|
|
301
|
+
buttonProps: o,
|
|
302
302
|
...s
|
|
303
303
|
}) {
|
|
304
|
-
return t && e && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */
|
|
305
|
-
|
|
304
|
+
return t && e && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */ T("div", { className: x("relative w-fit", a), ...s, children: [
|
|
305
|
+
r,
|
|
306
306
|
t && /* @__PURE__ */ c(
|
|
307
307
|
"a",
|
|
308
308
|
{
|
|
309
|
-
...
|
|
310
|
-
rel: (
|
|
309
|
+
...n,
|
|
310
|
+
rel: (n == null ? void 0 : n.rel) || "noreferrer",
|
|
311
311
|
href: t,
|
|
312
|
-
className:
|
|
312
|
+
className: x("absolute inset-0", n == null ? void 0 : n.className)
|
|
313
313
|
}
|
|
314
314
|
),
|
|
315
315
|
!t && e && /* @__PURE__ */ c(
|
|
316
316
|
"button",
|
|
317
317
|
{
|
|
318
|
-
...
|
|
318
|
+
...o,
|
|
319
319
|
type: "button",
|
|
320
320
|
onClick: e,
|
|
321
|
-
className:
|
|
321
|
+
className: x("absolute inset-0 cursor-pointer", o == null ? void 0 : o.className)
|
|
322
322
|
}
|
|
323
323
|
)
|
|
324
324
|
] });
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function Y({ elementId: r, type: a, message: t }) {
|
|
327
327
|
return $(() => {
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
330
|
-
if (!t &&
|
|
331
|
-
|
|
328
|
+
const n = document.getElementById(r);
|
|
329
|
+
if (n) {
|
|
330
|
+
if (!t && a === "error") {
|
|
331
|
+
n.removeAttribute("data-error");
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
334
|
-
if (!t &&
|
|
335
|
-
|
|
334
|
+
if (!t && a === "success") {
|
|
335
|
+
n.removeAttribute("data-success");
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
|
-
return
|
|
339
|
-
|
|
338
|
+
return n.setAttribute("aria-describedby", `${r}-${a}-message`), n.setAttribute("aria-invalid", a === "error" ? "true" : "false"), a === "error" && n.setAttribute("data-error", "true"), a === "success" && n.setAttribute("data-success", "true"), () => {
|
|
339
|
+
n.removeAttribute("aria-describedby"), n.removeAttribute("aria-invalid"), n.removeAttribute("data-error"), n.removeAttribute("data-success");
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
|
-
}, [
|
|
342
|
+
}, [r, a, t]), t ? /* @__PURE__ */ T(
|
|
343
343
|
"small",
|
|
344
344
|
{
|
|
345
|
-
className:
|
|
345
|
+
className: x(
|
|
346
346
|
"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",
|
|
347
|
-
|
|
348
|
-
|
|
347
|
+
a === "error" && "text-destructive",
|
|
348
|
+
a === "success" && "text-success"
|
|
349
349
|
),
|
|
350
350
|
role: "status",
|
|
351
351
|
children: [
|
|
352
|
-
|
|
353
|
-
/* @__PURE__ */ c("span", { id: `${
|
|
352
|
+
a === "error" ? /* @__PURE__ */ c(ze, {}) : /* @__PURE__ */ c(Ne, {}),
|
|
353
|
+
/* @__PURE__ */ c("span", { id: `${r}-${a}-message`, children: t })
|
|
354
354
|
]
|
|
355
355
|
}
|
|
356
356
|
) : null;
|
|
357
357
|
}
|
|
358
|
-
const
|
|
358
|
+
const Fe = {
|
|
359
359
|
base: "",
|
|
360
360
|
default: "ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",
|
|
361
361
|
underline: "border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",
|
|
362
362
|
outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
|
|
363
|
-
},
|
|
363
|
+
}, je = {
|
|
364
364
|
none: "rounded-none",
|
|
365
365
|
sm: "rounded-sm",
|
|
366
366
|
md: "rounded-md",
|
|
367
367
|
lg: "rounded-lg",
|
|
368
368
|
full: "px-3 rounded-full"
|
|
369
|
-
},
|
|
369
|
+
}, le = {
|
|
370
370
|
variant: "default",
|
|
371
371
|
rounded: "none"
|
|
372
372
|
};
|
|
373
|
-
function
|
|
374
|
-
variant:
|
|
375
|
-
rounded:
|
|
373
|
+
function Tt({
|
|
374
|
+
variant: r = le.variant,
|
|
375
|
+
rounded: a,
|
|
376
376
|
displayOnlyMode: t = !1,
|
|
377
|
-
errorMessage:
|
|
377
|
+
errorMessage: n,
|
|
378
378
|
successMessage: e,
|
|
379
|
-
type:
|
|
379
|
+
type: o = "text",
|
|
380
380
|
className: s,
|
|
381
381
|
...i
|
|
382
382
|
}) {
|
|
383
|
-
const u =
|
|
384
|
-
let l =
|
|
385
|
-
|
|
386
|
-
const
|
|
383
|
+
const u = F(), [d, f] = k(!1);
|
|
384
|
+
let l = a;
|
|
385
|
+
r === "outline" && !a && (l = "md"), l = l || le.rounded;
|
|
386
|
+
const v = x(
|
|
387
387
|
"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
|
|
388
388
|
"file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors",
|
|
389
|
-
!t &&
|
|
390
|
-
!t &&
|
|
391
|
-
|
|
389
|
+
!t && Fe[r],
|
|
390
|
+
!t && je[l],
|
|
391
|
+
o === "password" && "pr-10",
|
|
392
392
|
!t && "px-2 py-1",
|
|
393
393
|
t && "pointer-events-none",
|
|
394
394
|
s
|
|
395
395
|
);
|
|
396
|
-
return /* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
396
|
+
return /* @__PURE__ */ T("div", { className: x(t && "cursor-text"), style: { height: i.height, width: i.width }, children: [
|
|
397
|
+
/* @__PURE__ */ T("div", { className: x(o === "password" && "relative"), children: [
|
|
398
398
|
/* @__PURE__ */ c(
|
|
399
399
|
"input",
|
|
400
400
|
{
|
|
401
401
|
...i,
|
|
402
402
|
id: u,
|
|
403
|
-
type:
|
|
403
|
+
type: o === "password" && d ? "text" : o,
|
|
404
404
|
"aria-disabled": i.disabled,
|
|
405
405
|
readOnly: t,
|
|
406
406
|
"aria-readonly": t || i["aria-readonly"],
|
|
407
|
-
"data-error":
|
|
407
|
+
"data-error": n ? !0 : void 0,
|
|
408
408
|
"data-success": e ? !0 : void 0,
|
|
409
|
-
className:
|
|
409
|
+
className: v
|
|
410
410
|
}
|
|
411
411
|
),
|
|
412
|
-
|
|
412
|
+
o === "password" && /* @__PURE__ */ c(
|
|
413
413
|
"button",
|
|
414
414
|
{
|
|
415
|
-
onClick: () =>
|
|
415
|
+
onClick: () => f(!d),
|
|
416
416
|
className: "absolute inset-y-0 right-0 px-2 hover:cursor-pointer",
|
|
417
417
|
"aria-label": "Toggle password visibility",
|
|
418
418
|
"data-state": d ? "visible" : "hidden",
|
|
419
|
-
children: d ? /* @__PURE__ */ c(
|
|
419
|
+
children: d ? /* @__PURE__ */ c(Ee, { size: 20 }) : /* @__PURE__ */ c(Te, { size: 20 })
|
|
420
420
|
}
|
|
421
421
|
)
|
|
422
422
|
] }),
|
|
423
|
-
!t && /* @__PURE__ */ c(
|
|
424
|
-
!t && /* @__PURE__ */ c(
|
|
423
|
+
!t && /* @__PURE__ */ c(Y, { elementId: u, type: "error", message: n }),
|
|
424
|
+
!t && /* @__PURE__ */ c(Y, { elementId: u, type: "success", message: e })
|
|
425
425
|
] });
|
|
426
426
|
}
|
|
427
|
-
function
|
|
428
|
-
display:
|
|
429
|
-
width:
|
|
427
|
+
function At({
|
|
428
|
+
display: r = "inline",
|
|
429
|
+
width: a = "fit-content",
|
|
430
430
|
className: t = "",
|
|
431
|
-
required:
|
|
431
|
+
required: n,
|
|
432
432
|
helpMessage: e,
|
|
433
|
-
suffix:
|
|
433
|
+
suffix: o,
|
|
434
434
|
htmlFor: s,
|
|
435
435
|
children: i,
|
|
436
436
|
...u
|
|
437
437
|
}) {
|
|
438
|
-
const d =
|
|
439
|
-
return /* @__PURE__ */
|
|
440
|
-
/* @__PURE__ */
|
|
438
|
+
const d = F(), f = x("font-medium", r, t), l = e ? `${s ?? d}-help` : void 0;
|
|
439
|
+
return /* @__PURE__ */ T("div", { style: { display: r === "inline" ? "inline-flex" : "flex", width: a }, className: "relative", children: [
|
|
440
|
+
/* @__PURE__ */ T("label", { className: f, htmlFor: s, ...u, children: [
|
|
441
441
|
i,
|
|
442
|
-
|
|
442
|
+
n && /* @__PURE__ */ c("span", { className: "text-red-500 font-medium ml-1", "aria-label": "required", children: "*" })
|
|
443
443
|
] }),
|
|
444
444
|
e && /* @__PURE__ */ c(
|
|
445
445
|
"span",
|
|
@@ -448,36 +448,36 @@ function bt({
|
|
|
448
448
|
"aria-describedby": l,
|
|
449
449
|
"aria-label": "Help information",
|
|
450
450
|
title: e,
|
|
451
|
-
children: /* @__PURE__ */ c(
|
|
451
|
+
children: /* @__PURE__ */ c(Ae, {})
|
|
452
452
|
}
|
|
453
453
|
),
|
|
454
454
|
e && /* @__PURE__ */ c("div", { id: l, className: "sr-only", children: e }),
|
|
455
|
-
|
|
455
|
+
o && /* @__PURE__ */ c("span", { className: "ml-1", children: o })
|
|
456
456
|
] });
|
|
457
457
|
}
|
|
458
|
-
function
|
|
459
|
-
const [
|
|
458
|
+
function Ke(r) {
|
|
459
|
+
const [a, t] = k(!1), [n, e] = k(!1);
|
|
460
460
|
return $(() => {
|
|
461
|
-
|
|
462
|
-
}, [
|
|
461
|
+
r ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 150));
|
|
462
|
+
}, [r]), { show: a, shouldRender: n };
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function Pe(r, a) {
|
|
465
465
|
$(() => {
|
|
466
|
-
const t = (
|
|
467
|
-
|
|
466
|
+
const t = (n) => {
|
|
467
|
+
n.key === "Escape" && r && a();
|
|
468
468
|
};
|
|
469
|
-
return document.addEventListener("keydown", t),
|
|
469
|
+
return document.addEventListener("keydown", t), r && (document.body.style.overflow = "hidden"), () => {
|
|
470
470
|
document.removeEventListener("keydown", t), document.body.style.overflow = "auto";
|
|
471
471
|
};
|
|
472
|
-
}, [
|
|
472
|
+
}, [r, a]);
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
const t =
|
|
476
|
-
const e = document.getElementById(
|
|
474
|
+
function Ge(r, a) {
|
|
475
|
+
const t = V(null), n = C(() => {
|
|
476
|
+
const e = document.getElementById(r);
|
|
477
477
|
if (!e) return;
|
|
478
|
-
const
|
|
479
|
-
if (
|
|
480
|
-
|
|
478
|
+
const o = e.querySelectorAll('[data-modal-action="true"]');
|
|
479
|
+
if (o.length > 0) {
|
|
480
|
+
o[0].focus();
|
|
481
481
|
return;
|
|
482
482
|
}
|
|
483
483
|
const s = e.querySelectorAll(
|
|
@@ -493,60 +493,60 @@ function Be(n, o) {
|
|
|
493
493
|
return;
|
|
494
494
|
}
|
|
495
495
|
e.focus();
|
|
496
|
-
}, [
|
|
497
|
-
$(() => (
|
|
496
|
+
}, [r]);
|
|
497
|
+
$(() => (a && (t.current = document.activeElement, n()), () => {
|
|
498
498
|
document.body.style.overflow = "auto", t.current instanceof HTMLElement && t.current.focus();
|
|
499
|
-
}), [
|
|
499
|
+
}), [a, n]);
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
id:
|
|
503
|
-
isOpen:
|
|
501
|
+
function kt({
|
|
502
|
+
id: r,
|
|
503
|
+
isOpen: a,
|
|
504
504
|
onClose: t,
|
|
505
|
-
title:
|
|
505
|
+
title: n,
|
|
506
506
|
children: e,
|
|
507
|
-
contentOnly:
|
|
507
|
+
contentOnly: o = !1,
|
|
508
508
|
className: s,
|
|
509
509
|
overlayClassName: i,
|
|
510
510
|
hideCloseButton: u = !1,
|
|
511
511
|
actions: d = [],
|
|
512
|
-
disableCloseOnOverlayClick:
|
|
512
|
+
disableCloseOnOverlayClick: f = !1,
|
|
513
513
|
ariaLabelledBy: l,
|
|
514
|
-
ariaDescribedBy:
|
|
514
|
+
ariaDescribedBy: b
|
|
515
515
|
}) {
|
|
516
|
-
const
|
|
517
|
-
if (
|
|
518
|
-
const
|
|
519
|
-
const { label:
|
|
520
|
-
return /* @__PURE__ */ c(
|
|
516
|
+
const m = F(), v = r || `modal-${m}`, h = r ? `${r}-title` : `modal-title-${m}`, { show: p, shouldRender: y } = Ke(a);
|
|
517
|
+
if (Ge(v, y), Pe(y, t), !y) return null;
|
|
518
|
+
const g = () => n ? W.isValidElement(n) ? /* @__PURE__ */ c("div", { className: "mb-4", children: n }) : /* @__PURE__ */ c("h2", { className: "mb-4 text-xl font-semibold", id: h, children: n }) : null, w = () => d.length === 0 ? null : /* @__PURE__ */ c("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: d.map((N, E) => {
|
|
519
|
+
const { label: L, className: I, ...S } = N;
|
|
520
|
+
return /* @__PURE__ */ c(Be, { className: I, type: "button", ...S, "data-modal-action": "true", children: L }, E);
|
|
521
521
|
}) });
|
|
522
|
-
return /* @__PURE__ */ c(
|
|
522
|
+
return /* @__PURE__ */ c(ne, { children: se(
|
|
523
523
|
/* @__PURE__ */ c(
|
|
524
524
|
"div",
|
|
525
525
|
{
|
|
526
|
-
"aria-labelledby": l ??
|
|
527
|
-
"aria-describedby":
|
|
526
|
+
"aria-labelledby": l ?? n ? h : void 0,
|
|
527
|
+
"aria-describedby": b,
|
|
528
528
|
role: "dialog",
|
|
529
529
|
"aria-modal": "true",
|
|
530
530
|
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
531
|
-
children: /* @__PURE__ */
|
|
531
|
+
children: /* @__PURE__ */ T("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
|
|
532
532
|
/* @__PURE__ */ c(
|
|
533
533
|
"div",
|
|
534
534
|
{
|
|
535
|
-
className:
|
|
535
|
+
className: R("fixed inset-0 bg-black/20 transition-all", i),
|
|
536
536
|
onClick: () => {
|
|
537
|
-
|
|
537
|
+
f || t();
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
540
|
),
|
|
541
|
-
|
|
542
|
-
!
|
|
541
|
+
o && /* @__PURE__ */ c("div", { className: R("relative w-fit", s), children: e }),
|
|
542
|
+
!o && /* @__PURE__ */ T(
|
|
543
543
|
"div",
|
|
544
544
|
{
|
|
545
|
-
id:
|
|
545
|
+
id: v,
|
|
546
546
|
tabIndex: -1,
|
|
547
|
-
className:
|
|
547
|
+
className: R(
|
|
548
548
|
"relative w-full max-w-xl transform rounded-lg shadow-xl bg-popover transition-all p-6 focus:ring ease-in duration-75",
|
|
549
|
-
|
|
549
|
+
p ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
550
550
|
s
|
|
551
551
|
),
|
|
552
552
|
children: [
|
|
@@ -557,12 +557,12 @@ function ht({
|
|
|
557
557
|
onClick: t,
|
|
558
558
|
"data-modal-close-button": "true",
|
|
559
559
|
className: "rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",
|
|
560
|
-
children: /* @__PURE__ */ c(
|
|
560
|
+
children: /* @__PURE__ */ c(oe, { size: 18 })
|
|
561
561
|
}
|
|
562
562
|
),
|
|
563
|
-
|
|
563
|
+
g(),
|
|
564
564
|
e,
|
|
565
|
-
|
|
565
|
+
w()
|
|
566
566
|
]
|
|
567
567
|
}
|
|
568
568
|
)
|
|
@@ -572,117 +572,117 @@ function ht({
|
|
|
572
572
|
document.body
|
|
573
573
|
) });
|
|
574
574
|
}
|
|
575
|
-
const
|
|
575
|
+
const Me = {
|
|
576
576
|
link: "text-primary hover:text-primary-foreground hover:bg-primary/10 aria-current:text-primary-foreground aria-current:bg-primary",
|
|
577
577
|
outline: "border border-primary text-primary hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground aria-current:border-primary",
|
|
578
578
|
filled: "bg-secondary text-secondary-foreground hover:bg-primary hover:text-primary-foreground aria-current:bg-primary aria-current:text-primary-foreground"
|
|
579
|
-
},
|
|
579
|
+
}, qe = {
|
|
580
580
|
sm: "px-2 py-1 text-sm min-w-[32px] min-h-8",
|
|
581
581
|
md: "px-2 py-1 text-base min-w-[40px] min-h-10"
|
|
582
582
|
};
|
|
583
|
-
function
|
|
584
|
-
page:
|
|
585
|
-
pageCount:
|
|
583
|
+
function It({
|
|
584
|
+
page: r,
|
|
585
|
+
pageCount: a = 5,
|
|
586
586
|
maxVisiblePages: t = 5,
|
|
587
|
-
showFirstLast:
|
|
587
|
+
showFirstLast: n = !0,
|
|
588
588
|
onPageChange: e,
|
|
589
|
-
size:
|
|
589
|
+
size: o = "md",
|
|
590
590
|
variant: s = "link",
|
|
591
591
|
className: i,
|
|
592
592
|
ref: u,
|
|
593
593
|
buttonsClassName: d,
|
|
594
|
-
...
|
|
594
|
+
...f
|
|
595
595
|
}) {
|
|
596
|
-
const l =
|
|
596
|
+
const l = a === 1 / 0, m = C(() => {
|
|
597
597
|
if (l) return [];
|
|
598
|
-
const N =
|
|
598
|
+
const N = a, E = Math.min(t, N);
|
|
599
599
|
if (N <= E)
|
|
600
|
-
return Array.from({ length: N }, (
|
|
601
|
-
const
|
|
602
|
-
let
|
|
603
|
-
return
|
|
604
|
-
}, [l, t,
|
|
605
|
-
N >= 1 && (l || N <=
|
|
606
|
-
},
|
|
607
|
-
const N =
|
|
600
|
+
return Array.from({ length: N }, (K, P) => P + 1);
|
|
601
|
+
const L = Math.floor(E / 2);
|
|
602
|
+
let I = Math.max(1, r - L), S = Math.min(N, I + E - 1);
|
|
603
|
+
return S - I + 1 < E && (I = Math.max(1, S - E + 1), S = Math.min(N, I + E - 1)), Array.from({ length: S - I + 1 }, (K, P) => I + P);
|
|
604
|
+
}, [l, t, r, a])(), v = r > 1, h = l || r < a, p = n && !l, y = n && !l, g = (N) => {
|
|
605
|
+
N >= 1 && (l || N <= a) && e(N);
|
|
606
|
+
}, w = C(() => {
|
|
607
|
+
const N = R(
|
|
608
608
|
"flex items-center justify-center min-w-fit",
|
|
609
609
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
610
|
-
|
|
610
|
+
qe[o],
|
|
611
611
|
"rounded-md"
|
|
612
612
|
);
|
|
613
|
-
return
|
|
614
|
-
}, [s,
|
|
615
|
-
return /* @__PURE__ */
|
|
613
|
+
return R(N, Me[s], d);
|
|
614
|
+
}, [s, o, d]);
|
|
615
|
+
return /* @__PURE__ */ T(
|
|
616
616
|
"nav",
|
|
617
617
|
{
|
|
618
618
|
ref: u,
|
|
619
|
-
className:
|
|
619
|
+
className: R("flex items-center justify-center gap-1", i),
|
|
620
620
|
role: "navigation",
|
|
621
621
|
"aria-label": "Pagination",
|
|
622
|
-
"data-page":
|
|
623
|
-
"data-page-count": l ? "infinite" :
|
|
624
|
-
...
|
|
622
|
+
"data-page": r,
|
|
623
|
+
"data-page-count": l ? "infinite" : a,
|
|
624
|
+
...f,
|
|
625
625
|
children: [
|
|
626
|
-
|
|
626
|
+
p && /* @__PURE__ */ T(
|
|
627
627
|
"button",
|
|
628
628
|
{
|
|
629
|
-
onClick: () =>
|
|
630
|
-
className:
|
|
631
|
-
disabled:
|
|
629
|
+
onClick: () => g(1),
|
|
630
|
+
className: w(),
|
|
631
|
+
disabled: r === 1,
|
|
632
632
|
"aria-label": "Go to first page",
|
|
633
633
|
children: [
|
|
634
|
-
/* @__PURE__ */ c(
|
|
634
|
+
/* @__PURE__ */ c(ke, { size: o === "sm" ? 12 : 15 }),
|
|
635
635
|
/* @__PURE__ */ c("span", { className: "ml-1", children: "First" })
|
|
636
636
|
]
|
|
637
637
|
}
|
|
638
638
|
),
|
|
639
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ T(
|
|
640
640
|
"button",
|
|
641
641
|
{
|
|
642
|
-
onClick: () =>
|
|
643
|
-
className:
|
|
644
|
-
disabled: !
|
|
642
|
+
onClick: () => g(r - 1),
|
|
643
|
+
className: w(),
|
|
644
|
+
disabled: !v,
|
|
645
645
|
"aria-label": "Go to previous page",
|
|
646
646
|
children: [
|
|
647
|
-
/* @__PURE__ */ c(
|
|
647
|
+
/* @__PURE__ */ c(Ie, { size: o === "sm" ? 12 : 15 }),
|
|
648
648
|
/* @__PURE__ */ c("span", { className: "ml-1", children: "Previous" })
|
|
649
649
|
]
|
|
650
650
|
}
|
|
651
651
|
),
|
|
652
|
-
!l &&
|
|
652
|
+
!l && m.map((N) => /* @__PURE__ */ c(
|
|
653
653
|
"button",
|
|
654
654
|
{
|
|
655
|
-
onClick: () =>
|
|
656
|
-
className:
|
|
655
|
+
onClick: () => g(N),
|
|
656
|
+
className: R(w(), "aspect-square"),
|
|
657
657
|
"aria-label": `Go to page ${N}`,
|
|
658
|
-
"aria-current": N ===
|
|
658
|
+
"aria-current": N === r ? !0 : void 0,
|
|
659
659
|
children: N
|
|
660
660
|
},
|
|
661
661
|
N
|
|
662
662
|
)),
|
|
663
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ T(
|
|
664
664
|
"button",
|
|
665
665
|
{
|
|
666
|
-
onClick: () =>
|
|
667
|
-
className:
|
|
668
|
-
disabled: !
|
|
666
|
+
onClick: () => g(r + 1),
|
|
667
|
+
className: w(),
|
|
668
|
+
disabled: !h,
|
|
669
669
|
"aria-label": "Go to next page",
|
|
670
670
|
children: [
|
|
671
671
|
/* @__PURE__ */ c("span", { className: "mr-1", children: "Next" }),
|
|
672
|
-
/* @__PURE__ */ c(
|
|
672
|
+
/* @__PURE__ */ c(Ce, { size: o === "sm" ? 12 : 15 })
|
|
673
673
|
]
|
|
674
674
|
}
|
|
675
675
|
),
|
|
676
|
-
y && /* @__PURE__ */
|
|
676
|
+
y && /* @__PURE__ */ T(
|
|
677
677
|
"button",
|
|
678
678
|
{
|
|
679
|
-
onClick: () =>
|
|
680
|
-
className:
|
|
681
|
-
disabled:
|
|
679
|
+
onClick: () => g(a),
|
|
680
|
+
className: w(),
|
|
681
|
+
disabled: r === a,
|
|
682
682
|
"aria-label": "Go to last page",
|
|
683
683
|
children: [
|
|
684
684
|
/* @__PURE__ */ c("span", { className: "mr-1", children: "Last" }),
|
|
685
|
-
/* @__PURE__ */ c(
|
|
685
|
+
/* @__PURE__ */ c($e, { size: o === "sm" ? 12 : 15 })
|
|
686
686
|
]
|
|
687
687
|
}
|
|
688
688
|
)
|
|
@@ -690,29 +690,29 @@ function pt({
|
|
|
690
690
|
}
|
|
691
691
|
);
|
|
692
692
|
}
|
|
693
|
-
function
|
|
694
|
-
const [
|
|
693
|
+
function We(r) {
|
|
694
|
+
const [a, t] = k(!1), [n, e] = k(!1);
|
|
695
695
|
return $(() => {
|
|
696
|
-
|
|
697
|
-
}, [
|
|
696
|
+
r ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 300));
|
|
697
|
+
}, [r]), { show: a, shouldRender: n };
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function Ue(r, a) {
|
|
700
700
|
$(() => {
|
|
701
|
-
const t = (
|
|
702
|
-
|
|
701
|
+
const t = (n) => {
|
|
702
|
+
n.key === "Escape" && r && a();
|
|
703
703
|
};
|
|
704
|
-
return document.addEventListener("keydown", t),
|
|
704
|
+
return document.addEventListener("keydown", t), r && (document.body.style.overflow = "hidden"), () => {
|
|
705
705
|
document.removeEventListener("keydown", t), document.body.style.overflow = "auto";
|
|
706
706
|
};
|
|
707
|
-
}, [
|
|
707
|
+
}, [r, a]);
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
const t =
|
|
711
|
-
const e = document.getElementById(
|
|
709
|
+
function _e(r, a) {
|
|
710
|
+
const t = V(null), n = C(() => {
|
|
711
|
+
const e = document.getElementById(r);
|
|
712
712
|
if (!e) return;
|
|
713
|
-
const
|
|
714
|
-
if (
|
|
715
|
-
|
|
713
|
+
const o = e.querySelectorAll('[data-panel-action="true"]');
|
|
714
|
+
if (o.length > 0) {
|
|
715
|
+
o[0].focus();
|
|
716
716
|
return;
|
|
717
717
|
}
|
|
718
718
|
const s = e.querySelectorAll(
|
|
@@ -728,12 +728,12 @@ function qe(n, o) {
|
|
|
728
728
|
return;
|
|
729
729
|
}
|
|
730
730
|
e.focus();
|
|
731
|
-
}, [
|
|
732
|
-
$(() => (
|
|
731
|
+
}, [r]);
|
|
732
|
+
$(() => (a && (t.current = document.activeElement, n()), () => {
|
|
733
733
|
document.body.style.overflow = "auto", t.current instanceof HTMLElement && t.current.focus();
|
|
734
|
-
}), [
|
|
734
|
+
}), [a, n]);
|
|
735
735
|
}
|
|
736
|
-
const
|
|
736
|
+
const Xe = {
|
|
737
737
|
size: {
|
|
738
738
|
sm: "max-w-sm",
|
|
739
739
|
md: "max-w-md",
|
|
@@ -744,38 +744,38 @@ const He = {
|
|
|
744
744
|
screen: "w-screen"
|
|
745
745
|
}
|
|
746
746
|
};
|
|
747
|
-
function
|
|
748
|
-
ref:
|
|
749
|
-
id:
|
|
747
|
+
function Ct({
|
|
748
|
+
ref: r,
|
|
749
|
+
id: a,
|
|
750
750
|
isOpen: t,
|
|
751
|
-
onClose:
|
|
751
|
+
onClose: n,
|
|
752
752
|
title: e,
|
|
753
|
-
children:
|
|
753
|
+
children: o,
|
|
754
754
|
footer: s,
|
|
755
755
|
size: i = "md",
|
|
756
756
|
className: u,
|
|
757
757
|
overlayClassName: d,
|
|
758
|
-
hideCloseButton:
|
|
758
|
+
hideCloseButton: f = !1,
|
|
759
759
|
disableCloseOnOverlayClick: l = !1,
|
|
760
|
-
ariaLabelledBy:
|
|
761
|
-
ariaDescribedBy:
|
|
760
|
+
ariaLabelledBy: b,
|
|
761
|
+
ariaDescribedBy: m
|
|
762
762
|
}) {
|
|
763
|
-
const
|
|
764
|
-
if (
|
|
765
|
-
const
|
|
763
|
+
const v = F(), h = a || `panel-${v}`, p = a ? `${a}-title` : `panel-title-${v}`, { show: y, shouldRender: g } = We(t);
|
|
764
|
+
if (_e(h, g), Ue(g, n), !g) return null;
|
|
765
|
+
const w = () => e ? W.isValidElement(e) ? /* @__PURE__ */ c("div", { children: e }) : /* @__PURE__ */ c("h2", { className: "text-2xl font-semibold", id: p, children: e }) : null, N = () => {
|
|
766
766
|
if (!s) return null;
|
|
767
|
-
if (
|
|
768
|
-
const E = s,
|
|
769
|
-
return
|
|
767
|
+
if (W.isValidElement(s)) {
|
|
768
|
+
const E = s, L = E.props.className || "";
|
|
769
|
+
return W.cloneElement(E, { className: R("px-6 py-4", L) });
|
|
770
770
|
}
|
|
771
771
|
return /* @__PURE__ */ c("div", { className: "px-6 py-4", children: s });
|
|
772
772
|
};
|
|
773
|
-
return /* @__PURE__ */ c(
|
|
774
|
-
/* @__PURE__ */
|
|
773
|
+
return /* @__PURE__ */ c(ne, { children: se(
|
|
774
|
+
/* @__PURE__ */ T(
|
|
775
775
|
"div",
|
|
776
776
|
{
|
|
777
|
-
"aria-labelledby":
|
|
778
|
-
"aria-describedby":
|
|
777
|
+
"aria-labelledby": b ?? e ? p : void 0,
|
|
778
|
+
"aria-describedby": m,
|
|
779
779
|
role: "dialog",
|
|
780
780
|
"aria-modal": "true",
|
|
781
781
|
className: "fixed inset-0 z-[100] overflow-hidden",
|
|
@@ -784,44 +784,44 @@ function gt({
|
|
|
784
784
|
/* @__PURE__ */ c(
|
|
785
785
|
"div",
|
|
786
786
|
{
|
|
787
|
-
className:
|
|
787
|
+
className: R(
|
|
788
788
|
"fixed inset-0 bg-black/40 transition-opacity duration-300",
|
|
789
789
|
y ? "opacity-100" : "opacity-0",
|
|
790
790
|
d
|
|
791
791
|
),
|
|
792
792
|
onClick: () => {
|
|
793
|
-
l ||
|
|
793
|
+
l || n();
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
796
|
),
|
|
797
797
|
/* @__PURE__ */ c("div", { className: "fixed inset-y-0 right-0 flex max-w-full", children: /* @__PURE__ */ c(
|
|
798
798
|
"div",
|
|
799
799
|
{
|
|
800
|
-
id:
|
|
801
|
-
ref:
|
|
800
|
+
id: h,
|
|
801
|
+
ref: r,
|
|
802
802
|
tabIndex: -1,
|
|
803
|
-
className:
|
|
803
|
+
className: R(
|
|
804
804
|
"relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out",
|
|
805
805
|
i !== "screen" && "border-l border-border",
|
|
806
|
-
|
|
806
|
+
Xe.size[i],
|
|
807
807
|
y ? "translate-x-0" : "translate-x-full",
|
|
808
808
|
u
|
|
809
809
|
),
|
|
810
810
|
"data-panel-size": i,
|
|
811
|
-
children: /* @__PURE__ */
|
|
812
|
-
e && /* @__PURE__ */ c("div", { className: "px-6 pt-6", children:
|
|
813
|
-
!
|
|
811
|
+
children: /* @__PURE__ */ T("div", { className: "flex h-full flex-col", children: [
|
|
812
|
+
e && /* @__PURE__ */ c("div", { className: "px-6 pt-6", children: w() }),
|
|
813
|
+
!f && /* @__PURE__ */ c(
|
|
814
814
|
"button",
|
|
815
815
|
{
|
|
816
816
|
type: "button",
|
|
817
|
-
onClick:
|
|
817
|
+
onClick: n,
|
|
818
818
|
"data-panel-close-button": "true",
|
|
819
819
|
"aria-label": "Close panel",
|
|
820
820
|
className: "rounded-md p-0.5 top-3 right-3 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",
|
|
821
|
-
children: /* @__PURE__ */ c(
|
|
821
|
+
children: /* @__PURE__ */ c(oe, { size: 18 })
|
|
822
822
|
}
|
|
823
823
|
),
|
|
824
|
-
/* @__PURE__ */ c("div", { className:
|
|
824
|
+
/* @__PURE__ */ c("div", { className: R("flex-1 overflow-y-auto px-6 pb-6", e ? "pt-6" : "pt-10"), children: o }),
|
|
825
825
|
N()
|
|
826
826
|
] })
|
|
827
827
|
}
|
|
@@ -832,26 +832,26 @@ function gt({
|
|
|
832
832
|
document.body
|
|
833
833
|
) });
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function Qe({ itemId: r, checked: a, onChange: t, name: n, disabled: e = !1, className: o = "" }) {
|
|
836
836
|
const s = "relative inline-flex items-center justify-center rounded-full", i = () => {
|
|
837
837
|
e || t();
|
|
838
|
-
}, u =
|
|
838
|
+
}, u = x(
|
|
839
839
|
s,
|
|
840
|
-
!
|
|
840
|
+
!a && "hover:border-current/60",
|
|
841
841
|
!e && "border-current cursor-pointer",
|
|
842
842
|
e && "border-muted/60 cursor-not-allowed",
|
|
843
|
-
|
|
843
|
+
o
|
|
844
844
|
);
|
|
845
845
|
return /* @__PURE__ */ c(
|
|
846
846
|
"div",
|
|
847
847
|
{
|
|
848
|
-
id:
|
|
848
|
+
id: r,
|
|
849
849
|
role: "radio",
|
|
850
850
|
tabIndex: -1,
|
|
851
|
-
"aria-checked":
|
|
851
|
+
"aria-checked": a,
|
|
852
852
|
"aria-disabled": e,
|
|
853
|
-
"aria-description": `Radio button for ${
|
|
854
|
-
"aria-labelledby": `${
|
|
853
|
+
"aria-description": `Radio button for ${n}`,
|
|
854
|
+
"aria-labelledby": `${r}-label`,
|
|
855
855
|
onClick: i,
|
|
856
856
|
className: u,
|
|
857
857
|
style: {
|
|
@@ -860,76 +860,76 @@ function Me({ itemId: n, checked: o, onChange: t, name: a, disabled: e = !1, cla
|
|
|
860
860
|
padding: "0.1em",
|
|
861
861
|
borderWidth: "0.06em"
|
|
862
862
|
},
|
|
863
|
-
children:
|
|
863
|
+
children: a && /* @__PURE__ */ c(
|
|
864
864
|
"div",
|
|
865
865
|
{
|
|
866
|
-
className:
|
|
866
|
+
className: x("size-full aspect-square rounded-full", e && "bg-muted/60", !e && "bg-current")
|
|
867
867
|
}
|
|
868
868
|
)
|
|
869
869
|
}
|
|
870
870
|
);
|
|
871
871
|
}
|
|
872
|
-
function
|
|
873
|
-
value:
|
|
874
|
-
children:
|
|
872
|
+
function re({
|
|
873
|
+
value: r,
|
|
874
|
+
children: a,
|
|
875
875
|
className: t = "",
|
|
876
|
-
isSelected:
|
|
876
|
+
isSelected: n = !1,
|
|
877
877
|
onChange: e,
|
|
878
|
-
disabled:
|
|
878
|
+
disabled: o = !1,
|
|
879
879
|
hideInput: s = !1,
|
|
880
880
|
description: i,
|
|
881
881
|
name: u
|
|
882
882
|
}) {
|
|
883
|
-
const
|
|
884
|
-
|
|
883
|
+
const f = `radio-${F()}-${r}`, l = () => {
|
|
884
|
+
o || e == null || e(r);
|
|
885
885
|
};
|
|
886
|
-
return /* @__PURE__ */
|
|
886
|
+
return /* @__PURE__ */ T(
|
|
887
887
|
"div",
|
|
888
888
|
{
|
|
889
889
|
title: i,
|
|
890
|
-
className:
|
|
890
|
+
className: x(
|
|
891
891
|
"relative flex items-center",
|
|
892
892
|
t,
|
|
893
893
|
// Uses text color for borders
|
|
894
|
-
s && `p-2 border-2 focus-within:border-dashed focus-within:${
|
|
895
|
-
s && !
|
|
896
|
-
s &&
|
|
897
|
-
|
|
894
|
+
s && `p-2 border-2 focus-within:border-dashed focus-within:${o ? "border-current/50" : "border-current/80"}`,
|
|
895
|
+
s && !n && `border-transparent ${o ? "" : "not-focus-within:hover:border-border/60"}`,
|
|
896
|
+
s && n && "border-border",
|
|
897
|
+
o && "opacity-60 cursor-not-allowed"
|
|
898
898
|
),
|
|
899
899
|
style: {
|
|
900
900
|
gap: "0.5em"
|
|
901
901
|
},
|
|
902
902
|
children: [
|
|
903
903
|
!s && /* @__PURE__ */ c(
|
|
904
|
-
|
|
904
|
+
Qe,
|
|
905
905
|
{
|
|
906
|
-
itemId:
|
|
906
|
+
itemId: f,
|
|
907
907
|
name: u || "",
|
|
908
|
-
checked:
|
|
908
|
+
checked: n,
|
|
909
909
|
onChange: l,
|
|
910
|
-
disabled:
|
|
911
|
-
className:
|
|
910
|
+
disabled: o,
|
|
911
|
+
className: x(s && "")
|
|
912
912
|
}
|
|
913
913
|
),
|
|
914
914
|
/* @__PURE__ */ c(
|
|
915
915
|
"div",
|
|
916
916
|
{
|
|
917
|
-
id: s ?
|
|
917
|
+
id: s ? f : void 0,
|
|
918
918
|
tabIndex: s ? -1 : void 0,
|
|
919
919
|
role: s ? "radio" : void 0,
|
|
920
920
|
onClick: s ? l : void 0,
|
|
921
|
-
"aria-checked": s ?
|
|
922
|
-
"aria-disabled": s ?
|
|
921
|
+
"aria-checked": s ? n ? "true" : "false" : void 0,
|
|
922
|
+
"aria-disabled": s ? o : void 0,
|
|
923
923
|
"aria-description": s ? i || `Radio button for ${u}` : void 0,
|
|
924
|
-
"aria-labelledby": s ? `${
|
|
925
|
-
className:
|
|
924
|
+
"aria-labelledby": s ? `${f}-label` : void 0,
|
|
925
|
+
className: x(s && "size-full", typeof a == "object" && "grow focus:outline-none"),
|
|
926
926
|
children: /* @__PURE__ */ c(
|
|
927
927
|
"label",
|
|
928
928
|
{
|
|
929
|
-
id: `${
|
|
929
|
+
id: `${f}-label`,
|
|
930
930
|
onClick: s ? void 0 : l,
|
|
931
|
-
className:
|
|
932
|
-
children:
|
|
931
|
+
className: x(o && "cursor-not-allowed", !o && "cursor-pointer"),
|
|
932
|
+
children: a
|
|
933
933
|
}
|
|
934
934
|
)
|
|
935
935
|
}
|
|
@@ -938,98 +938,98 @@ function Y({
|
|
|
938
938
|
}
|
|
939
939
|
);
|
|
940
940
|
}
|
|
941
|
-
function
|
|
942
|
-
const [t,
|
|
941
|
+
function Ze(r, a) {
|
|
942
|
+
const [t, n] = k(a), [e, o] = k(-1), [s, i] = k(!1), u = C((m, v) => {
|
|
943
943
|
var y;
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
}, []), d =
|
|
947
|
-
(
|
|
948
|
-
var
|
|
949
|
-
if (
|
|
950
|
-
const
|
|
951
|
-
(
|
|
944
|
+
const h = m[v];
|
|
945
|
+
h.hasAttribute("disabled") || h.getAttribute("aria-disabled") === "true" || ((y = m[v]) == null || y.click(), o(v));
|
|
946
|
+
}, []), d = C(
|
|
947
|
+
(m, v) => {
|
|
948
|
+
var p;
|
|
949
|
+
if (m.preventDefault(), s || !v.length) return;
|
|
950
|
+
const h = a !== -1 ? a : 0;
|
|
951
|
+
(p = v[h]) == null || p.focus(), n(h), a !== -1 && u(v, h);
|
|
952
952
|
},
|
|
953
|
-
[
|
|
954
|
-
),
|
|
955
|
-
(
|
|
953
|
+
[a, s, u]
|
|
954
|
+
), f = C(
|
|
955
|
+
(m) => {
|
|
956
956
|
var y;
|
|
957
|
-
if (!
|
|
957
|
+
if (!m.shiftKey)
|
|
958
958
|
return;
|
|
959
|
-
|
|
960
|
-
const
|
|
959
|
+
m.preventDefault();
|
|
960
|
+
const v = Array.from(
|
|
961
961
|
document.querySelectorAll(
|
|
962
962
|
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
963
963
|
)
|
|
964
|
-
).filter((
|
|
965
|
-
(y =
|
|
964
|
+
).filter((g) => !g.hasAttribute("disabled") && g.tabIndex >= 0), h = v.findIndex((g) => g.id === r), p = h > 0 ? h - 1 : v.length - 1;
|
|
965
|
+
(y = v[p]) == null || y.focus();
|
|
966
966
|
},
|
|
967
|
-
[
|
|
968
|
-
), l =
|
|
969
|
-
(
|
|
970
|
-
var
|
|
971
|
-
if (!
|
|
972
|
-
const
|
|
973
|
-
if (!
|
|
967
|
+
[r]
|
|
968
|
+
), l = C(
|
|
969
|
+
(m, v) => {
|
|
970
|
+
var w;
|
|
971
|
+
if (!v.length) return;
|
|
972
|
+
const h = m.target;
|
|
973
|
+
if (!v.some((N) => N.id === h.id)) return;
|
|
974
974
|
const y = t !== -1 ? t : 0;
|
|
975
|
-
let
|
|
976
|
-
switch (
|
|
975
|
+
let g = y;
|
|
976
|
+
switch (m.key) {
|
|
977
977
|
case "ArrowUp":
|
|
978
978
|
case "ArrowLeft":
|
|
979
|
-
|
|
979
|
+
m.preventDefault(), g = y > 0 ? y - 1 : v.length - 1;
|
|
980
980
|
break;
|
|
981
981
|
case "ArrowDown":
|
|
982
982
|
case "ArrowRight":
|
|
983
|
-
|
|
983
|
+
m.preventDefault(), g = (y + 1) % v.length;
|
|
984
984
|
break;
|
|
985
985
|
// Select the option when the space key is pressed
|
|
986
986
|
case " ":
|
|
987
|
-
|
|
987
|
+
m.preventDefault(), u(v, y);
|
|
988
988
|
return;
|
|
989
989
|
case "Tab":
|
|
990
|
-
m
|
|
990
|
+
f(m);
|
|
991
991
|
return;
|
|
992
992
|
default:
|
|
993
993
|
return;
|
|
994
994
|
}
|
|
995
|
-
(
|
|
995
|
+
(w = v[g]) == null || w.focus(), n(g), e !== -1 && u(v, g);
|
|
996
996
|
},
|
|
997
|
-
[t, e,
|
|
998
|
-
),
|
|
999
|
-
const
|
|
1000
|
-
return
|
|
1001
|
-
}, [
|
|
997
|
+
[t, e, f, u]
|
|
998
|
+
), b = C(() => {
|
|
999
|
+
const m = document.querySelector(`[id="${r}"][role="radiogroup"]`);
|
|
1000
|
+
return m ? Array.from(m.querySelectorAll('[role="radio"]')) : [];
|
|
1001
|
+
}, [r]);
|
|
1002
1002
|
$(() => {
|
|
1003
|
-
const
|
|
1004
|
-
if (!
|
|
1005
|
-
const
|
|
1006
|
-
return document.addEventListener("keydown",
|
|
1007
|
-
document.removeEventListener("keydown",
|
|
1003
|
+
const m = document.querySelector(`[id="${r}"][role="radiogroup"]`);
|
|
1004
|
+
if (!m) return;
|
|
1005
|
+
const v = b(), h = (w) => d(w, v), p = (w) => l(w, v), y = () => i(!0), g = () => i(!1);
|
|
1006
|
+
return document.addEventListener("keydown", p), m.addEventListener("focus", h), m.addEventListener("mousedown", y), document.addEventListener("mouseup", g), () => {
|
|
1007
|
+
document.removeEventListener("keydown", p), m.removeEventListener("focus", h), m.removeEventListener("mousedown", y), document.removeEventListener("mouseup", g);
|
|
1008
1008
|
};
|
|
1009
|
-
}, [
|
|
1009
|
+
}, [r, b, d, l]);
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1012
|
-
options:
|
|
1013
|
-
value:
|
|
1011
|
+
function $t({
|
|
1012
|
+
options: r = [],
|
|
1013
|
+
value: a,
|
|
1014
1014
|
onChange: t,
|
|
1015
|
-
id:
|
|
1015
|
+
id: n,
|
|
1016
1016
|
children: e,
|
|
1017
|
-
className:
|
|
1017
|
+
className: o = "",
|
|
1018
1018
|
childrenClassName: s = "",
|
|
1019
1019
|
hideInputs: i = !1
|
|
1020
1020
|
}) {
|
|
1021
|
-
const u =
|
|
1022
|
-
|
|
1021
|
+
const u = F(), d = n || `radio-group-${u}`;
|
|
1022
|
+
Ze(
|
|
1023
1023
|
d,
|
|
1024
|
-
|
|
1024
|
+
r.findIndex((l) => l === a)
|
|
1025
1025
|
);
|
|
1026
|
-
const
|
|
1027
|
-
return /* @__PURE__ */
|
|
1028
|
-
|
|
1029
|
-
|
|
1026
|
+
const f = Q(() => r.reduce((l, b) => (typeof b == "string" ? l.some((m) => m.value === b) || l.push({ label: b, value: b }) : l.push(b), l), []), [r]);
|
|
1027
|
+
return /* @__PURE__ */ T("div", { id: d, role: "radiogroup", tabIndex: 0, className: x(o, "focus:outline-none"), children: [
|
|
1028
|
+
f.length > 0 && f.map((l, b) => /* @__PURE__ */ c(
|
|
1029
|
+
re,
|
|
1030
1030
|
{
|
|
1031
1031
|
value: l.value,
|
|
1032
|
-
isSelected:
|
|
1032
|
+
isSelected: a === l.value,
|
|
1033
1033
|
onChange: t,
|
|
1034
1034
|
name: d,
|
|
1035
1035
|
disabled: l.disabled,
|
|
@@ -1038,15 +1038,15 @@ function vt({
|
|
|
1038
1038
|
className: s,
|
|
1039
1039
|
children: l.label
|
|
1040
1040
|
},
|
|
1041
|
-
`${l.value}-${
|
|
1041
|
+
`${l.value}-${b}`
|
|
1042
1042
|
)),
|
|
1043
|
-
|
|
1044
|
-
|
|
1043
|
+
f.length === 0 && e && W.Children.map(e, (l) => W.isValidElement(l) && l.type === re ? /* @__PURE__ */ c(
|
|
1044
|
+
re,
|
|
1045
1045
|
{
|
|
1046
1046
|
...l.props,
|
|
1047
|
-
className:
|
|
1047
|
+
className: x(s, l.props.className),
|
|
1048
1048
|
hideInput: l.props.hideInput || i,
|
|
1049
|
-
isSelected:
|
|
1049
|
+
isSelected: a === l.props.value,
|
|
1050
1050
|
onChange: t,
|
|
1051
1051
|
name: d,
|
|
1052
1052
|
children: l.props.children
|
|
@@ -1054,7 +1054,459 @@ function vt({
|
|
|
1054
1054
|
) : null)
|
|
1055
1055
|
] });
|
|
1056
1056
|
}
|
|
1057
|
-
|
|
1057
|
+
function Je(r) {
|
|
1058
|
+
const a = V(null), t = V(null), n = V(null), [e, o] = k(!1), [s, i] = k(!1), [u, d] = k({
|
|
1059
|
+
vertical: !1,
|
|
1060
|
+
horizontal: !1
|
|
1061
|
+
}), f = V(null), l = V(null), b = C(() => {
|
|
1062
|
+
const h = a.current;
|
|
1063
|
+
if (!h) return;
|
|
1064
|
+
const p = h.scrollHeight > h.clientHeight, y = h.scrollWidth > h.clientWidth;
|
|
1065
|
+
d({
|
|
1066
|
+
vertical: p,
|
|
1067
|
+
horizontal: y
|
|
1068
|
+
});
|
|
1069
|
+
}, []), m = C(() => {
|
|
1070
|
+
const h = a.current, p = t.current, y = n.current;
|
|
1071
|
+
if (h) {
|
|
1072
|
+
if (p && u.vertical) {
|
|
1073
|
+
const w = (u.horizontal ? h.clientHeight - r : h.clientHeight) / h.scrollHeight, N = Math.max(w * 100, 10), E = h.scrollHeight - h.clientHeight, L = E > 0 ? h.scrollTop / E : 0, I = 100 - N, S = L * I;
|
|
1074
|
+
p.style.height = `${N}%`, p.style.top = `${S}%`, p.style.transform = "none";
|
|
1075
|
+
}
|
|
1076
|
+
if (y && u.horizontal) {
|
|
1077
|
+
const w = (u.vertical ? h.clientWidth - r : h.clientWidth) / h.scrollWidth, N = Math.max(w * 100, 10), E = h.scrollWidth - h.clientWidth, L = E > 0 ? h.scrollLeft / E : 0, I = 100 - N, S = L * I;
|
|
1078
|
+
y.style.width = `${N}%`, y.style.left = `${S}%`, y.style.transform = "none";
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
}, [u, r]), v = C(() => {
|
|
1082
|
+
f.current && clearTimeout(f.current), l.current && clearTimeout(l.current), o(!0), i(!1), m(), f.current = setTimeout(() => {
|
|
1083
|
+
i(!0), l.current = setTimeout(() => {
|
|
1084
|
+
o(!1), i(!1);
|
|
1085
|
+
}, 300);
|
|
1086
|
+
}, 1e3);
|
|
1087
|
+
}, [m]);
|
|
1088
|
+
return $(() => {
|
|
1089
|
+
const h = a.current;
|
|
1090
|
+
if (!h) return;
|
|
1091
|
+
b();
|
|
1092
|
+
const p = new ResizeObserver(b);
|
|
1093
|
+
p.observe(h);
|
|
1094
|
+
const y = new MutationObserver(b);
|
|
1095
|
+
return y.observe(h, {
|
|
1096
|
+
childList: !0,
|
|
1097
|
+
subtree: !0,
|
|
1098
|
+
attributes: !0
|
|
1099
|
+
}), () => {
|
|
1100
|
+
p.disconnect(), y.disconnect();
|
|
1101
|
+
};
|
|
1102
|
+
}, [b]), $(() => {
|
|
1103
|
+
m();
|
|
1104
|
+
}, [u, m]), $(() => () => {
|
|
1105
|
+
f.current && clearTimeout(f.current), l.current && clearTimeout(l.current);
|
|
1106
|
+
}, []), {
|
|
1107
|
+
viewportRef: a,
|
|
1108
|
+
verticalThumbRef: t,
|
|
1109
|
+
horizontalThumbRef: n,
|
|
1110
|
+
isScrolling: e,
|
|
1111
|
+
isFadingOut: s,
|
|
1112
|
+
scrollbarVisible: u,
|
|
1113
|
+
handleScroll: v
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
function Dt({
|
|
1117
|
+
className: r,
|
|
1118
|
+
thumbClassName: a,
|
|
1119
|
+
viewportClassName: t,
|
|
1120
|
+
scrollbarClassName: n,
|
|
1121
|
+
scrollbarThickness: e = 10,
|
|
1122
|
+
children: o,
|
|
1123
|
+
id: s,
|
|
1124
|
+
ref: i,
|
|
1125
|
+
...u
|
|
1126
|
+
}) {
|
|
1127
|
+
const { viewportRef: d, verticalThumbRef: f, horizontalThumbRef: l, isScrolling: b, isFadingOut: m, scrollbarVisible: v, handleScroll: h } = Je(e), p = R(
|
|
1128
|
+
"relative flex-1 rounded-full bg-slate-400/60 hover:bg-slate-400/80 active:bg-slate-400",
|
|
1129
|
+
a
|
|
1130
|
+
);
|
|
1131
|
+
return /* @__PURE__ */ T("div", { ref: i, id: s, className: R("relative overflow-hidden", r), "data-scroll-area-root": "", ...u, children: [
|
|
1132
|
+
/* @__PURE__ */ c(
|
|
1133
|
+
"div",
|
|
1134
|
+
{
|
|
1135
|
+
ref: d,
|
|
1136
|
+
className: R(
|
|
1137
|
+
"h-full w-full overflow-auto rounded-[inherit] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
1138
|
+
t
|
|
1139
|
+
),
|
|
1140
|
+
onScroll: h,
|
|
1141
|
+
"data-scroll-area-viewport": "",
|
|
1142
|
+
children: o
|
|
1143
|
+
}
|
|
1144
|
+
),
|
|
1145
|
+
v.vertical && (b || m) && /* @__PURE__ */ c(
|
|
1146
|
+
"div",
|
|
1147
|
+
{
|
|
1148
|
+
className: R(
|
|
1149
|
+
"touch-none select-none transition-all duration-300",
|
|
1150
|
+
"p-[1px]",
|
|
1151
|
+
"absolute right-0 top-0",
|
|
1152
|
+
m ? "opacity-0" : "opacity-100",
|
|
1153
|
+
n
|
|
1154
|
+
),
|
|
1155
|
+
"data-scroll-area-scrollbar": "vertical",
|
|
1156
|
+
"data-state": b ? "visible" : "hidden",
|
|
1157
|
+
style: {
|
|
1158
|
+
width: `${e}px`,
|
|
1159
|
+
height: v.horizontal ? `calc(100% - ${e}px)` : "100%"
|
|
1160
|
+
},
|
|
1161
|
+
children: /* @__PURE__ */ c(
|
|
1162
|
+
"div",
|
|
1163
|
+
{
|
|
1164
|
+
ref: f,
|
|
1165
|
+
className: R("absolute rounded-full", p),
|
|
1166
|
+
"data-scroll-area-thumb": "",
|
|
1167
|
+
style: { height: "20%", top: "0%", width: "100%" }
|
|
1168
|
+
}
|
|
1169
|
+
)
|
|
1170
|
+
}
|
|
1171
|
+
),
|
|
1172
|
+
v.horizontal && (b || m) && /* @__PURE__ */ c(
|
|
1173
|
+
"div",
|
|
1174
|
+
{
|
|
1175
|
+
className: R(
|
|
1176
|
+
"touch-none select-none transition-all duration-300",
|
|
1177
|
+
"p-[1px]",
|
|
1178
|
+
"absolute bottom-0 left-0",
|
|
1179
|
+
m ? "opacity-0" : "opacity-100",
|
|
1180
|
+
n
|
|
1181
|
+
),
|
|
1182
|
+
"data-scroll-area-scrollbar": "horizontal",
|
|
1183
|
+
"data-state": b ? "visible" : "hidden",
|
|
1184
|
+
style: {
|
|
1185
|
+
height: `${e}px`,
|
|
1186
|
+
width: v.vertical ? `calc(100% - ${e}px)` : "100%"
|
|
1187
|
+
},
|
|
1188
|
+
children: /* @__PURE__ */ c(
|
|
1189
|
+
"div",
|
|
1190
|
+
{
|
|
1191
|
+
ref: l,
|
|
1192
|
+
className: R("absolute rounded-full", p),
|
|
1193
|
+
"data-scroll-area-thumb": "",
|
|
1194
|
+
style: { width: "20%", left: "0%", height: "100%" }
|
|
1195
|
+
}
|
|
1196
|
+
)
|
|
1197
|
+
}
|
|
1198
|
+
),
|
|
1199
|
+
v.vertical && v.horizontal && /* @__PURE__ */ c(
|
|
1200
|
+
"div",
|
|
1201
|
+
{
|
|
1202
|
+
className: R("bg-transparent", "absolute bottom-0 right-0"),
|
|
1203
|
+
"data-scroll-area-corner": "",
|
|
1204
|
+
style: {
|
|
1205
|
+
height: `${e}px`,
|
|
1206
|
+
width: `${e}px`
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
)
|
|
1210
|
+
] });
|
|
1211
|
+
}
|
|
1212
|
+
function Ye(r) {
|
|
1213
|
+
const [a, t] = k(!1), [n, e] = k(!1);
|
|
1214
|
+
return $(() => {
|
|
1215
|
+
r ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 150));
|
|
1216
|
+
}, [r]), { show: a, shouldRender: n };
|
|
1217
|
+
}
|
|
1218
|
+
function Oe({
|
|
1219
|
+
isOpen: r,
|
|
1220
|
+
setIsOpen: a,
|
|
1221
|
+
filteredOptions: t,
|
|
1222
|
+
highlightedIndex: n,
|
|
1223
|
+
setHighlightedIndex: e,
|
|
1224
|
+
onSelect: o,
|
|
1225
|
+
triggerRef: s
|
|
1226
|
+
}) {
|
|
1227
|
+
return { handleKeyDown: C(
|
|
1228
|
+
(u) => {
|
|
1229
|
+
var d;
|
|
1230
|
+
switch (u.key) {
|
|
1231
|
+
case "ArrowDown":
|
|
1232
|
+
if (u.preventDefault(), !r)
|
|
1233
|
+
a(!0);
|
|
1234
|
+
else {
|
|
1235
|
+
const f = n < t.length - 1 ? n + 1 : 0;
|
|
1236
|
+
let l = f;
|
|
1237
|
+
for (let b = 0; b < t.length; b++) {
|
|
1238
|
+
const m = (f + b) % t.length;
|
|
1239
|
+
if (!t[m].disabled) {
|
|
1240
|
+
l = m;
|
|
1241
|
+
break;
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
e(l);
|
|
1245
|
+
}
|
|
1246
|
+
break;
|
|
1247
|
+
case "ArrowUp":
|
|
1248
|
+
if (u.preventDefault(), !r)
|
|
1249
|
+
a(!0);
|
|
1250
|
+
else {
|
|
1251
|
+
const f = n > 0 ? n - 1 : t.length - 1;
|
|
1252
|
+
let l = f;
|
|
1253
|
+
for (let b = 0; b < t.length; b++) {
|
|
1254
|
+
const m = (f - b + t.length) % t.length;
|
|
1255
|
+
if (!t[m].disabled) {
|
|
1256
|
+
l = m;
|
|
1257
|
+
break;
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
e(l);
|
|
1261
|
+
}
|
|
1262
|
+
break;
|
|
1263
|
+
case "Enter":
|
|
1264
|
+
case " ":
|
|
1265
|
+
if (u.preventDefault(), !r)
|
|
1266
|
+
a(!0);
|
|
1267
|
+
else if (n >= 0 && n < t.length) {
|
|
1268
|
+
const f = t[n];
|
|
1269
|
+
f.disabled || o(f);
|
|
1270
|
+
}
|
|
1271
|
+
break;
|
|
1272
|
+
case "Escape":
|
|
1273
|
+
u.preventDefault(), r && (a(!1), (d = s.current) == null || d.focus());
|
|
1274
|
+
break;
|
|
1275
|
+
case "Tab":
|
|
1276
|
+
r && a(!1);
|
|
1277
|
+
break;
|
|
1278
|
+
}
|
|
1279
|
+
},
|
|
1280
|
+
[r, a, t, n, e, o, s]
|
|
1281
|
+
) };
|
|
1282
|
+
}
|
|
1283
|
+
function et({
|
|
1284
|
+
isOpen: r,
|
|
1285
|
+
filteredOptions: a,
|
|
1286
|
+
selectedOption: t,
|
|
1287
|
+
shouldRender: n,
|
|
1288
|
+
optionsContainerRef: e
|
|
1289
|
+
}) {
|
|
1290
|
+
const [o, s] = k(-1), i = Q(() => t ? a.findIndex((u) => u.value === t.value) : -1, [a, t]);
|
|
1291
|
+
return $(() => {
|
|
1292
|
+
r && a.length > 0 ? s(t && i >= 0 ? i : 0) : s(-1);
|
|
1293
|
+
}, [a, r, t, i]), $(() => {
|
|
1294
|
+
if (o >= 0 && e.current && n) {
|
|
1295
|
+
const u = () => {
|
|
1296
|
+
const d = e.current, f = d == null ? void 0 : d.querySelector(`[data-option-index="${o}"]`);
|
|
1297
|
+
if (f) {
|
|
1298
|
+
const l = r && t && o === i ? "auto" : "smooth";
|
|
1299
|
+
f.scrollIntoView({
|
|
1300
|
+
behavior: l,
|
|
1301
|
+
block: "nearest"
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
};
|
|
1305
|
+
r && n && t ? setTimeout(u, 10) : u();
|
|
1306
|
+
}
|
|
1307
|
+
}, [o, n, r, t, a, e, i]), { highlightedIndex: o, setHighlightedIndex: s };
|
|
1308
|
+
}
|
|
1309
|
+
const ce = {
|
|
1310
|
+
sm: {
|
|
1311
|
+
trigger: "px-2 py-1 text-sm",
|
|
1312
|
+
options: "px-2 py-2 text-xs"
|
|
1313
|
+
},
|
|
1314
|
+
md: {
|
|
1315
|
+
trigger: "px-3 py-2 text-base",
|
|
1316
|
+
options: "px-3 py-2.5 text-sm"
|
|
1317
|
+
},
|
|
1318
|
+
lg: {
|
|
1319
|
+
trigger: "px-4 py-3 text-lg",
|
|
1320
|
+
options: "px-4 py-3 text-base"
|
|
1321
|
+
}
|
|
1322
|
+
};
|
|
1323
|
+
function zt({
|
|
1324
|
+
options: r,
|
|
1325
|
+
value: a,
|
|
1326
|
+
placeholder: t = "Select an option...",
|
|
1327
|
+
searchable: n = !1,
|
|
1328
|
+
disabled: e = !1,
|
|
1329
|
+
clearable: o = !1,
|
|
1330
|
+
size: s = "md",
|
|
1331
|
+
className: i,
|
|
1332
|
+
triggerClassName: u,
|
|
1333
|
+
dropdownClassName: d,
|
|
1334
|
+
id: f,
|
|
1335
|
+
ref: l,
|
|
1336
|
+
onChange: b,
|
|
1337
|
+
onSearch: m,
|
|
1338
|
+
searchPlaceholder: v = "Search options..."
|
|
1339
|
+
}) {
|
|
1340
|
+
const h = F(), y = `${f ?? h}-listbox`, g = (A) => `${y}-option-${A}`, [w, N] = k(!1), [E, L] = k(""), I = V(null), S = V(null), K = V(null), P = V(null), { show: X, shouldRender: j } = Ye(w), D = Q(() => !n || !E ? r : r.filter(
|
|
1341
|
+
(A) => {
|
|
1342
|
+
var H;
|
|
1343
|
+
return A.text.toLowerCase().includes(E.toLowerCase()) || ((H = A.description) == null ? void 0 : H.toLowerCase().includes(E.toLowerCase()));
|
|
1344
|
+
}
|
|
1345
|
+
), [r, n, E]), z = Q(() => r.find((A) => A.value === a), [r, a]), { highlightedIndex: B, setHighlightedIndex: G } = et({
|
|
1346
|
+
isOpen: w,
|
|
1347
|
+
filteredOptions: D,
|
|
1348
|
+
selectedOption: z,
|
|
1349
|
+
shouldRender: j,
|
|
1350
|
+
optionsContainerRef: P
|
|
1351
|
+
}), U = B >= 0 ? g(B) : void 0;
|
|
1352
|
+
$(() => {
|
|
1353
|
+
w && j && n && S.current && S.current.focus();
|
|
1354
|
+
}, [w, n, j]);
|
|
1355
|
+
const _ = C(
|
|
1356
|
+
(A) => {
|
|
1357
|
+
var H;
|
|
1358
|
+
A.disabled || (b == null || b(A.value), N(!1), L(""), (H = I.current) == null || H.focus());
|
|
1359
|
+
},
|
|
1360
|
+
[b]
|
|
1361
|
+
), { handleKeyDown: q } = Oe({
|
|
1362
|
+
isOpen: w,
|
|
1363
|
+
setIsOpen: N,
|
|
1364
|
+
filteredOptions: D,
|
|
1365
|
+
highlightedIndex: B,
|
|
1366
|
+
setHighlightedIndex: G,
|
|
1367
|
+
onSelect: _,
|
|
1368
|
+
triggerRef: I
|
|
1369
|
+
});
|
|
1370
|
+
$(() => {
|
|
1371
|
+
if (!w)
|
|
1372
|
+
return;
|
|
1373
|
+
const A = (H) => {
|
|
1374
|
+
var ie;
|
|
1375
|
+
K.current && !K.current.contains(H.target) && !((ie = I.current) != null && ie.contains(H.target)) && (N(!1), L(""));
|
|
1376
|
+
};
|
|
1377
|
+
return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
|
|
1378
|
+
}, [w]);
|
|
1379
|
+
const O = () => {
|
|
1380
|
+
e || (N(!w), w || (L(""), G(-1)));
|
|
1381
|
+
}, pe = (A) => {
|
|
1382
|
+
A.disabled || (b == null || b(A.value), N(!1), L(""));
|
|
1383
|
+
}, ge = (A) => {
|
|
1384
|
+
const H = A.target.value;
|
|
1385
|
+
L(H), m == null || m(H), G(-1);
|
|
1386
|
+
}, ye = (A) => {
|
|
1387
|
+
A.preventDefault(), A.stopPropagation(), b == null || b("");
|
|
1388
|
+
};
|
|
1389
|
+
return /* @__PURE__ */ T(
|
|
1390
|
+
"div",
|
|
1391
|
+
{
|
|
1392
|
+
className: x("relative", i),
|
|
1393
|
+
id: f,
|
|
1394
|
+
ref: l,
|
|
1395
|
+
"data-select": "true",
|
|
1396
|
+
"data-value": a,
|
|
1397
|
+
"data-searchable": n,
|
|
1398
|
+
"data-disabled": e,
|
|
1399
|
+
"data-clearable": o,
|
|
1400
|
+
children: [
|
|
1401
|
+
/* @__PURE__ */ T(
|
|
1402
|
+
"button",
|
|
1403
|
+
{
|
|
1404
|
+
ref: I,
|
|
1405
|
+
type: "button",
|
|
1406
|
+
className: x(
|
|
1407
|
+
"flex items-center justify-between w-full text-left bg-inherit border border-border rounded-md transition-colors",
|
|
1408
|
+
"hover:border-primary focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary",
|
|
1409
|
+
e && "opacity-50 cursor-not-allowed hover:border-border",
|
|
1410
|
+
w && "border-primary ring-1 ring-primary",
|
|
1411
|
+
ce[s].trigger,
|
|
1412
|
+
u
|
|
1413
|
+
),
|
|
1414
|
+
onClick: O,
|
|
1415
|
+
onKeyDown: q,
|
|
1416
|
+
disabled: e,
|
|
1417
|
+
"aria-disabled": e,
|
|
1418
|
+
"aria-haspopup": "listbox",
|
|
1419
|
+
"aria-expanded": w,
|
|
1420
|
+
"aria-controls": w ? y : void 0,
|
|
1421
|
+
"aria-activedescendant": w && !n ? U : void 0,
|
|
1422
|
+
"aria-label": z ? z.text : t,
|
|
1423
|
+
"data-select-trigger": "true",
|
|
1424
|
+
children: [
|
|
1425
|
+
/* @__PURE__ */ c("span", { className: x("block truncate", !z && "opacity-70"), children: z ? z.text : t }),
|
|
1426
|
+
/* @__PURE__ */ T("div", { className: "flex items-center ml-2", children: [
|
|
1427
|
+
o && z && /* @__PURE__ */ c(
|
|
1428
|
+
"button",
|
|
1429
|
+
{
|
|
1430
|
+
type: "button",
|
|
1431
|
+
onClick: ye,
|
|
1432
|
+
className: "p-0.5 rounded hover:bg-accent/20 transition-colors mr-1 group",
|
|
1433
|
+
"aria-label": "Clear selection",
|
|
1434
|
+
"data-select-clear": "true",
|
|
1435
|
+
children: /* @__PURE__ */ c(oe, { size: 14, className: "opacity-70 group-hover:opacity-100 transition-opacity" })
|
|
1436
|
+
}
|
|
1437
|
+
),
|
|
1438
|
+
/* @__PURE__ */ c(he, { size: 16, className: x("transition-transform duration-200", w && "rotate-180") })
|
|
1439
|
+
] })
|
|
1440
|
+
]
|
|
1441
|
+
}
|
|
1442
|
+
),
|
|
1443
|
+
j && /* @__PURE__ */ T(
|
|
1444
|
+
"div",
|
|
1445
|
+
{
|
|
1446
|
+
ref: K,
|
|
1447
|
+
className: x(
|
|
1448
|
+
"absolute z-50 w-full mt-1 bg-popover border border-border rounded-md shadow-lg transition-all duration-150",
|
|
1449
|
+
X ? "opacity-100 translate-y-0" : "opacity-0 -translate-y-2",
|
|
1450
|
+
d
|
|
1451
|
+
),
|
|
1452
|
+
id: y,
|
|
1453
|
+
role: "listbox",
|
|
1454
|
+
"data-select-content": "true",
|
|
1455
|
+
children: [
|
|
1456
|
+
n && /* @__PURE__ */ c("div", { className: "border-b border-border", children: /* @__PURE__ */ c(
|
|
1457
|
+
"input",
|
|
1458
|
+
{
|
|
1459
|
+
ref: S,
|
|
1460
|
+
type: "text",
|
|
1461
|
+
value: E,
|
|
1462
|
+
onChange: ge,
|
|
1463
|
+
onKeyDown: q,
|
|
1464
|
+
placeholder: v,
|
|
1465
|
+
className: "w-full px-2 py-2 text-inherit focus:outline-none",
|
|
1466
|
+
"aria-autocomplete": "list",
|
|
1467
|
+
"aria-controls": y,
|
|
1468
|
+
"aria-activedescendant": U,
|
|
1469
|
+
"data-select-search": "true"
|
|
1470
|
+
}
|
|
1471
|
+
) }),
|
|
1472
|
+
/* @__PURE__ */ c("div", { ref: P, className: "max-h-60 overflow-auto", children: D.length > 0 ? D.map((A, H) => /* @__PURE__ */ T(
|
|
1473
|
+
"div",
|
|
1474
|
+
{
|
|
1475
|
+
id: g(H),
|
|
1476
|
+
className: x(
|
|
1477
|
+
"flex items-center cursor-pointer transition-colors",
|
|
1478
|
+
"hover:bg-accent/10 focus:bg-accent/10",
|
|
1479
|
+
ce[s].options,
|
|
1480
|
+
A.disabled && "opacity-50 cursor-not-allowed",
|
|
1481
|
+
H === B && "bg-accent/20",
|
|
1482
|
+
a === A.value && "bg-accent/30"
|
|
1483
|
+
),
|
|
1484
|
+
onClick: () => pe(A),
|
|
1485
|
+
role: "option",
|
|
1486
|
+
"aria-selected": a === A.value,
|
|
1487
|
+
"aria-disabled": A.disabled,
|
|
1488
|
+
"data-select-option": "true",
|
|
1489
|
+
"data-value": A.value,
|
|
1490
|
+
"data-highlighted": H === B,
|
|
1491
|
+
"data-option-index": H,
|
|
1492
|
+
children: [
|
|
1493
|
+
/* @__PURE__ */ T("div", { className: "flex-1 min-w-0", children: [
|
|
1494
|
+
/* @__PURE__ */ c("div", { className: "font-medium", children: A.text }),
|
|
1495
|
+
A.description && /* @__PURE__ */ c("div", { className: "text-xs opacity-70 mt-0.5", children: A.description })
|
|
1496
|
+
] }),
|
|
1497
|
+
a === A.value && /* @__PURE__ */ c(ve, { size: 16, className: "ml-2 text-primary flex-shrink-0" })
|
|
1498
|
+
]
|
|
1499
|
+
},
|
|
1500
|
+
A.value
|
|
1501
|
+
)) : /* @__PURE__ */ c("div", { className: "px-3 py-2 text-sm opacity-70 text-center", children: n && E ? "No results found" : "No options available" }) })
|
|
1502
|
+
]
|
|
1503
|
+
}
|
|
1504
|
+
)
|
|
1505
|
+
]
|
|
1506
|
+
}
|
|
1507
|
+
);
|
|
1508
|
+
}
|
|
1509
|
+
const tt = {
|
|
1058
1510
|
thin: {
|
|
1059
1511
|
horizontal: "h-px",
|
|
1060
1512
|
vertical: "w-px"
|
|
@@ -1071,37 +1523,37 @@ const Ke = {
|
|
|
1071
1523
|
horizontal: "h-2",
|
|
1072
1524
|
vertical: "w-2"
|
|
1073
1525
|
}
|
|
1074
|
-
},
|
|
1526
|
+
}, rt = {
|
|
1075
1527
|
horizontal: "w-full",
|
|
1076
1528
|
vertical: "min-h-4 h-full"
|
|
1077
1529
|
};
|
|
1078
|
-
function
|
|
1079
|
-
orientation:
|
|
1080
|
-
decorative:
|
|
1530
|
+
function Rt({
|
|
1531
|
+
orientation: r = "horizontal",
|
|
1532
|
+
decorative: a = !1,
|
|
1081
1533
|
thickness: t = "thin",
|
|
1082
|
-
className:
|
|
1534
|
+
className: n,
|
|
1083
1535
|
...e
|
|
1084
1536
|
}) {
|
|
1085
|
-
const
|
|
1537
|
+
const o = x(
|
|
1086
1538
|
"shrink-0 bg-border",
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1539
|
+
rt[r],
|
|
1540
|
+
tt[t][r],
|
|
1541
|
+
n
|
|
1090
1542
|
);
|
|
1091
1543
|
return /* @__PURE__ */ c(
|
|
1092
1544
|
"div",
|
|
1093
1545
|
{
|
|
1094
1546
|
...e,
|
|
1095
|
-
className:
|
|
1096
|
-
role:
|
|
1097
|
-
"aria-orientation":
|
|
1098
|
-
"aria-hidden":
|
|
1099
|
-
"data-orientation":
|
|
1547
|
+
className: o,
|
|
1548
|
+
role: a ? "presentation" : "separator",
|
|
1549
|
+
"aria-orientation": a ? void 0 : r,
|
|
1550
|
+
"aria-hidden": a,
|
|
1551
|
+
"data-orientation": r,
|
|
1100
1552
|
"data-thickness": t
|
|
1101
1553
|
}
|
|
1102
1554
|
);
|
|
1103
1555
|
}
|
|
1104
|
-
const
|
|
1556
|
+
const ue = {
|
|
1105
1557
|
shape: {
|
|
1106
1558
|
rectangle: "rounded-md min-h-1",
|
|
1107
1559
|
circle: "rounded-full aspect-square min-h-1",
|
|
@@ -1115,35 +1567,35 @@ const ae = {
|
|
|
1115
1567
|
xl: "space-y-6"
|
|
1116
1568
|
}
|
|
1117
1569
|
};
|
|
1118
|
-
function
|
|
1119
|
-
shape:
|
|
1120
|
-
lineSpacing:
|
|
1570
|
+
function St({
|
|
1571
|
+
shape: r = "rectangle",
|
|
1572
|
+
lineSpacing: a = "sm",
|
|
1121
1573
|
className: t,
|
|
1122
|
-
lines:
|
|
1574
|
+
lines: n = 1,
|
|
1123
1575
|
animate: e = !0,
|
|
1124
|
-
ref:
|
|
1576
|
+
ref: o,
|
|
1125
1577
|
...s
|
|
1126
1578
|
}) {
|
|
1127
|
-
const i =
|
|
1128
|
-
return
|
|
1579
|
+
const i = x("bg-muted/70", e && "animate-pulse", ue.shape[r], t);
|
|
1580
|
+
return n > 1 ? /* @__PURE__ */ c(
|
|
1129
1581
|
"div",
|
|
1130
1582
|
{
|
|
1131
|
-
ref:
|
|
1132
|
-
className:
|
|
1583
|
+
ref: o,
|
|
1584
|
+
className: ue.lineSpacing[a],
|
|
1133
1585
|
role: "presentation",
|
|
1134
1586
|
"aria-hidden": "true",
|
|
1135
1587
|
"data-testid": "skeleton-container",
|
|
1136
|
-
"data-lines":
|
|
1137
|
-
"data-shape":
|
|
1588
|
+
"data-lines": n,
|
|
1589
|
+
"data-shape": r,
|
|
1138
1590
|
"data-animate": e,
|
|
1139
1591
|
...s,
|
|
1140
|
-
children: Array.from({ length:
|
|
1592
|
+
children: Array.from({ length: n }, (u, d) => /* @__PURE__ */ c(
|
|
1141
1593
|
"div",
|
|
1142
1594
|
{
|
|
1143
|
-
className:
|
|
1595
|
+
className: x(
|
|
1144
1596
|
i,
|
|
1145
1597
|
// Make last line shorter for a more natural text appearance
|
|
1146
|
-
d ===
|
|
1598
|
+
d === n - 1 && "w-3/4"
|
|
1147
1599
|
),
|
|
1148
1600
|
role: "presentation",
|
|
1149
1601
|
"aria-hidden": "true",
|
|
@@ -1156,179 +1608,179 @@ function wt({
|
|
|
1156
1608
|
) : /* @__PURE__ */ c(
|
|
1157
1609
|
"div",
|
|
1158
1610
|
{
|
|
1159
|
-
ref:
|
|
1611
|
+
ref: o,
|
|
1160
1612
|
className: i,
|
|
1161
1613
|
role: "presentation",
|
|
1162
1614
|
"aria-hidden": "true",
|
|
1163
1615
|
"data-testid": "skeleton",
|
|
1164
|
-
"data-shape":
|
|
1616
|
+
"data-shape": r,
|
|
1165
1617
|
"data-animate": e,
|
|
1166
1618
|
...s
|
|
1167
1619
|
}
|
|
1168
1620
|
);
|
|
1169
1621
|
}
|
|
1170
|
-
function
|
|
1171
|
-
id:
|
|
1172
|
-
value:
|
|
1622
|
+
function Lt({
|
|
1623
|
+
id: r,
|
|
1624
|
+
value: a,
|
|
1173
1625
|
defaultValue: t = 0,
|
|
1174
|
-
onValueChange:
|
|
1626
|
+
onValueChange: n,
|
|
1175
1627
|
min: e = 0,
|
|
1176
|
-
max:
|
|
1628
|
+
max: o = 100,
|
|
1177
1629
|
step: s = 1,
|
|
1178
1630
|
disabled: i = !1,
|
|
1179
1631
|
trackClassName: u,
|
|
1180
1632
|
rangeClassName: d,
|
|
1181
|
-
thumbClassName:
|
|
1633
|
+
thumbClassName: f,
|
|
1182
1634
|
className: l,
|
|
1183
|
-
ref:
|
|
1184
|
-
ariaLabel:
|
|
1185
|
-
ariaLabelledBy:
|
|
1186
|
-
...
|
|
1635
|
+
ref: b,
|
|
1636
|
+
ariaLabel: m,
|
|
1637
|
+
ariaLabelledBy: v,
|
|
1638
|
+
...h
|
|
1187
1639
|
}) {
|
|
1188
|
-
const [
|
|
1189
|
-
(
|
|
1190
|
-
const
|
|
1191
|
-
|
|
1640
|
+
const [p, y] = k(t), g = a !== void 0, w = g ? a : p, N = V(null), E = V(!1), L = V(0), I = C(
|
|
1641
|
+
(D) => {
|
|
1642
|
+
const z = Math.max(e, Math.min(o, D)), B = Math.round(z / s) * s;
|
|
1643
|
+
g || y(B), n == null || n(B);
|
|
1192
1644
|
},
|
|
1193
|
-
[e,
|
|
1194
|
-
),
|
|
1195
|
-
(
|
|
1196
|
-
var
|
|
1197
|
-
const B = (
|
|
1198
|
-
if (!B) return
|
|
1199
|
-
let
|
|
1200
|
-
|
|
1201
|
-
const
|
|
1202
|
-
return e + (
|
|
1645
|
+
[e, o, s, g, n]
|
|
1646
|
+
), S = C(
|
|
1647
|
+
(D, z = !1) => {
|
|
1648
|
+
var _;
|
|
1649
|
+
const B = (_ = N.current) == null ? void 0 : _.getBoundingClientRect();
|
|
1650
|
+
if (!B) return w;
|
|
1651
|
+
let G = D.clientX;
|
|
1652
|
+
z && (G = G - L.current);
|
|
1653
|
+
const U = Math.max(0, Math.min(1, (G - B.left) / B.width));
|
|
1654
|
+
return e + (o - e) * U;
|
|
1203
1655
|
},
|
|
1204
|
-
[e,
|
|
1205
|
-
),
|
|
1206
|
-
(
|
|
1207
|
-
if (i ||
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1656
|
+
[e, o, w]
|
|
1657
|
+
), K = C(
|
|
1658
|
+
(D) => {
|
|
1659
|
+
if (i || D.target !== D.currentTarget) return;
|
|
1660
|
+
const z = S(D);
|
|
1661
|
+
I(z);
|
|
1210
1662
|
},
|
|
1211
|
-
[i,
|
|
1212
|
-
),
|
|
1213
|
-
(
|
|
1214
|
-
var
|
|
1663
|
+
[i, S, I]
|
|
1664
|
+
), P = C(
|
|
1665
|
+
(D) => {
|
|
1666
|
+
var _;
|
|
1215
1667
|
if (i) return;
|
|
1216
|
-
|
|
1217
|
-
const
|
|
1218
|
-
if (
|
|
1219
|
-
const
|
|
1220
|
-
|
|
1668
|
+
D.stopPropagation(), E.current = !0;
|
|
1669
|
+
const z = (_ = N.current) == null ? void 0 : _.getBoundingClientRect(), B = D.currentTarget.getBoundingClientRect();
|
|
1670
|
+
if (z && B) {
|
|
1671
|
+
const q = B.left + B.width / 2;
|
|
1672
|
+
L.current = D.clientX - q;
|
|
1221
1673
|
}
|
|
1222
|
-
|
|
1223
|
-
const
|
|
1674
|
+
D.currentTarget.setPointerCapture(D.pointerId);
|
|
1675
|
+
const G = (q) => {
|
|
1224
1676
|
if (!E.current) return;
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
-
},
|
|
1228
|
-
if (
|
|
1229
|
-
E.current = !1,
|
|
1677
|
+
const O = S(q, !0);
|
|
1678
|
+
I(O);
|
|
1679
|
+
}, U = (q) => {
|
|
1680
|
+
if (q.pointerId === D.pointerId) {
|
|
1681
|
+
E.current = !1, L.current = 0;
|
|
1230
1682
|
try {
|
|
1231
|
-
|
|
1683
|
+
D.currentTarget.releasePointerCapture(q.pointerId);
|
|
1232
1684
|
} catch {
|
|
1233
1685
|
}
|
|
1234
|
-
document.removeEventListener("pointermove",
|
|
1686
|
+
document.removeEventListener("pointermove", G), document.removeEventListener("pointerup", U);
|
|
1235
1687
|
}
|
|
1236
1688
|
};
|
|
1237
|
-
document.addEventListener("pointermove",
|
|
1689
|
+
document.addEventListener("pointermove", G), document.addEventListener("pointerup", U);
|
|
1238
1690
|
},
|
|
1239
|
-
[i,
|
|
1240
|
-
),
|
|
1241
|
-
(
|
|
1691
|
+
[i, S, I]
|
|
1692
|
+
), X = C(
|
|
1693
|
+
(D) => {
|
|
1242
1694
|
if (i) return;
|
|
1243
|
-
let
|
|
1244
|
-
switch (
|
|
1695
|
+
let z = w;
|
|
1696
|
+
switch (D.key) {
|
|
1245
1697
|
case "ArrowRight":
|
|
1246
1698
|
case "ArrowUp":
|
|
1247
|
-
|
|
1699
|
+
z = w + s;
|
|
1248
1700
|
break;
|
|
1249
1701
|
case "ArrowLeft":
|
|
1250
1702
|
case "ArrowDown":
|
|
1251
|
-
|
|
1703
|
+
z = w - s;
|
|
1252
1704
|
break;
|
|
1253
1705
|
case "Home":
|
|
1254
|
-
|
|
1706
|
+
z = e;
|
|
1255
1707
|
break;
|
|
1256
1708
|
case "End":
|
|
1257
|
-
|
|
1709
|
+
z = o;
|
|
1258
1710
|
break;
|
|
1259
1711
|
case "PageUp":
|
|
1260
|
-
|
|
1712
|
+
z = w + s * 10;
|
|
1261
1713
|
break;
|
|
1262
1714
|
case "PageDown":
|
|
1263
|
-
|
|
1715
|
+
z = w - s * 10;
|
|
1264
1716
|
break;
|
|
1265
1717
|
default:
|
|
1266
1718
|
return;
|
|
1267
1719
|
}
|
|
1268
|
-
|
|
1720
|
+
D.preventDefault(), I(z);
|
|
1269
1721
|
},
|
|
1270
|
-
[i,
|
|
1271
|
-
),
|
|
1722
|
+
[i, w, s, e, o, I]
|
|
1723
|
+
), j = o === e ? 0 : (w - e) / (o - e) * 100;
|
|
1272
1724
|
return /* @__PURE__ */ c(
|
|
1273
1725
|
"div",
|
|
1274
1726
|
{
|
|
1275
|
-
id:
|
|
1276
|
-
ref:
|
|
1277
|
-
className:
|
|
1727
|
+
id: r,
|
|
1728
|
+
ref: b,
|
|
1729
|
+
className: R(
|
|
1278
1730
|
"relative flex items-center w-full touch-none select-none",
|
|
1279
1731
|
i && "opacity-50 cursor-not-allowed",
|
|
1280
1732
|
l
|
|
1281
1733
|
),
|
|
1282
1734
|
"data-disabled": i,
|
|
1283
|
-
"data-value":
|
|
1735
|
+
"data-value": w,
|
|
1284
1736
|
"data-min": e,
|
|
1285
|
-
"data-max":
|
|
1737
|
+
"data-max": o,
|
|
1286
1738
|
"data-step": s,
|
|
1287
|
-
...
|
|
1288
|
-
children: /* @__PURE__ */
|
|
1739
|
+
...h,
|
|
1740
|
+
children: /* @__PURE__ */ T(
|
|
1289
1741
|
"div",
|
|
1290
1742
|
{
|
|
1291
1743
|
ref: N,
|
|
1292
|
-
className:
|
|
1744
|
+
className: R(
|
|
1293
1745
|
"relative h-1.5 w-full rounded-full bg-muted cursor-pointer",
|
|
1294
1746
|
i && "cursor-not-allowed",
|
|
1295
1747
|
u
|
|
1296
1748
|
),
|
|
1297
|
-
onPointerDown:
|
|
1749
|
+
onPointerDown: K,
|
|
1298
1750
|
children: [
|
|
1299
1751
|
/* @__PURE__ */ c(
|
|
1300
1752
|
"div",
|
|
1301
1753
|
{
|
|
1302
|
-
className:
|
|
1754
|
+
className: R(
|
|
1303
1755
|
"absolute h-full rounded-full pointer-events-none",
|
|
1304
1756
|
// pointer-events are disabled so that user interactions are handled by the track element, enabling correct slider behavior
|
|
1305
1757
|
!E.current && "transition-all",
|
|
1306
1758
|
d
|
|
1307
1759
|
),
|
|
1308
|
-
style: { width: `${
|
|
1760
|
+
style: { width: `${j}%` }
|
|
1309
1761
|
}
|
|
1310
1762
|
),
|
|
1311
1763
|
/* @__PURE__ */ c(
|
|
1312
1764
|
"div",
|
|
1313
1765
|
{
|
|
1314
|
-
className:
|
|
1766
|
+
className: R(
|
|
1315
1767
|
"absolute size-5 -top-2 rounded-full shadow-md cursor-grab",
|
|
1316
1768
|
i && "cursor-not-allowed",
|
|
1317
1769
|
!i && "cursor-grab focus:outline-none focus:ring-2",
|
|
1318
1770
|
E.current ? "cursor-grabbing scale-110" : "transition-all",
|
|
1319
|
-
|
|
1771
|
+
f
|
|
1320
1772
|
),
|
|
1321
|
-
style: { left: `calc(${
|
|
1773
|
+
style: { left: `calc(${j}% - 10px)` },
|
|
1322
1774
|
tabIndex: i ? -1 : 0,
|
|
1323
1775
|
role: "slider",
|
|
1324
1776
|
"aria-valuemin": e,
|
|
1325
|
-
"aria-valuemax":
|
|
1326
|
-
"aria-valuenow":
|
|
1327
|
-
"aria-label":
|
|
1328
|
-
"aria-labelledby":
|
|
1777
|
+
"aria-valuemax": o,
|
|
1778
|
+
"aria-valuenow": w,
|
|
1779
|
+
"aria-label": m,
|
|
1780
|
+
"aria-labelledby": v,
|
|
1329
1781
|
"aria-disabled": i,
|
|
1330
|
-
onKeyDown:
|
|
1331
|
-
onPointerDown:
|
|
1782
|
+
onKeyDown: X,
|
|
1783
|
+
onPointerDown: P
|
|
1332
1784
|
}
|
|
1333
1785
|
)
|
|
1334
1786
|
]
|
|
@@ -1337,72 +1789,72 @@ function xt({
|
|
|
1337
1789
|
}
|
|
1338
1790
|
);
|
|
1339
1791
|
}
|
|
1340
|
-
function
|
|
1341
|
-
if (
|
|
1342
|
-
let
|
|
1343
|
-
return
|
|
1344
|
-
...
|
|
1792
|
+
function Vt({ children: r, ref: a, ...t }) {
|
|
1793
|
+
if (we(r)) {
|
|
1794
|
+
let n = { ...t };
|
|
1795
|
+
return r.props && (n = { ...n, ...r.props }), xe(r, {
|
|
1796
|
+
...n,
|
|
1345
1797
|
ref: (e) => {
|
|
1346
|
-
typeof
|
|
1798
|
+
typeof a == "function" ? a(e) : a && (a.current = e);
|
|
1347
1799
|
}
|
|
1348
1800
|
});
|
|
1349
1801
|
}
|
|
1350
|
-
return
|
|
1802
|
+
return be("div", { ...t, ref: a }, r);
|
|
1351
1803
|
}
|
|
1352
|
-
const
|
|
1353
|
-
const [
|
|
1354
|
-
|
|
1355
|
-
}, [
|
|
1804
|
+
const nt = ({ defaultValue: r, value: a, onValueChange: t } = {}) => {
|
|
1805
|
+
const [n, e] = k(r || ""), o = a !== void 0, s = o ? a : n, i = C((u) => {
|
|
1806
|
+
o || e(u), t == null || t(u);
|
|
1807
|
+
}, [o, t]);
|
|
1356
1808
|
return {
|
|
1357
1809
|
value: s,
|
|
1358
1810
|
onValueChange: i
|
|
1359
1811
|
};
|
|
1360
1812
|
};
|
|
1361
|
-
function
|
|
1362
|
-
defaultValue:
|
|
1363
|
-
value:
|
|
1813
|
+
function Bt({
|
|
1814
|
+
defaultValue: r,
|
|
1815
|
+
value: a,
|
|
1364
1816
|
onValueChange: t,
|
|
1365
|
-
tabsWidth:
|
|
1817
|
+
tabsWidth: n = "fit",
|
|
1366
1818
|
variant: e = "underline",
|
|
1367
|
-
className:
|
|
1819
|
+
className: o,
|
|
1368
1820
|
children: s,
|
|
1369
1821
|
ref: i,
|
|
1370
1822
|
id: u,
|
|
1371
1823
|
triggersClassName: d,
|
|
1372
|
-
contentClassName:
|
|
1824
|
+
contentClassName: f
|
|
1373
1825
|
}) {
|
|
1374
|
-
const { value: l, onValueChange:
|
|
1375
|
-
defaultValue:
|
|
1376
|
-
value:
|
|
1826
|
+
const { value: l, onValueChange: b } = nt({
|
|
1827
|
+
defaultValue: r,
|
|
1828
|
+
value: a,
|
|
1377
1829
|
onValueChange: t
|
|
1378
|
-
}),
|
|
1830
|
+
}), m = {
|
|
1379
1831
|
selectedValue: l,
|
|
1380
|
-
onValueChange:
|
|
1381
|
-
tabsWidth:
|
|
1832
|
+
onValueChange: b,
|
|
1833
|
+
tabsWidth: n,
|
|
1382
1834
|
variant: e,
|
|
1383
1835
|
triggersClassName: d,
|
|
1384
|
-
contentClassName:
|
|
1836
|
+
contentClassName: f
|
|
1385
1837
|
};
|
|
1386
|
-
return /* @__PURE__ */ c(
|
|
1838
|
+
return /* @__PURE__ */ c(De.Provider, { value: m, children: /* @__PURE__ */ c("div", { id: u, ref: i, className: o, "data-tabs-width": n, "data-variant": e, children: s }) });
|
|
1387
1839
|
}
|
|
1388
|
-
function
|
|
1389
|
-
const { selectedValue: e, contentClassName:
|
|
1840
|
+
function Ht({ value: r, className: a, children: t, ref: n }) {
|
|
1841
|
+
const { selectedValue: e, contentClassName: o } = ae(), s = e === r;
|
|
1390
1842
|
return s ? /* @__PURE__ */ c(
|
|
1391
1843
|
"div",
|
|
1392
1844
|
{
|
|
1393
|
-
ref:
|
|
1845
|
+
ref: n,
|
|
1394
1846
|
role: "tabpanel",
|
|
1395
|
-
id: `tabs-content-${
|
|
1396
|
-
"aria-labelledby": `tabs-trigger-${
|
|
1847
|
+
id: `tabs-content-${r}`,
|
|
1848
|
+
"aria-labelledby": `tabs-trigger-${r}`,
|
|
1397
1849
|
"data-state": s ? "active" : "inactive",
|
|
1398
|
-
"data-value":
|
|
1399
|
-
className:
|
|
1850
|
+
"data-value": r,
|
|
1851
|
+
className: x("mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2", o, a),
|
|
1400
1852
|
tabIndex: 0,
|
|
1401
1853
|
children: t
|
|
1402
1854
|
}
|
|
1403
1855
|
) : null;
|
|
1404
1856
|
}
|
|
1405
|
-
const
|
|
1857
|
+
const de = {
|
|
1406
1858
|
width: {
|
|
1407
1859
|
fit: "w-fit",
|
|
1408
1860
|
full: "w-full *:flex-1"
|
|
@@ -1412,166 +1864,166 @@ const oe = {
|
|
|
1412
1864
|
pills: "",
|
|
1413
1865
|
bordered: "border border-border rounded-lg p-1"
|
|
1414
1866
|
}
|
|
1415
|
-
},
|
|
1867
|
+
}, at = {
|
|
1416
1868
|
underline: "border-b-2 border-transparent data-[state=active]:border-accent data-[state=active]:text-accent hover:text-accent-foreground",
|
|
1417
1869
|
pills: "rounded-md data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30",
|
|
1418
1870
|
bordered: "rounded data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30"
|
|
1419
1871
|
};
|
|
1420
|
-
function
|
|
1421
|
-
const { tabsWidth: e, variant:
|
|
1872
|
+
function Ft({ children: r, className: a, id: t, ref: n }) {
|
|
1873
|
+
const { tabsWidth: e, variant: o } = ae();
|
|
1422
1874
|
return /* @__PURE__ */ c(
|
|
1423
1875
|
"div",
|
|
1424
1876
|
{
|
|
1425
1877
|
id: t,
|
|
1426
|
-
ref:
|
|
1878
|
+
ref: n,
|
|
1427
1879
|
role: "tablist",
|
|
1428
|
-
className:
|
|
1880
|
+
className: x("flex", de.width[e], de.variant[o], a),
|
|
1429
1881
|
"data-tabs-width": e,
|
|
1430
|
-
"data-variant":
|
|
1431
|
-
children:
|
|
1882
|
+
"data-variant": o,
|
|
1883
|
+
children: r
|
|
1432
1884
|
}
|
|
1433
1885
|
);
|
|
1434
1886
|
}
|
|
1435
|
-
function
|
|
1436
|
-
const { selectedValue: i, onValueChange: u, variant: d, triggersClassName:
|
|
1437
|
-
|
|
1887
|
+
function jt({ value: r, disabled: a = !1, className: t, children: n, onClick: e, id: o, ref: s }) {
|
|
1888
|
+
const { selectedValue: i, onValueChange: u, variant: d, triggersClassName: f } = ae(), l = i === r, b = (v) => {
|
|
1889
|
+
a || u(r), e == null || e(v);
|
|
1438
1890
|
};
|
|
1439
1891
|
return /* @__PURE__ */ c(
|
|
1440
1892
|
"button",
|
|
1441
1893
|
{
|
|
1442
|
-
id:
|
|
1894
|
+
id: o,
|
|
1443
1895
|
ref: s,
|
|
1444
1896
|
role: "tab",
|
|
1445
1897
|
type: "button",
|
|
1446
1898
|
"aria-selected": l,
|
|
1447
|
-
"aria-controls": `tabs-content-${
|
|
1899
|
+
"aria-controls": `tabs-content-${r}`,
|
|
1448
1900
|
"data-state": l ? "active" : "inactive",
|
|
1449
|
-
"data-value":
|
|
1450
|
-
disabled:
|
|
1451
|
-
className:
|
|
1901
|
+
"data-value": r,
|
|
1902
|
+
disabled: a,
|
|
1903
|
+
className: x(
|
|
1452
1904
|
"inline-flex items-center justify-center whitespace-nowrap px-3 py-2 text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
1453
1905
|
l ? "font-medium" : "font-light",
|
|
1454
|
-
|
|
1455
|
-
|
|
1906
|
+
at[d],
|
|
1907
|
+
f,
|
|
1456
1908
|
t
|
|
1457
1909
|
),
|
|
1458
|
-
onClick:
|
|
1459
|
-
children:
|
|
1910
|
+
onClick: b,
|
|
1911
|
+
children: n
|
|
1460
1912
|
}
|
|
1461
1913
|
);
|
|
1462
1914
|
}
|
|
1463
|
-
function
|
|
1464
|
-
const [t,
|
|
1915
|
+
function ot({ elementId: r, maxLength: a }) {
|
|
1916
|
+
const [t, n] = k(0);
|
|
1465
1917
|
return $(() => {
|
|
1466
|
-
const e = document.getElementById(
|
|
1918
|
+
const e = document.getElementById(r);
|
|
1467
1919
|
if (!e)
|
|
1468
1920
|
return;
|
|
1469
|
-
const
|
|
1921
|
+
const o = () => {
|
|
1470
1922
|
const s = e.value.length;
|
|
1471
|
-
|
|
1472
|
-
const i = s >=
|
|
1473
|
-
e.setAttribute("aria-describedby", `${
|
|
1923
|
+
n(s);
|
|
1924
|
+
const i = s >= a;
|
|
1925
|
+
e.setAttribute("aria-describedby", `${r}-character-count`), e.setAttribute("aria-invalid", i ? "true" : "false"), i ? e.setAttribute("data-error", "true") : e.removeAttribute("data-error");
|
|
1474
1926
|
};
|
|
1475
|
-
return
|
|
1476
|
-
e.removeEventListener("input",
|
|
1927
|
+
return o(), e.addEventListener("input", o), e.setAttribute("maxlength", String(a)), () => {
|
|
1928
|
+
e.removeEventListener("input", o), e.removeAttribute("maxlength"), e.removeAttribute("aria-describedby"), e.removeAttribute("aria-invalid"), e.removeAttribute("data-error");
|
|
1477
1929
|
};
|
|
1478
|
-
}, [
|
|
1930
|
+
}, [r, a]), /* @__PURE__ */ c(
|
|
1479
1931
|
"small",
|
|
1480
1932
|
{
|
|
1481
|
-
className:
|
|
1933
|
+
className: x(
|
|
1482
1934
|
"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",
|
|
1483
|
-
t >=
|
|
1484
|
-
t <
|
|
1935
|
+
t >= a && "text-destructive",
|
|
1936
|
+
t < a && "text-current"
|
|
1485
1937
|
),
|
|
1486
1938
|
role: "status",
|
|
1487
|
-
children: /* @__PURE__ */
|
|
1939
|
+
children: /* @__PURE__ */ T("span", { id: `${r}-character-count`, children: [
|
|
1488
1940
|
t,
|
|
1489
1941
|
" / ",
|
|
1490
|
-
|
|
1942
|
+
a,
|
|
1491
1943
|
" characters"
|
|
1492
1944
|
] })
|
|
1493
1945
|
}
|
|
1494
1946
|
);
|
|
1495
1947
|
}
|
|
1496
|
-
function
|
|
1948
|
+
function st(r, a) {
|
|
1497
1949
|
$(() => {
|
|
1498
|
-
const t = document.getElementById(
|
|
1950
|
+
const t = document.getElementById(r);
|
|
1499
1951
|
if (!t)
|
|
1500
1952
|
return;
|
|
1501
|
-
if (!
|
|
1953
|
+
if (!a) {
|
|
1502
1954
|
t.style.height = "auto";
|
|
1503
1955
|
return;
|
|
1504
1956
|
}
|
|
1505
|
-
const
|
|
1957
|
+
const n = () => {
|
|
1506
1958
|
t.style.height = "auto", t.style.height = `${t.scrollHeight}px`;
|
|
1507
1959
|
};
|
|
1508
|
-
return
|
|
1509
|
-
t.removeEventListener("input",
|
|
1960
|
+
return n(), t.addEventListener("input", n), t.addEventListener("resize", n), window.addEventListener("resize", n), () => {
|
|
1961
|
+
t.removeEventListener("input", n), t.removeEventListener("resize", n), window.removeEventListener("resize", n);
|
|
1510
1962
|
};
|
|
1511
|
-
}, [
|
|
1963
|
+
}, [r, a]);
|
|
1512
1964
|
}
|
|
1513
|
-
const
|
|
1965
|
+
const it = {
|
|
1514
1966
|
base: "",
|
|
1515
1967
|
"left-line": "border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",
|
|
1516
1968
|
outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
|
|
1517
|
-
},
|
|
1969
|
+
}, lt = {
|
|
1518
1970
|
none: "rounded-none",
|
|
1519
1971
|
sm: "rounded-sm",
|
|
1520
1972
|
md: "rounded-md",
|
|
1521
1973
|
lg: "rounded-lg",
|
|
1522
1974
|
full: "px-3 rounded-full"
|
|
1523
|
-
},
|
|
1975
|
+
}, fe = {
|
|
1524
1976
|
variant: "outline",
|
|
1525
1977
|
rounded: "none"
|
|
1526
1978
|
};
|
|
1527
|
-
function
|
|
1528
|
-
variant:
|
|
1529
|
-
rounded:
|
|
1979
|
+
function Kt({
|
|
1980
|
+
variant: r = fe.variant,
|
|
1981
|
+
rounded: a,
|
|
1530
1982
|
displayOnlyMode: t = !1,
|
|
1531
|
-
errorMessage:
|
|
1983
|
+
errorMessage: n,
|
|
1532
1984
|
successMessage: e,
|
|
1533
|
-
hideResizeHandle:
|
|
1985
|
+
hideResizeHandle: o = !1,
|
|
1534
1986
|
autoExpand: s = !1,
|
|
1535
1987
|
characterLimit: i = 0,
|
|
1536
1988
|
className: u,
|
|
1537
1989
|
...d
|
|
1538
1990
|
}) {
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1541
|
-
let l =
|
|
1542
|
-
|
|
1543
|
-
let
|
|
1544
|
-
(t ||
|
|
1545
|
-
const
|
|
1991
|
+
const f = F();
|
|
1992
|
+
st(f, s || t);
|
|
1993
|
+
let l = a;
|
|
1994
|
+
r === "outline" && !a && (l = "md"), l = l || fe.rounded;
|
|
1995
|
+
let b = o;
|
|
1996
|
+
(t || r === "left-line" && !o) && (b = !0);
|
|
1997
|
+
const v = x(
|
|
1546
1998
|
"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
|
|
1547
|
-
!t &&
|
|
1548
|
-
!t &&
|
|
1999
|
+
!t && it[r],
|
|
2000
|
+
!t && lt[l],
|
|
1549
2001
|
!t && "px-2 py-1",
|
|
1550
2002
|
t && "pointer-events-none",
|
|
1551
|
-
|
|
2003
|
+
b && "no-resize-handle",
|
|
1552
2004
|
u
|
|
1553
2005
|
);
|
|
1554
|
-
return /* @__PURE__ */
|
|
2006
|
+
return /* @__PURE__ */ T("div", { className: x("-space-y-1.5", t && "cursor-text"), children: [
|
|
1555
2007
|
/* @__PURE__ */ c(
|
|
1556
2008
|
"textarea",
|
|
1557
2009
|
{
|
|
1558
2010
|
...d,
|
|
1559
|
-
id:
|
|
2011
|
+
id: f,
|
|
1560
2012
|
"aria-disabled": d.disabled,
|
|
1561
2013
|
readOnly: t,
|
|
1562
2014
|
"aria-readonly": t || d["aria-readonly"],
|
|
1563
2015
|
style: {
|
|
1564
2016
|
resize: s ? "none" : void 0
|
|
1565
2017
|
},
|
|
1566
|
-
className:
|
|
2018
|
+
className: v
|
|
1567
2019
|
}
|
|
1568
2020
|
),
|
|
1569
|
-
i > 0 && /* @__PURE__ */ c(
|
|
1570
|
-
!t && /* @__PURE__ */ c(
|
|
1571
|
-
!t && /* @__PURE__ */ c(
|
|
2021
|
+
i > 0 && /* @__PURE__ */ c(ot, { elementId: f, maxLength: i }),
|
|
2022
|
+
!t && /* @__PURE__ */ c(Y, { elementId: f, type: "error", message: n }),
|
|
2023
|
+
!t && /* @__PURE__ */ c(Y, { elementId: f, type: "success", message: e })
|
|
1572
2024
|
] });
|
|
1573
2025
|
}
|
|
1574
|
-
const
|
|
2026
|
+
const ct = {
|
|
1575
2027
|
sm: {
|
|
1576
2028
|
container: "h-5 min-w-9 w-9",
|
|
1577
2029
|
thumb: "h-4 w-4",
|
|
@@ -1587,7 +2039,7 @@ const Ye = {
|
|
|
1587
2039
|
thumb: "h-6 w-6",
|
|
1588
2040
|
translate: "translate-x-6"
|
|
1589
2041
|
}
|
|
1590
|
-
},
|
|
2042
|
+
}, ut = {
|
|
1591
2043
|
default: {
|
|
1592
2044
|
unchecked: "bg-muted",
|
|
1593
2045
|
checked: "bg-primary"
|
|
@@ -1600,273 +2052,273 @@ const Ye = {
|
|
|
1600
2052
|
unchecked: "bg-muted",
|
|
1601
2053
|
checked: "bg-destructive"
|
|
1602
2054
|
}
|
|
1603
|
-
},
|
|
2055
|
+
}, me = {
|
|
1604
2056
|
variant: "default",
|
|
1605
2057
|
size: "md"
|
|
1606
2058
|
};
|
|
1607
|
-
function
|
|
1608
|
-
ref:
|
|
1609
|
-
id:
|
|
1610
|
-
size: t =
|
|
1611
|
-
variant:
|
|
2059
|
+
function Pt({
|
|
2060
|
+
ref: r,
|
|
2061
|
+
id: a,
|
|
2062
|
+
size: t = me.size,
|
|
2063
|
+
variant: n = me.variant,
|
|
1612
2064
|
checked: e,
|
|
1613
|
-
onCheckedChange:
|
|
2065
|
+
onCheckedChange: o,
|
|
1614
2066
|
disabled: s = !1,
|
|
1615
2067
|
className: i,
|
|
1616
2068
|
thumbClassName: u,
|
|
1617
2069
|
backgroundClassNames: d,
|
|
1618
|
-
...
|
|
2070
|
+
...f
|
|
1619
2071
|
}) {
|
|
1620
|
-
const l =
|
|
2072
|
+
const l = F(), b = Q(() => a || `toggle-${l}`, [a, l]), [m, v] = k(e);
|
|
1621
2073
|
$(() => {
|
|
1622
|
-
|
|
2074
|
+
v(e);
|
|
1623
2075
|
}, [e]);
|
|
1624
|
-
const
|
|
2076
|
+
const h = () => {
|
|
1625
2077
|
if (!s) {
|
|
1626
|
-
const E = !
|
|
1627
|
-
e === void 0 &&
|
|
2078
|
+
const E = !m;
|
|
2079
|
+
e === void 0 && v(E), o == null || o(E);
|
|
1628
2080
|
}
|
|
1629
|
-
},
|
|
1630
|
-
(E.key === " " || E.key === "Enter") && (E.preventDefault(),
|
|
1631
|
-
}, y =
|
|
2081
|
+
}, p = (E) => {
|
|
2082
|
+
(E.key === " " || E.key === "Enter") && (E.preventDefault(), h());
|
|
2083
|
+
}, y = ct[t], g = ut[n], w = x(
|
|
1632
2084
|
// Base styles
|
|
1633
2085
|
"relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out",
|
|
1634
2086
|
"focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
1635
2087
|
// Size
|
|
1636
2088
|
y.container,
|
|
1637
2089
|
// Variant and state
|
|
1638
|
-
|
|
2090
|
+
m ? (d == null ? void 0 : d.checked) || g.checked : (d == null ? void 0 : d.unchecked) || g.unchecked,
|
|
1639
2091
|
// Disabled state
|
|
1640
2092
|
s && "opacity-50 cursor-not-allowed",
|
|
1641
2093
|
!s && "cursor-pointer",
|
|
1642
2094
|
i
|
|
1643
|
-
), N =
|
|
2095
|
+
), N = x(
|
|
1644
2096
|
// Base thumb styles
|
|
1645
2097
|
"absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out",
|
|
1646
2098
|
// Size
|
|
1647
2099
|
y.thumb,
|
|
1648
2100
|
// Position based on state
|
|
1649
|
-
|
|
2101
|
+
m && y.translate,
|
|
1650
2102
|
u
|
|
1651
2103
|
);
|
|
1652
|
-
return /* @__PURE__ */
|
|
2104
|
+
return /* @__PURE__ */ T(
|
|
1653
2105
|
"button",
|
|
1654
2106
|
{
|
|
1655
|
-
ref:
|
|
1656
|
-
id:
|
|
2107
|
+
ref: r,
|
|
2108
|
+
id: b,
|
|
1657
2109
|
type: "button",
|
|
1658
2110
|
role: "switch",
|
|
1659
2111
|
tabIndex: 0,
|
|
1660
|
-
"aria-checked":
|
|
2112
|
+
"aria-checked": m,
|
|
1661
2113
|
"aria-disabled": s,
|
|
1662
2114
|
disabled: s,
|
|
1663
|
-
onClick:
|
|
1664
|
-
onKeyDown:
|
|
1665
|
-
className:
|
|
1666
|
-
...
|
|
2115
|
+
onClick: h,
|
|
2116
|
+
onKeyDown: p,
|
|
2117
|
+
className: w,
|
|
2118
|
+
...f,
|
|
1667
2119
|
children: [
|
|
1668
2120
|
/* @__PURE__ */ c("span", { className: N }),
|
|
1669
|
-
/* @__PURE__ */ c("span", { className: "sr-only", children:
|
|
2121
|
+
/* @__PURE__ */ c("span", { className: "sr-only", children: m ? "Enabled" : "Disabled" })
|
|
1670
2122
|
]
|
|
1671
2123
|
}
|
|
1672
2124
|
);
|
|
1673
2125
|
}
|
|
1674
|
-
const
|
|
1675
|
-
function
|
|
1676
|
-
return { calculatePosition:
|
|
1677
|
-
(t,
|
|
1678
|
-
const e = t.getBoundingClientRect(),
|
|
2126
|
+
const Z = 8, J = 4, M = 6;
|
|
2127
|
+
function dt(r) {
|
|
2128
|
+
return { calculatePosition: C(
|
|
2129
|
+
(t, n) => {
|
|
2130
|
+
const e = t.getBoundingClientRect(), o = n.getBoundingClientRect(), s = {
|
|
1679
2131
|
width: window.innerWidth,
|
|
1680
2132
|
height: window.innerHeight
|
|
1681
|
-
}, i = (
|
|
2133
|
+
}, i = (b, m, v, h) => b < 0 || m < 0 || b + v > s.width || m + h > s.height, u = {
|
|
1682
2134
|
top: {
|
|
1683
|
-
x: e.left + e.width / 2 -
|
|
1684
|
-
y: e.top -
|
|
2135
|
+
x: e.left + e.width / 2 - o.width / 2,
|
|
2136
|
+
y: e.top - o.height - J,
|
|
1685
2137
|
arrow: {
|
|
1686
|
-
x:
|
|
1687
|
-
y:
|
|
2138
|
+
x: o.width / 2 - M,
|
|
2139
|
+
y: o.height
|
|
1688
2140
|
}
|
|
1689
2141
|
},
|
|
1690
2142
|
bottom: {
|
|
1691
|
-
x: e.left + e.width / 2 -
|
|
1692
|
-
y: e.bottom +
|
|
2143
|
+
x: e.left + e.width / 2 - o.width / 2,
|
|
2144
|
+
y: e.bottom + J,
|
|
1693
2145
|
arrow: {
|
|
1694
|
-
x:
|
|
2146
|
+
x: o.width / 2 - M,
|
|
1695
2147
|
y: -6
|
|
1696
2148
|
}
|
|
1697
2149
|
},
|
|
1698
2150
|
left: {
|
|
1699
|
-
x: e.left -
|
|
1700
|
-
y: e.top + e.height / 2 -
|
|
2151
|
+
x: e.left - o.width - J,
|
|
2152
|
+
y: e.top + e.height / 2 - o.height / 2,
|
|
1701
2153
|
arrow: {
|
|
1702
|
-
x:
|
|
1703
|
-
y:
|
|
2154
|
+
x: o.width,
|
|
2155
|
+
y: o.height / 2 - M
|
|
1704
2156
|
}
|
|
1705
2157
|
},
|
|
1706
2158
|
right: {
|
|
1707
|
-
x: e.right +
|
|
1708
|
-
y: e.top + e.height / 2 -
|
|
2159
|
+
x: e.right + J,
|
|
2160
|
+
y: e.top + e.height / 2 - o.height / 2,
|
|
1709
2161
|
arrow: {
|
|
1710
2162
|
x: -6,
|
|
1711
|
-
y:
|
|
2163
|
+
y: o.height / 2 - M
|
|
1712
2164
|
}
|
|
1713
2165
|
}
|
|
1714
2166
|
};
|
|
1715
|
-
let d =
|
|
1716
|
-
if (i(
|
|
1717
|
-
const
|
|
2167
|
+
let d = r, f = u[r];
|
|
2168
|
+
if (i(f.x, f.y, o.width, o.height)) {
|
|
2169
|
+
const b = {
|
|
1718
2170
|
top: "bottom",
|
|
1719
2171
|
bottom: "top",
|
|
1720
2172
|
left: "right",
|
|
1721
2173
|
right: "left"
|
|
1722
|
-
},
|
|
1723
|
-
if (!i(
|
|
1724
|
-
d =
|
|
2174
|
+
}, m = u[b[r]];
|
|
2175
|
+
if (!i(m.x, m.y, o.width, o.height))
|
|
2176
|
+
d = b[r], f = m;
|
|
1725
2177
|
else {
|
|
1726
|
-
const
|
|
1727
|
-
(
|
|
2178
|
+
const v = ["top", "bottom", "left", "right"].filter(
|
|
2179
|
+
(h) => h !== r && h !== b[r]
|
|
1728
2180
|
);
|
|
1729
|
-
for (const
|
|
1730
|
-
const
|
|
1731
|
-
if (!i(
|
|
1732
|
-
d =
|
|
2181
|
+
for (const h of v) {
|
|
2182
|
+
const p = u[h];
|
|
2183
|
+
if (!i(p.x, p.y, o.width, o.height)) {
|
|
2184
|
+
d = h, f = p;
|
|
1733
2185
|
break;
|
|
1734
2186
|
}
|
|
1735
2187
|
}
|
|
1736
2188
|
}
|
|
1737
2189
|
}
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
Math.min(
|
|
1741
|
-
),
|
|
1742
|
-
|
|
1743
|
-
Math.min(
|
|
2190
|
+
f.x = Math.max(
|
|
2191
|
+
Z,
|
|
2192
|
+
Math.min(f.x, s.width - o.width - Z)
|
|
2193
|
+
), f.y = Math.max(
|
|
2194
|
+
Z,
|
|
2195
|
+
Math.min(f.y, s.height - o.height - Z)
|
|
1744
2196
|
);
|
|
1745
2197
|
const l = {
|
|
1746
2198
|
x: e.left + e.width / 2,
|
|
1747
2199
|
y: e.top + e.height / 2
|
|
1748
2200
|
};
|
|
1749
|
-
return d === "top" || d === "bottom" ?
|
|
1750
|
-
|
|
1751
|
-
Math.min(l.x -
|
|
1752
|
-
) :
|
|
1753
|
-
|
|
1754
|
-
Math.min(l.y -
|
|
2201
|
+
return d === "top" || d === "bottom" ? f.arrow.x = Math.max(
|
|
2202
|
+
M,
|
|
2203
|
+
Math.min(l.x - f.x - M, o.width - M * 2)
|
|
2204
|
+
) : f.arrow.y = Math.max(
|
|
2205
|
+
M,
|
|
2206
|
+
Math.min(l.y - f.y - M, o.height - M * 2)
|
|
1755
2207
|
), {
|
|
1756
|
-
...
|
|
2208
|
+
...f,
|
|
1757
2209
|
placement: d
|
|
1758
2210
|
};
|
|
1759
2211
|
},
|
|
1760
|
-
[
|
|
2212
|
+
[r]
|
|
1761
2213
|
) };
|
|
1762
2214
|
}
|
|
1763
|
-
function
|
|
1764
|
-
const
|
|
1765
|
-
if (!
|
|
1766
|
-
const s = n
|
|
2215
|
+
function ft(r, a, t) {
|
|
2216
|
+
const n = V(null), e = V(null), o = C(() => {
|
|
2217
|
+
if (!n.current || !e.current) return;
|
|
2218
|
+
const s = r(n.current, e.current);
|
|
1767
2219
|
t(s);
|
|
1768
|
-
}, [
|
|
2220
|
+
}, [r, t]);
|
|
1769
2221
|
return $(() => {
|
|
1770
|
-
if (!
|
|
1771
|
-
const s = () =>
|
|
2222
|
+
if (!a) return;
|
|
2223
|
+
const s = () => o();
|
|
1772
2224
|
return window.addEventListener("resize", s), () => {
|
|
1773
2225
|
window.removeEventListener("resize", s);
|
|
1774
2226
|
};
|
|
1775
|
-
}, [
|
|
1776
|
-
triggerRef:
|
|
2227
|
+
}, [a, o]), {
|
|
2228
|
+
triggerRef: n,
|
|
1777
2229
|
tooltipRef: e,
|
|
1778
|
-
updatePosition:
|
|
2230
|
+
updatePosition: o
|
|
1779
2231
|
};
|
|
1780
2232
|
}
|
|
1781
|
-
function
|
|
1782
|
-
const d =
|
|
1783
|
-
|
|
2233
|
+
function mt(r, a, t, n, e, o, s, i, u) {
|
|
2234
|
+
const d = V(null), f = C(() => {
|
|
2235
|
+
r || (d.current && clearTimeout(d.current), d.current = window.setTimeout(() => {
|
|
1784
2236
|
t(!0), requestAnimationFrame(() => {
|
|
1785
|
-
e(),
|
|
2237
|
+
e(), n(!0);
|
|
1786
2238
|
});
|
|
1787
|
-
},
|
|
1788
|
-
}, [
|
|
1789
|
-
(
|
|
1790
|
-
if (d.current && clearTimeout(d.current),
|
|
1791
|
-
|
|
2239
|
+
}, a));
|
|
2240
|
+
}, [r, a, t, e, n]), l = C(
|
|
2241
|
+
(b = !1) => {
|
|
2242
|
+
if (d.current && clearTimeout(d.current), b) {
|
|
2243
|
+
n(!1), setTimeout(() => t(!1), 150);
|
|
1792
2244
|
return;
|
|
1793
2245
|
}
|
|
1794
2246
|
d.current = window.setTimeout(() => {
|
|
1795
|
-
|
|
2247
|
+
n(!1), setTimeout(() => t(!1), 150);
|
|
1796
2248
|
}, 100);
|
|
1797
2249
|
},
|
|
1798
|
-
[
|
|
2250
|
+
[n, t]
|
|
1799
2251
|
);
|
|
1800
2252
|
return $(() => {
|
|
1801
|
-
!
|
|
1802
|
-
}, [
|
|
2253
|
+
!o && !s && !i && u && l();
|
|
2254
|
+
}, [o, s, i, u, l]), $(() => () => {
|
|
1803
2255
|
d.current && clearTimeout(d.current);
|
|
1804
2256
|
}, []), {
|
|
1805
|
-
showTooltip:
|
|
2257
|
+
showTooltip: f,
|
|
1806
2258
|
hideTooltip: l,
|
|
1807
2259
|
timeoutRef: d
|
|
1808
2260
|
};
|
|
1809
2261
|
}
|
|
1810
|
-
function
|
|
1811
|
-
id:
|
|
1812
|
-
children:
|
|
2262
|
+
function Gt({
|
|
2263
|
+
id: r,
|
|
2264
|
+
children: a,
|
|
1813
2265
|
message: t,
|
|
1814
|
-
placement:
|
|
2266
|
+
placement: n = "top",
|
|
1815
2267
|
disabled: e = !1,
|
|
1816
|
-
delay:
|
|
2268
|
+
delay: o = 200,
|
|
1817
2269
|
className: s
|
|
1818
2270
|
}) {
|
|
1819
|
-
const [i, u] =
|
|
2271
|
+
const [i, u] = k(!1), [d, f] = k(!1), [l, b] = k(null), [m, v] = k(!1), [h, p] = k(!1), [y, g] = k(!1), { calculatePosition: w } = dt(n), { triggerRef: N, tooltipRef: E, updatePosition: L } = ft(w, d, b), { showTooltip: I, hideTooltip: S, timeoutRef: K } = mt(
|
|
1820
2272
|
e,
|
|
1821
|
-
|
|
1822
|
-
m,
|
|
1823
|
-
u,
|
|
1824
|
-
V,
|
|
2273
|
+
o,
|
|
1825
2274
|
f,
|
|
1826
|
-
|
|
2275
|
+
u,
|
|
2276
|
+
L,
|
|
2277
|
+
m,
|
|
2278
|
+
h,
|
|
1827
2279
|
y,
|
|
1828
2280
|
i
|
|
1829
|
-
),
|
|
1830
|
-
return /* @__PURE__ */
|
|
1831
|
-
|
|
1832
|
-
ref: (
|
|
1833
|
-
N.current =
|
|
2281
|
+
), P = F(), X = r ?? P;
|
|
2282
|
+
return /* @__PURE__ */ T(ne, { children: [
|
|
2283
|
+
W.cloneElement(a, {
|
|
2284
|
+
ref: (j) => {
|
|
2285
|
+
N.current = j;
|
|
1834
2286
|
},
|
|
1835
2287
|
onMouseEnter: () => {
|
|
1836
|
-
|
|
2288
|
+
v(!0), I();
|
|
1837
2289
|
},
|
|
1838
2290
|
onMouseLeave: () => {
|
|
1839
|
-
|
|
2291
|
+
v(!1);
|
|
1840
2292
|
},
|
|
1841
2293
|
onFocus: () => {
|
|
1842
|
-
|
|
2294
|
+
g(!0), I();
|
|
1843
2295
|
},
|
|
1844
2296
|
onBlur: () => {
|
|
1845
|
-
|
|
2297
|
+
g(!1), S(!0);
|
|
1846
2298
|
},
|
|
1847
|
-
onKeyDown: (
|
|
1848
|
-
|
|
2299
|
+
onKeyDown: (j) => {
|
|
2300
|
+
j.key === "Escape" && S(!0);
|
|
1849
2301
|
},
|
|
1850
|
-
"aria-describedby": e ? void 0 :
|
|
2302
|
+
"aria-describedby": e ? void 0 : X
|
|
1851
2303
|
}),
|
|
1852
|
-
d &&
|
|
2304
|
+
d && se(
|
|
1853
2305
|
/* @__PURE__ */ c(
|
|
1854
2306
|
"div",
|
|
1855
2307
|
{
|
|
1856
2308
|
ref: E,
|
|
1857
|
-
id:
|
|
2309
|
+
id: X,
|
|
1858
2310
|
role: "tooltip",
|
|
1859
|
-
className:
|
|
2311
|
+
className: x(
|
|
1860
2312
|
"fixed z-50 px-2 py-1 text-sm rounded shadow-lg bg-popover pointer-events-auto transition-all duration-150 ease-out",
|
|
1861
2313
|
i ? "opacity-100" : "opacity-0",
|
|
1862
2314
|
s
|
|
1863
2315
|
),
|
|
1864
2316
|
style: l ? { left: l.x, top: l.y } : { opacity: 0 },
|
|
1865
2317
|
onMouseEnter: () => {
|
|
1866
|
-
|
|
2318
|
+
p(!0), K.current && clearTimeout(K.current);
|
|
1867
2319
|
},
|
|
1868
2320
|
onMouseLeave: () => {
|
|
1869
|
-
|
|
2321
|
+
p(!1);
|
|
1870
2322
|
},
|
|
1871
2323
|
children: t
|
|
1872
2324
|
}
|
|
@@ -1876,32 +2328,34 @@ function $t({
|
|
|
1876
2328
|
] });
|
|
1877
2329
|
}
|
|
1878
2330
|
export {
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
2331
|
+
xt as Accordion,
|
|
2332
|
+
ee as AccordionItem,
|
|
2333
|
+
Wt as ActionModal,
|
|
2334
|
+
Be as Button,
|
|
2335
|
+
Re as ButtonLoadingDots,
|
|
2336
|
+
Nt as Checkbox,
|
|
2337
|
+
Et as Clickable,
|
|
2338
|
+
Tt as Input,
|
|
2339
|
+
At as Label,
|
|
2340
|
+
kt as Modal,
|
|
2341
|
+
It as Pagination,
|
|
2342
|
+
Ct as Panel,
|
|
2343
|
+
$t as RadioGroup,
|
|
2344
|
+
re as RadioGroupItem,
|
|
2345
|
+
Qe as RadioInput,
|
|
2346
|
+
Dt as ScrollArea,
|
|
2347
|
+
zt as Select,
|
|
2348
|
+
Rt as Separator,
|
|
2349
|
+
St as Skeleton,
|
|
2350
|
+
Lt as Slider,
|
|
2351
|
+
Vt as Slot,
|
|
2352
|
+
Bt as Tabs,
|
|
2353
|
+
Ht as TabsContent,
|
|
2354
|
+
Ft as TabsList,
|
|
2355
|
+
jt as TabsTrigger,
|
|
2356
|
+
Kt as Textarea,
|
|
2357
|
+
Ut as Toast,
|
|
2358
|
+
Pt as Toggle,
|
|
2359
|
+
Gt as Tooltip
|
|
1906
2360
|
};
|
|
1907
2361
|
//# sourceMappingURL=components.esm.js.map
|