UNPKG

1.65 kBJavaScriptView Raw
1import _extends from "@babel/runtime/helpers/esm/extends";
2import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3import * as React from 'react';
4import PropTypes from 'prop-types';
5import clsx from 'clsx';
6import Paper from '../Paper';
7import withStyles from '../styles/withStyles';
8export const styles = {
9 /* Styles applied to the root element. */
10 root: {
11 overflow: 'hidden'
12 }
13};
14const Card = /*#__PURE__*/React.forwardRef(function Card(props, ref) {
15 const {
16 classes,
17 className,
18 raised = false
19 } = props,
20 other = _objectWithoutPropertiesLoose(props, ["classes", "className", "raised"]);
21
22 return /*#__PURE__*/React.createElement(Paper, _extends({
23 className: clsx(classes.root, className),
24 elevation: raised ? 8 : 1,
25 ref: ref
26 }, other));
27});
28process.env.NODE_ENV !== "production" ? Card.propTypes = {
29 // ----------------------------- Warning --------------------------------
30 // | These PropTypes are generated from the TypeScript type definitions |
31 // | To update them edit the d.ts file and run "yarn proptypes" |
32 // ----------------------------------------------------------------------
33
34 /**
35 * The content of the component.
36 */
37 children: PropTypes.node,
38
39 /**
40 * Override or extend the styles applied to the component.
41 * See [CSS API](#css) below for more details.
42 */
43 classes: PropTypes.object,
44
45 /**
46 * @ignore
47 */
48 className: PropTypes.string,
49
50 /**
51 * If `true`, the card will use raised styling.
52 */
53 raised: PropTypes.bool
54} : void 0;
55export default withStyles(styles, {
56 name: 'MuiCard'
57})(Card);
\No newline at end of file