@mui/material 5.3.1 → 5.4.0

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 (214) 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 +5 -0
  9. package/Autocomplete/Autocomplete.js +11 -3
  10. package/Autocomplete/autocompleteClasses.d.ts +54 -54
  11. package/Avatar/avatarClasses.d.ts +20 -20
  12. package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
  13. package/BottomNavigation/BottomNavigation.js +0 -0
  14. package/BottomNavigation/bottomNavigationClasses.d.ts +8 -8
  15. package/BottomNavigationAction/bottomNavigationActionClasses.d.ts +14 -14
  16. package/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
  17. package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
  18. package/Button/buttonClasses.d.ts +76 -76
  19. package/ButtonBase/TouchRipple.js +1 -2
  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 +84 -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 +80 -80
  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/containerClasses.d.ts +22 -22
  37. package/Dialog/DialogContext.d.ts +6 -6
  38. package/Dialog/dialogClasses.d.ts +36 -36
  39. package/DialogActions/dialogActionsClasses.d.ts +10 -10
  40. package/DialogContent/dialogContentClasses.d.ts +10 -10
  41. package/DialogContentText/dialogContentTextClasses.d.ts +8 -8
  42. package/DialogTitle/dialogTitleClasses.d.ts +8 -8
  43. package/Divider/dividerClasses.d.ts +34 -34
  44. package/Drawer/drawerClasses.d.ts +30 -30
  45. package/Fab/fabClasses.d.ts +26 -26
  46. package/FilledInput/filledInputClasses.d.ts +40 -40
  47. package/FormControl/formControlClasses.d.ts +14 -14
  48. package/FormControlLabel/FormControlLabel.js +11 -3
  49. package/FormControlLabel/formControlLabelClasses.d.ts +20 -18
  50. package/FormControlLabel/formControlLabelClasses.js +1 -1
  51. package/FormGroup/FormGroup.js +14 -3
  52. package/FormGroup/formGroupClasses.d.ts +12 -10
  53. package/FormGroup/formGroupClasses.js +1 -1
  54. package/FormHelperText/FormHelperText.js +7 -9
  55. package/FormHelperText/formHelperTextClasses.d.ts +22 -22
  56. package/FormLabel/formLabelClasses.d.ts +22 -22
  57. package/Grid/Grid.js +2 -4
  58. package/Grid/gridClasses.d.ts +48 -48
  59. package/Icon/iconClasses.d.ts +24 -24
  60. package/IconButton/iconButtonClasses.d.ts +26 -26
  61. package/ImageList/imageListClasses.d.ts +16 -16
  62. package/ImageListItem/imageListItemClasses.d.ts +18 -18
  63. package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
  64. package/Input/inputClasses.d.ts +34 -34
  65. package/InputAdornment/InputAdornment.js +6 -9
  66. package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
  67. package/InputBase/inputBaseClasses.d.ts +44 -44
  68. package/InputLabel/inputLabelClasses.d.ts +32 -32
  69. package/LinearProgress/linearProgressClasses.d.ts +42 -42
  70. package/Link/linkClasses.d.ts +18 -18
  71. package/List/listClasses.d.ts +14 -14
  72. package/ListItem/listItemClasses.d.ts +30 -30
  73. package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
  74. package/ListItemButton/listItemButtonClasses.d.ts +22 -22
  75. package/ListItemIcon/listItemIconClasses.d.ts +10 -10
  76. package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
  77. package/ListItemText/listItemTextClasses.d.ts +18 -18
  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/MobileStepper/mobileStepperClasses.d.ts +22 -22
  82. package/NativeSelect/nativeSelectClasses.d.ts +32 -32
  83. package/OutlinedInput/NotchedOutline.js +14 -16
  84. package/OutlinedInput/OutlinedInput.js +1 -1
  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 +17 -17
  91. package/Radio/RadioButtonIcon.js +2 -6
  92. package/Radio/radioClasses.d.ts +16 -16
  93. package/RadioGroup/RadioGroupContext.d.ts +11 -11
  94. package/RadioGroup/useRadioGroup.d.ts +4 -4
  95. package/Rating/ratingClasses.d.ts +40 -40
  96. package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
  97. package/Select/SelectInput.js +7 -9
  98. package/Select/selectClasses.d.ts +30 -30
  99. package/Skeleton/skeletonClasses.d.ts +24 -24
  100. package/Snackbar/snackbarClasses.d.ts +20 -20
  101. package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
  102. package/SpeedDial/speedDialClasses.d.ts +22 -22
  103. package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
  104. package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
  105. package/Step/stepClasses.d.ts +16 -16
  106. package/StepButton/stepButtonClasses.d.ts +14 -14
  107. package/StepConnector/stepConnectorClasses.d.ts +26 -26
  108. package/StepContent/stepContentClasses.d.ts +12 -12
  109. package/StepIcon/stepIconClasses.d.ts +16 -16
  110. package/StepLabel/stepLabelClasses.d.ts +28 -28
  111. package/Stepper/stepperClasses.d.ts +14 -14
  112. package/SvgIcon/svgIconClasses.d.ts +24 -24
  113. package/SwipeableDrawer/SwipeArea.js +1 -3
  114. package/Switch/switchClasses.d.ts +32 -32
  115. package/Tab/tabClasses.d.ts +26 -26
  116. package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
  117. package/Table/tableClasses.d.ts +10 -10
  118. package/TableBody/tableBodyClasses.d.ts +8 -8
  119. package/TableCell/tableCellClasses.d.ts +32 -32
  120. package/TableContainer/tableContainerClasses.d.ts +8 -8
  121. package/TableFooter/tableFooterClasses.d.ts +8 -8
  122. package/TableHead/tableHeadClasses.d.ts +8 -8
  123. package/TablePagination/tablePaginationClasses.d.ts +28 -28
  124. package/TableRow/tableRowClasses.d.ts +16 -16
  125. package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
  126. package/Tabs/tabsClasses.d.ts +32 -32
  127. package/TextField/TextField.js +1 -1
  128. package/TextField/textFieldClasses.d.ts +8 -8
  129. package/ToggleButton/toggleButtonClasses.d.ts +24 -24
  130. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
  131. package/Toolbar/toolbarClasses.d.ts +14 -14
  132. package/Tooltip/tooltipClasses.d.ts +30 -30
  133. package/Typography/typographyClasses.d.ts +50 -50
  134. package/darkScrollbar/index.d.ts +28 -28
  135. package/index.d.ts +7 -2
  136. package/index.js +6 -3
  137. package/internal/SwitchBase.js +2 -6
  138. package/internal/switchBaseClasses.d.ts +12 -12
  139. package/legacy/Autocomplete/Autocomplete.js +12 -3
  140. package/legacy/BottomNavigation/BottomNavigation.js +0 -0
  141. package/legacy/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
  142. package/legacy/ButtonBase/TouchRipple.js +1 -2
  143. package/legacy/FormControlLabel/FormControlLabel.js +11 -3
  144. package/legacy/FormControlLabel/formControlLabelClasses.js +1 -1
  145. package/legacy/FormGroup/FormGroup.js +14 -3
  146. package/legacy/FormGroup/formGroupClasses.js +1 -1
  147. package/legacy/FormHelperText/FormHelperText.js +7 -9
  148. package/legacy/Grid/Grid.js +2 -4
  149. package/legacy/InputAdornment/InputAdornment.js +6 -9
  150. package/legacy/OutlinedInput/NotchedOutline.js +14 -16
  151. package/legacy/OutlinedInput/OutlinedInput.js +1 -1
  152. package/legacy/Radio/RadioButtonIcon.js +2 -6
  153. package/legacy/Select/SelectInput.js +7 -9
  154. package/legacy/SwipeableDrawer/SwipeArea.js +1 -3
  155. package/legacy/TextField/TextField.js +1 -1
  156. package/legacy/index.js +6 -3
  157. package/legacy/internal/SwitchBase.js +2 -6
  158. package/legacy/useMediaQuery/useMediaQuery.js +86 -31
  159. package/locale/index.d.ts +68 -68
  160. package/modern/Autocomplete/Autocomplete.js +11 -3
  161. package/modern/BottomNavigation/BottomNavigation.js +0 -0
  162. package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
  163. package/modern/ButtonBase/TouchRipple.js +1 -2
  164. package/modern/FormControlLabel/FormControlLabel.js +11 -3
  165. package/modern/FormControlLabel/formControlLabelClasses.js +1 -1
  166. package/modern/FormGroup/FormGroup.js +14 -3
  167. package/modern/FormGroup/formGroupClasses.js +1 -1
  168. package/modern/FormHelperText/FormHelperText.js +7 -9
  169. package/modern/Grid/Grid.js +2 -4
  170. package/modern/InputAdornment/InputAdornment.js +6 -9
  171. package/modern/OutlinedInput/NotchedOutline.js +14 -16
  172. package/modern/OutlinedInput/OutlinedInput.js +1 -1
  173. package/modern/Radio/RadioButtonIcon.js +2 -6
  174. package/modern/Select/SelectInput.js +7 -9
  175. package/modern/SwipeableDrawer/SwipeArea.js +1 -3
  176. package/modern/TextField/TextField.js +1 -1
  177. package/modern/index.js +6 -3
  178. package/modern/internal/SwitchBase.js +2 -6
  179. package/modern/useMediaQuery/useMediaQuery.js +68 -26
  180. package/node/Autocomplete/Autocomplete.js +11 -3
  181. package/node/BottomNavigation/BottomNavigation.js +0 -0
  182. package/node/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
  183. package/node/ButtonBase/TouchRipple.js +1 -2
  184. package/node/FormControlLabel/FormControlLabel.js +12 -3
  185. package/node/FormControlLabel/formControlLabelClasses.js +1 -1
  186. package/node/FormGroup/FormGroup.js +15 -3
  187. package/node/FormGroup/formGroupClasses.js +1 -1
  188. package/node/FormHelperText/FormHelperText.js +6 -9
  189. package/node/Grid/Grid.js +2 -4
  190. package/node/InputAdornment/InputAdornment.js +5 -9
  191. package/node/OutlinedInput/NotchedOutline.js +12 -16
  192. package/node/OutlinedInput/OutlinedInput.js +1 -1
  193. package/node/Radio/RadioButtonIcon.js +2 -6
  194. package/node/Select/SelectInput.js +6 -9
  195. package/node/SwipeableDrawer/SwipeArea.js +1 -3
  196. package/node/TextField/TextField.js +1 -1
  197. package/node/index.js +41 -16
  198. package/node/internal/SwitchBase.js +2 -6
  199. package/node/useMediaQuery/useMediaQuery.js +68 -26
  200. package/package.json +3 -3
  201. package/styles/ThemeProvider.d.ts +1 -1
  202. package/transitions/index.d.ts +1 -1
  203. package/transitions/transition.d.ts +13 -13
  204. package/transitions/utils.d.ts +23 -23
  205. package/umd/material-ui.development.js +5869 -8117
  206. package/umd/material-ui.production.min.js +21 -21
  207. package/useMediaQuery/useMediaQuery.d.ts +31 -27
  208. package/useMediaQuery/useMediaQuery.js +68 -26
  209. package/useTouchRipple/index.d.ts +1 -1
  210. package/useTouchRipple/useTouchRipple.d.ts +28 -28
  211. package/utils/getScrollbarSize.d.ts +2 -2
  212. package/utils/ownerDocument.d.ts +2 -2
  213. package/utils/ownerWindow.d.ts +2 -2
  214. package/utils/setRef.d.ts +2 -2
