'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 _icons = require('../../Icon/icons');

var _icons2 = _interopRequireDefault(_icons);

var _sharedStyles = require('./sharedStyles');

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

var color = (0, _themeGet2.default)('colors.primary.alternate');

var focusBeforeStyles = (0, _styledComponents.css)(['right:-1.5em;opacity:1;transition:right 0.3s ease,opacity 0.2s ease 0.1s;']);

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{', '}'], (0, _icons2.default)('openInWindow'), (0, _themeGet2.default)('fonts.icon'), (0, _themeGet2.default)('colors.background.default'), function (_ref) {
  var appearFocused = _ref.appearFocused;
  return appearFocused ? focusBeforeStyles : '';
}, focusBeforeStyles);

var ExternalTextAnchor = _styledComponents2.default.a.withConfig({
  displayName: 'ExternalTextAnchor'
})(['', ' ', ';'], _sharedStyles.base, function (_ref2) {
  var newTab = _ref2.newTab,
      disabled = _ref2.disabled;
  return newTab && !disabled ? newTabIconStyles : '';
});

ExternalTextAnchor.Negative = (0, _styledComponents2.default)(ExternalTextAnchor).withConfig({
  displayName: 'ExternalTextAnchor__Negative'
})(['', ';'], _sharedStyles.negative);
ExternalTextAnchor.Danger = ExternalTextAnchor.Negative;

ExternalTextAnchor.Positive = (0, _styledComponents2.default)(ExternalTextAnchor).withConfig({
  displayName: 'ExternalTextAnchor__Positive'
})(['', ';'], _sharedStyles.positive);

ExternalTextAnchor.Dark = (0, _styledComponents2.default)(ExternalTextAnchor).withConfig({
  displayName: 'ExternalTextAnchor__Dark'
})(['', ';'], _sharedStyles.dark);

ExternalTextAnchor.Inverted = (0, _styledComponents2.default)(ExternalTextAnchor).withConfig({
  displayName: 'ExternalTextAnchor__Inverted'
})(['', ';'], _sharedStyles.inverted);

exports.default = ExternalTextAnchor;