/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
require("../../../_virtual/_rolldown/runtime.cjs");
const require_styles_styler = require("../../../styles/styler.cjs");
const require_components_client_Pressable = require("../../client/Pressable.cjs");
const require_components_Icon = require("../../Icon.cjs");
const require_components_Text = require("../../Text.cjs");
const require_components_HStack = require("../../HStack.cjs");
const require_components_VStack = require("../../VStack.cjs");
const require_components_client_SpringMotionConfig = require("../../client/SpringMotionConfig.cjs");
let _yahoo_uds_icons = require("@yahoo/uds-icons");
let react_jsx_runtime = require("react/jsx-runtime");
let motion_react = require("motion/react");
//#region src/components/experimental/client/Accordion.tsx
function Accordion({ label, children, onClick, open, spacingHorizontal = "4", spacingVertical = "4", _content, className, textProps, endAction = null, ...props }) {
	return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_client_SpringMotionConfig.SpringMotionConfig, {
		layoutVariant: "smooth",
		layoutSpeed: "3",
		children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Pressable.Pressable, {
			asChild: true,
			display: "flex",
			flexDirection: "row",
			alignItems: "center",
			justifyContent: "space-between",
			spacingVertical,
			spacingHorizontal,
			borderRadius: "md",
			onClick,
			className: require_styles_styler.cx("hover:bg-secondary/80", "w-full", className),
			...props,
			children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
				variant: "title4",
				color: "primary",
				...textProps || {},
				children: label
			}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_HStack.HStack, {
				display: "flex",
				alignItems: "center",
				justifyContent: "space-between",
				columnGap: "2.5",
				children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(motion_react.AnimatePresence, {
					initial: false,
					children: [endAction && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.m.div, {
						onClick: (e) => e.stopPropagation(),
						children: endAction
					}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.m.div, {
						initial: "collapsed",
						animate: open ? "open" : "collapsed",
						exit: "collapsed",
						variants: {
							open: { rotate: 90 },
							collapsed: { rotate: 0 }
						},
						"data-testid": "chevron-motion",
						children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
							name: _yahoo_uds_icons.ChevronRight,
							variant: "fill",
							size: "sm",
							color: "primary"
						})
					}, "chevron")]
				})
			})] })
		}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.AnimatePresence, {
			initial: false,
			children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(motion_react.m.div, {
				initial: "collapsed",
				animate: open ? "open" : "collapsed",
				exit: "collapsed",
				variants: {
					open: { height: "auto" },
					collapsed: {
						height: 0,
						overflow: "hidden"
					}
				},
				children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_VStack.VStack, {
					spacingHorizontal,
					..._content,
					children
				})
			}, "content")
		})]
	});
}
Accordion.displayName = "Accordion";
//#endregion
exports.Accordion = Accordion;
