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

[TextField][material-next] Add FormLabel and InputLabel components #39483

Merged
merged 27 commits into from
Nov 8, 2023

Conversation

mj12albert
Copy link
Member

@mj12albert mj12albert commented Oct 17, 2023

Part of #38374
Closes #39512

This PR refactors FormLabel and InputLabel for material-next, I included both as they integrate directly together to make some visible progress on the experiments page ~

material-next-filled-form-label.mov

@mj12albert mj12albert added component: text field This is the name of the generic UI component, not the React module! design: material you labels Oct 17, 2023
@mui-bot
Copy link

mui-bot commented Oct 17, 2023

Netlify deploy preview

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

@mui/material-next: parsed: +0.42% , gzip: +0.41%

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 2ef3c7a

@mj12albert mj12albert force-pushed the material-next/form-label branch 3 times, most recently from b5b5dc7 to ebd1433 Compare October 18, 2023 05:57
@mj12albert mj12albert force-pushed the material-next/form-label branch 2 times, most recently from 9c5d50d to 7af9d6c Compare October 24, 2023 10:33
@mj12albert mj12albert changed the title [FormLabel][material-next] Add FormLabel component [TextField][material-next] Add FormLabel and InputLabel components Oct 24, 2023
@mj12albert mj12albert force-pushed the material-next/form-label branch 3 times, most recently from 8444c6e to 4e69fca Compare October 26, 2023 10:20
@mj12albert mj12albert force-pushed the material-next/form-label branch 5 times, most recently from 7ba3c66 to 070f057 Compare October 31, 2023 12:43
Comment on lines +69 to +70
color:
'color-mix(in srgb, var(--md-comp-form-label-disabled-color), transparent calc(var(--md-comp-form-label-disabled-opacity) * 100%))',
Copy link
Member Author

Choose a reason for hiding this comment

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

From: https://una.im/color-mix-opacity/
A neat trick using color-mix to adjust the opacity of color

Copy link
Member

Choose a reason for hiding this comment

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

👏🏼 also using this in the Chip component. It's very useful for Material You's styles.

Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

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

Looks good to me 😄
As it has the Material You implementation, we should have someone from the design team review it from a design perspective, could you request a review from them?

@@ -243,7 +249,7 @@ InputLabel.propTypes /* remove-proptypes */ = {
/**
* The variant to use.
*/
variant: PropTypes.oneOf(['filled', 'outlined', 'standard']),
};
variant: PropTypes.oneOf(['filled', 'outlined']),
Copy link
Member

Choose a reason for hiding this comment

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

Probably not in this PR, but we should remember to add the removal of the standard variants on the migration guide.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added it anyway for now, even though it's just copy-pasta from FilledInput but we can reorganize the content later when there's more components ~

Co-authored-by: Diego Andai <diego@mui.com>
Signed-off-by: Albert Yu <albert@albertyu.co>
@mj12albert
Copy link
Member Author

As it has the Material You implementation, we should have someone from the design team review it

Asked @zanivan for a review 🙏

(PS I'm planning to do the layout change involving the InputAdornment when integrating InputAdornment #39628 (comment))

@zanivan
Copy link
Contributor

zanivan commented Nov 6, 2023

Hey @mj12albert it looks great!

Just some clarifying questions:

  • Is this PR only addressing the filled variant?
  • If I got it right, the adornment placing and behaviors will be addressed in a following PR, right?

If so, the filled variants look good, and as I see, it matches perfectly the tokens from MD3 :)

@mj12albert
Copy link
Member Author

Just some clarifying questions

@zanivan Yes and yes ~ I plan to assemble only the filled TextField first before tackling outlined.

I will do the changes related to the adornment in the InputAdornment PR, if I spotted this change sooner I would have done the adornment first but either way will work out ok 😬

@mj12albert mj12albert merged commit 3bada36 into mui:master Nov 8, 2023
23 checks passed
@mj12albert mj12albert deleted the material-next/form-label branch November 8, 2023 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module! design: material you
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[InputLabel][material-next] Add InputLabel component
4 participants