"use client";
import { cn } from "./index3.js";
import * as React from "react";
import { jsx, jsxs } from "react/jsx-runtime";
import { Dialog } from "@base-ui/react/dialog";
//#region src/components/ui/drawer.tsx
var DrawerDirectionContext = React.createContext("bottom");
function useDrawerDirection() {
	return React.useContext(DrawerDirectionContext);
}
function Drawer({ direction = "bottom", ...props }) {
	return /* @__PURE__ */ jsx(DrawerDirectionContext.Provider, {
		value: direction,
		children: /* @__PURE__ */ jsx(Dialog.Root, {
			"data-slot": "drawer",
			...props
		})
	});
}
function DrawerTrigger({ ...props }) {
	return /* @__PURE__ */ jsx(Dialog.Trigger, {
		"data-slot": "drawer-trigger",
		...props
	});
}
function DrawerPortal({ ...props }) {
	return /* @__PURE__ */ jsx(Dialog.Portal, {
		"data-slot": "drawer-portal",
		...props
	});
}
function DrawerClose({ ...props }) {
	return /* @__PURE__ */ jsx(Dialog.Close, {
		"data-slot": "drawer-close",
		...props
	});
}
function DrawerOverlay({ className, disableAnimation, disableBackdropBlur, ...props }) {
	return /* @__PURE__ */ jsx(Dialog.Backdrop, {
		"data-slot": "drawer-overlay",
		className: cn("bg-background/80/10 fixed inset-0 z-50", !disableAnimation && "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0", !disableBackdropBlur && "supports-backdrop-filter:backdrop-blur-xs", className),
		...props
	});
}
function DrawerContent({ className, children, disableAnimation, disableBackdropBlur, ...props }) {
	const direction = useDrawerDirection();
	return /* @__PURE__ */ jsxs(DrawerPortal, {
		"data-slot": "drawer-portal",
		children: [/* @__PURE__ */ jsx(DrawerOverlay, {
			disableAnimation,
			disableBackdropBlur
		}), /* @__PURE__ */ jsxs(Dialog.Popup, {
			"data-slot": "drawer-content",
			"data-vaul-drawer-direction": direction,
			className: cn("bg-background flex h-auto flex-col text-sm 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-xl data-[vaul-drawer-direction=bottom]:border-t 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]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r 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]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l 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-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm group/drawer-content fixed z-50", className),
			...props,
			children: [/* @__PURE__ */ jsx("div", { className: "bg-muted mx-auto mt-4 hidden h-1.5 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children]
		})]
	});
}
function DrawerHeader({ className, ...props }) {
	return /* @__PURE__ */ jsx("div", {
		"data-slot": "drawer-header",
		className: cn("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 flex flex-col", className),
		...props
	});
}
function DrawerFooter({ className, ...props }) {
	return /* @__PURE__ */ jsx("div", {
		"data-slot": "drawer-footer",
		className: cn("gap-2 p-4 mt-auto flex flex-col", className),
		...props
	});
}
function DrawerTitle({ className, ...props }) {
	return /* @__PURE__ */ jsx(Dialog.Title, {
		"data-slot": "drawer-title",
		className: cn("text-foreground font-medium", className),
		...props
	});
}
function DrawerDescription({ className, ...props }) {
	return /* @__PURE__ */ jsx(Dialog.Description, {
		"data-slot": "drawer-description",
		className: cn("text-muted-foreground text-sm", className),
		...props
	});
}
DrawerTrigger.displayName = "Drawer.Trigger";
DrawerPortal.displayName = "Drawer.Portal";
DrawerClose.displayName = "Drawer.Close";
DrawerOverlay.displayName = "Drawer.Overlay";
DrawerContent.displayName = "Drawer.Content";
DrawerHeader.displayName = "Drawer.Header";
DrawerFooter.displayName = "Drawer.Footer";
DrawerTitle.displayName = "Drawer.Title";
DrawerDescription.displayName = "Drawer.Description";
Drawer.displayName = "Drawer";
Object.assign(Drawer, {
	Trigger: DrawerTrigger,
	Portal: DrawerPortal,
	Close: DrawerClose,
	Overlay: DrawerOverlay,
	Content: DrawerContent,
	Header: DrawerHeader,
	Footer: DrawerFooter,
	Title: DrawerTitle,
	Description: DrawerDescription
});
//#endregion
export { DrawerDirectionContext, useDrawerDirection };

//# sourceMappingURL=index464.js.map