@mui/material 6.0.0-beta.5 → 6.0.0-beta.6

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 (101) hide show
  1. package/Autocomplete/Autocomplete.js +1 -1
  2. package/Breadcrumbs/Breadcrumbs.js +1 -1
  3. package/CHANGELOG.md +69 -0
  4. package/CardHeader/CardHeader.js +9 -5
  5. package/DialogContentText/DialogContentText.js +1 -1
  6. package/Divider/Divider.js +3 -2
  7. package/FormControlLabel/FormControlLabel.js +1 -3
  8. package/IconButton/IconButton.js +3 -0
  9. package/InputAdornment/InputAdornment.js +1 -1
  10. package/Link/Link.js +39 -4
  11. package/Link/getTextDecoration.d.ts +1 -2
  12. package/Link/getTextDecoration.js +1 -19
  13. package/ListItemText/ListItemText.js +8 -4
  14. package/Slider/useSlider.js +3 -3
  15. package/Typography/Typography.d.ts +21 -2
  16. package/Typography/Typography.js +28 -16
  17. package/index.js +1 -1
  18. package/modern/Autocomplete/Autocomplete.js +1 -1
  19. package/modern/Breadcrumbs/Breadcrumbs.js +1 -1
  20. package/modern/CardHeader/CardHeader.js +9 -5
  21. package/modern/DialogContentText/DialogContentText.js +1 -1
  22. package/modern/Divider/Divider.js +3 -2
  23. package/modern/FormControlLabel/FormControlLabel.js +1 -3
  24. package/modern/IconButton/IconButton.js +3 -0
  25. package/modern/InputAdornment/InputAdornment.js +1 -1
  26. package/modern/Link/Link.js +39 -4
  27. package/modern/Link/getTextDecoration.js +1 -19
  28. package/modern/ListItemText/ListItemText.js +8 -4
  29. package/modern/Slider/useSlider.js +3 -3
  30. package/modern/Typography/Typography.js +28 -16
  31. package/modern/index.js +1 -1
  32. package/modern/styles/createGetSelector.js +8 -2
  33. package/modern/useAutocomplete/useAutocomplete.js +0 -8
  34. package/modern/version/index.js +2 -2
  35. package/node/AppBar/AppBar.js +10 -13
  36. package/node/Autocomplete/Autocomplete.js +4 -7
  37. package/node/AvatarGroup/AvatarGroup.js +1 -2
  38. package/node/Badge/Badge.js +6 -7
  39. package/node/Breadcrumbs/Breadcrumbs.js +1 -1
  40. package/node/Button/Button.js +1 -2
  41. package/node/ButtonBase/TouchRipple.js +4 -4
  42. package/node/CardHeader/CardHeader.js +9 -5
  43. package/node/Checkbox/Checkbox.js +2 -3
  44. package/node/CssBaseline/CssBaseline.js +5 -10
  45. package/node/DialogContentText/DialogContentText.js +1 -1
  46. package/node/DialogTitle/DialogTitle.js +1 -1
  47. package/node/Divider/Divider.js +3 -2
  48. package/node/Fab/Fab.js +87 -90
  49. package/node/FilledInput/FilledInput.js +13 -17
  50. package/node/FormControlLabel/FormControlLabel.js +4 -7
  51. package/node/Grid/Grid.js +2 -4
  52. package/node/IconButton/IconButton.js +3 -0
  53. package/node/Input/Input.js +3 -4
  54. package/node/InputAdornment/InputAdornment.js +1 -1
  55. package/node/InputBase/InputBase.js +1 -2
  56. package/node/Link/Link.js +39 -4
  57. package/node/Link/getTextDecoration.js +2 -20
  58. package/node/ListItemText/ListItemText.js +9 -5
  59. package/node/Menu/Menu.js +2 -3
  60. package/node/Modal/Modal.js +4 -4
  61. package/node/Modal/ModalManager.js +1 -1
  62. package/node/Modal/useModal.js +4 -6
  63. package/node/OutlinedInput/OutlinedInput.js +3 -3
  64. package/node/PaginationItem/PaginationItem.js +4 -5
  65. package/node/Paper/Paper.js +1 -2
  66. package/node/Popover/Popover.js +2 -3
  67. package/node/Popper/BasePopper.js +1 -2
  68. package/node/Popper/Popper.js +2 -3
  69. package/node/Radio/Radio.js +2 -3
  70. package/node/ScopedCssBaseline/ScopedCssBaseline.js +2 -4
  71. package/node/Select/SelectInput.js +2 -3
  72. package/node/Slider/Slider.js +20 -21
  73. package/node/Slider/useSlider.js +17 -29
  74. package/node/Snackbar/useSnackbar.js +7 -7
  75. package/node/StepLabel/StepLabel.js +1 -1
  76. package/node/SvgIcon/SvgIcon.js +75 -81
  77. package/node/SwipeableDrawer/SwipeableDrawer.js +1 -2
  78. package/node/TabScrollButton/TabScrollButton.js +2 -3
  79. package/node/TablePagination/TablePagination.js +1 -2
  80. package/node/TablePagination/TablePaginationActions.js +10 -11
  81. package/node/Tabs/Tabs.js +5 -8
  82. package/node/Tooltip/Tooltip.js +13 -15
  83. package/node/Typography/Typography.js +28 -16
  84. package/node/Unstable_TrapFocus/FocusTrap.js +1 -2
  85. package/node/index.js +1 -1
  86. package/node/styles/createGetSelector.js +9 -3
  87. package/node/styles/createTheme.js +2 -2
  88. package/node/styles/createThemeNoVars.js +1 -1
  89. package/node/styles/createThemeWithVars.js +5 -7
  90. package/node/styles/shouldSkipGeneratingVar.js +1 -2
  91. package/node/transitions/utils.js +2 -3
  92. package/node/useAutocomplete/useAutocomplete.js +3 -18
  93. package/node/useLazyRipple/useLazyRipple.js +3 -12
  94. package/node/utils/useSlot.js +1 -1
  95. package/node/version/index.js +2 -2
  96. package/package.json +11 -11
  97. package/styles/createGetSelector.d.ts +5 -3
  98. package/styles/createGetSelector.js +8 -2
  99. package/useAutocomplete/useAutocomplete.d.ts +2 -2
  100. package/useAutocomplete/useAutocomplete.js +0 -8
  101. package/version/index.js +2 -2
