"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

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

var _react = _interopRequireDefault(require("react"));

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

var _ = require("../../..");

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

var SwatchSection = (0, _styledComponents["default"])(_.Box).withConfig({
  displayName: "SwatchSection",
  componentId: "sc-19un633-0"
})(["flex:", ";height:", ";border-radius:", ";border:", ";"], function (props) {
  return props.flex;
}, function (props) {
  return props.height;
}, function (props) {
  return props.borderRadius ? props.borderRadius : '10px';
}, function (props) {
  return props.borderColor ? "2px solid ".concat(props.borderColor) : undefined;
});
var UpperSpan = (0, _styledComponents["default"])(_.Span).withConfig({
  displayName: "UpperSpan",
  componentId: "sc-19un633-1"
})(["padding-top:10px;padding-bottom:2px;font-size:12px;"]);
var LowerSpan = (0, _styledComponents["default"])(_.Span).withConfig({
  displayName: "LowerSpan",
  componentId: "sc-19un633-2"
})(["padding-bottom:", ";"], function (props) {
  return props.paddingBottom;
});

var ColorName = function ColorName(_ref) {
  var _ref$diffColor = _ref.diffColor,
      diffColor = _ref$diffColor === void 0 ? false : _ref$diffColor,
      name = _ref.name,
      code = _ref.code,
      label = _ref.label,
      paddingBottom = _ref.paddingBottom;
  var colorName = diffColor ? 'greyscale-dark' : name;
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(UpperSpan, {
    bold: true,
    colorName: colorName
  }, code.toUpperCase()), /*#__PURE__*/_react["default"].createElement(LowerSpan, {
    paddingBottom: paddingBottom,
    bold: true,
    fontSize: "f1",
    colorName: colorName
  }, label == null ? name : label));
};

var LowerBox = (0, _styledComponents["default"])(_.Box).withConfig({
  displayName: "LowerBox",
  componentId: "sc-19un633-3"
})(["margin-right:-10px;border-radius:5px;border:2px solid ", ";"], function (props) {
  return props.borderColor;
});
var BigBox = (0, _styledComponents["default"])(_.Box).withConfig({
  displayName: "BigBox",
  componentId: "sc-19un633-4"
})(["height:425px;"]);
var AaBox = (0, _styledComponents["default"])(_.Box).withConfig({
  displayName: "AaBox",
  componentId: "sc-19un633-5"
})(["flex:1;padding-top:95px;"]);
var AaSpan = (0, _styledComponents["default"])(_.Span).withConfig({
  displayName: "AaSpan",
  componentId: "sc-19un633-6"
})(["padding-top:", ";"], function (props) {
  return props.paddingTop;
});
var BasicGridItem = (0, _styledComponents.withTheme)(function (_ref2) {
  var theme = _ref2.theme;
  return /*#__PURE__*/_react["default"].createElement(_.GridItem, {
    sm: 4,
    xl: 3
  }, /*#__PURE__*/_react["default"].createElement(_.SectionHeader, null, "Basics"), /*#__PURE__*/_react["default"].createElement(SwatchSection, {
    height: "500px",
    borderColor: theme.colorPalette['greyscale-light'],
    colorName: "background"
  }, /*#__PURE__*/_react["default"].createElement(_.Box, {
    stacked: "column",
    justify: "end",
    align: "end",
    spacing: ['pt1', 'pr3', 'pb2']
  }, /*#__PURE__*/_react["default"].createElement(ColorName, {
    diffColor: true,
    code: theme.colorPalette['greyscale-dark'],
    name: "background"
  })), /*#__PURE__*/_react["default"].createElement(BigBox, {
    stacked: "row"
  }, /*#__PURE__*/_react["default"].createElement(SwatchSection, {
    height: "410px",
    flex: 3,
    borderColor: theme.colorPalette['greyscale-light'],
    colorName: "white",
    spacing: ['ml1']
  }, /*#__PURE__*/_react["default"].createElement(_.Box, {
    stacked: "column",
    justify: "end",
    align: "end",
    spacing: ['pr2']
  }, /*#__PURE__*/_react["default"].createElement(ColorName, {
    paddingBottom: "30px",
    diffColor: true,
    code: theme.colorPalette.white,
    name: "white"
  }), /*#__PURE__*/_react["default"].createElement(ColorName, {
    paddingBottom: "10px",
    code: theme.colorPalette['greyscale-black'],
    name: "greyscale-black"
  }), /*#__PURE__*/_react["default"].createElement(ColorName, {
    paddingBottom: "10px",
    code: theme.colorPalette['greyscale-darker'],
    name: "greyscale-darker"
  }), /*#__PURE__*/_react["default"].createElement(ColorName, {
    paddingBottom: "10px",
    code: theme.colorPalette['greyscale-dark'],
    name: "greyscale-dark"
  }), /*#__PURE__*/_react["default"].createElement(ColorName, {
    paddingBottom: "30px",
    code: theme.colorPalette['greyscale-medium'],
    name: "greyscale-medium"
  }), /*#__PURE__*/_react["default"].createElement(LowerBox, {
    spacing: ['pr1', 'pb1', 'pl5'],
    borderColor: theme.colorPalette['greyscale-light'],
    stacked: "column",
    justify: "end",
    align: "end"
  }, /*#__PURE__*/_react["default"].createElement(ColorName, {
    code: theme.colorPalette['greyscale-light'],
    name: "greyscale-light"
  })))), /*#__PURE__*/_react["default"].createElement(AaBox, {
    stacked: "column",
    align: "center",
    hide: ['sm', 'md']
  }, /*#__PURE__*/_react["default"].createElement(_.Span, {
    colorName: "greyscale-black",
    bold: true,
    fontSize: "f3"
  }, "Aa"), /*#__PURE__*/_react["default"].createElement(AaSpan, {
    colorName: "greyscale-darker",
    paddingTop: "35px",
    bold: true,
    fontSize: "f3"
  }, "Aa"), /*#__PURE__*/_react["default"].createElement(AaSpan, {
    colorName: "greyscale-dark",
    paddingTop: "35px",
    bold: true,
    fontSize: "f3"
  }, "Aa"), /*#__PURE__*/_react["default"].createElement(AaSpan, {
    colorName: "greyscale-medium",
    paddingTop: "35px",
    bold: true,
    fontSize: "f3"
  }, "Aa")))));
});
var SmallFontSpan = (0, _styledComponents["default"])(_.Span).withConfig({
  displayName: "SmallFontSpan",
  componentId: "sc-19un633-7"
})(["font-size:12px;"]);

