@mui/material 5.2.3 → 5.2.7

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 (56) hide show
  1. package/Avatar/Avatar.d.ts +4 -2
  2. package/Badge/Badge.d.ts +25 -0
  3. package/Badge/Badge.js +40 -10
  4. package/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  5. package/ButtonGroup/ButtonGroupContext.d.ts +1 -1
  6. package/CHANGELOG.md +227 -0
  7. package/CssBaseline/CssBaseline.d.ts +1 -1
  8. package/GlobalStyles/GlobalStyles.d.ts +2 -1
  9. package/Grid/Grid.js +74 -66
  10. package/InputBase/InputBase.d.ts +6 -0
  11. package/InputBase/InputBase.js +10 -2
  12. package/ListItem/ListItem.d.ts +1 -1
  13. package/ListItemButton/ListItemButton.d.ts +1 -1
  14. package/MenuItem/MenuItem.d.ts +1 -1
  15. package/OutlinedInput/OutlinedInput.js +14 -1
  16. package/README.md +15 -27
  17. package/Select/SelectInput.js +11 -3
  18. package/SvgIcon/SvgIcon.d.ts +8 -0
  19. package/SvgIcon/SvgIcon.js +19 -3
  20. package/Tabs/Tabs.d.ts +1 -1
  21. package/TextField/TextField.js +2 -9
  22. package/index.js +1 -1
  23. package/legacy/Badge/Badge.js +46 -11
  24. package/legacy/Grid/Grid.js +84 -78
  25. package/legacy/InputBase/InputBase.js +10 -2
  26. package/legacy/OutlinedInput/OutlinedInput.js +14 -1
  27. package/legacy/Select/SelectInput.js +11 -5
  28. package/legacy/SvgIcon/SvgIcon.js +20 -3
  29. package/legacy/TextField/TextField.js +2 -9
  30. package/legacy/index.js +1 -1
  31. package/legacy/locale/index.js +319 -142
  32. package/locale/index.d.ts +2 -0
  33. package/locale/index.js +220 -50
  34. package/modern/Badge/Badge.js +40 -10
  35. package/modern/Grid/Grid.js +74 -66
  36. package/modern/InputBase/InputBase.js +10 -2
  37. package/modern/OutlinedInput/OutlinedInput.js +14 -1
  38. package/modern/Select/SelectInput.js +11 -3
  39. package/modern/SvgIcon/SvgIcon.js +19 -3
  40. package/modern/TextField/TextField.js +2 -7
  41. package/modern/index.js +1 -1
  42. package/modern/locale/index.js +220 -50
  43. package/node/Badge/Badge.js +40 -10
  44. package/node/Grid/Grid.js +75 -65
  45. package/node/InputBase/InputBase.js +10 -2
  46. package/node/OutlinedInput/OutlinedInput.js +15 -1
  47. package/node/Select/SelectInput.js +11 -3
  48. package/node/SvgIcon/SvgIcon.js +19 -3
  49. package/node/TextField/TextField.js +1 -8
  50. package/node/index.js +1 -1
  51. package/node/locale/index.js +223 -51
  52. package/package.json +3 -3
  53. package/styles/createTheme.d.ts +1 -1
  54. package/transitions/transition.d.ts +1 -2
  55. package/umd/material-ui.development.js +278 -171
  56. package/umd/material-ui.production.min.js +21 -21
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { SxProps } from '@mui/system';
3
- import { Theme } from '@mui/material/styles';
4
3
  import { OverridableStringUnion } from '@mui/types';
4
+ import { Theme } from '../styles';
5
5
  import { OverridableComponent, OverrideProps } from '../OverridableComponent';
6
6
  import { AvatarClasses } from './avatarClasses';
7
7
 
@@ -27,7 +27,9 @@ export interface AvatarTypeMap<P = {}, D extends React.ElementType = 'div'> {
27
27
  * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes) applied to the `img` element if the component is used to display an image.
28
28
  * It can be used to listen for the loading error event.
29
29
  */
30
- imgProps?: React.ImgHTMLAttributes<HTMLImageElement>;
30
+ imgProps?: React.ImgHTMLAttributes<HTMLImageElement> & {
31
+ sx?: SxProps<Theme>;
32
+ };
31
33
  /**
32
34
  * The `sizes` attribute for the `img` element.
33
35
  */
package/Badge/Badge.d.ts CHANGED
@@ -30,6 +30,26 @@ export type BadgeTypeMap<
30
30
  colorSuccess?: string;
31
31
  /** Styles applied to the badge `span` element if `color="warning"`. */
32
32
  colorWarning?: string;
