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] complete slots and slotProps #44971

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Jan 8, 2025

Added missing slots: root, icon, message and `action.


@siriwatknp siriwatknp added package: material-ui Specific to @mui/material component: alert This is the name of the generic UI component, not the React module! labels Jan 8, 2025
@mui-bot
Copy link

mui-bot commented Jan 8, 2025

Netlify deploy preview

https://deploy-preview-44971--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against f27138b

Copy link
Contributor

@sai6855 sai6855 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just added 2 suggestions

packages/mui-material/src/Alert/Alert.d.ts Outdated Show resolved Hide resolved
packages/mui-material/src/Alert/Alert.d.ts Outdated Show resolved Hide resolved
packages/mui-material/src/Alert/Alert.js Outdated Show resolved Hide resolved
packages/mui-material/src/Alert/Alert.js Show resolved Hide resolved
@@ -191,6 +191,7 @@ const Alert = React.forwardRef(function Alert(inProps, ref) {
const classes = useUtilityClasses(ownerState);

const externalForwardedProps = {
...other,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is ...other here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that the useSlot can handle the component prop (in …other) properly for the root slot.

@@ -64,7 +64,7 @@ export interface ConformanceOptions {
testStateOverrides?: { prop?: string; value?: any; styleKey: string };
testCustomVariant?: boolean;
testVariantProps?: object;
testLegacyComponentsProp?: boolean;
testLegacyComponentsProp?: boolean | string[];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add this to be able to test specific slot of components.*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: alert This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants