[chip] Add ChipButton, ChipLink and ChipDelete#48015
[chip] Add ChipButton, ChipLink and ChipDelete#48015mj12albert wants to merge 5 commits intomui:masterfrom
ChipButton, ChipLink and ChipDelete#48015Conversation
Netlify deploy previewBundle size report
|
7c03c51 to
d30ccd0
Compare
d30ccd0 to
958441c
Compare
958441c to
7aa375f
Compare
0ecabdc to
4cb6b07
Compare
ChipButton, ChipLink and ChipDelete
becb6d8 to
9d4087d
Compare
9d4087d to
9e31b8d
Compare
9e31b8d to
f9bc17a
Compare
d6fef7e to
70e344b
Compare
70e344b to
6c399e5
Compare
| // Filter out props whose type is only `undefined` (e.g. from `never | undefined`). | ||
| // There is no meaningful PropTypes validator for a prop that can only be `undefined`. | ||
| filteredNodes = filteredNodes.filter((type) => type.propType.type !== 'UndefinedNode'); |
There was a problem hiding this comment.
what's prop causes this change
| * Props forwarded to the start adornment slot. | ||
| * By default, the available props are based on the span element. | ||
| */ | ||
| startAdornment: SlotProps<'span', {}, ChipOwnerState>; |
There was a problem hiding this comment.
Overall, it looks really good. 👍 Awesome.
For Chip, the effort to make it support legacy and new API in the same component looks fragile to me. Isn't it better if we create a new Chip (v2) with a clean separation, styles classes and theme still shared. For docs, add "Chip v2 [new]" to the sidebar and mark the v1 as deprecated "Chip [deprecated]". Create a codemod for migration.
This way, we reduce the breaking change surface for the current chip, and the code changes from now on will be on v2 only. What do you think?
| props: { variant: 'outlined', color }, | ||
| style: { | ||
| color: p(theme, color).main, | ||
| border: `1px solid ${theme.alpha(p(theme, color).main, 0.7)}`, |
There was a problem hiding this comment.
Is this following other component? using p utility
I'm on board with this, the only thing is how to position it well, v1/v2 maybe confusing at the component level. We used "unstable" before but it looks unappealing to users. Base UI uses "preview" and so does RA, we could do the same? |
I'm good with that. |

Closes #20470
Closes #47234
Closes #46753
Closes #16097
Closes #23041
Previews:
API as discussed:
Chip*components are their own tab stopdivwrapper, and a pseudo-element is used to define the hitbox of the chipRequires [button] AddnativeButtonprop to ButtonBase #47989