"use client";
import { rem } from "../../../core/utils/units-converters/rem.mjs";
import { getFontSize } 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 { InputWrapperContext } from "../InputWrapper.context.mjs";
import Input_module_default from "../Input.module.mjs";
import { use } from "react";
import { jsx } from "react/jsx-runtime";
//#region packages/@mantine/core/src/components/Input/InputError/InputError.tsx
const varsResolver = createVarsResolver((_, { size }) => ({ error: { "--input-error-size": size === void 0 ? void 0 : `calc(${getFontSize(size)} - ${rem(2)})` } }));
const InputError = factory((_props) => {
	const props = useProps("InputError", null, _props);
	const { classNames, className, style, styles, unstyled, vars, attributes, __staticSelector, __inheritStyles = true, ...others } = props;
	const _getStyles = useStyles({
		name: ["InputWrapper", __staticSelector],
		props,
		classes: Input_module_default,
		className,
		style,
		classNames,
		styles,
		unstyled,
		attributes,
		rootSelector: "error",
		vars,
		varsResolver
	});
	const ctx = use(InputWrapperContext);
	return /* @__PURE__ */ jsx(Box, {
		component: "p",
		...(__inheritStyles && ctx?.getStyles || _getStyles)("error", ctx?.getStyles ? {
			className,
			style
		} : void 0),
		...others
	});
});
InputError.classes = Input_module_default;
InputError.varsResolver = varsResolver;
InputError.displayName = "@mantine/core/InputError";
//#endregion
export { InputError };

//# sourceMappingURL=InputError.mjs.map