@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.
22 lines (21 loc) • 610 B
JavaScript
;
exports.__esModule = true;
exports.default = void 0;
const DURATIONS = {
SLOW: "slow",
NORMAL: "normal",
FAST: "fast"
};
const transition = (properties, duration, timingFunction) => ({
theme
}) => {
if (theme.transitions === false) return null;
const tokens = {
[DURATIONS.SLOW]: theme.orbit.durationSlow,
[DURATIONS.NORMAL]: theme.orbit.durationNormal,
[DURATIONS.FAST]: theme.orbit.durationFast
};
return properties.map(property => `${property} ${tokens[duration] || duration} ${timingFunction}`).join(",");
};
var _default = transition;
exports.default = _default;