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