"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.linkStyles = exports.buttonStyles = exports.commonStyles = exports.getBorderColorActive = exports.getBorderColorHover = exports.getBorderColor = exports.getBorderRadius = void 0;

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

var _branding = require("../../../mixins/branding");

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

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

var _typography = require("../../../mixins/typography");

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

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var getBorderRadius = function getBorderRadius(_ref) {
  var theme = _ref.theme;
  return theme.buttonBorderRadius;
};

exports.getBorderRadius = getBorderRadius;

var getBorderColor = function getBorderColor(_ref2) {
  var hideBorder = _ref2.hideBorder,
      rest = _objectWithoutProperties(_ref2, ["hideBorder"]);

  return hideBorder ? 'transparent' : (0, _branding.getPaletteColor)('greyscale-light')(rest);
};

exports.getBorderColor = getBorderColor;

var getBorderColorHover = function getBorderColorHover(_ref3) {
  var hideBorder = _ref3.hideBorder,
      rest = _objectWithoutProperties(_ref3, ["hideBorder"]);

  return hideBorder ? 'transparent' : (0, _branding.getPaletteColor)('greyscale-medium')(rest);
};

exports.getBorderColorHover = getBorderColorHover;

var getBorderColorActive = function getBorderColorActive(_ref4) {
  var hideBorder = _ref4.hideBorder,
      rest = _objectWithoutProperties(_ref4, ["hideBorder"]);

  return hideBorder ? 'transparent' : (0, _branding.getPaletteColor)('greyscale-dark')(rest);
};

exports.getBorderColorActive = getBorderColorActive;
var commonStyles = (0, _styledComponents.css)(["&&{display:inline-block;min-width:80px;height:32px;border-width:1px;border-style:solid;border-radius:", ";background-color:", ";border-color:", ";color:", ";text-decoration:none;font-size:", ";font-family:", ";font-weight:", ";padding:0 15px;", "}", "{border-color:transparent;box-shadow:", ",", " ", ";}&[disabled]{color:", ";border-color:", ";}&&&{", "}", ";"], getBorderRadius, (0, _branding.getPaletteColor)('white'), getBorderColor, (0, _branding.getPaletteColor)('greyscale-dark'), _typography.getFontSize, _typography.getFontFamily, _typography.getFontWeight, (0, _focus.getBaseFocusState)({}), _focus.FOCUS_VISIBLE_SELECTOR, _focus.focusedBoxShadow, _focus.focusedBorderShadow, _focus.focusedBorderColor, (0, _branding.getPaletteColor)('greyscale-medium'), (0, _branding.getPaletteColor)('greyscale-light'), _spacing.getSpacingRules, _stackee.getStackeeRules);
exports.commonStyles = commonStyles;
var buttonStyles = (0, _styledComponents.css)(["line-height:100%;&:enabled:hover{border-color:", ";}&:enabled:active{color:", ";border-color:", ";}"], getBorderColorHover, (0, _branding.getPaletteColor)('greyscale-black'), getBorderColorActive);
exports.buttonStyles = buttonStyles;
var linkStyles = (0, _styledComponents.css)(["line-height:32px;text-align:center;text-decoration:none;&:hover{border-color:", ";}&:active{color:", ";border-color:", ";}"], getBorderColorHover, (0, _branding.getPaletteColor)('greyscale-black'), getBorderColorActive);
exports.linkStyles = linkStyles;