"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getAnimation = exports.getBoxShadow = exports.getColor = exports.getBgColor = exports.getTabButtonFontSize = void 0;

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

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

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

var _color = require("../../../utils/color");

var getTabButtonFontSize = function getTabButtonFontSize(_ref) {
  var theme = _ref.theme;
  return (0, _typography.getFontSize)({
    theme: theme,
    fontSize: 'f1'
  });
};

exports.getTabButtonFontSize = getTabButtonFontSize;

var getBgColor = function getBgColor(_ref2) {
  var theme = _ref2.theme,
      selected = _ref2.selected;
  return (0, _branding.getPaletteColor)(selected ? 'greyscale-dark' : 'greyscale-light')({
    theme: theme
  });
};

exports.getBgColor = getBgColor;

var getColor = function getColor(_ref3) {
  var theme = _ref3.theme,
      selected = _ref3.selected;
  return (0, _branding.getPaletteColor)(selected ? 'white' : 'greyscale-black')({
    theme: theme
  });
};

exports.getColor = getColor;

var getBoxShadow = function getBoxShadow(_ref4) {
  var theme = _ref4.theme;
  return "0 3px 10px 0 ".concat((0, _color.fadeColor)((0, _branding.getPaletteColor)('greyscale-black')({
    theme: theme
  }), 0.95));
};

exports.getBoxShadow = getBoxShadow;
var fadeToRight = (0, _styledComponents.keyframes)(["0%{transform:translate(0);}"]);
var fadeToLeft = (0, _styledComponents.keyframes)(["0%{transform:translate(100%);}"]);

var getAnimation = function getAnimation(_ref5) {
  var selected = _ref5.selected,
      currentIndex = _ref5.currentIndex,
      prevTabIndex = _ref5.prevTabIndex;

  if (prevTabIndex == null || prevTabIndex === currentIndex) {
    return '';
  }

  var keyFrameName = currentIndex > prevTabIndex ? fadeToRight : fadeToLeft;

  if (selected) {
    return (0, _styledComponents.css)(["animation:", " ease 0.2s;animation-timing-function:cubic-bezier(0.645,0.045,0.355,1);animation-iteration-count:1;transform-origin:50% 50%;"], keyFrameName);
  }

  return '';
};

exports.getAnimation = getAnimation;