@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.
25 lines (18 loc) • 2.56 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 _consts = require("./consts");
var getSizeToken = function getSizeToken(size, theme) {
var _TOKENS$heightButton, _TOKENS$fontSizeButto, _TOKENS$spinnerWidth, _TOKENS$spinnerHeight, _tokens;
var tokens = (_tokens = {}, (0, _defineProperty2.default)(_tokens, _consts.TOKENS.heightButton, (_TOKENS$heightButton = {}, (0, _defineProperty2.default)(_TOKENS$heightButton, _consts.SIZE_OPTIONS.LARGE, theme.orbit.heightButtonLarge), (0, _defineProperty2.default)(_TOKENS$heightButton, _consts.SIZE_OPTIONS.NORMAL, theme.orbit.heightButtonNormal), (0, _defineProperty2.default)(_TOKENS$heightButton, _consts.SIZE_OPTIONS.SMALL, theme.orbit.heightButtonSmall), _TOKENS$heightButton)), (0, _defineProperty2.default)(_tokens, _consts.TOKENS.fontSizeButton, (_TOKENS$fontSizeButto = {}, (0, _defineProperty2.default)(_TOKENS$fontSizeButto, _consts.SIZE_OPTIONS.LARGE, theme.orbit.fontSizeButtonLarge), (0, _defineProperty2.default)(_TOKENS$fontSizeButto, _consts.SIZE_OPTIONS.NORMAL, theme.orbit.fontSizeButtonNormal), (0, _defineProperty2.default)(_TOKENS$fontSizeButto, _consts.SIZE_OPTIONS.SMALL, theme.orbit.fontSizeButtonSmall), _TOKENS$fontSizeButto)), (0, _defineProperty2.default)(_tokens, _consts.TOKENS.spinnerWidth, (_TOKENS$spinnerWidth = {}, (0, _defineProperty2.default)(_TOKENS$spinnerWidth, _consts.SIZE_OPTIONS.LARGE, theme.orbit.widthIconMedium), (0, _defineProperty2.default)(_TOKENS$spinnerWidth, _consts.SIZE_OPTIONS.NORMAL, theme.orbit.widthIconMedium), (0, _defineProperty2.default)(_TOKENS$spinnerWidth, _consts.SIZE_OPTIONS.SMALL, theme.orbit.widthIconSmall), _TOKENS$spinnerWidth)), (0, _defineProperty2.default)(_tokens, _consts.TOKENS.spinnerHeight, (_TOKENS$spinnerHeight = {}, (0, _defineProperty2.default)(_TOKENS$spinnerHeight, _consts.SIZE_OPTIONS.LARGE, theme.orbit.heightIconMedium), (0, _defineProperty2.default)(_TOKENS$spinnerHeight, _consts.SIZE_OPTIONS.NORMAL, theme.orbit.heightIconMedium), (0, _defineProperty2.default)(_TOKENS$spinnerHeight, _consts.SIZE_OPTIONS.SMALL, theme.orbit.heightIconSmall), _TOKENS$spinnerHeight)), _tokens);
return {
height: tokens[_consts.TOKENS.heightButton][size],
fontSize: tokens[_consts.TOKENS.fontSizeButton][size]
};
};
var _default = getSizeToken;
exports.default = _default;