[material-next][ButtonGroup] Change ButtonGroup files to ts#39794
[material-next][ButtonGroup] Change ButtonGroup files to ts#39794DiegoAndai merged 18 commits intomui:masterfrom
ButtonGroup files to ts#39794Conversation
Netlify deploy previewBundle size reportDetails of bundle changes (Toolpad) |
|
@mnajdova I have changed the type for the OwnerState so far. We should try to adopt this way for the other components in |
|
@mnajdova @mj12albert We could also consider introducing a new type in @mui/types to make it easier to create the OwnerState types. An example of this would be: type PickRequired<T, K extends keyof T> = DistributiveOmit<T, K> & {
[P in K]-?: T[P];
};We could introduce this in this PR or in a separate one. Then we could use this type as follows: import { PickRequired } from '@mui/types'
export interface ButtonGroupOwnerState
extends PickRequired<ButtonGroupProps,
| 'color'
| 'disabled'
| 'disableElevation'
| 'disableRipple'
| 'disableTouchRipple'
| 'fullWidth'
| 'orientation'
| 'size'
| 'variant'
> {} |
I agree this could be helpful, we could discuss and refine in a separate issue CC @DiegoAndai We've actually kind of started making OwnerState types with Omit/Required/Pick here and there already 😅 e.g.
|
|
The types look good to me 👍 I will let @DiegoAndai chime in and let his opinion lastly before we merge this. Thanks a lot for the effort @lhilgert9 🙏 |
DiegoAndai
left a comment
There was a problem hiding this comment.
This looks good to me 🎉
The utility type for the owner state also makes sense to me. Left a comment on that issue.
Should we merge this @mnajdova? Go ahead if you think we should, just asking as you were reviewing it originally.
|
@DiegoAndai @mnajdova OwnerState type is now also fixed. Now everything should be ready in this PR to merge. |
mnajdova
left a comment
There was a problem hiding this comment.
Sorry for the delay, let's udpate to matest master and merge 👍
|
@mnajdova Done👍🏽 |
ButtonGroup issue: #39686
Material You umbrella issue: #29345
Changes
ButtonGroupfiles to TS