@mui/material 5.11.8 → 5.11.10

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 (199) 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/AppBar.js +1 -1
  8. package/AppBar/appBarClasses.d.ts +28 -28
  9. package/Autocomplete/Autocomplete.js +14 -0
  10. package/Autocomplete/autocompleteClasses.d.ts +54 -54
  11. package/Avatar/Avatar.js +1 -0
  12. package/Avatar/avatarClasses.d.ts +20 -20
  13. package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
  14. package/Backdrop/Backdrop.d.ts +8 -0
  15. package/Backdrop/Backdrop.js +10 -5
  16. package/Backdrop/backdropClasses.d.ts +10 -10
  17. package/Badge/Badge.d.ts +0 -1
  18. package/Badge/Badge.js +47 -47
  19. package/Badge/badgeClasses.d.ts +56 -56
  20. package/BottomNavigation/BottomNavigation.js +0 -0
  21. package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
  22. package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
  23. package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
  24. package/Button/buttonClasses.d.ts +100 -100
  25. package/ButtonBase/buttonBaseClasses.d.ts +12 -12
  26. package/ButtonBase/touchRippleClasses.d.ts +20 -20
  27. package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
  28. package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
  29. package/CHANGELOG.md +120 -2
  30. package/Card/cardClasses.d.ts +8 -8
  31. package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
  32. package/CardActions/cardActionsClasses.d.ts +10 -10
  33. package/CardContent/cardContentClasses.d.ts +8 -8
  34. package/CardHeader/cardHeaderClasses.d.ts +18 -18
  35. package/CardMedia/cardMediaClasses.d.ts +12 -12
  36. package/Checkbox/checkboxClasses.d.ts +18 -18
  37. package/Chip/chipClasses.d.ts +96 -96
  38. package/CircularProgress/circularProgressClasses.d.ts +26 -26
  39. package/ClickAwayListener/index.d.ts +2 -2
  40. package/Collapse/collapseClasses.d.ts +18 -18
  41. package/Container/containerClasses.d.ts +6 -6
  42. package/Dialog/DialogContext.d.ts +6 -6
  43. package/Dialog/DialogContext.js +2 -2
  44. package/Dialog/dialogClasses.d.ts +36 -36
  45. package/DialogActions/dialogActionsClasses.d.ts +10 -10
  46. package/DialogContent/dialogContentClasses.d.ts +10 -10
  47. package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
  48. package/DialogTitle/dialogTitleClasses.d.ts +8 -8
  49. package/Divider/dividerClasses.d.ts +34 -34
  50. package/Drawer/drawerClasses.d.ts +30 -30
  51. package/Fab/fabClasses.d.ts +26 -26
  52. package/FilledInput/filledInputClasses.d.ts +40 -40
  53. package/FormControl/FormControlContext.d.ts +17 -17
  54. package/FormControl/formControlClasses.d.ts +14 -14
  55. package/FormControl/useFormControl.d.ts +2 -2
  56. package/FormControlLabel/formControlLabelClasses.d.ts +20 -20
  57. package/FormGroup/formGroupClasses.d.ts +12 -12
  58. package/FormHelperText/formHelperTextClasses.d.ts +22 -22
  59. package/FormLabel/formLabelClasses.d.ts +22 -22
  60. package/Grid/gridClasses.d.ts +48 -48
  61. package/Icon/iconClasses.d.ts +24 -24
  62. package/IconButton/iconButtonClasses.d.ts +34 -34
  63. package/ImageList/imageListClasses.d.ts +16 -16
  64. package/ImageListItem/imageListItemClasses.d.ts +18 -18
  65. package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
  66. package/Input/inputClasses.d.ts +34 -34
  67. package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
  68. package/InputBase/inputBaseClasses.d.ts +46 -46
  69. package/InputLabel/inputLabelClasses.d.ts +32 -32
  70. package/LinearProgress/linearProgressClasses.d.ts +42 -42
  71. package/Link/getTextDecoration.d.ts +15 -15
  72. package/Link/linkClasses.d.ts +18 -18
  73. package/List/listClasses.d.ts +14 -14
  74. package/ListItem/listItemClasses.d.ts +30 -30
  75. package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
  76. package/ListItemButton/listItemButtonClasses.d.ts +22 -22
  77. package/ListItemIcon/listItemIconClasses.d.ts +10 -10
  78. package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
  79. package/ListItemText/listItemTextClasses.d.ts +18 -18
  80. package/ListSubheader/listSubheaderClasses.d.ts +18 -18
  81. package/Menu/menuClasses.d.ts +12 -12
  82. package/MenuItem/menuItemClasses.d.ts +20 -20
  83. package/MobileStepper/mobileStepperClasses.d.ts +22 -22
  84. package/NativeSelect/nativeSelectClasses.d.ts +32 -32
  85. package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
  86. package/Pagination/paginationClasses.d.ts +14 -14
  87. package/PaginationItem/paginationItemClasses.d.ts +42 -42
  88. package/Paper/paperClasses.d.ts +39 -39
  89. package/Popover/popoverClasses.d.ts +10 -10
  90. package/Popper/Popper.d.ts +55 -55
  91. package/Radio/radioClasses.d.ts +16 -16
  92. package/RadioGroup/RadioGroupContext.d.ts +11 -11
  93. package/RadioGroup/useRadioGroup.d.ts +4 -4
  94. package/Rating/ratingClasses.d.ts +40 -40
  95. package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
  96. package/Select/selectClasses.d.ts +30 -30
  97. package/Skeleton/skeletonClasses.d.ts +26 -26
  98. package/Slider/SliderValueLabel.d.ts +15 -15
  99. package/Slider/SliderValueLabel.types.d.ts +24 -24
  100. package/Slider/sliderClasses.d.ts +58 -58
  101. package/Snackbar/snackbarClasses.d.ts +20 -20
  102. package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
  103. package/SpeedDial/speedDialClasses.d.ts +22 -22
  104. package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
  105. package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
  106. package/Step/StepContext.d.ts +20 -20
  107. package/Step/stepClasses.d.ts +16 -16
  108. package/StepButton/stepButtonClasses.d.ts +14 -14
  109. package/StepConnector/stepConnectorClasses.d.ts +26 -26
  110. package/StepContent/stepContentClasses.d.ts +12 -12
  111. package/StepIcon/stepIconClasses.d.ts +16 -16
  112. package/StepLabel/stepLabelClasses.d.ts +28 -28
  113. package/Stepper/StepperContext.d.ts +18 -18
  114. package/Stepper/stepperClasses.d.ts +14 -14
  115. package/SvgIcon/svgIconClasses.d.ts +26 -26
  116. package/SwipeableDrawer/SwipeableDrawer.js +3 -3
  117. package/Switch/switchClasses.d.ts +32 -32
  118. package/Tab/tabClasses.d.ts +26 -26
  119. package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
  120. package/Table/tableClasses.d.ts +10 -10
  121. package/TableBody/tableBodyClasses.d.ts +8 -8
  122. package/TableCell/tableCellClasses.d.ts +32 -32
  123. package/TableContainer/tableContainerClasses.d.ts +8 -8
  124. package/TableFooter/tableFooterClasses.d.ts +8 -8
  125. package/TableHead/tableHeadClasses.d.ts +8 -8
  126. package/TablePagination/tablePaginationClasses.d.ts +28 -28
  127. package/TableRow/tableRowClasses.d.ts +16 -16
  128. package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
  129. package/Tabs/tabsClasses.d.ts +32 -32
  130. package/TextField/textFieldClasses.d.ts +8 -8
  131. package/ToggleButton/toggleButtonClasses.d.ts +24 -24
  132. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
  133. package/Toolbar/toolbarClasses.d.ts +14 -14
  134. package/Tooltip/tooltipClasses.d.ts +30 -30
  135. package/Typography/typographyClasses.d.ts +50 -50
  136. package/Unstable_Grid2/Grid2.d.ts +4 -4
  137. package/Unstable_Grid2/Grid2Props.d.ts +15 -15
  138. package/Unstable_Grid2/grid2Classes.d.ts +5 -5
  139. package/Unstable_Grid2/index.d.ts +4 -4
  140. package/className/index.d.ts +1 -1
  141. package/darkScrollbar/index.d.ts +28 -28
  142. package/generateUtilityClass/index.d.ts +2 -2
  143. package/generateUtilityClasses/index.d.ts +1 -1
  144. package/index.js +1 -1
  145. package/internal/SwitchBase.js +1 -1
  146. package/internal/switchBaseClasses.d.ts +12 -12
  147. package/legacy/AppBar/AppBar.js +1 -1
  148. package/legacy/Autocomplete/Autocomplete.js +10 -1
  149. package/legacy/Avatar/Avatar.js +1 -0
  150. package/legacy/Backdrop/Backdrop.js +9 -3
  151. package/legacy/Badge/Badge.js +48 -48
  152. package/legacy/BottomNavigation/BottomNavigation.js +0 -0
  153. package/legacy/Dialog/DialogContext.js +2 -2
  154. package/legacy/SwipeableDrawer/SwipeableDrawer.js +3 -3
  155. package/legacy/index.js +1 -1
  156. package/legacy/internal/SwitchBase.js +1 -1
  157. package/legacy/useMediaQuery/useMediaQuery.js +12 -7
  158. package/locale/index.d.ts +75 -75
  159. package/modern/AppBar/AppBar.js +1 -1
  160. package/modern/Autocomplete/Autocomplete.js +14 -0
  161. package/modern/Avatar/Avatar.js +1 -0
  162. package/modern/Backdrop/Backdrop.js +10 -5
  163. package/modern/Badge/Badge.js +47 -47
  164. package/modern/BottomNavigation/BottomNavigation.js +0 -0
  165. package/modern/Dialog/DialogContext.js +2 -2
  166. package/modern/SwipeableDrawer/SwipeableDrawer.js +3 -3
  167. package/modern/index.js +1 -1
  168. package/modern/internal/SwitchBase.js +1 -1
  169. package/modern/useMediaQuery/useMediaQuery.js +9 -7
  170. package/node/AppBar/AppBar.js +1 -1
  171. package/node/Autocomplete/Autocomplete.js +14 -0
  172. package/node/Avatar/Avatar.js +1 -0
  173. package/node/Backdrop/Backdrop.js +10 -5
  174. package/node/Badge/Badge.js +46 -47
  175. package/node/BottomNavigation/BottomNavigation.js +0 -0
  176. package/node/Dialog/DialogContext.js +4 -2
  177. package/node/SwipeableDrawer/SwipeableDrawer.js +3 -3
  178. package/node/index.js +1 -1
  179. package/node/internal/SwitchBase.js +1 -1
  180. package/node/useMediaQuery/useMediaQuery.js +9 -7
  181. package/package.json +6 -6
  182. package/styles/CssVarsProvider.d.ts +16 -16
  183. package/styles/excludeVariablesFromRoot.d.ts +5 -5
  184. package/styles/getOverlayAlpha.d.ts +2 -2
  185. package/styles/props.d.ts +2 -2
  186. package/transitions/index.d.ts +1 -1
  187. package/transitions/transition.d.ts +13 -13
  188. package/transitions/utils.d.ts +23 -23
  189. package/types/OverridableComponentAugmentation.d.ts +31 -31
  190. package/umd/material-ui.development.js +163 -248
  191. package/umd/material-ui.production.min.js +20 -20
  192. package/useMediaQuery/useMediaQuery.d.ts +46 -31
  193. package/useMediaQuery/useMediaQuery.js +9 -7
  194. package/useTouchRipple/index.d.ts +1 -1
  195. package/useTouchRipple/useTouchRipple.d.ts +28 -28
  196. package/utils/getScrollbarSize.d.ts +2 -2
  197. package/utils/ownerDocument.d.ts +2 -2
  198. package/utils/ownerWindow.d.ts +2 -2
  199. package/utils/setRef.d.ts +2 -2
