@arolariu/components
Version:
🎨 60+ beautiful, accessible React components built on Radix UI. TypeScript-first, tree-shakeable, SSR-ready. Perfect for modern web apps, design systems & rapid prototyping. Zero config, maximum flexibility! ⚡
86 lines (85 loc) • 4.2 kB
JavaScript
"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import "react";
import { Drawer } from "vaul";
import { cn } from "../../lib/utils.js";
function drawer_Drawer({ ...props }) {
return /*#__PURE__*/ jsx(Drawer.Root, {
"data-slot": "drawer",
...props
});
}
function DrawerTrigger({ ...props }) {
return /*#__PURE__*/ jsx(Drawer.Trigger, {
"data-slot": "drawer-trigger",
...props
});
}
function DrawerPortal({ ...props }) {
return /*#__PURE__*/ jsx(Drawer.Portal, {
"data-slot": "drawer-portal",
...props
});
}
function DrawerClose({ ...props }) {
return /*#__PURE__*/ jsx(Drawer.Close, {
"data-slot": "drawer-close",
...props
});
}
function DrawerOverlay({ className, ...props }) {
return /*#__PURE__*/ jsx(Drawer.Overlay, {
"data-slot": "drawer-overlay",
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", className),
...props
});
}
function DrawerContent({ className, children, ...props }) {
return /*#__PURE__*/ jsxs(DrawerPortal, {
"data-slot": "drawer-portal",
children: [
/*#__PURE__*/ jsx(DrawerOverlay, {}),
/*#__PURE__*/ jsxs(Drawer.Content, {
"data-slot": "drawer-content",
className: cn("group/drawer-content bg-white fixed z-50 flex h-auto flex-col dark:bg-neutral-950", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", className),
...props,
children: [
/*#__PURE__*/ jsx("div", {
className: "bg-neutral-100 mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block dark:bg-neutral-800"
}),
children
]
})
]
});
}
function DrawerHeader({ className, ...props }) {
return /*#__PURE__*/ jsx("div", {
"data-slot": "drawer-header",
className: cn("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", className),
...props
});
}
function DrawerFooter({ className, ...props }) {
return /*#__PURE__*/ jsx("div", {
"data-slot": "drawer-footer",
className: cn("mt-auto flex flex-col gap-2 p-4", className),
...props
});
}
function DrawerTitle({ className, ...props }) {
return /*#__PURE__*/ jsx(Drawer.Title, {
"data-slot": "drawer-title",
className: cn("text-neutral-950 font-semibold dark:text-neutral-50", className),
...props
});
}
function DrawerDescription({ className, ...props }) {
return /*#__PURE__*/ jsx(Drawer.Description, {
"data-slot": "drawer-description",
className: cn("text-neutral-500 text-sm dark:text-neutral-400", className),
...props
});
}
export { drawer_Drawer as Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
//# sourceMappingURL=drawer.js.map