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