import colors_default from "../theme/foundations/colors.js";
import { HSLToRGBA, cs, parseHSL } from "../utils/styles.js";
import { useStyleConfig } from "../core/theme.js";
import styled from "../core/styled.js";
import vui from "../core/vui.js";
import { useModalContext } from "./context.js";
import { jsx } from "react/jsx-runtime";

//#region src/modal/modalBackdrop.tsx
const { h, s, l } = parseHSL(colors_default.sandstone[5]);
const rgba = HSLToRGBA(h, s, l, .6);
const ModalBackdropBase = styled.divBox`
  background-color: ${rgba};
  inset: 0;
  position: fixed;
  z-index: modal;
`;
/** Displays a dark overlay underneath modal content, but on top of page content. */
const ModalBackdrop = vui((props, ref) => {
	const { className, ...rest } = props;
	const styles = useStyleConfig("Modal", useModalContext());
	return /* @__PURE__ */ jsx(ModalBackdropBase, {
		animation: "fadeIn",
		className: cs("vui-modalBackdrop", className),
		ref,
		...styles.backdrop,
		...rest
	});
});
ModalBackdrop.displayName = "ModalBackdrop";

//#endregion
export { ModalBackdropBase, ModalBackdrop as default };
globalThis.__vuiVersion__ = "4.0.1"
//# sourceMappingURL=modalBackdrop.js.map