@moondreamsdev/dreamer-ui 1.7.4-test.0 → 1.7.4-test.10
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/{QuestionMarkCircled-CIc05alV.js → QuestionMarkCircled-JRFAPLtT.js} +14 -2
- package/dist/QuestionMarkCircled-JRFAPLtT.js.map +1 -0
- package/dist/{QuestionMarkCircled-BYe9_hkd.cjs → QuestionMarkCircled-o1tqa8ZJ.cjs} +2 -2
- package/dist/QuestionMarkCircled-o1tqa8ZJ.cjs.map +1 -0
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +524 -402
- package/dist/components.esm.js.map +1 -1
- package/dist/src/components/accordion/Accordion.d.ts +2 -2
- package/dist/src/components/button/variants.d.ts +1 -1
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/input/variants.d.ts +3 -3
- package/dist/src/components/modal/Modal.d.ts +22 -0
- package/dist/src/components/modal/hooks.d.ts +6 -0
- package/dist/src/components/modal/index.d.ts +1 -0
- package/dist/src/components/radiogroup/RadioGroup.d.ts +2 -2
- package/dist/src/components/textarea/variants.d.ts +2 -2
- package/dist/src/symbols/X.d.ts +4 -0
- package/dist/src/symbols/index.d.ts +1 -0
- package/dist/symbols.cjs.js +1 -1
- package/dist/symbols.esm.js +3 -2
- package/dist/theme.css +2 -2
- package/package.json +1 -1
- package/dist/QuestionMarkCircled-BYe9_hkd.cjs.map +0 -1
- package/dist/QuestionMarkCircled-CIc05alV.js.map +0 -1
package/dist/components.esm.js
CHANGED
|
@@ -1,122 +1,123 @@
|
|
|
1
|
-
import { jsxs as w, jsx as
|
|
2
|
-
import I, { useId as
|
|
3
|
-
import { join as
|
|
4
|
-
import { b as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsxs as w, jsx as d, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import I, { useId as A, useState as C, createElement as V, useEffect as E, useCallback as $, useMemo as F, useRef as Q, isValidElement as U, cloneElement as W } from "react";
|
|
3
|
+
import { join as g } from "./utils.esm.js";
|
|
4
|
+
import { b as X, C as _, E as J, a as Y, d as Z, c as M, Q as O, X as P } from "./QuestionMarkCircled-JRFAPLtT.js";
|
|
5
|
+
import { createPortal as ee } from "react-dom";
|
|
6
|
+
function L({
|
|
7
|
+
id: n,
|
|
8
|
+
title: t,
|
|
8
9
|
content: e,
|
|
9
|
-
children:
|
|
10
|
+
children: r,
|
|
10
11
|
className: a = "",
|
|
11
|
-
disabled:
|
|
12
|
+
disabled: o = !1,
|
|
12
13
|
isOpen: s = !1,
|
|
13
|
-
onToggle:
|
|
14
|
+
onToggle: l,
|
|
14
15
|
triggerClassName: u = "",
|
|
15
|
-
bodyClassName:
|
|
16
|
+
bodyClassName: b = ""
|
|
16
17
|
}) {
|
|
17
|
-
const p =
|
|
18
|
-
!
|
|
19
|
-
},
|
|
18
|
+
const p = A(), i = n || `accordion-item-${p}`, x = `${i}-header`, m = `${i}-panel`, c = () => {
|
|
19
|
+
!o && l && l();
|
|
20
|
+
}, y = (f) => {
|
|
20
21
|
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), c());
|
|
21
22
|
};
|
|
22
|
-
return /* @__PURE__ */ w("div", { className:
|
|
23
|
+
return /* @__PURE__ */ w("div", { className: g("border-b border-gray-200", o && "opacity-60 cursor-not-allowed", a), children: [
|
|
23
24
|
/* @__PURE__ */ w(
|
|
24
25
|
"button",
|
|
25
26
|
{
|
|
26
|
-
id:
|
|
27
|
+
id: x,
|
|
27
28
|
type: "button",
|
|
28
|
-
className:
|
|
29
|
+
className: g(
|
|
29
30
|
"w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",
|
|
30
|
-
|
|
31
|
+
o ? "cursor-not-allowed" : "hover:bg-gray-50/10 cursor-pointer",
|
|
31
32
|
u
|
|
32
33
|
),
|
|
33
34
|
"aria-expanded": s,
|
|
34
|
-
"aria-controls":
|
|
35
|
-
disabled:
|
|
35
|
+
"aria-controls": m,
|
|
36
|
+
disabled: o,
|
|
36
37
|
onClick: c,
|
|
37
|
-
onKeyDown:
|
|
38
|
+
onKeyDown: y,
|
|
38
39
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ d("span", { children: t }),
|
|
41
|
+
/* @__PURE__ */ d(
|
|
41
42
|
"span",
|
|
42
43
|
{
|
|
43
|
-
className:
|
|
44
|
+
className: g(
|
|
44
45
|
"transform transition-transform duration-300 ease-linear",
|
|
45
46
|
s ? "rotate-180" : "rotate-0"
|
|
46
47
|
),
|
|
47
48
|
"aria-hidden": "true",
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ d(X, { size: 18 })
|
|
49
50
|
}
|
|
50
51
|
)
|
|
51
52
|
]
|
|
52
53
|
}
|
|
53
54
|
),
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ d(
|
|
55
56
|
"div",
|
|
56
57
|
{
|
|
57
|
-
id:
|
|
58
|
+
id: m,
|
|
58
59
|
role: "region",
|
|
59
|
-
"aria-labelledby":
|
|
60
|
-
className:
|
|
60
|
+
"aria-labelledby": x,
|
|
61
|
+
className: g(
|
|
61
62
|
"transition-all duration-300 ease-linear px-4",
|
|
62
63
|
s ? "max-h-96 opacity-100 overflow-auto py-3" : "max-h-0 opacity-0 overflow-hidden",
|
|
63
|
-
|
|
64
|
+
b
|
|
64
65
|
),
|
|
65
|
-
children: s && (
|
|
66
|
+
children: s && (r || e)
|
|
66
67
|
}
|
|
67
68
|
)
|
|
68
69
|
] });
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
|
|
72
|
-
items:
|
|
71
|
+
function Ce({
|
|
72
|
+
id: n,
|
|
73
|
+
items: t = [],
|
|
73
74
|
children: e,
|
|
74
|
-
className:
|
|
75
|
+
className: r = "",
|
|
75
76
|
itemClassName: a = "",
|
|
76
|
-
allowMultiple:
|
|
77
|
+
allowMultiple: o = !1,
|
|
77
78
|
defaultOpenItems: s = [],
|
|
78
|
-
triggersClassName:
|
|
79
|
+
triggersClassName: l = "",
|
|
79
80
|
bodiesClassName: u = ""
|
|
80
81
|
}) {
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
return
|
|
82
|
+
const b = A(), p = n || `accordion-group-${b}`, [i, x] = C(new Set(s)), m = (f) => {
|
|
83
|
+
x((h) => {
|
|
84
|
+
const v = new Set(h);
|
|
85
|
+
return v.has(f) ? v.delete(f) : (o || v.clear(), v.add(f)), v;
|
|
85
86
|
});
|
|
86
|
-
}, c = (f) => `${
|
|
87
|
-
return /* @__PURE__ */ w("div", { id: p, className:
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
|
|
87
|
+
}, c = (f) => `${b}-item-${f}`, y = (f) => i.has(f);
|
|
88
|
+
return /* @__PURE__ */ w("div", { id: p, className: r, children: [
|
|
89
|
+
t.length > 0 && t.map((f, h) => {
|
|
90
|
+
const v = f.id || c(h);
|
|
91
|
+
return /* @__PURE__ */ d(
|
|
92
|
+
L,
|
|
92
93
|
{
|
|
93
|
-
id:
|
|
94
|
+
id: v,
|
|
94
95
|
title: f.title,
|
|
95
96
|
content: f.content,
|
|
96
97
|
disabled: f.disabled,
|
|
97
|
-
isOpen:
|
|
98
|
-
onToggle: () =>
|
|
98
|
+
isOpen: y(v),
|
|
99
|
+
onToggle: () => m(v),
|
|
99
100
|
className: a,
|
|
100
|
-
triggerClassName:
|
|
101
|
+
triggerClassName: l,
|
|
101
102
|
bodyClassName: u
|
|
102
103
|
},
|
|
103
|
-
|
|
104
|
+
v
|
|
104
105
|
);
|
|
105
106
|
}),
|
|
106
|
-
|
|
107
|
-
if (I.isValidElement(f) && f.type ===
|
|
108
|
-
const
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
|
|
107
|
+
t.length === 0 && e && I.Children.map(e, (f, h) => {
|
|
108
|
+
if (I.isValidElement(f) && f.type === L) {
|
|
109
|
+
const v = f.props.id || c(h);
|
|
110
|
+
return /* @__PURE__ */ V(
|
|
111
|
+
L,
|
|
111
112
|
{
|
|
112
113
|
...f.props,
|
|
113
|
-
key:
|
|
114
|
-
id:
|
|
115
|
-
className:
|
|
116
|
-
isOpen:
|
|
117
|
-
onToggle: () =>
|
|
118
|
-
triggerClassName:
|
|
119
|
-
bodyClassName:
|
|
114
|
+
key: v,
|
|
115
|
+
id: v,
|
|
116
|
+
className: g(a, f.props.className),
|
|
117
|
+
isOpen: y(v),
|
|
118
|
+
onToggle: () => m(v),
|
|
119
|
+
triggerClassName: g(l, f.props.triggerClassName),
|
|
120
|
+
bodyClassName: g(u, f.props.bodyClassName)
|
|
120
121
|
}
|
|
121
122
|
);
|
|
122
123
|
}
|
|
@@ -124,33 +125,33 @@ function le({
|
|
|
124
125
|
})
|
|
125
126
|
] });
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
-
const [
|
|
129
|
-
return
|
|
128
|
+
function te() {
|
|
129
|
+
const [n, t] = C(0);
|
|
130
|
+
return E(() => {
|
|
130
131
|
const e = setInterval(() => {
|
|
131
|
-
|
|
132
|
+
t((r) => (r + 1) % 3);
|
|
132
133
|
}, 500);
|
|
133
134
|
return () => clearInterval(e);
|
|
134
|
-
}, []), /* @__PURE__ */
|
|
135
|
+
}, []), /* @__PURE__ */ d("div", { className: "absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle", children: [0, 1, 2].map((e) => /* @__PURE__ */ d(
|
|
135
136
|
"div",
|
|
136
137
|
{
|
|
137
|
-
className:
|
|
138
|
+
className: g(
|
|
138
139
|
"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
|
|
139
|
-
|
|
140
|
+
n === e && "transform -translate-y-1"
|
|
140
141
|
)
|
|
141
142
|
},
|
|
142
143
|
e
|
|
143
144
|
)) });
|
|
144
145
|
}
|
|
145
|
-
const
|
|
146
|
+
const re = {
|
|
146
147
|
base: "",
|
|
147
148
|
primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
|
|
148
149
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
149
150
|
tertiary: "text-primary hover:text-primary-foreground disabled:text-muted",
|
|
150
151
|
outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
|
|
151
152
|
link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
|
|
152
|
-
|
|
153
|
-
},
|
|
153
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
|
|
154
|
+
}, ne = {
|
|
154
155
|
stripped: "",
|
|
155
156
|
fitted: "size-fit",
|
|
156
157
|
sm: "px-2 py-1 text-sm",
|
|
@@ -158,61 +159,61 @@ const J = {
|
|
|
158
159
|
lg: "px-6 py-3 text-lg",
|
|
159
160
|
icon: "p-1 w-fit aspect-square",
|
|
160
161
|
full: "p-2 w-full"
|
|
161
|
-
},
|
|
162
|
+
}, ae = {
|
|
162
163
|
none: "rounded-none",
|
|
163
164
|
sm: "rounded-sm",
|
|
164
165
|
md: "rounded-md",
|
|
165
166
|
lg: "rounded-lg",
|
|
166
167
|
full: "rounded-full"
|
|
167
|
-
},
|
|
168
|
+
}, j = {
|
|
168
169
|
variant: "primary",
|
|
169
170
|
size: "md",
|
|
170
171
|
rounded: "md"
|
|
171
172
|
};
|
|
172
|
-
function
|
|
173
|
-
variant:
|
|
174
|
-
size:
|
|
175
|
-
rounded: e =
|
|
176
|
-
loading:
|
|
173
|
+
function oe({
|
|
174
|
+
variant: n = j.variant,
|
|
175
|
+
size: t,
|
|
176
|
+
rounded: e = j.rounded,
|
|
177
|
+
loading: r,
|
|
177
178
|
linkTo: a,
|
|
178
|
-
linkProps:
|
|
179
|
+
linkProps: o,
|
|
179
180
|
type: s = "button",
|
|
180
|
-
className:
|
|
181
|
+
className: l,
|
|
181
182
|
...u
|
|
182
183
|
}) {
|
|
183
|
-
let
|
|
184
|
-
|
|
185
|
-
const
|
|
184
|
+
let b;
|
|
185
|
+
n === "link" && !t ? b = "fitted" : b = t || j.size;
|
|
186
|
+
const i = g(
|
|
186
187
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
188
|
+
re[n],
|
|
189
|
+
ne[b],
|
|
190
|
+
ae[e],
|
|
191
|
+
r && "relative pointer-events-none",
|
|
191
192
|
a && "relative",
|
|
192
|
-
|
|
193
|
+
l
|
|
193
194
|
);
|
|
194
195
|
return /* @__PURE__ */ w(
|
|
195
196
|
"button",
|
|
196
197
|
{
|
|
197
198
|
...u,
|
|
198
199
|
role: a ? "link" : u.role,
|
|
199
|
-
"aria-label": u["aria-label"] || (
|
|
200
|
-
"aria-description": u["aria-description"] || (
|
|
201
|
-
"aria-disabled": u.disabled ||
|
|
202
|
-
"aria-busy":
|
|
200
|
+
"aria-label": u["aria-label"] || (o == null ? void 0 : o["aria-label"]),
|
|
201
|
+
"aria-description": u["aria-description"] || (o == null ? void 0 : o["aria-description"]),
|
|
202
|
+
"aria-disabled": u.disabled || r,
|
|
203
|
+
"aria-busy": r,
|
|
203
204
|
type: s,
|
|
204
|
-
className:
|
|
205
|
+
className: i,
|
|
205
206
|
children: [
|
|
206
|
-
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
a && !u.disabled && /* @__PURE__ */
|
|
207
|
+
r && /* @__PURE__ */ d(te, {}),
|
|
208
|
+
/* @__PURE__ */ d("span", { className: g(r && "invisible"), children: u.children }),
|
|
209
|
+
a && !u.disabled && /* @__PURE__ */ d(
|
|
209
210
|
"a",
|
|
210
211
|
{
|
|
211
|
-
...
|
|
212
|
+
...o,
|
|
212
213
|
"aria-hidden": !0,
|
|
213
214
|
href: a,
|
|
214
|
-
target: (
|
|
215
|
-
rel: (
|
|
215
|
+
target: (o == null ? void 0 : o.target) || "_blank",
|
|
216
|
+
rel: (o == null ? void 0 : o.rel) || "noreferrer",
|
|
216
217
|
className: "absolute inset-0"
|
|
217
218
|
}
|
|
218
219
|
)
|
|
@@ -220,270 +221,390 @@ function ue({
|
|
|
220
221
|
}
|
|
221
222
|
);
|
|
222
223
|
}
|
|
223
|
-
function
|
|
224
|
-
const [
|
|
225
|
-
let
|
|
226
|
-
for (;
|
|
227
|
-
const
|
|
228
|
-
|
|
224
|
+
function se(n) {
|
|
225
|
+
const [t, e] = C(""), r = $((a) => {
|
|
226
|
+
let o = a, s = "";
|
|
227
|
+
for (; o && !s; ) {
|
|
228
|
+
const l = window.getComputedStyle(o).backgroundColor;
|
|
229
|
+
l && l !== "transparent" && l !== "rgba(0, 0, 0, 0)" && (s = l), o = o.parentElement;
|
|
229
230
|
}
|
|
230
231
|
return s || "transparent";
|
|
231
232
|
}, []);
|
|
232
|
-
return
|
|
233
|
-
const a = document.getElementById(
|
|
233
|
+
return E(() => {
|
|
234
|
+
const a = document.getElementById(n);
|
|
234
235
|
if (a) {
|
|
235
|
-
const
|
|
236
|
-
e(
|
|
236
|
+
const o = r(a.parentElement);
|
|
237
|
+
e(o);
|
|
237
238
|
}
|
|
238
|
-
}, [
|
|
239
|
+
}, [n, r]), t;
|
|
239
240
|
}
|
|
240
|
-
function
|
|
241
|
-
ref:
|
|
242
|
-
id:
|
|
241
|
+
function Ee({
|
|
242
|
+
ref: n,
|
|
243
|
+
id: t,
|
|
243
244
|
size: e = 20,
|
|
244
|
-
color:
|
|
245
|
+
color: r,
|
|
245
246
|
filled: a = !1,
|
|
246
|
-
rounded:
|
|
247
|
+
rounded: o = !0,
|
|
247
248
|
checked: s = !1,
|
|
248
|
-
onCheckedChange:
|
|
249
|
+
onCheckedChange: l,
|
|
249
250
|
disabled: u,
|
|
250
|
-
className:
|
|
251
|
+
className: b = "",
|
|
251
252
|
...p
|
|
252
253
|
}) {
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
const i = A(), x = F(() => t || `checkbox-${i}`, [t, i]), m = se(x), [c, y] = C(s);
|
|
255
|
+
E(() => {
|
|
256
|
+
y(s);
|
|
256
257
|
}, [s]);
|
|
257
258
|
const f = () => {
|
|
258
|
-
u || (
|
|
259
|
-
},
|
|
260
|
-
|
|
261
|
-
},
|
|
259
|
+
u || (y(!c), l == null || l(!c));
|
|
260
|
+
}, h = (N) => {
|
|
261
|
+
N.key === " " && (N.preventDefault(), f());
|
|
262
|
+
}, v = g(
|
|
262
263
|
"flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",
|
|
263
|
-
|
|
264
|
+
o && "rounded",
|
|
264
265
|
u && "opacity-40 cursor-not-allowed",
|
|
265
266
|
!u && "cursor-pointer",
|
|
266
|
-
|
|
267
|
+
b
|
|
267
268
|
);
|
|
268
|
-
return /* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ d(
|
|
269
270
|
"button",
|
|
270
271
|
{
|
|
271
|
-
id:
|
|
272
|
+
id: x,
|
|
272
273
|
type: "button",
|
|
273
|
-
ref:
|
|
274
|
+
ref: n,
|
|
274
275
|
tabIndex: 0,
|
|
275
276
|
role: "checkbox",
|
|
276
277
|
onClick: f,
|
|
277
278
|
"aria-checked": c,
|
|
278
279
|
"aria-disabled": u,
|
|
279
|
-
onKeyDownCapture:
|
|
280
|
+
onKeyDownCapture: h,
|
|
280
281
|
style: {
|
|
281
282
|
width: e,
|
|
282
283
|
height: e,
|
|
283
|
-
color:
|
|
284
|
+
color: r,
|
|
284
285
|
backgroundColor: c && a ? "currentcolor" : "transparent"
|
|
285
286
|
},
|
|
286
|
-
className:
|
|
287
|
+
className: v,
|
|
287
288
|
...p,
|
|
288
|
-
children: c && /* @__PURE__ */
|
|
289
|
+
children: c && /* @__PURE__ */ d(_, { size: e, color: a ? m : void 0 })
|
|
289
290
|
}
|
|
290
291
|
);
|
|
291
292
|
}
|
|
292
|
-
function
|
|
293
|
-
children:
|
|
294
|
-
className:
|
|
293
|
+
function Ae({
|
|
294
|
+
children: n,
|
|
295
|
+
className: t,
|
|
295
296
|
linkTo: e,
|
|
296
|
-
linkProps:
|
|
297
|
+
linkProps: r,
|
|
297
298
|
onButtonClick: a,
|
|
298
|
-
buttonProps:
|
|
299
|
+
buttonProps: o,
|
|
299
300
|
...s
|
|
300
301
|
}) {
|
|
301
|
-
return e && a && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */ w("div", { className:
|
|
302
|
-
|
|
303
|
-
e && /* @__PURE__ */
|
|
302
|
+
return e && a && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */ w("div", { className: g("relative w-fit", t), ...s, children: [
|
|
303
|
+
n,
|
|
304
|
+
e && /* @__PURE__ */ d(
|
|
304
305
|
"a",
|
|
305
306
|
{
|
|
306
|
-
...
|
|
307
|
+
...r,
|
|
307
308
|
href: e,
|
|
308
|
-
className:
|
|
309
|
+
className: g("absolute inset-0", r == null ? void 0 : r.className)
|
|
309
310
|
}
|
|
310
311
|
),
|
|
311
|
-
!e && a && /* @__PURE__ */
|
|
312
|
+
!e && a && /* @__PURE__ */ d(
|
|
312
313
|
"button",
|
|
313
314
|
{
|
|
314
|
-
...
|
|
315
|
+
...o,
|
|
315
316
|
type: "button",
|
|
316
317
|
onClick: a,
|
|
317
|
-
className:
|
|
318
|
+
className: g("absolute inset-0 cursor-pointer", o == null ? void 0 : o.className)
|
|
318
319
|
}
|
|
319
320
|
)
|
|
320
321
|
] });
|
|
321
322
|
}
|
|
322
|
-
function D({ elementId:
|
|
323
|
-
return
|
|
324
|
-
const
|
|
325
|
-
if (
|
|
326
|
-
if (!e &&
|
|
327
|
-
|
|
323
|
+
function D({ elementId: n, type: t, message: e }) {
|
|
324
|
+
return E(() => {
|
|
325
|
+
const r = document.getElementById(n);
|
|
326
|
+
if (r) {
|
|
327
|
+
if (!e && t === "error") {
|
|
328
|
+
r.removeAttribute("data-error");
|
|
328
329
|
return;
|
|
329
330
|
}
|
|
330
|
-
if (!e &&
|
|
331
|
-
|
|
331
|
+
if (!e && t === "success") {
|
|
332
|
+
r.removeAttribute("data-success");
|
|
332
333
|
return;
|
|
333
334
|
}
|
|
334
|
-
return
|
|
335
|
-
|
|
335
|
+
return r.setAttribute("aria-describedby", `${n}-${t}-message`), r.setAttribute("aria-invalid", t === "error" ? "true" : "false"), t === "error" && r.setAttribute("data-error", "true"), t === "success" && r.setAttribute("data-success", "true"), () => {
|
|
336
|
+
r.removeAttribute("aria-describedby"), r.removeAttribute("aria-invalid"), r.removeAttribute("data-error"), r.removeAttribute("data-success");
|
|
336
337
|
};
|
|
337
338
|
}
|
|
338
|
-
}, [
|
|
339
|
+
}, [n, t, e]), e ? /* @__PURE__ */ w(
|
|
339
340
|
"small",
|
|
340
341
|
{
|
|
341
|
-
className:
|
|
342
|
+
className: g(
|
|
342
343
|
"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",
|
|
343
|
-
|
|
344
|
-
|
|
344
|
+
t === "error" && "text-destructive",
|
|
345
|
+
t === "success" && "text-success"
|
|
345
346
|
),
|
|
346
347
|
role: "status",
|
|
347
348
|
children: [
|
|
348
|
-
|
|
349
|
-
/* @__PURE__ */
|
|
349
|
+
t === "error" ? /* @__PURE__ */ d(J, {}) : /* @__PURE__ */ d(Y, {}),
|
|
350
|
+
/* @__PURE__ */ d("span", { id: `${n}-${t}-message`, children: e })
|
|
350
351
|
]
|
|
351
352
|
}
|
|
352
353
|
) : null;
|
|
353
354
|
}
|
|
354
|
-
const
|
|
355
|
+
const ie = {
|
|
355
356
|
base: "",
|
|
356
|
-
default: "ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-
|
|
357
|
-
underline: "border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-
|
|
358
|
-
outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-
|
|
359
|
-
},
|
|
357
|
+
default: "ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",
|
|
358
|
+
underline: "border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",
|
|
359
|
+
outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
|
|
360
|
+
}, de = {
|
|
360
361
|
none: "rounded-none",
|
|
361
362
|
sm: "rounded-sm",
|
|
362
363
|
md: "rounded-md",
|
|
363
364
|
lg: "rounded-lg",
|
|
364
365
|
full: "px-3 rounded-full"
|
|
365
|
-
},
|
|
366
|
+
}, B = {
|
|
366
367
|
variant: "default",
|
|
367
368
|
rounded: "none"
|
|
368
369
|
};
|
|
369
|
-
function
|
|
370
|
-
variant:
|
|
371
|
-
rounded:
|
|
370
|
+
function $e({
|
|
371
|
+
variant: n = B.variant,
|
|
372
|
+
rounded: t,
|
|
372
373
|
displayOnlyMode: e = !1,
|
|
373
|
-
errorMessage:
|
|
374
|
+
errorMessage: r,
|
|
374
375
|
successMessage: a,
|
|
375
|
-
type:
|
|
376
|
+
type: o = "text",
|
|
376
377
|
className: s,
|
|
377
|
-
...
|
|
378
|
+
...l
|
|
378
379
|
}) {
|
|
379
|
-
const u =
|
|
380
|
-
let
|
|
381
|
-
|
|
382
|
-
const c =
|
|
380
|
+
const u = A(), [b, p] = C(!1);
|
|
381
|
+
let i = t;
|
|
382
|
+
n === "outline" && !t && (i = "md"), i = i || B.rounded;
|
|
383
|
+
const c = g(
|
|
383
384
|
"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
|
|
384
385
|
"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",
|
|
385
|
-
!e &&
|
|
386
|
-
!e &&
|
|
387
|
-
|
|
386
|
+
!e && ie[n],
|
|
387
|
+
!e && de[i],
|
|
388
|
+
o === "password" && "pr-10",
|
|
388
389
|
!e && "px-2 py-1",
|
|
389
390
|
e && "pointer-events-none",
|
|
390
391
|
s
|
|
391
392
|
);
|
|
392
|
-
return /* @__PURE__ */ w("div", { className:
|
|
393
|
-
/* @__PURE__ */ w("div", { className:
|
|
394
|
-
/* @__PURE__ */
|
|
393
|
+
return /* @__PURE__ */ w("div", { className: g(e && "cursor-text"), style: { height: l.height, width: l.width }, children: [
|
|
394
|
+
/* @__PURE__ */ w("div", { className: g(o === "password" && "relative"), children: [
|
|
395
|
+
/* @__PURE__ */ d(
|
|
395
396
|
"input",
|
|
396
397
|
{
|
|
397
|
-
...
|
|
398
|
+
...l,
|
|
398
399
|
id: u,
|
|
399
|
-
type:
|
|
400
|
-
"aria-disabled":
|
|
400
|
+
type: o === "password" && b ? "text" : o,
|
|
401
|
+
"aria-disabled": l.disabled,
|
|
401
402
|
readOnly: e,
|
|
402
|
-
"aria-readonly": e ||
|
|
403
|
-
"data-error":
|
|
403
|
+
"aria-readonly": e || l["aria-readonly"],
|
|
404
|
+
"data-error": r ? !0 : void 0,
|
|
404
405
|
"data-success": a ? !0 : void 0,
|
|
405
406
|
className: c
|
|
406
407
|
}
|
|
407
408
|
),
|
|
408
|
-
|
|
409
|
+
o === "password" && /* @__PURE__ */ d(
|
|
409
410
|
"button",
|
|
410
411
|
{
|
|
411
|
-
onClick: () => p(!
|
|
412
|
+
onClick: () => p(!b),
|
|
412
413
|
className: "absolute inset-y-0 right-0 px-2 hover:cursor-pointer",
|
|
413
414
|
"aria-label": "Toggle password visibility",
|
|
414
|
-
"data-state":
|
|
415
|
-
children:
|
|
415
|
+
"data-state": b ? "visible" : "hidden",
|
|
416
|
+
children: b ? /* @__PURE__ */ d(Z, { size: 20 }) : /* @__PURE__ */ d(M, { size: 20 })
|
|
416
417
|
}
|
|
417
418
|
)
|
|
418
419
|
] }),
|
|
419
|
-
!e && /* @__PURE__ */
|
|
420
|
-
!e && /* @__PURE__ */
|
|
420
|
+
!e && /* @__PURE__ */ d(D, { elementId: u, type: "error", message: r }),
|
|
421
|
+
!e && /* @__PURE__ */ d(D, { elementId: u, type: "success", message: a })
|
|
421
422
|
] });
|
|
422
423
|
}
|
|
423
|
-
function
|
|
424
|
-
display:
|
|
425
|
-
width:
|
|
424
|
+
function Ie({
|
|
425
|
+
display: n = "inline",
|
|
426
|
+
width: t = "fit-content",
|
|
426
427
|
className: e = "",
|
|
427
|
-
required:
|
|
428
|
+
required: r,
|
|
428
429
|
helpMessage: a,
|
|
429
|
-
suffix:
|
|
430
|
+
suffix: o,
|
|
430
431
|
htmlFor: s,
|
|
431
|
-
children:
|
|
432
|
+
children: l,
|
|
432
433
|
...u
|
|
433
434
|
}) {
|
|
434
|
-
const
|
|
435
|
-
return /* @__PURE__ */ w("div", { style: { display:
|
|
435
|
+
const b = A(), p = g("font-medium", n, e), i = a ? `${s ?? b}-help` : void 0;
|
|
436
|
+
return /* @__PURE__ */ w("div", { style: { display: n === "inline" ? "inline-flex" : "flex", width: t }, className: "relative", children: [
|
|
436
437
|
/* @__PURE__ */ w("label", { className: p, htmlFor: s, ...u, children: [
|
|
437
|
-
|
|
438
|
-
|
|
438
|
+
l,
|
|
439
|
+
r && /* @__PURE__ */ d("span", { className: "text-red-500 font-medium ml-1", "aria-label": "required", children: "*" })
|
|
439
440
|
] }),
|
|
440
|
-
a && /* @__PURE__ */
|
|
441
|
+
a && /* @__PURE__ */ d(
|
|
441
442
|
"span",
|
|
442
443
|
{
|
|
443
444
|
className: "text-gray-500 ml-1 size-fit -translate-y-1/3",
|
|
444
|
-
"aria-describedby":
|
|
445
|
+
"aria-describedby": i,
|
|
445
446
|
"aria-label": "Help information",
|
|
446
447
|
title: a,
|
|
447
|
-
children: /* @__PURE__ */
|
|
448
|
+
children: /* @__PURE__ */ d(O, {})
|
|
448
449
|
}
|
|
449
450
|
),
|
|
450
|
-
a && /* @__PURE__ */
|
|
451
|
-
|
|
451
|
+
a && /* @__PURE__ */ d("div", { id: i, className: "sr-only", children: a }),
|
|
452
|
+
o && /* @__PURE__ */ d("span", { className: "ml-1", children: o })
|
|
452
453
|
] });
|
|
453
454
|
}
|
|
454
|
-
function
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
455
|
+
function z(...n) {
|
|
456
|
+
return n.filter((t) => typeof t == "string" && t).join(" ").trim() || void 0;
|
|
457
|
+
}
|
|
458
|
+
function le(n) {
|
|
459
|
+
const [t, e] = C(!1), [r, a] = C(!1);
|
|
460
|
+
return E(() => {
|
|
461
|
+
n ? (a(!0), setTimeout(() => e(!0), 10)) : (e(!1), setTimeout(() => a(!1), 150));
|
|
462
|
+
}, [n]), { show: t, shouldRender: r };
|
|
463
|
+
}
|
|
464
|
+
function ue(n, t) {
|
|
465
|
+
E(() => {
|
|
466
|
+
const e = (r) => {
|
|
467
|
+
r.key === "Escape" && n && t();
|
|
468
|
+
};
|
|
469
|
+
return document.addEventListener("keydown", e), n && (document.body.style.overflow = "hidden"), () => {
|
|
470
|
+
document.removeEventListener("keydown", e), document.body.style.overflow = "auto";
|
|
471
|
+
};
|
|
472
|
+
}, [n, t]);
|
|
473
|
+
}
|
|
474
|
+
function ce(n, t) {
|
|
475
|
+
const e = Q(null), r = $(() => {
|
|
476
|
+
const a = document.getElementById(n);
|
|
477
|
+
if (!a) return;
|
|
478
|
+
const o = a.querySelectorAll('[data-modal-action="true"]');
|
|
479
|
+
if (o.length > 0) {
|
|
480
|
+
o[0].focus();
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
const s = a.querySelectorAll(
|
|
484
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
485
|
+
);
|
|
486
|
+
if (s.length > 0) {
|
|
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
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
s[0].focus();
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
a.focus();
|
|
496
|
+
}, [n]);
|
|
497
|
+
E(() => (t && (e.current = document.activeElement, r()), () => {
|
|
498
|
+
document.body.style.overflow = "auto", e.current instanceof HTMLElement && e.current.focus();
|
|
499
|
+
}), [t, r]);
|
|
500
|
+
}
|
|
501
|
+
function De({
|
|
502
|
+
id: n,
|
|
503
|
+
isOpen: t,
|
|
504
|
+
onClose: e,
|
|
505
|
+
title: r,
|
|
506
|
+
children: a,
|
|
507
|
+
contentOnly: o = !1,
|
|
508
|
+
className: s,
|
|
509
|
+
overlayClassName: l,
|
|
510
|
+
hideCloseButton: u = !1,
|
|
511
|
+
actions: b = [],
|
|
512
|
+
disableCloseOnOverlayClick: p = !1,
|
|
513
|
+
ariaLabelledBy: i,
|
|
514
|
+
ariaDescribedBy: x
|
|
515
|
+
}) {
|
|
516
|
+
const m = A(), c = n || `modal-${m}`, y = n ? `${n}-title` : `modal-title-${m}`, { show: f, shouldRender: h } = le(t);
|
|
517
|
+
if (ce(c, h), ue(h, e), !h) return null;
|
|
518
|
+
const v = () => r ? I.isValidElement(r) ? /* @__PURE__ */ d("div", { className: "mb-4", children: r }) : /* @__PURE__ */ d("h2", { className: "mb-4 text-xl font-semibold", id: y, children: r }) : null, N = () => b.length === 0 ? null : /* @__PURE__ */ d("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: b.map((k, q) => {
|
|
519
|
+
const { label: T, className: H, ...K } = k;
|
|
520
|
+
return /* @__PURE__ */ d(oe, { className: H, type: "button", ...K, "data-modal-action": "true", children: T }, q);
|
|
521
|
+
}) });
|
|
522
|
+
return /* @__PURE__ */ d(G, { children: ee(
|
|
523
|
+
/* @__PURE__ */ d(
|
|
524
|
+
"div",
|
|
525
|
+
{
|
|
526
|
+
"aria-labelledby": i ?? r ? y : void 0,
|
|
527
|
+
"aria-describedby": x,
|
|
528
|
+
role: "dialog",
|
|
529
|
+
"aria-modal": "true",
|
|
530
|
+
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
531
|
+
children: /* @__PURE__ */ w("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
|
|
532
|
+
/* @__PURE__ */ d(
|
|
533
|
+
"div",
|
|
534
|
+
{
|
|
535
|
+
className: z("fixed inset-0 bg-black/20 transition-all", l),
|
|
536
|
+
onClick: () => {
|
|
537
|
+
p || e();
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
),
|
|
541
|
+
o && /* @__PURE__ */ d("div", { className: z("relative w-fit", s), children: a }),
|
|
542
|
+
!o && /* @__PURE__ */ w(
|
|
543
|
+
"div",
|
|
544
|
+
{
|
|
545
|
+
id: c,
|
|
546
|
+
tabIndex: -1,
|
|
547
|
+
className: z(
|
|
548
|
+
"relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:border ease-in duration-75",
|
|
549
|
+
f ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
550
|
+
s
|
|
551
|
+
),
|
|
552
|
+
children: [
|
|
553
|
+
!u && /* @__PURE__ */ d(
|
|
554
|
+
"button",
|
|
555
|
+
{
|
|
556
|
+
type: "button",
|
|
557
|
+
onClick: e,
|
|
558
|
+
"data-modal-close-button": "true",
|
|
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__ */ d(P, { size: 18 })
|
|
561
|
+
}
|
|
562
|
+
),
|
|
563
|
+
v(),
|
|
564
|
+
a,
|
|
565
|
+
N()
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
)
|
|
569
|
+
] })
|
|
570
|
+
}
|
|
571
|
+
),
|
|
572
|
+
document.body
|
|
573
|
+
) });
|
|
574
|
+
}
|
|
575
|
+
function ke({ children: n, ref: t, ...e }) {
|
|
576
|
+
if (U(n)) {
|
|
577
|
+
let r = { ...e };
|
|
578
|
+
return n.props && (r = { ...r, ...n.props }), W(n, {
|
|
579
|
+
...r,
|
|
459
580
|
ref: (a) => {
|
|
460
|
-
typeof
|
|
581
|
+
typeof t == "function" ? t(a) : t && (t.current = a);
|
|
461
582
|
}
|
|
462
583
|
});
|
|
463
584
|
}
|
|
464
|
-
return
|
|
585
|
+
return V("div", { ...e, ref: t }, n);
|
|
465
586
|
}
|
|
466
|
-
function
|
|
467
|
-
const s = "relative inline-flex items-center justify-center rounded-full",
|
|
587
|
+
function fe({ itemId: n, checked: t, onChange: e, name: r, disabled: a = !1, className: o = "" }) {
|
|
588
|
+
const s = "relative inline-flex items-center justify-center rounded-full", l = () => {
|
|
468
589
|
a || e();
|
|
469
|
-
}, u =
|
|
590
|
+
}, u = g(
|
|
470
591
|
s,
|
|
471
|
-
!
|
|
592
|
+
!t && "hover:border-current/60",
|
|
472
593
|
!a && "border-current cursor-pointer",
|
|
473
594
|
a && "border-muted/60 cursor-not-allowed",
|
|
474
|
-
|
|
595
|
+
o
|
|
475
596
|
);
|
|
476
|
-
return /* @__PURE__ */
|
|
597
|
+
return /* @__PURE__ */ d(
|
|
477
598
|
"div",
|
|
478
599
|
{
|
|
479
|
-
id:
|
|
600
|
+
id: n,
|
|
480
601
|
role: "radio",
|
|
481
602
|
tabIndex: -1,
|
|
482
|
-
"aria-checked":
|
|
603
|
+
"aria-checked": t,
|
|
483
604
|
"aria-disabled": a,
|
|
484
|
-
"aria-description": `Radio button for ${
|
|
485
|
-
"aria-labelledby": `${
|
|
486
|
-
onClick:
|
|
605
|
+
"aria-description": `Radio button for ${r}`,
|
|
606
|
+
"aria-labelledby": `${n}-label`,
|
|
607
|
+
onClick: l,
|
|
487
608
|
className: u,
|
|
488
609
|
style: {
|
|
489
610
|
width: "1em",
|
|
@@ -491,76 +612,76 @@ function P({ itemId: o, checked: r, onChange: e, name: t, disabled: a = !1, clas
|
|
|
491
612
|
padding: "0.1em",
|
|
492
613
|
borderWidth: "0.06em"
|
|
493
614
|
},
|
|
494
|
-
children:
|
|
615
|
+
children: t && /* @__PURE__ */ d(
|
|
495
616
|
"div",
|
|
496
617
|
{
|
|
497
|
-
className:
|
|
618
|
+
className: g("size-full aspect-square rounded-full", a && "bg-muted/60", !a && "bg-current")
|
|
498
619
|
}
|
|
499
620
|
)
|
|
500
621
|
}
|
|
501
622
|
);
|
|
502
623
|
}
|
|
503
|
-
function
|
|
504
|
-
value:
|
|
505
|
-
children:
|
|
624
|
+
function S({
|
|
625
|
+
value: n,
|
|
626
|
+
children: t,
|
|
506
627
|
className: e = "",
|
|
507
|
-
isSelected:
|
|
628
|
+
isSelected: r = !1,
|
|
508
629
|
onChange: a,
|
|
509
|
-
disabled:
|
|
630
|
+
disabled: o = !1,
|
|
510
631
|
hideInput: s = !1,
|
|
511
|
-
description:
|
|
632
|
+
description: l,
|
|
512
633
|
name: u
|
|
513
634
|
}) {
|
|
514
|
-
const p = `radio-${
|
|
515
|
-
|
|
635
|
+
const p = `radio-${A()}-${n}`, i = () => {
|
|
636
|
+
o || a == null || a(n);
|
|
516
637
|
};
|
|
517
638
|
return /* @__PURE__ */ w(
|
|
518
639
|
"div",
|
|
519
640
|
{
|
|
520
|
-
title:
|
|
521
|
-
className:
|
|
641
|
+
title: l,
|
|
642
|
+
className: g(
|
|
522
643
|
"relative flex items-center",
|
|
523
644
|
e,
|
|
524
645
|
// Uses text color for borders
|
|
525
|
-
s && `p-2 border-2 focus-within:border-dashed focus-within:${
|
|
526
|
-
s && !
|
|
527
|
-
s &&
|
|
528
|
-
|
|
646
|
+
s && `p-2 border-2 focus-within:border-dashed focus-within:${o ? "border-current/50" : "border-current/80"}`,
|
|
647
|
+
s && !r && `border-transparent ${o ? "" : "not-focus-within:hover:border-border/60"}`,
|
|
648
|
+
s && r && "border-border",
|
|
649
|
+
o && "opacity-60 cursor-not-allowed"
|
|
529
650
|
),
|
|
530
651
|
style: {
|
|
531
652
|
gap: "0.5em"
|
|
532
653
|
},
|
|
533
654
|
children: [
|
|
534
|
-
!s && /* @__PURE__ */
|
|
535
|
-
|
|
655
|
+
!s && /* @__PURE__ */ d(
|
|
656
|
+
fe,
|
|
536
657
|
{
|
|
537
658
|
itemId: p,
|
|
538
659
|
name: u || "",
|
|
539
|
-
checked:
|
|
540
|
-
onChange:
|
|
541
|
-
disabled:
|
|
542
|
-
className:
|
|
660
|
+
checked: r,
|
|
661
|
+
onChange: i,
|
|
662
|
+
disabled: o,
|
|
663
|
+
className: g(s && "")
|
|
543
664
|
}
|
|
544
665
|
),
|
|
545
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ d(
|
|
546
667
|
"div",
|
|
547
668
|
{
|
|
548
669
|
id: s ? p : void 0,
|
|
549
670
|
tabIndex: s ? -1 : void 0,
|
|
550
671
|
role: s ? "radio" : void 0,
|
|
551
|
-
onClick: s ?
|
|
552
|
-
"aria-checked": s ?
|
|
553
|
-
"aria-disabled": s ?
|
|
554
|
-
"aria-description": s ?
|
|
672
|
+
onClick: s ? i : void 0,
|
|
673
|
+
"aria-checked": s ? r ? "true" : "false" : void 0,
|
|
674
|
+
"aria-disabled": s ? o : void 0,
|
|
675
|
+
"aria-description": s ? l || `Radio button for ${u}` : void 0,
|
|
555
676
|
"aria-labelledby": s ? `${p}-label` : void 0,
|
|
556
|
-
className:
|
|
557
|
-
children: /* @__PURE__ */
|
|
677
|
+
className: g(s && "size-full", typeof t == "object" && "grow focus:outline-none"),
|
|
678
|
+
children: /* @__PURE__ */ d(
|
|
558
679
|
"label",
|
|
559
680
|
{
|
|
560
681
|
id: `${p}-label`,
|
|
561
|
-
onClick: s ? void 0 :
|
|
562
|
-
className:
|
|
563
|
-
children:
|
|
682
|
+
onClick: s ? void 0 : i,
|
|
683
|
+
className: g(o && "cursor-not-allowed", !o && "cursor-pointer"),
|
|
684
|
+
children: t
|
|
564
685
|
}
|
|
565
686
|
)
|
|
566
687
|
}
|
|
@@ -569,246 +690,247 @@ function z({
|
|
|
569
690
|
}
|
|
570
691
|
);
|
|
571
692
|
}
|
|
572
|
-
function
|
|
573
|
-
const [e,
|
|
574
|
-
var
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
}, []),
|
|
578
|
-
(
|
|
693
|
+
function me(n, t) {
|
|
694
|
+
const [e, r] = C(t), [a, o] = C(-1), [s, l] = C(!1), u = $((m, c) => {
|
|
695
|
+
var h;
|
|
696
|
+
const y = m[c];
|
|
697
|
+
y.hasAttribute("disabled") || y.getAttribute("aria-disabled") === "true" || ((h = m[c]) == null || h.click(), o(c));
|
|
698
|
+
}, []), b = $(
|
|
699
|
+
(m, c) => {
|
|
579
700
|
var f;
|
|
580
|
-
if (
|
|
581
|
-
const
|
|
582
|
-
(f = c[
|
|
701
|
+
if (m.preventDefault(), s || !c.length) return;
|
|
702
|
+
const y = t !== -1 ? t : 0;
|
|
703
|
+
(f = c[y]) == null || f.focus(), r(y), t !== -1 && u(c, y);
|
|
583
704
|
},
|
|
584
|
-
[
|
|
705
|
+
[t, s, u]
|
|
585
706
|
), p = $(
|
|
586
|
-
(
|
|
587
|
-
var
|
|
588
|
-
if (!
|
|
707
|
+
(m) => {
|
|
708
|
+
var h;
|
|
709
|
+
if (!m.shiftKey)
|
|
589
710
|
return;
|
|
590
|
-
|
|
711
|
+
m.preventDefault();
|
|
591
712
|
const c = Array.from(
|
|
592
713
|
document.querySelectorAll(
|
|
593
714
|
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
594
715
|
)
|
|
595
|
-
).filter((
|
|
596
|
-
(
|
|
716
|
+
).filter((v) => !v.hasAttribute("disabled") && v.tabIndex >= 0), y = c.findIndex((v) => v.id === n), f = y > 0 ? y - 1 : c.length - 1;
|
|
717
|
+
(h = c[f]) == null || h.focus();
|
|
597
718
|
},
|
|
598
|
-
[
|
|
599
|
-
),
|
|
600
|
-
(
|
|
601
|
-
var
|
|
719
|
+
[n]
|
|
720
|
+
), i = $(
|
|
721
|
+
(m, c) => {
|
|
722
|
+
var N;
|
|
602
723
|
if (!c.length) return;
|
|
603
|
-
const
|
|
604
|
-
if (!c.some((
|
|
605
|
-
const
|
|
606
|
-
let
|
|
607
|
-
switch (
|
|
724
|
+
const y = m.target;
|
|
725
|
+
if (!c.some((k) => k.id === y.id)) return;
|
|
726
|
+
const h = e !== -1 ? e : 0;
|
|
727
|
+
let v = h;
|
|
728
|
+
switch (m.key) {
|
|
608
729
|
case "ArrowUp":
|
|
609
730
|
case "ArrowLeft":
|
|
610
|
-
|
|
731
|
+
m.preventDefault(), v = h > 0 ? h - 1 : c.length - 1;
|
|
611
732
|
break;
|
|
612
733
|
case "ArrowDown":
|
|
613
734
|
case "ArrowRight":
|
|
614
|
-
|
|
735
|
+
m.preventDefault(), v = (h + 1) % c.length;
|
|
615
736
|
break;
|
|
616
737
|
// Select the option when the space key is pressed
|
|
617
738
|
case " ":
|
|
618
|
-
|
|
739
|
+
m.preventDefault(), u(c, h);
|
|
619
740
|
return;
|
|
620
741
|
case "Tab":
|
|
621
|
-
p(
|
|
742
|
+
p(m);
|
|
622
743
|
return;
|
|
623
744
|
default:
|
|
624
745
|
return;
|
|
625
746
|
}
|
|
626
|
-
(
|
|
747
|
+
(N = c[v]) == null || N.focus(), r(v), a !== -1 && u(c, v);
|
|
627
748
|
},
|
|
628
749
|
[e, a, p, u]
|
|
629
|
-
),
|
|
630
|
-
const
|
|
631
|
-
return
|
|
632
|
-
}, [
|
|
633
|
-
|
|
634
|
-
const
|
|
635
|
-
if (!
|
|
636
|
-
const c =
|
|
637
|
-
return document.addEventListener("keydown", f),
|
|
638
|
-
document.removeEventListener("keydown", f),
|
|
750
|
+
), x = $(() => {
|
|
751
|
+
const m = document.querySelector(`[id="${n}"][role="radiogroup"]`);
|
|
752
|
+
return m ? Array.from(m.querySelectorAll('[role="radio"]')) : [];
|
|
753
|
+
}, [n]);
|
|
754
|
+
E(() => {
|
|
755
|
+
const m = document.querySelector(`[id="${n}"][role="radiogroup"]`);
|
|
756
|
+
if (!m) return;
|
|
757
|
+
const c = x(), y = (N) => b(N, c), f = (N) => i(N, c), h = () => l(!0), v = () => l(!1);
|
|
758
|
+
return document.addEventListener("keydown", f), m.addEventListener("focus", y), m.addEventListener("mousedown", h), document.addEventListener("mouseup", v), () => {
|
|
759
|
+
document.removeEventListener("keydown", f), m.removeEventListener("focus", y), m.removeEventListener("mousedown", h), document.removeEventListener("mouseup", v);
|
|
639
760
|
};
|
|
640
|
-
}, [
|
|
761
|
+
}, [n, x, b, i]);
|
|
641
762
|
}
|
|
642
|
-
function
|
|
643
|
-
options:
|
|
644
|
-
value:
|
|
763
|
+
function Le({
|
|
764
|
+
options: n = [],
|
|
765
|
+
value: t,
|
|
645
766
|
onChange: e,
|
|
646
|
-
|
|
767
|
+
id: r,
|
|
647
768
|
children: a,
|
|
648
|
-
className:
|
|
769
|
+
className: o = "",
|
|
649
770
|
childrenClassName: s = "",
|
|
650
|
-
hideInputs:
|
|
771
|
+
hideInputs: l = !1
|
|
651
772
|
}) {
|
|
652
|
-
const u =
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
773
|
+
const u = A(), b = r || `radio-group-${u}`;
|
|
774
|
+
me(
|
|
775
|
+
b,
|
|
776
|
+
n.findIndex((i) => i === t)
|
|
656
777
|
);
|
|
657
|
-
const p =
|
|
658
|
-
return /* @__PURE__ */ w("div", { id:
|
|
659
|
-
p.length > 0 && p.map((
|
|
660
|
-
|
|
778
|
+
const p = F(() => n.reduce((i, x) => (typeof x == "string" ? i.some((m) => m.value === x) || i.push({ label: x, value: x }) : i.push(x), i), []), [n]);
|
|
779
|
+
return /* @__PURE__ */ w("div", { id: b, role: "radiogroup", tabIndex: 0, className: g(o, "focus:outline-none"), children: [
|
|
780
|
+
p.length > 0 && p.map((i, x) => /* @__PURE__ */ d(
|
|
781
|
+
S,
|
|
661
782
|
{
|
|
662
|
-
value:
|
|
663
|
-
isSelected:
|
|
783
|
+
value: i.value,
|
|
784
|
+
isSelected: t === i.value,
|
|
664
785
|
onChange: e,
|
|
665
|
-
name:
|
|
666
|
-
disabled:
|
|
667
|
-
description:
|
|
668
|
-
hideInput:
|
|
786
|
+
name: b,
|
|
787
|
+
disabled: i.disabled,
|
|
788
|
+
description: i.description,
|
|
789
|
+
hideInput: l,
|
|
669
790
|
className: s,
|
|
670
|
-
children:
|
|
791
|
+
children: i.label
|
|
671
792
|
},
|
|
672
|
-
`${
|
|
793
|
+
`${i.value}-${x}`
|
|
673
794
|
)),
|
|
674
|
-
p.length === 0 && a && I.Children.map(a, (
|
|
675
|
-
|
|
795
|
+
p.length === 0 && a && I.Children.map(a, (i) => I.isValidElement(i) && i.type === S ? /* @__PURE__ */ d(
|
|
796
|
+
S,
|
|
676
797
|
{
|
|
677
|
-
...
|
|
678
|
-
className:
|
|
679
|
-
hideInput:
|
|
680
|
-
isSelected:
|
|
798
|
+
...i.props,
|
|
799
|
+
className: g(s, i.props.className),
|
|
800
|
+
hideInput: i.props.hideInput || l,
|
|
801
|
+
isSelected: t === i.props.value,
|
|
681
802
|
onChange: e,
|
|
682
|
-
name:
|
|
683
|
-
children:
|
|
803
|
+
name: b,
|
|
804
|
+
children: i.props.children
|
|
684
805
|
}
|
|
685
806
|
) : null)
|
|
686
807
|
] });
|
|
687
808
|
}
|
|
688
|
-
function
|
|
689
|
-
const [e,
|
|
690
|
-
return
|
|
691
|
-
const a = document.getElementById(
|
|
809
|
+
function be({ elementId: n, maxLength: t }) {
|
|
810
|
+
const [e, r] = C(0);
|
|
811
|
+
return E(() => {
|
|
812
|
+
const a = document.getElementById(n);
|
|
692
813
|
if (!a)
|
|
693
814
|
return;
|
|
694
|
-
const
|
|
815
|
+
const o = () => {
|
|
695
816
|
const s = a.value.length;
|
|
696
|
-
|
|
697
|
-
const
|
|
698
|
-
a.setAttribute("aria-describedby", `${
|
|
817
|
+
r(s);
|
|
818
|
+
const l = s >= t;
|
|
819
|
+
a.setAttribute("aria-describedby", `${n}-character-count`), a.setAttribute("aria-invalid", l ? "true" : "false"), l ? a.setAttribute("data-error", "true") : a.removeAttribute("data-error");
|
|
699
820
|
};
|
|
700
|
-
return
|
|
701
|
-
a.removeEventListener("input",
|
|
821
|
+
return o(), a.addEventListener("input", o), a.setAttribute("maxlength", String(t)), () => {
|
|
822
|
+
a.removeEventListener("input", o), a.removeAttribute("maxlength"), a.removeAttribute("aria-describedby"), a.removeAttribute("aria-invalid"), a.removeAttribute("data-error");
|
|
702
823
|
};
|
|
703
|
-
}, [
|
|
824
|
+
}, [n, t]), /* @__PURE__ */ d(
|
|
704
825
|
"small",
|
|
705
826
|
{
|
|
706
|
-
className:
|
|
827
|
+
className: g(
|
|
707
828
|
"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",
|
|
708
|
-
e >=
|
|
709
|
-
e <
|
|
829
|
+
e >= t && "text-destructive",
|
|
830
|
+
e < t && "text-current"
|
|
710
831
|
),
|
|
711
832
|
role: "status",
|
|
712
|
-
children: /* @__PURE__ */ w("span", { id: `${
|
|
833
|
+
children: /* @__PURE__ */ w("span", { id: `${n}-character-count`, children: [
|
|
713
834
|
e,
|
|
714
835
|
" / ",
|
|
715
|
-
|
|
836
|
+
t,
|
|
716
837
|
" characters"
|
|
717
838
|
] })
|
|
718
839
|
}
|
|
719
840
|
);
|
|
720
841
|
}
|
|
721
|
-
function
|
|
722
|
-
|
|
723
|
-
const e = document.getElementById(
|
|
842
|
+
function ve(n, t) {
|
|
843
|
+
E(() => {
|
|
844
|
+
const e = document.getElementById(n);
|
|
724
845
|
if (!e)
|
|
725
846
|
return;
|
|
726
|
-
if (!
|
|
847
|
+
if (!t) {
|
|
727
848
|
e.style.height = "auto";
|
|
728
849
|
return;
|
|
729
850
|
}
|
|
730
|
-
const
|
|
851
|
+
const r = () => {
|
|
731
852
|
e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
|
|
732
853
|
};
|
|
733
|
-
return
|
|
734
|
-
e.removeEventListener("input",
|
|
854
|
+
return r(), e.addEventListener("input", r), e.addEventListener("resize", r), window.addEventListener("resize", r), () => {
|
|
855
|
+
e.removeEventListener("input", r), e.removeEventListener("resize", r), window.removeEventListener("resize", r);
|
|
735
856
|
};
|
|
736
|
-
}, [
|
|
857
|
+
}, [n, t]);
|
|
737
858
|
}
|
|
738
|
-
const
|
|
859
|
+
const pe = {
|
|
739
860
|
base: "",
|
|
740
|
-
"left-line": "border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-
|
|
741
|
-
outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-
|
|
742
|
-
},
|
|
861
|
+
"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",
|
|
862
|
+
outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
|
|
863
|
+
}, ge = {
|
|
743
864
|
none: "rounded-none",
|
|
744
865
|
sm: "rounded-sm",
|
|
745
866
|
md: "rounded-md",
|
|
746
867
|
lg: "rounded-lg",
|
|
747
868
|
full: "px-3 rounded-full"
|
|
748
|
-
},
|
|
869
|
+
}, R = {
|
|
749
870
|
variant: "outline",
|
|
750
871
|
rounded: "none"
|
|
751
872
|
};
|
|
752
|
-
function
|
|
753
|
-
variant:
|
|
754
|
-
rounded:
|
|
873
|
+
function je({
|
|
874
|
+
variant: n = R.variant,
|
|
875
|
+
rounded: t,
|
|
755
876
|
displayOnlyMode: e = !1,
|
|
756
|
-
errorMessage:
|
|
877
|
+
errorMessage: r,
|
|
757
878
|
successMessage: a,
|
|
758
|
-
hideResizeHandle:
|
|
879
|
+
hideResizeHandle: o = !1,
|
|
759
880
|
autoExpand: s = !1,
|
|
760
|
-
characterLimit:
|
|
881
|
+
characterLimit: l = 0,
|
|
761
882
|
className: u,
|
|
762
|
-
...
|
|
883
|
+
...b
|
|
763
884
|
}) {
|
|
764
|
-
const p =
|
|
765
|
-
|
|
766
|
-
let
|
|
767
|
-
|
|
768
|
-
let
|
|
769
|
-
(e ||
|
|
770
|
-
const c =
|
|
885
|
+
const p = A();
|
|
886
|
+
ve(p, s || e);
|
|
887
|
+
let i = t;
|
|
888
|
+
n === "outline" && !t && (i = "md"), i = i || R.rounded;
|
|
889
|
+
let x = o;
|
|
890
|
+
(e || n === "left-line" && !o) && (x = !0);
|
|
891
|
+
const c = g(
|
|
771
892
|
"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
|
|
772
|
-
!e &&
|
|
773
|
-
!e &&
|
|
893
|
+
!e && pe[n],
|
|
894
|
+
!e && ge[i],
|
|
774
895
|
!e && "px-2 py-1",
|
|
775
896
|
e && "pointer-events-none",
|
|
776
|
-
|
|
897
|
+
x && "no-resize-handle",
|
|
777
898
|
u
|
|
778
899
|
);
|
|
779
|
-
return /* @__PURE__ */ w("div", { className:
|
|
780
|
-
/* @__PURE__ */
|
|
900
|
+
return /* @__PURE__ */ w("div", { className: g("-space-y-1.5", e && "cursor-text"), children: [
|
|
901
|
+
/* @__PURE__ */ d(
|
|
781
902
|
"textarea",
|
|
782
903
|
{
|
|
783
|
-
...
|
|
904
|
+
...b,
|
|
784
905
|
id: p,
|
|
785
|
-
"aria-disabled":
|
|
906
|
+
"aria-disabled": b.disabled,
|
|
786
907
|
readOnly: e,
|
|
787
|
-
"aria-readonly": e ||
|
|
908
|
+
"aria-readonly": e || b["aria-readonly"],
|
|
788
909
|
style: {
|
|
789
910
|
resize: s ? "none" : void 0
|
|
790
911
|
},
|
|
791
912
|
className: c
|
|
792
913
|
}
|
|
793
914
|
),
|
|
794
|
-
|
|
795
|
-
!e && /* @__PURE__ */
|
|
796
|
-
!e && /* @__PURE__ */
|
|
915
|
+
l > 0 && /* @__PURE__ */ d(be, { elementId: p, maxLength: l }),
|
|
916
|
+
!e && /* @__PURE__ */ d(D, { elementId: p, type: "error", message: r }),
|
|
917
|
+
!e && /* @__PURE__ */ d(D, { elementId: p, type: "success", message: a })
|
|
797
918
|
] });
|
|
798
919
|
}
|
|
799
920
|
export {
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
921
|
+
Ce as Accordion,
|
|
922
|
+
L as AccordionItem,
|
|
923
|
+
oe as Button,
|
|
924
|
+
te as ButtonLoadingDots,
|
|
925
|
+
Ee as Checkbox,
|
|
926
|
+
Ae as Clickable,
|
|
927
|
+
$e as Input,
|
|
928
|
+
Ie as Label,
|
|
929
|
+
De as Modal,
|
|
930
|
+
Le as RadioGroup,
|
|
931
|
+
S as RadioGroupItem,
|
|
932
|
+
fe as RadioInput,
|
|
933
|
+
ke as Slot,
|
|
934
|
+
je as Textarea
|
|
813
935
|
};
|
|
814
936
|
//# sourceMappingURL=components.esm.js.map
|