tailwind-ux-kit 1.0.49 → 1.0.51
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/lib/components/Accordion.d.ts +2 -1
- package/lib/tailwind-ux-kit.es.js +203 -202
- package/lib/tailwind-ux-kit.umd.js +8 -8
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ interface AccordionProps<T extends AccordionItemBase> {
|
|
|
11
11
|
className?: string;
|
|
12
12
|
tileClasses?: string;
|
|
13
13
|
open?: (string | number)[];
|
|
14
|
+
showArrowIcon?: boolean;
|
|
14
15
|
onChange?: (openItems: (string | number)[]) => void;
|
|
15
16
|
/**
|
|
16
17
|
* Optional custom renderer for the title, gets the item and whether it's open
|
|
@@ -21,5 +22,5 @@ interface AccordionProps<T extends AccordionItemBase> {
|
|
|
21
22
|
*/
|
|
22
23
|
renderContent?: (item: T, isOpen: boolean) => React.ReactNode;
|
|
23
24
|
}
|
|
24
|
-
declare const Accordion: <T extends AccordionItemBase>({ items, allowMultipleOpen, className, tileClasses, open: controlledOpen, onChange, renderTitle, renderContent, }: AccordionProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare const Accordion: <T extends AccordionItemBase>({ items, allowMultipleOpen, className, tileClasses, open: controlledOpen, onChange, renderTitle, renderContent, showArrowIcon, }: AccordionProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
25
26
|
export default Accordion;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as y, jsx as f } from "react/jsx-runtime";
|
|
3
3
|
import P, { forwardRef as q, useState as L, useMemo as $, useId as se, useRef as M, useCallback as E, useEffect as A, createContext as X, useContext as Y } from "react";
|
|
4
4
|
const H = {
|
|
5
5
|
xs: "text-xs px-2 py-1",
|
|
@@ -38,75 +38,75 @@ const H = {
|
|
|
38
38
|
label: t,
|
|
39
39
|
id: r,
|
|
40
40
|
inputSize: s = "md",
|
|
41
|
-
shape:
|
|
42
|
-
validate:
|
|
41
|
+
shape: p = "rounded",
|
|
42
|
+
validate: u,
|
|
43
43
|
onValidatedChange: c,
|
|
44
|
-
className:
|
|
45
|
-
icon:
|
|
44
|
+
className: i = "",
|
|
45
|
+
icon: d,
|
|
46
46
|
iconPosition: o = "left",
|
|
47
|
-
floatingLabelStyle:
|
|
48
|
-
onChange:
|
|
49
|
-
isValid:
|
|
50
|
-
isInvalid:
|
|
47
|
+
floatingLabelStyle: l,
|
|
48
|
+
onChange: b,
|
|
49
|
+
isValid: a,
|
|
50
|
+
isInvalid: g,
|
|
51
51
|
feedback: x,
|
|
52
|
-
feedbackType:
|
|
52
|
+
feedbackType: h = "invalid",
|
|
53
53
|
...w
|
|
54
54
|
} = e, [S, N] = L("default"), O = P.useCallback(
|
|
55
55
|
(z) => {
|
|
56
|
-
const Z = z.target.value, I = (
|
|
57
|
-
N(I), c == null || c(z, I),
|
|
56
|
+
const Z = z.target.value, I = (u == null ? void 0 : u(Z)) ?? "default";
|
|
57
|
+
N(I), c == null || c(z, I), b == null || b(z);
|
|
58
58
|
},
|
|
59
|
-
[
|
|
60
|
-
), v = $(() => r || (typeof t == "string" ? `input-${t.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [r, t]),
|
|
61
|
-
() => ie(S,
|
|
62
|
-
[S,
|
|
63
|
-
), _ = $(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), B = $(() =>
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
!
|
|
59
|
+
[u, c, b]
|
|
60
|
+
), v = $(() => r || (typeof t == "string" ? `input-${t.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [r, t]), m = !!l, C = H[s] || H.md, k = W[p] || W.flat, j = $(
|
|
61
|
+
() => ie(S, a, g),
|
|
62
|
+
[S, a, g]
|
|
63
|
+
), _ = $(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), B = $(() => d ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [d, o]);
|
|
64
|
+
return /* @__PURE__ */ y("div", { className: `w-full relative ${m ? "z-0" : ""}`, children: [
|
|
65
|
+
!m && t && /* @__PURE__ */ f(
|
|
66
66
|
"label",
|
|
67
67
|
{
|
|
68
68
|
htmlFor: v,
|
|
69
|
-
className: `block mb-1 text-sm ${
|
|
69
|
+
className: `block mb-1 text-sm ${a ? "text-green-700 dark:text-green-500" : g ? "text-red-700 dark:text-red-500" : "text-gray-700"}`,
|
|
70
70
|
children: t
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
|
|
73
|
+
/* @__PURE__ */ y("div", { className: "relative w-full", children: [
|
|
74
|
+
d && /* @__PURE__ */ f(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
77
|
className: `absolute inset-y-0 flex items-center ${_}`,
|
|
78
78
|
"aria-hidden": "true",
|
|
79
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ f("span", { className: "text-gray-500", children: d })
|
|
80
80
|
}
|
|
81
81
|
),
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ f(
|
|
83
83
|
"input",
|
|
84
84
|
{
|
|
85
85
|
...w,
|
|
86
86
|
id: v,
|
|
87
87
|
ref: n,
|
|
88
|
-
placeholder:
|
|
88
|
+
placeholder: m ? " " : w.placeholder,
|
|
89
89
|
onChange: O,
|
|
90
90
|
className: `border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
|
|
91
91
|
${C}
|
|
92
|
-
${
|
|
93
|
-
${B} ${k} ${j} ${
|
|
92
|
+
${m && l && ae[l]}
|
|
93
|
+
${B} ${k} ${j} ${i}`
|
|
94
94
|
}
|
|
95
95
|
),
|
|
96
|
-
|
|
96
|
+
m && t && l && /* @__PURE__ */ f(
|
|
97
97
|
"label",
|
|
98
98
|
{
|
|
99
99
|
htmlFor: v,
|
|
100
|
-
className: `ms-1 ${le[
|
|
100
|
+
className: `ms-1 ${le[l]} ${i}`,
|
|
101
101
|
children: t
|
|
102
102
|
}
|
|
103
103
|
)
|
|
104
104
|
] }),
|
|
105
|
-
x && /* @__PURE__ */
|
|
105
|
+
x && /* @__PURE__ */ f(
|
|
106
106
|
"p",
|
|
107
107
|
{
|
|
108
|
-
className: `mt-1 text-xs ${
|
|
109
|
-
role:
|
|
108
|
+
className: `mt-1 text-xs ${h === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
|
|
109
|
+
role: h === "invalid" ? "alert" : void 0,
|
|
110
110
|
children: x
|
|
111
111
|
}
|
|
112
112
|
)
|
|
@@ -151,68 +151,68 @@ const de = {
|
|
|
151
151
|
label: t,
|
|
152
152
|
id: r,
|
|
153
153
|
inputSize: s = "md",
|
|
154
|
-
shape:
|
|
155
|
-
validate:
|
|
154
|
+
shape: p = "rounded",
|
|
155
|
+
validate: u,
|
|
156
156
|
onValidatedChange: c,
|
|
157
|
-
className:
|
|
158
|
-
icon:
|
|
157
|
+
className: i = "",
|
|
158
|
+
icon: d,
|
|
159
159
|
iconPosition: o = "left",
|
|
160
|
-
floatingLabelStyle:
|
|
161
|
-
onChange:
|
|
162
|
-
isValid:
|
|
163
|
-
isInvalid:
|
|
160
|
+
floatingLabelStyle: l,
|
|
161
|
+
onChange: b,
|
|
162
|
+
isValid: a,
|
|
163
|
+
isInvalid: g,
|
|
164
164
|
feedback: x,
|
|
165
|
-
feedbackType:
|
|
165
|
+
feedbackType: h = "invalid",
|
|
166
166
|
children: w,
|
|
167
167
|
...S
|
|
168
|
-
} = e, [N, O] = L("default"), v = se(),
|
|
169
|
-
const oe = I.target.value, G = (
|
|
170
|
-
O(G), c == null || c(I, G),
|
|
171
|
-
}, k = !!
|
|
172
|
-
return /* @__PURE__ */
|
|
173
|
-
!k && t && /* @__PURE__ */
|
|
168
|
+
} = e, [N, O] = L("default"), v = se(), m = $(() => r || (typeof t == "string" ? `select-${t.toLowerCase().replace(/\s+/g, "-")}` : v), [r, t, v]), C = (I) => {
|
|
169
|
+
const oe = I.target.value, G = (u == null ? void 0 : u(oe)) ?? "default";
|
|
170
|
+
O(G), c == null || c(I, G), b == null || b(I);
|
|
171
|
+
}, k = !!l, j = de[s], _ = ue[p], B = ge(N, a, g);
|
|
172
|
+
return /* @__PURE__ */ y("div", { className: `w-full relative ${k ? "z-0" : ""}`, children: [
|
|
173
|
+
!k && t && /* @__PURE__ */ f(
|
|
174
174
|
"label",
|
|
175
175
|
{
|
|
176
|
-
htmlFor:
|
|
177
|
-
className: `block mb-1 text-sm ${
|
|
176
|
+
htmlFor: m,
|
|
177
|
+
className: `block mb-1 text-sm ${a ? "text-green-700" : g ? "text-red-700" : "text-gray-700"}`,
|
|
178
178
|
children: t
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
|
|
181
|
+
/* @__PURE__ */ y("div", { className: "relative w-full", children: [
|
|
182
|
+
d && /* @__PURE__ */ f(
|
|
183
183
|
"div",
|
|
184
184
|
{
|
|
185
185
|
className: `absolute inset-y-0 flex items-center ${o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5"}`,
|
|
186
|
-
children: /* @__PURE__ */
|
|
186
|
+
children: /* @__PURE__ */ f("span", { className: "text-gray-500", children: d })
|
|
187
187
|
}
|
|
188
188
|
),
|
|
189
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ f(
|
|
190
190
|
"select",
|
|
191
191
|
{
|
|
192
192
|
...S,
|
|
193
|
-
id:
|
|
193
|
+
id: m,
|
|
194
194
|
ref: n,
|
|
195
195
|
onChange: C,
|
|
196
196
|
className: `border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-600 placeholder-[#798ba5] border-gray-400
|
|
197
|
-
${j} ${
|
|
198
|
-
${k &&
|
|
199
|
-
${_} ${B} ${
|
|
197
|
+
${j} ${d && (o === "start" || o === "left") ? "ps-10" : d ? "pe-10" : ""}
|
|
198
|
+
${k && l && fe[l]}
|
|
199
|
+
${_} ${B} ${i}`,
|
|
200
200
|
children: w
|
|
201
201
|
}
|
|
202
202
|
),
|
|
203
|
-
k && t &&
|
|
203
|
+
k && t && l && /* @__PURE__ */ f(
|
|
204
204
|
"label",
|
|
205
205
|
{
|
|
206
|
-
htmlFor:
|
|
207
|
-
className: `ms-1 ${pe[
|
|
206
|
+
htmlFor: m,
|
|
207
|
+
className: `ms-1 ${pe[l]} ${i}`,
|
|
208
208
|
children: t
|
|
209
209
|
}
|
|
210
210
|
)
|
|
211
211
|
] }),
|
|
212
|
-
x && /* @__PURE__ */
|
|
212
|
+
x && /* @__PURE__ */ f(
|
|
213
213
|
"p",
|
|
214
214
|
{
|
|
215
|
-
className: `mt-1 text-xs ${
|
|
215
|
+
className: `mt-1 text-xs ${h === "invalid" ? "text-red-600" : "text-green-600"}`,
|
|
216
216
|
children: x
|
|
217
217
|
}
|
|
218
218
|
)
|
|
@@ -262,22 +262,22 @@ const me = {
|
|
|
262
262
|
size: t = "md",
|
|
263
263
|
type: r = "button",
|
|
264
264
|
shape: s = "rounded",
|
|
265
|
-
className:
|
|
266
|
-
isLoading:
|
|
265
|
+
className: p = "",
|
|
266
|
+
isLoading: u = !1,
|
|
267
267
|
disabled: c = !1,
|
|
268
|
-
...
|
|
268
|
+
...i
|
|
269
269
|
}) => {
|
|
270
|
-
const
|
|
270
|
+
const d = c || u, o = [
|
|
271
271
|
"inline-flex items-center justify-center font-normal transition duration-150",
|
|
272
272
|
me[n],
|
|
273
273
|
xe[t],
|
|
274
274
|
he[s],
|
|
275
275
|
s === "flat" ? "shadow-none" : "shadow-sm",
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
d ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
277
|
+
p
|
|
278
278
|
].filter(Boolean).join(" ");
|
|
279
|
-
return /* @__PURE__ */
|
|
280
|
-
|
|
279
|
+
return /* @__PURE__ */ y("button", { type: r, className: o, disabled: d, ...i, children: [
|
|
280
|
+
u && /* @__PURE__ */ y(
|
|
281
281
|
"svg",
|
|
282
282
|
{
|
|
283
283
|
"aria-hidden": "true",
|
|
@@ -287,14 +287,14 @@ const me = {
|
|
|
287
287
|
fill: "none",
|
|
288
288
|
xmlns: "http://www.w3.org/2000/svg",
|
|
289
289
|
children: [
|
|
290
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ f(
|
|
291
291
|
"path",
|
|
292
292
|
{
|
|
293
293
|
d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
|
|
294
294
|
fill: "currentColor"
|
|
295
295
|
}
|
|
296
296
|
),
|
|
297
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ f(
|
|
298
298
|
"path",
|
|
299
299
|
{
|
|
300
300
|
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
@@ -311,7 +311,7 @@ const me = {
|
|
|
311
311
|
children: n,
|
|
312
312
|
position: t = "right"
|
|
313
313
|
}) => {
|
|
314
|
-
const [r, s] = L(!1), [
|
|
314
|
+
const [r, s] = L(!1), [p, u] = L(!1), c = M(null), i = M(null), d = $(() => {
|
|
315
315
|
switch (t) {
|
|
316
316
|
case "left":
|
|
317
317
|
return "left-0";
|
|
@@ -321,32 +321,32 @@ const me = {
|
|
|
321
321
|
default:
|
|
322
322
|
return "right-0";
|
|
323
323
|
}
|
|
324
|
-
}, [t]), o = E((
|
|
325
|
-
const
|
|
326
|
-
c.current && !c.current.contains(
|
|
327
|
-
}, []),
|
|
328
|
-
if (!
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
x <
|
|
324
|
+
}, [t]), o = E((a) => {
|
|
325
|
+
const g = a.target;
|
|
326
|
+
c.current && !c.current.contains(g) && i.current && !i.current.contains(g) && s(!1);
|
|
327
|
+
}, []), l = E(() => {
|
|
328
|
+
if (!i.current || !c.current) return;
|
|
329
|
+
const a = i.current.getBoundingClientRect(), g = c.current.getBoundingClientRect(), x = window.innerHeight - a.bottom, h = a.top;
|
|
330
|
+
u(
|
|
331
|
+
x < g.height && h > g.height
|
|
332
332
|
);
|
|
333
333
|
}, []);
|
|
334
334
|
A(() => {
|
|
335
335
|
if (r)
|
|
336
|
-
return
|
|
337
|
-
window.removeEventListener("resize",
|
|
336
|
+
return l(), window.addEventListener("resize", l), window.addEventListener("scroll", l, !0), () => {
|
|
337
|
+
window.removeEventListener("resize", l), window.removeEventListener("scroll", l, !0);
|
|
338
338
|
};
|
|
339
|
-
}, [r,
|
|
340
|
-
const
|
|
341
|
-
return /* @__PURE__ */
|
|
342
|
-
/* @__PURE__ */
|
|
343
|
-
r && /* @__PURE__ */
|
|
339
|
+
}, [r, l]), A(() => (document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o)), [o]);
|
|
340
|
+
const b = E(() => s((a) => !a), []);
|
|
341
|
+
return /* @__PURE__ */ y("div", { className: "relative flex items-center", children: [
|
|
342
|
+
/* @__PURE__ */ f("button", { ref: i, onClick: b, children: e }),
|
|
343
|
+
r && /* @__PURE__ */ f(
|
|
344
344
|
"div",
|
|
345
345
|
{
|
|
346
346
|
ref: c,
|
|
347
347
|
className: `absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
|
|
348
|
-
${
|
|
349
|
-
${
|
|
348
|
+
${p ? "bottom-full mb-2" : "top-full mt-2"}
|
|
349
|
+
${d}`,
|
|
350
350
|
children: n
|
|
351
351
|
}
|
|
352
352
|
)
|
|
@@ -357,22 +357,22 @@ const me = {
|
|
|
357
357
|
position: t = "top",
|
|
358
358
|
className: r = "",
|
|
359
359
|
tooltipClass: s = "",
|
|
360
|
-
tooltipStyle:
|
|
360
|
+
tooltipStyle: p = {}
|
|
361
361
|
}) => {
|
|
362
|
-
const
|
|
362
|
+
const u = M(null), c = M(null);
|
|
363
363
|
A(() => {
|
|
364
|
-
const
|
|
365
|
-
if (!
|
|
366
|
-
const
|
|
364
|
+
const d = u.current, o = c.current;
|
|
365
|
+
if (!d || !o) return;
|
|
366
|
+
const l = () => {
|
|
367
367
|
o.style.opacity = "1", o.style.visibility = "visible";
|
|
368
|
-
},
|
|
368
|
+
}, b = () => {
|
|
369
369
|
o.style.opacity = "0", o.style.visibility = "hidden";
|
|
370
370
|
};
|
|
371
|
-
return
|
|
372
|
-
|
|
371
|
+
return d.addEventListener("mouseenter", l), d.addEventListener("mouseleave", b), () => {
|
|
372
|
+
d.removeEventListener("mouseenter", l), d.removeEventListener("mouseleave", b);
|
|
373
373
|
};
|
|
374
374
|
}, []);
|
|
375
|
-
const
|
|
375
|
+
const i = (d) => {
|
|
376
376
|
const o = {
|
|
377
377
|
position: "absolute",
|
|
378
378
|
opacity: 0,
|
|
@@ -390,7 +390,7 @@ const me = {
|
|
|
390
390
|
zIndex: 9999,
|
|
391
391
|
width: "max-content"
|
|
392
392
|
};
|
|
393
|
-
switch (
|
|
393
|
+
switch (d) {
|
|
394
394
|
case "top":
|
|
395
395
|
return {
|
|
396
396
|
...o,
|
|
@@ -427,17 +427,17 @@ const me = {
|
|
|
427
427
|
return o;
|
|
428
428
|
}
|
|
429
429
|
};
|
|
430
|
-
return /* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ y("div", { ref: u, className: `relative inline-block ${r}`, children: [
|
|
431
431
|
e,
|
|
432
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ f(
|
|
433
433
|
"div",
|
|
434
434
|
{
|
|
435
435
|
ref: c,
|
|
436
436
|
role: "tooltip",
|
|
437
437
|
className: s,
|
|
438
438
|
style: {
|
|
439
|
-
...
|
|
440
|
-
...
|
|
439
|
+
...i(t),
|
|
440
|
+
...p
|
|
441
441
|
},
|
|
442
442
|
children: n
|
|
443
443
|
}
|
|
@@ -478,20 +478,20 @@ const me = {
|
|
|
478
478
|
size: t = "sm",
|
|
479
479
|
shape: r = "rounded",
|
|
480
480
|
icon: s,
|
|
481
|
-
dismissible:
|
|
482
|
-
onDismiss:
|
|
481
|
+
dismissible: p,
|
|
482
|
+
onDismiss: u,
|
|
483
483
|
className: c = "",
|
|
484
|
-
...
|
|
484
|
+
...i
|
|
485
485
|
}) => {
|
|
486
|
-
const
|
|
487
|
-
return /* @__PURE__ */
|
|
488
|
-
s && /* @__PURE__ */
|
|
486
|
+
const d = !e && !!s, o = `inline-flex items-center font-medium ${ye[n] || ""} ${we[t] || ""} ${ve[r] || ""} ${d ? "justify-center p-2 w-8 h-8" : ""} ` + c;
|
|
487
|
+
return /* @__PURE__ */ y("span", { className: o.trim(), ...i, children: [
|
|
488
|
+
s && /* @__PURE__ */ f("span", { className: e ? "mr-1" : "", children: s }),
|
|
489
489
|
e,
|
|
490
|
-
|
|
490
|
+
p && /* @__PURE__ */ f(
|
|
491
491
|
"button",
|
|
492
492
|
{
|
|
493
493
|
type: "button",
|
|
494
|
-
onClick:
|
|
494
|
+
onClick: u,
|
|
495
495
|
className: "ml-2 text-xs font-bold leading-none focus:outline-none",
|
|
496
496
|
children: "×"
|
|
497
497
|
}
|
|
@@ -509,9 +509,9 @@ function Se(e, n) {
|
|
|
509
509
|
if (e == null) return {};
|
|
510
510
|
var t = Ne(e, n), r, s;
|
|
511
511
|
if (Object.getOwnPropertySymbols) {
|
|
512
|
-
var
|
|
513
|
-
for (s = 0; s <
|
|
514
|
-
r =
|
|
512
|
+
var p = Object.getOwnPropertySymbols(e);
|
|
513
|
+
for (s = 0; s < p.length; s++)
|
|
514
|
+
r = p[s], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
515
515
|
}
|
|
516
516
|
return t;
|
|
517
517
|
}
|
|
@@ -588,21 +588,21 @@ function Le(e) {
|
|
|
588
588
|
var {
|
|
589
589
|
attr: r,
|
|
590
590
|
size: s,
|
|
591
|
-
title:
|
|
592
|
-
} = e,
|
|
593
|
-
return t.className && (
|
|
591
|
+
title: p
|
|
592
|
+
} = e, u = Se(e, Ce), c = s || t.size || "1em", i;
|
|
593
|
+
return t.className && (i = t.className), e.className && (i = (i ? i + " " : "") + e.className), /* @__PURE__ */ P.createElement("svg", D({
|
|
594
594
|
stroke: "currentColor",
|
|
595
595
|
fill: "currentColor",
|
|
596
596
|
strokeWidth: "0"
|
|
597
|
-
}, t.attr, r,
|
|
598
|
-
className:
|
|
597
|
+
}, t.attr, r, u, {
|
|
598
|
+
className: i,
|
|
599
599
|
style: T(T({
|
|
600
600
|
color: e.color || t.color
|
|
601
601
|
}, t.style), e.style),
|
|
602
602
|
height: c,
|
|
603
603
|
width: c,
|
|
604
604
|
xmlns: "http://www.w3.org/2000/svg"
|
|
605
|
-
}),
|
|
605
|
+
}), p && /* @__PURE__ */ P.createElement("title", null, p), e.children);
|
|
606
606
|
};
|
|
607
607
|
return K !== void 0 ? /* @__PURE__ */ P.createElement(K.Consumer, null, (t) => n(t)) : n(J);
|
|
608
608
|
}
|
|
@@ -615,59 +615,60 @@ const Fe = ({
|
|
|
615
615
|
className: t = "",
|
|
616
616
|
tileClasses: r = "",
|
|
617
617
|
open: s,
|
|
618
|
-
onChange:
|
|
619
|
-
renderTitle:
|
|
620
|
-
renderContent: c
|
|
618
|
+
onChange: p,
|
|
619
|
+
renderTitle: u,
|
|
620
|
+
renderContent: c,
|
|
621
|
+
showArrowIcon: i = !0
|
|
621
622
|
}) => {
|
|
622
|
-
const [
|
|
623
|
-
(
|
|
624
|
-
const
|
|
625
|
-
|
|
623
|
+
const [d, o] = L(/* @__PURE__ */ new Set()), l = $(() => s ? new Set(s) : d, [s, d]), b = E(
|
|
624
|
+
(a) => {
|
|
625
|
+
const g = new Set(l);
|
|
626
|
+
g.has(a) ? g.delete(a) : (n || g.clear(), g.add(a)), s && p ? p(Array.from(g)) : o(g);
|
|
626
627
|
},
|
|
627
|
-
[
|
|
628
|
+
[l, s, p, n]
|
|
628
629
|
);
|
|
629
|
-
return /* @__PURE__ */
|
|
630
|
+
return /* @__PURE__ */ f(
|
|
630
631
|
"div",
|
|
631
632
|
{
|
|
632
633
|
className: "accordion",
|
|
633
634
|
role: "region",
|
|
634
635
|
"aria-multiselectable": n,
|
|
635
|
-
children: e.map((
|
|
636
|
-
const
|
|
637
|
-
return /* @__PURE__ */
|
|
636
|
+
children: e.map((a) => {
|
|
637
|
+
const g = l.has(a.id), x = `accordion-heading-${a.id}`, h = `accordion-panel-${a.id}`;
|
|
638
|
+
return /* @__PURE__ */ y(
|
|
638
639
|
"div",
|
|
639
640
|
{
|
|
640
641
|
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,
|
|
641
642
|
children: [
|
|
642
|
-
/* @__PURE__ */
|
|
643
|
+
/* @__PURE__ */ y(
|
|
643
644
|
"button",
|
|
644
645
|
{
|
|
645
|
-
id:
|
|
646
|
+
id: x,
|
|
646
647
|
type: "button",
|
|
647
|
-
"aria-expanded":
|
|
648
|
-
"aria-controls":
|
|
649
|
-
onClick: () =>
|
|
648
|
+
"aria-expanded": g,
|
|
649
|
+
"aria-controls": h,
|
|
650
|
+
onClick: () => b(a.id),
|
|
650
651
|
className: `flex justify-between items-center w-full p-1.5 text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3 ${r}`,
|
|
651
652
|
children: [
|
|
652
|
-
|
|
653
|
-
/* @__PURE__ */
|
|
653
|
+
u ? u(a, g) : a.title,
|
|
654
|
+
i ? /* @__PURE__ */ f(Oe, {}) : null
|
|
654
655
|
]
|
|
655
656
|
}
|
|
656
657
|
),
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ f(
|
|
658
659
|
"div",
|
|
659
660
|
{
|
|
660
|
-
id:
|
|
661
|
+
id: h,
|
|
661
662
|
role: "region",
|
|
662
|
-
"aria-labelledby":
|
|
663
|
-
hidden: !
|
|
663
|
+
"aria-labelledby": x,
|
|
664
|
+
hidden: !g,
|
|
664
665
|
className: "p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",
|
|
665
|
-
children: c ? c(
|
|
666
|
+
children: c ? c(a, g) : a.content
|
|
666
667
|
}
|
|
667
668
|
)
|
|
668
669
|
]
|
|
669
670
|
},
|
|
670
|
-
|
|
671
|
+
a.id
|
|
671
672
|
);
|
|
672
673
|
})
|
|
673
674
|
}
|
|
@@ -686,15 +687,15 @@ function Ze({
|
|
|
686
687
|
children: t,
|
|
687
688
|
standalone: r = !1,
|
|
688
689
|
showFloatingClose: s = !1,
|
|
689
|
-
containerClasses:
|
|
690
|
-
onClose:
|
|
690
|
+
containerClasses: p = "",
|
|
691
|
+
onClose: u,
|
|
691
692
|
disableEscapeClose: c = !1
|
|
692
693
|
}) {
|
|
693
|
-
const
|
|
694
|
-
o ?
|
|
695
|
-
}, [o,
|
|
694
|
+
const i = ne(), d = te(), o = !r && !!i && !!d, [l, b] = L(!1), a = o ? i.isOpen(e) : l, g = o ? i.getModalData(e) : null, x = E(() => {
|
|
695
|
+
o ? d.closeModal(e) : b(!1), u == null || u();
|
|
696
|
+
}, [o, d, e, u]);
|
|
696
697
|
return A(() => {
|
|
697
|
-
const
|
|
698
|
+
const h = document.activeElement;
|
|
698
699
|
console.log(e);
|
|
699
700
|
const w = document.getElementById(e);
|
|
700
701
|
console.log("modalEl=", w);
|
|
@@ -707,39 +708,39 @@ function Ze({
|
|
|
707
708
|
'[tabindex]:not([tabindex="-1"])'
|
|
708
709
|
], N = () => {
|
|
709
710
|
if (!w) return [];
|
|
710
|
-
const
|
|
711
|
+
const m = w.querySelectorAll(
|
|
711
712
|
S.join(",")
|
|
712
713
|
);
|
|
713
|
-
return Array.from(
|
|
714
|
-
}, O = (
|
|
715
|
-
if (
|
|
714
|
+
return Array.from(m).filter((C) => C.offsetParent !== null);
|
|
715
|
+
}, O = (m) => {
|
|
716
|
+
if (m.key === "Tab") {
|
|
716
717
|
const C = N();
|
|
717
718
|
if (C.length === 0) return;
|
|
718
719
|
const k = C[0], j = C[C.length - 1];
|
|
719
|
-
|
|
720
|
+
m.shiftKey ? document.activeElement === k && (m.preventDefault(), j.focus()) : document.activeElement === j && (m.preventDefault(), k.focus());
|
|
720
721
|
}
|
|
721
|
-
}, v = (
|
|
722
|
-
|
|
722
|
+
}, v = (m) => {
|
|
723
|
+
m.key === "Escape" && !c && x(), O(m);
|
|
723
724
|
};
|
|
724
|
-
return
|
|
725
|
-
const
|
|
726
|
-
|
|
725
|
+
return a && (document.body.style.overflow = "hidden", setTimeout(() => {
|
|
726
|
+
const m = N();
|
|
727
|
+
m.length && m[0].focus();
|
|
727
728
|
}, 0), window.addEventListener("keydown", v)), () => {
|
|
728
|
-
document.body.style.overflow = "",
|
|
729
|
+
document.body.style.overflow = "", h && h.focus(), window.removeEventListener("keydown", v);
|
|
729
730
|
};
|
|
730
|
-
}, [
|
|
731
|
+
}, [a, c, x, e]), a ? /* @__PURE__ */ f(
|
|
731
732
|
"div",
|
|
732
733
|
{
|
|
733
734
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",
|
|
734
735
|
id: e,
|
|
735
|
-
children: /* @__PURE__ */
|
|
736
|
+
children: /* @__PURE__ */ y(
|
|
736
737
|
"div",
|
|
737
738
|
{
|
|
738
|
-
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${
|
|
739
|
+
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${p}`,
|
|
739
740
|
children: [
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
n && /* @__PURE__ */
|
|
742
|
-
s && /* @__PURE__ */
|
|
741
|
+
/* @__PURE__ */ y("div", { className: "flex justify-between items-center relative", children: [
|
|
742
|
+
n && /* @__PURE__ */ f("h2", { className: "text-lg font-semibold", children: n }),
|
|
743
|
+
s && /* @__PURE__ */ f(
|
|
743
744
|
"button",
|
|
744
745
|
{
|
|
745
746
|
onClick: x,
|
|
@@ -749,7 +750,7 @@ function Ze({
|
|
|
749
750
|
}
|
|
750
751
|
)
|
|
751
752
|
] }),
|
|
752
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ f("div", { className: "mt-3 text-sm text-gray-700", children: typeof t == "function" ? t({ modalData: g }) : t })
|
|
753
754
|
]
|
|
754
755
|
}
|
|
755
756
|
)
|
|
@@ -759,29 +760,29 @@ function Ze({
|
|
|
759
760
|
function Ge({
|
|
760
761
|
children: e
|
|
761
762
|
}) {
|
|
762
|
-
const [n, t] = L({}), [r, s] = L({}),
|
|
763
|
-
t((
|
|
764
|
-
}, []),
|
|
765
|
-
t((
|
|
766
|
-
const
|
|
767
|
-
return delete
|
|
763
|
+
const [n, t] = L({}), [r, s] = L({}), p = E((l, b) => {
|
|
764
|
+
t((a) => ({ ...a, [l]: !0 })), b && s((a) => ({ ...a, [l]: b }));
|
|
765
|
+
}, []), u = E((l) => {
|
|
766
|
+
t((b) => ({ ...b, [l]: !1 })), s((b) => {
|
|
767
|
+
const a = { ...b };
|
|
768
|
+
return delete a[l], a;
|
|
768
769
|
});
|
|
769
|
-
}, []), c = E((
|
|
770
|
-
(
|
|
770
|
+
}, []), c = E((l) => !!n[l], [n]), i = E(
|
|
771
|
+
(l) => r[l],
|
|
771
772
|
[r]
|
|
772
|
-
),
|
|
773
|
-
() => ({ openModal:
|
|
774
|
-
[
|
|
773
|
+
), d = $(
|
|
774
|
+
() => ({ openModal: p, closeModal: u }),
|
|
775
|
+
[p, u]
|
|
775
776
|
), o = $(
|
|
776
|
-
() => ({ isOpen: c, getModalData:
|
|
777
|
-
[c,
|
|
777
|
+
() => ({ isOpen: c, getModalData: i }),
|
|
778
|
+
[c, i]
|
|
778
779
|
);
|
|
779
|
-
return /* @__PURE__ */
|
|
780
|
+
return /* @__PURE__ */ f(ee.Provider, { value: d, children: /* @__PURE__ */ f(re.Provider, { value: o, children: e }) });
|
|
780
781
|
}
|
|
781
782
|
function He(e) {
|
|
782
783
|
const { openModal: n, closeModal: t } = te(), { isOpen: r, getModalData: s } = ne();
|
|
783
784
|
return {
|
|
784
|
-
open: (
|
|
785
|
+
open: (p) => n(e, p),
|
|
785
786
|
close: () => t(e),
|
|
786
787
|
isOpen: r(e),
|
|
787
788
|
data: s(e)
|
|
@@ -809,35 +810,35 @@ const Ae = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, functio
|
|
|
809
810
|
}), Ue = () => {
|
|
810
811
|
const [e, n] = L([]);
|
|
811
812
|
A(() => {
|
|
812
|
-
Pe((r, s,
|
|
813
|
+
Pe((r, s, p, u) => {
|
|
813
814
|
const c = Ae();
|
|
814
|
-
n((
|
|
815
|
-
n((
|
|
816
|
-
},
|
|
815
|
+
n((i) => [...i, { id: c, type: r, message: s, config: u }]), setTimeout(() => {
|
|
816
|
+
n((i) => i.filter((d) => d.id !== c));
|
|
817
|
+
}, p);
|
|
817
818
|
});
|
|
818
819
|
}, []);
|
|
819
820
|
const t = je();
|
|
820
|
-
return /* @__PURE__ */
|
|
821
|
-
var
|
|
822
|
-
const s = ((
|
|
823
|
-
return /* @__PURE__ */
|
|
821
|
+
return /* @__PURE__ */ f("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((r) => {
|
|
822
|
+
var i, d, o, l, b, a, g, x, h, w, S, N, O;
|
|
823
|
+
const s = ((i = r.config) == null ? void 0 : i.icon) || ((d = t.icons) == null ? void 0 : d[r.type]) || ze(r.type), p = ((o = r.config) == null ? void 0 : o.bgColor) || ((b = (l = t.colors) == null ? void 0 : l[r.type]) == null ? void 0 : b.bg) || "bg-white dark:bg-gray-800", u = ((a = r.config) == null ? void 0 : a.textColor) || ((x = (g = t.colors) == null ? void 0 : g[r.type]) == null ? void 0 : x.text) || "text-gray-700 dark:text-gray-300", c = ((h = r.config) == null ? void 0 : h.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
|
|
824
|
+
return /* @__PURE__ */ y(
|
|
824
825
|
"div",
|
|
825
826
|
{
|
|
826
|
-
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${
|
|
827
|
+
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${p} ${u}`,
|
|
827
828
|
children: [
|
|
828
|
-
/* @__PURE__ */
|
|
829
|
-
/* @__PURE__ */
|
|
830
|
-
((w = r.config) == null ? void 0 : w.title) && /* @__PURE__ */
|
|
831
|
-
((S = r.config) == null ? void 0 : S.description) && /* @__PURE__ */
|
|
832
|
-
!((N = r.config) != null && N.title) && !((O = r.config) != null && O.description) && /* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ f("div", { className: c, children: s }),
|
|
830
|
+
/* @__PURE__ */ y("div", { className: "flex-1 me-3", children: [
|
|
831
|
+
((w = r.config) == null ? void 0 : w.title) && /* @__PURE__ */ f("div", { className: "font-semibold text-black", children: r.config.title }),
|
|
832
|
+
((S = r.config) == null ? void 0 : S.description) && /* @__PURE__ */ f("div", { className: "text-sm text-gray-500", children: r.config.description }),
|
|
833
|
+
!((N = r.config) != null && N.title) && !((O = r.config) != null && O.description) && /* @__PURE__ */ f("div", { className: "text-sm", children: r.message })
|
|
833
834
|
] }),
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ f(
|
|
835
836
|
"button",
|
|
836
837
|
{
|
|
837
|
-
onClick: () => n((v) => v.filter((
|
|
838
|
+
onClick: () => n((v) => v.filter((m) => m.id !== r.id)),
|
|
838
839
|
className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
|
|
839
840
|
"aria-label": "Close",
|
|
840
|
-
children: /* @__PURE__ */
|
|
841
|
+
children: /* @__PURE__ */ f(Ie, { size: 18 })
|
|
841
842
|
}
|
|
842
843
|
)
|
|
843
844
|
]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(F);const Z={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},G={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},R={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},ee={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},te=(e,o,t)=>{if(t)return"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";if(o)return"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";switch(e){case"error":return"border-red-500 bg-red-50 focus:ring-red-500";case"warning":return"border-yellow-500 bg-yellow-50 focus:ring-yellow-500";case"success":return"border-green-500 bg-green-50 focus:ring-green-500";default:return"border-gray-300 focus:ring-blue-500"}},q=s.forwardRef((e,o)=>{const{label:t,id:r,inputSize:l="md",shape:
|
|
1
|
+
(function(x,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],n):(x=typeof globalThis<"u"?globalThis:x||self,n(x.TailwindUiKit={},x.jsxRuntime,x.React))})(this,function(x,n,s){"use strict";"use client";var F=document.createElement("style");F.textContent=`/*! tailwindcss v4.1.10 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}.btn-primary{background-color:var(--color-blue-600,oklch(54.6% .245 262.881));color:var(--color-white,#fff)}@media (hover:hover){.btn-primary:hover{background-color:var(--color-blue-700,oklch(48.8% .243 264.376))}}.btn-outline-primary{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-blue-600,oklch(54.6% .245 262.881));color:var(--color-blue-600,oklch(54.6% .245 262.881))}@media (hover:hover){.btn-outline-primary:hover{background-color:var(--color-blue-50,oklch(97% .014 254.604))}}.btn-soft-primary{background-color:var(--color-blue-100,oklch(93.2% .032 255.585));color:var(--color-blue-700,oklch(48.8% .243 264.376))}@media (hover:hover){.btn-soft-primary:hover{background-color:var(--color-blue-200,oklch(88.2% .059 254.128))}}.btn-secondary{background-color:var(--color-gray-600,oklch(44.6% .03 256.802));color:var(--color-white,#fff)}@media (hover:hover){.btn-secondary:hover{background-color:var(--color-gray-700,oklch(37.3% .034 259.733))}}.btn-outline-secondary{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-gray-600,oklch(44.6% .03 256.802));color:var(--color-gray-600,oklch(44.6% .03 256.802))}@media (hover:hover){.btn-outline-secondary:hover{background-color:var(--color-gray-50,oklch(98.5% .002 247.839))}}.btn-soft-secondary{background-color:var(--color-gray-100,oklch(96.7% .003 264.542));color:var(--color-gray-700,oklch(37.3% .034 259.733))}@media (hover:hover){.btn-soft-secondary:hover{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}}.btn-danger{background-color:var(--color-red-600,oklch(57.7% .245 27.325));color:var(--color-white,#fff)}@media (hover:hover){.btn-danger:hover{background-color:var(--color-red-700,oklch(50.5% .213 27.518))}}.btn-outline-danger{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-600,oklch(57.7% .245 27.325));color:var(--color-red-600,oklch(57.7% .245 27.325))}@media (hover:hover){.btn-outline-danger:hover{background-color:var(--color-red-50,oklch(97.1% .013 17.38))}}.btn-soft-danger{background-color:var(--color-red-100,oklch(93.6% .032 17.717));color:var(--color-red-700,oklch(50.5% .213 27.518))}@media (hover:hover){.btn-soft-danger:hover{background-color:var(--color-red-200,oklch(88.5% .062 18.334))}}.btn-link{padding:calc(var(--spacing,.25rem)*0);color:var(--color-blue-600,oklch(54.6% .245 262.881));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000}@media (hover:hover){.btn-link:hover{text-decoration-line:underline}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(F);const Z={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},G={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},R={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},ee={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},te=(e,o,t)=>{if(t)return"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";if(o)return"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";switch(e){case"error":return"border-red-500 bg-red-50 focus:ring-red-500";case"warning":return"border-yellow-500 bg-yellow-50 focus:ring-yellow-500";case"success":return"border-green-500 bg-green-50 focus:ring-green-500";default:return"border-gray-300 focus:ring-blue-500"}},q=s.forwardRef((e,o)=>{const{label:t,id:r,inputSize:l="md",shape:b="rounded",validate:p,onValidatedChange:u,className:d="",icon:f,iconPosition:a="left",floatingLabelStyle:c,onChange:h,isValid:i,isInvalid:g,feedback:m,feedbackType:w="invalid",...v}=e,[S,N]=s.useState("default"),$=s.useCallback(M=>{const B=M.target.value,O=(p==null?void 0:p(B))??"default";N(O),u==null||u(M,O),h==null||h(M)},[p,u,h]),k=s.useMemo(()=>r||(typeof t=="string"?`input-${t.toLowerCase().replace(/\s+/g,"-")}`:`input-${Math.random().toString(36).slice(2)}`),[r,t]),y=!!c,C=Z[l]||Z.md,E=G[b]||G.flat,L=s.useMemo(()=>te(S,i,g),[S,i,g]),_=s.useMemo(()=>a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5",[a]),D=s.useMemo(()=>f?a==="start"||a==="left"?"ps-10":"pe-10":"",[f,a]);return n.jsxs("div",{className:`w-full relative ${y?"z-0":""}`,children:[!y&&t&&n.jsx("label",{htmlFor:k,className:`block mb-1 text-sm ${i?"text-green-700 dark:text-green-500":g?"text-red-700 dark:text-red-500":"text-gray-700"}`,children:t}),n.jsxs("div",{className:"relative w-full",children:[f&&n.jsx("div",{className:`absolute inset-y-0 flex items-center ${_}`,"aria-hidden":"true",children:n.jsx("span",{className:"text-gray-500",children:f})}),n.jsx("input",{...v,id:k,ref:o,placeholder:y?" ":v.placeholder,onChange:$,className:`border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
|
|
3
3
|
${C}
|
|
4
|
-
${
|
|
5
|
-
${D} ${E} ${L} ${
|
|
4
|
+
${y&&c&&R[c]}
|
|
5
|
+
${D} ${E} ${L} ${d}`}),y&&t&&c&&n.jsx("label",{htmlFor:k,className:`ms-1 ${ee[c]} ${d}`,children:t})]}),m&&n.jsx("p",{className:`mt-1 text-xs ${w==="invalid"?"text-red-600 dark:text-red-500":"text-green-600 dark:text-green-500"}`,role:w==="invalid"?"alert":void 0,children:m})]})});q.displayName="Input";const re={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},oe={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},ne={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},se={filled:"absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",outlined:"absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",standard:"absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"},ae=(e,o,t)=>{if(t)return"border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";if(o)return"border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";const r="focus:ring focus:border";switch(e){case"error":return`${r}-red-500 border-red-500 bg-red-50`;case"warning":return`${r}-yellow-500 border-yellow-500 bg-yellow-50`;case"success":return`${r}-green-500 border-green-500 bg-green-50`;default:return"border-gray-300 focus:ring-blue-500"}},H=s.forwardRef((e,o)=>{const{label:t,id:r,inputSize:l="md",shape:b="rounded",validate:p,onValidatedChange:u,className:d="",icon:f,iconPosition:a="left",floatingLabelStyle:c,onChange:h,isValid:i,isInvalid:g,feedback:m,feedbackType:w="invalid",children:v,...S}=e,[N,$]=s.useState("default"),k=s.useId(),y=s.useMemo(()=>r||(typeof t=="string"?`select-${t.toLowerCase().replace(/\s+/g,"-")}`:k),[r,t,k]),C=O=>{const _e=O.target.value,V=(p==null?void 0:p(_e))??"default";$(V),u==null||u(O,V),h==null||h(O)},E=!!c,L=re[l],_=oe[b],D=ae(N,i,g),M=f&&(a==="start"||a==="left")?"ps-10":f?"pe-10":"",B=a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5";return n.jsxs("div",{className:`w-full relative ${E?"z-0":""}`,children:[!E&&t&&n.jsx("label",{htmlFor:y,className:`block mb-1 text-sm ${i?"text-green-700":g?"text-red-700":"text-gray-700"}`,children:t}),n.jsxs("div",{className:"relative w-full",children:[f&&n.jsx("div",{className:`absolute inset-y-0 flex items-center ${B}`,children:n.jsx("span",{className:"text-gray-500",children:f})}),n.jsx("select",{...S,id:y,ref:o,onChange:C,className:`border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-600 placeholder-[#798ba5] border-gray-400
|
|
6
6
|
${L} ${M}
|
|
7
|
-
${E&&
|
|
8
|
-
${_} ${D} ${
|
|
9
|
-
${
|
|
10
|
-
${p}`,children:o})]})},fe=({children:e,content:o,position:t="top",className:r="",tooltipClass:l="",tooltipStyle:g={}})=>{const b=s.useRef(null),u=s.useRef(null);s.useEffect(()=>{const p=b.current,a=u.current;if(!p||!a)return;const f=()=>{a.style.opacity="1",a.style.visibility="visible"},c=()=>{a.style.opacity="0",a.style.visibility="hidden"};return p.addEventListener("mouseenter",f),p.addEventListener("mouseleave",c),()=>{p.removeEventListener("mouseenter",f),p.removeEventListener("mouseleave",c)}},[]);const i=p=>{const a={position:"absolute",opacity:0,visibility:"hidden",transition:"opacity 0.2s ease",maxWidth:"240px",whiteSpace:"normal",wordBreak:"break-word",padding:"8px 12px",fontSize:"0.875rem",backgroundColor:"black",color:"white",borderRadius:"4px",boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.15)",zIndex:9999,width:"max-content"};switch(p){case"top":return{...a,bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};case"bottom":return{...a,top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"left":return{...a,right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"right":return{...a,left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};default:return a}};return n.jsxs("div",{ref:b,className:`relative inline-block ${r}`,children:[e,n.jsx("div",{ref:u,role:"tooltip",className:l,style:{...i(t),...g},children:o})]})},pe={primary:"bg-blue-500 text-white",secondary:"bg-gray-500 text-white",success:"bg-green-500 text-white",danger:"bg-red-500 text-white",warning:"bg-yellow-400 text-black",info:"bg-cyan-500 text-white",dark:"bg-black text-white",light:"bg-gray-100 text-gray-800",link:"bg-transparent text-blue-500 underline","outline-primary":"border border-blue-500 text-blue-500 bg-transparent","outline-secondary":"border border-gray-500 text-gray-500 bg-transparent","outline-success":"border border-green-500 text-green-500 bg-transparent","outline-danger":"border border-red-500 text-red-500 bg-transparent","outline-warning":"border border-yellow-400 text-yellow-500 bg-transparent","outline-info":"border border-cyan-500 text-cyan-500 bg-transparent","outline-dark":"border border-black text-black bg-transparent","outline-light":"border border-gray-100 text-gray-800 bg-transparent"},be={xs:"text-xs px-2 py-0.5",sm:"text-sm px-2.5 py-0.5",md:"text-base px-3 py-1",lg:"text-lg px-3.5 py-1.5",xl:"text-xl px-4 py-2"},ge={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full p-2 w-8 h-8 justify-center"},he=({label:e,variant:o="primary",size:t="sm",shape:r="rounded",icon:l,dismissible:g,onDismiss:b,className:u="",...i})=>{const p=!e&&!!l,a=`inline-flex items-center font-medium ${pe[o]||""} ${be[t]||""} ${ge[r]||""} ${p?"justify-center p-2 w-8 h-8":""} `+u;return n.jsxs("span",{className:a.trim(),...i,children:[l&&n.jsx("span",{className:e?"mr-1":"",children:l}),e,g&&n.jsx("button",{type:"button",onClick:b,className:"ml-2 text-xs font-bold leading-none focus:outline-none",children:"×"})]})};var K={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},U=s.createContext&&s.createContext(K),ye=["attr","size","title"];function xe(e,o){if(e==null)return{};var t=me(e,o),r,l;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(e);for(l=0;l<g.length;l++)r=g[l],!(o.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function me(e,o){if(e==null)return{};var t={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(o.indexOf(r)>=0)continue;t[r]=e[r]}return t}function P(){return P=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},P.apply(this,arguments)}function W(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);o&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,r)}return t}function j(e){for(var o=1;o<arguments.length;o++){var t=arguments[o]!=null?arguments[o]:{};o%2?W(Object(t),!0).forEach(function(r){we(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):W(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function we(e,o,t){return o=ve(o),o in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t,e}function ve(e){var o=ke(e,"string");return typeof o=="symbol"?o:o+""}function ke(e,o){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var r=t.call(e,o);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(e)}function X(e){return e&&e.map((o,t)=>s.createElement(o.tag,j({key:t},o.attr),X(o.child)))}function Y(e){return o=>s.createElement(Ce,P({attr:j({},e.attr)},o),X(e.child))}function Ce(e){var o=t=>{var{attr:r,size:l,title:g}=e,b=xe(e,ye),u=l||t.size||"1em",i;return t.className&&(i=t.className),e.className&&(i=(i?i+" ":"")+e.className),s.createElement("svg",P({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,b,{className:i,style:j(j({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),g&&s.createElement("title",null,g),e.children)};return U!==void 0?s.createElement(U.Consumer,null,t=>o(t)):o(K)}function Se(e){return Y({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(e)}const Ne=({items:e,allowMultipleOpen:o=!1,className:t="",tileClasses:r="",open:l,onChange:g,renderTitle:b,renderContent:u})=>{const[i,p]=s.useState(new Set),a=s.useMemo(()=>l?new Set(l):i,[l,i]),f=s.useCallback(c=>{const d=new Set(a);d.has(c)?d.delete(c):(o||d.clear(),d.add(c)),l&&g?g(Array.from(d)):p(d)},[a,l,g,o]);return n.jsx("div",{className:"accordion",role:"region","aria-multiselectable":o,children:e.map(c=>{const d=a.has(c.id),x=`accordion-heading-${c.id}`,m=`accordion-panel-${c.id}`;return n.jsxs("div",{className:`accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,children:[n.jsxs("button",{id:x,type:"button","aria-expanded":d,"aria-controls":m,onClick:()=>f(c.id),className:`flex justify-between items-center w-full p-1.5 text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3 ${r}`,children:[b?b(c,d):c.title,n.jsx(Se,{})]}),n.jsx("div",{id:m,role:"region","aria-labelledby":x,hidden:!d,className:"p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",children:u?u(c,d):c.content})]},c.id)})})},J=s.createContext(null),I=()=>{const e=s.useContext(J);if(!e)throw new Error("useModalActions must be used within a ModalActionProvider");return e},Q=s.createContext(null),T=()=>s.useContext(Q);function Ee({id:e,title:o,children:t,standalone:r=!1,showFloatingClose:l=!1,containerClasses:g="",onClose:b,disableEscapeClose:u=!1}){const i=T(),p=I(),a=!r&&!!i&&!!p,[f,c]=s.useState(!1),d=a?i.isOpen(e):f,x=a?i.getModalData(e):null,m=s.useCallback(()=>{a?p.closeModal(e):c(!1),b==null||b()},[a,p,e,b]);return s.useEffect(()=>{const w=document.activeElement;console.log(e);const v=document.getElementById(e);console.log("modalEl=",v);const S=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],N=()=>{if(!v)return[];const h=v.querySelectorAll(S.join(","));return Array.from(h).filter(C=>C.offsetParent!==null)},$=h=>{if(h.key==="Tab"){const C=N();if(C.length===0)return;const E=C[0],L=C[C.length-1];h.shiftKey?document.activeElement===E&&(h.preventDefault(),L.focus()):document.activeElement===L&&(h.preventDefault(),E.focus())}},k=h=>{h.key==="Escape"&&!u&&m(),$(h)};return d&&(document.body.style.overflow="hidden",setTimeout(()=>{const h=N();h.length&&h[0].focus()},0),window.addEventListener("keydown",k)),()=>{document.body.style.overflow="",w&&w.focus(),window.removeEventListener("keydown",k)}},[d,u,m,e]),d?n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",id:e,children:n.jsxs("div",{className:`bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${g}`,children:[n.jsxs("div",{className:"flex justify-between items-center relative",children:[o&&n.jsx("h2",{className:"text-lg font-semibold",children:o}),l&&n.jsx("button",{onClick:m,className:"text-gray-500 hover:text-black absolute top-2 right-3 hover:bg-gray-200 rounded-full aspect-square w-8","aria-label":"Close modal",children:"✕"})]}),n.jsx("div",{className:"mt-3 text-sm text-gray-700",children:typeof t=="function"?t({modalData:x}):t})]})}):null}function $e({children:e}){const[o,t]=s.useState({}),[r,l]=s.useState({}),g=s.useCallback((f,c)=>{t(d=>({...d,[f]:!0})),c&&l(d=>({...d,[f]:c}))},[]),b=s.useCallback(f=>{t(c=>({...c,[f]:!1})),l(c=>{const d={...c};return delete d[f],d})},[]),u=s.useCallback(f=>!!o[f],[o]),i=s.useCallback(f=>r[f],[r]),p=s.useMemo(()=>({openModal:g,closeModal:b}),[g,b]),a=s.useMemo(()=>({isOpen:u,getModalData:i}),[u,i]);return n.jsx(J.Provider,{value:p,children:n.jsx(Q.Provider,{value:a,children:e})})}function Le(e){const{openModal:o,closeModal:t}=I(),{isOpen:r,getModalData:l}=T();return{open:g=>o(e,g),close:()=>t(e),isOpen:r(e),data:l(e)}}let A=null,z={};function Oe(e){A=e}function Me(e){z={...z,...e}}function Pe(){return z}function je(e,o,t=3e3,r){A?A(e,o,t,r):console.warn("Toast system is not mounted")}function Ie(e){return Y({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor"},child:[]}]})(e)}const Te=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const o=Math.random()*16|0;return(e==="x"?o:o&3|8).toString(16)}),Ae=()=>{const[e,o]=s.useState([]);s.useEffect(()=>{Oe((r,l,g,b)=>{const u=Te();o(i=>[...i,{id:u,type:r,message:l,config:b}]),setTimeout(()=>{o(i=>i.filter(p=>p.id!==u))},g)})},[]);const t=Pe();return n.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(r=>{var i,p,a,f,c,d,x,m,w,v,S,N,$;const l=((i=r.config)==null?void 0:i.icon)||((p=t.icons)==null?void 0:p[r.type])||ze(r.type),g=((a=r.config)==null?void 0:a.bgColor)||((c=(f=t.colors)==null?void 0:f[r.type])==null?void 0:c.bg)||"bg-white dark:bg-gray-800",b=((d=r.config)==null?void 0:d.textColor)||((m=(x=t.colors)==null?void 0:x[r.type])==null?void 0:m.text)||"text-gray-700 dark:text-gray-300",u=((w=r.config)==null?void 0:w.iconContainerClass)||"w-8 h-8 mr-3 text-xl flex items-center justify-center";return n.jsxs("div",{className:`flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${g} ${b}`,children:[n.jsx("div",{className:u,children:l}),n.jsxs("div",{className:"flex-1 me-3",children:[((v=r.config)==null?void 0:v.title)&&n.jsx("div",{className:"font-semibold text-black",children:r.config.title}),((S=r.config)==null?void 0:S.description)&&n.jsx("div",{className:"text-sm text-gray-500",children:r.config.description}),!((N=r.config)!=null&&N.title)&&!(($=r.config)!=null&&$.description)&&n.jsx("div",{className:"text-sm",children:r.message})]}),n.jsx("button",{onClick:()=>o(k=>k.filter(h=>h.id!==r.id)),className:"ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white","aria-label":"Close",children:n.jsx(Ie,{size:18})})]},r.id)})})};function ze(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}y.Accordion=Ne,y.Badge=he,y.Button=de,y.Dropdown=ue,y.Input=q,y.Modal=Ee,y.ModalProvider=$e,y.Select=H,y.Toast=Ae,y.Tooltip=fe,y.setToastDefaults=Me,y.showToast=je,y.useModalActions=I,y.useModalInstance=Le,y.useModalState=T,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})});
|
|
7
|
+
${E&&c&&ne[c]}
|
|
8
|
+
${_} ${D} ${d}`,children:v}),E&&t&&c&&n.jsx("label",{htmlFor:y,className:`ms-1 ${se[c]} ${d}`,children:t})]}),m&&n.jsx("p",{className:`mt-1 text-xs ${w==="invalid"?"text-red-600":"text-green-600"}`,children:m})]})});H.displayName="Select";const le={primary:"btn-primary",secondary:"btn-secondary",success:"btn-success",danger:"btn-danger",warning:"btn-warning",info:"btn-info",dark:"btn-dark",light:"btn-light",link:"btn-link","outline-primary":"btn-outline-primary","outline-secondary":"btn-outline-secondary","outline-success":"btn-outline-success","outline-danger":"btn-outline-danger","outline-warning":"btn-outline-warning","outline-info":"btn-outline-info","outline-dark":"btn-outline-dark","outline-light":"btn-outline-light","soft-primary":"btn-soft-primary","soft-secondary":"btn-soft-secondary","soft-success":"btn-soft-success","soft-danger":"btn-soft-danger","soft-warning":"btn-soft-warning","soft-info":"btn-soft-info","soft-dark":"btn-soft-dark","soft-light":"btn-soft-light"},ie={xs:"px-3 py-2 text-xs",sm:"px-3 py-2 text-sm",md:"px-5 py-2.5 text-sm",lg:"px-5 py-3 text-base",xl:"px-6 py-3.5 text-base"},ce={flat:"shadow-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full w-10 h-10 p-0 flex items-center justify-center"},de=({children:e,variant:o="primary",size:t="md",type:r="button",shape:l="rounded",className:b="",isLoading:p=!1,disabled:u=!1,...d})=>{const f=u||p,a=["inline-flex items-center justify-center font-normal transition duration-150",le[o],ie[t],ce[l],l==="flat"?"shadow-none":"shadow-sm",f?"opacity-50 cursor-not-allowed":"cursor-pointer",b].filter(Boolean).join(" ");return n.jsxs("button",{type:r,className:a,disabled:f,...d,children:[p&&n.jsxs("svg",{"aria-hidden":"true",role:"status",className:"inline w-4 h-4 me-3 text-gray-200 animate-spin dark:text-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),n.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"#1C64F2"})]}),e]})},ue=({label:e,children:o,position:t="right"})=>{const[r,l]=s.useState(!1),[b,p]=s.useState(!1),u=s.useRef(null),d=s.useRef(null),f=s.useMemo(()=>{switch(t){case"left":return"left-0";case"center":return"left-1/2 transform -translate-x-1/2";case"right":default:return"right-0"}},[t]),a=s.useCallback(i=>{const g=i.target;u.current&&!u.current.contains(g)&&d.current&&!d.current.contains(g)&&l(!1)},[]),c=s.useCallback(()=>{if(!d.current||!u.current)return;const i=d.current.getBoundingClientRect(),g=u.current.getBoundingClientRect(),m=window.innerHeight-i.bottom,w=i.top;p(m<g.height&&w>g.height)},[]);s.useEffect(()=>{if(r)return c(),window.addEventListener("resize",c),window.addEventListener("scroll",c,!0),()=>{window.removeEventListener("resize",c),window.removeEventListener("scroll",c,!0)}},[r,c]),s.useEffect(()=>(document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)),[a]);const h=s.useCallback(()=>l(i=>!i),[]);return n.jsxs("div",{className:"relative flex items-center",children:[n.jsx("button",{ref:d,onClick:h,children:e}),r&&n.jsx("div",{ref:u,className:`absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
|
|
9
|
+
${b?"bottom-full mb-2":"top-full mt-2"}
|
|
10
|
+
${f}`,children:o})]})},fe=({children:e,content:o,position:t="top",className:r="",tooltipClass:l="",tooltipStyle:b={}})=>{const p=s.useRef(null),u=s.useRef(null);s.useEffect(()=>{const f=p.current,a=u.current;if(!f||!a)return;const c=()=>{a.style.opacity="1",a.style.visibility="visible"},h=()=>{a.style.opacity="0",a.style.visibility="hidden"};return f.addEventListener("mouseenter",c),f.addEventListener("mouseleave",h),()=>{f.removeEventListener("mouseenter",c),f.removeEventListener("mouseleave",h)}},[]);const d=f=>{const a={position:"absolute",opacity:0,visibility:"hidden",transition:"opacity 0.2s ease",maxWidth:"240px",whiteSpace:"normal",wordBreak:"break-word",padding:"8px 12px",fontSize:"0.875rem",backgroundColor:"black",color:"white",borderRadius:"4px",boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.15)",zIndex:9999,width:"max-content"};switch(f){case"top":return{...a,bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};case"bottom":return{...a,top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"left":return{...a,right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"right":return{...a,left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};default:return a}};return n.jsxs("div",{ref:p,className:`relative inline-block ${r}`,children:[e,n.jsx("div",{ref:u,role:"tooltip",className:l,style:{...d(t),...b},children:o})]})},pe={primary:"bg-blue-500 text-white",secondary:"bg-gray-500 text-white",success:"bg-green-500 text-white",danger:"bg-red-500 text-white",warning:"bg-yellow-400 text-black",info:"bg-cyan-500 text-white",dark:"bg-black text-white",light:"bg-gray-100 text-gray-800",link:"bg-transparent text-blue-500 underline","outline-primary":"border border-blue-500 text-blue-500 bg-transparent","outline-secondary":"border border-gray-500 text-gray-500 bg-transparent","outline-success":"border border-green-500 text-green-500 bg-transparent","outline-danger":"border border-red-500 text-red-500 bg-transparent","outline-warning":"border border-yellow-400 text-yellow-500 bg-transparent","outline-info":"border border-cyan-500 text-cyan-500 bg-transparent","outline-dark":"border border-black text-black bg-transparent","outline-light":"border border-gray-100 text-gray-800 bg-transparent"},be={xs:"text-xs px-2 py-0.5",sm:"text-sm px-2.5 py-0.5",md:"text-base px-3 py-1",lg:"text-lg px-3.5 py-1.5",xl:"text-xl px-4 py-2"},ge={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full p-2 w-8 h-8 justify-center"},he=({label:e,variant:o="primary",size:t="sm",shape:r="rounded",icon:l,dismissible:b,onDismiss:p,className:u="",...d})=>{const f=!e&&!!l,a=`inline-flex items-center font-medium ${pe[o]||""} ${be[t]||""} ${ge[r]||""} ${f?"justify-center p-2 w-8 h-8":""} `+u;return n.jsxs("span",{className:a.trim(),...d,children:[l&&n.jsx("span",{className:e?"mr-1":"",children:l}),e,b&&n.jsx("button",{type:"button",onClick:p,className:"ml-2 text-xs font-bold leading-none focus:outline-none",children:"×"})]})};var K={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},U=s.createContext&&s.createContext(K),ye=["attr","size","title"];function xe(e,o){if(e==null)return{};var t=me(e,o),r,l;if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(l=0;l<b.length;l++)r=b[l],!(o.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function me(e,o){if(e==null)return{};var t={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(o.indexOf(r)>=0)continue;t[r]=e[r]}return t}function P(){return P=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},P.apply(this,arguments)}function W(e,o){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);o&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,r)}return t}function j(e){for(var o=1;o<arguments.length;o++){var t=arguments[o]!=null?arguments[o]:{};o%2?W(Object(t),!0).forEach(function(r){we(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):W(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function we(e,o,t){return o=ve(o),o in e?Object.defineProperty(e,o,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[o]=t,e}function ve(e){var o=ke(e,"string");return typeof o=="symbol"?o:o+""}function ke(e,o){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var r=t.call(e,o);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(e)}function X(e){return e&&e.map((o,t)=>s.createElement(o.tag,j({key:t},o.attr),X(o.child)))}function Y(e){return o=>s.createElement(Ce,P({attr:j({},e.attr)},o),X(e.child))}function Ce(e){var o=t=>{var{attr:r,size:l,title:b}=e,p=xe(e,ye),u=l||t.size||"1em",d;return t.className&&(d=t.className),e.className&&(d=(d?d+" ":"")+e.className),s.createElement("svg",P({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,p,{className:d,style:j(j({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),b&&s.createElement("title",null,b),e.children)};return U!==void 0?s.createElement(U.Consumer,null,t=>o(t)):o(K)}function Se(e){return Y({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(e)}const Ne=({items:e,allowMultipleOpen:o=!1,className:t="",tileClasses:r="",open:l,onChange:b,renderTitle:p,renderContent:u,showArrowIcon:d=!0})=>{const[f,a]=s.useState(new Set),c=s.useMemo(()=>l?new Set(l):f,[l,f]),h=s.useCallback(i=>{const g=new Set(c);g.has(i)?g.delete(i):(o||g.clear(),g.add(i)),l&&b?b(Array.from(g)):a(g)},[c,l,b,o]);return n.jsx("div",{className:"accordion",role:"region","aria-multiselectable":o,children:e.map(i=>{const g=c.has(i.id),m=`accordion-heading-${i.id}`,w=`accordion-panel-${i.id}`;return n.jsxs("div",{className:`accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,children:[n.jsxs("button",{id:m,type:"button","aria-expanded":g,"aria-controls":w,onClick:()=>h(i.id),className:`flex justify-between items-center w-full p-1.5 text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3 ${r}`,children:[p?p(i,g):i.title,d?n.jsx(Se,{}):null]}),n.jsx("div",{id:w,role:"region","aria-labelledby":m,hidden:!g,className:"p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",children:u?u(i,g):i.content})]},i.id)})})},J=s.createContext(null),I=()=>{const e=s.useContext(J);if(!e)throw new Error("useModalActions must be used within a ModalActionProvider");return e},Q=s.createContext(null),T=()=>s.useContext(Q);function Ee({id:e,title:o,children:t,standalone:r=!1,showFloatingClose:l=!1,containerClasses:b="",onClose:p,disableEscapeClose:u=!1}){const d=T(),f=I(),a=!r&&!!d&&!!f,[c,h]=s.useState(!1),i=a?d.isOpen(e):c,g=a?d.getModalData(e):null,m=s.useCallback(()=>{a?f.closeModal(e):h(!1),p==null||p()},[a,f,e,p]);return s.useEffect(()=>{const w=document.activeElement;console.log(e);const v=document.getElementById(e);console.log("modalEl=",v);const S=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],N=()=>{if(!v)return[];const y=v.querySelectorAll(S.join(","));return Array.from(y).filter(C=>C.offsetParent!==null)},$=y=>{if(y.key==="Tab"){const C=N();if(C.length===0)return;const E=C[0],L=C[C.length-1];y.shiftKey?document.activeElement===E&&(y.preventDefault(),L.focus()):document.activeElement===L&&(y.preventDefault(),E.focus())}},k=y=>{y.key==="Escape"&&!u&&m(),$(y)};return i&&(document.body.style.overflow="hidden",setTimeout(()=>{const y=N();y.length&&y[0].focus()},0),window.addEventListener("keydown",k)),()=>{document.body.style.overflow="",w&&w.focus(),window.removeEventListener("keydown",k)}},[i,u,m,e]),i?n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",id:e,children:n.jsxs("div",{className:`bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${b}`,children:[n.jsxs("div",{className:"flex justify-between items-center relative",children:[o&&n.jsx("h2",{className:"text-lg font-semibold",children:o}),l&&n.jsx("button",{onClick:m,className:"text-gray-500 hover:text-black absolute top-2 right-3 hover:bg-gray-200 rounded-full aspect-square w-8","aria-label":"Close modal",children:"✕"})]}),n.jsx("div",{className:"mt-3 text-sm text-gray-700",children:typeof t=="function"?t({modalData:g}):t})]})}):null}function $e({children:e}){const[o,t]=s.useState({}),[r,l]=s.useState({}),b=s.useCallback((c,h)=>{t(i=>({...i,[c]:!0})),h&&l(i=>({...i,[c]:h}))},[]),p=s.useCallback(c=>{t(h=>({...h,[c]:!1})),l(h=>{const i={...h};return delete i[c],i})},[]),u=s.useCallback(c=>!!o[c],[o]),d=s.useCallback(c=>r[c],[r]),f=s.useMemo(()=>({openModal:b,closeModal:p}),[b,p]),a=s.useMemo(()=>({isOpen:u,getModalData:d}),[u,d]);return n.jsx(J.Provider,{value:f,children:n.jsx(Q.Provider,{value:a,children:e})})}function Le(e){const{openModal:o,closeModal:t}=I(),{isOpen:r,getModalData:l}=T();return{open:b=>o(e,b),close:()=>t(e),isOpen:r(e),data:l(e)}}let A=null,z={};function Oe(e){A=e}function Me(e){z={...z,...e}}function Pe(){return z}function je(e,o,t=3e3,r){A?A(e,o,t,r):console.warn("Toast system is not mounted")}function Ie(e){return Y({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor"},child:[]}]})(e)}const Te=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const o=Math.random()*16|0;return(e==="x"?o:o&3|8).toString(16)}),Ae=()=>{const[e,o]=s.useState([]);s.useEffect(()=>{Oe((r,l,b,p)=>{const u=Te();o(d=>[...d,{id:u,type:r,message:l,config:p}]),setTimeout(()=>{o(d=>d.filter(f=>f.id!==u))},b)})},[]);const t=Pe();return n.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(r=>{var d,f,a,c,h,i,g,m,w,v,S,N,$;const l=((d=r.config)==null?void 0:d.icon)||((f=t.icons)==null?void 0:f[r.type])||ze(r.type),b=((a=r.config)==null?void 0:a.bgColor)||((h=(c=t.colors)==null?void 0:c[r.type])==null?void 0:h.bg)||"bg-white dark:bg-gray-800",p=((i=r.config)==null?void 0:i.textColor)||((m=(g=t.colors)==null?void 0:g[r.type])==null?void 0:m.text)||"text-gray-700 dark:text-gray-300",u=((w=r.config)==null?void 0:w.iconContainerClass)||"w-8 h-8 mr-3 text-xl flex items-center justify-center";return n.jsxs("div",{className:`flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${b} ${p}`,children:[n.jsx("div",{className:u,children:l}),n.jsxs("div",{className:"flex-1 me-3",children:[((v=r.config)==null?void 0:v.title)&&n.jsx("div",{className:"font-semibold text-black",children:r.config.title}),((S=r.config)==null?void 0:S.description)&&n.jsx("div",{className:"text-sm text-gray-500",children:r.config.description}),!((N=r.config)!=null&&N.title)&&!(($=r.config)!=null&&$.description)&&n.jsx("div",{className:"text-sm",children:r.message})]}),n.jsx("button",{onClick:()=>o(k=>k.filter(y=>y.id!==r.id)),className:"ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white","aria-label":"Close",children:n.jsx(Ie,{size:18})})]},r.id)})})};function ze(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}x.Accordion=Ne,x.Badge=he,x.Button=de,x.Dropdown=ue,x.Input=q,x.Modal=Ee,x.ModalProvider=$e,x.Select=H,x.Toast=Ae,x.Tooltip=fe,x.setToastDefaults=Me,x.showToast=je,x.useModalActions=I,x.useModalInstance=Le,x.useModalState=T,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|