@@ -8,9 +8,8 @@ import useEnhancedEffect from '../utils/useEnhancedEffect';
8
8
  */
9
9
 
10
10
  function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
11
- var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
12
11
  var _React$useState = React.useState(function () {
13
- if (noSsr && supportMatchMedia) {
12
+ if (noSsr && matchMedia) {
14
13
  return matchMedia(query).matches;
15
14
  }
16
15
  if (ssrMatchMedia) {
@@ -25,7 +24,7 @@ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSs
25
24
  setMatch = _React$useState[1];
26
25
  useEnhancedEffect(function () {
27
26
  var active = true;
28
- if (!supportMatchMedia) {
27
+ if (!matchMedia) {
29
28
  return undefined;
30
29
  }
31
30
  var queryList = matchMedia(query);
@@ -44,17 +43,22 @@ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSs
44
43
  active = false;
45
44
  queryList.removeListener(updateMatch);
46
45
  };
47
- }, [query, matchMedia, supportMatchMedia]);
46
+ }, [query, matchMedia]);
48
47
  return match;
49
48
  }
50
49
 
51
50
  // eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814
52
51
  var maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];
53
- function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
52
+ function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
54
53
  var getDefaultSnapshot = React.useCallback(function () {
55
54
  return defaultMatches;
56
55
  }, [defaultMatches]);
