import { t as e } from "../../chunks/clsx.js";
import { FormControlError as t } from "./FormControlError.js";
import { useInternalStatus as n } from "../hooks/useInternalStatus.js";
import { FormLabel as r } from "./FormLabel.js";
import { jsx as i, jsxs as a } from "react/jsx-runtime";
//#region lib/ui/forms/FormControl.tsx
var o = ({ id: o, label: s, description: c, disabled: l, required: u, className: d, validationStatus: f = "default", children: p, errorMessage: m, dataTestId: h, "data-testid": g, dataName: _, labelClassName: v, hideRequiredStar: y, layout: b, inline: x }) => {
	let S = n({
		isDisabled: !!l,
		validationStatus: f
	}) === "error" && m;
	return /* @__PURE__ */ a("div", {
		className: e("flex gap-4", x ? "" : "flex-col", d),
		"data-name": _,
		"data-testid": g ?? h,
		children: [
			s && o && /* @__PURE__ */ i(r, {
				description: c,
				id: o,
				layout: b,
				required: u,
				hideRequiredStar: y,
				className: v,
				children: s
			}),
			p,
			S && /* @__PURE__ */ i(t, { children: m })
		]
	});
};
//#endregion
export { o as FormControl };

//# sourceMappingURL=FormControl.js.map