tailwind-ux-kit 1.0.75 → 1.0.77
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/Input.d.ts +3 -0
- package/lib/tailwind-ux-kit.es.js +367 -320
- package/lib/tailwind-ux-kit.umd.js +8 -8
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
2
|
+
import { jsxs as N, jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import A, { forwardRef as re, useState as D, useMemo as I, useId as ge, useRef as W, useCallback as z, useEffect as B, createContext as se, useContext as oe } from "react";
|
|
4
|
+
const V = {
|
|
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
|
+
}, ee = {
|
|
10
10
|
flat: "rounded-none",
|
|
11
11
|
rounded: "rounded-sm",
|
|
12
12
|
pill: "rounded-full"
|
|
13
|
-
},
|
|
13
|
+
}, be = {
|
|
14
14
|
filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
|
|
15
15
|
outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
|
|
16
16
|
standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
|
|
17
|
-
},
|
|
17
|
+
}, me = {
|
|
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
|
-
},
|
|
22
|
-
if (r)
|
|
23
|
-
return "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";
|
|
21
|
+
}, xe = (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,9 +33,9 @@ const K = {
|
|
|
33
33
|
default:
|
|
34
34
|
return "border-gray-300 focus:ring-blue-500";
|
|
35
35
|
}
|
|
36
|
-
},
|
|
36
|
+
}, he = re((e, r) => {
|
|
37
37
|
const {
|
|
38
|
-
label:
|
|
38
|
+
label: n,
|
|
39
39
|
id: t,
|
|
40
40
|
inputSize: o = "md",
|
|
41
41
|
shape: c = "rounded",
|
|
@@ -49,38 +49,83 @@ const K = {
|
|
|
49
49
|
isValid: b,
|
|
50
50
|
isInvalid: g,
|
|
51
51
|
feedback: m,
|
|
52
|
-
iconClasses:
|
|
53
|
-
feedbackType:
|
|
54
|
-
labelClasses:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
iconClasses: k,
|
|
53
|
+
feedbackType: v = "invalid",
|
|
54
|
+
labelClasses: E = "",
|
|
55
|
+
inputType: L = "string",
|
|
56
|
+
inputPattern: h,
|
|
57
|
+
...y
|
|
58
|
+
} = e, [O, w] = D("default"), $ = A.useCallback(
|
|
59
|
+
(j) => {
|
|
60
|
+
const S = j.target.value, H = (d == null ? void 0 : d(S)) ?? "default";
|
|
61
|
+
w(H), u == null || u(j, H), p == null || p(j);
|
|
60
62
|
},
|
|
61
63
|
[d, u, p]
|
|
62
|
-
), x =
|
|
63
|
-
() =>
|
|
64
|
-
[
|
|
65
|
-
),
|
|
66
|
-
|
|
64
|
+
), x = I(() => t || (typeof n == "string" ? `input-${n.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [t, n]), C = !!a, P = V[o] || V.md, F = ee[c] || ee.flat, T = I(
|
|
65
|
+
() => xe(O, b, g),
|
|
66
|
+
[O, b, g]
|
|
67
|
+
), M = I(() => s === "start" || s === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [s]), R = I(() => l ? s === "start" || s === "left" ? "ps-10" : "pe-10" : "", [l, s]), Z = (j) => {
|
|
68
|
+
var _;
|
|
69
|
+
const S = j.key;
|
|
70
|
+
(() => {
|
|
71
|
+
const K = /^\d$/, q = /^[a-zA-Z]$/, X = /^[a-zA-Z0-9]$/;
|
|
72
|
+
switch (L) {
|
|
73
|
+
case "numeric":
|
|
74
|
+
case "number":
|
|
75
|
+
case "integer":
|
|
76
|
+
return !K.test(S);
|
|
77
|
+
case "decimal":
|
|
78
|
+
return !K.test(S) && S !== "." && S !== "Backspace" && S !== "Tab";
|
|
79
|
+
case "alphabetic":
|
|
80
|
+
return !q.test(S);
|
|
81
|
+
case "string":
|
|
82
|
+
return !X.test(S);
|
|
83
|
+
case "custom":
|
|
84
|
+
return h ? !h.test(S) : !1;
|
|
85
|
+
default:
|
|
86
|
+
return !1;
|
|
87
|
+
}
|
|
88
|
+
})() && j.preventDefault(), (_ = y.onKeyDown) == null || _.call(y, j);
|
|
89
|
+
}, fe = (j) => {
|
|
90
|
+
var _;
|
|
91
|
+
const S = j.clipboardData.getData("Text");
|
|
92
|
+
(() => {
|
|
93
|
+
const K = /^\d+$/, q = /^\d*\.?\d*$/, X = /^[a-zA-Z]+$/, pe = /^[a-zA-Z0-9]+$/;
|
|
94
|
+
switch (L) {
|
|
95
|
+
case "numeric":
|
|
96
|
+
case "number":
|
|
97
|
+
return !K.test(S);
|
|
98
|
+
case "decimal":
|
|
99
|
+
return !q.test(S);
|
|
100
|
+
case "alphabetic":
|
|
101
|
+
return !X.test(S);
|
|
102
|
+
case "string":
|
|
103
|
+
return !pe.test(S);
|
|
104
|
+
case "custom":
|
|
105
|
+
return h ? !h.test(S) : !1;
|
|
106
|
+
default:
|
|
107
|
+
return !1;
|
|
108
|
+
}
|
|
109
|
+
})() && j.preventDefault(), (_ = y.onPaste) == null || _.call(y, j);
|
|
110
|
+
};
|
|
111
|
+
return /* @__PURE__ */ N(
|
|
67
112
|
"div",
|
|
68
113
|
{
|
|
69
|
-
className: `w-full relative ${
|
|
114
|
+
className: `w-full relative ${C ? "z-0" : ""} tailwind-ux-input`,
|
|
70
115
|
children: [
|
|
71
|
-
!
|
|
116
|
+
!C && n && /* @__PURE__ */ i(
|
|
72
117
|
"label",
|
|
73
118
|
{
|
|
74
119
|
htmlFor: x,
|
|
75
|
-
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"} ${
|
|
76
|
-
children:
|
|
120
|
+
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"} ${E}`,
|
|
121
|
+
children: n
|
|
77
122
|
}
|
|
78
123
|
),
|
|
79
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ N("div", { className: "relative w-full", children: [
|
|
80
125
|
l && /* @__PURE__ */ i(
|
|
81
126
|
"div",
|
|
82
127
|
{
|
|
83
|
-
className: `absolute inset-y-0 flex items-center ${
|
|
128
|
+
className: `absolute inset-y-0 flex items-center ${M} ${k}`,
|
|
84
129
|
"aria-hidden": "true",
|
|
85
130
|
children: l
|
|
86
131
|
}
|
|
@@ -88,31 +133,33 @@ const K = {
|
|
|
88
133
|
/* @__PURE__ */ i(
|
|
89
134
|
"input",
|
|
90
135
|
{
|
|
91
|
-
...
|
|
136
|
+
...y,
|
|
92
137
|
id: x,
|
|
93
|
-
ref:
|
|
94
|
-
placeholder:
|
|
95
|
-
onChange:
|
|
138
|
+
ref: r,
|
|
139
|
+
placeholder: C ? " " : y.placeholder,
|
|
140
|
+
onChange: $,
|
|
141
|
+
onKeyDown: Z,
|
|
142
|
+
onPaste: fe,
|
|
96
143
|
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
|
|
97
|
-
${
|
|
98
|
-
${
|
|
99
|
-
${
|
|
144
|
+
${P}
|
|
145
|
+
${C && a && be[a]}
|
|
146
|
+
${R} ${F} ${T} ${f}`
|
|
100
147
|
}
|
|
101
148
|
),
|
|
102
|
-
|
|
149
|
+
C && n && a && /* @__PURE__ */ i(
|
|
103
150
|
"label",
|
|
104
151
|
{
|
|
105
152
|
htmlFor: x,
|
|
106
|
-
className: `ms-1 ${
|
|
107
|
-
children:
|
|
153
|
+
className: `ms-1 ${me[a]} ${f}`,
|
|
154
|
+
children: n
|
|
108
155
|
}
|
|
109
156
|
)
|
|
110
157
|
] }),
|
|
111
158
|
m && /* @__PURE__ */ i(
|
|
112
159
|
"p",
|
|
113
160
|
{
|
|
114
|
-
className: `mt-1 text-xs ${
|
|
115
|
-
role:
|
|
161
|
+
className: `mt-1 text-xs ${v === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
|
|
162
|
+
role: v === "invalid" ? "alert" : void 0,
|
|
116
163
|
children: m
|
|
117
164
|
}
|
|
118
165
|
)
|
|
@@ -120,28 +167,28 @@ const K = {
|
|
|
120
167
|
}
|
|
121
168
|
);
|
|
122
169
|
});
|
|
123
|
-
|
|
124
|
-
const
|
|
170
|
+
he.displayName = "Input";
|
|
171
|
+
const ye = {
|
|
125
172
|
xs: "text-xs px-2 py-1",
|
|
126
173
|
sm: "text-sm px-3 py-1.5",
|
|
127
174
|
md: "text-sm px-3 py-3",
|
|
128
175
|
lg: "text-lg px-5 py-3"
|
|
129
|
-
},
|
|
176
|
+
}, we = {
|
|
130
177
|
flat: "rounded-none",
|
|
131
178
|
rounded: "rounded-sm",
|
|
132
179
|
pill: "rounded-full"
|
|
133
|
-
},
|
|
180
|
+
}, ve = {
|
|
134
181
|
filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
|
|
135
182
|
outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
|
|
136
183
|
standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
|
|
137
|
-
},
|
|
184
|
+
}, Ce = {
|
|
138
185
|
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",
|
|
139
186
|
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",
|
|
140
187
|
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"
|
|
141
|
-
},
|
|
142
|
-
if (r)
|
|
143
|
-
return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
|
|
188
|
+
}, ke = (e, r, n) => {
|
|
144
189
|
if (n)
|
|
190
|
+
return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
|
|
191
|
+
if (r)
|
|
145
192
|
return "border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";
|
|
146
193
|
const t = "focus:ring focus:border";
|
|
147
194
|
switch (e) {
|
|
@@ -154,9 +201,9 @@ const de = {
|
|
|
154
201
|
default:
|
|
155
202
|
return "border-gray-300 focus:ring-blue-500";
|
|
156
203
|
}
|
|
157
|
-
},
|
|
204
|
+
}, $e = re((e, r) => {
|
|
158
205
|
const {
|
|
159
|
-
label:
|
|
206
|
+
label: n,
|
|
160
207
|
id: t,
|
|
161
208
|
inputSize: o = "md",
|
|
162
209
|
shape: c = "rounded",
|
|
@@ -170,23 +217,23 @@ const de = {
|
|
|
170
217
|
isValid: b,
|
|
171
218
|
isInvalid: g,
|
|
172
219
|
feedback: m,
|
|
173
|
-
feedbackType:
|
|
174
|
-
children:
|
|
175
|
-
...
|
|
176
|
-
} = e, [
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
},
|
|
180
|
-
return /* @__PURE__ */
|
|
181
|
-
|
|
220
|
+
feedbackType: k = "invalid",
|
|
221
|
+
children: v,
|
|
222
|
+
...E
|
|
223
|
+
} = e, [L, h] = D("default"), y = ge(), O = I(() => t || (typeof n == "string" ? `select-${n.toLowerCase().replace(/\s+/g, "-")}` : y), [t, n, y]), w = (M) => {
|
|
224
|
+
const R = M.target.value, Z = (d == null ? void 0 : d(R)) ?? "default";
|
|
225
|
+
h(Z), u == null || u(M, Z), p == null || p(M);
|
|
226
|
+
}, $ = !!a, x = ye[o], C = we[c], P = ke(L, b, g);
|
|
227
|
+
return /* @__PURE__ */ N("div", { className: `w-full relative ${$ ? "z-0" : ""}`, children: [
|
|
228
|
+
!$ && n && /* @__PURE__ */ i(
|
|
182
229
|
"label",
|
|
183
230
|
{
|
|
184
|
-
htmlFor:
|
|
231
|
+
htmlFor: O,
|
|
185
232
|
className: `block mb-1 text-sm ${b ? "text-green-700" : g ? "text-red-700" : "text-gray-700"}`,
|
|
186
|
-
children:
|
|
233
|
+
children: n
|
|
187
234
|
}
|
|
188
235
|
),
|
|
189
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ N("div", { className: "relative w-full", children: [
|
|
190
237
|
l && /* @__PURE__ */ i(
|
|
191
238
|
"div",
|
|
192
239
|
{
|
|
@@ -197,37 +244,37 @@ const de = {
|
|
|
197
244
|
/* @__PURE__ */ i(
|
|
198
245
|
"select",
|
|
199
246
|
{
|
|
200
|
-
...
|
|
201
|
-
id:
|
|
202
|
-
ref:
|
|
203
|
-
onChange:
|
|
247
|
+
...E,
|
|
248
|
+
id: O,
|
|
249
|
+
ref: r,
|
|
250
|
+
onChange: w,
|
|
204
251
|
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
|
|
205
|
-
${
|
|
206
|
-
${
|
|
207
|
-
${
|
|
208
|
-
children:
|
|
252
|
+
${x} ${l && (s === "start" || s === "left") ? "ps-10" : l ? "pe-10" : ""}
|
|
253
|
+
${$ && a && ve[a]}
|
|
254
|
+
${C} ${P} ${f}`,
|
|
255
|
+
children: v
|
|
209
256
|
}
|
|
210
257
|
),
|
|
211
|
-
|
|
258
|
+
$ && n && a && /* @__PURE__ */ i(
|
|
212
259
|
"label",
|
|
213
260
|
{
|
|
214
|
-
htmlFor:
|
|
215
|
-
className: `ms-1 ${
|
|
216
|
-
children:
|
|
261
|
+
htmlFor: O,
|
|
262
|
+
className: `ms-1 ${Ce[a]} ${f}`,
|
|
263
|
+
children: n
|
|
217
264
|
}
|
|
218
265
|
)
|
|
219
266
|
] }),
|
|
220
267
|
m && /* @__PURE__ */ i(
|
|
221
268
|
"p",
|
|
222
269
|
{
|
|
223
|
-
className: `mt-1 text-xs ${
|
|
270
|
+
className: `mt-1 text-xs ${k === "invalid" ? "text-red-600" : "text-green-600"}`,
|
|
224
271
|
children: m
|
|
225
272
|
}
|
|
226
273
|
)
|
|
227
274
|
] });
|
|
228
275
|
});
|
|
229
|
-
|
|
230
|
-
const
|
|
276
|
+
$e.displayName = "Select";
|
|
277
|
+
const Ne = {
|
|
231
278
|
primary: "btn-primary",
|
|
232
279
|
secondary: "btn-secondary",
|
|
233
280
|
success: "btn-success",
|
|
@@ -253,21 +300,21 @@ const me = {
|
|
|
253
300
|
"soft-info": "btn-soft-info",
|
|
254
301
|
"soft-dark": "btn-soft-dark",
|
|
255
302
|
"soft-light": "btn-soft-light"
|
|
256
|
-
},
|
|
303
|
+
}, Se = {
|
|
257
304
|
xs: "px-3 py-2 text-xs",
|
|
258
305
|
sm: "px-3 py-2 text-sm",
|
|
259
306
|
md: "px-5 py-2.5 text-sm",
|
|
260
307
|
lg: "px-5 py-3 text-base",
|
|
261
308
|
xl: "px-6 py-3.5 text-base"
|
|
262
|
-
},
|
|
309
|
+
}, Ee = {
|
|
263
310
|
flat: "shadow-none",
|
|
264
311
|
rounded: "rounded-sm",
|
|
265
312
|
pill: "rounded-full",
|
|
266
313
|
circle: "rounded-full w-10 h-10 p-0 flex items-center justify-center"
|
|
267
|
-
},
|
|
314
|
+
}, Je = ({
|
|
268
315
|
children: e,
|
|
269
|
-
variant:
|
|
270
|
-
size:
|
|
316
|
+
variant: r = "primary",
|
|
317
|
+
size: n = "md",
|
|
271
318
|
type: t = "button",
|
|
272
319
|
shape: o = "rounded",
|
|
273
320
|
className: c = "",
|
|
@@ -277,15 +324,15 @@ const me = {
|
|
|
277
324
|
}) => {
|
|
278
325
|
const l = u || d, s = [
|
|
279
326
|
"inline-flex items-center justify-center font-normal transition duration-150",
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
327
|
+
Ne[r],
|
|
328
|
+
Se[n],
|
|
329
|
+
Ee[o],
|
|
283
330
|
o === "flat" ? "shadow-none" : "shadow-sm",
|
|
284
331
|
l ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
285
332
|
c
|
|
286
333
|
].filter(Boolean).join(" ");
|
|
287
|
-
return /* @__PURE__ */
|
|
288
|
-
d && /* @__PURE__ */
|
|
334
|
+
return /* @__PURE__ */ N("button", { type: t, className: s, disabled: l, ...f, children: [
|
|
335
|
+
d && /* @__PURE__ */ N(
|
|
289
336
|
"svg",
|
|
290
337
|
{
|
|
291
338
|
"aria-hidden": "true",
|
|
@@ -315,127 +362,127 @@ const me = {
|
|
|
315
362
|
e
|
|
316
363
|
] });
|
|
317
364
|
};
|
|
318
|
-
var
|
|
365
|
+
var ae = {
|
|
319
366
|
color: void 0,
|
|
320
367
|
size: void 0,
|
|
321
368
|
className: void 0,
|
|
322
369
|
style: void 0,
|
|
323
370
|
attr: void 0
|
|
324
|
-
},
|
|
325
|
-
function
|
|
371
|
+
}, te = A.createContext && /* @__PURE__ */ A.createContext(ae), Le = ["attr", "size", "title"];
|
|
372
|
+
function Oe(e, r) {
|
|
326
373
|
if (e == null) return {};
|
|
327
|
-
var
|
|
374
|
+
var n = Pe(e, r), t, o;
|
|
328
375
|
if (Object.getOwnPropertySymbols) {
|
|
329
376
|
var c = Object.getOwnPropertySymbols(e);
|
|
330
377
|
for (o = 0; o < c.length; o++)
|
|
331
|
-
t = c[o], !(
|
|
378
|
+
t = c[o], !(r.indexOf(t) >= 0) && Object.prototype.propertyIsEnumerable.call(e, t) && (n[t] = e[t]);
|
|
332
379
|
}
|
|
333
|
-
return
|
|
380
|
+
return n;
|
|
334
381
|
}
|
|
335
|
-
function
|
|
382
|
+
function Pe(e, r) {
|
|
336
383
|
if (e == null) return {};
|
|
337
|
-
var
|
|
384
|
+
var n = {};
|
|
338
385
|
for (var t in e)
|
|
339
386
|
if (Object.prototype.hasOwnProperty.call(e, t)) {
|
|
340
|
-
if (
|
|
341
|
-
|
|
387
|
+
if (r.indexOf(t) >= 0) continue;
|
|
388
|
+
n[t] = e[t];
|
|
342
389
|
}
|
|
343
|
-
return
|
|
390
|
+
return n;
|
|
344
391
|
}
|
|
345
|
-
function
|
|
346
|
-
return
|
|
347
|
-
for (var
|
|
348
|
-
var
|
|
349
|
-
for (var t in
|
|
350
|
-
Object.prototype.hasOwnProperty.call(
|
|
392
|
+
function G() {
|
|
393
|
+
return G = Object.assign ? Object.assign.bind() : function(e) {
|
|
394
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
395
|
+
var n = arguments[r];
|
|
396
|
+
for (var t in n)
|
|
397
|
+
Object.prototype.hasOwnProperty.call(n, t) && (e[t] = n[t]);
|
|
351
398
|
}
|
|
352
399
|
return e;
|
|
353
|
-
},
|
|
400
|
+
}, G.apply(this, arguments);
|
|
354
401
|
}
|
|
355
|
-
function
|
|
356
|
-
var
|
|
402
|
+
function ne(e, r) {
|
|
403
|
+
var n = Object.keys(e);
|
|
357
404
|
if (Object.getOwnPropertySymbols) {
|
|
358
405
|
var t = Object.getOwnPropertySymbols(e);
|
|
359
|
-
|
|
406
|
+
r && (t = t.filter(function(o) {
|
|
360
407
|
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
361
|
-
})),
|
|
408
|
+
})), n.push.apply(n, t);
|
|
362
409
|
}
|
|
363
|
-
return
|
|
410
|
+
return n;
|
|
364
411
|
}
|
|
365
|
-
function
|
|
366
|
-
for (var
|
|
367
|
-
var
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
371
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(
|
|
412
|
+
function U(e) {
|
|
413
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
414
|
+
var n = arguments[r] != null ? arguments[r] : {};
|
|
415
|
+
r % 2 ? ne(Object(n), !0).forEach(function(t) {
|
|
416
|
+
je(e, t, n[t]);
|
|
417
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ne(Object(n)).forEach(function(t) {
|
|
418
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
372
419
|
});
|
|
373
420
|
}
|
|
374
421
|
return e;
|
|
375
422
|
}
|
|
376
|
-
function
|
|
377
|
-
return
|
|
423
|
+
function je(e, r, n) {
|
|
424
|
+
return r = Ie(r), r in e ? Object.defineProperty(e, r, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = n, e;
|
|
378
425
|
}
|
|
379
|
-
function
|
|
380
|
-
var
|
|
381
|
-
return typeof
|
|
426
|
+
function Ie(e) {
|
|
427
|
+
var r = ze(e, "string");
|
|
428
|
+
return typeof r == "symbol" ? r : r + "";
|
|
382
429
|
}
|
|
383
|
-
function
|
|
430
|
+
function ze(e, r) {
|
|
384
431
|
if (typeof e != "object" || !e) return e;
|
|
385
|
-
var
|
|
386
|
-
if (
|
|
387
|
-
var t =
|
|
432
|
+
var n = e[Symbol.toPrimitive];
|
|
433
|
+
if (n !== void 0) {
|
|
434
|
+
var t = n.call(e, r);
|
|
388
435
|
if (typeof t != "object") return t;
|
|
389
436
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
390
437
|
}
|
|
391
|
-
return (
|
|
438
|
+
return (r === "string" ? String : Number)(e);
|
|
392
439
|
}
|
|
393
|
-
function
|
|
394
|
-
return e && e.map((
|
|
395
|
-
key:
|
|
396
|
-
},
|
|
440
|
+
function le(e) {
|
|
441
|
+
return e && e.map((r, n) => /* @__PURE__ */ A.createElement(r.tag, U({
|
|
442
|
+
key: n
|
|
443
|
+
}, r.attr), le(r.child)));
|
|
397
444
|
}
|
|
398
|
-
function
|
|
399
|
-
return (
|
|
400
|
-
attr:
|
|
401
|
-
},
|
|
445
|
+
function Q(e) {
|
|
446
|
+
return (r) => /* @__PURE__ */ A.createElement(Ae, G({
|
|
447
|
+
attr: U({}, e.attr)
|
|
448
|
+
}, r), le(e.child));
|
|
402
449
|
}
|
|
403
|
-
function
|
|
404
|
-
var
|
|
450
|
+
function Ae(e) {
|
|
451
|
+
var r = (n) => {
|
|
405
452
|
var {
|
|
406
453
|
attr: t,
|
|
407
454
|
size: o,
|
|
408
455
|
title: c
|
|
409
|
-
} = e, d =
|
|
410
|
-
return
|
|
456
|
+
} = e, d = Oe(e, Le), u = o || n.size || "1em", f;
|
|
457
|
+
return n.className && (f = n.className), e.className && (f = (f ? f + " " : "") + e.className), /* @__PURE__ */ A.createElement("svg", G({
|
|
411
458
|
stroke: "currentColor",
|
|
412
459
|
fill: "currentColor",
|
|
413
460
|
strokeWidth: "0"
|
|
414
|
-
},
|
|
461
|
+
}, n.attr, t, d, {
|
|
415
462
|
className: f,
|
|
416
|
-
style:
|
|
417
|
-
color: e.color ||
|
|
418
|
-
},
|
|
463
|
+
style: U(U({
|
|
464
|
+
color: e.color || n.color
|
|
465
|
+
}, n.style), e.style),
|
|
419
466
|
height: u,
|
|
420
467
|
width: u,
|
|
421
468
|
xmlns: "http://www.w3.org/2000/svg"
|
|
422
|
-
}), c && /* @__PURE__ */
|
|
469
|
+
}), c && /* @__PURE__ */ A.createElement("title", null, c), e.children);
|
|
423
470
|
};
|
|
424
|
-
return
|
|
471
|
+
return te !== void 0 ? /* @__PURE__ */ A.createElement(te.Consumer, null, (n) => r(n)) : r(ae);
|
|
425
472
|
}
|
|
426
|
-
function
|
|
427
|
-
return
|
|
473
|
+
function De(e) {
|
|
474
|
+
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);
|
|
428
475
|
}
|
|
429
|
-
const
|
|
476
|
+
const Me = {
|
|
430
477
|
xs: "w-3 h-3 text-[10px]",
|
|
431
478
|
sm: "w-4 h-4 text-xs",
|
|
432
479
|
md: "w-5 h-5 text-sm",
|
|
433
480
|
lg: "w-6 h-6 text-base"
|
|
434
|
-
},
|
|
481
|
+
}, Te = {
|
|
435
482
|
flat: "rounded-none",
|
|
436
483
|
rounded: "rounded-sm",
|
|
437
484
|
pill: "rounded-full"
|
|
438
|
-
},
|
|
485
|
+
}, Re = {
|
|
439
486
|
primary: "primary",
|
|
440
487
|
secondary: "secondary",
|
|
441
488
|
success: "success",
|
|
@@ -461,11 +508,11 @@ const Ee = {
|
|
|
461
508
|
"soft-info": "soft-info",
|
|
462
509
|
"soft-dark": "soft-dark",
|
|
463
510
|
"soft-light": "soft-light"
|
|
464
|
-
},
|
|
511
|
+
}, _e = A.forwardRef(
|
|
465
512
|
({
|
|
466
513
|
label: e,
|
|
467
|
-
boxSize:
|
|
468
|
-
shape:
|
|
514
|
+
boxSize: r = "md",
|
|
515
|
+
shape: n = "rounded",
|
|
469
516
|
variant: t = "success",
|
|
470
517
|
onSelectionChange: o,
|
|
471
518
|
disabled: c = !1,
|
|
@@ -477,15 +524,15 @@ const Ee = {
|
|
|
477
524
|
checked: a,
|
|
478
525
|
...p
|
|
479
526
|
}, b) => {
|
|
480
|
-
const g = (
|
|
481
|
-
!c && o && o(
|
|
482
|
-
}, m = "mr-2 border flex items-center justify-center transition-all",
|
|
527
|
+
const g = (x) => {
|
|
528
|
+
!c && o && o(x.target.checked), p.onChange && p.onChange(x);
|
|
529
|
+
}, m = "mr-2 border flex items-center justify-center transition-all", k = Me[r], v = Te[n], E = Re[t] ?? "", L = t.startsWith("outline"), h = t.startsWith("soft"), w = `${m} ${k} ${v} ${E} ${a && (L || h || t === "link") ? "peer-checked:bg-current peer-checked:text-white" : a ? "peer-checked:bg-current" : ""}`, $ = {
|
|
483
530
|
xs: "w-2 h-2",
|
|
484
531
|
sm: "w-2.5 h-2.5",
|
|
485
532
|
md: "w-3 h-3",
|
|
486
533
|
lg: "w-3.5 h-3.5"
|
|
487
534
|
};
|
|
488
|
-
return /* @__PURE__ */
|
|
535
|
+
return /* @__PURE__ */ N(
|
|
489
536
|
"label",
|
|
490
537
|
{
|
|
491
538
|
className: `flex items-center ${c ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} me-4 ${d}`,
|
|
@@ -504,18 +551,18 @@ const Ee = {
|
|
|
504
551
|
...p
|
|
505
552
|
}
|
|
506
553
|
),
|
|
507
|
-
/* @__PURE__ */ i("span", { className:
|
|
554
|
+
/* @__PURE__ */ i("span", { className: w.trim(), children: (a || p.defaultChecked) && (l ?? /* @__PURE__ */ i(De, { className: `${$[r]}` })) }),
|
|
508
555
|
e || s ? /* @__PURE__ */ i("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-300", children: e ?? s }) : null
|
|
509
556
|
]
|
|
510
557
|
}
|
|
511
558
|
);
|
|
512
559
|
}
|
|
513
560
|
);
|
|
514
|
-
|
|
515
|
-
const
|
|
561
|
+
_e.displayName = "Checkbox";
|
|
562
|
+
const Qe = ({
|
|
516
563
|
label: e,
|
|
517
|
-
header:
|
|
518
|
-
items:
|
|
564
|
+
header: r,
|
|
565
|
+
items: n = [],
|
|
519
566
|
onSelect: t,
|
|
520
567
|
renderItem: o,
|
|
521
568
|
position: c = "right",
|
|
@@ -527,77 +574,77 @@ const We = ({
|
|
|
527
574
|
ariaLabel: a = "Dropdown menu",
|
|
528
575
|
...p
|
|
529
576
|
}) => {
|
|
530
|
-
const [b, g] =
|
|
577
|
+
const [b, g] = D(!1), [m, k] = D(!1), v = W(null), E = W(null), L = I(() => ({
|
|
531
578
|
left: "left-0",
|
|
532
579
|
center: "left-1/2 transform -translate-x-1/2",
|
|
533
580
|
right: "right-0"
|
|
534
|
-
})[c], [c]),
|
|
535
|
-
const
|
|
536
|
-
if (!
|
|
537
|
-
const { top:
|
|
538
|
-
|
|
539
|
-
}, []),
|
|
540
|
-
var
|
|
541
|
-
!((
|
|
542
|
-
}, []),
|
|
543
|
-
|
|
581
|
+
})[c], [c]), h = z(() => {
|
|
582
|
+
const x = E.current, C = v.current;
|
|
583
|
+
if (!x || !C) return;
|
|
584
|
+
const { top: P, bottom: F } = x.getBoundingClientRect(), T = C.offsetHeight, M = window.innerHeight - F, R = P;
|
|
585
|
+
k(M < T && R > T);
|
|
586
|
+
}, []), y = z((x) => {
|
|
587
|
+
var C, P;
|
|
588
|
+
!((C = v.current) != null && C.contains(x.target)) && !((P = E.current) != null && P.contains(x.target)) && g(!1);
|
|
589
|
+
}, []), O = z(() => g((x) => !x), []), w = z(() => g(!1), []);
|
|
590
|
+
B(() => {
|
|
544
591
|
if (b)
|
|
545
|
-
return
|
|
546
|
-
window.removeEventListener("resize",
|
|
592
|
+
return h(), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0), () => {
|
|
593
|
+
window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
|
|
547
594
|
};
|
|
548
|
-
}, [b,
|
|
549
|
-
const
|
|
595
|
+
}, [b, h]), B(() => (document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y)), [y]);
|
|
596
|
+
const $ = I(
|
|
550
597
|
() => [
|
|
551
598
|
"absolute z-50 bg-white rounded shadow-lg overflow-hidden w-auto",
|
|
552
599
|
m ? "bottom-full mb-2" : "top-full mt-2",
|
|
553
|
-
|
|
600
|
+
L,
|
|
554
601
|
f,
|
|
555
602
|
s && "transition-all duration-200 ease-out",
|
|
556
603
|
u
|
|
557
604
|
].filter(Boolean).join(" "),
|
|
558
|
-
[m,
|
|
605
|
+
[m, L, f, s, u]
|
|
559
606
|
);
|
|
560
|
-
return /* @__PURE__ */
|
|
607
|
+
return /* @__PURE__ */ N("div", { className: `relative inline-block ${d}`, ...p, children: [
|
|
561
608
|
/* @__PURE__ */ i(
|
|
562
609
|
"button",
|
|
563
610
|
{
|
|
564
611
|
type: "button",
|
|
565
|
-
ref:
|
|
566
|
-
onClick:
|
|
612
|
+
ref: E,
|
|
613
|
+
onClick: O,
|
|
567
614
|
"aria-expanded": b,
|
|
568
615
|
"aria-label": a,
|
|
569
616
|
className: "focus:outline-none",
|
|
570
617
|
children: e
|
|
571
618
|
}
|
|
572
619
|
),
|
|
573
|
-
b && /* @__PURE__ */
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
const
|
|
577
|
-
t && t(
|
|
620
|
+
b && /* @__PURE__ */ N("div", { ref: v, role: "menu", className: $, children: [
|
|
621
|
+
r && r,
|
|
622
|
+
n.map((x, C) => {
|
|
623
|
+
const P = () => {
|
|
624
|
+
t && t(x), l && w();
|
|
578
625
|
};
|
|
579
|
-
return /* @__PURE__ */ i("div", { children: o ? o(
|
|
626
|
+
return /* @__PURE__ */ i("div", { children: o ? o(x, P) : /* @__PURE__ */ i(
|
|
580
627
|
"div",
|
|
581
628
|
{
|
|
582
|
-
onClick:
|
|
629
|
+
onClick: P,
|
|
583
630
|
className: "px-4 py-2 text-sm text-gray-800 hover:bg-gray-100 cursor-pointer",
|
|
584
631
|
role: "menuitem",
|
|
585
|
-
children:
|
|
632
|
+
children: x.label
|
|
586
633
|
}
|
|
587
|
-
) },
|
|
634
|
+
) }, C);
|
|
588
635
|
})
|
|
589
636
|
] })
|
|
590
637
|
] });
|
|
591
|
-
},
|
|
638
|
+
}, Ve = ({
|
|
592
639
|
children: e,
|
|
593
|
-
content:
|
|
594
|
-
position:
|
|
640
|
+
content: r,
|
|
641
|
+
position: n = "top",
|
|
595
642
|
className: t = "",
|
|
596
643
|
tooltipClass: o = "",
|
|
597
644
|
tooltipStyle: c = {}
|
|
598
645
|
}) => {
|
|
599
|
-
const d =
|
|
600
|
-
|
|
646
|
+
const d = W(null), u = W(null);
|
|
647
|
+
B(() => {
|
|
601
648
|
const l = d.current, s = u.current;
|
|
602
649
|
if (!l || !s) return;
|
|
603
650
|
const a = () => {
|
|
@@ -664,7 +711,7 @@ const We = ({
|
|
|
664
711
|
return s;
|
|
665
712
|
}
|
|
666
713
|
};
|
|
667
|
-
return /* @__PURE__ */
|
|
714
|
+
return /* @__PURE__ */ N("div", { ref: d, className: `relative inline-block ${t}`, children: [
|
|
668
715
|
e,
|
|
669
716
|
/* @__PURE__ */ i(
|
|
670
717
|
"div",
|
|
@@ -673,14 +720,14 @@ const We = ({
|
|
|
673
720
|
role: "tooltip",
|
|
674
721
|
className: o,
|
|
675
722
|
style: {
|
|
676
|
-
...f(
|
|
723
|
+
...f(n),
|
|
677
724
|
...c
|
|
678
725
|
},
|
|
679
|
-
children:
|
|
726
|
+
children: r
|
|
680
727
|
}
|
|
681
728
|
)
|
|
682
729
|
] });
|
|
683
|
-
},
|
|
730
|
+
}, Be = {
|
|
684
731
|
primary: "bg-blue-500 text-white",
|
|
685
732
|
secondary: "bg-gray-500 text-white",
|
|
686
733
|
success: "bg-green-500 text-white",
|
|
@@ -698,21 +745,21 @@ const We = ({
|
|
|
698
745
|
"outline-info": "border border-cyan-500 text-cyan-500 bg-transparent",
|
|
699
746
|
"outline-dark": "border border-black text-black bg-transparent",
|
|
700
747
|
"outline-light": "border border-gray-100 text-gray-800 bg-transparent"
|
|
701
|
-
},
|
|
748
|
+
}, Fe = {
|
|
702
749
|
xs: "text-xs px-2 py-0.5",
|
|
703
750
|
sm: "text-sm px-2.5 py-0.5",
|
|
704
751
|
md: "text-base px-3 py-1",
|
|
705
752
|
lg: "text-lg px-3.5 py-1.5",
|
|
706
753
|
xl: "text-xl px-4 py-2"
|
|
707
|
-
},
|
|
754
|
+
}, Ze = {
|
|
708
755
|
flat: "rounded-none",
|
|
709
756
|
rounded: "rounded-sm",
|
|
710
757
|
pill: "rounded-full",
|
|
711
758
|
circle: "rounded-full p-2 w-8 h-8 justify-center"
|
|
712
|
-
},
|
|
759
|
+
}, et = ({
|
|
713
760
|
label: e,
|
|
714
|
-
variant:
|
|
715
|
-
size:
|
|
761
|
+
variant: r = "primary",
|
|
762
|
+
size: n = "sm",
|
|
716
763
|
shape: t = "rounded",
|
|
717
764
|
icon: o,
|
|
718
765
|
dismissible: c,
|
|
@@ -720,8 +767,8 @@ const We = ({
|
|
|
720
767
|
className: u = "",
|
|
721
768
|
...f
|
|
722
769
|
}) => {
|
|
723
|
-
const l = !e && !!o, s = `inline-flex items-center font-medium ${
|
|
724
|
-
return /* @__PURE__ */
|
|
770
|
+
const l = !e && !!o, s = `inline-flex items-center font-medium ${Be[r] || ""} ${Fe[n] || ""} ${Ze[t] || ""} ${l ? "justify-center p-2 w-8 h-8" : ""} ` + u;
|
|
771
|
+
return /* @__PURE__ */ N("span", { className: s.trim(), ...f, children: [
|
|
725
772
|
o && /* @__PURE__ */ i("span", { className: e ? "mr-1" : "", children: o }),
|
|
726
773
|
e,
|
|
727
774
|
c && /* @__PURE__ */ i(
|
|
@@ -735,13 +782,13 @@ const We = ({
|
|
|
735
782
|
)
|
|
736
783
|
] });
|
|
737
784
|
};
|
|
738
|
-
function
|
|
739
|
-
return
|
|
785
|
+
function He(e) {
|
|
786
|
+
return Q({ 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);
|
|
740
787
|
}
|
|
741
|
-
const
|
|
788
|
+
const tt = ({
|
|
742
789
|
items: e,
|
|
743
|
-
allowMultipleOpen:
|
|
744
|
-
className:
|
|
790
|
+
allowMultipleOpen: r = !1,
|
|
791
|
+
className: n = "",
|
|
745
792
|
tileClasses: t = "",
|
|
746
793
|
open: o,
|
|
747
794
|
onChange: c,
|
|
@@ -750,47 +797,47 @@ const Ke = ({
|
|
|
750
797
|
showArrowIcon: f = !0,
|
|
751
798
|
panelClasses: l = ""
|
|
752
799
|
}) => {
|
|
753
|
-
const [s, a] =
|
|
800
|
+
const [s, a] = D(/* @__PURE__ */ new Set()), p = I(() => o ? new Set(o) : s, [o, s]), b = z(
|
|
754
801
|
(g) => {
|
|
755
802
|
const m = new Set(p);
|
|
756
|
-
m.has(g) ? m.delete(g) : (
|
|
803
|
+
m.has(g) ? m.delete(g) : (r || m.clear(), m.add(g)), o && c ? c(Array.from(m)) : a(m);
|
|
757
804
|
},
|
|
758
|
-
[p, o, c,
|
|
805
|
+
[p, o, c, r]
|
|
759
806
|
);
|
|
760
807
|
return /* @__PURE__ */ i(
|
|
761
808
|
"div",
|
|
762
809
|
{
|
|
763
810
|
className: "accordion",
|
|
764
811
|
role: "region",
|
|
765
|
-
"aria-multiselectable":
|
|
812
|
+
"aria-multiselectable": r,
|
|
766
813
|
children: e.map((g) => {
|
|
767
|
-
const m = p.has(g.id),
|
|
768
|
-
return /* @__PURE__ */
|
|
814
|
+
const m = p.has(g.id), k = `accordion-heading-${g.id}`, v = `accordion-panel-${g.id}`;
|
|
815
|
+
return /* @__PURE__ */ N(
|
|
769
816
|
"div",
|
|
770
817
|
{
|
|
771
|
-
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${
|
|
818
|
+
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${n}`,
|
|
772
819
|
children: [
|
|
773
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ N(
|
|
774
821
|
"button",
|
|
775
822
|
{
|
|
776
|
-
id:
|
|
823
|
+
id: k,
|
|
777
824
|
type: "button",
|
|
778
825
|
"aria-expanded": m,
|
|
779
|
-
"aria-controls":
|
|
826
|
+
"aria-controls": v,
|
|
780
827
|
onClick: () => b(g.id),
|
|
781
828
|
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}`,
|
|
782
829
|
children: [
|
|
783
830
|
d ? d(g, m) : g.title,
|
|
784
|
-
f ? /* @__PURE__ */ i(
|
|
831
|
+
f ? /* @__PURE__ */ i(He, {}) : null
|
|
785
832
|
]
|
|
786
833
|
}
|
|
787
834
|
),
|
|
788
835
|
/* @__PURE__ */ i(
|
|
789
836
|
"div",
|
|
790
837
|
{
|
|
791
|
-
id:
|
|
838
|
+
id: v,
|
|
792
839
|
role: "region",
|
|
793
|
-
"aria-labelledby":
|
|
840
|
+
"aria-labelledby": k,
|
|
794
841
|
hidden: !m,
|
|
795
842
|
className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${l}`,
|
|
796
843
|
children: u ? u(g, m) : g.content
|
|
@@ -803,18 +850,18 @@ const Ke = ({
|
|
|
803
850
|
})
|
|
804
851
|
}
|
|
805
852
|
);
|
|
806
|
-
},
|
|
807
|
-
const e =
|
|
853
|
+
}, ie = se(null), ce = () => {
|
|
854
|
+
const e = oe(ie);
|
|
808
855
|
if (!e)
|
|
809
856
|
throw new Error(
|
|
810
857
|
"useModalActions must be used within a ModalActionProvider"
|
|
811
858
|
);
|
|
812
859
|
return e;
|
|
813
|
-
},
|
|
814
|
-
function
|
|
860
|
+
}, de = se(null), ue = () => oe(de);
|
|
861
|
+
function nt({
|
|
815
862
|
id: e,
|
|
816
|
-
title:
|
|
817
|
-
children:
|
|
863
|
+
title: r,
|
|
864
|
+
children: n,
|
|
818
865
|
standalone: t = !1,
|
|
819
866
|
showFloatingClose: o = !1,
|
|
820
867
|
containerClasses: c = "",
|
|
@@ -822,150 +869,150 @@ function Ue({
|
|
|
822
869
|
disableEscapeClose: u = !1,
|
|
823
870
|
closeBtnStyle: f
|
|
824
871
|
}) {
|
|
825
|
-
const l =
|
|
872
|
+
const l = ue(), s = ce(), a = !t && !!l && !!s, [p, b] = D(!1), g = a ? l.isOpen(e) : p, m = a ? l.getModalData(e) : null, k = z(() => {
|
|
826
873
|
a ? s.closeModal(e) : b(!1), d == null || d();
|
|
827
874
|
}, [a, s, e, d]);
|
|
828
|
-
return
|
|
829
|
-
const
|
|
875
|
+
return B(() => {
|
|
876
|
+
const v = document.activeElement, E = document.getElementById(e), L = [
|
|
830
877
|
"a[href]",
|
|
831
878
|
"button:not([disabled])",
|
|
832
879
|
"textarea:not([disabled])",
|
|
833
880
|
"input:not([disabled])",
|
|
834
881
|
"select:not([disabled])",
|
|
835
882
|
'[tabindex]:not([tabindex="-1"])'
|
|
836
|
-
],
|
|
837
|
-
if (!
|
|
838
|
-
const
|
|
839
|
-
|
|
883
|
+
], h = () => {
|
|
884
|
+
if (!E) return [];
|
|
885
|
+
const w = E.querySelectorAll(
|
|
886
|
+
L.join(",")
|
|
840
887
|
);
|
|
841
|
-
return Array.from(
|
|
842
|
-
},
|
|
843
|
-
if (
|
|
844
|
-
const
|
|
845
|
-
if (
|
|
846
|
-
const
|
|
847
|
-
|
|
888
|
+
return Array.from(w).filter(($) => $.offsetParent !== null);
|
|
889
|
+
}, y = (w) => {
|
|
890
|
+
if (w.key === "Tab") {
|
|
891
|
+
const $ = h();
|
|
892
|
+
if ($.length === 0) return;
|
|
893
|
+
const x = $[0], C = $[$.length - 1];
|
|
894
|
+
w.shiftKey ? document.activeElement === x && (w.preventDefault(), C.focus()) : document.activeElement === C && (w.preventDefault(), x.focus());
|
|
848
895
|
}
|
|
849
|
-
},
|
|
850
|
-
|
|
896
|
+
}, O = (w) => {
|
|
897
|
+
w.key === "Escape" && !u && k(), y(w);
|
|
851
898
|
};
|
|
852
899
|
return g && (document.body.style.overflow = "hidden", setTimeout(() => {
|
|
853
|
-
const
|
|
854
|
-
|
|
855
|
-
}, 0), window.addEventListener("keydown",
|
|
856
|
-
document.body.style.overflow = "",
|
|
900
|
+
const w = h();
|
|
901
|
+
w.length && w[0].focus();
|
|
902
|
+
}, 0), window.addEventListener("keydown", O)), () => {
|
|
903
|
+
document.body.style.overflow = "", v && v.focus(), window.removeEventListener("keydown", O);
|
|
857
904
|
};
|
|
858
|
-
}, [g, u,
|
|
905
|
+
}, [g, u, k, e]), g ? /* @__PURE__ */ i(
|
|
859
906
|
"div",
|
|
860
907
|
{
|
|
861
908
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",
|
|
862
909
|
id: e,
|
|
863
|
-
children: /* @__PURE__ */
|
|
910
|
+
children: /* @__PURE__ */ N(
|
|
864
911
|
"div",
|
|
865
912
|
{
|
|
866
913
|
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${c}`,
|
|
867
914
|
children: [
|
|
868
|
-
/* @__PURE__ */
|
|
869
|
-
|
|
915
|
+
/* @__PURE__ */ N("div", { className: "flex justify-between items-center relative", children: [
|
|
916
|
+
r && /* @__PURE__ */ i("h2", { className: "text-lg font-semibold", children: r }),
|
|
870
917
|
o && /* @__PURE__ */ i(
|
|
871
918
|
"button",
|
|
872
919
|
{
|
|
873
|
-
onClick:
|
|
920
|
+
onClick: k,
|
|
874
921
|
className: `text-gray-500 hover:text-black absolute top-0 right-3 hover:bg-gray-200 rounded-full aspect-square w-8 ${f}`,
|
|
875
922
|
"aria-label": "Close modal",
|
|
876
923
|
children: "✕"
|
|
877
924
|
}
|
|
878
925
|
)
|
|
879
926
|
] }),
|
|
880
|
-
/* @__PURE__ */ i("div", { children: typeof
|
|
927
|
+
/* @__PURE__ */ i("div", { children: typeof n == "function" ? n({ modalData: m }) : n })
|
|
881
928
|
]
|
|
882
929
|
}
|
|
883
930
|
)
|
|
884
931
|
}
|
|
885
932
|
) : null;
|
|
886
933
|
}
|
|
887
|
-
function
|
|
934
|
+
function rt({
|
|
888
935
|
children: e
|
|
889
936
|
}) {
|
|
890
|
-
const [
|
|
891
|
-
|
|
892
|
-
}, []), d =
|
|
893
|
-
|
|
937
|
+
const [r, n] = D({}), [t, o] = D({}), c = z((a, p) => {
|
|
938
|
+
n((b) => ({ ...b, [a]: !0 })), p && o((b) => ({ ...b, [a]: p }));
|
|
939
|
+
}, []), d = z((a) => {
|
|
940
|
+
n((p) => ({ ...p, [a]: !1 })), o((p) => {
|
|
894
941
|
const b = { ...p };
|
|
895
942
|
return delete b[a], b;
|
|
896
943
|
});
|
|
897
|
-
}, []), u =
|
|
944
|
+
}, []), u = z((a) => !!r[a], [r]), f = z(
|
|
898
945
|
(a) => t[a],
|
|
899
946
|
[t]
|
|
900
|
-
), l =
|
|
947
|
+
), l = I(
|
|
901
948
|
() => ({ openModal: c, closeModal: d }),
|
|
902
949
|
[c, d]
|
|
903
|
-
), s =
|
|
950
|
+
), s = I(
|
|
904
951
|
() => ({ isOpen: u, getModalData: f }),
|
|
905
952
|
[u, f]
|
|
906
953
|
);
|
|
907
|
-
return /* @__PURE__ */ i(
|
|
954
|
+
return /* @__PURE__ */ i(ie.Provider, { value: l, children: /* @__PURE__ */ i(de.Provider, { value: s, children: e }) });
|
|
908
955
|
}
|
|
909
|
-
function
|
|
910
|
-
const { openModal:
|
|
956
|
+
function st(e) {
|
|
957
|
+
const { openModal: r, closeModal: n } = ce(), { isOpen: t, getModalData: o } = ue();
|
|
911
958
|
return {
|
|
912
|
-
open: (c) =>
|
|
913
|
-
close: () =>
|
|
959
|
+
open: (c) => r(e, c),
|
|
960
|
+
close: () => n(e),
|
|
914
961
|
isOpen: t(e),
|
|
915
962
|
data: o(e)
|
|
916
963
|
};
|
|
917
964
|
}
|
|
918
|
-
let
|
|
919
|
-
function
|
|
920
|
-
|
|
965
|
+
let Y = null, J = {};
|
|
966
|
+
function Ke(e) {
|
|
967
|
+
Y = e;
|
|
921
968
|
}
|
|
922
|
-
function
|
|
923
|
-
|
|
969
|
+
function ot(e) {
|
|
970
|
+
J = { ...J, ...e };
|
|
924
971
|
}
|
|
925
|
-
function
|
|
926
|
-
return
|
|
972
|
+
function We() {
|
|
973
|
+
return J;
|
|
927
974
|
}
|
|
928
|
-
function
|
|
929
|
-
|
|
975
|
+
function at(e, r, n = 3e3, t) {
|
|
976
|
+
Y ? Y(e, r, n, t) : console.warn("Toast system is not mounted");
|
|
930
977
|
}
|
|
931
|
-
function
|
|
932
|
-
return
|
|
978
|
+
function Ge(e) {
|
|
979
|
+
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);
|
|
933
980
|
}
|
|
934
|
-
const
|
|
935
|
-
const
|
|
936
|
-
return (e === "x" ?
|
|
937
|
-
}),
|
|
938
|
-
const [e,
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
const u =
|
|
942
|
-
|
|
943
|
-
|
|
981
|
+
const Ue = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
982
|
+
const r = Math.random() * 16 | 0;
|
|
983
|
+
return (e === "x" ? r : r & 3 | 8).toString(16);
|
|
984
|
+
}), lt = () => {
|
|
985
|
+
const [e, r] = D([]);
|
|
986
|
+
B(() => {
|
|
987
|
+
Ke((t, o, c, d) => {
|
|
988
|
+
const u = Ue();
|
|
989
|
+
r((f) => [...f, { id: u, type: t, message: o, config: d }]), setTimeout(() => {
|
|
990
|
+
r((f) => f.filter((l) => l.id !== u));
|
|
944
991
|
}, c);
|
|
945
992
|
});
|
|
946
993
|
}, []);
|
|
947
|
-
const
|
|
994
|
+
const n = We();
|
|
948
995
|
return /* @__PURE__ */ i("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((t) => {
|
|
949
|
-
var f, l, s, a, p, b, g, m,
|
|
950
|
-
const o = ((f = t.config) == null ? void 0 : f.icon) || ((l =
|
|
951
|
-
return /* @__PURE__ */
|
|
996
|
+
var f, l, s, a, p, b, g, m, k, v, E, L, h;
|
|
997
|
+
const o = ((f = t.config) == null ? void 0 : f.icon) || ((l = n.icons) == null ? void 0 : l[t.type]) || qe(t.type), c = ((s = t.config) == null ? void 0 : s.bgColor) || ((p = (a = n.colors) == null ? void 0 : a[t.type]) == null ? void 0 : p.bg) || "bg-white dark:bg-gray-800", d = ((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", u = ((k = t.config) == null ? void 0 : k.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
|
|
998
|
+
return /* @__PURE__ */ N(
|
|
952
999
|
"div",
|
|
953
1000
|
{
|
|
954
1001
|
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${c} ${d}`,
|
|
955
1002
|
children: [
|
|
956
1003
|
/* @__PURE__ */ i("div", { className: u, children: o }),
|
|
957
|
-
/* @__PURE__ */
|
|
958
|
-
((
|
|
959
|
-
((
|
|
960
|
-
!((
|
|
1004
|
+
/* @__PURE__ */ N("div", { className: "flex-1 me-3", children: [
|
|
1005
|
+
((v = t.config) == null ? void 0 : v.title) && /* @__PURE__ */ i("div", { className: "font-semibold text-black", children: t.config.title }),
|
|
1006
|
+
((E = t.config) == null ? void 0 : E.description) && /* @__PURE__ */ i("div", { className: "text-sm text-gray-500", children: t.config.description }),
|
|
1007
|
+
!((L = t.config) != null && L.title) && !((h = t.config) != null && h.description) && /* @__PURE__ */ i("div", { className: "text-sm", children: t.message })
|
|
961
1008
|
] }),
|
|
962
1009
|
/* @__PURE__ */ i(
|
|
963
1010
|
"button",
|
|
964
1011
|
{
|
|
965
|
-
onClick: () =>
|
|
1012
|
+
onClick: () => r((y) => y.filter((O) => O.id !== t.id)),
|
|
966
1013
|
className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
|
|
967
1014
|
"aria-label": "Close",
|
|
968
|
-
children: /* @__PURE__ */ i(
|
|
1015
|
+
children: /* @__PURE__ */ i(Ge, { size: 18 })
|
|
969
1016
|
}
|
|
970
1017
|
)
|
|
971
1018
|
]
|
|
@@ -974,7 +1021,7 @@ const _e = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, functio
|
|
|
974
1021
|
);
|
|
975
1022
|
}) });
|
|
976
1023
|
};
|
|
977
|
-
function
|
|
1024
|
+
function qe(e) {
|
|
978
1025
|
switch (e) {
|
|
979
1026
|
case "success":
|
|
980
1027
|
return "✅";
|
|
@@ -987,20 +1034,20 @@ function Be(e) {
|
|
|
987
1034
|
}
|
|
988
1035
|
}
|
|
989
1036
|
export {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1037
|
+
tt as Accordion,
|
|
1038
|
+
et as Badge,
|
|
1039
|
+
Je as Button,
|
|
1040
|
+
_e as Checkbox,
|
|
1041
|
+
Qe as Dropdown,
|
|
1042
|
+
he as Input,
|
|
1043
|
+
nt as Modal,
|
|
1044
|
+
rt as ModalProvider,
|
|
1045
|
+
$e as Select,
|
|
1046
|
+
lt as Toast,
|
|
1047
|
+
Ve as Tooltip,
|
|
1048
|
+
ot as setToastDefaults,
|
|
1049
|
+
at as showToast,
|
|
1050
|
+
ce as useModalActions,
|
|
1051
|
+
st as useModalInstance,
|
|
1052
|
+
ue as useModalState
|
|
1006
1053
|
};
|