@dimasbaguspm/versaur 0.0.54 → 0.0.55

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,9 +1,9 @@
1
- import { c as N, j as e, a as x } from "./index-DOdDlCoL.js";
2
- import b, { createContext as E, useContext as F, useId as B, forwardRef as z, useRef as T, useEffect as ne, useState as se } from "react";
3
- import { I as P } from "./image-rectangle-K9jmTTED.js";
1
+ import { c as C, j as e, a as x } from "./index-DOdDlCoL.js";
2
+ import m, { createContext as F, useContext as A, useId as B, forwardRef as O, useRef as T, useEffect as ae, useState as se } from "react";
3
+ import { I as $ } from "./image-rectangle-K9jmTTED.js";
4
4
  import { Calendar as oe, MailIcon as ie, Banknote as ce, SearchIcon as le, ChevronDown as de, Clock as ue } from "lucide-react";
5
5
  import "./snackbar-DH8jCh2V.js";
6
- const fe = N("space-y-2", {
6
+ const fe = C("space-y-2", {
7
7
  variants: {
8
8
  direction: {
9
9
  vertical: "space-y-2 space-x-0",
@@ -13,9 +13,9 @@ const fe = N("space-y-2", {
13
13
  defaultVariants: {
14
14
  direction: "vertical"
15
15
  }
16
- }), pe = N(
16
+ }), pe = C(
17
17
  "relative h-4 w-4 rounded border cursor-pointer transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed appearance-none bg-white border-primary/40 checked:bg-primary checked:border-primary focus:ring-primary/20"
18
- ), me = N(
18
+ ), me = C(
19
19
  "text-sm text-foreground cursor-pointer select-none",
20
20
  {
21
21
  variants: {
@@ -28,20 +28,20 @@ const fe = N("space-y-2", {
28
28
  disabled: !1
29
29
  }
30
30
  }
31
- ), q = E(null), he = () => {
32
- const t = F(q);
31
+ ), q = F(null), he = () => {
32
+ const t = A(q);
33
33
  if (!t)
34
34
  throw new Error("CheckboxOption must be used within CheckboxInput");
35
35
  return t;
36
- }, G = b.forwardRef(({ children: t, description: r, className: a, disabled: s, id: n, ...o }, d) => {
37
- const c = he(), i = b.useId(), l = n || i, u = s || c.disabled;
36
+ }, G = m.forwardRef(({ children: t, description: r, className: n, disabled: o, id: s, ...i }, d) => {
37
+ const l = he(), c = m.useId(), a = s || c, u = o || l.disabled;
38
38
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2", children: [
39
39
  /* @__PURE__ */ e.jsx("div", { className: "relative flex items-center mt-0.5", children: /* @__PURE__ */ e.jsx(
40
40
  "input",
41
41
  {
42
42
  ref: d,
43
43
  type: "checkbox",
44
- id: l,
44
+ id: a,
45
45
  disabled: u,
46
46
  className: x(
47
47
  pe(),
@@ -50,16 +50,16 @@ const fe = N("space-y-2", {
50
50
  // Checkmark dimensions for md size (default)
51
51
  "after:w-[4px] after:h-[8px]",
52
52
  "checked:after:opacity-100",
53
- a
53
+ n
54
54
  ),
55
- ...o
55
+ ...i
56
56
  }
57
57
  ) }),
58
58
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
59
59
  /* @__PURE__ */ e.jsx(
60
60
  "label",
61
61
  {
62
- htmlFor: l,
62
+ htmlFor: a,
63
63
  className: me({
64
64
  disabled: u
65
65
  }),
@@ -80,35 +80,35 @@ const fe = N("space-y-2", {
80
80
  ] });
81
81
  });
82
82
  G.displayName = "CheckboxOption";
83
- const K = b.forwardRef(
83
+ const K = m.forwardRef(
84
84
  ({
85
85
  label: t,
86
86
  helperText: r,
87
- error: a,
88
- direction: s = "vertical",
89
- className: n,
90
- disabled: o,
87
+ error: n,
88
+ direction: o = "vertical",
89
+ className: s,
90
+ disabled: i,
91
91
  required: d,
92
- children: c,
93
- ...i
94
- }, l) => {
95
- const u = !!a, p = {
96
- disabled: o
92
+ children: l,
93
+ ...c
94
+ }, a) => {
95
+ const u = !!n, p = {
96
+ disabled: i
97
97
  };
98
98
  return /* @__PURE__ */ e.jsx(q.Provider, { value: p, children: /* @__PURE__ */ e.jsxs(
99
99
  "fieldset",
100
100
  {
101
- ref: l,
102
- disabled: o,
103
- className: x("w-full border-0 p-0 m-0", n),
104
- ...i,
101
+ ref: a,
102
+ disabled: i,
103
+ className: x("w-full border-0 p-0 m-0", s),
104
+ ...c,
105
105
  children: [
106
106
  t && /* @__PURE__ */ e.jsxs("legend", { className: "block text-sm font-medium text-foreground mb-3", children: [
107
107
  t,
108
108
  d && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
109
109
  ] }),
110
- /* @__PURE__ */ e.jsx("div", { className: fe({ direction: s }), children: c }),
111
- u && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: a }),
110
+ /* @__PURE__ */ e.jsx("div", { className: fe({ direction: o }), children: l }),
111
+ u && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
112
112
  !u && r && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-gray-600", children: r })
113
113
  ]
114
114
  }
@@ -118,14 +118,14 @@ const K = b.forwardRef(
118
118
  K.displayName = "CheckboxInput";
119
119
  const lt = Object.assign(K, {
120
120
  Option: G
121
- }), _ = E(null), be = () => {
122
- const t = F(_);
121
+ }), _ = F(null), be = () => {
122
+ const t = A(_);
123
123
  if (!t)
124
124
  throw new Error(
125
125
  "useChipSingleInputContext must be used within ChipSingleInputContext"
126
126
  );
127
127
  return t;
128
- }, ge = N(
128
+ }, ge = C(
129
129
  "inline-flex items-center justify-center rounded-full bg-white transition-colors duration-200 cursor-pointer border border-border hover:bg-primary-soft hover:border-primary-bold focus:border-primary-light data-[selected=true]:bg-primary data-[selected=true]:border-primary data-[selected=true]:text-white",
130
130
  {
131
131
  variants: {
@@ -139,9 +139,9 @@ const lt = Object.assign(K, {
139
139
  size: "md"
140
140
  }
141
141
  }
142
- ), xe = b.forwardRef(({ children: t, className: r, disabled: a, id: s, value: n, ...o }, d) => {
143
- const { size: c = "md", maxWidth: i, ...l } = be(), u = B(), p = s || u, f = a || l.disabled, m = l.readOnly, h = l.value === n, y = (g) => {
144
- !f && !m && l.onChange?.(n), o.onChange?.(g);
142
+ ), xe = m.forwardRef(({ children: t, className: r, disabled: n, id: o, value: s, ...i }, d) => {
143
+ const { size: l = "md", maxWidth: c, ...a } = be(), u = B(), p = o || u, f = n || a.disabled, h = a.readOnly, b = a.value === s, w = (g) => {
144
+ !f && !h && a.onChange?.(s), i.onChange?.(g);
145
145
  };
146
146
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
147
147
  /* @__PURE__ */ e.jsx(
@@ -150,29 +150,29 @@ const lt = Object.assign(K, {
150
150
  ref: d,
151
151
  type: "radio",
152
152
  id: p,
153
- name: l.name,
154
- value: n,
155
- checked: h,
153
+ name: a.name,
154
+ value: s,
155
+ checked: b,
156
156
  disabled: f,
157
- readOnly: m,
158
- onChange: y,
157
+ readOnly: h,
158
+ onChange: w,
159
159
  className: "sr-only",
160
- ...o
160
+ ...i
161
161
  }
162
162
  ),
163
163
  /* @__PURE__ */ e.jsx(
164
164
  "label",
165
165
  {
166
166
  htmlFor: p,
167
- "data-selected": h,
168
- style: i ? { maxWidth: i } : void 0,
167
+ "data-selected": b,
168
+ style: c ? { maxWidth: c } : void 0,
169
169
  className: x(
170
170
  ge({
171
- size: c
171
+ size: l
172
172
  }),
173
173
  f && "opacity-50 cursor-not-allowed pointer-events-none",
174
- m && "cursor-default pointer-events-none",
175
- i && "overflow-hidden",
174
+ h && "cursor-default pointer-events-none",
175
+ c && "overflow-hidden",
176
176
  r
177
177
  ),
178
178
  children: /* @__PURE__ */ e.jsx(
@@ -180,7 +180,7 @@ const lt = Object.assign(K, {
180
180
  {
181
181
  className: x(
182
182
  "flex items-center gap-2",
183
- i && "truncate min-w-0"
183
+ c && "truncate min-w-0"
184
184
  ),
185
185
  children: t
186
186
  }
@@ -188,62 +188,62 @@ const lt = Object.assign(K, {
188
188
  }
189
189
  )
190
190
  ] });
191
- }), ye = z(
191
+ }), ye = O(
192
192
  ({
193
193
  size: t = "md",
194
194
  label: r,
195
- required: a,
196
- helperText: s,
197
- error: n,
198
- className: o,
195
+ required: n,
196
+ helperText: o,
197
+ error: s,
198
+ className: i,
199
199
  disabled: d,
200
- readOnly: c,
201
- maxWidth: i,
202
- name: l,
200
+ readOnly: l,
201
+ maxWidth: c,
202
+ name: a,
203
203
  value: u,
204
204
  onChange: p,
205
205
  children: f,
206
- ...m
207
- }, h) => {
208
- const y = !!n, g = {
206
+ ...h
207
+ }, b) => {
208
+ const w = !!s, g = {
209
209
  size: t,
210
210
  disabled: d,
211
- readOnly: c,
212
- error: y,
213
- name: l,
211
+ readOnly: l,
212
+ error: w,
213
+ name: a,
214
214
  value: u,
215
- maxWidth: i,
215
+ maxWidth: c,
216
216
  onChange: p
217
217
  };
218
218
  return /* @__PURE__ */ e.jsx(_.Provider, { value: g, children: /* @__PURE__ */ e.jsxs(
219
219
  "fieldset",
220
220
  {
221
- ref: h,
222
- className: x("w-full border-0 p-0 m-0", o),
221
+ ref: b,
222
+ className: x("w-full border-0 p-0 m-0", i),
223
223
  disabled: d,
224
- ...m,
224
+ ...h,
225
225
  children: [
226
226
  r && /* @__PURE__ */ e.jsxs("legend", { className: "block text-sm font-medium text-foreground mb-3 float-none w-auto", children: [
227
227
  r,
228
- a && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
228
+ n && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
229
229
  ] }),
230
230
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-2", children: f }),
231
- y && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
232
- !y && s && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
231
+ w && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: s }),
232
+ !w && o && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-gray-600", children: o })
233
233
  ]
234
234
  }
235
235
  ) });
236
236
  }
237
237
  ), dt = Object.assign(ye, {
238
238
  Option: xe
239
- }), H = E(null), we = () => {
240
- const t = F(H);
239
+ }), H = F(null), we = () => {
240
+ const t = A(H);
241
241
  if (!t)
242
242
  throw new Error(
243
243
  "useChipMultipleInputContext must be used within ChipMultipleInputContext"
244
244
  );
245
245
  return t;
246
- }, ve = N(
246
+ }, je = C(
247
247
  "inline-flex items-center justify-center rounded-full bg-white transition-colors duration-200 cursor-pointer border border-border hover:bg-primary-soft hover:border-primary-bold focus:border-primary-light data-[selected=true]:bg-primary data-[selected=true]:border-primary data-[selected=true]:text-white",
248
248
  {
249
249
  variants: {
@@ -257,14 +257,14 @@ const lt = Object.assign(K, {
257
257
  size: "md"
258
258
  }
259
259
  }
260
- ), je = b.forwardRef(({ children: t, className: r, disabled: a, id: s, value: n, ...o }, d) => {
261
- const { size: c = "md", maxWidth: i, ...l } = we(), u = B(), p = s || u, f = a || l.disabled, m = l.readOnly, h = l.value?.includes(n) ?? !1, y = (g) => {
262
- if (!f && !m) {
263
- const j = l.value || [];
264
- let v;
265
- h ? v = j.filter((V) => V !== n) : v = [...j, n], l.onChange?.(v);
260
+ ), ve = m.forwardRef(({ children: t, className: r, disabled: n, id: o, value: s, ...i }, d) => {
261
+ const { size: l = "md", maxWidth: c, ...a } = we(), u = B(), p = o || u, f = n || a.disabled, h = a.readOnly, b = a.value?.includes(s) ?? !1, w = (g) => {
262
+ if (!f && !h) {
263
+ const k = a.value || [];
264
+ let j;
265
+ b ? j = k.filter((N) => N !== s) : j = [...k, s], a.onChange?.(j);
266
266
  }
267
- o.onChange?.(g);
267
+ i.onChange?.(g);
268
268
  };
269
269
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
270
270
  /* @__PURE__ */ e.jsx(
@@ -273,29 +273,29 @@ const lt = Object.assign(K, {
273
273
  ref: d,
274
274
  type: "checkbox",
275
275
  id: p,
276
- name: `${l.name}[]`,
277
- value: n,
278
- checked: h,
276
+ name: `${a.name}[]`,
277
+ value: s,
278
+ checked: b,
279
279
  disabled: f,
280
- readOnly: m,
281
- onChange: y,
280
+ readOnly: h,
281
+ onChange: w,
282
282
  className: "sr-only",
283
- ...o
283
+ ...i
284
284
  }
285
285
  ),
286
286
  /* @__PURE__ */ e.jsx(
287
287
  "label",
288
288
  {
289
289
  htmlFor: p,
290
- "data-selected": h,
291
- style: i ? { maxWidth: i } : void 0,
290
+ "data-selected": b,
291
+ style: c ? { maxWidth: c } : void 0,
292
292
  className: x(
293
- ve({
294
- size: c
293
+ je({
294
+ size: l
295
295
  }),
296
296
  f && "opacity-50 cursor-not-allowed pointer-events-none",
297
- m && "cursor-default pointer-events-none",
298
- i && "overflow-hidden",
297
+ h && "cursor-default pointer-events-none",
298
+ c && "overflow-hidden",
299
299
  r
300
300
  ),
301
301
  children: /* @__PURE__ */ e.jsx(
@@ -303,7 +303,7 @@ const lt = Object.assign(K, {
303
303
  {
304
304
  className: x(
305
305
  "flex items-center gap-2",
306
- i && "truncate min-w-0"
306
+ c && "truncate min-w-0"
307
307
  ),
308
308
  children: t
309
309
  }
@@ -311,55 +311,55 @@ const lt = Object.assign(K, {
311
311
  }
312
312
  )
313
313
  ] });
314
- }), ke = z(
314
+ }), ke = O(
315
315
  ({
316
316
  size: t = "md",
317
317
  label: r,
318
- required: a,
319
- helperText: s,
320
- error: n,
321
- className: o,
318
+ required: n,
319
+ helperText: o,
320
+ error: s,
321
+ className: i,
322
322
  disabled: d,
323
- readOnly: c,
324
- maxWidth: i,
325
- name: l,
323
+ readOnly: l,
324
+ maxWidth: c,
325
+ name: a,
326
326
  value: u = [],
327
327
  onChange: p,
328
328
  children: f,
329
- ...m
330
- }, h) => {
331
- const y = !!n, g = {
329
+ ...h
330
+ }, b) => {
331
+ const w = !!s, g = {
332
332
  size: t,
333
333
  disabled: d,
334
- readOnly: c,
335
- error: y,
336
- name: l,
334
+ readOnly: l,
335
+ error: w,
336
+ name: a,
337
337
  value: u,
338
- maxWidth: i,
338
+ maxWidth: c,
339
339
  onChange: p
340
340
  };
341
341
  return /* @__PURE__ */ e.jsx(H.Provider, { value: g, children: /* @__PURE__ */ e.jsxs(
342
342
  "fieldset",
343
343
  {
344
- ref: h,
345
- className: x("w-full border-0 p-0 m-0", o),
344
+ ref: b,
345
+ className: x("w-full border-0 p-0 m-0", i),
346
346
  disabled: d,
347
- ...m,
347
+ ...h,
348
348
  children: [
349
349
  r && /* @__PURE__ */ e.jsxs("legend", { className: "block text-sm font-medium text-foreground mb-3 float-none w-auto", children: [
350
350
  r,
351
- a && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
351
+ n && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
352
352
  ] }),
353
353
  /* @__PURE__ */ e.jsx("div", { className: "flex flex-wrap gap-2", children: f }),
354
- y && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
355
- !y && s && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
354
+ w && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: s }),
355
+ !w && o && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-gray-600", children: o })
356
356
  ]
357
357
  }
358
358
  ) });
359
359
  }
360
360
  ), ut = Object.assign(ke, {
361
- Option: je
362
- }), Ie = N(
361
+ Option: ve
362
+ }), Ie = C(
363
363
  "block w-full rounded-md border bg-white transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:bg-gray-50 text-left",
364
364
  {
365
365
  variants: {
@@ -373,35 +373,46 @@ const lt = Object.assign(K, {
373
373
  state: "default"
374
374
  }
375
375
  }
376
- ), J = b.forwardRef(
376
+ ), J = m.forwardRef(
377
377
  ({
378
378
  label: t,
379
379
  leftContent: r,
380
- rightContent: a,
381
- helperText: s,
382
- error: n,
383
- className: o,
380
+ rightContent: n,
381
+ helperText: o,
382
+ error: s,
383
+ className: i,
384
384
  disabled: d,
385
- id: c,
386
- required: i,
387
- value: l = "",
388
- placeholder: u = "",
389
- name: p,
390
- ...f
391
- }, m) => {
392
- const h = b.useId(), y = c || h, g = `${y}-helper`, j = `${y}-error`, v = !!n, V = l || u, R = b.useMemo(() => {
393
- const C = [];
394
- return v ? C.push(j) : s && C.push(g), C.length > 0 ? C.join(" ") : void 0;
395
- }, [v, s, j, g]);
396
- return /* @__PURE__ */ e.jsxs("div", { className: x("w-full", o), children: [
385
+ id: l,
386
+ required: c,
387
+ value: a,
388
+ displayValue: u,
389
+ placeholder: p = "",
390
+ name: f,
391
+ ...h
392
+ }, b) => {
393
+ const w = m.useId(), g = l || w, k = `${g}-helper`, j = `${g}-error`, N = !!s, V = m.useMemo(() => {
394
+ if (u) return u;
395
+ if (a != null && a !== "") {
396
+ if (typeof a == "string") return a;
397
+ if (typeof a == "number" || typeof a == "boolean")
398
+ return String(a);
399
+ if (Array.isArray(a)) return a.join(", ");
400
+ if (typeof a == "object") return JSON.stringify(a);
401
+ }
402
+ return p;
403
+ }, [a, u, p]), R = m.useMemo(() => a == null ? "" : typeof a == "string" || typeof a == "number" || typeof a == "boolean" ? String(a) : Array.isArray(a) || typeof a == "object" ? JSON.stringify(a) : String(a), [a]), S = a != null && a !== "" && V !== p, E = m.useMemo(() => {
404
+ const z = [];
405
+ return N ? z.push(j) : o && z.push(k), z.length > 0 ? z.join(" ") : void 0;
406
+ }, [N, o, j, k]);
407
+ return /* @__PURE__ */ e.jsxs("div", { className: x("w-full", i), children: [
397
408
  t && /* @__PURE__ */ e.jsxs(
398
409
  "label",
399
410
  {
400
- htmlFor: y,
411
+ htmlFor: g,
401
412
  className: "block text-sm font-medium text-foreground mb-2",
402
413
  children: [
403
414
  t,
404
- i && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
415
+ c && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
405
416
  ]
406
417
  }
407
418
  ),
@@ -418,58 +429,58 @@ const lt = Object.assign(K, {
418
429
  /* @__PURE__ */ e.jsx(
419
430
  "button",
420
431
  {
421
- ref: m,
422
- id: y,
432
+ ref: b,
433
+ id: g,
423
434
  type: "button",
424
435
  disabled: d,
425
- "aria-invalid": v || void 0,
426
- "aria-describedby": R,
427
- "aria-errormessage": v ? j : void 0,
428
- "aria-required": i || void 0,
436
+ "aria-invalid": N || void 0,
437
+ "aria-describedby": E,
438
+ "aria-errormessage": N ? j : void 0,
439
+ "aria-required": c || void 0,
429
440
  className: x(
430
441
  Ie({
431
- state: v ? "error" : "default"
442
+ state: N ? "error" : "default"
432
443
  }),
433
444
  r ? "pl-9" : "pl-3",
434
- a ? "pr-9" : "pr-3",
445
+ n ? "pr-9" : "pr-3",
435
446
  "h-9",
436
- !l && "text-gray-400"
447
+ !S && "text-gray-400"
437
448
  ),
438
- ...f,
449
+ ...h,
439
450
  children: V
440
451
  }
441
452
  ),
442
- a && /* @__PURE__ */ e.jsx(
453
+ n && /* @__PURE__ */ e.jsx(
443
454
  "span",
444
455
  {
445
456
  className: "absolute right-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5 z-10",
446
457
  "aria-hidden": "true",
447
458
  "data-testid": "right-content",
448
- children: a
459
+ children: n
449
460
  }
450
461
  ),
451
- p && /* @__PURE__ */ e.jsx(
462
+ f && /* @__PURE__ */ e.jsx(
452
463
  "input",
453
464
  {
454
465
  type: "hidden",
455
- name: p,
456
- value: l,
466
+ name: f,
467
+ value: R,
457
468
  readOnly: !0,
458
469
  "data-testid": "hidden-input"
459
470
  }
460
471
  )
461
472
  ] }),
462
- v && /* @__PURE__ */ e.jsx(
473
+ N && /* @__PURE__ */ e.jsx(
463
474
  "div",
464
475
  {
465
476
  id: j,
466
477
  className: "mt-1 text-sm text-danger",
467
478
  role: "alert",
468
479
  "aria-live": "polite",
469
- children: n
480
+ children: s
470
481
  }
471
482
  ),
472
- !v && s && /* @__PURE__ */ e.jsx("div", { id: g, className: "mt-1 text-sm text-gray-600", children: s })
483
+ !N && o && /* @__PURE__ */ e.jsx("div", { id: k, className: "mt-1 text-sm text-gray-600", children: o })
473
484
  ] });
474
485
  }
475
486
  );
@@ -483,24 +494,24 @@ function Ne(t) {
483
494
  day: "numeric"
484
495
  });
485
496
  }
486
- const ft = b.forwardRef(function({ value: r = "", onChange: a, label: s, formatter: n, min: o, max: d, ...c }, i) {
487
- const l = T(null), u = (h) => {
488
- l.current = h, typeof i == "function" ? i(h) : i && typeof i == "object" && (i.current = h);
497
+ const ft = m.forwardRef(function({ value: r = "", onChange: n, label: o, formatter: s, min: i, max: d, ...l }, c) {
498
+ const a = T(null), u = (b) => {
499
+ a.current = b, typeof c == "function" ? c(b) : c && typeof c == "object" && (c.current = b);
489
500
  }, p = () => {
490
- l.current && (typeof l.current.showPicker == "function" ? l.current.showPicker() : l.current.focus());
491
- }, f = (h) => {
492
- a(h.target.value);
493
- }, m = (n ?? Ne)(r);
501
+ a.current && (typeof a.current.showPicker == "function" ? a.current.showPicker() : a.current.focus());
502
+ }, f = (b) => {
503
+ n(b.target.value);
504
+ }, h = (s ?? Ne)(r);
494
505
  return /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
495
506
  /* @__PURE__ */ e.jsx(
496
507
  J,
497
508
  {
498
509
  onClick: p,
499
- value: m,
500
- label: s,
501
- leftContent: /* @__PURE__ */ e.jsx(P, { as: oe, color: "inherit", size: "sm" }),
510
+ value: h,
511
+ label: o,
512
+ leftContent: /* @__PURE__ */ e.jsx($, { as: oe, color: "inherit", size: "sm" }),
502
513
  "data-testid": "date-single-picker-visible-input",
503
- ...c
514
+ ...l
504
515
  }
505
516
  ),
506
517
  /* @__PURE__ */ e.jsx(
@@ -510,15 +521,15 @@ const ft = b.forwardRef(function({ value: r = "", onChange: a, label: s, formatt
510
521
  type: "date",
511
522
  value: r,
512
523
  onChange: f,
513
- min: o,
524
+ min: i,
514
525
  max: d,
515
526
  className: "sr-only absolute opacity-0 h-0 w-0 pointer-events-none",
516
527
  tabIndex: -1,
517
- "aria-label": typeof s == "string" ? s : void 0
528
+ "aria-label": typeof o == "string" ? o : void 0
518
529
  }
519
530
  )
520
531
  ] });
521
- }), Ce = N(
532
+ }), Ce = C(
522
533
  "block w-full rounded-md border bg-white transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:bg-gray-50",
523
534
  {
524
535
  variants: {
@@ -532,33 +543,33 @@ const ft = b.forwardRef(function({ value: r = "", onChange: a, label: s, formatt
532
543
  state: "default"
533
544
  }
534
545
  }
535
- ), $ = b.forwardRef(
546
+ ), M = m.forwardRef(
536
547
  ({
537
548
  label: t,
538
549
  leftContent: r,
539
- rightContent: a,
540
- helperText: s,
541
- error: n,
542
- className: o,
550
+ rightContent: n,
551
+ helperText: o,
552
+ error: s,
553
+ className: i,
543
554
  disabled: d,
544
- readOnly: c,
545
- id: i,
546
- required: l,
555
+ readOnly: l,
556
+ id: c,
557
+ required: a,
547
558
  ...u
548
559
  }, p) => {
549
- const f = b.useId(), m = i || f, h = `${m}-helper`, y = `${m}-error`, g = !!n, j = b.useMemo(() => {
550
- const v = [];
551
- return g ? v.push(y) : s && v.push(h), v.length > 0 ? v.join(" ") : void 0;
552
- }, [g, s, y, h]);
553
- return /* @__PURE__ */ e.jsxs("div", { className: x("w-full", o), children: [
560
+ const f = m.useId(), h = c || f, b = `${h}-helper`, w = `${h}-error`, g = !!s, k = m.useMemo(() => {
561
+ const j = [];
562
+ return g ? j.push(w) : o && j.push(b), j.length > 0 ? j.join(" ") : void 0;
563
+ }, [g, o, w, b]);
564
+ return /* @__PURE__ */ e.jsxs("div", { className: x("w-full", i), children: [
554
565
  t && /* @__PURE__ */ e.jsxs(
555
566
  "label",
556
567
  {
557
- htmlFor: m,
568
+ htmlFor: h,
558
569
  className: "block text-sm font-medium text-foreground mb-2",
559
570
  children: [
560
571
  t,
561
- l && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
572
+ a && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
562
573
  ]
563
574
  }
564
575
  ),
@@ -576,164 +587,164 @@ const ft = b.forwardRef(function({ value: r = "", onChange: a, label: s, formatt
576
587
  "input",
577
588
  {
578
589
  ref: p,
579
- id: m,
580
- required: l,
590
+ id: h,
591
+ required: a,
581
592
  disabled: d,
582
- readOnly: c,
593
+ readOnly: l,
583
594
  "aria-invalid": g,
584
- "aria-describedby": j,
585
- "aria-errormessage": g ? y : void 0,
595
+ "aria-describedby": k,
596
+ "aria-errormessage": g ? w : void 0,
586
597
  className: x(
587
598
  Ce({
588
- state: g ? "error" : c ? "readOnly" : "default"
599
+ state: g ? "error" : l ? "readOnly" : "default"
589
600
  }),
590
601
  r ? "pl-9" : "pl-3",
591
- a ? "pr-9" : "pr-3",
602
+ n ? "pr-9" : "pr-3",
592
603
  "h-9"
593
604
  ),
594
605
  ...u
595
606
  }
596
607
  ),
597
- a && /* @__PURE__ */ e.jsx(
608
+ n && /* @__PURE__ */ e.jsx(
598
609
  "span",
599
610
  {
600
611
  className: "absolute right-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5",
601
612
  "aria-hidden": "true",
602
613
  "data-testid": "right-content",
603
- children: a
614
+ children: n
604
615
  }
605
616
  )
606
617
  ] }),
607
618
  g && /* @__PURE__ */ e.jsx(
608
619
  "div",
609
620
  {
610
- id: y,
621
+ id: w,
611
622
  className: "mt-1 text-sm text-danger",
612
623
  role: "alert",
613
624
  "aria-live": "polite",
614
- children: n
625
+ children: s
615
626
  }
616
627
  ),
617
- !g && s && /* @__PURE__ */ e.jsx("div", { id: h, className: "mt-1 text-sm text-gray-600", children: s })
628
+ !g && o && /* @__PURE__ */ e.jsx("div", { id: b, className: "mt-1 text-sm text-gray-600", children: o })
618
629
  ] });
619
630
  }
620
631
  );
621
- $.displayName = "TextInput";
622
- const pt = z(
632
+ M.displayName = "TextInput";
633
+ const pt = O(
623
634
  (t, r) => /* @__PURE__ */ e.jsx(
624
- $,
635
+ M,
625
636
  {
626
637
  ...t,
627
638
  ref: r,
628
639
  type: "email",
629
640
  autoComplete: "email",
630
641
  inputMode: "email",
631
- leftContent: /* @__PURE__ */ e.jsx(P, { as: ie, color: "inherit", size: "sm" })
642
+ leftContent: /* @__PURE__ */ e.jsx($, { as: ie, color: "inherit", size: "sm" })
632
643
  }
633
644
  )
634
- ), Ve = "w-9 h-9 text-center border border-primary/30 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50 disabled:pointer-events-none disabled:bg-gray-50 text-sm font-semibold text-foreground", Re = "w-9 h-9 text-center border border-danger rounded-md bg-danger/5 transition-colors focus:outline-none focus:ring-2 focus:ring-danger/20 focus:border-danger disabled:opacity-50 disabled:pointer-events-none disabled:bg-gray-50 text-sm font-semibold text-foreground", Se = (t) => /^\d$/.test(t), W = (t, r) => t?.replace(/\D/g, "").slice(0, r) || "", Q = b.forwardRef(
645
+ ), Ve = "w-9 h-9 text-center border border-primary/30 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50 disabled:pointer-events-none disabled:bg-gray-50 text-sm font-semibold text-foreground", Re = "w-9 h-9 text-center border border-danger rounded-md bg-danger/5 transition-colors focus:outline-none focus:ring-2 focus:ring-danger/20 focus:border-danger disabled:opacity-50 disabled:pointer-events-none disabled:bg-gray-50 text-sm font-semibold text-foreground", Se = (t) => /^\d$/.test(t), W = (t, r) => t?.replace(/\D/g, "").slice(0, r) || "", Q = m.forwardRef(
635
646
  ({
636
647
  value: t,
637
648
  onChange: r,
638
- onKeyDown: a,
639
- onFocus: s,
640
- onPaste: n,
641
- disabled: o,
649
+ onKeyDown: n,
650
+ onFocus: o,
651
+ onPaste: s,
652
+ disabled: i,
642
653
  error: d,
643
- secure: c,
644
- inputRef: i,
645
- index: l,
654
+ secure: l,
655
+ inputRef: c,
656
+ index: a,
646
657
  id: u
647
658
  }, p) => /* @__PURE__ */ e.jsx(
648
659
  "input",
649
660
  {
650
- ref: i,
661
+ ref: c,
651
662
  id: u,
652
663
  type: "text",
653
664
  inputMode: "numeric",
654
- pattern: c ? void 0 : "[0-9]*",
665
+ pattern: l ? void 0 : "[0-9]*",
655
666
  maxLength: 1,
656
- value: c ? t ? "•" : "" : t,
667
+ value: l ? t ? "•" : "" : t,
657
668
  onChange: (f) => {
658
- const m = f.target.value;
659
- (m === "" || Se(m)) && r(m);
669
+ const h = f.target.value;
670
+ (h === "" || Se(h)) && r(h);
660
671
  },
661
- onKeyDown: a,
662
- onFocus: s,
663
- onPaste: n,
664
- disabled: o,
672
+ onKeyDown: n,
673
+ onFocus: o,
674
+ onPaste: s,
675
+ disabled: i,
665
676
  "aria-invalid": d,
666
- "aria-disabled": o,
677
+ "aria-disabled": i,
667
678
  className: d ? Re : Ve,
668
679
  autoComplete: "one-time-code",
669
- "data-testid": `pin-input-${l}`
680
+ "data-testid": `pin-input-${a}`
670
681
  }
671
682
  )
672
683
  );
673
684
  Q.displayName = "PinInput";
674
- const De = b.forwardRef(
685
+ const De = m.forwardRef(
675
686
  ({
676
687
  label: t,
677
688
  helperText: r,
678
- error: a,
679
- disabled: s,
680
- value: n,
681
- onChange: o,
689
+ error: n,
690
+ disabled: o,
691
+ value: s,
692
+ onChange: i,
682
693
  onComplete: d,
683
- digits: c = 6,
684
- className: i,
685
- id: l,
694
+ digits: l = 6,
695
+ className: c,
696
+ id: a,
686
697
  name: u,
687
698
  required: p,
688
699
  secure: f = !1,
689
- ...m
690
- }, h) => {
691
- const y = b.useId(), g = l || y, j = !!a, v = b.useRef([]), V = W(n, c), R = V.split("").concat(Array(c - V.length).fill("")), C = b.useCallback(
692
- (k) => {
693
- const w = W(k, c);
694
- o(w), w.length === c && d?.(w);
700
+ ...h
701
+ }, b) => {
702
+ const w = m.useId(), g = a || w, k = !!n, j = m.useRef([]), N = W(s, l), V = N.split("").concat(Array(l - N.length).fill("")), R = m.useCallback(
703
+ (v) => {
704
+ const y = W(v, l);
705
+ i(y), y.length === l && d?.(y);
695
706
  },
696
- [o, d, c]
697
- ), D = b.useCallback(
698
- (k, w) => {
699
- const I = [...R];
700
- I[k] = w;
701
- const S = I.join("").replace(/\s+$/, "");
702
- C(S), w && k < c - 1 && v.current[k + 1]?.focus();
707
+ [i, d, l]
708
+ ), S = m.useCallback(
709
+ (v, y) => {
710
+ const I = [...V];
711
+ I[v] = y;
712
+ const D = I.join("").replace(/\s+$/, "");
713
+ R(D), y && v < l - 1 && j.current[v + 1]?.focus();
703
714
  },
704
- [R, C, c]
705
- ), M = b.useCallback(
706
- (k, w) => {
707
- if (w.key === "Backspace") {
708
- if (!R[k] && k > 0) {
709
- w.preventDefault();
710
- const I = [...R];
711
- I[k - 1] = "";
712
- const S = I.join("").replace(/\s+$/, "");
713
- C(S), v.current[k - 1]?.focus();
714
- } else if (R[k]) {
715
- w.preventDefault();
716
- const I = [...R];
717
- I[k] = "";
718
- const S = I.join("").replace(/\s+$/, "");
719
- C(S);
715
+ [V, R, l]
716
+ ), E = m.useCallback(
717
+ (v, y) => {
718
+ if (y.key === "Backspace") {
719
+ if (!V[v] && v > 0) {
720
+ y.preventDefault();
721
+ const I = [...V];
722
+ I[v - 1] = "";
723
+ const D = I.join("").replace(/\s+$/, "");
724
+ R(D), j.current[v - 1]?.focus();
725
+ } else if (V[v]) {
726
+ y.preventDefault();
727
+ const I = [...V];
728
+ I[v] = "";
729
+ const D = I.join("").replace(/\s+$/, "");
730
+ R(D);
720
731
  }
721
- } else w.key === "ArrowLeft" && k > 0 ? (w.preventDefault(), v.current[k - 1]?.focus()) : w.key === "ArrowRight" && k < c - 1 && (w.preventDefault(), v.current[k + 1]?.focus());
732
+ } else y.key === "ArrowLeft" && v > 0 ? (y.preventDefault(), j.current[v - 1]?.focus()) : y.key === "ArrowRight" && v < l - 1 && (y.preventDefault(), j.current[v + 1]?.focus());
722
733
  },
723
- [R, C, c]
724
- ), A = b.useCallback(
725
- (k) => {
726
- k.preventDefault();
727
- const w = k.clipboardData.getData("text"), I = W(w, c);
734
+ [V, R, l]
735
+ ), z = m.useCallback(
736
+ (v) => {
737
+ v.preventDefault();
738
+ const y = v.clipboardData.getData("text"), I = W(y, l);
728
739
  if (I.length > 0) {
729
- C(I);
730
- const S = Math.min(I.length, c - 1);
731
- v.current[S]?.focus();
740
+ R(I);
741
+ const D = Math.min(I.length, l - 1);
742
+ j.current[D]?.focus();
732
743
  }
733
744
  },
734
- [C, c]
745
+ [R, l]
735
746
  );
736
- return /* @__PURE__ */ e.jsxs("div", { ref: h, className: x("w-full", i), ...m, children: [
747
+ return /* @__PURE__ */ e.jsxs("div", { ref: b, className: x("w-full", c), ...h, children: [
737
748
  t && /* @__PURE__ */ e.jsxs(
738
749
  "label",
739
750
  {
@@ -751,28 +762,28 @@ const De = b.forwardRef(
751
762
  className: "flex gap-2 justify-center",
752
763
  role: "group",
753
764
  "aria-labelledby": t ? `${g}-label` : void 0,
754
- "aria-describedby": j ? `${g}-error` : r ? `${g}-helper` : void 0,
755
- children: R.map((k, w) => /* @__PURE__ */ e.jsx(
765
+ "aria-describedby": k ? `${g}-error` : r ? `${g}-helper` : void 0,
766
+ children: V.map((v, y) => /* @__PURE__ */ e.jsx(
756
767
  Q,
757
768
  {
758
- value: k,
759
- onChange: (I) => D(w, I),
760
- onKeyDown: (I) => M(w, I),
769
+ value: v,
770
+ onChange: (I) => S(y, I),
771
+ onKeyDown: (I) => E(y, I),
761
772
  onFocus: () => {
762
- const I = v.current[w];
773
+ const I = j.current[y];
763
774
  I && I.select();
764
775
  },
765
- onPaste: A,
766
- disabled: s,
767
- error: j,
776
+ onPaste: z,
777
+ disabled: o,
778
+ error: k,
768
779
  secure: f,
769
780
  inputRef: (I) => {
770
- v.current[w] = I;
781
+ j.current[y] = I;
771
782
  },
772
- index: w,
773
- id: `${g}-${w}`
783
+ index: y,
784
+ id: `${g}-${y}`
774
785
  },
775
- w
786
+ y
776
787
  ))
777
788
  }
778
789
  ),
@@ -781,38 +792,38 @@ const De = b.forwardRef(
781
792
  {
782
793
  type: "hidden",
783
794
  name: u,
784
- value: V,
795
+ value: N,
785
796
  required: p
786
797
  }
787
798
  ),
788
- j && /* @__PURE__ */ e.jsx(
799
+ k && /* @__PURE__ */ e.jsx(
789
800
  "div",
790
801
  {
791
802
  id: `${g}-error`,
792
803
  className: "mt-2 text-sm text-danger",
793
804
  role: "alert",
794
- children: a
805
+ children: n
795
806
  }
796
807
  ),
797
- !j && r && /* @__PURE__ */ e.jsx("div", { id: `${g}-helper`, className: "mt-2 text-sm text-gray-600", children: r })
808
+ !k && r && /* @__PURE__ */ e.jsx("div", { id: `${g}-helper`, className: "mt-2 text-sm text-gray-600", children: r })
798
809
  ] });
799
810
  }
800
811
  );
801
812
  De.displayName = "PinField";
802
813
  function ze(t, r) {
803
- ne(() => {
814
+ ae(() => {
804
815
  typeof t == "number" && !isNaN(t) ? r(`${t}`) : t === "" || t === null || t === void 0 ? r("") : typeof t == "string" && r(t);
805
816
  }, [t, r]);
806
817
  }
807
818
  function Oe(t, r = !1) {
808
819
  if (t === "" || t === "-" && r) return !0;
809
- const a = r && t.startsWith("-") ? t.slice(1) : t;
810
- if (r && t.startsWith("-") && a === "") return !0;
811
- if (a.startsWith(".") || a.startsWith(",") || !/^[\d.,]+$/.test(a)) return !1;
812
- const s = a.split(",");
813
- if (s.length > 2) return !1;
814
- const n = s[0], o = s[1];
815
- return !(n === "" || !Pe(n) || o !== void 0 && o !== "" && !$e(o));
820
+ const n = r && t.startsWith("-") ? t.slice(1) : t;
821
+ if (r && t.startsWith("-") && n === "") return !0;
822
+ if (n.startsWith(".") || n.startsWith(",") || !/^[\d.,]+$/.test(n)) return !1;
823
+ const o = n.split(",");
824
+ if (o.length > 2) return !1;
825
+ const s = o[0], i = o[1];
826
+ return !(s === "" || !Pe(s) || i !== void 0 && i !== "" && !$e(i));
816
827
  }
817
828
  function Pe(t) {
818
829
  if (t === "") return !1;
@@ -820,11 +831,11 @@ function Pe(t) {
820
831
  return /^\d+$/.test(t);
821
832
  const r = t.split(".");
822
833
  if (r[0] === "" || !/^\d{1,3}$/.test(r[0])) return !1;
823
- for (let a = 1; a < r.length; a++) {
824
- const s = r[a];
825
- if (a === r.length - 1) {
826
- if (s !== "" && !/^\d{1,3}$/.test(s)) return !1;
827
- } else if (!/^\d{3}$/.test(s)) return !1;
834
+ for (let n = 1; n < r.length; n++) {
835
+ const o = r[n];
836
+ if (n === r.length - 1) {
837
+ if (o !== "" && !/^\d{1,3}$/.test(o)) return !1;
838
+ } else if (!/^\d{3}$/.test(o)) return !1;
828
839
  }
829
840
  return !0;
830
841
  }
@@ -833,56 +844,56 @@ function $e(t) {
833
844
  }
834
845
  function U(t, r = !1) {
835
846
  if (t === "") return "";
836
- const a = t.startsWith("-");
837
- if (a && !r)
847
+ const n = t.startsWith("-");
848
+ if (n && !r)
838
849
  return U(t.slice(1), !1);
839
- if (a && t.length === 1) return "-";
840
- let n = (a ? t.slice(1) : t).replace(/[^\d.,]/g, "");
841
- const o = n.lastIndexOf(",");
842
- if (o !== -1) {
843
- const d = n.slice(0, o).replace(/,/g, ""), c = n.slice(o + 1).replace(/,/g, "");
844
- n = d + "," + c;
850
+ if (n && t.length === 1) return "-";
851
+ let s = (n ? t.slice(1) : t).replace(/[^\d.,]/g, "");
852
+ const i = s.lastIndexOf(",");
853
+ if (i !== -1) {
854
+ const d = s.slice(0, i).replace(/,/g, ""), l = s.slice(i + 1).replace(/,/g, "");
855
+ s = d + "," + l;
845
856
  }
846
- return n = n.replace(/\.{2,}/g, "."), (a ? "-" : "") + n;
857
+ return s = s.replace(/\.{2,}/g, "."), (n ? "-" : "") + s;
847
858
  }
848
859
  const mt = ({
849
860
  value: t,
850
861
  onChange: r,
851
- allowNegative: a = !1,
852
- inputProps: s,
853
- label: n,
854
- helperText: o,
862
+ allowNegative: n = !1,
863
+ inputProps: o,
864
+ label: s,
865
+ helperText: i,
855
866
  error: d,
856
- ...c
867
+ ...l
857
868
  }) => {
858
- const i = T(null), [l, u] = se(
869
+ const c = T(null), [a, u] = se(
859
870
  t === "" ? "" : String(t)
860
871
  );
861
872
  ze(t, u);
862
873
  const p = (f) => {
863
- const m = f.target.value, h = U(m, a);
864
- Oe(h, a) ? (u(h), r(h)) : f.preventDefault();
874
+ const h = f.target.value, b = U(h, n);
875
+ Oe(b, n) ? (u(b), r(b)) : f.preventDefault();
865
876
  };
866
877
  return /* @__PURE__ */ e.jsx(
867
- $,
878
+ M,
868
879
  {
869
- ref: i,
880
+ ref: c,
870
881
  type: "text",
871
- label: n,
872
- value: l,
882
+ label: s,
883
+ value: a,
873
884
  onChange: p,
874
885
  error: d,
875
- helperText: o,
876
- placeholder: c.placeholder,
877
- leftContent: /* @__PURE__ */ e.jsx(P, { as: ce, color: "inherit", size: "sm" }),
886
+ helperText: i,
887
+ placeholder: l.placeholder,
888
+ leftContent: /* @__PURE__ */ e.jsx($, { as: ce, color: "inherit", size: "sm" }),
878
889
  inputMode: "numeric",
879
890
  autoComplete: "off",
880
891
  pattern: "[0-9.,-]*",
881
- ...s,
882
- ...c
892
+ ...o,
893
+ ...l
883
894
  }
884
895
  );
885
- }, Ee = N("space-y-2", {
896
+ }, Ee = C("space-y-2", {
886
897
  variants: {
887
898
  direction: {
888
899
  vertical: "space-y-2 space-x-0",
@@ -892,7 +903,7 @@ const mt = ({
892
903
  defaultVariants: {
893
904
  direction: "vertical"
894
905
  }
895
- }), Fe = N(
906
+ }), Me = C(
896
907
  "relative h-4 w-4 rounded-full border cursor-pointer transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed appearance-none bg-white",
897
908
  {
898
909
  variants: {
@@ -930,7 +941,7 @@ const mt = ({
930
941
  size: "md"
931
942
  }
932
943
  }
933
- ), Be = N(
944
+ ), Fe = C(
934
945
  "text-foreground cursor-pointer select-none",
935
946
  {
936
947
  variants: {
@@ -949,43 +960,43 @@ const mt = ({
949
960
  disabled: !1
950
961
  }
951
962
  }
952
- ), X = E(
963
+ ), X = F(
953
964
  null
954
- ), Me = () => {
955
- const t = F(X);
965
+ ), Ae = () => {
966
+ const t = A(X);
956
967
  if (!t)
957
968
  throw new Error(
958
969
  "useRadioInputContext must be used within RadioInputContext"
959
970
  );
960
971
  return t;
961
- }, Ae = b.forwardRef(
962
- ({ children: t, description: r, className: a, disabled: s, id: n, value: o, ...d }, c) => {
963
- const i = Me(), l = b.useId(), u = n || l, p = s || i.disabled, f = i.error ? "danger" : i.variant || "primary";
972
+ }, Be = m.forwardRef(
973
+ ({ children: t, description: r, className: n, disabled: o, id: s, value: i, ...d }, l) => {
974
+ const c = Ae(), a = m.useId(), u = s || a, p = o || c.disabled, f = c.error ? "danger" : c.variant || "primary";
964
975
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
965
976
  /* @__PURE__ */ e.jsx("div", { className: "relative flex items-center", children: /* @__PURE__ */ e.jsx(
966
977
  "input",
967
978
  {
968
- ref: c,
979
+ ref: l,
969
980
  type: "radio",
970
981
  id: u,
971
- name: i.name,
972
- value: o,
982
+ name: c.name,
983
+ value: i,
973
984
  disabled: p,
974
985
  className: x(
975
- Fe({
986
+ Me({
976
987
  variant: f,
977
- size: i.size
988
+ size: c.size
978
989
  }),
979
990
  // Custom radio dot styling using ::before - centered positioning with size variants
980
991
  'before:content-[""] before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:bg-white before:opacity-0 before:transition-opacity before:duration-200',
981
992
  // Size-specific radio dot dimensions
982
- i.size === "sm" && "before:w-[6px] before:h-[6px]",
983
- i.size === "md" && "before:w-[8px] before:h-[8px]",
984
- i.size === "lg" && "before:w-[10px] before:h-[10px]",
993
+ c.size === "sm" && "before:w-[6px] before:h-[6px]",
994
+ c.size === "md" && "before:w-[8px] before:h-[8px]",
995
+ c.size === "lg" && "before:w-[10px] before:h-[10px]",
985
996
  "checked:before:opacity-100",
986
997
  // Outline variants use colored radio dot
987
998
  f?.includes("outline") && "checked:before:bg-current",
988
- a
999
+ n
989
1000
  ),
990
1001
  ...d
991
1002
  }
@@ -995,8 +1006,8 @@ const mt = ({
995
1006
  "label",
996
1007
  {
997
1008
  htmlFor: u,
998
- className: Be({
999
- size: i.size,
1009
+ className: Fe({
1010
+ size: c.size,
1000
1011
  disabled: p
1001
1012
  }),
1002
1013
  children: t
@@ -1007,9 +1018,9 @@ const mt = ({
1007
1018
  {
1008
1019
  className: x(
1009
1020
  "text-gray-600 mt-1",
1010
- i.size === "sm" && "text-xs",
1011
- i.size === "md" && "text-xs",
1012
- i.size === "lg" && "text-sm",
1021
+ c.size === "sm" && "text-xs",
1022
+ c.size === "md" && "text-xs",
1023
+ c.size === "lg" && "text-sm",
1013
1024
  p && "opacity-50"
1014
1025
  ),
1015
1026
  children: r
@@ -1018,64 +1029,64 @@ const mt = ({
1018
1029
  ] })
1019
1030
  ] });
1020
1031
  }
1021
- ), We = b.forwardRef(
1032
+ ), We = m.forwardRef(
1022
1033
  ({
1023
1034
  variant: t = "primary",
1024
1035
  size: r = "md",
1025
- label: a,
1026
- helperText: s,
1027
- error: n,
1028
- direction: o = "vertical",
1036
+ label: n,
1037
+ helperText: o,
1038
+ error: s,
1039
+ direction: i = "vertical",
1029
1040
  className: d,
1030
- disabled: c,
1031
- name: i,
1032
- children: l,
1041
+ disabled: l,
1042
+ name: c,
1043
+ children: a,
1033
1044
  ...u
1034
1045
  }, p) => {
1035
- const f = !!n, m = {
1046
+ const f = !!s, h = {
1036
1047
  variant: t,
1037
1048
  size: r,
1038
- disabled: c,
1049
+ disabled: l,
1039
1050
  error: f,
1040
- name: i
1051
+ name: c
1041
1052
  };
1042
- return /* @__PURE__ */ e.jsx(X.Provider, { value: m, children: /* @__PURE__ */ e.jsxs("div", { ref: p, className: x("w-full", d), ...u, children: [
1043
- a && /* @__PURE__ */ e.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: a }),
1044
- /* @__PURE__ */ e.jsx("div", { className: Ee({ direction: o }), children: l }),
1045
- f && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
1046
- !f && s && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
1053
+ return /* @__PURE__ */ e.jsx(X.Provider, { value: h, children: /* @__PURE__ */ e.jsxs("div", { ref: p, className: x("w-full", d), ...u, children: [
1054
+ n && /* @__PURE__ */ e.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: n }),
1055
+ /* @__PURE__ */ e.jsx("div", { className: Ee({ direction: i }), children: a }),
1056
+ f && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: s }),
1057
+ !f && o && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-gray-600", children: o })
1047
1058
  ] }) });
1048
1059
  }
1049
1060
  ), ht = Object.assign(We, {
1050
- Option: Ae
1051
- }), bt = z(
1061
+ Option: Be
1062
+ }), bt = O(
1052
1063
  ({
1053
1064
  autoComplete: t = "off",
1054
1065
  spellCheck: r = !1,
1055
- inputMode: a = "search",
1056
- placeholder: s = "Search...",
1057
- maxLength: n = 256,
1058
- enterKeyHint: o = "search",
1066
+ inputMode: n = "search",
1067
+ placeholder: o = "Search...",
1068
+ maxLength: s = 256,
1069
+ enterKeyHint: i = "search",
1059
1070
  "aria-label": d = "Search",
1060
1071
  // internal default, not in props
1061
- ...c
1062
- }, i) => /* @__PURE__ */ e.jsx(
1063
- $,
1072
+ ...l
1073
+ }, c) => /* @__PURE__ */ e.jsx(
1074
+ M,
1064
1075
  {
1065
- ref: i,
1076
+ ref: c,
1066
1077
  type: "search",
1067
- inputMode: a,
1078
+ inputMode: n,
1068
1079
  autoComplete: t,
1069
1080
  spellCheck: r,
1070
- placeholder: s,
1071
- maxLength: n,
1072
- enterKeyHint: o,
1081
+ placeholder: o,
1082
+ maxLength: s,
1083
+ enterKeyHint: i,
1073
1084
  "aria-label": d,
1074
- leftContent: /* @__PURE__ */ e.jsx(P, { as: le, color: "inherit", size: "sm" }),
1075
- ...c
1085
+ leftContent: /* @__PURE__ */ e.jsx($, { as: le, color: "inherit", size: "sm" }),
1086
+ ...l
1076
1087
  }
1077
1088
  )
1078
- ), Le = N(
1089
+ ), Le = C(
1079
1090
  "block w-full rounded-md border bg-white transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none disabled:bg-gray-50 appearance-none bg-no-repeat bg-right pr-10",
1080
1091
  {
1081
1092
  variants: {
@@ -1089,38 +1100,38 @@ const mt = ({
1089
1100
  state: "default"
1090
1101
  }
1091
1102
  }
1092
- ), Y = b.forwardRef(({ value: t, children: r, ...a }, s) => /* @__PURE__ */ e.jsx("option", { ref: s, value: t, ...a, children: r }));
1103
+ ), Y = m.forwardRef(({ value: t, children: r, ...n }, o) => /* @__PURE__ */ e.jsx("option", { ref: o, value: t, ...n, children: r }));
1093
1104
  Y.displayName = "SelectOption";
1094
- const Z = b.forwardRef(({ label: t, children: r, ...a }, s) => /* @__PURE__ */ e.jsx("optgroup", { ref: s, label: t, ...a, children: r }));
1105
+ const Z = m.forwardRef(({ label: t, children: r, ...n }, o) => /* @__PURE__ */ e.jsx("optgroup", { ref: o, label: t, ...n, children: r }));
1095
1106
  Z.displayName = "SelectOptionGroup";
1096
- const ee = b.forwardRef(
1107
+ const ee = m.forwardRef(
1097
1108
  ({
1098
1109
  label: t,
1099
1110
  helperText: r,
1100
- error: a,
1101
- className: s,
1102
- disabled: n,
1103
- readOnly: o,
1111
+ error: n,
1112
+ className: o,
1113
+ disabled: s,
1114
+ readOnly: i,
1104
1115
  id: d,
1105
- required: c,
1106
- placeholder: i,
1107
- children: l,
1116
+ required: l,
1117
+ placeholder: c,
1118
+ children: a,
1108
1119
  onChange: u,
1109
1120
  ...p
1110
1121
  }, f) => {
1111
- const m = b.useId(), h = d || m, y = `${h}-helper`, g = `${h}-error`, j = !!a, v = b.useMemo(() => {
1112
- const V = [];
1113
- return j ? V.push(g) : r && V.push(y), V.length > 0 ? V.join(" ") : void 0;
1114
- }, [j, r, g, y]);
1115
- return /* @__PURE__ */ e.jsxs("div", { className: x("w-full", s), children: [
1122
+ const h = m.useId(), b = d || h, w = `${b}-helper`, g = `${b}-error`, k = !!n, j = m.useMemo(() => {
1123
+ const N = [];
1124
+ return k ? N.push(g) : r && N.push(w), N.length > 0 ? N.join(" ") : void 0;
1125
+ }, [k, r, g, w]);
1126
+ return /* @__PURE__ */ e.jsxs("div", { className: x("w-full", o), children: [
1116
1127
  t && /* @__PURE__ */ e.jsxs(
1117
1128
  "label",
1118
1129
  {
1119
- htmlFor: h,
1130
+ htmlFor: b,
1120
1131
  className: "block text-sm font-medium text-foreground mb-2",
1121
1132
  children: [
1122
1133
  t,
1123
- c && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
1134
+ l && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
1124
1135
  ]
1125
1136
  }
1126
1137
  ),
@@ -1129,23 +1140,23 @@ const ee = b.forwardRef(
1129
1140
  "select",
1130
1141
  {
1131
1142
  ref: f,
1132
- id: h,
1133
- required: c,
1134
- disabled: n || o,
1135
- "aria-invalid": j,
1136
- "aria-describedby": v,
1137
- "aria-errormessage": j ? g : void 0,
1143
+ id: b,
1144
+ required: l,
1145
+ disabled: s || i,
1146
+ "aria-invalid": k,
1147
+ "aria-describedby": j,
1148
+ "aria-errormessage": k ? g : void 0,
1138
1149
  onChange: u,
1139
1150
  className: x(
1140
1151
  Le({
1141
- state: j ? "error" : o ? "readOnly" : "default"
1152
+ state: k ? "error" : i ? "readOnly" : "default"
1142
1153
  }),
1143
1154
  "h-9 pl-3"
1144
1155
  ),
1145
1156
  ...p,
1146
1157
  children: [
1147
- i && /* @__PURE__ */ e.jsx("option", { value: "", disabled: !0, hidden: !0, children: i }),
1148
- l
1158
+ c && /* @__PURE__ */ e.jsx("option", { value: "", disabled: !0, hidden: !0, children: c }),
1159
+ a
1149
1160
  ]
1150
1161
  }
1151
1162
  ),
@@ -1155,21 +1166,21 @@ const ee = b.forwardRef(
1155
1166
  className: x(
1156
1167
  "absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-transform duration-200"
1157
1168
  ),
1158
- children: /* @__PURE__ */ e.jsx(P, { as: de, size: "sm", color: "gray", "aria-hidden": "true" })
1169
+ children: /* @__PURE__ */ e.jsx($, { as: de, size: "sm", color: "gray", "aria-hidden": "true" })
1159
1170
  }
1160
1171
  )
1161
1172
  ] }),
1162
- j && /* @__PURE__ */ e.jsx(
1173
+ k && /* @__PURE__ */ e.jsx(
1163
1174
  "div",
1164
1175
  {
1165
1176
  id: g,
1166
1177
  className: "mt-1 text-sm text-danger",
1167
1178
  role: "alert",
1168
1179
  "aria-live": "polite",
1169
- children: a
1180
+ children: n
1170
1181
  }
1171
1182
  ),
1172
- !j && r && /* @__PURE__ */ e.jsx("div", { id: y, className: "mt-1 text-sm text-gray-600", children: r })
1183
+ !k && r && /* @__PURE__ */ e.jsx("div", { id: w, className: "mt-1 text-sm text-gray-600", children: r })
1173
1184
  ] });
1174
1185
  }
1175
1186
  );
@@ -1177,7 +1188,7 @@ ee.displayName = "SelectInput";
1177
1188
  const gt = Object.assign(ee, {
1178
1189
  Option: Y,
1179
1190
  OptionGroup: Z
1180
- }), Te = N(
1191
+ }), Te = C(
1181
1192
  "flex gap-3 cursor-pointer border-b border-border select-none transition-colors",
1182
1193
  {
1183
1194
  variants: {
@@ -1206,7 +1217,7 @@ const gt = Object.assign(ee, {
1206
1217
  hideCheckbox: !1
1207
1218
  }
1208
1219
  }
1209
- ), qe = N(
1220
+ ), qe = C(
1210
1221
  "relative h-6 w-6 rounded border cursor-pointer transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 appearance-none bg-white border-primary/40 checked:bg-primary checked:border-primary focus:ring-primary/20",
1211
1222
  {
1212
1223
  variants: {
@@ -1224,65 +1235,65 @@ const gt = Object.assign(ee, {
1224
1235
  disabled: !1
1225
1236
  }
1226
1237
  }
1227
- ), Ge = z(
1238
+ ), Ge = O(
1228
1239
  ({
1229
1240
  value: t,
1230
1241
  children: r,
1231
- checked: a,
1232
- id: s,
1233
- className: n,
1234
- disabled: o,
1242
+ checked: n,
1243
+ id: o,
1244
+ className: s,
1245
+ disabled: i,
1235
1246
  checkboxPlacement: d = "center",
1236
- hideCheckbox: c = !1,
1237
- ...i
1238
- }, l) => {
1239
- const u = B(), p = s || u, f = typeof r == "function" ? r(a) : r;
1247
+ hideCheckbox: l = !1,
1248
+ ...c
1249
+ }, a) => {
1250
+ const u = B(), p = o || u, f = typeof r == "function" ? r(n) : r;
1240
1251
  return /* @__PURE__ */ e.jsxs(
1241
1252
  "label",
1242
1253
  {
1243
1254
  htmlFor: p,
1244
1255
  className: x(
1245
1256
  Te({
1246
- checked: !!a,
1247
- disabled: !!o,
1257
+ checked: !!n,
1258
+ disabled: !!i,
1248
1259
  checkboxPlacement: d,
1249
- hideCheckbox: c
1260
+ hideCheckbox: l
1250
1261
  }),
1251
- n
1262
+ s
1252
1263
  ),
1253
- "aria-checked": a,
1264
+ "aria-checked": n,
1254
1265
  role: "radio",
1255
1266
  "aria-label": `Select ${t}`,
1256
- tabIndex: o ? -1 : 0,
1267
+ tabIndex: i ? -1 : 0,
1257
1268
  children: [
1258
1269
  /* @__PURE__ */ e.jsx(
1259
1270
  "input",
1260
1271
  {
1261
- ref: l,
1272
+ ref: a,
1262
1273
  id: p,
1263
1274
  type: "radio",
1264
1275
  value: t,
1265
- checked: a,
1266
- disabled: o,
1276
+ checked: n,
1277
+ disabled: i,
1267
1278
  className: "sr-only",
1268
1279
  "aria-hidden": !0,
1269
- "aria-checked": a,
1270
- ...i
1280
+ "aria-checked": n,
1281
+ ...c
1271
1282
  }
1272
1283
  ),
1273
- !c && /* @__PURE__ */ e.jsx(
1284
+ !l && /* @__PURE__ */ e.jsx(
1274
1285
  "span",
1275
1286
  {
1276
1287
  className: x(
1277
1288
  qe({
1278
- checked: !!a,
1279
- disabled: !!o
1289
+ checked: !!n,
1290
+ disabled: !!i
1280
1291
  }),
1281
1292
  // Custom checkmark styling using ::after - centered positioning
1282
1293
  'after:content-[""] after:absolute after:left-1/2 after:top-[45%] after:-translate-x-1/2 after:-translate-y-1/2 after:border-b-2 after:border-r-2 after:border-white after:rotate-45 after:opacity-0 after:transition-opacity after:duration-200',
1283
1294
  // Checkmark dimensions scaled up for h-6 w-6 size
1284
1295
  "after:w-[6px] after:h-[12px]",
1285
- a && "after:opacity-100"
1296
+ n && "after:opacity-100"
1286
1297
  ),
1287
1298
  "aria-hidden": "true"
1288
1299
  }
@@ -1294,7 +1305,7 @@ const gt = Object.assign(ee, {
1294
1305
  }
1295
1306
  );
1296
1307
  Ge.displayName = "SelectableSingleInput";
1297
- const Ke = N(
1308
+ const Ke = C(
1298
1309
  "flex gap-3 cursor-pointer border-b border-border select-none transition-colors",
1299
1310
  {
1300
1311
  variants: {
@@ -1323,7 +1334,7 @@ const Ke = N(
1323
1334
  hideCheckbox: !1
1324
1335
  }
1325
1336
  }
1326
- ), _e = N(
1337
+ ), _e = C(
1327
1338
  "relative h-6 w-6 rounded border cursor-pointer transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 appearance-none bg-white border-primary/40 checked:bg-primary checked:border-primary focus:ring-primary/20",
1328
1339
  {
1329
1340
  variants: {
@@ -1341,65 +1352,65 @@ const Ke = N(
1341
1352
  disabled: !1
1342
1353
  }
1343
1354
  }
1344
- ), He = z(
1355
+ ), He = O(
1345
1356
  ({
1346
1357
  value: t,
1347
1358
  children: r,
1348
- checked: a,
1349
- id: s,
1350
- className: n,
1351
- disabled: o,
1359
+ checked: n,
1360
+ id: o,
1361
+ className: s,
1362
+ disabled: i,
1352
1363
  checkboxPlacement: d = "center",
1353
- hideCheckbox: c = !1,
1354
- ...i
1355
- }, l) => {
1356
- const u = B(), p = s || u, f = typeof r == "function" ? r(a) : r;
1364
+ hideCheckbox: l = !1,
1365
+ ...c
1366
+ }, a) => {
1367
+ const u = B(), p = o || u, f = typeof r == "function" ? r(n) : r;
1357
1368
  return /* @__PURE__ */ e.jsxs(
1358
1369
  "label",
1359
1370
  {
1360
1371
  htmlFor: p,
1361
1372
  className: x(
1362
1373
  Ke({
1363
- checked: !!a,
1364
- disabled: !!o,
1374
+ checked: !!n,
1375
+ disabled: !!i,
1365
1376
  checkboxPlacement: d,
1366
- hideCheckbox: c
1377
+ hideCheckbox: l
1367
1378
  }),
1368
- n
1379
+ s
1369
1380
  ),
1370
- "aria-checked": a,
1381
+ "aria-checked": n,
1371
1382
  role: "checkbox",
1372
1383
  "aria-label": `Select ${t}`,
1373
- tabIndex: o ? -1 : 0,
1384
+ tabIndex: i ? -1 : 0,
1374
1385
  children: [
1375
1386
  /* @__PURE__ */ e.jsx(
1376
1387
  "input",
1377
1388
  {
1378
- ref: l,
1389
+ ref: a,
1379
1390
  id: p,
1380
1391
  type: "checkbox",
1381
1392
  value: t,
1382
- checked: a,
1383
- disabled: o,
1393
+ checked: n,
1394
+ disabled: i,
1384
1395
  className: "sr-only",
1385
1396
  "aria-hidden": !0,
1386
- "aria-checked": a,
1387
- ...i
1397
+ "aria-checked": n,
1398
+ ...c
1388
1399
  }
1389
1400
  ),
1390
- !c && /* @__PURE__ */ e.jsx(
1401
+ !l && /* @__PURE__ */ e.jsx(
1391
1402
  "span",
1392
1403
  {
1393
1404
  className: x(
1394
1405
  _e({
1395
- checked: !!a,
1396
- disabled: !!o
1406
+ checked: !!n,
1407
+ disabled: !!i
1397
1408
  }),
1398
1409
  // Custom checkmark styling using ::after - centered positioning
1399
1410
  'after:content-[""] after:absolute after:left-1/2 after:top-[45%] after:-translate-x-1/2 after:-translate-y-1/2 after:border-b-2 after:border-r-2 after:border-white after:rotate-45 after:opacity-0 after:transition-opacity after:duration-200',
1400
1411
  // Checkmark dimensions scaled up for h-6 w-6 size
1401
1412
  "after:w-[6px] after:h-[12px]",
1402
- a && "after:opacity-100"
1413
+ n && "after:opacity-100"
1403
1414
  ),
1404
1415
  "aria-hidden": "true"
1405
1416
  }
@@ -1411,7 +1422,7 @@ const Ke = N(
1411
1422
  }
1412
1423
  );
1413
1424
  He.displayName = "SelectableMultipleInput";
1414
- const Je = N(
1425
+ const Je = C(
1415
1426
  "relative inline-flex items-center h-5 w-10 rounded-full transition-colors duration-200 border border-transparent",
1416
1427
  {
1417
1428
  variants: {
@@ -1429,7 +1440,7 @@ const Je = N(
1429
1440
  checked: !1
1430
1441
  }
1431
1442
  }
1432
- ), Qe = N(
1443
+ ), Qe = C(
1433
1444
  "absolute h-4 w-4 rounded-full transition-transform duration-200",
1434
1445
  {
1435
1446
  variants: {
@@ -1442,80 +1453,80 @@ const Je = N(
1442
1453
  checked: !1
1443
1454
  }
1444
1455
  }
1445
- ), Ue = ({ disabled: t = !1, checked: r = !1, className: a }) => /* @__PURE__ */ e.jsx(
1456
+ ), Ue = ({ disabled: t = !1, checked: r = !1, className: n }) => /* @__PURE__ */ e.jsx(
1446
1457
  "span",
1447
1458
  {
1448
1459
  className: x(
1449
1460
  Je({ disabled: t, checked: r }),
1450
1461
  "pointer-events-none",
1451
- a
1462
+ n
1452
1463
  ),
1453
1464
  "aria-hidden": "true"
1454
1465
  }
1455
- ), Xe = ({ checked: t = !1 }) => /* @__PURE__ */ e.jsx("span", { className: x(Qe({ checked: t })), "aria-hidden": "true" }), Ye = ({ label: t, htmlFor: r, disabled: a = !1, required: s = !1 }) => t ? /* @__PURE__ */ e.jsxs(
1466
+ ), Xe = ({ checked: t = !1 }) => /* @__PURE__ */ e.jsx("span", { className: x(Qe({ checked: t })), "aria-hidden": "true" }), Ye = ({ label: t, htmlFor: r, disabled: n = !1, required: o = !1 }) => t ? /* @__PURE__ */ e.jsxs(
1456
1467
  "label",
1457
1468
  {
1458
1469
  htmlFor: r,
1459
1470
  className: x(
1460
1471
  "text-sm select-none font-medium text-foreground",
1461
- a && "opacity-50 cursor-not-allowed"
1472
+ n && "opacity-50 cursor-not-allowed"
1462
1473
  ),
1463
1474
  children: [
1464
1475
  t,
1465
- s && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
1476
+ o && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
1466
1477
  ]
1467
1478
  }
1468
- ) : null, Ze = b.forwardRef(
1479
+ ) : null, Ze = m.forwardRef(
1469
1480
  ({
1470
1481
  value: t,
1471
1482
  onChange: r,
1472
- label: a,
1473
- disabled: s = !1,
1474
- required: n = !1,
1475
- className: o,
1483
+ label: n,
1484
+ disabled: o = !1,
1485
+ required: s = !1,
1486
+ className: i,
1476
1487
  id: d,
1477
- ariaLabel: c,
1478
- ...i
1479
- }, l) => {
1480
- const u = b.useId(), p = d || u, f = t ?? !1, m = (h) => {
1481
- r?.(h.target.checked);
1488
+ ariaLabel: l,
1489
+ ...c
1490
+ }, a) => {
1491
+ const u = m.useId(), p = d || u, f = t ?? !1, h = (b) => {
1492
+ r?.(b.target.checked);
1482
1493
  };
1483
- return /* @__PURE__ */ e.jsxs("div", { className: x("inline-flex items-center gap-2", o), children: [
1494
+ return /* @__PURE__ */ e.jsxs("div", { className: x("inline-flex items-center gap-2", i), children: [
1484
1495
  /* @__PURE__ */ e.jsxs("span", { className: "relative inline-flex items-center", children: [
1485
1496
  /* @__PURE__ */ e.jsx(
1486
1497
  "input",
1487
1498
  {
1488
- ref: l,
1499
+ ref: a,
1489
1500
  type: "checkbox",
1490
1501
  role: "switch",
1491
1502
  id: p,
1492
- "aria-label": c || a,
1503
+ "aria-label": l || n,
1493
1504
  "aria-checked": f,
1494
1505
  checked: f,
1495
- disabled: s,
1496
- required: n,
1497
- onChange: m,
1506
+ disabled: o,
1507
+ required: s,
1508
+ onChange: h,
1498
1509
  className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10 disabled:cursor-not-allowed",
1499
- ...i
1510
+ ...c
1500
1511
  }
1501
1512
  ),
1502
- /* @__PURE__ */ e.jsx(Ue, { disabled: s, checked: f }),
1513
+ /* @__PURE__ */ e.jsx(Ue, { disabled: o, checked: f }),
1503
1514
  /* @__PURE__ */ e.jsx(Xe, { checked: f })
1504
1515
  ] }),
1505
1516
  /* @__PURE__ */ e.jsx(
1506
1517
  Ye,
1507
1518
  {
1508
- label: a,
1519
+ label: n,
1509
1520
  htmlFor: p,
1510
- disabled: s,
1511
- required: n
1521
+ disabled: o,
1522
+ required: s
1512
1523
  }
1513
1524
  )
1514
1525
  ] });
1515
1526
  }
1516
1527
  );
1517
1528
  Ze.displayName = "SwitchInput";
1518
- const et = N(
1529
+ const et = C(
1519
1530
  "block w-full rounded-md border bg-white text-foreground transition-colors focus:outline-none overflow-y-auto whitespace-pre-wrap break-words",
1520
1531
  {
1521
1532
  variants: {
@@ -1530,119 +1541,119 @@ const et = N(
1530
1541
  state: "default"
1531
1542
  }
1532
1543
  }
1533
- ), tt = (t, r, a) => t ? "disabled" : r ? "readOnly" : a ? "error" : "default", rt = (t, r, a) => {
1534
- if (r || a) {
1544
+ ), tt = (t, r, n) => t ? "disabled" : r ? "readOnly" : n ? "error" : "default", rt = (t, r, n) => {
1545
+ if (r || n) {
1535
1546
  t.preventDefault();
1536
1547
  return;
1537
1548
  }
1538
1549
  t.preventDefault();
1539
- const s = t.clipboardData.getData("text/plain"), n = window.getSelection();
1540
- if (!n || !n.rangeCount) return;
1541
- n.deleteFromDocument();
1542
- const o = n.getRangeAt(0), d = document.createTextNode(s);
1543
- o.insertNode(d), o.setStartAfter(d), o.setEndAfter(d), n.removeAllRanges(), n.addRange(o);
1544
- const c = new Event("input", { bubbles: !0 });
1545
- t.currentTarget.dispatchEvent(c);
1546
- }, at = b.forwardRef(
1550
+ const o = t.clipboardData.getData("text/plain"), s = window.getSelection();
1551
+ if (!s || !s.rangeCount) return;
1552
+ s.deleteFromDocument();
1553
+ const i = s.getRangeAt(0), d = document.createTextNode(o);
1554
+ i.insertNode(d), i.setStartAfter(d), i.setEndAfter(d), s.removeAllRanges(), s.addRange(i);
1555
+ const l = new Event("input", { bubbles: !0 });
1556
+ t.currentTarget.dispatchEvent(l);
1557
+ }, nt = m.forwardRef(
1547
1558
  ({
1548
1559
  label: t,
1549
1560
  helperText: r,
1550
- error: a,
1551
- className: s,
1552
- disabled: n,
1553
- readOnly: o,
1561
+ error: n,
1562
+ className: o,
1563
+ disabled: s,
1564
+ readOnly: i,
1554
1565
  id: d,
1555
- value: c,
1556
- defaultValue: i,
1557
- onChange: l,
1566
+ value: l,
1567
+ defaultValue: c,
1568
+ onChange: a,
1558
1569
  placeholder: u,
1559
1570
  name: p,
1560
1571
  row: f = 3,
1561
- required: m,
1562
- onBlur: h,
1563
- onFocus: y,
1572
+ required: h,
1573
+ onBlur: b,
1574
+ onFocus: w,
1564
1575
  onKeyDown: g,
1565
- ...j
1566
- }, v) => {
1567
- const V = b.useId(), R = d || V, C = !!a, D = b.useRef(null), [M, A] = b.useState(i || ""), k = c !== void 0, w = k ? c : M;
1568
- b.useImperativeHandle(v, () => D.current), b.useEffect(() => {
1569
- D.current && D.current.textContent !== w && (D.current.textContent = w);
1570
- }, [w]);
1571
- const I = tt(n, o, C), S = !w && u, te = (O) => {
1572
- const L = O.currentTarget.textContent || "";
1573
- k || A(L), l?.(L);
1574
- }, re = (O) => {
1575
- if (n || o) {
1576
- O.preventDefault();
1576
+ ...k
1577
+ }, j) => {
1578
+ const N = m.useId(), V = d || N, R = !!n, S = m.useRef(null), [E, z] = m.useState(c || ""), v = l !== void 0, y = v ? l : E;
1579
+ m.useImperativeHandle(j, () => S.current), m.useEffect(() => {
1580
+ S.current && S.current.textContent !== y && (S.current.textContent = y);
1581
+ }, [y]);
1582
+ const I = tt(s, i, R), D = !y && u, te = (P) => {
1583
+ const L = P.currentTarget.textContent || "";
1584
+ v || z(L), a?.(L);
1585
+ }, re = (P) => {
1586
+ if (s || i) {
1587
+ P.preventDefault();
1577
1588
  return;
1578
1589
  }
1579
- g?.(O);
1580
- }, ae = () => {
1581
- D.current?.focus();
1590
+ g?.(P);
1591
+ }, ne = () => {
1592
+ S.current?.focus();
1582
1593
  };
1583
1594
  return /* @__PURE__ */ e.jsxs("div", { children: [
1584
1595
  t && /* @__PURE__ */ e.jsxs(
1585
1596
  "label",
1586
1597
  {
1587
- htmlFor: R,
1598
+ htmlFor: V,
1588
1599
  className: "block text-sm font-medium text-foreground mb-2 cursor-pointer",
1589
- onClick: ae,
1600
+ onClick: ne,
1590
1601
  children: [
1591
1602
  t,
1592
- m && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
1603
+ h && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
1593
1604
  ]
1594
1605
  }
1595
1606
  ),
1596
- /* @__PURE__ */ e.jsx("div", { className: x("relative w-full", s), children: /* @__PURE__ */ e.jsx(
1607
+ /* @__PURE__ */ e.jsx("div", { className: x("relative w-full", o), children: /* @__PURE__ */ e.jsx(
1597
1608
  "div",
1598
1609
  {
1599
- ref: D,
1600
- id: R,
1610
+ ref: S,
1611
+ id: V,
1601
1612
  role: "textbox",
1602
1613
  "aria-multiline": "true",
1603
- "aria-invalid": C,
1604
- "aria-disabled": n,
1605
- "aria-readonly": o,
1606
- "aria-required": m,
1614
+ "aria-invalid": R,
1615
+ "aria-disabled": s,
1616
+ "aria-readonly": i,
1617
+ "aria-required": h,
1607
1618
  "aria-label": typeof t == "string" ? t : void 0,
1608
- contentEditable: !n && !o,
1619
+ contentEditable: !s && !i,
1609
1620
  "data-name": p,
1610
1621
  onInput: te,
1611
1622
  onKeyDown: re,
1612
- onPaste: (O) => rt(O, n, o),
1613
- onBlur: h,
1614
- onFocus: y,
1623
+ onPaste: (P) => rt(P, s, i),
1624
+ onBlur: b,
1625
+ onFocus: w,
1615
1626
  suppressContentEditableWarning: !0,
1616
1627
  style: { minHeight: `${f * 1.5 + 1}rem` },
1617
1628
  className: x(
1618
1629
  et({ state: I }),
1619
1630
  "px-3 py-2",
1620
- S && "empty:before:content-[attr(data-placeholder)] empty:before:text-gray-400"
1631
+ D && "empty:before:content-[attr(data-placeholder)] empty:before:text-gray-400"
1621
1632
  ),
1622
1633
  "data-placeholder": u,
1623
- ...j
1634
+ ...k
1624
1635
  }
1625
1636
  ) }),
1626
- C && /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-sm text-danger", role: "alert", children: a }),
1627
- !C && r && /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-sm text-gray-600", children: r })
1637
+ R && /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-sm text-danger", role: "alert", children: n }),
1638
+ !R && r && /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-sm text-gray-600", children: r })
1628
1639
  ] });
1629
1640
  }
1630
1641
  );
1631
- at.displayName = "TextAreaInput";
1632
- const xt = z(function(r, a) {
1633
- const s = (n) => {
1634
- r?.onChange?.(n.target.value);
1642
+ nt.displayName = "TextAreaInput";
1643
+ const xt = O(function(r, n) {
1644
+ const o = (s) => {
1645
+ r?.onChange?.(s.target.value);
1635
1646
  };
1636
1647
  return /* @__PURE__ */ e.jsx(
1637
- $,
1648
+ M,
1638
1649
  {
1639
1650
  type: "time",
1640
1651
  tabIndex: 0,
1641
1652
  "aria-hidden": "true",
1642
- leftContent: /* @__PURE__ */ e.jsx(P, { as: ue, color: "inherit", size: "sm" }),
1643
- ref: a,
1653
+ leftContent: /* @__PURE__ */ e.jsx($, { as: ue, color: "inherit", size: "sm" }),
1654
+ ref: n,
1644
1655
  ...r,
1645
- onChange: s
1656
+ onChange: o
1646
1657
  }
1647
1658
  );
1648
1659
  });
@@ -1653,7 +1664,7 @@ export {
1653
1664
  De as P,
1654
1665
  ht as R,
1655
1666
  bt as S,
1656
- $ as T,
1667
+ M as T,
1657
1668
  dt as a,
1658
1669
  ut as b,
1659
1670
  mt as c,
@@ -1662,6 +1673,6 @@ export {
1662
1673
  He as f,
1663
1674
  Ze as g,
1664
1675
  J as h,
1665
- at as i,
1676
+ nt as i,
1666
1677
  xt as j
1667
1678
  };