"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getColor = exports.getOutlineColor = exports.getPaletteColor = void 0;

var getPaletteColor = function getPaletteColor(colorNameKey) {
  return function (_ref) {
    var theme = _ref.theme;
    return colorNameKey ? theme.colorPalette[colorNameKey] : '';
  };
};

exports.getPaletteColor = getPaletteColor;

var getOutlineColor = function getOutlineColor(theme) {
  return getPaletteColor('greyscale-light')({
    theme: theme
  });
};
/**
 * This is a stub! It does not offer full colour support
 * Please upgrade your micro-app to v.3.x to have full colour support
 * Instead, use `getPaletteColor` with one of ColorPaletteColorNameKey
 */
// $FlowFixMe


exports.getOutlineColor = getOutlineColor;

var getColor = function getColor(theme, variant, mode) {
  var fade = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;

  switch (variant) {
    case 'primary':
      return getPaletteColor(fade === null ? 'brand-primary-base' : 'brand-primary-dark')({
        theme: theme
      });

    case 'secondary':
      return getPaletteColor(fade === null ? 'brand-secondary-base' : 'brand-secondary-dark')({
        theme: theme
      });

    default:
      return getPaletteColor('greyscale-black')({
        theme: theme
      });
  }
};

exports.getColor = getColor;