Skip to content

Commit

Permalink
[material-ui][Alert] Add slots and slotProps type to theme (mui#4…
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 authored and mnajdova committed Mar 8, 2024
1 parent b919a5d commit ad401ee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/mui-material/src/Alert/Alert.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type AlertSlotsAndSlotProps = CreateSlotsAndSlotProps<
}
>;

export interface AlertProps extends StandardProps<PaperProps, 'variant'> {
export interface AlertProps extends StandardProps<PaperProps, 'variant'>, AlertSlotsAndSlotProps {
/**
* The action to display. It renders after the message, at the end of the alert.
*/
Expand Down Expand Up @@ -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;
14 changes: 14 additions & 0 deletions packages/mui-material/src/Alert/Alert.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { CloseRounded } from '@mui/icons-material';
import { createTheme } from '@mui/material';

createTheme({
components: {
MuiAlert: {
defaultProps: {
slots: {
closeIcon: CloseRounded,
},
},
},
},
});

0 comments on commit ad401ee

Please sign in to comment.