Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui][Alert] Add slots and slotProps type to theme #41324

Merged
merged 4 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
},
},
},
},
});
Loading