"use client"; import * as React from "react"; import { Drawer as DrawerPrimitive } from "vaul"; import { cn } from "@/lib/utils"; import { resolvePhysicalSide } from "@/lib/direction"; import { useDir } from "../../contexts/DirectionContext"; // vaul's DialogProps is an intersection with a discriminated union // (WithFadeFromProps | WithoutFadeFromProps); a plain Omit collapses it and // breaks the snapPoints/fadeFromIndex correlation, so distribute the Omit. type DistributiveOmit = T extends unknown ? Omit : never; function Drawer({ direction, ...props }: DistributiveOmit, "direction"> & { direction?: "top" | "bottom" | "left" | "right" | "start" | "end"; }) { const dir = useDir(); const resolved = direction === "start" || direction === "end" ? resolvePhysicalSide(direction, dir) : direction; return ; } function DrawerTrigger({ ...props }: React.ComponentProps) { return ; } function DrawerPortal({ ...props }: React.ComponentProps) { return ; } function DrawerClose({ ...props }: React.ComponentProps) { return ; } function DrawerOverlay({ className, ...props }: React.ComponentProps) { return ( ); } function DrawerContent({ className, children, ...props }: React.ComponentProps) { return (
{children} ); } function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) { return (
); } function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) { return
; } function DrawerTitle({ className, ...props }: React.ComponentProps) { return ( ); } function DrawerDescription({ className, ...props }: React.ComponentProps) { return ( ); } export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };