@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.
29 lines (23 loc) • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
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 DURATIONS = {
SLOW: "slow",
NORMAL: "normal",
FAST: "fast"
};
var transition = function transition(properties, duration, timingFunction) {
return function (_ref) {
var _tokens;
var theme = _ref.theme;
var tokens = (_tokens = {}, _defineProperty(_tokens, DURATIONS.SLOW, theme.orbit.durationSlow), _defineProperty(_tokens, DURATIONS.NORMAL, theme.orbit.durationNormal), _defineProperty(_tokens, DURATIONS.FAST, theme.orbit.durationFast), _tokens);
return "\n ".concat(properties.map(function (property) {
return "".concat(property, " ").concat(tokens[duration], " ").concat(timingFunction);
}).join(","), ";\n ");
};
};
var _default = transition;
exports.default = _default;