@mui/material 5.11.10 → 5.11.11

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.
Files changed (240) hide show
  1. package/Accordion/accordionClasses.d.ts +18 -18
  2. package/AccordionActions/accordionActionsClasses.d.ts +10 -10
  3. package/AccordionDetails/accordionDetailsClasses.d.ts +8 -8
  4. package/AccordionSummary/accordionSummaryClasses.d.ts +22 -22
  5. package/Alert/alertClasses.d.ts +44 -44
  6. package/AlertTitle/alertTitleClasses.d.ts +8 -8
  7. package/AppBar/appBarClasses.d.ts +28 -28
  8. package/Autocomplete/Autocomplete.d.ts +3 -1
  9. package/Autocomplete/autocompleteClasses.d.ts +54 -54
  10. package/Avatar/avatarClasses.d.ts +20 -20
  11. package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
  12. package/Backdrop/backdropClasses.d.ts +10 -10
  13. package/Badge/Badge.js +1 -1
  14. package/Badge/badgeClasses.d.ts +56 -56
  15. package/BottomNavigation/BottomNavigation.js +0 -0
  16. package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
  17. package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
  18. package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
  19. package/Button/buttonClasses.d.ts +100 -100
  20. package/ButtonBase/buttonBaseClasses.d.ts +12 -12
  21. package/ButtonBase/touchRippleClasses.d.ts +20 -20
  22. package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
  23. package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
  24. package/CHANGELOG.md +89 -0
  25. package/Card/cardClasses.d.ts +8 -8
  26. package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
  27. package/CardActions/cardActionsClasses.d.ts +10 -10
  28. package/CardContent/cardContentClasses.d.ts +8 -8
  29. package/CardHeader/cardHeaderClasses.d.ts +18 -18
  30. package/CardMedia/cardMediaClasses.d.ts +12 -12
  31. package/Checkbox/checkboxClasses.d.ts +18 -18
  32. package/Chip/chipClasses.d.ts +96 -96
  33. package/CircularProgress/circularProgressClasses.d.ts +26 -26
  34. package/ClickAwayListener/index.d.ts +2 -2
  35. package/Collapse/collapseClasses.d.ts +18 -18
  36. package/Container/Container.js +0 -1
  37. package/Container/containerClasses.d.ts +6 -6
  38. package/Dialog/DialogContext.d.ts +6 -6
  39. package/Dialog/dialogClasses.d.ts +36 -36
  40. package/DialogActions/dialogActionsClasses.d.ts +10 -10
  41. package/DialogContent/dialogContentClasses.d.ts +10 -10
  42. package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
  43. package/DialogTitle/dialogTitleClasses.d.ts +8 -8
  44. package/Divider/dividerClasses.d.ts +34 -34
  45. package/Drawer/drawerClasses.d.ts +30 -30
  46. package/Fab/fabClasses.d.ts +26 -26
  47. package/FilledInput/filledInputClasses.d.ts +40 -40
  48. package/FormControl/FormControlContext.d.ts +17 -17
  49. package/FormControl/formControlClasses.d.ts +14 -14
  50. package/FormControl/useFormControl.d.ts +2 -2
  51. package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
  52. package/FormGroup/formGroupClasses.d.ts +12 -12
  53. package/FormHelperText/formHelperTextClasses.d.ts +22 -22
  54. package/FormLabel/formLabelClasses.d.ts +22 -22
  55. package/Grid/gridClasses.d.ts +48 -48
  56. package/Icon/iconClasses.d.ts +24 -24
  57. package/IconButton/iconButtonClasses.d.ts +34 -34
  58. package/ImageList/imageListClasses.d.ts +16 -16
  59. package/ImageListItem/imageListItemClasses.d.ts +18 -18
  60. package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
  61. package/Input/inputClasses.d.ts +34 -34
  62. package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
  63. package/InputBase/InputBase.js +2 -2
  64. package/InputBase/inputBaseClasses.d.ts +46 -46
  65. package/InputLabel/InputLabel.js +3 -1
  66. package/InputLabel/inputLabelClasses.d.ts +32 -32
  67. package/LinearProgress/linearProgressClasses.d.ts +42 -42
  68. package/Link/getTextDecoration.d.ts +15 -15
  69. package/Link/linkClasses.d.ts +18 -18
  70. package/List/listClasses.d.ts +14 -14
  71. package/ListItem/listItemClasses.d.ts +30 -30
  72. package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
  73. package/ListItemButton/listItemButtonClasses.d.ts +22 -22
  74. package/ListItemIcon/listItemIconClasses.d.ts +10 -10
  75. package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
  76. package/ListItemText/listItemTextClasses.d.ts +18 -18
  77. package/ListSubheader/ListSubheader.js +1 -0
  78. package/ListSubheader/listSubheaderClasses.d.ts +18 -18
  79. package/Menu/menuClasses.d.ts +12 -12
  80. package/MenuItem/menuItemClasses.d.ts +20 -20
  81. package/MenuList/MenuList.js +7 -0
  82. package/MobileStepper/mobileStepperClasses.d.ts +22 -22
  83. package/Modal/Modal.d.ts +9 -1
  84. package/Modal/Modal.js +14 -9
  85. package/NativeSelect/nativeSelectClasses.d.ts +32 -32
  86. package/OutlinedInput/OutlinedInput.js +1 -1
  87. package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
  88. package/Pagination/paginationClasses.d.ts +14 -14
  89. package/PaginationItem/paginationItemClasses.d.ts +42 -42
  90. package/Paper/paperClasses.d.ts +39 -39
  91. package/Popover/popoverClasses.d.ts +10 -10
  92. package/Popper/Popper.d.ts +55 -55
  93. package/README.md +0 -2
  94. package/Radio/radioClasses.d.ts +16 -16
  95. package/RadioGroup/RadioGroupContext.d.ts +11 -11
  96. package/RadioGroup/useRadioGroup.d.ts +4 -4
  97. package/Rating/Rating.js +2 -2
  98. package/Rating/ratingClasses.d.ts +40 -40
  99. package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
  100. package/Select/SelectInput.js +2 -22
  101. package/Select/selectClasses.d.ts +30 -30
  102. package/Skeleton/skeletonClasses.d.ts +26 -26
  103. package/Slider/Slider.d.ts +5 -1
  104. package/Slider/Slider.js +16 -11
  105. package/Slider/SliderValueLabel.d.ts +15 -15
  106. package/Slider/SliderValueLabel.types.d.ts +24 -24
  107. package/Slider/sliderClasses.d.ts +58 -58
  108. package/Snackbar/Snackbar.js +21 -125
  109. package/Snackbar/snackbarClasses.d.ts +20 -20
  110. package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
  111. package/SpeedDial/speedDialClasses.d.ts +22 -22
  112. package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
  113. package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
  114. package/Stack/Stack.d.ts +0 -1
  115. package/Stack/Stack.js +9 -120
  116. package/Stack/index.d.ts +3 -0
  117. package/Stack/index.js +2 -1
  118. package/Stack/stackClasses.d.ts +6 -0
  119. package/Stack/stackClasses.js +7 -0
  120. package/Step/StepContext.d.ts +20 -20
  121. package/Step/stepClasses.d.ts +16 -16
  122. package/StepButton/stepButtonClasses.d.ts +14 -14
  123. package/StepConnector/stepConnectorClasses.d.ts +26 -26
  124. package/StepContent/stepContentClasses.d.ts +12 -12
  125. package/StepIcon/stepIconClasses.d.ts +16 -16
  126. package/StepLabel/stepLabelClasses.d.ts +28 -28
  127. package/Stepper/StepperContext.d.ts +18 -18
  128. package/Stepper/stepperClasses.d.ts +14 -14
  129. package/SvgIcon/svgIconClasses.d.ts +26 -26
  130. package/Switch/switchClasses.d.ts +32 -32
  131. package/Tab/tabClasses.d.ts +26 -26
  132. package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
  133. package/Table/tableClasses.d.ts +10 -10
  134. package/TableBody/tableBodyClasses.d.ts +8 -8
  135. package/TableCell/tableCellClasses.d.ts +32 -32
  136. package/TableContainer/tableContainerClasses.d.ts +8 -8
  137. package/TableFooter/tableFooterClasses.d.ts +8 -8
  138. package/TableHead/tableHeadClasses.d.ts +8 -8
  139. package/TablePagination/tablePaginationClasses.d.ts +28 -28
  140. package/TableRow/tableRowClasses.d.ts +16 -16
  141. package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
  142. package/Tabs/tabsClasses.d.ts +32 -32
  143. package/TextField/textFieldClasses.d.ts +8 -8
  144. package/ToggleButton/toggleButtonClasses.d.ts +24 -24
  145. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
  146. package/Toolbar/toolbarClasses.d.ts +14 -14
  147. package/Tooltip/tooltipClasses.d.ts +30 -30
  148. package/Typography/typographyClasses.d.ts +50 -50
  149. package/Unstable_Grid2/Grid2.d.ts +4 -4
  150. package/Unstable_Grid2/Grid2.js +2 -3
  151. package/Unstable_Grid2/Grid2Props.d.ts +15 -15
  152. package/Unstable_Grid2/grid2Classes.d.ts +5 -5
  153. package/Unstable_Grid2/index.d.ts +4 -4
  154. package/className/index.d.ts +1 -1
  155. package/darkScrollbar/index.d.ts +28 -28
  156. package/generateUtilityClass/index.d.ts +2 -2
  157. package/generateUtilityClasses/index.d.ts +1 -1
  158. package/index.js +1 -1
  159. package/internal/switchBaseClasses.d.ts +12 -12
  160. package/legacy/Badge/Badge.js +1 -1
  161. package/legacy/BottomNavigation/BottomNavigation.js +0 -0
  162. package/legacy/Container/Container.js +0 -1
  163. package/legacy/InputBase/InputBase.js +2 -2
  164. package/legacy/InputLabel/InputLabel.js +3 -1
  165. package/legacy/ListSubheader/ListSubheader.js +1 -0
  166. package/legacy/MenuList/MenuList.js +7 -0
  167. package/legacy/Modal/Modal.js +14 -9
  168. package/legacy/OutlinedInput/OutlinedInput.js +1 -1
  169. package/legacy/Rating/Rating.js +2 -2
  170. package/legacy/Select/SelectInput.js +2 -22
  171. package/legacy/Slider/Slider.js +16 -12
  172. package/legacy/Snackbar/Snackbar.js +20 -119
  173. package/legacy/Stack/Stack.js +13 -122
  174. package/legacy/Stack/index.js +2 -1
  175. package/legacy/Stack/stackClasses.js +7 -0
  176. package/legacy/Unstable_Grid2/Grid2.js +2 -3
  177. package/legacy/index.js +1 -1
  178. package/legacy/styles/createTheme.js +1 -0
  179. package/legacy/useAutocomplete/useAutocomplete.js +2 -2
  180. package/locale/index.d.ts +75 -75
  181. package/modern/Badge/Badge.js +1 -1
  182. package/modern/BottomNavigation/BottomNavigation.js +0 -0
  183. package/modern/Container/Container.js +0 -1
  184. package/modern/InputBase/InputBase.js +2 -2
  185. package/modern/InputLabel/InputLabel.js +3 -1
  186. package/modern/ListSubheader/ListSubheader.js +1 -0
  187. package/modern/MenuList/MenuList.js +7 -0
  188. package/modern/Modal/Modal.js +14 -9
  189. package/modern/OutlinedInput/OutlinedInput.js +1 -1
  190. package/modern/Rating/Rating.js +2 -2
  191. package/modern/Select/SelectInput.js +2 -18
  192. package/modern/Slider/Slider.js +16 -11
  193. package/modern/Snackbar/Snackbar.js +21 -125
  194. package/modern/Stack/Stack.js +9 -120
  195. package/modern/Stack/index.js +2 -1
  196. package/modern/Stack/stackClasses.js +7 -0
  197. package/modern/Unstable_Grid2/Grid2.js +2 -3
  198. package/modern/index.js +1 -1
  199. package/modern/styles/createTheme.js +1 -0
  200. package/modern/useAutocomplete/useAutocomplete.js +2 -2
  201. package/node/Badge/Badge.js +2 -2
  202. package/node/BottomNavigation/BottomNavigation.js +0 -0
  203. package/node/Container/Container.js +0 -2
  204. package/node/InputBase/InputBase.js +2 -2
  205. package/node/InputLabel/InputLabel.js +3 -1
  206. package/node/ListSubheader/ListSubheader.js +1 -0
  207. package/node/MenuList/MenuList.js +7 -0
  208. package/node/Modal/Modal.js +14 -9
  209. package/node/OutlinedInput/OutlinedInput.js +1 -1
  210. package/node/Rating/Rating.js +2 -2
  211. package/node/Select/SelectInput.js +2 -22
  212. package/node/Slider/Slider.js +19 -14
  213. package/node/Snackbar/Snackbar.js +20 -124
  214. package/node/Stack/Stack.js +9 -122
  215. package/node/Stack/index.js +8 -1
  216. package/node/Stack/stackClasses.js +16 -0
  217. package/node/Unstable_Grid2/Grid2.js +0 -1
  218. package/node/index.js +1 -1
  219. package/node/styles/createTheme.js +1 -0
  220. package/node/useAutocomplete/useAutocomplete.js +8 -6
  221. package/package.json +6 -6
  222. package/styles/CssVarsProvider.d.ts +16 -16
  223. package/styles/createTheme.js +1 -0
  224. package/styles/excludeVariablesFromRoot.d.ts +5 -5
  225. package/styles/getOverlayAlpha.d.ts +2 -2
  226. package/transitions/index.d.ts +1 -1
  227. package/transitions/transition.d.ts +13 -13
  228. package/transitions/utils.d.ts +23 -23
  229. package/types/OverridableComponentAugmentation.d.ts +31 -31
  230. package/umd/material-ui.development.js +4132 -4060
  231. package/umd/material-ui.production.min.js +21 -21
  232. package/useAutocomplete/useAutocomplete.d.ts +2 -2
  233. package/useAutocomplete/useAutocomplete.js +2 -2
  234. package/useMediaQuery/useMediaQuery.d.ts +46 -46
  235. package/useTouchRipple/index.d.ts +1 -1
  236. package/useTouchRipple/useTouchRipple.d.ts +28 -28
  237. package/utils/getScrollbarSize.d.ts +2 -2
  238. package/utils/ownerDocument.d.ts +2 -2
  239. package/utils/ownerWindow.d.ts +2 -2
  240. package/utils/setRef.d.ts +2 -2
