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.

29 lines (25 loc) 661 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: 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;