import { Label as e } from "../../ui/label.js";
import "react";
import { jsx as t, jsxs as n } from "react/jsx-runtime";
//#region src/components/dynamic-form/fields/BaseFieldWrapper.tsx
var r = ({ name: r, label: i, required: a, error: o, helpText: s, description: c, children: l, labelClassName: u = "", showLabel: d = !0, helpTextPosition: f = "after" }) => /* @__PURE__ */ n("div", {
	className: "mb-4 block space-y-1.5",
	children: [
		d && /* @__PURE__ */ t(e, {
			htmlFor: r,
			className: `text-sm leading-none font-medium ${a ? "after:ml-0.5 after:text-red-500 after:content-['*']" : ""} ${u}`,
			children: i
		}),
		f === "before" && s && !o && /* @__PURE__ */ t("p", {
			className: "text-muted-foreground text-sm",
			children: s
		}),
		l,
		c && !o && /* @__PURE__ */ t("p", {
			id: `${r}-description`,
			className: "text-muted-foreground text-sm",
			children: c
		}),
		f === "after" && s && !o && /* @__PURE__ */ t("p", {
			className: "text-muted-foreground text-sm",
			children: s
		}),
		o && /* @__PURE__ */ t("p", {
			className: "text-destructive text-sm font-medium",
			role: "alert",
			children: String(o.message || "Invalid value")
		})
	]
});
//#endregion
export { r as BaseFieldWrapper };
