"use client";
import { useProps } from "../../core/MantineProvider/use-props/use-props.mjs";
import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
import { useRandomClassName } from "../../core/Box/use-random-classname/use-random-classname.mjs";
import { factory } from "../../core/factory/factory.mjs";
import { Box } from "../../core/Box/Box.mjs";
import { SimpleGridContainerVariables, SimpleGridMediaVariables } from "./SimpleGridVariables.mjs";
import SimpleGrid_module_default from "./SimpleGrid.module.mjs";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
//#region packages/@mantine/core/src/components/SimpleGrid/SimpleGrid.tsx
const defaultProps = {
	cols: 1,
	spacing: "md",
	type: "media"
};
const SimpleGrid = factory((_props) => {
	const props = useProps("SimpleGrid", defaultProps, _props);
	const { classNames, className, style, styles, unstyled, vars, cols, verticalSpacing, spacing, type, minColWidth, autoFlow, autoRows, attributes, ...others } = props;
	const getStyles = useStyles({
		name: "SimpleGrid",
		classes: SimpleGrid_module_default,
		props,
		className,
		style,
		classNames,
		styles,
		unstyled,
		attributes,
		vars
	});
	const responsiveClassName = useRandomClassName();
	const autoColsAttr = minColWidth !== void 0 ? autoFlow || "auto-fill" : void 0;
	if (type === "container") return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SimpleGridContainerVariables, {
		...props,
		selector: `.${responsiveClassName}`
	}), /* @__PURE__ */ jsx("div", {
		...getStyles("container"),
		children: /* @__PURE__ */ jsx(Box, {
			...getStyles("root", { className: responsiveClassName }),
			...others,
			"data-auto-cols": autoColsAttr
		})
	})] });
	return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SimpleGridMediaVariables, {
		...props,
		selector: `.${responsiveClassName}`
	}), /* @__PURE__ */ jsx(Box, {
		...getStyles("root", { className: responsiveClassName }),
		...others,
		"data-auto-cols": autoColsAttr
	})] });
});
SimpleGrid.classes = SimpleGrid_module_default;
SimpleGrid.displayName = "@mantine/core/SimpleGrid";
//#endregion
export { SimpleGrid };

//# sourceMappingURL=SimpleGrid.mjs.map