1 | 'use client';
|
2 |
|
3 | import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
4 | import _extends from "@babel/runtime/helpers/esm/extends";
|
5 | import * as React from 'react';
|
6 | import PropTypes from 'prop-types';
|
7 | import clsx from 'clsx';
|
8 | import composeClasses from '@mui/utils/composeClasses';
|
9 | import styled from '../styles/styled';
|
10 | import { useDefaultProps } from '../DefaultPropsProvider';
|
11 | import { getCardActionsUtilityClass } from './cardActionsClasses';
|
12 | import { jsx as _jsx } from "react/jsx-runtime";
|
13 | var useUtilityClasses = function useUtilityClasses(ownerState) {
|
14 | var classes = ownerState.classes,
|
15 | disableSpacing = ownerState.disableSpacing;
|
16 | var slots = {
|
17 | root: ['root', !disableSpacing && 'spacing']
|
18 | };
|
19 | return composeClasses(slots, getCardActionsUtilityClass, classes);
|
20 | };
|
21 | var CardActionsRoot = styled('div', {
|
22 | name: 'MuiCardActions',
|
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 | }, !ownerState.disableSpacing && {
|
35 | '& > :not(style) ~ :not(style)': {
|
36 | marginLeft: 8
|
37 | }
|
38 | });
|
39 | });
|
40 | var CardActions = React.forwardRef(function CardActions(inProps, ref) {
|
41 | var props = useDefaultProps({
|
42 | props: inProps,
|
43 | name: 'MuiCardActions'
|
44 | });
|
45 | var _props$disableSpacing = props.disableSpacing,
|
46 | disableSpacing = _props$disableSpacing === void 0 ? false : _props$disableSpacing,
|
47 | className = props.className,
|
48 | other = _objectWithoutProperties(props, ["disableSpacing", "className"]);
|
49 | var ownerState = _extends({}, props, {
|
50 | disableSpacing: disableSpacing
|
51 | });
|
52 | var classes = useUtilityClasses(ownerState);
|
53 | return _jsx(CardActionsRoot, _extends({
|
54 | className: clsx(classes.root, className),
|
55 | ownerState: ownerState,
|
56 | ref: ref
|
57 | }, other));
|
58 | });
|
59 | process.env.NODE_ENV !== "production" ? CardActions.propTypes = {
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | |
65 |
|
66 |
|
67 | children: PropTypes.node,
|
68 | |
69 |
|
70 |
|
71 | classes: PropTypes.object,
|
72 | |
73 |
|
74 |
|
75 | className: PropTypes.string,
|
76 | |
77 |
|
78 |
|
79 |
|
80 | disableSpacing: PropTypes.bool,
|
81 | |
82 |
|
83 |
|
84 | sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
85 | } : void 0;
|
86 | export default CardActions; |
\ | No newline at end of file |