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