"use client";
const require_get_default_z_index = require("../../core/utils/get-default-z-index/get-default-z-index.cjs");
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_Box = require("../../core/Box/Box.cjs");
const require_OptionalPortal = require("../Portal/OptionalPortal.cjs");
const require_Affix_module = require("./Affix.module.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
//#region packages/@mantine/core/src/components/Affix/Affix.tsx
const defaultProps = {
	position: {
		bottom: 0,
		right: 0
	},
	zIndex: require_get_default_z_index.getDefaultZIndex("modal"),
	withinPortal: true
};
const varsResolver = require_create_vars_resolver.createVarsResolver((_, { zIndex, position }) => ({ root: {
	"--affix-z-index": zIndex?.toString(),
	"--affix-top": require_get_size.getSpacing(position?.top),
	"--affix-left": require_get_size.getSpacing(position?.left),
	"--affix-bottom": require_get_size.getSpacing(position?.bottom),
	"--affix-right": require_get_size.getSpacing(position?.right)
} }));
const Affix = require_factory.factory((_props) => {
	const props = require_use_props.useProps("Affix", defaultProps, _props);
	const { classNames, className, style, styles, unstyled, vars, portalProps, zIndex, withinPortal, position, attributes, ...others } = props;
	const getStyles = require_use_styles.useStyles({
		name: "Affix",
		classes: require_Affix_module.default,
		props,
		className,
		style,
		classNames,
		styles,
		unstyled,
		attributes,
		vars,
		varsResolver
	});
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_OptionalPortal.OptionalPortal, {
		...portalProps,
		withinPortal,
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
			...getStyles("root"),
			...others
		})
	});
});
Affix.classes = require_Affix_module.default;
Affix.varsResolver = varsResolver;
Affix.displayName = "@mantine/core/Affix";
//#endregion
exports.Affix = Affix;

//# sourceMappingURL=Affix.cjs.map