package/Rating/Rating.js CHANGED
@@ -46,7 +46,7 @@ const useUtilityClasses = ownerState => {
46
46
  focusVisible
47
47
  } = ownerState;
48
48
  const slots = {
49
- root: ['root', `size${capitalize(size)}`, disabled && 'disabled', focusVisible && 'focusVisible', readOnly && 'readyOnly'],
49
+ root: ['root', `size${capitalize(size)}`, disabled && 'disabled', focusVisible && 'focusVisible', readOnly && 'readOnly'],
50
50
  label: ['label', 'pristine'],
51
51
  labelEmptyValue: [emptyValueFocused && 'labelEmptyValueActive'],
52
52
  icon: ['icon'],
@@ -444,7 +444,7 @@ const Rating = /*#__PURE__*/React.forwardRef(function Rating(inProps, ref) {
444
444
  ref: handleRef,
445
445
  onMouseMove: handleMouseMove,
446
446
  onMouseLeave: handleMouseLeave,
447
- className: clsx(classes.root, className),
447
+ className: clsx(classes.root, className, readOnly && 'MuiRating-readOnly'),
448
448
  ownerState: ownerState,
449
449
  role: readOnly ? 'img' : null,
450
450
  "aria-label": readOnly ? getLabelText(value) : null
@@ -1,40 +1,40 @@
1
- export interface RatingClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- /** Styles applied to the root element if `size="small"`. */
5
- sizeSmall: string;
6
- /** Styles applied to the root element if `size="medium"`. */
7
- sizeMedium: string;
8
- /** Styles applied to the root element if `size="large"`. */
9
- sizeLarge: string;
10
- /** Styles applied to the root element if `readOnly={true}`. */
11
- readOnly: string;
12
- /** State class applied to the root element if `disabled={true}`. */
13
- disabled: string;
14
- /** State class applied to the root element if keyboard focused. */
15
- focusVisible: string;
16
- /** Visually hide an element. */
17
- visuallyHidden: string;
18
- /** Styles applied to the label elements. */
19
- label: string;
20
- /** Styles applied to the label of the "no value" input when it is active. */
21
- labelEmptyValueActive: string;
22
- /** Styles applied to the icon wrapping elements. */
23
- icon: string;
24
- /** Styles applied to the icon wrapping elements when empty. */
25
- iconEmpty: string;
26
- /** Styles applied to the icon wrapping elements when filled. */
27
- iconFilled: string;
28
- /** Styles applied to the icon wrapping elements when hover. */
29
- iconHover: string;
30
- /** Styles applied to the icon wrapping elements when focus. */
31
- iconFocus: string;
32
- /** Styles applied to the icon wrapping elements when active. */
33
- iconActive: string;
34
- /** Styles applied to the icon wrapping elements when decimals are necessary. */
35
- decimal: string;
36
- }
37
- export type RatingClassKey = keyof RatingClasses;
38
- export declare function getRatingUtilityClass(slot: string): string;
39
- declare const ratingClasses: RatingClasses;
40
- export default ratingClasses;
1
+ export interface RatingClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the root element if `size="small"`. */
5
+ sizeSmall: string;
6
+ /** Styles applied to the root element if `size="medium"`. */
7
+ sizeMedium: string;
8
+ /** Styles applied to the root element if `size="large"`. */
9
+ sizeLarge: string;
10
+ /** Styles applied to the root element if `readOnly={true}`. */
11
+ readOnly: string;
12
+ /** State class applied to the root element if `disabled={true}`. */
13
+ disabled: string;
14
+ /** State class applied to the root element if keyboard focused. */
15
+ focusVisible: string;
16
+ /** Visually hide an element. */
17
+ visuallyHidden: string;
18
+ /** Styles applied to the label elements. */
19
+ label: string;
20
+ /** Styles applied to the label of the "no value" input when it is active. */
21
+ labelEmptyValueActive: string;
22
+ /** Styles applied to the icon wrapping elements. */
23
+ icon: string;
24
+ /** Styles applied to the icon wrapping elements when empty. */
25
+ iconEmpty: string;
26
+ /** Styles applied to the icon wrapping elements when filled. */
27
+ iconFilled: string;
28
+ /** Styles applied to the icon wrapping elements when hover. */
29
+ iconHover: string;
30
+ /** Styles applied to the icon wrapping elements when focus. */
31
+ iconFocus: string;
32
+ /** Styles applied to the icon wrapping elements when active. */
33
+ iconActive: string;
34
+ /** Styles applied to the icon wrapping elements when decimals are necessary. */
35
+ decimal: string;
36
+ }
37
+ export type RatingClassKey = keyof RatingClasses;
38
+ export declare function getRatingUtilityClass(slot: string): string;
39
+ declare const ratingClasses: RatingClasses;
40
+ export default ratingClasses;
@@ -1,8 +1,8 @@
1
- export interface ScopedCssBaselineClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- }
5
- export type ScopedCssBaselineClassKey = keyof ScopedCssBaselineClasses;
6
- export declare function getScopedCssBaselineUtilityClass(slot: string): string;
7
- declare const scopedCssBaselineClasses: Record<"root", string>;
8
- export default scopedCssBaselineClasses;
1
+ export interface ScopedCssBaselineClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ }
5
+ export type ScopedCssBaselineClassKey = keyof ScopedCssBaselineClasses;
6
+ export declare function getScopedCssBaselineUtilityClass(slot: string): string;
7
+ declare const scopedCssBaselineClasses: Record<"root", string>;
8
+ export default scopedCssBaselineClasses;
@@ -329,8 +329,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
329
329
  computeDisplay = true;
