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.

32 lines (30 loc) 1.04 kB
import { SIZE_OPTIONS, TOKENS } from "../consts"; const getSizeToken = name => ({ theme, size }) => { const tokens = { [TOKENS.heightButton]: { [SIZE_OPTIONS.LARGE]: theme.orbit.heightButtonLarge, [SIZE_OPTIONS.NORMAL]: theme.orbit.heightButtonNormal, [SIZE_OPTIONS.SMALL]: theme.orbit.heightButtonSmall }, [TOKENS.loadingWidth]: { [SIZE_OPTIONS.LARGE]: theme.orbit.widthIconMedium, [SIZE_OPTIONS.NORMAL]: theme.orbit.widthIconMedium, [SIZE_OPTIONS.SMALL]: theme.orbit.widthIconSmall }, [TOKENS.loadingHeight]: { [SIZE_OPTIONS.LARGE]: theme.orbit.heightIconMedium, [SIZE_OPTIONS.NORMAL]: theme.orbit.heightIconMedium, [SIZE_OPTIONS.SMALL]: theme.orbit.heightIconSmall }, [TOKENS.fontSizeButton]: { [SIZE_OPTIONS.LARGE]: theme.orbit.fontSizeButtonLarge, [SIZE_OPTIONS.NORMAL]: theme.orbit.fontSizeButtonNormal, [SIZE_OPTIONS.SMALL]: theme.orbit.fontSizeButtonSmall } }; return tokens[name][size]; }; export default getSizeToken;