import * as React from "react"; import * as DialogPrimitive from "@radix-ui/react-dialog"; import { X } from "lucide-react"; import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "@/lib/utils"; const Sheet = DialogPrimitive.Root; const SheetTrigger = DialogPrimitive.Trigger; const SheetClose = DialogPrimitive.Close; const SheetPortal = DialogPrimitive.Portal; const SheetOverlay = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); SheetOverlay.displayName = DialogPrimitive.Overlay.displayName; const sheetVariants = cva( "fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out", { variants: { side: { top: cn( "inset-x-0 top-0 border-b", "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top", ), bottom: cn( "inset-x-0 bottom-0 border-t", "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom", ), left: cn( "inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left", ), right: cn( "inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right", ), }, }, defaultVariants: { side: "right", }, }, ); interface SheetContentProps extends React.ComponentPropsWithoutRef, VariantProps { showCloseButton?: boolean; } const SheetContent = React.forwardRef< React.ElementRef, SheetContentProps >(({ side = "right", className, children, showCloseButton = true, ...props }, ref) => ( {children} {showCloseButton ? ( Close ) : null} )); SheetContent.displayName = DialogPrimitive.Content.displayName; const SheetHeader = ({ className, ...props }: React.HTMLAttributes) => (
); SheetHeader.displayName = "SheetHeader"; const SheetTitle = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); SheetTitle.displayName = DialogPrimitive.Title.displayName; export { Sheet, SheetTrigger, SheetClose, SheetPortal, SheetOverlay, SheetContent, SheetHeader, SheetTitle };