var _BORDER_RADIUS, _BORDER_WIDTH, _SECONDARY_BORDER_WID;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
import styled, { css } from 'styled-components';
import { selectors } from '@defencedigital/design-tokens';
import { COMPONENT_SIZE } from '../../components/Forms';
var color = selectors.color;

// Note: These are used with box shadows rather than borders, and for box
// shadows the values are taken to the inner edge of the shadow (rather
// than the outer edge for borders). To get the value that would be used
// with a normal border, the border width should be added to the radius
// value.
export var BORDER_RADIUS = (_BORDER_RADIUS = {}, _defineProperty(_BORDER_RADIUS, COMPONENT_SIZE.SMALL, '8px'), _defineProperty(_BORDER_RADIUS, COMPONENT_SIZE.FORMS, '12px'), _BORDER_RADIUS);
export var BORDER_WIDTH = (_BORDER_WIDTH = {}, _defineProperty(_BORDER_WIDTH, COMPONENT_SIZE.SMALL, '2px'), _defineProperty(_BORDER_WIDTH, COMPONENT_SIZE.FORMS, '3px'), _BORDER_WIDTH);
var SECONDARY_BORDER_WIDTH = (_SECONDARY_BORDER_WID = {}, _defineProperty(_SECONDARY_BORDER_WID, COMPONENT_SIZE.SMALL, '4px'), _defineProperty(_SECONDARY_BORDER_WID, COMPONENT_SIZE.FORMS, '6px'), _SECONDARY_BORDER_WID);
export var StyledOuterWrapper = styled.div.withConfig({
  displayName: "StyledOuterWrapper",
  componentId: "sc-7llhod-0"
})(["", ""], function (_ref) {
  var $hasFocus = _ref.$hasFocus,
    $isDisabled = _ref.$isDisabled,
    $isInvalid = _ref.$isInvalid,
    _ref$$size = _ref.$size,
    $size = _ref$$size === void 0 ? COMPONENT_SIZE.FORMS : _ref$$size;
  var defaults = css(["background-color:", ";border:none;border-radius:", ";box-shadow:0 0 0 1px ", ";transition:border-color 350ms cubic-bezier(0.4,0,0.2,1) 0ms,box-shadow 350ms cubic-bezier(0.4,0,0.2,1) 0ms;"], color('neutral', 'white'), BORDER_RADIUS[$size], color('neutral', '200'));
  if ($hasFocus) {
    return css(["", ";box-shadow:0 0 0 ", " ", ",0 0 0 ", " ", ";"], defaults, BORDER_WIDTH[$size], color('action', '500'), SECONDARY_BORDER_WIDTH[$size], color('action', '100'));
  }
  if ($isDisabled) {
    return css(["", ";background-color:", ";box-shadow:unset;*{cursor:not-allowed;}"], defaults, color('neutral', '000'));
  }
  if ($isInvalid) {
    return css(["", ";box-shadow:0 0 0 ", " ", ";"], defaults, BORDER_WIDTH[$size], color('danger', '800'));
  }
  return defaults;
});