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.

25 lines (20 loc) 874 B
import { TOKENS, TYPES } from "../consts"; import getButtonLinkTypeToken from "./getButtonLinkTypeToken"; var getButtonLinkIconForeground = function getButtonLinkIconForeground(_ref) { var type = _ref.type, theme = _ref.theme, compact = _ref.compact; var wrappedTypeReturn = function wrappedTypeReturn(usedType) { return { 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 wrappedTypeReturn(TYPES.PRIMARY); } return wrappedTypeReturn(type); }; export default getButtonLinkIconForeground;