'use strict';

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

var _templateObject = _taggedTemplateLiteral(['\n  color: ', ';\n\n  &:active {\n    color: ', ';\n  }\n\n  &::after {\n    background: ', ';\n  }\n'], ['\n  color: ', ';\n\n  &:active {\n    color: ', ';\n  }\n\n  &::after {\n    background: ', ';\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);

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 color = (0, _themeGet2.default)('colors.primary.alternate');

var newTabIconStyles = (0, _styledComponents.css)(['&::before{content:"', '";font-family:', ';opacity:0;background:', ';position:absolute;right:0;z-index:1;transition:right 0.3s ease,opacity 0.2s ease;}&:hover::before{right:-1.5em;opacity:1;transition:right 0.3s ease,opacity 0.2s ease 0.1s;}'], (0, _icons2.default)('openInWindow'), (0, _themeGet2.default)('fonts.icon'), (0, _themeGet2.default)('colors.background.default'));

var ExternalTextAnchor = _styledComponents2.default.a.withConfig({
  displayName: 'ExternalTextAnchor'
})(['color:', ';font-family:', ';text-decoration:none;cursor:pointer;transition:all 0.2s ease;white-space:nowrap;position:relative;height:auto;margin:auto;&:focus{outline:none;}&:active{color:', ';}&::after{content:\'\';background:', ';border-radius:2em;height:1px;width:100%;position:absolute;bottom:-0.1em;left:0;transition:height 0.15s ease,width 0.15s ease,left 0.15s ease,opacity 0.25s ease;}&:hover::after,&:focus::after{height:calc(100% + 0.2em);width:calc(100% + 0.6em);left:-0.3em;opacity:0.125;transition:height 0.15s ease,width 0.15s ease,left 0.15s ease,opacity 0s ease;}', ';'], color, (0, _themeGet2.default)('fonts.brand'), (0, _themeGet2.default)('colors.primary.default'), color, function (_ref) {
  var newTab = _ref.newTab;
  return newTab ? newTabIconStyles : '';
});

var dangerColor = (0, _themeGet2.default)('colors.negative.default');

ExternalTextAnchor.Danger = ExternalTextAnchor.Negative = ExternalTextAnchor.extend(_templateObject, dangerColor, (0, _themeGet2.default)('colors.negative.dark'), dangerColor);

var positiveColor = (0, _themeGet2.default)('colors.positive.default');

ExternalTextAnchor.Positive = ExternalTextAnchor.extend(_templateObject, positiveColor, (0, _themeGet2.default)('colors.positive.dark'), positiveColor);

var darkColor = (0, _themeGet2.default)('colors.primary.dark');

ExternalTextAnchor.Dark = ExternalTextAnchor.extend(_templateObject, darkColor, (0, _themeGet2.default)('colors.primary.dark'), darkColor);

var invertedColor = (0, _themeGet2.default)('colors.text.inverted');

ExternalTextAnchor.Inverted = ExternalTextAnchor.extend(_templateObject, invertedColor, (0, _themeGet2.default)('colors.text.inverted'), invertedColor);

exports.default = ExternalTextAnchor;