1 | 'use client';
|
2 |
|
3 | import * as React from 'react';
|
4 | import PropTypes from 'prop-types';
|
5 | import clsx from 'clsx';
|
6 | import composeClasses from '@mui/utils/composeClasses';
|
7 | import { styled } from "../zero-styled/index.js";
|
8 | import memoTheme from "../utils/memoTheme.js";
|
9 | import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
10 | import { getDialogContentUtilityClass } from "./dialogContentClasses.js";
|
11 | import dialogTitleClasses from "../DialogTitle/dialogTitleClasses.js";
|
12 | import { jsx as _jsx } from "react/jsx-runtime";
|
13 | const useUtilityClasses = ownerState => {
|
14 | const {
|
15 | classes,
|
16 | dividers
|
17 | } = ownerState;
|
18 | const slots = {
|
19 | root: ['root', dividers && 'dividers']
|
20 | };
|
21 | return composeClasses(slots, getDialogContentUtilityClass, classes);
|
22 | };
|
23 | const DialogContentRoot = styled('div', {
|
24 | name: 'MuiDialogContent',
|
25 | slot: 'Root',
|
26 | overridesResolver: (props, styles) => {
|
27 | const {
|
28 | ownerState
|
29 | } = props;
|
30 | return [styles.root, ownerState.dividers && styles.dividers];
|
31 | }
|
32 | })(memoTheme(({
|
33 | theme
|
34 | }) => ({
|
35 | flex: '1 1 auto',
|
36 |
|
37 | WebkitOverflowScrolling: 'touch',
|
38 | overflowY: 'auto',
|
39 | padding: '20px 24px',
|
40 | variants: [{
|
41 | props: ({
|
42 | ownerState
|
43 | }) => ownerState.dividers,
|
44 | style: {
|
45 | padding: '16px 24px',
|
46 | borderTop: `1px solid ${(theme.vars || theme).palette.divider}`,
|
47 | borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
|
48 | }
|
49 | }, {
|
50 | props: ({
|
51 | ownerState
|
52 | }) => !ownerState.dividers,
|
53 | style: {
|
54 | [`.${dialogTitleClasses.root} + &`]: {
|
55 | paddingTop: 0
|
56 | }
|
57 | }
|
58 | }]
|
59 | })));
|
60 | const DialogContent = React.forwardRef(function DialogContent(inProps, ref) {
|
61 | const props = useDefaultProps({
|
62 | props: inProps,
|
63 | name: 'MuiDialogContent'
|
64 | });
|
65 | const {
|
66 | className,
|
67 | dividers = false,
|
68 | ...other
|
69 | } = props;
|
70 | const ownerState = {
|
71 | ...props,
|
72 | dividers
|
73 | };
|
74 | const classes = useUtilityClasses(ownerState);
|
75 | return _jsx(DialogContentRoot, {
|
76 | className: clsx(classes.root, className),
|
77 | ownerState: ownerState,
|
78 | ref: ref,
|
79 | ...other
|
80 | });
|
81 | });
|
82 | process.env.NODE_ENV !== "production" ? DialogContent.propTypes = {
|
83 |
|
84 |
|
85 |
|
86 |
|
87 | |
88 |
|
89 |
|
90 | children: PropTypes.node,
|
91 | |
92 |
|
93 |
|
94 | classes: PropTypes.object,
|
95 | |
96 |
|
97 |
|
98 | className: PropTypes.string,
|
99 | |
100 |
|
101 |
|
102 |
|
103 | dividers: PropTypes.bool,
|
104 | |
105 |
|
106 |
|
107 | sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
108 | } : void 0;
|
109 | export default DialogContent; |
\ | No newline at end of file |