"use client";
import { t as e } from "../../chunks/clsx.js";
import { ElasticHeight as t } from "../ElasticHeight.js";
import { Button as n } from "../buttons/Button.js";
import { Card as r } from "./Card.js";
import { CardBackground as i } from "./CardBackground.js";
import { HeadingGroup as a } from "../heading/HeadingGroup.js";
import { Tag as o } from "../Tag.js";
import { Clickable as s } from "../Clickable.js";
import { createElement as c, useState as l } from "react";
import { jsx as u, jsxs as d } from "react/jsx-runtime";
//#region lib/ui/cards/ExpandableCard.tsx
var f = ({ children: f, className: p, hLevel: m = 3, image: h, onClick: g, subtitle: _, tags: v, title: y, component: b = "article", ...x }) => {
	let S = !!y, [C, w] = l(!1);
	return /* @__PURE__ */ d(r, {
		component: b,
		"data-name": "ExpandableCard",
		"data-testid": "expandable-card",
		...x,
		className: e({ "border-t-0": h?.src }, p),
		"data-open": C,
		children: [/* @__PURE__ */ u(s, {
			className: "group relative -m-1 block aspect-horizontal overflow-hidden rounded-16 text-start",
			"data-testid": "expandable-card-clickable",
			onClick: () => {
				g?.(!C), w(!C);
			},
			children: /* @__PURE__ */ d(i, {
				...h || {},
				children: [!!v?.length && /* @__PURE__ */ u("div", {
					className: "flex flex-wrap gap-4 self-start p-20",
					children: v?.map((e) => /* @__PURE__ */ c(o, {
						...e,
						key: e.label
					}))
				}), /* @__PURE__ */ d("div", {
					className: e("mt-auto flex justify-between gap-x-8 p-20", { "text-white": h?.src }),
					children: [S && /* @__PURE__ */ u(a, {
						subtitle: _,
						level: m,
						children: y
					}), /* @__PURE__ */ u(n, {
						component: "span",
						className: "!transition duration-500",
						color: h?.src ? "white" : "black",
						icon: "ArrowDefaultDown",
						style: { rotate: C ? "-180deg" : "0deg" },
						tabIndex: -1,
						theme: "outline",
						variant: "circle"
					})]
				})]
			})
		}), /* @__PURE__ */ u(t, {
			isExpanded: C,
			children: f
		})]
	});
};
//#endregion
export { f as ExpandableCard };

//# sourceMappingURL=ExpandableCard.js.map