var StyledSpan = function StyledSpan(_ref3) {
  var colorName = _ref3.colorName,
      code = _ref3.code;
  return /*#__PURE__*/_react["default"].createElement(SmallFontSpan, {
    bold: true,
    colorName: colorName
  }, code.toUpperCase());
};

var BoxWithBorder = (0, _styledComponents["default"])(_.Box).withConfig({
  displayName: "BoxWithBorder",
  componentId: "sc-19un633-8"
})(["border-radius:5px;border:1px solid ", ";"], function (props) {
  return props.borderColor;
});

var SingleSwatch = function SingleSwatch(_ref4) {
  var colorPalette = _ref4.colorPalette,
      mainColor = _ref4.mainColor,
      boxColor = _ref4.boxColor,
      label = _ref4.label,
      _ref4$spacing = _ref4.spacing,
      spacing = _ref4$spacing === void 0 ? [] : _ref4$spacing;
  return /*#__PURE__*/_react["default"].createElement(SwatchSection, {
    height: "140px",
    borderRadius: "10px",
    colorName: mainColor,
    stacked: "column",
    justify: "space-between",
    align: "end",
    spacing: ['pr1', 'pt1', 'pb1'].concat(_toConsumableArray(spacing))
  }, label == null ? /*#__PURE__*/_react["default"].createElement(StyledSpan, {
    code: colorPalette[mainColor],
    colorName: "white"
  }) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(StyledSpan, {
    code: colorPalette[mainColor],
    colorName: boxColor
  }), /*#__PURE__*/_react["default"].createElement(_.Span, {
    bold: true,
    colorName: boxColor
  }, label)), /*#__PURE__*/_react["default"].createElement(BoxWithBorder, {
    stacked: "column",
    justify: "space-between",
    align: "end",
    spacing: ['pl1', 'pr1', 'pb1', 'ml1'],
    borderColor: colorPalette[boxColor]
  }, /*#__PURE__*/_react["default"].createElement(ColorName, {
    code: colorPalette[boxColor],
    name: boxColor,
    label: "Text"
  })));
};

var SmallBox = (0, _styledComponents["default"])(_.Box).withConfig({
  displayName: "SmallBox",
  componentId: "sc-19un633-9"
})(["height:40px;"]);

var DoubleSwatch = function DoubleSwatch(_ref5) {
  var topColor = _ref5.topColor,
      bottomColor = _ref5.bottomColor,
      boxColor = _ref5.boxColor,
      colorPalette = _ref5.colorPalette,
      spacing = _ref5.spacing;
  return /*#__PURE__*/_react["default"].createElement(SwatchSection, {
    spacing: spacing,
    height: "180px",
    borderRadius: "10px",
    colorName: topColor
  }, /*#__PURE__*/_react["default"].createElement(SmallBox, {
    stacked: "column",
    justify: "start",
    align: "end",
    spacing: ['pr1', 'pt1']
  }, /*#__PURE__*/_react["default"].createElement(StyledSpan, {
    code: colorPalette[topColor],
    colorName: "white"
  })), /*#__PURE__*/_react["default"].createElement(SingleSwatch, {
    mainColor: bottomColor,
    boxColor: boxColor,
    colorPalette: colorPalette
  }));
};

