@moondreamsdev/dreamer-ui 1.7.7-test.3 → 1.7.7-test.5
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-SgqUNTIy.cjs → Toast-B4zUICg8.cjs} +2 -2
- package/dist/Toast-B4zUICg8.cjs.map +1 -0
- package/dist/{Toast-vensJgtx.js → Toast-C84BREWE.js} +20 -20
- package/dist/Toast-C84BREWE.js.map +1 -0
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +710 -574
- 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 +1 -0
- package/dist/src/components/clickable/Clickable.d.ts +1 -0
- package/dist/src/components/index.d.ts +1 -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 +1 -0
- package/dist/src/components/separator/Separator.d.ts +2 -3
- package/dist/src/components/separator/variants.d.ts +0 -7
- 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/dist/theme.css +1 -0
- package/package.json +1 -1
- package/dist/Toast-SgqUNTIy.cjs.map +0 -1
- package/dist/Toast-vensJgtx.js.map +0 -1
package/dist/components.esm.js
CHANGED
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import { jsxs as E, jsx as
|
|
2
|
-
import
|
|
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 D, { 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-C84BREWE.js";
|
|
6
|
+
import { A as at, T as st } from "./Toast-C84BREWE.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 Ke({
|
|
|
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 &&
|
|
111
|
-
if (
|
|
112
|
-
const p = h.props.id || m(
|
|
110
|
+
a.length === 0 && t && D.Children.map(t, (h, w) => {
|
|
111
|
+
if (D.isValidElement(h) && h.type === q) {
|
|
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 Ke({
|
|
|
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 Ge({
|
|
|
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 ? D.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((z, C) => {
|
|
519
|
+
const { label: L, className: B, ...S } = z;
|
|
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 Qe({
|
|
|
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 ? D.isValidElement(e) ? /* @__PURE__ */ c("div", { children: e }) : /* @__PURE__ */ c("h2", { className: "text-2xl font-semibold", id: h, children: e }) : null, z = () => {
|
|
648
|
+
if (!s) return null;
|
|
649
|
+
if (D.isValidElement(s)) {
|
|
650
|
+
const C = s, L = C.props.className || "";
|
|
651
|
+
return D.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
|
+
z()
|
|
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
|
-
if (!m.some((
|
|
714
|
-
const
|
|
715
|
-
let p =
|
|
855
|
+
if (!m.some((z) => z.id === g.id)) return;
|
|
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 && D.Children.map(e, (i) => D.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,81 +953,74 @@ const Ee = {
|
|
|
811
953
|
horizontal: "h-2",
|
|
812
954
|
vertical: "w-2"
|
|
813
955
|
}
|
|
814
|
-
},
|
|
815
|
-
default: "bg-border",
|
|
816
|
-
muted: "bg-muted",
|
|
817
|
-
accent: "bg-accent"
|
|
818
|
-
}, Ce = {
|
|
956
|
+
}, $e = {
|
|
819
957
|
horizontal: "w-full",
|
|
820
958
|
vertical: "min-h-4 h-full"
|
|
821
959
|
};
|
|
822
|
-
function
|
|
960
|
+
function Pe({
|
|
823
961
|
orientation: o = "horizontal",
|
|
824
962
|
decorative: a = !1,
|
|
825
|
-
thickness:
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
...r
|
|
963
|
+
thickness: t = "thin",
|
|
964
|
+
className: r,
|
|
965
|
+
...e
|
|
829
966
|
}) {
|
|
830
|
-
const
|
|
831
|
-
"shrink-0",
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
t
|
|
967
|
+
const n = y(
|
|
968
|
+
"shrink-0 bg-border",
|
|
969
|
+
$e[o],
|
|
970
|
+
Ie[t][o],
|
|
971
|
+
r
|
|
836
972
|
);
|
|
837
|
-
return /* @__PURE__ */
|
|
973
|
+
return /* @__PURE__ */ c(
|
|
838
974
|
"div",
|
|
839
975
|
{
|
|
840
|
-
...
|
|
841
|
-
className:
|
|
976
|
+
...e,
|
|
977
|
+
className: n,
|
|
842
978
|
role: a ? "presentation" : "separator",
|
|
843
979
|
"aria-orientation": a ? void 0 : o,
|
|
844
980
|
"aria-hidden": a,
|
|
845
981
|
"data-orientation": o,
|
|
846
|
-
"data-thickness":
|
|
847
|
-
"data-variant": n
|
|
982
|
+
"data-thickness": t
|
|
848
983
|
}
|
|
849
984
|
);
|
|
850
985
|
}
|
|
851
|
-
function
|
|
852
|
-
if (
|
|
853
|
-
let
|
|
854
|
-
return o.props && (
|
|
855
|
-
...
|
|
856
|
-
ref: (
|
|
857
|
-
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);
|
|
858
993
|
}
|
|
859
994
|
});
|
|
860
995
|
}
|
|
861
|
-
return Y("div", { ...
|
|
996
|
+
return Y("div", { ...t, ref: a }, o);
|
|
862
997
|
}
|
|
863
|
-
function
|
|
864
|
-
const [
|
|
865
|
-
return
|
|
866
|
-
const
|
|
867
|
-
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)
|
|
868
1003
|
return;
|
|
869
|
-
const
|
|
870
|
-
const s =
|
|
871
|
-
|
|
872
|
-
const
|
|
873
|
-
|
|
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");
|
|
874
1009
|
};
|
|
875
|
-
return
|
|
876
|
-
|
|
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");
|
|
877
1012
|
};
|
|
878
|
-
}, [o, a]), /* @__PURE__ */
|
|
1013
|
+
}, [o, a]), /* @__PURE__ */ c(
|
|
879
1014
|
"small",
|
|
880
1015
|
{
|
|
881
|
-
className:
|
|
1016
|
+
className: y(
|
|
882
1017
|
"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",
|
|
883
|
-
|
|
884
|
-
|
|
1018
|
+
t >= a && "text-destructive",
|
|
1019
|
+
t < a && "text-current"
|
|
885
1020
|
),
|
|
886
1021
|
role: "status",
|
|
887
1022
|
children: /* @__PURE__ */ E("span", { id: `${o}-character-count`, children: [
|
|
888
|
-
|
|
1023
|
+
t,
|
|
889
1024
|
" / ",
|
|
890
1025
|
a,
|
|
891
1026
|
" characters"
|
|
@@ -893,85 +1028,85 @@ function Ae({ elementId: o, maxLength: a }) {
|
|
|
893
1028
|
}
|
|
894
1029
|
);
|
|
895
1030
|
}
|
|
896
|
-
function
|
|
897
|
-
|
|
898
|
-
const
|
|
899
|
-
if (!
|
|
1031
|
+
function ze(o, a) {
|
|
1032
|
+
A(() => {
|
|
1033
|
+
const t = document.getElementById(o);
|
|
1034
|
+
if (!t)
|
|
900
1035
|
return;
|
|
901
1036
|
if (!a) {
|
|
902
|
-
|
|
1037
|
+
t.style.height = "auto";
|
|
903
1038
|
return;
|
|
904
1039
|
}
|
|
905
|
-
const
|
|
906
|
-
|
|
1040
|
+
const r = () => {
|
|
1041
|
+
t.style.height = "auto", t.style.height = `${t.scrollHeight}px`;
|
|
907
1042
|
};
|
|
908
|
-
return
|
|
909
|
-
|
|
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);
|
|
910
1045
|
};
|
|
911
1046
|
}, [o, a]);
|
|
912
1047
|
}
|
|
913
|
-
const
|
|
1048
|
+
const De = {
|
|
914
1049
|
base: "",
|
|
915
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",
|
|
916
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"
|
|
917
|
-
},
|
|
1052
|
+
}, ke = {
|
|
918
1053
|
none: "rounded-none",
|
|
919
1054
|
sm: "rounded-sm",
|
|
920
1055
|
md: "rounded-md",
|
|
921
1056
|
lg: "rounded-lg",
|
|
922
1057
|
full: "px-3 rounded-full"
|
|
923
|
-
},
|
|
1058
|
+
}, Z = {
|
|
924
1059
|
variant: "outline",
|
|
925
1060
|
rounded: "none"
|
|
926
1061
|
};
|
|
927
|
-
function
|
|
928
|
-
variant: o =
|
|
1062
|
+
function et({
|
|
1063
|
+
variant: o = Z.variant,
|
|
929
1064
|
rounded: a,
|
|
930
|
-
displayOnlyMode:
|
|
931
|
-
errorMessage:
|
|
932
|
-
successMessage:
|
|
933
|
-
hideResizeHandle:
|
|
1065
|
+
displayOnlyMode: t = !1,
|
|
1066
|
+
errorMessage: r,
|
|
1067
|
+
successMessage: e,
|
|
1068
|
+
hideResizeHandle: n = !1,
|
|
934
1069
|
autoExpand: s = !1,
|
|
935
|
-
characterLimit:
|
|
936
|
-
className:
|
|
937
|
-
...
|
|
1070
|
+
characterLimit: l = 0,
|
|
1071
|
+
className: u,
|
|
1072
|
+
...d
|
|
938
1073
|
}) {
|
|
939
|
-
const b =
|
|
940
|
-
|
|
1074
|
+
const b = $();
|
|
1075
|
+
ze(b, s || t);
|
|
941
1076
|
let i = a;
|
|
942
|
-
o === "outline" && !a && (i = "md"), i = i ||
|
|
943
|
-
let v =
|
|
944
|
-
(
|
|
945
|
-
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(
|
|
946
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",
|
|
947
|
-
!
|
|
948
|
-
!
|
|
949
|
-
!
|
|
950
|
-
|
|
1082
|
+
!t && De[o],
|
|
1083
|
+
!t && ke[i],
|
|
1084
|
+
!t && "px-2 py-1",
|
|
1085
|
+
t && "pointer-events-none",
|
|
951
1086
|
v && "no-resize-handle",
|
|
952
|
-
|
|
1087
|
+
u
|
|
953
1088
|
);
|
|
954
|
-
return /* @__PURE__ */ E("div", { className:
|
|
955
|
-
/* @__PURE__ */
|
|
1089
|
+
return /* @__PURE__ */ E("div", { className: y("-space-y-1.5", t && "cursor-text"), children: [
|
|
1090
|
+
/* @__PURE__ */ c(
|
|
956
1091
|
"textarea",
|
|
957
1092
|
{
|
|
958
|
-
...
|
|
1093
|
+
...d,
|
|
959
1094
|
id: b,
|
|
960
|
-
"aria-disabled":
|
|
961
|
-
readOnly:
|
|
962
|
-
"aria-readonly":
|
|
1095
|
+
"aria-disabled": d.disabled,
|
|
1096
|
+
readOnly: t,
|
|
1097
|
+
"aria-readonly": t || d["aria-readonly"],
|
|
963
1098
|
style: {
|
|
964
1099
|
resize: s ? "none" : void 0
|
|
965
1100
|
},
|
|
966
1101
|
className: m
|
|
967
1102
|
}
|
|
968
1103
|
),
|
|
969
|
-
|
|
970
|
-
!
|
|
971
|
-
!
|
|
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 })
|
|
972
1107
|
] });
|
|
973
1108
|
}
|
|
974
|
-
const
|
|
1109
|
+
const Le = {
|
|
975
1110
|
sm: {
|
|
976
1111
|
container: "h-5 min-w-9 w-9",
|
|
977
1112
|
thumb: "h-4 w-4",
|
|
@@ -987,7 +1122,7 @@ const De = {
|
|
|
987
1122
|
thumb: "h-6 w-6",
|
|
988
1123
|
translate: "translate-x-6"
|
|
989
1124
|
}
|
|
990
|
-
},
|
|
1125
|
+
}, Re = {
|
|
991
1126
|
default: {
|
|
992
1127
|
unchecked: "bg-muted",
|
|
993
1128
|
checked: "bg-primary"
|
|
@@ -1000,54 +1135,54 @@ const De = {
|
|
|
1000
1135
|
unchecked: "bg-muted",
|
|
1001
1136
|
checked: "bg-destructive"
|
|
1002
1137
|
}
|
|
1003
|
-
},
|
|
1138
|
+
}, J = {
|
|
1004
1139
|
variant: "default",
|
|
1005
1140
|
size: "md"
|
|
1006
1141
|
};
|
|
1007
|
-
function
|
|
1142
|
+
function tt({
|
|
1008
1143
|
ref: o,
|
|
1009
1144
|
id: a,
|
|
1010
|
-
size:
|
|
1011
|
-
variant:
|
|
1012
|
-
checked:
|
|
1013
|
-
onCheckedChange:
|
|
1145
|
+
size: t = J.size,
|
|
1146
|
+
variant: r = J.variant,
|
|
1147
|
+
checked: e,
|
|
1148
|
+
onCheckedChange: n,
|
|
1014
1149
|
disabled: s = !1,
|
|
1015
|
-
className:
|
|
1016
|
-
thumbClassName:
|
|
1017
|
-
backgroundClassNames:
|
|
1150
|
+
className: l,
|
|
1151
|
+
thumbClassName: u,
|
|
1152
|
+
backgroundClassNames: d,
|
|
1018
1153
|
...b
|
|
1019
1154
|
}) {
|
|
1020
|
-
const i =
|
|
1021
|
-
|
|
1022
|
-
m(
|
|
1023
|
-
}, [
|
|
1155
|
+
const i = $(), v = U(() => a || `toggle-${i}`, [a, i]), [f, m] = x(e);
|
|
1156
|
+
A(() => {
|
|
1157
|
+
m(e);
|
|
1158
|
+
}, [e]);
|
|
1024
1159
|
const g = () => {
|
|
1025
1160
|
if (!s) {
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1161
|
+
const C = !f;
|
|
1162
|
+
e === void 0 && m(C), n == null || n(C);
|
|
1028
1163
|
}
|
|
1029
|
-
}, h = (
|
|
1030
|
-
(
|
|
1031
|
-
},
|
|
1164
|
+
}, h = (C) => {
|
|
1165
|
+
(C.key === " " || C.key === "Enter") && (C.preventDefault(), g());
|
|
1166
|
+
}, w = Le[t], p = Re[r], N = y(
|
|
1032
1167
|
// Base styles
|
|
1033
1168
|
"relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out",
|
|
1034
1169
|
"focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
1035
1170
|
// Size
|
|
1036
|
-
|
|
1171
|
+
w.container,
|
|
1037
1172
|
// Variant and state
|
|
1038
|
-
f ? (
|
|
1173
|
+
f ? (d == null ? void 0 : d.checked) || p.checked : (d == null ? void 0 : d.unchecked) || p.unchecked,
|
|
1039
1174
|
// Disabled state
|
|
1040
1175
|
s && "opacity-50 cursor-not-allowed",
|
|
1041
1176
|
!s && "cursor-pointer",
|
|
1042
|
-
|
|
1043
|
-
),
|
|
1177
|
+
l
|
|
1178
|
+
), z = y(
|
|
1044
1179
|
// Base thumb styles
|
|
1045
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",
|
|
1046
1181
|
// Size
|
|
1047
|
-
|
|
1182
|
+
w.thumb,
|
|
1048
1183
|
// Position based on state
|
|
1049
|
-
f &&
|
|
1050
|
-
|
|
1184
|
+
f && w.translate,
|
|
1185
|
+
u
|
|
1051
1186
|
);
|
|
1052
1187
|
return /* @__PURE__ */ E(
|
|
1053
1188
|
"button",
|
|
@@ -1065,210 +1200,210 @@ function Me({
|
|
|
1065
1200
|
className: N,
|
|
1066
1201
|
...b,
|
|
1067
1202
|
children: [
|
|
1068
|
-
/* @__PURE__ */
|
|
1069
|
-
/* @__PURE__ */
|
|
1203
|
+
/* @__PURE__ */ c("span", { className: z }),
|
|
1204
|
+
/* @__PURE__ */ c("span", { className: "sr-only", children: f ? "Enabled" : "Disabled" })
|
|
1070
1205
|
]
|
|
1071
1206
|
}
|
|
1072
1207
|
);
|
|
1073
1208
|
}
|
|
1074
|
-
const
|
|
1075
|
-
function
|
|
1076
|
-
return { calculatePosition:
|
|
1077
|
-
(
|
|
1078
|
-
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 = {
|
|
1079
1214
|
width: window.innerWidth,
|
|
1080
1215
|
height: window.innerHeight
|
|
1081
|
-
},
|
|
1216
|
+
}, l = (v, f, m, g) => v < 0 || f < 0 || v + m > s.width || f + g > s.height, u = {
|
|
1082
1217
|
top: {
|
|
1083
|
-
x:
|
|
1084
|
-
y:
|
|
1218
|
+
x: e.left + e.width / 2 - n.width / 2,
|
|
1219
|
+
y: e.top - n.height - F,
|
|
1085
1220
|
arrow: {
|
|
1086
|
-
x:
|
|
1087
|
-
y:
|
|
1221
|
+
x: n.width / 2 - T,
|
|
1222
|
+
y: n.height
|
|
1088
1223
|
}
|
|
1089
1224
|
},
|
|
1090
1225
|
bottom: {
|
|
1091
|
-
x:
|
|
1092
|
-
y:
|
|
1226
|
+
x: e.left + e.width / 2 - n.width / 2,
|
|
1227
|
+
y: e.bottom + F,
|
|
1093
1228
|
arrow: {
|
|
1094
|
-
x:
|
|
1229
|
+
x: n.width / 2 - T,
|
|
1095
1230
|
y: -6
|
|
1096
1231
|
}
|
|
1097
1232
|
},
|
|
1098
1233
|
left: {
|
|
1099
|
-
x:
|
|
1100
|
-
y:
|
|
1234
|
+
x: e.left - n.width - F,
|
|
1235
|
+
y: e.top + e.height / 2 - n.height / 2,
|
|
1101
1236
|
arrow: {
|
|
1102
|
-
x:
|
|
1103
|
-
y:
|
|
1237
|
+
x: n.width,
|
|
1238
|
+
y: n.height / 2 - T
|
|
1104
1239
|
}
|
|
1105
1240
|
},
|
|
1106
1241
|
right: {
|
|
1107
|
-
x:
|
|
1108
|
-
y:
|
|
1242
|
+
x: e.right + F,
|
|
1243
|
+
y: e.top + e.height / 2 - n.height / 2,
|
|
1109
1244
|
arrow: {
|
|
1110
1245
|
x: -6,
|
|
1111
|
-
y:
|
|
1246
|
+
y: n.height / 2 - T
|
|
1112
1247
|
}
|
|
1113
1248
|
}
|
|
1114
1249
|
};
|
|
1115
|
-
let
|
|
1116
|
-
if (
|
|
1250
|
+
let d = o, b = u[o];
|
|
1251
|
+
if (l(b.x, b.y, n.width, n.height)) {
|
|
1117
1252
|
const v = {
|
|
1118
1253
|
top: "bottom",
|
|
1119
1254
|
bottom: "top",
|
|
1120
1255
|
left: "right",
|
|
1121
1256
|
right: "left"
|
|
1122
|
-
}, f =
|
|
1123
|
-
if (!
|
|
1124
|
-
|
|
1257
|
+
}, f = u[v[o]];
|
|
1258
|
+
if (!l(f.x, f.y, n.width, n.height))
|
|
1259
|
+
d = v[o], b = f;
|
|
1125
1260
|
else {
|
|
1126
1261
|
const m = ["top", "bottom", "left", "right"].filter(
|
|
1127
1262
|
(g) => g !== o && g !== v[o]
|
|
1128
1263
|
);
|
|
1129
1264
|
for (const g of m) {
|
|
1130
|
-
const h =
|
|
1131
|
-
if (!
|
|
1132
|
-
|
|
1265
|
+
const h = u[g];
|
|
1266
|
+
if (!l(h.x, h.y, n.width, n.height)) {
|
|
1267
|
+
d = g, b = h;
|
|
1133
1268
|
break;
|
|
1134
1269
|
}
|
|
1135
1270
|
}
|
|
1136
1271
|
}
|
|
1137
1272
|
}
|
|
1138
1273
|
b.x = Math.max(
|
|
1139
|
-
|
|
1140
|
-
Math.min(b.x, s.width -
|
|
1274
|
+
j,
|
|
1275
|
+
Math.min(b.x, s.width - n.width - j)
|
|
1141
1276
|
), b.y = Math.max(
|
|
1142
|
-
|
|
1143
|
-
Math.min(b.y, s.height -
|
|
1277
|
+
j,
|
|
1278
|
+
Math.min(b.y, s.height - n.height - j)
|
|
1144
1279
|
);
|
|
1145
1280
|
const i = {
|
|
1146
|
-
x:
|
|
1147
|
-
y:
|
|
1281
|
+
x: e.left + e.width / 2,
|
|
1282
|
+
y: e.top + e.height / 2
|
|
1148
1283
|
};
|
|
1149
|
-
return
|
|
1284
|
+
return d === "top" || d === "bottom" ? b.arrow.x = Math.max(
|
|
1150
1285
|
T,
|
|
1151
|
-
Math.min(i.x - b.x - T,
|
|
1286
|
+
Math.min(i.x - b.x - T, n.width - T * 2)
|
|
1152
1287
|
) : b.arrow.y = Math.max(
|
|
1153
1288
|
T,
|
|
1154
|
-
Math.min(i.y - b.y - T,
|
|
1289
|
+
Math.min(i.y - b.y - T, n.height - T * 2)
|
|
1155
1290
|
), {
|
|
1156
1291
|
...b,
|
|
1157
|
-
placement:
|
|
1292
|
+
placement: d
|
|
1158
1293
|
};
|
|
1159
1294
|
},
|
|
1160
1295
|
[o]
|
|
1161
1296
|
) };
|
|
1162
1297
|
}
|
|
1163
|
-
function
|
|
1164
|
-
const
|
|
1165
|
-
if (!
|
|
1166
|
-
const s = o(
|
|
1167
|
-
|
|
1168
|
-
}, [o,
|
|
1169
|
-
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(() => {
|
|
1170
1305
|
if (!a) return;
|
|
1171
|
-
const s = () =>
|
|
1306
|
+
const s = () => n();
|
|
1172
1307
|
return window.addEventListener("resize", s), () => {
|
|
1173
1308
|
window.removeEventListener("resize", s);
|
|
1174
1309
|
};
|
|
1175
|
-
}, [a,
|
|
1176
|
-
triggerRef:
|
|
1177
|
-
tooltipRef:
|
|
1178
|
-
updatePosition:
|
|
1310
|
+
}, [a, n]), {
|
|
1311
|
+
triggerRef: r,
|
|
1312
|
+
tooltipRef: e,
|
|
1313
|
+
updatePosition: n
|
|
1179
1314
|
};
|
|
1180
1315
|
}
|
|
1181
|
-
function
|
|
1182
|
-
const
|
|
1183
|
-
o || (
|
|
1184
|
-
|
|
1185
|
-
|
|
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);
|
|
1186
1321
|
});
|
|
1187
1322
|
}, a));
|
|
1188
|
-
}, [o, a,
|
|
1323
|
+
}, [o, a, t, e, r]), i = I(
|
|
1189
1324
|
(v = !1) => {
|
|
1190
|
-
if (
|
|
1191
|
-
|
|
1325
|
+
if (d.current && clearTimeout(d.current), v) {
|
|
1326
|
+
r(!1), setTimeout(() => t(!1), 150);
|
|
1192
1327
|
return;
|
|
1193
1328
|
}
|
|
1194
|
-
|
|
1195
|
-
|
|
1329
|
+
d.current = window.setTimeout(() => {
|
|
1330
|
+
r(!1), setTimeout(() => t(!1), 150);
|
|
1196
1331
|
}, 100);
|
|
1197
1332
|
},
|
|
1198
|
-
[
|
|
1333
|
+
[r, t]
|
|
1199
1334
|
);
|
|
1200
|
-
return
|
|
1201
|
-
!
|
|
1202
|
-
}, [
|
|
1203
|
-
|
|
1335
|
+
return A(() => {
|
|
1336
|
+
!n && !s && !l && u && i();
|
|
1337
|
+
}, [n, s, l, u, i]), A(() => () => {
|
|
1338
|
+
d.current && clearTimeout(d.current);
|
|
1204
1339
|
}, []), {
|
|
1205
1340
|
showTooltip: b,
|
|
1206
1341
|
hideTooltip: i,
|
|
1207
|
-
timeoutRef:
|
|
1342
|
+
timeoutRef: d
|
|
1208
1343
|
};
|
|
1209
1344
|
}
|
|
1210
|
-
function
|
|
1345
|
+
function rt({
|
|
1211
1346
|
id: o,
|
|
1212
1347
|
children: a,
|
|
1213
|
-
message:
|
|
1214
|
-
placement:
|
|
1215
|
-
disabled:
|
|
1216
|
-
delay:
|
|
1348
|
+
message: t,
|
|
1349
|
+
placement: r = "top",
|
|
1350
|
+
disabled: e = !1,
|
|
1351
|
+
delay: n = 200,
|
|
1217
1352
|
className: s
|
|
1218
1353
|
}) {
|
|
1219
|
-
const [
|
|
1220
|
-
|
|
1221
|
-
|
|
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: z, tooltipRef: C, updatePosition: L } = Se(N, d, v), { showTooltip: B, hideTooltip: S, timeoutRef: Q } = je(
|
|
1355
|
+
e,
|
|
1356
|
+
n,
|
|
1222
1357
|
b,
|
|
1223
|
-
|
|
1224
|
-
|
|
1358
|
+
u,
|
|
1359
|
+
L,
|
|
1225
1360
|
f,
|
|
1226
1361
|
g,
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
), O =
|
|
1230
|
-
return /* @__PURE__ */ E(
|
|
1231
|
-
|
|
1232
|
-
ref: (
|
|
1233
|
-
|
|
1362
|
+
w,
|
|
1363
|
+
l
|
|
1364
|
+
), O = $(), M = o ?? O;
|
|
1365
|
+
return /* @__PURE__ */ E(W, { children: [
|
|
1366
|
+
D.cloneElement(a, {
|
|
1367
|
+
ref: (H) => {
|
|
1368
|
+
z.current = H;
|
|
1234
1369
|
},
|
|
1235
1370
|
onMouseEnter: () => {
|
|
1236
|
-
m(!0),
|
|
1371
|
+
m(!0), B();
|
|
1237
1372
|
},
|
|
1238
1373
|
onMouseLeave: () => {
|
|
1239
1374
|
m(!1);
|
|
1240
1375
|
},
|
|
1241
1376
|
onFocus: () => {
|
|
1242
|
-
p(!0),
|
|
1377
|
+
p(!0), B();
|
|
1243
1378
|
},
|
|
1244
1379
|
onBlur: () => {
|
|
1245
|
-
p(!1),
|
|
1380
|
+
p(!1), S(!0);
|
|
1246
1381
|
},
|
|
1247
|
-
onKeyDown: (
|
|
1248
|
-
|
|
1382
|
+
onKeyDown: (H) => {
|
|
1383
|
+
H.key === "Escape" && S(!0);
|
|
1249
1384
|
},
|
|
1250
|
-
"aria-describedby":
|
|
1385
|
+
"aria-describedby": e ? void 0 : M
|
|
1251
1386
|
}),
|
|
1252
|
-
|
|
1253
|
-
/* @__PURE__ */
|
|
1387
|
+
d && _(
|
|
1388
|
+
/* @__PURE__ */ c(
|
|
1254
1389
|
"div",
|
|
1255
1390
|
{
|
|
1256
|
-
ref:
|
|
1257
|
-
id:
|
|
1391
|
+
ref: C,
|
|
1392
|
+
id: M,
|
|
1258
1393
|
role: "tooltip",
|
|
1259
|
-
className:
|
|
1260
|
-
"fixed z-50 px-2 py-1 text-sm rounded shadow-lg pointer-events-auto transition-all duration-150 ease-out",
|
|
1261
|
-
|
|
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",
|
|
1262
1397
|
s
|
|
1263
1398
|
),
|
|
1264
1399
|
style: i ? { left: i.x, top: i.y } : { opacity: 0 },
|
|
1265
1400
|
onMouseEnter: () => {
|
|
1266
|
-
h(!0),
|
|
1401
|
+
h(!0), Q.current && clearTimeout(Q.current);
|
|
1267
1402
|
},
|
|
1268
1403
|
onMouseLeave: () => {
|
|
1269
1404
|
h(!1);
|
|
1270
1405
|
},
|
|
1271
|
-
children:
|
|
1406
|
+
children: t
|
|
1272
1407
|
}
|
|
1273
1408
|
),
|
|
1274
1409
|
document.body
|
|
@@ -1276,24 +1411,25 @@ function Oe({
|
|
|
1276
1411
|
] });
|
|
1277
1412
|
}
|
|
1278
1413
|
export {
|
|
1279
|
-
|
|
1414
|
+
Ue as Accordion,
|
|
1280
1415
|
q as AccordionItem,
|
|
1281
|
-
|
|
1416
|
+
at as ActionModal,
|
|
1282
1417
|
me as Button,
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
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,
|
|
1290
1426
|
G as RadioGroupItem,
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
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
|
|
1298
1434
|
};
|
|
1299
1435
|
//# sourceMappingURL=components.esm.js.map
|