@dimasbaguspm/versaur 0.0.16 → 0.0.17
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/bottom-sheet-CHRSxXRE.js +501 -0
- package/dist/js/{switch-input-Bx6_2zG9.js → email-input-CVyrFzqL.js} +592 -807
- package/dist/js/enforce-subpath-import.js +5 -2
- package/dist/js/feedbacks/index.js +1 -1
- package/dist/js/{form-layout-4ASWdXn8.js → form-layout-Dhlv-FZL.js} +1 -1
- package/dist/js/forms/index.js +17 -14
- package/dist/js/{index-DOdDlCoL.js → index-C1uJQB34.js} +2 -2
- package/dist/js/index.js +45 -43
- package/dist/js/layouts/index.js +1 -1
- package/dist/js/modal-FqewbVts.js +150 -0
- package/dist/js/navigation/index.js +1 -1
- package/dist/js/overlays/index.js +4 -4
- package/dist/js/primitive/index.js +14 -15
- package/dist/js/{skeleton-BNZyaRjo.js → skeleton-QEyPZAuF.js} +1 -1
- package/dist/js/{tabs-BbOkYchB.js → tabs-DYcTvVao.js} +1 -1
- package/dist/js/tile-B9bt2AY6.js +1776 -0
- package/dist/types/forms/chip-multiple-input/chip-multiple-input.atoms.d.ts +10 -0
- package/dist/types/forms/chip-multiple-input/chip-multiple-input.d.ts +5 -0
- package/dist/types/forms/chip-multiple-input/index.d.ts +2 -0
- package/dist/types/forms/{chip-input → chip-multiple-input}/types.d.ts +16 -4
- package/dist/types/forms/chip-single-input/chip-single-input.atoms.d.ts +10 -0
- package/dist/types/forms/chip-single-input/chip-single-input.d.ts +5 -0
- package/dist/types/forms/chip-single-input/index.d.ts +1 -0
- package/dist/types/forms/chip-single-input/types.d.ts +67 -0
- package/dist/types/forms/date-single-picker-input/date-single-picker-input.d.ts +1 -8
- package/dist/types/forms/date-single-picker-input/index.d.ts +1 -1
- package/dist/types/forms/date-single-picker-input/types.d.ts +12 -66
- package/dist/types/forms/email-input/email-input.d.ts +8 -0
- package/dist/types/forms/email-input/index.d.ts +2 -0
- package/dist/types/forms/email-input/types.d.ts +6 -0
- package/dist/types/forms/index.d.ts +5 -1
- package/dist/types/forms/price-input/index.d.ts +2 -0
- package/dist/types/forms/price-input/price-input.d.ts +6 -0
- package/dist/types/forms/price-input/types.d.ts +15 -0
- package/dist/types/forms/price-input/use-price-input.d.ts +6 -0
- package/dist/types/forms/search-input/index.d.ts +2 -0
- package/dist/types/forms/search-input/search-input.d.ts +8 -0
- package/dist/types/forms/search-input/types.d.ts +35 -0
- package/dist/types/forms/segment-multiple-input/types.d.ts +1 -5
- package/dist/types/forms/segment-single-input/types.d.ts +1 -5
- package/dist/types/overlays/modal/types.d.ts +1 -1
- package/dist/types/primitive/anchor/types.d.ts +8 -2
- package/package.json +1 -1
- package/dist/js/bottom-sheet-Difan0U1.js +0 -340
- package/dist/js/calendar-CUjVZ7Ap.js +0 -811
- package/dist/js/menu-Bm-yPIMN.js +0 -310
- package/dist/js/tile-BjhJ5Mvl.js +0 -939
- package/dist/types/forms/chip-input/chip-input.atoms.d.ts +0 -10
- package/dist/types/forms/chip-input/chip-input.d.ts +0 -5
- package/dist/types/forms/chip-input/index.d.ts +0 -2
- package/dist/types/forms/date-range-picker-input/date-range-picker-input.d.ts +0 -10
- package/dist/types/forms/date-range-picker-input/index.d.ts +0 -2
- package/dist/types/forms/date-range-picker-input/types.d.ts +0 -64
- package/dist/types/forms/date-range-picker-input/use-date-range-picker.d.ts +0 -13
- package/dist/types/forms/date-single-picker-input/date-single-picker-input.atoms.d.ts +0 -13
- package/dist/types/forms/date-single-picker-input/date-single-picker-input.docked.d.ts +0 -14
- package/dist/types/forms/date-single-picker-input/date-single-picker-input.modal.d.ts +0 -15
- package/dist/types/forms/date-single-picker-input/use-date-single-picker.d.ts +0 -10
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React__default, { useState, useRef, createContext, useContext,
|
|
3
|
-
import { I as Icon, C as Calculator,
|
|
4
|
-
import {
|
|
5
|
-
import { CalculatorIcon, Check, Clock } from "lucide-react";
|
|
1
|
+
import { a as cva, j as jsxRuntimeExports, c as cn } from "./index-C1uJQB34.js";
|
|
2
|
+
import React__default, { useState, useRef, createContext, useContext, forwardRef, useId, useEffect } from "react";
|
|
3
|
+
import { I as Icon, C as Calculator, d as Button, h as Text } from "./tile-B9bt2AY6.js";
|
|
4
|
+
import { M as Modal } from "./modal-FqewbVts.js";
|
|
5
|
+
import { CalculatorIcon, Check, Calendar, SearchIcon, Clock, Banknote, MailIcon } from "lucide-react";
|
|
6
6
|
const textInputVariants = cva(
|
|
7
7
|
"block w-full rounded-md border bg-white transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none disabled:bg-gray-50",
|
|
8
8
|
{
|
|
@@ -39,64 +39,64 @@ const textInputVariants = cva(
|
|
|
39
39
|
({
|
|
40
40
|
variant: e = "primary",
|
|
41
41
|
label: t,
|
|
42
|
-
leftContent:
|
|
43
|
-
rightContent:
|
|
44
|
-
helperText:
|
|
45
|
-
error:
|
|
42
|
+
leftContent: i,
|
|
43
|
+
rightContent: s,
|
|
44
|
+
helperText: n,
|
|
45
|
+
error: l,
|
|
46
46
|
className: u,
|
|
47
|
-
disabled:
|
|
47
|
+
disabled: o,
|
|
48
48
|
id: r,
|
|
49
|
-
...
|
|
49
|
+
...d
|
|
50
50
|
}, x) => {
|
|
51
|
-
const
|
|
51
|
+
const c = React__default.useId(), a = r || c, g = !!l;
|
|
52
52
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
53
53
|
t && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
54
54
|
"label",
|
|
55
55
|
{
|
|
56
|
-
htmlFor:
|
|
56
|
+
htmlFor: a,
|
|
57
57
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
58
58
|
children: t
|
|
59
59
|
}
|
|
60
60
|
),
|
|
61
61
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("relative w-full", u), children: [
|
|
62
|
-
|
|
62
|
+
i && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
63
63
|
"span",
|
|
64
64
|
{
|
|
65
65
|
className: "absolute left-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5",
|
|
66
66
|
"data-testid": "left-content",
|
|
67
|
-
children:
|
|
67
|
+
children: i
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
70
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
71
71
|
"input",
|
|
72
72
|
{
|
|
73
73
|
ref: x,
|
|
74
|
-
id:
|
|
75
|
-
"aria-invalid":
|
|
76
|
-
"aria-disabled":
|
|
77
|
-
disabled:
|
|
74
|
+
id: a,
|
|
75
|
+
"aria-invalid": g,
|
|
76
|
+
"aria-disabled": o,
|
|
77
|
+
disabled: o,
|
|
78
78
|
className: cn(
|
|
79
79
|
textInputVariants({
|
|
80
|
-
variant:
|
|
80
|
+
variant: g ? "danger" : e
|
|
81
81
|
}),
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
i ? "pl-9" : "pl-3",
|
|
83
|
+
s ? "pr-9" : "pr-3",
|
|
84
84
|
"h-10"
|
|
85
85
|
),
|
|
86
|
-
...
|
|
86
|
+
...d
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
|
-
|
|
89
|
+
s && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
90
90
|
"span",
|
|
91
91
|
{
|
|
92
92
|
className: "absolute right-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5",
|
|
93
93
|
"data-testid": "right-content",
|
|
94
|
-
children:
|
|
94
|
+
children: s
|
|
95
95
|
}
|
|
96
96
|
)
|
|
97
97
|
] }),
|
|
98
|
-
|
|
99
|
-
!
|
|
98
|
+
g && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-sm text-danger", role: "alert", children: l }),
|
|
99
|
+
!g && n && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-sm text-gray-600", children: n })
|
|
100
100
|
] });
|
|
101
101
|
}
|
|
102
102
|
);
|
|
@@ -281,42 +281,42 @@ const DEFAULT_HEADER = "Enter Amount", CalculatorInput = ({
|
|
|
281
281
|
if (!e)
|
|
282
282
|
throw new Error("CheckboxOption must be used within CheckboxInput");
|
|
283
283
|
return e;
|
|
284
|
-
}, CheckboxOption = React__default.forwardRef(({ children: e, description: t, className:
|
|
285
|
-
const
|
|
284
|
+
}, CheckboxOption = React__default.forwardRef(({ children: e, description: t, className: i, disabled: s, id: n, ...l }, u) => {
|
|
285
|
+
const o = useCheckboxContext(), r = React__default.useId(), d = n || r, x = s || o.disabled, c = o.error ? "danger" : o.variant || "primary";
|
|
286
286
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
287
287
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative flex items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
288
288
|
"input",
|
|
289
289
|
{
|
|
290
290
|
ref: u,
|
|
291
291
|
type: "checkbox",
|
|
292
|
-
id:
|
|
292
|
+
id: d,
|
|
293
293
|
disabled: x,
|
|
294
294
|
className: cn(
|
|
295
295
|
checkboxVariants({
|
|
296
|
-
variant:
|
|
297
|
-
size:
|
|
296
|
+
variant: c,
|
|
297
|
+
size: o.size
|
|
298
298
|
}),
|
|
299
299
|
// Custom checkmark styling using ::after - centered positioning with size variants
|
|
300
300
|
'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',
|
|
301
301
|
// Size-specific checkmark dimensions
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
302
|
+
o.size === "sm" && "after:w-[3px] after:h-[6px]",
|
|
303
|
+
o.size === "md" && "after:w-[4px] after:h-[8px]",
|
|
304
|
+
o.size === "lg" && "after:w-[6px] after:h-[10px]",
|
|
305
305
|
"checked:after:opacity-100",
|
|
306
306
|
// Outline variants use colored checkmark
|
|
307
|
-
|
|
308
|
-
|
|
307
|
+
c?.includes("outline") && "checked:after:border-current",
|
|
308
|
+
i
|
|
309
309
|
),
|
|
310
|
-
...
|
|
310
|
+
...l
|
|
311
311
|
}
|
|
312
312
|
) }),
|
|
313
313
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
|
|
314
314
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
315
315
|
"label",
|
|
316
316
|
{
|
|
317
|
-
htmlFor:
|
|
317
|
+
htmlFor: d,
|
|
318
318
|
className: checkboxLabelVariants({
|
|
319
|
-
size:
|
|
319
|
+
size: o.size,
|
|
320
320
|
disabled: x
|
|
321
321
|
}),
|
|
322
322
|
children: e
|
|
@@ -327,9 +327,9 @@ const DEFAULT_HEADER = "Enter Amount", CalculatorInput = ({
|
|
|
327
327
|
{
|
|
328
328
|
className: cn(
|
|
329
329
|
"text-gray-600 mt-1",
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
330
|
+
o.size === "sm" && "text-xs",
|
|
331
|
+
o.size === "md" && "text-xs",
|
|
332
|
+
o.size === "lg" && "text-sm",
|
|
333
333
|
x && "opacity-50"
|
|
334
334
|
),
|
|
335
335
|
children: t
|
|
@@ -343,43 +343,41 @@ const CheckboxInputRoot = React__default.forwardRef(
|
|
|
343
343
|
({
|
|
344
344
|
variant: e = "primary",
|
|
345
345
|
size: t = "md",
|
|
346
|
-
label:
|
|
347
|
-
helperText:
|
|
348
|
-
error:
|
|
349
|
-
direction:
|
|
346
|
+
label: i,
|
|
347
|
+
helperText: s,
|
|
348
|
+
error: n,
|
|
349
|
+
direction: l = "vertical",
|
|
350
350
|
className: u,
|
|
351
|
-
disabled:
|
|
351
|
+
disabled: o,
|
|
352
352
|
children: r,
|
|
353
|
-
...
|
|
353
|
+
...d
|
|
354
354
|
}, x) => {
|
|
355
|
-
const
|
|
355
|
+
const c = !!n, a = {
|
|
356
356
|
variant: e,
|
|
357
357
|
size: t,
|
|
358
|
-
disabled:
|
|
359
|
-
error:
|
|
358
|
+
disabled: o,
|
|
359
|
+
error: c
|
|
360
360
|
};
|
|
361
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(CheckboxContext.Provider, { value:
|
|
362
|
-
|
|
363
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: checkboxGroupVariants({ direction:
|
|
364
|
-
|
|
365
|
-
!
|
|
361
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(CheckboxContext.Provider, { value: a, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: x, className: cn("w-full", u), ...d, children: [
|
|
362
|
+
i && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: i }),
|
|
363
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: checkboxGroupVariants({ direction: l }), children: r }),
|
|
364
|
+
c && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
|
|
365
|
+
!c && s && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
|
|
366
366
|
] }) });
|
|
367
367
|
}
|
|
368
368
|
);
|
|
369
369
|
CheckboxInputRoot.displayName = "CheckboxInput";
|
|
370
370
|
const CheckboxInput = Object.assign(CheckboxInputRoot, {
|
|
371
371
|
Option: CheckboxOption
|
|
372
|
-
}),
|
|
373
|
-
|
|
374
|
-
), useChipInputContext = () => {
|
|
375
|
-
const e = useContext(ChipInputContext);
|
|
372
|
+
}), ChipMultipleInputContext = createContext(null), useChipMultipleInputContext = () => {
|
|
373
|
+
const e = useContext(ChipMultipleInputContext);
|
|
376
374
|
if (!e)
|
|
377
|
-
throw new Error(
|
|
375
|
+
throw new Error(
|
|
376
|
+
"useChipMultipleInputContext must be used within ChipMultipleInputContext"
|
|
377
|
+
);
|
|
378
378
|
return e;
|
|
379
379
|
}, chipOptionVariants = cva(
|
|
380
|
-
|
|
381
|
-
"inline-flex items-center bg-white font-regular transition-colors duration-200 cursor-pointer border border-border"
|
|
382
|
-
].join(" "),
|
|
380
|
+
"inline-flex items-center bg-white font-regular transition-colors duration-200 cursor-pointer border border-border",
|
|
383
381
|
{
|
|
384
382
|
variants: {
|
|
385
383
|
variant: {
|
|
@@ -456,83 +454,77 @@ const CheckboxInput = Object.assign(CheckboxInputRoot, {
|
|
|
456
454
|
rounded: "rounded-lg"
|
|
457
455
|
},
|
|
458
456
|
size: {
|
|
459
|
-
sm: "px-
|
|
460
|
-
md: "px-
|
|
461
|
-
lg: "px-
|
|
457
|
+
sm: "px-3 py-1 text-xs min-h-[32px]",
|
|
458
|
+
md: "px-4 py-2 text-sm min-h-[40px]",
|
|
459
|
+
lg: "px-5 py-2.5 text-base min-h-[48px]"
|
|
462
460
|
}
|
|
463
|
-
},
|
|
464
|
-
defaultVariants: {
|
|
465
|
-
variant: "primary",
|
|
466
|
-
selected: !1,
|
|
467
|
-
shape: "circle",
|
|
468
|
-
size: "sm"
|
|
469
461
|
}
|
|
470
462
|
}
|
|
471
|
-
),
|
|
463
|
+
), ChipMultipleOption = React__default.forwardRef(
|
|
472
464
|
({
|
|
473
465
|
children: e,
|
|
474
466
|
className: t,
|
|
475
|
-
disabled:
|
|
476
|
-
id:
|
|
477
|
-
value:
|
|
478
|
-
check:
|
|
467
|
+
disabled: i,
|
|
468
|
+
id: s,
|
|
469
|
+
value: n,
|
|
470
|
+
check: l,
|
|
479
471
|
defaultCheck: u = !1,
|
|
480
|
-
...
|
|
472
|
+
...o
|
|
481
473
|
}, r) => {
|
|
482
|
-
const
|
|
483
|
-
if (!
|
|
484
|
-
const
|
|
474
|
+
const d = useChipMultipleInputContext(), x = React__default.useId(), c = s || x, a = i || d.disabled, g = d.error ? "danger" : d.variant || "primary", h = d.shape || "circle", b = d.size || "sm", f = d.value?.includes(n) ?? !1, y = (w) => {
|
|
475
|
+
if (!a) {
|
|
476
|
+
const R = d.value || [];
|
|
485
477
|
let C;
|
|
486
|
-
|
|
478
|
+
f ? C = R.filter((k) => k !== n) : C = [...R, n], d.onChange?.(C);
|
|
487
479
|
}
|
|
488
|
-
|
|
489
|
-
},
|
|
480
|
+
o.onChange?.(w);
|
|
481
|
+
}, m = b === "lg" ? 20 : b === "md" ? 18 : 16;
|
|
490
482
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
491
483
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
492
484
|
"input",
|
|
493
485
|
{
|
|
494
486
|
ref: r,
|
|
495
487
|
type: "checkbox",
|
|
496
|
-
id:
|
|
497
|
-
name: `${
|
|
498
|
-
value:
|
|
499
|
-
checked:
|
|
500
|
-
disabled:
|
|
501
|
-
onChange:
|
|
488
|
+
id: c,
|
|
489
|
+
name: `${d.name}[]`,
|
|
490
|
+
value: n,
|
|
491
|
+
checked: f,
|
|
492
|
+
disabled: a,
|
|
493
|
+
onChange: y,
|
|
502
494
|
className: "sr-only",
|
|
503
|
-
...
|
|
495
|
+
...o
|
|
504
496
|
}
|
|
505
497
|
),
|
|
506
498
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
507
499
|
"label",
|
|
508
500
|
{
|
|
509
|
-
htmlFor:
|
|
510
|
-
"data-selected":
|
|
501
|
+
htmlFor: c,
|
|
502
|
+
"data-selected": f,
|
|
511
503
|
className: cn(
|
|
512
504
|
chipOptionVariants({
|
|
513
|
-
variant:
|
|
514
|
-
selected:
|
|
515
|
-
shape:
|
|
516
|
-
size:
|
|
505
|
+
variant: g,
|
|
506
|
+
selected: f,
|
|
507
|
+
shape: h,
|
|
508
|
+
size: b
|
|
517
509
|
}),
|
|
518
|
-
|
|
510
|
+
a && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
519
511
|
t
|
|
520
512
|
),
|
|
521
513
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center", children: [
|
|
522
|
-
(
|
|
514
|
+
(l || u) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
523
515
|
"span",
|
|
524
516
|
{
|
|
525
517
|
className: cn(
|
|
526
518
|
"flex items-center",
|
|
527
519
|
"transition-transform transition-opacity duration-200",
|
|
528
|
-
|
|
520
|
+
f ? "opacity-100 scale-100 mr-1" : "opacity-0 scale-75"
|
|
529
521
|
),
|
|
530
522
|
"aria-hidden": "true",
|
|
531
|
-
children:
|
|
523
|
+
children: f && (l || /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
532
524
|
Check,
|
|
533
525
|
{
|
|
534
|
-
size:
|
|
535
|
-
className:
|
|
526
|
+
size: m,
|
|
527
|
+
className: g === "primary" ? "text-primary" : g === "secondary" ? "text-secondary" : g === "tertiary" ? "text-tertiary" : g === "ghost" ? "text-ghost" : g === "success" ? "text-success" : g === "info" ? "text-info" : g === "warning" ? "text-warning" : g === "danger" ? "text-danger" : "text-primary"
|
|
536
528
|
}
|
|
537
529
|
))
|
|
538
530
|
}
|
|
@@ -544,299 +536,96 @@ const CheckboxInput = Object.assign(CheckboxInputRoot, {
|
|
|
544
536
|
] });
|
|
545
537
|
}
|
|
546
538
|
);
|
|
547
|
-
|
|
548
|
-
const
|
|
539
|
+
ChipMultipleOption.displayName = "ChipMultipleOption";
|
|
540
|
+
const ChipMultipleInputRoot = React__default.forwardRef(
|
|
549
541
|
({
|
|
550
542
|
variant: e = "primary",
|
|
551
543
|
shape: t = "circle",
|
|
552
|
-
size:
|
|
553
|
-
label:
|
|
554
|
-
helperText:
|
|
555
|
-
error:
|
|
544
|
+
size: i = "sm",
|
|
545
|
+
label: s,
|
|
546
|
+
helperText: n,
|
|
547
|
+
error: l,
|
|
556
548
|
className: u,
|
|
557
|
-
disabled:
|
|
549
|
+
disabled: o,
|
|
558
550
|
name: r,
|
|
559
|
-
value:
|
|
551
|
+
value: d = [],
|
|
560
552
|
onChange: x,
|
|
561
|
-
children:
|
|
562
|
-
...
|
|
563
|
-
},
|
|
564
|
-
const
|
|
553
|
+
children: c,
|
|
554
|
+
...a
|
|
555
|
+
}, g) => {
|
|
556
|
+
const h = !!l, b = {
|
|
565
557
|
variant: e,
|
|
566
558
|
shape: t,
|
|
567
|
-
size:
|
|
568
|
-
disabled:
|
|
569
|
-
error:
|
|
559
|
+
size: i,
|
|
560
|
+
disabled: o,
|
|
561
|
+
error: h,
|
|
570
562
|
name: r,
|
|
571
|
-
value:
|
|
563
|
+
value: d,
|
|
572
564
|
onChange: x
|
|
573
565
|
};
|
|
574
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
575
|
-
|
|
576
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-2", children:
|
|
577
|
-
|
|
578
|
-
!
|
|
566
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ChipMultipleInputContext.Provider, { value: b, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: g, className: cn("w-full", u), ...a, children: [
|
|
567
|
+
s && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: s }),
|
|
568
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-2", children: c }),
|
|
569
|
+
h && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: l }),
|
|
570
|
+
!h && n && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-sm text-gray-600", children: n })
|
|
579
571
|
] }) });
|
|
580
572
|
}
|
|
581
|
-
),
|
|
582
|
-
Option:
|
|
583
|
-
})
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
className: a,
|
|
593
|
-
...r
|
|
594
|
-
}, i) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
595
|
-
"button",
|
|
596
|
-
{
|
|
597
|
-
ref: i,
|
|
598
|
-
type: "button",
|
|
599
|
-
"aria-invalid": n,
|
|
600
|
-
className: cn(
|
|
601
|
-
dateSinglePickerInputVariants({
|
|
602
|
-
variant: n ? "danger" : o
|
|
603
|
-
}),
|
|
604
|
-
e ? "pl-9" : "pl-3",
|
|
605
|
-
t ? "pr-9" : "pr-3",
|
|
606
|
-
"h-10 flex items-center justify-between cursor-pointer w-full relative",
|
|
607
|
-
"text-left",
|
|
608
|
-
a
|
|
609
|
-
),
|
|
610
|
-
...r,
|
|
611
|
-
children: [
|
|
612
|
-
e && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
613
|
-
"span",
|
|
614
|
-
{
|
|
615
|
-
className: "absolute left-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5",
|
|
616
|
-
"data-testid": "left-content",
|
|
617
|
-
children: e
|
|
618
|
-
}
|
|
619
|
-
),
|
|
620
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
621
|
-
"span",
|
|
622
|
-
{
|
|
623
|
-
className: cn(
|
|
624
|
-
"flex-1",
|
|
625
|
-
e ? "ml-2" : "",
|
|
626
|
-
t ? "mr-2" : ""
|
|
627
|
-
),
|
|
628
|
-
children: u ? u(s) : c
|
|
629
|
-
}
|
|
630
|
-
),
|
|
631
|
-
t && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
632
|
-
"span",
|
|
633
|
-
{
|
|
634
|
-
className: "absolute right-2.5 top-0 bottom-0 pointer-events-none text-gray-500 flex items-center justify-center w-5",
|
|
635
|
-
"data-testid": "right-content",
|
|
636
|
-
children: t
|
|
637
|
-
}
|
|
638
|
-
)
|
|
639
|
-
]
|
|
640
|
-
}
|
|
641
|
-
)
|
|
642
|
-
);
|
|
643
|
-
DateSinglePickerTrigger.displayName = "DateSinglePickerTrigger";
|
|
644
|
-
const DateSinglePickerDocked = ({
|
|
645
|
-
open: e,
|
|
646
|
-
value: t,
|
|
647
|
-
onChange: n,
|
|
648
|
-
handleMenuClose: o
|
|
649
|
-
}) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Menu, { isOpen: e, onOutsideClick: o, children: [
|
|
650
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Trigger, { className: "absolute top-[90%] left-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": "true" }) }),
|
|
651
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Menu.Content, { className: "drop-shadow-lg rounded-lg bg-white border border-neutral", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
652
|
-
Calendar,
|
|
653
|
-
{
|
|
654
|
-
value: t,
|
|
655
|
-
onChange: (s) => {
|
|
656
|
-
s instanceof Date && n(s);
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
) })
|
|
660
|
-
] }), DateSinglePickerModal = ({
|
|
661
|
-
open: e,
|
|
662
|
-
setOpen: t,
|
|
663
|
-
value: n,
|
|
664
|
-
onChange: o,
|
|
665
|
-
label: s,
|
|
666
|
-
buttonRef: c
|
|
667
|
-
}) => {
|
|
668
|
-
const [u, a] = useState(
|
|
669
|
-
n
|
|
670
|
-
);
|
|
671
|
-
useEffect(() => {
|
|
672
|
-
a(n);
|
|
673
|
-
}, [n, e]);
|
|
674
|
-
const r = () => {
|
|
675
|
-
t(!1), a(n), c.current?.focus();
|
|
676
|
-
}, i = () => {
|
|
677
|
-
u && (o(u), t(!1), c.current?.focus());
|
|
678
|
-
};
|
|
679
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
680
|
-
Modal,
|
|
681
|
-
{
|
|
682
|
-
isOpen: e,
|
|
683
|
-
onOpenChange: t,
|
|
684
|
-
placement: "top",
|
|
685
|
-
size: "md",
|
|
686
|
-
"aria-label": s ? String(s) : "Select date",
|
|
687
|
-
disableOverlayClose: !1,
|
|
688
|
-
disableEscClose: !1,
|
|
689
|
-
children: [
|
|
690
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Modal.Body, { className: "px-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
691
|
-
Calendar,
|
|
692
|
-
{
|
|
693
|
-
value: u,
|
|
694
|
-
onChange: (x) => {
|
|
695
|
-
x instanceof Date && a(x);
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
) }),
|
|
699
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Modal.Footer, { className: "px-6", children: [
|
|
700
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
701
|
-
Button,
|
|
702
|
-
{
|
|
703
|
-
onClick: r,
|
|
704
|
-
variant: "ghost",
|
|
705
|
-
type: "button",
|
|
706
|
-
size: "sm",
|
|
707
|
-
children: "Cancel"
|
|
708
|
-
}
|
|
709
|
-
),
|
|
710
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
711
|
-
Button,
|
|
712
|
-
{
|
|
713
|
-
onClick: i,
|
|
714
|
-
variant: "primary",
|
|
715
|
-
type: "button",
|
|
716
|
-
disabled: !u,
|
|
717
|
-
size: "sm",
|
|
718
|
-
children: "Confirm"
|
|
719
|
-
}
|
|
720
|
-
)
|
|
721
|
-
] })
|
|
722
|
-
]
|
|
723
|
-
}
|
|
724
|
-
);
|
|
725
|
-
};
|
|
726
|
-
function useDateSinglePicker({ id: e }) {
|
|
727
|
-
const [t, n] = useState(!1), o = useId(), s = e || o, c = useRef(null), u = useCallback(
|
|
728
|
-
(r) => {
|
|
729
|
-
(r.key === "ArrowDown" || r.key === "Enter" || r.key === " ") && n(!0);
|
|
730
|
-
},
|
|
731
|
-
[]
|
|
732
|
-
), a = useCallback(() => {
|
|
733
|
-
n(!1), c.current?.focus();
|
|
734
|
-
}, []);
|
|
735
|
-
return {
|
|
736
|
-
open: t,
|
|
737
|
-
setOpen: n,
|
|
738
|
-
inputId: s,
|
|
739
|
-
buttonRef: c,
|
|
740
|
-
handleKeyDown: u,
|
|
741
|
-
handleMenuClose: a
|
|
742
|
-
};
|
|
573
|
+
), ChipMultipleInput = Object.assign(ChipMultipleInputRoot, {
|
|
574
|
+
Option: ChipMultipleOption
|
|
575
|
+
});
|
|
576
|
+
function defaultDateFormatter(e) {
|
|
577
|
+
if (!e) return "";
|
|
578
|
+
const t = new Date(e);
|
|
579
|
+
return isNaN(t.getTime()) ? e : t.toLocaleDateString(void 0, {
|
|
580
|
+
year: "numeric",
|
|
581
|
+
month: "short",
|
|
582
|
+
day: "numeric"
|
|
583
|
+
});
|
|
743
584
|
}
|
|
744
|
-
const DateSinglePickerInput = React__default.forwardRef(
|
|
745
|
-
({
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
789
|
-
DateSinglePickerTrigger,
|
|
790
|
-
{
|
|
791
|
-
ref: (R) => {
|
|
792
|
-
w.current = R, typeof d == "function" ? d(R) : d && (d.current = R);
|
|
793
|
-
},
|
|
794
|
-
id: h,
|
|
795
|
-
"aria-haspopup": "dialog",
|
|
796
|
-
"aria-expanded": m,
|
|
797
|
-
"aria-controls": m ? `${h}-calendar` : void 0,
|
|
798
|
-
"aria-invalid": b,
|
|
799
|
-
"aria-disabled": r,
|
|
800
|
-
disabled: r,
|
|
801
|
-
leftContent: o,
|
|
802
|
-
rightContent: s,
|
|
803
|
-
hasError: b,
|
|
804
|
-
variant: a,
|
|
805
|
-
value: e,
|
|
806
|
-
placeholder: typeof i == "string" ? i : "Select date",
|
|
807
|
-
formatDate: I,
|
|
808
|
-
onClick: k,
|
|
809
|
-
onKeyDown: p,
|
|
810
|
-
tabIndex: 0,
|
|
811
|
-
...g
|
|
812
|
-
}
|
|
813
|
-
),
|
|
814
|
-
b && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-sm text-danger", role: "alert", children: u }),
|
|
815
|
-
c && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-sm text-muted-foreground", children: c })
|
|
816
|
-
] }),
|
|
817
|
-
l === "docked" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
818
|
-
DateSinglePickerDocked,
|
|
819
|
-
{
|
|
820
|
-
open: m,
|
|
821
|
-
value: e,
|
|
822
|
-
onChange: E,
|
|
823
|
-
inputId: h,
|
|
824
|
-
handleMenuClose: j
|
|
825
|
-
}
|
|
826
|
-
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
827
|
-
DateSinglePickerModal,
|
|
828
|
-
{
|
|
829
|
-
open: m,
|
|
830
|
-
setOpen: f,
|
|
831
|
-
value: e,
|
|
832
|
-
onChange: E,
|
|
833
|
-
label: typeof n == "string" ? n : void 0,
|
|
834
|
-
buttonRef: w
|
|
835
|
-
}
|
|
836
|
-
)
|
|
837
|
-
] });
|
|
838
|
-
}
|
|
839
|
-
), radioGroupVariants = cva("space-y-2", {
|
|
585
|
+
const DateSinglePickerInput = React__default.forwardRef(function e({ value: t = "", onChange: i, label: s, formatter: n, ...l }, u) {
|
|
586
|
+
const o = useRef(null), r = (a) => {
|
|
587
|
+
o.current = a, typeof u == "function" ? u(a) : u && typeof u == "object" && (u.current = a);
|
|
588
|
+
}, d = () => {
|
|
589
|
+
o.current && (typeof o.current.showPicker == "function" ? o.current.showPicker() : o.current.focus());
|
|
590
|
+
}, x = (a) => {
|
|
591
|
+
i(a.target.value);
|
|
592
|
+
}, c = (n ?? defaultDateFormatter)(t);
|
|
593
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
594
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
595
|
+
TextInput,
|
|
596
|
+
{
|
|
597
|
+
type: "text",
|
|
598
|
+
value: c,
|
|
599
|
+
label: s,
|
|
600
|
+
readOnly: !0,
|
|
601
|
+
tabIndex: 0,
|
|
602
|
+
"aria-hidden": "true",
|
|
603
|
+
onClick: d,
|
|
604
|
+
leftContent: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: Calendar, color: "inherit", size: "sm" }),
|
|
605
|
+
"data-testid": "date-single-picker-visible-input",
|
|
606
|
+
...l
|
|
607
|
+
}
|
|
608
|
+
),
|
|
609
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
610
|
+
"input",
|
|
611
|
+
{
|
|
612
|
+
ref: r,
|
|
613
|
+
type: "date",
|
|
614
|
+
value: t,
|
|
615
|
+
onChange: x,
|
|
616
|
+
style: {
|
|
617
|
+
position: "absolute",
|
|
618
|
+
opacity: 0,
|
|
619
|
+
pointerEvents: "none",
|
|
620
|
+
width: 0,
|
|
621
|
+
height: 0
|
|
622
|
+
},
|
|
623
|
+
tabIndex: -1,
|
|
624
|
+
"aria-label": typeof s == "string" ? s : void 0
|
|
625
|
+
}
|
|
626
|
+
)
|
|
627
|
+
] });
|
|
628
|
+
}), radioGroupVariants = cva("space-y-2", {
|
|
840
629
|
variants: {
|
|
841
630
|
direction: {
|
|
842
631
|
vertical: "space-y-2 space-x-0",
|
|
@@ -913,21 +702,21 @@ const DateSinglePickerInput = React__default.forwardRef(
|
|
|
913
702
|
);
|
|
914
703
|
return e;
|
|
915
704
|
}, RadioOption = React__default.forwardRef(
|
|
916
|
-
({ children: e, description: t, className:
|
|
917
|
-
const r = useRadioInputContext(),
|
|
705
|
+
({ children: e, description: t, className: i, disabled: s, id: n, value: l, ...u }, o) => {
|
|
706
|
+
const r = useRadioInputContext(), d = React__default.useId(), x = n || d, c = s || r.disabled, a = r.error ? "danger" : r.variant || "primary";
|
|
918
707
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
919
708
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "relative flex items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
920
709
|
"input",
|
|
921
710
|
{
|
|
922
|
-
ref:
|
|
711
|
+
ref: o,
|
|
923
712
|
type: "radio",
|
|
924
713
|
id: x,
|
|
925
714
|
name: r.name,
|
|
926
|
-
value:
|
|
927
|
-
disabled:
|
|
715
|
+
value: l,
|
|
716
|
+
disabled: c,
|
|
928
717
|
className: cn(
|
|
929
718
|
radioOptionVariants({
|
|
930
|
-
variant:
|
|
719
|
+
variant: a,
|
|
931
720
|
size: r.size
|
|
932
721
|
}),
|
|
933
722
|
// Custom radio dot styling using ::before - centered positioning with size variants
|
|
@@ -938,8 +727,8 @@ const DateSinglePickerInput = React__default.forwardRef(
|
|
|
938
727
|
r.size === "lg" && "before:w-[10px] before:h-[10px]",
|
|
939
728
|
"checked:before:opacity-100",
|
|
940
729
|
// Outline variants use colored radio dot
|
|
941
|
-
|
|
942
|
-
|
|
730
|
+
a?.includes("outline") && "checked:before:bg-current",
|
|
731
|
+
i
|
|
943
732
|
),
|
|
944
733
|
...u
|
|
945
734
|
}
|
|
@@ -951,7 +740,7 @@ const DateSinglePickerInput = React__default.forwardRef(
|
|
|
951
740
|
htmlFor: x,
|
|
952
741
|
className: radioLabelVariants({
|
|
953
742
|
size: r.size,
|
|
954
|
-
disabled:
|
|
743
|
+
disabled: c
|
|
955
744
|
}),
|
|
956
745
|
children: e
|
|
957
746
|
}
|
|
@@ -964,7 +753,7 @@ const DateSinglePickerInput = React__default.forwardRef(
|
|
|
964
753
|
r.size === "sm" && "text-xs",
|
|
965
754
|
r.size === "md" && "text-xs",
|
|
966
755
|
r.size === "lg" && "text-sm",
|
|
967
|
-
|
|
756
|
+
c && "opacity-50"
|
|
968
757
|
),
|
|
969
758
|
children: t
|
|
970
759
|
}
|
|
@@ -976,58 +765,48 @@ const DateSinglePickerInput = React__default.forwardRef(
|
|
|
976
765
|
({
|
|
977
766
|
variant: e = "primary",
|
|
978
767
|
size: t = "md",
|
|
979
|
-
label:
|
|
980
|
-
helperText:
|
|
981
|
-
error:
|
|
982
|
-
direction:
|
|
768
|
+
label: i,
|
|
769
|
+
helperText: s,
|
|
770
|
+
error: n,
|
|
771
|
+
direction: l = "vertical",
|
|
983
772
|
className: u,
|
|
984
|
-
disabled:
|
|
773
|
+
disabled: o,
|
|
985
774
|
name: r,
|
|
986
|
-
children:
|
|
775
|
+
children: d,
|
|
987
776
|
...x
|
|
988
|
-
},
|
|
989
|
-
const
|
|
777
|
+
}, c) => {
|
|
778
|
+
const a = !!n, g = {
|
|
990
779
|
variant: e,
|
|
991
780
|
size: t,
|
|
992
|
-
disabled:
|
|
993
|
-
error:
|
|
781
|
+
disabled: o,
|
|
782
|
+
error: a,
|
|
994
783
|
name: r
|
|
995
784
|
};
|
|
996
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(RadioInputContext.Provider, { value:
|
|
997
|
-
|
|
998
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: radioGroupVariants({ direction:
|
|
999
|
-
|
|
1000
|
-
!
|
|
785
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RadioInputContext.Provider, { value: g, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: c, className: cn("w-full", u), ...x, children: [
|
|
786
|
+
i && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: i }),
|
|
787
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: radioGroupVariants({ direction: l }), children: d }),
|
|
788
|
+
a && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
|
|
789
|
+
!a && s && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
|
|
1001
790
|
] }) });
|
|
1002
791
|
}
|
|
1003
792
|
), RadioInput = Object.assign(RadioInputRoot, {
|
|
1004
793
|
Option: RadioOption
|
|
1005
794
|
}), segmentGroupVariants$1 = cva(
|
|
1006
|
-
"
|
|
795
|
+
"flex flex-row rounded-full border overflow-hidden p-1 gap-0.25",
|
|
1007
796
|
{
|
|
1008
797
|
variants: {
|
|
1009
798
|
variant: {
|
|
1010
799
|
// Core variants using Versaur color system
|
|
1011
|
-
primary: "border-primary
|
|
1012
|
-
secondary: "border-secondary
|
|
1013
|
-
tertiary: "border-tertiary
|
|
1014
|
-
ghost: "border-ghost
|
|
800
|
+
primary: "border-primary-light",
|
|
801
|
+
secondary: "border-secondary-light",
|
|
802
|
+
tertiary: "border-tertiary-light",
|
|
803
|
+
ghost: "border-ghost-light",
|
|
1015
804
|
neutral: "border-gray-200",
|
|
1016
|
-
// Outline variants
|
|
1017
|
-
"primary-outline": "border-primary",
|
|
1018
|
-
"secondary-outline": "border-secondary",
|
|
1019
|
-
"tertiary-outline": "border-tertiary",
|
|
1020
|
-
"ghost-outline": "border-ghost",
|
|
1021
|
-
"neutral-outline": "border-gray-400",
|
|
1022
805
|
// Semantic variants
|
|
1023
|
-
success: "border-success
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
warning: "border-warning/20",
|
|
1028
|
-
"warning-outline": "border-warning",
|
|
1029
|
-
danger: "border-danger/20",
|
|
1030
|
-
"danger-outline": "border-danger"
|
|
806
|
+
success: "border-success-light",
|
|
807
|
+
info: "border-info-light",
|
|
808
|
+
warning: "border-warning-light",
|
|
809
|
+
danger: "border-danger-light"
|
|
1031
810
|
},
|
|
1032
811
|
size: {
|
|
1033
812
|
sm: "text-xs",
|
|
@@ -1046,7 +825,7 @@ const DateSinglePickerInput = React__default.forwardRef(
|
|
|
1046
825
|
}
|
|
1047
826
|
}
|
|
1048
827
|
), segmentOptionVariants$1 = cva(
|
|
1049
|
-
"relative flex flex-row items-center px-3 py-2 text-center font-medium transition-all duration-200 cursor-pointer border-0 bg-transparent outline-none focus:ring-2 focus:ring-offset-1",
|
|
828
|
+
"inline relative flex flex-row items-center px-3 py-2 text-center font-medium transition-all duration-200 cursor-pointer border-0 bg-transparent outline-none focus:ring-2 focus:ring-offset-1 flex-1",
|
|
1050
829
|
{
|
|
1051
830
|
variants: {
|
|
1052
831
|
variant: {
|
|
@@ -1056,21 +835,11 @@ const DateSinglePickerInput = React__default.forwardRef(
|
|
|
1056
835
|
tertiary: "text-ghost hover:text-tertiary focus:ring-tertiary/30",
|
|
1057
836
|
ghost: "text-ghost hover:text-ghost focus:ring-ghost/30",
|
|
1058
837
|
neutral: "text-ghost hover:text-gray-700 focus:ring-gray-400/30",
|
|
1059
|
-
// Outline variants
|
|
1060
|
-
"primary-outline": "text-primary hover:bg-primary/10 focus:ring-primary/30",
|
|
1061
|
-
"secondary-outline": "text-secondary hover:bg-secondary/10 focus:ring-secondary/30",
|
|
1062
|
-
"tertiary-outline": "text-tertiary hover:bg-tertiary/10 focus:ring-tertiary/30",
|
|
1063
|
-
"ghost-outline": "text-ghost hover:bg-ghost/10 focus:ring-ghost/30",
|
|
1064
|
-
"neutral-outline": "text-gray-600 hover:bg-gray-100 focus:ring-gray-500/30",
|
|
1065
838
|
// Semantic variants
|
|
1066
839
|
success: "text-ghost hover:text-success focus:ring-success/30",
|
|
1067
|
-
"success-outline": "text-success hover:bg-success/10 focus:ring-success/30",
|
|
1068
840
|
info: "text-ghost hover:text-info focus:ring-info/30",
|
|
1069
|
-
"info-outline": "text-info hover:bg-info/10 focus:ring-info/30",
|
|
1070
841
|
warning: "text-ghost hover:text-warning focus:ring-warning/30",
|
|
1071
|
-
|
|
1072
|
-
danger: "text-ghost hover:text-danger focus:ring-danger/30",
|
|
1073
|
-
"danger-outline": "text-danger hover:bg-danger/10 focus:ring-danger/30"
|
|
842
|
+
danger: "text-ghost hover:text-danger focus:ring-danger/30"
|
|
1074
843
|
},
|
|
1075
844
|
size: {
|
|
1076
845
|
sm: "px-2 py-1.5 text-xs",
|
|
@@ -1078,10 +847,10 @@ const DateSinglePickerInput = React__default.forwardRef(
|
|
|
1078
847
|
lg: "px-4 py-2.5 text-base"
|
|
1079
848
|
},
|
|
1080
849
|
rounded: {
|
|
1081
|
-
first: "rounded-l-
|
|
850
|
+
first: "rounded-l-full",
|
|
1082
851
|
middle: "",
|
|
1083
|
-
last: "rounded-r-
|
|
1084
|
-
single: "rounded-
|
|
852
|
+
last: "rounded-r-full",
|
|
853
|
+
single: "rounded-full"
|
|
1085
854
|
}
|
|
1086
855
|
},
|
|
1087
856
|
defaultVariants: {
|
|
@@ -1093,26 +862,16 @@ const DateSinglePickerInput = React__default.forwardRef(
|
|
|
1093
862
|
), getSegmentSelectedClasses$1 = (e) => {
|
|
1094
863
|
const t = {
|
|
1095
864
|
// Core variants - override hover text color changes
|
|
1096
|
-
primary: "bg-primary text-white
|
|
1097
|
-
secondary: "bg-secondary text-white
|
|
1098
|
-
tertiary: "bg-tertiary text-white
|
|
1099
|
-
ghost: "bg-ghost text-white
|
|
1100
|
-
neutral: "bg-gray-500 text-white
|
|
1101
|
-
// Outline variants - override hover text color changes
|
|
1102
|
-
"primary-outline": "bg-primary text-white shadow-sm hover:text-white",
|
|
1103
|
-
"secondary-outline": "bg-secondary text-white shadow-sm hover:text-white",
|
|
1104
|
-
"tertiary-outline": "bg-tertiary text-white shadow-sm hover:text-white",
|
|
1105
|
-
"ghost-outline": "bg-ghost text-white shadow-sm hover:text-white",
|
|
1106
|
-
"neutral-outline": "bg-gray-500 text-white shadow-sm hover:text-white",
|
|
865
|
+
primary: "bg-primary text-white hover:text-white",
|
|
866
|
+
secondary: "bg-secondary text-white hover:text-white",
|
|
867
|
+
tertiary: "bg-tertiary text-white hover:text-white",
|
|
868
|
+
ghost: "bg-ghost text-white hover:text-white",
|
|
869
|
+
neutral: "bg-gray-500 text-white hover:text-white",
|
|
1107
870
|
// Semantic variants - override hover text color changes
|
|
1108
|
-
success: "bg-success text-white
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
warning: "bg-warning text-white shadow-sm hover:text-white",
|
|
1113
|
-
"warning-outline": "bg-warning text-white shadow-sm hover:text-white",
|
|
1114
|
-
danger: "bg-danger text-white shadow-sm hover:text-white",
|
|
1115
|
-
"danger-outline": "bg-danger text-white shadow-sm hover:text-white"
|
|
871
|
+
success: "bg-success text-white hover:text-white",
|
|
872
|
+
info: "bg-info text-white hover:text-white",
|
|
873
|
+
warning: "bg-warning text-white hover:text-white",
|
|
874
|
+
danger: "bg-danger text-white hover:text-white"
|
|
1116
875
|
};
|
|
1117
876
|
return t[e || "primary"] || t.primary;
|
|
1118
877
|
}, SegmentSingleInputContext = createContext(null), useSegmentSingleInputContext = () => {
|
|
@@ -1123,26 +882,26 @@ const DateSinglePickerInput = React__default.forwardRef(
|
|
|
1123
882
|
);
|
|
1124
883
|
return e;
|
|
1125
884
|
}, SegmentOption$1 = React__default.forwardRef(
|
|
1126
|
-
({ children: e, className: t, disabled:
|
|
1127
|
-
const r = useSegmentSingleInputContext(),
|
|
1128
|
-
if (!
|
|
1129
|
-
const
|
|
1130
|
-
r.onChange?.(
|
|
885
|
+
({ children: e, className: t, disabled: i, id: s, value: n, position: l = "middle", ...u }, o) => {
|
|
886
|
+
const r = useSegmentSingleInputContext(), d = React__default.useId(), x = s || d, c = i || r.disabled, a = r.error ? "danger" : r.variant || "primary", g = r.value === n, h = (b) => {
|
|
887
|
+
if (!c) {
|
|
888
|
+
const f = r.value === n ? null : n;
|
|
889
|
+
r.onChange?.(f);
|
|
1131
890
|
}
|
|
1132
|
-
u.onChange?.(
|
|
891
|
+
u.onChange?.(b);
|
|
1133
892
|
};
|
|
1134
893
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1135
894
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1136
895
|
"input",
|
|
1137
896
|
{
|
|
1138
|
-
ref:
|
|
897
|
+
ref: o,
|
|
1139
898
|
type: "radio",
|
|
1140
899
|
id: x,
|
|
1141
900
|
name: r.name,
|
|
1142
|
-
value:
|
|
1143
|
-
checked:
|
|
1144
|
-
disabled:
|
|
1145
|
-
onChange:
|
|
901
|
+
value: n,
|
|
902
|
+
checked: g,
|
|
903
|
+
disabled: c,
|
|
904
|
+
onChange: h,
|
|
1146
905
|
className: "sr-only",
|
|
1147
906
|
...u
|
|
1148
907
|
}
|
|
@@ -1152,17 +911,14 @@ const DateSinglePickerInput = React__default.forwardRef(
|
|
|
1152
911
|
{
|
|
1153
912
|
htmlFor: x,
|
|
1154
913
|
className: cn(
|
|
914
|
+
"flex flex-row items-center justify-center",
|
|
1155
915
|
segmentOptionVariants$1({
|
|
1156
|
-
variant:
|
|
916
|
+
variant: a,
|
|
1157
917
|
size: r.size,
|
|
1158
|
-
rounded:
|
|
918
|
+
rounded: l
|
|
1159
919
|
}),
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
d && "relative z-10",
|
|
1163
|
-
// Apply disabled styling directly since labels don't support disabled attribute
|
|
1164
|
-
l && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
1165
|
-
r.fullWidth && "flex-1 min-w-0",
|
|
920
|
+
g && getSegmentSelectedClasses$1(a),
|
|
921
|
+
c && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
1166
922
|
t
|
|
1167
923
|
),
|
|
1168
924
|
children: e
|
|
@@ -1176,93 +932,71 @@ const SegmentSingleInputRoot = React__default.forwardRef(
|
|
|
1176
932
|
({
|
|
1177
933
|
variant: e = "primary",
|
|
1178
934
|
size: t = "md",
|
|
1179
|
-
label:
|
|
1180
|
-
helperText:
|
|
1181
|
-
error:
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
}, d) => {
|
|
1191
|
-
const m = !!s, f = {
|
|
935
|
+
label: i,
|
|
936
|
+
helperText: s,
|
|
937
|
+
error: n,
|
|
938
|
+
disabled: l,
|
|
939
|
+
name: u,
|
|
940
|
+
value: o,
|
|
941
|
+
onChange: r,
|
|
942
|
+
children: d,
|
|
943
|
+
...x
|
|
944
|
+
}, c) => {
|
|
945
|
+
const a = !!n, g = {
|
|
1192
946
|
variant: e,
|
|
1193
947
|
size: t,
|
|
1194
|
-
disabled:
|
|
1195
|
-
error:
|
|
1196
|
-
name:
|
|
1197
|
-
value:
|
|
1198
|
-
onChange:
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
{ position: b }
|
|
948
|
+
disabled: l,
|
|
949
|
+
error: a,
|
|
950
|
+
name: u,
|
|
951
|
+
value: o,
|
|
952
|
+
onChange: r
|
|
953
|
+
}, h = React__default.Children.toArray(d), b = h.map((f, y) => {
|
|
954
|
+
if (React__default.isValidElement(f)) {
|
|
955
|
+
let m;
|
|
956
|
+
return h.length === 1 ? m = "single" : y === 0 ? m = "first" : y === h.length - 1 ? m = "last" : m = "middle", React__default.cloneElement(
|
|
957
|
+
f,
|
|
958
|
+
{ position: m }
|
|
1206
959
|
);
|
|
1207
960
|
}
|
|
1208
|
-
return
|
|
961
|
+
return f;
|
|
1209
962
|
});
|
|
1210
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(SegmentSingleInputContext.Provider, { value:
|
|
1211
|
-
"div",
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
className: cn(
|
|
1222
|
-
segmentGroupVariants$1({
|
|
1223
|
-
variant: m ? "danger" : e,
|
|
1224
|
-
size: t,
|
|
1225
|
-
error: m
|
|
1226
|
-
}),
|
|
1227
|
-
l ? "flex w-full" : ""
|
|
1228
|
-
),
|
|
1229
|
-
children: w
|
|
1230
|
-
}
|
|
963
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SegmentSingleInputContext.Provider, { value: g, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: c, ...x, children: [
|
|
964
|
+
i && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: i }),
|
|
965
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
966
|
+
"div",
|
|
967
|
+
{
|
|
968
|
+
className: cn(
|
|
969
|
+
segmentGroupVariants$1({
|
|
970
|
+
variant: a ? "danger" : e,
|
|
971
|
+
size: t,
|
|
972
|
+
error: a
|
|
973
|
+
})
|
|
1231
974
|
),
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
}
|
|
1236
|
-
|
|
975
|
+
children: b
|
|
976
|
+
}
|
|
977
|
+
),
|
|
978
|
+
a && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
|
|
979
|
+
!a && s && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
|
|
980
|
+
] }) });
|
|
1237
981
|
}
|
|
1238
982
|
), SegmentSingleInput = Object.assign(SegmentSingleInputRoot, {
|
|
1239
983
|
Option: SegmentOption$1
|
|
1240
984
|
}), segmentGroupVariants = cva(
|
|
1241
|
-
"
|
|
985
|
+
"flex flex-row rounded-full border overflow-hidden p-1 gap-0.25",
|
|
1242
986
|
{
|
|
1243
987
|
variants: {
|
|
1244
988
|
variant: {
|
|
1245
989
|
// Core variants using Versaur color system
|
|
1246
|
-
primary: "border-primary
|
|
1247
|
-
secondary: "border-secondary
|
|
1248
|
-
tertiary: "border-tertiary
|
|
1249
|
-
ghost: "border-ghost
|
|
990
|
+
primary: "border-primary-light",
|
|
991
|
+
secondary: "border-secondary-light",
|
|
992
|
+
tertiary: "border-tertiary-light",
|
|
993
|
+
ghost: "border-ghost-light",
|
|
1250
994
|
neutral: "border-gray-200",
|
|
1251
|
-
// Outline variants
|
|
1252
|
-
"primary-outline": "border-primary",
|
|
1253
|
-
"secondary-outline": "border-secondary",
|
|
1254
|
-
"tertiary-outline": "border-tertiary",
|
|
1255
|
-
"ghost-outline": "border-ghost",
|
|
1256
|
-
"neutral-outline": "border-gray-400",
|
|
1257
995
|
// Semantic variants
|
|
1258
|
-
success: "border-success
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
warning: "border-warning/20",
|
|
1263
|
-
"warning-outline": "border-warning",
|
|
1264
|
-
danger: "border-danger/20",
|
|
1265
|
-
"danger-outline": "border-danger"
|
|
996
|
+
success: "border-success-light",
|
|
997
|
+
info: "border-info-light",
|
|
998
|
+
warning: "border-warning-light",
|
|
999
|
+
danger: "border-danger-light"
|
|
1266
1000
|
},
|
|
1267
1001
|
size: {
|
|
1268
1002
|
sm: "text-xs",
|
|
@@ -1281,7 +1015,7 @@ const SegmentSingleInputRoot = React__default.forwardRef(
|
|
|
1281
1015
|
}
|
|
1282
1016
|
}
|
|
1283
1017
|
), segmentOptionVariants = cva(
|
|
1284
|
-
"relative flex flex-row items-center px-3 py-2 text-center font-medium transition-all duration-200 cursor-pointer border-0 bg-transparent outline-none focus:ring-2 focus:ring-offset-1 flex-1",
|
|
1018
|
+
"inline relative flex flex-row items-center px-3 py-2 text-center font-medium transition-all duration-200 cursor-pointer border-0 bg-transparent outline-none focus:ring-2 focus:ring-offset-1 flex-1",
|
|
1285
1019
|
{
|
|
1286
1020
|
variants: {
|
|
1287
1021
|
variant: {
|
|
@@ -1291,21 +1025,11 @@ const SegmentSingleInputRoot = React__default.forwardRef(
|
|
|
1291
1025
|
tertiary: "text-ghost hover:text-tertiary focus:ring-tertiary/30",
|
|
1292
1026
|
ghost: "text-ghost hover:text-ghost focus:ring-ghost/30",
|
|
1293
1027
|
neutral: "text-ghost hover:text-gray-700 focus:ring-gray-400/30",
|
|
1294
|
-
// Outline variants
|
|
1295
|
-
"primary-outline": "text-primary hover:bg-primary/10 focus:ring-primary/30",
|
|
1296
|
-
"secondary-outline": "text-secondary hover:bg-secondary/10 focus:ring-secondary/30",
|
|
1297
|
-
"tertiary-outline": "text-tertiary hover:bg-tertiary/10 focus:ring-tertiary/30",
|
|
1298
|
-
"ghost-outline": "text-ghost hover:bg-ghost/10 focus:ring-ghost/30",
|
|
1299
|
-
"neutral-outline": "text-gray-600 hover:bg-gray-100 focus:ring-gray-500/30",
|
|
1300
1028
|
// Semantic variants
|
|
1301
1029
|
success: "text-ghost hover:text-success focus:ring-success/30",
|
|
1302
|
-
"success-outline": "text-success hover:bg-success/10 focus:ring-success/30",
|
|
1303
1030
|
info: "text-ghost hover:text-info focus:ring-info/30",
|
|
1304
|
-
"info-outline": "text-info hover:bg-info/10 focus:ring-info/30",
|
|
1305
1031
|
warning: "text-ghost hover:text-warning focus:ring-warning/30",
|
|
1306
|
-
|
|
1307
|
-
danger: "text-ghost hover:text-danger focus:ring-danger/30",
|
|
1308
|
-
"danger-outline": "text-danger hover:bg-danger/10 focus:ring-danger/30"
|
|
1032
|
+
danger: "text-ghost hover:text-danger focus:ring-danger/30"
|
|
1309
1033
|
},
|
|
1310
1034
|
size: {
|
|
1311
1035
|
sm: "px-2 py-1.5 text-xs",
|
|
@@ -1313,10 +1037,10 @@ const SegmentSingleInputRoot = React__default.forwardRef(
|
|
|
1313
1037
|
lg: "px-4 py-2.5 text-base"
|
|
1314
1038
|
},
|
|
1315
1039
|
rounded: {
|
|
1316
|
-
first: "rounded-l-
|
|
1040
|
+
first: "rounded-l-full",
|
|
1317
1041
|
middle: "",
|
|
1318
|
-
last: "rounded-r-
|
|
1319
|
-
single: "rounded-
|
|
1042
|
+
last: "rounded-r-full",
|
|
1043
|
+
single: "rounded-full"
|
|
1320
1044
|
}
|
|
1321
1045
|
},
|
|
1322
1046
|
defaultVariants: {
|
|
@@ -1328,26 +1052,16 @@ const SegmentSingleInputRoot = React__default.forwardRef(
|
|
|
1328
1052
|
), getSegmentSelectedClasses = (e) => {
|
|
1329
1053
|
const t = {
|
|
1330
1054
|
// Core variants - override hover text color changes
|
|
1331
|
-
primary: "bg-primary text-white
|
|
1332
|
-
secondary: "bg-secondary text-white
|
|
1333
|
-
tertiary: "bg-tertiary text-white
|
|
1334
|
-
ghost: "bg-ghost text-white
|
|
1335
|
-
neutral: "bg-gray-500 text-white
|
|
1336
|
-
// Outline variants - override hover text color changes
|
|
1337
|
-
"primary-outline": "bg-primary text-white shadow-sm hover:text-white",
|
|
1338
|
-
"secondary-outline": "bg-secondary text-white shadow-sm hover:text-white",
|
|
1339
|
-
"tertiary-outline": "bg-tertiary text-white shadow-sm hover:text-white",
|
|
1340
|
-
"ghost-outline": "bg-ghost text-white shadow-sm hover:text-white",
|
|
1341
|
-
"neutral-outline": "bg-gray-500 text-white shadow-sm hover:text-white",
|
|
1055
|
+
primary: "bg-primary text-white hover:text-white",
|
|
1056
|
+
secondary: "bg-secondary text-white hover:text-white",
|
|
1057
|
+
tertiary: "bg-tertiary text-white hover:text-white",
|
|
1058
|
+
ghost: "bg-ghost text-white hover:text-white",
|
|
1059
|
+
neutral: "bg-gray-500 text-white hover:text-white",
|
|
1342
1060
|
// Semantic variants - override hover text color changes
|
|
1343
|
-
success: "bg-success text-white
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
warning: "bg-warning text-white shadow-sm hover:text-white",
|
|
1348
|
-
"warning-outline": "bg-warning text-white shadow-sm hover:text-white",
|
|
1349
|
-
danger: "bg-danger text-white shadow-sm hover:text-white",
|
|
1350
|
-
"danger-outline": "bg-danger text-white shadow-sm hover:text-white"
|
|
1061
|
+
success: "bg-success text-white hover:text-white",
|
|
1062
|
+
info: "bg-info text-white hover:text-white",
|
|
1063
|
+
warning: "bg-warning text-white hover:text-white",
|
|
1064
|
+
danger: "bg-danger text-white hover:text-white"
|
|
1351
1065
|
};
|
|
1352
1066
|
return t[e || "primary"] || t.primary;
|
|
1353
1067
|
}, SegmentMultipleInputContext = createContext(null), useSegmentMultipleInputContext = () => {
|
|
@@ -1358,27 +1072,27 @@ const SegmentSingleInputRoot = React__default.forwardRef(
|
|
|
1358
1072
|
);
|
|
1359
1073
|
return e;
|
|
1360
1074
|
}, SegmentOption = React__default.forwardRef(
|
|
1361
|
-
({ children: e, className: t, disabled:
|
|
1362
|
-
const r = useSegmentMultipleInputContext(),
|
|
1363
|
-
if (!
|
|
1364
|
-
const
|
|
1365
|
-
let
|
|
1366
|
-
|
|
1075
|
+
({ children: e, className: t, disabled: i, id: s, value: n, position: l = "middle", ...u }, o) => {
|
|
1076
|
+
const r = useSegmentMultipleInputContext(), d = React__default.useId(), x = s || d, c = i || r.disabled, a = r.error ? "danger" : r.variant || "primary", g = r.value?.includes(n) ?? !1, h = (b) => {
|
|
1077
|
+
if (!c) {
|
|
1078
|
+
const f = r.value || [];
|
|
1079
|
+
let y;
|
|
1080
|
+
g ? y = f.filter((m) => m !== n) : y = [...f, n], r.onChange?.(y);
|
|
1367
1081
|
}
|
|
1368
|
-
u.onChange?.(
|
|
1082
|
+
u.onChange?.(b);
|
|
1369
1083
|
};
|
|
1370
1084
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1371
1085
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1372
1086
|
"input",
|
|
1373
1087
|
{
|
|
1374
|
-
ref:
|
|
1088
|
+
ref: o,
|
|
1375
1089
|
type: "checkbox",
|
|
1376
1090
|
id: x,
|
|
1377
1091
|
name: `${r.name}[]`,
|
|
1378
|
-
value:
|
|
1379
|
-
checked:
|
|
1380
|
-
disabled:
|
|
1381
|
-
onChange:
|
|
1092
|
+
value: n,
|
|
1093
|
+
checked: g,
|
|
1094
|
+
disabled: c,
|
|
1095
|
+
onChange: h,
|
|
1382
1096
|
className: "sr-only",
|
|
1383
1097
|
...u
|
|
1384
1098
|
}
|
|
@@ -1388,16 +1102,14 @@ const SegmentSingleInputRoot = React__default.forwardRef(
|
|
|
1388
1102
|
{
|
|
1389
1103
|
htmlFor: x,
|
|
1390
1104
|
className: cn(
|
|
1105
|
+
"flex flex-row items-center justify-center",
|
|
1391
1106
|
segmentOptionVariants({
|
|
1392
|
-
variant:
|
|
1107
|
+
variant: a,
|
|
1393
1108
|
size: r.size,
|
|
1394
|
-
rounded:
|
|
1109
|
+
rounded: l
|
|
1395
1110
|
}),
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
d && "relative z-10",
|
|
1399
|
-
// Apply disabled styling directly since labels don't support disabled attribute
|
|
1400
|
-
l && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
1111
|
+
g && getSegmentSelectedClasses(a),
|
|
1112
|
+
c && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
1401
1113
|
t
|
|
1402
1114
|
),
|
|
1403
1115
|
children: e
|
|
@@ -1411,70 +1123,83 @@ const SegmentMultipleInputRoot = React__default.forwardRef(
|
|
|
1411
1123
|
({
|
|
1412
1124
|
variant: e = "primary",
|
|
1413
1125
|
size: t = "md",
|
|
1414
|
-
label:
|
|
1415
|
-
helperText:
|
|
1416
|
-
error:
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
}, d) => {
|
|
1426
|
-
const m = !!s, f = {
|
|
1126
|
+
label: i,
|
|
1127
|
+
helperText: s,
|
|
1128
|
+
error: n,
|
|
1129
|
+
disabled: l,
|
|
1130
|
+
name: u,
|
|
1131
|
+
value: o = [],
|
|
1132
|
+
onChange: r,
|
|
1133
|
+
children: d,
|
|
1134
|
+
...x
|
|
1135
|
+
}, c) => {
|
|
1136
|
+
const a = !!n, g = {
|
|
1427
1137
|
variant: e,
|
|
1428
1138
|
size: t,
|
|
1429
|
-
disabled:
|
|
1430
|
-
error:
|
|
1431
|
-
name:
|
|
1432
|
-
value:
|
|
1433
|
-
onChange:
|
|
1434
|
-
}, h = React__default.Children.toArray(
|
|
1435
|
-
if (React__default.isValidElement(
|
|
1436
|
-
let
|
|
1437
|
-
return h.length === 1 ?
|
|
1438
|
-
|
|
1439
|
-
{ position:
|
|
1139
|
+
disabled: l,
|
|
1140
|
+
error: a,
|
|
1141
|
+
name: u,
|
|
1142
|
+
value: o,
|
|
1143
|
+
onChange: r
|
|
1144
|
+
}, h = React__default.Children.toArray(d), b = h.map((f, y) => {
|
|
1145
|
+
if (React__default.isValidElement(f)) {
|
|
1146
|
+
let m;
|
|
1147
|
+
return h.length === 1 ? m = "single" : y === 0 ? m = "first" : y === h.length - 1 ? m = "last" : m = "middle", React__default.cloneElement(
|
|
1148
|
+
f,
|
|
1149
|
+
{ position: m }
|
|
1440
1150
|
);
|
|
1441
1151
|
}
|
|
1442
|
-
return
|
|
1152
|
+
return f;
|
|
1443
1153
|
});
|
|
1444
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(SegmentMultipleInputContext.Provider, { value:
|
|
1445
|
-
"div",
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1456
|
-
"div",
|
|
1457
|
-
{
|
|
1458
|
-
className: cn(
|
|
1459
|
-
segmentGroupVariants({
|
|
1460
|
-
variant: m ? "danger" : e,
|
|
1461
|
-
size: t,
|
|
1462
|
-
error: m
|
|
1463
|
-
}),
|
|
1464
|
-
l && "flex w-full"
|
|
1465
|
-
),
|
|
1466
|
-
children: w
|
|
1467
|
-
}
|
|
1154
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SegmentMultipleInputContext.Provider, { value: g, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: c, ...x, children: [
|
|
1155
|
+
i && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "block text-sm font-medium text-foreground mb-3", children: i }),
|
|
1156
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1157
|
+
"div",
|
|
1158
|
+
{
|
|
1159
|
+
className: cn(
|
|
1160
|
+
segmentGroupVariants({
|
|
1161
|
+
variant: a ? "danger" : e,
|
|
1162
|
+
size: t,
|
|
1163
|
+
error: a
|
|
1164
|
+
})
|
|
1468
1165
|
),
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1166
|
+
children: b
|
|
1167
|
+
}
|
|
1168
|
+
),
|
|
1169
|
+
a && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-sm text-danger", role: "alert", children: n }),
|
|
1170
|
+
!a && s && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-sm text-gray-600", children: s })
|
|
1171
|
+
] }) });
|
|
1474
1172
|
}
|
|
1475
1173
|
), SegmentMultipleInput = Object.assign(SegmentMultipleInputRoot, {
|
|
1476
1174
|
Option: SegmentOption
|
|
1477
|
-
}),
|
|
1175
|
+
}), SearchInput = forwardRef(
|
|
1176
|
+
({
|
|
1177
|
+
autoComplete: e = "off",
|
|
1178
|
+
spellCheck: t = !1,
|
|
1179
|
+
inputMode: i = "search",
|
|
1180
|
+
placeholder: s = "Search...",
|
|
1181
|
+
maxLength: n = 256,
|
|
1182
|
+
enterKeyHint: l = "search",
|
|
1183
|
+
"aria-label": u = "Search",
|
|
1184
|
+
// internal default, not in props
|
|
1185
|
+
...o
|
|
1186
|
+
}, r) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1187
|
+
TextInput,
|
|
1188
|
+
{
|
|
1189
|
+
ref: r,
|
|
1190
|
+
type: "search",
|
|
1191
|
+
inputMode: i,
|
|
1192
|
+
autoComplete: e,
|
|
1193
|
+
spellCheck: t,
|
|
1194
|
+
placeholder: s,
|
|
1195
|
+
maxLength: n,
|
|
1196
|
+
enterKeyHint: l,
|
|
1197
|
+
"aria-label": u,
|
|
1198
|
+
leftContent: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: SearchIcon, color: "inherit", size: "sm" }),
|
|
1199
|
+
...o
|
|
1200
|
+
}
|
|
1201
|
+
)
|
|
1202
|
+
), selectInputVariants = cva(
|
|
1478
1203
|
"block w-full rounded-md border bg-white transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none disabled:bg-gray-50 appearance-none bg-no-repeat bg-right pr-10",
|
|
1479
1204
|
{
|
|
1480
1205
|
variants: {
|
|
@@ -1510,43 +1235,43 @@ const SegmentMultipleInputRoot = React__default.forwardRef(
|
|
|
1510
1235
|
({
|
|
1511
1236
|
variant: e = "primary",
|
|
1512
1237
|
label: t,
|
|
1513
|
-
helperText:
|
|
1514
|
-
error:
|
|
1515
|
-
className:
|
|
1516
|
-
disabled:
|
|
1238
|
+
helperText: i,
|
|
1239
|
+
error: s,
|
|
1240
|
+
className: n,
|
|
1241
|
+
disabled: l,
|
|
1517
1242
|
id: u,
|
|
1518
|
-
placeholder:
|
|
1243
|
+
placeholder: o,
|
|
1519
1244
|
children: r,
|
|
1520
|
-
...
|
|
1245
|
+
...d
|
|
1521
1246
|
}, x) => {
|
|
1522
|
-
const
|
|
1247
|
+
const c = React__default.useId(), a = u || c, g = !!s;
|
|
1523
1248
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
1524
1249
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1525
1250
|
"label",
|
|
1526
1251
|
{
|
|
1527
|
-
htmlFor:
|
|
1252
|
+
htmlFor: a,
|
|
1528
1253
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
1529
1254
|
children: t
|
|
1530
1255
|
}
|
|
1531
1256
|
),
|
|
1532
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("relative w-full",
|
|
1257
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("relative w-full", n), children: [
|
|
1533
1258
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1534
1259
|
"select",
|
|
1535
1260
|
{
|
|
1536
1261
|
ref: x,
|
|
1537
|
-
id:
|
|
1538
|
-
"aria-invalid":
|
|
1539
|
-
"aria-disabled":
|
|
1540
|
-
disabled:
|
|
1262
|
+
id: a,
|
|
1263
|
+
"aria-invalid": g,
|
|
1264
|
+
"aria-disabled": l,
|
|
1265
|
+
disabled: l,
|
|
1541
1266
|
className: cn(
|
|
1542
1267
|
selectInputVariants({
|
|
1543
|
-
variant:
|
|
1268
|
+
variant: g ? "danger" : e
|
|
1544
1269
|
}),
|
|
1545
1270
|
"h-10 pl-3"
|
|
1546
1271
|
),
|
|
1547
|
-
...
|
|
1272
|
+
...d,
|
|
1548
1273
|
children: [
|
|
1549
|
-
|
|
1274
|
+
o && /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", disabled: !0, hidden: !0, children: o }),
|
|
1550
1275
|
r
|
|
1551
1276
|
]
|
|
1552
1277
|
}
|
|
@@ -1570,8 +1295,8 @@ const SegmentMultipleInputRoot = React__default.forwardRef(
|
|
|
1570
1295
|
}
|
|
1571
1296
|
) })
|
|
1572
1297
|
] }),
|
|
1573
|
-
|
|
1574
|
-
!
|
|
1298
|
+
g && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-sm text-danger", role: "alert", children: s }),
|
|
1299
|
+
!g && i && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-sm text-gray-600", children: i })
|
|
1575
1300
|
] });
|
|
1576
1301
|
}
|
|
1577
1302
|
);
|
|
@@ -1617,22 +1342,22 @@ const textAreaInputVariants = cva(
|
|
|
1617
1342
|
({
|
|
1618
1343
|
variant: e = "primary",
|
|
1619
1344
|
label: t,
|
|
1620
|
-
helperText:
|
|
1621
|
-
error:
|
|
1622
|
-
className:
|
|
1623
|
-
disabled:
|
|
1345
|
+
helperText: i,
|
|
1346
|
+
error: s,
|
|
1347
|
+
className: n,
|
|
1348
|
+
disabled: l,
|
|
1624
1349
|
id: u,
|
|
1625
|
-
minRows:
|
|
1350
|
+
minRows: o = 3,
|
|
1626
1351
|
maxRows: r,
|
|
1627
|
-
fieldSizing:
|
|
1352
|
+
fieldSizing: d = "fixed",
|
|
1628
1353
|
style: x,
|
|
1629
|
-
rows:
|
|
1630
|
-
...
|
|
1631
|
-
},
|
|
1632
|
-
const
|
|
1633
|
-
...
|
|
1634
|
-
...
|
|
1635
|
-
maxHeight: `${
|
|
1354
|
+
rows: c,
|
|
1355
|
+
...a
|
|
1356
|
+
}, g) => {
|
|
1357
|
+
const h = React__default.useId(), b = u || h, f = !!s, y = c || o, m = d === "content" ? void 0 : r, w = {
|
|
1358
|
+
...d === "content" && { fieldSizing: "content" },
|
|
1359
|
+
...m && {
|
|
1360
|
+
maxHeight: `${m * 1.5}rem`
|
|
1636
1361
|
// Approximate line height
|
|
1637
1362
|
},
|
|
1638
1363
|
...x
|
|
@@ -1641,33 +1366,33 @@ const textAreaInputVariants = cva(
|
|
|
1641
1366
|
t && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1642
1367
|
"label",
|
|
1643
1368
|
{
|
|
1644
|
-
htmlFor:
|
|
1369
|
+
htmlFor: b,
|
|
1645
1370
|
className: "block text-sm font-medium text-foreground mb-2",
|
|
1646
1371
|
children: t
|
|
1647
1372
|
}
|
|
1648
1373
|
),
|
|
1649
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("relative w-full",
|
|
1374
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("relative w-full", n), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1650
1375
|
"textarea",
|
|
1651
1376
|
{
|
|
1652
|
-
ref:
|
|
1653
|
-
id:
|
|
1654
|
-
rows:
|
|
1655
|
-
"aria-invalid":
|
|
1656
|
-
"aria-disabled":
|
|
1657
|
-
disabled:
|
|
1658
|
-
style:
|
|
1377
|
+
ref: g,
|
|
1378
|
+
id: b,
|
|
1379
|
+
rows: y,
|
|
1380
|
+
"aria-invalid": f,
|
|
1381
|
+
"aria-disabled": l,
|
|
1382
|
+
disabled: l,
|
|
1383
|
+
style: w,
|
|
1659
1384
|
className: cn(
|
|
1660
1385
|
textAreaInputVariants({
|
|
1661
|
-
variant:
|
|
1662
|
-
fieldSizing:
|
|
1386
|
+
variant: f ? "danger" : e,
|
|
1387
|
+
fieldSizing: d
|
|
1663
1388
|
}),
|
|
1664
1389
|
"px-3 py-2"
|
|
1665
1390
|
),
|
|
1666
|
-
...
|
|
1391
|
+
...a
|
|
1667
1392
|
}
|
|
1668
1393
|
) }),
|
|
1669
|
-
|
|
1670
|
-
!
|
|
1394
|
+
f && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-sm text-danger", role: "alert", children: s }),
|
|
1395
|
+
!f && i && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-sm text-gray-600", children: i })
|
|
1671
1396
|
] });
|
|
1672
1397
|
}
|
|
1673
1398
|
);
|
|
@@ -1694,9 +1419,9 @@ const timeSegmentButtonVariants = cva(
|
|
|
1694
1419
|
), TimeField = ({
|
|
1695
1420
|
value: e,
|
|
1696
1421
|
onChange: t,
|
|
1697
|
-
label:
|
|
1698
|
-
"aria-label":
|
|
1699
|
-
disabled:
|
|
1422
|
+
label: i,
|
|
1423
|
+
"aria-label": s,
|
|
1424
|
+
disabled: n
|
|
1700
1425
|
}) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1701
1426
|
"input",
|
|
1702
1427
|
{
|
|
@@ -1705,131 +1430,131 @@ const timeSegmentButtonVariants = cva(
|
|
|
1705
1430
|
pattern: "[0-9]*",
|
|
1706
1431
|
maxLength: 2,
|
|
1707
1432
|
value: e,
|
|
1708
|
-
onChange: (
|
|
1433
|
+
onChange: (l) => t(l.target.value),
|
|
1709
1434
|
className: "w-12 h-12 text-center text-2xl border-b-2 border-primary bg-transparent focus:outline-none focus:border-primary",
|
|
1710
|
-
"aria-label":
|
|
1711
|
-
disabled:
|
|
1435
|
+
"aria-label": s || i,
|
|
1436
|
+
disabled: n,
|
|
1712
1437
|
autoComplete: "off"
|
|
1713
1438
|
}
|
|
1714
1439
|
), AmPmSegment = ({
|
|
1715
1440
|
value: e,
|
|
1716
1441
|
onChange: t,
|
|
1717
|
-
disabled:
|
|
1718
|
-
}) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 ml-4", children: ["AM", "PM"].map((
|
|
1442
|
+
disabled: i
|
|
1443
|
+
}) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-1 ml-4", children: ["AM", "PM"].map((s) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1719
1444
|
"button",
|
|
1720
1445
|
{
|
|
1721
1446
|
type: "button",
|
|
1722
1447
|
className: cn(
|
|
1723
1448
|
timeSegmentButtonVariants({
|
|
1724
|
-
active: e ===
|
|
1449
|
+
active: e === s,
|
|
1725
1450
|
size: "sm"
|
|
1726
1451
|
})
|
|
1727
1452
|
),
|
|
1728
|
-
"aria-pressed": e ===
|
|
1729
|
-
onClick: () => t(
|
|
1730
|
-
disabled:
|
|
1731
|
-
children:
|
|
1453
|
+
"aria-pressed": e === s,
|
|
1454
|
+
onClick: () => t(s),
|
|
1455
|
+
disabled: i,
|
|
1456
|
+
children: s
|
|
1732
1457
|
},
|
|
1733
|
-
|
|
1458
|
+
s
|
|
1734
1459
|
)) }), TimePickerInput = ({
|
|
1735
1460
|
value: e,
|
|
1736
1461
|
onChange: t,
|
|
1737
|
-
label:
|
|
1738
|
-
helperText:
|
|
1739
|
-
disabled:
|
|
1740
|
-
error:
|
|
1741
|
-
placement: u,
|
|
1742
|
-
"aria-label":
|
|
1462
|
+
label: i,
|
|
1463
|
+
helperText: s,
|
|
1464
|
+
disabled: n,
|
|
1465
|
+
error: l,
|
|
1466
|
+
placement: u = "top",
|
|
1467
|
+
"aria-label": o,
|
|
1743
1468
|
"aria-labelledby": r,
|
|
1744
|
-
"aria-describedby":
|
|
1469
|
+
"aria-describedby": d
|
|
1745
1470
|
}) => {
|
|
1746
|
-
const [x,
|
|
1747
|
-
const p =
|
|
1471
|
+
const [x, c] = useState(!1), a = (j) => {
|
|
1472
|
+
const p = j.match(/^(\d{1,2}):(\d{2})\s?(AM|PM)$/i);
|
|
1748
1473
|
return p ? {
|
|
1749
1474
|
hour: p[1],
|
|
1750
1475
|
minute: p[2],
|
|
1751
1476
|
period: p[3].toUpperCase()
|
|
1752
1477
|
} : { hour: "", minute: "", period: "AM" };
|
|
1753
|
-
}, [{ hour:
|
|
1754
|
-
|
|
1755
|
-
},
|
|
1756
|
-
let p =
|
|
1757
|
-
p.length > 2 && (p = p.slice(0, 2)), Number(p) > 12 && (p = "12"),
|
|
1758
|
-
},
|
|
1759
|
-
let p =
|
|
1760
|
-
p.length > 2 && (p = p.slice(0, 2)), Number(p) > 59 && (p = "59"),
|
|
1761
|
-
},
|
|
1762
|
-
|
|
1478
|
+
}, [{ hour: g, minute: h, period: b }, f] = useState(() => a(e)), y = () => {
|
|
1479
|
+
n || (f(a(e)), c(!0));
|
|
1480
|
+
}, m = (j) => {
|
|
1481
|
+
let p = j.replace(/[^\d]/g, "");
|
|
1482
|
+
p.length > 2 && (p = p.slice(0, 2)), Number(p) > 12 && (p = "12"), f((E) => ({ ...E, hour: p }));
|
|
1483
|
+
}, w = (j) => {
|
|
1484
|
+
let p = j.replace(/[^\d]/g, "");
|
|
1485
|
+
p.length > 2 && (p = p.slice(0, 2)), Number(p) > 59 && (p = "59"), f((E) => ({ ...E, minute: p }));
|
|
1486
|
+
}, R = (j) => {
|
|
1487
|
+
f((p) => ({ ...p, period: j }));
|
|
1763
1488
|
}, C = () => {
|
|
1764
|
-
|
|
1765
|
-
},
|
|
1766
|
-
const
|
|
1767
|
-
t(`${
|
|
1489
|
+
f(a(e)), c(!1);
|
|
1490
|
+
}, k = () => {
|
|
1491
|
+
const j = g.padStart(2, "0") || "12", p = h.padStart(2, "0") || "00";
|
|
1492
|
+
t(`${j}:${p} ${b}`), c(!1);
|
|
1768
1493
|
};
|
|
1769
1494
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
1770
1495
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1771
1496
|
TextInput,
|
|
1772
1497
|
{
|
|
1773
|
-
label:
|
|
1498
|
+
label: i,
|
|
1774
1499
|
value: e,
|
|
1775
|
-
onClick:
|
|
1500
|
+
onClick: y,
|
|
1776
1501
|
readOnly: !0,
|
|
1777
|
-
disabled:
|
|
1778
|
-
error:
|
|
1779
|
-
helperText:
|
|
1780
|
-
"aria-label":
|
|
1502
|
+
disabled: n,
|
|
1503
|
+
error: l,
|
|
1504
|
+
helperText: s,
|
|
1505
|
+
"aria-label": o,
|
|
1781
1506
|
"aria-labelledby": r,
|
|
1782
|
-
"aria-describedby":
|
|
1507
|
+
"aria-describedby": d,
|
|
1783
1508
|
className: "cursor-pointer bg-white",
|
|
1784
|
-
|
|
1509
|
+
leftContent: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: Clock, size: "sm", color: "inherit" })
|
|
1785
1510
|
}
|
|
1786
1511
|
),
|
|
1787
1512
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1788
1513
|
Modal,
|
|
1789
1514
|
{
|
|
1790
1515
|
isOpen: x,
|
|
1791
|
-
onOpenChange:
|
|
1516
|
+
onOpenChange: c,
|
|
1792
1517
|
placement: u,
|
|
1793
|
-
size: "
|
|
1794
|
-
"aria-label":
|
|
1518
|
+
size: "fit-content",
|
|
1519
|
+
"aria-label": o,
|
|
1795
1520
|
"aria-labelledby": r,
|
|
1796
|
-
"aria-describedby":
|
|
1521
|
+
"aria-describedby": d,
|
|
1797
1522
|
children: [
|
|
1798
1523
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Modal.Header, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "lg", fontWeight: "semibold", children: "Select time" }) }),
|
|
1799
1524
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Modal.Body, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 justify-center py-2", children: [
|
|
1800
1525
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1801
1526
|
TimeField,
|
|
1802
1527
|
{
|
|
1803
|
-
value:
|
|
1804
|
-
onChange:
|
|
1528
|
+
value: g,
|
|
1529
|
+
onChange: m,
|
|
1805
1530
|
label: "Hour",
|
|
1806
1531
|
"aria-label": "Hour",
|
|
1807
|
-
disabled:
|
|
1532
|
+
disabled: n
|
|
1808
1533
|
}
|
|
1809
1534
|
),
|
|
1810
1535
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Text, { as: "span", fontSize: "2xl", className: "select-none", children: ":" }),
|
|
1811
1536
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1812
1537
|
TimeField,
|
|
1813
1538
|
{
|
|
1814
|
-
value:
|
|
1815
|
-
onChange:
|
|
1539
|
+
value: h,
|
|
1540
|
+
onChange: w,
|
|
1816
1541
|
label: "Minute",
|
|
1817
1542
|
"aria-label": "Minute",
|
|
1818
|
-
disabled:
|
|
1543
|
+
disabled: n
|
|
1819
1544
|
}
|
|
1820
1545
|
),
|
|
1821
1546
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1822
1547
|
AmPmSegment,
|
|
1823
1548
|
{
|
|
1824
|
-
value:
|
|
1825
|
-
onChange:
|
|
1826
|
-
disabled:
|
|
1549
|
+
value: b === "AM" ? "AM" : "PM",
|
|
1550
|
+
onChange: R,
|
|
1551
|
+
disabled: n
|
|
1827
1552
|
}
|
|
1828
1553
|
)
|
|
1829
1554
|
] }) }),
|
|
1830
1555
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(Modal.Footer, { children: [
|
|
1831
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", size: "
|
|
1832
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "primary", size: "
|
|
1556
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", size: "sm", onClick: C, children: "Cancel" }),
|
|
1557
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "primary-ghost", size: "sm", onClick: k, children: "Confirm" })
|
|
1833
1558
|
] })
|
|
1834
1559
|
]
|
|
1835
1560
|
}
|
|
@@ -1913,27 +1638,27 @@ const timeSegmentButtonVariants = cva(
|
|
|
1913
1638
|
), SwitchTrack = ({
|
|
1914
1639
|
color: e = "primary",
|
|
1915
1640
|
size: t = "md",
|
|
1916
|
-
disabled:
|
|
1917
|
-
className:
|
|
1918
|
-
checked:
|
|
1641
|
+
disabled: i = !1,
|
|
1642
|
+
className: s,
|
|
1643
|
+
checked: n
|
|
1919
1644
|
}) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1920
1645
|
"span",
|
|
1921
1646
|
{
|
|
1922
1647
|
className: cn(
|
|
1923
|
-
switchVariants({ color: e, size: t, disabled:
|
|
1648
|
+
switchVariants({ color: e, size: t, disabled: i, checked: n }),
|
|
1924
1649
|
"rounded-full pointer-events-none",
|
|
1925
|
-
|
|
1650
|
+
s
|
|
1926
1651
|
),
|
|
1927
1652
|
"aria-hidden": "true"
|
|
1928
1653
|
}
|
|
1929
|
-
), SwitchThumb = ({ size: e = "md", checked: t = !1 }) => /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: cn(thumbVariants({ size: e, checked: t })), "aria-hidden": "true" }), SwitchLabel = ({ label: e, htmlFor: t, placement:
|
|
1654
|
+
), SwitchThumb = ({ size: e = "md", checked: t = !1 }) => /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: cn(thumbVariants({ size: e, checked: t })), "aria-hidden": "true" }), SwitchLabel = ({ label: e, htmlFor: t, placement: i = "top", disabled: s = !1 }) => e ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1930
1655
|
"label",
|
|
1931
1656
|
{
|
|
1932
1657
|
htmlFor: t,
|
|
1933
1658
|
className: cn(
|
|
1934
1659
|
"text-sm select-none font-medium text-foreground",
|
|
1935
|
-
|
|
1936
|
-
|
|
1660
|
+
i === "inline" ? "ml-2 mb-0" : "mb-1",
|
|
1661
|
+
s && "opacity-50 cursor-not-allowed"
|
|
1937
1662
|
),
|
|
1938
1663
|
children: e
|
|
1939
1664
|
}
|
|
@@ -1941,21 +1666,21 @@ const timeSegmentButtonVariants = cva(
|
|
|
1941
1666
|
({
|
|
1942
1667
|
checked: e,
|
|
1943
1668
|
defaultChecked: t,
|
|
1944
|
-
onCheckedChange:
|
|
1945
|
-
color:
|
|
1946
|
-
size:
|
|
1947
|
-
label:
|
|
1669
|
+
onCheckedChange: i,
|
|
1670
|
+
color: s = "primary",
|
|
1671
|
+
size: n = "md",
|
|
1672
|
+
label: l,
|
|
1948
1673
|
labelPlacement: u = "top",
|
|
1949
|
-
disabled:
|
|
1674
|
+
disabled: o = !1,
|
|
1950
1675
|
className: r,
|
|
1951
|
-
id:
|
|
1676
|
+
id: d,
|
|
1952
1677
|
ariaLabel: x,
|
|
1953
|
-
...
|
|
1954
|
-
},
|
|
1955
|
-
const [
|
|
1678
|
+
...c
|
|
1679
|
+
}, a) => {
|
|
1680
|
+
const [g, h] = useState(
|
|
1956
1681
|
t ?? !1
|
|
1957
|
-
),
|
|
1958
|
-
|
|
1682
|
+
), b = useId(), f = d || b, y = typeof e == "boolean", m = y ? e : g, w = (R) => {
|
|
1683
|
+
y || h(R.target.checked), i?.(R.target.checked);
|
|
1959
1684
|
};
|
|
1960
1685
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
1961
1686
|
"div",
|
|
@@ -1969,10 +1694,10 @@ const timeSegmentButtonVariants = cva(
|
|
|
1969
1694
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1970
1695
|
SwitchLabel,
|
|
1971
1696
|
{
|
|
1972
|
-
label:
|
|
1973
|
-
htmlFor:
|
|
1697
|
+
label: l,
|
|
1698
|
+
htmlFor: f,
|
|
1974
1699
|
placement: u,
|
|
1975
|
-
disabled:
|
|
1700
|
+
disabled: o
|
|
1976
1701
|
}
|
|
1977
1702
|
),
|
|
1978
1703
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -1986,27 +1711,27 @@ const timeSegmentButtonVariants = cva(
|
|
|
1986
1711
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1987
1712
|
"input",
|
|
1988
1713
|
{
|
|
1989
|
-
ref:
|
|
1714
|
+
ref: a,
|
|
1990
1715
|
type: "checkbox",
|
|
1991
|
-
id:
|
|
1992
|
-
"aria-label": x ||
|
|
1993
|
-
checked:
|
|
1994
|
-
disabled:
|
|
1995
|
-
onChange:
|
|
1716
|
+
id: f,
|
|
1717
|
+
"aria-label": x || l,
|
|
1718
|
+
checked: m,
|
|
1719
|
+
disabled: o,
|
|
1720
|
+
onChange: w,
|
|
1996
1721
|
className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10",
|
|
1997
|
-
...
|
|
1722
|
+
...c
|
|
1998
1723
|
}
|
|
1999
1724
|
),
|
|
2000
1725
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2001
1726
|
SwitchTrack,
|
|
2002
1727
|
{
|
|
2003
|
-
color:
|
|
2004
|
-
size:
|
|
2005
|
-
disabled:
|
|
2006
|
-
checked:
|
|
1728
|
+
color: s,
|
|
1729
|
+
size: n,
|
|
1730
|
+
disabled: o,
|
|
1731
|
+
checked: m
|
|
2007
1732
|
}
|
|
2008
1733
|
),
|
|
2009
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SwitchThumb, { size:
|
|
1734
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SwitchThumb, { size: n, checked: m })
|
|
2010
1735
|
]
|
|
2011
1736
|
}
|
|
2012
1737
|
)
|
|
@@ -2016,20 +1741,80 @@ const timeSegmentButtonVariants = cva(
|
|
|
2016
1741
|
}
|
|
2017
1742
|
);
|
|
2018
1743
|
SwitchInput.displayName = "SwitchInput";
|
|
1744
|
+
function usePriceInputSync(e, t) {
|
|
1745
|
+
useEffect(() => {
|
|
1746
|
+
typeof e == "number" && !isNaN(e) ? t(`${e}`) : e === "" || e === null || e === void 0 ? t("") : typeof e == "string" && t(e);
|
|
1747
|
+
}, [e, t]);
|
|
1748
|
+
}
|
|
1749
|
+
const PriceInput = ({
|
|
1750
|
+
value: e,
|
|
1751
|
+
onChange: t,
|
|
1752
|
+
allowNegative: i = !1,
|
|
1753
|
+
inputProps: s,
|
|
1754
|
+
label: n,
|
|
1755
|
+
helperText: l,
|
|
1756
|
+
error: u,
|
|
1757
|
+
variant: o,
|
|
1758
|
+
...r
|
|
1759
|
+
}) => {
|
|
1760
|
+
const d = useRef(null), [x, c] = useState(
|
|
1761
|
+
e === "" ? "" : String(e)
|
|
1762
|
+
);
|
|
1763
|
+
usePriceInputSync(e, c);
|
|
1764
|
+
const a = (g) => {
|
|
1765
|
+
let h = g.target.value.replace(/[^\d.,-]/g, "");
|
|
1766
|
+
i || (h = h.replace(/-/g, "")), c(h), t(h);
|
|
1767
|
+
};
|
|
1768
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1769
|
+
TextInput,
|
|
1770
|
+
{
|
|
1771
|
+
ref: d,
|
|
1772
|
+
type: "text",
|
|
1773
|
+
label: n,
|
|
1774
|
+
value: x,
|
|
1775
|
+
onChange: a,
|
|
1776
|
+
error: u,
|
|
1777
|
+
helperText: l,
|
|
1778
|
+
placeholder: r.placeholder,
|
|
1779
|
+
leftContent: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: Banknote, color: "inherit", size: "sm" }),
|
|
1780
|
+
variant: o,
|
|
1781
|
+
inputMode: "numeric",
|
|
1782
|
+
autoComplete: "off",
|
|
1783
|
+
pattern: i ? "^-?[\\d,.]*$" : "^[\\d,.]*$",
|
|
1784
|
+
...s,
|
|
1785
|
+
...r
|
|
1786
|
+
}
|
|
1787
|
+
);
|
|
1788
|
+
}, EmailInput = forwardRef(
|
|
1789
|
+
(e, t) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
1790
|
+
TextInput,
|
|
1791
|
+
{
|
|
1792
|
+
...e,
|
|
1793
|
+
ref: t,
|
|
1794
|
+
type: "email",
|
|
1795
|
+
autoComplete: "email",
|
|
1796
|
+
inputMode: "email",
|
|
1797
|
+
leftContent: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { as: MailIcon, color: "inherit", size: "sm" })
|
|
1798
|
+
}
|
|
1799
|
+
)
|
|
1800
|
+
);
|
|
2019
1801
|
export {
|
|
2020
1802
|
CalculatorInput as C,
|
|
2021
1803
|
DateSinglePickerInput as D,
|
|
1804
|
+
EmailInput as E,
|
|
1805
|
+
PriceInput as P,
|
|
2022
1806
|
RadioInput as R,
|
|
2023
1807
|
SegmentSingleInput as S,
|
|
2024
1808
|
TextInput as T,
|
|
2025
1809
|
CheckboxInput as a,
|
|
2026
|
-
|
|
1810
|
+
ChipMultipleInput as b,
|
|
2027
1811
|
SegmentMultipleInput as c,
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
1812
|
+
SearchInput as d,
|
|
1813
|
+
SelectInput as e,
|
|
1814
|
+
TextAreaInput as f,
|
|
1815
|
+
TimePickerInput as g,
|
|
1816
|
+
SwitchInput as h,
|
|
1817
|
+
SwitchTrack as i,
|
|
1818
|
+
SwitchThumb as j,
|
|
1819
|
+
SwitchLabel as k
|
|
2035
1820
|
};
|