import { ScrollArea as ScrollAreaPrimitive } from '@base-ui/react/scroll-area'; import * as React from 'react'; import { cn } from '@/lib/utils'; type ScrollAreaContentProps = React.ComponentProps< typeof ScrollAreaPrimitive.Content >; type ScrollAreaCornerProps = React.ComponentProps< typeof ScrollAreaPrimitive.Corner >; type ScrollAreaProps = Omit & { children?: React.ReactNode; contentClassName?: string; orientation?: 'both' | 'horizontal' | 'vertical'; viewportClassName?: string; }; type ScrollAreaRootProps = React.ComponentProps< typeof ScrollAreaPrimitive.Root >; type ScrollAreaScrollbarProps = React.ComponentProps< typeof ScrollAreaPrimitive.Scrollbar >; type ScrollAreaThumbProps = React.ComponentProps< typeof ScrollAreaPrimitive.Thumb >; type ScrollAreaViewportProps = React.ComponentProps< typeof ScrollAreaPrimitive.Viewport >; function ScrollAreaContent({ className, ...props }: ScrollAreaContentProps) { return ( ); } function ScrollAreaCorner({ className, ...props }: ScrollAreaCornerProps) { return ( ); } function ScrollAreaFacade({ children, contentClassName, orientation = 'vertical', viewportClassName, ...props }: ScrollAreaProps) { const hasHorizontalScrollbar = orientation === 'horizontal' || orientation === 'both'; const hasVerticalScrollbar = orientation === 'vertical' || orientation === 'both'; return ( {children} {hasVerticalScrollbar ? : null} {hasHorizontalScrollbar ? ( ) : null} {orientation === 'both' ? : null} ); } function ScrollAreaRoot({ className, ...props }: ScrollAreaRootProps) { return ( ); } function ScrollAreaScrollbar({ children, className, orientation = 'vertical', ...props }: ScrollAreaScrollbarProps) { return ( {children ?? } ); } function ScrollAreaThumb({ className, ...props }: ScrollAreaThumbProps) { return ( ); } function ScrollAreaViewport({ className, ...props }: ScrollAreaViewportProps) { return ( ); } const ScrollArea = Object.assign(ScrollAreaFacade, { Content: ScrollAreaContent, Corner: ScrollAreaCorner, Root: ScrollAreaRoot, Scrollbar: ScrollAreaScrollbar, Thumb: ScrollAreaThumb, Viewport: ScrollAreaViewport, }); export { ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, }; export type { ScrollAreaContentProps, ScrollAreaCornerProps, ScrollAreaProps, ScrollAreaRootProps, ScrollAreaScrollbarProps, ScrollAreaThumbProps, ScrollAreaViewportProps, };