@yca-software/yca-react-core 0.0.17 → 0.0.19
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/{chunk-2ZESYOQB.js → chunk-25GC4ZEE.js} +3 -3
- package/dist/{chunk-2ZESYOQB.js.map → chunk-25GC4ZEE.js.map} +1 -1
- package/dist/{chunk-AIO2327D.js → chunk-6YTCQ4GG.js} +90 -29
- package/dist/chunk-6YTCQ4GG.js.map +1 -0
- package/dist/{chunk-CBJJUQMY.js → chunk-KSWAKETF.js} +95 -92
- package/dist/chunk-KSWAKETF.js.map +1 -0
- package/dist/components/forms/index.js +2 -2
- package/dist/components/spa/index.d.ts +11 -2
- package/dist/components/spa/index.js +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-AIO2327D.js.map +0 -1
- package/dist/chunk-CBJJUQMY.js.map +0 -1
|
@@ -4,7 +4,7 @@ import { cn, surfaceOverlay, controlFocus, controlInvalid, controlBase, surfaceC
|
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
7
|
-
import * as
|
|
7
|
+
import * as React8 from 'react';
|
|
8
8
|
import { useRef, useId, useState, useEffect } from 'react';
|
|
9
9
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
10
10
|
import { Check, Calendar as Calendar$1, ChevronLeft, ChevronRight, Loader2, XIcon, ChevronUp, ChevronDown, X, CheckSquare, FileText, ImagePlus, UploadCloud } from 'lucide-react';
|
|
@@ -68,7 +68,7 @@ function AlertDescription({ className, ...props }) {
|
|
|
68
68
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
69
69
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
70
70
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
71
|
-
var AlertDialogOverlay =
|
|
71
|
+
var AlertDialogOverlay = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
72
72
|
AlertDialogPrimitive.Overlay,
|
|
73
73
|
{
|
|
74
74
|
className: cn(
|
|
@@ -80,7 +80,7 @@ var AlertDialogOverlay = React7.forwardRef(({ className, ...props }, ref) => /*
|
|
|
80
80
|
}
|
|
81
81
|
));
|
|
82
82
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
83
|
-
var AlertDialogContent =
|
|
83
|
+
var AlertDialogContent = React8.forwardRef(({ className, onOverlayClick, overlayClassName, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
84
84
|
/* @__PURE__ */ jsx(AlertDialogOverlay, { onClick: onOverlayClick, className: overlayClassName }),
|
|
85
85
|
/* @__PURE__ */ jsx(
|
|
86
86
|
AlertDialogPrimitive.Content,
|
|
@@ -106,7 +106,7 @@ var AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
108
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
109
|
-
var AlertDialogTitle =
|
|
109
|
+
var AlertDialogTitle = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
110
110
|
AlertDialogPrimitive.Title,
|
|
111
111
|
{
|
|
112
112
|
ref,
|
|
@@ -115,7 +115,7 @@ var AlertDialogTitle = React7.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
115
115
|
}
|
|
116
116
|
));
|
|
117
117
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
118
|
-
var AlertDialogDescription =
|
|
118
|
+
var AlertDialogDescription = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
119
119
|
AlertDialogPrimitive.Description,
|
|
120
120
|
{
|
|
121
121
|
ref,
|
|
@@ -124,7 +124,7 @@ var AlertDialogDescription = React7.forwardRef(({ className, ...props }, ref) =>
|
|
|
124
124
|
}
|
|
125
125
|
));
|
|
126
126
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
127
|
-
var AlertDialogAction =
|
|
127
|
+
var AlertDialogAction = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
128
128
|
AlertDialogPrimitive.Action,
|
|
129
129
|
{
|
|
130
130
|
ref,
|
|
@@ -134,7 +134,7 @@ var AlertDialogAction = React7.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
134
134
|
}
|
|
135
135
|
));
|
|
136
136
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
137
|
-
var AlertDialogCancel =
|
|
137
|
+
var AlertDialogCancel = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
138
138
|
AlertDialogPrimitive.Cancel,
|
|
139
139
|
{
|
|
140
140
|
ref,
|
|
@@ -144,7 +144,7 @@ var AlertDialogCancel = React7.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
144
144
|
}
|
|
145
145
|
));
|
|
146
146
|
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
147
|
-
var Avatar =
|
|
147
|
+
var Avatar = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
148
148
|
AvatarPrimitive.Root,
|
|
149
149
|
{
|
|
150
150
|
ref,
|
|
@@ -153,7 +153,7 @@ var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
153
153
|
}
|
|
154
154
|
));
|
|
155
155
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
156
|
-
var AvatarImage =
|
|
156
|
+
var AvatarImage = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
157
157
|
AvatarPrimitive.Image,
|
|
158
158
|
{
|
|
159
159
|
ref,
|
|
@@ -162,7 +162,7 @@ var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
162
162
|
}
|
|
163
163
|
));
|
|
164
164
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
165
|
-
var AvatarFallback =
|
|
165
|
+
var AvatarFallback = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
166
166
|
AvatarPrimitive.Fallback,
|
|
167
167
|
{
|
|
168
168
|
ref,
|
|
@@ -254,7 +254,7 @@ function Calendar({
|
|
|
254
254
|
}
|
|
255
255
|
);
|
|
256
256
|
}
|
|
257
|
-
var Checkbox =
|
|
257
|
+
var Checkbox = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
258
258
|
CheckboxPrimitive.Root,
|
|
259
259
|
{
|
|
260
260
|
ref,
|
|
@@ -406,11 +406,11 @@ function DatePicker({
|
|
|
406
406
|
className,
|
|
407
407
|
"aria-label": ariaLabel
|
|
408
408
|
}) {
|
|
409
|
-
const [open, setOpen] =
|
|
409
|
+
const [open, setOpen] = React8.useState(false);
|
|
410
410
|
const normalizedMin = normalizeDate(minDate);
|
|
411
411
|
const normalizedMax = normalizeDate(maxDate);
|
|
412
|
-
const formatOpts =
|
|
413
|
-
const disabledMatchers =
|
|
412
|
+
const formatOpts = React8.useMemo(() => locale ? { locale } : void 0, [locale]);
|
|
413
|
+
const disabledMatchers = React8.useMemo(() => {
|
|
414
414
|
const toStartOfDay = (d) => {
|
|
415
415
|
const copy = new Date(d);
|
|
416
416
|
copy.setHours(0, 0, 0, 0);
|
|
@@ -481,6 +481,16 @@ function DatePicker({
|
|
|
481
481
|
) })
|
|
482
482
|
] });
|
|
483
483
|
}
|
|
484
|
+
var InsideModalScrollLockContext = React8.createContext(false);
|
|
485
|
+
function InsideModalScrollLockProvider({
|
|
486
|
+
children,
|
|
487
|
+
active = true
|
|
488
|
+
}) {
|
|
489
|
+
return /* @__PURE__ */ jsx(InsideModalScrollLockContext.Provider, { value: active, children });
|
|
490
|
+
}
|
|
491
|
+
function useInsideModalScrollLock() {
|
|
492
|
+
return React8.useContext(InsideModalScrollLockContext);
|
|
493
|
+
}
|
|
484
494
|
function Dialog({ ...props }) {
|
|
485
495
|
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
486
496
|
}
|
|
@@ -550,7 +560,7 @@ function DialogContent({
|
|
|
550
560
|
),
|
|
551
561
|
...props,
|
|
552
562
|
children: [
|
|
553
|
-
children,
|
|
563
|
+
/* @__PURE__ */ jsx(InsideModalScrollLockProvider, { children }),
|
|
554
564
|
showCloseButton && /* @__PURE__ */ jsxs(
|
|
555
565
|
DialogPrimitive.Close,
|
|
556
566
|
{
|
|
@@ -886,7 +896,7 @@ function DateRangePickerPresetList({
|
|
|
886
896
|
})
|
|
887
897
|
] }) });
|
|
888
898
|
}
|
|
889
|
-
var DateRangePickerTrigger =
|
|
899
|
+
var DateRangePickerTrigger = React8.forwardRef(
|
|
890
900
|
function DateRangePickerTrigger2({
|
|
891
901
|
className,
|
|
892
902
|
inputText,
|
|
@@ -1008,7 +1018,7 @@ function getPresetRange(presetId) {
|
|
|
1008
1018
|
}
|
|
1009
1019
|
}
|
|
1010
1020
|
function useMediaQuery(query, fallback = false) {
|
|
1011
|
-
const subscribe =
|
|
1021
|
+
const subscribe = React8.useCallback(
|
|
1012
1022
|
(onChange) => {
|
|
1013
1023
|
const mql = window.matchMedia(query);
|
|
1014
1024
|
mql.addEventListener("change", onChange);
|
|
@@ -1016,7 +1026,7 @@ function useMediaQuery(query, fallback = false) {
|
|
|
1016
1026
|
},
|
|
1017
1027
|
[query]
|
|
1018
1028
|
);
|
|
1019
|
-
return
|
|
1029
|
+
return React8.useSyncExternalStore(
|
|
1020
1030
|
subscribe,
|
|
1021
1031
|
() => window.matchMedia(query).matches,
|
|
1022
1032
|
() => fallback
|
|
@@ -1044,7 +1054,7 @@ function DateRangePicker({
|
|
|
1044
1054
|
}) {
|
|
1045
1055
|
const t = { ...DEFAULT_TRANSLATIONS, ...translations };
|
|
1046
1056
|
const effectivePlaceholder = placeholder ?? t.placeholder;
|
|
1047
|
-
const presetList =
|
|
1057
|
+
const presetList = React8.useMemo(() => {
|
|
1048
1058
|
if (customPresets?.length) return customPresets;
|
|
1049
1059
|
if (!showPresets) return [];
|
|
1050
1060
|
return DEFAULT_PRESET_IDS.map(({ id }) => ({
|
|
@@ -1058,16 +1068,16 @@ function DateRangePicker({
|
|
|
1058
1068
|
const isMobileLayout = useIsDatePickerMobileLayout();
|
|
1059
1069
|
const isWideLayout = useIsWideDatePickerLayout();
|
|
1060
1070
|
const calendarMonths = isMobileLayout ? 1 : isWideLayout ? 2 : 1;
|
|
1061
|
-
const [open, setOpen] =
|
|
1062
|
-
const [draft, setDraft] =
|
|
1063
|
-
const [displayedMonth, setDisplayedMonth] =
|
|
1064
|
-
const appliedRef =
|
|
1065
|
-
const wasOpenRef =
|
|
1071
|
+
const [open, setOpen] = React8.useState(false);
|
|
1072
|
+
const [draft, setDraft] = React8.useState(value);
|
|
1073
|
+
const [displayedMonth, setDisplayedMonth] = React8.useState(() => value?.from ?? /* @__PURE__ */ new Date());
|
|
1074
|
+
const appliedRef = React8.useRef(value);
|
|
1075
|
+
const wasOpenRef = React8.useRef(false);
|
|
1066
1076
|
const useApplyFlow = !!onApply;
|
|
1067
|
-
const idScope =
|
|
1077
|
+
const idScope = React8.useId();
|
|
1068
1078
|
const startInputId = `date-range-start-${idScope}`;
|
|
1069
1079
|
const endInputId = `date-range-end-${idScope}`;
|
|
1070
|
-
|
|
1080
|
+
React8.useEffect(() => {
|
|
1071
1081
|
const wasOpen = wasOpenRef.current;
|
|
1072
1082
|
wasOpenRef.current = open;
|
|
1073
1083
|
if (open && !wasOpen) {
|
|
@@ -1078,7 +1088,7 @@ function DateRangePicker({
|
|
|
1078
1088
|
setDraft(value);
|
|
1079
1089
|
}
|
|
1080
1090
|
}, [open, value]);
|
|
1081
|
-
const handleOpenChange =
|
|
1091
|
+
const handleOpenChange = React8.useCallback(
|
|
1082
1092
|
(next) => {
|
|
1083
1093
|
if (!next && open && !useApplyFlow) {
|
|
1084
1094
|
onChange(appliedRef.current);
|
|
@@ -1088,14 +1098,14 @@ function DateRangePicker({
|
|
|
1088
1098
|
},
|
|
1089
1099
|
[open, useApplyFlow, onChange]
|
|
1090
1100
|
);
|
|
1091
|
-
const formatOpts =
|
|
1092
|
-
const label =
|
|
1101
|
+
const formatOpts = React8.useMemo(() => locale ? { locale } : void 0, [locale]);
|
|
1102
|
+
const label = React8.useMemo(
|
|
1093
1103
|
() => formatRangeLabel(value, effectivePlaceholder, formatOpts),
|
|
1094
1104
|
[effectivePlaceholder, value, formatOpts]
|
|
1095
1105
|
);
|
|
1096
|
-
const [inputText, setInputText] =
|
|
1097
|
-
const inputFocusedRef =
|
|
1098
|
-
|
|
1106
|
+
const [inputText, setInputText] = React8.useState(label);
|
|
1107
|
+
const inputFocusedRef = React8.useRef(false);
|
|
1108
|
+
React8.useEffect(() => {
|
|
1099
1109
|
if (!inputFocusedRef.current) setInputText(label);
|
|
1100
1110
|
}, [label]);
|
|
1101
1111
|
const handleInputBlur = () => {
|
|
@@ -1114,7 +1124,7 @@ function DateRangePicker({
|
|
|
1114
1124
|
setInputText(label);
|
|
1115
1125
|
}
|
|
1116
1126
|
};
|
|
1117
|
-
const disabledMatchers =
|
|
1127
|
+
const disabledMatchers = React8.useMemo(() => {
|
|
1118
1128
|
const toStartOfDay = (d) => {
|
|
1119
1129
|
const copy = new Date(d);
|
|
1120
1130
|
copy.setHours(0, 0, 0, 0);
|
|
@@ -1172,9 +1182,9 @@ function DateRangePicker({
|
|
|
1172
1182
|
return nextRange;
|
|
1173
1183
|
});
|
|
1174
1184
|
};
|
|
1175
|
-
const [startInputText, setStartInputText] =
|
|
1176
|
-
const [endInputText, setEndInputText] =
|
|
1177
|
-
|
|
1185
|
+
const [startInputText, setStartInputText] = React8.useState("");
|
|
1186
|
+
const [endInputText, setEndInputText] = React8.useState("");
|
|
1187
|
+
React8.useEffect(() => {
|
|
1178
1188
|
if (open) {
|
|
1179
1189
|
setStartInputText(draft?.from ? format(draft.from, INPUT_FORMAT) : "");
|
|
1180
1190
|
setEndInputText(draft?.to ? format(draft.to, INPUT_FORMAT) : "");
|
|
@@ -1374,10 +1384,10 @@ function DropdownScrollableList({
|
|
|
1374
1384
|
scrollAreaClassName,
|
|
1375
1385
|
grow = true
|
|
1376
1386
|
}) {
|
|
1377
|
-
const scrollRef =
|
|
1378
|
-
const [showTop, setShowTop] =
|
|
1379
|
-
const [showBottom, setShowBottom] =
|
|
1380
|
-
const update =
|
|
1387
|
+
const scrollRef = React8.useRef(null);
|
|
1388
|
+
const [showTop, setShowTop] = React8.useState(false);
|
|
1389
|
+
const [showBottom, setShowBottom] = React8.useState(false);
|
|
1390
|
+
const update = React8.useCallback(() => {
|
|
1381
1391
|
const el = scrollRef.current;
|
|
1382
1392
|
if (!el) {
|
|
1383
1393
|
setShowTop(false);
|
|
@@ -1394,14 +1404,14 @@ function DropdownScrollableList({
|
|
|
1394
1404
|
setShowTop(scrollTop > 2);
|
|
1395
1405
|
setShowBottom(scrollTop + clientHeight < scrollHeight - 2);
|
|
1396
1406
|
}, []);
|
|
1397
|
-
|
|
1407
|
+
React8.useLayoutEffect(() => {
|
|
1398
1408
|
update();
|
|
1399
1409
|
const id = requestAnimationFrame(() => {
|
|
1400
1410
|
requestAnimationFrame(update);
|
|
1401
1411
|
});
|
|
1402
1412
|
return () => cancelAnimationFrame(id);
|
|
1403
1413
|
}, [update, scrollKey]);
|
|
1404
|
-
|
|
1414
|
+
React8.useEffect(() => {
|
|
1405
1415
|
const el = scrollRef.current;
|
|
1406
1416
|
if (!el) return;
|
|
1407
1417
|
if (typeof ResizeObserver === "undefined") {
|
|
@@ -1422,6 +1432,9 @@ function DropdownScrollableList({
|
|
|
1422
1432
|
grow ? cn("min-h-0 flex-1 overflow-y-auto overscroll-y-contain p-1", scrollAreaClassName) : scrollAreaClassName
|
|
1423
1433
|
),
|
|
1424
1434
|
onScroll: update,
|
|
1435
|
+
onWheel: (event) => {
|
|
1436
|
+
event.stopPropagation();
|
|
1437
|
+
},
|
|
1425
1438
|
children
|
|
1426
1439
|
}
|
|
1427
1440
|
),
|
|
@@ -1490,15 +1503,15 @@ function Label({
|
|
|
1490
1503
|
return /* @__PURE__ */ jsx(LabelPrimitive.Root, { "data-slot": "label", className: cn(labelVariants(), className), ...props });
|
|
1491
1504
|
}
|
|
1492
1505
|
var Form = FormProvider;
|
|
1493
|
-
var FormFieldContext =
|
|
1506
|
+
var FormFieldContext = React8.createContext(null);
|
|
1494
1507
|
var FormField = ({
|
|
1495
1508
|
...props
|
|
1496
1509
|
}) => {
|
|
1497
1510
|
return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
|
|
1498
1511
|
};
|
|
1499
1512
|
var useFormField = () => {
|
|
1500
|
-
const fieldContext =
|
|
1501
|
-
const itemContext =
|
|
1513
|
+
const fieldContext = React8.useContext(FormFieldContext);
|
|
1514
|
+
const itemContext = React8.useContext(FormItemContext);
|
|
1502
1515
|
if (fieldContext === null || fieldContext === void 0) {
|
|
1503
1516
|
throw new Error("useFormField should be used within <FormField>");
|
|
1504
1517
|
}
|
|
@@ -1515,9 +1528,9 @@ var useFormField = () => {
|
|
|
1515
1528
|
...fieldState
|
|
1516
1529
|
};
|
|
1517
1530
|
};
|
|
1518
|
-
var FormItemContext =
|
|
1531
|
+
var FormItemContext = React8.createContext({});
|
|
1519
1532
|
function FormItem({ className, ...props }) {
|
|
1520
|
-
const id =
|
|
1533
|
+
const id = React8.useId();
|
|
1521
1534
|
return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx("div", { "data-slot": "form-item", className: cn("grid gap-3", className), ...props }) });
|
|
1522
1535
|
}
|
|
1523
1536
|
function FormLabel({
|
|
@@ -1578,16 +1591,6 @@ function FormMessage({ className, ...props }) {
|
|
|
1578
1591
|
}
|
|
1579
1592
|
);
|
|
1580
1593
|
}
|
|
1581
|
-
var InsideModalScrollLockContext = React7.createContext(false);
|
|
1582
|
-
function InsideModalScrollLockProvider({
|
|
1583
|
-
children,
|
|
1584
|
-
active = true
|
|
1585
|
-
}) {
|
|
1586
|
-
return /* @__PURE__ */ jsx(InsideModalScrollLockContext.Provider, { value: active, children });
|
|
1587
|
-
}
|
|
1588
|
-
function useInsideModalScrollLock() {
|
|
1589
|
-
return React7.useContext(InsideModalScrollLockContext);
|
|
1590
|
-
}
|
|
1591
1594
|
function Sheet({ ...props }) {
|
|
1592
1595
|
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...props });
|
|
1593
1596
|
}
|
|
@@ -1657,7 +1660,7 @@ function SheetContent({
|
|
|
1657
1660
|
),
|
|
1658
1661
|
...props,
|
|
1659
1662
|
children: [
|
|
1660
|
-
children,
|
|
1663
|
+
/* @__PURE__ */ jsx(InsideModalScrollLockProvider, { children }),
|
|
1661
1664
|
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-6 right-6 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none cursor-pointer", children: [
|
|
1662
1665
|
/* @__PURE__ */ jsx(XIcon, { className: "h-4 w-4" }),
|
|
1663
1666
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
@@ -1786,14 +1789,14 @@ function MultiSelect({
|
|
|
1786
1789
|
}) {
|
|
1787
1790
|
const t = { ...DEFAULT_TRANSLATIONS2, ...translations };
|
|
1788
1791
|
const insideModalScrollLock = useInsideModalScrollLock();
|
|
1789
|
-
const [search, setSearch] =
|
|
1790
|
-
const selectedSet =
|
|
1791
|
-
const labelByValue =
|
|
1792
|
+
const [search, setSearch] = React8.useState("");
|
|
1793
|
+
const selectedSet = React8.useMemo(() => new Set(value), [value]);
|
|
1794
|
+
const labelByValue = React8.useMemo(() => {
|
|
1792
1795
|
const map = /* @__PURE__ */ new Map();
|
|
1793
1796
|
for (const opt of options) map.set(opt.value, opt.label);
|
|
1794
1797
|
return map;
|
|
1795
1798
|
}, [options]);
|
|
1796
|
-
const filteredOptions =
|
|
1799
|
+
const filteredOptions = React8.useMemo(() => {
|
|
1797
1800
|
const q = search.trim().toLowerCase();
|
|
1798
1801
|
if (!q) return options;
|
|
1799
1802
|
return options.filter((opt) => opt.label.toLowerCase().includes(q));
|
|
@@ -1887,7 +1890,7 @@ function MultiSelect({
|
|
|
1887
1890
|
] })
|
|
1888
1891
|
] });
|
|
1889
1892
|
}
|
|
1890
|
-
var ScrollArea =
|
|
1893
|
+
var ScrollArea = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1891
1894
|
ScrollAreaPrimitive.Root,
|
|
1892
1895
|
{
|
|
1893
1896
|
ref,
|
|
@@ -1901,7 +1904,7 @@ var ScrollArea = React7.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
1901
1904
|
}
|
|
1902
1905
|
));
|
|
1903
1906
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
1904
|
-
var ScrollBar =
|
|
1907
|
+
var ScrollBar = React8.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1905
1908
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
1906
1909
|
{
|
|
1907
1910
|
ref,
|
|
@@ -1951,10 +1954,10 @@ function Select({
|
|
|
1951
1954
|
}) {
|
|
1952
1955
|
const t = { ...DEFAULT_TRANSLATIONS3, ...translations };
|
|
1953
1956
|
const insideModalScrollLock = useInsideModalScrollLock();
|
|
1954
|
-
const [open, setOpen] =
|
|
1955
|
-
const [search, setSearch] =
|
|
1957
|
+
const [open, setOpen] = React8.useState(false);
|
|
1958
|
+
const [search, setSearch] = React8.useState("");
|
|
1956
1959
|
const showSearch = isSelectSearchable(options.length, searchable);
|
|
1957
|
-
const filteredOptions =
|
|
1960
|
+
const filteredOptions = React8.useMemo(
|
|
1958
1961
|
() => showSearch ? filterSelectOptions(options, search) : options,
|
|
1959
1962
|
[options, search, showSearch]
|
|
1960
1963
|
);
|
|
@@ -2058,7 +2061,7 @@ function ChevronDownIcon({ className, ...props }) {
|
|
|
2058
2061
|
}
|
|
2059
2062
|
);
|
|
2060
2063
|
}
|
|
2061
|
-
var Separator =
|
|
2064
|
+
var Separator = React8.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2062
2065
|
SeparatorPrimitive.Root,
|
|
2063
2066
|
{
|
|
2064
2067
|
ref,
|
|
@@ -2073,7 +2076,7 @@ var Separator = React7.forwardRef(({ className, orientation = "horizontal", deco
|
|
|
2073
2076
|
}
|
|
2074
2077
|
));
|
|
2075
2078
|
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
2076
|
-
var Switch =
|
|
2079
|
+
var Switch = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2077
2080
|
SwitchPrimitive.Root,
|
|
2078
2081
|
{
|
|
2079
2082
|
ref,
|
|
@@ -2099,11 +2102,11 @@ var Switch = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
2099
2102
|
}
|
|
2100
2103
|
));
|
|
2101
2104
|
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
2102
|
-
var Table =
|
|
2105
|
+
var Table = React8.forwardRef(
|
|
2103
2106
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx("table", { ref, className: cn("w-full caption-bottom text-sm", className), ...props }) })
|
|
2104
2107
|
);
|
|
2105
2108
|
Table.displayName = "Table";
|
|
2106
|
-
var TableHeader =
|
|
2109
|
+
var TableHeader = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2107
2110
|
"thead",
|
|
2108
2111
|
{
|
|
2109
2112
|
ref,
|
|
@@ -2112,9 +2115,9 @@ var TableHeader = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
2112
2115
|
}
|
|
2113
2116
|
));
|
|
2114
2117
|
TableHeader.displayName = "TableHeader";
|
|
2115
|
-
var TableBody =
|
|
2118
|
+
var TableBody = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
|
|
2116
2119
|
TableBody.displayName = "TableBody";
|
|
2117
|
-
var TableFooter =
|
|
2120
|
+
var TableFooter = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2118
2121
|
"tfoot",
|
|
2119
2122
|
{
|
|
2120
2123
|
ref,
|
|
@@ -2126,7 +2129,7 @@ var TableFooter = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
2126
2129
|
}
|
|
2127
2130
|
));
|
|
2128
2131
|
TableFooter.displayName = "TableFooter";
|
|
2129
|
-
var TableRow =
|
|
2132
|
+
var TableRow = React8.forwardRef(
|
|
2130
2133
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2131
2134
|
"tr",
|
|
2132
2135
|
{
|
|
@@ -2140,7 +2143,7 @@ var TableRow = React7.forwardRef(
|
|
|
2140
2143
|
)
|
|
2141
2144
|
);
|
|
2142
2145
|
TableRow.displayName = "TableRow";
|
|
2143
|
-
var TableHead =
|
|
2146
|
+
var TableHead = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2144
2147
|
"th",
|
|
2145
2148
|
{
|
|
2146
2149
|
ref,
|
|
@@ -2152,7 +2155,7 @@ var TableHead = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2152
2155
|
}
|
|
2153
2156
|
));
|
|
2154
2157
|
TableHead.displayName = "TableHead";
|
|
2155
|
-
var TableCell =
|
|
2158
|
+
var TableCell = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2156
2159
|
"td",
|
|
2157
2160
|
{
|
|
2158
2161
|
ref,
|
|
@@ -2161,7 +2164,7 @@ var TableCell = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2161
2164
|
}
|
|
2162
2165
|
));
|
|
2163
2166
|
TableCell.displayName = "TableCell";
|
|
2164
|
-
var TableCaption =
|
|
2167
|
+
var TableCaption = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
|
|
2165
2168
|
TableCaption.displayName = "TableCaption";
|
|
2166
2169
|
function Tabs({ className, ...props }) {
|
|
2167
2170
|
return /* @__PURE__ */ jsx(
|
|
@@ -2221,7 +2224,7 @@ function TabsContent({
|
|
|
2221
2224
|
}
|
|
2222
2225
|
);
|
|
2223
2226
|
}
|
|
2224
|
-
var Textarea =
|
|
2227
|
+
var Textarea = React8.forwardRef(
|
|
2225
2228
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2226
2229
|
"textarea",
|
|
2227
2230
|
{
|
|
@@ -2250,22 +2253,22 @@ function Tooltip({
|
|
|
2250
2253
|
delayDuration = 400,
|
|
2251
2254
|
closeDelay = 100
|
|
2252
2255
|
}) {
|
|
2253
|
-
const [open, setOpen] =
|
|
2254
|
-
const openTimeoutRef =
|
|
2255
|
-
const closeTimeoutRef =
|
|
2256
|
-
const clearOpenTimeout =
|
|
2256
|
+
const [open, setOpen] = React8.useState(false);
|
|
2257
|
+
const openTimeoutRef = React8.useRef(null);
|
|
2258
|
+
const closeTimeoutRef = React8.useRef(null);
|
|
2259
|
+
const clearOpenTimeout = React8.useCallback(() => {
|
|
2257
2260
|
if (openTimeoutRef.current !== null) {
|
|
2258
2261
|
window.clearTimeout(openTimeoutRef.current);
|
|
2259
2262
|
openTimeoutRef.current = null;
|
|
2260
2263
|
}
|
|
2261
2264
|
}, []);
|
|
2262
|
-
const clearCloseTimeout =
|
|
2265
|
+
const clearCloseTimeout = React8.useCallback(() => {
|
|
2263
2266
|
if (closeTimeoutRef.current !== null) {
|
|
2264
2267
|
window.clearTimeout(closeTimeoutRef.current);
|
|
2265
2268
|
closeTimeoutRef.current = null;
|
|
2266
2269
|
}
|
|
2267
2270
|
}, []);
|
|
2268
|
-
const handleOpenChange =
|
|
2271
|
+
const handleOpenChange = React8.useCallback(
|
|
2269
2272
|
(next) => {
|
|
2270
2273
|
if (!next) {
|
|
2271
2274
|
clearOpenTimeout();
|
|
@@ -2275,14 +2278,14 @@ function Tooltip({
|
|
|
2275
2278
|
},
|
|
2276
2279
|
[clearCloseTimeout, clearOpenTimeout]
|
|
2277
2280
|
);
|
|
2278
|
-
const handlePointerEnter =
|
|
2281
|
+
const handlePointerEnter = React8.useCallback(() => {
|
|
2279
2282
|
clearCloseTimeout();
|
|
2280
2283
|
clearOpenTimeout();
|
|
2281
2284
|
openTimeoutRef.current = window.setTimeout(() => {
|
|
2282
2285
|
setOpen(true);
|
|
2283
2286
|
}, delayDuration);
|
|
2284
2287
|
}, [clearCloseTimeout, clearOpenTimeout, delayDuration]);
|
|
2285
|
-
const handlePointerLeave =
|
|
2288
|
+
const handlePointerLeave = React8.useCallback(() => {
|
|
2286
2289
|
clearOpenTimeout();
|
|
2287
2290
|
clearCloseTimeout();
|
|
2288
2291
|
if (closeDelay === 0) {
|
|
@@ -2293,7 +2296,7 @@ function Tooltip({
|
|
|
2293
2296
|
setOpen(false);
|
|
2294
2297
|
}, closeDelay);
|
|
2295
2298
|
}, [clearCloseTimeout, clearOpenTimeout, closeDelay]);
|
|
2296
|
-
|
|
2299
|
+
React8.useEffect(
|
|
2297
2300
|
() => () => {
|
|
2298
2301
|
clearOpenTimeout();
|
|
2299
2302
|
clearCloseTimeout();
|
|
@@ -2354,7 +2357,7 @@ var paragraphVariants = cva("text-muted-foreground leading-relaxed", {
|
|
|
2354
2357
|
size: "default"
|
|
2355
2358
|
}
|
|
2356
2359
|
});
|
|
2357
|
-
var Heading =
|
|
2360
|
+
var Heading = React8.forwardRef(
|
|
2358
2361
|
({ className, level, as, ...props }, ref) => {
|
|
2359
2362
|
const Component = as || (level === "h1" ? "h1" : level === "h2" ? "h2" : level === "h3" ? "h3" : "h4");
|
|
2360
2363
|
return /* @__PURE__ */ jsx(
|
|
@@ -2368,13 +2371,13 @@ var Heading = React7.forwardRef(
|
|
|
2368
2371
|
}
|
|
2369
2372
|
);
|
|
2370
2373
|
Heading.displayName = "Heading";
|
|
2371
|
-
var Paragraph =
|
|
2374
|
+
var Paragraph = React8.forwardRef(
|
|
2372
2375
|
({ className, size, ...props }, ref) => {
|
|
2373
2376
|
return /* @__PURE__ */ jsx("p", { ref, className: cn(paragraphVariants({ size }), className), ...props });
|
|
2374
2377
|
}
|
|
2375
2378
|
);
|
|
2376
2379
|
Paragraph.displayName = "Paragraph";
|
|
2377
|
-
var H3 =
|
|
2380
|
+
var H3 = React8.forwardRef(
|
|
2378
2381
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(Heading, { ref, level: "h3", as: "h3", className, ...props })
|
|
2379
2382
|
);
|
|
2380
2383
|
H3.displayName = "H3";
|
|
@@ -2541,5 +2544,5 @@ function UploadDropzone(props) {
|
|
|
2541
2544
|
}
|
|
2542
2545
|
|
|
2543
2546
|
export { Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Calendar, Checkbox, ConfirmDialog, DatePicker, DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, DropdownScrollableList, DropdownSelectSearchInput, Form, FormControl, FormDescription, FormDrawer, FormField, FormItem, FormLabel, FormMessage, H3, Heading, Label, Link, MultiSelect, Paragraph, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, SEARCHABLE_SELECT_MIN_OPTIONS, ScrollArea, ScrollBar, Select, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipProvider, UploadDropzone, badgeVariants, dropdownMenuSelectOptionsMaxHeightClassName, filterSelectOptions, foldSearchText, headingVariants, isSelectSearchable, linkStyles, paragraphVariants, useFormField };
|
|
2544
|
-
//# sourceMappingURL=chunk-
|
|
2545
|
-
//# sourceMappingURL=chunk-
|
|
2547
|
+
//# sourceMappingURL=chunk-KSWAKETF.js.map
|
|
2548
|
+
//# sourceMappingURL=chunk-KSWAKETF.js.map
|