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

[pickers] Create the new picker's ownerState object #14889

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Oct 9, 2024

Part of #14475

No breaking change, we can merge it before the alpha.

  • Create a new PickerOwnerState interface and create the ownerState in usePicker
  • Use the new ownerState from usePicker for the openPickerIcon slot which already uses a small object

@flaviendelangle flaviendelangle added the component: pickers This is the name of the generic UI component, not the React module! label Oct 9, 2024
@flaviendelangle flaviendelangle self-assigned this Oct 9, 2024
@mui-bot
Copy link

mui-bot commented Oct 9, 2024

Deploy preview: https://deploy-preview-14889--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against a85d00e

@@ -14,3 +14,22 @@ export interface PickerValidDateLookup {}
export type PickerValidDate = keyof PickerValidDateLookup extends number
? any
: PickerValidDateLookup[keyof PickerValidDateLookup];

export interface PickerOwnerState<TValue> {
Copy link
Member Author

Choose a reason for hiding this comment

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

I would be in favor of keeping the object as minimal as possible for now and add more properties as user request them.

But if you have another property that you think is important, I can of course add it 👍

Copy link
Member

Choose a reason for hiding this comment

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

We currently manually add WrapperVariant to use in some slots like the ActionBar and ToolBar. Perhaps it will be cleaner to add it directly to the hook instead ? 
I see it as an information that can be valuable for customization in any slot.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a very good candidate for the ownerState indeed 👌

I propose to treat it in a follow up, because I'm not sure we want to have it in its current shape.
We discussed following MD3 nomenclature (docked and modal) instead of mobile and desktop and this would impact the name of this property.

@flaviendelangle flaviendelangle changed the title [pickers] Prepare new picker ownerState object [pickers] Create the new picker's ownerState object Oct 9, 2024
@flaviendelangle flaviendelangle marked this pull request as ready for review October 9, 2024 09:04
Copy link
Member

@arthurbalduini arthurbalduini left a comment

Choose a reason for hiding this comment

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

Looks good and very promising to me 🎉
Thanks for this initiative !

@flaviendelangle flaviendelangle merged commit a005076 into mui:master Oct 16, 2024
18 checks passed
@flaviendelangle flaviendelangle deleted the ownerState-picker branch October 16, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants