rharuow-ds 1.3.0 → 1.3.2

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.
@@ -1,104 +1,104 @@
1
1
  import * as e from "react";
2
- import F from "react";
3
- import { useFormContext as j, useWatch as D } from "react-hook-form";
4
- function ne(t) {
5
- var r, a, n = "";
2
+ import L from "react";
3
+ import { useFormContext as X, useWatch as G } from "react-hook-form";
4
+ function se(t) {
5
+ var o, a, n = "";
6
6
  if (typeof t == "string" || typeof t == "number") n += t;
7
7
  else if (typeof t == "object") if (Array.isArray(t)) {
8
- var s = t.length;
9
- for (r = 0; r < s; r++) t[r] && (a = ne(t[r])) && (n && (n += " "), n += a);
8
+ var i = t.length;
9
+ for (o = 0; o < i; o++) t[o] && (a = se(t[o])) && (n && (n += " "), n += a);
10
10
  } else for (a in t) t[a] && (n && (n += " "), n += a);
11
11
  return n;
12
12
  }
13
- function ve() {
14
- for (var t, r, a = 0, n = "", s = arguments.length; a < s; a++) (t = arguments[a]) && (r = ne(t)) && (n && (n += " "), n += r);
13
+ function ge() {
14
+ for (var t, o, a = 0, n = "", i = arguments.length; a < i; a++) (t = arguments[a]) && (o = se(t)) && (n && (n += " "), n += o);
15
15
  return n;
16
16
  }
17
- function o(...t) {
18
- return ve(...t);
17
+ function s(...t) {
18
+ return ge(...t);
19
19
  }
20
- const Re = ({
20
+ const Fe = ({
21
21
  children: t,
22
- variant: r = "default",
22
+ variant: o = "default",
23
23
  className: a = "",
24
24
  ...n
25
25
  }) => {
26
- const s = "px-4 py-2 rounded font-medium transition", C = {
26
+ const i = "px-4 py-2 rounded font-medium transition", C = {
27
27
  default: "bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",
28
28
  outline: "border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",
29
29
  secondary: "bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"
30
30
  };
31
- return /* @__PURE__ */ F.createElement("button", { className: o(s, C[r], a), ...n }, t);
32
- }, xe = e.forwardRef(
31
+ return /* @__PURE__ */ L.createElement("button", { className: s(i, C[o], a), ...n }, t);
32
+ }, he = e.forwardRef(
33
33
  ({
34
34
  name: t,
35
- className: r,
35
+ className: o,
36
36
  type: a = "text",
37
37
  label: n,
38
- onFocus: s,
38
+ onFocus: i,
39
39
  onBlur: C,
40
- Icon: p,
41
- iconClassName: _,
42
- iconAction: i,
43
- containerClassName: w,
44
- ...E
45
- }, b) => {
46
- var V, v, l;
47
- const [N, h] = e.useState(!1), [d, m] = e.useState(!1), y = j(), k = y == null ? void 0 : y.control, c = y == null ? void 0 : y.register, R = k && t ? D({ control: k, name: t }) : void 0, T = E.value ?? R ?? "", x = (l = (v = (V = y == null ? void 0 : y.formState) == null ? void 0 : V.errors) == null ? void 0 : v[t]) == null ? void 0 : l.message, L = N || !!T, I = a === "password" ? d ? "text" : "password" : a, S = () => /* @__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(
40
+ Icon: w,
41
+ iconClassName: z,
42
+ iconAction: f,
43
+ containerClassName: E,
44
+ ...N
45
+ }, p) => {
46
+ var A, H, O;
47
+ const [d, y] = e.useState(!1), [m, M] = e.useState(!1), x = X(), l = x == null ? void 0 : x.control, g = x == null ? void 0 : x.register, F = l && t ? G({ control: l, name: t }) : void 0, v = N.value ?? F ?? "", h = (O = (H = (A = x == null ? void 0 : x.formState) == null ? void 0 : A.errors) == null ? void 0 : H[t]) == null ? void 0 : O.message, T = d || !!v, R = a === "password" ? m ? "text" : "password" : a, S = () => /* @__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(
48
48
  "path",
49
49
  {
50
50
  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",
51
51
  fill: "currentColor"
52
52
  }
53
- )), M = () => /* @__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(
53
+ )), V = () => /* @__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(
54
54
  "path",
55
55
  {
56
56
  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",
57
57
  fill: "currentColor"
58
58
  }
59
- )), z = () => {
60
- m(!d);
59
+ )), I = () => {
60
+ M(!m);
61
61
  };
62
- return /* @__PURE__ */ e.createElement("div", { className: o("relative", w) }, /* @__PURE__ */ e.createElement(
62
+ return /* @__PURE__ */ e.createElement("div", { className: s("relative", E) }, /* @__PURE__ */ e.createElement(
63
63
  "input",
64
64
  {
65
- id: E.id || t,
66
- type: I,
67
- className: o(
65
+ id: N.id || t,
66
+ type: R,
67
+ className: s(
68
68
  "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",
69
- a === "password" || p ? "pr-12" : "",
69
+ a === "password" || w ? "pr-12" : "",
70
70
  // espaço extra para qualquer ícone (password ou customizado)
71
- r
71
+ o
72
72
  ),
73
- onFocus: (f) => {
74
- h(!0), s && s(f);
73
+ onFocus: (k) => {
74
+ y(!0), i && i(k);
75
75
  },
76
- ...y && t ? (() => {
77
- const f = c(t), A = f.onBlur;
76
+ ...x && t ? (() => {
77
+ const k = g(t), c = k.onBlur;
78
78
  return {
79
- ...f,
80
- ref: (B) => {
81
- typeof b == "function" ? b(B) : b && (b.current = B), f.ref && f.ref(B);
79
+ ...k,
80
+ ref: (r) => {
81
+ typeof p == "function" ? p(r) : p && (p.current = r), k.ref && k.ref(r);
82
82
  },
83
- onBlur: (B) => {
84
- h(!1), C && C(B), A && A(B);
83
+ onBlur: (r) => {
84
+ y(!1), C && C(r), c && c(r);
85
85
  }
86
86
  };
87
87
  })() : {
88
- ref: b,
89
- onBlur: (f) => {
90
- h(!1), C && C(f);
88
+ ref: p,
89
+ onBlur: (k) => {
90
+ y(!1), C && C(k);
91
91
  }
92
92
  },
93
- ...E
93
+ ...N
94
94
  }
95
95
  ), n && /* @__PURE__ */ e.createElement(
96
96
  "label",
97
97
  {
98
- htmlFor: E.id || t,
99
- className: o(
98
+ htmlFor: N.id || t,
99
+ className: s(
100
100
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
101
- L ? "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"
101
+ T ? "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"
102
102
  )
103
103
  },
104
104
  n
@@ -107,426 +107,504 @@ const Re = ({
107
107
  {
108
108
  type: "button",
109
109
  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)]",
110
- onClick: z,
111
- "aria-label": d ? "Esconder senha" : "Mostrar senha",
110
+ onClick: I,
111
+ "aria-label": m ? "Esconder senha" : "Mostrar senha",
112
112
  tabIndex: -1
113
113
  },
114
- d ? /* @__PURE__ */ e.createElement(M, null) : /* @__PURE__ */ e.createElement(S, null)
115
- ), p && a !== "password" && /* @__PURE__ */ e.createElement(
114
+ m ? /* @__PURE__ */ e.createElement(V, null) : /* @__PURE__ */ e.createElement(S, null)
115
+ ), w && a !== "password" && /* @__PURE__ */ e.createElement(
116
116
  "div",
117
117
  {
118
- className: o(
118
+ className: s(
119
119
  "absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",
120
- _
120
+ z
121
121
  ),
122
- onClick: i
122
+ onClick: f
123
123
  },
124
- /* @__PURE__ */ e.createElement(p, null)
125
- ), x && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, x));
124
+ /* @__PURE__ */ e.createElement(w, null)
125
+ ), h && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, h));
126
126
  }
127
127
  );
128
- xe.displayName = "Input";
129
- const ge = e.forwardRef(
128
+ he.displayName = "Input";
129
+ const we = e.forwardRef(
130
130
  ({
131
131
  name: t,
132
- label: r,
132
+ label: o,
133
133
  options: a,
134
134
  className: n,
135
- containerClassName: s,
135
+ containerClassName: i,
136
136
  isClearable: C,
137
- onFocus: p,
138
- onBlur: _,
139
- ...i
140
- }, w) => {
141
- var S, M, z, V;
142
- const [E, b] = e.useState(!1), [N, h] = e.useState(!1), d = e.useRef(null), m = j(), y = m == null ? void 0 : m.control, k = y && t ? D({ control: y, name: t }) : void 0, c = i.value ?? k ?? "", R = (z = (M = (S = m == null ? void 0 : m.formState) == null ? void 0 : S.errors) == null ? void 0 : M[t]) == null ? void 0 : z.message, T = E || !!c;
137
+ onFocus: w,
138
+ onBlur: z,
139
+ ...f
140
+ }, E) => {
141
+ var A, H, O, k;
142
+ const [N, p] = e.useState(!1), [d, y] = e.useState(!1), [m, M] = e.useState({
143
+ top: 0,
144
+ left: 0,
145
+ width: 0
146
+ }), x = e.useRef(null), l = X(), g = l == null ? void 0 : l.control, F = g && t ? G({ control: g, name: t }) : void 0, v = f.value ?? F ?? "", h = (O = (H = (A = l == null ? void 0 : l.formState) == null ? void 0 : A.errors) == null ? void 0 : H[t]) == null ? void 0 : O.message, T = N || !!v, R = e.useCallback(() => {
147
+ if (x.current && d) {
148
+ const c = x.current.getBoundingClientRect();
149
+ M({
150
+ top: c.bottom + window.scrollY + 4,
151
+ left: c.left + window.scrollX,
152
+ width: c.width
153
+ });
154
+ }
155
+ }, [d]);
143
156
  e.useEffect(() => {
144
- const v = (l) => {
145
- d.current && !d.current.contains(l.target) && (h(!1), b(!1));
157
+ if (R(), d) {
158
+ const c = () => R(), r = () => R();
159
+ return window.addEventListener("resize", c), window.addEventListener("scroll", r, !0), () => {
160
+ window.removeEventListener("resize", c), window.removeEventListener("scroll", r, !0);
161
+ };
162
+ }
163
+ }, [d, R]), e.useEffect(() => {
164
+ const c = (r) => {
165
+ x.current && !x.current.contains(r.target) && (y(!1), p(!1));
146
166
  };
147
- return document.addEventListener("mousedown", v), () => {
148
- document.removeEventListener("mousedown", v);
167
+ return document.addEventListener("mousedown", c), () => {
168
+ document.removeEventListener("mousedown", c);
149
169
  };
150
170
  }, []);
151
- const x = () => {
152
- h((v) => !v), b(!0);
153
- }, L = (v) => {
154
- b(!0), p && p(v);
155
- }, I = (v) => {
156
- _ && _(v);
171
+ const S = () => {
172
+ y((c) => !c), p(!0);
173
+ }, V = (c) => {
174
+ p(!0), w && w(c);
175
+ }, I = (c) => {
176
+ z && z(c);
157
177
  };
158
- return /* @__PURE__ */ e.createElement("div", { className: o("relative", s), ref: d }, /* @__PURE__ */ e.createElement(
178
+ return /* @__PURE__ */ e.createElement("div", { className: s("relative", i), ref: x }, /* @__PURE__ */ e.createElement(
159
179
  "div",
160
180
  {
161
- id: i.id || t,
181
+ id: f.id || t,
162
182
  tabIndex: 0,
163
183
  role: "button",
164
184
  "aria-haspopup": "listbox",
165
- "aria-expanded": N,
166
- className: o(
185
+ "aria-expanded": d,
186
+ className: s(
167
187
  "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",
168
188
  n
169
189
  ),
170
- onClick: x,
171
- onFocus: L,
190
+ onClick: S,
191
+ onFocus: V,
172
192
  onBlur: I,
173
- ref: w
193
+ ref: E
174
194
  },
175
- /* @__PURE__ */ e.createElement("span", { className: o("block truncate", !c && "text-gray-400") }, ((V = a.find((v) => v.value === c)) == null ? void 0 : V.label) || !r && "Selecione..."),
176
- C && c && /* @__PURE__ */ e.createElement(
195
+ /* @__PURE__ */ e.createElement("span", { className: s("block truncate", !v && "text-gray-400") }, ((k = a.find((c) => c.value === v)) == null ? void 0 : k.label) || !o && "Selecione..."),
196
+ C && v && /* @__PURE__ */ e.createElement(
177
197
  "button",
178
198
  {
179
199
  type: "button",
180
200
  tabIndex: -1,
181
201
  "aria-label": "Limpar seleção",
182
202
  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",
183
- onClick: (v) => {
184
- if (v.stopPropagation(), m && t && m.setValue(t, ""), i.onChange) {
185
- const l = {
203
+ onClick: (c) => {
204
+ if (c.stopPropagation(), l && t && l.setValue(t, ""), f.onChange) {
205
+ const r = {
186
206
  target: { value: "" }
187
207
  };
188
- i.onChange(l);
208
+ f.onChange(r);
189
209
  }
190
- h(!1), b(!1);
210
+ y(!1), p(!1);
191
211
  }
192
212
  },
193
213
  "✕"
194
214
  )
195
- ), r && /* @__PURE__ */ e.createElement(
215
+ ), o && /* @__PURE__ */ e.createElement(
196
216
  "label",
197
217
  {
198
- htmlFor: i.id || t,
199
- className: o(
218
+ htmlFor: f.id || t,
219
+ className: s(
200
220
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
201
221
  T ? "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"
202
222
  )
203
223
  },
204
- r
224
+ o
205
225
  ), /* @__PURE__ */ e.createElement(
206
226
  "div",
207
227
  {
208
- className: o(
209
- "absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",
210
- N ? "border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
228
+ className: s(
229
+ "absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
230
+ "bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
231
+ d ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
211
232
  ),
212
233
  style: {
213
- maxHeight: N ? "9.5rem" : "0",
234
+ maxHeight: d ? "9.5rem" : "0",
214
235
  // 3 options * 2.5rem + padding
215
- overflowY: a.length > 3 ? "auto" : "hidden"
236
+ overflowY: a.length > 3 ? "auto" : "hidden",
237
+ position: "fixed",
238
+ // Use fixed positioning to escape container overflow
239
+ top: d ? m.top : "auto",
240
+ left: d ? m.left : "auto",
241
+ width: d ? m.width : "auto",
242
+ zIndex: 9999,
243
+ boxShadow: d ? "var(--select-dropdown-shadow)" : "none"
216
244
  }
217
245
  },
218
- a.map((v) => /* @__PURE__ */ e.createElement(
246
+ a.map((c) => /* @__PURE__ */ e.createElement(
219
247
  "div",
220
248
  {
221
- key: v.value,
222
- className: o(
223
- "px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm",
224
- c === v.value && "bg-blue-100"
249
+ key: c.value,
250
+ className: s(
251
+ "px-3 py-2 cursor-pointer text-sm transition-colors duration-150",
252
+ "hover:bg-[var(--select-dropdown-hover)]",
253
+ v === c.value && "bg-[var(--select-dropdown-selected)]"
225
254
  ),
226
255
  onMouseDown: () => {
227
- if (m && t && m.setValue(t, v.value), i.onChange) {
228
- const l = {
229
- target: { value: v.value }
256
+ if (l && t && l.setValue(t, c.value), f.onChange) {
257
+ const r = {
258
+ target: { value: c.value }
230
259
  };
231
- i.onChange(l);
260
+ f.onChange(r);
232
261
  }
233
- b(!0);
262
+ p(!0);
234
263
  }
235
264
  },
236
- v.label
265
+ c.label
237
266
  ))
238
- ), R && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, R));
267
+ ), h && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, h));
239
268
  }
240
269
  );
241
- ge.displayName = "Select";
242
- const pe = e.forwardRef(
270
+ we.displayName = "Select";
271
+ const ye = e.forwardRef(
243
272
  ({
244
273
  name: t,
245
- className: r,
274
+ className: o,
246
275
  label: a,
247
276
  onFocus: n,
248
- onBlur: s,
277
+ onBlur: i,
249
278
  Icon: C,
250
- iconClassName: p,
251
- iconAction: _,
252
- containerClassName: i,
253
- rows: w = 4,
254
- ...E
255
- }, b) => {
256
- var x, L, I;
257
- const [N, h] = e.useState(!1), d = j(), m = d == null ? void 0 : d.control, y = d == null ? void 0 : d.register, k = m && t ? D({ control: m, name: t }) : void 0, c = E.value ?? k ?? "", R = (I = (L = (x = d == null ? void 0 : d.formState) == null ? void 0 : x.errors) == null ? void 0 : L[t]) == null ? void 0 : I.message, T = N || !!c;
258
- return /* @__PURE__ */ e.createElement("div", { className: o("relative", i) }, /* @__PURE__ */ e.createElement(
279
+ iconClassName: w,
280
+ iconAction: z,
281
+ containerClassName: f,
282
+ rows: E = 4,
283
+ ...N
284
+ }, p) => {
285
+ var h, T, R;
286
+ const [d, y] = e.useState(!1), m = X(), M = m == null ? void 0 : m.control, x = m == null ? void 0 : m.register, l = M && t ? G({ control: M, name: t }) : void 0, g = N.value ?? l ?? "", F = (R = (T = (h = m == null ? void 0 : m.formState) == null ? void 0 : h.errors) == null ? void 0 : T[t]) == null ? void 0 : R.message, v = d || !!g;
287
+ return /* @__PURE__ */ e.createElement("div", { className: s("relative", f) }, /* @__PURE__ */ e.createElement(
259
288
  "textarea",
260
289
  {
261
- id: E.id || t,
262
- rows: w,
263
- className: o(
290
+ id: N.id || t,
291
+ rows: E,
292
+ className: s(
264
293
  "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",
265
294
  C ? "pr-12" : "",
266
295
  // espaço extra para ícone customizado
267
- r
296
+ o
268
297
  ),
269
298
  onFocus: (S) => {
270
- h(!0), n && n(S);
299
+ y(!0), n && n(S);
271
300
  },
272
- ...d && t ? (() => {
273
- const S = y(t), M = S.onBlur;
301
+ ...m && t ? (() => {
302
+ const S = x(t), V = S.onBlur;
274
303
  return {
275
304
  ...S,
276
- ref: (z) => {
277
- typeof b == "function" ? b(z) : b && (b.current = z), S.ref && S.ref(z);
305
+ ref: (I) => {
306
+ typeof p == "function" ? p(I) : p && (p.current = I), S.ref && S.ref(I);
278
307
  },
279
- onBlur: (z) => {
280
- h(!1), s && s(z), M && M(z);
308
+ onBlur: (I) => {
309
+ y(!1), i && i(I), V && V(I);
281
310
  }
282
311
  };
283
312
  })() : {
284
- ref: b,
313
+ ref: p,
285
314
  onBlur: (S) => {
286
- h(!1), s && s(S);
315
+ y(!1), i && i(S);
287
316
  }
288
317
  },
289
- ...E
318
+ ...N
290
319
  }
291
320
  ), a && /* @__PURE__ */ e.createElement(
292
321
  "label",
293
322
  {
294
- htmlFor: E.id || t,
295
- className: o(
323
+ htmlFor: N.id || t,
324
+ className: s(
296
325
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
297
- T ? "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"
326
+ v ? "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"
298
327
  )
299
328
  },
300
329
  a
301
330
  ), C && /* @__PURE__ */ e.createElement(
302
331
  "div",
303
332
  {
304
- className: o(
333
+ className: s(
305
334
  "absolute top-3 right-3 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",
306
- p
335
+ w
307
336
  ),
308
- onClick: _
337
+ onClick: z
309
338
  },
310
339
  /* @__PURE__ */ e.createElement(C, null)
311
- ), R && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, R));
340
+ ), F && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, F));
312
341
  }
313
342
  );
314
- pe.displayName = "Textarea";
315
- const he = e.forwardRef(
343
+ ye.displayName = "Textarea";
344
+ const Ee = e.forwardRef(
316
345
  ({
317
346
  name: t,
318
- label: r,
347
+ label: o,
319
348
  loadOptions: a,
320
349
  className: n,
321
- containerClassName: s,
350
+ containerClassName: i,
322
351
  isClearable: C,
323
- defaultOptions: p = !1,
324
- loadingMessage: _ = "Carregando...",
325
- noOptionsMessage: i = "Nenhuma opção encontrada",
326
- searchable: w = !1,
327
- debounceMs: E = 300,
328
- onFocus: b,
329
- onBlur: N,
330
- ...h
331
- }, d) => {
332
- var G, X, $;
333
- const [m, y] = e.useState(!1), [k, c] = e.useState(!1), [R, T] = e.useState([]), [x, L] = e.useState(!1), [I, S] = e.useState(""), [M, z] = e.useState(""), V = e.useRef(null), v = e.useRef(null), l = j(), f = l == null ? void 0 : l.control, A = f && t ? D({ control: f, name: t }) : void 0, B = h.value ?? A ?? "", O = ($ = (X = (G = l == null ? void 0 : l.formState) == null ? void 0 : G.errors) == null ? void 0 : X[t]) == null ? void 0 : $.message, K = m || !!B;
352
+ defaultOptions: w = !1,
353
+ loadingMessage: z = "Carregando...",
354
+ noOptionsMessage: f = "Nenhuma opção encontrada",
355
+ searchable: E = !1,
356
+ debounceMs: N = 300,
357
+ onFocus: p,
358
+ onBlur: d,
359
+ ...y
360
+ }, m) => {
361
+ var q, te, J;
362
+ const [M, x] = e.useState(!1), [l, g] = e.useState(!1), [F, v] = e.useState([]), [h, T] = e.useState(!1), [R, S] = e.useState(""), [V, I] = e.useState(""), [A, H] = e.useState({
363
+ top: 0,
364
+ left: 0,
365
+ width: 0
366
+ }), O = e.useRef(null), k = e.useRef(null), c = X(), r = c == null ? void 0 : c.control, B = r && t ? G({ control: r, name: t }) : void 0, W = y.value ?? B ?? "", _ = (J = (te = (q = c == null ? void 0 : c.formState) == null ? void 0 : q.errors) == null ? void 0 : te[t]) == null ? void 0 : J.message, Q = M || !!W, $ = e.useCallback(() => {
367
+ if (O.current && l) {
368
+ const b = O.current.getBoundingClientRect();
369
+ H({
370
+ top: b.bottom + window.scrollY + 4,
371
+ left: b.left + window.scrollX,
372
+ width: b.width
373
+ });
374
+ }
375
+ }, [l]);
334
376
  e.useEffect(() => {
335
- const g = setTimeout(() => {
336
- z(I);
337
- }, E);
338
- return () => clearTimeout(g);
339
- }, [I, E]), e.useEffect(() => {
340
- (k || p && R.length === 0) && q(w ? M : void 0);
341
- }, [M, k]), e.useEffect(() => {
342
- p === !0 ? q() : Array.isArray(p) && T(p);
377
+ if ($(), l) {
378
+ const b = () => $(), D = () => $();
379
+ return window.addEventListener("resize", b), window.addEventListener("scroll", D, !0), () => {
380
+ window.removeEventListener("resize", b), window.removeEventListener("scroll", D, !0);
381
+ };
382
+ }
383
+ }, [l, $]), e.useEffect(() => {
384
+ const b = setTimeout(() => {
385
+ I(R);
386
+ }, N);
387
+ return () => clearTimeout(b);
388
+ }, [R, N]), e.useEffect(() => {
389
+ (l || w && F.length === 0) && j(E ? V : void 0);
390
+ }, [V, l]), e.useEffect(() => {
391
+ w === !0 ? j() : Array.isArray(w) && v(w);
343
392
  }, []);
344
- const q = async (g) => {
393
+ const j = async (b) => {
345
394
  try {
346
- L(!0);
347
- const H = await a(g);
348
- T(H);
349
- } catch (H) {
350
- console.error("Error loading options:", H), T([]);
395
+ T(!0);
396
+ const D = await a(b);
397
+ v(D);
398
+ } catch (D) {
399
+ console.error("Error loading options:", D), v([]);
351
400
  } finally {
352
- L(!1);
401
+ T(!1);
353
402
  }
354
403
  };
355
404
  e.useEffect(() => {
356
- const g = (H) => {
357
- V.current && !V.current.contains(H.target) && (c(!1), y(!1), S(""));
405
+ const b = (D) => {
406
+ O.current && !O.current.contains(D.target) && (g(!1), x(!1), S(""));
358
407
  };
359
- return document.addEventListener("mousedown", g), () => {
360
- document.removeEventListener("mousedown", g);
408
+ return document.addEventListener("mousedown", b), () => {
409
+ document.removeEventListener("mousedown", b);
361
410
  };
362
411
  }, []);
363
- const J = () => {
364
- k || (c(!0), y(!0), w && v.current && setTimeout(() => {
365
- var g;
366
- return (g = v.current) == null ? void 0 : g.focus();
412
+ const U = () => {
413
+ l || (g(!0), x(!0), E && k.current && setTimeout(() => {
414
+ var b;
415
+ return (b = k.current) == null ? void 0 : b.focus();
367
416
  }, 0));
368
- }, Q = (g) => {
369
- y(!0), b && b(g);
370
- }, Y = (g) => {
371
- N && N(g);
372
- }, U = (g) => {
373
- S(g.target.value);
374
- }, ee = (g) => {
375
- if (l && t && l.setValue(t, g), h.onChange) {
376
- const H = {
377
- target: { value: g }
417
+ }, Z = (b) => {
418
+ x(!0), p && p(b);
419
+ }, K = (b) => {
420
+ d && d(b);
421
+ }, ee = (b) => {
422
+ S(b.target.value);
423
+ }, ae = (b) => {
424
+ if (c && t && c.setValue(t, b), y.onChange) {
425
+ const D = {
426
+ target: { value: b }
378
427
  };
379
- h.onChange(H);
428
+ y.onChange(D);
380
429
  }
381
- c(!1), y(!1), S("");
382
- }, te = (g) => {
383
- if (g.stopPropagation(), l && t && l.setValue(t, ""), h.onChange) {
384
- const H = {
430
+ g(!1), x(!1), S("");
431
+ }, oe = (b) => {
432
+ if (b.stopPropagation(), c && t && c.setValue(t, ""), y.onChange) {
433
+ const D = {
385
434
  target: { value: "" }
386
435
  };
387
- h.onChange(H);
436
+ y.onChange(D);
388
437
  }
389
- c(!1), y(!1), S("");
390
- }, P = R.find((g) => g.value === B), ae = w && k ? I : (P == null ? void 0 : P.label) || "";
391
- return /* @__PURE__ */ e.createElement("div", { className: o("relative", s), ref: V }, /* @__PURE__ */ e.createElement(
438
+ g(!1), x(!1), S("");
439
+ }, Y = F.find((b) => b.value === W), ne = E && l ? R : (Y == null ? void 0 : Y.label) || "";
440
+ return /* @__PURE__ */ e.createElement("div", { className: s("relative", i), ref: O }, /* @__PURE__ */ e.createElement(
392
441
  "div",
393
442
  {
394
- id: h.id || t,
395
- tabIndex: w ? -1 : 0,
443
+ id: y.id || t,
444
+ tabIndex: E ? -1 : 0,
396
445
  role: "button",
397
446
  "aria-haspopup": "listbox",
398
- "aria-expanded": k,
399
- className: o(
447
+ "aria-expanded": l,
448
+ className: s(
400
449
  "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",
401
450
  n
402
451
  ),
403
- onClick: J,
404
- onFocus: w ? void 0 : Q,
405
- onBlur: w ? void 0 : Y,
406
- ref: d
452
+ onClick: U,
453
+ onFocus: E ? void 0 : Z,
454
+ onBlur: E ? void 0 : K,
455
+ ref: m
407
456
  },
408
- w ? /* @__PURE__ */ e.createElement(
457
+ E ? /* @__PURE__ */ e.createElement(
409
458
  "input",
410
459
  {
411
- ref: v,
460
+ ref: k,
412
461
  type: "text",
413
- value: ae,
414
- onChange: U,
415
- onFocus: Q,
416
- onBlur: Y,
417
- placeholder: r ? "" : "Selecione...",
418
- className: o(
462
+ value: ne,
463
+ onChange: ee,
464
+ onFocus: Z,
465
+ onBlur: K,
466
+ placeholder: o ? "" : "Selecione...",
467
+ className: s(
419
468
  "w-full bg-transparent border-none outline-none text-sm",
420
- !B && !I && "text-gray-400"
469
+ !W && !R && "text-gray-400"
421
470
  )
422
471
  }
423
- ) : /* @__PURE__ */ e.createElement("span", { className: o("block truncate", !B && "text-gray-400") }, (P == null ? void 0 : P.label) || !r && "Selecione..."),
424
- x && /* @__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)]" })),
425
- C && B && !x && /* @__PURE__ */ e.createElement(
472
+ ) : /* @__PURE__ */ e.createElement("span", { className: s("block truncate", !W && "text-gray-400") }, (Y == null ? void 0 : Y.label) || !o && "Selecione..."),
473
+ h && /* @__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)]" })),
474
+ C && W && !h && /* @__PURE__ */ e.createElement(
426
475
  "button",
427
476
  {
428
477
  type: "button",
429
478
  tabIndex: -1,
430
479
  "aria-label": "Limpar seleção",
431
480
  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",
432
- onClick: te
481
+ onClick: oe
433
482
  },
434
483
  "✕"
435
484
  )
436
- ), r && /* @__PURE__ */ e.createElement(
485
+ ), o && /* @__PURE__ */ e.createElement(
437
486
  "label",
438
487
  {
439
- htmlFor: h.id || t,
440
- className: o(
488
+ htmlFor: y.id || t,
489
+ className: s(
441
490
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
442
- K ? "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"
491
+ 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"
443
492
  )
444
493
  },
445
- r
494
+ o
446
495
  ), /* @__PURE__ */ e.createElement(
447
496
  "div",
448
497
  {
449
- className: o(
450
- "absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",
451
- k ? "border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
498
+ className: s(
499
+ "absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
500
+ "bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
501
+ l ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
452
502
  ),
453
503
  style: {
454
- maxHeight: k ? "9.5rem" : "0",
455
- overflowY: R.length > 3 ? "auto" : "hidden"
504
+ maxHeight: l ? "9.5rem" : "0",
505
+ overflowY: F.length > 3 ? "auto" : "hidden",
506
+ position: "fixed",
507
+ // Use fixed positioning to escape container overflow
508
+ top: l ? A.top : "auto",
509
+ left: l ? A.left : "auto",
510
+ width: l ? A.width : "auto",
511
+ zIndex: 9999,
512
+ boxShadow: l ? "var(--select-dropdown-shadow)" : "none"
456
513
  }
457
514
  },
458
- x ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, _) : R.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, i) : R.map((g) => /* @__PURE__ */ e.createElement(
515
+ h ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, z) : F.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, f) : F.map((b) => /* @__PURE__ */ e.createElement(
459
516
  "div",
460
517
  {
461
- key: g.value,
462
- className: o(
463
- "px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm",
464
- B === g.value && "bg-blue-100"
518
+ key: b.value,
519
+ className: s(
520
+ "px-3 py-2 cursor-pointer text-sm transition-colors duration-150",
521
+ "hover:bg-[var(--select-dropdown-hover)]",
522
+ W === b.value && "bg-[var(--select-dropdown-selected)]"
465
523
  ),
466
- onMouseDown: () => ee(g.value)
524
+ onMouseDown: () => ae(b.value)
467
525
  },
468
- g.label
526
+ b.label
469
527
  ))
470
- ), O && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, O));
528
+ ), _ && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, _));
471
529
  }
472
530
  );
473
- he.displayName = "AsyncSelect";
474
- const ye = e.forwardRef(
531
+ Ee.displayName = "AsyncSelect";
532
+ const Ne = e.forwardRef(
475
533
  ({
476
534
  name: t,
477
- label: r,
535
+ label: o,
478
536
  options: a,
479
537
  className: n,
480
- containerClassName: s,
538
+ containerClassName: i,
481
539
  isClearable: C,
482
- onFocus: p,
483
- onBlur: _,
484
- ...i
485
- }, w) => {
486
- var z, V, v;
487
- const [E, b] = e.useState(!1), [N, h] = e.useState(!1), d = e.useRef(null), m = j(), y = m == null ? void 0 : m.control, k = y && t ? D({ control: y, name: t }) : void 0, c = i.value ?? k ?? [], R = (v = (V = (z = m == null ? void 0 : m.formState) == null ? void 0 : z.errors) == null ? void 0 : V[t]) == null ? void 0 : v.message, T = E || c && c.length > 0;
540
+ onFocus: w,
541
+ onBlur: z,
542
+ ...f
543
+ }, E) => {
544
+ var O, k, c;
545
+ const [N, p] = e.useState(!1), [d, y] = e.useState(!1), [m, M] = e.useState({
546
+ top: 0,
547
+ left: 0,
548
+ width: 0
549
+ }), x = e.useRef(null), l = X(), g = l == null ? void 0 : l.control, F = g && t ? G({ control: g, name: t }) : void 0, v = f.value ?? F ?? [], h = (c = (k = (O = l == null ? void 0 : l.formState) == null ? void 0 : O.errors) == null ? void 0 : k[t]) == null ? void 0 : c.message, T = N || v && v.length > 0, R = e.useCallback(() => {
550
+ if (x.current && d) {
551
+ const r = x.current.getBoundingClientRect();
552
+ M({
553
+ top: r.bottom + window.scrollY + 4,
554
+ left: r.left + window.scrollX,
555
+ width: r.width
556
+ });
557
+ }
558
+ }, [d]);
488
559
  e.useEffect(() => {
489
- const l = (f) => {
490
- d.current && !d.current.contains(f.target) && (h(!1), b(!1));
560
+ if (R(), d) {
561
+ const r = () => R(), B = () => R();
562
+ return window.addEventListener("resize", r), window.addEventListener("scroll", B, !0), () => {
563
+ window.removeEventListener("resize", r), window.removeEventListener("scroll", B, !0);
564
+ };
565
+ }
566
+ }, [d, R]), e.useEffect(() => {
567
+ const r = (B) => {
568
+ x.current && !x.current.contains(B.target) && (y(!1), p(!1));
491
569
  };
492
- return document.addEventListener("mousedown", l), () => {
493
- document.removeEventListener("mousedown", l);
570
+ return document.addEventListener("mousedown", r), () => {
571
+ document.removeEventListener("mousedown", r);
494
572
  };
495
573
  }, []);
496
- const x = () => {
497
- h((l) => !l), b(!0);
498
- }, L = (l) => {
499
- b(!0), p && p(l);
500
- }, I = (l) => {
501
- _ && _(l);
502
- }, S = (l) => {
503
- var A;
504
- let f;
505
- c.includes(l) ? f = c.filter((B) => B !== l) : f = [...c, l], m && t && m.setValue(t, f), i.onChange && ((A = i.onChange) == null || A.call(i, {
506
- target: { value: f }
507
- })), b(!0);
508
- }, M = (l) => {
509
- var f;
510
- l.stopPropagation(), m && t && m.setValue(t, []), i.onChange && ((f = i.onChange) == null || f.call(i, {
574
+ const S = () => {
575
+ y((r) => !r), p(!0);
576
+ }, V = (r) => {
577
+ p(!0), w && w(r);
578
+ }, I = (r) => {
579
+ z && z(r);
580
+ }, A = (r) => {
581
+ var W;
582
+ let B;
583
+ v.includes(r) ? B = v.filter((_) => _ !== r) : B = [...v, r], l && t && l.setValue(t, B), f.onChange && ((W = f.onChange) == null || W.call(f, {
584
+ target: { value: B }
585
+ })), p(!0);
586
+ }, H = (r) => {
587
+ var B;
588
+ r.stopPropagation(), l && t && l.setValue(t, []), f.onChange && ((B = f.onChange) == null || B.call(f, {
511
589
  target: { value: [] }
512
- })), h(!1), b(!1);
590
+ })), y(!1), p(!1);
513
591
  };
514
- return /* @__PURE__ */ e.createElement("div", { className: o("relative", s), ref: d }, /* @__PURE__ */ e.createElement(
592
+ return /* @__PURE__ */ e.createElement("div", { className: s("relative", i), ref: x }, /* @__PURE__ */ e.createElement(
515
593
  "div",
516
594
  {
517
- id: i.id || t,
595
+ id: f.id || t,
518
596
  tabIndex: 0,
519
597
  role: "button",
520
598
  "aria-haspopup": "listbox",
521
- "aria-expanded": N,
522
- className: o(
599
+ "aria-expanded": d,
600
+ className: s(
523
601
  "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",
524
602
  n
525
603
  ),
526
- onClick: x,
527
- onFocus: L,
604
+ onClick: S,
605
+ onFocus: V,
528
606
  onBlur: I,
529
- ref: w
607
+ ref: E
530
608
  },
531
609
  /* @__PURE__ */ e.createElement(
532
610
  "div",
@@ -534,26 +612,26 @@ const ye = e.forwardRef(
534
612
  className: "flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",
535
613
  style: { scrollbarWidth: "none" }
536
614
  },
537
- c && c.length > 0 ? a.filter((l) => c.includes(l.value)).map((l) => /* @__PURE__ */ e.createElement(
615
+ v && v.length > 0 ? a.filter((r) => v.includes(r.value)).map((r) => /* @__PURE__ */ e.createElement(
538
616
  "span",
539
617
  {
540
- key: l.value,
618
+ key: r.value,
541
619
  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",
542
620
  style: { maxWidth: "140px" }
543
621
  },
544
- /* @__PURE__ */ e.createElement("span", { className: "truncate", title: l.label }, l.label),
622
+ /* @__PURE__ */ e.createElement("span", { className: "truncate", title: r.label }, r.label),
545
623
  /* @__PURE__ */ e.createElement(
546
624
  "button",
547
625
  {
548
626
  type: "button",
549
627
  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",
550
- "aria-label": `Remover ${l.label}`,
628
+ "aria-label": `Remover ${r.label}`,
551
629
  tabIndex: -1,
552
- onClick: (f) => {
553
- f.stopPropagation();
554
- const A = c.filter((B) => B !== l.value);
555
- m && t && m.setValue(t, A), i.onChange && i.onChange({
556
- target: { value: A }
630
+ onClick: (B) => {
631
+ B.stopPropagation();
632
+ const W = v.filter((_) => _ !== r.value);
633
+ l && t && l.setValue(t, W), f.onChange && f.onChange({
634
+ target: { value: W }
557
635
  });
558
636
  }
559
637
  },
@@ -577,160 +655,189 @@ const ye = e.forwardRef(
577
655
  )
578
656
  )
579
657
  )
580
- )) : !r && /* @__PURE__ */ e.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione...")
658
+ )) : !o && /* @__PURE__ */ e.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione...")
581
659
  ),
582
- C && c && c.length > 0 && /* @__PURE__ */ e.createElement(
660
+ C && v && v.length > 0 && /* @__PURE__ */ e.createElement(
583
661
  "button",
584
662
  {
585
663
  type: "button",
586
664
  tabIndex: -1,
587
665
  "aria-label": "Limpar seleção",
588
666
  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",
589
- onClick: M
667
+ onClick: H
590
668
  },
591
669
  "✕"
592
670
  )
593
- ), r && /* @__PURE__ */ e.createElement(
671
+ ), o && /* @__PURE__ */ e.createElement(
594
672
  "label",
595
673
  {
596
- htmlFor: i.id || t,
597
- className: o(
674
+ htmlFor: f.id || t,
675
+ className: s(
598
676
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
599
677
  T ? "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"
600
678
  )
601
679
  },
602
- r
680
+ o
603
681
  ), /* @__PURE__ */ e.createElement(
604
682
  "div",
605
683
  {
606
- className: o(
607
- "absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",
608
- N ? "border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
684
+ className: s(
685
+ "absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
686
+ "bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
687
+ d ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
609
688
  ),
610
689
  style: {
611
- maxHeight: N ? "9.5rem" : "0",
612
- overflowY: a.length > 3 ? "auto" : "hidden"
690
+ maxHeight: d ? "9.5rem" : "0",
691
+ overflowY: a.length > 3 ? "auto" : "hidden",
692
+ position: "fixed",
693
+ // Use fixed positioning to escape container overflow
694
+ top: d ? m.top : "auto",
695
+ left: d ? m.left : "auto",
696
+ width: d ? m.width : "auto",
697
+ zIndex: 9999,
698
+ boxShadow: d ? "var(--select-dropdown-shadow)" : "none"
613
699
  }
614
700
  },
615
- a.map((l) => /* @__PURE__ */ e.createElement(
701
+ a.map((r) => /* @__PURE__ */ e.createElement(
616
702
  "div",
617
703
  {
618
- key: l.value,
619
- className: o(
620
- "px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm flex items-center gap-2",
621
- c.includes(l.value) && "bg-blue-100 font-semibold"
704
+ key: r.value,
705
+ className: s(
706
+ "px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150",
707
+ "hover:bg-[var(--select-dropdown-hover)]",
708
+ v.includes(r.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
622
709
  ),
623
- onMouseDown: () => S(l.value)
710
+ onMouseDown: () => A(r.value)
624
711
  },
625
712
  /* @__PURE__ */ e.createElement(
626
713
  "input",
627
714
  {
628
715
  type: "checkbox",
629
- checked: c.includes(l.value),
716
+ checked: v.includes(r.value),
630
717
  readOnly: !0,
631
718
  className: "accent-blue-500"
632
719
  }
633
720
  ),
634
- l.label
721
+ r.label
635
722
  ))
636
- ), R && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, R));
723
+ ), h && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, h));
637
724
  }
638
725
  );
639
- ye.displayName = "MultiSelect";
640
- const we = e.forwardRef(
726
+ Ne.displayName = "MultiSelect";
727
+ const Ce = e.forwardRef(
641
728
  ({
642
729
  name: t,
643
- label: r,
730
+ label: o,
644
731
  loadOptions: a,
645
732
  className: n,
646
- containerClassName: s,
733
+ containerClassName: i,
647
734
  isClearable: C,
648
- defaultOptions: p = !1,
649
- loadingMessage: _ = "Carregando...",
650
- noOptionsMessage: i = "Nenhuma opção encontrada",
651
- searchable: w = !1,
652
- debounceMs: E = 300,
653
- maxSelectedDisplay: b = 3,
654
- onFocus: N,
655
- onBlur: h,
656
- ...d
657
- }, m) => {
658
- var g, H, re;
659
- const [y, k] = e.useState(!1), [c, R] = e.useState(!1), [T, x] = e.useState([]), [L, I] = e.useState(!1), [S, M] = e.useState(""), [z, V] = e.useState(""), v = e.useRef(null), l = e.useRef(null), f = j(), A = f == null ? void 0 : f.control, B = A && t ? D({ control: A, name: t }) : void 0, O = d.value ?? B ?? [], K = (re = (H = (g = f == null ? void 0 : f.formState) == null ? void 0 : g.errors) == null ? void 0 : H[t]) == null ? void 0 : re.message, q = y || O && O.length > 0;
735
+ defaultOptions: w = !1,
736
+ loadingMessage: z = "Carregando...",
737
+ noOptionsMessage: f = "Nenhuma opção encontrada",
738
+ searchable: E = !1,
739
+ debounceMs: N = 300,
740
+ maxSelectedDisplay: p = 3,
741
+ onFocus: d,
742
+ onBlur: y,
743
+ ...m
744
+ }, M) => {
745
+ var b, D, le;
746
+ const [x, l] = e.useState(!1), [g, F] = e.useState(!1), [v, h] = e.useState([]), [T, R] = e.useState(!1), [S, V] = e.useState(""), [I, A] = e.useState(""), [H, O] = e.useState({
747
+ top: 0,
748
+ left: 0,
749
+ width: 0
750
+ }), k = e.useRef(null), c = e.useRef(null), r = X(), B = r == null ? void 0 : r.control, W = B && t ? G({ control: B, name: t }) : void 0, _ = m.value ?? W ?? [], Q = (le = (D = (b = r == null ? void 0 : r.formState) == null ? void 0 : b.errors) == null ? void 0 : D[t]) == null ? void 0 : le.message, $ = x || _ && _.length > 0, j = e.useCallback(() => {
751
+ if (k.current && g) {
752
+ const u = k.current.getBoundingClientRect();
753
+ O({
754
+ top: u.bottom + window.scrollY + 4,
755
+ left: u.left + window.scrollX,
756
+ width: u.width
757
+ });
758
+ }
759
+ }, [g]);
660
760
  e.useEffect(() => {
761
+ if (j(), g) {
762
+ const u = () => j(), P = () => j();
763
+ return window.addEventListener("resize", u), window.addEventListener("scroll", P, !0), () => {
764
+ window.removeEventListener("resize", u), window.removeEventListener("scroll", P, !0);
765
+ };
766
+ }
767
+ }, [g, j]), e.useEffect(() => {
661
768
  const u = setTimeout(() => {
662
- V(S);
663
- }, E);
769
+ A(S);
770
+ }, N);
664
771
  return () => clearTimeout(u);
665
- }, [S, E]), e.useEffect(() => {
666
- (c || p && T.length === 0) && J(w ? z : void 0);
667
- }, [z, c]), e.useEffect(() => {
668
- p === !0 ? J() : Array.isArray(p) && x(p);
772
+ }, [S, N]), e.useEffect(() => {
773
+ (g || w && v.length === 0) && U(E ? I : void 0);
774
+ }, [I, g]), e.useEffect(() => {
775
+ w === !0 ? U() : Array.isArray(w) && h(w);
669
776
  }, []);
670
- const J = async (u) => {
777
+ const U = async (u) => {
671
778
  try {
672
- I(!0);
673
- const W = await a(u);
674
- x(W);
675
- } catch (W) {
676
- console.error("Error loading options:", W), x([]);
779
+ R(!0);
780
+ const P = await a(u);
781
+ h(P);
782
+ } catch (P) {
783
+ console.error("Error loading options:", P), h([]);
677
784
  } finally {
678
- I(!1);
785
+ R(!1);
679
786
  }
680
787
  };
681
788
  e.useEffect(() => {
682
- const u = (W) => {
683
- v.current && !v.current.contains(W.target) && (R(!1), k(!1), M(""));
789
+ const u = (P) => {
790
+ k.current && !k.current.contains(P.target) && (F(!1), l(!1), V(""));
684
791
  };
685
792
  return document.addEventListener("mousedown", u), () => {
686
793
  document.removeEventListener("mousedown", u);
687
794
  };
688
795
  }, []);
689
- const Q = () => {
690
- c || (R(!0), k(!0), w && l.current && setTimeout(() => {
796
+ const Z = () => {
797
+ g || (F(!0), l(!0), E && c.current && setTimeout(() => {
691
798
  var u;
692
- return (u = l.current) == null ? void 0 : u.focus();
799
+ return (u = c.current) == null ? void 0 : u.focus();
693
800
  }, 0));
694
- }, Y = (u) => {
695
- k(!0), N && N(u);
696
- }, U = (u) => {
697
- h && h(u);
801
+ }, K = (u) => {
802
+ l(!0), d && d(u);
698
803
  }, ee = (u) => {
699
- M(u.target.value);
700
- }, te = (u) => {
701
- let W;
702
- O.includes(u) ? W = O.filter((Z) => Z !== u) : W = [...O, u], f && t && f.setValue(t, W), d.onChange && d.onChange({
703
- target: { value: W }
704
- }), k(!0);
705
- }, P = (u, W) => {
706
- W.stopPropagation();
707
- const Z = O.filter((be) => be !== u);
708
- f && t && f.setValue(t, Z), d.onChange && d.onChange({
709
- target: { value: Z }
710
- });
804
+ y && y(u);
711
805
  }, ae = (u) => {
712
- u.stopPropagation(), f && t && f.setValue(t, []), d.onChange && d.onChange({
806
+ V(u.target.value);
807
+ }, oe = (u) => {
808
+ let P;
809
+ _.includes(u) ? P = _.filter((re) => re !== u) : P = [..._, u], r && t && r.setValue(t, P), m.onChange && m.onChange({
810
+ target: { value: P }
811
+ }), l(!0);
812
+ }, Y = (u, P) => {
813
+ P.stopPropagation();
814
+ const re = _.filter((pe) => pe !== u);
815
+ r && t && r.setValue(t, re), m.onChange && m.onChange({
816
+ target: { value: re }
817
+ });
818
+ }, ne = (u) => {
819
+ u.stopPropagation(), r && t && r.setValue(t, []), m.onChange && m.onChange({
713
820
  target: { value: [] }
714
- }), R(!1), k(!1), M("");
715
- }, G = T.filter((u) => O.includes(u.value)), X = G.slice(0, b), $ = G.length - b;
716
- return /* @__PURE__ */ e.createElement("div", { className: o("relative", s), ref: v }, /* @__PURE__ */ e.createElement(
821
+ }), F(!1), l(!1), V("");
822
+ }, q = v.filter((u) => _.includes(u.value)), te = q.slice(0, p), J = q.length - p;
823
+ return /* @__PURE__ */ e.createElement("div", { className: s("relative", i), ref: k }, /* @__PURE__ */ e.createElement(
717
824
  "div",
718
825
  {
719
- id: d.id || t,
720
- tabIndex: w ? -1 : 0,
826
+ id: m.id || t,
827
+ tabIndex: E ? -1 : 0,
721
828
  role: "button",
722
829
  "aria-haspopup": "listbox",
723
- "aria-expanded": c,
724
- className: o(
830
+ "aria-expanded": g,
831
+ className: s(
725
832
  "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",
726
833
  n
727
834
  ),
728
- onClick: Q,
729
- onFocus: w ? void 0 : Y,
730
- onBlur: w ? void 0 : U,
731
- ref: m
835
+ onClick: Z,
836
+ onFocus: E ? void 0 : K,
837
+ onBlur: E ? void 0 : ee,
838
+ ref: M
732
839
  },
733
- /* @__PURE__ */ e.createElement("div", { className: "flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full" }, X.map((u) => /* @__PURE__ */ e.createElement(
840
+ /* @__PURE__ */ e.createElement("div", { className: "flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full" }, te.map((u) => /* @__PURE__ */ e.createElement(
734
841
  "span",
735
842
  {
736
843
  key: u.value,
@@ -745,7 +852,7 @@ const we = e.forwardRef(
745
852
  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",
746
853
  "aria-label": `Remover ${u.label}`,
747
854
  tabIndex: -1,
748
- onClick: (W) => P(u.value, W)
855
+ onClick: (P) => Y(u.value, P)
749
856
  },
750
857
  /* @__PURE__ */ e.createElement(
751
858
  "svg",
@@ -767,275 +874,284 @@ const we = e.forwardRef(
767
874
  )
768
875
  )
769
876
  )
770
- )), $ > 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" }, "+", $, " mais"), w ? /* @__PURE__ */ e.createElement(
877
+ )), J > 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" }, "+", J, " mais"), E ? /* @__PURE__ */ e.createElement(
771
878
  "input",
772
879
  {
773
- ref: l,
880
+ ref: c,
774
881
  type: "text",
775
882
  value: S,
776
- onChange: ee,
777
- onFocus: Y,
778
- onBlur: U,
779
- placeholder: O.length === 0 && !r ? "Selecione..." : "",
883
+ onChange: ae,
884
+ onFocus: K,
885
+ onBlur: ee,
886
+ placeholder: _.length === 0 && !o ? "Selecione..." : "",
780
887
  className: "flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm"
781
888
  }
782
- ) : O.length === 0 && !r && /* @__PURE__ */ e.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione...")),
783
- L && /* @__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)]" })),
784
- C && O && O.length > 0 && !L && /* @__PURE__ */ e.createElement(
889
+ ) : _.length === 0 && !o && /* @__PURE__ */ e.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione...")),
890
+ T && /* @__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)]" })),
891
+ C && _ && _.length > 0 && !T && /* @__PURE__ */ e.createElement(
785
892
  "button",
786
893
  {
787
894
  type: "button",
788
895
  tabIndex: -1,
789
896
  "aria-label": "Limpar seleção",
790
897
  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",
791
- onClick: ae
898
+ onClick: ne
792
899
  },
793
900
  "✕"
794
901
  )
795
- ), r && /* @__PURE__ */ e.createElement(
902
+ ), o && /* @__PURE__ */ e.createElement(
796
903
  "label",
797
904
  {
798
- htmlFor: d.id || t,
799
- className: o(
905
+ htmlFor: m.id || t,
906
+ className: s(
800
907
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
801
- 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"
908
+ $ ? "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"
802
909
  )
803
910
  },
804
- r
911
+ o
805
912
  ), /* @__PURE__ */ e.createElement(
806
913
  "div",
807
914
  {
808
- className: o(
809
- "absolute left-0 w-full mt-1 rounded-md shadow-lg bg-white z-20 transition-all duration-200 overflow-hidden",
810
- c ? "border border-[var(--primary,#2563eb)] max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
915
+ className: s(
916
+ "absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
917
+ "bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
918
+ g ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
811
919
  ),
812
920
  style: {
813
- maxHeight: c ? "9.5rem" : "0",
814
- overflowY: T.length > 3 ? "auto" : "hidden"
921
+ maxHeight: g ? "9.5rem" : "0",
922
+ overflowY: v.length > 3 ? "auto" : "hidden",
923
+ position: "fixed",
924
+ // Use fixed positioning to escape container overflow
925
+ top: g ? H.top : "auto",
926
+ left: g ? H.left : "auto",
927
+ width: g ? H.width : "auto",
928
+ zIndex: 9999,
929
+ boxShadow: g ? "var(--select-dropdown-shadow)" : "none"
815
930
  }
816
931
  },
817
- L ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, _) : T.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, i) : T.map((u) => /* @__PURE__ */ e.createElement(
932
+ T ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, z) : v.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, f) : v.map((u) => /* @__PURE__ */ e.createElement(
818
933
  "div",
819
934
  {
820
935
  key: u.value,
821
- className: o(
822
- "px-3 py-2 cursor-pointer hover:bg-blue-50 text-sm flex items-center gap-2",
823
- O.includes(u.value) && "bg-blue-100 font-semibold"
936
+ className: s(
937
+ "px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150",
938
+ "hover:bg-[var(--select-dropdown-hover)]",
939
+ _.includes(u.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
824
940
  ),
825
- onMouseDown: () => te(u.value)
941
+ onMouseDown: () => oe(u.value)
826
942
  },
827
943
  /* @__PURE__ */ e.createElement(
828
944
  "input",
829
945
  {
830
946
  type: "checkbox",
831
- checked: O.includes(u.value),
947
+ checked: _.includes(u.value),
832
948
  readOnly: !0,
833
949
  className: "accent-blue-500"
834
950
  }
835
951
  ),
836
952
  u.label
837
953
  ))
838
- ), K && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, K));
954
+ ), Q && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, Q));
839
955
  }
840
956
  );
841
- we.displayName = "MultiAsyncSelect";
842
- const Ee = {
957
+ Ce.displayName = "MultiAsyncSelect";
958
+ const ke = {
843
959
  sm: "h-10 text-sm px-3",
844
960
  md: "h-12 text-base px-4",
845
961
  lg: "h-16 text-lg px-6"
846
- }, Ne = e.forwardRef(
962
+ }, Se = e.forwardRef(
847
963
  ({
848
964
  name: t,
849
- label: r,
965
+ label: o,
850
966
  options: a,
851
967
  className: n,
852
- containerClassName: s,
968
+ containerClassName: i,
853
969
  optionClassName: C,
854
- direction: p = "row",
855
- size: _ = "md",
856
- onFocus: i,
857
- onBlur: w,
858
- ...E
859
- }, b) => {
860
- var c, R, T;
861
- const N = j(), h = N == null ? void 0 : N.control, d = h && t ? D({ control: h, name: t }) : void 0, m = E.value ?? d ?? "", y = (T = (R = (c = N == null ? void 0 : N.formState) == null ? void 0 : c.errors) == null ? void 0 : R[t]) == null ? void 0 : T.message, k = (x) => {
862
- N && t && N.setValue(t, x), E.onChange && E.onChange({ target: { value: x } });
970
+ direction: w = "row",
971
+ size: z = "md",
972
+ onFocus: f,
973
+ onBlur: E,
974
+ ...N
975
+ }, p) => {
976
+ var g, F, v;
977
+ const d = X(), y = d == null ? void 0 : d.control, m = y && t ? G({ control: y, name: t }) : void 0, M = N.value ?? m ?? "", x = (v = (F = (g = d == null ? void 0 : d.formState) == null ? void 0 : g.errors) == null ? void 0 : F[t]) == null ? void 0 : v.message, l = (h) => {
978
+ d && t && d.setValue(t, h), N.onChange && N.onChange({ target: { value: h } });
863
979
  };
864
- return /* @__PURE__ */ e.createElement("div", { className: o("relative", s), ref: b }, r && /* @__PURE__ */ e.createElement(
980
+ return /* @__PURE__ */ e.createElement("div", { className: s("relative", i), ref: p }, o && /* @__PURE__ */ e.createElement(
865
981
  "label",
866
982
  {
867
983
  htmlFor: t,
868
- className: o(
984
+ className: s(
869
985
  "absolute left-3 z-10 origin-[0] cursor-text select-none text-sm transition-all duration-200",
870
986
  "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white"
871
987
  )
872
988
  },
873
- r
989
+ o
874
990
  ), /* @__PURE__ */ e.createElement(
875
991
  "div",
876
992
  {
877
- className: o(
993
+ className: s(
878
994
  "flex gap-2 w-full pt-6",
879
995
  // espaço para label flutuante
880
- p === "row" ? "flex-row" : "flex-col",
996
+ w === "row" ? "flex-row" : "flex-col",
881
997
  n
882
998
  ),
883
- "aria-label": r,
999
+ "aria-label": o,
884
1000
  tabIndex: -1,
885
- onFocus: i,
886
- onBlur: w
1001
+ onFocus: f,
1002
+ onBlur: E
887
1003
  },
888
- a.map((x) => /* @__PURE__ */ e.createElement(
1004
+ a.map((h) => /* @__PURE__ */ e.createElement(
889
1005
  "button",
890
1006
  {
891
- key: x.value,
1007
+ key: h.value,
892
1008
  type: "button",
893
- className: o(
1009
+ className: s(
894
1010
  "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)]",
895
- Ee[_],
896
- m === x.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",
1011
+ ke[z],
1012
+ M === h.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",
897
1013
  C
898
1014
  ),
899
- "aria-pressed": m === x.value,
900
- "data-selected": m === x.value,
1015
+ "aria-pressed": M === h.value,
1016
+ "data-selected": M === h.value,
901
1017
  tabIndex: 0,
902
- onClick: () => k(x.value),
903
- onKeyDown: (L) => {
904
- (L.key === "Enter" || L.key === " ") && (L.preventDefault(), k(x.value));
1018
+ onClick: () => l(h.value),
1019
+ onKeyDown: (T) => {
1020
+ (T.key === "Enter" || T.key === " ") && (T.preventDefault(), l(h.value));
905
1021
  }
906
1022
  },
907
- x.icon && /* @__PURE__ */ e.createElement("span", { className: "mr-2 text-lg flex items-center" }, x.icon),
908
- /* @__PURE__ */ e.createElement("span", { className: "truncate font-medium" }, x.label)
1023
+ h.icon && /* @__PURE__ */ e.createElement("span", { className: "mr-2 text-lg flex items-center" }, h.icon),
1024
+ /* @__PURE__ */ e.createElement("span", { className: "truncate font-medium" }, h.label)
909
1025
  ))
910
- ), y && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, y));
1026
+ ), x && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, x));
911
1027
  }
912
1028
  );
913
- Ne.displayName = "RadioGroup";
914
- const le = F.forwardRef(
915
- ({ children: t, className: r, as: a = "div", ...n }, s) => /* @__PURE__ */ F.createElement(
1029
+ Se.displayName = "RadioGroup";
1030
+ const ce = L.forwardRef(
1031
+ ({ children: t, className: o, as: a = "div", ...n }, i) => /* @__PURE__ */ L.createElement(
916
1032
  a,
917
1033
  {
918
- ref: s,
919
- className: o(
1034
+ ref: i,
1035
+ className: s(
920
1036
  "px-6 py-4 border-b",
921
1037
  "bg-[var(--card-header-bg,rgba(249,250,251,0.5))]",
922
1038
  "border-[var(--card-header-border,#e5e7eb)]",
923
1039
  "text-[var(--card-text,#111827)]",
924
- r
1040
+ o
925
1041
  ),
926
1042
  ...n
927
1043
  },
928
1044
  t
929
1045
  )
930
1046
  );
931
- le.displayName = "CardHeader";
932
- const oe = F.forwardRef(
933
- ({ children: t, className: r, as: a = "div", ...n }, s) => /* @__PURE__ */ F.createElement(
1047
+ ce.displayName = "CardHeader";
1048
+ const ie = L.forwardRef(
1049
+ ({ children: t, className: o, as: a = "div", ...n }, i) => /* @__PURE__ */ L.createElement(
934
1050
  a,
935
1051
  {
936
- ref: s,
937
- className: o(
1052
+ ref: i,
1053
+ className: s(
938
1054
  "px-6 py-4",
939
1055
  "flex-1",
940
1056
  // Para ocupar o espaço disponível
941
1057
  "bg-[var(--card-bg,#ffffff)]",
942
1058
  "text-[var(--card-text,#111827)]",
943
- r
1059
+ o
944
1060
  ),
945
1061
  ...n
946
1062
  },
947
1063
  t
948
1064
  )
949
1065
  );
950
- oe.displayName = "CardBody";
951
- const se = F.forwardRef(
952
- ({ children: t, className: r, as: a = "div", ...n }, s) => /* @__PURE__ */ F.createElement(
1066
+ ie.displayName = "CardBody";
1067
+ const de = L.forwardRef(
1068
+ ({ children: t, className: o, as: a = "div", ...n }, i) => /* @__PURE__ */ L.createElement(
953
1069
  a,
954
1070
  {
955
- ref: s,
956
- className: o(
1071
+ ref: i,
1072
+ className: s(
957
1073
  "px-6 py-4 border-t",
958
1074
  "bg-[var(--card-footer-bg,rgba(249,250,251,0.5))]",
959
1075
  "border-[var(--card-footer-border,#e5e7eb)]",
960
1076
  "text-[var(--card-text,#111827)]",
961
- r
1077
+ o
962
1078
  ),
963
1079
  ...n
964
1080
  },
965
1081
  t
966
1082
  )
967
1083
  );
968
- se.displayName = "CardFooter";
969
- const Ce = F.forwardRef(
1084
+ de.displayName = "CardFooter";
1085
+ const Re = L.forwardRef(
970
1086
  ({
971
1087
  children: t,
972
- className: r,
1088
+ className: o,
973
1089
  variant: a = "default",
974
1090
  size: n = "md",
975
- padding: s = "none",
1091
+ padding: i = "none",
976
1092
  // none pois cada seção tem seu próprio padding
977
1093
  rounded: C = "lg",
978
- constrainWidth: p = !1,
1094
+ constrainWidth: w = !1,
979
1095
  // Por padrão, não aplicar max-width
980
- ..._
981
- }, i) => {
982
- const w = {
1096
+ ...z
1097
+ }, f) => {
1098
+ const E = {
983
1099
  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))]",
984
1100
  outlined: "bg-[var(--card-bg,#ffffff)] border-2 border-[var(--primary,#2563eb)]",
985
1101
  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))]",
986
1102
  flat: "bg-[var(--card-bg,#ffffff)] border-0"
987
- }, E = {
1103
+ }, N = {
988
1104
  sm: "max-w-sm",
989
1105
  md: "max-w-md",
990
1106
  lg: "max-w-lg"
991
- }, b = {
1107
+ }, p = {
992
1108
  none: "",
993
1109
  sm: "p-3",
994
1110
  md: "p-4",
995
1111
  lg: "p-6"
996
- }, N = {
1112
+ }, d = {
997
1113
  none: "rounded-none",
998
1114
  sm: "rounded-sm",
999
1115
  md: "rounded-md",
1000
1116
  lg: "rounded-lg",
1001
1117
  xl: "rounded-xl"
1002
1118
  };
1003
- return /* @__PURE__ */ F.createElement(
1119
+ return /* @__PURE__ */ L.createElement(
1004
1120
  "div",
1005
1121
  {
1006
- ref: i,
1007
- className: o(
1122
+ ref: f,
1123
+ className: s(
1008
1124
  "flex flex-col",
1009
1125
  // Flex column para organizar header, body, footer
1010
1126
  "overflow-hidden",
1011
1127
  // Para manter os borders radius das seções
1012
- w[a],
1013
- p && E[n],
1128
+ E[a],
1129
+ w && N[n],
1014
1130
  // Aplicar max-width apenas se constrainWidth for true
1015
- b[s],
1016
- N[C],
1017
- r
1131
+ p[i],
1132
+ d[C],
1133
+ o
1018
1134
  ),
1019
- ..._
1135
+ ...z
1020
1136
  },
1021
1137
  t
1022
1138
  );
1023
1139
  }
1024
- ), Fe = Object.assign(Ce, {
1025
- Header: le,
1026
- Body: oe,
1027
- Footer: se
1028
- }), ce = F.forwardRef(
1140
+ ), _e = Object.assign(Re, {
1141
+ Header: ce,
1142
+ Body: ie,
1143
+ Footer: de
1144
+ }), ue = L.forwardRef(
1029
1145
  ({
1030
1146
  children: t,
1031
- className: r,
1147
+ className: o,
1032
1148
  variant: a = "default",
1033
1149
  size: n = "md",
1034
- responsive: s = !1,
1150
+ responsive: i = !1,
1035
1151
  stickyHeader: C = !1,
1036
- ...p
1037
- }, _) => {
1038
- const i = o(
1152
+ ...w
1153
+ }, z) => {
1154
+ const f = s(
1039
1155
  // Base styles
1040
1156
  "w-full border-collapse bg-[var(--table-bg)] text-[var(--table-text)]",
1041
1157
  // Variant styles
@@ -1048,101 +1164,101 @@ const Ce = F.forwardRef(
1048
1164
  "text-base": n === "md",
1049
1165
  "text-lg": n === "lg"
1050
1166
  },
1051
- r
1052
- ), w = o(
1167
+ o
1168
+ ), E = s(
1053
1169
  {
1054
- "overflow-x-auto": s,
1170
+ "overflow-x-auto": i,
1055
1171
  "max-h-96 overflow-y-auto": C
1056
1172
  }
1057
- ), E = /* @__PURE__ */ F.createElement(
1173
+ ), N = /* @__PURE__ */ L.createElement(
1058
1174
  "table",
1059
1175
  {
1060
- ref: _,
1061
- className: i,
1062
- ...p
1176
+ ref: z,
1177
+ className: f,
1178
+ ...w
1063
1179
  },
1064
1180
  t
1065
1181
  );
1066
- return s || C ? /* @__PURE__ */ F.createElement("div", { className: w }, E) : E;
1182
+ return i || C ? /* @__PURE__ */ L.createElement("div", { className: E }, N) : N;
1067
1183
  }
1068
- ), ie = F.forwardRef(
1069
- ({ children: t, className: r, as: a = "thead", ...n }, s) => /* @__PURE__ */ F.createElement(
1184
+ ), fe = L.forwardRef(
1185
+ ({ children: t, className: o, as: a = "thead", ...n }, i) => /* @__PURE__ */ L.createElement(
1070
1186
  a,
1071
1187
  {
1072
- ref: s,
1073
- className: o(
1188
+ ref: i,
1189
+ className: s(
1074
1190
  "border-b border-[var(--table-border)] bg-[var(--table-header-bg)]",
1075
1191
  {
1076
1192
  "sticky top-0 z-10": a === "thead"
1077
1193
  },
1078
- r
1194
+ o
1079
1195
  ),
1080
1196
  ...n
1081
1197
  },
1082
1198
  t
1083
1199
  )
1084
- ), de = F.forwardRef(
1085
- ({ children: t, className: r, as: a = "tbody", ...n }, s) => /* @__PURE__ */ F.createElement(
1200
+ ), me = L.forwardRef(
1201
+ ({ children: t, className: o, as: a = "tbody", ...n }, i) => /* @__PURE__ */ L.createElement(
1086
1202
  a,
1087
1203
  {
1088
- ref: s,
1089
- className: o(
1204
+ ref: i,
1205
+ className: s(
1090
1206
  "[&_tr:nth-child(odd)]:bg-[var(--table-row-odd)]",
1091
1207
  "[&_tr:nth-child(even)]:bg-[var(--table-row-even)]",
1092
- r
1208
+ o
1093
1209
  ),
1094
1210
  ...n
1095
1211
  },
1096
1212
  t
1097
1213
  )
1098
- ), ue = F.forwardRef(
1099
- ({ children: t, className: r, as: a = "tfoot", ...n }, s) => /* @__PURE__ */ F.createElement(
1214
+ ), be = L.forwardRef(
1215
+ ({ children: t, className: o, as: a = "tfoot", ...n }, i) => /* @__PURE__ */ L.createElement(
1100
1216
  a,
1101
1217
  {
1102
- ref: s,
1103
- className: o(
1218
+ ref: i,
1219
+ className: s(
1104
1220
  "border-t border-[var(--table-border)] bg-[var(--table-header-bg)] font-medium",
1105
- r
1221
+ o
1106
1222
  ),
1107
1223
  ...n
1108
1224
  },
1109
1225
  t
1110
1226
  )
1111
- ), me = F.forwardRef(
1112
- ({ children: t, className: r, variant: a = "default", ...n }, s) => /* @__PURE__ */ F.createElement(
1227
+ ), ve = L.forwardRef(
1228
+ ({ children: t, className: o, variant: a = "default", ...n }, i) => /* @__PURE__ */ L.createElement(
1113
1229
  "tr",
1114
1230
  {
1115
- ref: s,
1116
- className: o(
1231
+ ref: i,
1232
+ className: s(
1117
1233
  "border-b border-[var(--table-border)] transition-colors",
1118
1234
  {
1119
1235
  "hover:bg-[var(--table-row-hover)]": a === "hover",
1120
1236
  "bg-[var(--table-row-selected)]": a === "selected"
1121
1237
  },
1122
- r
1238
+ o
1123
1239
  ),
1124
1240
  ...n
1125
1241
  },
1126
1242
  t
1127
1243
  )
1128
- ), fe = F.forwardRef(
1244
+ ), xe = L.forwardRef(
1129
1245
  ({
1130
1246
  children: t,
1131
- className: r,
1247
+ className: o,
1132
1248
  as: a = "td",
1133
1249
  align: n = "left",
1134
- scope: s,
1250
+ scope: i,
1135
1251
  colSpan: C,
1136
- rowSpan: p,
1137
- ..._
1138
- }, i) => /* @__PURE__ */ F.createElement(
1252
+ rowSpan: w,
1253
+ ...z
1254
+ }, f) => /* @__PURE__ */ L.createElement(
1139
1255
  a,
1140
1256
  {
1141
- ref: i,
1142
- scope: a === "th" ? s : void 0,
1257
+ ref: f,
1258
+ scope: a === "th" ? i : void 0,
1143
1259
  colSpan: C,
1144
- rowSpan: p,
1145
- className: o(
1260
+ rowSpan: w,
1261
+ className: s(
1146
1262
  "px-4 py-3 text-left",
1147
1263
  {
1148
1264
  "font-semibold": a === "th",
@@ -1150,43 +1266,43 @@ const Ce = F.forwardRef(
1150
1266
  "text-center": n === "center",
1151
1267
  "text-right": n === "right"
1152
1268
  },
1153
- r
1269
+ o
1154
1270
  ),
1155
- ..._
1271
+ ...z
1156
1272
  },
1157
1273
  t
1158
1274
  )
1159
1275
  );
1160
- ce.displayName = "Table";
1161
- ie.displayName = "TableHeader";
1162
- de.displayName = "TableBody";
1163
- ue.displayName = "TableFooter";
1164
- me.displayName = "TableRow";
1165
- fe.displayName = "TableCell";
1166
- const _e = Object.assign(ce, {
1167
- Header: ie,
1168
- Body: de,
1169
- Footer: ue,
1170
- Row: me,
1171
- Cell: fe
1276
+ ue.displayName = "Table";
1277
+ fe.displayName = "TableHeader";
1278
+ me.displayName = "TableBody";
1279
+ be.displayName = "TableFooter";
1280
+ ve.displayName = "TableRow";
1281
+ xe.displayName = "TableCell";
1282
+ const Te = Object.assign(ue, {
1283
+ Header: fe,
1284
+ Body: me,
1285
+ Footer: be,
1286
+ Row: ve,
1287
+ Cell: xe
1172
1288
  });
1173
1289
  export {
1174
- he as AsyncSelect,
1175
- Re as Button,
1176
- Fe as Card,
1177
- oe as CardBody,
1178
- se as CardFooter,
1179
- le as CardHeader,
1180
- xe as Input,
1181
- we as MultiAsyncSelect,
1182
- ye as MultiSelect,
1183
- Ne as RadioGroup,
1184
- ge as Select,
1185
- _e as Table,
1186
- de as TableBody,
1187
- fe as TableCell,
1188
- ue as TableFooter,
1189
- ie as TableHeader,
1190
- me as TableRow,
1191
- pe as Textarea
1290
+ Ee as AsyncSelect,
1291
+ Fe as Button,
1292
+ _e as Card,
1293
+ ie as CardBody,
1294
+ de as CardFooter,
1295
+ ce as CardHeader,
1296
+ he as Input,
1297
+ Ce as MultiAsyncSelect,
1298
+ Ne as MultiSelect,
1299
+ Se as RadioGroup,
1300
+ we as Select,
1301
+ Te as Table,
1302
+ me as TableBody,
1303
+ xe as TableCell,
1304
+ be as TableFooter,
1305
+ fe as TableHeader,
1306
+ ve as TableRow,
1307
+ ye as Textarea
1192
1308
  };