@mui/material 5.11.5 → 5.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/accordionClasses.d.ts +18 -18
- package/AccordionActions/accordionActionsClasses.d.ts +10 -10
- package/AccordionDetails/accordionDetailsClasses.d.ts +8 -8
- package/AccordionSummary/accordionSummaryClasses.d.ts +22 -22
- package/Alert/alertClasses.d.ts +44 -44
- package/AlertTitle/alertTitleClasses.d.ts +8 -8
- package/AppBar/appBarClasses.d.ts +28 -28
- package/Autocomplete/autocompleteClasses.d.ts +54 -54
- package/Avatar/avatarClasses.d.ts +20 -20
- package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
- package/Backdrop/backdropClasses.d.ts +10 -10
- package/Badge/badgeClasses.d.ts +56 -56
- package/BottomNavigation/BottomNavigation.js +0 -0
- package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
- package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
- package/Box/Box.d.ts +3 -2
- package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
- package/Button/Button.js +0 -2
- package/Button/buttonClasses.d.ts +100 -100
- package/ButtonBase/buttonBaseClasses.d.ts +12 -12
- package/ButtonBase/touchRippleClasses.d.ts +20 -20
- package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
- package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
- package/CHANGELOG.md +74 -0
- package/Card/cardClasses.d.ts +8 -8
- package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
- package/CardActions/cardActionsClasses.d.ts +10 -10
- package/CardContent/cardContentClasses.d.ts +8 -8
- package/CardHeader/cardHeaderClasses.d.ts +18 -18
- package/CardMedia/cardMediaClasses.d.ts +12 -12
- package/Checkbox/checkboxClasses.d.ts +18 -18
- package/Chip/chipClasses.d.ts +96 -96
- package/CircularProgress/circularProgressClasses.d.ts +26 -26
- package/ClickAwayListener/index.d.ts +2 -2
- package/Collapse/collapseClasses.d.ts +18 -18
- package/Container/containerClasses.d.ts +6 -6
- package/Dialog/DialogContext.d.ts +6 -6
- package/Dialog/dialogClasses.d.ts +36 -36
- package/DialogActions/dialogActionsClasses.d.ts +10 -10
- package/DialogContent/dialogContentClasses.d.ts +10 -10
- package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
- package/DialogTitle/dialogTitleClasses.d.ts +8 -8
- package/Divider/dividerClasses.d.ts +34 -34
- package/Drawer/drawerClasses.d.ts +30 -30
- package/Fab/fabClasses.d.ts +26 -26
- package/FilledInput/filledInputClasses.d.ts +40 -40
- package/FormControl/FormControlContext.d.ts +17 -17
- package/FormControl/formControlClasses.d.ts +14 -14
- package/FormControl/useFormControl.d.ts +2 -2
- package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
- package/FormGroup/formGroupClasses.d.ts +12 -12
- package/FormHelperText/formHelperTextClasses.d.ts +22 -22
- package/FormLabel/formLabelClasses.d.ts +22 -22
- package/Grid/gridClasses.d.ts +48 -48
- package/Icon/iconClasses.d.ts +24 -24
- package/IconButton/iconButtonClasses.d.ts +34 -34
- package/ImageList/imageListClasses.d.ts +16 -16
- package/ImageListItem/imageListItemClasses.d.ts +18 -18
- package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
- package/Input/inputClasses.d.ts +34 -34
- package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
- package/InputBase/inputBaseClasses.d.ts +46 -46
- package/InputLabel/inputLabelClasses.d.ts +32 -32
- package/LinearProgress/linearProgressClasses.d.ts +42 -42
- package/Link/getTextDecoration.d.ts +15 -15
- package/Link/linkClasses.d.ts +18 -18
- package/List/listClasses.d.ts +14 -14
- package/ListItem/listItemClasses.d.ts +30 -30
- package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
- package/ListItemButton/listItemButtonClasses.d.ts +22 -22
- package/ListItemIcon/listItemIconClasses.d.ts +10 -10
- package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
- package/ListItemText/listItemTextClasses.d.ts +18 -18
- package/ListSubheader/listSubheaderClasses.d.ts +18 -18
- package/Menu/menuClasses.d.ts +12 -12
- package/MenuItem/menuItemClasses.d.ts +20 -20
- package/MobileStepper/mobileStepperClasses.d.ts +22 -22
- package/NativeSelect/nativeSelectClasses.d.ts +32 -32
- package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
- package/Pagination/paginationClasses.d.ts +14 -14
- package/PaginationItem/paginationItemClasses.d.ts +42 -42
- package/Paper/paperClasses.d.ts +39 -39
- package/Popover/popoverClasses.d.ts +10 -10
- package/Popper/Popper.d.ts +37 -37
- package/Radio/radioClasses.d.ts +16 -16
- package/RadioGroup/RadioGroupContext.d.ts +11 -11
- package/RadioGroup/useRadioGroup.d.ts +4 -4
- package/Rating/ratingClasses.d.ts +40 -40
- package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
- package/Select/selectClasses.d.ts +30 -30
- package/Skeleton/skeletonClasses.d.ts +26 -26
- package/Slider/Slider.d.ts +215 -35
- package/Slider/Slider.js +7 -7
- package/Slider/SliderValueLabel.d.ts +15 -15
- package/Slider/SliderValueLabel.js +3 -0
- package/Slider/SliderValueLabel.types.d.ts +24 -24
- package/Slider/index.d.ts +2 -0
- package/Slider/index.js +2 -1
- package/Slider/sliderClasses.d.ts +58 -29
- package/Slider/sliderClasses.js +5 -3
- package/Snackbar/snackbarClasses.d.ts +20 -20
- package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
- package/SpeedDial/speedDialClasses.d.ts +22 -22
- package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
- package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
- package/Step/StepContext.d.ts +20 -20
- package/Step/stepClasses.d.ts +16 -16
- package/StepButton/stepButtonClasses.d.ts +14 -14
- package/StepConnector/stepConnectorClasses.d.ts +26 -26
- package/StepContent/stepContentClasses.d.ts +12 -12
- package/StepIcon/stepIconClasses.d.ts +16 -16
- package/StepLabel/stepLabelClasses.d.ts +28 -28
- package/Stepper/StepperContext.d.ts +18 -18
- package/Stepper/stepperClasses.d.ts +14 -14
- package/SvgIcon/svgIconClasses.d.ts +26 -26
- package/SwipeableDrawer/SwipeableDrawer.d.ts +15 -0
- package/SwipeableDrawer/SwipeableDrawer.js +48 -17
- package/Switch/switchClasses.d.ts +32 -32
- package/Tab/tabClasses.d.ts +26 -26
- package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
- package/Table/tableClasses.d.ts +10 -10
- package/TableBody/tableBodyClasses.d.ts +8 -8
- package/TableCell/tableCellClasses.d.ts +32 -32
- package/TableContainer/tableContainerClasses.d.ts +8 -8
- package/TableFooter/tableFooterClasses.d.ts +8 -8
- package/TableHead/tableHeadClasses.d.ts +8 -8
- package/TablePagination/tablePaginationClasses.d.ts +28 -28
- package/TableRow/tableRowClasses.d.ts +16 -16
- package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
- package/Tabs/tabsClasses.d.ts +32 -32
- package/TextField/textFieldClasses.d.ts +8 -8
- package/ToggleButton/toggleButtonClasses.d.ts +24 -24
- package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
- package/Toolbar/toolbarClasses.d.ts +14 -14
- package/Tooltip/tooltipClasses.d.ts +30 -30
- package/Typography/typographyClasses.d.ts +50 -50
- package/Unstable_Grid2/Grid2.d.ts +4 -4
- package/Unstable_Grid2/Grid2Props.d.ts +15 -15
- package/Unstable_Grid2/grid2Classes.d.ts +5 -5
- package/Unstable_Grid2/index.d.ts +4 -4
- package/className/index.d.ts +1 -1
- package/darkScrollbar/index.d.ts +28 -28
- package/generateUtilityClass/index.d.ts +2 -2
- package/generateUtilityClasses/index.d.ts +1 -1
- package/index.js +1 -1
- package/internal/switchBaseClasses.d.ts +12 -12
- package/legacy/BottomNavigation/BottomNavigation.js +0 -0
- package/legacy/Button/Button.js +0 -2
- package/legacy/Slider/Slider.js +7 -7
- package/legacy/Slider/SliderValueLabel.js +3 -0
- package/legacy/Slider/index.js +2 -1
- package/legacy/Slider/sliderClasses.js +5 -3
- package/legacy/SwipeableDrawer/SwipeableDrawer.js +50 -17
- package/legacy/index.js +1 -1
- package/locale/index.d.ts +75 -75
- package/modern/BottomNavigation/BottomNavigation.js +0 -0
- package/modern/Button/Button.js +0 -2
- package/modern/Slider/Slider.js +7 -7
- package/modern/Slider/SliderValueLabel.js +3 -0
- package/modern/Slider/index.js +2 -1
- package/modern/Slider/sliderClasses.js +5 -3
- package/modern/SwipeableDrawer/SwipeableDrawer.js +47 -17
- package/modern/index.js +1 -1
- package/node/BottomNavigation/BottomNavigation.js +0 -0
- package/node/Button/Button.js +0 -2
- package/node/Slider/Slider.js +6 -6
- package/node/Slider/SliderValueLabel.js +3 -0
- package/node/Slider/index.js +12 -2
- package/node/Slider/sliderClasses.js +6 -3
- package/node/SwipeableDrawer/SwipeableDrawer.js +48 -17
- package/node/index.js +1 -1
- package/package.json +3 -3
- package/styles/CssVarsProvider.d.ts +16 -16
- package/styles/excludeVariablesFromRoot.d.ts +5 -5
- package/styles/getOverlayAlpha.d.ts +2 -2
- package/transitions/index.d.ts +1 -1
- package/transitions/transition.d.ts +13 -13
- package/transitions/utils.d.ts +23 -23
- package/types/OverridableComponentAugmentation.d.ts +31 -31
- package/umd/material-ui.development.js +63 -33
- package/umd/material-ui.production.min.js +20 -20
- package/useMediaQuery/useMediaQuery.d.ts +31 -31
- package/useTouchRipple/index.d.ts +1 -1
- package/useTouchRipple/useTouchRipple.d.ts +28 -28
- package/utils/getScrollbarSize.d.ts +2 -2
- package/utils/ownerDocument.d.ts +2 -2
- package/utils/ownerWindow.d.ts +2 -2
- package/utils/setRef.d.ts +2 -2
package/Slider/Slider.d.ts
CHANGED
|
@@ -1,24 +1,39 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
ExtendSliderUnstyled,
|
|
5
|
-
SliderUnstyledTypeMap,
|
|
6
|
-
SliderValueLabelProps,
|
|
7
|
-
} from '@mui/base/SliderUnstyled';
|
|
2
|
+
import { SlotComponentProps } from '@mui/base';
|
|
3
|
+
import { Mark } from '@mui/base/SliderUnstyled';
|
|
8
4
|
import { SxProps } from '@mui/system';
|
|
9
5
|
import { OverridableStringUnion } from '@mui/types';
|
|
10
6
|
import { Theme } from '../styles';
|
|
11
|
-
import { OverrideProps } from '../OverridableComponent';
|
|
7
|
+
import { OverrideProps, OverridableComponent } from '../OverridableComponent';
|
|
8
|
+
import SliderValueLabelComponent from './SliderValueLabel';
|
|
9
|
+
import { SliderClasses } from './sliderClasses';
|
|
12
10
|
|
|
13
11
|
export interface SliderPropsColorOverrides {}
|
|
14
12
|
|
|
15
13
|
export interface SliderPropsSizeOverrides {}
|
|
16
14
|
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
export interface SliderComponentsPropsOverrides {}
|
|
16
|
+
|
|
17
|
+
export interface SliderOwnerState extends SliderProps {
|
|
18
|
+
dragging: boolean;
|
|
19
|
+
marked: boolean;
|
|
20
|
+
focusedThumbIndex: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface SliderTypeMap<D extends React.ElementType = 'span', P = {}> {
|
|
21
24
|
props: P & {
|
|
25
|
+
/**
|
|
26
|
+
* The label of the slider.
|
|
27
|
+
*/
|
|
28
|
+
'aria-label'?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The id of the element containing a label for the slider.
|
|
31
|
+
*/
|
|
32
|
+
'aria-labelledby'?: string;
|
|
33
|
+
/**
|
|
34
|
+
* A string value that provides a user-friendly name for the current value of the slider.
|
|
35
|
+
*/
|
|
36
|
+
'aria-valuetext'?: string;
|
|
22
37
|
/**
|
|
23
38
|
* The color of the component.
|
|
24
39
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
@@ -53,38 +68,209 @@ export type SliderTypeMap<
|
|
|
53
68
|
*
|
|
54
69
|
* @default {}
|
|
55
70
|
*/
|
|
56
|
-
componentsProps?:
|
|
71
|
+
componentsProps?: {
|
|
72
|
+
root?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
73
|
+
track?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
74
|
+
rail?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
75
|
+
thumb?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
76
|
+
mark?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
77
|
+
markLabel?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
78
|
+
valueLabel?: SlotComponentProps<
|
|
79
|
+
typeof SliderValueLabelComponent,
|
|
80
|
+
SliderComponentsPropsOverrides,
|
|
81
|
+
SliderOwnerState
|
|
82
|
+
>;
|
|
83
|
+
input?: SlotComponentProps<'input', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
84
|
+
};
|
|
57
85
|
/**
|
|
58
86
|
* Override or extend the styles applied to the component.
|
|
59
87
|
*/
|
|
60
|
-
classes?:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
88
|
+
classes?: Partial<SliderClasses>;
|
|
89
|
+
/**
|
|
90
|
+
* The default value. Use when the component is not controlled.
|
|
91
|
+
*/
|
|
92
|
+
defaultValue?: number | number[];
|
|
93
|
+
/**
|
|
94
|
+
* If `true`, the component is disabled.
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
97
|
+
disabled?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* If `true`, the active thumb doesn't swap when moving pointer over a thumb while dragging another thumb.
|
|
100
|
+
* @default false
|
|
101
|
+
*/
|
|
102
|
+
disableSwap?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Accepts a function which returns a string value that provides a user-friendly name for the thumb labels of the slider.
|
|
105
|
+
* This is important for screen reader users.
|
|
106
|
+
* @param {number} index The thumb label's index to format.
|
|
107
|
+
* @returns {string}
|
|
108
|
+
*/
|
|
109
|
+
getAriaLabel?: (index: number) => string;
|
|
110
|
+
/**
|
|
111
|
+
* Accepts a function which returns a string value that provides a user-friendly name for the current value of the slider.
|
|
112
|
+
* This is important for screen reader users.
|
|
113
|
+
* @param {number} value The thumb label's value to format.
|
|
114
|
+
* @param {number} index The thumb label's index to format.
|
|
115
|
+
* @returns {string}
|
|
116
|
+
*/
|
|
117
|
+
getAriaValueText?: (value: number, index: number) => string;
|
|
118
|
+
/**
|
|
119
|
+
* Marks indicate predetermined values to which the user can move the slider.
|
|
120
|
+
* If `true` the marks are spaced according the value of the `step` prop.
|
|
121
|
+
* If an array, it should contain objects with `value` and an optional `label` keys.
|
|
122
|
+
* @default false
|
|
123
|
+
*/
|
|
124
|
+
marks?: boolean | Mark[];
|
|
125
|
+
/**
|
|
126
|
+
* The maximum allowed value of the slider.
|
|
127
|
+
* Should not be equal to min.
|
|
128
|
+
* @default 100
|
|
129
|
+
*/
|
|
130
|
+
max?: number;
|
|
131
|
+
/**
|
|
132
|
+
* The minimum allowed value of the slider.
|
|
133
|
+
* Should not be equal to max.
|
|
134
|
+
* @default 0
|
|
135
|
+
*/
|
|
136
|
+
min?: number;
|
|
137
|
+
/**
|
|
138
|
+
* Name attribute of the hidden `input` element.
|
|
139
|
+
*/
|
|
140
|
+
name?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Callback function that is fired when the slider's value changed.
|
|
143
|
+
*
|
|
144
|
+
* @param {Event} event The event source of the callback.
|
|
145
|
+
* You can pull out the new value by accessing `event.target.value` (any).
|
|
146
|
+
* **Warning**: This is a generic event not a change event.
|
|
147
|
+
* @param {number | number[]} value The new value.
|
|
148
|
+
* @param {number} activeThumb Index of the currently moved thumb.
|
|
149
|
+
*/
|
|
150
|
+
onChange?: (event: Event, value: number | number[], activeThumb: number) => void;
|
|
151
|
+
/**
|
|
152
|
+
* Callback function that is fired when the `mouseup` is triggered.
|
|
153
|
+
*
|
|
154
|
+
* @param {React.SyntheticEvent | Event} event The event source of the callback. **Warning**: This is a generic event not a change event.
|
|
155
|
+
* @param {number | number[]} value The new value.
|
|
156
|
+
*/
|
|
157
|
+
onChangeCommitted?: (event: React.SyntheticEvent | Event, value: number | number[]) => void;
|
|
158
|
+
/**
|
|
159
|
+
* The component orientation.
|
|
160
|
+
* @default 'horizontal'
|
|
161
|
+
*/
|
|
162
|
+
orientation?: 'horizontal' | 'vertical';
|
|
163
|
+
/**
|
|
164
|
+
* A transformation function, to change the scale of the slider.
|
|
165
|
+
* @param {any} x
|
|
166
|
+
* @returns {any}
|
|
167
|
+
* @default function Identity(x) {
|
|
168
|
+
* return x;
|
|
169
|
+
* }
|
|
170
|
+
*/
|
|
171
|
+
scale?: (value: number) => number;
|
|
74
172
|
/**
|
|
75
173
|
* The size of the slider.
|
|
76
174
|
* @default 'medium'
|
|
77
175
|
*/
|
|
78
176
|
size?: OverridableStringUnion<'small' | 'medium', SliderPropsSizeOverrides>;
|
|
177
|
+
/**
|
|
178
|
+
* The props used for each slot inside the Slider.
|
|
179
|
+
* @default {}
|
|
180
|
+
*/
|
|
181
|
+
slotProps?: {
|
|
182
|
+
root?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
183
|
+
track?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
184
|
+
rail?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
185
|
+
thumb?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
186
|
+
mark?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
187
|
+
markLabel?: SlotComponentProps<'span', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
188
|
+
valueLabel?: SlotComponentProps<
|
|
189
|
+
typeof SliderValueLabelComponent,
|
|
190
|
+
SliderComponentsPropsOverrides,
|
|
191
|
+
SliderOwnerState
|
|
192
|
+
>;
|
|
193
|
+
input?: SlotComponentProps<'input', SliderComponentsPropsOverrides, SliderOwnerState>;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* The components used for each slot inside the Slider.
|
|
197
|
+
* Either a string to use a HTML element or a component.
|
|
198
|
+
* @default {}
|
|
199
|
+
*/
|
|
200
|
+
slots?: {
|
|
201
|
+
root?: React.ElementType;
|
|
202
|
+
track?: React.ElementType;
|
|
203
|
+
rail?: React.ElementType;
|
|
204
|
+
thumb?: React.ElementType;
|
|
205
|
+
mark?: React.ElementType;
|
|
206
|
+
markLabel?: React.ElementType;
|
|
207
|
+
valueLabel?: React.ElementType;
|
|
208
|
+
input?: React.ElementType;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* The granularity with which the slider can step through values. (A "discrete" slider.)
|
|
212
|
+
* The `min` prop serves as the origin for the valid values.
|
|
213
|
+
* We recommend (max - min) to be evenly divisible by the step.
|
|
214
|
+
*
|
|
215
|
+
* When step is `null`, the thumb can only be slid onto marks provided with the `marks` prop.
|
|
216
|
+
* @default 1
|
|
217
|
+
*/
|
|
218
|
+
step?: number | null;
|
|
79
219
|
/**
|
|
80
220
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
81
221
|
*/
|
|
82
222
|
sx?: SxProps<Theme>;
|
|
223
|
+
/**
|
|
224
|
+
* Tab index attribute of the hidden `input` element.
|
|
225
|
+
*/
|
|
226
|
+
tabIndex?: number;
|
|
227
|
+
/**
|
|
228
|
+
* The track presentation:
|
|
229
|
+
*
|
|
230
|
+
* - `normal` the track will render a bar representing the slider value.
|
|
231
|
+
* - `inverted` the track will render a bar representing the remaining slider value.
|
|
232
|
+
* - `false` the track will render without a bar.
|
|
233
|
+
* @default 'normal'
|
|
234
|
+
*/
|
|
235
|
+
track?: 'normal' | false | 'inverted';
|
|
236
|
+
/**
|
|
237
|
+
* The value of the slider.
|
|
238
|
+
* For ranged sliders, provide an array with two values.
|
|
239
|
+
*/
|
|
240
|
+
value?: number | number[];
|
|
241
|
+
/**
|
|
242
|
+
* Controls when the value label is displayed:
|
|
243
|
+
*
|
|
244
|
+
* - `auto` the value label will display when the thumb is hovered or focused.
|
|
245
|
+
* - `on` will display persistently.
|
|
246
|
+
* - `off` will never display.
|
|
247
|
+
* @default 'off'
|
|
248
|
+
*/
|
|
249
|
+
valueLabelDisplay?: 'on' | 'auto' | 'off';
|
|
250
|
+
/**
|
|
251
|
+
* The format function the value label's value.
|
|
252
|
+
*
|
|
253
|
+
* When a function is provided, it should have the following signature:
|
|
254
|
+
*
|
|
255
|
+
* - {number} value The value label's value to format
|
|
256
|
+
* - {number} index The value label's index to format
|
|
257
|
+
* @param {any} x
|
|
258
|
+
* @returns {any}
|
|
259
|
+
* @default function Identity(x) {
|
|
260
|
+
* return x;
|
|
261
|
+
* }
|
|
262
|
+
*/
|
|
263
|
+
valueLabelFormat?: string | ((value: number, index: number) => React.ReactNode);
|
|
83
264
|
};
|
|
84
265
|
defaultComponent: D;
|
|
85
|
-
}
|
|
266
|
+
}
|
|
86
267
|
|
|
87
|
-
export
|
|
268
|
+
export interface SliderValueLabelProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
269
|
+
children: React.ReactElement;
|
|
270
|
+
index: number;
|
|
271
|
+
open: boolean;
|
|
272
|
+
value: number;
|
|
273
|
+
}
|
|
88
274
|
|
|
89
275
|
type SliderRootProps = NonNullable<SliderTypeMap['props']['componentsProps']>['root'];
|
|
90
276
|
type SliderMarkProps = NonNullable<SliderTypeMap['props']['componentsProps']>['mark'];
|
|
@@ -111,17 +297,11 @@ export declare const SliderValueLabel: React.FC<SliderValueLabelProps>;
|
|
|
111
297
|
*
|
|
112
298
|
* - [Slider API](https://mui.com/material-ui/api/slider/)
|
|
113
299
|
*/
|
|
114
|
-
declare const Slider:
|
|
115
|
-
|
|
116
|
-
export type SliderClassKey = keyof NonNullable<SliderTypeMap['props']['classes']>;
|
|
300
|
+
declare const Slider: OverridableComponent<SliderTypeMap>;
|
|
117
301
|
|
|
118
302
|
export type SliderProps<
|
|
119
303
|
D extends React.ElementType = SliderTypeMap['defaultComponent'],
|
|
120
304
|
P = {},
|
|
121
305
|
> = OverrideProps<SliderTypeMap<D, P>, D>;
|
|
122
306
|
|
|
123
|
-
export type SliderClasses = Record<SliderClassKey, string>;
|
|
124
|
-
|
|
125
|
-
export declare const sliderClasses: SliderClasses;
|
|
126
|
-
|
|
127
307
|
export default Slider;
|
package/Slider/Slider.js
CHANGED
|
@@ -6,15 +6,15 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { chainPropTypes } from '@mui/utils';
|
|
8
8
|
import { isHostComponent, useSlotProps, unstable_composeClasses as composeClasses } from '@mui/base';
|
|
9
|
-
import { useSlider
|
|
9
|
+
import { useSlider } from '@mui/base/SliderUnstyled';
|
|
10
10
|
import { alpha, lighten, darken } from '@mui/system';
|
|
11
11
|
import useThemeProps from '../styles/useThemeProps';
|
|
12
12
|
import styled, { slotShouldForwardProp } from '../styles/styled';
|
|
13
13
|
import useTheme from '../styles/useTheme';
|
|
14
14
|
import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
|
|
15
15
|
import capitalize from '../utils/capitalize';
|
|
16
|
-
import
|
|
17
|
-
import sliderClasses from './sliderClasses';
|
|
16
|
+
import SliderValueLabel from './SliderValueLabel';
|
|
17
|
+
import sliderClasses, { getSliderUtilityClass } from './sliderClasses';
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
const valueToPercent = (value, min, max) => (value - min) * 100 / (max - min);
|
|
@@ -261,7 +261,7 @@ process.env.NODE_ENV !== "production" ? SliderThumb.propTypes /* remove-proptype
|
|
|
261
261
|
children: PropTypes.node
|
|
262
262
|
} : void 0;
|
|
263
263
|
export { SliderThumb };
|
|
264
|
-
const
|
|
264
|
+
const StyledSliderValueLabel = styled(SliderValueLabel, {
|
|
265
265
|
name: 'MuiSlider',
|
|
266
266
|
slot: 'ValueLabel',
|
|
267
267
|
overridesResolver: (props, styles) => styles.valueLabel
|
|
@@ -319,7 +319,7 @@ const SliderValueLabel = styled(SliderValueLabelComponent, {
|
|
|
319
319
|
fontSize: theme.typography.pxToRem(12),
|
|
320
320
|
padding: '0.25rem 0.5rem'
|
|
321
321
|
}));
|
|
322
|
-
process.env.NODE_ENV !== "production" ?
|
|
322
|
+
process.env.NODE_ENV !== "production" ? StyledSliderValueLabel.propTypes /* remove-proptypes */ = {
|
|
323
323
|
// ----------------------------- Warning --------------------------------
|
|
324
324
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
325
325
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -329,7 +329,7 @@ process.env.NODE_ENV !== "production" ? SliderValueLabel.propTypes /* remove-pro
|
|
|
329
329
|
*/
|
|
330
330
|
children: PropTypes.node
|
|
331
331
|
} : void 0;
|
|
332
|
-
export { SliderValueLabel };
|
|
332
|
+
export { StyledSliderValueLabel as SliderValueLabel };
|
|
333
333
|
const SliderMark = styled('span', {
|
|
334
334
|
name: 'MuiSlider',
|
|
335
335
|
slot: 'Mark',
|
|
@@ -523,7 +523,7 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
|
|
|
523
523
|
const RailSlot = (_ref2 = (_slots$rail = slots == null ? void 0 : slots.rail) != null ? _slots$rail : components.Rail) != null ? _ref2 : SliderRail;
|
|
524
524
|
const TrackSlot = (_ref3 = (_slots$track = slots == null ? void 0 : slots.track) != null ? _slots$track : components.Track) != null ? _ref3 : SliderTrack;
|
|
525
525
|
const ThumbSlot = (_ref4 = (_slots$thumb = slots == null ? void 0 : slots.thumb) != null ? _slots$thumb : components.Thumb) != null ? _ref4 : SliderThumb;
|
|
526
|
-
const ValueLabelSlot = (_ref5 = (_slots$valueLabel = slots == null ? void 0 : slots.valueLabel) != null ? _slots$valueLabel : components.ValueLabel) != null ? _ref5 :
|
|
526
|
+
const ValueLabelSlot = (_ref5 = (_slots$valueLabel = slots == null ? void 0 : slots.valueLabel) != null ? _slots$valueLabel : components.ValueLabel) != null ? _ref5 : StyledSliderValueLabel;
|
|
527
527
|
const MarkSlot = (_ref6 = (_slots$mark = slots == null ? void 0 : slots.mark) != null ? _slots$mark : components.Mark) != null ? _ref6 : SliderMark;
|
|
528
528
|
const MarkLabelSlot = (_ref7 = (_slots$markLabel = slots == null ? void 0 : slots.markLabel) != null ? _slots$markLabel : components.MarkLabel) != null ? _ref7 : SliderMarkLabel;
|
|
529
529
|
const InputSlot = (_ref8 = (_slots$input = slots == null ? void 0 : slots.input) != null ? _slots$input : components.Input) != null ? _ref8 : 'input';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { SliderValueLabelProps } from './SliderValueLabel.types';
|
|
4
|
-
/**
|
|
5
|
-
* @ignore - internal component.
|
|
6
|
-
*/
|
|
7
|
-
declare function SliderValueLabel(props: SliderValueLabelProps): React.ReactElement<any, string | React.JSXElementConstructor<any
|
|
8
|
-
declare namespace SliderValueLabel {
|
|
9
|
-
var propTypes: {
|
|
10
|
-
children: PropTypes.Validator<PropTypes.ReactElementLike>;
|
|
11
|
-
className: PropTypes.Requireable<string>;
|
|
12
|
-
value: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export default SliderValueLabel;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { SliderValueLabelProps } from './SliderValueLabel.types';
|
|
4
|
+
/**
|
|
5
|
+
* @ignore - internal component.
|
|
6
|
+
*/
|
|
7
|
+
declare function SliderValueLabel(props: SliderValueLabelProps): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
8
|
+
declare namespace SliderValueLabel {
|
|
9
|
+
var propTypes: {
|
|
10
|
+
children: PropTypes.Validator<PropTypes.ReactElementLike>;
|
|
11
|
+
className: PropTypes.Requireable<string>;
|
|
12
|
+
value: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export default SliderValueLabel;
|
|
@@ -26,6 +26,9 @@ export default function SliderValueLabel(props) {
|
|
|
26
26
|
value
|
|
27
27
|
} = props;
|
|
28
28
|
const classes = useValueLabelClasses(props);
|
|
29
|
+
if (!children) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
29
32
|
return /*#__PURE__*/React.cloneElement(children, {
|
|
30
33
|
className: clsx(children.props.className)
|
|
31
34
|
}, /*#__PURE__*/_jsxs(React.Fragment, {
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface SliderValueLabelProps {
|
|
3
|
-
children
|
|
4
|
-
className?: string;
|
|
5
|
-
style?: React.CSSProperties;
|
|
6
|
-
/**
|
|
7
|
-
* If `true`, the value label is visible.
|
|
8
|
-
*/
|
|
9
|
-
open: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* The value of the slider.
|
|
12
|
-
* For ranged sliders, provide an array with two values.
|
|
13
|
-
*/
|
|
14
|
-
value: number;
|
|
15
|
-
/**
|
|
16
|
-
* Controls when the value label is displayed:
|
|
17
|
-
*
|
|
18
|
-
* - `auto` the value label will display when the thumb is hovered or focused.
|
|
19
|
-
* - `on` will display persistently.
|
|
20
|
-
* - `off` will never display.
|
|
21
|
-
* @default 'off'
|
|
22
|
-
*/
|
|
23
|
-
valueLabelDisplay?: 'on' | 'auto' | 'off';
|
|
24
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface SliderValueLabelProps {
|
|
3
|
+
children?: React.ReactElement;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
/**
|
|
7
|
+
* If `true`, the value label is visible.
|
|
8
|
+
*/
|
|
9
|
+
open: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The value of the slider.
|
|
12
|
+
* For ranged sliders, provide an array with two values.
|
|
13
|
+
*/
|
|
14
|
+
value: number;
|
|
15
|
+
/**
|
|
16
|
+
* Controls when the value label is displayed:
|
|
17
|
+
*
|
|
18
|
+
* - `auto` the value label will display when the thumb is hovered or focused.
|
|
19
|
+
* - `on` will display persistently.
|
|
20
|
+
* - `off` will never display.
|
|
21
|
+
* @default 'off'
|
|
22
|
+
*/
|
|
23
|
+
valueLabelDisplay?: 'on' | 'auto' | 'off';
|
|
24
|
+
}
|
package/Slider/index.d.ts
CHANGED
package/Slider/index.js
CHANGED
|
@@ -1,29 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
root
|
|
9
|
-
marked: string;
|
|
10
|
-
vertical
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
export interface SliderClasses {
|
|
2
|
+
/** Class name applied to the root element. */
|
|
3
|
+
root: string;
|
|
4
|
+
/** Class name applied to the root element if `color="primary"`. */
|
|
5
|
+
colorPrimary: string;
|
|
6
|
+
/** Class name applied to the root element if `color="secondary"`. */
|
|
7
|
+
colorSecondary: string;
|
|
8
|
+
/** Class name applied to the root element if `marks` is provided with at least one label. */
|
|
9
|
+
marked: string;
|
|
10
|
+
/** Class name applied to the root element if `orientation="vertical"`. */
|
|
11
|
+
vertical: string;
|
|
12
|
+
/** State class applied to the root and thumb element if `disabled={true}`. */
|
|
13
|
+
disabled: string;
|
|
14
|
+
/** State class applied to the root if a thumb is being dragged. */
|
|
15
|
+
dragging: string;
|
|
16
|
+
/** Class name applied to the rail element. */
|
|
17
|
+
rail: string;
|
|
18
|
+
/** Class name applied to the track element. */
|
|
19
|
+
track: string;
|
|
20
|
+
/** Class name applied to the root element if `track={false}`. */
|
|
21
|
+
trackFalse: string;
|
|
22
|
+
/** Class name applied to the root element if `track="inverted"`. */
|
|
23
|
+
trackInverted: string;
|
|
24
|
+
/** Class name applied to the thumb element. */
|
|
25
|
+
thumb: string;
|
|
26
|
+
/** State class applied to the thumb element if it's active. */
|
|
27
|
+
active: string;
|
|
28
|
+
/** State class applied to the thumb element if keyboard focused. */
|
|
29
|
+
focusVisible: string;
|
|
30
|
+
/** Class name applied to the mark element. */
|
|
31
|
+
mark: string;
|
|
32
|
+
/** Class name applied to the mark element if active (depending on the value). */
|
|
33
|
+
markActive: string;
|
|
34
|
+
/** Class name applied to the mark label element. */
|
|
35
|
+
markLabel: string;
|
|
36
|
+
/** Class name applied to the mark label element if active (depending on the value). */
|
|
37
|
+
markLabelActive: string;
|
|
38
|
+
/** Class name applied to the root element if `size="small"`. */
|
|
39
|
+
sizeSmall: string;
|
|
40
|
+
/** Class name applied to the thumb element if `color="primary"`. */
|
|
41
|
+
thumbColorPrimary: string;
|
|
42
|
+
/** Class name applied to the thumb element if `color="secondary"`. */
|
|
43
|
+
thumbColorSecondary: string;
|
|
44
|
+
/** Class name applied to the thumb element if `size="small"`. */
|
|
45
|
+
thumbSizeSmall: string;
|
|
46
|
+
/** Class name applied to the thumb label element. */
|
|
47
|
+
valueLabel: string;
|
|
48
|
+
/** Class name applied to the thumb label element if it's open. */
|
|
49
|
+
valueLabelOpen: string;
|
|
50
|
+
/** Class name applied to the thumb label's circle element. */
|
|
51
|
+
valueLabelCircle: string;
|
|
52
|
+
/** Class name applied to the thumb label's label element. */
|
|
53
|
+
valueLabelLabel: string;
|
|
54
|
+
}
|
|
55
|
+
export type SliderClassKey = keyof SliderClasses;
|
|
56
|
+
export declare function getSliderUtilityClass(slot: string): string;
|
|
57
|
+
declare const sliderClasses: SliderClasses;
|
|
58
|
+
export default sliderClasses;
|
package/Slider/sliderClasses.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
3
|
-
import
|
|
4
|
-
|
|
2
|
+
import generateUtilityClass from '../generateUtilityClass';
|
|
3
|
+
export function getSliderUtilityClass(slot) {
|
|
4
|
+
return generateUtilityClass('MuiSlider', slot);
|
|
5
|
+
}
|
|
6
|
+
const sliderClasses = generateUtilityClasses('MuiSlider', ['root', 'active', 'colorPrimary', 'colorSecondary', 'disabled', 'dragging', 'focusVisible', 'mark', 'markActive', 'marked', 'markLabel', 'markLabelActive', 'rail', 'sizeSmall', 'thumb', 'thumbColorPrimary', 'thumbColorSecondary', 'track', 'trackInverted', 'trackFalse', 'thumbSizeSmall', 'valueLabel', 'valueLabelOpen', 'valueLabelCircle', 'valueLabelLabel', 'vertical']);
|
|
5
7
|
export default sliderClasses;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export interface SnackbarClasses {
|
|
2
|
-
/** Styles applied to the root element. */
|
|
3
|
-
root: string;
|
|
4
|
-
/** Styles applied to the root element if `anchorOrigin={{ 'top', 'center' }}`. */
|
|
5
|
-
anchorOriginTopCenter: string;
|
|
6
|
-
/** Styles applied to the root element if `anchorOrigin={{ 'bottom', 'center' }}`. */
|
|
7
|
-
anchorOriginBottomCenter: string;
|
|
8
|
-
/** Styles applied to the root element if `anchorOrigin={{ 'top', 'right' }}`. */
|
|
9
|
-
anchorOriginTopRight: string;
|
|
10
|
-
/** Styles applied to the root element if `anchorOrigin={{ 'bottom', 'right' }}`. */
|
|
11
|
-
anchorOriginBottomRight: string;
|
|
12
|
-
/** Styles applied to the root element if `anchorOrigin={{ 'top', 'left' }}`. */
|
|
13
|
-
anchorOriginTopLeft: string;
|
|
14
|
-
/** Styles applied to the root element if `anchorOrigin={{ 'bottom', 'left' }}`. */
|
|
15
|
-
anchorOriginBottomLeft: string;
|
|
16
|
-
}
|
|
17
|
-
export type SnackbarClassKey = keyof SnackbarClasses;
|
|
18
|
-
export declare function getSnackbarUtilityClass(slot: string): string;
|
|
19
|
-
declare const snackbarClasses: SnackbarClasses;
|
|
20
|
-
export default snackbarClasses;
|
|
1
|
+
export interface SnackbarClasses {
|
|
2
|
+
/** Styles applied to the root element. */
|
|
3
|
+
root: string;
|
|
4
|
+
/** Styles applied to the root element if `anchorOrigin={{ 'top', 'center' }}`. */
|
|
5
|
+
anchorOriginTopCenter: string;
|
|
6
|
+
/** Styles applied to the root element if `anchorOrigin={{ 'bottom', 'center' }}`. */
|
|
7
|
+
anchorOriginBottomCenter: string;
|
|
8
|
+
/** Styles applied to the root element if `anchorOrigin={{ 'top', 'right' }}`. */
|
|
9
|
+
anchorOriginTopRight: string;
|
|
10
|
+
/** Styles applied to the root element if `anchorOrigin={{ 'bottom', 'right' }}`. */
|
|
11
|
+
anchorOriginBottomRight: string;
|
|
12
|
+
/** Styles applied to the root element if `anchorOrigin={{ 'top', 'left' }}`. */
|
|
13
|
+
anchorOriginTopLeft: string;
|
|
14
|
+
/** Styles applied to the root element if `anchorOrigin={{ 'bottom', 'left' }}`. */
|
|
15
|
+
anchorOriginBottomLeft: string;
|
|
16
|
+
}
|
|
17
|
+
export type SnackbarClassKey = keyof SnackbarClasses;
|
|
18
|
+
export declare function getSnackbarUtilityClass(slot: string): string;
|
|
19
|
+
declare const snackbarClasses: SnackbarClasses;
|
|
20
|
+
export default snackbarClasses;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export interface SnackbarContentClasses {
|
|
2
|
-
/** Styles applied to the root element. */
|
|
3
|
-
root: string;
|
|
4
|
-
/** Styles applied to the message wrapper element. */
|
|
5
|
-
message: string;
|
|
6
|
-
/** Styles applied to the action wrapper element if `action` is provided. */
|
|
7
|
-
action: string;
|
|
8
|
-
}
|
|
9
|
-
export type SnackbarContentClassKey = keyof SnackbarContentClasses;
|
|
10
|
-
export declare function getSnackbarContentUtilityClass(slot: string): string;
|
|
11
|
-
declare const snackbarContentClasses: SnackbarContentClasses;
|
|
12
|
-
export default snackbarContentClasses;
|
|
1
|
+
export interface SnackbarContentClasses {
|
|
2
|
+
/** Styles applied to the root element. */
|
|
3
|
+
root: string;
|
|
4
|
+
/** Styles applied to the message wrapper element. */
|
|
5
|
+
message: string;
|
|
6
|
+
/** Styles applied to the action wrapper element if `action` is provided. */
|
|
7
|
+
action: string;
|
|
8
|
+
}
|
|
9
|
+
export type SnackbarContentClassKey = keyof SnackbarContentClasses;
|
|
10
|
+
export declare function getSnackbarContentUtilityClass(slot: string): string;
|
|
11
|
+
declare const snackbarContentClasses: SnackbarContentClasses;
|
|
12
|
+
export default snackbarContentClasses;
|