@@ -164,6 +164,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
164
164
  color = 'default',
165
165
  disabled = false,
166
166
  disableFocusRipple = false,
167
+ disableRipple = false,
167
168
  size = 'medium',
168
169
  ...other
169
170
  } = props;
@@ -173,6 +174,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
173
174
  color,
174
175
  disabled,
175
176
  disableFocusRipple,
177
+ disableRipple,
176
178
  size
177
179
  };
178
180
  const classes = useUtilityClasses(ownerState);
@@ -181,6 +183,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
181
183
  centerRipple: true,
182
184
  focusRipple: !disableFocusRipple,
183
185
  disabled: disabled,
186
+ disableRipple: disableRipple,
184
187
  ref: ref,
185
188
  ...other,
186
189
  ownerState: ownerState,
@@ -122,7 +122,7 @@ const InputAdornment = /*#__PURE__*/React.forwardRef(function InputAdornment(inP
122
122
  ref: ref,
123
123
  ...other,
124
124
  children: typeof children === 'string' && !disableTypography ? /*#__PURE__*/_jsx(Typography, {
125
- color: "text.secondary",
125
+ color: "textSecondary",
126
126
  children: children
127
127
  }) : /*#__PURE__*/_jsxs(React.Fragment, {
128
128
  children: [position === 'start' ? ( /* notranslate needed while Google Translate will not fix zero-width space issue */_span || (_span = /*#__PURE__*/_jsx("span", {
@@ -12,8 +12,19 @@ import { styled, useTheme } from '../zero-styled';
12
12
  import { useDefaultProps } from '../DefaultPropsProvider';
13
13
  import Typography from '../Typography';
14
14
  import linkClasses, { getLinkUtilityClass } from './linkClasses';
15
- import getTextDecoration, { colorTransformations } from './getTextDecoration';
15
+ import getTextDecoration from './getTextDecoration';
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
+ const v6Colors = {
18
+ primary: true,
19
+ secondary: true,
20
+ error: true,
21
+ info: true,
22
+ success: true,
23
+ warning: true,
24
+ textPrimary: true,
25
+ textSecondary: true,
26
+ textDisabled: true
27
+ };
17
28
  const useUtilityClasses = ownerState => {
18
29
  const {
19
30
  classes,
@@ -83,6 +94,30 @@ const LinkRoot = styled(Typography, {
83
94
  '--Link-underlineColor': theme.vars ? `rgba(${theme.vars.palette[color].mainChannel} / 0.4)` : alpha(theme.palette[color].main, 0.4)
84
95
  }
85
96
  })), {
97
+ props: {
98
+ underline: 'always',
99
+ color: 'textPrimary'
100
+ },
101
+ style: {
102
+ '--Link-underlineColor': theme.vars ? `rgba(${theme.vars.palette.text.primaryChannel} / 0.4)` : alpha(theme.palette.text.primary, 0.4)
103
+ }
104
+ }, {
105
+ props: {
106
+ underline: 'always',
107
+ color: 'textSecondary'
108
+ },
109
+ style: {
110
+ '--Link-underlineColor': theme.vars ? `rgba(${theme.vars.palette.text.secondaryChannel} / 0.4)` : alpha(theme.palette.text.secondary, 0.4)
111
+ }
112
+ }, {
113
+ props: {
114
+ underline: 'always',
115
+ color: 'textDisabled'
116
+ },
117
+ style: {
118
+ '--Link-underlineColor': (theme.vars || theme).palette.text.disabled
119
+ }
120
+ }, {
86
121
  props: {
87
122
  component: 'button'
88
123
  },
@@ -171,12 +206,12 @@ const Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {
171
206
  ownerState: ownerState,
172
207
  variant: variant,
173
208
  ...other,
174
- sx: [...(colorTransformations[color] === undefined ? [{
209
+ sx: [...(v6Colors[color] === undefined ? [{
175
210
  color
176
211
  }] : []), ...(Array.isArray(sx) ? sx : [sx])],
177
212
  style: {
178
213
  ...other.style,
179
- ...(underline === 'always' && color !== 'inherit' && {
214
+ ...(underline === 'always' && color !== 'inherit' && !v6Colors[color] && {
180
215
  '--Link-underlineColor': getTextDecoration({
181
216
  theme,
182
217
  ownerState
@@ -206,7 +241,7 @@ process.env.NODE_ENV !== "production" ? Link.propTypes /* remove-proptypes */ =
206
241
  * The color of the link.
207
242
  * @default 'primary'
208
243
  */
209
- color: PropTypes /* @typescript-to-proptypes-ignore */.any,
244
+ color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['primary', 'secondary', 'success', 'error', 'info', 'warning', 'textPrimary', 'textSecondary', 'textDisabled']), PropTypes.string]),
210
245
  /**
211
246
  * The component used for the root node.
212
247
  * Either a string to use a HTML element or a component.
@@ -1,28 +1,10 @@
1
1
  import { getPath } from '@mui/system/style';
2
2
  import { alpha } from '@mui/system/colorManipulator';
3
- // TODO v7: remove this transformation
4
- export const colorTransformations = {
5
- textPrimary: 'text.primary',
6
- textSecondary: 'text.secondary',
7
- // For main palette, the color will be applied by the styles above.
8
- primary: null,
9
- secondary: null,
10
- error: null,
11
- info: null,
12
- success: null,
13
- warning: null
14
- };
15
3
  const getTextDecoration = ({
16
4
  theme,
17
5
  ownerState
18
6
  }) => {
19
- let transformedColor = colorTransformations[ownerState.color];
20
- if (transformedColor === null) {
21
- return null;
22
- }
23
- if (transformedColor === undefined) {
24
- transformedColor = ownerState.color;
25
- }
7
+ const transformedColor = ownerState.color;
26
8
  const color = getPath(theme, `palette.${transformedColor}`, false) || ownerState.color;
27
9
  const channelColor = getPath(theme, `palette.${transformedColor}Channel`);
28
10
  if ('vars' in theme && channelColor) {
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import clsx from 'clsx';
6
6
  import composeClasses from '@mui/utils/composeClasses';
7
- import Typography from '../Typography';
7
+ import Typography, { typographyClasses } from '../Typography';
8
8
  import ListContext from '../List/ListContext';
9
9
  import { styled } from '../zero-styled';
10
10
  import { useDefaultProps } from '../DefaultPropsProvider';
@@ -43,6 +43,12 @@ const ListItemTextRoot = styled('div', {
43
43
  minWidth: 0,
44
44
  marginTop: 4,
45
45
  marginBottom: 4,
46
+ [`.${typographyClasses.root}:where(& .${listItemTextClasses.primary})`]: {
47
+ display: 'block'
48
+ },
49
+ [`.${typographyClasses.root}:where(& .${listItemTextClasses.secondary})`]: {
50
+ display: 'block'
51
+ },
46
52
  variants: [{
47
53
  props: ({
48
54
  ownerState
@@ -95,7 +101,6 @@ const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps
95
101
  variant: dense ? 'body2' : 'body1',
96
102
  className: classes.primary,
97
103
  component: primaryTypographyProps?.variant ? undefined : 'span',
98
- display: "block",
99
104
  ...primaryTypographyProps,
100
105
  children: primary
101
106
  });
@@ -104,8 +109,7 @@ const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps
104
109
  secondary = /*#__PURE__*/_jsx(Typography, {
105
110
  variant: "body2",
106
111
  className: classes.secondary,
107
- color: "text.secondary",
108
- display: "block",
112
+ color: "textSecondary",
109
113
  ...secondaryTypographyProps,
110
114
  children: secondary
111
115
  });
@@ -177,7 +177,7 @@ export function useSlider(parameters) {
177
177
  tabIndex,
178
178
  value: valueProp
179
179
  } = parameters;
180
- const touchId = React.useRef();
180
+ const touchId = React.useRef(undefined);
181
181
  // We can't use the :active browser pseudo-classes.
182
182
  // - The active state isn't triggered when clicking on the rail.
183
183
  // - The active state isn't transferred when inversing a range slider.
@@ -215,7 +215,7 @@ export function useSlider(parameters) {
215
215
  })) : marksProp || [];
216
216
  const marksValues = marks.map(mark => mark.value);
217
217
  const [focusedThumbIndex, setFocusedThumbIndex] = React.useState(-1);
218
- const sliderRef = React.useRef();
218
+ const sliderRef = React.useRef(null);
219
219
  const handleRef = useForkRef(ref, sliderRef);
220
220
  const createHandleHiddenInputFocus = otherHandlers => event => {
221
221
  const index = Number(event.currentTarget.getAttribute('data-index'));
@@ -318,7 +318,7 @@ export function useSlider(parameters) {
318
318
  // @ts-ignore
319
319
  changeValue(event, event.target.valueAsNumber);
320
320
  };
321
- const previousIndex = React.useRef();
321
+ const previousIndex = React.useRef(undefined);
322
322
  let axis = orientation;
323
323
  if (isRtl && orientation === 'horizontal') {
324
324
  axis += '-reverse';
@@ -9,6 +9,17 @@ import { useDefaultProps } from '../DefaultPropsProvider';
9
9
  import capitalize from '../utils/capitalize';
10
10
  import { getTypographyUtilityClass } from './typographyClasses';
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
+ const v6Colors = {
13
+ primary: true,
14
+ secondary: true,
15
+ error: true,
16
+ info: true,
17
+ success: true,
18
+ warning: true,
19
+ textPrimary: true,
20
+ textSecondary: true,
21
+ textDisabled: true
22
+ };
12
23
  const extendSxProp = internal_createExtendSxProp();
13
24
  const useUtilityClasses = ownerState => {
14
25
  const {
@@ -59,6 +70,13 @@ export const TypographyRoot = styled('span', {
59
70
  style: {
60
71
  color: (theme.vars || theme).palette[color].main
61
72
  }
73
+ })), ...Object.entries(theme.palette?.text || {}).filter(([, value]) => typeof value === 'string').map(([color]) => ({
74
+ props: {
75
+ color: `text${capitalize(color)}`
76
+ },
77
+ style: {
78
+ color: (theme.vars || theme).palette.text[color]
79
+ }
62
80
  })), {
63
81
  props: ({
64
82
  ownerState
@@ -104,19 +122,6 @@ const defaultVariantMapping = {
104
122
  body2: 'p',
105
123
  inherit: 'p'
106
124
  };
107
-
108
- // TODO v7: remove this transformation and `extendSxProp`
109
- const colorTransformations = {
110
- textPrimary: 'text.primary',
111
- textSecondary: 'text.secondary',
112
- // For the main palette, the color will be applied by the `...Object.entries(theme.palette)` clause in the TypographyRoot's styles
113
- primary: null,
114
- secondary: null,
115
- error: null,
116
- info: null,
117
- success: null,
118
- warning: null
119
- };
120
125
  const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, ref) {
121
126
  const {
122
127
  color,
@@ -125,11 +130,12 @@ const Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, re
125
130
  props: inProps,
126
131
  name: 'MuiTypography'
127
132
  });
128
- const textColor = colorTransformations[color];
133
+ const isSxColor = !v6Colors[color];
134
+ // TODO: Remove `extendSxProp` in v7
129
135
  const props = extendSxProp({
130
136
  ...themeProps,
131
- ...(textColor !== null && {
132
- color: textColor || color
137
+ ...(isSxColor && {
138
+ color
133
139
  })
134
140
  });
135
141
  const {
@@ -193,6 +199,12 @@ process.env.NODE_ENV !== "production" ? Typography.propTypes /* remove-proptypes
193
199
  * @ignore
194
200
  */
195
201
  className: PropTypes.string,
202
+ /**
203
+ * The color of the component.
204
+ * It supports both default and custom theme colors, which can be added as shown in the
205
+ * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
206
+ */
207
+ color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['primary', 'secondary', 'success', 'error', 'info', 'warning', 'textPrimary', 'textSecondary', 'textDisabled']), PropTypes.string]),
196
208
  /**
197
209
  * The component used for the root node.
198
210
  * Either a string to use a HTML element or a component.
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.0.0-beta.5
2
+ * @mui/material v6.0.0-beta.6
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -22,7 +22,9 @@ export default (theme => (colorScheme, css) => {
22
22
  if (rule === 'media') {
23
23
  return {
24
24
  ':root': css,
25
- '@media (prefers-color-scheme: dark) { :root': excludedVariables
25
+ [`@media (prefers-color-scheme: dark)`]: {
26
+ ':root': excludedVariables
27
+ }
26
28
  };
27
29
  }
28
30
  if (rule) {
@@ -43,7 +45,11 @@ export default (theme => (colorScheme, css) => {
43
45
  }
44
46
  } else if (colorScheme) {
45
47
  if (rule === 'media') {
46
- return `@media (prefers-color-scheme: ${String(colorScheme)}) { :root`;
48
+ return {
49
+ [`@media (prefers-color-scheme: ${String(colorScheme)})`]: {
50
+ ':root': css
51
+ }
52
+ };
47
53
  }
48
54
  if (rule) {
49
55
  return rule.replace('%s', String(colorScheme));
@@ -187,14 +187,6 @@ function useAutocomplete(props) {
187
187
  resetInputValue(null, value, 'reset');
188
188
  }, [value, resetInputValue, focused, previousProps.value, freeSolo]);
189
189
  const listboxAvailable = open && filteredOptions.length > 0 && !readOnly;
190
- if (process.env.NODE_ENV !== 'production') {
191
- if (value !== null && !freeSolo && options.length > 0) {
192
- const missingValue = (multiple ? value : [value]).filter(value2 => !options.some(option => isOptionEqualToValue(option, value2)));
193
- if (missingValue.length > 0) {
194
- console.warn([`MUI: The value provided to ${componentName} is invalid.`, `None of the options match with \`${missingValue.length > 1 ? JSON.stringify(missingValue) : JSON.stringify(missingValue[0])}\`.`, 'You can use the `isOptionEqualToValue` prop to customize the equality test.'].join('\n'));
195
- }
196
- }
197
- }
198
190
  const focusTag = useEventCallback(tagToFocus => {
199
191
  if (tagToFocus === -1) {
200
192
  inputRef.current.focus();
@@ -1,7 +1,7 @@
1
- export const version = "6.0.0-beta.5";
1
+ export const version = "6.0.0-beta.6";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("0");
4
4
  export const patch = Number("0");
5
5
  export const preReleaseLabel = "beta" || null;
6
- export const preReleaseNumber = Number("5") || null;
6
+ export const preReleaseNumber = Number("6") || null;
7
7
  export default version;
@@ -32,7 +32,7 @@ const useUtilityClasses = ownerState => {
32
32
 
33
33
  // var2 is the fallback.
34
34
  // Ex. var1: 'var(--a)', var2: 'var(--b)'; return: 'var(--a, var(--b))'
35
- const joinVars = (var1, var2) => var1 ? `${var1 == null ? void 0 : var1.replace(')', '')}, ${var2})` : var2;
35
+ const joinVars = (var1, var2) => var1 ? `${var1?.replace(')', '')}, ${var2})` : var2;
36
36
  const AppBarRoot = (0, _zeroStyled.styled)(_Paper.default, {
37
37
  name: 'MuiAppBar',
38
38
  slot: 'Root',
@@ -121,18 +121,15 @@ const AppBarRoot = (0, _zeroStyled.styled)(_Paper.default, {
121
121
  '--AppBar-color': theme.vars ? theme.vars.palette.text.primary : theme.palette.getContrastText(theme.palette.grey[900])
122
122
  })
123
123
  }
124
- }, ...Object.entries(theme.palette).filter(([, palette]) => palette && palette.main && palette.contrastText).map(([color]) => {
125
- var _theme$vars, _theme$vars2;
126
- return {
127
- props: {
128
- color
129
- },
130
- style: {
131
- '--AppBar-background': ((_theme$vars = theme.vars) != null ? _theme$vars : theme).palette[color].main,
132
- '--AppBar-color': ((_theme$vars2 = theme.vars) != null ? _theme$vars2 : theme).palette[color].contrastText
133
- }
134
- };
135
- }), {
124
+ }, ...Object.entries(theme.palette).filter(([, palette]) => palette && palette.main && palette.contrastText).map(([color]) => ({
125
+ props: {
126
+ color
127
+ },
128
+ style: {
129
+ '--AppBar-background': (theme.vars ?? theme).palette[color].main,
130
+ '--AppBar-color': (theme.vars ?? theme).palette[color].contrastText
131
+ }
132
+ })), {
136
133
  props: props => props.enableColorOnDark === true && !['inherit', 'transparent'].includes(props.color),
137
134
  style: {
138
135
  backgroundColor: 'var(--AppBar-background)',
@@ -525,10 +525,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
525
525
  ref: listboxRef,
526
526
  ...otherListboxProps
527
527
  } = getListboxProps();
528
- const defaultGetOptionLabel = option => {
529
- var _option$label;
530
- return (_option$label = option.label) != null ? _option$label : option;
531
- };
528
+ const defaultGetOptionLabel = option => option.label ?? option;
532
529
  const getOptionLabel = getOptionLabelProp || defaultGetOptionLabel;
533
530
 
534
531
  // If you modify this, make sure to keep the `AutocompleteOwnerState` type in sync.
@@ -740,7 +737,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
740
737
  title: clearText,
741
738
  ownerState: ownerState,
742
739
  ...clearIndicatorSlotProps,
743
- className: (0, _clsx.default)(classes.clearIndicator, clearIndicatorSlotProps == null ? void 0 : clearIndicatorSlotProps.className),
740
+ className: (0, _clsx.default)(classes.clearIndicator, clearIndicatorSlotProps?.className),
744
741
  children: clearIcon
745
742
  }) : null, hasPopupIcon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(AutocompletePopupIndicator, {
746
743
  ...getPopupIndicatorProps(),
@@ -749,7 +746,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
749
746
  title: popupOpen ? closeText : openText,
750
747
  ownerState: ownerState,
751
748
  ...popupIndicatorSlotProps,
752
- className: (0, _clsx.default)(classes.popupIndicator, popupIndicatorSlotProps == null ? void 0 : popupIndicatorSlotProps.className),
749
+ className: (0, _clsx.default)(classes.popupIndicator, popupIndicatorSlotProps?.className),
753
750
  children: popupIcon
754
751
  }) : null]
755
752
  })
@@ -1098,7 +1095,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
1098
1095
  */
1099
1096
  openText: _propTypes.default.string,
1100
1097
  /**
1101
- * Array of options.
1098
+ * A list of options that will be shown in the Autocomplete.
1102
1099
  */
1103
1100
  options: _propTypes.default.array.isRequired,
1104
1101
  /**
@@ -56,7 +56,6 @@ const AvatarGroupRoot = (0, _zeroStyled.styled)('div', {
56
56
  }
57
57
  }));
58
58
  const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
59
- var _slotProps$additional;
60
59
  const props = (0, _DefaultPropsProvider.useDefaultProps)({
61
60
  props: inProps,
62
61
  name: 'MuiAvatarGroup'
@@ -104,7 +103,7 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
104
103
  const externalForwardedProps = {
105
104
  slots,
106
105
  slotProps: {
107
- surplus: (_slotProps$additional = slotProps.additionalAvatar) != null ? _slotProps$additional : componentsProps == null ? void 0 : componentsProps.additionalAvatar,
106
+ surplus: slotProps.additionalAvatar ?? componentsProps?.additionalAvatar,
108
107
  ...componentsProps,
109
108
  ...slotProps
110
109
  }
@@ -217,7 +217,6 @@ const BadgeBadge = (0, _zeroStyled.styled)('span', {
217
217
  }]
218
218
  }));
219
219
  const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
220
- var _ref, _slots$root, _ref2, _slots$badge, _slotProps$root, _slotProps$badge;
221
220
  const props = (0, _DefaultPropsProvider.useDefaultProps)({
222
221
  props: inProps,
223
222
  name: 'MuiBadge'
@@ -285,10 +284,10 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
285
284
  const classes = useUtilityClasses(ownerState);
286
285
 
287
286
  // support both `slots` and `components` for backward compatibility
288
- const RootSlot = (_ref = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components.Root) != null ? _ref : BadgeRoot;
289
- const BadgeSlot = (_ref2 = (_slots$badge = slots == null ? void 0 : slots.badge) != null ? _slots$badge : components.Badge) != null ? _ref2 : BadgeBadge;
290
- const rootSlotProps = (_slotProps$root = slotProps == null ? void 0 : slotProps.root) != null ? _slotProps$root : componentsProps.root;
291
- const badgeSlotProps = (_slotProps$badge = slotProps == null ? void 0 : slotProps.badge) != null ? _slotProps$badge : componentsProps.badge;
287
+ const RootSlot = slots?.root ?? components.Root ?? BadgeRoot;
288
+ const BadgeSlot = slots?.badge ?? components.Badge ?? BadgeBadge;
289
+ const rootSlotProps = slotProps?.root ?? componentsProps.root;
290
+ const badgeSlotProps = slotProps?.badge ?? componentsProps.badge;
292
291
  const rootProps = (0, _useSlotProps.default)({
293
292
  elementType: RootSlot,
294
293
  externalSlotProps: rootSlotProps,
@@ -298,13 +297,13 @@ const Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {
298
297
  as: component
299
298
  },
300
299
  ownerState,
301
- className: (0, _clsx.default)(rootSlotProps == null ? void 0 : rootSlotProps.className, classes.root, className)
300
+ className: (0, _clsx.default)(rootSlotProps?.className, classes.root, className)
302
301
  });
303
302
  const badgeProps = (0, _useSlotProps.default)({
304
303
  elementType: BadgeSlot,
305
304
  externalSlotProps: badgeSlotProps,
306
305
  ownerState,
307
- className: (0, _clsx.default)(classes.badge, badgeSlotProps == null ? void 0 : badgeSlotProps.className)
306
+ className: (0, _clsx.default)(classes.badge, badgeSlotProps?.className)
308
307
  });
309
308
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
310
309
  ...rootProps,
@@ -162,7 +162,7 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef(function Breadcrumbs(inProps,
162
162
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(BreadcrumbsRoot, {
163
163
  ref: ref,
164
164
  component: component,
165
- color: "text.secondary",
165
+ color: "textSecondary",
166
166
  className: (0, _clsx.default)(classes.root, className),
167
167
  ownerState: ownerState,
168
168
  ...other,
@@ -86,7 +86,6 @@ const ButtonRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
86
86
  })(({
87
87
  theme
88
88
  }) => {
89
- var _theme$palette$getCon, _theme$palette;
90
89
  const inheritContainedBackgroundColor = theme.palette.mode === 'light' ? theme.palette.grey[300] : theme.palette.grey[800];
91
90
  const inheritContainedHoverBackgroundColor = theme.palette.mode === 'light' ? theme.palette.grey.A100 : theme.palette.grey[700];
92
91
  return {
@@ -180,7 +179,7 @@ const ButtonRoot = (0, _zeroStyled.styled)(_ButtonBase.default, {
180
179
  style: {
181
180
  '--variant-containedColor': theme.vars ?
182
181
  // this is safe because grey does not change between default light/dark mode
183
- theme.vars.palette.text.primary : (_theme$palette$getCon = (_theme$palette = theme.palette).getContrastText) == null ? void 0 : _theme$palette$getCon.call(_theme$palette, inheritContainedBackgroundColor),
182
+ theme.vars.palette.text.primary : theme.palette.getContrastText?.(inheritContainedBackgroundColor),
184
183
  '--variant-containedBg': theme.vars ? theme.vars.palette.Button.inheritContainedBg : inheritContainedBackgroundColor,
185
184
  '@media (hover: hover)': {
186
185
  '&:hover': {
@@ -193,11 +193,11 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
193
193
  center = centerProp || options.pulsate,
194
194
  fakeElement = false // For test purposes
195
195
  } = options;
196
- if ((event == null ? void 0 : event.type) === 'mousedown' && ignoringMouseDown.current) {
196
+ if (event?.type === 'mousedown' && ignoringMouseDown.current) {
197
197
  ignoringMouseDown.current = false;
198
198
  return;
199
199
  }
200
- if ((event == null ? void 0 : event.type) === 'touchstart') {
200
+ if (event?.type === 'touchstart') {
201
201
  ignoringMouseDown.current = true;
202
202
  }
203
203
  const element = fakeElement ? null : container.current;
@@ -237,7 +237,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
237
237
  }
238
238
 
239
239
  // Touche devices
240
- if (event != null && event.touches) {
240
+ if (event?.touches) {
241
241
  // check that this isn't another touchstart due to multitouch
242
242
  // otherwise we will only clear a single timer when unmounting while two
243
243
  // are running
@@ -281,7 +281,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
281
281
 
282
282
  // The touch interaction occurs too quickly.
283
283
  // We still want to show ripple effect.
284
- if ((event == null ? void 0 : event.type) === 'touchend' && startTimerCommit.current) {
284
+ if (event?.type === 'touchend' && startTimerCommit.current) {
285
285
  startTimerCommit.current();
286
286
  startTimerCommit.current = null;
287
287
  startTimer.start(0, () => {
@@ -10,7 +10,7 @@ var React = _interopRequireWildcard(require("react"));
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
  var _clsx = _interopRequireDefault(require("clsx"));
12
12
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
13
- var _Typography = _interopRequireDefault(require("../Typography"));
13
+ var _Typography = _interopRequireWildcard(require("../Typography"));
14
14
  var _zeroStyled = require("../zero-styled");
15
15
  var _DefaultPropsProvider = require("../DefaultPropsProvider");
16
16
  var _cardHeaderClasses = _interopRequireWildcard(require("./cardHeaderClasses"));
@@ -69,7 +69,13 @@ const CardHeaderContent = (0, _zeroStyled.styled)('div', {
69
69
  slot: 'Content',
70
70
  overridesResolver: (props, styles) => styles.content
71
71
  })({
72
- flex: '1 1 auto'
72
+ flex: '1 1 auto',
73
+ [`.${_Typography.typographyClasses.root}:where(& .${_cardHeaderClasses.default.title})`]: {
74
+ display: 'block'
75
+ },
76
+ [`.${_Typography.typographyClasses.root}:where(& .${_cardHeaderClasses.default.subheader})`]: {
77
+ display: 'block'
78
+ }
73
79
  });
74
80
  const CardHeader = /*#__PURE__*/React.forwardRef(function CardHeader(inProps, ref) {
75
81
  const props = (0, _DefaultPropsProvider.useDefaultProps)({
@@ -100,7 +106,6 @@ const CardHeader = /*#__PURE__*/React.forwardRef(function CardHeader(inProps, re
100
106
  variant: avatar ? 'body2' : 'h5',
101
107
  className: classes.title,
102
108
  component: "span",
103
- display: "block",
104
109
  ...titleTypographyProps,
105
110
  children: title
106
111
  });
@@ -110,9 +115,8 @@ const CardHeader = /*#__PURE__*/React.forwardRef(function CardHeader(inProps, re
110
115
  subheader = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
111
116
  variant: avatar ? 'body2' : 'body1',
112
117
  className: classes.subheader,
113
- color: "text.secondary",
118
+ color: "textSecondary",
114
119
  component: "span",
115
- display: "block",
116
120
  ...subheaderTypographyProps,
117
121
  children: subheader
118
122
  });
@@ -106,7 +106,6 @@ const defaultCheckedIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBox.default,
106
106
  const defaultIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBoxOutlineBlank.default, {});
107
107
  const defaultIndeterminateIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_IndeterminateCheckBox.default, {});
108
108
  const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(inProps, ref) {
109
- var _icon$props$fontSize, _indeterminateIcon$pr;
110
109
  const props = (0, _DefaultPropsProvider.useDefaultProps)({
111
110
  props: inProps,
112
111
  name: 'MuiCheckbox'
@@ -140,10 +139,10 @@ const Checkbox = /*#__PURE__*/React.forwardRef(function Checkbox(inProps, ref) {
140
139
  ...inputProps
141
140
  },
142
141
  icon: /*#__PURE__*/React.cloneElement(icon, {
143
- fontSize: (_icon$props$fontSize = icon.props.fontSize) != null ? _icon$props$fontSize : size
142
+ fontSize: icon.props.fontSize ?? size
144
143
  }),
145
144
  checkedIcon: /*#__PURE__*/React.cloneElement(indeterminateIcon, {
146
- fontSize: (_indeterminateIcon$pr = indeterminateIcon.props.fontSize) != null ? _indeterminateIcon$pr : size
145
+ fontSize: indeterminateIcon.props.fontSize ?? size
147
146
  }),
148
147
  ownerState: ownerState,
149
148
  ref: ref,