/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
import { cn } from "../../utils/cn.js";
import { X } from "../../icons/index.js";
import { Button as Button$1 } from "../../core/Button/Button2.js";
import "../../core/Button/index.js";
import "react";
import { jsx, jsxs } from "react/jsx-runtime";
import { Dialog, Heading, Modal, ModalOverlay } from "react-aria-components";
//#region src/layout/Drawer/Drawer.tsx
var Drawer = ({ isOpen, onClose, children, isDismissable = true, isKeyboardDismissDisabled = false }) => {
	return /* @__PURE__ */ jsx(ModalOverlay, {
		isOpen,
		onOpenChange: (open) => {
			if (!open) onClose?.();
		},
		isDismissable,
		isKeyboardDismissDisabled,
		className: "fixed inset-0 z-30 bg-cover backdrop-blur-xs",
		children: /* @__PURE__ */ jsx(Modal, {
			className: "fixed top-0 right-0 h-full w-11/12 md:w-10/12 lg:w-7/12 2xl:w-8/12 bg-(--surface) overflow-auto",
			children: /* @__PURE__ */ jsxs(Dialog, {
				className: "relative flex flex-col p-6 outline-hidden h-full",
				children: [onClose && /* @__PURE__ */ jsx(Button$1, {
					onClick: onClose,
					className: "absolute top-0 right-0 m-4",
					variant: "secondary",
					ariaLabel: "Close drawer",
					children: /* @__PURE__ */ jsx(X, {})
				}), children]
			})
		})
	});
};
var headingClass = "text-2xl font-bold text-(--text) mb-4";
var Header$1 = ({ as, children, className }) => {
	if (as) return /* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx(Heading, {
		slot: "title",
		level: parseInt(as.charAt(1), 10),
		className: cn(headingClass, className),
		children
	}) });
	return /* @__PURE__ */ jsx("header", {
		className,
		children
	});
};
var DrawerHeading = ({ children, className, level = 2 }) => /* @__PURE__ */ jsx(Heading, {
	slot: "title",
	level,
	className: cn(headingClass, className),
	children
});
var Body = ({ children, className }) => /* @__PURE__ */ jsx("div", {
	className: cn("grow", className),
	children
});
var Footer = ({ children, className }) => /* @__PURE__ */ jsx("footer", {
	className: cn("pt-8", className),
	children
});
Drawer.Header = Header$1;
Drawer.Heading = DrawerHeading;
Drawer.Body = Body;
Drawer.Footer = Footer;
//#endregion
export { Drawer };

//# sourceMappingURL=Drawer.js.map