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