@mvn-ui/react 0.1.4 → 0.1.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/index.css +84 -63
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +185 -32
- package/dist/index.d.ts +185 -32
- package/dist/index.js +1380 -632
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1235 -500
- package/dist/index.mjs.map +1 -1
- package/dist/themes.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var clsx = require('clsx');
|
|
4
4
|
var tailwindMerge = require('tailwind-merge');
|
|
5
|
-
var
|
|
5
|
+
var React52 = require('react');
|
|
6
6
|
var classVarianceAuthority = require('class-variance-authority');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
8
|
var reactSlot = require('@radix-ui/react-slot');
|
|
@@ -65,7 +65,7 @@ function _interopNamespace(e) {
|
|
|
65
65
|
return Object.freeze(n);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
var
|
|
68
|
+
var React52__namespace = /*#__PURE__*/_interopNamespace(React52);
|
|
69
69
|
var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
|
|
70
70
|
var SelectPrimitive__namespace = /*#__PURE__*/_interopNamespace(SelectPrimitive);
|
|
71
71
|
var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
|
|
@@ -337,7 +337,7 @@ var init_card = __esm({
|
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
);
|
|
340
|
-
exports.Card =
|
|
340
|
+
exports.Card = React52__namespace.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
341
341
|
"div",
|
|
342
342
|
{
|
|
343
343
|
ref,
|
|
@@ -346,7 +346,7 @@ var init_card = __esm({
|
|
|
346
346
|
}
|
|
347
347
|
));
|
|
348
348
|
exports.Card.displayName = "Card";
|
|
349
|
-
exports.CardHeader =
|
|
349
|
+
exports.CardHeader = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
350
350
|
"div",
|
|
351
351
|
{
|
|
352
352
|
ref,
|
|
@@ -355,7 +355,7 @@ var init_card = __esm({
|
|
|
355
355
|
}
|
|
356
356
|
));
|
|
357
357
|
exports.CardHeader.displayName = "CardHeader";
|
|
358
|
-
exports.CardTitle =
|
|
358
|
+
exports.CardTitle = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
359
359
|
"h3",
|
|
360
360
|
{
|
|
361
361
|
ref,
|
|
@@ -364,7 +364,7 @@ var init_card = __esm({
|
|
|
364
364
|
}
|
|
365
365
|
));
|
|
366
366
|
exports.CardTitle.displayName = "CardTitle";
|
|
367
|
-
exports.CardDescription =
|
|
367
|
+
exports.CardDescription = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
368
368
|
"div",
|
|
369
369
|
{
|
|
370
370
|
ref,
|
|
@@ -373,9 +373,9 @@ var init_card = __esm({
|
|
|
373
373
|
}
|
|
374
374
|
));
|
|
375
375
|
exports.CardDescription.displayName = "CardDescription";
|
|
376
|
-
exports.CardContent =
|
|
376
|
+
exports.CardContent = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
377
377
|
exports.CardContent.displayName = "CardContent";
|
|
378
|
-
exports.CardFooter =
|
|
378
|
+
exports.CardFooter = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
379
379
|
"div",
|
|
380
380
|
{
|
|
381
381
|
ref,
|
|
@@ -386,6 +386,132 @@ var init_card = __esm({
|
|
|
386
386
|
exports.CardFooter.displayName = "CardFooter";
|
|
387
387
|
}
|
|
388
388
|
});
|
|
389
|
+
var BREAKPOINTS = {
|
|
390
|
+
sm: 640,
|
|
391
|
+
md: 768,
|
|
392
|
+
lg: 1024,
|
|
393
|
+
xl: 1280
|
|
394
|
+
};
|
|
395
|
+
function useBreakpoint(ssrFallback = "md") {
|
|
396
|
+
const [breakpoint, setBreakpoint] = React52.useState(ssrFallback);
|
|
397
|
+
React52.useEffect(() => {
|
|
398
|
+
const getBreakpoint = () => {
|
|
399
|
+
const width = window.innerWidth;
|
|
400
|
+
if (width >= BREAKPOINTS.xl) return "xl";
|
|
401
|
+
if (width >= BREAKPOINTS.lg) return "lg";
|
|
402
|
+
if (width >= BREAKPOINTS.md) return "md";
|
|
403
|
+
if (width >= BREAKPOINTS.sm) return "sm";
|
|
404
|
+
return "xs";
|
|
405
|
+
};
|
|
406
|
+
setBreakpoint(getBreakpoint());
|
|
407
|
+
let timeoutId;
|
|
408
|
+
const handleResize = () => {
|
|
409
|
+
clearTimeout(timeoutId);
|
|
410
|
+
timeoutId = setTimeout(() => setBreakpoint(getBreakpoint()), 150);
|
|
411
|
+
};
|
|
412
|
+
window.addEventListener("resize", handleResize);
|
|
413
|
+
return () => {
|
|
414
|
+
window.removeEventListener("resize", handleResize);
|
|
415
|
+
clearTimeout(timeoutId);
|
|
416
|
+
};
|
|
417
|
+
}, []);
|
|
418
|
+
return breakpoint;
|
|
419
|
+
}
|
|
420
|
+
function useBreakpointValue(values, fallback) {
|
|
421
|
+
const breakpoint = useBreakpoint();
|
|
422
|
+
return React52.useMemo(() => {
|
|
423
|
+
const order = ["xs", "sm", "md", "lg", "xl"];
|
|
424
|
+
const currentIndex = order.indexOf(breakpoint);
|
|
425
|
+
for (let i = currentIndex; i >= 0; i--) {
|
|
426
|
+
const bp = order[i];
|
|
427
|
+
if (values[bp] !== void 0) {
|
|
428
|
+
return values[bp];
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
return fallback;
|
|
432
|
+
}, [breakpoint, values, fallback]);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
// src/hooks/useIsMobile.ts
|
|
436
|
+
function useIsMobile(ssrFallback = false) {
|
|
437
|
+
const fallbackBreakpoint = ssrFallback ? "xs" : "md";
|
|
438
|
+
const breakpoint = useBreakpoint(fallbackBreakpoint);
|
|
439
|
+
return breakpoint === "xs" || breakpoint === "sm";
|
|
440
|
+
}
|
|
441
|
+
function useIsTablet() {
|
|
442
|
+
const breakpoint = useBreakpoint();
|
|
443
|
+
return breakpoint === "md";
|
|
444
|
+
}
|
|
445
|
+
function useIsDesktop() {
|
|
446
|
+
const breakpoint = useBreakpoint();
|
|
447
|
+
return breakpoint === "lg" || breakpoint === "xl";
|
|
448
|
+
}
|
|
449
|
+
function useSwipeActions({
|
|
450
|
+
leftActions = [],
|
|
451
|
+
rightActions = [],
|
|
452
|
+
threshold = 80,
|
|
453
|
+
disabled = false
|
|
454
|
+
} = {}) {
|
|
455
|
+
const [offsetX, setOffsetX] = React52.useState(0);
|
|
456
|
+
const [isDragging, setIsDragging] = React52.useState(false);
|
|
457
|
+
const [revealed, setRevealed] = React52.useState(null);
|
|
458
|
+
const startX = React52.useRef(0);
|
|
459
|
+
const currentOffsetX = React52.useRef(0);
|
|
460
|
+
currentOffsetX.current = offsetX;
|
|
461
|
+
const reset = React52.useCallback(() => {
|
|
462
|
+
setOffsetX(0);
|
|
463
|
+
setRevealed(null);
|
|
464
|
+
}, []);
|
|
465
|
+
const handleTouchStart = React52.useCallback(
|
|
466
|
+
(e) => {
|
|
467
|
+
if (disabled) return;
|
|
468
|
+
startX.current = e.touches[0].clientX;
|
|
469
|
+
setIsDragging(true);
|
|
470
|
+
},
|
|
471
|
+
[disabled]
|
|
472
|
+
);
|
|
473
|
+
const handleTouchMove = React52.useCallback(
|
|
474
|
+
(e) => {
|
|
475
|
+
if (disabled || !isDragging) return;
|
|
476
|
+
const currentX = e.touches[0].clientX;
|
|
477
|
+
const deltaX = currentX - startX.current;
|
|
478
|
+
const maxLeft = rightActions.length > 0 ? -threshold * 1.5 : 0;
|
|
479
|
+
const maxRight = leftActions.length > 0 ? threshold * 1.5 : 0;
|
|
480
|
+
const clampedX = Math.max(maxLeft, Math.min(maxRight, deltaX));
|
|
481
|
+
setOffsetX(clampedX);
|
|
482
|
+
},
|
|
483
|
+
[disabled, isDragging, threshold, leftActions.length, rightActions.length]
|
|
484
|
+
);
|
|
485
|
+
const handleTouchEnd = React52.useCallback(() => {
|
|
486
|
+
setIsDragging(false);
|
|
487
|
+
const offset = currentOffsetX.current;
|
|
488
|
+
if (Math.abs(offset) >= threshold) {
|
|
489
|
+
if (offset < 0 && rightActions.length > 0) {
|
|
490
|
+
setRevealed("right");
|
|
491
|
+
setOffsetX(-threshold);
|
|
492
|
+
} else if (offset > 0 && leftActions.length > 0) {
|
|
493
|
+
setRevealed("left");
|
|
494
|
+
setOffsetX(threshold);
|
|
495
|
+
} else {
|
|
496
|
+
reset();
|
|
497
|
+
}
|
|
498
|
+
} else {
|
|
499
|
+
reset();
|
|
500
|
+
}
|
|
501
|
+
}, [threshold, leftActions.length, rightActions.length, reset]);
|
|
502
|
+
const computedOffsetX = revealed === "right" ? -threshold : revealed === "left" ? threshold : offsetX;
|
|
503
|
+
return {
|
|
504
|
+
offsetX: computedOffsetX,
|
|
505
|
+
revealed,
|
|
506
|
+
isDragging,
|
|
507
|
+
handlers: {
|
|
508
|
+
onTouchStart: handleTouchStart,
|
|
509
|
+
onTouchMove: handleTouchMove,
|
|
510
|
+
onTouchEnd: handleTouchEnd
|
|
511
|
+
},
|
|
512
|
+
reset
|
|
513
|
+
};
|
|
514
|
+
}
|
|
389
515
|
|
|
390
516
|
// src/components/ui/button/index.tsx
|
|
391
517
|
init_utils();
|
|
@@ -405,8 +531,10 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
405
531
|
default: "h-10 px-4 py-2.5 rounded-md text-[0.9375rem]",
|
|
406
532
|
sm: "h-8 px-3 py-1.5 rounded text-sm",
|
|
407
533
|
lg: "h-12 px-5 py-3 rounded-md text-base",
|
|
534
|
+
touch: "h-11 min-h-[44px] px-4 py-2.5 rounded-md text-base",
|
|
408
535
|
icon: "h-10 w-10 rounded-md",
|
|
409
|
-
"icon-sm": "h-8 w-8 rounded"
|
|
536
|
+
"icon-sm": "h-8 w-8 rounded",
|
|
537
|
+
"icon-touch": "h-11 w-11 min-h-[44px] min-w-[44px] rounded-md"
|
|
410
538
|
},
|
|
411
539
|
fullWidth: {
|
|
412
540
|
true: "w-full"
|
|
@@ -418,7 +546,7 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
418
546
|
}
|
|
419
547
|
}
|
|
420
548
|
);
|
|
421
|
-
var Button =
|
|
549
|
+
var Button = React52__namespace.forwardRef(
|
|
422
550
|
({
|
|
423
551
|
className,
|
|
424
552
|
variant,
|
|
@@ -468,7 +596,7 @@ var Button = React50__namespace.forwardRef(
|
|
|
468
596
|
}
|
|
469
597
|
);
|
|
470
598
|
Button.displayName = "Button";
|
|
471
|
-
var IconButton =
|
|
599
|
+
var IconButton = React52__namespace.forwardRef(
|
|
472
600
|
({ icon, size = "icon", className, ...props }, ref) => {
|
|
473
601
|
return /* @__PURE__ */ jsxRuntime.jsx(Button, { ref, size, className, ...props, children: icon });
|
|
474
602
|
}
|
|
@@ -551,9 +679,10 @@ var inputVariants = classVarianceAuthority.cva(
|
|
|
551
679
|
underlined: "rounded-md border-0 border-b-2 border-mvn-gray-300 px-3.5 py-2.5 hover:border-mvn-gray-400 focus:border-primary bg-transparent"
|
|
552
680
|
},
|
|
553
681
|
inputSize: {
|
|
554
|
-
sm: "h-8 text-
|
|
555
|
-
default: "h-10 text-
|
|
556
|
-
lg: "h-12 text-base px-4 py-3 rounded-md"
|
|
682
|
+
sm: "h-8 text-base px-2.5 py-1.5 rounded",
|
|
683
|
+
default: "h-10 text-base px-3.5 py-2.5 rounded-md",
|
|
684
|
+
lg: "h-12 text-base px-4 py-3 rounded-md",
|
|
685
|
+
touch: "h-11 min-h-[44px] text-base px-3.5 py-2.5 rounded-md"
|
|
557
686
|
}
|
|
558
687
|
},
|
|
559
688
|
defaultVariants: {
|
|
@@ -562,7 +691,7 @@ var inputVariants = classVarianceAuthority.cva(
|
|
|
562
691
|
}
|
|
563
692
|
}
|
|
564
693
|
);
|
|
565
|
-
var Input =
|
|
694
|
+
var Input = React52__namespace.forwardRef(
|
|
566
695
|
({
|
|
567
696
|
className,
|
|
568
697
|
containerClassName,
|
|
@@ -580,12 +709,12 @@ var Input = React50__namespace.forwardRef(
|
|
|
580
709
|
value,
|
|
581
710
|
...props
|
|
582
711
|
}, ref) => {
|
|
583
|
-
const [showPassword, setShowPassword] =
|
|
584
|
-
const [internalValue, setInternalValue] =
|
|
585
|
-
const generatedId =
|
|
712
|
+
const [showPassword, setShowPassword] = React52__namespace.useState(false);
|
|
713
|
+
const [internalValue, setInternalValue] = React52__namespace.useState(value || "");
|
|
714
|
+
const generatedId = React52__namespace.useId();
|
|
586
715
|
const inputId = id || generatedId;
|
|
587
716
|
const hasError = !!error;
|
|
588
|
-
|
|
717
|
+
React52__namespace.useEffect(() => {
|
|
589
718
|
setInternalValue(value || "");
|
|
590
719
|
}, [value]);
|
|
591
720
|
const handleClear = () => {
|
|
@@ -694,7 +823,7 @@ var labelVariants = classVarianceAuthority.cva(
|
|
|
694
823
|
}
|
|
695
824
|
}
|
|
696
825
|
);
|
|
697
|
-
var Label =
|
|
826
|
+
var Label = React52__namespace.forwardRef(({ className, variant, required, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
698
827
|
LabelPrimitive__namespace.Root,
|
|
699
828
|
{
|
|
700
829
|
ref,
|
|
@@ -735,7 +864,7 @@ var textareaVariants = classVarianceAuthority.cva(
|
|
|
735
864
|
}
|
|
736
865
|
}
|
|
737
866
|
);
|
|
738
|
-
var Textarea =
|
|
867
|
+
var Textarea = React52__namespace.forwardRef(
|
|
739
868
|
({
|
|
740
869
|
className,
|
|
741
870
|
containerClassName,
|
|
@@ -753,8 +882,8 @@ var Textarea = React50__namespace.forwardRef(
|
|
|
753
882
|
id,
|
|
754
883
|
...props
|
|
755
884
|
}, ref) => {
|
|
756
|
-
const internalRef =
|
|
757
|
-
const [charCount, setCharCount] =
|
|
885
|
+
const internalRef = React52__namespace.useRef(null);
|
|
886
|
+
const [charCount, setCharCount] = React52__namespace.useState(0);
|
|
758
887
|
const textareaRef = (node) => {
|
|
759
888
|
internalRef.current = node;
|
|
760
889
|
if (typeof ref === "function") {
|
|
@@ -763,14 +892,14 @@ var Textarea = React50__namespace.forwardRef(
|
|
|
763
892
|
ref.current = node;
|
|
764
893
|
}
|
|
765
894
|
};
|
|
766
|
-
|
|
895
|
+
React52__namespace.useEffect(() => {
|
|
767
896
|
if (autoResize && internalRef.current) {
|
|
768
897
|
const textarea = internalRef.current;
|
|
769
898
|
textarea.style.height = "auto";
|
|
770
899
|
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
771
900
|
}
|
|
772
901
|
}, [value, autoResize]);
|
|
773
|
-
const handleChange =
|
|
902
|
+
const handleChange = React52__namespace.useCallback(
|
|
774
903
|
(e) => {
|
|
775
904
|
if (showCount || maxLength) {
|
|
776
905
|
setCharCount(e.target.value.length);
|
|
@@ -779,13 +908,13 @@ var Textarea = React50__namespace.forwardRef(
|
|
|
779
908
|
},
|
|
780
909
|
[onChange, showCount, maxLength]
|
|
781
910
|
);
|
|
782
|
-
|
|
911
|
+
React52__namespace.useEffect(() => {
|
|
783
912
|
if (showCount || maxLength) {
|
|
784
913
|
setCharCount(String(value || "").length);
|
|
785
914
|
}
|
|
786
915
|
}, [value, showCount, maxLength]);
|
|
787
916
|
const hasError = !!error;
|
|
788
|
-
const generatedId =
|
|
917
|
+
const generatedId = React52__namespace.useId();
|
|
789
918
|
const textareaId = id || generatedId;
|
|
790
919
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("w-full space-y-2", containerClassName), children: [
|
|
791
920
|
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -846,10 +975,10 @@ Textarea.displayName = "Textarea";
|
|
|
846
975
|
|
|
847
976
|
// src/components/ui/select/index.tsx
|
|
848
977
|
init_utils();
|
|
849
|
-
var Select =
|
|
978
|
+
var Select = React52__namespace.forwardRef(
|
|
850
979
|
({ children, value, onValueChange, ...props }, _ref) => {
|
|
851
|
-
const [internalValue, setInternalValue] =
|
|
852
|
-
|
|
980
|
+
const [internalValue, setInternalValue] = React52__namespace.useState(value ?? "");
|
|
981
|
+
React52__namespace.useEffect(() => {
|
|
853
982
|
setInternalValue(value ?? "");
|
|
854
983
|
}, [value]);
|
|
855
984
|
const handleValueChange = (newValue) => {
|
|
@@ -871,7 +1000,7 @@ Select.displayName = "Select";
|
|
|
871
1000
|
var SelectGroup = SelectPrimitive__namespace.Group;
|
|
872
1001
|
var SelectValue = SelectPrimitive__namespace.Value;
|
|
873
1002
|
var triggerVariants = classVarianceAuthority.cva(
|
|
874
|
-
"flex
|
|
1003
|
+
"flex w-full items-center justify-between text-[0.9375rem] transition-colors placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:bg-mvn-gray-100 disabled:opacity-60 [&>span]:line-clamp-1",
|
|
875
1004
|
{
|
|
876
1005
|
variants: {
|
|
877
1006
|
variant: {
|
|
@@ -879,18 +1008,25 @@ var triggerVariants = classVarianceAuthority.cva(
|
|
|
879
1008
|
filled: "rounded-md border border-transparent bg-mvn-gray-100 px-3.5 py-2.5 hover:bg-mvn-gray-200 focus:border-primary focus:bg-background",
|
|
880
1009
|
borderless: "rounded-md border border-transparent bg-transparent px-3.5 py-2.5 shadow-none",
|
|
881
1010
|
underlined: "rounded-md border-0 border-b-2 border-mvn-gray-300 px-3.5 py-2.5 hover:border-mvn-gray-400 focus:border-primary"
|
|
1011
|
+
},
|
|
1012
|
+
size: {
|
|
1013
|
+
sm: "h-8 text-sm px-2.5",
|
|
1014
|
+
default: "h-10",
|
|
1015
|
+
lg: "h-12 text-base px-4",
|
|
1016
|
+
touch: "h-11 min-h-[44px] text-base"
|
|
882
1017
|
}
|
|
883
1018
|
},
|
|
884
1019
|
defaultVariants: {
|
|
885
|
-
variant: "outlined"
|
|
1020
|
+
variant: "outlined",
|
|
1021
|
+
size: "default"
|
|
886
1022
|
}
|
|
887
1023
|
}
|
|
888
1024
|
);
|
|
889
|
-
var SelectTrigger =
|
|
1025
|
+
var SelectTrigger = React52__namespace.forwardRef(({ className, children, variant, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
890
1026
|
SelectPrimitive__namespace.Trigger,
|
|
891
1027
|
{
|
|
892
1028
|
ref,
|
|
893
|
-
className: cn(triggerVariants({ variant }), className),
|
|
1029
|
+
className: cn(triggerVariants({ variant, size }), className),
|
|
894
1030
|
...props,
|
|
895
1031
|
children: [
|
|
896
1032
|
children,
|
|
@@ -899,7 +1035,7 @@ var SelectTrigger = React50__namespace.forwardRef(({ className, children, varian
|
|
|
899
1035
|
}
|
|
900
1036
|
));
|
|
901
1037
|
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
902
|
-
var SelectScrollUpButton =
|
|
1038
|
+
var SelectScrollUpButton = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
903
1039
|
SelectPrimitive__namespace.ScrollUpButton,
|
|
904
1040
|
{
|
|
905
1041
|
ref,
|
|
@@ -912,7 +1048,7 @@ var SelectScrollUpButton = React50__namespace.forwardRef(({ className, ...props
|
|
|
912
1048
|
}
|
|
913
1049
|
));
|
|
914
1050
|
SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
|
|
915
|
-
var SelectScrollDownButton =
|
|
1051
|
+
var SelectScrollDownButton = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
916
1052
|
SelectPrimitive__namespace.ScrollDownButton,
|
|
917
1053
|
{
|
|
918
1054
|
ref,
|
|
@@ -925,7 +1061,7 @@ var SelectScrollDownButton = React50__namespace.forwardRef(({ className, ...prop
|
|
|
925
1061
|
}
|
|
926
1062
|
));
|
|
927
1063
|
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
928
|
-
var SelectContent =
|
|
1064
|
+
var SelectContent = React52__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
929
1065
|
SelectPrimitive__namespace.Content,
|
|
930
1066
|
{
|
|
931
1067
|
ref,
|
|
@@ -953,7 +1089,7 @@ var SelectContent = React50__namespace.forwardRef(({ className, children, positi
|
|
|
953
1089
|
}
|
|
954
1090
|
) }));
|
|
955
1091
|
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
956
|
-
var SelectLabel =
|
|
1092
|
+
var SelectLabel = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
957
1093
|
SelectPrimitive__namespace.Label,
|
|
958
1094
|
{
|
|
959
1095
|
ref,
|
|
@@ -965,7 +1101,7 @@ var SelectLabel = React50__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
965
1101
|
}
|
|
966
1102
|
));
|
|
967
1103
|
SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
|
|
968
|
-
var SelectItem =
|
|
1104
|
+
var SelectItem = React52__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
969
1105
|
SelectPrimitive__namespace.Item,
|
|
970
1106
|
{
|
|
971
1107
|
ref,
|
|
@@ -981,7 +1117,7 @@ var SelectItem = React50__namespace.forwardRef(({ className, children, ...props
|
|
|
981
1117
|
}
|
|
982
1118
|
));
|
|
983
1119
|
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
984
|
-
var SelectSeparator =
|
|
1120
|
+
var SelectSeparator = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
985
1121
|
SelectPrimitive__namespace.Separator,
|
|
986
1122
|
{
|
|
987
1123
|
ref,
|
|
@@ -1000,7 +1136,8 @@ var checkboxVariants = classVarianceAuthority.cva(
|
|
|
1000
1136
|
size: {
|
|
1001
1137
|
sm: "h-4 w-4 rounded",
|
|
1002
1138
|
default: "h-[18px] w-[18px] rounded",
|
|
1003
|
-
lg: "h-5 w-5 rounded-md"
|
|
1139
|
+
lg: "h-5 w-5 rounded-md",
|
|
1140
|
+
touch: "h-6 w-6 rounded-md"
|
|
1004
1141
|
}
|
|
1005
1142
|
},
|
|
1006
1143
|
defaultVariants: {
|
|
@@ -1008,10 +1145,23 @@ var checkboxVariants = classVarianceAuthority.cva(
|
|
|
1008
1145
|
}
|
|
1009
1146
|
}
|
|
1010
1147
|
);
|
|
1011
|
-
var
|
|
1012
|
-
|
|
1148
|
+
var checkboxWrapperVariants = classVarianceAuthority.cva("flex items-start", {
|
|
1149
|
+
variants: {
|
|
1150
|
+
size: {
|
|
1151
|
+
sm: "gap-2.5",
|
|
1152
|
+
default: "gap-2.5",
|
|
1153
|
+
lg: "gap-3",
|
|
1154
|
+
touch: "gap-3 min-h-[44px] items-center"
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
defaultVariants: {
|
|
1158
|
+
size: "default"
|
|
1159
|
+
}
|
|
1160
|
+
});
|
|
1161
|
+
var Checkbox = React52__namespace.forwardRef(({ className, size, label, description, indeterminate, ...props }, ref) => {
|
|
1162
|
+
const generatedId = React52__namespace.useId();
|
|
1013
1163
|
const checkboxId = props.id || generatedId;
|
|
1014
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
1164
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(checkboxWrapperVariants({ size })), children: [
|
|
1015
1165
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1016
1166
|
CheckboxPrimitive__namespace.Root,
|
|
1017
1167
|
{
|
|
@@ -1057,10 +1207,40 @@ var radioGroupVariants = classVarianceAuthority.cva("grid gap-2", {
|
|
|
1057
1207
|
orientation: "vertical"
|
|
1058
1208
|
}
|
|
1059
1209
|
});
|
|
1060
|
-
var
|
|
1210
|
+
var radioItemVariants = classVarianceAuthority.cva(
|
|
1211
|
+
"aspect-square rounded-full border border-line-strong text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary shrink-0",
|
|
1212
|
+
{
|
|
1213
|
+
variants: {
|
|
1214
|
+
size: {
|
|
1215
|
+
sm: "h-3.5 w-3.5",
|
|
1216
|
+
default: "h-4 w-4",
|
|
1217
|
+
lg: "h-5 w-5",
|
|
1218
|
+
touch: "h-6 w-6"
|
|
1219
|
+
}
|
|
1220
|
+
},
|
|
1221
|
+
defaultVariants: {
|
|
1222
|
+
size: "default"
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
);
|
|
1226
|
+
var radioIndicatorVariants = classVarianceAuthority.cva("fill-primary text-primary", {
|
|
1227
|
+
variants: {
|
|
1228
|
+
size: {
|
|
1229
|
+
sm: "h-2 w-2",
|
|
1230
|
+
default: "h-2.5 w-2.5",
|
|
1231
|
+
lg: "h-3 w-3",
|
|
1232
|
+
touch: "h-3.5 w-3.5"
|
|
1233
|
+
}
|
|
1234
|
+
},
|
|
1235
|
+
defaultVariants: {
|
|
1236
|
+
size: "default"
|
|
1237
|
+
}
|
|
1238
|
+
});
|
|
1239
|
+
var RadioGroup = React52__namespace.forwardRef(
|
|
1061
1240
|
({
|
|
1062
1241
|
className,
|
|
1063
1242
|
orientation = "vertical",
|
|
1243
|
+
size,
|
|
1064
1244
|
items,
|
|
1065
1245
|
itemClassName,
|
|
1066
1246
|
renderItem,
|
|
@@ -1070,14 +1250,15 @@ var RadioGroup = React50__namespace.forwardRef(
|
|
|
1070
1250
|
children,
|
|
1071
1251
|
...props
|
|
1072
1252
|
}, ref) => {
|
|
1073
|
-
const generatedId =
|
|
1074
|
-
const defaultRenderItem =
|
|
1253
|
+
const generatedId = React52__namespace.useId();
|
|
1254
|
+
const defaultRenderItem = React52__namespace.useCallback(
|
|
1075
1255
|
(item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1076
1256
|
"div",
|
|
1077
1257
|
{
|
|
1078
1258
|
className: cn(
|
|
1079
1259
|
"flex items-start gap-3 rounded-lg border border-line-soft p-4 transition-colors hover:bg-surface-2 has-[[data-state=checked]]:border-primary has-[[data-state=checked]]:bg-primary/5",
|
|
1080
1260
|
item.disabled && "opacity-50 cursor-not-allowed",
|
|
1261
|
+
size === "touch" && "min-h-[44px] items-center",
|
|
1081
1262
|
itemClassName
|
|
1082
1263
|
),
|
|
1083
1264
|
children: [
|
|
@@ -1087,8 +1268,8 @@ var RadioGroup = React50__namespace.forwardRef(
|
|
|
1087
1268
|
value: item.value,
|
|
1088
1269
|
id: `${generatedId}-${item.value}`,
|
|
1089
1270
|
disabled: item.disabled,
|
|
1090
|
-
className:
|
|
1091
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleIcon, { className:
|
|
1271
|
+
className: cn(radioItemVariants({ size }), "mt-0.5"),
|
|
1272
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleIcon, { className: cn(radioIndicatorVariants({ size })) }) })
|
|
1092
1273
|
}
|
|
1093
1274
|
),
|
|
1094
1275
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-1", children: [
|
|
@@ -1109,7 +1290,7 @@ var RadioGroup = React50__namespace.forwardRef(
|
|
|
1109
1290
|
},
|
|
1110
1291
|
item.value
|
|
1111
1292
|
),
|
|
1112
|
-
[generatedId, itemClassName]
|
|
1293
|
+
[generatedId, itemClassName, size]
|
|
1113
1294
|
);
|
|
1114
1295
|
const renderFunction = renderItem || defaultRenderItem;
|
|
1115
1296
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
@@ -1129,17 +1310,14 @@ var RadioGroup = React50__namespace.forwardRef(
|
|
|
1129
1310
|
}
|
|
1130
1311
|
);
|
|
1131
1312
|
RadioGroup.displayName = RadioGroupPrimitive__namespace.Root.displayName;
|
|
1132
|
-
var RadioGroupItem =
|
|
1313
|
+
var RadioGroupItem = React52__namespace.forwardRef(({ className, size, ...props }, ref) => {
|
|
1133
1314
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1134
1315
|
RadioGroupPrimitive__namespace.Item,
|
|
1135
1316
|
{
|
|
1136
1317
|
ref,
|
|
1137
|
-
className: cn(
|
|
1138
|
-
"aspect-square h-4 w-4 rounded-full border border-line-strong text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary",
|
|
1139
|
-
className
|
|
1140
|
-
),
|
|
1318
|
+
className: cn(radioItemVariants({ size }), className),
|
|
1141
1319
|
...props,
|
|
1142
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleIcon, { className:
|
|
1320
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleIcon, { className: cn(radioIndicatorVariants({ size })) }) })
|
|
1143
1321
|
}
|
|
1144
1322
|
);
|
|
1145
1323
|
});
|
|
@@ -1147,32 +1325,49 @@ RadioGroupItem.displayName = RadioGroupPrimitive__namespace.Item.displayName;
|
|
|
1147
1325
|
|
|
1148
1326
|
// src/components/ui/switch/index.tsx
|
|
1149
1327
|
init_utils();
|
|
1150
|
-
var
|
|
1328
|
+
var switchVariants = classVarianceAuthority.cva(
|
|
1329
|
+
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
1330
|
+
{
|
|
1331
|
+
variants: {
|
|
1332
|
+
size: {
|
|
1333
|
+
sm: "h-5 w-9",
|
|
1334
|
+
default: "h-6 w-11",
|
|
1335
|
+
lg: "h-7 w-[52px]",
|
|
1336
|
+
touch: "h-7 w-[52px] min-h-[44px] min-w-[44px]"
|
|
1337
|
+
}
|
|
1338
|
+
},
|
|
1339
|
+
defaultVariants: {
|
|
1340
|
+
size: "default"
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
);
|
|
1344
|
+
var thumbVariants = classVarianceAuthority.cva(
|
|
1345
|
+
"group pointer-events-none relative flex items-center justify-center rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
1346
|
+
{
|
|
1347
|
+
variants: {
|
|
1348
|
+
size: {
|
|
1349
|
+
sm: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",
|
|
1350
|
+
default: "h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
|
1351
|
+
lg: "h-6 w-6 data-[state=checked]:translate-x-6 data-[state=unchecked]:translate-x-0",
|
|
1352
|
+
touch: "h-6 w-6 data-[state=checked]:translate-x-6 data-[state=unchecked]:translate-x-0"
|
|
1353
|
+
}
|
|
1354
|
+
},
|
|
1355
|
+
defaultVariants: {
|
|
1356
|
+
size: "default"
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
);
|
|
1360
|
+
var Switch = React52__namespace.forwardRef(({ className, size, offNode, onNode, ...props }, ref) => {
|
|
1151
1361
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1152
1362
|
SwitchPrimitives__namespace.Root,
|
|
1153
1363
|
{
|
|
1154
1364
|
ref,
|
|
1155
|
-
className: cn(
|
|
1156
|
-
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
|
|
1157
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
1158
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1159
|
-
"data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
1160
|
-
className
|
|
1161
|
-
),
|
|
1365
|
+
className: cn(switchVariants({ size }), className),
|
|
1162
1366
|
...props,
|
|
1163
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1164
|
-
|
|
1165
|
-
{
|
|
1166
|
-
|
|
1167
|
-
"group pointer-events-none relative flex items-center justify-center h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
1168
|
-
"data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
1169
|
-
),
|
|
1170
|
-
children: [
|
|
1171
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute opacity-0 group-data-[state=checked]:opacity-100 transition-all duration-200", children: onNode }),
|
|
1172
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute opacity-100 group-data-[state=checked]:opacity-0 transition-all duration-200", children: offNode })
|
|
1173
|
-
]
|
|
1174
|
-
}
|
|
1175
|
-
)
|
|
1367
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(SwitchPrimitives__namespace.Thumb, { className: cn(thumbVariants({ size })), children: [
|
|
1368
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute opacity-0 group-data-[state=checked]:opacity-100 transition-all duration-200", children: onNode }),
|
|
1369
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute opacity-100 group-data-[state=checked]:opacity-0 transition-all duration-200", children: offNode })
|
|
1370
|
+
] })
|
|
1176
1371
|
}
|
|
1177
1372
|
);
|
|
1178
1373
|
});
|
|
@@ -1201,7 +1396,7 @@ var toggleVariants = classVarianceAuthority.cva(
|
|
|
1201
1396
|
}
|
|
1202
1397
|
}
|
|
1203
1398
|
);
|
|
1204
|
-
var Toggle =
|
|
1399
|
+
var Toggle = React52__namespace.forwardRef(({ className, variant, size, icon, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1205
1400
|
TogglePrimitive__namespace.Root,
|
|
1206
1401
|
{
|
|
1207
1402
|
ref,
|
|
@@ -1247,9 +1442,9 @@ var toggleGroupItemVariants = classVarianceAuthority.cva(
|
|
|
1247
1442
|
}
|
|
1248
1443
|
}
|
|
1249
1444
|
);
|
|
1250
|
-
var ToggleGroup =
|
|
1445
|
+
var ToggleGroup = React52__namespace.forwardRef(
|
|
1251
1446
|
({ className, size, items, itemClassName, renderItem, children, ...props }, ref) => {
|
|
1252
|
-
const defaultRenderItem =
|
|
1447
|
+
const defaultRenderItem = React52__namespace.useCallback(
|
|
1253
1448
|
(item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1254
1449
|
ToggleGroupPrimitive__namespace.Item,
|
|
1255
1450
|
{
|
|
@@ -1279,7 +1474,7 @@ var ToggleGroup = React50__namespace.forwardRef(
|
|
|
1279
1474
|
}
|
|
1280
1475
|
);
|
|
1281
1476
|
ToggleGroup.displayName = "ToggleGroup";
|
|
1282
|
-
var ToggleGroupItem =
|
|
1477
|
+
var ToggleGroupItem = React52__namespace.forwardRef(({ className, size, children, ...props }, ref) => {
|
|
1283
1478
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1284
1479
|
ToggleGroupPrimitive__namespace.Item,
|
|
1285
1480
|
{
|
|
@@ -1294,7 +1489,7 @@ ToggleGroupItem.displayName = "ToggleGroupItem";
|
|
|
1294
1489
|
|
|
1295
1490
|
// src/components/ui/slider/index.tsx
|
|
1296
1491
|
init_utils();
|
|
1297
|
-
var Slider =
|
|
1492
|
+
var Slider = React52__namespace.forwardRef(
|
|
1298
1493
|
({
|
|
1299
1494
|
className,
|
|
1300
1495
|
showValue,
|
|
@@ -1353,7 +1548,7 @@ var inputGroupVariants = classVarianceAuthority.cva("flex items-stretch w-full",
|
|
|
1353
1548
|
size: "default"
|
|
1354
1549
|
}
|
|
1355
1550
|
});
|
|
1356
|
-
var InputGroup =
|
|
1551
|
+
var InputGroup = React52__namespace.forwardRef(
|
|
1357
1552
|
({
|
|
1358
1553
|
className,
|
|
1359
1554
|
size,
|
|
@@ -1389,9 +1584,9 @@ var InputGroup = React50__namespace.forwardRef(
|
|
|
1389
1584
|
}
|
|
1390
1585
|
),
|
|
1391
1586
|
leftElement && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex items-center", children: leftElement }),
|
|
1392
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children:
|
|
1393
|
-
if (
|
|
1394
|
-
return
|
|
1587
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: React52__namespace.Children.map(children, (child) => {
|
|
1588
|
+
if (React52__namespace.isValidElement(child)) {
|
|
1589
|
+
return React52__namespace.cloneElement(child, {
|
|
1395
1590
|
className: cn(
|
|
1396
1591
|
child.props.className,
|
|
1397
1592
|
(leftAddon || leftElement) && "rounded-l-none border-l-0",
|
|
@@ -1422,7 +1617,7 @@ InputGroup.displayName = "InputGroup";
|
|
|
1422
1617
|
|
|
1423
1618
|
// src/components/ui/input-otp/index.tsx
|
|
1424
1619
|
init_utils();
|
|
1425
|
-
var InputOTP =
|
|
1620
|
+
var InputOTP = React52__namespace.forwardRef(({ containerClassName, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1426
1621
|
inputOtp.OTPInput,
|
|
1427
1622
|
{
|
|
1428
1623
|
ref,
|
|
@@ -1435,10 +1630,10 @@ var InputOTP = React50__namespace.forwardRef(({ containerClassName, children, ..
|
|
|
1435
1630
|
}
|
|
1436
1631
|
));
|
|
1437
1632
|
InputOTP.displayName = "InputOTP";
|
|
1438
|
-
var InputOTPGroup =
|
|
1633
|
+
var InputOTPGroup = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center gap-2", className), ...props }));
|
|
1439
1634
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
1440
|
-
var InputOTPSlot =
|
|
1441
|
-
const inputOTPContext =
|
|
1635
|
+
var InputOTPSlot = React52__namespace.forwardRef(({ index, className, ...props }, ref) => {
|
|
1636
|
+
const inputOTPContext = React52__namespace.useContext(inputOtp.OTPInputContext);
|
|
1442
1637
|
if (!inputOTPContext) {
|
|
1443
1638
|
console.error("InputOTPSlot must be used within InputOTP");
|
|
1444
1639
|
return null;
|
|
@@ -1472,7 +1667,7 @@ var InputOTPSlot = React50__namespace.forwardRef(({ index, className, ...props }
|
|
|
1472
1667
|
);
|
|
1473
1668
|
});
|
|
1474
1669
|
InputOTPSlot.displayName = "InputOTPSlot";
|
|
1475
|
-
var InputOTPSeparator =
|
|
1670
|
+
var InputOTPSeparator = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, role: "separator", className, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MinusIcon, { className: "h-4 w-4 text-muted-foreground" }) }));
|
|
1476
1671
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
1477
1672
|
|
|
1478
1673
|
// src/components/ui/form/form-utils.ts
|
|
@@ -1907,9 +2102,9 @@ function createFormInstance(name) {
|
|
|
1907
2102
|
}
|
|
1908
2103
|
|
|
1909
2104
|
// src/components/ui/form/form-context.tsx
|
|
1910
|
-
var FormContext =
|
|
2105
|
+
var FormContext = React52.createContext(null);
|
|
1911
2106
|
function useForm(name) {
|
|
1912
|
-
const ref =
|
|
2107
|
+
const ref = React52.useRef();
|
|
1913
2108
|
if (!ref.current) {
|
|
1914
2109
|
const instance = createFormInstance(name);
|
|
1915
2110
|
ref.current = instance;
|
|
@@ -1919,17 +2114,17 @@ function useForm(name) {
|
|
|
1919
2114
|
return ref.current;
|
|
1920
2115
|
}
|
|
1921
2116
|
function useWatch(name, formInstance) {
|
|
1922
|
-
const ctx =
|
|
2117
|
+
const ctx = React52.useContext(FormContext);
|
|
1923
2118
|
const form = formInstance ?? ctx?.form;
|
|
1924
2119
|
if (!form)
|
|
1925
2120
|
throw new Error(
|
|
1926
2121
|
"useWatch must be used inside Form or receive a form instance."
|
|
1927
2122
|
);
|
|
1928
|
-
const [state, setState] =
|
|
2123
|
+
const [state, setState] = React52.useState(() => ({
|
|
1929
2124
|
value: name === void 0 ? form.getFieldsValue() : Array.isArray(name) ? name.map((n) => form.getFieldValue(n)) : form.getFieldValue(name),
|
|
1930
2125
|
revision: 0
|
|
1931
2126
|
}));
|
|
1932
|
-
|
|
2127
|
+
React52.useEffect(() => {
|
|
1933
2128
|
const readValue = () => {
|
|
1934
2129
|
if (name === void 0) return form.getFieldsValue();
|
|
1935
2130
|
if (Array.isArray(name)) return name.map((n) => form.getFieldValue(n));
|
|
@@ -2033,7 +2228,7 @@ var maxValueRule = (max, message2) => ({
|
|
|
2033
2228
|
message: message2 || `Must be at most ${max}`
|
|
2034
2229
|
});
|
|
2035
2230
|
var composeRules = (...rules) => rules.filter(Boolean);
|
|
2036
|
-
var Form =
|
|
2231
|
+
var Form = React52.forwardRef(function Form2(props, ref) {
|
|
2037
2232
|
const {
|
|
2038
2233
|
form: formProp,
|
|
2039
2234
|
initialValues,
|
|
@@ -2045,11 +2240,11 @@ var Form = React50.forwardRef(function Form2(props, ref) {
|
|
|
2045
2240
|
onFieldsChange,
|
|
2046
2241
|
children
|
|
2047
2242
|
} = props;
|
|
2048
|
-
const createdFormRef =
|
|
2243
|
+
const createdFormRef = React52.useRef(null);
|
|
2049
2244
|
const form = formProp || (createdFormRef.current ?? (createdFormRef.current = useForm()));
|
|
2050
|
-
const initialAppliedRef =
|
|
2051
|
-
const [, forceUpdate] =
|
|
2052
|
-
|
|
2245
|
+
const initialAppliedRef = React52.useRef(false);
|
|
2246
|
+
const [, forceUpdate] = React52.useState(0);
|
|
2247
|
+
React52.useEffect(() => {
|
|
2053
2248
|
if (!initialAppliedRef.current && initialValues) {
|
|
2054
2249
|
form.setFieldsValue(initialValues);
|
|
2055
2250
|
initialAppliedRef.current = true;
|
|
@@ -2112,8 +2307,8 @@ var Form = React50.forwardRef(function Form2(props, ref) {
|
|
|
2112
2307
|
onValuesChange,
|
|
2113
2308
|
onFieldsChange
|
|
2114
2309
|
]);
|
|
2115
|
-
|
|
2116
|
-
const handleSubmit =
|
|
2310
|
+
React52.useImperativeHandle(ref, () => ({ ...form, nativeElement: null }));
|
|
2311
|
+
const handleSubmit = React52.useCallback(
|
|
2117
2312
|
(event) => {
|
|
2118
2313
|
if (event) event.preventDefault();
|
|
2119
2314
|
form.validateFields().then((values) => {
|
|
@@ -2139,11 +2334,11 @@ var FormItem = (props) => {
|
|
|
2139
2334
|
variant = "outlined",
|
|
2140
2335
|
requiredMark
|
|
2141
2336
|
} = props;
|
|
2142
|
-
const ctx =
|
|
2337
|
+
const ctx = React52.useContext(FormContext);
|
|
2143
2338
|
if (!ctx) throw new Error("FormItem must be used inside Form");
|
|
2144
2339
|
const { form, disabled: contextDisabled } = ctx;
|
|
2145
|
-
const [, tick] =
|
|
2146
|
-
|
|
2340
|
+
const [, tick] = React52.useState(0);
|
|
2341
|
+
React52.useEffect(() => {
|
|
2147
2342
|
const meta = {
|
|
2148
2343
|
rules,
|
|
2149
2344
|
onStoreChange: () => tick((value) => value + 1),
|
|
@@ -2161,7 +2356,7 @@ var FormItem = (props) => {
|
|
|
2161
2356
|
const isRequired = Array.isArray(rules) ? rules.some((rule) => rule && rule.required) : false;
|
|
2162
2357
|
const isDisabled = !!contextDisabled;
|
|
2163
2358
|
const requiredIndicator = requiredMark === void 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive mr-1", "aria-hidden": "true", children: "*" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1", "aria-hidden": "true", children: requiredMark });
|
|
2164
|
-
if (!children || !
|
|
2359
|
+
if (!children || !React52__namespace.default.isValidElement(children)) return null;
|
|
2165
2360
|
const childProps = {};
|
|
2166
2361
|
childProps[valuePropName] = fieldValue;
|
|
2167
2362
|
const childClass = children.props.className;
|
|
@@ -2208,23 +2403,23 @@ var FormItem = (props) => {
|
|
|
2208
2403
|
isRequired ? requiredIndicator : null,
|
|
2209
2404
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
|
|
2210
2405
|
] }) : null,
|
|
2211
|
-
|
|
2406
|
+
React52.cloneElement(children, childProps),
|
|
2212
2407
|
help ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground mt-2", children: help }) : null,
|
|
2213
2408
|
fieldErrors && fieldErrors.length ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-destructive mt-1 text-sm font-medium", children: fieldErrors[0] }) : null
|
|
2214
2409
|
] });
|
|
2215
2410
|
};
|
|
2216
2411
|
var FormList = (props) => {
|
|
2217
2412
|
const { name, initialValue, children } = props;
|
|
2218
|
-
const ctx =
|
|
2413
|
+
const ctx = React52.useContext(FormContext);
|
|
2219
2414
|
if (!ctx) throw new Error("FormList must be used inside Form");
|
|
2220
2415
|
const { form, disabled: contextDisabled } = ctx;
|
|
2221
2416
|
const isDisabled = !!contextDisabled;
|
|
2222
|
-
const [fields, setFields] =
|
|
2223
|
-
const [errors, setErrors] =
|
|
2417
|
+
const [fields, setFields] = React52.useState([]);
|
|
2418
|
+
const [errors, setErrors] = React52.useState(
|
|
2224
2419
|
() => form.getFieldError(name) || []
|
|
2225
2420
|
);
|
|
2226
|
-
const initializedRef =
|
|
2227
|
-
const syncFields =
|
|
2421
|
+
const initializedRef = React52.useRef(false);
|
|
2422
|
+
const syncFields = React52.useCallback((list) => {
|
|
2228
2423
|
const next = list.map((_, index) => ({
|
|
2229
2424
|
key: index,
|
|
2230
2425
|
name: index,
|
|
@@ -2232,24 +2427,24 @@ var FormList = (props) => {
|
|
|
2232
2427
|
}));
|
|
2233
2428
|
setFields(next);
|
|
2234
2429
|
}, []);
|
|
2235
|
-
const updateState =
|
|
2430
|
+
const updateState = React52.useCallback(() => {
|
|
2236
2431
|
const raw = form.getFieldValue(name);
|
|
2237
2432
|
const list = Array.isArray(raw) ? raw : [];
|
|
2238
2433
|
syncFields(list);
|
|
2239
2434
|
setErrors(form.getFieldError(name) || []);
|
|
2240
2435
|
}, [form, name, syncFields]);
|
|
2241
|
-
const ensureList =
|
|
2436
|
+
const ensureList = React52.useCallback(() => {
|
|
2242
2437
|
const raw = form.getFieldValue(name);
|
|
2243
2438
|
return Array.isArray(raw) ? [...raw] : [];
|
|
2244
2439
|
}, [form, name]);
|
|
2245
|
-
const setList =
|
|
2440
|
+
const setList = React52.useCallback(
|
|
2246
2441
|
(next) => {
|
|
2247
2442
|
form.setFieldValue(name, next);
|
|
2248
2443
|
updateState();
|
|
2249
2444
|
},
|
|
2250
2445
|
[form, name, updateState]
|
|
2251
2446
|
);
|
|
2252
|
-
const add =
|
|
2447
|
+
const add = React52.useCallback(
|
|
2253
2448
|
(defaultValue, index) => {
|
|
2254
2449
|
if (isDisabled) return;
|
|
2255
2450
|
const list = ensureList();
|
|
@@ -2259,7 +2454,7 @@ var FormList = (props) => {
|
|
|
2259
2454
|
},
|
|
2260
2455
|
[ensureList, isDisabled, setList]
|
|
2261
2456
|
);
|
|
2262
|
-
const remove =
|
|
2457
|
+
const remove = React52.useCallback(
|
|
2263
2458
|
(index) => {
|
|
2264
2459
|
if (isDisabled) return;
|
|
2265
2460
|
const list = ensureList();
|
|
@@ -2271,7 +2466,7 @@ var FormList = (props) => {
|
|
|
2271
2466
|
},
|
|
2272
2467
|
[ensureList, isDisabled, setList]
|
|
2273
2468
|
);
|
|
2274
|
-
const move =
|
|
2469
|
+
const move = React52.useCallback(
|
|
2275
2470
|
(from, to) => {
|
|
2276
2471
|
if (isDisabled) return;
|
|
2277
2472
|
const list = ensureList();
|
|
@@ -2284,7 +2479,7 @@ var FormList = (props) => {
|
|
|
2284
2479
|
},
|
|
2285
2480
|
[ensureList, isDisabled, setList]
|
|
2286
2481
|
);
|
|
2287
|
-
|
|
2482
|
+
React52.useEffect(() => {
|
|
2288
2483
|
if (initializedRef.current) return;
|
|
2289
2484
|
if (initialValue === void 0) return;
|
|
2290
2485
|
const current = form.getFieldValue(name);
|
|
@@ -2297,7 +2492,7 @@ var FormList = (props) => {
|
|
|
2297
2492
|
}
|
|
2298
2493
|
initializedRef.current = true;
|
|
2299
2494
|
}, [form, name, initialValue, updateState]);
|
|
2300
|
-
|
|
2495
|
+
React52.useEffect(() => {
|
|
2301
2496
|
const handleChange = () => updateState();
|
|
2302
2497
|
handleChange();
|
|
2303
2498
|
let unsubscribe = null;
|
|
@@ -2329,7 +2524,7 @@ var fieldVariants = classVarianceAuthority.cva("", {
|
|
|
2329
2524
|
orientation: "vertical"
|
|
2330
2525
|
}
|
|
2331
2526
|
});
|
|
2332
|
-
var Field =
|
|
2527
|
+
var Field = React52__namespace.forwardRef(
|
|
2333
2528
|
({
|
|
2334
2529
|
className,
|
|
2335
2530
|
orientation,
|
|
@@ -2342,7 +2537,7 @@ var Field = React50__namespace.forwardRef(
|
|
|
2342
2537
|
children,
|
|
2343
2538
|
...props
|
|
2344
2539
|
}, ref) => {
|
|
2345
|
-
const generatedId =
|
|
2540
|
+
const generatedId = React52__namespace.useId();
|
|
2346
2541
|
const fieldId = htmlFor || generatedId;
|
|
2347
2542
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2348
2543
|
"div",
|
|
@@ -2391,7 +2586,7 @@ var alertVariants = classVarianceAuthority.cva(
|
|
|
2391
2586
|
}
|
|
2392
2587
|
}
|
|
2393
2588
|
);
|
|
2394
|
-
var Alert =
|
|
2589
|
+
var Alert = React52__namespace.forwardRef(
|
|
2395
2590
|
({
|
|
2396
2591
|
className,
|
|
2397
2592
|
variant,
|
|
@@ -2404,8 +2599,8 @@ var Alert = React50__namespace.forwardRef(
|
|
|
2404
2599
|
descriptionClassName,
|
|
2405
2600
|
...props
|
|
2406
2601
|
}, ref) => {
|
|
2407
|
-
const [isVisible, setIsVisible] =
|
|
2408
|
-
const handleDismiss =
|
|
2602
|
+
const [isVisible, setIsVisible] = React52__namespace.useState(true);
|
|
2603
|
+
const handleDismiss = React52__namespace.useCallback(() => {
|
|
2409
2604
|
setIsVisible(false);
|
|
2410
2605
|
onClose?.();
|
|
2411
2606
|
}, [onClose]);
|
|
@@ -2467,14 +2662,14 @@ Alert.displayName = "Alert";
|
|
|
2467
2662
|
|
|
2468
2663
|
// src/components/ui/toast/index.tsx
|
|
2469
2664
|
init_utils();
|
|
2470
|
-
var ToastContext =
|
|
2665
|
+
var ToastContext = React52.createContext(void 0);
|
|
2471
2666
|
function ToastProvider({
|
|
2472
2667
|
children,
|
|
2473
2668
|
defaultDuration = 5e3,
|
|
2474
2669
|
position = "top-right"
|
|
2475
2670
|
}) {
|
|
2476
|
-
const [toasts, setToasts] =
|
|
2477
|
-
const toast2 =
|
|
2671
|
+
const [toasts, setToasts] = React52.useState([]);
|
|
2672
|
+
const toast2 = React52.useCallback(
|
|
2478
2673
|
(props) => {
|
|
2479
2674
|
const id = Math.random().toString(36).substring(7);
|
|
2480
2675
|
const duration = props.duration ?? defaultDuration;
|
|
@@ -2493,7 +2688,7 @@ function ToastProvider({
|
|
|
2493
2688
|
},
|
|
2494
2689
|
[defaultDuration]
|
|
2495
2690
|
);
|
|
2496
|
-
const dismiss =
|
|
2691
|
+
const dismiss = React52.useCallback((id) => {
|
|
2497
2692
|
setToasts((prev) => prev.filter((toast3) => toast3.id !== id));
|
|
2498
2693
|
}, []);
|
|
2499
2694
|
const getPositionClasses = () => {
|
|
@@ -2540,7 +2735,7 @@ function ToastProvider({
|
|
|
2540
2735
|
] });
|
|
2541
2736
|
}
|
|
2542
2737
|
function useToastContext() {
|
|
2543
|
-
const context =
|
|
2738
|
+
const context = React52.useContext(ToastContext);
|
|
2544
2739
|
if (!context) {
|
|
2545
2740
|
throw new Error("useToast must be used within ToastProvider");
|
|
2546
2741
|
}
|
|
@@ -2574,7 +2769,7 @@ var toastVariants = classVarianceAuthority.cva(
|
|
|
2574
2769
|
}
|
|
2575
2770
|
}
|
|
2576
2771
|
);
|
|
2577
|
-
var Toast =
|
|
2772
|
+
var Toast = React52__namespace.forwardRef(
|
|
2578
2773
|
({
|
|
2579
2774
|
className,
|
|
2580
2775
|
variant,
|
|
@@ -2587,8 +2782,8 @@ var Toast = React50__namespace.forwardRef(
|
|
|
2587
2782
|
descriptionClassName,
|
|
2588
2783
|
...props
|
|
2589
2784
|
}, ref) => {
|
|
2590
|
-
const [isVisible, setIsVisible] =
|
|
2591
|
-
const handleDismiss =
|
|
2785
|
+
const [isVisible, setIsVisible] = React52__namespace.useState(true);
|
|
2786
|
+
const handleDismiss = React52__namespace.useCallback(() => {
|
|
2592
2787
|
setIsVisible(false);
|
|
2593
2788
|
onClose?.();
|
|
2594
2789
|
}, [onClose]);
|
|
@@ -2684,7 +2879,7 @@ var progressVariants = classVarianceAuthority.cva(
|
|
|
2684
2879
|
}
|
|
2685
2880
|
}
|
|
2686
2881
|
);
|
|
2687
|
-
var Progress =
|
|
2882
|
+
var Progress = React52__namespace.forwardRef(
|
|
2688
2883
|
({
|
|
2689
2884
|
className,
|
|
2690
2885
|
value = 0,
|
|
@@ -2750,7 +2945,7 @@ var spinnerVariants = classVarianceAuthority.cva("animate-spin", {
|
|
|
2750
2945
|
variant: "default"
|
|
2751
2946
|
}
|
|
2752
2947
|
});
|
|
2753
|
-
var Spinner =
|
|
2948
|
+
var Spinner = React52__namespace.forwardRef(
|
|
2754
2949
|
({ className, size, variant, label, centered, overlay, icon, ...props }, ref) => {
|
|
2755
2950
|
const spinnerContent = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2756
2951
|
"div",
|
|
@@ -2781,7 +2976,7 @@ var Spinner = React50__namespace.forwardRef(
|
|
|
2781
2976
|
}
|
|
2782
2977
|
);
|
|
2783
2978
|
Spinner.displayName = "Spinner";
|
|
2784
|
-
var DotsSpinner =
|
|
2979
|
+
var DotsSpinner = React52__namespace.forwardRef(
|
|
2785
2980
|
({ className, size = "default", dotCount = 3, ...props }, ref) => {
|
|
2786
2981
|
const dotSizeMap = {
|
|
2787
2982
|
xs: "h-1 w-1",
|
|
@@ -2834,7 +3029,7 @@ var skeletonVariants = classVarianceAuthority.cva(
|
|
|
2834
3029
|
}
|
|
2835
3030
|
}
|
|
2836
3031
|
);
|
|
2837
|
-
var Skeleton =
|
|
3032
|
+
var Skeleton = React52__namespace.forwardRef(
|
|
2838
3033
|
({
|
|
2839
3034
|
className,
|
|
2840
3035
|
variant,
|
|
@@ -2883,7 +3078,7 @@ var Skeleton = React50__namespace.forwardRef(
|
|
|
2883
3078
|
}
|
|
2884
3079
|
);
|
|
2885
3080
|
Skeleton.displayName = "Skeleton";
|
|
2886
|
-
var SkeletonCard =
|
|
3081
|
+
var SkeletonCard = React52__namespace.forwardRef(
|
|
2887
3082
|
({ className, avatar = false, lines = 3, ...props }, ref) => {
|
|
2888
3083
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("space-y-4", className), ...props, children: [
|
|
2889
3084
|
avatar && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -2923,7 +3118,7 @@ var emptyVariants = classVarianceAuthority.cva(
|
|
|
2923
3118
|
}
|
|
2924
3119
|
}
|
|
2925
3120
|
);
|
|
2926
|
-
var Empty =
|
|
3121
|
+
var Empty = React52__namespace.forwardRef(
|
|
2927
3122
|
({
|
|
2928
3123
|
className,
|
|
2929
3124
|
size,
|
|
@@ -2964,7 +3159,7 @@ var Dialog = DialogPrimitive__namespace.Root;
|
|
|
2964
3159
|
var DialogTrigger = DialogPrimitive__namespace.Trigger;
|
|
2965
3160
|
var DialogPortal = DialogPrimitive__namespace.Portal;
|
|
2966
3161
|
var DialogClose = DialogPrimitive__namespace.Close;
|
|
2967
|
-
var DialogOverlay =
|
|
3162
|
+
var DialogOverlay = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2968
3163
|
DialogPrimitive__namespace.Overlay,
|
|
2969
3164
|
{
|
|
2970
3165
|
ref,
|
|
@@ -2976,7 +3171,7 @@ var DialogOverlay = React50__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
2976
3171
|
}
|
|
2977
3172
|
));
|
|
2978
3173
|
DialogOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
|
|
2979
|
-
var DialogContent =
|
|
3174
|
+
var DialogContent = React52__namespace.forwardRef(
|
|
2980
3175
|
({
|
|
2981
3176
|
className,
|
|
2982
3177
|
children,
|
|
@@ -3041,7 +3236,7 @@ var DialogFooter = ({
|
|
|
3041
3236
|
}
|
|
3042
3237
|
);
|
|
3043
3238
|
DialogFooter.displayName = "DialogFooter";
|
|
3044
|
-
var DialogTitle =
|
|
3239
|
+
var DialogTitle = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3045
3240
|
DialogPrimitive__namespace.Title,
|
|
3046
3241
|
{
|
|
3047
3242
|
ref,
|
|
@@ -3053,7 +3248,7 @@ var DialogTitle = React50__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
3053
3248
|
}
|
|
3054
3249
|
));
|
|
3055
3250
|
DialogTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
3056
|
-
var DialogDescription =
|
|
3251
|
+
var DialogDescription = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3057
3252
|
DialogPrimitive__namespace.Description,
|
|
3058
3253
|
{
|
|
3059
3254
|
ref,
|
|
@@ -3068,7 +3263,7 @@ init_utils();
|
|
|
3068
3263
|
var AlertDialog = AlertDialogPrimitive__namespace.Root;
|
|
3069
3264
|
var AlertDialogTrigger = AlertDialogPrimitive__namespace.Trigger;
|
|
3070
3265
|
var AlertDialogPortal = AlertDialogPrimitive__namespace.Portal;
|
|
3071
|
-
var AlertDialogOverlay =
|
|
3266
|
+
var AlertDialogOverlay = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3072
3267
|
AlertDialogPrimitive__namespace.Overlay,
|
|
3073
3268
|
{
|
|
3074
3269
|
className: cn(
|
|
@@ -3080,7 +3275,7 @@ var AlertDialogOverlay = React50__namespace.forwardRef(({ className, ...props },
|
|
|
3080
3275
|
}
|
|
3081
3276
|
));
|
|
3082
3277
|
AlertDialogOverlay.displayName = AlertDialogPrimitive__namespace.Overlay.displayName;
|
|
3083
|
-
var AlertDialogContent =
|
|
3278
|
+
var AlertDialogContent = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogPortal, { children: [
|
|
3084
3279
|
/* @__PURE__ */ jsxRuntime.jsx(AlertDialogOverlay, {}),
|
|
3085
3280
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3086
3281
|
AlertDialogPrimitive__namespace.Content,
|
|
@@ -3123,7 +3318,7 @@ var AlertDialogFooter = ({
|
|
|
3123
3318
|
}
|
|
3124
3319
|
);
|
|
3125
3320
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
3126
|
-
var AlertDialogTitle =
|
|
3321
|
+
var AlertDialogTitle = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3127
3322
|
AlertDialogPrimitive__namespace.Title,
|
|
3128
3323
|
{
|
|
3129
3324
|
ref,
|
|
@@ -3132,7 +3327,7 @@ var AlertDialogTitle = React50__namespace.forwardRef(({ className, ...props }, r
|
|
|
3132
3327
|
}
|
|
3133
3328
|
));
|
|
3134
3329
|
AlertDialogTitle.displayName = AlertDialogPrimitive__namespace.Title.displayName;
|
|
3135
|
-
var AlertDialogDescription =
|
|
3330
|
+
var AlertDialogDescription = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3136
3331
|
AlertDialogPrimitive__namespace.Description,
|
|
3137
3332
|
{
|
|
3138
3333
|
ref,
|
|
@@ -3141,7 +3336,7 @@ var AlertDialogDescription = React50__namespace.forwardRef(({ className, ...prop
|
|
|
3141
3336
|
}
|
|
3142
3337
|
));
|
|
3143
3338
|
AlertDialogDescription.displayName = AlertDialogPrimitive__namespace.Description.displayName;
|
|
3144
|
-
var AlertDialogAction =
|
|
3339
|
+
var AlertDialogAction = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3145
3340
|
AlertDialogPrimitive__namespace.Action,
|
|
3146
3341
|
{
|
|
3147
3342
|
ref,
|
|
@@ -3150,7 +3345,7 @@ var AlertDialogAction = React50__namespace.forwardRef(({ className, ...props },
|
|
|
3150
3345
|
}
|
|
3151
3346
|
));
|
|
3152
3347
|
AlertDialogAction.displayName = AlertDialogPrimitive__namespace.Action.displayName;
|
|
3153
|
-
var AlertDialogCancel =
|
|
3348
|
+
var AlertDialogCancel = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3154
3349
|
AlertDialogPrimitive__namespace.Cancel,
|
|
3155
3350
|
{
|
|
3156
3351
|
ref,
|
|
@@ -3170,7 +3365,7 @@ var Sheet = DialogPrimitive__namespace.Root;
|
|
|
3170
3365
|
var SheetTrigger = DialogPrimitive__namespace.Trigger;
|
|
3171
3366
|
var SheetClose = DialogPrimitive__namespace.Close;
|
|
3172
3367
|
var SheetPortal = DialogPrimitive__namespace.Portal;
|
|
3173
|
-
var SheetOverlay =
|
|
3368
|
+
var SheetOverlay = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3174
3369
|
DialogPrimitive__namespace.Overlay,
|
|
3175
3370
|
{
|
|
3176
3371
|
className: cn(
|
|
@@ -3198,7 +3393,7 @@ var sheetVariants = classVarianceAuthority.cva(
|
|
|
3198
3393
|
}
|
|
3199
3394
|
}
|
|
3200
3395
|
);
|
|
3201
|
-
var SheetContent =
|
|
3396
|
+
var SheetContent = React52__namespace.forwardRef(({ side = "right", className, children, hideClose, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(SheetPortal, { children: [
|
|
3202
3397
|
/* @__PURE__ */ jsxRuntime.jsx(SheetOverlay, {}),
|
|
3203
3398
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3204
3399
|
DialogPrimitive__namespace.Content,
|
|
@@ -3245,7 +3440,7 @@ var SheetFooter = ({
|
|
|
3245
3440
|
}
|
|
3246
3441
|
);
|
|
3247
3442
|
SheetFooter.displayName = "SheetFooter";
|
|
3248
|
-
var SheetTitle =
|
|
3443
|
+
var SheetTitle = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3249
3444
|
DialogPrimitive__namespace.Title,
|
|
3250
3445
|
{
|
|
3251
3446
|
ref,
|
|
@@ -3254,7 +3449,7 @@ var SheetTitle = React50__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
3254
3449
|
}
|
|
3255
3450
|
));
|
|
3256
3451
|
SheetTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
3257
|
-
var SheetDescription =
|
|
3452
|
+
var SheetDescription = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3258
3453
|
DialogPrimitive__namespace.Description,
|
|
3259
3454
|
{
|
|
3260
3455
|
ref,
|
|
@@ -3266,7 +3461,7 @@ SheetDescription.displayName = DialogPrimitive__namespace.Description.displayNam
|
|
|
3266
3461
|
|
|
3267
3462
|
// src/components/ui/drawer/index.tsx
|
|
3268
3463
|
init_utils();
|
|
3269
|
-
var DrawerContext =
|
|
3464
|
+
var DrawerContext = React52__namespace.createContext({
|
|
3270
3465
|
direction: "bottom"
|
|
3271
3466
|
});
|
|
3272
3467
|
var Drawer = ({
|
|
@@ -3285,7 +3480,7 @@ Drawer.displayName = "Drawer";
|
|
|
3285
3480
|
var DrawerTrigger = vaul.Drawer.Trigger;
|
|
3286
3481
|
var DrawerPortal = vaul.Drawer.Portal;
|
|
3287
3482
|
var DrawerClose = vaul.Drawer.Close;
|
|
3288
|
-
var DrawerOverlay =
|
|
3483
|
+
var DrawerOverlay = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3289
3484
|
vaul.Drawer.Overlay,
|
|
3290
3485
|
{
|
|
3291
3486
|
ref,
|
|
@@ -3294,7 +3489,7 @@ var DrawerOverlay = React50__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
3294
3489
|
}
|
|
3295
3490
|
));
|
|
3296
3491
|
DrawerOverlay.displayName = vaul.Drawer.Overlay.displayName;
|
|
3297
|
-
var DrawerContent =
|
|
3492
|
+
var DrawerContent = React52__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DrawerPortal, { children: [
|
|
3298
3493
|
/* @__PURE__ */ jsxRuntime.jsx(DrawerOverlay, {}),
|
|
3299
3494
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3300
3495
|
vaul.Drawer.Content,
|
|
@@ -3329,7 +3524,7 @@ var DrawerFooter = ({
|
|
|
3329
3524
|
}
|
|
3330
3525
|
);
|
|
3331
3526
|
DrawerFooter.displayName = "DrawerFooter";
|
|
3332
|
-
var DrawerTitle =
|
|
3527
|
+
var DrawerTitle = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3333
3528
|
vaul.Drawer.Title,
|
|
3334
3529
|
{
|
|
3335
3530
|
ref,
|
|
@@ -3341,7 +3536,7 @@ var DrawerTitle = React50__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
3341
3536
|
}
|
|
3342
3537
|
));
|
|
3343
3538
|
DrawerTitle.displayName = vaul.Drawer.Title.displayName;
|
|
3344
|
-
var DrawerDescription =
|
|
3539
|
+
var DrawerDescription = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3345
3540
|
vaul.Drawer.Description,
|
|
3346
3541
|
{
|
|
3347
3542
|
ref,
|
|
@@ -3356,7 +3551,7 @@ init_utils();
|
|
|
3356
3551
|
var Popover = PopoverPrimitive__namespace.Root;
|
|
3357
3552
|
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
3358
3553
|
var PopoverAnchor = PopoverPrimitive__namespace.Anchor;
|
|
3359
|
-
var PopoverContent =
|
|
3554
|
+
var PopoverContent = React52__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3360
3555
|
PopoverPrimitive__namespace.Content,
|
|
3361
3556
|
{
|
|
3362
3557
|
ref,
|
|
@@ -3376,7 +3571,7 @@ init_utils();
|
|
|
3376
3571
|
var TooltipProvider = TooltipPrimitive__namespace.Provider;
|
|
3377
3572
|
var Tooltip = TooltipPrimitive__namespace.Root;
|
|
3378
3573
|
var TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
3379
|
-
var TooltipContent =
|
|
3574
|
+
var TooltipContent = React52__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3380
3575
|
TooltipPrimitive__namespace.Content,
|
|
3381
3576
|
{
|
|
3382
3577
|
ref,
|
|
@@ -3391,7 +3586,7 @@ var TooltipContent = React50__namespace.forwardRef(({ className, sideOffset = 4,
|
|
|
3391
3586
|
}
|
|
3392
3587
|
));
|
|
3393
3588
|
TooltipContent.displayName = TooltipPrimitive__namespace.Content.displayName;
|
|
3394
|
-
var SimpleTooltip =
|
|
3589
|
+
var SimpleTooltip = React52__namespace.forwardRef(
|
|
3395
3590
|
({
|
|
3396
3591
|
children,
|
|
3397
3592
|
content,
|
|
@@ -3422,7 +3617,7 @@ init_utils();
|
|
|
3422
3617
|
var HoverCard = HoverCardPrimitive__namespace.Root;
|
|
3423
3618
|
var HoverCardTrigger = HoverCardPrimitive__namespace.Trigger;
|
|
3424
3619
|
var HoverCardArrow = HoverCardPrimitive__namespace.Arrow;
|
|
3425
|
-
var HoverCardContent =
|
|
3620
|
+
var HoverCardContent = React52__namespace.forwardRef(
|
|
3426
3621
|
({
|
|
3427
3622
|
className,
|
|
3428
3623
|
align = "center",
|
|
@@ -3466,7 +3661,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
|
|
|
3466
3661
|
var DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
|
|
3467
3662
|
var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
|
|
3468
3663
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
|
|
3469
|
-
var DropdownMenuSubTrigger =
|
|
3664
|
+
var DropdownMenuSubTrigger = React52__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3470
3665
|
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
3471
3666
|
{
|
|
3472
3667
|
ref,
|
|
@@ -3483,7 +3678,7 @@ var DropdownMenuSubTrigger = React50__namespace.forwardRef(({ className, inset,
|
|
|
3483
3678
|
}
|
|
3484
3679
|
));
|
|
3485
3680
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
|
|
3486
|
-
var DropdownMenuSubContent =
|
|
3681
|
+
var DropdownMenuSubContent = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3487
3682
|
DropdownMenuPrimitive__namespace.SubContent,
|
|
3488
3683
|
{
|
|
3489
3684
|
ref,
|
|
@@ -3495,7 +3690,7 @@ var DropdownMenuSubContent = React50__namespace.forwardRef(({ className, ...prop
|
|
|
3495
3690
|
}
|
|
3496
3691
|
));
|
|
3497
3692
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
|
|
3498
|
-
var DropdownMenuContent =
|
|
3693
|
+
var DropdownMenuContent = React52__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3499
3694
|
DropdownMenuPrimitive__namespace.Content,
|
|
3500
3695
|
{
|
|
3501
3696
|
ref,
|
|
@@ -3508,7 +3703,7 @@ var DropdownMenuContent = React50__namespace.forwardRef(({ className, sideOffset
|
|
|
3508
3703
|
}
|
|
3509
3704
|
) }));
|
|
3510
3705
|
DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
|
|
3511
|
-
var DropdownMenuItem =
|
|
3706
|
+
var DropdownMenuItem = React52__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3512
3707
|
DropdownMenuPrimitive__namespace.Item,
|
|
3513
3708
|
{
|
|
3514
3709
|
ref,
|
|
@@ -3521,7 +3716,7 @@ var DropdownMenuItem = React50__namespace.forwardRef(({ className, inset, ...pro
|
|
|
3521
3716
|
}
|
|
3522
3717
|
));
|
|
3523
3718
|
DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
|
|
3524
|
-
var DropdownMenuCheckboxItem =
|
|
3719
|
+
var DropdownMenuCheckboxItem = React52__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3525
3720
|
DropdownMenuPrimitive__namespace.CheckboxItem,
|
|
3526
3721
|
{
|
|
3527
3722
|
ref,
|
|
@@ -3538,7 +3733,7 @@ var DropdownMenuCheckboxItem = React50__namespace.forwardRef(({ className, child
|
|
|
3538
3733
|
}
|
|
3539
3734
|
));
|
|
3540
3735
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
|
|
3541
|
-
var DropdownMenuRadioItem =
|
|
3736
|
+
var DropdownMenuRadioItem = React52__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3542
3737
|
DropdownMenuPrimitive__namespace.RadioItem,
|
|
3543
3738
|
{
|
|
3544
3739
|
ref,
|
|
@@ -3554,7 +3749,7 @@ var DropdownMenuRadioItem = React50__namespace.forwardRef(({ className, children
|
|
|
3554
3749
|
}
|
|
3555
3750
|
));
|
|
3556
3751
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
|
|
3557
|
-
var DropdownMenuLabel =
|
|
3752
|
+
var DropdownMenuLabel = React52__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3558
3753
|
DropdownMenuPrimitive__namespace.Label,
|
|
3559
3754
|
{
|
|
3560
3755
|
ref,
|
|
@@ -3567,7 +3762,7 @@ var DropdownMenuLabel = React50__namespace.forwardRef(({ className, inset, ...pr
|
|
|
3567
3762
|
}
|
|
3568
3763
|
));
|
|
3569
3764
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
|
|
3570
|
-
var DropdownMenuSeparator =
|
|
3765
|
+
var DropdownMenuSeparator = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3571
3766
|
DropdownMenuPrimitive__namespace.Separator,
|
|
3572
3767
|
{
|
|
3573
3768
|
ref,
|
|
@@ -3598,7 +3793,7 @@ var ContextMenuGroup = ContextMenuPrimitive__namespace.Group;
|
|
|
3598
3793
|
var ContextMenuPortal = ContextMenuPrimitive__namespace.Portal;
|
|
3599
3794
|
var ContextMenuSub = ContextMenuPrimitive__namespace.Sub;
|
|
3600
3795
|
var ContextMenuRadioGroup = ContextMenuPrimitive__namespace.RadioGroup;
|
|
3601
|
-
var ContextMenuSubTrigger =
|
|
3796
|
+
var ContextMenuSubTrigger = React52__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3602
3797
|
ContextMenuPrimitive__namespace.SubTrigger,
|
|
3603
3798
|
{
|
|
3604
3799
|
ref,
|
|
@@ -3615,7 +3810,7 @@ var ContextMenuSubTrigger = React50__namespace.forwardRef(({ className, inset, c
|
|
|
3615
3810
|
}
|
|
3616
3811
|
));
|
|
3617
3812
|
ContextMenuSubTrigger.displayName = ContextMenuPrimitive__namespace.SubTrigger.displayName;
|
|
3618
|
-
var ContextMenuSubContent =
|
|
3813
|
+
var ContextMenuSubContent = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3619
3814
|
ContextMenuPrimitive__namespace.SubContent,
|
|
3620
3815
|
{
|
|
3621
3816
|
ref,
|
|
@@ -3627,7 +3822,7 @@ var ContextMenuSubContent = React50__namespace.forwardRef(({ className, ...props
|
|
|
3627
3822
|
}
|
|
3628
3823
|
));
|
|
3629
3824
|
ContextMenuSubContent.displayName = ContextMenuPrimitive__namespace.SubContent.displayName;
|
|
3630
|
-
var ContextMenuContent =
|
|
3825
|
+
var ContextMenuContent = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(ContextMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3631
3826
|
ContextMenuPrimitive__namespace.Content,
|
|
3632
3827
|
{
|
|
3633
3828
|
ref,
|
|
@@ -3639,7 +3834,7 @@ var ContextMenuContent = React50__namespace.forwardRef(({ className, ...props },
|
|
|
3639
3834
|
}
|
|
3640
3835
|
) }));
|
|
3641
3836
|
ContextMenuContent.displayName = ContextMenuPrimitive__namespace.Content.displayName;
|
|
3642
|
-
var ContextMenuItem =
|
|
3837
|
+
var ContextMenuItem = React52__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3643
3838
|
ContextMenuPrimitive__namespace.Item,
|
|
3644
3839
|
{
|
|
3645
3840
|
ref,
|
|
@@ -3652,7 +3847,7 @@ var ContextMenuItem = React50__namespace.forwardRef(({ className, inset, ...prop
|
|
|
3652
3847
|
}
|
|
3653
3848
|
));
|
|
3654
3849
|
ContextMenuItem.displayName = ContextMenuPrimitive__namespace.Item.displayName;
|
|
3655
|
-
var ContextMenuCheckboxItem =
|
|
3850
|
+
var ContextMenuCheckboxItem = React52__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3656
3851
|
ContextMenuPrimitive__namespace.CheckboxItem,
|
|
3657
3852
|
{
|
|
3658
3853
|
ref,
|
|
@@ -3669,7 +3864,7 @@ var ContextMenuCheckboxItem = React50__namespace.forwardRef(({ className, childr
|
|
|
3669
3864
|
}
|
|
3670
3865
|
));
|
|
3671
3866
|
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive__namespace.CheckboxItem.displayName;
|
|
3672
|
-
var ContextMenuRadioItem =
|
|
3867
|
+
var ContextMenuRadioItem = React52__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3673
3868
|
ContextMenuPrimitive__namespace.RadioItem,
|
|
3674
3869
|
{
|
|
3675
3870
|
ref,
|
|
@@ -3685,7 +3880,7 @@ var ContextMenuRadioItem = React50__namespace.forwardRef(({ className, children,
|
|
|
3685
3880
|
}
|
|
3686
3881
|
));
|
|
3687
3882
|
ContextMenuRadioItem.displayName = ContextMenuPrimitive__namespace.RadioItem.displayName;
|
|
3688
|
-
var ContextMenuLabel =
|
|
3883
|
+
var ContextMenuLabel = React52__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3689
3884
|
ContextMenuPrimitive__namespace.Label,
|
|
3690
3885
|
{
|
|
3691
3886
|
ref,
|
|
@@ -3698,7 +3893,7 @@ var ContextMenuLabel = React50__namespace.forwardRef(({ className, inset, ...pro
|
|
|
3698
3893
|
}
|
|
3699
3894
|
));
|
|
3700
3895
|
ContextMenuLabel.displayName = ContextMenuPrimitive__namespace.Label.displayName;
|
|
3701
|
-
var ContextMenuSeparator =
|
|
3896
|
+
var ContextMenuSeparator = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3702
3897
|
ContextMenuPrimitive__namespace.Separator,
|
|
3703
3898
|
{
|
|
3704
3899
|
ref,
|
|
@@ -3731,7 +3926,7 @@ var MenubarGroup = MenubarPrimitive__namespace.Group;
|
|
|
3731
3926
|
var MenubarPortal = MenubarPrimitive__namespace.Portal;
|
|
3732
3927
|
var MenubarSub = MenubarPrimitive__namespace.Sub;
|
|
3733
3928
|
var MenubarRadioGroup = MenubarPrimitive__namespace.RadioGroup;
|
|
3734
|
-
var Menubar =
|
|
3929
|
+
var Menubar = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3735
3930
|
MenubarPrimitive__namespace.Root,
|
|
3736
3931
|
{
|
|
3737
3932
|
ref,
|
|
@@ -3743,7 +3938,7 @@ var Menubar = React50__namespace.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3743
3938
|
}
|
|
3744
3939
|
));
|
|
3745
3940
|
Menubar.displayName = MenubarPrimitive__namespace.Root.displayName;
|
|
3746
|
-
var MenubarTrigger =
|
|
3941
|
+
var MenubarTrigger = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3747
3942
|
MenubarPrimitive__namespace.Trigger,
|
|
3748
3943
|
{
|
|
3749
3944
|
ref,
|
|
@@ -3755,7 +3950,7 @@ var MenubarTrigger = React50__namespace.forwardRef(({ className, ...props }, ref
|
|
|
3755
3950
|
}
|
|
3756
3951
|
));
|
|
3757
3952
|
MenubarTrigger.displayName = MenubarPrimitive__namespace.Trigger.displayName;
|
|
3758
|
-
var MenubarSubTrigger =
|
|
3953
|
+
var MenubarSubTrigger = React52__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3759
3954
|
MenubarPrimitive__namespace.SubTrigger,
|
|
3760
3955
|
{
|
|
3761
3956
|
ref,
|
|
@@ -3772,7 +3967,7 @@ var MenubarSubTrigger = React50__namespace.forwardRef(({ className, inset, child
|
|
|
3772
3967
|
}
|
|
3773
3968
|
));
|
|
3774
3969
|
MenubarSubTrigger.displayName = MenubarPrimitive__namespace.SubTrigger.displayName;
|
|
3775
|
-
var MenubarSubContent =
|
|
3970
|
+
var MenubarSubContent = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3776
3971
|
MenubarPrimitive__namespace.SubContent,
|
|
3777
3972
|
{
|
|
3778
3973
|
ref,
|
|
@@ -3784,7 +3979,7 @@ var MenubarSubContent = React50__namespace.forwardRef(({ className, ...props },
|
|
|
3784
3979
|
}
|
|
3785
3980
|
));
|
|
3786
3981
|
MenubarSubContent.displayName = MenubarPrimitive__namespace.SubContent.displayName;
|
|
3787
|
-
var MenubarContent =
|
|
3982
|
+
var MenubarContent = React52__namespace.forwardRef(
|
|
3788
3983
|
({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(MenubarPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3789
3984
|
MenubarPrimitive__namespace.Content,
|
|
3790
3985
|
{
|
|
@@ -3801,7 +3996,7 @@ var MenubarContent = React50__namespace.forwardRef(
|
|
|
3801
3996
|
) })
|
|
3802
3997
|
);
|
|
3803
3998
|
MenubarContent.displayName = MenubarPrimitive__namespace.Content.displayName;
|
|
3804
|
-
var MenubarItem =
|
|
3999
|
+
var MenubarItem = React52__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3805
4000
|
MenubarPrimitive__namespace.Item,
|
|
3806
4001
|
{
|
|
3807
4002
|
ref,
|
|
@@ -3814,7 +4009,7 @@ var MenubarItem = React50__namespace.forwardRef(({ className, inset, ...props },
|
|
|
3814
4009
|
}
|
|
3815
4010
|
));
|
|
3816
4011
|
MenubarItem.displayName = MenubarPrimitive__namespace.Item.displayName;
|
|
3817
|
-
var MenubarCheckboxItem =
|
|
4012
|
+
var MenubarCheckboxItem = React52__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3818
4013
|
MenubarPrimitive__namespace.CheckboxItem,
|
|
3819
4014
|
{
|
|
3820
4015
|
ref,
|
|
@@ -3831,7 +4026,7 @@ var MenubarCheckboxItem = React50__namespace.forwardRef(({ className, children,
|
|
|
3831
4026
|
}
|
|
3832
4027
|
));
|
|
3833
4028
|
MenubarCheckboxItem.displayName = MenubarPrimitive__namespace.CheckboxItem.displayName;
|
|
3834
|
-
var MenubarRadioItem =
|
|
4029
|
+
var MenubarRadioItem = React52__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3835
4030
|
MenubarPrimitive__namespace.RadioItem,
|
|
3836
4031
|
{
|
|
3837
4032
|
ref,
|
|
@@ -3847,7 +4042,7 @@ var MenubarRadioItem = React50__namespace.forwardRef(({ className, children, ...
|
|
|
3847
4042
|
}
|
|
3848
4043
|
));
|
|
3849
4044
|
MenubarRadioItem.displayName = MenubarPrimitive__namespace.RadioItem.displayName;
|
|
3850
|
-
var MenubarLabel =
|
|
4045
|
+
var MenubarLabel = React52__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3851
4046
|
MenubarPrimitive__namespace.Label,
|
|
3852
4047
|
{
|
|
3853
4048
|
ref,
|
|
@@ -3860,7 +4055,7 @@ var MenubarLabel = React50__namespace.forwardRef(({ className, inset, ...props }
|
|
|
3860
4055
|
}
|
|
3861
4056
|
));
|
|
3862
4057
|
MenubarLabel.displayName = MenubarPrimitive__namespace.Label.displayName;
|
|
3863
|
-
var MenubarSeparator =
|
|
4058
|
+
var MenubarSeparator = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3864
4059
|
MenubarPrimitive__namespace.Separator,
|
|
3865
4060
|
{
|
|
3866
4061
|
ref,
|
|
@@ -3888,7 +4083,7 @@ MenubarShortcut.displayName = "MenubarShortcut";
|
|
|
3888
4083
|
|
|
3889
4084
|
// src/components/ui/navigation-menu/index.tsx
|
|
3890
4085
|
init_utils();
|
|
3891
|
-
var NavigationMenu =
|
|
4086
|
+
var NavigationMenu = React52__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3892
4087
|
NavigationMenuPrimitive__namespace.Root,
|
|
3893
4088
|
{
|
|
3894
4089
|
ref,
|
|
@@ -3904,7 +4099,7 @@ var NavigationMenu = React50__namespace.forwardRef(({ className, children, ...pr
|
|
|
3904
4099
|
}
|
|
3905
4100
|
));
|
|
3906
4101
|
NavigationMenu.displayName = NavigationMenuPrimitive__namespace.Root.displayName;
|
|
3907
|
-
var NavigationMenuList =
|
|
4102
|
+
var NavigationMenuList = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3908
4103
|
NavigationMenuPrimitive__namespace.List,
|
|
3909
4104
|
{
|
|
3910
4105
|
ref,
|
|
@@ -3920,7 +4115,7 @@ var NavigationMenuItem = NavigationMenuPrimitive__namespace.Item;
|
|
|
3920
4115
|
var navigationMenuTriggerStyle = classVarianceAuthority.cva(
|
|
3921
4116
|
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-[0.9375rem] font-medium transition-colors hover:bg-mvn-gray-100 focus:bg-mvn-gray-100 focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-mvn-gray-100 data-[state=open]:bg-mvn-gray-100"
|
|
3922
4117
|
);
|
|
3923
|
-
var NavigationMenuTrigger =
|
|
4118
|
+
var NavigationMenuTrigger = React52__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3924
4119
|
NavigationMenuPrimitive__namespace.Trigger,
|
|
3925
4120
|
{
|
|
3926
4121
|
ref,
|
|
@@ -3940,7 +4135,7 @@ var NavigationMenuTrigger = React50__namespace.forwardRef(({ className, children
|
|
|
3940
4135
|
}
|
|
3941
4136
|
));
|
|
3942
4137
|
NavigationMenuTrigger.displayName = NavigationMenuPrimitive__namespace.Trigger.displayName;
|
|
3943
|
-
var NavigationMenuContent =
|
|
4138
|
+
var NavigationMenuContent = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3944
4139
|
NavigationMenuPrimitive__namespace.Content,
|
|
3945
4140
|
{
|
|
3946
4141
|
ref,
|
|
@@ -3953,7 +4148,7 @@ var NavigationMenuContent = React50__namespace.forwardRef(({ className, ...props
|
|
|
3953
4148
|
));
|
|
3954
4149
|
NavigationMenuContent.displayName = NavigationMenuPrimitive__namespace.Content.displayName;
|
|
3955
4150
|
var NavigationMenuLink = NavigationMenuPrimitive__namespace.Link;
|
|
3956
|
-
var NavigationMenuViewport =
|
|
4151
|
+
var NavigationMenuViewport = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3957
4152
|
NavigationMenuPrimitive__namespace.Viewport,
|
|
3958
4153
|
{
|
|
3959
4154
|
className: cn(
|
|
@@ -3965,7 +4160,7 @@ var NavigationMenuViewport = React50__namespace.forwardRef(({ className, ...prop
|
|
|
3965
4160
|
}
|
|
3966
4161
|
) }));
|
|
3967
4162
|
NavigationMenuViewport.displayName = NavigationMenuPrimitive__namespace.Viewport.displayName;
|
|
3968
|
-
var NavigationMenuIndicator =
|
|
4163
|
+
var NavigationMenuIndicator = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3969
4164
|
NavigationMenuPrimitive__namespace.Indicator,
|
|
3970
4165
|
{
|
|
3971
4166
|
ref,
|
|
@@ -3981,7 +4176,7 @@ NavigationMenuIndicator.displayName = NavigationMenuPrimitive__namespace.Indicat
|
|
|
3981
4176
|
|
|
3982
4177
|
// src/components/ui/command/index.tsx
|
|
3983
4178
|
init_utils();
|
|
3984
|
-
var Command =
|
|
4179
|
+
var Command = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3985
4180
|
cmdk.Command,
|
|
3986
4181
|
{
|
|
3987
4182
|
ref,
|
|
@@ -3996,7 +4191,7 @@ Command.displayName = cmdk.Command.displayName;
|
|
|
3996
4191
|
var CommandDialog = ({ children, ...props }) => {
|
|
3997
4192
|
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ jsxRuntime.jsx(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) }) });
|
|
3998
4193
|
};
|
|
3999
|
-
var CommandInput =
|
|
4194
|
+
var CommandInput = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center border-b border-mvn-gray-200 px-3", "cmdk-input-wrapper": "", children: [
|
|
4000
4195
|
/* @__PURE__ */ jsxRuntime.jsx(reactIcons.MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
4001
4196
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4002
4197
|
cmdk.Command.Input,
|
|
@@ -4011,7 +4206,7 @@ var CommandInput = React50__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
4011
4206
|
)
|
|
4012
4207
|
] }));
|
|
4013
4208
|
CommandInput.displayName = cmdk.Command.Input.displayName;
|
|
4014
|
-
var CommandList =
|
|
4209
|
+
var CommandList = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4015
4210
|
cmdk.Command.List,
|
|
4016
4211
|
{
|
|
4017
4212
|
ref,
|
|
@@ -4020,7 +4215,7 @@ var CommandList = React50__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
4020
4215
|
}
|
|
4021
4216
|
));
|
|
4022
4217
|
CommandList.displayName = cmdk.Command.List.displayName;
|
|
4023
|
-
var CommandEmpty =
|
|
4218
|
+
var CommandEmpty = React52__namespace.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4024
4219
|
cmdk.Command.Empty,
|
|
4025
4220
|
{
|
|
4026
4221
|
ref,
|
|
@@ -4029,7 +4224,7 @@ var CommandEmpty = React50__namespace.forwardRef((props, ref) => /* @__PURE__ */
|
|
|
4029
4224
|
}
|
|
4030
4225
|
));
|
|
4031
4226
|
CommandEmpty.displayName = cmdk.Command.Empty.displayName;
|
|
4032
|
-
var CommandGroup =
|
|
4227
|
+
var CommandGroup = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4033
4228
|
cmdk.Command.Group,
|
|
4034
4229
|
{
|
|
4035
4230
|
ref,
|
|
@@ -4041,7 +4236,7 @@ var CommandGroup = React50__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
4041
4236
|
}
|
|
4042
4237
|
));
|
|
4043
4238
|
CommandGroup.displayName = cmdk.Command.Group.displayName;
|
|
4044
|
-
var CommandSeparator =
|
|
4239
|
+
var CommandSeparator = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4045
4240
|
cmdk.Command.Separator,
|
|
4046
4241
|
{
|
|
4047
4242
|
ref,
|
|
@@ -4050,7 +4245,7 @@ var CommandSeparator = React50__namespace.forwardRef(({ className, ...props }, r
|
|
|
4050
4245
|
}
|
|
4051
4246
|
));
|
|
4052
4247
|
CommandSeparator.displayName = cmdk.Command.Separator.displayName;
|
|
4053
|
-
var CommandItem =
|
|
4248
|
+
var CommandItem = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4054
4249
|
cmdk.Command.Item,
|
|
4055
4250
|
{
|
|
4056
4251
|
ref,
|
|
@@ -4081,7 +4276,7 @@ CommandShortcut.displayName = "CommandShortcut";
|
|
|
4081
4276
|
|
|
4082
4277
|
// src/components/ui/combobox/index.tsx
|
|
4083
4278
|
init_utils();
|
|
4084
|
-
var Combobox =
|
|
4279
|
+
var Combobox = React52__namespace.forwardRef(
|
|
4085
4280
|
({
|
|
4086
4281
|
options,
|
|
4087
4282
|
value,
|
|
@@ -4093,7 +4288,7 @@ var Combobox = React50__namespace.forwardRef(
|
|
|
4093
4288
|
disabled,
|
|
4094
4289
|
clearable
|
|
4095
4290
|
}, ref) => {
|
|
4096
|
-
const [open, setOpen] =
|
|
4291
|
+
const [open, setOpen] = React52__namespace.useState(false);
|
|
4097
4292
|
const selectedOption = options.find((option) => option.value === value);
|
|
4098
4293
|
const handleClear = (e) => {
|
|
4099
4294
|
e.stopPropagation();
|
|
@@ -4165,9 +4360,9 @@ Combobox.displayName = "Combobox";
|
|
|
4165
4360
|
|
|
4166
4361
|
// src/components/ui/breadcrumb/index.tsx
|
|
4167
4362
|
init_utils();
|
|
4168
|
-
var Breadcrumb =
|
|
4363
|
+
var Breadcrumb = React52__namespace.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
4169
4364
|
Breadcrumb.displayName = "Breadcrumb";
|
|
4170
|
-
var BreadcrumbList =
|
|
4365
|
+
var BreadcrumbList = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4171
4366
|
"ol",
|
|
4172
4367
|
{
|
|
4173
4368
|
ref,
|
|
@@ -4179,7 +4374,7 @@ var BreadcrumbList = React50__namespace.forwardRef(({ className, ...props }, ref
|
|
|
4179
4374
|
}
|
|
4180
4375
|
));
|
|
4181
4376
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
4182
|
-
var BreadcrumbItem =
|
|
4377
|
+
var BreadcrumbItem = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4183
4378
|
"li",
|
|
4184
4379
|
{
|
|
4185
4380
|
ref,
|
|
@@ -4188,7 +4383,7 @@ var BreadcrumbItem = React50__namespace.forwardRef(({ className, ...props }, ref
|
|
|
4188
4383
|
}
|
|
4189
4384
|
));
|
|
4190
4385
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
4191
|
-
var BreadcrumbLink =
|
|
4386
|
+
var BreadcrumbLink = React52__namespace.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
4192
4387
|
const Comp = "a";
|
|
4193
4388
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4194
4389
|
Comp,
|
|
@@ -4203,7 +4398,7 @@ var BreadcrumbLink = React50__namespace.forwardRef(({ asChild, className, ...pro
|
|
|
4203
4398
|
);
|
|
4204
4399
|
});
|
|
4205
4400
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
4206
|
-
var BreadcrumbPage =
|
|
4401
|
+
var BreadcrumbPage = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4207
4402
|
"span",
|
|
4208
4403
|
{
|
|
4209
4404
|
ref,
|
|
@@ -4270,7 +4465,7 @@ var Pagination = ({
|
|
|
4270
4465
|
}
|
|
4271
4466
|
);
|
|
4272
4467
|
Pagination.displayName = "Pagination";
|
|
4273
|
-
var PaginationContent =
|
|
4468
|
+
var PaginationContent = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4274
4469
|
"ul",
|
|
4275
4470
|
{
|
|
4276
4471
|
ref,
|
|
@@ -4279,7 +4474,7 @@ var PaginationContent = React50__namespace.forwardRef(({ className, ...props },
|
|
|
4279
4474
|
}
|
|
4280
4475
|
));
|
|
4281
4476
|
PaginationContent.displayName = "PaginationContent";
|
|
4282
|
-
var PaginationItem =
|
|
4477
|
+
var PaginationItem = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: cn("", className), ...props }));
|
|
4283
4478
|
PaginationItem.displayName = "PaginationItem";
|
|
4284
4479
|
var PaginationLink = ({
|
|
4285
4480
|
className,
|
|
@@ -4386,12 +4581,12 @@ PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
|
4386
4581
|
|
|
4387
4582
|
// src/components/ui/tabs/index.tsx
|
|
4388
4583
|
init_utils();
|
|
4389
|
-
var TabsContext =
|
|
4584
|
+
var TabsContext = React52__namespace.createContext({
|
|
4390
4585
|
destroyInactiveTabs: true
|
|
4391
4586
|
});
|
|
4392
|
-
var Tabs =
|
|
4587
|
+
var Tabs = React52__namespace.forwardRef(({ destroyInactiveTabs = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TabsContext.Provider, { value: { destroyInactiveTabs }, children: /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Root, { ref, ...props }) }));
|
|
4393
4588
|
Tabs.displayName = TabsPrimitive__namespace.Root.displayName;
|
|
4394
|
-
var TabsList =
|
|
4589
|
+
var TabsList = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4395
4590
|
TabsPrimitive__namespace.List,
|
|
4396
4591
|
{
|
|
4397
4592
|
ref,
|
|
@@ -4406,7 +4601,7 @@ var TabsList = React50__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
4406
4601
|
}
|
|
4407
4602
|
));
|
|
4408
4603
|
TabsList.displayName = TabsPrimitive__namespace.List.displayName;
|
|
4409
|
-
var TabsTrigger =
|
|
4604
|
+
var TabsTrigger = React52__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4410
4605
|
TabsPrimitive__namespace.Trigger,
|
|
4411
4606
|
{
|
|
4412
4607
|
ref,
|
|
@@ -4428,8 +4623,8 @@ var TabsTrigger = React50__namespace.forwardRef(({ className, children, ...props
|
|
|
4428
4623
|
}
|
|
4429
4624
|
));
|
|
4430
4625
|
TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
|
|
4431
|
-
var TabsContent =
|
|
4432
|
-
const { destroyInactiveTabs } =
|
|
4626
|
+
var TabsContent = React52__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
4627
|
+
const { destroyInactiveTabs } = React52__namespace.useContext(TabsContext);
|
|
4433
4628
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4434
4629
|
TabsPrimitive__namespace.Content,
|
|
4435
4630
|
{
|
|
@@ -4518,7 +4713,7 @@ var separatorVariants = classVarianceAuthority.cva("shrink-0 bg-line-normal", {
|
|
|
4518
4713
|
variant: "default"
|
|
4519
4714
|
}
|
|
4520
4715
|
});
|
|
4521
|
-
var Separator5 =
|
|
4716
|
+
var Separator5 = React52__namespace.forwardRef(
|
|
4522
4717
|
({
|
|
4523
4718
|
className,
|
|
4524
4719
|
orientation = "horizontal",
|
|
@@ -4575,7 +4770,7 @@ var AspectRatio = AspectRatioPrimitive__namespace.Root;
|
|
|
4575
4770
|
|
|
4576
4771
|
// src/components/ui/accordion/index.tsx
|
|
4577
4772
|
init_utils();
|
|
4578
|
-
var Accordion =
|
|
4773
|
+
var Accordion = React52__namespace.forwardRef(
|
|
4579
4774
|
({
|
|
4580
4775
|
items,
|
|
4581
4776
|
className,
|
|
@@ -4585,7 +4780,7 @@ var Accordion = React50__namespace.forwardRef(
|
|
|
4585
4780
|
renderItem,
|
|
4586
4781
|
...props
|
|
4587
4782
|
}, ref) => {
|
|
4588
|
-
const defaultRenderItem =
|
|
4783
|
+
const defaultRenderItem = React52__namespace.useCallback(
|
|
4589
4784
|
(item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4590
4785
|
AccordionPrimitive__namespace.Item,
|
|
4591
4786
|
{
|
|
@@ -4633,7 +4828,7 @@ Accordion.displayName = "Accordion";
|
|
|
4633
4828
|
// src/components/ui/collapsible/index.tsx
|
|
4634
4829
|
init_utils();
|
|
4635
4830
|
var Collapsible = CollapsiblePrimitive__namespace.Root;
|
|
4636
|
-
var CollapsibleItem =
|
|
4831
|
+
var CollapsibleItem = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4637
4832
|
"div",
|
|
4638
4833
|
{
|
|
4639
4834
|
ref,
|
|
@@ -4645,7 +4840,7 @@ var CollapsibleItem = React50__namespace.forwardRef(({ className, ...props }, re
|
|
|
4645
4840
|
}
|
|
4646
4841
|
));
|
|
4647
4842
|
CollapsibleItem.displayName = "CollapsibleItem";
|
|
4648
|
-
var CollapsibleTrigger =
|
|
4843
|
+
var CollapsibleTrigger = React52__namespace.forwardRef(({ className, children, indicator, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4649
4844
|
CollapsiblePrimitive__namespace.Trigger,
|
|
4650
4845
|
{
|
|
4651
4846
|
ref,
|
|
@@ -4671,7 +4866,7 @@ var CollapsibleTrigger = React50__namespace.forwardRef(({ className, children, i
|
|
|
4671
4866
|
}
|
|
4672
4867
|
));
|
|
4673
4868
|
CollapsibleTrigger.displayName = CollapsiblePrimitive__namespace.Trigger.displayName;
|
|
4674
|
-
var CollapsibleContent =
|
|
4869
|
+
var CollapsibleContent = React52__namespace.forwardRef(({ className, contentClassName, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4675
4870
|
CollapsiblePrimitive__namespace.Content,
|
|
4676
4871
|
{
|
|
4677
4872
|
ref,
|
|
@@ -4722,7 +4917,7 @@ var ResizableHandle = ({
|
|
|
4722
4917
|
|
|
4723
4918
|
// src/components/ui/scroll-area/index.tsx
|
|
4724
4919
|
init_utils();
|
|
4725
|
-
var ScrollArea =
|
|
4920
|
+
var ScrollArea = React52__namespace.forwardRef(
|
|
4726
4921
|
({
|
|
4727
4922
|
className,
|
|
4728
4923
|
children,
|
|
@@ -4777,7 +4972,7 @@ var ScrollArea = React50__namespace.forwardRef(
|
|
|
4777
4972
|
}
|
|
4778
4973
|
);
|
|
4779
4974
|
ScrollArea.displayName = ScrollAreaPrimitive__namespace.Root.displayName;
|
|
4780
|
-
var ScrollBar =
|
|
4975
|
+
var ScrollBar = React52__namespace.forwardRef(({ className, orientation = "vertical", thumbClassName, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4781
4976
|
ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
|
|
4782
4977
|
{
|
|
4783
4978
|
ref,
|
|
@@ -4809,9 +5004,9 @@ var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
|
4809
5004
|
var SIDEBAR_WIDTH = "16rem";
|
|
4810
5005
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
4811
5006
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
4812
|
-
var SidebarContext =
|
|
5007
|
+
var SidebarContext = React52__namespace.createContext(null);
|
|
4813
5008
|
function useSidebar() {
|
|
4814
|
-
const context =
|
|
5009
|
+
const context = React52__namespace.useContext(SidebarContext);
|
|
4815
5010
|
if (!context) {
|
|
4816
5011
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
4817
5012
|
}
|
|
@@ -4826,9 +5021,9 @@ function SidebarProvider({
|
|
|
4826
5021
|
children,
|
|
4827
5022
|
...props
|
|
4828
5023
|
}) {
|
|
4829
|
-
const [_open, _setOpen] =
|
|
5024
|
+
const [_open, _setOpen] = React52__namespace.useState(defaultOpen);
|
|
4830
5025
|
const open = openProp ?? _open;
|
|
4831
|
-
const setOpen =
|
|
5026
|
+
const setOpen = React52__namespace.useCallback(
|
|
4832
5027
|
(value) => {
|
|
4833
5028
|
const openState = typeof value === "function" ? value(open) : value;
|
|
4834
5029
|
if (setOpenProp) {
|
|
@@ -4840,10 +5035,10 @@ function SidebarProvider({
|
|
|
4840
5035
|
},
|
|
4841
5036
|
[setOpenProp, open]
|
|
4842
5037
|
);
|
|
4843
|
-
const toggleSidebar =
|
|
5038
|
+
const toggleSidebar = React52__namespace.useCallback(() => {
|
|
4844
5039
|
return setOpen((open2) => !open2);
|
|
4845
5040
|
}, [setOpen]);
|
|
4846
|
-
|
|
5041
|
+
React52__namespace.useEffect(() => {
|
|
4847
5042
|
const handleKeyDown = (event) => {
|
|
4848
5043
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
4849
5044
|
event.preventDefault();
|
|
@@ -4854,7 +5049,7 @@ function SidebarProvider({
|
|
|
4854
5049
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
4855
5050
|
}, [toggleSidebar]);
|
|
4856
5051
|
const state = open ? "expanded" : "collapsed";
|
|
4857
|
-
const contextValue =
|
|
5052
|
+
const contextValue = React52__namespace.useMemo(
|
|
4858
5053
|
() => ({
|
|
4859
5054
|
state,
|
|
4860
5055
|
open,
|
|
@@ -4889,7 +5084,25 @@ function Sidebar({
|
|
|
4889
5084
|
children,
|
|
4890
5085
|
...props
|
|
4891
5086
|
}) {
|
|
4892
|
-
const { state } = useSidebar();
|
|
5087
|
+
const { state, open, setOpen } = useSidebar();
|
|
5088
|
+
const isMobile = useIsMobile();
|
|
5089
|
+
if (isMobile) {
|
|
5090
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Sheet, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5091
|
+
SheetContent,
|
|
5092
|
+
{
|
|
5093
|
+
side,
|
|
5094
|
+
className: cn(
|
|
5095
|
+
"w-[280px] max-w-[80vw] p-0",
|
|
5096
|
+
"pt-[var(--mvn-safe-area-top)]",
|
|
5097
|
+
className
|
|
5098
|
+
),
|
|
5099
|
+
hideClose: true,
|
|
5100
|
+
"data-slot": "sidebar",
|
|
5101
|
+
"data-mobile": "true",
|
|
5102
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-sidebar text-sidebar-foreground flex h-full w-full flex-col", children })
|
|
5103
|
+
}
|
|
5104
|
+
) });
|
|
5105
|
+
}
|
|
4893
5106
|
if (collapsible === "none") {
|
|
4894
5107
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4895
5108
|
"div",
|
|
@@ -5320,7 +5533,7 @@ function SidebarMenuSkeleton({
|
|
|
5320
5533
|
showIcon = false,
|
|
5321
5534
|
...props
|
|
5322
5535
|
}) {
|
|
5323
|
-
const width =
|
|
5536
|
+
const width = React52__namespace.useMemo(() => {
|
|
5324
5537
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
5325
5538
|
}, []);
|
|
5326
5539
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -5413,6 +5626,166 @@ function SidebarMenuSubButton({
|
|
|
5413
5626
|
);
|
|
5414
5627
|
}
|
|
5415
5628
|
|
|
5629
|
+
// src/components/ui/mobile-header/index.tsx
|
|
5630
|
+
init_utils();
|
|
5631
|
+
function MobileHeader({
|
|
5632
|
+
logo,
|
|
5633
|
+
title,
|
|
5634
|
+
rightActions,
|
|
5635
|
+
showSidebarTrigger = true,
|
|
5636
|
+
stickyTop = true,
|
|
5637
|
+
className,
|
|
5638
|
+
...props
|
|
5639
|
+
}) {
|
|
5640
|
+
const sidebar = useSidebar();
|
|
5641
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5642
|
+
"header",
|
|
5643
|
+
{
|
|
5644
|
+
"data-slot": "mobile-header",
|
|
5645
|
+
className: cn(
|
|
5646
|
+
"flex items-center h-14 bg-background border-b border-border px-4 gap-3 md:hidden",
|
|
5647
|
+
"pt-[var(--mvn-safe-area-top)]",
|
|
5648
|
+
stickyTop && "sticky top-0 z-40",
|
|
5649
|
+
className
|
|
5650
|
+
),
|
|
5651
|
+
...props,
|
|
5652
|
+
children: [
|
|
5653
|
+
showSidebarTrigger && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5654
|
+
Button,
|
|
5655
|
+
{
|
|
5656
|
+
variant: "ghost",
|
|
5657
|
+
size: "icon",
|
|
5658
|
+
className: "-ml-2",
|
|
5659
|
+
onClick: () => sidebar.setOpen(true),
|
|
5660
|
+
"aria-label": "Open menu",
|
|
5661
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MenuIcon, { className: "h-5 w-5" })
|
|
5662
|
+
}
|
|
5663
|
+
),
|
|
5664
|
+
logo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: logo }),
|
|
5665
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold truncate flex-1 text-foreground", children: title }),
|
|
5666
|
+
rightActions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 shrink-0", children: rightActions })
|
|
5667
|
+
]
|
|
5668
|
+
}
|
|
5669
|
+
);
|
|
5670
|
+
}
|
|
5671
|
+
MobileHeader.displayName = "MobileHeader";
|
|
5672
|
+
|
|
5673
|
+
// src/components/ui/bottom-navigation/index.tsx
|
|
5674
|
+
init_utils();
|
|
5675
|
+
function BottomNavigation({
|
|
5676
|
+
items,
|
|
5677
|
+
activeKey,
|
|
5678
|
+
onActiveChange,
|
|
5679
|
+
hideOnDesktop = true,
|
|
5680
|
+
className,
|
|
5681
|
+
...props
|
|
5682
|
+
}) {
|
|
5683
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5684
|
+
"nav",
|
|
5685
|
+
{
|
|
5686
|
+
"data-slot": "bottom-navigation",
|
|
5687
|
+
className: cn(
|
|
5688
|
+
"fixed bottom-0 left-0 right-0 bg-background border-t border-border",
|
|
5689
|
+
"flex justify-around items-center h-16",
|
|
5690
|
+
"pb-[var(--mvn-safe-area-bottom)]",
|
|
5691
|
+
"z-40",
|
|
5692
|
+
hideOnDesktop && "md:hidden",
|
|
5693
|
+
className
|
|
5694
|
+
),
|
|
5695
|
+
...props,
|
|
5696
|
+
children: items.map((item) => {
|
|
5697
|
+
const isActive = activeKey === item.key;
|
|
5698
|
+
const Component = item.href ? "a" : "button";
|
|
5699
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5700
|
+
Component,
|
|
5701
|
+
{
|
|
5702
|
+
href: item.href,
|
|
5703
|
+
onClick: () => {
|
|
5704
|
+
if (!item.disabled) {
|
|
5705
|
+
item.onClick?.();
|
|
5706
|
+
onActiveChange?.(item.key);
|
|
5707
|
+
}
|
|
5708
|
+
},
|
|
5709
|
+
disabled: item.disabled,
|
|
5710
|
+
className: cn(
|
|
5711
|
+
"flex flex-col items-center justify-center gap-1 flex-1 h-full relative",
|
|
5712
|
+
"text-muted-foreground transition-colors",
|
|
5713
|
+
"min-w-[64px] min-h-[48px]",
|
|
5714
|
+
"hover:text-foreground focus:outline-none focus-visible:text-foreground",
|
|
5715
|
+
isActive && "text-primary",
|
|
5716
|
+
item.disabled && "opacity-50 pointer-events-none"
|
|
5717
|
+
),
|
|
5718
|
+
"aria-current": isActive ? "page" : void 0,
|
|
5719
|
+
children: [
|
|
5720
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative", children: [
|
|
5721
|
+
item.icon,
|
|
5722
|
+
item.badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5723
|
+
"span",
|
|
5724
|
+
{
|
|
5725
|
+
className: cn(
|
|
5726
|
+
"absolute -top-1 -right-2 min-w-[18px] h-[18px]",
|
|
5727
|
+
"bg-destructive text-destructive-foreground",
|
|
5728
|
+
"rounded-full text-[10px] font-medium",
|
|
5729
|
+
"flex items-center justify-center px-1"
|
|
5730
|
+
),
|
|
5731
|
+
children: typeof item.badge === "number" && item.badge > 99 ? "99+" : item.badge
|
|
5732
|
+
}
|
|
5733
|
+
)
|
|
5734
|
+
] }),
|
|
5735
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-medium leading-tight", children: item.label })
|
|
5736
|
+
]
|
|
5737
|
+
},
|
|
5738
|
+
item.key
|
|
5739
|
+
);
|
|
5740
|
+
})
|
|
5741
|
+
}
|
|
5742
|
+
);
|
|
5743
|
+
}
|
|
5744
|
+
BottomNavigation.displayName = "BottomNavigation";
|
|
5745
|
+
var MobileNavContext = React52__namespace.createContext(
|
|
5746
|
+
null
|
|
5747
|
+
);
|
|
5748
|
+
function useMobileNav() {
|
|
5749
|
+
const context = React52__namespace.useContext(MobileNavContext);
|
|
5750
|
+
if (!context) {
|
|
5751
|
+
throw new Error(
|
|
5752
|
+
"useMobileNav must be used within MobileNavigationProvider"
|
|
5753
|
+
);
|
|
5754
|
+
}
|
|
5755
|
+
return context;
|
|
5756
|
+
}
|
|
5757
|
+
function MobileNavigationProvider({
|
|
5758
|
+
children,
|
|
5759
|
+
hideBottomNavOnScroll = false
|
|
5760
|
+
}) {
|
|
5761
|
+
const [bottomNavVisible, setBottomNavVisible] = React52__namespace.useState(true);
|
|
5762
|
+
const lastScrollY = React52__namespace.useRef(0);
|
|
5763
|
+
React52__namespace.useEffect(() => {
|
|
5764
|
+
if (!hideBottomNavOnScroll) return;
|
|
5765
|
+
const handleScroll = () => {
|
|
5766
|
+
const currentY = window.scrollY;
|
|
5767
|
+
const direction = currentY > lastScrollY.current ? "down" : "up";
|
|
5768
|
+
if (direction === "down" && currentY > 50) {
|
|
5769
|
+
setBottomNavVisible(false);
|
|
5770
|
+
} else if (direction === "up") {
|
|
5771
|
+
setBottomNavVisible(true);
|
|
5772
|
+
}
|
|
5773
|
+
lastScrollY.current = currentY;
|
|
5774
|
+
};
|
|
5775
|
+
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
5776
|
+
return () => window.removeEventListener("scroll", handleScroll);
|
|
5777
|
+
}, [hideBottomNavOnScroll]);
|
|
5778
|
+
const value = React52__namespace.useMemo(
|
|
5779
|
+
() => ({
|
|
5780
|
+
bottomNavVisible,
|
|
5781
|
+
setBottomNavVisible
|
|
5782
|
+
}),
|
|
5783
|
+
[bottomNavVisible]
|
|
5784
|
+
);
|
|
5785
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MobileNavContext.Provider, { value, children });
|
|
5786
|
+
}
|
|
5787
|
+
MobileNavigationProvider.displayName = "MobileNavigationProvider";
|
|
5788
|
+
|
|
5416
5789
|
// src/components/ui/table/index.tsx
|
|
5417
5790
|
init_utils();
|
|
5418
5791
|
|
|
@@ -5439,7 +5812,7 @@ var tableVariants = classVarianceAuthority.cva("w-full caption-bottom text-sm",
|
|
|
5439
5812
|
size: "default"
|
|
5440
5813
|
}
|
|
5441
5814
|
});
|
|
5442
|
-
var Table =
|
|
5815
|
+
var Table = React52__namespace.forwardRef(({ className, variant, size, wrapperClassName, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative w-full overflow-auto", wrapperClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5443
5816
|
"table",
|
|
5444
5817
|
{
|
|
5445
5818
|
ref,
|
|
@@ -5448,9 +5821,9 @@ var Table = React50__namespace.forwardRef(({ className, variant, size, wrapperCl
|
|
|
5448
5821
|
}
|
|
5449
5822
|
) }));
|
|
5450
5823
|
Table.displayName = "Table";
|
|
5451
|
-
var TableHeader =
|
|
5824
|
+
var TableHeader = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
5452
5825
|
TableHeader.displayName = "TableHeader";
|
|
5453
|
-
var TableBody =
|
|
5826
|
+
var TableBody = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5454
5827
|
"tbody",
|
|
5455
5828
|
{
|
|
5456
5829
|
ref,
|
|
@@ -5459,7 +5832,7 @@ var TableBody = React50__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
5459
5832
|
}
|
|
5460
5833
|
));
|
|
5461
5834
|
TableBody.displayName = "TableBody";
|
|
5462
|
-
var TableFooter =
|
|
5835
|
+
var TableFooter = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5463
5836
|
"tfoot",
|
|
5464
5837
|
{
|
|
5465
5838
|
ref,
|
|
@@ -5471,7 +5844,7 @@ var TableFooter = React50__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
5471
5844
|
}
|
|
5472
5845
|
));
|
|
5473
5846
|
TableFooter.displayName = "TableFooter";
|
|
5474
|
-
var TableRow =
|
|
5847
|
+
var TableRow = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5475
5848
|
"tr",
|
|
5476
5849
|
{
|
|
5477
5850
|
ref,
|
|
@@ -5483,7 +5856,7 @@ var TableRow = React50__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
5483
5856
|
}
|
|
5484
5857
|
));
|
|
5485
5858
|
TableRow.displayName = "TableRow";
|
|
5486
|
-
var TableHead =
|
|
5859
|
+
var TableHead = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5487
5860
|
"th",
|
|
5488
5861
|
{
|
|
5489
5862
|
ref,
|
|
@@ -5495,7 +5868,7 @@ var TableHead = React50__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
5495
5868
|
}
|
|
5496
5869
|
));
|
|
5497
5870
|
TableHead.displayName = "TableHead";
|
|
5498
|
-
var TableCell =
|
|
5871
|
+
var TableCell = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5499
5872
|
"td",
|
|
5500
5873
|
{
|
|
5501
5874
|
ref,
|
|
@@ -5507,7 +5880,7 @@ var TableCell = React50__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
5507
5880
|
}
|
|
5508
5881
|
));
|
|
5509
5882
|
TableCell.displayName = "TableCell";
|
|
5510
|
-
var TableCaption =
|
|
5883
|
+
var TableCaption = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5511
5884
|
"caption",
|
|
5512
5885
|
{
|
|
5513
5886
|
ref,
|
|
@@ -5554,9 +5927,10 @@ var TableBodyComponent = ({
|
|
|
5554
5927
|
onRowClick,
|
|
5555
5928
|
getRowExpandable,
|
|
5556
5929
|
invalidateCache,
|
|
5557
|
-
headers
|
|
5930
|
+
headers,
|
|
5931
|
+
hasInitializedSizing
|
|
5558
5932
|
}) => {
|
|
5559
|
-
const resolveRowClassName =
|
|
5933
|
+
const resolveRowClassName = React52.useCallback(
|
|
5560
5934
|
(record, index) => {
|
|
5561
5935
|
if (!rowClassName) return "";
|
|
5562
5936
|
return typeof rowClassName === "function" ? rowClassName(record, index) : rowClassName;
|
|
@@ -5595,13 +5969,11 @@ var TableBodyComponent = ({
|
|
|
5595
5969
|
}
|
|
5596
5970
|
return reactTable.flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
5597
5971
|
};
|
|
5598
|
-
const { leftOffsets, rightOffsets
|
|
5972
|
+
const { leftOffsets, rightOffsets } = React52.useMemo(() => {
|
|
5599
5973
|
if (!headers || headers.length === 0) {
|
|
5600
5974
|
return {
|
|
5601
5975
|
leftOffsets: /* @__PURE__ */ new Map(),
|
|
5602
|
-
rightOffsets: /* @__PURE__ */ new Map()
|
|
5603
|
-
lastLeftId: null,
|
|
5604
|
-
firstRightId: null
|
|
5976
|
+
rightOffsets: /* @__PURE__ */ new Map()
|
|
5605
5977
|
};
|
|
5606
5978
|
}
|
|
5607
5979
|
const leftPinned = headers.filter(
|
|
@@ -5625,12 +5997,10 @@ var TableBodyComponent = ({
|
|
|
5625
5997
|
}
|
|
5626
5998
|
return {
|
|
5627
5999
|
leftOffsets: leftMap,
|
|
5628
|
-
rightOffsets: rightMap
|
|
5629
|
-
lastLeftId: leftPinned.length > 0 ? leftPinned[leftPinned.length - 1].column.id : null,
|
|
5630
|
-
firstRightId: rightPinned.length > 0 ? rightPinned[0].column.id : null
|
|
6000
|
+
rightOffsets: rightMap
|
|
5631
6001
|
};
|
|
5632
6002
|
}, [headers]);
|
|
5633
|
-
const renderBaseRow =
|
|
6003
|
+
const renderBaseRow = React52.useCallback(
|
|
5634
6004
|
(rowData, options = {}) => {
|
|
5635
6005
|
const { ref, virtualIndex } = options;
|
|
5636
6006
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5652,24 +6022,31 @@ var TableBodyComponent = ({
|
|
|
5652
6022
|
children: rowData.getVisibleCells().map((cell) => {
|
|
5653
6023
|
const meta = cell.column.columnDef.meta;
|
|
5654
6024
|
const pinPosition = cell.column.getIsPinned();
|
|
5655
|
-
const
|
|
6025
|
+
const cellStyle = {};
|
|
6026
|
+
if (hasInitializedSizing) {
|
|
6027
|
+
const fallbackWidth = cell.column.getSize();
|
|
6028
|
+
cellStyle.width = `var(--mvn-col-${cell.column.id}-width, ${fallbackWidth}px)`;
|
|
6029
|
+
cellStyle.maxWidth = `var(--mvn-col-${cell.column.id}-width, ${fallbackWidth}px)`;
|
|
6030
|
+
cellStyle.overflow = "hidden";
|
|
6031
|
+
cellStyle.textOverflow = "ellipsis";
|
|
6032
|
+
cellStyle.whiteSpace = "nowrap";
|
|
6033
|
+
}
|
|
5656
6034
|
if (pinPosition === "left") {
|
|
5657
6035
|
const offset = leftOffsets.get(cell.column.id);
|
|
5658
6036
|
if (offset !== void 0) {
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
6037
|
+
cellStyle.position = "sticky";
|
|
6038
|
+
cellStyle.left = `var(--mvn-col-${cell.column.id}-left, ${offset}px)`;
|
|
6039
|
+
cellStyle.zIndex = 5;
|
|
5662
6040
|
}
|
|
5663
6041
|
} else if (pinPosition === "right") {
|
|
5664
6042
|
const offset = rightOffsets.get(cell.column.id);
|
|
5665
6043
|
if (offset !== void 0) {
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
6044
|
+
cellStyle.position = "sticky";
|
|
6045
|
+
cellStyle.right = `var(--mvn-col-${cell.column.id}-right, ${offset}px)`;
|
|
6046
|
+
cellStyle.zIndex = 5;
|
|
5669
6047
|
}
|
|
5670
6048
|
}
|
|
5671
|
-
const
|
|
5672
|
-
const isFirstRightPinned = cell.column.id === firstRightId;
|
|
6049
|
+
const hasStyles = Object.keys(cellStyle).length > 0;
|
|
5673
6050
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5674
6051
|
TableCell,
|
|
5675
6052
|
{
|
|
@@ -5679,11 +6056,9 @@ var TableBodyComponent = ({
|
|
|
5679
6056
|
meta?.align === "right" && "text-right",
|
|
5680
6057
|
meta?.align === "left" && "text-left",
|
|
5681
6058
|
// Pinned cell styling
|
|
5682
|
-
pinPosition && "bg-background"
|
|
5683
|
-
isLastLeftPinned && "after:absolute after:right-0 after:top-0 after:bottom-0 after:w-[4px] after:bg-gradient-to-r after:from-black/10 after:to-transparent",
|
|
5684
|
-
isFirstRightPinned && "before:absolute before:left-0 before:top-0 before:bottom-0 before:w-[4px] before:bg-gradient-to-l before:from-black/10 before:to-transparent"
|
|
6059
|
+
pinPosition && "bg-background"
|
|
5685
6060
|
),
|
|
5686
|
-
style:
|
|
6061
|
+
style: hasStyles ? cellStyle : void 0,
|
|
5687
6062
|
children: onRenderedRow(cell, virtualIndex)
|
|
5688
6063
|
},
|
|
5689
6064
|
cell.id
|
|
@@ -5698,11 +6073,10 @@ var TableBodyComponent = ({
|
|
|
5698
6073
|
resolveRowClassName,
|
|
5699
6074
|
leftOffsets,
|
|
5700
6075
|
rightOffsets,
|
|
5701
|
-
|
|
5702
|
-
firstRightId
|
|
6076
|
+
hasInitializedSizing
|
|
5703
6077
|
]
|
|
5704
6078
|
);
|
|
5705
|
-
const renderExpandedRow =
|
|
6079
|
+
const renderExpandedRow = React52.useCallback(
|
|
5706
6080
|
(rowData, options = {}) => {
|
|
5707
6081
|
if (!renderExpandedContent) return null;
|
|
5708
6082
|
const { ref, virtualIndex } = options;
|
|
@@ -5783,15 +6157,152 @@ var TableBodyComponent = ({
|
|
|
5783
6157
|
) })
|
|
5784
6158
|
] });
|
|
5785
6159
|
}
|
|
5786
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: rows.map((row) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6160
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: rows.map((row) => /* @__PURE__ */ jsxRuntime.jsxs(React52.Fragment, { children: [
|
|
5787
6161
|
renderBaseRow(row),
|
|
5788
6162
|
expandable && renderExpandedRow(row)
|
|
5789
6163
|
] }, row.id)) });
|
|
5790
6164
|
};
|
|
5791
6165
|
|
|
6166
|
+
// src/components/ui/table/components/TableCardView.tsx
|
|
6167
|
+
init_utils();
|
|
6168
|
+
var CARD_BASE_CLASSES = "border border-border rounded-lg bg-card overflow-hidden transition-shadow hover:shadow-md";
|
|
6169
|
+
function renderCellValue(col, value, record, index) {
|
|
6170
|
+
if (col.mobileRender) return col.mobileRender(value, record, index);
|
|
6171
|
+
if (col.render) return col.render(value, record, index);
|
|
6172
|
+
return String(value ?? "");
|
|
6173
|
+
}
|
|
6174
|
+
function TableCardView({
|
|
6175
|
+
rows,
|
|
6176
|
+
columns,
|
|
6177
|
+
selectable,
|
|
6178
|
+
expandable,
|
|
6179
|
+
onRowClick,
|
|
6180
|
+
rowClassName,
|
|
6181
|
+
renderExpandedContent,
|
|
6182
|
+
mobileCardActions,
|
|
6183
|
+
emptyMessage = "No data",
|
|
6184
|
+
renderMobileCard
|
|
6185
|
+
}) {
|
|
6186
|
+
if (rows.length === 0) {
|
|
6187
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center py-12 text-muted-foreground", children: emptyMessage });
|
|
6188
|
+
}
|
|
6189
|
+
const mobileColumns = React52__namespace.useMemo(() => {
|
|
6190
|
+
return columns.filter((col) => !col.mobileHidden && (col.mobileVisible ?? true)).sort((a, b) => (a.mobilePriority ?? 99) - (b.mobilePriority ?? 99)).slice(0, 6);
|
|
6191
|
+
}, [columns]);
|
|
6192
|
+
const headerColumn = mobileColumns[0];
|
|
6193
|
+
const bodyColumns = mobileColumns.slice(1);
|
|
6194
|
+
const hasCardContent = bodyColumns.length > 0 || mobileCardActions;
|
|
6195
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: rows.map((row) => {
|
|
6196
|
+
const record = row.original;
|
|
6197
|
+
const isSelected = row.getIsSelected();
|
|
6198
|
+
const isExpanded = row.getIsExpanded();
|
|
6199
|
+
const rowClasses = typeof rowClassName === "function" ? rowClassName(record, row.index) : rowClassName;
|
|
6200
|
+
const cardClassName = cn(
|
|
6201
|
+
CARD_BASE_CLASSES,
|
|
6202
|
+
isSelected && "ring-2 ring-primary",
|
|
6203
|
+
rowClasses
|
|
6204
|
+
);
|
|
6205
|
+
if (renderMobileCard) {
|
|
6206
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cardClassName, children: renderMobileCard(record, columns) }, row.id);
|
|
6207
|
+
}
|
|
6208
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cardClassName, children: [
|
|
6209
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6210
|
+
"div",
|
|
6211
|
+
{
|
|
6212
|
+
className: cn(
|
|
6213
|
+
"flex items-center gap-3 p-4",
|
|
6214
|
+
hasCardContent && "border-b border-border",
|
|
6215
|
+
onRowClick && "cursor-pointer"
|
|
6216
|
+
),
|
|
6217
|
+
onClick: () => onRowClick?.(record, row.index),
|
|
6218
|
+
onKeyDown: onRowClick ? (e) => {
|
|
6219
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
6220
|
+
e.preventDefault();
|
|
6221
|
+
onRowClick(record, row.index);
|
|
6222
|
+
}
|
|
6223
|
+
} : void 0,
|
|
6224
|
+
role: onRowClick ? "button" : void 0,
|
|
6225
|
+
tabIndex: onRowClick ? 0 : void 0,
|
|
6226
|
+
children: [
|
|
6227
|
+
selectable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6228
|
+
Checkbox,
|
|
6229
|
+
{
|
|
6230
|
+
checked: isSelected,
|
|
6231
|
+
onCheckedChange: (checked) => row.toggleSelected(!!checked),
|
|
6232
|
+
onClick: (e) => e.stopPropagation(),
|
|
6233
|
+
"aria-label": "Select row"
|
|
6234
|
+
}
|
|
6235
|
+
),
|
|
6236
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 font-medium text-foreground truncate", children: headerColumn && renderCellValue(
|
|
6237
|
+
headerColumn,
|
|
6238
|
+
row.getValue(headerColumn.key),
|
|
6239
|
+
record,
|
|
6240
|
+
row.index
|
|
6241
|
+
) }),
|
|
6242
|
+
expandable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6243
|
+
"button",
|
|
6244
|
+
{
|
|
6245
|
+
onClick: (e) => {
|
|
6246
|
+
e.stopPropagation();
|
|
6247
|
+
row.toggleExpanded();
|
|
6248
|
+
},
|
|
6249
|
+
className: "p-1 text-muted-foreground hover:text-foreground transition-colors",
|
|
6250
|
+
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
6251
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6252
|
+
lucideReact.ChevronDownIcon,
|
|
6253
|
+
{
|
|
6254
|
+
className: cn(
|
|
6255
|
+
"h-5 w-5 transition-transform",
|
|
6256
|
+
isExpanded && "rotate-180"
|
|
6257
|
+
)
|
|
6258
|
+
}
|
|
6259
|
+
)
|
|
6260
|
+
}
|
|
6261
|
+
)
|
|
6262
|
+
]
|
|
6263
|
+
}
|
|
6264
|
+
),
|
|
6265
|
+
bodyColumns.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 space-y-2", children: bodyColumns.map((col) => {
|
|
6266
|
+
const isFullWidth = col.mobileWidth === "full";
|
|
6267
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6268
|
+
"div",
|
|
6269
|
+
{
|
|
6270
|
+
className: cn(
|
|
6271
|
+
"flex justify-between items-start gap-2",
|
|
6272
|
+
isFullWidth && "flex-col"
|
|
6273
|
+
),
|
|
6274
|
+
children: [
|
|
6275
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground shrink-0", children: col.mobileLabel ?? col.title }),
|
|
6276
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6277
|
+
"span",
|
|
6278
|
+
{
|
|
6279
|
+
className: cn(
|
|
6280
|
+
"text-sm text-foreground text-right",
|
|
6281
|
+
isFullWidth && "text-left w-full"
|
|
6282
|
+
),
|
|
6283
|
+
children: renderCellValue(
|
|
6284
|
+
col,
|
|
6285
|
+
row.getValue(col.key),
|
|
6286
|
+
record,
|
|
6287
|
+
row.index
|
|
6288
|
+
)
|
|
6289
|
+
}
|
|
6290
|
+
)
|
|
6291
|
+
]
|
|
6292
|
+
},
|
|
6293
|
+
col.key
|
|
6294
|
+
);
|
|
6295
|
+
}) }),
|
|
6296
|
+
mobileCardActions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 p-4 pt-0 border-t border-border mt-2", children: mobileCardActions(record) }),
|
|
6297
|
+
expandable && isExpanded && renderExpandedContent && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-t border-border bg-muted/50", children: renderExpandedContent(record, row) })
|
|
6298
|
+
] }, row.id);
|
|
6299
|
+
}) });
|
|
6300
|
+
}
|
|
6301
|
+
TableCardView.displayName = "TableCardView";
|
|
6302
|
+
|
|
5792
6303
|
// src/components/ui/table/components/TableHeaderComponent.tsx
|
|
5793
6304
|
init_utils();
|
|
5794
|
-
var
|
|
6305
|
+
var TABLE_FILTER_OPTIONS = [
|
|
5795
6306
|
{ value: "includesString", label: "Contains" },
|
|
5796
6307
|
{ value: "notContains", label: "Does not contain" },
|
|
5797
6308
|
{ value: "equals", label: "Equals" },
|
|
@@ -5799,18 +6310,10 @@ var TableFilterOptions = [
|
|
|
5799
6310
|
{ value: "startsWith", label: "Starts with" },
|
|
5800
6311
|
{ value: "endsWith", label: "Ends with" }
|
|
5801
6312
|
];
|
|
5802
|
-
var
|
|
6313
|
+
var PIN_OPTIONS = [
|
|
5803
6314
|
{ value: "left", label: "Pin Left" },
|
|
5804
6315
|
{ value: "right", label: "Pin Right" }
|
|
5805
6316
|
];
|
|
5806
|
-
var sizingOptions = [
|
|
5807
|
-
{ value: "reset-single", label: "Reset This Column" },
|
|
5808
|
-
{ value: "reset-all", label: "Reset All Columns" }
|
|
5809
|
-
];
|
|
5810
|
-
var sortOptions = [
|
|
5811
|
-
{ value: "asc", label: "Sort Ascending" },
|
|
5812
|
-
{ value: "desc", label: "Sort Descending" }
|
|
5813
|
-
];
|
|
5814
6317
|
var TableHeaderComponent = ({
|
|
5815
6318
|
header,
|
|
5816
6319
|
enableColumnOrdering,
|
|
@@ -5819,8 +6322,8 @@ var TableHeaderComponent = ({
|
|
|
5819
6322
|
draggedColumnId,
|
|
5820
6323
|
pinnedLeftOffset,
|
|
5821
6324
|
pinnedRightOffset,
|
|
5822
|
-
|
|
5823
|
-
|
|
6325
|
+
hasInitializedSizing,
|
|
6326
|
+
startResize
|
|
5824
6327
|
}) => {
|
|
5825
6328
|
const column = header.column;
|
|
5826
6329
|
const meta = column.columnDef.meta;
|
|
@@ -5830,47 +6333,27 @@ var TableHeaderComponent = ({
|
|
|
5830
6333
|
};
|
|
5831
6334
|
const pinPosition = column.getIsPinned();
|
|
5832
6335
|
const sortDirection = column.getIsSorted();
|
|
5833
|
-
const
|
|
5834
|
-
const
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
moveColumnTo(sourceId, targetId);
|
|
5839
|
-
};
|
|
5840
|
-
const moveColumnTo = (sourceId, targetId) => {
|
|
5841
|
-
if (!enableColumnOrdering || sourceId.startsWith("_mvn_") || targetId.startsWith("_mvn_"))
|
|
5842
|
-
return;
|
|
5843
|
-
setColumnOrder((previous) => {
|
|
5844
|
-
const order = previous.length ? [...previous] : [...baseColumnOrder];
|
|
5845
|
-
const sourceIndex = order.indexOf(sourceId);
|
|
5846
|
-
const targetIndex = order.indexOf(targetId);
|
|
5847
|
-
if (sourceIndex === -1 || targetIndex === -1 || sourceIndex === targetIndex)
|
|
5848
|
-
return order;
|
|
5849
|
-
const next = [...order];
|
|
5850
|
-
next.splice(sourceIndex, 1);
|
|
5851
|
-
next.splice(targetIndex, 0, sourceId);
|
|
5852
|
-
return next;
|
|
5853
|
-
});
|
|
5854
|
-
};
|
|
5855
|
-
const [inputValue, setInputValue] = React50.useState(value);
|
|
5856
|
-
const debounceTimeoutRef = React50.useRef(null);
|
|
5857
|
-
React50.useEffect(() => {
|
|
6336
|
+
const isMvnColumn = column.id.startsWith("_mvn_");
|
|
6337
|
+
const isReorderTable = enableColumnOrdering && !isMvnColumn;
|
|
6338
|
+
const [inputValue, setInputValue] = React52.useState(value);
|
|
6339
|
+
const debounceTimeoutRef = React52.useRef(null);
|
|
6340
|
+
React52.useEffect(() => {
|
|
5858
6341
|
setInputValue(value);
|
|
5859
6342
|
}, [value]);
|
|
5860
|
-
|
|
6343
|
+
React52.useEffect(() => {
|
|
5861
6344
|
return () => {
|
|
5862
6345
|
if (debounceTimeoutRef.current !== null) {
|
|
5863
6346
|
window.clearTimeout(debounceTimeoutRef.current);
|
|
5864
6347
|
}
|
|
5865
6348
|
};
|
|
5866
6349
|
}, []);
|
|
5867
|
-
const handleFilterChange =
|
|
6350
|
+
const handleFilterChange = React52.useCallback(
|
|
5868
6351
|
(type, nextValue) => {
|
|
5869
6352
|
column.setFilterValue({ filterType: type, value: nextValue });
|
|
5870
6353
|
},
|
|
5871
6354
|
[column]
|
|
5872
6355
|
);
|
|
5873
|
-
const debouncedFilterChange =
|
|
6356
|
+
const debouncedFilterChange = React52.useCallback(
|
|
5874
6357
|
(type, nextValue) => {
|
|
5875
6358
|
if (debounceTimeoutRef.current !== null) {
|
|
5876
6359
|
window.clearTimeout(debounceTimeoutRef.current);
|
|
@@ -5882,7 +6365,7 @@ var TableHeaderComponent = ({
|
|
|
5882
6365
|
},
|
|
5883
6366
|
[handleFilterChange]
|
|
5884
6367
|
);
|
|
5885
|
-
const handleInputChange =
|
|
6368
|
+
const handleInputChange = React52.useCallback(
|
|
5886
6369
|
(event) => {
|
|
5887
6370
|
const nextValue = event.target.value;
|
|
5888
6371
|
setInputValue(nextValue);
|
|
@@ -5890,33 +6373,96 @@ var TableHeaderComponent = ({
|
|
|
5890
6373
|
},
|
|
5891
6374
|
[debouncedFilterChange, filterType]
|
|
5892
6375
|
);
|
|
5893
|
-
const
|
|
5894
|
-
|
|
6376
|
+
const moveColumnTo = React52.useCallback(
|
|
6377
|
+
(sourceId, targetId) => {
|
|
6378
|
+
if (!enableColumnOrdering || sourceId.startsWith("_mvn_") || targetId.startsWith("_mvn_")) {
|
|
6379
|
+
return;
|
|
6380
|
+
}
|
|
6381
|
+
setColumnOrder((previous) => {
|
|
6382
|
+
const order = previous.length ? [...previous] : [...baseColumnOrder];
|
|
6383
|
+
const sourceIndex = order.indexOf(sourceId);
|
|
6384
|
+
const targetIndex = order.indexOf(targetId);
|
|
6385
|
+
if (sourceIndex === -1 || targetIndex === -1 || sourceIndex === targetIndex) {
|
|
6386
|
+
return order;
|
|
6387
|
+
}
|
|
6388
|
+
const next = [...order];
|
|
6389
|
+
next.splice(sourceIndex, 1);
|
|
6390
|
+
next.splice(targetIndex, 0, sourceId);
|
|
6391
|
+
return next;
|
|
6392
|
+
});
|
|
6393
|
+
},
|
|
6394
|
+
[baseColumnOrder, enableColumnOrdering, setColumnOrder]
|
|
6395
|
+
);
|
|
6396
|
+
const handleColumnDrop = React52.useCallback(
|
|
6397
|
+
(targetId) => {
|
|
6398
|
+
const sourceId = draggedColumnId.current;
|
|
6399
|
+
draggedColumnId.current = null;
|
|
6400
|
+
if (!sourceId || sourceId === targetId) return;
|
|
6401
|
+
moveColumnTo(sourceId, targetId);
|
|
6402
|
+
},
|
|
6403
|
+
[draggedColumnId, moveColumnTo]
|
|
6404
|
+
);
|
|
6405
|
+
const handleResizeStart = React52.useCallback(
|
|
6406
|
+
(event) => {
|
|
6407
|
+
event.stopPropagation();
|
|
6408
|
+
if (startResize) {
|
|
6409
|
+
const minSize = column.columnDef.minSize ?? 36;
|
|
6410
|
+
const maxSize = column.columnDef.maxSize ?? 9999;
|
|
6411
|
+
startResize(column.id, event, header.getSize(), minSize, maxSize);
|
|
6412
|
+
} else {
|
|
6413
|
+
header.getResizeHandler()(event);
|
|
6414
|
+
}
|
|
6415
|
+
},
|
|
6416
|
+
[
|
|
6417
|
+
column.columnDef.minSize,
|
|
6418
|
+
column.columnDef.maxSize,
|
|
6419
|
+
column.id,
|
|
6420
|
+
header,
|
|
6421
|
+
startResize
|
|
6422
|
+
]
|
|
6423
|
+
);
|
|
6424
|
+
const handleFilterTypeChange = React52.useCallback(
|
|
6425
|
+
(selected) => {
|
|
6426
|
+
if (debounceTimeoutRef.current !== null) {
|
|
6427
|
+
window.clearTimeout(debounceTimeoutRef.current);
|
|
6428
|
+
debounceTimeoutRef.current = null;
|
|
6429
|
+
}
|
|
6430
|
+
handleFilterChange(selected, inputValue);
|
|
6431
|
+
},
|
|
6432
|
+
[debounceTimeoutRef, handleFilterChange, inputValue]
|
|
6433
|
+
);
|
|
6434
|
+
const showPopover = column.getCanPin() || column.getCanFilter();
|
|
6435
|
+
const cellStyle = {};
|
|
6436
|
+
if (hasInitializedSizing) {
|
|
6437
|
+
const fallbackWidth = Math.max(header.getSize(), 36);
|
|
6438
|
+
cellStyle.width = `var(--mvn-col-${column.id}-width, ${fallbackWidth}px)`;
|
|
6439
|
+
cellStyle.overflow = "hidden";
|
|
6440
|
+
cellStyle.textOverflow = "ellipsis";
|
|
6441
|
+
cellStyle.whiteSpace = "nowrap";
|
|
6442
|
+
}
|
|
5895
6443
|
if (pinPosition === "left" && pinnedLeftOffset !== void 0) {
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
6444
|
+
cellStyle.position = "sticky";
|
|
6445
|
+
cellStyle.left = `var(--mvn-col-${column.id}-left, ${pinnedLeftOffset}px)`;
|
|
6446
|
+
cellStyle.zIndex = 20;
|
|
5899
6447
|
} else if (pinPosition === "right" && pinnedRightOffset !== void 0) {
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
6448
|
+
cellStyle.position = "sticky";
|
|
6449
|
+
cellStyle.right = `var(--mvn-col-${column.id}-right, ${pinnedRightOffset}px)`;
|
|
6450
|
+
cellStyle.zIndex = 20;
|
|
5903
6451
|
}
|
|
5904
6452
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5905
6453
|
TableHead,
|
|
5906
6454
|
{
|
|
5907
6455
|
className: cn(
|
|
6456
|
+
"group",
|
|
5908
6457
|
meta?.headerClassName,
|
|
5909
6458
|
meta?.align === "center" && "text-center",
|
|
5910
6459
|
meta?.align === "right" && "text-right",
|
|
5911
6460
|
meta?.align === "left" && "text-left",
|
|
5912
6461
|
column.getCanSort() && "select-none",
|
|
5913
6462
|
"bg-mvn-gray-100 text-foreground sticky top-0 z-10",
|
|
5914
|
-
|
|
5915
|
-
pinPosition && "bg-background",
|
|
5916
|
-
isLastLeftPinned && "after:absolute after:right-0 after:top-0 after:bottom-0 after:w-[4px] after:bg-gradient-to-r after:from-black/10 after:to-transparent",
|
|
5917
|
-
isFirstRightPinned && "before:absolute before:left-0 before:top-0 before:bottom-0 before:w-[4px] before:bg-gradient-to-l before:from-black/10 before:to-transparent"
|
|
6463
|
+
pinPosition && "bg-background"
|
|
5918
6464
|
),
|
|
5919
|
-
style:
|
|
6465
|
+
style: cellStyle,
|
|
5920
6466
|
children: [
|
|
5921
6467
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5922
6468
|
"div",
|
|
@@ -5925,8 +6471,7 @@ var TableHeaderComponent = ({
|
|
|
5925
6471
|
"flex items-center w-full",
|
|
5926
6472
|
meta?.align === "center" && "justify-center",
|
|
5927
6473
|
meta?.align === "right" && "justify-end",
|
|
5928
|
-
meta?.align === "left" && "justify-start"
|
|
5929
|
-
column.getCanSort() && "cursor-pointer"
|
|
6474
|
+
meta?.align === "left" && "justify-start"
|
|
5930
6475
|
),
|
|
5931
6476
|
draggable: isReorderTable,
|
|
5932
6477
|
onDragStart: (event) => {
|
|
@@ -5950,38 +6495,41 @@ var TableHeaderComponent = ({
|
|
|
5950
6495
|
handleColumnDrop(column.id);
|
|
5951
6496
|
},
|
|
5952
6497
|
children: [
|
|
5953
|
-
/* @__PURE__ */ jsxRuntime.
|
|
5954
|
-
|
|
6498
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6499
|
+
"div",
|
|
6500
|
+
{
|
|
6501
|
+
className: cn(
|
|
6502
|
+
"flex gap-2 text-[16px] font-medium items-center",
|
|
6503
|
+
column.getCanSort() && "cursor-pointer"
|
|
6504
|
+
),
|
|
6505
|
+
onClick: () => {
|
|
6506
|
+
if (draggedColumnId.current) return;
|
|
6507
|
+
if (column.getCanSort()) {
|
|
6508
|
+
column.toggleSorting();
|
|
6509
|
+
}
|
|
6510
|
+
},
|
|
6511
|
+
children: [
|
|
6512
|
+
reactTable.flexRender(column.columnDef.header, header.getContext()),
|
|
6513
|
+
sortDirection === "asc" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUp, { className: "h-4 w-4 text-primary flex-shrink-0" }),
|
|
6514
|
+
sortDirection === "desc" && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDown, { className: "h-4 w-4 text-primary flex-shrink-0" })
|
|
6515
|
+
]
|
|
6516
|
+
}
|
|
6517
|
+
),
|
|
6518
|
+
!isMvnColumn && showPopover && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5955
6519
|
"span",
|
|
5956
6520
|
{
|
|
5957
6521
|
onClick: (event) => event.stopPropagation(),
|
|
5958
6522
|
className: "ml-auto",
|
|
5959
6523
|
children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
|
|
5960
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.
|
|
5961
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { side: "bottom", children: /* @__PURE__ */ jsxRuntime.jsxs(Tabs, { defaultValue: "
|
|
6524
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "p-1 h-4 w-4 rounded-sm cursor-pointer hover:bg-muted transition-colors" }) }),
|
|
6525
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { side: "bottom", className: "pt-2", children: /* @__PURE__ */ jsxRuntime.jsxs(Tabs, { defaultValue: column.getCanPin() ? "pin" : "filter", children: [
|
|
5962
6526
|
/* @__PURE__ */ jsxRuntime.jsxs(TabsList, { children: [
|
|
5963
|
-
column.getCanResize() && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5964
|
-
TabsTrigger,
|
|
5965
|
-
{
|
|
5966
|
-
value: "size",
|
|
5967
|
-
className: "data-[orientation=horizontal]:p-2",
|
|
5968
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Scaling, { className: "p-1 h-6 w-6" })
|
|
5969
|
-
}
|
|
5970
|
-
),
|
|
5971
|
-
column.getCanSort() && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5972
|
-
TabsTrigger,
|
|
5973
|
-
{
|
|
5974
|
-
value: "sort",
|
|
5975
|
-
className: "data-[orientation=horizontal]:p-2",
|
|
5976
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Scaling, { className: "p-1 h-6 w-6" })
|
|
5977
|
-
}
|
|
5978
|
-
),
|
|
5979
6527
|
column.getCanPin() && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5980
6528
|
TabsTrigger,
|
|
5981
6529
|
{
|
|
5982
6530
|
value: "pin",
|
|
5983
6531
|
className: "data-[orientation=horizontal]:p-2",
|
|
5984
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pin, { className: "
|
|
6532
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pin, { className: "h-4 w-4" })
|
|
5985
6533
|
}
|
|
5986
6534
|
),
|
|
5987
6535
|
column.getCanFilter() && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5989,63 +6537,18 @@ var TableHeaderComponent = ({
|
|
|
5989
6537
|
{
|
|
5990
6538
|
value: "filter",
|
|
5991
6539
|
className: "data-[orientation=horizontal]:p-2",
|
|
5992
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListFilter, { className: "
|
|
6540
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListFilter, { className: "h-4 w-4" })
|
|
5993
6541
|
}
|
|
5994
6542
|
)
|
|
5995
6543
|
] }),
|
|
5996
|
-
column.
|
|
5997
|
-
CommandItem,
|
|
5998
|
-
{
|
|
5999
|
-
value: option.value,
|
|
6000
|
-
onSelect: () => {
|
|
6001
|
-
if (option.value === "reset-single") {
|
|
6002
|
-
column.resetSize();
|
|
6003
|
-
} else if (option.value === "reset-all") {
|
|
6004
|
-
header.getContext().table.resetColumnSizing();
|
|
6005
|
-
}
|
|
6006
|
-
},
|
|
6007
|
-
children: option.label
|
|
6008
|
-
},
|
|
6009
|
-
option.value
|
|
6010
|
-
)) }) }) }) }),
|
|
6011
|
-
column.getCanSort() && /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "sort", className: "mt-2", children: /* @__PURE__ */ jsxRuntime.jsx(Command, { className: "h-auto", children: /* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: sortOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6544
|
+
column.getCanPin() && /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "pin", className: "mt-4", children: /* @__PURE__ */ jsxRuntime.jsx(Command, { className: "h-auto", children: /* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: PIN_OPTIONS.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6012
6545
|
CommandItem,
|
|
6013
6546
|
{
|
|
6014
6547
|
value: option.value,
|
|
6015
6548
|
onSelect: () => {
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
}
|
|
6020
|
-
column.toggleSorting(option.value === "desc");
|
|
6021
|
-
},
|
|
6022
|
-
children: [
|
|
6023
|
-
option.label,
|
|
6024
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6025
|
-
lucideReact.CheckIcon,
|
|
6026
|
-
{
|
|
6027
|
-
className: cn(
|
|
6028
|
-
"ml-auto h-4 w-4",
|
|
6029
|
-
sortDirection === option.value ? "opacity-100" : "opacity-0"
|
|
6030
|
-
)
|
|
6031
|
-
}
|
|
6032
|
-
)
|
|
6033
|
-
]
|
|
6034
|
-
},
|
|
6035
|
-
option.value
|
|
6036
|
-
)) }) }) }) }),
|
|
6037
|
-
column.getCanPin() && /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: "pin", className: "mt-2", children: /* @__PURE__ */ jsxRuntime.jsx(Command, { className: "h-auto", children: /* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { children: pinOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6038
|
-
CommandItem,
|
|
6039
|
-
{
|
|
6040
|
-
value: option.value,
|
|
6041
|
-
onSelect: () => {
|
|
6042
|
-
if (option.value === pinPosition) {
|
|
6043
|
-
column.pin(false);
|
|
6044
|
-
return;
|
|
6045
|
-
}
|
|
6046
|
-
if (option.value === "left" || option.value === "right") {
|
|
6047
|
-
column.pin(option.value);
|
|
6048
|
-
}
|
|
6549
|
+
column.pin(
|
|
6550
|
+
option.value === pinPosition ? false : option.value
|
|
6551
|
+
);
|
|
6049
6552
|
},
|
|
6050
6553
|
children: [
|
|
6051
6554
|
option.label,
|
|
@@ -6067,16 +6570,10 @@ var TableHeaderComponent = ({
|
|
|
6067
6570
|
Select,
|
|
6068
6571
|
{
|
|
6069
6572
|
value: filterType,
|
|
6070
|
-
onValueChange:
|
|
6071
|
-
if (debounceTimeoutRef.current !== null) {
|
|
6072
|
-
window.clearTimeout(debounceTimeoutRef.current);
|
|
6073
|
-
debounceTimeoutRef.current = null;
|
|
6074
|
-
}
|
|
6075
|
-
handleFilterChange(selected, inputValue);
|
|
6076
|
-
},
|
|
6573
|
+
onValueChange: handleFilterTypeChange,
|
|
6077
6574
|
children: [
|
|
6078
6575
|
/* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "mb-4", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, {}) }),
|
|
6079
|
-
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children:
|
|
6576
|
+
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: TABLE_FILTER_OPTIONS.map((option) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: option.value, children: option.label }, option.value)) })
|
|
6080
6577
|
]
|
|
6081
6578
|
}
|
|
6082
6579
|
),
|
|
@@ -6102,17 +6599,16 @@ var TableHeaderComponent = ({
|
|
|
6102
6599
|
column.getCanResize() && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6103
6600
|
"div",
|
|
6104
6601
|
{
|
|
6105
|
-
onMouseDown:
|
|
6106
|
-
onTouchStart:
|
|
6602
|
+
onMouseDown: handleResizeStart,
|
|
6603
|
+
onTouchStart: handleResizeStart,
|
|
6107
6604
|
onDoubleClick: () => header.column.resetSize(),
|
|
6108
6605
|
className: cn(
|
|
6109
|
-
"absolute right-0 top-0 h-full w-
|
|
6110
|
-
"
|
|
6111
|
-
|
|
6606
|
+
"absolute right-0 top-0 h-full w-4 cursor-w-resize select-none touch-none",
|
|
6607
|
+
"flex items-center justify-center",
|
|
6608
|
+
"opacity-0 group-hover:opacity-100 transition-opacity duration-150",
|
|
6609
|
+
header.column.getIsResizing() && "opacity-100 bg-primary/10"
|
|
6112
6610
|
),
|
|
6113
|
-
style: {
|
|
6114
|
-
transform: "translateX(50%)"
|
|
6115
|
-
}
|
|
6611
|
+
style: { transform: "translateX(50%)" }
|
|
6116
6612
|
}
|
|
6117
6613
|
)
|
|
6118
6614
|
]
|
|
@@ -6131,19 +6627,19 @@ var TableToolbarComponent = ({
|
|
|
6131
6627
|
customizeToolbar
|
|
6132
6628
|
}) => {
|
|
6133
6629
|
const toolbarVisible = enableExport || customizeToolbar || enableGlobalFilter;
|
|
6134
|
-
const [inputValue, setInputValue] =
|
|
6135
|
-
const debounceTimeoutRef =
|
|
6136
|
-
|
|
6630
|
+
const [inputValue, setInputValue] = React52.useState(globalFilter);
|
|
6631
|
+
const debounceTimeoutRef = React52.useRef(null);
|
|
6632
|
+
React52.useEffect(() => {
|
|
6137
6633
|
setInputValue(globalFilter);
|
|
6138
6634
|
}, [globalFilter]);
|
|
6139
|
-
|
|
6635
|
+
React52.useEffect(() => {
|
|
6140
6636
|
return () => {
|
|
6141
6637
|
if (debounceTimeoutRef.current !== null) {
|
|
6142
6638
|
window.clearTimeout(debounceTimeoutRef.current);
|
|
6143
6639
|
}
|
|
6144
6640
|
};
|
|
6145
6641
|
}, []);
|
|
6146
|
-
const debouncedSetGlobalFilter =
|
|
6642
|
+
const debouncedSetGlobalFilter = React52.useCallback(
|
|
6147
6643
|
(nextValue) => {
|
|
6148
6644
|
if (debounceTimeoutRef.current !== null) {
|
|
6149
6645
|
window.clearTimeout(debounceTimeoutRef.current);
|
|
@@ -6155,7 +6651,7 @@ var TableToolbarComponent = ({
|
|
|
6155
6651
|
},
|
|
6156
6652
|
[setGlobalFilter]
|
|
6157
6653
|
);
|
|
6158
|
-
const handleInputChange =
|
|
6654
|
+
const handleInputChange = React52.useCallback(
|
|
6159
6655
|
(event) => {
|
|
6160
6656
|
const nextValue = event.target.value;
|
|
6161
6657
|
setInputValue(nextValue);
|
|
@@ -6163,7 +6659,7 @@ var TableToolbarComponent = ({
|
|
|
6163
6659
|
},
|
|
6164
6660
|
[debouncedSetGlobalFilter]
|
|
6165
6661
|
);
|
|
6166
|
-
const handleClear =
|
|
6662
|
+
const handleClear = React52.useCallback(() => {
|
|
6167
6663
|
if (debounceTimeoutRef.current !== null) {
|
|
6168
6664
|
window.clearTimeout(debounceTimeoutRef.current);
|
|
6169
6665
|
debounceTimeoutRef.current = null;
|
|
@@ -6294,35 +6790,51 @@ function useTableCore({
|
|
|
6294
6790
|
enableColumnResizing = false,
|
|
6295
6791
|
columnResizeMode = "onChange"
|
|
6296
6792
|
}) {
|
|
6297
|
-
const [sorting, setSorting] =
|
|
6793
|
+
const [sorting, setSorting] = React52.useState(
|
|
6298
6794
|
sortBy ? [{ id: sortBy, desc: sortDirection === "desc" }] : []
|
|
6299
6795
|
);
|
|
6300
|
-
const [columnFilters, setColumnFilters] =
|
|
6301
|
-
const [globalFilter, setGlobalFilter] =
|
|
6302
|
-
const [rowSelection, setRowSelection] =
|
|
6303
|
-
const [expanded, setExpanded] =
|
|
6304
|
-
const [paginationState, setPaginationState] =
|
|
6796
|
+
const [columnFilters, setColumnFilters] = React52.useState([]);
|
|
6797
|
+
const [globalFilter, setGlobalFilter] = React52.useState("");
|
|
6798
|
+
const [rowSelection, setRowSelection] = React52.useState({});
|
|
6799
|
+
const [expanded, setExpanded] = React52.useState({});
|
|
6800
|
+
const [paginationState, setPaginationState] = React52.useState({
|
|
6305
6801
|
pageIndex: Math.max(currentPage - 1, 0),
|
|
6306
6802
|
pageSize
|
|
6307
6803
|
});
|
|
6308
|
-
const [columnPinning, setColumnPinning] =
|
|
6804
|
+
const [columnPinning, setColumnPinning] = React52.useState({
|
|
6309
6805
|
left: defaultColumnPinning?.left ?? [],
|
|
6310
6806
|
right: defaultColumnPinning?.right ?? []
|
|
6311
6807
|
});
|
|
6808
|
+
const [columnSizing, setColumnSizing] = React52.useState(() => {
|
|
6809
|
+
if (!enableColumnResizing) return {};
|
|
6810
|
+
const initial = {};
|
|
6811
|
+
columns.forEach((col) => {
|
|
6812
|
+
if (col.size !== void 0) {
|
|
6813
|
+
const key = typeof col.key === "string" ? col.key : String(col.key);
|
|
6814
|
+
initial[key] = col.size;
|
|
6815
|
+
}
|
|
6816
|
+
});
|
|
6817
|
+
return initial;
|
|
6818
|
+
});
|
|
6819
|
+
const [columnSizingInfo, setColumnSizingInfo] = React52.useState({});
|
|
6820
|
+
const [hasInitializedSizing, setHasInitializedSizing] = React52.useState(() => {
|
|
6821
|
+
if (!enableColumnResizing) return false;
|
|
6822
|
+
return columns.some((col) => col.size !== void 0);
|
|
6823
|
+
});
|
|
6312
6824
|
const dataLength = data.length;
|
|
6313
|
-
const enableColumnFilters =
|
|
6825
|
+
const enableColumnFilters = React52.useMemo(() => {
|
|
6314
6826
|
return columns.some((column) => column.filterable === true);
|
|
6315
6827
|
}, [columns]);
|
|
6316
|
-
const enableColumnSorter =
|
|
6828
|
+
const enableColumnSorter = React52.useMemo(() => {
|
|
6317
6829
|
return columns.some((column) => column.sortable === true);
|
|
6318
6830
|
}, [columns]);
|
|
6319
|
-
const pinnableColumnIds =
|
|
6831
|
+
const pinnableColumnIds = React52.useMemo(() => {
|
|
6320
6832
|
return columns.filter((column) => column.pinnable === true).map(
|
|
6321
6833
|
(column) => typeof column.key === "string" ? column.key : String(column.key)
|
|
6322
6834
|
);
|
|
6323
6835
|
}, [columns]);
|
|
6324
6836
|
const enableColumnPin = pinnableColumnIds.length > 0;
|
|
6325
|
-
const baseColumnOrder =
|
|
6837
|
+
const baseColumnOrder = React52.useMemo(() => {
|
|
6326
6838
|
const ids = [];
|
|
6327
6839
|
if (showIndex) ids.push("_mvn_index");
|
|
6328
6840
|
if (expandable) ids.push("_mvn_expand");
|
|
@@ -6333,8 +6845,8 @@ function useTableCore({
|
|
|
6333
6845
|
});
|
|
6334
6846
|
return ids;
|
|
6335
6847
|
}, [columns, selectable, expandable, showIndex]);
|
|
6336
|
-
const [columnOrder, setColumnOrder] =
|
|
6337
|
-
|
|
6848
|
+
const [columnOrder, setColumnOrder] = React52.useState(baseColumnOrder);
|
|
6849
|
+
React52.useEffect(() => {
|
|
6338
6850
|
setColumnOrder((previous) => {
|
|
6339
6851
|
if (isEqual__default.default(previous, baseColumnOrder)) {
|
|
6340
6852
|
return previous;
|
|
@@ -6342,7 +6854,7 @@ function useTableCore({
|
|
|
6342
6854
|
return baseColumnOrder;
|
|
6343
6855
|
});
|
|
6344
6856
|
}, [baseColumnOrder]);
|
|
6345
|
-
|
|
6857
|
+
React52.useEffect(() => {
|
|
6346
6858
|
if (!sortBy) {
|
|
6347
6859
|
setSorting([]);
|
|
6348
6860
|
return;
|
|
@@ -6355,7 +6867,7 @@ function useTableCore({
|
|
|
6355
6867
|
return [next];
|
|
6356
6868
|
});
|
|
6357
6869
|
}, [sortBy, sortDirection]);
|
|
6358
|
-
|
|
6870
|
+
React52.useEffect(() => {
|
|
6359
6871
|
if (!enableColumnFilters) return;
|
|
6360
6872
|
if (!columns.some((column) => column.filterable && column?.defaultFilterValue))
|
|
6361
6873
|
return;
|
|
@@ -6372,7 +6884,7 @@ function useTableCore({
|
|
|
6372
6884
|
return next;
|
|
6373
6885
|
});
|
|
6374
6886
|
}, [columns, enableColumnFilters]);
|
|
6375
|
-
const resolveRowId =
|
|
6887
|
+
const resolveRowId = React52.useCallback(
|
|
6376
6888
|
(record, index) => {
|
|
6377
6889
|
if (typeof rowKey === "function") {
|
|
6378
6890
|
return String(rowKey(record, index));
|
|
@@ -6382,7 +6894,7 @@ function useTableCore({
|
|
|
6382
6894
|
},
|
|
6383
6895
|
[rowKey]
|
|
6384
6896
|
);
|
|
6385
|
-
|
|
6897
|
+
React52.useEffect(() => {
|
|
6386
6898
|
const map = {};
|
|
6387
6899
|
selectedRowKey?.forEach((k) => {
|
|
6388
6900
|
map[k] = true;
|
|
@@ -6394,7 +6906,7 @@ function useTableCore({
|
|
|
6394
6906
|
await onFilterChange(filters);
|
|
6395
6907
|
}
|
|
6396
6908
|
};
|
|
6397
|
-
const handleFilteringChange =
|
|
6909
|
+
const handleFilteringChange = React52.useCallback(
|
|
6398
6910
|
(updater) => {
|
|
6399
6911
|
setColumnFilters((previous) => {
|
|
6400
6912
|
const next = typeof updater === "function" ? updater(previous) : updater;
|
|
@@ -6404,7 +6916,7 @@ function useTableCore({
|
|
|
6404
6916
|
},
|
|
6405
6917
|
[enableColumnFilters, onFilterChange, columnFilters]
|
|
6406
6918
|
);
|
|
6407
|
-
const handleSortingChange =
|
|
6919
|
+
const handleSortingChange = React52.useCallback(
|
|
6408
6920
|
(updater) => {
|
|
6409
6921
|
setSorting((previous) => {
|
|
6410
6922
|
const next = typeof updater === "function" ? updater(previous) : updater;
|
|
@@ -6421,7 +6933,7 @@ function useTableCore({
|
|
|
6421
6933
|
},
|
|
6422
6934
|
[onSortChange]
|
|
6423
6935
|
);
|
|
6424
|
-
const columnDefs =
|
|
6936
|
+
const columnDefs = React52.useMemo(() => {
|
|
6425
6937
|
const defs = columns.map((column) => {
|
|
6426
6938
|
const key = typeof column.key === "string" ? column.key : String(column.key);
|
|
6427
6939
|
return {
|
|
@@ -6433,6 +6945,9 @@ function useTableCore({
|
|
|
6433
6945
|
enableColumnFilter: column.filterable === true,
|
|
6434
6946
|
enablePinning: column.pinnable === true,
|
|
6435
6947
|
enableResizing: column.resizable === true,
|
|
6948
|
+
size: column.size,
|
|
6949
|
+
minSize: column.minSize,
|
|
6950
|
+
maxSize: column.maxSize,
|
|
6436
6951
|
meta: {
|
|
6437
6952
|
align: column.align,
|
|
6438
6953
|
className: column.className,
|
|
@@ -6525,7 +7040,7 @@ function useTableCore({
|
|
|
6525
7040
|
expandable,
|
|
6526
7041
|
showIndex
|
|
6527
7042
|
]);
|
|
6528
|
-
|
|
7043
|
+
React52.useEffect(() => {
|
|
6529
7044
|
if (!pagination) return;
|
|
6530
7045
|
setPaginationState((previous) => {
|
|
6531
7046
|
const newPageIndex = Math.max(currentPage - 1, 0);
|
|
@@ -6539,7 +7054,7 @@ function useTableCore({
|
|
|
6539
7054
|
return next;
|
|
6540
7055
|
});
|
|
6541
7056
|
}, [pagination, currentPage, pageSize]);
|
|
6542
|
-
const handlePaginationChange =
|
|
7057
|
+
const handlePaginationChange = React52.useCallback(
|
|
6543
7058
|
(updater) => {
|
|
6544
7059
|
if (!pagination) return;
|
|
6545
7060
|
setPaginationState((previous) => {
|
|
@@ -6555,13 +7070,156 @@ function useTableCore({
|
|
|
6555
7070
|
},
|
|
6556
7071
|
[pagination, onPageChange]
|
|
6557
7072
|
);
|
|
6558
|
-
const tablePaginationState =
|
|
7073
|
+
const tablePaginationState = React52.useMemo(() => {
|
|
6559
7074
|
if (!pagination) {
|
|
6560
7075
|
const fallbackSize = dataLength || paginationState.pageSize || 1;
|
|
6561
7076
|
return { pageIndex: 0, pageSize: fallbackSize };
|
|
6562
7077
|
}
|
|
6563
7078
|
return paginationState;
|
|
6564
7079
|
}, [pagination, dataLength, paginationState]);
|
|
7080
|
+
const tableRef = React52.useRef(null);
|
|
7081
|
+
const tableContainerRef = React52.useRef(null);
|
|
7082
|
+
const resizeStateRef = React52.useRef({
|
|
7083
|
+
isResizing: false,
|
|
7084
|
+
columnId: null,
|
|
7085
|
+
startX: 0,
|
|
7086
|
+
startWidth: 0,
|
|
7087
|
+
minSize: 36,
|
|
7088
|
+
maxSize: 9999
|
|
7089
|
+
});
|
|
7090
|
+
const pinnedColumnsRef = React52.useRef({ left: [], right: [] });
|
|
7091
|
+
const updatePinnedOffsets = React52.useCallback(() => {
|
|
7092
|
+
const container = tableContainerRef.current;
|
|
7093
|
+
if (!container) return;
|
|
7094
|
+
const { left, right } = pinnedColumnsRef.current;
|
|
7095
|
+
const computedStyle = getComputedStyle(container);
|
|
7096
|
+
let leftAcc = 0;
|
|
7097
|
+
for (const col of left) {
|
|
7098
|
+
container.style.setProperty(`--mvn-col-${col.id}-left`, `${leftAcc}px`);
|
|
7099
|
+
const widthVar = computedStyle.getPropertyValue(
|
|
7100
|
+
`--mvn-col-${col.id}-width`
|
|
7101
|
+
);
|
|
7102
|
+
const width = widthVar ? parseFloat(widthVar) : 0;
|
|
7103
|
+
leftAcc += width;
|
|
7104
|
+
}
|
|
7105
|
+
let rightAcc = 0;
|
|
7106
|
+
for (let i = right.length - 1; i >= 0; i--) {
|
|
7107
|
+
const col = right[i];
|
|
7108
|
+
container.style.setProperty(`--mvn-col-${col.id}-right`, `${rightAcc}px`);
|
|
7109
|
+
const widthVar = computedStyle.getPropertyValue(
|
|
7110
|
+
`--mvn-col-${col.id}-width`
|
|
7111
|
+
);
|
|
7112
|
+
const width = widthVar ? parseFloat(widthVar) : 0;
|
|
7113
|
+
rightAcc += width;
|
|
7114
|
+
}
|
|
7115
|
+
}, []);
|
|
7116
|
+
const handleResizeMove = React52.useCallback(
|
|
7117
|
+
(event) => {
|
|
7118
|
+
const state = resizeStateRef.current;
|
|
7119
|
+
if (!state.isResizing || !state.columnId || !tableContainerRef.current)
|
|
7120
|
+
return;
|
|
7121
|
+
const clientX = "touches" in event ? event.touches[0].clientX : event.clientX;
|
|
7122
|
+
const delta = clientX - state.startX;
|
|
7123
|
+
const newWidth = Math.max(
|
|
7124
|
+
state.minSize,
|
|
7125
|
+
Math.min(state.maxSize, state.startWidth + delta)
|
|
7126
|
+
);
|
|
7127
|
+
tableContainerRef.current.style.setProperty(
|
|
7128
|
+
`--mvn-col-${state.columnId}-width`,
|
|
7129
|
+
`${newWidth}px`
|
|
7130
|
+
);
|
|
7131
|
+
const { left, right } = pinnedColumnsRef.current;
|
|
7132
|
+
const isPinned = left.some((c) => c.id === state.columnId) || right.some((c) => c.id === state.columnId);
|
|
7133
|
+
if (isPinned) {
|
|
7134
|
+
updatePinnedOffsets();
|
|
7135
|
+
}
|
|
7136
|
+
},
|
|
7137
|
+
[updatePinnedOffsets]
|
|
7138
|
+
);
|
|
7139
|
+
const handleResizeEnd = React52.useCallback(() => {
|
|
7140
|
+
const state = resizeStateRef.current;
|
|
7141
|
+
if (!state.isResizing || !tableContainerRef.current) return;
|
|
7142
|
+
const container = tableContainerRef.current;
|
|
7143
|
+
const computedStyle = getComputedStyle(container);
|
|
7144
|
+
const newSizing = {};
|
|
7145
|
+
const headers = tableRef.current?.getHeaderGroups()[0]?.headers ?? [];
|
|
7146
|
+
for (const header of headers) {
|
|
7147
|
+
if (header.column.getCanResize()) {
|
|
7148
|
+
const varName = `--mvn-col-${header.column.id}-width`;
|
|
7149
|
+
const value = computedStyle.getPropertyValue(varName);
|
|
7150
|
+
if (value) {
|
|
7151
|
+
newSizing[header.column.id] = parseFloat(value);
|
|
7152
|
+
}
|
|
7153
|
+
}
|
|
7154
|
+
}
|
|
7155
|
+
if (Object.keys(newSizing).length > 0) {
|
|
7156
|
+
setColumnSizing(newSizing);
|
|
7157
|
+
if (!hasInitializedSizing) {
|
|
7158
|
+
setHasInitializedSizing(true);
|
|
7159
|
+
}
|
|
7160
|
+
}
|
|
7161
|
+
resizeStateRef.current = {
|
|
7162
|
+
isResizing: false,
|
|
7163
|
+
columnId: null,
|
|
7164
|
+
startX: 0,
|
|
7165
|
+
startWidth: 0,
|
|
7166
|
+
minSize: 36,
|
|
7167
|
+
maxSize: 9999
|
|
7168
|
+
};
|
|
7169
|
+
document.removeEventListener("mousemove", handleResizeMove);
|
|
7170
|
+
document.removeEventListener("mouseup", handleResizeEnd);
|
|
7171
|
+
document.removeEventListener("touchmove", handleResizeMove);
|
|
7172
|
+
document.removeEventListener("touchend", handleResizeEnd);
|
|
7173
|
+
}, [hasInitializedSizing, handleResizeMove]);
|
|
7174
|
+
const startResize = React52.useCallback(
|
|
7175
|
+
(columnId, event, initialWidth, minSize = 36, maxSize = 9999) => {
|
|
7176
|
+
const clientX = "touches" in event ? event.touches[0].clientX : event.clientX;
|
|
7177
|
+
resizeStateRef.current = {
|
|
7178
|
+
isResizing: true,
|
|
7179
|
+
columnId,
|
|
7180
|
+
startX: clientX,
|
|
7181
|
+
startWidth: initialWidth,
|
|
7182
|
+
minSize,
|
|
7183
|
+
maxSize
|
|
7184
|
+
};
|
|
7185
|
+
document.addEventListener("mousemove", handleResizeMove);
|
|
7186
|
+
document.addEventListener("mouseup", handleResizeEnd);
|
|
7187
|
+
document.addEventListener("touchmove", handleResizeMove);
|
|
7188
|
+
document.addEventListener("touchend", handleResizeEnd);
|
|
7189
|
+
},
|
|
7190
|
+
[handleResizeMove, handleResizeEnd]
|
|
7191
|
+
);
|
|
7192
|
+
React52.useEffect(() => {
|
|
7193
|
+
return () => {
|
|
7194
|
+
document.removeEventListener("mousemove", handleResizeMove);
|
|
7195
|
+
document.removeEventListener("mouseup", handleResizeEnd);
|
|
7196
|
+
document.removeEventListener("touchmove", handleResizeMove);
|
|
7197
|
+
document.removeEventListener("touchend", handleResizeEnd);
|
|
7198
|
+
};
|
|
7199
|
+
}, [handleResizeMove, handleResizeEnd]);
|
|
7200
|
+
const handleColumnSizingInfoChange = React52.useCallback(
|
|
7201
|
+
(updater) => {
|
|
7202
|
+
setColumnSizingInfo((prev) => {
|
|
7203
|
+
const next = typeof updater === "function" ? updater(prev) : updater;
|
|
7204
|
+
const shouldInitializeSizing = next.isResizingColumn && !hasInitializedSizing && tableRef.current;
|
|
7205
|
+
if (shouldInitializeSizing) {
|
|
7206
|
+
const headers = tableRef.current.getHeaderGroups()[0]?.headers ?? [];
|
|
7207
|
+
const allWidths = {};
|
|
7208
|
+
for (const header of headers) {
|
|
7209
|
+
if (header.column.getCanResize()) {
|
|
7210
|
+
allWidths[header.column.id] = header.getSize();
|
|
7211
|
+
}
|
|
7212
|
+
}
|
|
7213
|
+
if (Object.keys(allWidths).length > 0) {
|
|
7214
|
+
setColumnSizing(allWidths);
|
|
7215
|
+
setHasInitializedSizing(true);
|
|
7216
|
+
}
|
|
7217
|
+
}
|
|
7218
|
+
return next;
|
|
7219
|
+
});
|
|
7220
|
+
},
|
|
7221
|
+
[hasInitializedSizing]
|
|
7222
|
+
);
|
|
6565
7223
|
const table = reactTable.useReactTable({
|
|
6566
7224
|
data,
|
|
6567
7225
|
columns: columnDefs,
|
|
@@ -6577,7 +7235,9 @@ function useTableCore({
|
|
|
6577
7235
|
...enableColumnOrdering ? { columnOrder } : {},
|
|
6578
7236
|
...enableGlobalFilter ? { globalFilter } : {},
|
|
6579
7237
|
pagination: tablePaginationState,
|
|
6580
|
-
columnPinning
|
|
7238
|
+
columnPinning,
|
|
7239
|
+
columnSizing,
|
|
7240
|
+
columnSizingInfo
|
|
6581
7241
|
},
|
|
6582
7242
|
onSortingChange: enableColumnSorter ? handleSortingChange : void 0,
|
|
6583
7243
|
onColumnFiltersChange: enableColumnFilters ? handleFilteringChange : void 0,
|
|
@@ -6587,6 +7247,8 @@ function useTableCore({
|
|
|
6587
7247
|
onGlobalFilterChange: enableGlobalFilter ? setGlobalFilter : void 0,
|
|
6588
7248
|
onPaginationChange: pagination ? handlePaginationChange : void 0,
|
|
6589
7249
|
onColumnPinningChange: enableColumnPin ? setColumnPinning : void 0,
|
|
7250
|
+
onColumnSizingChange: enableColumnResizing ? setColumnSizing : void 0,
|
|
7251
|
+
onColumnSizingInfoChange: enableColumnResizing ? handleColumnSizingInfoChange : void 0,
|
|
6590
7252
|
getCoreRowModel: reactTable.getCoreRowModel(),
|
|
6591
7253
|
getSortedRowModel: reactTable.getSortedRowModel(),
|
|
6592
7254
|
getFilteredRowModel: reactTable.getFilteredRowModel(),
|
|
@@ -6598,11 +7260,23 @@ function useTableCore({
|
|
|
6598
7260
|
getRowId: (originalRow, index) => resolveRowId(originalRow, index),
|
|
6599
7261
|
getRowCanExpand: expandable ? (row) => getRowCanExpand ? getRowCanExpand(row.original) : !!renderExpandedContent : void 0
|
|
6600
7262
|
});
|
|
6601
|
-
|
|
7263
|
+
tableRef.current = table;
|
|
7264
|
+
React52.useEffect(() => {
|
|
7265
|
+
const headers = table.getHeaderGroups()[0]?.headers ?? [];
|
|
7266
|
+
const leftPinned = [];
|
|
7267
|
+
const rightPinned = [];
|
|
7268
|
+
headers.forEach((h) => {
|
|
7269
|
+
const pin = h.column.getIsPinned();
|
|
7270
|
+
if (pin === "left") leftPinned.push({ id: h.column.id });
|
|
7271
|
+
if (pin === "right") rightPinned.push({ id: h.column.id });
|
|
7272
|
+
});
|
|
7273
|
+
pinnedColumnsRef.current = { left: leftPinned, right: rightPinned };
|
|
7274
|
+
}, [table, columnPinning]);
|
|
7275
|
+
const pageCount = React52.useMemo(
|
|
6602
7276
|
() => table.getPageCount(),
|
|
6603
7277
|
[table, sorting, columnFilters]
|
|
6604
7278
|
);
|
|
6605
|
-
|
|
7279
|
+
React52.useEffect(() => {
|
|
6606
7280
|
if (!enableColumnPin) {
|
|
6607
7281
|
setColumnPinning({ left: [], right: [] });
|
|
6608
7282
|
return;
|
|
@@ -6620,7 +7294,7 @@ function useTableCore({
|
|
|
6620
7294
|
return next;
|
|
6621
7295
|
});
|
|
6622
7296
|
}, [enableColumnPin, pinnableColumnIds]);
|
|
6623
|
-
|
|
7297
|
+
React52.useEffect(() => {
|
|
6624
7298
|
if (!pagination) return;
|
|
6625
7299
|
setPaginationState((previous) => {
|
|
6626
7300
|
const lastPage = Math.max(pageCount - 1, 0);
|
|
@@ -6630,11 +7304,11 @@ function useTableCore({
|
|
|
6630
7304
|
return previous;
|
|
6631
7305
|
});
|
|
6632
7306
|
}, [pagination, pageCount]);
|
|
6633
|
-
const shouldShowPagination =
|
|
7307
|
+
const shouldShowPagination = React52.useCallback(
|
|
6634
7308
|
() => pagination && pageCount > 1,
|
|
6635
7309
|
[pagination, pageCount]
|
|
6636
7310
|
);
|
|
6637
|
-
const pageNumbers =
|
|
7311
|
+
const pageNumbers = React52.useMemo(() => {
|
|
6638
7312
|
if (!pagination || pageCount <= 0) return [];
|
|
6639
7313
|
const windowSize = Math.max(Math.min(numberOfPageButtons, pageCount), 1);
|
|
6640
7314
|
const half = Math.floor(windowSize / 2);
|
|
@@ -6656,7 +7330,11 @@ function useTableCore({
|
|
|
6656
7330
|
pageNumbers,
|
|
6657
7331
|
paginationState,
|
|
6658
7332
|
sorting,
|
|
6659
|
-
columnFilters
|
|
7333
|
+
columnFilters,
|
|
7334
|
+
hasInitializedSizing,
|
|
7335
|
+
tableContainerRef,
|
|
7336
|
+
startResize,
|
|
7337
|
+
updatePinnedOffsets
|
|
6660
7338
|
};
|
|
6661
7339
|
}
|
|
6662
7340
|
function useTableVirtualization({
|
|
@@ -6668,7 +7346,7 @@ function useTableVirtualization({
|
|
|
6668
7346
|
overScan,
|
|
6669
7347
|
shouldVirtualize
|
|
6670
7348
|
}) {
|
|
6671
|
-
const virtualRowPointers =
|
|
7349
|
+
const virtualRowPointers = React52.useMemo(() => {
|
|
6672
7350
|
const arr = [];
|
|
6673
7351
|
rows.forEach((row, index) => {
|
|
6674
7352
|
arr.push({
|
|
@@ -6685,14 +7363,14 @@ function useTableVirtualization({
|
|
|
6685
7363
|
});
|
|
6686
7364
|
return arr;
|
|
6687
7365
|
}, [rows, expandable]);
|
|
6688
|
-
const virtualRowPointersRef =
|
|
7366
|
+
const virtualRowPointersRef = React52.useRef(virtualRowPointers);
|
|
6689
7367
|
virtualRowPointersRef.current = virtualRowPointers;
|
|
6690
|
-
const cacheBackingRef =
|
|
7368
|
+
const cacheBackingRef = React52.useRef(
|
|
6691
7369
|
/* @__PURE__ */ new Map()
|
|
6692
7370
|
);
|
|
6693
|
-
const heightCacheByIndexRef =
|
|
6694
|
-
const heightCacheByKeyRef =
|
|
6695
|
-
const cacheRef =
|
|
7371
|
+
const heightCacheByIndexRef = React52.useRef(/* @__PURE__ */ new Map());
|
|
7372
|
+
const heightCacheByKeyRef = React52.useRef(/* @__PURE__ */ new Map());
|
|
7373
|
+
const cacheRef = React52.useRef({
|
|
6696
7374
|
get: (index) => cacheBackingRef.current.get(index)?.size,
|
|
6697
7375
|
set: (index, size, key) => {
|
|
6698
7376
|
cacheBackingRef.current.set(index, { size, key });
|
|
@@ -6710,23 +7388,23 @@ function useTableVirtualization({
|
|
|
6710
7388
|
});
|
|
6711
7389
|
}
|
|
6712
7390
|
});
|
|
6713
|
-
const [virtualWindow, setVirtualWindow] =
|
|
6714
|
-
const virtualWindowRef =
|
|
6715
|
-
const rafRef =
|
|
6716
|
-
const debounceTimeoutRef =
|
|
6717
|
-
const measurementQueueRef =
|
|
6718
|
-
const measurementRafRef =
|
|
6719
|
-
const measurementTimeoutRef =
|
|
7391
|
+
const [virtualWindow, setVirtualWindow] = React52.useState(EMPTY_WINDOW);
|
|
7392
|
+
const virtualWindowRef = React52.useRef(EMPTY_WINDOW);
|
|
7393
|
+
const rafRef = React52.useRef(null);
|
|
7394
|
+
const debounceTimeoutRef = React52.useRef(null);
|
|
7395
|
+
const measurementQueueRef = React52.useRef(/* @__PURE__ */ new Map());
|
|
7396
|
+
const measurementRafRef = React52.useRef(null);
|
|
7397
|
+
const measurementTimeoutRef = React52.useRef(
|
|
6720
7398
|
null
|
|
6721
7399
|
);
|
|
6722
|
-
const measurementIdleRef =
|
|
6723
|
-
const prefixSumCacheRef =
|
|
7400
|
+
const measurementIdleRef = React52.useRef(null);
|
|
7401
|
+
const prefixSumCacheRef = React52.useRef({
|
|
6724
7402
|
count: 0,
|
|
6725
7403
|
itemSizes: [],
|
|
6726
7404
|
offsets: [],
|
|
6727
7405
|
totalSize: 0
|
|
6728
7406
|
});
|
|
6729
|
-
const cleanupRaf =
|
|
7407
|
+
const cleanupRaf = React52.useCallback(() => {
|
|
6730
7408
|
if (debounceTimeoutRef.current != null) {
|
|
6731
7409
|
clearTimeout(debounceTimeoutRef.current);
|
|
6732
7410
|
debounceTimeoutRef.current = null;
|
|
@@ -6757,7 +7435,7 @@ function useTableVirtualization({
|
|
|
6757
7435
|
totalSize: 0
|
|
6758
7436
|
};
|
|
6759
7437
|
}, []);
|
|
6760
|
-
const estimateSize =
|
|
7438
|
+
const estimateSize = React52.useCallback(
|
|
6761
7439
|
(index) => {
|
|
6762
7440
|
const item = virtualRowPointersRef.current[index];
|
|
6763
7441
|
if (!item) return baseRowEstimateSize;
|
|
@@ -6774,7 +7452,7 @@ function useTableVirtualization({
|
|
|
6774
7452
|
},
|
|
6775
7453
|
[baseRowEstimateSize, expandContentEstimateSize]
|
|
6776
7454
|
);
|
|
6777
|
-
const recomputeVirtualWindow =
|
|
7455
|
+
const recomputeVirtualWindow = React52.useCallback(() => {
|
|
6778
7456
|
if (!shouldVirtualize) {
|
|
6779
7457
|
setVirtualWindow(EMPTY_WINDOW);
|
|
6780
7458
|
return;
|
|
@@ -6792,7 +7470,7 @@ function useTableVirtualization({
|
|
|
6792
7470
|
});
|
|
6793
7471
|
setVirtualWindow(nextWindow);
|
|
6794
7472
|
}, [estimateSize, overScan]);
|
|
6795
|
-
const scheduleRecompute =
|
|
7473
|
+
const scheduleRecompute = React52.useCallback(() => {
|
|
6796
7474
|
if (!shouldVirtualize) return;
|
|
6797
7475
|
if (debounceTimeoutRef.current != null) {
|
|
6798
7476
|
clearTimeout(debounceTimeoutRef.current);
|
|
@@ -6811,7 +7489,7 @@ function useTableVirtualization({
|
|
|
6811
7489
|
};
|
|
6812
7490
|
debounceTimeoutRef.current = setTimeout(run, SCROLL_RESIZE_DEBOUNCE_MS);
|
|
6813
7491
|
}, [recomputeVirtualWindow]);
|
|
6814
|
-
const flushMeasurementQueue =
|
|
7492
|
+
const flushMeasurementQueue = React52.useCallback(() => {
|
|
6815
7493
|
if (!shouldVirtualize) {
|
|
6816
7494
|
measurementQueueRef.current.clear();
|
|
6817
7495
|
return;
|
|
@@ -6840,7 +7518,7 @@ function useTableVirtualization({
|
|
|
6840
7518
|
measurementQueueRef.current.clear();
|
|
6841
7519
|
scheduleRecompute();
|
|
6842
7520
|
}, [scheduleRecompute]);
|
|
6843
|
-
const scheduleMeasurementFlush =
|
|
7521
|
+
const scheduleMeasurementFlush = React52.useCallback(() => {
|
|
6844
7522
|
if (!shouldVirtualize) {
|
|
6845
7523
|
measurementQueueRef.current.clear();
|
|
6846
7524
|
return;
|
|
@@ -6868,7 +7546,7 @@ function useTableVirtualization({
|
|
|
6868
7546
|
measurementTimeoutRef.current = setTimeout(runFlush, 16);
|
|
6869
7547
|
}
|
|
6870
7548
|
}, [flushMeasurementQueue]);
|
|
6871
|
-
const measureElement =
|
|
7549
|
+
const measureElement = React52.useCallback(
|
|
6872
7550
|
(height, index) => {
|
|
6873
7551
|
if (!height || !shouldVirtualize || index == null) return;
|
|
6874
7552
|
if (shouldVirtualize) {
|
|
@@ -6885,7 +7563,7 @@ function useTableVirtualization({
|
|
|
6885
7563
|
},
|
|
6886
7564
|
[scheduleMeasurementFlush]
|
|
6887
7565
|
);
|
|
6888
|
-
|
|
7566
|
+
React52.useEffect(() => {
|
|
6889
7567
|
if (!shouldVirtualize) {
|
|
6890
7568
|
cacheRef.current.clear();
|
|
6891
7569
|
heightCacheByIndexRef.current.clear();
|
|
@@ -6903,7 +7581,7 @@ function useTableVirtualization({
|
|
|
6903
7581
|
});
|
|
6904
7582
|
scheduleRecompute();
|
|
6905
7583
|
}, [scheduleRecompute]);
|
|
6906
|
-
const invalidateCache =
|
|
7584
|
+
const invalidateCache = React52.useCallback(
|
|
6907
7585
|
(index, key) => {
|
|
6908
7586
|
const result = cacheRef.current.invalidateIndex?.(index);
|
|
6909
7587
|
if (!result) return;
|
|
@@ -6914,7 +7592,7 @@ function useTableVirtualization({
|
|
|
6914
7592
|
},
|
|
6915
7593
|
[scheduleRecompute]
|
|
6916
7594
|
);
|
|
6917
|
-
|
|
7595
|
+
React52.useEffect(() => {
|
|
6918
7596
|
if (!shouldVirtualize) return;
|
|
6919
7597
|
const element = tableContainerRef.current;
|
|
6920
7598
|
if (!element) return;
|
|
@@ -6943,11 +7621,11 @@ function useTableVirtualization({
|
|
|
6943
7621
|
if (frameId != null) cancelAnimationFrame(frameId);
|
|
6944
7622
|
};
|
|
6945
7623
|
}, [scheduleRecompute]);
|
|
6946
|
-
|
|
6947
|
-
|
|
7624
|
+
React52.useEffect(() => () => cleanupRaf(), [cleanupRaf]);
|
|
7625
|
+
React52.useEffect(() => {
|
|
6948
7626
|
virtualWindowRef.current = virtualWindow;
|
|
6949
7627
|
}, [virtualWindow]);
|
|
6950
|
-
const virtualItems =
|
|
7628
|
+
const virtualItems = React52.useMemo(() => {
|
|
6951
7629
|
if (!shouldVirtualize) return [];
|
|
6952
7630
|
return virtualWindow.items.map(({ index, offset, size }) => {
|
|
6953
7631
|
const start = offset;
|
|
@@ -7163,10 +7841,16 @@ function SimpleTable({
|
|
|
7163
7841
|
loadingText,
|
|
7164
7842
|
pagingPosition = "right",
|
|
7165
7843
|
recordPerChunk = 100,
|
|
7166
|
-
defaultColumnPinning
|
|
7844
|
+
defaultColumnPinning,
|
|
7845
|
+
enableColumnResizing = false,
|
|
7846
|
+
columnResizeMode = "onChange",
|
|
7847
|
+
// Mobile props
|
|
7848
|
+
mobileLayout = "auto",
|
|
7849
|
+
mobileCardActions,
|
|
7850
|
+
renderMobileCard
|
|
7167
7851
|
}) {
|
|
7168
|
-
const [internalLazyLoading, setInternalLazyLoading] =
|
|
7169
|
-
const pendingLazyLoad =
|
|
7852
|
+
const [internalLazyLoading, setInternalLazyLoading] = React52.useState(false);
|
|
7853
|
+
const pendingLazyLoad = React52.useRef(false);
|
|
7170
7854
|
const isControlledLoading = loading !== void 0;
|
|
7171
7855
|
const resolvedLoading = isControlledLoading ? loading : internalLazyLoading;
|
|
7172
7856
|
const showOverlayLoading = resolvedLoading && lazyLoadIndicatorType === "overlay";
|
|
@@ -7182,7 +7866,11 @@ function SimpleTable({
|
|
|
7182
7866
|
pageNumbers,
|
|
7183
7867
|
paginationState,
|
|
7184
7868
|
sorting,
|
|
7185
|
-
columnFilters
|
|
7869
|
+
columnFilters,
|
|
7870
|
+
hasInitializedSizing,
|
|
7871
|
+
tableContainerRef,
|
|
7872
|
+
startResize,
|
|
7873
|
+
updatePinnedOffsets
|
|
7186
7874
|
} = useTableCore({
|
|
7187
7875
|
data,
|
|
7188
7876
|
columns,
|
|
@@ -7207,9 +7895,11 @@ function SimpleTable({
|
|
|
7207
7895
|
manualSorting,
|
|
7208
7896
|
manualFiltering,
|
|
7209
7897
|
onFilterChange,
|
|
7210
|
-
defaultColumnPinning
|
|
7898
|
+
defaultColumnPinning,
|
|
7899
|
+
enableColumnResizing,
|
|
7900
|
+
columnResizeMode
|
|
7211
7901
|
});
|
|
7212
|
-
const handleLazyLoad =
|
|
7902
|
+
const handleLazyLoad = React52.useCallback(async () => {
|
|
7213
7903
|
if (!onLazyScrollLoad || pendingLazyLoad.current || resolvedLoading) return;
|
|
7214
7904
|
pendingLazyLoad.current = true;
|
|
7215
7905
|
if (!isControlledLoading) setInternalLazyLoading(true);
|
|
@@ -7221,8 +7911,10 @@ function SimpleTable({
|
|
|
7221
7911
|
}
|
|
7222
7912
|
}, [onLazyScrollLoad, resolvedLoading]);
|
|
7223
7913
|
const virtualizationActive = data.length * (expandable ? 2 : 1) > virtualizationThreshold;
|
|
7224
|
-
const
|
|
7225
|
-
const
|
|
7914
|
+
const isMobile = useIsMobile();
|
|
7915
|
+
const shouldUseCardView = mobileLayout === "card" || mobileLayout === "auto" && isMobile;
|
|
7916
|
+
const [chunkCount, setChunkCount] = React52.useState(recordPerChunk);
|
|
7917
|
+
const onLoadChunk = React52.useCallback(() => {
|
|
7226
7918
|
if (resolvedLoading || pendingLazyLoad.current) return;
|
|
7227
7919
|
if (data.length > chunkCount) {
|
|
7228
7920
|
setChunkCount(() => Math.min(chunkCount + recordPerChunk, data.length));
|
|
@@ -7231,25 +7923,24 @@ function SimpleTable({
|
|
|
7231
7923
|
if (typeof maxRecords === "number" && data.length >= maxRecords) return;
|
|
7232
7924
|
void handleLazyLoad();
|
|
7233
7925
|
}, [recordPerChunk, data.length, handleLazyLoad, chunkCount, maxRecords]);
|
|
7234
|
-
const onLoadChunkRef =
|
|
7235
|
-
|
|
7926
|
+
const onLoadChunkRef = React52.useRef(onLoadChunk);
|
|
7927
|
+
React52.useEffect(() => {
|
|
7236
7928
|
onLoadChunkRef.current = onLoadChunk;
|
|
7237
7929
|
}, [onLoadChunk]);
|
|
7238
|
-
const rows =
|
|
7930
|
+
const rows = React52.useMemo(
|
|
7239
7931
|
() => table.getRowModel().rows,
|
|
7240
|
-
[paginationState, sorting, columnFilters, globalFilter]
|
|
7932
|
+
[paginationState, sorting, columnFilters, globalFilter, data]
|
|
7241
7933
|
);
|
|
7242
|
-
const splittedRows =
|
|
7934
|
+
const splittedRows = React52.useMemo(
|
|
7243
7935
|
() => rows.slice(0, chunkCount),
|
|
7244
7936
|
[rows, chunkCount]
|
|
7245
7937
|
);
|
|
7246
|
-
const selectedRows =
|
|
7938
|
+
const selectedRows = React52.useMemo(
|
|
7247
7939
|
() => table.getSelectedRowModel().rows.map((row) => row.original),
|
|
7248
7940
|
[rowSelection]
|
|
7249
7941
|
);
|
|
7250
7942
|
const tablePagination = table.getState().pagination;
|
|
7251
|
-
const draggedColumnId =
|
|
7252
|
-
const tableContainerRef = React50.useRef(null);
|
|
7943
|
+
const draggedColumnId = React52.useRef(null);
|
|
7253
7944
|
const {
|
|
7254
7945
|
virtualRowPointers,
|
|
7255
7946
|
virtualItems,
|
|
@@ -7266,10 +7957,10 @@ function SimpleTable({
|
|
|
7266
7957
|
overScan,
|
|
7267
7958
|
shouldVirtualize: virtualizationActive
|
|
7268
7959
|
});
|
|
7269
|
-
const rafRef =
|
|
7270
|
-
|
|
7960
|
+
const rafRef = React52.useRef(null);
|
|
7961
|
+
React52.useEffect(() => {
|
|
7271
7962
|
const container = tableContainerRef.current;
|
|
7272
|
-
if (!container || virtualizationActive) return;
|
|
7963
|
+
if (!container || virtualizationActive && !shouldUseCardView) return;
|
|
7273
7964
|
const scheduleCheck = () => {
|
|
7274
7965
|
if (rafRef.current != null) return;
|
|
7275
7966
|
rafRef.current = requestAnimationFrame(() => {
|
|
@@ -7290,31 +7981,30 @@ function SimpleTable({
|
|
|
7290
7981
|
}
|
|
7291
7982
|
};
|
|
7292
7983
|
}, [scrollLoadThreshold, virtualizationActive]);
|
|
7293
|
-
|
|
7984
|
+
React52.useEffect(() => {
|
|
7294
7985
|
if (virtualizationActive) return;
|
|
7295
7986
|
if (table.getState().pagination.pageIndex === 0) {
|
|
7296
7987
|
tableContainerRef.current?.scrollTo({ top: 0 });
|
|
7297
7988
|
}
|
|
7298
7989
|
}, [virtualizationActive]);
|
|
7299
|
-
|
|
7300
|
-
if (!virtualItems.length || !virtualizationActive)
|
|
7990
|
+
React52.useEffect(() => {
|
|
7991
|
+
if (!virtualItems.length || !virtualizationActive || shouldUseCardView)
|
|
7992
|
+
return;
|
|
7301
7993
|
if (paddingBottom <= scrollLoadThreshold) {
|
|
7302
7994
|
onLoadChunkRef.current();
|
|
7303
7995
|
}
|
|
7304
7996
|
}, [paddingBottom, scrollLoadThreshold, virtualizationActive]);
|
|
7305
7997
|
const columnCount = table.getAllLeafColumns().length;
|
|
7306
|
-
const allHeaders =
|
|
7998
|
+
const allHeaders = React52.useMemo(() => {
|
|
7307
7999
|
const groups = table.getHeaderGroups();
|
|
7308
8000
|
if (groups.length === 0) return [];
|
|
7309
8001
|
return groups[0].headers;
|
|
7310
8002
|
}, [table]);
|
|
7311
|
-
const { leftOffsets, rightOffsets
|
|
8003
|
+
const { leftOffsets, rightOffsets } = React52.useMemo(() => {
|
|
7312
8004
|
if (!allHeaders || allHeaders.length === 0) {
|
|
7313
8005
|
return {
|
|
7314
8006
|
leftOffsets: /* @__PURE__ */ new Map(),
|
|
7315
|
-
rightOffsets: /* @__PURE__ */ new Map()
|
|
7316
|
-
lastLeftId: null,
|
|
7317
|
-
firstRightId: null
|
|
8007
|
+
rightOffsets: /* @__PURE__ */ new Map()
|
|
7318
8008
|
};
|
|
7319
8009
|
}
|
|
7320
8010
|
const leftPinned = allHeaders.filter(
|
|
@@ -7338,16 +8028,29 @@ function SimpleTable({
|
|
|
7338
8028
|
}
|
|
7339
8029
|
return {
|
|
7340
8030
|
leftOffsets: leftMap,
|
|
7341
|
-
rightOffsets: rightMap
|
|
7342
|
-
lastLeftId: leftPinned.length > 0 ? leftPinned[leftPinned.length - 1].column.id : null,
|
|
7343
|
-
firstRightId: rightPinned.length > 0 ? rightPinned[0].column.id : null
|
|
8031
|
+
rightOffsets: rightMap
|
|
7344
8032
|
};
|
|
7345
8033
|
}, [allHeaders]);
|
|
7346
|
-
|
|
8034
|
+
React52.useEffect(() => {
|
|
8035
|
+
if (!hasInitializedSizing || !tableContainerRef.current) return;
|
|
8036
|
+
const container = tableContainerRef.current;
|
|
8037
|
+
const headers = table.getHeaderGroups()[0]?.headers ?? [];
|
|
8038
|
+
for (const header of headers) {
|
|
8039
|
+
if (header.column.getCanResize()) {
|
|
8040
|
+
const width = header.getSize();
|
|
8041
|
+
container.style.setProperty(
|
|
8042
|
+
`--mvn-col-${header.column.id}-width`,
|
|
8043
|
+
`${width}px`
|
|
8044
|
+
);
|
|
8045
|
+
}
|
|
8046
|
+
}
|
|
8047
|
+
updatePinnedOffsets();
|
|
8048
|
+
}, [hasInitializedSizing, table, updatePinnedOffsets]);
|
|
8049
|
+
React52.useEffect(() => {
|
|
7347
8050
|
if (!selectable || !onSelectionChange) return;
|
|
7348
8051
|
onSelectionChange(selectedRows);
|
|
7349
8052
|
}, [selectable, onSelectionChange, selectedRows]);
|
|
7350
|
-
|
|
8053
|
+
React52.useEffect(() => {
|
|
7351
8054
|
if (!expandable || !onExpandedChange) return;
|
|
7352
8055
|
onExpandedChange(
|
|
7353
8056
|
table.getExpandedRowModel().rows.map((row) => row.original)
|
|
@@ -7393,13 +8096,31 @@ function SimpleTable({
|
|
|
7393
8096
|
},
|
|
7394
8097
|
children: [
|
|
7395
8098
|
showOverlayLoading && (loadingComponent ?? /* @__PURE__ */ jsxRuntime.jsx(DefaultLoadingComponent, { loadingText })),
|
|
7396
|
-
/* @__PURE__ */ jsxRuntime.
|
|
8099
|
+
shouldUseCardView ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
8100
|
+
TableCardView,
|
|
8101
|
+
{
|
|
8102
|
+
rows: splittedRows,
|
|
8103
|
+
columns,
|
|
8104
|
+
selectable,
|
|
8105
|
+
expandable,
|
|
8106
|
+
onRowClick,
|
|
8107
|
+
rowClassName,
|
|
8108
|
+
renderExpandedContent,
|
|
8109
|
+
mobileCardActions,
|
|
8110
|
+
emptyMessage,
|
|
8111
|
+
renderMobileCard
|
|
8112
|
+
}
|
|
8113
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7397
8114
|
Table,
|
|
7398
8115
|
{
|
|
7399
8116
|
variant,
|
|
7400
8117
|
size,
|
|
7401
8118
|
wrapperClassName: "overflow-visible",
|
|
7402
8119
|
className: showOverlayLoading ? "pointer-events-none opacity-50" : void 0,
|
|
8120
|
+
style: enableColumnResizing ? {
|
|
8121
|
+
width: hasInitializedSizing ? table.getTotalSize() : void 0,
|
|
8122
|
+
tableLayout: hasInitializedSizing ? "fixed" : "auto"
|
|
8123
|
+
} : void 0,
|
|
7403
8124
|
children: [
|
|
7404
8125
|
caption && /* @__PURE__ */ jsxRuntime.jsx(TableCaption, { children: caption }),
|
|
7405
8126
|
/* @__PURE__ */ jsxRuntime.jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsxRuntime.jsx(TableRow, { children: headerGroup.headers.map((header) => {
|
|
@@ -7415,8 +8136,8 @@ function SimpleTable({
|
|
|
7415
8136
|
setColumnOrder,
|
|
7416
8137
|
pinnedLeftOffset: pinPosition === "left" ? leftOffsets.get(header.column.id) : void 0,
|
|
7417
8138
|
pinnedRightOffset: pinPosition === "right" ? rightOffsets.get(header.column.id) : void 0,
|
|
7418
|
-
|
|
7419
|
-
|
|
8139
|
+
hasInitializedSizing,
|
|
8140
|
+
startResize
|
|
7420
8141
|
},
|
|
7421
8142
|
header.id
|
|
7422
8143
|
);
|
|
@@ -7440,7 +8161,8 @@ function SimpleTable({
|
|
|
7440
8161
|
virtualItems,
|
|
7441
8162
|
invalidateCache,
|
|
7442
8163
|
getRowExpandable,
|
|
7443
|
-
headers: allHeaders
|
|
8164
|
+
headers: allHeaders,
|
|
8165
|
+
hasInitializedSizing
|
|
7444
8166
|
}
|
|
7445
8167
|
),
|
|
7446
8168
|
showInlineLoadingRow && resolvedLoading && /* @__PURE__ */ jsxRuntime.jsx(TableRow, { "data-loading-row": true, className: "pointer-events-none", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -7501,12 +8223,12 @@ function DataTable({
|
|
|
7501
8223
|
pageSize = 10,
|
|
7502
8224
|
className
|
|
7503
8225
|
}) {
|
|
7504
|
-
const [sorting, setSorting] =
|
|
7505
|
-
const [columnFilters, setColumnFilters] =
|
|
8226
|
+
const [sorting, setSorting] = React52__namespace.useState([]);
|
|
8227
|
+
const [columnFilters, setColumnFilters] = React52__namespace.useState(
|
|
7506
8228
|
[]
|
|
7507
8229
|
);
|
|
7508
|
-
const [columnVisibility, setColumnVisibility] =
|
|
7509
|
-
const [rowSelection, setRowSelection] =
|
|
8230
|
+
const [columnVisibility, setColumnVisibility] = React52__namespace.useState({});
|
|
8231
|
+
const [rowSelection, setRowSelection] = React52__namespace.useState({});
|
|
7510
8232
|
const table = reactTable.useReactTable({
|
|
7511
8233
|
data,
|
|
7512
8234
|
columns,
|
|
@@ -7663,7 +8385,7 @@ var avatarFallbackVariants = classVarianceAuthority.cva(
|
|
|
7663
8385
|
}
|
|
7664
8386
|
}
|
|
7665
8387
|
);
|
|
7666
|
-
var Avatar =
|
|
8388
|
+
var Avatar = React52__namespace.forwardRef(({ className, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7667
8389
|
AvatarPrimitive__namespace.Root,
|
|
7668
8390
|
{
|
|
7669
8391
|
ref,
|
|
@@ -7672,7 +8394,7 @@ var Avatar = React50__namespace.forwardRef(({ className, size, ...props }, ref)
|
|
|
7672
8394
|
}
|
|
7673
8395
|
));
|
|
7674
8396
|
Avatar.displayName = AvatarPrimitive__namespace.Root.displayName;
|
|
7675
|
-
var AvatarImage =
|
|
8397
|
+
var AvatarImage = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7676
8398
|
AvatarPrimitive__namespace.Image,
|
|
7677
8399
|
{
|
|
7678
8400
|
ref,
|
|
@@ -7681,7 +8403,7 @@ var AvatarImage = React50__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
7681
8403
|
}
|
|
7682
8404
|
));
|
|
7683
8405
|
AvatarImage.displayName = AvatarPrimitive__namespace.Image.displayName;
|
|
7684
|
-
var AvatarFallback =
|
|
8406
|
+
var AvatarFallback = React52__namespace.forwardRef(({ className, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7685
8407
|
AvatarPrimitive__namespace.Fallback,
|
|
7686
8408
|
{
|
|
7687
8409
|
ref,
|
|
@@ -7845,7 +8567,7 @@ var itemVariants = classVarianceAuthority.cva(
|
|
|
7845
8567
|
}
|
|
7846
8568
|
}
|
|
7847
8569
|
);
|
|
7848
|
-
var Item9 =
|
|
8570
|
+
var Item9 = React52__namespace.forwardRef(
|
|
7849
8571
|
({
|
|
7850
8572
|
className,
|
|
7851
8573
|
variant,
|
|
@@ -7911,7 +8633,7 @@ var Item9 = React50__namespace.forwardRef(
|
|
|
7911
8633
|
}
|
|
7912
8634
|
);
|
|
7913
8635
|
Item9.displayName = "Item";
|
|
7914
|
-
var ItemGroup =
|
|
8636
|
+
var ItemGroup = React52__namespace.forwardRef(({ className, label, description, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("space-y-1", className), ...props, children: [
|
|
7915
8637
|
(label || description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-2 space-y-0.5", children: [
|
|
7916
8638
|
label && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: label }),
|
|
7917
8639
|
description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: description })
|
|
@@ -7919,7 +8641,7 @@ var ItemGroup = React50__namespace.forwardRef(({ className, label, description,
|
|
|
7919
8641
|
children
|
|
7920
8642
|
] }));
|
|
7921
8643
|
ItemGroup.displayName = "ItemGroup";
|
|
7922
|
-
var ItemList =
|
|
8644
|
+
var ItemList = React52__namespace.forwardRef(({ className, divided, spacing = "default", children, ...props }, ref) => {
|
|
7923
8645
|
const spacingClasses = {
|
|
7924
8646
|
none: "space-y-0",
|
|
7925
8647
|
sm: "space-y-0.5",
|
|
@@ -7942,7 +8664,7 @@ var ItemList = React50__namespace.forwardRef(({ className, divided, spacing = "d
|
|
|
7942
8664
|
);
|
|
7943
8665
|
});
|
|
7944
8666
|
ItemList.displayName = "ItemList";
|
|
7945
|
-
var ItemSeparator =
|
|
8667
|
+
var ItemSeparator = React52__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
7946
8668
|
"div",
|
|
7947
8669
|
{
|
|
7948
8670
|
ref,
|
|
@@ -7980,7 +8702,7 @@ var badgeVariants = classVarianceAuthority.cva(
|
|
|
7980
8702
|
}
|
|
7981
8703
|
}
|
|
7982
8704
|
);
|
|
7983
|
-
var Badge =
|
|
8705
|
+
var Badge = React52__namespace.forwardRef(
|
|
7984
8706
|
({
|
|
7985
8707
|
className,
|
|
7986
8708
|
variant,
|
|
@@ -8047,7 +8769,7 @@ function Calendar({
|
|
|
8047
8769
|
...props
|
|
8048
8770
|
}) {
|
|
8049
8771
|
const defaultClassNames = reactDayPicker.getDefaultClassNames();
|
|
8050
|
-
const { Card: Card2, CardHeader: CardHeader2, CardTitle: CardTitle2, CardContent: CardContent2, CardDescription: CardDescription2 } =
|
|
8772
|
+
const { Card: Card2, CardHeader: CardHeader2, CardTitle: CardTitle2, CardContent: CardContent2, CardDescription: CardDescription2 } = React52__namespace.useMemo(() => {
|
|
8051
8773
|
try {
|
|
8052
8774
|
const cardComponents = (init_card(), __toCommonJS(card_exports));
|
|
8053
8775
|
return cardComponents;
|
|
@@ -8061,7 +8783,7 @@ function Calendar({
|
|
|
8061
8783
|
};
|
|
8062
8784
|
}
|
|
8063
8785
|
}, []);
|
|
8064
|
-
const defaultPresets =
|
|
8786
|
+
const defaultPresets = React52__namespace.useMemo(() => {
|
|
8065
8787
|
if (!quickSelect && !presets) return [];
|
|
8066
8788
|
const mode = props.mode;
|
|
8067
8789
|
if (mode === "single") {
|
|
@@ -8069,7 +8791,7 @@ function Calendar({
|
|
|
8069
8791
|
{
|
|
8070
8792
|
label: "Today",
|
|
8071
8793
|
value: () => /* @__PURE__ */ new Date(),
|
|
8072
|
-
icon:
|
|
8794
|
+
icon: React52__namespace.createElement(lucideReact.Calendar, { className: "h-3 w-3" })
|
|
8073
8795
|
},
|
|
8074
8796
|
{
|
|
8075
8797
|
label: "Tomorrow",
|
|
@@ -8078,7 +8800,7 @@ function Calendar({
|
|
|
8078
8800
|
tomorrow.setDate(tomorrow.getDate() + 1);
|
|
8079
8801
|
return tomorrow;
|
|
8080
8802
|
},
|
|
8081
|
-
icon:
|
|
8803
|
+
icon: React52__namespace.createElement("span", { className: "text-xs" }, "\u27A1\uFE0F")
|
|
8082
8804
|
},
|
|
8083
8805
|
{
|
|
8084
8806
|
label: "Next Week",
|
|
@@ -8087,7 +8809,7 @@ function Calendar({
|
|
|
8087
8809
|
nextWeek.setDate(nextWeek.getDate() + 7);
|
|
8088
8810
|
return nextWeek;
|
|
8089
8811
|
},
|
|
8090
|
-
icon:
|
|
8812
|
+
icon: React52__namespace.createElement(lucideReact.Calendar, { className: "h-3 w-3" })
|
|
8091
8813
|
}
|
|
8092
8814
|
];
|
|
8093
8815
|
} else if (mode === "range") {
|
|
@@ -8100,7 +8822,7 @@ function Calendar({
|
|
|
8100
8822
|
end.setDate(start.getDate() + 6);
|
|
8101
8823
|
return { from: start, to: end };
|
|
8102
8824
|
},
|
|
8103
|
-
icon:
|
|
8825
|
+
icon: React52__namespace.createElement(lucideReact.Calendar, { className: "h-3 w-3" })
|
|
8104
8826
|
},
|
|
8105
8827
|
{
|
|
8106
8828
|
label: "Next 7 Days",
|
|
@@ -8110,7 +8832,7 @@ function Calendar({
|
|
|
8110
8832
|
end.setDate(start.getDate() + 7);
|
|
8111
8833
|
return { from: start, to: end };
|
|
8112
8834
|
},
|
|
8113
|
-
icon:
|
|
8835
|
+
icon: React52__namespace.createElement("span", { className: "text-xs" }, "\u27A1\uFE0F")
|
|
8114
8836
|
}
|
|
8115
8837
|
];
|
|
8116
8838
|
} else {
|
|
@@ -8126,7 +8848,7 @@ function Calendar({
|
|
|
8126
8848
|
}
|
|
8127
8849
|
return dates;
|
|
8128
8850
|
},
|
|
8129
|
-
icon:
|
|
8851
|
+
icon: React52__namespace.createElement(lucideReact.Calendar, { className: "h-3 w-3" })
|
|
8130
8852
|
}
|
|
8131
8853
|
];
|
|
8132
8854
|
}
|
|
@@ -8137,24 +8859,24 @@ function Calendar({
|
|
|
8137
8859
|
const selected = props.selected;
|
|
8138
8860
|
const mode = props.mode;
|
|
8139
8861
|
if (mode === "single" && selected) {
|
|
8140
|
-
return
|
|
8862
|
+
return React52__namespace.createElement(
|
|
8141
8863
|
"div",
|
|
8142
8864
|
{
|
|
8143
8865
|
className: "p-3 border rounded-lg bg-muted/50"
|
|
8144
8866
|
},
|
|
8145
8867
|
[
|
|
8146
|
-
|
|
8868
|
+
React52__namespace.createElement(
|
|
8147
8869
|
"div",
|
|
8148
8870
|
{
|
|
8149
8871
|
key: "header",
|
|
8150
8872
|
className: "flex items-center gap-2 mb-1"
|
|
8151
8873
|
},
|
|
8152
8874
|
[
|
|
8153
|
-
|
|
8875
|
+
React52__namespace.createElement(lucideReact.Calendar, {
|
|
8154
8876
|
key: "icon",
|
|
8155
8877
|
className: "h-4 w-4"
|
|
8156
8878
|
}),
|
|
8157
|
-
|
|
8879
|
+
React52__namespace.createElement(
|
|
8158
8880
|
"span",
|
|
8159
8881
|
{
|
|
8160
8882
|
key: "label",
|
|
@@ -8164,7 +8886,7 @@ function Calendar({
|
|
|
8164
8886
|
)
|
|
8165
8887
|
]
|
|
8166
8888
|
),
|
|
8167
|
-
|
|
8889
|
+
React52__namespace.createElement(
|
|
8168
8890
|
"p",
|
|
8169
8891
|
{
|
|
8170
8892
|
key: "date",
|
|
@@ -8182,24 +8904,24 @@ function Calendar({
|
|
|
8182
8904
|
}
|
|
8183
8905
|
if (mode === "range" && selected?.from) {
|
|
8184
8906
|
const elements = [
|
|
8185
|
-
|
|
8907
|
+
React52__namespace.createElement(
|
|
8186
8908
|
"div",
|
|
8187
8909
|
{
|
|
8188
8910
|
key: "from",
|
|
8189
8911
|
className: "flex items-center gap-2 text-sm"
|
|
8190
8912
|
},
|
|
8191
8913
|
[
|
|
8192
|
-
|
|
8914
|
+
React52__namespace.createElement(
|
|
8193
8915
|
"span",
|
|
8194
8916
|
{ key: "icon", className: "text-green-600" },
|
|
8195
8917
|
"\u{1F7E2}"
|
|
8196
8918
|
),
|
|
8197
|
-
|
|
8919
|
+
React52__namespace.createElement(
|
|
8198
8920
|
"span",
|
|
8199
8921
|
{ key: "label", className: "font-medium" },
|
|
8200
8922
|
"From:"
|
|
8201
8923
|
),
|
|
8202
|
-
|
|
8924
|
+
React52__namespace.createElement(
|
|
8203
8925
|
"span",
|
|
8204
8926
|
{ key: "date" },
|
|
8205
8927
|
selected.from.toLocaleDateString()
|
|
@@ -8209,43 +8931,43 @@ function Calendar({
|
|
|
8209
8931
|
];
|
|
8210
8932
|
if (selected.to) {
|
|
8211
8933
|
elements.push(
|
|
8212
|
-
|
|
8934
|
+
React52__namespace.createElement(
|
|
8213
8935
|
"div",
|
|
8214
8936
|
{
|
|
8215
8937
|
key: "to",
|
|
8216
8938
|
className: "flex items-center gap-2 text-sm"
|
|
8217
8939
|
},
|
|
8218
8940
|
[
|
|
8219
|
-
|
|
8941
|
+
React52__namespace.createElement(
|
|
8220
8942
|
"span",
|
|
8221
8943
|
{ key: "icon", className: "text-red-600" },
|
|
8222
8944
|
"\u{1F534}"
|
|
8223
8945
|
),
|
|
8224
|
-
|
|
8946
|
+
React52__namespace.createElement(
|
|
8225
8947
|
"span",
|
|
8226
8948
|
{ key: "label", className: "font-medium" },
|
|
8227
8949
|
"To:"
|
|
8228
8950
|
),
|
|
8229
|
-
|
|
8951
|
+
React52__namespace.createElement(
|
|
8230
8952
|
"span",
|
|
8231
8953
|
{ key: "date" },
|
|
8232
8954
|
selected.to.toLocaleDateString()
|
|
8233
8955
|
)
|
|
8234
8956
|
]
|
|
8235
8957
|
),
|
|
8236
|
-
|
|
8958
|
+
React52__namespace.createElement(
|
|
8237
8959
|
"div",
|
|
8238
8960
|
{
|
|
8239
8961
|
key: "duration",
|
|
8240
8962
|
className: "flex items-center gap-2 pt-2 border-t text-sm"
|
|
8241
8963
|
},
|
|
8242
8964
|
[
|
|
8243
|
-
|
|
8965
|
+
React52__namespace.createElement(
|
|
8244
8966
|
"span",
|
|
8245
8967
|
{ key: "icon", className: "text-mvn-blue-600" },
|
|
8246
8968
|
"\u23F1\uFE0F"
|
|
8247
8969
|
),
|
|
8248
|
-
|
|
8970
|
+
React52__namespace.createElement(
|
|
8249
8971
|
"span",
|
|
8250
8972
|
{ key: "text" },
|
|
8251
8973
|
`Duration: ${Math.ceil(
|
|
@@ -8256,25 +8978,25 @@ function Calendar({
|
|
|
8256
8978
|
)
|
|
8257
8979
|
);
|
|
8258
8980
|
}
|
|
8259
|
-
return
|
|
8981
|
+
return React52__namespace.createElement(
|
|
8260
8982
|
"div",
|
|
8261
8983
|
{
|
|
8262
8984
|
className: "p-3 border rounded-lg bg-muted/50"
|
|
8263
8985
|
},
|
|
8264
|
-
|
|
8986
|
+
React52__namespace.createElement("div", { className: "space-y-2" }, elements)
|
|
8265
8987
|
);
|
|
8266
8988
|
}
|
|
8267
8989
|
if (mode === "multiple" && Array.isArray(selected) && selected.length > 0) {
|
|
8268
8990
|
const sortedDates = selected.sort((a, b) => a.getTime() - b.getTime()).slice(0, 5);
|
|
8269
8991
|
const dateElements = sortedDates.map(
|
|
8270
|
-
(date, index) =>
|
|
8992
|
+
(date, index) => React52__namespace.createElement(
|
|
8271
8993
|
"div",
|
|
8272
8994
|
{
|
|
8273
8995
|
key: index,
|
|
8274
8996
|
className: "flex items-center justify-between p-2 bg-background rounded border"
|
|
8275
8997
|
},
|
|
8276
8998
|
[
|
|
8277
|
-
|
|
8999
|
+
React52__namespace.createElement(
|
|
8278
9000
|
"span",
|
|
8279
9001
|
{
|
|
8280
9002
|
key: "date",
|
|
@@ -8286,7 +9008,7 @@ function Calendar({
|
|
|
8286
9008
|
year: "numeric"
|
|
8287
9009
|
})
|
|
8288
9010
|
),
|
|
8289
|
-
|
|
9011
|
+
React52__namespace.createElement(
|
|
8290
9012
|
"button",
|
|
8291
9013
|
{
|
|
8292
9014
|
key: "remove",
|
|
@@ -8307,18 +9029,18 @@ function Calendar({
|
|
|
8307
9029
|
)
|
|
8308
9030
|
);
|
|
8309
9031
|
const elements = [
|
|
8310
|
-
|
|
9032
|
+
React52__namespace.createElement(
|
|
8311
9033
|
"div",
|
|
8312
9034
|
{
|
|
8313
9035
|
key: "header",
|
|
8314
9036
|
className: "flex items-center gap-2 mb-2"
|
|
8315
9037
|
},
|
|
8316
9038
|
[
|
|
8317
|
-
|
|
9039
|
+
React52__namespace.createElement(lucideReact.Star, {
|
|
8318
9040
|
key: "icon",
|
|
8319
9041
|
className: "h-4 w-4 text-yellow-500"
|
|
8320
9042
|
}),
|
|
8321
|
-
|
|
9043
|
+
React52__namespace.createElement(
|
|
8322
9044
|
"span",
|
|
8323
9045
|
{
|
|
8324
9046
|
key: "label",
|
|
@@ -8328,7 +9050,7 @@ function Calendar({
|
|
|
8328
9050
|
)
|
|
8329
9051
|
]
|
|
8330
9052
|
),
|
|
8331
|
-
|
|
9053
|
+
React52__namespace.createElement(
|
|
8332
9054
|
"div",
|
|
8333
9055
|
{
|
|
8334
9056
|
key: "dates",
|
|
@@ -8339,7 +9061,7 @@ function Calendar({
|
|
|
8339
9061
|
];
|
|
8340
9062
|
if (selected.length > 5) {
|
|
8341
9063
|
elements.push(
|
|
8342
|
-
|
|
9064
|
+
React52__namespace.createElement(
|
|
8343
9065
|
"p",
|
|
8344
9066
|
{
|
|
8345
9067
|
key: "more",
|
|
@@ -8349,7 +9071,7 @@ function Calendar({
|
|
|
8349
9071
|
)
|
|
8350
9072
|
);
|
|
8351
9073
|
}
|
|
8352
|
-
return
|
|
9074
|
+
return React52__namespace.createElement(
|
|
8353
9075
|
"div",
|
|
8354
9076
|
{
|
|
8355
9077
|
className: "p-3 border rounded-lg bg-muted/50 max-h-48 overflow-y-auto"
|
|
@@ -8364,7 +9086,7 @@ function Calendar({
|
|
|
8364
9086
|
const elements = [];
|
|
8365
9087
|
if ((quickSelect || presets) && activePresets.length > 0) {
|
|
8366
9088
|
const presetButtons = activePresets.map(
|
|
8367
|
-
(preset, index) =>
|
|
9089
|
+
(preset, index) => React52__namespace.createElement(
|
|
8368
9090
|
"button",
|
|
8369
9091
|
{
|
|
8370
9092
|
key: index,
|
|
@@ -8373,19 +9095,19 @@ function Calendar({
|
|
|
8373
9095
|
},
|
|
8374
9096
|
[
|
|
8375
9097
|
preset.icon,
|
|
8376
|
-
|
|
9098
|
+
React52__namespace.createElement("span", { key: "label" }, preset.label)
|
|
8377
9099
|
]
|
|
8378
9100
|
)
|
|
8379
9101
|
);
|
|
8380
9102
|
elements.push(
|
|
8381
|
-
|
|
9103
|
+
React52__namespace.createElement(
|
|
8382
9104
|
"div",
|
|
8383
9105
|
{
|
|
8384
9106
|
key: "presets",
|
|
8385
9107
|
className: "space-y-2"
|
|
8386
9108
|
},
|
|
8387
9109
|
[
|
|
8388
|
-
|
|
9110
|
+
React52__namespace.createElement(
|
|
8389
9111
|
"h5",
|
|
8390
9112
|
{
|
|
8391
9113
|
key: "title",
|
|
@@ -8393,7 +9115,7 @@ function Calendar({
|
|
|
8393
9115
|
},
|
|
8394
9116
|
"Quick Select:"
|
|
8395
9117
|
),
|
|
8396
|
-
|
|
9118
|
+
React52__namespace.createElement(
|
|
8397
9119
|
"div",
|
|
8398
9120
|
{
|
|
8399
9121
|
key: "buttons",
|
|
@@ -8418,7 +9140,7 @@ function Calendar({
|
|
|
8418
9140
|
label = "Clear Range";
|
|
8419
9141
|
}
|
|
8420
9142
|
elements.push(
|
|
8421
|
-
|
|
9143
|
+
React52__namespace.createElement(
|
|
8422
9144
|
"button",
|
|
8423
9145
|
{
|
|
8424
9146
|
key: "clear",
|
|
@@ -8434,7 +9156,7 @@ function Calendar({
|
|
|
8434
9156
|
disabled
|
|
8435
9157
|
},
|
|
8436
9158
|
[
|
|
8437
|
-
|
|
9159
|
+
React52__namespace.createElement(lucideReact.RotateCcw, {
|
|
8438
9160
|
key: "icon",
|
|
8439
9161
|
className: "mr-1 h-3 w-3"
|
|
8440
9162
|
}),
|
|
@@ -8443,7 +9165,7 @@ function Calendar({
|
|
|
8443
9165
|
)
|
|
8444
9166
|
);
|
|
8445
9167
|
}
|
|
8446
|
-
return
|
|
9168
|
+
return React52__namespace.createElement(
|
|
8447
9169
|
"div",
|
|
8448
9170
|
{
|
|
8449
9171
|
className: cn("space-y-3", sidebarClassName)
|
|
@@ -8451,7 +9173,7 @@ function Calendar({
|
|
|
8451
9173
|
elements
|
|
8452
9174
|
);
|
|
8453
9175
|
};
|
|
8454
|
-
const calendarElement =
|
|
9176
|
+
const calendarElement = React52__namespace.createElement(reactDayPicker.DayPicker, {
|
|
8455
9177
|
showOutsideDays,
|
|
8456
9178
|
className: cn(
|
|
8457
9179
|
"bg-background group/calendar p-4 border rounded-lg shadow-sm [--cell-size:theme(spacing.10)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
@@ -8553,7 +9275,7 @@ function Calendar({
|
|
|
8553
9275
|
},
|
|
8554
9276
|
components: {
|
|
8555
9277
|
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
8556
|
-
return
|
|
9278
|
+
return React52__namespace.createElement("div", {
|
|
8557
9279
|
"data-slot": "calendar",
|
|
8558
9280
|
ref: rootRef,
|
|
8559
9281
|
className: cn(className2),
|
|
@@ -8562,28 +9284,28 @@ function Calendar({
|
|
|
8562
9284
|
},
|
|
8563
9285
|
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
8564
9286
|
if (orientation === "left") {
|
|
8565
|
-
return
|
|
9287
|
+
return React52__namespace.createElement(lucideReact.ChevronLeft, {
|
|
8566
9288
|
className: cn("size-4", className2),
|
|
8567
9289
|
...props2
|
|
8568
9290
|
});
|
|
8569
9291
|
}
|
|
8570
9292
|
if (orientation === "right") {
|
|
8571
|
-
return
|
|
9293
|
+
return React52__namespace.createElement(lucideReact.ChevronRight, {
|
|
8572
9294
|
className: cn("size-4", className2),
|
|
8573
9295
|
...props2
|
|
8574
9296
|
});
|
|
8575
9297
|
}
|
|
8576
|
-
return
|
|
9298
|
+
return React52__namespace.createElement(lucideReact.ChevronDown, {
|
|
8577
9299
|
className: cn("size-4", className2),
|
|
8578
9300
|
...props2
|
|
8579
9301
|
});
|
|
8580
9302
|
},
|
|
8581
9303
|
DayButton: CalendarDayButton,
|
|
8582
9304
|
WeekNumber: ({ children, ...props2 }) => {
|
|
8583
|
-
return
|
|
9305
|
+
return React52__namespace.createElement(
|
|
8584
9306
|
"td",
|
|
8585
9307
|
props2,
|
|
8586
|
-
|
|
9308
|
+
React52__namespace.createElement(
|
|
8587
9309
|
"div",
|
|
8588
9310
|
{
|
|
8589
9311
|
className: "flex size-10 items-center justify-center text-center text-sm font-medium text-muted-foreground"
|
|
@@ -8598,25 +9320,25 @@ function Calendar({
|
|
|
8598
9320
|
});
|
|
8599
9321
|
if (layout === "compact") {
|
|
8600
9322
|
if (withCard) {
|
|
8601
|
-
return
|
|
9323
|
+
return React52__namespace.createElement(
|
|
8602
9324
|
Card2,
|
|
8603
9325
|
{
|
|
8604
9326
|
className: cn("w-fit", cardClassName)
|
|
8605
9327
|
},
|
|
8606
|
-
|
|
9328
|
+
React52__namespace.createElement(CardContent2, { className: "p-3" }, calendarElement)
|
|
8607
9329
|
);
|
|
8608
9330
|
}
|
|
8609
9331
|
return calendarElement;
|
|
8610
9332
|
}
|
|
8611
9333
|
if (layout === "inline") {
|
|
8612
|
-
const sidebarElement2 = renderDateInfo() || renderQuickActions() ?
|
|
9334
|
+
const sidebarElement2 = renderDateInfo() || renderQuickActions() ? React52__namespace.createElement(
|
|
8613
9335
|
"div",
|
|
8614
9336
|
{
|
|
8615
9337
|
className: cn("min-w-[240px] space-y-3", sidebarClassName)
|
|
8616
9338
|
},
|
|
8617
9339
|
[renderDateInfo(), renderQuickActions()].filter(Boolean)
|
|
8618
9340
|
) : null;
|
|
8619
|
-
const content = sidebarElement2 ?
|
|
9341
|
+
const content = sidebarElement2 ? React52__namespace.createElement(
|
|
8620
9342
|
"div",
|
|
8621
9343
|
{
|
|
8622
9344
|
className: cn("flex gap-4 items-start", containerClassName)
|
|
@@ -8624,25 +9346,25 @@ function Calendar({
|
|
|
8624
9346
|
[calendarElement, sidebarElement2]
|
|
8625
9347
|
) : calendarElement;
|
|
8626
9348
|
if (withCard) {
|
|
8627
|
-
return
|
|
9349
|
+
return React52__namespace.createElement(
|
|
8628
9350
|
Card2,
|
|
8629
9351
|
{
|
|
8630
9352
|
className: cn("w-fit", cardClassName)
|
|
8631
9353
|
},
|
|
8632
9354
|
[
|
|
8633
|
-
(cardTitle || cardDescription) &&
|
|
8634
|
-
cardTitle &&
|
|
9355
|
+
(cardTitle || cardDescription) && React52__namespace.createElement(CardHeader2, { key: "header" }, [
|
|
9356
|
+
cardTitle && React52__namespace.createElement(
|
|
8635
9357
|
CardTitle2,
|
|
8636
9358
|
{ key: "title", className: "text-base" },
|
|
8637
9359
|
cardTitle
|
|
8638
9360
|
),
|
|
8639
|
-
cardDescription &&
|
|
9361
|
+
cardDescription && React52__namespace.createElement(
|
|
8640
9362
|
CardDescription2,
|
|
8641
9363
|
{ key: "desc" },
|
|
8642
9364
|
cardDescription
|
|
8643
9365
|
)
|
|
8644
9366
|
]),
|
|
8645
|
-
|
|
9367
|
+
React52__namespace.createElement(
|
|
8646
9368
|
CardContent2,
|
|
8647
9369
|
{
|
|
8648
9370
|
key: "content",
|
|
@@ -8655,7 +9377,7 @@ function Calendar({
|
|
|
8655
9377
|
}
|
|
8656
9378
|
return content;
|
|
8657
9379
|
}
|
|
8658
|
-
const sidebarElement = renderDateInfo() || renderQuickActions() ?
|
|
9380
|
+
const sidebarElement = renderDateInfo() || renderQuickActions() ? React52__namespace.createElement(
|
|
8659
9381
|
"div",
|
|
8660
9382
|
{
|
|
8661
9383
|
className: cn("min-w-[240px] space-y-3", sidebarClassName)
|
|
@@ -8663,7 +9385,7 @@ function Calendar({
|
|
|
8663
9385
|
[renderDateInfo(), renderQuickActions()].filter(Boolean)
|
|
8664
9386
|
) : null;
|
|
8665
9387
|
if (withCard) {
|
|
8666
|
-
const cardElement =
|
|
9388
|
+
const cardElement = React52__namespace.createElement(
|
|
8667
9389
|
Card2,
|
|
8668
9390
|
{
|
|
8669
9391
|
className: cn(
|
|
@@ -8674,19 +9396,19 @@ function Calendar({
|
|
|
8674
9396
|
)
|
|
8675
9397
|
},
|
|
8676
9398
|
[
|
|
8677
|
-
(cardTitle || cardDescription) &&
|
|
8678
|
-
cardTitle &&
|
|
9399
|
+
(cardTitle || cardDescription) && React52__namespace.createElement(CardHeader2, { key: "header" }, [
|
|
9400
|
+
cardTitle && React52__namespace.createElement(
|
|
8679
9401
|
CardTitle2,
|
|
8680
9402
|
{ key: "title", className: "text-base" },
|
|
8681
9403
|
cardTitle
|
|
8682
9404
|
),
|
|
8683
|
-
cardDescription &&
|
|
9405
|
+
cardDescription && React52__namespace.createElement(
|
|
8684
9406
|
CardDescription2,
|
|
8685
9407
|
{ key: "desc" },
|
|
8686
9408
|
cardDescription
|
|
8687
9409
|
)
|
|
8688
9410
|
]),
|
|
8689
|
-
|
|
9411
|
+
React52__namespace.createElement(
|
|
8690
9412
|
CardContent2,
|
|
8691
9413
|
{
|
|
8692
9414
|
key: "content",
|
|
@@ -8697,7 +9419,7 @@ function Calendar({
|
|
|
8697
9419
|
].filter(Boolean)
|
|
8698
9420
|
);
|
|
8699
9421
|
if (sidebarElement) {
|
|
8700
|
-
return
|
|
9422
|
+
return React52__namespace.createElement(
|
|
8701
9423
|
"div",
|
|
8702
9424
|
{
|
|
8703
9425
|
className: cn("flex gap-4 flex-wrap items-start", containerClassName)
|
|
@@ -8708,7 +9430,7 @@ function Calendar({
|
|
|
8708
9430
|
return cardElement;
|
|
8709
9431
|
}
|
|
8710
9432
|
if (sidebarElement) {
|
|
8711
|
-
return
|
|
9433
|
+
return React52__namespace.createElement(
|
|
8712
9434
|
"div",
|
|
8713
9435
|
{
|
|
8714
9436
|
className: cn("flex gap-4 flex-wrap items-start", containerClassName)
|
|
@@ -8725,8 +9447,8 @@ function CalendarDayButton({
|
|
|
8725
9447
|
...props
|
|
8726
9448
|
}) {
|
|
8727
9449
|
const defaultClassNames = reactDayPicker.getDefaultClassNames();
|
|
8728
|
-
const ref =
|
|
8729
|
-
|
|
9450
|
+
const ref = React52__namespace.useRef(null);
|
|
9451
|
+
React52__namespace.useEffect(() => {
|
|
8730
9452
|
if (modifiers.focused) ref.current?.focus();
|
|
8731
9453
|
}, [modifiers.focused]);
|
|
8732
9454
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10342,7 +11064,7 @@ var pickerVariants = classVarianceAuthority.cva("w-full justify-start text-left
|
|
|
10342
11064
|
variant: "outlined"
|
|
10343
11065
|
}
|
|
10344
11066
|
});
|
|
10345
|
-
var DatePicker =
|
|
11067
|
+
var DatePicker = React52__namespace.forwardRef(
|
|
10346
11068
|
({
|
|
10347
11069
|
date,
|
|
10348
11070
|
onDateChange,
|
|
@@ -10389,7 +11111,7 @@ var DatePicker = React50__namespace.forwardRef(
|
|
|
10389
11111
|
}
|
|
10390
11112
|
);
|
|
10391
11113
|
DatePicker.displayName = "DatePicker";
|
|
10392
|
-
var DateRangePicker =
|
|
11114
|
+
var DateRangePicker = React52__namespace.forwardRef(
|
|
10393
11115
|
({
|
|
10394
11116
|
dateRange,
|
|
10395
11117
|
onDateRangeChange,
|
|
@@ -10447,15 +11169,15 @@ DateRangePicker.displayName = "DateRangePicker";
|
|
|
10447
11169
|
|
|
10448
11170
|
// src/components/ui/carousel/index.tsx
|
|
10449
11171
|
init_utils();
|
|
10450
|
-
var CarouselContext =
|
|
11172
|
+
var CarouselContext = React52__namespace.createContext(null);
|
|
10451
11173
|
function useCarousel() {
|
|
10452
|
-
const context =
|
|
11174
|
+
const context = React52__namespace.useContext(CarouselContext);
|
|
10453
11175
|
if (!context) {
|
|
10454
11176
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
10455
11177
|
}
|
|
10456
11178
|
return context;
|
|
10457
11179
|
}
|
|
10458
|
-
var Carousel =
|
|
11180
|
+
var Carousel = React52__namespace.forwardRef(
|
|
10459
11181
|
({
|
|
10460
11182
|
orientation = "horizontal",
|
|
10461
11183
|
opts,
|
|
@@ -10472,22 +11194,22 @@ var Carousel = React50__namespace.forwardRef(
|
|
|
10472
11194
|
},
|
|
10473
11195
|
plugins
|
|
10474
11196
|
);
|
|
10475
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
10476
|
-
const [canScrollNext, setCanScrollNext] =
|
|
10477
|
-
const onSelect =
|
|
11197
|
+
const [canScrollPrev, setCanScrollPrev] = React52__namespace.useState(false);
|
|
11198
|
+
const [canScrollNext, setCanScrollNext] = React52__namespace.useState(false);
|
|
11199
|
+
const onSelect = React52__namespace.useCallback((api2) => {
|
|
10478
11200
|
if (!api2) {
|
|
10479
11201
|
return;
|
|
10480
11202
|
}
|
|
10481
11203
|
setCanScrollPrev(api2.canScrollPrev());
|
|
10482
11204
|
setCanScrollNext(api2.canScrollNext());
|
|
10483
11205
|
}, []);
|
|
10484
|
-
const scrollPrev =
|
|
11206
|
+
const scrollPrev = React52__namespace.useCallback(() => {
|
|
10485
11207
|
api?.scrollPrev();
|
|
10486
11208
|
}, [api]);
|
|
10487
|
-
const scrollNext =
|
|
11209
|
+
const scrollNext = React52__namespace.useCallback(() => {
|
|
10488
11210
|
api?.scrollNext();
|
|
10489
11211
|
}, [api]);
|
|
10490
|
-
const handleKeyDown =
|
|
11212
|
+
const handleKeyDown = React52__namespace.useCallback(
|
|
10491
11213
|
(event) => {
|
|
10492
11214
|
if (event.key === "ArrowLeft") {
|
|
10493
11215
|
event.preventDefault();
|
|
@@ -10499,13 +11221,13 @@ var Carousel = React50__namespace.forwardRef(
|
|
|
10499
11221
|
},
|
|
10500
11222
|
[scrollPrev, scrollNext]
|
|
10501
11223
|
);
|
|
10502
|
-
|
|
11224
|
+
React52__namespace.useEffect(() => {
|
|
10503
11225
|
if (!api || !setApi) {
|
|
10504
11226
|
return;
|
|
10505
11227
|
}
|
|
10506
11228
|
setApi(api);
|
|
10507
11229
|
}, [api, setApi]);
|
|
10508
|
-
|
|
11230
|
+
React52__namespace.useEffect(() => {
|
|
10509
11231
|
if (!api) {
|
|
10510
11232
|
return;
|
|
10511
11233
|
}
|
|
@@ -10550,7 +11272,7 @@ var Carousel = React50__namespace.forwardRef(
|
|
|
10550
11272
|
}
|
|
10551
11273
|
);
|
|
10552
11274
|
Carousel.displayName = "Carousel";
|
|
10553
|
-
var CarouselContent =
|
|
11275
|
+
var CarouselContent = React52__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
10554
11276
|
const { carouselRef, orientation } = useCarousel();
|
|
10555
11277
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: carouselRef, className: "overflow-hidden h-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10556
11278
|
"div",
|
|
@@ -10566,7 +11288,7 @@ var CarouselContent = React50__namespace.forwardRef(({ className, ...props }, re
|
|
|
10566
11288
|
) });
|
|
10567
11289
|
});
|
|
10568
11290
|
CarouselContent.displayName = "CarouselContent";
|
|
10569
|
-
var CarouselItem =
|
|
11291
|
+
var CarouselItem = React52__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
10570
11292
|
const { orientation } = useCarousel();
|
|
10571
11293
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10572
11294
|
"div",
|
|
@@ -10584,7 +11306,7 @@ var CarouselItem = React50__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
10584
11306
|
);
|
|
10585
11307
|
});
|
|
10586
11308
|
CarouselItem.displayName = "CarouselItem";
|
|
10587
|
-
var CarouselPrevious =
|
|
11309
|
+
var CarouselPrevious = React52__namespace.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
10588
11310
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
10589
11311
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10590
11312
|
Button,
|
|
@@ -10608,7 +11330,7 @@ var CarouselPrevious = React50__namespace.forwardRef(({ className, variant = "ou
|
|
|
10608
11330
|
);
|
|
10609
11331
|
});
|
|
10610
11332
|
CarouselPrevious.displayName = "CarouselPrevious";
|
|
10611
|
-
var CarouselNext =
|
|
11333
|
+
var CarouselNext = React52__namespace.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
10612
11334
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
10613
11335
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10614
11336
|
Button,
|
|
@@ -10647,10 +11369,10 @@ function SimpleCarousel({
|
|
|
10647
11369
|
nextArrow,
|
|
10648
11370
|
onSlideChange
|
|
10649
11371
|
}) {
|
|
10650
|
-
const [api, setApi] =
|
|
10651
|
-
const [current, setCurrent] =
|
|
10652
|
-
const [count, setCount] =
|
|
10653
|
-
|
|
11372
|
+
const [api, setApi] = React52__namespace.useState();
|
|
11373
|
+
const [current, setCurrent] = React52__namespace.useState(0);
|
|
11374
|
+
const [count, setCount] = React52__namespace.useState(0);
|
|
11375
|
+
React52__namespace.useEffect(() => {
|
|
10654
11376
|
if (!api) {
|
|
10655
11377
|
return;
|
|
10656
11378
|
}
|
|
@@ -10662,7 +11384,7 @@ function SimpleCarousel({
|
|
|
10662
11384
|
onSlideChange?.(selectedIndex);
|
|
10663
11385
|
});
|
|
10664
11386
|
}, [api, onSlideChange]);
|
|
10665
|
-
|
|
11387
|
+
React52__namespace.useEffect(() => {
|
|
10666
11388
|
if (!api || !autoPlay) {
|
|
10667
11389
|
return;
|
|
10668
11390
|
}
|
|
@@ -10812,7 +11534,7 @@ var typeToTag = {
|
|
|
10812
11534
|
list: "ul",
|
|
10813
11535
|
"list-item": "li"
|
|
10814
11536
|
};
|
|
10815
|
-
var Typography =
|
|
11537
|
+
var Typography = React52__namespace.forwardRef(
|
|
10816
11538
|
({
|
|
10817
11539
|
type,
|
|
10818
11540
|
size,
|
|
@@ -10849,7 +11571,7 @@ var Typography = React50__namespace.forwardRef(
|
|
|
10849
11571
|
);
|
|
10850
11572
|
Typography.displayName = "Typography";
|
|
10851
11573
|
function createWrapper(fixedType) {
|
|
10852
|
-
return
|
|
11574
|
+
return React52__namespace.forwardRef(
|
|
10853
11575
|
({ ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(Typography, { ref, type: fixedType, ...props })
|
|
10854
11576
|
);
|
|
10855
11577
|
}
|
|
@@ -10952,6 +11674,13 @@ var tooltipStyle = {
|
|
|
10952
11674
|
boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
|
|
10953
11675
|
color: "var(--foreground)"
|
|
10954
11676
|
};
|
|
11677
|
+
var tooltipLabelStyle = {
|
|
11678
|
+
color: "var(--foreground)",
|
|
11679
|
+
fontWeight: 500
|
|
11680
|
+
};
|
|
11681
|
+
var tooltipItemStyle = {
|
|
11682
|
+
color: "var(--foreground)"
|
|
11683
|
+
};
|
|
10955
11684
|
var legendStyle = {
|
|
10956
11685
|
fontSize: "12px",
|
|
10957
11686
|
color: "var(--muted-foreground, #616875)"
|
|
@@ -11002,7 +11731,8 @@ function LineChart({
|
|
|
11002
11731
|
recharts.Tooltip,
|
|
11003
11732
|
{
|
|
11004
11733
|
contentStyle: tooltipStyle,
|
|
11005
|
-
labelStyle:
|
|
11734
|
+
labelStyle: tooltipLabelStyle,
|
|
11735
|
+
itemStyle: tooltipItemStyle
|
|
11006
11736
|
}
|
|
11007
11737
|
),
|
|
11008
11738
|
showLegend && /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, {}),
|
|
@@ -11094,7 +11824,8 @@ function BarChart({
|
|
|
11094
11824
|
recharts.Tooltip,
|
|
11095
11825
|
{
|
|
11096
11826
|
contentStyle: tooltipStyle,
|
|
11097
|
-
labelStyle:
|
|
11827
|
+
labelStyle: tooltipLabelStyle,
|
|
11828
|
+
itemStyle: tooltipItemStyle
|
|
11098
11829
|
}
|
|
11099
11830
|
),
|
|
11100
11831
|
showLegend && /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, {}),
|
|
@@ -11154,7 +11885,8 @@ function PieChart({
|
|
|
11154
11885
|
recharts.Tooltip,
|
|
11155
11886
|
{
|
|
11156
11887
|
contentStyle: tooltipStyle,
|
|
11157
|
-
labelStyle:
|
|
11888
|
+
labelStyle: tooltipLabelStyle,
|
|
11889
|
+
itemStyle: tooltipItemStyle
|
|
11158
11890
|
}
|
|
11159
11891
|
),
|
|
11160
11892
|
showLegend && /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, {})
|
|
@@ -11204,7 +11936,8 @@ function AreaChart({
|
|
|
11204
11936
|
recharts.Tooltip,
|
|
11205
11937
|
{
|
|
11206
11938
|
contentStyle: tooltipStyle,
|
|
11207
|
-
labelStyle:
|
|
11939
|
+
labelStyle: tooltipLabelStyle,
|
|
11940
|
+
itemStyle: tooltipItemStyle
|
|
11208
11941
|
}
|
|
11209
11942
|
),
|
|
11210
11943
|
showLegend && /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, {}),
|
|
@@ -11275,7 +12008,8 @@ function ScatterChart({
|
|
|
11275
12008
|
recharts.Tooltip,
|
|
11276
12009
|
{
|
|
11277
12010
|
contentStyle: tooltipStyle,
|
|
11278
|
-
labelStyle:
|
|
12011
|
+
labelStyle: tooltipLabelStyle,
|
|
12012
|
+
itemStyle: tooltipItemStyle,
|
|
11279
12013
|
cursor: { strokeDasharray: "3 3" }
|
|
11280
12014
|
}
|
|
11281
12015
|
),
|
|
@@ -11333,7 +12067,8 @@ function RadarChart({
|
|
|
11333
12067
|
recharts.Tooltip,
|
|
11334
12068
|
{
|
|
11335
12069
|
contentStyle: tooltipStyle,
|
|
11336
|
-
labelStyle:
|
|
12070
|
+
labelStyle: tooltipLabelStyle,
|
|
12071
|
+
itemStyle: tooltipItemStyle
|
|
11337
12072
|
}
|
|
11338
12073
|
),
|
|
11339
12074
|
showLegend && /* @__PURE__ */ jsxRuntime.jsx(recharts.Legend, {}),
|
|
@@ -11482,17 +12217,17 @@ function initializeTheme() {
|
|
|
11482
12217
|
} catch {
|
|
11483
12218
|
}
|
|
11484
12219
|
}
|
|
11485
|
-
var ThemeContext =
|
|
12220
|
+
var ThemeContext = React52.createContext(void 0);
|
|
11486
12221
|
function ThemeProvider({
|
|
11487
12222
|
children,
|
|
11488
12223
|
defaultTheme = "default",
|
|
11489
12224
|
defaultMode = "system",
|
|
11490
12225
|
storageKey = "mvn-theme"
|
|
11491
12226
|
}) {
|
|
11492
|
-
const [theme, setThemeState] =
|
|
11493
|
-
const [mode, setModeState] =
|
|
11494
|
-
const [resolvedMode, setResolvedMode] =
|
|
11495
|
-
|
|
12227
|
+
const [theme, setThemeState] = React52.useState(defaultTheme);
|
|
12228
|
+
const [mode, setModeState] = React52.useState(defaultMode);
|
|
12229
|
+
const [resolvedMode, setResolvedMode] = React52.useState("light");
|
|
12230
|
+
React52.useEffect(() => {
|
|
11496
12231
|
try {
|
|
11497
12232
|
const savedTheme = localStorage.getItem(storageKey);
|
|
11498
12233
|
const savedMode = localStorage.getItem(`${storageKey}-mode`);
|
|
@@ -11505,7 +12240,7 @@ function ThemeProvider({
|
|
|
11505
12240
|
} catch {
|
|
11506
12241
|
}
|
|
11507
12242
|
}, [storageKey]);
|
|
11508
|
-
|
|
12243
|
+
React52.useEffect(() => {
|
|
11509
12244
|
const html = document.documentElement;
|
|
11510
12245
|
for (const t of Object.keys(THEMES)) {
|
|
11511
12246
|
if (t !== "default") {
|
|
@@ -11520,7 +12255,7 @@ function ThemeProvider({
|
|
|
11520
12255
|
} catch {
|
|
11521
12256
|
}
|
|
11522
12257
|
}, [theme, storageKey]);
|
|
11523
|
-
|
|
12258
|
+
React52.useEffect(() => {
|
|
11524
12259
|
const html = document.documentElement;
|
|
11525
12260
|
const applyMode = (isDark) => {
|
|
11526
12261
|
html.classList.toggle("dark", isDark);
|
|
@@ -11550,7 +12285,7 @@ function ThemeProvider({
|
|
|
11550
12285
|
return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value, children });
|
|
11551
12286
|
}
|
|
11552
12287
|
function useTheme2() {
|
|
11553
|
-
const context =
|
|
12288
|
+
const context = React52.useContext(ThemeContext);
|
|
11554
12289
|
if (!context) {
|
|
11555
12290
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
11556
12291
|
}
|
|
@@ -11660,9 +12395,11 @@ exports.Avatar = Avatar;
|
|
|
11660
12395
|
exports.AvatarFallback = AvatarFallback;
|
|
11661
12396
|
exports.AvatarGroup = AvatarGroup;
|
|
11662
12397
|
exports.AvatarImage = AvatarImage;
|
|
12398
|
+
exports.BREAKPOINTS = BREAKPOINTS;
|
|
11663
12399
|
exports.Badge = Badge;
|
|
11664
12400
|
exports.BarChart = BarChart;
|
|
11665
12401
|
exports.Blockquote = Blockquote;
|
|
12402
|
+
exports.BottomNavigation = BottomNavigation;
|
|
11666
12403
|
exports.Breadcrumb = Breadcrumb;
|
|
11667
12404
|
exports.BreadcrumbEllipsis = BreadcrumbEllipsis;
|
|
11668
12405
|
exports.BreadcrumbItem = BreadcrumbItem;
|
|
@@ -11797,6 +12534,8 @@ exports.MenubarSub = MenubarSub;
|
|
|
11797
12534
|
exports.MenubarSubContent = MenubarSubContent;
|
|
11798
12535
|
exports.MenubarSubTrigger = MenubarSubTrigger;
|
|
11799
12536
|
exports.MenubarTrigger = MenubarTrigger;
|
|
12537
|
+
exports.MobileHeader = MobileHeader;
|
|
12538
|
+
exports.MobileNavigationProvider = MobileNavigationProvider;
|
|
11800
12539
|
exports.Muted = Muted;
|
|
11801
12540
|
exports.NavigationMenu = NavigationMenu;
|
|
11802
12541
|
exports.NavigationMenuContent = NavigationMenuContent;
|
|
@@ -11946,12 +12685,14 @@ exports.numberRule = numberRule;
|
|
|
11946
12685
|
exports.patternRule = patternRule;
|
|
11947
12686
|
exports.progressVariants = progressVariants;
|
|
11948
12687
|
exports.radioGroupVariants = radioGroupVariants;
|
|
12688
|
+
exports.radioItemVariants = radioItemVariants;
|
|
11949
12689
|
exports.requiredRule = requiredRule;
|
|
11950
12690
|
exports.separatorVariants = separatorVariants;
|
|
11951
12691
|
exports.setMode = setMode;
|
|
11952
12692
|
exports.setTheme = setTheme;
|
|
11953
12693
|
exports.skeletonVariants = skeletonVariants;
|
|
11954
12694
|
exports.spinnerVariants = spinnerVariants;
|
|
12695
|
+
exports.switchVariants = switchVariants;
|
|
11955
12696
|
exports.tableVariants = tableVariants;
|
|
11956
12697
|
exports.textareaVariants = textareaVariants;
|
|
11957
12698
|
exports.toastVariants = toastVariants;
|
|
@@ -11959,9 +12700,16 @@ exports.toggleGroupVariants = toggleGroupVariants;
|
|
|
11959
12700
|
exports.toggleVariants = toggleVariants;
|
|
11960
12701
|
exports.tooltipStyle = tooltipStyle;
|
|
11961
12702
|
exports.urlRule = urlRule;
|
|
12703
|
+
exports.useBreakpoint = useBreakpoint;
|
|
12704
|
+
exports.useBreakpointValue = useBreakpointValue;
|
|
11962
12705
|
exports.useCarousel = useCarousel;
|
|
11963
12706
|
exports.useForm = useForm;
|
|
12707
|
+
exports.useIsDesktop = useIsDesktop;
|
|
12708
|
+
exports.useIsMobile = useIsMobile;
|
|
12709
|
+
exports.useIsTablet = useIsTablet;
|
|
12710
|
+
exports.useMobileNav = useMobileNav;
|
|
11964
12711
|
exports.useSidebar = useSidebar;
|
|
12712
|
+
exports.useSwipeActions = useSwipeActions;
|
|
11965
12713
|
exports.useTheme = useTheme2;
|
|
11966
12714
|
exports.useToast = useToast;
|
|
11967
12715
|
exports.useWatch = useWatch;
|