"use client";
const require_get_size = require("../../core/utils/get-size/get-size.cjs");
const require_create_vars_resolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs");
const require_use_props = require("../../core/MantineProvider/use-props/use-props.cjs");
const require_use_styles = require("../../core/styles-api/use-styles/use-styles.cjs");
const require_factory = require("../../core/factory/factory.cjs");
const require_Paper = require("../Paper/Paper.cjs");
const require_Transition = require("../Transition/Transition.cjs");
const require_CloseButton = require("../CloseButton/CloseButton.cjs");
const require_Affix = require("../Affix/Affix.cjs");
const require_Dialog_module = require("./Dialog.module.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
//#region packages/@mantine/core/src/components/Dialog/Dialog.tsx
const defaultProps = {
	shadow: "md",
	p: "md",
	withBorder: true,
	transitionProps: {
		transition: "pop-top-right",
		duration: 200
	},
	position: {
		bottom: 30,
		right: 30
	}
};
const varsResolver = require_create_vars_resolver.createVarsResolver((_, { size }) => ({ root: { "--dialog-size": require_get_size.getSize(size, "dialog-size") } }));
const Dialog = require_factory.factory((_props) => {
	const props = require_use_props.useProps("Dialog", defaultProps, _props);
	const { classNames, className, style, styles, unstyled, vars, zIndex, position, keepMounted, opened, transitionProps, withCloseButton, withinPortal, children, onClose, portalProps, attributes, ...others } = props;
	const getStyles = require_use_styles.useStyles({
		name: "Dialog",
		classes: require_Dialog_module.default,
		props,
		className,
		style,
		classNames,
		styles,
		unstyled,
		attributes,
		vars,
		varsResolver
	});
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Affix.Affix, {
		zIndex,
		position,
		withinPortal,
		portalProps,
		unstyled,
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Transition.Transition, {
			keepMounted,
			mounted: opened,
			...transitionProps,
			children: (transitionStyles) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Paper.Paper, {
				unstyled,
				...getStyles("root", { style: transitionStyles }),
				...others,
				children: [withCloseButton && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CloseButton.CloseButton, {
					onClick: onClose,
					unstyled,
					...getStyles("closeButton")
				}), children]
			})
		})
	});
});
Dialog.classes = require_Dialog_module.default;
Dialog.varsResolver = varsResolver;
Dialog.displayName = "@mantine/core/Dialog";
//#endregion
exports.Dialog = Dialog;

//# sourceMappingURL=Dialog.cjs.map