import { a as IconSize, n as AnalyticsId } from "../../constants2.js";
import { t as usePseudoClasses } from "../../usePseudoClasses.js";
import { n as mergeRefs, t as isMutableRefObject } from "../../refs.js";
import { t as Icon_default } from "../../Icon.js";
import { n as getAriaLabelAttributes } from "../../accessibility.js";
import { t as ChevronDown_default } from "../../ChevronDown.js";
import { t as ChevronUp_default } from "../../ChevronUp.js";
import { t as useExpand } from "../../useExpand.js";
import { t as HelpDetails_default } from "../../HelpDetails.js";
import { t as HelpTriggerStandalone_default } from "../../HelpTriggerStandalone.js";
import { jsx, jsxs } from "react/jsx-runtime";
import styles from "./styles.module.scss";
var HelpExpanderStandalone = (props) => {
	const { ariaLabel, ariaLabelledById, children, className, expanded = false, onExpand, testId, triggerText, weight = "normal", ref } = props;
	const ariaLabelAttributes = getAriaLabelAttributes({
		label: ariaLabel,
		id: ariaLabelledById
	});
	const [isExpanded, setIsExpanded] = useExpand(expanded, onExpand);
	const { refObject, isHovered } = usePseudoClasses(isMutableRefObject(ref) ? ref : null);
	return /* @__PURE__ */ jsxs("div", {
		className,
		"data-testid": testId,
		"data-analyticsid": AnalyticsId.HelpExpanderStandalone,
		children: [/* @__PURE__ */ jsxs(HelpTriggerStandalone_default, {
			className: styles["help-expander-standalone-trigger"],
			"aria-expanded": isExpanded,
			onClick: () => setIsExpanded(!isExpanded),
			ref: mergeRefs([ref, refObject]),
			weight,
			...ariaLabelAttributes,
			children: [triggerText, /* @__PURE__ */ jsx(Icon_default, {
				color: `var(--core-color-plum-${isHovered ? "900" : "700"})`,
				svgIcon: isExpanded ? ChevronUp_default : ChevronDown_default,
				size: IconSize.XXSmall
			})]
		}), isExpanded && /* @__PURE__ */ jsx(HelpDetails_default, { children })]
	});
};
HelpExpanderStandalone.displayName = "HelpExpanderStandalone";
var HelpExpanderStandalone_default = HelpExpanderStandalone;
export { HelpExpanderStandalone_default as default };

//# sourceMappingURL=index.js.map