UNPKG

2.09 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 withStyles from '../styles/withStyles';
7export const styles = theme => ({
8 /* Styles applied to the root element. */
9 root: {
10 flex: '1 1 auto',
11 WebkitOverflowScrolling: 'touch',
12 // Add iOS momentum scrolling.
13 overflowY: 'auto',
14 padding: '8px 24px',
15 '&:first-child': {
16 // dialog without title
17 paddingTop: 20
18 }
19 },
20
21 /* Styles applied to the root element if `dividers={true}`. */
22 dividers: {
23 padding: '16px 24px',
24 borderTop: `1px solid ${theme.palette.divider}`,
25 borderBottom: `1px solid ${theme.palette.divider}`
26 }
27});
28const DialogContent = /*#__PURE__*/React.forwardRef(function DialogContent(props, ref) {
29 const {
30 classes,
31 className,
32 dividers = false
33 } = props,
34 other = _objectWithoutPropertiesLoose(props, ["classes", "className", "dividers"]);
35
36 return /*#__PURE__*/React.createElement("div", _extends({
37 className: clsx(classes.root, className, dividers && classes.dividers),
38 ref: ref
39 }, other));
40});
41process.env.NODE_ENV !== "production" ? DialogContent.propTypes = {
42 // ----------------------------- Warning --------------------------------
43 // | These PropTypes are generated from the TypeScript type definitions |
44 // | To update them edit the d.ts file and run "yarn proptypes" |
45 // ----------------------------------------------------------------------
46
47 /**
48 * The content of the component.
49 */
50 children: PropTypes.node,
51
52 /**
53 * Override or extend the styles applied to the component.
54 * See [CSS API](#css) below for more details.
55 */
56 classes: PropTypes.object,
57
58 /**
59 * @ignore
60 */
61 className: PropTypes.string,
62
63 /**
64 * Display the top and bottom dividers.
65 */
66 dividers: PropTypes.bool
67} : void 0;
68export default withStyles(styles, {
69 name: 'MuiDialogContent'
70})(DialogContent);
\No newline at end of file