import { t as e } from "../../utils-B7XIe3qq.js";
import "react";
import { jsx as t, jsxs as n } from "react/jsx-runtime";
//#region src/react/primitives/field.tsx
function r({ className: r, label: i, htmlFor: a, required: o, hint: s, error: c, children: l, ...u }) {
	return /* @__PURE__ */ n("div", {
		"data-slot": "field",
		className: e("flex flex-col gap-1.5", r),
		...u,
		children: [
			i && /* @__PURE__ */ n("label", {
				"data-slot": "field-label",
				htmlFor: a,
				className: "text-foreground text-sm font-medium leading-none",
				children: [i, o && /* @__PURE__ */ t("span", {
					"aria-hidden": "true",
					className: "text-accent-rose ml-0.5",
					children: "*"
				})]
			}),
			/* @__PURE__ */ t("div", {
				"data-slot": "field-content",
				children: l
			}),
			c ? /* @__PURE__ */ t("p", {
				"data-slot": "field-error",
				role: "alert",
				className: "text-accent-rose text-xs",
				children: c
			}) : s ? /* @__PURE__ */ t("p", {
				"data-slot": "field-hint",
				className: "text-foreground-muted text-xs",
				children: s
			}) : null
		]
	});
}
//#endregion
export { r as Field };

//# sourceMappingURL=field.js.map