"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.commonStyles = exports.getFocusState = exports.getBoxShadow = void 0;

var _styledComponents = require("styled-components");

var _focus = require("../../../mixins/focus");

var _spacing = require("../../../mixins/spacing");

var _stacking = require("../../../mixins/stacking");

var _stackee = require("../../../mixins/stackee");

var getBoxShadow = function getBoxShadow(props) {
  var themeProps = {
    theme: props.theme
  };

  if (props.isDarkMode) {
    return "".concat((0, _focus.darkModeBoxShadow)(themeProps));
  } // eslint-disable-next-line no-extra-boolean-cast


  if (!!props.insetFocus) {
    return "".concat((0, _focus.focusedBoxShadow)(themeProps), ", ").concat((0, _focus.focusedBorderShadow)({
      inset: true
    }), " ").concat((0, _focus.focusedBorderColor)(themeProps));
  }

  return "".concat((0, _focus.focusedBorderShadow)({
    inset: false
  }), " ").concat((0, _focus.focusedBorderColor)(themeProps), ", ").concat((0, _focus.focusedBoxShadow)(themeProps));
};

exports.getBoxShadow = getBoxShadow;

var getFocusState = function getFocusState(_ref) {
  var _ref$hasTransition = _ref.hasTransition,
      hasTransition = _ref$hasTransition === void 0 ? true : _ref$hasTransition;
  return hasTransition ? (0, _focus.getBaseFocusState)({}) : (0, _focus.getBaseFocusState)({
    baseTransition: false,
    hoverTransition: false
  });
};

exports.getFocusState = getFocusState;
var commonStyles = (0, _styledComponents.css)(["font:inherit;color:inherit;background:transparent;border:0;padding:0;line-height:1;text-align:inherit;border-radius:", ";", " ", "{box-shadow:", ";}", ";", ";", ";"], _focus.focusedBorderRadius, getFocusState, _focus.FOCUS_VISIBLE_SELECTOR, getBoxShadow, _spacing.getSpacingRules, _stacking.getStackedRules, _stackee.getStackeeRules);
exports.commonStyles = commonStyles;