'use client' import * as React from 'react' import { Drawer as DrawerPrimitive } from 'vaul' import { cn } from '@/lib/utils' import { glassCvaConfig } from '@/recipes/glass-cva' import { type VariantProps, cva } from 'class-variance-authority' const twStyles = { content: ['fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px]'], overlay: 'fixed inset-0 z-50 bg-black/80', handle: 'mx-auto mt-4 h-2 w-[100px] rounded-full bg-gray-100 dark:bg-gray-800', header: 'grid gap-1.5 p-4 text-center sm:text-left', footer: 'mt-auto flex flex-col gap-2 p-4', title: 'text-lg font-semibold leading-none tracking-tight', description: 'text-sm text-neutral-500 dark:text-neutral-400', } const Drawer = ({ shouldScaleBackground = true, ...props }: React.ComponentProps) => ( ) Drawer.displayName = 'Drawer' const DrawerTrigger = DrawerPrimitive.Trigger const DrawerPortal = DrawerPrimitive.Portal const DrawerClose = DrawerPrimitive.Close const DrawerOverlay = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )) DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName const drawerContentVariants = cva(cn(twStyles.content), glassCvaConfig) interface DrawerContentProps extends React.ComponentPropsWithoutRef, VariantProps {} const DrawerContent = React.forwardRef, DrawerContentProps>( ({ className, children, variant, blur, ...props }, ref) => (
{children} ), ) DrawerContent.displayName = 'DrawerContent' const DrawerHeader = ({ className, ...props }: React.HTMLAttributes) => (
) DrawerHeader.displayName = 'DrawerHeader' const DrawerFooter = ({ className, ...props }: React.HTMLAttributes) => (
) DrawerFooter.displayName = 'DrawerFooter' const DrawerTitle = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )) DrawerTitle.displayName = DrawerPrimitive.Title.displayName const DrawerDescription = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )) DrawerDescription.displayName = DrawerPrimitive.Description.displayName export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, }