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