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

[Joy] Add Typography component #30489

Merged
merged 16 commits into from
Jan 7, 2022
Merged

Conversation

siriwatknp
Copy link
Member

Summary
Mostly replicate material Typography component with some deprecations:

  • deprecate variant to use level prop instead (variant has another meaning in Joy)
  • deprecate align and paragraph prop because of sx prop.

The intention of deprecation instead of removing is to ease people who are familiar with material (To be honest, I am a bit reluctant about this decision, waiting to see the team's thought)


@mui-pr-bot
Copy link

mui-pr-bot commented Jan 4, 2022

Details of bundle changes

@mui/joy: parsed: +2.24% , gzip: +2.04%

Generated by 🚫 dangerJS against 5b4dc4b

},
})<{ ownerState: TypographyProps }>(({ theme, ownerState }) => ({
margin: 0,
// TODO: remove in the next major version
Copy link
Member

Choose a reason for hiding this comment

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

What next version do these TODOs refer to? As we're building the first version, we can introduce breaking changes (vs material) now, can't we?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I also doubt my initial thought. @danilo-leal What do you think? should we go with only level prop or leave it like this and revisit again before the official release?

Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't make too much sense to me to maintain @mui/material props in any Joy component for the sake of ease of transition. They're meant to be different things with different stakes/trade-offs (at least at some levels), so I'd go for breaking away from Material when appropriate from the get-go.

inherit: 'p',
};

const Typography = React.forwardRef(function Typography(inProps, ref) {
Copy link
Member

Choose a reason for hiding this comment

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

Side note: I'm wondering why don't we just call it Text - it's much shorter to type :)

Copy link
Member Author

@siriwatknp siriwatknp Jan 5, 2022

Choose a reason for hiding this comment

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

I don't want to change the component name at this point but I think @oliviertassinari can explain the history of "Typography".

siriwatknp and others added 2 commits January 6, 2022 11:43
Co-authored-by: Michał Dudak <michal.dudak@gmail.com>
Co-authored-by: Benny Joo <sldisek783@gmail.com>
Copy link
Member

@hbjORbj hbjORbj left a comment

Choose a reason for hiding this comment

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

Love it 😀

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 7, 2022
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 7, 2022
@siriwatknp siriwatknp merged commit e81f306 into mui:master Jan 7, 2022
@oliviertassinari oliviertassinari added component: Typography The React component. package: joy-ui Specific to @mui/joy labels Jan 7, 2022
wladimirguerra pushed a commit to wladimirguerra/material-ui that referenced this pull request Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Typography The React component. package: joy-ui Specific to @mui/joy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants