@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.
14 lines (11 loc) • 1.96 kB
JavaScript
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { SIZE_OPTIONS, TOKENS } from "./consts";
var getSizeToken = function getSizeToken(size, theme) {
var _TOKENS$heightButton, _TOKENS$fontSizeButto, _TOKENS$spinnerWidth, _TOKENS$spinnerHeight, _tokens;
var tokens = (_tokens = {}, _defineProperty(_tokens, TOKENS.heightButton, (_TOKENS$heightButton = {}, _defineProperty(_TOKENS$heightButton, SIZE_OPTIONS.LARGE, theme.orbit.heightButtonLarge), _defineProperty(_TOKENS$heightButton, SIZE_OPTIONS.NORMAL, theme.orbit.heightButtonNormal), _defineProperty(_TOKENS$heightButton, SIZE_OPTIONS.SMALL, theme.orbit.heightButtonSmall), _TOKENS$heightButton)), _defineProperty(_tokens, TOKENS.fontSizeButton, (_TOKENS$fontSizeButto = {}, _defineProperty(_TOKENS$fontSizeButto, SIZE_OPTIONS.LARGE, theme.orbit.fontSizeButtonLarge), _defineProperty(_TOKENS$fontSizeButto, SIZE_OPTIONS.NORMAL, theme.orbit.fontSizeButtonNormal), _defineProperty(_TOKENS$fontSizeButto, SIZE_OPTIONS.SMALL, theme.orbit.fontSizeButtonSmall), _TOKENS$fontSizeButto)), _defineProperty(_tokens, TOKENS.spinnerWidth, (_TOKENS$spinnerWidth = {}, _defineProperty(_TOKENS$spinnerWidth, SIZE_OPTIONS.LARGE, theme.orbit.widthIconMedium), _defineProperty(_TOKENS$spinnerWidth, SIZE_OPTIONS.NORMAL, theme.orbit.widthIconMedium), _defineProperty(_TOKENS$spinnerWidth, SIZE_OPTIONS.SMALL, theme.orbit.widthIconSmall), _TOKENS$spinnerWidth)), _defineProperty(_tokens, TOKENS.spinnerHeight, (_TOKENS$spinnerHeight = {}, _defineProperty(_TOKENS$spinnerHeight, SIZE_OPTIONS.LARGE, theme.orbit.heightIconMedium), _defineProperty(_TOKENS$spinnerHeight, SIZE_OPTIONS.NORMAL, theme.orbit.heightIconMedium), _defineProperty(_TOKENS$spinnerHeight, SIZE_OPTIONS.SMALL, theme.orbit.heightIconSmall), _TOKENS$spinnerHeight)), _tokens);
return {
height: tokens[TOKENS.heightButton][size],
fontSize: tokens[TOKENS.fontSizeButton][size]
};
};
export default getSizeToken;