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

[base] Add explicit interfaces for the return values of the public hooks #35933

Closed
15 tasks done
mnajdova opened this issue Jan 24, 2023 · 12 comments
Closed
15 tasks done
Labels
docs Improvements or additions to the documentation package: base-ui Specific to @mui/base ready to take Help wanted. Guidance available. There is a high chance the change will be accepted typescript umbrella For grouping multiple issues to provide a holistic view

Comments

@mnajdova
Copy link
Member

mnajdova commented Jan 24, 2023

Summary 💡

As we are adding API pages for the public hooks of MUI Base, we need to have explicit interfaces for the return values. The interfaces' names should follow the naming pattern: ${HookName}ReturnValue, for example: UseButtonReturnValue. This is the list of all hooks we have at this moment:

If you plan to work on some of the hooks, please leave a comment on the issue.

Examples 🌈

As an example, you can take a look at the UseButtonReturnValue. This is how the API page section for the return value will look like: https://deploy-preview-35828--material-ui.netlify.app/base/api/use-button/#return-value

Motivation 🔦

Having explicit hooks for the return values will help with the type check performances, and will allow us to extract the values in the API pages.

@mnajdova mnajdova added umbrella For grouping multiple issues to provide a holistic view typescript ready to take Help wanted. Guidance available. There is a high chance the change will be accepted package: base-ui Specific to @mui/base labels Jan 24, 2023
@HeVictor
Copy link
Contributor

Hi, I'd like to give the useAutocomplete hook task a crack if that's alright. Thanks!

@github-project-automation github-project-automation bot moved this to To do 📃 in Base UI Feb 1, 2023
@mnajdova mnajdova moved this from To do 📃 to In progress 🛠 in Base UI Feb 3, 2023
@skevprog
Copy link
Contributor

skevprog commented Feb 3, 2023

Hi! I would like to take the useBadge hook if it's ok.

@the-mgi
Copy link
Contributor

the-mgi commented Feb 26, 2023

hello, i'd like to take useMenu.

@rayrw
Copy link
Contributor

rayrw commented Feb 27, 2023

Hi! I'd like to take useMenuItem.

@the-mgi
Copy link
Contributor

the-mgi commented Mar 3, 2023

created a PR for useSlider.

@varunmulay22
Copy link
Contributor

Hey I'd like to take useSelect, thanks

@michaldudak
Copy link
Member

I'm doing a pretty big refactoring in the useSelect hook, and I'll add these types in the process.
@varunmulay22 could you take useSlider instead?

@varunmulay22
Copy link
Contributor

sure happy to do so thanks

@varunmulay22
Copy link
Contributor

@michaldudak @mnajdova created a PR for useSlider thanks

@Kimzify
Copy link
Contributor

Kimzify commented Mar 21, 2023

Is it possible to take useFormControlUnstyledContext or useSelect? thanks.

@ZeeshanTamboli
Copy link
Member

Is it possible to take useFormControlUnstyledContext or useSelect? thanks.

@kimiyahajizadeh useFormControlUnstyledContext had a PR already created in #36302, while useSelect is undergoing a major refactoring during which the type will be added.

@michaldudak
Copy link
Member

All done.

@github-project-automation github-project-automation bot moved this from In progress 🛠 to Done 🎉 in Base UI Apr 14, 2023
@michaldudak michaldudak removed this from Base UI Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation package: base-ui Specific to @mui/base ready to take Help wanted. Guidance available. There is a high chance the change will be accepted typescript umbrella For grouping multiple issues to provide a holistic view
Projects
None yet
Development

No branches or pull requests

10 participants