wix-style-react
Version:
wix-style-react
51 lines (41 loc) • 1.54 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 { bool, node, string } from 'prop-types';
import classNames from 'classnames';
import Content from './Content';
import Header from './Header';
import Divider from './Divider';
import LinkHeader from './LinkHeader';
import ButtonHeader from './ButtonHeader';
import CollapsedHeader from './CollapsedHeader';
import styles from './Card.scss';
var Card = function Card(_ref) {
var _classNames;
var stretchVertically = _ref.stretchVertically,
hideOverflow = _ref.hideOverflow,
className = _ref.className,
children = _ref.children,
dataHook = _ref.dataHook;
return React.createElement('div', {
className: classNames(styles.card, className, (_classNames = {}, _defineProperty(_classNames, styles.stretchVertically, stretchVertically), _defineProperty(_classNames, styles.hideOverflow, hideOverflow), _classNames)),
children: children,
'data-hook': dataHook
});
};
Card.displayName = 'Card';
Card.propTypes = {
children: node,
stretchVertically: bool,
hideOverflow: bool,
dataHook: string
};
Card.defaultProps = {
stretchVertically: false
};
Card.Content = Content;
Card.Header = Header;
Card.Divider = Divider;
Card.LinkHeader = LinkHeader;
Card.ButtonHeader = ButtonHeader;
Card.CollapsedHeader = CollapsedHeader;
export default Card;