@mui/material 5.2.3 → 5.2.4

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 (172) 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/autocompleteClasses.d.ts +54 -54
  9. package/Avatar/Avatar.d.ts +1 -1
  10. package/Avatar/avatarClasses.d.ts +20 -20
  11. package/AvatarGroup/avatarGroupClasses.d.ts +10 -10
  12. package/Badge/Badge.js +16 -3
  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/Breadcrumbs.d.ts +1 -1
  17. package/Breadcrumbs/breadcrumbsClasses.d.ts +14 -14
  18. package/Button/buttonClasses.d.ts +76 -76
  19. package/ButtonBase/buttonBaseClasses.d.ts +12 -12
  20. package/ButtonBase/touchRippleClasses.d.ts +20 -20
  21. package/ButtonGroup/ButtonGroupContext.d.ts +18 -18
  22. package/ButtonGroup/buttonGroupClasses.d.ts +58 -58
  23. package/CHANGELOG.md +72 -0
  24. package/Card/cardClasses.d.ts +8 -8
  25. package/CardActionArea/cardActionAreaClasses.d.ts +12 -12
  26. package/CardActions/cardActionsClasses.d.ts +10 -10
  27. package/CardContent/cardContentClasses.d.ts +8 -8
  28. package/CardHeader/cardHeaderClasses.d.ts +18 -18
  29. package/CardMedia/cardMediaClasses.d.ts +12 -12
  30. package/Checkbox/checkboxClasses.d.ts +18 -18
  31. package/Chip/chipClasses.d.ts +80 -80
  32. package/CircularProgress/circularProgressClasses.d.ts +26 -26
  33. package/ClickAwayListener/index.d.ts +2 -2
  34. package/Collapse/collapseClasses.d.ts +18 -18
  35. package/Container/containerClasses.d.ts +22 -22
  36. package/CssBaseline/CssBaseline.d.ts +1 -1
  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/formControlLabelClasses.d.ts +18 -18
  49. package/FormGroup/formGroupClasses.d.ts +10 -10
  50. package/FormHelperText/formHelperTextClasses.d.ts +22 -22
  51. package/FormLabel/formLabelClasses.d.ts +22 -22
  52. package/GlobalStyles/GlobalStyles.d.ts +2 -1
  53. package/Grid/Grid.js +74 -66
  54. package/Grid/gridClasses.d.ts +48 -48
  55. package/Icon/iconClasses.d.ts +24 -24
  56. package/IconButton/iconButtonClasses.d.ts +26 -26
  57. package/ImageList/imageListClasses.d.ts +16 -16
  58. package/ImageListItem/imageListItemClasses.d.ts +18 -18
  59. package/ImageListItemBar/imageListItemBarClasses.d.ts +30 -30
  60. package/Input/inputClasses.d.ts +34 -34
  61. package/InputAdornment/inputAdornmentClasses.d.ts +24 -24
  62. package/InputBase/InputBase.d.ts +6 -0
  63. package/InputBase/InputBase.js +10 -2
  64. package/InputBase/inputBaseClasses.d.ts +44 -44
  65. package/InputLabel/inputLabelClasses.d.ts +32 -32
  66. package/LinearProgress/linearProgressClasses.d.ts +42 -42
  67. package/Link/linkClasses.d.ts +18 -18
  68. package/List/listClasses.d.ts +14 -14
  69. package/ListItem/ListItem.d.ts +1 -1
  70. package/ListItem/listItemClasses.d.ts +30 -30
  71. package/ListItemAvatar/listItemAvatarClasses.d.ts +10 -10
  72. package/ListItemButton/ListItemButton.d.ts +1 -1
  73. package/ListItemButton/listItemButtonClasses.d.ts +22 -22
  74. package/ListItemIcon/listItemIconClasses.d.ts +10 -10
  75. package/ListItemSecondaryAction/listItemSecondaryActionClasses.d.ts +10 -10
  76. package/ListItemText/listItemTextClasses.d.ts +18 -18
  77. package/ListSubheader/listSubheaderClasses.d.ts +18 -18
  78. package/Menu/menuClasses.d.ts +12 -12
  79. package/MenuItem/MenuItem.d.ts +1 -1
  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/OutlinedInput.js +14 -1
  84. package/OutlinedInput/outlinedInputClasses.d.ts +36 -36
  85. package/Pagination/paginationClasses.d.ts +14 -14
  86. package/PaginationItem/paginationItemClasses.d.ts +42 -42
  87. package/Paper/paperClasses.d.ts +39 -39
  88. package/Popover/popoverClasses.d.ts +10 -10
  89. package/Popper/Popper.d.ts +17 -17
  90. package/Radio/radioClasses.d.ts +16 -16
  91. package/RadioGroup/RadioGroupContext.d.ts +11 -11
  92. package/RadioGroup/useRadioGroup.d.ts +4 -4
  93. package/Rating/ratingClasses.d.ts +40 -40
  94. package/ScopedCssBaseline/scopedCssBaselineClasses.d.ts +8 -8
  95. package/Select/SelectInput.js +11 -3
  96. package/Select/selectClasses.d.ts +30 -30
  97. package/Skeleton/skeletonClasses.d.ts +24 -24
  98. package/Snackbar/snackbarClasses.d.ts +20 -20
  99. package/SnackbarContent/snackbarContentClasses.d.ts +12 -12
  100. package/SpeedDial/speedDialClasses.d.ts +22 -22
  101. package/SpeedDialAction/speedDialActionClasses.d.ts +20 -20
  102. package/SpeedDialIcon/speedDialIconClasses.d.ts +18 -18
  103. package/Step/stepClasses.d.ts +16 -16
  104. package/StepButton/stepButtonClasses.d.ts +14 -14
  105. package/StepConnector/stepConnectorClasses.d.ts +26 -26
  106. package/StepContent/stepContentClasses.d.ts +12 -12
  107. package/StepIcon/stepIconClasses.d.ts +16 -16
  108. package/StepLabel/stepLabelClasses.d.ts +28 -28
  109. package/Stepper/stepperClasses.d.ts +14 -14
  110. package/SvgIcon/svgIconClasses.d.ts +24 -24
  111. package/Switch/switchClasses.d.ts +32 -32
  112. package/Tab/tabClasses.d.ts +26 -26
  113. package/TabScrollButton/tabScrollButtonClasses.d.ts +12 -12
  114. package/Table/tableClasses.d.ts +10 -10
  115. package/TableBody/tableBodyClasses.d.ts +8 -8
  116. package/TableCell/tableCellClasses.d.ts +32 -32
  117. package/TableContainer/tableContainerClasses.d.ts +8 -8
  118. package/TableFooter/tableFooterClasses.d.ts +8 -8
  119. package/TableHead/tableHeadClasses.d.ts +8 -8
  120. package/TablePagination/tablePaginationClasses.d.ts +28 -28
  121. package/TableRow/tableRowClasses.d.ts +16 -16
  122. package/TableSortLabel/tableSortLabelClasses.d.ts +16 -16
  123. package/Tabs/tabsClasses.d.ts +32 -32
  124. package/TextField/TextField.js +2 -9
  125. package/TextField/textFieldClasses.d.ts +8 -8
  126. package/ToggleButton/toggleButtonClasses.d.ts +24 -24
  127. package/ToggleButtonGroup/toggleButtonGroupClasses.d.ts +18 -18
  128. package/Toolbar/toolbarClasses.d.ts +14 -14
  129. package/Tooltip/tooltipClasses.d.ts +30 -30
  130. package/Typography/typographyClasses.d.ts +50 -50
  131. package/darkScrollbar/index.d.ts +28 -28
  132. package/index.js +1 -1
  133. package/internal/switchBaseClasses.d.ts +12 -12
  134. package/legacy/Badge/Badge.js +18 -4
  135. package/legacy/BottomNavigation/BottomNavigation.js +0 -0
  136. package/legacy/Grid/Grid.js +84 -78
  137. package/legacy/InputBase/InputBase.js +10 -2
  138. package/legacy/OutlinedInput/OutlinedInput.js +14 -1
  139. package/legacy/Select/SelectInput.js +11 -5
  140. package/legacy/TextField/TextField.js +2 -9
  141. package/legacy/index.js +1 -1
  142. package/locale/index.d.ts +66 -66
  143. package/modern/Badge/Badge.js +16 -3
  144. package/modern/BottomNavigation/BottomNavigation.js +0 -0
  145. package/modern/Grid/Grid.js +74 -66
  146. package/modern/InputBase/InputBase.js +10 -2
  147. package/modern/OutlinedInput/OutlinedInput.js +14 -1
  148. package/modern/Select/SelectInput.js +11 -3
  149. package/modern/TextField/TextField.js +2 -7
  150. package/modern/index.js +1 -1
  151. package/node/Badge/Badge.js +16 -3
  152. package/node/BottomNavigation/BottomNavigation.js +0 -0
  153. package/node/Grid/Grid.js +75 -65
  154. package/node/InputBase/InputBase.js +10 -2
  155. package/node/OutlinedInput/OutlinedInput.js +15 -1
  156. package/node/Select/SelectInput.js +11 -3
  157. package/node/TextField/TextField.js +1 -8
  158. package/node/index.js +1 -1
  159. package/package.json +3 -3
  160. package/styles/createTheme.d.ts +1 -1
  161. package/transitions/index.d.ts +1 -1
  162. package/transitions/transition.d.ts +13 -14
  163. package/transitions/utils.d.ts +23 -23
  164. package/umd/material-ui.development.js +160 -114
  165. package/umd/material-ui.production.min.js +21 -21
  166. package/useMediaQuery/useMediaQuery.d.ts +27 -27
  167. package/useTouchRipple/index.d.ts +1 -1
  168. package/useTouchRipple/useTouchRipple.d.ts +28 -28
  169. package/utils/getScrollbarSize.d.ts +2 -2
  170. package/utils/ownerDocument.d.ts +2 -2
  171. package/utils/ownerWindow.d.ts +2 -2
  172. package/utils/setRef.d.ts +2 -2
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.2.3
1
+ /** @license MUI v5.2.4
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.
package/locale/index.d.ts CHANGED
@@ -1,66 +1,66 @@
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 deDE: Localization;
33
- export declare const elGR: Localization;
34
- export declare const enUS: Localization;
35
- export declare const esES: Localization;
36
- export declare const etEE: Localization;
37
- export declare const faIR: Localization;
38
- export declare const fiFI: Localization;
39
- export declare const frFR: Localization;
40
- export declare const heIL: Localization;
41
- export declare const hiIN: Localization;
42
- export declare const huHU: Localization;
43
- export declare const hyAM: Localization;
44
- export declare const idID: Localization;
45
- export declare const isIS: Localization;
46
- export declare const itIT: Localization;
47
- export declare const jaJP: Localization;
48
- export declare const khKH: Localization;
49
- export declare const koKR: Localization;
50
- export declare const kzKZ: Localization;
51
- export declare const nlNL: Localization;
52
- export declare const plPL: Localization;
53
- export declare const ptBR: Localization;
54
- export declare const ptPT: Localization;
55
- export declare const roRO: Localization;
56
- export declare const ruRU: Localization;
57
- export declare const siLK: Localization;
58
- export declare const skSK: Localization;
59
- export declare const svSE: Localization;
60
- export declare const thTH: Localization;
61
- export declare const trTR: Localization;
62
- export declare const ukUA: Localization;
63
- export declare const viVN: Localization;
64
- export declare const zhCN: Localization;
65
- export declare const zhHK: Localization;
66
- 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 deDE: Localization;
33
+ export declare const elGR: Localization;
34
+ export declare const enUS: Localization;
35
+ export declare const esES: Localization;
36
+ export declare const etEE: Localization;
37
+ export declare const faIR: Localization;
38
+ export declare const fiFI: Localization;
39
+ export declare const frFR: Localization;
40
+ export declare const heIL: Localization;
41
+ export declare const hiIN: Localization;
42
+ export declare const huHU: Localization;
43
+ export declare const hyAM: Localization;
44
+ export declare const idID: Localization;
45
+ export declare const isIS: Localization;
46
+ export declare const itIT: Localization;
47
+ export declare const jaJP: Localization;
48
+ export declare const khKH: Localization;
49
+ export declare const koKR: Localization;
50
+ export declare const kzKZ: Localization;
51
+ export declare const nlNL: Localization;
52
+ export declare const plPL: Localization;
53
+ export declare const ptBR: Localization;
54
+ export declare const ptPT: Localization;
55
+ export declare const roRO: Localization;
56
+ export declare const ruRU: Localization;
57
+ export declare const siLK: Localization;
58
+ export declare const skSK: Localization;
59
+ export declare const svSE: Localization;
60
+ export declare const thTH: Localization;
61
+ export declare const trTR: Localization;
62
+ export declare const ukUA: Localization;
63
+ export declare const viVN: Localization;
64
+ export declare const zhCN: Localization;
65
+ export declare const zhHK: Localization;
66
+ export declare const zhTW: Localization;
@@ -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 = ["component", "components", "componentsProps", "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';
@@ -149,6 +149,11 @@ const BadgeBadge = styled('span', {
149
149
  duration: theme.transitions.duration.leavingScreen
150
150
  })
151
151
  }));
152
+
153
+ const shouldSpreadAdditionalProps = Slot => {
154
+ return !Slot || !isHostComponent(Slot);
155
+ };
156
+
152
157
  const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
153
158
  const props = useThemeProps({
154
159
  props: inProps,
@@ -156,6 +161,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
156
161
  });
157
162
 
158
163
  const {
164
+ component = 'span',
159
165
  components = {},
160
166
  componentsProps = {},
161
167
  color: colorProp = 'default',
@@ -196,12 +202,13 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
196
202
  Badge: BadgeBadge
197
203
  }, components),
198
204
  componentsProps: {
199
- root: _extends({}, componentsProps.root, (!components.Root || !isHostComponent(components.Root)) && {
205
+ root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
206
+ as: component,
200
207
  ownerState: _extends({}, componentsProps.root?.ownerState, {
201
208
  color
202
209
  })
203
210
  }),
204
- badge: _extends({}, componentsProps.badge, (!components.Thumb || !isHostComponent(components.Thumb)) && {
211
+ badge: _extends({}, componentsProps.badge, shouldSpreadAdditionalProps(components.Badge) && {
205
212
  ownerState: _extends({}, componentsProps.badge?.ownerState, {
206
213
  color
207
214
  })
@@ -254,6 +261,12 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
254
261
  /* @typescript-to-proptypes-ignore */
