From df521913b5a15744621578edaf06bd093d0d6ce8 Mon Sep 17 00:00:00 2001 From: sai6855 Date: Fri, 1 Mar 2024 18:49:02 +0530 Subject: [PATCH 1/2] Update AlertProps interface in Alert.d.ts --- packages/mui-material/src/Alert/Alert.d.ts | 4 ++-- packages/mui-material/src/Alert/Alert.spec.tsx | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 packages/mui-material/src/Alert/Alert.spec.tsx diff --git a/packages/mui-material/src/Alert/Alert.d.ts b/packages/mui-material/src/Alert/Alert.d.ts index 70875f28848eea..a267dec3c89f9d 100644 --- a/packages/mui-material/src/Alert/Alert.d.ts +++ b/packages/mui-material/src/Alert/Alert.d.ts @@ -33,7 +33,7 @@ export type AlertSlotsAndSlotProps = CreateSlotsAndSlotProps< } >; -export interface AlertProps extends StandardProps { +export interface AlertProps extends StandardProps, AlertSlotsAndSlotProps { /** * The action to display. It renders after the message, at the end of the alert. */ @@ -133,4 +133,4 @@ export interface AlertOwnerState extends AlertProps {} * - [Alert API](https://mui.com/material-ui/api/alert/) * - inherits [Paper API](https://mui.com/material-ui/api/paper/) */ -export default function Alert(props: AlertProps & AlertSlotsAndSlotProps): JSX.Element; +export default function Alert(props: AlertProps): JSX.Element; diff --git a/packages/mui-material/src/Alert/Alert.spec.tsx b/packages/mui-material/src/Alert/Alert.spec.tsx new file mode 100644 index 00000000000000..76ceb6c54a4099 --- /dev/null +++ b/packages/mui-material/src/Alert/Alert.spec.tsx @@ -0,0 +1,16 @@ +import { createTheme } from '@mui/material/styles'; +import * as React from 'react'; + +const CloseIcon = () =>
; + +const theme = createTheme({ + components: { + MuiAlert: { + defaultProps: { + slots: { + closeIcon: CloseIcon, + }, + }, + }, + }, +}); From af2164fdf5daecd5501da0b522ea847eb303f484 Mon Sep 17 00:00:00 2001 From: sai6855 Date: Fri, 1 Mar 2024 18:49:53 +0530 Subject: [PATCH 2/2] Update AlertProps interface in Alert.d.ts --- packages/mui-material/src/Alert/Alert.d.ts | 4 ++-- packages/mui-material/src/Alert/Alert.spec.tsx | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 packages/mui-material/src/Alert/Alert.spec.tsx diff --git a/packages/mui-material/src/Alert/Alert.d.ts b/packages/mui-material/src/Alert/Alert.d.ts index 70875f28848eea..a267dec3c89f9d 100644 --- a/packages/mui-material/src/Alert/Alert.d.ts +++ b/packages/mui-material/src/Alert/Alert.d.ts @@ -33,7 +33,7 @@ export type AlertSlotsAndSlotProps = CreateSlotsAndSlotProps< } >; -export interface AlertProps extends StandardProps { +export interface AlertProps extends StandardProps, AlertSlotsAndSlotProps { /** * The action to display. It renders after the message, at the end of the alert. */ @@ -133,4 +133,4 @@ export interface AlertOwnerState extends AlertProps {} * - [Alert API](https://mui.com/material-ui/api/alert/) * - inherits [Paper API](https://mui.com/material-ui/api/paper/) */ -export default function Alert(props: AlertProps & AlertSlotsAndSlotProps): JSX.Element; +export default function Alert(props: AlertProps): JSX.Element; diff --git a/packages/mui-material/src/Alert/Alert.spec.tsx b/packages/mui-material/src/Alert/Alert.spec.tsx new file mode 100644 index 00000000000000..dbfeb1222427a0 --- /dev/null +++ b/packages/mui-material/src/Alert/Alert.spec.tsx @@ -0,0 +1,14 @@ +import { CloseRounded } from '@mui/icons-material'; +import { createTheme } from '@mui/material'; + +createTheme({ + components: { + MuiAlert: { + defaultProps: { + slots: { + closeIcon: CloseRounded, + }, + }, + }, + }, +});