var _StyledBadgeSizeMap, _StyledBadgePillMap, _BADGE_COLOR$NEUTRAL, _BADGE_COLOR$ACTION, _BADGE_COLOR$SUCCESS, _BADGE_COLOR$WARNING, _BADGE_COLOR$DANGER, _BADGE_COLOR$SUPA, _BADGE_COLOR$SUPB, _BADGE_COLOR$SUPC, _BADGE_COLOR$SUPD, _BADGE_COLOR$SUPE, _BADGE_COLOR$SUPF, _StyledBadgeColorVari;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
import { selectors } from '@defencedigital/design-tokens';
import styled, { css } from 'styled-components';
import { BADGE_COLOR, BADGE_COLOR_VARIANT, BADGE_SIZE, BADGE_VARIANT } from '../constants';
var color = selectors.color,
  fontSize = selectors.fontSize,
  shadow = selectors.shadow,
  spacing = selectors.spacing;
var StyledBadgeSizeMap = (_StyledBadgeSizeMap = {}, _defineProperty(_StyledBadgeSizeMap, BADGE_SIZE.XSMALL, css(["font-size:", ";font-weight:700;line-height:1.4;padding:", " ", ";"], fontSize('xs'), spacing('px'), spacing('2'))), _defineProperty(_StyledBadgeSizeMap, BADGE_SIZE.SMALL, css(["font-size:", ";font-weight:700;line-height:1.4;padding:", " ", ";"], fontSize('s'), spacing('1'), spacing('2'))), _defineProperty(_StyledBadgeSizeMap, BADGE_SIZE.REGULAR, css(["font-size:", ";font-weight:600;line-height:1.3;padding:", " ", ";"], fontSize('base'), spacing('1'), spacing('2'))), _defineProperty(_StyledBadgeSizeMap, BADGE_SIZE.LARGE, css(["font-size:", ";font-weight:600;line-height:1.3;padding:", " ", ";"], fontSize('base'), spacing('2'), spacing('3'))), _defineProperty(_StyledBadgeSizeMap, BADGE_SIZE.XLARGE, css(["font-size:", ";font-weight:600;line-height:1.3;padding:", " ", ";"], fontSize('m'), spacing('2'), spacing('3'))), _StyledBadgeSizeMap);
var StyledBadgePillMap = (_StyledBadgePillMap = {}, _defineProperty(_StyledBadgePillMap, BADGE_SIZE.XSMALL, css(["padding:", " ", ";"], spacing('px'), spacing('2'))), _defineProperty(_StyledBadgePillMap, BADGE_SIZE.SMALL, css(["padding:", " ", ";"], spacing('1'), spacing('3'))), _defineProperty(_StyledBadgePillMap, BADGE_SIZE.REGULAR, css(["padding:", " ", ";"], spacing('1'), spacing('4'))), _defineProperty(_StyledBadgePillMap, BADGE_SIZE.LARGE, css(["padding:", " ", ";"], spacing('2'), spacing('4'))), _defineProperty(_StyledBadgePillMap, BADGE_SIZE.XLARGE, css(["padding:", " ", ";"], spacing('2'), spacing('4'))), _StyledBadgePillMap);
var StyledBadgeColorVariantMap = (_StyledBadgeColorVari = {}, _defineProperty(_StyledBadgeColorVari, BADGE_COLOR.NEUTRAL, (_BADGE_COLOR$NEUTRAL = {}, _defineProperty(_BADGE_COLOR$NEUTRAL, BADGE_COLOR_VARIANT.FADED, css(["background-color:", ";color:", ";text-shadow:", ";"], color('neutral', '100'), color('neutral', '400'), shadow('0'))), _defineProperty(_BADGE_COLOR$NEUTRAL, BADGE_COLOR_VARIANT.SOLID, css(["background-color:", ";color:", ";text-shadow:", ";"], color('neutral', '500'), color('neutral', 'white'), shadow('1'))), _BADGE_COLOR$NEUTRAL)), _defineProperty(_StyledBadgeColorVari, BADGE_COLOR.ACTION, (_BADGE_COLOR$ACTION = {}, _defineProperty(_BADGE_COLOR$ACTION, BADGE_COLOR_VARIANT.FADED, css(["background-color:", ";color:", ";text-shadow:", ";"], color('action', '100'), color('action', '700'), shadow('0'))), _defineProperty(_BADGE_COLOR$ACTION, BADGE_COLOR_VARIANT.SOLID, css(["background-color:", ";color:", ";text-shadow:", ";"], color('action', '600'), color('neutral', 'white'), shadow('1'))), _BADGE_COLOR$ACTION)), _defineProperty(_StyledBadgeColorVari, BADGE_COLOR.SUCCESS, (_BADGE_COLOR$SUCCESS = {}, _defineProperty(_BADGE_COLOR$SUCCESS, BADGE_COLOR_VARIANT.FADED, css(["background-color:", ";color:", ";text-shadow:", ";"], color('success', '100'), color('success', '800'), shadow('0'))), _defineProperty(_BADGE_COLOR$SUCCESS, BADGE_COLOR_VARIANT.SOLID, css(["background-color:", ";color:", ";text-shadow:", ";"], color('success', '800'), color('neutral', 'white'), shadow('1'))), _BADGE_COLOR$SUCCESS)), _defineProperty(_StyledBadgeColorVari, BADGE_COLOR.WARNING, (_BADGE_COLOR$WARNING = {}, _defineProperty(_BADGE_COLOR$WARNING, BADGE_COLOR_VARIANT.FADED, css(["background-color:", ";color:", ";text-shadow:", ";"], color('warning', '000'), color('warning', '800'), shadow('0'))), _defineProperty(_BADGE_COLOR$WARNING, BADGE_COLOR_VARIANT.SOLID, css(["background-color:", ";color:", ";text-shadow:", ";"], color('warning', '300'), color('warning', '800'), shadow('0'))), _BADGE_COLOR$WARNING)), _defineProperty(_StyledBadgeColorVari, BADGE_COLOR.DANGER, (_BADGE_COLOR$DANGER = {}, _defineProperty(_BADGE_COLOR$DANGER, BADGE_COLOR_VARIANT.FADED, css(["background-color:", ";color:", ";text-shadow:", ";"], color('danger', '100'), color('danger', '800'), shadow('0'))), _defineProperty(_BADGE_COLOR$DANGER, BADGE_COLOR_VARIANT.SOLID, css(["background-color:", ";color:", ";text-shadow:", ";"], color('danger', '700'), color('neutral', 'white'), shadow('1'))), _BADGE_COLOR$DANGER)), _defineProperty(_StyledBadgeColorVari, BADGE_COLOR.SUPA, (_BADGE_COLOR$SUPA = {}, _defineProperty(_BADGE_COLOR$SUPA, BADGE_COLOR_VARIANT.FADED, css(["background-color:", ";color:", ";text-shadow:", ";"], color('supa', '000'), color('supa', '600'), shadow('0'))), _defineProperty(_BADGE_COLOR$SUPA, BADGE_COLOR_VARIANT.SOLID, css(["background-color:", ";color:", ";text-shadow:", ";"], color('supa', '600'), color('neutral', 'white'), shadow('1'))), _BADGE_COLOR$SUPA)), _defineProperty(_StyledBadgeColorVari, BADGE_COLOR.SUPB, (_BADGE_COLOR$SUPB = {}, _defineProperty(_BADGE_COLOR$SUPB, BADGE_COLOR_VARIANT.FADED, css(["background-color:", ";color:", ";text-shadow:", ";"], color('supb', '100'), color('supb', '600'), shadow('0'))), _defineProperty(_BADGE_COLOR$SUPB, BADGE_COLOR_VARIANT.SOLID, css(["background-color:", ";color:", ";text-shadow:", ";"], color('supb', '600'), color('neutral', 'white'), shadow('1'))), _BADGE_COLOR$SUPB)), _defineProperty(_StyledBadgeColorVari, BADGE_COLOR.SUPC, (_BADGE_COLOR$SUPC = {}, _defineProperty(_BADGE_COLOR$SUPC, BADGE_COLOR_VARIANT.FADED, css(["background-color:", ";color:", ";text-shadow:", ";"], color('supc', '100'), color('supc', '800'), shadow('0'))), _defineProperty(_BADGE_COLOR$SUPC, BADGE_COLOR_VARIANT.SOLID, css(["background-color:", ";color:", ";text-shadow:", ";"], color('supc', '700'), color('neutral', 'white'), shadow('1'))), _BADGE_COLOR$SUPC)), _defineProperty(_StyledBadgeColorVari, BADGE_COLOR.SUPD, (_BADGE_COLOR$SUPD = {}, _defineProperty(_BADGE_COLOR$SUPD, BADGE_COLOR_VARIANT.FADED, css(["background-color:", ";color:", ";text-shadow:", ";"], color('supd', '100'), color('supd', '800'), shadow('0'))), _defineProperty(_BADGE_COLOR$SUPD, BADGE_COLOR_VARIANT.SOLID, css(["background-color:", ";color:", ";text-shadow:", ";"], color('supd', '700'), color('neutral', 'white'), shadow('1'))), _BADGE_COLOR$SUPD)), _defineProperty(_StyledBadgeColorVari, BADGE_COLOR.SUPE, (_BADGE_COLOR$SUPE = {}, _defineProperty(_BADGE_COLOR$SUPE, BADGE_COLOR_VARIANT.FADED, css(["background-color:", ";color:", ";text-shadow:", ";"], color('supe', '200'), color('supe', '800'), shadow('0'))), _defineProperty(_BADGE_COLOR$SUPE, BADGE_COLOR_VARIANT.SOLID, css(["background-color:", ";color:", ";text-shadow:", ";"], color('supe', '800'), color('neutral', 'white'), shadow('1'))), _BADGE_COLOR$SUPE)), _defineProperty(_StyledBadgeColorVari, BADGE_COLOR.SUPF, (_BADGE_COLOR$SUPF = {}, _defineProperty(_BADGE_COLOR$SUPF, BADGE_COLOR_VARIANT.FADED, css(["background-color:", ";color:", ";text-shadow:", ";"], color('supf', '200'), color('supf', '800'), shadow('1'))), _defineProperty(_BADGE_COLOR$SUPF, BADGE_COLOR_VARIANT.SOLID, css(["background-color:", ";color:", ";text-shadow:", ";"], color('supf', '700'), color('neutral', 'white'), shadow('1'))), _BADGE_COLOR$SUPF)), _StyledBadgeColorVari);
export var StyledBadge = styled.span.withConfig({
  displayName: "StyledBadge",
  componentId: "sc-1ce3jdw-0"
})(["display:inline-block;vertical-align:middle;white-space:nowrap;border-radius:", ";", ""], function (_ref) {
  var $variant = _ref.$variant;
  return $variant === BADGE_VARIANT.PILL ? '100px' : '2px';
}, function (_ref2) {
  var $color = _ref2.$color,
    $colorVariant = _ref2.$colorVariant,
    $size = _ref2.$size,
    $variant = _ref2.$variant;
  return css(["", " ", " ", ""], StyledBadgeSizeMap[$size], StyledBadgeColorVariantMap[$color][$colorVariant], $variant === BADGE_VARIANT.PILL && StyledBadgePillMap[$size]);
});