rharuow-ds 1.7.1 → 1.8.1
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/README.md +83 -2
- package/dist/rharuow-ds.cjs.js +1 -1
- package/dist/rharuow-ds.es.js +1087 -915
- package/dist/styles.css +1 -1
- package/dist/types/src/components/Accordion.d.ts +22 -0
- package/dist/types/src/components/Input.d.ts +1 -0
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/lib/cpf.utils.d.ts +18 -0
- package/dist/types/src/lib/index.d.ts +2 -0
- package/dist/types/src/stories/Accordion.stories.d.ts +18 -0
- package/dist/types/src/stories/InputCpf.stories.d.ts +7 -0
- package/package.json +5 -2
package/dist/rharuow-ds.es.js
CHANGED
|
@@ -1,672 +1,706 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
|
-
import
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
function
|
|
6
|
-
var
|
|
7
|
-
if (typeof t == "string" || typeof t == "number")
|
|
2
|
+
import o, { useState as le, useRef as pe, useEffect as be } from "react";
|
|
3
|
+
import { useFormContext as ce, useWatch as de } from "react-hook-form";
|
|
4
|
+
import { createPortal as he } from "react-dom";
|
|
5
|
+
function xe(t) {
|
|
6
|
+
var n, r, a = "";
|
|
7
|
+
if (typeof t == "string" || typeof t == "number") a += t;
|
|
8
8
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
9
|
-
var
|
|
10
|
-
for (
|
|
11
|
-
} else for (r in t) t[r] && (
|
|
12
|
-
return
|
|
9
|
+
var l = t.length;
|
|
10
|
+
for (n = 0; n < l; n++) t[n] && (r = xe(t[n])) && (a && (a += " "), a += r);
|
|
11
|
+
} else for (r in t) t[r] && (a && (a += " "), a += r);
|
|
12
|
+
return a;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
for (var t,
|
|
16
|
-
return
|
|
14
|
+
function Ae() {
|
|
15
|
+
for (var t, n, r = 0, a = "", l = arguments.length; r < l; r++) (t = arguments[r]) && (n = xe(t)) && (a && (a += " "), a += n);
|
|
16
|
+
return a;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function d(...t) {
|
|
19
|
+
return Ae(...t);
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const Xe = ({
|
|
22
22
|
children: t,
|
|
23
|
-
variant:
|
|
23
|
+
variant: n = "default",
|
|
24
24
|
className: r = "",
|
|
25
|
-
...
|
|
25
|
+
...a
|
|
26
26
|
}) => {
|
|
27
|
-
const
|
|
27
|
+
const l = "px-4 py-2 rounded font-medium transition", w = {
|
|
28
28
|
default: "bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",
|
|
29
29
|
outline: "border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",
|
|
30
30
|
secondary: "bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"
|
|
31
31
|
};
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
},
|
|
32
|
+
return /* @__PURE__ */ o.createElement("button", { className: d(l, w[n], r), ...a }, t);
|
|
33
|
+
}, we = (t) => t.replace(/\D/g, ""), Te = (t) => {
|
|
34
|
+
const r = we(t).slice(0, 11);
|
|
35
|
+
return r.length <= 3 ? r : r.length <= 6 ? `${r.slice(0, 3)}.${r.slice(3)}` : r.length <= 9 ? `${r.slice(0, 3)}.${r.slice(3, 6)}.${r.slice(6)}` : `${r.slice(0, 3)}.${r.slice(3, 6)}.${r.slice(6, 9)}-${r.slice(9, 11)}`;
|
|
36
|
+
}, ve = (t) => {
|
|
37
|
+
const n = we(t);
|
|
38
|
+
if (n.length !== 11 || /^(\d)\1{10}$/.test(n))
|
|
39
|
+
return !1;
|
|
40
|
+
let r = 0;
|
|
41
|
+
for (let l = 0; l < 9; l++)
|
|
42
|
+
r += parseInt(n.charAt(l)) * (10 - l);
|
|
43
|
+
let a = r * 10 % 11;
|
|
44
|
+
if ((a === 10 || a === 11) && (a = 0), a !== parseInt(n.charAt(9)))
|
|
45
|
+
return !1;
|
|
46
|
+
r = 0;
|
|
47
|
+
for (let l = 0; l < 10; l++)
|
|
48
|
+
r += parseInt(n.charAt(l)) * (11 - l);
|
|
49
|
+
return a = r * 10 % 11, (a === 10 || a === 11) && (a = 0), a === parseInt(n.charAt(10));
|
|
50
|
+
}, $e = e.forwardRef(
|
|
34
51
|
({
|
|
35
52
|
name: t,
|
|
36
|
-
className:
|
|
53
|
+
className: n,
|
|
37
54
|
type: r = "text",
|
|
38
|
-
label:
|
|
39
|
-
onFocus:
|
|
40
|
-
onBlur:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
label: a,
|
|
56
|
+
onFocus: l,
|
|
57
|
+
onBlur: w,
|
|
58
|
+
onChange: b,
|
|
59
|
+
Icon: M,
|
|
60
|
+
iconClassName: N,
|
|
61
|
+
iconAction: y,
|
|
62
|
+
containerClassName: f,
|
|
63
|
+
cpf: x = !1,
|
|
64
|
+
...c
|
|
65
|
+
}, I) => {
|
|
66
|
+
var _, P, q;
|
|
67
|
+
const [k, S] = e.useState(!1), [v, h] = e.useState(!1), [E, C] = e.useState(null), i = ce(), R = i == null ? void 0 : i.control, F = i == null ? void 0 : i.register, B = R && t ? de({ control: R, name: t }) : void 0, p = c.value ?? B ?? "", V = ((q = (P = (_ = i == null ? void 0 : i.formState) == null ? void 0 : _.errors) == null ? void 0 : P[t]) == null ? void 0 : q.message) || E, L = ["date", "datetime-local", "time", "month", "week"].includes(r), J = k || !!p || L, Z = r === "password" ? v ? "text" : "password" : r, G = () => /* @__PURE__ */ e.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement(
|
|
49
68
|
"path",
|
|
50
69
|
{
|
|
51
70
|
d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",
|
|
52
71
|
fill: "currentColor"
|
|
53
72
|
}
|
|
54
|
-
)),
|
|
73
|
+
)), W = () => /* @__PURE__ */ e.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement(
|
|
55
74
|
"path",
|
|
56
75
|
{
|
|
57
76
|
d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",
|
|
58
77
|
fill: "currentColor"
|
|
59
78
|
}
|
|
60
|
-
)),
|
|
61
|
-
|
|
79
|
+
)), $ = () => {
|
|
80
|
+
h(!v);
|
|
81
|
+
}, X = (z) => {
|
|
82
|
+
if (x) {
|
|
83
|
+
const Y = z.target.value, j = Te(Y);
|
|
84
|
+
z.target.value = j, j.length === 14 ? ve(j) ? C(null) : C("CPF inválido") : C(null);
|
|
85
|
+
}
|
|
86
|
+
b && b(z);
|
|
62
87
|
};
|
|
63
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
88
|
+
return /* @__PURE__ */ e.createElement("div", { className: d("relative", f) }, /* @__PURE__ */ e.createElement(
|
|
64
89
|
"input",
|
|
65
90
|
{
|
|
66
|
-
id:
|
|
67
|
-
type:
|
|
68
|
-
className:
|
|
91
|
+
id: c.id || t,
|
|
92
|
+
type: Z,
|
|
93
|
+
className: d(
|
|
69
94
|
"peer flex h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50",
|
|
70
|
-
r === "password" ||
|
|
95
|
+
r === "password" || M ? "pr-12" : "",
|
|
71
96
|
// espaço extra para qualquer ícone (password ou customizado)
|
|
72
|
-
|
|
97
|
+
V ? "border-red-500" : "",
|
|
98
|
+
n
|
|
73
99
|
),
|
|
74
|
-
onFocus: (
|
|
75
|
-
|
|
100
|
+
onFocus: (z) => {
|
|
101
|
+
S(!0), l && l(z);
|
|
76
102
|
},
|
|
77
|
-
|
|
78
|
-
|
|
103
|
+
maxLength: x ? 14 : c.maxLength,
|
|
104
|
+
inputMode: x ? "numeric" : c.inputMode,
|
|
105
|
+
...i && t ? (() => {
|
|
106
|
+
const z = F(t, x ? {
|
|
107
|
+
validate: (D) => D ? D.length < 14 ? "CPF incompleto" : ve(D) ? !0 : "CPF inválido" : "CPF é obrigatório"
|
|
108
|
+
} : void 0), Y = z.onBlur, j = z.onChange;
|
|
79
109
|
return {
|
|
80
|
-
...
|
|
81
|
-
ref: (
|
|
82
|
-
typeof
|
|
110
|
+
...z,
|
|
111
|
+
ref: (D) => {
|
|
112
|
+
typeof I == "function" ? I(D) : I && (I.current = D), z.ref && z.ref(D);
|
|
83
113
|
},
|
|
84
|
-
onBlur: (
|
|
85
|
-
|
|
114
|
+
onBlur: (D) => {
|
|
115
|
+
S(!1), w && w(D), Y && Y(D);
|
|
116
|
+
},
|
|
117
|
+
onChange: (D) => {
|
|
118
|
+
X(D), j && j(D);
|
|
86
119
|
}
|
|
87
120
|
};
|
|
88
121
|
})() : {
|
|
89
|
-
ref:
|
|
90
|
-
onBlur: (
|
|
91
|
-
|
|
92
|
-
}
|
|
122
|
+
ref: I,
|
|
123
|
+
onBlur: (z) => {
|
|
124
|
+
S(!1), w && w(z);
|
|
125
|
+
},
|
|
126
|
+
onChange: X
|
|
93
127
|
},
|
|
94
|
-
...
|
|
128
|
+
...c
|
|
95
129
|
}
|
|
96
|
-
),
|
|
130
|
+
), a && /* @__PURE__ */ e.createElement(
|
|
97
131
|
"label",
|
|
98
132
|
{
|
|
99
|
-
htmlFor:
|
|
100
|
-
className:
|
|
133
|
+
htmlFor: c.id || t,
|
|
134
|
+
className: d(
|
|
101
135
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
102
|
-
|
|
136
|
+
J ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
103
137
|
)
|
|
104
138
|
},
|
|
105
|
-
|
|
139
|
+
a
|
|
106
140
|
), r === "password" && /* @__PURE__ */ e.createElement(
|
|
107
141
|
"button",
|
|
108
142
|
{
|
|
109
143
|
type: "button",
|
|
110
144
|
className: "absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 hover:text-[var(--primary,#2563eb)] transition-colors duration-200 focus:outline-none focus:text-[var(--primary,#2563eb)]",
|
|
111
|
-
onClick:
|
|
112
|
-
"aria-label":
|
|
145
|
+
onClick: $,
|
|
146
|
+
"aria-label": v ? "Esconder senha" : "Mostrar senha",
|
|
113
147
|
tabIndex: -1
|
|
114
148
|
},
|
|
115
|
-
|
|
116
|
-
),
|
|
149
|
+
v ? /* @__PURE__ */ e.createElement(W, null) : /* @__PURE__ */ e.createElement(G, null)
|
|
150
|
+
), M && r !== "password" && /* @__PURE__ */ e.createElement(
|
|
117
151
|
"div",
|
|
118
152
|
{
|
|
119
|
-
className:
|
|
153
|
+
className: d(
|
|
120
154
|
"absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",
|
|
121
|
-
|
|
155
|
+
N
|
|
122
156
|
),
|
|
123
|
-
onClick:
|
|
157
|
+
onClick: y
|
|
124
158
|
},
|
|
125
|
-
/* @__PURE__ */ e.createElement(
|
|
126
|
-
),
|
|
159
|
+
/* @__PURE__ */ e.createElement(M, null)
|
|
160
|
+
), V && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, V));
|
|
127
161
|
}
|
|
128
162
|
);
|
|
129
|
-
|
|
130
|
-
const
|
|
163
|
+
$e.displayName = "Input";
|
|
164
|
+
const ze = e.forwardRef(
|
|
131
165
|
({
|
|
132
166
|
name: t,
|
|
133
|
-
label:
|
|
167
|
+
label: n,
|
|
134
168
|
options: r,
|
|
135
|
-
className:
|
|
136
|
-
containerClassName:
|
|
137
|
-
isClearable:
|
|
138
|
-
searchable:
|
|
139
|
-
filterPlaceholder:
|
|
140
|
-
caseSensitive:
|
|
141
|
-
filterFunction:
|
|
142
|
-
onFocus:
|
|
143
|
-
onBlur:
|
|
144
|
-
...
|
|
145
|
-
},
|
|
146
|
-
var
|
|
147
|
-
const [
|
|
169
|
+
className: a,
|
|
170
|
+
containerClassName: l,
|
|
171
|
+
isClearable: w,
|
|
172
|
+
searchable: b = !1,
|
|
173
|
+
filterPlaceholder: M = "Digite para filtrar...",
|
|
174
|
+
caseSensitive: N = !1,
|
|
175
|
+
filterFunction: y,
|
|
176
|
+
onFocus: f,
|
|
177
|
+
onBlur: x,
|
|
178
|
+
...c
|
|
179
|
+
}, I) => {
|
|
180
|
+
var re, ne, u, T;
|
|
181
|
+
const [k, S] = e.useState(!1), [v, h] = e.useState(!1), [E, C] = e.useState(""), [i, R] = e.useState({
|
|
148
182
|
top: 0,
|
|
149
183
|
left: 0,
|
|
150
184
|
width: 0
|
|
151
|
-
}),
|
|
152
|
-
const
|
|
153
|
-
return
|
|
154
|
-
}), W =
|
|
155
|
-
if (
|
|
156
|
-
const
|
|
157
|
-
let
|
|
158
|
-
if (
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
|
|
185
|
+
}), F = e.useRef(null), B = e.useRef(null), p = ce(), V = p == null ? void 0 : p.control, U = V && t ? de({ control: V, name: t }) : void 0, L = c.value ?? U ?? "", J = (u = (ne = (re = p == null ? void 0 : p.formState) == null ? void 0 : re.errors) == null ? void 0 : ne[t]) == null ? void 0 : u.message, G = y || ((s, O) => {
|
|
186
|
+
const K = N ? s.label : s.label.toLowerCase(), te = N ? O : O.toLowerCase();
|
|
187
|
+
return K.includes(te);
|
|
188
|
+
}), W = E.trim() ? r.filter((s) => G(s, E.trim())) : r, $ = r.find((s) => s.value === L), X = b && v ? E : ($ == null ? void 0 : $.label) || "", _ = k || !!L || b && !!E, P = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), q = e.useCallback(() => {
|
|
189
|
+
if (F.current && v) {
|
|
190
|
+
const s = F.current.getBoundingClientRect(), O = P(), K = window.innerHeight, te = window.innerWidth, Q = 152;
|
|
191
|
+
let g = s.bottom + 4, H = s.left;
|
|
192
|
+
if (O) {
|
|
193
|
+
const ae = K - s.bottom, m = s.top;
|
|
194
|
+
ae < Q && m > Q && (g = s.top - Q - 4);
|
|
195
|
+
const A = 16, ee = te - s.width - A;
|
|
196
|
+
H = Math.min(Math.max(H, A), ee);
|
|
163
197
|
} else
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
top:
|
|
167
|
-
left:
|
|
168
|
-
width:
|
|
198
|
+
K - s.bottom < Q && (g = s.top - Q - 4);
|
|
199
|
+
R({
|
|
200
|
+
top: g,
|
|
201
|
+
left: H,
|
|
202
|
+
width: s.width
|
|
169
203
|
});
|
|
170
204
|
}
|
|
171
|
-
}, [
|
|
205
|
+
}, [v, P]);
|
|
172
206
|
e.useEffect(() => {
|
|
173
|
-
if (
|
|
174
|
-
const
|
|
175
|
-
return window.addEventListener("resize",
|
|
176
|
-
window.removeEventListener("resize",
|
|
207
|
+
if (q(), v) {
|
|
208
|
+
const s = () => q(), O = () => q();
|
|
209
|
+
return window.addEventListener("resize", s), window.addEventListener("scroll", O, !0), () => {
|
|
210
|
+
window.removeEventListener("resize", s), window.removeEventListener("scroll", O, !0);
|
|
177
211
|
};
|
|
178
212
|
}
|
|
179
|
-
}, [
|
|
180
|
-
const
|
|
181
|
-
|
|
213
|
+
}, [v, q]), e.useEffect(() => {
|
|
214
|
+
const s = (O) => {
|
|
215
|
+
F.current && !F.current.contains(O.target) && (h(!1), S(!1));
|
|
182
216
|
};
|
|
183
|
-
return document.addEventListener("mousedown",
|
|
184
|
-
document.removeEventListener("mousedown",
|
|
217
|
+
return document.addEventListener("mousedown", s), () => {
|
|
218
|
+
document.removeEventListener("mousedown", s);
|
|
185
219
|
};
|
|
186
220
|
}, []);
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
}, oe = (
|
|
196
|
-
if (
|
|
197
|
-
const
|
|
198
|
-
target: { value:
|
|
221
|
+
const z = () => {
|
|
222
|
+
h((s) => !s), S(!0);
|
|
223
|
+
}, Y = (s) => {
|
|
224
|
+
S(!0), f && f(s);
|
|
225
|
+
}, j = (s) => {
|
|
226
|
+
x && x(s);
|
|
227
|
+
}, D = (s) => {
|
|
228
|
+
C(s.target.value);
|
|
229
|
+
}, oe = (s) => {
|
|
230
|
+
if (p && t && p.setValue(t, s), c.onChange) {
|
|
231
|
+
const O = {
|
|
232
|
+
target: { value: s }
|
|
199
233
|
};
|
|
200
|
-
|
|
234
|
+
c.onChange(O);
|
|
201
235
|
}
|
|
202
|
-
|
|
236
|
+
h(!1), S(!1), C("");
|
|
203
237
|
};
|
|
204
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
238
|
+
return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: F }, /* @__PURE__ */ e.createElement(
|
|
205
239
|
"div",
|
|
206
240
|
{
|
|
207
|
-
id:
|
|
241
|
+
id: c.id || t,
|
|
208
242
|
tabIndex: 0,
|
|
209
243
|
role: "button",
|
|
210
244
|
"aria-haspopup": "listbox",
|
|
211
|
-
"aria-expanded":
|
|
212
|
-
className:
|
|
245
|
+
"aria-expanded": v,
|
|
246
|
+
className: d(
|
|
213
247
|
"peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
|
|
214
|
-
|
|
248
|
+
a
|
|
215
249
|
),
|
|
216
|
-
onClick:
|
|
217
|
-
onFocus:
|
|
218
|
-
onBlur:
|
|
219
|
-
ref:
|
|
250
|
+
onClick: b ? void 0 : z,
|
|
251
|
+
onFocus: b ? void 0 : Y,
|
|
252
|
+
onBlur: b ? void 0 : j,
|
|
253
|
+
ref: I
|
|
220
254
|
},
|
|
221
|
-
|
|
255
|
+
b ? /* @__PURE__ */ e.createElement(
|
|
222
256
|
"input",
|
|
223
257
|
{
|
|
224
|
-
ref:
|
|
258
|
+
ref: B,
|
|
225
259
|
type: "text",
|
|
226
|
-
value:
|
|
227
|
-
onChange:
|
|
228
|
-
onFocus:
|
|
229
|
-
|
|
260
|
+
value: X,
|
|
261
|
+
onChange: D,
|
|
262
|
+
onFocus: b ? (s) => {
|
|
263
|
+
S(!0), h(!0), f && f(s);
|
|
230
264
|
} : void 0,
|
|
231
|
-
onBlur:
|
|
232
|
-
|
|
265
|
+
onBlur: b ? (s) => {
|
|
266
|
+
x && x(s);
|
|
233
267
|
} : void 0,
|
|
234
|
-
placeholder:
|
|
235
|
-
className:
|
|
268
|
+
placeholder: n ? "" : M || "Selecione...",
|
|
269
|
+
className: d(
|
|
236
270
|
"w-full bg-transparent border-none outline-none text-sm",
|
|
237
|
-
!
|
|
271
|
+
!L && !E && "text-gray-400"
|
|
238
272
|
)
|
|
239
273
|
}
|
|
240
|
-
) : /* @__PURE__ */ e.createElement("span", { className:
|
|
241
|
-
|
|
274
|
+
) : /* @__PURE__ */ e.createElement("span", { className: d("block truncate", !L && "text-gray-400") }, ((T = r.find((s) => s.value === L)) == null ? void 0 : T.label) || !n && "Selecione..."),
|
|
275
|
+
w && L && /* @__PURE__ */ e.createElement(
|
|
242
276
|
"button",
|
|
243
277
|
{
|
|
244
278
|
type: "button",
|
|
245
279
|
tabIndex: -1,
|
|
246
280
|
"aria-label": "Limpar seleção",
|
|
247
281
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
|
|
248
|
-
onClick: (
|
|
249
|
-
if (
|
|
250
|
-
const
|
|
282
|
+
onClick: (s) => {
|
|
283
|
+
if (s.stopPropagation(), p && t && p.setValue(t, ""), c.onChange) {
|
|
284
|
+
const O = {
|
|
251
285
|
target: { value: "" }
|
|
252
286
|
};
|
|
253
|
-
|
|
287
|
+
c.onChange(O);
|
|
254
288
|
}
|
|
255
|
-
|
|
289
|
+
h(!1), S(!1);
|
|
256
290
|
}
|
|
257
291
|
},
|
|
258
292
|
"✕"
|
|
259
293
|
)
|
|
260
|
-
),
|
|
294
|
+
), n && /* @__PURE__ */ e.createElement(
|
|
261
295
|
"label",
|
|
262
296
|
{
|
|
263
|
-
htmlFor:
|
|
264
|
-
className:
|
|
297
|
+
htmlFor: c.id || t,
|
|
298
|
+
className: d(
|
|
265
299
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
266
|
-
|
|
300
|
+
_ ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
267
301
|
)
|
|
268
302
|
},
|
|
269
|
-
|
|
303
|
+
n
|
|
270
304
|
), /* @__PURE__ */ e.createElement(
|
|
271
305
|
"div",
|
|
272
306
|
{
|
|
273
|
-
className:
|
|
307
|
+
className: d(
|
|
274
308
|
"absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
|
|
275
309
|
"bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
|
|
276
|
-
|
|
310
|
+
v ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
|
|
277
311
|
),
|
|
278
312
|
style: {
|
|
279
|
-
maxHeight:
|
|
313
|
+
maxHeight: v ? "9.5rem" : "0",
|
|
280
314
|
// 3 options * 2.5rem + padding
|
|
281
315
|
overflowY: r.length > 3 ? "auto" : "hidden",
|
|
282
316
|
position: "fixed",
|
|
283
317
|
// Use fixed positioning to escape container overflow
|
|
284
|
-
top:
|
|
285
|
-
left:
|
|
286
|
-
width:
|
|
318
|
+
top: v ? `${i.top}px` : "auto",
|
|
319
|
+
left: v ? `${i.left}px` : "auto",
|
|
320
|
+
width: v ? `${i.width}px` : "auto",
|
|
287
321
|
zIndex: 9999,
|
|
288
|
-
boxShadow:
|
|
322
|
+
boxShadow: v ? "var(--select-dropdown-shadow)" : "none"
|
|
289
323
|
}
|
|
290
324
|
},
|
|
291
|
-
W.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : W.map((
|
|
325
|
+
W.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : W.map((s) => /* @__PURE__ */ e.createElement(
|
|
292
326
|
"div",
|
|
293
327
|
{
|
|
294
|
-
key:
|
|
295
|
-
className:
|
|
328
|
+
key: s.value,
|
|
329
|
+
className: d(
|
|
296
330
|
"px-3 py-2 cursor-pointer text-sm transition-colors duration-150",
|
|
297
331
|
"hover:bg-[var(--select-dropdown-hover)]",
|
|
298
|
-
|
|
332
|
+
L === s.value && "bg-[var(--select-dropdown-selected)]"
|
|
299
333
|
),
|
|
300
|
-
onMouseDown: () => oe(
|
|
334
|
+
onMouseDown: () => oe(s.value)
|
|
301
335
|
},
|
|
302
|
-
|
|
336
|
+
s.label
|
|
303
337
|
))
|
|
304
|
-
),
|
|
338
|
+
), J && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, J));
|
|
305
339
|
}
|
|
306
340
|
);
|
|
307
|
-
|
|
308
|
-
const
|
|
341
|
+
ze.displayName = "Select";
|
|
342
|
+
const Oe = e.forwardRef(
|
|
309
343
|
({
|
|
310
344
|
name: t,
|
|
311
|
-
className:
|
|
345
|
+
className: n,
|
|
312
346
|
label: r,
|
|
313
|
-
onFocus:
|
|
314
|
-
onBlur:
|
|
315
|
-
Icon:
|
|
316
|
-
iconClassName:
|
|
317
|
-
iconAction:
|
|
318
|
-
containerClassName:
|
|
319
|
-
rows:
|
|
320
|
-
...
|
|
321
|
-
},
|
|
322
|
-
var
|
|
323
|
-
const [
|
|
324
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
347
|
+
onFocus: a,
|
|
348
|
+
onBlur: l,
|
|
349
|
+
Icon: w,
|
|
350
|
+
iconClassName: b,
|
|
351
|
+
iconAction: M,
|
|
352
|
+
containerClassName: N,
|
|
353
|
+
rows: y = 4,
|
|
354
|
+
...f
|
|
355
|
+
}, x) => {
|
|
356
|
+
var R, F, B;
|
|
357
|
+
const [c, I] = e.useState(!1), k = ce(), S = k == null ? void 0 : k.control, v = k == null ? void 0 : k.register, h = S && t ? de({ control: S, name: t }) : void 0, E = f.value ?? h ?? "", C = (B = (F = (R = k == null ? void 0 : k.formState) == null ? void 0 : R.errors) == null ? void 0 : F[t]) == null ? void 0 : B.message, i = c || !!E;
|
|
358
|
+
return /* @__PURE__ */ e.createElement("div", { className: d("relative", N) }, /* @__PURE__ */ e.createElement(
|
|
325
359
|
"textarea",
|
|
326
360
|
{
|
|
327
|
-
id:
|
|
328
|
-
rows:
|
|
329
|
-
className:
|
|
361
|
+
id: f.id || t,
|
|
362
|
+
rows: y,
|
|
363
|
+
className: d(
|
|
330
364
|
"peer flex min-h-[80px] w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 resize-vertical",
|
|
331
|
-
|
|
365
|
+
w ? "pr-12" : "",
|
|
332
366
|
// espaço extra para ícone customizado
|
|
333
|
-
|
|
367
|
+
n
|
|
334
368
|
),
|
|
335
|
-
onFocus: (
|
|
336
|
-
|
|
369
|
+
onFocus: (p) => {
|
|
370
|
+
I(!0), a && a(p);
|
|
337
371
|
},
|
|
338
|
-
...
|
|
339
|
-
const
|
|
372
|
+
...k && t ? (() => {
|
|
373
|
+
const p = v(t), V = p.onBlur;
|
|
340
374
|
return {
|
|
341
|
-
...
|
|
342
|
-
ref: (
|
|
343
|
-
typeof
|
|
375
|
+
...p,
|
|
376
|
+
ref: (U) => {
|
|
377
|
+
typeof x == "function" ? x(U) : x && (x.current = U), p.ref && p.ref(U);
|
|
344
378
|
},
|
|
345
|
-
onBlur: (
|
|
346
|
-
|
|
379
|
+
onBlur: (U) => {
|
|
380
|
+
I(!1), l && l(U), V && V(U);
|
|
347
381
|
}
|
|
348
382
|
};
|
|
349
383
|
})() : {
|
|
350
|
-
ref:
|
|
351
|
-
onBlur: (
|
|
352
|
-
|
|
384
|
+
ref: x,
|
|
385
|
+
onBlur: (p) => {
|
|
386
|
+
I(!1), l && l(p);
|
|
353
387
|
}
|
|
354
388
|
},
|
|
355
|
-
...
|
|
389
|
+
...f
|
|
356
390
|
}
|
|
357
391
|
), r && /* @__PURE__ */ e.createElement(
|
|
358
392
|
"label",
|
|
359
393
|
{
|
|
360
|
-
htmlFor:
|
|
361
|
-
className:
|
|
394
|
+
htmlFor: f.id || t,
|
|
395
|
+
className: d(
|
|
362
396
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
363
|
-
|
|
397
|
+
i ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
364
398
|
)
|
|
365
399
|
},
|
|
366
400
|
r
|
|
367
|
-
),
|
|
401
|
+
), w && /* @__PURE__ */ e.createElement(
|
|
368
402
|
"div",
|
|
369
403
|
{
|
|
370
|
-
className:
|
|
404
|
+
className: d(
|
|
371
405
|
"absolute top-3 right-3 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",
|
|
372
|
-
|
|
406
|
+
b
|
|
373
407
|
),
|
|
374
|
-
onClick:
|
|
408
|
+
onClick: M
|
|
375
409
|
},
|
|
376
|
-
/* @__PURE__ */ e.createElement(
|
|
377
|
-
),
|
|
410
|
+
/* @__PURE__ */ e.createElement(w, null)
|
|
411
|
+
), C && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, C));
|
|
378
412
|
}
|
|
379
413
|
);
|
|
380
|
-
|
|
381
|
-
const
|
|
414
|
+
Oe.displayName = "Textarea";
|
|
415
|
+
const We = e.forwardRef(
|
|
382
416
|
({
|
|
383
417
|
name: t,
|
|
384
|
-
label:
|
|
418
|
+
label: n,
|
|
385
419
|
loadOptions: r,
|
|
386
|
-
className:
|
|
387
|
-
containerClassName:
|
|
388
|
-
isClearable:
|
|
389
|
-
defaultOptions:
|
|
390
|
-
loadingMessage:
|
|
391
|
-
noOptionsMessage:
|
|
392
|
-
searchable:
|
|
393
|
-
debounceMs:
|
|
394
|
-
onFocus:
|
|
395
|
-
onBlur:
|
|
396
|
-
...
|
|
397
|
-
},
|
|
398
|
-
var
|
|
399
|
-
const [
|
|
420
|
+
className: a,
|
|
421
|
+
containerClassName: l,
|
|
422
|
+
isClearable: w,
|
|
423
|
+
defaultOptions: b = !1,
|
|
424
|
+
loadingMessage: M = "Carregando...",
|
|
425
|
+
noOptionsMessage: N = "Nenhuma opção encontrada",
|
|
426
|
+
searchable: y = !1,
|
|
427
|
+
debounceMs: f = 300,
|
|
428
|
+
onFocus: x,
|
|
429
|
+
onBlur: c,
|
|
430
|
+
...I
|
|
431
|
+
}, k) => {
|
|
432
|
+
var K, te, Q;
|
|
433
|
+
const [S, v] = e.useState(!1), [h, E] = e.useState(!1), [C, i] = e.useState([]), [R, F] = e.useState(!1), [B, p] = e.useState(""), [V, U] = e.useState(""), [L, J] = e.useState({
|
|
400
434
|
top: 0,
|
|
401
435
|
left: 0,
|
|
402
436
|
width: 0
|
|
403
|
-
}),
|
|
404
|
-
if (
|
|
405
|
-
const
|
|
406
|
-
let
|
|
407
|
-
if (
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
const
|
|
411
|
-
|
|
437
|
+
}), Z = e.useRef(null), G = e.useRef(null), W = ce(), $ = W == null ? void 0 : W.control, X = $ && t ? de({ control: $, name: t }) : void 0, _ = I.value ?? X ?? "", P = (Q = (te = (K = W == null ? void 0 : W.formState) == null ? void 0 : K.errors) == null ? void 0 : te[t]) == null ? void 0 : Q.message, q = S || !!_, z = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), Y = e.useCallback(() => {
|
|
438
|
+
if (Z.current && h) {
|
|
439
|
+
const g = Z.current.getBoundingClientRect(), H = z(), ae = window.innerHeight, m = window.innerWidth, A = 152;
|
|
440
|
+
let ee = g.bottom + 4, ie = g.left;
|
|
441
|
+
if (H) {
|
|
442
|
+
const se = ae - g.bottom, fe = g.top;
|
|
443
|
+
se < A && fe > A && (ee = g.top - A - 4);
|
|
444
|
+
const ue = 16, me = m - g.width - ue;
|
|
445
|
+
ie = Math.min(Math.max(ie, ue), me);
|
|
412
446
|
} else
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
top:
|
|
416
|
-
left:
|
|
417
|
-
width:
|
|
447
|
+
ae - g.bottom < A && (ee = g.top - A - 4);
|
|
448
|
+
J({
|
|
449
|
+
top: ee,
|
|
450
|
+
left: ie,
|
|
451
|
+
width: g.width
|
|
418
452
|
});
|
|
419
453
|
}
|
|
420
|
-
}, [
|
|
454
|
+
}, [h, z]);
|
|
421
455
|
e.useEffect(() => {
|
|
422
|
-
if (
|
|
423
|
-
const
|
|
424
|
-
return window.addEventListener("resize",
|
|
425
|
-
window.removeEventListener("resize",
|
|
456
|
+
if (Y(), h) {
|
|
457
|
+
const g = () => Y(), H = () => Y();
|
|
458
|
+
return window.addEventListener("resize", g), window.addEventListener("scroll", H, !0), () => {
|
|
459
|
+
window.removeEventListener("resize", g), window.removeEventListener("scroll", H, !0);
|
|
426
460
|
};
|
|
427
461
|
}
|
|
428
|
-
}, [
|
|
429
|
-
const
|
|
430
|
-
|
|
431
|
-
},
|
|
432
|
-
return () => clearTimeout(
|
|
433
|
-
}, [
|
|
434
|
-
(
|
|
435
|
-
}, [
|
|
436
|
-
|
|
462
|
+
}, [h, Y]), e.useEffect(() => {
|
|
463
|
+
const g = setTimeout(() => {
|
|
464
|
+
U(B);
|
|
465
|
+
}, f);
|
|
466
|
+
return () => clearTimeout(g);
|
|
467
|
+
}, [B, f]), e.useEffect(() => {
|
|
468
|
+
(h || b && C.length === 0) && j(y ? V : void 0);
|
|
469
|
+
}, [V, h]), e.useEffect(() => {
|
|
470
|
+
b === !0 ? j() : Array.isArray(b) && i(b);
|
|
437
471
|
}, []);
|
|
438
|
-
const
|
|
472
|
+
const j = async (g) => {
|
|
439
473
|
try {
|
|
440
|
-
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
} catch (
|
|
444
|
-
console.error("Error loading options:",
|
|
474
|
+
F(!0);
|
|
475
|
+
const H = await r(g);
|
|
476
|
+
i(H);
|
|
477
|
+
} catch (H) {
|
|
478
|
+
console.error("Error loading options:", H), i([]);
|
|
445
479
|
} finally {
|
|
446
|
-
|
|
480
|
+
F(!1);
|
|
447
481
|
}
|
|
448
482
|
};
|
|
449
483
|
e.useEffect(() => {
|
|
450
|
-
const
|
|
451
|
-
|
|
484
|
+
const g = (H) => {
|
|
485
|
+
Z.current && !Z.current.contains(H.target) && (E(!1), v(!1), p(""));
|
|
452
486
|
};
|
|
453
|
-
return document.addEventListener("mousedown",
|
|
454
|
-
document.removeEventListener("mousedown",
|
|
487
|
+
return document.addEventListener("mousedown", g), () => {
|
|
488
|
+
document.removeEventListener("mousedown", g);
|
|
455
489
|
};
|
|
456
490
|
}, []);
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
var
|
|
460
|
-
return (
|
|
491
|
+
const D = () => {
|
|
492
|
+
h || (E(!0), v(!0), y && G.current && setTimeout(() => {
|
|
493
|
+
var g;
|
|
494
|
+
return (g = G.current) == null ? void 0 : g.focus();
|
|
461
495
|
}, 0));
|
|
462
|
-
}, oe = (
|
|
463
|
-
|
|
464
|
-
},
|
|
465
|
-
|
|
466
|
-
},
|
|
467
|
-
|
|
468
|
-
},
|
|
469
|
-
if (W && t && W.setValue(t,
|
|
470
|
-
const
|
|
471
|
-
target: { value:
|
|
496
|
+
}, oe = (g) => {
|
|
497
|
+
v(!0), x && x(g);
|
|
498
|
+
}, re = (g) => {
|
|
499
|
+
c && c(g);
|
|
500
|
+
}, ne = (g) => {
|
|
501
|
+
p(g.target.value);
|
|
502
|
+
}, u = (g) => {
|
|
503
|
+
if (W && t && W.setValue(t, g), I.onChange) {
|
|
504
|
+
const H = {
|
|
505
|
+
target: { value: g }
|
|
472
506
|
};
|
|
473
|
-
|
|
507
|
+
I.onChange(H);
|
|
474
508
|
}
|
|
475
|
-
|
|
476
|
-
},
|
|
477
|
-
if (
|
|
478
|
-
const
|
|
509
|
+
E(!1), v(!1), p("");
|
|
510
|
+
}, T = (g) => {
|
|
511
|
+
if (g.stopPropagation(), W && t && W.setValue(t, ""), I.onChange) {
|
|
512
|
+
const H = {
|
|
479
513
|
target: { value: "" }
|
|
480
514
|
};
|
|
481
|
-
|
|
515
|
+
I.onChange(H);
|
|
482
516
|
}
|
|
483
|
-
|
|
484
|
-
},
|
|
485
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
517
|
+
E(!1), v(!1), p("");
|
|
518
|
+
}, s = C.find((g) => g.value === _), O = y && h ? B : (s == null ? void 0 : s.label) || "";
|
|
519
|
+
return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: Z }, /* @__PURE__ */ e.createElement(
|
|
486
520
|
"div",
|
|
487
521
|
{
|
|
488
|
-
id:
|
|
489
|
-
tabIndex:
|
|
522
|
+
id: I.id || t,
|
|
523
|
+
tabIndex: y ? -1 : 0,
|
|
490
524
|
role: "button",
|
|
491
525
|
"aria-haspopup": "listbox",
|
|
492
|
-
"aria-expanded":
|
|
493
|
-
className:
|
|
526
|
+
"aria-expanded": h,
|
|
527
|
+
className: d(
|
|
494
528
|
"peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
|
|
495
|
-
|
|
529
|
+
a
|
|
496
530
|
),
|
|
497
|
-
onClick:
|
|
498
|
-
onFocus:
|
|
499
|
-
onBlur:
|
|
500
|
-
ref:
|
|
531
|
+
onClick: D,
|
|
532
|
+
onFocus: y ? void 0 : oe,
|
|
533
|
+
onBlur: y ? void 0 : re,
|
|
534
|
+
ref: k
|
|
501
535
|
},
|
|
502
|
-
|
|
536
|
+
y ? /* @__PURE__ */ e.createElement(
|
|
503
537
|
"input",
|
|
504
538
|
{
|
|
505
|
-
ref:
|
|
539
|
+
ref: G,
|
|
506
540
|
type: "text",
|
|
507
|
-
value:
|
|
508
|
-
onChange:
|
|
541
|
+
value: O,
|
|
542
|
+
onChange: ne,
|
|
509
543
|
onFocus: oe,
|
|
510
|
-
onBlur:
|
|
511
|
-
placeholder:
|
|
512
|
-
className:
|
|
544
|
+
onBlur: re,
|
|
545
|
+
placeholder: n ? "" : "Selecione...",
|
|
546
|
+
className: d(
|
|
513
547
|
"w-full bg-transparent border-none outline-none text-sm",
|
|
514
|
-
!
|
|
548
|
+
!_ && !B && "text-gray-400"
|
|
515
549
|
)
|
|
516
550
|
}
|
|
517
|
-
) : /* @__PURE__ */ e.createElement("span", { className:
|
|
518
|
-
|
|
519
|
-
|
|
551
|
+
) : /* @__PURE__ */ e.createElement("span", { className: d("block truncate", !_ && "text-gray-400") }, (s == null ? void 0 : s.label) || !n && "Selecione..."),
|
|
552
|
+
R && /* @__PURE__ */ e.createElement("div", { className: "absolute right-8 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ e.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]" })),
|
|
553
|
+
w && _ && !R && /* @__PURE__ */ e.createElement(
|
|
520
554
|
"button",
|
|
521
555
|
{
|
|
522
556
|
type: "button",
|
|
523
557
|
tabIndex: -1,
|
|
524
558
|
"aria-label": "Limpar seleção",
|
|
525
559
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
|
|
526
|
-
onClick:
|
|
560
|
+
onClick: T
|
|
527
561
|
},
|
|
528
562
|
"✕"
|
|
529
563
|
)
|
|
530
|
-
),
|
|
564
|
+
), n && /* @__PURE__ */ e.createElement(
|
|
531
565
|
"label",
|
|
532
566
|
{
|
|
533
|
-
htmlFor:
|
|
534
|
-
className:
|
|
567
|
+
htmlFor: I.id || t,
|
|
568
|
+
className: d(
|
|
535
569
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
536
|
-
|
|
570
|
+
q ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
537
571
|
)
|
|
538
572
|
},
|
|
539
|
-
|
|
573
|
+
n
|
|
540
574
|
), /* @__PURE__ */ e.createElement(
|
|
541
575
|
"div",
|
|
542
576
|
{
|
|
543
|
-
className:
|
|
577
|
+
className: d(
|
|
544
578
|
"absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
|
|
545
579
|
"bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
|
|
546
|
-
|
|
580
|
+
h ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
|
|
547
581
|
),
|
|
548
582
|
style: {
|
|
549
|
-
maxHeight:
|
|
550
|
-
overflowY:
|
|
583
|
+
maxHeight: h ? "9.5rem" : "0",
|
|
584
|
+
overflowY: C.length > 3 ? "auto" : "hidden",
|
|
551
585
|
position: "fixed",
|
|
552
586
|
// Use fixed positioning to escape container overflow
|
|
553
|
-
top:
|
|
554
|
-
left:
|
|
555
|
-
width:
|
|
587
|
+
top: h ? `${L.top}px` : "auto",
|
|
588
|
+
left: h ? `${L.left}px` : "auto",
|
|
589
|
+
width: h ? `${L.width}px` : "auto",
|
|
556
590
|
zIndex: 9999,
|
|
557
|
-
boxShadow:
|
|
591
|
+
boxShadow: h ? "var(--select-dropdown-shadow)" : "none"
|
|
558
592
|
}
|
|
559
593
|
},
|
|
560
|
-
|
|
594
|
+
R ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, M) : C.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, N) : C.map((g) => /* @__PURE__ */ e.createElement(
|
|
561
595
|
"div",
|
|
562
596
|
{
|
|
563
|
-
key:
|
|
564
|
-
className:
|
|
597
|
+
key: g.value,
|
|
598
|
+
className: d(
|
|
565
599
|
"px-3 py-2 cursor-pointer text-sm transition-colors duration-150",
|
|
566
600
|
"hover:bg-[var(--select-dropdown-hover)]",
|
|
567
|
-
|
|
601
|
+
_ === g.value && "bg-[var(--select-dropdown-selected)]"
|
|
568
602
|
),
|
|
569
|
-
onMouseDown: () =>
|
|
603
|
+
onMouseDown: () => u(g.value)
|
|
570
604
|
},
|
|
571
|
-
|
|
605
|
+
g.label
|
|
572
606
|
))
|
|
573
|
-
),
|
|
607
|
+
), P && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, P));
|
|
574
608
|
}
|
|
575
609
|
);
|
|
576
|
-
|
|
577
|
-
const
|
|
610
|
+
We.displayName = "AsyncSelect";
|
|
611
|
+
const Ve = e.forwardRef(
|
|
578
612
|
({
|
|
579
613
|
name: t,
|
|
580
|
-
label:
|
|
614
|
+
label: n,
|
|
581
615
|
options: r,
|
|
582
|
-
className:
|
|
583
|
-
containerClassName:
|
|
584
|
-
isClearable:
|
|
585
|
-
searchable:
|
|
586
|
-
filterPlaceholder:
|
|
587
|
-
caseSensitive:
|
|
588
|
-
filterFunction:
|
|
589
|
-
onFocus:
|
|
590
|
-
onBlur:
|
|
591
|
-
...
|
|
592
|
-
},
|
|
593
|
-
var oe,
|
|
594
|
-
const [
|
|
616
|
+
className: a,
|
|
617
|
+
containerClassName: l,
|
|
618
|
+
isClearable: w,
|
|
619
|
+
searchable: b = !1,
|
|
620
|
+
filterPlaceholder: M = "Digite para filtrar...",
|
|
621
|
+
caseSensitive: N = !1,
|
|
622
|
+
filterFunction: y,
|
|
623
|
+
onFocus: f,
|
|
624
|
+
onBlur: x,
|
|
625
|
+
...c
|
|
626
|
+
}, I) => {
|
|
627
|
+
var oe, re, ne;
|
|
628
|
+
const [k, S] = e.useState(!1), [v, h] = e.useState(!1), [E, C] = e.useState(""), [i, R] = e.useState({
|
|
595
629
|
top: 0,
|
|
596
630
|
left: 0,
|
|
597
631
|
width: 0
|
|
598
|
-
}),
|
|
599
|
-
const
|
|
600
|
-
return
|
|
601
|
-
}), W =
|
|
602
|
-
if (
|
|
603
|
-
const
|
|
604
|
-
let
|
|
605
|
-
if (
|
|
606
|
-
const
|
|
607
|
-
|
|
608
|
-
const
|
|
609
|
-
|
|
632
|
+
}), F = e.useRef(null), B = e.useRef(null), p = ce(), V = p == null ? void 0 : p.control, U = V && t ? de({ control: V, name: t }) : void 0, L = c.value ?? U ?? [], J = (ne = (re = (oe = p == null ? void 0 : p.formState) == null ? void 0 : oe.errors) == null ? void 0 : re[t]) == null ? void 0 : ne.message, G = y || ((u, T) => {
|
|
633
|
+
const s = N ? u.label : u.label.toLowerCase(), O = N ? T : T.toLowerCase();
|
|
634
|
+
return s.includes(O);
|
|
635
|
+
}), W = E.trim() ? r.filter((u) => G(u, E.trim())) : r, $ = k || L && L.length > 0 || b && !!E, X = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), _ = e.useCallback(() => {
|
|
636
|
+
if (F.current && v) {
|
|
637
|
+
const u = F.current.getBoundingClientRect(), T = X(), s = window.innerHeight, O = window.innerWidth, K = 152;
|
|
638
|
+
let te = u.bottom + 4, Q = u.left;
|
|
639
|
+
if (T) {
|
|
640
|
+
const g = s - u.bottom, H = u.top;
|
|
641
|
+
g < K && H > K && (te = u.top - K - 4);
|
|
642
|
+
const ae = 16, m = O - u.width - ae;
|
|
643
|
+
Q = Math.min(Math.max(Q, ae), m);
|
|
610
644
|
} else
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
top:
|
|
614
|
-
left:
|
|
615
|
-
width:
|
|
645
|
+
s - u.bottom < K && (te = u.top - K - 4);
|
|
646
|
+
R({
|
|
647
|
+
top: te,
|
|
648
|
+
left: Q,
|
|
649
|
+
width: u.width
|
|
616
650
|
});
|
|
617
651
|
}
|
|
618
|
-
}, [
|
|
652
|
+
}, [v, X]);
|
|
619
653
|
e.useEffect(() => {
|
|
620
|
-
if (
|
|
621
|
-
const
|
|
622
|
-
return window.addEventListener("resize",
|
|
623
|
-
window.removeEventListener("resize",
|
|
654
|
+
if (_(), v) {
|
|
655
|
+
const u = () => _(), T = () => _();
|
|
656
|
+
return window.addEventListener("resize", u), window.addEventListener("scroll", T, !0), () => {
|
|
657
|
+
window.removeEventListener("resize", u), window.removeEventListener("scroll", T, !0);
|
|
624
658
|
};
|
|
625
659
|
}
|
|
626
|
-
}, [
|
|
627
|
-
const
|
|
628
|
-
|
|
660
|
+
}, [v, _]), e.useEffect(() => {
|
|
661
|
+
const u = (T) => {
|
|
662
|
+
F.current && !F.current.contains(T.target) && (h(!1), S(!1));
|
|
629
663
|
};
|
|
630
|
-
return document.addEventListener("mousedown",
|
|
631
|
-
document.removeEventListener("mousedown",
|
|
664
|
+
return document.addEventListener("mousedown", u), () => {
|
|
665
|
+
document.removeEventListener("mousedown", u);
|
|
632
666
|
};
|
|
633
667
|
}, []);
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
},
|
|
637
|
-
|
|
638
|
-
},
|
|
639
|
-
|
|
640
|
-
},
|
|
641
|
-
var
|
|
642
|
-
let
|
|
643
|
-
|
|
644
|
-
target: { value:
|
|
645
|
-
})),
|
|
646
|
-
},
|
|
647
|
-
var
|
|
648
|
-
|
|
668
|
+
const P = () => {
|
|
669
|
+
h((u) => !u), S(!0);
|
|
670
|
+
}, q = (u) => {
|
|
671
|
+
S(!0), f && f(u);
|
|
672
|
+
}, z = (u) => {
|
|
673
|
+
x && x(u);
|
|
674
|
+
}, Y = (u) => {
|
|
675
|
+
var s;
|
|
676
|
+
let T;
|
|
677
|
+
L.includes(u) ? T = L.filter((O) => O !== u) : T = [...L, u], p && t && p.setValue(t, T), c.onChange && ((s = c.onChange) == null || s.call(c, {
|
|
678
|
+
target: { value: T }
|
|
679
|
+
})), S(!0);
|
|
680
|
+
}, j = (u) => {
|
|
681
|
+
var T;
|
|
682
|
+
u.stopPropagation(), p && t && p.setValue(t, []), c.onChange && ((T = c.onChange) == null || T.call(c, {
|
|
649
683
|
target: { value: [] }
|
|
650
|
-
})),
|
|
651
|
-
},
|
|
652
|
-
|
|
684
|
+
})), h(!1), S(!1);
|
|
685
|
+
}, D = (u) => {
|
|
686
|
+
C(u.target.value);
|
|
653
687
|
};
|
|
654
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
688
|
+
return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: F }, /* @__PURE__ */ e.createElement(
|
|
655
689
|
"div",
|
|
656
690
|
{
|
|
657
|
-
id:
|
|
691
|
+
id: c.id || t,
|
|
658
692
|
tabIndex: 0,
|
|
659
693
|
role: "button",
|
|
660
694
|
"aria-haspopup": "listbox",
|
|
661
|
-
"aria-expanded":
|
|
662
|
-
className:
|
|
695
|
+
"aria-expanded": v,
|
|
696
|
+
className: d(
|
|
663
697
|
"peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
|
|
664
|
-
|
|
698
|
+
a
|
|
665
699
|
),
|
|
666
|
-
onClick:
|
|
667
|
-
onFocus:
|
|
668
|
-
onBlur:
|
|
669
|
-
ref:
|
|
700
|
+
onClick: b ? void 0 : P,
|
|
701
|
+
onFocus: b ? void 0 : q,
|
|
702
|
+
onBlur: b ? void 0 : z,
|
|
703
|
+
ref: I
|
|
670
704
|
},
|
|
671
705
|
/* @__PURE__ */ e.createElement(
|
|
672
706
|
"div",
|
|
@@ -674,26 +708,26 @@ const Te = e.forwardRef(
|
|
|
674
708
|
className: "flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",
|
|
675
709
|
style: { scrollbarWidth: "none" }
|
|
676
710
|
},
|
|
677
|
-
|
|
711
|
+
L && L.length > 0 ? r.filter((u) => L.includes(u.value)).map((u) => /* @__PURE__ */ e.createElement(
|
|
678
712
|
"span",
|
|
679
713
|
{
|
|
680
|
-
key:
|
|
714
|
+
key: u.value,
|
|
681
715
|
className: "flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm mr-1 gap-2",
|
|
682
716
|
style: { maxWidth: "140px" }
|
|
683
717
|
},
|
|
684
|
-
/* @__PURE__ */ e.createElement("span", { className: "truncate", title:
|
|
718
|
+
/* @__PURE__ */ e.createElement("span", { className: "truncate", title: u.label }, u.label),
|
|
685
719
|
/* @__PURE__ */ e.createElement(
|
|
686
720
|
"button",
|
|
687
721
|
{
|
|
688
722
|
type: "button",
|
|
689
723
|
className: "ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150",
|
|
690
|
-
"aria-label": `Remover ${
|
|
724
|
+
"aria-label": `Remover ${u.label}`,
|
|
691
725
|
tabIndex: -1,
|
|
692
|
-
onClick: (
|
|
693
|
-
|
|
694
|
-
const
|
|
695
|
-
|
|
696
|
-
target: { value:
|
|
726
|
+
onClick: (T) => {
|
|
727
|
+
T.stopPropagation();
|
|
728
|
+
const s = L.filter((O) => O !== u.value);
|
|
729
|
+
p && t && p.setValue(t, s), c.onChange && c.onChange({
|
|
730
|
+
target: { value: s }
|
|
697
731
|
});
|
|
698
732
|
}
|
|
699
733
|
},
|
|
@@ -717,229 +751,229 @@ const Te = e.forwardRef(
|
|
|
717
751
|
)
|
|
718
752
|
)
|
|
719
753
|
)
|
|
720
|
-
)) : !
|
|
721
|
-
|
|
754
|
+
)) : !n && !b && /* @__PURE__ */ e.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione..."),
|
|
755
|
+
b && /* @__PURE__ */ e.createElement(
|
|
722
756
|
"input",
|
|
723
757
|
{
|
|
724
|
-
ref:
|
|
758
|
+
ref: B,
|
|
725
759
|
type: "text",
|
|
726
|
-
value:
|
|
727
|
-
onChange:
|
|
728
|
-
onFocus: (
|
|
729
|
-
|
|
760
|
+
value: E,
|
|
761
|
+
onChange: D,
|
|
762
|
+
onFocus: (u) => {
|
|
763
|
+
S(!0), h(!0), f && f(u);
|
|
730
764
|
},
|
|
731
|
-
onBlur: (
|
|
732
|
-
|
|
765
|
+
onBlur: (u) => {
|
|
766
|
+
x && x(u);
|
|
733
767
|
},
|
|
734
|
-
placeholder:
|
|
768
|
+
placeholder: n ? L && L.length > 0 ? "" : M : M || "Selecione...",
|
|
735
769
|
className: "flex-1 bg-transparent border-none outline-none text-sm min-w-[100px]"
|
|
736
770
|
}
|
|
737
771
|
)
|
|
738
772
|
),
|
|
739
|
-
|
|
773
|
+
w && L && L.length > 0 && /* @__PURE__ */ e.createElement(
|
|
740
774
|
"button",
|
|
741
775
|
{
|
|
742
776
|
type: "button",
|
|
743
777
|
tabIndex: -1,
|
|
744
778
|
"aria-label": "Limpar seleção",
|
|
745
779
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
|
|
746
|
-
onClick:
|
|
780
|
+
onClick: j
|
|
747
781
|
},
|
|
748
782
|
"✕"
|
|
749
783
|
)
|
|
750
|
-
),
|
|
784
|
+
), n && /* @__PURE__ */ e.createElement(
|
|
751
785
|
"label",
|
|
752
786
|
{
|
|
753
|
-
htmlFor:
|
|
754
|
-
className:
|
|
787
|
+
htmlFor: c.id || t,
|
|
788
|
+
className: d(
|
|
755
789
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
756
|
-
|
|
790
|
+
$ ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
757
791
|
)
|
|
758
792
|
},
|
|
759
|
-
|
|
793
|
+
n
|
|
760
794
|
), /* @__PURE__ */ e.createElement(
|
|
761
795
|
"div",
|
|
762
796
|
{
|
|
763
|
-
className:
|
|
797
|
+
className: d(
|
|
764
798
|
"absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
|
|
765
799
|
"bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
|
|
766
|
-
|
|
800
|
+
v ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
|
|
767
801
|
),
|
|
768
802
|
style: {
|
|
769
|
-
maxHeight:
|
|
803
|
+
maxHeight: v ? "9.5rem" : "0",
|
|
770
804
|
overflowY: r.length > 3 ? "auto" : "hidden",
|
|
771
805
|
position: "fixed",
|
|
772
806
|
// Use fixed positioning to escape container overflow
|
|
773
|
-
top:
|
|
774
|
-
left:
|
|
775
|
-
width:
|
|
807
|
+
top: v ? `${i.top}px` : "auto",
|
|
808
|
+
left: v ? `${i.left}px` : "auto",
|
|
809
|
+
width: v ? `${i.width}px` : "auto",
|
|
776
810
|
zIndex: 9999,
|
|
777
|
-
boxShadow:
|
|
811
|
+
boxShadow: v ? "var(--select-dropdown-shadow)" : "none"
|
|
778
812
|
}
|
|
779
813
|
},
|
|
780
|
-
W.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : W.map((
|
|
814
|
+
W.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : W.map((u) => /* @__PURE__ */ e.createElement(
|
|
781
815
|
"div",
|
|
782
816
|
{
|
|
783
|
-
key:
|
|
784
|
-
className:
|
|
817
|
+
key: u.value,
|
|
818
|
+
className: d(
|
|
785
819
|
"px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150",
|
|
786
820
|
"hover:bg-[var(--select-dropdown-hover)]",
|
|
787
|
-
|
|
821
|
+
L.includes(u.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
|
|
788
822
|
),
|
|
789
|
-
onMouseDown: () =>
|
|
823
|
+
onMouseDown: () => Y(u.value)
|
|
790
824
|
},
|
|
791
825
|
/* @__PURE__ */ e.createElement(
|
|
792
826
|
"input",
|
|
793
827
|
{
|
|
794
828
|
type: "checkbox",
|
|
795
|
-
checked:
|
|
829
|
+
checked: L.includes(u.value),
|
|
796
830
|
readOnly: !0,
|
|
797
831
|
className: "accent-blue-500"
|
|
798
832
|
}
|
|
799
833
|
),
|
|
800
|
-
|
|
834
|
+
u.label
|
|
801
835
|
))
|
|
802
|
-
),
|
|
836
|
+
), J && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, J));
|
|
803
837
|
}
|
|
804
838
|
);
|
|
805
|
-
|
|
806
|
-
const
|
|
839
|
+
Ve.displayName = "MultiSelect";
|
|
840
|
+
const He = e.forwardRef(
|
|
807
841
|
({
|
|
808
842
|
name: t,
|
|
809
|
-
label:
|
|
843
|
+
label: n,
|
|
810
844
|
loadOptions: r,
|
|
811
|
-
className:
|
|
812
|
-
containerClassName:
|
|
813
|
-
isClearable:
|
|
814
|
-
defaultOptions:
|
|
815
|
-
loadingMessage:
|
|
816
|
-
noOptionsMessage:
|
|
817
|
-
searchable:
|
|
818
|
-
debounceMs:
|
|
819
|
-
maxSelectedDisplay:
|
|
820
|
-
onFocus:
|
|
821
|
-
onBlur:
|
|
822
|
-
...
|
|
823
|
-
},
|
|
824
|
-
var
|
|
825
|
-
const [
|
|
845
|
+
className: a,
|
|
846
|
+
containerClassName: l,
|
|
847
|
+
isClearable: w,
|
|
848
|
+
defaultOptions: b = !1,
|
|
849
|
+
loadingMessage: M = "Carregando...",
|
|
850
|
+
noOptionsMessage: N = "Nenhuma opção encontrada",
|
|
851
|
+
searchable: y = !1,
|
|
852
|
+
debounceMs: f = 300,
|
|
853
|
+
maxSelectedDisplay: x = 3,
|
|
854
|
+
onFocus: c,
|
|
855
|
+
onBlur: I,
|
|
856
|
+
...k
|
|
857
|
+
}, S) => {
|
|
858
|
+
var g, H, ae;
|
|
859
|
+
const [v, h] = e.useState(!1), [E, C] = e.useState(!1), [i, R] = e.useState([]), [F, B] = e.useState(!1), [p, V] = e.useState(""), [U, L] = e.useState(""), [J, Z] = e.useState({
|
|
826
860
|
top: 0,
|
|
827
861
|
left: 0,
|
|
828
862
|
width: 0
|
|
829
|
-
}),
|
|
830
|
-
if (
|
|
831
|
-
const
|
|
832
|
-
let fe =
|
|
833
|
-
if (
|
|
834
|
-
const me =
|
|
835
|
-
me <
|
|
836
|
-
const
|
|
837
|
-
|
|
863
|
+
}), G = e.useRef(null), W = e.useRef(null), $ = ce(), X = $ == null ? void 0 : $.control, _ = X && t ? de({ control: X, name: t }) : void 0, P = k.value ?? _ ?? [], q = (ae = (H = (g = $ == null ? void 0 : $.formState) == null ? void 0 : g.errors) == null ? void 0 : H[t]) == null ? void 0 : ae.message, z = v || P && P.length > 0, Y = e.useCallback(() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || window.innerWidth <= 768, []), j = e.useCallback(() => {
|
|
864
|
+
if (G.current && E) {
|
|
865
|
+
const m = G.current.getBoundingClientRect(), A = Y(), ee = window.innerHeight, ie = window.innerWidth, se = 152;
|
|
866
|
+
let fe = m.bottom + 4, ue = m.left;
|
|
867
|
+
if (A) {
|
|
868
|
+
const me = ee - m.bottom, Pe = m.top;
|
|
869
|
+
me < se && Pe > se && (fe = m.top - se - 4);
|
|
870
|
+
const ge = 16, _e = ie - m.width - ge;
|
|
871
|
+
ue = Math.min(Math.max(ue, ge), _e);
|
|
838
872
|
} else
|
|
839
|
-
|
|
840
|
-
|
|
873
|
+
ee - m.bottom < se && (fe = m.top - se - 4);
|
|
874
|
+
Z({
|
|
841
875
|
top: fe,
|
|
842
|
-
left:
|
|
843
|
-
width:
|
|
876
|
+
left: ue,
|
|
877
|
+
width: m.width
|
|
844
878
|
});
|
|
845
879
|
}
|
|
846
|
-
}, [
|
|
880
|
+
}, [E, Y]);
|
|
847
881
|
e.useEffect(() => {
|
|
848
|
-
if (
|
|
849
|
-
const
|
|
850
|
-
return window.addEventListener("resize",
|
|
851
|
-
window.removeEventListener("resize",
|
|
882
|
+
if (j(), E) {
|
|
883
|
+
const m = () => j(), A = () => j();
|
|
884
|
+
return window.addEventListener("resize", m), window.addEventListener("scroll", A, !0), () => {
|
|
885
|
+
window.removeEventListener("resize", m), window.removeEventListener("scroll", A, !0);
|
|
852
886
|
};
|
|
853
887
|
}
|
|
854
|
-
}, [
|
|
855
|
-
const
|
|
856
|
-
|
|
857
|
-
},
|
|
858
|
-
return () => clearTimeout(
|
|
859
|
-
}, [
|
|
860
|
-
(
|
|
861
|
-
}, [
|
|
862
|
-
|
|
888
|
+
}, [E, j]), e.useEffect(() => {
|
|
889
|
+
const m = setTimeout(() => {
|
|
890
|
+
L(p);
|
|
891
|
+
}, f);
|
|
892
|
+
return () => clearTimeout(m);
|
|
893
|
+
}, [p, f]), e.useEffect(() => {
|
|
894
|
+
(E || b && i.length === 0) && D(y ? U : void 0);
|
|
895
|
+
}, [U, E]), e.useEffect(() => {
|
|
896
|
+
b === !0 ? D() : Array.isArray(b) && R(b);
|
|
863
897
|
}, []);
|
|
864
|
-
const
|
|
898
|
+
const D = async (m) => {
|
|
865
899
|
try {
|
|
866
|
-
|
|
867
|
-
const
|
|
868
|
-
|
|
869
|
-
} catch (
|
|
870
|
-
console.error("Error loading options:",
|
|
900
|
+
B(!0);
|
|
901
|
+
const A = await r(m);
|
|
902
|
+
R(A);
|
|
903
|
+
} catch (A) {
|
|
904
|
+
console.error("Error loading options:", A), R([]);
|
|
871
905
|
} finally {
|
|
872
|
-
|
|
906
|
+
B(!1);
|
|
873
907
|
}
|
|
874
908
|
};
|
|
875
909
|
e.useEffect(() => {
|
|
876
|
-
const
|
|
877
|
-
|
|
910
|
+
const m = (A) => {
|
|
911
|
+
G.current && !G.current.contains(A.target) && (C(!1), h(!1), V(""));
|
|
878
912
|
};
|
|
879
|
-
return document.addEventListener("mousedown",
|
|
880
|
-
document.removeEventListener("mousedown",
|
|
913
|
+
return document.addEventListener("mousedown", m), () => {
|
|
914
|
+
document.removeEventListener("mousedown", m);
|
|
881
915
|
};
|
|
882
916
|
}, []);
|
|
883
917
|
const oe = () => {
|
|
884
|
-
|
|
885
|
-
var
|
|
886
|
-
return (
|
|
918
|
+
E || (C(!0), h(!0), y && W.current && setTimeout(() => {
|
|
919
|
+
var m;
|
|
920
|
+
return (m = W.current) == null ? void 0 : m.focus();
|
|
887
921
|
}, 0));
|
|
888
|
-
},
|
|
889
|
-
|
|
890
|
-
},
|
|
891
|
-
|
|
892
|
-
},
|
|
893
|
-
|
|
894
|
-
},
|
|
895
|
-
let
|
|
896
|
-
|
|
897
|
-
target: { value:
|
|
898
|
-
}),
|
|
899
|
-
},
|
|
900
|
-
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
target: { value:
|
|
922
|
+
}, re = (m) => {
|
|
923
|
+
h(!0), c && c(m);
|
|
924
|
+
}, ne = (m) => {
|
|
925
|
+
I && I(m);
|
|
926
|
+
}, u = (m) => {
|
|
927
|
+
V(m.target.value);
|
|
928
|
+
}, T = (m) => {
|
|
929
|
+
let A;
|
|
930
|
+
P.includes(m) ? A = P.filter((ee) => ee !== m) : A = [...P, m], $ && t && $.setValue(t, A), k.onChange && k.onChange({
|
|
931
|
+
target: { value: A }
|
|
932
|
+
}), h(!0);
|
|
933
|
+
}, s = (m, A) => {
|
|
934
|
+
A.stopPropagation();
|
|
935
|
+
const ee = P.filter((ie) => ie !== m);
|
|
936
|
+
$ && t && $.setValue(t, ee), k.onChange && k.onChange({
|
|
937
|
+
target: { value: ee }
|
|
904
938
|
});
|
|
905
|
-
},
|
|
906
|
-
|
|
939
|
+
}, O = (m) => {
|
|
940
|
+
m.stopPropagation(), $ && t && $.setValue(t, []), k.onChange && k.onChange({
|
|
907
941
|
target: { value: [] }
|
|
908
|
-
}),
|
|
909
|
-
},
|
|
910
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
942
|
+
}), C(!1), h(!1), V("");
|
|
943
|
+
}, K = i.filter((m) => P.includes(m.value)), te = K.slice(0, x), Q = K.length - x;
|
|
944
|
+
return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: G }, /* @__PURE__ */ e.createElement(
|
|
911
945
|
"div",
|
|
912
946
|
{
|
|
913
|
-
id:
|
|
914
|
-
tabIndex:
|
|
947
|
+
id: k.id || t,
|
|
948
|
+
tabIndex: y ? -1 : 0,
|
|
915
949
|
role: "button",
|
|
916
950
|
"aria-haspopup": "listbox",
|
|
917
|
-
"aria-expanded":
|
|
918
|
-
className:
|
|
951
|
+
"aria-expanded": E,
|
|
952
|
+
className: d(
|
|
919
953
|
"peer flex items-center min-h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-2 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
|
|
920
|
-
|
|
954
|
+
a
|
|
921
955
|
),
|
|
922
956
|
onClick: oe,
|
|
923
|
-
onFocus:
|
|
924
|
-
onBlur:
|
|
925
|
-
ref:
|
|
957
|
+
onFocus: y ? void 0 : re,
|
|
958
|
+
onBlur: y ? void 0 : ne,
|
|
959
|
+
ref: S
|
|
926
960
|
},
|
|
927
|
-
/* @__PURE__ */ e.createElement("div", { className: "flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full" },
|
|
961
|
+
/* @__PURE__ */ e.createElement("div", { className: "flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full" }, te.map((m) => /* @__PURE__ */ e.createElement(
|
|
928
962
|
"span",
|
|
929
963
|
{
|
|
930
|
-
key:
|
|
964
|
+
key: m.value,
|
|
931
965
|
className: "flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm gap-2",
|
|
932
966
|
style: { maxWidth: "140px" }
|
|
933
967
|
},
|
|
934
|
-
/* @__PURE__ */ e.createElement("span", { className: "truncate", title:
|
|
968
|
+
/* @__PURE__ */ e.createElement("span", { className: "truncate", title: m.label }, m.label),
|
|
935
969
|
/* @__PURE__ */ e.createElement(
|
|
936
970
|
"button",
|
|
937
971
|
{
|
|
938
972
|
type: "button",
|
|
939
973
|
className: "ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150",
|
|
940
|
-
"aria-label": `Remover ${
|
|
974
|
+
"aria-label": `Remover ${m.label}`,
|
|
941
975
|
tabIndex: -1,
|
|
942
|
-
onClick: (
|
|
976
|
+
onClick: (A) => s(m.value, A)
|
|
943
977
|
},
|
|
944
978
|
/* @__PURE__ */ e.createElement(
|
|
945
979
|
"svg",
|
|
@@ -961,286 +995,286 @@ const ze = e.forwardRef(
|
|
|
961
995
|
)
|
|
962
996
|
)
|
|
963
997
|
)
|
|
964
|
-
)),
|
|
998
|
+
)), Q > 0 && /* @__PURE__ */ e.createElement("span", { className: "flex items-center border border-gray-200 bg-gray-100 text-gray-600 rounded-2xl px-3 py-1 text-xs" }, "+", Q, " mais"), y ? /* @__PURE__ */ e.createElement(
|
|
965
999
|
"input",
|
|
966
1000
|
{
|
|
967
1001
|
ref: W,
|
|
968
1002
|
type: "text",
|
|
969
|
-
value:
|
|
970
|
-
onChange:
|
|
971
|
-
onFocus:
|
|
972
|
-
onBlur:
|
|
973
|
-
placeholder:
|
|
1003
|
+
value: p,
|
|
1004
|
+
onChange: u,
|
|
1005
|
+
onFocus: re,
|
|
1006
|
+
onBlur: ne,
|
|
1007
|
+
placeholder: P.length === 0 && !n ? "Selecione..." : "",
|
|
974
1008
|
className: "flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm"
|
|
975
1009
|
}
|
|
976
|
-
) :
|
|
977
|
-
|
|
978
|
-
|
|
1010
|
+
) : P.length === 0 && !n && /* @__PURE__ */ e.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione...")),
|
|
1011
|
+
F && /* @__PURE__ */ e.createElement("div", { className: "absolute right-8 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ e.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]" })),
|
|
1012
|
+
w && P && P.length > 0 && !F && /* @__PURE__ */ e.createElement(
|
|
979
1013
|
"button",
|
|
980
1014
|
{
|
|
981
1015
|
type: "button",
|
|
982
1016
|
tabIndex: -1,
|
|
983
1017
|
"aria-label": "Limpar seleção",
|
|
984
1018
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
|
|
985
|
-
onClick:
|
|
1019
|
+
onClick: O
|
|
986
1020
|
},
|
|
987
1021
|
"✕"
|
|
988
1022
|
)
|
|
989
|
-
),
|
|
1023
|
+
), n && /* @__PURE__ */ e.createElement(
|
|
990
1024
|
"label",
|
|
991
1025
|
{
|
|
992
|
-
htmlFor:
|
|
993
|
-
className:
|
|
1026
|
+
htmlFor: k.id || t,
|
|
1027
|
+
className: d(
|
|
994
1028
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
995
|
-
|
|
1029
|
+
z ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
996
1030
|
)
|
|
997
1031
|
},
|
|
998
|
-
|
|
1032
|
+
n
|
|
999
1033
|
), /* @__PURE__ */ e.createElement(
|
|
1000
1034
|
"div",
|
|
1001
1035
|
{
|
|
1002
|
-
className:
|
|
1036
|
+
className: d(
|
|
1003
1037
|
"absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
|
|
1004
1038
|
"bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
|
|
1005
|
-
|
|
1039
|
+
E ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
|
|
1006
1040
|
),
|
|
1007
1041
|
style: {
|
|
1008
|
-
maxHeight:
|
|
1009
|
-
overflowY:
|
|
1042
|
+
maxHeight: E ? "9.5rem" : "0",
|
|
1043
|
+
overflowY: i.length > 3 ? "auto" : "hidden",
|
|
1010
1044
|
position: "fixed",
|
|
1011
1045
|
// Use fixed positioning to escape container overflow
|
|
1012
|
-
top:
|
|
1013
|
-
left:
|
|
1014
|
-
width:
|
|
1046
|
+
top: E ? `${J.top}px` : "auto",
|
|
1047
|
+
left: E ? `${J.left}px` : "auto",
|
|
1048
|
+
width: E ? `${J.width}px` : "auto",
|
|
1015
1049
|
zIndex: 9999,
|
|
1016
|
-
boxShadow:
|
|
1050
|
+
boxShadow: E ? "var(--select-dropdown-shadow)" : "none"
|
|
1017
1051
|
}
|
|
1018
1052
|
},
|
|
1019
|
-
|
|
1053
|
+
F ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, M) : i.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, N) : i.map((m) => /* @__PURE__ */ e.createElement(
|
|
1020
1054
|
"div",
|
|
1021
1055
|
{
|
|
1022
|
-
key:
|
|
1023
|
-
className:
|
|
1056
|
+
key: m.value,
|
|
1057
|
+
className: d(
|
|
1024
1058
|
"px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150",
|
|
1025
1059
|
"hover:bg-[var(--select-dropdown-hover)]",
|
|
1026
|
-
|
|
1060
|
+
P.includes(m.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
|
|
1027
1061
|
),
|
|
1028
|
-
onMouseDown: () =>
|
|
1062
|
+
onMouseDown: () => T(m.value)
|
|
1029
1063
|
},
|
|
1030
1064
|
/* @__PURE__ */ e.createElement(
|
|
1031
1065
|
"input",
|
|
1032
1066
|
{
|
|
1033
1067
|
type: "checkbox",
|
|
1034
|
-
checked:
|
|
1068
|
+
checked: P.includes(m.value),
|
|
1035
1069
|
readOnly: !0,
|
|
1036
1070
|
className: "accent-blue-500"
|
|
1037
1071
|
}
|
|
1038
1072
|
),
|
|
1039
|
-
|
|
1073
|
+
m.label
|
|
1040
1074
|
))
|
|
1041
|
-
),
|
|
1075
|
+
), q && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, q));
|
|
1042
1076
|
}
|
|
1043
1077
|
);
|
|
1044
|
-
|
|
1045
|
-
const
|
|
1078
|
+
He.displayName = "MultiAsyncSelect";
|
|
1079
|
+
const De = {
|
|
1046
1080
|
sm: "h-10 text-sm px-3",
|
|
1047
1081
|
md: "h-12 text-base px-4",
|
|
1048
1082
|
lg: "h-16 text-lg px-6"
|
|
1049
|
-
},
|
|
1083
|
+
}, je = e.forwardRef(
|
|
1050
1084
|
({
|
|
1051
1085
|
name: t,
|
|
1052
|
-
label:
|
|
1086
|
+
label: n,
|
|
1053
1087
|
options: r,
|
|
1054
|
-
className:
|
|
1055
|
-
containerClassName:
|
|
1056
|
-
optionClassName:
|
|
1057
|
-
direction:
|
|
1058
|
-
size:
|
|
1059
|
-
onFocus:
|
|
1060
|
-
onBlur:
|
|
1061
|
-
...
|
|
1062
|
-
},
|
|
1063
|
-
var
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1088
|
+
className: a,
|
|
1089
|
+
containerClassName: l,
|
|
1090
|
+
optionClassName: w,
|
|
1091
|
+
direction: b = "row",
|
|
1092
|
+
size: M = "md",
|
|
1093
|
+
onFocus: N,
|
|
1094
|
+
onBlur: y,
|
|
1095
|
+
...f
|
|
1096
|
+
}, x) => {
|
|
1097
|
+
var E, C, i;
|
|
1098
|
+
const c = ce(), I = c == null ? void 0 : c.control, k = I && t ? de({ control: I, name: t }) : void 0, S = f.value ?? k ?? "", v = (i = (C = (E = c == null ? void 0 : c.formState) == null ? void 0 : E.errors) == null ? void 0 : C[t]) == null ? void 0 : i.message, h = (R) => {
|
|
1099
|
+
c && t && c.setValue(t, R), f.onChange && f.onChange({ target: { value: R } });
|
|
1066
1100
|
};
|
|
1067
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
1101
|
+
return /* @__PURE__ */ e.createElement("div", { className: d("relative", l), ref: x }, n && /* @__PURE__ */ e.createElement(
|
|
1068
1102
|
"label",
|
|
1069
1103
|
{
|
|
1070
1104
|
htmlFor: t,
|
|
1071
|
-
className:
|
|
1105
|
+
className: d(
|
|
1072
1106
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm transition-all duration-200",
|
|
1073
1107
|
"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white"
|
|
1074
1108
|
)
|
|
1075
1109
|
},
|
|
1076
|
-
|
|
1110
|
+
n
|
|
1077
1111
|
), /* @__PURE__ */ e.createElement(
|
|
1078
1112
|
"div",
|
|
1079
1113
|
{
|
|
1080
|
-
className:
|
|
1114
|
+
className: d(
|
|
1081
1115
|
"flex gap-2 w-full pt-6",
|
|
1082
1116
|
// espaço para label flutuante
|
|
1083
|
-
|
|
1084
|
-
|
|
1117
|
+
b === "row" ? "flex-row" : "flex-col",
|
|
1118
|
+
a
|
|
1085
1119
|
),
|
|
1086
|
-
"aria-label":
|
|
1120
|
+
"aria-label": n,
|
|
1087
1121
|
tabIndex: -1,
|
|
1088
|
-
onFocus:
|
|
1089
|
-
onBlur:
|
|
1122
|
+
onFocus: N,
|
|
1123
|
+
onBlur: y
|
|
1090
1124
|
},
|
|
1091
|
-
r.map((
|
|
1125
|
+
r.map((R) => /* @__PURE__ */ e.createElement(
|
|
1092
1126
|
"button",
|
|
1093
1127
|
{
|
|
1094
|
-
key:
|
|
1128
|
+
key: R.value,
|
|
1095
1129
|
type: "button",
|
|
1096
|
-
className:
|
|
1130
|
+
className: d(
|
|
1097
1131
|
"relative flex items-center justify-center border rounded-lg transition-all duration-200 shadow-sm px-4 focus:outline-none focus:ring-2 focus:ring-[var(--primary-hover,#dbeafe)]",
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1132
|
+
De[M],
|
|
1133
|
+
S === R.value ? "border-[var(--primary,#2563eb)] bg-[var(--primary-hover,#dbeafe)] text-[var(--primary,#2563eb)] ring-2 ring-[var(--primary-hover,#dbeafe)] shadow-md transform scale-[1.02]" : "border-gray-200 bg-white text-gray-600 hover:border-[var(--primary,#2563eb)] hover:bg-[var(--primary-hover,#dbeafe)] hover:text-[var(--primary,#2563eb)] hover:shadow-md",
|
|
1134
|
+
w
|
|
1101
1135
|
),
|
|
1102
|
-
"aria-pressed":
|
|
1103
|
-
"data-selected":
|
|
1136
|
+
"aria-pressed": S === R.value,
|
|
1137
|
+
"data-selected": S === R.value,
|
|
1104
1138
|
tabIndex: 0,
|
|
1105
|
-
onClick: () =>
|
|
1106
|
-
onKeyDown: (
|
|
1107
|
-
(
|
|
1139
|
+
onClick: () => h(R.value),
|
|
1140
|
+
onKeyDown: (F) => {
|
|
1141
|
+
(F.key === "Enter" || F.key === " ") && (F.preventDefault(), h(R.value));
|
|
1108
1142
|
}
|
|
1109
1143
|
},
|
|
1110
|
-
|
|
1111
|
-
/* @__PURE__ */ e.createElement("span", { className: "truncate font-medium" },
|
|
1144
|
+
R.icon && /* @__PURE__ */ e.createElement("span", { className: "mr-2 text-lg flex items-center" }, R.icon),
|
|
1145
|
+
/* @__PURE__ */ e.createElement("span", { className: "truncate font-medium" }, R.label)
|
|
1112
1146
|
))
|
|
1113
|
-
),
|
|
1147
|
+
), v && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, v));
|
|
1114
1148
|
}
|
|
1115
1149
|
);
|
|
1116
|
-
|
|
1117
|
-
const
|
|
1118
|
-
({ children: t, className:
|
|
1150
|
+
je.displayName = "RadioGroup";
|
|
1151
|
+
const ye = o.forwardRef(
|
|
1152
|
+
({ children: t, className: n, as: r = "div", ...a }, l) => /* @__PURE__ */ o.createElement(
|
|
1119
1153
|
r,
|
|
1120
1154
|
{
|
|
1121
|
-
ref:
|
|
1122
|
-
className:
|
|
1155
|
+
ref: l,
|
|
1156
|
+
className: d(
|
|
1123
1157
|
"px-6 py-4 border-b",
|
|
1124
1158
|
"bg-[var(--card-header-bg,rgba(249,250,251,0.5))]",
|
|
1125
1159
|
"border-[var(--card-header-border,#e5e7eb)]",
|
|
1126
1160
|
"text-[var(--card-text,#111827)]",
|
|
1127
|
-
|
|
1161
|
+
n
|
|
1128
1162
|
),
|
|
1129
|
-
...
|
|
1163
|
+
...a
|
|
1130
1164
|
},
|
|
1131
1165
|
t
|
|
1132
1166
|
)
|
|
1133
1167
|
);
|
|
1134
|
-
|
|
1135
|
-
const
|
|
1136
|
-
({ children: t, className:
|
|
1168
|
+
ye.displayName = "CardHeader";
|
|
1169
|
+
const Ee = o.forwardRef(
|
|
1170
|
+
({ children: t, className: n, as: r = "div", ...a }, l) => /* @__PURE__ */ o.createElement(
|
|
1137
1171
|
r,
|
|
1138
1172
|
{
|
|
1139
|
-
ref:
|
|
1140
|
-
className:
|
|
1173
|
+
ref: l,
|
|
1174
|
+
className: d(
|
|
1141
1175
|
"px-6 py-4",
|
|
1142
1176
|
"flex-1",
|
|
1143
1177
|
// Para ocupar o espaço disponível
|
|
1144
1178
|
"bg-[var(--card-bg,#ffffff)]",
|
|
1145
1179
|
"text-[var(--card-text,#111827)]",
|
|
1146
|
-
|
|
1180
|
+
n
|
|
1147
1181
|
),
|
|
1148
|
-
...
|
|
1182
|
+
...a
|
|
1149
1183
|
},
|
|
1150
1184
|
t
|
|
1151
1185
|
)
|
|
1152
1186
|
);
|
|
1153
|
-
|
|
1154
|
-
const
|
|
1155
|
-
({ children: t, className:
|
|
1187
|
+
Ee.displayName = "CardBody";
|
|
1188
|
+
const Ce = o.forwardRef(
|
|
1189
|
+
({ children: t, className: n, as: r = "div", ...a }, l) => /* @__PURE__ */ o.createElement(
|
|
1156
1190
|
r,
|
|
1157
1191
|
{
|
|
1158
|
-
ref:
|
|
1159
|
-
className:
|
|
1192
|
+
ref: l,
|
|
1193
|
+
className: d(
|
|
1160
1194
|
"px-6 py-4 border-t",
|
|
1161
1195
|
"bg-[var(--card-footer-bg,rgba(249,250,251,0.5))]",
|
|
1162
1196
|
"border-[var(--card-footer-border,#e5e7eb)]",
|
|
1163
1197
|
"text-[var(--card-text,#111827)]",
|
|
1164
|
-
|
|
1198
|
+
n
|
|
1165
1199
|
),
|
|
1166
|
-
...
|
|
1200
|
+
...a
|
|
1167
1201
|
},
|
|
1168
1202
|
t
|
|
1169
1203
|
)
|
|
1170
1204
|
);
|
|
1171
|
-
|
|
1172
|
-
const
|
|
1205
|
+
Ce.displayName = "CardFooter";
|
|
1206
|
+
const Ue = o.forwardRef(
|
|
1173
1207
|
({
|
|
1174
1208
|
children: t,
|
|
1175
|
-
className:
|
|
1209
|
+
className: n,
|
|
1176
1210
|
variant: r = "default",
|
|
1177
|
-
size:
|
|
1178
|
-
padding:
|
|
1211
|
+
size: a = "md",
|
|
1212
|
+
padding: l = "none",
|
|
1179
1213
|
// none pois cada seção tem seu próprio padding
|
|
1180
|
-
rounded:
|
|
1181
|
-
constrainWidth:
|
|
1214
|
+
rounded: w = "lg",
|
|
1215
|
+
constrainWidth: b = !1,
|
|
1182
1216
|
// Por padrão, não aplicar max-width
|
|
1183
|
-
allowOverflow:
|
|
1217
|
+
allowOverflow: M = !1,
|
|
1184
1218
|
// Por padrão, aplicar overflow hidden para interface limpa
|
|
1185
|
-
...
|
|
1186
|
-
},
|
|
1187
|
-
const
|
|
1219
|
+
...N
|
|
1220
|
+
}, y) => {
|
|
1221
|
+
const f = {
|
|
1188
1222
|
default: "bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-sm,0_1px_2px_0_rgb(0_0_0_/_0.05))]",
|
|
1189
1223
|
outlined: "bg-[var(--card-bg,#ffffff)] border-2 border-[var(--primary,#2563eb)]",
|
|
1190
1224
|
elevated: "bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-lg,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]",
|
|
1191
1225
|
flat: "bg-[var(--card-bg,#ffffff)] border-0"
|
|
1192
|
-
},
|
|
1226
|
+
}, x = {
|
|
1193
1227
|
sm: "max-w-sm",
|
|
1194
1228
|
md: "max-w-md",
|
|
1195
1229
|
lg: "max-w-lg"
|
|
1196
|
-
},
|
|
1230
|
+
}, c = {
|
|
1197
1231
|
none: "",
|
|
1198
1232
|
sm: "p-3",
|
|
1199
1233
|
md: "p-4",
|
|
1200
1234
|
lg: "p-6"
|
|
1201
|
-
},
|
|
1235
|
+
}, I = {
|
|
1202
1236
|
none: "rounded-none",
|
|
1203
1237
|
sm: "rounded-sm",
|
|
1204
1238
|
md: "rounded-md",
|
|
1205
1239
|
lg: "rounded-lg",
|
|
1206
1240
|
xl: "rounded-xl"
|
|
1207
1241
|
};
|
|
1208
|
-
return /* @__PURE__ */
|
|
1242
|
+
return /* @__PURE__ */ o.createElement(
|
|
1209
1243
|
"div",
|
|
1210
1244
|
{
|
|
1211
|
-
ref:
|
|
1212
|
-
className:
|
|
1245
|
+
ref: y,
|
|
1246
|
+
className: d(
|
|
1213
1247
|
"flex flex-col",
|
|
1214
1248
|
// Flex column para organizar header, body, footer
|
|
1215
|
-
!
|
|
1249
|
+
!M && "overflow-hidden",
|
|
1216
1250
|
// Overflow hidden por padrão para bordas limpas
|
|
1217
|
-
|
|
1218
|
-
|
|
1251
|
+
f[r],
|
|
1252
|
+
b && x[a],
|
|
1219
1253
|
// Aplicar max-width apenas se constrainWidth for true
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1254
|
+
c[l],
|
|
1255
|
+
I[w],
|
|
1256
|
+
n
|
|
1223
1257
|
),
|
|
1224
|
-
...
|
|
1258
|
+
...N
|
|
1225
1259
|
},
|
|
1226
1260
|
t
|
|
1227
1261
|
);
|
|
1228
1262
|
}
|
|
1229
|
-
),
|
|
1230
|
-
Header:
|
|
1231
|
-
Body:
|
|
1232
|
-
Footer:
|
|
1233
|
-
}),
|
|
1263
|
+
), Ze = Object.assign(Ue, {
|
|
1264
|
+
Header: ye,
|
|
1265
|
+
Body: Ee,
|
|
1266
|
+
Footer: Ce
|
|
1267
|
+
}), Ne = o.forwardRef(
|
|
1234
1268
|
({
|
|
1235
1269
|
children: t,
|
|
1236
|
-
className:
|
|
1270
|
+
className: n,
|
|
1237
1271
|
variant: r = "default",
|
|
1238
|
-
size:
|
|
1239
|
-
responsive:
|
|
1240
|
-
stickyHeader:
|
|
1241
|
-
...
|
|
1242
|
-
},
|
|
1243
|
-
const
|
|
1272
|
+
size: a = "md",
|
|
1273
|
+
responsive: l = !1,
|
|
1274
|
+
stickyHeader: w = !1,
|
|
1275
|
+
...b
|
|
1276
|
+
}, M) => {
|
|
1277
|
+
const N = d(
|
|
1244
1278
|
// Base styles
|
|
1245
1279
|
"w-full border-collapse bg-[var(--table-bg)] text-[var(--table-text)]",
|
|
1246
1280
|
// Variant styles
|
|
@@ -1249,397 +1283,397 @@ const $e = l.forwardRef(
|
|
|
1249
1283
|
},
|
|
1250
1284
|
// Size styles
|
|
1251
1285
|
{
|
|
1252
|
-
"text-sm":
|
|
1253
|
-
"text-base":
|
|
1254
|
-
"text-lg":
|
|
1286
|
+
"text-sm": a === "sm",
|
|
1287
|
+
"text-base": a === "md",
|
|
1288
|
+
"text-lg": a === "lg"
|
|
1255
1289
|
},
|
|
1256
|
-
|
|
1257
|
-
),
|
|
1290
|
+
n
|
|
1291
|
+
), y = d(
|
|
1258
1292
|
{
|
|
1259
|
-
"overflow-x-auto":
|
|
1260
|
-
"max-h-96 overflow-y-auto":
|
|
1293
|
+
"overflow-x-auto": l,
|
|
1294
|
+
"max-h-96 overflow-y-auto": w
|
|
1261
1295
|
}
|
|
1262
|
-
),
|
|
1296
|
+
), f = /* @__PURE__ */ o.createElement(
|
|
1263
1297
|
"table",
|
|
1264
1298
|
{
|
|
1265
|
-
ref:
|
|
1266
|
-
className:
|
|
1267
|
-
...
|
|
1299
|
+
ref: M,
|
|
1300
|
+
className: N,
|
|
1301
|
+
...b
|
|
1268
1302
|
},
|
|
1269
1303
|
t
|
|
1270
1304
|
);
|
|
1271
|
-
return
|
|
1305
|
+
return l || w ? /* @__PURE__ */ o.createElement("div", { className: y }, f) : f;
|
|
1272
1306
|
}
|
|
1273
|
-
),
|
|
1274
|
-
({ children: t, className:
|
|
1307
|
+
), ke = o.forwardRef(
|
|
1308
|
+
({ children: t, className: n, as: r = "thead", ...a }, l) => /* @__PURE__ */ o.createElement(
|
|
1275
1309
|
r,
|
|
1276
1310
|
{
|
|
1277
|
-
ref:
|
|
1278
|
-
className:
|
|
1311
|
+
ref: l,
|
|
1312
|
+
className: d(
|
|
1279
1313
|
"border-b border-[var(--table-border)] bg-[var(--table-header-bg)]",
|
|
1280
1314
|
{
|
|
1281
1315
|
"sticky top-0 z-10": r === "thead"
|
|
1282
1316
|
},
|
|
1283
|
-
|
|
1317
|
+
n
|
|
1284
1318
|
),
|
|
1285
|
-
...
|
|
1319
|
+
...a
|
|
1286
1320
|
},
|
|
1287
1321
|
t
|
|
1288
1322
|
)
|
|
1289
|
-
),
|
|
1290
|
-
({ children: t, className:
|
|
1323
|
+
), Se = o.forwardRef(
|
|
1324
|
+
({ children: t, className: n, as: r = "tbody", ...a }, l) => /* @__PURE__ */ o.createElement(
|
|
1291
1325
|
r,
|
|
1292
1326
|
{
|
|
1293
|
-
ref:
|
|
1294
|
-
className:
|
|
1327
|
+
ref: l,
|
|
1328
|
+
className: d(
|
|
1295
1329
|
"[&_tr:nth-child(odd)]:bg-[var(--table-row-odd)]",
|
|
1296
1330
|
"[&_tr:nth-child(even)]:bg-[var(--table-row-even)]",
|
|
1297
|
-
|
|
1331
|
+
n
|
|
1298
1332
|
),
|
|
1299
|
-
...
|
|
1333
|
+
...a
|
|
1300
1334
|
},
|
|
1301
1335
|
t
|
|
1302
1336
|
)
|
|
1303
|
-
),
|
|
1304
|
-
({ children: t, className:
|
|
1337
|
+
), Re = o.forwardRef(
|
|
1338
|
+
({ children: t, className: n, as: r = "tfoot", ...a }, l) => /* @__PURE__ */ o.createElement(
|
|
1305
1339
|
r,
|
|
1306
1340
|
{
|
|
1307
|
-
ref:
|
|
1308
|
-
className:
|
|
1341
|
+
ref: l,
|
|
1342
|
+
className: d(
|
|
1309
1343
|
"border-t border-[var(--table-border)] bg-[var(--table-header-bg)] font-medium",
|
|
1310
|
-
|
|
1344
|
+
n
|
|
1311
1345
|
),
|
|
1312
|
-
...
|
|
1346
|
+
...a
|
|
1313
1347
|
},
|
|
1314
1348
|
t
|
|
1315
1349
|
)
|
|
1316
|
-
),
|
|
1317
|
-
({ children: t, className:
|
|
1350
|
+
), Fe = o.forwardRef(
|
|
1351
|
+
({ children: t, className: n, variant: r = "default", ...a }, l) => /* @__PURE__ */ o.createElement(
|
|
1318
1352
|
"tr",
|
|
1319
1353
|
{
|
|
1320
|
-
ref:
|
|
1321
|
-
className:
|
|
1354
|
+
ref: l,
|
|
1355
|
+
className: d(
|
|
1322
1356
|
"border-b border-[var(--table-border)] transition-colors",
|
|
1323
1357
|
{
|
|
1324
1358
|
"hover:bg-[var(--table-row-hover)]": r === "hover",
|
|
1325
1359
|
"bg-[var(--table-row-selected)]": r === "selected"
|
|
1326
1360
|
},
|
|
1327
|
-
|
|
1361
|
+
n
|
|
1328
1362
|
),
|
|
1329
|
-
...
|
|
1363
|
+
...a
|
|
1330
1364
|
},
|
|
1331
1365
|
t
|
|
1332
1366
|
)
|
|
1333
|
-
),
|
|
1367
|
+
), Ie = o.forwardRef(
|
|
1334
1368
|
({
|
|
1335
1369
|
children: t,
|
|
1336
|
-
className:
|
|
1370
|
+
className: n,
|
|
1337
1371
|
as: r = "td",
|
|
1338
|
-
align:
|
|
1339
|
-
scope:
|
|
1340
|
-
colSpan:
|
|
1341
|
-
rowSpan:
|
|
1342
|
-
...
|
|
1343
|
-
},
|
|
1372
|
+
align: a = "left",
|
|
1373
|
+
scope: l,
|
|
1374
|
+
colSpan: w,
|
|
1375
|
+
rowSpan: b,
|
|
1376
|
+
...M
|
|
1377
|
+
}, N) => /* @__PURE__ */ o.createElement(
|
|
1344
1378
|
r,
|
|
1345
1379
|
{
|
|
1346
|
-
ref:
|
|
1347
|
-
scope: r === "th" ?
|
|
1348
|
-
colSpan:
|
|
1349
|
-
rowSpan:
|
|
1350
|
-
className:
|
|
1380
|
+
ref: N,
|
|
1381
|
+
scope: r === "th" ? l : void 0,
|
|
1382
|
+
colSpan: w,
|
|
1383
|
+
rowSpan: b,
|
|
1384
|
+
className: d(
|
|
1351
1385
|
"px-4 py-3 text-left",
|
|
1352
1386
|
{
|
|
1353
1387
|
"font-semibold": r === "th",
|
|
1354
1388
|
"text-sm": r === "td",
|
|
1355
|
-
"text-center":
|
|
1356
|
-
"text-right":
|
|
1389
|
+
"text-center": a === "center",
|
|
1390
|
+
"text-right": a === "right"
|
|
1357
1391
|
},
|
|
1358
|
-
|
|
1392
|
+
n
|
|
1359
1393
|
),
|
|
1360
|
-
...
|
|
1394
|
+
...M
|
|
1361
1395
|
},
|
|
1362
1396
|
t
|
|
1363
1397
|
)
|
|
1364
1398
|
);
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
const
|
|
1372
|
-
Header:
|
|
1373
|
-
Body:
|
|
1374
|
-
Footer:
|
|
1375
|
-
Row:
|
|
1376
|
-
Cell:
|
|
1377
|
-
}),
|
|
1399
|
+
Ne.displayName = "Table";
|
|
1400
|
+
ke.displayName = "TableHeader";
|
|
1401
|
+
Se.displayName = "TableBody";
|
|
1402
|
+
Re.displayName = "TableFooter";
|
|
1403
|
+
Fe.displayName = "TableRow";
|
|
1404
|
+
Ie.displayName = "TableCell";
|
|
1405
|
+
const et = Object.assign(Ne, {
|
|
1406
|
+
Header: ke,
|
|
1407
|
+
Body: Se,
|
|
1408
|
+
Footer: Re,
|
|
1409
|
+
Row: Fe,
|
|
1410
|
+
Cell: Ie
|
|
1411
|
+
}), tt = ({
|
|
1378
1412
|
content: t,
|
|
1379
|
-
children:
|
|
1413
|
+
children: n,
|
|
1380
1414
|
position: r = "top",
|
|
1381
|
-
className:
|
|
1382
|
-
disabled:
|
|
1415
|
+
className: a = "",
|
|
1416
|
+
disabled: l = !1
|
|
1383
1417
|
}) => {
|
|
1384
|
-
const [
|
|
1385
|
-
|
|
1386
|
-
if (!
|
|
1387
|
-
const
|
|
1388
|
-
let
|
|
1418
|
+
const [w, b] = le(!1), [M, N] = le(r), [y, f] = le({}), x = pe(null), c = pe(null);
|
|
1419
|
+
be(() => {
|
|
1420
|
+
if (!w || !c.current) return;
|
|
1421
|
+
const i = c.current.getBoundingClientRect();
|
|
1422
|
+
let R = r, F = 0, B = 0;
|
|
1389
1423
|
switch (r) {
|
|
1390
1424
|
case "top":
|
|
1391
|
-
|
|
1425
|
+
F = i.top - 8, B = i.left + i.width / 2;
|
|
1392
1426
|
break;
|
|
1393
1427
|
case "bottom":
|
|
1394
|
-
|
|
1428
|
+
F = i.bottom + 8, B = i.left + i.width / 2;
|
|
1395
1429
|
break;
|
|
1396
1430
|
case "left":
|
|
1397
|
-
|
|
1431
|
+
F = i.top + i.height / 2, B = i.left - 8;
|
|
1398
1432
|
break;
|
|
1399
1433
|
case "right":
|
|
1400
|
-
|
|
1434
|
+
F = i.top + i.height / 2, B = i.right + 8;
|
|
1401
1435
|
break;
|
|
1402
1436
|
}
|
|
1403
|
-
if (
|
|
1404
|
-
const
|
|
1405
|
-
r === "top" &&
|
|
1437
|
+
if (x.current) {
|
|
1438
|
+
const p = x.current.getBoundingClientRect(), V = window.innerWidth, U = window.innerHeight;
|
|
1439
|
+
r === "top" && i.top < p.height + 16 ? (R = "bottom", F = i.bottom + 8) : r === "bottom" && i.bottom + p.height + 16 > U ? (R = "top", F = i.top - 8) : r === "left" && i.left < p.width + 16 ? (R = "right", B = i.right + 8) : r === "right" && i.right + p.width + 16 > V && (R = "left", B = i.left - 8);
|
|
1406
1440
|
}
|
|
1407
|
-
|
|
1441
|
+
N(R), f({
|
|
1408
1442
|
position: "fixed",
|
|
1409
|
-
top: `${
|
|
1410
|
-
left: `${
|
|
1443
|
+
top: `${F}px`,
|
|
1444
|
+
left: `${B}px`,
|
|
1411
1445
|
zIndex: 9999
|
|
1412
1446
|
});
|
|
1413
|
-
}, [
|
|
1414
|
-
const
|
|
1415
|
-
|
|
1416
|
-
},
|
|
1417
|
-
|
|
1418
|
-
},
|
|
1419
|
-
|
|
1420
|
-
},
|
|
1421
|
-
|
|
1422
|
-
},
|
|
1423
|
-
const
|
|
1424
|
-
switch (
|
|
1447
|
+
}, [w, r]);
|
|
1448
|
+
const I = () => {
|
|
1449
|
+
l || b(!0);
|
|
1450
|
+
}, k = () => {
|
|
1451
|
+
b(!1);
|
|
1452
|
+
}, S = () => {
|
|
1453
|
+
l || b(!0);
|
|
1454
|
+
}, v = () => {
|
|
1455
|
+
b(!1);
|
|
1456
|
+
}, h = () => {
|
|
1457
|
+
const C = "pointer-events-none";
|
|
1458
|
+
switch (M) {
|
|
1425
1459
|
case "top":
|
|
1426
|
-
return `${
|
|
1460
|
+
return `${C} transform -translate-x-1/2 -translate-y-full`;
|
|
1427
1461
|
case "bottom":
|
|
1428
|
-
return `${
|
|
1462
|
+
return `${C} transform -translate-x-1/2`;
|
|
1429
1463
|
case "left":
|
|
1430
|
-
return `${
|
|
1464
|
+
return `${C} transform -translate-x-full -translate-y-1/2`;
|
|
1431
1465
|
case "right":
|
|
1432
|
-
return `${
|
|
1466
|
+
return `${C} transform -translate-y-1/2`;
|
|
1433
1467
|
default:
|
|
1434
|
-
return `${
|
|
1468
|
+
return `${C} transform -translate-x-1/2 -translate-y-full`;
|
|
1435
1469
|
}
|
|
1436
|
-
},
|
|
1437
|
-
const
|
|
1438
|
-
switch (
|
|
1470
|
+
}, E = () => {
|
|
1471
|
+
const C = "absolute w-2 h-2 bg-[var(--tooltip-bg,#374151)] transform rotate-45";
|
|
1472
|
+
switch (M) {
|
|
1439
1473
|
case "top":
|
|
1440
|
-
return `${
|
|
1474
|
+
return `${C} top-full left-1/2 -translate-x-1/2 -translate-y-1/2`;
|
|
1441
1475
|
case "bottom":
|
|
1442
|
-
return `${
|
|
1476
|
+
return `${C} bottom-full left-1/2 -translate-x-1/2 translate-y-1/2`;
|
|
1443
1477
|
case "left":
|
|
1444
|
-
return `${
|
|
1478
|
+
return `${C} left-full top-1/2 -translate-y-1/2 -translate-x-1/2`;
|
|
1445
1479
|
case "right":
|
|
1446
|
-
return `${
|
|
1480
|
+
return `${C} right-full top-1/2 -translate-y-1/2 translate-x-1/2`;
|
|
1447
1481
|
default:
|
|
1448
|
-
return `${
|
|
1482
|
+
return `${C} top-full left-1/2 -translate-x-1/2 -translate-y-1/2`;
|
|
1449
1483
|
}
|
|
1450
1484
|
};
|
|
1451
|
-
return
|
|
1485
|
+
return l || !t ? /* @__PURE__ */ o.createElement(o.Fragment, null, n) : /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
1452
1486
|
"div",
|
|
1453
1487
|
{
|
|
1454
1488
|
className: "relative inline-block",
|
|
1455
|
-
ref:
|
|
1456
|
-
onMouseEnter:
|
|
1457
|
-
onMouseLeave:
|
|
1458
|
-
onFocus:
|
|
1459
|
-
onBlur:
|
|
1489
|
+
ref: c,
|
|
1490
|
+
onMouseEnter: I,
|
|
1491
|
+
onMouseLeave: k,
|
|
1492
|
+
onFocus: S,
|
|
1493
|
+
onBlur: v
|
|
1460
1494
|
},
|
|
1461
|
-
|
|
1462
|
-
),
|
|
1463
|
-
/* @__PURE__ */
|
|
1495
|
+
n
|
|
1496
|
+
), w && typeof document < "u" && he(
|
|
1497
|
+
/* @__PURE__ */ o.createElement(
|
|
1464
1498
|
"div",
|
|
1465
1499
|
{
|
|
1466
|
-
ref:
|
|
1467
|
-
style:
|
|
1468
|
-
className:
|
|
1469
|
-
|
|
1500
|
+
ref: x,
|
|
1501
|
+
style: y,
|
|
1502
|
+
className: d(
|
|
1503
|
+
h(),
|
|
1470
1504
|
"px-2 py-1 text-sm rounded whitespace-nowrap",
|
|
1471
1505
|
"bg-[var(--tooltip-bg,#374151)] text-[var(--tooltip-text,#fff)]",
|
|
1472
1506
|
"shadow-[var(--tooltip-shadow,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]",
|
|
1473
1507
|
"transition-opacity duration-200 ease-in-out",
|
|
1474
|
-
|
|
1508
|
+
a
|
|
1475
1509
|
),
|
|
1476
1510
|
role: "tooltip",
|
|
1477
|
-
"aria-hidden": !
|
|
1511
|
+
"aria-hidden": !w
|
|
1478
1512
|
},
|
|
1479
1513
|
t,
|
|
1480
|
-
/* @__PURE__ */
|
|
1514
|
+
/* @__PURE__ */ o.createElement("div", { className: E() })
|
|
1481
1515
|
),
|
|
1482
1516
|
document.body
|
|
1483
1517
|
));
|
|
1484
|
-
},
|
|
1518
|
+
}, Ye = ({
|
|
1485
1519
|
open: t,
|
|
1486
|
-
onClose:
|
|
1520
|
+
onClose: n,
|
|
1487
1521
|
side: r = "right",
|
|
1488
|
-
size:
|
|
1489
|
-
closeOnOverlayClick:
|
|
1490
|
-
children:
|
|
1491
|
-
className:
|
|
1492
|
-
...
|
|
1522
|
+
size: a = "md",
|
|
1523
|
+
closeOnOverlayClick: l = !0,
|
|
1524
|
+
children: w,
|
|
1525
|
+
className: b = "",
|
|
1526
|
+
...M
|
|
1493
1527
|
}) => {
|
|
1494
|
-
const
|
|
1528
|
+
const N = typeof document < "u" ? document.body : null, y = a === "sm" ? "w-64" : a === "md" ? "w-96" : a === "lg" ? "w-[36rem]" : void 0, f = typeof a == "string" && !["sm", "md", "lg"].includes(a) ? { width: a } : void 0, x = /* @__PURE__ */ o.createElement(
|
|
1495
1529
|
"div",
|
|
1496
1530
|
{
|
|
1497
1531
|
"aria-hidden": !t,
|
|
1498
|
-
className:
|
|
1532
|
+
className: d(
|
|
1499
1533
|
"fixed inset-0 z-50 flex",
|
|
1500
1534
|
t ? "pointer-events-auto" : "pointer-events-none"
|
|
1501
1535
|
)
|
|
1502
1536
|
},
|
|
1503
|
-
/* @__PURE__ */
|
|
1537
|
+
/* @__PURE__ */ o.createElement(
|
|
1504
1538
|
"div",
|
|
1505
1539
|
{
|
|
1506
|
-
className:
|
|
1540
|
+
className: d(
|
|
1507
1541
|
"absolute inset-0 bg-black/40 transition-opacity duration-200",
|
|
1508
1542
|
t ? "opacity-100" : "opacity-0"
|
|
1509
1543
|
),
|
|
1510
|
-
onMouseDown: (
|
|
1511
|
-
|
|
1544
|
+
onMouseDown: (c) => {
|
|
1545
|
+
l && c.target === c.currentTarget && n();
|
|
1512
1546
|
}
|
|
1513
1547
|
}
|
|
1514
1548
|
),
|
|
1515
|
-
/* @__PURE__ */
|
|
1549
|
+
/* @__PURE__ */ o.createElement(
|
|
1516
1550
|
"div",
|
|
1517
1551
|
{
|
|
1518
|
-
className:
|
|
1552
|
+
className: d(
|
|
1519
1553
|
"relative h-full",
|
|
1520
1554
|
r === "right" ? "ml-auto" : "mr-auto",
|
|
1521
1555
|
// ensure the sheet doesn't shrink
|
|
1522
1556
|
"flex-shrink-0"
|
|
1523
1557
|
),
|
|
1524
|
-
style:
|
|
1558
|
+
style: f
|
|
1525
1559
|
},
|
|
1526
|
-
/* @__PURE__ */
|
|
1560
|
+
/* @__PURE__ */ o.createElement(
|
|
1527
1561
|
"aside",
|
|
1528
1562
|
{
|
|
1529
1563
|
role: "dialog",
|
|
1530
1564
|
"aria-modal": !0,
|
|
1531
|
-
className:
|
|
1565
|
+
className: d(
|
|
1532
1566
|
"h-full bg-white shadow-xl border-l border-gray-100 overflow-auto transition-transform duration-300",
|
|
1533
1567
|
r === "right" ? t ? "translate-x-0" : "translate-x-full" : t ? "translate-x-0" : "-translate-x-full",
|
|
1534
|
-
|
|
1535
|
-
|
|
1568
|
+
y,
|
|
1569
|
+
b
|
|
1536
1570
|
),
|
|
1537
|
-
style:
|
|
1538
|
-
...
|
|
1571
|
+
style: f,
|
|
1572
|
+
...M
|
|
1539
1573
|
},
|
|
1540
|
-
|
|
1574
|
+
w
|
|
1541
1575
|
)
|
|
1542
1576
|
)
|
|
1543
1577
|
);
|
|
1544
|
-
return
|
|
1578
|
+
return N ? he(x, N) : null;
|
|
1545
1579
|
};
|
|
1546
|
-
|
|
1547
|
-
const
|
|
1580
|
+
Ye.displayName = "AsideSheet";
|
|
1581
|
+
const rt = ({
|
|
1548
1582
|
avatar: t = !1,
|
|
1549
|
-
value:
|
|
1583
|
+
value: n,
|
|
1550
1584
|
onUpload: r,
|
|
1551
|
-
onRemove:
|
|
1552
|
-
accept:
|
|
1553
|
-
maxSize:
|
|
1554
|
-
placeholder:
|
|
1555
|
-
loading:
|
|
1556
|
-
size:
|
|
1557
|
-
label:
|
|
1558
|
-
error:
|
|
1559
|
-
disabled:
|
|
1560
|
-
className:
|
|
1561
|
-
...
|
|
1585
|
+
onRemove: a,
|
|
1586
|
+
accept: l = "image/*",
|
|
1587
|
+
maxSize: w,
|
|
1588
|
+
placeholder: b = "Selecionar imagem",
|
|
1589
|
+
loading: M = !1,
|
|
1590
|
+
size: N = "md",
|
|
1591
|
+
label: y,
|
|
1592
|
+
error: f,
|
|
1593
|
+
disabled: x,
|
|
1594
|
+
className: c,
|
|
1595
|
+
...I
|
|
1562
1596
|
}) => {
|
|
1563
|
-
const [
|
|
1597
|
+
const [k, S] = le(null), [v, h] = le(""), [E, C] = le(!1), i = pe(null), R = !!n, F = !!k, B = R || F, p = M || E, V = {
|
|
1564
1598
|
sm: t ? "w-16 h-16" : "w-24 h-16",
|
|
1565
1599
|
md: t ? "w-24 h-24" : "w-32 h-24",
|
|
1566
1600
|
lg: t ? "w-32 h-32" : "w-40 h-32"
|
|
1567
|
-
},
|
|
1568
|
-
var
|
|
1569
|
-
const
|
|
1570
|
-
if (!
|
|
1571
|
-
if (
|
|
1572
|
-
alert(`Arquivo muito grande. Tamanho máximo: ${(
|
|
1601
|
+
}, L = b || (t ? "Adicionar foto" : "Selecionar imagem"), J = (_) => {
|
|
1602
|
+
var z;
|
|
1603
|
+
const P = (z = _.target.files) == null ? void 0 : z[0];
|
|
1604
|
+
if (!P) return;
|
|
1605
|
+
if (w && P.size > w) {
|
|
1606
|
+
alert(`Arquivo muito grande. Tamanho máximo: ${(w / 1024 / 1024).toFixed(1)}MB`);
|
|
1573
1607
|
return;
|
|
1574
1608
|
}
|
|
1575
|
-
const
|
|
1576
|
-
|
|
1577
|
-
var
|
|
1578
|
-
|
|
1579
|
-
},
|
|
1580
|
-
},
|
|
1581
|
-
if (!(!
|
|
1609
|
+
const q = new FileReader();
|
|
1610
|
+
q.onload = (Y) => {
|
|
1611
|
+
var j;
|
|
1612
|
+
h((j = Y.target) == null ? void 0 : j.result), S(P);
|
|
1613
|
+
}, q.readAsDataURL(P);
|
|
1614
|
+
}, Z = async () => {
|
|
1615
|
+
if (!(!k || !r))
|
|
1582
1616
|
try {
|
|
1583
|
-
|
|
1584
|
-
const
|
|
1585
|
-
|
|
1586
|
-
} catch (
|
|
1587
|
-
console.error("Erro ao fazer upload:",
|
|
1617
|
+
C(!0);
|
|
1618
|
+
const _ = await r(k);
|
|
1619
|
+
S(null), h(""), i.current && (i.current.value = "");
|
|
1620
|
+
} catch (_) {
|
|
1621
|
+
console.error("Erro ao fazer upload:", _), alert("Erro ao fazer upload da imagem");
|
|
1588
1622
|
} finally {
|
|
1589
|
-
|
|
1623
|
+
C(!1);
|
|
1590
1624
|
}
|
|
1591
|
-
},
|
|
1592
|
-
|
|
1625
|
+
}, G = () => {
|
|
1626
|
+
S(null), h(""), i.current && (i.current.value = "");
|
|
1593
1627
|
}, W = async () => {
|
|
1594
1628
|
try {
|
|
1595
|
-
|
|
1596
|
-
} catch (
|
|
1597
|
-
console.error("Erro ao remover imagem:",
|
|
1629
|
+
a && await a(n), S(null), h(""), i.current && (i.current.value = "");
|
|
1630
|
+
} catch (_) {
|
|
1631
|
+
console.error("Erro ao remover imagem:", _), alert("Erro ao remover imagem");
|
|
1598
1632
|
}
|
|
1599
|
-
},
|
|
1600
|
-
var
|
|
1601
|
-
|
|
1602
|
-
},
|
|
1603
|
-
return /* @__PURE__ */
|
|
1633
|
+
}, $ = () => {
|
|
1634
|
+
var _;
|
|
1635
|
+
x || p || (_ = i.current) == null || _.click();
|
|
1636
|
+
}, X = v || n;
|
|
1637
|
+
return /* @__PURE__ */ o.createElement("div", { className: d("flex flex-col space-y-2", c) }, y && /* @__PURE__ */ o.createElement("label", { className: "text-sm font-medium text-gray-700" }, y), /* @__PURE__ */ o.createElement("div", { className: "relative flex flex-col items-center" }, /* @__PURE__ */ o.createElement(
|
|
1604
1638
|
"input",
|
|
1605
1639
|
{
|
|
1606
|
-
ref:
|
|
1640
|
+
ref: i,
|
|
1607
1641
|
type: "file",
|
|
1608
|
-
accept:
|
|
1609
|
-
onChange:
|
|
1610
|
-
disabled:
|
|
1642
|
+
accept: l,
|
|
1643
|
+
onChange: J,
|
|
1644
|
+
disabled: x || p,
|
|
1611
1645
|
className: "hidden",
|
|
1612
|
-
...
|
|
1646
|
+
...I
|
|
1613
1647
|
}
|
|
1614
|
-
), /* @__PURE__ */
|
|
1648
|
+
), /* @__PURE__ */ o.createElement(
|
|
1615
1649
|
"div",
|
|
1616
1650
|
{
|
|
1617
|
-
onClick:
|
|
1618
|
-
className:
|
|
1651
|
+
onClick: $,
|
|
1652
|
+
className: d(
|
|
1619
1653
|
// Base styles
|
|
1620
1654
|
"relative border-2 border-dashed border-gray-300 transition-colors cursor-pointer",
|
|
1621
1655
|
"hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",
|
|
1622
1656
|
// Shape
|
|
1623
1657
|
t ? "rounded-full" : "rounded-lg",
|
|
1624
1658
|
// Size
|
|
1625
|
-
|
|
1659
|
+
V[N],
|
|
1626
1660
|
// States
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1661
|
+
x && "opacity-50 cursor-not-allowed",
|
|
1662
|
+
p && "cursor-wait",
|
|
1663
|
+
f && "border-red-300",
|
|
1630
1664
|
// Background
|
|
1631
|
-
!
|
|
1632
|
-
|
|
1665
|
+
!B && "bg-gray-50 hover:bg-gray-100",
|
|
1666
|
+
B && "border-solid border-gray-200"
|
|
1633
1667
|
)
|
|
1634
1668
|
},
|
|
1635
|
-
|
|
1669
|
+
B ? (
|
|
1636
1670
|
// Preview da imagem
|
|
1637
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ o.createElement(
|
|
1638
1672
|
"img",
|
|
1639
1673
|
{
|
|
1640
|
-
src:
|
|
1674
|
+
src: X,
|
|
1641
1675
|
alt: "Preview",
|
|
1642
|
-
className:
|
|
1676
|
+
className: d(
|
|
1643
1677
|
"w-full h-full object-cover",
|
|
1644
1678
|
t ? "rounded-full" : "rounded-lg"
|
|
1645
1679
|
)
|
|
@@ -1647,9 +1681,9 @@ const qe = ({
|
|
|
1647
1681
|
)
|
|
1648
1682
|
) : (
|
|
1649
1683
|
// Estado vazio
|
|
1650
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ o.createElement("div", { className: "flex flex-col items-center justify-center h-full text-gray-500 text-sm" }, t ? (
|
|
1651
1685
|
// Ícone de usuário para avatar
|
|
1652
|
-
/* @__PURE__ */
|
|
1686
|
+
/* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
1653
1687
|
"svg",
|
|
1654
1688
|
{
|
|
1655
1689
|
className: "w-8 h-8 mb-1",
|
|
@@ -1657,7 +1691,7 @@ const qe = ({
|
|
|
1657
1691
|
stroke: "currentColor",
|
|
1658
1692
|
viewBox: "0 0 24 24"
|
|
1659
1693
|
},
|
|
1660
|
-
/* @__PURE__ */
|
|
1694
|
+
/* @__PURE__ */ o.createElement(
|
|
1661
1695
|
"path",
|
|
1662
1696
|
{
|
|
1663
1697
|
strokeLinecap: "round",
|
|
@@ -1666,10 +1700,10 @@ const qe = ({
|
|
|
1666
1700
|
d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"
|
|
1667
1701
|
}
|
|
1668
1702
|
)
|
|
1669
|
-
), /* @__PURE__ */
|
|
1703
|
+
), /* @__PURE__ */ o.createElement("span", { className: "text-center px-2 text-xs" }, L))
|
|
1670
1704
|
) : (
|
|
1671
1705
|
// Ícone de adicionar imagem genérica
|
|
1672
|
-
/* @__PURE__ */
|
|
1706
|
+
/* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
1673
1707
|
"svg",
|
|
1674
1708
|
{
|
|
1675
1709
|
className: "w-6 h-6 mb-1",
|
|
@@ -1677,7 +1711,7 @@ const qe = ({
|
|
|
1677
1711
|
stroke: "currentColor",
|
|
1678
1712
|
viewBox: "0 0 24 24"
|
|
1679
1713
|
},
|
|
1680
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ o.createElement(
|
|
1681
1715
|
"path",
|
|
1682
1716
|
{
|
|
1683
1717
|
strokeLinecap: "round",
|
|
@@ -1686,64 +1720,202 @@ const qe = ({
|
|
|
1686
1720
|
d: "M12 6v6m0 0v6m0-6h6m-6 0H6"
|
|
1687
1721
|
}
|
|
1688
1722
|
)
|
|
1689
|
-
), /* @__PURE__ */
|
|
1723
|
+
), /* @__PURE__ */ o.createElement("span", { className: "text-center px-2" }, L))
|
|
1690
1724
|
))
|
|
1691
1725
|
),
|
|
1692
|
-
|
|
1726
|
+
p && /* @__PURE__ */ o.createElement("div", { className: d(
|
|
1693
1727
|
"absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center",
|
|
1694
1728
|
t ? "rounded-full" : "rounded-lg"
|
|
1695
|
-
) }, /* @__PURE__ */
|
|
1696
|
-
),
|
|
1729
|
+
) }, /* @__PURE__ */ o.createElement("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }))
|
|
1730
|
+
), B && !p && /* @__PURE__ */ o.createElement("div", { className: "flex justify-center space-x-2 mt-3" }, F ? (
|
|
1697
1731
|
// Ações para arquivo selecionado (não salvo ainda)
|
|
1698
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
1699
1733
|
"button",
|
|
1700
1734
|
{
|
|
1701
|
-
onClick:
|
|
1735
|
+
onClick: Z,
|
|
1702
1736
|
disabled: !r,
|
|
1703
1737
|
className: "px-3 py-1 bg-blue-600 text-white text-sm rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
1704
1738
|
},
|
|
1705
1739
|
"Confirmar"
|
|
1706
|
-
), /* @__PURE__ */
|
|
1740
|
+
), /* @__PURE__ */ o.createElement(
|
|
1707
1741
|
"button",
|
|
1708
1742
|
{
|
|
1709
|
-
onClick:
|
|
1743
|
+
onClick: G,
|
|
1710
1744
|
className: "px-3 py-1 bg-gray-600 text-white text-sm rounded hover:bg-gray-700"
|
|
1711
1745
|
},
|
|
1712
1746
|
"Cancelar"
|
|
1713
1747
|
))
|
|
1714
1748
|
) : (
|
|
1715
1749
|
// Ações para imagem já salva
|
|
1716
|
-
/* @__PURE__ */
|
|
1750
|
+
/* @__PURE__ */ o.createElement(
|
|
1717
1751
|
"button",
|
|
1718
1752
|
{
|
|
1719
1753
|
onClick: W,
|
|
1720
|
-
disabled: !
|
|
1754
|
+
disabled: !a,
|
|
1721
1755
|
className: "px-3 py-1 bg-red-600 text-white text-sm rounded hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed"
|
|
1722
1756
|
},
|
|
1723
1757
|
"Remover"
|
|
1724
1758
|
)
|
|
1725
|
-
))),
|
|
1759
|
+
))), f && /* @__PURE__ */ o.createElement("p", { className: "text-sm text-red-600" }, f), w && !B && /* @__PURE__ */ o.createElement("p", { className: "text-xs text-gray-500" }, "Tamanho máximo: ", (w / 1024 / 1024).toFixed(1), "MB"), t && !B && /* @__PURE__ */ o.createElement("p", { className: "text-xs text-gray-500 text-center" }, "Use uma foto com seu rosto centralizado e bem visível"));
|
|
1760
|
+
}, Me = o.createContext(null), Ge = () => {
|
|
1761
|
+
const t = o.useContext(Me);
|
|
1762
|
+
if (!t)
|
|
1763
|
+
throw new Error("AccordionItem must be used within an Accordion");
|
|
1764
|
+
return t;
|
|
1765
|
+
};
|
|
1766
|
+
let Le = 0;
|
|
1767
|
+
const Be = ({
|
|
1768
|
+
title: t,
|
|
1769
|
+
children: n,
|
|
1770
|
+
defaultOpen: r = !1,
|
|
1771
|
+
disabled: a = !1,
|
|
1772
|
+
className: l,
|
|
1773
|
+
headerClassName: w,
|
|
1774
|
+
contentClassName: b,
|
|
1775
|
+
icon: M
|
|
1776
|
+
}) => {
|
|
1777
|
+
const { openItems: N, toggleItem: y, variant: f } = Ge(), [x] = le(() => Le++), c = N.has(x), I = pe(null), [k, S] = le(r ? void 0 : 0);
|
|
1778
|
+
be(() => {
|
|
1779
|
+
if (c) {
|
|
1780
|
+
const C = I.current;
|
|
1781
|
+
C && S(C.scrollHeight);
|
|
1782
|
+
} else
|
|
1783
|
+
S(0);
|
|
1784
|
+
}, [c]);
|
|
1785
|
+
const v = () => {
|
|
1786
|
+
a || y(x);
|
|
1787
|
+
}, E = {
|
|
1788
|
+
default: {
|
|
1789
|
+
item: "border-b border-[var(--accordion-border,#e5e7eb)] last:border-b-0",
|
|
1790
|
+
header: "",
|
|
1791
|
+
content: ""
|
|
1792
|
+
},
|
|
1793
|
+
bordered: {
|
|
1794
|
+
item: "border border-[var(--accordion-border,#e5e7eb)] rounded-md mb-2",
|
|
1795
|
+
header: "border-b border-[var(--accordion-border,#e5e7eb)]",
|
|
1796
|
+
content: ""
|
|
1797
|
+
},
|
|
1798
|
+
separated: {
|
|
1799
|
+
item: "border border-[var(--accordion-border,#e5e7eb)] rounded-md mb-3 shadow-sm",
|
|
1800
|
+
header: "",
|
|
1801
|
+
content: ""
|
|
1802
|
+
}
|
|
1803
|
+
}[f];
|
|
1804
|
+
return /* @__PURE__ */ o.createElement("div", { className: d(E.item, l) }, /* @__PURE__ */ o.createElement(
|
|
1805
|
+
"button",
|
|
1806
|
+
{
|
|
1807
|
+
type: "button",
|
|
1808
|
+
onClick: v,
|
|
1809
|
+
disabled: a,
|
|
1810
|
+
"aria-expanded": c,
|
|
1811
|
+
className: d(
|
|
1812
|
+
"w-full flex items-center justify-between px-4 py-3 text-left transition-colors",
|
|
1813
|
+
"bg-[var(--accordion-header-bg,transparent)]",
|
|
1814
|
+
"hover:bg-[var(--accordion-header-hover,rgba(0,0,0,0.05))]",
|
|
1815
|
+
"text-[var(--accordion-text,#111827)]",
|
|
1816
|
+
"font-medium",
|
|
1817
|
+
a && "opacity-50 cursor-not-allowed",
|
|
1818
|
+
c && f !== "default" && E.header,
|
|
1819
|
+
w
|
|
1820
|
+
)
|
|
1821
|
+
},
|
|
1822
|
+
/* @__PURE__ */ o.createElement("span", { className: "flex items-center gap-2" }, M && /* @__PURE__ */ o.createElement("span", { className: "flex-shrink-0" }, M), t),
|
|
1823
|
+
/* @__PURE__ */ o.createElement(
|
|
1824
|
+
"svg",
|
|
1825
|
+
{
|
|
1826
|
+
className: d(
|
|
1827
|
+
"w-5 h-5 transition-transform duration-200 flex-shrink-0",
|
|
1828
|
+
"text-[var(--accordion-icon,#6b7280)]",
|
|
1829
|
+
c && "rotate-180"
|
|
1830
|
+
),
|
|
1831
|
+
fill: "none",
|
|
1832
|
+
strokeWidth: "2",
|
|
1833
|
+
stroke: "currentColor",
|
|
1834
|
+
viewBox: "0 0 24 24"
|
|
1835
|
+
},
|
|
1836
|
+
/* @__PURE__ */ o.createElement("path", { d: "M19 9l-7 7-7-7" })
|
|
1837
|
+
)
|
|
1838
|
+
), /* @__PURE__ */ o.createElement(
|
|
1839
|
+
"div",
|
|
1840
|
+
{
|
|
1841
|
+
style: {
|
|
1842
|
+
height: k,
|
|
1843
|
+
overflow: "hidden",
|
|
1844
|
+
transition: "height 0.3s ease-in-out"
|
|
1845
|
+
}
|
|
1846
|
+
},
|
|
1847
|
+
/* @__PURE__ */ o.createElement(
|
|
1848
|
+
"div",
|
|
1849
|
+
{
|
|
1850
|
+
ref: I,
|
|
1851
|
+
className: d(
|
|
1852
|
+
"px-4 py-3",
|
|
1853
|
+
"text-[var(--accordion-content-text,#374151)]",
|
|
1854
|
+
"bg-[var(--accordion-content-bg,transparent)]",
|
|
1855
|
+
b
|
|
1856
|
+
)
|
|
1857
|
+
},
|
|
1858
|
+
n
|
|
1859
|
+
)
|
|
1860
|
+
));
|
|
1861
|
+
};
|
|
1862
|
+
Be.displayName = "AccordionItem";
|
|
1863
|
+
const qe = ({
|
|
1864
|
+
children: t,
|
|
1865
|
+
type: n = "single",
|
|
1866
|
+
className: r,
|
|
1867
|
+
variant: a = "default",
|
|
1868
|
+
collapsible: l = !0
|
|
1869
|
+
}) => {
|
|
1870
|
+
const [w, b] = le(/* @__PURE__ */ new Set());
|
|
1871
|
+
be(() => {
|
|
1872
|
+
Le = 0;
|
|
1873
|
+
const N = o.Children.toArray(t), y = /* @__PURE__ */ new Set();
|
|
1874
|
+
if (N.forEach((f, x) => {
|
|
1875
|
+
o.isValidElement(f) && f.props.defaultOpen && y.add(x);
|
|
1876
|
+
}), n === "single" && y.size > 1) {
|
|
1877
|
+
const f = Array.from(y)[0];
|
|
1878
|
+
b(/* @__PURE__ */ new Set([f]));
|
|
1879
|
+
} else
|
|
1880
|
+
b(y);
|
|
1881
|
+
}, [t, n]);
|
|
1882
|
+
const M = (N) => {
|
|
1883
|
+
b((y) => {
|
|
1884
|
+
const f = new Set(y);
|
|
1885
|
+
return n === "single" ? f.has(N) ? l && f.clear() : (f.clear(), f.add(N)) : f.has(N) ? f.delete(N) : f.add(N), f;
|
|
1886
|
+
});
|
|
1887
|
+
};
|
|
1888
|
+
return /* @__PURE__ */ o.createElement(
|
|
1889
|
+
Me.Provider,
|
|
1890
|
+
{
|
|
1891
|
+
value: { type: n, openItems: w, toggleItem: M, collapsible: l, variant: a }
|
|
1892
|
+
},
|
|
1893
|
+
/* @__PURE__ */ o.createElement("div", { className: d("w-full", r) }, t)
|
|
1894
|
+
);
|
|
1726
1895
|
};
|
|
1896
|
+
qe.Item = Be;
|
|
1727
1897
|
export {
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1898
|
+
qe as Accordion,
|
|
1899
|
+
Be as AccordionItem,
|
|
1900
|
+
Ye as AsideSheet,
|
|
1901
|
+
We as AsyncSelect,
|
|
1902
|
+
Xe as Button,
|
|
1903
|
+
Ze as Card,
|
|
1904
|
+
Ee as CardBody,
|
|
1905
|
+
Ce as CardFooter,
|
|
1906
|
+
ye as CardHeader,
|
|
1907
|
+
rt as ImageInput,
|
|
1908
|
+
$e as Input,
|
|
1909
|
+
He as MultiAsyncSelect,
|
|
1910
|
+
Ve as MultiSelect,
|
|
1911
|
+
je as RadioGroup,
|
|
1912
|
+
ze as Select,
|
|
1913
|
+
et as Table,
|
|
1914
|
+
Se as TableBody,
|
|
1915
|
+
Ie as TableCell,
|
|
1916
|
+
Re as TableFooter,
|
|
1917
|
+
ke as TableHeader,
|
|
1918
|
+
Fe as TableRow,
|
|
1919
|
+
Oe as Textarea,
|
|
1920
|
+
tt as Tooltip
|
|
1749
1921
|
};
|