@mvn-ui/react 0.1.2 → 0.1.3
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 +27 -7
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +16 -6
- package/dist/index.d.ts +16 -6
- package/dist/index.js +206 -110
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +206 -110
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -309,8 +309,14 @@ interface RadioGroupProps extends Omit<React$1.ComponentPropsWithoutRef<typeof R
|
|
|
309
309
|
declare const RadioGroup: React$1.ForwardRefExoticComponent<RadioGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
310
310
|
declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
311
311
|
|
|
312
|
-
type SwitchProps = React$1.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root
|
|
313
|
-
|
|
312
|
+
type SwitchProps = React$1.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> & {
|
|
313
|
+
offNode?: React$1.ReactNode;
|
|
314
|
+
onNode?: React$1.ReactNode;
|
|
315
|
+
};
|
|
316
|
+
declare const Switch: React$1.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
317
|
+
offNode?: React$1.ReactNode;
|
|
318
|
+
onNode?: React$1.ReactNode;
|
|
319
|
+
} & React$1.RefAttributes<HTMLButtonElement>>;
|
|
314
320
|
|
|
315
321
|
declare const toggleVariants: (props?: ({
|
|
316
322
|
variant?: "default" | "outline" | "solid" | null | undefined;
|
|
@@ -988,7 +994,11 @@ declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.D
|
|
|
988
994
|
declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
989
995
|
declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
990
996
|
declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
991
|
-
declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> &
|
|
997
|
+
declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
998
|
+
showClose?: boolean;
|
|
999
|
+
closeClassName?: string;
|
|
1000
|
+
customClose?: React$1.ReactNode;
|
|
1001
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
992
1002
|
declare const DialogHeader: {
|
|
993
1003
|
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
994
1004
|
displayName: string;
|
|
@@ -1073,8 +1083,8 @@ declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrim
|
|
|
1073
1083
|
interface SimpleTooltipProps {
|
|
1074
1084
|
children: React$1.ReactNode;
|
|
1075
1085
|
content: React$1.ReactNode;
|
|
1076
|
-
side?:
|
|
1077
|
-
align?:
|
|
1086
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
1087
|
+
align?: 'start' | 'center' | 'end';
|
|
1078
1088
|
delayDuration?: number;
|
|
1079
1089
|
className?: string;
|
|
1080
1090
|
}
|
|
@@ -1646,7 +1656,7 @@ declare const ResizableHandle: ({ withHandle, className, ...props }: React$1.Com
|
|
|
1646
1656
|
}) => react_jsx_runtime.JSX.Element;
|
|
1647
1657
|
|
|
1648
1658
|
interface ScrollAreaProps extends React$1.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> {
|
|
1649
|
-
orientation?:
|
|
1659
|
+
orientation?: 'vertical' | 'horizontal' | 'both';
|
|
1650
1660
|
scrollbarClassName?: string;
|
|
1651
1661
|
thumbClassName?: string;
|
|
1652
1662
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -309,8 +309,14 @@ interface RadioGroupProps extends Omit<React$1.ComponentPropsWithoutRef<typeof R
|
|
|
309
309
|
declare const RadioGroup: React$1.ForwardRefExoticComponent<RadioGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
310
310
|
declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
311
311
|
|
|
312
|
-
type SwitchProps = React$1.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root
|
|
313
|
-
|
|
312
|
+
type SwitchProps = React$1.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> & {
|
|
313
|
+
offNode?: React$1.ReactNode;
|
|
314
|
+
onNode?: React$1.ReactNode;
|
|
315
|
+
};
|
|
316
|
+
declare const Switch: React$1.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
317
|
+
offNode?: React$1.ReactNode;
|
|
318
|
+
onNode?: React$1.ReactNode;
|
|
319
|
+
} & React$1.RefAttributes<HTMLButtonElement>>;
|
|
314
320
|
|
|
315
321
|
declare const toggleVariants: (props?: ({
|
|
316
322
|
variant?: "default" | "outline" | "solid" | null | undefined;
|
|
@@ -988,7 +994,11 @@ declare const DialogTrigger: React$1.ForwardRefExoticComponent<DialogPrimitive.D
|
|
|
988
994
|
declare const DialogPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
|
|
989
995
|
declare const DialogClose: React$1.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
990
996
|
declare const DialogOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
991
|
-
declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> &
|
|
997
|
+
declare const DialogContent: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
998
|
+
showClose?: boolean;
|
|
999
|
+
closeClassName?: string;
|
|
1000
|
+
customClose?: React$1.ReactNode;
|
|
1001
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
992
1002
|
declare const DialogHeader: {
|
|
993
1003
|
({ className, ...props }: React$1.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
994
1004
|
displayName: string;
|
|
@@ -1073,8 +1083,8 @@ declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrim
|
|
|
1073
1083
|
interface SimpleTooltipProps {
|
|
1074
1084
|
children: React$1.ReactNode;
|
|
1075
1085
|
content: React$1.ReactNode;
|
|
1076
|
-
side?:
|
|
1077
|
-
align?:
|
|
1086
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
1087
|
+
align?: 'start' | 'center' | 'end';
|
|
1078
1088
|
delayDuration?: number;
|
|
1079
1089
|
className?: string;
|
|
1080
1090
|
}
|
|
@@ -1646,7 +1656,7 @@ declare const ResizableHandle: ({ withHandle, className, ...props }: React$1.Com
|
|
|
1646
1656
|
}) => react_jsx_runtime.JSX.Element;
|
|
1647
1657
|
|
|
1648
1658
|
interface ScrollAreaProps extends React$1.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> {
|
|
1649
|
-
orientation?:
|
|
1659
|
+
orientation?: 'vertical' | 'horizontal' | 'both';
|
|
1650
1660
|
scrollbarClassName?: string;
|
|
1651
1661
|
thumbClassName?: string;
|
|
1652
1662
|
}
|
package/dist/index.js
CHANGED
|
@@ -489,10 +489,10 @@ function ButtonGroup({
|
|
|
489
489
|
"data-orientation": orientation,
|
|
490
490
|
className: cn(
|
|
491
491
|
"inline-flex",
|
|
492
|
+
className,
|
|
492
493
|
isVertical ? "flex-col" : "flex-row",
|
|
493
494
|
// Join children and normalize border radius so the group looks contiguous
|
|
494
|
-
isVertical ? "[&>*]:rounded-none [&>*]:-mt-px [&>:first-child]:mt-0 [&>:first-child]:rounded-t-md [&>:last-child]:rounded-b-md" : "[&>*]:rounded-none [&>*]:-ml-px [&>:first-child]:ml-0 [&>:first-child]:rounded-l-md [&>:last-child]:rounded-r-md"
|
|
495
|
-
className
|
|
495
|
+
isVertical ? "[&>*]:rounded-none [&>*]:-mt-px [&>:first-child]:mt-0 [&>:first-child]:rounded-t-md [&>:last-child]:rounded-b-md" : "[&>*]:rounded-none [&>*]:-ml-px [&>:first-child]:ml-0 [&>:first-child]:rounded-l-md [&>:last-child]:rounded-r-md"
|
|
496
496
|
),
|
|
497
497
|
...props
|
|
498
498
|
}
|
|
@@ -603,8 +603,8 @@ var Input = React49__namespace.forwardRef(
|
|
|
603
603
|
children: label
|
|
604
604
|
}
|
|
605
605
|
),
|
|
606
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
607
|
-
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-3
|
|
606
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center", children: [
|
|
607
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-3 text-muted-foreground pointer-events-none flex items-center justify-center [&_svg]:size-4", children: leftIcon }),
|
|
608
608
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
609
609
|
"input",
|
|
610
610
|
{
|
|
@@ -629,7 +629,7 @@ var Input = React49__namespace.forwardRef(
|
|
|
629
629
|
...props
|
|
630
630
|
}
|
|
631
631
|
),
|
|
632
|
-
(showClearButton || showPasswordToggle || rightIcon) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute right-3
|
|
632
|
+
(showClearButton || showPasswordToggle || rightIcon) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute right-3 flex items-center gap-1", children: [
|
|
633
633
|
showClearButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
634
634
|
"button",
|
|
635
635
|
{
|
|
@@ -650,7 +650,7 @@ var Input = React49__namespace.forwardRef(
|
|
|
650
650
|
children: showPassword ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeOffIcon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EyeIcon, { className: "h-4 w-4" })
|
|
651
651
|
}
|
|
652
652
|
),
|
|
653
|
-
rightIcon && !showPasswordToggle && !showClearButton && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground [&_svg]:size-4", children: rightIcon })
|
|
653
|
+
rightIcon && !showPasswordToggle && !showClearButton && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground flex items-center justify-center [&_svg]:size-4", children: rightIcon })
|
|
654
654
|
] })
|
|
655
655
|
] }),
|
|
656
656
|
error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1146,7 +1146,7 @@ RadioGroupItem.displayName = RadioGroupPrimitive__namespace.Item.displayName;
|
|
|
1146
1146
|
|
|
1147
1147
|
// src/components/ui/switch/index.tsx
|
|
1148
1148
|
init_utils();
|
|
1149
|
-
var Switch = React49__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
1149
|
+
var Switch = React49__namespace.forwardRef(({ className, offNode, onNode, ...props }, ref) => {
|
|
1150
1150
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1151
1151
|
SwitchPrimitives__namespace.Root,
|
|
1152
1152
|
{
|
|
@@ -1159,13 +1159,17 @@ var Switch = React49__namespace.forwardRef(({ className, ...props }, ref) => {
|
|
|
1159
1159
|
className
|
|
1160
1160
|
),
|
|
1161
1161
|
...props,
|
|
1162
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
1162
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1163
1163
|
SwitchPrimitives__namespace.Thumb,
|
|
1164
1164
|
{
|
|
1165
1165
|
className: cn(
|
|
1166
|
-
"pointer-events-none
|
|
1166
|
+
"group pointer-events-none relative flex items-center justify-center h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
1167
1167
|
"data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
1168
|
-
)
|
|
1168
|
+
),
|
|
1169
|
+
children: [
|
|
1170
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute opacity-0 group-data-[state=checked]:opacity-100 transition-all duration-200", children: onNode }),
|
|
1171
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute opacity-100 group-data-[state=checked]:opacity-0 transition-all duration-200", children: offNode })
|
|
1172
|
+
]
|
|
1169
1173
|
}
|
|
1170
1174
|
)
|
|
1171
1175
|
}
|
|
@@ -2971,27 +2975,45 @@ var DialogOverlay = React49__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
2971
2975
|
}
|
|
2972
2976
|
));
|
|
2973
2977
|
DialogOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
|
|
2974
|
-
var DialogContent = React49__namespace.forwardRef(
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2978
|
+
var DialogContent = React49__namespace.forwardRef(
|
|
2979
|
+
({
|
|
2980
|
+
className,
|
|
2981
|
+
children,
|
|
2982
|
+
showClose = true,
|
|
2983
|
+
closeClassName,
|
|
2984
|
+
customClose,
|
|
2985
|
+
...props
|
|
2986
|
+
}, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
|
|
2987
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
|
|
2988
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2989
|
+
DialogPrimitive__namespace.Content,
|
|
2990
|
+
{
|
|
2991
|
+
ref,
|
|
2992
|
+
className: cn(
|
|
2993
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-mvn-gray-200 bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",
|
|
2994
|
+
className
|
|
2995
|
+
),
|
|
2996
|
+
...props,
|
|
2997
|
+
children: [
|
|
2998
|
+
children,
|
|
2999
|
+
showClose && (customClose ? customClose : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3000
|
+
DialogPrimitive__namespace.Close,
|
|
3001
|
+
{
|
|
3002
|
+
className: cn(
|
|
3003
|
+
"absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-mvn-gray-100",
|
|
3004
|
+
closeClassName
|
|
3005
|
+
),
|
|
3006
|
+
children: [
|
|
3007
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-5 w-5" }),
|
|
3008
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
|
|
3009
|
+
]
|
|
3010
|
+
}
|
|
3011
|
+
))
|
|
3012
|
+
]
|
|
3013
|
+
}
|
|
3014
|
+
)
|
|
3015
|
+
] })
|
|
3016
|
+
);
|
|
2995
3017
|
DialogContent.displayName = DialogPrimitive__namespace.Content.displayName;
|
|
2996
3018
|
var DialogHeader = ({
|
|
2997
3019
|
className,
|
|
@@ -2999,10 +3021,7 @@ var DialogHeader = ({
|
|
|
2999
3021
|
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3000
3022
|
"div",
|
|
3001
3023
|
{
|
|
3002
|
-
className: cn(
|
|
3003
|
-
"flex flex-col space-y-1.5 text-left",
|
|
3004
|
-
className
|
|
3005
|
-
),
|
|
3024
|
+
className: cn("flex flex-col space-y-1.5 text-left", className),
|
|
3006
3025
|
...props
|
|
3007
3026
|
}
|
|
3008
3027
|
);
|
|
@@ -3362,7 +3381,9 @@ var TooltipContent = React49__namespace.forwardRef(({ className, sideOffset = 4,
|
|
|
3362
3381
|
ref,
|
|
3363
3382
|
sideOffset,
|
|
3364
3383
|
className: cn(
|
|
3365
|
-
"z-50 overflow-hidden rounded-md bg-mvn-gray-900 px-3 py-1.5 text-xs text-
|
|
3384
|
+
"z-50 overflow-hidden rounded-md bg-mvn-gray-900 px-3 py-1.5 text-xs text-primary-50 dark:bg-primary-50 dark:text-mvn-gray-900 animate-in fade-in-0 zoom-in-95",
|
|
3385
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
3386
|
+
"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",
|
|
3366
3387
|
className
|
|
3367
3388
|
),
|
|
3368
3389
|
...props
|
|
@@ -4375,7 +4396,7 @@ var TabsList = React49__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
4375
4396
|
ref,
|
|
4376
4397
|
className: cn(
|
|
4377
4398
|
"flex items-stretch gap-0 text-muted-foreground",
|
|
4378
|
-
"data-[orientation=horizontal]:w-full
|
|
4399
|
+
"data-[orientation=horizontal]:w-full",
|
|
4379
4400
|
"data-[orientation=vertical]:w-56 data-[orientation=vertical]:border-r data-[orientation=vertical]:border-border",
|
|
4380
4401
|
"data-[orientation=vertical]:flex-col data-[orientation=vertical]:shrink-0",
|
|
4381
4402
|
className
|
|
@@ -4392,9 +4413,9 @@ var TabsTrigger = React49__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
4392
4413
|
"inline-flex min-w-0 items-center justify-center whitespace-nowrap text-sm font-medium",
|
|
4393
4414
|
"transition-all duration-150 text-muted-foreground hover:text-primary",
|
|
4394
4415
|
"ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
4395
|
-
"data-[orientation=horizontal]:
|
|
4416
|
+
"data-[orientation=horizontal]:px-4 data-[orientation=horizontal]:py-3 data-[orientation=horizontal]:border-b-2 data-[orientation=horizontal]:border-transparent",
|
|
4396
4417
|
"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",
|
|
4397
|
-
"data-[state=active]:text-primary data-[state=active]:font-semibold data-[state=active]:
|
|
4418
|
+
"data-[state=active]:text-primary data-[state=active]:font-semibold data-[state=active]:border-primary",
|
|
4398
4419
|
"disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",
|
|
4399
4420
|
className
|
|
4400
4421
|
),
|
|
@@ -4703,6 +4724,7 @@ var ScrollArea = React49__namespace.forwardRef(
|
|
|
4703
4724
|
orientation = "vertical",
|
|
4704
4725
|
scrollbarClassName,
|
|
4705
4726
|
thumbClassName,
|
|
4727
|
+
type = "auto",
|
|
4706
4728
|
...props
|
|
4707
4729
|
}, ref) => {
|
|
4708
4730
|
const showVertical = orientation === "vertical" || orientation === "both";
|
|
@@ -4711,12 +4733,38 @@ var ScrollArea = React49__namespace.forwardRef(
|
|
|
4711
4733
|
ScrollAreaPrimitive__namespace.Root,
|
|
4712
4734
|
{
|
|
4713
4735
|
ref,
|
|
4736
|
+
type,
|
|
4714
4737
|
className: cn("relative overflow-hidden", className),
|
|
4715
4738
|
...props,
|
|
4716
4739
|
children: [
|
|
4717
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4718
|
-
|
|
4719
|
-
|
|
4740
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4741
|
+
ScrollAreaPrimitive__namespace.Viewport,
|
|
4742
|
+
{
|
|
4743
|
+
className: cn(
|
|
4744
|
+
"h-full w-full rounded-[inherit]",
|
|
4745
|
+
// Fix overflow based on orientation to prevent unwanted scrolling
|
|
4746
|
+
orientation === "vertical" && "!overflow-x-hidden",
|
|
4747
|
+
orientation === "horizontal" && "!overflow-y-hidden"
|
|
4748
|
+
),
|
|
4749
|
+
children
|
|
4750
|
+
}
|
|
4751
|
+
),
|
|
4752
|
+
showVertical && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4753
|
+
ScrollBar,
|
|
4754
|
+
{
|
|
4755
|
+
orientation: "vertical",
|
|
4756
|
+
className: scrollbarClassName,
|
|
4757
|
+
thumbClassName
|
|
4758
|
+
}
|
|
4759
|
+
),
|
|
4760
|
+
showHorizontal && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4761
|
+
ScrollBar,
|
|
4762
|
+
{
|
|
4763
|
+
orientation: "horizontal",
|
|
4764
|
+
className: scrollbarClassName,
|
|
4765
|
+
thumbClassName
|
|
4766
|
+
}
|
|
4767
|
+
),
|
|
4720
4768
|
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaPrimitive__namespace.Corner, {})
|
|
4721
4769
|
]
|
|
4722
4770
|
}
|
|
@@ -4740,7 +4788,7 @@ var ScrollBar = React49__namespace.forwardRef(({ className, orientation = "verti
|
|
|
4740
4788
|
ScrollAreaPrimitive__namespace.ScrollAreaThumb,
|
|
4741
4789
|
{
|
|
4742
4790
|
className: cn(
|
|
4743
|
-
"relative flex-1 rounded-full bg-
|
|
4791
|
+
"relative flex-1 rounded-full bg-muted-foreground/50 hover:bg-muted-foreground transition-colors",
|
|
4744
4792
|
thumbClassName
|
|
4745
4793
|
)
|
|
4746
4794
|
}
|
|
@@ -5386,20 +5434,14 @@ var tableVariants = classVarianceAuthority.cva("w-full caption-bottom text-sm",
|
|
|
5386
5434
|
size: "default"
|
|
5387
5435
|
}
|
|
5388
5436
|
});
|
|
5389
|
-
var Table = React49__namespace.forwardRef(({ className, variant, size, wrapperClassName, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5390
|
-
"
|
|
5437
|
+
var Table = React49__namespace.forwardRef(({ className, variant, size, wrapperClassName, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative w-full overflow-auto", wrapperClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5438
|
+
"table",
|
|
5391
5439
|
{
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
{
|
|
5396
|
-
ref,
|
|
5397
|
-
className: cn(tableVariants({ variant, size, className })),
|
|
5398
|
-
...props
|
|
5399
|
-
}
|
|
5400
|
-
)
|
|
5440
|
+
ref,
|
|
5441
|
+
className: cn(tableVariants({ variant, size, className })),
|
|
5442
|
+
...props
|
|
5401
5443
|
}
|
|
5402
|
-
));
|
|
5444
|
+
) }));
|
|
5403
5445
|
Table.displayName = "Table";
|
|
5404
5446
|
var TableHeader = React49__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
5405
5447
|
TableHeader.displayName = "TableHeader";
|
|
@@ -6458,6 +6500,8 @@ function useTableVirtualization({
|
|
|
6458
6500
|
});
|
|
6459
6501
|
return arr;
|
|
6460
6502
|
}, [rows, expandable]);
|
|
6503
|
+
const virtualRowPointersRef = React49.useRef(virtualRowPointers);
|
|
6504
|
+
virtualRowPointersRef.current = virtualRowPointers;
|
|
6461
6505
|
const cacheBackingRef = React49.useRef(
|
|
6462
6506
|
/* @__PURE__ */ new Map()
|
|
6463
6507
|
);
|
|
@@ -6491,6 +6535,12 @@ function useTableVirtualization({
|
|
|
6491
6535
|
null
|
|
6492
6536
|
);
|
|
6493
6537
|
const measurementIdleRef = React49.useRef(null);
|
|
6538
|
+
const prefixSumCacheRef = React49.useRef({
|
|
6539
|
+
count: 0,
|
|
6540
|
+
itemSizes: [],
|
|
6541
|
+
offsets: [],
|
|
6542
|
+
totalSize: 0
|
|
6543
|
+
});
|
|
6494
6544
|
const cleanupRaf = React49.useCallback(() => {
|
|
6495
6545
|
if (debounceTimeoutRef.current != null) {
|
|
6496
6546
|
clearTimeout(debounceTimeoutRef.current);
|
|
@@ -6515,10 +6565,16 @@ function useTableVirtualization({
|
|
|
6515
6565
|
measurementIdleRef.current = null;
|
|
6516
6566
|
}
|
|
6517
6567
|
measurementQueueRef.current.clear();
|
|
6568
|
+
prefixSumCacheRef.current = {
|
|
6569
|
+
count: 0,
|
|
6570
|
+
itemSizes: [],
|
|
6571
|
+
offsets: [],
|
|
6572
|
+
totalSize: 0
|
|
6573
|
+
};
|
|
6518
6574
|
}, []);
|
|
6519
6575
|
const estimateSize = React49.useCallback(
|
|
6520
6576
|
(index) => {
|
|
6521
|
-
const item =
|
|
6577
|
+
const item = virtualRowPointersRef.current[index];
|
|
6522
6578
|
if (!item) return baseRowEstimateSize;
|
|
6523
6579
|
const key = item.key;
|
|
6524
6580
|
if (item.kind === "expanded" && !rows[item.rowIndex]?.getIsExpanded()) {
|
|
@@ -6531,21 +6587,23 @@ function useTableVirtualization({
|
|
|
6531
6587
|
if (cached != null) return cached;
|
|
6532
6588
|
return item.kind === "expanded" ? expandContentEstimateSize : baseRowEstimateSize;
|
|
6533
6589
|
},
|
|
6534
|
-
[
|
|
6590
|
+
[baseRowEstimateSize, expandContentEstimateSize]
|
|
6535
6591
|
);
|
|
6536
6592
|
const recomputeVirtualWindow = React49.useCallback(() => {
|
|
6537
6593
|
if (!shouldVirtualize) {
|
|
6538
6594
|
setVirtualWindow(EMPTY_WINDOW);
|
|
6539
6595
|
return;
|
|
6540
6596
|
}
|
|
6597
|
+
const pointers = virtualRowPointersRef.current;
|
|
6541
6598
|
const nextWindow = computeVirtualizedRows({
|
|
6542
|
-
count:
|
|
6599
|
+
count: pointers.length,
|
|
6543
6600
|
getScrollElement: () => tableContainerRef.current,
|
|
6544
6601
|
estimateSize,
|
|
6545
6602
|
overScan,
|
|
6546
6603
|
cache: cacheRef.current,
|
|
6547
6604
|
heightCacheByKey: heightCacheByKeyRef.current,
|
|
6548
|
-
getItemKey: (index) =>
|
|
6605
|
+
getItemKey: (index) => pointers[index]?.key ?? "",
|
|
6606
|
+
prefixSumCache: prefixSumCacheRef.current
|
|
6549
6607
|
});
|
|
6550
6608
|
setVirtualWindow(nextWindow);
|
|
6551
6609
|
}, [estimateSize, overScan]);
|
|
@@ -6578,7 +6636,7 @@ function useTableVirtualization({
|
|
|
6578
6636
|
const { startIndex, endIndex } = virtualWindowRef.current;
|
|
6579
6637
|
if (index < startIndex || index > endIndex) return;
|
|
6580
6638
|
}
|
|
6581
|
-
const item =
|
|
6639
|
+
const item = virtualRowPointersRef.current[index];
|
|
6582
6640
|
if (!item) return;
|
|
6583
6641
|
if (!Number.isFinite(height)) return;
|
|
6584
6642
|
const size = normalizeVirtualSize(height);
|
|
@@ -6632,7 +6690,7 @@ function useTableVirtualization({
|
|
|
6632
6690
|
const { startIndex, endIndex } = virtualWindowRef.current;
|
|
6633
6691
|
if (index < startIndex || index > endIndex) return;
|
|
6634
6692
|
}
|
|
6635
|
-
const item =
|
|
6693
|
+
const item = virtualRowPointersRef.current[index];
|
|
6636
6694
|
const key = item?.key;
|
|
6637
6695
|
if (key != null && heightCacheByKeyRef.current.has(key) || heightCacheByIndexRef.current.has(index)) {
|
|
6638
6696
|
return;
|
|
@@ -6652,7 +6710,7 @@ function useTableVirtualization({
|
|
|
6652
6710
|
return;
|
|
6653
6711
|
}
|
|
6654
6712
|
cacheRef.current.forEach((index, _, key) => {
|
|
6655
|
-
if (index >=
|
|
6713
|
+
if (index >= virtualRowPointersRef.current.length) {
|
|
6656
6714
|
cacheRef.current.remove(index);
|
|
6657
6715
|
heightCacheByIndexRef.current.delete(index);
|
|
6658
6716
|
if (key != null) heightCacheByKeyRef.current.delete(key);
|
|
@@ -6742,7 +6800,8 @@ var computeVirtualizedRows = (config) => {
|
|
|
6742
6800
|
cache,
|
|
6743
6801
|
getItemKey,
|
|
6744
6802
|
getHorizontalScrollElement,
|
|
6745
|
-
heightCacheByKey
|
|
6803
|
+
heightCacheByKey,
|
|
6804
|
+
prefixSumCache
|
|
6746
6805
|
} = config;
|
|
6747
6806
|
if (count <= 0) return EMPTY_WINDOW;
|
|
6748
6807
|
const scrollElement = getScrollElement() ?? null;
|
|
@@ -6756,24 +6815,60 @@ var computeVirtualizedRows = (config) => {
|
|
|
6756
6815
|
Math.max(rawHorizontalScrollOffset, 0),
|
|
6757
6816
|
horizontalTotalSize - horizontalViewportSize
|
|
6758
6817
|
) : Math.max(rawHorizontalScrollOffset, 0);
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
let totalSize
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6818
|
+
let itemSizes;
|
|
6819
|
+
let offsets;
|
|
6820
|
+
let totalSize;
|
|
6821
|
+
const cachedCount = prefixSumCache?.count ?? 0;
|
|
6822
|
+
if (prefixSumCache && cachedCount > 0 && count >= cachedCount) {
|
|
6823
|
+
itemSizes = prefixSumCache.itemSizes.slice(0, cachedCount);
|
|
6824
|
+
offsets = prefixSumCache.offsets.slice(0, cachedCount);
|
|
6825
|
+
totalSize = prefixSumCache.totalSize;
|
|
6826
|
+
if (count > cachedCount) {
|
|
6827
|
+
itemSizes.length = count;
|
|
6828
|
+
offsets.length = count;
|
|
6829
|
+
for (let index = cachedCount; index < count; index++) {
|
|
6830
|
+
offsets[index] = totalSize;
|
|
6831
|
+
const key = getItemKey(index);
|
|
6832
|
+
let size = cache.get(index);
|
|
6833
|
+
if (size == null && key != null) {
|
|
6834
|
+
size = heightCacheByKey.get(key);
|
|
6835
|
+
}
|
|
6836
|
+
if (size == null) {
|
|
6837
|
+
const estimate = estimateSize(index);
|
|
6838
|
+
size = normalizeVirtualSize(estimate);
|
|
6839
|
+
} else {
|
|
6840
|
+
size = normalizeVirtualSize(size);
|
|
6841
|
+
}
|
|
6842
|
+
itemSizes[index] = size;
|
|
6843
|
+
totalSize += size;
|
|
6844
|
+
}
|
|
6845
|
+
}
|
|
6846
|
+
} else {
|
|
6847
|
+
itemSizes = new Array(count);
|
|
6848
|
+
offsets = new Array(count);
|
|
6849
|
+
totalSize = 0;
|
|
6850
|
+
for (let index = 0; index < count; index++) {
|
|
6851
|
+
offsets[index] = totalSize;
|
|
6852
|
+
const key = getItemKey(index);
|
|
6853
|
+
let size = cache.get(index);
|
|
6854
|
+
if (size == null && key != null) {
|
|
6855
|
+
size = heightCacheByKey.get(key);
|
|
6856
|
+
}
|
|
6857
|
+
if (size == null) {
|
|
6858
|
+
const estimate = estimateSize(index);
|
|
6859
|
+
size = normalizeVirtualSize(estimate);
|
|
6860
|
+
} else {
|
|
6861
|
+
size = normalizeVirtualSize(size);
|
|
6862
|
+
}
|
|
6863
|
+
itemSizes[index] = size;
|
|
6864
|
+
totalSize += size;
|
|
6774
6865
|
}
|
|
6775
|
-
|
|
6776
|
-
|
|
6866
|
+
}
|
|
6867
|
+
if (prefixSumCache) {
|
|
6868
|
+
prefixSumCache.count = count;
|
|
6869
|
+
prefixSumCache.itemSizes = itemSizes;
|
|
6870
|
+
prefixSumCache.offsets = offsets;
|
|
6871
|
+
prefixSumCache.totalSize = totalSize;
|
|
6777
6872
|
}
|
|
6778
6873
|
const viewportActive = clientHeight > 0;
|
|
6779
6874
|
const scrollOffset = viewportActive ? Math.min(scrollTop, Math.max(totalSize - clientHeight, 0)) : 0;
|
|
@@ -6781,19 +6876,28 @@ var computeVirtualizedRows = (config) => {
|
|
|
6781
6876
|
let visibleStartIndex = 0;
|
|
6782
6877
|
let visibleEndIndex = 0;
|
|
6783
6878
|
if (viewportActive && totalSize > 0) {
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6879
|
+
let low = 0;
|
|
6880
|
+
let high = count - 1;
|
|
6881
|
+
while (low < high) {
|
|
6882
|
+
const mid = Math.floor((low + high) / 2);
|
|
6883
|
+
if (offsets[mid] + itemSizes[mid] > scrollOffset) {
|
|
6884
|
+
high = mid;
|
|
6885
|
+
} else {
|
|
6886
|
+
low = mid + 1;
|
|
6788
6887
|
}
|
|
6789
6888
|
}
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6889
|
+
visibleStartIndex = low;
|
|
6890
|
+
low = visibleStartIndex;
|
|
6891
|
+
high = count - 1;
|
|
6892
|
+
while (low < high) {
|
|
6893
|
+
const mid = Math.ceil((low + high) / 2);
|
|
6894
|
+
if (offsets[mid] >= viewportLimit) {
|
|
6895
|
+
high = mid - 1;
|
|
6896
|
+
} else {
|
|
6897
|
+
low = mid;
|
|
6794
6898
|
}
|
|
6795
|
-
visibleEndIndex = index;
|
|
6796
6899
|
}
|
|
6900
|
+
visibleEndIndex = Math.max(visibleStartIndex, low);
|
|
6797
6901
|
}
|
|
6798
6902
|
const overScanCount = Math.max(0, Math.ceil(overScan));
|
|
6799
6903
|
const startIndex = Math.max(0, visibleStartIndex - overScanCount);
|
|
@@ -6855,7 +6959,7 @@ function SimpleTable({
|
|
|
6855
6959
|
getRowExpandable,
|
|
6856
6960
|
onExpandedChange,
|
|
6857
6961
|
onLazyScrollLoad,
|
|
6858
|
-
scrollLoadThreshold =
|
|
6962
|
+
scrollLoadThreshold = 42,
|
|
6859
6963
|
numberOfPageButtons = 5,
|
|
6860
6964
|
onClickExport,
|
|
6861
6965
|
baseRowEstimateSize = 42,
|
|
@@ -6940,6 +7044,10 @@ function SimpleTable({
|
|
|
6940
7044
|
if (typeof maxRecords === "number" && data.length >= maxRecords) return;
|
|
6941
7045
|
void handleLazyLoad();
|
|
6942
7046
|
}, [recordPerChunk, data.length, handleLazyLoad, chunkCount, maxRecords]);
|
|
7047
|
+
const onLoadChunkRef = React49.useRef(onLoadChunk);
|
|
7048
|
+
React49.useEffect(() => {
|
|
7049
|
+
onLoadChunkRef.current = onLoadChunk;
|
|
7050
|
+
}, [onLoadChunk]);
|
|
6943
7051
|
const rows = React49.useMemo(
|
|
6944
7052
|
() => table.getRowModel().rows,
|
|
6945
7053
|
[paginationState, sorting, columnFilters]
|
|
@@ -6981,7 +7089,7 @@ function SimpleTable({
|
|
|
6981
7089
|
rafRef.current = null;
|
|
6982
7090
|
const { scrollTop, scrollHeight, clientHeight } = container;
|
|
6983
7091
|
if (scrollHeight - (scrollTop + clientHeight) <= scrollLoadThreshold && scrollTop !== 0 && scrollHeight > clientHeight) {
|
|
6984
|
-
|
|
7092
|
+
onLoadChunkRef.current();
|
|
6985
7093
|
}
|
|
6986
7094
|
});
|
|
6987
7095
|
};
|
|
@@ -6994,7 +7102,7 @@ function SimpleTable({
|
|
|
6994
7102
|
rafRef.current = null;
|
|
6995
7103
|
}
|
|
6996
7104
|
};
|
|
6997
|
-
}, [scrollLoadThreshold,
|
|
7105
|
+
}, [scrollLoadThreshold, virtualizationActive]);
|
|
6998
7106
|
React49.useEffect(() => {
|
|
6999
7107
|
if (virtualizationActive) return;
|
|
7000
7108
|
if (table.getState().pagination.pageIndex === 0) {
|
|
@@ -7003,23 +7111,10 @@ function SimpleTable({
|
|
|
7003
7111
|
}, [virtualizationActive]);
|
|
7004
7112
|
React49.useEffect(() => {
|
|
7005
7113
|
if (!virtualItems.length || !virtualizationActive) return;
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
if (paddingBottom <= scrollLoadThreshold) {
|
|
7011
|
-
onLoadChunk();
|
|
7012
|
-
}
|
|
7013
|
-
});
|
|
7014
|
-
};
|
|
7015
|
-
scheduleCheck();
|
|
7016
|
-
return () => {
|
|
7017
|
-
if (rafRef.current != null) {
|
|
7018
|
-
cancelAnimationFrame(rafRef.current);
|
|
7019
|
-
rafRef.current = null;
|
|
7020
|
-
}
|
|
7021
|
-
};
|
|
7022
|
-
}, [paddingBottom]);
|
|
7114
|
+
if (paddingBottom <= scrollLoadThreshold) {
|
|
7115
|
+
onLoadChunkRef.current();
|
|
7116
|
+
}
|
|
7117
|
+
}, [paddingBottom, scrollLoadThreshold, virtualizationActive]);
|
|
7023
7118
|
const columnCount = table.getAllLeafColumns().length;
|
|
7024
7119
|
React49.useEffect(() => {
|
|
7025
7120
|
if (!selectable || !onSelectionChange) return;
|
|
@@ -10374,8 +10469,9 @@ function SimpleCarousel({
|
|
|
10374
10469
|
}
|
|
10375
10470
|
),
|
|
10376
10471
|
showDots && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center space-x-2 mt-4", children: Array.from({ length: count }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10377
|
-
|
|
10472
|
+
Button,
|
|
10378
10473
|
{
|
|
10474
|
+
variant: "ghost",
|
|
10379
10475
|
className: cn(
|
|
10380
10476
|
"h-2 w-2 rounded-full transition-colors",
|
|
10381
10477
|
current === index + 1 ? "bg-primary" : "bg-primary/20 hover:bg-primary/40"
|