"use client";
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
import { cx } from "../../../styles/styler.js";
import { HStack } from "../../HStack.js";
import { Text } from "../../Text.js";
import { VStack } from "../../VStack.js";
import { IconButton } from "../../client/IconButton.js";
import { jsx, jsxs } from "react/jsx-runtime";
import { Cross } from "@yahoo/uds-icons";
import { Dialog, DialogDismiss, useDialogStore } from "@ariakit/react";

//#region src/components/experimental/client/Modal.tsx
function useModalStore(params) {
	return useDialogStore({
		animated: true,
		...params
	});
}
function ModalHeader({ children, handleClose }) {
	return /* @__PURE__ */ jsxs(HStack, {
		alignItems: "center",
		justifyContent: "space-between",
		children: [/* @__PURE__ */ jsx(Text, {
			variant: "headline1",
			color: "primary",
			children
		}), /* @__PURE__ */ jsx(IconButton, {
			"aria-label": "Close",
			size: "sm",
			variant: "tertiary",
			name: Cross,
			onClick: handleClose
		})]
	});
}
ModalHeader.displayName = "ModalHeader";
function Modal({ className, ...props }) {
	return /* @__PURE__ */ jsx(VStack, {
		borderRadius: "md",
		position: "fixed",
		backgroundColor: "primary",
		dropShadow: "md",
		className: cx("inset-8 top-[250px] z-50 mx-auto h-fit w-[600px] origin-center scale-95 opacity-0 transition duration-150 data-[enter]:scale-100 data-[enter]:opacity-100", className),
		spacing: "8",
		asChild: true,
		overflow: "hidden",
		children: /* @__PURE__ */ jsx(Dialog, {
			backdrop: /* @__PURE__ */ jsx("div", { className: "data-[enter]:bg-primary opacity-0 backdrop-blur-0 transition duration-150 data-[enter]:opacity-60 data-[enter]:backdrop-blur-sm" }),
			...props
		})
	});
}
Modal.displayName = "Modal";
const ModalDismiss = DialogDismiss;

//#endregion
export { Modal, ModalDismiss, ModalHeader, useModalStore };