tailwind-ux-kit 1.0.43 → 1.0.45
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.
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React, ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
type Variant = "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "dark" | "light" | "link" | "outline-primary" | "outline-secondary" | "outline-success" | "outline-danger" | "outline-warning" | "outline-info" | "outline-dark" | "outline-light" | "soft-primary" | "soft-secondary" | "soft-success" | "soft-danger" | "soft-warning" | "soft-info" | "soft-dark" | "soft-light";
|
|
3
|
+
type Size = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
type Shape = "flat" | "rounded" | "pill" | "circle";
|
|
5
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
variant?: Variant;
|
|
8
|
+
size?: Size;
|
|
9
|
+
shape?: Shape;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const Button: React.FC<ButtonProps>;
|
|
14
|
+
export default Button;
|
|
@@ -5,7 +5,7 @@ type Status = "default" | "error" | "warning" | "success";
|
|
|
5
5
|
type FloatingLabelStyle = "filled" | "outlined" | "standard";
|
|
6
6
|
type IconPosition = "start" | "end" | "left" | "right";
|
|
7
7
|
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "size" | "onChange"> {
|
|
8
|
-
label?: string;
|
|
8
|
+
label?: string | React.ReactNode;
|
|
9
9
|
id?: string;
|
|
10
10
|
inputSize?: InputSize;
|
|
11
11
|
shape?: Shape;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as Input } from './components/Input';
|
|
2
2
|
export { default as Select } from './components/Select';
|
|
3
|
-
export { default as Button } from './components/Button';
|
|
3
|
+
export { default as Button } from './components/Button/Button';
|
|
4
4
|
export { default as Dropdown } from './components/Dropdown';
|
|
5
5
|
export { default as Tooltip } from './components/ToolTip';
|
|
6
6
|
export { default as Badge } from './components/Badge';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tailwindcss v4.1.10 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}.btn-primary{background-color:var(--color-blue-600,oklch(54.6% .245 262.881));color:var(--color-white,#fff)}@media (hover:hover){.btn-primary:hover{background-color:var(--color-blue-700,oklch(48.8% .243 264.376))}}.btn-outline-primary{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-blue-600,oklch(54.6% .245 262.881));color:var(--color-blue-600,oklch(54.6% .245 262.881))}@media (hover:hover){.btn-outline-primary:hover{background-color:var(--color-blue-50,oklch(97% .014 254.604))}}.btn-soft-primary{background-color:var(--color-blue-100,oklch(93.2% .032 255.585));color:var(--color-blue-700,oklch(48.8% .243 264.376))}@media (hover:hover){.btn-soft-primary:hover{background-color:var(--color-blue-200,oklch(88.2% .059 254.128))}}.btn-secondary{background-color:var(--color-gray-600,oklch(44.6% .03 256.802));color:var(--color-white,#fff)}@media (hover:hover){.btn-secondary:hover{background-color:var(--color-gray-700,oklch(37.3% .034 259.733))}}.btn-outline-secondary{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-gray-600,oklch(44.6% .03 256.802));color:var(--color-gray-600,oklch(44.6% .03 256.802))}@media (hover:hover){.btn-outline-secondary:hover{background-color:var(--color-gray-50,oklch(98.5% .002 247.839))}}.btn-soft-secondary{background-color:var(--color-gray-100,oklch(96.7% .003 264.542));color:var(--color-gray-700,oklch(37.3% .034 259.733))}@media (hover:hover){.btn-soft-secondary:hover{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}}.btn-danger{background-color:var(--color-red-600,oklch(57.7% .245 27.325));color:var(--color-white,#fff)}@media (hover:hover){.btn-danger:hover{background-color:var(--color-red-700,oklch(50.5% .213 27.518))}}.btn-outline-danger{border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-red-600,oklch(57.7% .245 27.325));color:var(--color-red-600,oklch(57.7% .245 27.325))}@media (hover:hover){.btn-outline-danger:hover{background-color:var(--color-red-50,oklch(97.1% .013 17.38))}}.btn-soft-danger{background-color:var(--color-red-100,oklch(93.6% .032 17.717));color:var(--color-red-700,oklch(50.5% .213 27.518))}@media (hover:hover){.btn-soft-danger:hover{background-color:var(--color-red-200,oklch(88.5% .062 18.334))}}.btn-link{padding:calc(var(--spacing,.25rem)*0);color:var(--color-blue-600,oklch(54.6% .245 262.881));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000}@media (hover:hover){.btn-link:hover{text-decoration-line:underline}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as h, jsx as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
2
|
+
import { jsxs as h, jsx as p } from "react/jsx-runtime";
|
|
3
|
+
import P, { forwardRef as q, useState as L, useMemo as $, useId as se, useRef as M, useCallback as E, useEffect as A, createContext as X, useContext as Y } from "react";
|
|
4
|
+
const H = {
|
|
5
5
|
xs: "text-xs px-2 py-1",
|
|
6
6
|
sm: "text-sm px-3 py-1.5",
|
|
7
7
|
md: "text-sm px-3 py-3",
|
|
8
8
|
lg: "text-lg px-5 py-3"
|
|
9
|
-
},
|
|
9
|
+
}, W = {
|
|
10
10
|
flat: "rounded-none",
|
|
11
11
|
rounded: "rounded-sm",
|
|
12
12
|
pill: "rounded-full"
|
|
13
|
-
},
|
|
13
|
+
}, ae = {
|
|
14
14
|
filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
|
|
15
15
|
outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
|
|
16
16
|
standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
|
|
17
|
-
},
|
|
17
|
+
}, le = {
|
|
18
18
|
filled: "absolute duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] start-2.5 peer-placeholder-shown:translate-y-0 peer-placeholder-shown:scale-100 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",
|
|
19
19
|
outlined: "absolute duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-placeholder-shown:scale-100 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-blue-600",
|
|
20
20
|
standard: "absolute duration-300 transform -translate-y-6 scale-75 top-3 origin-[0] peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6 peer-focus:text-blue-600"
|
|
21
|
-
},
|
|
21
|
+
}, ie = (e, n, t) => {
|
|
22
22
|
if (t)
|
|
23
23
|
return "border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";
|
|
24
24
|
if (n)
|
|
@@ -33,13 +33,13 @@ const q = {
|
|
|
33
33
|
default:
|
|
34
34
|
return "border-gray-300 focus:ring-blue-500";
|
|
35
35
|
}
|
|
36
|
-
},
|
|
36
|
+
}, ce = q((e, n) => {
|
|
37
37
|
const {
|
|
38
38
|
label: t,
|
|
39
39
|
id: r,
|
|
40
40
|
inputSize: s = "md",
|
|
41
|
-
shape:
|
|
42
|
-
validate:
|
|
41
|
+
shape: g = "rounded",
|
|
42
|
+
validate: f,
|
|
43
43
|
onValidatedChange: c,
|
|
44
44
|
className: a = "",
|
|
45
45
|
icon: u,
|
|
@@ -47,79 +47,112 @@ const q = {
|
|
|
47
47
|
floatingLabelStyle: d,
|
|
48
48
|
onChange: l,
|
|
49
49
|
isValid: i,
|
|
50
|
-
isInvalid:
|
|
51
|
-
feedback:
|
|
50
|
+
isInvalid: m,
|
|
51
|
+
feedback: x,
|
|
52
52
|
feedbackType: y = "invalid",
|
|
53
53
|
...w
|
|
54
|
-
} = e, [S, N] =
|
|
55
|
-
(
|
|
56
|
-
const
|
|
57
|
-
N(
|
|
54
|
+
} = e, [S, N] = L("default"), O = P.useCallback(
|
|
55
|
+
(z) => {
|
|
56
|
+
const Z = z.target.value, I = (f == null ? void 0 : f(Z)) ?? "default";
|
|
57
|
+
N(I), c == null || c(z, I), l == null || l(z);
|
|
58
58
|
},
|
|
59
|
-
[
|
|
60
|
-
),
|
|
61
|
-
() =>
|
|
62
|
-
[S, i,
|
|
63
|
-
),
|
|
59
|
+
[f, c, l]
|
|
60
|
+
), v = $(() => r || (typeof t == "string" ? `input-${t.toLowerCase().replace(/\s+/g, "-")}` : `input-${Math.random().toString(36).slice(2)}`), [r, t]), b = !!d, C = H[s] || H.md, k = W[g] || W.flat, j = $(
|
|
61
|
+
() => ie(S, i, m),
|
|
62
|
+
[S, i, m]
|
|
63
|
+
), _ = $(() => o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", [o]), B = $(() => u ? o === "start" || o === "left" ? "ps-10" : "pe-10" : "", [u, o]);
|
|
64
64
|
return /* @__PURE__ */ h("div", { className: `w-full relative ${b ? "z-0" : ""}`, children: [
|
|
65
|
-
!b && t && /* @__PURE__ */
|
|
65
|
+
!b && t && /* @__PURE__ */ p(
|
|
66
66
|
"label",
|
|
67
67
|
{
|
|
68
|
-
htmlFor:
|
|
69
|
-
className: `block mb-1 text-sm ${i ? "text-green-700 dark:text-green-500" :
|
|
68
|
+
htmlFor: v,
|
|
69
|
+
className: `block mb-1 text-sm ${i ? "text-green-700 dark:text-green-500" : m ? "text-red-700 dark:text-red-500" : "text-gray-700"}`,
|
|
70
70
|
children: t
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
73
|
/* @__PURE__ */ h("div", { className: "relative w-full", children: [
|
|
74
|
-
u && /* @__PURE__ */
|
|
74
|
+
u && /* @__PURE__ */ p(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
|
-
className: `absolute inset-y-0 flex items-center ${
|
|
77
|
+
className: `absolute inset-y-0 flex items-center ${_}`,
|
|
78
78
|
"aria-hidden": "true",
|
|
79
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ p("span", { className: "text-gray-500", children: u })
|
|
80
80
|
}
|
|
81
81
|
),
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ p(
|
|
83
83
|
"input",
|
|
84
84
|
{
|
|
85
85
|
...w,
|
|
86
|
-
id:
|
|
86
|
+
id: v,
|
|
87
87
|
ref: n,
|
|
88
88
|
placeholder: b ? " " : w.placeholder,
|
|
89
|
-
onChange:
|
|
89
|
+
onChange: O,
|
|
90
90
|
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
|
|
91
|
-
${
|
|
92
|
-
${b && d &&
|
|
93
|
-
${
|
|
91
|
+
${C}
|
|
92
|
+
${b && d && ae[d]}
|
|
93
|
+
${B} ${k} ${j} ${a}`
|
|
94
94
|
}
|
|
95
95
|
),
|
|
96
|
-
b && t && d && /* @__PURE__ */
|
|
96
|
+
b && t && d && /* @__PURE__ */ p(
|
|
97
97
|
"label",
|
|
98
98
|
{
|
|
99
|
-
htmlFor:
|
|
100
|
-
className: `ms-1 ${
|
|
99
|
+
htmlFor: v,
|
|
100
|
+
className: `ms-1 ${le[d]} ${a}`,
|
|
101
101
|
children: t
|
|
102
102
|
}
|
|
103
103
|
)
|
|
104
104
|
] }),
|
|
105
|
-
|
|
105
|
+
x && /* @__PURE__ */ p(
|
|
106
106
|
"p",
|
|
107
107
|
{
|
|
108
108
|
className: `mt-1 text-xs ${y === "invalid" ? "text-red-600 dark:text-red-500" : "text-green-600 dark:text-green-500"}`,
|
|
109
109
|
role: y === "invalid" ? "alert" : void 0,
|
|
110
|
-
children:
|
|
110
|
+
children: x
|
|
111
111
|
}
|
|
112
112
|
)
|
|
113
113
|
] });
|
|
114
114
|
});
|
|
115
|
-
|
|
116
|
-
const
|
|
115
|
+
ce.displayName = "Input";
|
|
116
|
+
const de = {
|
|
117
|
+
xs: "text-xs px-2 py-1",
|
|
118
|
+
sm: "text-sm px-3 py-1.5",
|
|
119
|
+
md: "text-sm px-3 py-3",
|
|
120
|
+
lg: "text-lg px-5 py-3"
|
|
121
|
+
}, ue = {
|
|
122
|
+
flat: "rounded-none",
|
|
123
|
+
rounded: "rounded-sm",
|
|
124
|
+
pill: "rounded-full"
|
|
125
|
+
}, fe = {
|
|
126
|
+
filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
|
|
127
|
+
outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
|
|
128
|
+
standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
|
|
129
|
+
}, pe = {
|
|
130
|
+
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",
|
|
131
|
+
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",
|
|
132
|
+
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"
|
|
133
|
+
}, ge = (e, n, t) => {
|
|
134
|
+
if (t)
|
|
135
|
+
return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
|
|
136
|
+
if (n)
|
|
137
|
+
return "border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";
|
|
138
|
+
const r = "focus:ring focus:border";
|
|
139
|
+
switch (e) {
|
|
140
|
+
case "error":
|
|
141
|
+
return `${r}-red-500 border-red-500 bg-red-50`;
|
|
142
|
+
case "warning":
|
|
143
|
+
return `${r}-yellow-500 border-yellow-500 bg-yellow-50`;
|
|
144
|
+
case "success":
|
|
145
|
+
return `${r}-green-500 border-green-500 bg-green-50`;
|
|
146
|
+
default:
|
|
147
|
+
return "border-gray-300 focus:ring-blue-500";
|
|
148
|
+
}
|
|
149
|
+
}, be = q((e, n) => {
|
|
117
150
|
const {
|
|
118
151
|
label: t,
|
|
119
152
|
id: r,
|
|
120
153
|
inputSize: s = "md",
|
|
121
|
-
shape:
|
|
122
|
-
validate:
|
|
154
|
+
shape: g = "rounded",
|
|
155
|
+
validate: f,
|
|
123
156
|
onValidatedChange: c,
|
|
124
157
|
className: a = "",
|
|
125
158
|
icon: u,
|
|
@@ -127,148 +160,124 @@ const fe = Q((e, n) => {
|
|
|
127
160
|
floatingLabelStyle: d,
|
|
128
161
|
onChange: l,
|
|
129
162
|
isValid: i,
|
|
130
|
-
isInvalid:
|
|
131
|
-
feedback:
|
|
163
|
+
isInvalid: m,
|
|
164
|
+
feedback: x,
|
|
132
165
|
feedbackType: y = "invalid",
|
|
133
166
|
children: w,
|
|
134
167
|
...S
|
|
135
|
-
} = e, [N,
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
md: "text-sm px-3 py-3",
|
|
142
|
-
lg: "text-lg px-5 py-3"
|
|
143
|
-
}, v = {
|
|
144
|
-
flat: "rounded-none",
|
|
145
|
-
rounded: "rounded-sm",
|
|
146
|
-
pill: "rounded-full"
|
|
147
|
-
}, P = {
|
|
148
|
-
filled: "rounded-t-lg px-2.5 pb-2.5 pt-5 bg-gray-50 border-b-2",
|
|
149
|
-
outlined: "rounded-lg px-2.5 pb-2.5 pt-4 bg-transparent border",
|
|
150
|
-
standard: "px-0 py-2.5 bg-transparent border-0 border-b-2"
|
|
151
|
-
}, j = {
|
|
152
|
-
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",
|
|
153
|
-
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",
|
|
154
|
-
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"
|
|
155
|
-
}, F = (A, W, T) => {
|
|
156
|
-
if (T)
|
|
157
|
-
return "border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";
|
|
158
|
-
if (W)
|
|
159
|
-
return "border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";
|
|
160
|
-
switch (A) {
|
|
161
|
-
case "error":
|
|
162
|
-
return "border-red-500 bg-red-50 focus:ring-red-500";
|
|
163
|
-
case "warning":
|
|
164
|
-
return "border-yellow-500 bg-yellow-50 focus:ring-yellow-500";
|
|
165
|
-
case "success":
|
|
166
|
-
return "border-green-500 bg-green-50 focus:ring-green-500";
|
|
167
|
-
default:
|
|
168
|
-
return "border-gray-300 focus:ring-blue-500";
|
|
169
|
-
}
|
|
170
|
-
}, Z = b[s] || b.md, I = v[p] || v.flat, G = F(N, i, x), M = o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5", ie = u && (o === "start" || o === "left") ? "ps-10" : u ? "pe-10" : "", H = r ?? `select-${(t == null ? void 0 : t.toLowerCase().replace(/\s+/g, "-")) || Math.random().toString(36).slice(2)}`, D = !!d;
|
|
171
|
-
return /* @__PURE__ */ h("div", { className: `w-full relative ${D ? "z-0" : ""}`, children: [
|
|
172
|
-
!D && t && /* @__PURE__ */ f(
|
|
168
|
+
} = e, [N, O] = L("default"), v = se(), b = $(() => r || (typeof t == "string" ? `select-${t.toLowerCase().replace(/\s+/g, "-")}` : v), [r, t, v]), C = (I) => {
|
|
169
|
+
const oe = I.target.value, G = (f == null ? void 0 : f(oe)) ?? "default";
|
|
170
|
+
O(G), c == null || c(I, G), l == null || l(I);
|
|
171
|
+
}, k = !!d, j = de[s], _ = ue[g], B = ge(N, i, m);
|
|
172
|
+
return /* @__PURE__ */ h("div", { className: `w-full relative ${k ? "z-0" : ""}`, children: [
|
|
173
|
+
!k && t && /* @__PURE__ */ p(
|
|
173
174
|
"label",
|
|
174
175
|
{
|
|
175
|
-
htmlFor:
|
|
176
|
-
className: `block mb-1 text-sm ${i ? "text-green-700" :
|
|
176
|
+
htmlFor: b,
|
|
177
|
+
className: `block mb-1 text-sm ${i ? "text-green-700" : m ? "text-red-700" : "text-gray-700"}`,
|
|
177
178
|
children: t
|
|
178
179
|
}
|
|
179
180
|
),
|
|
180
181
|
/* @__PURE__ */ h("div", { className: "relative w-full", children: [
|
|
181
|
-
u && /* @__PURE__ */
|
|
182
|
+
u && /* @__PURE__ */ p(
|
|
182
183
|
"div",
|
|
183
184
|
{
|
|
184
|
-
className: `absolute inset-y-0 flex items-center ${
|
|
185
|
-
children: /* @__PURE__ */
|
|
185
|
+
className: `absolute inset-y-0 flex items-center ${o === "start" || o === "left" ? "left-0 ps-3.5" : "right-0 pe-3.5"}`,
|
|
186
|
+
children: /* @__PURE__ */ p("span", { className: "text-gray-500", children: u })
|
|
186
187
|
}
|
|
187
188
|
),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ p(
|
|
189
190
|
"select",
|
|
190
191
|
{
|
|
191
192
|
...S,
|
|
192
|
-
id:
|
|
193
|
+
id: b,
|
|
193
194
|
ref: n,
|
|
194
195
|
onChange: C,
|
|
195
196
|
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
|
|
196
|
-
|
|
197
|
-
${
|
|
198
|
-
${
|
|
197
|
+
${j} ${u && (o === "start" || o === "left") ? "ps-10" : u ? "pe-10" : ""}
|
|
198
|
+
${k && d && fe[d]}
|
|
199
|
+
${_} ${B} ${a}`,
|
|
199
200
|
children: w
|
|
200
201
|
}
|
|
201
202
|
),
|
|
202
|
-
|
|
203
|
+
k && t && d && /* @__PURE__ */ p(
|
|
203
204
|
"label",
|
|
204
205
|
{
|
|
205
|
-
htmlFor:
|
|
206
|
-
className: `ms-1 ${
|
|
206
|
+
htmlFor: b,
|
|
207
|
+
className: `ms-1 ${pe[d]} ${a}`,
|
|
207
208
|
children: t
|
|
208
209
|
}
|
|
209
210
|
)
|
|
210
211
|
] }),
|
|
211
|
-
|
|
212
|
+
x && /* @__PURE__ */ p(
|
|
212
213
|
"p",
|
|
213
214
|
{
|
|
214
215
|
className: `mt-1 text-xs ${y === "invalid" ? "text-red-600" : "text-green-600"}`,
|
|
215
|
-
children:
|
|
216
|
+
children: x
|
|
216
217
|
}
|
|
217
218
|
)
|
|
218
219
|
] });
|
|
219
220
|
});
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
primary: "
|
|
223
|
-
secondary: "
|
|
224
|
-
success: "
|
|
225
|
-
danger: "
|
|
226
|
-
warning: "
|
|
227
|
-
info: "
|
|
228
|
-
dark: "
|
|
229
|
-
light: "
|
|
230
|
-
link: "
|
|
231
|
-
"outline-primary": "
|
|
232
|
-
"outline-secondary": "
|
|
233
|
-
"outline-success": "
|
|
234
|
-
"outline-danger": "
|
|
235
|
-
"outline-warning": "
|
|
236
|
-
"outline-info": "
|
|
237
|
-
"outline-dark": "
|
|
238
|
-
"outline-light": "
|
|
239
|
-
|
|
221
|
+
be.displayName = "Select";
|
|
222
|
+
const me = {
|
|
223
|
+
primary: "btn-primary",
|
|
224
|
+
secondary: "btn-secondary",
|
|
225
|
+
success: "btn-success",
|
|
226
|
+
danger: "btn-danger",
|
|
227
|
+
warning: "btn-warning",
|
|
228
|
+
info: "btn-info",
|
|
229
|
+
dark: "btn-dark",
|
|
230
|
+
light: "btn-light",
|
|
231
|
+
link: "btn-link",
|
|
232
|
+
"outline-primary": "btn-outline-primary",
|
|
233
|
+
"outline-secondary": "btn-outline-secondary",
|
|
234
|
+
"outline-success": "btn-outline-success",
|
|
235
|
+
"outline-danger": "btn-outline-danger",
|
|
236
|
+
"outline-warning": "btn-outline-warning",
|
|
237
|
+
"outline-info": "btn-outline-info",
|
|
238
|
+
"outline-dark": "btn-outline-dark",
|
|
239
|
+
"outline-light": "btn-outline-light",
|
|
240
|
+
"soft-primary": "btn-soft-primary",
|
|
241
|
+
"soft-secondary": "btn-soft-secondary",
|
|
242
|
+
"soft-success": "btn-soft-success",
|
|
243
|
+
"soft-danger": "btn-soft-danger",
|
|
244
|
+
"soft-warning": "btn-soft-warning",
|
|
245
|
+
"soft-info": "btn-soft-info",
|
|
246
|
+
"soft-dark": "btn-soft-dark",
|
|
247
|
+
"soft-light": "btn-soft-light"
|
|
248
|
+
}, xe = {
|
|
240
249
|
xs: "px-3 py-2 text-xs",
|
|
241
250
|
sm: "px-3 py-2 text-sm",
|
|
242
251
|
md: "px-5 py-2.5 text-sm",
|
|
243
252
|
lg: "px-5 py-3 text-base",
|
|
244
253
|
xl: "px-6 py-3.5 text-base"
|
|
245
|
-
},
|
|
254
|
+
}, he = {
|
|
246
255
|
flat: "shadow-none",
|
|
247
256
|
rounded: "rounded-sm",
|
|
248
257
|
pill: "rounded-full",
|
|
249
258
|
circle: "rounded-full w-10 h-10 p-0 flex items-center justify-center"
|
|
250
|
-
},
|
|
259
|
+
}, Te = ({
|
|
251
260
|
children: e,
|
|
252
261
|
variant: n = "primary",
|
|
253
262
|
size: t = "md",
|
|
254
263
|
type: r = "button",
|
|
255
264
|
shape: s = "rounded",
|
|
256
|
-
className:
|
|
257
|
-
isLoading:
|
|
265
|
+
className: g = "",
|
|
266
|
+
isLoading: f = !1,
|
|
258
267
|
disabled: c = !1,
|
|
259
268
|
...a
|
|
260
269
|
}) => {
|
|
261
|
-
const u = c ||
|
|
270
|
+
const u = c || f, o = [
|
|
262
271
|
"inline-flex items-center justify-center font-normal transition duration-150 cursor-pointer",
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
272
|
+
me[n],
|
|
273
|
+
xe[t],
|
|
274
|
+
he[s],
|
|
266
275
|
s === "flat" ? "shadow-none" : "shadow-sm",
|
|
267
276
|
u ? "opacity-50 cursor-not-allowed pointer-events-none" : "",
|
|
268
|
-
|
|
277
|
+
g
|
|
269
278
|
].filter(Boolean).join(" ");
|
|
270
279
|
return /* @__PURE__ */ h("button", { type: r, className: o, disabled: u, ...a, children: [
|
|
271
|
-
|
|
280
|
+
f && /* @__PURE__ */ h(
|
|
272
281
|
"svg",
|
|
273
282
|
{
|
|
274
283
|
"aria-hidden": "true",
|
|
@@ -278,14 +287,14 @@ const pe = {
|
|
|
278
287
|
fill: "none",
|
|
279
288
|
xmlns: "http://www.w3.org/2000/svg",
|
|
280
289
|
children: [
|
|
281
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ p(
|
|
282
291
|
"path",
|
|
283
292
|
{
|
|
284
293
|
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",
|
|
285
294
|
fill: "currentColor"
|
|
286
295
|
}
|
|
287
296
|
),
|
|
288
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ p(
|
|
289
298
|
"path",
|
|
290
299
|
{
|
|
291
300
|
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",
|
|
@@ -297,12 +306,12 @@ const pe = {
|
|
|
297
306
|
),
|
|
298
307
|
e
|
|
299
308
|
] });
|
|
300
|
-
},
|
|
309
|
+
}, _e = ({
|
|
301
310
|
label: e,
|
|
302
311
|
children: n,
|
|
303
312
|
position: t = "right"
|
|
304
313
|
}) => {
|
|
305
|
-
const [r, s] =
|
|
314
|
+
const [r, s] = L(!1), [g, f] = L(!1), c = M(null), a = M(null), u = $(() => {
|
|
306
315
|
switch (t) {
|
|
307
316
|
case "left":
|
|
308
317
|
return "left-0";
|
|
@@ -312,47 +321,47 @@ const pe = {
|
|
|
312
321
|
default:
|
|
313
322
|
return "right-0";
|
|
314
323
|
}
|
|
315
|
-
}, [t]), o =
|
|
316
|
-
const
|
|
317
|
-
c.current && !c.current.contains(
|
|
318
|
-
}, []), d =
|
|
324
|
+
}, [t]), o = E((i) => {
|
|
325
|
+
const m = i.target;
|
|
326
|
+
c.current && !c.current.contains(m) && a.current && !a.current.contains(m) && s(!1);
|
|
327
|
+
}, []), d = E(() => {
|
|
319
328
|
if (!a.current || !c.current) return;
|
|
320
|
-
const i = a.current.getBoundingClientRect(),
|
|
321
|
-
|
|
322
|
-
|
|
329
|
+
const i = a.current.getBoundingClientRect(), m = c.current.getBoundingClientRect(), x = window.innerHeight - i.bottom, y = i.top;
|
|
330
|
+
f(
|
|
331
|
+
x < m.height && y > m.height
|
|
323
332
|
);
|
|
324
333
|
}, []);
|
|
325
|
-
|
|
334
|
+
A(() => {
|
|
326
335
|
if (r)
|
|
327
336
|
return d(), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0), () => {
|
|
328
337
|
window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0);
|
|
329
338
|
};
|
|
330
|
-
}, [r, d]),
|
|
331
|
-
const l =
|
|
339
|
+
}, [r, d]), A(() => (document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o)), [o]);
|
|
340
|
+
const l = E(() => s((i) => !i), []);
|
|
332
341
|
return /* @__PURE__ */ h("div", { className: "relative flex items-center", children: [
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
r && /* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ p("button", { ref: a, onClick: l, children: e }),
|
|
343
|
+
r && /* @__PURE__ */ p(
|
|
335
344
|
"div",
|
|
336
345
|
{
|
|
337
346
|
ref: c,
|
|
338
347
|
className: `absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
|
|
339
|
-
${
|
|
348
|
+
${g ? "bottom-full mb-2" : "top-full mt-2"}
|
|
340
349
|
${u}`,
|
|
341
350
|
children: n
|
|
342
351
|
}
|
|
343
352
|
)
|
|
344
353
|
] });
|
|
345
|
-
},
|
|
354
|
+
}, Be = ({
|
|
346
355
|
children: e,
|
|
347
356
|
content: n,
|
|
348
357
|
position: t = "top",
|
|
349
358
|
className: r = "",
|
|
350
359
|
tooltipClass: s = "",
|
|
351
|
-
tooltipStyle:
|
|
360
|
+
tooltipStyle: g = {}
|
|
352
361
|
}) => {
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
const u =
|
|
362
|
+
const f = M(null), c = M(null);
|
|
363
|
+
A(() => {
|
|
364
|
+
const u = f.current, o = c.current;
|
|
356
365
|
if (!u || !o) return;
|
|
357
366
|
const d = () => {
|
|
358
367
|
o.style.opacity = "1", o.style.visibility = "visible";
|
|
@@ -418,9 +427,9 @@ const pe = {
|
|
|
418
427
|
return o;
|
|
419
428
|
}
|
|
420
429
|
};
|
|
421
|
-
return /* @__PURE__ */ h("div", { ref:
|
|
430
|
+
return /* @__PURE__ */ h("div", { ref: f, className: `relative inline-block ${r}`, children: [
|
|
422
431
|
e,
|
|
423
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ p(
|
|
424
433
|
"div",
|
|
425
434
|
{
|
|
426
435
|
ref: c,
|
|
@@ -428,13 +437,13 @@ const pe = {
|
|
|
428
437
|
className: s,
|
|
429
438
|
style: {
|
|
430
439
|
...a(t),
|
|
431
|
-
...
|
|
440
|
+
...g
|
|
432
441
|
},
|
|
433
442
|
children: n
|
|
434
443
|
}
|
|
435
444
|
)
|
|
436
445
|
] });
|
|
437
|
-
},
|
|
446
|
+
}, ye = {
|
|
438
447
|
primary: "bg-blue-500 text-white",
|
|
439
448
|
secondary: "bg-gray-500 text-white",
|
|
440
449
|
success: "bg-green-500 text-white",
|
|
@@ -452,61 +461,61 @@ const pe = {
|
|
|
452
461
|
"outline-info": "border border-cyan-500 text-cyan-500 bg-transparent",
|
|
453
462
|
"outline-dark": "border border-black text-black bg-transparent",
|
|
454
463
|
"outline-light": "border border-gray-100 text-gray-800 bg-transparent"
|
|
455
|
-
},
|
|
464
|
+
}, we = {
|
|
456
465
|
xs: "text-xs px-2 py-0.5",
|
|
457
466
|
sm: "text-sm px-2.5 py-0.5",
|
|
458
467
|
md: "text-base px-3 py-1",
|
|
459
468
|
lg: "text-lg px-3.5 py-1.5",
|
|
460
469
|
xl: "text-xl px-4 py-2"
|
|
461
|
-
},
|
|
470
|
+
}, ve = {
|
|
462
471
|
flat: "rounded-none",
|
|
463
472
|
rounded: "rounded-sm",
|
|
464
473
|
pill: "rounded-full",
|
|
465
474
|
circle: "rounded-full p-2 w-8 h-8 justify-center"
|
|
466
|
-
},
|
|
475
|
+
}, Re = ({
|
|
467
476
|
label: e,
|
|
468
477
|
variant: n = "primary",
|
|
469
478
|
size: t = "sm",
|
|
470
479
|
shape: r = "rounded",
|
|
471
480
|
icon: s,
|
|
472
|
-
dismissible:
|
|
473
|
-
onDismiss:
|
|
481
|
+
dismissible: g,
|
|
482
|
+
onDismiss: f,
|
|
474
483
|
className: c = "",
|
|
475
484
|
...a
|
|
476
485
|
}) => {
|
|
477
|
-
const u = !e && !!s, o = `inline-flex items-center font-medium ${
|
|
486
|
+
const u = !e && !!s, o = `inline-flex items-center font-medium ${ye[n] || ""} ${we[t] || ""} ${ve[r] || ""} ${u ? "justify-center p-2 w-8 h-8" : ""} ` + c;
|
|
478
487
|
return /* @__PURE__ */ h("span", { className: o.trim(), ...a, children: [
|
|
479
|
-
s && /* @__PURE__ */
|
|
488
|
+
s && /* @__PURE__ */ p("span", { className: e ? "mr-1" : "", children: s }),
|
|
480
489
|
e,
|
|
481
|
-
|
|
490
|
+
g && /* @__PURE__ */ p(
|
|
482
491
|
"button",
|
|
483
492
|
{
|
|
484
493
|
type: "button",
|
|
485
|
-
onClick:
|
|
494
|
+
onClick: f,
|
|
486
495
|
className: "ml-2 text-xs font-bold leading-none focus:outline-none",
|
|
487
496
|
children: "×"
|
|
488
497
|
}
|
|
489
498
|
)
|
|
490
499
|
] });
|
|
491
500
|
};
|
|
492
|
-
var
|
|
501
|
+
var J = {
|
|
493
502
|
color: void 0,
|
|
494
503
|
size: void 0,
|
|
495
504
|
className: void 0,
|
|
496
505
|
style: void 0,
|
|
497
506
|
attr: void 0
|
|
498
|
-
},
|
|
499
|
-
function
|
|
507
|
+
}, K = P.createContext && /* @__PURE__ */ P.createContext(J), Ce = ["attr", "size", "title"];
|
|
508
|
+
function Se(e, n) {
|
|
500
509
|
if (e == null) return {};
|
|
501
|
-
var t =
|
|
510
|
+
var t = Ne(e, n), r, s;
|
|
502
511
|
if (Object.getOwnPropertySymbols) {
|
|
503
|
-
var
|
|
504
|
-
for (s = 0; s <
|
|
505
|
-
r =
|
|
512
|
+
var g = Object.getOwnPropertySymbols(e);
|
|
513
|
+
for (s = 0; s < g.length; s++)
|
|
514
|
+
r = g[s], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (t[r] = e[r]);
|
|
506
515
|
}
|
|
507
516
|
return t;
|
|
508
517
|
}
|
|
509
|
-
function
|
|
518
|
+
function Ne(e, n) {
|
|
510
519
|
if (e == null) return {};
|
|
511
520
|
var t = {};
|
|
512
521
|
for (var r in e)
|
|
@@ -516,17 +525,17 @@ function Ce(e, n) {
|
|
|
516
525
|
}
|
|
517
526
|
return t;
|
|
518
527
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
528
|
+
function D() {
|
|
529
|
+
return D = Object.assign ? Object.assign.bind() : function(e) {
|
|
521
530
|
for (var n = 1; n < arguments.length; n++) {
|
|
522
531
|
var t = arguments[n];
|
|
523
532
|
for (var r in t)
|
|
524
533
|
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
525
534
|
}
|
|
526
535
|
return e;
|
|
527
|
-
},
|
|
536
|
+
}, D.apply(this, arguments);
|
|
528
537
|
}
|
|
529
|
-
function
|
|
538
|
+
function U(e, n) {
|
|
530
539
|
var t = Object.keys(e);
|
|
531
540
|
if (Object.getOwnPropertySymbols) {
|
|
532
541
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -536,25 +545,25 @@ function J(e, n) {
|
|
|
536
545
|
}
|
|
537
546
|
return t;
|
|
538
547
|
}
|
|
539
|
-
function
|
|
548
|
+
function T(e) {
|
|
540
549
|
for (var n = 1; n < arguments.length; n++) {
|
|
541
550
|
var t = arguments[n] != null ? arguments[n] : {};
|
|
542
|
-
n % 2 ?
|
|
543
|
-
|
|
544
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) :
|
|
551
|
+
n % 2 ? U(Object(t), !0).forEach(function(r) {
|
|
552
|
+
ke(e, r, t[r]);
|
|
553
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : U(Object(t)).forEach(function(r) {
|
|
545
554
|
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
546
555
|
});
|
|
547
556
|
}
|
|
548
557
|
return e;
|
|
549
558
|
}
|
|
550
|
-
function
|
|
551
|
-
return n =
|
|
559
|
+
function ke(e, n, t) {
|
|
560
|
+
return n = $e(n), n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
|
|
552
561
|
}
|
|
553
|
-
function
|
|
554
|
-
var n =
|
|
562
|
+
function $e(e) {
|
|
563
|
+
var n = Ee(e, "string");
|
|
555
564
|
return typeof n == "symbol" ? n : n + "";
|
|
556
565
|
}
|
|
557
|
-
function
|
|
566
|
+
function Ee(e, n) {
|
|
558
567
|
if (typeof e != "object" || !e) return e;
|
|
559
568
|
var t = e[Symbol.toPrimitive];
|
|
560
569
|
if (t !== void 0) {
|
|
@@ -564,67 +573,67 @@ function ke(e, n) {
|
|
|
564
573
|
}
|
|
565
574
|
return (n === "string" ? String : Number)(e);
|
|
566
575
|
}
|
|
567
|
-
function
|
|
568
|
-
return e && e.map((n, t) => /* @__PURE__ */
|
|
576
|
+
function Q(e) {
|
|
577
|
+
return e && e.map((n, t) => /* @__PURE__ */ P.createElement(n.tag, T({
|
|
569
578
|
key: t
|
|
570
|
-
}, n.attr),
|
|
579
|
+
}, n.attr), Q(n.child)));
|
|
571
580
|
}
|
|
572
|
-
function
|
|
573
|
-
return (n) => /* @__PURE__ */
|
|
574
|
-
attr:
|
|
575
|
-
}, n),
|
|
581
|
+
function V(e) {
|
|
582
|
+
return (n) => /* @__PURE__ */ P.createElement(Le, D({
|
|
583
|
+
attr: T({}, e.attr)
|
|
584
|
+
}, n), Q(e.child));
|
|
576
585
|
}
|
|
577
|
-
function
|
|
586
|
+
function Le(e) {
|
|
578
587
|
var n = (t) => {
|
|
579
588
|
var {
|
|
580
589
|
attr: r,
|
|
581
590
|
size: s,
|
|
582
|
-
title:
|
|
583
|
-
} = e,
|
|
584
|
-
return t.className && (a = t.className), e.className && (a = (a ? a + " " : "") + e.className), /* @__PURE__ */
|
|
591
|
+
title: g
|
|
592
|
+
} = e, f = Se(e, Ce), c = s || t.size || "1em", a;
|
|
593
|
+
return t.className && (a = t.className), e.className && (a = (a ? a + " " : "") + e.className), /* @__PURE__ */ P.createElement("svg", D({
|
|
585
594
|
stroke: "currentColor",
|
|
586
595
|
fill: "currentColor",
|
|
587
596
|
strokeWidth: "0"
|
|
588
|
-
}, t.attr, r,
|
|
597
|
+
}, t.attr, r, f, {
|
|
589
598
|
className: a,
|
|
590
|
-
style:
|
|
599
|
+
style: T(T({
|
|
591
600
|
color: e.color || t.color
|
|
592
601
|
}, t.style), e.style),
|
|
593
602
|
height: c,
|
|
594
603
|
width: c,
|
|
595
604
|
xmlns: "http://www.w3.org/2000/svg"
|
|
596
|
-
}),
|
|
605
|
+
}), g && /* @__PURE__ */ P.createElement("title", null, g), e.children);
|
|
597
606
|
};
|
|
598
|
-
return
|
|
607
|
+
return K !== void 0 ? /* @__PURE__ */ P.createElement(K.Consumer, null, (t) => n(t)) : n(J);
|
|
599
608
|
}
|
|
600
|
-
function
|
|
601
|
-
return
|
|
609
|
+
function Oe(e) {
|
|
610
|
+
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);
|
|
602
611
|
}
|
|
603
|
-
const
|
|
612
|
+
const Fe = ({
|
|
604
613
|
items: e,
|
|
605
614
|
allowMultipleOpen: n = !1,
|
|
606
615
|
className: t = "",
|
|
607
616
|
tileClasses: r = "",
|
|
608
617
|
open: s,
|
|
609
|
-
onChange:
|
|
610
|
-
renderTitle:
|
|
618
|
+
onChange: g,
|
|
619
|
+
renderTitle: f,
|
|
611
620
|
renderContent: c
|
|
612
621
|
}) => {
|
|
613
|
-
const [a, u] =
|
|
622
|
+
const [a, u] = L(/* @__PURE__ */ new Set()), o = $(() => s ? new Set(s) : a, [s, a]), d = E(
|
|
614
623
|
(l) => {
|
|
615
624
|
const i = new Set(o);
|
|
616
|
-
i.has(l) ? i.delete(l) : (n || i.clear(), i.add(l)), s &&
|
|
625
|
+
i.has(l) ? i.delete(l) : (n || i.clear(), i.add(l)), s && g ? g(Array.from(i)) : u(i);
|
|
617
626
|
},
|
|
618
|
-
[o, s,
|
|
627
|
+
[o, s, g, n]
|
|
619
628
|
);
|
|
620
|
-
return /* @__PURE__ */
|
|
629
|
+
return /* @__PURE__ */ p(
|
|
621
630
|
"div",
|
|
622
631
|
{
|
|
623
632
|
className: "accordion",
|
|
624
633
|
role: "region",
|
|
625
634
|
"aria-multiselectable": n,
|
|
626
635
|
children: e.map((l) => {
|
|
627
|
-
const i = o.has(l.id),
|
|
636
|
+
const i = o.has(l.id), m = `accordion-heading-${l.id}`, x = `accordion-panel-${l.id}`;
|
|
628
637
|
return /* @__PURE__ */ h(
|
|
629
638
|
"div",
|
|
630
639
|
{
|
|
@@ -633,24 +642,24 @@ const Re = ({
|
|
|
633
642
|
/* @__PURE__ */ h(
|
|
634
643
|
"button",
|
|
635
644
|
{
|
|
636
|
-
id:
|
|
645
|
+
id: m,
|
|
637
646
|
type: "button",
|
|
638
647
|
"aria-expanded": i,
|
|
639
|
-
"aria-controls":
|
|
648
|
+
"aria-controls": x,
|
|
640
649
|
onClick: () => d(l.id),
|
|
641
650
|
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}`,
|
|
642
651
|
children: [
|
|
643
|
-
|
|
644
|
-
/* @__PURE__ */
|
|
652
|
+
f ? f(l, i) : l.title,
|
|
653
|
+
/* @__PURE__ */ p(Oe, {})
|
|
645
654
|
]
|
|
646
655
|
}
|
|
647
656
|
),
|
|
648
|
-
/* @__PURE__ */
|
|
657
|
+
/* @__PURE__ */ p(
|
|
649
658
|
"div",
|
|
650
659
|
{
|
|
651
|
-
id:
|
|
660
|
+
id: x,
|
|
652
661
|
role: "region",
|
|
653
|
-
"aria-labelledby":
|
|
662
|
+
"aria-labelledby": m,
|
|
654
663
|
hidden: !i,
|
|
655
664
|
className: "p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",
|
|
656
665
|
children: c ? c(l, i) : l.content
|
|
@@ -663,28 +672,28 @@ const Re = ({
|
|
|
663
672
|
})
|
|
664
673
|
}
|
|
665
674
|
);
|
|
666
|
-
},
|
|
667
|
-
const e = ee
|
|
675
|
+
}, ee = X(null), te = () => {
|
|
676
|
+
const e = Y(ee);
|
|
668
677
|
if (!e)
|
|
669
678
|
throw new Error(
|
|
670
679
|
"useModalActions must be used within a ModalActionProvider"
|
|
671
680
|
);
|
|
672
681
|
return e;
|
|
673
|
-
},
|
|
674
|
-
function
|
|
682
|
+
}, re = X(null), ne = () => Y(re);
|
|
683
|
+
function Ze({
|
|
675
684
|
id: e,
|
|
676
685
|
title: n,
|
|
677
686
|
children: t,
|
|
678
687
|
standalone: r = !1,
|
|
679
688
|
showFloatingClose: s = !1,
|
|
680
|
-
containerClasses:
|
|
681
|
-
onClose:
|
|
689
|
+
containerClasses: g = "",
|
|
690
|
+
onClose: f,
|
|
682
691
|
disableEscapeClose: c = !1
|
|
683
692
|
}) {
|
|
684
|
-
const a =
|
|
685
|
-
o ? u.closeModal(e) : l(!1),
|
|
686
|
-
}, [o, u, e,
|
|
687
|
-
return
|
|
693
|
+
const a = ne(), u = te(), o = !r && !!a && !!u, [d, l] = L(!1), i = o ? a.isOpen(e) : d, m = o ? a.getModalData(e) : null, x = E(() => {
|
|
694
|
+
o ? u.closeModal(e) : l(!1), f == null || f();
|
|
695
|
+
}, [o, u, e, f]);
|
|
696
|
+
return A(() => {
|
|
688
697
|
const y = document.activeElement;
|
|
689
698
|
console.log(e);
|
|
690
699
|
const w = document.getElementById(e);
|
|
@@ -701,24 +710,24 @@ function Be({
|
|
|
701
710
|
const b = w.querySelectorAll(
|
|
702
711
|
S.join(",")
|
|
703
712
|
);
|
|
704
|
-
return Array.from(b).filter((
|
|
705
|
-
},
|
|
713
|
+
return Array.from(b).filter((C) => C.offsetParent !== null);
|
|
714
|
+
}, O = (b) => {
|
|
706
715
|
if (b.key === "Tab") {
|
|
707
|
-
const
|
|
708
|
-
if (
|
|
709
|
-
const
|
|
710
|
-
b.shiftKey ? document.activeElement ===
|
|
716
|
+
const C = N();
|
|
717
|
+
if (C.length === 0) return;
|
|
718
|
+
const k = C[0], j = C[C.length - 1];
|
|
719
|
+
b.shiftKey ? document.activeElement === k && (b.preventDefault(), j.focus()) : document.activeElement === j && (b.preventDefault(), k.focus());
|
|
711
720
|
}
|
|
712
|
-
},
|
|
713
|
-
b.key === "Escape" && !c &&
|
|
721
|
+
}, v = (b) => {
|
|
722
|
+
b.key === "Escape" && !c && x(), O(b);
|
|
714
723
|
};
|
|
715
724
|
return i && (document.body.style.overflow = "hidden", setTimeout(() => {
|
|
716
725
|
const b = N();
|
|
717
726
|
b.length && b[0].focus();
|
|
718
|
-
}, 0), window.addEventListener("keydown",
|
|
719
|
-
document.body.style.overflow = "", y && y.focus(), window.removeEventListener("keydown",
|
|
727
|
+
}, 0), window.addEventListener("keydown", v)), () => {
|
|
728
|
+
document.body.style.overflow = "", y && y.focus(), window.removeEventListener("keydown", v);
|
|
720
729
|
};
|
|
721
|
-
}, [i, c,
|
|
730
|
+
}, [i, c, x, e]), i ? /* @__PURE__ */ p(
|
|
722
731
|
"div",
|
|
723
732
|
{
|
|
724
733
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",
|
|
@@ -726,109 +735,109 @@ function Be({
|
|
|
726
735
|
children: /* @__PURE__ */ h(
|
|
727
736
|
"div",
|
|
728
737
|
{
|
|
729
|
-
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${
|
|
738
|
+
className: `bg-white rounded-lg shadow-lg w-full max-w-md p-4 transform transition-all duration-300 scale-100 ${g}`,
|
|
730
739
|
children: [
|
|
731
740
|
/* @__PURE__ */ h("div", { className: "flex justify-between items-center relative", children: [
|
|
732
|
-
n && /* @__PURE__ */
|
|
733
|
-
s && /* @__PURE__ */
|
|
741
|
+
n && /* @__PURE__ */ p("h2", { className: "text-lg font-semibold", children: n }),
|
|
742
|
+
s && /* @__PURE__ */ p(
|
|
734
743
|
"button",
|
|
735
744
|
{
|
|
736
|
-
onClick:
|
|
745
|
+
onClick: x,
|
|
737
746
|
className: "text-gray-500 hover:text-black absolute top-2 right-3 hover:bg-gray-200 rounded-full aspect-square w-8",
|
|
738
747
|
"aria-label": "Close modal",
|
|
739
748
|
children: "✕"
|
|
740
749
|
}
|
|
741
750
|
)
|
|
742
751
|
] }),
|
|
743
|
-
/* @__PURE__ */
|
|
752
|
+
/* @__PURE__ */ p("div", { className: "mt-3 text-sm text-gray-700", children: typeof t == "function" ? t({ modalData: m }) : t })
|
|
744
753
|
]
|
|
745
754
|
}
|
|
746
755
|
)
|
|
747
756
|
}
|
|
748
757
|
) : null;
|
|
749
758
|
}
|
|
750
|
-
function
|
|
759
|
+
function Ge({
|
|
751
760
|
children: e
|
|
752
761
|
}) {
|
|
753
|
-
const [n, t] =
|
|
762
|
+
const [n, t] = L({}), [r, s] = L({}), g = E((d, l) => {
|
|
754
763
|
t((i) => ({ ...i, [d]: !0 })), l && s((i) => ({ ...i, [d]: l }));
|
|
755
|
-
}, []),
|
|
764
|
+
}, []), f = E((d) => {
|
|
756
765
|
t((l) => ({ ...l, [d]: !1 })), s((l) => {
|
|
757
766
|
const i = { ...l };
|
|
758
767
|
return delete i[d], i;
|
|
759
768
|
});
|
|
760
|
-
}, []), c =
|
|
769
|
+
}, []), c = E((d) => !!n[d], [n]), a = E(
|
|
761
770
|
(d) => r[d],
|
|
762
771
|
[r]
|
|
763
772
|
), u = $(
|
|
764
|
-
() => ({ openModal:
|
|
765
|
-
[
|
|
773
|
+
() => ({ openModal: g, closeModal: f }),
|
|
774
|
+
[g, f]
|
|
766
775
|
), o = $(
|
|
767
776
|
() => ({ isOpen: c, getModalData: a }),
|
|
768
777
|
[c, a]
|
|
769
778
|
);
|
|
770
|
-
return /* @__PURE__ */
|
|
779
|
+
return /* @__PURE__ */ p(ee.Provider, { value: u, children: /* @__PURE__ */ p(re.Provider, { value: o, children: e }) });
|
|
771
780
|
}
|
|
772
|
-
function
|
|
773
|
-
const { openModal: n, closeModal: t } =
|
|
781
|
+
function He(e) {
|
|
782
|
+
const { openModal: n, closeModal: t } = te(), { isOpen: r, getModalData: s } = ne();
|
|
774
783
|
return {
|
|
775
|
-
open: (
|
|
784
|
+
open: (g) => n(e, g),
|
|
776
785
|
close: () => t(e),
|
|
777
786
|
isOpen: r(e),
|
|
778
787
|
data: s(e)
|
|
779
788
|
};
|
|
780
789
|
}
|
|
781
|
-
let
|
|
782
|
-
function
|
|
783
|
-
|
|
790
|
+
let R = null, F = {};
|
|
791
|
+
function Pe(e) {
|
|
792
|
+
R = e;
|
|
784
793
|
}
|
|
785
|
-
function
|
|
786
|
-
|
|
794
|
+
function We(e) {
|
|
795
|
+
F = { ...F, ...e };
|
|
787
796
|
}
|
|
788
|
-
function
|
|
789
|
-
return
|
|
797
|
+
function je() {
|
|
798
|
+
return F;
|
|
790
799
|
}
|
|
791
|
-
function
|
|
792
|
-
|
|
800
|
+
function Ke(e, n, t = 3e3, r) {
|
|
801
|
+
R ? R(e, n, t, r) : console.warn("Toast system is not mounted");
|
|
793
802
|
}
|
|
794
|
-
function
|
|
795
|
-
return
|
|
803
|
+
function Ie(e) {
|
|
804
|
+
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);
|
|
796
805
|
}
|
|
797
|
-
const
|
|
806
|
+
const Ae = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
798
807
|
const n = Math.random() * 16 | 0;
|
|
799
808
|
return (e === "x" ? n : n & 3 | 8).toString(16);
|
|
800
|
-
}),
|
|
801
|
-
const [e, n] =
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
const c =
|
|
805
|
-
n((a) => [...a, { id: c, type: r, message: s, config:
|
|
809
|
+
}), Ue = () => {
|
|
810
|
+
const [e, n] = L([]);
|
|
811
|
+
A(() => {
|
|
812
|
+
Pe((r, s, g, f) => {
|
|
813
|
+
const c = Ae();
|
|
814
|
+
n((a) => [...a, { id: c, type: r, message: s, config: f }]), setTimeout(() => {
|
|
806
815
|
n((a) => a.filter((u) => u.id !== c));
|
|
807
|
-
},
|
|
816
|
+
}, g);
|
|
808
817
|
});
|
|
809
818
|
}, []);
|
|
810
|
-
const t =
|
|
811
|
-
return /* @__PURE__ */
|
|
812
|
-
var a, u, o, d, l, i,
|
|
813
|
-
const s = ((a = r.config) == null ? void 0 : a.icon) || ((u = t.icons) == null ? void 0 : u[r.type]) ||
|
|
819
|
+
const t = je();
|
|
820
|
+
return /* @__PURE__ */ p("div", { className: "fixed top-5 right-5 z-[9999] flex flex-col gap-2", children: e.map((r) => {
|
|
821
|
+
var a, u, o, d, l, i, m, x, y, w, S, N, O;
|
|
822
|
+
const s = ((a = r.config) == null ? void 0 : a.icon) || ((u = t.icons) == null ? void 0 : u[r.type]) || ze(r.type), g = ((o = r.config) == null ? void 0 : o.bgColor) || ((l = (d = t.colors) == null ? void 0 : d[r.type]) == null ? void 0 : l.bg) || "bg-white dark:bg-gray-800", f = ((i = r.config) == null ? void 0 : i.textColor) || ((x = (m = t.colors) == null ? void 0 : m[r.type]) == null ? void 0 : x.text) || "text-gray-700 dark:text-gray-300", c = ((y = r.config) == null ? void 0 : y.iconContainerClass) || "w-8 h-8 mr-3 text-xl flex items-center justify-center";
|
|
814
823
|
return /* @__PURE__ */ h(
|
|
815
824
|
"div",
|
|
816
825
|
{
|
|
817
|
-
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${
|
|
826
|
+
className: `flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${g} ${f}`,
|
|
818
827
|
children: [
|
|
819
|
-
/* @__PURE__ */
|
|
828
|
+
/* @__PURE__ */ p("div", { className: c, children: s }),
|
|
820
829
|
/* @__PURE__ */ h("div", { className: "flex-1 me-3", children: [
|
|
821
|
-
((w = r.config) == null ? void 0 : w.title) && /* @__PURE__ */
|
|
822
|
-
((S = r.config) == null ? void 0 : S.description) && /* @__PURE__ */
|
|
823
|
-
!((N = r.config) != null && N.title) && !((
|
|
830
|
+
((w = r.config) == null ? void 0 : w.title) && /* @__PURE__ */ p("div", { className: "font-semibold text-black", children: r.config.title }),
|
|
831
|
+
((S = r.config) == null ? void 0 : S.description) && /* @__PURE__ */ p("div", { className: "text-sm text-gray-500", children: r.config.description }),
|
|
832
|
+
!((N = r.config) != null && N.title) && !((O = r.config) != null && O.description) && /* @__PURE__ */ p("div", { className: "text-sm", children: r.message })
|
|
824
833
|
] }),
|
|
825
|
-
/* @__PURE__ */
|
|
834
|
+
/* @__PURE__ */ p(
|
|
826
835
|
"button",
|
|
827
836
|
{
|
|
828
|
-
onClick: () => n((
|
|
837
|
+
onClick: () => n((v) => v.filter((b) => b.id !== r.id)),
|
|
829
838
|
className: "ml-auto text-gray-400 hover:text-gray-700 dark:text-gray-500 dark:hover:text-white",
|
|
830
839
|
"aria-label": "Close",
|
|
831
|
-
children: /* @__PURE__ */
|
|
840
|
+
children: /* @__PURE__ */ p(Ie, { size: 18 })
|
|
832
841
|
}
|
|
833
842
|
)
|
|
834
843
|
]
|
|
@@ -837,7 +846,7 @@ const je = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, functio
|
|
|
837
846
|
);
|
|
838
847
|
}) });
|
|
839
848
|
};
|
|
840
|
-
function
|
|
849
|
+
function ze(e) {
|
|
841
850
|
switch (e) {
|
|
842
851
|
case "success":
|
|
843
852
|
return "✅";
|
|
@@ -850,19 +859,19 @@ function Ie(e) {
|
|
|
850
859
|
}
|
|
851
860
|
}
|
|
852
861
|
export {
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
862
|
+
Fe as Accordion,
|
|
863
|
+
Re as Badge,
|
|
864
|
+
Te as Button,
|
|
865
|
+
_e as Dropdown,
|
|
866
|
+
ce as Input,
|
|
867
|
+
Ze as Modal,
|
|
868
|
+
Ge as ModalProvider,
|
|
869
|
+
be as Select,
|
|
870
|
+
Ue as Toast,
|
|
871
|
+
Be as Tooltip,
|
|
872
|
+
We as setToastDefaults,
|
|
873
|
+
Ke as showToast,
|
|
874
|
+
te as useModalActions,
|
|
875
|
+
He as useModalInstance,
|
|
876
|
+
ne as useModalState
|
|
868
877
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
${
|
|
3
|
-
${x&&f&&
|
|
4
|
-
${
|
|
5
|
-
|
|
6
|
-
${
|
|
7
|
-
${
|
|
8
|
-
${
|
|
9
|
-
${g}`,children:n})]})},de=({children:e,content:n,position:t="top",className:r="",tooltipClass:a="",tooltipStyle:b={}})=>{const p=s.useRef(null),u=s.useRef(null);s.useEffect(()=>{const g=p.current,l=u.current;if(!g||!l)return;const f=()=>{l.style.opacity="1",l.style.visibility="visible"},c=()=>{l.style.opacity="0",l.style.visibility="hidden"};return g.addEventListener("mouseenter",f),g.addEventListener("mouseleave",c),()=>{g.removeEventListener("mouseenter",f),g.removeEventListener("mouseleave",c)}},[]);const i=g=>{const l={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(g){case"top":return{...l,bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};case"bottom":return{...l,top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"left":return{...l,right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"right":return{...l,left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};default:return l}};return o.jsxs("div",{ref:p,className:`relative inline-block ${r}`,children:[e,o.jsx("div",{ref:u,role:"tooltip",className:a,style:{...i(t),...b},children:n})]})},ue={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"},fe={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"},ge={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full p-2 w-8 h-8 justify-center"},pe=({label:e,variant:n="primary",size:t="sm",shape:r="rounded",icon:a,dismissible:b,onDismiss:p,className:u="",...i})=>{const g=!e&&!!a,l=`inline-flex items-center font-medium ${ue[n]||""} ${fe[t]||""} ${ge[r]||""} ${g?"justify-center p-2 w-8 h-8":""} `+u;return o.jsxs("span",{className:l.trim(),...i,children:[a&&o.jsx("span",{className:e?"mr-1":"",children:a}),e,b&&o.jsx("button",{type:"button",onClick:p,className:"ml-2 text-xs font-bold leading-none focus:outline-none",children:"×"})]})};var Y={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},J=s.createContext&&s.createContext(Y),be=["attr","size","title"];function xe(e,n){if(e==null)return{};var t=he(e,n),r,a;if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(a=0;a<b.length;a++)r=b[a],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function he(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 Q(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,r)}return t}function j(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?Q(Object(t),!0).forEach(function(r){ye(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Q(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function ye(e,n,t){return n=me(n),n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function me(e){var n=we(e,"string");return typeof n=="symbol"?n:n+""}function we(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 V(e){return e&&e.map((n,t)=>s.createElement(n.tag,j({key:t},n.attr),V(n.child)))}function R(e){return n=>s.createElement(ve,P({attr:j({},e.attr)},n),V(e.child))}function ve(e){var n=t=>{var{attr:r,size:a,title:b}=e,p=xe(e,be),u=a||t.size||"1em",i;return t.className&&(i=t.className),e.className&&(i=(i?i+" ":"")+e.className),s.createElement("svg",P({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,p,{className:i,style:j(j({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),b&&s.createElement("title",null,b),e.children)};return J!==void 0?s.createElement(J.Consumer,null,t=>n(t)):n(Y)}function Ce(e){return R({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 Se=({items:e,allowMultipleOpen:n=!1,className:t="",tileClasses:r="",open:a,onChange:b,renderTitle:p,renderContent:u})=>{const[i,g]=s.useState(new Set),l=s.useMemo(()=>a?new Set(a):i,[a,i]),f=s.useCallback(c=>{const d=new Set(l);d.has(c)?d.delete(c):(n||d.clear(),d.add(c)),a&&b?b(Array.from(d)):g(d)},[l,a,b,n]);return o.jsx("div",{className:"accordion",role:"region","aria-multiselectable":n,children:e.map(c=>{const d=l.has(c.id),y=`accordion-heading-${c.id}`,m=`accordion-panel-${c.id}`;return o.jsxs("div",{className:`accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,children:[o.jsxs("button",{id:y,type:"button","aria-expanded":d,"aria-controls":m,onClick:()=>f(c.id),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}`,children:[p?p(c,d):c.title,o.jsx(Ce,{})]}),o.jsx("div",{id:m,role:"region","aria-labelledby":y,hidden:!d,className:"p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",children:u?u(c,d):c.content})]},c.id)})})},ee=s.createContext(null),z=()=>{const e=s.useContext(ee);if(!e)throw new Error("useModalActions must be used within a ModalActionProvider");return e},te=s.createContext(null),D=()=>s.useContext(te);function Ne({id:e,title:n,children:t,standalone:r=!1,showFloatingClose:a=!1,containerClasses:b="",onClose:p,disableEscapeClose:u=!1}){const i=D(),g=z(),l=!r&&!!i&&!!g,[f,c]=s.useState(!1),d=l?i.isOpen(e):f,y=l?i.getModalData(e):null,m=s.useCallback(()=>{l?g.closeModal(e):c(!1),p==null||p()},[l,g,e,p]);return s.useEffect(()=>{const w=document.activeElement;console.log(e);const v=document.getElementById(e);console.log("modalEl=",v);const N=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],k=()=>{if(!v)return[];const x=v.querySelectorAll(N.join(","));return Array.from(x).filter(C=>C.offsetParent!==null)},E=x=>{if(x.key==="Tab"){const C=k();if(C.length===0)return;const L=C[0],O=C[C.length-1];x.shiftKey?document.activeElement===L&&(x.preventDefault(),O.focus()):document.activeElement===O&&(x.preventDefault(),L.focus())}},S=x=>{x.key==="Escape"&&!u&&m(),E(x)};return d&&(document.body.style.overflow="hidden",setTimeout(()=>{const x=k();x.length&&x[0].focus()},0),window.addEventListener("keydown",S)),()=>{document.body.style.overflow="",w&&w.focus(),window.removeEventListener("keydown",S)}},[d,u,m,e]),d?o.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",id:e,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 ${b}`,children:[o.jsxs("div",{className:"flex justify-between items-center relative",children:[n&&o.jsx("h2",{className:"text-lg font-semibold",children:n}),a&&o.jsx("button",{onClick:m,className:"text-gray-500 hover:text-black absolute top-2 right-3 hover:bg-gray-200 rounded-full aspect-square w-8","aria-label":"Close modal",children:"✕"})]}),o.jsx("div",{className:"mt-3 text-sm text-gray-700",children:typeof t=="function"?t({modalData:y}):t})]})}):null}function ke({children:e}){const[n,t]=s.useState({}),[r,a]=s.useState({}),b=s.useCallback((f,c)=>{t(d=>({...d,[f]:!0})),c&&a(d=>({...d,[f]:c}))},[]),p=s.useCallback(f=>{t(c=>({...c,[f]:!1})),a(c=>{const d={...c};return delete d[f],d})},[]),u=s.useCallback(f=>!!n[f],[n]),i=s.useCallback(f=>r[f],[r]),g=s.useMemo(()=>({openModal:b,closeModal:p}),[b,p]),l=s.useMemo(()=>({isOpen:u,getModalData:i}),[u,i]);return o.jsx(ee.Provider,{value:g,children:o.jsx(te.Provider,{value:l,children:e})})}function Ee(e){const{openModal:n,closeModal:t}=z(),{isOpen:r,getModalData:a}=D();return{open:b=>n(e,b),close:()=>t(e),isOpen:r(e),data:a(e)}}let _=null,B={};function Le(e){_=e}function Oe(e){B={...B,...e}}function $e(){return B}function Me(e,n,t=3e3,r){_?_(e,n,t,r):console.warn("Toast system is not mounted")}function Pe(e){return R({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 je=()=>"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)}),Ie=()=>{const[e,n]=s.useState([]);s.useEffect(()=>{Le((r,a,b,p)=>{const u=je();n(i=>[...i,{id:u,type:r,message:a,config:p}]),setTimeout(()=>{n(i=>i.filter(g=>g.id!==u))},b)})},[]);const t=$e();return o.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(r=>{var i,g,l,f,c,d,y,m,w,v,N,k,E;const a=((i=r.config)==null?void 0:i.icon)||((g=t.icons)==null?void 0:g[r.type])||Ae(r.type),b=((l=r.config)==null?void 0:l.bgColor)||((c=(f=t.colors)==null?void 0:f[r.type])==null?void 0:c.bg)||"bg-white dark:bg-gray-800",p=((d=r.config)==null?void 0:d.textColor)||((m=(y=t.colors)==null?void 0:y[r.type])==null?void 0:m.text)||"text-gray-700 dark:text-gray-300",u=((w=r.config)==null?void 0:w.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 ${b} ${p}`,children:[o.jsx("div",{className:u,children:a}),o.jsxs("div",{className:"flex-1 me-3",children:[((v=r.config)==null?void 0:v.title)&&o.jsx("div",{className:"font-semibold text-black",children:r.config.title}),((N=r.config)==null?void 0:N.description)&&o.jsx("div",{className:"text-sm text-gray-500",children:r.config.description}),!((k=r.config)!=null&&k.title)&&!((E=r.config)!=null&&E.description)&&o.jsx("div",{className:"text-sm",children:r.message})]}),o.jsx("button",{onClick:()=>n(S=>S.filter(x=>x.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(Pe,{size:18})})]},r.id)})})};function Ae(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}h.Accordion=Se,h.Badge=pe,h.Button=ie,h.Dropdown=ce,h.Input=W,h.Modal=Ne,h.ModalProvider=ke,h.Select=X,h.Toast=Ie,h.Tooltip=de,h.setToastDefaults=Oe,h.showToast=Me,h.useModalActions=z,h.useModalInstance=Ee,h.useModalState=D,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(m,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],s):(m=typeof globalThis<"u"?globalThis:m||self,s(m.TailwindUiKit={},m.jsxRuntime,m.React))})(this,function(m,s,o){"use strict";"use client";const F={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"},Z={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},V={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"},R={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"},ee=(e,n,t)=>{if(t)return"border-red-500 bg-red-50 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500";if(n)return"border-green-500 bg-green-50 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500";switch(e){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=o.forwardRef((e,n)=>{const{label:t,id:r,inputSize:a="md",shape:g="rounded",validate:b,onValidatedChange:u,className:i="",icon:p,iconPosition:l="left",floatingLabelStyle:f,onChange:c,isValid:d,isInvalid:h,feedback:y,feedbackType:w="invalid",...v}=e,[k,N]=o.useState("default"),$=o.useCallback(M=>{const B=M.target.value,O=(b==null?void 0:b(B))??"default";N(O),u==null||u(M,O),c==null||c(M)},[b,u,c]),C=o.useMemo(()=>r||(typeof t=="string"?`input-${t.toLowerCase().replace(/\s+/g,"-")}`:`input-${Math.random().toString(36).slice(2)}`),[r,t]),x=!!f,S=F[a]||F.md,E=Z[g]||Z.flat,L=o.useMemo(()=>ee(k,d,h),[k,d,h]),D=o.useMemo(()=>l==="start"||l==="left"?"left-0 ps-3.5":"right-0 pe-3.5",[l]),_=o.useMemo(()=>p?l==="start"||l==="left"?"ps-10":"pe-10":"",[p,l]);return s.jsxs("div",{className:`w-full relative ${x?"z-0":""}`,children:[!x&&t&&s.jsx("label",{htmlFor:C,className:`block mb-1 text-sm ${d?"text-green-700 dark:text-green-500":h?"text-red-700 dark:text-red-500":"text-gray-700"}`,children:t}),s.jsxs("div",{className:"relative w-full",children:[p&&s.jsx("div",{className:`absolute inset-y-0 flex items-center ${D}`,"aria-hidden":"true",children:s.jsx("span",{className:"text-gray-500",children:p})}),s.jsx("input",{...v,id:C,ref:n,placeholder:x?" ":v.placeholder,onChange:$,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
|
|
2
|
+
${S}
|
|
3
|
+
${x&&f&&V[f]}
|
|
4
|
+
${_} ${E} ${L} ${i}`}),x&&t&&f&&s.jsx("label",{htmlFor:C,className:`ms-1 ${R[f]} ${i}`,children:t})]}),y&&s.jsx("p",{className:`mt-1 text-xs ${w==="invalid"?"text-red-600 dark:text-red-500":"text-green-600 dark:text-green-500"}`,role:w==="invalid"?"alert":void 0,children:y})]})});G.displayName="Input";const te={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"},re={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full"},ne={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"},se={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"},oe=(e,n,t)=>{if(t)return"border-red-500 bg-red-50 text-red-900 focus:ring-red-500 focus:border-red-500";if(n)return"border-green-500 bg-green-50 text-green-900 focus:ring-green-500 focus:border-green-500";const r="focus:ring focus:border";switch(e){case"error":return`${r}-red-500 border-red-500 bg-red-50`;case"warning":return`${r}-yellow-500 border-yellow-500 bg-yellow-50`;case"success":return`${r}-green-500 border-green-500 bg-green-50`;default:return"border-gray-300 focus:ring-blue-500"}},q=o.forwardRef((e,n)=>{const{label:t,id:r,inputSize:a="md",shape:g="rounded",validate:b,onValidatedChange:u,className:i="",icon:p,iconPosition:l="left",floatingLabelStyle:f,onChange:c,isValid:d,isInvalid:h,feedback:y,feedbackType:w="invalid",children:v,...k}=e,[N,$]=o.useState("default"),C=o.useId(),x=o.useMemo(()=>r||(typeof t=="string"?`select-${t.toLowerCase().replace(/\s+/g,"-")}`:C),[r,t,C]),S=O=>{const ze=O.target.value,Q=(b==null?void 0:b(ze))??"default";$(Q),u==null||u(O,Q),c==null||c(O)},E=!!f,L=te[a],D=re[g],_=oe(N,d,h),M=p&&(l==="start"||l==="left")?"ps-10":p?"pe-10":"",B=l==="start"||l==="left"?"left-0 ps-3.5":"right-0 pe-3.5";return s.jsxs("div",{className:`w-full relative ${E?"z-0":""}`,children:[!E&&t&&s.jsx("label",{htmlFor:x,className:`block mb-1 text-sm ${d?"text-green-700":h?"text-red-700":"text-gray-700"}`,children:t}),s.jsxs("div",{className:"relative w-full",children:[p&&s.jsx("div",{className:`absolute inset-y-0 flex items-center ${B}`,children:s.jsx("span",{className:"text-gray-500",children:p})}),s.jsx("select",{...k,id:x,ref:n,onChange:S,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
|
|
5
|
+
${L} ${M}
|
|
6
|
+
${E&&f&&ne[f]}
|
|
7
|
+
${D} ${_} ${i}`,children:v}),E&&t&&f&&s.jsx("label",{htmlFor:x,className:`ms-1 ${se[f]} ${i}`,children:t})]}),y&&s.jsx("p",{className:`mt-1 text-xs ${w==="invalid"?"text-red-600":"text-green-600"}`,children:y})]})});q.displayName="Select";const le={primary:"btn-primary",secondary:"btn-secondary",success:"btn-success",danger:"btn-danger",warning:"btn-warning",info:"btn-info",dark:"btn-dark",light:"btn-light",link:"btn-link","outline-primary":"btn-outline-primary","outline-secondary":"btn-outline-secondary","outline-success":"btn-outline-success","outline-danger":"btn-outline-danger","outline-warning":"btn-outline-warning","outline-info":"btn-outline-info","outline-dark":"btn-outline-dark","outline-light":"btn-outline-light","soft-primary":"btn-soft-primary","soft-secondary":"btn-soft-secondary","soft-success":"btn-soft-success","soft-danger":"btn-soft-danger","soft-warning":"btn-soft-warning","soft-info":"btn-soft-info","soft-dark":"btn-soft-dark","soft-light":"btn-soft-light"},ae={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"},ie={flat:"shadow-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full w-10 h-10 p-0 flex items-center justify-center"},ce=({children:e,variant:n="primary",size:t="md",type:r="button",shape:a="rounded",className:g="",isLoading:b=!1,disabled:u=!1,...i})=>{const p=u||b,l=["inline-flex items-center justify-center font-normal transition duration-150 cursor-pointer",le[n],ae[t],ie[a],a==="flat"?"shadow-none":"shadow-sm",p?"opacity-50 cursor-not-allowed pointer-events-none":"",g].filter(Boolean).join(" ");return s.jsxs("button",{type:r,className:l,disabled:p,...i,children:[b&&s.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:[s.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"}),s.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]})},de=({label:e,children:n,position:t="right"})=>{const[r,a]=o.useState(!1),[g,b]=o.useState(!1),u=o.useRef(null),i=o.useRef(null),p=o.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]),l=o.useCallback(d=>{const h=d.target;u.current&&!u.current.contains(h)&&i.current&&!i.current.contains(h)&&a(!1)},[]),f=o.useCallback(()=>{if(!i.current||!u.current)return;const d=i.current.getBoundingClientRect(),h=u.current.getBoundingClientRect(),y=window.innerHeight-d.bottom,w=d.top;b(y<h.height&&w>h.height)},[]);o.useEffect(()=>{if(r)return f(),window.addEventListener("resize",f),window.addEventListener("scroll",f,!0),()=>{window.removeEventListener("resize",f),window.removeEventListener("scroll",f,!0)}},[r,f]),o.useEffect(()=>(document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)),[l]);const c=o.useCallback(()=>a(d=>!d),[]);return s.jsxs("div",{className:"relative flex items-center",children:[s.jsx("button",{ref:i,onClick:c,children:e}),r&&s.jsx("div",{ref:u,className:`absolute z-10 bg-white rounded-sm shadow-md overflow-hidden
|
|
8
|
+
${g?"bottom-full mb-2":"top-full mt-2"}
|
|
9
|
+
${p}`,children:n})]})},ue=({children:e,content:n,position:t="top",className:r="",tooltipClass:a="",tooltipStyle:g={}})=>{const b=o.useRef(null),u=o.useRef(null);o.useEffect(()=>{const p=b.current,l=u.current;if(!p||!l)return;const f=()=>{l.style.opacity="1",l.style.visibility="visible"},c=()=>{l.style.opacity="0",l.style.visibility="hidden"};return p.addEventListener("mouseenter",f),p.addEventListener("mouseleave",c),()=>{p.removeEventListener("mouseenter",f),p.removeEventListener("mouseleave",c)}},[]);const i=p=>{const l={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(p){case"top":return{...l,bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};case"bottom":return{...l,top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"left":return{...l,right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"right":return{...l,left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};default:return l}};return s.jsxs("div",{ref:b,className:`relative inline-block ${r}`,children:[e,s.jsx("div",{ref:u,role:"tooltip",className:a,style:{...i(t),...g},children:n})]})},fe={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"},pe={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"},be={flat:"rounded-none",rounded:"rounded-sm",pill:"rounded-full",circle:"rounded-full p-2 w-8 h-8 justify-center"},ge=({label:e,variant:n="primary",size:t="sm",shape:r="rounded",icon:a,dismissible:g,onDismiss:b,className:u="",...i})=>{const p=!e&&!!a,l=`inline-flex items-center font-medium ${fe[n]||""} ${pe[t]||""} ${be[r]||""} ${p?"justify-center p-2 w-8 h-8":""} `+u;return s.jsxs("span",{className:l.trim(),...i,children:[a&&s.jsx("span",{className:e?"mr-1":"",children:a}),e,g&&s.jsx("button",{type:"button",onClick:b,className:"ml-2 text-xs font-bold leading-none focus:outline-none",children:"×"})]})};var H={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},K=o.createContext&&o.createContext(H),xe=["attr","size","title"];function me(e,n){if(e==null)return{};var t=he(e,n),r,a;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(e);for(a=0;a<g.length;a++)r=g[a],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}function he(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 U(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,r)}return t}function j(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?U(Object(t),!0).forEach(function(r){ye(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):U(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function ye(e,n,t){return n=we(n),n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function we(e){var n=ve(e,"string");return typeof n=="symbol"?n:n+""}function ve(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 W(e){return e&&e.map((n,t)=>o.createElement(n.tag,j({key:t},n.attr),W(n.child)))}function X(e){return n=>o.createElement(Ce,P({attr:j({},e.attr)},n),W(e.child))}function Ce(e){var n=t=>{var{attr:r,size:a,title:g}=e,b=me(e,xe),u=a||t.size||"1em",i;return t.className&&(i=t.className),e.className&&(i=(i?i+" ":"")+e.className),o.createElement("svg",P({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,r,b,{className:i,style:j(j({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),g&&o.createElement("title",null,g),e.children)};return K!==void 0?o.createElement(K.Consumer,null,t=>n(t)):n(H)}function Se(e){return X({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(e)}const ke=({items:e,allowMultipleOpen:n=!1,className:t="",tileClasses:r="",open:a,onChange:g,renderTitle:b,renderContent:u})=>{const[i,p]=o.useState(new Set),l=o.useMemo(()=>a?new Set(a):i,[a,i]),f=o.useCallback(c=>{const d=new Set(l);d.has(c)?d.delete(c):(n||d.clear(),d.add(c)),a&&g?g(Array.from(d)):p(d)},[l,a,g,n]);return s.jsx("div",{className:"accordion",role:"region","aria-multiselectable":n,children:e.map(c=>{const d=l.has(c.id),h=`accordion-heading-${c.id}`,y=`accordion-panel-${c.id}`;return s.jsxs("div",{className:`accordion-item border rounded border-gray-300 dark:border-gray-700 ${t}`,children:[s.jsxs("button",{id:h,type:"button","aria-expanded":d,"aria-controls":y,onClick:()=>f(c.id),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}`,children:[b?b(c,d):c.title,s.jsx(Se,{})]}),s.jsx("div",{id:y,role:"region","aria-labelledby":h,hidden:!d,className:"p-4 border-t border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-400",children:u?u(c,d):c.content})]},c.id)})})},Y=o.createContext(null),I=()=>{const e=o.useContext(Y);if(!e)throw new Error("useModalActions must be used within a ModalActionProvider");return e},J=o.createContext(null),A=()=>o.useContext(J);function Ne({id:e,title:n,children:t,standalone:r=!1,showFloatingClose:a=!1,containerClasses:g="",onClose:b,disableEscapeClose:u=!1}){const i=A(),p=I(),l=!r&&!!i&&!!p,[f,c]=o.useState(!1),d=l?i.isOpen(e):f,h=l?i.getModalData(e):null,y=o.useCallback(()=>{l?p.closeModal(e):c(!1),b==null||b()},[l,p,e,b]);return o.useEffect(()=>{const w=document.activeElement;console.log(e);const v=document.getElementById(e);console.log("modalEl=",v);const k=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],N=()=>{if(!v)return[];const x=v.querySelectorAll(k.join(","));return Array.from(x).filter(S=>S.offsetParent!==null)},$=x=>{if(x.key==="Tab"){const S=N();if(S.length===0)return;const E=S[0],L=S[S.length-1];x.shiftKey?document.activeElement===E&&(x.preventDefault(),L.focus()):document.activeElement===L&&(x.preventDefault(),E.focus())}},C=x=>{x.key==="Escape"&&!u&&y(),$(x)};return d&&(document.body.style.overflow="hidden",setTimeout(()=>{const x=N();x.length&&x[0].focus()},0),window.addEventListener("keydown",C)),()=>{document.body.style.overflow="",w&&w.focus(),window.removeEventListener("keydown",C)}},[d,u,y,e]),d?s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-[2px]",id:e,children:s.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:[s.jsxs("div",{className:"flex justify-between items-center relative",children:[n&&s.jsx("h2",{className:"text-lg font-semibold",children:n}),a&&s.jsx("button",{onClick:y,className:"text-gray-500 hover:text-black absolute top-2 right-3 hover:bg-gray-200 rounded-full aspect-square w-8","aria-label":"Close modal",children:"✕"})]}),s.jsx("div",{className:"mt-3 text-sm text-gray-700",children:typeof t=="function"?t({modalData:h}):t})]})}):null}function Ee({children:e}){const[n,t]=o.useState({}),[r,a]=o.useState({}),g=o.useCallback((f,c)=>{t(d=>({...d,[f]:!0})),c&&a(d=>({...d,[f]:c}))},[]),b=o.useCallback(f=>{t(c=>({...c,[f]:!1})),a(c=>{const d={...c};return delete d[f],d})},[]),u=o.useCallback(f=>!!n[f],[n]),i=o.useCallback(f=>r[f],[r]),p=o.useMemo(()=>({openModal:g,closeModal:b}),[g,b]),l=o.useMemo(()=>({isOpen:u,getModalData:i}),[u,i]);return s.jsx(Y.Provider,{value:p,children:s.jsx(J.Provider,{value:l,children:e})})}function $e(e){const{openModal:n,closeModal:t}=I(),{isOpen:r,getModalData:a}=A();return{open:g=>n(e,g),close:()=>t(e),isOpen:r(e),data:a(e)}}let T=null,z={};function Le(e){T=e}function Oe(e){z={...z,...e}}function Me(){return z}function Pe(e,n,t=3e3,r){T?T(e,n,t,r):console.warn("Toast system is not mounted")}function je(e){return X({attr:{viewBox:"0 0 15 15",fill:"none"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor"},child:[]}]})(e)}const Ie=()=>"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)}),Ae=()=>{const[e,n]=o.useState([]);o.useEffect(()=>{Le((r,a,g,b)=>{const u=Ie();n(i=>[...i,{id:u,type:r,message:a,config:b}]),setTimeout(()=>{n(i=>i.filter(p=>p.id!==u))},g)})},[]);const t=Me();return s.jsx("div",{className:"fixed top-5 right-5 z-[9999] flex flex-col gap-2",children:e.map(r=>{var i,p,l,f,c,d,h,y,w,v,k,N,$;const a=((i=r.config)==null?void 0:i.icon)||((p=t.icons)==null?void 0:p[r.type])||Te(r.type),g=((l=r.config)==null?void 0:l.bgColor)||((c=(f=t.colors)==null?void 0:f[r.type])==null?void 0:c.bg)||"bg-white dark:bg-gray-800",b=((d=r.config)==null?void 0:d.textColor)||((y=(h=t.colors)==null?void 0:h[r.type])==null?void 0:y.text)||"text-gray-700 dark:text-gray-300",u=((w=r.config)==null?void 0:w.iconContainerClass)||"w-8 h-8 mr-3 text-xl flex items-center justify-center";return s.jsxs("div",{className:`flex items-center w-full max-w-xs p-4 text-sm rounded-lg shadow ${g} ${b}`,children:[s.jsx("div",{className:u,children:a}),s.jsxs("div",{className:"flex-1 me-3",children:[((v=r.config)==null?void 0:v.title)&&s.jsx("div",{className:"font-semibold text-black",children:r.config.title}),((k=r.config)==null?void 0:k.description)&&s.jsx("div",{className:"text-sm text-gray-500",children:r.config.description}),!((N=r.config)!=null&&N.title)&&!(($=r.config)!=null&&$.description)&&s.jsx("div",{className:"text-sm",children:r.message})]}),s.jsx("button",{onClick:()=>n(C=>C.filter(x=>x.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:s.jsx(je,{size:18})})]},r.id)})})};function Te(e){switch(e){case"success":return"✅";case"error":return"❌";case"warning":return"⚠️";case"info":return"ℹ️"}}m.Accordion=ke,m.Badge=ge,m.Button=ce,m.Dropdown=de,m.Input=G,m.Modal=Ne,m.ModalProvider=Ee,m.Select=q,m.Toast=Ae,m.Tooltip=ue,m.setToastDefaults=Oe,m.showToast=Pe,m.useModalActions=I,m.useModalInstance=$e,m.useModalState=A,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|