"use client";
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_use_random_classname = require("../../core/Box/use-random-classname/use-random-classname.cjs");
const require_factory = require("../../core/factory/factory.cjs");
const require_Box = require("../../core/Box/Box.cjs");
const require_Grid_context = require("./Grid.context.cjs");
const require_Grid_module = require("./Grid.module.cjs");
const require_GridCol = require("./GridCol/GridCol.cjs");
const require_GridVariables = require("./GridVariables.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
//#region packages/@mantine/core/src/components/Grid/Grid.tsx
const defaultProps = {
	gap: "md",
	columns: 12
};
const varsResolver = require_create_vars_resolver.createVarsResolver((_, { justify, align, overflow }) => ({ root: {
	"--grid-justify": justify,
	"--grid-align": align,
	"--grid-overflow": overflow
} }));
const Grid = require_factory.factory((_props) => {
	const props = require_use_props.useProps("Grid", defaultProps, _props);
	const { classNames, className, style, styles, unstyled, vars, grow, gap, rowGap, columnGap, columns, align, justify, children, breakpoints, type, attributes, ...others } = props;
	const getStyles = require_use_styles.useStyles({
		name: "Grid",
		classes: require_Grid_module.default,
		props,
		className,
		style,
		classNames,
		styles,
		unstyled,
		attributes,
		vars,
		varsResolver
	});
	const responsiveClassName = require_use_random_classname.useRandomClassName();
	if (type === "container" && breakpoints) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Grid_context.GridProvider, {
		value: {
			getStyles,
			grow,
			columns,
			breakpoints,
			type
		},
		children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_GridVariables.GridVariables, {
			selector: `.${responsiveClassName}`,
			...props
		}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
			...getStyles("container"),
			children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
				...getStyles("root", { className: responsiveClassName }),
				...others,
				children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
					...getStyles("inner"),
					children
				})
			})
		})]
	});
	return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Grid_context.GridProvider, {
		value: {
			getStyles,
			grow,
			columns,
			breakpoints,
			type
		},
		children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_GridVariables.GridVariables, {
			selector: `.${responsiveClassName}`,
			...props
		}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
			...getStyles("root", { className: responsiveClassName }),
			...others,
			children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
				...getStyles("inner"),
				children
			})
		})]
	});
});
Grid.classes = require_Grid_module.default;
Grid.varsResolver = varsResolver;
Grid.displayName = "@mantine/core/Grid";
Grid.Col = require_GridCol.GridCol;
//#endregion
exports.Grid = Grid;

//# sourceMappingURL=Grid.cjs.map