/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
"use client";
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_IconSlot = require("../../IconSlot.cjs");
const require_components_HStack = require("../../HStack.cjs");
const require_components_client_AnimateHeightChange = require("../AnimateHeightChange.cjs");
const require_components_client_Select_selectContext = require("./selectContext.cjs");
const require_components_client_Select_selectFieldStyles = require("./selectFieldStyles.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);
let _ariakit_react = require("@ariakit/react");
//#region src/components/client/Select/SelectHelpText.tsx
function SelectHelpText({ helpText, helperTextIcon, slotProps, className }) {
	const { size, helpTextId, reduceMotion } = require_components_client_Select_selectContext.useSelectFieldContext();
	const value = (0, _ariakit_react.useStoreState)((0, _ariakit_react.useSelectContext)(), "value");
	const hasValue = value != null && value !== "";
	const content = (0, lodash_isFunction_js.default)(helpText) ? helpText() : helpText;
	if (!content && !helperTextIcon) return null;
	const { className: helperTextClassName, ...helperTextSlotProps } = slotProps?.helperText ?? {};
	const { className: helperTextIconClassName, ...helperTextIconSlotProps } = slotProps?.helperTextIcon ?? {};
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_AnimateHeightChange.AnimateHeightChange, {
		reduceMotion: reduceMotion ? "always" : "user",
		layoutVariant: "bouncy",
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_HStack.HStack, {
			id: helpTextId,
			gap: "1",
			alignItems: "center",
			spacingTop: "2",
			className,
			children: [helperTextIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
				icon: helperTextIcon,
				className: require_styles_styler.cx(require_components_client_Select_selectFieldStyles.getSelectHelperIconClassName(size, hasValue), helperTextIconClassName),
				iconProps: {
					variant: "outline",
					...helperTextIconSlotProps
				}
			}), content && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
				className: require_styles_styler.cx(require_components_client_Select_selectFieldStyles.getSelectHelpTextClassName(size, hasValue), helperTextClassName),
				...helperTextSlotProps,
				children: content
			})]
		})
	});
}
SelectHelpText.displayName = "SelectHelpText";
//#endregion
exports.SelectHelpText = SelectHelpText;
