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 (24 loc) 1.02 kB
import { TOKENS, TYPES } from "../consts"; import getButtonLinkTypeToken from "./getButtonLinkTypeToken"; const getButtonLinkIconForeground = ({ type, theme, compact }) => { const wrappedTypeReturn = usedType => ({ foreground: getButtonLinkTypeToken(TOKENS.foreground, type, theme), foregroundHover: getButtonLinkTypeToken(TOKENS.foregroundHover, usedType, theme), foregroundActive: getButtonLinkTypeToken(TOKENS.foregroundActive, usedType, theme), foregroundFocus: getButtonLinkTypeToken(TOKENS.foregroundActive, usedType, theme) }); if (compact && type === TYPES.SECONDARY) { return { foreground: getButtonLinkTypeToken(TOKENS.foreground, type, theme), foregroundHover: theme.orbit.colorTextButtonLinkSecondaryCompactHover, foregroundActive: theme.orbit.colorTextButtonLinkSecondaryCompactHover, foregroundFocus: theme.orbit.colorTextButtonLinkSecondaryCompactActive }; } return wrappedTypeReturn(type); }; export default getButtonLinkIconForeground;