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

[SelectUnstyled] Improve exported types #30895

Merged
merged 8 commits into from Feb 7, 2022

Conversation

michaldudak
Copy link
Member

Part of #30870

  • Exported the type of OptionUnstyled's ownerState
  • Made Popper's slot props optional.
  • Cleaned the OptionState type

@michaldudak michaldudak added component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base labels Feb 3, 2022
@mui-bot
Copy link

mui-bot commented Feb 3, 2022

Details of bundle changes

Generated by 🚫 dangerJS against c0bde88

@@ -29,7 +29,7 @@ export interface SelectUnstyledCommonProps {
componentsProps?: {
root?: React.ComponentPropsWithRef<'button'> & SelectUnstyledComponentsPropsOverrides;
listbox?: React.ComponentPropsWithRef<'ul'> & SelectUnstyledComponentsPropsOverrides;
popper?: React.ComponentPropsWithRef<typeof PopperUnstyled> &
popper?: Partial<React.ComponentPropsWithRef<typeof PopperUnstyled>> &
Copy link
Member

Choose a reason for hiding this comment

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

Why is Partial required here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Popper requires an open prop, but it's not necessary to provide it here in componentsProps.

Copy link
Member

Choose a reason for hiding this comment

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

Alright, could we leave an comment for it?

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, it's done!

<SelectUnstyled
componentsProps={{
root: {
// @ts-expect-error - requires module augmentation
Copy link
Member

Choose a reason for hiding this comment

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

Do we have test for the module augmentation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Now we do 😊

Copy link
Member

Choose a reason for hiding this comment

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

Awesomeness :D

@siriwatknp
Copy link
Member

👋 The migration PR has been merged.

Please follow these steps to make sure that the contents are all updated. (Sorry for the inconvenience)

  1. pull latest master from upstream to your branch
  2. if your PR has changes on the *.md or demo files, you are likely to encounter conflict because all of them have been moved to the new folder.
    2.1 revert the change on those markdown files you did
    2.2 pull latest master from upstream (you should not see conflict)
    2.3 make the changes again at docs/data/material/*
  3. run yarn docs:api
    • you might see the changes in docs/pages/material/api/* if your PR touches some of the components
    • it is okay if there is no changes

If you are struggle with the steps above, feel free to tag @siriwatknp

@michaldudak michaldudak merged commit a76002e into mui:master Feb 7, 2022
@michaldudak michaldudak deleted the select-improvements branch February 7, 2022 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants