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.

36 lines (34 loc) 1.26 kB
import { TOKENS, TYPES } from "../consts"; const getTypeToken = name => ({ theme, type }) => { const tokens = { [TOKENS.backgroundButton]: { [TYPES.PRIMARY]: theme.orbit.backgroundButtonLinkPrimary, [TYPES.SECONDARY]: theme.orbit.backgroundButtonLinkSecondary }, [TOKENS.backgroundButtonHover]: { [TYPES.PRIMARY]: theme.orbit.backgroundButtonLinkPrimaryHover, [TYPES.SECONDARY]: theme.orbit.backgroundButtonLinkSecondaryHover }, [TOKENS.backgroundButtonActive]: { [TYPES.PRIMARY]: theme.orbit.backgroundButtonLinkPrimaryHover, [TYPES.SECONDARY]: theme.orbit.backgroundButtonLinkSecondaryHover }, [TOKENS.colorTextButton]: { [TYPES.PRIMARY]: theme.orbit.colorTextButtonLinkPrimary, [TYPES.SECONDARY]: theme.orbit.colorTextButtonLinkSecondary }, [TOKENS.colorTextButtonHover]: { [TYPES.PRIMARY]: theme.orbit.colorTextButtonLinkPrimaryHover, [TYPES.SECONDARY]: theme.orbit.colorTextButtonLinkSecondaryHover }, [TOKENS.colorTextButtonActive]: { [TYPES.PRIMARY]: theme.orbit.colorTextButtonLinkPrimaryActive, [TYPES.SECONDARY]: theme.orbit.colorTextButtonLinkSecondaryActive } }; return tokens[name][type]; }; export default getTypeToken;