/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../../_virtual/_rolldown/runtime.cjs");
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/components/client/Modal/UDSModalConfigProvider.tsx
const ModalContext = (0, react.createContext)(void 0);
const UDSModalConfigProvider = ({ children, value }) => {
	const existingContext = (0, react.useContext)(ModalContext);
	if ("type" in value) {
		if (!existingContext) throw new Error("Cannot merge context values without an existing ModalContext");
		return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalContext.Provider, {
			value: {
				...existingContext,
				...value.value
			},
			children
		});
	}
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalContext.Provider, {
		value,
		children
	});
};
UDSModalConfigProvider.displayName = "UDSModalConfigProvider";
function useModalConfig(sizeProp, variantProp) {
	const context = (0, react.useContext)(ModalContext);
	if (!context) throw new Error("useModalConfig must be used within a UDSConfigProvider or UDSModalConfigProvider");
	const { defaultSize, defaultVariant, gutter, animationDuration, animationEasing } = context;
	const size = sizeProp ?? defaultSize;
	return {
		size,
		variant: variantProp ?? defaultVariant,
		animationDuration,
		animationEasing,
		gutter: gutter[size]
	};
}
//#endregion
exports.UDSModalConfigProvider = UDSModalConfigProvider;
exports.useModalConfig = useModalConfig;
