tailwind-ux-kit 1.0.102 → 1.0.105
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/BottomSheet/index.d.ts +3 -0
- package/lib/components/modal/Modal.d.ts +3 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/tailwind-ux-kit.es.js +636 -476
- package/lib/tailwind-ux-kit.umd.js +28 -12
- package/package.json +1 -1
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
|
|
2
|
+
import { jsxs as E, jsx as d, Fragment as me } from "react/jsx-runtime";
|
|
3
|
+
import K, { forwardRef as ie, useState as z, useMemo as _, useId as he, useRef as F, useCallback as I, useEffect as T, createContext as V, useContext as ee } from "react";
|
|
4
|
+
import { createPortal as xe } from "react-dom";
|
|
5
|
+
const ne = {
|
|
5
6
|
xs: "text-xs px-2 py-1",
|
|
6
7
|
sm: "text-sm px-3 py-1.5",
|
|
7
8
|
md: "text-sm px-3 py-3",
|
|
8
9
|
lg: "text-lg px-5 py-3"
|
|
9
|
-
},
|
|
10
|
+
}, re = {
|
|
10
11
|
flat: "rounded-none",
|
|
11
12
|
rounded: "rounded-sm",
|
|
12
13
|
pill: "rounded-full"
|
|
13
|
-
},
|
|
14
|
+
}, ye = {
|
|
14
15
|
filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
|
|
15
16
|
outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
|
|
16
17
|
standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
|
|
17
|
-
},
|
|
18
|
+
}, we = {
|
|
18
19
|
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
20
|
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
21
|
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
|
+
}, ve = (e, n, t) => {
|
|
22
23
|
if (t)
|
|
23
24
|
return "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";
|
|
24
25
|
if (n)
|
|
@@ -33,130 +34,130 @@ const te = {
|
|
|
33
34
|
default:
|
|
34
35
|
return "border-gray-300 focus:ring-blue-500";
|
|
35
36
|
}
|
|
36
|
-
},
|
|
37
|
+
}, Ce = ie((e, n) => {
|
|
37
38
|
const {
|
|
38
39
|
label: t,
|
|
39
40
|
id: r,
|
|
40
|
-
inputSize:
|
|
41
|
-
shape:
|
|
42
|
-
validate:
|
|
43
|
-
onValidatedChange:
|
|
44
|
-
className:
|
|
41
|
+
inputSize: o = "md",
|
|
42
|
+
shape: u = "rounded",
|
|
43
|
+
validate: g,
|
|
44
|
+
onValidatedChange: c,
|
|
45
|
+
className: f = "",
|
|
45
46
|
icon: a,
|
|
46
|
-
iconPosition:
|
|
47
|
+
iconPosition: s = "left",
|
|
47
48
|
floatingLabelStyle: l,
|
|
48
|
-
onChange:
|
|
49
|
+
onChange: i,
|
|
49
50
|
isValid: x,
|
|
50
|
-
isInvalid:
|
|
51
|
+
isInvalid: p,
|
|
51
52
|
feedback: b,
|
|
52
53
|
iconClasses: C,
|
|
53
|
-
feedbackType:
|
|
54
|
-
labelClasses:
|
|
55
|
-
inputType:
|
|
56
|
-
inputPattern:
|
|
57
|
-
...
|
|
58
|
-
} = e, [
|
|
59
|
-
(
|
|
60
|
-
const
|
|
61
|
-
|
|
54
|
+
feedbackType: $ = "invalid",
|
|
55
|
+
labelClasses: L = "",
|
|
56
|
+
inputType: y = "",
|
|
57
|
+
inputPattern: w,
|
|
58
|
+
...h
|
|
59
|
+
} = e, [v, P] = z("default"), S = K.useCallback(
|
|
60
|
+
(B) => {
|
|
61
|
+
const A = B.target.value, Y = (g == null ? void 0 : g(A)) ?? "default";
|
|
62
|
+
P(Y), c == null || c(B, Y), i == null || i(B);
|
|
62
63
|
},
|
|
63
|
-
[
|
|
64
|
-
),
|
|
65
|
-
() =>
|
|
66
|
-
[
|
|
67
|
-
),
|
|
68
|
-
var
|
|
69
|
-
const
|
|
70
|
-
!(
|
|
71
|
-
const W = /^\d$/,
|
|
72
|
-
switch (
|
|
64
|
+
[g, c, i]
|
|
65
|
+
), O = _(() => r || (typeof t == "string" ? `input-${t.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [r, t]), j = !!l, m = ne[o] || ne.md, N = re[u] || re.flat, D = _(
|
|
66
|
+
() => ve(v, x, p),
|
|
67
|
+
[v, x, p]
|
|
68
|
+
), k = _(() => s === "start" || s === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [s]), M = _(() => a ? s === "start" || s === "left" ? "ps-10" : "pe-10" : "", [a, s]), R = (B) => {
|
|
69
|
+
var Z;
|
|
70
|
+
const A = B.key;
|
|
71
|
+
!(B.ctrlKey || B.metaKey || A.length !== 1 || ["Backspace", "ArrowLeft", "ArrowRight", "Delete", "Tab"].includes(A)) && (() => {
|
|
72
|
+
const W = /^\d$/, X = /^[a-zA-Z]$/;
|
|
73
|
+
switch (y) {
|
|
73
74
|
case "numeric":
|
|
74
75
|
case "number":
|
|
75
76
|
case "integer":
|
|
76
|
-
return !W.test(
|
|
77
|
+
return !W.test(A);
|
|
77
78
|
case "decimal":
|
|
78
|
-
return !W.test(
|
|
79
|
+
return !W.test(A) && A !== "." && A !== "Backspace" && A !== "Tab";
|
|
79
80
|
case "alphabetic":
|
|
80
|
-
return !
|
|
81
|
+
return !X.test(A);
|
|
81
82
|
case "custom":
|
|
82
|
-
return
|
|
83
|
+
return w ? !w.test(A) : !1;
|
|
83
84
|
default:
|
|
84
85
|
return !1;
|
|
85
86
|
}
|
|
86
|
-
})() &&
|
|
87
|
-
},
|
|
88
|
-
var
|
|
89
|
-
const
|
|
87
|
+
})() && B.preventDefault(), (Z = h.onKeyDown) == null || Z.call(h, B);
|
|
88
|
+
}, H = (B) => {
|
|
89
|
+
var q;
|
|
90
|
+
const A = B.clipboardData.getData("Text");
|
|
90
91
|
(() => {
|
|
91
|
-
const
|
|
92
|
-
switch (
|
|
92
|
+
const Z = /^\d+$/, W = /^\d*\.?\d*$/, X = /^[a-zA-Z]+$/;
|
|
93
|
+
switch (y) {
|
|
93
94
|
case "numeric":
|
|
94
95
|
case "number":
|
|
95
96
|
case "integer":
|
|
96
|
-
return !
|
|
97
|
+
return !Z.test(A);
|
|
97
98
|
case "decimal":
|
|
98
|
-
return !W.test(
|
|
99
|
+
return !W.test(A);
|
|
99
100
|
case "alphabetic":
|
|
100
|
-
return !
|
|
101
|
+
return !X.test(A);
|
|
101
102
|
case "custom":
|
|
102
|
-
return
|
|
103
|
+
return w ? !w.test(A) : !1;
|
|
103
104
|
default:
|
|
104
105
|
return !1;
|
|
105
106
|
}
|
|
106
|
-
})() &&
|
|
107
|
+
})() && B.preventDefault(), (q = h.onPaste) == null || q.call(h, B);
|
|
107
108
|
};
|
|
108
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ E(
|
|
109
110
|
"div",
|
|
110
111
|
{
|
|
111
|
-
className: `w-full relative ${
|
|
112
|
+
className: `w-full relative ${j ? "z-0" : ""} tailwind-ux-input`,
|
|
112
113
|
children: [
|
|
113
|
-
!
|
|
114
|
+
!j && t && /* @__PURE__ */ d(
|
|
114
115
|
"label",
|
|
115
116
|
{
|
|
116
|
-
htmlFor:
|
|
117
|
-
className: `block mb-1 text-sm ${x ? "text-green-700 dark:text-green-500" :
|
|
117
|
+
htmlFor: O,
|
|
118
|
+
className: `block mb-1 text-sm ${x ? "text-green-700 dark:text-green-500" : p ? "text-red-700 dark:text-red-500" : "text-gray-700"} ${L}`,
|
|
118
119
|
children: t
|
|
119
120
|
}
|
|
120
121
|
),
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
a && /* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ E("div", { className: "relative w-full", children: [
|
|
123
|
+
a && /* @__PURE__ */ d(
|
|
123
124
|
"div",
|
|
124
125
|
{
|
|
125
|
-
className: `absolute inset-y-0 flex items-center ${
|
|
126
|
+
className: `absolute inset-y-0 flex items-center ${k} ${C}`,
|
|
126
127
|
"aria-hidden": "true",
|
|
127
128
|
children: a
|
|
128
129
|
}
|
|
129
130
|
),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ d(
|
|
131
132
|
"input",
|
|
132
133
|
{
|
|
133
|
-
...
|
|
134
|
-
id:
|
|
134
|
+
...h,
|
|
135
|
+
id: O,
|
|
135
136
|
ref: n,
|
|
136
|
-
placeholder:
|
|
137
|
-
onChange:
|
|
138
|
-
onKeyDown:
|
|
139
|
-
onPaste:
|
|
137
|
+
placeholder: j ? " " : h.placeholder,
|
|
138
|
+
onChange: S,
|
|
139
|
+
onKeyDown: R,
|
|
140
|
+
onPaste: H,
|
|
140
141
|
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
|
-
${
|
|
142
|
+
${m}
|
|
143
|
+
${j && l && ye[l]}
|
|
144
|
+
${M} ${N} ${D} ${f}`
|
|
144
145
|
}
|
|
145
146
|
),
|
|
146
|
-
|
|
147
|
+
j && t && l && /* @__PURE__ */ d(
|
|
147
148
|
"label",
|
|
148
149
|
{
|
|
149
|
-
htmlFor:
|
|
150
|
-
className: `ms-1 ${
|
|
150
|
+
htmlFor: O,
|
|
151
|
+
className: `ms-1 ${we[l]} ${f}`,
|
|
151
152
|
children: t
|
|
152
153
|
}
|
|
153
154
|
)
|
|
154
155
|
] }),
|
|
155
|
-
b && /* @__PURE__ */
|
|
156
|
+
b && /* @__PURE__ */ d(
|
|
156
157
|
"p",
|
|
157
158
|
{
|
|
158
|
-
className: `mt-1 text-xs ${
|
|
159
|
-
role:
|
|
159
|
+
className: `mt-1 text-xs ${$ === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
|
|
160
|
+
role: $ === "invalid" ? "alert" : void 0,
|
|
160
161
|
children: b
|
|
161
162
|
}
|
|
162
163
|
)
|
|
@@ -164,25 +165,25 @@ const te = {
|
|
|
164
165
|
}
|
|
165
166
|
);
|
|
166
167
|
});
|
|
167
|
-
|
|
168
|
-
const
|
|
168
|
+
Ce.displayName = "Input";
|
|
169
|
+
const $e = {
|
|
169
170
|
xs: "text-xs px-2 py-1",
|
|
170
171
|
sm: "text-sm px-3 py-1.5",
|
|
171
172
|
md: "text-sm px-3 py-3",
|
|
172
173
|
lg: "text-lg px-5 py-3"
|
|
173
|
-
},
|
|
174
|
+
}, ke = {
|
|
174
175
|
flat: "rounded-none",
|
|
175
176
|
rounded: "rounded-sm",
|
|
176
177
|
pill: "rounded-full"
|
|
177
|
-
},
|
|
178
|
+
}, Se = {
|
|
178
179
|
filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
|
|
179
180
|
outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
|
|
180
181
|
standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
|
|
181
|
-
},
|
|
182
|
+
}, Ne = {
|
|
182
183
|
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
184
|
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
185
|
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
|
-
},
|
|
186
|
+
}, Ee = (e, n, t) => {
|
|
186
187
|
if (t)
|
|
187
188
|
return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
|
|
188
189
|
if (n)
|
|
@@ -198,70 +199,70 @@ const we = {
|
|
|
198
199
|
default:
|
|
199
200
|
return "border-gray-300 focus:ring-blue-500";
|
|
200
201
|
}
|
|
201
|
-
},
|
|
202
|
+
}, Le = ie((e, n) => {
|
|
202
203
|
const {
|
|
203
204
|
label: t,
|
|
204
205
|
id: r,
|
|
205
|
-
inputSize:
|
|
206
|
-
shape:
|
|
207
|
-
validate:
|
|
208
|
-
onValidatedChange:
|
|
209
|
-
className:
|
|
206
|
+
inputSize: o = "md",
|
|
207
|
+
shape: u = "rounded",
|
|
208
|
+
validate: g,
|
|
209
|
+
onValidatedChange: c,
|
|
210
|
+
className: f = "",
|
|
210
211
|
icon: a,
|
|
211
|
-
iconPosition:
|
|
212
|
+
iconPosition: s = "left",
|
|
212
213
|
floatingLabelStyle: l,
|
|
213
|
-
onChange:
|
|
214
|
+
onChange: i,
|
|
214
215
|
isValid: x,
|
|
215
|
-
isInvalid:
|
|
216
|
+
isInvalid: p,
|
|
216
217
|
feedback: b,
|
|
217
218
|
feedbackType: C = "invalid",
|
|
218
|
-
children:
|
|
219
|
-
...
|
|
220
|
-
} = e, [
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
return /* @__PURE__ */
|
|
225
|
-
!
|
|
219
|
+
children: $,
|
|
220
|
+
...L
|
|
221
|
+
} = e, [y, w] = z("default"), h = he(), v = _(() => r || (typeof t == "string" ? `select-${t.toLowerCase().replace(/\s+/g, "-")}` : h), [r, t, h]), P = (k) => {
|
|
222
|
+
const M = k.target.value, R = (g == null ? void 0 : g(M)) ?? "default";
|
|
223
|
+
w(R), c == null || c(k, R), i == null || i(k);
|
|
224
|
+
}, S = !!l, O = $e[o], j = ke[u], m = Ee(y, x, p);
|
|
225
|
+
return /* @__PURE__ */ E("div", { className: `w-full relative ${S ? "z-0" : ""}`, children: [
|
|
226
|
+
!S && t && /* @__PURE__ */ d(
|
|
226
227
|
"label",
|
|
227
228
|
{
|
|
228
|
-
htmlFor:
|
|
229
|
-
className: `block mb-1 text-sm ${x ? "text-green-700" :
|
|
229
|
+
htmlFor: v,
|
|
230
|
+
className: `block mb-1 text-sm ${x ? "text-green-700" : p ? "text-red-700" : "text-gray-700"}`,
|
|
230
231
|
children: t
|
|
231
232
|
}
|
|
232
233
|
),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
a && /* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ E("div", { className: "relative w-full", children: [
|
|
235
|
+
a && /* @__PURE__ */ d(
|
|
235
236
|
"div",
|
|
236
237
|
{
|
|
237
|
-
className: `absolute inset-y-0 flex items-center ${
|
|
238
|
-
children: /* @__PURE__ */
|
|
238
|
+
className: `absolute inset-y-0 flex items-center ${s === "start" || s === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5"}`,
|
|
239
|
+
children: /* @__PURE__ */ d("span", { className: "text-gray-500", children: a })
|
|
239
240
|
}
|
|
240
241
|
),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ d(
|
|
242
243
|
"select",
|
|
243
244
|
{
|
|
244
|
-
...
|
|
245
|
-
id:
|
|
245
|
+
...L,
|
|
246
|
+
id: v,
|
|
246
247
|
ref: n,
|
|
247
|
-
onChange:
|
|
248
|
+
onChange: P,
|
|
248
249
|
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:
|
|
250
|
+
${O} ${a && (s === "start" || s === "left") ? "ps-10" : a ? "pe-10" : ""}
|
|
251
|
+
${S && l && Se[l]}
|
|
252
|
+
${j} ${m} ${f}`,
|
|
253
|
+
children: $
|
|
253
254
|
}
|
|
254
255
|
),
|
|
255
|
-
|
|
256
|
+
S && t && l && /* @__PURE__ */ d(
|
|
256
257
|
"label",
|
|
257
258
|
{
|
|
258
|
-
htmlFor:
|
|
259
|
-
className: `ms-1 ${
|
|
259
|
+
htmlFor: v,
|
|
260
|
+
className: `ms-1 ${Ne[l]} ${f}`,
|
|
260
261
|
children: t
|
|
261
262
|
}
|
|
262
263
|
)
|
|
263
264
|
] }),
|
|
264
|
-
b && /* @__PURE__ */
|
|
265
|
+
b && /* @__PURE__ */ d(
|
|
265
266
|
"p",
|
|
266
267
|
{
|
|
267
268
|
className: `mt-1 text-xs ${C === "invalid" ? "text-red-600" : "text-green-600"}`,
|
|
@@ -270,8 +271,8 @@ const we = {
|
|
|
270
271
|
)
|
|
271
272
|
] });
|
|
272
273
|
});
|
|
273
|
-
|
|
274
|
-
const
|
|
274
|
+
Le.displayName = "Select";
|
|
275
|
+
const Pe = {
|
|
275
276
|
primary: "btn-primary",
|
|
276
277
|
secondary: "btn-secondary",
|
|
277
278
|
success: "btn-success",
|
|
@@ -297,39 +298,39 @@ const Ne = {
|
|
|
297
298
|
"soft-info": "btn-soft-info",
|
|
298
299
|
"soft-dark": "btn-soft-dark",
|
|
299
300
|
"soft-light": "btn-soft-light"
|
|
300
|
-
},
|
|
301
|
+
}, Oe = {
|
|
301
302
|
xs: "px-3 py-2 text-xs",
|
|
302
303
|
sm: "px-3 py-2 text-sm",
|
|
303
304
|
md: "px-5 py-2.5 text-sm",
|
|
304
305
|
lg: "px-5 py-3 text-base",
|
|
305
306
|
xl: "px-6 py-3.5 text-base"
|
|
306
|
-
},
|
|
307
|
+
}, De = {
|
|
307
308
|
flat: "shadow-none",
|
|
308
309
|
rounded: "rounded-sm",
|
|
309
310
|
pill: "rounded-full",
|
|
310
311
|
circle: "rounded-full w-10 h-10 p-0 flex items-center justify-center"
|
|
311
|
-
},
|
|
312
|
+
}, rt = ({
|
|
312
313
|
children: e,
|
|
313
314
|
variant: n = "primary",
|
|
314
315
|
size: t = "md",
|
|
315
316
|
type: r = "button",
|
|
316
|
-
shape:
|
|
317
|
-
className:
|
|
318
|
-
isLoading:
|
|
319
|
-
disabled:
|
|
320
|
-
...
|
|
317
|
+
shape: o = "rounded",
|
|
318
|
+
className: u = "",
|
|
319
|
+
isLoading: g = !1,
|
|
320
|
+
disabled: c = !1,
|
|
321
|
+
...f
|
|
321
322
|
}) => {
|
|
322
|
-
const a =
|
|
323
|
+
const a = c || g, s = [
|
|
323
324
|
"inline-flex items-center justify-center font-normal transition duration-150",
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
325
|
+
Pe[n],
|
|
326
|
+
Oe[t],
|
|
327
|
+
De[o],
|
|
328
|
+
o === "flat" ? "shadow-none" : "shadow-sm",
|
|
328
329
|
a ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
|
|
329
|
-
|
|
330
|
+
u
|
|
330
331
|
].filter(Boolean).join(" ");
|
|
331
|
-
return /* @__PURE__ */
|
|
332
|
-
|
|
332
|
+
return /* @__PURE__ */ E("button", { type: r, className: s, disabled: a, ...f, children: [
|
|
333
|
+
g && /* @__PURE__ */ E(
|
|
333
334
|
"svg",
|
|
334
335
|
{
|
|
335
336
|
"aria-hidden": "true",
|
|
@@ -339,14 +340,14 @@ const Ne = {
|
|
|
339
340
|
fill: "none",
|
|
340
341
|
xmlns: "http://www.w3.org/2000/svg",
|
|
341
342
|
children: [
|
|
342
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ d(
|
|
343
344
|
"path",
|
|
344
345
|
{
|
|
345
346
|
d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
|
|
346
347
|
fill: "currentColor"
|
|
347
348
|
}
|
|
348
349
|
),
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ d(
|
|
350
351
|
"path",
|
|
351
352
|
{
|
|
352
353
|
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
@@ -365,18 +366,18 @@ var ce = {
|
|
|
365
366
|
className: void 0,
|
|
366
367
|
style: void 0,
|
|
367
368
|
attr: void 0
|
|
368
|
-
},
|
|
369
|
-
function
|
|
369
|
+
}, oe = K.createContext && /* @__PURE__ */ K.createContext(ce), Ae = ["attr", "size", "title"];
|
|
370
|
+
function je(e, n) {
|
|
370
371
|
if (e == null) return {};
|
|
371
|
-
var t =
|
|
372
|
+
var t = Ie(e, n), r, o;
|
|
372
373
|
if (Object.getOwnPropertySymbols) {
|
|
373
|
-
var
|
|
374
|
-
for (
|
|
375
|
-
r =
|
|
374
|
+
var u = Object.getOwnPropertySymbols(e);
|
|
375
|
+
for (o = 0; o < u.length; o++)
|
|
376
|
+
r = u[o], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
376
377
|
}
|
|
377
378
|
return t;
|
|
378
379
|
}
|
|
379
|
-
function
|
|
380
|
+
function Ie(e, n) {
|
|
380
381
|
if (e == null) return {};
|
|
381
382
|
var t = {};
|
|
382
383
|
for (var r in e)
|
|
@@ -400,31 +401,31 @@ function se(e, n) {
|
|
|
400
401
|
var t = Object.keys(e);
|
|
401
402
|
if (Object.getOwnPropertySymbols) {
|
|
402
403
|
var r = Object.getOwnPropertySymbols(e);
|
|
403
|
-
n && (r = r.filter(function(
|
|
404
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
404
|
+
n && (r = r.filter(function(o) {
|
|
405
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
405
406
|
})), t.push.apply(t, r);
|
|
406
407
|
}
|
|
407
408
|
return t;
|
|
408
409
|
}
|
|
409
|
-
function
|
|
410
|
+
function U(e) {
|
|
410
411
|
for (var n = 1; n < arguments.length; n++) {
|
|
411
412
|
var t = arguments[n] != null ? arguments[n] : {};
|
|
412
413
|
n % 2 ? se(Object(t), !0).forEach(function(r) {
|
|
413
|
-
|
|
414
|
+
ze(e, r, t[r]);
|
|
414
415
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : se(Object(t)).forEach(function(r) {
|
|
415
416
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
416
417
|
});
|
|
417
418
|
}
|
|
418
419
|
return e;
|
|
419
420
|
}
|
|
420
|
-
function
|
|
421
|
-
return n =
|
|
421
|
+
function ze(e, n, t) {
|
|
422
|
+
return n = Be(n), n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
|
|
422
423
|
}
|
|
423
|
-
function
|
|
424
|
-
var n =
|
|
424
|
+
function Be(e) {
|
|
425
|
+
var n = Me(e, "string");
|
|
425
426
|
return typeof n == "symbol" ? n : n + "";
|
|
426
427
|
}
|
|
427
|
-
function
|
|
428
|
+
function Me(e, n) {
|
|
428
429
|
if (typeof e != "object" || !e) return e;
|
|
429
430
|
var t = e[Symbol.toPrimitive];
|
|
430
431
|
if (t !== void 0) {
|
|
@@ -435,51 +436,51 @@ function ze(e, n) {
|
|
|
435
436
|
return (n === "string" ? String : Number)(e);
|
|
436
437
|
}
|
|
437
438
|
function de(e) {
|
|
438
|
-
return e && e.map((n, t) => /* @__PURE__ */
|
|
439
|
+
return e && e.map((n, t) => /* @__PURE__ */ K.createElement(n.tag, U({
|
|
439
440
|
key: t
|
|
440
441
|
}, n.attr), de(n.child)));
|
|
441
442
|
}
|
|
442
|
-
function
|
|
443
|
-
return (n) => /* @__PURE__ */
|
|
444
|
-
attr:
|
|
443
|
+
function te(e) {
|
|
444
|
+
return (n) => /* @__PURE__ */ K.createElement(Te, G({
|
|
445
|
+
attr: U({}, e.attr)
|
|
445
446
|
}, n), de(e.child));
|
|
446
447
|
}
|
|
447
|
-
function
|
|
448
|
+
function Te(e) {
|
|
448
449
|
var n = (t) => {
|
|
449
450
|
var {
|
|
450
451
|
attr: r,
|
|
451
|
-
size:
|
|
452
|
-
title:
|
|
453
|
-
} = e,
|
|
454
|
-
return t.className && (
|
|
452
|
+
size: o,
|
|
453
|
+
title: u
|
|
454
|
+
} = e, g = je(e, Ae), c = o || t.size || "1em", f;
|
|
455
|
+
return t.className && (f = t.className), e.className && (f = (f ? f + " " : "") + e.className), /* @__PURE__ */ K.createElement("svg", G({
|
|
455
456
|
stroke: "currentColor",
|
|
456
457
|
fill: "currentColor",
|
|
457
458
|
strokeWidth: "0"
|
|
458
|
-
}, t.attr, r,
|
|
459
|
-
className:
|
|
460
|
-
style:
|
|
459
|
+
}, t.attr, r, g, {
|
|
460
|
+
className: f,
|
|
461
|
+
style: U(U({
|
|
461
462
|
color: e.color || t.color
|
|
462
463
|
}, t.style), e.style),
|
|
463
|
-
height:
|
|
464
|
-
width:
|
|
464
|
+
height: c,
|
|
465
|
+
width: c,
|
|
465
466
|
xmlns: "http://www.w3.org/2000/svg"
|
|
466
|
-
}),
|
|
467
|
+
}), u && /* @__PURE__ */ K.createElement("title", null, u), e.children);
|
|
467
468
|
};
|
|
468
|
-
return
|
|
469
|
+
return oe !== void 0 ? /* @__PURE__ */ K.createElement(oe.Consumer, null, (t) => n(t)) : n(ce);
|
|
469
470
|
}
|
|
470
|
-
function
|
|
471
|
-
return
|
|
471
|
+
function Re(e) {
|
|
472
|
+
return te({ 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
473
|
}
|
|
473
|
-
const
|
|
474
|
+
const _e = {
|
|
474
475
|
xs: "w-3 h-3 text-[10px]",
|
|
475
476
|
sm: "w-4 h-4 text-xs",
|
|
476
477
|
md: "w-5 h-5 text-sm",
|
|
477
478
|
lg: "w-6 h-6 text-base"
|
|
478
|
-
},
|
|
479
|
+
}, Fe = {
|
|
479
480
|
flat: "rounded-none",
|
|
480
481
|
rounded: "rounded-sm",
|
|
481
482
|
pill: "rounded-full"
|
|
482
|
-
},
|
|
483
|
+
}, Ke = {
|
|
483
484
|
primary: "primary",
|
|
484
485
|
secondary: "secondary",
|
|
485
486
|
success: "success",
|
|
@@ -505,169 +506,169 @@ const Te = {
|
|
|
505
506
|
"soft-info": "soft-info",
|
|
506
507
|
"soft-dark": "soft-dark",
|
|
507
508
|
"soft-light": "soft-light"
|
|
508
|
-
},
|
|
509
|
+
}, He = K.forwardRef(
|
|
509
510
|
({
|
|
510
511
|
label: e,
|
|
511
512
|
boxSize: n = "md",
|
|
512
513
|
shape: t = "rounded",
|
|
513
514
|
variant: r = "success",
|
|
514
|
-
onSelectionChange:
|
|
515
|
-
disabled:
|
|
516
|
-
className:
|
|
517
|
-
id:
|
|
518
|
-
value:
|
|
515
|
+
onSelectionChange: o,
|
|
516
|
+
disabled: u = !1,
|
|
517
|
+
className: g = "",
|
|
518
|
+
id: c,
|
|
519
|
+
value: f,
|
|
519
520
|
icon: a,
|
|
520
|
-
children:
|
|
521
|
+
children: s,
|
|
521
522
|
checked: l,
|
|
522
|
-
...
|
|
523
|
+
...i
|
|
523
524
|
}, x) => {
|
|
524
|
-
const
|
|
525
|
-
!
|
|
526
|
-
}, b = "mr-2 border flex items-center justify-center transition-all", C =
|
|
525
|
+
const p = (O) => {
|
|
526
|
+
!u && o && o(O.target.checked), i.onChange && i.onChange(O);
|
|
527
|
+
}, b = "mr-2 border flex items-center justify-center transition-all", C = _e[n], $ = Fe[t], L = Ke[r] ?? "", y = r.startsWith("outline"), w = r.startsWith("soft"), P = `${b} ${C} ${$} ${L} ${l && (y || w || r === "link") ? "peer-checked:bg-current peer-checked:text-white" : l ? "peer-checked:bg-current" : ""}`, S = {
|
|
527
528
|
xs: "w-2 h-2",
|
|
528
529
|
sm: "w-2.5 h-2.5",
|
|
529
530
|
md: "w-3 h-3",
|
|
530
531
|
lg: "w-3.5 h-3.5"
|
|
531
532
|
};
|
|
532
|
-
return /* @__PURE__ */
|
|
533
|
+
return /* @__PURE__ */ E(
|
|
533
534
|
"label",
|
|
534
535
|
{
|
|
535
|
-
className: `flex items-center ${
|
|
536
|
+
className: `flex items-center ${u ? "opacity-50 cursor-not-allowed" : "cursor-pointer"} me-4 ${g}`,
|
|
536
537
|
children: [
|
|
537
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ d(
|
|
538
539
|
"input",
|
|
539
540
|
{
|
|
540
541
|
type: "checkbox",
|
|
541
542
|
className: "peer hidden",
|
|
542
543
|
checked: l,
|
|
543
|
-
onChange:
|
|
544
|
-
disabled:
|
|
545
|
-
id:
|
|
546
|
-
value:
|
|
544
|
+
onChange: p,
|
|
545
|
+
disabled: u,
|
|
546
|
+
id: c,
|
|
547
|
+
value: f,
|
|
547
548
|
ref: x,
|
|
548
|
-
...
|
|
549
|
+
...i
|
|
549
550
|
}
|
|
550
551
|
),
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
-
e ||
|
|
552
|
+
/* @__PURE__ */ d("span", { className: P.trim(), children: (l || i.defaultChecked) && (a ?? /* @__PURE__ */ d(Re, { className: `${S[n]}` })) }),
|
|
553
|
+
e || s ? /* @__PURE__ */ d("span", { className: "text-sm font-medium text-gray-900 dark:text-gray-300", children: e ?? s }) : null
|
|
553
554
|
]
|
|
554
555
|
}
|
|
555
556
|
);
|
|
556
557
|
}
|
|
557
558
|
);
|
|
558
|
-
|
|
559
|
-
const
|
|
559
|
+
He.displayName = "Checkbox";
|
|
560
|
+
const ot = ({
|
|
560
561
|
label: e,
|
|
561
562
|
header: n,
|
|
562
563
|
items: t = [],
|
|
563
564
|
onSelect: r,
|
|
564
|
-
renderItem:
|
|
565
|
-
position:
|
|
566
|
-
className:
|
|
567
|
-
menuClassName:
|
|
568
|
-
width:
|
|
565
|
+
renderItem: o,
|
|
566
|
+
position: u = "right",
|
|
567
|
+
className: g = "",
|
|
568
|
+
menuClassName: c = "",
|
|
569
|
+
width: f = "w-48",
|
|
569
570
|
closeOnSelect: a = !1,
|
|
570
|
-
transition:
|
|
571
|
+
transition: s = !0,
|
|
571
572
|
ariaLabel: l = "Dropdown menu",
|
|
572
|
-
forceCloseDropdown:
|
|
573
|
+
forceCloseDropdown: i,
|
|
573
574
|
...x
|
|
574
575
|
}) => {
|
|
575
|
-
const [
|
|
576
|
+
const [p, b] = z(!1), [C, $] = z(!1), L = F(null), y = F(null), w = _(() => ({
|
|
576
577
|
left: "left-0",
|
|
577
578
|
center: "left-1/2 transform -translate-x-1/2",
|
|
578
579
|
right: "right-0"
|
|
579
|
-
})[
|
|
580
|
-
const
|
|
581
|
-
if (
|
|
582
|
-
const { top:
|
|
583
|
-
|
|
584
|
-
}, []),
|
|
585
|
-
var
|
|
586
|
-
!((
|
|
587
|
-
}, []),
|
|
588
|
-
|
|
589
|
-
if (
|
|
590
|
-
return
|
|
591
|
-
window.removeEventListener("resize",
|
|
580
|
+
})[u], [u]), h = I(() => {
|
|
581
|
+
const m = y.current, N = L.current;
|
|
582
|
+
if (!m || !N) return;
|
|
583
|
+
const { top: D, bottom: k } = m.getBoundingClientRect(), M = N.offsetHeight, R = window.innerHeight - k, H = D;
|
|
584
|
+
$(R < M && H > M);
|
|
585
|
+
}, []), v = I((m) => {
|
|
586
|
+
var N, D;
|
|
587
|
+
!((N = L.current) != null && N.contains(m.target)) && !((D = y.current) != null && D.contains(m.target)) && b(!1);
|
|
588
|
+
}, []), P = I(() => b((m) => !m), []), S = I(() => b(!1), []);
|
|
589
|
+
T(() => {
|
|
590
|
+
if (p)
|
|
591
|
+
return h(), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0), () => {
|
|
592
|
+
window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
|
|
592
593
|
};
|
|
593
|
-
}, [
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}, [
|
|
598
|
-
const
|
|
599
|
-
var
|
|
600
|
-
|
|
594
|
+
}, [p, h]);
|
|
595
|
+
const O = F(p);
|
|
596
|
+
T(() => {
|
|
597
|
+
O.current = p;
|
|
598
|
+
}, [p]), T(() => {
|
|
599
|
+
const m = (N) => {
|
|
600
|
+
var D;
|
|
601
|
+
N.key === "Escape" && O.current && (b(!1), (D = y.current) == null || D.focus());
|
|
601
602
|
};
|
|
602
|
-
return document.addEventListener("keydown",
|
|
603
|
-
document.removeEventListener("keydown",
|
|
603
|
+
return document.addEventListener("keydown", m), () => {
|
|
604
|
+
document.removeEventListener("keydown", m);
|
|
604
605
|
};
|
|
605
|
-
}, []),
|
|
606
|
-
const
|
|
606
|
+
}, []), T(() => (document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v)), [v]);
|
|
607
|
+
const j = _(
|
|
607
608
|
() => [
|
|
608
609
|
"absolute z-50 bg-white rounded shadow-lg overflow-hidden w-auto",
|
|
609
610
|
C ? "bottom-full mb-2" : "top-full mt-2",
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
611
|
+
w,
|
|
612
|
+
f,
|
|
613
|
+
s && "transition-all duration-200 ease-out",
|
|
614
|
+
c
|
|
614
615
|
].filter(Boolean).join(" "),
|
|
615
|
-
[C,
|
|
616
|
+
[C, w, f, s, c]
|
|
616
617
|
);
|
|
617
|
-
return /* @__PURE__ */
|
|
618
|
-
/* @__PURE__ */
|
|
618
|
+
return /* @__PURE__ */ E("div", { className: `relative inline-block ${g}`, ...x, children: [
|
|
619
|
+
/* @__PURE__ */ d(
|
|
619
620
|
"button",
|
|
620
621
|
{
|
|
621
622
|
type: "button",
|
|
622
|
-
ref:
|
|
623
|
-
onClick:
|
|
624
|
-
"aria-expanded":
|
|
623
|
+
ref: y,
|
|
624
|
+
onClick: P,
|
|
625
|
+
"aria-expanded": p,
|
|
625
626
|
"aria-label": l,
|
|
626
627
|
className: "focus:outline-none",
|
|
627
628
|
children: e
|
|
628
629
|
}
|
|
629
630
|
),
|
|
630
|
-
|
|
631
|
+
p && /* @__PURE__ */ E("div", { ref: L, role: "menu", className: j, children: [
|
|
631
632
|
n && n,
|
|
632
|
-
t.map((
|
|
633
|
-
const
|
|
634
|
-
r && r(
|
|
633
|
+
t.map((m, N) => {
|
|
634
|
+
const D = () => {
|
|
635
|
+
r && r(m), a && S();
|
|
635
636
|
};
|
|
636
|
-
return /* @__PURE__ */
|
|
637
|
+
return /* @__PURE__ */ d("div", { children: o ? o(m, D) : /* @__PURE__ */ d(
|
|
637
638
|
"div",
|
|
638
639
|
{
|
|
639
|
-
onClick:
|
|
640
|
+
onClick: D,
|
|
640
641
|
className: "px-4 py-2 text-sm text-gray-800 hover:bg-gray-100 cursor-pointer",
|
|
641
642
|
role: "menuitem",
|
|
642
|
-
children:
|
|
643
|
+
children: m.label
|
|
643
644
|
}
|
|
644
|
-
) },
|
|
645
|
+
) }, N);
|
|
645
646
|
})
|
|
646
647
|
] })
|
|
647
648
|
] });
|
|
648
|
-
},
|
|
649
|
+
}, st = ({
|
|
649
650
|
children: e,
|
|
650
651
|
content: n,
|
|
651
652
|
position: t = "top",
|
|
652
653
|
className: r = "",
|
|
653
|
-
tooltipClass:
|
|
654
|
-
tooltipStyle:
|
|
654
|
+
tooltipClass: o = "",
|
|
655
|
+
tooltipStyle: u = {}
|
|
655
656
|
}) => {
|
|
656
|
-
const
|
|
657
|
-
|
|
658
|
-
const a =
|
|
659
|
-
if (!a || !
|
|
657
|
+
const g = F(null), c = F(null);
|
|
658
|
+
T(() => {
|
|
659
|
+
const a = g.current, s = c.current;
|
|
660
|
+
if (!a || !s) return;
|
|
660
661
|
const l = () => {
|
|
661
|
-
|
|
662
|
-
},
|
|
663
|
-
|
|
662
|
+
s.style.opacity = "1", s.style.visibility = "visible";
|
|
663
|
+
}, i = () => {
|
|
664
|
+
s.style.opacity = "0", s.style.visibility = "hidden";
|
|
664
665
|
};
|
|
665
|
-
return a.addEventListener("mouseenter", l), a.addEventListener("mouseleave",
|
|
666
|
-
a.removeEventListener("mouseenter", l), a.removeEventListener("mouseleave",
|
|
666
|
+
return a.addEventListener("mouseenter", l), a.addEventListener("mouseleave", i), () => {
|
|
667
|
+
a.removeEventListener("mouseenter", l), a.removeEventListener("mouseleave", i);
|
|
667
668
|
};
|
|
668
669
|
}, []);
|
|
669
|
-
const
|
|
670
|
-
const
|
|
670
|
+
const f = (a) => {
|
|
671
|
+
const s = {
|
|
671
672
|
position: "absolute",
|
|
672
673
|
opacity: 0,
|
|
673
674
|
visibility: "hidden",
|
|
@@ -687,7 +688,7 @@ const Ve = ({
|
|
|
687
688
|
switch (a) {
|
|
688
689
|
case "top":
|
|
689
690
|
return {
|
|
690
|
-
...
|
|
691
|
+
...s,
|
|
691
692
|
bottom: "100%",
|
|
692
693
|
left: "50%",
|
|
693
694
|
transform: "translateX(-50%)",
|
|
@@ -695,7 +696,7 @@ const Ve = ({
|
|
|
695
696
|
};
|
|
696
697
|
case "bottom":
|
|
697
698
|
return {
|
|
698
|
-
...
|
|
699
|
+
...s,
|
|
699
700
|
top: "100%",
|
|
700
701
|
left: "50%",
|
|
701
702
|
transform: "translateX(-50%)",
|
|
@@ -703,7 +704,7 @@ const Ve = ({
|
|
|
703
704
|
};
|
|
704
705
|
case "left":
|
|
705
706
|
return {
|
|
706
|
-
...
|
|
707
|
+
...s,
|
|
707
708
|
right: "100%",
|
|
708
709
|
top: "50%",
|
|
709
710
|
transform: "translateY(-50%)",
|
|
@@ -711,33 +712,33 @@ const Ve = ({
|
|
|
711
712
|
};
|
|
712
713
|
case "right":
|
|
713
714
|
return {
|
|
714
|
-
...
|
|
715
|
+
...s,
|
|
715
716
|
left: "100%",
|
|
716
717
|
top: "50%",
|
|
717
718
|
transform: "translateY(-50%)",
|
|
718
719
|
marginLeft: "8px"
|
|
719
720
|
};
|
|
720
721
|
default:
|
|
721
|
-
return
|
|
722
|
+
return s;
|
|
722
723
|
}
|
|
723
724
|
};
|
|
724
|
-
return /* @__PURE__ */
|
|
725
|
+
return /* @__PURE__ */ E("div", { ref: g, className: `relative inline-block ${r}`, children: [
|
|
725
726
|
e,
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ d(
|
|
727
728
|
"div",
|
|
728
729
|
{
|
|
729
|
-
ref:
|
|
730
|
+
ref: c,
|
|
730
731
|
role: "tooltip",
|
|
731
|
-
className:
|
|
732
|
+
className: o,
|
|
732
733
|
style: {
|
|
733
|
-
...
|
|
734
|
-
...
|
|
734
|
+
...f(t),
|
|
735
|
+
...u
|
|
735
736
|
},
|
|
736
737
|
children: n
|
|
737
738
|
}
|
|
738
739
|
)
|
|
739
740
|
] });
|
|
740
|
-
},
|
|
741
|
+
}, Ye = {
|
|
741
742
|
primary: "bg-blue-500 text-white",
|
|
742
743
|
secondary: "bg-gray-500 text-white",
|
|
743
744
|
success: "bg-green-500 text-white",
|
|
@@ -755,47 +756,47 @@ const Ve = ({
|
|
|
755
756
|
"outline-info": "border border-cyan-500 text-cyan-500 bg-transparent",
|
|
756
757
|
"outline-dark": "border border-black text-black bg-transparent",
|
|
757
758
|
"outline-light": "border border-gray-100 text-gray-800 bg-transparent"
|
|
758
|
-
},
|
|
759
|
+
}, Ze = {
|
|
759
760
|
xs: "text-xs px-2 py-0.5",
|
|
760
761
|
sm: "text-sm px-2.5 py-0.5",
|
|
761
762
|
md: "text-base px-3 py-1",
|
|
762
763
|
lg: "text-lg px-3.5 py-1.5",
|
|
763
764
|
xl: "text-xl px-4 py-2"
|
|
764
|
-
},
|
|
765
|
+
}, We = {
|
|
765
766
|
flat: "rounded-none",
|
|
766
767
|
rounded: "rounded-sm",
|
|
767
768
|
pill: "rounded-full",
|
|
768
769
|
circle: "rounded-full p-2 w-8 h-8 justify-center"
|
|
769
|
-
},
|
|
770
|
+
}, at = ({
|
|
770
771
|
label: e,
|
|
771
772
|
variant: n = "primary",
|
|
772
773
|
size: t = "sm",
|
|
773
774
|
shape: r = "rounded",
|
|
774
|
-
icon:
|
|
775
|
-
dismissible:
|
|
776
|
-
onDismiss:
|
|
777
|
-
className:
|
|
778
|
-
...
|
|
775
|
+
icon: o,
|
|
776
|
+
dismissible: u,
|
|
777
|
+
onDismiss: g,
|
|
778
|
+
className: c = "",
|
|
779
|
+
...f
|
|
779
780
|
}) => {
|
|
780
|
-
const a = !e && !!
|
|
781
|
-
return /* @__PURE__ */
|
|
782
|
-
|
|
781
|
+
const a = !e && !!o, s = `inline-flex items-center font-medium ${Ye[n] || ""} ${Ze[t] || ""} ${We[r] || ""} ${a ? "justify-center p-2 w-8 h-8" : ""} ` + c;
|
|
782
|
+
return /* @__PURE__ */ E("span", { className: s.trim(), ...f, children: [
|
|
783
|
+
o && /* @__PURE__ */ d("span", { className: e ? "mr-1" : "", children: o }),
|
|
783
784
|
e,
|
|
784
|
-
|
|
785
|
+
u && /* @__PURE__ */ d(
|
|
785
786
|
"button",
|
|
786
787
|
{
|
|
787
788
|
type: "button",
|
|
788
|
-
onClick:
|
|
789
|
+
onClick: g,
|
|
789
790
|
className: "ml-2 text-xs font-bold leading-none focus:outline-none",
|
|
790
791
|
children: "×"
|
|
791
792
|
}
|
|
792
793
|
)
|
|
793
794
|
] });
|
|
794
|
-
},
|
|
795
|
+
}, ae = {
|
|
795
796
|
rounded: "rounded-md",
|
|
796
797
|
pill: "rounded-full",
|
|
797
798
|
flat: "rounded-none"
|
|
798
|
-
},
|
|
799
|
+
}, le = {
|
|
799
800
|
xs: {
|
|
800
801
|
button: "px-2 py-1 text-xs"
|
|
801
802
|
},
|
|
@@ -812,62 +813,62 @@ const Ve = ({
|
|
|
812
813
|
button: "px-6 py-4 text-lg"
|
|
813
814
|
}
|
|
814
815
|
};
|
|
815
|
-
function
|
|
816
|
+
function lt({
|
|
816
817
|
options: e,
|
|
817
818
|
selected: n,
|
|
818
819
|
onChange: t,
|
|
819
820
|
label: r,
|
|
820
|
-
disabled:
|
|
821
|
-
shape:
|
|
822
|
-
variant:
|
|
823
|
-
size:
|
|
824
|
-
className:
|
|
821
|
+
disabled: o = !1,
|
|
822
|
+
shape: u = "rounded",
|
|
823
|
+
variant: g = "primary",
|
|
824
|
+
size: c = "md",
|
|
825
|
+
className: f = "",
|
|
825
826
|
classNames: a = {},
|
|
826
|
-
id:
|
|
827
|
+
id: s,
|
|
827
828
|
name: l,
|
|
828
|
-
renderOption:
|
|
829
|
+
renderOption: i
|
|
829
830
|
}) {
|
|
830
|
-
const x =
|
|
831
|
-
|
|
831
|
+
const x = ae[u] || ae.rounded, p = le[c] || le.md, b = F(null), [C, $] = z({});
|
|
832
|
+
T(() => {
|
|
832
833
|
if (!b.current) return;
|
|
833
|
-
const
|
|
834
|
-
if (
|
|
835
|
-
const
|
|
836
|
-
if (
|
|
837
|
-
const { offsetLeft:
|
|
838
|
-
|
|
839
|
-
transform: `translateX(${
|
|
840
|
-
width:
|
|
841
|
-
height:
|
|
834
|
+
const y = e.findIndex((v) => v.value === n);
|
|
835
|
+
if (y === -1) return;
|
|
836
|
+
const h = b.current.querySelectorAll("button")[y];
|
|
837
|
+
if (h) {
|
|
838
|
+
const { offsetLeft: v, offsetWidth: P, offsetHeight: S } = h;
|
|
839
|
+
$({
|
|
840
|
+
transform: `translateX(${v}px)`,
|
|
841
|
+
width: P,
|
|
842
|
+
height: S
|
|
842
843
|
});
|
|
843
844
|
}
|
|
844
|
-
}, [n, e,
|
|
845
|
-
const
|
|
846
|
-
return /* @__PURE__ */
|
|
845
|
+
}, [n, e, c]);
|
|
846
|
+
const L = `toggler-${g}`;
|
|
847
|
+
return /* @__PURE__ */ E(
|
|
847
848
|
"div",
|
|
848
849
|
{
|
|
849
|
-
className: `flex flex-col gap-2 w-fit ${
|
|
850
|
-
id:
|
|
850
|
+
className: `flex flex-col gap-2 w-fit ${f} ${a.root ?? ""}`,
|
|
851
|
+
id: s,
|
|
851
852
|
children: [
|
|
852
|
-
r && /* @__PURE__ */
|
|
853
|
+
r && /* @__PURE__ */ d(
|
|
853
854
|
"span",
|
|
854
855
|
{
|
|
855
856
|
className: `text-sm font-medium select-none ${a.label ?? ""}`,
|
|
856
857
|
children: r
|
|
857
858
|
}
|
|
858
859
|
),
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ E(
|
|
860
861
|
"div",
|
|
861
862
|
{
|
|
862
863
|
ref: b,
|
|
863
864
|
role: "radiogroup",
|
|
864
|
-
"aria-disabled":
|
|
865
|
-
className: `relative inline-flex overflow-hidden border border-gray-300 bg-gray-100 ${x} ${
|
|
865
|
+
"aria-disabled": o,
|
|
866
|
+
className: `relative inline-flex overflow-hidden border border-gray-300 bg-gray-100 ${x} ${o ? "opacity-50 cursor-not-allowed" : ""} ${a.group ?? ""}`,
|
|
866
867
|
children: [
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
+
/* @__PURE__ */ d(
|
|
868
869
|
"div",
|
|
869
870
|
{
|
|
870
|
-
className: `absolute top-0 left-0 transition-transform duration-300 ease-in-out ${x} ${
|
|
871
|
+
className: `absolute top-0 left-0 transition-transform duration-300 ease-in-out ${x} ${L}`,
|
|
871
872
|
style: {
|
|
872
873
|
...C,
|
|
873
874
|
zIndex: 0
|
|
@@ -875,30 +876,30 @@ function nt({
|
|
|
875
876
|
"aria-hidden": "true"
|
|
876
877
|
}
|
|
877
878
|
),
|
|
878
|
-
e.map((
|
|
879
|
-
const
|
|
880
|
-
return /* @__PURE__ */
|
|
879
|
+
e.map((y) => {
|
|
880
|
+
const w = n === y.value, h = o || y.disabled;
|
|
881
|
+
return /* @__PURE__ */ d(
|
|
881
882
|
"button",
|
|
882
883
|
{
|
|
883
884
|
role: "radio",
|
|
884
885
|
name: l,
|
|
885
|
-
"aria-checked":
|
|
886
|
-
disabled:
|
|
887
|
-
onClick: () => !
|
|
888
|
-
onKeyDown: (
|
|
889
|
-
(
|
|
886
|
+
"aria-checked": w,
|
|
887
|
+
disabled: h,
|
|
888
|
+
onClick: () => !h && t(y.value),
|
|
889
|
+
onKeyDown: (v) => {
|
|
890
|
+
(v.key === "Enter" || v.key === " ") && !h && (v.preventDefault(), t(y.value));
|
|
890
891
|
},
|
|
891
892
|
className: `
|
|
892
893
|
relative z-10
|
|
893
894
|
transition-colors duration-200 focus:outline-none
|
|
894
|
-
${
|
|
895
|
-
${
|
|
895
|
+
${p.button}
|
|
896
|
+
${w ? `text-white toggler-text-${g}` : "text-gray-700 hover:bg-gray-200"}
|
|
896
897
|
${a.option ?? ""}
|
|
897
|
-
${
|
|
898
|
+
${w ? a.selectedOption ?? "" : ""}
|
|
898
899
|
`,
|
|
899
|
-
children:
|
|
900
|
+
children: i ? i(y, w) : y.label
|
|
900
901
|
},
|
|
901
|
-
String(
|
|
902
|
+
String(y.value)
|
|
902
903
|
);
|
|
903
904
|
})
|
|
904
905
|
]
|
|
@@ -908,276 +909,432 @@ function nt({
|
|
|
908
909
|
}
|
|
909
910
|
);
|
|
910
911
|
}
|
|
911
|
-
V(
|
|
912
|
+
const ue = V(
|
|
912
913
|
null
|
|
913
914
|
);
|
|
914
|
-
function
|
|
915
|
-
|
|
915
|
+
function it({
|
|
916
|
+
children: e
|
|
917
|
+
}) {
|
|
918
|
+
const [n, t] = z([]), r = I((c) => {
|
|
919
|
+
t((f) => f.includes(c) ? f : [...f, c]);
|
|
920
|
+
}, []), o = I((c) => {
|
|
921
|
+
t((f) => f.filter((a) => a !== c));
|
|
922
|
+
}, []), u = I(() => {
|
|
923
|
+
t([]);
|
|
924
|
+
}, []), g = _(
|
|
925
|
+
() => ({
|
|
926
|
+
showBottomSheet: r,
|
|
927
|
+
closeBottomSheet: o,
|
|
928
|
+
closeAllBottomSheet: u,
|
|
929
|
+
activeSheets: n
|
|
930
|
+
}),
|
|
931
|
+
[r, o, u, n]
|
|
932
|
+
);
|
|
933
|
+
return /* @__PURE__ */ d(ue.Provider, { value: g, children: e });
|
|
934
|
+
}
|
|
935
|
+
function Ge() {
|
|
936
|
+
const e = ee(ue);
|
|
937
|
+
if (!e)
|
|
938
|
+
throw new Error("useBottomSheet must be used inside BottomSheetProvider");
|
|
939
|
+
return e;
|
|
940
|
+
}
|
|
941
|
+
function ct({
|
|
942
|
+
id: e,
|
|
943
|
+
children: n,
|
|
944
|
+
initialSnap: t = "half",
|
|
945
|
+
snapPoints: r,
|
|
946
|
+
className: o = "",
|
|
947
|
+
overlayClassName: u = "",
|
|
948
|
+
closeOnBackdrop: g = !0,
|
|
949
|
+
lockScroll: c = !0,
|
|
950
|
+
zIndex: f = 1e3
|
|
951
|
+
}) {
|
|
952
|
+
const { activeSheets: a, closeBottomSheet: s } = Ge(), l = a.includes(e), i = !!r, [x, p] = z(!1), [b, C] = z(100), [$, L] = z(!1), y = F(0), w = F(0), h = F(null), v = typeof window < "u" ? window.innerHeight : 0, P = r ? (1 - r.full) * 100 : 0, S = r ? (1 - r.half) * 100 : 0, O = I(
|
|
953
|
+
(k) => {
|
|
954
|
+
if (i)
|
|
955
|
+
switch (k) {
|
|
956
|
+
case "full":
|
|
957
|
+
C(P);
|
|
958
|
+
break;
|
|
959
|
+
case "half":
|
|
960
|
+
C(S);
|
|
961
|
+
break;
|
|
962
|
+
default:
|
|
963
|
+
C(100);
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
[P, S, i]
|
|
967
|
+
);
|
|
968
|
+
T(() => {
|
|
969
|
+
p(!0);
|
|
970
|
+
}, []), T(() => {
|
|
971
|
+
if (!l) {
|
|
972
|
+
C(100);
|
|
973
|
+
return;
|
|
974
|
+
}
|
|
975
|
+
i ? O(t) : C(0);
|
|
976
|
+
}, [l, t, O, i]), T(() => {
|
|
977
|
+
if (c)
|
|
978
|
+
return l ? (document.body.style.overflow = "hidden", document.body.style.touchAction = "none") : (document.body.style.overflow = "", document.body.style.touchAction = ""), () => {
|
|
979
|
+
document.body.style.overflow = "", document.body.style.touchAction = "";
|
|
980
|
+
};
|
|
981
|
+
}, [l, c]), T(() => {
|
|
982
|
+
if (!l) return;
|
|
983
|
+
const k = (M) => {
|
|
984
|
+
M.key === "Escape" && s(e);
|
|
985
|
+
};
|
|
986
|
+
return window.addEventListener("keydown", k), () => {
|
|
987
|
+
window.removeEventListener("keydown", k);
|
|
988
|
+
};
|
|
989
|
+
}, [s, e, l]);
|
|
990
|
+
const j = (k) => {
|
|
991
|
+
var M, R;
|
|
992
|
+
i && (L(!0), y.current = k.clientY, w.current = b, (R = (M = k.target).setPointerCapture) == null || R.call(M, k.pointerId));
|
|
993
|
+
}, m = (k) => {
|
|
994
|
+
if (!$ || !i) return;
|
|
995
|
+
const R = (k.clientY - y.current) / v * 100, H = w.current + R;
|
|
996
|
+
C(Math.min(Math.max(H, P), 100));
|
|
997
|
+
}, N = () => {
|
|
998
|
+
if (!i) return;
|
|
999
|
+
if (L(!1), b > 75) {
|
|
1000
|
+
s(e);
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
1003
|
+
const k = (S + P) / 2;
|
|
1004
|
+
b <= k ? O("full") : O("half");
|
|
1005
|
+
};
|
|
1006
|
+
if (!x) return null;
|
|
1007
|
+
const D = {
|
|
1008
|
+
transform: `translate3d(0, ${b}%, 0)`,
|
|
1009
|
+
transition: $ ? "none" : "transform 240ms cubic-bezier(0.22, 1, 0.36, 1)",
|
|
1010
|
+
willChange: "transform",
|
|
1011
|
+
zIndex: f,
|
|
1012
|
+
// height: hasSnapPoints ? "92dvh" : `${contentHeight}px`,
|
|
1013
|
+
maxHeight: "100dvh"
|
|
1014
|
+
};
|
|
1015
|
+
return xe(
|
|
1016
|
+
/* @__PURE__ */ E(me, { children: [
|
|
1017
|
+
/* @__PURE__ */ d(
|
|
1018
|
+
"button",
|
|
1019
|
+
{
|
|
1020
|
+
type: "button",
|
|
1021
|
+
"aria-label": "Close bottom sheet",
|
|
1022
|
+
onClick: () => {
|
|
1023
|
+
g && s(e);
|
|
1024
|
+
},
|
|
1025
|
+
className: `fixed inset-0 bg-black/45 backdrop-blur-[2px] transition-opacity duration-200 ${l ? "opacity-100" : "pointer-events-none opacity-0"} ${u}`,
|
|
1026
|
+
style: { zIndex: f }
|
|
1027
|
+
}
|
|
1028
|
+
),
|
|
1029
|
+
/* @__PURE__ */ E(
|
|
1030
|
+
"div",
|
|
1031
|
+
{
|
|
1032
|
+
ref: h,
|
|
1033
|
+
style: D,
|
|
1034
|
+
className: `
|
|
1035
|
+
fixed inset-x-0 bottom-0
|
|
1036
|
+
rounded-t-3xl
|
|
1037
|
+
bg-white
|
|
1038
|
+
overflow-hidden
|
|
1039
|
+
text-white
|
|
1040
|
+
shadow-2xl
|
|
1041
|
+
flex flex-col
|
|
1042
|
+
overscroll-contain
|
|
1043
|
+
touch-pan-y
|
|
1044
|
+
pb-[env(safe-area-inset-bottom)]
|
|
1045
|
+
${o}
|
|
1046
|
+
`,
|
|
1047
|
+
children: [
|
|
1048
|
+
/* @__PURE__ */ d(
|
|
1049
|
+
"div",
|
|
1050
|
+
{
|
|
1051
|
+
onPointerDown: j,
|
|
1052
|
+
onPointerMove: m,
|
|
1053
|
+
onPointerUp: N,
|
|
1054
|
+
className: `
|
|
1055
|
+
flex justify-center py-2.5
|
|
1056
|
+
${i ? "cursor-grab active:cursor-grabbing" : ""}
|
|
1057
|
+
select-none touch-none bg-gray-50
|
|
1058
|
+
`,
|
|
1059
|
+
children: /* @__PURE__ */ d("div", { className: "h-1 w-14 rounded-full bg-gray-500" })
|
|
1060
|
+
}
|
|
1061
|
+
),
|
|
1062
|
+
/* @__PURE__ */ d("div", { className: "flex-1 overflow-y-auto p-4", children: n })
|
|
1063
|
+
]
|
|
1064
|
+
}
|
|
1065
|
+
)
|
|
1066
|
+
] }),
|
|
1067
|
+
document.body
|
|
1068
|
+
);
|
|
1069
|
+
}
|
|
1070
|
+
function Ue(e) {
|
|
1071
|
+
return te({ 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);
|
|
916
1072
|
}
|
|
917
|
-
const
|
|
1073
|
+
const dt = ({
|
|
918
1074
|
items: e,
|
|
919
1075
|
allowMultipleOpen: n = !1,
|
|
920
1076
|
className: t = "",
|
|
921
1077
|
tileClasses: r = "",
|
|
922
|
-
open:
|
|
923
|
-
onChange:
|
|
924
|
-
renderTitle:
|
|
925
|
-
renderContent:
|
|
926
|
-
showArrowIcon:
|
|
1078
|
+
open: o,
|
|
1079
|
+
onChange: u,
|
|
1080
|
+
renderTitle: g,
|
|
1081
|
+
renderContent: c,
|
|
1082
|
+
showArrowIcon: f = !0,
|
|
927
1083
|
panelClasses: a = ""
|
|
928
1084
|
}) => {
|
|
929
|
-
const [
|
|
930
|
-
(
|
|
931
|
-
const b = new Set(
|
|
932
|
-
b.has(
|
|
1085
|
+
const [s, l] = z(/* @__PURE__ */ new Set()), i = _(() => o ? new Set(o) : s, [o, s]), x = I(
|
|
1086
|
+
(p) => {
|
|
1087
|
+
const b = new Set(i);
|
|
1088
|
+
b.has(p) ? b.delete(p) : (n || b.clear(), b.add(p)), o && u ? u(Array.from(b)) : l(b);
|
|
933
1089
|
},
|
|
934
|
-
[
|
|
1090
|
+
[i, o, u, n]
|
|
935
1091
|
);
|
|
936
|
-
return /* @__PURE__ */
|
|
1092
|
+
return /* @__PURE__ */ d(
|
|
937
1093
|
"div",
|
|
938
1094
|
{
|
|
939
1095
|
className: "accordion",
|
|
940
1096
|
role: "region",
|
|
941
1097
|
"aria-multiselectable": n,
|
|
942
|
-
children: e.map((
|
|
943
|
-
const b =
|
|
944
|
-
return /* @__PURE__ */
|
|
1098
|
+
children: e.map((p) => {
|
|
1099
|
+
const b = i.has(p.id), C = `accordion-heading-${p.id}`, $ = `accordion-panel-${p.id}`;
|
|
1100
|
+
return /* @__PURE__ */ E(
|
|
945
1101
|
"div",
|
|
946
1102
|
{
|
|
947
1103
|
className: `accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,
|
|
948
1104
|
children: [
|
|
949
|
-
/* @__PURE__ */
|
|
1105
|
+
/* @__PURE__ */ E(
|
|
950
1106
|
"button",
|
|
951
1107
|
{
|
|
952
1108
|
id: C,
|
|
953
1109
|
type: "button",
|
|
954
1110
|
"aria-expanded": b,
|
|
955
|
-
"aria-controls":
|
|
956
|
-
onClick: () => x(
|
|
1111
|
+
"aria-controls": $,
|
|
1112
|
+
onClick: () => x(p.id),
|
|
957
1113
|
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 ${r}`,
|
|
958
1114
|
children: [
|
|
959
|
-
|
|
960
|
-
|
|
1115
|
+
g ? g(p, b) : p.title,
|
|
1116
|
+
f ? /* @__PURE__ */ d(Ue, {}) : null
|
|
961
1117
|
]
|
|
962
1118
|
}
|
|
963
1119
|
),
|
|
964
|
-
/* @__PURE__ */
|
|
1120
|
+
/* @__PURE__ */ d(
|
|
965
1121
|
"div",
|
|
966
1122
|
{
|
|
967
|
-
id:
|
|
1123
|
+
id: $,
|
|
968
1124
|
role: "region",
|
|
969
1125
|
"aria-labelledby": C,
|
|
970
1126
|
hidden: !b,
|
|
971
1127
|
className: `p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400 ${a}`,
|
|
972
|
-
children:
|
|
1128
|
+
children: c ? c(p, b) : p.content
|
|
973
1129
|
}
|
|
974
1130
|
)
|
|
975
1131
|
]
|
|
976
1132
|
},
|
|
977
|
-
|
|
1133
|
+
p.id
|
|
978
1134
|
);
|
|
979
1135
|
})
|
|
980
1136
|
}
|
|
981
1137
|
);
|
|
982
|
-
},
|
|
983
|
-
const e =
|
|
1138
|
+
}, fe = V(null), pe = () => {
|
|
1139
|
+
const e = ee(fe);
|
|
984
1140
|
if (!e)
|
|
985
1141
|
throw new Error(
|
|
986
1142
|
"useModalActions must be used within a ModalActionProvider"
|
|
987
1143
|
);
|
|
988
1144
|
return e;
|
|
989
|
-
},
|
|
990
|
-
function
|
|
1145
|
+
}, ge = V(null), be = () => ee(ge);
|
|
1146
|
+
function ut({
|
|
991
1147
|
id: e,
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1148
|
+
variant: n = "center",
|
|
1149
|
+
title: t,
|
|
1150
|
+
children: r,
|
|
1151
|
+
standalone: o = !1,
|
|
1152
|
+
showFloatingClose: u = !1,
|
|
1153
|
+
containerClasses: g = "",
|
|
1154
|
+
headerClasses: c = "",
|
|
1155
|
+
bodyClasses: f = "",
|
|
1156
|
+
onClose: a,
|
|
1157
|
+
disableEscapeClose: s = !1,
|
|
1158
|
+
closeBtnStyle: l
|
|
1002
1159
|
}) {
|
|
1003
|
-
const
|
|
1004
|
-
|
|
1005
|
-
}, [
|
|
1006
|
-
return
|
|
1007
|
-
|
|
1008
|
-
const v = document.getElementById(e),
|
|
1160
|
+
const i = be(), x = pe(), p = !o && !!i && !!x, [b, C] = z(!1), $ = p ? i.isOpen(e) : b, L = p ? i.getModalData(e) : null, y = n === "bottom-sheet", w = I(() => {
|
|
1161
|
+
p ? x.closeModal(e) : C(!1), a == null || a();
|
|
1162
|
+
}, [p, x, e, a]), h = F(null);
|
|
1163
|
+
return T(() => {
|
|
1164
|
+
$ && (h.current = document.activeElement);
|
|
1165
|
+
const v = document.getElementById(e), P = [
|
|
1009
1166
|
"a[href]",
|
|
1010
1167
|
"button:not([disabled])",
|
|
1011
1168
|
"textarea:not([disabled])",
|
|
1012
1169
|
"input:not([disabled])",
|
|
1013
1170
|
"select:not([disabled])",
|
|
1014
1171
|
'[tabindex]:not([tabindex="-1"])'
|
|
1015
|
-
],
|
|
1172
|
+
], S = () => {
|
|
1016
1173
|
if (!v) return [];
|
|
1017
|
-
const
|
|
1018
|
-
|
|
1174
|
+
const m = v.querySelectorAll(
|
|
1175
|
+
P.join(",")
|
|
1019
1176
|
);
|
|
1020
|
-
return Array.from(
|
|
1021
|
-
},
|
|
1022
|
-
if (
|
|
1023
|
-
const
|
|
1024
|
-
if (
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1177
|
+
return Array.from(m).filter((N) => N.offsetParent !== null);
|
|
1178
|
+
}, O = (m) => {
|
|
1179
|
+
if (m.key === "Tab") {
|
|
1180
|
+
const N = S();
|
|
1181
|
+
if (N.length === 0) return;
|
|
1182
|
+
const D = N[0], k = N[N.length - 1];
|
|
1183
|
+
m.shiftKey ? document.activeElement === D && (m.preventDefault(), k.focus()) : document.activeElement === k && (m.preventDefault(), D.focus());
|
|
1027
1184
|
}
|
|
1028
|
-
},
|
|
1029
|
-
|
|
1185
|
+
}, j = (m) => {
|
|
1186
|
+
m.key === "Escape" && !s && w(), O(m);
|
|
1030
1187
|
};
|
|
1031
|
-
return
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1034
|
-
}, 0), window.addEventListener("keydown",
|
|
1035
|
-
var
|
|
1036
|
-
document.body.style.overflow = "", (
|
|
1188
|
+
return $ && (document.body.style.overflow = "hidden", setTimeout(() => {
|
|
1189
|
+
const m = S();
|
|
1190
|
+
m.length && m[0].focus();
|
|
1191
|
+
}, 0), window.addEventListener("keydown", j)), () => {
|
|
1192
|
+
var m;
|
|
1193
|
+
document.body.style.overflow = "", (m = h.current) == null || m.focus(), window.removeEventListener("keydown", j);
|
|
1037
1194
|
};
|
|
1038
|
-
}, [
|
|
1195
|
+
}, [$, s, w, e]), $ ? /* @__PURE__ */ d(
|
|
1039
1196
|
"div",
|
|
1040
1197
|
{
|
|
1041
|
-
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",
|
|
1042
1198
|
id: e,
|
|
1043
|
-
|
|
1199
|
+
className: `fixed inset-0 z-50 bg-black/60 backdrop-blur-[2px] ${y ? "flex items-end justify-center" : "flex items-center justify-center"}`,
|
|
1200
|
+
children: /* @__PURE__ */ E(
|
|
1044
1201
|
"div",
|
|
1045
1202
|
{
|
|
1046
|
-
className: `bg-white
|
|
1203
|
+
className: `bg-white shadow-lg transform transition-all duration-300 ${y ? "w-full rounded-t-3xl max-h-[92dvh] overflow-y-auto animate-slide-up p-4" : "w-full max-w-md rounded-lg scale-100 p-4"} ${g}`,
|
|
1047
1204
|
children: [
|
|
1048
|
-
/* @__PURE__ */
|
|
1205
|
+
/* @__PURE__ */ E(
|
|
1049
1206
|
"div",
|
|
1050
1207
|
{
|
|
1051
|
-
className: `flex justify-between items-center relative ${
|
|
1208
|
+
className: `flex justify-between items-center relative ${c}`,
|
|
1052
1209
|
children: [
|
|
1053
|
-
|
|
1054
|
-
|
|
1210
|
+
t && /* @__PURE__ */ d("h2", { className: "text-lg font-semibold", children: t }),
|
|
1211
|
+
u && /* @__PURE__ */ d(
|
|
1055
1212
|
"button",
|
|
1056
1213
|
{
|
|
1057
|
-
onClick:
|
|
1058
|
-
className: `text-gray-500 hover:text-black absolute top-0 right-3 hover:bg-gray-200 rounded-full aspect-square w-8 ${o}`,
|
|
1214
|
+
onClick: w,
|
|
1059
1215
|
"aria-label": "Close modal",
|
|
1216
|
+
className: `text-gray-500 hover:text-black absolute top-0 right-3 hover:bg-gray-200 rounded-full aspect-square w-8 ${l}`,
|
|
1060
1217
|
children: "✕"
|
|
1061
1218
|
}
|
|
1062
1219
|
)
|
|
1063
1220
|
]
|
|
1064
1221
|
}
|
|
1065
1222
|
),
|
|
1066
|
-
/* @__PURE__ */
|
|
1223
|
+
/* @__PURE__ */ d("div", { className: f, children: typeof r == "function" ? r({ modalData: L }) : r })
|
|
1067
1224
|
]
|
|
1068
1225
|
}
|
|
1069
1226
|
)
|
|
1070
1227
|
}
|
|
1071
1228
|
) : null;
|
|
1072
1229
|
}
|
|
1073
|
-
function
|
|
1230
|
+
function ft({
|
|
1074
1231
|
children: e
|
|
1075
1232
|
}) {
|
|
1076
|
-
const [n, t] =
|
|
1077
|
-
t((x) => ({ ...x, [l]: !0 })),
|
|
1078
|
-
}, []),
|
|
1079
|
-
t((
|
|
1080
|
-
const x = { ...
|
|
1233
|
+
const [n, t] = z({}), [r, o] = z({}), u = I((l, i) => {
|
|
1234
|
+
t((x) => ({ ...x, [l]: !0 })), i && o((x) => ({ ...x, [l]: i }));
|
|
1235
|
+
}, []), g = I((l) => {
|
|
1236
|
+
t((i) => ({ ...i, [l]: !1 })), o((i) => {
|
|
1237
|
+
const x = { ...i };
|
|
1081
1238
|
return delete x[l], x;
|
|
1082
1239
|
});
|
|
1083
|
-
}, []),
|
|
1240
|
+
}, []), c = I((l) => !!n[l], [n]), f = I(
|
|
1084
1241
|
(l) => r[l],
|
|
1085
1242
|
[r]
|
|
1086
|
-
), a =
|
|
1087
|
-
() => ({ openModal:
|
|
1088
|
-
[
|
|
1089
|
-
),
|
|
1090
|
-
() => ({ isOpen:
|
|
1091
|
-
[
|
|
1243
|
+
), a = _(
|
|
1244
|
+
() => ({ openModal: u, closeModal: g }),
|
|
1245
|
+
[u, g]
|
|
1246
|
+
), s = _(
|
|
1247
|
+
() => ({ isOpen: c, getModalData: f }),
|
|
1248
|
+
[c, f]
|
|
1092
1249
|
);
|
|
1093
|
-
return /* @__PURE__ */
|
|
1250
|
+
return /* @__PURE__ */ d(fe.Provider, { value: a, children: /* @__PURE__ */ d(ge.Provider, { value: s, children: e }) });
|
|
1094
1251
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const { openModal: n, closeModal: t } =
|
|
1252
|
+
function pt(e) {
|
|
1253
|
+
const { openModal: n, closeModal: t } = pe(), { isOpen: r, getModalData: o } = be();
|
|
1097
1254
|
return {
|
|
1098
|
-
open: (
|
|
1255
|
+
open: (u) => n(e, u),
|
|
1099
1256
|
close: () => t(e),
|
|
1100
1257
|
isOpen: r(e),
|
|
1101
|
-
data:
|
|
1258
|
+
data: o(e)
|
|
1102
1259
|
};
|
|
1103
1260
|
}
|
|
1104
1261
|
let J = null, Q = {};
|
|
1105
|
-
function
|
|
1262
|
+
function qe(e) {
|
|
1106
1263
|
J = e;
|
|
1107
1264
|
}
|
|
1108
|
-
function
|
|
1265
|
+
function gt(e) {
|
|
1109
1266
|
Q = { ...Q, ...e };
|
|
1110
1267
|
}
|
|
1111
|
-
function
|
|
1268
|
+
function Xe() {
|
|
1112
1269
|
return Q;
|
|
1113
1270
|
}
|
|
1114
|
-
function
|
|
1271
|
+
function bt(e, n, t = 3e3, r) {
|
|
1115
1272
|
J ? J(e, n, t, r) : console.warn("Toast system is not mounted");
|
|
1116
1273
|
}
|
|
1117
|
-
function
|
|
1118
|
-
return
|
|
1274
|
+
function Je(e) {
|
|
1275
|
+
return te({ 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);
|
|
1119
1276
|
}
|
|
1120
|
-
const
|
|
1277
|
+
const Qe = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
1121
1278
|
const n = Math.random() * 16 | 0;
|
|
1122
1279
|
return (e === "x" ? n : n & 3 | 8).toString(16);
|
|
1123
|
-
}),
|
|
1124
|
-
const [n, t] =
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
const
|
|
1128
|
-
t((a) => [...a, { id:
|
|
1129
|
-
t((a) => a.filter((
|
|
1130
|
-
},
|
|
1280
|
+
}), mt = ({ containerStyle: e = "" }) => {
|
|
1281
|
+
const [n, t] = z([]);
|
|
1282
|
+
T(() => {
|
|
1283
|
+
qe((o, u, g, c) => {
|
|
1284
|
+
const f = Qe();
|
|
1285
|
+
t((a) => [...a, { id: f, type: o, message: u, config: c }]), setTimeout(() => {
|
|
1286
|
+
t((a) => a.filter((s) => s.id !== f));
|
|
1287
|
+
}, g);
|
|
1131
1288
|
});
|
|
1132
1289
|
}, []);
|
|
1133
|
-
const r =
|
|
1134
|
-
return /* @__PURE__ */
|
|
1290
|
+
const r = Xe();
|
|
1291
|
+
return /* @__PURE__ */ d(
|
|
1135
1292
|
"div",
|
|
1136
1293
|
{
|
|
1137
1294
|
className: `fixed top-5 right-5 z-9999 flex flex-col gap-2 ${e}`,
|
|
1138
|
-
children: n.map((
|
|
1139
|
-
var a,
|
|
1140
|
-
const
|
|
1141
|
-
return /* @__PURE__ */
|
|
1295
|
+
children: n.map((o) => {
|
|
1296
|
+
var a, s, l, i, x, p, b, C, $, L, y, w, h, v;
|
|
1297
|
+
const u = ((a = o.config) == null ? void 0 : a.icon) || ((s = r.icons) == null ? void 0 : s[o.type]) || Ve(o.type), g = ((l = o.config) == null ? void 0 : l.bgColor) || ((x = (i = r.colors) == null ? void 0 : i[o.type]) == null ? void 0 : x.bg) || "bg-white dark:bg-gray-800", c = ((p = o.config) == null ? void 0 : p.textColor) || ((C = (b = r.colors) == null ? void 0 : b[o.type]) == null ? void 0 : C.text) || "text-gray-700 dark:text-gray-300", f = `w-8 h-8 mr-3 text-xl flex items-center justify-center ${($ = o.config) == null ? void 0 : $.iconContainerClass}`;
|
|
1298
|
+
return /* @__PURE__ */ E(
|
|
1142
1299
|
"div",
|
|
1143
1300
|
{
|
|
1144
|
-
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${
|
|
1301
|
+
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${g} ${c} ${(L = o.config) == null ? void 0 : L.containerBody}`,
|
|
1145
1302
|
children: [
|
|
1146
|
-
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
((
|
|
1303
|
+
u && /* @__PURE__ */ d("div", { className: f, children: u }),
|
|
1304
|
+
/* @__PURE__ */ E("div", { className: "flex-1", children: [
|
|
1305
|
+
((y = o.config) == null ? void 0 : y.title) && /* @__PURE__ */ d(
|
|
1149
1306
|
"div",
|
|
1150
1307
|
{
|
|
1151
|
-
className: `font-semibold text-black ${(
|
|
1152
|
-
children:
|
|
1308
|
+
className: `font-semibold text-black ${(w = o.config) == null ? void 0 : w.titleClass}`,
|
|
1309
|
+
children: o.config.title
|
|
1153
1310
|
}
|
|
1154
1311
|
),
|
|
1155
|
-
((
|
|
1312
|
+
((h = o.config) == null ? void 0 : h.description) && /* @__PURE__ */ d(
|
|
1156
1313
|
"div",
|
|
1157
1314
|
{
|
|
1158
|
-
className: `text-sm text-gray-500 ${(
|
|
1159
|
-
children:
|
|
1315
|
+
className: `text-sm text-gray-500 ${(v = o.config) == null ? void 0 : v.subTitleClass}`,
|
|
1316
|
+
children: o.config.description
|
|
1160
1317
|
}
|
|
1161
1318
|
)
|
|
1162
1319
|
] }),
|
|
1163
|
-
/* @__PURE__ */
|
|
1320
|
+
/* @__PURE__ */ d(
|
|
1164
1321
|
"button",
|
|
1165
1322
|
{
|
|
1166
|
-
onClick: () => t((
|
|
1323
|
+
onClick: () => t((P) => P.filter((S) => S.id !== o.id)),
|
|
1167
1324
|
className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
|
|
1168
1325
|
"aria-label": "Close",
|
|
1169
|
-
children: /* @__PURE__ */
|
|
1326
|
+
children: /* @__PURE__ */ d(Je, { size: 18 })
|
|
1170
1327
|
}
|
|
1171
1328
|
)
|
|
1172
1329
|
]
|
|
1173
1330
|
},
|
|
1174
|
-
|
|
1331
|
+
o.id
|
|
1175
1332
|
);
|
|
1176
1333
|
})
|
|
1177
1334
|
}
|
|
1178
1335
|
);
|
|
1179
1336
|
};
|
|
1180
|
-
function
|
|
1337
|
+
function Ve(e) {
|
|
1181
1338
|
switch (e) {
|
|
1182
1339
|
case "success":
|
|
1183
1340
|
return "✅";
|
|
@@ -1190,21 +1347,24 @@ function Xe(e) {
|
|
|
1190
1347
|
}
|
|
1191
1348
|
}
|
|
1192
1349
|
export {
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
lt as
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1350
|
+
dt as Accordion,
|
|
1351
|
+
at as Badge,
|
|
1352
|
+
ct as BottomSheet,
|
|
1353
|
+
it as BottomSheetProvider,
|
|
1354
|
+
rt as Button,
|
|
1355
|
+
He as Checkbox,
|
|
1356
|
+
ot as Dropdown,
|
|
1357
|
+
Ce as Input,
|
|
1358
|
+
ut as Modal,
|
|
1359
|
+
ft as ModalProvider,
|
|
1360
|
+
Le as Select,
|
|
1361
|
+
mt as Toast,
|
|
1362
|
+
lt as Toggler,
|
|
1363
|
+
st as Tooltip,
|
|
1364
|
+
gt as setToastDefaults,
|
|
1365
|
+
bt as showToast,
|
|
1366
|
+
Ge as useBottomSheet,
|
|
1367
|
+
pe as useModalActions,
|
|
1368
|
+
pt as useModalInstance,
|
|
1369
|
+
be as useModalState
|
|
1210
1370
|
};
|