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

[SliderUnstyled] Add useSlider hook and polish #30094

Merged
merged 23 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/pages/api-docs/slider.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
},
"default": "'primary'"
},
"component": { "type": { "name": "elementType" } },
Copy link
Member

Choose a reason for hiding this comment

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

The component prop should remain in the docs, shouldn't 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.

I think it's removed because the prop is available in the unstyled component. Will double check

"components": {
"type": {
"name": "shape",
Expand Down
3 changes: 1 addition & 2 deletions docs/translations/api-docs/slider/slider.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
"track": "The track presentation:<br>- <code>normal</code> the track will render a bar representing the slider value. - <code>inverted</code> the track will render a bar representing the remaining slider value. - <code>false</code> the track will render without a bar.",
"value": "The value of the slider. For ranged sliders, provide an array with two values.",
"valueLabelDisplay": "Controls when the value label is displayed:<br>- <code>auto</code> the value label will display when the thumb is hovered or focused. - <code>on</code> will display persistently. - <code>off</code> will never display.",
"valueLabelFormat": "The format function the value label&#39;s value.<br>When a function is provided, it should have the following signature:<br>- {number} value The value label&#39;s value to format - {number} index The value label&#39;s index to format",
"component": "The component used for the root node. Either a string to use a HTML element or a component."
"valueLabelFormat": "The format function the value label&#39;s value.<br>When a function is provided, it should have the following signature:<br>- {number} value The value label&#39;s value to format - {number} index The value label&#39;s index to format"
},
"classDescriptions": {
"root": { "description": "Class name applied to the root element." },
Expand Down
12 changes: 6 additions & 6 deletions packages/mui-base/src/SliderUnstyled/SliderUnstyled.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ export interface SliderUnstyledTypeMap<P = {}, D extends React.ElementType = 'sp
* @default {}
*/
componentsProps?: {
root?: React.HTMLAttributes<HTMLSpanElement> & SliderUnstyledComponentsPropsOverrides;
track?: React.HTMLAttributes<HTMLSpanElement> & SliderUnstyledComponentsPropsOverrides;
rail?: React.HTMLAttributes<HTMLSpanElement> & SliderUnstyledComponentsPropsOverrides;
thumb?: React.HTMLAttributes<HTMLSpanElement> & SliderUnstyledComponentsPropsOverrides;
mark?: React.HTMLAttributes<HTMLSpanElement> & SliderUnstyledComponentsPropsOverrides;
markLabel?: React.HTMLAttributes<HTMLSpanElement> & SliderUnstyledComponentsPropsOverrides;
root?: React.ComponentPropsWithRef<'span'> & SliderUnstyledComponentsPropsOverrides;
track?: React.ComponentPropsWithRef<'span'> & SliderUnstyledComponentsPropsOverrides;
rail?: React.ComponentPropsWithRef<'span'> & SliderUnstyledComponentsPropsOverrides;
thumb?: React.ComponentPropsWithRef<'span'> & SliderUnstyledComponentsPropsOverrides;
mark?: React.ComponentPropsWithRef<'span'> & SliderUnstyledComponentsPropsOverrides;
markLabel?: React.ComponentPropsWithRef<'span'> & SliderUnstyledComponentsPropsOverrides;
valueLabel?: React.ComponentPropsWithRef<typeof SliderValueLabelUnstyled> &
SliderUnstyledComponentsPropsOverrides;
};
Expand Down