"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _css2 = require("@emotion/css");

var _css3 = _interopRequireDefault(_css2);

var _core = require("@emotion/core");

var _react = require("react");

var _react2 = _interopRequireDefault(_react);

var _propTypes = require("prop-types");

var _propTypes2 = _interopRequireDefault(_propTypes);

var _presets = require("../../../utils/presets");

var _fontSizes = require("../../../theme/fontSizes");

var _fontSizes2 = _interopRequireDefault(_fontSizes);

var _fonts = require("../../../theme/fonts");

var _fonts2 = _interopRequireDefault(_fonts);

var _colors = require("../../../theme/colors");

var _colors2 = _interopRequireDefault(_colors);

var _badge = require("../../../theme/styles/badge");

var _tones = require("../../../theme/tones");

var _tones2 = _interopRequireDefault(_tones);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var baseStyle = _badge.styles.baseStyle,
    variantStyles = _badge.styles.variantStyles;
var VARIANTS = _badge.options.VARIANTS,
    TONES = _badge.options.TONES;

function Badge(_ref) {
  var children = _ref.children,
      label = _ref.label,
      _ref$variant = _ref.variant,
      variant = _ref$variant === void 0 ? "STATUS" : _ref$variant,
      _ref$tone = _ref.tone,
      tone = _ref$tone === void 0 ? "SUCCESS" : _ref$tone,
      rest = _objectWithoutProperties(_ref, ["children", "label", "variant", "tone"]);

  return (0, _core.jsx)("span", Object.assign({
    css:
    /*#__PURE__*/
    (0, _css3["default"])(_objectSpread({}, baseStyle({
      tone: tone
    }), {}, variantStyles[variant]), "label:Badge;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL2NvcmUvQmFkZ2UvQmFkZ2UuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBd0JNIiwiZmlsZSI6Ii4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL2NvcmUvQmFkZ2UvQmFkZ2UuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IGpzeCB9IGZyb20gXCJAZW1vdGlvbi9jb3JlXCJcbmltcG9ydCBSZWFjdCwgeyBGcmFnbWVudCB9IGZyb20gXCJyZWFjdFwiXG5pbXBvcnQgUHJvcFR5cGVzIGZyb20gXCJwcm9wLXR5cGVzXCJcblxuaW1wb3J0IHsgc3BhY2VzLCByYWRpdXMgfSBmcm9tIFw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QgQmFkZ2VcbiJdfQ== */"))
  }, rest), label ? label : children);
}

Badge.propTypes = {
  children: _propTypes2["default"].node,
  variant: _propTypes2["default"].oneOf(VARIANTS),
  tone: _propTypes2["default"].oneOf(TONES)
};
exports["default"] = Badge;