"use client";
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_filter_falsy_children = require("./filter-falsy-children/filter-falsy-children.cjs");
const require_Group_module = require("./Group.module.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
//#region packages/@mantine/core/src/components/Group/Group.tsx
const defaultProps = {
	preventGrowOverflow: true,
	gap: "md",
	align: "center",
	justify: "flex-start",
	wrap: "wrap"
};
const varsResolver = require_create_vars_resolver.createVarsResolver((_, { grow, preventGrowOverflow, gap, align, justify, wrap }, { childWidth }) => ({ root: {
	"--group-child-width": grow && preventGrowOverflow ? childWidth : void 0,
	"--group-gap": require_get_size.getSpacing(gap),
	"--group-align": align,
	"--group-justify": justify,
	"--group-wrap": wrap
} }));
const Group = require_factory.factory((_props) => {
	const props = require_use_props.useProps("Group", defaultProps, _props);
	const { classNames, className, style, styles, unstyled, children, gap, align, justify, wrap, grow, preventGrowOverflow, vars, variant, __size, mod, attributes, ...others } = props;
	const filteredChildren = require_filter_falsy_children.filterFalsyChildren(children);
	const childrenCount = filteredChildren.length;
	const resolvedGap = require_get_size.getSpacing(gap ?? "md");
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
		...require_use_styles.useStyles({
			name: "Group",
			props,
			stylesCtx: { childWidth: `calc(${100 / childrenCount}% - (${resolvedGap} - ${resolvedGap} / ${childrenCount}))` },
			className,
			style,
			classes: require_Group_module.default,
			classNames,
			styles,
			unstyled,
			attributes,
			vars,
			varsResolver
		})("root"),
		variant,
		mod: [{ grow }, mod],
		size: __size,
		...others,
		children: filteredChildren
	});
});
Group.classes = require_Group_module.default;
Group.varsResolver = varsResolver;
Group.displayName = "@mantine/core/Group";
//#endregion
exports.Group = Group;

//# sourceMappingURL=Group.cjs.map