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