33
+ /** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'right' }} overlap="rectangular"`. */
34
+ anchorOriginTopRightRectangular?: string;
35
+ /** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'right' }} overlap="rectangular"`. */
36
+ anchorOriginBottomRightRectangular?: string;
37
+ /** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'left' }} overlap="rectangular"`. */
38
+ anchorOriginTopLeftRectangular?: string;
39
+ /** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'left' }} overlap="rectangular"`. */
40
+ anchorOriginBottomLeftRectangular?: string;
41
+ /** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'right' }} overlap="circular"`. */
42
+ anchorOriginTopRightCircular?: string;
43
+ /** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'right' }} overlap="circular"`. */
44
+ anchorOriginBottomRightCircular?: string;
45
+ /** Class name applied to the badge `span` element if `anchorOrigin={{ 'top', 'left' }} overlap="circular"`. */
46
+ anchorOriginTopLeftCircular?: string;
47
+ /** Class name applied to the badge `span` element if `anchorOrigin={{ 'bottom', 'left' }} overlap="circular"`. */
48
+ anchorOriginBottomLeftCircular?: string;
49
+ /** Class name applied to the badge `span` element if `overlap="rectangular"`. */
50
+ overlapRectangular?: string;
51
+ /** Class name applied to the badge `span` element if `overlap="circular"`. */
52
+ overlapCircular?: string;
33
53
  };
34
54
  /**
35
55
  * The color of the component. It supports those theme colors that make sense for this component.
@@ -39,6 +59,11 @@ export type BadgeTypeMap<
39
59
  'primary' | 'secondary' | 'default' | 'error' | 'info' | 'success' | 'warning',
40
60
  BadgePropsColorOverrides
41
61
  >;
62
+ /**
63
+ * Wrapped shape the badge should overlap.
64
+ * @default 'rectangular'
65
+ */
66
+ overlap?: 'rectangular' | 'circular';
42
67
  /**
43
68
  * The system prop that allows defining system overrides as well as additional CSS styles.
44
69
  */
package/Badge/Badge.js CHANGED
@@ -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 = ["components", "componentsProps", "color", "invisible", "badgeContent", "showZero", "variant"];
3
+ const _excluded = ["anchorOrigin", "component", "components", "componentsProps", "overlap", "color", "invisible", "badgeContent", "showZero", "variant"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import clsx from 'clsx';
@@ -11,17 +11,20 @@ import styled from '../styles/styled';
11
11
  import useThemeProps from '../styles/useThemeProps';
12
12
  import capitalize from '../utils/capitalize';
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
- export const badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning']));
14
+ export const badgeClasses = _extends({}, badgeUnstyledClasses, generateUtilityClasses('MuiBadge', ['colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys
15
+ 'anchorOriginTopLeftCircular', 'anchorOriginTopLeftRectangular', 'anchorOriginTopRightCircular', 'anchorOriginTopRightRectangular', 'anchorOriginBottomLeftCircular', 'anchorOriginBottomLeftRectangular', 'anchorOriginBottomRightCircular', 'anchorOriginBottomRightRectangular']));
15
16
  const RADIUS_STANDARD = 10;
16
17
  const RADIUS_DOT = 4;
17
18
 
18
19
  const extendUtilityClasses = ownerState => {
19
20
  const {
20
21
  color,
22
+ anchorOrigin,
23
+ overlap,
21
24
  classes = {}
22
25
  } = ownerState;
23
26
  return _extends({}, classes, {
24
- badge: clsx(classes.badge, color !== 'default' && [getBadgeUtilityClass(`color${capitalize(color)}`), classes[`color${capitalize(color)}`]])
27
+ badge: clsx(classes.badge, getBadgeUtilityClass(`anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}${capitalize(overlap)}`), getBadgeUtilityClass(`overlap${capitalize(overlap)}`), color !== 'default' && [getBadgeUtilityClass(`color${capitalize(color)}`), classes[`color${capitalize(color)}`]])
25
28
  });
26
29
  };
27
30
 
@@ -149,6 +152,11 @@ const BadgeBadge = styled('span', {
149
152
  duration: theme.transitions.duration.leavingScreen
150
153
  })
151
154
  }));
155
+
156
+ const shouldSpreadAdditionalProps = Slot => {
157
+ return !Slot || !isHostComponent(Slot);
158
+ };
159
+
152
160
  const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
153
161
  var _componentsProps$root, _componentsProps$badg;
154
162
 
@@ -158,8 +166,14 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
158
166
  });
159
167
 
