"use client";
import { getFontSize, getSize } from "../../core/utils/get-size/get-size.mjs";
import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
import { Box } from "../../core/Box/Box.mjs";
import { Input } from "../../components/Input/Input.mjs";
import InlineInput_module_default from "./InlineInput.module.mjs";
import { jsx, jsxs } from "react/jsx-runtime";
//#region packages/@mantine/core/src/utils/InlineInput/InlineInput.tsx
const InlineInputClasses = InlineInput_module_default;
function InlineInput({ __staticSelector, __stylesApiProps, className, classNames, styles, unstyled, children, label, description, id, disabled, error, size, labelPosition = "left", bodyElement = "div", labelElement = "label", variant, style, vars, mod, attributes, ...others }) {
	const getStyles = useStyles({
		name: __staticSelector,
		props: __stylesApiProps,
		className,
		style,
		classes: InlineInput_module_default,
		classNames,
		styles,
		unstyled,
		attributes
	});
	const descriptionId = description ? `${id}-description` : void 0;
	const errorId = error && typeof error !== "boolean" ? `${id}-error` : void 0;
	return /* @__PURE__ */ jsx(Box, {
		...getStyles("root"),
		__vars: {
			"--label-fz": getFontSize(size),
			"--label-lh": getSize(size, "label-lh")
		},
		mod: [{ "label-position": labelPosition }, mod],
		variant,
		size,
		...others,
		children: /* @__PURE__ */ jsxs(Box, {
			component: bodyElement,
			htmlFor: bodyElement === "label" ? id : void 0,
			...getStyles("body"),
			children: [children, /* @__PURE__ */ jsxs("div", {
				...getStyles("labelWrapper"),
				"data-disabled": disabled || void 0,
				children: [
					label && /* @__PURE__ */ jsx(Box, {
						component: labelElement,
						htmlFor: labelElement === "label" ? id : void 0,
						...getStyles("label"),
						"data-disabled": disabled || void 0,
						children: label
					}),
					description && /* @__PURE__ */ jsx(Input.Description, {
						id: descriptionId,
						size,
						__inheritStyles: false,
						...getStyles("description"),
						children: description
					}),
					error && typeof error !== "boolean" && /* @__PURE__ */ jsx(Input.Error, {
						id: errorId,
						size,
						__inheritStyles: false,
						...getStyles("error"),
						children: error
					})
				]
			})]
		})
	});
}
InlineInput.displayName = "@mantine/core/InlineInput";
//#endregion
export { InlineInput, InlineInputClasses };

//# sourceMappingURL=InlineInput.mjs.map