@dimasbaguspm/versaur 0.0.54 → 0.0.56
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
|
|
2
|
-
import
|
|
3
|
-
import { I as
|
|
1
|
+
import { c as C, j as e, a as x } from "./index-DOdDlCoL.js";
|
|
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
|
+
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
32
|
-
const t =
|
|
31
|
+
), q = F(null), he = () => {
|
|
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 =
|
|
37
|
-
const
|
|
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(),
|
|
@@ -59,7 +59,7 @@ const fe = N("space-y-2", {
|
|
|
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
|
}),
|
|
@@ -80,7 +80,7 @@ const fe = N("space-y-2", {
|
|
|
80
80
|
] });
|
|
81
81
|
});
|
|
82
82
|
G.displayName = "CheckboxOption";
|
|
83
|
-
const K =
|
|
83
|
+
const K = m.forwardRef(
|
|
84
84
|
({
|
|
85
85
|
label: t,
|
|
86
86
|
helperText: r,
|
|
@@ -89,25 +89,25 @@ const K = b.forwardRef(
|
|
|
89
89
|
className: n,
|
|
90
90
|
disabled: o,
|
|
91
91
|
required: d,
|
|
92
|
-
children:
|
|
93
|
-
...
|
|
94
|
-
},
|
|
92
|
+
children: l,
|
|
93
|
+
...c
|
|
94
|
+
}, i) => {
|
|
95
95
|
const u = !!a, p = {
|
|
96
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:
|
|
101
|
+
ref: i,
|
|
102
102
|
disabled: o,
|
|
103
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: s }), children:
|
|
110
|
+
/* @__PURE__ */ e.jsx("div", { className: fe({ direction: s }), children: l }),
|
|
111
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
|
]
|
|
@@ -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
|
-
}), _ =
|
|
122
|
-
const t =
|
|
121
|
+
}), _ = F(null), be = () => {
|
|
122
|
+
const t = B(_);
|
|
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 =
|
|
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 =
|
|
143
|
-
const { size:
|
|
144
|
-
!f && !
|
|
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,12 +150,12 @@ const lt = Object.assign(K, {
|
|
|
150
150
|
ref: d,
|
|
151
151
|
type: "radio",
|
|
152
152
|
id: p,
|
|
153
|
-
name:
|
|
153
|
+
name: i.name,
|
|
154
154
|
value: n,
|
|
155
|
-
checked:
|
|
155
|
+
checked: b,
|
|
156
156
|
disabled: f,
|
|
157
|
-
readOnly:
|
|
158
|
-
onChange:
|
|
157
|
+
readOnly: h,
|
|
158
|
+
onChange: w,
|
|
159
159
|
className: "sr-only",
|
|
160
160
|
...o
|
|
161
161
|
}
|
|
@@ -164,15 +164,15 @@ const lt = Object.assign(K, {
|
|
|
164
164
|
"label",
|
|
165
165
|
{
|
|
166
166
|
htmlFor: p,
|
|
167
|
-
"data-selected":
|
|
168
|
-
style:
|
|
167
|
+
"data-selected": b,
|
|
168
|
+
style: c ? { maxWidth: c } : void 0,
|
|
169
169
|
className: x(
|
|
170
170
|
ge({
|
|
171
|
-
size:
|
|
171
|
+
size: l
|
|
172
172
|
}),
|
|
173
173
|
f && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
|
|
183
|
+
c && "truncate min-w-0"
|
|
184
184
|
),
|
|
185
185
|
children: t
|
|
186
186
|
}
|
|
@@ -188,7 +188,7 @@ const lt = Object.assign(K, {
|
|
|
188
188
|
}
|
|
189
189
|
)
|
|
190
190
|
] });
|
|
191
|
-
}), ye =
|
|
191
|
+
}), ye = O(
|
|
192
192
|
({
|
|
193
193
|
size: t = "md",
|
|
194
194
|
label: r,
|
|
@@ -197,53 +197,53 @@ const lt = Object.assign(K, {
|
|
|
197
197
|
error: n,
|
|
198
198
|
className: o,
|
|
199
199
|
disabled: d,
|
|
200
|
-
readOnly:
|
|
201
|
-
maxWidth:
|
|
202
|
-
name:
|
|
200
|
+
readOnly: l,
|
|
201
|
+
maxWidth: c,
|
|
202
|
+
name: i,
|
|
203
203
|
value: u,
|
|
204
204
|
onChange: p,
|
|
205
205
|
children: f,
|
|
206
|
-
...
|
|
207
|
-
},
|
|
208
|
-
const
|
|
206
|
+
...h
|
|
207
|
+
}, b) => {
|
|
208
|
+
const w = !!n, g = {
|
|
209
209
|
size: t,
|
|
210
210
|
disabled: d,
|
|
211
|
-
readOnly:
|
|
212
|
-
error:
|
|
213
|
-
name:
|
|
211
|
+
readOnly: l,
|
|
212
|
+
error: w,
|
|
213
|
+
name: i,
|
|
214
214
|
value: u,
|
|
215
|
-
maxWidth:
|
|
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:
|
|
221
|
+
ref: b,
|
|
222
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
|
-
|
|
232
|
-
!
|
|
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
|
) });
|
|
236
236
|
}
|
|
237
237
|
), dt = Object.assign(ye, {
|
|
238
238
|
Option: xe
|
|
239
|
-
}), H =
|
|
240
|
-
const t =
|
|
239
|
+
}), H = F(null), we = () => {
|
|
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
|
-
}, ve =
|
|
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,12 +257,12 @@ const lt = Object.assign(K, {
|
|
|
257
257
|
size: "md"
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
), je =
|
|
261
|
-
const { size:
|
|
262
|
-
if (!f && !
|
|
263
|
-
const
|
|
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
|
+
if (!f && !h) {
|
|
263
|
+
const k = i.value || [];
|
|
264
264
|
let v;
|
|
265
|
-
|
|
265
|
+
b ? v = k.filter((N) => N !== n) : v = [...k, n], i.onChange?.(v);
|
|
266
266
|
}
|
|
267
267
|
o.onChange?.(g);
|
|
268
268
|
};
|
|
@@ -273,12 +273,12 @@ const lt = Object.assign(K, {
|
|
|
273
273
|
ref: d,
|
|
274
274
|
type: "checkbox",
|
|
275
275
|
id: p,
|
|
276
|
-
name: `${
|
|
276
|
+
name: `${i.name}[]`,
|
|
277
277
|
value: n,
|
|
278
|
-
checked:
|
|
278
|
+
checked: b,
|
|
279
279
|
disabled: f,
|
|
280
|
-
readOnly:
|
|
281
|
-
onChange:
|
|
280
|
+
readOnly: h,
|
|
281
|
+
onChange: w,
|
|
282
282
|
className: "sr-only",
|
|
283
283
|
...o
|
|
284
284
|
}
|
|
@@ -287,15 +287,15 @@ const lt = Object.assign(K, {
|
|
|
287
287
|
"label",
|
|
288
288
|
{
|
|
289
289
|
htmlFor: p,
|
|
290
|
-
"data-selected":
|
|
291
|
-
style:
|
|
290
|
+
"data-selected": b,
|
|
291
|
+
style: c ? { maxWidth: c } : void 0,
|
|
292
292
|
className: x(
|
|
293
293
|
ve({
|
|
294
|
-
size:
|
|
294
|
+
size: l
|
|
295
295
|
}),
|
|
296
296
|
f && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
297
|
-
|
|
298
|
-
|
|
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
|
-
|
|
306
|
+
c && "truncate min-w-0"
|
|
307
307
|
),
|
|
308
308
|
children: t
|
|
309
309
|
}
|
|
@@ -311,7 +311,7 @@ const lt = Object.assign(K, {
|
|
|
311
311
|
}
|
|
312
312
|
)
|
|
313
313
|
] });
|
|
314
|
-
}), ke =
|
|
314
|
+
}), ke = O(
|
|
315
315
|
({
|
|
316
316
|
size: t = "md",
|
|
317
317
|
label: r,
|
|
@@ -320,46 +320,46 @@ const lt = Object.assign(K, {
|
|
|
320
320
|
error: n,
|
|
321
321
|
className: o,
|
|
322
322
|
disabled: d,
|
|
323
|
-
readOnly:
|
|
324
|
-
maxWidth:
|
|
325
|
-
name:
|
|
323
|
+
readOnly: l,
|
|
324
|
+
maxWidth: c,
|
|
325
|
+
name: i,
|
|
326
326
|
value: u = [],
|
|
327
327
|
onChange: p,
|
|
328
328
|
children: f,
|
|
329
|
-
...
|
|
330
|
-
},
|
|
331
|
-
const
|
|
329
|
+
...h
|
|
330
|
+
}, b) => {
|
|
331
|
+
const w = !!n, g = {
|
|
332
332
|
size: t,
|
|
333
333
|
disabled: d,
|
|
334
|
-
readOnly:
|
|
335
|
-
error:
|
|
336
|
-
name:
|
|
334
|
+
readOnly: l,
|
|
335
|
+
error: w,
|
|
336
|
+
name: i,
|
|
337
337
|
value: u,
|
|
338
|
-
maxWidth:
|
|
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:
|
|
344
|
+
ref: b,
|
|
345
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
|
-
|
|
355
|
-
!
|
|
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
361
|
Option: je
|
|
362
|
-
}), Ie =
|
|
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,7 +373,7 @@ const lt = Object.assign(K, {
|
|
|
373
373
|
state: "default"
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
), J =
|
|
376
|
+
), J = m.forwardRef(
|
|
377
377
|
({
|
|
378
378
|
label: t,
|
|
379
379
|
leftContent: r,
|
|
@@ -382,26 +382,27 @@ const lt = Object.assign(K, {
|
|
|
382
382
|
error: n,
|
|
383
383
|
className: o,
|
|
384
384
|
disabled: d,
|
|
385
|
-
id:
|
|
386
|
-
required:
|
|
387
|
-
value:
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
385
|
+
id: l,
|
|
386
|
+
required: c,
|
|
387
|
+
value: i,
|
|
388
|
+
displayValue: u,
|
|
389
|
+
placeholder: p = "",
|
|
390
|
+
name: f,
|
|
391
|
+
...h
|
|
392
|
+
}, b) => {
|
|
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(() => {
|
|
394
|
+
const z = [];
|
|
395
|
+
return N ? z.push(v) : s && z.push(k), z.length > 0 ? z.join(" ") : void 0;
|
|
396
|
+
}, [N, s, v, k]);
|
|
396
397
|
return /* @__PURE__ */ e.jsxs("div", { className: x("w-full", o), children: [
|
|
397
398
|
t && /* @__PURE__ */ e.jsxs(
|
|
398
399
|
"label",
|
|
399
400
|
{
|
|
400
|
-
htmlFor:
|
|
401
|
+
htmlFor: g,
|
|
401
402
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
402
403
|
children: [
|
|
403
404
|
t,
|
|
404
|
-
|
|
405
|
+
c && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
405
406
|
]
|
|
406
407
|
}
|
|
407
408
|
),
|
|
@@ -418,24 +419,24 @@ const lt = Object.assign(K, {
|
|
|
418
419
|
/* @__PURE__ */ e.jsx(
|
|
419
420
|
"button",
|
|
420
421
|
{
|
|
421
|
-
ref:
|
|
422
|
-
id:
|
|
422
|
+
ref: b,
|
|
423
|
+
id: g,
|
|
423
424
|
type: "button",
|
|
424
425
|
disabled: d,
|
|
425
|
-
"aria-invalid":
|
|
426
|
-
"aria-describedby":
|
|
427
|
-
"aria-errormessage":
|
|
428
|
-
"aria-required":
|
|
426
|
+
"aria-invalid": N || void 0,
|
|
427
|
+
"aria-describedby": E,
|
|
428
|
+
"aria-errormessage": N ? v : void 0,
|
|
429
|
+
"aria-required": c || void 0,
|
|
429
430
|
className: x(
|
|
430
431
|
Ie({
|
|
431
|
-
state:
|
|
432
|
+
state: N ? "error" : "default"
|
|
432
433
|
}),
|
|
433
434
|
r ? "pl-9" : "pl-3",
|
|
434
435
|
a ? "pr-9" : "pr-3",
|
|
435
436
|
"h-9",
|
|
436
|
-
!
|
|
437
|
+
!S && "text-gray-400"
|
|
437
438
|
),
|
|
438
|
-
...
|
|
439
|
+
...h,
|
|
439
440
|
children: V
|
|
440
441
|
}
|
|
441
442
|
),
|
|
@@ -448,28 +449,28 @@ const lt = Object.assign(K, {
|
|
|
448
449
|
children: a
|
|
449
450
|
}
|
|
450
451
|
),
|
|
451
|
-
|
|
452
|
+
f && /* @__PURE__ */ e.jsx(
|
|
452
453
|
"input",
|
|
453
454
|
{
|
|
454
455
|
type: "hidden",
|
|
455
|
-
name:
|
|
456
|
-
value:
|
|
456
|
+
name: f,
|
|
457
|
+
value: R,
|
|
457
458
|
readOnly: !0,
|
|
458
459
|
"data-testid": "hidden-input"
|
|
459
460
|
}
|
|
460
461
|
)
|
|
461
462
|
] }),
|
|
462
|
-
|
|
463
|
+
N && /* @__PURE__ */ e.jsx(
|
|
463
464
|
"div",
|
|
464
465
|
{
|
|
465
|
-
id:
|
|
466
|
+
id: v,
|
|
466
467
|
className: "mt-1 text-sm text-danger",
|
|
467
468
|
role: "alert",
|
|
468
469
|
"aria-live": "polite",
|
|
469
470
|
children: n
|
|
470
471
|
}
|
|
471
472
|
),
|
|
472
|
-
!
|
|
473
|
+
!N && s && /* @__PURE__ */ e.jsx("div", { id: k, className: "mt-1 text-sm text-gray-600", children: s })
|
|
473
474
|
] });
|
|
474
475
|
}
|
|
475
476
|
);
|
|
@@ -483,24 +484,25 @@ function Ne(t) {
|
|
|
483
484
|
day: "numeric"
|
|
484
485
|
});
|
|
485
486
|
}
|
|
486
|
-
const ft =
|
|
487
|
-
const
|
|
488
|
-
|
|
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);
|
|
489
490
|
}, p = () => {
|
|
490
|
-
|
|
491
|
-
}, f = (
|
|
492
|
-
a(
|
|
493
|
-
},
|
|
491
|
+
i.current && (typeof i.current.showPicker == "function" ? i.current.showPicker() : i.current.focus());
|
|
492
|
+
}, f = (b) => {
|
|
493
|
+
a(b.target.value);
|
|
494
|
+
}, h = (n ?? Ne)(r);
|
|
494
495
|
return /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
495
496
|
/* @__PURE__ */ e.jsx(
|
|
496
497
|
J,
|
|
497
498
|
{
|
|
498
499
|
onClick: p,
|
|
499
|
-
value:
|
|
500
|
+
value: r,
|
|
501
|
+
displayValue: h,
|
|
500
502
|
label: s,
|
|
501
|
-
leftContent: /* @__PURE__ */ e.jsx(
|
|
503
|
+
leftContent: /* @__PURE__ */ e.jsx($, { as: oe, color: "inherit", size: "sm" }),
|
|
502
504
|
"data-testid": "date-single-picker-visible-input",
|
|
503
|
-
...
|
|
505
|
+
...l
|
|
504
506
|
}
|
|
505
507
|
),
|
|
506
508
|
/* @__PURE__ */ e.jsx(
|
|
@@ -518,7 +520,7 @@ const ft = b.forwardRef(function({ value: r = "", onChange: a, label: s, formatt
|
|
|
518
520
|
}
|
|
519
521
|
)
|
|
520
522
|
] });
|
|
521
|
-
}), Ce =
|
|
523
|
+
}), Ce = C(
|
|
522
524
|
"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
525
|
{
|
|
524
526
|
variants: {
|
|
@@ -532,7 +534,7 @@ const ft = b.forwardRef(function({ value: r = "", onChange: a, label: s, formatt
|
|
|
532
534
|
state: "default"
|
|
533
535
|
}
|
|
534
536
|
}
|
|
535
|
-
),
|
|
537
|
+
), M = m.forwardRef(
|
|
536
538
|
({
|
|
537
539
|
label: t,
|
|
538
540
|
leftContent: r,
|
|
@@ -541,24 +543,24 @@ const ft = b.forwardRef(function({ value: r = "", onChange: a, label: s, formatt
|
|
|
541
543
|
error: n,
|
|
542
544
|
className: o,
|
|
543
545
|
disabled: d,
|
|
544
|
-
readOnly:
|
|
545
|
-
id:
|
|
546
|
-
required:
|
|
546
|
+
readOnly: l,
|
|
547
|
+
id: c,
|
|
548
|
+
required: i,
|
|
547
549
|
...u
|
|
548
550
|
}, p) => {
|
|
549
|
-
const f =
|
|
551
|
+
const f = m.useId(), h = c || f, b = `${h}-helper`, w = `${h}-error`, g = !!n, k = m.useMemo(() => {
|
|
550
552
|
const v = [];
|
|
551
|
-
return g ? v.push(
|
|
552
|
-
}, [g, s,
|
|
553
|
+
return g ? v.push(w) : s && v.push(b), v.length > 0 ? v.join(" ") : void 0;
|
|
554
|
+
}, [g, s, w, b]);
|
|
553
555
|
return /* @__PURE__ */ e.jsxs("div", { className: x("w-full", o), children: [
|
|
554
556
|
t && /* @__PURE__ */ e.jsxs(
|
|
555
557
|
"label",
|
|
556
558
|
{
|
|
557
|
-
htmlFor:
|
|
559
|
+
htmlFor: h,
|
|
558
560
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
559
561
|
children: [
|
|
560
562
|
t,
|
|
561
|
-
|
|
563
|
+
i && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
562
564
|
]
|
|
563
565
|
}
|
|
564
566
|
),
|
|
@@ -576,16 +578,16 @@ const ft = b.forwardRef(function({ value: r = "", onChange: a, label: s, formatt
|
|
|
576
578
|
"input",
|
|
577
579
|
{
|
|
578
580
|
ref: p,
|
|
579
|
-
id:
|
|
580
|
-
required:
|
|
581
|
+
id: h,
|
|
582
|
+
required: i,
|
|
581
583
|
disabled: d,
|
|
582
|
-
readOnly:
|
|
584
|
+
readOnly: l,
|
|
583
585
|
"aria-invalid": g,
|
|
584
|
-
"aria-describedby":
|
|
585
|
-
"aria-errormessage": g ?
|
|
586
|
+
"aria-describedby": k,
|
|
587
|
+
"aria-errormessage": g ? w : void 0,
|
|
586
588
|
className: x(
|
|
587
589
|
Ce({
|
|
588
|
-
state: g ? "error" :
|
|
590
|
+
state: g ? "error" : l ? "readOnly" : "default"
|
|
589
591
|
}),
|
|
590
592
|
r ? "pl-9" : "pl-3",
|
|
591
593
|
a ? "pr-9" : "pr-3",
|
|
@@ -607,31 +609,31 @@ const ft = b.forwardRef(function({ value: r = "", onChange: a, label: s, formatt
|
|
|
607
609
|
g && /* @__PURE__ */ e.jsx(
|
|
608
610
|
"div",
|
|
609
611
|
{
|
|
610
|
-
id:
|
|
612
|
+
id: w,
|
|
611
613
|
className: "mt-1 text-sm text-danger",
|
|
612
614
|
role: "alert",
|
|
613
615
|
"aria-live": "polite",
|
|
614
616
|
children: n
|
|
615
617
|
}
|
|
616
618
|
),
|
|
617
|
-
!g && s && /* @__PURE__ */ e.jsx("div", { id:
|
|
619
|
+
!g && s && /* @__PURE__ */ e.jsx("div", { id: b, className: "mt-1 text-sm text-gray-600", children: s })
|
|
618
620
|
] });
|
|
619
621
|
}
|
|
620
622
|
);
|
|
621
|
-
|
|
622
|
-
const pt =
|
|
623
|
+
M.displayName = "TextInput";
|
|
624
|
+
const pt = O(
|
|
623
625
|
(t, r) => /* @__PURE__ */ e.jsx(
|
|
624
|
-
|
|
626
|
+
M,
|
|
625
627
|
{
|
|
626
628
|
...t,
|
|
627
629
|
ref: r,
|
|
628
630
|
type: "email",
|
|
629
631
|
autoComplete: "email",
|
|
630
632
|
inputMode: "email",
|
|
631
|
-
leftContent: /* @__PURE__ */ e.jsx(
|
|
633
|
+
leftContent: /* @__PURE__ */ e.jsx($, { as: ie, color: "inherit", size: "sm" })
|
|
632
634
|
}
|
|
633
635
|
)
|
|
634
|
-
),
|
|
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(
|
|
635
637
|
({
|
|
636
638
|
value: t,
|
|
637
639
|
onChange: r,
|
|
@@ -640,23 +642,23 @@ const pt = z(
|
|
|
640
642
|
onPaste: n,
|
|
641
643
|
disabled: o,
|
|
642
644
|
error: d,
|
|
643
|
-
secure:
|
|
644
|
-
inputRef:
|
|
645
|
-
index:
|
|
645
|
+
secure: l,
|
|
646
|
+
inputRef: c,
|
|
647
|
+
index: i,
|
|
646
648
|
id: u
|
|
647
649
|
}, p) => /* @__PURE__ */ e.jsx(
|
|
648
650
|
"input",
|
|
649
651
|
{
|
|
650
|
-
ref:
|
|
652
|
+
ref: c,
|
|
651
653
|
id: u,
|
|
652
654
|
type: "text",
|
|
653
655
|
inputMode: "numeric",
|
|
654
|
-
pattern:
|
|
656
|
+
pattern: l ? void 0 : "[0-9]*",
|
|
655
657
|
maxLength: 1,
|
|
656
|
-
value:
|
|
658
|
+
value: l ? t ? "•" : "" : t,
|
|
657
659
|
onChange: (f) => {
|
|
658
|
-
const
|
|
659
|
-
(
|
|
660
|
+
const h = f.target.value;
|
|
661
|
+
(h === "" || Se(h)) && r(h);
|
|
660
662
|
},
|
|
661
663
|
onKeyDown: a,
|
|
662
664
|
onFocus: s,
|
|
@@ -664,14 +666,14 @@ const pt = z(
|
|
|
664
666
|
disabled: o,
|
|
665
667
|
"aria-invalid": d,
|
|
666
668
|
"aria-disabled": o,
|
|
667
|
-
className: d ?
|
|
669
|
+
className: d ? Ve : Re,
|
|
668
670
|
autoComplete: "one-time-code",
|
|
669
|
-
"data-testid": `pin-input-${
|
|
671
|
+
"data-testid": `pin-input-${i}`
|
|
670
672
|
}
|
|
671
673
|
)
|
|
672
674
|
);
|
|
673
675
|
Q.displayName = "PinInput";
|
|
674
|
-
const De =
|
|
676
|
+
const De = m.forwardRef(
|
|
675
677
|
({
|
|
676
678
|
label: t,
|
|
677
679
|
helperText: r,
|
|
@@ -680,60 +682,60 @@ const De = b.forwardRef(
|
|
|
680
682
|
value: n,
|
|
681
683
|
onChange: o,
|
|
682
684
|
onComplete: d,
|
|
683
|
-
digits:
|
|
684
|
-
className:
|
|
685
|
-
id:
|
|
685
|
+
digits: l = 6,
|
|
686
|
+
className: c,
|
|
687
|
+
id: i,
|
|
686
688
|
name: u,
|
|
687
689
|
required: p,
|
|
688
690
|
secure: f = !1,
|
|
689
|
-
...
|
|
690
|
-
},
|
|
691
|
-
const
|
|
692
|
-
(
|
|
693
|
-
const
|
|
694
|
-
o(
|
|
691
|
+
...h
|
|
692
|
+
}, b) => {
|
|
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);
|
|
695
697
|
},
|
|
696
|
-
[o, d,
|
|
697
|
-
),
|
|
698
|
-
(
|
|
699
|
-
const I = [...
|
|
700
|
-
I[
|
|
701
|
-
const
|
|
702
|
-
|
|
698
|
+
[o, d, l]
|
|
699
|
+
), S = m.useCallback(
|
|
700
|
+
(j, y) => {
|
|
701
|
+
const I = [...V];
|
|
702
|
+
I[j] = y;
|
|
703
|
+
const D = I.join("").replace(/\s+$/, "");
|
|
704
|
+
R(D), y && j < l - 1 && v.current[j + 1]?.focus();
|
|
703
705
|
},
|
|
704
|
-
[
|
|
705
|
-
),
|
|
706
|
-
(
|
|
707
|
-
if (
|
|
708
|
-
if (!
|
|
709
|
-
|
|
710
|
-
const I = [...
|
|
711
|
-
I[
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
} else if (
|
|
715
|
-
|
|
716
|
-
const I = [...
|
|
717
|
-
I[
|
|
718
|
-
const
|
|
719
|
-
|
|
706
|
+
[V, R, l]
|
|
707
|
+
), E = m.useCallback(
|
|
708
|
+
(j, y) => {
|
|
709
|
+
if (y.key === "Backspace") {
|
|
710
|
+
if (!V[j] && j > 0) {
|
|
711
|
+
y.preventDefault();
|
|
712
|
+
const I = [...V];
|
|
713
|
+
I[j - 1] = "";
|
|
714
|
+
const D = I.join("").replace(/\s+$/, "");
|
|
715
|
+
R(D), v.current[j - 1]?.focus();
|
|
716
|
+
} else if (V[j]) {
|
|
717
|
+
y.preventDefault();
|
|
718
|
+
const I = [...V];
|
|
719
|
+
I[j] = "";
|
|
720
|
+
const D = I.join("").replace(/\s+$/, "");
|
|
721
|
+
R(D);
|
|
720
722
|
}
|
|
721
|
-
} else
|
|
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());
|
|
722
724
|
},
|
|
723
|
-
[
|
|
724
|
-
),
|
|
725
|
-
(
|
|
726
|
-
|
|
727
|
-
const
|
|
725
|
+
[V, R, l]
|
|
726
|
+
), z = m.useCallback(
|
|
727
|
+
(j) => {
|
|
728
|
+
j.preventDefault();
|
|
729
|
+
const y = j.clipboardData.getData("text"), I = W(y, l);
|
|
728
730
|
if (I.length > 0) {
|
|
729
|
-
|
|
730
|
-
const
|
|
731
|
-
v.current[
|
|
731
|
+
R(I);
|
|
732
|
+
const D = Math.min(I.length, l - 1);
|
|
733
|
+
v.current[D]?.focus();
|
|
732
734
|
}
|
|
733
735
|
},
|
|
734
|
-
[
|
|
736
|
+
[R, l]
|
|
735
737
|
);
|
|
736
|
-
return /* @__PURE__ */ e.jsxs("div", { ref:
|
|
738
|
+
return /* @__PURE__ */ e.jsxs("div", { ref: b, className: x("w-full", c), ...h, children: [
|
|
737
739
|
t && /* @__PURE__ */ e.jsxs(
|
|
738
740
|
"label",
|
|
739
741
|
{
|
|
@@ -751,28 +753,28 @@ const De = b.forwardRef(
|
|
|
751
753
|
className: "flex gap-2 justify-center",
|
|
752
754
|
role: "group",
|
|
753
755
|
"aria-labelledby": t ? `${g}-label` : void 0,
|
|
754
|
-
"aria-describedby":
|
|
755
|
-
children:
|
|
756
|
+
"aria-describedby": k ? `${g}-error` : r ? `${g}-helper` : void 0,
|
|
757
|
+
children: V.map((j, y) => /* @__PURE__ */ e.jsx(
|
|
756
758
|
Q,
|
|
757
759
|
{
|
|
758
|
-
value:
|
|
759
|
-
onChange: (I) =>
|
|
760
|
-
onKeyDown: (I) =>
|
|
760
|
+
value: j,
|
|
761
|
+
onChange: (I) => S(y, I),
|
|
762
|
+
onKeyDown: (I) => E(y, I),
|
|
761
763
|
onFocus: () => {
|
|
762
|
-
const I = v.current[
|
|
764
|
+
const I = v.current[y];
|
|
763
765
|
I && I.select();
|
|
764
766
|
},
|
|
765
|
-
onPaste:
|
|
767
|
+
onPaste: z,
|
|
766
768
|
disabled: s,
|
|
767
|
-
error:
|
|
769
|
+
error: k,
|
|
768
770
|
secure: f,
|
|
769
771
|
inputRef: (I) => {
|
|
770
|
-
v.current[
|
|
772
|
+
v.current[y] = I;
|
|
771
773
|
},
|
|
772
|
-
index:
|
|
773
|
-
id: `${g}-${
|
|
774
|
+
index: y,
|
|
775
|
+
id: `${g}-${y}`
|
|
774
776
|
},
|
|
775
|
-
|
|
777
|
+
y
|
|
776
778
|
))
|
|
777
779
|
}
|
|
778
780
|
),
|
|
@@ -781,11 +783,11 @@ const De = b.forwardRef(
|
|
|
781
783
|
{
|
|
782
784
|
type: "hidden",
|
|
783
785
|
name: u,
|
|
784
|
-
value:
|
|
786
|
+
value: N,
|
|
785
787
|
required: p
|
|
786
788
|
}
|
|
787
789
|
),
|
|
788
|
-
|
|
790
|
+
k && /* @__PURE__ */ e.jsx(
|
|
789
791
|
"div",
|
|
790
792
|
{
|
|
791
793
|
id: `${g}-error`,
|
|
@@ -794,7 +796,7 @@ const De = b.forwardRef(
|
|
|
794
796
|
children: a
|
|
795
797
|
}
|
|
796
798
|
),
|
|
797
|
-
!
|
|
799
|
+
!k && r && /* @__PURE__ */ e.jsx("div", { id: `${g}-helper`, className: "mt-2 text-sm text-gray-600", children: r })
|
|
798
800
|
] });
|
|
799
801
|
}
|
|
800
802
|
);
|
|
@@ -840,8 +842,8 @@ function U(t, r = !1) {
|
|
|
840
842
|
let n = (a ? t.slice(1) : t).replace(/[^\d.,]/g, "");
|
|
841
843
|
const o = n.lastIndexOf(",");
|
|
842
844
|
if (o !== -1) {
|
|
843
|
-
const d = n.slice(0, o).replace(/,/g, ""),
|
|
844
|
-
n = d + "," +
|
|
845
|
+
const d = n.slice(0, o).replace(/,/g, ""), l = n.slice(o + 1).replace(/,/g, "");
|
|
846
|
+
n = d + "," + l;
|
|
845
847
|
}
|
|
846
848
|
return n = n.replace(/\.{2,}/g, "."), (a ? "-" : "") + n;
|
|
847
849
|
}
|
|
@@ -853,36 +855,36 @@ const mt = ({
|
|
|
853
855
|
label: n,
|
|
854
856
|
helperText: o,
|
|
855
857
|
error: d,
|
|
856
|
-
...
|
|
858
|
+
...l
|
|
857
859
|
}) => {
|
|
858
|
-
const
|
|
860
|
+
const c = T(null), [i, u] = se(
|
|
859
861
|
t === "" ? "" : String(t)
|
|
860
862
|
);
|
|
861
863
|
ze(t, u);
|
|
862
864
|
const p = (f) => {
|
|
863
|
-
const
|
|
864
|
-
Oe(
|
|
865
|
+
const h = f.target.value, b = U(h, a);
|
|
866
|
+
Oe(b, a) ? (u(b), r(b)) : f.preventDefault();
|
|
865
867
|
};
|
|
866
868
|
return /* @__PURE__ */ e.jsx(
|
|
867
|
-
|
|
869
|
+
M,
|
|
868
870
|
{
|
|
869
|
-
ref:
|
|
871
|
+
ref: c,
|
|
870
872
|
type: "text",
|
|
871
873
|
label: n,
|
|
872
|
-
value:
|
|
874
|
+
value: i,
|
|
873
875
|
onChange: p,
|
|
874
876
|
error: d,
|
|
875
877
|
helperText: o,
|
|
876
|
-
placeholder:
|
|
877
|
-
leftContent: /* @__PURE__ */ e.jsx(
|
|
878
|
+
placeholder: l.placeholder,
|
|
879
|
+
leftContent: /* @__PURE__ */ e.jsx($, { as: ce, color: "inherit", size: "sm" }),
|
|
878
880
|
inputMode: "numeric",
|
|
879
881
|
autoComplete: "off",
|
|
880
882
|
pattern: "[0-9.,-]*",
|
|
881
883
|
...s,
|
|
882
|
-
...
|
|
884
|
+
...l
|
|
883
885
|
}
|
|
884
886
|
);
|
|
885
|
-
}, Ee =
|
|
887
|
+
}, Ee = C("space-y-2", {
|
|
886
888
|
variants: {
|
|
887
889
|
direction: {
|
|
888
890
|
vertical: "space-y-2 space-x-0",
|
|
@@ -892,7 +894,7 @@ const mt = ({
|
|
|
892
894
|
defaultVariants: {
|
|
893
895
|
direction: "vertical"
|
|
894
896
|
}
|
|
895
|
-
}),
|
|
897
|
+
}), Me = C(
|
|
896
898
|
"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
899
|
{
|
|
898
900
|
variants: {
|
|
@@ -930,7 +932,7 @@ const mt = ({
|
|
|
930
932
|
size: "md"
|
|
931
933
|
}
|
|
932
934
|
}
|
|
933
|
-
),
|
|
935
|
+
), Fe = C(
|
|
934
936
|
"text-foreground cursor-pointer select-none",
|
|
935
937
|
{
|
|
936
938
|
variants: {
|
|
@@ -949,39 +951,39 @@ const mt = ({
|
|
|
949
951
|
disabled: !1
|
|
950
952
|
}
|
|
951
953
|
}
|
|
952
|
-
), X =
|
|
954
|
+
), X = F(
|
|
953
955
|
null
|
|
954
|
-
),
|
|
955
|
-
const t =
|
|
956
|
+
), Be = () => {
|
|
957
|
+
const t = B(X);
|
|
956
958
|
if (!t)
|
|
957
959
|
throw new Error(
|
|
958
960
|
"useRadioInputContext must be used within RadioInputContext"
|
|
959
961
|
);
|
|
960
962
|
return t;
|
|
961
|
-
}, Ae =
|
|
962
|
-
({ children: t, description: r, className: a, disabled: s, id: n, value: o, ...d },
|
|
963
|
-
const
|
|
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";
|
|
964
966
|
return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
965
967
|
/* @__PURE__ */ e.jsx("div", { className: "relative flex items-center", children: /* @__PURE__ */ e.jsx(
|
|
966
968
|
"input",
|
|
967
969
|
{
|
|
968
|
-
ref:
|
|
970
|
+
ref: l,
|
|
969
971
|
type: "radio",
|
|
970
972
|
id: u,
|
|
971
|
-
name:
|
|
973
|
+
name: c.name,
|
|
972
974
|
value: o,
|
|
973
975
|
disabled: p,
|
|
974
976
|
className: x(
|
|
975
|
-
|
|
977
|
+
Me({
|
|
976
978
|
variant: f,
|
|
977
|
-
size:
|
|
979
|
+
size: c.size
|
|
978
980
|
}),
|
|
979
981
|
// Custom radio dot styling using ::before - centered positioning with size variants
|
|
980
982
|
'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
983
|
// Size-specific radio dot dimensions
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
984
|
+
c.size === "sm" && "before:w-[6px] before:h-[6px]",
|
|
985
|
+
c.size === "md" && "before:w-[8px] before:h-[8px]",
|
|
986
|
+
c.size === "lg" && "before:w-[10px] before:h-[10px]",
|
|
985
987
|
"checked:before:opacity-100",
|
|
986
988
|
// Outline variants use colored radio dot
|
|
987
989
|
f?.includes("outline") && "checked:before:bg-current",
|
|
@@ -995,8 +997,8 @@ const mt = ({
|
|
|
995
997
|
"label",
|
|
996
998
|
{
|
|
997
999
|
htmlFor: u,
|
|
998
|
-
className:
|
|
999
|
-
size:
|
|
1000
|
+
className: Fe({
|
|
1001
|
+
size: c.size,
|
|
1000
1002
|
disabled: p
|
|
1001
1003
|
}),
|
|
1002
1004
|
children: t
|
|
@@ -1007,9 +1009,9 @@ const mt = ({
|
|
|
1007
1009
|
{
|
|
1008
1010
|
className: x(
|
|
1009
1011
|
"text-gray-600 mt-1",
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1012
|
+
c.size === "sm" && "text-xs",
|
|
1013
|
+
c.size === "md" && "text-xs",
|
|
1014
|
+
c.size === "lg" && "text-sm",
|
|
1013
1015
|
p && "opacity-50"
|
|
1014
1016
|
),
|
|
1015
1017
|
children: r
|
|
@@ -1018,7 +1020,7 @@ const mt = ({
|
|
|
1018
1020
|
] })
|
|
1019
1021
|
] });
|
|
1020
1022
|
}
|
|
1021
|
-
), We =
|
|
1023
|
+
), We = m.forwardRef(
|
|
1022
1024
|
({
|
|
1023
1025
|
variant: t = "primary",
|
|
1024
1026
|
size: r = "md",
|
|
@@ -1027,28 +1029,28 @@ const mt = ({
|
|
|
1027
1029
|
error: n,
|
|
1028
1030
|
direction: o = "vertical",
|
|
1029
1031
|
className: d,
|
|
1030
|
-
disabled:
|
|
1031
|
-
name:
|
|
1032
|
-
children:
|
|
1032
|
+
disabled: l,
|
|
1033
|
+
name: c,
|
|
1034
|
+
children: i,
|
|
1033
1035
|
...u
|
|
1034
1036
|
}, p) => {
|
|
1035
|
-
const f = !!n,
|
|
1037
|
+
const f = !!n, h = {
|
|
1036
1038
|
variant: t,
|
|
1037
1039
|
size: r,
|
|
1038
|
-
disabled:
|
|
1040
|
+
disabled: l,
|
|
1039
1041
|
error: f,
|
|
1040
|
-
name:
|
|
1042
|
+
name: c
|
|
1041
1043
|
};
|
|
1042
|
-
return /* @__PURE__ */ e.jsx(X.Provider, { value:
|
|
1044
|
+
return /* @__PURE__ */ e.jsx(X.Provider, { value: h, children: /* @__PURE__ */ e.jsxs("div", { ref: p, className: x("w-full", d), ...u, children: [
|
|
1043
1045
|
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:
|
|
1046
|
+
/* @__PURE__ */ e.jsx("div", { className: Ee({ direction: o }), children: i }),
|
|
1045
1047
|
f && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
|
|
1046
1048
|
!f && s && /* @__PURE__ */ e.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
|
|
1047
1049
|
] }) });
|
|
1048
1050
|
}
|
|
1049
1051
|
), ht = Object.assign(We, {
|
|
1050
1052
|
Option: Ae
|
|
1051
|
-
}), bt =
|
|
1053
|
+
}), bt = O(
|
|
1052
1054
|
({
|
|
1053
1055
|
autoComplete: t = "off",
|
|
1054
1056
|
spellCheck: r = !1,
|
|
@@ -1058,11 +1060,11 @@ const mt = ({
|
|
|
1058
1060
|
enterKeyHint: o = "search",
|
|
1059
1061
|
"aria-label": d = "Search",
|
|
1060
1062
|
// internal default, not in props
|
|
1061
|
-
...
|
|
1062
|
-
},
|
|
1063
|
-
|
|
1063
|
+
...l
|
|
1064
|
+
}, c) => /* @__PURE__ */ e.jsx(
|
|
1065
|
+
M,
|
|
1064
1066
|
{
|
|
1065
|
-
ref:
|
|
1067
|
+
ref: c,
|
|
1066
1068
|
type: "search",
|
|
1067
1069
|
inputMode: a,
|
|
1068
1070
|
autoComplete: t,
|
|
@@ -1071,11 +1073,11 @@ const mt = ({
|
|
|
1071
1073
|
maxLength: n,
|
|
1072
1074
|
enterKeyHint: o,
|
|
1073
1075
|
"aria-label": d,
|
|
1074
|
-
leftContent: /* @__PURE__ */ e.jsx(
|
|
1075
|
-
...
|
|
1076
|
+
leftContent: /* @__PURE__ */ e.jsx($, { as: le, color: "inherit", size: "sm" }),
|
|
1077
|
+
...l
|
|
1076
1078
|
}
|
|
1077
1079
|
)
|
|
1078
|
-
), Le =
|
|
1080
|
+
), Le = C(
|
|
1079
1081
|
"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
1082
|
{
|
|
1081
1083
|
variants: {
|
|
@@ -1089,11 +1091,11 @@ const mt = ({
|
|
|
1089
1091
|
state: "default"
|
|
1090
1092
|
}
|
|
1091
1093
|
}
|
|
1092
|
-
), Y =
|
|
1094
|
+
), Y = m.forwardRef(({ value: t, children: r, ...a }, s) => /* @__PURE__ */ e.jsx("option", { ref: s, value: t, ...a, children: r }));
|
|
1093
1095
|
Y.displayName = "SelectOption";
|
|
1094
|
-
const Z =
|
|
1096
|
+
const Z = m.forwardRef(({ label: t, children: r, ...a }, s) => /* @__PURE__ */ e.jsx("optgroup", { ref: s, label: t, ...a, children: r }));
|
|
1095
1097
|
Z.displayName = "SelectOptionGroup";
|
|
1096
|
-
const ee =
|
|
1098
|
+
const ee = m.forwardRef(
|
|
1097
1099
|
({
|
|
1098
1100
|
label: t,
|
|
1099
1101
|
helperText: r,
|
|
@@ -1102,25 +1104,25 @@ const ee = b.forwardRef(
|
|
|
1102
1104
|
disabled: n,
|
|
1103
1105
|
readOnly: o,
|
|
1104
1106
|
id: d,
|
|
1105
|
-
required:
|
|
1106
|
-
placeholder:
|
|
1107
|
-
children:
|
|
1107
|
+
required: l,
|
|
1108
|
+
placeholder: c,
|
|
1109
|
+
children: i,
|
|
1108
1110
|
onChange: u,
|
|
1109
1111
|
...p
|
|
1110
1112
|
}, f) => {
|
|
1111
|
-
const
|
|
1112
|
-
const
|
|
1113
|
-
return
|
|
1114
|
-
}, [
|
|
1113
|
+
const h = m.useId(), b = d || h, w = `${b}-helper`, g = `${b}-error`, k = !!a, v = m.useMemo(() => {
|
|
1114
|
+
const N = [];
|
|
1115
|
+
return k ? N.push(g) : r && N.push(w), N.length > 0 ? N.join(" ") : void 0;
|
|
1116
|
+
}, [k, r, g, w]);
|
|
1115
1117
|
return /* @__PURE__ */ e.jsxs("div", { className: x("w-full", s), children: [
|
|
1116
1118
|
t && /* @__PURE__ */ e.jsxs(
|
|
1117
1119
|
"label",
|
|
1118
1120
|
{
|
|
1119
|
-
htmlFor:
|
|
1121
|
+
htmlFor: b,
|
|
1120
1122
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
1121
1123
|
children: [
|
|
1122
1124
|
t,
|
|
1123
|
-
|
|
1125
|
+
l && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
1124
1126
|
]
|
|
1125
1127
|
}
|
|
1126
1128
|
),
|
|
@@ -1129,23 +1131,23 @@ const ee = b.forwardRef(
|
|
|
1129
1131
|
"select",
|
|
1130
1132
|
{
|
|
1131
1133
|
ref: f,
|
|
1132
|
-
id:
|
|
1133
|
-
required:
|
|
1134
|
+
id: b,
|
|
1135
|
+
required: l,
|
|
1134
1136
|
disabled: n || o,
|
|
1135
|
-
"aria-invalid":
|
|
1137
|
+
"aria-invalid": k,
|
|
1136
1138
|
"aria-describedby": v,
|
|
1137
|
-
"aria-errormessage":
|
|
1139
|
+
"aria-errormessage": k ? g : void 0,
|
|
1138
1140
|
onChange: u,
|
|
1139
1141
|
className: x(
|
|
1140
1142
|
Le({
|
|
1141
|
-
state:
|
|
1143
|
+
state: k ? "error" : o ? "readOnly" : "default"
|
|
1142
1144
|
}),
|
|
1143
1145
|
"h-9 pl-3"
|
|
1144
1146
|
),
|
|
1145
1147
|
...p,
|
|
1146
1148
|
children: [
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
+
c && /* @__PURE__ */ e.jsx("option", { value: "", disabled: !0, hidden: !0, children: c }),
|
|
1150
|
+
i
|
|
1149
1151
|
]
|
|
1150
1152
|
}
|
|
1151
1153
|
),
|
|
@@ -1155,11 +1157,11 @@ const ee = b.forwardRef(
|
|
|
1155
1157
|
className: x(
|
|
1156
1158
|
"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none transition-transform duration-200"
|
|
1157
1159
|
),
|
|
1158
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1160
|
+
children: /* @__PURE__ */ e.jsx($, { as: de, size: "sm", color: "gray", "aria-hidden": "true" })
|
|
1159
1161
|
}
|
|
1160
1162
|
)
|
|
1161
1163
|
] }),
|
|
1162
|
-
|
|
1164
|
+
k && /* @__PURE__ */ e.jsx(
|
|
1163
1165
|
"div",
|
|
1164
1166
|
{
|
|
1165
1167
|
id: g,
|
|
@@ -1169,7 +1171,7 @@ const ee = b.forwardRef(
|
|
|
1169
1171
|
children: a
|
|
1170
1172
|
}
|
|
1171
1173
|
),
|
|
1172
|
-
!
|
|
1174
|
+
!k && r && /* @__PURE__ */ e.jsx("div", { id: w, className: "mt-1 text-sm text-gray-600", children: r })
|
|
1173
1175
|
] });
|
|
1174
1176
|
}
|
|
1175
1177
|
);
|
|
@@ -1177,7 +1179,7 @@ ee.displayName = "SelectInput";
|
|
|
1177
1179
|
const gt = Object.assign(ee, {
|
|
1178
1180
|
Option: Y,
|
|
1179
1181
|
OptionGroup: Z
|
|
1180
|
-
}), Te =
|
|
1182
|
+
}), Te = C(
|
|
1181
1183
|
"flex gap-3 cursor-pointer border-b border-border select-none transition-colors",
|
|
1182
1184
|
{
|
|
1183
1185
|
variants: {
|
|
@@ -1206,7 +1208,7 @@ const gt = Object.assign(ee, {
|
|
|
1206
1208
|
hideCheckbox: !1
|
|
1207
1209
|
}
|
|
1208
1210
|
}
|
|
1209
|
-
), qe =
|
|
1211
|
+
), qe = C(
|
|
1210
1212
|
"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
1213
|
{
|
|
1212
1214
|
variants: {
|
|
@@ -1224,7 +1226,7 @@ const gt = Object.assign(ee, {
|
|
|
1224
1226
|
disabled: !1
|
|
1225
1227
|
}
|
|
1226
1228
|
}
|
|
1227
|
-
), Ge =
|
|
1229
|
+
), Ge = O(
|
|
1228
1230
|
({
|
|
1229
1231
|
value: t,
|
|
1230
1232
|
children: r,
|
|
@@ -1233,10 +1235,10 @@ const gt = Object.assign(ee, {
|
|
|
1233
1235
|
className: n,
|
|
1234
1236
|
disabled: o,
|
|
1235
1237
|
checkboxPlacement: d = "center",
|
|
1236
|
-
hideCheckbox:
|
|
1237
|
-
...
|
|
1238
|
-
},
|
|
1239
|
-
const u =
|
|
1238
|
+
hideCheckbox: l = !1,
|
|
1239
|
+
...c
|
|
1240
|
+
}, i) => {
|
|
1241
|
+
const u = A(), p = s || u, f = typeof r == "function" ? r(a) : r;
|
|
1240
1242
|
return /* @__PURE__ */ e.jsxs(
|
|
1241
1243
|
"label",
|
|
1242
1244
|
{
|
|
@@ -1246,7 +1248,7 @@ const gt = Object.assign(ee, {
|
|
|
1246
1248
|
checked: !!a,
|
|
1247
1249
|
disabled: !!o,
|
|
1248
1250
|
checkboxPlacement: d,
|
|
1249
|
-
hideCheckbox:
|
|
1251
|
+
hideCheckbox: l
|
|
1250
1252
|
}),
|
|
1251
1253
|
n
|
|
1252
1254
|
),
|
|
@@ -1258,7 +1260,7 @@ const gt = Object.assign(ee, {
|
|
|
1258
1260
|
/* @__PURE__ */ e.jsx(
|
|
1259
1261
|
"input",
|
|
1260
1262
|
{
|
|
1261
|
-
ref:
|
|
1263
|
+
ref: i,
|
|
1262
1264
|
id: p,
|
|
1263
1265
|
type: "radio",
|
|
1264
1266
|
value: t,
|
|
@@ -1267,10 +1269,10 @@ const gt = Object.assign(ee, {
|
|
|
1267
1269
|
className: "sr-only",
|
|
1268
1270
|
"aria-hidden": !0,
|
|
1269
1271
|
"aria-checked": a,
|
|
1270
|
-
...
|
|
1272
|
+
...c
|
|
1271
1273
|
}
|
|
1272
1274
|
),
|
|
1273
|
-
!
|
|
1275
|
+
!l && /* @__PURE__ */ e.jsx(
|
|
1274
1276
|
"span",
|
|
1275
1277
|
{
|
|
1276
1278
|
className: x(
|
|
@@ -1294,7 +1296,7 @@ const gt = Object.assign(ee, {
|
|
|
1294
1296
|
}
|
|
1295
1297
|
);
|
|
1296
1298
|
Ge.displayName = "SelectableSingleInput";
|
|
1297
|
-
const Ke =
|
|
1299
|
+
const Ke = C(
|
|
1298
1300
|
"flex gap-3 cursor-pointer border-b border-border select-none transition-colors",
|
|
1299
1301
|
{
|
|
1300
1302
|
variants: {
|
|
@@ -1323,7 +1325,7 @@ const Ke = N(
|
|
|
1323
1325
|
hideCheckbox: !1
|
|
1324
1326
|
}
|
|
1325
1327
|
}
|
|
1326
|
-
), _e =
|
|
1328
|
+
), _e = C(
|
|
1327
1329
|
"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
1330
|
{
|
|
1329
1331
|
variants: {
|
|
@@ -1341,7 +1343,7 @@ const Ke = N(
|
|
|
1341
1343
|
disabled: !1
|
|
1342
1344
|
}
|
|
1343
1345
|
}
|
|
1344
|
-
), He =
|
|
1346
|
+
), He = O(
|
|
1345
1347
|
({
|
|
1346
1348
|
value: t,
|
|
1347
1349
|
children: r,
|
|
@@ -1350,10 +1352,10 @@ const Ke = N(
|
|
|
1350
1352
|
className: n,
|
|
1351
1353
|
disabled: o,
|
|
1352
1354
|
checkboxPlacement: d = "center",
|
|
1353
|
-
hideCheckbox:
|
|
1354
|
-
...
|
|
1355
|
-
},
|
|
1356
|
-
const u =
|
|
1355
|
+
hideCheckbox: l = !1,
|
|
1356
|
+
...c
|
|
1357
|
+
}, i) => {
|
|
1358
|
+
const u = A(), p = s || u, f = typeof r == "function" ? r(a) : r;
|
|
1357
1359
|
return /* @__PURE__ */ e.jsxs(
|
|
1358
1360
|
"label",
|
|
1359
1361
|
{
|
|
@@ -1363,7 +1365,7 @@ const Ke = N(
|
|
|
1363
1365
|
checked: !!a,
|
|
1364
1366
|
disabled: !!o,
|
|
1365
1367
|
checkboxPlacement: d,
|
|
1366
|
-
hideCheckbox:
|
|
1368
|
+
hideCheckbox: l
|
|
1367
1369
|
}),
|
|
1368
1370
|
n
|
|
1369
1371
|
),
|
|
@@ -1375,7 +1377,7 @@ const Ke = N(
|
|
|
1375
1377
|
/* @__PURE__ */ e.jsx(
|
|
1376
1378
|
"input",
|
|
1377
1379
|
{
|
|
1378
|
-
ref:
|
|
1380
|
+
ref: i,
|
|
1379
1381
|
id: p,
|
|
1380
1382
|
type: "checkbox",
|
|
1381
1383
|
value: t,
|
|
@@ -1384,10 +1386,10 @@ const Ke = N(
|
|
|
1384
1386
|
className: "sr-only",
|
|
1385
1387
|
"aria-hidden": !0,
|
|
1386
1388
|
"aria-checked": a,
|
|
1387
|
-
...
|
|
1389
|
+
...c
|
|
1388
1390
|
}
|
|
1389
1391
|
),
|
|
1390
|
-
!
|
|
1392
|
+
!l && /* @__PURE__ */ e.jsx(
|
|
1391
1393
|
"span",
|
|
1392
1394
|
{
|
|
1393
1395
|
className: x(
|
|
@@ -1411,7 +1413,7 @@ const Ke = N(
|
|
|
1411
1413
|
}
|
|
1412
1414
|
);
|
|
1413
1415
|
He.displayName = "SelectableMultipleInput";
|
|
1414
|
-
const Je =
|
|
1416
|
+
const Je = C(
|
|
1415
1417
|
"relative inline-flex items-center h-5 w-10 rounded-full transition-colors duration-200 border border-transparent",
|
|
1416
1418
|
{
|
|
1417
1419
|
variants: {
|
|
@@ -1429,7 +1431,7 @@ const Je = N(
|
|
|
1429
1431
|
checked: !1
|
|
1430
1432
|
}
|
|
1431
1433
|
}
|
|
1432
|
-
), Qe =
|
|
1434
|
+
), Qe = C(
|
|
1433
1435
|
"absolute h-4 w-4 rounded-full transition-transform duration-200",
|
|
1434
1436
|
{
|
|
1435
1437
|
variants: {
|
|
@@ -1465,7 +1467,7 @@ const Je = N(
|
|
|
1465
1467
|
s && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
1466
1468
|
]
|
|
1467
1469
|
}
|
|
1468
|
-
) : null, Ze =
|
|
1470
|
+
) : null, Ze = m.forwardRef(
|
|
1469
1471
|
({
|
|
1470
1472
|
value: t,
|
|
1471
1473
|
onChange: r,
|
|
@@ -1474,29 +1476,29 @@ const Je = N(
|
|
|
1474
1476
|
required: n = !1,
|
|
1475
1477
|
className: o,
|
|
1476
1478
|
id: d,
|
|
1477
|
-
ariaLabel:
|
|
1478
|
-
...
|
|
1479
|
-
},
|
|
1480
|
-
const u =
|
|
1481
|
-
r?.(
|
|
1479
|
+
ariaLabel: l,
|
|
1480
|
+
...c
|
|
1481
|
+
}, i) => {
|
|
1482
|
+
const u = m.useId(), p = d || u, f = t ?? !1, h = (b) => {
|
|
1483
|
+
r?.(b.target.checked);
|
|
1482
1484
|
};
|
|
1483
1485
|
return /* @__PURE__ */ e.jsxs("div", { className: x("inline-flex items-center gap-2", o), children: [
|
|
1484
1486
|
/* @__PURE__ */ e.jsxs("span", { className: "relative inline-flex items-center", children: [
|
|
1485
1487
|
/* @__PURE__ */ e.jsx(
|
|
1486
1488
|
"input",
|
|
1487
1489
|
{
|
|
1488
|
-
ref:
|
|
1490
|
+
ref: i,
|
|
1489
1491
|
type: "checkbox",
|
|
1490
1492
|
role: "switch",
|
|
1491
1493
|
id: p,
|
|
1492
|
-
"aria-label":
|
|
1494
|
+
"aria-label": l || a,
|
|
1493
1495
|
"aria-checked": f,
|
|
1494
1496
|
checked: f,
|
|
1495
1497
|
disabled: s,
|
|
1496
1498
|
required: n,
|
|
1497
|
-
onChange:
|
|
1499
|
+
onChange: h,
|
|
1498
1500
|
className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10 disabled:cursor-not-allowed",
|
|
1499
|
-
...
|
|
1501
|
+
...c
|
|
1500
1502
|
}
|
|
1501
1503
|
),
|
|
1502
1504
|
/* @__PURE__ */ e.jsx(Ue, { disabled: s, checked: f }),
|
|
@@ -1515,22 +1517,21 @@ const Je = N(
|
|
|
1515
1517
|
}
|
|
1516
1518
|
);
|
|
1517
1519
|
Ze.displayName = "SwitchInput";
|
|
1518
|
-
const et =
|
|
1519
|
-
"block w-full rounded-md border bg-white
|
|
1520
|
+
const et = C(
|
|
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",
|
|
1520
1522
|
{
|
|
1521
1523
|
variants: {
|
|
1522
1524
|
state: {
|
|
1523
|
-
default: "border-primary/30 focus:
|
|
1524
|
-
error: "border-danger bg-danger/5
|
|
1525
|
-
|
|
1526
|
-
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"
|
|
1527
1528
|
}
|
|
1528
1529
|
},
|
|
1529
1530
|
defaultVariants: {
|
|
1530
1531
|
state: "default"
|
|
1531
1532
|
}
|
|
1532
1533
|
}
|
|
1533
|
-
), tt = (t, r
|
|
1534
|
+
), tt = (t, r) => t ? "readOnly" : r ? "error" : "default", rt = (t, r, a) => {
|
|
1534
1535
|
if (r || a) {
|
|
1535
1536
|
t.preventDefault();
|
|
1536
1537
|
return;
|
|
@@ -1541,9 +1542,9 @@ const et = N(
|
|
|
1541
1542
|
n.deleteFromDocument();
|
|
1542
1543
|
const o = n.getRangeAt(0), d = document.createTextNode(s);
|
|
1543
1544
|
o.insertNode(d), o.setStartAfter(d), o.setEndAfter(d), n.removeAllRanges(), n.addRange(o);
|
|
1544
|
-
const
|
|
1545
|
-
t.currentTarget.dispatchEvent(
|
|
1546
|
-
}, at =
|
|
1545
|
+
const l = new Event("input", { bubbles: !0 });
|
|
1546
|
+
t.currentTarget.dispatchEvent(l);
|
|
1547
|
+
}, at = m.forwardRef(
|
|
1547
1548
|
({
|
|
1548
1549
|
label: t,
|
|
1549
1550
|
helperText: r,
|
|
@@ -1552,94 +1553,94 @@ const et = N(
|
|
|
1552
1553
|
disabled: n,
|
|
1553
1554
|
readOnly: o,
|
|
1554
1555
|
id: d,
|
|
1555
|
-
value:
|
|
1556
|
-
defaultValue:
|
|
1557
|
-
onChange:
|
|
1556
|
+
value: l,
|
|
1557
|
+
defaultValue: c,
|
|
1558
|
+
onChange: i,
|
|
1558
1559
|
placeholder: u,
|
|
1559
1560
|
name: p,
|
|
1560
1561
|
row: f = 3,
|
|
1561
|
-
required:
|
|
1562
|
-
onBlur:
|
|
1563
|
-
onFocus:
|
|
1562
|
+
required: h,
|
|
1563
|
+
onBlur: b,
|
|
1564
|
+
onFocus: w,
|
|
1564
1565
|
onKeyDown: g,
|
|
1565
|
-
...
|
|
1566
|
+
...k
|
|
1566
1567
|
}, v) => {
|
|
1567
|
-
const
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
}, [
|
|
1571
|
-
const I = tt(
|
|
1572
|
-
const L =
|
|
1573
|
-
|
|
1574
|
-
}, re = (
|
|
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(() => {
|
|
1570
|
+
S.current && S.current.textContent !== y && (S.current.textContent = y);
|
|
1571
|
+
}, [y]);
|
|
1572
|
+
const I = tt(o, R), D = !y && u, te = (P) => {
|
|
1573
|
+
const L = P.currentTarget.textContent || "";
|
|
1574
|
+
j || z(L), i?.(L);
|
|
1575
|
+
}, re = (P) => {
|
|
1575
1576
|
if (n || o) {
|
|
1576
|
-
|
|
1577
|
+
P.preventDefault();
|
|
1577
1578
|
return;
|
|
1578
1579
|
}
|
|
1579
|
-
g?.(
|
|
1580
|
+
g?.(P);
|
|
1580
1581
|
}, ae = () => {
|
|
1581
|
-
|
|
1582
|
+
S.current?.focus();
|
|
1582
1583
|
};
|
|
1583
1584
|
return /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1584
1585
|
t && /* @__PURE__ */ e.jsxs(
|
|
1585
1586
|
"label",
|
|
1586
1587
|
{
|
|
1587
|
-
htmlFor:
|
|
1588
|
+
htmlFor: V,
|
|
1588
1589
|
className: "block text-sm font-medium text-foreground mb-2 cursor-pointer",
|
|
1589
1590
|
onClick: ae,
|
|
1590
1591
|
children: [
|
|
1591
1592
|
t,
|
|
1592
|
-
|
|
1593
|
+
h && /* @__PURE__ */ e.jsx("span", { className: "text-danger ml-1", "aria-label": "required", children: "*" })
|
|
1593
1594
|
]
|
|
1594
1595
|
}
|
|
1595
1596
|
),
|
|
1596
1597
|
/* @__PURE__ */ e.jsx("div", { className: x("relative w-full", s), children: /* @__PURE__ */ e.jsx(
|
|
1597
1598
|
"div",
|
|
1598
1599
|
{
|
|
1599
|
-
ref:
|
|
1600
|
-
id:
|
|
1600
|
+
ref: S,
|
|
1601
|
+
id: V,
|
|
1601
1602
|
role: "textbox",
|
|
1602
1603
|
"aria-multiline": "true",
|
|
1603
|
-
"aria-invalid":
|
|
1604
|
+
"aria-invalid": R,
|
|
1604
1605
|
"aria-disabled": n,
|
|
1605
1606
|
"aria-readonly": o,
|
|
1606
|
-
"aria-required":
|
|
1607
|
+
"aria-required": h,
|
|
1607
1608
|
"aria-label": typeof t == "string" ? t : void 0,
|
|
1608
1609
|
contentEditable: !n && !o,
|
|
1609
1610
|
"data-name": p,
|
|
1610
1611
|
onInput: te,
|
|
1611
1612
|
onKeyDown: re,
|
|
1612
|
-
onPaste: (
|
|
1613
|
-
onBlur:
|
|
1614
|
-
onFocus:
|
|
1613
|
+
onPaste: (P) => rt(P, n, o),
|
|
1614
|
+
onBlur: b,
|
|
1615
|
+
onFocus: w,
|
|
1615
1616
|
suppressContentEditableWarning: !0,
|
|
1616
1617
|
style: { minHeight: `${f * 1.5 + 1}rem` },
|
|
1617
1618
|
className: x(
|
|
1618
1619
|
et({ state: I }),
|
|
1619
1620
|
"px-3 py-2",
|
|
1620
|
-
|
|
1621
|
+
D && "empty:before:content-[attr(data-placeholder)] empty:before:text-gray-400"
|
|
1621
1622
|
),
|
|
1622
1623
|
"data-placeholder": u,
|
|
1623
|
-
...
|
|
1624
|
+
...k
|
|
1624
1625
|
}
|
|
1625
1626
|
) }),
|
|
1626
|
-
|
|
1627
|
-
!
|
|
1627
|
+
R && /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-sm text-danger", role: "alert", children: a }),
|
|
1628
|
+
!R && r && /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-sm text-gray-600", children: r })
|
|
1628
1629
|
] });
|
|
1629
1630
|
}
|
|
1630
1631
|
);
|
|
1631
1632
|
at.displayName = "TextAreaInput";
|
|
1632
|
-
const xt =
|
|
1633
|
+
const xt = O(function(r, a) {
|
|
1633
1634
|
const s = (n) => {
|
|
1634
1635
|
r?.onChange?.(n.target.value);
|
|
1635
1636
|
};
|
|
1636
1637
|
return /* @__PURE__ */ e.jsx(
|
|
1637
|
-
|
|
1638
|
+
M,
|
|
1638
1639
|
{
|
|
1639
1640
|
type: "time",
|
|
1640
1641
|
tabIndex: 0,
|
|
1641
1642
|
"aria-hidden": "true",
|
|
1642
|
-
leftContent: /* @__PURE__ */ e.jsx(
|
|
1643
|
+
leftContent: /* @__PURE__ */ e.jsx($, { as: ue, color: "inherit", size: "sm" }),
|
|
1643
1644
|
ref: a,
|
|
1644
1645
|
...r,
|
|
1645
1646
|
onChange: s
|
|
@@ -1653,7 +1654,7 @@ export {
|
|
|
1653
1654
|
De as P,
|
|
1654
1655
|
ht as R,
|
|
1655
1656
|
bt as S,
|
|
1656
|
-
|
|
1657
|
+
M as T,
|
|
1657
1658
|
dt as a,
|
|
1658
1659
|
ut as b,
|
|
1659
1660
|
mt as c,
|