UNPKG

@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.

28 lines (20 loc) 3.41 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _convertHexToRgba = _interopRequireDefault(require("@kiwicom/orbit-design-tokens/lib/convertHexToRgba")); var _consts = require("../consts"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var getTypeToken = function getTypeToken(name) { return function (_ref) { var _TOKENS$backgroundBut, _TOKENS$backgroundBut2, _TOKENS$backgroundBut3, _TOKENS$colorTextButt, _TOKENS$colorTextButt2, _TOKENS$colorTextButt3, _TOKENS$backgroundBut4, _tokens; var theme = _ref.theme, type = _ref.type; var tokens = (_tokens = {}, _defineProperty(_tokens, _consts.TOKENS.backgroundButton, (_TOKENS$backgroundBut = {}, _defineProperty(_TOKENS$backgroundBut, _consts.TYPES.PRIMARY, theme.orbit.backgroundButtonLinkPrimary), _defineProperty(_TOKENS$backgroundBut, _consts.TYPES.SECONDARY, theme.orbit.backgroundButtonLinkSecondary), _TOKENS$backgroundBut)), _defineProperty(_tokens, _consts.TOKENS.backgroundButtonHover, (_TOKENS$backgroundBut2 = {}, _defineProperty(_TOKENS$backgroundBut2, _consts.TYPES.PRIMARY, theme.orbit.backgroundButtonLinkPrimaryHover), _defineProperty(_TOKENS$backgroundBut2, _consts.TYPES.SECONDARY, theme.orbit.backgroundButtonLinkSecondaryHover), _TOKENS$backgroundBut2)), _defineProperty(_tokens, _consts.TOKENS.backgroundButtonActive, (_TOKENS$backgroundBut3 = {}, _defineProperty(_TOKENS$backgroundBut3, _consts.TYPES.PRIMARY, theme.orbit.backgroundButtonLinkPrimaryHover), _defineProperty(_TOKENS$backgroundBut3, _consts.TYPES.SECONDARY, theme.orbit.backgroundButtonLinkSecondaryHover), _TOKENS$backgroundBut3)), _defineProperty(_tokens, _consts.TOKENS.colorTextButton, (_TOKENS$colorTextButt = {}, _defineProperty(_TOKENS$colorTextButt, _consts.TYPES.PRIMARY, theme.orbit.colorTextButtonLinkPrimary), _defineProperty(_TOKENS$colorTextButt, _consts.TYPES.SECONDARY, theme.orbit.colorTextButtonLinkSecondary), _TOKENS$colorTextButt)), _defineProperty(_tokens, _consts.TOKENS.colorTextButtonHover, (_TOKENS$colorTextButt2 = {}, _defineProperty(_TOKENS$colorTextButt2, _consts.TYPES.PRIMARY, theme.orbit.colorTextButtonLinkPrimaryHover), _defineProperty(_TOKENS$colorTextButt2, _consts.TYPES.SECONDARY, theme.orbit.colorTextButtonLinkSecondaryHover), _TOKENS$colorTextButt2)), _defineProperty(_tokens, _consts.TOKENS.colorTextButtonActive, (_TOKENS$colorTextButt3 = {}, _defineProperty(_TOKENS$colorTextButt3, _consts.TYPES.PRIMARY, theme.orbit.colorTextButtonLinkPrimaryActive), _defineProperty(_TOKENS$colorTextButt3, _consts.TYPES.SECONDARY, theme.orbit.colorTextButtonLinkSecondaryActive), _TOKENS$colorTextButt3)), _defineProperty(_tokens, _consts.TOKENS.backgroundButtonFocus, (_TOKENS$backgroundBut4 = {}, _defineProperty(_TOKENS$backgroundBut4, _consts.TYPES.PRIMARY, (0, _convertHexToRgba.default)(theme.orbit.paletteProductNormal, 10)), _defineProperty(_TOKENS$backgroundBut4, _consts.TYPES.SECONDARY, (0, _convertHexToRgba.default)(theme.orbit.paletteInkLight, 10)), _TOKENS$backgroundBut4)), _tokens); return tokens[name][type]; }; }; var _default = getTypeToken; exports.default = _default;