@yca-software/yca-react-core 0.0.5 → 0.0.7
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-T3EWLUSA.js → chunk-2Z7XBMHE.js} +3 -3
- package/dist/{chunk-T3EWLUSA.js.map → chunk-2Z7XBMHE.js.map} +1 -1
- package/dist/{chunk-FQR4BC6X.js → chunk-UWAGYVB6.js} +3 -3
- package/dist/{chunk-FQR4BC6X.js.map → chunk-UWAGYVB6.js.map} +1 -1
- package/dist/{chunk-UIRJ6RVY.js → chunk-ZCMETMED.js} +163 -146
- package/dist/chunk-ZCMETMED.js.map +1 -0
- package/dist/components/forms/index.js +2 -2
- package/dist/components/spa/index.js +2 -2
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-UIRJ6RVY.js.map +0 -1
|
@@ -4,10 +4,10 @@ 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 React7 from 'react';
|
|
8
8
|
import { useRef, useId, useState, useEffect } from 'react';
|
|
9
9
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
10
|
-
import { Check, ChevronLeft, ChevronRight, Loader2,
|
|
10
|
+
import { Check, Calendar as Calendar$1, ChevronLeft, ChevronRight, Loader2, XIcon, ChevronUp, ChevronDown, X, CheckSquare, FileText, ImagePlus, UploadCloud } from 'lucide-react';
|
|
11
11
|
import { DayPicker } from 'react-day-picker';
|
|
12
12
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
13
13
|
import { format, parse } from 'date-fns';
|
|
@@ -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 = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
72
72
|
AlertDialogPrimitive.Overlay,
|
|
73
73
|
{
|
|
74
74
|
className: cn(
|
|
@@ -80,7 +80,7 @@ var AlertDialogOverlay = React6.forwardRef(({ className, ...props }, ref) => /*
|
|
|
80
80
|
}
|
|
81
81
|
));
|
|
82
82
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
83
|
-
var AlertDialogContent =
|
|
83
|
+
var AlertDialogContent = React7.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 = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
110
110
|
AlertDialogPrimitive.Title,
|
|
111
111
|
{
|
|
112
112
|
ref,
|
|
@@ -115,7 +115,7 @@ var AlertDialogTitle = React6.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
115
115
|
}
|
|
116
116
|
));
|
|
117
117
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
118
|
-
var AlertDialogDescription =
|
|
118
|
+
var AlertDialogDescription = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
119
119
|
AlertDialogPrimitive.Description,
|
|
120
120
|
{
|
|
121
121
|
ref,
|
|
@@ -124,7 +124,7 @@ var AlertDialogDescription = React6.forwardRef(({ className, ...props }, ref) =>
|
|
|
124
124
|
}
|
|
125
125
|
));
|
|
126
126
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
127
|
-
var AlertDialogAction =
|
|
127
|
+
var AlertDialogAction = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
128
128
|
AlertDialogPrimitive.Action,
|
|
129
129
|
{
|
|
130
130
|
ref,
|
|
@@ -134,7 +134,7 @@ var AlertDialogAction = React6.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
134
134
|
}
|
|
135
135
|
));
|
|
136
136
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
137
|
-
var AlertDialogCancel =
|
|
137
|
+
var AlertDialogCancel = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
138
138
|
AlertDialogPrimitive.Cancel,
|
|
139
139
|
{
|
|
140
140
|
ref,
|
|
@@ -144,7 +144,7 @@ var AlertDialogCancel = React6.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
144
144
|
}
|
|
145
145
|
));
|
|
146
146
|
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
147
|
-
var Avatar =
|
|
147
|
+
var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
148
148
|
AvatarPrimitive.Root,
|
|
149
149
|
{
|
|
150
150
|
ref,
|
|
@@ -153,7 +153,7 @@ var Avatar = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
153
153
|
}
|
|
154
154
|
));
|
|
155
155
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
156
|
-
var AvatarImage =
|
|
156
|
+
var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
157
157
|
AvatarPrimitive.Image,
|
|
158
158
|
{
|
|
159
159
|
ref,
|
|
@@ -162,7 +162,7 @@ var AvatarImage = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
162
162
|
}
|
|
163
163
|
));
|
|
164
164
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
165
|
-
var AvatarFallback =
|
|
165
|
+
var AvatarFallback = React7.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 = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
258
258
|
CheckboxPrimitive.Root,
|
|
259
259
|
{
|
|
260
260
|
ref,
|
|
@@ -365,6 +365,9 @@ function PopoverContent({
|
|
|
365
365
|
className,
|
|
366
366
|
align = "start",
|
|
367
367
|
sideOffset = 4,
|
|
368
|
+
collisionPadding = 16,
|
|
369
|
+
sticky = "always",
|
|
370
|
+
avoidCollisions = true,
|
|
368
371
|
...props
|
|
369
372
|
}) {
|
|
370
373
|
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
@@ -373,6 +376,9 @@ function PopoverContent({
|
|
|
373
376
|
"data-slot": "popover-content",
|
|
374
377
|
align,
|
|
375
378
|
sideOffset,
|
|
379
|
+
collisionPadding,
|
|
380
|
+
sticky,
|
|
381
|
+
avoidCollisions,
|
|
376
382
|
className: cn(
|
|
377
383
|
surfaceOverlay,
|
|
378
384
|
"z-110 w-auto min-w-48 p-3 outline-none",
|
|
@@ -400,11 +406,11 @@ function DatePicker({
|
|
|
400
406
|
className,
|
|
401
407
|
"aria-label": ariaLabel
|
|
402
408
|
}) {
|
|
403
|
-
const [open, setOpen] =
|
|
409
|
+
const [open, setOpen] = React7.useState(false);
|
|
404
410
|
const normalizedMin = normalizeDate(minDate);
|
|
405
411
|
const normalizedMax = normalizeDate(maxDate);
|
|
406
|
-
const formatOpts =
|
|
407
|
-
const disabledMatchers =
|
|
412
|
+
const formatOpts = React7.useMemo(() => locale ? { locale } : void 0, [locale]);
|
|
413
|
+
const disabledMatchers = React7.useMemo(() => {
|
|
408
414
|
const toStartOfDay = (d) => {
|
|
409
415
|
const copy = new Date(d);
|
|
410
416
|
copy.setHours(0, 0, 0, 0);
|
|
@@ -875,68 +881,75 @@ function DateRangePickerPresetList({
|
|
|
875
881
|
})
|
|
876
882
|
] }) });
|
|
877
883
|
}
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
controlBase,
|
|
904
|
-
"flex w-full min-w-[17rem] max-w-full cursor-pointer items-center overflow-hidden focus-within:ring-[3px] focus-within:ring-ring/40",
|
|
905
|
-
className
|
|
906
|
-
),
|
|
907
|
-
children: [
|
|
908
|
-
/* @__PURE__ */ jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center border-r border-border/40 bg-muted/25 text-muted-foreground", children: /* @__PURE__ */ jsx(Calendar$1, { className: "size-4", "aria-hidden": "true" }) }),
|
|
909
|
-
/* @__PURE__ */ jsx(
|
|
910
|
-
Input,
|
|
911
|
-
{
|
|
912
|
-
type: "text",
|
|
913
|
-
value: inputText,
|
|
914
|
-
onChange: (e) => onInputChange(e.target.value),
|
|
915
|
-
onFocus: onInputFocus,
|
|
916
|
-
onBlur: onInputBlur,
|
|
917
|
-
onClick: (e) => {
|
|
918
|
-
e.stopPropagation();
|
|
919
|
-
onOpen();
|
|
920
|
-
},
|
|
921
|
-
onKeyDown: (e) => {
|
|
922
|
-
if (e.key === "Enter") {
|
|
923
|
-
e.target.blur();
|
|
924
|
-
}
|
|
925
|
-
},
|
|
926
|
-
placeholder: effectivePlaceholder,
|
|
927
|
-
"data-empty": isEmpty || void 0,
|
|
928
|
-
className: cn(
|
|
929
|
-
"h-10 min-w-0 flex-1 cursor-pointer rounded-none border-0 bg-transparent py-2 pl-3 pr-3 text-sm shadow-none focus-visible:ring-0 whitespace-nowrap",
|
|
930
|
-
isEmpty && "text-muted-foreground"
|
|
931
|
-
),
|
|
932
|
-
title: !isEmpty ? inputText : void 0,
|
|
933
|
-
"aria-label": ariaLabel
|
|
884
|
+
var DateRangePickerTrigger = React7.forwardRef(
|
|
885
|
+
function DateRangePickerTrigger2({
|
|
886
|
+
className,
|
|
887
|
+
inputText,
|
|
888
|
+
effectivePlaceholder,
|
|
889
|
+
isEmpty,
|
|
890
|
+
ariaLabel,
|
|
891
|
+
onOpen,
|
|
892
|
+
onInputChange,
|
|
893
|
+
onInputFocus,
|
|
894
|
+
onInputBlur
|
|
895
|
+
}, ref) {
|
|
896
|
+
return /* @__PURE__ */ jsxs(
|
|
897
|
+
"div",
|
|
898
|
+
{
|
|
899
|
+
ref,
|
|
900
|
+
role: "button",
|
|
901
|
+
tabIndex: 0,
|
|
902
|
+
"aria-label": ariaLabel,
|
|
903
|
+
"aria-haspopup": "dialog",
|
|
904
|
+
onClick: onOpen,
|
|
905
|
+
onKeyDown: (e) => {
|
|
906
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
907
|
+
e.preventDefault();
|
|
908
|
+
onOpen();
|
|
934
909
|
}
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
910
|
+
},
|
|
911
|
+
className: cn(
|
|
912
|
+
controlBase,
|
|
913
|
+
"flex w-full min-w-[17rem] max-w-full cursor-pointer items-center overflow-hidden focus-within:ring-[3px] focus-within:ring-ring/40",
|
|
914
|
+
className
|
|
915
|
+
),
|
|
916
|
+
children: [
|
|
917
|
+
/* @__PURE__ */ jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center border-r border-border/40 bg-muted/25 text-muted-foreground", children: /* @__PURE__ */ jsx(Calendar$1, { className: "size-4", "aria-hidden": "true" }) }),
|
|
918
|
+
/* @__PURE__ */ jsx(
|
|
919
|
+
Input,
|
|
920
|
+
{
|
|
921
|
+
type: "text",
|
|
922
|
+
value: inputText,
|
|
923
|
+
onChange: (e) => onInputChange(e.target.value),
|
|
924
|
+
onFocus: onInputFocus,
|
|
925
|
+
onBlur: onInputBlur,
|
|
926
|
+
onClick: (e) => {
|
|
927
|
+
e.stopPropagation();
|
|
928
|
+
onOpen();
|
|
929
|
+
},
|
|
930
|
+
onPointerDown: (e) => {
|
|
931
|
+
e.stopPropagation();
|
|
932
|
+
},
|
|
933
|
+
onKeyDown: (e) => {
|
|
934
|
+
if (e.key === "Enter") {
|
|
935
|
+
e.target.blur();
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
placeholder: effectivePlaceholder,
|
|
939
|
+
"data-empty": isEmpty || void 0,
|
|
940
|
+
className: cn(
|
|
941
|
+
"h-10 min-w-0 flex-1 cursor-pointer rounded-none border-0 bg-transparent py-2 pl-3 pr-3 text-sm shadow-none focus-visible:ring-0 whitespace-nowrap",
|
|
942
|
+
isEmpty && "text-muted-foreground"
|
|
943
|
+
),
|
|
944
|
+
title: !isEmpty ? inputText : void 0,
|
|
945
|
+
"aria-label": ariaLabel
|
|
946
|
+
}
|
|
947
|
+
)
|
|
948
|
+
]
|
|
949
|
+
}
|
|
950
|
+
);
|
|
951
|
+
}
|
|
952
|
+
);
|
|
940
953
|
|
|
941
954
|
// src/components/ui/date-range-picker/useDateRangePresets.ts
|
|
942
955
|
function getPresetRange(presetId) {
|
|
@@ -990,7 +1003,7 @@ function getPresetRange(presetId) {
|
|
|
990
1003
|
}
|
|
991
1004
|
}
|
|
992
1005
|
function useMediaQuery(query, fallback = false) {
|
|
993
|
-
const subscribe =
|
|
1006
|
+
const subscribe = React7.useCallback(
|
|
994
1007
|
(onChange) => {
|
|
995
1008
|
const mql = window.matchMedia(query);
|
|
996
1009
|
mql.addEventListener("change", onChange);
|
|
@@ -998,7 +1011,7 @@ function useMediaQuery(query, fallback = false) {
|
|
|
998
1011
|
},
|
|
999
1012
|
[query]
|
|
1000
1013
|
);
|
|
1001
|
-
return
|
|
1014
|
+
return React7.useSyncExternalStore(
|
|
1002
1015
|
subscribe,
|
|
1003
1016
|
() => window.matchMedia(query).matches,
|
|
1004
1017
|
() => fallback
|
|
@@ -1026,7 +1039,7 @@ function DateRangePicker({
|
|
|
1026
1039
|
}) {
|
|
1027
1040
|
const t = { ...DEFAULT_TRANSLATIONS, ...translations };
|
|
1028
1041
|
const effectivePlaceholder = placeholder ?? t.placeholder;
|
|
1029
|
-
const presetList =
|
|
1042
|
+
const presetList = React7.useMemo(() => {
|
|
1030
1043
|
if (customPresets?.length) return customPresets;
|
|
1031
1044
|
if (!showPresets) return [];
|
|
1032
1045
|
return DEFAULT_PRESET_IDS.map(({ id }) => ({
|
|
@@ -1040,16 +1053,16 @@ function DateRangePicker({
|
|
|
1040
1053
|
const isMobileLayout = useIsDatePickerMobileLayout();
|
|
1041
1054
|
const isWideLayout = useIsWideDatePickerLayout();
|
|
1042
1055
|
const calendarMonths = isMobileLayout ? 1 : isWideLayout ? 2 : 1;
|
|
1043
|
-
const [open, setOpen] =
|
|
1044
|
-
const [draft, setDraft] =
|
|
1045
|
-
const [displayedMonth, setDisplayedMonth] =
|
|
1046
|
-
const appliedRef =
|
|
1047
|
-
const wasOpenRef =
|
|
1056
|
+
const [open, setOpen] = React7.useState(false);
|
|
1057
|
+
const [draft, setDraft] = React7.useState(value);
|
|
1058
|
+
const [displayedMonth, setDisplayedMonth] = React7.useState(() => value?.from ?? /* @__PURE__ */ new Date());
|
|
1059
|
+
const appliedRef = React7.useRef(value);
|
|
1060
|
+
const wasOpenRef = React7.useRef(false);
|
|
1048
1061
|
const useApplyFlow = !!onApply;
|
|
1049
|
-
const idScope =
|
|
1062
|
+
const idScope = React7.useId();
|
|
1050
1063
|
const startInputId = `date-range-start-${idScope}`;
|
|
1051
1064
|
const endInputId = `date-range-end-${idScope}`;
|
|
1052
|
-
|
|
1065
|
+
React7.useEffect(() => {
|
|
1053
1066
|
const wasOpen = wasOpenRef.current;
|
|
1054
1067
|
wasOpenRef.current = open;
|
|
1055
1068
|
if (open && !wasOpen) {
|
|
@@ -1060,7 +1073,7 @@ function DateRangePicker({
|
|
|
1060
1073
|
setDraft(value);
|
|
1061
1074
|
}
|
|
1062
1075
|
}, [open, value]);
|
|
1063
|
-
const handleOpenChange =
|
|
1076
|
+
const handleOpenChange = React7.useCallback(
|
|
1064
1077
|
(next) => {
|
|
1065
1078
|
if (!next && open && !useApplyFlow) {
|
|
1066
1079
|
onChange(appliedRef.current);
|
|
@@ -1070,14 +1083,14 @@ function DateRangePicker({
|
|
|
1070
1083
|
},
|
|
1071
1084
|
[open, useApplyFlow, onChange]
|
|
1072
1085
|
);
|
|
1073
|
-
const formatOpts =
|
|
1074
|
-
const label =
|
|
1086
|
+
const formatOpts = React7.useMemo(() => locale ? { locale } : void 0, [locale]);
|
|
1087
|
+
const label = React7.useMemo(
|
|
1075
1088
|
() => formatRangeLabel(value, effectivePlaceholder, formatOpts),
|
|
1076
1089
|
[effectivePlaceholder, value, formatOpts]
|
|
1077
1090
|
);
|
|
1078
|
-
const [inputText, setInputText] =
|
|
1079
|
-
const inputFocusedRef =
|
|
1080
|
-
|
|
1091
|
+
const [inputText, setInputText] = React7.useState(label);
|
|
1092
|
+
const inputFocusedRef = React7.useRef(false);
|
|
1093
|
+
React7.useEffect(() => {
|
|
1081
1094
|
if (!inputFocusedRef.current) setInputText(label);
|
|
1082
1095
|
}, [label]);
|
|
1083
1096
|
const handleInputBlur = () => {
|
|
@@ -1096,7 +1109,7 @@ function DateRangePicker({
|
|
|
1096
1109
|
setInputText(label);
|
|
1097
1110
|
}
|
|
1098
1111
|
};
|
|
1099
|
-
const disabledMatchers =
|
|
1112
|
+
const disabledMatchers = React7.useMemo(() => {
|
|
1100
1113
|
const toStartOfDay = (d) => {
|
|
1101
1114
|
const copy = new Date(d);
|
|
1102
1115
|
copy.setHours(0, 0, 0, 0);
|
|
@@ -1152,9 +1165,9 @@ function DateRangePicker({
|
|
|
1152
1165
|
return nextRange;
|
|
1153
1166
|
});
|
|
1154
1167
|
};
|
|
1155
|
-
const [startInputText, setStartInputText] =
|
|
1156
|
-
const [endInputText, setEndInputText] =
|
|
1157
|
-
|
|
1168
|
+
const [startInputText, setStartInputText] = React7.useState("");
|
|
1169
|
+
const [endInputText, setEndInputText] = React7.useState("");
|
|
1170
|
+
React7.useEffect(() => {
|
|
1158
1171
|
if (open) {
|
|
1159
1172
|
setStartInputText(draft?.from ? format(draft.from, INPUT_FORMAT) : "");
|
|
1160
1173
|
setEndInputText(draft?.to ? format(draft.to, INPUT_FORMAT) : "");
|
|
@@ -1259,10 +1272,10 @@ function DateRangePicker({
|
|
|
1259
1272
|
] });
|
|
1260
1273
|
}
|
|
1261
1274
|
return (
|
|
1262
|
-
// Non-modal
|
|
1263
|
-
//
|
|
1275
|
+
// Non-modal (editable input keeps focus). PopoverTrigger anchors Popper —
|
|
1276
|
+
// Anchor-without-forwardRef parked content at translate(0,-200%) off-screen.
|
|
1264
1277
|
/* @__PURE__ */ jsxs(Popover, { modal: false, open, onOpenChange: handleOpenChange, children: [
|
|
1265
|
-
/* @__PURE__ */ jsx(
|
|
1278
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: trigger }),
|
|
1266
1279
|
/* @__PURE__ */ jsx(
|
|
1267
1280
|
PopoverContent,
|
|
1268
1281
|
{
|
|
@@ -1272,7 +1285,11 @@ function DateRangePicker({
|
|
|
1272
1285
|
calendarMonths === 2 && "min-w-[36rem]"
|
|
1273
1286
|
),
|
|
1274
1287
|
align: "start",
|
|
1288
|
+
side: "bottom",
|
|
1275
1289
|
sideOffset: 8,
|
|
1290
|
+
avoidCollisions: true,
|
|
1291
|
+
collisionPadding: 16,
|
|
1292
|
+
sticky: "always",
|
|
1276
1293
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
1277
1294
|
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row", children: [
|
|
1278
1295
|
/* @__PURE__ */ jsx(
|
|
@@ -1351,10 +1368,10 @@ function DropdownScrollableList({
|
|
|
1351
1368
|
scrollAreaClassName,
|
|
1352
1369
|
grow = true
|
|
1353
1370
|
}) {
|
|
1354
|
-
const scrollRef =
|
|
1355
|
-
const [showTop, setShowTop] =
|
|
1356
|
-
const [showBottom, setShowBottom] =
|
|
1357
|
-
const update =
|
|
1371
|
+
const scrollRef = React7.useRef(null);
|
|
1372
|
+
const [showTop, setShowTop] = React7.useState(false);
|
|
1373
|
+
const [showBottom, setShowBottom] = React7.useState(false);
|
|
1374
|
+
const update = React7.useCallback(() => {
|
|
1358
1375
|
const el = scrollRef.current;
|
|
1359
1376
|
if (!el) {
|
|
1360
1377
|
setShowTop(false);
|
|
@@ -1371,14 +1388,14 @@ function DropdownScrollableList({
|
|
|
1371
1388
|
setShowTop(scrollTop > 2);
|
|
1372
1389
|
setShowBottom(scrollTop + clientHeight < scrollHeight - 2);
|
|
1373
1390
|
}, []);
|
|
1374
|
-
|
|
1391
|
+
React7.useLayoutEffect(() => {
|
|
1375
1392
|
update();
|
|
1376
1393
|
const id = requestAnimationFrame(() => {
|
|
1377
1394
|
requestAnimationFrame(update);
|
|
1378
1395
|
});
|
|
1379
1396
|
return () => cancelAnimationFrame(id);
|
|
1380
1397
|
}, [update, scrollKey]);
|
|
1381
|
-
|
|
1398
|
+
React7.useEffect(() => {
|
|
1382
1399
|
const el = scrollRef.current;
|
|
1383
1400
|
if (!el) return;
|
|
1384
1401
|
if (typeof ResizeObserver === "undefined") {
|
|
@@ -1467,15 +1484,15 @@ function Label({
|
|
|
1467
1484
|
return /* @__PURE__ */ jsx(LabelPrimitive.Root, { "data-slot": "label", className: cn(labelVariants(), className), ...props });
|
|
1468
1485
|
}
|
|
1469
1486
|
var Form = FormProvider;
|
|
1470
|
-
var FormFieldContext =
|
|
1487
|
+
var FormFieldContext = React7.createContext(null);
|
|
1471
1488
|
var FormField = ({
|
|
1472
1489
|
...props
|
|
1473
1490
|
}) => {
|
|
1474
1491
|
return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
|
|
1475
1492
|
};
|
|
1476
1493
|
var useFormField = () => {
|
|
1477
|
-
const fieldContext =
|
|
1478
|
-
const itemContext =
|
|
1494
|
+
const fieldContext = React7.useContext(FormFieldContext);
|
|
1495
|
+
const itemContext = React7.useContext(FormItemContext);
|
|
1479
1496
|
if (fieldContext === null || fieldContext === void 0) {
|
|
1480
1497
|
throw new Error("useFormField should be used within <FormField>");
|
|
1481
1498
|
}
|
|
@@ -1492,9 +1509,9 @@ var useFormField = () => {
|
|
|
1492
1509
|
...fieldState
|
|
1493
1510
|
};
|
|
1494
1511
|
};
|
|
1495
|
-
var FormItemContext =
|
|
1512
|
+
var FormItemContext = React7.createContext({});
|
|
1496
1513
|
function FormItem({ className, ...props }) {
|
|
1497
|
-
const id =
|
|
1514
|
+
const id = React7.useId();
|
|
1498
1515
|
return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx("div", { "data-slot": "form-item", className: cn("grid gap-3", className), ...props }) });
|
|
1499
1516
|
}
|
|
1500
1517
|
function FormLabel({
|
|
@@ -1555,7 +1572,7 @@ function FormMessage({ className, ...props }) {
|
|
|
1555
1572
|
}
|
|
1556
1573
|
);
|
|
1557
1574
|
}
|
|
1558
|
-
var InsideModalScrollLockContext =
|
|
1575
|
+
var InsideModalScrollLockContext = React7.createContext(false);
|
|
1559
1576
|
function InsideModalScrollLockProvider({
|
|
1560
1577
|
children,
|
|
1561
1578
|
active = true
|
|
@@ -1563,7 +1580,7 @@ function InsideModalScrollLockProvider({
|
|
|
1563
1580
|
return /* @__PURE__ */ jsx(InsideModalScrollLockContext.Provider, { value: active, children });
|
|
1564
1581
|
}
|
|
1565
1582
|
function useInsideModalScrollLock() {
|
|
1566
|
-
return
|
|
1583
|
+
return React7.useContext(InsideModalScrollLockContext);
|
|
1567
1584
|
}
|
|
1568
1585
|
function Sheet({ ...props }) {
|
|
1569
1586
|
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...props });
|
|
@@ -1763,14 +1780,14 @@ function MultiSelect({
|
|
|
1763
1780
|
}) {
|
|
1764
1781
|
const t = { ...DEFAULT_TRANSLATIONS2, ...translations };
|
|
1765
1782
|
const insideModalScrollLock = useInsideModalScrollLock();
|
|
1766
|
-
const [search, setSearch] =
|
|
1767
|
-
const selectedSet =
|
|
1768
|
-
const labelByValue =
|
|
1783
|
+
const [search, setSearch] = React7.useState("");
|
|
1784
|
+
const selectedSet = React7.useMemo(() => new Set(value), [value]);
|
|
1785
|
+
const labelByValue = React7.useMemo(() => {
|
|
1769
1786
|
const map = /* @__PURE__ */ new Map();
|
|
1770
1787
|
for (const opt of options) map.set(opt.value, opt.label);
|
|
1771
1788
|
return map;
|
|
1772
1789
|
}, [options]);
|
|
1773
|
-
const filteredOptions =
|
|
1790
|
+
const filteredOptions = React7.useMemo(() => {
|
|
1774
1791
|
const q = search.trim().toLowerCase();
|
|
1775
1792
|
if (!q) return options;
|
|
1776
1793
|
return options.filter((opt) => opt.label.toLowerCase().includes(q));
|
|
@@ -1864,7 +1881,7 @@ function MultiSelect({
|
|
|
1864
1881
|
] })
|
|
1865
1882
|
] });
|
|
1866
1883
|
}
|
|
1867
|
-
var ScrollArea =
|
|
1884
|
+
var ScrollArea = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1868
1885
|
ScrollAreaPrimitive.Root,
|
|
1869
1886
|
{
|
|
1870
1887
|
ref,
|
|
@@ -1878,7 +1895,7 @@ var ScrollArea = React6.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
1878
1895
|
}
|
|
1879
1896
|
));
|
|
1880
1897
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
1881
|
-
var ScrollBar =
|
|
1898
|
+
var ScrollBar = React7.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1882
1899
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
1883
1900
|
{
|
|
1884
1901
|
ref,
|
|
@@ -1925,10 +1942,10 @@ function Select({
|
|
|
1925
1942
|
}) {
|
|
1926
1943
|
const t = { ...DEFAULT_TRANSLATIONS3, ...translations };
|
|
1927
1944
|
const insideModalScrollLock = useInsideModalScrollLock();
|
|
1928
|
-
const [open, setOpen] =
|
|
1929
|
-
const [search, setSearch] =
|
|
1945
|
+
const [open, setOpen] = React7.useState(false);
|
|
1946
|
+
const [search, setSearch] = React7.useState("");
|
|
1930
1947
|
const showSearch = isSelectSearchable(options.length, searchable);
|
|
1931
|
-
const filteredOptions =
|
|
1948
|
+
const filteredOptions = React7.useMemo(
|
|
1932
1949
|
() => showSearch ? filterSelectOptions(options, search) : options,
|
|
1933
1950
|
[options, search, showSearch]
|
|
1934
1951
|
);
|
|
@@ -2032,7 +2049,7 @@ function ChevronDownIcon({ className, ...props }) {
|
|
|
2032
2049
|
}
|
|
2033
2050
|
);
|
|
2034
2051
|
}
|
|
2035
|
-
var Separator =
|
|
2052
|
+
var Separator = React7.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2036
2053
|
SeparatorPrimitive.Root,
|
|
2037
2054
|
{
|
|
2038
2055
|
ref,
|
|
@@ -2047,7 +2064,7 @@ var Separator = React6.forwardRef(({ className, orientation = "horizontal", deco
|
|
|
2047
2064
|
}
|
|
2048
2065
|
));
|
|
2049
2066
|
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
2050
|
-
var Switch =
|
|
2067
|
+
var Switch = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2051
2068
|
SwitchPrimitive.Root,
|
|
2052
2069
|
{
|
|
2053
2070
|
ref,
|
|
@@ -2073,11 +2090,11 @@ var Switch = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
2073
2090
|
}
|
|
2074
2091
|
));
|
|
2075
2092
|
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
2076
|
-
var Table =
|
|
2093
|
+
var Table = React7.forwardRef(
|
|
2077
2094
|
({ 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 }) })
|
|
2078
2095
|
);
|
|
2079
2096
|
Table.displayName = "Table";
|
|
2080
|
-
var TableHeader =
|
|
2097
|
+
var TableHeader = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2081
2098
|
"thead",
|
|
2082
2099
|
{
|
|
2083
2100
|
ref,
|
|
@@ -2086,9 +2103,9 @@ var TableHeader = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
2086
2103
|
}
|
|
2087
2104
|
));
|
|
2088
2105
|
TableHeader.displayName = "TableHeader";
|
|
2089
|
-
var TableBody =
|
|
2106
|
+
var TableBody = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
|
|
2090
2107
|
TableBody.displayName = "TableBody";
|
|
2091
|
-
var TableFooter =
|
|
2108
|
+
var TableFooter = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2092
2109
|
"tfoot",
|
|
2093
2110
|
{
|
|
2094
2111
|
ref,
|
|
@@ -2100,7 +2117,7 @@ var TableFooter = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
2100
2117
|
}
|
|
2101
2118
|
));
|
|
2102
2119
|
TableFooter.displayName = "TableFooter";
|
|
2103
|
-
var TableRow =
|
|
2120
|
+
var TableRow = React7.forwardRef(
|
|
2104
2121
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2105
2122
|
"tr",
|
|
2106
2123
|
{
|
|
@@ -2114,7 +2131,7 @@ var TableRow = React6.forwardRef(
|
|
|
2114
2131
|
)
|
|
2115
2132
|
);
|
|
2116
2133
|
TableRow.displayName = "TableRow";
|
|
2117
|
-
var TableHead =
|
|
2134
|
+
var TableHead = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2118
2135
|
"th",
|
|
2119
2136
|
{
|
|
2120
2137
|
ref,
|
|
@@ -2126,7 +2143,7 @@ var TableHead = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2126
2143
|
}
|
|
2127
2144
|
));
|
|
2128
2145
|
TableHead.displayName = "TableHead";
|
|
2129
|
-
var TableCell =
|
|
2146
|
+
var TableCell = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2130
2147
|
"td",
|
|
2131
2148
|
{
|
|
2132
2149
|
ref,
|
|
@@ -2135,7 +2152,7 @@ var TableCell = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2135
2152
|
}
|
|
2136
2153
|
));
|
|
2137
2154
|
TableCell.displayName = "TableCell";
|
|
2138
|
-
var TableCaption =
|
|
2155
|
+
var TableCaption = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
|
|
2139
2156
|
TableCaption.displayName = "TableCaption";
|
|
2140
2157
|
function Tabs({ className, ...props }) {
|
|
2141
2158
|
return /* @__PURE__ */ jsx(
|
|
@@ -2195,7 +2212,7 @@ function TabsContent({
|
|
|
2195
2212
|
}
|
|
2196
2213
|
);
|
|
2197
2214
|
}
|
|
2198
|
-
var Textarea =
|
|
2215
|
+
var Textarea = React7.forwardRef(
|
|
2199
2216
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2200
2217
|
"textarea",
|
|
2201
2218
|
{
|
|
@@ -2224,22 +2241,22 @@ function Tooltip({
|
|
|
2224
2241
|
delayDuration = 400,
|
|
2225
2242
|
closeDelay = 100
|
|
2226
2243
|
}) {
|
|
2227
|
-
const [open, setOpen] =
|
|
2228
|
-
const openTimeoutRef =
|
|
2229
|
-
const closeTimeoutRef =
|
|
2230
|
-
const clearOpenTimeout =
|
|
2244
|
+
const [open, setOpen] = React7.useState(false);
|
|
2245
|
+
const openTimeoutRef = React7.useRef(null);
|
|
2246
|
+
const closeTimeoutRef = React7.useRef(null);
|
|
2247
|
+
const clearOpenTimeout = React7.useCallback(() => {
|
|
2231
2248
|
if (openTimeoutRef.current !== null) {
|
|
2232
2249
|
window.clearTimeout(openTimeoutRef.current);
|
|
2233
2250
|
openTimeoutRef.current = null;
|
|
2234
2251
|
}
|
|
2235
2252
|
}, []);
|
|
2236
|
-
const clearCloseTimeout =
|
|
2253
|
+
const clearCloseTimeout = React7.useCallback(() => {
|
|
2237
2254
|
if (closeTimeoutRef.current !== null) {
|
|
2238
2255
|
window.clearTimeout(closeTimeoutRef.current);
|
|
2239
2256
|
closeTimeoutRef.current = null;
|
|
2240
2257
|
}
|
|
2241
2258
|
}, []);
|
|
2242
|
-
const handleOpenChange =
|
|
2259
|
+
const handleOpenChange = React7.useCallback(
|
|
2243
2260
|
(next) => {
|
|
2244
2261
|
if (!next) {
|
|
2245
2262
|
clearOpenTimeout();
|
|
@@ -2249,14 +2266,14 @@ function Tooltip({
|
|
|
2249
2266
|
},
|
|
2250
2267
|
[clearCloseTimeout, clearOpenTimeout]
|
|
2251
2268
|
);
|
|
2252
|
-
const handlePointerEnter =
|
|
2269
|
+
const handlePointerEnter = React7.useCallback(() => {
|
|
2253
2270
|
clearCloseTimeout();
|
|
2254
2271
|
clearOpenTimeout();
|
|
2255
2272
|
openTimeoutRef.current = window.setTimeout(() => {
|
|
2256
2273
|
setOpen(true);
|
|
2257
2274
|
}, delayDuration);
|
|
2258
2275
|
}, [clearCloseTimeout, clearOpenTimeout, delayDuration]);
|
|
2259
|
-
const handlePointerLeave =
|
|
2276
|
+
const handlePointerLeave = React7.useCallback(() => {
|
|
2260
2277
|
clearOpenTimeout();
|
|
2261
2278
|
clearCloseTimeout();
|
|
2262
2279
|
if (closeDelay === 0) {
|
|
@@ -2267,7 +2284,7 @@ function Tooltip({
|
|
|
2267
2284
|
setOpen(false);
|
|
2268
2285
|
}, closeDelay);
|
|
2269
2286
|
}, [clearCloseTimeout, clearOpenTimeout, closeDelay]);
|
|
2270
|
-
|
|
2287
|
+
React7.useEffect(
|
|
2271
2288
|
() => () => {
|
|
2272
2289
|
clearOpenTimeout();
|
|
2273
2290
|
clearCloseTimeout();
|
|
@@ -2328,7 +2345,7 @@ var paragraphVariants = cva("text-muted-foreground leading-relaxed", {
|
|
|
2328
2345
|
size: "default"
|
|
2329
2346
|
}
|
|
2330
2347
|
});
|
|
2331
|
-
var Heading =
|
|
2348
|
+
var Heading = React7.forwardRef(
|
|
2332
2349
|
({ className, level, as, ...props }, ref) => {
|
|
2333
2350
|
const Component = as || (level === "h1" ? "h1" : level === "h2" ? "h2" : level === "h3" ? "h3" : "h4");
|
|
2334
2351
|
return /* @__PURE__ */ jsx(
|
|
@@ -2342,13 +2359,13 @@ var Heading = React6.forwardRef(
|
|
|
2342
2359
|
}
|
|
2343
2360
|
);
|
|
2344
2361
|
Heading.displayName = "Heading";
|
|
2345
|
-
var Paragraph =
|
|
2362
|
+
var Paragraph = React7.forwardRef(
|
|
2346
2363
|
({ className, size, ...props }, ref) => {
|
|
2347
2364
|
return /* @__PURE__ */ jsx("p", { ref, className: cn(paragraphVariants({ size }), className), ...props });
|
|
2348
2365
|
}
|
|
2349
2366
|
);
|
|
2350
2367
|
Paragraph.displayName = "Paragraph";
|
|
2351
|
-
var H3 =
|
|
2368
|
+
var H3 = React7.forwardRef(
|
|
2352
2369
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(Heading, { ref, level: "h3", as: "h3", className, ...props })
|
|
2353
2370
|
);
|
|
2354
2371
|
H3.displayName = "H3";
|
|
@@ -2515,5 +2532,5 @@ function UploadDropzone(props) {
|
|
|
2515
2532
|
}
|
|
2516
2533
|
|
|
2517
2534
|
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, headingVariants, isSelectSearchable, linkStyles, paragraphVariants, useFormField };
|
|
2518
|
-
//# sourceMappingURL=chunk-
|
|
2519
|
-
//# sourceMappingURL=chunk-
|
|
2535
|
+
//# sourceMappingURL=chunk-ZCMETMED.js.map
|
|
2536
|
+
//# sourceMappingURL=chunk-ZCMETMED.js.map
|