@mui/material 5.11.10 → 5.11.12

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 (115) hide show
  1. package/Autocomplete/Autocomplete.d.ts +4 -1
  2. package/Autocomplete/Autocomplete.js +5 -2
  3. package/Autocomplete/autocompleteClasses.d.ts +2 -0
  4. package/Autocomplete/autocompleteClasses.js +1 -1
  5. package/Badge/Badge.js +1 -1
  6. package/CHANGELOG.md +233 -0
  7. package/Container/Container.js +0 -1
  8. package/DialogTitle/DialogTitle.js +2 -2
  9. package/InputBase/InputBase.js +2 -2
  10. package/InputLabel/InputLabel.js +3 -1
  11. package/ListSubheader/ListSubheader.js +1 -0
  12. package/Menu/Menu.js +1 -1
  13. package/MenuList/MenuList.js +7 -0
  14. package/Modal/Modal.d.ts +9 -1
  15. package/Modal/Modal.js +14 -9
  16. package/OutlinedInput/OutlinedInput.js +1 -1
  17. package/README.md +0 -2
  18. package/Rating/Rating.js +2 -2
  19. package/Select/SelectInput.js +2 -22
  20. package/Slider/Slider.d.ts +5 -1
  21. package/Slider/Slider.js +16 -11
  22. package/Snackbar/Snackbar.js +21 -125
  23. package/Stack/Stack.d.ts +0 -1
  24. package/Stack/Stack.js +9 -120
  25. package/Stack/index.d.ts +3 -0
  26. package/Stack/index.js +2 -1
  27. package/Stack/stackClasses.d.ts +6 -0
  28. package/Stack/stackClasses.js +7 -0
  29. package/Unstable_Grid2/Grid2.js +2 -3
  30. package/index.js +1 -1
  31. package/legacy/Autocomplete/Autocomplete.js +5 -2
  32. package/legacy/Autocomplete/autocompleteClasses.js +1 -1
  33. package/legacy/Badge/Badge.js +1 -1
  34. package/legacy/Container/Container.js +0 -1
  35. package/legacy/DialogTitle/DialogTitle.js +2 -2
  36. package/legacy/InputBase/InputBase.js +2 -2
  37. package/legacy/InputLabel/InputLabel.js +3 -1
  38. package/legacy/ListSubheader/ListSubheader.js +1 -0
  39. package/legacy/Menu/Menu.js +1 -1
  40. package/legacy/MenuList/MenuList.js +7 -0
  41. package/legacy/Modal/Modal.js +14 -9
  42. package/legacy/OutlinedInput/OutlinedInput.js +1 -1
  43. package/legacy/Rating/Rating.js +2 -2
  44. package/legacy/Select/SelectInput.js +2 -22
  45. package/legacy/Slider/Slider.js +16 -12
  46. package/legacy/Snackbar/Snackbar.js +20 -119
  47. package/legacy/Stack/Stack.js +13 -122
  48. package/legacy/Stack/index.js +2 -1
  49. package/legacy/Stack/stackClasses.js +7 -0
  50. package/legacy/Unstable_Grid2/Grid2.js +2 -3
  51. package/legacy/index.js +1 -1
  52. package/legacy/styles/CssVarsProvider.js +1 -8
  53. package/legacy/styles/createTheme.js +1 -0
  54. package/legacy/styles/experimental_extendTheme.js +64 -40
  55. package/legacy/useAutocomplete/useAutocomplete.js +2 -2
  56. package/modern/Autocomplete/Autocomplete.js +5 -2
  57. package/modern/Autocomplete/autocompleteClasses.js +1 -1
  58. package/modern/Badge/Badge.js +1 -1
  59. package/modern/Container/Container.js +0 -1
  60. package/modern/DialogTitle/DialogTitle.js +2 -2
  61. package/modern/InputBase/InputBase.js +2 -2
  62. package/modern/InputLabel/InputLabel.js +3 -1
  63. package/modern/ListSubheader/ListSubheader.js +1 -0
  64. package/modern/Menu/Menu.js +1 -1
  65. package/modern/MenuList/MenuList.js +7 -0
  66. package/modern/Modal/Modal.js +14 -9
  67. package/modern/OutlinedInput/OutlinedInput.js +1 -1
  68. package/modern/Rating/Rating.js +2 -2
  69. package/modern/Select/SelectInput.js +2 -18
  70. package/modern/Slider/Slider.js +16 -11
  71. package/modern/Snackbar/Snackbar.js +21 -125
  72. package/modern/Stack/Stack.js +9 -120
  73. package/modern/Stack/index.js +2 -1
  74. package/modern/Stack/stackClasses.js +7 -0
  75. package/modern/Unstable_Grid2/Grid2.js +2 -3
  76. package/modern/index.js +1 -1
  77. package/modern/styles/CssVarsProvider.js +1 -5
  78. package/modern/styles/createTheme.js +1 -0
  79. package/modern/styles/experimental_extendTheme.js +62 -41
  80. package/modern/useAutocomplete/useAutocomplete.js +2 -2
  81. package/node/Autocomplete/Autocomplete.js +5 -2
  82. package/node/Autocomplete/autocompleteClasses.js +1 -1
  83. package/node/Badge/Badge.js +2 -2
  84. package/node/Container/Container.js +0 -2
  85. package/node/DialogTitle/DialogTitle.js +2 -2
  86. package/node/InputBase/InputBase.js +2 -2
  87. package/node/InputLabel/InputLabel.js +3 -1
  88. package/node/ListSubheader/ListSubheader.js +1 -0
  89. package/node/Menu/Menu.js +1 -1
  90. package/node/MenuList/MenuList.js +7 -0
  91. package/node/Modal/Modal.js +14 -9
  92. package/node/OutlinedInput/OutlinedInput.js +1 -1
  93. package/node/Rating/Rating.js +2 -2
  94. package/node/Select/SelectInput.js +2 -22
  95. package/node/Slider/Slider.js +19 -14
  96. package/node/Snackbar/Snackbar.js +20 -124
  97. package/node/Stack/Stack.js +9 -122
  98. package/node/Stack/index.js +8 -1
  99. package/node/Stack/stackClasses.js +16 -0
  100. package/node/Unstable_Grid2/Grid2.js +0 -1
  101. package/node/index.js +1 -1
  102. package/node/styles/CssVarsProvider.js +1 -9
  103. package/node/styles/createTheme.js +1 -0
  104. package/node/styles/experimental_extendTheme.js +66 -40
  105. package/node/useAutocomplete/useAutocomplete.js +8 -6
  106. package/package.json +6 -6
  107. package/styles/CssVarsProvider.d.ts +1 -2
  108. package/styles/CssVarsProvider.js +1 -8
  109. package/styles/createTheme.js +1 -0
  110. package/styles/experimental_extendTheme.d.ts +16 -0
  111. package/styles/experimental_extendTheme.js +65 -41
  112. package/umd/material-ui.development.js +3958 -3813
  113. package/umd/material-ui.production.min.js +21 -21
  114. package/useAutocomplete/useAutocomplete.d.ts +2 -2
  115. package/useAutocomplete/useAutocomplete.js +2 -2
