'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { XIcon } from 'lucide-react';
import { Drawer as DrawerPrimitive } from 'vaul';
import { cn } from '../../lib/utils.js';
function Drawer({ ...props }) {
    return _jsx(DrawerPrimitive.Root, { "data-slot": "drawer", ...props });
}
function DrawerTrigger({ ...props }) {
    return _jsx(DrawerPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
}
function DrawerPortal({ ...props }) {
    return _jsx(DrawerPrimitive.Portal, { "data-slot": "drawer-portal", ...props });
}
function DrawerClose({ ...props }) {
    return _jsx(DrawerPrimitive.Close, { "data-slot": "drawer-close", ...props });
}
function DrawerOverlay({ className, ...props }) {
    return (_jsx(DrawerPrimitive.Overlay, { "data-slot": "drawer-overlay", className: cn('fixed inset-0 z-50 bg-black/50', className), ...props }));
}
function DrawerContent({ className, children, direction = 'bottom', showCloseButton = true, ...props }) {
    return (_jsx(DrawerPortal, { children: _jsxs(DrawerPrimitive.Content, { "data-slot": "drawer-content", className: cn('bg-background fixed z-50 flex flex-col shadow-lg', direction === 'bottom' && 'inset-x-0 bottom-0 mb-24 rounded-t-lg border-t', direction === 'top' && 'inset-x-0 top-0 mt-24 rounded-b-lg border-b', direction === 'right' && 'inset-y-0 right-0 h-full w-3/4 border-l', direction === 'left' && 'inset-y-0 left-0 h-full w-3/4 border-r', className), style: {
                '--initial-transform': 'calc(100% + 8px)',
                // Override vaul's user-select:none on [data-vaul-drawer] so text is selectable
                userSelect: 'text',
                ...(props.style ?? {}),
            }, ...props, children: [children, showCloseButton ? (_jsxs(DrawerPrimitive.Close, { className: "ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [_jsx(XIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })) : null] }) }));
}
function DrawerHeader({ className, ...props }) {
    return (_jsx("div", { "data-slot": "drawer-header", className: cn('flex flex-col gap-1.5 p-4', className), ...props }));
}
function DrawerFooter({ className, ...props }) {
    return (_jsx("div", { "data-slot": "drawer-footer", className: cn('mt-auto flex flex-col gap-2 p-4', className), ...props }));
}
function DrawerTitle({ className, ...props }) {
    return (_jsx(DrawerPrimitive.Title, { "data-slot": "drawer-title", className: cn('text-foreground font-semibold', className), ...props }));
}
function DrawerDescription({ className, ...props }) {
    return (_jsx(DrawerPrimitive.Description, { "data-slot": "drawer-description", className: cn('text-muted-foreground text-sm', className), ...props }));
}
export { Drawer, DrawerPortal, DrawerOverlay, DrawerClose, DrawerTrigger, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
