-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[code-infra] Add alias for icon types #41248
Conversation
Netlify deploy previewhttps://deploy-preview-41248--material-ui.netlify.app/ Bundle size report |
@@ -65,6 +65,22 @@ declare module '@mui/material/Chip' { | |||
} | |||
} | |||
|
|||
declare module '@mui/material/SvgIcon' { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to add a few interface augmentations to make icons types work for joy (cc @siriwatknp)
{Object.keys(theme.fontSize).map((size) => ( | ||
<Person key={size} fontSize={size} /> | ||
))} | ||
<Person fontSize="xs" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also cc @siriwatknp for suggesting a different solution if necessary
https://deploy-preview-41248--material-ui.netlify.app/joy-ui/integrations/icon-libraries/#size
It's all good from a Base UI perspective. I'll let @siriwatknp review the Joy UI changes as I don't know the original intent. |
Signed-off-by: Jan Potoms <[email protected]>
@@ -10,7 +10,7 @@ export default function TransitionComponentSnackbar() { | |||
const [exited, setExited] = React.useState(true); | |||
const nodeRef = React.useRef(null); | |||
|
|||
const handleClose = (_: any, reason: SnackbarCloseReason) => { | |||
const handleClose = (_: any, reason?: SnackbarCloseReason) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's guaranteed to be defined, no?
const handleClose = (_: any, reason?: SnackbarCloseReason) => { | |
const handleClose = (_: any, reason: SnackbarCloseReason) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not always, this is passed as a click handler to an SvgIcon
. that's why it started failing when we added types for icons to the code base. Before, all icons were typed any
and accepted this handler without warning.
<CloseIcon onClick={handleClose} className="snackbar-close-icon" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 All good from my side
Signed-off-by: Jan Potoms <[email protected]>
Make sure we have types for icons across the monorepo. This is needed for #41206