@moondreamsdev/dreamer-ui 1.7.7-test.1 → 1.7.7-test.3
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-BVBF3skB.js +157 -0
- package/dist/QuestionMarkCircled-BVBF3skB.js.map +1 -0
- package/dist/QuestionMarkCircled-D5cHmQp1.cjs +2 -0
- package/dist/QuestionMarkCircled-D5cHmQp1.cjs.map +1 -0
- package/dist/Toast-SgqUNTIy.cjs +2 -0
- package/dist/Toast-SgqUNTIy.cjs.map +1 -0
- package/dist/{Toast-Bn0CCsLY.js → Toast-vensJgtx.js} +72 -61
- package/dist/Toast-vensJgtx.js.map +1 -0
- package/dist/X-CIoyLewf.js +111 -0
- package/dist/X-CIoyLewf.js.map +1 -0
- package/dist/X-CgjeP2OI.cjs +2 -0
- package/dist/X-CgjeP2OI.cjs.map +1 -0
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +608 -452
- package/dist/components.esm.js.map +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.cjs.js.map +1 -1
- package/dist/providers.esm.js +15 -15
- package/dist/providers.esm.js.map +1 -1
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/components/separator/Separator.d.ts +16 -0
- package/dist/src/components/separator/index.d.ts +2 -0
- package/dist/src/components/separator/variants.d.ts +14 -0
- package/dist/src/components/toggle/Toggle.d.ts +13 -0
- package/dist/src/components/toggle/index.d.ts +2 -0
- package/dist/src/components/toggle/variants.d.ts +29 -0
- package/dist/src/hooks/useToast.d.ts +1 -1
- package/dist/src/symbols/Check.d.ts +2 -4
- package/dist/src/symbols/CheckCircled.d.ts +2 -3
- package/dist/src/symbols/ChevronDown.d.ts +2 -4
- package/dist/src/symbols/CrossCircled.d.ts +2 -4
- package/dist/src/symbols/ExclamationTriangle.d.ts +2 -3
- package/dist/src/symbols/EyeClosed.d.ts +2 -3
- package/dist/src/symbols/EyeOpened.d.ts +2 -3
- package/dist/src/symbols/InfoCircled.d.ts +2 -4
- package/dist/src/symbols/QuestionMarkCircled.d.ts +2 -4
- package/dist/src/symbols/X.d.ts +2 -4
- package/dist/src/symbols/index.d.ts +4 -0
- package/dist/symbols.cjs.js +1 -1
- package/dist/symbols.esm.js +2 -2
- package/dist/theme.css +2 -0
- package/dist/useToast-CEKvEJVB.js.map +1 -1
- package/dist/useToast-CraVIawn.cjs.map +1 -1
- package/package.json +2 -2
- package/dist/QuestionMarkCircled-B6xdNcJl.js +0 -76
- package/dist/QuestionMarkCircled-B6xdNcJl.js.map +0 -1
- package/dist/QuestionMarkCircled-Dh6Bl18_.cjs +0 -2
- package/dist/QuestionMarkCircled-Dh6Bl18_.cjs.map +0 -1
- package/dist/Toast-Bn0CCsLY.js.map +0 -1
- package/dist/Toast-uzg_Sy4r.cjs +0 -2
- package/dist/Toast-uzg_Sy4r.cjs.map +0 -1
- package/dist/X-JuXyHwMp.cjs +0 -2
- package/dist/X-JuXyHwMp.cjs.map +0 -1
- package/dist/X-aXWqJhiz.js +0 -52
- package/dist/X-aXWqJhiz.js.map +0 -1
package/dist/components.esm.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as E, jsx as u, Fragment as J } from "react/jsx-runtime";
|
|
2
|
+
import z, { useId as I, useState as x, createElement as Y, useEffect as C, useCallback as A, useMemo as W, useRef as j, isValidElement as P, cloneElement as ee } from "react";
|
|
3
3
|
import { join as w } from "./utils.esm.js";
|
|
4
|
-
import { b as
|
|
5
|
-
import { n as
|
|
6
|
-
import { A as
|
|
7
|
-
import { E as
|
|
8
|
-
import { createPortal as
|
|
9
|
-
function
|
|
10
|
-
id:
|
|
4
|
+
import { b as te, C as re, a as ne, c as oe, E as ae, Q as se } from "./QuestionMarkCircled-BVBF3skB.js";
|
|
5
|
+
import { n as H } from "./Toast-vensJgtx.js";
|
|
6
|
+
import { A as tt, T as rt } from "./Toast-vensJgtx.js";
|
|
7
|
+
import { E as ie, X as le } from "./X-CIoyLewf.js";
|
|
8
|
+
import { createPortal as M } from "react-dom";
|
|
9
|
+
function q({
|
|
10
|
+
id: o,
|
|
11
11
|
title: a,
|
|
12
12
|
content: e,
|
|
13
|
-
children:
|
|
13
|
+
children: n,
|
|
14
14
|
className: t = "",
|
|
15
15
|
disabled: r = !1,
|
|
16
16
|
isOpen: s = !1,
|
|
17
|
-
onToggle:
|
|
18
|
-
triggerClassName:
|
|
19
|
-
bodyClassName:
|
|
17
|
+
onToggle: d,
|
|
18
|
+
triggerClassName: c = "",
|
|
19
|
+
bodyClassName: l = ""
|
|
20
20
|
}) {
|
|
21
|
-
const
|
|
22
|
-
!r &&
|
|
23
|
-
},
|
|
21
|
+
const b = I(), i = o || `accordion-item-${b}`, v = `${i}-header`, f = `${i}-panel`, m = () => {
|
|
22
|
+
!r && d && d();
|
|
23
|
+
}, g = (h) => {
|
|
24
24
|
(h.key === "Enter" || h.key === " ") && (h.preventDefault(), m());
|
|
25
25
|
};
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ E("div", { className: w("border-b border-gray-200", r && "opacity-60 cursor-not-allowed", t), children: [
|
|
27
|
+
/* @__PURE__ */ E(
|
|
28
28
|
"button",
|
|
29
29
|
{
|
|
30
|
-
id:
|
|
30
|
+
id: v,
|
|
31
31
|
type: "button",
|
|
32
32
|
className: w(
|
|
33
33
|
"w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",
|
|
34
34
|
r ? "cursor-not-allowed" : "hover:bg-gray-50/10 cursor-pointer",
|
|
35
|
-
|
|
35
|
+
c
|
|
36
36
|
),
|
|
37
37
|
"aria-expanded": s,
|
|
38
|
-
"aria-controls":
|
|
38
|
+
"aria-controls": f,
|
|
39
39
|
disabled: r,
|
|
40
40
|
onClick: m,
|
|
41
|
-
onKeyDown:
|
|
41
|
+
onKeyDown: g,
|
|
42
42
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ u("span", { children: a }),
|
|
44
|
+
/* @__PURE__ */ u(
|
|
45
45
|
"span",
|
|
46
46
|
{
|
|
47
47
|
className: w(
|
|
@@ -49,78 +49,78 @@ function V({
|
|
|
49
49
|
s ? "rotate-180" : "rotate-0"
|
|
50
50
|
),
|
|
51
51
|
"aria-hidden": "true",
|
|
52
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ u(te, { size: 18 })
|
|
53
53
|
}
|
|
54
54
|
)
|
|
55
55
|
]
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ u(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
|
-
id:
|
|
61
|
+
id: f,
|
|
62
62
|
role: "region",
|
|
63
|
-
"aria-labelledby":
|
|
63
|
+
"aria-labelledby": v,
|
|
64
64
|
className: w(
|
|
65
65
|
"transition-all duration-300 ease-linear px-4",
|
|
66
66
|
s ? "max-h-96 opacity-100 overflow-auto py-3" : "max-h-0 opacity-0 overflow-hidden",
|
|
67
|
-
|
|
67
|
+
l
|
|
68
68
|
),
|
|
69
|
-
children: s && (
|
|
69
|
+
children: s && (n || e)
|
|
70
70
|
}
|
|
71
71
|
)
|
|
72
72
|
] });
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
id:
|
|
74
|
+
function Ke({
|
|
75
|
+
id: o,
|
|
76
76
|
items: a = [],
|
|
77
77
|
children: e,
|
|
78
|
-
className:
|
|
78
|
+
className: n = "",
|
|
79
79
|
itemClassName: t = "",
|
|
80
80
|
allowMultiple: r = !1,
|
|
81
81
|
defaultOpenItems: s = [],
|
|
82
|
-
triggersClassName:
|
|
83
|
-
bodiesClassName:
|
|
82
|
+
triggersClassName: d = "",
|
|
83
|
+
bodiesClassName: c = ""
|
|
84
84
|
}) {
|
|
85
|
-
const
|
|
86
|
-
|
|
85
|
+
const l = I(), b = o || `accordion-group-${l}`, [i, v] = x(new Set(s)), f = (h) => {
|
|
86
|
+
v((y) => {
|
|
87
87
|
const p = new Set(y);
|
|
88
88
|
return p.has(h) ? p.delete(h) : (r || p.clear(), p.add(h)), p;
|
|
89
89
|
});
|
|
90
|
-
}, m = (h) => `${
|
|
91
|
-
return /* @__PURE__ */
|
|
90
|
+
}, m = (h) => `${l}-item-${h}`, g = (h) => i.has(h);
|
|
91
|
+
return /* @__PURE__ */ E("div", { id: b, className: n, children: [
|
|
92
92
|
a.length > 0 && a.map((h, y) => {
|
|
93
93
|
const p = h.id || m(y);
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
|
|
94
|
+
return /* @__PURE__ */ u(
|
|
95
|
+
q,
|
|
96
96
|
{
|
|
97
97
|
id: p,
|
|
98
98
|
title: h.title,
|
|
99
99
|
content: h.content,
|
|
100
100
|
disabled: h.disabled,
|
|
101
|
-
isOpen:
|
|
102
|
-
onToggle: () =>
|
|
101
|
+
isOpen: g(p),
|
|
102
|
+
onToggle: () => f(p),
|
|
103
103
|
className: t,
|
|
104
|
-
triggerClassName:
|
|
105
|
-
bodyClassName:
|
|
104
|
+
triggerClassName: d,
|
|
105
|
+
bodyClassName: c
|
|
106
106
|
},
|
|
107
107
|
p
|
|
108
108
|
);
|
|
109
109
|
}),
|
|
110
|
-
a.length === 0 && e &&
|
|
111
|
-
if (
|
|
110
|
+
a.length === 0 && e && z.Children.map(e, (h, y) => {
|
|
111
|
+
if (z.isValidElement(h) && h.type === q) {
|
|
112
112
|
const p = h.props.id || m(y);
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
|
|
113
|
+
return /* @__PURE__ */ Y(
|
|
114
|
+
q,
|
|
115
115
|
{
|
|
116
116
|
...h.props,
|
|
117
117
|
key: p,
|
|
118
118
|
id: p,
|
|
119
119
|
className: w(t, h.props.className),
|
|
120
|
-
isOpen:
|
|
121
|
-
onToggle: () =>
|
|
122
|
-
triggerClassName: w(
|
|
123
|
-
bodyClassName: w(
|
|
120
|
+
isOpen: g(p),
|
|
121
|
+
onToggle: () => f(p),
|
|
122
|
+
triggerClassName: w(d, h.props.triggerClassName),
|
|
123
|
+
bodyClassName: w(c, h.props.bodyClassName)
|
|
124
124
|
}
|
|
125
125
|
);
|
|
126
126
|
}
|
|
@@ -128,25 +128,25 @@ function je({
|
|
|
128
128
|
})
|
|
129
129
|
] });
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
const [
|
|
131
|
+
function de() {
|
|
132
|
+
const [o, a] = x(0);
|
|
133
133
|
return C(() => {
|
|
134
134
|
const e = setInterval(() => {
|
|
135
|
-
a((
|
|
135
|
+
a((n) => (n + 1) % 3);
|
|
136
136
|
}, 500);
|
|
137
137
|
return () => clearInterval(e);
|
|
138
|
-
}, []), /* @__PURE__ */
|
|
138
|
+
}, []), /* @__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(
|
|
139
139
|
"div",
|
|
140
140
|
{
|
|
141
141
|
className: w(
|
|
142
142
|
"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",
|
|
143
|
-
|
|
143
|
+
o === e && "transform -translate-y-1"
|
|
144
144
|
)
|
|
145
145
|
},
|
|
146
146
|
e
|
|
147
147
|
)) });
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const ce = {
|
|
150
150
|
base: "",
|
|
151
151
|
primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
|
|
152
152
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
|
|
@@ -162,7 +162,7 @@ const de = {
|
|
|
162
162
|
lg: "px-6 py-3 text-lg",
|
|
163
163
|
icon: "p-1 w-fit aspect-square",
|
|
164
164
|
full: "p-2 w-full"
|
|
165
|
-
},
|
|
165
|
+
}, fe = {
|
|
166
166
|
none: "rounded-none",
|
|
167
167
|
sm: "rounded-sm",
|
|
168
168
|
md: "rounded-md",
|
|
@@ -173,43 +173,43 @@ const de = {
|
|
|
173
173
|
size: "md",
|
|
174
174
|
rounded: "md"
|
|
175
175
|
};
|
|
176
|
-
function
|
|
177
|
-
variant:
|
|
176
|
+
function me({
|
|
177
|
+
variant: o = K.variant,
|
|
178
178
|
size: a,
|
|
179
179
|
rounded: e = K.rounded,
|
|
180
|
-
loading:
|
|
180
|
+
loading: n,
|
|
181
181
|
linkTo: t,
|
|
182
182
|
linkProps: r,
|
|
183
183
|
type: s = "button",
|
|
184
|
-
className:
|
|
185
|
-
...
|
|
184
|
+
className: d,
|
|
185
|
+
...c
|
|
186
186
|
}) {
|
|
187
|
-
let
|
|
188
|
-
|
|
187
|
+
let l;
|
|
188
|
+
o === "link" && !a ? l = "fitted" : l = a || K.size;
|
|
189
189
|
const i = w(
|
|
190
190
|
"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
|
|
191
|
-
|
|
192
|
-
ue[
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
ce[o],
|
|
192
|
+
ue[l],
|
|
193
|
+
fe[e],
|
|
194
|
+
n && "relative pointer-events-none",
|
|
195
195
|
t && "relative",
|
|
196
|
-
|
|
196
|
+
d
|
|
197
197
|
);
|
|
198
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ E(
|
|
199
199
|
"button",
|
|
200
200
|
{
|
|
201
|
-
...
|
|
202
|
-
role: t ? "link" :
|
|
203
|
-
"aria-label":
|
|
204
|
-
"aria-description":
|
|
205
|
-
"aria-disabled":
|
|
206
|
-
"aria-busy":
|
|
201
|
+
...c,
|
|
202
|
+
role: t ? "link" : c.role,
|
|
203
|
+
"aria-label": c["aria-label"] || (r == null ? void 0 : r["aria-label"]),
|
|
204
|
+
"aria-description": c["aria-description"] || (r == null ? void 0 : r["aria-description"]),
|
|
205
|
+
"aria-disabled": c.disabled || n,
|
|
206
|
+
"aria-busy": n,
|
|
207
207
|
type: s,
|
|
208
208
|
className: i,
|
|
209
209
|
children: [
|
|
210
|
-
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
t && !
|
|
210
|
+
n && /* @__PURE__ */ u(de, {}),
|
|
211
|
+
/* @__PURE__ */ u("span", { className: w(n && "invisible"), children: c.children }),
|
|
212
|
+
t && !c.disabled && /* @__PURE__ */ u(
|
|
213
213
|
"a",
|
|
214
214
|
{
|
|
215
215
|
...r,
|
|
@@ -223,96 +223,96 @@ function fe({
|
|
|
223
223
|
}
|
|
224
224
|
);
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
const [a, e] = x(""),
|
|
226
|
+
function be(o) {
|
|
227
|
+
const [a, e] = x(""), n = A((t) => {
|
|
228
228
|
let r = t, s = "";
|
|
229
229
|
for (; r && !s; ) {
|
|
230
|
-
const
|
|
231
|
-
|
|
230
|
+
const d = window.getComputedStyle(r).backgroundColor;
|
|
231
|
+
d && d !== "transparent" && d !== "rgba(0, 0, 0, 0)" && (s = d), r = r.parentElement;
|
|
232
232
|
}
|
|
233
233
|
return s || "transparent";
|
|
234
234
|
}, []);
|
|
235
235
|
return C(() => {
|
|
236
|
-
const t = document.getElementById(
|
|
236
|
+
const t = document.getElementById(o);
|
|
237
237
|
if (t) {
|
|
238
|
-
const r =
|
|
238
|
+
const r = n(t.parentElement);
|
|
239
239
|
e(r);
|
|
240
240
|
}
|
|
241
|
-
}, [
|
|
241
|
+
}, [o, n]), a;
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
ref:
|
|
243
|
+
function Ge({
|
|
244
|
+
ref: o,
|
|
245
245
|
id: a,
|
|
246
246
|
size: e = 20,
|
|
247
|
-
color:
|
|
247
|
+
color: n,
|
|
248
248
|
filled: t = !1,
|
|
249
249
|
rounded: r = !0,
|
|
250
250
|
checked: s = !1,
|
|
251
|
-
onCheckedChange:
|
|
252
|
-
disabled:
|
|
253
|
-
className:
|
|
254
|
-
...
|
|
251
|
+
onCheckedChange: d,
|
|
252
|
+
disabled: c,
|
|
253
|
+
className: l = "",
|
|
254
|
+
...b
|
|
255
255
|
}) {
|
|
256
|
-
const i =
|
|
256
|
+
const i = I(), v = W(() => a || `checkbox-${i}`, [a, i]), f = be(v), [m, g] = x(s);
|
|
257
257
|
C(() => {
|
|
258
|
-
|
|
258
|
+
g(s);
|
|
259
259
|
}, [s]);
|
|
260
260
|
const h = () => {
|
|
261
|
-
|
|
262
|
-
}, y = (
|
|
263
|
-
|
|
261
|
+
c || (g(!m), d == null || d(!m));
|
|
262
|
+
}, y = (N) => {
|
|
263
|
+
N.key === " " && (N.preventDefault(), h());
|
|
264
264
|
}, p = w(
|
|
265
265
|
"flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",
|
|
266
266
|
r && "rounded",
|
|
267
|
-
|
|
268
|
-
!
|
|
269
|
-
|
|
267
|
+
c && "opacity-40 cursor-not-allowed",
|
|
268
|
+
!c && "cursor-pointer",
|
|
269
|
+
l
|
|
270
270
|
);
|
|
271
|
-
return /* @__PURE__ */
|
|
271
|
+
return /* @__PURE__ */ u(
|
|
272
272
|
"button",
|
|
273
273
|
{
|
|
274
|
-
id:
|
|
274
|
+
id: v,
|
|
275
275
|
type: "button",
|
|
276
|
-
ref:
|
|
276
|
+
ref: o,
|
|
277
277
|
tabIndex: 0,
|
|
278
278
|
role: "checkbox",
|
|
279
279
|
onClick: h,
|
|
280
280
|
"aria-checked": m,
|
|
281
|
-
"aria-disabled":
|
|
281
|
+
"aria-disabled": c,
|
|
282
282
|
onKeyDownCapture: y,
|
|
283
283
|
style: {
|
|
284
284
|
width: e,
|
|
285
285
|
height: e,
|
|
286
|
-
color:
|
|
286
|
+
color: n,
|
|
287
287
|
backgroundColor: m && t ? "currentcolor" : "transparent"
|
|
288
288
|
},
|
|
289
289
|
className: p,
|
|
290
|
-
...
|
|
291
|
-
children: m && /* @__PURE__ */
|
|
290
|
+
...b,
|
|
291
|
+
children: m && /* @__PURE__ */ u(re, { size: e, color: t ? f : void 0 })
|
|
292
292
|
}
|
|
293
293
|
);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
children:
|
|
295
|
+
function We({
|
|
296
|
+
children: o,
|
|
297
297
|
className: a,
|
|
298
298
|
linkTo: e,
|
|
299
|
-
linkProps:
|
|
299
|
+
linkProps: n,
|
|
300
300
|
onButtonClick: t,
|
|
301
301
|
buttonProps: r,
|
|
302
302
|
...s
|
|
303
303
|
}) {
|
|
304
|
-
return e && t && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */
|
|
305
|
-
|
|
306
|
-
e && /* @__PURE__ */
|
|
304
|
+
return e && t && console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'), /* @__PURE__ */ E("div", { className: w("relative w-fit", a), ...s, children: [
|
|
305
|
+
o,
|
|
306
|
+
e && /* @__PURE__ */ u(
|
|
307
307
|
"a",
|
|
308
308
|
{
|
|
309
|
-
...
|
|
310
|
-
rel: (
|
|
309
|
+
...n,
|
|
310
|
+
rel: (n == null ? void 0 : n.rel) || "noreferrer",
|
|
311
311
|
href: e,
|
|
312
|
-
className: w("absolute inset-0",
|
|
312
|
+
className: w("absolute inset-0", n == null ? void 0 : n.className)
|
|
313
313
|
}
|
|
314
314
|
),
|
|
315
|
-
!e && t && /* @__PURE__ */
|
|
315
|
+
!e && t && /* @__PURE__ */ u(
|
|
316
316
|
"button",
|
|
317
317
|
{
|
|
318
318
|
...r,
|
|
@@ -323,23 +323,23 @@ function Se({
|
|
|
323
323
|
)
|
|
324
324
|
] });
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function S({ elementId: o, type: a, message: e }) {
|
|
327
327
|
return C(() => {
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
328
|
+
const n = document.getElementById(o);
|
|
329
|
+
if (n) {
|
|
330
330
|
if (!e && a === "error") {
|
|
331
|
-
|
|
331
|
+
n.removeAttribute("data-error");
|
|
332
332
|
return;
|
|
333
333
|
}
|
|
334
334
|
if (!e && a === "success") {
|
|
335
|
-
|
|
335
|
+
n.removeAttribute("data-success");
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
|
-
return
|
|
339
|
-
|
|
338
|
+
return n.setAttribute("aria-describedby", `${o}-${a}-message`), n.setAttribute("aria-invalid", a === "error" ? "true" : "false"), a === "error" && n.setAttribute("data-error", "true"), a === "success" && n.setAttribute("data-success", "true"), () => {
|
|
339
|
+
n.removeAttribute("aria-describedby"), n.removeAttribute("aria-invalid"), n.removeAttribute("data-error"), n.removeAttribute("data-success");
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
|
-
}, [
|
|
342
|
+
}, [o, a, e]), e ? /* @__PURE__ */ E(
|
|
343
343
|
"small",
|
|
344
344
|
{
|
|
345
345
|
className: w(
|
|
@@ -349,131 +349,131 @@ function j({ elementId: n, type: a, message: e }) {
|
|
|
349
349
|
),
|
|
350
350
|
role: "status",
|
|
351
351
|
children: [
|
|
352
|
-
a === "error" ? /* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */
|
|
352
|
+
a === "error" ? /* @__PURE__ */ u(ie, {}) : /* @__PURE__ */ u(ne, {}),
|
|
353
|
+
/* @__PURE__ */ u("span", { id: `${o}-${a}-message`, children: e })
|
|
354
354
|
]
|
|
355
355
|
}
|
|
356
356
|
) : null;
|
|
357
357
|
}
|
|
358
|
-
const
|
|
358
|
+
const he = {
|
|
359
359
|
base: "",
|
|
360
360
|
default: "ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",
|
|
361
361
|
underline: "border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",
|
|
362
362
|
outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
|
|
363
|
-
},
|
|
363
|
+
}, pe = {
|
|
364
364
|
none: "rounded-none",
|
|
365
365
|
sm: "rounded-sm",
|
|
366
366
|
md: "rounded-md",
|
|
367
367
|
lg: "rounded-lg",
|
|
368
368
|
full: "px-3 rounded-full"
|
|
369
|
-
},
|
|
369
|
+
}, Q = {
|
|
370
370
|
variant: "default",
|
|
371
371
|
rounded: "none"
|
|
372
372
|
};
|
|
373
|
-
function
|
|
374
|
-
variant:
|
|
373
|
+
function Ue({
|
|
374
|
+
variant: o = Q.variant,
|
|
375
375
|
rounded: a,
|
|
376
376
|
displayOnlyMode: e = !1,
|
|
377
|
-
errorMessage:
|
|
377
|
+
errorMessage: n,
|
|
378
378
|
successMessage: t,
|
|
379
379
|
type: r = "text",
|
|
380
380
|
className: s,
|
|
381
|
-
...
|
|
381
|
+
...d
|
|
382
382
|
}) {
|
|
383
|
-
const
|
|
383
|
+
const c = I(), [l, b] = x(!1);
|
|
384
384
|
let i = a;
|
|
385
|
-
|
|
385
|
+
o === "outline" && !a && (i = "md"), i = i || Q.rounded;
|
|
386
386
|
const m = w(
|
|
387
387
|
"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
|
|
388
388
|
"file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors",
|
|
389
|
-
!e &&
|
|
390
|
-
!e &&
|
|
389
|
+
!e && he[o],
|
|
390
|
+
!e && pe[i],
|
|
391
391
|
r === "password" && "pr-10",
|
|
392
392
|
!e && "px-2 py-1",
|
|
393
393
|
e && "pointer-events-none",
|
|
394
394
|
s
|
|
395
395
|
);
|
|
396
|
-
return /* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */
|
|
396
|
+
return /* @__PURE__ */ E("div", { className: w(e && "cursor-text"), style: { height: d.height, width: d.width }, children: [
|
|
397
|
+
/* @__PURE__ */ E("div", { className: w(r === "password" && "relative"), children: [
|
|
398
|
+
/* @__PURE__ */ u(
|
|
399
399
|
"input",
|
|
400
400
|
{
|
|
401
|
-
...
|
|
402
|
-
id:
|
|
403
|
-
type: r === "password" &&
|
|
404
|
-
"aria-disabled":
|
|
401
|
+
...d,
|
|
402
|
+
id: c,
|
|
403
|
+
type: r === "password" && l ? "text" : r,
|
|
404
|
+
"aria-disabled": d.disabled,
|
|
405
405
|
readOnly: e,
|
|
406
|
-
"aria-readonly": e ||
|
|
407
|
-
"data-error":
|
|
406
|
+
"aria-readonly": e || d["aria-readonly"],
|
|
407
|
+
"data-error": n ? !0 : void 0,
|
|
408
408
|
"data-success": t ? !0 : void 0,
|
|
409
409
|
className: m
|
|
410
410
|
}
|
|
411
411
|
),
|
|
412
|
-
r === "password" && /* @__PURE__ */
|
|
412
|
+
r === "password" && /* @__PURE__ */ u(
|
|
413
413
|
"button",
|
|
414
414
|
{
|
|
415
|
-
onClick: () =>
|
|
415
|
+
onClick: () => b(!l),
|
|
416
416
|
className: "absolute inset-y-0 right-0 px-2 hover:cursor-pointer",
|
|
417
417
|
"aria-label": "Toggle password visibility",
|
|
418
|
-
"data-state":
|
|
419
|
-
children:
|
|
418
|
+
"data-state": l ? "visible" : "hidden",
|
|
419
|
+
children: l ? /* @__PURE__ */ u(oe, { size: 20 }) : /* @__PURE__ */ u(ae, { size: 20 })
|
|
420
420
|
}
|
|
421
421
|
)
|
|
422
422
|
] }),
|
|
423
|
-
!e && /* @__PURE__ */
|
|
424
|
-
!e && /* @__PURE__ */
|
|
423
|
+
!e && /* @__PURE__ */ u(S, { elementId: c, type: "error", message: n }),
|
|
424
|
+
!e && /* @__PURE__ */ u(S, { elementId: c, type: "success", message: t })
|
|
425
425
|
] });
|
|
426
426
|
}
|
|
427
|
-
function
|
|
428
|
-
display:
|
|
427
|
+
function _e({
|
|
428
|
+
display: o = "inline",
|
|
429
429
|
width: a = "fit-content",
|
|
430
430
|
className: e = "",
|
|
431
|
-
required:
|
|
431
|
+
required: n,
|
|
432
432
|
helpMessage: t,
|
|
433
433
|
suffix: r,
|
|
434
434
|
htmlFor: s,
|
|
435
|
-
children:
|
|
436
|
-
...
|
|
435
|
+
children: d,
|
|
436
|
+
...c
|
|
437
437
|
}) {
|
|
438
|
-
const
|
|
439
|
-
return /* @__PURE__ */
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
|
|
442
|
-
|
|
438
|
+
const l = I(), b = w("font-medium", o, e), i = t ? `${s ?? l}-help` : void 0;
|
|
439
|
+
return /* @__PURE__ */ E("div", { style: { display: o === "inline" ? "inline-flex" : "flex", width: a }, className: "relative", children: [
|
|
440
|
+
/* @__PURE__ */ E("label", { className: b, htmlFor: s, ...c, children: [
|
|
441
|
+
d,
|
|
442
|
+
n && /* @__PURE__ */ u("span", { className: "text-red-500 font-medium ml-1", "aria-label": "required", children: "*" })
|
|
443
443
|
] }),
|
|
444
|
-
t && /* @__PURE__ */
|
|
444
|
+
t && /* @__PURE__ */ u(
|
|
445
445
|
"span",
|
|
446
446
|
{
|
|
447
447
|
className: "text-gray-500 ml-1 size-fit -translate-y-1/3",
|
|
448
448
|
"aria-describedby": i,
|
|
449
449
|
"aria-label": "Help information",
|
|
450
450
|
title: t,
|
|
451
|
-
children: /* @__PURE__ */
|
|
451
|
+
children: /* @__PURE__ */ u(se, {})
|
|
452
452
|
}
|
|
453
453
|
),
|
|
454
|
-
t && /* @__PURE__ */
|
|
455
|
-
r && /* @__PURE__ */
|
|
454
|
+
t && /* @__PURE__ */ u("div", { id: i, className: "sr-only", children: t }),
|
|
455
|
+
r && /* @__PURE__ */ u("span", { className: "ml-1", children: r })
|
|
456
456
|
] });
|
|
457
457
|
}
|
|
458
|
-
function
|
|
459
|
-
const [a, e] = x(!1), [
|
|
458
|
+
function ge(o) {
|
|
459
|
+
const [a, e] = x(!1), [n, t] = x(!1);
|
|
460
460
|
return C(() => {
|
|
461
|
-
|
|
462
|
-
}, [
|
|
461
|
+
o ? (t(!0), setTimeout(() => e(!0), 10)) : (e(!1), setTimeout(() => t(!1), 150));
|
|
462
|
+
}, [o]), { show: a, shouldRender: n };
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function ve(o, a) {
|
|
465
465
|
C(() => {
|
|
466
|
-
const e = (
|
|
467
|
-
|
|
466
|
+
const e = (n) => {
|
|
467
|
+
n.key === "Escape" && o && a();
|
|
468
468
|
};
|
|
469
|
-
return document.addEventListener("keydown", e),
|
|
469
|
+
return document.addEventListener("keydown", e), o && (document.body.style.overflow = "hidden"), () => {
|
|
470
470
|
document.removeEventListener("keydown", e), document.body.style.overflow = "auto";
|
|
471
471
|
};
|
|
472
|
-
}, [
|
|
472
|
+
}, [o, a]);
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
const e =
|
|
476
|
-
const t = document.getElementById(
|
|
474
|
+
function we(o, a) {
|
|
475
|
+
const e = j(null), n = A(() => {
|
|
476
|
+
const t = document.getElementById(o);
|
|
477
477
|
if (!t) return;
|
|
478
478
|
const r = t.querySelectorAll('[data-modal-action="true"]');
|
|
479
479
|
if (r.length > 0) {
|
|
@@ -484,85 +484,85 @@ function ve(n, a) {
|
|
|
484
484
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
485
485
|
);
|
|
486
486
|
if (s.length > 0) {
|
|
487
|
-
const
|
|
488
|
-
if (
|
|
489
|
-
|
|
487
|
+
const d = Array.from(s).filter((c) => !(c instanceof HTMLButtonElement && c.getAttribute("data-modal-close-button") === "true"));
|
|
488
|
+
if (d.length > 0) {
|
|
489
|
+
d[0].focus();
|
|
490
490
|
return;
|
|
491
491
|
}
|
|
492
492
|
s[0].focus();
|
|
493
493
|
return;
|
|
494
494
|
}
|
|
495
495
|
t.focus();
|
|
496
|
-
}, [
|
|
497
|
-
C(() => (a && (e.current = document.activeElement,
|
|
496
|
+
}, [o]);
|
|
497
|
+
C(() => (a && (e.current = document.activeElement, n()), () => {
|
|
498
498
|
document.body.style.overflow = "auto", e.current instanceof HTMLElement && e.current.focus();
|
|
499
|
-
}), [a,
|
|
499
|
+
}), [a, n]);
|
|
500
500
|
}
|
|
501
|
-
function
|
|
502
|
-
id:
|
|
501
|
+
function Qe({
|
|
502
|
+
id: o,
|
|
503
503
|
isOpen: a,
|
|
504
504
|
onClose: e,
|
|
505
|
-
title:
|
|
505
|
+
title: n,
|
|
506
506
|
children: t,
|
|
507
507
|
contentOnly: r = !1,
|
|
508
508
|
className: s,
|
|
509
|
-
overlayClassName:
|
|
510
|
-
hideCloseButton:
|
|
511
|
-
actions:
|
|
512
|
-
disableCloseOnOverlayClick:
|
|
509
|
+
overlayClassName: d,
|
|
510
|
+
hideCloseButton: c = !1,
|
|
511
|
+
actions: l = [],
|
|
512
|
+
disableCloseOnOverlayClick: b = !1,
|
|
513
513
|
ariaLabelledBy: i,
|
|
514
|
-
ariaDescribedBy:
|
|
514
|
+
ariaDescribedBy: v
|
|
515
515
|
}) {
|
|
516
|
-
const
|
|
517
|
-
if (
|
|
518
|
-
const p = () =>
|
|
519
|
-
const { label:
|
|
520
|
-
return /* @__PURE__ */
|
|
516
|
+
const f = I(), m = o || `modal-${f}`, g = o ? `${o}-title` : `modal-title-${f}`, { show: h, shouldRender: y } = ge(a);
|
|
517
|
+
if (we(m, y), ve(y, e), !y) return null;
|
|
518
|
+
const p = () => n ? z.isValidElement(n) ? /* @__PURE__ */ u("div", { className: "mb-4", children: n }) : /* @__PURE__ */ u("h2", { className: "mb-4 text-xl font-semibold", id: g, children: n }) : null, N = () => l.length === 0 ? null : /* @__PURE__ */ u("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: l.map((D, $) => {
|
|
519
|
+
const { label: F, className: k, ...L } = D;
|
|
520
|
+
return /* @__PURE__ */ u(me, { className: k, type: "button", ...L, "data-modal-action": "true", children: F }, $);
|
|
521
521
|
}) });
|
|
522
|
-
return /* @__PURE__ */
|
|
523
|
-
/* @__PURE__ */
|
|
522
|
+
return /* @__PURE__ */ u(J, { children: M(
|
|
523
|
+
/* @__PURE__ */ u(
|
|
524
524
|
"div",
|
|
525
525
|
{
|
|
526
|
-
"aria-labelledby": i ??
|
|
527
|
-
"aria-describedby":
|
|
526
|
+
"aria-labelledby": i ?? n ? g : void 0,
|
|
527
|
+
"aria-describedby": v,
|
|
528
528
|
role: "dialog",
|
|
529
529
|
"aria-modal": "true",
|
|
530
530
|
className: "fixed inset-0 z-[100] overflow-y-auto",
|
|
531
|
-
children: /* @__PURE__ */
|
|
532
|
-
/* @__PURE__ */
|
|
531
|
+
children: /* @__PURE__ */ E("div", { className: "flex min-h-screen items-center justify-center p-4", children: [
|
|
532
|
+
/* @__PURE__ */ u(
|
|
533
533
|
"div",
|
|
534
534
|
{
|
|
535
|
-
className:
|
|
535
|
+
className: H("fixed inset-0 bg-black/20 transition-all", d),
|
|
536
536
|
onClick: () => {
|
|
537
|
-
|
|
537
|
+
b || e();
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
540
|
),
|
|
541
|
-
r && /* @__PURE__ */
|
|
542
|
-
!r && /* @__PURE__ */
|
|
541
|
+
r && /* @__PURE__ */ u("div", { className: H("relative w-fit", s), children: t }),
|
|
542
|
+
!r && /* @__PURE__ */ E(
|
|
543
543
|
"div",
|
|
544
544
|
{
|
|
545
545
|
id: m,
|
|
546
546
|
tabIndex: -1,
|
|
547
|
-
className:
|
|
547
|
+
className: H(
|
|
548
548
|
"relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75",
|
|
549
549
|
h ? "opacity-100 scale-100" : "opacity-0 scale-90",
|
|
550
550
|
s
|
|
551
551
|
),
|
|
552
552
|
children: [
|
|
553
|
-
!
|
|
553
|
+
!c && /* @__PURE__ */ u(
|
|
554
554
|
"button",
|
|
555
555
|
{
|
|
556
556
|
type: "button",
|
|
557
557
|
onClick: e,
|
|
558
558
|
"data-modal-close-button": "true",
|
|
559
559
|
className: "rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",
|
|
560
|
-
children: /* @__PURE__ */
|
|
560
|
+
children: /* @__PURE__ */ u(le, { size: 18 })
|
|
561
561
|
}
|
|
562
562
|
),
|
|
563
563
|
p(),
|
|
564
564
|
t,
|
|
565
|
-
|
|
565
|
+
N()
|
|
566
566
|
]
|
|
567
567
|
}
|
|
568
568
|
)
|
|
@@ -572,35 +572,35 @@ function Ve({
|
|
|
572
572
|
document.body
|
|
573
573
|
) });
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
const s = "relative inline-flex items-center justify-center rounded-full",
|
|
575
|
+
function ye({ itemId: o, checked: a, onChange: e, name: n, disabled: t = !1, className: r = "" }) {
|
|
576
|
+
const s = "relative inline-flex items-center justify-center rounded-full", d = () => {
|
|
577
577
|
t || e();
|
|
578
|
-
},
|
|
578
|
+
}, c = w(
|
|
579
579
|
s,
|
|
580
580
|
!a && "hover:border-current/60",
|
|
581
581
|
!t && "border-current cursor-pointer",
|
|
582
582
|
t && "border-muted/60 cursor-not-allowed",
|
|
583
583
|
r
|
|
584
584
|
);
|
|
585
|
-
return /* @__PURE__ */
|
|
585
|
+
return /* @__PURE__ */ u(
|
|
586
586
|
"div",
|
|
587
587
|
{
|
|
588
|
-
id:
|
|
588
|
+
id: o,
|
|
589
589
|
role: "radio",
|
|
590
590
|
tabIndex: -1,
|
|
591
591
|
"aria-checked": a,
|
|
592
592
|
"aria-disabled": t,
|
|
593
|
-
"aria-description": `Radio button for ${
|
|
594
|
-
"aria-labelledby": `${
|
|
595
|
-
onClick:
|
|
596
|
-
className:
|
|
593
|
+
"aria-description": `Radio button for ${n}`,
|
|
594
|
+
"aria-labelledby": `${o}-label`,
|
|
595
|
+
onClick: d,
|
|
596
|
+
className: c,
|
|
597
597
|
style: {
|
|
598
598
|
width: "1em",
|
|
599
599
|
height: "1em",
|
|
600
600
|
padding: "0.1em",
|
|
601
601
|
borderWidth: "0.06em"
|
|
602
602
|
},
|
|
603
|
-
children: a && /* @__PURE__ */
|
|
603
|
+
children: a && /* @__PURE__ */ u(
|
|
604
604
|
"div",
|
|
605
605
|
{
|
|
606
606
|
className: w("size-full aspect-square rounded-full", t && "bg-muted/60", !t && "bg-current")
|
|
@@ -610,63 +610,63 @@ function we({ itemId: n, checked: a, onChange: e, name: o, disabled: t = !1, cla
|
|
|
610
610
|
);
|
|
611
611
|
}
|
|
612
612
|
function G({
|
|
613
|
-
value:
|
|
613
|
+
value: o,
|
|
614
614
|
children: a,
|
|
615
615
|
className: e = "",
|
|
616
|
-
isSelected:
|
|
616
|
+
isSelected: n = !1,
|
|
617
617
|
onChange: t,
|
|
618
618
|
disabled: r = !1,
|
|
619
619
|
hideInput: s = !1,
|
|
620
|
-
description:
|
|
621
|
-
name:
|
|
620
|
+
description: d,
|
|
621
|
+
name: c
|
|
622
622
|
}) {
|
|
623
|
-
const
|
|
624
|
-
r || t == null || t(
|
|
623
|
+
const b = `radio-${I()}-${o}`, i = () => {
|
|
624
|
+
r || t == null || t(o);
|
|
625
625
|
};
|
|
626
|
-
return /* @__PURE__ */
|
|
626
|
+
return /* @__PURE__ */ E(
|
|
627
627
|
"div",
|
|
628
628
|
{
|
|
629
|
-
title:
|
|
629
|
+
title: d,
|
|
630
630
|
className: w(
|
|
631
631
|
"relative flex items-center",
|
|
632
632
|
e,
|
|
633
633
|
// Uses text color for borders
|
|
634
634
|
s && `p-2 border-2 focus-within:border-dashed focus-within:${r ? "border-current/50" : "border-current/80"}`,
|
|
635
|
-
s && !
|
|
636
|
-
s &&
|
|
635
|
+
s && !n && `border-transparent ${r ? "" : "not-focus-within:hover:border-border/60"}`,
|
|
636
|
+
s && n && "border-border",
|
|
637
637
|
r && "opacity-60 cursor-not-allowed"
|
|
638
638
|
),
|
|
639
639
|
style: {
|
|
640
640
|
gap: "0.5em"
|
|
641
641
|
},
|
|
642
642
|
children: [
|
|
643
|
-
!s && /* @__PURE__ */
|
|
644
|
-
|
|
643
|
+
!s && /* @__PURE__ */ u(
|
|
644
|
+
ye,
|
|
645
645
|
{
|
|
646
|
-
itemId:
|
|
647
|
-
name:
|
|
648
|
-
checked:
|
|
646
|
+
itemId: b,
|
|
647
|
+
name: c || "",
|
|
648
|
+
checked: n,
|
|
649
649
|
onChange: i,
|
|
650
650
|
disabled: r,
|
|
651
651
|
className: w(s && "")
|
|
652
652
|
}
|
|
653
653
|
),
|
|
654
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ u(
|
|
655
655
|
"div",
|
|
656
656
|
{
|
|
657
|
-
id: s ?
|
|
657
|
+
id: s ? b : void 0,
|
|
658
658
|
tabIndex: s ? -1 : void 0,
|
|
659
659
|
role: s ? "radio" : void 0,
|
|
660
660
|
onClick: s ? i : void 0,
|
|
661
|
-
"aria-checked": s ?
|
|
661
|
+
"aria-checked": s ? n ? "true" : "false" : void 0,
|
|
662
662
|
"aria-disabled": s ? r : void 0,
|
|
663
|
-
"aria-description": s ?
|
|
664
|
-
"aria-labelledby": s ? `${
|
|
663
|
+
"aria-description": s ? d || `Radio button for ${c}` : void 0,
|
|
664
|
+
"aria-labelledby": s ? `${b}-label` : void 0,
|
|
665
665
|
className: w(s && "size-full", typeof a == "object" && "grow focus:outline-none"),
|
|
666
|
-
children: /* @__PURE__ */
|
|
666
|
+
children: /* @__PURE__ */ u(
|
|
667
667
|
"label",
|
|
668
668
|
{
|
|
669
|
-
id: `${
|
|
669
|
+
id: `${b}-label`,
|
|
670
670
|
onClick: s ? void 0 : i,
|
|
671
671
|
className: w(r && "cursor-not-allowed", !r && "cursor-pointer"),
|
|
672
672
|
children: a
|
|
@@ -678,150 +678,204 @@ function G({
|
|
|
678
678
|
}
|
|
679
679
|
);
|
|
680
680
|
}
|
|
681
|
-
function
|
|
682
|
-
const [e,
|
|
681
|
+
function xe(o, a) {
|
|
682
|
+
const [e, n] = x(a), [t, r] = x(-1), [s, d] = x(!1), c = A((f, m) => {
|
|
683
683
|
var y;
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
}, []),
|
|
687
|
-
(
|
|
684
|
+
const g = f[m];
|
|
685
|
+
g.hasAttribute("disabled") || g.getAttribute("aria-disabled") === "true" || ((y = f[m]) == null || y.click(), r(m));
|
|
686
|
+
}, []), l = A(
|
|
687
|
+
(f, m) => {
|
|
688
688
|
var h;
|
|
689
|
-
if (
|
|
690
|
-
const
|
|
691
|
-
(h = m[
|
|
689
|
+
if (f.preventDefault(), s || !m.length) return;
|
|
690
|
+
const g = a !== -1 ? a : 0;
|
|
691
|
+
(h = m[g]) == null || h.focus(), n(g), a !== -1 && c(m, g);
|
|
692
692
|
},
|
|
693
|
-
[a, s,
|
|
694
|
-
),
|
|
695
|
-
(
|
|
693
|
+
[a, s, c]
|
|
694
|
+
), b = A(
|
|
695
|
+
(f) => {
|
|
696
696
|
var y;
|
|
697
|
-
if (!
|
|
697
|
+
if (!f.shiftKey)
|
|
698
698
|
return;
|
|
699
|
-
|
|
699
|
+
f.preventDefault();
|
|
700
700
|
const m = Array.from(
|
|
701
701
|
document.querySelectorAll(
|
|
702
702
|
'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
|
|
703
703
|
)
|
|
704
|
-
).filter((p) => !p.hasAttribute("disabled") && p.tabIndex >= 0),
|
|
704
|
+
).filter((p) => !p.hasAttribute("disabled") && p.tabIndex >= 0), g = m.findIndex((p) => p.id === o), h = g > 0 ? g - 1 : m.length - 1;
|
|
705
705
|
(y = m[h]) == null || y.focus();
|
|
706
706
|
},
|
|
707
|
-
[
|
|
707
|
+
[o]
|
|
708
708
|
), i = A(
|
|
709
|
-
(
|
|
710
|
-
var
|
|
709
|
+
(f, m) => {
|
|
710
|
+
var N;
|
|
711
711
|
if (!m.length) return;
|
|
712
|
-
const
|
|
713
|
-
if (!m.some((D) => D.id ===
|
|
712
|
+
const g = f.target;
|
|
713
|
+
if (!m.some((D) => D.id === g.id)) return;
|
|
714
714
|
const y = e !== -1 ? e : 0;
|
|
715
715
|
let p = y;
|
|
716
|
-
switch (
|
|
716
|
+
switch (f.key) {
|
|
717
717
|
case "ArrowUp":
|
|
718
718
|
case "ArrowLeft":
|
|
719
|
-
|
|
719
|
+
f.preventDefault(), p = y > 0 ? y - 1 : m.length - 1;
|
|
720
720
|
break;
|
|
721
721
|
case "ArrowDown":
|
|
722
722
|
case "ArrowRight":
|
|
723
|
-
|
|
723
|
+
f.preventDefault(), p = (y + 1) % m.length;
|
|
724
724
|
break;
|
|
725
725
|
// Select the option when the space key is pressed
|
|
726
726
|
case " ":
|
|
727
|
-
|
|
727
|
+
f.preventDefault(), c(m, y);
|
|
728
728
|
return;
|
|
729
729
|
case "Tab":
|
|
730
|
-
f
|
|
730
|
+
b(f);
|
|
731
731
|
return;
|
|
732
732
|
default:
|
|
733
733
|
return;
|
|
734
734
|
}
|
|
735
|
-
(
|
|
735
|
+
(N = m[p]) == null || N.focus(), n(p), t !== -1 && c(m, p);
|
|
736
736
|
},
|
|
737
|
-
[e, t,
|
|
738
|
-
),
|
|
739
|
-
const
|
|
740
|
-
return
|
|
741
|
-
}, [
|
|
737
|
+
[e, t, b, c]
|
|
738
|
+
), v = A(() => {
|
|
739
|
+
const f = document.querySelector(`[id="${o}"][role="radiogroup"]`);
|
|
740
|
+
return f ? Array.from(f.querySelectorAll('[role="radio"]')) : [];
|
|
741
|
+
}, [o]);
|
|
742
742
|
C(() => {
|
|
743
|
-
const
|
|
744
|
-
if (!
|
|
745
|
-
const m =
|
|
746
|
-
return document.addEventListener("keydown", h),
|
|
747
|
-
document.removeEventListener("keydown", h),
|
|
743
|
+
const f = document.querySelector(`[id="${o}"][role="radiogroup"]`);
|
|
744
|
+
if (!f) return;
|
|
745
|
+
const m = v(), g = (N) => l(N, m), h = (N) => i(N, m), y = () => d(!0), p = () => d(!1);
|
|
746
|
+
return document.addEventListener("keydown", h), f.addEventListener("focus", g), f.addEventListener("mousedown", y), document.addEventListener("mouseup", p), () => {
|
|
747
|
+
document.removeEventListener("keydown", h), f.removeEventListener("focus", g), f.removeEventListener("mousedown", y), document.removeEventListener("mouseup", p);
|
|
748
748
|
};
|
|
749
|
-
}, [
|
|
749
|
+
}, [o, v, l, i]);
|
|
750
750
|
}
|
|
751
|
-
function
|
|
752
|
-
options:
|
|
751
|
+
function Xe({
|
|
752
|
+
options: o = [],
|
|
753
753
|
value: a,
|
|
754
754
|
onChange: e,
|
|
755
|
-
id:
|
|
755
|
+
id: n,
|
|
756
756
|
children: t,
|
|
757
757
|
className: r = "",
|
|
758
758
|
childrenClassName: s = "",
|
|
759
|
-
hideInputs:
|
|
759
|
+
hideInputs: d = !1
|
|
760
760
|
}) {
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
761
|
+
const c = I(), l = n || `radio-group-${c}`;
|
|
762
|
+
xe(
|
|
763
|
+
l,
|
|
764
|
+
o.findIndex((i) => i === a)
|
|
765
765
|
);
|
|
766
|
-
const
|
|
767
|
-
return /* @__PURE__ */
|
|
768
|
-
|
|
766
|
+
const b = W(() => o.reduce((i, v) => (typeof v == "string" ? i.some((f) => f.value === v) || i.push({ label: v, value: v }) : i.push(v), i), []), [o]);
|
|
767
|
+
return /* @__PURE__ */ E("div", { id: l, role: "radiogroup", tabIndex: 0, className: w(r, "focus:outline-none"), children: [
|
|
768
|
+
b.length > 0 && b.map((i, v) => /* @__PURE__ */ u(
|
|
769
769
|
G,
|
|
770
770
|
{
|
|
771
771
|
value: i.value,
|
|
772
772
|
isSelected: a === i.value,
|
|
773
773
|
onChange: e,
|
|
774
|
-
name:
|
|
774
|
+
name: l,
|
|
775
775
|
disabled: i.disabled,
|
|
776
776
|
description: i.description,
|
|
777
|
-
hideInput:
|
|
777
|
+
hideInput: d,
|
|
778
778
|
className: s,
|
|
779
779
|
children: i.label
|
|
780
780
|
},
|
|
781
|
-
`${i.value}-${
|
|
781
|
+
`${i.value}-${v}`
|
|
782
782
|
)),
|
|
783
|
-
|
|
783
|
+
b.length === 0 && t && z.Children.map(t, (i) => z.isValidElement(i) && i.type === G ? /* @__PURE__ */ u(
|
|
784
784
|
G,
|
|
785
785
|
{
|
|
786
786
|
...i.props,
|
|
787
787
|
className: w(s, i.props.className),
|
|
788
|
-
hideInput: i.props.hideInput ||
|
|
788
|
+
hideInput: i.props.hideInput || d,
|
|
789
789
|
isSelected: a === i.props.value,
|
|
790
790
|
onChange: e,
|
|
791
|
-
name:
|
|
791
|
+
name: l,
|
|
792
792
|
children: i.props.children
|
|
793
793
|
}
|
|
794
794
|
) : null)
|
|
795
795
|
] });
|
|
796
796
|
}
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
797
|
+
const Ee = {
|
|
798
|
+
thin: {
|
|
799
|
+
horizontal: "h-px",
|
|
800
|
+
vertical: "w-px"
|
|
801
|
+
},
|
|
802
|
+
medium: {
|
|
803
|
+
horizontal: "h-0.5",
|
|
804
|
+
vertical: "w-0.5"
|
|
805
|
+
},
|
|
806
|
+
thick: {
|
|
807
|
+
horizontal: "h-1",
|
|
808
|
+
vertical: "w-1"
|
|
809
|
+
},
|
|
810
|
+
"extra-thick": {
|
|
811
|
+
horizontal: "h-2",
|
|
812
|
+
vertical: "w-2"
|
|
813
|
+
}
|
|
814
|
+
}, Ne = {
|
|
815
|
+
default: "bg-border",
|
|
816
|
+
muted: "bg-muted",
|
|
817
|
+
accent: "bg-accent"
|
|
818
|
+
}, Ce = {
|
|
819
|
+
horizontal: "w-full",
|
|
820
|
+
vertical: "min-h-4 h-full"
|
|
821
|
+
};
|
|
822
|
+
function Ze({
|
|
823
|
+
orientation: o = "horizontal",
|
|
824
|
+
decorative: a = !1,
|
|
825
|
+
thickness: e = "thin",
|
|
826
|
+
variant: n = "default",
|
|
827
|
+
className: t,
|
|
828
|
+
...r
|
|
829
|
+
}) {
|
|
830
|
+
const s = w(
|
|
831
|
+
"shrink-0",
|
|
832
|
+
Ce[o],
|
|
833
|
+
Ee[e][o],
|
|
834
|
+
Ne[n],
|
|
835
|
+
t
|
|
836
|
+
);
|
|
837
|
+
return /* @__PURE__ */ u(
|
|
838
|
+
"div",
|
|
839
|
+
{
|
|
840
|
+
...r,
|
|
841
|
+
className: s,
|
|
842
|
+
role: a ? "presentation" : "separator",
|
|
843
|
+
"aria-orientation": a ? void 0 : o,
|
|
844
|
+
"aria-hidden": a,
|
|
845
|
+
"data-orientation": o,
|
|
846
|
+
"data-thickness": e,
|
|
847
|
+
"data-variant": n
|
|
848
|
+
}
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
function Je({ children: o, ref: a, ...e }) {
|
|
852
|
+
if (P(o)) {
|
|
853
|
+
let n = { ...e };
|
|
854
|
+
return o.props && (n = { ...n, ...o.props }), ee(o, {
|
|
855
|
+
...n,
|
|
802
856
|
ref: (t) => {
|
|
803
857
|
typeof a == "function" ? a(t) : a && (a.current = t);
|
|
804
858
|
}
|
|
805
859
|
});
|
|
806
860
|
}
|
|
807
|
-
return
|
|
861
|
+
return Y("div", { ...e, ref: a }, o);
|
|
808
862
|
}
|
|
809
|
-
function
|
|
810
|
-
const [e,
|
|
863
|
+
function Ae({ elementId: o, maxLength: a }) {
|
|
864
|
+
const [e, n] = x(0);
|
|
811
865
|
return C(() => {
|
|
812
|
-
const t = document.getElementById(
|
|
866
|
+
const t = document.getElementById(o);
|
|
813
867
|
if (!t)
|
|
814
868
|
return;
|
|
815
869
|
const r = () => {
|
|
816
870
|
const s = t.value.length;
|
|
817
|
-
|
|
818
|
-
const
|
|
819
|
-
t.setAttribute("aria-describedby", `${
|
|
871
|
+
n(s);
|
|
872
|
+
const d = s >= a;
|
|
873
|
+
t.setAttribute("aria-describedby", `${o}-character-count`), t.setAttribute("aria-invalid", d ? "true" : "false"), d ? t.setAttribute("data-error", "true") : t.removeAttribute("data-error");
|
|
820
874
|
};
|
|
821
875
|
return r(), t.addEventListener("input", r), t.setAttribute("maxlength", String(a)), () => {
|
|
822
876
|
t.removeEventListener("input", r), t.removeAttribute("maxlength"), t.removeAttribute("aria-describedby"), t.removeAttribute("aria-invalid"), t.removeAttribute("data-error");
|
|
823
877
|
};
|
|
824
|
-
}, [
|
|
878
|
+
}, [o, a]), /* @__PURE__ */ u(
|
|
825
879
|
"small",
|
|
826
880
|
{
|
|
827
881
|
className: w(
|
|
@@ -830,7 +884,7 @@ function xe({ elementId: n, maxLength: a }) {
|
|
|
830
884
|
e < a && "text-current"
|
|
831
885
|
),
|
|
832
886
|
role: "status",
|
|
833
|
-
children: /* @__PURE__ */
|
|
887
|
+
children: /* @__PURE__ */ E("span", { id: `${o}-character-count`, children: [
|
|
834
888
|
e,
|
|
835
889
|
" / ",
|
|
836
890
|
a,
|
|
@@ -839,179 +893,279 @@ function xe({ elementId: n, maxLength: a }) {
|
|
|
839
893
|
}
|
|
840
894
|
);
|
|
841
895
|
}
|
|
842
|
-
function
|
|
896
|
+
function Ie(o, a) {
|
|
843
897
|
C(() => {
|
|
844
|
-
const e = document.getElementById(
|
|
898
|
+
const e = document.getElementById(o);
|
|
845
899
|
if (!e)
|
|
846
900
|
return;
|
|
847
901
|
if (!a) {
|
|
848
902
|
e.style.height = "auto";
|
|
849
903
|
return;
|
|
850
904
|
}
|
|
851
|
-
const
|
|
905
|
+
const n = () => {
|
|
852
906
|
e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
|
|
853
907
|
};
|
|
854
|
-
return
|
|
855
|
-
e.removeEventListener("input",
|
|
908
|
+
return n(), e.addEventListener("input", n), e.addEventListener("resize", n), window.addEventListener("resize", n), () => {
|
|
909
|
+
e.removeEventListener("input", n), e.removeEventListener("resize", n), window.removeEventListener("resize", n);
|
|
856
910
|
};
|
|
857
|
-
}, [
|
|
911
|
+
}, [o, a]);
|
|
858
912
|
}
|
|
859
|
-
const
|
|
913
|
+
const $e = {
|
|
860
914
|
base: "",
|
|
861
915
|
"left-line": "border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success",
|
|
862
916
|
outline: "border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"
|
|
863
|
-
},
|
|
917
|
+
}, Te = {
|
|
864
918
|
none: "rounded-none",
|
|
865
919
|
sm: "rounded-sm",
|
|
866
920
|
md: "rounded-md",
|
|
867
921
|
lg: "rounded-lg",
|
|
868
922
|
full: "px-3 rounded-full"
|
|
869
|
-
},
|
|
923
|
+
}, X = {
|
|
870
924
|
variant: "outline",
|
|
871
925
|
rounded: "none"
|
|
872
926
|
};
|
|
873
|
-
function
|
|
874
|
-
variant:
|
|
927
|
+
function Ye({
|
|
928
|
+
variant: o = X.variant,
|
|
875
929
|
rounded: a,
|
|
876
930
|
displayOnlyMode: e = !1,
|
|
877
|
-
errorMessage:
|
|
931
|
+
errorMessage: n,
|
|
878
932
|
successMessage: t,
|
|
879
933
|
hideResizeHandle: r = !1,
|
|
880
934
|
autoExpand: s = !1,
|
|
881
|
-
characterLimit:
|
|
882
|
-
className:
|
|
883
|
-
...
|
|
935
|
+
characterLimit: d = 0,
|
|
936
|
+
className: c,
|
|
937
|
+
...l
|
|
884
938
|
}) {
|
|
885
|
-
const
|
|
886
|
-
|
|
939
|
+
const b = I();
|
|
940
|
+
Ie(b, s || e);
|
|
887
941
|
let i = a;
|
|
888
|
-
|
|
889
|
-
let
|
|
890
|
-
(e ||
|
|
942
|
+
o === "outline" && !a && (i = "md"), i = i || X.rounded;
|
|
943
|
+
let v = r;
|
|
944
|
+
(e || o === "left-line" && !r) && (v = !0);
|
|
891
945
|
const m = w(
|
|
892
946
|
"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",
|
|
893
|
-
!e &&
|
|
894
|
-
!e &&
|
|
947
|
+
!e && $e[o],
|
|
948
|
+
!e && Te[i],
|
|
895
949
|
!e && "px-2 py-1",
|
|
896
950
|
e && "pointer-events-none",
|
|
897
|
-
|
|
898
|
-
|
|
951
|
+
v && "no-resize-handle",
|
|
952
|
+
c
|
|
899
953
|
);
|
|
900
|
-
return /* @__PURE__ */
|
|
901
|
-
/* @__PURE__ */
|
|
954
|
+
return /* @__PURE__ */ E("div", { className: w("-space-y-1.5", e && "cursor-text"), children: [
|
|
955
|
+
/* @__PURE__ */ u(
|
|
902
956
|
"textarea",
|
|
903
957
|
{
|
|
904
|
-
...
|
|
905
|
-
id:
|
|
906
|
-
"aria-disabled":
|
|
958
|
+
...l,
|
|
959
|
+
id: b,
|
|
960
|
+
"aria-disabled": l.disabled,
|
|
907
961
|
readOnly: e,
|
|
908
|
-
"aria-readonly": e ||
|
|
962
|
+
"aria-readonly": e || l["aria-readonly"],
|
|
909
963
|
style: {
|
|
910
964
|
resize: s ? "none" : void 0
|
|
911
965
|
},
|
|
912
966
|
className: m
|
|
913
967
|
}
|
|
914
968
|
),
|
|
915
|
-
|
|
916
|
-
!e && /* @__PURE__ */
|
|
917
|
-
!e && /* @__PURE__ */
|
|
969
|
+
d > 0 && /* @__PURE__ */ u(Ae, { elementId: b, maxLength: d }),
|
|
970
|
+
!e && /* @__PURE__ */ u(S, { elementId: b, type: "error", message: n }),
|
|
971
|
+
!e && /* @__PURE__ */ u(S, { elementId: b, type: "success", message: t })
|
|
918
972
|
] });
|
|
919
973
|
}
|
|
920
|
-
const
|
|
921
|
-
|
|
974
|
+
const De = {
|
|
975
|
+
sm: {
|
|
976
|
+
container: "h-5 min-w-9 w-9",
|
|
977
|
+
thumb: "h-4 w-4",
|
|
978
|
+
translate: "translate-x-4"
|
|
979
|
+
},
|
|
980
|
+
md: {
|
|
981
|
+
container: "h-6 min-w-11 w-11",
|
|
982
|
+
thumb: "h-5 w-5",
|
|
983
|
+
translate: "translate-x-5"
|
|
984
|
+
},
|
|
985
|
+
lg: {
|
|
986
|
+
container: "h-7 min-w-13 w-13",
|
|
987
|
+
thumb: "h-6 w-6",
|
|
988
|
+
translate: "translate-x-6"
|
|
989
|
+
}
|
|
990
|
+
}, ze = {
|
|
991
|
+
default: {
|
|
992
|
+
unchecked: "bg-muted",
|
|
993
|
+
checked: "bg-primary"
|
|
994
|
+
},
|
|
995
|
+
success: {
|
|
996
|
+
unchecked: "bg-muted",
|
|
997
|
+
checked: "bg-success"
|
|
998
|
+
},
|
|
999
|
+
destructive: {
|
|
1000
|
+
unchecked: "bg-muted",
|
|
1001
|
+
checked: "bg-destructive"
|
|
1002
|
+
}
|
|
1003
|
+
}, Z = {
|
|
1004
|
+
variant: "default",
|
|
1005
|
+
size: "md"
|
|
1006
|
+
};
|
|
1007
|
+
function Me({
|
|
1008
|
+
ref: o,
|
|
1009
|
+
id: a,
|
|
1010
|
+
size: e = Z.size,
|
|
1011
|
+
variant: n = Z.variant,
|
|
1012
|
+
checked: t,
|
|
1013
|
+
onCheckedChange: r,
|
|
1014
|
+
disabled: s = !1,
|
|
1015
|
+
className: d,
|
|
1016
|
+
thumbClassName: c,
|
|
1017
|
+
backgroundClassNames: l,
|
|
1018
|
+
...b
|
|
1019
|
+
}) {
|
|
1020
|
+
const i = I(), v = W(() => a || `toggle-${i}`, [a, i]), [f, m] = x(t);
|
|
1021
|
+
C(() => {
|
|
1022
|
+
m(t);
|
|
1023
|
+
}, [t]);
|
|
1024
|
+
const g = () => {
|
|
1025
|
+
if (!s) {
|
|
1026
|
+
const $ = !f;
|
|
1027
|
+
t === void 0 && m($), r == null || r($);
|
|
1028
|
+
}
|
|
1029
|
+
}, h = ($) => {
|
|
1030
|
+
($.key === " " || $.key === "Enter") && ($.preventDefault(), g());
|
|
1031
|
+
}, y = De[e], p = ze[n], N = w(
|
|
1032
|
+
// Base styles
|
|
1033
|
+
"relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out",
|
|
1034
|
+
"focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
1035
|
+
// Size
|
|
1036
|
+
y.container,
|
|
1037
|
+
// Variant and state
|
|
1038
|
+
f ? (l == null ? void 0 : l.checked) || p.checked : (l == null ? void 0 : l.unchecked) || p.unchecked,
|
|
1039
|
+
// Disabled state
|
|
1040
|
+
s && "opacity-50 cursor-not-allowed",
|
|
1041
|
+
!s && "cursor-pointer",
|
|
1042
|
+
d
|
|
1043
|
+
), D = w(
|
|
1044
|
+
// Base thumb styles
|
|
1045
|
+
"absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out",
|
|
1046
|
+
// Size
|
|
1047
|
+
y.thumb,
|
|
1048
|
+
// Position based on state
|
|
1049
|
+
f && y.translate,
|
|
1050
|
+
c
|
|
1051
|
+
);
|
|
1052
|
+
return /* @__PURE__ */ E(
|
|
1053
|
+
"button",
|
|
1054
|
+
{
|
|
1055
|
+
ref: o,
|
|
1056
|
+
id: v,
|
|
1057
|
+
type: "button",
|
|
1058
|
+
role: "switch",
|
|
1059
|
+
tabIndex: 0,
|
|
1060
|
+
"aria-checked": f,
|
|
1061
|
+
"aria-disabled": s,
|
|
1062
|
+
disabled: s,
|
|
1063
|
+
onClick: g,
|
|
1064
|
+
onKeyDown: h,
|
|
1065
|
+
className: N,
|
|
1066
|
+
...b,
|
|
1067
|
+
children: [
|
|
1068
|
+
/* @__PURE__ */ u("span", { className: D }),
|
|
1069
|
+
/* @__PURE__ */ u("span", { className: "sr-only", children: f ? "Enabled" : "Disabled" })
|
|
1070
|
+
]
|
|
1071
|
+
}
|
|
1072
|
+
);
|
|
1073
|
+
}
|
|
1074
|
+
const R = 8, B = 4, T = 6;
|
|
1075
|
+
function ke(o) {
|
|
922
1076
|
return { calculatePosition: A(
|
|
923
|
-
(e,
|
|
924
|
-
const t = e.getBoundingClientRect(), r =
|
|
1077
|
+
(e, n) => {
|
|
1078
|
+
const t = e.getBoundingClientRect(), r = n.getBoundingClientRect(), s = {
|
|
925
1079
|
width: window.innerWidth,
|
|
926
1080
|
height: window.innerHeight
|
|
927
|
-
},
|
|
1081
|
+
}, d = (v, f, m, g) => v < 0 || f < 0 || v + m > s.width || f + g > s.height, c = {
|
|
928
1082
|
top: {
|
|
929
1083
|
x: t.left + t.width / 2 - r.width / 2,
|
|
930
|
-
y: t.top - r.height -
|
|
1084
|
+
y: t.top - r.height - B,
|
|
931
1085
|
arrow: {
|
|
932
|
-
x: r.width / 2 -
|
|
1086
|
+
x: r.width / 2 - T,
|
|
933
1087
|
y: r.height
|
|
934
1088
|
}
|
|
935
1089
|
},
|
|
936
1090
|
bottom: {
|
|
937
1091
|
x: t.left + t.width / 2 - r.width / 2,
|
|
938
|
-
y: t.bottom +
|
|
1092
|
+
y: t.bottom + B,
|
|
939
1093
|
arrow: {
|
|
940
|
-
x: r.width / 2 -
|
|
1094
|
+
x: r.width / 2 - T,
|
|
941
1095
|
y: -6
|
|
942
1096
|
}
|
|
943
1097
|
},
|
|
944
1098
|
left: {
|
|
945
|
-
x: t.left - r.width -
|
|
1099
|
+
x: t.left - r.width - B,
|
|
946
1100
|
y: t.top + t.height / 2 - r.height / 2,
|
|
947
1101
|
arrow: {
|
|
948
1102
|
x: r.width,
|
|
949
|
-
y: r.height / 2 -
|
|
1103
|
+
y: r.height / 2 - T
|
|
950
1104
|
}
|
|
951
1105
|
},
|
|
952
1106
|
right: {
|
|
953
|
-
x: t.right +
|
|
1107
|
+
x: t.right + B,
|
|
954
1108
|
y: t.top + t.height / 2 - r.height / 2,
|
|
955
1109
|
arrow: {
|
|
956
1110
|
x: -6,
|
|
957
|
-
y: r.height / 2 -
|
|
1111
|
+
y: r.height / 2 - T
|
|
958
1112
|
}
|
|
959
1113
|
}
|
|
960
1114
|
};
|
|
961
|
-
let
|
|
962
|
-
if (
|
|
963
|
-
const
|
|
1115
|
+
let l = o, b = c[o];
|
|
1116
|
+
if (d(b.x, b.y, r.width, r.height)) {
|
|
1117
|
+
const v = {
|
|
964
1118
|
top: "bottom",
|
|
965
1119
|
bottom: "top",
|
|
966
1120
|
left: "right",
|
|
967
1121
|
right: "left"
|
|
968
|
-
},
|
|
969
|
-
if (!
|
|
970
|
-
|
|
1122
|
+
}, f = c[v[o]];
|
|
1123
|
+
if (!d(f.x, f.y, r.width, r.height))
|
|
1124
|
+
l = v[o], b = f;
|
|
971
1125
|
else {
|
|
972
1126
|
const m = ["top", "bottom", "left", "right"].filter(
|
|
973
|
-
(
|
|
1127
|
+
(g) => g !== o && g !== v[o]
|
|
974
1128
|
);
|
|
975
|
-
for (const
|
|
976
|
-
const h =
|
|
977
|
-
if (!
|
|
978
|
-
|
|
1129
|
+
for (const g of m) {
|
|
1130
|
+
const h = c[g];
|
|
1131
|
+
if (!d(h.x, h.y, r.width, r.height)) {
|
|
1132
|
+
l = g, b = h;
|
|
979
1133
|
break;
|
|
980
1134
|
}
|
|
981
1135
|
}
|
|
982
1136
|
}
|
|
983
1137
|
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
Math.min(
|
|
987
|
-
),
|
|
988
|
-
|
|
989
|
-
Math.min(
|
|
1138
|
+
b.x = Math.max(
|
|
1139
|
+
R,
|
|
1140
|
+
Math.min(b.x, s.width - r.width - R)
|
|
1141
|
+
), b.y = Math.max(
|
|
1142
|
+
R,
|
|
1143
|
+
Math.min(b.y, s.height - r.height - R)
|
|
990
1144
|
);
|
|
991
1145
|
const i = {
|
|
992
1146
|
x: t.left + t.width / 2,
|
|
993
1147
|
y: t.top + t.height / 2
|
|
994
1148
|
};
|
|
995
|
-
return
|
|
996
|
-
|
|
997
|
-
Math.min(i.x -
|
|
998
|
-
) :
|
|
999
|
-
|
|
1000
|
-
Math.min(i.y -
|
|
1149
|
+
return l === "top" || l === "bottom" ? b.arrow.x = Math.max(
|
|
1150
|
+
T,
|
|
1151
|
+
Math.min(i.x - b.x - T, r.width - T * 2)
|
|
1152
|
+
) : b.arrow.y = Math.max(
|
|
1153
|
+
T,
|
|
1154
|
+
Math.min(i.y - b.y - T, r.height - T * 2)
|
|
1001
1155
|
), {
|
|
1002
|
-
...
|
|
1003
|
-
placement:
|
|
1156
|
+
...b,
|
|
1157
|
+
placement: l
|
|
1004
1158
|
};
|
|
1005
1159
|
},
|
|
1006
|
-
[
|
|
1160
|
+
[o]
|
|
1007
1161
|
) };
|
|
1008
1162
|
}
|
|
1009
|
-
function
|
|
1010
|
-
const
|
|
1011
|
-
if (!
|
|
1012
|
-
const s = n
|
|
1163
|
+
function Le(o, a, e) {
|
|
1164
|
+
const n = j(null), t = j(null), r = A(() => {
|
|
1165
|
+
if (!n.current || !t.current) return;
|
|
1166
|
+
const s = o(n.current, t.current);
|
|
1013
1167
|
e(s);
|
|
1014
|
-
}, [
|
|
1168
|
+
}, [o, e]);
|
|
1015
1169
|
return C(() => {
|
|
1016
1170
|
if (!a) return;
|
|
1017
1171
|
const s = () => r();
|
|
@@ -1019,97 +1173,97 @@ function Ie(n, a, e) {
|
|
|
1019
1173
|
window.removeEventListener("resize", s);
|
|
1020
1174
|
};
|
|
1021
1175
|
}, [a, r]), {
|
|
1022
|
-
triggerRef:
|
|
1176
|
+
triggerRef: n,
|
|
1023
1177
|
tooltipRef: t,
|
|
1024
1178
|
updatePosition: r
|
|
1025
1179
|
};
|
|
1026
1180
|
}
|
|
1027
|
-
function
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1181
|
+
function Re(o, a, e, n, t, r, s, d, c) {
|
|
1182
|
+
const l = j(null), b = A(() => {
|
|
1183
|
+
o || (l.current && clearTimeout(l.current), l.current = window.setTimeout(() => {
|
|
1030
1184
|
e(!0), requestAnimationFrame(() => {
|
|
1031
|
-
t(),
|
|
1185
|
+
t(), n(!0);
|
|
1032
1186
|
});
|
|
1033
1187
|
}, a));
|
|
1034
|
-
}, [
|
|
1035
|
-
(
|
|
1036
|
-
if (
|
|
1037
|
-
|
|
1188
|
+
}, [o, a, e, t, n]), i = A(
|
|
1189
|
+
(v = !1) => {
|
|
1190
|
+
if (l.current && clearTimeout(l.current), v) {
|
|
1191
|
+
n(!1), setTimeout(() => e(!1), 150);
|
|
1038
1192
|
return;
|
|
1039
1193
|
}
|
|
1040
|
-
|
|
1041
|
-
|
|
1194
|
+
l.current = window.setTimeout(() => {
|
|
1195
|
+
n(!1), setTimeout(() => e(!1), 150);
|
|
1042
1196
|
}, 100);
|
|
1043
1197
|
},
|
|
1044
|
-
[
|
|
1198
|
+
[n, e]
|
|
1045
1199
|
);
|
|
1046
1200
|
return C(() => {
|
|
1047
|
-
!r && !s && !
|
|
1048
|
-
}, [r, s,
|
|
1049
|
-
|
|
1201
|
+
!r && !s && !d && c && i();
|
|
1202
|
+
}, [r, s, d, c, i]), C(() => () => {
|
|
1203
|
+
l.current && clearTimeout(l.current);
|
|
1050
1204
|
}, []), {
|
|
1051
|
-
showTooltip:
|
|
1205
|
+
showTooltip: b,
|
|
1052
1206
|
hideTooltip: i,
|
|
1053
|
-
timeoutRef:
|
|
1207
|
+
timeoutRef: l
|
|
1054
1208
|
};
|
|
1055
1209
|
}
|
|
1056
|
-
function
|
|
1057
|
-
id:
|
|
1210
|
+
function Oe({
|
|
1211
|
+
id: o,
|
|
1058
1212
|
children: a,
|
|
1059
1213
|
message: e,
|
|
1060
|
-
placement:
|
|
1214
|
+
placement: n = "top",
|
|
1061
1215
|
disabled: t = !1,
|
|
1062
1216
|
delay: r = 200,
|
|
1063
1217
|
className: s
|
|
1064
1218
|
}) {
|
|
1065
|
-
const [
|
|
1219
|
+
const [d, c] = x(!1), [l, b] = x(!1), [i, v] = x(null), [f, m] = x(!1), [g, h] = x(!1), [y, p] = x(!1), { calculatePosition: N } = ke(n), { triggerRef: D, tooltipRef: $, updatePosition: F } = Le(N, l, v), { showTooltip: k, hideTooltip: L, timeoutRef: U } = Re(
|
|
1066
1220
|
t,
|
|
1067
1221
|
r,
|
|
1068
|
-
f,
|
|
1069
|
-
d,
|
|
1070
|
-
S,
|
|
1071
1222
|
b,
|
|
1072
|
-
|
|
1223
|
+
c,
|
|
1224
|
+
F,
|
|
1225
|
+
f,
|
|
1226
|
+
g,
|
|
1073
1227
|
y,
|
|
1074
|
-
|
|
1075
|
-
),
|
|
1076
|
-
return /* @__PURE__ */
|
|
1077
|
-
|
|
1078
|
-
ref: (
|
|
1079
|
-
D.current =
|
|
1228
|
+
d
|
|
1229
|
+
), O = I(), _ = o ?? O;
|
|
1230
|
+
return /* @__PURE__ */ E(J, { children: [
|
|
1231
|
+
z.cloneElement(a, {
|
|
1232
|
+
ref: (V) => {
|
|
1233
|
+
D.current = V;
|
|
1080
1234
|
},
|
|
1081
1235
|
onMouseEnter: () => {
|
|
1082
|
-
m(!0),
|
|
1236
|
+
m(!0), k();
|
|
1083
1237
|
},
|
|
1084
1238
|
onMouseLeave: () => {
|
|
1085
1239
|
m(!1);
|
|
1086
1240
|
},
|
|
1087
1241
|
onFocus: () => {
|
|
1088
|
-
p(!0),
|
|
1242
|
+
p(!0), k();
|
|
1089
1243
|
},
|
|
1090
1244
|
onBlur: () => {
|
|
1091
|
-
p(!1),
|
|
1245
|
+
p(!1), L(!0);
|
|
1092
1246
|
},
|
|
1093
|
-
onKeyDown: (
|
|
1094
|
-
|
|
1247
|
+
onKeyDown: (V) => {
|
|
1248
|
+
V.key === "Escape" && L(!0);
|
|
1095
1249
|
},
|
|
1096
|
-
"aria-describedby": t ? void 0 :
|
|
1250
|
+
"aria-describedby": t ? void 0 : _
|
|
1097
1251
|
}),
|
|
1098
|
-
|
|
1099
|
-
/* @__PURE__ */
|
|
1252
|
+
l && M(
|
|
1253
|
+
/* @__PURE__ */ u(
|
|
1100
1254
|
"div",
|
|
1101
1255
|
{
|
|
1102
|
-
ref:
|
|
1103
|
-
id:
|
|
1256
|
+
ref: $,
|
|
1257
|
+
id: _,
|
|
1104
1258
|
role: "tooltip",
|
|
1105
1259
|
className: w(
|
|
1106
1260
|
"fixed z-50 px-2 py-1 text-sm rounded shadow-lg pointer-events-auto transition-all duration-150 ease-out",
|
|
1107
|
-
|
|
1261
|
+
d ? "opacity-100" : "opacity-0",
|
|
1108
1262
|
s
|
|
1109
1263
|
),
|
|
1110
1264
|
style: i ? { left: i.x, top: i.y } : { opacity: 0 },
|
|
1111
1265
|
onMouseEnter: () => {
|
|
1112
|
-
h(!0),
|
|
1266
|
+
h(!0), U.current && clearTimeout(U.current);
|
|
1113
1267
|
},
|
|
1114
1268
|
onMouseLeave: () => {
|
|
1115
1269
|
h(!1);
|
|
@@ -1122,22 +1276,24 @@ function Ue({
|
|
|
1122
1276
|
] });
|
|
1123
1277
|
}
|
|
1124
1278
|
export {
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1279
|
+
Ke as Accordion,
|
|
1280
|
+
q as AccordionItem,
|
|
1281
|
+
tt as ActionModal,
|
|
1282
|
+
me as Button,
|
|
1283
|
+
de as ButtonLoadingDots,
|
|
1284
|
+
Ge as Checkbox,
|
|
1285
|
+
We as Clickable,
|
|
1286
|
+
Ue as Input,
|
|
1287
|
+
_e as Label,
|
|
1288
|
+
Qe as Modal,
|
|
1289
|
+
Xe as RadioGroup,
|
|
1136
1290
|
G as RadioGroupItem,
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1291
|
+
ye as RadioInput,
|
|
1292
|
+
Ze as Separator,
|
|
1293
|
+
Je as Slot,
|
|
1294
|
+
Ye as Textarea,
|
|
1295
|
+
rt as Toast,
|
|
1296
|
+
Me as Toggle,
|
|
1297
|
+
Oe as Tooltip
|
|
1142
1298
|
};
|
|
1143
1299
|
//# sourceMappingURL=components.esm.js.map
|