'use strict';

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

var _templateObject = _taggedTemplateLiteral(['\n  \n  ', ' > & {\n    margin: 0 5px auto 0;\n  }\n'], ['\n  \n  ', ' > & {\n    margin: 0 5px auto 0;\n  }\n']);

var _styledComponents = require('styled-components');

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _themeGet = require('../../../extensions/themeGet');

var _themeGet2 = _interopRequireDefault(_themeGet);

var _icons = require('../../Icon/icons');

var _icons2 = _interopRequireDefault(_icons);

var _AlertBorder = require('./AlertBorder');

var _AlertBorder2 = _interopRequireDefault(_AlertBorder);

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

function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

var SIZE = exports.SIZE = '31px';
var SMALL_SIZE = '18px';

var getAlertIcon = function getAlertIcon(size) {
  return _styledComponents2.default.i.withConfig({
    displayName: 'AlertIcon'
  })(['width:', ';height:', ';display:inline-block;border-color:inherit;&::before{content:', ';box-sizing:border-box;border-width:', ';border-style:solid;border-color:inherit;background:', ';width:', ';height:', ';display:inline-block;line-height:', ';font-family:', ';text-align:center;border-radius:100%;font-size:1em;position:absolute;font-style:normal;}', ' > &{margin:0 10px auto 0;flex:0 0 auto;}'], size, size, function (_ref) {
    var type = _ref.type;

    switch (type) {
      case 'success':
        return '"' + (0, _icons2.default)('checkmark') + '"';
      case 'error':
        return '"!"';
      default:
        return '"i"';
    }
  }, (0, _themeGet2.default)('thicknesses.normal'), (0, _themeGet2.default)('colors.background.default'), size, size, size, function (props) {
    switch (props.type) {
      case 'success':
        return (0, _themeGet2.default)('fonts.icon');
      case 'error':
      default:
        return (0, _themeGet2.default)('fonts.brand');
    }
  }, _AlertBorder2.default);
};

var AlertIcon = getAlertIcon(SIZE);
AlertIcon.Small = getAlertIcon(SMALL_SIZE).extend(_templateObject, _AlertBorder2.default.Small);

exports.default = AlertIcon;