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 memoTheme from "../utils/memoTheme.js";
|
9 | import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
10 | import Typography from "../Typography/index.js";
|
11 | import { getAlertTitleUtilityClass } from "./alertTitleClasses.js";
|
12 | import { jsx as _jsx } from "react/jsx-runtime";
|
13 | const useUtilityClasses = ownerState => {
|
14 | const {
|
15 | classes
|
16 | } = ownerState;
|
17 | const slots = {
|
18 | root: ['root']
|
19 | };
|
20 | return composeClasses(slots, getAlertTitleUtilityClass, classes);
|
21 | };
|
22 | const AlertTitleRoot = styled(Typography, {
|
23 | name: 'MuiAlertTitle',
|
24 | slot: 'Root',
|
25 | overridesResolver: (props, styles) => styles.root
|
26 | })(memoTheme(({
|
27 | theme
|
28 | }) => {
|
29 | return {
|
30 | fontWeight: theme.typography.fontWeightMedium,
|
31 | marginTop: -2
|
32 | };
|
33 | }));
|
34 | const AlertTitle = React.forwardRef(function AlertTitle(inProps, ref) {
|
35 | const props = useDefaultProps({
|
36 | props: inProps,
|
37 | name: 'MuiAlertTitle'
|
38 | });
|
39 | const {
|
40 | className,
|
41 | ...other
|
42 | } = props;
|
43 | const ownerState = props;
|
44 | const classes = useUtilityClasses(ownerState);
|
45 | return _jsx(AlertTitleRoot, {
|
46 | gutterBottom: true,
|
47 | component: "div",
|
48 | ownerState: ownerState,
|
49 | ref: ref,
|
50 | className: clsx(classes.root, className),
|
51 | ...other
|
52 | });
|
53 | });
|
54 | process.env.NODE_ENV !== "production" ? AlertTitle.propTypes = {
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | |
60 |
|
61 |
|
62 | children: PropTypes.node,
|
63 | |
64 |
|
65 |
|
66 | classes: PropTypes.object,
|
67 | |
68 |
|
69 |
|
70 | className: PropTypes.string,
|
71 | |
72 |
|
73 |
|
74 | sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
75 | } : void 0;
|
76 | export default AlertTitle; |
\ | No newline at end of file |