import styled, { css } from 'styled-components';
import { selectors } from '@defencedigital/design-tokens';
import { BUTTON_ICON_POSITION } from '../constants';
import { COMPONENT_SIZE } from '../../Forms';
var spacing = selectors.spacing;
export var StyledIconWrapper = styled.span.withConfig({
  displayName: "StyledIconWrapper",
  componentId: "sc-18oll3t-0"
})(["display:inline-flex;align-items:center;visibility:", ";", " ", ""], function (_ref) {
  var $isLoading = _ref.$isLoading;
  return $isLoading ? 'hidden' : 'initial';
}, function (_ref2) {
  var $buttonSize = _ref2.$buttonSize,
    $buttonHasText = _ref2.$buttonHasText;
  return $buttonSize === COMPONENT_SIZE.FORMS && !$buttonHasText && css(["padding:0 ", ";"], spacing('4'));
}, function (_ref3) {
  var $buttonHasText = _ref3.$buttonHasText,
    $iconPosition = _ref3.$iconPosition;
  return $buttonHasText && css(["margin-left:", ";margin-right:", ";"], $iconPosition === BUTTON_ICON_POSITION.RIGHT ? spacing('5') : '0', $iconPosition === BUTTON_ICON_POSITION.LEFT ? spacing('5') : '0');
});