'use strict';

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

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 }; }

var SIZE = exports.SIZE = '1.2em';

var AlertIcon = _styledComponents2.default.i.withConfig({
  displayName: 'AlertIcon'
})(['width:', ';height:', ';margin-right:1em;display:inline-block;&::before{content:', ';border-width:', ';border-style:solid;border-color:', ';background:', ';width:', ';height:', ';display:inline-block;line-height:', ';font-family:', ';text-align:center;border-radius:100%;font-size:calc(', ' - 0.3em);position:absolute;font-style:normal;}', ' > &{margin:0 1em 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'), function (props) {
  switch (props.type) {
    case 'success':
      return (0, _themeGet2.default)('colors.positive.default')(props);
    case 'error':
      return (0, _themeGet2.default)('colors.negative.default')(props);
    default:
      return (0, _themeGet2.default)('colors.primary.default')(props);
  }
}, (0, _themeGet2.default)('colors.background.default'), SIZE, SIZE, SIZE, (0, _themeGet2.default)('fonts.icon'), SIZE, _AlertBorder2.default);

exports.default = AlertIcon;