UNPKG

2.65 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 memoTheme from "../utils/memoTheme.js";
9import { useDefaultProps } from "../DefaultPropsProvider/index.js";
10import Typography from "../Typography/index.js";
11import { getAlertTitleUtilityClass } from "./alertTitleClasses.js";
12import { jsx as _jsx } from "react/jsx-runtime";
13const useUtilityClasses = ownerState => {
14 const {
15 classes
16 } = ownerState;
17 const slots = {
18 root: ['root']
19 };
20 return composeClasses(slots, getAlertTitleUtilityClass, classes);
21};
22const 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}));
34const AlertTitle = /*#__PURE__*/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 /*#__PURE__*/_jsx(AlertTitleRoot, {
46 gutterBottom: true,
47 component: "div",
48 ownerState: ownerState,
49 ref: ref,
50 className: clsx(classes.root, className),
51 ...other
52 });
53});
54process.env.NODE_ENV !== "production" ? AlertTitle.propTypes /* remove-proptypes */ = {
55 // ┌────────────────────────────── Warning ──────────────────────────────┐
56 // │ These PropTypes are generated from the TypeScript type definitions. │
57 // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
58 // └─────────────────────────────────────────────────────────────────────┘
59 /**
60 * The content of the component.
61 */
62 children: PropTypes.node,
63 /**
64 * Override or extend the styles applied to the component.
65 */
66 classes: PropTypes.object,
67 /**
68 * @ignore
69 */
70 className: PropTypes.string,
71 /**
72 * The system prop that allows defining system overrides as well as additional CSS styles.
73 */
74 sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
75} : void 0;
76export default AlertTitle;
\No newline at end of file