1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
3 | const _excluded = ["className"];
|
4 | import * as React from 'react';
|
5 | import PropTypes from 'prop-types';
|
6 | import clsx from 'clsx';
|
7 | import { unstable_composeClasses as composeClasses } from '@mui/base';
|
8 | import styled from '../styles/styled';
|
9 | import useThemeProps from '../styles/useThemeProps';
|
10 | import Typography from '../Typography';
|
11 | import { getAlertTitleUtilityClass } from './alertTitleClasses';
|
12 | import { jsx as _jsx } from "react/jsx-runtime";
|
13 |
|
14 | const useUtilityClasses = ownerState => {
|
15 | const {
|
16 | classes
|
17 | } = ownerState;
|
18 | const slots = {
|
19 | root: ['root']
|
20 | };
|
21 | return composeClasses(slots, getAlertTitleUtilityClass, classes);
|
22 | };
|
23 |
|
24 | const AlertTitleRoot = styled(Typography, {
|
25 | name: 'MuiAlertTitle',
|
26 | slot: 'Root',
|
27 | overridesResolver: (props, styles) => styles.root
|
28 | })(({
|
29 | theme
|
30 | }) => {
|
31 | return {
|
32 | fontWeight: theme.typography.fontWeightMedium,
|
33 | marginTop: -2
|
34 | };
|
35 | });
|
36 | const AlertTitle = React.forwardRef(function AlertTitle(inProps, ref) {
|
37 | const props = useThemeProps({
|
38 | props: inProps,
|
39 | name: 'MuiAlertTitle'
|
40 | });
|
41 |
|
42 | const {
|
43 | className
|
44 | } = props,
|
45 | other = _objectWithoutPropertiesLoose(props, _excluded);
|
46 |
|
47 | const ownerState = props;
|
48 | const classes = useUtilityClasses(ownerState);
|
49 | return _jsx(AlertTitleRoot, _extends({
|
50 | gutterBottom: true,
|
51 | component: "div",
|
52 | ownerState: ownerState,
|
53 | ref: ref,
|
54 | className: clsx(classes.root, className)
|
55 | }, other));
|
56 | });
|
57 | process.env.NODE_ENV !== "production" ? AlertTitle.propTypes
|
58 |
|
59 | = {
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 | |
66 |
|
67 |
|
68 | children: PropTypes.node,
|
69 |
|
70 | |
71 |
|
72 |
|
73 | classes: PropTypes.object,
|
74 |
|
75 | |
76 |
|
77 |
|
78 | className: PropTypes.string,
|
79 |
|
80 | |
81 |
|
82 |
|
83 | sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
84 | } : void 0;
|
85 | export default AlertTitle; |
\ | No newline at end of file |