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