wix-style-react
Version:
46 lines (40 loc) • 1.14 kB
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import { st, classes } from './styles.st.css';
var Cell = function Cell(_ref) {
var span = _ref.span,
rows = _ref.rows,
children = _ref.children,
vertical = _ref.vertical,
className = _ref.className,
dataHook = _ref.dataHook;
return /*#__PURE__*/React.createElement("div", {
"data-hook": dataHook,
style: {
gridColumn: "span ".concat(span),
gridRow: "span ".concat(rows)
},
className: st(classes.root, {
vertical: vertical
}, className),
children: children
});
};
Cell.displayName = 'Cell';
Cell.propTypes = {
/** hook for testing purposes */
dataHook: PropTypes.string,
/** any node to be rendered inside */
children: PropTypes.node,
/** how many columns should this cell occupy. Can be any number from 1 to 12 inclusive */
span: PropTypes.number,
/** whether to align children vertically to the middle */
vertical: PropTypes.bool,
/** how many rows should this cell occupy */
rows: PropTypes.number
};
Cell.defaultProps = {
span: 12,
rows: 1
};
export default Cell;