"use client";
import { getRadius } from "../../core/utils/get-size/get-size.mjs";
import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
import { useProps } from "../../core/MantineProvider/use-props/use-props.mjs";
import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
import { factory } from "../../core/factory/factory.mjs";
import { Box } from "../../core/Box/Box.mjs";
import Fieldset_module_default from "./Fieldset.module.mjs";
import { jsx, jsxs } from "react/jsx-runtime";
//#region packages/@mantine/core/src/components/Fieldset/Fieldset.tsx
const defaultProps = { variant: "default" };
const varsResolver = createVarsResolver((_, { radius }) => ({ root: { "--fieldset-radius": radius === void 0 ? void 0 : getRadius(radius) } }));
const Fieldset = factory((_props) => {
	const props = useProps("Fieldset", defaultProps, _props);
	const { classNames, className, style, styles, unstyled, vars, legend, variant, children, attributes, ...others } = props;
	const getStyles = useStyles({
		name: "Fieldset",
		classes: Fieldset_module_default,
		props,
		className,
		style,
		classNames,
		styles,
		unstyled,
		attributes,
		vars,
		varsResolver
	});
	return /* @__PURE__ */ jsxs(Box, {
		component: "fieldset",
		variant,
		...getStyles("root", { variant }),
		...others,
		children: [legend && /* @__PURE__ */ jsx("legend", {
			...getStyles("legend", { variant }),
			children: legend
		}), children]
	});
});
Fieldset.classes = Fieldset_module_default;
Fieldset.varsResolver = varsResolver;
Fieldset.displayName = "@mantine/core/Fieldset";
//#endregion
export { Fieldset };

//# sourceMappingURL=Fieldset.mjs.map