@moondreamsdev/dreamer-ui 1.7.7-test.7 → 1.7.7-test.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Toast-BZMBGn3W.cjs.map +1 -1
- package/dist/{Toast-DfNdN3Lk.js → Toast-COzsZuCT.js} +11 -11
- package/dist/{Toast-DfNdN3Lk.js.map → Toast-COzsZuCT.js.map} +1 -1
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +434 -367
- package/dist/components.esm.js.map +1 -1
- package/dist/providers.esm.js +1 -1
- package/dist/src/components/accordion/AccordionItem.d.ts +1 -0
- package/dist/src/components/clickable/Clickable.d.ts +1 -0
- package/dist/src/components/radiogroup/RadioGroupItem.d.ts +1 -0
- package/dist/src/components/skeleton/index.d.ts +1 -1
- package/dist/src/components/tooltip/hooks.d.ts +1 -0
- package/dist/src/hooks/useActionModal.d.ts +1 -0
- package/dist/src/hooks/useToast.d.ts +1 -0
- package/dist/src/symbols/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/components.esm.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsxs as E, jsx as
|
|
2
|
-
import z, { useId as $, useState as x, createElement as
|
|
1
|
+
import { jsxs as E, jsx as d, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import z, { useId as $, useState as x, createElement as P, useEffect as A, useCallback as I, useMemo as _, useRef as R, isValidElement as te, cloneElement as re } from "react";
|
|
3
3
|
import { join as y } from "./utils.esm.js";
|
|
4
|
-
import { b as
|
|
5
|
-
import { n as
|
|
6
|
-
import { A as
|
|
7
|
-
import { E as
|
|
8
|
-
import { createPortal as
|
|
9
|
-
function
|
|
10
|
-
id:
|
|
4
|
+
import { b as ne, C as oe, a as ae, c as se, E as ie, Q as le } from "./QuestionMarkCircled-BVBF3skB.js";
|
|
5
|
+
import { n as D } from "./Toast-COzsZuCT.js";
|
|
6
|
+
import { A as it, T as lt } from "./Toast-COzsZuCT.js";
|
|
7
|
+
import { E as de, X as O } from "./X-CIoyLewf.js";
|
|
8
|
+
import { createPortal as U } from "react-dom";
|
|
9
|
+
function H({
|
|
10
|
+
id: n,
|
|
11
11
|
title: a,
|
|
12
12
|
content: t,
|
|
13
13
|
children: r,
|
|
14
14
|
className: e = "",
|
|
15
|
-
disabled:
|
|
15
|
+
disabled: o = !1,
|
|
16
16
|
isOpen: s = !1,
|
|
17
17
|
onToggle: l,
|
|
18
18
|
triggerClassName: u = "",
|
|
19
|
-
bodyClassName:
|
|
19
|
+
bodyClassName: c = ""
|
|
20
20
|
}) {
|
|
21
|
-
const b = $(), i =
|
|
22
|
-
!
|
|
21
|
+
const b = $(), i = n || `accordion-item-${b}`, v = `${i}-header`, f = `${i}-panel`, m = () => {
|
|
22
|
+
!o && l && l();
|
|
23
23
|
}, g = (h) => {
|
|
24
24
|
(h.key === "Enter" || h.key === " ") && (h.preventDefault(), m());
|
|
25
25
|
};
|
|
26
|
-
return /* @__PURE__ */ E("div", { className: y("border-b border-gray-200",
|
|
26
|
+
return /* @__PURE__ */ E("div", { className: y("border-b border-gray-200", o && "opacity-60 cursor-not-allowed", e), children: [
|
|
27
27
|
/* @__PURE__ */ E(
|
|
28
28
|
"button",
|
|
29
29
|
{
|
|
@@ -31,17 +31,17 @@ function q({
|
|
|
31
31
|
type: "button",
|
|
32
32
|
className: y(
|
|
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
38
|
"aria-controls": f,
|
|
39
|
-
disabled:
|
|
39
|
+
disabled: o,
|
|
40
40
|
onClick: m,
|
|
41
41
|
onKeyDown: g,
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ d("span", { children: a }),
|
|
44
|
+
/* @__PURE__ */ d(
|
|
45
45
|
"span",
|
|
46
46
|
{
|
|
47
47
|
className: y(
|
|
@@ -49,13 +49,13 @@ function q({
|
|
|
49
49
|
s ? "rotate-180" : "rotate-0"
|
|
50
50
|
),
|
|
51
51
|
"aria-hidden": "true",
|
|
52
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ d(ne, { size: 18 })
|
|
53
53
|
}
|
|
54
54
|
)
|
|
55
55
|
]
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ d(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
id: f,
|
|
@@ -64,7 +64,7 @@ function q({
|
|
|
64
64
|
className: y(
|
|
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
|
+
c
|
|
68
68
|
),
|
|
69
69
|
children: s && (r || t)
|
|
70
70
|
}
|
|
@@ -72,27 +72,27 @@ function q({
|
|
|
72
72
|
] });
|
|
73
73
|
}
|
|
74
74
|
function Ue({
|
|
75
|
-
id:
|
|
75
|
+
id: n,
|
|
76
76
|
items: a = [],
|
|
77
77
|
children: t,
|
|
78
78
|
className: r = "",
|
|
79
79
|
itemClassName: e = "",
|
|
80
|
-
allowMultiple:
|
|
80
|
+
allowMultiple: o = !1,
|
|
81
81
|
defaultOpenItems: s = [],
|
|
82
82
|
triggersClassName: l = "",
|
|
83
83
|
bodiesClassName: u = ""
|
|
84
84
|
}) {
|
|
85
|
-
const
|
|
85
|
+
const c = $(), b = n || `accordion-group-${c}`, [i, v] = x(new Set(s)), f = (h) => {
|
|
86
86
|
v((w) => {
|
|
87
87
|
const p = new Set(w);
|
|
88
|
-
return p.has(h) ? p.delete(h) : (
|
|
88
|
+
return p.has(h) ? p.delete(h) : (o || p.clear(), p.add(h)), p;
|
|
89
89
|
});
|
|
90
|
-
}, m = (h) => `${
|
|
90
|
+
}, m = (h) => `${c}-item-${h}`, g = (h) => i.has(h);
|
|
91
91
|
return /* @__PURE__ */ E("div", { id: b, className: r, children: [
|
|
92
92
|
a.length > 0 && a.map((h, w) => {
|
|
93
93
|
const p = h.id || m(w);
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
|
|
94
|
+
return /* @__PURE__ */ d(
|
|
95
|
+
H,
|
|
96
96
|
{
|
|
97
97
|
id: p,
|
|
98
98
|
title: h.title,
|
|
@@ -108,10 +108,10 @@ function Ue({
|
|
|
108
108
|
);
|
|
109
109
|
}),
|
|
110
110
|
a.length === 0 && t && z.Children.map(t, (h, w) => {
|
|
111
|
-
if (z.isValidElement(h) && h.type ===
|
|
111
|
+
if (z.isValidElement(h) && h.type === H) {
|
|
112
112
|
const p = h.props.id || m(w);
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
|
|
113
|
+
return /* @__PURE__ */ P(
|
|
114
|
+
H,
|
|
115
115
|
{
|
|
116
116
|
...h.props,
|
|
117
117
|
key: p,
|
|
@@ -129,24 +129,24 @@ function Ue({
|
|
|
129
129
|
] });
|
|
130
130
|
}
|
|
131
131
|
function ce() {
|
|
132
|
-
const [
|
|
132
|
+
const [n, a] = x(0);
|
|
133
133
|
return A(() => {
|
|
134
134
|
const t = setInterval(() => {
|
|
135
135
|
a((r) => (r + 1) % 3);
|
|
136
136
|
}, 500);
|
|
137
137
|
return () => clearInterval(t);
|
|
138
|
-
}, []), /* @__PURE__ */
|
|
138
|
+
}, []), /* @__PURE__ */ d("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((t) => /* @__PURE__ */ d(
|
|
139
139
|
"div",
|
|
140
140
|
{
|
|
141
141
|
className: y(
|
|
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
|
)
|
|
145
145
|
},
|
|
146
146
|
t
|
|
147
147
|
)) });
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const ue = {
|
|
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 de = {
|
|
|
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
|
+
}, fe = {
|
|
158
158
|
stripped: "",
|
|
159
159
|
fitted: "size-fit",
|
|
160
160
|
sm: "px-2 py-1 text-sm",
|
|
@@ -162,7 +162,7 @@ const de = {
|
|
|
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
|
+
}, me = {
|
|
166
166
|
none: "rounded-none",
|
|
167
167
|
sm: "rounded-sm",
|
|
168
168
|
md: "rounded-md",
|
|
@@ -173,24 +173,24 @@ const de = {
|
|
|
173
173
|
size: "md",
|
|
174
174
|
rounded: "md"
|
|
175
175
|
};
|
|
176
|
-
function
|
|
177
|
-
variant:
|
|
176
|
+
function be({
|
|
177
|
+
variant: n = K.variant,
|
|
178
178
|
size: a,
|
|
179
179
|
rounded: t = K.rounded,
|
|
180
180
|
loading: r,
|
|
181
181
|
linkTo: e,
|
|
182
|
-
linkProps:
|
|
182
|
+
linkProps: o,
|
|
183
183
|
type: s = "button",
|
|
184
184
|
className: l,
|
|
185
185
|
...u
|
|
186
186
|
}) {
|
|
187
|
-
let
|
|
188
|
-
|
|
187
|
+
let c;
|
|
188
|
+
n === "link" && !a ? c = "fitted" : c = a || K.size;
|
|
189
189
|
const i = y(
|
|
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
|
+
ue[n],
|
|
192
|
+
fe[c],
|
|
193
|
+
me[t],
|
|
194
194
|
r && "relative pointer-events-none",
|
|
195
195
|
e && "relative",
|
|
196
196
|
l
|
|
@@ -200,22 +200,22 @@ function me({
|
|
|
200
200
|
{
|
|
201
201
|
...u,
|
|
202
202
|
role: e ? "link" : u.role,
|
|
203
|
-
"aria-label": u["aria-label"] || (
|
|
204
|
-
"aria-description": u["aria-description"] || (
|
|
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
205
|
"aria-disabled": u.disabled || r,
|
|
206
206
|
"aria-busy": r,
|
|
207
207
|
type: s,
|
|
208
208
|
className: i,
|
|
209
209
|
children: [
|
|
210
|
-
r && /* @__PURE__ */
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
e && !u.disabled && /* @__PURE__ */
|
|
210
|
+
r && /* @__PURE__ */ d(ce, {}),
|
|
211
|
+
/* @__PURE__ */ d("span", { className: y(r && "invisible"), children: u.children }),
|
|
212
|
+
e && !u.disabled && /* @__PURE__ */ d(
|
|
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,37 +223,37 @@ function me({
|
|
|
223
223
|
}
|
|
224
224
|
);
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function he(n) {
|
|
227
227
|
const [a, t] = x(""), r = I((e) => {
|
|
228
|
-
let
|
|
229
|
-
for (;
|
|
230
|
-
const l = window.getComputedStyle(
|
|
231
|
-
l && l !== "transparent" && l !== "rgba(0, 0, 0, 0)" && (s = l),
|
|
228
|
+
let o = e, s = "";
|
|
229
|
+
for (; o && !s; ) {
|
|
230
|
+
const l = window.getComputedStyle(o).backgroundColor;
|
|
231
|
+
l && l !== "transparent" && l !== "rgba(0, 0, 0, 0)" && (s = l), o = o.parentElement;
|
|
232
232
|
}
|
|
233
233
|
return s || "transparent";
|
|
234
234
|
}, []);
|
|
235
235
|
return A(() => {
|
|
236
|
-
const e = document.getElementById(
|
|
236
|
+
const e = document.getElementById(n);
|
|
237
237
|
if (e) {
|
|
238
|
-
const
|
|
239
|
-
t(
|
|
238
|
+
const o = r(e.parentElement);
|
|
239
|
+
t(o);
|
|
240
240
|
}
|
|
241
|
-
}, [
|
|
241
|
+
}, [n, r]), a;
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
ref:
|
|
243
|
+
function Qe({
|
|
244
|
+
ref: n,
|
|
245
245
|
id: a,
|
|
246
246
|
size: t = 20,
|
|
247
247
|
color: r,
|
|
248
248
|
filled: e = !1,
|
|
249
|
-
rounded:
|
|
249
|
+
rounded: o = !0,
|
|
250
250
|
checked: s = !1,
|
|
251
251
|
onCheckedChange: l,
|
|
252
252
|
disabled: u,
|
|
253
|
-
className:
|
|
253
|
+
className: c = "",
|
|
254
254
|
...b
|
|
255
255
|
}) {
|
|
256
|
-
const i = $(), v =
|
|
256
|
+
const i = $(), v = _(() => a || `checkbox-${i}`, [a, i]), f = he(v), [m, g] = x(s);
|
|
257
257
|
A(() => {
|
|
258
258
|
g(s);
|
|
259
259
|
}, [s]);
|
|
@@ -263,17 +263,17 @@ function _e({
|
|
|
263
263
|
N.key === " " && (N.preventDefault(), h());
|
|
264
264
|
}, p = y(
|
|
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
|
+
c
|
|
270
270
|
);
|
|
271
|
-
return /* @__PURE__ */
|
|
271
|
+
return /* @__PURE__ */ d(
|
|
272
272
|
"button",
|
|
273
273
|
{
|
|
274
274
|
id: v,
|
|
275
275
|
type: "button",
|
|
276
|
-
ref:
|
|
276
|
+
ref: n,
|
|
277
277
|
tabIndex: 0,
|
|
278
278
|
role: "checkbox",
|
|
279
279
|
onClick: h,
|
|
@@ -288,22 +288,22 @@ function _e({
|
|
|
288
288
|
},
|
|
289
289
|
className: p,
|
|
290
290
|
...b,
|
|
291
|
-
children: m && /* @__PURE__ */
|
|
291
|
+
children: m && /* @__PURE__ */ d(oe, { size: t, color: e ? f : void 0 })
|
|
292
292
|
}
|
|
293
293
|
);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
children:
|
|
295
|
+
function Me({
|
|
296
|
+
children: n,
|
|
297
297
|
className: a,
|
|
298
298
|
linkTo: t,
|
|
299
299
|
linkProps: r,
|
|
300
300
|
onButtonClick: e,
|
|
301
|
-
buttonProps:
|
|
301
|
+
buttonProps: o,
|
|
302
302
|
...s
|
|
303
303
|
}) {
|
|
304
304
|
return t && e && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */ E("div", { className: y("relative w-fit", a), ...s, children: [
|
|
305
|
-
|
|
306
|
-
t && /* @__PURE__ */
|
|
305
|
+
n,
|
|
306
|
+
t && /* @__PURE__ */ d(
|
|
307
307
|
"a",
|
|
308
308
|
{
|
|
309
309
|
...r,
|
|
@@ -312,20 +312,20 @@ function Qe({
|
|
|
312
312
|
className: y("absolute inset-0", r == null ? void 0 : r.className)
|
|
313
313
|
}
|
|
314
314
|
),
|
|
315
|
-
!t && e && /* @__PURE__ */
|
|
315
|
+
!t && e && /* @__PURE__ */ d(
|
|
316
316
|
"button",
|
|
317
317
|
{
|
|
318
|
-
...
|
|
318
|
+
...o,
|
|
319
319
|
type: "button",
|
|
320
320
|
onClick: e,
|
|
321
|
-
className: y("absolute inset-0 cursor-pointer",
|
|
321
|
+
className: y("absolute inset-0 cursor-pointer", o == null ? void 0 : o.className)
|
|
322
322
|
}
|
|
323
323
|
)
|
|
324
324
|
] });
|
|
325
325
|
}
|
|
326
|
-
function V({ elementId:
|
|
326
|
+
function V({ elementId: n, type: a, message: t }) {
|
|
327
327
|
return A(() => {
|
|
328
|
-
const r = document.getElementById(
|
|
328
|
+
const r = document.getElementById(n);
|
|
329
329
|
if (r) {
|
|
330
330
|
if (!t && a === "error") {
|
|
331
331
|
r.removeAttribute("data-error");
|
|
@@ -335,11 +335,11 @@ function V({ elementId: o, type: a, message: t }) {
|
|
|
335
335
|
r.removeAttribute("data-success");
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
|
-
return r.setAttribute("aria-describedby", `${
|
|
338
|
+
return r.setAttribute("aria-describedby", `${n}-${a}-message`), r.setAttribute("aria-invalid", a === "error" ? "true" : "false"), a === "error" && r.setAttribute("data-error", "true"), a === "success" && r.setAttribute("data-success", "true"), () => {
|
|
339
339
|
r.removeAttribute("aria-describedby"), r.removeAttribute("aria-invalid"), r.removeAttribute("data-error"), r.removeAttribute("data-success");
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
|
-
}, [
|
|
342
|
+
}, [n, a, t]), t ? /* @__PURE__ */ E(
|
|
343
343
|
"small",
|
|
344
344
|
{
|
|
345
345
|
className: y(
|
|
@@ -349,18 +349,18 @@ function V({ elementId: o, type: a, message: t }) {
|
|
|
349
349
|
),
|
|
350
350
|
role: "status",
|
|
351
351
|
children: [
|
|
352
|
-
a === "error" ? /* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */
|
|
352
|
+
a === "error" ? /* @__PURE__ */ d(de, {}) : /* @__PURE__ */ d(ae, {}),
|
|
353
|
+
/* @__PURE__ */ d("span", { id: `${n}-${a}-message`, children: t })
|
|
354
354
|
]
|
|
355
355
|
}
|
|
356
356
|
) : null;
|
|
357
357
|
}
|
|
358
|
-
const
|
|
358
|
+
const pe = {
|
|
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
|
+
}, ge = {
|
|
364
364
|
none: "rounded-none",
|
|
365
365
|
sm: "rounded-sm",
|
|
366
366
|
md: "rounded-md",
|
|
@@ -370,37 +370,37 @@ const he = {
|
|
|
370
370
|
variant: "default",
|
|
371
371
|
rounded: "none"
|
|
372
372
|
};
|
|
373
|
-
function
|
|
374
|
-
variant:
|
|
373
|
+
function Xe({
|
|
374
|
+
variant: n = X.variant,
|
|
375
375
|
rounded: a,
|
|
376
376
|
displayOnlyMode: t = !1,
|
|
377
377
|
errorMessage: r,
|
|
378
378
|
successMessage: e,
|
|
379
|
-
type:
|
|
379
|
+
type: o = "text",
|
|
380
380
|
className: s,
|
|
381
381
|
...l
|
|
382
382
|
}) {
|
|
383
|
-
const u = $(), [
|
|
383
|
+
const u = $(), [c, b] = x(!1);
|
|
384
384
|
let i = a;
|
|
385
|
-
|
|
385
|
+
n === "outline" && !a && (i = "md"), i = i || X.rounded;
|
|
386
386
|
const m = y(
|
|
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 && pe[n],
|
|
390
|
+
!t && ge[i],
|
|
391
|
+
o === "password" && "pr-10",
|
|
392
392
|
!t && "px-2 py-1",
|
|
393
393
|
t && "pointer-events-none",
|
|
394
394
|
s
|
|
395
395
|
);
|
|
396
396
|
return /* @__PURE__ */ E("div", { className: y(t && "cursor-text"), style: { height: l.height, width: l.width }, children: [
|
|
397
|
-
/* @__PURE__ */ E("div", { className: y(
|
|
398
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ E("div", { className: y(o === "password" && "relative"), children: [
|
|
398
|
+
/* @__PURE__ */ d(
|
|
399
399
|
"input",
|
|
400
400
|
{
|
|
401
401
|
...l,
|
|
402
402
|
id: u,
|
|
403
|
-
type:
|
|
403
|
+
type: o === "password" && c ? "text" : o,
|
|
404
404
|
"aria-disabled": l.disabled,
|
|
405
405
|
readOnly: t,
|
|
406
406
|
"aria-readonly": t || l["aria-readonly"],
|
|
@@ -409,75 +409,75 @@ function Me({
|
|
|
409
409
|
className: m
|
|
410
410
|
}
|
|
411
411
|
),
|
|
412
|
-
|
|
412
|
+
o === "password" && /* @__PURE__ */ d(
|
|
413
413
|
"button",
|
|
414
414
|
{
|
|
415
|
-
onClick: () => b(!
|
|
415
|
+
onClick: () => b(!c),
|
|
416
416
|
className: "absolute inset-y-0 right-0 px-2 hover:cursor-pointer",
|
|
417
417
|
"aria-label": "Toggle password visibility",
|
|
418
|
-
"data-state":
|
|
419
|
-
children:
|
|
418
|
+
"data-state": c ? "visible" : "hidden",
|
|
419
|
+
children: c ? /* @__PURE__ */ d(se, { size: 20 }) : /* @__PURE__ */ d(ie, { size: 20 })
|
|
420
420
|
}
|
|
421
421
|
)
|
|
422
422
|
] }),
|
|
423
|
-
!t && /* @__PURE__ */
|
|
424
|
-
!t && /* @__PURE__ */
|
|
423
|
+
!t && /* @__PURE__ */ d(V, { elementId: u, type: "error", message: r }),
|
|
424
|
+
!t && /* @__PURE__ */ d(V, { elementId: u, type: "success", message: e })
|
|
425
425
|
] });
|
|
426
426
|
}
|
|
427
|
-
function
|
|
428
|
-
display:
|
|
427
|
+
function Ze({
|
|
428
|
+
display: n = "inline",
|
|
429
429
|
width: a = "fit-content",
|
|
430
430
|
className: t = "",
|
|
431
431
|
required: r,
|
|
432
432
|
helpMessage: e,
|
|
433
|
-
suffix:
|
|
433
|
+
suffix: o,
|
|
434
434
|
htmlFor: s,
|
|
435
435
|
children: l,
|
|
436
436
|
...u
|
|
437
437
|
}) {
|
|
438
|
-
const
|
|
439
|
-
return /* @__PURE__ */ E("div", { style: { display:
|
|
438
|
+
const c = $(), b = y("font-medium", n, t), i = e ? `${s ?? c}-help` : void 0;
|
|
439
|
+
return /* @__PURE__ */ E("div", { style: { display: n === "inline" ? "inline-flex" : "flex", width: a }, className: "relative", children: [
|
|
440
440
|
/* @__PURE__ */ E("label", { className: b, htmlFor: s, ...u, children: [
|
|
441
441
|
l,
|
|
442
|
-
r && /* @__PURE__ */
|
|
442
|
+
r && /* @__PURE__ */ d("span", { className: "text-red-500 font-medium ml-1", "aria-label": "required", children: "*" })
|
|
443
443
|
] }),
|
|
444
|
-
e && /* @__PURE__ */
|
|
444
|
+
e && /* @__PURE__ */ d(
|
|
445
445
|
"span",
|
|
446
446
|
{
|
|
447
447
|
className: "text-gray-500 ml-1 size-fit -translate-y-1/3",
|
|
448
448
|
"aria-describedby": i,
|
|
449
449
|
"aria-label": "Help information",
|
|
450
450
|
title: e,
|
|
451
|
-
children: /* @__PURE__ */
|
|
451
|
+
children: /* @__PURE__ */ d(le, {})
|
|
452
452
|
}
|
|
453
453
|
),
|
|
454
|
-
e && /* @__PURE__ */
|
|
455
|
-
|
|
454
|
+
e && /* @__PURE__ */ d("div", { id: i, className: "sr-only", children: e }),
|
|
455
|
+
o && /* @__PURE__ */ d("span", { className: "ml-1", children: o })
|
|
456
456
|
] });
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function ve(n) {
|
|
459
459
|
const [a, t] = x(!1), [r, e] = x(!1);
|
|
460
460
|
return A(() => {
|
|
461
|
-
|
|
462
|
-
}, [
|
|
461
|
+
n ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 150));
|
|
462
|
+
}, [n]), { show: a, shouldRender: r };
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function ye(n, a) {
|
|
465
465
|
A(() => {
|
|
466
466
|
const t = (r) => {
|
|
467
|
-
r.key === "Escape" &&
|
|
467
|
+
r.key === "Escape" && n && a();
|
|
468
468
|
};
|
|
469
|
-
return document.addEventListener("keydown", t),
|
|
469
|
+
return document.addEventListener("keydown", t), n && (document.body.style.overflow = "hidden"), () => {
|
|
470
470
|
document.removeEventListener("keydown", t), document.body.style.overflow = "auto";
|
|
471
471
|
};
|
|
472
|
-
}, [
|
|
472
|
+
}, [n, a]);
|
|
473
473
|
}
|
|
474
|
-
function we(
|
|
474
|
+
function we(n, a) {
|
|
475
475
|
const t = R(null), r = I(() => {
|
|
476
|
-
const e = document.getElementById(
|
|
476
|
+
const e = document.getElementById(n);
|
|
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,34 +493,34 @@ function we(o, a) {
|
|
|
493
493
|
return;
|
|
494
494
|
}
|
|
495
495
|
e.focus();
|
|
496
|
-
}, [
|
|
496
|
+
}, [n]);
|
|
497
497
|
A(() => (a && (t.current = document.activeElement, r()), () => {
|
|
498
498
|
document.body.style.overflow = "auto", t.current instanceof HTMLElement && t.current.focus();
|
|
499
499
|
}), [a, r]);
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
id:
|
|
501
|
+
function Je({
|
|
502
|
+
id: n,
|
|
503
503
|
isOpen: a,
|
|
504
504
|
onClose: t,
|
|
505
505
|
title: r,
|
|
506
506
|
children: e,
|
|
507
|
-
contentOnly:
|
|
507
|
+
contentOnly: o = !1,
|
|
508
508
|
className: s,
|
|
509
509
|
overlayClassName: l,
|
|
510
510
|
hideCloseButton: u = !1,
|
|
511
|
-
actions:
|
|
511
|
+
actions: c = [],
|
|
512
512
|
disableCloseOnOverlayClick: b = !1,
|
|
513
513
|
ariaLabelledBy: i,
|
|
514
514
|
ariaDescribedBy: v
|
|
515
515
|
}) {
|
|
516
|
-
const f = $(), m =
|
|
517
|
-
if (we(m, w),
|
|
518
|
-
const p = () => r ? z.isValidElement(r) ? /* @__PURE__ */
|
|
519
|
-
const { label: L, className:
|
|
520
|
-
return /* @__PURE__ */
|
|
516
|
+
const f = $(), m = n || `modal-${f}`, g = n ? `${n}-title` : `modal-title-${f}`, { show: h, shouldRender: w } = ve(a);
|
|
517
|
+
if (we(m, w), ye(w, t), !w) return null;
|
|
518
|
+
const p = () => r ? z.isValidElement(r) ? /* @__PURE__ */ d("div", { className: "mb-4", children: r }) : /* @__PURE__ */ d("h2", { className: "mb-4 text-xl font-semibold", id: g, children: r }) : null, N = () => c.length === 0 ? null : /* @__PURE__ */ d("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: c.map((k, C) => {
|
|
519
|
+
const { label: L, className: S, ...B } = k;
|
|
520
|
+
return /* @__PURE__ */ d(be, { className: S, type: "button", ...B, "data-modal-action": "true", children: L }, C);
|
|
521
521
|
}) });
|
|
522
|
-
return /* @__PURE__ */
|
|
523
|
-
/* @__PURE__ */
|
|
522
|
+
return /* @__PURE__ */ d(W, { children: U(
|
|
523
|
+
/* @__PURE__ */ d(
|
|
524
524
|
"div",
|
|
525
525
|
{
|
|
526
526
|
"aria-labelledby": i ?? r ? g : void 0,
|
|
@@ -529,35 +529,35 @@ function Ze({
|
|
|
529
529
|
"aria-modal": "true",
|
|
530
530
|
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
531
531
|
children: /* @__PURE__ */ E("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
|
|
532
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ d(
|
|
533
533
|
"div",
|
|
534
534
|
{
|
|
535
|
-
className:
|
|
535
|
+
className: D("fixed inset-0 bg-black/20 transition-all", l),
|
|
536
536
|
onClick: () => {
|
|
537
537
|
b || t();
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
540
|
),
|
|
541
|
-
|
|
542
|
-
!
|
|
541
|
+
o && /* @__PURE__ */ d("div", { className: D("relative w-fit", s), children: e }),
|
|
542
|
+
!o && /* @__PURE__ */ E(
|
|
543
543
|
"div",
|
|
544
544
|
{
|
|
545
545
|
id: m,
|
|
546
546
|
tabIndex: -1,
|
|
547
|
-
className:
|
|
547
|
+
className: D(
|
|
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
|
h ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
550
550
|
s
|
|
551
551
|
),
|
|
552
552
|
children: [
|
|
553
|
-
!u && /* @__PURE__ */
|
|
553
|
+
!u && /* @__PURE__ */ d(
|
|
554
554
|
"button",
|
|
555
555
|
{
|
|
556
556
|
type: "button",
|
|
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__ */
|
|
560
|
+
children: /* @__PURE__ */ d(O, { size: 18 })
|
|
561
561
|
}
|
|
562
562
|
),
|
|
563
563
|
p(),
|
|
@@ -572,29 +572,29 @@ function Ze({
|
|
|
572
572
|
document.body
|
|
573
573
|
) });
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function xe(n) {
|
|
576
576
|
const [a, t] = x(!1), [r, e] = x(!1);
|
|
577
577
|
return A(() => {
|
|
578
|
-
|
|
579
|
-
}, [
|
|
578
|
+
n ? (e(!0), setTimeout(() => t(!0), 10)) : (t(!1), setTimeout(() => e(!1), 300));
|
|
579
|
+
}, [n]), { show: a, shouldRender: r };
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function Ee(n, a) {
|
|
582
582
|
A(() => {
|
|
583
583
|
const t = (r) => {
|
|
584
|
-
r.key === "Escape" &&
|
|
584
|
+
r.key === "Escape" && n && a();
|
|
585
585
|
};
|
|
586
|
-
return document.addEventListener("keydown", t),
|
|
586
|
+
return document.addEventListener("keydown", t), n && (document.body.style.overflow = "hidden"), () => {
|
|
587
587
|
document.removeEventListener("keydown", t), document.body.style.overflow = "auto";
|
|
588
588
|
};
|
|
589
|
-
}, [
|
|
589
|
+
}, [n, a]);
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function Ne(n, a) {
|
|
592
592
|
const t = R(null), r = I(() => {
|
|
593
|
-
const e = document.getElementById(
|
|
593
|
+
const e = document.getElementById(n);
|
|
594
594
|
if (!e) return;
|
|
595
|
-
const
|
|
596
|
-
if (
|
|
597
|
-
|
|
595
|
+
const o = e.querySelectorAll('[data-panel-action="true"]');
|
|
596
|
+
if (o.length > 0) {
|
|
597
|
+
o[0].focus();
|
|
598
598
|
return;
|
|
599
599
|
}
|
|
600
600
|
const s = e.querySelectorAll(
|
|
@@ -610,12 +610,12 @@ function Ee(o, a) {
|
|
|
610
610
|
return;
|
|
611
611
|
}
|
|
612
612
|
e.focus();
|
|
613
|
-
}, [
|
|
613
|
+
}, [n]);
|
|
614
614
|
A(() => (a && (t.current = document.activeElement, r()), () => {
|
|
615
615
|
document.body.style.overflow = "auto", t.current instanceof HTMLElement && t.current.focus();
|
|
616
616
|
}), [a, r]);
|
|
617
617
|
}
|
|
618
|
-
const
|
|
618
|
+
const Ae = {
|
|
619
619
|
size: {
|
|
620
620
|
sm: "max-w-sm",
|
|
621
621
|
md: "max-w-md",
|
|
@@ -626,33 +626,33 @@ const Ne = {
|
|
|
626
626
|
screen: "w-screen"
|
|
627
627
|
}
|
|
628
628
|
};
|
|
629
|
-
function
|
|
630
|
-
ref:
|
|
629
|
+
function Ye({
|
|
630
|
+
ref: n,
|
|
631
631
|
id: a,
|
|
632
632
|
isOpen: t,
|
|
633
633
|
onClose: r,
|
|
634
634
|
title: e,
|
|
635
|
-
children:
|
|
635
|
+
children: o,
|
|
636
636
|
footer: s,
|
|
637
637
|
size: l = "md",
|
|
638
638
|
className: u,
|
|
639
|
-
overlayClassName:
|
|
639
|
+
overlayClassName: c,
|
|
640
640
|
hideCloseButton: b = !1,
|
|
641
641
|
disableCloseOnOverlayClick: i = !1,
|
|
642
642
|
ariaLabelledBy: v,
|
|
643
643
|
ariaDescribedBy: f
|
|
644
644
|
}) {
|
|
645
|
-
const m = $(), g = a || `panel-${m}`, h = a ? `${a}-title` : `panel-title-${m}`, { show: w, shouldRender: p } =
|
|
646
|
-
if (
|
|
647
|
-
const N = () => e ? z.isValidElement(e) ? /* @__PURE__ */
|
|
645
|
+
const m = $(), g = a || `panel-${m}`, h = a ? `${a}-title` : `panel-title-${m}`, { show: w, shouldRender: p } = xe(t);
|
|
646
|
+
if (Ne(g, p), Ee(p, r), !p) return null;
|
|
647
|
+
const N = () => e ? z.isValidElement(e) ? /* @__PURE__ */ d("div", { children: e }) : /* @__PURE__ */ d("h2", { className: "text-2xl font-semibold", id: h, children: e }) : null, k = () => {
|
|
648
648
|
if (!s) return null;
|
|
649
649
|
if (z.isValidElement(s)) {
|
|
650
650
|
const C = s, L = C.props.className || "";
|
|
651
|
-
return z.cloneElement(C, { className:
|
|
651
|
+
return z.cloneElement(C, { className: D("px-6 py-4", L) });
|
|
652
652
|
}
|
|
653
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ d("div", { className: "px-6 py-4", children: s });
|
|
654
654
|
};
|
|
655
|
-
return /* @__PURE__ */
|
|
655
|
+
return /* @__PURE__ */ d(W, { children: U(
|
|
656
656
|
/* @__PURE__ */ E(
|
|
657
657
|
"div",
|
|
658
658
|
{
|
|
@@ -663,36 +663,36 @@ function Je({
|
|
|
663
663
|
className: "fixed inset-0 z-[100] overflow-hidden",
|
|
664
664
|
"data-panel-open": t,
|
|
665
665
|
children: [
|
|
666
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ d(
|
|
667
667
|
"div",
|
|
668
668
|
{
|
|
669
|
-
className:
|
|
669
|
+
className: D(
|
|
670
670
|
"fixed inset-0 bg-black/40 transition-opacity duration-300",
|
|
671
671
|
w ? "opacity-100" : "opacity-0",
|
|
672
|
-
|
|
672
|
+
c
|
|
673
673
|
),
|
|
674
674
|
onClick: () => {
|
|
675
675
|
i || r();
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
678
|
),
|
|
679
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ d("div", { className: "fixed inset-y-0 right-0 flex max-w-full", children: /* @__PURE__ */ d(
|
|
680
680
|
"div",
|
|
681
681
|
{
|
|
682
682
|
id: g,
|
|
683
|
-
ref:
|
|
683
|
+
ref: n,
|
|
684
684
|
tabIndex: -1,
|
|
685
|
-
className:
|
|
685
|
+
className: D(
|
|
686
686
|
"relative h-full transform shadow-xl bg-popover transition-transform duration-300 ease-in-out",
|
|
687
687
|
l !== "screen" && "border-l border-border",
|
|
688
|
-
|
|
688
|
+
Ae.size[l],
|
|
689
689
|
w ? "translate-x-0" : "translate-x-full",
|
|
690
690
|
u
|
|
691
691
|
),
|
|
692
692
|
"data-panel-size": l,
|
|
693
693
|
children: /* @__PURE__ */ E("div", { className: "flex h-full flex-col", children: [
|
|
694
|
-
e && /* @__PURE__ */
|
|
695
|
-
!b && /* @__PURE__ */
|
|
694
|
+
e && /* @__PURE__ */ d("div", { className: "px-6 pt-6", children: N() }),
|
|
695
|
+
!b && /* @__PURE__ */ d(
|
|
696
696
|
"button",
|
|
697
697
|
{
|
|
698
698
|
type: "button",
|
|
@@ -700,11 +700,11 @@ function Je({
|
|
|
700
700
|
"data-panel-close-button": "true",
|
|
701
701
|
"aria-label": "Close panel",
|
|
702
702
|
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",
|
|
703
|
-
children: /* @__PURE__ */
|
|
703
|
+
children: /* @__PURE__ */ d(O, { size: 18 })
|
|
704
704
|
}
|
|
705
705
|
),
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
|
|
706
|
+
/* @__PURE__ */ d("div", { className: D("flex-1 overflow-y-auto px-6 pb-6", e ? "pt-6" : "pt-10"), children: o }),
|
|
707
|
+
k()
|
|
708
708
|
] })
|
|
709
709
|
}
|
|
710
710
|
) })
|
|
@@ -714,7 +714,7 @@ function Je({
|
|
|
714
714
|
document.body
|
|
715
715
|
) });
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function Ce({ itemId: n, checked: a, onChange: t, name: r, disabled: e = !1, className: o = "" }) {
|
|
718
718
|
const s = "relative inline-flex items-center justify-center rounded-full", l = () => {
|
|
719
719
|
e || t();
|
|
720
720
|
}, u = y(
|
|
@@ -722,18 +722,18 @@ function Ae({ itemId: o, checked: a, onChange: t, name: r, disabled: e = !1, cla
|
|
|
722
722
|
!a && "hover:border-current/60",
|
|
723
723
|
!e && "border-current cursor-pointer",
|
|
724
724
|
e && "border-muted/60 cursor-not-allowed",
|
|
725
|
-
|
|
725
|
+
o
|
|
726
726
|
);
|
|
727
|
-
return /* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ d(
|
|
728
728
|
"div",
|
|
729
729
|
{
|
|
730
|
-
id:
|
|
730
|
+
id: n,
|
|
731
731
|
role: "radio",
|
|
732
732
|
tabIndex: -1,
|
|
733
733
|
"aria-checked": a,
|
|
734
734
|
"aria-disabled": e,
|
|
735
735
|
"aria-description": `Radio button for ${r}`,
|
|
736
|
-
"aria-labelledby": `${
|
|
736
|
+
"aria-labelledby": `${n}-label`,
|
|
737
737
|
onClick: l,
|
|
738
738
|
className: u,
|
|
739
739
|
style: {
|
|
@@ -742,7 +742,7 @@ function Ae({ itemId: o, checked: a, onChange: t, name: r, disabled: e = !1, cla
|
|
|
742
742
|
padding: "0.1em",
|
|
743
743
|
borderWidth: "0.06em"
|
|
744
744
|
},
|
|
745
|
-
children: a && /* @__PURE__ */
|
|
745
|
+
children: a && /* @__PURE__ */ d(
|
|
746
746
|
"div",
|
|
747
747
|
{
|
|
748
748
|
className: y("size-full aspect-square rounded-full", e && "bg-muted/60", !e && "bg-current")
|
|
@@ -752,18 +752,18 @@ function Ae({ itemId: o, checked: a, onChange: t, name: r, disabled: e = !1, cla
|
|
|
752
752
|
);
|
|
753
753
|
}
|
|
754
754
|
function G({
|
|
755
|
-
value:
|
|
755
|
+
value: n,
|
|
756
756
|
children: a,
|
|
757
757
|
className: t = "",
|
|
758
758
|
isSelected: r = !1,
|
|
759
759
|
onChange: e,
|
|
760
|
-
disabled:
|
|
760
|
+
disabled: o = !1,
|
|
761
761
|
hideInput: s = !1,
|
|
762
762
|
description: l,
|
|
763
763
|
name: u
|
|
764
764
|
}) {
|
|
765
|
-
const b = `radio-${$()}-${
|
|
766
|
-
|
|
765
|
+
const b = `radio-${$()}-${n}`, i = () => {
|
|
766
|
+
o || e == null || e(n);
|
|
767
767
|
};
|
|
768
768
|
return /* @__PURE__ */ E(
|
|
769
769
|
"div",
|
|
@@ -773,27 +773,27 @@ function G({
|
|
|
773
773
|
"relative flex items-center",
|
|
774
774
|
t,
|
|
775
775
|
// Uses text color for borders
|
|
776
|
-
s && `p-2 border-2 focus-within:border-dashed focus-within:${
|
|
777
|
-
s && !r && `border-transparent ${
|
|
776
|
+
s && `p-2 border-2 focus-within:border-dashed focus-within:${o ? "border-current/50" : "border-current/80"}`,
|
|
777
|
+
s && !r && `border-transparent ${o ? "" : "not-focus-within:hover:border-border/60"}`,
|
|
778
778
|
s && r && "border-border",
|
|
779
|
-
|
|
779
|
+
o && "opacity-60 cursor-not-allowed"
|
|
780
780
|
),
|
|
781
781
|
style: {
|
|
782
782
|
gap: "0.5em"
|
|
783
783
|
},
|
|
784
784
|
children: [
|
|
785
|
-
!s && /* @__PURE__ */
|
|
786
|
-
|
|
785
|
+
!s && /* @__PURE__ */ d(
|
|
786
|
+
Ce,
|
|
787
787
|
{
|
|
788
788
|
itemId: b,
|
|
789
789
|
name: u || "",
|
|
790
790
|
checked: r,
|
|
791
791
|
onChange: i,
|
|
792
|
-
disabled:
|
|
792
|
+
disabled: o,
|
|
793
793
|
className: y(s && "")
|
|
794
794
|
}
|
|
795
795
|
),
|
|
796
|
-
/* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ d(
|
|
797
797
|
"div",
|
|
798
798
|
{
|
|
799
799
|
id: s ? b : void 0,
|
|
@@ -801,16 +801,16 @@ function G({
|
|
|
801
801
|
role: s ? "radio" : void 0,
|
|
802
802
|
onClick: s ? i : void 0,
|
|
803
803
|
"aria-checked": s ? r ? "true" : "false" : void 0,
|
|
804
|
-
"aria-disabled": s ?
|
|
804
|
+
"aria-disabled": s ? o : void 0,
|
|
805
805
|
"aria-description": s ? l || `Radio button for ${u}` : void 0,
|
|
806
806
|
"aria-labelledby": s ? `${b}-label` : void 0,
|
|
807
807
|
className: y(s && "size-full", typeof a == "object" && "grow focus:outline-none"),
|
|
808
|
-
children: /* @__PURE__ */
|
|
808
|
+
children: /* @__PURE__ */ d(
|
|
809
809
|
"label",
|
|
810
810
|
{
|
|
811
811
|
id: `${b}-label`,
|
|
812
812
|
onClick: s ? void 0 : i,
|
|
813
|
-
className: y(
|
|
813
|
+
className: y(o && "cursor-not-allowed", !o && "cursor-pointer"),
|
|
814
814
|
children: a
|
|
815
815
|
}
|
|
816
816
|
)
|
|
@@ -820,12 +820,12 @@ function G({
|
|
|
820
820
|
}
|
|
821
821
|
);
|
|
822
822
|
}
|
|
823
|
-
function
|
|
824
|
-
const [t, r] = x(a), [e,
|
|
823
|
+
function Ie(n, a) {
|
|
824
|
+
const [t, r] = x(a), [e, o] = x(-1), [s, l] = x(!1), u = I((f, m) => {
|
|
825
825
|
var w;
|
|
826
826
|
const g = f[m];
|
|
827
|
-
g.hasAttribute("disabled") || g.getAttribute("aria-disabled") === "true" || ((w = f[m]) == null || w.click(),
|
|
828
|
-
}, []),
|
|
827
|
+
g.hasAttribute("disabled") || g.getAttribute("aria-disabled") === "true" || ((w = f[m]) == null || w.click(), o(m));
|
|
828
|
+
}, []), c = I(
|
|
829
829
|
(f, m) => {
|
|
830
830
|
var h;
|
|
831
831
|
if (f.preventDefault(), s || !m.length) return;
|
|
@@ -843,16 +843,16 @@ function Ce(o, a) {
|
|
|
843
843
|
document.querySelectorAll(
|
|
844
844
|
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
845
845
|
)
|
|
846
|
-
).filter((p) => !p.hasAttribute("disabled") && p.tabIndex >= 0), g = m.findIndex((p) => p.id ===
|
|
846
|
+
).filter((p) => !p.hasAttribute("disabled") && p.tabIndex >= 0), g = m.findIndex((p) => p.id === n), h = g > 0 ? g - 1 : m.length - 1;
|
|
847
847
|
(w = m[h]) == null || w.focus();
|
|
848
848
|
},
|
|
849
|
-
[
|
|
849
|
+
[n]
|
|
850
850
|
), i = I(
|
|
851
851
|
(f, m) => {
|
|
852
852
|
var N;
|
|
853
853
|
if (!m.length) return;
|
|
854
854
|
const g = f.target;
|
|
855
|
-
if (!m.some((
|
|
855
|
+
if (!m.some((k) => k.id === g.id)) return;
|
|
856
856
|
const w = t !== -1 ? t : 0;
|
|
857
857
|
let p = w;
|
|
858
858
|
switch (f.key) {
|
|
@@ -878,42 +878,42 @@ function Ce(o, a) {
|
|
|
878
878
|
},
|
|
879
879
|
[t, e, b, u]
|
|
880
880
|
), v = I(() => {
|
|
881
|
-
const f = document.querySelector(`[id="${
|
|
881
|
+
const f = document.querySelector(`[id="${n}"][role="radiogroup"]`);
|
|
882
882
|
return f ? Array.from(f.querySelectorAll('[role="radio"]')) : [];
|
|
883
|
-
}, [
|
|
883
|
+
}, [n]);
|
|
884
884
|
A(() => {
|
|
885
|
-
const f = document.querySelector(`[id="${
|
|
885
|
+
const f = document.querySelector(`[id="${n}"][role="radiogroup"]`);
|
|
886
886
|
if (!f) return;
|
|
887
|
-
const m = v(), g = (N) =>
|
|
887
|
+
const m = v(), g = (N) => c(N, m), h = (N) => i(N, m), w = () => l(!0), p = () => l(!1);
|
|
888
888
|
return document.addEventListener("keydown", h), f.addEventListener("focus", g), f.addEventListener("mousedown", w), document.addEventListener("mouseup", p), () => {
|
|
889
889
|
document.removeEventListener("keydown", h), f.removeEventListener("focus", g), f.removeEventListener("mousedown", w), document.removeEventListener("mouseup", p);
|
|
890
890
|
};
|
|
891
|
-
}, [
|
|
891
|
+
}, [n, v, c, i]);
|
|
892
892
|
}
|
|
893
|
-
function
|
|
894
|
-
options:
|
|
893
|
+
function Pe({
|
|
894
|
+
options: n = [],
|
|
895
895
|
value: a,
|
|
896
896
|
onChange: t,
|
|
897
897
|
id: r,
|
|
898
898
|
children: e,
|
|
899
|
-
className:
|
|
899
|
+
className: o = "",
|
|
900
900
|
childrenClassName: s = "",
|
|
901
901
|
hideInputs: l = !1
|
|
902
902
|
}) {
|
|
903
|
-
const u = $(),
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
903
|
+
const u = $(), c = r || `radio-group-${u}`;
|
|
904
|
+
Ie(
|
|
905
|
+
c,
|
|
906
|
+
n.findIndex((i) => i === a)
|
|
907
907
|
);
|
|
908
|
-
const b =
|
|
909
|
-
return /* @__PURE__ */ E("div", { id:
|
|
910
|
-
b.length > 0 && b.map((i, v) => /* @__PURE__ */
|
|
908
|
+
const b = _(() => n.reduce((i, v) => (typeof v == "string" ? i.some((f) => f.value === v) || i.push({ label: v, value: v }) : i.push(v), i), []), [n]);
|
|
909
|
+
return /* @__PURE__ */ E("div", { id: c, role: "radiogroup", tabIndex: 0, className: y(o, "focus:outline-none"), children: [
|
|
910
|
+
b.length > 0 && b.map((i, v) => /* @__PURE__ */ d(
|
|
911
911
|
G,
|
|
912
912
|
{
|
|
913
913
|
value: i.value,
|
|
914
914
|
isSelected: a === i.value,
|
|
915
915
|
onChange: t,
|
|
916
|
-
name:
|
|
916
|
+
name: c,
|
|
917
917
|
disabled: i.disabled,
|
|
918
918
|
description: i.description,
|
|
919
919
|
hideInput: l,
|
|
@@ -922,7 +922,7 @@ function Ye({
|
|
|
922
922
|
},
|
|
923
923
|
`${i.value}-${v}`
|
|
924
924
|
)),
|
|
925
|
-
b.length === 0 && e && z.Children.map(e, (i) => z.isValidElement(i) && i.type === G ? /* @__PURE__ */
|
|
925
|
+
b.length === 0 && e && z.Children.map(e, (i) => z.isValidElement(i) && i.type === G ? /* @__PURE__ */ d(
|
|
926
926
|
G,
|
|
927
927
|
{
|
|
928
928
|
...i.props,
|
|
@@ -930,13 +930,13 @@ function Ye({
|
|
|
930
930
|
hideInput: i.props.hideInput || l,
|
|
931
931
|
isSelected: a === i.props.value,
|
|
932
932
|
onChange: t,
|
|
933
|
-
name:
|
|
933
|
+
name: c,
|
|
934
934
|
children: i.props.children
|
|
935
935
|
}
|
|
936
936
|
) : null)
|
|
937
937
|
] });
|
|
938
938
|
}
|
|
939
|
-
const
|
|
939
|
+
const $e = {
|
|
940
940
|
thin: {
|
|
941
941
|
horizontal: "h-px",
|
|
942
942
|
vertical: "w-px"
|
|
@@ -953,64 +953,130 @@ const Ie = {
|
|
|
953
953
|
horizontal: "h-2",
|
|
954
954
|
vertical: "w-2"
|
|
955
955
|
}
|
|
956
|
-
},
|
|
956
|
+
}, Te = {
|
|
957
957
|
horizontal: "w-full",
|
|
958
958
|
vertical: "min-h-4 h-full"
|
|
959
959
|
};
|
|
960
|
-
function
|
|
961
|
-
orientation:
|
|
960
|
+
function Oe({
|
|
961
|
+
orientation: n = "horizontal",
|
|
962
962
|
decorative: a = !1,
|
|
963
963
|
thickness: t = "thin",
|
|
964
964
|
className: r,
|
|
965
965
|
...e
|
|
966
966
|
}) {
|
|
967
|
-
const
|
|
967
|
+
const o = y(
|
|
968
968
|
"shrink-0 bg-border",
|
|
969
|
-
|
|
970
|
-
|
|
969
|
+
Te[n],
|
|
970
|
+
$e[t][n],
|
|
971
971
|
r
|
|
972
972
|
);
|
|
973
|
-
return /* @__PURE__ */
|
|
973
|
+
return /* @__PURE__ */ d(
|
|
974
974
|
"div",
|
|
975
975
|
{
|
|
976
976
|
...e,
|
|
977
|
-
className:
|
|
977
|
+
className: o,
|
|
978
978
|
role: a ? "presentation" : "separator",
|
|
979
|
-
"aria-orientation": a ? void 0 :
|
|
979
|
+
"aria-orientation": a ? void 0 : n,
|
|
980
980
|
"aria-hidden": a,
|
|
981
|
-
"data-orientation":
|
|
981
|
+
"data-orientation": n,
|
|
982
982
|
"data-thickness": t
|
|
983
983
|
}
|
|
984
984
|
);
|
|
985
985
|
}
|
|
986
|
-
|
|
987
|
-
|
|
986
|
+
const Z = {
|
|
987
|
+
shape: {
|
|
988
|
+
rectangle: "rounded-md min-h-1",
|
|
989
|
+
circle: "rounded-full aspect-square min-h-1",
|
|
990
|
+
text: "rounded-sm min-h-1 h-4"
|
|
991
|
+
},
|
|
992
|
+
lineSpacing: {
|
|
993
|
+
xs: "space-y-1",
|
|
994
|
+
sm: "space-y-2",
|
|
995
|
+
md: "space-y-3",
|
|
996
|
+
lg: "space-y-4",
|
|
997
|
+
xl: "space-y-6"
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
function et({
|
|
1001
|
+
shape: n = "rectangle",
|
|
1002
|
+
lineSpacing: a = "sm",
|
|
1003
|
+
className: t,
|
|
1004
|
+
lines: r = 1,
|
|
1005
|
+
animate: e = !0,
|
|
1006
|
+
ref: o,
|
|
1007
|
+
...s
|
|
1008
|
+
}) {
|
|
1009
|
+
const l = y("bg-muted/70", e && "animate-pulse", Z.shape[n], t);
|
|
1010
|
+
return r > 1 ? /* @__PURE__ */ d(
|
|
1011
|
+
"div",
|
|
1012
|
+
{
|
|
1013
|
+
ref: o,
|
|
1014
|
+
className: Z.lineSpacing[a],
|
|
1015
|
+
role: "presentation",
|
|
1016
|
+
"aria-hidden": "true",
|
|
1017
|
+
"data-testid": "skeleton-container",
|
|
1018
|
+
"data-lines": r,
|
|
1019
|
+
"data-shape": n,
|
|
1020
|
+
"data-animate": e,
|
|
1021
|
+
...s,
|
|
1022
|
+
children: Array.from({ length: r }, (u, c) => /* @__PURE__ */ d(
|
|
1023
|
+
"div",
|
|
1024
|
+
{
|
|
1025
|
+
className: y(
|
|
1026
|
+
l,
|
|
1027
|
+
// Make last line shorter for a more natural text appearance
|
|
1028
|
+
c === r - 1 && "w-3/4"
|
|
1029
|
+
),
|
|
1030
|
+
role: "presentation",
|
|
1031
|
+
"aria-hidden": "true",
|
|
1032
|
+
"data-testid": "skeleton-line",
|
|
1033
|
+
"data-line-index": c
|
|
1034
|
+
},
|
|
1035
|
+
c
|
|
1036
|
+
))
|
|
1037
|
+
}
|
|
1038
|
+
) : /* @__PURE__ */ d(
|
|
1039
|
+
"div",
|
|
1040
|
+
{
|
|
1041
|
+
ref: o,
|
|
1042
|
+
className: l,
|
|
1043
|
+
role: "presentation",
|
|
1044
|
+
"aria-hidden": "true",
|
|
1045
|
+
"data-testid": "skeleton",
|
|
1046
|
+
"data-shape": n,
|
|
1047
|
+
"data-animate": e,
|
|
1048
|
+
...s
|
|
1049
|
+
}
|
|
1050
|
+
);
|
|
1051
|
+
}
|
|
1052
|
+
function tt({ children: n, ref: a, ...t }) {
|
|
1053
|
+
if (te(n)) {
|
|
988
1054
|
let r = { ...t };
|
|
989
|
-
return
|
|
1055
|
+
return n.props && (r = { ...r, ...n.props }), re(n, {
|
|
990
1056
|
...r,
|
|
991
1057
|
ref: (e) => {
|
|
992
1058
|
typeof a == "function" ? a(e) : a && (a.current = e);
|
|
993
1059
|
}
|
|
994
1060
|
});
|
|
995
1061
|
}
|
|
996
|
-
return
|
|
1062
|
+
return P("div", { ...t, ref: a }, n);
|
|
997
1063
|
}
|
|
998
|
-
function
|
|
1064
|
+
function ke({ elementId: n, maxLength: a }) {
|
|
999
1065
|
const [t, r] = x(0);
|
|
1000
1066
|
return A(() => {
|
|
1001
|
-
const e = document.getElementById(
|
|
1067
|
+
const e = document.getElementById(n);
|
|
1002
1068
|
if (!e)
|
|
1003
1069
|
return;
|
|
1004
|
-
const
|
|
1070
|
+
const o = () => {
|
|
1005
1071
|
const s = e.value.length;
|
|
1006
1072
|
r(s);
|
|
1007
1073
|
const l = s >= a;
|
|
1008
|
-
e.setAttribute("aria-describedby", `${
|
|
1074
|
+
e.setAttribute("aria-describedby", `${n}-character-count`), e.setAttribute("aria-invalid", l ? "true" : "false"), l ? e.setAttribute("data-error", "true") : e.removeAttribute("data-error");
|
|
1009
1075
|
};
|
|
1010
|
-
return
|
|
1011
|
-
e.removeEventListener("input",
|
|
1076
|
+
return o(), e.addEventListener("input", o), e.setAttribute("maxlength", String(a)), () => {
|
|
1077
|
+
e.removeEventListener("input", o), e.removeAttribute("maxlength"), e.removeAttribute("aria-describedby"), e.removeAttribute("aria-invalid"), e.removeAttribute("data-error");
|
|
1012
1078
|
};
|
|
1013
|
-
}, [
|
|
1079
|
+
}, [n, a]), /* @__PURE__ */ d(
|
|
1014
1080
|
"small",
|
|
1015
1081
|
{
|
|
1016
1082
|
className: y(
|
|
@@ -1019,7 +1085,7 @@ function Te({ elementId: o, maxLength: a }) {
|
|
|
1019
1085
|
t < a && "text-current"
|
|
1020
1086
|
),
|
|
1021
1087
|
role: "status",
|
|
1022
|
-
children: /* @__PURE__ */ E("span", { id: `${
|
|
1088
|
+
children: /* @__PURE__ */ E("span", { id: `${n}-character-count`, children: [
|
|
1023
1089
|
t,
|
|
1024
1090
|
" / ",
|
|
1025
1091
|
a,
|
|
@@ -1028,9 +1094,9 @@ function Te({ elementId: o, maxLength: a }) {
|
|
|
1028
1094
|
}
|
|
1029
1095
|
);
|
|
1030
1096
|
}
|
|
1031
|
-
function
|
|
1097
|
+
function ze(n, a) {
|
|
1032
1098
|
A(() => {
|
|
1033
|
-
const t = document.getElementById(
|
|
1099
|
+
const t = document.getElementById(n);
|
|
1034
1100
|
if (!t)
|
|
1035
1101
|
return;
|
|
1036
1102
|
if (!a) {
|
|
@@ -1043,70 +1109,70 @@ function De(o, a) {
|
|
|
1043
1109
|
return r(), t.addEventListener("input", r), t.addEventListener("resize", r), window.addEventListener("resize", r), () => {
|
|
1044
1110
|
t.removeEventListener("input", r), t.removeEventListener("resize", r), window.removeEventListener("resize", r);
|
|
1045
1111
|
};
|
|
1046
|
-
}, [
|
|
1112
|
+
}, [n, a]);
|
|
1047
1113
|
}
|
|
1048
|
-
const
|
|
1114
|
+
const De = {
|
|
1049
1115
|
base: "",
|
|
1050
1116
|
"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",
|
|
1051
1117
|
outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
|
|
1052
|
-
},
|
|
1118
|
+
}, Le = {
|
|
1053
1119
|
none: "rounded-none",
|
|
1054
1120
|
sm: "rounded-sm",
|
|
1055
1121
|
md: "rounded-md",
|
|
1056
1122
|
lg: "rounded-lg",
|
|
1057
1123
|
full: "px-3 rounded-full"
|
|
1058
|
-
},
|
|
1124
|
+
}, J = {
|
|
1059
1125
|
variant: "outline",
|
|
1060
1126
|
rounded: "none"
|
|
1061
1127
|
};
|
|
1062
|
-
function
|
|
1063
|
-
variant:
|
|
1128
|
+
function rt({
|
|
1129
|
+
variant: n = J.variant,
|
|
1064
1130
|
rounded: a,
|
|
1065
1131
|
displayOnlyMode: t = !1,
|
|
1066
1132
|
errorMessage: r,
|
|
1067
1133
|
successMessage: e,
|
|
1068
|
-
hideResizeHandle:
|
|
1134
|
+
hideResizeHandle: o = !1,
|
|
1069
1135
|
autoExpand: s = !1,
|
|
1070
1136
|
characterLimit: l = 0,
|
|
1071
1137
|
className: u,
|
|
1072
|
-
...
|
|
1138
|
+
...c
|
|
1073
1139
|
}) {
|
|
1074
1140
|
const b = $();
|
|
1075
|
-
|
|
1141
|
+
ze(b, s || t);
|
|
1076
1142
|
let i = a;
|
|
1077
|
-
|
|
1078
|
-
let v =
|
|
1079
|
-
(t ||
|
|
1143
|
+
n === "outline" && !a && (i = "md"), i = i || J.rounded;
|
|
1144
|
+
let v = o;
|
|
1145
|
+
(t || n === "left-line" && !o) && (v = !0);
|
|
1080
1146
|
const m = y(
|
|
1081
1147
|
"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
|
|
1082
|
-
!t &&
|
|
1083
|
-
!t &&
|
|
1148
|
+
!t && De[n],
|
|
1149
|
+
!t && Le[i],
|
|
1084
1150
|
!t && "px-2 py-1",
|
|
1085
1151
|
t && "pointer-events-none",
|
|
1086
1152
|
v && "no-resize-handle",
|
|
1087
1153
|
u
|
|
1088
1154
|
);
|
|
1089
1155
|
return /* @__PURE__ */ E("div", { className: y("-space-y-1.5", t && "cursor-text"), children: [
|
|
1090
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ d(
|
|
1091
1157
|
"textarea",
|
|
1092
1158
|
{
|
|
1093
|
-
...
|
|
1159
|
+
...c,
|
|
1094
1160
|
id: b,
|
|
1095
|
-
"aria-disabled":
|
|
1161
|
+
"aria-disabled": c.disabled,
|
|
1096
1162
|
readOnly: t,
|
|
1097
|
-
"aria-readonly": t ||
|
|
1163
|
+
"aria-readonly": t || c["aria-readonly"],
|
|
1098
1164
|
style: {
|
|
1099
1165
|
resize: s ? "none" : void 0
|
|
1100
1166
|
},
|
|
1101
1167
|
className: m
|
|
1102
1168
|
}
|
|
1103
1169
|
),
|
|
1104
|
-
l > 0 && /* @__PURE__ */
|
|
1105
|
-
!t && /* @__PURE__ */
|
|
1106
|
-
!t && /* @__PURE__ */
|
|
1170
|
+
l > 0 && /* @__PURE__ */ d(ke, { elementId: b, maxLength: l }),
|
|
1171
|
+
!t && /* @__PURE__ */ d(V, { elementId: b, type: "error", message: r }),
|
|
1172
|
+
!t && /* @__PURE__ */ d(V, { elementId: b, type: "success", message: e })
|
|
1107
1173
|
] });
|
|
1108
1174
|
}
|
|
1109
|
-
const
|
|
1175
|
+
const Re = {
|
|
1110
1176
|
sm: {
|
|
1111
1177
|
container: "h-5 min-w-9 w-9",
|
|
1112
1178
|
thumb: "h-4 w-4",
|
|
@@ -1122,7 +1188,7 @@ const Le = {
|
|
|
1122
1188
|
thumb: "h-6 w-6",
|
|
1123
1189
|
translate: "translate-x-6"
|
|
1124
1190
|
}
|
|
1125
|
-
},
|
|
1191
|
+
}, Se = {
|
|
1126
1192
|
default: {
|
|
1127
1193
|
unchecked: "bg-muted",
|
|
1128
1194
|
checked: "bg-primary"
|
|
@@ -1135,47 +1201,47 @@ const Le = {
|
|
|
1135
1201
|
unchecked: "bg-muted",
|
|
1136
1202
|
checked: "bg-destructive"
|
|
1137
1203
|
}
|
|
1138
|
-
},
|
|
1204
|
+
}, Y = {
|
|
1139
1205
|
variant: "default",
|
|
1140
1206
|
size: "md"
|
|
1141
1207
|
};
|
|
1142
|
-
function
|
|
1143
|
-
ref:
|
|
1208
|
+
function nt({
|
|
1209
|
+
ref: n,
|
|
1144
1210
|
id: a,
|
|
1145
|
-
size: t =
|
|
1146
|
-
variant: r =
|
|
1211
|
+
size: t = Y.size,
|
|
1212
|
+
variant: r = Y.variant,
|
|
1147
1213
|
checked: e,
|
|
1148
|
-
onCheckedChange:
|
|
1214
|
+
onCheckedChange: o,
|
|
1149
1215
|
disabled: s = !1,
|
|
1150
1216
|
className: l,
|
|
1151
1217
|
thumbClassName: u,
|
|
1152
|
-
backgroundClassNames:
|
|
1218
|
+
backgroundClassNames: c,
|
|
1153
1219
|
...b
|
|
1154
1220
|
}) {
|
|
1155
|
-
const i = $(), v =
|
|
1221
|
+
const i = $(), v = _(() => a || `toggle-${i}`, [a, i]), [f, m] = x(e);
|
|
1156
1222
|
A(() => {
|
|
1157
1223
|
m(e);
|
|
1158
1224
|
}, [e]);
|
|
1159
1225
|
const g = () => {
|
|
1160
1226
|
if (!s) {
|
|
1161
1227
|
const C = !f;
|
|
1162
|
-
e === void 0 && m(C),
|
|
1228
|
+
e === void 0 && m(C), o == null || o(C);
|
|
1163
1229
|
}
|
|
1164
1230
|
}, h = (C) => {
|
|
1165
1231
|
(C.key === " " || C.key === "Enter") && (C.preventDefault(), g());
|
|
1166
|
-
}, w =
|
|
1232
|
+
}, w = Re[t], p = Se[r], N = y(
|
|
1167
1233
|
// Base styles
|
|
1168
1234
|
"relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out",
|
|
1169
1235
|
"focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
1170
1236
|
// Size
|
|
1171
1237
|
w.container,
|
|
1172
1238
|
// Variant and state
|
|
1173
|
-
f ? (
|
|
1239
|
+
f ? (c == null ? void 0 : c.checked) || p.checked : (c == null ? void 0 : c.unchecked) || p.unchecked,
|
|
1174
1240
|
// Disabled state
|
|
1175
1241
|
s && "opacity-50 cursor-not-allowed",
|
|
1176
1242
|
!s && "cursor-pointer",
|
|
1177
1243
|
l
|
|
1178
|
-
),
|
|
1244
|
+
), k = y(
|
|
1179
1245
|
// Base thumb styles
|
|
1180
1246
|
"absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out",
|
|
1181
1247
|
// Size
|
|
@@ -1187,7 +1253,7 @@ function tt({
|
|
|
1187
1253
|
return /* @__PURE__ */ E(
|
|
1188
1254
|
"button",
|
|
1189
1255
|
{
|
|
1190
|
-
ref:
|
|
1256
|
+
ref: n,
|
|
1191
1257
|
id: v,
|
|
1192
1258
|
type: "button",
|
|
1193
1259
|
role: "switch",
|
|
@@ -1200,71 +1266,71 @@ function tt({
|
|
|
1200
1266
|
className: N,
|
|
1201
1267
|
...b,
|
|
1202
1268
|
children: [
|
|
1203
|
-
/* @__PURE__ */
|
|
1204
|
-
/* @__PURE__ */
|
|
1269
|
+
/* @__PURE__ */ d("span", { className: k }),
|
|
1270
|
+
/* @__PURE__ */ d("span", { className: "sr-only", children: f ? "Enabled" : "Disabled" })
|
|
1205
1271
|
]
|
|
1206
1272
|
}
|
|
1207
1273
|
);
|
|
1208
1274
|
}
|
|
1209
1275
|
const j = 8, F = 4, T = 6;
|
|
1210
|
-
function Be(
|
|
1276
|
+
function Be(n) {
|
|
1211
1277
|
return { calculatePosition: I(
|
|
1212
1278
|
(t, r) => {
|
|
1213
|
-
const e = t.getBoundingClientRect(),
|
|
1279
|
+
const e = t.getBoundingClientRect(), o = r.getBoundingClientRect(), s = {
|
|
1214
1280
|
width: window.innerWidth,
|
|
1215
1281
|
height: window.innerHeight
|
|
1216
1282
|
}, l = (v, f, m, g) => v < 0 || f < 0 || v + m > s.width || f + g > s.height, u = {
|
|
1217
1283
|
top: {
|
|
1218
|
-
x: e.left + e.width / 2 -
|
|
1219
|
-
y: e.top -
|
|
1284
|
+
x: e.left + e.width / 2 - o.width / 2,
|
|
1285
|
+
y: e.top - o.height - F,
|
|
1220
1286
|
arrow: {
|
|
1221
|
-
x:
|
|
1222
|
-
y:
|
|
1287
|
+
x: o.width / 2 - T,
|
|
1288
|
+
y: o.height
|
|
1223
1289
|
}
|
|
1224
1290
|
},
|
|
1225
1291
|
bottom: {
|
|
1226
|
-
x: e.left + e.width / 2 -
|
|
1292
|
+
x: e.left + e.width / 2 - o.width / 2,
|
|
1227
1293
|
y: e.bottom + F,
|
|
1228
1294
|
arrow: {
|
|
1229
|
-
x:
|
|
1295
|
+
x: o.width / 2 - T,
|
|
1230
1296
|
y: -6
|
|
1231
1297
|
}
|
|
1232
1298
|
},
|
|
1233
1299
|
left: {
|
|
1234
|
-
x: e.left -
|
|
1235
|
-
y: e.top + e.height / 2 -
|
|
1300
|
+
x: e.left - o.width - F,
|
|
1301
|
+
y: e.top + e.height / 2 - o.height / 2,
|
|
1236
1302
|
arrow: {
|
|
1237
|
-
x:
|
|
1238
|
-
y:
|
|
1303
|
+
x: o.width,
|
|
1304
|
+
y: o.height / 2 - T
|
|
1239
1305
|
}
|
|
1240
1306
|
},
|
|
1241
1307
|
right: {
|
|
1242
1308
|
x: e.right + F,
|
|
1243
|
-
y: e.top + e.height / 2 -
|
|
1309
|
+
y: e.top + e.height / 2 - o.height / 2,
|
|
1244
1310
|
arrow: {
|
|
1245
1311
|
x: -6,
|
|
1246
|
-
y:
|
|
1312
|
+
y: o.height / 2 - T
|
|
1247
1313
|
}
|
|
1248
1314
|
}
|
|
1249
1315
|
};
|
|
1250
|
-
let
|
|
1251
|
-
if (l(b.x, b.y,
|
|
1316
|
+
let c = n, b = u[n];
|
|
1317
|
+
if (l(b.x, b.y, o.width, o.height)) {
|
|
1252
1318
|
const v = {
|
|
1253
1319
|
top: "bottom",
|
|
1254
1320
|
bottom: "top",
|
|
1255
1321
|
left: "right",
|
|
1256
1322
|
right: "left"
|
|
1257
|
-
}, f = u[v[
|
|
1258
|
-
if (!l(f.x, f.y,
|
|
1259
|
-
|
|
1323
|
+
}, f = u[v[n]];
|
|
1324
|
+
if (!l(f.x, f.y, o.width, o.height))
|
|
1325
|
+
c = v[n], b = f;
|
|
1260
1326
|
else {
|
|
1261
1327
|
const m = ["top", "bottom", "left", "right"].filter(
|
|
1262
|
-
(g) => g !==
|
|
1328
|
+
(g) => g !== n && g !== v[n]
|
|
1263
1329
|
);
|
|
1264
1330
|
for (const g of m) {
|
|
1265
1331
|
const h = u[g];
|
|
1266
|
-
if (!l(h.x, h.y,
|
|
1267
|
-
|
|
1332
|
+
if (!l(h.x, h.y, o.width, o.height)) {
|
|
1333
|
+
c = g, b = h;
|
|
1268
1334
|
break;
|
|
1269
1335
|
}
|
|
1270
1336
|
}
|
|
@@ -1272,88 +1338,88 @@ function Be(o) {
|
|
|
1272
1338
|
}
|
|
1273
1339
|
b.x = Math.max(
|
|
1274
1340
|
j,
|
|
1275
|
-
Math.min(b.x, s.width -
|
|
1341
|
+
Math.min(b.x, s.width - o.width - j)
|
|
1276
1342
|
), b.y = Math.max(
|
|
1277
1343
|
j,
|
|
1278
|
-
Math.min(b.y, s.height -
|
|
1344
|
+
Math.min(b.y, s.height - o.height - j)
|
|
1279
1345
|
);
|
|
1280
1346
|
const i = {
|
|
1281
1347
|
x: e.left + e.width / 2,
|
|
1282
1348
|
y: e.top + e.height / 2
|
|
1283
1349
|
};
|
|
1284
|
-
return
|
|
1350
|
+
return c === "top" || c === "bottom" ? b.arrow.x = Math.max(
|
|
1285
1351
|
T,
|
|
1286
|
-
Math.min(i.x - b.x - T,
|
|
1352
|
+
Math.min(i.x - b.x - T, o.width - T * 2)
|
|
1287
1353
|
) : b.arrow.y = Math.max(
|
|
1288
1354
|
T,
|
|
1289
|
-
Math.min(i.y - b.y - T,
|
|
1355
|
+
Math.min(i.y - b.y - T, o.height - T * 2)
|
|
1290
1356
|
), {
|
|
1291
1357
|
...b,
|
|
1292
|
-
placement:
|
|
1358
|
+
placement: c
|
|
1293
1359
|
};
|
|
1294
1360
|
},
|
|
1295
|
-
[
|
|
1361
|
+
[n]
|
|
1296
1362
|
) };
|
|
1297
1363
|
}
|
|
1298
|
-
function
|
|
1299
|
-
const r = R(null), e = R(null),
|
|
1364
|
+
function je(n, a, t) {
|
|
1365
|
+
const r = R(null), e = R(null), o = I(() => {
|
|
1300
1366
|
if (!r.current || !e.current) return;
|
|
1301
|
-
const s =
|
|
1367
|
+
const s = n(r.current, e.current);
|
|
1302
1368
|
t(s);
|
|
1303
|
-
}, [
|
|
1369
|
+
}, [n, t]);
|
|
1304
1370
|
return A(() => {
|
|
1305
1371
|
if (!a) return;
|
|
1306
|
-
const s = () =>
|
|
1372
|
+
const s = () => o();
|
|
1307
1373
|
return window.addEventListener("resize", s), () => {
|
|
1308
1374
|
window.removeEventListener("resize", s);
|
|
1309
1375
|
};
|
|
1310
|
-
}, [a,
|
|
1376
|
+
}, [a, o]), {
|
|
1311
1377
|
triggerRef: r,
|
|
1312
1378
|
tooltipRef: e,
|
|
1313
|
-
updatePosition:
|
|
1379
|
+
updatePosition: o
|
|
1314
1380
|
};
|
|
1315
1381
|
}
|
|
1316
|
-
function
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1382
|
+
function Fe(n, a, t, r, e, o, s, l, u) {
|
|
1383
|
+
const c = R(null), b = I(() => {
|
|
1384
|
+
n || (c.current && clearTimeout(c.current), c.current = window.setTimeout(() => {
|
|
1319
1385
|
t(!0), requestAnimationFrame(() => {
|
|
1320
1386
|
e(), r(!0);
|
|
1321
1387
|
});
|
|
1322
1388
|
}, a));
|
|
1323
|
-
}, [
|
|
1389
|
+
}, [n, a, t, e, r]), i = I(
|
|
1324
1390
|
(v = !1) => {
|
|
1325
|
-
if (
|
|
1391
|
+
if (c.current && clearTimeout(c.current), v) {
|
|
1326
1392
|
r(!1), setTimeout(() => t(!1), 150);
|
|
1327
1393
|
return;
|
|
1328
1394
|
}
|
|
1329
|
-
|
|
1395
|
+
c.current = window.setTimeout(() => {
|
|
1330
1396
|
r(!1), setTimeout(() => t(!1), 150);
|
|
1331
1397
|
}, 100);
|
|
1332
1398
|
},
|
|
1333
1399
|
[r, t]
|
|
1334
1400
|
);
|
|
1335
1401
|
return A(() => {
|
|
1336
|
-
!
|
|
1337
|
-
}, [
|
|
1338
|
-
|
|
1402
|
+
!o && !s && !l && u && i();
|
|
1403
|
+
}, [o, s, l, u, i]), A(() => () => {
|
|
1404
|
+
c.current && clearTimeout(c.current);
|
|
1339
1405
|
}, []), {
|
|
1340
1406
|
showTooltip: b,
|
|
1341
1407
|
hideTooltip: i,
|
|
1342
|
-
timeoutRef:
|
|
1408
|
+
timeoutRef: c
|
|
1343
1409
|
};
|
|
1344
1410
|
}
|
|
1345
|
-
function
|
|
1346
|
-
id:
|
|
1411
|
+
function ot({
|
|
1412
|
+
id: n,
|
|
1347
1413
|
children: a,
|
|
1348
1414
|
message: t,
|
|
1349
1415
|
placement: r = "top",
|
|
1350
1416
|
disabled: e = !1,
|
|
1351
|
-
delay:
|
|
1417
|
+
delay: o = 200,
|
|
1352
1418
|
className: s
|
|
1353
1419
|
}) {
|
|
1354
|
-
const [l, u] = x(!1), [
|
|
1420
|
+
const [l, u] = x(!1), [c, b] = x(!1), [i, v] = x(null), [f, m] = x(!1), [g, h] = x(!1), [w, p] = x(!1), { calculatePosition: N } = Be(r), { triggerRef: k, tooltipRef: C, updatePosition: L } = je(N, c, v), { showTooltip: S, hideTooltip: B, timeoutRef: Q } = Fe(
|
|
1355
1421
|
e,
|
|
1356
|
-
|
|
1422
|
+
o,
|
|
1357
1423
|
b,
|
|
1358
1424
|
u,
|
|
1359
1425
|
L,
|
|
@@ -1361,31 +1427,31 @@ function rt({
|
|
|
1361
1427
|
g,
|
|
1362
1428
|
w,
|
|
1363
1429
|
l
|
|
1364
|
-
),
|
|
1430
|
+
), ee = $(), M = n ?? ee;
|
|
1365
1431
|
return /* @__PURE__ */ E(W, { children: [
|
|
1366
1432
|
z.cloneElement(a, {
|
|
1367
|
-
ref: (
|
|
1368
|
-
|
|
1433
|
+
ref: (q) => {
|
|
1434
|
+
k.current = q;
|
|
1369
1435
|
},
|
|
1370
1436
|
onMouseEnter: () => {
|
|
1371
|
-
m(!0),
|
|
1437
|
+
m(!0), S();
|
|
1372
1438
|
},
|
|
1373
1439
|
onMouseLeave: () => {
|
|
1374
1440
|
m(!1);
|
|
1375
1441
|
},
|
|
1376
1442
|
onFocus: () => {
|
|
1377
|
-
p(!0),
|
|
1443
|
+
p(!0), S();
|
|
1378
1444
|
},
|
|
1379
1445
|
onBlur: () => {
|
|
1380
|
-
p(!1),
|
|
1446
|
+
p(!1), B(!0);
|
|
1381
1447
|
},
|
|
1382
|
-
onKeyDown: (
|
|
1383
|
-
|
|
1448
|
+
onKeyDown: (q) => {
|
|
1449
|
+
q.key === "Escape" && B(!0);
|
|
1384
1450
|
},
|
|
1385
1451
|
"aria-describedby": e ? void 0 : M
|
|
1386
1452
|
}),
|
|
1387
|
-
|
|
1388
|
-
/* @__PURE__ */
|
|
1453
|
+
c && U(
|
|
1454
|
+
/* @__PURE__ */ d(
|
|
1389
1455
|
"div",
|
|
1390
1456
|
{
|
|
1391
1457
|
ref: C,
|
|
@@ -1412,24 +1478,25 @@ function rt({
|
|
|
1412
1478
|
}
|
|
1413
1479
|
export {
|
|
1414
1480
|
Ue as Accordion,
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1481
|
+
H as AccordionItem,
|
|
1482
|
+
it as ActionModal,
|
|
1483
|
+
be as Button,
|
|
1418
1484
|
ce as ButtonLoadingDots,
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1485
|
+
Qe as Checkbox,
|
|
1486
|
+
Me as Clickable,
|
|
1487
|
+
Xe as Input,
|
|
1488
|
+
Ze as Label,
|
|
1489
|
+
Je as Modal,
|
|
1490
|
+
Ye as Panel,
|
|
1491
|
+
Pe as RadioGroup,
|
|
1426
1492
|
G as RadioGroupItem,
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1493
|
+
Ce as RadioInput,
|
|
1494
|
+
Oe as Separator,
|
|
1495
|
+
et as Skeleton,
|
|
1496
|
+
tt as Slot,
|
|
1497
|
+
rt as Textarea,
|
|
1498
|
+
lt as Toast,
|
|
1499
|
+
nt as Toggle,
|
|
1500
|
+
ot as Tooltip
|
|
1434
1501
|
};
|
|
1435
1502
|
//# sourceMappingURL=components.esm.js.map
|