import * as React from "react" import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area" import { cn } from "@/lib/utils" const ScrollArea = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { viewportRef?: React.Ref; // Opt in when the viewport wraps content that manages its own horizontal // overflow (e.g., a child `overflow-x-auto` table). Overrides Radix's // default `display: table` wrapper so the child can be constrained to the // viewport width and trigger its own scroll. Also renders a horizontal // ScrollBar for viewports that overflow directly. block?: boolean; } >(({ className, children, viewportRef, block, ...props }, ref) => ( div]:!block [&>div]:!min-w-0" )} > {children} {block && } )) ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName // Thumb uses a translucent foreground alpha so it harmonizes with glass // overlays (dropdowns, popovers, dialogs) instead of competing with content. const ScrollBar = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, orientation = "vertical", ...props }, ref) => ( )) ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName export { ScrollArea, ScrollBar }