UNPKG

@material-ui/core

Version:

React components that implement Google's Material Design.

46 lines (43 loc) 1.32 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import Paper from '../Paper'; import withStyles from '../styles/withStyles'; export var styles = { /* Styles applied to the root element. */ root: { overflow: 'hidden' } }; var Card = React.forwardRef(function Card(props, ref) { var classes = props.classes, className = props.className, _props$raised = props.raised, raised = _props$raised === void 0 ? false : _props$raised, other = _objectWithoutProperties(props, ["classes", "className", "raised"]); return React.createElement(Paper, _extends({ className: clsx(classes.root, className), elevation: raised ? 8 : 1, ref: ref }, other)); }); process.env.NODE_ENV !== "production" ? Card.propTypes = { /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * If `true`, the card will use raised styling. */ raised: PropTypes.bool } : void 0; export default withStyles(styles, { name: 'MuiCard' })(Card);