@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.
12 lines (11 loc) • 365 B
JavaScript
;
exports.__esModule = true;
exports.rtlSpacing = void 0;
const rtlSpacing = value => ({
theme
}) => {
if (!theme.rtl) return value;
const parts = value.split(" ").filter(part => !Number.isNaN(parseFloat(part)) && part);
return parts.length === 4 ? [parts[0], parts[3], parts[2], parts[1]].join(" ") : value;
};
exports.rtlSpacing = rtlSpacing;