/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../_virtual/_rolldown/runtime.cjs");
const require_components_client_SpringMotionConfig = require("./SpringMotionConfig.cjs");
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");
let motion_react = require("motion/react");
//#region src/components/client/AnimateHeightChange.tsx
const AnimateHeightChange = ({ children, reduceMotion, layoutVariant }) => {
	const ref = (0, react.useRef)(null);
	const [height, setHeight] = (0, react.useState)("auto");
	(0, react.useEffect)(() => {
		if (ref.current) {
			const observer = new ResizeObserver((entries) => {
				setHeight(entries[0].contentRect.height);
			});
			observer.observe(ref.current);
			return () => {
				observer.disconnect();
			};
		}
	}, []);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_SpringMotionConfig.SpringMotionConfig, {
		reducedMotion: reduceMotion,
		layoutSpeed: "4",
		layoutVariant,
		children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.m.div, {
			className: "overflow-hidden",
			style: {
				height,
				opacity: 0
			},
			animate: {
				height,
				opacity: 1
			},
			children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
				ref,
				children
			})
		})
	});
};
AnimateHeightChange.displayName = "AnimateHeightChange";
//#endregion
exports.AnimateHeightChange = AnimateHeightChange;
