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