255
262
  .oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),
256
263
 
264
+ /**
265
+ * The component used for the root node.
266
+ * Either a string to use a HTML element or a component.
267
+ */
268
+ component: PropTypes.elementType,
269
+
257
270
  /**
258
271
  * The components used for each slot inside the Badge.
259
272
  * Either a string to use a HTML element or a component.
File without changes
@@ -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 {
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
4
- const _excluded = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "startAdornment", "type", "value"];
4
+ const _excluded = ["aria-describedby", "autoComplete", "autoFocus", "className", "color", "components", "componentsProps", "defaultValue", "disabled", "disableInjectingGlobalStyles", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "maxRows", "minRows", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "size", "startAdornment", "type", "value"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import clsx from 'clsx';
@@ -220,6 +220,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
220
220
  componentsProps = {},
221
221
  defaultValue,
222
222
  disabled,
223
+ disableInjectingGlobalStyles,
223
224
  endAdornment,
224
225
  fullWidth = false,
225
226
  id,
@@ -450,7 +451,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
450
451
  const Input = components.Input || InputBaseComponent;
451
452
  inputProps = _extends({}, inputProps, componentsProps.input);
452
453
  return /*#__PURE__*/_jsxs(React.Fragment, {
453
- children: [inputGlobalStyles, /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, !isHostComponent(Root) && {
454
+ children: [!disableInjectingGlobalStyles && inputGlobalStyles, /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, !isHostComponent(Root) && {
454
455
  ownerState: _extends({}, ownerState, rootProps.ownerState)
455
456
  }, {
456
457
  ref: ref,
@@ -564,6 +565,13 @@ process.env.NODE_ENV !== "production" ? InputBase.propTypes
564
565
  */
565
566
  disabled: PropTypes.bool,
566
567
 
568
+ /**
569
+ * 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.
570
+ * This option is intended to help with boosting the initial rendering performance if you are loading a big amount of Input components at once.
571
+ * @default false
572
+ */
573
+ disableInjectingGlobalStyles: PropTypes.bool,
574
+
567
575
  /**
568
576
  * End `InputAdornment` for this component.
569
577
  */
@@ -6,10 +6,13 @@ import PropTypes from 'prop-types';
6
6
  import { refType } from '@mui/utils';
7
7
  import { unstable_composeClasses as composeClasses } from '@mui/base';
8
8
  import NotchedOutline from './NotchedOutline';
9
+ import useFormControl from '../FormControl/useFormControl';
10
+ import formControlState from '../FormControl/formControlState';
9
11
  import styled, { rootShouldForwardProp } from '../styles/styled';
10
12
  import outlinedInputClasses, { getOutlinedInputUtilityClass } from './outlinedInputClasses';
11
13
  import InputBase, { rootOverridesResolver as inputBaseRootOverridesResolver, inputOverridesResolver as inputBaseInputOverridesResolver, InputBaseRoot, InputBaseComponent as InputBaseInput } from '../InputBase/InputBase';
12
14
  import useThemeProps from '../styles/useThemeProps';
15
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
16
  import { jsx as _jsx } from "react/jsx-runtime";
14
17
 
15
18
  const useUtilityClasses = ownerState => {
@@ -101,6 +104,8 @@ const OutlinedInputInput = styled(InputBaseInput, {
101
104
  paddingRight: 0
102
105
  }));
103
106
  const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inProps, ref) {
107
+ var _React$Fragment;
108
+
104
109
  const props = useThemeProps({
105
110
  props: inProps,
106
111
  name: 'MuiOutlinedInput'
@@ -118,6 +123,12 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
118
123
  other = _objectWithoutPropertiesLoose(props, _excluded);
119
124
 
120
125
  const classes = useUtilityClasses(props);
126
+ const muiFormControl = useFormControl();
127
+ const fcs = formControlState({
128
+ props,
129
+ muiFormControl,
130
+ states: ['required']
131
+ });
121
132
  return /*#__PURE__*/_jsx(InputBase, _extends({
122
133
  components: _extends({
123
134
  Root: OutlinedInputRoot,
@@ -125,7 +136,9 @@ const OutlinedInput = /*#__PURE__*/React.forwardRef(function OutlinedInput(inPro
125
136
  }, components),
126
137
  renderSuffix: state => /*#__PURE__*/_jsx(NotchedOutlineRoot, {
127
138
  className: classes.notchedOutline,
128
- label: label,
139
+ label: label && fcs.required ? _React$Fragment || (_React$Fragment = /*#__PURE__*/_jsxs(React.Fragment, {
140
+ children: [label, "\xA0", '*']
141
+ })) : label,
129
142
  notched: typeof notched !== 'undefined' ? notched : Boolean(state.startAdornment || state.filled || state.focused)
130
143
  }),
131
144
  fullWidth: fullWidth,
@@ -405,10 +405,18 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
405
405
 
406
406
  if (computeDisplay) {
407
407
  if (multiple) {
408
- if (value.length === 0) {
409
- display = '';
408
+ if (displayMultiple.length === 0) {
409
+ display = null;
410
410
  } else {
411
- display = displayMultiple.reduce((prev, curr) => [prev, ', ', curr]);
411
+ display = displayMultiple.reduce((output, child, index) => {
412
+ output.push(child);
413
+
414
+ if (index < displayMultiple.length - 1) {
415
+ output.push(', ');
416
+ }
417
+
418
+ return output;
419
+ }, []);
412
420
  }
413
421
  } else {
414
422
  display = displaySingle;
@@ -16,8 +16,8 @@ import FormControl from '../FormControl';
16
16
  import FormHelperText from '../FormHelperText';
17
17
  import Select from '../Select';
18
18
  import { getTextFieldUtilityClass } from './textFieldClasses';
19
- import { jsxs as _jsxs } from "react/jsx-runtime";
20
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
+ import { jsxs as _jsxs } from "react/jsx-runtime";
21
21
  const variantComponent = {
22
22
  standard: Input,
23
23
  filled: FilledInput,
@@ -141,12 +141,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
141
141
  InputMore.notched = InputLabelProps.shrink;
142
142
  }
143
143
 
144
- if (label) {
145
- const displayRequired = InputLabelProps?.required ?? required;
146
- InputMore.label = /*#__PURE__*/_jsxs(React.Fragment, {
147
- children: [label, displayRequired && '\u00a0*']
148
- });
149
- }
144
+ InputMore.label = label;
150
145
  }
151
146
 
152
147
  if (select) {
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.2.3
1
+ /** @license MUI v5.2.4
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.
@@ -31,7 +31,7 @@ var _capitalize = _interopRequireDefault(require("../utils/capitalize"));
31
31
 
32
32
  var _jsxRuntime = require("react/jsx-runtime");
33
33
 
34
- const _excluded = ["components", "componentsProps", "color", "invisible", "badgeContent", "showZero", "variant"];
34
+ const _excluded = ["component", "components", "componentsProps", "color", "invisible", "badgeContent", "showZero", "variant"];
35
35
 
36
36
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
37
 
@@ -176,6 +176,11 @@ const BadgeBadge = (0, _styled.default)('span', {
176
176
  duration: theme.transitions.duration.leavingScreen
177
177
  })
178
178
  }));
179
+
180
+ const shouldSpreadAdditionalProps = Slot => {
181
+ return !Slot || !(0, _base.isHostComponent)(Slot);
182
+ };
183
+
179
184
  const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
180
185
  var _componentsProps$root, _componentsProps$badg;
181
186
 
@@ -184,6 +189,7 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
184
189
  name: 'MuiBadge'
185
190
  });
186
191
  const {
192
+ component = 'span',
187
193
  components = {},
188
194
  componentsProps = {},
189
195
  color: colorProp = 'default',
@@ -221,12 +227,13 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
221
227
  Badge: BadgeBadge
222
228
  }, components),
223
229
  componentsProps: {
224
- root: (0, _extends2.default)({}, componentsProps.root, (!components.Root || !(0, _base.isHostComponent)(components.Root)) && {
230
+ root: (0, _extends2.default)({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {
231
+ as: component,
225
232
  ownerState: (0, _extends2.default)({}, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.ownerState, {
226
233
  color
227
234
  })
228
235
  }),
229
- badge: (0, _extends2.default)({}, componentsProps.badge, (!components.Thumb || !(0, _base.isHostComponent)(components.Thumb)) && {
236
+ badge: (0, _extends2.default)({}, componentsProps.badge, shouldSpreadAdditionalProps(components.Badge) && {
230
237
  ownerState: (0, _extends2.default)({}, (_componentsProps$badg = componentsProps.badge) == null ? void 0 : _componentsProps$badg.ownerState, {
231
238
  color
232
239
  })
@@ -279,6 +286,12 @@ process.env.NODE_ENV !== "production" ? Badge.propTypes
279
286
  /* @typescript-to-proptypes-ignore */
280
287
  .oneOfType([_propTypes.default.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), _propTypes.default.string]),
281
288
 
289
+ /**
290
+ * The component used for the root node.
291
+ * Either a string to use a HTML element or a component.
292
+ */
293
+ component: _propTypes.default.elementType,
294
+
282
295
  /**
283
296
  * The components used for each slot inside the Badge.
284
297
  * Either a string to use a HTML element or a component.
File without changes