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