@@ -32,6 +32,7 @@ export type AutocompleteOwnerState<
32
32
  ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent'],
33
33
  > = AutocompleteProps<T, Multiple, DisableClearable, FreeSolo, ChipComponent> & {
34
34
  disablePortal: boolean;
35
+ expanded: boolean;
35
36
  focused: boolean;
36
37
  fullWidth: boolean;
37
38
  hasClearIcon: boolean;
@@ -160,7 +161,9 @@ export interface AutocompleteProps<
160
161
  /**
161
162
  * Props applied to the Listbox element.
162
163
  */
163
- ListboxProps?: ReturnType<ReturnType<typeof useAutocomplete>['getListboxProps']>;
164
+ ListboxProps?: ReturnType<ReturnType<typeof useAutocomplete>['getListboxProps']> & {
165
+ sx?: SxProps<Theme>;
166
+ };
164
167
  /**
165
168
  * If `true`, the component is in a loading state.
166
169
  * This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, e.g. `options` are empty).
@@ -29,6 +29,7 @@ const useUtilityClasses = ownerState => {
29
29
  const {
30
30
  classes,
31
31
  disablePortal,
32
+ expanded,
32
33
  focused,
33
34
  fullWidth,
34
35
  hasClearIcon,
@@ -38,7 +39,7 @@ const useUtilityClasses = ownerState => {
38
39
  size
39
40
  } = ownerState;
40
41
  const slots = {
41
- root: ['root', focused && 'focused', fullWidth && 'fullWidth', hasClearIcon && 'hasClearIcon', hasPopupIcon && 'hasPopupIcon'],
42
+ root: ['root', expanded && 'expanded', focused && 'focused', fullWidth && 'fullWidth', hasClearIcon && 'hasClearIcon', hasPopupIcon && 'hasPopupIcon'],
42
43
  inputRoot: ['inputRoot'],
43
44
  input: ['input', inputFocused && 'inputFocused'],
44
45
  tag: ['tag', `tagSize${capitalize(size)}`],
@@ -438,6 +439,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
438
439
  getOptionProps,
439
440
  value,
440
441
  dirty,
442
+ expanded,
441
443
  id,
442
444
  popupOpen,
443
445
  focused,
@@ -455,6 +457,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
455
457
  // If you modify this, make sure to keep the `AutocompleteOwnerState` type in sync.
456
458
  const ownerState = _extends({}, props, {
457
459
  disablePortal,
460
+ expanded,
458
461
  focused,
459
462
  fullWidth,
460
463
  hasClearIcon,
@@ -901,7 +904,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
901
904
  *
902
905
  * @param {React.SyntheticEvent} event The event source of the callback.
903
906
  * @param {T} option The highlighted option.
904
- * @param {string} reason Can be: `"keyboard"`, `"auto"`, `"mouse"`.
907
+ * @param {string} reason Can be: `"keyboard"`, `"auto"`, `"mouse"`, `"touch"`.
905
908
  */
906
909
  onHighlightChange: PropTypes.func,
907
910
  /**
@@ -3,6 +3,8 @@ export interface AutocompleteClasses {
3
3
  root: string;
4
4
  /** Styles applied to the root element if `fullWidth={true}`. */
5
5
  fullWidth: string;
6
+ /** State class applied to the root element if the listbox is displayed. */
7
+ expanded: string;
6
8
  /** State class applied to the root element if focused. */
7
9
  focused: string;
8
10
  /** Styles applied to the tag elements, e.g. the chips. */
@@ -3,5 +3,5 @@ import generateUtilityClass from '../generateUtilityClass';
3
3
  export function getAutocompleteUtilityClass(slot) {
4
4
  return generateUtilityClass('MuiAutocomplete', slot);
5
5
  }
6
- const autocompleteClasses = generateUtilityClasses('MuiAutocomplete', ['root', 'fullWidth', 'focused', 'focusVisible', 'tag', 'tagSizeSmall', 'tagSizeMedium', 'hasPopupIcon', 'hasClearIcon', 'inputRoot', 'input', 'inputFocused', 'endAdornment', 'clearIndicator', 'popupIndicator', 'popupIndicatorOpen', 'popper', 'popperDisablePortal', 'paper', 'listbox', 'loading', 'noOptions', 'option', 'groupLabel', 'groupUl']);
6
+ const autocompleteClasses = generateUtilityClasses('MuiAutocomplete', ['root', 'expanded', 'fullWidth', 'focused', 'focusVisible', 'tag', 'tagSizeSmall', 'tagSizeMedium', 'hasPopupIcon', 'hasClearIcon', 'inputRoot', 'input', 'inputFocused', 'endAdornment', 'clearIndicator', 'popupIndicator', 'popupIndicatorOpen', 'popper', 'popperDisablePortal', 'paper', 'listbox', 'loading', 'noOptions', 'option', 'groupLabel', 'groupUl']);
7
7
  export default autocompleteClasses;
package/Badge/Badge.js CHANGED
@@ -6,7 +6,7 @@ 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 { useBadge } from '@mui/base/BadgeUnstyled';
9
+ import useBadge from '@mui/base/useBadge';
10
10
  import { useSlotProps } from '@mui/base';
11
11
  import styled from '../styles/styled';
12
12
  import useThemeProps from '../styles/useThemeProps';
package/CHANGELOG.md CHANGED
@@ -1,5 +1,238 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.11.12
4
+
5
+ <!-- generated comparing v5.11.11..master -->
6
+
7
+ _Mar 6, 2023_
8
+
9
+ A big thanks to the 17 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - @michaldudak added the multiselect functionality to SelectUnstyled (#36274)
12
+ - @mnajdova updated `extendTheme` so that it can generate CSS variables with default values. This means that the `CssVarsProvider` is no longer required for Joy UI when using the default theme (#35739)
13
+ - other 🐛 bug fixes and 📚 documentation improvements.
14
+
15
+ ### `@mui/material@5.11.12`
16
+
17
+ - &#8203;<!-- 30 -->[Autocomplete] Fix list scrolls to the top when new data is added on touch devices (#36231) @SaidMarar
18
+ - &#8203;<!-- 29 -->[Autocomplete] Add `Mui-expanded` class (#33312) @Osman-Sodefa
19
+ - &#8203;<!-- 24 -->[Dialog] Use the `id` prop provided to the `DialogTitle` component (#36353) @Kundan28
20
+ - &#8203;<!-- 07 -->[Menu] Fix Menu Paper styles overriding in the theme (#36316) @Paatus
21
+
22
+ ### `@mui/lab@5.0.0-alpha.122`
23
+
24
+ - &#8203;<!-- 05 -->[TreeView] Fix Tree View inside shadow root crashes (#36225) @NoFr1ends
25
+
26
+ ### `@mui/system@5.11.12`
27
+
28
+ #### Breaking changes
29
+
30
+ - &#8203;<!-- 26 -->[core] Generate vars in `extendTheme` (#35739) @mnajdova
31
+
32
+ The `shouldSkipGeneratingVar` prop was moved from the `createCssVarsProvider`'s option to the `theme`. If the default theme does not use `extendTheme` from Material UI or Joy UI, it needs to be wrapped inside `unstable_createCssVarsTheme` - a util exported from the MUI System. Below is an example of how the migration should look like:
33
+
34
+ ```diff
35
+ import {
36
+ unstable_createCssVarsProvider as createCssVarsProvider,
37
+ + unstable_createCssVarsTheme as createCssVarsTheme,
38
+ } from '@mui/system';
39
+
40
+ const { CssVarsProvider } = createCssVarsProvider({
41
+ - theme: {
42
+ + theme: createCssVarsTheme({
43
+ colorSchemes: {
44
+ light: {
45
+ typography: {
46
+ htmlFontSize: '16px',
47
+ h1: {
48
+ fontSize: '1rem',
49
+ fontWeight: 500,
50
+ },
51
+ },
52
+ },
53
+ },
54
+ + shouldSkipGeneratingVar: (keys) => keys[0] === 'typography' && keys[1] === 'h1',
55
+ - },
56
+ + }),
57
+ defaultColorScheme: 'light',
58
+ - shouldSkipGeneratingVar: (keys) => keys[0] === 'typography' && keys[1] === 'h1',
59
+ });
60
+ ```
61
+
62
+ Or you can define it directly in the theme prop:
63
+
64
+ ```diff
65
+ <CssVarsProvider
66
+ + theme={createCssVarsProvider({
67
+ + // other theme keys
68
+ + shouldSkipGeneratingVar: (keys) => keys[0] === 'typography' && keys[1] === 'h1'
69
+ + })} />
70
+ ```
71
+
72
+ This breaking change **only** affects experimental APIs
73
+
74
+ ### `@mui/base@5.0.0-alpha.120`
75
+
76
+ #### Breaking changes
77
+
78
+ - &#8203;<!-- 27 -->[Select][base] Add the multiselect functionality to SelectUnstyled (#36274) @michaldudak
79
+
80
+ The MultiSelectUnstyled was removed. The `SelectUnstyled` component with the `multiple` prop should be used instead. Additionally, the SelectUnstyledProps received a second generic parameter: `Multiple extends boolean`. If you deal with strictly single- or multi-select components, you can hard-code this parameter to `false` or `true`, respectively. Below is an example of how the migration should look like:
81
+
82
+ ```diff
83
+ -import MultiSelectUnstyled from '@mui/base/MultiSelectUnstyled';
84
+ +import SelectUnstyled from '@mui/base/SelectUnstyled';
85
+
86
+ export default App() {
87
+ -return <MultiSelectUnstyled />
88
+ +return <SelectUnstyled multiple />
89
+ }
90
+ ```
91
+
92
+ #### Changes
93
+
94
+ - &#8203;<!-- 34 -->[useSnackBar] Add explicit return type (#36052) @sai6855
95
+ - &#8203;<!-- 04 -->[useMenu] Fix `import type` syntax (#36411) @ZeeshanTamboli
96
+ - &#8203;<!-- 03 -->[useSwitch] Add explicit return type (#36050) @sai6855
97
+
98
+ ### `@mui/joy@5.0.0-alpha.70`
99
+
100
+ #### Breaking changes
101
+
102
+ - &#8203;<!-- 09 -->[Joy] Change CSS variables naming for components (#36282) @hbjORbj
103
+
104
+ Joy UI has new naming standards of the CSS variables for its components. Below is an example of how the migration should look like:
105
+
106
+ ```diff
107
+ -<List sx={{ py: 'var(--List-divider-gap)' }}>
108
+ +<List sx={{ py: 'var(--ListDivider-gap)' }}>
109
+ -<Switch sx={{ '--Switch-track-width': '40px' }}>
110
+ +<Switch sx={{ '--Switch-trackWidth': '40px' }}>
111
+ ```
112
+
113
+ #### Changes
114
+
115
+ - &#8203;<!-- 28 -->[Autocomplete][joy] Add disabled class to the popup indicator (#36397) @hbjORbj
116
+ - &#8203;<!-- 08 -->[Joy] Fix broken loading button in Safari (#36298) @Kuba429
117
+
118
+ ### Docs
119
+
120
+ - &#8203;<!-- 33 -->[docs][joy] Clarify when `CssVarsProvider` is required (#36410) @mnajdova
121
+ - &#8203;<!-- 32 -->MUI X v6 release announcement (#36398) @joserodolfofreitas
122
+ - &#8203;<!-- 23 -->[docs] Add instructions for deploying docs without a release (#36301) @cherniavskii
123
+ - &#8203;<!-- 22 -->[docs] Fix 301 redirections on the docs @oliviertassinari
124
+ - &#8203;<!-- 21 -->[docs] Update MUI X banner to reflect stable release (#36354) @MBilalShafi
125
+ - &#8203;<!-- 20 -->[docs] Clarify the future plan for integrating MUI Base in Material UI (#36365) @mnajdova
126
+ - &#8203;<!-- 19 -->[docs] Improve visual look of loose lists (#36190) @oliviertassinari
127
+ - &#8203;<!-- 18 -->[docs] Fix @mui/styles example links (#36331) @oliviertassinari
128
+ - &#8203;<!-- 17 -->[docs][joy] Build TS versions for List component demos (#36382) @sai6855
129
+ - &#8203;<!-- 16 -->[docs][joy] Build TS versions for Radio component demos (#36406) @sai6855
130
+ - &#8203;<!-- 15 -->[docs][joy] Build TS versions for Checkbox component demos (#36381) @sai6855
131
+ - &#8203;<!-- 14 -->[docs][joy] Build TS versions for Select component demos (#36380) @sai6855
132
+ - &#8203;<!-- 13 -->[docs][joy] Build TS versions for Typography component demos (#36378) @varunmulay22
133
+ - &#8203;<!-- 12 -->[docs][joy] Add typescript demos for `Divider` (#36374) @sai6855
134
+ - &#8203;<!-- 11 -->[docs][joy] Build TS versions for Textarea component demos (#36371) @varunmulay22
135
+ - &#8203;<!-- 10 -->[docs][joy] Build TS versions for Link component demos (#36366) @hbjORbj
136
+
137
+ ### Core
138
+
139
+ - &#8203;<!-- 31 -->Revert "Bump rimraf to ^4.1.3" (#36420) @mnajdova
140
+ - &#8203;<!-- 25 -->[core] Fix test utils types and external `buildApiUtils` usage issues (#36310) @LukasTy
141
+ - &#8203;<!-- 06 -->[test] Remove duplicate `combobox` role queries in Autocomplete tests (#36394) @ZeeshanTamboli
142
+ - &#8203;<!-- 02 -->[website] Clarify redistribution @oliviertassinari
143
+ - &#8203;<!-- 01 -->[website] Sync /about page (#36334) @oliviertassinari
144
+
145
+ All contributors of this release in alphabetical order: @cherniavskii, @hbjORbj, @joserodolfofreitas, @Kuba429, @Kundan28, @LukasTy, @MBilalShafi, @michaldudak, @mnajdova, @NoFr1ends, @oliviertassinari, @Osman-Sodefa, @Paatus, @sai6855, @SaidMarar, @varunmulay22, @ZeeshanTamboli
146
+
147
+ ## 5.11.11
148
+
149
+ <!-- generated comparing v5.11.10..master -->
150
+
151
+ _Feb 27, 2023_
152
+
153
+ A big thanks to the 15 contributors who made this release possible. Here are some highlights ✨:
154
+
155
+ - 📚 added API documentation for the slots in MUI Base and Joy UI by @hbjORbj, for e.g. [SliderUnstyled API](https://mui.com/base/api/slider-unstyled/#slots)
156
+ - other 🐛 bug fixes and 📚 documentation improvements.
157
+
158
+ ### `@mui/material@5.11.11`
159
+
160
+ - &#8203;<!-- 30 -->[Autocomplete] Adds `sx` prop to `ListboxProps` type (#36243) @sai6855
161
+ - &#8203;<!-- 11 -->[material] Add global CSS class for `readOnly` prop (#32822) @jrparish
162
+ - &#8203;<!-- 10 -->[Stack][material] Use createStack from the system (#33795) @mnajdova
163
+ - &#8203;<!-- 07 -->[Select] Fix incorrect selecting of first element (#36024) @michaldudak
164
+ - &#8203;<!-- 06 -->[Slider] Miscellaneous improvements (#35941) @ZeeshanTamboli
165
+ - &#8203;<!-- 05 -->[Slider] Remove unnecessary `data-focusvisible` attribute (#36091) @ZeeshanTamboli
166
+ - &#8203;<!-- 04 -->[Snackbar] Replace component logic with `useSnackbar` hook (#36272) @ZeeshanTamboli
167
+ - &#8203;<!-- 03 -->[TextField] Fix floating label position (#36246) @oliviertassinari
168
+ - &#8203;<!-- 13 -->[TextField] Fix floating label position (#36288) @oliviertassinari
169
+
170
+ ### `@mui/base@5.0.0-alpha.119`
171
+
172
+ #### Breaking changes
173
+
174
+ - &#8203;<!-- 29 -->[base] Remove `classes` prop from the Base components that have it (#36157) @hbjORbj
175
+ These are the components affected by this change: ModalUnstyled, SliderUnstyled, TablePaginationUnstyled and TablePaginationActionsUnstyled.
176
+ You can replace the `classes` prop by providing the class name prop directly to the prop via `slotProps`. Below is an example of how the migration should look like:
177
+
178
+ ```diff
179
+ <TablePaginationUnstyled
180
+ - classes={{ toolbar: 'toolbar-classname', menuItem: 'menuItem-classname' }}
181
+ + slotProps={{ toolbar: { className: 'toolbar-classname' }, menuItem: { className: 'menuItem-classname'}}}
182
+ />
183
+ ```
184
+
185
+ - &#8203;<!-- 28 -->[base] Move hooks to their own directories (#36235) @hbjORbj
186
+ Base hooks (e.g., `useSelect`) are no longer exported from `{Component}Unstyled` directories and instead they have their own directories.
187
+ Below is an example of how the migration should look like:
188
+
189
+ ```diff
190
+ -import { useBadge } from '@mui/base/BadgeUnstyled';
191
+ +import useBadge from '@mui/base/useBadge';
192
+ ```
193
+
194
+ You can use this [codemod](https://github.com/mui/material-ui/blob/master/packages/mui-codemod/README.md#base-hook-imports) to help with the migration.
195
+
196
+ #### Changes
197
+
198
+ - &#8203;<!-- 31 -->[Autocomplete] Add docs interface for the hook (#36242) @HeVictor
199
+ - &#8203;<!-- 09 -->[MenuUnstyled] Remove extra useMemo (#36265) @ivp-dev
200
+ - &#8203;<!-- 31 -->[base] Export all slot prop overrides interfaces (#36323) @michaldudak
201
+
202
+ ### `@mui/codemod@5.11.11`
203
+
204
+ - &#8203;<!-- 35 -->[base] Codemod for hook directory migration (#36295) @hbjORbj
205
+
206
+ ### `@mui/joy@5.0.0-alpha.69`
207
+
208
+ - &#8203;<!-- 15 -->[Joy] Able to remove default tokens from theme types (#36006) @siriwatknp
209
+ - &#8203;<!-- 14 -->[Joy] Fix modal dialog overflow viewport (#36103) @siriwatknp
210
+ - &#8203;<!-- 13 -->[Joy] Select popup should have max-height (#36156) @Vivek-Prajapatii
211
+ - &#8203;<!-- 12 -->[Joy] Fix `ListDivider` to change semantic based on `List` (#36266) @siriwatknp
212
+
213
+ ### Docs
214
+
215
+ - &#8203;<!-- 27 -->[docs][base] List slots in API documentation (#36104) @hbjORbj
216
+ - &#8203;<!-- 26 -->[docs] Add missing sandbox adapter deps resolving (#36291) @LukasTy
217
+ - &#8203;<!-- 25 -->[docs] Allow to pass navigation bar banner from outside (#36299) @MBilalShafi
218
+ - &#8203;<!-- 24 -->[docs] Fix code on the Working with Tailwind CSS guide (#36090) @mnajdova
219
+ - &#8203;<!-- 23 -->[docs] Remove See Slots Section text from Material UI slots description (#36284) @hbjORbj
220
+ - &#8203;<!-- 22 -->[docs] Fix emotion warning `:first-child` (#36263) @siriwatknp
221
+ - &#8203;<!-- 21 -->[docs][joy] Improve the descriptions of props in API docs (#36307) @hbjORbj
222
+ - &#8203;<!-- 20 -->[docs][joy] List slots in API documentation (#36271) @hbjORbj
223
+ - &#8203;<!-- 19 -->[docs][joy] Build API documentations (#36008) @hbjORbj
224
+ - &#8203;<!-- 18 -->[examples] Update Next.js examples to use built-in font (#36315) @Juneezee
225
+ - &#8203;<!-- 17 -->[examples] Update curl link in `material-next-ts-v4-v5-migration` example README (#36321) @ZeeshanTamboli
226
+ - &#8203;<!-- 16 -->[examples] Convert Next.js \_document class components to function components (#36109) @ossan-engineer
227
+
228
+ ### Core
229
+
230
+ - &#8203;<!-- 08 -->[Rating] Add a comment in Rating component to use `readOnly` state class (#36357) @ZeeshanTamboli
231
+ - &#8203;<!-- 02 -->[website] Fix broken links to role levels (#36333) @oliviertassinari
232
+ - &#8203;<!-- 01 -->[website] Sync gold sponsors (#36312) @oliviertassinari
233
+
234
+ All contributors of this release in alphabetical order: @hbjORbj, @HeVictor, @ivp-dev, @jrparish, @Juneezee, @LukasTy, @MBilalShafi, @michaldudak, @mnajdova, @oliviertassinari, @ossan-engineer, @sai6855, @siriwatknp, @Vivek-Prajapatii, @ZeeshanTamboli
235
+
3
236
  ## 5.11.10
4
237
 
5
238
  <!-- generated comparing v5.11.9..master -->
@@ -1,4 +1,3 @@
1
- /* eslint-disable material-ui/mui-name-matches-component-name */
2
1
  import PropTypes from 'prop-types';
3
2
  import { createContainer } from '@mui/system';
4
3
  import capitalize from '../utils/capitalize';
@@ -41,7 +41,7 @@ const DialogTitle = /*#__PURE__*/React.forwardRef(function DialogTitle(inProps,
41
41
  const ownerState = props;
42
42
  const classes = useUtilityClasses(ownerState);
43
43
  const {
44
- titleId: id = idProp
44
+ titleId = idProp
45
45
  } = React.useContext(DialogContext);
46
46
  return /*#__PURE__*/_jsx(DialogTitleRoot, _extends({
47
47
  component: "h2",
@@ -49,7 +49,7 @@ const DialogTitle = /*#__PURE__*/React.forwardRef(function DialogTitle(inProps,
49
49
  ownerState: ownerState,
50
50
  ref: ref,
51
51
  variant: "h6",
52
- id: id
52
+ id: idProp != null ? idProp : titleId
53
53
  }, other));
54
54
  });
55
55
  process.env.NODE_ENV !== "production" ? DialogTitle.propTypes /* remove-proptypes */ = {
@@ -436,7 +436,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
436
436
  ref: ref,
437
437
  onClick: handleClick
438
438
  }, other, {
439
- className: clsx(classes.root, rootProps.className, className),
439
+ className: clsx(classes.root, rootProps.className, className, readOnly && 'MuiInputBase-readOnly'),
440
440
  children: [startAdornment, /*#__PURE__*/_jsx(FormControlContext.Provider, {
441
441
  value: null,
442
442
  children: /*#__PURE__*/_jsx(Input, _extends({
@@ -463,7 +463,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
463
463
  ownerState: _extends({}, ownerState, inputProps.ownerState)
464
464
  }, {
465
465
  ref: handleInputRef,
466
- className: clsx(classes.input, inputProps.className),
466
+ className: clsx(classes.input, inputProps.className, readOnly && 'MuiInputBase-readOnly'),
467
467
  onBlur: handleBlur,
468
468
  onChange: handleChange,
469
469
  onFocus: handleFocus
@@ -98,7 +98,9 @@ const InputLabelRoot = styled(FormLabel, {
98
98
  }, ownerState.shrink && {
99
99
  userSelect: 'none',
100
100
  pointerEvents: 'auto',
101
- maxWidth: 'calc(133% - 24px)',
101
+ // Theoretically, we should have (8+5)*2/0.75 = 34px
102
+ // but it feels a better when it bleeds a bit on the left, so 32px.
103
+ maxWidth: 'calc(133% - 32px)',
102
104
  transform: 'translate(14px, -9px) scale(0.75)'
103
105
  })));
104
106
  const InputLabel = /*#__PURE__*/React.forwardRef(function InputLabel(inProps, ref) {
@@ -87,6 +87,7 @@ const ListSubheader = /*#__PURE__*/React.forwardRef(function ListSubheader(inPro
87
87
  ownerState: ownerState
88
88
  }, other));
89
89
  });
90
+ ListSubheader.muiSkipListHighlight = true;
90
91
  process.env.NODE_ENV !== "production" ? ListSubheader.propTypes /* remove-proptypes */ = {
91
92
  // ----------------------------- Warning --------------------------------
92
93
  // | These PropTypes are generated from the TypeScript type definitions |
package/Menu/Menu.js CHANGED
@@ -149,7 +149,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
149
149
  },
150
150
  transformOrigin: isRtl ? RTL_ORIGIN : LTR_ORIGIN,
151
151
  PaperProps: _extends({
152
- component: MenuPaper
152
+ as: MenuPaper
153
153
  }, PaperProps, {
154
154
  classes: _extends({}, PaperProps.classes, {
155
155
  root: classes.paper
@@ -194,6 +194,13 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
194
194
  activeItemIndex = index;
195
195
  }
196
196
  }
197
+ if (activeItemIndex === index && (child.props.disabled || child.props.muiSkipListHighlight || child.type.muiSkipListHighlight)) {
198
+ activeItemIndex += 1;
199
+ if (activeItemIndex >= children.length) {
200
+ // there are no focusable items within the list.
201
+ activeItemIndex = -1;
202
+ }
203
+ }
197
204
  });
198
205
  const items = React.Children.map(children, (child, index) => {
199
206
  if (index === activeItemIndex) {
package/Modal/Modal.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SxProps } from '@mui/system';
3
3
  import { OverrideProps } from '@mui/types';
4
4
  import { SlotComponentProps } from '@mui/base';
5
- import { ModalUnstyledTypeMap } from '@mui/base/ModalUnstyled';
5
+ import { ModalUnstyledTypeMap, ModalUnstyledClasses } from '@mui/base/ModalUnstyled';
6
6
  import { Theme } from '../styles';
7
7
  import Backdrop, { BackdropProps } from '../Backdrop';
8
8
  import { OverridableComponent } from '../OverridableComponent';
@@ -35,6 +35,14 @@ export interface ModalTypeMap<D extends React.ElementType = 'div', P = {}> {
35
35
  * @deprecated Use `slotProps.backdrop` instead.
36
36
  */
37
37
  BackdropProps?: Partial<BackdropProps>;
38
+ /**
39
+ * Override or extend the styles applied to the component.
40
+ */
41
+ classes?: Partial<ModalUnstyledClasses>;
42
+ /**
43
+ * @ignore
44
+ */
45
+ className?: string;
38
46
  /**
39
47
  * The components used for each slot inside.
40
48
  *
package/Modal/Modal.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["BackdropComponent", "BackdropProps", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "slotProps", "slots", "theme"];
3
+ const _excluded = ["BackdropComponent", "BackdropProps", "classes", "className", "closeAfterTransition", "children", "component", "components", "componentsProps", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "slotProps", "slots", "theme"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
+ import clsx from 'clsx';
6
7
  import ModalUnstyled, { modalUnstyledClasses } from '@mui/base/ModalUnstyled';
7
8
  import { isHostComponent, resolveComponentProps } from '@mui/base/utils';
8
9
  import { elementAcceptingRef, HTMLElementType } from '@mui/utils';
@@ -11,9 +12,6 @@ import useThemeProps from '../styles/useThemeProps';
11
12
  import Backdrop from '../Backdrop';
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  export const modalClasses = modalUnstyledClasses;
14
- const extendUtilityClasses = ownerState => {
15
- return ownerState.classes;
16
- };
17
15
  const ModalRoot = styled('div', {
18
16
  name: 'MuiModal',
19
17
  slot: 'Root',
@@ -68,6 +66,8 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
68
66
  const {
69
67
  BackdropComponent = ModalBackdrop,
70
68
  BackdropProps,
69
+ classes,
70
+ className,
71
71
  closeAfterTransition = false,
72
72
  children,
73
73
  component,
@@ -102,7 +102,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
102
102
  const ownerState = _extends({}, props, commonProps, {
103
103
  exited
104
104
  });
105
- const classes = extendUtilityClasses(ownerState);
106
105
  const RootSlot = (_ref = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components.Root) != null ? _ref : ModalRoot;
107
106
  const BackdropSlot = (_ref2 = (_slots$backdrop = slots == null ? void 0 : slots.backdrop) != null ? _slots$backdrop : components.Backdrop) != null ? _ref2 : BackdropComponent;
108
107
  const rootSlotProps = (_slotProps$root = slotProps == null ? void 0 : slotProps.root) != null ? _slotProps$root : componentsProps.root;
@@ -116,15 +115,17 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
116
115
  root: () => _extends({}, resolveComponentProps(rootSlotProps, ownerState), !isHostComponent(RootSlot) && {
117
116
  as: component,
118
117
  theme
118
+ }, {
119
+ className: clsx(className, rootSlotProps == null ? void 0 : rootSlotProps.className, classes == null ? void 0 : classes.root, !ownerState.open && ownerState.exited && (classes == null ? void 0 : classes.hidden))
119
120
  }),
120
- backdrop: () => _extends({}, BackdropProps, resolveComponentProps(backdropSlotProps, ownerState))
121
+ backdrop: () => _extends({}, BackdropProps, resolveComponentProps(backdropSlotProps, ownerState), {
122
+ className: clsx(backdropSlotProps == null ? void 0 : backdropSlotProps.className, classes == null ? void 0 : classes.backdrop)
123
+ })
121
124
  },
122
125
  onTransitionEnter: () => setExited(false),
123
126
  onTransitionExited: () => setExited(true),
124
127
  ref: ref
125
- }, other, {
126
- classes: classes
127
- }, commonProps, {
128
+ }, other, commonProps, {
128
129
  children: children
129
130
  }));
130
131
  });
@@ -161,6 +162,10 @@ process.env.NODE_ENV !== "production" ? Modal.propTypes /* remove-proptypes */ =
161
162
  * Override or extend the styles applied to the component.
162
163
  */
163
164
  classes: PropTypes.object,
165
+ /**
166
+ * @ignore
167
+ */
168
+ className: PropTypes.string,
164
169
  /**
165
170
  * When set to true the Modal waits until a nested Transition is completed before closing.
166
171
  * @default false
@@ -163,7 +163,7 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
163
163
  ownerState: ownerState,
164
164
  className: classes.notchedOutline,
165
165
  label: label != null && label !== '' && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
166
- children: [label, "\xA0", '*']
166
+ children: [label, "\u2009", '*']
167
167
  })) : label,
168
168
  notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
169
169
  }),
package/README.md CHANGED
@@ -132,9 +132,7 @@ via [OpenCollective](https://opencollective.com/mui) or via [Patreon](https://ww
132
132
 
133
133
  <p>
134
134
  <a href="https://tidelift.com/subscription/pkg/npm-material-ui?utm_source=npm-material-ui&utm_medium=referral&utm_campaign=homepage" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://avatars.githubusercontent.com/u/30204434?s=192" alt="tidelift.com" title="Enterprise-ready open-source software" loading="lazy" /></a>
135
- <a href="https://bit.dev/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank" style="margin-rig ht: 16px;"><img height="96" width="96" src="https://avatars.githubusercontent.com/u/24789812?s=192" alt="bit.dev" title="The fastest way to share code" loading="lazy" /></a>
136
135
  <a href="https://www.text-em-all.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img src="https://avatars.githubusercontent.com/u/1262264?s=192" alt="text-em-all.com" title="Mass Text Messaging & Automated Calling" height="96" width="96" loading="lazy"></a>
137
- <a href="https://netticasinohex.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/netticasinohex-com/71d7417/logo/192.png" alt="netticasinohex.com" title="A real giant among casino guides" loading="lazy" /></a>
138
136
  <a href="https://megafamous.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://mui.com/static/sponsors/megafamous.png" alt="megafamous.com" title="The best place to buy Instagram followers & likes." loading="lazy" /></a>
139
137
  <a href="https://www.dialmycalls.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/dialmycalls/f5ae9ab/avatar/192.png" alt="dialmycalls.com" title="Send text messages, calls & emails to thousands with ease." loading="lazy" /></a>
140
138
  <a href="https://goread.io/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/goread_io/eb6337d/logo/192.png" alt="goread.io" title="Instagram followers, likes, power likes, views, comments, saves in minutes." loading="lazy" /></a>
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
@@ -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,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
  */