@@ -197,7 +197,7 @@ var TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {
197
197
  variant: variant,
198
198
  ownerState: ownerState
199
199
  }, other, {
200
- children: [label && /*#__PURE__*/_jsx(InputLabel, _extends({
200
+ children: [label != null && label !== '' && /*#__PURE__*/_jsx(InputLabel, _extends({
201
201
  htmlFor: id,
202
202
  id: inputLabelId
203
203
  }, InputLabelProps, {
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.3.1
1
+ /** @license MUI v5.4.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -8,7 +8,6 @@ import * as colors from './colors';
8
8
  export { colors };
9
9
  export * from './styles';
10
10
  export * from './utils';
11
- export * from '@mui/base';
12
11
  export { default as Accordion } from './Accordion';
13
12
  export * from './Accordion';
14
13
  export { default as AccordionActions } from './AccordionActions';
@@ -273,4 +272,8 @@ export * from './Zoom'; // createFilterOptions is exported from Autocomplete
273
272
  export { default as useAutocomplete } from './useAutocomplete';
274
273
  export { default as GlobalStyles } from './GlobalStyles';
275
274
  export * from './GlobalStyles';
276
- export { StyledEngineProvider } from './styles';
275
+ export { StyledEngineProvider } from './styles';
276
+ export { default as unstable_composeClasses } from '@mui/base/composeClasses';
277
+ export { default as generateUtilityClass } from '@mui/base/generateUtilityClass';
278
+ export * from '@mui/base/generateUtilityClass';
279
+ export { default as generateUtilityClasses } from '@mui/base/generateUtilityClasses';
@@ -27,9 +27,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
27
27
  return composeClasses(slots, getSwitchBaseUtilityClass, classes);
28
28
  };
29
29
 
30
- var SwitchBaseRoot = styled(ButtonBase, {
31
- skipSx: true
32
- })(function (_ref) {
30
+ var SwitchBaseRoot = styled(ButtonBase)(function (_ref) {
33
31
  var ownerState = _ref.ownerState;
34
32
  return _extends({
35
33
  padding: 9,
@@ -40,9 +38,7 @@ var SwitchBaseRoot = styled(ButtonBase, {
40
38
  marginRight: ownerState.size === 'small' ? -3 : -12
41
39
  });
42
40
  });
43
- var SwitchBaseInput = styled('input', {
44
- skipSx: true
45
- })({
41
+ var SwitchBaseInput = styled('input')({
46
42
  cursor: 'inherit',
47
43
  position: 'absolute',
48
44
  opacity: 0,
@@ -1,3 +1,4 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
1
2
  import * as React from 'react';
2
3
  import { getThemeProps, useThemeWithoutDefault as useTheme } from '@mui/system';
3
4
  import useEnhancedEffect from '../utils/useEnhancedEffect';
@@ -5,38 +6,9 @@ import useEnhancedEffect from '../utils/useEnhancedEffect';
5
6
  * @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.
6
7
  */
7
8
 
8
- export default function useMediaQuery(queryInput) {
9
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
10
- var theme = useTheme(); // Wait for jsdom to support the match media feature.
11
- // All the browsers MUI support have this built-in.
12
- // This defensive check is here for simplicity.
13
- // Most of the time, the match media logic isn't central to people tests.
14
-
9
+ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {
15
10
  var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
16
11
 
17
- var _getThemeProps = getThemeProps({
18
- name: 'MuiUseMediaQuery',
19
- props: options,
20
- theme: theme
21
- }),
22
- _getThemeProps$defaul = _getThemeProps.defaultMatches,
23
- defaultMatches = _getThemeProps$defaul === void 0 ? false : _getThemeProps$defaul,
24
- _getThemeProps$matchM = _getThemeProps.matchMedia,
25
- matchMedia = _getThemeProps$matchM === void 0 ? supportMatchMedia ? window.matchMedia : null : _getThemeProps$matchM,
26
- _getThemeProps$noSsr = _getThemeProps.noSsr,
27
- noSsr = _getThemeProps$noSsr === void 0 ? false : _getThemeProps$noSsr,
28
- _getThemeProps$ssrMat = _getThemeProps.ssrMatchMedia,
29
- ssrMatchMedia = _getThemeProps$ssrMat === void 0 ? null : _getThemeProps$ssrMat;
30
-
31
- if (process.env.NODE_ENV !== 'production') {
32
- if (typeof queryInput === 'function' && theme === null) {
33
- 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'));
34
- }
35
- }
36
-
37
- var query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
38
- query = query.replace(/^@media( ?)/m, '');
39
-
40
12
  var _React$useState = React.useState(function () {
41
13
  if (noSsr && supportMatchMedia) {
42
14
  return matchMedia(query).matches;
@@ -73,13 +45,96 @@ export default function useMediaQuery(queryInput) {
73
45
  }
74
46
  };
75
47
 
76
- updateMatch();
48
+ updateMatch(); // TODO: Use `addEventListener` once support for Safari < 14 is dropped
49
+
77
50
  queryList.addListener(updateMatch);
78
51
  return function () {
79
52
  active = false;
80
53
  queryList.removeListener(updateMatch);
81
54
  };
82
55
  }, [query, matchMedia, supportMatchMedia]);
56
+ return match;
57
+ } // eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814
58
+
59
+
60
+ var maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];
61
+
62
+ function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia) {
63
+ var getDefaultSnapshot = React.useCallback(function () {
64
+ return defaultMatches;
65
+ }, [defaultMatches]);
66
+ var getServerSnapshot = React.useMemo(function () {
67
+ if (ssrMatchMedia !== null) {
68
+ var _ssrMatchMedia = ssrMatchMedia(query),
69
+ matches = _ssrMatchMedia.matches;
70
+
71
+ return function () {
72
+ return matches;
73
+ };
74
+ }
75
+
76
+ return getDefaultSnapshot;
77
+ }, [getDefaultSnapshot, query, ssrMatchMedia]);
78
+
79
+ var _React$useMemo = React.useMemo(function () {
80
+ if (matchMedia === null) {
81
+ return [getDefaultSnapshot, function () {
82
+ return function () {};
83
+ }];
84
+ }
85
+
86
+ var mediaQueryList = matchMedia(query);
87
+ return [function () {
88
+ return mediaQueryList.matches;
89
+ }, function (notify) {
90
+ // TODO: Use `addEventListener` once support for Safari < 14 is dropped
91
+ mediaQueryList.addListener(notify);
92
+ return function () {
93
+ mediaQueryList.removeListener(notify);
94
+ };
95
+ }];
96
+ }, [getDefaultSnapshot, matchMedia, query]),
97
+ _React$useMemo2 = _slicedToArray(_React$useMemo, 2),
98
+ getSnapshot = _React$useMemo2[0],
99
+ subscribe = _React$useMemo2[1];
100
+
101
+ var match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
102
+ return match;
103
+ }
104
+
105
+ export default function useMediaQuery(queryInput) {
106
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
107
+ var theme = useTheme(); // Wait for jsdom to support the match media feature.
108
+ // All the browsers MUI support have this built-in.
109
+ // This defensive check is here for simplicity.
110
+ // Most of the time, the match media logic isn't central to people tests.
111
+
112
+ var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';
113
+
114
+ var _getThemeProps = getThemeProps({
115
+ name: 'MuiUseMediaQuery',
116
+ props: options,
117
+ theme: theme
118
+ }),
119
+ _getThemeProps$defaul = _getThemeProps.defaultMatches,
120
+ defaultMatches = _getThemeProps$defaul === void 0 ? false : _getThemeProps$defaul,
121
+ _getThemeProps$matchM = _getThemeProps.matchMedia,
122
+ matchMedia = _getThemeProps$matchM === void 0 ? supportMatchMedia ? window.matchMedia : null : _getThemeProps$matchM,
123
+ _getThemeProps$ssrMat = _getThemeProps.ssrMatchMedia,
124
+ ssrMatchMedia = _getThemeProps$ssrMat === void 0 ? null : _getThemeProps$ssrMat,
125
+ noSsr = _getThemeProps.noSsr;
126
+
127
+ if (process.env.NODE_ENV !== 'production') {
128
+ if (typeof queryInput === 'function' && theme === null) {
129
+ 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'));
130
+ }
131
+ }
132
+
133
+ var query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;
134
+ query = query.replace(/^@media( ?)/m, ''); // TODO: Drop `useMediaQueryOld` and use `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable
135
+
136
+ var useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;
137
+ var match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);
83
138
 
84
139
  if (process.env.NODE_ENV !== 'production') {
85
140
  // eslint-disable-next-line react-hooks/rules-of-hooks
package/locale/index.d.ts CHANGED
@@ -1,68 +1,68 @@
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 arSD: Localization;
27
- export declare const azAZ: Localization;
28
- export declare const bnBD: Localization;
29
- export declare const bgBG: Localization;
30
- export declare const caES: Localization;
31
- export declare const csCZ: Localization;
32
- export declare const daDK: Localization;
33
- export declare const deDE: Localization;
34
- export declare const elGR: Localization;
35
- export declare const enUS: Localization;
36
- export declare const esES: Localization;
37
- export declare const etEE: Localization;
38
- export declare const faIR: Localization;
39
- export declare const fiFI: Localization;
40
- export declare const frFR: Localization;
41
- export declare const heIL: Localization;
42
- export declare const hiIN: Localization;
43
- export declare const huHU: Localization;
44
- export declare const hyAM: Localization;
45
- export declare const idID: Localization;
46
- export declare const isIS: Localization;
47
- export declare const itIT: Localization;
48
- export declare const jaJP: Localization;
49
- export declare const khKH: Localization;
50
- export declare const koKR: Localization;
51
- export declare const kzKZ: Localization;
52
- export declare const nbNO: Localization;
53
- export declare const nlNL: Localization;
54
- export declare const plPL: Localization;
55
- export declare const ptBR: Localization;
56
- export declare const ptPT: Localization;
57
- export declare const roRO: Localization;
58
- export declare const ruRU: Localization;
59
- export declare const siLK: Localization;
60
- export declare const skSK: Localization;
61
- export declare const svSE: Localization;
62
- export declare const thTH: Localization;
63
- export declare const trTR: Localization;
64
- export declare const ukUA: Localization;
65
- export declare const viVN: Localization;
66
- export declare const zhCN: Localization;
67
- export declare const zhHK: Localization;
68
- 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 arSD: Localization;
27
+ export declare const azAZ: Localization;
28
+ export declare const bnBD: Localization;
29
+ export declare const bgBG: Localization;
30
+ export declare const caES: Localization;
31
+ export declare const csCZ: Localization;
32
+ export declare const daDK: Localization;
33
+ export declare const deDE: Localization;
34
+ export declare const elGR: Localization;
35
+ export declare const enUS: Localization;
36
+ export declare const esES: Localization;
37
+ export declare const etEE: Localization;
38
+ export declare const faIR: Localization;
39
+ export declare const fiFI: Localization;
40
+ export declare const frFR: Localization;
41
+ export declare const heIL: Localization;
42
+ export declare const hiIN: Localization;
43
+ export declare const huHU: Localization;
44
+ export declare const hyAM: Localization;
45
+ export declare const idID: Localization;
46
+ export declare const isIS: Localization;
47
+ export declare const itIT: Localization;
48
+ export declare const jaJP: Localization;
49
+ export declare const khKH: Localization;
50
+ export declare const koKR: Localization;
51
+ export declare const kzKZ: Localization;
52
+ export declare const nbNO: Localization;
53
+ export declare const nlNL: Localization;
54
+ export declare const plPL: Localization;
55
+ export declare const ptBR: Localization;
56
+ export declare const ptPT: Localization;
57
+ export declare const roRO: Localization;
58
+ export declare const ruRU: Localization;
59
+ export declare const siLK: Localization;
60
+ export declare const skSK: Localization;
61
+ export declare const svSE: Localization;
62
+ export declare const thTH: Localization;
63
+ export declare const trTR: Localization;
64
+ export declare const ukUA: Localization;
65
+ export declare const viVN: Localization;
66
+ export declare const zhCN: Localization;
67
+ export declare const zhHK: Localization;
68
+ export declare const zhTW: Localization;
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
 
4
4
  var _ClearIcon, _ArrowDropDownIcon;
5
5
 
6
- const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"];
6
+ const _excluded = ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "readOnly", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"];
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import clsx from 'clsx';
@@ -398,6 +398,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
398
398
  PaperComponent = Paper,
399
399
  PopperComponent = Popper,
400
400
  popupIcon = _ArrowDropDownIcon || (_ArrowDropDownIcon = /*#__PURE__*/_jsx(ArrowDropDownIcon, {})),
401
+ readOnly = false,
401
402
  renderGroup: renderGroupProp,
402
403
  renderInput,
403
404
  renderOption: renderOptionProp,
@@ -431,7 +432,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
431
432
  } = useAutocomplete(_extends({}, props, {
432
433
  componentName: 'Autocomplete'
433
434
  }));
434
- const hasClearIcon = !disableClearable && !disabled && dirty;
435
+ const hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
435
436
  const hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
436
437
 
437
438
  const ownerState = _extends({}, props, {
@@ -550,7 +551,8 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
550
551
  },
551
552
  inputProps: _extends({
552
553
  className: clsx(classes.input),
553
- disabled
554
+ disabled,
555
+ readOnly
554
556
  }, getInputProps())
555
557
  })
556
558
  })), popupOpen && anchorEl ? /*#__PURE__*/_jsx(AutocompletePopper, {
@@ -991,6 +993,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
991
993
  */
992
994
  popupIcon: PropTypes.node,
993
995
 
996
+ /**
997
+ * If `true`, the component becomes readonly. It is also supported for multiple tags where the tag cannot be deleted.
998
+ * @default false
999
+ */
1000
+ readOnly: PropTypes.bool,
1001
+
994
1002
  /**
995
1003
  * Render the group.
996
1004
  *
File without changes
@@ -6,9 +6,7 @@ import styled from '../styles/styled';
6
6
  import MoreHorizIcon from '../internal/svg-icons/MoreHoriz';
7
7
  import ButtonBase from '../ButtonBase';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
- const BreadcrumbCollapsedButton = styled(ButtonBase, {
10
- skipSx: true
11
- })(({
9
+ const BreadcrumbCollapsedButton = styled(ButtonBase)(({
12
10
  theme
13
11
  }) => _extends({
14
12
  display: 'flex',
@@ -48,8 +48,7 @@ const pulsateKeyframe = keyframes`
48
48
  `;
49
49
  export const TouchRippleRoot = styled('span', {
50
50
  name: 'MuiTouchRipple',
51
- slot: 'Root',
52
- skipSx: true
51
+ slot: 'Root'
53
52
  })({
54
53
  overflow: 'hidden',
55
54
  pointerEvents: 'none',
@@ -12,6 +12,7 @@ import capitalize from '../utils/capitalize';
12
12
  import styled from '../styles/styled';
13
13
  import useThemeProps from '../styles/useThemeProps';
14
14
  import formControlLabelClasses, { getFormControlLabelUtilityClasses } from './formControlLabelClasses';
15
+ import formControlState from '../FormControl/formControlState';
15
16
  import { jsx as _jsx } from "react/jsx-runtime";
16
17
  import { jsxs as _jsxs } from "react/jsx-runtime";
17
18
 
@@ -19,10 +20,11 @@ const useUtilityClasses = ownerState => {
19
20
  const {
20
21
  classes,
21
22
  disabled,
22
- labelPlacement
23
+ labelPlacement,
24
+ error
23
25
  } = ownerState;
24
26
  const slots = {
25
- root: ['root', disabled && 'disabled', `labelPlacement${capitalize(labelPlacement)}`],
27
+ root: ['root', disabled && 'disabled', `labelPlacement${capitalize(labelPlacement)}`, error && 'error'],
26
28
  label: ['label', disabled && 'disabled']
27
29
  };
28
30
  return composeClasses(slots, getFormControlLabelUtilityClasses, classes);
@@ -114,11 +116,17 @@ const FormControlLabel = /*#__PURE__*/React.forwardRef(function FormControlLabel
114
116
  controlProps[key] = props[key];
115
117
  }
116
118
  });
119
+ const fcs = formControlState({
120
+ props,
121
+ muiFormControl,
122
+ states: ['error']
123
+ });
117
124
 
118
125
  const ownerState = _extends({}, props, {
119
126
  disabled,
120
127
  label,
121
- labelPlacement
128
+ labelPlacement,
129
+ error: fcs.error
122
130
  });
123
131
 
124
132
  const classes = useUtilityClasses(ownerState);
@@ -2,5 +2,5 @@ import { generateUtilityClasses, generateUtilityClass } from '@mui/base';
2
2
  export function getFormControlLabelUtilityClasses(slot) {
3
3
  return generateUtilityClass('MuiFormControlLabel', slot);
4
4
  }
5
- const formControlLabelClasses = generateUtilityClasses('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label']);
5
+ const formControlLabelClasses = generateUtilityClasses('MuiFormControlLabel', ['root', 'labelPlacementStart', 'labelPlacementTop', 'labelPlacementBottom', 'disabled', 'label', 'error']);
6
6
  export default formControlLabelClasses;
@@ -8,15 +8,18 @@ import { unstable_composeClasses as composeClasses } from '@mui/base';
8
8
  import styled from '../styles/styled';
9
9
  import useThemeProps from '../styles/useThemeProps';
10
10
  import { getFormGroupUtilityClass } from './formGroupClasses';
11
+ import useFormControl from '../FormControl/useFormControl';
12
+ import formControlState from '../FormControl/formControlState';
11
13
  import { jsx as _jsx } from "react/jsx-runtime";
12
14
 
13
15
  const useUtilityClasses = ownerState => {
14
16
  const {
15
17
  classes,
16
- row
18
+ row,
19
+ error
17
20
  } = ownerState;
18
21
  const slots = {
19
- root: ['root', row && 'row']
22
+ root: ['root', row && 'row', error && 'error']
20
23
  };
21
24
  return composeClasses(slots, getFormGroupUtilityClass, classes);
22
25
  };
@@ -57,8 +60,16 @@ const FormGroup = /*#__PURE__*/React.forwardRef(function FormGroup(inProps, ref)
57
60
  } = props,
58
61
  other = _objectWithoutPropertiesLoose(props, _excluded);
59
62
 
63
+ const muiFormControl = useFormControl();
64
+ const fcs = formControlState({
65
+ props,
66
+ muiFormControl,
67
+ states: ['error']
68
+ });
69
+
60
70
  const ownerState = _extends({}, props, {
61
- row
71
+ row,
72
+ error: fcs.error
62
73
  });
63
74
 
64
75
  const classes = useUtilityClasses(ownerState);
@@ -2,5 +2,5 @@ import { generateUtilityClass, generateUtilityClasses } from '@mui/base';
2
2
  export function getFormGroupUtilityClass(slot) {
3
3
  return generateUtilityClass('MuiFormGroup', slot);
4
4
  }
5
- const formGroupClasses = generateUtilityClasses('MuiFormGroup', ['root', 'row']);
5
+ const formGroupClasses = generateUtilityClasses('MuiFormGroup', ['root', 'row', 'error']);
6
6
  export default formGroupClasses;
@@ -1,5 +1,8 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
+
4
+ var _span;
5
+
3
6
  const _excluded = ["children", "className", "component", "disabled", "error", "filled", "focused", "margin", "required", "variant"];
4
7
  import * as React from 'react';
5
8
  import PropTypes from 'prop-types';
@@ -101,16 +104,11 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
101
104
  className: clsx(classes.root, className),
102
105
  ref: ref
103
106
  }, other, {
104
- children: children === ' ' ?
105
- /*#__PURE__*/
106
- // notranslate needed while Google Translate will not fix zero-width space issue
107
- // eslint-disable-next-line react/no-danger
108
- _jsx("span", {
107
+ children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
108
+ _span || (_span = /*#__PURE__*/_jsx("span", {
109
109
  className: "notranslate",
110
- dangerouslySetInnerHTML: {
111
- __html: '&#8203;'
112
- }
113
- }) : children
110
+ children: "\u200B"
111
+ })) : children
114
112
  }));
