"use client"; import * as React from "react"; import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer"; import { cn } from "cn"; type DrawerContextProps = { hasSnapPoints: boolean; modal: DrawerPrimitive.Root.Props["modal"]; showSwipeHandle: boolean; swipeDirection: NonNullable; }; const DrawerContext = React.createContext(null); function useDrawer() { const context = React.useContext(DrawerContext); if (!context) { throw new Error("useDrawer must be used within a Drawer."); } return context; } function Drawer({ modal = true, showSwipeHandle = false, snapPoints, swipeDirection = "down", ...props }: DrawerPrimitive.Root.Props & { showSwipeHandle?: boolean; }) { const hasSnapPoints = snapPoints != null && snapPoints.length > 0; const contextValue = React.useMemo( () => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }), [hasSnapPoints, modal, showSwipeHandle, swipeDirection] ); return ( ); } function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) { return ; } function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) { return ; } function DrawerClose({ ...props }: DrawerPrimitive.Close.Props) { return ; } function DrawerOverlay({ className, ...props }: DrawerPrimitive.Backdrop.Props) { return ( ); } function DrawerSwipeHandle({ className, ...props }: React.ComponentProps<"div">) { return (