@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
47 lines • 1.99 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildProps = void 0;
const decorativeElement_1 = require("../../decorativeElement/types/decorativeElement");
const buildProps = (styles, element, device, dataTestId) => {
if (element?.[decorativeElement_1.DecorativeType.ICON]) {
return {
marginRight: styles.icon?.margin_right,
additionalProps: {
width: styles.icon?.[device]?.width ?? styles.icon?.width,
height: styles.icon?.[device]?.height ?? styles.icon?.height,
color: styles.icon?.[device]?.color ?? styles.icon?.color,
...element[decorativeElement_1.DecorativeType.ICON],
},
};
}
else if (element?.[decorativeElement_1.DecorativeType.ICON_HIGHLIGHTED]) {
const size = element[decorativeElement_1.DecorativeType.ICON_HIGHLIGHTED]?.size
? element[decorativeElement_1.DecorativeType.ICON_HIGHLIGHTED]?.size
: styles.iconHighlighted?.size;
return {
marginRight: styles.iconHighlighted?.margin_right,
additionalProps: {
...styles.iconHighlighted,
size,
},
};
}
else if (element?.[decorativeElement_1.DecorativeType.ILLUSTRATION]) {
return {
marginRight: styles.illustration?.margin_right,
additionalProps: {
height: `${styles.illustration?.[device]?.height ?? styles.illustration?.height}`,
width: `${styles.illustration?.[device]?.width ?? styles.illustration?.width}`,
},
};
}
else if (element?.[decorativeElement_1.DecorativeType.AVATAR]) {
return {
marginRight: styles.avatar?.margin_right,
additionalProps: {},
};
}
return { marginRight: undefined, additionalProps: undefined };
};
exports.buildProps = buildProps;
//# sourceMappingURL=buildProps.js.map