tailwind-ux-kit 1.0.81 → 1.0.82
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import D, { forwardRef as re, useState as A, useMemo as
|
|
2
|
+
import { jsxs as k, jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import D, { forwardRef as re, useState as A, useMemo as j, useId as pe, useRef as W, useCallback as I, useEffect as B, createContext as se, useContext as oe } 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",
|
|
@@ -37,127 +37,127 @@ const V = {
|
|
|
37
37
|
const {
|
|
38
38
|
label: n,
|
|
39
39
|
id: t,
|
|
40
|
-
inputSize:
|
|
41
|
-
shape:
|
|
42
|
-
validate:
|
|
40
|
+
inputSize: s = "md",
|
|
41
|
+
shape: d = "rounded",
|
|
42
|
+
validate: p,
|
|
43
43
|
onValidatedChange: u,
|
|
44
|
-
className:
|
|
45
|
-
icon:
|
|
46
|
-
iconPosition:
|
|
44
|
+
className: l = "",
|
|
45
|
+
icon: c,
|
|
46
|
+
iconPosition: o = "left",
|
|
47
47
|
floatingLabelStyle: a,
|
|
48
|
-
onChange:
|
|
49
|
-
isValid:
|
|
50
|
-
isInvalid:
|
|
51
|
-
feedback:
|
|
52
|
-
iconClasses:
|
|
48
|
+
onChange: f,
|
|
49
|
+
isValid: m,
|
|
50
|
+
isInvalid: b,
|
|
51
|
+
feedback: x,
|
|
52
|
+
iconClasses: C,
|
|
53
53
|
feedbackType: v = "invalid",
|
|
54
|
-
labelClasses:
|
|
55
|
-
inputType:
|
|
56
|
-
inputPattern:
|
|
57
|
-
...
|
|
58
|
-
} = e, [
|
|
54
|
+
labelClasses: $ = "",
|
|
55
|
+
inputType: N = "",
|
|
56
|
+
inputPattern: y,
|
|
57
|
+
...w
|
|
58
|
+
} = e, [E, z] = A("default"), O = D.useCallback(
|
|
59
59
|
(P) => {
|
|
60
|
-
const
|
|
61
|
-
|
|
60
|
+
const S = P.target.value, K = (p == null ? void 0 : p(S)) ?? "default";
|
|
61
|
+
z(K), u == null || u(P, K), f == null || f(P);
|
|
62
62
|
},
|
|
63
|
-
[
|
|
64
|
-
),
|
|
65
|
-
() => me(
|
|
66
|
-
[
|
|
67
|
-
),
|
|
63
|
+
[p, u, f]
|
|
64
|
+
), g = j(() => t || (typeof n == "string" ? `input-${n.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [t, n]), h = !!a, L = V[s] || V.md, M = ee[d] || ee.flat, R = j(
|
|
65
|
+
() => me(E, m, b),
|
|
66
|
+
[E, m, b]
|
|
67
|
+
), T = j(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), _ = j(() => c ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [c, o]), F = (P) => {
|
|
68
68
|
var Z;
|
|
69
|
-
const
|
|
70
|
-
!(P.ctrlKey || P.metaKey ||
|
|
69
|
+
const S = P.key;
|
|
70
|
+
!(P.ctrlKey || P.metaKey || S.length !== 1) && (() => {
|
|
71
71
|
const H = /^\d$/, X = /^[a-zA-Z]$/;
|
|
72
|
-
switch (
|
|
72
|
+
switch (N) {
|
|
73
73
|
case "numeric":
|
|
74
74
|
case "number":
|
|
75
75
|
case "integer":
|
|
76
|
-
return !H.test(
|
|
76
|
+
return !H.test(S);
|
|
77
77
|
case "decimal":
|
|
78
|
-
return !H.test(
|
|
78
|
+
return !H.test(S) && S !== "." && S !== "Backspace" && S !== "Tab";
|
|
79
79
|
case "alphabetic":
|
|
80
|
-
return !X.test(
|
|
80
|
+
return !X.test(S);
|
|
81
81
|
case "custom":
|
|
82
|
-
return
|
|
82
|
+
return y ? !y.test(S) : !1;
|
|
83
83
|
default:
|
|
84
84
|
return !1;
|
|
85
85
|
}
|
|
86
|
-
})() && P.preventDefault(), (Z =
|
|
86
|
+
})() && P.preventDefault(), (Z = w.onKeyDown) == null || Z.call(w, P);
|
|
87
87
|
}, fe = (P) => {
|
|
88
88
|
var q;
|
|
89
|
-
const
|
|
89
|
+
const S = P.clipboardData.getData("Text");
|
|
90
90
|
(() => {
|
|
91
91
|
const Z = /^\d+$/, H = /^\d*\.?\d*$/, X = /^[a-zA-Z]+$/;
|
|
92
|
-
switch (
|
|
92
|
+
switch (N) {
|
|
93
93
|
case "numeric":
|
|
94
94
|
case "number":
|
|
95
95
|
case "integer":
|
|
96
|
-
return !Z.test(
|
|
96
|
+
return !Z.test(S);
|
|
97
97
|
case "decimal":
|
|
98
|
-
return !H.test(
|
|
98
|
+
return !H.test(S);
|
|
99
99
|
case "alphabetic":
|
|
100
|
-
return !X.test(
|
|
100
|
+
return !X.test(S);
|
|
101
101
|
case "custom":
|
|
102
|
-
return
|
|
102
|
+
return y ? !y.test(S) : !1;
|
|
103
103
|
default:
|
|
104
104
|
return !1;
|
|
105
105
|
}
|
|
106
|
-
})() && P.preventDefault(), (q =
|
|
106
|
+
})() && P.preventDefault(), (q = w.onPaste) == null || q.call(w, P);
|
|
107
107
|
};
|
|
108
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ k(
|
|
109
109
|
"div",
|
|
110
110
|
{
|
|
111
|
-
className: `w-full relative ${
|
|
111
|
+
className: `w-full relative ${h ? "z-0" : ""} tailwind-ux-input`,
|
|
112
112
|
children: [
|
|
113
|
-
!
|
|
113
|
+
!h && n && /* @__PURE__ */ i(
|
|
114
114
|
"label",
|
|
115
115
|
{
|
|
116
|
-
htmlFor:
|
|
117
|
-
className: `block mb-1 text-sm ${
|
|
116
|
+
htmlFor: g,
|
|
117
|
+
className: `block mb-1 text-sm ${m ? "text-green-700 dark:text-green-500" : b ? "text-red-700 dark:text-red-500" : "text-gray-700"} ${$}`,
|
|
118
118
|
children: n
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
|
|
121
|
+
/* @__PURE__ */ k("div", { className: "relative w-full", children: [
|
|
122
|
+
c && /* @__PURE__ */ i(
|
|
123
123
|
"div",
|
|
124
124
|
{
|
|
125
|
-
className: `absolute inset-y-0 flex items-center ${
|
|
125
|
+
className: `absolute inset-y-0 flex items-center ${T} ${C}`,
|
|
126
126
|
"aria-hidden": "true",
|
|
127
|
-
children:
|
|
127
|
+
children: c
|
|
128
128
|
}
|
|
129
129
|
),
|
|
130
130
|
/* @__PURE__ */ i(
|
|
131
131
|
"input",
|
|
132
132
|
{
|
|
133
|
-
...
|
|
134
|
-
id:
|
|
133
|
+
...w,
|
|
134
|
+
id: g,
|
|
135
135
|
ref: r,
|
|
136
|
-
placeholder:
|
|
137
|
-
onChange:
|
|
136
|
+
placeholder: h ? " " : w.placeholder,
|
|
137
|
+
onChange: O,
|
|
138
138
|
onKeyDown: F,
|
|
139
139
|
onPaste: fe,
|
|
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
|
-
${
|
|
142
|
-
${
|
|
143
|
-
${
|
|
141
|
+
${L}
|
|
142
|
+
${h && a && ge[a]}
|
|
143
|
+
${_} ${M} ${R} ${l}`
|
|
144
144
|
}
|
|
145
145
|
),
|
|
146
|
-
|
|
146
|
+
h && n && a && /* @__PURE__ */ i(
|
|
147
147
|
"label",
|
|
148
148
|
{
|
|
149
|
-
htmlFor:
|
|
150
|
-
className: `ms-1 ${be[a]} ${
|
|
149
|
+
htmlFor: g,
|
|
150
|
+
className: `ms-1 ${be[a]} ${l}`,
|
|
151
151
|
children: n
|
|
152
152
|
}
|
|
153
153
|
)
|
|
154
154
|
] }),
|
|
155
|
-
|
|
155
|
+
x && /* @__PURE__ */ i(
|
|
156
156
|
"p",
|
|
157
157
|
{
|
|
158
158
|
className: `mt-1 text-xs ${v === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
|
|
159
159
|
role: v === "invalid" ? "alert" : void 0,
|
|
160
|
-
children:
|
|
160
|
+
children: x
|
|
161
161
|
}
|
|
162
162
|
)
|
|
163
163
|
]
|
|
@@ -202,70 +202,70 @@ const he = {
|
|
|
202
202
|
const {
|
|
203
203
|
label: n,
|
|
204
204
|
id: t,
|
|
205
|
-
inputSize:
|
|
206
|
-
shape:
|
|
207
|
-
validate:
|
|
205
|
+
inputSize: s = "md",
|
|
206
|
+
shape: d = "rounded",
|
|
207
|
+
validate: p,
|
|
208
208
|
onValidatedChange: u,
|
|
209
|
-
className:
|
|
210
|
-
icon:
|
|
211
|
-
iconPosition:
|
|
209
|
+
className: l = "",
|
|
210
|
+
icon: c,
|
|
211
|
+
iconPosition: o = "left",
|
|
212
212
|
floatingLabelStyle: a,
|
|
213
|
-
onChange:
|
|
214
|
-
isValid:
|
|
215
|
-
isInvalid:
|
|
216
|
-
feedback:
|
|
217
|
-
feedbackType:
|
|
213
|
+
onChange: f,
|
|
214
|
+
isValid: m,
|
|
215
|
+
isInvalid: b,
|
|
216
|
+
feedback: x,
|
|
217
|
+
feedbackType: C = "invalid",
|
|
218
218
|
children: v,
|
|
219
|
-
|
|
220
|
-
} = e, [
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
return /* @__PURE__ */
|
|
225
|
-
|
|
219
|
+
...$
|
|
220
|
+
} = e, [N, y] = A("default"), w = pe(), E = j(() => t || (typeof n == "string" ? `select-${n.toLowerCase().replace(/\s+/g, "-")}` : w), [t, n, w]), z = (T) => {
|
|
221
|
+
const _ = T.target.value, F = (p == null ? void 0 : p(_)) ?? "default";
|
|
222
|
+
y(F), u == null || u(T, F), f == null || f(T);
|
|
223
|
+
}, O = !!a, g = he[s], h = ye[d], L = Ce(N, m, b);
|
|
224
|
+
return /* @__PURE__ */ k("div", { className: `w-full relative ${O ? "z-0" : ""}`, children: [
|
|
225
|
+
!O && n && /* @__PURE__ */ i(
|
|
226
226
|
"label",
|
|
227
227
|
{
|
|
228
|
-
htmlFor:
|
|
229
|
-
className: `block mb-1 text-sm ${
|
|
228
|
+
htmlFor: E,
|
|
229
|
+
className: `block mb-1 text-sm ${m ? "text-green-700" : b ? "text-red-700" : "text-gray-700"}`,
|
|
230
230
|
children: n
|
|
231
231
|
}
|
|
232
232
|
),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
|
|
233
|
+
/* @__PURE__ */ k("div", { className: "relative w-full", children: [
|
|
234
|
+
c && /* @__PURE__ */ i(
|
|
235
235
|
"div",
|
|
236
236
|
{
|
|
237
|
-
className: `absolute inset-y-0 flex items-center ${
|
|
238
|
-
children: /* @__PURE__ */ i("span", { className: "text-gray-500", children:
|
|
237
|
+
className: `absolute inset-y-0 flex items-center ${o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5"}`,
|
|
238
|
+
children: /* @__PURE__ */ i("span", { className: "text-gray-500", children: c })
|
|
239
239
|
}
|
|
240
240
|
),
|
|
241
241
|
/* @__PURE__ */ i(
|
|
242
242
|
"select",
|
|
243
243
|
{
|
|
244
|
-
|
|
245
|
-
id:
|
|
244
|
+
...$,
|
|
245
|
+
id: E,
|
|
246
246
|
ref: r,
|
|
247
|
-
onChange:
|
|
247
|
+
onChange: z,
|
|
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
|
-
${
|
|
250
|
-
${
|
|
251
|
-
${
|
|
249
|
+
${g} ${c && (o === "start" || o === "left") ? "ps-10" : c ? "pe-10" : ""}
|
|
250
|
+
${O && a && we[a]}
|
|
251
|
+
${h} ${L} ${l}`,
|
|
252
252
|
children: v
|
|
253
253
|
}
|
|
254
254
|
),
|
|
255
|
-
|
|
255
|
+
O && n && a && /* @__PURE__ */ i(
|
|
256
256
|
"label",
|
|
257
257
|
{
|
|
258
|
-
htmlFor:
|
|
259
|
-
className: `ms-1 ${ve[a]} ${
|
|
258
|
+
htmlFor: E,
|
|
259
|
+
className: `ms-1 ${ve[a]} ${l}`,
|
|
260
260
|
children: n
|
|
261
261
|
}
|
|
262
262
|
)
|
|
263
263
|
] }),
|
|
264
|
-
|
|
264
|
+
x && /* @__PURE__ */ i(
|
|
265
265
|
"p",
|
|
266
266
|
{
|
|
267
|
-
className: `mt-1 text-xs ${
|
|
268
|
-
children:
|
|
267
|
+
className: `mt-1 text-xs ${C === "invalid" ? "text-red-600" : "text-green-600"}`,
|
|
268
|
+
children: x
|
|
269
269
|
}
|
|
270
270
|
)
|
|
271
271
|
] });
|
|
@@ -313,23 +313,23 @@ const $e = {
|
|
|
313
313
|
variant: r = "primary",
|
|
314
314
|
size: n = "md",
|
|
315
315
|
type: t = "button",
|
|
316
|
-
shape:
|
|
317
|
-
className:
|
|
318
|
-
isLoading:
|
|
316
|
+
shape: s = "rounded",
|
|
317
|
+
className: d = "",
|
|
318
|
+
isLoading: p = !1,
|
|
319
319
|
disabled: u = !1,
|
|
320
|
-
...
|
|
320
|
+
...l
|
|
321
321
|
}) => {
|
|
322
|
-
const
|
|
322
|
+
const c = u || p, o = [
|
|
323
323
|
"inline-flex items-center justify-center font-normal transition duration-150",
|
|
324
324
|
$e[r],
|
|
325
325
|
Ne[n],
|
|
326
|
-
Se[
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
326
|
+
Se[s],
|
|
327
|
+
s === "flat" ? "shadow-none" : "shadow-sm",
|
|
328
|
+
c ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
329
|
+
d
|
|
330
330
|
].filter(Boolean).join(" ");
|
|
331
|
-
return /* @__PURE__ */
|
|
332
|
-
|
|
331
|
+
return /* @__PURE__ */ k("button", { type: t, className: o, disabled: c, ...l, children: [
|
|
332
|
+
p && /* @__PURE__ */ k(
|
|
333
333
|
"svg",
|
|
334
334
|
{
|
|
335
335
|
"aria-hidden": "true",
|
|
@@ -368,11 +368,11 @@ var ae = {
|
|
|
368
368
|
}, te = D.createContext && /* @__PURE__ */ D.createContext(ae), Ee = ["attr", "size", "title"];
|
|
369
369
|
function Le(e, r) {
|
|
370
370
|
if (e == null) return {};
|
|
371
|
-
var n = Oe(e, r), t,
|
|
371
|
+
var n = Oe(e, r), t, s;
|
|
372
372
|
if (Object.getOwnPropertySymbols) {
|
|
373
|
-
var
|
|
374
|
-
for (
|
|
375
|
-
t =
|
|
373
|
+
var d = Object.getOwnPropertySymbols(e);
|
|
374
|
+
for (s = 0; s < d.length; s++)
|
|
375
|
+
t = d[s], !(r.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (n[t] = e[t]);
|
|
376
376
|
}
|
|
377
377
|
return n;
|
|
378
378
|
}
|
|
@@ -400,8 +400,8 @@ function ne(e, r) {
|
|
|
400
400
|
var n = Object.keys(e);
|
|
401
401
|
if (Object.getOwnPropertySymbols) {
|
|
402
402
|
var t = Object.getOwnPropertySymbols(e);
|
|
403
|
-
r && (t = t.filter(function(
|
|
404
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
403
|
+
r && (t = t.filter(function(s) {
|
|
404
|
+
return Object.getOwnPropertyDescriptor(e, s).enumerable;
|
|
405
405
|
})), n.push.apply(n, t);
|
|
406
406
|
}
|
|
407
407
|
return n;
|
|
@@ -448,22 +448,22 @@ function ze(e) {
|
|
|
448
448
|
var r = (n) => {
|
|
449
449
|
var {
|
|
450
450
|
attr: t,
|
|
451
|
-
size:
|
|
452
|
-
title:
|
|
453
|
-
} = e,
|
|
454
|
-
return n.className && (
|
|
451
|
+
size: s,
|
|
452
|
+
title: d
|
|
453
|
+
} = e, p = Le(e, Ee), u = s || n.size || "1em", l;
|
|
454
|
+
return n.className && (l = n.className), e.className && (l = (l ? l + " " : "") + e.className), /* @__PURE__ */ D.createElement("svg", G({
|
|
455
455
|
stroke: "currentColor",
|
|
456
456
|
fill: "currentColor",
|
|
457
457
|
strokeWidth: "0"
|
|
458
|
-
}, n.attr, t,
|
|
459
|
-
className:
|
|
458
|
+
}, n.attr, t, p, {
|
|
459
|
+
className: l,
|
|
460
460
|
style: U(U({
|
|
461
461
|
color: e.color || n.color
|
|
462
462
|
}, n.style), e.style),
|
|
463
463
|
height: u,
|
|
464
464
|
width: u,
|
|
465
465
|
xmlns: "http://www.w3.org/2000/svg"
|
|
466
|
-
}),
|
|
466
|
+
}), d && /* @__PURE__ */ D.createElement("title", null, d), e.children);
|
|
467
467
|
};
|
|
468
468
|
return te !== void 0 ? /* @__PURE__ */ D.createElement(te.Consumer, null, (n) => r(n)) : r(ae);
|
|
469
469
|
}
|
|
@@ -511,28 +511,28 @@ const Ae = {
|
|
|
511
511
|
boxSize: r = "md",
|
|
512
512
|
shape: n = "rounded",
|
|
513
513
|
variant: t = "success",
|
|
514
|
-
onSelectionChange:
|
|
515
|
-
disabled:
|
|
516
|
-
className:
|
|
514
|
+
onSelectionChange: s,
|
|
515
|
+
disabled: d = !1,
|
|
516
|
+
className: p = "",
|
|
517
517
|
id: u,
|
|
518
|
-
value:
|
|
519
|
-
icon:
|
|
520
|
-
children:
|
|
518
|
+
value: l,
|
|
519
|
+
icon: c,
|
|
520
|
+
children: o,
|
|
521
521
|
checked: a,
|
|
522
|
-
...
|
|
523
|
-
},
|
|
524
|
-
const
|
|
525
|
-
!
|
|
526
|
-
},
|
|
522
|
+
...f
|
|
523
|
+
}, m) => {
|
|
524
|
+
const b = (g) => {
|
|
525
|
+
!d && s && s(g.target.checked), f.onChange && f.onChange(g);
|
|
526
|
+
}, x = "mr-2 border flex items-center justify-center transition-all", C = Ae[r], v = Me[n], $ = Te[t] ?? "", N = t.startsWith("outline"), y = t.startsWith("soft"), z = `${x} ${C} ${v} ${$} ${a && (N || y || t === "link") ? "peer-checked:bg-current peer-checked:text-white" : a ? "peer-checked:bg-current" : ""}`, O = {
|
|
527
527
|
xs: "w-2 h-2",
|
|
528
528
|
sm: "w-2.5 h-2.5",
|
|
529
529
|
md: "w-3 h-3",
|
|
530
530
|
lg: "w-3.5 h-3.5"
|
|
531
531
|
};
|
|
532
|
-
return /* @__PURE__ */
|
|
532
|
+
return /* @__PURE__ */ k(
|
|
533
533
|
"label",
|
|
534
534
|
{
|
|
535
|
-
className: `flex items-center ${
|
|
535
|
+
className: `flex items-center ${d ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} me-4 ${p}`,
|
|
536
536
|
children: [
|
|
537
537
|
/* @__PURE__ */ i(
|
|
538
538
|
"input",
|
|
@@ -540,16 +540,16 @@ const Ae = {
|
|
|
540
540
|
type: "checkbox",
|
|
541
541
|
className: "peer hidden",
|
|
542
542
|
checked: a,
|
|
543
|
-
onChange:
|
|
544
|
-
disabled:
|
|
543
|
+
onChange: b,
|
|
544
|
+
disabled: d,
|
|
545
545
|
id: u,
|
|
546
|
-
value:
|
|
547
|
-
ref:
|
|
548
|
-
...
|
|
546
|
+
value: l,
|
|
547
|
+
ref: m,
|
|
548
|
+
...f
|
|
549
549
|
}
|
|
550
550
|
),
|
|
551
|
-
/* @__PURE__ */ i("span", { className:
|
|
552
|
-
e ||
|
|
551
|
+
/* @__PURE__ */ i("span", { className: z.trim(), children: (a || f.defaultChecked) && (c ?? /* @__PURE__ */ i(De, { className: `${O[r]}` })) }),
|
|
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
|
}
|
|
555
555
|
);
|
|
@@ -561,74 +561,74 @@ const Je = ({
|
|
|
561
561
|
header: r,
|
|
562
562
|
items: n = [],
|
|
563
563
|
onSelect: t,
|
|
564
|
-
renderItem:
|
|
565
|
-
position:
|
|
566
|
-
className:
|
|
564
|
+
renderItem: s,
|
|
565
|
+
position: d = "right",
|
|
566
|
+
className: p = "",
|
|
567
567
|
menuClassName: u = "",
|
|
568
|
-
width:
|
|
569
|
-
closeOnSelect:
|
|
570
|
-
transition:
|
|
568
|
+
width: l = "w-48",
|
|
569
|
+
closeOnSelect: c = !1,
|
|
570
|
+
transition: o = !0,
|
|
571
571
|
ariaLabel: a = "Dropdown menu",
|
|
572
|
-
...
|
|
572
|
+
...f
|
|
573
573
|
}) => {
|
|
574
|
-
const [
|
|
574
|
+
const [m, b] = A(!1), [x, C] = A(!1), v = W(null), $ = W(null), N = j(() => ({
|
|
575
575
|
left: "left-0",
|
|
576
576
|
center: "left-1/2 transform -translate-x-1/2",
|
|
577
577
|
right: "right-0"
|
|
578
|
-
})[
|
|
579
|
-
const
|
|
580
|
-
if (!
|
|
581
|
-
const { top:
|
|
582
|
-
|
|
583
|
-
}, []),
|
|
584
|
-
var
|
|
585
|
-
!((
|
|
586
|
-
}, []),
|
|
587
|
-
|
|
588
|
-
if (
|
|
589
|
-
return
|
|
590
|
-
window.removeEventListener("resize",
|
|
578
|
+
})[d], [d]), y = I(() => {
|
|
579
|
+
const g = $.current, h = v.current;
|
|
580
|
+
if (!g || !h) return;
|
|
581
|
+
const { top: L, bottom: M } = g.getBoundingClientRect(), R = h.offsetHeight, T = window.innerHeight - M, _ = L;
|
|
582
|
+
C(T < R && _ > R);
|
|
583
|
+
}, []), w = I((g) => {
|
|
584
|
+
var h, L;
|
|
585
|
+
!((h = v.current) != null && h.contains(g.target)) && !((L = $.current) != null && L.contains(g.target)) && b(!1);
|
|
586
|
+
}, []), E = I(() => b((g) => !g), []), z = I(() => b(!1), []);
|
|
587
|
+
B(() => {
|
|
588
|
+
if (m)
|
|
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
|
-
}, [
|
|
593
|
-
const
|
|
592
|
+
}, [m, y]), B(() => (document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w)), [w]);
|
|
593
|
+
const O = j(
|
|
594
594
|
() => [
|
|
595
595
|
"absolute z-50 bg-white rounded shadow-lg overflow-hidden w-auto",
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
596
|
+
x ? "bottom-full mb-2" : "top-full mt-2",
|
|
597
|
+
N,
|
|
598
|
+
l,
|
|
599
|
+
o && "transition-all duration-200 ease-out",
|
|
600
600
|
u
|
|
601
601
|
].filter(Boolean).join(" "),
|
|
602
|
-
[
|
|
602
|
+
[x, N, l, o, u]
|
|
603
603
|
);
|
|
604
|
-
return /* @__PURE__ */
|
|
604
|
+
return /* @__PURE__ */ k("div", { className: `relative inline-block ${p}`, ...f, children: [
|
|
605
605
|
/* @__PURE__ */ i(
|
|
606
606
|
"button",
|
|
607
607
|
{
|
|
608
608
|
type: "button",
|
|
609
|
-
ref:
|
|
610
|
-
onClick:
|
|
611
|
-
"aria-expanded":
|
|
609
|
+
ref: $,
|
|
610
|
+
onClick: E,
|
|
611
|
+
"aria-expanded": m,
|
|
612
612
|
"aria-label": a,
|
|
613
613
|
className: "focus:outline-none",
|
|
614
614
|
children: e
|
|
615
615
|
}
|
|
616
616
|
),
|
|
617
|
-
|
|
617
|
+
m && /* @__PURE__ */ k("div", { ref: v, role: "menu", className: O, children: [
|
|
618
618
|
r && r,
|
|
619
|
-
n.map((
|
|
620
|
-
const
|
|
621
|
-
t && t(
|
|
619
|
+
n.map((g, h) => {
|
|
620
|
+
const L = () => {
|
|
621
|
+
t && t(g), c && z();
|
|
622
622
|
};
|
|
623
|
-
return /* @__PURE__ */ i("div", { children:
|
|
623
|
+
return /* @__PURE__ */ i("div", { children: s ? s(g, L) : /* @__PURE__ */ i(
|
|
624
624
|
"div",
|
|
625
625
|
{
|
|
626
|
-
onClick:
|
|
626
|
+
onClick: L,
|
|
627
627
|
className: "px-4 py-2 text-sm text-gray-800 hover:bg-gray-100 cursor-pointer",
|
|
628
628
|
role: "menuitem",
|
|
629
|
-
children:
|
|
629
|
+
children: g.label
|
|
630
630
|
}
|
|
631
|
-
) },
|
|
631
|
+
) }, h);
|
|
632
632
|
})
|
|
633
633
|
] })
|
|
634
634
|
] });
|
|
@@ -637,24 +637,24 @@ const Je = ({
|
|
|
637
637
|
content: r,
|
|
638
638
|
position: n = "top",
|
|
639
639
|
className: t = "",
|
|
640
|
-
tooltipClass:
|
|
641
|
-
tooltipStyle:
|
|
640
|
+
tooltipClass: s = "",
|
|
641
|
+
tooltipStyle: d = {}
|
|
642
642
|
}) => {
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
const
|
|
646
|
-
if (!
|
|
643
|
+
const p = W(null), u = W(null);
|
|
644
|
+
B(() => {
|
|
645
|
+
const c = p.current, o = u.current;
|
|
646
|
+
if (!c || !o) return;
|
|
647
647
|
const a = () => {
|
|
648
|
-
|
|
649
|
-
},
|
|
650
|
-
|
|
648
|
+
o.style.opacity = "1", o.style.visibility = "visible";
|
|
649
|
+
}, f = () => {
|
|
650
|
+
o.style.opacity = "0", o.style.visibility = "hidden";
|
|
651
651
|
};
|
|
652
|
-
return
|
|
653
|
-
|
|
652
|
+
return c.addEventListener("mouseenter", a), c.addEventListener("mouseleave", f), () => {
|
|
653
|
+
c.removeEventListener("mouseenter", a), c.removeEventListener("mouseleave", f);
|
|
654
654
|
};
|
|
655
655
|
}, []);
|
|
656
|
-
const
|
|
657
|
-
const
|
|
656
|
+
const l = (c) => {
|
|
657
|
+
const o = {
|
|
658
658
|
position: "absolute",
|
|
659
659
|
opacity: 0,
|
|
660
660
|
visibility: "hidden",
|
|
@@ -671,10 +671,10 @@ const Je = ({
|
|
|
671
671
|
zIndex: 9999,
|
|
672
672
|
width: "max-content"
|
|
673
673
|
};
|
|
674
|
-
switch (
|
|
674
|
+
switch (c) {
|
|
675
675
|
case "top":
|
|
676
676
|
return {
|
|
677
|
-
...
|
|
677
|
+
...o,
|
|
678
678
|
bottom: "100%",
|
|
679
679
|
left: "50%",
|
|
680
680
|
transform: "translateX(-50%)",
|
|
@@ -682,7 +682,7 @@ const Je = ({
|
|
|
682
682
|
};
|
|
683
683
|
case "bottom":
|
|
684
684
|
return {
|
|
685
|
-
...
|
|
685
|
+
...o,
|
|
686
686
|
top: "100%",
|
|
687
687
|
left: "50%",
|
|
688
688
|
transform: "translateX(-50%)",
|
|
@@ -690,7 +690,7 @@ const Je = ({
|
|
|
690
690
|
};
|
|
691
691
|
case "left":
|
|
692
692
|
return {
|
|
693
|
-
...
|
|
693
|
+
...o,
|
|
694
694
|
right: "100%",
|
|
695
695
|
top: "50%",
|
|
696
696
|
transform: "translateY(-50%)",
|
|
@@ -698,27 +698,27 @@ const Je = ({
|
|
|
698
698
|
};
|
|
699
699
|
case "right":
|
|
700
700
|
return {
|
|
701
|
-
...
|
|
701
|
+
...o,
|
|
702
702
|
left: "100%",
|
|
703
703
|
top: "50%",
|
|
704
704
|
transform: "translateY(-50%)",
|
|
705
705
|
marginLeft: "8px"
|
|
706
706
|
};
|
|
707
707
|
default:
|
|
708
|
-
return
|
|
708
|
+
return o;
|
|
709
709
|
}
|
|
710
710
|
};
|
|
711
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ k("div", { ref: p, className: `relative inline-block ${t}`, children: [
|
|
712
712
|
e,
|
|
713
713
|
/* @__PURE__ */ i(
|
|
714
714
|
"div",
|
|
715
715
|
{
|
|
716
716
|
ref: u,
|
|
717
717
|
role: "tooltip",
|
|
718
|
-
className:
|
|
718
|
+
className: s,
|
|
719
719
|
style: {
|
|
720
|
-
...
|
|
721
|
-
...
|
|
720
|
+
...l(n),
|
|
721
|
+
...d
|
|
722
722
|
},
|
|
723
723
|
children: r
|
|
724
724
|
}
|
|
@@ -758,21 +758,21 @@ const Je = ({
|
|
|
758
758
|
variant: r = "primary",
|
|
759
759
|
size: n = "sm",
|
|
760
760
|
shape: t = "rounded",
|
|
761
|
-
icon:
|
|
762
|
-
dismissible:
|
|
763
|
-
onDismiss:
|
|
761
|
+
icon: s,
|
|
762
|
+
dismissible: d,
|
|
763
|
+
onDismiss: p,
|
|
764
764
|
className: u = "",
|
|
765
|
-
...
|
|
765
|
+
...l
|
|
766
766
|
}) => {
|
|
767
|
-
const
|
|
768
|
-
return /* @__PURE__ */
|
|
769
|
-
|
|
767
|
+
const c = !e && !!s, o = `inline-flex items-center font-medium ${_e[r] || ""} ${Be[n] || ""} ${Fe[t] || ""} ${c ? "justify-center p-2 w-8 h-8" : ""} ` + u;
|
|
768
|
+
return /* @__PURE__ */ k("span", { className: o.trim(), ...l, children: [
|
|
769
|
+
s && /* @__PURE__ */ i("span", { className: e ? "mr-1" : "", children: s }),
|
|
770
770
|
e,
|
|
771
|
-
|
|
771
|
+
d && /* @__PURE__ */ i(
|
|
772
772
|
"button",
|
|
773
773
|
{
|
|
774
774
|
type: "button",
|
|
775
|
-
onClick:
|
|
775
|
+
onClick: p,
|
|
776
776
|
className: "ml-2 text-xs font-bold leading-none focus:outline-none",
|
|
777
777
|
children: "×"
|
|
778
778
|
}
|
|
@@ -787,19 +787,19 @@ const et = ({
|
|
|
787
787
|
allowMultipleOpen: r = !1,
|
|
788
788
|
className: n = "",
|
|
789
789
|
tileClasses: t = "",
|
|
790
|
-
open:
|
|
791
|
-
onChange:
|
|
792
|
-
renderTitle:
|
|
790
|
+
open: s,
|
|
791
|
+
onChange: d,
|
|
792
|
+
renderTitle: p,
|
|
793
793
|
renderContent: u,
|
|
794
|
-
showArrowIcon:
|
|
795
|
-
panelClasses:
|
|
794
|
+
showArrowIcon: l = !0,
|
|
795
|
+
panelClasses: c = ""
|
|
796
796
|
}) => {
|
|
797
|
-
const [
|
|
798
|
-
(
|
|
799
|
-
const
|
|
800
|
-
|
|
797
|
+
const [o, a] = A(/* @__PURE__ */ new Set()), f = j(() => s ? new Set(s) : o, [s, o]), m = I(
|
|
798
|
+
(b) => {
|
|
799
|
+
const x = new Set(f);
|
|
800
|
+
x.has(b) ? x.delete(b) : (r || x.clear(), x.add(b)), s && d ? d(Array.from(x)) : a(x);
|
|
801
801
|
},
|
|
802
|
-
[
|
|
802
|
+
[f, s, d, r]
|
|
803
803
|
);
|
|
804
804
|
return /* @__PURE__ */ i(
|
|
805
805
|
"div",
|
|
@@ -807,25 +807,25 @@ const et = ({
|
|
|
807
807
|
className: "accordion",
|
|
808
808
|
role: "region",
|
|
809
809
|
"aria-multiselectable": r,
|
|
810
|
-
children: e.map((
|
|
811
|
-
const
|
|
812
|
-
return /* @__PURE__ */
|
|
810
|
+
children: e.map((b) => {
|
|
811
|
+
const x = f.has(b.id), C = `accordion-heading-${b.id}`, v = `accordion-panel-${b.id}`;
|
|
812
|
+
return /* @__PURE__ */ k(
|
|
813
813
|
"div",
|
|
814
814
|
{
|
|
815
815
|
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${n}`,
|
|
816
816
|
children: [
|
|
817
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ k(
|
|
818
818
|
"button",
|
|
819
819
|
{
|
|
820
|
-
id:
|
|
820
|
+
id: C,
|
|
821
821
|
type: "button",
|
|
822
|
-
"aria-expanded":
|
|
822
|
+
"aria-expanded": x,
|
|
823
823
|
"aria-controls": v,
|
|
824
|
-
onClick: () => b
|
|
824
|
+
onClick: () => m(b.id),
|
|
825
825
|
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 ${t}`,
|
|
826
826
|
children: [
|
|
827
|
-
|
|
828
|
-
|
|
827
|
+
p ? p(b, x) : b.title,
|
|
828
|
+
l ? /* @__PURE__ */ i(Ke, {}) : null
|
|
829
829
|
]
|
|
830
830
|
}
|
|
831
831
|
),
|
|
@@ -834,15 +834,15 @@ const et = ({
|
|
|
834
834
|
{
|
|
835
835
|
id: v,
|
|
836
836
|
role: "region",
|
|
837
|
-
"aria-labelledby":
|
|
838
|
-
hidden: !
|
|
839
|
-
className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${
|
|
840
|
-
children: u ? u(
|
|
837
|
+
"aria-labelledby": C,
|
|
838
|
+
hidden: !x,
|
|
839
|
+
className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${c}`,
|
|
840
|
+
children: u ? u(b, x) : b.content
|
|
841
841
|
}
|
|
842
842
|
)
|
|
843
843
|
]
|
|
844
844
|
},
|
|
845
|
-
|
|
845
|
+
b.id
|
|
846
846
|
);
|
|
847
847
|
})
|
|
848
848
|
}
|
|
@@ -860,68 +860,76 @@ function tt({
|
|
|
860
860
|
title: r,
|
|
861
861
|
children: n,
|
|
862
862
|
standalone: t = !1,
|
|
863
|
-
showFloatingClose:
|
|
864
|
-
containerClasses:
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
863
|
+
showFloatingClose: s = !1,
|
|
864
|
+
containerClasses: d = "",
|
|
865
|
+
headerClasses: p = "",
|
|
866
|
+
bodyClasses: u = "",
|
|
867
|
+
onClose: l,
|
|
868
|
+
disableEscapeClose: c = !1,
|
|
869
|
+
closeBtnStyle: o
|
|
868
870
|
}) {
|
|
869
|
-
const
|
|
870
|
-
|
|
871
|
-
}, [
|
|
872
|
-
return
|
|
873
|
-
const
|
|
871
|
+
const a = ue(), f = ce(), m = !t && !!a && !!f, [b, x] = A(!1), C = m ? a.isOpen(e) : b, v = m ? a.getModalData(e) : null, $ = I(() => {
|
|
872
|
+
m ? f.closeModal(e) : x(!1), l == null || l();
|
|
873
|
+
}, [m, f, e, l]);
|
|
874
|
+
return B(() => {
|
|
875
|
+
const N = document.activeElement, y = document.getElementById(e), w = [
|
|
874
876
|
"a[href]",
|
|
875
877
|
"button:not([disabled])",
|
|
876
878
|
"textarea:not([disabled])",
|
|
877
879
|
"input:not([disabled])",
|
|
878
880
|
"select:not([disabled])",
|
|
879
881
|
'[tabindex]:not([tabindex="-1"])'
|
|
880
|
-
],
|
|
881
|
-
if (!
|
|
882
|
-
const
|
|
883
|
-
|
|
882
|
+
], E = () => {
|
|
883
|
+
if (!y) return [];
|
|
884
|
+
const g = y.querySelectorAll(
|
|
885
|
+
w.join(",")
|
|
884
886
|
);
|
|
885
|
-
return Array.from(
|
|
886
|
-
},
|
|
887
|
-
if (
|
|
888
|
-
const
|
|
889
|
-
if (
|
|
890
|
-
const
|
|
891
|
-
|
|
887
|
+
return Array.from(g).filter((h) => h.offsetParent !== null);
|
|
888
|
+
}, z = (g) => {
|
|
889
|
+
if (g.key === "Tab") {
|
|
890
|
+
const h = E();
|
|
891
|
+
if (h.length === 0) return;
|
|
892
|
+
const L = h[0], M = h[h.length - 1];
|
|
893
|
+
g.shiftKey ? document.activeElement === L && (g.preventDefault(), M.focus()) : document.activeElement === M && (g.preventDefault(), L.focus());
|
|
892
894
|
}
|
|
893
|
-
}, O = (
|
|
894
|
-
|
|
895
|
+
}, O = (g) => {
|
|
896
|
+
g.key === "Escape" && !c && $(), z(g);
|
|
895
897
|
};
|
|
896
|
-
return
|
|
897
|
-
const
|
|
898
|
-
|
|
898
|
+
return C && (document.body.style.overflow = "hidden", setTimeout(() => {
|
|
899
|
+
const g = E();
|
|
900
|
+
g.length && g[0].focus();
|
|
899
901
|
}, 0), window.addEventListener("keydown", O)), () => {
|
|
900
|
-
document.body.style.overflow = "",
|
|
902
|
+
document.body.style.overflow = "", N && N.focus(), window.removeEventListener("keydown", O);
|
|
901
903
|
};
|
|
902
|
-
}, [
|
|
904
|
+
}, [C, c, $, e]), C ? /* @__PURE__ */ i(
|
|
903
905
|
"div",
|
|
904
906
|
{
|
|
905
907
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",
|
|
906
908
|
id: e,
|
|
907
|
-
children: /* @__PURE__ */
|
|
909
|
+
children: /* @__PURE__ */ k(
|
|
908
910
|
"div",
|
|
909
911
|
{
|
|
910
|
-
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${
|
|
912
|
+
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${d}`,
|
|
911
913
|
children: [
|
|
912
|
-
/* @__PURE__ */
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
914
|
+
/* @__PURE__ */ k(
|
|
915
|
+
"div",
|
|
916
|
+
{
|
|
917
|
+
className: `flex justify-between items-center relative ${p}`,
|
|
918
|
+
children: [
|
|
919
|
+
r && /* @__PURE__ */ i("h2", { className: "text-lg font-semibold", children: r }),
|
|
920
|
+
s && /* @__PURE__ */ i(
|
|
921
|
+
"button",
|
|
922
|
+
{
|
|
923
|
+
onClick: $,
|
|
924
|
+
className: `text-gray-500 hover:text-black absolute top-0 right-3 hover:bg-gray-200 rounded-full aspect-square w-8 ${o}`,
|
|
925
|
+
"aria-label": "Close modal",
|
|
926
|
+
children: "✕"
|
|
927
|
+
}
|
|
928
|
+
)
|
|
929
|
+
]
|
|
930
|
+
}
|
|
931
|
+
),
|
|
932
|
+
/* @__PURE__ */ i("div", { className: u, children: typeof n == "function" ? n({ modalData: v }) : n })
|
|
925
933
|
]
|
|
926
934
|
}
|
|
927
935
|
)
|
|
@@ -931,32 +939,32 @@ function tt({
|
|
|
931
939
|
function nt({
|
|
932
940
|
children: e
|
|
933
941
|
}) {
|
|
934
|
-
const [r, n] = A({}), [t,
|
|
935
|
-
n((
|
|
936
|
-
}, []),
|
|
937
|
-
n((
|
|
938
|
-
const
|
|
939
|
-
return delete
|
|
942
|
+
const [r, n] = A({}), [t, s] = A({}), d = I((a, f) => {
|
|
943
|
+
n((m) => ({ ...m, [a]: !0 })), f && s((m) => ({ ...m, [a]: f }));
|
|
944
|
+
}, []), p = I((a) => {
|
|
945
|
+
n((f) => ({ ...f, [a]: !1 })), s((f) => {
|
|
946
|
+
const m = { ...f };
|
|
947
|
+
return delete m[a], m;
|
|
940
948
|
});
|
|
941
|
-
}, []), u =
|
|
949
|
+
}, []), u = I((a) => !!r[a], [r]), l = I(
|
|
942
950
|
(a) => t[a],
|
|
943
951
|
[t]
|
|
944
|
-
),
|
|
945
|
-
() => ({ openModal:
|
|
946
|
-
[
|
|
947
|
-
),
|
|
948
|
-
() => ({ isOpen: u, getModalData:
|
|
949
|
-
[u,
|
|
952
|
+
), c = j(
|
|
953
|
+
() => ({ openModal: d, closeModal: p }),
|
|
954
|
+
[d, p]
|
|
955
|
+
), o = j(
|
|
956
|
+
() => ({ isOpen: u, getModalData: l }),
|
|
957
|
+
[u, l]
|
|
950
958
|
);
|
|
951
|
-
return /* @__PURE__ */ i(ie.Provider, { value:
|
|
959
|
+
return /* @__PURE__ */ i(ie.Provider, { value: c, children: /* @__PURE__ */ i(de.Provider, { value: o, children: e }) });
|
|
952
960
|
}
|
|
953
961
|
function rt(e) {
|
|
954
|
-
const { openModal: r, closeModal: n } = ce(), { isOpen: t, getModalData:
|
|
962
|
+
const { openModal: r, closeModal: n } = ce(), { isOpen: t, getModalData: s } = ue();
|
|
955
963
|
return {
|
|
956
|
-
open: (
|
|
964
|
+
open: (d) => r(e, d),
|
|
957
965
|
close: () => n(e),
|
|
958
966
|
isOpen: t(e),
|
|
959
|
-
data:
|
|
967
|
+
data: s(e)
|
|
960
968
|
};
|
|
961
969
|
}
|
|
962
970
|
let Y = null, J = {};
|
|
@@ -980,33 +988,33 @@ const Ge = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, functio
|
|
|
980
988
|
return (e === "x" ? r : r & 3 | 8).toString(16);
|
|
981
989
|
}), at = () => {
|
|
982
990
|
const [e, r] = A([]);
|
|
983
|
-
|
|
984
|
-
Ze((t,
|
|
991
|
+
B(() => {
|
|
992
|
+
Ze((t, s, d, p) => {
|
|
985
993
|
const u = Ge();
|
|
986
|
-
r((
|
|
987
|
-
r((
|
|
988
|
-
},
|
|
994
|
+
r((l) => [...l, { id: u, type: t, message: s, config: p }]), setTimeout(() => {
|
|
995
|
+
r((l) => l.filter((c) => c.id !== u));
|
|
996
|
+
}, d);
|
|
989
997
|
});
|
|
990
998
|
}, []);
|
|
991
999
|
const n = He();
|
|
992
1000
|
return /* @__PURE__ */ i("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((t) => {
|
|
993
|
-
var
|
|
994
|
-
const
|
|
995
|
-
return /* @__PURE__ */
|
|
1001
|
+
var l, c, o, a, f, m, b, x, C, v, $, N, y;
|
|
1002
|
+
const s = ((l = t.config) == null ? void 0 : l.icon) || ((c = n.icons) == null ? void 0 : c[t.type]) || Ue(t.type), d = ((o = t.config) == null ? void 0 : o.bgColor) || ((f = (a = n.colors) == null ? void 0 : a[t.type]) == null ? void 0 : f.bg) || "bg-white dark:bg-gray-800", p = ((m = t.config) == null ? void 0 : m.textColor) || ((x = (b = n.colors) == null ? void 0 : b[t.type]) == null ? void 0 : x.text) || "text-gray-700 dark:text-gray-300", u = ((C = t.config) == null ? void 0 : C.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
|
|
1003
|
+
return /* @__PURE__ */ k(
|
|
996
1004
|
"div",
|
|
997
1005
|
{
|
|
998
|
-
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${
|
|
1006
|
+
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${d} ${p}`,
|
|
999
1007
|
children: [
|
|
1000
|
-
/* @__PURE__ */ i("div", { className: u, children:
|
|
1001
|
-
/* @__PURE__ */
|
|
1008
|
+
/* @__PURE__ */ i("div", { className: u, children: s }),
|
|
1009
|
+
/* @__PURE__ */ k("div", { className: "flex-1 me-3", children: [
|
|
1002
1010
|
((v = t.config) == null ? void 0 : v.title) && /* @__PURE__ */ i("div", { className: "font-semibold text-black", children: t.config.title }),
|
|
1003
|
-
((
|
|
1004
|
-
!((
|
|
1011
|
+
(($ = t.config) == null ? void 0 : $.description) && /* @__PURE__ */ i("div", { className: "text-sm text-gray-500", children: t.config.description }),
|
|
1012
|
+
!((N = t.config) != null && N.title) && !((y = t.config) != null && y.description) && /* @__PURE__ */ i("div", { className: "text-sm", children: t.message })
|
|
1005
1013
|
] }),
|
|
1006
1014
|
/* @__PURE__ */ i(
|
|
1007
1015
|
"button",
|
|
1008
1016
|
{
|
|
1009
|
-
onClick: () => r((
|
|
1017
|
+
onClick: () => r((w) => w.filter((E) => E.id !== t.id)),
|
|
1010
1018
|
className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
|
|
1011
1019
|
"aria-label": "Close",
|
|
1012
1020
|
children: /* @__PURE__ */ i(We, { size: 18 })
|