@moondreamsdev/dreamer-ui 1.7.7-test.13 → 1.7.7-test.14
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-CkxIjis9.cjs +2 -0
- package/dist/Toast-CkxIjis9.cjs.map +1 -0
- package/dist/{Toast-cdFf2Gbf.js → Toast-CuxloQs8.js} +68 -67
- package/dist/Toast-CuxloQs8.js.map +1 -0
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +578 -422
- 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/index.d.ts +1 -0
- package/package.json +1 -1
- 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,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as C, jsx as c, Fragment as O } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { join as
|
|
4
|
-
import { d as me, C as be, a as he, g as pe, E as
|
|
5
|
-
import { n as
|
|
6
|
-
import { A as
|
|
2
|
+
import F, { useId as V, useState as A, createElement as le, useEffect as z, useCallback as I, useMemo as ee, useRef as S, isValidElement as de, cloneElement as fe } from "react";
|
|
3
|
+
import { join as x } from "./utils.esm.js";
|
|
4
|
+
import { d as me, C as be, a as he, g as pe, E as ve, Q as ge, b as ye, e as we, f as xe, c as Ne } from "./QuestionMarkCircled-CY81euqP.js";
|
|
5
|
+
import { n as T, a as Ee, u as te } from "./Toast-CuxloQs8.js";
|
|
6
|
+
import { A as St, T as Vt } from "./Toast-CuxloQs8.js";
|
|
7
7
|
import { E as Ce, X as ce } from "./X-CIoyLewf.js";
|
|
8
8
|
import { createPortal as re } from "react-dom";
|
|
9
9
|
function Z({
|
|
@@ -18,18 +18,18 @@ function Z({
|
|
|
18
18
|
triggerClassName: u = "",
|
|
19
19
|
bodyClassName: d = ""
|
|
20
20
|
}) {
|
|
21
|
-
const
|
|
21
|
+
const h = V(), l = n || `accordion-item-${h}`, v = `${l}-header`, f = `${l}-panel`, b = () => {
|
|
22
22
|
!r && i && i();
|
|
23
|
-
},
|
|
24
|
-
(
|
|
23
|
+
}, m = (p) => {
|
|
24
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), b());
|
|
25
25
|
};
|
|
26
|
-
return /* @__PURE__ */ C("div", { className:
|
|
26
|
+
return /* @__PURE__ */ C("div", { className: x("border-b border-gray-200", r && "opacity-60 cursor-not-allowed", e), children: [
|
|
27
27
|
/* @__PURE__ */ C(
|
|
28
28
|
"button",
|
|
29
29
|
{
|
|
30
|
-
id:
|
|
30
|
+
id: v,
|
|
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
|
r ? "cursor-not-allowed" : "hover:bg-gray-50/10 cursor-pointer",
|
|
35
35
|
u
|
|
@@ -38,13 +38,13 @@ function Z({
|
|
|
38
38
|
"aria-controls": f,
|
|
39
39
|
disabled: r,
|
|
40
40
|
onClick: b,
|
|
41
|
-
onKeyDown:
|
|
41
|
+
onKeyDown: m,
|
|
42
42
|
children: [
|
|
43
43
|
/* @__PURE__ */ c("span", { children: o }),
|
|
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
|
),
|
|
@@ -60,8 +60,8 @@ function Z({
|
|
|
60
60
|
{
|
|
61
61
|
id: f,
|
|
62
62
|
role: "region",
|
|
63
|
-
"aria-labelledby":
|
|
64
|
-
className:
|
|
63
|
+
"aria-labelledby": v,
|
|
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
|
|
@@ -82,45 +82,45 @@ function dt({
|
|
|
82
82
|
triggersClassName: i = "",
|
|
83
83
|
bodiesClassName: u = ""
|
|
84
84
|
}) {
|
|
85
|
-
const d =
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
return
|
|
85
|
+
const d = V(), h = n || `accordion-group-${d}`, [l, v] = A(new Set(s)), f = (p) => {
|
|
86
|
+
v((y) => {
|
|
87
|
+
const g = new Set(y);
|
|
88
|
+
return g.has(p) ? g.delete(p) : (r || g.clear(), g.add(p)), g;
|
|
89
89
|
});
|
|
90
|
-
}, b = (
|
|
91
|
-
return /* @__PURE__ */ C("div", { id:
|
|
92
|
-
o.length > 0 && o.map((
|
|
93
|
-
const
|
|
90
|
+
}, b = (p) => `${d}-item-${p}`, m = (p) => l.has(p);
|
|
91
|
+
return /* @__PURE__ */ C("div", { id: h, className: a, children: [
|
|
92
|
+
o.length > 0 && o.map((p, y) => {
|
|
93
|
+
const g = p.id || b(y);
|
|
94
94
|
return /* @__PURE__ */ c(
|
|
95
95
|
Z,
|
|
96
96
|
{
|
|
97
|
-
id:
|
|
98
|
-
title:
|
|
99
|
-
content:
|
|
100
|
-
disabled:
|
|
101
|
-
isOpen:
|
|
102
|
-
onToggle: () => f(
|
|
97
|
+
id: g,
|
|
98
|
+
title: p.title,
|
|
99
|
+
content: p.content,
|
|
100
|
+
disabled: p.disabled,
|
|
101
|
+
isOpen: m(g),
|
|
102
|
+
onToggle: () => f(g),
|
|
103
103
|
className: e,
|
|
104
104
|
triggerClassName: i,
|
|
105
105
|
bodyClassName: u
|
|
106
106
|
},
|
|
107
|
-
|
|
107
|
+
g
|
|
108
108
|
);
|
|
109
109
|
}),
|
|
110
|
-
o.length === 0 && t &&
|
|
111
|
-
if (
|
|
112
|
-
const
|
|
110
|
+
o.length === 0 && t && F.Children.map(t, (p, y) => {
|
|
111
|
+
if (F.isValidElement(p) && p.type === Z) {
|
|
112
|
+
const g = p.props.id || b(y);
|
|
113
113
|
return /* @__PURE__ */ le(
|
|
114
114
|
Z,
|
|
115
115
|
{
|
|
116
|
-
...
|
|
117
|
-
key:
|
|
118
|
-
id:
|
|
119
|
-
className:
|
|
120
|
-
isOpen:
|
|
121
|
-
onToggle: () => f(
|
|
122
|
-
triggerClassName:
|
|
123
|
-
bodyClassName:
|
|
116
|
+
...p.props,
|
|
117
|
+
key: g,
|
|
118
|
+
id: g,
|
|
119
|
+
className: x(e, p.props.className),
|
|
120
|
+
isOpen: m(g),
|
|
121
|
+
onToggle: () => f(g),
|
|
122
|
+
triggerClassName: x(i, p.props.triggerClassName),
|
|
123
|
+
bodyClassName: x(u, p.props.bodyClassName)
|
|
124
124
|
}
|
|
125
125
|
);
|
|
126
126
|
}
|
|
@@ -130,7 +130,7 @@ function dt({
|
|
|
130
130
|
}
|
|
131
131
|
function Ae() {
|
|
132
132
|
const [n, o] = A(0);
|
|
133
|
-
return
|
|
133
|
+
return z(() => {
|
|
134
134
|
const t = setInterval(() => {
|
|
135
135
|
o((a) => (a + 1) % 3);
|
|
136
136
|
}, 500);
|
|
@@ -138,7 +138,7 @@ function Ae() {
|
|
|
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
|
n === t && "transform -translate-y-1"
|
|
144
144
|
)
|
|
@@ -146,7 +146,7 @@ function Ae() {
|
|
|
146
146
|
t
|
|
147
147
|
)) });
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const Te = {
|
|
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
|
+
}, Ie = {
|
|
158
158
|
stripped: "",
|
|
159
159
|
fitted: "size-fit",
|
|
160
160
|
sm: "px-2 py-1 text-sm",
|
|
@@ -162,7 +162,7 @@ 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
|
+
}, $e = {
|
|
166
166
|
none: "rounded-none",
|
|
167
167
|
sm: "rounded-sm",
|
|
168
168
|
md: "rounded-md",
|
|
@@ -173,7 +173,7 @@ const Ie = {
|
|
|
173
173
|
size: "md",
|
|
174
174
|
rounded: "md"
|
|
175
175
|
};
|
|
176
|
-
function
|
|
176
|
+
function ze({
|
|
177
177
|
variant: n = J.variant,
|
|
178
178
|
size: o,
|
|
179
179
|
rounded: t = J.rounded,
|
|
@@ -186,11 +186,11 @@ function $e({
|
|
|
186
186
|
}) {
|
|
187
187
|
let d;
|
|
188
188
|
n === "link" && !o ? d = "fitted" : d = o || J.size;
|
|
189
|
-
const l =
|
|
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
|
-
|
|
191
|
+
Te[n],
|
|
192
|
+
Ie[d],
|
|
193
|
+
$e[t],
|
|
194
194
|
a && "relative pointer-events-none",
|
|
195
195
|
e && "relative",
|
|
196
196
|
i
|
|
@@ -208,7 +208,7 @@ function $e({
|
|
|
208
208
|
className: l,
|
|
209
209
|
children: [
|
|
210
210
|
a && /* @__PURE__ */ c(Ae, {}),
|
|
211
|
-
/* @__PURE__ */ c("span", { className:
|
|
211
|
+
/* @__PURE__ */ c("span", { className: x(a && "invisible"), children: u.children }),
|
|
212
212
|
e && !u.disabled && /* @__PURE__ */ c(
|
|
213
213
|
"a",
|
|
214
214
|
{
|
|
@@ -223,7 +223,7 @@ function $e({
|
|
|
223
223
|
}
|
|
224
224
|
);
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function ke(n) {
|
|
227
227
|
const [o, t] = A(""), a = I((e) => {
|
|
228
228
|
let r = e, s = "";
|
|
229
229
|
for (; r && !s; ) {
|
|
@@ -232,7 +232,7 @@ function De(n) {
|
|
|
232
232
|
}
|
|
233
233
|
return s || "transparent";
|
|
234
234
|
}, []);
|
|
235
|
-
return
|
|
235
|
+
return z(() => {
|
|
236
236
|
const e = document.getElementById(n);
|
|
237
237
|
if (e) {
|
|
238
238
|
const r = a(e.parentElement);
|
|
@@ -240,7 +240,7 @@ function De(n) {
|
|
|
240
240
|
}
|
|
241
241
|
}, [n, a]), o;
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function ft({
|
|
244
244
|
ref: n,
|
|
245
245
|
id: o,
|
|
246
246
|
size: t = 20,
|
|
@@ -251,17 +251,17 @@ function ut({
|
|
|
251
251
|
onCheckedChange: i,
|
|
252
252
|
disabled: u,
|
|
253
253
|
className: d = "",
|
|
254
|
-
...
|
|
254
|
+
...h
|
|
255
255
|
}) {
|
|
256
|
-
const l =
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
const l = V(), v = ee(() => o || `checkbox-${l}`, [o, l]), f = ke(v), [b, m] = A(s);
|
|
257
|
+
z(() => {
|
|
258
|
+
m(s);
|
|
259
259
|
}, [s]);
|
|
260
|
-
const
|
|
261
|
-
u || (
|
|
262
|
-
}, y = (
|
|
263
|
-
|
|
264
|
-
},
|
|
260
|
+
const p = () => {
|
|
261
|
+
u || (m(!b), i == null || i(!b));
|
|
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
|
r && "rounded",
|
|
267
267
|
u && "opacity-40 cursor-not-allowed",
|
|
@@ -271,12 +271,12 @@ function ut({
|
|
|
271
271
|
return /* @__PURE__ */ c(
|
|
272
272
|
"button",
|
|
273
273
|
{
|
|
274
|
-
id:
|
|
274
|
+
id: v,
|
|
275
275
|
type: "button",
|
|
276
276
|
ref: n,
|
|
277
277
|
tabIndex: 0,
|
|
278
278
|
role: "checkbox",
|
|
279
|
-
onClick:
|
|
279
|
+
onClick: p,
|
|
280
280
|
"aria-checked": b,
|
|
281
281
|
"aria-disabled": u,
|
|
282
282
|
onKeyDownCapture: y,
|
|
@@ -286,13 +286,13 @@ function ut({
|
|
|
286
286
|
color: a,
|
|
287
287
|
backgroundColor: b && e ? "currentcolor" : "transparent"
|
|
288
288
|
},
|
|
289
|
-
className:
|
|
290
|
-
...
|
|
289
|
+
className: g,
|
|
290
|
+
...h,
|
|
291
291
|
children: b && /* @__PURE__ */ c(be, { size: t, color: e ? f : void 0 })
|
|
292
292
|
}
|
|
293
293
|
);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function mt({
|
|
296
296
|
children: n,
|
|
297
297
|
className: o,
|
|
298
298
|
linkTo: t,
|
|
@@ -301,7 +301,7 @@ function ft({
|
|
|
301
301
|
buttonProps: r,
|
|
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__ */ C("div", { className:
|
|
304
|
+
return t && e && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */ C("div", { className: x("relative w-fit", o), ...s, children: [
|
|
305
305
|
n,
|
|
306
306
|
t && /* @__PURE__ */ c(
|
|
307
307
|
"a",
|
|
@@ -309,7 +309,7 @@ function ft({
|
|
|
309
309
|
...a,
|
|
310
310
|
rel: (a == null ? void 0 : a.rel) || "noreferrer",
|
|
311
311
|
href: t,
|
|
312
|
-
className:
|
|
312
|
+
className: x("absolute inset-0", a == null ? void 0 : a.className)
|
|
313
313
|
}
|
|
314
314
|
),
|
|
315
315
|
!t && e && /* @__PURE__ */ c(
|
|
@@ -318,13 +318,13 @@ function ft({
|
|
|
318
318
|
...r,
|
|
319
319
|
type: "button",
|
|
320
320
|
onClick: e,
|
|
321
|
-
className:
|
|
321
|
+
className: x("absolute inset-0 cursor-pointer", r == null ? void 0 : r.className)
|
|
322
322
|
}
|
|
323
323
|
)
|
|
324
324
|
] });
|
|
325
325
|
}
|
|
326
326
|
function Q({ elementId: n, type: o, message: t }) {
|
|
327
|
-
return
|
|
327
|
+
return z(() => {
|
|
328
328
|
const a = document.getElementById(n);
|
|
329
329
|
if (a) {
|
|
330
330
|
if (!t && o === "error") {
|
|
@@ -342,7 +342,7 @@ function Q({ elementId: n, type: o, message: t }) {
|
|
|
342
342
|
}, [n, o, t]), t ? /* @__PURE__ */ C(
|
|
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
347
|
o === "error" && "text-destructive",
|
|
348
348
|
o === "success" && "text-success"
|
|
@@ -355,12 +355,12 @@ function Q({ elementId: n, type: o, message: t }) {
|
|
|
355
355
|
}
|
|
356
356
|
) : null;
|
|
357
357
|
}
|
|
358
|
-
const
|
|
358
|
+
const Re = {
|
|
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
|
+
}, De = {
|
|
364
364
|
none: "rounded-none",
|
|
365
365
|
sm: "rounded-sm",
|
|
366
366
|
md: "rounded-md",
|
|
@@ -370,7 +370,7 @@ const Le = {
|
|
|
370
370
|
variant: "default",
|
|
371
371
|
rounded: "none"
|
|
372
372
|
};
|
|
373
|
-
function
|
|
373
|
+
function bt({
|
|
374
374
|
variant: n = ne.variant,
|
|
375
375
|
rounded: o,
|
|
376
376
|
displayOnlyMode: t = !1,
|
|
@@ -380,21 +380,21 @@ function mt({
|
|
|
380
380
|
className: s,
|
|
381
381
|
...i
|
|
382
382
|
}) {
|
|
383
|
-
const u =
|
|
383
|
+
const u = V(), [d, h] = A(!1);
|
|
384
384
|
let l = o;
|
|
385
385
|
n === "outline" && !o && (l = "md"), l = l || ne.rounded;
|
|
386
|
-
const b =
|
|
386
|
+
const b = 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 &&
|
|
389
|
+
!t && Re[n],
|
|
390
|
+
!t && De[l],
|
|
391
391
|
r === "password" && "pr-10",
|
|
392
392
|
!t && "px-2 py-1",
|
|
393
393
|
t && "pointer-events-none",
|
|
394
394
|
s
|
|
395
395
|
);
|
|
396
|
-
return /* @__PURE__ */ C("div", { className:
|
|
397
|
-
/* @__PURE__ */ C("div", { className:
|
|
396
|
+
return /* @__PURE__ */ C("div", { className: x(t && "cursor-text"), style: { height: i.height, width: i.width }, children: [
|
|
397
|
+
/* @__PURE__ */ C("div", { className: x(r === "password" && "relative"), children: [
|
|
398
398
|
/* @__PURE__ */ c(
|
|
399
399
|
"input",
|
|
400
400
|
{
|
|
@@ -412,11 +412,11 @@ function mt({
|
|
|
412
412
|
r === "password" && /* @__PURE__ */ c(
|
|
413
413
|
"button",
|
|
414
414
|
{
|
|
415
|
-
onClick: () =>
|
|
415
|
+
onClick: () => h(!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(pe, { size: 20 }) : /* @__PURE__ */ c(
|
|
419
|
+
children: d ? /* @__PURE__ */ c(pe, { size: 20 }) : /* @__PURE__ */ c(ve, { size: 20 })
|
|
420
420
|
}
|
|
421
421
|
)
|
|
422
422
|
] }),
|
|
@@ -424,7 +424,7 @@ function mt({
|
|
|
424
424
|
!t && /* @__PURE__ */ c(Q, { elementId: u, type: "success", message: e })
|
|
425
425
|
] });
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function ht({
|
|
428
428
|
display: n = "inline",
|
|
429
429
|
width: o = "fit-content",
|
|
430
430
|
className: t = "",
|
|
@@ -435,9 +435,9 @@ function bt({
|
|
|
435
435
|
children: i,
|
|
436
436
|
...u
|
|
437
437
|
}) {
|
|
438
|
-
const d =
|
|
438
|
+
const d = V(), h = x("font-medium", n, t), l = e ? `${s ?? d}-help` : void 0;
|
|
439
439
|
return /* @__PURE__ */ C("div", { style: { display: n === "inline" ? "inline-flex" : "flex", width: o }, className: "relative", children: [
|
|
440
|
-
/* @__PURE__ */ C("label", { className:
|
|
440
|
+
/* @__PURE__ */ C("label", { className: h, htmlFor: s, ...u, children: [
|
|
441
441
|
i,
|
|
442
442
|
a && /* @__PURE__ */ c("span", { className: "text-red-500 font-medium ml-1", "aria-label": "required", children: "*" })
|
|
443
443
|
] }),
|
|
@@ -448,21 +448,21 @@ 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(ge, {})
|
|
452
452
|
}
|
|
453
453
|
),
|
|
454
454
|
e && /* @__PURE__ */ c("div", { id: l, className: "sr-only", children: e }),
|
|
455
455
|
r && /* @__PURE__ */ c("span", { className: "ml-1", children: r })
|
|
456
456
|
] });
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function Le(n) {
|
|
459
459
|
const [o, t] = A(!1), [a, e] = A(!1);
|
|
460
|
-
return
|
|
460
|
+
return z(() => {
|
|
461
461
|
n ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 150));
|
|
462
462
|
}, [n]), { show: o, shouldRender: a };
|
|
463
463
|
}
|
|
464
|
-
function
|
|
465
|
-
|
|
464
|
+
function Se(n, o) {
|
|
465
|
+
z(() => {
|
|
466
466
|
const t = (a) => {
|
|
467
467
|
a.key === "Escape" && n && o();
|
|
468
468
|
};
|
|
@@ -471,8 +471,8 @@ function Ve(n, o) {
|
|
|
471
471
|
};
|
|
472
472
|
}, [n, o]);
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
const t =
|
|
474
|
+
function Ve(n, o) {
|
|
475
|
+
const t = S(null), a = I(() => {
|
|
476
476
|
const e = document.getElementById(n);
|
|
477
477
|
if (!e) return;
|
|
478
478
|
const r = e.querySelectorAll('[data-modal-action="true"]');
|
|
@@ -494,11 +494,11 @@ function Be(n, o) {
|
|
|
494
494
|
}
|
|
495
495
|
e.focus();
|
|
496
496
|
}, [n]);
|
|
497
|
-
|
|
497
|
+
z(() => (o && (t.current = document.activeElement, a()), () => {
|
|
498
498
|
document.body.style.overflow = "auto", t.current instanceof HTMLElement && t.current.focus();
|
|
499
499
|
}), [o, a]);
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function pt({
|
|
502
502
|
id: n,
|
|
503
503
|
isOpen: o,
|
|
504
504
|
onClose: t,
|
|
@@ -509,22 +509,22 @@ function ht({
|
|
|
509
509
|
overlayClassName: i,
|
|
510
510
|
hideCloseButton: u = !1,
|
|
511
511
|
actions: d = [],
|
|
512
|
-
disableCloseOnOverlayClick:
|
|
512
|
+
disableCloseOnOverlayClick: h = !1,
|
|
513
513
|
ariaLabelledBy: l,
|
|
514
|
-
ariaDescribedBy:
|
|
514
|
+
ariaDescribedBy: v
|
|
515
515
|
}) {
|
|
516
|
-
const f =
|
|
517
|
-
if (
|
|
518
|
-
const
|
|
519
|
-
const { label:
|
|
520
|
-
return /* @__PURE__ */ c(
|
|
516
|
+
const f = V(), b = n || `modal-${f}`, m = n ? `${n}-title` : `modal-title-${f}`, { show: p, shouldRender: y } = Le(o);
|
|
517
|
+
if (Ve(b, y), Se(y, t), !y) return null;
|
|
518
|
+
const g = () => a ? F.isValidElement(a) ? /* @__PURE__ */ c("div", { className: "mb-4", children: a }) : /* @__PURE__ */ c("h2", { className: "mb-4 text-xl font-semibold", id: m, children: a }) : 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: D, className: $, ...k } = N;
|
|
520
|
+
return /* @__PURE__ */ c(ze, { className: $, type: "button", ...k, "data-modal-action": "true", children: D }, E);
|
|
521
521
|
}) });
|
|
522
522
|
return /* @__PURE__ */ c(O, { children: re(
|
|
523
523
|
/* @__PURE__ */ c(
|
|
524
524
|
"div",
|
|
525
525
|
{
|
|
526
|
-
"aria-labelledby": l ?? a ?
|
|
527
|
-
"aria-describedby":
|
|
526
|
+
"aria-labelledby": l ?? a ? m : void 0,
|
|
527
|
+
"aria-describedby": v,
|
|
528
528
|
role: "dialog",
|
|
529
529
|
"aria-modal": "true",
|
|
530
530
|
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
@@ -532,21 +532,21 @@ function ht({
|
|
|
532
532
|
/* @__PURE__ */ c(
|
|
533
533
|
"div",
|
|
534
534
|
{
|
|
535
|
-
className:
|
|
535
|
+
className: T("fixed inset-0 bg-black/20 transition-all", i),
|
|
536
536
|
onClick: () => {
|
|
537
|
-
|
|
537
|
+
h || t();
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
540
|
),
|
|
541
|
-
r && /* @__PURE__ */ c("div", { className:
|
|
541
|
+
r && /* @__PURE__ */ c("div", { className: T("relative w-fit", s), children: e }),
|
|
542
542
|
!r && /* @__PURE__ */ C(
|
|
543
543
|
"div",
|
|
544
544
|
{
|
|
545
545
|
id: b,
|
|
546
546
|
tabIndex: -1,
|
|
547
|
-
className:
|
|
547
|
+
className: T(
|
|
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: [
|
|
@@ -560,9 +560,9 @@ function ht({
|
|
|
560
560
|
children: /* @__PURE__ */ c(ce, { size: 18 })
|
|
561
561
|
}
|
|
562
562
|
),
|
|
563
|
-
|
|
563
|
+
g(),
|
|
564
564
|
e,
|
|
565
|
-
|
|
565
|
+
w()
|
|
566
566
|
]
|
|
567
567
|
}
|
|
568
568
|
)
|
|
@@ -572,15 +572,15 @@ function ht({
|
|
|
572
572
|
document.body
|
|
573
573
|
) });
|
|
574
574
|
}
|
|
575
|
-
const
|
|
575
|
+
const Be = {
|
|
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
|
+
}, He = {
|
|
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
|
|
583
|
+
function vt({
|
|
584
584
|
page: n,
|
|
585
585
|
pageCount: o = 5,
|
|
586
586
|
maxVisiblePages: t = 5,
|
|
@@ -591,43 +591,43 @@ function pt({
|
|
|
591
591
|
className: i,
|
|
592
592
|
ref: u,
|
|
593
593
|
buttonsClassName: d,
|
|
594
|
-
...
|
|
594
|
+
...h
|
|
595
595
|
}) {
|
|
596
596
|
const l = o === 1 / 0, f = I(() => {
|
|
597
597
|
if (l) return [];
|
|
598
598
|
const N = o, 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, n, o])(), b = n > 1,
|
|
600
|
+
return Array.from({ length: N }, (P, j) => j + 1);
|
|
601
|
+
const D = Math.floor(E / 2);
|
|
602
|
+
let $ = Math.max(1, n - D), k = Math.min(N, $ + E - 1);
|
|
603
|
+
return k - $ + 1 < E && ($ = Math.max(1, k - E + 1), k = Math.min(N, $ + E - 1)), Array.from({ length: k - $ + 1 }, (P, j) => $ + j);
|
|
604
|
+
}, [l, t, n, o])(), b = n > 1, m = l || n < o, p = a && !l, y = a && !l, g = (N) => {
|
|
605
605
|
N >= 1 && (l || N <= o) && e(N);
|
|
606
|
-
},
|
|
607
|
-
const N =
|
|
606
|
+
}, w = I(() => {
|
|
607
|
+
const N = T(
|
|
608
608
|
"flex items-center justify-center min-w-fit",
|
|
609
609
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
610
|
-
|
|
610
|
+
He[r],
|
|
611
611
|
"rounded-md"
|
|
612
612
|
);
|
|
613
|
-
return
|
|
613
|
+
return T(N, Be[s], d);
|
|
614
614
|
}, [s, r, d]);
|
|
615
615
|
return /* @__PURE__ */ C(
|
|
616
616
|
"nav",
|
|
617
617
|
{
|
|
618
618
|
ref: u,
|
|
619
|
-
className:
|
|
619
|
+
className: T("flex items-center justify-center gap-1", i),
|
|
620
620
|
role: "navigation",
|
|
621
621
|
"aria-label": "Pagination",
|
|
622
622
|
"data-page": n,
|
|
623
623
|
"data-page-count": l ? "infinite" : o,
|
|
624
|
-
...
|
|
624
|
+
...h,
|
|
625
625
|
children: [
|
|
626
|
-
|
|
626
|
+
p && /* @__PURE__ */ C(
|
|
627
627
|
"button",
|
|
628
628
|
{
|
|
629
|
-
onClick: () =>
|
|
630
|
-
className:
|
|
629
|
+
onClick: () => g(1),
|
|
630
|
+
className: w(),
|
|
631
631
|
disabled: n === 1,
|
|
632
632
|
"aria-label": "Go to first page",
|
|
633
633
|
children: [
|
|
@@ -639,8 +639,8 @@ function pt({
|
|
|
639
639
|
/* @__PURE__ */ C(
|
|
640
640
|
"button",
|
|
641
641
|
{
|
|
642
|
-
onClick: () =>
|
|
643
|
-
className:
|
|
642
|
+
onClick: () => g(n - 1),
|
|
643
|
+
className: w(),
|
|
644
644
|
disabled: !b,
|
|
645
645
|
"aria-label": "Go to previous page",
|
|
646
646
|
children: [
|
|
@@ -652,8 +652,8 @@ function pt({
|
|
|
652
652
|
!l && f.map((N) => /* @__PURE__ */ c(
|
|
653
653
|
"button",
|
|
654
654
|
{
|
|
655
|
-
onClick: () =>
|
|
656
|
-
className:
|
|
655
|
+
onClick: () => g(N),
|
|
656
|
+
className: T(w(), "aspect-square"),
|
|
657
657
|
"aria-label": `Go to page ${N}`,
|
|
658
658
|
"aria-current": N === n ? !0 : void 0,
|
|
659
659
|
children: N
|
|
@@ -663,9 +663,9 @@ function pt({
|
|
|
663
663
|
/* @__PURE__ */ C(
|
|
664
664
|
"button",
|
|
665
665
|
{
|
|
666
|
-
onClick: () =>
|
|
667
|
-
className:
|
|
668
|
-
disabled: !
|
|
666
|
+
onClick: () => g(n + 1),
|
|
667
|
+
className: w(),
|
|
668
|
+
disabled: !m,
|
|
669
669
|
"aria-label": "Go to next page",
|
|
670
670
|
children: [
|
|
671
671
|
/* @__PURE__ */ c("span", { className: "mr-1", children: "Next" }),
|
|
@@ -676,8 +676,8 @@ function pt({
|
|
|
676
676
|
y && /* @__PURE__ */ C(
|
|
677
677
|
"button",
|
|
678
678
|
{
|
|
679
|
-
onClick: () =>
|
|
680
|
-
className:
|
|
679
|
+
onClick: () => g(o),
|
|
680
|
+
className: w(),
|
|
681
681
|
disabled: n === o,
|
|
682
682
|
"aria-label": "Go to last page",
|
|
683
683
|
children: [
|
|
@@ -692,12 +692,12 @@ function pt({
|
|
|
692
692
|
}
|
|
693
693
|
function Fe(n) {
|
|
694
694
|
const [o, t] = A(!1), [a, e] = A(!1);
|
|
695
|
-
return
|
|
695
|
+
return z(() => {
|
|
696
696
|
n ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 300));
|
|
697
697
|
}, [n]), { show: o, shouldRender: a };
|
|
698
698
|
}
|
|
699
|
-
function
|
|
700
|
-
|
|
699
|
+
function je(n, o) {
|
|
700
|
+
z(() => {
|
|
701
701
|
const t = (a) => {
|
|
702
702
|
a.key === "Escape" && n && o();
|
|
703
703
|
};
|
|
@@ -706,8 +706,8 @@ function Ge(n, o) {
|
|
|
706
706
|
};
|
|
707
707
|
}, [n, o]);
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
const t =
|
|
709
|
+
function Pe(n, o) {
|
|
710
|
+
const t = S(null), a = I(() => {
|
|
711
711
|
const e = document.getElementById(n);
|
|
712
712
|
if (!e) return;
|
|
713
713
|
const r = e.querySelectorAll('[data-panel-action="true"]');
|
|
@@ -729,11 +729,11 @@ function qe(n, o) {
|
|
|
729
729
|
}
|
|
730
730
|
e.focus();
|
|
731
731
|
}, [n]);
|
|
732
|
-
|
|
732
|
+
z(() => (o && (t.current = document.activeElement, a()), () => {
|
|
733
733
|
document.body.style.overflow = "auto", t.current instanceof HTMLElement && t.current.focus();
|
|
734
734
|
}), [o, a]);
|
|
735
735
|
}
|
|
736
|
-
const
|
|
736
|
+
const Ge = {
|
|
737
737
|
size: {
|
|
738
738
|
sm: "max-w-sm",
|
|
739
739
|
md: "max-w-md",
|
|
@@ -755,18 +755,18 @@ function gt({
|
|
|
755
755
|
size: i = "md",
|
|
756
756
|
className: u,
|
|
757
757
|
overlayClassName: d,
|
|
758
|
-
hideCloseButton:
|
|
758
|
+
hideCloseButton: h = !1,
|
|
759
759
|
disableCloseOnOverlayClick: l = !1,
|
|
760
|
-
ariaLabelledBy:
|
|
760
|
+
ariaLabelledBy: v,
|
|
761
761
|
ariaDescribedBy: f
|
|
762
762
|
}) {
|
|
763
|
-
const b =
|
|
764
|
-
if (
|
|
765
|
-
const
|
|
763
|
+
const b = V(), m = o || `panel-${b}`, p = o ? `${o}-title` : `panel-title-${b}`, { show: y, shouldRender: g } = Fe(t);
|
|
764
|
+
if (Pe(m, g), je(g, a), !g) return null;
|
|
765
|
+
const w = () => e ? F.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 (F.isValidElement(s)) {
|
|
768
|
+
const E = s, D = E.props.className || "";
|
|
769
|
+
return F.cloneElement(E, { className: T("px-6 py-4", D) });
|
|
770
770
|
}
|
|
771
771
|
return /* @__PURE__ */ c("div", { className: "px-6 py-4", children: s });
|
|
772
772
|
};
|
|
@@ -774,7 +774,7 @@ function gt({
|
|
|
774
774
|
/* @__PURE__ */ C(
|
|
775
775
|
"div",
|
|
776
776
|
{
|
|
777
|
-
"aria-labelledby":
|
|
777
|
+
"aria-labelledby": v ?? e ? p : void 0,
|
|
778
778
|
"aria-describedby": f,
|
|
779
779
|
role: "dialog",
|
|
780
780
|
"aria-modal": "true",
|
|
@@ -784,7 +784,7 @@ function gt({
|
|
|
784
784
|
/* @__PURE__ */ c(
|
|
785
785
|
"div",
|
|
786
786
|
{
|
|
787
|
-
className:
|
|
787
|
+
className: T(
|
|
788
788
|
"fixed inset-0 bg-black/40 transition-opacity duration-300",
|
|
789
789
|
y ? "opacity-100" : "opacity-0",
|
|
790
790
|
d
|
|
@@ -797,20 +797,20 @@ function gt({
|
|
|
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:
|
|
800
|
+
id: m,
|
|
801
801
|
ref: n,
|
|
802
802
|
tabIndex: -1,
|
|
803
|
-
className:
|
|
803
|
+
className: T(
|
|
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
|
+
Ge.size[i],
|
|
807
807
|
y ? "translate-x-0" : "translate-x-full",
|
|
808
808
|
u
|
|
809
809
|
),
|
|
810
810
|
"data-panel-size": i,
|
|
811
811
|
children: /* @__PURE__ */ C("div", { className: "flex h-full flex-col", children: [
|
|
812
|
-
e && /* @__PURE__ */ c("div", { className: "px-6 pt-6", children:
|
|
813
|
-
!
|
|
812
|
+
e && /* @__PURE__ */ c("div", { className: "px-6 pt-6", children: w() }),
|
|
813
|
+
!h && /* @__PURE__ */ c(
|
|
814
814
|
"button",
|
|
815
815
|
{
|
|
816
816
|
type: "button",
|
|
@@ -821,7 +821,7 @@ function gt({
|
|
|
821
821
|
children: /* @__PURE__ */ c(ce, { size: 18 })
|
|
822
822
|
}
|
|
823
823
|
),
|
|
824
|
-
/* @__PURE__ */ c("div", { className:
|
|
824
|
+
/* @__PURE__ */ c("div", { className: T("flex-1 overflow-y-auto px-6 pb-6", e ? "pt-6" : "pt-10"), children: r }),
|
|
825
825
|
N()
|
|
826
826
|
] })
|
|
827
827
|
}
|
|
@@ -835,7 +835,7 @@ function gt({
|
|
|
835
835
|
function Me({ itemId: n, checked: o, onChange: t, name: a, disabled: e = !1, className: r = "" }) {
|
|
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
|
!o && "hover:border-current/60",
|
|
841
841
|
!e && "border-current cursor-pointer",
|
|
@@ -863,7 +863,7 @@ function Me({ itemId: n, checked: o, onChange: t, name: a, disabled: e = !1, cla
|
|
|
863
863
|
children: o && /* @__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
|
}
|
|
@@ -880,14 +880,14 @@ function Y({
|
|
|
880
880
|
description: i,
|
|
881
881
|
name: u
|
|
882
882
|
}) {
|
|
883
|
-
const
|
|
883
|
+
const h = `radio-${V()}-${n}`, l = () => {
|
|
884
884
|
r || e == null || e(n);
|
|
885
885
|
};
|
|
886
886
|
return /* @__PURE__ */ C(
|
|
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
|
|
@@ -903,32 +903,32 @@ function Y({
|
|
|
903
903
|
!s && /* @__PURE__ */ c(
|
|
904
904
|
Me,
|
|
905
905
|
{
|
|
906
|
-
itemId:
|
|
906
|
+
itemId: h,
|
|
907
907
|
name: u || "",
|
|
908
908
|
checked: a,
|
|
909
909
|
onChange: l,
|
|
910
910
|
disabled: r,
|
|
911
|
-
className:
|
|
911
|
+
className: x(s && "")
|
|
912
912
|
}
|
|
913
913
|
),
|
|
914
914
|
/* @__PURE__ */ c(
|
|
915
915
|
"div",
|
|
916
916
|
{
|
|
917
|
-
id: s ?
|
|
917
|
+
id: s ? h : void 0,
|
|
918
918
|
tabIndex: s ? -1 : void 0,
|
|
919
919
|
role: s ? "radio" : void 0,
|
|
920
920
|
onClick: s ? l : void 0,
|
|
921
921
|
"aria-checked": s ? a ? "true" : "false" : void 0,
|
|
922
922
|
"aria-disabled": s ? r : void 0,
|
|
923
923
|
"aria-description": s ? i || `Radio button for ${u}` : void 0,
|
|
924
|
-
"aria-labelledby": s ? `${
|
|
925
|
-
className:
|
|
924
|
+
"aria-labelledby": s ? `${h}-label` : void 0,
|
|
925
|
+
className: x(s && "size-full", typeof o == "object" && "grow focus:outline-none"),
|
|
926
926
|
children: /* @__PURE__ */ c(
|
|
927
927
|
"label",
|
|
928
928
|
{
|
|
929
|
-
id: `${
|
|
929
|
+
id: `${h}-label`,
|
|
930
930
|
onClick: s ? void 0 : l,
|
|
931
|
-
className:
|
|
931
|
+
className: x(r && "cursor-not-allowed", !r && "cursor-pointer"),
|
|
932
932
|
children: o
|
|
933
933
|
}
|
|
934
934
|
)
|
|
@@ -938,20 +938,20 @@ function Y({
|
|
|
938
938
|
}
|
|
939
939
|
);
|
|
940
940
|
}
|
|
941
|
-
function
|
|
941
|
+
function qe(n, o) {
|
|
942
942
|
const [t, a] = A(o), [e, r] = A(-1), [s, i] = A(!1), u = I((f, b) => {
|
|
943
943
|
var y;
|
|
944
|
-
const
|
|
945
|
-
|
|
944
|
+
const m = f[b];
|
|
945
|
+
m.hasAttribute("disabled") || m.getAttribute("aria-disabled") === "true" || ((y = f[b]) == null || y.click(), r(b));
|
|
946
946
|
}, []), d = I(
|
|
947
947
|
(f, b) => {
|
|
948
|
-
var
|
|
948
|
+
var p;
|
|
949
949
|
if (f.preventDefault(), s || !b.length) return;
|
|
950
|
-
const
|
|
951
|
-
(
|
|
950
|
+
const m = o !== -1 ? o : 0;
|
|
951
|
+
(p = b[m]) == null || p.focus(), a(m), o !== -1 && u(b, m);
|
|
952
952
|
},
|
|
953
953
|
[o, s, u]
|
|
954
|
-
),
|
|
954
|
+
), h = I(
|
|
955
955
|
(f) => {
|
|
956
956
|
var y;
|
|
957
957
|
if (!f.shiftKey)
|
|
@@ -961,54 +961,54 @@ function Pe(n, o) {
|
|
|
961
961
|
document.querySelectorAll(
|
|
962
962
|
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
963
963
|
)
|
|
964
|
-
).filter((
|
|
965
|
-
(y = b[
|
|
964
|
+
).filter((g) => !g.hasAttribute("disabled") && g.tabIndex >= 0), m = b.findIndex((g) => g.id === n), p = m > 0 ? m - 1 : b.length - 1;
|
|
965
|
+
(y = b[p]) == null || y.focus();
|
|
966
966
|
},
|
|
967
967
|
[n]
|
|
968
968
|
), l = I(
|
|
969
969
|
(f, b) => {
|
|
970
|
-
var
|
|
970
|
+
var w;
|
|
971
971
|
if (!b.length) return;
|
|
972
|
-
const
|
|
973
|
-
if (!b.some((N) => N.id ===
|
|
972
|
+
const m = f.target;
|
|
973
|
+
if (!b.some((N) => N.id === m.id)) return;
|
|
974
974
|
const y = t !== -1 ? t : 0;
|
|
975
|
-
let
|
|
975
|
+
let g = y;
|
|
976
976
|
switch (f.key) {
|
|
977
977
|
case "ArrowUp":
|
|
978
978
|
case "ArrowLeft":
|
|
979
|
-
f.preventDefault(),
|
|
979
|
+
f.preventDefault(), g = y > 0 ? y - 1 : b.length - 1;
|
|
980
980
|
break;
|
|
981
981
|
case "ArrowDown":
|
|
982
982
|
case "ArrowRight":
|
|
983
|
-
f.preventDefault(),
|
|
983
|
+
f.preventDefault(), g = (y + 1) % b.length;
|
|
984
984
|
break;
|
|
985
985
|
// Select the option when the space key is pressed
|
|
986
986
|
case " ":
|
|
987
987
|
f.preventDefault(), u(b, y);
|
|
988
988
|
return;
|
|
989
989
|
case "Tab":
|
|
990
|
-
|
|
990
|
+
h(f);
|
|
991
991
|
return;
|
|
992
992
|
default:
|
|
993
993
|
return;
|
|
994
994
|
}
|
|
995
|
-
(
|
|
995
|
+
(w = b[g]) == null || w.focus(), a(g), e !== -1 && u(b, g);
|
|
996
996
|
},
|
|
997
|
-
[t, e,
|
|
998
|
-
),
|
|
997
|
+
[t, e, h, u]
|
|
998
|
+
), v = I(() => {
|
|
999
999
|
const f = document.querySelector(`[id="${n}"][role="radiogroup"]`);
|
|
1000
1000
|
return f ? Array.from(f.querySelectorAll('[role="radio"]')) : [];
|
|
1001
1001
|
}, [n]);
|
|
1002
|
-
|
|
1002
|
+
z(() => {
|
|
1003
1003
|
const f = document.querySelector(`[id="${n}"][role="radiogroup"]`);
|
|
1004
1004
|
if (!f) return;
|
|
1005
|
-
const b =
|
|
1006
|
-
return document.addEventListener("keydown",
|
|
1007
|
-
document.removeEventListener("keydown",
|
|
1005
|
+
const b = v(), m = (w) => d(w, b), p = (w) => l(w, b), y = () => i(!0), g = () => i(!1);
|
|
1006
|
+
return document.addEventListener("keydown", p), f.addEventListener("focus", m), f.addEventListener("mousedown", y), document.addEventListener("mouseup", g), () => {
|
|
1007
|
+
document.removeEventListener("keydown", p), f.removeEventListener("focus", m), f.removeEventListener("mousedown", y), document.removeEventListener("mouseup", g);
|
|
1008
1008
|
};
|
|
1009
|
-
}, [n,
|
|
1009
|
+
}, [n, v, d, l]);
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function yt({
|
|
1012
1012
|
options: n = [],
|
|
1013
1013
|
value: o,
|
|
1014
1014
|
onChange: t,
|
|
@@ -1018,14 +1018,14 @@ function vt({
|
|
|
1018
1018
|
childrenClassName: s = "",
|
|
1019
1019
|
hideInputs: i = !1
|
|
1020
1020
|
}) {
|
|
1021
|
-
const u =
|
|
1022
|
-
|
|
1021
|
+
const u = V(), d = a || `radio-group-${u}`;
|
|
1022
|
+
qe(
|
|
1023
1023
|
d,
|
|
1024
1024
|
n.findIndex((l) => l === o)
|
|
1025
1025
|
);
|
|
1026
|
-
const
|
|
1027
|
-
return /* @__PURE__ */ C("div", { id: d, role: "radiogroup", tabIndex: 0, className:
|
|
1028
|
-
|
|
1026
|
+
const h = ee(() => n.reduce((l, v) => (typeof v == "string" ? l.some((f) => f.value === v) || l.push({ label: v, value: v }) : l.push(v), l), []), [n]);
|
|
1027
|
+
return /* @__PURE__ */ C("div", { id: d, role: "radiogroup", tabIndex: 0, className: x(r, "focus:outline-none"), children: [
|
|
1028
|
+
h.length > 0 && h.map((l, v) => /* @__PURE__ */ c(
|
|
1029
1029
|
Y,
|
|
1030
1030
|
{
|
|
1031
1031
|
value: l.value,
|
|
@@ -1038,13 +1038,13 @@ function vt({
|
|
|
1038
1038
|
className: s,
|
|
1039
1039
|
children: l.label
|
|
1040
1040
|
},
|
|
1041
|
-
`${l.value}-${
|
|
1041
|
+
`${l.value}-${v}`
|
|
1042
1042
|
)),
|
|
1043
|
-
|
|
1043
|
+
h.length === 0 && e && F.Children.map(e, (l) => F.isValidElement(l) && l.type === Y ? /* @__PURE__ */ c(
|
|
1044
1044
|
Y,
|
|
1045
1045
|
{
|
|
1046
1046
|
...l.props,
|
|
1047
|
-
className:
|
|
1047
|
+
className: x(s, l.props.className),
|
|
1048
1048
|
hideInput: l.props.hideInput || i,
|
|
1049
1049
|
isSelected: o === l.props.value,
|
|
1050
1050
|
onChange: t,
|
|
@@ -1054,6 +1054,161 @@ function vt({
|
|
|
1054
1054
|
) : null)
|
|
1055
1055
|
] });
|
|
1056
1056
|
}
|
|
1057
|
+
function We(n) {
|
|
1058
|
+
const o = S(null), t = S(null), a = S(null), [e, r] = A(!1), [s, i] = A(!1), [u, d] = A({
|
|
1059
|
+
vertical: !1,
|
|
1060
|
+
horizontal: !1
|
|
1061
|
+
}), h = S(null), l = S(null), v = I(() => {
|
|
1062
|
+
const m = o.current;
|
|
1063
|
+
if (!m) return;
|
|
1064
|
+
const p = m.scrollHeight > m.clientHeight, y = m.scrollWidth > m.clientWidth;
|
|
1065
|
+
d({
|
|
1066
|
+
vertical: p,
|
|
1067
|
+
horizontal: y
|
|
1068
|
+
});
|
|
1069
|
+
}, []), f = I(() => {
|
|
1070
|
+
const m = o.current, p = t.current, y = a.current;
|
|
1071
|
+
if (m) {
|
|
1072
|
+
if (p && u.vertical) {
|
|
1073
|
+
const w = (u.horizontal ? m.clientHeight - n : m.clientHeight) / m.scrollHeight, N = Math.max(w * 100, 10), E = m.scrollHeight - m.clientHeight, D = E > 0 ? m.scrollTop / E : 0, $ = 100 - N, k = D * $;
|
|
1074
|
+
p.style.height = `${N}%`, p.style.top = `${k}%`, p.style.transform = "none";
|
|
1075
|
+
}
|
|
1076
|
+
if (y && u.horizontal) {
|
|
1077
|
+
const w = (u.vertical ? m.clientWidth - n : m.clientWidth) / m.scrollWidth, N = Math.max(w * 100, 10), E = m.scrollWidth - m.clientWidth, D = E > 0 ? m.scrollLeft / E : 0, $ = 100 - N, k = D * $;
|
|
1078
|
+
y.style.width = `${N}%`, y.style.left = `${k}%`, y.style.transform = "none";
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
}, [u, n]), b = I(() => {
|
|
1082
|
+
h.current && clearTimeout(h.current), l.current && clearTimeout(l.current), r(!0), i(!1), f(), h.current = setTimeout(() => {
|
|
1083
|
+
i(!0), l.current = setTimeout(() => {
|
|
1084
|
+
r(!1), i(!1);
|
|
1085
|
+
}, 300);
|
|
1086
|
+
}, 1e3);
|
|
1087
|
+
}, [f]);
|
|
1088
|
+
return z(() => {
|
|
1089
|
+
const m = o.current;
|
|
1090
|
+
if (!m) return;
|
|
1091
|
+
v();
|
|
1092
|
+
const p = new ResizeObserver(v);
|
|
1093
|
+
p.observe(m);
|
|
1094
|
+
const y = new MutationObserver(v);
|
|
1095
|
+
return y.observe(m, {
|
|
1096
|
+
childList: !0,
|
|
1097
|
+
subtree: !0,
|
|
1098
|
+
attributes: !0
|
|
1099
|
+
}), () => {
|
|
1100
|
+
p.disconnect(), y.disconnect();
|
|
1101
|
+
};
|
|
1102
|
+
}, [v]), z(() => {
|
|
1103
|
+
f();
|
|
1104
|
+
}, [u, f]), z(() => () => {
|
|
1105
|
+
h.current && clearTimeout(h.current), l.current && clearTimeout(l.current);
|
|
1106
|
+
}, []), {
|
|
1107
|
+
viewportRef: o,
|
|
1108
|
+
verticalThumbRef: t,
|
|
1109
|
+
horizontalThumbRef: a,
|
|
1110
|
+
isScrolling: e,
|
|
1111
|
+
isFadingOut: s,
|
|
1112
|
+
scrollbarVisible: u,
|
|
1113
|
+
handleScroll: b
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
function wt({
|
|
1117
|
+
className: n,
|
|
1118
|
+
thumbClassName: o,
|
|
1119
|
+
viewportClassName: t,
|
|
1120
|
+
scrollbarClassName: a,
|
|
1121
|
+
scrollbarThickness: e = 10,
|
|
1122
|
+
children: r,
|
|
1123
|
+
id: s,
|
|
1124
|
+
ref: i,
|
|
1125
|
+
...u
|
|
1126
|
+
}) {
|
|
1127
|
+
const { viewportRef: d, verticalThumbRef: h, horizontalThumbRef: l, isScrolling: v, isFadingOut: f, scrollbarVisible: b, handleScroll: m } = We(e), p = T(
|
|
1128
|
+
"relative flex-1 rounded-full bg-slate-400/60 hover:bg-slate-400/80 active:bg-slate-400",
|
|
1129
|
+
o
|
|
1130
|
+
);
|
|
1131
|
+
return /* @__PURE__ */ C("div", { ref: i, id: s, className: T("relative overflow-hidden", n), "data-scroll-area-root": "", ...u, children: [
|
|
1132
|
+
/* @__PURE__ */ c(
|
|
1133
|
+
"div",
|
|
1134
|
+
{
|
|
1135
|
+
ref: d,
|
|
1136
|
+
className: T(
|
|
1137
|
+
"h-full w-full overflow-auto rounded-[inherit] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
1138
|
+
t
|
|
1139
|
+
),
|
|
1140
|
+
onScroll: m,
|
|
1141
|
+
"data-scroll-area-viewport": "",
|
|
1142
|
+
children: r
|
|
1143
|
+
}
|
|
1144
|
+
),
|
|
1145
|
+
b.vertical && (v || f) && /* @__PURE__ */ c(
|
|
1146
|
+
"div",
|
|
1147
|
+
{
|
|
1148
|
+
className: T(
|
|
1149
|
+
"touch-none select-none transition-all duration-300",
|
|
1150
|
+
"p-[1px]",
|
|
1151
|
+
"absolute right-0 top-0",
|
|
1152
|
+
f ? "opacity-0" : "opacity-100",
|
|
1153
|
+
a
|
|
1154
|
+
),
|
|
1155
|
+
"data-scroll-area-scrollbar": "vertical",
|
|
1156
|
+
"data-state": v ? "visible" : "hidden",
|
|
1157
|
+
style: {
|
|
1158
|
+
width: `${e}px`,
|
|
1159
|
+
height: b.horizontal ? `calc(100% - ${e}px)` : "100%"
|
|
1160
|
+
},
|
|
1161
|
+
children: /* @__PURE__ */ c(
|
|
1162
|
+
"div",
|
|
1163
|
+
{
|
|
1164
|
+
ref: h,
|
|
1165
|
+
className: T("absolute rounded-full", p),
|
|
1166
|
+
"data-scroll-area-thumb": "",
|
|
1167
|
+
style: { height: "20%", top: "0%", width: "100%" }
|
|
1168
|
+
}
|
|
1169
|
+
)
|
|
1170
|
+
}
|
|
1171
|
+
),
|
|
1172
|
+
b.horizontal && (v || f) && /* @__PURE__ */ c(
|
|
1173
|
+
"div",
|
|
1174
|
+
{
|
|
1175
|
+
className: T(
|
|
1176
|
+
"touch-none select-none transition-all duration-300",
|
|
1177
|
+
"p-[1px]",
|
|
1178
|
+
"absolute bottom-0 left-0",
|
|
1179
|
+
f ? "opacity-0" : "opacity-100",
|
|
1180
|
+
a
|
|
1181
|
+
),
|
|
1182
|
+
"data-scroll-area-scrollbar": "horizontal",
|
|
1183
|
+
"data-state": v ? "visible" : "hidden",
|
|
1184
|
+
style: {
|
|
1185
|
+
height: `${e}px`,
|
|
1186
|
+
width: b.vertical ? `calc(100% - ${e}px)` : "100%"
|
|
1187
|
+
},
|
|
1188
|
+
children: /* @__PURE__ */ c(
|
|
1189
|
+
"div",
|
|
1190
|
+
{
|
|
1191
|
+
ref: l,
|
|
1192
|
+
className: T("absolute rounded-full", p),
|
|
1193
|
+
"data-scroll-area-thumb": "",
|
|
1194
|
+
style: { width: "20%", left: "0%", height: "100%" }
|
|
1195
|
+
}
|
|
1196
|
+
)
|
|
1197
|
+
}
|
|
1198
|
+
),
|
|
1199
|
+
b.vertical && b.horizontal && /* @__PURE__ */ c(
|
|
1200
|
+
"div",
|
|
1201
|
+
{
|
|
1202
|
+
className: T("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
|
+
}
|
|
1057
1212
|
const Ke = {
|
|
1058
1213
|
thin: {
|
|
1059
1214
|
horizontal: "h-px",
|
|
@@ -1075,14 +1230,14 @@ const Ke = {
|
|
|
1075
1230
|
horizontal: "w-full",
|
|
1076
1231
|
vertical: "min-h-4 h-full"
|
|
1077
1232
|
};
|
|
1078
|
-
function
|
|
1233
|
+
function xt({
|
|
1079
1234
|
orientation: n = "horizontal",
|
|
1080
1235
|
decorative: o = !1,
|
|
1081
1236
|
thickness: t = "thin",
|
|
1082
1237
|
className: a,
|
|
1083
1238
|
...e
|
|
1084
1239
|
}) {
|
|
1085
|
-
const r =
|
|
1240
|
+
const r = x(
|
|
1086
1241
|
"shrink-0 bg-border",
|
|
1087
1242
|
Ue[n],
|
|
1088
1243
|
Ke[t][n],
|
|
@@ -1101,7 +1256,7 @@ function yt({
|
|
|
1101
1256
|
}
|
|
1102
1257
|
);
|
|
1103
1258
|
}
|
|
1104
|
-
const
|
|
1259
|
+
const oe = {
|
|
1105
1260
|
shape: {
|
|
1106
1261
|
rectangle: "rounded-md min-h-1",
|
|
1107
1262
|
circle: "rounded-full aspect-square min-h-1",
|
|
@@ -1115,7 +1270,7 @@ const ae = {
|
|
|
1115
1270
|
xl: "space-y-6"
|
|
1116
1271
|
}
|
|
1117
1272
|
};
|
|
1118
|
-
function
|
|
1273
|
+
function Nt({
|
|
1119
1274
|
shape: n = "rectangle",
|
|
1120
1275
|
lineSpacing: o = "sm",
|
|
1121
1276
|
className: t,
|
|
@@ -1124,12 +1279,12 @@ function wt({
|
|
|
1124
1279
|
ref: r,
|
|
1125
1280
|
...s
|
|
1126
1281
|
}) {
|
|
1127
|
-
const i =
|
|
1282
|
+
const i = x("bg-muted/70", e && "animate-pulse", oe.shape[n], t);
|
|
1128
1283
|
return a > 1 ? /* @__PURE__ */ c(
|
|
1129
1284
|
"div",
|
|
1130
1285
|
{
|
|
1131
1286
|
ref: r,
|
|
1132
|
-
className:
|
|
1287
|
+
className: oe.lineSpacing[o],
|
|
1133
1288
|
role: "presentation",
|
|
1134
1289
|
"aria-hidden": "true",
|
|
1135
1290
|
"data-testid": "skeleton-container",
|
|
@@ -1140,7 +1295,7 @@ function wt({
|
|
|
1140
1295
|
children: Array.from({ length: a }, (u, d) => /* @__PURE__ */ c(
|
|
1141
1296
|
"div",
|
|
1142
1297
|
{
|
|
1143
|
-
className:
|
|
1298
|
+
className: x(
|
|
1144
1299
|
i,
|
|
1145
1300
|
// Make last line shorter for a more natural text appearance
|
|
1146
1301
|
d === a - 1 && "w-3/4"
|
|
@@ -1167,7 +1322,7 @@ function wt({
|
|
|
1167
1322
|
}
|
|
1168
1323
|
);
|
|
1169
1324
|
}
|
|
1170
|
-
function
|
|
1325
|
+
function Et({
|
|
1171
1326
|
id: n,
|
|
1172
1327
|
value: o,
|
|
1173
1328
|
defaultValue: t = 0,
|
|
@@ -1178,157 +1333,157 @@ function xt({
|
|
|
1178
1333
|
disabled: i = !1,
|
|
1179
1334
|
trackClassName: u,
|
|
1180
1335
|
rangeClassName: d,
|
|
1181
|
-
thumbClassName:
|
|
1336
|
+
thumbClassName: h,
|
|
1182
1337
|
className: l,
|
|
1183
|
-
ref:
|
|
1338
|
+
ref: v,
|
|
1184
1339
|
ariaLabel: f,
|
|
1185
1340
|
ariaLabelledBy: b,
|
|
1186
|
-
...
|
|
1341
|
+
...m
|
|
1187
1342
|
}) {
|
|
1188
|
-
const [
|
|
1189
|
-
(
|
|
1190
|
-
const
|
|
1191
|
-
|
|
1343
|
+
const [p, y] = A(t), g = o !== void 0, w = g ? o : p, N = S(null), E = S(!1), D = S(0), $ = I(
|
|
1344
|
+
(R) => {
|
|
1345
|
+
const L = Math.max(e, Math.min(r, R)), B = Math.round(L / s) * s;
|
|
1346
|
+
g || y(B), a == null || a(B);
|
|
1192
1347
|
},
|
|
1193
|
-
[e, r, s,
|
|
1194
|
-
),
|
|
1195
|
-
(
|
|
1196
|
-
var
|
|
1197
|
-
const B = (
|
|
1198
|
-
if (!B) return
|
|
1199
|
-
let M =
|
|
1200
|
-
|
|
1201
|
-
const
|
|
1202
|
-
return e + (r - e) *
|
|
1348
|
+
[e, r, s, g, a]
|
|
1349
|
+
), k = I(
|
|
1350
|
+
(R, L = !1) => {
|
|
1351
|
+
var W;
|
|
1352
|
+
const B = (W = N.current) == null ? void 0 : W.getBoundingClientRect();
|
|
1353
|
+
if (!B) return w;
|
|
1354
|
+
let M = R.clientX;
|
|
1355
|
+
L && (M = M - D.current);
|
|
1356
|
+
const U = Math.max(0, Math.min(1, (M - B.left) / B.width));
|
|
1357
|
+
return e + (r - e) * U;
|
|
1203
1358
|
},
|
|
1204
|
-
[e, r,
|
|
1205
|
-
),
|
|
1206
|
-
(
|
|
1207
|
-
if (i ||
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1359
|
+
[e, r, w]
|
|
1360
|
+
), P = I(
|
|
1361
|
+
(R) => {
|
|
1362
|
+
if (i || R.target !== R.currentTarget) return;
|
|
1363
|
+
const L = k(R);
|
|
1364
|
+
$(L);
|
|
1210
1365
|
},
|
|
1211
|
-
[i,
|
|
1212
|
-
),
|
|
1213
|
-
(
|
|
1214
|
-
var
|
|
1366
|
+
[i, k, $]
|
|
1367
|
+
), j = I(
|
|
1368
|
+
(R) => {
|
|
1369
|
+
var W;
|
|
1215
1370
|
if (i) return;
|
|
1216
|
-
|
|
1217
|
-
const
|
|
1218
|
-
if (
|
|
1219
|
-
const
|
|
1220
|
-
|
|
1371
|
+
R.stopPropagation(), E.current = !0;
|
|
1372
|
+
const L = (W = N.current) == null ? void 0 : W.getBoundingClientRect(), B = R.currentTarget.getBoundingClientRect();
|
|
1373
|
+
if (L && B) {
|
|
1374
|
+
const q = B.left + B.width / 2;
|
|
1375
|
+
D.current = R.clientX - q;
|
|
1221
1376
|
}
|
|
1222
|
-
|
|
1223
|
-
const M = (
|
|
1377
|
+
R.currentTarget.setPointerCapture(R.pointerId);
|
|
1378
|
+
const M = (q) => {
|
|
1224
1379
|
if (!E.current) return;
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
-
},
|
|
1228
|
-
if (
|
|
1229
|
-
E.current = !1,
|
|
1380
|
+
const ue = k(q, !0);
|
|
1381
|
+
$(ue);
|
|
1382
|
+
}, U = (q) => {
|
|
1383
|
+
if (q.pointerId === R.pointerId) {
|
|
1384
|
+
E.current = !1, D.current = 0;
|
|
1230
1385
|
try {
|
|
1231
|
-
|
|
1386
|
+
R.currentTarget.releasePointerCapture(q.pointerId);
|
|
1232
1387
|
} catch {
|
|
1233
1388
|
}
|
|
1234
|
-
document.removeEventListener("pointermove", M), document.removeEventListener("pointerup",
|
|
1389
|
+
document.removeEventListener("pointermove", M), document.removeEventListener("pointerup", U);
|
|
1235
1390
|
}
|
|
1236
1391
|
};
|
|
1237
|
-
document.addEventListener("pointermove", M), document.addEventListener("pointerup",
|
|
1392
|
+
document.addEventListener("pointermove", M), document.addEventListener("pointerup", U);
|
|
1238
1393
|
},
|
|
1239
|
-
[i,
|
|
1240
|
-
),
|
|
1241
|
-
(
|
|
1394
|
+
[i, k, $]
|
|
1395
|
+
), K = I(
|
|
1396
|
+
(R) => {
|
|
1242
1397
|
if (i) return;
|
|
1243
|
-
let
|
|
1244
|
-
switch (
|
|
1398
|
+
let L = w;
|
|
1399
|
+
switch (R.key) {
|
|
1245
1400
|
case "ArrowRight":
|
|
1246
1401
|
case "ArrowUp":
|
|
1247
|
-
|
|
1402
|
+
L = w + s;
|
|
1248
1403
|
break;
|
|
1249
1404
|
case "ArrowLeft":
|
|
1250
1405
|
case "ArrowDown":
|
|
1251
|
-
|
|
1406
|
+
L = w - s;
|
|
1252
1407
|
break;
|
|
1253
1408
|
case "Home":
|
|
1254
|
-
|
|
1409
|
+
L = e;
|
|
1255
1410
|
break;
|
|
1256
1411
|
case "End":
|
|
1257
|
-
|
|
1412
|
+
L = r;
|
|
1258
1413
|
break;
|
|
1259
1414
|
case "PageUp":
|
|
1260
|
-
|
|
1415
|
+
L = w + s * 10;
|
|
1261
1416
|
break;
|
|
1262
1417
|
case "PageDown":
|
|
1263
|
-
|
|
1418
|
+
L = w - s * 10;
|
|
1264
1419
|
break;
|
|
1265
1420
|
default:
|
|
1266
1421
|
return;
|
|
1267
1422
|
}
|
|
1268
|
-
|
|
1423
|
+
R.preventDefault(), $(L);
|
|
1269
1424
|
},
|
|
1270
|
-
[i,
|
|
1271
|
-
),
|
|
1425
|
+
[i, w, s, e, r, $]
|
|
1426
|
+
), G = r === e ? 0 : (w - e) / (r - e) * 100;
|
|
1272
1427
|
return /* @__PURE__ */ c(
|
|
1273
1428
|
"div",
|
|
1274
1429
|
{
|
|
1275
1430
|
id: n,
|
|
1276
|
-
ref:
|
|
1277
|
-
className:
|
|
1431
|
+
ref: v,
|
|
1432
|
+
className: T(
|
|
1278
1433
|
"relative flex items-center w-full touch-none select-none",
|
|
1279
1434
|
i && "opacity-50 cursor-not-allowed",
|
|
1280
1435
|
l
|
|
1281
1436
|
),
|
|
1282
1437
|
"data-disabled": i,
|
|
1283
|
-
"data-value":
|
|
1438
|
+
"data-value": w,
|
|
1284
1439
|
"data-min": e,
|
|
1285
1440
|
"data-max": r,
|
|
1286
1441
|
"data-step": s,
|
|
1287
|
-
...
|
|
1442
|
+
...m,
|
|
1288
1443
|
children: /* @__PURE__ */ C(
|
|
1289
1444
|
"div",
|
|
1290
1445
|
{
|
|
1291
1446
|
ref: N,
|
|
1292
|
-
className:
|
|
1447
|
+
className: T(
|
|
1293
1448
|
"relative h-1.5 w-full rounded-full bg-muted cursor-pointer",
|
|
1294
1449
|
i && "cursor-not-allowed",
|
|
1295
1450
|
u
|
|
1296
1451
|
),
|
|
1297
|
-
onPointerDown:
|
|
1452
|
+
onPointerDown: P,
|
|
1298
1453
|
children: [
|
|
1299
1454
|
/* @__PURE__ */ c(
|
|
1300
1455
|
"div",
|
|
1301
1456
|
{
|
|
1302
|
-
className:
|
|
1457
|
+
className: T(
|
|
1303
1458
|
"absolute h-full rounded-full pointer-events-none",
|
|
1304
1459
|
// pointer-events are disabled so that user interactions are handled by the track element, enabling correct slider behavior
|
|
1305
1460
|
!E.current && "transition-all",
|
|
1306
1461
|
d
|
|
1307
1462
|
),
|
|
1308
|
-
style: { width: `${
|
|
1463
|
+
style: { width: `${G}%` }
|
|
1309
1464
|
}
|
|
1310
1465
|
),
|
|
1311
1466
|
/* @__PURE__ */ c(
|
|
1312
1467
|
"div",
|
|
1313
1468
|
{
|
|
1314
|
-
className:
|
|
1469
|
+
className: T(
|
|
1315
1470
|
"absolute size-5 -top-2 rounded-full shadow-md cursor-grab",
|
|
1316
1471
|
i && "cursor-not-allowed",
|
|
1317
1472
|
!i && "cursor-grab focus:outline-none focus:ring-2",
|
|
1318
1473
|
E.current ? "cursor-grabbing scale-110" : "transition-all",
|
|
1319
|
-
|
|
1474
|
+
h
|
|
1320
1475
|
),
|
|
1321
|
-
style: { left: `calc(${
|
|
1476
|
+
style: { left: `calc(${G}% - 10px)` },
|
|
1322
1477
|
tabIndex: i ? -1 : 0,
|
|
1323
1478
|
role: "slider",
|
|
1324
1479
|
"aria-valuemin": e,
|
|
1325
1480
|
"aria-valuemax": r,
|
|
1326
|
-
"aria-valuenow":
|
|
1481
|
+
"aria-valuenow": w,
|
|
1327
1482
|
"aria-label": f,
|
|
1328
1483
|
"aria-labelledby": b,
|
|
1329
1484
|
"aria-disabled": i,
|
|
1330
|
-
onKeyDown:
|
|
1331
|
-
onPointerDown:
|
|
1485
|
+
onKeyDown: K,
|
|
1486
|
+
onPointerDown: j
|
|
1332
1487
|
}
|
|
1333
1488
|
)
|
|
1334
1489
|
]
|
|
@@ -1337,8 +1492,8 @@ function xt({
|
|
|
1337
1492
|
}
|
|
1338
1493
|
);
|
|
1339
1494
|
}
|
|
1340
|
-
function
|
|
1341
|
-
if (
|
|
1495
|
+
function Ct({ children: n, ref: o, ...t }) {
|
|
1496
|
+
if (de(n)) {
|
|
1342
1497
|
let a = { ...t };
|
|
1343
1498
|
return n.props && (a = { ...a, ...n.props }), fe(n, {
|
|
1344
1499
|
...a,
|
|
@@ -1358,7 +1513,7 @@ const _e = ({ defaultValue: n, value: o, onValueChange: t } = {}) => {
|
|
|
1358
1513
|
onValueChange: i
|
|
1359
1514
|
};
|
|
1360
1515
|
};
|
|
1361
|
-
function
|
|
1516
|
+
function At({
|
|
1362
1517
|
defaultValue: n,
|
|
1363
1518
|
value: o,
|
|
1364
1519
|
onValueChange: t,
|
|
@@ -1369,23 +1524,23 @@ function Et({
|
|
|
1369
1524
|
ref: i,
|
|
1370
1525
|
id: u,
|
|
1371
1526
|
triggersClassName: d,
|
|
1372
|
-
contentClassName:
|
|
1527
|
+
contentClassName: h
|
|
1373
1528
|
}) {
|
|
1374
|
-
const { value: l, onValueChange:
|
|
1529
|
+
const { value: l, onValueChange: v } = _e({
|
|
1375
1530
|
defaultValue: n,
|
|
1376
1531
|
value: o,
|
|
1377
1532
|
onValueChange: t
|
|
1378
1533
|
}), f = {
|
|
1379
1534
|
selectedValue: l,
|
|
1380
|
-
onValueChange:
|
|
1535
|
+
onValueChange: v,
|
|
1381
1536
|
tabsWidth: a,
|
|
1382
1537
|
variant: e,
|
|
1383
1538
|
triggersClassName: d,
|
|
1384
|
-
contentClassName:
|
|
1539
|
+
contentClassName: h
|
|
1385
1540
|
};
|
|
1386
1541
|
return /* @__PURE__ */ c(Ee.Provider, { value: f, children: /* @__PURE__ */ c("div", { id: u, ref: i, className: r, "data-tabs-width": a, "data-variant": e, children: s }) });
|
|
1387
1542
|
}
|
|
1388
|
-
function
|
|
1543
|
+
function Tt({ value: n, className: o, children: t, ref: a }) {
|
|
1389
1544
|
const { selectedValue: e, contentClassName: r } = te(), s = e === n;
|
|
1390
1545
|
return s ? /* @__PURE__ */ c(
|
|
1391
1546
|
"div",
|
|
@@ -1396,13 +1551,13 @@ function Ct({ value: n, className: o, children: t, ref: a }) {
|
|
|
1396
1551
|
"aria-labelledby": `tabs-trigger-${n}`,
|
|
1397
1552
|
"data-state": s ? "active" : "inactive",
|
|
1398
1553
|
"data-value": n,
|
|
1399
|
-
className:
|
|
1554
|
+
className: x("mt-4 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2", r, o),
|
|
1400
1555
|
tabIndex: 0,
|
|
1401
1556
|
children: t
|
|
1402
1557
|
}
|
|
1403
1558
|
) : null;
|
|
1404
1559
|
}
|
|
1405
|
-
const
|
|
1560
|
+
const ae = {
|
|
1406
1561
|
width: {
|
|
1407
1562
|
fit: "w-fit",
|
|
1408
1563
|
full: "w-full *:flex-1"
|
|
@@ -1412,12 +1567,12 @@ const oe = {
|
|
|
1412
1567
|
pills: "",
|
|
1413
1568
|
bordered: "border border-border rounded-lg p-1"
|
|
1414
1569
|
}
|
|
1415
|
-
},
|
|
1570
|
+
}, Xe = {
|
|
1416
1571
|
underline: "border-b-2 border-transparent data-[state=active]:border-accent data-[state=active]:text-accent hover:text-accent-foreground",
|
|
1417
1572
|
pills: "rounded-md data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30",
|
|
1418
1573
|
bordered: "rounded data-[state=active]:bg-accent data-[state=active]:text-accent-foreground hover:bg-accent/30"
|
|
1419
1574
|
};
|
|
1420
|
-
function
|
|
1575
|
+
function It({ children: n, className: o, id: t, ref: a }) {
|
|
1421
1576
|
const { tabsWidth: e, variant: r } = te();
|
|
1422
1577
|
return /* @__PURE__ */ c(
|
|
1423
1578
|
"div",
|
|
@@ -1425,15 +1580,15 @@ function At({ children: n, className: o, id: t, ref: a }) {
|
|
|
1425
1580
|
id: t,
|
|
1426
1581
|
ref: a,
|
|
1427
1582
|
role: "tablist",
|
|
1428
|
-
className:
|
|
1583
|
+
className: x("flex", ae.width[e], ae.variant[r], o),
|
|
1429
1584
|
"data-tabs-width": e,
|
|
1430
1585
|
"data-variant": r,
|
|
1431
1586
|
children: n
|
|
1432
1587
|
}
|
|
1433
1588
|
);
|
|
1434
1589
|
}
|
|
1435
|
-
function
|
|
1436
|
-
const { selectedValue: i, onValueChange: u, variant: d, triggersClassName:
|
|
1590
|
+
function $t({ value: n, disabled: o = !1, className: t, children: a, onClick: e, id: r, ref: s }) {
|
|
1591
|
+
const { selectedValue: i, onValueChange: u, variant: d, triggersClassName: h } = te(), l = i === n, v = (b) => {
|
|
1437
1592
|
o || u(n), e == null || e(b);
|
|
1438
1593
|
};
|
|
1439
1594
|
return /* @__PURE__ */ c(
|
|
@@ -1448,21 +1603,21 @@ function It({ value: n, disabled: o = !1, className: t, children: a, onClick: e,
|
|
|
1448
1603
|
"data-state": l ? "active" : "inactive",
|
|
1449
1604
|
"data-value": n,
|
|
1450
1605
|
disabled: o,
|
|
1451
|
-
className:
|
|
1606
|
+
className: x(
|
|
1452
1607
|
"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
1608
|
l ? "font-medium" : "font-light",
|
|
1454
|
-
|
|
1455
|
-
|
|
1609
|
+
Xe[d],
|
|
1610
|
+
h,
|
|
1456
1611
|
t
|
|
1457
1612
|
),
|
|
1458
|
-
onClick:
|
|
1613
|
+
onClick: v,
|
|
1459
1614
|
children: a
|
|
1460
1615
|
}
|
|
1461
1616
|
);
|
|
1462
1617
|
}
|
|
1463
|
-
function
|
|
1618
|
+
function Qe({ elementId: n, maxLength: o }) {
|
|
1464
1619
|
const [t, a] = A(0);
|
|
1465
|
-
return
|
|
1620
|
+
return z(() => {
|
|
1466
1621
|
const e = document.getElementById(n);
|
|
1467
1622
|
if (!e)
|
|
1468
1623
|
return;
|
|
@@ -1478,7 +1633,7 @@ function Xe({ elementId: n, maxLength: o }) {
|
|
|
1478
1633
|
}, [n, o]), /* @__PURE__ */ c(
|
|
1479
1634
|
"small",
|
|
1480
1635
|
{
|
|
1481
|
-
className:
|
|
1636
|
+
className: x(
|
|
1482
1637
|
"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",
|
|
1483
1638
|
t >= o && "text-destructive",
|
|
1484
1639
|
t < o && "text-current"
|
|
@@ -1493,8 +1648,8 @@ function Xe({ elementId: n, maxLength: o }) {
|
|
|
1493
1648
|
}
|
|
1494
1649
|
);
|
|
1495
1650
|
}
|
|
1496
|
-
function
|
|
1497
|
-
|
|
1651
|
+
function Ze(n, o) {
|
|
1652
|
+
z(() => {
|
|
1498
1653
|
const t = document.getElementById(n);
|
|
1499
1654
|
if (!t)
|
|
1500
1655
|
return;
|
|
@@ -1510,11 +1665,11 @@ function Qe(n, o) {
|
|
|
1510
1665
|
};
|
|
1511
1666
|
}, [n, o]);
|
|
1512
1667
|
}
|
|
1513
|
-
const
|
|
1668
|
+
const Je = {
|
|
1514
1669
|
base: "",
|
|
1515
1670
|
"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
1671
|
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
|
-
},
|
|
1672
|
+
}, Ye = {
|
|
1518
1673
|
none: "rounded-none",
|
|
1519
1674
|
sm: "rounded-sm",
|
|
1520
1675
|
md: "rounded-md",
|
|
@@ -1524,7 +1679,7 @@ const Ze = {
|
|
|
1524
1679
|
variant: "outline",
|
|
1525
1680
|
rounded: "none"
|
|
1526
1681
|
};
|
|
1527
|
-
function
|
|
1682
|
+
function zt({
|
|
1528
1683
|
variant: n = se.variant,
|
|
1529
1684
|
rounded: o,
|
|
1530
1685
|
displayOnlyMode: t = !1,
|
|
@@ -1536,27 +1691,27 @@ function kt({
|
|
|
1536
1691
|
className: u,
|
|
1537
1692
|
...d
|
|
1538
1693
|
}) {
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1694
|
+
const h = V();
|
|
1695
|
+
Ze(h, s || t);
|
|
1541
1696
|
let l = o;
|
|
1542
1697
|
n === "outline" && !o && (l = "md"), l = l || se.rounded;
|
|
1543
|
-
let
|
|
1544
|
-
(t || n === "left-line" && !r) && (
|
|
1545
|
-
const b =
|
|
1698
|
+
let v = r;
|
|
1699
|
+
(t || n === "left-line" && !r) && (v = !0);
|
|
1700
|
+
const b = x(
|
|
1546
1701
|
"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 &&
|
|
1702
|
+
!t && Je[n],
|
|
1703
|
+
!t && Ye[l],
|
|
1549
1704
|
!t && "px-2 py-1",
|
|
1550
1705
|
t && "pointer-events-none",
|
|
1551
|
-
|
|
1706
|
+
v && "no-resize-handle",
|
|
1552
1707
|
u
|
|
1553
1708
|
);
|
|
1554
|
-
return /* @__PURE__ */ C("div", { className:
|
|
1709
|
+
return /* @__PURE__ */ C("div", { className: x("-space-y-1.5", t && "cursor-text"), children: [
|
|
1555
1710
|
/* @__PURE__ */ c(
|
|
1556
1711
|
"textarea",
|
|
1557
1712
|
{
|
|
1558
1713
|
...d,
|
|
1559
|
-
id:
|
|
1714
|
+
id: h,
|
|
1560
1715
|
"aria-disabled": d.disabled,
|
|
1561
1716
|
readOnly: t,
|
|
1562
1717
|
"aria-readonly": t || d["aria-readonly"],
|
|
@@ -1566,12 +1721,12 @@ function kt({
|
|
|
1566
1721
|
className: b
|
|
1567
1722
|
}
|
|
1568
1723
|
),
|
|
1569
|
-
i > 0 && /* @__PURE__ */ c(
|
|
1570
|
-
!t && /* @__PURE__ */ c(Q, { elementId:
|
|
1571
|
-
!t && /* @__PURE__ */ c(Q, { elementId:
|
|
1724
|
+
i > 0 && /* @__PURE__ */ c(Qe, { elementId: h, maxLength: i }),
|
|
1725
|
+
!t && /* @__PURE__ */ c(Q, { elementId: h, type: "error", message: a }),
|
|
1726
|
+
!t && /* @__PURE__ */ c(Q, { elementId: h, type: "success", message: e })
|
|
1572
1727
|
] });
|
|
1573
1728
|
}
|
|
1574
|
-
const
|
|
1729
|
+
const Oe = {
|
|
1575
1730
|
sm: {
|
|
1576
1731
|
container: "h-5 min-w-9 w-9",
|
|
1577
1732
|
thumb: "h-4 w-4",
|
|
@@ -1587,7 +1742,7 @@ const Ye = {
|
|
|
1587
1742
|
thumb: "h-6 w-6",
|
|
1588
1743
|
translate: "translate-x-6"
|
|
1589
1744
|
}
|
|
1590
|
-
},
|
|
1745
|
+
}, et = {
|
|
1591
1746
|
default: {
|
|
1592
1747
|
unchecked: "bg-muted",
|
|
1593
1748
|
checked: "bg-primary"
|
|
@@ -1604,7 +1759,7 @@ const Ye = {
|
|
|
1604
1759
|
variant: "default",
|
|
1605
1760
|
size: "md"
|
|
1606
1761
|
};
|
|
1607
|
-
function
|
|
1762
|
+
function kt({
|
|
1608
1763
|
ref: n,
|
|
1609
1764
|
id: o,
|
|
1610
1765
|
size: t = ie.size,
|
|
@@ -1615,32 +1770,32 @@ function Tt({
|
|
|
1615
1770
|
className: i,
|
|
1616
1771
|
thumbClassName: u,
|
|
1617
1772
|
backgroundClassNames: d,
|
|
1618
|
-
...
|
|
1773
|
+
...h
|
|
1619
1774
|
}) {
|
|
1620
|
-
const l =
|
|
1621
|
-
|
|
1775
|
+
const l = V(), v = ee(() => o || `toggle-${l}`, [o, l]), [f, b] = A(e);
|
|
1776
|
+
z(() => {
|
|
1622
1777
|
b(e);
|
|
1623
1778
|
}, [e]);
|
|
1624
|
-
const
|
|
1779
|
+
const m = () => {
|
|
1625
1780
|
if (!s) {
|
|
1626
1781
|
const E = !f;
|
|
1627
1782
|
e === void 0 && b(E), r == null || r(E);
|
|
1628
1783
|
}
|
|
1629
|
-
},
|
|
1630
|
-
(E.key === " " || E.key === "Enter") && (E.preventDefault(),
|
|
1631
|
-
}, y =
|
|
1784
|
+
}, p = (E) => {
|
|
1785
|
+
(E.key === " " || E.key === "Enter") && (E.preventDefault(), m());
|
|
1786
|
+
}, y = Oe[t], g = et[a], w = x(
|
|
1632
1787
|
// Base styles
|
|
1633
1788
|
"relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out",
|
|
1634
1789
|
"focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
1635
1790
|
// Size
|
|
1636
1791
|
y.container,
|
|
1637
1792
|
// Variant and state
|
|
1638
|
-
f ? (d == null ? void 0 : d.checked) ||
|
|
1793
|
+
f ? (d == null ? void 0 : d.checked) || g.checked : (d == null ? void 0 : d.unchecked) || g.unchecked,
|
|
1639
1794
|
// Disabled state
|
|
1640
1795
|
s && "opacity-50 cursor-not-allowed",
|
|
1641
1796
|
!s && "cursor-pointer",
|
|
1642
1797
|
i
|
|
1643
|
-
), N =
|
|
1798
|
+
), N = x(
|
|
1644
1799
|
// Base thumb styles
|
|
1645
1800
|
"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
1801
|
// Size
|
|
@@ -1653,17 +1808,17 @@ function Tt({
|
|
|
1653
1808
|
"button",
|
|
1654
1809
|
{
|
|
1655
1810
|
ref: n,
|
|
1656
|
-
id:
|
|
1811
|
+
id: v,
|
|
1657
1812
|
type: "button",
|
|
1658
1813
|
role: "switch",
|
|
1659
1814
|
tabIndex: 0,
|
|
1660
1815
|
"aria-checked": f,
|
|
1661
1816
|
"aria-disabled": s,
|
|
1662
1817
|
disabled: s,
|
|
1663
|
-
onClick:
|
|
1664
|
-
onKeyDown:
|
|
1665
|
-
className:
|
|
1666
|
-
...
|
|
1818
|
+
onClick: m,
|
|
1819
|
+
onKeyDown: p,
|
|
1820
|
+
className: w,
|
|
1821
|
+
...h,
|
|
1667
1822
|
children: [
|
|
1668
1823
|
/* @__PURE__ */ c("span", { className: N }),
|
|
1669
1824
|
/* @__PURE__ */ c("span", { className: "sr-only", children: f ? "Enabled" : "Disabled" })
|
|
@@ -1671,19 +1826,19 @@ function Tt({
|
|
|
1671
1826
|
}
|
|
1672
1827
|
);
|
|
1673
1828
|
}
|
|
1674
|
-
const
|
|
1675
|
-
function
|
|
1829
|
+
const _ = 8, X = 4, H = 6;
|
|
1830
|
+
function tt(n) {
|
|
1676
1831
|
return { calculatePosition: I(
|
|
1677
1832
|
(t, a) => {
|
|
1678
1833
|
const e = t.getBoundingClientRect(), r = a.getBoundingClientRect(), s = {
|
|
1679
1834
|
width: window.innerWidth,
|
|
1680
1835
|
height: window.innerHeight
|
|
1681
|
-
}, i = (
|
|
1836
|
+
}, i = (v, f, b, m) => v < 0 || f < 0 || v + b > s.width || f + m > s.height, u = {
|
|
1682
1837
|
top: {
|
|
1683
1838
|
x: e.left + e.width / 2 - r.width / 2,
|
|
1684
1839
|
y: e.top - r.height - X,
|
|
1685
1840
|
arrow: {
|
|
1686
|
-
x: r.width / 2 -
|
|
1841
|
+
x: r.width / 2 - H,
|
|
1687
1842
|
y: r.height
|
|
1688
1843
|
}
|
|
1689
1844
|
},
|
|
@@ -1691,7 +1846,7 @@ function et(n) {
|
|
|
1691
1846
|
x: e.left + e.width / 2 - r.width / 2,
|
|
1692
1847
|
y: e.bottom + X,
|
|
1693
1848
|
arrow: {
|
|
1694
|
-
x: r.width / 2 -
|
|
1849
|
+
x: r.width / 2 - H,
|
|
1695
1850
|
y: -6
|
|
1696
1851
|
}
|
|
1697
1852
|
},
|
|
@@ -1700,7 +1855,7 @@ function et(n) {
|
|
|
1700
1855
|
y: e.top + e.height / 2 - r.height / 2,
|
|
1701
1856
|
arrow: {
|
|
1702
1857
|
x: r.width,
|
|
1703
|
-
y: r.height / 2 -
|
|
1858
|
+
y: r.height / 2 - H
|
|
1704
1859
|
}
|
|
1705
1860
|
},
|
|
1706
1861
|
right: {
|
|
@@ -1708,65 +1863,65 @@ function et(n) {
|
|
|
1708
1863
|
y: e.top + e.height / 2 - r.height / 2,
|
|
1709
1864
|
arrow: {
|
|
1710
1865
|
x: -6,
|
|
1711
|
-
y: r.height / 2 -
|
|
1866
|
+
y: r.height / 2 - H
|
|
1712
1867
|
}
|
|
1713
1868
|
}
|
|
1714
1869
|
};
|
|
1715
|
-
let d = n,
|
|
1716
|
-
if (i(
|
|
1717
|
-
const
|
|
1870
|
+
let d = n, h = u[n];
|
|
1871
|
+
if (i(h.x, h.y, r.width, r.height)) {
|
|
1872
|
+
const v = {
|
|
1718
1873
|
top: "bottom",
|
|
1719
1874
|
bottom: "top",
|
|
1720
1875
|
left: "right",
|
|
1721
1876
|
right: "left"
|
|
1722
|
-
}, f = u[
|
|
1877
|
+
}, f = u[v[n]];
|
|
1723
1878
|
if (!i(f.x, f.y, r.width, r.height))
|
|
1724
|
-
d =
|
|
1879
|
+
d = v[n], h = f;
|
|
1725
1880
|
else {
|
|
1726
1881
|
const b = ["top", "bottom", "left", "right"].filter(
|
|
1727
|
-
(
|
|
1882
|
+
(m) => m !== n && m !== v[n]
|
|
1728
1883
|
);
|
|
1729
|
-
for (const
|
|
1730
|
-
const
|
|
1731
|
-
if (!i(
|
|
1732
|
-
d =
|
|
1884
|
+
for (const m of b) {
|
|
1885
|
+
const p = u[m];
|
|
1886
|
+
if (!i(p.x, p.y, r.width, r.height)) {
|
|
1887
|
+
d = m, h = p;
|
|
1733
1888
|
break;
|
|
1734
1889
|
}
|
|
1735
1890
|
}
|
|
1736
1891
|
}
|
|
1737
1892
|
}
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
Math.min(
|
|
1741
|
-
),
|
|
1742
|
-
|
|
1743
|
-
Math.min(
|
|
1893
|
+
h.x = Math.max(
|
|
1894
|
+
_,
|
|
1895
|
+
Math.min(h.x, s.width - r.width - _)
|
|
1896
|
+
), h.y = Math.max(
|
|
1897
|
+
_,
|
|
1898
|
+
Math.min(h.y, s.height - r.height - _)
|
|
1744
1899
|
);
|
|
1745
1900
|
const l = {
|
|
1746
1901
|
x: e.left + e.width / 2,
|
|
1747
1902
|
y: e.top + e.height / 2
|
|
1748
1903
|
};
|
|
1749
|
-
return d === "top" || d === "bottom" ?
|
|
1750
|
-
|
|
1751
|
-
Math.min(l.x -
|
|
1752
|
-
) :
|
|
1753
|
-
|
|
1754
|
-
Math.min(l.y -
|
|
1904
|
+
return d === "top" || d === "bottom" ? h.arrow.x = Math.max(
|
|
1905
|
+
H,
|
|
1906
|
+
Math.min(l.x - h.x - H, r.width - H * 2)
|
|
1907
|
+
) : h.arrow.y = Math.max(
|
|
1908
|
+
H,
|
|
1909
|
+
Math.min(l.y - h.y - H, r.height - H * 2)
|
|
1755
1910
|
), {
|
|
1756
|
-
...
|
|
1911
|
+
...h,
|
|
1757
1912
|
placement: d
|
|
1758
1913
|
};
|
|
1759
1914
|
},
|
|
1760
1915
|
[n]
|
|
1761
1916
|
) };
|
|
1762
1917
|
}
|
|
1763
|
-
function
|
|
1764
|
-
const a =
|
|
1918
|
+
function rt(n, o, t) {
|
|
1919
|
+
const a = S(null), e = S(null), r = I(() => {
|
|
1765
1920
|
if (!a.current || !e.current) return;
|
|
1766
1921
|
const s = n(a.current, e.current);
|
|
1767
1922
|
t(s);
|
|
1768
1923
|
}, [n, t]);
|
|
1769
|
-
return
|
|
1924
|
+
return z(() => {
|
|
1770
1925
|
if (!o) return;
|
|
1771
1926
|
const s = () => r();
|
|
1772
1927
|
return window.addEventListener("resize", s), () => {
|
|
@@ -1778,16 +1933,16 @@ function tt(n, o, t) {
|
|
|
1778
1933
|
updatePosition: r
|
|
1779
1934
|
};
|
|
1780
1935
|
}
|
|
1781
|
-
function
|
|
1782
|
-
const d =
|
|
1936
|
+
function nt(n, o, t, a, e, r, s, i, u) {
|
|
1937
|
+
const d = S(null), h = I(() => {
|
|
1783
1938
|
n || (d.current && clearTimeout(d.current), d.current = window.setTimeout(() => {
|
|
1784
1939
|
t(!0), requestAnimationFrame(() => {
|
|
1785
1940
|
e(), a(!0);
|
|
1786
1941
|
});
|
|
1787
1942
|
}, o));
|
|
1788
1943
|
}, [n, o, t, e, a]), l = I(
|
|
1789
|
-
(
|
|
1790
|
-
if (d.current && clearTimeout(d.current),
|
|
1944
|
+
(v = !1) => {
|
|
1945
|
+
if (d.current && clearTimeout(d.current), v) {
|
|
1791
1946
|
a(!1), setTimeout(() => t(!1), 150);
|
|
1792
1947
|
return;
|
|
1793
1948
|
}
|
|
@@ -1797,17 +1952,17 @@ function rt(n, o, t, a, e, r, s, i, u) {
|
|
|
1797
1952
|
},
|
|
1798
1953
|
[a, t]
|
|
1799
1954
|
);
|
|
1800
|
-
return
|
|
1955
|
+
return z(() => {
|
|
1801
1956
|
!r && !s && !i && u && l();
|
|
1802
|
-
}, [r, s, i, u, l]),
|
|
1957
|
+
}, [r, s, i, u, l]), z(() => () => {
|
|
1803
1958
|
d.current && clearTimeout(d.current);
|
|
1804
1959
|
}, []), {
|
|
1805
|
-
showTooltip:
|
|
1960
|
+
showTooltip: h,
|
|
1806
1961
|
hideTooltip: l,
|
|
1807
1962
|
timeoutRef: d
|
|
1808
1963
|
};
|
|
1809
1964
|
}
|
|
1810
|
-
function
|
|
1965
|
+
function Rt({
|
|
1811
1966
|
id: n,
|
|
1812
1967
|
children: o,
|
|
1813
1968
|
message: t,
|
|
@@ -1816,57 +1971,57 @@ function $t({
|
|
|
1816
1971
|
delay: r = 200,
|
|
1817
1972
|
className: s
|
|
1818
1973
|
}) {
|
|
1819
|
-
const [i, u] = A(!1), [d,
|
|
1974
|
+
const [i, u] = A(!1), [d, h] = A(!1), [l, v] = A(null), [f, b] = A(!1), [m, p] = A(!1), [y, g] = A(!1), { calculatePosition: w } = tt(a), { triggerRef: N, tooltipRef: E, updatePosition: D } = rt(w, d, v), { showTooltip: $, hideTooltip: k, timeoutRef: P } = nt(
|
|
1820
1975
|
e,
|
|
1821
1976
|
r,
|
|
1822
|
-
|
|
1977
|
+
h,
|
|
1823
1978
|
u,
|
|
1824
|
-
|
|
1979
|
+
D,
|
|
1825
1980
|
f,
|
|
1826
|
-
|
|
1981
|
+
m,
|
|
1827
1982
|
y,
|
|
1828
1983
|
i
|
|
1829
|
-
),
|
|
1984
|
+
), j = V(), K = n ?? j;
|
|
1830
1985
|
return /* @__PURE__ */ C(O, { children: [
|
|
1831
|
-
|
|
1832
|
-
ref: (
|
|
1833
|
-
N.current =
|
|
1986
|
+
F.cloneElement(o, {
|
|
1987
|
+
ref: (G) => {
|
|
1988
|
+
N.current = G;
|
|
1834
1989
|
},
|
|
1835
1990
|
onMouseEnter: () => {
|
|
1836
|
-
b(!0),
|
|
1991
|
+
b(!0), $();
|
|
1837
1992
|
},
|
|
1838
1993
|
onMouseLeave: () => {
|
|
1839
1994
|
b(!1);
|
|
1840
1995
|
},
|
|
1841
1996
|
onFocus: () => {
|
|
1842
|
-
|
|
1997
|
+
g(!0), $();
|
|
1843
1998
|
},
|
|
1844
1999
|
onBlur: () => {
|
|
1845
|
-
|
|
2000
|
+
g(!1), k(!0);
|
|
1846
2001
|
},
|
|
1847
|
-
onKeyDown: (
|
|
1848
|
-
|
|
2002
|
+
onKeyDown: (G) => {
|
|
2003
|
+
G.key === "Escape" && k(!0);
|
|
1849
2004
|
},
|
|
1850
|
-
"aria-describedby": e ? void 0 :
|
|
2005
|
+
"aria-describedby": e ? void 0 : K
|
|
1851
2006
|
}),
|
|
1852
2007
|
d && re(
|
|
1853
2008
|
/* @__PURE__ */ c(
|
|
1854
2009
|
"div",
|
|
1855
2010
|
{
|
|
1856
2011
|
ref: E,
|
|
1857
|
-
id:
|
|
2012
|
+
id: K,
|
|
1858
2013
|
role: "tooltip",
|
|
1859
|
-
className:
|
|
2014
|
+
className: x(
|
|
1860
2015
|
"fixed z-50 px-2 py-1 text-sm rounded shadow-lg bg-popover pointer-events-auto transition-all duration-150 ease-out",
|
|
1861
2016
|
i ? "opacity-100" : "opacity-0",
|
|
1862
2017
|
s
|
|
1863
2018
|
),
|
|
1864
2019
|
style: l ? { left: l.x, top: l.y } : { opacity: 0 },
|
|
1865
2020
|
onMouseEnter: () => {
|
|
1866
|
-
|
|
2021
|
+
p(!0), P.current && clearTimeout(P.current);
|
|
1867
2022
|
},
|
|
1868
2023
|
onMouseLeave: () => {
|
|
1869
|
-
|
|
2024
|
+
p(!1);
|
|
1870
2025
|
},
|
|
1871
2026
|
children: t
|
|
1872
2027
|
}
|
|
@@ -1878,30 +2033,31 @@ function $t({
|
|
|
1878
2033
|
export {
|
|
1879
2034
|
dt as Accordion,
|
|
1880
2035
|
Z as AccordionItem,
|
|
1881
|
-
|
|
1882
|
-
|
|
2036
|
+
St as ActionModal,
|
|
2037
|
+
ze as Button,
|
|
1883
2038
|
Ae as ButtonLoadingDots,
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
2039
|
+
ft as Checkbox,
|
|
2040
|
+
mt as Clickable,
|
|
2041
|
+
bt as Input,
|
|
2042
|
+
ht as Label,
|
|
2043
|
+
pt as Modal,
|
|
2044
|
+
vt as Pagination,
|
|
1890
2045
|
gt as Panel,
|
|
1891
|
-
|
|
2046
|
+
yt as RadioGroup,
|
|
1892
2047
|
Y as RadioGroupItem,
|
|
1893
2048
|
Me as RadioInput,
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
It as
|
|
1902
|
-
|
|
1903
|
-
zt as
|
|
1904
|
-
|
|
1905
|
-
|
|
2049
|
+
wt as ScrollArea,
|
|
2050
|
+
xt as Separator,
|
|
2051
|
+
Nt as Skeleton,
|
|
2052
|
+
Et as Slider,
|
|
2053
|
+
Ct as Slot,
|
|
2054
|
+
At as Tabs,
|
|
2055
|
+
Tt as TabsContent,
|
|
2056
|
+
It as TabsList,
|
|
2057
|
+
$t as TabsTrigger,
|
|
2058
|
+
zt as Textarea,
|
|
2059
|
+
Vt as Toast,
|
|
2060
|
+
kt as Toggle,
|
|
2061
|
+
Rt as Tooltip
|
|
1906
2062
|
};
|
|
1907
2063
|
//# sourceMappingURL=components.esm.js.map
|