'use strict';

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

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

var _styledComponents2 = _interopRequireDefault(_styledComponents);

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

var _themeGet2 = _interopRequireDefault(_themeGet);

var _cleanTag = require('clean-tag');

var _cleanTag2 = _interopRequireDefault(_cleanTag);

var _userSpacing = require('../../../extensions/userSpacing');

var _userSpacing2 = _interopRequireDefault(_userSpacing);

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

var fadeIn = (0, _styledComponents.keyframes)(['from{opacity:0;}to{opacity:1;}']);

var AlertBorder = (0, _styledComponents2.default)(_cleanTag2.default.div).attrs({
  spacing: _userSpacing2.default
}).withConfig({
  displayName: 'AlertBorder'
})(['font-weight:200;border-width:', ';border-style:solid;width:auto;font-size:14px;line-height:1.5em;letter-spacing:0.02em;margin:', ';animation:', ' 0.2s ease;transition:opacity 0.2s ease;background:', ';border-color:', ';color:', ';opacity:', ';'], (0, _themeGet2.default)('thicknesses.normal'), function (props) {
  return props.spacing;
}, fadeIn, function (_ref) {
  var theme = _ref.theme,
      type = _ref.type;

  switch (type) {
    case 'success':
      return (0, _themeGet2.default)('colors.positive.light');
    case 'error':
      return (0, _themeGet2.default)('colors.negative.light');
    default:
      return (0, _themeGet2.default)('colors.primary.light');
  }
}, function (_ref2) {
  var theme = _ref2.theme,
      type = _ref2.type;

  switch (type) {
    case 'success':
      return (0, _themeGet2.default)('colors.positive.border');
    case 'error':
      return (0, _themeGet2.default)('colors.negative.border');
    default:
      return (0, _themeGet2.default)('colors.primary.border');
  }
}, function (_ref3) {
  var theme = _ref3.theme,
      type = _ref3.type;

  switch (type) {
    case 'success':
      return (0, _themeGet2.default)('colors.positive.dark');
    case 'error':
      return (0, _themeGet2.default)('colors.negative.dark');
    default:
      return (0, _themeGet2.default)('colors.primary.dark');
  }
}, function (props) {
  return props.closing ? '0' : '1';
});

AlertBorder.Small = (0, _styledComponents2.default)(AlertBorder).withConfig({
  displayName: 'AlertBorder__Small'
})(['font-size:0.8em;font-weight:300;']);

exports.default = AlertBorder;