"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_get_theme_color = require("../../core/MantineProvider/color-functions/get-theme-color/get-theme-color.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_polymorphic_factory = require("../../core/factory/polymorphic-factory.cjs");
const require_Box = require("../../core/Box/Box.cjs");
const require_Badge_module = require("./Badge.module.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
//#region packages/@mantine/core/src/components/Badge/Badge.tsx
const varsResolver = require_create_vars_resolver.createVarsResolver((theme, { radius, color, gradient, variant, size, autoContrast, circle }) => {
	const colors = theme.variantColorResolver({
		color: color || theme.primaryColor,
		theme,
		gradient,
		variant: variant || "filled",
		autoContrast
	});
	return { root: {
		"--badge-height": require_get_size.getSize(size, "badge-height"),
		"--badge-padding-x": require_get_size.getSize(size, "badge-padding-x"),
		"--badge-fz": require_get_size.getSize(size, "badge-fz"),
		"--badge-radius": circle || radius === void 0 ? void 0 : require_get_size.getRadius(radius),
		"--badge-bg": color || variant ? colors.background : void 0,
		"--badge-color": color || variant ? colors.color : void 0,
		"--badge-bd": color || variant ? colors.border : void 0,
		"--badge-dot-color": variant === "dot" ? require_get_theme_color.getThemeColor(color, theme) : void 0
	} };
});
const Badge = require_polymorphic_factory.polymorphicFactory((_props) => {
	const props = require_use_props.useProps("Badge", null, _props);
	const { classNames, className, style, styles, unstyled, vars, radius, color, gradient, leftSection, rightSection, children, variant, fullWidth, autoContrast, circle, mod, attributes, ...others } = props;
	const getStyles = require_use_styles.useStyles({
		name: "Badge",
		props,
		classes: require_Badge_module.default,
		className,
		style,
		classNames,
		styles,
		unstyled,
		attributes,
		vars,
		varsResolver
	});
	return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_Box.Box, {
		variant,
		mod: [{
			block: fullWidth,
			circle,
			"with-right-section": !!rightSection,
			"with-left-section": !!leftSection
		}, mod],
		...getStyles("root", { variant }),
		...others,
		children: [
			leftSection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
				...getStyles("section"),
				"data-position": "left",
				children: leftSection
			}),
			/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
				...getStyles("label"),
				children
			}),
			rightSection && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
				...getStyles("section"),
				"data-position": "right",
				children: rightSection
			})
		]
	});
});
Badge.classes = require_Badge_module.default;
Badge.varsResolver = varsResolver;
Badge.displayName = "@mantine/core/Badge";
//#endregion
exports.Badge = Badge;

//# sourceMappingURL=Badge.cjs.map