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