@mvn-ui/react 0.1.3 → 0.1.5
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 +138 -26
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +638 -34
- package/dist/index.d.ts +638 -34
- package/dist/index.js +2453 -698
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2225 -582
- package/dist/index.mjs.map +1 -1
- package/dist/themes.css +653 -0
- package/package.json +5 -3
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
3
|
+
import * as React52 from 'react';
|
|
4
|
+
import React52__default, { createContext, forwardRef, useRef, useState, useEffect, useImperativeHandle, useCallback, useMemo, useContext, cloneElement, Fragment as Fragment$1 } from 'react';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { Slot } from '@radix-ui/react-slot';
|
|
8
|
-
import { Loader2Icon, XIcon, EyeOffIcon, EyeIcon, ChevronDownIcon, ChevronUpIcon, CheckIcon, MinusIcon, CircleIcon, X, InboxIcon, ChevronRightIcon, ChevronsUpDownIcon, CalendarIcon, ArrowLeft, ArrowRight, Calendar as Calendar$1, ChevronLeft, ChevronRight, ChevronDown, Star, RotateCcw, MoreHorizontalIcon, ChevronLeftIcon, ChevronsLeftIcon, ChevronsRightIcon, GripVerticalIcon, PanelLeftIcon, FileDown, SearchIcon,
|
|
8
|
+
import { Loader2Icon, XIcon, EyeOffIcon, EyeIcon, ChevronDownIcon, ChevronUpIcon, CheckIcon, MinusIcon, CircleIcon, X, InboxIcon, ChevronRightIcon, ChevronsUpDownIcon, CalendarIcon, ArrowLeft, ArrowRight, Calendar as Calendar$1, ChevronLeft, ChevronRight, ChevronDown, Star, RotateCcw, MoreHorizontalIcon, ChevronLeftIcon, ChevronsLeftIcon, ChevronsRightIcon, GripVerticalIcon, PanelLeftIcon, MenuIcon, FileDown, SearchIcon, ArrowUp, ArrowDown, MoreHorizontal, Pin, ListFilter, Minus, Plus } from 'lucide-react';
|
|
9
9
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
10
10
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
11
11
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
@@ -43,6 +43,8 @@ import isEqual from 'react-fast-compare';
|
|
|
43
43
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
44
44
|
import { getDefaultClassNames, DayPicker } from 'react-day-picker';
|
|
45
45
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
46
|
+
import { ResponsiveContainer, LineChart as LineChart$1, CartesianGrid, XAxis, YAxis, Tooltip as Tooltip$1, Legend, Line, BarChart as BarChart$1, Bar, PieChart as PieChart$1, Pie, Cell, AreaChart as AreaChart$1, Area, ScatterChart as ScatterChart$1, ZAxis, Scatter, RadarChart as RadarChart$1, PolarGrid, PolarAngleAxis, PolarRadiusAxis, Radar } from 'recharts';
|
|
47
|
+
export { Area, Bar, Brush, CartesianGrid, Cell, Legend as ChartLegend, Tooltip as ChartTooltip, Line, Pie, PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, ReferenceArea, ReferenceLine, ResponsiveContainer, Scatter, XAxis, YAxis, ZAxis } from 'recharts';
|
|
46
48
|
|
|
47
49
|
var __defProp = Object.defineProperty;
|
|
48
50
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -286,7 +288,7 @@ var init_card = __esm({
|
|
|
286
288
|
}
|
|
287
289
|
}
|
|
288
290
|
);
|
|
289
|
-
Card =
|
|
291
|
+
Card = React52.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
290
292
|
"div",
|
|
291
293
|
{
|
|
292
294
|
ref,
|
|
@@ -295,7 +297,7 @@ var init_card = __esm({
|
|
|
295
297
|
}
|
|
296
298
|
));
|
|
297
299
|
Card.displayName = "Card";
|
|
298
|
-
CardHeader =
|
|
300
|
+
CardHeader = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
299
301
|
"div",
|
|
300
302
|
{
|
|
301
303
|
ref,
|
|
@@ -304,7 +306,7 @@ var init_card = __esm({
|
|
|
304
306
|
}
|
|
305
307
|
));
|
|
306
308
|
CardHeader.displayName = "CardHeader";
|
|
307
|
-
CardTitle =
|
|
309
|
+
CardTitle = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
308
310
|
"h3",
|
|
309
311
|
{
|
|
310
312
|
ref,
|
|
@@ -313,7 +315,7 @@ var init_card = __esm({
|
|
|
313
315
|
}
|
|
314
316
|
));
|
|
315
317
|
CardTitle.displayName = "CardTitle";
|
|
316
|
-
CardDescription =
|
|
318
|
+
CardDescription = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
317
319
|
"div",
|
|
318
320
|
{
|
|
319
321
|
ref,
|
|
@@ -322,9 +324,9 @@ var init_card = __esm({
|
|
|
322
324
|
}
|
|
323
325
|
));
|
|
324
326
|
CardDescription.displayName = "CardDescription";
|
|
325
|
-
CardContent =
|
|
327
|
+
CardContent = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
326
328
|
CardContent.displayName = "CardContent";
|
|
327
|
-
CardFooter =
|
|
329
|
+
CardFooter = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
328
330
|
"div",
|
|
329
331
|
{
|
|
330
332
|
ref,
|
|
@@ -335,6 +337,132 @@ var init_card = __esm({
|
|
|
335
337
|
CardFooter.displayName = "CardFooter";
|
|
336
338
|
}
|
|
337
339
|
});
|
|
340
|
+
var BREAKPOINTS = {
|
|
341
|
+
sm: 640,
|
|
342
|
+
md: 768,
|
|
343
|
+
lg: 1024,
|
|
344
|
+
xl: 1280
|
|
345
|
+
};
|
|
346
|
+
function useBreakpoint(ssrFallback = "md") {
|
|
347
|
+
const [breakpoint, setBreakpoint] = useState(ssrFallback);
|
|
348
|
+
useEffect(() => {
|
|
349
|
+
const getBreakpoint = () => {
|
|
350
|
+
const width = window.innerWidth;
|
|
351
|
+
if (width >= BREAKPOINTS.xl) return "xl";
|
|
352
|
+
if (width >= BREAKPOINTS.lg) return "lg";
|
|
353
|
+
if (width >= BREAKPOINTS.md) return "md";
|
|
354
|
+
if (width >= BREAKPOINTS.sm) return "sm";
|
|
355
|
+
return "xs";
|
|
356
|
+
};
|
|
357
|
+
setBreakpoint(getBreakpoint());
|
|
358
|
+
let timeoutId;
|
|
359
|
+
const handleResize = () => {
|
|
360
|
+
clearTimeout(timeoutId);
|
|
361
|
+
timeoutId = setTimeout(() => setBreakpoint(getBreakpoint()), 150);
|
|
362
|
+
};
|
|
363
|
+
window.addEventListener("resize", handleResize);
|
|
364
|
+
return () => {
|
|
365
|
+
window.removeEventListener("resize", handleResize);
|
|
366
|
+
clearTimeout(timeoutId);
|
|
367
|
+
};
|
|
368
|
+
}, []);
|
|
369
|
+
return breakpoint;
|
|
370
|
+
}
|
|
371
|
+
function useBreakpointValue(values, fallback) {
|
|
372
|
+
const breakpoint = useBreakpoint();
|
|
373
|
+
return useMemo(() => {
|
|
374
|
+
const order = ["xs", "sm", "md", "lg", "xl"];
|
|
375
|
+
const currentIndex = order.indexOf(breakpoint);
|
|
376
|
+
for (let i = currentIndex; i >= 0; i--) {
|
|
377
|
+
const bp = order[i];
|
|
378
|
+
if (values[bp] !== void 0) {
|
|
379
|
+
return values[bp];
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return fallback;
|
|
383
|
+
}, [breakpoint, values, fallback]);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// src/hooks/useIsMobile.ts
|
|
387
|
+
function useIsMobile(ssrFallback = false) {
|
|
388
|
+
const fallbackBreakpoint = ssrFallback ? "xs" : "md";
|
|
389
|
+
const breakpoint = useBreakpoint(fallbackBreakpoint);
|
|
390
|
+
return breakpoint === "xs" || breakpoint === "sm";
|
|
391
|
+
}
|
|
392
|
+
function useIsTablet() {
|
|
393
|
+
const breakpoint = useBreakpoint();
|
|
394
|
+
return breakpoint === "md";
|
|
395
|
+
}
|
|
396
|
+
function useIsDesktop() {
|
|
397
|
+
const breakpoint = useBreakpoint();
|
|
398
|
+
return breakpoint === "lg" || breakpoint === "xl";
|
|
399
|
+
}
|
|
400
|
+
function useSwipeActions({
|
|
401
|
+
leftActions = [],
|
|
402
|
+
rightActions = [],
|
|
403
|
+
threshold = 80,
|
|
404
|
+
disabled = false
|
|
405
|
+
} = {}) {
|
|
406
|
+
const [offsetX, setOffsetX] = useState(0);
|
|
407
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
408
|
+
const [revealed, setRevealed] = useState(null);
|
|
409
|
+
const startX = useRef(0);
|
|
410
|
+
const currentOffsetX = useRef(0);
|
|
411
|
+
currentOffsetX.current = offsetX;
|
|
412
|
+
const reset = useCallback(() => {
|
|
413
|
+
setOffsetX(0);
|
|
414
|
+
setRevealed(null);
|
|
415
|
+
}, []);
|
|
416
|
+
const handleTouchStart = useCallback(
|
|
417
|
+
(e) => {
|
|
418
|
+
if (disabled) return;
|
|
419
|
+
startX.current = e.touches[0].clientX;
|
|
420
|
+
setIsDragging(true);
|
|
421
|
+
},
|
|
422
|
+
[disabled]
|
|
423
|
+
);
|
|
424
|
+
const handleTouchMove = useCallback(
|
|
425
|
+
(e) => {
|
|
426
|
+
if (disabled || !isDragging) return;
|
|
427
|
+
const currentX = e.touches[0].clientX;
|
|
428
|
+
const deltaX = currentX - startX.current;
|
|
429
|
+
const maxLeft = rightActions.length > 0 ? -threshold * 1.5 : 0;
|
|
430
|
+
const maxRight = leftActions.length > 0 ? threshold * 1.5 : 0;
|
|
431
|
+
const clampedX = Math.max(maxLeft, Math.min(maxRight, deltaX));
|
|
432
|
+
setOffsetX(clampedX);
|
|
433
|
+
},
|
|
434
|
+
[disabled, isDragging, threshold, leftActions.length, rightActions.length]
|
|
435
|
+
);
|
|
436
|
+
const handleTouchEnd = useCallback(() => {
|
|
437
|
+
setIsDragging(false);
|
|
438
|
+
const offset = currentOffsetX.current;
|
|
439
|
+
if (Math.abs(offset) >= threshold) {
|
|
440
|
+
if (offset < 0 && rightActions.length > 0) {
|
|
441
|
+
setRevealed("right");
|
|
442
|
+
setOffsetX(-threshold);
|
|
443
|
+
} else if (offset > 0 && leftActions.length > 0) {
|
|
444
|
+
setRevealed("left");
|
|
445
|
+
setOffsetX(threshold);
|
|
446
|
+
} else {
|
|
447
|
+
reset();
|
|
448
|
+
}
|
|
449
|
+
} else {
|
|
450
|
+
reset();
|
|
451
|
+
}
|
|
452
|
+
}, [threshold, leftActions.length, rightActions.length, reset]);
|
|
453
|
+
const computedOffsetX = revealed === "right" ? -threshold : revealed === "left" ? threshold : offsetX;
|
|
454
|
+
return {
|
|
455
|
+
offsetX: computedOffsetX,
|
|
456
|
+
revealed,
|
|
457
|
+
isDragging,
|
|
458
|
+
handlers: {
|
|
459
|
+
onTouchStart: handleTouchStart,
|
|
460
|
+
onTouchMove: handleTouchMove,
|
|
461
|
+
onTouchEnd: handleTouchEnd
|
|
462
|
+
},
|
|
463
|
+
reset
|
|
464
|
+
};
|
|
465
|
+
}
|
|
338
466
|
|
|
339
467
|
// src/components/ui/button/index.tsx
|
|
340
468
|
init_utils();
|
|
@@ -354,8 +482,10 @@ var buttonVariants = cva(
|
|
|
354
482
|
default: "h-10 px-4 py-2.5 rounded-md text-[0.9375rem]",
|
|
355
483
|
sm: "h-8 px-3 py-1.5 rounded text-sm",
|
|
356
484
|
lg: "h-12 px-5 py-3 rounded-md text-base",
|
|
485
|
+
touch: "h-11 min-h-[44px] px-4 py-2.5 rounded-md text-base",
|
|
357
486
|
icon: "h-10 w-10 rounded-md",
|
|
358
|
-
"icon-sm": "h-8 w-8 rounded"
|
|
487
|
+
"icon-sm": "h-8 w-8 rounded",
|
|
488
|
+
"icon-touch": "h-11 w-11 min-h-[44px] min-w-[44px] rounded-md"
|
|
359
489
|
},
|
|
360
490
|
fullWidth: {
|
|
361
491
|
true: "w-full"
|
|
@@ -367,7 +497,7 @@ var buttonVariants = cva(
|
|
|
367
497
|
}
|
|
368
498
|
}
|
|
369
499
|
);
|
|
370
|
-
var Button =
|
|
500
|
+
var Button = React52.forwardRef(
|
|
371
501
|
({
|
|
372
502
|
className,
|
|
373
503
|
variant,
|
|
@@ -417,7 +547,7 @@ var Button = React49.forwardRef(
|
|
|
417
547
|
}
|
|
418
548
|
);
|
|
419
549
|
Button.displayName = "Button";
|
|
420
|
-
var IconButton =
|
|
550
|
+
var IconButton = React52.forwardRef(
|
|
421
551
|
({ icon, size = "icon", className, ...props }, ref) => {
|
|
422
552
|
return /* @__PURE__ */ jsx(Button, { ref, size, className, ...props, children: icon });
|
|
423
553
|
}
|
|
@@ -500,9 +630,10 @@ var inputVariants = cva(
|
|
|
500
630
|
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"
|
|
501
631
|
},
|
|
502
632
|
inputSize: {
|
|
503
|
-
sm: "h-8 text-
|
|
504
|
-
default: "h-10 text-
|
|
505
|
-
lg: "h-12 text-base px-4 py-3 rounded-md"
|
|
633
|
+
sm: "h-8 text-base px-2.5 py-1.5 rounded",
|
|
634
|
+
default: "h-10 text-base px-3.5 py-2.5 rounded-md",
|
|
635
|
+
lg: "h-12 text-base px-4 py-3 rounded-md",
|
|
636
|
+
touch: "h-11 min-h-[44px] text-base px-3.5 py-2.5 rounded-md"
|
|
506
637
|
}
|
|
507
638
|
},
|
|
508
639
|
defaultVariants: {
|
|
@@ -511,7 +642,7 @@ var inputVariants = cva(
|
|
|
511
642
|
}
|
|
512
643
|
}
|
|
513
644
|
);
|
|
514
|
-
var Input =
|
|
645
|
+
var Input = React52.forwardRef(
|
|
515
646
|
({
|
|
516
647
|
className,
|
|
517
648
|
containerClassName,
|
|
@@ -529,12 +660,12 @@ var Input = React49.forwardRef(
|
|
|
529
660
|
value,
|
|
530
661
|
...props
|
|
531
662
|
}, ref) => {
|
|
532
|
-
const [showPassword, setShowPassword] =
|
|
533
|
-
const [internalValue, setInternalValue] =
|
|
534
|
-
const generatedId =
|
|
663
|
+
const [showPassword, setShowPassword] = React52.useState(false);
|
|
664
|
+
const [internalValue, setInternalValue] = React52.useState(value || "");
|
|
665
|
+
const generatedId = React52.useId();
|
|
535
666
|
const inputId = id || generatedId;
|
|
536
667
|
const hasError = !!error;
|
|
537
|
-
|
|
668
|
+
React52.useEffect(() => {
|
|
538
669
|
setInternalValue(value || "");
|
|
539
670
|
}, [value]);
|
|
540
671
|
const handleClear = () => {
|
|
@@ -643,7 +774,7 @@ var labelVariants = cva(
|
|
|
643
774
|
}
|
|
644
775
|
}
|
|
645
776
|
);
|
|
646
|
-
var Label =
|
|
777
|
+
var Label = React52.forwardRef(({ className, variant, required, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
647
778
|
LabelPrimitive.Root,
|
|
648
779
|
{
|
|
649
780
|
ref,
|
|
@@ -684,7 +815,7 @@ var textareaVariants = cva(
|
|
|
684
815
|
}
|
|
685
816
|
}
|
|
686
817
|
);
|
|
687
|
-
var Textarea =
|
|
818
|
+
var Textarea = React52.forwardRef(
|
|
688
819
|
({
|
|
689
820
|
className,
|
|
690
821
|
containerClassName,
|
|
@@ -702,8 +833,8 @@ var Textarea = React49.forwardRef(
|
|
|
702
833
|
id,
|
|
703
834
|
...props
|
|
704
835
|
}, ref) => {
|
|
705
|
-
const internalRef =
|
|
706
|
-
const [charCount, setCharCount] =
|
|
836
|
+
const internalRef = React52.useRef(null);
|
|
837
|
+
const [charCount, setCharCount] = React52.useState(0);
|
|
707
838
|
const textareaRef = (node) => {
|
|
708
839
|
internalRef.current = node;
|
|
709
840
|
if (typeof ref === "function") {
|
|
@@ -712,14 +843,14 @@ var Textarea = React49.forwardRef(
|
|
|
712
843
|
ref.current = node;
|
|
713
844
|
}
|
|
714
845
|
};
|
|
715
|
-
|
|
846
|
+
React52.useEffect(() => {
|
|
716
847
|
if (autoResize && internalRef.current) {
|
|
717
848
|
const textarea = internalRef.current;
|
|
718
849
|
textarea.style.height = "auto";
|
|
719
850
|
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
720
851
|
}
|
|
721
852
|
}, [value, autoResize]);
|
|
722
|
-
const handleChange =
|
|
853
|
+
const handleChange = React52.useCallback(
|
|
723
854
|
(e) => {
|
|
724
855
|
if (showCount || maxLength) {
|
|
725
856
|
setCharCount(e.target.value.length);
|
|
@@ -728,13 +859,13 @@ var Textarea = React49.forwardRef(
|
|
|
728
859
|
},
|
|
729
860
|
[onChange, showCount, maxLength]
|
|
730
861
|
);
|
|
731
|
-
|
|
862
|
+
React52.useEffect(() => {
|
|
732
863
|
if (showCount || maxLength) {
|
|
733
864
|
setCharCount(String(value || "").length);
|
|
734
865
|
}
|
|
735
866
|
}, [value, showCount, maxLength]);
|
|
736
867
|
const hasError = !!error;
|
|
737
|
-
const generatedId =
|
|
868
|
+
const generatedId = React52.useId();
|
|
738
869
|
const textareaId = id || generatedId;
|
|
739
870
|
return /* @__PURE__ */ jsxs("div", { className: cn("w-full space-y-2", containerClassName), children: [
|
|
740
871
|
label && /* @__PURE__ */ jsx(
|
|
@@ -795,10 +926,10 @@ Textarea.displayName = "Textarea";
|
|
|
795
926
|
|
|
796
927
|
// src/components/ui/select/index.tsx
|
|
797
928
|
init_utils();
|
|
798
|
-
var Select =
|
|
929
|
+
var Select = React52.forwardRef(
|
|
799
930
|
({ children, value, onValueChange, ...props }, _ref) => {
|
|
800
|
-
const [internalValue, setInternalValue] =
|
|
801
|
-
|
|
931
|
+
const [internalValue, setInternalValue] = React52.useState(value ?? "");
|
|
932
|
+
React52.useEffect(() => {
|
|
802
933
|
setInternalValue(value ?? "");
|
|
803
934
|
}, [value]);
|
|
804
935
|
const handleValueChange = (newValue) => {
|
|
@@ -820,7 +951,7 @@ Select.displayName = "Select";
|
|
|
820
951
|
var SelectGroup = SelectPrimitive.Group;
|
|
821
952
|
var SelectValue = SelectPrimitive.Value;
|
|
822
953
|
var triggerVariants = cva(
|
|
823
|
-
"flex
|
|
954
|
+
"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",
|
|
824
955
|
{
|
|
825
956
|
variants: {
|
|
826
957
|
variant: {
|
|
@@ -828,18 +959,25 @@ var triggerVariants = cva(
|
|
|
828
959
|
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",
|
|
829
960
|
borderless: "rounded-md border border-transparent bg-transparent px-3.5 py-2.5 shadow-none",
|
|
830
961
|
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"
|
|
962
|
+
},
|
|
963
|
+
size: {
|
|
964
|
+
sm: "h-8 text-sm px-2.5",
|
|
965
|
+
default: "h-10",
|
|
966
|
+
lg: "h-12 text-base px-4",
|
|
967
|
+
touch: "h-11 min-h-[44px] text-base"
|
|
831
968
|
}
|
|
832
969
|
},
|
|
833
970
|
defaultVariants: {
|
|
834
|
-
variant: "outlined"
|
|
971
|
+
variant: "outlined",
|
|
972
|
+
size: "default"
|
|
835
973
|
}
|
|
836
974
|
}
|
|
837
975
|
);
|
|
838
|
-
var SelectTrigger =
|
|
976
|
+
var SelectTrigger = React52.forwardRef(({ className, children, variant, size, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
839
977
|
SelectPrimitive.Trigger,
|
|
840
978
|
{
|
|
841
979
|
ref,
|
|
842
|
-
className: cn(triggerVariants({ variant }), className),
|
|
980
|
+
className: cn(triggerVariants({ variant, size }), className),
|
|
843
981
|
...props,
|
|
844
982
|
children: [
|
|
845
983
|
children,
|
|
@@ -848,7 +986,7 @@ var SelectTrigger = React49.forwardRef(({ className, children, variant, ...props
|
|
|
848
986
|
}
|
|
849
987
|
));
|
|
850
988
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
851
|
-
var SelectScrollUpButton =
|
|
989
|
+
var SelectScrollUpButton = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
852
990
|
SelectPrimitive.ScrollUpButton,
|
|
853
991
|
{
|
|
854
992
|
ref,
|
|
@@ -861,7 +999,7 @@ var SelectScrollUpButton = React49.forwardRef(({ className, ...props }, ref) =>
|
|
|
861
999
|
}
|
|
862
1000
|
));
|
|
863
1001
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
864
|
-
var SelectScrollDownButton =
|
|
1002
|
+
var SelectScrollDownButton = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
865
1003
|
SelectPrimitive.ScrollDownButton,
|
|
866
1004
|
{
|
|
867
1005
|
ref,
|
|
@@ -874,7 +1012,7 @@ var SelectScrollDownButton = React49.forwardRef(({ className, ...props }, ref) =
|
|
|
874
1012
|
}
|
|
875
1013
|
));
|
|
876
1014
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
877
|
-
var SelectContent =
|
|
1015
|
+
var SelectContent = React52.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
878
1016
|
SelectPrimitive.Content,
|
|
879
1017
|
{
|
|
880
1018
|
ref,
|
|
@@ -902,7 +1040,7 @@ var SelectContent = React49.forwardRef(({ className, children, position = "poppe
|
|
|
902
1040
|
}
|
|
903
1041
|
) }));
|
|
904
1042
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
905
|
-
var SelectLabel =
|
|
1043
|
+
var SelectLabel = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
906
1044
|
SelectPrimitive.Label,
|
|
907
1045
|
{
|
|
908
1046
|
ref,
|
|
@@ -914,7 +1052,7 @@ var SelectLabel = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
914
1052
|
}
|
|
915
1053
|
));
|
|
916
1054
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
917
|
-
var SelectItem =
|
|
1055
|
+
var SelectItem = React52.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
918
1056
|
SelectPrimitive.Item,
|
|
919
1057
|
{
|
|
920
1058
|
ref,
|
|
@@ -930,7 +1068,7 @@ var SelectItem = React49.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
930
1068
|
}
|
|
931
1069
|
));
|
|
932
1070
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
933
|
-
var SelectSeparator =
|
|
1071
|
+
var SelectSeparator = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
934
1072
|
SelectPrimitive.Separator,
|
|
935
1073
|
{
|
|
936
1074
|
ref,
|
|
@@ -949,7 +1087,8 @@ var checkboxVariants = cva(
|
|
|
949
1087
|
size: {
|
|
950
1088
|
sm: "h-4 w-4 rounded",
|
|
951
1089
|
default: "h-[18px] w-[18px] rounded",
|
|
952
|
-
lg: "h-5 w-5 rounded-md"
|
|
1090
|
+
lg: "h-5 w-5 rounded-md",
|
|
1091
|
+
touch: "h-6 w-6 rounded-md"
|
|
953
1092
|
}
|
|
954
1093
|
},
|
|
955
1094
|
defaultVariants: {
|
|
@@ -957,10 +1096,23 @@ var checkboxVariants = cva(
|
|
|
957
1096
|
}
|
|
958
1097
|
}
|
|
959
1098
|
);
|
|
960
|
-
var
|
|
961
|
-
|
|
1099
|
+
var checkboxWrapperVariants = cva("flex items-start", {
|
|
1100
|
+
variants: {
|
|
1101
|
+
size: {
|
|
1102
|
+
sm: "gap-2.5",
|
|
1103
|
+
default: "gap-2.5",
|
|
1104
|
+
lg: "gap-3",
|
|
1105
|
+
touch: "gap-3 min-h-[44px] items-center"
|
|
1106
|
+
}
|
|
1107
|
+
},
|
|
1108
|
+
defaultVariants: {
|
|
1109
|
+
size: "default"
|
|
1110
|
+
}
|
|
1111
|
+
});
|
|
1112
|
+
var Checkbox = React52.forwardRef(({ className, size, label, description, indeterminate, ...props }, ref) => {
|
|
1113
|
+
const generatedId = React52.useId();
|
|
962
1114
|
const checkboxId = props.id || generatedId;
|
|
963
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
1115
|
+
return /* @__PURE__ */ jsxs("div", { className: cn(checkboxWrapperVariants({ size })), children: [
|
|
964
1116
|
/* @__PURE__ */ jsx(
|
|
965
1117
|
CheckboxPrimitive.Root,
|
|
966
1118
|
{
|
|
@@ -1006,10 +1158,40 @@ var radioGroupVariants = cva("grid gap-2", {
|
|
|
1006
1158
|
orientation: "vertical"
|
|
1007
1159
|
}
|
|
1008
1160
|
});
|
|
1009
|
-
var
|
|
1161
|
+
var radioItemVariants = cva(
|
|
1162
|
+
"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",
|
|
1163
|
+
{
|
|
1164
|
+
variants: {
|
|
1165
|
+
size: {
|
|
1166
|
+
sm: "h-3.5 w-3.5",
|
|
1167
|
+
default: "h-4 w-4",
|
|
1168
|
+
lg: "h-5 w-5",
|
|
1169
|
+
touch: "h-6 w-6"
|
|
1170
|
+
}
|
|
1171
|
+
},
|
|
1172
|
+
defaultVariants: {
|
|
1173
|
+
size: "default"
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
);
|
|
1177
|
+
var radioIndicatorVariants = cva("fill-primary text-primary", {
|
|
1178
|
+
variants: {
|
|
1179
|
+
size: {
|
|
1180
|
+
sm: "h-2 w-2",
|
|
1181
|
+
default: "h-2.5 w-2.5",
|
|
1182
|
+
lg: "h-3 w-3",
|
|
1183
|
+
touch: "h-3.5 w-3.5"
|
|
1184
|
+
}
|
|
1185
|
+
},
|
|
1186
|
+
defaultVariants: {
|
|
1187
|
+
size: "default"
|
|
1188
|
+
}
|
|
1189
|
+
});
|
|
1190
|
+
var RadioGroup = React52.forwardRef(
|
|
1010
1191
|
({
|
|
1011
1192
|
className,
|
|
1012
1193
|
orientation = "vertical",
|
|
1194
|
+
size,
|
|
1013
1195
|
items,
|
|
1014
1196
|
itemClassName,
|
|
1015
1197
|
renderItem,
|
|
@@ -1019,14 +1201,15 @@ var RadioGroup = React49.forwardRef(
|
|
|
1019
1201
|
children,
|
|
1020
1202
|
...props
|
|
1021
1203
|
}, ref) => {
|
|
1022
|
-
const generatedId =
|
|
1023
|
-
const defaultRenderItem =
|
|
1204
|
+
const generatedId = React52.useId();
|
|
1205
|
+
const defaultRenderItem = React52.useCallback(
|
|
1024
1206
|
(item) => /* @__PURE__ */ jsxs(
|
|
1025
1207
|
"div",
|
|
1026
1208
|
{
|
|
1027
1209
|
className: cn(
|
|
1028
1210
|
"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",
|
|
1029
1211
|
item.disabled && "opacity-50 cursor-not-allowed",
|
|
1212
|
+
size === "touch" && "min-h-[44px] items-center",
|
|
1030
1213
|
itemClassName
|
|
1031
1214
|
),
|
|
1032
1215
|
children: [
|
|
@@ -1036,8 +1219,8 @@ var RadioGroup = React49.forwardRef(
|
|
|
1036
1219
|
value: item.value,
|
|
1037
1220
|
id: `${generatedId}-${item.value}`,
|
|
1038
1221
|
disabled: item.disabled,
|
|
1039
|
-
className:
|
|
1040
|
-
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(CircleIcon, { className:
|
|
1222
|
+
className: cn(radioItemVariants({ size }), "mt-0.5"),
|
|
1223
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(CircleIcon, { className: cn(radioIndicatorVariants({ size })) }) })
|
|
1041
1224
|
}
|
|
1042
1225
|
),
|
|
1043
1226
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-1", children: [
|
|
@@ -1058,7 +1241,7 @@ var RadioGroup = React49.forwardRef(
|
|
|
1058
1241
|
},
|
|
1059
1242
|
item.value
|
|
1060
1243
|
),
|
|
1061
|
-
[generatedId, itemClassName]
|
|
1244
|
+
[generatedId, itemClassName, size]
|
|
1062
1245
|
);
|
|
1063
1246
|
const renderFunction = renderItem || defaultRenderItem;
|
|
1064
1247
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
@@ -1078,17 +1261,14 @@ var RadioGroup = React49.forwardRef(
|
|
|
1078
1261
|
}
|
|
1079
1262
|
);
|
|
1080
1263
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
1081
|
-
var RadioGroupItem =
|
|
1264
|
+
var RadioGroupItem = React52.forwardRef(({ className, size, ...props }, ref) => {
|
|
1082
1265
|
return /* @__PURE__ */ jsx(
|
|
1083
1266
|
RadioGroupPrimitive.Item,
|
|
1084
1267
|
{
|
|
1085
1268
|
ref,
|
|
1086
|
-
className: cn(
|
|
1087
|
-
"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",
|
|
1088
|
-
className
|
|
1089
|
-
),
|
|
1269
|
+
className: cn(radioItemVariants({ size }), className),
|
|
1090
1270
|
...props,
|
|
1091
|
-
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(CircleIcon, { className:
|
|
1271
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(CircleIcon, { className: cn(radioIndicatorVariants({ size })) }) })
|
|
1092
1272
|
}
|
|
1093
1273
|
);
|
|
1094
1274
|
});
|
|
@@ -1096,32 +1276,49 @@ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
|
1096
1276
|
|
|
1097
1277
|
// src/components/ui/switch/index.tsx
|
|
1098
1278
|
init_utils();
|
|
1099
|
-
var
|
|
1279
|
+
var switchVariants = cva(
|
|
1280
|
+
"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",
|
|
1281
|
+
{
|
|
1282
|
+
variants: {
|
|
1283
|
+
size: {
|
|
1284
|
+
sm: "h-5 w-9",
|
|
1285
|
+
default: "h-6 w-11",
|
|
1286
|
+
lg: "h-7 w-[52px]",
|
|
1287
|
+
touch: "h-7 w-[52px] min-h-[44px] min-w-[44px]"
|
|
1288
|
+
}
|
|
1289
|
+
},
|
|
1290
|
+
defaultVariants: {
|
|
1291
|
+
size: "default"
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
);
|
|
1295
|
+
var thumbVariants = cva(
|
|
1296
|
+
"group pointer-events-none relative flex items-center justify-center rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
1297
|
+
{
|
|
1298
|
+
variants: {
|
|
1299
|
+
size: {
|
|
1300
|
+
sm: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",
|
|
1301
|
+
default: "h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
|
1302
|
+
lg: "h-6 w-6 data-[state=checked]:translate-x-6 data-[state=unchecked]:translate-x-0",
|
|
1303
|
+
touch: "h-6 w-6 data-[state=checked]:translate-x-6 data-[state=unchecked]:translate-x-0"
|
|
1304
|
+
}
|
|
1305
|
+
},
|
|
1306
|
+
defaultVariants: {
|
|
1307
|
+
size: "default"
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
);
|
|
1311
|
+
var Switch = React52.forwardRef(({ className, size, offNode, onNode, ...props }, ref) => {
|
|
1100
1312
|
return /* @__PURE__ */ jsx(
|
|
1101
1313
|
SwitchPrimitives.Root,
|
|
1102
1314
|
{
|
|
1103
1315
|
ref,
|
|
1104
|
-
className: cn(
|
|
1105
|
-
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
|
|
1106
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
1107
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
1108
|
-
"data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
1109
|
-
className
|
|
1110
|
-
),
|
|
1316
|
+
className: cn(switchVariants({ size }), className),
|
|
1111
1317
|
...props,
|
|
1112
|
-
children: /* @__PURE__ */ jsxs(
|
|
1113
|
-
|
|
1114
|
-
{
|
|
1115
|
-
|
|
1116
|
-
"group pointer-events-none relative flex items-center justify-center h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
1117
|
-
"data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
1118
|
-
),
|
|
1119
|
-
children: [
|
|
1120
|
-
/* @__PURE__ */ jsx("span", { className: "absolute opacity-0 group-data-[state=checked]:opacity-100 transition-all duration-200", children: onNode }),
|
|
1121
|
-
/* @__PURE__ */ jsx("span", { className: "absolute opacity-100 group-data-[state=checked]:opacity-0 transition-all duration-200", children: offNode })
|
|
1122
|
-
]
|
|
1123
|
-
}
|
|
1124
|
-
)
|
|
1318
|
+
children: /* @__PURE__ */ jsxs(SwitchPrimitives.Thumb, { className: cn(thumbVariants({ size })), children: [
|
|
1319
|
+
/* @__PURE__ */ jsx("span", { className: "absolute opacity-0 group-data-[state=checked]:opacity-100 transition-all duration-200", children: onNode }),
|
|
1320
|
+
/* @__PURE__ */ jsx("span", { className: "absolute opacity-100 group-data-[state=checked]:opacity-0 transition-all duration-200", children: offNode })
|
|
1321
|
+
] })
|
|
1125
1322
|
}
|
|
1126
1323
|
);
|
|
1127
1324
|
});
|
|
@@ -1150,7 +1347,7 @@ var toggleVariants = cva(
|
|
|
1150
1347
|
}
|
|
1151
1348
|
}
|
|
1152
1349
|
);
|
|
1153
|
-
var Toggle =
|
|
1350
|
+
var Toggle = React52.forwardRef(({ className, variant, size, icon, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
1154
1351
|
TogglePrimitive.Root,
|
|
1155
1352
|
{
|
|
1156
1353
|
ref,
|
|
@@ -1196,9 +1393,9 @@ var toggleGroupItemVariants = cva(
|
|
|
1196
1393
|
}
|
|
1197
1394
|
}
|
|
1198
1395
|
);
|
|
1199
|
-
var ToggleGroup =
|
|
1396
|
+
var ToggleGroup = React52.forwardRef(
|
|
1200
1397
|
({ className, size, items, itemClassName, renderItem, children, ...props }, ref) => {
|
|
1201
|
-
const defaultRenderItem =
|
|
1398
|
+
const defaultRenderItem = React52.useCallback(
|
|
1202
1399
|
(item) => /* @__PURE__ */ jsxs(
|
|
1203
1400
|
ToggleGroupPrimitive.Item,
|
|
1204
1401
|
{
|
|
@@ -1228,7 +1425,7 @@ var ToggleGroup = React49.forwardRef(
|
|
|
1228
1425
|
}
|
|
1229
1426
|
);
|
|
1230
1427
|
ToggleGroup.displayName = "ToggleGroup";
|
|
1231
|
-
var ToggleGroupItem =
|
|
1428
|
+
var ToggleGroupItem = React52.forwardRef(({ className, size, children, ...props }, ref) => {
|
|
1232
1429
|
return /* @__PURE__ */ jsx(
|
|
1233
1430
|
ToggleGroupPrimitive.Item,
|
|
1234
1431
|
{
|
|
@@ -1243,7 +1440,7 @@ ToggleGroupItem.displayName = "ToggleGroupItem";
|
|
|
1243
1440
|
|
|
1244
1441
|
// src/components/ui/slider/index.tsx
|
|
1245
1442
|
init_utils();
|
|
1246
|
-
var Slider =
|
|
1443
|
+
var Slider = React52.forwardRef(
|
|
1247
1444
|
({
|
|
1248
1445
|
className,
|
|
1249
1446
|
showValue,
|
|
@@ -1302,7 +1499,7 @@ var inputGroupVariants = cva("flex items-stretch w-full", {
|
|
|
1302
1499
|
size: "default"
|
|
1303
1500
|
}
|
|
1304
1501
|
});
|
|
1305
|
-
var InputGroup =
|
|
1502
|
+
var InputGroup = React52.forwardRef(
|
|
1306
1503
|
({
|
|
1307
1504
|
className,
|
|
1308
1505
|
size,
|
|
@@ -1338,9 +1535,9 @@ var InputGroup = React49.forwardRef(
|
|
|
1338
1535
|
}
|
|
1339
1536
|
),
|
|
1340
1537
|
leftElement && /* @__PURE__ */ jsx("div", { className: "inline-flex items-center", children: leftElement }),
|
|
1341
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children:
|
|
1342
|
-
if (
|
|
1343
|
-
return
|
|
1538
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children: React52.Children.map(children, (child) => {
|
|
1539
|
+
if (React52.isValidElement(child)) {
|
|
1540
|
+
return React52.cloneElement(child, {
|
|
1344
1541
|
className: cn(
|
|
1345
1542
|
child.props.className,
|
|
1346
1543
|
(leftAddon || leftElement) && "rounded-l-none border-l-0",
|
|
@@ -1371,7 +1568,7 @@ InputGroup.displayName = "InputGroup";
|
|
|
1371
1568
|
|
|
1372
1569
|
// src/components/ui/input-otp/index.tsx
|
|
1373
1570
|
init_utils();
|
|
1374
|
-
var InputOTP =
|
|
1571
|
+
var InputOTP = React52.forwardRef(({ containerClassName, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1375
1572
|
OTPInput,
|
|
1376
1573
|
{
|
|
1377
1574
|
ref,
|
|
@@ -1384,10 +1581,10 @@ var InputOTP = React49.forwardRef(({ containerClassName, children, ...props }, r
|
|
|
1384
1581
|
}
|
|
1385
1582
|
));
|
|
1386
1583
|
InputOTP.displayName = "InputOTP";
|
|
1387
|
-
var InputOTPGroup =
|
|
1584
|
+
var InputOTPGroup = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex items-center gap-2", className), ...props }));
|
|
1388
1585
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
1389
|
-
var InputOTPSlot =
|
|
1390
|
-
const inputOTPContext =
|
|
1586
|
+
var InputOTPSlot = React52.forwardRef(({ index, className, ...props }, ref) => {
|
|
1587
|
+
const inputOTPContext = React52.useContext(OTPInputContext);
|
|
1391
1588
|
if (!inputOTPContext) {
|
|
1392
1589
|
console.error("InputOTPSlot must be used within InputOTP");
|
|
1393
1590
|
return null;
|
|
@@ -1421,7 +1618,7 @@ var InputOTPSlot = React49.forwardRef(({ index, className, ...props }, ref) => {
|
|
|
1421
1618
|
);
|
|
1422
1619
|
});
|
|
1423
1620
|
InputOTPSlot.displayName = "InputOTPSlot";
|
|
1424
|
-
var InputOTPSeparator =
|
|
1621
|
+
var InputOTPSeparator = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, role: "separator", className, ...props, children: /* @__PURE__ */ jsx(MinusIcon, { className: "h-4 w-4 text-muted-foreground" }) }));
|
|
1425
1622
|
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
1426
1623
|
|
|
1427
1624
|
// src/components/ui/form/form-utils.ts
|
|
@@ -2110,7 +2307,7 @@ var FormItem = (props) => {
|
|
|
2110
2307
|
const isRequired = Array.isArray(rules) ? rules.some((rule) => rule && rule.required) : false;
|
|
2111
2308
|
const isDisabled = !!contextDisabled;
|
|
2112
2309
|
const requiredIndicator = requiredMark === void 0 ? /* @__PURE__ */ jsx("span", { className: "text-destructive mr-1", "aria-hidden": "true", children: "*" }) : /* @__PURE__ */ jsx("span", { className: "mr-1", "aria-hidden": "true", children: requiredMark });
|
|
2113
|
-
if (!children || !
|
|
2310
|
+
if (!children || !React52__default.isValidElement(children)) return null;
|
|
2114
2311
|
const childProps = {};
|
|
2115
2312
|
childProps[valuePropName] = fieldValue;
|
|
2116
2313
|
const childClass = children.props.className;
|
|
@@ -2278,7 +2475,7 @@ var fieldVariants = cva("", {
|
|
|
2278
2475
|
orientation: "vertical"
|
|
2279
2476
|
}
|
|
2280
2477
|
});
|
|
2281
|
-
var Field =
|
|
2478
|
+
var Field = React52.forwardRef(
|
|
2282
2479
|
({
|
|
2283
2480
|
className,
|
|
2284
2481
|
orientation,
|
|
@@ -2291,7 +2488,7 @@ var Field = React49.forwardRef(
|
|
|
2291
2488
|
children,
|
|
2292
2489
|
...props
|
|
2293
2490
|
}, ref) => {
|
|
2294
|
-
const generatedId =
|
|
2491
|
+
const generatedId = React52.useId();
|
|
2295
2492
|
const fieldId = htmlFor || generatedId;
|
|
2296
2493
|
return /* @__PURE__ */ jsxs(
|
|
2297
2494
|
"div",
|
|
@@ -2340,7 +2537,7 @@ var alertVariants = cva(
|
|
|
2340
2537
|
}
|
|
2341
2538
|
}
|
|
2342
2539
|
);
|
|
2343
|
-
var Alert =
|
|
2540
|
+
var Alert = React52.forwardRef(
|
|
2344
2541
|
({
|
|
2345
2542
|
className,
|
|
2346
2543
|
variant,
|
|
@@ -2353,8 +2550,8 @@ var Alert = React49.forwardRef(
|
|
|
2353
2550
|
descriptionClassName,
|
|
2354
2551
|
...props
|
|
2355
2552
|
}, ref) => {
|
|
2356
|
-
const [isVisible, setIsVisible] =
|
|
2357
|
-
const handleDismiss =
|
|
2553
|
+
const [isVisible, setIsVisible] = React52.useState(true);
|
|
2554
|
+
const handleDismiss = React52.useCallback(() => {
|
|
2358
2555
|
setIsVisible(false);
|
|
2359
2556
|
onClose?.();
|
|
2360
2557
|
}, [onClose]);
|
|
@@ -2523,7 +2720,7 @@ var toastVariants = cva(
|
|
|
2523
2720
|
}
|
|
2524
2721
|
}
|
|
2525
2722
|
);
|
|
2526
|
-
var Toast =
|
|
2723
|
+
var Toast = React52.forwardRef(
|
|
2527
2724
|
({
|
|
2528
2725
|
className,
|
|
2529
2726
|
variant,
|
|
@@ -2536,8 +2733,8 @@ var Toast = React49.forwardRef(
|
|
|
2536
2733
|
descriptionClassName,
|
|
2537
2734
|
...props
|
|
2538
2735
|
}, ref) => {
|
|
2539
|
-
const [isVisible, setIsVisible] =
|
|
2540
|
-
const handleDismiss =
|
|
2736
|
+
const [isVisible, setIsVisible] = React52.useState(true);
|
|
2737
|
+
const handleDismiss = React52.useCallback(() => {
|
|
2541
2738
|
setIsVisible(false);
|
|
2542
2739
|
onClose?.();
|
|
2543
2740
|
}, [onClose]);
|
|
@@ -2633,7 +2830,7 @@ var progressVariants = cva(
|
|
|
2633
2830
|
}
|
|
2634
2831
|
}
|
|
2635
2832
|
);
|
|
2636
|
-
var Progress =
|
|
2833
|
+
var Progress = React52.forwardRef(
|
|
2637
2834
|
({
|
|
2638
2835
|
className,
|
|
2639
2836
|
value = 0,
|
|
@@ -2699,7 +2896,7 @@ var spinnerVariants = cva("animate-spin", {
|
|
|
2699
2896
|
variant: "default"
|
|
2700
2897
|
}
|
|
2701
2898
|
});
|
|
2702
|
-
var Spinner =
|
|
2899
|
+
var Spinner = React52.forwardRef(
|
|
2703
2900
|
({ className, size, variant, label, centered, overlay, icon, ...props }, ref) => {
|
|
2704
2901
|
const spinnerContent = /* @__PURE__ */ jsxs(
|
|
2705
2902
|
"div",
|
|
@@ -2730,7 +2927,7 @@ var Spinner = React49.forwardRef(
|
|
|
2730
2927
|
}
|
|
2731
2928
|
);
|
|
2732
2929
|
Spinner.displayName = "Spinner";
|
|
2733
|
-
var DotsSpinner =
|
|
2930
|
+
var DotsSpinner = React52.forwardRef(
|
|
2734
2931
|
({ className, size = "default", dotCount = 3, ...props }, ref) => {
|
|
2735
2932
|
const dotSizeMap = {
|
|
2736
2933
|
xs: "h-1 w-1",
|
|
@@ -2783,7 +2980,7 @@ var skeletonVariants = cva(
|
|
|
2783
2980
|
}
|
|
2784
2981
|
}
|
|
2785
2982
|
);
|
|
2786
|
-
var Skeleton =
|
|
2983
|
+
var Skeleton = React52.forwardRef(
|
|
2787
2984
|
({
|
|
2788
2985
|
className,
|
|
2789
2986
|
variant,
|
|
@@ -2832,7 +3029,7 @@ var Skeleton = React49.forwardRef(
|
|
|
2832
3029
|
}
|
|
2833
3030
|
);
|
|
2834
3031
|
Skeleton.displayName = "Skeleton";
|
|
2835
|
-
var SkeletonCard =
|
|
3032
|
+
var SkeletonCard = React52.forwardRef(
|
|
2836
3033
|
({ className, avatar = false, lines = 3, ...props }, ref) => {
|
|
2837
3034
|
return /* @__PURE__ */ jsxs("div", { ref, className: cn("space-y-4", className), ...props, children: [
|
|
2838
3035
|
avatar && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -2872,7 +3069,7 @@ var emptyVariants = cva(
|
|
|
2872
3069
|
}
|
|
2873
3070
|
}
|
|
2874
3071
|
);
|
|
2875
|
-
var Empty =
|
|
3072
|
+
var Empty = React52.forwardRef(
|
|
2876
3073
|
({
|
|
2877
3074
|
className,
|
|
2878
3075
|
size,
|
|
@@ -2913,7 +3110,7 @@ var Dialog = DialogPrimitive.Root;
|
|
|
2913
3110
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
2914
3111
|
var DialogPortal = DialogPrimitive.Portal;
|
|
2915
3112
|
var DialogClose = DialogPrimitive.Close;
|
|
2916
|
-
var DialogOverlay =
|
|
3113
|
+
var DialogOverlay = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2917
3114
|
DialogPrimitive.Overlay,
|
|
2918
3115
|
{
|
|
2919
3116
|
ref,
|
|
@@ -2925,7 +3122,7 @@ var DialogOverlay = React49.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2925
3122
|
}
|
|
2926
3123
|
));
|
|
2927
3124
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
2928
|
-
var DialogContent =
|
|
3125
|
+
var DialogContent = React52.forwardRef(
|
|
2929
3126
|
({
|
|
2930
3127
|
className,
|
|
2931
3128
|
children,
|
|
@@ -2990,7 +3187,7 @@ var DialogFooter = ({
|
|
|
2990
3187
|
}
|
|
2991
3188
|
);
|
|
2992
3189
|
DialogFooter.displayName = "DialogFooter";
|
|
2993
|
-
var DialogTitle =
|
|
3190
|
+
var DialogTitle = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2994
3191
|
DialogPrimitive.Title,
|
|
2995
3192
|
{
|
|
2996
3193
|
ref,
|
|
@@ -3002,7 +3199,7 @@ var DialogTitle = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3002
3199
|
}
|
|
3003
3200
|
));
|
|
3004
3201
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
3005
|
-
var DialogDescription =
|
|
3202
|
+
var DialogDescription = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3006
3203
|
DialogPrimitive.Description,
|
|
3007
3204
|
{
|
|
3008
3205
|
ref,
|
|
@@ -3017,7 +3214,7 @@ init_utils();
|
|
|
3017
3214
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
3018
3215
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
3019
3216
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
3020
|
-
var AlertDialogOverlay =
|
|
3217
|
+
var AlertDialogOverlay = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3021
3218
|
AlertDialogPrimitive.Overlay,
|
|
3022
3219
|
{
|
|
3023
3220
|
className: cn(
|
|
@@ -3029,7 +3226,7 @@ var AlertDialogOverlay = React49.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3029
3226
|
}
|
|
3030
3227
|
));
|
|
3031
3228
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
3032
|
-
var AlertDialogContent =
|
|
3229
|
+
var AlertDialogContent = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
3033
3230
|
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
3034
3231
|
/* @__PURE__ */ jsx(
|
|
3035
3232
|
AlertDialogPrimitive.Content,
|
|
@@ -3072,7 +3269,7 @@ var AlertDialogFooter = ({
|
|
|
3072
3269
|
}
|
|
3073
3270
|
);
|
|
3074
3271
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
3075
|
-
var AlertDialogTitle =
|
|
3272
|
+
var AlertDialogTitle = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3076
3273
|
AlertDialogPrimitive.Title,
|
|
3077
3274
|
{
|
|
3078
3275
|
ref,
|
|
@@ -3081,7 +3278,7 @@ var AlertDialogTitle = React49.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
3081
3278
|
}
|
|
3082
3279
|
));
|
|
3083
3280
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
3084
|
-
var AlertDialogDescription =
|
|
3281
|
+
var AlertDialogDescription = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3085
3282
|
AlertDialogPrimitive.Description,
|
|
3086
3283
|
{
|
|
3087
3284
|
ref,
|
|
@@ -3090,7 +3287,7 @@ var AlertDialogDescription = React49.forwardRef(({ className, ...props }, ref) =
|
|
|
3090
3287
|
}
|
|
3091
3288
|
));
|
|
3092
3289
|
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
3093
|
-
var AlertDialogAction =
|
|
3290
|
+
var AlertDialogAction = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3094
3291
|
AlertDialogPrimitive.Action,
|
|
3095
3292
|
{
|
|
3096
3293
|
ref,
|
|
@@ -3099,7 +3296,7 @@ var AlertDialogAction = React49.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3099
3296
|
}
|
|
3100
3297
|
));
|
|
3101
3298
|
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
3102
|
-
var AlertDialogCancel =
|
|
3299
|
+
var AlertDialogCancel = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3103
3300
|
AlertDialogPrimitive.Cancel,
|
|
3104
3301
|
{
|
|
3105
3302
|
ref,
|
|
@@ -3119,7 +3316,7 @@ var Sheet = DialogPrimitive.Root;
|
|
|
3119
3316
|
var SheetTrigger = DialogPrimitive.Trigger;
|
|
3120
3317
|
var SheetClose = DialogPrimitive.Close;
|
|
3121
3318
|
var SheetPortal = DialogPrimitive.Portal;
|
|
3122
|
-
var SheetOverlay =
|
|
3319
|
+
var SheetOverlay = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3123
3320
|
DialogPrimitive.Overlay,
|
|
3124
3321
|
{
|
|
3125
3322
|
className: cn(
|
|
@@ -3147,7 +3344,7 @@ var sheetVariants = cva(
|
|
|
3147
3344
|
}
|
|
3148
3345
|
}
|
|
3149
3346
|
);
|
|
3150
|
-
var SheetContent =
|
|
3347
|
+
var SheetContent = React52.forwardRef(({ side = "right", className, children, hideClose, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
3151
3348
|
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
3152
3349
|
/* @__PURE__ */ jsxs(
|
|
3153
3350
|
DialogPrimitive.Content,
|
|
@@ -3194,7 +3391,7 @@ var SheetFooter = ({
|
|
|
3194
3391
|
}
|
|
3195
3392
|
);
|
|
3196
3393
|
SheetFooter.displayName = "SheetFooter";
|
|
3197
|
-
var SheetTitle =
|
|
3394
|
+
var SheetTitle = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3198
3395
|
DialogPrimitive.Title,
|
|
3199
3396
|
{
|
|
3200
3397
|
ref,
|
|
@@ -3203,7 +3400,7 @@ var SheetTitle = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
3203
3400
|
}
|
|
3204
3401
|
));
|
|
3205
3402
|
SheetTitle.displayName = DialogPrimitive.Title.displayName;
|
|
3206
|
-
var SheetDescription =
|
|
3403
|
+
var SheetDescription = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3207
3404
|
DialogPrimitive.Description,
|
|
3208
3405
|
{
|
|
3209
3406
|
ref,
|
|
@@ -3215,7 +3412,7 @@ SheetDescription.displayName = DialogPrimitive.Description.displayName;
|
|
|
3215
3412
|
|
|
3216
3413
|
// src/components/ui/drawer/index.tsx
|
|
3217
3414
|
init_utils();
|
|
3218
|
-
var DrawerContext =
|
|
3415
|
+
var DrawerContext = React52.createContext({
|
|
3219
3416
|
direction: "bottom"
|
|
3220
3417
|
});
|
|
3221
3418
|
var Drawer = ({
|
|
@@ -3234,7 +3431,7 @@ Drawer.displayName = "Drawer";
|
|
|
3234
3431
|
var DrawerTrigger = Drawer$1.Trigger;
|
|
3235
3432
|
var DrawerPortal = Drawer$1.Portal;
|
|
3236
3433
|
var DrawerClose = Drawer$1.Close;
|
|
3237
|
-
var DrawerOverlay =
|
|
3434
|
+
var DrawerOverlay = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3238
3435
|
Drawer$1.Overlay,
|
|
3239
3436
|
{
|
|
3240
3437
|
ref,
|
|
@@ -3243,7 +3440,7 @@ var DrawerOverlay = React49.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
3243
3440
|
}
|
|
3244
3441
|
));
|
|
3245
3442
|
DrawerOverlay.displayName = Drawer$1.Overlay.displayName;
|
|
3246
|
-
var DrawerContent =
|
|
3443
|
+
var DrawerContent = React52.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DrawerPortal, { children: [
|
|
3247
3444
|
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
3248
3445
|
/* @__PURE__ */ jsxs(
|
|
3249
3446
|
Drawer$1.Content,
|
|
@@ -3278,7 +3475,7 @@ var DrawerFooter = ({
|
|
|
3278
3475
|
}
|
|
3279
3476
|
);
|
|
3280
3477
|
DrawerFooter.displayName = "DrawerFooter";
|
|
3281
|
-
var DrawerTitle =
|
|
3478
|
+
var DrawerTitle = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3282
3479
|
Drawer$1.Title,
|
|
3283
3480
|
{
|
|
3284
3481
|
ref,
|
|
@@ -3290,7 +3487,7 @@ var DrawerTitle = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3290
3487
|
}
|
|
3291
3488
|
));
|
|
3292
3489
|
DrawerTitle.displayName = Drawer$1.Title.displayName;
|
|
3293
|
-
var DrawerDescription =
|
|
3490
|
+
var DrawerDescription = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3294
3491
|
Drawer$1.Description,
|
|
3295
3492
|
{
|
|
3296
3493
|
ref,
|
|
@@ -3305,7 +3502,7 @@ init_utils();
|
|
|
3305
3502
|
var Popover = PopoverPrimitive.Root;
|
|
3306
3503
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
3307
3504
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
3308
|
-
var PopoverContent =
|
|
3505
|
+
var PopoverContent = React52.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
3309
3506
|
PopoverPrimitive.Content,
|
|
3310
3507
|
{
|
|
3311
3508
|
ref,
|
|
@@ -3325,13 +3522,13 @@ init_utils();
|
|
|
3325
3522
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
3326
3523
|
var Tooltip = TooltipPrimitive.Root;
|
|
3327
3524
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
3328
|
-
var TooltipContent =
|
|
3525
|
+
var TooltipContent = React52.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3329
3526
|
TooltipPrimitive.Content,
|
|
3330
3527
|
{
|
|
3331
3528
|
ref,
|
|
3332
3529
|
sideOffset,
|
|
3333
3530
|
className: cn(
|
|
3334
|
-
"z-50 overflow-hidden rounded-md bg-mvn-gray-900 px-3 py-1.5 text-xs text-primary-50
|
|
3531
|
+
"z-50 overflow-hidden rounded-md bg-mvn-gray-900 px-3 py-1.5 text-xs text-primary-50 animate-in fade-in-0 zoom-in-95",
|
|
3335
3532
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
3336
3533
|
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
3337
3534
|
className
|
|
@@ -3340,7 +3537,7 @@ var TooltipContent = React49.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
3340
3537
|
}
|
|
3341
3538
|
));
|
|
3342
3539
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
3343
|
-
var SimpleTooltip =
|
|
3540
|
+
var SimpleTooltip = React52.forwardRef(
|
|
3344
3541
|
({
|
|
3345
3542
|
children,
|
|
3346
3543
|
content,
|
|
@@ -3371,7 +3568,7 @@ init_utils();
|
|
|
3371
3568
|
var HoverCard = HoverCardPrimitive.Root;
|
|
3372
3569
|
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
3373
3570
|
var HoverCardArrow = HoverCardPrimitive.Arrow;
|
|
3374
|
-
var HoverCardContent =
|
|
3571
|
+
var HoverCardContent = React52.forwardRef(
|
|
3375
3572
|
({
|
|
3376
3573
|
className,
|
|
3377
3574
|
align = "center",
|
|
@@ -3415,7 +3612,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
|
3415
3612
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
3416
3613
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
3417
3614
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
3418
|
-
var DropdownMenuSubTrigger =
|
|
3615
|
+
var DropdownMenuSubTrigger = React52.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3419
3616
|
DropdownMenuPrimitive.SubTrigger,
|
|
3420
3617
|
{
|
|
3421
3618
|
ref,
|
|
@@ -3432,7 +3629,7 @@ var DropdownMenuSubTrigger = React49.forwardRef(({ className, inset, children, .
|
|
|
3432
3629
|
}
|
|
3433
3630
|
));
|
|
3434
3631
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
3435
|
-
var DropdownMenuSubContent =
|
|
3632
|
+
var DropdownMenuSubContent = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3436
3633
|
DropdownMenuPrimitive.SubContent,
|
|
3437
3634
|
{
|
|
3438
3635
|
ref,
|
|
@@ -3444,7 +3641,7 @@ var DropdownMenuSubContent = React49.forwardRef(({ className, ...props }, ref) =
|
|
|
3444
3641
|
}
|
|
3445
3642
|
));
|
|
3446
3643
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3447
|
-
var DropdownMenuContent =
|
|
3644
|
+
var DropdownMenuContent = React52.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
3448
3645
|
DropdownMenuPrimitive.Content,
|
|
3449
3646
|
{
|
|
3450
3647
|
ref,
|
|
@@ -3457,7 +3654,7 @@ var DropdownMenuContent = React49.forwardRef(({ className, sideOffset = 4, ...pr
|
|
|
3457
3654
|
}
|
|
3458
3655
|
) }));
|
|
3459
3656
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3460
|
-
var DropdownMenuItem =
|
|
3657
|
+
var DropdownMenuItem = React52.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3461
3658
|
DropdownMenuPrimitive.Item,
|
|
3462
3659
|
{
|
|
3463
3660
|
ref,
|
|
@@ -3470,7 +3667,7 @@ var DropdownMenuItem = React49.forwardRef(({ className, inset, ...props }, ref)
|
|
|
3470
3667
|
}
|
|
3471
3668
|
));
|
|
3472
3669
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
3473
|
-
var DropdownMenuCheckboxItem =
|
|
3670
|
+
var DropdownMenuCheckboxItem = React52.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3474
3671
|
DropdownMenuPrimitive.CheckboxItem,
|
|
3475
3672
|
{
|
|
3476
3673
|
ref,
|
|
@@ -3487,7 +3684,7 @@ var DropdownMenuCheckboxItem = React49.forwardRef(({ className, children, checke
|
|
|
3487
3684
|
}
|
|
3488
3685
|
));
|
|
3489
3686
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
3490
|
-
var DropdownMenuRadioItem =
|
|
3687
|
+
var DropdownMenuRadioItem = React52.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3491
3688
|
DropdownMenuPrimitive.RadioItem,
|
|
3492
3689
|
{
|
|
3493
3690
|
ref,
|
|
@@ -3503,7 +3700,7 @@ var DropdownMenuRadioItem = React49.forwardRef(({ className, children, ...props
|
|
|
3503
3700
|
}
|
|
3504
3701
|
));
|
|
3505
3702
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
3506
|
-
var DropdownMenuLabel =
|
|
3703
|
+
var DropdownMenuLabel = React52.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3507
3704
|
DropdownMenuPrimitive.Label,
|
|
3508
3705
|
{
|
|
3509
3706
|
ref,
|
|
@@ -3516,7 +3713,7 @@ var DropdownMenuLabel = React49.forwardRef(({ className, inset, ...props }, ref)
|
|
|
3516
3713
|
}
|
|
3517
3714
|
));
|
|
3518
3715
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
3519
|
-
var DropdownMenuSeparator =
|
|
3716
|
+
var DropdownMenuSeparator = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3520
3717
|
DropdownMenuPrimitive.Separator,
|
|
3521
3718
|
{
|
|
3522
3719
|
ref,
|
|
@@ -3547,7 +3744,7 @@ var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
|
3547
3744
|
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
3548
3745
|
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
3549
3746
|
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
3550
|
-
var ContextMenuSubTrigger =
|
|
3747
|
+
var ContextMenuSubTrigger = React52.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3551
3748
|
ContextMenuPrimitive.SubTrigger,
|
|
3552
3749
|
{
|
|
3553
3750
|
ref,
|
|
@@ -3564,7 +3761,7 @@ var ContextMenuSubTrigger = React49.forwardRef(({ className, inset, children, ..
|
|
|
3564
3761
|
}
|
|
3565
3762
|
));
|
|
3566
3763
|
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
3567
|
-
var ContextMenuSubContent =
|
|
3764
|
+
var ContextMenuSubContent = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3568
3765
|
ContextMenuPrimitive.SubContent,
|
|
3569
3766
|
{
|
|
3570
3767
|
ref,
|
|
@@ -3576,7 +3773,7 @@ var ContextMenuSubContent = React49.forwardRef(({ className, ...props }, ref) =>
|
|
|
3576
3773
|
}
|
|
3577
3774
|
));
|
|
3578
3775
|
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
3579
|
-
var ContextMenuContent =
|
|
3776
|
+
var ContextMenuContent = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
3580
3777
|
ContextMenuPrimitive.Content,
|
|
3581
3778
|
{
|
|
3582
3779
|
ref,
|
|
@@ -3588,7 +3785,7 @@ var ContextMenuContent = React49.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3588
3785
|
}
|
|
3589
3786
|
) }));
|
|
3590
3787
|
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
3591
|
-
var ContextMenuItem =
|
|
3788
|
+
var ContextMenuItem = React52.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3592
3789
|
ContextMenuPrimitive.Item,
|
|
3593
3790
|
{
|
|
3594
3791
|
ref,
|
|
@@ -3601,7 +3798,7 @@ var ContextMenuItem = React49.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
3601
3798
|
}
|
|
3602
3799
|
));
|
|
3603
3800
|
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
3604
|
-
var ContextMenuCheckboxItem =
|
|
3801
|
+
var ContextMenuCheckboxItem = React52.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3605
3802
|
ContextMenuPrimitive.CheckboxItem,
|
|
3606
3803
|
{
|
|
3607
3804
|
ref,
|
|
@@ -3618,7 +3815,7 @@ var ContextMenuCheckboxItem = React49.forwardRef(({ className, children, checked
|
|
|
3618
3815
|
}
|
|
3619
3816
|
));
|
|
3620
3817
|
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
3621
|
-
var ContextMenuRadioItem =
|
|
3818
|
+
var ContextMenuRadioItem = React52.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3622
3819
|
ContextMenuPrimitive.RadioItem,
|
|
3623
3820
|
{
|
|
3624
3821
|
ref,
|
|
@@ -3634,7 +3831,7 @@ var ContextMenuRadioItem = React49.forwardRef(({ className, children, ...props }
|
|
|
3634
3831
|
}
|
|
3635
3832
|
));
|
|
3636
3833
|
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
3637
|
-
var ContextMenuLabel =
|
|
3834
|
+
var ContextMenuLabel = React52.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3638
3835
|
ContextMenuPrimitive.Label,
|
|
3639
3836
|
{
|
|
3640
3837
|
ref,
|
|
@@ -3647,7 +3844,7 @@ var ContextMenuLabel = React49.forwardRef(({ className, inset, ...props }, ref)
|
|
|
3647
3844
|
}
|
|
3648
3845
|
));
|
|
3649
3846
|
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
3650
|
-
var ContextMenuSeparator =
|
|
3847
|
+
var ContextMenuSeparator = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3651
3848
|
ContextMenuPrimitive.Separator,
|
|
3652
3849
|
{
|
|
3653
3850
|
ref,
|
|
@@ -3680,7 +3877,7 @@ var MenubarGroup = MenubarPrimitive.Group;
|
|
|
3680
3877
|
var MenubarPortal = MenubarPrimitive.Portal;
|
|
3681
3878
|
var MenubarSub = MenubarPrimitive.Sub;
|
|
3682
3879
|
var MenubarRadioGroup = MenubarPrimitive.RadioGroup;
|
|
3683
|
-
var Menubar =
|
|
3880
|
+
var Menubar = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3684
3881
|
MenubarPrimitive.Root,
|
|
3685
3882
|
{
|
|
3686
3883
|
ref,
|
|
@@ -3692,7 +3889,7 @@ var Menubar = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
3692
3889
|
}
|
|
3693
3890
|
));
|
|
3694
3891
|
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
3695
|
-
var MenubarTrigger =
|
|
3892
|
+
var MenubarTrigger = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3696
3893
|
MenubarPrimitive.Trigger,
|
|
3697
3894
|
{
|
|
3698
3895
|
ref,
|
|
@@ -3704,7 +3901,7 @@ var MenubarTrigger = React49.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
3704
3901
|
}
|
|
3705
3902
|
));
|
|
3706
3903
|
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
3707
|
-
var MenubarSubTrigger =
|
|
3904
|
+
var MenubarSubTrigger = React52.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3708
3905
|
MenubarPrimitive.SubTrigger,
|
|
3709
3906
|
{
|
|
3710
3907
|
ref,
|
|
@@ -3721,7 +3918,7 @@ var MenubarSubTrigger = React49.forwardRef(({ className, inset, children, ...pro
|
|
|
3721
3918
|
}
|
|
3722
3919
|
));
|
|
3723
3920
|
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
3724
|
-
var MenubarSubContent =
|
|
3921
|
+
var MenubarSubContent = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3725
3922
|
MenubarPrimitive.SubContent,
|
|
3726
3923
|
{
|
|
3727
3924
|
ref,
|
|
@@ -3733,7 +3930,7 @@ var MenubarSubContent = React49.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3733
3930
|
}
|
|
3734
3931
|
));
|
|
3735
3932
|
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
3736
|
-
var MenubarContent =
|
|
3933
|
+
var MenubarContent = React52.forwardRef(
|
|
3737
3934
|
({ className, align = "start", alignOffset = -4, sideOffset = 8, ...props }, ref) => /* @__PURE__ */ jsx(MenubarPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
3738
3935
|
MenubarPrimitive.Content,
|
|
3739
3936
|
{
|
|
@@ -3750,7 +3947,7 @@ var MenubarContent = React49.forwardRef(
|
|
|
3750
3947
|
) })
|
|
3751
3948
|
);
|
|
3752
3949
|
MenubarContent.displayName = MenubarPrimitive.Content.displayName;
|
|
3753
|
-
var MenubarItem =
|
|
3950
|
+
var MenubarItem = React52.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3754
3951
|
MenubarPrimitive.Item,
|
|
3755
3952
|
{
|
|
3756
3953
|
ref,
|
|
@@ -3763,7 +3960,7 @@ var MenubarItem = React49.forwardRef(({ className, inset, ...props }, ref) => /*
|
|
|
3763
3960
|
}
|
|
3764
3961
|
));
|
|
3765
3962
|
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
3766
|
-
var MenubarCheckboxItem =
|
|
3963
|
+
var MenubarCheckboxItem = React52.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3767
3964
|
MenubarPrimitive.CheckboxItem,
|
|
3768
3965
|
{
|
|
3769
3966
|
ref,
|
|
@@ -3780,7 +3977,7 @@ var MenubarCheckboxItem = React49.forwardRef(({ className, children, checked, ..
|
|
|
3780
3977
|
}
|
|
3781
3978
|
));
|
|
3782
3979
|
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
3783
|
-
var MenubarRadioItem =
|
|
3980
|
+
var MenubarRadioItem = React52.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3784
3981
|
MenubarPrimitive.RadioItem,
|
|
3785
3982
|
{
|
|
3786
3983
|
ref,
|
|
@@ -3796,7 +3993,7 @@ var MenubarRadioItem = React49.forwardRef(({ className, children, ...props }, re
|
|
|
3796
3993
|
}
|
|
3797
3994
|
));
|
|
3798
3995
|
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
3799
|
-
var MenubarLabel =
|
|
3996
|
+
var MenubarLabel = React52.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3800
3997
|
MenubarPrimitive.Label,
|
|
3801
3998
|
{
|
|
3802
3999
|
ref,
|
|
@@ -3809,7 +4006,7 @@ var MenubarLabel = React49.forwardRef(({ className, inset, ...props }, ref) => /
|
|
|
3809
4006
|
}
|
|
3810
4007
|
));
|
|
3811
4008
|
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
3812
|
-
var MenubarSeparator =
|
|
4009
|
+
var MenubarSeparator = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3813
4010
|
MenubarPrimitive.Separator,
|
|
3814
4011
|
{
|
|
3815
4012
|
ref,
|
|
@@ -3837,7 +4034,7 @@ MenubarShortcut.displayName = "MenubarShortcut";
|
|
|
3837
4034
|
|
|
3838
4035
|
// src/components/ui/navigation-menu/index.tsx
|
|
3839
4036
|
init_utils();
|
|
3840
|
-
var NavigationMenu =
|
|
4037
|
+
var NavigationMenu = React52.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3841
4038
|
NavigationMenuPrimitive.Root,
|
|
3842
4039
|
{
|
|
3843
4040
|
ref,
|
|
@@ -3853,7 +4050,7 @@ var NavigationMenu = React49.forwardRef(({ className, children, ...props }, ref)
|
|
|
3853
4050
|
}
|
|
3854
4051
|
));
|
|
3855
4052
|
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;
|
|
3856
|
-
var NavigationMenuList =
|
|
4053
|
+
var NavigationMenuList = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3857
4054
|
NavigationMenuPrimitive.List,
|
|
3858
4055
|
{
|
|
3859
4056
|
ref,
|
|
@@ -3869,7 +4066,7 @@ var NavigationMenuItem = NavigationMenuPrimitive.Item;
|
|
|
3869
4066
|
var navigationMenuTriggerStyle = cva(
|
|
3870
4067
|
"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"
|
|
3871
4068
|
);
|
|
3872
|
-
var NavigationMenuTrigger =
|
|
4069
|
+
var NavigationMenuTrigger = React52.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3873
4070
|
NavigationMenuPrimitive.Trigger,
|
|
3874
4071
|
{
|
|
3875
4072
|
ref,
|
|
@@ -3889,7 +4086,7 @@ var NavigationMenuTrigger = React49.forwardRef(({ className, children, ...props
|
|
|
3889
4086
|
}
|
|
3890
4087
|
));
|
|
3891
4088
|
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
3892
|
-
var NavigationMenuContent =
|
|
4089
|
+
var NavigationMenuContent = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3893
4090
|
NavigationMenuPrimitive.Content,
|
|
3894
4091
|
{
|
|
3895
4092
|
ref,
|
|
@@ -3902,7 +4099,7 @@ var NavigationMenuContent = React49.forwardRef(({ className, ...props }, ref) =>
|
|
|
3902
4099
|
));
|
|
3903
4100
|
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
3904
4101
|
var NavigationMenuLink = NavigationMenuPrimitive.Link;
|
|
3905
|
-
var NavigationMenuViewport =
|
|
4102
|
+
var NavigationMenuViewport = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ jsx(
|
|
3906
4103
|
NavigationMenuPrimitive.Viewport,
|
|
3907
4104
|
{
|
|
3908
4105
|
className: cn(
|
|
@@ -3914,7 +4111,7 @@ var NavigationMenuViewport = React49.forwardRef(({ className, ...props }, ref) =
|
|
|
3914
4111
|
}
|
|
3915
4112
|
) }));
|
|
3916
4113
|
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
3917
|
-
var NavigationMenuIndicator =
|
|
4114
|
+
var NavigationMenuIndicator = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3918
4115
|
NavigationMenuPrimitive.Indicator,
|
|
3919
4116
|
{
|
|
3920
4117
|
ref,
|
|
@@ -3930,7 +4127,7 @@ NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayN
|
|
|
3930
4127
|
|
|
3931
4128
|
// src/components/ui/command/index.tsx
|
|
3932
4129
|
init_utils();
|
|
3933
|
-
var Command =
|
|
4130
|
+
var Command = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3934
4131
|
Command$1,
|
|
3935
4132
|
{
|
|
3936
4133
|
ref,
|
|
@@ -3945,7 +4142,7 @@ Command.displayName = Command$1.displayName;
|
|
|
3945
4142
|
var CommandDialog = ({ children, ...props }) => {
|
|
3946
4143
|
return /* @__PURE__ */ jsx(Dialog, { ...props, children: /* @__PURE__ */ jsx(DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ 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 }) }) });
|
|
3947
4144
|
};
|
|
3948
|
-
var CommandInput =
|
|
4145
|
+
var CommandInput = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b border-mvn-gray-200 px-3", "cmdk-input-wrapper": "", children: [
|
|
3949
4146
|
/* @__PURE__ */ jsx(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
3950
4147
|
/* @__PURE__ */ jsx(
|
|
3951
4148
|
Command$1.Input,
|
|
@@ -3960,7 +4157,7 @@ var CommandInput = React49.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
3960
4157
|
)
|
|
3961
4158
|
] }));
|
|
3962
4159
|
CommandInput.displayName = Command$1.Input.displayName;
|
|
3963
|
-
var CommandList =
|
|
4160
|
+
var CommandList = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3964
4161
|
Command$1.List,
|
|
3965
4162
|
{
|
|
3966
4163
|
ref,
|
|
@@ -3969,7 +4166,7 @@ var CommandList = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3969
4166
|
}
|
|
3970
4167
|
));
|
|
3971
4168
|
CommandList.displayName = Command$1.List.displayName;
|
|
3972
|
-
var CommandEmpty =
|
|
4169
|
+
var CommandEmpty = React52.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
3973
4170
|
Command$1.Empty,
|
|
3974
4171
|
{
|
|
3975
4172
|
ref,
|
|
@@ -3978,7 +4175,7 @@ var CommandEmpty = React49.forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
|
3978
4175
|
}
|
|
3979
4176
|
));
|
|
3980
4177
|
CommandEmpty.displayName = Command$1.Empty.displayName;
|
|
3981
|
-
var CommandGroup =
|
|
4178
|
+
var CommandGroup = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3982
4179
|
Command$1.Group,
|
|
3983
4180
|
{
|
|
3984
4181
|
ref,
|
|
@@ -3990,7 +4187,7 @@ var CommandGroup = React49.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
3990
4187
|
}
|
|
3991
4188
|
));
|
|
3992
4189
|
CommandGroup.displayName = Command$1.Group.displayName;
|
|
3993
|
-
var CommandSeparator =
|
|
4190
|
+
var CommandSeparator = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3994
4191
|
Command$1.Separator,
|
|
3995
4192
|
{
|
|
3996
4193
|
ref,
|
|
@@ -3999,7 +4196,7 @@ var CommandSeparator = React49.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
3999
4196
|
}
|
|
4000
4197
|
));
|
|
4001
4198
|
CommandSeparator.displayName = Command$1.Separator.displayName;
|
|
4002
|
-
var CommandItem =
|
|
4199
|
+
var CommandItem = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4003
4200
|
Command$1.Item,
|
|
4004
4201
|
{
|
|
4005
4202
|
ref,
|
|
@@ -4030,7 +4227,7 @@ CommandShortcut.displayName = "CommandShortcut";
|
|
|
4030
4227
|
|
|
4031
4228
|
// src/components/ui/combobox/index.tsx
|
|
4032
4229
|
init_utils();
|
|
4033
|
-
var Combobox =
|
|
4230
|
+
var Combobox = React52.forwardRef(
|
|
4034
4231
|
({
|
|
4035
4232
|
options,
|
|
4036
4233
|
value,
|
|
@@ -4042,7 +4239,7 @@ var Combobox = React49.forwardRef(
|
|
|
4042
4239
|
disabled,
|
|
4043
4240
|
clearable
|
|
4044
4241
|
}, ref) => {
|
|
4045
|
-
const [open, setOpen] =
|
|
4242
|
+
const [open, setOpen] = React52.useState(false);
|
|
4046
4243
|
const selectedOption = options.find((option) => option.value === value);
|
|
4047
4244
|
const handleClear = (e) => {
|
|
4048
4245
|
e.stopPropagation();
|
|
@@ -4114,9 +4311,9 @@ Combobox.displayName = "Combobox";
|
|
|
4114
4311
|
|
|
4115
4312
|
// src/components/ui/breadcrumb/index.tsx
|
|
4116
4313
|
init_utils();
|
|
4117
|
-
var Breadcrumb =
|
|
4314
|
+
var Breadcrumb = React52.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, "aria-label": "breadcrumb", ...props }));
|
|
4118
4315
|
Breadcrumb.displayName = "Breadcrumb";
|
|
4119
|
-
var BreadcrumbList =
|
|
4316
|
+
var BreadcrumbList = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4120
4317
|
"ol",
|
|
4121
4318
|
{
|
|
4122
4319
|
ref,
|
|
@@ -4128,7 +4325,7 @@ var BreadcrumbList = React49.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
4128
4325
|
}
|
|
4129
4326
|
));
|
|
4130
4327
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
4131
|
-
var BreadcrumbItem =
|
|
4328
|
+
var BreadcrumbItem = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4132
4329
|
"li",
|
|
4133
4330
|
{
|
|
4134
4331
|
ref,
|
|
@@ -4137,7 +4334,7 @@ var BreadcrumbItem = React49.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
4137
4334
|
}
|
|
4138
4335
|
));
|
|
4139
4336
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
4140
|
-
var BreadcrumbLink =
|
|
4337
|
+
var BreadcrumbLink = React52.forwardRef(({ asChild, className, ...props }, ref) => {
|
|
4141
4338
|
const Comp = "a";
|
|
4142
4339
|
return /* @__PURE__ */ jsx(
|
|
4143
4340
|
Comp,
|
|
@@ -4152,7 +4349,7 @@ var BreadcrumbLink = React49.forwardRef(({ asChild, className, ...props }, ref)
|
|
|
4152
4349
|
);
|
|
4153
4350
|
});
|
|
4154
4351
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
4155
|
-
var BreadcrumbPage =
|
|
4352
|
+
var BreadcrumbPage = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4156
4353
|
"span",
|
|
4157
4354
|
{
|
|
4158
4355
|
ref,
|
|
@@ -4219,7 +4416,7 @@ var Pagination = ({
|
|
|
4219
4416
|
}
|
|
4220
4417
|
);
|
|
4221
4418
|
Pagination.displayName = "Pagination";
|
|
4222
|
-
var PaginationContent =
|
|
4419
|
+
var PaginationContent = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4223
4420
|
"ul",
|
|
4224
4421
|
{
|
|
4225
4422
|
ref,
|
|
@@ -4228,7 +4425,7 @@ var PaginationContent = React49.forwardRef(({ className, ...props }, ref) => /*
|
|
|
4228
4425
|
}
|
|
4229
4426
|
));
|
|
4230
4427
|
PaginationContent.displayName = "PaginationContent";
|
|
4231
|
-
var PaginationItem =
|
|
4428
|
+
var PaginationItem = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("li", { ref, className: cn("", className), ...props }));
|
|
4232
4429
|
PaginationItem.displayName = "PaginationItem";
|
|
4233
4430
|
var PaginationLink = ({
|
|
4234
4431
|
className,
|
|
@@ -4335,12 +4532,12 @@ PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
|
4335
4532
|
|
|
4336
4533
|
// src/components/ui/tabs/index.tsx
|
|
4337
4534
|
init_utils();
|
|
4338
|
-
var TabsContext =
|
|
4535
|
+
var TabsContext = React52.createContext({
|
|
4339
4536
|
destroyInactiveTabs: true
|
|
4340
4537
|
});
|
|
4341
|
-
var Tabs =
|
|
4538
|
+
var Tabs = React52.forwardRef(({ destroyInactiveTabs = true, ...props }, ref) => /* @__PURE__ */ jsx(TabsContext.Provider, { value: { destroyInactiveTabs }, children: /* @__PURE__ */ jsx(TabsPrimitive.Root, { ref, ...props }) }));
|
|
4342
4539
|
Tabs.displayName = TabsPrimitive.Root.displayName;
|
|
4343
|
-
var TabsList =
|
|
4540
|
+
var TabsList = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4344
4541
|
TabsPrimitive.List,
|
|
4345
4542
|
{
|
|
4346
4543
|
ref,
|
|
@@ -4355,26 +4552,30 @@ var TabsList = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
4355
4552
|
}
|
|
4356
4553
|
));
|
|
4357
4554
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
4358
|
-
var TabsTrigger =
|
|
4555
|
+
var TabsTrigger = React52.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4359
4556
|
TabsPrimitive.Trigger,
|
|
4360
4557
|
{
|
|
4361
4558
|
ref,
|
|
4362
4559
|
className: cn(
|
|
4363
|
-
"inline-flex min-w-0 items-center justify-center whitespace-nowrap text-sm
|
|
4560
|
+
"group inline-flex min-w-0 items-center justify-center whitespace-nowrap text-sm",
|
|
4364
4561
|
"transition-all duration-150 text-muted-foreground hover:text-primary",
|
|
4365
4562
|
"ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
4366
4563
|
"data-[orientation=horizontal]:px-4 data-[orientation=horizontal]:py-3 data-[orientation=horizontal]:border-b-2 data-[orientation=horizontal]:border-transparent",
|
|
4367
4564
|
"data-[orientation=vertical]:w-full data-[orientation=vertical]:justify-start data-[orientation=vertical]:px-3 data-[orientation=vertical]:py-2 data-[orientation=vertical]:border-l-2 data-[orientation=vertical]:border-border",
|
|
4368
|
-
"data-[state=active]:text-primary data-[state=active]:
|
|
4565
|
+
"data-[state=active]:text-primary data-[state=active]:border-primary",
|
|
4369
4566
|
"disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4370
4567
|
className
|
|
4371
4568
|
),
|
|
4372
|
-
...props
|
|
4569
|
+
...props,
|
|
4570
|
+
children: /* @__PURE__ */ jsxs("span", { className: "relative inline-flex", children: [
|
|
4571
|
+
/* @__PURE__ */ jsx("span", { className: "invisible font-semibold", "aria-hidden": "true", children }),
|
|
4572
|
+
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 flex items-center justify-center font-medium group-data-[state=active]:font-semibold", children })
|
|
4573
|
+
] })
|
|
4373
4574
|
}
|
|
4374
4575
|
));
|
|
4375
4576
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
4376
|
-
var TabsContent =
|
|
4377
|
-
const { destroyInactiveTabs } =
|
|
4577
|
+
var TabsContent = React52.forwardRef(({ className, ...props }, ref) => {
|
|
4578
|
+
const { destroyInactiveTabs } = React52.useContext(TabsContext);
|
|
4378
4579
|
return /* @__PURE__ */ jsx(
|
|
4379
4580
|
TabsPrimitive.Content,
|
|
4380
4581
|
{
|
|
@@ -4463,7 +4664,7 @@ var separatorVariants = cva("shrink-0 bg-line-normal", {
|
|
|
4463
4664
|
variant: "default"
|
|
4464
4665
|
}
|
|
4465
4666
|
});
|
|
4466
|
-
var Separator5 =
|
|
4667
|
+
var Separator5 = React52.forwardRef(
|
|
4467
4668
|
({
|
|
4468
4669
|
className,
|
|
4469
4670
|
orientation = "horizontal",
|
|
@@ -4520,7 +4721,7 @@ var AspectRatio = AspectRatioPrimitive.Root;
|
|
|
4520
4721
|
|
|
4521
4722
|
// src/components/ui/accordion/index.tsx
|
|
4522
4723
|
init_utils();
|
|
4523
|
-
var Accordion =
|
|
4724
|
+
var Accordion = React52.forwardRef(
|
|
4524
4725
|
({
|
|
4525
4726
|
items,
|
|
4526
4727
|
className,
|
|
@@ -4530,7 +4731,7 @@ var Accordion = React49.forwardRef(
|
|
|
4530
4731
|
renderItem,
|
|
4531
4732
|
...props
|
|
4532
4733
|
}, ref) => {
|
|
4533
|
-
const defaultRenderItem =
|
|
4734
|
+
const defaultRenderItem = React52.useCallback(
|
|
4534
4735
|
(item) => /* @__PURE__ */ jsxs(
|
|
4535
4736
|
AccordionPrimitive.Item,
|
|
4536
4737
|
{
|
|
@@ -4578,7 +4779,7 @@ Accordion.displayName = "Accordion";
|
|
|
4578
4779
|
// src/components/ui/collapsible/index.tsx
|
|
4579
4780
|
init_utils();
|
|
4580
4781
|
var Collapsible = CollapsiblePrimitive.Root;
|
|
4581
|
-
var CollapsibleItem =
|
|
4782
|
+
var CollapsibleItem = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4582
4783
|
"div",
|
|
4583
4784
|
{
|
|
4584
4785
|
ref,
|
|
@@ -4590,7 +4791,7 @@ var CollapsibleItem = React49.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
4590
4791
|
}
|
|
4591
4792
|
));
|
|
4592
4793
|
CollapsibleItem.displayName = "CollapsibleItem";
|
|
4593
|
-
var CollapsibleTrigger =
|
|
4794
|
+
var CollapsibleTrigger = React52.forwardRef(({ className, children, indicator, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
4594
4795
|
CollapsiblePrimitive.Trigger,
|
|
4595
4796
|
{
|
|
4596
4797
|
ref,
|
|
@@ -4616,7 +4817,7 @@ var CollapsibleTrigger = React49.forwardRef(({ className, children, indicator, .
|
|
|
4616
4817
|
}
|
|
4617
4818
|
));
|
|
4618
4819
|
CollapsibleTrigger.displayName = CollapsiblePrimitive.Trigger.displayName;
|
|
4619
|
-
var CollapsibleContent =
|
|
4820
|
+
var CollapsibleContent = React52.forwardRef(({ className, contentClassName, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4620
4821
|
CollapsiblePrimitive.Content,
|
|
4621
4822
|
{
|
|
4622
4823
|
ref,
|
|
@@ -4667,7 +4868,7 @@ var ResizableHandle = ({
|
|
|
4667
4868
|
|
|
4668
4869
|
// src/components/ui/scroll-area/index.tsx
|
|
4669
4870
|
init_utils();
|
|
4670
|
-
var ScrollArea =
|
|
4871
|
+
var ScrollArea = React52.forwardRef(
|
|
4671
4872
|
({
|
|
4672
4873
|
className,
|
|
4673
4874
|
children,
|
|
@@ -4722,7 +4923,7 @@ var ScrollArea = React49.forwardRef(
|
|
|
4722
4923
|
}
|
|
4723
4924
|
);
|
|
4724
4925
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
4725
|
-
var ScrollBar =
|
|
4926
|
+
var ScrollBar = React52.forwardRef(({ className, orientation = "vertical", thumbClassName, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4726
4927
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
4727
4928
|
{
|
|
4728
4929
|
ref,
|
|
@@ -4754,9 +4955,9 @@ var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
|
4754
4955
|
var SIDEBAR_WIDTH = "16rem";
|
|
4755
4956
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
4756
4957
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
4757
|
-
var SidebarContext =
|
|
4958
|
+
var SidebarContext = React52.createContext(null);
|
|
4758
4959
|
function useSidebar() {
|
|
4759
|
-
const context =
|
|
4960
|
+
const context = React52.useContext(SidebarContext);
|
|
4760
4961
|
if (!context) {
|
|
4761
4962
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
4762
4963
|
}
|
|
@@ -4771,9 +4972,9 @@ function SidebarProvider({
|
|
|
4771
4972
|
children,
|
|
4772
4973
|
...props
|
|
4773
4974
|
}) {
|
|
4774
|
-
const [_open, _setOpen] =
|
|
4975
|
+
const [_open, _setOpen] = React52.useState(defaultOpen);
|
|
4775
4976
|
const open = openProp ?? _open;
|
|
4776
|
-
const setOpen =
|
|
4977
|
+
const setOpen = React52.useCallback(
|
|
4777
4978
|
(value) => {
|
|
4778
4979
|
const openState = typeof value === "function" ? value(open) : value;
|
|
4779
4980
|
if (setOpenProp) {
|
|
@@ -4785,10 +4986,10 @@ function SidebarProvider({
|
|
|
4785
4986
|
},
|
|
4786
4987
|
[setOpenProp, open]
|
|
4787
4988
|
);
|
|
4788
|
-
const toggleSidebar =
|
|
4989
|
+
const toggleSidebar = React52.useCallback(() => {
|
|
4789
4990
|
return setOpen((open2) => !open2);
|
|
4790
4991
|
}, [setOpen]);
|
|
4791
|
-
|
|
4992
|
+
React52.useEffect(() => {
|
|
4792
4993
|
const handleKeyDown = (event) => {
|
|
4793
4994
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
4794
4995
|
event.preventDefault();
|
|
@@ -4799,7 +5000,7 @@ function SidebarProvider({
|
|
|
4799
5000
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
4800
5001
|
}, [toggleSidebar]);
|
|
4801
5002
|
const state = open ? "expanded" : "collapsed";
|
|
4802
|
-
const contextValue =
|
|
5003
|
+
const contextValue = React52.useMemo(
|
|
4803
5004
|
() => ({
|
|
4804
5005
|
state,
|
|
4805
5006
|
open,
|
|
@@ -4834,7 +5035,25 @@ function Sidebar({
|
|
|
4834
5035
|
children,
|
|
4835
5036
|
...props
|
|
4836
5037
|
}) {
|
|
4837
|
-
const { state } = useSidebar();
|
|
5038
|
+
const { state, open, setOpen } = useSidebar();
|
|
5039
|
+
const isMobile = useIsMobile();
|
|
5040
|
+
if (isMobile) {
|
|
5041
|
+
return /* @__PURE__ */ jsx(Sheet, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsx(
|
|
5042
|
+
SheetContent,
|
|
5043
|
+
{
|
|
5044
|
+
side,
|
|
5045
|
+
className: cn(
|
|
5046
|
+
"w-[280px] max-w-[80vw] p-0",
|
|
5047
|
+
"pt-[var(--mvn-safe-area-top)]",
|
|
5048
|
+
className
|
|
5049
|
+
),
|
|
5050
|
+
hideClose: true,
|
|
5051
|
+
"data-slot": "sidebar",
|
|
5052
|
+
"data-mobile": "true",
|
|
5053
|
+
children: /* @__PURE__ */ jsx("div", { className: "bg-sidebar text-sidebar-foreground flex h-full w-full flex-col", children })
|
|
5054
|
+
}
|
|
5055
|
+
) });
|
|
5056
|
+
}
|
|
4838
5057
|
if (collapsible === "none") {
|
|
4839
5058
|
return /* @__PURE__ */ jsx(
|
|
4840
5059
|
"div",
|
|
@@ -5265,7 +5484,7 @@ function SidebarMenuSkeleton({
|
|
|
5265
5484
|
showIcon = false,
|
|
5266
5485
|
...props
|
|
5267
5486
|
}) {
|
|
5268
|
-
const width =
|
|
5487
|
+
const width = React52.useMemo(() => {
|
|
5269
5488
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
5270
5489
|
}, []);
|
|
5271
5490
|
return /* @__PURE__ */ jsxs(
|
|
@@ -5358,6 +5577,166 @@ function SidebarMenuSubButton({
|
|
|
5358
5577
|
);
|
|
5359
5578
|
}
|
|
5360
5579
|
|
|
5580
|
+
// src/components/ui/mobile-header/index.tsx
|
|
5581
|
+
init_utils();
|
|
5582
|
+
function MobileHeader({
|
|
5583
|
+
logo,
|
|
5584
|
+
title,
|
|
5585
|
+
rightActions,
|
|
5586
|
+
showSidebarTrigger = true,
|
|
5587
|
+
stickyTop = true,
|
|
5588
|
+
className,
|
|
5589
|
+
...props
|
|
5590
|
+
}) {
|
|
5591
|
+
const sidebar = useSidebar();
|
|
5592
|
+
return /* @__PURE__ */ jsxs(
|
|
5593
|
+
"header",
|
|
5594
|
+
{
|
|
5595
|
+
"data-slot": "mobile-header",
|
|
5596
|
+
className: cn(
|
|
5597
|
+
"flex items-center h-14 bg-background border-b border-border px-4 gap-3 md:hidden",
|
|
5598
|
+
"pt-[var(--mvn-safe-area-top)]",
|
|
5599
|
+
stickyTop && "sticky top-0 z-40",
|
|
5600
|
+
className
|
|
5601
|
+
),
|
|
5602
|
+
...props,
|
|
5603
|
+
children: [
|
|
5604
|
+
showSidebarTrigger && /* @__PURE__ */ jsx(
|
|
5605
|
+
Button,
|
|
5606
|
+
{
|
|
5607
|
+
variant: "ghost",
|
|
5608
|
+
size: "icon",
|
|
5609
|
+
className: "-ml-2",
|
|
5610
|
+
onClick: () => sidebar.setOpen(true),
|
|
5611
|
+
"aria-label": "Open menu",
|
|
5612
|
+
children: /* @__PURE__ */ jsx(MenuIcon, { className: "h-5 w-5" })
|
|
5613
|
+
}
|
|
5614
|
+
),
|
|
5615
|
+
logo && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: logo }),
|
|
5616
|
+
title && /* @__PURE__ */ jsx("span", { className: "font-semibold truncate flex-1 text-foreground", children: title }),
|
|
5617
|
+
rightActions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 shrink-0", children: rightActions })
|
|
5618
|
+
]
|
|
5619
|
+
}
|
|
5620
|
+
);
|
|
5621
|
+
}
|
|
5622
|
+
MobileHeader.displayName = "MobileHeader";
|
|
5623
|
+
|
|
5624
|
+
// src/components/ui/bottom-navigation/index.tsx
|
|
5625
|
+
init_utils();
|
|
5626
|
+
function BottomNavigation({
|
|
5627
|
+
items,
|
|
5628
|
+
activeKey,
|
|
5629
|
+
onActiveChange,
|
|
5630
|
+
hideOnDesktop = true,
|
|
5631
|
+
className,
|
|
5632
|
+
...props
|
|
5633
|
+
}) {
|
|
5634
|
+
return /* @__PURE__ */ jsx(
|
|
5635
|
+
"nav",
|
|
5636
|
+
{
|
|
5637
|
+
"data-slot": "bottom-navigation",
|
|
5638
|
+
className: cn(
|
|
5639
|
+
"fixed bottom-0 left-0 right-0 bg-background border-t border-border",
|
|
5640
|
+
"flex justify-around items-center h-16",
|
|
5641
|
+
"pb-[var(--mvn-safe-area-bottom)]",
|
|
5642
|
+
"z-40",
|
|
5643
|
+
hideOnDesktop && "md:hidden",
|
|
5644
|
+
className
|
|
5645
|
+
),
|
|
5646
|
+
...props,
|
|
5647
|
+
children: items.map((item) => {
|
|
5648
|
+
const isActive = activeKey === item.key;
|
|
5649
|
+
const Component = item.href ? "a" : "button";
|
|
5650
|
+
return /* @__PURE__ */ jsxs(
|
|
5651
|
+
Component,
|
|
5652
|
+
{
|
|
5653
|
+
href: item.href,
|
|
5654
|
+
onClick: () => {
|
|
5655
|
+
if (!item.disabled) {
|
|
5656
|
+
item.onClick?.();
|
|
5657
|
+
onActiveChange?.(item.key);
|
|
5658
|
+
}
|
|
5659
|
+
},
|
|
5660
|
+
disabled: item.disabled,
|
|
5661
|
+
className: cn(
|
|
5662
|
+
"flex flex-col items-center justify-center gap-1 flex-1 h-full relative",
|
|
5663
|
+
"text-muted-foreground transition-colors",
|
|
5664
|
+
"min-w-[64px] min-h-[48px]",
|
|
5665
|
+
"hover:text-foreground focus:outline-none focus-visible:text-foreground",
|
|
5666
|
+
isActive && "text-primary",
|
|
5667
|
+
item.disabled && "opacity-50 pointer-events-none"
|
|
5668
|
+
),
|
|
5669
|
+
"aria-current": isActive ? "page" : void 0,
|
|
5670
|
+
children: [
|
|
5671
|
+
/* @__PURE__ */ jsxs("span", { className: "relative", children: [
|
|
5672
|
+
item.icon,
|
|
5673
|
+
item.badge !== void 0 && /* @__PURE__ */ jsx(
|
|
5674
|
+
"span",
|
|
5675
|
+
{
|
|
5676
|
+
className: cn(
|
|
5677
|
+
"absolute -top-1 -right-2 min-w-[18px] h-[18px]",
|
|
5678
|
+
"bg-destructive text-destructive-foreground",
|
|
5679
|
+
"rounded-full text-[10px] font-medium",
|
|
5680
|
+
"flex items-center justify-center px-1"
|
|
5681
|
+
),
|
|
5682
|
+
children: typeof item.badge === "number" && item.badge > 99 ? "99+" : item.badge
|
|
5683
|
+
}
|
|
5684
|
+
)
|
|
5685
|
+
] }),
|
|
5686
|
+
/* @__PURE__ */ jsx("span", { className: "text-[11px] font-medium leading-tight", children: item.label })
|
|
5687
|
+
]
|
|
5688
|
+
},
|
|
5689
|
+
item.key
|
|
5690
|
+
);
|
|
5691
|
+
})
|
|
5692
|
+
}
|
|
5693
|
+
);
|
|
5694
|
+
}
|
|
5695
|
+
BottomNavigation.displayName = "BottomNavigation";
|
|
5696
|
+
var MobileNavContext = React52.createContext(
|
|
5697
|
+
null
|
|
5698
|
+
);
|
|
5699
|
+
function useMobileNav() {
|
|
5700
|
+
const context = React52.useContext(MobileNavContext);
|
|
5701
|
+
if (!context) {
|
|
5702
|
+
throw new Error(
|
|
5703
|
+
"useMobileNav must be used within MobileNavigationProvider"
|
|
5704
|
+
);
|
|
5705
|
+
}
|
|
5706
|
+
return context;
|
|
5707
|
+
}
|
|
5708
|
+
function MobileNavigationProvider({
|
|
5709
|
+
children,
|
|
5710
|
+
hideBottomNavOnScroll = false
|
|
5711
|
+
}) {
|
|
5712
|
+
const [bottomNavVisible, setBottomNavVisible] = React52.useState(true);
|
|
5713
|
+
const lastScrollY = React52.useRef(0);
|
|
5714
|
+
React52.useEffect(() => {
|
|
5715
|
+
if (!hideBottomNavOnScroll) return;
|
|
5716
|
+
const handleScroll = () => {
|
|
5717
|
+
const currentY = window.scrollY;
|
|
5718
|
+
const direction = currentY > lastScrollY.current ? "down" : "up";
|
|
5719
|
+
if (direction === "down" && currentY > 50) {
|
|
5720
|
+
setBottomNavVisible(false);
|
|
5721
|
+
} else if (direction === "up") {
|
|
5722
|
+
setBottomNavVisible(true);
|
|
5723
|
+
}
|
|
5724
|
+
lastScrollY.current = currentY;
|
|
5725
|
+
};
|
|
5726
|
+
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
5727
|
+
return () => window.removeEventListener("scroll", handleScroll);
|
|
5728
|
+
}, [hideBottomNavOnScroll]);
|
|
5729
|
+
const value = React52.useMemo(
|
|
5730
|
+
() => ({
|
|
5731
|
+
bottomNavVisible,
|
|
5732
|
+
setBottomNavVisible
|
|
5733
|
+
}),
|
|
5734
|
+
[bottomNavVisible]
|
|
5735
|
+
);
|
|
5736
|
+
return /* @__PURE__ */ jsx(MobileNavContext.Provider, { value, children });
|
|
5737
|
+
}
|
|
5738
|
+
MobileNavigationProvider.displayName = "MobileNavigationProvider";
|
|
5739
|
+
|
|
5361
5740
|
// src/components/ui/table/index.tsx
|
|
5362
5741
|
init_utils();
|
|
5363
5742
|
|
|
@@ -5384,7 +5763,7 @@ var tableVariants = cva("w-full caption-bottom text-sm", {
|
|
|
5384
5763
|
size: "default"
|
|
5385
5764
|
}
|
|
5386
5765
|
});
|
|
5387
|
-
var Table =
|
|
5766
|
+
var Table = React52.forwardRef(({ className, variant, size, wrapperClassName, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn("relative w-full overflow-auto", wrapperClassName), children: /* @__PURE__ */ jsx(
|
|
5388
5767
|
"table",
|
|
5389
5768
|
{
|
|
5390
5769
|
ref,
|
|
@@ -5393,9 +5772,9 @@ var Table = React49.forwardRef(({ className, variant, size, wrapperClassName, ..
|
|
|
5393
5772
|
}
|
|
5394
5773
|
) }));
|
|
5395
5774
|
Table.displayName = "Table";
|
|
5396
|
-
var TableHeader =
|
|
5775
|
+
var TableHeader = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
5397
5776
|
TableHeader.displayName = "TableHeader";
|
|
5398
|
-
var TableBody =
|
|
5777
|
+
var TableBody = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5399
5778
|
"tbody",
|
|
5400
5779
|
{
|
|
5401
5780
|
ref,
|
|
@@ -5404,7 +5783,7 @@ var TableBody = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
5404
5783
|
}
|
|
5405
5784
|
));
|
|
5406
5785
|
TableBody.displayName = "TableBody";
|
|
5407
|
-
var TableFooter =
|
|
5786
|
+
var TableFooter = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5408
5787
|
"tfoot",
|
|
5409
5788
|
{
|
|
5410
5789
|
ref,
|
|
@@ -5416,7 +5795,7 @@ var TableFooter = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
5416
5795
|
}
|
|
5417
5796
|
));
|
|
5418
5797
|
TableFooter.displayName = "TableFooter";
|
|
5419
|
-
var TableRow =
|
|
5798
|
+
var TableRow = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5420
5799
|
"tr",
|
|
5421
5800
|
{
|
|
5422
5801
|
ref,
|
|
@@ -5428,7 +5807,7 @@ var TableRow = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5428
5807
|
}
|
|
5429
5808
|
));
|
|
5430
5809
|
TableRow.displayName = "TableRow";
|
|
5431
|
-
var TableHead =
|
|
5810
|
+
var TableHead = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5432
5811
|
"th",
|
|
5433
5812
|
{
|
|
5434
5813
|
ref,
|
|
@@ -5440,7 +5819,7 @@ var TableHead = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
5440
5819
|
}
|
|
5441
5820
|
));
|
|
5442
5821
|
TableHead.displayName = "TableHead";
|
|
5443
|
-
var TableCell =
|
|
5822
|
+
var TableCell = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5444
5823
|
"td",
|
|
5445
5824
|
{
|
|
5446
5825
|
ref,
|
|
@@ -5452,7 +5831,7 @@ var TableCell = React49.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
5452
5831
|
}
|
|
5453
5832
|
));
|
|
5454
5833
|
TableCell.displayName = "TableCell";
|
|
5455
|
-
var TableCaption =
|
|
5834
|
+
var TableCaption = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5456
5835
|
"caption",
|
|
5457
5836
|
{
|
|
5458
5837
|
ref,
|
|
@@ -5498,7 +5877,9 @@ var TableBodyComponent = ({
|
|
|
5498
5877
|
rowClassName,
|
|
5499
5878
|
onRowClick,
|
|
5500
5879
|
getRowExpandable,
|
|
5501
|
-
invalidateCache
|
|
5880
|
+
invalidateCache,
|
|
5881
|
+
headers,
|
|
5882
|
+
hasInitializedSizing
|
|
5502
5883
|
}) => {
|
|
5503
5884
|
const resolveRowClassName = useCallback(
|
|
5504
5885
|
(record, index) => {
|
|
@@ -5539,6 +5920,37 @@ var TableBodyComponent = ({
|
|
|
5539
5920
|
}
|
|
5540
5921
|
return flexRender(cell.column.columnDef.cell, cell.getContext());
|
|
5541
5922
|
};
|
|
5923
|
+
const { leftOffsets, rightOffsets } = useMemo(() => {
|
|
5924
|
+
if (!headers || headers.length === 0) {
|
|
5925
|
+
return {
|
|
5926
|
+
leftOffsets: /* @__PURE__ */ new Map(),
|
|
5927
|
+
rightOffsets: /* @__PURE__ */ new Map()
|
|
5928
|
+
};
|
|
5929
|
+
}
|
|
5930
|
+
const leftPinned = headers.filter(
|
|
5931
|
+
(h) => h.column.getIsPinned() === "left"
|
|
5932
|
+
);
|
|
5933
|
+
const rightPinned = headers.filter(
|
|
5934
|
+
(h) => h.column.getIsPinned() === "right"
|
|
5935
|
+
);
|
|
5936
|
+
const leftMap = /* @__PURE__ */ new Map();
|
|
5937
|
+
let leftAcc = 0;
|
|
5938
|
+
for (const h of leftPinned) {
|
|
5939
|
+
leftMap.set(h.column.id, leftAcc);
|
|
5940
|
+
leftAcc += h.getSize();
|
|
5941
|
+
}
|
|
5942
|
+
const rightMap = /* @__PURE__ */ new Map();
|
|
5943
|
+
let rightAcc = 0;
|
|
5944
|
+
for (let i = rightPinned.length - 1; i >= 0; i--) {
|
|
5945
|
+
const h = rightPinned[i];
|
|
5946
|
+
rightMap.set(h.column.id, rightAcc);
|
|
5947
|
+
rightAcc += h.getSize();
|
|
5948
|
+
}
|
|
5949
|
+
return {
|
|
5950
|
+
leftOffsets: leftMap,
|
|
5951
|
+
rightOffsets: rightMap
|
|
5952
|
+
};
|
|
5953
|
+
}, [headers]);
|
|
5542
5954
|
const renderBaseRow = useCallback(
|
|
5543
5955
|
(rowData, options = {}) => {
|
|
5544
5956
|
const { ref, virtualIndex } = options;
|
|
@@ -5560,6 +5972,32 @@ var TableBodyComponent = ({
|
|
|
5560
5972
|
onClick: () => onRowClick?.(rowData.original, rowData.index),
|
|
5561
5973
|
children: rowData.getVisibleCells().map((cell) => {
|
|
5562
5974
|
const meta = cell.column.columnDef.meta;
|
|
5975
|
+
const pinPosition = cell.column.getIsPinned();
|
|
5976
|
+
const cellStyle = {};
|
|
5977
|
+
if (hasInitializedSizing) {
|
|
5978
|
+
const fallbackWidth = cell.column.getSize();
|
|
5979
|
+
cellStyle.width = `var(--mvn-col-${cell.column.id}-width, ${fallbackWidth}px)`;
|
|
5980
|
+
cellStyle.maxWidth = `var(--mvn-col-${cell.column.id}-width, ${fallbackWidth}px)`;
|
|
5981
|
+
cellStyle.overflow = "hidden";
|
|
5982
|
+
cellStyle.textOverflow = "ellipsis";
|
|
5983
|
+
cellStyle.whiteSpace = "nowrap";
|
|
5984
|
+
}
|
|
5985
|
+
if (pinPosition === "left") {
|
|
5986
|
+
const offset = leftOffsets.get(cell.column.id);
|
|
5987
|
+
if (offset !== void 0) {
|
|
5988
|
+
cellStyle.position = "sticky";
|
|
5989
|
+
cellStyle.left = `var(--mvn-col-${cell.column.id}-left, ${offset}px)`;
|
|
5990
|
+
cellStyle.zIndex = 5;
|
|
5991
|
+
}
|
|
5992
|
+
} else if (pinPosition === "right") {
|
|
5993
|
+
const offset = rightOffsets.get(cell.column.id);
|
|
5994
|
+
if (offset !== void 0) {
|
|
5995
|
+
cellStyle.position = "sticky";
|
|
5996
|
+
cellStyle.right = `var(--mvn-col-${cell.column.id}-right, ${offset}px)`;
|
|
5997
|
+
cellStyle.zIndex = 5;
|
|
5998
|
+
}
|
|
5999
|
+
}
|
|
6000
|
+
const hasStyles = Object.keys(cellStyle).length > 0;
|
|
5563
6001
|
return /* @__PURE__ */ jsx(
|
|
5564
6002
|
TableCell,
|
|
5565
6003
|
{
|
|
@@ -5567,9 +6005,11 @@ var TableBodyComponent = ({
|
|
|
5567
6005
|
meta?.className,
|
|
5568
6006
|
meta?.align === "center" && "text-center",
|
|
5569
6007
|
meta?.align === "right" && "text-right",
|
|
5570
|
-
meta?.align === "left" && "text-left"
|
|
6008
|
+
meta?.align === "left" && "text-left",
|
|
6009
|
+
// Pinned cell styling
|
|
6010
|
+
pinPosition && "bg-background"
|
|
5571
6011
|
),
|
|
5572
|
-
style:
|
|
6012
|
+
style: hasStyles ? cellStyle : void 0,
|
|
5573
6013
|
children: onRenderedRow(cell, virtualIndex)
|
|
5574
6014
|
},
|
|
5575
6015
|
cell.id
|
|
@@ -5579,7 +6019,13 @@ var TableBodyComponent = ({
|
|
|
5579
6019
|
`row-${rowData.index}`
|
|
5580
6020
|
);
|
|
5581
6021
|
},
|
|
5582
|
-
[
|
|
6022
|
+
[
|
|
6023
|
+
onRowClick,
|
|
6024
|
+
resolveRowClassName,
|
|
6025
|
+
leftOffsets,
|
|
6026
|
+
rightOffsets,
|
|
6027
|
+
hasInitializedSizing
|
|
6028
|
+
]
|
|
5583
6029
|
);
|
|
5584
6030
|
const renderExpandedRow = useCallback(
|
|
5585
6031
|
(rowData, options = {}) => {
|
|
@@ -5668,9 +6114,146 @@ var TableBodyComponent = ({
|
|
|
5668
6114
|
] }, row.id)) });
|
|
5669
6115
|
};
|
|
5670
6116
|
|
|
6117
|
+
// src/components/ui/table/components/TableCardView.tsx
|
|
6118
|
+
init_utils();
|
|
6119
|
+
var CARD_BASE_CLASSES = "border border-border rounded-lg bg-card overflow-hidden transition-shadow hover:shadow-md";
|
|
6120
|
+
function renderCellValue(col, value, record, index) {
|
|
6121
|
+
if (col.mobileRender) return col.mobileRender(value, record, index);
|
|
6122
|
+
if (col.render) return col.render(value, record, index);
|
|
6123
|
+
return String(value ?? "");
|
|
6124
|
+
}
|
|
6125
|
+
function TableCardView({
|
|
6126
|
+
rows,
|
|
6127
|
+
columns,
|
|
6128
|
+
selectable,
|
|
6129
|
+
expandable,
|
|
6130
|
+
onRowClick,
|
|
6131
|
+
rowClassName,
|
|
6132
|
+
renderExpandedContent,
|
|
6133
|
+
mobileCardActions,
|
|
6134
|
+
emptyMessage = "No data",
|
|
6135
|
+
renderMobileCard
|
|
6136
|
+
}) {
|
|
6137
|
+
if (rows.length === 0) {
|
|
6138
|
+
return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12 text-muted-foreground", children: emptyMessage });
|
|
6139
|
+
}
|
|
6140
|
+
const mobileColumns = React52.useMemo(() => {
|
|
6141
|
+
return columns.filter((col) => !col.mobileHidden && (col.mobileVisible ?? true)).sort((a, b) => (a.mobilePriority ?? 99) - (b.mobilePriority ?? 99)).slice(0, 6);
|
|
6142
|
+
}, [columns]);
|
|
6143
|
+
const headerColumn = mobileColumns[0];
|
|
6144
|
+
const bodyColumns = mobileColumns.slice(1);
|
|
6145
|
+
const hasCardContent = bodyColumns.length > 0 || mobileCardActions;
|
|
6146
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: rows.map((row) => {
|
|
6147
|
+
const record = row.original;
|
|
6148
|
+
const isSelected = row.getIsSelected();
|
|
6149
|
+
const isExpanded = row.getIsExpanded();
|
|
6150
|
+
const rowClasses = typeof rowClassName === "function" ? rowClassName(record, row.index) : rowClassName;
|
|
6151
|
+
const cardClassName = cn(
|
|
6152
|
+
CARD_BASE_CLASSES,
|
|
6153
|
+
isSelected && "ring-2 ring-primary",
|
|
6154
|
+
rowClasses
|
|
6155
|
+
);
|
|
6156
|
+
if (renderMobileCard) {
|
|
6157
|
+
return /* @__PURE__ */ jsx("div", { className: cardClassName, children: renderMobileCard(record, columns) }, row.id);
|
|
6158
|
+
}
|
|
6159
|
+
return /* @__PURE__ */ jsxs("div", { className: cardClassName, children: [
|
|
6160
|
+
/* @__PURE__ */ jsxs(
|
|
6161
|
+
"div",
|
|
6162
|
+
{
|
|
6163
|
+
className: cn(
|
|
6164
|
+
"flex items-center gap-3 p-4",
|
|
6165
|
+
hasCardContent && "border-b border-border",
|
|
6166
|
+
onRowClick && "cursor-pointer"
|
|
6167
|
+
),
|
|
6168
|
+
onClick: () => onRowClick?.(record, row.index),
|
|
6169
|
+
onKeyDown: onRowClick ? (e) => {
|
|
6170
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
6171
|
+
e.preventDefault();
|
|
6172
|
+
onRowClick(record, row.index);
|
|
6173
|
+
}
|
|
6174
|
+
} : void 0,
|
|
6175
|
+
role: onRowClick ? "button" : void 0,
|
|
6176
|
+
tabIndex: onRowClick ? 0 : void 0,
|
|
6177
|
+
children: [
|
|
6178
|
+
selectable && /* @__PURE__ */ jsx(
|
|
6179
|
+
Checkbox,
|
|
6180
|
+
{
|
|
6181
|
+
checked: isSelected,
|
|
6182
|
+
onCheckedChange: (checked) => row.toggleSelected(!!checked),
|
|
6183
|
+
onClick: (e) => e.stopPropagation(),
|
|
6184
|
+
"aria-label": "Select row"
|
|
6185
|
+
}
|
|
6186
|
+
),
|
|
6187
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 font-medium text-foreground truncate", children: headerColumn && renderCellValue(
|
|
6188
|
+
headerColumn,
|
|
6189
|
+
row.getValue(headerColumn.key),
|
|
6190
|
+
record,
|
|
6191
|
+
row.index
|
|
6192
|
+
) }),
|
|
6193
|
+
expandable && /* @__PURE__ */ jsx(
|
|
6194
|
+
"button",
|
|
6195
|
+
{
|
|
6196
|
+
onClick: (e) => {
|
|
6197
|
+
e.stopPropagation();
|
|
6198
|
+
row.toggleExpanded();
|
|
6199
|
+
},
|
|
6200
|
+
className: "p-1 text-muted-foreground hover:text-foreground transition-colors",
|
|
6201
|
+
"aria-label": isExpanded ? "Collapse" : "Expand",
|
|
6202
|
+
children: /* @__PURE__ */ jsx(
|
|
6203
|
+
ChevronDownIcon,
|
|
6204
|
+
{
|
|
6205
|
+
className: cn(
|
|
6206
|
+
"h-5 w-5 transition-transform",
|
|
6207
|
+
isExpanded && "rotate-180"
|
|
6208
|
+
)
|
|
6209
|
+
}
|
|
6210
|
+
)
|
|
6211
|
+
}
|
|
6212
|
+
)
|
|
6213
|
+
]
|
|
6214
|
+
}
|
|
6215
|
+
),
|
|
6216
|
+
bodyColumns.length > 0 && /* @__PURE__ */ jsx("div", { className: "p-4 space-y-2", children: bodyColumns.map((col) => {
|
|
6217
|
+
const isFullWidth = col.mobileWidth === "full";
|
|
6218
|
+
return /* @__PURE__ */ jsxs(
|
|
6219
|
+
"div",
|
|
6220
|
+
{
|
|
6221
|
+
className: cn(
|
|
6222
|
+
"flex justify-between items-start gap-2",
|
|
6223
|
+
isFullWidth && "flex-col"
|
|
6224
|
+
),
|
|
6225
|
+
children: [
|
|
6226
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground shrink-0", children: col.mobileLabel ?? col.title }),
|
|
6227
|
+
/* @__PURE__ */ jsx(
|
|
6228
|
+
"span",
|
|
6229
|
+
{
|
|
6230
|
+
className: cn(
|
|
6231
|
+
"text-sm text-foreground text-right",
|
|
6232
|
+
isFullWidth && "text-left w-full"
|
|
6233
|
+
),
|
|
6234
|
+
children: renderCellValue(
|
|
6235
|
+
col,
|
|
6236
|
+
row.getValue(col.key),
|
|
6237
|
+
record,
|
|
6238
|
+
row.index
|
|
6239
|
+
)
|
|
6240
|
+
}
|
|
6241
|
+
)
|
|
6242
|
+
]
|
|
6243
|
+
},
|
|
6244
|
+
col.key
|
|
6245
|
+
);
|
|
6246
|
+
}) }),
|
|
6247
|
+
mobileCardActions && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 p-4 pt-0 border-t border-border mt-2", children: mobileCardActions(record) }),
|
|
6248
|
+
expandable && isExpanded && renderExpandedContent && /* @__PURE__ */ jsx("div", { className: "p-4 border-t border-border bg-muted/50", children: renderExpandedContent(record, row) })
|
|
6249
|
+
] }, row.id);
|
|
6250
|
+
}) });
|
|
6251
|
+
}
|
|
6252
|
+
TableCardView.displayName = "TableCardView";
|
|
6253
|
+
|
|
5671
6254
|
// src/components/ui/table/components/TableHeaderComponent.tsx
|
|
5672
6255
|
init_utils();
|
|
5673
|
-
var
|
|
6256
|
+
var TABLE_FILTER_OPTIONS = [
|
|
5674
6257
|
{ value: "includesString", label: "Contains" },
|
|
5675
6258
|
{ value: "notContains", label: "Does not contain" },
|
|
5676
6259
|
{ value: "equals", label: "Equals" },
|
|
@@ -5678,25 +6261,20 @@ var TableFilterOptions = [
|
|
|
5678
6261
|
{ value: "startsWith", label: "Starts with" },
|
|
5679
6262
|
{ value: "endsWith", label: "Ends with" }
|
|
5680
6263
|
];
|
|
5681
|
-
var
|
|
6264
|
+
var PIN_OPTIONS = [
|
|
5682
6265
|
{ value: "left", label: "Pin Left" },
|
|
5683
6266
|
{ value: "right", label: "Pin Right" }
|
|
5684
6267
|
];
|
|
5685
|
-
var sizingOptions = [
|
|
5686
|
-
{ value: "single", label: "Autosize This Column" },
|
|
5687
|
-
{ value: "all", label: "Autosize All Columns" },
|
|
5688
|
-
{ value: "reset", label: "Reset All Columns" }
|
|
5689
|
-
];
|
|
5690
|
-
var sortOptions = [
|
|
5691
|
-
{ value: "asc", label: "Sort Ascending" },
|
|
5692
|
-
{ value: "desc", label: "Sort Descending" }
|
|
5693
|
-
];
|
|
5694
6268
|
var TableHeaderComponent = ({
|
|
5695
6269
|
header,
|
|
5696
6270
|
enableColumnOrdering,
|
|
5697
6271
|
baseColumnOrder,
|
|
5698
6272
|
setColumnOrder,
|
|
5699
|
-
draggedColumnId
|
|
6273
|
+
draggedColumnId,
|
|
6274
|
+
pinnedLeftOffset,
|
|
6275
|
+
pinnedRightOffset,
|
|
6276
|
+
hasInitializedSizing,
|
|
6277
|
+
startResize
|
|
5700
6278
|
}) => {
|
|
5701
6279
|
const column = header.column;
|
|
5702
6280
|
const meta = column.columnDef.meta;
|
|
@@ -5706,28 +6284,8 @@ var TableHeaderComponent = ({
|
|
|
5706
6284
|
};
|
|
5707
6285
|
const pinPosition = column.getIsPinned();
|
|
5708
6286
|
const sortDirection = column.getIsSorted();
|
|
5709
|
-
const
|
|
5710
|
-
const
|
|
5711
|
-
const sourceId = draggedColumnId.current;
|
|
5712
|
-
draggedColumnId.current = null;
|
|
5713
|
-
if (!sourceId || sourceId === targetId) return;
|
|
5714
|
-
moveColumnTo(sourceId, targetId);
|
|
5715
|
-
};
|
|
5716
|
-
const moveColumnTo = (sourceId, targetId) => {
|
|
5717
|
-
if (!enableColumnOrdering || sourceId.startsWith("_mvn_") || targetId.startsWith("_mvn_"))
|
|
5718
|
-
return;
|
|
5719
|
-
setColumnOrder((previous) => {
|
|
5720
|
-
const order = previous.length ? [...previous] : [...baseColumnOrder];
|
|
5721
|
-
const sourceIndex = order.indexOf(sourceId);
|
|
5722
|
-
const targetIndex = order.indexOf(targetId);
|
|
5723
|
-
if (sourceIndex === -1 || targetIndex === -1 || sourceIndex === targetIndex)
|
|
5724
|
-
return order;
|
|
5725
|
-
const next = [...order];
|
|
5726
|
-
next.splice(sourceIndex, 1);
|
|
5727
|
-
next.splice(targetIndex, 0, sourceId);
|
|
5728
|
-
return next;
|
|
5729
|
-
});
|
|
5730
|
-
};
|
|
6287
|
+
const isMvnColumn = column.id.startsWith("_mvn_");
|
|
6288
|
+
const isReorderTable = enableColumnOrdering && !isMvnColumn;
|
|
5731
6289
|
const [inputValue, setInputValue] = useState(value);
|
|
5732
6290
|
const debounceTimeoutRef = useRef(null);
|
|
5733
6291
|
useEffect(() => {
|
|
@@ -5766,167 +6324,245 @@ var TableHeaderComponent = ({
|
|
|
5766
6324
|
},
|
|
5767
6325
|
[debouncedFilterChange, filterType]
|
|
5768
6326
|
);
|
|
5769
|
-
const
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
6327
|
+
const moveColumnTo = useCallback(
|
|
6328
|
+
(sourceId, targetId) => {
|
|
6329
|
+
if (!enableColumnOrdering || sourceId.startsWith("_mvn_") || targetId.startsWith("_mvn_")) {
|
|
6330
|
+
return;
|
|
6331
|
+
}
|
|
6332
|
+
setColumnOrder((previous) => {
|
|
6333
|
+
const order = previous.length ? [...previous] : [...baseColumnOrder];
|
|
6334
|
+
const sourceIndex = order.indexOf(sourceId);
|
|
6335
|
+
const targetIndex = order.indexOf(targetId);
|
|
6336
|
+
if (sourceIndex === -1 || targetIndex === -1 || sourceIndex === targetIndex) {
|
|
6337
|
+
return order;
|
|
6338
|
+
}
|
|
6339
|
+
const next = [...order];
|
|
6340
|
+
next.splice(sourceIndex, 1);
|
|
6341
|
+
next.splice(targetIndex, 0, sourceId);
|
|
6342
|
+
return next;
|
|
6343
|
+
});
|
|
6344
|
+
},
|
|
6345
|
+
[baseColumnOrder, enableColumnOrdering, setColumnOrder]
|
|
6346
|
+
);
|
|
6347
|
+
const handleColumnDrop = useCallback(
|
|
6348
|
+
(targetId) => {
|
|
6349
|
+
const sourceId = draggedColumnId.current;
|
|
6350
|
+
draggedColumnId.current = null;
|
|
6351
|
+
if (!sourceId || sourceId === targetId) return;
|
|
6352
|
+
moveColumnTo(sourceId, targetId);
|
|
6353
|
+
},
|
|
6354
|
+
[draggedColumnId, moveColumnTo]
|
|
6355
|
+
);
|
|
6356
|
+
const handleResizeStart = useCallback(
|
|
6357
|
+
(event) => {
|
|
6358
|
+
event.stopPropagation();
|
|
6359
|
+
if (startResize) {
|
|
6360
|
+
const minSize = column.columnDef.minSize ?? 36;
|
|
6361
|
+
const maxSize = column.columnDef.maxSize ?? 9999;
|
|
6362
|
+
startResize(column.id, event, header.getSize(), minSize, maxSize);
|
|
6363
|
+
} else {
|
|
6364
|
+
header.getResizeHandler()(event);
|
|
6365
|
+
}
|
|
6366
|
+
},
|
|
6367
|
+
[
|
|
6368
|
+
column.columnDef.minSize,
|
|
6369
|
+
column.columnDef.maxSize,
|
|
6370
|
+
column.id,
|
|
6371
|
+
header,
|
|
6372
|
+
startResize
|
|
6373
|
+
]
|
|
6374
|
+
);
|
|
6375
|
+
const handleFilterTypeChange = useCallback(
|
|
6376
|
+
(selected) => {
|
|
6377
|
+
if (debounceTimeoutRef.current !== null) {
|
|
6378
|
+
window.clearTimeout(debounceTimeoutRef.current);
|
|
6379
|
+
debounceTimeoutRef.current = null;
|
|
6380
|
+
}
|
|
6381
|
+
handleFilterChange(selected, inputValue);
|
|
6382
|
+
},
|
|
6383
|
+
[debounceTimeoutRef, handleFilterChange, inputValue]
|
|
6384
|
+
);
|
|
6385
|
+
const showPopover = column.getCanPin() || column.getCanFilter();
|
|
6386
|
+
const cellStyle = {};
|
|
6387
|
+
if (hasInitializedSizing) {
|
|
6388
|
+
const fallbackWidth = Math.max(header.getSize(), 36);
|
|
6389
|
+
cellStyle.width = `var(--mvn-col-${column.id}-width, ${fallbackWidth}px)`;
|
|
6390
|
+
cellStyle.overflow = "hidden";
|
|
6391
|
+
cellStyle.textOverflow = "ellipsis";
|
|
6392
|
+
cellStyle.whiteSpace = "nowrap";
|
|
6393
|
+
}
|
|
6394
|
+
if (pinPosition === "left" && pinnedLeftOffset !== void 0) {
|
|
6395
|
+
cellStyle.position = "sticky";
|
|
6396
|
+
cellStyle.left = `var(--mvn-col-${column.id}-left, ${pinnedLeftOffset}px)`;
|
|
6397
|
+
cellStyle.zIndex = 20;
|
|
6398
|
+
} else if (pinPosition === "right" && pinnedRightOffset !== void 0) {
|
|
6399
|
+
cellStyle.position = "sticky";
|
|
6400
|
+
cellStyle.right = `var(--mvn-col-${column.id}-right, ${pinnedRightOffset}px)`;
|
|
6401
|
+
cellStyle.zIndex = 20;
|
|
6402
|
+
}
|
|
6403
|
+
return /* @__PURE__ */ jsxs(
|
|
6404
|
+
TableHead,
|
|
6405
|
+
{
|
|
6406
|
+
className: cn(
|
|
6407
|
+
"group",
|
|
6408
|
+
meta?.headerClassName,
|
|
6409
|
+
meta?.align === "center" && "text-center",
|
|
6410
|
+
meta?.align === "right" && "text-right",
|
|
6411
|
+
meta?.align === "left" && "text-left",
|
|
6412
|
+
column.getCanSort() && "select-none",
|
|
6413
|
+
"bg-mvn-gray-100 text-foreground sticky top-0 z-10",
|
|
6414
|
+
pinPosition && "bg-background"
|
|
6415
|
+
),
|
|
6416
|
+
style: cellStyle,
|
|
6417
|
+
children: [
|
|
6418
|
+
/* @__PURE__ */ jsxs(
|
|
6419
|
+
"div",
|
|
6420
|
+
{
|
|
6421
|
+
className: cn(
|
|
6422
|
+
"flex items-center w-full",
|
|
6423
|
+
meta?.align === "center" && "justify-center",
|
|
6424
|
+
meta?.align === "right" && "justify-end",
|
|
6425
|
+
meta?.align === "left" && "justify-start"
|
|
6426
|
+
),
|
|
6427
|
+
draggable: isReorderTable,
|
|
6428
|
+
onDragStart: (event) => {
|
|
6429
|
+
if (!isReorderTable) return;
|
|
6430
|
+
event.dataTransfer.effectAllowed = "move";
|
|
6431
|
+
draggedColumnId.current = column.id;
|
|
6432
|
+
},
|
|
6433
|
+
onDragEnd: () => {
|
|
6434
|
+
draggedColumnId.current = null;
|
|
6435
|
+
},
|
|
6436
|
+
onDragOver: (event) => {
|
|
6437
|
+
if (!isReorderTable || !draggedColumnId.current || draggedColumnId.current === column.id) {
|
|
6438
|
+
return;
|
|
6439
|
+
}
|
|
6440
|
+
event.preventDefault();
|
|
6441
|
+
event.dataTransfer.dropEffect = "move";
|
|
6442
|
+
},
|
|
6443
|
+
onDrop: (event) => {
|
|
6444
|
+
if (!isReorderTable) return;
|
|
6445
|
+
event.preventDefault();
|
|
6446
|
+
handleColumnDrop(column.id);
|
|
6447
|
+
},
|
|
6448
|
+
children: [
|
|
6449
|
+
/* @__PURE__ */ jsxs(
|
|
6450
|
+
"div",
|
|
6451
|
+
{
|
|
6452
|
+
className: cn(
|
|
6453
|
+
"flex gap-2 text-[16px] font-medium items-center",
|
|
6454
|
+
column.getCanSort() && "cursor-pointer"
|
|
6455
|
+
),
|
|
6456
|
+
onClick: () => {
|
|
6457
|
+
if (draggedColumnId.current) return;
|
|
6458
|
+
if (column.getCanSort()) {
|
|
6459
|
+
column.toggleSorting();
|
|
6460
|
+
}
|
|
6461
|
+
},
|
|
6462
|
+
children: [
|
|
6463
|
+
flexRender(column.columnDef.header, header.getContext()),
|
|
6464
|
+
sortDirection === "asc" && /* @__PURE__ */ jsx(ArrowUp, { className: "h-4 w-4 text-primary flex-shrink-0" }),
|
|
6465
|
+
sortDirection === "desc" && /* @__PURE__ */ jsx(ArrowDown, { className: "h-4 w-4 text-primary flex-shrink-0" })
|
|
6466
|
+
]
|
|
6467
|
+
}
|
|
6468
|
+
),
|
|
6469
|
+
!isMvnColumn && showPopover && /* @__PURE__ */ jsx(
|
|
6470
|
+
"span",
|
|
6471
|
+
{
|
|
6472
|
+
onClick: (event) => event.stopPropagation(),
|
|
6473
|
+
className: "ml-auto",
|
|
6474
|
+
children: /* @__PURE__ */ jsxs(Popover, { children: [
|
|
6475
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "p-1 h-4 w-4 rounded-sm cursor-pointer hover:bg-muted transition-colors" }) }),
|
|
6476
|
+
/* @__PURE__ */ jsx(PopoverContent, { side: "bottom", className: "pt-2", children: /* @__PURE__ */ jsxs(Tabs, { defaultValue: column.getCanPin() ? "pin" : "filter", children: [
|
|
6477
|
+
/* @__PURE__ */ jsxs(TabsList, { children: [
|
|
6478
|
+
column.getCanPin() && /* @__PURE__ */ jsx(
|
|
6479
|
+
TabsTrigger,
|
|
6480
|
+
{
|
|
6481
|
+
value: "pin",
|
|
6482
|
+
className: "data-[orientation=horizontal]:p-2",
|
|
6483
|
+
children: /* @__PURE__ */ jsx(Pin, { className: "h-4 w-4" })
|
|
5873
6484
|
}
|
|
5874
|
-
|
|
5875
|
-
|
|
6485
|
+
),
|
|
6486
|
+
column.getCanFilter() && /* @__PURE__ */ jsx(
|
|
6487
|
+
TabsTrigger,
|
|
6488
|
+
{
|
|
6489
|
+
value: "filter",
|
|
6490
|
+
className: "data-[orientation=horizontal]:p-2",
|
|
6491
|
+
children: /* @__PURE__ */ jsx(ListFilter, { className: "h-4 w-4" })
|
|
5876
6492
|
}
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
CheckIcon,
|
|
5882
|
-
{
|
|
5883
|
-
className: cn(
|
|
5884
|
-
"ml-auto h-4 w-4",
|
|
5885
|
-
pinPosition === option.value ? "opacity-100" : "opacity-0"
|
|
5886
|
-
)
|
|
5887
|
-
}
|
|
5888
|
-
)
|
|
5889
|
-
]
|
|
5890
|
-
},
|
|
5891
|
-
option.value
|
|
5892
|
-
)) }) }) }) }),
|
|
5893
|
-
column.getCanFilter() && /* @__PURE__ */ jsxs(TabsContent, { value: "filter", children: [
|
|
5894
|
-
/* @__PURE__ */ jsxs(
|
|
5895
|
-
Select,
|
|
6493
|
+
)
|
|
6494
|
+
] }),
|
|
6495
|
+
column.getCanPin() && /* @__PURE__ */ jsx(TabsContent, { value: "pin", className: "mt-4", children: /* @__PURE__ */ jsx(Command, { className: "h-auto", children: /* @__PURE__ */ jsx(CommandList, { children: /* @__PURE__ */ jsx(CommandGroup, { children: PIN_OPTIONS.map((option) => /* @__PURE__ */ jsxs(
|
|
6496
|
+
CommandItem,
|
|
5896
6497
|
{
|
|
5897
|
-
value:
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
}
|
|
5903
|
-
handleFilterChange(selected, inputValue);
|
|
6498
|
+
value: option.value,
|
|
6499
|
+
onSelect: () => {
|
|
6500
|
+
column.pin(
|
|
6501
|
+
option.value === pinPosition ? false : option.value
|
|
6502
|
+
);
|
|
5904
6503
|
},
|
|
5905
6504
|
children: [
|
|
5906
|
-
|
|
5907
|
-
/* @__PURE__ */ jsx(
|
|
6505
|
+
option.label,
|
|
6506
|
+
/* @__PURE__ */ jsx(
|
|
6507
|
+
CheckIcon,
|
|
6508
|
+
{
|
|
6509
|
+
className: cn(
|
|
6510
|
+
"ml-auto h-4 w-4",
|
|
6511
|
+
pinPosition === option.value ? "opacity-100" : "opacity-0"
|
|
6512
|
+
)
|
|
6513
|
+
}
|
|
6514
|
+
)
|
|
5908
6515
|
]
|
|
5909
|
-
}
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
6516
|
+
},
|
|
6517
|
+
option.value
|
|
6518
|
+
)) }) }) }) }),
|
|
6519
|
+
column.getCanFilter() && /* @__PURE__ */ jsxs(TabsContent, { value: "filter", className: "mt-2", children: [
|
|
6520
|
+
/* @__PURE__ */ jsxs(
|
|
6521
|
+
Select,
|
|
6522
|
+
{
|
|
6523
|
+
value: filterType,
|
|
6524
|
+
onValueChange: handleFilterTypeChange,
|
|
6525
|
+
children: [
|
|
6526
|
+
/* @__PURE__ */ jsx(SelectTrigger, { className: "mb-4", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
6527
|
+
/* @__PURE__ */ jsx(SelectContent, { children: TABLE_FILTER_OPTIONS.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value, children: option.label }, option.value)) })
|
|
6528
|
+
]
|
|
6529
|
+
}
|
|
6530
|
+
),
|
|
6531
|
+
/* @__PURE__ */ jsx(
|
|
6532
|
+
Input,
|
|
6533
|
+
{
|
|
6534
|
+
leftIcon: /* @__PURE__ */ jsx(SearchIcon, {}),
|
|
6535
|
+
value: inputValue,
|
|
6536
|
+
onChange: handleInputChange,
|
|
6537
|
+
clearable: true,
|
|
6538
|
+
onClear: () => column.setFilterValue({ filterType, value: "" }),
|
|
6539
|
+
placeholder: meta?.filterPlaceholder ?? "Filter\u2026"
|
|
6540
|
+
}
|
|
6541
|
+
)
|
|
6542
|
+
] })
|
|
6543
|
+
] }) })
|
|
6544
|
+
] })
|
|
6545
|
+
}
|
|
6546
|
+
)
|
|
6547
|
+
]
|
|
6548
|
+
}
|
|
6549
|
+
),
|
|
6550
|
+
column.getCanResize() && /* @__PURE__ */ jsx(
|
|
6551
|
+
"div",
|
|
6552
|
+
{
|
|
6553
|
+
onMouseDown: handleResizeStart,
|
|
6554
|
+
onTouchStart: handleResizeStart,
|
|
6555
|
+
onDoubleClick: () => header.column.resetSize(),
|
|
6556
|
+
className: cn(
|
|
6557
|
+
"absolute right-0 top-0 h-full w-4 cursor-w-resize select-none touch-none",
|
|
6558
|
+
"flex items-center justify-center",
|
|
6559
|
+
"opacity-0 group-hover:opacity-100 transition-opacity duration-150",
|
|
6560
|
+
header.column.getIsResizing() && "opacity-100 bg-primary/10"
|
|
6561
|
+
),
|
|
6562
|
+
style: { transform: "translateX(50%)" }
|
|
6563
|
+
}
|
|
6564
|
+
)
|
|
6565
|
+
]
|
|
5930
6566
|
},
|
|
5931
6567
|
header.id
|
|
5932
6568
|
);
|
|
@@ -5942,6 +6578,46 @@ var TableToolbarComponent = ({
|
|
|
5942
6578
|
customizeToolbar
|
|
5943
6579
|
}) => {
|
|
5944
6580
|
const toolbarVisible = enableExport || customizeToolbar || enableGlobalFilter;
|
|
6581
|
+
const [inputValue, setInputValue] = useState(globalFilter);
|
|
6582
|
+
const debounceTimeoutRef = useRef(null);
|
|
6583
|
+
useEffect(() => {
|
|
6584
|
+
setInputValue(globalFilter);
|
|
6585
|
+
}, [globalFilter]);
|
|
6586
|
+
useEffect(() => {
|
|
6587
|
+
return () => {
|
|
6588
|
+
if (debounceTimeoutRef.current !== null) {
|
|
6589
|
+
window.clearTimeout(debounceTimeoutRef.current);
|
|
6590
|
+
}
|
|
6591
|
+
};
|
|
6592
|
+
}, []);
|
|
6593
|
+
const debouncedSetGlobalFilter = useCallback(
|
|
6594
|
+
(nextValue) => {
|
|
6595
|
+
if (debounceTimeoutRef.current !== null) {
|
|
6596
|
+
window.clearTimeout(debounceTimeoutRef.current);
|
|
6597
|
+
}
|
|
6598
|
+
debounceTimeoutRef.current = window.setTimeout(() => {
|
|
6599
|
+
setGlobalFilter(nextValue);
|
|
6600
|
+
debounceTimeoutRef.current = null;
|
|
6601
|
+
}, 300);
|
|
6602
|
+
},
|
|
6603
|
+
[setGlobalFilter]
|
|
6604
|
+
);
|
|
6605
|
+
const handleInputChange = useCallback(
|
|
6606
|
+
(event) => {
|
|
6607
|
+
const nextValue = event.target.value;
|
|
6608
|
+
setInputValue(nextValue);
|
|
6609
|
+
debouncedSetGlobalFilter(nextValue);
|
|
6610
|
+
},
|
|
6611
|
+
[debouncedSetGlobalFilter]
|
|
6612
|
+
);
|
|
6613
|
+
const handleClear = useCallback(() => {
|
|
6614
|
+
if (debounceTimeoutRef.current !== null) {
|
|
6615
|
+
window.clearTimeout(debounceTimeoutRef.current);
|
|
6616
|
+
debounceTimeoutRef.current = null;
|
|
6617
|
+
}
|
|
6618
|
+
setInputValue("");
|
|
6619
|
+
setGlobalFilter("");
|
|
6620
|
+
}, [setGlobalFilter]);
|
|
5945
6621
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
5946
6622
|
toolbarVisible && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5947
6623
|
enableExport && /* @__PURE__ */ jsx(
|
|
@@ -5959,9 +6635,10 @@ var TableToolbarComponent = ({
|
|
|
5959
6635
|
Input,
|
|
5960
6636
|
{
|
|
5961
6637
|
leftIcon: /* @__PURE__ */ jsx(SearchIcon, {}),
|
|
5962
|
-
value:
|
|
5963
|
-
onChange:
|
|
6638
|
+
value: inputValue,
|
|
6639
|
+
onChange: handleInputChange,
|
|
5964
6640
|
clearable: true,
|
|
6641
|
+
onClear: handleClear,
|
|
5965
6642
|
placeholder: globalFilterPlaceholder
|
|
5966
6643
|
}
|
|
5967
6644
|
)
|
|
@@ -6059,7 +6736,10 @@ function useTableCore({
|
|
|
6059
6736
|
manualSorting,
|
|
6060
6737
|
onFilterChange,
|
|
6061
6738
|
getCheckboxProps,
|
|
6062
|
-
selectedRowKey
|
|
6739
|
+
selectedRowKey,
|
|
6740
|
+
defaultColumnPinning,
|
|
6741
|
+
enableColumnResizing = false,
|
|
6742
|
+
columnResizeMode = "onChange"
|
|
6063
6743
|
}) {
|
|
6064
6744
|
const [sorting, setSorting] = useState(
|
|
6065
6745
|
sortBy ? [{ id: sortBy, desc: sortDirection === "desc" }] : []
|
|
@@ -6073,8 +6753,24 @@ function useTableCore({
|
|
|
6073
6753
|
pageSize
|
|
6074
6754
|
});
|
|
6075
6755
|
const [columnPinning, setColumnPinning] = useState({
|
|
6076
|
-
left: [],
|
|
6077
|
-
right: []
|
|
6756
|
+
left: defaultColumnPinning?.left ?? [],
|
|
6757
|
+
right: defaultColumnPinning?.right ?? []
|
|
6758
|
+
});
|
|
6759
|
+
const [columnSizing, setColumnSizing] = useState(() => {
|
|
6760
|
+
if (!enableColumnResizing) return {};
|
|
6761
|
+
const initial = {};
|
|
6762
|
+
columns.forEach((col) => {
|
|
6763
|
+
if (col.size !== void 0) {
|
|
6764
|
+
const key = typeof col.key === "string" ? col.key : String(col.key);
|
|
6765
|
+
initial[key] = col.size;
|
|
6766
|
+
}
|
|
6767
|
+
});
|
|
6768
|
+
return initial;
|
|
6769
|
+
});
|
|
6770
|
+
const [columnSizingInfo, setColumnSizingInfo] = useState({});
|
|
6771
|
+
const [hasInitializedSizing, setHasInitializedSizing] = useState(() => {
|
|
6772
|
+
if (!enableColumnResizing) return false;
|
|
6773
|
+
return columns.some((col) => col.size !== void 0);
|
|
6078
6774
|
});
|
|
6079
6775
|
const dataLength = data.length;
|
|
6080
6776
|
const enableColumnFilters = useMemo(() => {
|
|
@@ -6200,6 +6896,9 @@ function useTableCore({
|
|
|
6200
6896
|
enableColumnFilter: column.filterable === true,
|
|
6201
6897
|
enablePinning: column.pinnable === true,
|
|
6202
6898
|
enableResizing: column.resizable === true,
|
|
6899
|
+
size: column.size,
|
|
6900
|
+
minSize: column.minSize,
|
|
6901
|
+
maxSize: column.maxSize,
|
|
6203
6902
|
meta: {
|
|
6204
6903
|
align: column.align,
|
|
6205
6904
|
className: column.className,
|
|
@@ -6329,11 +7028,156 @@ function useTableCore({
|
|
|
6329
7028
|
}
|
|
6330
7029
|
return paginationState;
|
|
6331
7030
|
}, [pagination, dataLength, paginationState]);
|
|
7031
|
+
const tableRef = useRef(null);
|
|
7032
|
+
const tableContainerRef = useRef(null);
|
|
7033
|
+
const resizeStateRef = useRef({
|
|
7034
|
+
isResizing: false,
|
|
7035
|
+
columnId: null,
|
|
7036
|
+
startX: 0,
|
|
7037
|
+
startWidth: 0,
|
|
7038
|
+
minSize: 36,
|
|
7039
|
+
maxSize: 9999
|
|
7040
|
+
});
|
|
7041
|
+
const pinnedColumnsRef = useRef({ left: [], right: [] });
|
|
7042
|
+
const updatePinnedOffsets = useCallback(() => {
|
|
7043
|
+
const container = tableContainerRef.current;
|
|
7044
|
+
if (!container) return;
|
|
7045
|
+
const { left, right } = pinnedColumnsRef.current;
|
|
7046
|
+
const computedStyle = getComputedStyle(container);
|
|
7047
|
+
let leftAcc = 0;
|
|
7048
|
+
for (const col of left) {
|
|
7049
|
+
container.style.setProperty(`--mvn-col-${col.id}-left`, `${leftAcc}px`);
|
|
7050
|
+
const widthVar = computedStyle.getPropertyValue(
|
|
7051
|
+
`--mvn-col-${col.id}-width`
|
|
7052
|
+
);
|
|
7053
|
+
const width = widthVar ? parseFloat(widthVar) : 0;
|
|
7054
|
+
leftAcc += width;
|
|
7055
|
+
}
|
|
7056
|
+
let rightAcc = 0;
|
|
7057
|
+
for (let i = right.length - 1; i >= 0; i--) {
|
|
7058
|
+
const col = right[i];
|
|
7059
|
+
container.style.setProperty(`--mvn-col-${col.id}-right`, `${rightAcc}px`);
|
|
7060
|
+
const widthVar = computedStyle.getPropertyValue(
|
|
7061
|
+
`--mvn-col-${col.id}-width`
|
|
7062
|
+
);
|
|
7063
|
+
const width = widthVar ? parseFloat(widthVar) : 0;
|
|
7064
|
+
rightAcc += width;
|
|
7065
|
+
}
|
|
7066
|
+
}, []);
|
|
7067
|
+
const handleResizeMove = useCallback(
|
|
7068
|
+
(event) => {
|
|
7069
|
+
const state = resizeStateRef.current;
|
|
7070
|
+
if (!state.isResizing || !state.columnId || !tableContainerRef.current)
|
|
7071
|
+
return;
|
|
7072
|
+
const clientX = "touches" in event ? event.touches[0].clientX : event.clientX;
|
|
7073
|
+
const delta = clientX - state.startX;
|
|
7074
|
+
const newWidth = Math.max(
|
|
7075
|
+
state.minSize,
|
|
7076
|
+
Math.min(state.maxSize, state.startWidth + delta)
|
|
7077
|
+
);
|
|
7078
|
+
tableContainerRef.current.style.setProperty(
|
|
7079
|
+
`--mvn-col-${state.columnId}-width`,
|
|
7080
|
+
`${newWidth}px`
|
|
7081
|
+
);
|
|
7082
|
+
const { left, right } = pinnedColumnsRef.current;
|
|
7083
|
+
const isPinned = left.some((c) => c.id === state.columnId) || right.some((c) => c.id === state.columnId);
|
|
7084
|
+
if (isPinned) {
|
|
7085
|
+
updatePinnedOffsets();
|
|
7086
|
+
}
|
|
7087
|
+
},
|
|
7088
|
+
[updatePinnedOffsets]
|
|
7089
|
+
);
|
|
7090
|
+
const handleResizeEnd = useCallback(() => {
|
|
7091
|
+
const state = resizeStateRef.current;
|
|
7092
|
+
if (!state.isResizing || !tableContainerRef.current) return;
|
|
7093
|
+
const container = tableContainerRef.current;
|
|
7094
|
+
const computedStyle = getComputedStyle(container);
|
|
7095
|
+
const newSizing = {};
|
|
7096
|
+
const headers = tableRef.current?.getHeaderGroups()[0]?.headers ?? [];
|
|
7097
|
+
for (const header of headers) {
|
|
7098
|
+
if (header.column.getCanResize()) {
|
|
7099
|
+
const varName = `--mvn-col-${header.column.id}-width`;
|
|
7100
|
+
const value = computedStyle.getPropertyValue(varName);
|
|
7101
|
+
if (value) {
|
|
7102
|
+
newSizing[header.column.id] = parseFloat(value);
|
|
7103
|
+
}
|
|
7104
|
+
}
|
|
7105
|
+
}
|
|
7106
|
+
if (Object.keys(newSizing).length > 0) {
|
|
7107
|
+
setColumnSizing(newSizing);
|
|
7108
|
+
if (!hasInitializedSizing) {
|
|
7109
|
+
setHasInitializedSizing(true);
|
|
7110
|
+
}
|
|
7111
|
+
}
|
|
7112
|
+
resizeStateRef.current = {
|
|
7113
|
+
isResizing: false,
|
|
7114
|
+
columnId: null,
|
|
7115
|
+
startX: 0,
|
|
7116
|
+
startWidth: 0,
|
|
7117
|
+
minSize: 36,
|
|
7118
|
+
maxSize: 9999
|
|
7119
|
+
};
|
|
7120
|
+
document.removeEventListener("mousemove", handleResizeMove);
|
|
7121
|
+
document.removeEventListener("mouseup", handleResizeEnd);
|
|
7122
|
+
document.removeEventListener("touchmove", handleResizeMove);
|
|
7123
|
+
document.removeEventListener("touchend", handleResizeEnd);
|
|
7124
|
+
}, [hasInitializedSizing, handleResizeMove]);
|
|
7125
|
+
const startResize = useCallback(
|
|
7126
|
+
(columnId, event, initialWidth, minSize = 36, maxSize = 9999) => {
|
|
7127
|
+
const clientX = "touches" in event ? event.touches[0].clientX : event.clientX;
|
|
7128
|
+
resizeStateRef.current = {
|
|
7129
|
+
isResizing: true,
|
|
7130
|
+
columnId,
|
|
7131
|
+
startX: clientX,
|
|
7132
|
+
startWidth: initialWidth,
|
|
7133
|
+
minSize,
|
|
7134
|
+
maxSize
|
|
7135
|
+
};
|
|
7136
|
+
document.addEventListener("mousemove", handleResizeMove);
|
|
7137
|
+
document.addEventListener("mouseup", handleResizeEnd);
|
|
7138
|
+
document.addEventListener("touchmove", handleResizeMove);
|
|
7139
|
+
document.addEventListener("touchend", handleResizeEnd);
|
|
7140
|
+
},
|
|
7141
|
+
[handleResizeMove, handleResizeEnd]
|
|
7142
|
+
);
|
|
7143
|
+
useEffect(() => {
|
|
7144
|
+
return () => {
|
|
7145
|
+
document.removeEventListener("mousemove", handleResizeMove);
|
|
7146
|
+
document.removeEventListener("mouseup", handleResizeEnd);
|
|
7147
|
+
document.removeEventListener("touchmove", handleResizeMove);
|
|
7148
|
+
document.removeEventListener("touchend", handleResizeEnd);
|
|
7149
|
+
};
|
|
7150
|
+
}, [handleResizeMove, handleResizeEnd]);
|
|
7151
|
+
const handleColumnSizingInfoChange = useCallback(
|
|
7152
|
+
(updater) => {
|
|
7153
|
+
setColumnSizingInfo((prev) => {
|
|
7154
|
+
const next = typeof updater === "function" ? updater(prev) : updater;
|
|
7155
|
+
const shouldInitializeSizing = next.isResizingColumn && !hasInitializedSizing && tableRef.current;
|
|
7156
|
+
if (shouldInitializeSizing) {
|
|
7157
|
+
const headers = tableRef.current.getHeaderGroups()[0]?.headers ?? [];
|
|
7158
|
+
const allWidths = {};
|
|
7159
|
+
for (const header of headers) {
|
|
7160
|
+
if (header.column.getCanResize()) {
|
|
7161
|
+
allWidths[header.column.id] = header.getSize();
|
|
7162
|
+
}
|
|
7163
|
+
}
|
|
7164
|
+
if (Object.keys(allWidths).length > 0) {
|
|
7165
|
+
setColumnSizing(allWidths);
|
|
7166
|
+
setHasInitializedSizing(true);
|
|
7167
|
+
}
|
|
7168
|
+
}
|
|
7169
|
+
return next;
|
|
7170
|
+
});
|
|
7171
|
+
},
|
|
7172
|
+
[hasInitializedSizing]
|
|
7173
|
+
);
|
|
6332
7174
|
const table = useReactTable({
|
|
6333
7175
|
data,
|
|
6334
7176
|
columns: columnDefs,
|
|
6335
7177
|
manualFiltering,
|
|
6336
7178
|
manualSorting,
|
|
7179
|
+
enableColumnResizing,
|
|
7180
|
+
columnResizeMode,
|
|
6337
7181
|
state: {
|
|
6338
7182
|
sorting,
|
|
6339
7183
|
columnFilters,
|
|
@@ -6342,7 +7186,9 @@ function useTableCore({
|
|
|
6342
7186
|
...enableColumnOrdering ? { columnOrder } : {},
|
|
6343
7187
|
...enableGlobalFilter ? { globalFilter } : {},
|
|
6344
7188
|
pagination: tablePaginationState,
|
|
6345
|
-
columnPinning
|
|
7189
|
+
columnPinning,
|
|
7190
|
+
columnSizing,
|
|
7191
|
+
columnSizingInfo
|
|
6346
7192
|
},
|
|
6347
7193
|
onSortingChange: enableColumnSorter ? handleSortingChange : void 0,
|
|
6348
7194
|
onColumnFiltersChange: enableColumnFilters ? handleFilteringChange : void 0,
|
|
@@ -6352,6 +7198,8 @@ function useTableCore({
|
|
|
6352
7198
|
onGlobalFilterChange: enableGlobalFilter ? setGlobalFilter : void 0,
|
|
6353
7199
|
onPaginationChange: pagination ? handlePaginationChange : void 0,
|
|
6354
7200
|
onColumnPinningChange: enableColumnPin ? setColumnPinning : void 0,
|
|
7201
|
+
onColumnSizingChange: enableColumnResizing ? setColumnSizing : void 0,
|
|
7202
|
+
onColumnSizingInfoChange: enableColumnResizing ? handleColumnSizingInfoChange : void 0,
|
|
6355
7203
|
getCoreRowModel: getCoreRowModel(),
|
|
6356
7204
|
getSortedRowModel: getSortedRowModel(),
|
|
6357
7205
|
getFilteredRowModel: getFilteredRowModel(),
|
|
@@ -6363,6 +7211,18 @@ function useTableCore({
|
|
|
6363
7211
|
getRowId: (originalRow, index) => resolveRowId(originalRow, index),
|
|
6364
7212
|
getRowCanExpand: expandable ? (row) => getRowCanExpand ? getRowCanExpand(row.original) : !!renderExpandedContent : void 0
|
|
6365
7213
|
});
|
|
7214
|
+
tableRef.current = table;
|
|
7215
|
+
useEffect(() => {
|
|
7216
|
+
const headers = table.getHeaderGroups()[0]?.headers ?? [];
|
|
7217
|
+
const leftPinned = [];
|
|
7218
|
+
const rightPinned = [];
|
|
7219
|
+
headers.forEach((h) => {
|
|
7220
|
+
const pin = h.column.getIsPinned();
|
|
7221
|
+
if (pin === "left") leftPinned.push({ id: h.column.id });
|
|
7222
|
+
if (pin === "right") rightPinned.push({ id: h.column.id });
|
|
7223
|
+
});
|
|
7224
|
+
pinnedColumnsRef.current = { left: leftPinned, right: rightPinned };
|
|
7225
|
+
}, [table, columnPinning]);
|
|
6366
7226
|
const pageCount = useMemo(
|
|
6367
7227
|
() => table.getPageCount(),
|
|
6368
7228
|
[table, sorting, columnFilters]
|
|
@@ -6421,7 +7281,11 @@ function useTableCore({
|
|
|
6421
7281
|
pageNumbers,
|
|
6422
7282
|
paginationState,
|
|
6423
7283
|
sorting,
|
|
6424
|
-
columnFilters
|
|
7284
|
+
columnFilters,
|
|
7285
|
+
hasInitializedSizing,
|
|
7286
|
+
tableContainerRef,
|
|
7287
|
+
startResize,
|
|
7288
|
+
updatePinnedOffsets
|
|
6425
7289
|
};
|
|
6426
7290
|
}
|
|
6427
7291
|
function useTableVirtualization({
|
|
@@ -6927,7 +7791,14 @@ function SimpleTable({
|
|
|
6927
7791
|
maxRecords,
|
|
6928
7792
|
loadingText,
|
|
6929
7793
|
pagingPosition = "right",
|
|
6930
|
-
recordPerChunk = 100
|
|
7794
|
+
recordPerChunk = 100,
|
|
7795
|
+
defaultColumnPinning,
|
|
7796
|
+
enableColumnResizing = false,
|
|
7797
|
+
columnResizeMode = "onChange",
|
|
7798
|
+
// Mobile props
|
|
7799
|
+
mobileLayout = "auto",
|
|
7800
|
+
mobileCardActions,
|
|
7801
|
+
renderMobileCard
|
|
6931
7802
|
}) {
|
|
6932
7803
|
const [internalLazyLoading, setInternalLazyLoading] = useState(false);
|
|
6933
7804
|
const pendingLazyLoad = useRef(false);
|
|
@@ -6946,7 +7817,11 @@ function SimpleTable({
|
|
|
6946
7817
|
pageNumbers,
|
|
6947
7818
|
paginationState,
|
|
6948
7819
|
sorting,
|
|
6949
|
-
columnFilters
|
|
7820
|
+
columnFilters,
|
|
7821
|
+
hasInitializedSizing,
|
|
7822
|
+
tableContainerRef,
|
|
7823
|
+
startResize,
|
|
7824
|
+
updatePinnedOffsets
|
|
6950
7825
|
} = useTableCore({
|
|
6951
7826
|
data,
|
|
6952
7827
|
columns,
|
|
@@ -6970,7 +7845,10 @@ function SimpleTable({
|
|
|
6970
7845
|
numberOfPageButtons,
|
|
6971
7846
|
manualSorting,
|
|
6972
7847
|
manualFiltering,
|
|
6973
|
-
onFilterChange
|
|
7848
|
+
onFilterChange,
|
|
7849
|
+
defaultColumnPinning,
|
|
7850
|
+
enableColumnResizing,
|
|
7851
|
+
columnResizeMode
|
|
6974
7852
|
});
|
|
6975
7853
|
const handleLazyLoad = useCallback(async () => {
|
|
6976
7854
|
if (!onLazyScrollLoad || pendingLazyLoad.current || resolvedLoading) return;
|
|
@@ -6984,6 +7862,8 @@ function SimpleTable({
|
|
|
6984
7862
|
}
|
|
6985
7863
|
}, [onLazyScrollLoad, resolvedLoading]);
|
|
6986
7864
|
const virtualizationActive = data.length * (expandable ? 2 : 1) > virtualizationThreshold;
|
|
7865
|
+
const isMobile = useIsMobile();
|
|
7866
|
+
const shouldUseCardView = mobileLayout === "card" || mobileLayout === "auto" && isMobile;
|
|
6987
7867
|
const [chunkCount, setChunkCount] = useState(recordPerChunk);
|
|
6988
7868
|
const onLoadChunk = useCallback(() => {
|
|
6989
7869
|
if (resolvedLoading || pendingLazyLoad.current) return;
|
|
@@ -7000,7 +7880,7 @@ function SimpleTable({
|
|
|
7000
7880
|
}, [onLoadChunk]);
|
|
7001
7881
|
const rows = useMemo(
|
|
7002
7882
|
() => table.getRowModel().rows,
|
|
7003
|
-
[paginationState, sorting, columnFilters]
|
|
7883
|
+
[paginationState, sorting, columnFilters, globalFilter]
|
|
7004
7884
|
);
|
|
7005
7885
|
const splittedRows = useMemo(
|
|
7006
7886
|
() => rows.slice(0, chunkCount),
|
|
@@ -7012,7 +7892,6 @@ function SimpleTable({
|
|
|
7012
7892
|
);
|
|
7013
7893
|
const tablePagination = table.getState().pagination;
|
|
7014
7894
|
const draggedColumnId = useRef(null);
|
|
7015
|
-
const tableContainerRef = useRef(null);
|
|
7016
7895
|
const {
|
|
7017
7896
|
virtualRowPointers,
|
|
7018
7897
|
virtualItems,
|
|
@@ -7032,7 +7911,7 @@ function SimpleTable({
|
|
|
7032
7911
|
const rafRef = useRef(null);
|
|
7033
7912
|
useEffect(() => {
|
|
7034
7913
|
const container = tableContainerRef.current;
|
|
7035
|
-
if (!container || virtualizationActive) return;
|
|
7914
|
+
if (!container || virtualizationActive && !shouldUseCardView) return;
|
|
7036
7915
|
const scheduleCheck = () => {
|
|
7037
7916
|
if (rafRef.current != null) return;
|
|
7038
7917
|
rafRef.current = requestAnimationFrame(() => {
|
|
@@ -7060,12 +7939,63 @@ function SimpleTable({
|
|
|
7060
7939
|
}
|
|
7061
7940
|
}, [virtualizationActive]);
|
|
7062
7941
|
useEffect(() => {
|
|
7063
|
-
if (!virtualItems.length || !virtualizationActive) return;
|
|
7942
|
+
if (!virtualItems.length || !virtualizationActive || shouldUseCardView) return;
|
|
7064
7943
|
if (paddingBottom <= scrollLoadThreshold) {
|
|
7065
7944
|
onLoadChunkRef.current();
|
|
7066
7945
|
}
|
|
7067
7946
|
}, [paddingBottom, scrollLoadThreshold, virtualizationActive]);
|
|
7068
7947
|
const columnCount = table.getAllLeafColumns().length;
|
|
7948
|
+
const allHeaders = useMemo(() => {
|
|
7949
|
+
const groups = table.getHeaderGroups();
|
|
7950
|
+
if (groups.length === 0) return [];
|
|
7951
|
+
return groups[0].headers;
|
|
7952
|
+
}, [table]);
|
|
7953
|
+
const { leftOffsets, rightOffsets } = useMemo(() => {
|
|
7954
|
+
if (!allHeaders || allHeaders.length === 0) {
|
|
7955
|
+
return {
|
|
7956
|
+
leftOffsets: /* @__PURE__ */ new Map(),
|
|
7957
|
+
rightOffsets: /* @__PURE__ */ new Map()
|
|
7958
|
+
};
|
|
7959
|
+
}
|
|
7960
|
+
const leftPinned = allHeaders.filter(
|
|
7961
|
+
(h) => h.column.getIsPinned() === "left"
|
|
7962
|
+
);
|
|
7963
|
+
const rightPinned = allHeaders.filter(
|
|
7964
|
+
(h) => h.column.getIsPinned() === "right"
|
|
7965
|
+
);
|
|
7966
|
+
const leftMap = /* @__PURE__ */ new Map();
|
|
7967
|
+
let leftAcc = 0;
|
|
7968
|
+
for (const h of leftPinned) {
|
|
7969
|
+
leftMap.set(h.column.id, leftAcc);
|
|
7970
|
+
leftAcc += h.getSize();
|
|
7971
|
+
}
|
|
7972
|
+
const rightMap = /* @__PURE__ */ new Map();
|
|
7973
|
+
let rightAcc = 0;
|
|
7974
|
+
for (let i = rightPinned.length - 1; i >= 0; i--) {
|
|
7975
|
+
const h = rightPinned[i];
|
|
7976
|
+
rightMap.set(h.column.id, rightAcc);
|
|
7977
|
+
rightAcc += h.getSize();
|
|
7978
|
+
}
|
|
7979
|
+
return {
|
|
7980
|
+
leftOffsets: leftMap,
|
|
7981
|
+
rightOffsets: rightMap
|
|
7982
|
+
};
|
|
7983
|
+
}, [allHeaders]);
|
|
7984
|
+
useEffect(() => {
|
|
7985
|
+
if (!hasInitializedSizing || !tableContainerRef.current) return;
|
|
7986
|
+
const container = tableContainerRef.current;
|
|
7987
|
+
const headers = table.getHeaderGroups()[0]?.headers ?? [];
|
|
7988
|
+
for (const header of headers) {
|
|
7989
|
+
if (header.column.getCanResize()) {
|
|
7990
|
+
const width = header.getSize();
|
|
7991
|
+
container.style.setProperty(
|
|
7992
|
+
`--mvn-col-${header.column.id}-width`,
|
|
7993
|
+
`${width}px`
|
|
7994
|
+
);
|
|
7995
|
+
}
|
|
7996
|
+
}
|
|
7997
|
+
updatePinnedOffsets();
|
|
7998
|
+
}, [hasInitializedSizing, table, updatePinnedOffsets]);
|
|
7069
7999
|
useEffect(() => {
|
|
7070
8000
|
if (!selectable || !onSelectionChange) return;
|
|
7071
8001
|
onSelectionChange(selectedRows);
|
|
@@ -7116,17 +8046,36 @@ function SimpleTable({
|
|
|
7116
8046
|
},
|
|
7117
8047
|
children: [
|
|
7118
8048
|
showOverlayLoading && (loadingComponent ?? /* @__PURE__ */ jsx(DefaultLoadingComponent, { loadingText })),
|
|
7119
|
-
/* @__PURE__ */
|
|
8049
|
+
shouldUseCardView ? /* @__PURE__ */ jsx(
|
|
8050
|
+
TableCardView,
|
|
8051
|
+
{
|
|
8052
|
+
rows: splittedRows,
|
|
8053
|
+
columns,
|
|
8054
|
+
selectable,
|
|
8055
|
+
expandable,
|
|
8056
|
+
onRowClick,
|
|
8057
|
+
rowClassName,
|
|
8058
|
+
renderExpandedContent,
|
|
8059
|
+
mobileCardActions,
|
|
8060
|
+
emptyMessage,
|
|
8061
|
+
renderMobileCard
|
|
8062
|
+
}
|
|
8063
|
+
) : /* @__PURE__ */ jsxs(
|
|
7120
8064
|
Table,
|
|
7121
8065
|
{
|
|
7122
8066
|
variant,
|
|
7123
8067
|
size,
|
|
7124
8068
|
wrapperClassName: "overflow-visible",
|
|
7125
8069
|
className: showOverlayLoading ? "pointer-events-none opacity-50" : void 0,
|
|
8070
|
+
style: enableColumnResizing ? {
|
|
8071
|
+
width: hasInitializedSizing ? table.getTotalSize() : void 0,
|
|
8072
|
+
tableLayout: hasInitializedSizing ? "fixed" : "auto"
|
|
8073
|
+
} : void 0,
|
|
7126
8074
|
children: [
|
|
7127
8075
|
caption && /* @__PURE__ */ jsx(TableCaption, { children: caption }),
|
|
7128
8076
|
/* @__PURE__ */ jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { children: headerGroup.headers.map((header) => {
|
|
7129
8077
|
if (header.isPlaceholder) return null;
|
|
8078
|
+
const pinPosition = header.column.getIsPinned();
|
|
7130
8079
|
return /* @__PURE__ */ jsx(
|
|
7131
8080
|
TableHeaderComponent,
|
|
7132
8081
|
{
|
|
@@ -7134,7 +8083,11 @@ function SimpleTable({
|
|
|
7134
8083
|
draggedColumnId,
|
|
7135
8084
|
enableColumnOrdering,
|
|
7136
8085
|
baseColumnOrder,
|
|
7137
|
-
setColumnOrder
|
|
8086
|
+
setColumnOrder,
|
|
8087
|
+
pinnedLeftOffset: pinPosition === "left" ? leftOffsets.get(header.column.id) : void 0,
|
|
8088
|
+
pinnedRightOffset: pinPosition === "right" ? rightOffsets.get(header.column.id) : void 0,
|
|
8089
|
+
hasInitializedSizing,
|
|
8090
|
+
startResize
|
|
7138
8091
|
},
|
|
7139
8092
|
header.id
|
|
7140
8093
|
);
|
|
@@ -7157,7 +8110,9 @@ function SimpleTable({
|
|
|
7157
8110
|
renderExpandedContent,
|
|
7158
8111
|
virtualItems,
|
|
7159
8112
|
invalidateCache,
|
|
7160
|
-
getRowExpandable
|
|
8113
|
+
getRowExpandable,
|
|
8114
|
+
headers: allHeaders,
|
|
8115
|
+
hasInitializedSizing
|
|
7161
8116
|
}
|
|
7162
8117
|
),
|
|
7163
8118
|
showInlineLoadingRow && resolvedLoading && /* @__PURE__ */ jsx(TableRow, { "data-loading-row": true, className: "pointer-events-none", children: /* @__PURE__ */ jsxs(
|
|
@@ -7218,12 +8173,12 @@ function DataTable({
|
|
|
7218
8173
|
pageSize = 10,
|
|
7219
8174
|
className
|
|
7220
8175
|
}) {
|
|
7221
|
-
const [sorting, setSorting] =
|
|
7222
|
-
const [columnFilters, setColumnFilters] =
|
|
8176
|
+
const [sorting, setSorting] = React52.useState([]);
|
|
8177
|
+
const [columnFilters, setColumnFilters] = React52.useState(
|
|
7223
8178
|
[]
|
|
7224
8179
|
);
|
|
7225
|
-
const [columnVisibility, setColumnVisibility] =
|
|
7226
|
-
const [rowSelection, setRowSelection] =
|
|
8180
|
+
const [columnVisibility, setColumnVisibility] = React52.useState({});
|
|
8181
|
+
const [rowSelection, setRowSelection] = React52.useState({});
|
|
7227
8182
|
const table = useReactTable({
|
|
7228
8183
|
data,
|
|
7229
8184
|
columns,
|
|
@@ -7380,7 +8335,7 @@ var avatarFallbackVariants = cva(
|
|
|
7380
8335
|
}
|
|
7381
8336
|
}
|
|
7382
8337
|
);
|
|
7383
|
-
var Avatar =
|
|
8338
|
+
var Avatar = React52.forwardRef(({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7384
8339
|
AvatarPrimitive.Root,
|
|
7385
8340
|
{
|
|
7386
8341
|
ref,
|
|
@@ -7389,7 +8344,7 @@ var Avatar = React49.forwardRef(({ className, size, ...props }, ref) => /* @__PU
|
|
|
7389
8344
|
}
|
|
7390
8345
|
));
|
|
7391
8346
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
7392
|
-
var AvatarImage =
|
|
8347
|
+
var AvatarImage = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7393
8348
|
AvatarPrimitive.Image,
|
|
7394
8349
|
{
|
|
7395
8350
|
ref,
|
|
@@ -7398,7 +8353,7 @@ var AvatarImage = React49.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
7398
8353
|
}
|
|
7399
8354
|
));
|
|
7400
8355
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
7401
|
-
var AvatarFallback =
|
|
8356
|
+
var AvatarFallback = React52.forwardRef(({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7402
8357
|
AvatarPrimitive.Fallback,
|
|
7403
8358
|
{
|
|
7404
8359
|
ref,
|
|
@@ -7562,7 +8517,7 @@ var itemVariants = cva(
|
|
|
7562
8517
|
}
|
|
7563
8518
|
}
|
|
7564
8519
|
);
|
|
7565
|
-
var Item9 =
|
|
8520
|
+
var Item9 = React52.forwardRef(
|
|
7566
8521
|
({
|
|
7567
8522
|
className,
|
|
7568
8523
|
variant,
|
|
@@ -7628,7 +8583,7 @@ var Item9 = React49.forwardRef(
|
|
|
7628
8583
|
}
|
|
7629
8584
|
);
|
|
7630
8585
|
Item9.displayName = "Item";
|
|
7631
|
-
var ItemGroup =
|
|
8586
|
+
var ItemGroup = React52.forwardRef(({ className, label, description, children, ...props }, ref) => /* @__PURE__ */ jsxs("div", { ref, className: cn("space-y-1", className), ...props, children: [
|
|
7632
8587
|
(label || description) && /* @__PURE__ */ jsxs("div", { className: "px-3 py-2 space-y-0.5", children: [
|
|
7633
8588
|
label && /* @__PURE__ */ jsx("div", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider", children: label }),
|
|
7634
8589
|
description && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: description })
|
|
@@ -7636,7 +8591,7 @@ var ItemGroup = React49.forwardRef(({ className, label, description, children, .
|
|
|
7636
8591
|
children
|
|
7637
8592
|
] }));
|
|
7638
8593
|
ItemGroup.displayName = "ItemGroup";
|
|
7639
|
-
var ItemList =
|
|
8594
|
+
var ItemList = React52.forwardRef(({ className, divided, spacing = "default", children, ...props }, ref) => {
|
|
7640
8595
|
const spacingClasses = {
|
|
7641
8596
|
none: "space-y-0",
|
|
7642
8597
|
sm: "space-y-0.5",
|
|
@@ -7659,7 +8614,7 @@ var ItemList = React49.forwardRef(({ className, divided, spacing = "default", ch
|
|
|
7659
8614
|
);
|
|
7660
8615
|
});
|
|
7661
8616
|
ItemList.displayName = "ItemList";
|
|
7662
|
-
var ItemSeparator =
|
|
8617
|
+
var ItemSeparator = React52.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7663
8618
|
"div",
|
|
7664
8619
|
{
|
|
7665
8620
|
ref,
|
|
@@ -7697,7 +8652,7 @@ var badgeVariants = cva(
|
|
|
7697
8652
|
}
|
|
7698
8653
|
}
|
|
7699
8654
|
);
|
|
7700
|
-
var Badge =
|
|
8655
|
+
var Badge = React52.forwardRef(
|
|
7701
8656
|
({
|
|
7702
8657
|
className,
|
|
7703
8658
|
variant,
|
|
@@ -7764,7 +8719,7 @@ function Calendar({
|
|
|
7764
8719
|
...props
|
|
7765
8720
|
}) {
|
|
7766
8721
|
const defaultClassNames = getDefaultClassNames();
|
|
7767
|
-
const { Card: Card2, CardHeader: CardHeader2, CardTitle: CardTitle2, CardContent: CardContent2, CardDescription: CardDescription2 } =
|
|
8722
|
+
const { Card: Card2, CardHeader: CardHeader2, CardTitle: CardTitle2, CardContent: CardContent2, CardDescription: CardDescription2 } = React52.useMemo(() => {
|
|
7768
8723
|
try {
|
|
7769
8724
|
const cardComponents = (init_card(), __toCommonJS(card_exports));
|
|
7770
8725
|
return cardComponents;
|
|
@@ -7778,7 +8733,7 @@ function Calendar({
|
|
|
7778
8733
|
};
|
|
7779
8734
|
}
|
|
7780
8735
|
}, []);
|
|
7781
|
-
const defaultPresets =
|
|
8736
|
+
const defaultPresets = React52.useMemo(() => {
|
|
7782
8737
|
if (!quickSelect && !presets) return [];
|
|
7783
8738
|
const mode = props.mode;
|
|
7784
8739
|
if (mode === "single") {
|
|
@@ -7786,7 +8741,7 @@ function Calendar({
|
|
|
7786
8741
|
{
|
|
7787
8742
|
label: "Today",
|
|
7788
8743
|
value: () => /* @__PURE__ */ new Date(),
|
|
7789
|
-
icon:
|
|
8744
|
+
icon: React52.createElement(Calendar$1, { className: "h-3 w-3" })
|
|
7790
8745
|
},
|
|
7791
8746
|
{
|
|
7792
8747
|
label: "Tomorrow",
|
|
@@ -7795,7 +8750,7 @@ function Calendar({
|
|
|
7795
8750
|
tomorrow.setDate(tomorrow.getDate() + 1);
|
|
7796
8751
|
return tomorrow;
|
|
7797
8752
|
},
|
|
7798
|
-
icon:
|
|
8753
|
+
icon: React52.createElement("span", { className: "text-xs" }, "\u27A1\uFE0F")
|
|
7799
8754
|
},
|
|
7800
8755
|
{
|
|
7801
8756
|
label: "Next Week",
|
|
@@ -7804,7 +8759,7 @@ function Calendar({
|
|
|
7804
8759
|
nextWeek.setDate(nextWeek.getDate() + 7);
|
|
7805
8760
|
return nextWeek;
|
|
7806
8761
|
},
|
|
7807
|
-
icon:
|
|
8762
|
+
icon: React52.createElement(Calendar$1, { className: "h-3 w-3" })
|
|
7808
8763
|
}
|
|
7809
8764
|
];
|
|
7810
8765
|
} else if (mode === "range") {
|
|
@@ -7817,7 +8772,7 @@ function Calendar({
|
|
|
7817
8772
|
end.setDate(start.getDate() + 6);
|
|
7818
8773
|
return { from: start, to: end };
|
|
7819
8774
|
},
|
|
7820
|
-
icon:
|
|
8775
|
+
icon: React52.createElement(Calendar$1, { className: "h-3 w-3" })
|
|
7821
8776
|
},
|
|
7822
8777
|
{
|
|
7823
8778
|
label: "Next 7 Days",
|
|
@@ -7827,7 +8782,7 @@ function Calendar({
|
|
|
7827
8782
|
end.setDate(start.getDate() + 7);
|
|
7828
8783
|
return { from: start, to: end };
|
|
7829
8784
|
},
|
|
7830
|
-
icon:
|
|
8785
|
+
icon: React52.createElement("span", { className: "text-xs" }, "\u27A1\uFE0F")
|
|
7831
8786
|
}
|
|
7832
8787
|
];
|
|
7833
8788
|
} else {
|
|
@@ -7843,7 +8798,7 @@ function Calendar({
|
|
|
7843
8798
|
}
|
|
7844
8799
|
return dates;
|
|
7845
8800
|
},
|
|
7846
|
-
icon:
|
|
8801
|
+
icon: React52.createElement(Calendar$1, { className: "h-3 w-3" })
|
|
7847
8802
|
}
|
|
7848
8803
|
];
|
|
7849
8804
|
}
|
|
@@ -7854,24 +8809,24 @@ function Calendar({
|
|
|
7854
8809
|
const selected = props.selected;
|
|
7855
8810
|
const mode = props.mode;
|
|
7856
8811
|
if (mode === "single" && selected) {
|
|
7857
|
-
return
|
|
8812
|
+
return React52.createElement(
|
|
7858
8813
|
"div",
|
|
7859
8814
|
{
|
|
7860
8815
|
className: "p-3 border rounded-lg bg-muted/50"
|
|
7861
8816
|
},
|
|
7862
8817
|
[
|
|
7863
|
-
|
|
8818
|
+
React52.createElement(
|
|
7864
8819
|
"div",
|
|
7865
8820
|
{
|
|
7866
8821
|
key: "header",
|
|
7867
8822
|
className: "flex items-center gap-2 mb-1"
|
|
7868
8823
|
},
|
|
7869
8824
|
[
|
|
7870
|
-
|
|
8825
|
+
React52.createElement(Calendar$1, {
|
|
7871
8826
|
key: "icon",
|
|
7872
8827
|
className: "h-4 w-4"
|
|
7873
8828
|
}),
|
|
7874
|
-
|
|
8829
|
+
React52.createElement(
|
|
7875
8830
|
"span",
|
|
7876
8831
|
{
|
|
7877
8832
|
key: "label",
|
|
@@ -7881,7 +8836,7 @@ function Calendar({
|
|
|
7881
8836
|
)
|
|
7882
8837
|
]
|
|
7883
8838
|
),
|
|
7884
|
-
|
|
8839
|
+
React52.createElement(
|
|
7885
8840
|
"p",
|
|
7886
8841
|
{
|
|
7887
8842
|
key: "date",
|
|
@@ -7899,24 +8854,24 @@ function Calendar({
|
|
|
7899
8854
|
}
|
|
7900
8855
|
if (mode === "range" && selected?.from) {
|
|
7901
8856
|
const elements = [
|
|
7902
|
-
|
|
8857
|
+
React52.createElement(
|
|
7903
8858
|
"div",
|
|
7904
8859
|
{
|
|
7905
8860
|
key: "from",
|
|
7906
8861
|
className: "flex items-center gap-2 text-sm"
|
|
7907
8862
|
},
|
|
7908
8863
|
[
|
|
7909
|
-
|
|
8864
|
+
React52.createElement(
|
|
7910
8865
|
"span",
|
|
7911
8866
|
{ key: "icon", className: "text-green-600" },
|
|
7912
8867
|
"\u{1F7E2}"
|
|
7913
8868
|
),
|
|
7914
|
-
|
|
8869
|
+
React52.createElement(
|
|
7915
8870
|
"span",
|
|
7916
8871
|
{ key: "label", className: "font-medium" },
|
|
7917
8872
|
"From:"
|
|
7918
8873
|
),
|
|
7919
|
-
|
|
8874
|
+
React52.createElement(
|
|
7920
8875
|
"span",
|
|
7921
8876
|
{ key: "date" },
|
|
7922
8877
|
selected.from.toLocaleDateString()
|
|
@@ -7926,43 +8881,43 @@ function Calendar({
|
|
|
7926
8881
|
];
|
|
7927
8882
|
if (selected.to) {
|
|
7928
8883
|
elements.push(
|
|
7929
|
-
|
|
8884
|
+
React52.createElement(
|
|
7930
8885
|
"div",
|
|
7931
8886
|
{
|
|
7932
8887
|
key: "to",
|
|
7933
8888
|
className: "flex items-center gap-2 text-sm"
|
|
7934
8889
|
},
|
|
7935
8890
|
[
|
|
7936
|
-
|
|
8891
|
+
React52.createElement(
|
|
7937
8892
|
"span",
|
|
7938
8893
|
{ key: "icon", className: "text-red-600" },
|
|
7939
8894
|
"\u{1F534}"
|
|
7940
8895
|
),
|
|
7941
|
-
|
|
8896
|
+
React52.createElement(
|
|
7942
8897
|
"span",
|
|
7943
8898
|
{ key: "label", className: "font-medium" },
|
|
7944
8899
|
"To:"
|
|
7945
8900
|
),
|
|
7946
|
-
|
|
8901
|
+
React52.createElement(
|
|
7947
8902
|
"span",
|
|
7948
8903
|
{ key: "date" },
|
|
7949
8904
|
selected.to.toLocaleDateString()
|
|
7950
8905
|
)
|
|
7951
8906
|
]
|
|
7952
8907
|
),
|
|
7953
|
-
|
|
8908
|
+
React52.createElement(
|
|
7954
8909
|
"div",
|
|
7955
8910
|
{
|
|
7956
8911
|
key: "duration",
|
|
7957
8912
|
className: "flex items-center gap-2 pt-2 border-t text-sm"
|
|
7958
8913
|
},
|
|
7959
8914
|
[
|
|
7960
|
-
|
|
8915
|
+
React52.createElement(
|
|
7961
8916
|
"span",
|
|
7962
8917
|
{ key: "icon", className: "text-mvn-blue-600" },
|
|
7963
8918
|
"\u23F1\uFE0F"
|
|
7964
8919
|
),
|
|
7965
|
-
|
|
8920
|
+
React52.createElement(
|
|
7966
8921
|
"span",
|
|
7967
8922
|
{ key: "text" },
|
|
7968
8923
|
`Duration: ${Math.ceil(
|
|
@@ -7973,25 +8928,25 @@ function Calendar({
|
|
|
7973
8928
|
)
|
|
7974
8929
|
);
|
|
7975
8930
|
}
|
|
7976
|
-
return
|
|
8931
|
+
return React52.createElement(
|
|
7977
8932
|
"div",
|
|
7978
8933
|
{
|
|
7979
8934
|
className: "p-3 border rounded-lg bg-muted/50"
|
|
7980
8935
|
},
|
|
7981
|
-
|
|
8936
|
+
React52.createElement("div", { className: "space-y-2" }, elements)
|
|
7982
8937
|
);
|
|
7983
8938
|
}
|
|
7984
8939
|
if (mode === "multiple" && Array.isArray(selected) && selected.length > 0) {
|
|
7985
8940
|
const sortedDates = selected.sort((a, b) => a.getTime() - b.getTime()).slice(0, 5);
|
|
7986
8941
|
const dateElements = sortedDates.map(
|
|
7987
|
-
(date, index) =>
|
|
8942
|
+
(date, index) => React52.createElement(
|
|
7988
8943
|
"div",
|
|
7989
8944
|
{
|
|
7990
8945
|
key: index,
|
|
7991
8946
|
className: "flex items-center justify-between p-2 bg-background rounded border"
|
|
7992
8947
|
},
|
|
7993
8948
|
[
|
|
7994
|
-
|
|
8949
|
+
React52.createElement(
|
|
7995
8950
|
"span",
|
|
7996
8951
|
{
|
|
7997
8952
|
key: "date",
|
|
@@ -8003,7 +8958,7 @@ function Calendar({
|
|
|
8003
8958
|
year: "numeric"
|
|
8004
8959
|
})
|
|
8005
8960
|
),
|
|
8006
|
-
|
|
8961
|
+
React52.createElement(
|
|
8007
8962
|
"button",
|
|
8008
8963
|
{
|
|
8009
8964
|
key: "remove",
|
|
@@ -8024,18 +8979,18 @@ function Calendar({
|
|
|
8024
8979
|
)
|
|
8025
8980
|
);
|
|
8026
8981
|
const elements = [
|
|
8027
|
-
|
|
8982
|
+
React52.createElement(
|
|
8028
8983
|
"div",
|
|
8029
8984
|
{
|
|
8030
8985
|
key: "header",
|
|
8031
8986
|
className: "flex items-center gap-2 mb-2"
|
|
8032
8987
|
},
|
|
8033
8988
|
[
|
|
8034
|
-
|
|
8989
|
+
React52.createElement(Star, {
|
|
8035
8990
|
key: "icon",
|
|
8036
8991
|
className: "h-4 w-4 text-yellow-500"
|
|
8037
8992
|
}),
|
|
8038
|
-
|
|
8993
|
+
React52.createElement(
|
|
8039
8994
|
"span",
|
|
8040
8995
|
{
|
|
8041
8996
|
key: "label",
|
|
@@ -8045,7 +9000,7 @@ function Calendar({
|
|
|
8045
9000
|
)
|
|
8046
9001
|
]
|
|
8047
9002
|
),
|
|
8048
|
-
|
|
9003
|
+
React52.createElement(
|
|
8049
9004
|
"div",
|
|
8050
9005
|
{
|
|
8051
9006
|
key: "dates",
|
|
@@ -8056,7 +9011,7 @@ function Calendar({
|
|
|
8056
9011
|
];
|
|
8057
9012
|
if (selected.length > 5) {
|
|
8058
9013
|
elements.push(
|
|
8059
|
-
|
|
9014
|
+
React52.createElement(
|
|
8060
9015
|
"p",
|
|
8061
9016
|
{
|
|
8062
9017
|
key: "more",
|
|
@@ -8066,7 +9021,7 @@ function Calendar({
|
|
|
8066
9021
|
)
|
|
8067
9022
|
);
|
|
8068
9023
|
}
|
|
8069
|
-
return
|
|
9024
|
+
return React52.createElement(
|
|
8070
9025
|
"div",
|
|
8071
9026
|
{
|
|
8072
9027
|
className: "p-3 border rounded-lg bg-muted/50 max-h-48 overflow-y-auto"
|
|
@@ -8081,7 +9036,7 @@ function Calendar({
|
|
|
8081
9036
|
const elements = [];
|
|
8082
9037
|
if ((quickSelect || presets) && activePresets.length > 0) {
|
|
8083
9038
|
const presetButtons = activePresets.map(
|
|
8084
|
-
(preset, index) =>
|
|
9039
|
+
(preset, index) => React52.createElement(
|
|
8085
9040
|
"button",
|
|
8086
9041
|
{
|
|
8087
9042
|
key: index,
|
|
@@ -8090,19 +9045,19 @@ function Calendar({
|
|
|
8090
9045
|
},
|
|
8091
9046
|
[
|
|
8092
9047
|
preset.icon,
|
|
8093
|
-
|
|
9048
|
+
React52.createElement("span", { key: "label" }, preset.label)
|
|
8094
9049
|
]
|
|
8095
9050
|
)
|
|
8096
9051
|
);
|
|
8097
9052
|
elements.push(
|
|
8098
|
-
|
|
9053
|
+
React52.createElement(
|
|
8099
9054
|
"div",
|
|
8100
9055
|
{
|
|
8101
9056
|
key: "presets",
|
|
8102
9057
|
className: "space-y-2"
|
|
8103
9058
|
},
|
|
8104
9059
|
[
|
|
8105
|
-
|
|
9060
|
+
React52.createElement(
|
|
8106
9061
|
"h5",
|
|
8107
9062
|
{
|
|
8108
9063
|
key: "title",
|
|
@@ -8110,7 +9065,7 @@ function Calendar({
|
|
|
8110
9065
|
},
|
|
8111
9066
|
"Quick Select:"
|
|
8112
9067
|
),
|
|
8113
|
-
|
|
9068
|
+
React52.createElement(
|
|
8114
9069
|
"div",
|
|
8115
9070
|
{
|
|
8116
9071
|
key: "buttons",
|
|
@@ -8135,7 +9090,7 @@ function Calendar({
|
|
|
8135
9090
|
label = "Clear Range";
|
|
8136
9091
|
}
|
|
8137
9092
|
elements.push(
|
|
8138
|
-
|
|
9093
|
+
React52.createElement(
|
|
8139
9094
|
"button",
|
|
8140
9095
|
{
|
|
8141
9096
|
key: "clear",
|
|
@@ -8151,7 +9106,7 @@ function Calendar({
|
|
|
8151
9106
|
disabled
|
|
8152
9107
|
},
|
|
8153
9108
|
[
|
|
8154
|
-
|
|
9109
|
+
React52.createElement(RotateCcw, {
|
|
8155
9110
|
key: "icon",
|
|
8156
9111
|
className: "mr-1 h-3 w-3"
|
|
8157
9112
|
}),
|
|
@@ -8160,7 +9115,7 @@ function Calendar({
|
|
|
8160
9115
|
)
|
|
8161
9116
|
);
|
|
8162
9117
|
}
|
|
8163
|
-
return
|
|
9118
|
+
return React52.createElement(
|
|
8164
9119
|
"div",
|
|
8165
9120
|
{
|
|
8166
9121
|
className: cn("space-y-3", sidebarClassName)
|
|
@@ -8168,7 +9123,7 @@ function Calendar({
|
|
|
8168
9123
|
elements
|
|
8169
9124
|
);
|
|
8170
9125
|
};
|
|
8171
|
-
const calendarElement =
|
|
9126
|
+
const calendarElement = React52.createElement(DayPicker, {
|
|
8172
9127
|
showOutsideDays,
|
|
8173
9128
|
className: cn(
|
|
8174
9129
|
"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",
|
|
@@ -8270,7 +9225,7 @@ function Calendar({
|
|
|
8270
9225
|
},
|
|
8271
9226
|
components: {
|
|
8272
9227
|
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
8273
|
-
return
|
|
9228
|
+
return React52.createElement("div", {
|
|
8274
9229
|
"data-slot": "calendar",
|
|
8275
9230
|
ref: rootRef,
|
|
8276
9231
|
className: cn(className2),
|
|
@@ -8279,28 +9234,28 @@ function Calendar({
|
|
|
8279
9234
|
},
|
|
8280
9235
|
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
8281
9236
|
if (orientation === "left") {
|
|
8282
|
-
return
|
|
9237
|
+
return React52.createElement(ChevronLeft, {
|
|
8283
9238
|
className: cn("size-4", className2),
|
|
8284
9239
|
...props2
|
|
8285
9240
|
});
|
|
8286
9241
|
}
|
|
8287
9242
|
if (orientation === "right") {
|
|
8288
|
-
return
|
|
9243
|
+
return React52.createElement(ChevronRight, {
|
|
8289
9244
|
className: cn("size-4", className2),
|
|
8290
9245
|
...props2
|
|
8291
9246
|
});
|
|
8292
9247
|
}
|
|
8293
|
-
return
|
|
9248
|
+
return React52.createElement(ChevronDown, {
|
|
8294
9249
|
className: cn("size-4", className2),
|
|
8295
9250
|
...props2
|
|
8296
9251
|
});
|
|
8297
9252
|
},
|
|
8298
9253
|
DayButton: CalendarDayButton,
|
|
8299
9254
|
WeekNumber: ({ children, ...props2 }) => {
|
|
8300
|
-
return
|
|
9255
|
+
return React52.createElement(
|
|
8301
9256
|
"td",
|
|
8302
9257
|
props2,
|
|
8303
|
-
|
|
9258
|
+
React52.createElement(
|
|
8304
9259
|
"div",
|
|
8305
9260
|
{
|
|
8306
9261
|
className: "flex size-10 items-center justify-center text-center text-sm font-medium text-muted-foreground"
|
|
@@ -8315,25 +9270,25 @@ function Calendar({
|
|
|
8315
9270
|
});
|
|
8316
9271
|
if (layout === "compact") {
|
|
8317
9272
|
if (withCard) {
|
|
8318
|
-
return
|
|
9273
|
+
return React52.createElement(
|
|
8319
9274
|
Card2,
|
|
8320
9275
|
{
|
|
8321
9276
|
className: cn("w-fit", cardClassName)
|
|
8322
9277
|
},
|
|
8323
|
-
|
|
9278
|
+
React52.createElement(CardContent2, { className: "p-3" }, calendarElement)
|
|
8324
9279
|
);
|
|
8325
9280
|
}
|
|
8326
9281
|
return calendarElement;
|
|
8327
9282
|
}
|
|
8328
9283
|
if (layout === "inline") {
|
|
8329
|
-
const sidebarElement2 = renderDateInfo() || renderQuickActions() ?
|
|
9284
|
+
const sidebarElement2 = renderDateInfo() || renderQuickActions() ? React52.createElement(
|
|
8330
9285
|
"div",
|
|
8331
9286
|
{
|
|
8332
9287
|
className: cn("min-w-[240px] space-y-3", sidebarClassName)
|
|
8333
9288
|
},
|
|
8334
9289
|
[renderDateInfo(), renderQuickActions()].filter(Boolean)
|
|
8335
9290
|
) : null;
|
|
8336
|
-
const content = sidebarElement2 ?
|
|
9291
|
+
const content = sidebarElement2 ? React52.createElement(
|
|
8337
9292
|
"div",
|
|
8338
9293
|
{
|
|
8339
9294
|
className: cn("flex gap-4 items-start", containerClassName)
|
|
@@ -8341,25 +9296,25 @@ function Calendar({
|
|
|
8341
9296
|
[calendarElement, sidebarElement2]
|
|
8342
9297
|
) : calendarElement;
|
|
8343
9298
|
if (withCard) {
|
|
8344
|
-
return
|
|
9299
|
+
return React52.createElement(
|
|
8345
9300
|
Card2,
|
|
8346
9301
|
{
|
|
8347
9302
|
className: cn("w-fit", cardClassName)
|
|
8348
9303
|
},
|
|
8349
9304
|
[
|
|
8350
|
-
(cardTitle || cardDescription) &&
|
|
8351
|
-
cardTitle &&
|
|
9305
|
+
(cardTitle || cardDescription) && React52.createElement(CardHeader2, { key: "header" }, [
|
|
9306
|
+
cardTitle && React52.createElement(
|
|
8352
9307
|
CardTitle2,
|
|
8353
9308
|
{ key: "title", className: "text-base" },
|
|
8354
9309
|
cardTitle
|
|
8355
9310
|
),
|
|
8356
|
-
cardDescription &&
|
|
9311
|
+
cardDescription && React52.createElement(
|
|
8357
9312
|
CardDescription2,
|
|
8358
9313
|
{ key: "desc" },
|
|
8359
9314
|
cardDescription
|
|
8360
9315
|
)
|
|
8361
9316
|
]),
|
|
8362
|
-
|
|
9317
|
+
React52.createElement(
|
|
8363
9318
|
CardContent2,
|
|
8364
9319
|
{
|
|
8365
9320
|
key: "content",
|
|
@@ -8372,7 +9327,7 @@ function Calendar({
|
|
|
8372
9327
|
}
|
|
8373
9328
|
return content;
|
|
8374
9329
|
}
|
|
8375
|
-
const sidebarElement = renderDateInfo() || renderQuickActions() ?
|
|
9330
|
+
const sidebarElement = renderDateInfo() || renderQuickActions() ? React52.createElement(
|
|
8376
9331
|
"div",
|
|
8377
9332
|
{
|
|
8378
9333
|
className: cn("min-w-[240px] space-y-3", sidebarClassName)
|
|
@@ -8380,7 +9335,7 @@ function Calendar({
|
|
|
8380
9335
|
[renderDateInfo(), renderQuickActions()].filter(Boolean)
|
|
8381
9336
|
) : null;
|
|
8382
9337
|
if (withCard) {
|
|
8383
|
-
const cardElement =
|
|
9338
|
+
const cardElement = React52.createElement(
|
|
8384
9339
|
Card2,
|
|
8385
9340
|
{
|
|
8386
9341
|
className: cn(
|
|
@@ -8391,19 +9346,19 @@ function Calendar({
|
|
|
8391
9346
|
)
|
|
8392
9347
|
},
|
|
8393
9348
|
[
|
|
8394
|
-
(cardTitle || cardDescription) &&
|
|
8395
|
-
cardTitle &&
|
|
9349
|
+
(cardTitle || cardDescription) && React52.createElement(CardHeader2, { key: "header" }, [
|
|
9350
|
+
cardTitle && React52.createElement(
|
|
8396
9351
|
CardTitle2,
|
|
8397
9352
|
{ key: "title", className: "text-base" },
|
|
8398
9353
|
cardTitle
|
|
8399
9354
|
),
|
|
8400
|
-
cardDescription &&
|
|
9355
|
+
cardDescription && React52.createElement(
|
|
8401
9356
|
CardDescription2,
|
|
8402
9357
|
{ key: "desc" },
|
|
8403
9358
|
cardDescription
|
|
8404
9359
|
)
|
|
8405
9360
|
]),
|
|
8406
|
-
|
|
9361
|
+
React52.createElement(
|
|
8407
9362
|
CardContent2,
|
|
8408
9363
|
{
|
|
8409
9364
|
key: "content",
|
|
@@ -8414,7 +9369,7 @@ function Calendar({
|
|
|
8414
9369
|
].filter(Boolean)
|
|
8415
9370
|
);
|
|
8416
9371
|
if (sidebarElement) {
|
|
8417
|
-
return
|
|
9372
|
+
return React52.createElement(
|
|
8418
9373
|
"div",
|
|
8419
9374
|
{
|
|
8420
9375
|
className: cn("flex gap-4 flex-wrap items-start", containerClassName)
|
|
@@ -8425,7 +9380,7 @@ function Calendar({
|
|
|
8425
9380
|
return cardElement;
|
|
8426
9381
|
}
|
|
8427
9382
|
if (sidebarElement) {
|
|
8428
|
-
return
|
|
9383
|
+
return React52.createElement(
|
|
8429
9384
|
"div",
|
|
8430
9385
|
{
|
|
8431
9386
|
className: cn("flex gap-4 flex-wrap items-start", containerClassName)
|
|
@@ -8442,8 +9397,8 @@ function CalendarDayButton({
|
|
|
8442
9397
|
...props
|
|
8443
9398
|
}) {
|
|
8444
9399
|
const defaultClassNames = getDefaultClassNames();
|
|
8445
|
-
const ref =
|
|
8446
|
-
|
|
9400
|
+
const ref = React52.useRef(null);
|
|
9401
|
+
React52.useEffect(() => {
|
|
8447
9402
|
if (modifiers.focused) ref.current?.focus();
|
|
8448
9403
|
}, [modifiers.focused]);
|
|
8449
9404
|
return /* @__PURE__ */ jsx(
|
|
@@ -10059,7 +11014,7 @@ var pickerVariants = cva("w-full justify-start text-left font-normal", {
|
|
|
10059
11014
|
variant: "outlined"
|
|
10060
11015
|
}
|
|
10061
11016
|
});
|
|
10062
|
-
var DatePicker =
|
|
11017
|
+
var DatePicker = React52.forwardRef(
|
|
10063
11018
|
({
|
|
10064
11019
|
date,
|
|
10065
11020
|
onDateChange,
|
|
@@ -10106,7 +11061,7 @@ var DatePicker = React49.forwardRef(
|
|
|
10106
11061
|
}
|
|
10107
11062
|
);
|
|
10108
11063
|
DatePicker.displayName = "DatePicker";
|
|
10109
|
-
var DateRangePicker =
|
|
11064
|
+
var DateRangePicker = React52.forwardRef(
|
|
10110
11065
|
({
|
|
10111
11066
|
dateRange,
|
|
10112
11067
|
onDateRangeChange,
|
|
@@ -10164,15 +11119,15 @@ DateRangePicker.displayName = "DateRangePicker";
|
|
|
10164
11119
|
|
|
10165
11120
|
// src/components/ui/carousel/index.tsx
|
|
10166
11121
|
init_utils();
|
|
10167
|
-
var CarouselContext =
|
|
11122
|
+
var CarouselContext = React52.createContext(null);
|
|
10168
11123
|
function useCarousel() {
|
|
10169
|
-
const context =
|
|
11124
|
+
const context = React52.useContext(CarouselContext);
|
|
10170
11125
|
if (!context) {
|
|
10171
11126
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
10172
11127
|
}
|
|
10173
11128
|
return context;
|
|
10174
11129
|
}
|
|
10175
|
-
var Carousel =
|
|
11130
|
+
var Carousel = React52.forwardRef(
|
|
10176
11131
|
({
|
|
10177
11132
|
orientation = "horizontal",
|
|
10178
11133
|
opts,
|
|
@@ -10189,22 +11144,22 @@ var Carousel = React49.forwardRef(
|
|
|
10189
11144
|
},
|
|
10190
11145
|
plugins
|
|
10191
11146
|
);
|
|
10192
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
10193
|
-
const [canScrollNext, setCanScrollNext] =
|
|
10194
|
-
const onSelect =
|
|
11147
|
+
const [canScrollPrev, setCanScrollPrev] = React52.useState(false);
|
|
11148
|
+
const [canScrollNext, setCanScrollNext] = React52.useState(false);
|
|
11149
|
+
const onSelect = React52.useCallback((api2) => {
|
|
10195
11150
|
if (!api2) {
|
|
10196
11151
|
return;
|
|
10197
11152
|
}
|
|
10198
11153
|
setCanScrollPrev(api2.canScrollPrev());
|
|
10199
11154
|
setCanScrollNext(api2.canScrollNext());
|
|
10200
11155
|
}, []);
|
|
10201
|
-
const scrollPrev =
|
|
11156
|
+
const scrollPrev = React52.useCallback(() => {
|
|
10202
11157
|
api?.scrollPrev();
|
|
10203
11158
|
}, [api]);
|
|
10204
|
-
const scrollNext =
|
|
11159
|
+
const scrollNext = React52.useCallback(() => {
|
|
10205
11160
|
api?.scrollNext();
|
|
10206
11161
|
}, [api]);
|
|
10207
|
-
const handleKeyDown =
|
|
11162
|
+
const handleKeyDown = React52.useCallback(
|
|
10208
11163
|
(event) => {
|
|
10209
11164
|
if (event.key === "ArrowLeft") {
|
|
10210
11165
|
event.preventDefault();
|
|
@@ -10216,13 +11171,13 @@ var Carousel = React49.forwardRef(
|
|
|
10216
11171
|
},
|
|
10217
11172
|
[scrollPrev, scrollNext]
|
|
10218
11173
|
);
|
|
10219
|
-
|
|
11174
|
+
React52.useEffect(() => {
|
|
10220
11175
|
if (!api || !setApi) {
|
|
10221
11176
|
return;
|
|
10222
11177
|
}
|
|
10223
11178
|
setApi(api);
|
|
10224
11179
|
}, [api, setApi]);
|
|
10225
|
-
|
|
11180
|
+
React52.useEffect(() => {
|
|
10226
11181
|
if (!api) {
|
|
10227
11182
|
return;
|
|
10228
11183
|
}
|
|
@@ -10251,7 +11206,11 @@ var Carousel = React49.forwardRef(
|
|
|
10251
11206
|
{
|
|
10252
11207
|
ref,
|
|
10253
11208
|
onKeyDownCapture: handleKeyDown,
|
|
10254
|
-
className: cn(
|
|
11209
|
+
className: cn(
|
|
11210
|
+
"relative",
|
|
11211
|
+
orientation === "vertical" && "h-full",
|
|
11212
|
+
className
|
|
11213
|
+
),
|
|
10255
11214
|
role: "region",
|
|
10256
11215
|
"aria-roledescription": "carousel",
|
|
10257
11216
|
...props,
|
|
@@ -10263,9 +11222,9 @@ var Carousel = React49.forwardRef(
|
|
|
10263
11222
|
}
|
|
10264
11223
|
);
|
|
10265
11224
|
Carousel.displayName = "Carousel";
|
|
10266
|
-
var CarouselContent =
|
|
11225
|
+
var CarouselContent = React52.forwardRef(({ className, ...props }, ref) => {
|
|
10267
11226
|
const { carouselRef, orientation } = useCarousel();
|
|
10268
|
-
return /* @__PURE__ */ jsx("div", { ref: carouselRef, className: "overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
11227
|
+
return /* @__PURE__ */ jsx("div", { ref: carouselRef, className: "overflow-hidden h-full", children: /* @__PURE__ */ jsx(
|
|
10269
11228
|
"div",
|
|
10270
11229
|
{
|
|
10271
11230
|
ref,
|
|
@@ -10279,7 +11238,7 @@ var CarouselContent = React49.forwardRef(({ className, ...props }, ref) => {
|
|
|
10279
11238
|
) });
|
|
10280
11239
|
});
|
|
10281
11240
|
CarouselContent.displayName = "CarouselContent";
|
|
10282
|
-
var CarouselItem =
|
|
11241
|
+
var CarouselItem = React52.forwardRef(({ className, ...props }, ref) => {
|
|
10283
11242
|
const { orientation } = useCarousel();
|
|
10284
11243
|
return /* @__PURE__ */ jsx(
|
|
10285
11244
|
"div",
|
|
@@ -10297,7 +11256,7 @@ var CarouselItem = React49.forwardRef(({ className, ...props }, ref) => {
|
|
|
10297
11256
|
);
|
|
10298
11257
|
});
|
|
10299
11258
|
CarouselItem.displayName = "CarouselItem";
|
|
10300
|
-
var CarouselPrevious =
|
|
11259
|
+
var CarouselPrevious = React52.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
10301
11260
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
10302
11261
|
return /* @__PURE__ */ jsxs(
|
|
10303
11262
|
Button,
|
|
@@ -10306,8 +11265,8 @@ var CarouselPrevious = React49.forwardRef(({ className, variant = "outline", siz
|
|
|
10306
11265
|
variant,
|
|
10307
11266
|
size,
|
|
10308
11267
|
className: cn(
|
|
10309
|
-
"absolute h-8 w-8 rounded-full",
|
|
10310
|
-
orientation === "horizontal" ? "
|
|
11268
|
+
"absolute z-10 h-8 w-8 rounded-full",
|
|
11269
|
+
orientation === "horizontal" ? "left-2 top-1/2 -translate-y-[1rem]" : "top-2 left-1/2 -translate-x-[1rem] rotate-90",
|
|
10311
11270
|
className
|
|
10312
11271
|
),
|
|
10313
11272
|
disabled: !canScrollPrev,
|
|
@@ -10321,7 +11280,7 @@ var CarouselPrevious = React49.forwardRef(({ className, variant = "outline", siz
|
|
|
10321
11280
|
);
|
|
10322
11281
|
});
|
|
10323
11282
|
CarouselPrevious.displayName = "CarouselPrevious";
|
|
10324
|
-
var CarouselNext =
|
|
11283
|
+
var CarouselNext = React52.forwardRef(({ className, variant = "outline", size = "icon", ...props }, ref) => {
|
|
10325
11284
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
10326
11285
|
return /* @__PURE__ */ jsxs(
|
|
10327
11286
|
Button,
|
|
@@ -10330,8 +11289,8 @@ var CarouselNext = React49.forwardRef(({ className, variant = "outline", size =
|
|
|
10330
11289
|
variant,
|
|
10331
11290
|
size,
|
|
10332
11291
|
className: cn(
|
|
10333
|
-
"absolute h-8 w-8 rounded-full",
|
|
10334
|
-
orientation === "horizontal" ? "
|
|
11292
|
+
"absolute z-10 h-8 w-8 rounded-full",
|
|
11293
|
+
orientation === "horizontal" ? "right-2 top-1/2 -translate-y-[1rem]" : "bottom-2 left-1/2 -translate-x-[1rem] rotate-90",
|
|
10335
11294
|
className
|
|
10336
11295
|
),
|
|
10337
11296
|
disabled: !canScrollNext,
|
|
@@ -10360,10 +11319,10 @@ function SimpleCarousel({
|
|
|
10360
11319
|
nextArrow,
|
|
10361
11320
|
onSlideChange
|
|
10362
11321
|
}) {
|
|
10363
|
-
const [api, setApi] =
|
|
10364
|
-
const [current, setCurrent] =
|
|
10365
|
-
const [count, setCount] =
|
|
10366
|
-
|
|
11322
|
+
const [api, setApi] = React52.useState();
|
|
11323
|
+
const [current, setCurrent] = React52.useState(0);
|
|
11324
|
+
const [count, setCount] = React52.useState(0);
|
|
11325
|
+
React52.useEffect(() => {
|
|
10367
11326
|
if (!api) {
|
|
10368
11327
|
return;
|
|
10369
11328
|
}
|
|
@@ -10375,7 +11334,7 @@ function SimpleCarousel({
|
|
|
10375
11334
|
onSlideChange?.(selectedIndex);
|
|
10376
11335
|
});
|
|
10377
11336
|
}, [api, onSlideChange]);
|
|
10378
|
-
|
|
11337
|
+
React52.useEffect(() => {
|
|
10379
11338
|
if (!api || !autoPlay) {
|
|
10380
11339
|
return;
|
|
10381
11340
|
}
|
|
@@ -10389,55 +11348,65 @@ function SimpleCarousel({
|
|
|
10389
11348
|
return () => clearInterval(interval);
|
|
10390
11349
|
}, [api, autoPlay, loop]);
|
|
10391
11350
|
const slideWidth = slidesToShow > 1 ? `${100 / slidesToShow}%` : "100%";
|
|
10392
|
-
return /* @__PURE__ */ jsxs(
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
/* @__PURE__ */ jsx(CarouselContent, { children: items.map((item, index) => /* @__PURE__ */ jsx(
|
|
10405
|
-
CarouselItem,
|
|
10406
|
-
{
|
|
10407
|
-
className: cn(itemClassName, item.className),
|
|
10408
|
-
style: { flexBasis: slideWidth },
|
|
10409
|
-
onClick: item.onClick,
|
|
10410
|
-
children: item.content
|
|
11351
|
+
return /* @__PURE__ */ jsxs(
|
|
11352
|
+
"div",
|
|
11353
|
+
{
|
|
11354
|
+
className: cn("w-full", orientation === "vertical" && "h-64", className),
|
|
11355
|
+
children: [
|
|
11356
|
+
/* @__PURE__ */ jsxs(
|
|
11357
|
+
Carousel,
|
|
11358
|
+
{
|
|
11359
|
+
setApi,
|
|
11360
|
+
opts: {
|
|
11361
|
+
align: "start",
|
|
11362
|
+
loop
|
|
10411
11363
|
},
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
11364
|
+
orientation,
|
|
11365
|
+
className: cn(
|
|
11366
|
+
"w-full mx-auto",
|
|
11367
|
+
orientation === "vertical" && "h-full",
|
|
11368
|
+
containerClassName
|
|
11369
|
+
),
|
|
11370
|
+
children: [
|
|
11371
|
+
/* @__PURE__ */ jsx(CarouselContent, { children: items.map((item, index) => /* @__PURE__ */ jsx(
|
|
11372
|
+
CarouselItem,
|
|
11373
|
+
{
|
|
11374
|
+
className: cn(itemClassName, item.className),
|
|
11375
|
+
style: { flexBasis: slideWidth },
|
|
11376
|
+
onClick: item.onClick,
|
|
11377
|
+
children: item.content
|
|
11378
|
+
},
|
|
11379
|
+
item.id || index
|
|
11380
|
+
)) }),
|
|
11381
|
+
showArrows && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11382
|
+
prevArrow || /* @__PURE__ */ jsx(CarouselPrevious, {}),
|
|
11383
|
+
nextArrow || /* @__PURE__ */ jsx(CarouselNext, {})
|
|
11384
|
+
] })
|
|
11385
|
+
]
|
|
11386
|
+
}
|
|
10428
11387
|
),
|
|
10429
|
-
|
|
10430
|
-
|
|
10431
|
-
|
|
10432
|
-
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
|
|
11388
|
+
showDots && /* @__PURE__ */ jsx("div", { className: "flex justify-center space-x-2 mt-4", children: Array.from({ length: count }).map((_, index) => /* @__PURE__ */ jsx(
|
|
11389
|
+
Button,
|
|
11390
|
+
{
|
|
11391
|
+
variant: "ghost",
|
|
11392
|
+
className: cn(
|
|
11393
|
+
"h-2 w-2 rounded-full transition-colors",
|
|
11394
|
+
current === index + 1 ? "bg-primary" : "bg-primary/20 hover:bg-primary/40"
|
|
11395
|
+
),
|
|
11396
|
+
onClick: () => api?.scrollTo(index),
|
|
11397
|
+
"aria-label": `Go to slide ${index + 1}`
|
|
11398
|
+
},
|
|
11399
|
+
index
|
|
11400
|
+
)) }),
|
|
11401
|
+
count > 0 && /* @__PURE__ */ jsxs("div", { className: "py-2 text-center text-sm text-muted-foreground", children: [
|
|
11402
|
+
"Slide ",
|
|
11403
|
+
current,
|
|
11404
|
+
" of ",
|
|
11405
|
+
count
|
|
11406
|
+
] })
|
|
11407
|
+
]
|
|
11408
|
+
}
|
|
11409
|
+
);
|
|
10441
11410
|
}
|
|
10442
11411
|
|
|
10443
11412
|
// src/components/ui/typography/index.tsx
|
|
@@ -10515,7 +11484,7 @@ var typeToTag = {
|
|
|
10515
11484
|
list: "ul",
|
|
10516
11485
|
"list-item": "li"
|
|
10517
11486
|
};
|
|
10518
|
-
var Typography =
|
|
11487
|
+
var Typography = React52.forwardRef(
|
|
10519
11488
|
({
|
|
10520
11489
|
type,
|
|
10521
11490
|
size,
|
|
@@ -10552,7 +11521,7 @@ var Typography = React49.forwardRef(
|
|
|
10552
11521
|
);
|
|
10553
11522
|
Typography.displayName = "Typography";
|
|
10554
11523
|
function createWrapper(fixedType) {
|
|
10555
|
-
return
|
|
11524
|
+
return React52.forwardRef(
|
|
10556
11525
|
({ ...props }, ref) => /* @__PURE__ */ jsx(Typography, { ref, type: fixedType, ...props })
|
|
10557
11526
|
);
|
|
10558
11527
|
}
|
|
@@ -10599,6 +11568,680 @@ var TypographyGroup = {
|
|
|
10599
11568
|
// src/index.ts
|
|
10600
11569
|
init_utils();
|
|
10601
11570
|
|
|
10602
|
-
|
|
11571
|
+
// src/components/ui/charts/chart-theme.ts
|
|
11572
|
+
var getCSSVariable = (name) => {
|
|
11573
|
+
if (typeof window === "undefined") return "";
|
|
11574
|
+
return getComputedStyle(document.documentElement).getPropertyValue(name).trim();
|
|
11575
|
+
};
|
|
11576
|
+
var CHART_COLORS = {
|
|
11577
|
+
primary: "var(--chart-1)",
|
|
11578
|
+
secondary: "var(--chart-2)",
|
|
11579
|
+
tertiary: "var(--chart-3)",
|
|
11580
|
+
quaternary: "var(--chart-4)",
|
|
11581
|
+
quinary: "var(--chart-5)",
|
|
11582
|
+
// Semantic colors (fixed values)
|
|
11583
|
+
success: "#22a55b",
|
|
11584
|
+
warning: "#f59e0b",
|
|
11585
|
+
error: "#ef4444",
|
|
11586
|
+
info: "var(--chart-1)",
|
|
11587
|
+
// Neutral - uses theme variables
|
|
11588
|
+
muted: "var(--muted-foreground)",
|
|
11589
|
+
foreground: "var(--foreground)",
|
|
11590
|
+
background: "var(--background)",
|
|
11591
|
+
grid: "var(--border)"
|
|
11592
|
+
};
|
|
11593
|
+
var CHART_PALETTE = [
|
|
11594
|
+
CHART_COLORS.primary,
|
|
11595
|
+
CHART_COLORS.secondary,
|
|
11596
|
+
CHART_COLORS.tertiary,
|
|
11597
|
+
CHART_COLORS.quaternary,
|
|
11598
|
+
CHART_COLORS.quinary,
|
|
11599
|
+
CHART_COLORS.success,
|
|
11600
|
+
CHART_COLORS.warning,
|
|
11601
|
+
CHART_COLORS.error
|
|
11602
|
+
];
|
|
11603
|
+
var getThemeColors = () => {
|
|
11604
|
+
const chart1 = getCSSVariable("--chart-1");
|
|
11605
|
+
const primary = getCSSVariable("--primary");
|
|
11606
|
+
return {
|
|
11607
|
+
primary: chart1 || primary || "#007bff",
|
|
11608
|
+
chart1: chart1 || "#007bff",
|
|
11609
|
+
chart2: getCSSVariable("--chart-2") || "#3d9bff",
|
|
11610
|
+
chart3: getCSSVariable("--chart-3") || "#7abaff",
|
|
11611
|
+
chart4: getCSSVariable("--chart-4") || "#0563c7",
|
|
11612
|
+
chart5: getCSSVariable("--chart-5") || "#084f9b",
|
|
11613
|
+
foreground: getCSSVariable("--foreground") || "#23252a",
|
|
11614
|
+
muted: getCSSVariable("--muted-foreground") || "#616875",
|
|
11615
|
+
grid: getCSSVariable("--border") || "#dbdde1",
|
|
11616
|
+
background: getCSSVariable("--background") || "#fff"
|
|
11617
|
+
};
|
|
11618
|
+
};
|
|
11619
|
+
var tooltipStyle = {
|
|
11620
|
+
backgroundColor: "var(--popover)",
|
|
11621
|
+
border: "1px solid var(--border)",
|
|
11622
|
+
borderRadius: "6px",
|
|
11623
|
+
padding: "8px 12px",
|
|
11624
|
+
boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
|
|
11625
|
+
color: "var(--foreground)"
|
|
11626
|
+
};
|
|
11627
|
+
var tooltipLabelStyle = {
|
|
11628
|
+
color: "var(--foreground)",
|
|
11629
|
+
fontWeight: 500
|
|
11630
|
+
};
|
|
11631
|
+
var tooltipItemStyle = {
|
|
11632
|
+
color: "var(--foreground)"
|
|
11633
|
+
};
|
|
11634
|
+
var legendStyle = {
|
|
11635
|
+
fontSize: "12px",
|
|
11636
|
+
color: "var(--muted-foreground, #616875)"
|
|
11637
|
+
};
|
|
11638
|
+
function LineChart({
|
|
11639
|
+
data,
|
|
11640
|
+
xAxisKey,
|
|
11641
|
+
lines,
|
|
11642
|
+
width = "100%",
|
|
11643
|
+
height = 300,
|
|
11644
|
+
showGrid = true,
|
|
11645
|
+
showTooltip = true,
|
|
11646
|
+
showLegend = true,
|
|
11647
|
+
showXAxis = true,
|
|
11648
|
+
showYAxis = true,
|
|
11649
|
+
margin = { top: 20, right: 30, left: 20, bottom: 5 },
|
|
11650
|
+
className
|
|
11651
|
+
}) {
|
|
11652
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width, height, children: /* @__PURE__ */ jsxs(LineChart$1, { data, margin, children: [
|
|
11653
|
+
showGrid && /* @__PURE__ */ jsx(
|
|
11654
|
+
CartesianGrid,
|
|
11655
|
+
{
|
|
11656
|
+
strokeDasharray: "3 3",
|
|
11657
|
+
stroke: CHART_COLORS.grid,
|
|
11658
|
+
strokeOpacity: 0.5
|
|
11659
|
+
}
|
|
11660
|
+
),
|
|
11661
|
+
showXAxis && /* @__PURE__ */ jsx(
|
|
11662
|
+
XAxis,
|
|
11663
|
+
{
|
|
11664
|
+
dataKey: xAxisKey,
|
|
11665
|
+
stroke: CHART_COLORS.muted,
|
|
11666
|
+
fontSize: 12,
|
|
11667
|
+
tickLine: false,
|
|
11668
|
+
axisLine: false
|
|
11669
|
+
}
|
|
11670
|
+
),
|
|
11671
|
+
showYAxis && /* @__PURE__ */ jsx(
|
|
11672
|
+
YAxis,
|
|
11673
|
+
{
|
|
11674
|
+
stroke: CHART_COLORS.muted,
|
|
11675
|
+
fontSize: 12,
|
|
11676
|
+
tickLine: false,
|
|
11677
|
+
axisLine: false
|
|
11678
|
+
}
|
|
11679
|
+
),
|
|
11680
|
+
showTooltip && /* @__PURE__ */ jsx(
|
|
11681
|
+
Tooltip$1,
|
|
11682
|
+
{
|
|
11683
|
+
contentStyle: tooltipStyle,
|
|
11684
|
+
labelStyle: tooltipLabelStyle,
|
|
11685
|
+
itemStyle: tooltipItemStyle
|
|
11686
|
+
}
|
|
11687
|
+
),
|
|
11688
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {}),
|
|
11689
|
+
lines.map((line, index) => /* @__PURE__ */ jsx(
|
|
11690
|
+
Line,
|
|
11691
|
+
{
|
|
11692
|
+
type: line.type ?? "monotone",
|
|
11693
|
+
dataKey: line.dataKey,
|
|
11694
|
+
name: line.name ?? line.dataKey,
|
|
11695
|
+
stroke: line.stroke ?? CHART_PALETTE[index % CHART_PALETTE.length],
|
|
11696
|
+
strokeWidth: line.strokeWidth ?? 2,
|
|
11697
|
+
dot: line.dot ?? false,
|
|
11698
|
+
activeDot: { r: 4 }
|
|
11699
|
+
},
|
|
11700
|
+
line.dataKey
|
|
11701
|
+
))
|
|
11702
|
+
] }) }) });
|
|
11703
|
+
}
|
|
11704
|
+
function BarChart({
|
|
11705
|
+
data,
|
|
11706
|
+
xAxisKey,
|
|
11707
|
+
bars,
|
|
11708
|
+
width = "100%",
|
|
11709
|
+
height = 300,
|
|
11710
|
+
showGrid = true,
|
|
11711
|
+
showTooltip = true,
|
|
11712
|
+
showLegend = true,
|
|
11713
|
+
layout = "horizontal",
|
|
11714
|
+
margin,
|
|
11715
|
+
className
|
|
11716
|
+
}) {
|
|
11717
|
+
const defaultMargin = layout === "vertical" ? { top: 20, right: 30, left: 60, bottom: 5 } : { top: 20, right: 30, left: 20, bottom: 5 };
|
|
11718
|
+
const chartMargin = margin ?? defaultMargin;
|
|
11719
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width, height, children: /* @__PURE__ */ jsxs(BarChart$1, { data, layout, margin: chartMargin, children: [
|
|
11720
|
+
showGrid && /* @__PURE__ */ jsx(
|
|
11721
|
+
CartesianGrid,
|
|
11722
|
+
{
|
|
11723
|
+
strokeDasharray: "3 3",
|
|
11724
|
+
stroke: CHART_COLORS.grid,
|
|
11725
|
+
strokeOpacity: 0.5
|
|
11726
|
+
}
|
|
11727
|
+
),
|
|
11728
|
+
layout === "horizontal" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11729
|
+
/* @__PURE__ */ jsx(
|
|
11730
|
+
XAxis,
|
|
11731
|
+
{
|
|
11732
|
+
dataKey: xAxisKey,
|
|
11733
|
+
stroke: CHART_COLORS.muted,
|
|
11734
|
+
fontSize: 12,
|
|
11735
|
+
tickLine: false,
|
|
11736
|
+
axisLine: false
|
|
11737
|
+
}
|
|
11738
|
+
),
|
|
11739
|
+
/* @__PURE__ */ jsx(
|
|
11740
|
+
YAxis,
|
|
11741
|
+
{
|
|
11742
|
+
stroke: CHART_COLORS.muted,
|
|
11743
|
+
fontSize: 12,
|
|
11744
|
+
tickLine: false,
|
|
11745
|
+
axisLine: false
|
|
11746
|
+
}
|
|
11747
|
+
)
|
|
11748
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11749
|
+
/* @__PURE__ */ jsx(
|
|
11750
|
+
XAxis,
|
|
11751
|
+
{
|
|
11752
|
+
type: "number",
|
|
11753
|
+
domain: [0, "dataMax"],
|
|
11754
|
+
stroke: CHART_COLORS.muted,
|
|
11755
|
+
fontSize: 12,
|
|
11756
|
+
tickLine: false,
|
|
11757
|
+
axisLine: false
|
|
11758
|
+
}
|
|
11759
|
+
),
|
|
11760
|
+
/* @__PURE__ */ jsx(
|
|
11761
|
+
YAxis,
|
|
11762
|
+
{
|
|
11763
|
+
dataKey: xAxisKey,
|
|
11764
|
+
type: "category",
|
|
11765
|
+
width: 80,
|
|
11766
|
+
stroke: CHART_COLORS.muted,
|
|
11767
|
+
fontSize: 12,
|
|
11768
|
+
tickLine: false,
|
|
11769
|
+
axisLine: false
|
|
11770
|
+
}
|
|
11771
|
+
)
|
|
11772
|
+
] }),
|
|
11773
|
+
showTooltip && /* @__PURE__ */ jsx(
|
|
11774
|
+
Tooltip$1,
|
|
11775
|
+
{
|
|
11776
|
+
contentStyle: tooltipStyle,
|
|
11777
|
+
labelStyle: tooltipLabelStyle,
|
|
11778
|
+
itemStyle: tooltipItemStyle
|
|
11779
|
+
}
|
|
11780
|
+
),
|
|
11781
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {}),
|
|
11782
|
+
bars.map((bar, index) => {
|
|
11783
|
+
const defaultRadius = layout === "vertical" ? [0, 4, 4, 0] : [4, 4, 0, 0];
|
|
11784
|
+
return /* @__PURE__ */ jsx(
|
|
11785
|
+
Bar,
|
|
11786
|
+
{
|
|
11787
|
+
dataKey: bar.dataKey,
|
|
11788
|
+
name: bar.name ?? bar.dataKey,
|
|
11789
|
+
fill: bar.fill ?? CHART_PALETTE[index % CHART_PALETTE.length],
|
|
11790
|
+
stackId: bar.stackId,
|
|
11791
|
+
radius: bar.radius ?? defaultRadius
|
|
11792
|
+
},
|
|
11793
|
+
bar.dataKey
|
|
11794
|
+
);
|
|
11795
|
+
})
|
|
11796
|
+
] }) }) });
|
|
11797
|
+
}
|
|
11798
|
+
function PieChart({
|
|
11799
|
+
data,
|
|
11800
|
+
dataKey = "value",
|
|
11801
|
+
nameKey = "name",
|
|
11802
|
+
width = "100%",
|
|
11803
|
+
height = 300,
|
|
11804
|
+
showTooltip = true,
|
|
11805
|
+
showLegend = true,
|
|
11806
|
+
innerRadius = 0,
|
|
11807
|
+
outerRadius = 80,
|
|
11808
|
+
showLabel = false,
|
|
11809
|
+
margin = { top: 20, right: 30, left: 20, bottom: 5 },
|
|
11810
|
+
className
|
|
11811
|
+
}) {
|
|
11812
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width, height, children: /* @__PURE__ */ jsxs(PieChart$1, { margin, children: [
|
|
11813
|
+
/* @__PURE__ */ jsx(
|
|
11814
|
+
Pie,
|
|
11815
|
+
{
|
|
11816
|
+
data,
|
|
11817
|
+
dataKey,
|
|
11818
|
+
nameKey,
|
|
11819
|
+
cx: "50%",
|
|
11820
|
+
cy: "50%",
|
|
11821
|
+
innerRadius,
|
|
11822
|
+
outerRadius,
|
|
11823
|
+
label: showLabel,
|
|
11824
|
+
labelLine: showLabel,
|
|
11825
|
+
children: data.map((entry, index) => /* @__PURE__ */ jsx(
|
|
11826
|
+
Cell,
|
|
11827
|
+
{
|
|
11828
|
+
fill: entry.fill ?? CHART_PALETTE[index % CHART_PALETTE.length]
|
|
11829
|
+
},
|
|
11830
|
+
`cell-${index}`
|
|
11831
|
+
))
|
|
11832
|
+
}
|
|
11833
|
+
),
|
|
11834
|
+
showTooltip && /* @__PURE__ */ jsx(
|
|
11835
|
+
Tooltip$1,
|
|
11836
|
+
{
|
|
11837
|
+
contentStyle: tooltipStyle,
|
|
11838
|
+
labelStyle: tooltipLabelStyle,
|
|
11839
|
+
itemStyle: tooltipItemStyle
|
|
11840
|
+
}
|
|
11841
|
+
),
|
|
11842
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {})
|
|
11843
|
+
] }) }) });
|
|
11844
|
+
}
|
|
11845
|
+
function AreaChart({
|
|
11846
|
+
data,
|
|
11847
|
+
xAxisKey,
|
|
11848
|
+
areas,
|
|
11849
|
+
width = "100%",
|
|
11850
|
+
height = 300,
|
|
11851
|
+
showGrid = true,
|
|
11852
|
+
showTooltip = true,
|
|
11853
|
+
showLegend = true,
|
|
11854
|
+
margin = { top: 20, right: 30, left: 20, bottom: 5 },
|
|
11855
|
+
className
|
|
11856
|
+
}) {
|
|
11857
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width, height, children: /* @__PURE__ */ jsxs(AreaChart$1, { data, margin, children: [
|
|
11858
|
+
showGrid && /* @__PURE__ */ jsx(
|
|
11859
|
+
CartesianGrid,
|
|
11860
|
+
{
|
|
11861
|
+
strokeDasharray: "3 3",
|
|
11862
|
+
stroke: CHART_COLORS.grid,
|
|
11863
|
+
strokeOpacity: 0.5
|
|
11864
|
+
}
|
|
11865
|
+
),
|
|
11866
|
+
/* @__PURE__ */ jsx(
|
|
11867
|
+
XAxis,
|
|
11868
|
+
{
|
|
11869
|
+
dataKey: xAxisKey,
|
|
11870
|
+
stroke: CHART_COLORS.muted,
|
|
11871
|
+
fontSize: 12,
|
|
11872
|
+
tickLine: false,
|
|
11873
|
+
axisLine: false
|
|
11874
|
+
}
|
|
11875
|
+
),
|
|
11876
|
+
/* @__PURE__ */ jsx(
|
|
11877
|
+
YAxis,
|
|
11878
|
+
{
|
|
11879
|
+
stroke: CHART_COLORS.muted,
|
|
11880
|
+
fontSize: 12,
|
|
11881
|
+
tickLine: false,
|
|
11882
|
+
axisLine: false
|
|
11883
|
+
}
|
|
11884
|
+
),
|
|
11885
|
+
showTooltip && /* @__PURE__ */ jsx(
|
|
11886
|
+
Tooltip$1,
|
|
11887
|
+
{
|
|
11888
|
+
contentStyle: tooltipStyle,
|
|
11889
|
+
labelStyle: tooltipLabelStyle,
|
|
11890
|
+
itemStyle: tooltipItemStyle
|
|
11891
|
+
}
|
|
11892
|
+
),
|
|
11893
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {}),
|
|
11894
|
+
areas.map((area, index) => {
|
|
11895
|
+
const color = area.stroke ?? CHART_PALETTE[index % CHART_PALETTE.length];
|
|
11896
|
+
return /* @__PURE__ */ jsx(
|
|
11897
|
+
Area,
|
|
11898
|
+
{
|
|
11899
|
+
type: area.type ?? "monotone",
|
|
11900
|
+
dataKey: area.dataKey,
|
|
11901
|
+
name: area.name ?? area.dataKey,
|
|
11902
|
+
stroke: color,
|
|
11903
|
+
fill: area.fill ?? color,
|
|
11904
|
+
fillOpacity: area.fillOpacity ?? 0.3,
|
|
11905
|
+
stackId: area.stackId
|
|
11906
|
+
},
|
|
11907
|
+
area.dataKey
|
|
11908
|
+
);
|
|
11909
|
+
})
|
|
11910
|
+
] }) }) });
|
|
11911
|
+
}
|
|
11912
|
+
function ScatterChart({
|
|
11913
|
+
series,
|
|
11914
|
+
xAxisKey,
|
|
11915
|
+
yAxisKey,
|
|
11916
|
+
zAxisKey,
|
|
11917
|
+
width = "100%",
|
|
11918
|
+
height = 300,
|
|
11919
|
+
showGrid = true,
|
|
11920
|
+
showTooltip = true,
|
|
11921
|
+
showLegend = true,
|
|
11922
|
+
margin = { top: 20, right: 30, left: 20, bottom: 5 },
|
|
11923
|
+
className
|
|
11924
|
+
}) {
|
|
11925
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width, height, children: /* @__PURE__ */ jsxs(ScatterChart$1, { margin, children: [
|
|
11926
|
+
showGrid && /* @__PURE__ */ jsx(
|
|
11927
|
+
CartesianGrid,
|
|
11928
|
+
{
|
|
11929
|
+
strokeDasharray: "3 3",
|
|
11930
|
+
stroke: CHART_COLORS.grid,
|
|
11931
|
+
strokeOpacity: 0.5
|
|
11932
|
+
}
|
|
11933
|
+
),
|
|
11934
|
+
/* @__PURE__ */ jsx(
|
|
11935
|
+
XAxis,
|
|
11936
|
+
{
|
|
11937
|
+
dataKey: xAxisKey,
|
|
11938
|
+
type: "number",
|
|
11939
|
+
stroke: CHART_COLORS.muted,
|
|
11940
|
+
fontSize: 12,
|
|
11941
|
+
tickLine: false,
|
|
11942
|
+
axisLine: false
|
|
11943
|
+
}
|
|
11944
|
+
),
|
|
11945
|
+
/* @__PURE__ */ jsx(
|
|
11946
|
+
YAxis,
|
|
11947
|
+
{
|
|
11948
|
+
dataKey: yAxisKey,
|
|
11949
|
+
type: "number",
|
|
11950
|
+
stroke: CHART_COLORS.muted,
|
|
11951
|
+
fontSize: 12,
|
|
11952
|
+
tickLine: false,
|
|
11953
|
+
axisLine: false
|
|
11954
|
+
}
|
|
11955
|
+
),
|
|
11956
|
+
zAxisKey && /* @__PURE__ */ jsx(ZAxis, { dataKey: zAxisKey, range: [60, 400] }),
|
|
11957
|
+
showTooltip && /* @__PURE__ */ jsx(
|
|
11958
|
+
Tooltip$1,
|
|
11959
|
+
{
|
|
11960
|
+
contentStyle: tooltipStyle,
|
|
11961
|
+
labelStyle: tooltipLabelStyle,
|
|
11962
|
+
itemStyle: tooltipItemStyle,
|
|
11963
|
+
cursor: { strokeDasharray: "3 3" }
|
|
11964
|
+
}
|
|
11965
|
+
),
|
|
11966
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {}),
|
|
11967
|
+
series.map((s, index) => /* @__PURE__ */ jsx(
|
|
11968
|
+
Scatter,
|
|
11969
|
+
{
|
|
11970
|
+
name: s.name,
|
|
11971
|
+
data: s.data,
|
|
11972
|
+
fill: s.fill ?? CHART_PALETTE[index % CHART_PALETTE.length]
|
|
11973
|
+
},
|
|
11974
|
+
s.name
|
|
11975
|
+
))
|
|
11976
|
+
] }) }) });
|
|
11977
|
+
}
|
|
11978
|
+
function RadarChart({
|
|
11979
|
+
data,
|
|
11980
|
+
angleKey,
|
|
11981
|
+
radars,
|
|
11982
|
+
width = "100%",
|
|
11983
|
+
height = 300,
|
|
11984
|
+
showTooltip = true,
|
|
11985
|
+
showLegend = true,
|
|
11986
|
+
outerRadius = "80%",
|
|
11987
|
+
margin = { top: 20, right: 30, left: 20, bottom: 5 },
|
|
11988
|
+
domain,
|
|
11989
|
+
className
|
|
11990
|
+
}) {
|
|
11991
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width, height, children: /* @__PURE__ */ jsxs(
|
|
11992
|
+
RadarChart$1,
|
|
11993
|
+
{
|
|
11994
|
+
data,
|
|
11995
|
+
margin,
|
|
11996
|
+
outerRadius,
|
|
11997
|
+
children: [
|
|
11998
|
+
/* @__PURE__ */ jsx(PolarGrid, { stroke: CHART_COLORS.grid, strokeOpacity: 0.5 }),
|
|
11999
|
+
/* @__PURE__ */ jsx(
|
|
12000
|
+
PolarAngleAxis,
|
|
12001
|
+
{
|
|
12002
|
+
dataKey: angleKey,
|
|
12003
|
+
stroke: CHART_COLORS.muted,
|
|
12004
|
+
fontSize: 12
|
|
12005
|
+
}
|
|
12006
|
+
),
|
|
12007
|
+
/* @__PURE__ */ jsx(
|
|
12008
|
+
PolarRadiusAxis,
|
|
12009
|
+
{
|
|
12010
|
+
stroke: CHART_COLORS.muted,
|
|
12011
|
+
fontSize: 10,
|
|
12012
|
+
angle: 90,
|
|
12013
|
+
domain
|
|
12014
|
+
}
|
|
12015
|
+
),
|
|
12016
|
+
showTooltip && /* @__PURE__ */ jsx(
|
|
12017
|
+
Tooltip$1,
|
|
12018
|
+
{
|
|
12019
|
+
contentStyle: tooltipStyle,
|
|
12020
|
+
labelStyle: tooltipLabelStyle,
|
|
12021
|
+
itemStyle: tooltipItemStyle
|
|
12022
|
+
}
|
|
12023
|
+
),
|
|
12024
|
+
showLegend && /* @__PURE__ */ jsx(Legend, {}),
|
|
12025
|
+
radars.map((radar, index) => {
|
|
12026
|
+
const color = radar.stroke ?? CHART_PALETTE[index % CHART_PALETTE.length];
|
|
12027
|
+
return /* @__PURE__ */ jsx(
|
|
12028
|
+
Radar,
|
|
12029
|
+
{
|
|
12030
|
+
name: radar.name ?? radar.dataKey,
|
|
12031
|
+
dataKey: radar.dataKey,
|
|
12032
|
+
stroke: color,
|
|
12033
|
+
fill: radar.fill ?? color,
|
|
12034
|
+
fillOpacity: radar.fillOpacity ?? 0.3
|
|
12035
|
+
},
|
|
12036
|
+
radar.dataKey
|
|
12037
|
+
);
|
|
12038
|
+
})
|
|
12039
|
+
]
|
|
12040
|
+
}
|
|
12041
|
+
) }) });
|
|
12042
|
+
}
|
|
12043
|
+
var THEMES = {
|
|
12044
|
+
default: "default",
|
|
12045
|
+
sunset: "sunset",
|
|
12046
|
+
lavender: "lavender",
|
|
12047
|
+
rose: "rose",
|
|
12048
|
+
slate: "slate",
|
|
12049
|
+
midnight: "midnight",
|
|
12050
|
+
emerald: "emerald",
|
|
12051
|
+
amber: "amber",
|
|
12052
|
+
crimson: "crimson"
|
|
12053
|
+
};
|
|
12054
|
+
var THEME_CATALOG = [
|
|
12055
|
+
{
|
|
12056
|
+
name: "default",
|
|
12057
|
+
label: "Default (Toss Blue)",
|
|
12058
|
+
description: "Clean, professional blue theme",
|
|
12059
|
+
primaryColor: "hsl(211, 100%, 50%)"
|
|
12060
|
+
},
|
|
12061
|
+
{
|
|
12062
|
+
name: "sunset",
|
|
12063
|
+
label: "Sunset",
|
|
12064
|
+
description: "Warm orange for energy and creativity",
|
|
12065
|
+
primaryColor: "hsl(24, 95%, 53%)"
|
|
12066
|
+
},
|
|
12067
|
+
{
|
|
12068
|
+
name: "lavender",
|
|
12069
|
+
label: "Lavender",
|
|
12070
|
+
description: "Elegant purple for creative projects",
|
|
12071
|
+
primaryColor: "hsl(262, 83%, 58%)"
|
|
12072
|
+
},
|
|
12073
|
+
{
|
|
12074
|
+
name: "rose",
|
|
12075
|
+
label: "Rose",
|
|
12076
|
+
description: "Soft pink for modern, approachable design",
|
|
12077
|
+
primaryColor: "hsl(346, 77%, 50%)"
|
|
12078
|
+
},
|
|
12079
|
+
{
|
|
12080
|
+
name: "slate",
|
|
12081
|
+
label: "Slate",
|
|
12082
|
+
description: "Minimal gray for clean, professional look",
|
|
12083
|
+
primaryColor: "hsl(215, 16%, 47%)"
|
|
12084
|
+
},
|
|
12085
|
+
{
|
|
12086
|
+
name: "midnight",
|
|
12087
|
+
label: "Midnight",
|
|
12088
|
+
description: "Deep purple-blue optimized for dark mode",
|
|
12089
|
+
primaryColor: "hsl(240, 65%, 52%)"
|
|
12090
|
+
},
|
|
12091
|
+
{
|
|
12092
|
+
name: "emerald",
|
|
12093
|
+
label: "Emerald",
|
|
12094
|
+
description: "Fresh teal-green for tech-forward apps",
|
|
12095
|
+
primaryColor: "hsl(160, 84%, 39%)"
|
|
12096
|
+
},
|
|
12097
|
+
{
|
|
12098
|
+
name: "amber",
|
|
12099
|
+
label: "Amber",
|
|
12100
|
+
description: "Premium gold for attention-grabbing UI",
|
|
12101
|
+
primaryColor: "hsl(38, 92%, 50%)"
|
|
12102
|
+
},
|
|
12103
|
+
{
|
|
12104
|
+
name: "crimson",
|
|
12105
|
+
label: "Crimson",
|
|
12106
|
+
description: "Bold red for urgent, passionate design",
|
|
12107
|
+
primaryColor: "hsl(0, 84%, 50%)"
|
|
12108
|
+
}
|
|
12109
|
+
];
|
|
12110
|
+
function getCurrentTheme() {
|
|
12111
|
+
if (typeof document === "undefined") return "default";
|
|
12112
|
+
const html = document.documentElement;
|
|
12113
|
+
for (const theme of Object.keys(THEMES)) {
|
|
12114
|
+
if (theme !== "default" && html.classList.contains(`theme-${theme}`)) {
|
|
12115
|
+
return theme;
|
|
12116
|
+
}
|
|
12117
|
+
}
|
|
12118
|
+
return "default";
|
|
12119
|
+
}
|
|
12120
|
+
function getCurrentMode() {
|
|
12121
|
+
if (typeof document === "undefined") return "light";
|
|
12122
|
+
return document.documentElement.classList.contains("dark") ? "dark" : "light";
|
|
12123
|
+
}
|
|
12124
|
+
function setTheme(theme) {
|
|
12125
|
+
if (typeof document === "undefined") return;
|
|
12126
|
+
const html = document.documentElement;
|
|
12127
|
+
for (const t of Object.keys(THEMES)) {
|
|
12128
|
+
if (t !== "default") {
|
|
12129
|
+
html.classList.remove(`theme-${t}`);
|
|
12130
|
+
}
|
|
12131
|
+
}
|
|
12132
|
+
if (theme !== "default") {
|
|
12133
|
+
html.classList.add(`theme-${theme}`);
|
|
12134
|
+
}
|
|
12135
|
+
try {
|
|
12136
|
+
localStorage.setItem("mvn-theme", theme);
|
|
12137
|
+
} catch {
|
|
12138
|
+
}
|
|
12139
|
+
}
|
|
12140
|
+
function setMode(mode) {
|
|
12141
|
+
if (typeof document === "undefined") return;
|
|
12142
|
+
const html = document.documentElement;
|
|
12143
|
+
if (mode === "system") {
|
|
12144
|
+
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
12145
|
+
html.classList.toggle("dark", prefersDark);
|
|
12146
|
+
} else {
|
|
12147
|
+
html.classList.toggle("dark", mode === "dark");
|
|
12148
|
+
}
|
|
12149
|
+
try {
|
|
12150
|
+
localStorage.setItem("mvn-mode", mode);
|
|
12151
|
+
} catch {
|
|
12152
|
+
}
|
|
12153
|
+
}
|
|
12154
|
+
function initializeTheme() {
|
|
12155
|
+
if (typeof window === "undefined") return;
|
|
12156
|
+
try {
|
|
12157
|
+
const savedTheme = localStorage.getItem("mvn-theme");
|
|
12158
|
+
const savedMode = localStorage.getItem("mvn-mode");
|
|
12159
|
+
if (savedTheme && savedTheme in THEMES) {
|
|
12160
|
+
setTheme(savedTheme);
|
|
12161
|
+
}
|
|
12162
|
+
if (savedMode) {
|
|
12163
|
+
setMode(savedMode);
|
|
12164
|
+
} else {
|
|
12165
|
+
setMode("system");
|
|
12166
|
+
}
|
|
12167
|
+
} catch {
|
|
12168
|
+
}
|
|
12169
|
+
}
|
|
12170
|
+
var ThemeContext = createContext(void 0);
|
|
12171
|
+
function ThemeProvider({
|
|
12172
|
+
children,
|
|
12173
|
+
defaultTheme = "default",
|
|
12174
|
+
defaultMode = "system",
|
|
12175
|
+
storageKey = "mvn-theme"
|
|
12176
|
+
}) {
|
|
12177
|
+
const [theme, setThemeState] = useState(defaultTheme);
|
|
12178
|
+
const [mode, setModeState] = useState(defaultMode);
|
|
12179
|
+
const [resolvedMode, setResolvedMode] = useState("light");
|
|
12180
|
+
useEffect(() => {
|
|
12181
|
+
try {
|
|
12182
|
+
const savedTheme = localStorage.getItem(storageKey);
|
|
12183
|
+
const savedMode = localStorage.getItem(`${storageKey}-mode`);
|
|
12184
|
+
if (savedTheme && savedTheme in THEMES) {
|
|
12185
|
+
setThemeState(savedTheme);
|
|
12186
|
+
}
|
|
12187
|
+
if (savedMode) {
|
|
12188
|
+
setModeState(savedMode);
|
|
12189
|
+
}
|
|
12190
|
+
} catch {
|
|
12191
|
+
}
|
|
12192
|
+
}, [storageKey]);
|
|
12193
|
+
useEffect(() => {
|
|
12194
|
+
const html = document.documentElement;
|
|
12195
|
+
for (const t of Object.keys(THEMES)) {
|
|
12196
|
+
if (t !== "default") {
|
|
12197
|
+
html.classList.remove(`theme-${t}`);
|
|
12198
|
+
}
|
|
12199
|
+
}
|
|
12200
|
+
if (theme !== "default") {
|
|
12201
|
+
html.classList.add(`theme-${theme}`);
|
|
12202
|
+
}
|
|
12203
|
+
try {
|
|
12204
|
+
localStorage.setItem(storageKey, theme);
|
|
12205
|
+
} catch {
|
|
12206
|
+
}
|
|
12207
|
+
}, [theme, storageKey]);
|
|
12208
|
+
useEffect(() => {
|
|
12209
|
+
const html = document.documentElement;
|
|
12210
|
+
const applyMode = (isDark) => {
|
|
12211
|
+
html.classList.toggle("dark", isDark);
|
|
12212
|
+
setResolvedMode(isDark ? "dark" : "light");
|
|
12213
|
+
};
|
|
12214
|
+
if (mode === "system") {
|
|
12215
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
12216
|
+
applyMode(mediaQuery.matches);
|
|
12217
|
+
const handler = (e) => applyMode(e.matches);
|
|
12218
|
+
mediaQuery.addEventListener("change", handler);
|
|
12219
|
+
return () => mediaQuery.removeEventListener("change", handler);
|
|
12220
|
+
} else {
|
|
12221
|
+
applyMode(mode === "dark");
|
|
12222
|
+
}
|
|
12223
|
+
try {
|
|
12224
|
+
localStorage.setItem(`${storageKey}-mode`, mode);
|
|
12225
|
+
} catch {
|
|
12226
|
+
}
|
|
12227
|
+
}, [mode, storageKey]);
|
|
12228
|
+
const value = {
|
|
12229
|
+
theme,
|
|
12230
|
+
mode,
|
|
12231
|
+
resolvedMode,
|
|
12232
|
+
setTheme: setThemeState,
|
|
12233
|
+
setMode: setModeState
|
|
12234
|
+
};
|
|
12235
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value, children });
|
|
12236
|
+
}
|
|
12237
|
+
function useTheme2() {
|
|
12238
|
+
const context = useContext(ThemeContext);
|
|
12239
|
+
if (!context) {
|
|
12240
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
12241
|
+
}
|
|
12242
|
+
return context;
|
|
12243
|
+
}
|
|
12244
|
+
|
|
12245
|
+
export { Accordion, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AreaChart, AspectRatio, Avatar, AvatarFallback, AvatarGroup, AvatarImage, BREAKPOINTS, Badge, BarChart, Blockquote, BottomNavigation, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHART_COLORS, CHART_PALETTE, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Collapsible, CollapsibleContent, CollapsibleItem, CollapsibleTrigger, Combobox, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DatePicker, DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DotsSpinner, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, Field, Form, FormItem, FormList, H1, H2, H3, H4, HoverCard, HoverCardContent, HoverCardTrigger, IconButton, InlineCode, Input, InputGroup, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item9 as Item, ItemGroup, ItemList, ItemSeparator, Label, Lead, LineChart, List3 as List, ListItem, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MobileHeader, MobileNavigationProvider, Muted, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, P, Pagination, PaginationContent, PaginationEllipsis, PaginationFirst, PaginationItem, PaginationLast, PaginationLink, PaginationNext, PaginationPrevious, PieChart, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ProductCard, ProfileCard, Progress, RadarChart, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScatterChart, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator5 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SimpleAvatar, SimpleCard, SimpleCarousel, SimpleTable, SimpleTabs, SimpleTooltip, Skeleton, SkeletonCard, Slider, Small, Spinner, Switch, THEMES, THEME_CATALOG, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, Toast, ToastProvider, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Typography, TypographyGroup, alertVariants, avatarVariants, badgeVariants, buttonVariants, cardVariants, checkboxVariants, cn, composeRules, emailRule, emptyVariants, fieldVariants, getCurrentMode, getCurrentTheme, getInitials, getThemeColors, initializeTheme, inputGroupVariants, inputVariants, itemVariants, labelVariants, legendStyle, maxLengthRule, maxValueRule, minLengthRule, minValueRule, navigationMenuTriggerStyle, numberRule, patternRule, progressVariants, radioGroupVariants, radioItemVariants, requiredRule, separatorVariants, setMode, setTheme, skeletonVariants, spinnerVariants, switchVariants, tableVariants, textareaVariants, toastVariants, toggleGroupVariants, toggleVariants, tooltipStyle, urlRule, useBreakpoint, useBreakpointValue, useCarousel, useForm, useIsDesktop, useIsMobile, useIsTablet, useMobileNav, useSidebar, useSwipeActions, useTheme2 as useTheme, useToast, useWatch };
|
|
10603
12246
|
//# sourceMappingURL=index.mjs.map
|
|
10604
12247
|
//# sourceMappingURL=index.mjs.map
|