tailwind-ux-kit 1.0.59 → 1.0.60
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/Checkbox/Checkbox.d.ts +20 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/tailwind-ux-kit.es.js +445 -360
- package/lib/tailwind-ux-kit.umd.js +7 -7
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
2
|
+
import { jsxs as v, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import A, { forwardRef as Y, useState as I, useMemo as P, useId as oe, useRef as _, useCallback as j, useEffect as T, createContext as J, useContext as Q } from "react";
|
|
4
|
+
const K = {
|
|
5
5
|
xs: "text-xs px-2 py-1",
|
|
6
6
|
sm: "text-sm px-3 py-1.5",
|
|
7
7
|
md: "text-sm px-3 py-3",
|
|
8
8
|
lg: "text-lg px-5 py-3"
|
|
9
|
-
},
|
|
9
|
+
}, U = {
|
|
10
10
|
flat: "rounded-none",
|
|
11
11
|
rounded: "rounded-sm",
|
|
12
12
|
pill: "rounded-full"
|
|
@@ -18,10 +18,10 @@ const W = {
|
|
|
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
|
-
}, ie = (e,
|
|
22
|
-
if (t)
|
|
23
|
-
return "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";
|
|
21
|
+
}, ie = (e, r, n) => {
|
|
24
22
|
if (n)
|
|
23
|
+
return "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";
|
|
24
|
+
if (r)
|
|
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,84 +33,84 @@ const W = {
|
|
|
33
33
|
default:
|
|
34
34
|
return "border-gray-300 focus:ring-blue-500";
|
|
35
35
|
}
|
|
36
|
-
}, ce =
|
|
36
|
+
}, ce = Y((e, r) => {
|
|
37
37
|
const {
|
|
38
|
-
label:
|
|
39
|
-
id:
|
|
38
|
+
label: n,
|
|
39
|
+
id: t,
|
|
40
40
|
inputSize: s = "md",
|
|
41
41
|
shape: u = "rounded",
|
|
42
|
-
validate:
|
|
42
|
+
validate: l,
|
|
43
43
|
onValidatedChange: d,
|
|
44
|
-
className:
|
|
45
|
-
icon:
|
|
44
|
+
className: c = "",
|
|
45
|
+
icon: i,
|
|
46
46
|
iconPosition: o = "left",
|
|
47
47
|
floatingLabelStyle: f,
|
|
48
48
|
onChange: p,
|
|
49
49
|
isValid: b,
|
|
50
50
|
isInvalid: g,
|
|
51
51
|
feedback: m,
|
|
52
|
-
feedbackType:
|
|
52
|
+
feedbackType: w = "invalid",
|
|
53
53
|
...h
|
|
54
|
-
} = e, [N,
|
|
54
|
+
} = e, [N, S] = I("default"), C = A.useCallback(
|
|
55
55
|
(M) => {
|
|
56
|
-
const D = M.target.value,
|
|
57
|
-
|
|
56
|
+
const D = M.target.value, z = (l == null ? void 0 : l(D)) ?? "default";
|
|
57
|
+
S(z), d == null || d(M, z), p == null || p(M);
|
|
58
58
|
},
|
|
59
|
-
[
|
|
60
|
-
),
|
|
59
|
+
[l, d, p]
|
|
60
|
+
), k = P(() => t || (typeof n == "string" ? `input-${n.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [t, n]), x = !!f, $ = K[s] || K.md, E = U[u] || U.flat, y = P(
|
|
61
61
|
() => ie(N, b, g),
|
|
62
62
|
[N, b, g]
|
|
63
|
-
), L = P(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), O = P(() =>
|
|
64
|
-
return /* @__PURE__ */
|
|
63
|
+
), L = P(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), O = P(() => i ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [i, o]);
|
|
64
|
+
return /* @__PURE__ */ v(
|
|
65
65
|
"div",
|
|
66
66
|
{
|
|
67
67
|
className: `w-full relative ${x ? "z-0" : ""} tailwind-ux-input`,
|
|
68
68
|
children: [
|
|
69
|
-
!x &&
|
|
69
|
+
!x && n && /* @__PURE__ */ a(
|
|
70
70
|
"label",
|
|
71
71
|
{
|
|
72
|
-
htmlFor:
|
|
72
|
+
htmlFor: k,
|
|
73
73
|
className: `block mb-1 text-sm ${b ? "text-green-700 dark:text-green-500" : g ? "text-red-700 dark:text-red-500" : "text-gray-700"}`,
|
|
74
|
-
children:
|
|
74
|
+
children: n
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
77
|
+
/* @__PURE__ */ v("div", { className: "relative w-full", children: [
|
|
78
|
+
i && /* @__PURE__ */ a(
|
|
79
79
|
"div",
|
|
80
80
|
{
|
|
81
81
|
className: `absolute inset-y-0 flex items-center ${L}`,
|
|
82
82
|
"aria-hidden": "true",
|
|
83
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ a("span", { className: "text-gray-500", children: i })
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ a(
|
|
87
87
|
"input",
|
|
88
88
|
{
|
|
89
89
|
...h,
|
|
90
|
-
id:
|
|
91
|
-
ref:
|
|
90
|
+
id: k,
|
|
91
|
+
ref: r,
|
|
92
92
|
placeholder: x ? " " : h.placeholder,
|
|
93
93
|
onChange: C,
|
|
94
94
|
className: `border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
|
|
95
95
|
${$}
|
|
96
96
|
${x && f && ae[f]}
|
|
97
|
-
${O} ${E} ${y} ${
|
|
97
|
+
${O} ${E} ${y} ${c}`
|
|
98
98
|
}
|
|
99
99
|
),
|
|
100
|
-
x &&
|
|
100
|
+
x && n && f && /* @__PURE__ */ a(
|
|
101
101
|
"label",
|
|
102
102
|
{
|
|
103
|
-
htmlFor:
|
|
104
|
-
className: `ms-1 ${le[f]} ${
|
|
105
|
-
children:
|
|
103
|
+
htmlFor: k,
|
|
104
|
+
className: `ms-1 ${le[f]} ${c}`,
|
|
105
|
+
children: n
|
|
106
106
|
}
|
|
107
107
|
)
|
|
108
108
|
] }),
|
|
109
|
-
m && /* @__PURE__ */
|
|
109
|
+
m && /* @__PURE__ */ a(
|
|
110
110
|
"p",
|
|
111
111
|
{
|
|
112
|
-
className: `mt-1 text-xs ${
|
|
113
|
-
role:
|
|
112
|
+
className: `mt-1 text-xs ${w === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
|
|
113
|
+
role: w === "invalid" ? "alert" : void 0,
|
|
114
114
|
children: m
|
|
115
115
|
}
|
|
116
116
|
)
|
|
@@ -136,89 +136,89 @@ const de = {
|
|
|
136
136
|
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",
|
|
137
137
|
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",
|
|
138
138
|
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"
|
|
139
|
-
}, ge = (e,
|
|
140
|
-
if (t)
|
|
141
|
-
return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
|
|
139
|
+
}, ge = (e, r, n) => {
|
|
142
140
|
if (n)
|
|
141
|
+
return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
|
|
142
|
+
if (r)
|
|
143
143
|
return "border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";
|
|
144
|
-
const
|
|
144
|
+
const t = "focus:ring focus:border";
|
|
145
145
|
switch (e) {
|
|
146
146
|
case "error":
|
|
147
|
-
return `${
|
|
147
|
+
return `${t}-red-500 border-red-500 bg-red-50`;
|
|
148
148
|
case "warning":
|
|
149
|
-
return `${
|
|
149
|
+
return `${t}-yellow-500 border-yellow-500 bg-yellow-50`;
|
|
150
150
|
case "success":
|
|
151
|
-
return `${
|
|
151
|
+
return `${t}-green-500 border-green-500 bg-green-50`;
|
|
152
152
|
default:
|
|
153
153
|
return "border-gray-300 focus:ring-blue-500";
|
|
154
154
|
}
|
|
155
|
-
}, be =
|
|
155
|
+
}, be = Y((e, r) => {
|
|
156
156
|
const {
|
|
157
|
-
label:
|
|
158
|
-
id:
|
|
157
|
+
label: n,
|
|
158
|
+
id: t,
|
|
159
159
|
inputSize: s = "md",
|
|
160
160
|
shape: u = "rounded",
|
|
161
|
-
validate:
|
|
161
|
+
validate: l,
|
|
162
162
|
onValidatedChange: d,
|
|
163
|
-
className:
|
|
164
|
-
icon:
|
|
163
|
+
className: c = "",
|
|
164
|
+
icon: i,
|
|
165
165
|
iconPosition: o = "left",
|
|
166
166
|
floatingLabelStyle: f,
|
|
167
167
|
onChange: p,
|
|
168
168
|
isValid: b,
|
|
169
169
|
isInvalid: g,
|
|
170
170
|
feedback: m,
|
|
171
|
-
feedbackType:
|
|
171
|
+
feedbackType: w = "invalid",
|
|
172
172
|
children: h,
|
|
173
173
|
...N
|
|
174
|
-
} = e, [
|
|
175
|
-
const R =
|
|
176
|
-
C(G), d == null || d(
|
|
177
|
-
}, E = !!f, y = de[s], L = ue[u], O = ge(
|
|
178
|
-
return /* @__PURE__ */
|
|
179
|
-
!E &&
|
|
174
|
+
} = e, [S, C] = I("default"), k = oe(), x = P(() => t || (typeof n == "string" ? `select-${n.toLowerCase().replace(/\s+/g, "-")}` : k), [t, n, k]), $ = (z) => {
|
|
175
|
+
const R = z.target.value, G = (l == null ? void 0 : l(R)) ?? "default";
|
|
176
|
+
C(G), d == null || d(z, G), p == null || p(z);
|
|
177
|
+
}, E = !!f, y = de[s], L = ue[u], O = ge(S, b, g);
|
|
178
|
+
return /* @__PURE__ */ v("div", { className: `w-full relative ${E ? "z-0" : ""}`, children: [
|
|
179
|
+
!E && n && /* @__PURE__ */ a(
|
|
180
180
|
"label",
|
|
181
181
|
{
|
|
182
182
|
htmlFor: x,
|
|
183
183
|
className: `block mb-1 text-sm ${b ? "text-green-700" : g ? "text-red-700" : "text-gray-700"}`,
|
|
184
|
-
children:
|
|
184
|
+
children: n
|
|
185
185
|
}
|
|
186
186
|
),
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
|
|
187
|
+
/* @__PURE__ */ v("div", { className: "relative w-full", children: [
|
|
188
|
+
i && /* @__PURE__ */ a(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
191
|
className: `absolute inset-y-0 flex items-center ${o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5"}`,
|
|
192
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ a("span", { className: "text-gray-500", children: i })
|
|
193
193
|
}
|
|
194
194
|
),
|
|
195
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ a(
|
|
196
196
|
"select",
|
|
197
197
|
{
|
|
198
198
|
...N,
|
|
199
199
|
id: x,
|
|
200
|
-
ref:
|
|
200
|
+
ref: r,
|
|
201
201
|
onChange: $,
|
|
202
202
|
className: `border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-600 placeholder-[#798ba5] border-gray-400
|
|
203
|
-
${y} ${
|
|
203
|
+
${y} ${i && (o === "start" || o === "left") ? "ps-10" : i ? "pe-10" : ""}
|
|
204
204
|
${E && f && fe[f]}
|
|
205
|
-
${L} ${O} ${
|
|
205
|
+
${L} ${O} ${c}`,
|
|
206
206
|
children: h
|
|
207
207
|
}
|
|
208
208
|
),
|
|
209
|
-
E &&
|
|
209
|
+
E && n && f && /* @__PURE__ */ a(
|
|
210
210
|
"label",
|
|
211
211
|
{
|
|
212
212
|
htmlFor: x,
|
|
213
|
-
className: `ms-1 ${pe[f]} ${
|
|
214
|
-
children:
|
|
213
|
+
className: `ms-1 ${pe[f]} ${c}`,
|
|
214
|
+
children: n
|
|
215
215
|
}
|
|
216
216
|
)
|
|
217
217
|
] }),
|
|
218
|
-
m && /* @__PURE__ */
|
|
218
|
+
m && /* @__PURE__ */ a(
|
|
219
219
|
"p",
|
|
220
220
|
{
|
|
221
|
-
className: `mt-1 text-xs ${
|
|
221
|
+
className: `mt-1 text-xs ${w === "invalid" ? "text-red-600" : "text-green-600"}`,
|
|
222
222
|
children: m
|
|
223
223
|
}
|
|
224
224
|
)
|
|
@@ -262,28 +262,28 @@ const me = {
|
|
|
262
262
|
rounded: "rounded-sm",
|
|
263
263
|
pill: "rounded-full",
|
|
264
264
|
circle: "rounded-full w-10 h-10 p-0 flex items-center justify-center"
|
|
265
|
-
},
|
|
265
|
+
}, Re = ({
|
|
266
266
|
children: e,
|
|
267
|
-
variant:
|
|
268
|
-
size:
|
|
269
|
-
type:
|
|
267
|
+
variant: r = "primary",
|
|
268
|
+
size: n = "md",
|
|
269
|
+
type: t = "button",
|
|
270
270
|
shape: s = "rounded",
|
|
271
271
|
className: u = "",
|
|
272
|
-
isLoading:
|
|
272
|
+
isLoading: l = !1,
|
|
273
273
|
disabled: d = !1,
|
|
274
|
-
...
|
|
274
|
+
...c
|
|
275
275
|
}) => {
|
|
276
|
-
const
|
|
276
|
+
const i = d || l, o = [
|
|
277
277
|
"inline-flex items-center justify-center font-normal transition duration-150",
|
|
278
|
-
me[
|
|
279
|
-
xe[
|
|
278
|
+
me[r],
|
|
279
|
+
xe[n],
|
|
280
280
|
he[s],
|
|
281
281
|
s === "flat" ? "shadow-none" : "shadow-sm",
|
|
282
|
-
|
|
282
|
+
i ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
283
283
|
u
|
|
284
284
|
].filter(Boolean).join(" ");
|
|
285
|
-
return /* @__PURE__ */
|
|
286
|
-
|
|
285
|
+
return /* @__PURE__ */ v("button", { type: t, className: o, disabled: i, ...c, children: [
|
|
286
|
+
l && /* @__PURE__ */ v(
|
|
287
287
|
"svg",
|
|
288
288
|
{
|
|
289
289
|
"aria-hidden": "true",
|
|
@@ -293,14 +293,14 @@ const me = {
|
|
|
293
293
|
fill: "none",
|
|
294
294
|
xmlns: "http://www.w3.org/2000/svg",
|
|
295
295
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ a(
|
|
297
297
|
"path",
|
|
298
298
|
{
|
|
299
299
|
d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
|
|
300
300
|
fill: "currentColor"
|
|
301
301
|
}
|
|
302
302
|
),
|
|
303
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ a(
|
|
304
304
|
"path",
|
|
305
305
|
{
|
|
306
306
|
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
@@ -312,31 +312,224 @@ const me = {
|
|
|
312
312
|
),
|
|
313
313
|
e
|
|
314
314
|
] });
|
|
315
|
-
}
|
|
315
|
+
};
|
|
316
|
+
var V = {
|
|
317
|
+
color: void 0,
|
|
318
|
+
size: void 0,
|
|
319
|
+
className: void 0,
|
|
320
|
+
style: void 0,
|
|
321
|
+
attr: void 0
|
|
322
|
+
}, q = A.createContext && /* @__PURE__ */ A.createContext(V), ye = ["attr", "size", "title"];
|
|
323
|
+
function we(e, r) {
|
|
324
|
+
if (e == null) return {};
|
|
325
|
+
var n = ve(e, r), t, s;
|
|
326
|
+
if (Object.getOwnPropertySymbols) {
|
|
327
|
+
var u = Object.getOwnPropertySymbols(e);
|
|
328
|
+
for (s = 0; s < u.length; s++)
|
|
329
|
+
t = u[s], !(r.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (n[t] = e[t]);
|
|
330
|
+
}
|
|
331
|
+
return n;
|
|
332
|
+
}
|
|
333
|
+
function ve(e, r) {
|
|
334
|
+
if (e == null) return {};
|
|
335
|
+
var n = {};
|
|
336
|
+
for (var t in e)
|
|
337
|
+
if (Object.prototype.hasOwnProperty.call(e, t)) {
|
|
338
|
+
if (r.indexOf(t) >= 0) continue;
|
|
339
|
+
n[t] = e[t];
|
|
340
|
+
}
|
|
341
|
+
return n;
|
|
342
|
+
}
|
|
343
|
+
function B() {
|
|
344
|
+
return B = Object.assign ? Object.assign.bind() : function(e) {
|
|
345
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
346
|
+
var n = arguments[r];
|
|
347
|
+
for (var t in n)
|
|
348
|
+
Object.prototype.hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
349
|
+
}
|
|
350
|
+
return e;
|
|
351
|
+
}, B.apply(this, arguments);
|
|
352
|
+
}
|
|
353
|
+
function X(e, r) {
|
|
354
|
+
var n = Object.keys(e);
|
|
355
|
+
if (Object.getOwnPropertySymbols) {
|
|
356
|
+
var t = Object.getOwnPropertySymbols(e);
|
|
357
|
+
r && (t = t.filter(function(s) {
|
|
358
|
+
return Object.getOwnPropertyDescriptor(e, s).enumerable;
|
|
359
|
+
})), n.push.apply(n, t);
|
|
360
|
+
}
|
|
361
|
+
return n;
|
|
362
|
+
}
|
|
363
|
+
function F(e) {
|
|
364
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
365
|
+
var n = arguments[r] != null ? arguments[r] : {};
|
|
366
|
+
r % 2 ? X(Object(n), !0).forEach(function(t) {
|
|
367
|
+
Ce(e, t, n[t]);
|
|
368
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : X(Object(n)).forEach(function(t) {
|
|
369
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
return e;
|
|
373
|
+
}
|
|
374
|
+
function Ce(e, r, n) {
|
|
375
|
+
return r = ke(r), r in e ? Object.defineProperty(e, r, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = n, e;
|
|
376
|
+
}
|
|
377
|
+
function ke(e) {
|
|
378
|
+
var r = Ne(e, "string");
|
|
379
|
+
return typeof r == "symbol" ? r : r + "";
|
|
380
|
+
}
|
|
381
|
+
function Ne(e, r) {
|
|
382
|
+
if (typeof e != "object" || !e) return e;
|
|
383
|
+
var n = e[Symbol.toPrimitive];
|
|
384
|
+
if (n !== void 0) {
|
|
385
|
+
var t = n.call(e, r);
|
|
386
|
+
if (typeof t != "object") return t;
|
|
387
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
388
|
+
}
|
|
389
|
+
return (r === "string" ? String : Number)(e);
|
|
390
|
+
}
|
|
391
|
+
function ee(e) {
|
|
392
|
+
return e && e.map((r, n) => /* @__PURE__ */ A.createElement(r.tag, F({
|
|
393
|
+
key: n
|
|
394
|
+
}, r.attr), ee(r.child)));
|
|
395
|
+
}
|
|
396
|
+
function Z(e) {
|
|
397
|
+
return (r) => /* @__PURE__ */ A.createElement(Se, B({
|
|
398
|
+
attr: F({}, e.attr)
|
|
399
|
+
}, r), ee(e.child));
|
|
400
|
+
}
|
|
401
|
+
function Se(e) {
|
|
402
|
+
var r = (n) => {
|
|
403
|
+
var {
|
|
404
|
+
attr: t,
|
|
405
|
+
size: s,
|
|
406
|
+
title: u
|
|
407
|
+
} = e, l = we(e, ye), d = s || n.size || "1em", c;
|
|
408
|
+
return n.className && (c = n.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ A.createElement("svg", B({
|
|
409
|
+
stroke: "currentColor",
|
|
410
|
+
fill: "currentColor",
|
|
411
|
+
strokeWidth: "0"
|
|
412
|
+
}, n.attr, t, l, {
|
|
413
|
+
className: c,
|
|
414
|
+
style: F(F({
|
|
415
|
+
color: e.color || n.color
|
|
416
|
+
}, n.style), e.style),
|
|
417
|
+
height: d,
|
|
418
|
+
width: d,
|
|
419
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
420
|
+
}), u && /* @__PURE__ */ A.createElement("title", null, u), e.children);
|
|
421
|
+
};
|
|
422
|
+
return q !== void 0 ? /* @__PURE__ */ A.createElement(q.Consumer, null, (n) => r(n)) : r(V);
|
|
423
|
+
}
|
|
424
|
+
function $e(e) {
|
|
425
|
+
return Z({ 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);
|
|
426
|
+
}
|
|
427
|
+
const Ee = {
|
|
428
|
+
xs: "w-3 h-3 text-[10px]",
|
|
429
|
+
sm: "w-4 h-4 text-xs",
|
|
430
|
+
md: "w-5 h-5 text-sm",
|
|
431
|
+
lg: "w-6 h-6 text-base"
|
|
432
|
+
}, Le = {
|
|
433
|
+
flat: "rounded-none",
|
|
434
|
+
rounded: "rounded-md",
|
|
435
|
+
pill: "rounded-full"
|
|
436
|
+
}, Oe = {
|
|
437
|
+
primary: "btn-primary",
|
|
438
|
+
secondary: "btn-secondary",
|
|
439
|
+
success: "btn-success",
|
|
440
|
+
danger: "btn-danger",
|
|
441
|
+
warning: "btn-warning",
|
|
442
|
+
info: "btn-info",
|
|
443
|
+
dark: "btn-dark",
|
|
444
|
+
light: "btn-light",
|
|
445
|
+
link: "btn-link",
|
|
446
|
+
"outline-primary": "btn-outline-primary",
|
|
447
|
+
"outline-secondary": "btn-outline-secondary",
|
|
448
|
+
"outline-success": "btn-outline-success",
|
|
449
|
+
"outline-danger": "btn-outline-danger",
|
|
450
|
+
"outline-warning": "btn-outline-warning",
|
|
451
|
+
"outline-info": "btn-outline-info",
|
|
452
|
+
"outline-dark": "btn-outline-dark",
|
|
453
|
+
"outline-light": "btn-outline-light",
|
|
454
|
+
"soft-primary": "btn-soft-primary",
|
|
455
|
+
"soft-secondary": "btn-soft-secondary",
|
|
456
|
+
"soft-success": "btn-soft-success",
|
|
457
|
+
"soft-danger": "btn-soft-danger",
|
|
458
|
+
"soft-warning": "btn-soft-warning",
|
|
459
|
+
"soft-info": "btn-soft-info",
|
|
460
|
+
"soft-dark": "btn-soft-dark",
|
|
461
|
+
"soft-light": "btn-soft-light"
|
|
462
|
+
}, He = ({
|
|
316
463
|
label: e,
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
464
|
+
boxSize: r = "md",
|
|
465
|
+
shape: n = "rounded",
|
|
466
|
+
variant: t = "success",
|
|
467
|
+
checked: s = !1,
|
|
468
|
+
onSelectionChange: u,
|
|
469
|
+
disabled: l = !1,
|
|
470
|
+
className: d = "",
|
|
471
|
+
id: c,
|
|
472
|
+
value: i,
|
|
473
|
+
icon: o,
|
|
474
|
+
children: f,
|
|
475
|
+
...p
|
|
476
|
+
}) => {
|
|
477
|
+
const b = (E) => {
|
|
478
|
+
!l && u && u(E.target.checked);
|
|
479
|
+
}, g = "mr-2 border flex items-center justify-center transition-all", m = Ee[r], w = Le[n], h = Oe[t] ?? "", N = t.startsWith("outline"), S = t.startsWith("soft"), x = `${g} ${m} ${w} ${h} ${s && (N || S || t === "link") ? "peer-checked:bg-current peer-checked:text-white" : s ? "peer-checked:bg-current" : ""}`, $ = {
|
|
480
|
+
xs: "w-2 h-2",
|
|
481
|
+
sm: "w-2.5 h-2.5",
|
|
482
|
+
md: "w-3 h-3",
|
|
483
|
+
lg: "w-3.5 h-3.5"
|
|
484
|
+
};
|
|
485
|
+
return /* @__PURE__ */ v(
|
|
486
|
+
"label",
|
|
487
|
+
{
|
|
488
|
+
className: `flex items-center ${l ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} me-4 ${d}`,
|
|
489
|
+
children: [
|
|
490
|
+
/* @__PURE__ */ a(
|
|
491
|
+
"input",
|
|
492
|
+
{
|
|
493
|
+
type: "checkbox",
|
|
494
|
+
className: "peer hidden",
|
|
495
|
+
checked: s,
|
|
496
|
+
onChange: b,
|
|
497
|
+
disabled: l,
|
|
498
|
+
id: c,
|
|
499
|
+
value: i,
|
|
500
|
+
...p
|
|
501
|
+
}
|
|
502
|
+
),
|
|
503
|
+
/* @__PURE__ */ a("span", { className: x.trim(), children: s && (o ?? /* @__PURE__ */ a($e, { className: `text-white ${$[r]}` })) }),
|
|
504
|
+
e || f ? /* @__PURE__ */ a("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-300", children: e ?? f }) : null
|
|
505
|
+
]
|
|
506
|
+
}
|
|
507
|
+
);
|
|
508
|
+
}, We = ({
|
|
509
|
+
label: e,
|
|
510
|
+
header: r,
|
|
511
|
+
items: n = [],
|
|
512
|
+
onSelect: t,
|
|
320
513
|
renderItem: s,
|
|
321
514
|
position: u = "right",
|
|
322
|
-
className:
|
|
515
|
+
className: l = "",
|
|
323
516
|
menuClassName: d = "",
|
|
324
|
-
width:
|
|
325
|
-
closeOnSelect:
|
|
517
|
+
width: c = "w-48",
|
|
518
|
+
closeOnSelect: i = !1,
|
|
326
519
|
transition: o = !0,
|
|
327
520
|
ariaLabel: f = "Dropdown menu",
|
|
328
521
|
...p
|
|
329
522
|
}) => {
|
|
330
|
-
const [b, g] = I(!1), [m,
|
|
523
|
+
const [b, g] = I(!1), [m, w] = I(!1), h = _(null), N = _(null), S = P(() => ({
|
|
331
524
|
left: "left-0",
|
|
332
525
|
center: "left-1/2 transform -translate-x-1/2",
|
|
333
526
|
right: "right-0"
|
|
334
527
|
})[u], [u]), C = j(() => {
|
|
335
528
|
const y = N.current, L = h.current;
|
|
336
529
|
if (!y || !L) return;
|
|
337
|
-
const { top: O, bottom: M } = y.getBoundingClientRect(), D = L.offsetHeight,
|
|
338
|
-
|
|
339
|
-
}, []),
|
|
530
|
+
const { top: O, bottom: M } = y.getBoundingClientRect(), D = L.offsetHeight, z = window.innerHeight - M, R = O;
|
|
531
|
+
w(z < D && R > D);
|
|
532
|
+
}, []), k = j((y) => {
|
|
340
533
|
var L, O;
|
|
341
534
|
!((L = h.current) != null && L.contains(y.target)) && !((O = N.current) != null && O.contains(y.target)) && g(!1);
|
|
342
535
|
}, []), x = j(() => g((y) => !y), []), $ = j(() => g(!1), []);
|
|
@@ -345,38 +538,37 @@ const me = {
|
|
|
345
538
|
return C(), window.addEventListener("resize", C), window.addEventListener("scroll", C, !0), () => {
|
|
346
539
|
window.removeEventListener("resize", C), window.removeEventListener("scroll", C, !0);
|
|
347
540
|
};
|
|
348
|
-
}, [b, C]), T(() => (document.addEventListener("mousedown",
|
|
541
|
+
}, [b, C]), T(() => (document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k)), [k]);
|
|
349
542
|
const E = P(
|
|
350
543
|
() => [
|
|
351
544
|
"absolute z-50 bg-white rounded shadow-lg overflow-hidden",
|
|
352
545
|
m ? "bottom-full mb-2" : "top-full mt-2",
|
|
353
|
-
|
|
354
|
-
|
|
546
|
+
S,
|
|
547
|
+
c,
|
|
355
548
|
o && "transition-all duration-200 ease-out",
|
|
356
549
|
d
|
|
357
550
|
].filter(Boolean).join(" "),
|
|
358
|
-
[m,
|
|
551
|
+
[m, S, c, o, d]
|
|
359
552
|
);
|
|
360
|
-
return /* @__PURE__ */
|
|
361
|
-
/* @__PURE__ */
|
|
553
|
+
return /* @__PURE__ */ v("div", { className: `relative inline-block ${l}`, ...p, children: [
|
|
554
|
+
/* @__PURE__ */ a(
|
|
362
555
|
"button",
|
|
363
556
|
{
|
|
364
557
|
ref: N,
|
|
365
558
|
onClick: x,
|
|
366
|
-
"aria-haspopup": "true",
|
|
367
559
|
"aria-expanded": b,
|
|
368
560
|
"aria-label": f,
|
|
369
561
|
className: "focus:outline-none",
|
|
370
562
|
children: e
|
|
371
563
|
}
|
|
372
564
|
),
|
|
373
|
-
b && /* @__PURE__ */
|
|
374
|
-
|
|
375
|
-
|
|
565
|
+
b && /* @__PURE__ */ v("div", { ref: h, role: "menu", className: E, children: [
|
|
566
|
+
r && r,
|
|
567
|
+
n.map((y, L) => {
|
|
376
568
|
const O = () => {
|
|
377
|
-
|
|
569
|
+
t && t(y), i && $();
|
|
378
570
|
};
|
|
379
|
-
return /* @__PURE__ */
|
|
571
|
+
return /* @__PURE__ */ a("div", { children: s ? s(y, O) : /* @__PURE__ */ a(
|
|
380
572
|
"div",
|
|
381
573
|
{
|
|
382
574
|
onClick: O,
|
|
@@ -388,28 +580,28 @@ const me = {
|
|
|
388
580
|
})
|
|
389
581
|
] })
|
|
390
582
|
] });
|
|
391
|
-
},
|
|
583
|
+
}, Ze = ({
|
|
392
584
|
children: e,
|
|
393
|
-
content:
|
|
394
|
-
position:
|
|
395
|
-
className:
|
|
585
|
+
content: r,
|
|
586
|
+
position: n = "top",
|
|
587
|
+
className: t = "",
|
|
396
588
|
tooltipClass: s = "",
|
|
397
589
|
tooltipStyle: u = {}
|
|
398
590
|
}) => {
|
|
399
|
-
const
|
|
591
|
+
const l = _(null), d = _(null);
|
|
400
592
|
T(() => {
|
|
401
|
-
const
|
|
402
|
-
if (!
|
|
593
|
+
const i = l.current, o = d.current;
|
|
594
|
+
if (!i || !o) return;
|
|
403
595
|
const f = () => {
|
|
404
596
|
o.style.opacity = "1", o.style.visibility = "visible";
|
|
405
597
|
}, p = () => {
|
|
406
598
|
o.style.opacity = "0", o.style.visibility = "hidden";
|
|
407
599
|
};
|
|
408
|
-
return
|
|
409
|
-
|
|
600
|
+
return i.addEventListener("mouseenter", f), i.addEventListener("mouseleave", p), () => {
|
|
601
|
+
i.removeEventListener("mouseenter", f), i.removeEventListener("mouseleave", p);
|
|
410
602
|
};
|
|
411
603
|
}, []);
|
|
412
|
-
const
|
|
604
|
+
const c = (i) => {
|
|
413
605
|
const o = {
|
|
414
606
|
position: "absolute",
|
|
415
607
|
opacity: 0,
|
|
@@ -427,7 +619,7 @@ const me = {
|
|
|
427
619
|
zIndex: 9999,
|
|
428
620
|
width: "max-content"
|
|
429
621
|
};
|
|
430
|
-
switch (
|
|
622
|
+
switch (i) {
|
|
431
623
|
case "top":
|
|
432
624
|
return {
|
|
433
625
|
...o,
|
|
@@ -464,23 +656,23 @@ const me = {
|
|
|
464
656
|
return o;
|
|
465
657
|
}
|
|
466
658
|
};
|
|
467
|
-
return /* @__PURE__ */
|
|
659
|
+
return /* @__PURE__ */ v("div", { ref: l, className: `relative inline-block ${t}`, children: [
|
|
468
660
|
e,
|
|
469
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ a(
|
|
470
662
|
"div",
|
|
471
663
|
{
|
|
472
664
|
ref: d,
|
|
473
665
|
role: "tooltip",
|
|
474
666
|
className: s,
|
|
475
667
|
style: {
|
|
476
|
-
...
|
|
668
|
+
...c(n),
|
|
477
669
|
...u
|
|
478
670
|
},
|
|
479
|
-
children:
|
|
671
|
+
children: r
|
|
480
672
|
}
|
|
481
673
|
)
|
|
482
674
|
] });
|
|
483
|
-
},
|
|
675
|
+
}, Pe = {
|
|
484
676
|
primary: "bg-blue-500 text-white",
|
|
485
677
|
secondary: "bg-gray-500 text-white",
|
|
486
678
|
success: "bg-green-500 text-white",
|
|
@@ -498,209 +690,101 @@ const me = {
|
|
|
498
690
|
"outline-info": "border border-cyan-500 text-cyan-500 bg-transparent",
|
|
499
691
|
"outline-dark": "border border-black text-black bg-transparent",
|
|
500
692
|
"outline-light": "border border-gray-100 text-gray-800 bg-transparent"
|
|
501
|
-
},
|
|
693
|
+
}, je = {
|
|
502
694
|
xs: "text-xs px-2 py-0.5",
|
|
503
695
|
sm: "text-sm px-2.5 py-0.5",
|
|
504
696
|
md: "text-base px-3 py-1",
|
|
505
697
|
lg: "text-lg px-3.5 py-1.5",
|
|
506
698
|
xl: "text-xl px-4 py-2"
|
|
507
|
-
},
|
|
699
|
+
}, Ie = {
|
|
508
700
|
flat: "rounded-none",
|
|
509
701
|
rounded: "rounded-sm",
|
|
510
702
|
pill: "rounded-full",
|
|
511
703
|
circle: "rounded-full p-2 w-8 h-8 justify-center"
|
|
512
|
-
},
|
|
704
|
+
}, Ge = ({
|
|
513
705
|
label: e,
|
|
514
|
-
variant:
|
|
515
|
-
size:
|
|
516
|
-
shape:
|
|
706
|
+
variant: r = "primary",
|
|
707
|
+
size: n = "sm",
|
|
708
|
+
shape: t = "rounded",
|
|
517
709
|
icon: s,
|
|
518
710
|
dismissible: u,
|
|
519
|
-
onDismiss:
|
|
711
|
+
onDismiss: l,
|
|
520
712
|
className: d = "",
|
|
521
|
-
...
|
|
713
|
+
...c
|
|
522
714
|
}) => {
|
|
523
|
-
const
|
|
524
|
-
return /* @__PURE__ */
|
|
525
|
-
s && /* @__PURE__ */
|
|
715
|
+
const i = !e && !!s, o = `inline-flex items-center font-medium ${Pe[r] || ""} ${je[n] || ""} ${Ie[t] || ""} ${i ? "justify-center p-2 w-8 h-8" : ""} ` + d;
|
|
716
|
+
return /* @__PURE__ */ v("span", { className: o.trim(), ...c, children: [
|
|
717
|
+
s && /* @__PURE__ */ a("span", { className: e ? "mr-1" : "", children: s }),
|
|
526
718
|
e,
|
|
527
|
-
u && /* @__PURE__ */
|
|
719
|
+
u && /* @__PURE__ */ a(
|
|
528
720
|
"button",
|
|
529
721
|
{
|
|
530
722
|
type: "button",
|
|
531
|
-
onClick:
|
|
723
|
+
onClick: l,
|
|
532
724
|
className: "ml-2 text-xs font-bold leading-none focus:outline-none",
|
|
533
725
|
children: "×"
|
|
534
726
|
}
|
|
535
727
|
)
|
|
536
728
|
] });
|
|
537
729
|
};
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
size: void 0,
|
|
541
|
-
className: void 0,
|
|
542
|
-
style: void 0,
|
|
543
|
-
attr: void 0
|
|
544
|
-
}, U = z.createContext && /* @__PURE__ */ z.createContext(Q), Ce = ["attr", "size", "title"];
|
|
545
|
-
function Se(e, n) {
|
|
546
|
-
if (e == null) return {};
|
|
547
|
-
var t = Ne(e, n), r, s;
|
|
548
|
-
if (Object.getOwnPropertySymbols) {
|
|
549
|
-
var u = Object.getOwnPropertySymbols(e);
|
|
550
|
-
for (s = 0; s < u.length; s++)
|
|
551
|
-
r = u[s], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
552
|
-
}
|
|
553
|
-
return t;
|
|
554
|
-
}
|
|
555
|
-
function Ne(e, n) {
|
|
556
|
-
if (e == null) return {};
|
|
557
|
-
var t = {};
|
|
558
|
-
for (var r in e)
|
|
559
|
-
if (Object.prototype.hasOwnProperty.call(e, r)) {
|
|
560
|
-
if (n.indexOf(r) >= 0) continue;
|
|
561
|
-
t[r] = e[r];
|
|
562
|
-
}
|
|
563
|
-
return t;
|
|
564
|
-
}
|
|
565
|
-
function B() {
|
|
566
|
-
return B = Object.assign ? Object.assign.bind() : function(e) {
|
|
567
|
-
for (var n = 1; n < arguments.length; n++) {
|
|
568
|
-
var t = arguments[n];
|
|
569
|
-
for (var r in t)
|
|
570
|
-
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
571
|
-
}
|
|
572
|
-
return e;
|
|
573
|
-
}, B.apply(this, arguments);
|
|
574
|
-
}
|
|
575
|
-
function q(e, n) {
|
|
576
|
-
var t = Object.keys(e);
|
|
577
|
-
if (Object.getOwnPropertySymbols) {
|
|
578
|
-
var r = Object.getOwnPropertySymbols(e);
|
|
579
|
-
n && (r = r.filter(function(s) {
|
|
580
|
-
return Object.getOwnPropertyDescriptor(e, s).enumerable;
|
|
581
|
-
})), t.push.apply(t, r);
|
|
582
|
-
}
|
|
583
|
-
return t;
|
|
584
|
-
}
|
|
585
|
-
function F(e) {
|
|
586
|
-
for (var n = 1; n < arguments.length; n++) {
|
|
587
|
-
var t = arguments[n] != null ? arguments[n] : {};
|
|
588
|
-
n % 2 ? q(Object(t), !0).forEach(function(r) {
|
|
589
|
-
ke(e, r, t[r]);
|
|
590
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : q(Object(t)).forEach(function(r) {
|
|
591
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
return e;
|
|
595
|
-
}
|
|
596
|
-
function ke(e, n, t) {
|
|
597
|
-
return n = $e(n), n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
|
|
598
|
-
}
|
|
599
|
-
function $e(e) {
|
|
600
|
-
var n = Ee(e, "string");
|
|
601
|
-
return typeof n == "symbol" ? n : n + "";
|
|
602
|
-
}
|
|
603
|
-
function Ee(e, n) {
|
|
604
|
-
if (typeof e != "object" || !e) return e;
|
|
605
|
-
var t = e[Symbol.toPrimitive];
|
|
606
|
-
if (t !== void 0) {
|
|
607
|
-
var r = t.call(e, n);
|
|
608
|
-
if (typeof r != "object") return r;
|
|
609
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
610
|
-
}
|
|
611
|
-
return (n === "string" ? String : Number)(e);
|
|
612
|
-
}
|
|
613
|
-
function V(e) {
|
|
614
|
-
return e && e.map((n, t) => /* @__PURE__ */ z.createElement(n.tag, F({
|
|
615
|
-
key: t
|
|
616
|
-
}, n.attr), V(n.child)));
|
|
617
|
-
}
|
|
618
|
-
function ee(e) {
|
|
619
|
-
return (n) => /* @__PURE__ */ z.createElement(Le, B({
|
|
620
|
-
attr: F({}, e.attr)
|
|
621
|
-
}, n), V(e.child));
|
|
622
|
-
}
|
|
623
|
-
function Le(e) {
|
|
624
|
-
var n = (t) => {
|
|
625
|
-
var {
|
|
626
|
-
attr: r,
|
|
627
|
-
size: s,
|
|
628
|
-
title: u
|
|
629
|
-
} = e, c = Se(e, Ce), d = s || t.size || "1em", l;
|
|
630
|
-
return t.className && (l = t.className), e.className && (l = (l ? l + " " : "") + e.className), /* @__PURE__ */ z.createElement("svg", B({
|
|
631
|
-
stroke: "currentColor",
|
|
632
|
-
fill: "currentColor",
|
|
633
|
-
strokeWidth: "0"
|
|
634
|
-
}, t.attr, r, c, {
|
|
635
|
-
className: l,
|
|
636
|
-
style: F(F({
|
|
637
|
-
color: e.color || t.color
|
|
638
|
-
}, t.style), e.style),
|
|
639
|
-
height: d,
|
|
640
|
-
width: d,
|
|
641
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
642
|
-
}), u && /* @__PURE__ */ z.createElement("title", null, u), e.children);
|
|
643
|
-
};
|
|
644
|
-
return U !== void 0 ? /* @__PURE__ */ z.createElement(U.Consumer, null, (t) => n(t)) : n(Q);
|
|
645
|
-
}
|
|
646
|
-
function Oe(e) {
|
|
647
|
-
return ee({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z" }, child: [] }] })(e);
|
|
730
|
+
function ze(e) {
|
|
731
|
+
return Z({ 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);
|
|
648
732
|
}
|
|
649
|
-
const
|
|
733
|
+
const Ke = ({
|
|
650
734
|
items: e,
|
|
651
|
-
allowMultipleOpen:
|
|
652
|
-
className:
|
|
653
|
-
tileClasses:
|
|
735
|
+
allowMultipleOpen: r = !1,
|
|
736
|
+
className: n = "",
|
|
737
|
+
tileClasses: t = "",
|
|
654
738
|
open: s,
|
|
655
739
|
onChange: u,
|
|
656
|
-
renderTitle:
|
|
740
|
+
renderTitle: l,
|
|
657
741
|
renderContent: d,
|
|
658
|
-
showArrowIcon:
|
|
659
|
-
panelClasses:
|
|
742
|
+
showArrowIcon: c = !0,
|
|
743
|
+
panelClasses: i = ""
|
|
660
744
|
}) => {
|
|
661
745
|
const [o, f] = I(/* @__PURE__ */ new Set()), p = P(() => s ? new Set(s) : o, [s, o]), b = j(
|
|
662
746
|
(g) => {
|
|
663
747
|
const m = new Set(p);
|
|
664
|
-
m.has(g) ? m.delete(g) : (
|
|
748
|
+
m.has(g) ? m.delete(g) : (r || m.clear(), m.add(g)), s && u ? u(Array.from(m)) : f(m);
|
|
665
749
|
},
|
|
666
|
-
[p, s, u,
|
|
750
|
+
[p, s, u, r]
|
|
667
751
|
);
|
|
668
|
-
return /* @__PURE__ */
|
|
752
|
+
return /* @__PURE__ */ a(
|
|
669
753
|
"div",
|
|
670
754
|
{
|
|
671
755
|
className: "accordion",
|
|
672
756
|
role: "region",
|
|
673
|
-
"aria-multiselectable":
|
|
757
|
+
"aria-multiselectable": r,
|
|
674
758
|
children: e.map((g) => {
|
|
675
|
-
const m = p.has(g.id),
|
|
676
|
-
return /* @__PURE__ */
|
|
759
|
+
const m = p.has(g.id), w = `accordion-heading-${g.id}`, h = `accordion-panel-${g.id}`;
|
|
760
|
+
return /* @__PURE__ */ v(
|
|
677
761
|
"div",
|
|
678
762
|
{
|
|
679
|
-
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${
|
|
763
|
+
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${n}`,
|
|
680
764
|
children: [
|
|
681
|
-
/* @__PURE__ */
|
|
765
|
+
/* @__PURE__ */ v(
|
|
682
766
|
"button",
|
|
683
767
|
{
|
|
684
|
-
id:
|
|
768
|
+
id: w,
|
|
685
769
|
type: "button",
|
|
686
770
|
"aria-expanded": m,
|
|
687
771
|
"aria-controls": h,
|
|
688
772
|
onClick: () => b(g.id),
|
|
689
|
-
className: `flex justify-between items-center w-full p-1.5 text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3 ${
|
|
773
|
+
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}`,
|
|
690
774
|
children: [
|
|
691
|
-
|
|
692
|
-
|
|
775
|
+
l ? l(g, m) : g.title,
|
|
776
|
+
c ? /* @__PURE__ */ a(ze, {}) : null
|
|
693
777
|
]
|
|
694
778
|
}
|
|
695
779
|
),
|
|
696
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ a(
|
|
697
781
|
"div",
|
|
698
782
|
{
|
|
699
783
|
id: h,
|
|
700
784
|
role: "region",
|
|
701
|
-
"aria-labelledby":
|
|
785
|
+
"aria-labelledby": w,
|
|
702
786
|
hidden: !m,
|
|
703
|
-
className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${
|
|
787
|
+
className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${i}`,
|
|
704
788
|
children: d ? d(g, m) : g.content
|
|
705
789
|
}
|
|
706
790
|
)
|
|
@@ -711,29 +795,29 @@ const Re = ({
|
|
|
711
795
|
})
|
|
712
796
|
}
|
|
713
797
|
);
|
|
714
|
-
}, te =
|
|
715
|
-
const e =
|
|
798
|
+
}, te = J(null), ne = () => {
|
|
799
|
+
const e = Q(te);
|
|
716
800
|
if (!e)
|
|
717
801
|
throw new Error(
|
|
718
802
|
"useModalActions must be used within a ModalActionProvider"
|
|
719
803
|
);
|
|
720
804
|
return e;
|
|
721
|
-
},
|
|
722
|
-
function
|
|
805
|
+
}, re = J(null), se = () => Q(re);
|
|
806
|
+
function Ue({
|
|
723
807
|
id: e,
|
|
724
|
-
title:
|
|
725
|
-
children:
|
|
726
|
-
standalone:
|
|
808
|
+
title: r,
|
|
809
|
+
children: n,
|
|
810
|
+
standalone: t = !1,
|
|
727
811
|
showFloatingClose: s = !1,
|
|
728
812
|
containerClasses: u = "",
|
|
729
|
-
onClose:
|
|
813
|
+
onClose: l,
|
|
730
814
|
disableEscapeClose: d = !1
|
|
731
815
|
}) {
|
|
732
|
-
const
|
|
733
|
-
o ?
|
|
734
|
-
}, [o,
|
|
816
|
+
const c = se(), i = ne(), o = !t && !!c && !!i, [f, p] = I(!1), b = o ? c.isOpen(e) : f, g = o ? c.getModalData(e) : null, m = j(() => {
|
|
817
|
+
o ? i.closeModal(e) : p(!1), l == null || l();
|
|
818
|
+
}, [o, i, e, l]);
|
|
735
819
|
return T(() => {
|
|
736
|
-
const
|
|
820
|
+
const w = document.activeElement;
|
|
737
821
|
console.log(e);
|
|
738
822
|
const h = document.getElementById(e);
|
|
739
823
|
console.log("modalEl=", h);
|
|
@@ -744,7 +828,7 @@ function He({
|
|
|
744
828
|
"input:not([disabled])",
|
|
745
829
|
"select:not([disabled])",
|
|
746
830
|
'[tabindex]:not([tabindex="-1"])'
|
|
747
|
-
],
|
|
831
|
+
], S = () => {
|
|
748
832
|
if (!h) return [];
|
|
749
833
|
const x = h.querySelectorAll(
|
|
750
834
|
N.join(",")
|
|
@@ -752,33 +836,33 @@ function He({
|
|
|
752
836
|
return Array.from(x).filter(($) => $.offsetParent !== null);
|
|
753
837
|
}, C = (x) => {
|
|
754
838
|
if (x.key === "Tab") {
|
|
755
|
-
const $ =
|
|
839
|
+
const $ = S();
|
|
756
840
|
if ($.length === 0) return;
|
|
757
841
|
const E = $[0], y = $[$.length - 1];
|
|
758
842
|
x.shiftKey ? document.activeElement === E && (x.preventDefault(), y.focus()) : document.activeElement === y && (x.preventDefault(), E.focus());
|
|
759
843
|
}
|
|
760
|
-
},
|
|
844
|
+
}, k = (x) => {
|
|
761
845
|
x.key === "Escape" && !d && m(), C(x);
|
|
762
846
|
};
|
|
763
847
|
return b && (document.body.style.overflow = "hidden", setTimeout(() => {
|
|
764
|
-
const x =
|
|
848
|
+
const x = S();
|
|
765
849
|
x.length && x[0].focus();
|
|
766
|
-
}, 0), window.addEventListener("keydown",
|
|
767
|
-
document.body.style.overflow = "",
|
|
850
|
+
}, 0), window.addEventListener("keydown", k)), () => {
|
|
851
|
+
document.body.style.overflow = "", w && w.focus(), window.removeEventListener("keydown", k);
|
|
768
852
|
};
|
|
769
|
-
}, [b, d, m, e]), b ? /* @__PURE__ */
|
|
853
|
+
}, [b, d, m, e]), b ? /* @__PURE__ */ a(
|
|
770
854
|
"div",
|
|
771
855
|
{
|
|
772
856
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",
|
|
773
857
|
id: e,
|
|
774
|
-
children: /* @__PURE__ */
|
|
858
|
+
children: /* @__PURE__ */ v(
|
|
775
859
|
"div",
|
|
776
860
|
{
|
|
777
861
|
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${u}`,
|
|
778
862
|
children: [
|
|
779
|
-
/* @__PURE__ */
|
|
780
|
-
|
|
781
|
-
s && /* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ v("div", { className: "flex justify-between items-center relative", children: [
|
|
864
|
+
r && /* @__PURE__ */ a("h2", { className: "text-lg font-semibold", children: r }),
|
|
865
|
+
s && /* @__PURE__ */ a(
|
|
782
866
|
"button",
|
|
783
867
|
{
|
|
784
868
|
onClick: m,
|
|
@@ -788,104 +872,104 @@ function He({
|
|
|
788
872
|
}
|
|
789
873
|
)
|
|
790
874
|
] }),
|
|
791
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ a("div", { className: "mt-3 text-sm text-gray-700", children: typeof n == "function" ? n({ modalData: g }) : n })
|
|
792
876
|
]
|
|
793
877
|
}
|
|
794
878
|
)
|
|
795
879
|
}
|
|
796
880
|
) : null;
|
|
797
881
|
}
|
|
798
|
-
function
|
|
882
|
+
function qe({
|
|
799
883
|
children: e
|
|
800
884
|
}) {
|
|
801
|
-
const [
|
|
802
|
-
|
|
803
|
-
}, []),
|
|
804
|
-
|
|
885
|
+
const [r, n] = I({}), [t, s] = I({}), u = j((f, p) => {
|
|
886
|
+
n((b) => ({ ...b, [f]: !0 })), p && s((b) => ({ ...b, [f]: p }));
|
|
887
|
+
}, []), l = j((f) => {
|
|
888
|
+
n((p) => ({ ...p, [f]: !1 })), s((p) => {
|
|
805
889
|
const b = { ...p };
|
|
806
890
|
return delete b[f], b;
|
|
807
891
|
});
|
|
808
|
-
}, []), d = j((f) => !!
|
|
809
|
-
(f) =>
|
|
810
|
-
[
|
|
811
|
-
),
|
|
812
|
-
() => ({ openModal: u, closeModal:
|
|
813
|
-
[u,
|
|
892
|
+
}, []), d = j((f) => !!r[f], [r]), c = j(
|
|
893
|
+
(f) => t[f],
|
|
894
|
+
[t]
|
|
895
|
+
), i = P(
|
|
896
|
+
() => ({ openModal: u, closeModal: l }),
|
|
897
|
+
[u, l]
|
|
814
898
|
), o = P(
|
|
815
|
-
() => ({ isOpen: d, getModalData:
|
|
816
|
-
[d,
|
|
899
|
+
() => ({ isOpen: d, getModalData: c }),
|
|
900
|
+
[d, c]
|
|
817
901
|
);
|
|
818
|
-
return /* @__PURE__ */
|
|
902
|
+
return /* @__PURE__ */ a(te.Provider, { value: i, children: /* @__PURE__ */ a(re.Provider, { value: o, children: e }) });
|
|
819
903
|
}
|
|
820
|
-
function
|
|
821
|
-
const { openModal:
|
|
904
|
+
function Xe(e) {
|
|
905
|
+
const { openModal: r, closeModal: n } = ne(), { isOpen: t, getModalData: s } = se();
|
|
822
906
|
return {
|
|
823
|
-
open: (u) =>
|
|
824
|
-
close: () =>
|
|
825
|
-
isOpen:
|
|
907
|
+
open: (u) => r(e, u),
|
|
908
|
+
close: () => n(e),
|
|
909
|
+
isOpen: t(e),
|
|
826
910
|
data: s(e)
|
|
827
911
|
};
|
|
828
912
|
}
|
|
829
|
-
let H = null,
|
|
830
|
-
function
|
|
913
|
+
let H = null, W = {};
|
|
914
|
+
function Ae(e) {
|
|
831
915
|
H = e;
|
|
832
916
|
}
|
|
833
|
-
function
|
|
834
|
-
|
|
917
|
+
function Ye(e) {
|
|
918
|
+
W = { ...W, ...e };
|
|
835
919
|
}
|
|
836
|
-
function
|
|
837
|
-
return
|
|
920
|
+
function Me() {
|
|
921
|
+
return W;
|
|
838
922
|
}
|
|
839
|
-
function
|
|
840
|
-
H ? H(e, n, t
|
|
923
|
+
function Je(e, r, n = 3e3, t) {
|
|
924
|
+
H ? H(e, r, n, t) : console.warn("Toast system is not mounted");
|
|
841
925
|
}
|
|
842
|
-
function
|
|
843
|
-
return
|
|
926
|
+
function De(e) {
|
|
927
|
+
return Z({ 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);
|
|
844
928
|
}
|
|
845
|
-
const
|
|
846
|
-
const
|
|
847
|
-
return (e === "x" ?
|
|
848
|
-
}),
|
|
849
|
-
const [e,
|
|
929
|
+
const Te = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
930
|
+
const r = Math.random() * 16 | 0;
|
|
931
|
+
return (e === "x" ? r : r & 3 | 8).toString(16);
|
|
932
|
+
}), Qe = () => {
|
|
933
|
+
const [e, r] = I([]);
|
|
850
934
|
T(() => {
|
|
851
|
-
|
|
852
|
-
const d =
|
|
853
|
-
|
|
854
|
-
|
|
935
|
+
Ae((t, s, u, l) => {
|
|
936
|
+
const d = Te();
|
|
937
|
+
r((c) => [...c, { id: d, type: t, message: s, config: l }]), setTimeout(() => {
|
|
938
|
+
r((c) => c.filter((i) => i.id !== d));
|
|
855
939
|
}, u);
|
|
856
940
|
});
|
|
857
941
|
}, []);
|
|
858
|
-
const
|
|
859
|
-
return /* @__PURE__ */
|
|
860
|
-
var
|
|
861
|
-
const s = ((
|
|
862
|
-
return /* @__PURE__ */
|
|
942
|
+
const n = Me();
|
|
943
|
+
return /* @__PURE__ */ a("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((t) => {
|
|
944
|
+
var c, i, o, f, p, b, g, m, w, h, N, S, C;
|
|
945
|
+
const s = ((c = t.config) == null ? void 0 : c.icon) || ((i = n.icons) == null ? void 0 : i[t.type]) || _e(t.type), u = ((o = t.config) == null ? void 0 : o.bgColor) || ((p = (f = n.colors) == null ? void 0 : f[t.type]) == null ? void 0 : p.bg) || "bg-white dark:bg-gray-800", l = ((b = t.config) == null ? void 0 : b.textColor) || ((m = (g = n.colors) == null ? void 0 : g[t.type]) == null ? void 0 : m.text) || "text-gray-700 dark:text-gray-300", d = ((w = t.config) == null ? void 0 : w.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
|
|
946
|
+
return /* @__PURE__ */ v(
|
|
863
947
|
"div",
|
|
864
948
|
{
|
|
865
|
-
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${u} ${
|
|
949
|
+
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${u} ${l}`,
|
|
866
950
|
children: [
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
869
|
-
((h =
|
|
870
|
-
((N =
|
|
871
|
-
!((
|
|
951
|
+
/* @__PURE__ */ a("div", { className: d, children: s }),
|
|
952
|
+
/* @__PURE__ */ v("div", { className: "flex-1 me-3", children: [
|
|
953
|
+
((h = t.config) == null ? void 0 : h.title) && /* @__PURE__ */ a("div", { className: "font-semibold text-black", children: t.config.title }),
|
|
954
|
+
((N = t.config) == null ? void 0 : N.description) && /* @__PURE__ */ a("div", { className: "text-sm text-gray-500", children: t.config.description }),
|
|
955
|
+
!((S = t.config) != null && S.title) && !((C = t.config) != null && C.description) && /* @__PURE__ */ a("div", { className: "text-sm", children: t.message })
|
|
872
956
|
] }),
|
|
873
|
-
/* @__PURE__ */
|
|
957
|
+
/* @__PURE__ */ a(
|
|
874
958
|
"button",
|
|
875
959
|
{
|
|
876
|
-
onClick: () =>
|
|
960
|
+
onClick: () => r((k) => k.filter((x) => x.id !== t.id)),
|
|
877
961
|
className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
|
|
878
962
|
"aria-label": "Close",
|
|
879
|
-
children: /* @__PURE__ */
|
|
963
|
+
children: /* @__PURE__ */ a(De, { size: 18 })
|
|
880
964
|
}
|
|
881
965
|
)
|
|
882
966
|
]
|
|
883
967
|
},
|
|
884
|
-
|
|
968
|
+
t.id
|
|
885
969
|
);
|
|
886
970
|
}) });
|
|
887
971
|
};
|
|
888
|
-
function
|
|
972
|
+
function _e(e) {
|
|
889
973
|
switch (e) {
|
|
890
974
|
case "success":
|
|
891
975
|
return "✅";
|
|
@@ -898,19 +982,20 @@ function ze(e) {
|
|
|
898
982
|
}
|
|
899
983
|
}
|
|
900
984
|
export {
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
985
|
+
Ke as Accordion,
|
|
986
|
+
Ge as Badge,
|
|
987
|
+
Re as Button,
|
|
988
|
+
He as Checkbox,
|
|
989
|
+
We as Dropdown,
|
|
905
990
|
ce as Input,
|
|
906
|
-
|
|
907
|
-
|
|
991
|
+
Ue as Modal,
|
|
992
|
+
qe as ModalProvider,
|
|
908
993
|
be as Select,
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
994
|
+
Qe as Toast,
|
|
995
|
+
Ze as Tooltip,
|
|
996
|
+
Ye as setToastDefaults,
|
|
997
|
+
Je as showToast,
|
|
998
|
+
ne as useModalActions,
|
|
999
|
+
Xe as useModalInstance,
|
|
1000
|
+
se as useModalState
|
|
916
1001
|
};
|