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 (26 loc) 1.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _consts = require("../consts"); var _rtl = require("../../utils/rtl"); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var getIconSpacing = function getIconSpacing() { return function (_ref) { var _TOKENS$marginRightIc; var theme = _ref.theme, right = _ref.right, size = _ref.size, onlyIcon = _ref.onlyIcon; if (onlyIcon) { return null; } var tokens = _defineProperty({}, _consts.TOKENS.marginRightIcon, (_TOKENS$marginRightIc = {}, _defineProperty(_TOKENS$marginRightIc, _consts.SIZES.LARGE, theme.orbit.marginButtonIconLarge), _defineProperty(_TOKENS$marginRightIc, _consts.SIZES.NORMAL, theme.orbit.marginButtonIconNormal), _defineProperty(_TOKENS$marginRightIc, _consts.SIZES.SMALL, theme.orbit.marginButtonIconSmall), _TOKENS$marginRightIc)); return (0, _rtl.rtlSpacing)(right ? "0 0 0 ".concat(tokens[_consts.TOKENS.marginRightIcon][size]) : "0 ".concat(tokens[_consts.TOKENS.marginRightIcon][size], " 0 0"))({ theme: theme }); }; }; var _default = getIconSpacing; exports.default = _default;