1 | import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
2 | import _extends from "@babel/runtime/helpers/esm/extends";
|
3 | import * as React from 'react';
|
4 | import PropTypes from 'prop-types';
|
5 | import clsx from 'clsx';
|
6 | import { unstable_composeClasses as composeClasses } from '@mui/base';
|
7 | import styled from '../styles/styled';
|
8 | import useThemeProps from '../styles/useThemeProps';
|
9 | import { getDialogActionsUtilityClass } from './dialogActionsClasses';
|
10 | import { jsx as _jsx } from "react/jsx-runtime";
|
11 |
|
12 | var useUtilityClasses = function useUtilityClasses(ownerState) {
|
13 | var classes = ownerState.classes,
|
14 | disableSpacing = ownerState.disableSpacing;
|
15 | var slots = {
|
16 | root: ['root', !disableSpacing && 'spacing']
|
17 | };
|
18 | return composeClasses(slots, getDialogActionsUtilityClass, classes);
|
19 | };
|
20 |
|
21 | var DialogActionsRoot = styled('div', {
|
22 | name: 'MuiDialogActions',
|
23 | slot: 'Root',
|
24 | overridesResolver: function overridesResolver(props, styles) {
|
25 | var ownerState = props.ownerState;
|
26 | return [styles.root, !ownerState.disableSpacing && styles.spacing];
|
27 | }
|
28 | })(function (_ref) {
|
29 | var ownerState = _ref.ownerState;
|
30 | return _extends({
|
31 | display: 'flex',
|
32 | alignItems: 'center',
|
33 | padding: 8,
|
34 | justifyContent: 'flex-end',
|
35 | flex: '0 0 auto'
|
36 | }, !ownerState.disableSpacing && {
|
37 | '& > :not(:first-of-type)': {
|
38 | marginLeft: 8
|
39 | }
|
40 | });
|
41 | });
|
42 | var DialogActions = React.forwardRef(function DialogActions(inProps, ref) {
|
43 | var props = useThemeProps({
|
44 | props: inProps,
|
45 | name: 'MuiDialogActions'
|
46 | });
|
47 |
|
48 | var className = props.className,
|
49 | _props$disableSpacing = props.disableSpacing,
|
50 | disableSpacing = _props$disableSpacing === void 0 ? false : _props$disableSpacing,
|
51 | other = _objectWithoutProperties(props, ["className", "disableSpacing"]);
|
52 |
|
53 | var ownerState = _extends({}, props, {
|
54 | disableSpacing: disableSpacing
|
55 | });
|
56 |
|
57 | var classes = useUtilityClasses(ownerState);
|
58 | return _jsx(DialogActionsRoot, _extends({
|
59 | className: clsx(classes.root, className),
|
60 | ownerState: ownerState,
|
61 | ref: ref
|
62 | }, other));
|
63 | });
|
64 | process.env.NODE_ENV !== "production" ? DialogActions.propTypes
|
65 |
|
66 | = {
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 | |
73 |
|
74 |
|
75 | children: PropTypes.node,
|
76 |
|
77 | |
78 |
|
79 |
|
80 | classes: PropTypes.object,
|
81 |
|
82 | |
83 |
|
84 |
|
85 | className: PropTypes.string,
|
86 |
|
87 | |
88 |
|
89 |
|
90 |
|
91 | disableSpacing: PropTypes.bool,
|
92 |
|
93 | |
94 |
|
95 |
|
96 | sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
97 | } : void 0;
|
98 | export default DialogActions; |
\ | No newline at end of file |