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

[code-infra] Add alias for icon types #41248

Merged
merged 12 commits into from Mar 7, 2024
Merged

[code-infra] Add alias for icon types #41248

merged 12 commits into from Mar 7, 2024

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Feb 23, 2024

Make sure we have types for icons across the monorepo. This is needed for #41206

  • fixed up types of event handlers for base UI
  • fixed up augmentation of fontsize and color for joy

@mui-bot
Copy link

mui-bot commented Feb 23, 2024

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 7db5203

@Janpot Janpot changed the title [code-infr] Add alias for icon types [code-infra] Add alias for icon types Feb 23, 2024
@@ -65,6 +65,22 @@ declare module '@mui/material/Chip' {
}
}

declare module '@mui/material/SvgIcon' {
Copy link
Member Author

@Janpot Janpot Feb 28, 2024

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)

@Janpot Janpot added the scope: code-infra Specific to the core-infra product label Feb 28, 2024
@Janpot Janpot marked this pull request as ready for review February 28, 2024 14:20
{Object.keys(theme.fontSize).map((size) => (
<Person key={size} fontSize={size} />
))}
<Person fontSize="xs" />
Copy link
Member Author

Choose a reason for hiding this comment

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

@michaldudak
Copy link
Member

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.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 1, 2024
Signed-off-by: Jan Potoms <2109932+Janpot@users.noreply.github.com>
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 1, 2024
@@ -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) => {
Copy link
Member

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?

Suggested change
const handleClose = (_: any, reason?: SnackbarCloseReason) => {
const handleClose = (_: any, reason: SnackbarCloseReason) => {

Copy link
Member Author

@Janpot Janpot Mar 3, 2024

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" />

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 4, 2024
Copy link
Member

@siriwatknp siriwatknp left a 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

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 7, 2024
@Janpot Janpot merged commit 16e8ef7 into mui:master Mar 7, 2024
22 checks passed
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Mar 8, 2024
Signed-off-by: Jan Potoms <2109932+Janpot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the core-infra product typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants