tailwind-ux-kit 1.0.24 → 1.0.26
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/Select.d.ts +22 -8
- package/lib/index.d.ts +1 -0
- package/lib/tailwind-ux-kit.es.js +392 -285
- package/lib/tailwind-ux-kit.umd.js +9 -5
- package/package.json +1 -1
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
import { default as React, SelectHTMLAttributes } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { default as React, ChangeEvent, SelectHTMLAttributes } from 'react';
|
|
2
|
+
type InputSize = "xs" | "sm" | "md" | "lg";
|
|
3
|
+
type Shape = "flat" | "rounded" | "pill";
|
|
4
|
+
type Status = "default" | "error" | "warning" | "success";
|
|
5
|
+
type FloatingLabelStyle = "filled" | "outlined" | "standard";
|
|
6
|
+
type IconPosition = "start" | "end" | "left" | "right";
|
|
7
|
+
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "size" | "onChange"> {
|
|
8
|
+
label?: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
inputSize?: InputSize;
|
|
11
|
+
shape?: Shape;
|
|
12
|
+
validate?: (value: string) => Status;
|
|
13
|
+
onChange?: (e: ChangeEvent<HTMLSelectElement>) => void;
|
|
14
|
+
onValidatedChange?: (e: ChangeEvent<HTMLSelectElement>, status: Status) => void;
|
|
8
15
|
className?: string;
|
|
16
|
+
icon?: React.ReactNode;
|
|
17
|
+
iconPosition?: IconPosition;
|
|
18
|
+
floatingLabelStyle?: FloatingLabelStyle;
|
|
19
|
+
isValid?: boolean;
|
|
20
|
+
isInvalid?: boolean;
|
|
21
|
+
feedback?: string;
|
|
22
|
+
feedbackType?: "valid" | "invalid";
|
|
9
23
|
}
|
|
10
|
-
declare const Select: React.
|
|
24
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
11
25
|
export default Select;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as Input } from './components/Input';
|
|
2
|
+
export { default as Select } from './components/Select';
|
|
2
3
|
export { default as Button } from './components/Button';
|
|
3
4
|
export { default as Dropdown } from './components/Dropdown';
|
|
4
5
|
export { default as Tooltip } from './components/ToolTip';
|
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as x, jsx as u } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import O, { forwardRef as J, useState as v, useRef as T, useMemo as _, useCallback as N, useEffect as z, createContext as Q, useContext as V } from "react";
|
|
4
|
+
const le = J((e, n) => {
|
|
5
5
|
const {
|
|
6
|
-
label:
|
|
7
|
-
id:
|
|
6
|
+
label: t,
|
|
7
|
+
id: r,
|
|
8
8
|
inputSize: s = "md",
|
|
9
|
-
shape:
|
|
10
|
-
validate:
|
|
9
|
+
shape: p = "rounded",
|
|
10
|
+
validate: g,
|
|
11
11
|
onValidatedChange: l,
|
|
12
|
-
className:
|
|
13
|
-
icon:
|
|
14
|
-
iconPosition:
|
|
12
|
+
className: i = "",
|
|
13
|
+
icon: a,
|
|
14
|
+
iconPosition: c = "left",
|
|
15
15
|
floatingLabelStyle: o,
|
|
16
|
-
onChange:
|
|
17
|
-
isValid:
|
|
16
|
+
onChange: d,
|
|
17
|
+
isValid: f,
|
|
18
18
|
isInvalid: b,
|
|
19
|
-
feedback:
|
|
20
|
-
feedbackType:
|
|
21
|
-
...
|
|
22
|
-
} = e, [
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
},
|
|
19
|
+
feedback: m,
|
|
20
|
+
feedbackType: C = "invalid",
|
|
21
|
+
...k
|
|
22
|
+
} = e, [$, E] = v("default"), P = (h) => {
|
|
23
|
+
const w = h.target.value, S = (g == null ? void 0 : g(w)) ?? "default";
|
|
24
|
+
E(S), l == null || l(h, S), d == null || d(h);
|
|
25
|
+
}, j = {
|
|
26
26
|
xs: "text-xs px-2 py-1",
|
|
27
27
|
sm: "text-sm px-3 py-1.5",
|
|
28
28
|
md: "text-sm px-3 py-3",
|
|
29
29
|
lg: "text-lg px-5 py-3"
|
|
30
|
-
},
|
|
30
|
+
}, L = {
|
|
31
31
|
flat: "rounded-none",
|
|
32
32
|
rounded: "rounded-md",
|
|
33
33
|
pill: "rounded-full"
|
|
34
|
-
},
|
|
34
|
+
}, A = {
|
|
35
35
|
filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
|
|
36
36
|
outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
|
|
37
37
|
standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
|
|
38
|
-
},
|
|
38
|
+
}, B = {
|
|
39
39
|
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",
|
|
40
40
|
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",
|
|
41
41
|
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"
|
|
42
|
-
},
|
|
43
|
-
if (
|
|
42
|
+
}, F = (h, w, S) => {
|
|
43
|
+
if (S)
|
|
44
44
|
return "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";
|
|
45
|
-
if (
|
|
45
|
+
if (w)
|
|
46
46
|
return "border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";
|
|
47
|
-
switch (
|
|
47
|
+
switch (h) {
|
|
48
48
|
case "error":
|
|
49
49
|
return "border-red-500 bg-red-50 focus:ring-red-500";
|
|
50
50
|
case "warning":
|
|
@@ -54,57 +54,163 @@ const ae = se((e, n) => {
|
|
|
54
54
|
default:
|
|
55
55
|
return "border-gray-300 focus:ring-blue-500";
|
|
56
56
|
}
|
|
57
|
-
},
|
|
58
|
-
return /* @__PURE__ */ x("div", { className: `w-full relative ${
|
|
59
|
-
!
|
|
57
|
+
}, Z = j[s] || j.md, G = L[p] || L.flat, H = F($, f, b), W = c === "start" || c === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", U = a && (c === "start" || c === "left") ? "ps-10" : a ? "pe-10" : "", I = r ?? `input-${(t == null ? void 0 : t.toLowerCase().replace(/\s+/g, "-")) || Math.random().toString(36).slice(2)}`, y = !!o;
|
|
58
|
+
return /* @__PURE__ */ x("div", { className: `w-full relative ${y ? "z-0" : ""}`, children: [
|
|
59
|
+
!y && t && /* @__PURE__ */ u(
|
|
60
60
|
"label",
|
|
61
61
|
{
|
|
62
|
-
htmlFor:
|
|
63
|
-
className: `block mb-1 font-light text-sm ${
|
|
64
|
-
children:
|
|
62
|
+
htmlFor: I,
|
|
63
|
+
className: `block mb-1 font-light text-sm ${f ? "text-green-700 dark:text-green-500" : b ? "text-red-700 dark:text-red-500" : "text-gray-700"}`,
|
|
64
|
+
children: t
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
67
|
/* @__PURE__ */ x("div", { className: "relative w-full", children: [
|
|
68
|
-
|
|
68
|
+
a && /* @__PURE__ */ u(
|
|
69
69
|
"div",
|
|
70
70
|
{
|
|
71
|
-
className: `absolute inset-y-0 flex items-center ${
|
|
72
|
-
children: /* @__PURE__ */ u("span", { className: "text-gray-500", children:
|
|
71
|
+
className: `absolute inset-y-0 flex items-center ${W}`,
|
|
72
|
+
children: /* @__PURE__ */ u("span", { className: "text-gray-500", children: a })
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
75
|
/* @__PURE__ */ u(
|
|
76
76
|
"input",
|
|
77
77
|
{
|
|
78
|
-
...
|
|
79
|
-
id:
|
|
78
|
+
...k,
|
|
79
|
+
id: I,
|
|
80
|
+
ref: n,
|
|
81
|
+
placeholder: y ? " " : k.placeholder,
|
|
82
|
+
onChange: P,
|
|
83
|
+
className: `border peer w-full block font-light appearance-none focus:outline-none focus:ring-0 transition text-[#798ba5] placeholder-[#798ba5] border-gray-400
|
|
84
|
+
${Z}
|
|
85
|
+
${y && o && A[o]}
|
|
86
|
+
${U} ${G} ${H} ${i}`
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
y && t && o && /* @__PURE__ */ u(
|
|
90
|
+
"label",
|
|
91
|
+
{
|
|
92
|
+
htmlFor: I,
|
|
93
|
+
className: `ms-1 ${B[o]} ${i}`,
|
|
94
|
+
children: t
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
] }),
|
|
98
|
+
m && /* @__PURE__ */ u(
|
|
99
|
+
"p",
|
|
100
|
+
{
|
|
101
|
+
className: `mt-1 text-xs ${C === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
|
|
102
|
+
children: m
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
] });
|
|
106
|
+
});
|
|
107
|
+
le.displayName = "Input";
|
|
108
|
+
const ie = J((e, n) => {
|
|
109
|
+
const {
|
|
110
|
+
label: t,
|
|
111
|
+
id: r,
|
|
112
|
+
inputSize: s = "md",
|
|
113
|
+
shape: p = "rounded",
|
|
114
|
+
validate: g,
|
|
115
|
+
onValidatedChange: l,
|
|
116
|
+
className: i = "",
|
|
117
|
+
icon: a,
|
|
118
|
+
iconPosition: c = "left",
|
|
119
|
+
floatingLabelStyle: o,
|
|
120
|
+
onChange: d,
|
|
121
|
+
isValid: f,
|
|
122
|
+
isInvalid: b,
|
|
123
|
+
feedback: m,
|
|
124
|
+
feedbackType: C = "invalid",
|
|
125
|
+
children: k,
|
|
126
|
+
...$
|
|
127
|
+
} = e, [E, P] = v("default"), j = (w) => {
|
|
128
|
+
const S = w.target.value, M = (g == null ? void 0 : g(S)) ?? "default";
|
|
129
|
+
P(M), l == null || l(w, M), d == null || d(w);
|
|
130
|
+
}, L = {
|
|
131
|
+
xs: "text-xs px-2 py-1",
|
|
132
|
+
sm: "text-sm px-3 py-1.5",
|
|
133
|
+
md: "text-sm px-3 py-3",
|
|
134
|
+
lg: "text-lg px-5 py-3"
|
|
135
|
+
}, A = {
|
|
136
|
+
flat: "rounded-none",
|
|
137
|
+
rounded: "rounded-md",
|
|
138
|
+
pill: "rounded-full"
|
|
139
|
+
}, B = {
|
|
140
|
+
filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
|
|
141
|
+
outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
|
|
142
|
+
standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
|
|
143
|
+
}, F = {
|
|
144
|
+
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",
|
|
145
|
+
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",
|
|
146
|
+
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"
|
|
147
|
+
}, Z = (w, S, M) => {
|
|
148
|
+
if (M)
|
|
149
|
+
return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
|
|
150
|
+
if (S)
|
|
151
|
+
return "border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";
|
|
152
|
+
switch (w) {
|
|
153
|
+
case "error":
|
|
154
|
+
return "border-red-500 bg-red-50 focus:ring-red-500";
|
|
155
|
+
case "warning":
|
|
156
|
+
return "border-yellow-500 bg-yellow-50 focus:ring-yellow-500";
|
|
157
|
+
case "success":
|
|
158
|
+
return "border-green-500 bg-green-50 focus:ring-green-500";
|
|
159
|
+
default:
|
|
160
|
+
return "border-gray-300 focus:ring-blue-500";
|
|
161
|
+
}
|
|
162
|
+
}, G = L[s] || L.md, H = A[p] || A.flat, W = Z(E, f, b), U = c === "start" || c === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", I = a && (c === "start" || c === "left") ? "ps-10" : a ? "pe-10" : "", y = r ?? `select-${(t == null ? void 0 : t.toLowerCase().replace(/\s+/g, "-")) || Math.random().toString(36).slice(2)}`, h = !!o;
|
|
163
|
+
return /* @__PURE__ */ x("div", { className: `w-full relative ${h ? "z-0" : ""}`, children: [
|
|
164
|
+
!h && t && /* @__PURE__ */ u(
|
|
165
|
+
"label",
|
|
166
|
+
{
|
|
167
|
+
htmlFor: y,
|
|
168
|
+
className: `block mb-1 font-light text-sm ${f ? "text-green-700" : b ? "text-red-700" : "text-gray-700"}`,
|
|
169
|
+
children: t
|
|
170
|
+
}
|
|
171
|
+
),
|
|
172
|
+
/* @__PURE__ */ x("div", { className: "relative w-full", children: [
|
|
173
|
+
a && /* @__PURE__ */ u(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
className: `absolute inset-y-0 flex items-center ${U}`,
|
|
177
|
+
children: /* @__PURE__ */ u("span", { className: "text-gray-500", children: a })
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
/* @__PURE__ */ u(
|
|
181
|
+
"select",
|
|
182
|
+
{
|
|
183
|
+
...$,
|
|
184
|
+
id: y,
|
|
80
185
|
ref: n,
|
|
81
|
-
placeholder: N ? " " : C.placeholder,
|
|
82
186
|
onChange: j,
|
|
83
|
-
className: `border peer w-full block font-light appearance-none focus:outline-none focus:ring-0 transition
|
|
84
|
-
|
|
85
|
-
${
|
|
187
|
+
className: `border peer w-full block font-light appearance-none focus:outline-none focus:ring-0 transition text-[#798ba5] placeholder-[#798ba5] border-gray-400
|
|
188
|
+
${G}
|
|
189
|
+
${h && o && B[o]}
|
|
190
|
+
${I} ${H} ${W} ${i}`,
|
|
191
|
+
children: k
|
|
86
192
|
}
|
|
87
193
|
),
|
|
88
|
-
|
|
194
|
+
h && t && o && /* @__PURE__ */ u(
|
|
89
195
|
"label",
|
|
90
196
|
{
|
|
91
|
-
htmlFor:
|
|
92
|
-
className: `ms-1 ${
|
|
93
|
-
children:
|
|
197
|
+
htmlFor: y,
|
|
198
|
+
className: `ms-1 ${F[o]} ${i}`,
|
|
199
|
+
children: t
|
|
94
200
|
}
|
|
95
201
|
)
|
|
96
202
|
] }),
|
|
97
|
-
|
|
203
|
+
m && /* @__PURE__ */ u(
|
|
98
204
|
"p",
|
|
99
205
|
{
|
|
100
|
-
className: `mt-1 text-xs ${
|
|
101
|
-
children:
|
|
206
|
+
className: `mt-1 text-xs ${C === "invalid" ? "text-red-600" : "text-green-600"}`,
|
|
207
|
+
children: m
|
|
102
208
|
}
|
|
103
209
|
)
|
|
104
210
|
] });
|
|
105
211
|
});
|
|
106
|
-
|
|
107
|
-
const
|
|
212
|
+
ie.displayName = "Select";
|
|
213
|
+
const ce = {
|
|
108
214
|
primary: "bg-blue-600 text-white hover:bg-blue-700",
|
|
109
215
|
secondary: "bg-gray-600 text-white hover:bg-gray-700",
|
|
110
216
|
success: "bg-green-600 text-white hover:bg-green-700",
|
|
@@ -122,39 +228,39 @@ const le = {
|
|
|
122
228
|
"outline-info": "border border-cyan-600 text-cyan-600 hover:bg-cyan-50",
|
|
123
229
|
"outline-dark": "border border-gray-900 text-gray-900 hover:bg-gray-100",
|
|
124
230
|
"outline-light": "border border-gray-100 text-gray-500 hover:bg-gray-200"
|
|
125
|
-
},
|
|
231
|
+
}, de = {
|
|
126
232
|
xs: "px-3 py-2 text-xs",
|
|
127
233
|
sm: "px-3 py-2 text-sm",
|
|
128
234
|
md: "px-5 py-2.5 text-sm",
|
|
129
235
|
lg: "px-5 py-3 text-base",
|
|
130
236
|
xl: "px-6 py-3.5 text-base"
|
|
131
|
-
},
|
|
237
|
+
}, ue = {
|
|
132
238
|
flat: "shadow-none",
|
|
133
239
|
rounded: "rounded-md",
|
|
134
240
|
pill: "rounded-full",
|
|
135
241
|
circle: "rounded-full w-10 h-10 p-0 flex items-center justify-center"
|
|
136
|
-
},
|
|
242
|
+
}, Pe = ({
|
|
137
243
|
children: e,
|
|
138
244
|
variant: n = "primary",
|
|
139
|
-
size:
|
|
140
|
-
type:
|
|
245
|
+
size: t = "md",
|
|
246
|
+
type: r = "button",
|
|
141
247
|
shape: s = "rounded",
|
|
142
|
-
className:
|
|
143
|
-
isLoading:
|
|
248
|
+
className: p = "",
|
|
249
|
+
isLoading: g = !1,
|
|
144
250
|
disabled: l = !1,
|
|
145
|
-
...
|
|
251
|
+
...i
|
|
146
252
|
}) => {
|
|
147
|
-
const
|
|
253
|
+
const a = l || g, c = [
|
|
148
254
|
"inline-flex items-center justify-center font-normal transition duration-150 cursor-pointer",
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
255
|
+
ce[n],
|
|
256
|
+
de[t],
|
|
257
|
+
ue[s],
|
|
152
258
|
s === "flat" ? "shadow-none" : "shadow-sm",
|
|
153
|
-
|
|
154
|
-
|
|
259
|
+
a ? "opacity-50 cursor-not-allowed pointer-events-none" : "",
|
|
260
|
+
p
|
|
155
261
|
].filter(Boolean).join(" ");
|
|
156
|
-
return /* @__PURE__ */ x("button", { type:
|
|
157
|
-
|
|
262
|
+
return /* @__PURE__ */ x("button", { type: r, className: c, disabled: a, ...i, children: [
|
|
263
|
+
g && /* @__PURE__ */ x(
|
|
158
264
|
"svg",
|
|
159
265
|
{
|
|
160
266
|
"aria-hidden": "true",
|
|
@@ -183,13 +289,13 @@ const le = {
|
|
|
183
289
|
),
|
|
184
290
|
e
|
|
185
291
|
] });
|
|
186
|
-
},
|
|
292
|
+
}, je = ({
|
|
187
293
|
label: e,
|
|
188
294
|
children: n,
|
|
189
|
-
position:
|
|
295
|
+
position: t = "right"
|
|
190
296
|
}) => {
|
|
191
|
-
const [
|
|
192
|
-
switch (
|
|
297
|
+
const [r, s] = v(!1), [p, g] = v(!1), l = T(null), i = T(null), a = _(() => {
|
|
298
|
+
switch (t) {
|
|
193
299
|
case "left":
|
|
194
300
|
return "left-0";
|
|
195
301
|
case "center":
|
|
@@ -198,59 +304,59 @@ const le = {
|
|
|
198
304
|
default:
|
|
199
305
|
return "right-0";
|
|
200
306
|
}
|
|
201
|
-
}, [
|
|
202
|
-
const b =
|
|
203
|
-
l.current && !l.current.contains(b) &&
|
|
204
|
-
}, []), o =
|
|
205
|
-
if (!
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
307
|
+
}, [t]), c = N((f) => {
|
|
308
|
+
const b = f.target;
|
|
309
|
+
l.current && !l.current.contains(b) && i.current && !i.current.contains(b) && s(!1);
|
|
310
|
+
}, []), o = N(() => {
|
|
311
|
+
if (!i.current || !l.current) return;
|
|
312
|
+
const f = i.current.getBoundingClientRect(), b = l.current.getBoundingClientRect(), m = window.innerHeight - f.bottom, C = f.top;
|
|
313
|
+
g(
|
|
314
|
+
m < b.height && C > b.height
|
|
209
315
|
);
|
|
210
316
|
}, []);
|
|
211
|
-
|
|
212
|
-
if (
|
|
317
|
+
z(() => {
|
|
318
|
+
if (r)
|
|
213
319
|
return o(), window.addEventListener("resize", o), window.addEventListener("scroll", o, !0), () => {
|
|
214
320
|
window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0);
|
|
215
321
|
};
|
|
216
|
-
}, [
|
|
217
|
-
const
|
|
322
|
+
}, [r, o]), z(() => (document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c)), [c]);
|
|
323
|
+
const d = N(() => s((f) => !f), []);
|
|
218
324
|
return /* @__PURE__ */ x("div", { className: "relative flex items-center", children: [
|
|
219
|
-
/* @__PURE__ */ u("button", { ref:
|
|
220
|
-
|
|
325
|
+
/* @__PURE__ */ u("button", { ref: i, onClick: d, children: e }),
|
|
326
|
+
r && /* @__PURE__ */ u(
|
|
221
327
|
"div",
|
|
222
328
|
{
|
|
223
329
|
ref: l,
|
|
224
330
|
className: `absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
|
|
225
|
-
${
|
|
226
|
-
${
|
|
331
|
+
${p ? "bottom-full mb-2" : "top-full mt-2"}
|
|
332
|
+
${a}`,
|
|
227
333
|
children: n
|
|
228
334
|
}
|
|
229
335
|
)
|
|
230
336
|
] });
|
|
231
|
-
},
|
|
337
|
+
}, Ie = ({
|
|
232
338
|
children: e,
|
|
233
339
|
content: n,
|
|
234
|
-
position:
|
|
235
|
-
className:
|
|
340
|
+
position: t = "top",
|
|
341
|
+
className: r = "",
|
|
236
342
|
tooltipClass: s = "",
|
|
237
|
-
tooltipStyle:
|
|
343
|
+
tooltipStyle: p = {}
|
|
238
344
|
}) => {
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
if (!
|
|
345
|
+
const g = T(null), l = T(null);
|
|
346
|
+
z(() => {
|
|
347
|
+
const a = g.current, c = l.current;
|
|
348
|
+
if (!a || !c) return;
|
|
243
349
|
const o = () => {
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
|
|
350
|
+
c.style.opacity = "1", c.style.visibility = "visible";
|
|
351
|
+
}, d = () => {
|
|
352
|
+
c.style.opacity = "0", c.style.visibility = "hidden";
|
|
247
353
|
};
|
|
248
|
-
return
|
|
249
|
-
|
|
354
|
+
return a.addEventListener("mouseenter", o), a.addEventListener("mouseleave", d), () => {
|
|
355
|
+
a.removeEventListener("mouseenter", o), a.removeEventListener("mouseleave", d);
|
|
250
356
|
};
|
|
251
357
|
}, []);
|
|
252
|
-
const
|
|
253
|
-
const
|
|
358
|
+
const i = (a) => {
|
|
359
|
+
const c = {
|
|
254
360
|
position: "absolute",
|
|
255
361
|
opacity: 0,
|
|
256
362
|
visibility: "hidden",
|
|
@@ -267,10 +373,10 @@ const le = {
|
|
|
267
373
|
zIndex: 9999,
|
|
268
374
|
width: "max-content"
|
|
269
375
|
};
|
|
270
|
-
switch (
|
|
376
|
+
switch (a) {
|
|
271
377
|
case "top":
|
|
272
378
|
return {
|
|
273
|
-
...
|
|
379
|
+
...c,
|
|
274
380
|
bottom: "100%",
|
|
275
381
|
left: "50%",
|
|
276
382
|
transform: "translateX(-50%)",
|
|
@@ -278,7 +384,7 @@ const le = {
|
|
|
278
384
|
};
|
|
279
385
|
case "bottom":
|
|
280
386
|
return {
|
|
281
|
-
...
|
|
387
|
+
...c,
|
|
282
388
|
top: "100%",
|
|
283
389
|
left: "50%",
|
|
284
390
|
transform: "translateX(-50%)",
|
|
@@ -286,7 +392,7 @@ const le = {
|
|
|
286
392
|
};
|
|
287
393
|
case "left":
|
|
288
394
|
return {
|
|
289
|
-
...
|
|
395
|
+
...c,
|
|
290
396
|
right: "100%",
|
|
291
397
|
top: "50%",
|
|
292
398
|
transform: "translateY(-50%)",
|
|
@@ -294,17 +400,17 @@ const le = {
|
|
|
294
400
|
};
|
|
295
401
|
case "right":
|
|
296
402
|
return {
|
|
297
|
-
...
|
|
403
|
+
...c,
|
|
298
404
|
left: "100%",
|
|
299
405
|
top: "50%",
|
|
300
406
|
transform: "translateY(-50%)",
|
|
301
407
|
marginLeft: "8px"
|
|
302
408
|
};
|
|
303
409
|
default:
|
|
304
|
-
return
|
|
410
|
+
return c;
|
|
305
411
|
}
|
|
306
412
|
};
|
|
307
|
-
return /* @__PURE__ */ x("div", { ref:
|
|
413
|
+
return /* @__PURE__ */ x("div", { ref: g, className: `relative inline-block ${r}`, children: [
|
|
308
414
|
e,
|
|
309
415
|
/* @__PURE__ */ u(
|
|
310
416
|
"div",
|
|
@@ -313,14 +419,14 @@ const le = {
|
|
|
313
419
|
role: "tooltip",
|
|
314
420
|
className: s,
|
|
315
421
|
style: {
|
|
316
|
-
...
|
|
317
|
-
...
|
|
422
|
+
...i(t),
|
|
423
|
+
...p
|
|
318
424
|
},
|
|
319
425
|
children: n
|
|
320
426
|
}
|
|
321
427
|
)
|
|
322
428
|
] });
|
|
323
|
-
},
|
|
429
|
+
}, ge = {
|
|
324
430
|
primary: "bg-blue-500 text-white",
|
|
325
431
|
secondary: "bg-gray-500 text-white",
|
|
326
432
|
success: "bg-green-500 text-white",
|
|
@@ -338,169 +444,169 @@ const le = {
|
|
|
338
444
|
"outline-info": "border border-cyan-500 text-cyan-500 bg-transparent",
|
|
339
445
|
"outline-dark": "border border-black text-black bg-transparent",
|
|
340
446
|
"outline-light": "border border-gray-100 text-gray-800 bg-transparent"
|
|
341
|
-
},
|
|
447
|
+
}, pe = {
|
|
342
448
|
xs: "text-xs px-2 py-0.5",
|
|
343
449
|
sm: "text-sm px-2.5 py-0.5",
|
|
344
450
|
md: "text-base px-3 py-1",
|
|
345
451
|
lg: "text-lg px-3.5 py-1.5",
|
|
346
452
|
xl: "text-xl px-4 py-2"
|
|
347
|
-
},
|
|
453
|
+
}, fe = {
|
|
348
454
|
flat: "rounded-none",
|
|
349
455
|
rounded: "rounded-sm",
|
|
350
456
|
pill: "rounded-full",
|
|
351
457
|
circle: "rounded-full p-2 w-8 h-8 justify-center"
|
|
352
|
-
},
|
|
458
|
+
}, ze = ({
|
|
353
459
|
label: e,
|
|
354
460
|
variant: n = "primary",
|
|
355
|
-
size:
|
|
356
|
-
shape:
|
|
461
|
+
size: t = "sm",
|
|
462
|
+
shape: r = "rounded",
|
|
357
463
|
icon: s,
|
|
358
|
-
dismissible:
|
|
359
|
-
onDismiss:
|
|
464
|
+
dismissible: p,
|
|
465
|
+
onDismiss: g,
|
|
360
466
|
className: l = "",
|
|
361
|
-
...
|
|
467
|
+
...i
|
|
362
468
|
}) => {
|
|
363
|
-
const
|
|
364
|
-
return /* @__PURE__ */ x("span", { className:
|
|
469
|
+
const a = !e && !!s, c = `inline-flex items-center font-medium ${ge[n] || ""} ${pe[t] || ""} ${fe[r] || ""} ${a ? "justify-center p-2 w-8 h-8" : ""} ` + l;
|
|
470
|
+
return /* @__PURE__ */ x("span", { className: c.trim(), ...i, children: [
|
|
365
471
|
s && /* @__PURE__ */ u("span", { className: e ? "mr-1" : "", children: s }),
|
|
366
472
|
e,
|
|
367
|
-
|
|
473
|
+
p && /* @__PURE__ */ u(
|
|
368
474
|
"button",
|
|
369
475
|
{
|
|
370
476
|
type: "button",
|
|
371
|
-
onClick:
|
|
477
|
+
onClick: g,
|
|
372
478
|
className: "ml-2 text-xs font-bold leading-none focus:outline-none",
|
|
373
479
|
children: "×"
|
|
374
480
|
}
|
|
375
481
|
)
|
|
376
482
|
] });
|
|
377
483
|
};
|
|
378
|
-
var
|
|
484
|
+
var ee = {
|
|
379
485
|
color: void 0,
|
|
380
486
|
size: void 0,
|
|
381
487
|
className: void 0,
|
|
382
488
|
style: void 0,
|
|
383
489
|
attr: void 0
|
|
384
|
-
},
|
|
385
|
-
function
|
|
490
|
+
}, K = O.createContext && /* @__PURE__ */ O.createContext(ee), be = ["attr", "size", "title"];
|
|
491
|
+
function xe(e, n) {
|
|
386
492
|
if (e == null) return {};
|
|
387
|
-
var
|
|
493
|
+
var t = me(e, n), r, s;
|
|
388
494
|
if (Object.getOwnPropertySymbols) {
|
|
389
|
-
var
|
|
390
|
-
for (s = 0; s <
|
|
391
|
-
|
|
495
|
+
var p = Object.getOwnPropertySymbols(e);
|
|
496
|
+
for (s = 0; s < p.length; s++)
|
|
497
|
+
r = p[s], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
392
498
|
}
|
|
393
|
-
return
|
|
499
|
+
return t;
|
|
394
500
|
}
|
|
395
|
-
function
|
|
501
|
+
function me(e, n) {
|
|
396
502
|
if (e == null) return {};
|
|
397
|
-
var
|
|
398
|
-
for (var
|
|
399
|
-
if (Object.prototype.hasOwnProperty.call(e,
|
|
400
|
-
if (n.indexOf(
|
|
401
|
-
r
|
|
503
|
+
var t = {};
|
|
504
|
+
for (var r in e)
|
|
505
|
+
if (Object.prototype.hasOwnProperty.call(e, r)) {
|
|
506
|
+
if (n.indexOf(r) >= 0) continue;
|
|
507
|
+
t[r] = e[r];
|
|
402
508
|
}
|
|
403
|
-
return
|
|
509
|
+
return t;
|
|
404
510
|
}
|
|
405
|
-
function
|
|
406
|
-
return
|
|
511
|
+
function D() {
|
|
512
|
+
return D = Object.assign ? Object.assign.bind() : function(e) {
|
|
407
513
|
for (var n = 1; n < arguments.length; n++) {
|
|
408
|
-
var
|
|
409
|
-
for (var
|
|
410
|
-
Object.prototype.hasOwnProperty.call(
|
|
514
|
+
var t = arguments[n];
|
|
515
|
+
for (var r in t)
|
|
516
|
+
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
411
517
|
}
|
|
412
518
|
return e;
|
|
413
|
-
},
|
|
519
|
+
}, D.apply(this, arguments);
|
|
414
520
|
}
|
|
415
|
-
function
|
|
416
|
-
var
|
|
521
|
+
function q(e, n) {
|
|
522
|
+
var t = Object.keys(e);
|
|
417
523
|
if (Object.getOwnPropertySymbols) {
|
|
418
|
-
var
|
|
419
|
-
n && (
|
|
524
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
525
|
+
n && (r = r.filter(function(s) {
|
|
420
526
|
return Object.getOwnPropertyDescriptor(e, s).enumerable;
|
|
421
|
-
})),
|
|
527
|
+
})), t.push.apply(t, r);
|
|
422
528
|
}
|
|
423
|
-
return
|
|
529
|
+
return t;
|
|
424
530
|
}
|
|
425
|
-
function
|
|
531
|
+
function R(e) {
|
|
426
532
|
for (var n = 1; n < arguments.length; n++) {
|
|
427
|
-
var
|
|
428
|
-
n % 2 ?
|
|
429
|
-
|
|
430
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
431
|
-
Object.defineProperty(e,
|
|
533
|
+
var t = arguments[n] != null ? arguments[n] : {};
|
|
534
|
+
n % 2 ? q(Object(t), !0).forEach(function(r) {
|
|
535
|
+
he(e, r, t[r]);
|
|
536
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : q(Object(t)).forEach(function(r) {
|
|
537
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
432
538
|
});
|
|
433
539
|
}
|
|
434
540
|
return e;
|
|
435
541
|
}
|
|
436
|
-
function
|
|
437
|
-
return n =
|
|
542
|
+
function he(e, n, t) {
|
|
543
|
+
return n = ye(n), n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
|
|
438
544
|
}
|
|
439
|
-
function
|
|
440
|
-
var n =
|
|
545
|
+
function ye(e) {
|
|
546
|
+
var n = we(e, "string");
|
|
441
547
|
return typeof n == "symbol" ? n : n + "";
|
|
442
548
|
}
|
|
443
|
-
function
|
|
549
|
+
function we(e, n) {
|
|
444
550
|
if (typeof e != "object" || !e) return e;
|
|
445
|
-
var
|
|
446
|
-
if (
|
|
447
|
-
var
|
|
448
|
-
if (typeof
|
|
551
|
+
var t = e[Symbol.toPrimitive];
|
|
552
|
+
if (t !== void 0) {
|
|
553
|
+
var r = t.call(e, n);
|
|
554
|
+
if (typeof r != "object") return r;
|
|
449
555
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
450
556
|
}
|
|
451
557
|
return (n === "string" ? String : Number)(e);
|
|
452
558
|
}
|
|
453
|
-
function
|
|
454
|
-
return e && e.map((n,
|
|
455
|
-
key:
|
|
456
|
-
}, n.attr),
|
|
559
|
+
function te(e) {
|
|
560
|
+
return e && e.map((n, t) => /* @__PURE__ */ O.createElement(n.tag, R({
|
|
561
|
+
key: t
|
|
562
|
+
}, n.attr), te(n.child)));
|
|
457
563
|
}
|
|
458
|
-
function
|
|
459
|
-
return (n) => /* @__PURE__ */
|
|
460
|
-
attr:
|
|
461
|
-
}, n),
|
|
564
|
+
function re(e) {
|
|
565
|
+
return (n) => /* @__PURE__ */ O.createElement(ve, D({
|
|
566
|
+
attr: R({}, e.attr)
|
|
567
|
+
}, n), te(e.child));
|
|
462
568
|
}
|
|
463
|
-
function
|
|
464
|
-
var n = (
|
|
569
|
+
function ve(e) {
|
|
570
|
+
var n = (t) => {
|
|
465
571
|
var {
|
|
466
|
-
attr:
|
|
572
|
+
attr: r,
|
|
467
573
|
size: s,
|
|
468
|
-
title:
|
|
469
|
-
} = e,
|
|
470
|
-
return
|
|
574
|
+
title: p
|
|
575
|
+
} = e, g = xe(e, be), l = s || t.size || "1em", i;
|
|
576
|
+
return t.className && (i = t.className), e.className && (i = (i ? i + " " : "") + e.className), /* @__PURE__ */ O.createElement("svg", D({
|
|
471
577
|
stroke: "currentColor",
|
|
472
578
|
fill: "currentColor",
|
|
473
579
|
strokeWidth: "0"
|
|
474
|
-
},
|
|
475
|
-
className:
|
|
476
|
-
style:
|
|
477
|
-
color: e.color ||
|
|
478
|
-
},
|
|
580
|
+
}, t.attr, r, g, {
|
|
581
|
+
className: i,
|
|
582
|
+
style: R(R({
|
|
583
|
+
color: e.color || t.color
|
|
584
|
+
}, t.style), e.style),
|
|
479
585
|
height: l,
|
|
480
586
|
width: l,
|
|
481
587
|
xmlns: "http://www.w3.org/2000/svg"
|
|
482
|
-
}),
|
|
588
|
+
}), p && /* @__PURE__ */ O.createElement("title", null, p), e.children);
|
|
483
589
|
};
|
|
484
|
-
return
|
|
590
|
+
return K !== void 0 ? /* @__PURE__ */ O.createElement(K.Consumer, null, (t) => n(t)) : n(ee);
|
|
485
591
|
}
|
|
486
|
-
function
|
|
487
|
-
return
|
|
592
|
+
function Ce(e) {
|
|
593
|
+
return re({ 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);
|
|
488
594
|
}
|
|
489
|
-
const
|
|
595
|
+
const Ae = ({
|
|
490
596
|
items: e,
|
|
491
597
|
allowMultipleOpen: n = !1,
|
|
492
|
-
className:
|
|
493
|
-
open:
|
|
598
|
+
className: t = "",
|
|
599
|
+
open: r,
|
|
494
600
|
onChange: s,
|
|
495
|
-
renderTitle:
|
|
496
|
-
renderContent:
|
|
601
|
+
renderTitle: p,
|
|
602
|
+
renderContent: g
|
|
497
603
|
}) => {
|
|
498
|
-
const [l,
|
|
604
|
+
const [l, i] = v(/* @__PURE__ */ new Set()), a = _(() => r ? new Set(r) : l, [r, l]), c = N(
|
|
499
605
|
(o) => {
|
|
500
|
-
const
|
|
501
|
-
|
|
606
|
+
const d = new Set(a);
|
|
607
|
+
d.has(o) ? d.delete(o) : (n || d.clear(), d.add(o)), r && s ? s(Array.from(d)) : i(d);
|
|
502
608
|
},
|
|
503
|
-
[
|
|
609
|
+
[a, r, s, n]
|
|
504
610
|
);
|
|
505
611
|
return /* @__PURE__ */ u(
|
|
506
612
|
"div",
|
|
@@ -509,23 +615,23 @@ const Me = ({
|
|
|
509
615
|
role: "region",
|
|
510
616
|
"aria-multiselectable": n,
|
|
511
617
|
children: e.map((o) => {
|
|
512
|
-
const
|
|
618
|
+
const d = a.has(o.id), f = `accordion-heading-${o.id}`, b = `accordion-panel-${o.id}`;
|
|
513
619
|
return /* @__PURE__ */ x(
|
|
514
620
|
"div",
|
|
515
621
|
{
|
|
516
|
-
className: `accordion-item mb-2 border rounded border-gray-300 dark:border-gray-700 ${
|
|
622
|
+
className: `accordion-item mb-2 border rounded border-gray-300 dark:border-gray-700 ${t}`,
|
|
517
623
|
children: [
|
|
518
|
-
/* @__PURE__ */ u("h3", { id:
|
|
624
|
+
/* @__PURE__ */ u("h3", { id: f, children: /* @__PURE__ */ x(
|
|
519
625
|
"button",
|
|
520
626
|
{
|
|
521
627
|
type: "button",
|
|
522
|
-
"aria-expanded":
|
|
628
|
+
"aria-expanded": d,
|
|
523
629
|
"aria-controls": b,
|
|
524
|
-
onClick: () =>
|
|
630
|
+
onClick: () => c(o.id),
|
|
525
631
|
className: "flex justify-between items-center w-full p-2 font-medium text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3",
|
|
526
632
|
children: [
|
|
527
|
-
|
|
528
|
-
/* @__PURE__ */ u(
|
|
633
|
+
p ? p(o, d) : o.title,
|
|
634
|
+
/* @__PURE__ */ u(Ce, {})
|
|
529
635
|
]
|
|
530
636
|
}
|
|
531
637
|
) }),
|
|
@@ -534,10 +640,10 @@ const Me = ({
|
|
|
534
640
|
{
|
|
535
641
|
id: b,
|
|
536
642
|
role: "region",
|
|
537
|
-
"aria-labelledby":
|
|
538
|
-
hidden: !
|
|
643
|
+
"aria-labelledby": f,
|
|
644
|
+
hidden: !d,
|
|
539
645
|
className: "p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",
|
|
540
|
-
children:
|
|
646
|
+
children: g ? g(o, d) : o.content
|
|
541
647
|
}
|
|
542
648
|
)
|
|
543
649
|
]
|
|
@@ -547,25 +653,25 @@ const Me = ({
|
|
|
547
653
|
})
|
|
548
654
|
}
|
|
549
655
|
);
|
|
550
|
-
},
|
|
551
|
-
function
|
|
656
|
+
}, ne = Q(null), oe = () => V(ne), se = Q(null), ae = () => V(se);
|
|
657
|
+
function Me({
|
|
552
658
|
id: e,
|
|
553
659
|
title: n,
|
|
554
|
-
children:
|
|
555
|
-
standalone:
|
|
660
|
+
children: t,
|
|
661
|
+
standalone: r = !1,
|
|
556
662
|
showFloatingClose: s = !1,
|
|
557
|
-
containerClasses:
|
|
558
|
-
onClose:
|
|
663
|
+
containerClasses: p = "",
|
|
664
|
+
onClose: g
|
|
559
665
|
}) {
|
|
560
|
-
const l =
|
|
561
|
-
|
|
666
|
+
const l = ae(), i = oe(), a = !r && !!l && !!i, [c, o] = v(!1), d = a ? l.isOpen(e) : c, f = a ? l.getModalData(e) : null, b = () => {
|
|
667
|
+
a ? i.closeModal(e) : o(!1), g == null || g();
|
|
562
668
|
};
|
|
563
|
-
return
|
|
669
|
+
return z(() => (d ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
564
670
|
document.body.style.overflow = "";
|
|
565
|
-
}), [
|
|
671
|
+
}), [d]), d ? /* @__PURE__ */ u("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]", children: /* @__PURE__ */ x(
|
|
566
672
|
"div",
|
|
567
673
|
{
|
|
568
|
-
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${
|
|
674
|
+
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${p}`,
|
|
569
675
|
children: [
|
|
570
676
|
/* @__PURE__ */ x("div", { className: "flex justify-between items-center relative", children: [
|
|
571
677
|
n && /* @__PURE__ */ u("h2", { className: "text-lg font-semibold", children: n }),
|
|
@@ -579,98 +685,98 @@ function ze({
|
|
|
579
685
|
}
|
|
580
686
|
)
|
|
581
687
|
] }),
|
|
582
|
-
/* @__PURE__ */ u("div", { className: "mt-3 text-sm text-gray-700", children: typeof
|
|
688
|
+
/* @__PURE__ */ u("div", { className: "mt-3 text-sm text-gray-700", children: typeof t == "function" ? t({ modalData: f }) : t })
|
|
583
689
|
]
|
|
584
690
|
}
|
|
585
691
|
) }) : null;
|
|
586
692
|
}
|
|
587
|
-
function
|
|
693
|
+
function Te({
|
|
588
694
|
children: e
|
|
589
695
|
}) {
|
|
590
|
-
const [n,
|
|
591
|
-
|
|
592
|
-
}, []),
|
|
593
|
-
|
|
594
|
-
const
|
|
595
|
-
return delete
|
|
696
|
+
const [n, t] = v({}), [r, s] = v({}), p = N((o, d) => {
|
|
697
|
+
t((f) => ({ ...f, [o]: !0 })), d && s((f) => ({ ...f, [o]: d }));
|
|
698
|
+
}, []), g = N((o) => {
|
|
699
|
+
t((d) => ({ ...d, [o]: !1 })), s((d) => {
|
|
700
|
+
const f = { ...d };
|
|
701
|
+
return delete f[o], f;
|
|
596
702
|
});
|
|
597
|
-
}, []), l =
|
|
598
|
-
(o) =>
|
|
599
|
-
[
|
|
600
|
-
),
|
|
601
|
-
() => ({ openModal:
|
|
602
|
-
[
|
|
603
|
-
),
|
|
604
|
-
() => ({ isOpen: l, getModalData:
|
|
605
|
-
[l,
|
|
703
|
+
}, []), l = N((o) => !!n[o], [n]), i = N(
|
|
704
|
+
(o) => r[o],
|
|
705
|
+
[r]
|
|
706
|
+
), a = _(
|
|
707
|
+
() => ({ openModal: p, closeModal: g }),
|
|
708
|
+
[p, g]
|
|
709
|
+
), c = _(
|
|
710
|
+
() => ({ isOpen: l, getModalData: i }),
|
|
711
|
+
[l, i]
|
|
606
712
|
);
|
|
607
|
-
return /* @__PURE__ */ u(
|
|
713
|
+
return /* @__PURE__ */ u(ne.Provider, { value: a, children: /* @__PURE__ */ u(se.Provider, { value: c, children: e }) });
|
|
608
714
|
}
|
|
609
|
-
function
|
|
610
|
-
const { openModal: n, closeModal:
|
|
715
|
+
function _e(e) {
|
|
716
|
+
const { openModal: n, closeModal: t } = oe(), { isOpen: r, getModalData: s } = ae();
|
|
611
717
|
return {
|
|
612
|
-
open: (
|
|
613
|
-
close: () =>
|
|
614
|
-
isOpen:
|
|
718
|
+
open: (p) => n(e, p),
|
|
719
|
+
close: () => t(e),
|
|
720
|
+
isOpen: r(e),
|
|
615
721
|
data: s(e)
|
|
616
722
|
};
|
|
617
723
|
}
|
|
618
|
-
let
|
|
619
|
-
function
|
|
620
|
-
|
|
724
|
+
let X = null, Y = {};
|
|
725
|
+
function Se(e) {
|
|
726
|
+
X = e;
|
|
621
727
|
}
|
|
622
|
-
function
|
|
623
|
-
|
|
728
|
+
function De(e) {
|
|
729
|
+
Y = { ...Y, ...e };
|
|
624
730
|
}
|
|
625
|
-
function
|
|
626
|
-
return
|
|
731
|
+
function Ne() {
|
|
732
|
+
return Y;
|
|
627
733
|
}
|
|
628
|
-
function
|
|
629
|
-
|
|
734
|
+
function Re(e, n, t = 3e3, r) {
|
|
735
|
+
X ? X(e, n, t, r) : console.warn("Toast system is not mounted");
|
|
630
736
|
}
|
|
631
|
-
function
|
|
632
|
-
return
|
|
737
|
+
function ke(e) {
|
|
738
|
+
return re({ 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);
|
|
633
739
|
}
|
|
634
|
-
const
|
|
740
|
+
const Le = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
635
741
|
const n = Math.random() * 16 | 0;
|
|
636
742
|
return (e === "x" ? n : n & 3 | 8).toString(16);
|
|
637
|
-
}),
|
|
638
|
-
const [e, n] =
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
const l =
|
|
642
|
-
n((
|
|
643
|
-
n((
|
|
644
|
-
},
|
|
743
|
+
}), Be = () => {
|
|
744
|
+
const [e, n] = v([]);
|
|
745
|
+
z(() => {
|
|
746
|
+
Se((r, s, p, g) => {
|
|
747
|
+
const l = Le();
|
|
748
|
+
n((i) => [...i, { id: l, type: r, message: s, config: g }]), setTimeout(() => {
|
|
749
|
+
n((i) => i.filter((a) => a.id !== l));
|
|
750
|
+
}, p);
|
|
645
751
|
});
|
|
646
752
|
}, []);
|
|
647
|
-
const
|
|
648
|
-
return /* @__PURE__ */ u("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((
|
|
649
|
-
var
|
|
650
|
-
const s = ((
|
|
753
|
+
const t = Ne();
|
|
754
|
+
return /* @__PURE__ */ u("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((r) => {
|
|
755
|
+
var i, a, c, o, d, f, b, m, C, k, $, E, P;
|
|
756
|
+
const s = ((i = r.config) == null ? void 0 : i.icon) || ((a = t.icons) == null ? void 0 : a[r.type]) || Oe(r.type), p = ((c = r.config) == null ? void 0 : c.bgColor) || ((d = (o = t.colors) == null ? void 0 : o[r.type]) == null ? void 0 : d.bg) || "bg-white dark:bg-gray-800", g = ((f = r.config) == null ? void 0 : f.textColor) || ((m = (b = t.colors) == null ? void 0 : b[r.type]) == null ? void 0 : m.text) || "text-gray-700 dark:text-gray-300", l = ((C = r.config) == null ? void 0 : C.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
|
|
651
757
|
return /* @__PURE__ */ x(
|
|
652
758
|
"div",
|
|
653
759
|
{
|
|
654
|
-
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${
|
|
760
|
+
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${p} ${g}`,
|
|
655
761
|
children: [
|
|
656
762
|
/* @__PURE__ */ u("div", { className: l, children: s }),
|
|
657
763
|
/* @__PURE__ */ x("div", { className: "flex-1 me-3", children: [
|
|
658
|
-
((
|
|
659
|
-
((
|
|
660
|
-
!((
|
|
764
|
+
((k = r.config) == null ? void 0 : k.title) && /* @__PURE__ */ u("div", { className: "font-semibold text-black", children: r.config.title }),
|
|
765
|
+
(($ = r.config) == null ? void 0 : $.description) && /* @__PURE__ */ u("div", { className: "text-sm text-gray-500", children: r.config.description }),
|
|
766
|
+
!((E = r.config) != null && E.title) && !((P = r.config) != null && P.description) && /* @__PURE__ */ u("div", { className: "text-sm", children: r.message })
|
|
661
767
|
] }),
|
|
662
768
|
/* @__PURE__ */ u(
|
|
663
769
|
"button",
|
|
664
770
|
{
|
|
665
|
-
onClick: () => n((
|
|
771
|
+
onClick: () => n((j) => j.filter((L) => L.id !== r.id)),
|
|
666
772
|
className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
|
|
667
773
|
"aria-label": "Close",
|
|
668
|
-
children: /* @__PURE__ */ u(
|
|
774
|
+
children: /* @__PURE__ */ u(ke, { size: 18 })
|
|
669
775
|
}
|
|
670
776
|
)
|
|
671
777
|
]
|
|
672
778
|
},
|
|
673
|
-
|
|
779
|
+
r.id
|
|
674
780
|
);
|
|
675
781
|
}) });
|
|
676
782
|
};
|
|
@@ -687,18 +793,19 @@ function Oe(e) {
|
|
|
687
793
|
}
|
|
688
794
|
}
|
|
689
795
|
export {
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
796
|
+
Ae as Accordion,
|
|
797
|
+
ze as Badge,
|
|
798
|
+
Pe as Button,
|
|
799
|
+
je as Dropdown,
|
|
800
|
+
le as Input,
|
|
801
|
+
Me as Modal,
|
|
802
|
+
Te as ModalProvider,
|
|
803
|
+
ie as Select,
|
|
804
|
+
Be as Toast,
|
|
805
|
+
Ie as Tooltip,
|
|
806
|
+
De as setToastDefaults,
|
|
807
|
+
Re as showToast,
|
|
808
|
+
oe as useModalActions,
|
|
809
|
+
_e as useModalInstance,
|
|
810
|
+
ae as useModalState
|
|
704
811
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
(function(x,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],o):(x=typeof globalThis<"u"?globalThis:x||self,o(x.TailwindUiKit={},x.jsxRuntime,x.React))})(this,function(x,o,a){"use strict";"use client";const
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
|
|
5
|
-
${d}`,children:n})]})},J=({children:e,content:n,position:r="top",className:t="",tooltipClass:l="",tooltipStyle:g={}})=>{const b=a.useRef(null),c=a.useRef(null);a.useEffect(()=>{const d=b.current,f=c.current;if(!d||!f)return;const s=()=>{f.style.opacity="1",f.style.visibility="visible"},u=()=>{f.style.opacity="0",f.style.visibility="hidden"};return d.addEventListener("mouseenter",s),d.addEventListener("mouseleave",u),()=>{d.removeEventListener("mouseenter",s),d.removeEventListener("mouseleave",u)}},[]);const i=d=>{const f={position:"absolute",opacity:0,visibility:"hidden",transition:"opacity 0.2s ease",maxWidth:"240px",whiteSpace:"normal",wordBreak:"break-word",padding:"8px 12px",fontSize:"0.875rem",backgroundColor:"black",color:"white",borderRadius:"4px",boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.15)",zIndex:9999,width:"max-content"};switch(d){case"top":return{...f,bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};case"bottom":return{...f,top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"left":return{...f,right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"right":return{...f,left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};default:return f}};return o.jsxs("div",{ref:b,className:`relative inline-block ${t}`,children:[e,o.jsx("div",{ref:c,role:"tooltip",className:l,style:{...i(r),...g},children:n})]})},Q={primary:"bg-blue-500 text-white",secondary:"bg-gray-500 text-white",success:"bg-green-500 text-white",danger:"bg-red-500 text-white",warning:"bg-yellow-400 text-black",info:"bg-cyan-500 text-white",dark:"bg-black text-white",light:"bg-gray-100 text-gray-800",link:"bg-transparent text-blue-500 underline","outline-primary":"border border-blue-500 text-blue-500 bg-transparent","outline-secondary":"border border-gray-500 text-gray-500 bg-transparent","outline-success":"border border-green-500 text-green-500 bg-transparent","outline-danger":"border border-red-500 text-red-500 bg-transparent","outline-warning":"border border-yellow-400 text-yellow-500 bg-transparent","outline-info":"border border-cyan-500 text-cyan-500 bg-transparent","outline-dark":"border border-black text-black bg-transparent","outline-light":"border border-gray-100 text-gray-800 bg-transparent"},V={xs:"text-xs px-2 py-0.5",sm:"text-sm px-2.5 py-0.5",md:"text-base px-3 py-1",lg:"text-lg px-3.5 py-1.5",xl:"text-xl px-4 py-2"},R={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full p-2 w-8 h-8 justify-center"},ee=({label:e,variant:n="primary",size:r="sm",shape:t="rounded",icon:l,dismissible:g,onDismiss:b,className:c="",...i})=>{const d=!e&&!!l,f=`inline-flex items-center font-medium ${Q[n]||""} ${V[r]||""} ${R[t]||""} ${d?"justify-center p-2 w-8 h-8":""} `+c;return o.jsxs("span",{className:f.trim(),...i,children:[l&&o.jsx("span",{className:e?"mr-1":"",children:l}),e,g&&o.jsx("button",{type:"button",onClick:b,className:"ml-2 text-xs font-bold leading-none focus:outline-none",children:"×"})]})};var B={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},_=a.createContext&&a.createContext(B),te=["attr","size","title"];function re(e,n){if(e==null)return{};var r=ne(e,n),t,l;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(e);for(l=0;l<g.length;l++)t=g[l],!(n.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function ne(e,n){if(e==null)return{};var r={};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){if(n.indexOf(t)>=0)continue;r[t]=e[t]}return r}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},S.apply(this,arguments)}function F(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),r.push.apply(r,t)}return r}function N(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?F(Object(r),!0).forEach(function(t){oe(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function oe(e,n,r){return n=se(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function se(e){var n=ae(e,"string");return typeof n=="symbol"?n:n+""}function ae(e,n){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var t=r.call(e,n);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Z(e){return e&&e.map((n,r)=>a.createElement(n.tag,N({key:r},n.attr),Z(n.child)))}function W(e){return n=>a.createElement(le,S({attr:N({},e.attr)},n),Z(e.child))}function le(e){var n=r=>{var{attr:t,size:l,title:g}=e,b=re(e,te),c=l||r.size||"1em",i;return r.className&&(i=r.className),e.className&&(i=(i?i+" ":"")+e.className),a.createElement("svg",S({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,t,b,{className:i,style:N(N({color:e.color||r.color},r.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),g&&a.createElement("title",null,g),e.children)};return _!==void 0?a.createElement(_.Consumer,null,r=>n(r)):n(B)}function ie(e){return W({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)}const ce=({items:e,allowMultipleOpen:n=!1,className:r="",open:t,onChange:l,renderTitle:g,renderContent:b})=>{const[c,i]=a.useState(new Set),d=a.useMemo(()=>t?new Set(t):c,[t,c]),f=a.useCallback(s=>{const u=new Set(d);u.has(s)?u.delete(s):(n||u.clear(),u.add(s)),t&&l?l(Array.from(u)):i(u)},[d,t,l,n]);return o.jsx("div",{className:"accordion",role:"region","aria-multiselectable":n,children:e.map(s=>{const u=d.has(s.id),p=`accordion-heading-${s.id}`,h=`accordion-panel-${s.id}`;return o.jsxs("div",{className:`accordion-item mb-2 border rounded border-gray-300 dark:border-gray-700 ${r}`,children:[o.jsx("h3",{id:p,children:o.jsxs("button",{type:"button","aria-expanded":u,"aria-controls":h,onClick:()=>f(s.id),className:"flex justify-between items-center w-full p-2 font-medium text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3",children:[g?g(s,u):s.title,o.jsx(ie,{})]})}),o.jsx("div",{id:h,role:"region","aria-labelledby":p,hidden:!u,className:"p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",children:b?b(s,u):s.content})]},s.id)})})},G=a.createContext(null),P=()=>a.useContext(G),H=a.createContext(null),$=()=>a.useContext(H);function de({id:e,title:n,children:r,standalone:t=!1,showFloatingClose:l=!1,containerClasses:g="",onClose:b}){const c=$(),i=P(),d=!t&&!!c&&!!i,[f,s]=a.useState(!1),u=d?c.isOpen(e):f,p=d?c.getModalData(e):null,h=()=>{d?i.closeModal(e):s(!1),b==null||b()};return a.useEffect(()=>(u?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[u]),u?o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",children:o.jsxs("div",{className:`bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${g}`,children:[o.jsxs("div",{className:"flex justify-between items-center relative",children:[n&&o.jsx("h2",{className:"text-lg font-semibold",children:n}),l&&o.jsx("button",{onClick:h,className:"text-gray-500 hover:text-gray-700 absolute top-2 right-3","aria-label":"Close modal",children:"✕"})]}),o.jsx("div",{className:"mt-3 text-sm text-gray-700",children:typeof r=="function"?r({modalData:p}):r})]})}):null}function ue({children:e}){const[n,r]=a.useState({}),[t,l]=a.useState({}),g=a.useCallback((s,u)=>{r(p=>({...p,[s]:!0})),u&&l(p=>({...p,[s]:u}))},[]),b=a.useCallback(s=>{r(u=>({...u,[s]:!1})),l(u=>{const p={...u};return delete p[s],p})},[]),c=a.useCallback(s=>!!n[s],[n]),i=a.useCallback(s=>t[s],[t]),d=a.useMemo(()=>({openModal:g,closeModal:b}),[g,b]),f=a.useMemo(()=>({isOpen:c,getModalData:i}),[c,i]);return o.jsx(G.Provider,{value:d,children:o.jsx(H.Provider,{value:f,children:e})})}function fe(e){const{openModal:n,closeModal:r}=P(),{isOpen:t,getModalData:l}=$();return{open:g=>n(e,g),close:()=>r(e),isOpen:t(e),data:l(e)}}let I=null,T={};function ge(e){I=e}function be(e){T={...T,...e}}function pe(){return T}function xe(e,n,r=3e3,t){I?I(e,n,r,t):console.warn("Toast system is not mounted")}function he(e){return W({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)}const ye=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)}),me=()=>{const[e,n]=a.useState([]);a.useEffect(()=>{ge((t,l,g,b)=>{const c=ye();n(i=>[...i,{id:c,type:t,message:l,config:b}]),setTimeout(()=>{n(i=>i.filter(d=>d.id!==c))},g)})},[]);const r=pe();return o.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(t=>{var i,d,f,s,u,p,h,y,m,w,k,O,j;const l=((i=t.config)==null?void 0:i.icon)||((d=r.icons)==null?void 0:d[t.type])||we(t.type),g=((f=t.config)==null?void 0:f.bgColor)||((u=(s=r.colors)==null?void 0:s[t.type])==null?void 0:u.bg)||"bg-white dark:bg-gray-800",b=((p=t.config)==null?void 0:p.textColor)||((y=(h=r.colors)==null?void 0:h[t.type])==null?void 0:y.text)||"text-gray-700 dark:text-gray-300",c=((m=t.config)==null?void 0:m.iconContainerClass)||"w-8 h-8 mr-3 text-xl flex items-center justify-center";return o.jsxs("div",{className:`flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${g} ${b}`,children:[o.jsx("div",{className:c,children:l}),o.jsxs("div",{className:"flex-1 me-3",children:[((w=t.config)==null?void 0:w.title)&&o.jsx("div",{className:"font-semibold text-black",children:t.config.title}),((k=t.config)==null?void 0:k.description)&&o.jsx("div",{className:"text-sm text-gray-500",children:t.config.description}),!((O=t.config)!=null&&O.title)&&!((j=t.config)!=null&&j.description)&&o.jsx("div",{className:"text-sm",children:t.message})]}),o.jsx("button",{onClick:()=>n(L=>L.filter(E=>E.id!==t.id)),className:"ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white","aria-label":"Close",children:o.jsx(he,{size:18})})]},t.id)})})};function we(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}x.Accordion=ce,x.Badge=ee,x.Button=X,x.Dropdown=Y,x.Input=A,x.Modal=de,x.ModalProvider=ue,x.Toast=me,x.Tooltip=J,x.setToastDefaults=be,x.showToast=xe,x.useModalActions=P,x.useModalInstance=fe,x.useModalState=$,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(x,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],o):(x=typeof globalThis<"u"?globalThis:x||self,o(x.TailwindUiKit={},x.jsxRuntime,x.React))})(this,function(x,o,a){"use strict";"use client";const q=a.forwardRef((e,n)=>{const{label:t,id:r,inputSize:l="md",shape:p="rounded",validate:f,onValidatedChange:c,className:d="",icon:i,iconPosition:u="left",floatingLabelStyle:s,onChange:g,isValid:b,isInvalid:h,feedback:y,feedbackType:C="invalid",...N}=e,[O,L]=a.useState("default"),$=m=>{const v=m.target.value,S=(f==null?void 0:f(v))??"default";L(S),c==null||c(m,S),g==null||g(m)},E={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},k={flat:"rounded-none",rounded:"rounded-md",pill:"rounded-full"},I={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},B={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",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",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"},F=(m,v,S)=>{if(S)return"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";if(v)return"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";switch(m){case"error":return"border-red-500 bg-red-50 focus:ring-red-500";case"warning":return"border-yellow-500 bg-yellow-50 focus:ring-yellow-500";case"success":return"border-green-500 bg-green-50 focus:ring-green-500";default:return"border-gray-300 focus:ring-blue-500"}},Z=E[l]||E.md,G=k[p]||k.flat,H=F(O,b,h),U=u==="start"||u==="left"?"left-0 ps-3.5":"right-0 pe-3.5",W=i&&(u==="start"||u==="left")?"ps-10":i?"pe-10":"",j=r??`input-${(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"))||Math.random().toString(36).slice(2)}`,w=!!s;return o.jsxs("div",{className:`w-full relative ${w?"z-0":""}`,children:[!w&&t&&o.jsx("label",{htmlFor:j,className:`block mb-1 font-light text-sm ${b?"text-green-700 dark:text-green-500":h?"text-red-700 dark:text-red-500":"text-gray-700"}`,children:t}),o.jsxs("div",{className:"relative w-full",children:[i&&o.jsx("div",{className:`absolute inset-y-0 flex items-center ${U}`,children:o.jsx("span",{className:"text-gray-500",children:i})}),o.jsx("input",{...N,id:j,ref:n,placeholder:w?" ":N.placeholder,onChange:$,className:`border peer w-full block font-light appearance-none focus:outline-none focus:ring-0 transition text-[#798ba5] placeholder-[#798ba5] border-gray-400
|
|
2
|
+
${Z}
|
|
3
|
+
${w&&s&&I[s]}
|
|
4
|
+
${W} ${G} ${H} ${d}`}),w&&t&&s&&o.jsx("label",{htmlFor:j,className:`ms-1 ${B[s]} ${d}`,children:t})]}),y&&o.jsx("p",{className:`mt-1 text-xs ${C==="invalid"?"text-red-600 dark:text-red-500":"text-green-600 dark:text-green-500"}`,children:y})]})});q.displayName="Input";const K=a.forwardRef((e,n)=>{const{label:t,id:r,inputSize:l="md",shape:p="rounded",validate:f,onValidatedChange:c,className:d="",icon:i,iconPosition:u="left",floatingLabelStyle:s,onChange:g,isValid:b,isInvalid:h,feedback:y,feedbackType:C="invalid",children:N,...O}=e,[L,$]=a.useState("default"),E=v=>{const S=v.target.value,T=(f==null?void 0:f(S))??"default";$(T),c==null||c(v,T),g==null||g(v)},k={xs:"text-xs px-2 py-1",sm:"text-sm px-3 py-1.5",md:"text-sm px-3 py-3",lg:"text-lg px-5 py-3"},I={flat:"rounded-none",rounded:"rounded-md",pill:"rounded-full"},B={filled:"rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",outlined:"rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",standard:"px-0 py-2.5 bg-transparent border-0 border-b-2"},F={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",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",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"},Z=(v,S,T)=>{if(T)return"border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";if(S)return"border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";switch(v){case"error":return"border-red-500 bg-red-50 focus:ring-red-500";case"warning":return"border-yellow-500 bg-yellow-50 focus:ring-yellow-500";case"success":return"border-green-500 bg-green-50 focus:ring-green-500";default:return"border-gray-300 focus:ring-blue-500"}},G=k[l]||k.md,H=I[p]||I.flat,U=Z(L,b,h),W=u==="start"||u==="left"?"left-0 ps-3.5":"right-0 pe-3.5",j=i&&(u==="start"||u==="left")?"ps-10":i?"pe-10":"",w=r??`select-${(t==null?void 0:t.toLowerCase().replace(/\s+/g,"-"))||Math.random().toString(36).slice(2)}`,m=!!s;return o.jsxs("div",{className:`w-full relative ${m?"z-0":""}`,children:[!m&&t&&o.jsx("label",{htmlFor:w,className:`block mb-1 font-light text-sm ${b?"text-green-700":h?"text-red-700":"text-gray-700"}`,children:t}),o.jsxs("div",{className:"relative w-full",children:[i&&o.jsx("div",{className:`absolute inset-y-0 flex items-center ${W}`,children:o.jsx("span",{className:"text-gray-500",children:i})}),o.jsx("select",{...O,id:w,ref:n,onChange:E,className:`border peer w-full block font-light appearance-none focus:outline-none focus:ring-0 transition text-[#798ba5] placeholder-[#798ba5] border-gray-400
|
|
5
|
+
${G}
|
|
6
|
+
${m&&s&&B[s]}
|
|
7
|
+
${j} ${H} ${U} ${d}`,children:N}),m&&t&&s&&o.jsx("label",{htmlFor:w,className:`ms-1 ${F[s]} ${d}`,children:t})]}),y&&o.jsx("p",{className:`mt-1 text-xs ${C==="invalid"?"text-red-600":"text-green-600"}`,children:y})]})});K.displayName="Select";const te={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-600 text-white hover:bg-gray-700",success:"bg-green-600 text-white hover:bg-green-700",danger:"bg-red-600 text-white hover:bg-red-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-cyan-600 text-white hover:bg-cyan-700",dark:"bg-gray-900 text-white hover:bg-black",light:"bg-gray-100 text-black hover:bg-gray-200",link:"bg-transparent text-blue-600 hover:underline [&&]:p-0 [&&]:shadow-none","outline-primary":"border border-blue-600 text-blue-600 hover:bg-blue-50","outline-secondary":"border border-gray-600 text-gray-600 hover:bg-gray-50","outline-success":"border border-green-600 text-green-600 hover:bg-green-50","outline-danger":"border border-red-600 text-red-600 hover:bg-red-50","outline-warning":"border border-yellow-500 text-yellow-600 hover:bg-yellow-50","outline-info":"border border-cyan-600 text-cyan-600 hover:bg-cyan-50","outline-dark":"border border-gray-900 text-gray-900 hover:bg-gray-100","outline-light":"border border-gray-100 text-gray-500 hover:bg-gray-200"},re={xs:"px-3 py-2 text-xs",sm:"px-3 py-2 text-sm",md:"px-5 py-2.5 text-sm",lg:"px-5 py-3 text-base",xl:"px-6 py-3.5 text-base"},ne={flat:"shadow-none",rounded:"rounded-md",pill:"rounded-full",circle:"rounded-full w-10 h-10 p-0 flex items-center justify-center"},oe=({children:e,variant:n="primary",size:t="md",type:r="button",shape:l="rounded",className:p="",isLoading:f=!1,disabled:c=!1,...d})=>{const i=c||f,u=["inline-flex items-center justify-center font-normal transition duration-150 cursor-pointer",te[n],re[t],ne[l],l==="flat"?"shadow-none":"shadow-sm",i?"opacity-50 cursor-not-allowed pointer-events-none":"",p].filter(Boolean).join(" ");return o.jsxs("button",{type:r,className:u,disabled:i,...d,children:[f&&o.jsxs("svg",{"aria-hidden":"true",role:"status",className:"inline w-4 h-4 me-3 text-gray-200 animate-spin dark:text-gray-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{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",fill:"currentColor"}),o.jsx("path",{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",fill:"#1C64F2"})]}),e]})},se=({label:e,children:n,position:t="right"})=>{const[r,l]=a.useState(!1),[p,f]=a.useState(!1),c=a.useRef(null),d=a.useRef(null),i=a.useMemo(()=>{switch(t){case"left":return"left-0";case"center":return"left-1/2 transform -translate-x-1/2";case"right":default:return"right-0"}},[t]),u=a.useCallback(b=>{const h=b.target;c.current&&!c.current.contains(h)&&d.current&&!d.current.contains(h)&&l(!1)},[]),s=a.useCallback(()=>{if(!d.current||!c.current)return;const b=d.current.getBoundingClientRect(),h=c.current.getBoundingClientRect(),y=window.innerHeight-b.bottom,C=b.top;f(y<h.height&&C>h.height)},[]);a.useEffect(()=>{if(r)return s(),window.addEventListener("resize",s),window.addEventListener("scroll",s,!0),()=>{window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0)}},[r,s]),a.useEffect(()=>(document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)),[u]);const g=a.useCallback(()=>l(b=>!b),[]);return o.jsxs("div",{className:"relative flex items-center",children:[o.jsx("button",{ref:d,onClick:g,children:e}),r&&o.jsx("div",{ref:c,className:`absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
|
|
8
|
+
${p?"bottom-full mb-2":"top-full mt-2"}
|
|
9
|
+
${i}`,children:n})]})},ae=({children:e,content:n,position:t="top",className:r="",tooltipClass:l="",tooltipStyle:p={}})=>{const f=a.useRef(null),c=a.useRef(null);a.useEffect(()=>{const i=f.current,u=c.current;if(!i||!u)return;const s=()=>{u.style.opacity="1",u.style.visibility="visible"},g=()=>{u.style.opacity="0",u.style.visibility="hidden"};return i.addEventListener("mouseenter",s),i.addEventListener("mouseleave",g),()=>{i.removeEventListener("mouseenter",s),i.removeEventListener("mouseleave",g)}},[]);const d=i=>{const u={position:"absolute",opacity:0,visibility:"hidden",transition:"opacity 0.2s ease",maxWidth:"240px",whiteSpace:"normal",wordBreak:"break-word",padding:"8px 12px",fontSize:"0.875rem",backgroundColor:"black",color:"white",borderRadius:"4px",boxShadow:"0px 4px 12px rgba(0, 0, 0, 0.15)",zIndex:9999,width:"max-content"};switch(i){case"top":return{...u,bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};case"bottom":return{...u,top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"left":return{...u,right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"right":return{...u,left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};default:return u}};return o.jsxs("div",{ref:f,className:`relative inline-block ${r}`,children:[e,o.jsx("div",{ref:c,role:"tooltip",className:l,style:{...d(t),...p},children:n})]})},le={primary:"bg-blue-500 text-white",secondary:"bg-gray-500 text-white",success:"bg-green-500 text-white",danger:"bg-red-500 text-white",warning:"bg-yellow-400 text-black",info:"bg-cyan-500 text-white",dark:"bg-black text-white",light:"bg-gray-100 text-gray-800",link:"bg-transparent text-blue-500 underline","outline-primary":"border border-blue-500 text-blue-500 bg-transparent","outline-secondary":"border border-gray-500 text-gray-500 bg-transparent","outline-success":"border border-green-500 text-green-500 bg-transparent","outline-danger":"border border-red-500 text-red-500 bg-transparent","outline-warning":"border border-yellow-400 text-yellow-500 bg-transparent","outline-info":"border border-cyan-500 text-cyan-500 bg-transparent","outline-dark":"border border-black text-black bg-transparent","outline-light":"border border-gray-100 text-gray-800 bg-transparent"},ie={xs:"text-xs px-2 py-0.5",sm:"text-sm px-2.5 py-0.5",md:"text-base px-3 py-1",lg:"text-lg px-3.5 py-1.5",xl:"text-xl px-4 py-2"},ce={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full p-2 w-8 h-8 justify-center"},de=({label:e,variant:n="primary",size:t="sm",shape:r="rounded",icon:l,dismissible:p,onDismiss:f,className:c="",...d})=>{const i=!e&&!!l,u=`inline-flex items-center font-medium ${le[n]||""} ${ie[t]||""} ${ce[r]||""} ${i?"justify-center p-2 w-8 h-8":""} `+c;return o.jsxs("span",{className:u.trim(),...d,children:[l&&o.jsx("span",{className:e?"mr-1":"",children:l}),e,p&&o.jsx("button",{type:"button",onClick:f,className:"ml-2 text-xs font-bold leading-none focus:outline-none",children:"×"})]})};var X={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Y=a.createContext&&a.createContext(X),ue=["attr","size","title"];function ge(e,n){if(e==null)return{};var t=fe(e,n),r,l;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);for(l=0;l<p.length;l++)r=p[l],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function fe(e,n){if(e==null)return{};var t={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}function P(){return P=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},P.apply(this,arguments)}function J(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),t.push.apply(t,r)}return t}function M(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?J(Object(t),!0).forEach(function(r){pe(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):J(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function pe(e,n,t){return n=be(n),n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function be(e){var n=xe(e,"string");return typeof n=="symbol"?n:n+""}function xe(e,n){if(typeof e!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var r=t.call(e,n);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Q(e){return e&&e.map((n,t)=>a.createElement(n.tag,M({key:t},n.attr),Q(n.child)))}function V(e){return n=>a.createElement(he,P({attr:M({},e.attr)},n),Q(e.child))}function he(e){var n=t=>{var{attr:r,size:l,title:p}=e,f=ge(e,ue),c=l||t.size||"1em",d;return t.className&&(d=t.className),e.className&&(d=(d?d+" ":"")+e.className),a.createElement("svg",P({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,f,{className:d,style:M(M({color:e.color||t.color},t.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),p&&a.createElement("title",null,p),e.children)};return Y!==void 0?a.createElement(Y.Consumer,null,t=>n(t)):n(X)}function ye(e){return V({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)}const me=({items:e,allowMultipleOpen:n=!1,className:t="",open:r,onChange:l,renderTitle:p,renderContent:f})=>{const[c,d]=a.useState(new Set),i=a.useMemo(()=>r?new Set(r):c,[r,c]),u=a.useCallback(s=>{const g=new Set(i);g.has(s)?g.delete(s):(n||g.clear(),g.add(s)),r&&l?l(Array.from(g)):d(g)},[i,r,l,n]);return o.jsx("div",{className:"accordion",role:"region","aria-multiselectable":n,children:e.map(s=>{const g=i.has(s.id),b=`accordion-heading-${s.id}`,h=`accordion-panel-${s.id}`;return o.jsxs("div",{className:`accordion-item mb-2 border rounded border-gray-300 dark:border-gray-700 ${t}`,children:[o.jsx("h3",{id:b,children:o.jsxs("button",{type:"button","aria-expanded":g,"aria-controls":h,onClick:()=>u(s.id),className:"flex justify-between items-center w-full p-2 font-medium text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none gap-3",children:[p?p(s,g):s.title,o.jsx(ye,{})]})}),o.jsx("div",{id:h,role:"region","aria-labelledby":b,hidden:!g,className:"p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",children:f?f(s,g):s.content})]},s.id)})})},R=a.createContext(null),z=()=>a.useContext(R),ee=a.createContext(null),A=()=>a.useContext(ee);function we({id:e,title:n,children:t,standalone:r=!1,showFloatingClose:l=!1,containerClasses:p="",onClose:f}){const c=A(),d=z(),i=!r&&!!c&&!!d,[u,s]=a.useState(!1),g=i?c.isOpen(e):u,b=i?c.getModalData(e):null,h=()=>{i?d.closeModal(e):s(!1),f==null||f()};return a.useEffect(()=>(g?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[g]),g?o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",children:o.jsxs("div",{className:`bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${p}`,children:[o.jsxs("div",{className:"flex justify-between items-center relative",children:[n&&o.jsx("h2",{className:"text-lg font-semibold",children:n}),l&&o.jsx("button",{onClick:h,className:"text-gray-500 hover:text-gray-700 absolute top-2 right-3","aria-label":"Close modal",children:"✕"})]}),o.jsx("div",{className:"mt-3 text-sm text-gray-700",children:typeof t=="function"?t({modalData:b}):t})]})}):null}function ve({children:e}){const[n,t]=a.useState({}),[r,l]=a.useState({}),p=a.useCallback((s,g)=>{t(b=>({...b,[s]:!0})),g&&l(b=>({...b,[s]:g}))},[]),f=a.useCallback(s=>{t(g=>({...g,[s]:!1})),l(g=>{const b={...g};return delete b[s],b})},[]),c=a.useCallback(s=>!!n[s],[n]),d=a.useCallback(s=>r[s],[r]),i=a.useMemo(()=>({openModal:p,closeModal:f}),[p,f]),u=a.useMemo(()=>({isOpen:c,getModalData:d}),[c,d]);return o.jsx(R.Provider,{value:i,children:o.jsx(ee.Provider,{value:u,children:e})})}function Ce(e){const{openModal:n,closeModal:t}=z(),{isOpen:r,getModalData:l}=A();return{open:p=>n(e,p),close:()=>t(e),isOpen:r(e),data:l(e)}}let D=null,_={};function Se(e){D=e}function Ne(e){_={..._,...e}}function ke(){return _}function Oe(e,n,t=3e3,r){D?D(e,n,t,r):console.warn("Toast system is not mounted")}function Le(e){return V({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)}const $e=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)}),Ee=()=>{const[e,n]=a.useState([]);a.useEffect(()=>{Se((r,l,p,f)=>{const c=$e();n(d=>[...d,{id:c,type:r,message:l,config:f}]),setTimeout(()=>{n(d=>d.filter(i=>i.id!==c))},p)})},[]);const t=ke();return o.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(r=>{var d,i,u,s,g,b,h,y,C,N,O,L,$;const l=((d=r.config)==null?void 0:d.icon)||((i=t.icons)==null?void 0:i[r.type])||je(r.type),p=((u=r.config)==null?void 0:u.bgColor)||((g=(s=t.colors)==null?void 0:s[r.type])==null?void 0:g.bg)||"bg-white dark:bg-gray-800",f=((b=r.config)==null?void 0:b.textColor)||((y=(h=t.colors)==null?void 0:h[r.type])==null?void 0:y.text)||"text-gray-700 dark:text-gray-300",c=((C=r.config)==null?void 0:C.iconContainerClass)||"w-8 h-8 mr-3 text-xl flex items-center justify-center";return o.jsxs("div",{className:`flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${p} ${f}`,children:[o.jsx("div",{className:c,children:l}),o.jsxs("div",{className:"flex-1 me-3",children:[((N=r.config)==null?void 0:N.title)&&o.jsx("div",{className:"font-semibold text-black",children:r.config.title}),((O=r.config)==null?void 0:O.description)&&o.jsx("div",{className:"text-sm text-gray-500",children:r.config.description}),!((L=r.config)!=null&&L.title)&&!(($=r.config)!=null&&$.description)&&o.jsx("div",{className:"text-sm",children:r.message})]}),o.jsx("button",{onClick:()=>n(E=>E.filter(k=>k.id!==r.id)),className:"ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white","aria-label":"Close",children:o.jsx(Le,{size:18})})]},r.id)})})};function je(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}x.Accordion=me,x.Badge=de,x.Button=oe,x.Dropdown=se,x.Input=q,x.Modal=we,x.ModalProvider=ve,x.Select=K,x.Toast=Ee,x.Tooltip=ae,x.setToastDefaults=Ne,x.showToast=Oe,x.useModalActions=z,x.useModalInstance=Ce,x.useModalState=A,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|