@moondreamsdev/dreamer-ui 1.7.4-test.1 → 1.7.4-test.2
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 +472 -351
- 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 +0 -1
- package/dist/src/components/modal/index.d.ts +1 -1
- package/dist/src/components/radiogroup/RadioGroupItem.d.ts +0 -1
- package/dist/symbols.cjs.js +1 -1
- package/dist/symbols.cjs.js.map +1 -1
- package/dist/symbols.esm.js +8 -20
- package/dist/symbols.esm.js.map +1 -1
- 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
|
-
|
|
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 p } 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,
|
|
7
8
|
title: r,
|
|
8
9
|
content: e,
|
|
9
10
|
children: t,
|
|
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
|
|
18
|
-
!
|
|
19
|
-
},
|
|
18
|
+
const v = A(), i = n || `accordion-item-${v}`, 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: p("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: p(
|
|
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: r }),
|
|
41
|
+
/* @__PURE__ */ d(
|
|
41
42
|
"span",
|
|
42
43
|
{
|
|
43
|
-
className:
|
|
44
|
+
className: p(
|
|
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: p(
|
|
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
66
|
children: s && (t || e)
|
|
66
67
|
}
|
|
67
68
|
)
|
|
68
69
|
] });
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
name:
|
|
71
|
+
function Ce({
|
|
72
|
+
name: n,
|
|
72
73
|
items: r = [],
|
|
73
74
|
children: e,
|
|
74
75
|
className: t = "",
|
|
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(), v = n || `accordion-group-${b}`, [i, x] = C(new Set(s)), m = (f) => {
|
|
83
|
+
x((h) => {
|
|
84
|
+
const g = new Set(h);
|
|
85
|
+
return g.has(f) ? g.delete(f) : (o || g.clear(), g.add(f)), g;
|
|
85
86
|
});
|
|
86
|
-
}, c = (f) => `${
|
|
87
|
-
return /* @__PURE__ */ w("div", { id:
|
|
88
|
-
r.length > 0 && r.map((f,
|
|
89
|
-
const
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
|
|
87
|
+
}, c = (f) => `${b}-item-${f}`, y = (f) => i.has(f);
|
|
88
|
+
return /* @__PURE__ */ w("div", { id: v, className: t, children: [
|
|
89
|
+
r.length > 0 && r.map((f, h) => {
|
|
90
|
+
const g = f.id || c(h);
|
|
91
|
+
return /* @__PURE__ */ d(
|
|
92
|
+
L,
|
|
92
93
|
{
|
|
93
|
-
id:
|
|
94
|
+
id: g,
|
|
94
95
|
title: f.title,
|
|
95
96
|
content: f.content,
|
|
96
97
|
disabled: f.disabled,
|
|
97
|
-
isOpen:
|
|
98
|
-
onToggle: () =>
|
|
98
|
+
isOpen: y(g),
|
|
99
|
+
onToggle: () => m(g),
|
|
99
100
|
className: a,
|
|
100
|
-
triggerClassName:
|
|
101
|
+
triggerClassName: l,
|
|
101
102
|
bodyClassName: u
|
|
102
103
|
},
|
|
103
|
-
|
|
104
|
+
g
|
|
104
105
|
);
|
|
105
106
|
}),
|
|
106
|
-
r.length === 0 && e && I.Children.map(e, (f,
|
|
107
|
-
if (I.isValidElement(f) && f.type ===
|
|
108
|
-
const
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
|
|
107
|
+
r.length === 0 && e && I.Children.map(e, (f, h) => {
|
|
108
|
+
if (I.isValidElement(f) && f.type === L) {
|
|
109
|
+
const g = 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: g,
|
|
115
|
+
id: g,
|
|
116
|
+
className: p(a, f.props.className),
|
|
117
|
+
isOpen: y(g),
|
|
118
|
+
onToggle: () => m(g),
|
|
119
|
+
triggerClassName: p(l, f.props.triggerClassName),
|
|
120
|
+
bodyClassName: p(u, f.props.bodyClassName)
|
|
120
121
|
}
|
|
121
122
|
);
|
|
122
123
|
}
|
|
@@ -124,25 +125,25 @@ function le({
|
|
|
124
125
|
})
|
|
125
126
|
] });
|
|
126
127
|
}
|
|
127
|
-
function
|
|
128
|
-
const [
|
|
129
|
-
return
|
|
128
|
+
function re() {
|
|
129
|
+
const [n, r] = C(0);
|
|
130
|
+
return E(() => {
|
|
130
131
|
const e = setInterval(() => {
|
|
131
132
|
r((t) => (t + 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: p(
|
|
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 te = {
|
|
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",
|
|
@@ -150,7 +151,7 @@ const J = {
|
|
|
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
|
danger: "bg-danger text-danger-foreground hover:bg-danger/85 disabled:bg-muted disabled:text-muted-foreground"
|
|
153
|
-
},
|
|
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:
|
|
173
|
+
function oe({
|
|
174
|
+
variant: n = j.variant,
|
|
174
175
|
size: r,
|
|
175
|
-
rounded: e =
|
|
176
|
+
rounded: e = j.rounded,
|
|
176
177
|
loading: t,
|
|
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" && !r ? b = "fitted" : b = r || j.size;
|
|
186
|
+
const i = p(
|
|
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
|
-
|
|
188
|
+
te[n],
|
|
189
|
+
ne[b],
|
|
190
|
+
ae[e],
|
|
190
191
|
t && "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"] || (
|
|
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"]),
|
|
201
202
|
"aria-disabled": u.disabled || t,
|
|
202
203
|
"aria-busy": t,
|
|
203
204
|
type: s,
|
|
204
|
-
className:
|
|
205
|
+
className: i,
|
|
205
206
|
children: [
|
|
206
|
-
t && /* @__PURE__ */
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
a && !u.disabled && /* @__PURE__ */
|
|
207
|
+
t && /* @__PURE__ */ d(re, {}),
|
|
208
|
+
/* @__PURE__ */ d("span", { className: p(t && "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,108 +221,108 @@ function ue({
|
|
|
220
221
|
}
|
|
221
222
|
);
|
|
222
223
|
}
|
|
223
|
-
function
|
|
224
|
-
const [r, e] =
|
|
225
|
-
let
|
|
226
|
-
for (;
|
|
227
|
-
const
|
|
228
|
-
|
|
224
|
+
function se(n) {
|
|
225
|
+
const [r, e] = C(""), t = $((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 = t(a.parentElement);
|
|
237
|
+
e(o);
|
|
237
238
|
}
|
|
238
|
-
}, [
|
|
239
|
+
}, [n, t]), r;
|
|
239
240
|
}
|
|
240
|
-
function
|
|
241
|
-
ref:
|
|
241
|
+
function Ee({
|
|
242
|
+
ref: n,
|
|
242
243
|
id: r,
|
|
243
244
|
size: e = 20,
|
|
244
245
|
color: t,
|
|
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
|
-
...
|
|
251
|
+
className: b = "",
|
|
252
|
+
...v
|
|
252
253
|
}) {
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
const i = A(), x = F(() => r || `checkbox-${i}`, [r, 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
|
+
}, g = p(
|
|
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
284
|
color: t,
|
|
284
285
|
backgroundColor: c && a ? "currentcolor" : "transparent"
|
|
285
286
|
},
|
|
286
|
-
className:
|
|
287
|
-
...
|
|
288
|
-
children: c && /* @__PURE__ */
|
|
287
|
+
className: g,
|
|
288
|
+
...v,
|
|
289
|
+
children: c && /* @__PURE__ */ d(_, { size: e, color: a ? m : void 0 })
|
|
289
290
|
}
|
|
290
291
|
);
|
|
291
292
|
}
|
|
292
|
-
function
|
|
293
|
-
children:
|
|
293
|
+
function Ae({
|
|
294
|
+
children: n,
|
|
294
295
|
className: r,
|
|
295
296
|
linkTo: e,
|
|
296
297
|
linkProps: t,
|
|
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: p("relative w-fit", r), ...s, children: [
|
|
303
|
+
n,
|
|
304
|
+
e && /* @__PURE__ */ d(
|
|
304
305
|
"a",
|
|
305
306
|
{
|
|
306
307
|
...t,
|
|
307
308
|
href: e,
|
|
308
|
-
className:
|
|
309
|
+
className: p("absolute inset-0", t == null ? void 0 : t.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: p("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 t = document.getElementById(
|
|
323
|
+
function D({ elementId: n, type: r, message: e }) {
|
|
324
|
+
return E(() => {
|
|
325
|
+
const t = document.getElementById(n);
|
|
325
326
|
if (t) {
|
|
326
327
|
if (!e && r === "error") {
|
|
327
328
|
t.removeAttribute("data-error");
|
|
@@ -331,159 +332,278 @@ function D({ elementId: o, type: r, message: e }) {
|
|
|
331
332
|
t.removeAttribute("data-success");
|
|
332
333
|
return;
|
|
333
334
|
}
|
|
334
|
-
return t.setAttribute("aria-describedby", `${
|
|
335
|
+
return t.setAttribute("aria-describedby", `${n}-${r}-message`), t.setAttribute("aria-invalid", r === "error" ? "true" : "false"), r === "error" && t.setAttribute("data-error", "true"), r === "success" && t.setAttribute("data-success", "true"), () => {
|
|
335
336
|
t.removeAttribute("aria-describedby"), t.removeAttribute("aria-invalid"), t.removeAttribute("data-error"), t.removeAttribute("data-success");
|
|
336
337
|
};
|
|
337
338
|
}
|
|
338
|
-
}, [
|
|
339
|
+
}, [n, r, e]), e ? /* @__PURE__ */ w(
|
|
339
340
|
"small",
|
|
340
341
|
{
|
|
341
|
-
className:
|
|
342
|
+
className: p(
|
|
342
343
|
"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",
|
|
343
344
|
r === "error" && "text-danger",
|
|
344
345
|
r === "success" && "text-success"
|
|
345
346
|
),
|
|
346
347
|
role: "status",
|
|
347
348
|
children: [
|
|
348
|
-
r === "error" ? /* @__PURE__ */
|
|
349
|
-
/* @__PURE__ */
|
|
349
|
+
r === "error" ? /* @__PURE__ */ d(J, {}) : /* @__PURE__ */ d(Y, {}),
|
|
350
|
+
/* @__PURE__ */ d("span", { id: `${n}-${r}-message`, children: e })
|
|
350
351
|
]
|
|
351
352
|
}
|
|
352
353
|
) : null;
|
|
353
354
|
}
|
|
354
|
-
const
|
|
355
|
+
const ie = {
|
|
355
356
|
base: "",
|
|
356
357
|
default: "ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-danger not-disabled:data-success:ring-success",
|
|
357
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",
|
|
358
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"
|
|
359
|
-
},
|
|
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:
|
|
370
|
+
function $e({
|
|
371
|
+
variant: n = B.variant,
|
|
371
372
|
rounded: r,
|
|
372
373
|
displayOnlyMode: e = !1,
|
|
373
374
|
errorMessage: t,
|
|
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, v] = C(!1);
|
|
381
|
+
let i = r;
|
|
382
|
+
n === "outline" && !r && (i = "md"), i = i || B.rounded;
|
|
383
|
+
const c = p(
|
|
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: p(e && "cursor-text"), style: { height: l.height, width: l.width }, children: [
|
|
394
|
+
/* @__PURE__ */ w("div", { className: p(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
|
+
"aria-readonly": e || l["aria-readonly"],
|
|
403
404
|
"data-error": t ? !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: () =>
|
|
412
|
+
onClick: () => v(!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: t }),
|
|
421
|
+
!e && /* @__PURE__ */ d(D, { elementId: u, type: "success", message: a })
|
|
421
422
|
] });
|
|
422
423
|
}
|
|
423
|
-
function
|
|
424
|
-
display:
|
|
424
|
+
function Ie({
|
|
425
|
+
display: n = "inline",
|
|
425
426
|
width: r = "fit-content",
|
|
426
427
|
className: e = "",
|
|
427
428
|
required: t,
|
|
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:
|
|
436
|
-
/* @__PURE__ */ w("label", { className:
|
|
437
|
-
|
|
438
|
-
t && /* @__PURE__ */
|
|
435
|
+
const b = A(), v = p("font-medium", n, e), i = a ? `${s ?? b}-help` : void 0;
|
|
436
|
+
return /* @__PURE__ */ w("div", { style: { display: n === "inline" ? "inline-flex" : "flex", width: r }, className: "relative", children: [
|
|
437
|
+
/* @__PURE__ */ w("label", { className: v, htmlFor: s, ...u, children: [
|
|
438
|
+
l,
|
|
439
|
+
t && /* @__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
|
-
|
|
455
|
+
function z(...n) {
|
|
456
|
+
return n.filter((r) => typeof r == "string" && r).join(" ").trim() || void 0;
|
|
457
|
+
}
|
|
458
|
+
function le({ isOpen: n }) {
|
|
459
|
+
const [r, e] = C(!1), [t, a] = C(!1);
|
|
460
|
+
return E(() => {
|
|
461
|
+
n ? (a(!0), setTimeout(() => e(!0), 10)) : (e(!1), setTimeout(() => a(!1), 150));
|
|
462
|
+
}, [n]), { show: r, shouldRender: t };
|
|
463
|
+
}
|
|
464
|
+
function ue({ isOpen: n, onClose: r }) {
|
|
465
|
+
E(() => {
|
|
466
|
+
const e = (t) => {
|
|
467
|
+
t.key === "Escape" && n && r();
|
|
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, r]);
|
|
473
|
+
}
|
|
474
|
+
function ce({ modalId: n, isOpen: r }) {
|
|
475
|
+
const e = Q(null), t = $(() => {
|
|
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(() => (r && (e.current = document.activeElement, t()), () => {
|
|
498
|
+
document.body.style.overflow = "auto", e.current instanceof HTMLElement && e.current.focus();
|
|
499
|
+
}), [r, t]);
|
|
500
|
+
}
|
|
501
|
+
function De({
|
|
502
|
+
id: n,
|
|
503
|
+
isOpen: r,
|
|
504
|
+
onClose: e,
|
|
505
|
+
title: t,
|
|
506
|
+
children: a,
|
|
507
|
+
contentOnly: o = !1,
|
|
508
|
+
className: s,
|
|
509
|
+
overlayClassName: l,
|
|
510
|
+
hideCloseButton: u = !1,
|
|
511
|
+
actions: b = [],
|
|
512
|
+
disableCloseOnOverlayClick: v = !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({ isOpen: r });
|
|
517
|
+
if (ce({ modalId: c, isOpen: h }), ue({ isOpen: h, onClose: e }), !h) return null;
|
|
518
|
+
const g = () => t ? I.isValidElement(t) ? /* @__PURE__ */ d("div", { className: "mb-4", children: t }) : /* @__PURE__ */ d("h2", { className: "mb-4 text-xl font-semibold", id: y, children: t }) : 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 ?? t ? 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
|
+
v || 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
|
+
onClick: e,
|
|
557
|
+
"data-modal-close-button": "true",
|
|
558
|
+
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",
|
|
559
|
+
children: /* @__PURE__ */ d(P, { size: 18 })
|
|
560
|
+
}
|
|
561
|
+
),
|
|
562
|
+
g(),
|
|
563
|
+
a,
|
|
564
|
+
N()
|
|
565
|
+
]
|
|
566
|
+
}
|
|
567
|
+
)
|
|
568
|
+
] })
|
|
569
|
+
}
|
|
570
|
+
),
|
|
571
|
+
document.body
|
|
572
|
+
) });
|
|
573
|
+
}
|
|
574
|
+
function ke({ children: n, ref: r, ...e }) {
|
|
575
|
+
if (U(n)) {
|
|
456
576
|
let t = { ...e };
|
|
457
|
-
return
|
|
577
|
+
return n.props && (t = { ...t, ...n.props }), W(n, {
|
|
458
578
|
...t,
|
|
459
579
|
ref: (a) => {
|
|
460
580
|
typeof r == "function" ? r(a) : r && (r.current = a);
|
|
461
581
|
}
|
|
462
582
|
});
|
|
463
583
|
}
|
|
464
|
-
return
|
|
584
|
+
return V("div", { ...e, ref: r }, n);
|
|
465
585
|
}
|
|
466
|
-
function
|
|
467
|
-
const s = "relative inline-flex items-center justify-center rounded-full",
|
|
586
|
+
function fe({ itemId: n, checked: r, onChange: e, name: t, disabled: a = !1, className: o = "" }) {
|
|
587
|
+
const s = "relative inline-flex items-center justify-center rounded-full", l = () => {
|
|
468
588
|
a || e();
|
|
469
|
-
}, u =
|
|
589
|
+
}, u = p(
|
|
470
590
|
s,
|
|
471
591
|
!r && "hover:border-current/60",
|
|
472
592
|
!a && "border-current cursor-pointer",
|
|
473
593
|
a && "border-muted/60 cursor-not-allowed",
|
|
474
|
-
|
|
594
|
+
o
|
|
475
595
|
);
|
|
476
|
-
return /* @__PURE__ */
|
|
596
|
+
return /* @__PURE__ */ d(
|
|
477
597
|
"div",
|
|
478
598
|
{
|
|
479
|
-
id:
|
|
599
|
+
id: n,
|
|
480
600
|
role: "radio",
|
|
481
601
|
tabIndex: -1,
|
|
482
602
|
"aria-checked": r,
|
|
483
603
|
"aria-disabled": a,
|
|
484
604
|
"aria-description": `Radio button for ${t}`,
|
|
485
|
-
"aria-labelledby": `${
|
|
486
|
-
onClick:
|
|
605
|
+
"aria-labelledby": `${n}-label`,
|
|
606
|
+
onClick: l,
|
|
487
607
|
className: u,
|
|
488
608
|
style: {
|
|
489
609
|
width: "1em",
|
|
@@ -491,75 +611,75 @@ function P({ itemId: o, checked: r, onChange: e, name: t, disabled: a = !1, clas
|
|
|
491
611
|
padding: "0.1em",
|
|
492
612
|
borderWidth: "0.06em"
|
|
493
613
|
},
|
|
494
|
-
children: r && /* @__PURE__ */
|
|
614
|
+
children: r && /* @__PURE__ */ d(
|
|
495
615
|
"div",
|
|
496
616
|
{
|
|
497
|
-
className:
|
|
617
|
+
className: p("size-full aspect-square rounded-full", a && "bg-muted/60", !a && "bg-current")
|
|
498
618
|
}
|
|
499
619
|
)
|
|
500
620
|
}
|
|
501
621
|
);
|
|
502
622
|
}
|
|
503
|
-
function
|
|
504
|
-
value:
|
|
623
|
+
function S({
|
|
624
|
+
value: n,
|
|
505
625
|
children: r,
|
|
506
626
|
className: e = "",
|
|
507
627
|
isSelected: t = !1,
|
|
508
628
|
onChange: a,
|
|
509
|
-
disabled:
|
|
629
|
+
disabled: o = !1,
|
|
510
630
|
hideInput: s = !1,
|
|
511
|
-
description:
|
|
631
|
+
description: l,
|
|
512
632
|
name: u
|
|
513
633
|
}) {
|
|
514
|
-
const
|
|
515
|
-
|
|
634
|
+
const v = `radio-${A()}-${n}`, i = () => {
|
|
635
|
+
o || a == null || a(n);
|
|
516
636
|
};
|
|
517
637
|
return /* @__PURE__ */ w(
|
|
518
638
|
"div",
|
|
519
639
|
{
|
|
520
|
-
title:
|
|
521
|
-
className:
|
|
640
|
+
title: l,
|
|
641
|
+
className: p(
|
|
522
642
|
"relative flex items-center",
|
|
523
643
|
e,
|
|
524
644
|
// Uses text color for borders
|
|
525
|
-
s && `p-2 border-2 focus-within:border-dashed focus-within:${
|
|
526
|
-
s && !t && `border-transparent ${
|
|
645
|
+
s && `p-2 border-2 focus-within:border-dashed focus-within:${o ? "border-current/50" : "border-current/80"}`,
|
|
646
|
+
s && !t && `border-transparent ${o ? "" : "not-focus-within:hover:border-border/60"}`,
|
|
527
647
|
s && t && "border-border",
|
|
528
|
-
|
|
648
|
+
o && "opacity-60 cursor-not-allowed"
|
|
529
649
|
),
|
|
530
650
|
style: {
|
|
531
651
|
gap: "0.5em"
|
|
532
652
|
},
|
|
533
653
|
children: [
|
|
534
|
-
!s && /* @__PURE__ */
|
|
535
|
-
|
|
654
|
+
!s && /* @__PURE__ */ d(
|
|
655
|
+
fe,
|
|
536
656
|
{
|
|
537
|
-
itemId:
|
|
657
|
+
itemId: v,
|
|
538
658
|
name: u || "",
|
|
539
659
|
checked: t,
|
|
540
|
-
onChange:
|
|
541
|
-
disabled:
|
|
542
|
-
className:
|
|
660
|
+
onChange: i,
|
|
661
|
+
disabled: o,
|
|
662
|
+
className: p(s && "")
|
|
543
663
|
}
|
|
544
664
|
),
|
|
545
|
-
/* @__PURE__ */
|
|
665
|
+
/* @__PURE__ */ d(
|
|
546
666
|
"div",
|
|
547
667
|
{
|
|
548
|
-
id: s ?
|
|
668
|
+
id: s ? v : void 0,
|
|
549
669
|
tabIndex: s ? -1 : void 0,
|
|
550
670
|
role: s ? "radio" : void 0,
|
|
551
|
-
onClick: s ?
|
|
671
|
+
onClick: s ? i : void 0,
|
|
552
672
|
"aria-checked": s ? t ? "true" : "false" : void 0,
|
|
553
|
-
"aria-disabled": s ?
|
|
554
|
-
"aria-description": s ?
|
|
555
|
-
"aria-labelledby": s ? `${
|
|
556
|
-
className:
|
|
557
|
-
children: /* @__PURE__ */
|
|
673
|
+
"aria-disabled": s ? o : void 0,
|
|
674
|
+
"aria-description": s ? l || `Radio button for ${u}` : void 0,
|
|
675
|
+
"aria-labelledby": s ? `${v}-label` : void 0,
|
|
676
|
+
className: p(s && "size-full", typeof r == "object" && "grow focus:outline-none"),
|
|
677
|
+
children: /* @__PURE__ */ d(
|
|
558
678
|
"label",
|
|
559
679
|
{
|
|
560
|
-
id: `${
|
|
561
|
-
onClick: s ? void 0 :
|
|
562
|
-
className:
|
|
680
|
+
id: `${v}-label`,
|
|
681
|
+
onClick: s ? void 0 : i,
|
|
682
|
+
className: p(o && "cursor-not-allowed", !o && "cursor-pointer"),
|
|
563
683
|
children: r
|
|
564
684
|
}
|
|
565
685
|
)
|
|
@@ -569,147 +689,147 @@ function z({
|
|
|
569
689
|
}
|
|
570
690
|
);
|
|
571
691
|
}
|
|
572
|
-
function
|
|
573
|
-
const [e, t] =
|
|
574
|
-
var
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
}, []),
|
|
578
|
-
(
|
|
692
|
+
function me(n, r) {
|
|
693
|
+
const [e, t] = C(r), [a, o] = C(-1), [s, l] = C(!1), u = $((m, c) => {
|
|
694
|
+
var h;
|
|
695
|
+
const y = m[c];
|
|
696
|
+
y.hasAttribute("disabled") || y.getAttribute("aria-disabled") === "true" || ((h = m[c]) == null || h.click(), o(c));
|
|
697
|
+
}, []), b = $(
|
|
698
|
+
(m, c) => {
|
|
579
699
|
var f;
|
|
580
|
-
if (
|
|
581
|
-
const
|
|
582
|
-
(f = c[
|
|
700
|
+
if (m.preventDefault(), s || !c.length) return;
|
|
701
|
+
const y = r !== -1 ? r : 0;
|
|
702
|
+
(f = c[y]) == null || f.focus(), t(y), r !== -1 && u(c, y);
|
|
583
703
|
},
|
|
584
704
|
[r, s, u]
|
|
585
|
-
),
|
|
586
|
-
(
|
|
587
|
-
var
|
|
588
|
-
if (!
|
|
705
|
+
), v = $(
|
|
706
|
+
(m) => {
|
|
707
|
+
var h;
|
|
708
|
+
if (!m.shiftKey)
|
|
589
709
|
return;
|
|
590
|
-
|
|
710
|
+
m.preventDefault();
|
|
591
711
|
const c = Array.from(
|
|
592
712
|
document.querySelectorAll(
|
|
593
713
|
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
594
714
|
)
|
|
595
|
-
).filter((
|
|
596
|
-
(
|
|
715
|
+
).filter((g) => !g.hasAttribute("disabled") && g.tabIndex >= 0), y = c.findIndex((g) => g.id === n), f = y > 0 ? y - 1 : c.length - 1;
|
|
716
|
+
(h = c[f]) == null || h.focus();
|
|
597
717
|
},
|
|
598
|
-
[
|
|
599
|
-
),
|
|
600
|
-
(
|
|
601
|
-
var
|
|
718
|
+
[n]
|
|
719
|
+
), i = $(
|
|
720
|
+
(m, c) => {
|
|
721
|
+
var N;
|
|
602
722
|
if (!c.length) return;
|
|
603
|
-
const
|
|
604
|
-
if (!c.some((
|
|
605
|
-
const
|
|
606
|
-
let
|
|
607
|
-
switch (
|
|
723
|
+
const y = m.target;
|
|
724
|
+
if (!c.some((k) => k.id === y.id)) return;
|
|
725
|
+
const h = e !== -1 ? e : 0;
|
|
726
|
+
let g = h;
|
|
727
|
+
switch (m.key) {
|
|
608
728
|
case "ArrowUp":
|
|
609
729
|
case "ArrowLeft":
|
|
610
|
-
|
|
730
|
+
m.preventDefault(), g = h > 0 ? h - 1 : c.length - 1;
|
|
611
731
|
break;
|
|
612
732
|
case "ArrowDown":
|
|
613
733
|
case "ArrowRight":
|
|
614
|
-
|
|
734
|
+
m.preventDefault(), g = (h + 1) % c.length;
|
|
615
735
|
break;
|
|
616
736
|
// Select the option when the space key is pressed
|
|
617
737
|
case " ":
|
|
618
|
-
|
|
738
|
+
m.preventDefault(), u(c, h);
|
|
619
739
|
return;
|
|
620
740
|
case "Tab":
|
|
621
|
-
|
|
741
|
+
v(m);
|
|
622
742
|
return;
|
|
623
743
|
default:
|
|
624
744
|
return;
|
|
625
745
|
}
|
|
626
|
-
(
|
|
746
|
+
(N = c[g]) == null || N.focus(), t(g), a !== -1 && u(c, g);
|
|
627
747
|
},
|
|
628
|
-
[e, a,
|
|
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),
|
|
748
|
+
[e, a, v, u]
|
|
749
|
+
), x = $(() => {
|
|
750
|
+
const m = document.querySelector(`[id="${n}"][role="radiogroup"]`);
|
|
751
|
+
return m ? Array.from(m.querySelectorAll('[role="radio"]')) : [];
|
|
752
|
+
}, [n]);
|
|
753
|
+
E(() => {
|
|
754
|
+
const m = document.querySelector(`[id="${n}"][role="radiogroup"]`);
|
|
755
|
+
if (!m) return;
|
|
756
|
+
const c = x(), y = (N) => b(N, c), f = (N) => i(N, c), h = () => l(!0), g = () => l(!1);
|
|
757
|
+
return document.addEventListener("keydown", f), m.addEventListener("focus", y), m.addEventListener("mousedown", h), document.addEventListener("mouseup", g), () => {
|
|
758
|
+
document.removeEventListener("keydown", f), m.removeEventListener("focus", y), m.removeEventListener("mousedown", h), document.removeEventListener("mouseup", g);
|
|
639
759
|
};
|
|
640
|
-
}, [
|
|
760
|
+
}, [n, x, b, i]);
|
|
641
761
|
}
|
|
642
|
-
function
|
|
643
|
-
options:
|
|
762
|
+
function Le({
|
|
763
|
+
options: n = [],
|
|
644
764
|
value: r,
|
|
645
765
|
onChange: e,
|
|
646
766
|
name: t,
|
|
647
767
|
children: a,
|
|
648
|
-
className:
|
|
768
|
+
className: o = "",
|
|
649
769
|
childrenClassName: s = "",
|
|
650
|
-
hideInputs:
|
|
770
|
+
hideInputs: l = !1
|
|
651
771
|
}) {
|
|
652
|
-
const u =
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
772
|
+
const u = A(), b = t || `radio-group-${u}`;
|
|
773
|
+
me(
|
|
774
|
+
b,
|
|
775
|
+
n.findIndex((i) => i === r)
|
|
656
776
|
);
|
|
657
|
-
const
|
|
658
|
-
return /* @__PURE__ */ w("div", { id:
|
|
659
|
-
|
|
660
|
-
|
|
777
|
+
const v = 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]);
|
|
778
|
+
return /* @__PURE__ */ w("div", { id: b, role: "radiogroup", tabIndex: 0, className: p(o, "focus:outline-none"), children: [
|
|
779
|
+
v.length > 0 && v.map((i, x) => /* @__PURE__ */ d(
|
|
780
|
+
S,
|
|
661
781
|
{
|
|
662
|
-
value:
|
|
663
|
-
isSelected: r ===
|
|
782
|
+
value: i.value,
|
|
783
|
+
isSelected: r === i.value,
|
|
664
784
|
onChange: e,
|
|
665
|
-
name:
|
|
666
|
-
disabled:
|
|
667
|
-
description:
|
|
668
|
-
hideInput:
|
|
785
|
+
name: b,
|
|
786
|
+
disabled: i.disabled,
|
|
787
|
+
description: i.description,
|
|
788
|
+
hideInput: l,
|
|
669
789
|
className: s,
|
|
670
|
-
children:
|
|
790
|
+
children: i.label
|
|
671
791
|
},
|
|
672
|
-
`${
|
|
792
|
+
`${i.value}-${x}`
|
|
673
793
|
)),
|
|
674
|
-
|
|
675
|
-
|
|
794
|
+
v.length === 0 && a && I.Children.map(a, (i) => I.isValidElement(i) && i.type === S ? /* @__PURE__ */ d(
|
|
795
|
+
S,
|
|
676
796
|
{
|
|
677
|
-
...
|
|
678
|
-
className:
|
|
679
|
-
hideInput:
|
|
680
|
-
isSelected: r ===
|
|
797
|
+
...i.props,
|
|
798
|
+
className: p(s, i.props.className),
|
|
799
|
+
hideInput: i.props.hideInput || l,
|
|
800
|
+
isSelected: r === i.props.value,
|
|
681
801
|
onChange: e,
|
|
682
|
-
name:
|
|
683
|
-
children:
|
|
802
|
+
name: b,
|
|
803
|
+
children: i.props.children
|
|
684
804
|
}
|
|
685
805
|
) : null)
|
|
686
806
|
] });
|
|
687
807
|
}
|
|
688
|
-
function
|
|
689
|
-
const [e, t] =
|
|
690
|
-
return
|
|
691
|
-
const a = document.getElementById(
|
|
808
|
+
function be({ elementId: n, maxLength: r }) {
|
|
809
|
+
const [e, t] = C(0);
|
|
810
|
+
return E(() => {
|
|
811
|
+
const a = document.getElementById(n);
|
|
692
812
|
if (!a)
|
|
693
813
|
return;
|
|
694
|
-
const
|
|
814
|
+
const o = () => {
|
|
695
815
|
const s = a.value.length;
|
|
696
816
|
t(s);
|
|
697
|
-
const
|
|
698
|
-
a.setAttribute("aria-describedby", `${
|
|
817
|
+
const l = s >= r;
|
|
818
|
+
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
819
|
};
|
|
700
|
-
return
|
|
701
|
-
a.removeEventListener("input",
|
|
820
|
+
return o(), a.addEventListener("input", o), a.setAttribute("maxlength", String(r)), () => {
|
|
821
|
+
a.removeEventListener("input", o), a.removeAttribute("maxlength"), a.removeAttribute("aria-describedby"), a.removeAttribute("aria-invalid"), a.removeAttribute("data-error");
|
|
702
822
|
};
|
|
703
|
-
}, [
|
|
823
|
+
}, [n, r]), /* @__PURE__ */ d(
|
|
704
824
|
"small",
|
|
705
825
|
{
|
|
706
|
-
className:
|
|
826
|
+
className: p(
|
|
707
827
|
"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",
|
|
708
828
|
e >= r && "text-danger",
|
|
709
829
|
e < r && "text-current"
|
|
710
830
|
),
|
|
711
831
|
role: "status",
|
|
712
|
-
children: /* @__PURE__ */ w("span", { id: `${
|
|
832
|
+
children: /* @__PURE__ */ w("span", { id: `${n}-character-count`, children: [
|
|
713
833
|
e,
|
|
714
834
|
" / ",
|
|
715
835
|
r,
|
|
@@ -718,9 +838,9 @@ function re({ elementId: o, maxLength: r }) {
|
|
|
718
838
|
}
|
|
719
839
|
);
|
|
720
840
|
}
|
|
721
|
-
function
|
|
722
|
-
|
|
723
|
-
const e = document.getElementById(
|
|
841
|
+
function ge(n, r) {
|
|
842
|
+
E(() => {
|
|
843
|
+
const e = document.getElementById(n);
|
|
724
844
|
if (!e)
|
|
725
845
|
return;
|
|
726
846
|
if (!r) {
|
|
@@ -733,82 +853,83 @@ function te(o, r) {
|
|
|
733
853
|
return t(), e.addEventListener("input", t), e.addEventListener("resize", t), window.addEventListener("resize", t), () => {
|
|
734
854
|
e.removeEventListener("input", t), e.removeEventListener("resize", t), window.removeEventListener("resize", t);
|
|
735
855
|
};
|
|
736
|
-
}, [
|
|
856
|
+
}, [n, r]);
|
|
737
857
|
}
|
|
738
|
-
const
|
|
858
|
+
const ve = {
|
|
739
859
|
base: "",
|
|
740
860
|
"left-line": "border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success",
|
|
741
861
|
outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-danger not-disabled:data-success:border-success"
|
|
742
|
-
},
|
|
862
|
+
}, pe = {
|
|
743
863
|
none: "rounded-none",
|
|
744
864
|
sm: "rounded-sm",
|
|
745
865
|
md: "rounded-md",
|
|
746
866
|
lg: "rounded-lg",
|
|
747
867
|
full: "px-3 rounded-full"
|
|
748
|
-
},
|
|
868
|
+
}, R = {
|
|
749
869
|
variant: "outline",
|
|
750
870
|
rounded: "none"
|
|
751
871
|
};
|
|
752
|
-
function
|
|
753
|
-
variant:
|
|
872
|
+
function je({
|
|
873
|
+
variant: n = R.variant,
|
|
754
874
|
rounded: r,
|
|
755
875
|
displayOnlyMode: e = !1,
|
|
756
876
|
errorMessage: t,
|
|
757
877
|
successMessage: a,
|
|
758
|
-
hideResizeHandle:
|
|
878
|
+
hideResizeHandle: o = !1,
|
|
759
879
|
autoExpand: s = !1,
|
|
760
|
-
characterLimit:
|
|
880
|
+
characterLimit: l = 0,
|
|
761
881
|
className: u,
|
|
762
|
-
...
|
|
882
|
+
...b
|
|
763
883
|
}) {
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
let
|
|
767
|
-
|
|
768
|
-
let
|
|
769
|
-
(e ||
|
|
770
|
-
const c =
|
|
884
|
+
const v = A();
|
|
885
|
+
ge(v, s || e);
|
|
886
|
+
let i = r;
|
|
887
|
+
n === "outline" && !r && (i = "md"), i = i || R.rounded;
|
|
888
|
+
let x = o;
|
|
889
|
+
(e || n === "left-line" && !o) && (x = !0);
|
|
890
|
+
const c = p(
|
|
771
891
|
"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 &&
|
|
892
|
+
!e && ve[n],
|
|
893
|
+
!e && pe[i],
|
|
774
894
|
!e && "px-2 py-1",
|
|
775
895
|
e && "pointer-events-none",
|
|
776
|
-
|
|
896
|
+
x && "no-resize-handle",
|
|
777
897
|
u
|
|
778
898
|
);
|
|
779
|
-
return /* @__PURE__ */ w("div", { className:
|
|
780
|
-
/* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ w("div", { className: p("-space-y-1.5", e && "cursor-text"), children: [
|
|
900
|
+
/* @__PURE__ */ d(
|
|
781
901
|
"textarea",
|
|
782
902
|
{
|
|
783
|
-
...
|
|
784
|
-
id:
|
|
785
|
-
"aria-disabled":
|
|
903
|
+
...b,
|
|
904
|
+
id: v,
|
|
905
|
+
"aria-disabled": b.disabled,
|
|
786
906
|
readOnly: e,
|
|
787
|
-
"aria-readonly": e ||
|
|
907
|
+
"aria-readonly": e || b["aria-readonly"],
|
|
788
908
|
style: {
|
|
789
909
|
resize: s ? "none" : void 0
|
|
790
910
|
},
|
|
791
911
|
className: c
|
|
792
912
|
}
|
|
793
913
|
),
|
|
794
|
-
|
|
795
|
-
!e && /* @__PURE__ */
|
|
796
|
-
!e && /* @__PURE__ */
|
|
914
|
+
l > 0 && /* @__PURE__ */ d(be, { elementId: v, maxLength: l }),
|
|
915
|
+
!e && /* @__PURE__ */ d(D, { elementId: v, type: "error", message: t }),
|
|
916
|
+
!e && /* @__PURE__ */ d(D, { elementId: v, type: "success", message: a })
|
|
797
917
|
] });
|
|
798
918
|
}
|
|
799
919
|
export {
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
920
|
+
Ce as Accordion,
|
|
921
|
+
L as AccordionItem,
|
|
922
|
+
oe as Button,
|
|
923
|
+
re as ButtonLoadingDots,
|
|
924
|
+
Ee as Checkbox,
|
|
925
|
+
Ae as Clickable,
|
|
926
|
+
$e as Input,
|
|
927
|
+
Ie as Label,
|
|
928
|
+
De as Modal,
|
|
929
|
+
Le as RadioGroup,
|
|
930
|
+
S as RadioGroupItem,
|
|
931
|
+
fe as RadioInput,
|
|
932
|
+
ke as Slot,
|
|
933
|
+
je as Textarea
|
|
813
934
|
};
|
|
814
935
|
//# sourceMappingURL=components.esm.js.map
|