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 Chip doc #32819

Merged
merged 14 commits into from
May 26, 2022
Merged

[Joy] Add Chip doc #32819

merged 14 commits into from
May 26, 2022

Conversation

hbjORbj
Copy link
Member

@hbjORbj hbjORbj commented May 18, 2022

Sorry, something went wrong.

@hbjORbj hbjORbj changed the title [Joy] Add Chip doc Draft: [Joy] Add Chip doc May 18, 2022
@hbjORbj hbjORbj changed the title Draft: [Joy] Add Chip doc [Joy] Add Chip doc May 18, 2022
@hbjORbj hbjORbj marked this pull request as draft May 18, 2022 11:53
@hbjORbj hbjORbj added docs Improvements or additions to the documentation component: chip This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy labels May 18, 2022
@mui-bot
Copy link

mui-bot commented May 18, 2022

No bundle size changes

Generated by 🚫 dangerJS against 4d4ac3c

@hbjORbj hbjORbj self-assigned this May 18, 2022
@danilo-leal
Copy link
Contributor

Something I just realized while playing with the demo there is that the size variant is purely affecting the Chip's padding?! I'd intuitively expect that prop to also affect text size, otherwise, we have mostly a difference on horizontal padding. Does that make sense to you @hbjORbj and @siriwatknp?

@siriwatknp
Copy link
Member

siriwatknp commented May 19, 2022

Something I just realized while playing with the demo there is that the size variant is purely affecting the Chip's padding?! I'd intuitively expect that prop to also affect text size, otherwise, we have mostly a difference on horizontal padding. Does that make sense to you @hbjORbj and @siriwatknp?

I think you don't see the text size changes because there is a Typography (by default it uses body1 typography from the theme) placed inside the chip. I think if @hbjORbj removes the typography, it should work.

@danilo-leal
Copy link
Contributor

Right, cool! Just pushed a commit with those changes :)

@danilo-leal
Copy link
Contributor

Another thing that just came up while designing the email UI: I remember we removed the clickable prop from the Chip but can't really recall why now 😅 Should we bring it back?

@siriwatknp
Copy link
Member

siriwatknp commented May 20, 2022

Another thing that just came up while designing the email UI: I remember we removed the clickable prop from the Chip but can't really recall why now 😅 Should we bring it back?

clickable is replaced by onClick prop. @hbjORbj Can you add demos for these headings?

## Decorators

## Delete button

## Clickable

## With checkbox

## With radio

The demos have been done in https://deploy-preview-32819--material-ui.netlify.app/experiments/joy/chip/

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 24, 2022
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label May 24, 2022
@hbjORbj hbjORbj marked this pull request as ready for review May 24, 2022 11:35
@hbjORbj hbjORbj requested a review from siriwatknp May 24, 2022 11:35
hbjORbj added 3 commits May 24, 2022 12:59

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@siriwatknp
Copy link
Member

Looks much better!

Some improvements that I think:

Basic
I think this is redundant given the playground.

Decorators

  • The demo, eg. "Turn on lights" looks like it is clickable. Can you find another text that does not lead to that expectation?
  • I think there should be 2 chips in this demo, the startDecorator and endDecorator. Please remove the ChipDelete.

** Delete button**

  • The demo is too big (no need to use Array).
  • Shows 2 chips where:
    <Chip variant="outlined" endDecorator={<ChipDelete />}>text</Chip>
    <Chip variant="soft" endDecorator={<ChipDelete variant="plain" />}>text</Chip>
  • Add "The variant of the ChipDelete changes based on the parent Chip unless you specify a specific variant to it." (Feel free to make this phrase better)

Clickable

  • 1 chip with onClick is enough

Clickable and Deletable (new)

  • also 1 chip is enough

With checkbox

  • don't hide the toolbar

With radio

  • don't hide the toolbar

@hbjORbj
Copy link
Member Author

hbjORbj commented May 25, 2022

@siriwatknp

Thanks for the feedback, Jun. I addressed them all.

);
})}
</RadioGroup>
</Box>
Copy link
Member

Choose a reason for hiding this comment

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

Should we add a TextField for customizing the children?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. Done

@hbjORbj hbjORbj requested a review from siriwatknp May 26, 2022 08:45
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.

👍 Nice!

@hbjORbj hbjORbj merged commit a08576c into mui:master May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: chip This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation package: joy-ui Specific to @mui/joy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants