@dimasbaguspm/versaur 0.0.55 → 0.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/forms/index.js +1 -1
- package/dist/js/index.js +3 -3
- package/dist/js/layouts/index.js +1 -1
- package/dist/js/navigation/index.js +1 -1
- package/dist/js/{tabs-I4n6MLAv.js → tabs-CmfJNCe6.js} +55 -47
- package/dist/js/{time-picker-input-CYBfc7s_.js → time-picker-input-BgbyllDK.js} +315 -325
- package/dist/js/{top-bar-Dqje-W3G.js → top-bar-Do2JqSqe.js} +133 -112
- package/dist/types/forms/text-input-as-button/types.d.ts +3 -2
- package/dist/types/layouts/badge-group/types.d.ts +5 -0
- package/dist/types/layouts/button-group/types.d.ts +5 -0
- package/dist/types/layouts/filter-chip-group/types.d.ts +5 -0
- package/dist/types/navigation/tabs/types.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as C, j as e, a as x } from "./index-DOdDlCoL.js";
|
|
2
|
-
import m, { createContext as F, useContext as
|
|
2
|
+
import m, { createContext as F, useContext as B, useId as A, forwardRef as O, useRef as T, useEffect as ne, useState as se } from "react";
|
|
3
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";
|
|
@@ -29,19 +29,19 @@ const fe = C("space-y-2", {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
), q = F(null), he = () => {
|
|
32
|
-
const t =
|
|
32
|
+
const t = B(q);
|
|
33
33
|
if (!t)
|
|
34
34
|
throw new Error("CheckboxOption must be used within CheckboxInput");
|
|
35
35
|
return t;
|
|
36
|
-
}, G = m.forwardRef(({ children: t, description: r, className:
|
|
37
|
-
const l = he(), c = m.useId(),
|
|
36
|
+
}, G = m.forwardRef(({ children: t, description: r, className: a, disabled: s, id: n, ...o }, d) => {
|
|
37
|
+
const l = he(), c = m.useId(), i = n || c, u = s || 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:
|
|
44
|
+
id: i,
|
|
45
45
|
disabled: u,
|
|
46
46
|
className: x(
|
|
47
47
|
pe(),
|
|
@@ -50,16 +50,16 @@ const fe = C("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
|
-
|
|
53
|
+
a
|
|
54
54
|
),
|
|
55
|
-
...
|
|
55
|
+
...o
|
|
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:
|
|
62
|
+
htmlFor: i,
|
|
63
63
|
className: me({
|
|
64
64
|
disabled: u
|
|
65
65
|
}),
|
|
@@ -84,31 +84,31 @@ const K = m.forwardRef(
|
|
|
84
84
|
({
|
|
85
85
|
label: t,
|
|
86
86
|
helperText: r,
|
|
87
|
-
error:
|
|
88
|
-
direction:
|
|
89
|
-
className:
|
|
90
|
-
disabled:
|
|
87
|
+
error: a,
|
|
88
|
+
direction: s = "vertical",
|
|
89
|
+
className: n,
|
|
90
|
+
disabled: o,
|
|
91
91
|
required: d,
|
|
92
92
|
children: l,
|
|
93
93
|
...c
|
|
94
|
-
},
|
|
95
|
-
const u = !!
|
|
96
|
-
disabled:
|
|
94
|
+
}, i) => {
|
|
95
|
+
const u = !!a, p = {
|
|
96
|
+
disabled: o
|
|
97
97
|
};
|
|
98
98
|
return /* @__PURE__ */ e.jsx(q.Provider, { value: p, children: /* @__PURE__ */ e.jsxs(
|
|
99
99
|
"fieldset",
|
|
100
100
|
{
|
|
101
|
-
ref:
|
|
102
|
-
disabled:
|
|
103
|
-
className: x("w-full border-0 p-0 m-0",
|
|
101
|
+
ref: i,
|
|
102
|
+
disabled: o,
|
|
103
|
+
className: x("w-full border-0 p-0 m-0", n),
|
|
104
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:
|
|
111
|
-
u && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children:
|
|
110
|
+
/* @__PURE__ */ e.jsx("div", { className: fe({ direction: s }), children: l }),
|
|
111
|
+
u && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: a }),
|
|
112
112
|
!u && r && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-gray-600", children: r })
|
|
113
113
|
]
|
|
114
114
|
}
|
|
@@ -119,7 +119,7 @@ K.displayName = "CheckboxInput";
|
|
|
119
119
|
const lt = Object.assign(K, {
|
|
120
120
|
Option: G
|
|
121
121
|
}), _ = F(null), be = () => {
|
|
122
|
-
const t =
|
|
122
|
+
const t = B(_);
|
|
123
123
|
if (!t)
|
|
124
124
|
throw new Error(
|
|
125
125
|
"useChipSingleInputContext must be used within ChipSingleInputContext"
|
|
@@ -139,9 +139,9 @@ const lt = Object.assign(K, {
|
|
|
139
139
|
size: "md"
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
), xe = m.forwardRef(({ children: t, className: r, disabled:
|
|
143
|
-
const { size: l = "md", maxWidth: c, ...
|
|
144
|
-
!f && !h &&
|
|
142
|
+
), xe = m.forwardRef(({ children: t, className: r, disabled: a, id: s, value: n, ...o }, d) => {
|
|
143
|
+
const { size: l = "md", maxWidth: c, ...i } = be(), u = A(), p = s || u, f = a || i.disabled, h = i.readOnly, b = i.value === n, w = (g) => {
|
|
144
|
+
!f && !h && i.onChange?.(n), o.onChange?.(g);
|
|
145
145
|
};
|
|
146
146
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
147
147
|
/* @__PURE__ */ e.jsx(
|
|
@@ -150,14 +150,14 @@ const lt = Object.assign(K, {
|
|
|
150
150
|
ref: d,
|
|
151
151
|
type: "radio",
|
|
152
152
|
id: p,
|
|
153
|
-
name:
|
|
154
|
-
value:
|
|
153
|
+
name: i.name,
|
|
154
|
+
value: n,
|
|
155
155
|
checked: b,
|
|
156
156
|
disabled: f,
|
|
157
157
|
readOnly: h,
|
|
158
158
|
onChange: w,
|
|
159
159
|
className: "sr-only",
|
|
160
|
-
...
|
|
160
|
+
...o
|
|
161
161
|
}
|
|
162
162
|
),
|
|
163
163
|
/* @__PURE__ */ e.jsx(
|
|
@@ -192,25 +192,25 @@ const lt = Object.assign(K, {
|
|
|
192
192
|
({
|
|
193
193
|
size: t = "md",
|
|
194
194
|
label: r,
|
|
195
|
-
required:
|
|
196
|
-
helperText:
|
|
197
|
-
error:
|
|
198
|
-
className:
|
|
195
|
+
required: a,
|
|
196
|
+
helperText: s,
|
|
197
|
+
error: n,
|
|
198
|
+
className: o,
|
|
199
199
|
disabled: d,
|
|
200
200
|
readOnly: l,
|
|
201
201
|
maxWidth: c,
|
|
202
|
-
name:
|
|
202
|
+
name: i,
|
|
203
203
|
value: u,
|
|
204
204
|
onChange: p,
|
|
205
205
|
children: f,
|
|
206
206
|
...h
|
|
207
207
|
}, b) => {
|
|
208
|
-
const w = !!
|
|
208
|
+
const w = !!n, g = {
|
|
209
209
|
size: t,
|
|
210
210
|
disabled: d,
|
|
211
211
|
readOnly: l,
|
|
212
212
|
error: w,
|
|
213
|
-
name:
|
|
213
|
+
name: i,
|
|
214
214
|
value: u,
|
|
215
215
|
maxWidth: c,
|
|
216
216
|
onChange: p
|
|
@@ -219,17 +219,17 @@ const lt = Object.assign(K, {
|
|
|
219
219
|
"fieldset",
|
|
220
220
|
{
|
|
221
221
|
ref: b,
|
|
222
|
-
className: x("w-full border-0 p-0 m-0",
|
|
222
|
+
className: x("w-full border-0 p-0 m-0", o),
|
|
223
223
|
disabled: d,
|
|
224
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
|
-
|
|
228
|
+
a && /* @__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
|
-
w && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children:
|
|
232
|
-
!w &&
|
|
231
|
+
w && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
|
|
232
|
+
!w && s && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
|
|
233
233
|
]
|
|
234
234
|
}
|
|
235
235
|
) });
|
|
@@ -237,13 +237,13 @@ const lt = Object.assign(K, {
|
|
|
237
237
|
), dt = Object.assign(ye, {
|
|
238
238
|
Option: xe
|
|
239
239
|
}), H = F(null), we = () => {
|
|
240
|
-
const t =
|
|
240
|
+
const t = B(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
|
-
},
|
|
246
|
+
}, ve = 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
|
-
),
|
|
261
|
-
const { size: l = "md", maxWidth: c, ...
|
|
260
|
+
), je = m.forwardRef(({ children: t, className: r, disabled: a, id: s, value: n, ...o }, d) => {
|
|
261
|
+
const { size: l = "md", maxWidth: c, ...i } = we(), u = A(), p = s || u, f = a || i.disabled, h = i.readOnly, b = i.value?.includes(n) ?? !1, w = (g) => {
|
|
262
262
|
if (!f && !h) {
|
|
263
|
-
const k =
|
|
264
|
-
let
|
|
265
|
-
b ?
|
|
263
|
+
const k = i.value || [];
|
|
264
|
+
let v;
|
|
265
|
+
b ? v = k.filter((N) => N !== n) : v = [...k, n], i.onChange?.(v);
|
|
266
266
|
}
|
|
267
|
-
|
|
267
|
+
o.onChange?.(g);
|
|
268
268
|
};
|
|
269
269
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
270
270
|
/* @__PURE__ */ e.jsx(
|
|
@@ -273,14 +273,14 @@ const lt = Object.assign(K, {
|
|
|
273
273
|
ref: d,
|
|
274
274
|
type: "checkbox",
|
|
275
275
|
id: p,
|
|
276
|
-
name: `${
|
|
277
|
-
value:
|
|
276
|
+
name: `${i.name}[]`,
|
|
277
|
+
value: n,
|
|
278
278
|
checked: b,
|
|
279
279
|
disabled: f,
|
|
280
280
|
readOnly: h,
|
|
281
281
|
onChange: w,
|
|
282
282
|
className: "sr-only",
|
|
283
|
-
...
|
|
283
|
+
...o
|
|
284
284
|
}
|
|
285
285
|
),
|
|
286
286
|
/* @__PURE__ */ e.jsx(
|
|
@@ -290,7 +290,7 @@ const lt = Object.assign(K, {
|
|
|
290
290
|
"data-selected": b,
|
|
291
291
|
style: c ? { maxWidth: c } : void 0,
|
|
292
292
|
className: x(
|
|
293
|
-
|
|
293
|
+
ve({
|
|
294
294
|
size: l
|
|
295
295
|
}),
|
|
296
296
|
f && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
@@ -315,25 +315,25 @@ const lt = Object.assign(K, {
|
|
|
315
315
|
({
|
|
316
316
|
size: t = "md",
|
|
317
317
|
label: r,
|
|
318
|
-
required:
|
|
319
|
-
helperText:
|
|
320
|
-
error:
|
|
321
|
-
className:
|
|
318
|
+
required: a,
|
|
319
|
+
helperText: s,
|
|
320
|
+
error: n,
|
|
321
|
+
className: o,
|
|
322
322
|
disabled: d,
|
|
323
323
|
readOnly: l,
|
|
324
324
|
maxWidth: c,
|
|
325
|
-
name:
|
|
325
|
+
name: i,
|
|
326
326
|
value: u = [],
|
|
327
327
|
onChange: p,
|
|
328
328
|
children: f,
|
|
329
329
|
...h
|
|
330
330
|
}, b) => {
|
|
331
|
-
const w = !!
|
|
331
|
+
const w = !!n, g = {
|
|
332
332
|
size: t,
|
|
333
333
|
disabled: d,
|
|
334
334
|
readOnly: l,
|
|
335
335
|
error: w,
|
|
336
|
-
name:
|
|
336
|
+
name: i,
|
|
337
337
|
value: u,
|
|
338
338
|
maxWidth: c,
|
|
339
339
|
onChange: p
|
|
@@ -342,23 +342,23 @@ const lt = Object.assign(K, {
|
|
|
342
342
|
"fieldset",
|
|
343
343
|
{
|
|
344
344
|
ref: b,
|
|
345
|
-
className: x("w-full border-0 p-0 m-0",
|
|
345
|
+
className: x("w-full border-0 p-0 m-0", o),
|
|
346
346
|
disabled: d,
|
|
347
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
|
-
|
|
351
|
+
a && /* @__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
|
-
w && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children:
|
|
355
|
-
!w &&
|
|
354
|
+
w && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
|
|
355
|
+
!w && s && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
|
|
356
356
|
]
|
|
357
357
|
}
|
|
358
358
|
) });
|
|
359
359
|
}
|
|
360
360
|
), ut = Object.assign(ke, {
|
|
361
|
-
Option:
|
|
361
|
+
Option: je
|
|
362
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
|
{
|
|
@@ -377,34 +377,24 @@ const lt = Object.assign(K, {
|
|
|
377
377
|
({
|
|
378
378
|
label: t,
|
|
379
379
|
leftContent: r,
|
|
380
|
-
rightContent:
|
|
381
|
-
helperText:
|
|
382
|
-
error:
|
|
383
|
-
className:
|
|
380
|
+
rightContent: a,
|
|
381
|
+
helperText: s,
|
|
382
|
+
error: n,
|
|
383
|
+
className: o,
|
|
384
384
|
disabled: d,
|
|
385
385
|
id: l,
|
|
386
386
|
required: c,
|
|
387
|
-
value:
|
|
387
|
+
value: i,
|
|
388
388
|
displayValue: u,
|
|
389
389
|
placeholder: p = "",
|
|
390
390
|
name: f,
|
|
391
391
|
...h
|
|
392
392
|
}, b) => {
|
|
393
|
-
const w = m.useId(), g = l || w, k = `${g}-helper`,
|
|
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(() => {
|
|
393
|
+
const w = m.useId(), g = l || w, k = `${g}-helper`, v = `${g}-error`, N = !!n, V = m.useMemo(() => u && u !== "" ? u : p, [u, p]), R = m.useMemo(() => i == null ? "" : typeof i == "string" || typeof i == "number" || typeof i == "boolean" ? String(i) : Array.isArray(i) || typeof i == "object" ? JSON.stringify(i) : String(i), [i]), S = u !== void 0 && u !== "", E = m.useMemo(() => {
|
|
404
394
|
const z = [];
|
|
405
|
-
return N ? z.push(
|
|
406
|
-
}, [N,
|
|
407
|
-
return /* @__PURE__ */ e.jsxs("div", { className: x("w-full",
|
|
395
|
+
return N ? z.push(v) : s && z.push(k), z.length > 0 ? z.join(" ") : void 0;
|
|
396
|
+
}, [N, s, v, k]);
|
|
397
|
+
return /* @__PURE__ */ e.jsxs("div", { className: x("w-full", o), children: [
|
|
408
398
|
t && /* @__PURE__ */ e.jsxs(
|
|
409
399
|
"label",
|
|
410
400
|
{
|
|
@@ -435,14 +425,14 @@ const lt = Object.assign(K, {
|
|
|
435
425
|
disabled: d,
|
|
436
426
|
"aria-invalid": N || void 0,
|
|
437
427
|
"aria-describedby": E,
|
|
438
|
-
"aria-errormessage": N ?
|
|
428
|
+
"aria-errormessage": N ? v : void 0,
|
|
439
429
|
"aria-required": c || void 0,
|
|
440
430
|
className: x(
|
|
441
431
|
Ie({
|
|
442
432
|
state: N ? "error" : "default"
|
|
443
433
|
}),
|
|
444
434
|
r ? "pl-9" : "pl-3",
|
|
445
|
-
|
|
435
|
+
a ? "pr-9" : "pr-3",
|
|
446
436
|
"h-9",
|
|
447
437
|
!S && "text-gray-400"
|
|
448
438
|
),
|
|
@@ -450,13 +440,13 @@ const lt = Object.assign(K, {
|
|
|
450
440
|
children: V
|
|
451
441
|
}
|
|
452
442
|
),
|
|
453
|
-
|
|
443
|
+
a && /* @__PURE__ */ e.jsx(
|
|
454
444
|
"span",
|
|
455
445
|
{
|
|
456
446
|
className: "absolute right-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5 z-10",
|
|
457
447
|
"aria-hidden": "true",
|
|
458
448
|
"data-testid": "right-content",
|
|
459
|
-
children:
|
|
449
|
+
children: a
|
|
460
450
|
}
|
|
461
451
|
),
|
|
462
452
|
f && /* @__PURE__ */ e.jsx(
|
|
@@ -473,14 +463,14 @@ const lt = Object.assign(K, {
|
|
|
473
463
|
N && /* @__PURE__ */ e.jsx(
|
|
474
464
|
"div",
|
|
475
465
|
{
|
|
476
|
-
id:
|
|
466
|
+
id: v,
|
|
477
467
|
className: "mt-1 text-sm text-danger",
|
|
478
468
|
role: "alert",
|
|
479
469
|
"aria-live": "polite",
|
|
480
|
-
children:
|
|
470
|
+
children: n
|
|
481
471
|
}
|
|
482
472
|
),
|
|
483
|
-
!N &&
|
|
473
|
+
!N && s && /* @__PURE__ */ e.jsx("div", { id: k, className: "mt-1 text-sm text-gray-600", children: s })
|
|
484
474
|
] });
|
|
485
475
|
}
|
|
486
476
|
);
|
|
@@ -494,21 +484,22 @@ function Ne(t) {
|
|
|
494
484
|
day: "numeric"
|
|
495
485
|
});
|
|
496
486
|
}
|
|
497
|
-
const ft = m.forwardRef(function({ value: r = "", onChange:
|
|
498
|
-
const
|
|
499
|
-
|
|
487
|
+
const ft = m.forwardRef(function({ value: r = "", onChange: a, label: s, formatter: n, min: o, max: d, ...l }, c) {
|
|
488
|
+
const i = T(null), u = (b) => {
|
|
489
|
+
i.current = b, typeof c == "function" ? c(b) : c && typeof c == "object" && (c.current = b);
|
|
500
490
|
}, p = () => {
|
|
501
|
-
|
|
491
|
+
i.current && (typeof i.current.showPicker == "function" ? i.current.showPicker() : i.current.focus());
|
|
502
492
|
}, f = (b) => {
|
|
503
|
-
|
|
504
|
-
}, h = (
|
|
493
|
+
a(b.target.value);
|
|
494
|
+
}, h = (n ?? Ne)(r);
|
|
505
495
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
506
496
|
/* @__PURE__ */ e.jsx(
|
|
507
497
|
J,
|
|
508
498
|
{
|
|
509
499
|
onClick: p,
|
|
510
|
-
value:
|
|
511
|
-
|
|
500
|
+
value: r,
|
|
501
|
+
displayValue: h,
|
|
502
|
+
label: s,
|
|
512
503
|
leftContent: /* @__PURE__ */ e.jsx($, { as: oe, color: "inherit", size: "sm" }),
|
|
513
504
|
"data-testid": "date-single-picker-visible-input",
|
|
514
505
|
...l
|
|
@@ -521,11 +512,11 @@ const ft = m.forwardRef(function({ value: r = "", onChange: n, label: o, formatt
|
|
|
521
512
|
type: "date",
|
|
522
513
|
value: r,
|
|
523
514
|
onChange: f,
|
|
524
|
-
min:
|
|
515
|
+
min: o,
|
|
525
516
|
max: d,
|
|
526
517
|
className: "sr-only absolute opacity-0 h-0 w-0 pointer-events-none",
|
|
527
518
|
tabIndex: -1,
|
|
528
|
-
"aria-label": typeof
|
|
519
|
+
"aria-label": typeof s == "string" ? s : void 0
|
|
529
520
|
}
|
|
530
521
|
)
|
|
531
522
|
] });
|
|
@@ -547,21 +538,21 @@ const ft = m.forwardRef(function({ value: r = "", onChange: n, label: o, formatt
|
|
|
547
538
|
({
|
|
548
539
|
label: t,
|
|
549
540
|
leftContent: r,
|
|
550
|
-
rightContent:
|
|
551
|
-
helperText:
|
|
552
|
-
error:
|
|
553
|
-
className:
|
|
541
|
+
rightContent: a,
|
|
542
|
+
helperText: s,
|
|
543
|
+
error: n,
|
|
544
|
+
className: o,
|
|
554
545
|
disabled: d,
|
|
555
546
|
readOnly: l,
|
|
556
547
|
id: c,
|
|
557
|
-
required:
|
|
548
|
+
required: i,
|
|
558
549
|
...u
|
|
559
550
|
}, p) => {
|
|
560
|
-
const f = m.useId(), h = c || f, b = `${h}-helper`, w = `${h}-error`, g = !!
|
|
561
|
-
const
|
|
562
|
-
return g ?
|
|
563
|
-
}, [g,
|
|
564
|
-
return /* @__PURE__ */ e.jsxs("div", { className: x("w-full",
|
|
551
|
+
const f = m.useId(), h = c || f, b = `${h}-helper`, w = `${h}-error`, g = !!n, k = m.useMemo(() => {
|
|
552
|
+
const v = [];
|
|
553
|
+
return g ? v.push(w) : s && v.push(b), v.length > 0 ? v.join(" ") : void 0;
|
|
554
|
+
}, [g, s, w, b]);
|
|
555
|
+
return /* @__PURE__ */ e.jsxs("div", { className: x("w-full", o), children: [
|
|
565
556
|
t && /* @__PURE__ */ e.jsxs(
|
|
566
557
|
"label",
|
|
567
558
|
{
|
|
@@ -569,7 +560,7 @@ const ft = m.forwardRef(function({ value: r = "", onChange: n, label: o, formatt
|
|
|
569
560
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
570
561
|
children: [
|
|
571
562
|
t,
|
|
572
|
-
|
|
563
|
+
i && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
573
564
|
]
|
|
574
565
|
}
|
|
575
566
|
),
|
|
@@ -588,7 +579,7 @@ const ft = m.forwardRef(function({ value: r = "", onChange: n, label: o, formatt
|
|
|
588
579
|
{
|
|
589
580
|
ref: p,
|
|
590
581
|
id: h,
|
|
591
|
-
required:
|
|
582
|
+
required: i,
|
|
592
583
|
disabled: d,
|
|
593
584
|
readOnly: l,
|
|
594
585
|
"aria-invalid": g,
|
|
@@ -599,19 +590,19 @@ const ft = m.forwardRef(function({ value: r = "", onChange: n, label: o, formatt
|
|
|
599
590
|
state: g ? "error" : l ? "readOnly" : "default"
|
|
600
591
|
}),
|
|
601
592
|
r ? "pl-9" : "pl-3",
|
|
602
|
-
|
|
593
|
+
a ? "pr-9" : "pr-3",
|
|
603
594
|
"h-9"
|
|
604
595
|
),
|
|
605
596
|
...u
|
|
606
597
|
}
|
|
607
598
|
),
|
|
608
|
-
|
|
599
|
+
a && /* @__PURE__ */ e.jsx(
|
|
609
600
|
"span",
|
|
610
601
|
{
|
|
611
602
|
className: "absolute right-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5",
|
|
612
603
|
"aria-hidden": "true",
|
|
613
604
|
"data-testid": "right-content",
|
|
614
|
-
children:
|
|
605
|
+
children: a
|
|
615
606
|
}
|
|
616
607
|
)
|
|
617
608
|
] }),
|
|
@@ -622,10 +613,10 @@ const ft = m.forwardRef(function({ value: r = "", onChange: n, label: o, formatt
|
|
|
622
613
|
className: "mt-1 text-sm text-danger",
|
|
623
614
|
role: "alert",
|
|
624
615
|
"aria-live": "polite",
|
|
625
|
-
children:
|
|
616
|
+
children: n
|
|
626
617
|
}
|
|
627
618
|
),
|
|
628
|
-
!g &&
|
|
619
|
+
!g && s && /* @__PURE__ */ e.jsx("div", { id: b, className: "mt-1 text-sm text-gray-600", children: s })
|
|
629
620
|
] });
|
|
630
621
|
}
|
|
631
622
|
);
|
|
@@ -642,18 +633,18 @@ const pt = O(
|
|
|
642
633
|
leftContent: /* @__PURE__ */ e.jsx($, { as: ie, color: "inherit", size: "sm" })
|
|
643
634
|
}
|
|
644
635
|
)
|
|
645
|
-
),
|
|
636
|
+
), Re = "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", Ve = "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(
|
|
646
637
|
({
|
|
647
638
|
value: t,
|
|
648
639
|
onChange: r,
|
|
649
|
-
onKeyDown:
|
|
650
|
-
onFocus:
|
|
651
|
-
onPaste:
|
|
652
|
-
disabled:
|
|
640
|
+
onKeyDown: a,
|
|
641
|
+
onFocus: s,
|
|
642
|
+
onPaste: n,
|
|
643
|
+
disabled: o,
|
|
653
644
|
error: d,
|
|
654
645
|
secure: l,
|
|
655
646
|
inputRef: c,
|
|
656
|
-
index:
|
|
647
|
+
index: i,
|
|
657
648
|
id: u
|
|
658
649
|
}, p) => /* @__PURE__ */ e.jsx(
|
|
659
650
|
"input",
|
|
@@ -669,15 +660,15 @@ const pt = O(
|
|
|
669
660
|
const h = f.target.value;
|
|
670
661
|
(h === "" || Se(h)) && r(h);
|
|
671
662
|
},
|
|
672
|
-
onKeyDown:
|
|
673
|
-
onFocus:
|
|
674
|
-
onPaste:
|
|
675
|
-
disabled:
|
|
663
|
+
onKeyDown: a,
|
|
664
|
+
onFocus: s,
|
|
665
|
+
onPaste: n,
|
|
666
|
+
disabled: o,
|
|
676
667
|
"aria-invalid": d,
|
|
677
|
-
"aria-disabled":
|
|
678
|
-
className: d ?
|
|
668
|
+
"aria-disabled": o,
|
|
669
|
+
className: d ? Ve : Re,
|
|
679
670
|
autoComplete: "one-time-code",
|
|
680
|
-
"data-testid": `pin-input-${
|
|
671
|
+
"data-testid": `pin-input-${i}`
|
|
681
672
|
}
|
|
682
673
|
)
|
|
683
674
|
);
|
|
@@ -686,60 +677,60 @@ const De = m.forwardRef(
|
|
|
686
677
|
({
|
|
687
678
|
label: t,
|
|
688
679
|
helperText: r,
|
|
689
|
-
error:
|
|
690
|
-
disabled:
|
|
691
|
-
value:
|
|
692
|
-
onChange:
|
|
680
|
+
error: a,
|
|
681
|
+
disabled: s,
|
|
682
|
+
value: n,
|
|
683
|
+
onChange: o,
|
|
693
684
|
onComplete: d,
|
|
694
685
|
digits: l = 6,
|
|
695
686
|
className: c,
|
|
696
|
-
id:
|
|
687
|
+
id: i,
|
|
697
688
|
name: u,
|
|
698
689
|
required: p,
|
|
699
690
|
secure: f = !1,
|
|
700
691
|
...h
|
|
701
692
|
}, b) => {
|
|
702
|
-
const w = m.useId(), g =
|
|
703
|
-
(
|
|
704
|
-
const y = W(
|
|
705
|
-
|
|
693
|
+
const w = m.useId(), g = i || w, k = !!a, v = m.useRef([]), N = W(n, l), V = N.split("").concat(Array(l - N.length).fill("")), R = m.useCallback(
|
|
694
|
+
(j) => {
|
|
695
|
+
const y = W(j, l);
|
|
696
|
+
o(y), y.length === l && d?.(y);
|
|
706
697
|
},
|
|
707
|
-
[
|
|
698
|
+
[o, d, l]
|
|
708
699
|
), S = m.useCallback(
|
|
709
|
-
(
|
|
700
|
+
(j, y) => {
|
|
710
701
|
const I = [...V];
|
|
711
|
-
I[
|
|
702
|
+
I[j] = y;
|
|
712
703
|
const D = I.join("").replace(/\s+$/, "");
|
|
713
|
-
R(D), y &&
|
|
704
|
+
R(D), y && j < l - 1 && v.current[j + 1]?.focus();
|
|
714
705
|
},
|
|
715
706
|
[V, R, l]
|
|
716
707
|
), E = m.useCallback(
|
|
717
|
-
(
|
|
708
|
+
(j, y) => {
|
|
718
709
|
if (y.key === "Backspace") {
|
|
719
|
-
if (!V[
|
|
710
|
+
if (!V[j] && j > 0) {
|
|
720
711
|
y.preventDefault();
|
|
721
712
|
const I = [...V];
|
|
722
|
-
I[
|
|
713
|
+
I[j - 1] = "";
|
|
723
714
|
const D = I.join("").replace(/\s+$/, "");
|
|
724
|
-
R(D),
|
|
725
|
-
} else if (V[
|
|
715
|
+
R(D), v.current[j - 1]?.focus();
|
|
716
|
+
} else if (V[j]) {
|
|
726
717
|
y.preventDefault();
|
|
727
718
|
const I = [...V];
|
|
728
|
-
I[
|
|
719
|
+
I[j] = "";
|
|
729
720
|
const D = I.join("").replace(/\s+$/, "");
|
|
730
721
|
R(D);
|
|
731
722
|
}
|
|
732
|
-
} else y.key === "ArrowLeft" &&
|
|
723
|
+
} else y.key === "ArrowLeft" && j > 0 ? (y.preventDefault(), v.current[j - 1]?.focus()) : y.key === "ArrowRight" && j < l - 1 && (y.preventDefault(), v.current[j + 1]?.focus());
|
|
733
724
|
},
|
|
734
725
|
[V, R, l]
|
|
735
726
|
), z = m.useCallback(
|
|
736
|
-
(
|
|
737
|
-
|
|
738
|
-
const y =
|
|
727
|
+
(j) => {
|
|
728
|
+
j.preventDefault();
|
|
729
|
+
const y = j.clipboardData.getData("text"), I = W(y, l);
|
|
739
730
|
if (I.length > 0) {
|
|
740
731
|
R(I);
|
|
741
732
|
const D = Math.min(I.length, l - 1);
|
|
742
|
-
|
|
733
|
+
v.current[D]?.focus();
|
|
743
734
|
}
|
|
744
735
|
},
|
|
745
736
|
[R, l]
|
|
@@ -763,22 +754,22 @@ const De = m.forwardRef(
|
|
|
763
754
|
role: "group",
|
|
764
755
|
"aria-labelledby": t ? `${g}-label` : void 0,
|
|
765
756
|
"aria-describedby": k ? `${g}-error` : r ? `${g}-helper` : void 0,
|
|
766
|
-
children: V.map((
|
|
757
|
+
children: V.map((j, y) => /* @__PURE__ */ e.jsx(
|
|
767
758
|
Q,
|
|
768
759
|
{
|
|
769
|
-
value:
|
|
760
|
+
value: j,
|
|
770
761
|
onChange: (I) => S(y, I),
|
|
771
762
|
onKeyDown: (I) => E(y, I),
|
|
772
763
|
onFocus: () => {
|
|
773
|
-
const I =
|
|
764
|
+
const I = v.current[y];
|
|
774
765
|
I && I.select();
|
|
775
766
|
},
|
|
776
767
|
onPaste: z,
|
|
777
|
-
disabled:
|
|
768
|
+
disabled: s,
|
|
778
769
|
error: k,
|
|
779
770
|
secure: f,
|
|
780
771
|
inputRef: (I) => {
|
|
781
|
-
|
|
772
|
+
v.current[y] = I;
|
|
782
773
|
},
|
|
783
774
|
index: y,
|
|
784
775
|
id: `${g}-${y}`
|
|
@@ -802,7 +793,7 @@ const De = m.forwardRef(
|
|
|
802
793
|
id: `${g}-error`,
|
|
803
794
|
className: "mt-2 text-sm text-danger",
|
|
804
795
|
role: "alert",
|
|
805
|
-
children:
|
|
796
|
+
children: a
|
|
806
797
|
}
|
|
807
798
|
),
|
|
808
799
|
!k && r && /* @__PURE__ */ e.jsx("div", { id: `${g}-helper`, className: "mt-2 text-sm text-gray-600", children: r })
|
|
@@ -811,19 +802,19 @@ const De = m.forwardRef(
|
|
|
811
802
|
);
|
|
812
803
|
De.displayName = "PinField";
|
|
813
804
|
function ze(t, r) {
|
|
814
|
-
|
|
805
|
+
ne(() => {
|
|
815
806
|
typeof t == "number" && !isNaN(t) ? r(`${t}`) : t === "" || t === null || t === void 0 ? r("") : typeof t == "string" && r(t);
|
|
816
807
|
}, [t, r]);
|
|
817
808
|
}
|
|
818
809
|
function Oe(t, r = !1) {
|
|
819
810
|
if (t === "" || t === "-" && r) return !0;
|
|
820
|
-
const
|
|
821
|
-
if (r && t.startsWith("-") &&
|
|
822
|
-
if (
|
|
823
|
-
const
|
|
824
|
-
if (
|
|
825
|
-
const
|
|
826
|
-
return !(
|
|
811
|
+
const a = r && t.startsWith("-") ? t.slice(1) : t;
|
|
812
|
+
if (r && t.startsWith("-") && a === "") return !0;
|
|
813
|
+
if (a.startsWith(".") || a.startsWith(",") || !/^[\d.,]+$/.test(a)) return !1;
|
|
814
|
+
const s = a.split(",");
|
|
815
|
+
if (s.length > 2) return !1;
|
|
816
|
+
const n = s[0], o = s[1];
|
|
817
|
+
return !(n === "" || !Pe(n) || o !== void 0 && o !== "" && !$e(o));
|
|
827
818
|
}
|
|
828
819
|
function Pe(t) {
|
|
829
820
|
if (t === "") return !1;
|
|
@@ -831,11 +822,11 @@ function Pe(t) {
|
|
|
831
822
|
return /^\d+$/.test(t);
|
|
832
823
|
const r = t.split(".");
|
|
833
824
|
if (r[0] === "" || !/^\d{1,3}$/.test(r[0])) return !1;
|
|
834
|
-
for (let
|
|
835
|
-
const
|
|
836
|
-
if (
|
|
837
|
-
if (
|
|
838
|
-
} else if (!/^\d{3}$/.test(
|
|
825
|
+
for (let a = 1; a < r.length; a++) {
|
|
826
|
+
const s = r[a];
|
|
827
|
+
if (a === r.length - 1) {
|
|
828
|
+
if (s !== "" && !/^\d{1,3}$/.test(s)) return !1;
|
|
829
|
+
} else if (!/^\d{3}$/.test(s)) return !1;
|
|
839
830
|
}
|
|
840
831
|
return !0;
|
|
841
832
|
}
|
|
@@ -844,52 +835,52 @@ function $e(t) {
|
|
|
844
835
|
}
|
|
845
836
|
function U(t, r = !1) {
|
|
846
837
|
if (t === "") return "";
|
|
847
|
-
const
|
|
848
|
-
if (
|
|
838
|
+
const a = t.startsWith("-");
|
|
839
|
+
if (a && !r)
|
|
849
840
|
return U(t.slice(1), !1);
|
|
850
|
-
if (
|
|
851
|
-
let
|
|
852
|
-
const
|
|
853
|
-
if (
|
|
854
|
-
const d =
|
|
855
|
-
|
|
841
|
+
if (a && t.length === 1) return "-";
|
|
842
|
+
let n = (a ? t.slice(1) : t).replace(/[^\d.,]/g, "");
|
|
843
|
+
const o = n.lastIndexOf(",");
|
|
844
|
+
if (o !== -1) {
|
|
845
|
+
const d = n.slice(0, o).replace(/,/g, ""), l = n.slice(o + 1).replace(/,/g, "");
|
|
846
|
+
n = d + "," + l;
|
|
856
847
|
}
|
|
857
|
-
return
|
|
848
|
+
return n = n.replace(/\.{2,}/g, "."), (a ? "-" : "") + n;
|
|
858
849
|
}
|
|
859
850
|
const mt = ({
|
|
860
851
|
value: t,
|
|
861
852
|
onChange: r,
|
|
862
|
-
allowNegative:
|
|
863
|
-
inputProps:
|
|
864
|
-
label:
|
|
865
|
-
helperText:
|
|
853
|
+
allowNegative: a = !1,
|
|
854
|
+
inputProps: s,
|
|
855
|
+
label: n,
|
|
856
|
+
helperText: o,
|
|
866
857
|
error: d,
|
|
867
858
|
...l
|
|
868
859
|
}) => {
|
|
869
|
-
const c = T(null), [
|
|
860
|
+
const c = T(null), [i, u] = se(
|
|
870
861
|
t === "" ? "" : String(t)
|
|
871
862
|
);
|
|
872
863
|
ze(t, u);
|
|
873
864
|
const p = (f) => {
|
|
874
|
-
const h = f.target.value, b = U(h,
|
|
875
|
-
Oe(b,
|
|
865
|
+
const h = f.target.value, b = U(h, a);
|
|
866
|
+
Oe(b, a) ? (u(b), r(b)) : f.preventDefault();
|
|
876
867
|
};
|
|
877
868
|
return /* @__PURE__ */ e.jsx(
|
|
878
869
|
M,
|
|
879
870
|
{
|
|
880
871
|
ref: c,
|
|
881
872
|
type: "text",
|
|
882
|
-
label:
|
|
883
|
-
value:
|
|
873
|
+
label: n,
|
|
874
|
+
value: i,
|
|
884
875
|
onChange: p,
|
|
885
876
|
error: d,
|
|
886
|
-
helperText:
|
|
877
|
+
helperText: o,
|
|
887
878
|
placeholder: l.placeholder,
|
|
888
879
|
leftContent: /* @__PURE__ */ e.jsx($, { as: ce, color: "inherit", size: "sm" }),
|
|
889
880
|
inputMode: "numeric",
|
|
890
881
|
autoComplete: "off",
|
|
891
882
|
pattern: "[0-9.,-]*",
|
|
892
|
-
...
|
|
883
|
+
...s,
|
|
893
884
|
...l
|
|
894
885
|
}
|
|
895
886
|
);
|
|
@@ -962,16 +953,16 @@ const mt = ({
|
|
|
962
953
|
}
|
|
963
954
|
), X = F(
|
|
964
955
|
null
|
|
965
|
-
),
|
|
966
|
-
const t =
|
|
956
|
+
), Be = () => {
|
|
957
|
+
const t = B(X);
|
|
967
958
|
if (!t)
|
|
968
959
|
throw new Error(
|
|
969
960
|
"useRadioInputContext must be used within RadioInputContext"
|
|
970
961
|
);
|
|
971
962
|
return t;
|
|
972
|
-
},
|
|
973
|
-
({ children: t, description: r, className:
|
|
974
|
-
const c =
|
|
963
|
+
}, Ae = m.forwardRef(
|
|
964
|
+
({ children: t, description: r, className: a, disabled: s, id: n, value: o, ...d }, l) => {
|
|
965
|
+
const c = Be(), i = m.useId(), u = n || i, p = s || c.disabled, f = c.error ? "danger" : c.variant || "primary";
|
|
975
966
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
976
967
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
977
968
|
"input",
|
|
@@ -980,7 +971,7 @@ const mt = ({
|
|
|
980
971
|
type: "radio",
|
|
981
972
|
id: u,
|
|
982
973
|
name: c.name,
|
|
983
|
-
value:
|
|
974
|
+
value: o,
|
|
984
975
|
disabled: p,
|
|
985
976
|
className: x(
|
|
986
977
|
Me({
|
|
@@ -996,7 +987,7 @@ const mt = ({
|
|
|
996
987
|
"checked:before:opacity-100",
|
|
997
988
|
// Outline variants use colored radio dot
|
|
998
989
|
f?.includes("outline") && "checked:before:bg-current",
|
|
999
|
-
|
|
990
|
+
a
|
|
1000
991
|
),
|
|
1001
992
|
...d
|
|
1002
993
|
}
|
|
@@ -1033,17 +1024,17 @@ const mt = ({
|
|
|
1033
1024
|
({
|
|
1034
1025
|
variant: t = "primary",
|
|
1035
1026
|
size: r = "md",
|
|
1036
|
-
label:
|
|
1037
|
-
helperText:
|
|
1038
|
-
error:
|
|
1039
|
-
direction:
|
|
1027
|
+
label: a,
|
|
1028
|
+
helperText: s,
|
|
1029
|
+
error: n,
|
|
1030
|
+
direction: o = "vertical",
|
|
1040
1031
|
className: d,
|
|
1041
1032
|
disabled: l,
|
|
1042
1033
|
name: c,
|
|
1043
|
-
children:
|
|
1034
|
+
children: i,
|
|
1044
1035
|
...u
|
|
1045
1036
|
}, p) => {
|
|
1046
|
-
const f = !!
|
|
1037
|
+
const f = !!n, h = {
|
|
1047
1038
|
variant: t,
|
|
1048
1039
|
size: r,
|
|
1049
1040
|
disabled: l,
|
|
@@ -1051,22 +1042,22 @@ const mt = ({
|
|
|
1051
1042
|
name: c
|
|
1052
1043
|
};
|
|
1053
1044
|
return /* @__PURE__ */ e.jsx(X.Provider, { value: h, children: /* @__PURE__ */ e.jsxs("div", { ref: p, className: x("w-full", d), ...u, children: [
|
|
1054
|
-
|
|
1055
|
-
/* @__PURE__ */ e.jsx("div", { className: Ee({ direction:
|
|
1056
|
-
f && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children:
|
|
1057
|
-
!f &&
|
|
1045
|
+
a && /* @__PURE__ */ e.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: a }),
|
|
1046
|
+
/* @__PURE__ */ e.jsx("div", { className: Ee({ direction: o }), children: i }),
|
|
1047
|
+
f && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
|
|
1048
|
+
!f && s && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
|
|
1058
1049
|
] }) });
|
|
1059
1050
|
}
|
|
1060
1051
|
), ht = Object.assign(We, {
|
|
1061
|
-
Option:
|
|
1052
|
+
Option: Ae
|
|
1062
1053
|
}), bt = O(
|
|
1063
1054
|
({
|
|
1064
1055
|
autoComplete: t = "off",
|
|
1065
1056
|
spellCheck: r = !1,
|
|
1066
|
-
inputMode:
|
|
1067
|
-
placeholder:
|
|
1068
|
-
maxLength:
|
|
1069
|
-
enterKeyHint:
|
|
1057
|
+
inputMode: a = "search",
|
|
1058
|
+
placeholder: s = "Search...",
|
|
1059
|
+
maxLength: n = 256,
|
|
1060
|
+
enterKeyHint: o = "search",
|
|
1070
1061
|
"aria-label": d = "Search",
|
|
1071
1062
|
// internal default, not in props
|
|
1072
1063
|
...l
|
|
@@ -1075,12 +1066,12 @@ const mt = ({
|
|
|
1075
1066
|
{
|
|
1076
1067
|
ref: c,
|
|
1077
1068
|
type: "search",
|
|
1078
|
-
inputMode:
|
|
1069
|
+
inputMode: a,
|
|
1079
1070
|
autoComplete: t,
|
|
1080
1071
|
spellCheck: r,
|
|
1081
|
-
placeholder:
|
|
1082
|
-
maxLength:
|
|
1083
|
-
enterKeyHint:
|
|
1072
|
+
placeholder: s,
|
|
1073
|
+
maxLength: n,
|
|
1074
|
+
enterKeyHint: o,
|
|
1084
1075
|
"aria-label": d,
|
|
1085
1076
|
leftContent: /* @__PURE__ */ e.jsx($, { as: le, color: "inherit", size: "sm" }),
|
|
1086
1077
|
...l
|
|
@@ -1100,30 +1091,30 @@ const mt = ({
|
|
|
1100
1091
|
state: "default"
|
|
1101
1092
|
}
|
|
1102
1093
|
}
|
|
1103
|
-
), Y = m.forwardRef(({ value: t, children: r, ...
|
|
1094
|
+
), Y = m.forwardRef(({ value: t, children: r, ...a }, s) => /* @__PURE__ */ e.jsx("option", { ref: s, value: t, ...a, children: r }));
|
|
1104
1095
|
Y.displayName = "SelectOption";
|
|
1105
|
-
const Z = m.forwardRef(({ label: t, children: r, ...
|
|
1096
|
+
const Z = m.forwardRef(({ label: t, children: r, ...a }, s) => /* @__PURE__ */ e.jsx("optgroup", { ref: s, label: t, ...a, children: r }));
|
|
1106
1097
|
Z.displayName = "SelectOptionGroup";
|
|
1107
1098
|
const ee = m.forwardRef(
|
|
1108
1099
|
({
|
|
1109
1100
|
label: t,
|
|
1110
1101
|
helperText: r,
|
|
1111
|
-
error:
|
|
1112
|
-
className:
|
|
1113
|
-
disabled:
|
|
1114
|
-
readOnly:
|
|
1102
|
+
error: a,
|
|
1103
|
+
className: s,
|
|
1104
|
+
disabled: n,
|
|
1105
|
+
readOnly: o,
|
|
1115
1106
|
id: d,
|
|
1116
1107
|
required: l,
|
|
1117
1108
|
placeholder: c,
|
|
1118
|
-
children:
|
|
1109
|
+
children: i,
|
|
1119
1110
|
onChange: u,
|
|
1120
1111
|
...p
|
|
1121
1112
|
}, f) => {
|
|
1122
|
-
const h = m.useId(), b = d || h, w = `${b}-helper`, g = `${b}-error`, k = !!
|
|
1113
|
+
const h = m.useId(), b = d || h, w = `${b}-helper`, g = `${b}-error`, k = !!a, v = m.useMemo(() => {
|
|
1123
1114
|
const N = [];
|
|
1124
1115
|
return k ? N.push(g) : r && N.push(w), N.length > 0 ? N.join(" ") : void 0;
|
|
1125
1116
|
}, [k, r, g, w]);
|
|
1126
|
-
return /* @__PURE__ */ e.jsxs("div", { className: x("w-full",
|
|
1117
|
+
return /* @__PURE__ */ e.jsxs("div", { className: x("w-full", s), children: [
|
|
1127
1118
|
t && /* @__PURE__ */ e.jsxs(
|
|
1128
1119
|
"label",
|
|
1129
1120
|
{
|
|
@@ -1142,21 +1133,21 @@ const ee = m.forwardRef(
|
|
|
1142
1133
|
ref: f,
|
|
1143
1134
|
id: b,
|
|
1144
1135
|
required: l,
|
|
1145
|
-
disabled:
|
|
1136
|
+
disabled: n || o,
|
|
1146
1137
|
"aria-invalid": k,
|
|
1147
|
-
"aria-describedby":
|
|
1138
|
+
"aria-describedby": v,
|
|
1148
1139
|
"aria-errormessage": k ? g : void 0,
|
|
1149
1140
|
onChange: u,
|
|
1150
1141
|
className: x(
|
|
1151
1142
|
Le({
|
|
1152
|
-
state: k ? "error" :
|
|
1143
|
+
state: k ? "error" : o ? "readOnly" : "default"
|
|
1153
1144
|
}),
|
|
1154
1145
|
"h-9 pl-3"
|
|
1155
1146
|
),
|
|
1156
1147
|
...p,
|
|
1157
1148
|
children: [
|
|
1158
1149
|
c && /* @__PURE__ */ e.jsx("option", { value: "", disabled: !0, hidden: !0, children: c }),
|
|
1159
|
-
|
|
1150
|
+
i
|
|
1160
1151
|
]
|
|
1161
1152
|
}
|
|
1162
1153
|
),
|
|
@@ -1177,7 +1168,7 @@ const ee = m.forwardRef(
|
|
|
1177
1168
|
className: "mt-1 text-sm text-danger",
|
|
1178
1169
|
role: "alert",
|
|
1179
1170
|
"aria-live": "polite",
|
|
1180
|
-
children:
|
|
1171
|
+
children: a
|
|
1181
1172
|
}
|
|
1182
1173
|
),
|
|
1183
1174
|
!k && r && /* @__PURE__ */ e.jsx("div", { id: w, className: "mt-1 text-sm text-gray-600", children: r })
|
|
@@ -1239,45 +1230,45 @@ const gt = Object.assign(ee, {
|
|
|
1239
1230
|
({
|
|
1240
1231
|
value: t,
|
|
1241
1232
|
children: r,
|
|
1242
|
-
checked:
|
|
1243
|
-
id:
|
|
1244
|
-
className:
|
|
1245
|
-
disabled:
|
|
1233
|
+
checked: a,
|
|
1234
|
+
id: s,
|
|
1235
|
+
className: n,
|
|
1236
|
+
disabled: o,
|
|
1246
1237
|
checkboxPlacement: d = "center",
|
|
1247
1238
|
hideCheckbox: l = !1,
|
|
1248
1239
|
...c
|
|
1249
|
-
},
|
|
1250
|
-
const u =
|
|
1240
|
+
}, i) => {
|
|
1241
|
+
const u = A(), p = s || u, f = typeof r == "function" ? r(a) : r;
|
|
1251
1242
|
return /* @__PURE__ */ e.jsxs(
|
|
1252
1243
|
"label",
|
|
1253
1244
|
{
|
|
1254
1245
|
htmlFor: p,
|
|
1255
1246
|
className: x(
|
|
1256
1247
|
Te({
|
|
1257
|
-
checked: !!
|
|
1258
|
-
disabled: !!
|
|
1248
|
+
checked: !!a,
|
|
1249
|
+
disabled: !!o,
|
|
1259
1250
|
checkboxPlacement: d,
|
|
1260
1251
|
hideCheckbox: l
|
|
1261
1252
|
}),
|
|
1262
|
-
|
|
1253
|
+
n
|
|
1263
1254
|
),
|
|
1264
|
-
"aria-checked":
|
|
1255
|
+
"aria-checked": a,
|
|
1265
1256
|
role: "radio",
|
|
1266
1257
|
"aria-label": `Select ${t}`,
|
|
1267
|
-
tabIndex:
|
|
1258
|
+
tabIndex: o ? -1 : 0,
|
|
1268
1259
|
children: [
|
|
1269
1260
|
/* @__PURE__ */ e.jsx(
|
|
1270
1261
|
"input",
|
|
1271
1262
|
{
|
|
1272
|
-
ref:
|
|
1263
|
+
ref: i,
|
|
1273
1264
|
id: p,
|
|
1274
1265
|
type: "radio",
|
|
1275
1266
|
value: t,
|
|
1276
|
-
checked:
|
|
1277
|
-
disabled:
|
|
1267
|
+
checked: a,
|
|
1268
|
+
disabled: o,
|
|
1278
1269
|
className: "sr-only",
|
|
1279
1270
|
"aria-hidden": !0,
|
|
1280
|
-
"aria-checked":
|
|
1271
|
+
"aria-checked": a,
|
|
1281
1272
|
...c
|
|
1282
1273
|
}
|
|
1283
1274
|
),
|
|
@@ -1286,14 +1277,14 @@ const gt = Object.assign(ee, {
|
|
|
1286
1277
|
{
|
|
1287
1278
|
className: x(
|
|
1288
1279
|
qe({
|
|
1289
|
-
checked: !!
|
|
1290
|
-
disabled: !!
|
|
1280
|
+
checked: !!a,
|
|
1281
|
+
disabled: !!o
|
|
1291
1282
|
}),
|
|
1292
1283
|
// Custom checkmark styling using ::after - centered positioning
|
|
1293
1284
|
'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',
|
|
1294
1285
|
// Checkmark dimensions scaled up for h-6 w-6 size
|
|
1295
1286
|
"after:w-[6px] after:h-[12px]",
|
|
1296
|
-
|
|
1287
|
+
a && "after:opacity-100"
|
|
1297
1288
|
),
|
|
1298
1289
|
"aria-hidden": "true"
|
|
1299
1290
|
}
|
|
@@ -1356,45 +1347,45 @@ const Ke = C(
|
|
|
1356
1347
|
({
|
|
1357
1348
|
value: t,
|
|
1358
1349
|
children: r,
|
|
1359
|
-
checked:
|
|
1360
|
-
id:
|
|
1361
|
-
className:
|
|
1362
|
-
disabled:
|
|
1350
|
+
checked: a,
|
|
1351
|
+
id: s,
|
|
1352
|
+
className: n,
|
|
1353
|
+
disabled: o,
|
|
1363
1354
|
checkboxPlacement: d = "center",
|
|
1364
1355
|
hideCheckbox: l = !1,
|
|
1365
1356
|
...c
|
|
1366
|
-
},
|
|
1367
|
-
const u =
|
|
1357
|
+
}, i) => {
|
|
1358
|
+
const u = A(), p = s || u, f = typeof r == "function" ? r(a) : r;
|
|
1368
1359
|
return /* @__PURE__ */ e.jsxs(
|
|
1369
1360
|
"label",
|
|
1370
1361
|
{
|
|
1371
1362
|
htmlFor: p,
|
|
1372
1363
|
className: x(
|
|
1373
1364
|
Ke({
|
|
1374
|
-
checked: !!
|
|
1375
|
-
disabled: !!
|
|
1365
|
+
checked: !!a,
|
|
1366
|
+
disabled: !!o,
|
|
1376
1367
|
checkboxPlacement: d,
|
|
1377
1368
|
hideCheckbox: l
|
|
1378
1369
|
}),
|
|
1379
|
-
|
|
1370
|
+
n
|
|
1380
1371
|
),
|
|
1381
|
-
"aria-checked":
|
|
1372
|
+
"aria-checked": a,
|
|
1382
1373
|
role: "checkbox",
|
|
1383
1374
|
"aria-label": `Select ${t}`,
|
|
1384
|
-
tabIndex:
|
|
1375
|
+
tabIndex: o ? -1 : 0,
|
|
1385
1376
|
children: [
|
|
1386
1377
|
/* @__PURE__ */ e.jsx(
|
|
1387
1378
|
"input",
|
|
1388
1379
|
{
|
|
1389
|
-
ref:
|
|
1380
|
+
ref: i,
|
|
1390
1381
|
id: p,
|
|
1391
1382
|
type: "checkbox",
|
|
1392
1383
|
value: t,
|
|
1393
|
-
checked:
|
|
1394
|
-
disabled:
|
|
1384
|
+
checked: a,
|
|
1385
|
+
disabled: o,
|
|
1395
1386
|
className: "sr-only",
|
|
1396
1387
|
"aria-hidden": !0,
|
|
1397
|
-
"aria-checked":
|
|
1388
|
+
"aria-checked": a,
|
|
1398
1389
|
...c
|
|
1399
1390
|
}
|
|
1400
1391
|
),
|
|
@@ -1403,14 +1394,14 @@ const Ke = C(
|
|
|
1403
1394
|
{
|
|
1404
1395
|
className: x(
|
|
1405
1396
|
_e({
|
|
1406
|
-
checked: !!
|
|
1407
|
-
disabled: !!
|
|
1397
|
+
checked: !!a,
|
|
1398
|
+
disabled: !!o
|
|
1408
1399
|
}),
|
|
1409
1400
|
// Custom checkmark styling using ::after - centered positioning
|
|
1410
1401
|
'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',
|
|
1411
1402
|
// Checkmark dimensions scaled up for h-6 w-6 size
|
|
1412
1403
|
"after:w-[6px] after:h-[12px]",
|
|
1413
|
-
|
|
1404
|
+
a && "after:opacity-100"
|
|
1414
1405
|
),
|
|
1415
1406
|
"aria-hidden": "true"
|
|
1416
1407
|
}
|
|
@@ -1453,73 +1444,73 @@ const Je = C(
|
|
|
1453
1444
|
checked: !1
|
|
1454
1445
|
}
|
|
1455
1446
|
}
|
|
1456
|
-
), Ue = ({ disabled: t = !1, checked: r = !1, className:
|
|
1447
|
+
), Ue = ({ disabled: t = !1, checked: r = !1, className: a }) => /* @__PURE__ */ e.jsx(
|
|
1457
1448
|
"span",
|
|
1458
1449
|
{
|
|
1459
1450
|
className: x(
|
|
1460
1451
|
Je({ disabled: t, checked: r }),
|
|
1461
1452
|
"pointer-events-none",
|
|
1462
|
-
|
|
1453
|
+
a
|
|
1463
1454
|
),
|
|
1464
1455
|
"aria-hidden": "true"
|
|
1465
1456
|
}
|
|
1466
|
-
), Xe = ({ checked: t = !1 }) => /* @__PURE__ */ e.jsx("span", { className: x(Qe({ checked: t })), "aria-hidden": "true" }), Ye = ({ label: t, htmlFor: r, disabled:
|
|
1457
|
+
), 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(
|
|
1467
1458
|
"label",
|
|
1468
1459
|
{
|
|
1469
1460
|
htmlFor: r,
|
|
1470
1461
|
className: x(
|
|
1471
1462
|
"text-sm select-none font-medium text-foreground",
|
|
1472
|
-
|
|
1463
|
+
a && "opacity-50 cursor-not-allowed"
|
|
1473
1464
|
),
|
|
1474
1465
|
children: [
|
|
1475
1466
|
t,
|
|
1476
|
-
|
|
1467
|
+
s && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
1477
1468
|
]
|
|
1478
1469
|
}
|
|
1479
1470
|
) : null, Ze = m.forwardRef(
|
|
1480
1471
|
({
|
|
1481
1472
|
value: t,
|
|
1482
1473
|
onChange: r,
|
|
1483
|
-
label:
|
|
1484
|
-
disabled:
|
|
1485
|
-
required:
|
|
1486
|
-
className:
|
|
1474
|
+
label: a,
|
|
1475
|
+
disabled: s = !1,
|
|
1476
|
+
required: n = !1,
|
|
1477
|
+
className: o,
|
|
1487
1478
|
id: d,
|
|
1488
1479
|
ariaLabel: l,
|
|
1489
1480
|
...c
|
|
1490
|
-
},
|
|
1481
|
+
}, i) => {
|
|
1491
1482
|
const u = m.useId(), p = d || u, f = t ?? !1, h = (b) => {
|
|
1492
1483
|
r?.(b.target.checked);
|
|
1493
1484
|
};
|
|
1494
|
-
return /* @__PURE__ */ e.jsxs("div", { className: x("inline-flex items-center gap-2",
|
|
1485
|
+
return /* @__PURE__ */ e.jsxs("div", { className: x("inline-flex items-center gap-2", o), children: [
|
|
1495
1486
|
/* @__PURE__ */ e.jsxs("span", { className: "relative inline-flex items-center", children: [
|
|
1496
1487
|
/* @__PURE__ */ e.jsx(
|
|
1497
1488
|
"input",
|
|
1498
1489
|
{
|
|
1499
|
-
ref:
|
|
1490
|
+
ref: i,
|
|
1500
1491
|
type: "checkbox",
|
|
1501
1492
|
role: "switch",
|
|
1502
1493
|
id: p,
|
|
1503
|
-
"aria-label": l ||
|
|
1494
|
+
"aria-label": l || a,
|
|
1504
1495
|
"aria-checked": f,
|
|
1505
1496
|
checked: f,
|
|
1506
|
-
disabled:
|
|
1507
|
-
required:
|
|
1497
|
+
disabled: s,
|
|
1498
|
+
required: n,
|
|
1508
1499
|
onChange: h,
|
|
1509
1500
|
className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10 disabled:cursor-not-allowed",
|
|
1510
1501
|
...c
|
|
1511
1502
|
}
|
|
1512
1503
|
),
|
|
1513
|
-
/* @__PURE__ */ e.jsx(Ue, { disabled:
|
|
1504
|
+
/* @__PURE__ */ e.jsx(Ue, { disabled: s, checked: f }),
|
|
1514
1505
|
/* @__PURE__ */ e.jsx(Xe, { checked: f })
|
|
1515
1506
|
] }),
|
|
1516
1507
|
/* @__PURE__ */ e.jsx(
|
|
1517
1508
|
Ye,
|
|
1518
1509
|
{
|
|
1519
|
-
label:
|
|
1510
|
+
label: a,
|
|
1520
1511
|
htmlFor: p,
|
|
1521
|
-
disabled:
|
|
1522
|
-
required:
|
|
1512
|
+
disabled: s,
|
|
1513
|
+
required: n
|
|
1523
1514
|
}
|
|
1524
1515
|
)
|
|
1525
1516
|
] });
|
|
@@ -1527,45 +1518,44 @@ const Je = C(
|
|
|
1527
1518
|
);
|
|
1528
1519
|
Ze.displayName = "SwitchInput";
|
|
1529
1520
|
const et = C(
|
|
1530
|
-
"block w-full rounded-md border bg-white
|
|
1521
|
+
"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 overflow-y-auto whitespace-pre-wrap break-words",
|
|
1531
1522
|
{
|
|
1532
1523
|
variants: {
|
|
1533
1524
|
state: {
|
|
1534
|
-
default: "border-primary/30 focus:
|
|
1535
|
-
error: "border-danger bg-danger/5
|
|
1536
|
-
|
|
1537
|
-
readOnly: "bg-gray-50 cursor-default focus:ring-0 border-gray-300 focus:border-gray-300"
|
|
1525
|
+
default: "border-primary/30 text-foreground focus:border-primary focus:ring-primary/20",
|
|
1526
|
+
error: "border-danger bg-danger/5 text-foreground focus:border-danger focus:ring-danger/20",
|
|
1527
|
+
readOnly: "border-gray-300 bg-gray-50 text-foreground cursor-default focus:ring-0 focus:border-gray-300"
|
|
1538
1528
|
}
|
|
1539
1529
|
},
|
|
1540
1530
|
defaultVariants: {
|
|
1541
1531
|
state: "default"
|
|
1542
1532
|
}
|
|
1543
1533
|
}
|
|
1544
|
-
), tt = (t, r
|
|
1545
|
-
if (r ||
|
|
1534
|
+
), tt = (t, r) => t ? "readOnly" : r ? "error" : "default", rt = (t, r, a) => {
|
|
1535
|
+
if (r || a) {
|
|
1546
1536
|
t.preventDefault();
|
|
1547
1537
|
return;
|
|
1548
1538
|
}
|
|
1549
1539
|
t.preventDefault();
|
|
1550
|
-
const
|
|
1551
|
-
if (!
|
|
1552
|
-
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1540
|
+
const s = t.clipboardData.getData("text/plain"), n = window.getSelection();
|
|
1541
|
+
if (!n || !n.rangeCount) return;
|
|
1542
|
+
n.deleteFromDocument();
|
|
1543
|
+
const o = n.getRangeAt(0), d = document.createTextNode(s);
|
|
1544
|
+
o.insertNode(d), o.setStartAfter(d), o.setEndAfter(d), n.removeAllRanges(), n.addRange(o);
|
|
1555
1545
|
const l = new Event("input", { bubbles: !0 });
|
|
1556
1546
|
t.currentTarget.dispatchEvent(l);
|
|
1557
|
-
},
|
|
1547
|
+
}, at = m.forwardRef(
|
|
1558
1548
|
({
|
|
1559
1549
|
label: t,
|
|
1560
1550
|
helperText: r,
|
|
1561
|
-
error:
|
|
1562
|
-
className:
|
|
1563
|
-
disabled:
|
|
1564
|
-
readOnly:
|
|
1551
|
+
error: a,
|
|
1552
|
+
className: s,
|
|
1553
|
+
disabled: n,
|
|
1554
|
+
readOnly: o,
|
|
1565
1555
|
id: d,
|
|
1566
1556
|
value: l,
|
|
1567
1557
|
defaultValue: c,
|
|
1568
|
-
onChange:
|
|
1558
|
+
onChange: i,
|
|
1569
1559
|
placeholder: u,
|
|
1570
1560
|
name: p,
|
|
1571
1561
|
row: f = 3,
|
|
@@ -1574,21 +1564,21 @@ const et = C(
|
|
|
1574
1564
|
onFocus: w,
|
|
1575
1565
|
onKeyDown: g,
|
|
1576
1566
|
...k
|
|
1577
|
-
},
|
|
1578
|
-
const N = m.useId(), V = d || N, R = !!
|
|
1579
|
-
m.useImperativeHandle(
|
|
1567
|
+
}, v) => {
|
|
1568
|
+
const N = m.useId(), V = d || N, R = !!a, S = m.useRef(null), [E, z] = m.useState(c || ""), j = l !== void 0, y = j ? l : E;
|
|
1569
|
+
m.useImperativeHandle(v, () => S.current), m.useEffect(() => {
|
|
1580
1570
|
S.current && S.current.textContent !== y && (S.current.textContent = y);
|
|
1581
1571
|
}, [y]);
|
|
1582
|
-
const I = tt(
|
|
1572
|
+
const I = tt(o, R), D = !y && u, te = (P) => {
|
|
1583
1573
|
const L = P.currentTarget.textContent || "";
|
|
1584
|
-
|
|
1574
|
+
j || z(L), i?.(L);
|
|
1585
1575
|
}, re = (P) => {
|
|
1586
|
-
if (
|
|
1576
|
+
if (n || o) {
|
|
1587
1577
|
P.preventDefault();
|
|
1588
1578
|
return;
|
|
1589
1579
|
}
|
|
1590
1580
|
g?.(P);
|
|
1591
|
-
},
|
|
1581
|
+
}, ae = () => {
|
|
1592
1582
|
S.current?.focus();
|
|
1593
1583
|
};
|
|
1594
1584
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
@@ -1597,14 +1587,14 @@ const et = C(
|
|
|
1597
1587
|
{
|
|
1598
1588
|
htmlFor: V,
|
|
1599
1589
|
className: "block text-sm font-medium text-foreground mb-2 cursor-pointer",
|
|
1600
|
-
onClick:
|
|
1590
|
+
onClick: ae,
|
|
1601
1591
|
children: [
|
|
1602
1592
|
t,
|
|
1603
1593
|
h && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
1604
1594
|
]
|
|
1605
1595
|
}
|
|
1606
1596
|
),
|
|
1607
|
-
/* @__PURE__ */ e.jsx("div", { className: x("relative w-full",
|
|
1597
|
+
/* @__PURE__ */ e.jsx("div", { className: x("relative w-full", s), children: /* @__PURE__ */ e.jsx(
|
|
1608
1598
|
"div",
|
|
1609
1599
|
{
|
|
1610
1600
|
ref: S,
|
|
@@ -1612,15 +1602,15 @@ const et = C(
|
|
|
1612
1602
|
role: "textbox",
|
|
1613
1603
|
"aria-multiline": "true",
|
|
1614
1604
|
"aria-invalid": R,
|
|
1615
|
-
"aria-disabled":
|
|
1616
|
-
"aria-readonly":
|
|
1605
|
+
"aria-disabled": n,
|
|
1606
|
+
"aria-readonly": o,
|
|
1617
1607
|
"aria-required": h,
|
|
1618
1608
|
"aria-label": typeof t == "string" ? t : void 0,
|
|
1619
|
-
contentEditable: !
|
|
1609
|
+
contentEditable: !n && !o,
|
|
1620
1610
|
"data-name": p,
|
|
1621
1611
|
onInput: te,
|
|
1622
1612
|
onKeyDown: re,
|
|
1623
|
-
onPaste: (P) => rt(P,
|
|
1613
|
+
onPaste: (P) => rt(P, n, o),
|
|
1624
1614
|
onBlur: b,
|
|
1625
1615
|
onFocus: w,
|
|
1626
1616
|
suppressContentEditableWarning: !0,
|
|
@@ -1634,15 +1624,15 @@ const et = C(
|
|
|
1634
1624
|
...k
|
|
1635
1625
|
}
|
|
1636
1626
|
) }),
|
|
1637
|
-
R && /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-sm text-danger", role: "alert", children:
|
|
1627
|
+
R && /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-sm text-danger", role: "alert", children: a }),
|
|
1638
1628
|
!R && r && /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-sm text-gray-600", children: r })
|
|
1639
1629
|
] });
|
|
1640
1630
|
}
|
|
1641
1631
|
);
|
|
1642
|
-
|
|
1643
|
-
const xt = O(function(r,
|
|
1644
|
-
const
|
|
1645
|
-
r?.onChange?.(
|
|
1632
|
+
at.displayName = "TextAreaInput";
|
|
1633
|
+
const xt = O(function(r, a) {
|
|
1634
|
+
const s = (n) => {
|
|
1635
|
+
r?.onChange?.(n.target.value);
|
|
1646
1636
|
};
|
|
1647
1637
|
return /* @__PURE__ */ e.jsx(
|
|
1648
1638
|
M,
|
|
@@ -1651,9 +1641,9 @@ const xt = O(function(r, n) {
|
|
|
1651
1641
|
tabIndex: 0,
|
|
1652
1642
|
"aria-hidden": "true",
|
|
1653
1643
|
leftContent: /* @__PURE__ */ e.jsx($, { as: ue, color: "inherit", size: "sm" }),
|
|
1654
|
-
ref:
|
|
1644
|
+
ref: a,
|
|
1655
1645
|
...r,
|
|
1656
|
-
onChange:
|
|
1646
|
+
onChange: s
|
|
1657
1647
|
}
|
|
1658
1648
|
);
|
|
1659
1649
|
});
|
|
@@ -1673,6 +1663,6 @@ export {
|
|
|
1673
1663
|
He as f,
|
|
1674
1664
|
Ze as g,
|
|
1675
1665
|
J as h,
|
|
1676
|
-
|
|
1666
|
+
at as i,
|
|
1677
1667
|
xt as j
|
|
1678
1668
|
};
|