|
|
@ -79,6 +79,7 @@ export default function Box({ |
|
|
|
textAlign, |
|
|
|
textAlign, |
|
|
|
flexDirection = FLEX_DIRECTION.ROW, |
|
|
|
flexDirection = FLEX_DIRECTION.ROW, |
|
|
|
flexWrap, |
|
|
|
flexWrap, |
|
|
|
|
|
|
|
gap, |
|
|
|
display, |
|
|
|
display, |
|
|
|
width, |
|
|
|
width, |
|
|
|
height, |
|
|
|
height, |
|
|
@ -134,6 +135,7 @@ export default function Box({ |
|
|
|
[`box--height-${height}`]: Boolean(height), |
|
|
|
[`box--height-${height}`]: Boolean(height), |
|
|
|
// background
|
|
|
|
// background
|
|
|
|
[`box--background-color-${backgroundColor}`]: Boolean(backgroundColor), |
|
|
|
[`box--background-color-${backgroundColor}`]: Boolean(backgroundColor), |
|
|
|
|
|
|
|
...generateSizeClasses('box', 'gap', gap), |
|
|
|
}); |
|
|
|
}); |
|
|
|
// Apply Box styles to any other component using function pattern
|
|
|
|
// Apply Box styles to any other component using function pattern
|
|
|
|
if (typeof children === 'function') { |
|
|
|
if (typeof children === 'function') { |
|
|
@ -146,6 +148,7 @@ Box.propTypes = { |
|
|
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), |
|
|
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), |
|
|
|
flexDirection: PropTypes.oneOf(Object.values(FLEX_DIRECTION)), |
|
|
|
flexDirection: PropTypes.oneOf(Object.values(FLEX_DIRECTION)), |
|
|
|
flexWrap: PropTypes.oneOf(Object.values(FLEX_WRAP)), |
|
|
|
flexWrap: PropTypes.oneOf(Object.values(FLEX_WRAP)), |
|
|
|
|
|
|
|
gap: ValidSize, |
|
|
|
margin: MultipleSizes, |
|
|
|
margin: MultipleSizes, |
|
|
|
marginTop: ValidSize, |
|
|
|
marginTop: ValidSize, |
|
|
|
marginBottom: ValidSize, |
|
|
|
marginBottom: ValidSize, |
|
|
|