2021-10-05 20:01:16 -07:00
|
|
|
import classNames from 'classnames';
|
2022-01-10 14:17:52 -08:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React from 'react';
|
2020-03-27 13:59:38 -07:00
|
|
|
|
|
|
|
export default class Column extends React.PureComponent {
|
|
|
|
|
|
|
|
static propTypes = {
|
2021-10-05 20:01:16 -07:00
|
|
|
className: PropTypes.string,
|
2021-10-06 13:57:24 -07:00
|
|
|
transparent: PropTypes.bool,
|
2020-03-27 13:59:38 -07:00
|
|
|
children: PropTypes.node,
|
|
|
|
label: PropTypes.string,
|
|
|
|
};
|
|
|
|
|
2021-10-26 08:38:49 -07:00
|
|
|
setRef = c => {
|
|
|
|
this.node = c;
|
|
|
|
}
|
|
|
|
|
2020-04-14 14:47:35 -07:00
|
|
|
render() {
|
2021-10-06 13:57:24 -07:00
|
|
|
const { className, label, children, transparent, ...rest } = this.props;
|
2020-03-27 13:59:38 -07:00
|
|
|
|
|
|
|
return (
|
2021-10-05 20:01:16 -07:00
|
|
|
<div
|
|
|
|
role='region'
|
|
|
|
aria-label={label}
|
2021-10-06 13:57:24 -07:00
|
|
|
className={classNames('column', className, { 'column--transparent': transparent })}
|
|
|
|
{...rest}
|
2021-10-26 08:38:49 -07:00
|
|
|
ref={this.setRef}
|
2021-10-05 20:01:16 -07:00
|
|
|
>
|
2020-03-27 13:59:38 -07:00
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|