330
330
  }
331
331
  }
332
- const items = childrenArray.map((child, index, arr) => {
333
- var _arr$, _arr$$props, _arr$2, _arr$2$props;
332
+ const items = childrenArray.map(child => {
334
333
  if (! /*#__PURE__*/React.isValidElement(child)) {
335
334
  return null;
336
335
  }
@@ -357,25 +356,6 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
357
356
  if (selected) {
358
357
  foundMatch = true;
359
358
  }
360
- if (child.props.value === undefined) {
361
- return /*#__PURE__*/React.cloneElement(child, {
362
- 'aria-readonly': true,
363
- role: 'option'
364
- });
365
- }
366
- const isFirstSelectableElement = () => {
367
- if (value) {
368
- return selected;
369
- }
370
- const firstSelectableElement = arr.find(item => {
371
- var _item$props;
372
- return (item == null ? void 0 : (_item$props = item.props) == null ? void 0 : _item$props.value) !== undefined && item.props.disabled !== true;
373
- });
374
- if (child === firstSelectableElement) {
375
- return true;
376
- }
377
- return selected;
378
- };
379
359
  return /*#__PURE__*/React.cloneElement(child, {
380
360
  'aria-selected': selected ? 'true' : 'false',
381
361
  onClick: handleItemClick(child),
@@ -391,7 +371,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
391
371
  }
392
372
  },
393
373
  role: 'option',
394
- selected: ((_arr$ = arr[0]) == null ? void 0 : (_arr$$props = _arr$.props) == null ? void 0 : _arr$$props.value) === undefined || ((_arr$2 = arr[0]) == null ? void 0 : (_arr$2$props = _arr$2.props) == null ? void 0 : _arr$2$props.disabled) === true ? isFirstSelectableElement() : selected,
374
+ selected,
395
375
  value: undefined,
396
376
  // The value is most likely not a valid HTML attribute.
397
377
  'data-value': child.props.value // Instead, we provide it as a data attribute.
@@ -1,30 +1,30 @@
1
- export interface SelectClasses {
2
- /** Styles applied to the select component `select` class. */
3
- select: string;
4
- /** Styles applied to the select component if `multiple={true}`. */
5
- multiple: string;
6
- /** Styles applied to the select component if `variant="filled"`. */
7
- filled: string;
8
- /** Styles applied to the select component if `variant="outlined"`. */
9
- outlined: string;
10
- /** Styles applied to the select component if `variant="standard"`. */
11
- standard: string;
12
- /** State class applied to the select component `disabled` class. */
13
- disabled: string;
14
- /** Styles applied to the icon component. */
15
- icon: string;
16
- /** Styles applied to the icon component if the popup is open. */
17
- iconOpen: string;
18
- /** Styles applied to the icon component if `variant="filled"`. */
19
- iconFilled: string;
20
- /** Styles applied to the icon component if `variant="outlined"`. */
21
- iconOutlined: string;
22
- /** Styles applied to the icon component if `variant="standard"`. */
23
- iconStandard: string;
24
- /** Styles applied to the underlying native input component. */
25
- nativeInput: string;
26
- }
27
- export type SelectClassKey = keyof SelectClasses;
28
- export declare function getSelectUtilityClasses(slot: string): string;
29
- declare const selectClasses: SelectClasses;
30
- export default selectClasses;
1
+ export interface SelectClasses {
2
+ /** Styles applied to the select component `select` class. */
3
+ select: string;
4
+ /** Styles applied to the select component if `multiple={true}`. */
5
+ multiple: string;
6
+ /** Styles applied to the select component if `variant="filled"`. */
7
+ filled: string;
8
+ /** Styles applied to the select component if `variant="outlined"`. */
9
+ outlined: string;
10
+ /** Styles applied to the select component if `variant="standard"`. */
11
+ standard: string;
12
+ /** State class applied to the select component `disabled` class. */
13
+ disabled: string;
14
+ /** Styles applied to the icon component. */
15
+ icon: string;
16
+ /** Styles applied to the icon component if the popup is open. */
17
+ iconOpen: string;
18
+ /** Styles applied to the icon component if `variant="filled"`. */
19
+ iconFilled: string;
20
+ /** Styles applied to the icon component if `variant="outlined"`. */
21
+ iconOutlined: string;
22
+ /** Styles applied to the icon component if `variant="standard"`. */
23
+ iconStandard: string;
24
+ /** Styles applied to the underlying native input component. */
25
+ nativeInput: string;
26
+ }
27
+ export type SelectClassKey = keyof SelectClasses;
28
+ export declare function getSelectUtilityClasses(slot: string): string;
29
+ declare const selectClasses: SelectClasses;
30
+ export default selectClasses;
@@ -1,26 +1,26 @@
1
- export interface SkeletonClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- /** Styles applied to the root element if `variant="text"`. */
5
- text: string;
6
- /** Styles applied to the root element if `variant="rectangular"`. */
7
- rectangular: string;
8
- /** Styles applied to the root element if `variant="rounded"`. */
9
- rounded: string;
10
- /** Styles applied to the root element if `variant="circular"`. */
11
- circular: string;
12
- /** Styles applied to the root element if `animation="pulse"`. */
13
- pulse: string;
14
- /** Styles applied to the root element if `animation="wave"`. */
15
- wave: string;
16
- /** Styles applied when the component is passed children. */
17
- withChildren: string;
18
- /** Styles applied when the component is passed children and no width. */
19
- fitContent: string;
20
- /** Styles applied when the component is passed children and no height. */
21
- heightAuto: string;
22
- }
23
- export type SkeletonClassKey = keyof SkeletonClasses;
24
- export declare function getSkeletonUtilityClass(slot: string): string;
25
- declare const skeletonClasses: SkeletonClasses;
26
- export default skeletonClasses;
1
+ export interface SkeletonClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the root element if `variant="text"`. */
5
+ text: string;
6
+ /** Styles applied to the root element if `variant="rectangular"`. */
7
+ rectangular: string;
8
+ /** Styles applied to the root element if `variant="rounded"`. */
9
+ rounded: string;
10
+ /** Styles applied to the root element if `variant="circular"`. */
11
+ circular: string;
12
+ /** Styles applied to the root element if `animation="pulse"`. */
13
+ pulse: string;
14
+ /** Styles applied to the root element if `animation="wave"`. */
15
+ wave: string;
16
+ /** Styles applied when the component is passed children. */
17
+ withChildren: string;
18
+ /** Styles applied when the component is passed children and no width. */
19
+ fitContent: string;
20
+ /** Styles applied when the component is passed children and no height. */
21
+ heightAuto: string;
22
+ }
23
+ export type SkeletonClassKey = keyof SkeletonClasses;
24
+ export declare function getSkeletonUtilityClass(slot: string): string;
25
+ declare const skeletonClasses: SkeletonClasses;
26
+ export default skeletonClasses;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { SlotComponentProps } from '@mui/base';
3
- import { Mark } from '@mui/base/SliderUnstyled';
3
+ import { Mark } from '@mui/base/useSlider';
4
4
  import { SxProps } from '@mui/system';
5
5
  import { OverridableStringUnion } from '@mui/types';
6
6
  import { Theme } from '../styles';
@@ -86,6 +86,10 @@ export interface SliderTypeMap<D extends React.ElementType = 'span', P = {}> {
86
86
  * Override or extend the styles applied to the component.
87
87
  */
88
88
  classes?: Partial<SliderClasses>;
89
+ /**
90
+ * @ignore
91
+ */
92
+ className?: string;
89
93
  /**
90
94
  * The default value. Use when the component is not controlled.
91
95
  */
package/Slider/Slider.js CHANGED
@@ -6,7 +6,7 @@ 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 } from '@mui/base/SliderUnstyled';
9
+ import useSlider, { valueToPercent } from '@mui/base/useSlider';
10
10
  import { alpha, lighten, darken } from '@mui/system';
11
11
  import useThemeProps from '../styles/useThemeProps';
12
12
  import styled, { slotShouldForwardProp } from '../styles/styled';
@@ -17,7 +17,6 @@ import SliderValueLabel from './SliderValueLabel';
17
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
- const valueToPercent = (value, min, max) => (value - min) * 100 / (max - min);
21
20
  function Identity(x) {
22
21
  return x;
23
22
  }
@@ -458,7 +457,6 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
458
457
  componentsProps = {},
459
458
  color = 'primary',
460
459
  classes: classesProp,
461
- // eslint-disable-next-line react/prop-types
462
460
  className,
463
461
  disableSwap = false,
464
462
  disabled = false,
@@ -565,7 +563,8 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
565
563
  elementType: ThumbSlot,
566
564
  getSlotProps: getThumbProps,
567
565
  externalSlotProps: thumbSlotProps,
568
- ownerState: _extends({}, ownerState, thumbSlotProps == null ? void 0 : thumbSlotProps.ownerState)
566
+ ownerState: _extends({}, ownerState, thumbSlotProps == null ? void 0 : thumbSlotProps.ownerState),
567
+ className: classes.thumb
569
568
  });
