tailwind-ux-kit 1.0.82 → 1.0.83
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/Switch.d.ts +9 -4
- package/lib/components/Toggler/Toggler.d.ts +32 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/tailwind-ux-kit.es.js +435 -318
- package/lib/tailwind-ux-kit.umd.js +15 -8
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
2
|
+
import { jsxs as S, jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import A, { forwardRef as oe, useState as D, useMemo as j, useId as be, useRef as F, useCallback as z, useEffect as R, createContext as ae, useContext as le } from "react";
|
|
4
4
|
const V = {
|
|
5
5
|
xs: "text-xs px-2 py-1",
|
|
6
6
|
sm: "text-sm px-3 py-1.5",
|
|
@@ -10,15 +10,15 @@ const V = {
|
|
|
10
10
|
flat: "rounded-none",
|
|
11
11
|
rounded: "rounded-sm",
|
|
12
12
|
pill: "rounded-full"
|
|
13
|
-
},
|
|
13
|
+
}, me = {
|
|
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
|
+
}, xe = {
|
|
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
|
-
},
|
|
21
|
+
}, he = (e, r, n) => {
|
|
22
22
|
if (n)
|
|
23
23
|
return "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";
|
|
24
24
|
if (r)
|
|
@@ -33,7 +33,7 @@ const V = {
|
|
|
33
33
|
default:
|
|
34
34
|
return "border-gray-300 focus:ring-blue-500";
|
|
35
35
|
}
|
|
36
|
-
},
|
|
36
|
+
}, ye = oe((e, r) => {
|
|
37
37
|
const {
|
|
38
38
|
label: n,
|
|
39
39
|
id: t,
|
|
@@ -41,113 +41,113 @@ const V = {
|
|
|
41
41
|
shape: d = "rounded",
|
|
42
42
|
validate: p,
|
|
43
43
|
onValidatedChange: u,
|
|
44
|
-
className:
|
|
45
|
-
icon:
|
|
44
|
+
className: c = "",
|
|
45
|
+
icon: a,
|
|
46
46
|
iconPosition: o = "left",
|
|
47
|
-
floatingLabelStyle:
|
|
47
|
+
floatingLabelStyle: l,
|
|
48
48
|
onChange: f,
|
|
49
|
-
isValid:
|
|
49
|
+
isValid: g,
|
|
50
50
|
isInvalid: b,
|
|
51
51
|
feedback: x,
|
|
52
|
-
iconClasses:
|
|
53
|
-
feedbackType:
|
|
54
|
-
labelClasses:
|
|
55
|
-
inputType:
|
|
56
|
-
inputPattern:
|
|
57
|
-
...
|
|
58
|
-
} = e, [
|
|
52
|
+
iconClasses: k,
|
|
53
|
+
feedbackType: $ = "invalid",
|
|
54
|
+
labelClasses: N = "",
|
|
55
|
+
inputType: w = "",
|
|
56
|
+
inputPattern: h,
|
|
57
|
+
...y
|
|
58
|
+
} = e, [v, I] = D("default"), E = A.useCallback(
|
|
59
59
|
(P) => {
|
|
60
|
-
const
|
|
61
|
-
|
|
60
|
+
const L = P.target.value, Z = (p == null ? void 0 : p(L)) ?? "default";
|
|
61
|
+
I(Z), u == null || u(P, Z), f == null || f(P);
|
|
62
62
|
},
|
|
63
63
|
[p, u, f]
|
|
64
|
-
),
|
|
65
|
-
() =>
|
|
66
|
-
[
|
|
67
|
-
), T = j(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), _ = j(() =>
|
|
68
|
-
var
|
|
69
|
-
const
|
|
70
|
-
!(P.ctrlKey || P.metaKey ||
|
|
71
|
-
const
|
|
72
|
-
switch (
|
|
64
|
+
), m = j(() => t || (typeof n == "string" ? `input-${n.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [t, n]), C = !!l, O = V[s] || V.md, M = ee[d] || ee.flat, B = j(
|
|
65
|
+
() => he(v, g, b),
|
|
66
|
+
[v, g, b]
|
|
67
|
+
), T = j(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), _ = j(() => a ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [a, o]), K = (P) => {
|
|
68
|
+
var H;
|
|
69
|
+
const L = P.key;
|
|
70
|
+
!(P.ctrlKey || P.metaKey || L.length !== 1) && (() => {
|
|
71
|
+
const W = /^\d$/, X = /^[a-zA-Z]$/;
|
|
72
|
+
switch (w) {
|
|
73
73
|
case "numeric":
|
|
74
74
|
case "number":
|
|
75
75
|
case "integer":
|
|
76
|
-
return !
|
|
76
|
+
return !W.test(L);
|
|
77
77
|
case "decimal":
|
|
78
|
-
return !
|
|
78
|
+
return !W.test(L) && L !== "." && L !== "Backspace" && L !== "Tab";
|
|
79
79
|
case "alphabetic":
|
|
80
|
-
return !X.test(
|
|
80
|
+
return !X.test(L);
|
|
81
81
|
case "custom":
|
|
82
|
-
return
|
|
82
|
+
return h ? !h.test(L) : !1;
|
|
83
83
|
default:
|
|
84
84
|
return !1;
|
|
85
85
|
}
|
|
86
|
-
})() && P.preventDefault(), (
|
|
87
|
-
},
|
|
88
|
-
var
|
|
89
|
-
const
|
|
86
|
+
})() && P.preventDefault(), (H = y.onKeyDown) == null || H.call(y, P);
|
|
87
|
+
}, ge = (P) => {
|
|
88
|
+
var U;
|
|
89
|
+
const L = P.clipboardData.getData("Text");
|
|
90
90
|
(() => {
|
|
91
|
-
const
|
|
92
|
-
switch (
|
|
91
|
+
const H = /^\d+$/, W = /^\d*\.?\d*$/, X = /^[a-zA-Z]+$/;
|
|
92
|
+
switch (w) {
|
|
93
93
|
case "numeric":
|
|
94
94
|
case "number":
|
|
95
95
|
case "integer":
|
|
96
|
-
return !
|
|
96
|
+
return !H.test(L);
|
|
97
97
|
case "decimal":
|
|
98
|
-
return !
|
|
98
|
+
return !W.test(L);
|
|
99
99
|
case "alphabetic":
|
|
100
|
-
return !X.test(
|
|
100
|
+
return !X.test(L);
|
|
101
101
|
case "custom":
|
|
102
|
-
return
|
|
102
|
+
return h ? !h.test(L) : !1;
|
|
103
103
|
default:
|
|
104
104
|
return !1;
|
|
105
105
|
}
|
|
106
|
-
})() && P.preventDefault(), (
|
|
106
|
+
})() && P.preventDefault(), (U = y.onPaste) == null || U.call(y, P);
|
|
107
107
|
};
|
|
108
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ S(
|
|
109
109
|
"div",
|
|
110
110
|
{
|
|
111
|
-
className: `w-full relative ${
|
|
111
|
+
className: `w-full relative ${C ? "z-0" : ""} tailwind-ux-input`,
|
|
112
112
|
children: [
|
|
113
|
-
!
|
|
113
|
+
!C && n && /* @__PURE__ */ i(
|
|
114
114
|
"label",
|
|
115
115
|
{
|
|
116
|
-
htmlFor:
|
|
117
|
-
className: `block mb-1 text-sm ${
|
|
116
|
+
htmlFor: m,
|
|
117
|
+
className: `block mb-1 text-sm ${g ? "text-green-700 dark:text-green-500" : b ? "text-red-700 dark:text-red-500" : "text-gray-700"} ${N}`,
|
|
118
118
|
children: n
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
|
|
121
|
+
/* @__PURE__ */ S("div", { className: "relative w-full", children: [
|
|
122
|
+
a && /* @__PURE__ */ i(
|
|
123
123
|
"div",
|
|
124
124
|
{
|
|
125
|
-
className: `absolute inset-y-0 flex items-center ${T} ${
|
|
125
|
+
className: `absolute inset-y-0 flex items-center ${T} ${k}`,
|
|
126
126
|
"aria-hidden": "true",
|
|
127
|
-
children:
|
|
127
|
+
children: a
|
|
128
128
|
}
|
|
129
129
|
),
|
|
130
130
|
/* @__PURE__ */ i(
|
|
131
131
|
"input",
|
|
132
132
|
{
|
|
133
|
-
...
|
|
134
|
-
id:
|
|
133
|
+
...y,
|
|
134
|
+
id: m,
|
|
135
135
|
ref: r,
|
|
136
|
-
placeholder:
|
|
137
|
-
onChange:
|
|
138
|
-
onKeyDown:
|
|
139
|
-
onPaste:
|
|
136
|
+
placeholder: C ? " " : y.placeholder,
|
|
137
|
+
onChange: E,
|
|
138
|
+
onKeyDown: K,
|
|
139
|
+
onPaste: ge,
|
|
140
140
|
className: `border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-900 placeholder-gray-600 border-gray-400
|
|
141
|
-
${
|
|
142
|
-
${
|
|
143
|
-
${_} ${M} ${
|
|
141
|
+
${O}
|
|
142
|
+
${C && l && me[l]}
|
|
143
|
+
${_} ${M} ${B} ${c}`
|
|
144
144
|
}
|
|
145
145
|
),
|
|
146
|
-
|
|
146
|
+
C && n && l && /* @__PURE__ */ i(
|
|
147
147
|
"label",
|
|
148
148
|
{
|
|
149
|
-
htmlFor:
|
|
150
|
-
className: `ms-1 ${
|
|
149
|
+
htmlFor: m,
|
|
150
|
+
className: `ms-1 ${xe[l]} ${c}`,
|
|
151
151
|
children: n
|
|
152
152
|
}
|
|
153
153
|
)
|
|
@@ -155,8 +155,8 @@ const V = {
|
|
|
155
155
|
x && /* @__PURE__ */ i(
|
|
156
156
|
"p",
|
|
157
157
|
{
|
|
158
|
-
className: `mt-1 text-xs ${
|
|
159
|
-
role:
|
|
158
|
+
className: `mt-1 text-xs ${$ === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
|
|
159
|
+
role: $ === "invalid" ? "alert" : void 0,
|
|
160
160
|
children: x
|
|
161
161
|
}
|
|
162
162
|
)
|
|
@@ -164,25 +164,25 @@ const V = {
|
|
|
164
164
|
}
|
|
165
165
|
);
|
|
166
166
|
});
|
|
167
|
-
|
|
168
|
-
const
|
|
167
|
+
ye.displayName = "Input";
|
|
168
|
+
const we = {
|
|
169
169
|
xs: "text-xs px-2 py-1",
|
|
170
170
|
sm: "text-sm px-3 py-1.5",
|
|
171
171
|
md: "text-sm px-3 py-3",
|
|
172
172
|
lg: "text-lg px-5 py-3"
|
|
173
|
-
},
|
|
173
|
+
}, ve = {
|
|
174
174
|
flat: "rounded-none",
|
|
175
175
|
rounded: "rounded-sm",
|
|
176
176
|
pill: "rounded-full"
|
|
177
|
-
},
|
|
177
|
+
}, Ce = {
|
|
178
178
|
filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
|
|
179
179
|
outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
|
|
180
180
|
standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
|
|
181
|
-
},
|
|
181
|
+
}, $e = {
|
|
182
182
|
filled: "absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",
|
|
183
183
|
outlined: "absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",
|
|
184
184
|
standard: "absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"
|
|
185
|
-
},
|
|
185
|
+
}, ke = (e, r, n) => {
|
|
186
186
|
if (n)
|
|
187
187
|
return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
|
|
188
188
|
if (r)
|
|
@@ -198,7 +198,7 @@ const he = {
|
|
|
198
198
|
default:
|
|
199
199
|
return "border-gray-300 focus:ring-blue-500";
|
|
200
200
|
}
|
|
201
|
-
},
|
|
201
|
+
}, Se = oe((e, r) => {
|
|
202
202
|
const {
|
|
203
203
|
label: n,
|
|
204
204
|
id: t,
|
|
@@ -206,57 +206,57 @@ const he = {
|
|
|
206
206
|
shape: d = "rounded",
|
|
207
207
|
validate: p,
|
|
208
208
|
onValidatedChange: u,
|
|
209
|
-
className:
|
|
210
|
-
icon:
|
|
209
|
+
className: c = "",
|
|
210
|
+
icon: a,
|
|
211
211
|
iconPosition: o = "left",
|
|
212
|
-
floatingLabelStyle:
|
|
212
|
+
floatingLabelStyle: l,
|
|
213
213
|
onChange: f,
|
|
214
|
-
isValid:
|
|
214
|
+
isValid: g,
|
|
215
215
|
isInvalid: b,
|
|
216
216
|
feedback: x,
|
|
217
|
-
feedbackType:
|
|
218
|
-
children:
|
|
219
|
-
|
|
220
|
-
} = e, [
|
|
221
|
-
const _ = T.target.value,
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
return /* @__PURE__ */
|
|
225
|
-
!
|
|
217
|
+
feedbackType: k = "invalid",
|
|
218
|
+
children: $,
|
|
219
|
+
...N
|
|
220
|
+
} = e, [w, h] = D("default"), y = be(), v = j(() => t || (typeof n == "string" ? `select-${n.toLowerCase().replace(/\s+/g, "-")}` : y), [t, n, y]), I = (T) => {
|
|
221
|
+
const _ = T.target.value, K = (p == null ? void 0 : p(_)) ?? "default";
|
|
222
|
+
h(K), u == null || u(T, K), f == null || f(T);
|
|
223
|
+
}, E = !!l, m = we[s], C = ve[d], O = ke(w, g, b);
|
|
224
|
+
return /* @__PURE__ */ S("div", { className: `w-full relative ${E ? "z-0" : ""}`, children: [
|
|
225
|
+
!E && n && /* @__PURE__ */ i(
|
|
226
226
|
"label",
|
|
227
227
|
{
|
|
228
|
-
htmlFor:
|
|
229
|
-
className: `block mb-1 text-sm ${
|
|
228
|
+
htmlFor: v,
|
|
229
|
+
className: `block mb-1 text-sm ${g ? "text-green-700" : b ? "text-red-700" : "text-gray-700"}`,
|
|
230
230
|
children: n
|
|
231
231
|
}
|
|
232
232
|
),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
|
|
233
|
+
/* @__PURE__ */ S("div", { className: "relative w-full", children: [
|
|
234
|
+
a && /* @__PURE__ */ i(
|
|
235
235
|
"div",
|
|
236
236
|
{
|
|
237
237
|
className: `absolute inset-y-0 flex items-center ${o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5"}`,
|
|
238
|
-
children: /* @__PURE__ */ i("span", { className: "text-gray-500", children:
|
|
238
|
+
children: /* @__PURE__ */ i("span", { className: "text-gray-500", children: a })
|
|
239
239
|
}
|
|
240
240
|
),
|
|
241
241
|
/* @__PURE__ */ i(
|
|
242
242
|
"select",
|
|
243
243
|
{
|
|
244
|
-
|
|
245
|
-
id:
|
|
244
|
+
...N,
|
|
245
|
+
id: v,
|
|
246
246
|
ref: r,
|
|
247
|
-
onChange:
|
|
247
|
+
onChange: I,
|
|
248
248
|
className: `border peer w-full block font-normal appearance-none focus:outline-none focus:ring-0 transition text-gray-600 placeholder-[#798ba5] border-gray-400
|
|
249
|
-
${
|
|
250
|
-
${
|
|
251
|
-
${
|
|
252
|
-
children:
|
|
249
|
+
${m} ${a && (o === "start" || o === "left") ? "ps-10" : a ? "pe-10" : ""}
|
|
250
|
+
${E && l && Ce[l]}
|
|
251
|
+
${C} ${O} ${c}`,
|
|
252
|
+
children: $
|
|
253
253
|
}
|
|
254
254
|
),
|
|
255
|
-
|
|
255
|
+
E && n && l && /* @__PURE__ */ i(
|
|
256
256
|
"label",
|
|
257
257
|
{
|
|
258
|
-
htmlFor:
|
|
259
|
-
className: `ms-1 ${
|
|
258
|
+
htmlFor: v,
|
|
259
|
+
className: `ms-1 ${$e[l]} ${c}`,
|
|
260
260
|
children: n
|
|
261
261
|
}
|
|
262
262
|
)
|
|
@@ -264,14 +264,14 @@ const he = {
|
|
|
264
264
|
x && /* @__PURE__ */ i(
|
|
265
265
|
"p",
|
|
266
266
|
{
|
|
267
|
-
className: `mt-1 text-xs ${
|
|
267
|
+
className: `mt-1 text-xs ${k === "invalid" ? "text-red-600" : "text-green-600"}`,
|
|
268
268
|
children: x
|
|
269
269
|
}
|
|
270
270
|
)
|
|
271
271
|
] });
|
|
272
272
|
});
|
|
273
|
-
|
|
274
|
-
const
|
|
273
|
+
Se.displayName = "Select";
|
|
274
|
+
const Ne = {
|
|
275
275
|
primary: "btn-primary",
|
|
276
276
|
secondary: "btn-secondary",
|
|
277
277
|
success: "btn-success",
|
|
@@ -297,18 +297,18 @@ const $e = {
|
|
|
297
297
|
"soft-info": "btn-soft-info",
|
|
298
298
|
"soft-dark": "btn-soft-dark",
|
|
299
299
|
"soft-light": "btn-soft-light"
|
|
300
|
-
},
|
|
300
|
+
}, Ee = {
|
|
301
301
|
xs: "px-3 py-2 text-xs",
|
|
302
302
|
sm: "px-3 py-2 text-sm",
|
|
303
303
|
md: "px-5 py-2.5 text-sm",
|
|
304
304
|
lg: "px-5 py-3 text-base",
|
|
305
305
|
xl: "px-6 py-3.5 text-base"
|
|
306
|
-
},
|
|
306
|
+
}, Le = {
|
|
307
307
|
flat: "shadow-none",
|
|
308
308
|
rounded: "rounded-sm",
|
|
309
309
|
pill: "rounded-full",
|
|
310
310
|
circle: "rounded-full w-10 h-10 p-0 flex items-center justify-center"
|
|
311
|
-
},
|
|
311
|
+
}, Qe = ({
|
|
312
312
|
children: e,
|
|
313
313
|
variant: r = "primary",
|
|
314
314
|
size: n = "md",
|
|
@@ -317,19 +317,19 @@ const $e = {
|
|
|
317
317
|
className: d = "",
|
|
318
318
|
isLoading: p = !1,
|
|
319
319
|
disabled: u = !1,
|
|
320
|
-
...
|
|
320
|
+
...c
|
|
321
321
|
}) => {
|
|
322
|
-
const
|
|
322
|
+
const a = u || p, o = [
|
|
323
323
|
"inline-flex items-center justify-center font-normal transition duration-150",
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
Ne[r],
|
|
325
|
+
Ee[n],
|
|
326
|
+
Le[s],
|
|
327
327
|
s === "flat" ? "shadow-none" : "shadow-sm",
|
|
328
|
-
|
|
328
|
+
a ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
329
329
|
d
|
|
330
330
|
].filter(Boolean).join(" ");
|
|
331
|
-
return /* @__PURE__ */
|
|
332
|
-
p && /* @__PURE__ */
|
|
331
|
+
return /* @__PURE__ */ S("button", { type: t, className: o, disabled: a, ...c, children: [
|
|
332
|
+
p && /* @__PURE__ */ S(
|
|
333
333
|
"svg",
|
|
334
334
|
{
|
|
335
335
|
"aria-hidden": "true",
|
|
@@ -359,16 +359,16 @@ const $e = {
|
|
|
359
359
|
e
|
|
360
360
|
] });
|
|
361
361
|
};
|
|
362
|
-
var
|
|
362
|
+
var ie = {
|
|
363
363
|
color: void 0,
|
|
364
364
|
size: void 0,
|
|
365
365
|
className: void 0,
|
|
366
366
|
style: void 0,
|
|
367
367
|
attr: void 0
|
|
368
|
-
}, te =
|
|
369
|
-
function
|
|
368
|
+
}, te = A.createContext && /* @__PURE__ */ A.createContext(ie), Oe = ["attr", "size", "title"];
|
|
369
|
+
function Pe(e, r) {
|
|
370
370
|
if (e == null) return {};
|
|
371
|
-
var n =
|
|
371
|
+
var n = Ie(e, r), t, s;
|
|
372
372
|
if (Object.getOwnPropertySymbols) {
|
|
373
373
|
var d = Object.getOwnPropertySymbols(e);
|
|
374
374
|
for (s = 0; s < d.length; s++)
|
|
@@ -376,7 +376,7 @@ function Le(e, r) {
|
|
|
376
376
|
}
|
|
377
377
|
return n;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Ie(e, r) {
|
|
380
380
|
if (e == null) return {};
|
|
381
381
|
var n = {};
|
|
382
382
|
for (var t in e)
|
|
@@ -406,25 +406,25 @@ function ne(e, r) {
|
|
|
406
406
|
}
|
|
407
407
|
return n;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function q(e) {
|
|
410
410
|
for (var r = 1; r < arguments.length; r++) {
|
|
411
411
|
var n = arguments[r] != null ? arguments[r] : {};
|
|
412
412
|
r % 2 ? ne(Object(n), !0).forEach(function(t) {
|
|
413
|
-
|
|
413
|
+
je(e, t, n[t]);
|
|
414
414
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ne(Object(n)).forEach(function(t) {
|
|
415
415
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
return e;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
return r =
|
|
420
|
+
function je(e, r, n) {
|
|
421
|
+
return r = ze(r), r in e ? Object.defineProperty(e, r, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = n, e;
|
|
422
422
|
}
|
|
423
|
-
function
|
|
424
|
-
var r =
|
|
423
|
+
function ze(e) {
|
|
424
|
+
var r = De(e, "string");
|
|
425
425
|
return typeof r == "symbol" ? r : r + "";
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function De(e, r) {
|
|
428
428
|
if (typeof e != "object" || !e) return e;
|
|
429
429
|
var n = e[Symbol.toPrimitive];
|
|
430
430
|
if (n !== void 0) {
|
|
@@ -434,52 +434,52 @@ function Ie(e, r) {
|
|
|
434
434
|
}
|
|
435
435
|
return (r === "string" ? String : Number)(e);
|
|
436
436
|
}
|
|
437
|
-
function
|
|
438
|
-
return e && e.map((r, n) => /* @__PURE__ */
|
|
437
|
+
function ce(e) {
|
|
438
|
+
return e && e.map((r, n) => /* @__PURE__ */ A.createElement(r.tag, q({
|
|
439
439
|
key: n
|
|
440
|
-
}, r.attr),
|
|
440
|
+
}, r.attr), ce(r.child)));
|
|
441
441
|
}
|
|
442
442
|
function Q(e) {
|
|
443
|
-
return (r) => /* @__PURE__ */
|
|
444
|
-
attr:
|
|
445
|
-
}, r),
|
|
443
|
+
return (r) => /* @__PURE__ */ A.createElement(Ae, G({
|
|
444
|
+
attr: q({}, e.attr)
|
|
445
|
+
}, r), ce(e.child));
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function Ae(e) {
|
|
448
448
|
var r = (n) => {
|
|
449
449
|
var {
|
|
450
450
|
attr: t,
|
|
451
451
|
size: s,
|
|
452
452
|
title: d
|
|
453
|
-
} = e, p =
|
|
454
|
-
return n.className && (
|
|
453
|
+
} = e, p = Pe(e, Oe), u = s || n.size || "1em", c;
|
|
454
|
+
return n.className && (c = n.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ A.createElement("svg", G({
|
|
455
455
|
stroke: "currentColor",
|
|
456
456
|
fill: "currentColor",
|
|
457
457
|
strokeWidth: "0"
|
|
458
458
|
}, n.attr, t, p, {
|
|
459
|
-
className:
|
|
460
|
-
style:
|
|
459
|
+
className: c,
|
|
460
|
+
style: q(q({
|
|
461
461
|
color: e.color || n.color
|
|
462
462
|
}, n.style), e.style),
|
|
463
463
|
height: u,
|
|
464
464
|
width: u,
|
|
465
465
|
xmlns: "http://www.w3.org/2000/svg"
|
|
466
|
-
}), d && /* @__PURE__ */
|
|
466
|
+
}), d && /* @__PURE__ */ A.createElement("title", null, d), e.children);
|
|
467
467
|
};
|
|
468
|
-
return te !== void 0 ? /* @__PURE__ */
|
|
468
|
+
return te !== void 0 ? /* @__PURE__ */ A.createElement(te.Consumer, null, (n) => r(n)) : r(ie);
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function Me(e) {
|
|
471
471
|
return Q({ attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z" }, child: [] }] })(e);
|
|
472
472
|
}
|
|
473
|
-
const
|
|
473
|
+
const Te = {
|
|
474
474
|
xs: "w-3 h-3 text-[10px]",
|
|
475
475
|
sm: "w-4 h-4 text-xs",
|
|
476
476
|
md: "w-5 h-5 text-sm",
|
|
477
477
|
lg: "w-6 h-6 text-base"
|
|
478
|
-
},
|
|
478
|
+
}, Re = {
|
|
479
479
|
flat: "rounded-none",
|
|
480
480
|
rounded: "rounded-sm",
|
|
481
481
|
pill: "rounded-full"
|
|
482
|
-
},
|
|
482
|
+
}, Be = {
|
|
483
483
|
primary: "primary",
|
|
484
484
|
secondary: "secondary",
|
|
485
485
|
success: "success",
|
|
@@ -505,7 +505,7 @@ const Ae = {
|
|
|
505
505
|
"soft-info": "soft-info",
|
|
506
506
|
"soft-dark": "soft-dark",
|
|
507
507
|
"soft-light": "soft-light"
|
|
508
|
-
},
|
|
508
|
+
}, _e = A.forwardRef(
|
|
509
509
|
({
|
|
510
510
|
label: e,
|
|
511
511
|
boxSize: r = "md",
|
|
@@ -515,21 +515,21 @@ const Ae = {
|
|
|
515
515
|
disabled: d = !1,
|
|
516
516
|
className: p = "",
|
|
517
517
|
id: u,
|
|
518
|
-
value:
|
|
519
|
-
icon:
|
|
518
|
+
value: c,
|
|
519
|
+
icon: a,
|
|
520
520
|
children: o,
|
|
521
|
-
checked:
|
|
521
|
+
checked: l,
|
|
522
522
|
...f
|
|
523
|
-
},
|
|
524
|
-
const b = (
|
|
525
|
-
!d && s && s(
|
|
526
|
-
}, x = "mr-2 border flex items-center justify-center transition-all",
|
|
523
|
+
}, g) => {
|
|
524
|
+
const b = (m) => {
|
|
525
|
+
!d && s && s(m.target.checked), f.onChange && f.onChange(m);
|
|
526
|
+
}, x = "mr-2 border flex items-center justify-center transition-all", k = Te[r], $ = Re[n], N = Be[t] ?? "", w = t.startsWith("outline"), h = t.startsWith("soft"), I = `${x} ${k} ${$} ${N} ${l && (w || h || t === "link") ? "peer-checked:bg-current peer-checked:text-white" : l ? "peer-checked:bg-current" : ""}`, E = {
|
|
527
527
|
xs: "w-2 h-2",
|
|
528
528
|
sm: "w-2.5 h-2.5",
|
|
529
529
|
md: "w-3 h-3",
|
|
530
530
|
lg: "w-3.5 h-3.5"
|
|
531
531
|
};
|
|
532
|
-
return /* @__PURE__ */
|
|
532
|
+
return /* @__PURE__ */ S(
|
|
533
533
|
"label",
|
|
534
534
|
{
|
|
535
535
|
className: `flex items-center ${d ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} me-4 ${p}`,
|
|
@@ -539,24 +539,24 @@ const Ae = {
|
|
|
539
539
|
{
|
|
540
540
|
type: "checkbox",
|
|
541
541
|
className: "peer hidden",
|
|
542
|
-
checked:
|
|
542
|
+
checked: l,
|
|
543
543
|
onChange: b,
|
|
544
544
|
disabled: d,
|
|
545
545
|
id: u,
|
|
546
|
-
value:
|
|
547
|
-
ref:
|
|
546
|
+
value: c,
|
|
547
|
+
ref: g,
|
|
548
548
|
...f
|
|
549
549
|
}
|
|
550
550
|
),
|
|
551
|
-
/* @__PURE__ */ i("span", { className:
|
|
551
|
+
/* @__PURE__ */ i("span", { className: I.trim(), children: (l || f.defaultChecked) && (a ?? /* @__PURE__ */ i(Me, { className: `${E[r]}` })) }),
|
|
552
552
|
e || o ? /* @__PURE__ */ i("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-300", children: e ?? o }) : null
|
|
553
553
|
]
|
|
554
554
|
}
|
|
555
555
|
);
|
|
556
556
|
}
|
|
557
557
|
);
|
|
558
|
-
|
|
559
|
-
const
|
|
558
|
+
_e.displayName = "Checkbox";
|
|
559
|
+
const Ve = ({
|
|
560
560
|
label: e,
|
|
561
561
|
header: r,
|
|
562
562
|
items: n = [],
|
|
@@ -565,74 +565,74 @@ const Je = ({
|
|
|
565
565
|
position: d = "right",
|
|
566
566
|
className: p = "",
|
|
567
567
|
menuClassName: u = "",
|
|
568
|
-
width:
|
|
569
|
-
closeOnSelect:
|
|
568
|
+
width: c = "w-48",
|
|
569
|
+
closeOnSelect: a = !1,
|
|
570
570
|
transition: o = !0,
|
|
571
|
-
ariaLabel:
|
|
571
|
+
ariaLabel: l = "Dropdown menu",
|
|
572
572
|
...f
|
|
573
573
|
}) => {
|
|
574
|
-
const [
|
|
574
|
+
const [g, b] = D(!1), [x, k] = D(!1), $ = F(null), N = F(null), w = j(() => ({
|
|
575
575
|
left: "left-0",
|
|
576
576
|
center: "left-1/2 transform -translate-x-1/2",
|
|
577
577
|
right: "right-0"
|
|
578
|
-
})[d], [d]),
|
|
579
|
-
const
|
|
580
|
-
if (!
|
|
581
|
-
const { top:
|
|
582
|
-
|
|
583
|
-
}, []),
|
|
584
|
-
var
|
|
585
|
-
!((
|
|
586
|
-
}, []),
|
|
587
|
-
|
|
588
|
-
if (
|
|
589
|
-
return
|
|
590
|
-
window.removeEventListener("resize",
|
|
578
|
+
})[d], [d]), h = z(() => {
|
|
579
|
+
const m = N.current, C = $.current;
|
|
580
|
+
if (!m || !C) return;
|
|
581
|
+
const { top: O, bottom: M } = m.getBoundingClientRect(), B = C.offsetHeight, T = window.innerHeight - M, _ = O;
|
|
582
|
+
k(T < B && _ > B);
|
|
583
|
+
}, []), y = z((m) => {
|
|
584
|
+
var C, O;
|
|
585
|
+
!((C = $.current) != null && C.contains(m.target)) && !((O = N.current) != null && O.contains(m.target)) && b(!1);
|
|
586
|
+
}, []), v = z(() => b((m) => !m), []), I = z(() => b(!1), []);
|
|
587
|
+
R(() => {
|
|
588
|
+
if (g)
|
|
589
|
+
return h(), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0), () => {
|
|
590
|
+
window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
|
|
591
591
|
};
|
|
592
|
-
}, [
|
|
593
|
-
const
|
|
592
|
+
}, [g, h]), R(() => (document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y)), [y]);
|
|
593
|
+
const E = j(
|
|
594
594
|
() => [
|
|
595
595
|
"absolute z-50 bg-white rounded shadow-lg overflow-hidden w-auto",
|
|
596
596
|
x ? "bottom-full mb-2" : "top-full mt-2",
|
|
597
|
-
|
|
598
|
-
|
|
597
|
+
w,
|
|
598
|
+
c,
|
|
599
599
|
o && "transition-all duration-200 ease-out",
|
|
600
600
|
u
|
|
601
601
|
].filter(Boolean).join(" "),
|
|
602
|
-
[x,
|
|
602
|
+
[x, w, c, o, u]
|
|
603
603
|
);
|
|
604
|
-
return /* @__PURE__ */
|
|
604
|
+
return /* @__PURE__ */ S("div", { className: `relative inline-block ${p}`, ...f, children: [
|
|
605
605
|
/* @__PURE__ */ i(
|
|
606
606
|
"button",
|
|
607
607
|
{
|
|
608
608
|
type: "button",
|
|
609
|
-
ref:
|
|
610
|
-
onClick:
|
|
611
|
-
"aria-expanded":
|
|
612
|
-
"aria-label":
|
|
609
|
+
ref: N,
|
|
610
|
+
onClick: v,
|
|
611
|
+
"aria-expanded": g,
|
|
612
|
+
"aria-label": l,
|
|
613
613
|
className: "focus:outline-none",
|
|
614
614
|
children: e
|
|
615
615
|
}
|
|
616
616
|
),
|
|
617
|
-
|
|
617
|
+
g && /* @__PURE__ */ S("div", { ref: $, role: "menu", className: E, children: [
|
|
618
618
|
r && r,
|
|
619
|
-
n.map((
|
|
620
|
-
const
|
|
621
|
-
t && t(
|
|
619
|
+
n.map((m, C) => {
|
|
620
|
+
const O = () => {
|
|
621
|
+
t && t(m), a && I();
|
|
622
622
|
};
|
|
623
|
-
return /* @__PURE__ */ i("div", { children: s ? s(
|
|
623
|
+
return /* @__PURE__ */ i("div", { children: s ? s(m, O) : /* @__PURE__ */ i(
|
|
624
624
|
"div",
|
|
625
625
|
{
|
|
626
|
-
onClick:
|
|
626
|
+
onClick: O,
|
|
627
627
|
className: "px-4 py-2 text-sm text-gray-800 hover:bg-gray-100 cursor-pointer",
|
|
628
628
|
role: "menuitem",
|
|
629
|
-
children:
|
|
629
|
+
children: m.label
|
|
630
630
|
}
|
|
631
|
-
) },
|
|
631
|
+
) }, C);
|
|
632
632
|
})
|
|
633
633
|
] })
|
|
634
634
|
] });
|
|
635
|
-
},
|
|
635
|
+
}, et = ({
|
|
636
636
|
children: e,
|
|
637
637
|
content: r,
|
|
638
638
|
position: n = "top",
|
|
@@ -640,20 +640,20 @@ const Je = ({
|
|
|
640
640
|
tooltipClass: s = "",
|
|
641
641
|
tooltipStyle: d = {}
|
|
642
642
|
}) => {
|
|
643
|
-
const p =
|
|
644
|
-
|
|
645
|
-
const
|
|
646
|
-
if (!
|
|
647
|
-
const
|
|
643
|
+
const p = F(null), u = F(null);
|
|
644
|
+
R(() => {
|
|
645
|
+
const a = p.current, o = u.current;
|
|
646
|
+
if (!a || !o) return;
|
|
647
|
+
const l = () => {
|
|
648
648
|
o.style.opacity = "1", o.style.visibility = "visible";
|
|
649
649
|
}, f = () => {
|
|
650
650
|
o.style.opacity = "0", o.style.visibility = "hidden";
|
|
651
651
|
};
|
|
652
|
-
return
|
|
653
|
-
|
|
652
|
+
return a.addEventListener("mouseenter", l), a.addEventListener("mouseleave", f), () => {
|
|
653
|
+
a.removeEventListener("mouseenter", l), a.removeEventListener("mouseleave", f);
|
|
654
654
|
};
|
|
655
655
|
}, []);
|
|
656
|
-
const
|
|
656
|
+
const c = (a) => {
|
|
657
657
|
const o = {
|
|
658
658
|
position: "absolute",
|
|
659
659
|
opacity: 0,
|
|
@@ -671,7 +671,7 @@ const Je = ({
|
|
|
671
671
|
zIndex: 9999,
|
|
672
672
|
width: "max-content"
|
|
673
673
|
};
|
|
674
|
-
switch (
|
|
674
|
+
switch (a) {
|
|
675
675
|
case "top":
|
|
676
676
|
return {
|
|
677
677
|
...o,
|
|
@@ -708,7 +708,7 @@ const Je = ({
|
|
|
708
708
|
return o;
|
|
709
709
|
}
|
|
710
710
|
};
|
|
711
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ S("div", { ref: p, className: `relative inline-block ${t}`, children: [
|
|
712
712
|
e,
|
|
713
713
|
/* @__PURE__ */ i(
|
|
714
714
|
"div",
|
|
@@ -717,14 +717,14 @@ const Je = ({
|
|
|
717
717
|
role: "tooltip",
|
|
718
718
|
className: s,
|
|
719
719
|
style: {
|
|
720
|
-
...
|
|
720
|
+
...c(n),
|
|
721
721
|
...d
|
|
722
722
|
},
|
|
723
723
|
children: r
|
|
724
724
|
}
|
|
725
725
|
)
|
|
726
726
|
] });
|
|
727
|
-
},
|
|
727
|
+
}, Fe = {
|
|
728
728
|
primary: "bg-blue-500 text-white",
|
|
729
729
|
secondary: "bg-gray-500 text-white",
|
|
730
730
|
success: "bg-green-500 text-white",
|
|
@@ -742,18 +742,18 @@ const Je = ({
|
|
|
742
742
|
"outline-info": "border border-cyan-500 text-cyan-500 bg-transparent",
|
|
743
743
|
"outline-dark": "border border-black text-black bg-transparent",
|
|
744
744
|
"outline-light": "border border-gray-100 text-gray-800 bg-transparent"
|
|
745
|
-
},
|
|
745
|
+
}, Ke = {
|
|
746
746
|
xs: "text-xs px-2 py-0.5",
|
|
747
747
|
sm: "text-sm px-2.5 py-0.5",
|
|
748
748
|
md: "text-base px-3 py-1",
|
|
749
749
|
lg: "text-lg px-3.5 py-1.5",
|
|
750
750
|
xl: "text-xl px-4 py-2"
|
|
751
|
-
},
|
|
751
|
+
}, Ze = {
|
|
752
752
|
flat: "rounded-none",
|
|
753
753
|
rounded: "rounded-sm",
|
|
754
754
|
pill: "rounded-full",
|
|
755
755
|
circle: "rounded-full p-2 w-8 h-8 justify-center"
|
|
756
|
-
},
|
|
756
|
+
}, tt = ({
|
|
757
757
|
label: e,
|
|
758
758
|
variant: r = "primary",
|
|
759
759
|
size: n = "sm",
|
|
@@ -762,10 +762,10 @@ const Je = ({
|
|
|
762
762
|
dismissible: d,
|
|
763
763
|
onDismiss: p,
|
|
764
764
|
className: u = "",
|
|
765
|
-
...
|
|
765
|
+
...c
|
|
766
766
|
}) => {
|
|
767
|
-
const
|
|
768
|
-
return /* @__PURE__ */
|
|
767
|
+
const a = !e && !!s, o = `inline-flex items-center font-medium ${Fe[r] || ""} ${Ke[n] || ""} ${Ze[t] || ""} ${a ? "justify-center p-2 w-8 h-8" : ""} ` + u;
|
|
768
|
+
return /* @__PURE__ */ S("span", { className: o.trim(), ...c, children: [
|
|
769
769
|
s && /* @__PURE__ */ i("span", { className: e ? "mr-1" : "", children: s }),
|
|
770
770
|
e,
|
|
771
771
|
d && /* @__PURE__ */ i(
|
|
@@ -778,11 +778,127 @@ const Je = ({
|
|
|
778
778
|
}
|
|
779
779
|
)
|
|
780
780
|
] });
|
|
781
|
+
}, re = {
|
|
782
|
+
rounded: "rounded-md",
|
|
783
|
+
pill: "rounded-full",
|
|
784
|
+
flat: "rounded-none"
|
|
785
|
+
}, se = {
|
|
786
|
+
xs: {
|
|
787
|
+
button: "px-2 py-1 text-xs"
|
|
788
|
+
},
|
|
789
|
+
sm: {
|
|
790
|
+
button: "px-3 py-1.5 text-sm"
|
|
791
|
+
},
|
|
792
|
+
md: {
|
|
793
|
+
button: "px-4 py-2 text-sm"
|
|
794
|
+
},
|
|
795
|
+
lg: {
|
|
796
|
+
button: "px-5 py-3 text-base"
|
|
797
|
+
},
|
|
798
|
+
xl: {
|
|
799
|
+
button: "px-6 py-4 text-lg"
|
|
800
|
+
}
|
|
781
801
|
};
|
|
782
|
-
function
|
|
802
|
+
function nt({
|
|
803
|
+
options: e,
|
|
804
|
+
selected: r,
|
|
805
|
+
onChange: n,
|
|
806
|
+
label: t,
|
|
807
|
+
disabled: s = !1,
|
|
808
|
+
shape: d = "rounded",
|
|
809
|
+
variant: p = "primary",
|
|
810
|
+
size: u = "md",
|
|
811
|
+
className: c = "",
|
|
812
|
+
classNames: a = {},
|
|
813
|
+
id: o,
|
|
814
|
+
name: l,
|
|
815
|
+
renderOption: f
|
|
816
|
+
}) {
|
|
817
|
+
const g = re[d] || re.rounded, b = se[u] || se.md, x = F(null), [k, $] = D({});
|
|
818
|
+
R(() => {
|
|
819
|
+
if (!x.current) return;
|
|
820
|
+
const w = e.findIndex((v) => v.value === r);
|
|
821
|
+
if (w === -1) return;
|
|
822
|
+
const y = x.current.querySelectorAll("button")[w];
|
|
823
|
+
if (y) {
|
|
824
|
+
const { offsetLeft: v, offsetWidth: I, offsetHeight: E } = y;
|
|
825
|
+
$({
|
|
826
|
+
transform: `translateX(${v}px)`,
|
|
827
|
+
width: I,
|
|
828
|
+
height: E
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
}, [r, e, u]);
|
|
832
|
+
const N = `toggler-${p}`;
|
|
833
|
+
return /* @__PURE__ */ S(
|
|
834
|
+
"div",
|
|
835
|
+
{
|
|
836
|
+
className: `flex flex-col gap-2 w-fit ${c} ${a.root ?? ""}`,
|
|
837
|
+
id: o,
|
|
838
|
+
children: [
|
|
839
|
+
t && /* @__PURE__ */ i(
|
|
840
|
+
"span",
|
|
841
|
+
{
|
|
842
|
+
className: `text-sm font-medium select-none ${a.label ?? ""}`,
|
|
843
|
+
children: t
|
|
844
|
+
}
|
|
845
|
+
),
|
|
846
|
+
/* @__PURE__ */ S(
|
|
847
|
+
"div",
|
|
848
|
+
{
|
|
849
|
+
ref: x,
|
|
850
|
+
role: "radiogroup",
|
|
851
|
+
"aria-disabled": s,
|
|
852
|
+
className: `relative inline-flex overflow-hidden border border-gray-300 bg-gray-100 ${g} ${s ? "opacity-50 cursor-not-allowed" : ""} ${a.group ?? ""}`,
|
|
853
|
+
children: [
|
|
854
|
+
/* @__PURE__ */ i(
|
|
855
|
+
"div",
|
|
856
|
+
{
|
|
857
|
+
className: `absolute top-0 left-0 transition-transform duration-300 ease-in-out ${g} ${N}`,
|
|
858
|
+
style: {
|
|
859
|
+
...k,
|
|
860
|
+
zIndex: 0
|
|
861
|
+
},
|
|
862
|
+
"aria-hidden": "true"
|
|
863
|
+
}
|
|
864
|
+
),
|
|
865
|
+
e.map((w) => {
|
|
866
|
+
const h = r === w.value, y = s || w.disabled;
|
|
867
|
+
return /* @__PURE__ */ i(
|
|
868
|
+
"button",
|
|
869
|
+
{
|
|
870
|
+
role: "radio",
|
|
871
|
+
name: l,
|
|
872
|
+
"aria-checked": h,
|
|
873
|
+
disabled: y,
|
|
874
|
+
onClick: () => !y && n(w.value),
|
|
875
|
+
onKeyDown: (v) => {
|
|
876
|
+
(v.key === "Enter" || v.key === " ") && !y && (v.preventDefault(), n(w.value));
|
|
877
|
+
},
|
|
878
|
+
className: `
|
|
879
|
+
relative z-10
|
|
880
|
+
transition-colors duration-200 focus:outline-none
|
|
881
|
+
${b.button}
|
|
882
|
+
${h ? `text-white toggler-text-${p}` : "text-gray-700 hover:bg-gray-200"}
|
|
883
|
+
${a.option ?? ""}
|
|
884
|
+
${h ? a.selectedOption ?? "" : ""}
|
|
885
|
+
`,
|
|
886
|
+
children: f ? f(w, h) : w.label
|
|
887
|
+
},
|
|
888
|
+
String(w.value)
|
|
889
|
+
);
|
|
890
|
+
})
|
|
891
|
+
]
|
|
892
|
+
}
|
|
893
|
+
)
|
|
894
|
+
]
|
|
895
|
+
}
|
|
896
|
+
);
|
|
897
|
+
}
|
|
898
|
+
function He(e) {
|
|
783
899
|
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);
|
|
784
900
|
}
|
|
785
|
-
const
|
|
901
|
+
const rt = ({
|
|
786
902
|
items: e,
|
|
787
903
|
allowMultipleOpen: r = !1,
|
|
788
904
|
className: n = "",
|
|
@@ -791,13 +907,13 @@ const et = ({
|
|
|
791
907
|
onChange: d,
|
|
792
908
|
renderTitle: p,
|
|
793
909
|
renderContent: u,
|
|
794
|
-
showArrowIcon:
|
|
795
|
-
panelClasses:
|
|
910
|
+
showArrowIcon: c = !0,
|
|
911
|
+
panelClasses: a = ""
|
|
796
912
|
}) => {
|
|
797
|
-
const [o,
|
|
913
|
+
const [o, l] = D(/* @__PURE__ */ new Set()), f = j(() => s ? new Set(s) : o, [s, o]), g = z(
|
|
798
914
|
(b) => {
|
|
799
915
|
const x = new Set(f);
|
|
800
|
-
x.has(b) ? x.delete(b) : (r || x.clear(), x.add(b)), s && d ? d(Array.from(x)) :
|
|
916
|
+
x.has(b) ? x.delete(b) : (r || x.clear(), x.add(b)), s && d ? d(Array.from(x)) : l(x);
|
|
801
917
|
},
|
|
802
918
|
[f, s, d, r]
|
|
803
919
|
);
|
|
@@ -808,35 +924,35 @@ const et = ({
|
|
|
808
924
|
role: "region",
|
|
809
925
|
"aria-multiselectable": r,
|
|
810
926
|
children: e.map((b) => {
|
|
811
|
-
const x = f.has(b.id),
|
|
812
|
-
return /* @__PURE__ */
|
|
927
|
+
const x = f.has(b.id), k = `accordion-heading-${b.id}`, $ = `accordion-panel-${b.id}`;
|
|
928
|
+
return /* @__PURE__ */ S(
|
|
813
929
|
"div",
|
|
814
930
|
{
|
|
815
931
|
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${n}`,
|
|
816
932
|
children: [
|
|
817
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ S(
|
|
818
934
|
"button",
|
|
819
935
|
{
|
|
820
|
-
id:
|
|
936
|
+
id: k,
|
|
821
937
|
type: "button",
|
|
822
938
|
"aria-expanded": x,
|
|
823
|
-
"aria-controls":
|
|
824
|
-
onClick: () =>
|
|
939
|
+
"aria-controls": $,
|
|
940
|
+
onClick: () => g(b.id),
|
|
825
941
|
className: `flex justify-between items-center w-full p-1.5 text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3 ${t}`,
|
|
826
942
|
children: [
|
|
827
943
|
p ? p(b, x) : b.title,
|
|
828
|
-
|
|
944
|
+
c ? /* @__PURE__ */ i(He, {}) : null
|
|
829
945
|
]
|
|
830
946
|
}
|
|
831
947
|
),
|
|
832
948
|
/* @__PURE__ */ i(
|
|
833
949
|
"div",
|
|
834
950
|
{
|
|
835
|
-
id:
|
|
951
|
+
id: $,
|
|
836
952
|
role: "region",
|
|
837
|
-
"aria-labelledby":
|
|
953
|
+
"aria-labelledby": k,
|
|
838
954
|
hidden: !x,
|
|
839
|
-
className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${
|
|
955
|
+
className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${a}`,
|
|
840
956
|
children: u ? u(b, x) : b.content
|
|
841
957
|
}
|
|
842
958
|
)
|
|
@@ -847,15 +963,15 @@ const et = ({
|
|
|
847
963
|
})
|
|
848
964
|
}
|
|
849
965
|
);
|
|
850
|
-
},
|
|
851
|
-
const e =
|
|
966
|
+
}, de = ae(null), ue = () => {
|
|
967
|
+
const e = le(de);
|
|
852
968
|
if (!e)
|
|
853
969
|
throw new Error(
|
|
854
970
|
"useModalActions must be used within a ModalActionProvider"
|
|
855
971
|
);
|
|
856
972
|
return e;
|
|
857
|
-
},
|
|
858
|
-
function
|
|
973
|
+
}, fe = ae(null), pe = () => le(fe);
|
|
974
|
+
function st({
|
|
859
975
|
id: e,
|
|
860
976
|
title: r,
|
|
861
977
|
children: n,
|
|
@@ -864,54 +980,54 @@ function tt({
|
|
|
864
980
|
containerClasses: d = "",
|
|
865
981
|
headerClasses: p = "",
|
|
866
982
|
bodyClasses: u = "",
|
|
867
|
-
onClose:
|
|
868
|
-
disableEscapeClose:
|
|
983
|
+
onClose: c,
|
|
984
|
+
disableEscapeClose: a = !1,
|
|
869
985
|
closeBtnStyle: o
|
|
870
986
|
}) {
|
|
871
|
-
const
|
|
872
|
-
|
|
873
|
-
}, [
|
|
874
|
-
return
|
|
875
|
-
const
|
|
987
|
+
const l = pe(), f = ue(), g = !t && !!l && !!f, [b, x] = D(!1), k = g ? l.isOpen(e) : b, $ = g ? l.getModalData(e) : null, N = z(() => {
|
|
988
|
+
g ? f.closeModal(e) : x(!1), c == null || c();
|
|
989
|
+
}, [g, f, e, c]);
|
|
990
|
+
return R(() => {
|
|
991
|
+
const w = document.activeElement, h = document.getElementById(e), y = [
|
|
876
992
|
"a[href]",
|
|
877
993
|
"button:not([disabled])",
|
|
878
994
|
"textarea:not([disabled])",
|
|
879
995
|
"input:not([disabled])",
|
|
880
996
|
"select:not([disabled])",
|
|
881
997
|
'[tabindex]:not([tabindex="-1"])'
|
|
882
|
-
],
|
|
883
|
-
if (!
|
|
884
|
-
const
|
|
885
|
-
|
|
998
|
+
], v = () => {
|
|
999
|
+
if (!h) return [];
|
|
1000
|
+
const m = h.querySelectorAll(
|
|
1001
|
+
y.join(",")
|
|
886
1002
|
);
|
|
887
|
-
return Array.from(
|
|
888
|
-
},
|
|
889
|
-
if (
|
|
890
|
-
const
|
|
891
|
-
if (
|
|
892
|
-
const
|
|
893
|
-
|
|
1003
|
+
return Array.from(m).filter((C) => C.offsetParent !== null);
|
|
1004
|
+
}, I = (m) => {
|
|
1005
|
+
if (m.key === "Tab") {
|
|
1006
|
+
const C = v();
|
|
1007
|
+
if (C.length === 0) return;
|
|
1008
|
+
const O = C[0], M = C[C.length - 1];
|
|
1009
|
+
m.shiftKey ? document.activeElement === O && (m.preventDefault(), M.focus()) : document.activeElement === M && (m.preventDefault(), O.focus());
|
|
894
1010
|
}
|
|
895
|
-
},
|
|
896
|
-
|
|
1011
|
+
}, E = (m) => {
|
|
1012
|
+
m.key === "Escape" && !a && N(), I(m);
|
|
897
1013
|
};
|
|
898
|
-
return
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
}, 0), window.addEventListener("keydown",
|
|
902
|
-
document.body.style.overflow = "",
|
|
1014
|
+
return k && (document.body.style.overflow = "hidden", setTimeout(() => {
|
|
1015
|
+
const m = v();
|
|
1016
|
+
m.length && m[0].focus();
|
|
1017
|
+
}, 0), window.addEventListener("keydown", E)), () => {
|
|
1018
|
+
document.body.style.overflow = "", w && w.focus(), window.removeEventListener("keydown", E);
|
|
903
1019
|
};
|
|
904
|
-
}, [
|
|
1020
|
+
}, [k, a, N, e]), k ? /* @__PURE__ */ i(
|
|
905
1021
|
"div",
|
|
906
1022
|
{
|
|
907
1023
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",
|
|
908
1024
|
id: e,
|
|
909
|
-
children: /* @__PURE__ */
|
|
1025
|
+
children: /* @__PURE__ */ S(
|
|
910
1026
|
"div",
|
|
911
1027
|
{
|
|
912
1028
|
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${d}`,
|
|
913
1029
|
children: [
|
|
914
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ S(
|
|
915
1031
|
"div",
|
|
916
1032
|
{
|
|
917
1033
|
className: `flex justify-between items-center relative ${p}`,
|
|
@@ -920,7 +1036,7 @@ function tt({
|
|
|
920
1036
|
s && /* @__PURE__ */ i(
|
|
921
1037
|
"button",
|
|
922
1038
|
{
|
|
923
|
-
onClick:
|
|
1039
|
+
onClick: N,
|
|
924
1040
|
className: `text-gray-500 hover:text-black absolute top-0 right-3 hover:bg-gray-200 rounded-full aspect-square w-8 ${o}`,
|
|
925
1041
|
"aria-label": "Close modal",
|
|
926
1042
|
children: "✕"
|
|
@@ -929,37 +1045,37 @@ function tt({
|
|
|
929
1045
|
]
|
|
930
1046
|
}
|
|
931
1047
|
),
|
|
932
|
-
/* @__PURE__ */ i("div", { className: u, children: typeof n == "function" ? n({ modalData:
|
|
1048
|
+
/* @__PURE__ */ i("div", { className: u, children: typeof n == "function" ? n({ modalData: $ }) : n })
|
|
933
1049
|
]
|
|
934
1050
|
}
|
|
935
1051
|
)
|
|
936
1052
|
}
|
|
937
1053
|
) : null;
|
|
938
1054
|
}
|
|
939
|
-
function
|
|
1055
|
+
function ot({
|
|
940
1056
|
children: e
|
|
941
1057
|
}) {
|
|
942
|
-
const [r, n] =
|
|
943
|
-
n((
|
|
944
|
-
}, []), p =
|
|
945
|
-
n((f) => ({ ...f, [
|
|
946
|
-
const
|
|
947
|
-
return delete
|
|
1058
|
+
const [r, n] = D({}), [t, s] = D({}), d = z((l, f) => {
|
|
1059
|
+
n((g) => ({ ...g, [l]: !0 })), f && s((g) => ({ ...g, [l]: f }));
|
|
1060
|
+
}, []), p = z((l) => {
|
|
1061
|
+
n((f) => ({ ...f, [l]: !1 })), s((f) => {
|
|
1062
|
+
const g = { ...f };
|
|
1063
|
+
return delete g[l], g;
|
|
948
1064
|
});
|
|
949
|
-
}, []), u =
|
|
950
|
-
(
|
|
1065
|
+
}, []), u = z((l) => !!r[l], [r]), c = z(
|
|
1066
|
+
(l) => t[l],
|
|
951
1067
|
[t]
|
|
952
|
-
),
|
|
1068
|
+
), a = j(
|
|
953
1069
|
() => ({ openModal: d, closeModal: p }),
|
|
954
1070
|
[d, p]
|
|
955
1071
|
), o = j(
|
|
956
|
-
() => ({ isOpen: u, getModalData:
|
|
957
|
-
[u,
|
|
1072
|
+
() => ({ isOpen: u, getModalData: c }),
|
|
1073
|
+
[u, c]
|
|
958
1074
|
);
|
|
959
|
-
return /* @__PURE__ */ i(
|
|
1075
|
+
return /* @__PURE__ */ i(de.Provider, { value: a, children: /* @__PURE__ */ i(fe.Provider, { value: o, children: e }) });
|
|
960
1076
|
}
|
|
961
|
-
function
|
|
962
|
-
const { openModal: r, closeModal: n } =
|
|
1077
|
+
function at(e) {
|
|
1078
|
+
const { openModal: r, closeModal: n } = ue(), { isOpen: t, getModalData: s } = pe();
|
|
963
1079
|
return {
|
|
964
1080
|
open: (d) => r(e, d),
|
|
965
1081
|
close: () => n(e),
|
|
@@ -968,56 +1084,56 @@ function rt(e) {
|
|
|
968
1084
|
};
|
|
969
1085
|
}
|
|
970
1086
|
let Y = null, J = {};
|
|
971
|
-
function
|
|
1087
|
+
function We(e) {
|
|
972
1088
|
Y = e;
|
|
973
1089
|
}
|
|
974
|
-
function
|
|
1090
|
+
function lt(e) {
|
|
975
1091
|
J = { ...J, ...e };
|
|
976
1092
|
}
|
|
977
|
-
function
|
|
1093
|
+
function Ge() {
|
|
978
1094
|
return J;
|
|
979
1095
|
}
|
|
980
|
-
function
|
|
1096
|
+
function it(e, r, n = 3e3, t) {
|
|
981
1097
|
Y ? Y(e, r, n, t) : console.warn("Toast system is not mounted");
|
|
982
1098
|
}
|
|
983
|
-
function
|
|
1099
|
+
function qe(e) {
|
|
984
1100
|
return Q({ attr: { viewBox: "0 0 15 15", fill: "none" }, child: [{ tag: "path", attr: { fillRule: "evenodd", clipRule: "evenodd", d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor" }, child: [] }] })(e);
|
|
985
1101
|
}
|
|
986
|
-
const
|
|
1102
|
+
const Ue = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
987
1103
|
const r = Math.random() * 16 | 0;
|
|
988
1104
|
return (e === "x" ? r : r & 3 | 8).toString(16);
|
|
989
|
-
}),
|
|
990
|
-
const [e, r] =
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
const u =
|
|
994
|
-
r((
|
|
995
|
-
r((
|
|
1105
|
+
}), ct = () => {
|
|
1106
|
+
const [e, r] = D([]);
|
|
1107
|
+
R(() => {
|
|
1108
|
+
We((t, s, d, p) => {
|
|
1109
|
+
const u = Ue();
|
|
1110
|
+
r((c) => [...c, { id: u, type: t, message: s, config: p }]), setTimeout(() => {
|
|
1111
|
+
r((c) => c.filter((a) => a.id !== u));
|
|
996
1112
|
}, d);
|
|
997
1113
|
});
|
|
998
1114
|
}, []);
|
|
999
|
-
const n =
|
|
1115
|
+
const n = Ge();
|
|
1000
1116
|
return /* @__PURE__ */ i("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((t) => {
|
|
1001
|
-
var
|
|
1002
|
-
const s = ((
|
|
1003
|
-
return /* @__PURE__ */
|
|
1117
|
+
var c, a, o, l, f, g, b, x, k, $, N, w, h;
|
|
1118
|
+
const s = ((c = t.config) == null ? void 0 : c.icon) || ((a = n.icons) == null ? void 0 : a[t.type]) || Xe(t.type), d = ((o = t.config) == null ? void 0 : o.bgColor) || ((f = (l = n.colors) == null ? void 0 : l[t.type]) == null ? void 0 : f.bg) || "bg-white dark:bg-gray-800", p = ((g = t.config) == null ? void 0 : g.textColor) || ((x = (b = n.colors) == null ? void 0 : b[t.type]) == null ? void 0 : x.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";
|
|
1119
|
+
return /* @__PURE__ */ S(
|
|
1004
1120
|
"div",
|
|
1005
1121
|
{
|
|
1006
1122
|
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${d} ${p}`,
|
|
1007
1123
|
children: [
|
|
1008
1124
|
/* @__PURE__ */ i("div", { className: u, children: s }),
|
|
1009
|
-
/* @__PURE__ */
|
|
1010
|
-
((
|
|
1011
|
-
((
|
|
1012
|
-
!((
|
|
1125
|
+
/* @__PURE__ */ S("div", { className: "flex-1 me-3", children: [
|
|
1126
|
+
(($ = t.config) == null ? void 0 : $.title) && /* @__PURE__ */ i("div", { className: "font-semibold text-black", children: t.config.title }),
|
|
1127
|
+
((N = t.config) == null ? void 0 : N.description) && /* @__PURE__ */ i("div", { className: "text-sm text-gray-500", children: t.config.description }),
|
|
1128
|
+
!((w = t.config) != null && w.title) && !((h = t.config) != null && h.description) && /* @__PURE__ */ i("div", { className: "text-sm", children: t.message })
|
|
1013
1129
|
] }),
|
|
1014
1130
|
/* @__PURE__ */ i(
|
|
1015
1131
|
"button",
|
|
1016
1132
|
{
|
|
1017
|
-
onClick: () => r((
|
|
1133
|
+
onClick: () => r((y) => y.filter((v) => v.id !== t.id)),
|
|
1018
1134
|
className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
|
|
1019
1135
|
"aria-label": "Close",
|
|
1020
|
-
children: /* @__PURE__ */ i(
|
|
1136
|
+
children: /* @__PURE__ */ i(qe, { size: 18 })
|
|
1021
1137
|
}
|
|
1022
1138
|
)
|
|
1023
1139
|
]
|
|
@@ -1026,7 +1142,7 @@ const Ge = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, functio
|
|
|
1026
1142
|
);
|
|
1027
1143
|
}) });
|
|
1028
1144
|
};
|
|
1029
|
-
function
|
|
1145
|
+
function Xe(e) {
|
|
1030
1146
|
switch (e) {
|
|
1031
1147
|
case "success":
|
|
1032
1148
|
return "✅";
|
|
@@ -1039,20 +1155,21 @@ function Ue(e) {
|
|
|
1039
1155
|
}
|
|
1040
1156
|
}
|
|
1041
1157
|
export {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1158
|
+
rt as Accordion,
|
|
1159
|
+
tt as Badge,
|
|
1160
|
+
Qe as Button,
|
|
1161
|
+
_e as Checkbox,
|
|
1162
|
+
Ve as Dropdown,
|
|
1163
|
+
ye as Input,
|
|
1164
|
+
st as Modal,
|
|
1165
|
+
ot as ModalProvider,
|
|
1166
|
+
Se as Select,
|
|
1167
|
+
ct as Toast,
|
|
1168
|
+
nt as Toggler,
|
|
1169
|
+
et as Tooltip,
|
|
1170
|
+
lt as setToastDefaults,
|
|
1171
|
+
it as showToast,
|
|
1172
|
+
ue as useModalActions,
|
|
1173
|
+
at as useModalInstance,
|
|
1174
|
+
pe as useModalState
|
|
1058
1175
|
};
|