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