570
569
  const valueLabelProps = useSlotProps({
571
570
  elementType: ValueLabelSlot,
@@ -582,7 +581,8 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
582
581
  const markLabelProps = useSlotProps({
583
582
  elementType: MarkLabelSlot,
584
583
  externalSlotProps: markLabelSlotProps,
585
- ownerState
584
+ ownerState,
585
+ className: classes.markLabel
586
586
  });
587
587
  const inputSliderProps = useSlotProps({
588
588
  elementType: InputSlot,
@@ -623,8 +623,10 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
623
623
  const percent = valueToPercent(value, min, max);
624
624
  const style = axisProps[axis].offset(percent);
625
625
  const ValueLabelComponent = valueLabelDisplay === 'off' ? Forward : ValueLabelSlot;
626
- return /*#__PURE__*/_jsx(React.Fragment, {
627
- children: /*#__PURE__*/_jsx(ValueLabelComponent, _extends({}, !isHostComponent(ValueLabelComponent) && {
626
+ return (
627
+ /*#__PURE__*/
628
+ /* TODO v6: Change component structure. It will help in avoiding the complicated React.cloneElement API added in SliderValueLabel component. Should be: Thumb -> Input, ValueLabel. Follow Joy UI's Slider structure. */
629
+ _jsx(ValueLabelComponent, _extends({}, !isHostComponent(ValueLabelComponent) && {
628
630
  valueLabelFormat,
629
631
  valueLabelDisplay,
630
632
  value: typeof valueLabelFormat === 'function' ? valueLabelFormat(scale(value), index) : valueLabelFormat,
@@ -633,8 +635,7 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
633
635
  disabled
634
636
  }, valueLabelProps, {
635
637
  children: /*#__PURE__*/_jsx(ThumbSlot, _extends({
636
- "data-index": index,
637
- "data-focusvisible": focusedThumbIndex === index
638
+ "data-index": index
638
639
  }, thumbProps, {
639
640
  className: clsx(classes.thumb, thumbProps.className, active === index && classes.active, focusedThumbIndex === index && classes.focusVisible),
640
641
  style: _extends({}, style, {
@@ -649,8 +650,8 @@ const Slider = /*#__PURE__*/React.forwardRef(function Slider(inputProps, ref) {
649
650
  value: values[index]
650
651
  }, inputSliderProps))
651
652
  }))
652
- }))
653
- }, index);
653
+ }), index)
654
+ );
654
655
  })]
655
656
  }));
656
657
  });
@@ -691,6 +692,10 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
691
692
  * Override or extend the styles applied to the component.
692
693
  */
693
694
  classes: PropTypes.object,
695
+ /**
696
+ * @ignore
697
+ */
698
+ className: PropTypes.string,
694
699
  /**
695
700
  * The color of the component.
696
701
  * It supports both default and custom theme colors, which can be added as shown in the
@@ -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>> | 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;
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;
@@ -1,24 +1,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
- }
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
+ }
@@ -1,58 +1,58 @@
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;
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;