var FlexWrapBox = (0, _styledComponents["default"])(_.Box).withConfig({
  displayName: "FlexWrapBox",
  componentId: "sc-19un633-10"
})(["display:flex;flex-wrap:wrap;"]);
var WealthsimpleGridItem = (0, _styledComponents.withTheme)(function (_ref6) {
  var colorPalette = _ref6.theme.colorPalette;
  return /*#__PURE__*/_react["default"].createElement(_.GridItem, {
    sm: 3
  }, /*#__PURE__*/_react["default"].createElement(_.SectionHeader, null, "Branding"), /*#__PURE__*/_react["default"].createElement(FlexWrapBox, null, /*#__PURE__*/_react["default"].createElement(DoubleSwatch, {
    spacing: ['mr2', 'mb1'],
    colorPalette: colorPalette,
    topColor: "brand-secondary-dark",
    bottomColor: "brand-secondary-base",
    boxColor: "white"
  }), /*#__PURE__*/_react["default"].createElement(DoubleSwatch, {
    colorPalette: colorPalette,
    topColor: "brand-primary-dark",
    bottomColor: "brand-primary-base",
    boxColor: "white"
  })), /*#__PURE__*/_react["default"].createElement(FlexWrapBox, null, /*#__PURE__*/_react["default"].createElement(SingleSwatch, {
    label: "Secondary",
    mainColor: "brand-secondary-bg",
    boxColor: "brand-secondary-fg",
    colorPalette: colorPalette
  }), /*#__PURE__*/_react["default"].createElement(SingleSwatch, {
    spacing: ['ml1', 'mb1'],
    label: "Primary",
    mainColor: "brand-primary-bg",
    boxColor: "brand-primary-fg",
    colorPalette: colorPalette
  })));
});
var BannerItem = (0, _styledComponents.withTheme)(function (_ref7) {
  var colorPalette = _ref7.theme.colorPalette;
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_.SectionHeader, null, "Banners/errors/warnings"), /*#__PURE__*/_react["default"].createElement(FlexWrapBox, null, /*#__PURE__*/_react["default"].createElement(SingleSwatch, {
    label: "Success",
    mainColor: "success-bg",
    boxColor: "success-fg",
    colorPalette: colorPalette
  }), /*#__PURE__*/_react["default"].createElement(SingleSwatch, {
    spacing: ['ml1', 'mb1'],
    label: "Info",
    mainColor: "info-bg",
    boxColor: "info-fg",
    colorPalette: colorPalette
  }), /*#__PURE__*/_react["default"].createElement(SingleSwatch, {
    spacing: ['ml1', 'mb1'],
    label: "Error",
    mainColor: "error-bg",
    boxColor: "error-fg",
    colorPalette: colorPalette
  })));
});
var AuxiliaryItem = (0, _styledComponents.withTheme)(function (_ref8) {
  var colorPalette = _ref8.theme.colorPalette;
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_.SectionHeader, null, "Auxiliary Colors"), /*#__PURE__*/_react["default"].createElement(FlexWrapBox, null, /*#__PURE__*/_react["default"].createElement(SingleSwatch, {
    label: "aux-1",
    mainColor: "aux-1",
    boxColor: "white",
    colorPalette: colorPalette
  }), /*#__PURE__*/_react["default"].createElement(SingleSwatch, {
    spacing: ['ml1', 'mb1'],
    label: "aux-2",
    mainColor: "aux-2",
    boxColor: "white",
    colorPalette: colorPalette
  }), /*#__PURE__*/_react["default"].createElement(SingleSwatch, {
    spacing: ['ml1', 'mb1'],
    label: "aux-3",
    mainColor: "aux-3",
    boxColor: "white",
    colorPalette: colorPalette
  }), /*#__PURE__*/_react["default"].createElement(SingleSwatch, {
    spacing: ['ml1', 'mb1'],
    label: "aux-4",
    mainColor: "aux-4",
    boxColor: "white",
    colorPalette: colorPalette
  })));
});
var ColorGrid = (0, _styledComponents["default"])(_.Grid).withConfig({
  displayName: "ColorGrid",
  componentId: "sc-19un633-11"
})(["margin-left:0;margin-right:0;padding-left:10px;"]);

var Palette = function Palette() {
  return /*#__PURE__*/_react["default"].createElement(ColorGrid, null, /*#__PURE__*/_react["default"].createElement(BasicGridItem, null), /*#__PURE__*/_react["default"].createElement(WealthsimpleGridItem, null), /*#__PURE__*/_react["default"].createElement(_.GridItem, {
    sm: 5
  }, /*#__PURE__*/_react["default"].createElement(BannerItem, null), /*#__PURE__*/_react["default"].createElement(AuxiliaryItem, null)));
};

exports.Palette = Palette;