tailwind-ux-kit 1.0.27 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Accordion.d.ts +2 -1
- package/lib/tailwind-ux-kit.es.js +200 -198
- package/lib/tailwind-ux-kit.umd.js +7 -7
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ interface AccordionProps<T extends AccordionItemBase> {
|
|
|
9
9
|
items: T[];
|
|
10
10
|
allowMultipleOpen?: boolean;
|
|
11
11
|
className?: string;
|
|
12
|
+
tileClasses?: string;
|
|
12
13
|
open?: (string | number)[];
|
|
13
14
|
onChange?: (openItems: (string | number)[]) => void;
|
|
14
15
|
/**
|
|
@@ -20,5 +21,5 @@ interface AccordionProps<T extends AccordionItemBase> {
|
|
|
20
21
|
*/
|
|
21
22
|
renderContent?: (item: T, isOpen: boolean) => React.ReactNode;
|
|
22
23
|
}
|
|
23
|
-
declare const Accordion: <T extends AccordionItemBase>({ items, allowMultipleOpen, className, open: controlledOpen, onChange, renderTitle, renderContent, }: AccordionProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare const Accordion: <T extends AccordionItemBase>({ items, allowMultipleOpen, className, tileClasses, open: controlledOpen, onChange, renderTitle, renderContent, }: AccordionProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
export default Accordion;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as x, jsx as
|
|
2
|
+
import { jsxs as x, jsx as g } from "react/jsx-runtime";
|
|
3
3
|
import O, { forwardRef as J, useState as v, useRef as T, useMemo as _, useCallback as N, useEffect as z, createContext as Q, useContext as V } from "react";
|
|
4
4
|
const le = J((e, n) => {
|
|
5
5
|
const {
|
|
6
6
|
label: t,
|
|
7
7
|
id: r,
|
|
8
|
-
inputSize:
|
|
9
|
-
shape:
|
|
10
|
-
validate:
|
|
11
|
-
onValidatedChange:
|
|
12
|
-
className:
|
|
13
|
-
icon:
|
|
14
|
-
iconPosition:
|
|
15
|
-
floatingLabelStyle:
|
|
16
|
-
onChange:
|
|
17
|
-
isValid:
|
|
8
|
+
inputSize: o = "md",
|
|
9
|
+
shape: f = "rounded",
|
|
10
|
+
validate: p,
|
|
11
|
+
onValidatedChange: i,
|
|
12
|
+
className: l = "",
|
|
13
|
+
icon: d,
|
|
14
|
+
iconPosition: s = "left",
|
|
15
|
+
floatingLabelStyle: c,
|
|
16
|
+
onChange: a,
|
|
17
|
+
isValid: u,
|
|
18
18
|
isInvalid: b,
|
|
19
19
|
feedback: m,
|
|
20
20
|
feedbackType: C = "invalid",
|
|
21
21
|
...k
|
|
22
22
|
} = e, [$, E] = v("default"), P = (h) => {
|
|
23
|
-
const w = h.target.value, S = (
|
|
24
|
-
E(S),
|
|
23
|
+
const w = h.target.value, S = (p == null ? void 0 : p(w)) ?? "default";
|
|
24
|
+
E(S), i == null || i(h, S), a == null || a(h);
|
|
25
25
|
}, j = {
|
|
26
26
|
xs: "text-xs px-2 py-1",
|
|
27
27
|
sm: "text-sm px-3 py-1.5",
|
|
@@ -54,25 +54,25 @@ const le = J((e, n) => {
|
|
|
54
54
|
default:
|
|
55
55
|
return "border-gray-300 focus:ring-blue-500";
|
|
56
56
|
}
|
|
57
|
-
}, Z = j[
|
|
57
|
+
}, Z = j[o] || j.md, G = L[f] || L.flat, H = F($, u, b), W = s === "start" || s === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", U = d && (s === "start" || s === "left") ? "ps-10" : d ? "pe-10" : "", I = r ?? `input-${(t == null ? void 0 : t.toLowerCase().replace(/\s+/g, "-")) || Math.random().toString(36).slice(2)}`, y = !!c;
|
|
58
58
|
return /* @__PURE__ */ x("div", { className: `w-full relative ${y ? "z-0" : ""}`, children: [
|
|
59
|
-
!y && t && /* @__PURE__ */
|
|
59
|
+
!y && t && /* @__PURE__ */ g(
|
|
60
60
|
"label",
|
|
61
61
|
{
|
|
62
62
|
htmlFor: I,
|
|
63
|
-
className: `block mb-1 font-light text-sm ${
|
|
63
|
+
className: `block mb-1 font-light text-sm ${u ? "text-green-700 dark:text-green-500" : b ? "text-red-700 dark:text-red-500" : "text-gray-700"}`,
|
|
64
64
|
children: t
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
67
|
/* @__PURE__ */ x("div", { className: "relative w-full", children: [
|
|
68
|
-
|
|
68
|
+
d && /* @__PURE__ */ g(
|
|
69
69
|
"div",
|
|
70
70
|
{
|
|
71
71
|
className: `absolute inset-y-0 flex items-center ${W}`,
|
|
72
|
-
children: /* @__PURE__ */
|
|
72
|
+
children: /* @__PURE__ */ g("span", { className: "text-gray-500", children: d })
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ g(
|
|
76
76
|
"input",
|
|
77
77
|
{
|
|
78
78
|
...k,
|
|
@@ -82,20 +82,20 @@ const le = J((e, n) => {
|
|
|
82
82
|
onChange: P,
|
|
83
83
|
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
|
|
84
84
|
${Z}
|
|
85
|
-
${y &&
|
|
86
|
-
${U} ${G} ${H} ${
|
|
85
|
+
${y && c && A[c]}
|
|
86
|
+
${U} ${G} ${H} ${l}`
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
|
-
y && t &&
|
|
89
|
+
y && t && c && /* @__PURE__ */ g(
|
|
90
90
|
"label",
|
|
91
91
|
{
|
|
92
92
|
htmlFor: I,
|
|
93
|
-
className: `ms-1 ${B[
|
|
93
|
+
className: `ms-1 ${B[c]} ${l}`,
|
|
94
94
|
children: t
|
|
95
95
|
}
|
|
96
96
|
)
|
|
97
97
|
] }),
|
|
98
|
-
m && /* @__PURE__ */
|
|
98
|
+
m && /* @__PURE__ */ g(
|
|
99
99
|
"p",
|
|
100
100
|
{
|
|
101
101
|
className: `mt-1 text-xs ${C === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
|
|
@@ -109,24 +109,24 @@ const ie = J((e, n) => {
|
|
|
109
109
|
const {
|
|
110
110
|
label: t,
|
|
111
111
|
id: r,
|
|
112
|
-
inputSize:
|
|
113
|
-
shape:
|
|
114
|
-
validate:
|
|
115
|
-
onValidatedChange:
|
|
116
|
-
className:
|
|
117
|
-
icon:
|
|
118
|
-
iconPosition:
|
|
119
|
-
floatingLabelStyle:
|
|
120
|
-
onChange:
|
|
121
|
-
isValid:
|
|
112
|
+
inputSize: o = "md",
|
|
113
|
+
shape: f = "rounded",
|
|
114
|
+
validate: p,
|
|
115
|
+
onValidatedChange: i,
|
|
116
|
+
className: l = "",
|
|
117
|
+
icon: d,
|
|
118
|
+
iconPosition: s = "left",
|
|
119
|
+
floatingLabelStyle: c,
|
|
120
|
+
onChange: a,
|
|
121
|
+
isValid: u,
|
|
122
122
|
isInvalid: b,
|
|
123
123
|
feedback: m,
|
|
124
124
|
feedbackType: C = "invalid",
|
|
125
125
|
children: k,
|
|
126
126
|
...$
|
|
127
127
|
} = e, [E, P] = v("default"), j = (w) => {
|
|
128
|
-
const S = w.target.value, M = (
|
|
129
|
-
P(M),
|
|
128
|
+
const S = w.target.value, M = (p == null ? void 0 : p(S)) ?? "default";
|
|
129
|
+
P(M), i == null || i(w, M), a == null || a(w);
|
|
130
130
|
}, L = {
|
|
131
131
|
xs: "text-xs px-2 py-1",
|
|
132
132
|
sm: "text-sm px-3 py-1.5",
|
|
@@ -159,25 +159,25 @@ const ie = J((e, n) => {
|
|
|
159
159
|
default:
|
|
160
160
|
return "border-gray-300 focus:ring-blue-500";
|
|
161
161
|
}
|
|
162
|
-
}, G = L[
|
|
162
|
+
}, G = L[o] || L.md, H = A[f] || A.flat, W = Z(E, u, b), U = s === "start" || s === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", I = d && (s === "start" || s === "left") ? "ps-10" : d ? "pe-10" : "", y = r ?? `select-${(t == null ? void 0 : t.toLowerCase().replace(/\s+/g, "-")) || Math.random().toString(36).slice(2)}`, h = !!c;
|
|
163
163
|
return /* @__PURE__ */ x("div", { className: `w-full relative ${h ? "z-0" : ""}`, children: [
|
|
164
|
-
!h && t && /* @__PURE__ */
|
|
164
|
+
!h && t && /* @__PURE__ */ g(
|
|
165
165
|
"label",
|
|
166
166
|
{
|
|
167
167
|
htmlFor: y,
|
|
168
|
-
className: `block mb-1 font-light text-sm ${
|
|
168
|
+
className: `block mb-1 font-light text-sm ${u ? "text-green-700" : b ? "text-red-700" : "text-gray-700"}`,
|
|
169
169
|
children: t
|
|
170
170
|
}
|
|
171
171
|
),
|
|
172
172
|
/* @__PURE__ */ x("div", { className: "relative w-full", children: [
|
|
173
|
-
|
|
173
|
+
d && /* @__PURE__ */ g(
|
|
174
174
|
"div",
|
|
175
175
|
{
|
|
176
176
|
className: `absolute inset-y-0 flex items-center ${U}`,
|
|
177
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ g("span", { className: "text-gray-500", children: d })
|
|
178
178
|
}
|
|
179
179
|
),
|
|
180
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ g(
|
|
181
181
|
"select",
|
|
182
182
|
{
|
|
183
183
|
...$,
|
|
@@ -186,21 +186,21 @@ const ie = J((e, n) => {
|
|
|
186
186
|
onChange: j,
|
|
187
187
|
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
|
|
188
188
|
${G}
|
|
189
|
-
${h &&
|
|
190
|
-
${I} ${H} ${W} ${
|
|
189
|
+
${h && c && B[c]}
|
|
190
|
+
${I} ${H} ${W} ${l}`,
|
|
191
191
|
children: k
|
|
192
192
|
}
|
|
193
193
|
),
|
|
194
|
-
h && t &&
|
|
194
|
+
h && t && c && /* @__PURE__ */ g(
|
|
195
195
|
"label",
|
|
196
196
|
{
|
|
197
197
|
htmlFor: y,
|
|
198
|
-
className: `ms-1 ${F[
|
|
198
|
+
className: `ms-1 ${F[c]} ${l}`,
|
|
199
199
|
children: t
|
|
200
200
|
}
|
|
201
201
|
)
|
|
202
202
|
] }),
|
|
203
|
-
m && /* @__PURE__ */
|
|
203
|
+
m && /* @__PURE__ */ g(
|
|
204
204
|
"p",
|
|
205
205
|
{
|
|
206
206
|
className: `mt-1 text-xs ${C === "invalid" ? "text-red-600" : "text-green-600"}`,
|
|
@@ -244,23 +244,23 @@ const ce = {
|
|
|
244
244
|
variant: n = "primary",
|
|
245
245
|
size: t = "md",
|
|
246
246
|
type: r = "button",
|
|
247
|
-
shape:
|
|
248
|
-
className:
|
|
249
|
-
isLoading:
|
|
250
|
-
disabled:
|
|
251
|
-
...
|
|
247
|
+
shape: o = "rounded",
|
|
248
|
+
className: f = "",
|
|
249
|
+
isLoading: p = !1,
|
|
250
|
+
disabled: i = !1,
|
|
251
|
+
...l
|
|
252
252
|
}) => {
|
|
253
|
-
const
|
|
253
|
+
const d = i || p, s = [
|
|
254
254
|
"inline-flex items-center justify-center font-normal transition duration-150 cursor-pointer",
|
|
255
255
|
ce[n],
|
|
256
256
|
de[t],
|
|
257
|
-
ue[
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
257
|
+
ue[o],
|
|
258
|
+
o === "flat" ? "shadow-none" : "shadow-sm",
|
|
259
|
+
d ? "opacity-50 cursor-not-allowed pointer-events-none" : "",
|
|
260
|
+
f
|
|
261
261
|
].filter(Boolean).join(" ");
|
|
262
|
-
return /* @__PURE__ */ x("button", { type: r, className:
|
|
263
|
-
|
|
262
|
+
return /* @__PURE__ */ x("button", { type: r, className: s, disabled: d, ...l, children: [
|
|
263
|
+
p && /* @__PURE__ */ x(
|
|
264
264
|
"svg",
|
|
265
265
|
{
|
|
266
266
|
"aria-hidden": "true",
|
|
@@ -270,14 +270,14 @@ const ce = {
|
|
|
270
270
|
fill: "none",
|
|
271
271
|
xmlns: "http://www.w3.org/2000/svg",
|
|
272
272
|
children: [
|
|
273
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ g(
|
|
274
274
|
"path",
|
|
275
275
|
{
|
|
276
276
|
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",
|
|
277
277
|
fill: "currentColor"
|
|
278
278
|
}
|
|
279
279
|
),
|
|
280
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ g(
|
|
281
281
|
"path",
|
|
282
282
|
{
|
|
283
283
|
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",
|
|
@@ -294,7 +294,7 @@ const ce = {
|
|
|
294
294
|
children: n,
|
|
295
295
|
position: t = "right"
|
|
296
296
|
}) => {
|
|
297
|
-
const [r,
|
|
297
|
+
const [r, o] = v(!1), [f, p] = v(!1), i = T(null), l = T(null), d = _(() => {
|
|
298
298
|
switch (t) {
|
|
299
299
|
case "left":
|
|
300
300
|
return "left-0";
|
|
@@ -304,32 +304,32 @@ const ce = {
|
|
|
304
304
|
default:
|
|
305
305
|
return "right-0";
|
|
306
306
|
}
|
|
307
|
-
}, [t]),
|
|
308
|
-
const b =
|
|
309
|
-
|
|
310
|
-
}, []),
|
|
311
|
-
if (!
|
|
312
|
-
const
|
|
313
|
-
|
|
307
|
+
}, [t]), s = N((u) => {
|
|
308
|
+
const b = u.target;
|
|
309
|
+
i.current && !i.current.contains(b) && l.current && !l.current.contains(b) && o(!1);
|
|
310
|
+
}, []), c = N(() => {
|
|
311
|
+
if (!l.current || !i.current) return;
|
|
312
|
+
const u = l.current.getBoundingClientRect(), b = i.current.getBoundingClientRect(), m = window.innerHeight - u.bottom, C = u.top;
|
|
313
|
+
p(
|
|
314
314
|
m < b.height && C > b.height
|
|
315
315
|
);
|
|
316
316
|
}, []);
|
|
317
317
|
z(() => {
|
|
318
318
|
if (r)
|
|
319
|
-
return
|
|
320
|
-
window.removeEventListener("resize",
|
|
319
|
+
return c(), window.addEventListener("resize", c), window.addEventListener("scroll", c, !0), () => {
|
|
320
|
+
window.removeEventListener("resize", c), window.removeEventListener("scroll", c, !0);
|
|
321
321
|
};
|
|
322
|
-
}, [r,
|
|
323
|
-
const
|
|
322
|
+
}, [r, c]), z(() => (document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s)), [s]);
|
|
323
|
+
const a = N(() => o((u) => !u), []);
|
|
324
324
|
return /* @__PURE__ */ x("div", { className: "relative flex items-center", children: [
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
r && /* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ g("button", { ref: l, onClick: a, children: e }),
|
|
326
|
+
r && /* @__PURE__ */ g(
|
|
327
327
|
"div",
|
|
328
328
|
{
|
|
329
|
-
ref:
|
|
329
|
+
ref: i,
|
|
330
330
|
className: `absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
|
|
331
|
-
${
|
|
332
|
-
${
|
|
331
|
+
${f ? "bottom-full mb-2" : "top-full mt-2"}
|
|
332
|
+
${d}`,
|
|
333
333
|
children: n
|
|
334
334
|
}
|
|
335
335
|
)
|
|
@@ -339,24 +339,24 @@ const ce = {
|
|
|
339
339
|
content: n,
|
|
340
340
|
position: t = "top",
|
|
341
341
|
className: r = "",
|
|
342
|
-
tooltipClass:
|
|
343
|
-
tooltipStyle:
|
|
342
|
+
tooltipClass: o = "",
|
|
343
|
+
tooltipStyle: f = {}
|
|
344
344
|
}) => {
|
|
345
|
-
const
|
|
345
|
+
const p = T(null), i = T(null);
|
|
346
346
|
z(() => {
|
|
347
|
-
const
|
|
348
|
-
if (!
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
},
|
|
352
|
-
|
|
347
|
+
const d = p.current, s = i.current;
|
|
348
|
+
if (!d || !s) return;
|
|
349
|
+
const c = () => {
|
|
350
|
+
s.style.opacity = "1", s.style.visibility = "visible";
|
|
351
|
+
}, a = () => {
|
|
352
|
+
s.style.opacity = "0", s.style.visibility = "hidden";
|
|
353
353
|
};
|
|
354
|
-
return
|
|
355
|
-
|
|
354
|
+
return d.addEventListener("mouseenter", c), d.addEventListener("mouseleave", a), () => {
|
|
355
|
+
d.removeEventListener("mouseenter", c), d.removeEventListener("mouseleave", a);
|
|
356
356
|
};
|
|
357
357
|
}, []);
|
|
358
|
-
const
|
|
359
|
-
const
|
|
358
|
+
const l = (d) => {
|
|
359
|
+
const s = {
|
|
360
360
|
position: "absolute",
|
|
361
361
|
opacity: 0,
|
|
362
362
|
visibility: "hidden",
|
|
@@ -373,10 +373,10 @@ const ce = {
|
|
|
373
373
|
zIndex: 9999,
|
|
374
374
|
width: "max-content"
|
|
375
375
|
};
|
|
376
|
-
switch (
|
|
376
|
+
switch (d) {
|
|
377
377
|
case "top":
|
|
378
378
|
return {
|
|
379
|
-
...
|
|
379
|
+
...s,
|
|
380
380
|
bottom: "100%",
|
|
381
381
|
left: "50%",
|
|
382
382
|
transform: "translateX(-50%)",
|
|
@@ -384,7 +384,7 @@ const ce = {
|
|
|
384
384
|
};
|
|
385
385
|
case "bottom":
|
|
386
386
|
return {
|
|
387
|
-
...
|
|
387
|
+
...s,
|
|
388
388
|
top: "100%",
|
|
389
389
|
left: "50%",
|
|
390
390
|
transform: "translateX(-50%)",
|
|
@@ -392,7 +392,7 @@ const ce = {
|
|
|
392
392
|
};
|
|
393
393
|
case "left":
|
|
394
394
|
return {
|
|
395
|
-
...
|
|
395
|
+
...s,
|
|
396
396
|
right: "100%",
|
|
397
397
|
top: "50%",
|
|
398
398
|
transform: "translateY(-50%)",
|
|
@@ -400,27 +400,27 @@ const ce = {
|
|
|
400
400
|
};
|
|
401
401
|
case "right":
|
|
402
402
|
return {
|
|
403
|
-
...
|
|
403
|
+
...s,
|
|
404
404
|
left: "100%",
|
|
405
405
|
top: "50%",
|
|
406
406
|
transform: "translateY(-50%)",
|
|
407
407
|
marginLeft: "8px"
|
|
408
408
|
};
|
|
409
409
|
default:
|
|
410
|
-
return
|
|
410
|
+
return s;
|
|
411
411
|
}
|
|
412
412
|
};
|
|
413
|
-
return /* @__PURE__ */ x("div", { ref:
|
|
413
|
+
return /* @__PURE__ */ x("div", { ref: p, className: `relative inline-block ${r}`, children: [
|
|
414
414
|
e,
|
|
415
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ g(
|
|
416
416
|
"div",
|
|
417
417
|
{
|
|
418
|
-
ref:
|
|
418
|
+
ref: i,
|
|
419
419
|
role: "tooltip",
|
|
420
|
-
className:
|
|
420
|
+
className: o,
|
|
421
421
|
style: {
|
|
422
|
-
...
|
|
423
|
-
...
|
|
422
|
+
...l(t),
|
|
423
|
+
...f
|
|
424
424
|
},
|
|
425
425
|
children: n
|
|
426
426
|
}
|
|
@@ -460,21 +460,21 @@ const ce = {
|
|
|
460
460
|
variant: n = "primary",
|
|
461
461
|
size: t = "sm",
|
|
462
462
|
shape: r = "rounded",
|
|
463
|
-
icon:
|
|
464
|
-
dismissible:
|
|
465
|
-
onDismiss:
|
|
466
|
-
className:
|
|
467
|
-
...
|
|
463
|
+
icon: o,
|
|
464
|
+
dismissible: f,
|
|
465
|
+
onDismiss: p,
|
|
466
|
+
className: i = "",
|
|
467
|
+
...l
|
|
468
468
|
}) => {
|
|
469
|
-
const
|
|
470
|
-
return /* @__PURE__ */ x("span", { className:
|
|
471
|
-
|
|
469
|
+
const d = !e && !!o, s = `inline-flex items-center font-medium ${ge[n] || ""} ${pe[t] || ""} ${fe[r] || ""} ${d ? "justify-center p-2 w-8 h-8" : ""} ` + i;
|
|
470
|
+
return /* @__PURE__ */ x("span", { className: s.trim(), ...l, children: [
|
|
471
|
+
o && /* @__PURE__ */ g("span", { className: e ? "mr-1" : "", children: o }),
|
|
472
472
|
e,
|
|
473
|
-
|
|
473
|
+
f && /* @__PURE__ */ g(
|
|
474
474
|
"button",
|
|
475
475
|
{
|
|
476
476
|
type: "button",
|
|
477
|
-
onClick:
|
|
477
|
+
onClick: p,
|
|
478
478
|
className: "ml-2 text-xs font-bold leading-none focus:outline-none",
|
|
479
479
|
children: "×"
|
|
480
480
|
}
|
|
@@ -490,11 +490,11 @@ var ee = {
|
|
|
490
490
|
}, K = O.createContext && /* @__PURE__ */ O.createContext(ee), be = ["attr", "size", "title"];
|
|
491
491
|
function xe(e, n) {
|
|
492
492
|
if (e == null) return {};
|
|
493
|
-
var t = me(e, n), r,
|
|
493
|
+
var t = me(e, n), r, o;
|
|
494
494
|
if (Object.getOwnPropertySymbols) {
|
|
495
|
-
var
|
|
496
|
-
for (
|
|
497
|
-
r =
|
|
495
|
+
var f = Object.getOwnPropertySymbols(e);
|
|
496
|
+
for (o = 0; o < f.length; o++)
|
|
497
|
+
r = f[o], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
498
498
|
}
|
|
499
499
|
return t;
|
|
500
500
|
}
|
|
@@ -522,8 +522,8 @@ function q(e, n) {
|
|
|
522
522
|
var t = Object.keys(e);
|
|
523
523
|
if (Object.getOwnPropertySymbols) {
|
|
524
524
|
var r = Object.getOwnPropertySymbols(e);
|
|
525
|
-
n && (r = r.filter(function(
|
|
526
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
525
|
+
n && (r = r.filter(function(o) {
|
|
526
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
527
527
|
})), t.push.apply(t, r);
|
|
528
528
|
}
|
|
529
529
|
return t;
|
|
@@ -570,22 +570,22 @@ function ve(e) {
|
|
|
570
570
|
var n = (t) => {
|
|
571
571
|
var {
|
|
572
572
|
attr: r,
|
|
573
|
-
size:
|
|
574
|
-
title:
|
|
575
|
-
} = e,
|
|
576
|
-
return t.className && (
|
|
573
|
+
size: o,
|
|
574
|
+
title: f
|
|
575
|
+
} = e, p = xe(e, be), i = o || t.size || "1em", l;
|
|
576
|
+
return t.className && (l = t.className), e.className && (l = (l ? l + " " : "") + e.className), /* @__PURE__ */ O.createElement("svg", D({
|
|
577
577
|
stroke: "currentColor",
|
|
578
578
|
fill: "currentColor",
|
|
579
579
|
strokeWidth: "0"
|
|
580
|
-
}, t.attr, r,
|
|
581
|
-
className:
|
|
580
|
+
}, t.attr, r, p, {
|
|
581
|
+
className: l,
|
|
582
582
|
style: R(R({
|
|
583
583
|
color: e.color || t.color
|
|
584
584
|
}, t.style), e.style),
|
|
585
|
-
height:
|
|
586
|
-
width:
|
|
585
|
+
height: i,
|
|
586
|
+
width: i,
|
|
587
587
|
xmlns: "http://www.w3.org/2000/svg"
|
|
588
|
-
}),
|
|
588
|
+
}), f && /* @__PURE__ */ O.createElement("title", null, f), e.children);
|
|
589
589
|
};
|
|
590
590
|
return K !== void 0 ? /* @__PURE__ */ O.createElement(K.Consumer, null, (t) => n(t)) : n(ee);
|
|
591
591
|
}
|
|
@@ -596,59 +596,61 @@ const Ae = ({
|
|
|
596
596
|
items: e,
|
|
597
597
|
allowMultipleOpen: n = !1,
|
|
598
598
|
className: t = "",
|
|
599
|
-
|
|
600
|
-
|
|
599
|
+
tileClasses: r = "",
|
|
600
|
+
open: o,
|
|
601
|
+
onChange: f,
|
|
601
602
|
renderTitle: p,
|
|
602
|
-
renderContent:
|
|
603
|
+
renderContent: i
|
|
603
604
|
}) => {
|
|
604
|
-
const [l,
|
|
605
|
-
(
|
|
606
|
-
const
|
|
607
|
-
|
|
605
|
+
const [l, d] = v(/* @__PURE__ */ new Set()), s = _(() => o ? new Set(o) : l, [o, l]), c = N(
|
|
606
|
+
(a) => {
|
|
607
|
+
const u = new Set(s);
|
|
608
|
+
u.has(a) ? u.delete(a) : (n || u.clear(), u.add(a)), o && f ? f(Array.from(u)) : d(u);
|
|
608
609
|
},
|
|
609
|
-
[
|
|
610
|
+
[s, o, f, n]
|
|
610
611
|
);
|
|
611
|
-
return /* @__PURE__ */
|
|
612
|
+
return /* @__PURE__ */ g(
|
|
612
613
|
"div",
|
|
613
614
|
{
|
|
614
615
|
className: "accordion",
|
|
615
616
|
role: "region",
|
|
616
617
|
"aria-multiselectable": n,
|
|
617
|
-
children: e.map((
|
|
618
|
-
const
|
|
618
|
+
children: e.map((a) => {
|
|
619
|
+
const u = s.has(a.id), b = `accordion-heading-${a.id}`, m = `accordion-panel-${a.id}`;
|
|
619
620
|
return /* @__PURE__ */ x(
|
|
620
621
|
"div",
|
|
621
622
|
{
|
|
622
|
-
className: `accordion-item
|
|
623
|
+
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,
|
|
623
624
|
children: [
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ x(
|
|
625
626
|
"button",
|
|
626
627
|
{
|
|
628
|
+
id: b,
|
|
627
629
|
type: "button",
|
|
628
|
-
"aria-expanded":
|
|
629
|
-
"aria-controls":
|
|
630
|
-
onClick: () => c(
|
|
631
|
-
className:
|
|
630
|
+
"aria-expanded": u,
|
|
631
|
+
"aria-controls": m,
|
|
632
|
+
onClick: () => c(a.id),
|
|
633
|
+
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}`,
|
|
632
634
|
children: [
|
|
633
|
-
p ? p(
|
|
634
|
-
/* @__PURE__ */
|
|
635
|
+
p ? p(a, u) : a.title,
|
|
636
|
+
/* @__PURE__ */ g(Ce, {})
|
|
635
637
|
]
|
|
636
638
|
}
|
|
637
|
-
)
|
|
638
|
-
/* @__PURE__ */
|
|
639
|
+
),
|
|
640
|
+
/* @__PURE__ */ g(
|
|
639
641
|
"div",
|
|
640
642
|
{
|
|
641
|
-
id:
|
|
643
|
+
id: m,
|
|
642
644
|
role: "region",
|
|
643
|
-
"aria-labelledby":
|
|
644
|
-
hidden: !
|
|
645
|
+
"aria-labelledby": b,
|
|
646
|
+
hidden: !u,
|
|
645
647
|
className: "p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",
|
|
646
|
-
children:
|
|
648
|
+
children: i ? i(a, u) : a.content
|
|
647
649
|
}
|
|
648
650
|
)
|
|
649
651
|
]
|
|
650
652
|
},
|
|
651
|
-
|
|
653
|
+
a.id
|
|
652
654
|
);
|
|
653
655
|
})
|
|
654
656
|
}
|
|
@@ -659,23 +661,23 @@ function Me({
|
|
|
659
661
|
title: n,
|
|
660
662
|
children: t,
|
|
661
663
|
standalone: r = !1,
|
|
662
|
-
showFloatingClose:
|
|
663
|
-
containerClasses:
|
|
664
|
-
onClose:
|
|
664
|
+
showFloatingClose: o = !1,
|
|
665
|
+
containerClasses: f = "",
|
|
666
|
+
onClose: p
|
|
665
667
|
}) {
|
|
666
|
-
const
|
|
667
|
-
|
|
668
|
+
const i = ae(), l = oe(), d = !r && !!i && !!l, [s, c] = v(!1), a = d ? i.isOpen(e) : s, u = d ? i.getModalData(e) : null, b = () => {
|
|
669
|
+
d ? l.closeModal(e) : c(!1), p == null || p();
|
|
668
670
|
};
|
|
669
|
-
return z(() => (
|
|
671
|
+
return z(() => (a ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
670
672
|
document.body.style.overflow = "";
|
|
671
|
-
}), [
|
|
673
|
+
}), [a]), a ? /* @__PURE__ */ g("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]", children: /* @__PURE__ */ x(
|
|
672
674
|
"div",
|
|
673
675
|
{
|
|
674
|
-
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${
|
|
676
|
+
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${f}`,
|
|
675
677
|
children: [
|
|
676
678
|
/* @__PURE__ */ x("div", { className: "flex justify-between items-center relative", children: [
|
|
677
|
-
n && /* @__PURE__ */
|
|
678
|
-
|
|
679
|
+
n && /* @__PURE__ */ g("h2", { className: "text-lg font-semibold", children: n }),
|
|
680
|
+
o && /* @__PURE__ */ g(
|
|
679
681
|
"button",
|
|
680
682
|
{
|
|
681
683
|
onClick: b,
|
|
@@ -685,7 +687,7 @@ function Me({
|
|
|
685
687
|
}
|
|
686
688
|
)
|
|
687
689
|
] }),
|
|
688
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ g("div", { className: "mt-3 text-sm text-gray-700", children: typeof t == "function" ? t({ modalData: u }) : t })
|
|
689
691
|
]
|
|
690
692
|
}
|
|
691
693
|
) }) : null;
|
|
@@ -693,32 +695,32 @@ function Me({
|
|
|
693
695
|
function Te({
|
|
694
696
|
children: e
|
|
695
697
|
}) {
|
|
696
|
-
const [n, t] = v({}), [r,
|
|
697
|
-
t((
|
|
698
|
-
}, []),
|
|
699
|
-
t((
|
|
700
|
-
const
|
|
701
|
-
return delete
|
|
698
|
+
const [n, t] = v({}), [r, o] = v({}), f = N((c, a) => {
|
|
699
|
+
t((u) => ({ ...u, [c]: !0 })), a && o((u) => ({ ...u, [c]: a }));
|
|
700
|
+
}, []), p = N((c) => {
|
|
701
|
+
t((a) => ({ ...a, [c]: !1 })), o((a) => {
|
|
702
|
+
const u = { ...a };
|
|
703
|
+
return delete u[c], u;
|
|
702
704
|
});
|
|
703
|
-
}, []),
|
|
704
|
-
(
|
|
705
|
+
}, []), i = N((c) => !!n[c], [n]), l = N(
|
|
706
|
+
(c) => r[c],
|
|
705
707
|
[r]
|
|
706
|
-
),
|
|
707
|
-
() => ({ openModal:
|
|
708
|
-
[
|
|
709
|
-
),
|
|
710
|
-
() => ({ isOpen:
|
|
711
|
-
[
|
|
708
|
+
), d = _(
|
|
709
|
+
() => ({ openModal: f, closeModal: p }),
|
|
710
|
+
[f, p]
|
|
711
|
+
), s = _(
|
|
712
|
+
() => ({ isOpen: i, getModalData: l }),
|
|
713
|
+
[i, l]
|
|
712
714
|
);
|
|
713
|
-
return /* @__PURE__ */
|
|
715
|
+
return /* @__PURE__ */ g(ne.Provider, { value: d, children: /* @__PURE__ */ g(se.Provider, { value: s, children: e }) });
|
|
714
716
|
}
|
|
715
717
|
function _e(e) {
|
|
716
|
-
const { openModal: n, closeModal: t } = oe(), { isOpen: r, getModalData:
|
|
718
|
+
const { openModal: n, closeModal: t } = oe(), { isOpen: r, getModalData: o } = ae();
|
|
717
719
|
return {
|
|
718
|
-
open: (
|
|
720
|
+
open: (f) => n(e, f),
|
|
719
721
|
close: () => t(e),
|
|
720
722
|
isOpen: r(e),
|
|
721
|
-
data:
|
|
723
|
+
data: o(e)
|
|
722
724
|
};
|
|
723
725
|
}
|
|
724
726
|
let X = null, Y = {};
|
|
@@ -743,35 +745,35 @@ const Le = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, functio
|
|
|
743
745
|
}), Be = () => {
|
|
744
746
|
const [e, n] = v([]);
|
|
745
747
|
z(() => {
|
|
746
|
-
Se((r,
|
|
747
|
-
const
|
|
748
|
-
n((
|
|
749
|
-
n((
|
|
750
|
-
},
|
|
748
|
+
Se((r, o, f, p) => {
|
|
749
|
+
const i = Le();
|
|
750
|
+
n((l) => [...l, { id: i, type: r, message: o, config: p }]), setTimeout(() => {
|
|
751
|
+
n((l) => l.filter((d) => d.id !== i));
|
|
752
|
+
}, f);
|
|
751
753
|
});
|
|
752
754
|
}, []);
|
|
753
755
|
const t = Ne();
|
|
754
|
-
return /* @__PURE__ */
|
|
755
|
-
var
|
|
756
|
-
const
|
|
756
|
+
return /* @__PURE__ */ g("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((r) => {
|
|
757
|
+
var l, d, s, c, a, u, b, m, C, k, $, E, P;
|
|
758
|
+
const o = ((l = r.config) == null ? void 0 : l.icon) || ((d = t.icons) == null ? void 0 : d[r.type]) || Oe(r.type), f = ((s = r.config) == null ? void 0 : s.bgColor) || ((a = (c = t.colors) == null ? void 0 : c[r.type]) == null ? void 0 : a.bg) || "bg-white dark:bg-gray-800", p = ((u = r.config) == null ? void 0 : u.textColor) || ((m = (b = t.colors) == null ? void 0 : b[r.type]) == null ? void 0 : m.text) || "text-gray-700 dark:text-gray-300", i = ((C = r.config) == null ? void 0 : C.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
|
|
757
759
|
return /* @__PURE__ */ x(
|
|
758
760
|
"div",
|
|
759
761
|
{
|
|
760
|
-
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${
|
|
762
|
+
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${f} ${p}`,
|
|
761
763
|
children: [
|
|
762
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ g("div", { className: i, children: o }),
|
|
763
765
|
/* @__PURE__ */ x("div", { className: "flex-1 me-3", children: [
|
|
764
|
-
((k = r.config) == null ? void 0 : k.title) && /* @__PURE__ */
|
|
765
|
-
(($ = r.config) == null ? void 0 : $.description) && /* @__PURE__ */
|
|
766
|
-
!((E = r.config) != null && E.title) && !((P = r.config) != null && P.description) && /* @__PURE__ */
|
|
766
|
+
((k = r.config) == null ? void 0 : k.title) && /* @__PURE__ */ g("div", { className: "font-semibold text-black", children: r.config.title }),
|
|
767
|
+
(($ = r.config) == null ? void 0 : $.description) && /* @__PURE__ */ g("div", { className: "text-sm text-gray-500", children: r.config.description }),
|
|
768
|
+
!((E = r.config) != null && E.title) && !((P = r.config) != null && P.description) && /* @__PURE__ */ g("div", { className: "text-sm", children: r.message })
|
|
767
769
|
] }),
|
|
768
|
-
/* @__PURE__ */
|
|
770
|
+
/* @__PURE__ */ g(
|
|
769
771
|
"button",
|
|
770
772
|
{
|
|
771
773
|
onClick: () => n((j) => j.filter((L) => L.id !== r.id)),
|
|
772
774
|
className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
|
|
773
775
|
"aria-label": "Close",
|
|
774
|
-
children: /* @__PURE__ */
|
|
776
|
+
children: /* @__PURE__ */ g(ke, { size: 18 })
|
|
775
777
|
}
|
|
776
778
|
)
|
|
777
779
|
]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(x,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],o):(x=typeof globalThis<"u"?globalThis:x||self,o(x.TailwindUiKit={},x.jsxRuntime,x.React))})(this,function(x,o,
|
|
1
|
+
(function(x,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],o):(x=typeof globalThis<"u"?globalThis:x||self,o(x.TailwindUiKit={},x.jsxRuntime,x.React))})(this,function(x,o,s){"use strict";"use client";const q=s.forwardRef((e,n)=>{const{label:t,id:r,inputSize:a="md",shape:b="rounded",validate:p,onValidatedChange:d,className:c="",icon:g,iconPosition:l="left",floatingLabelStyle:u,onChange:i,isValid:f,isInvalid:h,feedback:y,feedbackType:C="invalid",...N}=e,[O,L]=s.useState("default"),$=m=>{const v=m.target.value,S=(p==null?void 0:p(v))??"default";L(S),d==null||d(m,S),i==null||i(m)},E={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"},k={flat:"rounded-none",rounded:"rounded-md",pill:"rounded-full"},I={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"},B={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"},F=(m,v,S)=>{if(S)return"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";if(v)return"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";switch(m){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"}},Z=E[a]||E.md,G=k[b]||k.flat,H=F(O,f,h),U=l==="start"||l==="left"?"left-0 ps-3.5":"right-0 pe-3.5",W=g&&(l==="start"||l==="left")?"ps-10":g?"pe-10":"",j=r??`input-${(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"))||Math.random().toString(36).slice(2)}`,w=!!u;return o.jsxs("div",{className:`w-full relative ${w?"z-0":""}`,children:[!w&&t&&o.jsx("label",{htmlFor:j,className:`block mb-1 font-light text-sm ${f?"text-green-700 dark:text-green-500":h?"text-red-700 dark:text-red-500":"text-gray-700"}`,children:t}),o.jsxs("div",{className:"relative w-full",children:[g&&o.jsx("div",{className:`absolute inset-y-0 flex items-center ${U}`,children:o.jsx("span",{className:"text-gray-500",children:g})}),o.jsx("input",{...N,id:j,ref:n,placeholder:w?" ":N.placeholder,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
|
|
2
2
|
${Z}
|
|
3
|
-
${w&&
|
|
4
|
-
${W} ${G} ${H} ${
|
|
3
|
+
${w&&u&&I[u]}
|
|
4
|
+
${W} ${G} ${H} ${c}`}),w&&t&&u&&o.jsx("label",{htmlFor:j,className:`ms-1 ${B[u]} ${c}`,children:t})]}),y&&o.jsx("p",{className:`mt-1 text-xs ${C==="invalid"?"text-red-600 dark:text-red-500":"text-green-600 dark:text-green-500"}`,children:y})]})});q.displayName="Input";const K=s.forwardRef((e,n)=>{const{label:t,id:r,inputSize:a="md",shape:b="rounded",validate:p,onValidatedChange:d,className:c="",icon:g,iconPosition:l="left",floatingLabelStyle:u,onChange:i,isValid:f,isInvalid:h,feedback:y,feedbackType:C="invalid",children:N,...O}=e,[L,$]=s.useState("default"),E=v=>{const S=v.target.value,T=(p==null?void 0:p(S))??"default";$(T),d==null||d(v,T),i==null||i(v)},k={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"},I={flat:"rounded-none",rounded:"rounded-md",pill:"rounded-full"},B={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"},F={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"},Z=(v,S,T)=>{if(T)return"border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";if(S)return"border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";switch(v){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=k[a]||k.md,H=I[b]||I.flat,U=Z(L,f,h),W=l==="start"||l==="left"?"left-0 ps-3.5":"right-0 pe-3.5",j=g&&(l==="start"||l==="left")?"ps-10":g?"pe-10":"",w=r??`select-${(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"))||Math.random().toString(36).slice(2)}`,m=!!u;return o.jsxs("div",{className:`w-full relative ${m?"z-0":""}`,children:[!m&&t&&o.jsx("label",{htmlFor:w,className:`block mb-1 font-light text-sm ${f?"text-green-700":h?"text-red-700":"text-gray-700"}`,children:t}),o.jsxs("div",{className:"relative w-full",children:[g&&o.jsx("div",{className:`absolute inset-y-0 flex items-center ${W}`,children:o.jsx("span",{className:"text-gray-500",children:g})}),o.jsx("select",{...O,id:w,ref:n,onChange:E,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
|
|
5
5
|
${G}
|
|
6
|
-
${m&&
|
|
7
|
-
${j} ${H} ${U} ${
|
|
8
|
-
${
|
|
9
|
-
${i}`,children:n})]})},ae=({children:e,content:n,position:t="top",className:r="",tooltipClass:l="",tooltipStyle:p={}})=>{const f=a.useRef(null),c=a.useRef(null);a.useEffect(()=>{const i=f.current,u=c.current;if(!i||!u)return;const s=()=>{u.style.opacity="1",u.style.visibility="visible"},g=()=>{u.style.opacity="0",u.style.visibility="hidden"};return i.addEventListener("mouseenter",s),i.addEventListener("mouseleave",g),()=>{i.removeEventListener("mouseenter",s),i.removeEventListener("mouseleave",g)}},[]);const d=i=>{const u={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(i){case"top":return{...u,bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};case"bottom":return{...u,top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"left":return{...u,right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"right":return{...u,left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};default:return u}};return o.jsxs("div",{ref:f,className:`relative inline-block ${r}`,children:[e,o.jsx("div",{ref:c,role:"tooltip",className:l,style:{...d(t),...p},children:n})]})},le={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"},ie={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"},ce={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full p-2 w-8 h-8 justify-center"},de=({label:e,variant:n="primary",size:t="sm",shape:r="rounded",icon:l,dismissible:p,onDismiss:f,className:c="",...d})=>{const i=!e&&!!l,u=`inline-flex items-center font-medium ${le[n]||""} ${ie[t]||""} ${ce[r]||""} ${i?"justify-center p-2 w-8 h-8":""} `+c;return o.jsxs("span",{className:u.trim(),...d,children:[l&&o.jsx("span",{className:e?"mr-1":"",children:l}),e,p&&o.jsx("button",{type:"button",onClick:f,className:"ml-2 text-xs font-bold leading-none focus:outline-none",children:"×"})]})};var X={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Y=a.createContext&&a.createContext(X),ue=["attr","size","title"];function ge(e,n){if(e==null)return{};var t=fe(e,n),r,l;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);for(l=0;l<p.length;l++)r=p[l],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function fe(e,n){if(e==null)return{};var t={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}function P(){return P=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},P.apply(this,arguments)}function J(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,r)}return t}function M(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?J(Object(t),!0).forEach(function(r){pe(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):J(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function pe(e,n,t){return n=be(n),n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function be(e){var n=xe(e,"string");return typeof n=="symbol"?n:n+""}function xe(e,n){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var r=t.call(e,n);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Q(e){return e&&e.map((n,t)=>a.createElement(n.tag,M({key:t},n.attr),Q(n.child)))}function V(e){return n=>a.createElement(he,P({attr:M({},e.attr)},n),Q(e.child))}function he(e){var n=t=>{var{attr:r,size:l,title:p}=e,f=ge(e,ue),c=l||t.size||"1em",d;return t.className&&(d=t.className),e.className&&(d=(d?d+" ":"")+e.className),a.createElement("svg",P({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,f,{className:d,style:M(M({color:e.color||t.color},t.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),p&&a.createElement("title",null,p),e.children)};return Y!==void 0?a.createElement(Y.Consumer,null,t=>n(t)):n(X)}function ye(e){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)}const me=({items:e,allowMultipleOpen:n=!1,className:t="",open:r,onChange:l,renderTitle:p,renderContent:f})=>{const[c,d]=a.useState(new Set),i=a.useMemo(()=>r?new Set(r):c,[r,c]),u=a.useCallback(s=>{const g=new Set(i);g.has(s)?g.delete(s):(n||g.clear(),g.add(s)),r&&l?l(Array.from(g)):d(g)},[i,r,l,n]);return o.jsx("div",{className:"accordion",role:"region","aria-multiselectable":n,children:e.map(s=>{const g=i.has(s.id),b=`accordion-heading-${s.id}`,h=`accordion-panel-${s.id}`;return o.jsxs("div",{className:`accordion-item mb-2 border rounded border-gray-300 dark:border-gray-700 ${t}`,children:[o.jsx("h3",{id:b,children:o.jsxs("button",{type:"button","aria-expanded":g,"aria-controls":h,onClick:()=>u(s.id),className:"flex justify-between items-center w-full p-2 font-medium text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3",children:[p?p(s,g):s.title,o.jsx(ye,{})]})}),o.jsx("div",{id:h,role:"region","aria-labelledby":b,hidden:!g,className:"p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",children:f?f(s,g):s.content})]},s.id)})})},R=a.createContext(null),z=()=>a.useContext(R),ee=a.createContext(null),A=()=>a.useContext(ee);function we({id:e,title:n,children:t,standalone:r=!1,showFloatingClose:l=!1,containerClasses:p="",onClose:f}){const c=A(),d=z(),i=!r&&!!c&&!!d,[u,s]=a.useState(!1),g=i?c.isOpen(e):u,b=i?c.getModalData(e):null,h=()=>{i?d.closeModal(e):s(!1),f==null||f()};return a.useEffect(()=>(g?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[g]),g?o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",children:o.jsxs("div",{className:`bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${p}`,children:[o.jsxs("div",{className:"flex justify-between items-center relative",children:[n&&o.jsx("h2",{className:"text-lg font-semibold",children:n}),l&&o.jsx("button",{onClick:h,className:"text-gray-500 hover:text-gray-700 absolute top-2 right-3","aria-label":"Close modal",children:"✕"})]}),o.jsx("div",{className:"mt-3 text-sm text-gray-700",children:typeof t=="function"?t({modalData:b}):t})]})}):null}function ve({children:e}){const[n,t]=a.useState({}),[r,l]=a.useState({}),p=a.useCallback((s,g)=>{t(b=>({...b,[s]:!0})),g&&l(b=>({...b,[s]:g}))},[]),f=a.useCallback(s=>{t(g=>({...g,[s]:!1})),l(g=>{const b={...g};return delete b[s],b})},[]),c=a.useCallback(s=>!!n[s],[n]),d=a.useCallback(s=>r[s],[r]),i=a.useMemo(()=>({openModal:p,closeModal:f}),[p,f]),u=a.useMemo(()=>({isOpen:c,getModalData:d}),[c,d]);return o.jsx(R.Provider,{value:i,children:o.jsx(ee.Provider,{value:u,children:e})})}function Ce(e){const{openModal:n,closeModal:t}=z(),{isOpen:r,getModalData:l}=A();return{open:p=>n(e,p),close:()=>t(e),isOpen:r(e),data:l(e)}}let D=null,_={};function Se(e){D=e}function Ne(e){_={..._,...e}}function ke(){return _}function Oe(e,n,t=3e3,r){D?D(e,n,t,r):console.warn("Toast system is not mounted")}function Le(e){return V({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 $e=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)}),Ee=()=>{const[e,n]=a.useState([]);a.useEffect(()=>{Se((r,l,p,f)=>{const c=$e();n(d=>[...d,{id:c,type:r,message:l,config:f}]),setTimeout(()=>{n(d=>d.filter(i=>i.id!==c))},p)})},[]);const t=ke();return o.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(r=>{var d,i,u,s,g,b,h,y,C,N,O,L,$;const l=((d=r.config)==null?void 0:d.icon)||((i=t.icons)==null?void 0:i[r.type])||je(r.type),p=((u=r.config)==null?void 0:u.bgColor)||((g=(s=t.colors)==null?void 0:s[r.type])==null?void 0:g.bg)||"bg-white dark:bg-gray-800",f=((b=r.config)==null?void 0:b.textColor)||((y=(h=t.colors)==null?void 0:h[r.type])==null?void 0:y.text)||"text-gray-700 dark:text-gray-300",c=((C=r.config)==null?void 0:C.iconContainerClass)||"w-8 h-8 mr-3 text-xl flex items-center justify-center";return o.jsxs("div",{className:`flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${p} ${f}`,children:[o.jsx("div",{className:c,children:l}),o.jsxs("div",{className:"flex-1 me-3",children:[((N=r.config)==null?void 0:N.title)&&o.jsx("div",{className:"font-semibold text-black",children:r.config.title}),((O=r.config)==null?void 0:O.description)&&o.jsx("div",{className:"text-sm text-gray-500",children:r.config.description}),!((L=r.config)!=null&&L.title)&&!(($=r.config)!=null&&$.description)&&o.jsx("div",{className:"text-sm",children:r.message})]}),o.jsx("button",{onClick:()=>n(E=>E.filter(k=>k.id!==r.id)),className:"ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white","aria-label":"Close",children:o.jsx(Le,{size:18})})]},r.id)})})};function je(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}x.Accordion=me,x.Badge=de,x.Button=oe,x.Dropdown=se,x.Input=q,x.Modal=we,x.ModalProvider=ve,x.Select=K,x.Toast=Ee,x.Tooltip=ae,x.setToastDefaults=Ne,x.showToast=Oe,x.useModalActions=z,x.useModalInstance=Ce,x.useModalState=A,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
|
6
|
+
${m&&u&&B[u]}
|
|
7
|
+
${j} ${H} ${U} ${c}`,children:N}),m&&t&&u&&o.jsx("label",{htmlFor:w,className:`ms-1 ${F[u]} ${c}`,children:t})]}),y&&o.jsx("p",{className:`mt-1 text-xs ${C==="invalid"?"text-red-600":"text-green-600"}`,children:y})]})});K.displayName="Select";const te={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-600 text-white hover:bg-gray-700",success:"bg-green-600 text-white hover:bg-green-700",danger:"bg-red-600 text-white hover:bg-red-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-cyan-600 text-white hover:bg-cyan-700",dark:"bg-gray-900 text-white hover:bg-black",light:"bg-gray-100 text-black hover:bg-gray-200",link:"bg-transparent text-blue-600 hover:underline [&&]:p-0 [&&]:shadow-none","outline-primary":"border border-blue-600 text-blue-600 hover:bg-blue-50","outline-secondary":"border border-gray-600 text-gray-600 hover:bg-gray-50","outline-success":"border border-green-600 text-green-600 hover:bg-green-50","outline-danger":"border border-red-600 text-red-600 hover:bg-red-50","outline-warning":"border border-yellow-500 text-yellow-600 hover:bg-yellow-50","outline-info":"border border-cyan-600 text-cyan-600 hover:bg-cyan-50","outline-dark":"border border-gray-900 text-gray-900 hover:bg-gray-100","outline-light":"border border-gray-100 text-gray-500 hover:bg-gray-200"},re={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"},ne={flat:"shadow-none",rounded:"rounded-md",pill:"rounded-full",circle:"rounded-full w-10 h-10 p-0 flex items-center justify-center"},oe=({children:e,variant:n="primary",size:t="md",type:r="button",shape:a="rounded",className:b="",isLoading:p=!1,disabled:d=!1,...c})=>{const g=d||p,l=["inline-flex items-center justify-center font-normal transition duration-150 cursor-pointer",te[n],re[t],ne[a],a==="flat"?"shadow-none":"shadow-sm",g?"opacity-50 cursor-not-allowed pointer-events-none":"",b].filter(Boolean).join(" ");return o.jsxs("button",{type:r,className:l,disabled:g,...c,children:[p&&o.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:[o.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"}),o.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]})},se=({label:e,children:n,position:t="right"})=>{const[r,a]=s.useState(!1),[b,p]=s.useState(!1),d=s.useRef(null),c=s.useRef(null),g=s.useMemo(()=>{switch(t){case"left":return"left-0";case"center":return"left-1/2 transform -translate-x-1/2";case"right":default:return"right-0"}},[t]),l=s.useCallback(f=>{const h=f.target;d.current&&!d.current.contains(h)&&c.current&&!c.current.contains(h)&&a(!1)},[]),u=s.useCallback(()=>{if(!c.current||!d.current)return;const f=c.current.getBoundingClientRect(),h=d.current.getBoundingClientRect(),y=window.innerHeight-f.bottom,C=f.top;p(y<h.height&&C>h.height)},[]);s.useEffect(()=>{if(r)return u(),window.addEventListener("resize",u),window.addEventListener("scroll",u,!0),()=>{window.removeEventListener("resize",u),window.removeEventListener("scroll",u,!0)}},[r,u]),s.useEffect(()=>(document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)),[l]);const i=s.useCallback(()=>a(f=>!f),[]);return o.jsxs("div",{className:"relative flex items-center",children:[o.jsx("button",{ref:c,onClick:i,children:e}),r&&o.jsx("div",{ref:d,className:`absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
|
|
8
|
+
${b?"bottom-full mb-2":"top-full mt-2"}
|
|
9
|
+
${g}`,children:n})]})},ae=({children:e,content:n,position:t="top",className:r="",tooltipClass:a="",tooltipStyle:b={}})=>{const p=s.useRef(null),d=s.useRef(null);s.useEffect(()=>{const g=p.current,l=d.current;if(!g||!l)return;const u=()=>{l.style.opacity="1",l.style.visibility="visible"},i=()=>{l.style.opacity="0",l.style.visibility="hidden"};return g.addEventListener("mouseenter",u),g.addEventListener("mouseleave",i),()=>{g.removeEventListener("mouseenter",u),g.removeEventListener("mouseleave",i)}},[]);const c=g=>{const l={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(g){case"top":return{...l,bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};case"bottom":return{...l,top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"left":return{...l,right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"right":return{...l,left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};default:return l}};return o.jsxs("div",{ref:p,className:`relative inline-block ${r}`,children:[e,o.jsx("div",{ref:d,role:"tooltip",className:a,style:{...c(t),...b},children:n})]})},le={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"},ie={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"},ce={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full p-2 w-8 h-8 justify-center"},de=({label:e,variant:n="primary",size:t="sm",shape:r="rounded",icon:a,dismissible:b,onDismiss:p,className:d="",...c})=>{const g=!e&&!!a,l=`inline-flex items-center font-medium ${le[n]||""} ${ie[t]||""} ${ce[r]||""} ${g?"justify-center p-2 w-8 h-8":""} `+d;return o.jsxs("span",{className:l.trim(),...c,children:[a&&o.jsx("span",{className:e?"mr-1":"",children:a}),e,b&&o.jsx("button",{type:"button",onClick:p,className:"ml-2 text-xs font-bold leading-none focus:outline-none",children:"×"})]})};var X={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Y=s.createContext&&s.createContext(X),ue=["attr","size","title"];function ge(e,n){if(e==null)return{};var t=fe(e,n),r,a;if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(a=0;a<b.length;a++)r=b[a],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function fe(e,n){if(e==null)return{};var t={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}function P(){return P=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},P.apply(this,arguments)}function J(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,r)}return t}function M(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?J(Object(t),!0).forEach(function(r){pe(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):J(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function pe(e,n,t){return n=be(n),n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function be(e){var n=xe(e,"string");return typeof n=="symbol"?n:n+""}function xe(e,n){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var r=t.call(e,n);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Q(e){return e&&e.map((n,t)=>s.createElement(n.tag,M({key:t},n.attr),Q(n.child)))}function V(e){return n=>s.createElement(he,P({attr:M({},e.attr)},n),Q(e.child))}function he(e){var n=t=>{var{attr:r,size:a,title:b}=e,p=ge(e,ue),d=a||t.size||"1em",c;return t.className&&(c=t.className),e.className&&(c=(c?c+" ":"")+e.className),s.createElement("svg",P({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,p,{className:c,style:M(M({color:e.color||t.color},t.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),b&&s.createElement("title",null,b),e.children)};return Y!==void 0?s.createElement(Y.Consumer,null,t=>n(t)):n(X)}function ye(e){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)}const me=({items:e,allowMultipleOpen:n=!1,className:t="",tileClasses:r="",open:a,onChange:b,renderTitle:p,renderContent:d})=>{const[c,g]=s.useState(new Set),l=s.useMemo(()=>a?new Set(a):c,[a,c]),u=s.useCallback(i=>{const f=new Set(l);f.has(i)?f.delete(i):(n||f.clear(),f.add(i)),a&&b?b(Array.from(f)):g(f)},[l,a,b,n]);return o.jsx("div",{className:"accordion",role:"region","aria-multiselectable":n,children:e.map(i=>{const f=l.has(i.id),h=`accordion-heading-${i.id}`,y=`accordion-panel-${i.id}`;return o.jsxs("div",{className:`accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,children:[o.jsxs("button",{id:h,type:"button","aria-expanded":f,"aria-controls":y,onClick:()=>u(i.id),className:`flex justify-between items-center w-full p-1.5 text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3 ${r}`,children:[p?p(i,f):i.title,o.jsx(ye,{})]}),o.jsx("div",{id:y,role:"region","aria-labelledby":h,hidden:!f,className:"p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",children:d?d(i,f):i.content})]},i.id)})})},R=s.createContext(null),z=()=>s.useContext(R),ee=s.createContext(null),A=()=>s.useContext(ee);function we({id:e,title:n,children:t,standalone:r=!1,showFloatingClose:a=!1,containerClasses:b="",onClose:p}){const d=A(),c=z(),g=!r&&!!d&&!!c,[l,u]=s.useState(!1),i=g?d.isOpen(e):l,f=g?d.getModalData(e):null,h=()=>{g?c.closeModal(e):u(!1),p==null||p()};return s.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i]),i?o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",children:o.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:[o.jsxs("div",{className:"flex justify-between items-center relative",children:[n&&o.jsx("h2",{className:"text-lg font-semibold",children:n}),a&&o.jsx("button",{onClick:h,className:"text-gray-500 hover:text-gray-700 absolute top-2 right-3","aria-label":"Close modal",children:"✕"})]}),o.jsx("div",{className:"mt-3 text-sm text-gray-700",children:typeof t=="function"?t({modalData:f}):t})]})}):null}function ve({children:e}){const[n,t]=s.useState({}),[r,a]=s.useState({}),b=s.useCallback((u,i)=>{t(f=>({...f,[u]:!0})),i&&a(f=>({...f,[u]:i}))},[]),p=s.useCallback(u=>{t(i=>({...i,[u]:!1})),a(i=>{const f={...i};return delete f[u],f})},[]),d=s.useCallback(u=>!!n[u],[n]),c=s.useCallback(u=>r[u],[r]),g=s.useMemo(()=>({openModal:b,closeModal:p}),[b,p]),l=s.useMemo(()=>({isOpen:d,getModalData:c}),[d,c]);return o.jsx(R.Provider,{value:g,children:o.jsx(ee.Provider,{value:l,children:e})})}function Ce(e){const{openModal:n,closeModal:t}=z(),{isOpen:r,getModalData:a}=A();return{open:b=>n(e,b),close:()=>t(e),isOpen:r(e),data:a(e)}}let D=null,_={};function Se(e){D=e}function Ne(e){_={..._,...e}}function ke(){return _}function Oe(e,n,t=3e3,r){D?D(e,n,t,r):console.warn("Toast system is not mounted")}function Le(e){return V({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 $e=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)}),Ee=()=>{const[e,n]=s.useState([]);s.useEffect(()=>{Se((r,a,b,p)=>{const d=$e();n(c=>[...c,{id:d,type:r,message:a,config:p}]),setTimeout(()=>{n(c=>c.filter(g=>g.id!==d))},b)})},[]);const t=ke();return o.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(r=>{var c,g,l,u,i,f,h,y,C,N,O,L,$;const a=((c=r.config)==null?void 0:c.icon)||((g=t.icons)==null?void 0:g[r.type])||je(r.type),b=((l=r.config)==null?void 0:l.bgColor)||((i=(u=t.colors)==null?void 0:u[r.type])==null?void 0:i.bg)||"bg-white dark:bg-gray-800",p=((f=r.config)==null?void 0:f.textColor)||((y=(h=t.colors)==null?void 0:h[r.type])==null?void 0:y.text)||"text-gray-700 dark:text-gray-300",d=((C=r.config)==null?void 0:C.iconContainerClass)||"w-8 h-8 mr-3 text-xl flex items-center justify-center";return o.jsxs("div",{className:`flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${b} ${p}`,children:[o.jsx("div",{className:d,children:a}),o.jsxs("div",{className:"flex-1 me-3",children:[((N=r.config)==null?void 0:N.title)&&o.jsx("div",{className:"font-semibold text-black",children:r.config.title}),((O=r.config)==null?void 0:O.description)&&o.jsx("div",{className:"text-sm text-gray-500",children:r.config.description}),!((L=r.config)!=null&&L.title)&&!(($=r.config)!=null&&$.description)&&o.jsx("div",{className:"text-sm",children:r.message})]}),o.jsx("button",{onClick:()=>n(E=>E.filter(k=>k.id!==r.id)),className:"ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white","aria-label":"Close",children:o.jsx(Le,{size:18})})]},r.id)})})};function je(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}x.Accordion=me,x.Badge=de,x.Button=oe,x.Dropdown=se,x.Input=q,x.Modal=we,x.ModalProvider=ve,x.Select=K,x.Toast=Ee,x.Tooltip=ae,x.setToastDefaults=Ne,x.showToast=Oe,x.useModalActions=z,x.useModalInstance=Ce,x.useModalState=A,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|