tailwind-ux-kit 1.0.53 → 1.0.55
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.
|
@@ -10,6 +10,7 @@ interface AccordionProps<T extends AccordionItemBase> {
|
|
|
10
10
|
allowMultipleOpen?: boolean;
|
|
11
11
|
className?: string;
|
|
12
12
|
tileClasses?: string;
|
|
13
|
+
panelClasses?: string;
|
|
13
14
|
open?: (string | number)[];
|
|
14
15
|
showArrowIcon?: boolean;
|
|
15
16
|
onChange?: (openItems: (string | number)[]) => void;
|
|
@@ -22,5 +23,5 @@ interface AccordionProps<T extends AccordionItemBase> {
|
|
|
22
23
|
*/
|
|
23
24
|
renderContent?: (item: T, isOpen: boolean) => React.ReactNode;
|
|
24
25
|
}
|
|
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;
|
|
26
|
+
declare const Accordion: <T extends AccordionItemBase>({ items, allowMultipleOpen, className, tileClasses, open: controlledOpen, onChange, renderTitle, renderContent, showArrowIcon, panelClasses, }: AccordionProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
26
27
|
export default Accordion;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { default as React, ReactNode } from 'react';
|
|
1
|
+
import { default as React, ReactNode, HTMLAttributes } from 'react';
|
|
2
2
|
type DropdownProps = {
|
|
3
3
|
label: ReactNode;
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
position?: "left" | "center" | "right";
|
|
6
|
-
|
|
6
|
+
className?: string;
|
|
7
|
+
menuClassName?: string;
|
|
8
|
+
width?: string;
|
|
9
|
+
closeOnSelect?: boolean;
|
|
10
|
+
transition?: boolean;
|
|
11
|
+
ariaLabel?: string;
|
|
12
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
7
13
|
declare const Dropdown: React.FC<DropdownProps>;
|
|
8
14
|
export default Dropdown;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
2
|
+
import { jsxs as C, jsx as u } from "react/jsx-runtime";
|
|
3
|
+
import j, { forwardRef as q, useState as P, useMemo as O, useId as se, useRef as _, useCallback as L, useEffect as D, createContext as X, useContext as Y } from "react";
|
|
4
|
+
const G = {
|
|
5
5
|
xs: "text-xs px-2 py-1",
|
|
6
6
|
sm: "text-sm px-3 py-1.5",
|
|
7
7
|
md: "text-sm px-3 py-3",
|
|
@@ -38,80 +38,80 @@ const H = {
|
|
|
38
38
|
label: t,
|
|
39
39
|
id: r,
|
|
40
40
|
inputSize: s = "md",
|
|
41
|
-
shape:
|
|
42
|
-
validate:
|
|
43
|
-
onValidatedChange:
|
|
44
|
-
className:
|
|
45
|
-
icon:
|
|
41
|
+
shape: f = "rounded",
|
|
42
|
+
validate: l,
|
|
43
|
+
onValidatedChange: i,
|
|
44
|
+
className: c = "",
|
|
45
|
+
icon: a,
|
|
46
46
|
iconPosition: o = "left",
|
|
47
|
-
floatingLabelStyle:
|
|
48
|
-
onChange:
|
|
49
|
-
isValid:
|
|
47
|
+
floatingLabelStyle: d,
|
|
48
|
+
onChange: p,
|
|
49
|
+
isValid: x,
|
|
50
50
|
isInvalid: g,
|
|
51
|
-
feedback:
|
|
52
|
-
feedbackType:
|
|
53
|
-
...
|
|
54
|
-
} = e, [S,
|
|
55
|
-
(
|
|
56
|
-
const
|
|
57
|
-
|
|
51
|
+
feedback: b,
|
|
52
|
+
feedbackType: w = "invalid",
|
|
53
|
+
...h
|
|
54
|
+
} = e, [S, k] = P("default"), $ = j.useCallback(
|
|
55
|
+
(A) => {
|
|
56
|
+
const T = A.target.value, z = (l == null ? void 0 : l(T)) ?? "default";
|
|
57
|
+
k(z), i == null || i(A, z), p == null || p(A);
|
|
58
58
|
},
|
|
59
|
-
[
|
|
60
|
-
),
|
|
61
|
-
() => ie(S,
|
|
62
|
-
[S,
|
|
63
|
-
),
|
|
64
|
-
return /* @__PURE__ */
|
|
59
|
+
[l, i, p]
|
|
60
|
+
), N = O(() => r || (typeof t == "string" ? `input-${t.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [r, t]), m = !!d, y = G[s] || G.md, v = W[f] || W.flat, E = O(
|
|
61
|
+
() => ie(S, x, g),
|
|
62
|
+
[S, x, g]
|
|
63
|
+
), M = O(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), I = O(() => a ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [a, o]);
|
|
64
|
+
return /* @__PURE__ */ C(
|
|
65
65
|
"div",
|
|
66
66
|
{
|
|
67
67
|
className: `w-full relative ${m ? "z-0" : ""} tailwind-ux-input`,
|
|
68
68
|
children: [
|
|
69
|
-
!m && t && /* @__PURE__ */
|
|
69
|
+
!m && t && /* @__PURE__ */ u(
|
|
70
70
|
"label",
|
|
71
71
|
{
|
|
72
|
-
htmlFor:
|
|
73
|
-
className: `block mb-1 text-sm ${
|
|
72
|
+
htmlFor: N,
|
|
73
|
+
className: `block mb-1 text-sm ${x ? "text-green-700 dark:text-green-500" : g ? "text-red-700 dark:text-red-500" : "text-gray-700"}`,
|
|
74
74
|
children: t
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
77
|
+
/* @__PURE__ */ C("div", { className: "relative w-full", children: [
|
|
78
|
+
a && /* @__PURE__ */ u(
|
|
79
79
|
"div",
|
|
80
80
|
{
|
|
81
|
-
className: `absolute inset-y-0 flex items-center ${
|
|
81
|
+
className: `absolute inset-y-0 flex items-center ${M}`,
|
|
82
82
|
"aria-hidden": "true",
|
|
83
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ u("span", { className: "text-gray-500", children: a })
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ u(
|
|
87
87
|
"input",
|
|
88
88
|
{
|
|
89
|
-
...
|
|
90
|
-
id:
|
|
89
|
+
...h,
|
|
90
|
+
id: N,
|
|
91
91
|
ref: n,
|
|
92
|
-
placeholder: m ? " " :
|
|
93
|
-
onChange:
|
|
92
|
+
placeholder: m ? " " : h.placeholder,
|
|
93
|
+
onChange: $,
|
|
94
94
|
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
|
|
95
|
-
${
|
|
96
|
-
${m &&
|
|
97
|
-
${
|
|
95
|
+
${y}
|
|
96
|
+
${m && d && ae[d]}
|
|
97
|
+
${I} ${v} ${E} ${c}`
|
|
98
98
|
}
|
|
99
99
|
),
|
|
100
|
-
m && t &&
|
|
100
|
+
m && t && d && /* @__PURE__ */ u(
|
|
101
101
|
"label",
|
|
102
102
|
{
|
|
103
|
-
htmlFor:
|
|
104
|
-
className: `ms-1 ${le[
|
|
103
|
+
htmlFor: N,
|
|
104
|
+
className: `ms-1 ${le[d]} ${c}`,
|
|
105
105
|
children: t
|
|
106
106
|
}
|
|
107
107
|
)
|
|
108
108
|
] }),
|
|
109
|
-
|
|
109
|
+
b && /* @__PURE__ */ u(
|
|
110
110
|
"p",
|
|
111
111
|
{
|
|
112
|
-
className: `mt-1 text-xs ${
|
|
113
|
-
role:
|
|
114
|
-
children:
|
|
112
|
+
className: `mt-1 text-xs ${w === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
|
|
113
|
+
role: w === "invalid" ? "alert" : void 0,
|
|
114
|
+
children: b
|
|
115
115
|
}
|
|
116
116
|
)
|
|
117
117
|
]
|
|
@@ -157,69 +157,69 @@ const de = {
|
|
|
157
157
|
label: t,
|
|
158
158
|
id: r,
|
|
159
159
|
inputSize: s = "md",
|
|
160
|
-
shape:
|
|
161
|
-
validate:
|
|
162
|
-
onValidatedChange:
|
|
163
|
-
className:
|
|
164
|
-
icon:
|
|
160
|
+
shape: f = "rounded",
|
|
161
|
+
validate: l,
|
|
162
|
+
onValidatedChange: i,
|
|
163
|
+
className: c = "",
|
|
164
|
+
icon: a,
|
|
165
165
|
iconPosition: o = "left",
|
|
166
|
-
floatingLabelStyle:
|
|
167
|
-
onChange:
|
|
168
|
-
isValid:
|
|
166
|
+
floatingLabelStyle: d,
|
|
167
|
+
onChange: p,
|
|
168
|
+
isValid: x,
|
|
169
169
|
isInvalid: g,
|
|
170
|
-
feedback:
|
|
171
|
-
feedbackType:
|
|
172
|
-
children:
|
|
170
|
+
feedback: b,
|
|
171
|
+
feedbackType: w = "invalid",
|
|
172
|
+
children: h,
|
|
173
173
|
...S
|
|
174
|
-
} = e, [
|
|
175
|
-
const oe =
|
|
176
|
-
|
|
177
|
-
},
|
|
178
|
-
return /* @__PURE__ */
|
|
179
|
-
!
|
|
174
|
+
} = e, [k, $] = P("default"), N = se(), m = O(() => r || (typeof t == "string" ? `select-${t.toLowerCase().replace(/\s+/g, "-")}` : N), [r, t, N]), y = (z) => {
|
|
175
|
+
const oe = z.target.value, Z = (l == null ? void 0 : l(oe)) ?? "default";
|
|
176
|
+
$(Z), i == null || i(z, Z), p == null || p(z);
|
|
177
|
+
}, v = !!d, E = de[s], M = ue[f], I = ge(k, x, g);
|
|
178
|
+
return /* @__PURE__ */ C("div", { className: `w-full relative ${v ? "z-0" : ""}`, children: [
|
|
179
|
+
!v && t && /* @__PURE__ */ u(
|
|
180
180
|
"label",
|
|
181
181
|
{
|
|
182
182
|
htmlFor: m,
|
|
183
|
-
className: `block mb-1 text-sm ${
|
|
183
|
+
className: `block mb-1 text-sm ${x ? "text-green-700" : g ? "text-red-700" : "text-gray-700"}`,
|
|
184
184
|
children: t
|
|
185
185
|
}
|
|
186
186
|
),
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
|
|
187
|
+
/* @__PURE__ */ C("div", { className: "relative w-full", children: [
|
|
188
|
+
a && /* @__PURE__ */ u(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
191
|
className: `absolute inset-y-0 flex items-center ${o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5"}`,
|
|
192
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ u("span", { className: "text-gray-500", children: a })
|
|
193
193
|
}
|
|
194
194
|
),
|
|
195
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ u(
|
|
196
196
|
"select",
|
|
197
197
|
{
|
|
198
198
|
...S,
|
|
199
199
|
id: m,
|
|
200
200
|
ref: n,
|
|
201
|
-
onChange:
|
|
201
|
+
onChange: y,
|
|
202
202
|
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
|
|
203
|
-
${
|
|
204
|
-
${
|
|
205
|
-
${
|
|
206
|
-
children:
|
|
203
|
+
${E} ${a && (o === "start" || o === "left") ? "ps-10" : a ? "pe-10" : ""}
|
|
204
|
+
${v && d && fe[d]}
|
|
205
|
+
${M} ${I} ${c}`,
|
|
206
|
+
children: h
|
|
207
207
|
}
|
|
208
208
|
),
|
|
209
|
-
|
|
209
|
+
v && t && d && /* @__PURE__ */ u(
|
|
210
210
|
"label",
|
|
211
211
|
{
|
|
212
212
|
htmlFor: m,
|
|
213
|
-
className: `ms-1 ${pe[
|
|
213
|
+
className: `ms-1 ${pe[d]} ${c}`,
|
|
214
214
|
children: t
|
|
215
215
|
}
|
|
216
216
|
)
|
|
217
217
|
] }),
|
|
218
|
-
|
|
218
|
+
b && /* @__PURE__ */ u(
|
|
219
219
|
"p",
|
|
220
220
|
{
|
|
221
|
-
className: `mt-1 text-xs ${
|
|
222
|
-
children:
|
|
221
|
+
className: `mt-1 text-xs ${w === "invalid" ? "text-red-600" : "text-green-600"}`,
|
|
222
|
+
children: b
|
|
223
223
|
}
|
|
224
224
|
)
|
|
225
225
|
] });
|
|
@@ -268,22 +268,22 @@ const me = {
|
|
|
268
268
|
size: t = "md",
|
|
269
269
|
type: r = "button",
|
|
270
270
|
shape: s = "rounded",
|
|
271
|
-
className:
|
|
272
|
-
isLoading:
|
|
273
|
-
disabled:
|
|
274
|
-
...
|
|
271
|
+
className: f = "",
|
|
272
|
+
isLoading: l = !1,
|
|
273
|
+
disabled: i = !1,
|
|
274
|
+
...c
|
|
275
275
|
}) => {
|
|
276
|
-
const
|
|
276
|
+
const a = i || l, o = [
|
|
277
277
|
"inline-flex items-center justify-center font-normal transition duration-150",
|
|
278
278
|
me[n],
|
|
279
279
|
xe[t],
|
|
280
280
|
he[s],
|
|
281
281
|
s === "flat" ? "shadow-none" : "shadow-sm",
|
|
282
|
-
|
|
283
|
-
|
|
282
|
+
a ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
283
|
+
f
|
|
284
284
|
].filter(Boolean).join(" ");
|
|
285
|
-
return /* @__PURE__ */
|
|
286
|
-
|
|
285
|
+
return /* @__PURE__ */ C("button", { type: r, className: o, disabled: a, ...c, children: [
|
|
286
|
+
l && /* @__PURE__ */ C(
|
|
287
287
|
"svg",
|
|
288
288
|
{
|
|
289
289
|
"aria-hidden": "true",
|
|
@@ -293,14 +293,14 @@ const me = {
|
|
|
293
293
|
fill: "none",
|
|
294
294
|
xmlns: "http://www.w3.org/2000/svg",
|
|
295
295
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ u(
|
|
297
297
|
"path",
|
|
298
298
|
{
|
|
299
299
|
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",
|
|
300
300
|
fill: "currentColor"
|
|
301
301
|
}
|
|
302
302
|
),
|
|
303
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ u(
|
|
304
304
|
"path",
|
|
305
305
|
{
|
|
306
306
|
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",
|
|
@@ -315,44 +315,67 @@ const me = {
|
|
|
315
315
|
}, _e = ({
|
|
316
316
|
label: e,
|
|
317
317
|
children: n,
|
|
318
|
-
position: t = "right"
|
|
318
|
+
position: t = "right",
|
|
319
|
+
className: r = "",
|
|
320
|
+
menuClassName: s = "",
|
|
321
|
+
width: f = "w-48",
|
|
322
|
+
closeOnSelect: l = !1,
|
|
323
|
+
transition: i = !0,
|
|
324
|
+
ariaLabel: c = "Dropdown menu",
|
|
325
|
+
...a
|
|
319
326
|
}) => {
|
|
320
|
-
const [
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
if (
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
x < g.height && h > g.height
|
|
338
|
-
);
|
|
339
|
-
}, []);
|
|
340
|
-
A(() => {
|
|
341
|
-
if (r)
|
|
342
|
-
return l(), window.addEventListener("resize", l), window.addEventListener("scroll", l, !0), () => {
|
|
343
|
-
window.removeEventListener("resize", l), window.removeEventListener("scroll", l, !0);
|
|
327
|
+
const [o, d] = P(!1), [p, x] = P(!1), g = _(null), b = _(null), w = O(() => ({
|
|
328
|
+
left: "left-0",
|
|
329
|
+
center: "left-1/2 transform -translate-x-1/2",
|
|
330
|
+
right: "right-0"
|
|
331
|
+
})[t], [t]), h = L(() => {
|
|
332
|
+
const y = b.current, v = g.current;
|
|
333
|
+
if (!y || !v) return;
|
|
334
|
+
const { top: E, bottom: M } = y.getBoundingClientRect(), I = v.offsetHeight, A = window.innerHeight - M, T = E;
|
|
335
|
+
x(A < I && T > I);
|
|
336
|
+
}, []), S = L((y) => {
|
|
337
|
+
var v, E;
|
|
338
|
+
!((v = g.current) != null && v.contains(y.target)) && !((E = b.current) != null && E.contains(y.target)) && d(!1);
|
|
339
|
+
}, []), k = L(() => d((y) => !y), []), $ = L(() => d(!1), []);
|
|
340
|
+
D(() => {
|
|
341
|
+
if (o)
|
|
342
|
+
return h(), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0), () => {
|
|
343
|
+
window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
|
|
344
344
|
};
|
|
345
|
-
}, [
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
345
|
+
}, [o, h]), D(() => (document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S)), [S]);
|
|
346
|
+
const N = L(() => {
|
|
347
|
+
l && $();
|
|
348
|
+
}, [l, $]), m = O(
|
|
349
|
+
() => [
|
|
350
|
+
"absolute z-50 bg-white rounded shadow-lg overflow-hidden",
|
|
351
|
+
p ? "bottom-full mb-2" : "top-full mt-2",
|
|
352
|
+
w,
|
|
353
|
+
f,
|
|
354
|
+
i && "transition-all duration-200 ease-out",
|
|
355
|
+
s
|
|
356
|
+
].filter(Boolean).join(" "),
|
|
357
|
+
[p, w, f, i, s]
|
|
358
|
+
);
|
|
359
|
+
return /* @__PURE__ */ C("div", { className: `relative inline-block ${r}`, ...a, children: [
|
|
360
|
+
/* @__PURE__ */ u(
|
|
361
|
+
"button",
|
|
362
|
+
{
|
|
363
|
+
ref: b,
|
|
364
|
+
onClick: k,
|
|
365
|
+
"aria-haspopup": "true",
|
|
366
|
+
"aria-expanded": o,
|
|
367
|
+
"aria-label": c,
|
|
368
|
+
className: "focus:outline-none",
|
|
369
|
+
children: e
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
o && /* @__PURE__ */ u(
|
|
350
373
|
"div",
|
|
351
374
|
{
|
|
352
|
-
ref:
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
375
|
+
ref: g,
|
|
376
|
+
role: "menu",
|
|
377
|
+
onClick: N,
|
|
378
|
+
className: m,
|
|
356
379
|
children: n
|
|
357
380
|
}
|
|
358
381
|
)
|
|
@@ -363,22 +386,22 @@ const me = {
|
|
|
363
386
|
position: t = "top",
|
|
364
387
|
className: r = "",
|
|
365
388
|
tooltipClass: s = "",
|
|
366
|
-
tooltipStyle:
|
|
389
|
+
tooltipStyle: f = {}
|
|
367
390
|
}) => {
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
const
|
|
371
|
-
if (!
|
|
372
|
-
const
|
|
391
|
+
const l = _(null), i = _(null);
|
|
392
|
+
D(() => {
|
|
393
|
+
const a = l.current, o = i.current;
|
|
394
|
+
if (!a || !o) return;
|
|
395
|
+
const d = () => {
|
|
373
396
|
o.style.opacity = "1", o.style.visibility = "visible";
|
|
374
|
-
},
|
|
397
|
+
}, p = () => {
|
|
375
398
|
o.style.opacity = "0", o.style.visibility = "hidden";
|
|
376
399
|
};
|
|
377
|
-
return
|
|
378
|
-
|
|
400
|
+
return a.addEventListener("mouseenter", d), a.addEventListener("mouseleave", p), () => {
|
|
401
|
+
a.removeEventListener("mouseenter", d), a.removeEventListener("mouseleave", p);
|
|
379
402
|
};
|
|
380
403
|
}, []);
|
|
381
|
-
const
|
|
404
|
+
const c = (a) => {
|
|
382
405
|
const o = {
|
|
383
406
|
position: "absolute",
|
|
384
407
|
opacity: 0,
|
|
@@ -396,7 +419,7 @@ const me = {
|
|
|
396
419
|
zIndex: 9999,
|
|
397
420
|
width: "max-content"
|
|
398
421
|
};
|
|
399
|
-
switch (
|
|
422
|
+
switch (a) {
|
|
400
423
|
case "top":
|
|
401
424
|
return {
|
|
402
425
|
...o,
|
|
@@ -433,17 +456,17 @@ const me = {
|
|
|
433
456
|
return o;
|
|
434
457
|
}
|
|
435
458
|
};
|
|
436
|
-
return /* @__PURE__ */
|
|
459
|
+
return /* @__PURE__ */ C("div", { ref: l, className: `relative inline-block ${r}`, children: [
|
|
437
460
|
e,
|
|
438
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ u(
|
|
439
462
|
"div",
|
|
440
463
|
{
|
|
441
|
-
ref:
|
|
464
|
+
ref: i,
|
|
442
465
|
role: "tooltip",
|
|
443
466
|
className: s,
|
|
444
467
|
style: {
|
|
445
|
-
...
|
|
446
|
-
...
|
|
468
|
+
...c(t),
|
|
469
|
+
...f
|
|
447
470
|
},
|
|
448
471
|
children: n
|
|
449
472
|
}
|
|
@@ -478,26 +501,26 @@ const me = {
|
|
|
478
501
|
rounded: "rounded-sm",
|
|
479
502
|
pill: "rounded-full",
|
|
480
503
|
circle: "rounded-full p-2 w-8 h-8 justify-center"
|
|
481
|
-
},
|
|
504
|
+
}, Fe = ({
|
|
482
505
|
label: e,
|
|
483
506
|
variant: n = "primary",
|
|
484
507
|
size: t = "sm",
|
|
485
508
|
shape: r = "rounded",
|
|
486
509
|
icon: s,
|
|
487
|
-
dismissible:
|
|
488
|
-
onDismiss:
|
|
489
|
-
className:
|
|
490
|
-
...
|
|
510
|
+
dismissible: f,
|
|
511
|
+
onDismiss: l,
|
|
512
|
+
className: i = "",
|
|
513
|
+
...c
|
|
491
514
|
}) => {
|
|
492
|
-
const
|
|
493
|
-
return /* @__PURE__ */
|
|
494
|
-
s && /* @__PURE__ */
|
|
515
|
+
const a = !e && !!s, o = `inline-flex items-center font-medium ${ye[n] || ""} ${we[t] || ""} ${ve[r] || ""} ${a ? "justify-center p-2 w-8 h-8" : ""} ` + i;
|
|
516
|
+
return /* @__PURE__ */ C("span", { className: o.trim(), ...c, children: [
|
|
517
|
+
s && /* @__PURE__ */ u("span", { className: e ? "mr-1" : "", children: s }),
|
|
495
518
|
e,
|
|
496
|
-
|
|
519
|
+
f && /* @__PURE__ */ u(
|
|
497
520
|
"button",
|
|
498
521
|
{
|
|
499
522
|
type: "button",
|
|
500
|
-
onClick:
|
|
523
|
+
onClick: l,
|
|
501
524
|
className: "ml-2 text-xs font-bold leading-none focus:outline-none",
|
|
502
525
|
children: "×"
|
|
503
526
|
}
|
|
@@ -510,14 +533,14 @@ var J = {
|
|
|
510
533
|
className: void 0,
|
|
511
534
|
style: void 0,
|
|
512
535
|
attr: void 0
|
|
513
|
-
}, K =
|
|
536
|
+
}, K = j.createContext && /* @__PURE__ */ j.createContext(J), Ce = ["attr", "size", "title"];
|
|
514
537
|
function Se(e, n) {
|
|
515
538
|
if (e == null) return {};
|
|
516
539
|
var t = Ne(e, n), r, s;
|
|
517
540
|
if (Object.getOwnPropertySymbols) {
|
|
518
|
-
var
|
|
519
|
-
for (s = 0; s <
|
|
520
|
-
r =
|
|
541
|
+
var f = Object.getOwnPropertySymbols(e);
|
|
542
|
+
for (s = 0; s < f.length; s++)
|
|
543
|
+
r = f[s], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
521
544
|
}
|
|
522
545
|
return t;
|
|
523
546
|
}
|
|
@@ -531,15 +554,15 @@ function Ne(e, n) {
|
|
|
531
554
|
}
|
|
532
555
|
return t;
|
|
533
556
|
}
|
|
534
|
-
function
|
|
535
|
-
return
|
|
557
|
+
function B() {
|
|
558
|
+
return B = Object.assign ? Object.assign.bind() : function(e) {
|
|
536
559
|
for (var n = 1; n < arguments.length; n++) {
|
|
537
560
|
var t = arguments[n];
|
|
538
561
|
for (var r in t)
|
|
539
562
|
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
540
563
|
}
|
|
541
564
|
return e;
|
|
542
|
-
},
|
|
565
|
+
}, B.apply(this, arguments);
|
|
543
566
|
}
|
|
544
567
|
function U(e, n) {
|
|
545
568
|
var t = Object.keys(e);
|
|
@@ -551,7 +574,7 @@ function U(e, n) {
|
|
|
551
574
|
}
|
|
552
575
|
return t;
|
|
553
576
|
}
|
|
554
|
-
function
|
|
577
|
+
function F(e) {
|
|
555
578
|
for (var n = 1; n < arguments.length; n++) {
|
|
556
579
|
var t = arguments[n] != null ? arguments[n] : {};
|
|
557
580
|
n % 2 ? U(Object(t), !0).forEach(function(r) {
|
|
@@ -580,13 +603,13 @@ function Ee(e, n) {
|
|
|
580
603
|
return (n === "string" ? String : Number)(e);
|
|
581
604
|
}
|
|
582
605
|
function Q(e) {
|
|
583
|
-
return e && e.map((n, t) => /* @__PURE__ */
|
|
606
|
+
return e && e.map((n, t) => /* @__PURE__ */ j.createElement(n.tag, F({
|
|
584
607
|
key: t
|
|
585
608
|
}, n.attr), Q(n.child)));
|
|
586
609
|
}
|
|
587
610
|
function V(e) {
|
|
588
|
-
return (n) => /* @__PURE__ */
|
|
589
|
-
attr:
|
|
611
|
+
return (n) => /* @__PURE__ */ j.createElement(Le, B({
|
|
612
|
+
attr: F({}, e.attr)
|
|
590
613
|
}, n), Q(e.child));
|
|
591
614
|
}
|
|
592
615
|
function Le(e) {
|
|
@@ -594,87 +617,88 @@ function Le(e) {
|
|
|
594
617
|
var {
|
|
595
618
|
attr: r,
|
|
596
619
|
size: s,
|
|
597
|
-
title:
|
|
598
|
-
} = e,
|
|
599
|
-
return t.className && (
|
|
620
|
+
title: f
|
|
621
|
+
} = e, l = Se(e, Ce), i = s || t.size || "1em", c;
|
|
622
|
+
return t.className && (c = t.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ j.createElement("svg", B({
|
|
600
623
|
stroke: "currentColor",
|
|
601
624
|
fill: "currentColor",
|
|
602
625
|
strokeWidth: "0"
|
|
603
|
-
}, t.attr, r,
|
|
604
|
-
className:
|
|
605
|
-
style:
|
|
626
|
+
}, t.attr, r, l, {
|
|
627
|
+
className: c,
|
|
628
|
+
style: F(F({
|
|
606
629
|
color: e.color || t.color
|
|
607
630
|
}, t.style), e.style),
|
|
608
|
-
height:
|
|
609
|
-
width:
|
|
631
|
+
height: i,
|
|
632
|
+
width: i,
|
|
610
633
|
xmlns: "http://www.w3.org/2000/svg"
|
|
611
|
-
}),
|
|
634
|
+
}), f && /* @__PURE__ */ j.createElement("title", null, f), e.children);
|
|
612
635
|
};
|
|
613
|
-
return K !== void 0 ? /* @__PURE__ */
|
|
636
|
+
return K !== void 0 ? /* @__PURE__ */ j.createElement(K.Consumer, null, (t) => n(t)) : n(J);
|
|
614
637
|
}
|
|
615
638
|
function Oe(e) {
|
|
616
639
|
return V({ 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);
|
|
617
640
|
}
|
|
618
|
-
const
|
|
641
|
+
const Re = ({
|
|
619
642
|
items: e,
|
|
620
643
|
allowMultipleOpen: n = !1,
|
|
621
644
|
className: t = "",
|
|
622
645
|
tileClasses: r = "",
|
|
623
646
|
open: s,
|
|
624
|
-
onChange:
|
|
625
|
-
renderTitle:
|
|
626
|
-
renderContent:
|
|
627
|
-
showArrowIcon:
|
|
647
|
+
onChange: f,
|
|
648
|
+
renderTitle: l,
|
|
649
|
+
renderContent: i,
|
|
650
|
+
showArrowIcon: c = !0,
|
|
651
|
+
panelClasses: a = ""
|
|
628
652
|
}) => {
|
|
629
|
-
const [
|
|
630
|
-
(
|
|
631
|
-
const
|
|
632
|
-
|
|
653
|
+
const [o, d] = P(/* @__PURE__ */ new Set()), p = O(() => s ? new Set(s) : o, [s, o]), x = L(
|
|
654
|
+
(g) => {
|
|
655
|
+
const b = new Set(p);
|
|
656
|
+
b.has(g) ? b.delete(g) : (n || b.clear(), b.add(g)), s && f ? f(Array.from(b)) : d(b);
|
|
633
657
|
},
|
|
634
|
-
[
|
|
658
|
+
[p, s, f, n]
|
|
635
659
|
);
|
|
636
|
-
return /* @__PURE__ */
|
|
660
|
+
return /* @__PURE__ */ u(
|
|
637
661
|
"div",
|
|
638
662
|
{
|
|
639
663
|
className: "accordion",
|
|
640
664
|
role: "region",
|
|
641
665
|
"aria-multiselectable": n,
|
|
642
|
-
children: e.map((
|
|
643
|
-
const
|
|
644
|
-
return /* @__PURE__ */
|
|
666
|
+
children: e.map((g) => {
|
|
667
|
+
const b = p.has(g.id), w = `accordion-heading-${g.id}`, h = `accordion-panel-${g.id}`;
|
|
668
|
+
return /* @__PURE__ */ C(
|
|
645
669
|
"div",
|
|
646
670
|
{
|
|
647
671
|
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,
|
|
648
672
|
children: [
|
|
649
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ C(
|
|
650
674
|
"button",
|
|
651
675
|
{
|
|
652
|
-
id:
|
|
676
|
+
id: w,
|
|
653
677
|
type: "button",
|
|
654
|
-
"aria-expanded":
|
|
678
|
+
"aria-expanded": b,
|
|
655
679
|
"aria-controls": h,
|
|
656
|
-
onClick: () =>
|
|
680
|
+
onClick: () => x(g.id),
|
|
657
681
|
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}`,
|
|
658
682
|
children: [
|
|
659
|
-
|
|
660
|
-
|
|
683
|
+
l ? l(g, b) : g.title,
|
|
684
|
+
c ? /* @__PURE__ */ u(Oe, {}) : null
|
|
661
685
|
]
|
|
662
686
|
}
|
|
663
687
|
),
|
|
664
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ u(
|
|
665
689
|
"div",
|
|
666
690
|
{
|
|
667
691
|
id: h,
|
|
668
692
|
role: "region",
|
|
669
|
-
"aria-labelledby":
|
|
670
|
-
hidden: !
|
|
671
|
-
className:
|
|
672
|
-
children:
|
|
693
|
+
"aria-labelledby": w,
|
|
694
|
+
hidden: !b,
|
|
695
|
+
className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${a}`,
|
|
696
|
+
children: i ? i(g, b) : g.content
|
|
673
697
|
}
|
|
674
698
|
)
|
|
675
699
|
]
|
|
676
700
|
},
|
|
677
|
-
|
|
701
|
+
g.id
|
|
678
702
|
);
|
|
679
703
|
})
|
|
680
704
|
}
|
|
@@ -687,24 +711,24 @@ const Fe = ({
|
|
|
687
711
|
);
|
|
688
712
|
return e;
|
|
689
713
|
}, re = X(null), ne = () => Y(re);
|
|
690
|
-
function
|
|
714
|
+
function He({
|
|
691
715
|
id: e,
|
|
692
716
|
title: n,
|
|
693
717
|
children: t,
|
|
694
718
|
standalone: r = !1,
|
|
695
719
|
showFloatingClose: s = !1,
|
|
696
|
-
containerClasses:
|
|
697
|
-
onClose:
|
|
698
|
-
disableEscapeClose:
|
|
720
|
+
containerClasses: f = "",
|
|
721
|
+
onClose: l,
|
|
722
|
+
disableEscapeClose: i = !1
|
|
699
723
|
}) {
|
|
700
|
-
const
|
|
701
|
-
o ?
|
|
702
|
-
}, [o,
|
|
703
|
-
return
|
|
704
|
-
const
|
|
724
|
+
const c = ne(), a = te(), o = !r && !!c && !!a, [d, p] = P(!1), x = o ? c.isOpen(e) : d, g = o ? c.getModalData(e) : null, b = L(() => {
|
|
725
|
+
o ? a.closeModal(e) : p(!1), l == null || l();
|
|
726
|
+
}, [o, a, e, l]);
|
|
727
|
+
return D(() => {
|
|
728
|
+
const w = document.activeElement;
|
|
705
729
|
console.log(e);
|
|
706
|
-
const
|
|
707
|
-
console.log("modalEl=",
|
|
730
|
+
const h = document.getElementById(e);
|
|
731
|
+
console.log("modalEl=", h);
|
|
708
732
|
const S = [
|
|
709
733
|
"a[href]",
|
|
710
734
|
"button:not([disabled])",
|
|
@@ -712,97 +736,97 @@ function Ze({
|
|
|
712
736
|
"input:not([disabled])",
|
|
713
737
|
"select:not([disabled])",
|
|
714
738
|
'[tabindex]:not([tabindex="-1"])'
|
|
715
|
-
],
|
|
716
|
-
if (!
|
|
717
|
-
const m =
|
|
739
|
+
], k = () => {
|
|
740
|
+
if (!h) return [];
|
|
741
|
+
const m = h.querySelectorAll(
|
|
718
742
|
S.join(",")
|
|
719
743
|
);
|
|
720
|
-
return Array.from(m).filter((
|
|
721
|
-
},
|
|
744
|
+
return Array.from(m).filter((y) => y.offsetParent !== null);
|
|
745
|
+
}, $ = (m) => {
|
|
722
746
|
if (m.key === "Tab") {
|
|
723
|
-
const
|
|
724
|
-
if (
|
|
725
|
-
const
|
|
726
|
-
m.shiftKey ? document.activeElement ===
|
|
747
|
+
const y = k();
|
|
748
|
+
if (y.length === 0) return;
|
|
749
|
+
const v = y[0], E = y[y.length - 1];
|
|
750
|
+
m.shiftKey ? document.activeElement === v && (m.preventDefault(), E.focus()) : document.activeElement === E && (m.preventDefault(), v.focus());
|
|
727
751
|
}
|
|
728
|
-
},
|
|
729
|
-
m.key === "Escape" && !
|
|
752
|
+
}, N = (m) => {
|
|
753
|
+
m.key === "Escape" && !i && b(), $(m);
|
|
730
754
|
};
|
|
731
|
-
return
|
|
732
|
-
const m =
|
|
755
|
+
return x && (document.body.style.overflow = "hidden", setTimeout(() => {
|
|
756
|
+
const m = k();
|
|
733
757
|
m.length && m[0].focus();
|
|
734
|
-
}, 0), window.addEventListener("keydown",
|
|
735
|
-
document.body.style.overflow = "",
|
|
758
|
+
}, 0), window.addEventListener("keydown", N)), () => {
|
|
759
|
+
document.body.style.overflow = "", w && w.focus(), window.removeEventListener("keydown", N);
|
|
736
760
|
};
|
|
737
|
-
}, [
|
|
761
|
+
}, [x, i, b, e]), x ? /* @__PURE__ */ u(
|
|
738
762
|
"div",
|
|
739
763
|
{
|
|
740
764
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",
|
|
741
765
|
id: e,
|
|
742
|
-
children: /* @__PURE__ */
|
|
766
|
+
children: /* @__PURE__ */ C(
|
|
743
767
|
"div",
|
|
744
768
|
{
|
|
745
|
-
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${
|
|
769
|
+
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${f}`,
|
|
746
770
|
children: [
|
|
747
|
-
/* @__PURE__ */
|
|
748
|
-
n && /* @__PURE__ */
|
|
749
|
-
s && /* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ C("div", { className: "flex justify-between items-center relative", children: [
|
|
772
|
+
n && /* @__PURE__ */ u("h2", { className: "text-lg font-semibold", children: n }),
|
|
773
|
+
s && /* @__PURE__ */ u(
|
|
750
774
|
"button",
|
|
751
775
|
{
|
|
752
|
-
onClick:
|
|
776
|
+
onClick: b,
|
|
753
777
|
className: "text-gray-500 hover:text-black absolute top-2 right-3 hover:bg-gray-200 rounded-full aspect-square w-8",
|
|
754
778
|
"aria-label": "Close modal",
|
|
755
779
|
children: "✕"
|
|
756
780
|
}
|
|
757
781
|
)
|
|
758
782
|
] }),
|
|
759
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ u("div", { className: "mt-3 text-sm text-gray-700", children: typeof t == "function" ? t({ modalData: g }) : t })
|
|
760
784
|
]
|
|
761
785
|
}
|
|
762
786
|
)
|
|
763
787
|
}
|
|
764
788
|
) : null;
|
|
765
789
|
}
|
|
766
|
-
function
|
|
790
|
+
function Ze({
|
|
767
791
|
children: e
|
|
768
792
|
}) {
|
|
769
|
-
const [n, t] =
|
|
770
|
-
t((
|
|
771
|
-
}, []),
|
|
772
|
-
t((
|
|
773
|
-
const
|
|
774
|
-
return delete
|
|
793
|
+
const [n, t] = P({}), [r, s] = P({}), f = L((d, p) => {
|
|
794
|
+
t((x) => ({ ...x, [d]: !0 })), p && s((x) => ({ ...x, [d]: p }));
|
|
795
|
+
}, []), l = L((d) => {
|
|
796
|
+
t((p) => ({ ...p, [d]: !1 })), s((p) => {
|
|
797
|
+
const x = { ...p };
|
|
798
|
+
return delete x[d], x;
|
|
775
799
|
});
|
|
776
|
-
}, []),
|
|
777
|
-
(
|
|
800
|
+
}, []), i = L((d) => !!n[d], [n]), c = L(
|
|
801
|
+
(d) => r[d],
|
|
778
802
|
[r]
|
|
779
|
-
),
|
|
780
|
-
() => ({ openModal:
|
|
781
|
-
[
|
|
782
|
-
), o =
|
|
783
|
-
() => ({ isOpen:
|
|
784
|
-
[
|
|
803
|
+
), a = O(
|
|
804
|
+
() => ({ openModal: f, closeModal: l }),
|
|
805
|
+
[f, l]
|
|
806
|
+
), o = O(
|
|
807
|
+
() => ({ isOpen: i, getModalData: c }),
|
|
808
|
+
[i, c]
|
|
785
809
|
);
|
|
786
|
-
return /* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ u(ee.Provider, { value: a, children: /* @__PURE__ */ u(re.Provider, { value: o, children: e }) });
|
|
787
811
|
}
|
|
788
|
-
function
|
|
812
|
+
function Ge(e) {
|
|
789
813
|
const { openModal: n, closeModal: t } = te(), { isOpen: r, getModalData: s } = ne();
|
|
790
814
|
return {
|
|
791
|
-
open: (
|
|
815
|
+
open: (f) => n(e, f),
|
|
792
816
|
close: () => t(e),
|
|
793
817
|
isOpen: r(e),
|
|
794
818
|
data: s(e)
|
|
795
819
|
};
|
|
796
820
|
}
|
|
797
|
-
let R = null,
|
|
821
|
+
let R = null, H = {};
|
|
798
822
|
function Pe(e) {
|
|
799
823
|
R = e;
|
|
800
824
|
}
|
|
801
825
|
function We(e) {
|
|
802
|
-
|
|
826
|
+
H = { ...H, ...e };
|
|
803
827
|
}
|
|
804
828
|
function je() {
|
|
805
|
-
return
|
|
829
|
+
return H;
|
|
806
830
|
}
|
|
807
831
|
function Ke(e, n, t = 3e3, r) {
|
|
808
832
|
R ? R(e, n, t, r) : console.warn("Toast system is not mounted");
|
|
@@ -814,37 +838,37 @@ const Ae = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, functio
|
|
|
814
838
|
const n = Math.random() * 16 | 0;
|
|
815
839
|
return (e === "x" ? n : n & 3 | 8).toString(16);
|
|
816
840
|
}), Ue = () => {
|
|
817
|
-
const [e, n] =
|
|
818
|
-
|
|
819
|
-
Pe((r, s,
|
|
820
|
-
const
|
|
821
|
-
n((
|
|
822
|
-
n((
|
|
823
|
-
},
|
|
841
|
+
const [e, n] = P([]);
|
|
842
|
+
D(() => {
|
|
843
|
+
Pe((r, s, f, l) => {
|
|
844
|
+
const i = Ae();
|
|
845
|
+
n((c) => [...c, { id: i, type: r, message: s, config: l }]), setTimeout(() => {
|
|
846
|
+
n((c) => c.filter((a) => a.id !== i));
|
|
847
|
+
}, f);
|
|
824
848
|
});
|
|
825
849
|
}, []);
|
|
826
850
|
const t = je();
|
|
827
|
-
return /* @__PURE__ */
|
|
828
|
-
var
|
|
829
|
-
const s = ((
|
|
830
|
-
return /* @__PURE__ */
|
|
851
|
+
return /* @__PURE__ */ u("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((r) => {
|
|
852
|
+
var c, a, o, d, p, x, g, b, w, h, S, k, $;
|
|
853
|
+
const s = ((c = r.config) == null ? void 0 : c.icon) || ((a = t.icons) == null ? void 0 : a[r.type]) || ze(r.type), f = ((o = r.config) == null ? void 0 : o.bgColor) || ((p = (d = t.colors) == null ? void 0 : d[r.type]) == null ? void 0 : p.bg) || "bg-white dark:bg-gray-800", l = ((x = r.config) == null ? void 0 : x.textColor) || ((b = (g = t.colors) == null ? void 0 : g[r.type]) == null ? void 0 : b.text) || "text-gray-700 dark:text-gray-300", i = ((w = r.config) == null ? void 0 : w.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
|
|
854
|
+
return /* @__PURE__ */ C(
|
|
831
855
|
"div",
|
|
832
856
|
{
|
|
833
|
-
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${
|
|
857
|
+
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${f} ${l}`,
|
|
834
858
|
children: [
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
((
|
|
838
|
-
((S = r.config) == null ? void 0 : S.description) && /* @__PURE__ */
|
|
839
|
-
!((
|
|
859
|
+
/* @__PURE__ */ u("div", { className: i, children: s }),
|
|
860
|
+
/* @__PURE__ */ C("div", { className: "flex-1 me-3", children: [
|
|
861
|
+
((h = r.config) == null ? void 0 : h.title) && /* @__PURE__ */ u("div", { className: "font-semibold text-black", children: r.config.title }),
|
|
862
|
+
((S = r.config) == null ? void 0 : S.description) && /* @__PURE__ */ u("div", { className: "text-sm text-gray-500", children: r.config.description }),
|
|
863
|
+
!((k = r.config) != null && k.title) && !(($ = r.config) != null && $.description) && /* @__PURE__ */ u("div", { className: "text-sm", children: r.message })
|
|
840
864
|
] }),
|
|
841
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ u(
|
|
842
866
|
"button",
|
|
843
867
|
{
|
|
844
|
-
onClick: () => n((
|
|
868
|
+
onClick: () => n((N) => N.filter((m) => m.id !== r.id)),
|
|
845
869
|
className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
|
|
846
870
|
"aria-label": "Close",
|
|
847
|
-
children: /* @__PURE__ */
|
|
871
|
+
children: /* @__PURE__ */ u(Ie, { size: 18 })
|
|
848
872
|
}
|
|
849
873
|
)
|
|
850
874
|
]
|
|
@@ -866,19 +890,19 @@ function ze(e) {
|
|
|
866
890
|
}
|
|
867
891
|
}
|
|
868
892
|
export {
|
|
869
|
-
|
|
870
|
-
|
|
893
|
+
Re as Accordion,
|
|
894
|
+
Fe as Badge,
|
|
871
895
|
Te as Button,
|
|
872
896
|
_e as Dropdown,
|
|
873
897
|
ce as Input,
|
|
874
|
-
|
|
875
|
-
|
|
898
|
+
He as Modal,
|
|
899
|
+
Ze as ModalProvider,
|
|
876
900
|
be as Select,
|
|
877
901
|
Ue as Toast,
|
|
878
902
|
Be as Tooltip,
|
|
879
903
|
We as setToastDefaults,
|
|
880
904
|
Ke as showToast,
|
|
881
905
|
te as useModalActions,
|
|
882
|
-
|
|
906
|
+
Ge as useModalInstance,
|
|
883
907
|
ne as useModalState
|
|
884
908
|
};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(F);const
|
|
3
|
-
${
|
|
4
|
-
${v&&
|
|
5
|
-
${
|
|
6
|
-
${L} ${
|
|
7
|
-
${
|
|
8
|
-
${_} ${D} ${d}`,children:x}),E&&r&&i&&n.jsx("label",{htmlFor:v,className:`ms-1 ${le[i]} ${d}`,children:r})]}),w&&n.jsx("p",{className:`mt-1 text-xs ${m==="invalid"?"text-red-600":"text-green-600"}`,children:w})]})});H.displayName="Select";const se={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"},ce={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"},ie={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:t="primary",size:r="md",type:o="button",shape:s="rounded",className:h="",isLoading:b=!1,disabled:u=!1,...d})=>{const f=u||b,a=["inline-flex items-center justify-center font-normal transition duration-150",se[t],ce[r],ie[s],s==="flat"?"shadow-none":"shadow-sm",f?"opacity-50 cursor-not-allowed":"cursor-pointer",h].filter(Boolean).join(" ");return n.jsxs("button",{type:o,className:a,disabled:f,...d,children:[b&&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:t,position:r="right"})=>{const[o,s]=l.useState(!1),[h,b]=l.useState(!1),u=l.useRef(null),d=l.useRef(null),f=l.useMemo(()=>{switch(r){case"left":return"left-0";case"center":return"left-1/2 transform -translate-x-1/2";case"right":default:return"right-0"}},[r]),a=l.useCallback(c=>{const g=c.target;u.current&&!u.current.contains(g)&&d.current&&!d.current.contains(g)&&s(!1)},[]),i=l.useCallback(()=>{if(!d.current||!u.current)return;const c=d.current.getBoundingClientRect(),g=u.current.getBoundingClientRect(),w=window.innerHeight-c.bottom,m=c.top;b(w<g.height&&m>g.height)},[]);l.useEffect(()=>{if(o)return i(),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[o,i]),l.useEffect(()=>(document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)),[a]);const p=l.useCallback(()=>s(c=>!c),[]);return n.jsxs("div",{className:"relative flex items-center",children:[n.jsx("button",{ref:d,onClick:p,children:e}),o&&n.jsx("div",{ref:u,className:`absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
|
|
9
|
-
${h?"bottom-full mb-2":"top-full mt-2"}
|
|
10
|
-
${f}`,children:t})]})},fe=({children:e,content:t,position:r="top",className:o="",tooltipClass:s="",tooltipStyle:h={}})=>{const b=l.useRef(null),u=l.useRef(null);l.useEffect(()=>{const f=b.current,a=u.current;if(!f||!a)return;const i=()=>{a.style.opacity="1",a.style.visibility="visible"},p=()=>{a.style.opacity="0",a.style.visibility="hidden"};return f.addEventListener("mouseenter",i),f.addEventListener("mouseleave",p),()=>{f.removeEventListener("mouseenter",i),f.removeEventListener("mouseleave",p)}},[]);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:b,className:`relative inline-block ${o}`,children:[e,n.jsx("div",{ref:u,role:"tooltip",className:s,style:{...d(r),...h},children:t})]})},be={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"},he={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"},pe=({label:e,variant:t="primary",size:r="sm",shape:o="rounded",icon:s,dismissible:h,onDismiss:b,className:u="",...d})=>{const f=!e&&!!s,a=`inline-flex items-center font-medium ${be[t]||""} ${he[r]||""} ${ge[o]||""} ${f?"justify-center p-2 w-8 h-8":""} `+u;return n.jsxs("span",{className:a.trim(),...d,children:[s&&n.jsx("span",{className:e?"mr-1":"",children:s}),e,h&&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=l.createContext&&l.createContext(K),ve=["attr","size","title"];function ye(e,t){if(e==null)return{};var r=we(e,t),o,s;if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(e);for(s=0;s<h.length;s++)o=h[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function we(e,t){if(e==null)return{};var r={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;r[o]=e[o]}return r}function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},P.apply(this,arguments)}function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W(Object(r),!0).forEach(function(o){me(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function me(e,t,r){return t=xe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xe(e){var t=ke(e,"string");return typeof t=="symbol"?t:t+""}function ke(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function X(e){return e&&e.map((t,r)=>l.createElement(t.tag,j({key:r},t.attr),X(t.child)))}function Y(e){return t=>l.createElement(Ce,P({attr:j({},e.attr)},t),X(e.child))}function Ce(e){var t=r=>{var{attr:o,size:s,title:h}=e,b=ye(e,ve),u=s||r.size||"1em",d;return r.className&&(d=r.className),e.className&&(d=(d?d+" ":"")+e.className),l.createElement("svg",P({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,o,b,{className:d,style:j(j({color:e.color||r.color},r.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),h&&l.createElement("title",null,h),e.children)};return U!==void 0?l.createElement(U.Consumer,null,r=>t(r)):t(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:t=!1,className:r="",tileClasses:o="",open:s,onChange:h,renderTitle:b,renderContent:u,showArrowIcon:d=!0})=>{const[f,a]=l.useState(new Set),i=l.useMemo(()=>s?new Set(s):f,[s,f]),p=l.useCallback(c=>{const g=new Set(i);g.has(c)?g.delete(c):(t||g.clear(),g.add(c)),s&&h?h(Array.from(g)):a(g)},[i,s,h,t]);return n.jsx("div",{className:"accordion",role:"region","aria-multiselectable":t,children:e.map(c=>{const g=i.has(c.id),w=`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 ${r}`,children:[n.jsxs("button",{id:w,type:"button","aria-expanded":g,"aria-controls":m,onClick:()=>p(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 ${o}`,children:[b?b(c,g):c.title,d?n.jsx(Se,{}):null]}),n.jsx("div",{id:m,role:"region","aria-labelledby":w,hidden:!g,className:"p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",children:u?u(c,g):c.content})]},c.id)})})},J=l.createContext(null),I=()=>{const e=l.useContext(J);if(!e)throw new Error("useModalActions must be used within a ModalActionProvider");return e},Q=l.createContext(null),T=()=>l.useContext(Q);function Ee({id:e,title:t,children:r,standalone:o=!1,showFloatingClose:s=!1,containerClasses:h="",onClose:b,disableEscapeClose:u=!1}){const d=T(),f=I(),a=!o&&!!d&&!!f,[i,p]=l.useState(!1),c=a?d.isOpen(e):i,g=a?d.getModalData(e):null,w=l.useCallback(()=>{a?f.closeModal(e):p(!1),b==null||b()},[a,f,e,b]);return l.useEffect(()=>{const m=document.activeElement;console.log(e);const x=document.getElementById(e);console.log("modalEl=",x);const S=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],N=()=>{if(!x)return[];const v=x.querySelectorAll(S.join(","));return Array.from(v).filter(C=>C.offsetParent!==null)},$=v=>{if(v.key==="Tab"){const C=N();if(C.length===0)return;const E=C[0],L=C[C.length-1];v.shiftKey?document.activeElement===E&&(v.preventDefault(),L.focus()):document.activeElement===L&&(v.preventDefault(),E.focus())}},k=v=>{v.key==="Escape"&&!u&&w(),$(v)};return c&&(document.body.style.overflow="hidden",setTimeout(()=>{const v=N();v.length&&v[0].focus()},0),window.addEventListener("keydown",k)),()=>{document.body.style.overflow="",m&&m.focus(),window.removeEventListener("keydown",k)}},[c,u,w,e]),c?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 ${h}`,children:[n.jsxs("div",{className:"flex justify-between items-center relative",children:[t&&n.jsx("h2",{className:"text-lg font-semibold",children:t}),s&&n.jsx("button",{onClick:w,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 r=="function"?r({modalData:g}):r})]})}):null}function $e({children:e}){const[t,r]=l.useState({}),[o,s]=l.useState({}),h=l.useCallback((i,p)=>{r(c=>({...c,[i]:!0})),p&&s(c=>({...c,[i]:p}))},[]),b=l.useCallback(i=>{r(p=>({...p,[i]:!1})),s(p=>{const c={...p};return delete c[i],c})},[]),u=l.useCallback(i=>!!t[i],[t]),d=l.useCallback(i=>o[i],[o]),f=l.useMemo(()=>({openModal:h,closeModal:b}),[h,b]),a=l.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:t,closeModal:r}=I(),{isOpen:o,getModalData:s}=T();return{open:h=>t(e,h),close:()=>r(e),isOpen:o(e),data:s(e)}}let A=null,z={};function Oe(e){A=e}function Me(e){z={...z,...e}}function Pe(){return z}function je(e,t,r=3e3,o){A?A(e,t,r,o):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 t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Ae=()=>{const[e,t]=l.useState([]);l.useEffect(()=>{Oe((o,s,h,b)=>{const u=Te();t(d=>[...d,{id:u,type:o,message:s,config:b}]),setTimeout(()=>{t(d=>d.filter(f=>f.id!==u))},h)})},[]);const r=Pe();return n.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(o=>{var d,f,a,i,p,c,g,w,m,x,S,N,$;const s=((d=o.config)==null?void 0:d.icon)||((f=r.icons)==null?void 0:f[o.type])||ze(o.type),h=((a=o.config)==null?void 0:a.bgColor)||((p=(i=r.colors)==null?void 0:i[o.type])==null?void 0:p.bg)||"bg-white dark:bg-gray-800",b=((c=o.config)==null?void 0:c.textColor)||((w=(g=r.colors)==null?void 0:g[o.type])==null?void 0:w.text)||"text-gray-700 dark:text-gray-300",u=((m=o.config)==null?void 0:m.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 ${h} ${b}`,children:[n.jsx("div",{className:u,children:s}),n.jsxs("div",{className:"flex-1 me-3",children:[((x=o.config)==null?void 0:x.title)&&n.jsx("div",{className:"font-semibold text-black",children:o.config.title}),((S=o.config)==null?void 0:S.description)&&n.jsx("div",{className:"text-sm text-gray-500",children:o.config.description}),!((N=o.config)!=null&&N.title)&&!(($=o.config)!=null&&$.description)&&n.jsx("div",{className:"text-sm",children:o.message})]}),n.jsx("button",{onClick:()=>t(k=>k.filter(v=>v.id!==o.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})})]},o.id)})})};function ze(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}y.Accordion=Ne,y.Badge=pe,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"})});
|
|
1
|
+
(function(w,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):(w=typeof globalThis<"u"?globalThis:w||self,n(w.TailwindUiKit={},w.jsxRuntime,w.React))})(this,function(w,n,l){"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-success{background-color:var(--color-green-600,oklch(62.7% .194 149.214));color:var(--color-white,#fff)}@media (hover:hover){.btn-success:hover{background-color:var(--color-green-700,oklch(52.7% .154 150.069))}}.btn-outline-success{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-green-600,oklch(62.7% .194 149.214));color:var(--color-green-600,oklch(62.7% .194 149.214))}@media (hover:hover){.btn-outline-success:hover{background-color:var(--color-green-50,oklch(98.2% .018 155.826))}}.btn-soft-success{background-color:var(--color-green-100,oklch(96.2% .044 156.743));color:var(--color-green-700,oklch(52.7% .154 150.069))}@media (hover:hover){.btn-soft-success:hover{background-color:var(--color-green-200,oklch(92.5% .084 155.995))}}.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-warning{background-color:var(--color-yellow-500,oklch(79.5% .184 86.047));color:var(--color-white,#fff)}@media (hover:hover){.btn-warning:hover{background-color:var(--color-yellow-600,oklch(68.1% .162 75.834))}}.btn-outline-warning{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-yellow-500,oklch(79.5% .184 86.047));color:var(--color-yellow-600,oklch(68.1% .162 75.834))}@media (hover:hover){.btn-outline-warning:hover{background-color:var(--color-yellow-50,oklch(98.7% .026 102.212))}}.btn-soft-warning{background-color:var(--color-yellow-100,oklch(97.3% .071 103.193));color:var(--color-yellow-700,oklch(55.4% .135 66.442))}@media (hover:hover){.btn-soft-warning:hover{background-color:var(--color-yellow-200,oklch(94.5% .129 101.54))}}.btn-info{background-color:var(--color-cyan-600,oklch(60.9% .126 221.723));color:var(--color-white,#fff)}@media (hover:hover){.btn-info:hover{background-color:var(--color-cyan-700,oklch(52% .105 223.128))}}.btn-outline-info{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-cyan-600,oklch(60.9% .126 221.723));color:var(--color-cyan-600,oklch(60.9% .126 221.723))}@media (hover:hover){.btn-outline-info:hover{background-color:var(--color-cyan-50,oklch(98.4% .019 200.873))}}.btn-soft-info{background-color:var(--color-cyan-100,oklch(95.6% .045 203.388));color:var(--color-cyan-700,oklch(52% .105 223.128))}@media (hover:hover){.btn-soft-info:hover{background-color:var(--color-cyan-200,oklch(91.7% .08 205.041))}}.btn-dark{background-color:var(--color-gray-900,oklch(21% .034 264.665));color:var(--color-white,#fff)}@media (hover:hover){.btn-dark:hover{background-color:var(--color-black,#000)}}.btn-outline-dark{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-gray-900,oklch(21% .034 264.665));color:var(--color-gray-900,oklch(21% .034 264.665))}@media (hover:hover){.btn-outline-dark:hover{background-color:var(--color-gray-100,oklch(96.7% .003 264.542))}}.btn-soft-dark{background-color:var(--color-gray-200,oklch(92.8% .006 264.531));color:var(--color-gray-900,oklch(21% .034 264.665))}@media (hover:hover){.btn-soft-dark:hover{background-color:var(--color-gray-300,oklch(87.2% .01 258.338))}}.btn-light{background-color:var(--color-gray-100,oklch(96.7% .003 264.542));color:var(--color-gray-800,oklch(27.8% .033 256.848))}@media (hover:hover){.btn-light:hover{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}}.btn-outline-light{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-gray-100,oklch(96.7% .003 264.542));color:var(--color-gray-600,oklch(44.6% .03 256.802))}@media (hover:hover){.btn-outline-light:hover{background-color:var(--color-gray-50,oklch(98.5% .002 247.839))}}.btn-soft-light{background-color:var(--color-gray-50,oklch(98.5% .002 247.839));color:var(--color-gray-700,oklch(37.3% .034 259.733))}@media (hover:hover){.btn-soft-light:hover{background-color:var(--color-gray-100,oklch(96.7% .003 264.542))}}.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 H={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"},Z={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"},re=(e,t,r)=>{if(r)return"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";if(t)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"}},G=l.forwardRef((e,t)=>{const{label:r,id:o,inputSize:s="md",shape:b="rounded",validate:i,onValidatedChange:d,className:u="",icon:c,iconPosition:a="left",floatingLabelStyle:f,onChange:h,isValid:y,isInvalid:g,feedback:p,feedbackType:k="invalid",...x}=e,[S,E]=l.useState("default"),$=l.useCallback(O=>{const I=O.target.value,j=(i==null?void 0:i(I))??"default";E(j),d==null||d(O,j),h==null||h(O)},[i,d,h]),N=l.useMemo(()=>o||(typeof r=="string"?`input-${r.toLowerCase().replace(/\s+/g,"-")}`:`input-${Math.random().toString(36).slice(2)}`),[o,r]),v=!!f,m=H[s]||H.md,C=Z[b]||Z.flat,L=l.useMemo(()=>re(S,y,g),[S,y,g]),P=l.useMemo(()=>a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5",[a]),M=l.useMemo(()=>c?a==="start"||a==="left"?"ps-10":"pe-10":"",[c,a]);return n.jsxs("div",{className:`w-full relative ${v?"z-0":""} tailwind-ux-input`,children:[!v&&r&&n.jsx("label",{htmlFor:N,className:`block mb-1 text-sm ${y?"text-green-700 dark:text-green-500":g?"text-red-700 dark:text-red-500":"text-gray-700"}`,children:r}),n.jsxs("div",{className:"relative w-full",children:[c&&n.jsx("div",{className:`absolute inset-y-0 flex items-center ${P}`,"aria-hidden":"true",children:n.jsx("span",{className:"text-gray-500",children:c})}),n.jsx("input",{...x,id:N,ref:t,placeholder:v?" ":x.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
|
+
${m}
|
|
4
|
+
${v&&f&&R[f]}
|
|
5
|
+
${M} ${C} ${L} ${u}`}),v&&r&&f&&n.jsx("label",{htmlFor:N,className:`ms-1 ${ee[f]} ${u}`,children:r})]}),p&&n.jsx("p",{className:`mt-1 text-xs ${k==="invalid"?"text-red-600 dark:text-red-500":"text-green-600 dark:text-green-500"}`,role:k==="invalid"?"alert":void 0,children:p})]})});G.displayName="Input";const oe={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"},te={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"},le={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,t,r)=>{if(r)return"border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";if(t)return"border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";const o="focus:ring focus:border";switch(e){case"error":return`${o}-red-500 border-red-500 bg-red-50`;case"warning":return`${o}-yellow-500 border-yellow-500 bg-yellow-50`;case"success":return`${o}-green-500 border-green-500 bg-green-50`;default:return"border-gray-300 focus:ring-blue-500"}},q=l.forwardRef((e,t)=>{const{label:r,id:o,inputSize:s="md",shape:b="rounded",validate:i,onValidatedChange:d,className:u="",icon:c,iconPosition:a="left",floatingLabelStyle:f,onChange:h,isValid:y,isInvalid:g,feedback:p,feedbackType:k="invalid",children:x,...S}=e,[E,$]=l.useState("default"),N=l.useId(),v=l.useMemo(()=>o||(typeof r=="string"?`select-${r.toLowerCase().replace(/\s+/g,"-")}`:N),[o,r,N]),m=j=>{const De=j.target.value,V=(i==null?void 0:i(De))??"default";$(V),d==null||d(j,V),h==null||h(j)},C=!!f,L=oe[s],P=te[b],M=ae(E,y,g),O=c&&(a==="start"||a==="left")?"ps-10":c?"pe-10":"",I=a==="start"||a==="left"?"left-0 ps-3.5":"right-0 pe-3.5";return n.jsxs("div",{className:`w-full relative ${C?"z-0":""}`,children:[!C&&r&&n.jsx("label",{htmlFor:v,className:`block mb-1 text-sm ${y?"text-green-700":g?"text-red-700":"text-gray-700"}`,children:r}),n.jsxs("div",{className:"relative w-full",children:[c&&n.jsx("div",{className:`absolute inset-y-0 flex items-center ${I}`,children:n.jsx("span",{className:"text-gray-500",children:c})}),n.jsx("select",{...S,id:v,ref:t,onChange:m,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
|
+
${L} ${O}
|
|
7
|
+
${C&&f&&ne[f]}
|
|
8
|
+
${P} ${M} ${u}`,children:x}),C&&r&&f&&n.jsx("label",{htmlFor:v,className:`ms-1 ${le[f]} ${u}`,children:r})]}),p&&n.jsx("p",{className:`mt-1 text-xs ${k==="invalid"?"text-red-600":"text-green-600"}`,children:p})]})});q.displayName="Select";const se={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"},ce={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"},ie={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:t="primary",size:r="md",type:o="button",shape:s="rounded",className:b="",isLoading:i=!1,disabled:d=!1,...u})=>{const c=d||i,a=["inline-flex items-center justify-center font-normal transition duration-150",se[t],ce[r],ie[s],s==="flat"?"shadow-none":"shadow-sm",c?"opacity-50 cursor-not-allowed":"cursor-pointer",b].filter(Boolean).join(" ");return n.jsxs("button",{type:o,className:a,disabled:c,...u,children:[i&&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:t,position:r="right",className:o="",menuClassName:s="",width:b="w-48",closeOnSelect:i=!1,transition:d=!0,ariaLabel:u="Dropdown menu",...c})=>{const[a,f]=l.useState(!1),[h,y]=l.useState(!1),g=l.useRef(null),p=l.useRef(null),k=l.useMemo(()=>({left:"left-0",center:"left-1/2 transform -translate-x-1/2",right:"right-0"})[r],[r]),x=l.useCallback(()=>{const m=p.current,C=g.current;if(!m||!C)return;const{top:L,bottom:P}=m.getBoundingClientRect(),M=C.offsetHeight,O=window.innerHeight-P,I=L;y(O<M&&I>M)},[]),S=l.useCallback(m=>{var C,L;!((C=g.current)!=null&&C.contains(m.target))&&!((L=p.current)!=null&&L.contains(m.target))&&f(!1)},[]),E=l.useCallback(()=>f(m=>!m),[]),$=l.useCallback(()=>f(!1),[]);l.useEffect(()=>{if(a)return x(),window.addEventListener("resize",x),window.addEventListener("scroll",x,!0),()=>{window.removeEventListener("resize",x),window.removeEventListener("scroll",x,!0)}},[a,x]),l.useEffect(()=>(document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)),[S]);const N=l.useCallback(()=>{i&&$()},[i,$]),v=l.useMemo(()=>["absolute z-50 bg-white rounded shadow-lg overflow-hidden",h?"bottom-full mb-2":"top-full mt-2",k,b,d&&"transition-all duration-200 ease-out",s].filter(Boolean).join(" "),[h,k,b,d,s]);return n.jsxs("div",{className:`relative inline-block ${o}`,...c,children:[n.jsx("button",{ref:p,onClick:E,"aria-haspopup":"true","aria-expanded":a,"aria-label":u,className:"focus:outline-none",children:e}),a&&n.jsx("div",{ref:g,role:"menu",onClick:N,className:v,children:t})]})},fe=({children:e,content:t,position:r="top",className:o="",tooltipClass:s="",tooltipStyle:b={}})=>{const i=l.useRef(null),d=l.useRef(null);l.useEffect(()=>{const c=i.current,a=d.current;if(!c||!a)return;const f=()=>{a.style.opacity="1",a.style.visibility="visible"},h=()=>{a.style.opacity="0",a.style.visibility="hidden"};return c.addEventListener("mouseenter",f),c.addEventListener("mouseleave",h),()=>{c.removeEventListener("mouseenter",f),c.removeEventListener("mouseleave",h)}},[]);const u=c=>{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(c){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:i,className:`relative inline-block ${o}`,children:[e,n.jsx("div",{ref:d,role:"tooltip",className:s,style:{...u(r),...b},children:t})]})},be={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"},he={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"},pe=({label:e,variant:t="primary",size:r="sm",shape:o="rounded",icon:s,dismissible:b,onDismiss:i,className:d="",...u})=>{const c=!e&&!!s,a=`inline-flex items-center font-medium ${be[t]||""} ${he[r]||""} ${ge[o]||""} ${c?"justify-center p-2 w-8 h-8":""} `+d;return n.jsxs("span",{className:a.trim(),...u,children:[s&&n.jsx("span",{className:e?"mr-1":"",children:s}),e,b&&n.jsx("button",{type:"button",onClick:i,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=l.createContext&&l.createContext(K),ve=["attr","size","title"];function ye(e,t){if(e==null)return{};var r=we(e,t),o,s;if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(s=0;s<b.length;s++)o=b[s],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}function we(e,t){if(e==null)return{};var r={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(t.indexOf(o)>=0)continue;r[o]=e[o]}return r}function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},T.apply(this,arguments)}function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W(Object(r),!0).forEach(function(o){xe(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function xe(e,t,r){return t=me(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function me(e){var t=ke(e,"string");return typeof t=="symbol"?t:t+""}function ke(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function X(e){return e&&e.map((t,r)=>l.createElement(t.tag,A({key:r},t.attr),X(t.child)))}function Y(e){return t=>l.createElement(Ce,T({attr:A({},e.attr)},t),X(e.child))}function Ce(e){var t=r=>{var{attr:o,size:s,title:b}=e,i=ye(e,ve),d=s||r.size||"1em",u;return r.className&&(u=r.className),e.className&&(u=(u?u+" ":"")+e.className),l.createElement("svg",T({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,o,i,{className:u,style:A(A({color:e.color||r.color},r.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),b&&l.createElement("title",null,b),e.children)};return U!==void 0?l.createElement(U.Consumer,null,r=>t(r)):t(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:t=!1,className:r="",tileClasses:o="",open:s,onChange:b,renderTitle:i,renderContent:d,showArrowIcon:u=!0,panelClasses:c=""})=>{const[a,f]=l.useState(new Set),h=l.useMemo(()=>s?new Set(s):a,[s,a]),y=l.useCallback(g=>{const p=new Set(h);p.has(g)?p.delete(g):(t||p.clear(),p.add(g)),s&&b?b(Array.from(p)):f(p)},[h,s,b,t]);return n.jsx("div",{className:"accordion",role:"region","aria-multiselectable":t,children:e.map(g=>{const p=h.has(g.id),k=`accordion-heading-${g.id}`,x=`accordion-panel-${g.id}`;return n.jsxs("div",{className:`accordion-item border rounded border-gray-300 dark:border-gray-700 ${r}`,children:[n.jsxs("button",{id:k,type:"button","aria-expanded":p,"aria-controls":x,onClick:()=>y(g.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 ${o}`,children:[i?i(g,p):g.title,u?n.jsx(Se,{}):null]}),n.jsx("div",{id:x,role:"region","aria-labelledby":k,hidden:!p,className:`p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${c}`,children:d?d(g,p):g.content})]},g.id)})})},J=l.createContext(null),z=()=>{const e=l.useContext(J);if(!e)throw new Error("useModalActions must be used within a ModalActionProvider");return e},Q=l.createContext(null),D=()=>l.useContext(Q);function Ee({id:e,title:t,children:r,standalone:o=!1,showFloatingClose:s=!1,containerClasses:b="",onClose:i,disableEscapeClose:d=!1}){const u=D(),c=z(),a=!o&&!!u&&!!c,[f,h]=l.useState(!1),y=a?u.isOpen(e):f,g=a?u.getModalData(e):null,p=l.useCallback(()=>{a?c.closeModal(e):h(!1),i==null||i()},[a,c,e,i]);return l.useEffect(()=>{const k=document.activeElement;console.log(e);const x=document.getElementById(e);console.log("modalEl=",x);const S=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],E=()=>{if(!x)return[];const v=x.querySelectorAll(S.join(","));return Array.from(v).filter(m=>m.offsetParent!==null)},$=v=>{if(v.key==="Tab"){const m=E();if(m.length===0)return;const C=m[0],L=m[m.length-1];v.shiftKey?document.activeElement===C&&(v.preventDefault(),L.focus()):document.activeElement===L&&(v.preventDefault(),C.focus())}},N=v=>{v.key==="Escape"&&!d&&p(),$(v)};return y&&(document.body.style.overflow="hidden",setTimeout(()=>{const v=E();v.length&&v[0].focus()},0),window.addEventListener("keydown",N)),()=>{document.body.style.overflow="",k&&k.focus(),window.removeEventListener("keydown",N)}},[y,d,p,e]),y?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:[t&&n.jsx("h2",{className:"text-lg font-semibold",children:t}),s&&n.jsx("button",{onClick:p,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 r=="function"?r({modalData:g}):r})]})}):null}function $e({children:e}){const[t,r]=l.useState({}),[o,s]=l.useState({}),b=l.useCallback((f,h)=>{r(y=>({...y,[f]:!0})),h&&s(y=>({...y,[f]:h}))},[]),i=l.useCallback(f=>{r(h=>({...h,[f]:!1})),s(h=>{const y={...h};return delete y[f],y})},[]),d=l.useCallback(f=>!!t[f],[t]),u=l.useCallback(f=>o[f],[o]),c=l.useMemo(()=>({openModal:b,closeModal:i}),[b,i]),a=l.useMemo(()=>({isOpen:d,getModalData:u}),[d,u]);return n.jsx(J.Provider,{value:c,children:n.jsx(Q.Provider,{value:a,children:e})})}function Le(e){const{openModal:t,closeModal:r}=z(),{isOpen:o,getModalData:s}=D();return{open:b=>t(e,b),close:()=>r(e),isOpen:o(e),data:s(e)}}let _=null,B={};function Oe(e){_=e}function Me(e){B={...B,...e}}function je(){return B}function Pe(e,t,r=3e3,o){_?_(e,t,r,o):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 t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Ae=()=>{const[e,t]=l.useState([]);l.useEffect(()=>{Oe((o,s,b,i)=>{const d=Te();t(u=>[...u,{id:d,type:o,message:s,config:i}]),setTimeout(()=>{t(u=>u.filter(c=>c.id!==d))},b)})},[]);const r=je();return n.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(o=>{var u,c,a,f,h,y,g,p,k,x,S,E,$;const s=((u=o.config)==null?void 0:u.icon)||((c=r.icons)==null?void 0:c[o.type])||ze(o.type),b=((a=o.config)==null?void 0:a.bgColor)||((h=(f=r.colors)==null?void 0:f[o.type])==null?void 0:h.bg)||"bg-white dark:bg-gray-800",i=((y=o.config)==null?void 0:y.textColor)||((p=(g=r.colors)==null?void 0:g[o.type])==null?void 0:p.text)||"text-gray-700 dark:text-gray-300",d=((k=o.config)==null?void 0:k.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} ${i}`,children:[n.jsx("div",{className:d,children:s}),n.jsxs("div",{className:"flex-1 me-3",children:[((x=o.config)==null?void 0:x.title)&&n.jsx("div",{className:"font-semibold text-black",children:o.config.title}),((S=o.config)==null?void 0:S.description)&&n.jsx("div",{className:"text-sm text-gray-500",children:o.config.description}),!((E=o.config)!=null&&E.title)&&!(($=o.config)!=null&&$.description)&&n.jsx("div",{className:"text-sm",children:o.message})]}),n.jsx("button",{onClick:()=>t(N=>N.filter(v=>v.id!==o.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})})]},o.id)})})};function ze(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}w.Accordion=Ne,w.Badge=pe,w.Button=de,w.Dropdown=ue,w.Input=G,w.Modal=Ee,w.ModalProvider=$e,w.Select=q,w.Toast=Ae,w.Tooltip=fe,w.setToastDefaults=Me,w.showToast=Pe,w.useModalActions=z,w.useModalInstance=Le,w.useModalState=D,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|