160
168
  const {
169
+ anchorOrigin: anchorOriginProp = {
170
+ vertical: 'top',
171
+ horizontal: 'right'
172
+ },
173
+ component = 'span',
161
174
  components = {},
162
175
  componentsProps = {},
176
+ overlap: overlapProp = 'rectangular',
163
177
  color: colorProp = 'default',
164
178
  invisible: invisibleProp,
165
179
  badgeContent: badgeContentProp,
@@ -169,7 +183,9 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
169
183
  other = _objectWithoutPropertiesLoose(props, _excluded);
170
184
 
171
185
  const prevProps = usePreviousProps({
172
- color: colorProp
186
+ anchorOrigin: anchorOriginProp,
187
+ color: colorProp,
188
+ overlap: overlapProp
173
189
  });
174
190
  let invisible = invisibleProp;
175
191
 
@@ -178,16 +194,21 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
178
194
  }
179
195
 
180
196
  const {
181
- color = colorProp
197
+ color = colorProp,
198
+ overlap = overlapProp,
199
+ anchorOrigin = anchorOriginProp
182
200
  } = invisible ? prevProps : props;
183
201
 
184
202
  const ownerState = _extends({}, props, {
203
+ anchorOrigin,
185
204
  invisible,
186
- color
205
+ color,
206
+ overlap
187
207
  });
188
208
 
189
209
  const classes = extendUtilityClasses(ownerState);