57
56
  var getServerSnapshot = React.useMemo(function () {
57
+ if (noSsr && matchMedia) {
58
+ return function () {
59
+ return matchMedia(query).matches;
60
+ };
61
+ }
58
62
  if (ssrMatchMedia !== null) {
59
63
  var _ssrMatchMedia = ssrMatchMedia(query),
60
64
  matches = _ssrMatchMedia.matches;
@@ -63,7 +67,7 @@ function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
63
67
  };
64
68
  }
65
69
  return getDefaultSnapshot;
66
- }, [getDefaultSnapshot, query, ssrMatchMedia]);
70
+ }, [getDefaultSnapshot, query, ssrMatchMedia, noSsr, matchMedia]);
67
71
  var _React$useMemo = React.useMemo(function () {
68
72
  if (matchMedia === null) {
69
73
  return [getDefaultSnapshot, function () {
@@ -106,7 +110,8 @@ export default function useMediaQuery(queryInput) {
106
110
  matchMedia = _getThemeProps$matchM === void 0 ? supportMatchMedia ? window.matchMedia : null : _getThemeProps$matchM,
107
111
  _getThemeProps$ssrMat = _getThemeProps.ssrMatchMedia,
108
112
  ssrMatchMedia = _getThemeProps$ssrMat === void 0 ? null : _getThemeProps$ssrMat,
109
- noSsr = _getThemeProps.noSsr;
113
+ _getThemeProps$noSsr = _getThemeProps.noSsr,
114
+ noSsr = _getThemeProps$noSsr === void 0 ? false : _getThemeProps$noSsr;
110
115
  if (process.env.NODE_ENV !== 'production') {
111
116
  if (typeof queryInput === 'function' && theme === null) {
112
117
  console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n'));
package/locale/index.d.ts CHANGED
@@ -1,75 +1,75 @@
1
- import { ComponentsPropsList } from '../styles/props';
2
- export interface Localization {
3
- components?: {
4
- MuiAlert?: {
5
- defaultProps: Pick<ComponentsPropsList['MuiAlert'], 'closeText'>;
6
- };
7
- MuiBreadcrumbs?: {
8
- defaultProps: Pick<ComponentsPropsList['MuiBreadcrumbs'], 'expandText'>;
9
- };
10
- MuiTablePagination?: {
11
- defaultProps: Pick<ComponentsPropsList['MuiTablePagination'], 'labelRowsPerPage' | 'labelDisplayedRows' | 'getItemAriaLabel'>;
12
- };
13
- MuiRating?: {
14
- defaultProps: Pick<ComponentsPropsList['MuiRating'], 'emptyLabelText' | 'getLabelText'>;
15
- };
16
- MuiAutocomplete?: {
17
- defaultProps: Pick<ComponentsPropsList['MuiAutocomplete'], 'clearText' | 'closeText' | 'loadingText' | 'noOptionsText' | 'openText'>;
18
- };
19
- MuiPagination?: {
20
- defaultProps: Pick<ComponentsPropsList['MuiPagination'], 'aria-label' | 'getItemAriaLabel'>;
21
- };
22
- };
23
- }
24
- export declare const amET: Localization;
25
- export declare const arEG: Localization;
26
- export declare const arSA: Localization;
27
- export declare const arSD: Localization;
28
- export declare const azAZ: Localization;
29
- export declare const bnBD: Localization;
30
- export declare const beBY: Localization;
31
- export declare const bgBG: Localization;
32
- export declare const caES: Localization;
33
- export declare const csCZ: Localization;
34
- export declare const daDK: Localization;
35
- export declare const deDE: Localization;
36
- export declare const elGR: Localization;
37
- export declare const enUS: Localization;
38
- export declare const esES: Localization;
39
- export declare const etEE: Localization;
40
- export declare const faIR: Localization;
41
- export declare const fiFI: Localization;
42
- export declare const frFR: Localization;
43
- export declare const heIL: Localization;
44
- export declare const hiIN: Localization;
45
- export declare const hrHR: Localization;
46
- export declare const huHU: Localization;
47
- export declare const hyAM: Localization;
48
- export declare const idID: Localization;
49
- export declare const isIS: Localization;
50
- export declare const itIT: Localization;
51
- export declare const jaJP: Localization;
52
- export declare const khKH: Localization;
53
- export declare const koKR: Localization;
54
- export declare const kuLatn: Localization;
55
- export declare const kkKZ: Localization;
56
- export declare const mkMK: Localization;
57
- export declare const nbNO: Localization;
58
- export declare const nlNL: Localization;
59
- export declare const plPL: Localization;
60
- export declare const ptBR: Localization;
61
- export declare const ptPT: Localization;
62
- export declare const roRO: Localization;
63
- export declare const srRS: Localization;
64
- export declare const ruRU: Localization;
65
- export declare const siLK: Localization;
66
- export declare const skSK: Localization;
67
- export declare const svSE: Localization;
68
- export declare const thTH: Localization;
69
- export declare const trTR: Localization;
70
- export declare const ukUA: Localization;
71
- export declare const urPK: Localization;
72
- export declare const viVN: Localization;
73
- export declare const zhCN: Localization;
74
- export declare const zhHK: Localization;
75
- export declare const zhTW: Localization;
1
+ import { ComponentsPropsList } from '../styles/props';
2
+ export interface Localization {
3
+ components?: {
4
+ MuiAlert?: {
5
+ defaultProps: Pick<ComponentsPropsList['MuiAlert'], 'closeText'>;
6
+ };
7
+ MuiBreadcrumbs?: {
8
+ defaultProps: Pick<ComponentsPropsList['MuiBreadcrumbs'], 'expandText'>;
9
+ };
10
+ MuiTablePagination?: {
11
+ defaultProps: Pick<ComponentsPropsList['MuiTablePagination'], 'labelRowsPerPage' | 'labelDisplayedRows' | 'getItemAriaLabel'>;
12
+ };
13
+ MuiRating?: {
14
+ defaultProps: Pick<ComponentsPropsList['MuiRating'], 'emptyLabelText' | 'getLabelText'>;
15
+ };
16
+ MuiAutocomplete?: {
17
+ defaultProps: Pick<ComponentsPropsList['MuiAutocomplete'], 'clearText' | 'closeText' | 'loadingText' | 'noOptionsText' | 'openText'>;
18
+ };
19
+ MuiPagination?: {
20
+ defaultProps: Pick<ComponentsPropsList['MuiPagination'], 'aria-label' | 'getItemAriaLabel'>;
21
+ };
22
+ };
23
+ }
24
+ export declare const amET: Localization;
25
+ export declare const arEG: Localization;
26
+ export declare const arSA: Localization;
27
+ export declare const arSD: Localization;
28
+ export declare const azAZ: Localization;
29
+ export declare const bnBD: Localization;
30
+ export declare const beBY: Localization;
31
+ export declare const bgBG: Localization;
32
+ export declare const caES: Localization;
33
+ export declare const csCZ: Localization;
34
+ export declare const daDK: Localization;
35
+ export declare const deDE: Localization;
36
+ export declare const elGR: Localization;
37
+ export declare const enUS: Localization;
38
+ export declare const esES: Localization;
39
+ export declare const etEE: Localization;
40
+ export declare const faIR: Localization;
41
+ export declare const fiFI: Localization;
42
+ export declare const frFR: Localization;
43
+ export declare const heIL: Localization;
44
+ export declare const hiIN: Localization;
45
+ export declare const hrHR: Localization;
46
+ export declare const huHU: Localization;
47
+ export declare const hyAM: Localization;
48
+ export declare const idID: Localization;
49
+ export declare const isIS: Localization;
50
+ export declare const itIT: Localization;
51
+ export declare const jaJP: Localization;
52
+ export declare const khKH: Localization;
53
+ export declare const koKR: Localization;
54
+ export declare const kuLatn: Localization;
55
+ export declare const kkKZ: Localization;
56
+ export declare const mkMK: Localization;
57
+ export declare const nbNO: Localization;
58
+ export declare const nlNL: Localization;
59
+ export declare const plPL: Localization;
60
+ export declare const ptBR: Localization;
61
+ export declare const ptPT: Localization;
62
+ export declare const roRO: Localization;
63
+ export declare const srRS: Localization;
64
+ export declare const ruRU: Localization;
65
+ export declare const siLK: Localization;
66
+ export declare const skSK: Localization;
67
+ export declare const svSE: Localization;
68
+ export declare const thTH: Localization;
69
+ export declare const trTR: Localization;
70
+ export declare const ukUA: Localization;
71
+ export declare const urPK: Localization;
72
+ export declare const viVN: Localization;
73
+ export declare const zhCN: Localization;
74
+ export declare const zhHK: Localization;
75
+ export declare const zhTW: Localization;
@@ -25,7 +25,7 @@ const useUtilityClasses = ownerState => {
25
25
 
26
26
  // var2 is the fallback.
27
27
  // Ex. var1: 'var(--a)', var2: 'var(--b)'; return: 'var(--a, var(--b))'
28
- const joinVars = (var1, var2) => `${var1?.replace(')', '')}, ${var2})`;
28
+ const joinVars = (var1, var2) => var1 ? `${var1?.replace(')', '')}, ${var2})` : var2;
29
29
  const AppBarRoot = styled(Paper, {
30
30
  name: 'MuiAppBar',
31
31
  slot: 'Root',
@@ -178,6 +178,20 @@ const AutocompleteRoot = styled('div', {
178
178
  [`& .${inputBaseClasses.hiddenLabel}`]: {
179
179
  paddingTop: 8
180
180
  },
181
+ [`& .${filledInputClasses.root}.${inputBaseClasses.hiddenLabel}`]: {
182
+ paddingTop: 0,
183
+ paddingBottom: 0,
184
+ [`& .${autocompleteClasses.input}`]: {
185
+ paddingTop: 16,
186
+ paddingBottom: 17
187
+ }
188
+ },
189
+ [`& .${filledInputClasses.root}.${inputBaseClasses.hiddenLabel}.${inputBaseClasses.sizeSmall}`]: {
190
+ [`& .${autocompleteClasses.input}`]: {
191
+ paddingTop: 8,
192
+ paddingBottom: 9
193
+ }
194
+ },
181
195
  [`& .${autocompleteClasses.input}`]: _extends({
182
196
  flexGrow: 1,
183
197
  textOverflow: 'ellipsis',
@@ -168,6 +168,7 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(inProps, ref) {
168
168
  children = alt[0];
169
169
  } else {
170
170
  children = /*#__PURE__*/_jsx(AvatarFallback, {
171
+ ownerState: ownerState,
171
172
  className: classes.fallback
172
173
  });
173
174
  }
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["children", "component", "components", "componentsProps", "className", "invisible", "open", "slotProps", "slots", "transitionDuration", "TransitionComponent"];
3
+ const _excluded = ["children", "className", "component", "components", "componentsProps", "invisible", "open", "slotProps", "slots", "TransitionComponent", "transitionDuration"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -52,17 +52,16 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
52
52
  });
53
53
  const {
54
54
  children,
55
+ className,
55
56
  component = 'div',
56
57
  components = {},
57
58
  componentsProps = {},
58
- className,
59
59
  invisible = false,
60
60
  open,
61
61
  slotProps = {},
62
62
  slots = {},
63
- transitionDuration,
64
- // eslint-disable-next-line react/prop-types
65
- TransitionComponent = Fade
63
+ TransitionComponent = Fade,
64
+ transitionDuration
66
65
  } = props,
67
66
  other = _objectWithoutPropertiesLoose(props, _excluded);
68
67
  const ownerState = _extends({}, props, {
@@ -167,6 +166,12 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes /* remove-proptypes *
167
166
  * The system prop that allows defining system overrides as well as additional CSS styles.
168
167
  */
169
168
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
169
+ /**
170
+ * The component used for the transition.
171
+ * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
172
+ * @default Fade
173
+ */
174
+ TransitionComponent: PropTypes.elementType,
170
175
  /**
171
176
  * The duration for the transition, in milliseconds.
172
177
  * You may specify a single timeout for all transitions, or individually with an object.
@@ -1,18 +1,19 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["anchorOrigin", "className", "component", "components", "componentsProps", "overlap", "color", "invisible", "max", "badgeContent", "slots", "slotProps", "showZero", "variant"];
3
+ const _excluded = ["anchorOrigin", "className", "classes", "component", "components", "componentsProps", "children", "overlap", "color", "invisible", "max", "badgeContent", "slots", "slotProps", "showZero", "variant"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
7
7
  import { usePreviousProps } from '@mui/utils';
8
8
  import composeClasses from '@mui/base/composeClasses';
9
- import BadgeUnstyled from '@mui/base/BadgeUnstyled';
9
+ import { useBadge } from '@mui/base/BadgeUnstyled';
10
+ import { useSlotProps } from '@mui/base';
10
11
  import styled from '../styles/styled';
11
12
  import useThemeProps from '../styles/useThemeProps';
12
- import shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';
13
13
  import capitalize from '../utils/capitalize';
14
14
  import badgeClasses, { getBadgeUtilityClass } from './badgeClasses';
15
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
+ import { jsxs as _jsxs } from "react/jsx-runtime";
16
17
  const RADIUS_STANDARD = 10;
17
18
  const RADIUS_DOT = 4;
18
19
  const useUtilityClasses = ownerState => {
@@ -165,13 +166,14 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
165
166
  horizontal: 'right'
166
167
  },
167
168
  className,
168
- component = 'span',
169
+ component,
169
170
  components = {},
170
171
  componentsProps = {},
172
+ children,
171
173
  overlap: overlapProp = 'rectangular',
172
174
  color: colorProp = 'default',
173
175
  invisible: invisibleProp = false,
174
- max,
176
+ max: maxProp = 99,
175
177
  badgeContent: badgeContentProp,
176
178
  slots,
177
179
  slotProps,
@@ -179,73 +181,71 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
179
181
  variant: variantProp = 'standard'
180
182
  } = props,
181
183
  other = _objectWithoutPropertiesLoose(props, _excluded);
184
+ const {
185
+ badgeContent,
186
+ invisible: invisibleFromHook,
187
+ max,
188
+ displayValue: displayValueFromHook
189
+ } = useBadge({
190
+ max: maxProp,
191
+ invisible: invisibleProp,
192
+ badgeContent: badgeContentProp,
193
+ showZero
194
+ });
182
195
  const prevProps = usePreviousProps({
183
196
  anchorOrigin: anchorOriginProp,
184
197
  color: colorProp,
185
198
  overlap: overlapProp,
186
- variant: variantProp
199
+ variant: variantProp,
200
+ badgeContent: badgeContentProp
187
201
  });
188
- let invisible = invisibleProp;
189
- if (invisibleProp === false && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== 'dot')) {
190
- invisible = true;
191
- }
202
+ const invisible = invisibleFromHook || badgeContent == null && variantProp !== 'dot';
192
203
  const {
193
204
  color = colorProp,
194
205
  overlap = overlapProp,
195
206
  anchorOrigin = anchorOriginProp,
196
207
  variant = variantProp
197
208
  } = invisible ? prevProps : props;
209
+ const displayValue = variant !== 'dot' ? displayValueFromHook : undefined;
198
210
  const ownerState = _extends({}, props, {
199
- anchorOrigin,
211
+ badgeContent,
200
212
  invisible,
213
+ max,
214
+ displayValue,
215
+ showZero,
216
+ anchorOrigin,
201
217
  color,
202
218
  overlap,
203
219
  variant
204
220
  });
205
221
  const classes = useUtilityClasses(ownerState);
206
- let displayValue;
207
- if (variant !== 'dot') {
208
- displayValue = badgeContentProp && Number(badgeContentProp) > max ? `${max}+` : badgeContentProp;
209
- }
210
222
 
211
223
  // support both `slots` and `components` for backward compatibility
212
224
  const RootSlot = slots?.root ?? components.Root ?? BadgeRoot;
213
225
  const BadgeSlot = slots?.badge ?? components.Badge ?? BadgeBadge;
214
226
  const rootSlotProps = slotProps?.root ?? componentsProps.root;
215
227
  const badgeSlotProps = slotProps?.badge ?? componentsProps.badge;
216
- return /*#__PURE__*/_jsx(BadgeUnstyled, _extends({
217
- invisible: invisibleProp,
218
- badgeContent: displayValue,
219
- showZero: showZero,
220
- max: max
221
- }, other, {
222
- slots: {
223
- root: RootSlot,
224
- badge: BadgeSlot
225
- },
226
- className: clsx(rootSlotProps?.className, classes.root, className),
227
- slotProps: {
228
- root: _extends({}, rootSlotProps, shouldSpreadAdditionalProps(RootSlot) && {
229
- as: component,
230
- ownerState: _extends({}, rootSlotProps?.ownerState, {
231
- anchorOrigin,
232
- color,
233
- overlap,
234
- variant
235
- })
236
- }),
237
- badge: _extends({}, badgeSlotProps, {
238
- className: clsx(classes.badge, badgeSlotProps?.className)
239
- }, shouldSpreadAdditionalProps(BadgeSlot) && {
240
- ownerState: _extends({}, badgeSlotProps?.ownerState, {
241
- anchorOrigin,
242
- color,
243
- overlap,
244
- variant
245
- })
246
- })
228
+ const rootProps = useSlotProps({
229
+ elementType: RootSlot,
230
+ externalSlotProps: rootSlotProps,
231
+ externalForwardedProps: other,
232
+ additionalProps: {
233
+ ref,
234
+ as: component
247
235
  },
248
- ref: ref
236
+ ownerState,
237
+ className: clsx(rootSlotProps?.className, classes.root, className)
238
+ });
239
+ const badgeProps = useSlotProps({
240
+ elementType: BadgeSlot,
241
+ externalSlotProps: badgeSlotProps,
242
+ ownerState,
243
+ className: clsx(classes.badge, badgeSlotProps?.className)
244
+ });
245
+ return /*#__PURE__*/_jsxs(RootSlot, _extends({}, rootProps, {
246
+ children: [children, /*#__PURE__*/_jsx(BadgeSlot, _extends({}, badgeProps, {
247
+ children: displayValue
248
+ }))]
249
249
  }));
250
250
  });
251
251
  process.env.NODE_ENV !== "production" ? Badge.propTypes /* remove-proptypes */ = {
File without changes
@@ -1,5 +1,5 @@
1
- import { createContext } from 'react';
2
- const DialogContext = /*#__PURE__*/createContext({});
1
+ import * as React from 'react';
2
+ const DialogContext = /*#__PURE__*/React.createContext({});
3
3
  if (process.env.NODE_ENV !== 'production') {
4
4
  DialogContext.displayName = 'DialogContext';
5
5
  }
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  const _excluded = ["BackdropProps"],
4
4
  _excluded2 = ["anchor", "disableBackdropTransition", "disableDiscovery", "disableSwipeToOpen", "hideBackdrop", "hysteresis", "allowSwipeInChildren", "minFlingVelocity", "ModalProps", "onClose", "onOpen", "open", "PaperProps", "SwipeAreaProps", "swipeAreaWidth", "transitionDuration", "variant"];
5
5
  import * as React from 'react';
6
- import { flushSync } from 'react-dom';
6
+ import * as ReactDOM from 'react-dom';
7
7
  import PropTypes from 'prop-types';
8
8
  import { elementTypeAcceptingRef } from '@mui/utils';
9
9
  import { useThemeProps } from '@mui/system';
@@ -207,7 +207,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
207
207
  }
208
208
  claimedSwipeInstance = null;
209
209
  touchDetected.current = false;
210
- flushSync(() => {
210
+ ReactDOM.flushSync(() => {
211
211
  setMaybeSwiping(false);
212
212
  });
213
213
 
@@ -259,7 +259,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
259
259
  // this is because Safari Mobile will not fire any mouse events (still fires touch though) if the DOM changes during mousemove.
260
260
  // so do this change on first touchmove instead of touchstart
261
261
  if (force || !(disableDiscovery && allowSwipeInChildren)) {
262
- flushSync(() => {
262
+ ReactDOM.flushSync(() => {
263
263
  setMaybeSwiping(true);
264
264
  });
265
265
  }
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.11.8
2
+ * @mui/material v5.11.10
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -146,7 +146,7 @@ const SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref)
146
146
  defaultChecked: defaultChecked,
147
147
  className: classes.input,
148
148
  disabled: disabled,
149
- id: hasLabelFor && id,
149
+ id: hasLabelFor ? id : undefined,
150
150
  name: name,
151
151
  onChange: handleInputChange,
152
152
  readOnly: readOnly,
@@ -7,9 +7,8 @@ import useEnhancedEffect from '../utils/useEnhancedEffect';
7
7
  */
8
8
 
9
9
  function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
10
- const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
11
10
  const [match, setMatch] = React.useState(() => {
12
- if (noSsr && supportMatchMedia) {
11
+ if (noSsr && matchMedia) {
13
12
  return matchMedia(query).matches;
14
13
  }
15
14
  if (ssrMatchMedia) {
@@ -22,7 +21,7 @@ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSs
22
21
  });
23
22
  useEnhancedEffect(() => {
24
23
  let active = true;
25
- if (!supportMatchMedia) {
24
+ if (!matchMedia) {
26
25
  return undefined;
27
26
  }
28
27
  const queryList = matchMedia(query);
@@ -41,15 +40,18 @@ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSs
41
40
  active = false;
42
41
  queryList.removeListener(updateMatch);
43
42
  };
44
- }, [query, matchMedia, supportMatchMedia]);
43
+ }, [query, matchMedia]);
45
44
  return match;
46
45
  }
47
46
 
48
47
  // eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814
49
48
  const maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];
50
- function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
49
+ function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
51
50
  const getDefaultSnapshot = React.useCallback(() => defaultMatches, [defaultMatches]);
52
51
  const getServerSnapshot = React.useMemo(() => {
52
+ if (noSsr && matchMedia) {
53
+ return () => matchMedia(query).matches;
54
+ }
53
55
  if (ssrMatchMedia !== null) {
54
56
  const {
55
57
  matches
@@ -57,7 +59,7 @@ function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
57
59
  return () => matches;
58
60
  }
59
61
  return getDefaultSnapshot;
60
- }, [getDefaultSnapshot, query, ssrMatchMedia]);
62
+ }, [getDefaultSnapshot, query, ssrMatchMedia, noSsr, matchMedia]);
61
63
  const [getSnapshot, subscribe] = React.useMemo(() => {
62
64
  if (matchMedia === null) {
63
65
  return [getDefaultSnapshot, () => () => {}];
@@ -85,7 +87,7 @@ export default function useMediaQuery(queryInput, options = {}) {
85
87
  defaultMatches = false,
86
88
  matchMedia = supportMatchMedia ? window.matchMedia : null,
87
89
  ssrMatchMedia = null,
88
- noSsr
90
+ noSsr = false
89
91
  } = getThemeProps({
90
92
  name: 'MuiUseMediaQuery',
91
93
  props: options,
@@ -34,7 +34,7 @@ const useUtilityClasses = ownerState => {
34
34
 
35
35
  // var2 is the fallback.
36
36
  // Ex. var1: 'var(--a)', var2: 'var(--b)'; return: 'var(--a, var(--b))'
37
- const joinVars = (var1, var2) => `${var1 == null ? void 0 : var1.replace(')', '')}, ${var2})`;
37
+ const joinVars = (var1, var2) => var1 ? `${var1 == null ? void 0 : var1.replace(')', '')}, ${var2})` : var2;
38
38
  const AppBarRoot = (0, _styled.default)(_Paper.default, {
39
39
  name: 'MuiAppBar',
40
40
  slot: 'Root',
@@ -192,6 +192,20 @@ const AutocompleteRoot = (0, _styled.default)('div', {
192
192
  [`& .${_inputBaseClasses.default.hiddenLabel}`]: {
193
193
  paddingTop: 8
194
194
  },
195
+ [`& .${_filledInputClasses.default.root}.${_inputBaseClasses.default.hiddenLabel}`]: {
196
+ paddingTop: 0,
197
+ paddingBottom: 0,
198
+ [`& .${_autocompleteClasses.default.input}`]: {
199
+ paddingTop: 16,
200
+ paddingBottom: 17
201
+ }
202
+ },
203
+ [`& .${_filledInputClasses.default.root}.${_inputBaseClasses.default.hiddenLabel}.${_inputBaseClasses.default.sizeSmall}`]: {
204
+ [`& .${_autocompleteClasses.default.input}`]: {
205
+ paddingTop: 8,
206
+ paddingBottom: 9
207
+ }
208
+ },
195
209
  [`& .${_autocompleteClasses.default.input}`]: (0, _extends2.default)({
196
210
  flexGrow: 1,
197
211
  textOverflow: 'ellipsis',
@@ -177,6 +177,7 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(inProps, ref) {
177
177
  children = alt[0];
178
178
  } else {
179
179
  children = /*#__PURE__*/(0, _jsxRuntime.jsx)(AvatarFallback, {
180
+ ownerState: ownerState,
180
181
  className: classes.fallback
181
182
  });
182
183
  }
@@ -16,7 +16,7 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
16
16
  var _Fade = _interopRequireDefault(require("../Fade"));
17
17
  var _backdropClasses = require("./backdropClasses");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
- const _excluded = ["children", "component", "components", "componentsProps", "className", "invisible", "open", "slotProps", "slots", "transitionDuration", "TransitionComponent"];
19
+ const _excluded = ["children", "className", "component", "components", "componentsProps", "invisible", "open", "slotProps", "slots", "TransitionComponent", "transitionDuration"];
20
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
22
  const useUtilityClasses = ownerState => {
@@ -62,17 +62,16 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
62
62
  });
63
63
  const {
64
64
  children,
65
+ className,
65
66
  component = 'div',
66
67
  components = {},
67
68
  componentsProps = {},
68
- className,
69
69
  invisible = false,
70
70
  open,
71
71
  slotProps = {},
72
72
  slots = {},
73
- transitionDuration,
74
- // eslint-disable-next-line react/prop-types
75
- TransitionComponent = _Fade.default
73
+ TransitionComponent = _Fade.default,
74
+ transitionDuration
76
75
  } = props,
77
76
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
78
77
  const ownerState = (0, _extends2.default)({}, props, {
@@ -177,6 +176,12 @@ process.env.NODE_ENV !== "production" ? Backdrop.propTypes /* remove-proptypes *
177
176
  * The system prop that allows defining system overrides as well as additional CSS styles.
178
177
  */
179
178
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
179
+ /**
180
+ * The component used for the transition.
181
+ * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
182
+ * @default Fade
183
+ */
184
+ TransitionComponent: _propTypes.default.elementType,
180
185
  /**
181
186
  * The duration for the transition, in milliseconds.
182
187
  * You may specify a single timeout for all transitions, or individually with an object.