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.

40 lines (39 loc) 1.51 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; exports.__esModule = true; exports.default = void 0; var _consts = require("../consts"); var _getButtonLinkTypeToken = _interopRequireDefault(require("./getButtonLinkTypeToken")); const getButtonLinkStyles = ({ type, theme, compact }) => { const wrappedTypeToken = name => (0, _getButtonLinkTypeToken.default)(name, type, theme); const commonStyles = { background: wrappedTypeToken(_consts.TOKENS.background), foreground: wrappedTypeToken(_consts.TOKENS.foreground), foregroundHover: wrappedTypeToken(_consts.TOKENS.foregroundHover), foregroundActive: wrappedTypeToken(_consts.TOKENS.foregroundActive), foregroundFocus: wrappedTypeToken(_consts.TOKENS.foregroundActive) }; if (compact) { if (type === _consts.TYPES.SECONDARY) { return { ...commonStyles, foregroundHover: theme.orbit.colorTextButtonLinkSecondaryCompactHover, foregroundActive: theme.orbit.colorTextButtonLinkSecondaryCompactHover, foregroundFocus: theme.orbit.colorTextButtonLinkSecondaryCompactActive }; } return commonStyles; } return { backgroundHover: wrappedTypeToken(_consts.TOKENS.backgroundHover), backgroundActive: wrappedTypeToken(_consts.TOKENS.backgroundActive), backgroundFocus: wrappedTypeToken(_consts.TOKENS.backgroundActive), ...commonStyles }; }; var _default = getButtonLinkStyles; exports.default = _default;