'use strict';

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

var styled = require('styled-components');
var index = require('../../utils/index.js');
var utils = require('./utils.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);

const LinkWrapper = styled__default['default'].a `
  display: ${({ type }) => (type === 'inline' ? 'inline-block' : 'block')};
  color: ${({ variant }) => variant && utils.getLinkColor(variant)};
  width: fit-content;
  ${({ size }) => size === 'small' ? index.getFontSize('size14') : index.getFontSize('size16')};
  font-weight: ${({ bold, theme }) => bold && theme.font.weightBold};
  text-decoration: ${({ underlined }) => (underlined ? 'underline' : 'none')};

  &:hover,
  &:active {
    text-decoration: ${({ underlined }) => (underlined ? 'none' : 'underline')};
  }

  &:focus-within,
  &:focus,
  &:focus-visible,
  &:active {
    outline: none;
    border-color: ${index.getColorAlias('focusOuter')};
    box-shadow: 0 0 0 2px ${index.getColorAlias('contentLinkDistinct')};
    border-radius: ${(props) => props.theme.radius.roundedA};
  }

  &:visited {
    color: ${index.getColorAlias('contentLinkVisited')};

    svg {
      fill: ${index.getColorAlias('contentLinkVisited')};
    }
  }
`;
const LinkContent = styled__default['default'].div.withConfig({
    shouldForwardProp: index.convertToTransientProps([
        'iconModifiers',
    ]),
}) `
  display: flex;
  align-items: center;
  flex-direction: ${({ iconModifiers }) => iconModifiers === 'leading' && 'row-reverse'};

  svg {
    fill: ${({ variant }) => variant && utils.getLinkColor(variant)};

    ${({ iconModifiers }) => iconModifiers === 'trailing'
    ? styled.css `
            margin: 0 0 0 ${index.getSpacing('s01')};
          `
    : styled.css `
            margin: 0 ${index.getSpacing('s01')} 0 0;
          `}
  }
`;

exports.LinkContent = LinkContent;
exports.LinkWrapper = LinkWrapper;
