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.

21 lines (20 loc) 600 B
"use strict"; 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 = exports.default = transition;