@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.
20 lines (18 loc) • 470 B
JavaScript
const DURATIONS = {
SLOW: "slow",
NORMAL: "normal",
FAST: "fast"
};
const transition = (properties, duration, timingFunction) => ({
theme
}) => {
const tokens = {
[DURATIONS.SLOW]: theme.orbit.durationSlow,
[DURATIONS.NORMAL]: theme.orbit.durationNormal,
[DURATIONS.FAST]: theme.orbit.durationFast
};
return `
${properties.map(property => `${property} ${tokens[duration]} ${timingFunction}`).join(",")};
`;
};
export default transition;