@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
24 lines (16 loc) • 6.29 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _convertHexToRgba = _interopRequireDefault(require("@kiwicom/orbit-design-tokens/lib/convertHexToRgba"));
var _consts = require("../consts");
var getSocialButtonTypeToken = function getSocialButtonTypeToken(name, type, theme) {
var _TOKENS$backgroundBut, _TOKENS$backgroundBut2, _TOKENS$backgroundBut3, _TOKENS$backgroundBut4, _TOKENS$colorTextButt, _TOKENS$colorTextButt2, _TOKENS$colorTextButt3, _TOKENS$iconColor, _TOKENS$borderColorBu, _tokens;
var tokens = (_tokens = {}, (0, _defineProperty2.default)(_tokens, _consts.TOKENS.backgroundButton, (_TOKENS$backgroundBut = {}, (0, _defineProperty2.default)(_TOKENS$backgroundBut, _consts.TYPE_OPTIONS.APPLE, theme.orbit.paletteInkNormal), (0, _defineProperty2.default)(_TOKENS$backgroundBut, _consts.TYPE_OPTIONS.FACEBOOK, theme.orbit.paletteCloudDark), (0, _defineProperty2.default)(_TOKENS$backgroundBut, _consts.TYPE_OPTIONS.GOOGLE, theme.orbit.paletteCloudDark), (0, _defineProperty2.default)(_TOKENS$backgroundBut, _consts.TYPE_OPTIONS.TWITTER, theme.orbit.paletteCloudDark), _TOKENS$backgroundBut)), (0, _defineProperty2.default)(_tokens, _consts.TOKENS.backgroundButtonHover, (_TOKENS$backgroundBut2 = {}, (0, _defineProperty2.default)(_TOKENS$backgroundBut2, _consts.TYPE_OPTIONS.APPLE, theme.orbit.paletteInkNormalHover), (0, _defineProperty2.default)(_TOKENS$backgroundBut2, _consts.TYPE_OPTIONS.FACEBOOK, theme.orbit.paletteCloudNormalHover), (0, _defineProperty2.default)(_TOKENS$backgroundBut2, _consts.TYPE_OPTIONS.GOOGLE, theme.orbit.paletteCloudNormalHover), (0, _defineProperty2.default)(_TOKENS$backgroundBut2, _consts.TYPE_OPTIONS.TWITTER, theme.orbit.paletteCloudNormalHover), _TOKENS$backgroundBut2)), (0, _defineProperty2.default)(_tokens, _consts.TOKENS.backgroundButtonActive, (_TOKENS$backgroundBut3 = {}, (0, _defineProperty2.default)(_TOKENS$backgroundBut3, _consts.TYPE_OPTIONS.APPLE, theme.orbit.paletteInkNormalActive), (0, _defineProperty2.default)(_TOKENS$backgroundBut3, _consts.TYPE_OPTIONS.FACEBOOK, theme.orbit.paletteCloudNormalActive), (0, _defineProperty2.default)(_TOKENS$backgroundBut3, _consts.TYPE_OPTIONS.GOOGLE, theme.orbit.paletteCloudNormalActive), (0, _defineProperty2.default)(_TOKENS$backgroundBut3, _consts.TYPE_OPTIONS.TWITTER, theme.orbit.paletteCloudNormalActive), _TOKENS$backgroundBut3)), (0, _defineProperty2.default)(_tokens, _consts.TOKENS.backgroundButtonFocus, (_TOKENS$backgroundBut4 = {}, (0, _defineProperty2.default)(_TOKENS$backgroundBut4, _consts.TYPE_OPTIONS.APPLE, theme.orbit.paletteInkNormal), (0, _defineProperty2.default)(_TOKENS$backgroundBut4, _consts.TYPE_OPTIONS.FACEBOOK, theme.orbit.paletteCloudDark), (0, _defineProperty2.default)(_TOKENS$backgroundBut4, _consts.TYPE_OPTIONS.GOOGLE, theme.orbit.paletteCloudDark), (0, _defineProperty2.default)(_TOKENS$backgroundBut4, _consts.TYPE_OPTIONS.TWITTER, theme.orbit.paletteCloudDark), _TOKENS$backgroundBut4)), (0, _defineProperty2.default)(_tokens, _consts.TOKENS.colorTextButton, (_TOKENS$colorTextButt = {}, (0, _defineProperty2.default)(_TOKENS$colorTextButt, _consts.TYPE_OPTIONS.APPLE, theme.orbit.paletteWhite), (0, _defineProperty2.default)(_TOKENS$colorTextButt, _consts.TYPE_OPTIONS.FACEBOOK, theme.orbit.paletteInkNormal), (0, _defineProperty2.default)(_TOKENS$colorTextButt, _consts.TYPE_OPTIONS.GOOGLE, theme.orbit.paletteInkNormal), (0, _defineProperty2.default)(_TOKENS$colorTextButt, _consts.TYPE_OPTIONS.TWITTER, theme.orbit.paletteInkNormal), _TOKENS$colorTextButt)), (0, _defineProperty2.default)(_tokens, _consts.TOKENS.colorTextButtonHover, (_TOKENS$colorTextButt2 = {}, (0, _defineProperty2.default)(_TOKENS$colorTextButt2, _consts.TYPE_OPTIONS.APPLE, theme.orbit.paletteWhite), (0, _defineProperty2.default)(_TOKENS$colorTextButt2, _consts.TYPE_OPTIONS.FACEBOOK, theme.orbit.paletteInkNormal), (0, _defineProperty2.default)(_TOKENS$colorTextButt2, _consts.TYPE_OPTIONS.GOOGLE, theme.orbit.paletteInkNormal), (0, _defineProperty2.default)(_TOKENS$colorTextButt2, _consts.TYPE_OPTIONS.TWITTER, theme.orbit.paletteInkNormal), _TOKENS$colorTextButt2)), (0, _defineProperty2.default)(_tokens, _consts.TOKENS.colorTextButtonActive, (_TOKENS$colorTextButt3 = {}, (0, _defineProperty2.default)(_TOKENS$colorTextButt3, _consts.TYPE_OPTIONS.APPLE, theme.orbit.paletteWhite), (0, _defineProperty2.default)(_TOKENS$colorTextButt3, _consts.TYPE_OPTIONS.FACEBOOK, theme.orbit.paletteInkNormal), (0, _defineProperty2.default)(_TOKENS$colorTextButt3, _consts.TYPE_OPTIONS.GOOGLE, theme.orbit.paletteInkNormal), (0, _defineProperty2.default)(_TOKENS$colorTextButt3, _consts.TYPE_OPTIONS.TWITTER, theme.orbit.paletteInkNormal), _TOKENS$colorTextButt3)), (0, _defineProperty2.default)(_tokens, _consts.TOKENS.iconColor, (_TOKENS$iconColor = {}, (0, _defineProperty2.default)(_TOKENS$iconColor, _consts.TYPE_OPTIONS.APPLE, theme.orbit.paletteWhite), (0, _defineProperty2.default)(_TOKENS$iconColor, _consts.TYPE_OPTIONS.FACEBOOK, theme.orbit.paletteSocialFacebook), (0, _defineProperty2.default)(_TOKENS$iconColor, _consts.TYPE_OPTIONS.GOOGLE, "currentColor"), (0, _defineProperty2.default)(_TOKENS$iconColor, _consts.TYPE_OPTIONS.TWITTER, "#00ACEE"), _TOKENS$iconColor)), (0, _defineProperty2.default)(_tokens, _consts.TOKENS.borderColorButtonFocus, (_TOKENS$borderColorBu = {}, (0, _defineProperty2.default)(_TOKENS$borderColorBu, _consts.TYPE_OPTIONS.APPLE, (0, _convertHexToRgba.default)(theme.orbit.paletteInkLight, 50)), (0, _defineProperty2.default)(_TOKENS$borderColorBu, _consts.TYPE_OPTIONS.FACEBOOK, (0, _convertHexToRgba.default)(theme.orbit.paletteInkLight, 30)), (0, _defineProperty2.default)(_TOKENS$borderColorBu, _consts.TYPE_OPTIONS.GOOGLE, (0, _convertHexToRgba.default)(theme.orbit.paletteInkLight, 50)), (0, _defineProperty2.default)(_TOKENS$borderColorBu, _consts.TYPE_OPTIONS.TWITTER, (0, _convertHexToRgba.default)(theme.orbit.paletteInkLight, 50)), _TOKENS$borderColorBu)), _tokens);
return tokens[name][type];
};
var _default = getSocialButtonTypeToken;
exports.default = _default;