mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
94.03k stars 32.31k forks source link

[icons] Material Icons do not support Joy UI's "danger" color prop #42325

Open NaveenEdala opened 6 months ago

NaveenEdala commented 6 months ago

Steps to reproduce

Link to live example:

Steps:

  1. Import any Icon from "@mui/icons-material"
  2. Import Button from "@mui/joy"
  3. Set the color prop on any Icon to "danger"

Current behavior

Type '"danger"' is not assignable to type '"primary" | "success" | "warning" | "disabled" | "action" | "inherit" | "secondary" | "error" | "info" | undefined'.

Expected behavior

Expected behavior is for the icon to inherit the red "danger" color, as is the case with all Joy components.

Context

I'm trying to use it to create simple label strings (in )

Your environment

npx @mui/envinfo ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```

Search keywords: Icons, Icons-Material, Joy UI, Danger

danilo-leal commented 5 months ago

Heya @NaveenEdala, thanks for the issue! I see that's an issue, but I'd expect to have some way to map Joy's danger prop to Material's error prop instead of the Material Icons package, also accounting for something that's not Material Design. @siriwatknp any ideas there? I'm not sure we should focus on this too much, too, though.

beppemarazzi commented 3 months ago

To workaround this issue i have to add somewhere in my project something like:

declare module "@mui/material/SvgIcon" {
    interface SvgIconPropsColorOverrides {
        danger: true;
    }
  }
NaveenEdala commented 2 days ago

Interesting fix, I've tried this to limited success. Thank you!

At the moment it seems like Joy itself is on the backburner while Material UI v6 is being rolled out, plus the Material Design 3 standards are also a priority. So I just ended up migrating my project from Joy to the main Material UI.

Hopefully Joy is picked back up sometime in the future!

siriwatknp commented 2 days ago

Thanks for reporting the issue! Joy UI development is temporarily on hold as the maintainers focus on the next two major releases of Material UI