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 { getAccordionActionsUtilityClass } from "./accordionActionsClasses.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, getAccordionActionsUtilityClass, classes);
|
20 | };
|
21 | const AccordionActionsRoot = styled('div', {
|
22 | name: 'MuiAccordionActions',
|
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 | variants: [{
|
36 | props: props => !props.disableSpacing,
|
37 | style: {
|
38 | '& > :not(style) ~ :not(style)': {
|
39 | marginLeft: 8
|
40 | }
|
41 | }
|
42 | }]
|
43 | });
|
44 | const AccordionActions = React.forwardRef(function AccordionActions(inProps, ref) {
|
45 | const props = useDefaultProps({
|
46 | props: inProps,
|
47 | name: 'MuiAccordionActions'
|
48 | });
|
49 | const {
|
50 | className,
|
51 | disableSpacing = false,
|
52 | ...other
|
53 | } = props;
|
54 | const ownerState = {
|
55 | ...props,
|
56 | disableSpacing
|
57 | };
|
58 | const classes = useUtilityClasses(ownerState);
|
59 | return _jsx(AccordionActionsRoot, {
|
60 | className: clsx(classes.root, className),
|
61 | ref: ref,
|
62 | ownerState: ownerState,
|
63 | ...other
|
64 | });
|
65 | });
|
66 | process.env.NODE_ENV !== "production" ? AccordionActions.propTypes = {
|
67 |
|
68 |
|
69 |
|
70 |
|
71 | |
72 |
|
73 |
|
74 | children: PropTypes.node,
|
75 | |
76 |
|
77 |
|
78 | classes: PropTypes.object,
|
79 | |
80 |
|
81 |
|
82 | className: PropTypes.string,
|
83 | |
84 |
|
85 |
|
86 |
|
87 | disableSpacing: PropTypes.bool,
|
88 | |
89 |
|
90 |
|
91 | sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
92 | } : void 0;
|
93 | export default AccordionActions; |
\ | No newline at end of file |