115
113
  });
116
114
  process.env.NODE_ENV !== "production" ? FormHelperText.propTypes
@@ -260,10 +260,8 @@ const GridRoot = styled('div', {
260
260
 
261
261
  }, ownerState.zeroMinWidth && {
262
262
  minWidth: 0
263
- }, ownerState.wrap === 'nowrap' && {
264
- flexWrap: 'nowrap'
265
- }, ownerState.wrap === 'reverse' && {
266
- flexWrap: 'wrap-reverse'
263
+ }, ownerState.wrap !== 'wrap' && {
264
+ flexWrap: ownerState.wrap
267
265
  }), generateDirection, generateRowGap, generateColumnGap, generateGrid);
268
266
 
269
267
  const useUtilityClasses = ownerState => {
@@ -1,5 +1,8 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
+
4
+ var _span;
5
+
3
6
  const _excluded = ["children", "className", "component", "disablePointerEvents", "disableTypography", "position", "variant"];
4
7
  import * as React from 'react';
5
8
  import PropTypes from 'prop-types';
@@ -121,17 +124,11 @@ const InputAdornment = /*#__PURE__*/React.forwardRef(function InputAdornment(inP
121
124
  children: children
122
125
  }) : /*#__PURE__*/_jsxs(React.Fragment, {
123
126
  children: [position === 'start' ?
124
- /*#__PURE__*/
125
-
126
127
  /* notranslate needed while Google Translate will not fix zero-width space issue */
127
-
128
- /* eslint-disable-next-line react/no-danger */
129
- _jsx("span", {
128
+ _span || (_span = /*#__PURE__*/_jsx("span", {
130
129
  className: "notranslate",
131
- dangerouslySetInnerHTML: {
132
- __html: '&#8203;'
133
- }
134
- }) : null, children]
130
+ children: "\u200B"
131
+ })) : null, children]
135
132
  })
