var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import * as React from "react";
import { cn } from "@utils";
import { cardVariants, cardHeaderVariants, cardBodyVariants, cardFooterVariants } from "./cardVariants";
import { CTAGroup } from "../ctaGroup";
/**
 * Card component with optional header, body, and footer
 *
 * @example
 * ```tsx
 * <Card>
 *   <CardHeader title="Card Title" />
 *   <CardBody>Card content goes here</CardBody>
 *   <CardFooter>Footer content</CardFooter>
 * </Card>
 * ```
 */
export const Card = React.forwardRef((_a, ref) => {
    var { className, children } = _a, props = __rest(_a, ["className", "children"]);
    return (_jsx("div", Object.assign({ ref: ref, className: cn(cardVariants(), className) }, props, { children: children })));
});
Card.displayName = "Card";
/**
 * Card header component
 *
 * @example
 * ```tsx
 * <CardHeader title="Card Title" />
 * ```
 */
export const CardHeader = React.forwardRef((_a, ref) => {
    var { className, title, children, ctaGroupProps } = _a, props = __rest(_a, ["className", "title", "children", "ctaGroupProps"]);
    return (_jsxs("header", Object.assign({ ref: ref, className: cn(cardHeaderVariants(), className), "data-testid": "cardHeader" }, props, { children: [title && _jsx("div", { className: "font-medium", children: title }), children, ctaGroupProps && _jsx(CTAGroup, Object.assign({}, ctaGroupProps))] })));
});
CardHeader.displayName = "CardHeader";
/**
 * Card body component
 *
 * @example
 * ```tsx
 * <CardBody>Card content goes here</CardBody>
 * ```
 */
export const CardBody = React.forwardRef((_a, ref) => {
    var { className, children } = _a, props = __rest(_a, ["className", "children"]);
    if (!children) {
        return null;
    }
    return (_jsx("div", Object.assign({ ref: ref, className: cn(cardBodyVariants(), className), "data-testid": "cardBody" }, props, { children: children })));
});
CardBody.displayName = "CardBody";
/**
 * Card footer component
 *
 * @example
 * ```tsx
 * <CardFooter>Footer content</CardFooter>
 * ```
 */
export const CardFooter = React.forwardRef((_a, ref) => {
    var { className, children } = _a, props = __rest(_a, ["className", "children"]);
    if (!children) {
        return null;
    }
    return (_jsx("footer", Object.assign({ ref: ref, className: cn(cardFooterVariants(), className), "data-testid": "cardFooter" }, props, { children: children })));
});
CardFooter.displayName = "CardFooter";
//# sourceMappingURL=card.js.map