wix-style-react
Version:
wix-style-react
39 lines (30 loc) • 1.06 kB
JavaScript
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import React from 'react';
import PropTypes from 'prop-types';
import classname from 'classnames';
import styles from './styles.scss';
var Cell = function Cell(_ref) {
var span = _ref.span,
children = _ref.children,
vertical = _ref.vertical;
return React.createElement('div', {
style: {
gridColumn: 'span ' + span
},
className: classname(styles.root, _defineProperty({}, styles.vertical, vertical)),
children: children
});
};
Cell.displayName = 'Cell';
Cell.propTypes = {
/** 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
};
Cell.defaultProps = {
span: 12
};
export default Cell;