"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _chunkYPB3YRAGcjs = require('./chunk-YPB3YRAG.cjs');


var _chunkDDGSFIWAcjs = require('./chunk-DDGSFIWA.cjs');


var _chunkWF7Z2VITcjs = require('./chunk-WF7Z2VIT.cjs');


var _chunkRSHN4K6Ncjs = require('./chunk-RSHN4K6N.cjs');


var _chunkOBHJBBPCcjs = require('./chunk-OBHJBBPC.cjs');

// src/components/Badge.tsx
var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);
var _jsxruntime = require('@emotion/react/jsx-runtime');
function Badge({
  content: contentProp,
  kind,
  icon,
  ml = 0,
  mr = 0,
  size = "sm",
  block = false,
  typography: typographyProp
}) {
  const defaultTypography = {
    type: (typographyProp == null ? void 0 : typographyProp.type) || "Label Moderate",
    size: (typographyProp == null ? void 0 : typographyProp.size) || "Small",
    color: (typographyProp == null ? void 0 : typographyProp.color) || (kind === "danger" ? "danger" : kind === "success" ? "white" : "text")
  };
  const nodesWithTypography = _chunkYPB3YRAGcjs.setDefaultReactNodesTypography.call(void 0, contentProp, {
    default: defaultTypography
  });
  const content = _chunkDDGSFIWAcjs.toReactNodes.call(void 0, nodesWithTypography);
  return contentProp ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, StyledBadge, { kind, ml, mr, size, block, children: [
    icon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
      _chunkWF7Z2VITcjs.Icon,
      {
        name: icon.name,
        width: 20,
        color: icon.color ? icon.color : kind === "danger" ? "danger" : kind === "success" ? "success" : void 0
      }
    ) : null,
    /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BadgeContent, { children: content })
  ] }) : null;
}
var badgeSmVPadding = 2;
var badgeSmHPadding = 6;
var StyledBadge = _styled2.default.div`
  ${({ size }) => _chunkRSHN4K6Ncjs.standardBorderRadius.call(void 0, size === "sm" ? 4 : 12)}
  ${({ ml }) => ml === 0 ? "" : `margin-left: ${ml}px;`}
  ${({ mr }) => mr === 0 ? "" : `margin-right: ${mr}px;`}

  display: ${({ block }) => block ? "flex" : "inline-flex"};
  gap: ${({ size }) => size === "sm" ? badgeSmHPadding : 12}px;
  align-items: center;
  padding: ${({ size }) => size === "sm" ? `${badgeSmVPadding}px ${badgeSmHPadding}px` : "12px 16px"};
  background-color: ${({ theme, kind }) => {
  if (kind === "danger") {
    return _chunkOBHJBBPCcjs.getColor.call(void 0, theme, "red42a10");
  } else if (kind === "success") {
    return _chunkOBHJBBPCcjs.getColor.call(void 0, theme, "success");
  } else {
    return _chunkOBHJBBPCcjs.getColor.call(void 0, theme, theme.badge.bg);
  }
}};
`;
var BadgeContent = _styled2.default.div``;




exports.Badge = Badge; exports.badgeSmVPadding = badgeSmVPadding;
