wix-style-react
Version:
wix-style-react
33 lines • 1.58 kB
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import Content from './Content';
import Header from './Header';
import Subheader from './Subheader';
import Divider from './Divider';
import { st, classes } from './Card.st.css';
const Card = ({ stretchVertically = false, showShadow = false, hideOverflow, className, children, controls, dataHook, }) => (React.createElement("div", { className: st(classes.card, { stretchVertically, hideOverflow, showShadow }, className), "data-hook": dataHook },
controls && React.createElement("div", { className: classes.controls }, controls),
children));
Card.displayName = 'Card';
Card.propTypes = {
/** Contains elements inside the card `<Card.Header/>`, `<Card.Subeader/>`, `<Card.Content/>` or `<Card.Divider/>` */
children: PropTypes.node,
/** Applies a CSS class to the component’s root element */
className: PropTypes.string,
/** Contains elements that control the component (usually a <CloseButton/>) */
controls: PropTypes.node,
/** Makes a card stretch vertically to max height in a layout or container */
stretchVertically: PropTypes.bool,
/** Applies a drop shadow effect */
showShadow: PropTypes.bool,
/** Hides a portion of card content that overflows its dimensions */
hideOverflow: PropTypes.bool,
/** Applies a data-hook HTML attribute to be used in the tests */
dataHook: PropTypes.string,
};
Card.Content = Content;
Card.Header = Header;
Card.Divider = Divider;
Card.Subheader = Subheader;
export default Card;
//# sourceMappingURL=Card.js.map