@yca-software/yca-react-core 0.0.5 → 0.0.6
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-UIRJ6RVY.js → chunk-COQAEZJH.js} +155 -146
- package/dist/chunk-COQAEZJH.js.map +1 -0
- package/dist/{chunk-T3EWLUSA.js → chunk-EABWWAKL.js} +3 -3
- package/dist/{chunk-T3EWLUSA.js.map → chunk-EABWWAKL.js.map} +1 -1
- package/dist/{chunk-FQR4BC6X.js → chunk-Y66OVB6C.js} +3 -3
- package/dist/{chunk-FQR4BC6X.js.map → chunk-Y66OVB6C.js.map} +1 -1
- package/dist/components/forms/index.js +2 -2
- package/dist/components/spa/index.js +2 -2
- 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,
|
|
@@ -400,11 +400,11 @@ function DatePicker({
|
|
|
400
400
|
className,
|
|
401
401
|
"aria-label": ariaLabel
|
|
402
402
|
}) {
|
|
403
|
-
const [open, setOpen] =
|
|
403
|
+
const [open, setOpen] = React7.useState(false);
|
|
404
404
|
const normalizedMin = normalizeDate(minDate);
|
|
405
405
|
const normalizedMax = normalizeDate(maxDate);
|
|
406
|
-
const formatOpts =
|
|
407
|
-
const disabledMatchers =
|
|
406
|
+
const formatOpts = React7.useMemo(() => locale ? { locale } : void 0, [locale]);
|
|
407
|
+
const disabledMatchers = React7.useMemo(() => {
|
|
408
408
|
const toStartOfDay = (d) => {
|
|
409
409
|
const copy = new Date(d);
|
|
410
410
|
copy.setHours(0, 0, 0, 0);
|
|
@@ -875,68 +875,75 @@ function DateRangePickerPresetList({
|
|
|
875
875
|
})
|
|
876
876
|
] }) });
|
|
877
877
|
}
|
|
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
|
|
878
|
+
var DateRangePickerTrigger = React7.forwardRef(
|
|
879
|
+
function DateRangePickerTrigger2({
|
|
880
|
+
className,
|
|
881
|
+
inputText,
|
|
882
|
+
effectivePlaceholder,
|
|
883
|
+
isEmpty,
|
|
884
|
+
ariaLabel,
|
|
885
|
+
onOpen,
|
|
886
|
+
onInputChange,
|
|
887
|
+
onInputFocus,
|
|
888
|
+
onInputBlur
|
|
889
|
+
}, ref) {
|
|
890
|
+
return /* @__PURE__ */ jsxs(
|
|
891
|
+
"div",
|
|
892
|
+
{
|
|
893
|
+
ref,
|
|
894
|
+
role: "button",
|
|
895
|
+
tabIndex: 0,
|
|
896
|
+
"aria-label": ariaLabel,
|
|
897
|
+
"aria-haspopup": "dialog",
|
|
898
|
+
onClick: onOpen,
|
|
899
|
+
onKeyDown: (e) => {
|
|
900
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
901
|
+
e.preventDefault();
|
|
902
|
+
onOpen();
|
|
934
903
|
}
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
904
|
+
},
|
|
905
|
+
className: cn(
|
|
906
|
+
controlBase,
|
|
907
|
+
"flex w-full min-w-[17rem] max-w-full cursor-pointer items-center overflow-hidden focus-within:ring-[3px] focus-within:ring-ring/40",
|
|
908
|
+
className
|
|
909
|
+
),
|
|
910
|
+
children: [
|
|
911
|
+
/* @__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" }) }),
|
|
912
|
+
/* @__PURE__ */ jsx(
|
|
913
|
+
Input,
|
|
914
|
+
{
|
|
915
|
+
type: "text",
|
|
916
|
+
value: inputText,
|
|
917
|
+
onChange: (e) => onInputChange(e.target.value),
|
|
918
|
+
onFocus: onInputFocus,
|
|
919
|
+
onBlur: onInputBlur,
|
|
920
|
+
onClick: (e) => {
|
|
921
|
+
e.stopPropagation();
|
|
922
|
+
onOpen();
|
|
923
|
+
},
|
|
924
|
+
onPointerDown: (e) => {
|
|
925
|
+
e.stopPropagation();
|
|
926
|
+
},
|
|
927
|
+
onKeyDown: (e) => {
|
|
928
|
+
if (e.key === "Enter") {
|
|
929
|
+
e.target.blur();
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
placeholder: effectivePlaceholder,
|
|
933
|
+
"data-empty": isEmpty || void 0,
|
|
934
|
+
className: cn(
|
|
935
|
+
"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",
|
|
936
|
+
isEmpty && "text-muted-foreground"
|
|
937
|
+
),
|
|
938
|
+
title: !isEmpty ? inputText : void 0,
|
|
939
|
+
"aria-label": ariaLabel
|
|
940
|
+
}
|
|
941
|
+
)
|
|
942
|
+
]
|
|
943
|
+
}
|
|
944
|
+
);
|
|
945
|
+
}
|
|
946
|
+
);
|
|
940
947
|
|
|
941
948
|
// src/components/ui/date-range-picker/useDateRangePresets.ts
|
|
942
949
|
function getPresetRange(presetId) {
|
|
@@ -990,7 +997,7 @@ function getPresetRange(presetId) {
|
|
|
990
997
|
}
|
|
991
998
|
}
|
|
992
999
|
function useMediaQuery(query, fallback = false) {
|
|
993
|
-
const subscribe =
|
|
1000
|
+
const subscribe = React7.useCallback(
|
|
994
1001
|
(onChange) => {
|
|
995
1002
|
const mql = window.matchMedia(query);
|
|
996
1003
|
mql.addEventListener("change", onChange);
|
|
@@ -998,7 +1005,7 @@ function useMediaQuery(query, fallback = false) {
|
|
|
998
1005
|
},
|
|
999
1006
|
[query]
|
|
1000
1007
|
);
|
|
1001
|
-
return
|
|
1008
|
+
return React7.useSyncExternalStore(
|
|
1002
1009
|
subscribe,
|
|
1003
1010
|
() => window.matchMedia(query).matches,
|
|
1004
1011
|
() => fallback
|
|
@@ -1026,7 +1033,7 @@ function DateRangePicker({
|
|
|
1026
1033
|
}) {
|
|
1027
1034
|
const t = { ...DEFAULT_TRANSLATIONS, ...translations };
|
|
1028
1035
|
const effectivePlaceholder = placeholder ?? t.placeholder;
|
|
1029
|
-
const presetList =
|
|
1036
|
+
const presetList = React7.useMemo(() => {
|
|
1030
1037
|
if (customPresets?.length) return customPresets;
|
|
1031
1038
|
if (!showPresets) return [];
|
|
1032
1039
|
return DEFAULT_PRESET_IDS.map(({ id }) => ({
|
|
@@ -1040,16 +1047,16 @@ function DateRangePicker({
|
|
|
1040
1047
|
const isMobileLayout = useIsDatePickerMobileLayout();
|
|
1041
1048
|
const isWideLayout = useIsWideDatePickerLayout();
|
|
1042
1049
|
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 =
|
|
1050
|
+
const [open, setOpen] = React7.useState(false);
|
|
1051
|
+
const [draft, setDraft] = React7.useState(value);
|
|
1052
|
+
const [displayedMonth, setDisplayedMonth] = React7.useState(() => value?.from ?? /* @__PURE__ */ new Date());
|
|
1053
|
+
const appliedRef = React7.useRef(value);
|
|
1054
|
+
const wasOpenRef = React7.useRef(false);
|
|
1048
1055
|
const useApplyFlow = !!onApply;
|
|
1049
|
-
const idScope =
|
|
1056
|
+
const idScope = React7.useId();
|
|
1050
1057
|
const startInputId = `date-range-start-${idScope}`;
|
|
1051
1058
|
const endInputId = `date-range-end-${idScope}`;
|
|
1052
|
-
|
|
1059
|
+
React7.useEffect(() => {
|
|
1053
1060
|
const wasOpen = wasOpenRef.current;
|
|
1054
1061
|
wasOpenRef.current = open;
|
|
1055
1062
|
if (open && !wasOpen) {
|
|
@@ -1060,7 +1067,7 @@ function DateRangePicker({
|
|
|
1060
1067
|
setDraft(value);
|
|
1061
1068
|
}
|
|
1062
1069
|
}, [open, value]);
|
|
1063
|
-
const handleOpenChange =
|
|
1070
|
+
const handleOpenChange = React7.useCallback(
|
|
1064
1071
|
(next) => {
|
|
1065
1072
|
if (!next && open && !useApplyFlow) {
|
|
1066
1073
|
onChange(appliedRef.current);
|
|
@@ -1070,14 +1077,14 @@ function DateRangePicker({
|
|
|
1070
1077
|
},
|
|
1071
1078
|
[open, useApplyFlow, onChange]
|
|
1072
1079
|
);
|
|
1073
|
-
const formatOpts =
|
|
1074
|
-
const label =
|
|
1080
|
+
const formatOpts = React7.useMemo(() => locale ? { locale } : void 0, [locale]);
|
|
1081
|
+
const label = React7.useMemo(
|
|
1075
1082
|
() => formatRangeLabel(value, effectivePlaceholder, formatOpts),
|
|
1076
1083
|
[effectivePlaceholder, value, formatOpts]
|
|
1077
1084
|
);
|
|
1078
|
-
const [inputText, setInputText] =
|
|
1079
|
-
const inputFocusedRef =
|
|
1080
|
-
|
|
1085
|
+
const [inputText, setInputText] = React7.useState(label);
|
|
1086
|
+
const inputFocusedRef = React7.useRef(false);
|
|
1087
|
+
React7.useEffect(() => {
|
|
1081
1088
|
if (!inputFocusedRef.current) setInputText(label);
|
|
1082
1089
|
}, [label]);
|
|
1083
1090
|
const handleInputBlur = () => {
|
|
@@ -1096,7 +1103,7 @@ function DateRangePicker({
|
|
|
1096
1103
|
setInputText(label);
|
|
1097
1104
|
}
|
|
1098
1105
|
};
|
|
1099
|
-
const disabledMatchers =
|
|
1106
|
+
const disabledMatchers = React7.useMemo(() => {
|
|
1100
1107
|
const toStartOfDay = (d) => {
|
|
1101
1108
|
const copy = new Date(d);
|
|
1102
1109
|
copy.setHours(0, 0, 0, 0);
|
|
@@ -1152,9 +1159,9 @@ function DateRangePicker({
|
|
|
1152
1159
|
return nextRange;
|
|
1153
1160
|
});
|
|
1154
1161
|
};
|
|
1155
|
-
const [startInputText, setStartInputText] =
|
|
1156
|
-
const [endInputText, setEndInputText] =
|
|
1157
|
-
|
|
1162
|
+
const [startInputText, setStartInputText] = React7.useState("");
|
|
1163
|
+
const [endInputText, setEndInputText] = React7.useState("");
|
|
1164
|
+
React7.useEffect(() => {
|
|
1158
1165
|
if (open) {
|
|
1159
1166
|
setStartInputText(draft?.from ? format(draft.from, INPUT_FORMAT) : "");
|
|
1160
1167
|
setEndInputText(draft?.to ? format(draft.to, INPUT_FORMAT) : "");
|
|
@@ -1259,10 +1266,10 @@ function DateRangePicker({
|
|
|
1259
1266
|
] });
|
|
1260
1267
|
}
|
|
1261
1268
|
return (
|
|
1262
|
-
// Non-modal
|
|
1263
|
-
//
|
|
1269
|
+
// Non-modal (editable input keeps focus). PopoverTrigger anchors Popper —
|
|
1270
|
+
// Anchor-without-forwardRef parked content at translate(0,-200%) off-screen.
|
|
1264
1271
|
/* @__PURE__ */ jsxs(Popover, { modal: false, open, onOpenChange: handleOpenChange, children: [
|
|
1265
|
-
/* @__PURE__ */ jsx(
|
|
1272
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: trigger }),
|
|
1266
1273
|
/* @__PURE__ */ jsx(
|
|
1267
1274
|
PopoverContent,
|
|
1268
1275
|
{
|
|
@@ -1272,7 +1279,9 @@ function DateRangePicker({
|
|
|
1272
1279
|
calendarMonths === 2 && "min-w-[36rem]"
|
|
1273
1280
|
),
|
|
1274
1281
|
align: "start",
|
|
1282
|
+
side: "bottom",
|
|
1275
1283
|
sideOffset: 8,
|
|
1284
|
+
avoidCollisions: false,
|
|
1276
1285
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
1277
1286
|
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row", children: [
|
|
1278
1287
|
/* @__PURE__ */ jsx(
|
|
@@ -1351,10 +1360,10 @@ function DropdownScrollableList({
|
|
|
1351
1360
|
scrollAreaClassName,
|
|
1352
1361
|
grow = true
|
|
1353
1362
|
}) {
|
|
1354
|
-
const scrollRef =
|
|
1355
|
-
const [showTop, setShowTop] =
|
|
1356
|
-
const [showBottom, setShowBottom] =
|
|
1357
|
-
const update =
|
|
1363
|
+
const scrollRef = React7.useRef(null);
|
|
1364
|
+
const [showTop, setShowTop] = React7.useState(false);
|
|
1365
|
+
const [showBottom, setShowBottom] = React7.useState(false);
|
|
1366
|
+
const update = React7.useCallback(() => {
|
|
1358
1367
|
const el = scrollRef.current;
|
|
1359
1368
|
if (!el) {
|
|
1360
1369
|
setShowTop(false);
|
|
@@ -1371,14 +1380,14 @@ function DropdownScrollableList({
|
|
|
1371
1380
|
setShowTop(scrollTop > 2);
|
|
1372
1381
|
setShowBottom(scrollTop + clientHeight < scrollHeight - 2);
|
|
1373
1382
|
}, []);
|
|
1374
|
-
|
|
1383
|
+
React7.useLayoutEffect(() => {
|
|
1375
1384
|
update();
|
|
1376
1385
|
const id = requestAnimationFrame(() => {
|
|
1377
1386
|
requestAnimationFrame(update);
|
|
1378
1387
|
});
|
|
1379
1388
|
return () => cancelAnimationFrame(id);
|
|
1380
1389
|
}, [update, scrollKey]);
|
|
1381
|
-
|
|
1390
|
+
React7.useEffect(() => {
|
|
1382
1391
|
const el = scrollRef.current;
|
|
1383
1392
|
if (!el) return;
|
|
1384
1393
|
if (typeof ResizeObserver === "undefined") {
|
|
@@ -1467,15 +1476,15 @@ function Label({
|
|
|
1467
1476
|
return /* @__PURE__ */ jsx(LabelPrimitive.Root, { "data-slot": "label", className: cn(labelVariants(), className), ...props });
|
|
1468
1477
|
}
|
|
1469
1478
|
var Form = FormProvider;
|
|
1470
|
-
var FormFieldContext =
|
|
1479
|
+
var FormFieldContext = React7.createContext(null);
|
|
1471
1480
|
var FormField = ({
|
|
1472
1481
|
...props
|
|
1473
1482
|
}) => {
|
|
1474
1483
|
return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
|
|
1475
1484
|
};
|
|
1476
1485
|
var useFormField = () => {
|
|
1477
|
-
const fieldContext =
|
|
1478
|
-
const itemContext =
|
|
1486
|
+
const fieldContext = React7.useContext(FormFieldContext);
|
|
1487
|
+
const itemContext = React7.useContext(FormItemContext);
|
|
1479
1488
|
if (fieldContext === null || fieldContext === void 0) {
|
|
1480
1489
|
throw new Error("useFormField should be used within <FormField>");
|
|
1481
1490
|
}
|
|
@@ -1492,9 +1501,9 @@ var useFormField = () => {
|
|
|
1492
1501
|
...fieldState
|
|
1493
1502
|
};
|
|
1494
1503
|
};
|
|
1495
|
-
var FormItemContext =
|
|
1504
|
+
var FormItemContext = React7.createContext({});
|
|
1496
1505
|
function FormItem({ className, ...props }) {
|
|
1497
|
-
const id =
|
|
1506
|
+
const id = React7.useId();
|
|
1498
1507
|
return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx("div", { "data-slot": "form-item", className: cn("grid gap-3", className), ...props }) });
|
|
1499
1508
|
}
|
|
1500
1509
|
function FormLabel({
|
|
@@ -1555,7 +1564,7 @@ function FormMessage({ className, ...props }) {
|
|
|
1555
1564
|
}
|
|
1556
1565
|
);
|
|
1557
1566
|
}
|
|
1558
|
-
var InsideModalScrollLockContext =
|
|
1567
|
+
var InsideModalScrollLockContext = React7.createContext(false);
|
|
1559
1568
|
function InsideModalScrollLockProvider({
|
|
1560
1569
|
children,
|
|
1561
1570
|
active = true
|
|
@@ -1563,7 +1572,7 @@ function InsideModalScrollLockProvider({
|
|
|
1563
1572
|
return /* @__PURE__ */ jsx(InsideModalScrollLockContext.Provider, { value: active, children });
|
|
1564
1573
|
}
|
|
1565
1574
|
function useInsideModalScrollLock() {
|
|
1566
|
-
return
|
|
1575
|
+
return React7.useContext(InsideModalScrollLockContext);
|
|
1567
1576
|
}
|
|
1568
1577
|
function Sheet({ ...props }) {
|
|
1569
1578
|
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...props });
|
|
@@ -1763,14 +1772,14 @@ function MultiSelect({
|
|
|
1763
1772
|
}) {
|
|
1764
1773
|
const t = { ...DEFAULT_TRANSLATIONS2, ...translations };
|
|
1765
1774
|
const insideModalScrollLock = useInsideModalScrollLock();
|
|
1766
|
-
const [search, setSearch] =
|
|
1767
|
-
const selectedSet =
|
|
1768
|
-
const labelByValue =
|
|
1775
|
+
const [search, setSearch] = React7.useState("");
|
|
1776
|
+
const selectedSet = React7.useMemo(() => new Set(value), [value]);
|
|
1777
|
+
const labelByValue = React7.useMemo(() => {
|
|
1769
1778
|
const map = /* @__PURE__ */ new Map();
|
|
1770
1779
|
for (const opt of options) map.set(opt.value, opt.label);
|
|
1771
1780
|
return map;
|
|
1772
1781
|
}, [options]);
|
|
1773
|
-
const filteredOptions =
|
|
1782
|
+
const filteredOptions = React7.useMemo(() => {
|
|
1774
1783
|
const q = search.trim().toLowerCase();
|
|
1775
1784
|
if (!q) return options;
|
|
1776
1785
|
return options.filter((opt) => opt.label.toLowerCase().includes(q));
|
|
@@ -1864,7 +1873,7 @@ function MultiSelect({
|
|
|
1864
1873
|
] })
|
|
1865
1874
|
] });
|
|
1866
1875
|
}
|
|
1867
|
-
var ScrollArea =
|
|
1876
|
+
var ScrollArea = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1868
1877
|
ScrollAreaPrimitive.Root,
|
|
1869
1878
|
{
|
|
1870
1879
|
ref,
|
|
@@ -1878,7 +1887,7 @@ var ScrollArea = React6.forwardRef(({ className, children, ...props }, ref) => /
|
|
|
1878
1887
|
}
|
|
1879
1888
|
));
|
|
1880
1889
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
1881
|
-
var ScrollBar =
|
|
1890
|
+
var ScrollBar = React7.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1882
1891
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
1883
1892
|
{
|
|
1884
1893
|
ref,
|
|
@@ -1925,10 +1934,10 @@ function Select({
|
|
|
1925
1934
|
}) {
|
|
1926
1935
|
const t = { ...DEFAULT_TRANSLATIONS3, ...translations };
|
|
1927
1936
|
const insideModalScrollLock = useInsideModalScrollLock();
|
|
1928
|
-
const [open, setOpen] =
|
|
1929
|
-
const [search, setSearch] =
|
|
1937
|
+
const [open, setOpen] = React7.useState(false);
|
|
1938
|
+
const [search, setSearch] = React7.useState("");
|
|
1930
1939
|
const showSearch = isSelectSearchable(options.length, searchable);
|
|
1931
|
-
const filteredOptions =
|
|
1940
|
+
const filteredOptions = React7.useMemo(
|
|
1932
1941
|
() => showSearch ? filterSelectOptions(options, search) : options,
|
|
1933
1942
|
[options, search, showSearch]
|
|
1934
1943
|
);
|
|
@@ -2032,7 +2041,7 @@ function ChevronDownIcon({ className, ...props }) {
|
|
|
2032
2041
|
}
|
|
2033
2042
|
);
|
|
2034
2043
|
}
|
|
2035
|
-
var Separator =
|
|
2044
|
+
var Separator = React7.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2036
2045
|
SeparatorPrimitive.Root,
|
|
2037
2046
|
{
|
|
2038
2047
|
ref,
|
|
@@ -2047,7 +2056,7 @@ var Separator = React6.forwardRef(({ className, orientation = "horizontal", deco
|
|
|
2047
2056
|
}
|
|
2048
2057
|
));
|
|
2049
2058
|
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
2050
|
-
var Switch =
|
|
2059
|
+
var Switch = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2051
2060
|
SwitchPrimitive.Root,
|
|
2052
2061
|
{
|
|
2053
2062
|
ref,
|
|
@@ -2073,11 +2082,11 @@ var Switch = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
2073
2082
|
}
|
|
2074
2083
|
));
|
|
2075
2084
|
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
2076
|
-
var Table =
|
|
2085
|
+
var Table = React7.forwardRef(
|
|
2077
2086
|
({ 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
2087
|
);
|
|
2079
2088
|
Table.displayName = "Table";
|
|
2080
|
-
var TableHeader =
|
|
2089
|
+
var TableHeader = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2081
2090
|
"thead",
|
|
2082
2091
|
{
|
|
2083
2092
|
ref,
|
|
@@ -2086,9 +2095,9 @@ var TableHeader = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
2086
2095
|
}
|
|
2087
2096
|
));
|
|
2088
2097
|
TableHeader.displayName = "TableHeader";
|
|
2089
|
-
var TableBody =
|
|
2098
|
+
var TableBody = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
|
|
2090
2099
|
TableBody.displayName = "TableBody";
|
|
2091
|
-
var TableFooter =
|
|
2100
|
+
var TableFooter = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2092
2101
|
"tfoot",
|
|
2093
2102
|
{
|
|
2094
2103
|
ref,
|
|
@@ -2100,7 +2109,7 @@ var TableFooter = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
2100
2109
|
}
|
|
2101
2110
|
));
|
|
2102
2111
|
TableFooter.displayName = "TableFooter";
|
|
2103
|
-
var TableRow =
|
|
2112
|
+
var TableRow = React7.forwardRef(
|
|
2104
2113
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2105
2114
|
"tr",
|
|
2106
2115
|
{
|
|
@@ -2114,7 +2123,7 @@ var TableRow = React6.forwardRef(
|
|
|
2114
2123
|
)
|
|
2115
2124
|
);
|
|
2116
2125
|
TableRow.displayName = "TableRow";
|
|
2117
|
-
var TableHead =
|
|
2126
|
+
var TableHead = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2118
2127
|
"th",
|
|
2119
2128
|
{
|
|
2120
2129
|
ref,
|
|
@@ -2126,7 +2135,7 @@ var TableHead = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2126
2135
|
}
|
|
2127
2136
|
));
|
|
2128
2137
|
TableHead.displayName = "TableHead";
|
|
2129
|
-
var TableCell =
|
|
2138
|
+
var TableCell = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2130
2139
|
"td",
|
|
2131
2140
|
{
|
|
2132
2141
|
ref,
|
|
@@ -2135,7 +2144,7 @@ var TableCell = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
2135
2144
|
}
|
|
2136
2145
|
));
|
|
2137
2146
|
TableCell.displayName = "TableCell";
|
|
2138
|
-
var TableCaption =
|
|
2147
|
+
var TableCaption = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
|
|
2139
2148
|
TableCaption.displayName = "TableCaption";
|
|
2140
2149
|
function Tabs({ className, ...props }) {
|
|
2141
2150
|
return /* @__PURE__ */ jsx(
|
|
@@ -2195,7 +2204,7 @@ function TabsContent({
|
|
|
2195
2204
|
}
|
|
2196
2205
|
);
|
|
2197
2206
|
}
|
|
2198
|
-
var Textarea =
|
|
2207
|
+
var Textarea = React7.forwardRef(
|
|
2199
2208
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2200
2209
|
"textarea",
|
|
2201
2210
|
{
|
|
@@ -2224,22 +2233,22 @@ function Tooltip({
|
|
|
2224
2233
|
delayDuration = 400,
|
|
2225
2234
|
closeDelay = 100
|
|
2226
2235
|
}) {
|
|
2227
|
-
const [open, setOpen] =
|
|
2228
|
-
const openTimeoutRef =
|
|
2229
|
-
const closeTimeoutRef =
|
|
2230
|
-
const clearOpenTimeout =
|
|
2236
|
+
const [open, setOpen] = React7.useState(false);
|
|
2237
|
+
const openTimeoutRef = React7.useRef(null);
|
|
2238
|
+
const closeTimeoutRef = React7.useRef(null);
|
|
2239
|
+
const clearOpenTimeout = React7.useCallback(() => {
|
|
2231
2240
|
if (openTimeoutRef.current !== null) {
|
|
2232
2241
|
window.clearTimeout(openTimeoutRef.current);
|
|
2233
2242
|
openTimeoutRef.current = null;
|
|
2234
2243
|
}
|
|
2235
2244
|
}, []);
|
|
2236
|
-
const clearCloseTimeout =
|
|
2245
|
+
const clearCloseTimeout = React7.useCallback(() => {
|
|
2237
2246
|
if (closeTimeoutRef.current !== null) {
|
|
2238
2247
|
window.clearTimeout(closeTimeoutRef.current);
|
|
2239
2248
|
closeTimeoutRef.current = null;
|
|
2240
2249
|
}
|
|
2241
2250
|
}, []);
|
|
2242
|
-
const handleOpenChange =
|
|
2251
|
+
const handleOpenChange = React7.useCallback(
|
|
2243
2252
|
(next) => {
|
|
2244
2253
|
if (!next) {
|
|
2245
2254
|
clearOpenTimeout();
|
|
@@ -2249,14 +2258,14 @@ function Tooltip({
|
|
|
2249
2258
|
},
|
|
2250
2259
|
[clearCloseTimeout, clearOpenTimeout]
|
|
2251
2260
|
);
|
|
2252
|
-
const handlePointerEnter =
|
|
2261
|
+
const handlePointerEnter = React7.useCallback(() => {
|
|
2253
2262
|
clearCloseTimeout();
|
|
2254
2263
|
clearOpenTimeout();
|
|
2255
2264
|
openTimeoutRef.current = window.setTimeout(() => {
|
|
2256
2265
|
setOpen(true);
|
|
2257
2266
|
}, delayDuration);
|
|
2258
2267
|
}, [clearCloseTimeout, clearOpenTimeout, delayDuration]);
|
|
2259
|
-
const handlePointerLeave =
|
|
2268
|
+
const handlePointerLeave = React7.useCallback(() => {
|
|
2260
2269
|
clearOpenTimeout();
|
|
2261
2270
|
clearCloseTimeout();
|
|
2262
2271
|
if (closeDelay === 0) {
|
|
@@ -2267,7 +2276,7 @@ function Tooltip({
|
|
|
2267
2276
|
setOpen(false);
|
|
2268
2277
|
}, closeDelay);
|
|
2269
2278
|
}, [clearCloseTimeout, clearOpenTimeout, closeDelay]);
|
|
2270
|
-
|
|
2279
|
+
React7.useEffect(
|
|
2271
2280
|
() => () => {
|
|
2272
2281
|
clearOpenTimeout();
|
|
2273
2282
|
clearCloseTimeout();
|
|
@@ -2328,7 +2337,7 @@ var paragraphVariants = cva("text-muted-foreground leading-relaxed", {
|
|
|
2328
2337
|
size: "default"
|
|
2329
2338
|
}
|
|
2330
2339
|
});
|
|
2331
|
-
var Heading =
|
|
2340
|
+
var Heading = React7.forwardRef(
|
|
2332
2341
|
({ className, level, as, ...props }, ref) => {
|
|
2333
2342
|
const Component = as || (level === "h1" ? "h1" : level === "h2" ? "h2" : level === "h3" ? "h3" : "h4");
|
|
2334
2343
|
return /* @__PURE__ */ jsx(
|
|
@@ -2342,13 +2351,13 @@ var Heading = React6.forwardRef(
|
|
|
2342
2351
|
}
|
|
2343
2352
|
);
|
|
2344
2353
|
Heading.displayName = "Heading";
|
|
2345
|
-
var Paragraph =
|
|
2354
|
+
var Paragraph = React7.forwardRef(
|
|
2346
2355
|
({ className, size, ...props }, ref) => {
|
|
2347
2356
|
return /* @__PURE__ */ jsx("p", { ref, className: cn(paragraphVariants({ size }), className), ...props });
|
|
2348
2357
|
}
|
|
2349
2358
|
);
|
|
2350
2359
|
Paragraph.displayName = "Paragraph";
|
|
2351
|
-
var H3 =
|
|
2360
|
+
var H3 = React7.forwardRef(
|
|
2352
2361
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(Heading, { ref, level: "h3", as: "h3", className, ...props })
|
|
2353
2362
|
);
|
|
2354
2363
|
H3.displayName = "H3";
|
|
@@ -2515,5 +2524,5 @@ function UploadDropzone(props) {
|
|
|
2515
2524
|
}
|
|
2516
2525
|
|
|
2517
2526
|
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-
|
|
2527
|
+
//# sourceMappingURL=chunk-COQAEZJH.js.map
|
|
2528
|
+
//# sourceMappingURL=chunk-COQAEZJH.js.map
|