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] Clean the internals and the public API of <PickersPopper /> #16319

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Jan 24, 2025

Part of #16175

  • Rename PickersPopper => PickerPopper
  • Limit the props overridable through theme augmentation
  • Reduce props drilling and use the contexts instead (I added the view stuff to the private context so that we can clean it later if we want to)

@flaviendelangle flaviendelangle self-assigned this Jan 24, 2025
@flaviendelangle flaviendelangle added the component: pickers This is the name of the generic UI component, not the React module! label Jan 24, 2025
@flaviendelangle flaviendelangle force-pushed the pickers-popper-context branch 2 times, most recently from dde1420 to 431d5d9 Compare January 24, 2025 07:11
const themeProps = useThemeProps({
props,
name,
});
const reduceAnimations = useReduceAnimations(themeProps.reduceAnimations);
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 unified the behavior of useReduceAnimations with usePickerOrientation it now takes the explicit value as a param.

@mui-bot
Copy link

mui-bot commented Jan 24, 2025

@flaviendelangle flaviendelangle force-pushed the pickers-popper-context branch 2 times, most recently from c150930 to 5e39ab6 Compare January 24, 2025 07:20
* Whether the heavy animations should be disabled.
* @default `@media(prefers-reduced-motion: reduce)` || `navigator.userAgent` matches Android <10 or iOS <13
*/
reduceAnimations?: boolean;
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if we should name this one with a boolean prefix (shouldReduceAnimations for instance) or not.
I kept the name of the prop for now.

I added it to the public context because I think it's something people should be able to use, especially for custom views when we will stop drilling it to the view.

@flaviendelangle flaviendelangle changed the title [pickers] Use context to remove props on <PickersPopper /> [pickers] lean <PickersPopper /> Jan 24, 2025
@flaviendelangle flaviendelangle changed the title [pickers] lean <PickersPopper /> [pickers] Clean <PickersPopper /> Jan 24, 2025
@flaviendelangle flaviendelangle changed the title [pickers] Clean <PickersPopper /> [pickers] Clean the internals and the public API of <PickersPopper /> Jan 24, 2025
@flaviendelangle flaviendelangle changed the title [pickers] Clean the internals and the public API of <PickersPopper /> [pickers] Clean the internals and the public API of <PickersPopper /> Jan 24, 2025
@flaviendelangle flaviendelangle marked this pull request as ready for review January 24, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change 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.

2 participants