190
210
  return /*#__PURE__*/_jsx(BadgeUnstyled, _extends({
211
+ anchorOrigin: anchorOrigin,
191
212
  invisible: invisibleProp,
192
213
  badgeContent: badgeContentProp,
193
214
  showZero: showZero,
@@ -198,14 +219,17 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
198
219
  Badge: BadgeBadge
199
220
  }, components),
200
221
  componentsProps: {
201
- root: _extends({}, componentsProps.root, (!components.Root || !isHostComponent(components.Root)) && {
222
+ root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
223
+ as: component,
202
224
  ownerState: _extends({}, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.ownerState, {
203
- color
225
+ color,
226
+ overlap
204
227
  })
205
228
  }),
206
- badge: _extends({}, componentsProps.badge, (!components.Thumb || !isHostComponent(components.Thumb)) && {
229
+ badge: _extends({}, componentsProps.badge, shouldSpreadAdditionalProps(components.Badge) && {
207
230
  ownerState: _extends({}, (_componentsProps$badg = componentsProps.badge) == null ? void 0 : _componentsProps$badg.ownerState, {
208
- color
231
+ color,
232
+ overlap
209
233
  })
210
234
  })
211
235
  },
@@ -256,6 +280,12 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
256
280
  /* @typescript-to-proptypes-ignore */
257
281
  .oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
258
282
 
283
+ /**
284
+ * The component used for the root node.
285
+ * Either a string to use a HTML element or a component.
286
+ */
287
+ component: PropTypes.elementType,
288
+
259
289
  /**
260
290
  * The components used for each slot inside the Badge.
261
291
  * Either a string to use a HTML element or a component.
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { SxProps } from '@mui/system';
3
- import { Theme } from '@mui/material/styles';
3
+ import { Theme } from '../styles';
4
4
  import { OverridableComponent, OverrideProps } from '../OverridableComponent';
5
5
  import { BreadcrumbsClasses } from './breadcrumbsClasses';
6
6
 
@@ -4,7 +4,7 @@ interface IButtonGroupContext {
4
4
  className?: string;
5
5
  color?: ButtonGroupProps['color'];
6
6
  disabled?: boolean;
7
- disabledElevation?: boolean;
7
+ disableElevation?: boolean;
8
8
  disableFocusRipple?: boolean;
9
9
  disableRipple?: boolean;
10
10
  fullWidth?: boolean;
package/CHANGELOG.md CHANGED
@@ -1,5 +1,232 @@
1
1
  ### [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.2.7
4
+
5
+ <!-- generated comparing v5.2.6..master -->
6
+
7
+ _Jan 3, 2022_
8
+
9
+ A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ - 📓 Improvements on the Vietnamese (vi-VN) and Finnish (fi-FI) locales (#30426, #30442) @hckhanh @Certificate
12
+ - And more 🐛 bug fixes and 📚 documentation improvements.
13
+
14
+ ### `@mui/material@5.2.7`
15
+
16
+ - &#8203;<!-- 14 -->[Autocomplete] Fix calling onChange for duplicate values (#30374) @alisasanib
17
+ - &#8203;<!-- 13 -->[Avatar] Fix TypeScript error on imgProps (#30255) @ahmad-reza619
18
+ - &#8203;<!-- 12 -->[Badge] Fix `classes` prop TypeScript type (#30427) @ZeeshanTamboli
19
+ - &#8203;<!-- 03 -->[SvgIcon] Allow viewBox to inherit from Component through inheritViewBox prop (#29954) @alex-dikusar
20
+ - &#8203;<!-- 04 -->[SvgIcon] Correct API docs and code style (#30470) @michaldudak
21
+
22
+ ### Docs
23
+
24
+ - &#8203;<!-- 11 -->[blog] 2021 (#30425) @oliviertassinari
25
+ - &#8203;<!-- 15 -->[docs] Fix typo on the Grid docs page (#30446) @abhi45
26
+ - &#8203;<!-- 07 -->[docs] Fix `useMediaQuery` SSR example to v5 theme API (#30454) @ValentinH
27
+ - &#8203;<!-- 11 -->[docs] Improve the migration guide and add examples for transforming to `tss-react` (#30388) @mnajdova
28
+ - &#8203;<!-- 09 -->[docs] Make the reference to the select clearer (#30460) @boazrymland
29
+ - &#8203;<!-- 08 -->[docs] Sync translations with Crowdin (#30385) @l10nbot
30
+ - &#8203;<!-- 06 -->[example] Avoid double rendering in the Remix example (#30366) @mnajdova
31
+ - &#8203;<!-- 05 -->[i18n] improve viVN locale (#30426) @hckhanh
32
+ - &#8203;<!-- 04 -->[l10n] Improve fiFI locale (#30442) @Certificate
33
+ - &#8203;<!-- 02 -->[website] Add new batch of open roles (#30282) @oliviertassinari
34
+ - &#8203;<!-- 01 -->[website] Refactor page context with next router (#30020) @siriwatknp
35
+
36
+ ### Core
37
+
38
+ - &#8203;<!-- 13 -->[core] Automatically close issues that are incomplete and inactive (#30459) @oliviertassinari
39
+ - &#8203;<!-- 10 -->[core] Remove contrib tweet (#30455) @oliviertassinari
40
+
41
+ All contributors of this release in alphabetical order: @abhi45, @ahmad-reza619, @alex-dikusar, @alisasanib, @boazrymland, @Certificate, @hckhanh, @l10nbot, @michaldudak, @mnajdova, @oliviertassinari, @siriwatknp, @ValentinH, @ZeeshanTamboli
42
+
43
+ ## 5.2.6
44
+
45
+ <!-- generated comparing v5.2.5..master -->
46
+
47
+ _Dec 27, 2021_
48
+
49
+ A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
50
+
51
+ - 📓 The Norwegian Bokmål (nb-NO) locale was added (#27520) @wogsland
52
+ - 🛠 Introduced a new `useBadge` hook in the `@mui/base` package (#30246) @mnajdova
53
+ - And more 🐛 bug fixes and 📚 documentation improvements.
54
+
55
+ ### `@mui/material@5.2.6`
56
+
57
+ - &#8203;<!-- 24 -->[ButtonGroup] Fix typo in ButtonGroupContext's interface (#30376) @kealjones-wk
58
+ - &#8203;<!-- 03 -->[l10n] Add Norwegian Bokmål (nb-NO) locale (#27520) @wogsland
59
+
60
+ ### `@mui/base@5.0.0-alpha.62`
61
+
62
+ - &#8203;<!-- 26 -->[BadgeUnstyled] Add useBadge hook (#30246) @mnajdova
63
+
64
+ ### `@mui/joy@5.0.0-alpha.8`
65
+
66
+ - &#8203;<!-- 04 -->[Joy] Button API (#29962) @siriwatknp
67
+
68
+ ### Docs
69
+
70
+ - &#8203;<!-- 27 -->[docs] Fix color coercion (#30319) @Janpot
71
+ - &#8203;<!-- 25 -->[blog] Fix file import conflict resolution (#30391) @oliviertassinari
72
+ - &#8203;<!-- 21 -->[docs] Fix crash on Safari because of unsupported lookahead feature (#30345) @cherniavskii
73
+ - &#8203;<!-- 20 -->[docs] Update to new website domain (#30396) @ryota-murakami
74
+ - &#8203;<!-- 19 -->[docs] Fix text from material-ui to @mui to reflect v5 name changes (#30393) @pupudu
75
+ - &#8203;<!-- 18 -->[docs] Fix a11y in Menu demos (#30378) @ZeeshanTamboli
76
+ - &#8203;<!-- 17 -->[docs] Document how to unmount transition child (#30382) @oliviertassinari
77
+ - &#8203;<!-- 16 -->[docs] The current standard for quotes is QUOTATION MARK @oliviertassinari
78
+ - &#8203;<!-- 15 -->[docs] Fix 404 links (#30380) @oliviertassinari
79
+ - &#8203;<!-- 14 -->[docs] Fix Breadcrumb description (#30307) @jamesmelzer
80
+ - &#8203;<!-- 13 -->[docs] Modify injection order for Gatsby and SSR examples (#30358) @ShuPink
81
+ - &#8203;<!-- 12 -->[docs] Improve the translation experience (#30373) @oliviertassinari
82
+ - &#8203;<!-- 11 -->[docs] Sync translations with Crowdin (#30176) @l10nbot
83
+ - &#8203;<!-- 10 -->[docs] Fix link to /size-snapshot (#30363) @oliviertassinari
84
+ - &#8203;<!-- 09 -->[docs] Fix incorrect aria label in SpeedDial demo (#30354) @chwallen
85
+ - &#8203;<!-- 08 -->[docs] Fix incorrect number of breakpoint helpers (#30353) @chwallen
86
+ - &#8203;<!-- 07 -->[docs] Update outdated links (#30260) @oliviertassinari
87
+ - &#8203;<!-- 06 -->[docs] Support redirects from old urls to /material/\* (#30286) @siriwatknp
88
+ - &#8203;<!-- 05 -->[examples] Fix CSS modules integration (#30381) @oliviertassinari
89
+ - &#8203;<!-- 02 -->[website] Fix SEO issues (#30372) @oliviertassinari
90
+ - &#8203;<!-- 01 -->[website] Sync sponsors (#30259) @oliviertassinari
91
+
92
+ ### Core
93
+
94
+ - &#8203;<!-- 28 -->[core] Rename Material-UI to MUI (#30338) @ZeeshanTamboli
95
+ - &#8203;<!-- 23 -->[core] Fix warning in dev mode (#30368) @oliviertassinari
96
+ - &#8203;<!-- 22 -->[core] Update `buildApi` script to support new structure (#30245) @siriwatknp
97
+
98
+ All contributors of this release in alphabetical order: @cherniavskii, @chwallen, @jamesmelzer, @Janpot, @kealjones-wk, @l10nbot, @mnajdova, @oliviertassinari, @pupudu, @ryota-murakami, @ShuPink, @siriwatknp, @wogsland, @ZeeshanTamboli
99
+
100
+ ## 5.2.5
101
+
102
+ <!-- generated comparing v5.2.4..master -->
103
+
104
+ _Dec 20, 2021_
105
+
106
+ A big thanks to the 16 contributors who made this release possible. Here are some highlights ✨:
107
+
108
+ - 🛠 This release mostly improves what's behind the scenes: infrastructure and tests
109
+ - 📓 Danish (da-DK) locale was added (#29485) @mikk5829
110
+ - 🖌 Polished the design of Base components (#30149) and the docs in general (#29994) @danilo-leal
111
+ - 📚 Many additions and improvements to the documentation were made
112
+
113
+ ### `@mui/material@5.2.5`
114
+
115
+ - [l10n] Add Danish (da-DK) locale (#29485) @mikk5829
116
+ - [LoadingButton] Label progressbar by the LoadingButton (#30002) @eps1lon
117
+ - [Tabs] Remove unnecessary `Partial<>` type around TabIndicatorProps type (#30254) @ZeeshanTamboli
118
+
119
+ ### `@mui/system@5.2.5`
120
+
121
+ - [system] Use `useEnhancedEffect` to prevent flicker (#30216) @hbjORbj
122
+
123
+ ### `@mui/lab@5.0.0-alpha.61`
124
+
125
+ - [pickers] Fix the wrong MuiClockPicker's ArrowSwitcher slot name (#30226) @rejetto
126
+
127
+ ### Docs
128
+
129
+ - [docs] Run JS compiler on markdown output (#29732) @Janpot
130
+ - [Badge] Add tests for `anchorOrigin` prop (#30147) @daniel-sachs
131
+ - [docs] Add cssmodule injection order comments to Nextjs example (#30213) @ShuPink
132
+ - [docs] Remove extra word in Select component code example comments (#30281) @KThompso
133
+ - [docs] Improve the description of the Accordion (#30253) @jamesmelzer
134
+ - [docs] Heading capitalization convention @oliviertassinari
135
+ - [docs] Rename remaining 'unstyled' references to 'base' (#30206) @michaldudak
136
+ - [docs] Add to migration doc about ref type specificity (#30114) @hbjORbj
137
+ - [docs] Add script to clone pages (#30107) @siriwatknp
138
+ - [docs] Correct colors in breakpoints documentation (#30219) @michaldudak
139
+ - [docs] Sync icon search UI state with the url (#30075) @Janpot
140
+ - [docs] Base components demos design polish (#30149) @danilo-leal
141
+ - [docs] General documentation polish (#29994) @danilo-leal
142
+ - [examples] Fix typo in the remix example's README (#30289) @lemol
143
+ - [website] Remove expired gold sponsor (#30222) @oliviertassinari
144
+ - [website] Remove broken showcase links (#30217) @mnajdova
145
+
146
+ ### Core
147
+
148
+ - [test] Reduce bundle size comparison memory consumption (#30195) @Janpot
149
+ - [core] make snapshot comparison more resilient (#30183) @Janpot
150
+ - [core] update formatted ts demo to support new structure (#30248) @siriwatknp
151
+ - [core] cache dependencies in github actions (#30211) @siriwatknp
152
+ - [core] fix root package version (#30204) @siriwatknp
153
+ - [core] Fail the build when the dangerjs script errors (#30186) @Janpot
154
+ - [test] Add E2E website tests (#30128) @siriwatknp
155
+
156
+ All contributors of this release in alphabetical order: @daniel-sachs, @danilo-leal, @eps1lon, @hbjORbj, @jamesmelzer, @Janpot, @KThompso, @lemol, @michaldudak, @mikk5829, @mnajdova, @oliviertassinari, @rejetto, @ShuPink, @siriwatknp, @ZeeshanTamboli
157
+
158
+ ## 5.2.4
159
+
160
+ <!-- generated comparing v5.2.3..master -->
161
+
162
+ _Dec 14, 2021_
163
+
164
+ A big thanks to the 16 contributors who made this release possible. Here are some highlights ✨:
165
+
166
+ - ✨ Add `not` operator to `theme.breakpoints` (#29311) @Philipp000
167
+
168
+ ```js
169
+ const styles = (theme) => ({
170
+ root: {
171
+ backgroundColor: 'blue',
172
+ // Match [xs, md) and [md + 1, ∞)
173
+ // [xs, md) and [lg, ∞)
174
+ // [0px, 900px) and [1200px, ∞)
175
+ [theme.breakpoints.not('md')]: {
176
+ backgroundColor: 'red',
177
+ },
178
+ },
179
+ });
180
+ ```
181
+
182
+ - And many more 🐛 bug fixes and 📚 improvements.
183
+
184
+ ### `@mui/material@5.2.4`
185
+
186
+ - &#8203;<!-- 14 -->[esm] Correct a styles imports (#29976) @Janpot
187
+ - &#8203;<!-- 12 -->[GlobalStyles] Fix `theme` type (#30072) @mnajdova
188
+ - &#8203;<!-- 11 -->[Grid] Fix grid items to respond to the container's responsive columns (#29715) @kkorach
189
+ - &#8203;<!-- 04 -->[TextField] Fix missing space before asterisk in `OutlinedInput`'s label (#29630) @alisasanib
190
+ - &#8203;<!-- 03 -->[Transition] Allow any valid HTML attribute to be passed (#29888) @Janpot
191
+ - &#8203;<!-- 02 -->[types] Fix discrepancy between core and system `ThemeOptions` (#30095) @fmeum
192
+ - &#8203;<!-- 09 -->[InputBase] Add prop for disabling global styles (#29213) @bryan-hunter
193
+ - &#8203;<!-- 08 -->[Select] Improve multiple logic (#30135) @ladygo93
194
+
195
+ ### `@mui/system@5.2.4`
196
+
197
+ - &#8203;<!-- 06 -->[system] Don't transition when re-appearing (#30108) @eps1lon
198
+ - &#8203;<!-- 05 -->[system] Add `not` operator to `breakpoints` (#29311) @Philipp000
199
+
200
+ ### `@mui/base@5.0.0-alpha.60`
201
+
202
+ - &#8203;<!-- 25 -->[BadgeUnstyled] Make it conformant with other base components (#30141) @mnajdova
203
+
204
+ ### `@mui/icons-material@5.2.4`
205
+
206
+ - &#8203;<!-- 10 -->[icons] Correct location of icon download folder (#29839) @yaboi
207
+
208
+ ### Docs
209
+
210
+ - &#8203;<!-- 22 -->[docs] Explain the use of Select's label in FormControl (#30189) @michaldudak
211
+ - &#8203;<!-- 21 -->[docs] Don't run nprogress on shallow routing (#30087) @Janpot
212
+ - &#8203;<!-- 20 -->[docs] Add Data Driven Forms to related projects (#30078) @rvsia
213
+ - &#8203;<!-- 19 -->[docs] Sync translations with Crowdin (#30067) @l10nbot
214
+ - &#8203;<!-- 18 -->[docs] Fix link on "Custom variables" section in the Theming page #30100 @danilo-leal
215
+ - &#8203;<!-- 17 -->[docs] Fix justifyContent option in the Grid interactive demo (#30117) @danilo-leal
216
+ - &#8203;<!-- 16 -->[docs] Add tip to help access the docs of a previous version when finding answers in StackOverflow (#30101) @danilo-leal
217
+ - &#8203;<!-- 15 -->[docs] Fix import example inside Unstyled Backdrop section (#30098) @TheodosiouTh
218
+ - &#8203;<!-- 01 -->[website] Column pinning and Tree data are out (#30136) @oliviertassinari
219
+ - &#8203;<!-- 07 -->[survey] Remove survey promotion items (#30122) @danilo-leal
220
+
221
+ ### Core
222
+
223
+ - &#8203;<!-- 23 -->[core] Fix link to Open Collective @oliviertassinari
224
+ - &#8203;<!-- 26 -->[core] Update snapshots and s3 fallback (#30134) @Janpot
225
+ - &#8203;<!-- 24 -->[ci] Update CI bucket (#30080) @Janpot
226
+ - &#8203;<!-- 13 -->[fix] size:snapshot for mui-material-next and mui-joy components (#30106) @Janpot
227
+
228
+ All contributors of this release in alphabetical order: @alisasanib, @bryan-hunter, @danilo-leal, @eps1lon, @fmeum, @Janpot, @kkorach, @l10nbot, @ladygo93, @michaldudak, @mnajdova, @oliviertassinari, @Philipp000, @rvsia, @TheodosiouTh, @yaboi
229
+
3
230
  ## 5.2.3
4
231
 
5
232
  <!-- generated comparing v5.2.2..master -->
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { StyledComponentProps } from '@mui/material/styles';
2
+ import { StyledComponentProps } from '../styles';
3
3
 
4
4
  export interface CssBaselineProps extends StyledComponentProps<never> {
5
5
  /**
@@ -1,10 +1,11 @@
1
1
  import { GlobalStylesProps as StyledGlobalStylesProps } from '@mui/system';
2
+ import { Theme } from '../styles';
2
3
 
3
4
  export interface GlobalStylesProps {
4
5
  /**
5
6
  * The styles you want to apply globally.
6
7
  */
7
- styles: StyledGlobalStylesProps['styles'];
8
+ styles: StyledGlobalStylesProps<Theme>['styles'];
8
9
  }
9
10
 
10
11
  /**
package/Grid/Grid.js CHANGED
@@ -28,69 +28,84 @@ function getOffset(val) {
28
28
  return `${parse}${String(val).replace(String(parse), '') || 'px'}`;
29
29
  }
30
30
 
31
- function generateGrid(globalStyles, theme, breakpoint, ownerState) {
32
- const size = ownerState[breakpoint];
33
-
34
- if (!size) {
35
- return;
36
- }
37
-
38
- let styles = {};
39
-
40
- if (size === true) {
41
- // For the auto layouting
42
- styles = {
43
- flexBasis: 0,
44
- flexGrow: 1,
45
- maxWidth: '100%'
46
- };
47
- } else if (size === 'auto') {
48
- styles = {
49
- flexBasis: 'auto',
50
- flexGrow: 0,
51
- flexShrink: 0,
52
- maxWidth: 'none',
53
- width: 'auto'
54
- };
55
- } else {
56
- const columnsBreakpointValues = resolveBreakpointValues({
57
- values: ownerState.columns,
58
- breakpoints: theme.breakpoints.values
59
- });
60
- const columnValue = typeof columnsBreakpointValues === 'object' ? columnsBreakpointValues[breakpoint] : columnsBreakpointValues; // Keep 7 significant numbers.
61
-
62
- const width = `${Math.round(size / columnValue * 10e7) / 10e5}%`;
63
- let more = {};
64
-
65
- if (ownerState.container && ownerState.item && ownerState.columnSpacing !== 0) {
66
- const themeSpacing = theme.spacing(ownerState.columnSpacing);
67
-
68
- if (themeSpacing !== '0px') {
69
- const fullWidth = `calc(${width} + ${getOffset(themeSpacing)})`;
70
- more = {
71
- flexBasis: fullWidth,
72
- maxWidth: fullWidth
73
- };
74
- }
75
- } // Close to the bootstrap implementation:
76
- // https://github.com/twbs/bootstrap/blob/8fccaa2439e97ec72a4b7dc42ccc1f649790adb0/scss/mixins/_grid.scss#L41
31
+ export function generateGrid({
32
+ theme,
33
+ ownerState
34
+ }) {
35
+ let size;
36
+ return theme.breakpoints.keys.reduce((globalStyles, breakpoint) => {
37
+ // Use side effect over immutability for better performance.
38
+ let styles = {};
77
39
 
40
+ if (ownerState[breakpoint]) {
41
+ size = ownerState[breakpoint];
42
+ }
78
43
 
79
- styles = _extends({
80
- flexBasis: width,
81
- flexGrow: 0,
82
- maxWidth: width
83
- }, more);
84
- } // No need for a media query for the first size.
44
+ if (!size) {
45
+ return globalStyles;
46
+ }
85
47
 
48
+ if (size === true) {
49
+ // For the auto layouting
50
+ styles = {
51
+ flexBasis: 0,
52
+ flexGrow: 1,
53
+ maxWidth: '100%'
54
+ };
55
+ } else if (size === 'auto') {
56
+ styles = {
57
+ flexBasis: 'auto',
58
+ flexGrow: 0,
59
+ flexShrink: 0,
60
+ maxWidth: 'none',
61
+ width: 'auto'
62
+ };
63
+ } else {
64
+ const columnsBreakpointValues = resolveBreakpointValues({
65
+ values: ownerState.columns,
66
+ breakpoints: theme.breakpoints.values
67
+ });
68
+ const columnValue = typeof columnsBreakpointValues === 'object' ? columnsBreakpointValues[breakpoint] : columnsBreakpointValues;
69
+
70
+ if (columnValue === undefined || columnValue === null) {
71
+ return globalStyles;
72
+ } // Keep 7 significant numbers.
73
+
74
+
75
+ const width = `${Math.round(size / columnValue * 10e7) / 10e5}%`;
76
+ let more = {};
77
+
78
+ if (ownerState.container && ownerState.item && ownerState.columnSpacing !== 0) {
79
+ const themeSpacing = theme.spacing(ownerState.columnSpacing);
80
+
81
+ if (themeSpacing !== '0px') {
82
+ const fullWidth = `calc(${width} + ${getOffset(themeSpacing)})`;
83
+ more = {
84
+ flexBasis: fullWidth,
85
+ maxWidth: fullWidth
86
+ };
87
+ }
88
+ } // Close to the bootstrap implementation:
89
+ // https://github.com/twbs/bootstrap/blob/8fccaa2439e97ec72a4b7dc42ccc1f649790adb0/scss/mixins/_grid.scss#L41
90
+
91
+
92
+ styles = _extends({
93
+ flexBasis: width,
94
+ flexGrow: 0,
95
+ maxWidth: width
96
+ }, more);
97
+ } // No need for a media query for the first size.
98
+
99
+
100
+ if (theme.breakpoints.values[breakpoint] === 0) {
101
+ Object.assign(globalStyles, styles);
102
+ } else {
103
+ globalStyles[theme.breakpoints.up(breakpoint)] = styles;
104
+ }
86
105
 
87
- if (theme.breakpoints.values[breakpoint] === 0) {
88
- Object.assign(globalStyles, styles);
89
- } else {
90
- globalStyles[theme.breakpoints.up(breakpoint)] = styles;
91
- }
106
+ return globalStyles;
107
+ }, {});
92
108
  }
93
-
94
109
  export function generateDirection({
95
110
  theme,
96
111
  ownerState
@@ -249,14 +264,7 @@ const GridRoot = styled('div', {
249
264
  flexWrap: 'nowrap'
250
265
  }, ownerState.wrap === 'reverse' && {
251
266
  flexWrap: 'wrap-reverse'
252
- }), generateDirection, generateRowGap, generateColumnGap, ({
253
- theme,
254
- ownerState
255
- }) => theme.breakpoints.keys.reduce((globalStyles, breakpoint) => {
256
- // Use side effect over immutability for better performance.
257
- generateGrid(globalStyles, theme, breakpoint, ownerState);
258
- return globalStyles;
259
- }, {}));
267
+ }), generateDirection, generateRowGap, generateColumnGap, generateGrid);
260
268
 
261
269
  const useUtilityClasses = ownerState => {
262
270
  const {
@@ -70,6 +70,12 @@ export interface InputBaseProps
70
70
  * The prop defaults to the value (`false`) inherited from the parent FormControl component.
71
71
  */
72
72
  disabled?: boolean;
73
+ /**
74
+ * If `true`, GlobalStyles for the auto-fill keyframes will not be injected/removed on mount/unmount. Make sure to inject them at the top of your application.
75
+ * This option is intended to help with boosting the initial rendering performance if you are loading a big amount of Input components at once.
76
+ * @default false
77
+ */
78
+ disableInjectingGlobalStyles?: boolean;
73
79
  /**
74
80
  * End `InputAdornment` for this component.
75
81
  */