import { jsxs, jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { C as Card } from './Card-DSFuXUGk.js';
import { c as cx } from './index-De1g9FRV.js';

import './InteractiveCard.css';const styles = {
	"card-wrapper": "_card-wrapper_1ygty_4",
	"card-action": "_card-action_1ygty_16",
	"bg-stronger": "_bg-stronger_1ygty_32",
	"bg-strong": "_bg-strong_1ygty_32",
	"card-content": "_card-content_1ygty_43"
};

const InteractiveCard = forwardRef(
  (props, ref) => {
    const {
      wrapperProps,
      actionProps,
      contentProps = {},
      children,
      "data-interactive": dataInteractive
    } = props;
    const {
      "aria-label": ariaLabel,
      className: wrapperClassName,
      style: wrapperStyle,
      ...restWrapperProps
    } = wrapperProps;
    const { "aria-label": actionAriaLabel, ...restActionProps } = actionProps;
    const {
      padding = "medium",
      background,
      className: contentClassName,
      ...restContentProps
    } = contentProps;
    const actionClassNames = cx(styles["card-action"], {
      [styles[`bg-${background}`]]: !!background
    });
    const contentClassNames = cx(styles["card-content"], contentClassName);
    const wrapperClassNames = cx(styles["card-wrapper"], wrapperClassName);
    const isLink = "href" in restActionProps;
    return /* @__PURE__ */ jsxs(
      "div",
      {
        ...restWrapperProps,
        role: "group",
        "aria-label": ariaLabel,
        className: wrapperClassNames,
        style: wrapperStyle,
        ref,
        children: [
          isLink ? /* @__PURE__ */ jsx(
            "a",
            {
              ...restActionProps,
              "aria-label": actionAriaLabel,
              className: actionClassNames,
              "data-interactive": dataInteractive
            }
          ) : /* @__PURE__ */ jsx(
            "button",
            {
              ...restActionProps,
              "aria-label": actionAriaLabel,
              className: actionClassNames,
              "data-interactive": dataInteractive,
              type: "button"
            }
          ),
          /* @__PURE__ */ jsx(
            Card,
            {
              padding,
              className: contentClassNames,
              ...restContentProps,
              children
            }
          )
        ]
      }
    );
  }
);
InteractiveCard.displayName = "InteractiveCard";

export { InteractiveCard as I };
//# sourceMappingURL=InteractiveCard-CnW0m_F-.js.map
