UNPKG

2.68 kBJavaScriptView Raw
1'use client';
2
3import * as React from 'react';
4import PropTypes from 'prop-types';
5import clsx from 'clsx';
6import composeClasses from '@mui/utils/composeClasses';
7import { styled } from "../zero-styled/index.js";
8import { useDefaultProps } from "../DefaultPropsProvider/index.js";
9import { getCardContentUtilityClass } from "./cardContentClasses.js";
10import { jsx as _jsx } from "react/jsx-runtime";
11const useUtilityClasses = ownerState => {
12 const {
13 classes
14 } = ownerState;
15 const slots = {
16 root: ['root']
17 };
18 return composeClasses(slots, getCardContentUtilityClass, classes);
19};
20const CardContentRoot = styled('div', {
21 name: 'MuiCardContent',
22 slot: 'Root',
23 overridesResolver: (props, styles) => styles.root
24})({
25 padding: 16,
26 '&:last-child': {
27 paddingBottom: 24
28 }
29});
30const CardContent = /*#__PURE__*/React.forwardRef(function CardContent(inProps, ref) {
31 const props = useDefaultProps({
32 props: inProps,
33 name: 'MuiCardContent'
34 });
35 const {
36 className,
37 component = 'div',
38 ...other
39 } = props;
40 const ownerState = {
41 ...props,
42 component
43 };
44 const classes = useUtilityClasses(ownerState);
45 return /*#__PURE__*/_jsx(CardContentRoot, {
46 as: component,
47 className: clsx(classes.root, className),
48 ownerState: ownerState,
49 ref: ref,
50 ...other
51 });
52});
53process.env.NODE_ENV !== "production" ? CardContent.propTypes /* remove-proptypes */ = {
54 // ┌────────────────────────────── Warning ──────────────────────────────┐
55 // │ These PropTypes are generated from the TypeScript type definitions. │
56 // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
57 // └─────────────────────────────────────────────────────────────────────┘
58 /**
59 * The content of the component.
60 */
61 children: PropTypes.node,
62 /**
63 * Override or extend the styles applied to the component.
64 */
65 classes: PropTypes.object,
66 /**
67 * @ignore
68 */
69 className: PropTypes.string,
70 /**
71 * The component used for the root node.
72 * Either a string to use a HTML element or a component.
73 */
74 component: PropTypes.elementType,
75 /**
76 * The system prop that allows defining system overrides as well as additional CSS styles.
77 */
78 sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
79} : void 0;
80export default CardContent;
\No newline at end of file