"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var BannerCard_exports = {};
__export(BannerCard_exports, {
  default: () => BannerCard
});
module.exports = __toCommonJS(BannerCard_exports);
var import_react = __toESM(require("react"));
var import_styled_components = __toESM(require("styled-components"));
var import_styles = require("../../../../styles");
var import_assets = require("../../../../assets");
var import_Text = __toESM(require("../../../asorted/Text"));
var import_cta = require("../../../cta");
var import_Tag = __toESM(require("../../../Tag"));
var import__ = require("../..");
function BannerCard({
  title,
  cta,
  description,
  descriptionWidth,
  tag,
  image,
  onClick,
  onClose,
  ...boxProps
}) {
  const handleClose = (event) => {
    event.stopPropagation();
    onClose == null ? void 0 : onClose(event);
  };
  const handleClick = (event) => {
    event.stopPropagation();
    onClick(event);
  };
  return /* @__PURE__ */ import_react.default.createElement(Wrapper, { ...boxProps, image, tag, onClick: handleClick }, tag && /* @__PURE__ */ import_react.default.createElement(StyledTag, null, tag), /* @__PURE__ */ import_react.default.createElement(Title, null, title), description && /* @__PURE__ */ import_react.default.createElement(Desc, { maxWidth: descriptionWidth }, description), /* @__PURE__ */ import_react.default.createElement(import__.Flex, { columnGap: 5 }, cta), onClose && /* @__PURE__ */ import_react.default.createElement(import_styles.StyleProvider, { selectedPalette: "dark" }, /* @__PURE__ */ import_react.default.createElement(CloseButton, { "data-testid": "portfolio-card-close-button", onClick: handleClose })));
}
const StyledTag = (0, import_styled_components.default)(import_Tag.default).attrs({ size: "medium", type: "plain", active: true })`
  font-size: 11px;
  background-color: ${(p) => p.theme.colors.primary.c80};
`;
const Title = (0, import_styled_components.default)(import_Text.default).attrs({ variant: "h4Inter" })`
  font-family: Inter;
  font-size: 24px;
  font-weight: 600;
`;
const Desc = (0, import_styled_components.default)(import_Text.default).attrs({ variant: "small", color: "neutral.c70" })`
  font-family: Inter;
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
  padding-bottom: 8px;
`;
const Wrapper = (0, import_styled_components.default)(import__.Flex)`
  background-color: ${(p) => p.theme.colors.background.card};
  background-image: ${(p) => p.image ? `url("${p.image}")` : "none"};
  background-position: right center;
  background-repeat: no-repeat;
  background-size: 50% auto;

  cursor: pointer;
  padding: 16px;
  padding-top: ${(p) => p.tag ? "16px" : "24px"};
  padding-right: 50%;

  position: relative;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 4px;
`;
const CloseButton = (0, import_styled_components.default)(import_cta.Button).attrs({
  Icon: /* @__PURE__ */ import_react.default.createElement(import_assets.Icons.Close, { size: "XS" }),
  iconButton: true,
  outline: true
})`
  background-color: ${(p) => p.theme.colors.neutral.c30};
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  svg {
    width: 12px;
    height: 12px;
  }
`;
//# sourceMappingURL=index.js.map
