tailwind-ux-kit 1.0.84 → 1.0.91
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/Toast.d.ts +4 -1
- package/lib/index.css +1 -770
- package/lib/tailwind-ux-kit.es.js +350 -333
- package/lib/tailwind-ux-kit.umd.js +7 -7
- package/lib/utils/toast.d.ts +3 -0
- package/package.json +1 -1
- package/lib/components/Button.d.ts +0 -14
- package/lib/components/Checkbox.d.ts +0 -7
- package/lib/components/Radio.d.ts +0 -9
- package/lib/components/Toggle.d.ts +0 -7
- package/lib/tailwind-ux-kit.css +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as S, jsx as i } from "react/jsx-runtime";
|
|
3
|
-
import A, { forwardRef as oe, useState as
|
|
3
|
+
import A, { forwardRef as oe, useState as z, useMemo as j, useId as be, useRef as F, useCallback as D, useEffect as B, createContext as ae, useContext as le } from "react";
|
|
4
4
|
const V = {
|
|
5
5
|
xs: "text-xs px-2 py-1",
|
|
6
6
|
sm: "text-sm px-3 py-1.5",
|
|
@@ -18,10 +18,10 @@ const V = {
|
|
|
18
18
|
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",
|
|
19
19
|
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",
|
|
20
20
|
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"
|
|
21
|
-
}, he = (e,
|
|
22
|
-
if (
|
|
21
|
+
}, he = (e, n, t) => {
|
|
22
|
+
if (t)
|
|
23
23
|
return "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";
|
|
24
|
-
if (
|
|
24
|
+
if (n)
|
|
25
25
|
return "border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";
|
|
26
26
|
switch (e) {
|
|
27
27
|
case "error":
|
|
@@ -33,19 +33,19 @@ const V = {
|
|
|
33
33
|
default:
|
|
34
34
|
return "border-gray-300 focus:ring-blue-500";
|
|
35
35
|
}
|
|
36
|
-
}, ye = oe((e,
|
|
36
|
+
}, ye = oe((e, n) => {
|
|
37
37
|
const {
|
|
38
|
-
label:
|
|
39
|
-
id:
|
|
38
|
+
label: t,
|
|
39
|
+
id: r,
|
|
40
40
|
inputSize: s = "md",
|
|
41
|
-
shape:
|
|
41
|
+
shape: c = "rounded",
|
|
42
42
|
validate: p,
|
|
43
|
-
onValidatedChange:
|
|
44
|
-
className:
|
|
43
|
+
onValidatedChange: f,
|
|
44
|
+
className: d = "",
|
|
45
45
|
icon: a,
|
|
46
46
|
iconPosition: o = "left",
|
|
47
47
|
floatingLabelStyle: l,
|
|
48
|
-
onChange:
|
|
48
|
+
onChange: u,
|
|
49
49
|
isValid: g,
|
|
50
50
|
isInvalid: b,
|
|
51
51
|
feedback: x,
|
|
@@ -53,69 +53,69 @@ const V = {
|
|
|
53
53
|
feedbackType: $ = "invalid",
|
|
54
54
|
labelClasses: N = "",
|
|
55
55
|
inputType: w = "",
|
|
56
|
-
inputPattern:
|
|
57
|
-
...
|
|
58
|
-
} = e, [v,
|
|
59
|
-
(
|
|
60
|
-
const
|
|
61
|
-
|
|
56
|
+
inputPattern: y,
|
|
57
|
+
...h
|
|
58
|
+
} = e, [v, P] = z("default"), L = A.useCallback(
|
|
59
|
+
(I) => {
|
|
60
|
+
const E = I.target.value, Z = (p == null ? void 0 : p(E)) ?? "default";
|
|
61
|
+
P(Z), f == null || f(I, Z), u == null || u(I);
|
|
62
62
|
},
|
|
63
|
-
[p,
|
|
64
|
-
), m = j(() =>
|
|
63
|
+
[p, f, u]
|
|
64
|
+
), m = j(() => r || (typeof t == "string" ? `input-${t.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [r, t]), C = !!l, O = V[s] || V.md, M = ee[c] || ee.flat, R = j(
|
|
65
65
|
() => he(v, g, b),
|
|
66
66
|
[v, g, b]
|
|
67
|
-
), T = j(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), _ = j(() => a ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [a, o]), K = (
|
|
67
|
+
), T = j(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), _ = j(() => a ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [a, o]), K = (I) => {
|
|
68
68
|
var H;
|
|
69
|
-
const
|
|
70
|
-
!(
|
|
69
|
+
const E = I.key;
|
|
70
|
+
!(I.ctrlKey || I.metaKey || E.length !== 1 || ["Backspace", "ArrowLeft", "ArrowRight", "Delete", "Tab"].includes(E)) && (() => {
|
|
71
71
|
const W = /^\d$/, X = /^[a-zA-Z]$/;
|
|
72
72
|
switch (w) {
|
|
73
73
|
case "numeric":
|
|
74
74
|
case "number":
|
|
75
75
|
case "integer":
|
|
76
|
-
return !W.test(
|
|
76
|
+
return !W.test(E);
|
|
77
77
|
case "decimal":
|
|
78
|
-
return !W.test(
|
|
78
|
+
return !W.test(E) && E !== "." && E !== "Backspace" && E !== "Tab";
|
|
79
79
|
case "alphabetic":
|
|
80
|
-
return !X.test(
|
|
80
|
+
return !X.test(E);
|
|
81
81
|
case "custom":
|
|
82
|
-
return
|
|
82
|
+
return y ? !y.test(E) : !1;
|
|
83
83
|
default:
|
|
84
84
|
return !1;
|
|
85
85
|
}
|
|
86
|
-
})() &&
|
|
87
|
-
}, ge = (
|
|
86
|
+
})() && I.preventDefault(), (H = h.onKeyDown) == null || H.call(h, I);
|
|
87
|
+
}, ge = (I) => {
|
|
88
88
|
var U;
|
|
89
|
-
const
|
|
89
|
+
const E = I.clipboardData.getData("Text");
|
|
90
90
|
(() => {
|
|
91
91
|
const H = /^\d+$/, W = /^\d*\.?\d*$/, X = /^[a-zA-Z]+$/;
|
|
92
92
|
switch (w) {
|
|
93
93
|
case "numeric":
|
|
94
94
|
case "number":
|
|
95
95
|
case "integer":
|
|
96
|
-
return !H.test(
|
|
96
|
+
return !H.test(E);
|
|
97
97
|
case "decimal":
|
|
98
|
-
return !W.test(
|
|
98
|
+
return !W.test(E);
|
|
99
99
|
case "alphabetic":
|
|
100
|
-
return !X.test(
|
|
100
|
+
return !X.test(E);
|
|
101
101
|
case "custom":
|
|
102
|
-
return
|
|
102
|
+
return y ? !y.test(E) : !1;
|
|
103
103
|
default:
|
|
104
104
|
return !1;
|
|
105
105
|
}
|
|
106
|
-
})() &&
|
|
106
|
+
})() && I.preventDefault(), (U = h.onPaste) == null || U.call(h, I);
|
|
107
107
|
};
|
|
108
108
|
return /* @__PURE__ */ S(
|
|
109
109
|
"div",
|
|
110
110
|
{
|
|
111
111
|
className: `w-full relative ${C ? "z-0" : ""} tailwind-ux-input`,
|
|
112
112
|
children: [
|
|
113
|
-
!C &&
|
|
113
|
+
!C && t && /* @__PURE__ */ i(
|
|
114
114
|
"label",
|
|
115
115
|
{
|
|
116
116
|
htmlFor: m,
|
|
117
117
|
className: `block mb-1 text-sm ${g ? "text-green-700 dark:text-green-500" : b ? "text-red-700 dark:text-red-500" : "text-gray-700"} ${N}`,
|
|
118
|
-
children:
|
|
118
|
+
children: t
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
121
|
/* @__PURE__ */ S("div", { className: "relative w-full", children: [
|
|
@@ -130,25 +130,25 @@ const V = {
|
|
|
130
130
|
/* @__PURE__ */ i(
|
|
131
131
|
"input",
|
|
132
132
|
{
|
|
133
|
-
...
|
|
133
|
+
...h,
|
|
134
134
|
id: m,
|
|
135
|
-
ref:
|
|
136
|
-
placeholder: C ? " " :
|
|
137
|
-
onChange:
|
|
135
|
+
ref: n,
|
|
136
|
+
placeholder: C ? " " : h.placeholder,
|
|
137
|
+
onChange: L,
|
|
138
138
|
onKeyDown: K,
|
|
139
139
|
onPaste: ge,
|
|
140
140
|
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
|
|
141
141
|
${O}
|
|
142
142
|
${C && l && me[l]}
|
|
143
|
-
${_} ${M} ${
|
|
143
|
+
${_} ${M} ${R} ${d}`
|
|
144
144
|
}
|
|
145
145
|
),
|
|
146
|
-
C &&
|
|
146
|
+
C && t && l && /* @__PURE__ */ i(
|
|
147
147
|
"label",
|
|
148
148
|
{
|
|
149
149
|
htmlFor: m,
|
|
150
|
-
className: `ms-1 ${xe[l]} ${
|
|
151
|
-
children:
|
|
150
|
+
className: `ms-1 ${xe[l]} ${d}`,
|
|
151
|
+
children: t
|
|
152
152
|
}
|
|
153
153
|
)
|
|
154
154
|
] }),
|
|
@@ -182,52 +182,52 @@ const we = {
|
|
|
182
182
|
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",
|
|
183
183
|
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",
|
|
184
184
|
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"
|
|
185
|
-
}, ke = (e,
|
|
186
|
-
if (
|
|
185
|
+
}, ke = (e, n, t) => {
|
|
186
|
+
if (t)
|
|
187
187
|
return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
|
|
188
|
-
if (
|
|
188
|
+
if (n)
|
|
189
189
|
return "border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";
|
|
190
|
-
const
|
|
190
|
+
const r = "focus:ring focus:border";
|
|
191
191
|
switch (e) {
|
|
192
192
|
case "error":
|
|
193
|
-
return `${
|
|
193
|
+
return `${r}-red-500 border-red-500 bg-red-50`;
|
|
194
194
|
case "warning":
|
|
195
|
-
return `${
|
|
195
|
+
return `${r}-yellow-500 border-yellow-500 bg-yellow-50`;
|
|
196
196
|
case "success":
|
|
197
|
-
return `${
|
|
197
|
+
return `${r}-green-500 border-green-500 bg-green-50`;
|
|
198
198
|
default:
|
|
199
199
|
return "border-gray-300 focus:ring-blue-500";
|
|
200
200
|
}
|
|
201
|
-
}, Se = oe((e,
|
|
201
|
+
}, Se = oe((e, n) => {
|
|
202
202
|
const {
|
|
203
|
-
label:
|
|
204
|
-
id:
|
|
203
|
+
label: t,
|
|
204
|
+
id: r,
|
|
205
205
|
inputSize: s = "md",
|
|
206
|
-
shape:
|
|
206
|
+
shape: c = "rounded",
|
|
207
207
|
validate: p,
|
|
208
|
-
onValidatedChange:
|
|
209
|
-
className:
|
|
208
|
+
onValidatedChange: f,
|
|
209
|
+
className: d = "",
|
|
210
210
|
icon: a,
|
|
211
211
|
iconPosition: o = "left",
|
|
212
212
|
floatingLabelStyle: l,
|
|
213
|
-
onChange:
|
|
213
|
+
onChange: u,
|
|
214
214
|
isValid: g,
|
|
215
215
|
isInvalid: b,
|
|
216
216
|
feedback: x,
|
|
217
217
|
feedbackType: k = "invalid",
|
|
218
218
|
children: $,
|
|
219
219
|
...N
|
|
220
|
-
} = e, [w,
|
|
220
|
+
} = e, [w, y] = z("default"), h = be(), v = j(() => r || (typeof t == "string" ? `select-${t.toLowerCase().replace(/\s+/g, "-")}` : h), [r, t, h]), P = (T) => {
|
|
221
221
|
const _ = T.target.value, K = (p == null ? void 0 : p(_)) ?? "default";
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
return /* @__PURE__ */ S("div", { className: `w-full relative ${
|
|
225
|
-
!
|
|
222
|
+
y(K), f == null || f(T, K), u == null || u(T);
|
|
223
|
+
}, L = !!l, m = we[s], C = ve[c], O = ke(w, g, b);
|
|
224
|
+
return /* @__PURE__ */ S("div", { className: `w-full relative ${L ? "z-0" : ""}`, children: [
|
|
225
|
+
!L && t && /* @__PURE__ */ i(
|
|
226
226
|
"label",
|
|
227
227
|
{
|
|
228
228
|
htmlFor: v,
|
|
229
229
|
className: `block mb-1 text-sm ${g ? "text-green-700" : b ? "text-red-700" : "text-gray-700"}`,
|
|
230
|
-
children:
|
|
230
|
+
children: t
|
|
231
231
|
}
|
|
232
232
|
),
|
|
233
233
|
/* @__PURE__ */ S("div", { className: "relative w-full", children: [
|
|
@@ -243,21 +243,21 @@ const we = {
|
|
|
243
243
|
{
|
|
244
244
|
...N,
|
|
245
245
|
id: v,
|
|
246
|
-
ref:
|
|
247
|
-
onChange:
|
|
246
|
+
ref: n,
|
|
247
|
+
onChange: P,
|
|
248
248
|
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
|
|
249
249
|
${m} ${a && (o === "start" || o === "left") ? "ps-10" : a ? "pe-10" : ""}
|
|
250
|
-
${
|
|
251
|
-
${C} ${O} ${
|
|
250
|
+
${L && l && Ce[l]}
|
|
251
|
+
${C} ${O} ${d}`,
|
|
252
252
|
children: $
|
|
253
253
|
}
|
|
254
254
|
),
|
|
255
|
-
|
|
255
|
+
L && t && l && /* @__PURE__ */ i(
|
|
256
256
|
"label",
|
|
257
257
|
{
|
|
258
258
|
htmlFor: v,
|
|
259
|
-
className: `ms-1 ${$e[l]} ${
|
|
260
|
-
children:
|
|
259
|
+
className: `ms-1 ${$e[l]} ${d}`,
|
|
260
|
+
children: t
|
|
261
261
|
}
|
|
262
262
|
)
|
|
263
263
|
] }),
|
|
@@ -297,38 +297,38 @@ const Ne = {
|
|
|
297
297
|
"soft-info": "btn-soft-info",
|
|
298
298
|
"soft-dark": "btn-soft-dark",
|
|
299
299
|
"soft-light": "btn-soft-light"
|
|
300
|
-
},
|
|
300
|
+
}, Le = {
|
|
301
301
|
xs: "px-3 py-2 text-xs",
|
|
302
302
|
sm: "px-3 py-2 text-sm",
|
|
303
303
|
md: "px-5 py-2.5 text-sm",
|
|
304
304
|
lg: "px-5 py-3 text-base",
|
|
305
305
|
xl: "px-6 py-3.5 text-base"
|
|
306
|
-
},
|
|
306
|
+
}, Ee = {
|
|
307
307
|
flat: "shadow-none",
|
|
308
308
|
rounded: "rounded-sm",
|
|
309
309
|
pill: "rounded-full",
|
|
310
310
|
circle: "rounded-full w-10 h-10 p-0 flex items-center justify-center"
|
|
311
311
|
}, Qe = ({
|
|
312
312
|
children: e,
|
|
313
|
-
variant:
|
|
314
|
-
size:
|
|
315
|
-
type:
|
|
313
|
+
variant: n = "primary",
|
|
314
|
+
size: t = "md",
|
|
315
|
+
type: r = "button",
|
|
316
316
|
shape: s = "rounded",
|
|
317
|
-
className:
|
|
317
|
+
className: c = "",
|
|
318
318
|
isLoading: p = !1,
|
|
319
|
-
disabled:
|
|
320
|
-
...
|
|
319
|
+
disabled: f = !1,
|
|
320
|
+
...d
|
|
321
321
|
}) => {
|
|
322
|
-
const a =
|
|
322
|
+
const a = f || p, o = [
|
|
323
323
|
"inline-flex items-center justify-center font-normal transition duration-150",
|
|
324
|
-
Ne[
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
Ne[n],
|
|
325
|
+
Le[t],
|
|
326
|
+
Ee[s],
|
|
327
327
|
s === "flat" ? "shadow-none" : "shadow-sm",
|
|
328
328
|
a ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
329
|
-
|
|
329
|
+
c
|
|
330
330
|
].filter(Boolean).join(" ");
|
|
331
|
-
return /* @__PURE__ */ S("button", { type:
|
|
331
|
+
return /* @__PURE__ */ S("button", { type: r, className: o, disabled: a, ...d, children: [
|
|
332
332
|
p && /* @__PURE__ */ S(
|
|
333
333
|
"svg",
|
|
334
334
|
{
|
|
@@ -366,106 +366,106 @@ var ie = {
|
|
|
366
366
|
style: void 0,
|
|
367
367
|
attr: void 0
|
|
368
368
|
}, te = A.createContext && /* @__PURE__ */ A.createContext(ie), Oe = ["attr", "size", "title"];
|
|
369
|
-
function Pe(e,
|
|
369
|
+
function Pe(e, n) {
|
|
370
370
|
if (e == null) return {};
|
|
371
|
-
var
|
|
371
|
+
var t = Ie(e, n), r, s;
|
|
372
372
|
if (Object.getOwnPropertySymbols) {
|
|
373
|
-
var
|
|
374
|
-
for (s = 0; s <
|
|
375
|
-
|
|
373
|
+
var c = Object.getOwnPropertySymbols(e);
|
|
374
|
+
for (s = 0; s < c.length; s++)
|
|
375
|
+
r = c[s], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
376
376
|
}
|
|
377
|
-
return
|
|
377
|
+
return t;
|
|
378
378
|
}
|
|
379
|
-
function Ie(e,
|
|
379
|
+
function Ie(e, n) {
|
|
380
380
|
if (e == null) return {};
|
|
381
|
-
var
|
|
382
|
-
for (var
|
|
383
|
-
if (Object.prototype.hasOwnProperty.call(e,
|
|
384
|
-
if (
|
|
385
|
-
|
|
381
|
+
var t = {};
|
|
382
|
+
for (var r in e)
|
|
383
|
+
if (Object.prototype.hasOwnProperty.call(e, r)) {
|
|
384
|
+
if (n.indexOf(r) >= 0) continue;
|
|
385
|
+
t[r] = e[r];
|
|
386
386
|
}
|
|
387
|
-
return
|
|
387
|
+
return t;
|
|
388
388
|
}
|
|
389
389
|
function G() {
|
|
390
390
|
return G = Object.assign ? Object.assign.bind() : function(e) {
|
|
391
|
-
for (var
|
|
392
|
-
var
|
|
393
|
-
for (var
|
|
394
|
-
Object.prototype.hasOwnProperty.call(
|
|
391
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
392
|
+
var t = arguments[n];
|
|
393
|
+
for (var r in t)
|
|
394
|
+
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
395
395
|
}
|
|
396
396
|
return e;
|
|
397
397
|
}, G.apply(this, arguments);
|
|
398
398
|
}
|
|
399
|
-
function ne(e,
|
|
400
|
-
var
|
|
399
|
+
function ne(e, n) {
|
|
400
|
+
var t = Object.keys(e);
|
|
401
401
|
if (Object.getOwnPropertySymbols) {
|
|
402
|
-
var
|
|
403
|
-
|
|
402
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
403
|
+
n && (r = r.filter(function(s) {
|
|
404
404
|
return Object.getOwnPropertyDescriptor(e, s).enumerable;
|
|
405
|
-
})),
|
|
405
|
+
})), t.push.apply(t, r);
|
|
406
406
|
}
|
|
407
|
-
return
|
|
407
|
+
return t;
|
|
408
408
|
}
|
|
409
409
|
function q(e) {
|
|
410
|
-
for (var
|
|
411
|
-
var
|
|
412
|
-
|
|
413
|
-
je(e,
|
|
414
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
415
|
-
Object.defineProperty(e,
|
|
410
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
411
|
+
var t = arguments[n] != null ? arguments[n] : {};
|
|
412
|
+
n % 2 ? ne(Object(t), !0).forEach(function(r) {
|
|
413
|
+
je(e, r, t[r]);
|
|
414
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ne(Object(t)).forEach(function(r) {
|
|
415
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
return e;
|
|
419
419
|
}
|
|
420
|
-
function je(e,
|
|
421
|
-
return
|
|
420
|
+
function je(e, n, t) {
|
|
421
|
+
return n = De(n), n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
|
|
422
422
|
}
|
|
423
|
-
function
|
|
424
|
-
var
|
|
425
|
-
return typeof
|
|
423
|
+
function De(e) {
|
|
424
|
+
var n = ze(e, "string");
|
|
425
|
+
return typeof n == "symbol" ? n : n + "";
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function ze(e, n) {
|
|
428
428
|
if (typeof e != "object" || !e) return e;
|
|
429
|
-
var
|
|
430
|
-
if (
|
|
431
|
-
var
|
|
432
|
-
if (typeof
|
|
429
|
+
var t = e[Symbol.toPrimitive];
|
|
430
|
+
if (t !== void 0) {
|
|
431
|
+
var r = t.call(e, n);
|
|
432
|
+
if (typeof r != "object") return r;
|
|
433
433
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
434
434
|
}
|
|
435
|
-
return (
|
|
435
|
+
return (n === "string" ? String : Number)(e);
|
|
436
436
|
}
|
|
437
437
|
function ce(e) {
|
|
438
|
-
return e && e.map((
|
|
439
|
-
key:
|
|
440
|
-
},
|
|
438
|
+
return e && e.map((n, t) => /* @__PURE__ */ A.createElement(n.tag, q({
|
|
439
|
+
key: t
|
|
440
|
+
}, n.attr), ce(n.child)));
|
|
441
441
|
}
|
|
442
442
|
function Q(e) {
|
|
443
|
-
return (
|
|
443
|
+
return (n) => /* @__PURE__ */ A.createElement(Ae, G({
|
|
444
444
|
attr: q({}, e.attr)
|
|
445
|
-
},
|
|
445
|
+
}, n), ce(e.child));
|
|
446
446
|
}
|
|
447
447
|
function Ae(e) {
|
|
448
|
-
var
|
|
448
|
+
var n = (t) => {
|
|
449
449
|
var {
|
|
450
|
-
attr:
|
|
450
|
+
attr: r,
|
|
451
451
|
size: s,
|
|
452
|
-
title:
|
|
453
|
-
} = e, p = Pe(e, Oe),
|
|
454
|
-
return
|
|
452
|
+
title: c
|
|
453
|
+
} = e, p = Pe(e, Oe), f = s || t.size || "1em", d;
|
|
454
|
+
return t.className && (d = t.className), e.className && (d = (d ? d + " " : "") + e.className), /* @__PURE__ */ A.createElement("svg", G({
|
|
455
455
|
stroke: "currentColor",
|
|
456
456
|
fill: "currentColor",
|
|
457
457
|
strokeWidth: "0"
|
|
458
|
-
},
|
|
459
|
-
className:
|
|
458
|
+
}, t.attr, r, p, {
|
|
459
|
+
className: d,
|
|
460
460
|
style: q(q({
|
|
461
|
-
color: e.color ||
|
|
462
|
-
},
|
|
463
|
-
height:
|
|
464
|
-
width:
|
|
461
|
+
color: e.color || t.color
|
|
462
|
+
}, t.style), e.style),
|
|
463
|
+
height: f,
|
|
464
|
+
width: f,
|
|
465
465
|
xmlns: "http://www.w3.org/2000/svg"
|
|
466
|
-
}),
|
|
466
|
+
}), c && /* @__PURE__ */ A.createElement("title", null, c), e.children);
|
|
467
467
|
};
|
|
468
|
-
return te !== void 0 ? /* @__PURE__ */ A.createElement(te.Consumer, null, (
|
|
468
|
+
return te !== void 0 ? /* @__PURE__ */ A.createElement(te.Consumer, null, (t) => n(t)) : n(ie);
|
|
469
469
|
}
|
|
470
470
|
function Me(e) {
|
|
471
471
|
return Q({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z" }, child: [] }] })(e);
|
|
@@ -475,11 +475,11 @@ const Te = {
|
|
|
475
475
|
sm: "w-4 h-4 text-xs",
|
|
476
476
|
md: "w-5 h-5 text-sm",
|
|
477
477
|
lg: "w-6 h-6 text-base"
|
|
478
|
-
},
|
|
478
|
+
}, Be = {
|
|
479
479
|
flat: "rounded-none",
|
|
480
480
|
rounded: "rounded-sm",
|
|
481
481
|
pill: "rounded-full"
|
|
482
|
-
},
|
|
482
|
+
}, Re = {
|
|
483
483
|
primary: "primary",
|
|
484
484
|
secondary: "secondary",
|
|
485
485
|
success: "success",
|
|
@@ -508,22 +508,22 @@ const Te = {
|
|
|
508
508
|
}, _e = A.forwardRef(
|
|
509
509
|
({
|
|
510
510
|
label: e,
|
|
511
|
-
boxSize:
|
|
512
|
-
shape:
|
|
513
|
-
variant:
|
|
511
|
+
boxSize: n = "md",
|
|
512
|
+
shape: t = "rounded",
|
|
513
|
+
variant: r = "success",
|
|
514
514
|
onSelectionChange: s,
|
|
515
|
-
disabled:
|
|
515
|
+
disabled: c = !1,
|
|
516
516
|
className: p = "",
|
|
517
|
-
id:
|
|
518
|
-
value:
|
|
517
|
+
id: f,
|
|
518
|
+
value: d,
|
|
519
519
|
icon: a,
|
|
520
520
|
children: o,
|
|
521
521
|
checked: l,
|
|
522
|
-
...
|
|
522
|
+
...u
|
|
523
523
|
}, g) => {
|
|
524
524
|
const b = (m) => {
|
|
525
|
-
!
|
|
526
|
-
}, x = "mr-2 border flex items-center justify-center transition-all", k = Te[
|
|
525
|
+
!c && s && s(m.target.checked), u.onChange && u.onChange(m);
|
|
526
|
+
}, x = "mr-2 border flex items-center justify-center transition-all", k = Te[n], $ = Be[t], N = Re[r] ?? "", w = r.startsWith("outline"), y = r.startsWith("soft"), P = `${x} ${k} ${$} ${N} ${l && (w || y || r === "link") ? "peer-checked:bg-current peer-checked:text-white" : l ? "peer-checked:bg-current" : ""}`, L = {
|
|
527
527
|
xs: "w-2 h-2",
|
|
528
528
|
sm: "w-2.5 h-2.5",
|
|
529
529
|
md: "w-3 h-3",
|
|
@@ -532,7 +532,7 @@ const Te = {
|
|
|
532
532
|
return /* @__PURE__ */ S(
|
|
533
533
|
"label",
|
|
534
534
|
{
|
|
535
|
-
className: `flex items-center ${
|
|
535
|
+
className: `flex items-center ${c ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} me-4 ${p}`,
|
|
536
536
|
children: [
|
|
537
537
|
/* @__PURE__ */ i(
|
|
538
538
|
"input",
|
|
@@ -541,14 +541,14 @@ const Te = {
|
|
|
541
541
|
className: "peer hidden",
|
|
542
542
|
checked: l,
|
|
543
543
|
onChange: b,
|
|
544
|
-
disabled:
|
|
545
|
-
id:
|
|
546
|
-
value:
|
|
544
|
+
disabled: c,
|
|
545
|
+
id: f,
|
|
546
|
+
value: d,
|
|
547
547
|
ref: g,
|
|
548
|
-
...
|
|
548
|
+
...u
|
|
549
549
|
}
|
|
550
550
|
),
|
|
551
|
-
/* @__PURE__ */ i("span", { className:
|
|
551
|
+
/* @__PURE__ */ i("span", { className: P.trim(), children: (l || u.defaultChecked) && (a ?? /* @__PURE__ */ i(Me, { className: `${L[n]}` })) }),
|
|
552
552
|
e || o ? /* @__PURE__ */ i("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-300", children: e ?? o }) : null
|
|
553
553
|
]
|
|
554
554
|
}
|
|
@@ -558,50 +558,50 @@ const Te = {
|
|
|
558
558
|
_e.displayName = "Checkbox";
|
|
559
559
|
const Ve = ({
|
|
560
560
|
label: e,
|
|
561
|
-
header:
|
|
562
|
-
items:
|
|
563
|
-
onSelect:
|
|
561
|
+
header: n,
|
|
562
|
+
items: t = [],
|
|
563
|
+
onSelect: r,
|
|
564
564
|
renderItem: s,
|
|
565
|
-
position:
|
|
565
|
+
position: c = "right",
|
|
566
566
|
className: p = "",
|
|
567
|
-
menuClassName:
|
|
568
|
-
width:
|
|
567
|
+
menuClassName: f = "",
|
|
568
|
+
width: d = "w-48",
|
|
569
569
|
closeOnSelect: a = !1,
|
|
570
570
|
transition: o = !0,
|
|
571
571
|
ariaLabel: l = "Dropdown menu",
|
|
572
|
-
...
|
|
572
|
+
...u
|
|
573
573
|
}) => {
|
|
574
|
-
const [g, b] =
|
|
574
|
+
const [g, b] = z(!1), [x, k] = z(!1), $ = F(null), N = F(null), w = j(() => ({
|
|
575
575
|
left: "left-0",
|
|
576
576
|
center: "left-1/2 transform -translate-x-1/2",
|
|
577
577
|
right: "right-0"
|
|
578
|
-
})[
|
|
578
|
+
})[c], [c]), y = D(() => {
|
|
579
579
|
const m = N.current, C = $.current;
|
|
580
580
|
if (!m || !C) return;
|
|
581
|
-
const { top: O, bottom: M } = m.getBoundingClientRect(),
|
|
582
|
-
k(T <
|
|
583
|
-
}, []),
|
|
581
|
+
const { top: O, bottom: M } = m.getBoundingClientRect(), R = C.offsetHeight, T = window.innerHeight - M, _ = O;
|
|
582
|
+
k(T < R && _ > R);
|
|
583
|
+
}, []), h = D((m) => {
|
|
584
584
|
var C, O;
|
|
585
585
|
!((C = $.current) != null && C.contains(m.target)) && !((O = N.current) != null && O.contains(m.target)) && b(!1);
|
|
586
|
-
}, []), v =
|
|
587
|
-
|
|
586
|
+
}, []), v = D(() => b((m) => !m), []), P = D(() => b(!1), []);
|
|
587
|
+
B(() => {
|
|
588
588
|
if (g)
|
|
589
|
-
return
|
|
590
|
-
window.removeEventListener("resize",
|
|
589
|
+
return y(), window.addEventListener("resize", y), window.addEventListener("scroll", y, !0), () => {
|
|
590
|
+
window.removeEventListener("resize", y), window.removeEventListener("scroll", y, !0);
|
|
591
591
|
};
|
|
592
|
-
}, [g,
|
|
593
|
-
const
|
|
592
|
+
}, [g, y]), B(() => (document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h)), [h]);
|
|
593
|
+
const L = j(
|
|
594
594
|
() => [
|
|
595
595
|
"absolute z-50 bg-white rounded shadow-lg overflow-hidden w-auto",
|
|
596
596
|
x ? "bottom-full mb-2" : "top-full mt-2",
|
|
597
597
|
w,
|
|
598
|
-
|
|
598
|
+
d,
|
|
599
599
|
o && "transition-all duration-200 ease-out",
|
|
600
|
-
|
|
600
|
+
f
|
|
601
601
|
].filter(Boolean).join(" "),
|
|
602
|
-
[x, w,
|
|
602
|
+
[x, w, d, o, f]
|
|
603
603
|
);
|
|
604
|
-
return /* @__PURE__ */ S("div", { className: `relative inline-block ${p}`, ...
|
|
604
|
+
return /* @__PURE__ */ S("div", { className: `relative inline-block ${p}`, ...u, children: [
|
|
605
605
|
/* @__PURE__ */ i(
|
|
606
606
|
"button",
|
|
607
607
|
{
|
|
@@ -614,11 +614,11 @@ const Ve = ({
|
|
|
614
614
|
children: e
|
|
615
615
|
}
|
|
616
616
|
),
|
|
617
|
-
g && /* @__PURE__ */ S("div", { ref: $, role: "menu", className:
|
|
618
|
-
|
|
619
|
-
|
|
617
|
+
g && /* @__PURE__ */ S("div", { ref: $, role: "menu", className: L, children: [
|
|
618
|
+
n && n,
|
|
619
|
+
t.map((m, C) => {
|
|
620
620
|
const O = () => {
|
|
621
|
-
|
|
621
|
+
r && r(m), a && P();
|
|
622
622
|
};
|
|
623
623
|
return /* @__PURE__ */ i("div", { children: s ? s(m, O) : /* @__PURE__ */ i(
|
|
624
624
|
"div",
|
|
@@ -634,26 +634,26 @@ const Ve = ({
|
|
|
634
634
|
] });
|
|
635
635
|
}, et = ({
|
|
636
636
|
children: e,
|
|
637
|
-
content:
|
|
638
|
-
position:
|
|
639
|
-
className:
|
|
637
|
+
content: n,
|
|
638
|
+
position: t = "top",
|
|
639
|
+
className: r = "",
|
|
640
640
|
tooltipClass: s = "",
|
|
641
|
-
tooltipStyle:
|
|
641
|
+
tooltipStyle: c = {}
|
|
642
642
|
}) => {
|
|
643
|
-
const p = F(null),
|
|
644
|
-
|
|
645
|
-
const a = p.current, o =
|
|
643
|
+
const p = F(null), f = F(null);
|
|
644
|
+
B(() => {
|
|
645
|
+
const a = p.current, o = f.current;
|
|
646
646
|
if (!a || !o) return;
|
|
647
647
|
const l = () => {
|
|
648
648
|
o.style.opacity = "1", o.style.visibility = "visible";
|
|
649
|
-
},
|
|
649
|
+
}, u = () => {
|
|
650
650
|
o.style.opacity = "0", o.style.visibility = "hidden";
|
|
651
651
|
};
|
|
652
|
-
return a.addEventListener("mouseenter", l), a.addEventListener("mouseleave",
|
|
653
|
-
a.removeEventListener("mouseenter", l), a.removeEventListener("mouseleave",
|
|
652
|
+
return a.addEventListener("mouseenter", l), a.addEventListener("mouseleave", u), () => {
|
|
653
|
+
a.removeEventListener("mouseenter", l), a.removeEventListener("mouseleave", u);
|
|
654
654
|
};
|
|
655
655
|
}, []);
|
|
656
|
-
const
|
|
656
|
+
const d = (a) => {
|
|
657
657
|
const o = {
|
|
658
658
|
position: "absolute",
|
|
659
659
|
opacity: 0,
|
|
@@ -708,19 +708,19 @@ const Ve = ({
|
|
|
708
708
|
return o;
|
|
709
709
|
}
|
|
710
710
|
};
|
|
711
|
-
return /* @__PURE__ */ S("div", { ref: p, className: `relative inline-block ${
|
|
711
|
+
return /* @__PURE__ */ S("div", { ref: p, className: `relative inline-block ${r}`, children: [
|
|
712
712
|
e,
|
|
713
713
|
/* @__PURE__ */ i(
|
|
714
714
|
"div",
|
|
715
715
|
{
|
|
716
|
-
ref:
|
|
716
|
+
ref: f,
|
|
717
717
|
role: "tooltip",
|
|
718
718
|
className: s,
|
|
719
719
|
style: {
|
|
720
|
-
...
|
|
721
|
-
...
|
|
720
|
+
...d(t),
|
|
721
|
+
...c
|
|
722
722
|
},
|
|
723
|
-
children:
|
|
723
|
+
children: n
|
|
724
724
|
}
|
|
725
725
|
)
|
|
726
726
|
] });
|
|
@@ -755,20 +755,20 @@ const Ve = ({
|
|
|
755
755
|
circle: "rounded-full p-2 w-8 h-8 justify-center"
|
|
756
756
|
}, tt = ({
|
|
757
757
|
label: e,
|
|
758
|
-
variant:
|
|
759
|
-
size:
|
|
760
|
-
shape:
|
|
758
|
+
variant: n = "primary",
|
|
759
|
+
size: t = "sm",
|
|
760
|
+
shape: r = "rounded",
|
|
761
761
|
icon: s,
|
|
762
|
-
dismissible:
|
|
762
|
+
dismissible: c,
|
|
763
763
|
onDismiss: p,
|
|
764
|
-
className:
|
|
765
|
-
...
|
|
764
|
+
className: f = "",
|
|
765
|
+
...d
|
|
766
766
|
}) => {
|
|
767
|
-
const a = !e && !!s, o = `inline-flex items-center font-medium ${Fe[
|
|
768
|
-
return /* @__PURE__ */ S("span", { className: o.trim(), ...
|
|
767
|
+
const a = !e && !!s, o = `inline-flex items-center font-medium ${Fe[n] || ""} ${Ke[t] || ""} ${Ze[r] || ""} ${a ? "justify-center p-2 w-8 h-8" : ""} ` + f;
|
|
768
|
+
return /* @__PURE__ */ S("span", { className: o.trim(), ...d, children: [
|
|
769
769
|
s && /* @__PURE__ */ i("span", { className: e ? "mr-1" : "", children: s }),
|
|
770
770
|
e,
|
|
771
|
-
|
|
771
|
+
c && /* @__PURE__ */ i(
|
|
772
772
|
"button",
|
|
773
773
|
{
|
|
774
774
|
type: "button",
|
|
@@ -801,46 +801,46 @@ const Ve = ({
|
|
|
801
801
|
};
|
|
802
802
|
function nt({
|
|
803
803
|
options: e,
|
|
804
|
-
selected:
|
|
805
|
-
onChange:
|
|
806
|
-
label:
|
|
804
|
+
selected: n,
|
|
805
|
+
onChange: t,
|
|
806
|
+
label: r,
|
|
807
807
|
disabled: s = !1,
|
|
808
|
-
shape:
|
|
808
|
+
shape: c = "rounded",
|
|
809
809
|
variant: p = "primary",
|
|
810
|
-
size:
|
|
811
|
-
className:
|
|
810
|
+
size: f = "md",
|
|
811
|
+
className: d = "",
|
|
812
812
|
classNames: a = {},
|
|
813
813
|
id: o,
|
|
814
814
|
name: l,
|
|
815
|
-
renderOption:
|
|
815
|
+
renderOption: u
|
|
816
816
|
}) {
|
|
817
|
-
const g = re[
|
|
818
|
-
|
|
817
|
+
const g = re[c] || re.rounded, b = se[f] || se.md, x = F(null), [k, $] = z({});
|
|
818
|
+
B(() => {
|
|
819
819
|
if (!x.current) return;
|
|
820
|
-
const w = e.findIndex((v) => v.value ===
|
|
820
|
+
const w = e.findIndex((v) => v.value === n);
|
|
821
821
|
if (w === -1) return;
|
|
822
|
-
const
|
|
823
|
-
if (
|
|
824
|
-
const { offsetLeft: v, offsetWidth:
|
|
822
|
+
const h = x.current.querySelectorAll("button")[w];
|
|
823
|
+
if (h) {
|
|
824
|
+
const { offsetLeft: v, offsetWidth: P, offsetHeight: L } = h;
|
|
825
825
|
$({
|
|
826
826
|
transform: `translateX(${v}px)`,
|
|
827
|
-
width:
|
|
828
|
-
height:
|
|
827
|
+
width: P,
|
|
828
|
+
height: L
|
|
829
829
|
});
|
|
830
830
|
}
|
|
831
|
-
}, [
|
|
831
|
+
}, [n, e, f]);
|
|
832
832
|
const N = `toggler-${p}`;
|
|
833
833
|
return /* @__PURE__ */ S(
|
|
834
834
|
"div",
|
|
835
835
|
{
|
|
836
|
-
className: `flex flex-col gap-2 w-fit ${
|
|
836
|
+
className: `flex flex-col gap-2 w-fit ${d} ${a.root ?? ""}`,
|
|
837
837
|
id: o,
|
|
838
838
|
children: [
|
|
839
|
-
|
|
839
|
+
r && /* @__PURE__ */ i(
|
|
840
840
|
"span",
|
|
841
841
|
{
|
|
842
842
|
className: `text-sm font-medium select-none ${a.label ?? ""}`,
|
|
843
|
-
children:
|
|
843
|
+
children: r
|
|
844
844
|
}
|
|
845
845
|
),
|
|
846
846
|
/* @__PURE__ */ S(
|
|
@@ -863,27 +863,27 @@ function nt({
|
|
|
863
863
|
}
|
|
864
864
|
),
|
|
865
865
|
e.map((w) => {
|
|
866
|
-
const
|
|
866
|
+
const y = n === w.value, h = s || w.disabled;
|
|
867
867
|
return /* @__PURE__ */ i(
|
|
868
868
|
"button",
|
|
869
869
|
{
|
|
870
870
|
role: "radio",
|
|
871
871
|
name: l,
|
|
872
|
-
"aria-checked":
|
|
873
|
-
disabled:
|
|
874
|
-
onClick: () => !
|
|
872
|
+
"aria-checked": y,
|
|
873
|
+
disabled: h,
|
|
874
|
+
onClick: () => !h && t(w.value),
|
|
875
875
|
onKeyDown: (v) => {
|
|
876
|
-
(v.key === "Enter" || v.key === " ") && !
|
|
876
|
+
(v.key === "Enter" || v.key === " ") && !h && (v.preventDefault(), t(w.value));
|
|
877
877
|
},
|
|
878
878
|
className: `
|
|
879
879
|
relative z-10
|
|
880
880
|
transition-colors duration-200 focus:outline-none
|
|
881
881
|
${b.button}
|
|
882
|
-
${
|
|
882
|
+
${y ? `text-white toggler-text-${p}` : "text-gray-700 hover:bg-gray-200"}
|
|
883
883
|
${a.option ?? ""}
|
|
884
|
-
${
|
|
884
|
+
${y ? a.selectedOption ?? "" : ""}
|
|
885
885
|
`,
|
|
886
|
-
children:
|
|
886
|
+
children: u ? u(w, y) : w.label
|
|
887
887
|
},
|
|
888
888
|
String(w.value)
|
|
889
889
|
);
|
|
@@ -900,35 +900,35 @@ function He(e) {
|
|
|
900
900
|
}
|
|
901
901
|
const rt = ({
|
|
902
902
|
items: e,
|
|
903
|
-
allowMultipleOpen:
|
|
904
|
-
className:
|
|
905
|
-
tileClasses:
|
|
903
|
+
allowMultipleOpen: n = !1,
|
|
904
|
+
className: t = "",
|
|
905
|
+
tileClasses: r = "",
|
|
906
906
|
open: s,
|
|
907
|
-
onChange:
|
|
907
|
+
onChange: c,
|
|
908
908
|
renderTitle: p,
|
|
909
|
-
renderContent:
|
|
910
|
-
showArrowIcon:
|
|
909
|
+
renderContent: f,
|
|
910
|
+
showArrowIcon: d = !0,
|
|
911
911
|
panelClasses: a = ""
|
|
912
912
|
}) => {
|
|
913
|
-
const [o, l] =
|
|
913
|
+
const [o, l] = z(/* @__PURE__ */ new Set()), u = j(() => s ? new Set(s) : o, [s, o]), g = D(
|
|
914
914
|
(b) => {
|
|
915
|
-
const x = new Set(
|
|
916
|
-
x.has(b) ? x.delete(b) : (
|
|
915
|
+
const x = new Set(u);
|
|
916
|
+
x.has(b) ? x.delete(b) : (n || x.clear(), x.add(b)), s && c ? c(Array.from(x)) : l(x);
|
|
917
917
|
},
|
|
918
|
-
[
|
|
918
|
+
[u, s, c, n]
|
|
919
919
|
);
|
|
920
920
|
return /* @__PURE__ */ i(
|
|
921
921
|
"div",
|
|
922
922
|
{
|
|
923
923
|
className: "accordion",
|
|
924
924
|
role: "region",
|
|
925
|
-
"aria-multiselectable":
|
|
925
|
+
"aria-multiselectable": n,
|
|
926
926
|
children: e.map((b) => {
|
|
927
|
-
const x =
|
|
927
|
+
const x = u.has(b.id), k = `accordion-heading-${b.id}`, $ = `accordion-panel-${b.id}`;
|
|
928
928
|
return /* @__PURE__ */ S(
|
|
929
929
|
"div",
|
|
930
930
|
{
|
|
931
|
-
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${
|
|
931
|
+
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,
|
|
932
932
|
children: [
|
|
933
933
|
/* @__PURE__ */ S(
|
|
934
934
|
"button",
|
|
@@ -938,10 +938,10 @@ const rt = ({
|
|
|
938
938
|
"aria-expanded": x,
|
|
939
939
|
"aria-controls": $,
|
|
940
940
|
onClick: () => g(b.id),
|
|
941
|
-
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 ${
|
|
941
|
+
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}`,
|
|
942
942
|
children: [
|
|
943
943
|
p ? p(b, x) : b.title,
|
|
944
|
-
|
|
944
|
+
d ? /* @__PURE__ */ i(He, {}) : null
|
|
945
945
|
]
|
|
946
946
|
}
|
|
947
947
|
),
|
|
@@ -953,7 +953,7 @@ const rt = ({
|
|
|
953
953
|
"aria-labelledby": k,
|
|
954
954
|
hidden: !x,
|
|
955
955
|
className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${a}`,
|
|
956
|
-
children:
|
|
956
|
+
children: f ? f(b, x) : b.content
|
|
957
957
|
}
|
|
958
958
|
)
|
|
959
959
|
]
|
|
@@ -973,22 +973,22 @@ const rt = ({
|
|
|
973
973
|
}, fe = ae(null), pe = () => le(fe);
|
|
974
974
|
function st({
|
|
975
975
|
id: e,
|
|
976
|
-
title:
|
|
977
|
-
children:
|
|
978
|
-
standalone:
|
|
976
|
+
title: n,
|
|
977
|
+
children: t,
|
|
978
|
+
standalone: r = !1,
|
|
979
979
|
showFloatingClose: s = !1,
|
|
980
|
-
containerClasses:
|
|
980
|
+
containerClasses: c = "",
|
|
981
981
|
headerClasses: p = "",
|
|
982
|
-
bodyClasses:
|
|
983
|
-
onClose:
|
|
982
|
+
bodyClasses: f = "",
|
|
983
|
+
onClose: d,
|
|
984
984
|
disableEscapeClose: a = !1,
|
|
985
985
|
closeBtnStyle: o
|
|
986
986
|
}) {
|
|
987
|
-
const l = pe(),
|
|
988
|
-
g ?
|
|
989
|
-
}, [g,
|
|
990
|
-
return
|
|
991
|
-
const w = document.activeElement,
|
|
987
|
+
const l = pe(), u = ue(), g = !r && !!l && !!u, [b, x] = z(!1), k = g ? l.isOpen(e) : b, $ = g ? l.getModalData(e) : null, N = D(() => {
|
|
988
|
+
g ? u.closeModal(e) : x(!1), d == null || d();
|
|
989
|
+
}, [g, u, e, d]);
|
|
990
|
+
return B(() => {
|
|
991
|
+
const w = document.activeElement, y = document.getElementById(e), h = [
|
|
992
992
|
"a[href]",
|
|
993
993
|
"button:not([disabled])",
|
|
994
994
|
"textarea:not([disabled])",
|
|
@@ -996,26 +996,26 @@ function st({
|
|
|
996
996
|
"select:not([disabled])",
|
|
997
997
|
'[tabindex]:not([tabindex="-1"])'
|
|
998
998
|
], v = () => {
|
|
999
|
-
if (!
|
|
1000
|
-
const m =
|
|
1001
|
-
|
|
999
|
+
if (!y) return [];
|
|
1000
|
+
const m = y.querySelectorAll(
|
|
1001
|
+
h.join(",")
|
|
1002
1002
|
);
|
|
1003
1003
|
return Array.from(m).filter((C) => C.offsetParent !== null);
|
|
1004
|
-
},
|
|
1004
|
+
}, P = (m) => {
|
|
1005
1005
|
if (m.key === "Tab") {
|
|
1006
1006
|
const C = v();
|
|
1007
1007
|
if (C.length === 0) return;
|
|
1008
1008
|
const O = C[0], M = C[C.length - 1];
|
|
1009
1009
|
m.shiftKey ? document.activeElement === O && (m.preventDefault(), M.focus()) : document.activeElement === M && (m.preventDefault(), O.focus());
|
|
1010
1010
|
}
|
|
1011
|
-
},
|
|
1012
|
-
m.key === "Escape" && !a && N(),
|
|
1011
|
+
}, L = (m) => {
|
|
1012
|
+
m.key === "Escape" && !a && N(), P(m);
|
|
1013
1013
|
};
|
|
1014
1014
|
return k && (document.body.style.overflow = "hidden", setTimeout(() => {
|
|
1015
1015
|
const m = v();
|
|
1016
1016
|
m.length && m[0].focus();
|
|
1017
|
-
}, 0), window.addEventListener("keydown",
|
|
1018
|
-
document.body.style.overflow = "", w && w.focus(), window.removeEventListener("keydown",
|
|
1017
|
+
}, 0), window.addEventListener("keydown", L)), () => {
|
|
1018
|
+
document.body.style.overflow = "", w && w.focus(), window.removeEventListener("keydown", L);
|
|
1019
1019
|
};
|
|
1020
1020
|
}, [k, a, N, e]), k ? /* @__PURE__ */ i(
|
|
1021
1021
|
"div",
|
|
@@ -1025,14 +1025,14 @@ function st({
|
|
|
1025
1025
|
children: /* @__PURE__ */ S(
|
|
1026
1026
|
"div",
|
|
1027
1027
|
{
|
|
1028
|
-
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${
|
|
1028
|
+
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${c}`,
|
|
1029
1029
|
children: [
|
|
1030
1030
|
/* @__PURE__ */ S(
|
|
1031
1031
|
"div",
|
|
1032
1032
|
{
|
|
1033
1033
|
className: `flex justify-between items-center relative ${p}`,
|
|
1034
1034
|
children: [
|
|
1035
|
-
|
|
1035
|
+
n && /* @__PURE__ */ i("h2", { className: "text-lg font-semibold", children: n }),
|
|
1036
1036
|
s && /* @__PURE__ */ i(
|
|
1037
1037
|
"button",
|
|
1038
1038
|
{
|
|
@@ -1045,7 +1045,7 @@ function st({
|
|
|
1045
1045
|
]
|
|
1046
1046
|
}
|
|
1047
1047
|
),
|
|
1048
|
-
/* @__PURE__ */ i("div", { className:
|
|
1048
|
+
/* @__PURE__ */ i("div", { className: f, children: typeof t == "function" ? t({ modalData: $ }) : t })
|
|
1049
1049
|
]
|
|
1050
1050
|
}
|
|
1051
1051
|
)
|
|
@@ -1055,31 +1055,31 @@ function st({
|
|
|
1055
1055
|
function ot({
|
|
1056
1056
|
children: e
|
|
1057
1057
|
}) {
|
|
1058
|
-
const [
|
|
1059
|
-
|
|
1060
|
-
}, []), p =
|
|
1061
|
-
|
|
1062
|
-
const g = { ...
|
|
1058
|
+
const [n, t] = z({}), [r, s] = z({}), c = D((l, u) => {
|
|
1059
|
+
t((g) => ({ ...g, [l]: !0 })), u && s((g) => ({ ...g, [l]: u }));
|
|
1060
|
+
}, []), p = D((l) => {
|
|
1061
|
+
t((u) => ({ ...u, [l]: !1 })), s((u) => {
|
|
1062
|
+
const g = { ...u };
|
|
1063
1063
|
return delete g[l], g;
|
|
1064
1064
|
});
|
|
1065
|
-
}, []),
|
|
1066
|
-
(l) =>
|
|
1067
|
-
[
|
|
1065
|
+
}, []), f = D((l) => !!n[l], [n]), d = D(
|
|
1066
|
+
(l) => r[l],
|
|
1067
|
+
[r]
|
|
1068
1068
|
), a = j(
|
|
1069
|
-
() => ({ openModal:
|
|
1070
|
-
[
|
|
1069
|
+
() => ({ openModal: c, closeModal: p }),
|
|
1070
|
+
[c, p]
|
|
1071
1071
|
), o = j(
|
|
1072
|
-
() => ({ isOpen:
|
|
1073
|
-
[
|
|
1072
|
+
() => ({ isOpen: f, getModalData: d }),
|
|
1073
|
+
[f, d]
|
|
1074
1074
|
);
|
|
1075
1075
|
return /* @__PURE__ */ i(de.Provider, { value: a, children: /* @__PURE__ */ i(fe.Provider, { value: o, children: e }) });
|
|
1076
1076
|
}
|
|
1077
1077
|
function at(e) {
|
|
1078
|
-
const { openModal:
|
|
1078
|
+
const { openModal: n, closeModal: t } = ue(), { isOpen: r, getModalData: s } = pe();
|
|
1079
1079
|
return {
|
|
1080
|
-
open: (
|
|
1081
|
-
close: () =>
|
|
1082
|
-
isOpen:
|
|
1080
|
+
open: (c) => n(e, c),
|
|
1081
|
+
close: () => t(e),
|
|
1082
|
+
isOpen: r(e),
|
|
1083
1083
|
data: s(e)
|
|
1084
1084
|
};
|
|
1085
1085
|
}
|
|
@@ -1093,54 +1093,71 @@ function lt(e) {
|
|
|
1093
1093
|
function Ge() {
|
|
1094
1094
|
return J;
|
|
1095
1095
|
}
|
|
1096
|
-
function it(e,
|
|
1097
|
-
Y ? Y(e,
|
|
1096
|
+
function it(e, n, t = 3e3, r) {
|
|
1097
|
+
Y ? Y(e, n, t, r) : console.warn("Toast system is not mounted");
|
|
1098
1098
|
}
|
|
1099
1099
|
function qe(e) {
|
|
1100
1100
|
return Q({ 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);
|
|
1101
1101
|
}
|
|
1102
1102
|
const Ue = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
1103
|
-
const
|
|
1104
|
-
return (e === "x" ?
|
|
1105
|
-
}), ct = () => {
|
|
1106
|
-
const [
|
|
1107
|
-
|
|
1108
|
-
We((
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
},
|
|
1103
|
+
const n = Math.random() * 16 | 0;
|
|
1104
|
+
return (e === "x" ? n : n & 3 | 8).toString(16);
|
|
1105
|
+
}), ct = ({ containerStyle: e = "" }) => {
|
|
1106
|
+
const [n, t] = z([]);
|
|
1107
|
+
B(() => {
|
|
1108
|
+
We((s, c, p, f) => {
|
|
1109
|
+
const d = Ue();
|
|
1110
|
+
t((a) => [...a, { id: d, type: s, message: c, config: f }]), setTimeout(() => {
|
|
1111
|
+
t((a) => a.filter((o) => o.id !== d));
|
|
1112
|
+
}, p);
|
|
1113
1113
|
});
|
|
1114
1114
|
}, []);
|
|
1115
|
-
const
|
|
1116
|
-
return /* @__PURE__ */ i(
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1115
|
+
const r = Ge();
|
|
1116
|
+
return /* @__PURE__ */ i(
|
|
1117
|
+
"div",
|
|
1118
|
+
{
|
|
1119
|
+
className: `fixed top-5 right-5 z-9999 flex flex-col gap-2 ${e}`,
|
|
1120
|
+
children: n.map((s) => {
|
|
1121
|
+
var a, o, l, u, g, b, x, k, $, N, w, y, h, v;
|
|
1122
|
+
const c = ((a = s.config) == null ? void 0 : a.icon) || ((o = r.icons) == null ? void 0 : o[s.type]) || Xe(s.type), p = ((l = s.config) == null ? void 0 : l.bgColor) || ((g = (u = r.colors) == null ? void 0 : u[s.type]) == null ? void 0 : g.bg) || "bg-white dark:bg-gray-800", f = ((b = s.config) == null ? void 0 : b.textColor) || ((k = (x = r.colors) == null ? void 0 : x[s.type]) == null ? void 0 : k.text) || "text-gray-700 dark:text-gray-300", d = (($ = s.config) == null ? void 0 : $.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
|
|
1123
|
+
return /* @__PURE__ */ S(
|
|
1124
|
+
"div",
|
|
1125
|
+
{
|
|
1126
|
+
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${p} ${f} ${(N = s.config) == null ? void 0 : N.containerBody}`,
|
|
1127
|
+
children: [
|
|
1128
|
+
c && /* @__PURE__ */ i("div", { className: d, children: c }),
|
|
1129
|
+
/* @__PURE__ */ S("div", { className: "flex-1 me-3", children: [
|
|
1130
|
+
((w = s.config) == null ? void 0 : w.title) && /* @__PURE__ */ i(
|
|
1131
|
+
"div",
|
|
1132
|
+
{
|
|
1133
|
+
className: `font-semibold text-black ${(y = s.config) == null ? void 0 : y.titleClass}`,
|
|
1134
|
+
children: s.config.title
|
|
1135
|
+
}
|
|
1136
|
+
),
|
|
1137
|
+
((h = s.config) == null ? void 0 : h.description) && /* @__PURE__ */ i(
|
|
1138
|
+
"div",
|
|
1139
|
+
{
|
|
1140
|
+
className: `text-sm text-gray-500 ${(v = s.config) == null ? void 0 : v.subTitleClass}`,
|
|
1141
|
+
children: s.config.description
|
|
1142
|
+
}
|
|
1143
|
+
)
|
|
1144
|
+
] }),
|
|
1145
|
+
/* @__PURE__ */ i(
|
|
1146
|
+
"button",
|
|
1147
|
+
{
|
|
1148
|
+
onClick: () => t((P) => P.filter((L) => L.id !== s.id)),
|
|
1149
|
+
className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
|
|
1150
|
+
"aria-label": "Close",
|
|
1151
|
+
children: /* @__PURE__ */ i(qe, { size: 18 })
|
|
1152
|
+
}
|
|
1153
|
+
)
|
|
1154
|
+
]
|
|
1155
|
+
},
|
|
1156
|
+
s.id
|
|
1157
|
+
);
|
|
1158
|
+
})
|
|
1159
|
+
}
|
|
1160
|
+
);
|
|
1144
1161
|
};
|
|
1145
1162
|
function Xe(e) {
|
|
1146
1163
|
switch (e) {
|