Sha256: 869754eae898b5524d248445b7a0a90bd817e24c8b573e84ad964c8b8cc3cc81
Contents?: true
Size: 1.93 KB
Versions: 31
Compression:
Stored size: 1.93 KB
Contents
// Prop categories const spacingProps = ({ marginRight, marginLeft, marginTop, marginBottom, marginX, marginY, margin, paddingRight, paddingLeft, paddingTop, paddingBottom, paddingX, paddingY, padding, }) => { let css = '' css += marginRight ? `mr_${marginRight} ` : '' css += marginLeft ? `ml_${marginLeft} ` : '' css += marginTop ? `mt_${marginTop} ` : '' css += marginBottom ? `mb_${marginBottom} ` : '' css += marginX ? `mx_${marginX} ` : '' css += marginY ? `my_${marginY} ` : '' css += margin ? `m_${margin} ` : '' css += paddingRight ? `pr_${paddingRight} ` : '' css += paddingLeft ? `pl_${paddingLeft} ` : '' css += paddingTop ? `pt_${paddingTop} ` : '' css += paddingBottom ? `pb_${paddingBottom} ` : '' css += paddingX ? `px_${paddingX} ` : '' css += paddingY ? `py_${paddingY} ` : '' css += padding ? `p_${padding} ` : '' return css } const darkProps = ({ dark }) => { let css = '' css += dark ? 'dark' : '' return css } const numberSpacingProps = ({ numberSpacing }) => { let css = '' css += numberSpacing ? `ns_${numberSpacing} ` : '' return css } const maxWidthProps = ({ maxWidth }) => { let css = '' css += maxWidth ? `max_width_${maxWidth } ` : '' return css } const zIndexProps = ({ zIndex }) => { let css = '' css += zIndex ? `z_index_${zIndex } ` : '' return css } // All Exported as a single function export const globalProps = (props, defaultProps = {}) => { const allProps = { ...props, ...defaultProps } return spacingProps(allProps) + darkProps(allProps) + maxWidthProps(allProps) + zIndexProps(allProps) + numberSpacingProps(allProps) } export const deprecatedProps = (kit, props = []) => { if (process.env.NODE_ENV === 'development') { /* eslint no-console: ["error", { allow: ["warn", "error"] }] */ props.forEach((prop) => { console.warn(`${kit} Kit: The prop '${prop}' is deprecated and will be removed in a future release!`) }) } }
Version data entries
31 entries across 31 versions & 1 rubygems