/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
const require_styles_styler = require('../styles/styler.cjs');
const require_components_Text = require('./Text.cjs');
let react_jsx_runtime = require("react/jsx-runtime");
let lodash_isFunction_js = require("lodash/isFunction.js");
lodash_isFunction_js = require_runtime.__toESM(lodash_isFunction_js);

//#region src/components/FormLabel.tsx
const FormLabel = ({ htmlFor, required, label, children, color = "muted", variant = "label3", hasError = false, showRequiredAsterisk = false, as = "label", className, ...rest }) => {
	const contents = label ? (0, lodash_isFunction_js.default)(label) ? label() : label : children;
	if (!contents) return null;
	return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_Text.Text, {
		variant,
		color,
		as,
		htmlFor,
		className: require_styles_styler.cx("cursor-[inherit]", className),
		...rest,
		children: [contents, required && showRequiredAsterisk && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
			as: "sup",
			color: hasError ? "alert" : "inherit",
			variant: "inherit",
			spacingStart: "0.5",
			"aria-hidden": true,
			children: "*"
		})]
	});
};
FormLabel.displayName = "FormLabel";

//#endregion
exports.FormLabel = FormLabel;