136
133
  }))
137
134
  });
@@ -1,5 +1,8 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
+
4
+ var _span;
5
+
3
6
  const _excluded = ["children", "classes", "className", "label", "notched"];
4
7
  import * as React from 'react';
5
8
  import PropTypes from 'prop-types';
@@ -21,14 +24,12 @@ const NotchedOutlineRoot = styled('fieldset')({
21
24
  overflow: 'hidden',
22
25
  minWidth: '0%'
23
26
  });
24
- const NotchedOutlineLegend = styled('legend', {
25
- skipSx: true
26
- })(({
27
+ const NotchedOutlineLegend = styled('legend')(({
27
28
  ownerState,
28
29
  theme
29
30
  }) => _extends({
30
31
  float: 'unset'
31
- }, ownerState.label === undefined && {
32
+ }, !ownerState.withLabel && {
32
33
  padding: 0,
33
34
  lineHeight: '11px',
34
35
  // sync with `height` in `legend` styles
@@ -36,7 +37,7 @@ const NotchedOutlineLegend = styled('legend', {
36
37
  duration: 150,
37
38
  easing: theme.transitions.easing.easeOut
38
39
  })
39
- }, ownerState.label !== undefined && _extends({
40
+ }, ownerState.withLabel && _extends({
40
41
  display: 'block',
41
42
  // Fix conflict with normalize.css and sanitize.css
42
43
  width: 'auto',
@@ -77,9 +78,11 @@ export default function NotchedOutline(props) {
77
78
  } = props,
78
79
  other = _objectWithoutPropertiesLoose(props, _excluded);
79
80
 
81
+ const withLabel = label != null && label !== '';
82
+
80
83
  const ownerState = _extends({}, props, {
81
84
  notched,
82
- label
85
+ withLabel
83
86
  });
84
87
 
85
88
  return /*#__PURE__*/_jsx(NotchedOutlineRoot, _extends({
@@ -89,18 +92,13 @@ export default function NotchedOutline(props) {
89
92
  }, other, {
90
93
  children: /*#__PURE__*/_jsx(NotchedOutlineLegend, {
91
94
  ownerState: ownerState,
92
- children: label ? /*#__PURE__*/_jsx("span", {
95
+ children: withLabel ? /*#__PURE__*/_jsx("span", {
93
96
  children: label
94
- }) :
95
- /*#__PURE__*/
96
- // notranslate needed while Google Translate will not fix zero-width space issue
97
- // eslint-disable-next-line react/no-danger
98
- _jsx("span", {
97
+ }) : // notranslate needed while Google Translate will not fix zero-width space issue
98
+ _span || (_span = /*#__PURE__*/_jsx("span", {
99
99
  className: "notranslate",
100
- dangerouslySetInnerHTML: {
101
- __html: '&#8203;'
102
- }
103
- })
100
+ children: "\u200B"
101
+ }))
104
102
  })
105
103
  }));
106
104
  }