|
|
|
@ -163,7 +163,8 @@ const generateClassNames = memoize( |
|
|
|
|
(type, value) => [type, value], |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
export default function Box({ |
|
|
|
|
const Box = React.forwardRef(function Box( |
|
|
|
|
{ |
|
|
|
|
padding, |
|
|
|
|
paddingTop, |
|
|
|
|
paddingRight, |
|
|
|
@ -193,7 +194,9 @@ export default function Box({ |
|
|
|
|
color, |
|
|
|
|
as = 'div', |
|
|
|
|
...props |
|
|
|
|
}) { |
|
|
|
|
}, |
|
|
|
|
ref, |
|
|
|
|
) { |
|
|
|
|
const boxClassName = classnames( |
|
|
|
|
BASE_CLASS_NAME, |
|
|
|
|
className, |
|
|
|
@ -252,11 +255,11 @@ export default function Box({ |
|
|
|
|
} |
|
|
|
|
const Component = as; |
|
|
|
|
return ( |
|
|
|
|
<Component className={boxClassName} {...props}> |
|
|
|
|
<Component className={boxClassName} ref={ref} {...props}> |
|
|
|
|
{children} |
|
|
|
|
</Component> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
Box.propTypes = { |
|
|
|
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), |
|
|
|
@ -329,3 +332,5 @@ Box.propTypes = { |
|
|
|
|
*/ |
|
|
|
|
color: MultipleTextColors, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export default Box; |
|
|
|
|