@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
50 lines • 1.82 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPaddingRightFromContainer = exports.getPaddingLeftFromContainer = exports.getPaddingRight = exports.getPaddingLeft = void 0;
const getPaddingLeft = (padding) => {
if (!padding) {
return undefined;
}
const values = padding.split(' ');
switch (values.length) {
case 1: // All four sides are the same
return values[0];
case 2: // Vertical | Horizontal
return values[1];
case 3: // Top | Horizontal | Bottom
return values[1];
case 4: // Top | Right | Bottom | Left
return values[3];
default:
return undefined;
}
};
exports.getPaddingLeft = getPaddingLeft;
const getPaddingRight = (padding) => {
if (!padding) {
return undefined;
}
const values = padding.split(' ');
switch (values.length) {
case 1: // All four sides are the same
return values[0];
case 2: // Vertical | Horizontal
return values[1];
case 3: // Top | Horizontal | Bottom
return values[1];
case 4: // Top | Right | Bottom | Left
return values[1];
default:
return undefined;
}
};
exports.getPaddingRight = getPaddingRight;
const getPaddingLeftFromContainer = (container) => {
return container?.padding_left ?? (0, exports.getPaddingLeft)(container?.padding) ?? '0rem';
};
exports.getPaddingLeftFromContainer = getPaddingLeftFromContainer;
const getPaddingRightFromContainer = (container) => {
return container?.padding_right ?? (0, exports.getPaddingRight)(container?.padding) ?? '0rem';
};
exports.getPaddingRightFromContainer = getPaddingRightFromContainer;
//# sourceMappingURL=input.mixin.utils.js.map