@razorpay/blade
Version:
The Design System that powers Razorpay
16 lines (14 loc) • 877 B
JavaScript
// The reason we need to omit them is because styled-component thinks they are valid html attributes
// because fontFamily, fontWeight etc are valid SVG props.
// Here are list of valid props which emotion checks https://github.com/emotion-js/emotion/blob/main/packages/is-prop-valid/src/props.js
// Thus we just need to ignore few of these
var filterProps = ['cursor', 'display', 'overflow', 'order', 'color', 'fontFamily', 'fontWeight', 'fontSize', 'fontStyle', 'lineHeight',
// width height are only accepted in few components,
// canvas, embed, iframe, input, object, video, img
// none of them are currently supported in Box
'width', 'height', 'visibility'];
var omitPropsFromHTML = function omitPropsFromHTML(prop, defaultValidatorFn) {
return !filterProps.includes(prop) && defaultValidatorFn(prop);
};
export { omitPropsFromHTML };
//# sourceMappingURL=index.js.map