@mui/material 5.14.1 → 5.14.3

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 (131) hide show
  1. package/Accordion/Accordion.d.ts +11 -6
  2. package/AccordionSummary/AccordionSummary.d.ts +9 -7
  3. package/AppBar/AppBar.d.ts +11 -6
  4. package/Autocomplete/Autocomplete.d.ts +20 -16
  5. package/Autocomplete/Autocomplete.js +19 -15
  6. package/Avatar/Avatar.d.ts +11 -6
  7. package/AvatarGroup/AvatarGroup.d.ts +1 -1
  8. package/Backdrop/Backdrop.d.ts +11 -6
  9. package/Badge/Badge.d.ts +11 -6
  10. package/BottomNavigation/BottomNavigation.d.ts +11 -6
  11. package/BottomNavigationAction/BottomNavigationAction.d.ts +9 -7
  12. package/Box/Box.d.ts +3 -3
  13. package/Breadcrumbs/Breadcrumbs.d.ts +11 -6
  14. package/Button/Button.d.ts +16 -14
  15. package/Button/Button.js +1 -1
  16. package/ButtonBase/ButtonBase.d.ts +17 -12
  17. package/ButtonGroup/ButtonGroup.d.ts +11 -6
  18. package/CHANGELOG.md +152 -1
  19. package/Card/Card.d.ts +11 -6
  20. package/CardActionArea/CardActionArea.d.ts +11 -6
  21. package/CardContent/CardContent.d.ts +11 -6
  22. package/CardMedia/CardMedia.d.ts +9 -7
  23. package/Chip/Chip.d.ts +11 -6
  24. package/Chip/Chip.js +0 -2
  25. package/Container/Container.d.ts +11 -6
  26. package/DialogContentText/DialogContentText.d.ts +9 -7
  27. package/DialogTitle/DialogTitle.d.ts +9 -7
  28. package/Divider/Divider.d.ts +11 -6
  29. package/Divider/Divider.js +6 -0
  30. package/Fab/Fab.d.ts +11 -6
  31. package/Fab/Fab.js +1 -1
  32. package/FormControl/FormControl.d.ts +11 -6
  33. package/FormHelperText/FormHelperText.d.ts +11 -6
  34. package/FormLabel/FormLabel.d.ts +14 -9
  35. package/Grid/Grid.d.ts +11 -6
  36. package/Icon/Icon.d.ts +11 -6
  37. package/IconButton/IconButton.d.ts +9 -7
  38. package/ImageList/ImageList.d.ts +11 -6
  39. package/ImageListItem/ImageListItem.d.ts +11 -6
  40. package/InputAdornment/InputAdornment.d.ts +11 -6
  41. package/InputLabel/InputLabel.d.ts +9 -7
  42. package/Link/Link.d.ts +11 -6
  43. package/List/List.d.ts +17 -10
  44. package/ListItem/ListItem.d.ts +9 -7
  45. package/ListItem/ListItem.js +1 -1
  46. package/ListItemButton/ListItemButton.d.ts +9 -7
  47. package/ListItemButton/ListItemButton.js +1 -1
  48. package/ListSubheader/ListSubheader.d.ts +11 -6
  49. package/Menu/Menu.d.ts +23 -2
  50. package/Menu/Menu.js +48 -10
  51. package/MenuItem/MenuItem.d.ts +11 -6
  52. package/MenuItem/MenuItem.js +1 -1
  53. package/MenuList/MenuList.d.ts +11 -6
  54. package/Modal/Modal.d.ts +11 -6
  55. package/OverridableComponent.d.ts +14 -21
  56. package/PaginationItem/PaginationItem.d.ts +12 -7
  57. package/Paper/Paper.d.ts +14 -9
  58. package/Paper/index.d.ts +1 -1
  59. package/README.md +1 -1
  60. package/ScopedCssBaseline/ScopedCssBaseline.d.ts +11 -6
  61. package/Select/Select.d.ts +8 -8
  62. package/Select/Select.js +1 -1
  63. package/Select/SelectInput.d.ts +7 -7
  64. package/Skeleton/Skeleton.d.ts +11 -6
  65. package/Slider/Slider.d.ts +11 -6
  66. package/Stack/Stack.d.ts +11 -6
  67. package/Step/Step.d.ts +11 -6
  68. package/StepButton/StepButton.d.ts +11 -6
  69. package/Stepper/Stepper.d.ts +11 -6
  70. package/SvgIcon/SvgIcon.d.ts +11 -6
  71. package/Tab/Tab.d.ts +11 -6
  72. package/Table/Table.d.ts +11 -6
  73. package/TableBody/TableBody.d.ts +11 -6
  74. package/TableContainer/TableContainer.d.ts +11 -6
  75. package/TableFooter/TableFooter.d.ts +11 -6
  76. package/TableHead/TableHead.d.ts +11 -6
  77. package/TablePagination/TablePagination.d.ts +11 -6
  78. package/TableRow/TableRow.d.ts +11 -6
  79. package/TableSortLabel/TableSortLabel.d.ts +9 -7
  80. package/Tabs/Tabs.d.ts +11 -6
  81. package/Tabs/Tabs.js +39 -42
  82. package/ToggleButton/ToggleButton.d.ts +9 -7
  83. package/Toolbar/Toolbar.d.ts +11 -6
  84. package/Typography/Typography.d.ts +11 -6
  85. package/index.d.ts +9 -9
  86. package/index.js +1 -1
  87. package/legacy/Autocomplete/Autocomplete.js +19 -16
  88. package/legacy/Button/Button.js +1 -1
  89. package/legacy/Chip/Chip.js +0 -2
  90. package/legacy/Divider/Divider.js +6 -0
  91. package/legacy/Fab/Fab.js +1 -1
  92. package/legacy/ListItem/ListItem.js +1 -1
  93. package/legacy/ListItemButton/ListItemButton.js +1 -1
  94. package/legacy/Menu/Menu.js +49 -9
  95. package/legacy/MenuItem/MenuItem.js +1 -1
  96. package/legacy/Select/Select.js +1 -1
  97. package/legacy/Tabs/Tabs.js +48 -48
  98. package/legacy/index.js +1 -1
  99. package/modern/Autocomplete/Autocomplete.js +16 -12
  100. package/modern/Button/Button.js +1 -1
  101. package/modern/Chip/Chip.js +0 -2
  102. package/modern/Divider/Divider.js +6 -0
  103. package/modern/Fab/Fab.js +1 -1
  104. package/modern/ListItem/ListItem.js +1 -1
  105. package/modern/ListItemButton/ListItemButton.js +1 -1
  106. package/modern/Menu/Menu.js +47 -10
  107. package/modern/MenuItem/MenuItem.js +1 -1
  108. package/modern/Select/Select.js +1 -1
  109. package/modern/Tabs/Tabs.js +39 -42
  110. package/modern/index.js +1 -1
  111. package/node/Autocomplete/Autocomplete.js +19 -15
  112. package/node/Button/Button.js +1 -1
  113. package/node/Chip/Chip.js +0 -2
  114. package/node/Divider/Divider.js +6 -0
  115. package/node/Fab/Fab.js +1 -1
  116. package/node/ListItem/ListItem.js +1 -1
  117. package/node/ListItemButton/ListItemButton.js +1 -1
  118. package/node/Menu/Menu.js +47 -9
  119. package/node/MenuItem/MenuItem.js +1 -1
  120. package/node/Select/Select.js +1 -1
  121. package/node/Tabs/Tabs.js +39 -42
  122. package/node/index.js +1 -1
  123. package/package.json +6 -6
  124. package/styles/ThemeProvider.d.ts +3 -3
  125. package/styles/components.d.ts +1 -0
  126. package/styles/createTypography.d.ts +9 -10
  127. package/styles/overrides.d.ts +2 -0
  128. package/styles/props.d.ts +1 -1
  129. package/types/OverridableComponentAugmentation.d.ts +7 -7
  130. package/umd/material-ui.development.js +362 -324
  131. package/umd/material-ui.production.min.js +21 -21
@@ -385,6 +385,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
385
385
  props: inProps,
386
386
  name: 'MuiAutocomplete'
387
387
  });
388
+
388
389
  /* eslint-disable @typescript-eslint/no-unused-vars */
389
390
  const {
390
391
  autoComplete = false,
@@ -413,10 +414,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
413
414
  freeSolo = false,
414
415
  fullWidth = false,
415
416
  getLimitTagsText = more => `+${more}`,
416
- getOptionLabel = option => {
417
- var _option$label;
418
- return (_option$label = option.label) != null ? _option$label : option;
419
- },
417
+ getOptionLabel: getOptionLabelProp,
420
418
  groupBy,
421
419
  handleHomeEndKeys = !props.freeSolo,
422
420
  includeInputInList = false,
@@ -481,6 +479,11 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
481
479
  } = _getListboxProps,
482
480
  otherListboxProps = (0, _objectWithoutPropertiesLoose2.default)(_getListboxProps, _excluded2);
483
481
  const combinedListboxRef = (0, _useForkRef.default)(listboxRef, externalListboxRef);
482
+ const defaultGetOptionLabel = option => {
483
+ var _option$label;
484
+ return (_option$label = option.label) != null ? _option$label : option;
485
+ };
486
+ const getOptionLabel = getOptionLabelProp || defaultGetOptionLabel;
484
487
 
485
488
  // If you modify this, make sure to keep the `AutocompleteOwnerState` type in sync.
486
489
  const ownerState = (0, _extends2.default)({}, props, {
@@ -488,6 +491,7 @@ const Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps
488
491
  expanded,
489
492
  focused,
490
493
  fullWidth,
494
+ getOptionLabel,
491
495
  hasClearIcon,
492
496
  hasPopupIcon,
493
497
  inputFocused: focusedTag === -1,
@@ -791,9 +795,9 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
791
795
  * A function that determines the filtered options to be rendered on search.
792
796
  *
793
797
  * @default createFilterOptions()
794
- * @param {T[]} options The options to render.
798
+ * @param {Value[]} options The options to render.
795
799
  * @param {object} state The state of the component.
796
- * @returns {T[]}
800
+ * @returns {Value[]}
797
801
  */
798
802
  filterOptions: _propTypes.default.func,
799
803
  /**
@@ -827,7 +831,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
827
831
  /**
828
832
  * Used to determine the disabled state for a given option.
829
833
  *
830
- * @param {T} option The option to test.
834
+ * @param {Value} option The option to test.
831
835
  * @returns {boolean}
832
836
  */
833
837
  getOptionDisabled: _propTypes.default.func,
@@ -837,7 +841,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
837
841
  *
838
842
  * If used in free solo mode, it must accept both the type of the options and a string.
839
843
  *
840
- * @param {T} option
844
+ * @param {Value} option
841
845
  * @returns {string}
842
846
  * @default (option) => option.label ?? option
843
847
  */
@@ -846,7 +850,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
846
850
  * If provided, the options will be grouped under the returned string.
847
851
  * The groupBy value is also used as the text for group headings when `renderGroup` is not provided.
848
852
  *
849
- * @param {T} options The options to group.
853
+ * @param {Value} options The options to group.
850
854
  * @returns {string}
851
855
  */
852
856
  groupBy: _propTypes.default.func,
@@ -875,8 +879,8 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
875
879
  * Uses strict equality by default.
876
880
  * ⚠️ Both arguments need to be handled, an option can only match with one value.
877
881
  *
878
- * @param {T} option The option to test.
879
- * @param {T} value The value to test against.
882
+ * @param {Value} option The option to test.
883
+ * @param {Value} value The value to test against.
880
884
  * @returns {boolean}
881
885
  */
882
886
  isOptionEqualToValue: _propTypes.default.func,
@@ -924,7 +928,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
924
928
  * Callback fired when the value changes.
925
929
  *
926
930
  * @param {React.SyntheticEvent} event The event source of the callback.
927
- * @param {T|T[]} value The new value of the component.
931
+ * @param {Value|Value[]} value The new value of the component.
928
932
  * @param {string} reason One of "createOption", "selectOption", "removeOption", "blur" or "clear".
929
933
  * @param {string} [details]
930
934
  */
@@ -941,7 +945,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
941
945
  * Callback fired when the highlight option changes.
942
946
  *
943
947
  * @param {React.SyntheticEvent} event The event source of the callback.
944
- * @param {T} option The highlighted option.
948
+ * @param {Value} option The highlighted option.
945
949
  * @param {string} reason Can be: `"keyboard"`, `"auto"`, `"mouse"`, `"touch"`.
946
950
  */
947
951
  onHighlightChange: _propTypes.default.func,
@@ -1018,7 +1022,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
1018
1022
  * Render the option, use `getOptionLabel` by default.
1019
1023
  *
1020
1024
  * @param {object} props The props to apply on the li element.
1021
- * @param {T} option The option to render.
1025
+ * @param {Value} option The option to render.
1022
1026
  * @param {object} state The state of each option.
1023
1027
  * @param {object} ownerState The state of the Autocomplete component.
1024
1028
  * @returns {ReactNode}
@@ -1027,7 +1031,7 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes /* remove-proptyp
1027
1031
  /**
1028
1032
  * Render the selected value.
1029
1033
  *
1030
- * @param {T[]} value The `value` provided to the component.
1034
+ * @param {Value[]} value The `value` provided to the component.
1031
1035
  * @param {function} getTagProps A tag props getter.
1032
1036
  * @param {object} ownerState The state of the Autocomplete component.
1033
1037
  * @returns {ReactNode}
@@ -314,7 +314,7 @@ process.env.NODE_ENV !== "production" ? Button.propTypes /* remove-proptypes */
314
314
  * The component used for the root node.
315
315
  * Either a string to use a HTML element or a component.
316
316
  */
317
- component: _propTypes.default /* @typescript-to-proptypes-ignore */.elementType,
317
+ component: _propTypes.default.elementType,
318
318
  /**
319
319
  * If `true`, the component is disabled.
320
320
  * @default false
package/node/Chip/Chip.js CHANGED
@@ -100,8 +100,6 @@ const ChipRoot = (0, _styled.default)('div', {
100
100
  borderRadius: 32 / 2,
101
101
  whiteSpace: 'nowrap',
102
102
  transition: theme.transitions.create(['background-color', 'box-shadow']),
103
- // label will inherit this from root, then `clickable` class overrides this for both
104
- cursor: 'default',
105
103
  // We disable the focus ring for mouse, touch and keyboard users.
106
104
  outline: 0,
107
105
  textDecoration: 'none',
@@ -187,6 +187,12 @@ const Divider = /*#__PURE__*/React.forwardRef(function Divider(inProps, ref) {
187
187
  }) : null
188
188
  }));
189
189
  });
190
+
191
+ /**
192
+ * The following flag is used to ensure that this component isn't tabbable i.e.
193
+ * does not get highlight/focus inside of MUI List.
194
+ */
195
+ Divider.muiSkipListHighlight = true;
190
196
  process.env.NODE_ENV !== "production" ? Divider.propTypes /* remove-proptypes */ = {
191
197
  // ----------------------------- Warning --------------------------------
192
198
  // | These PropTypes are generated from the TypeScript type definitions |
package/node/Fab/Fab.js CHANGED
@@ -194,7 +194,7 @@ process.env.NODE_ENV !== "production" ? Fab.propTypes /* remove-proptypes */ = {
194
194
  * The component used for the root node.
195
195
  * Either a string to use a HTML element or a component.
196
196
  */
197
- component: _propTypes.default /* @typescript-to-proptypes-ignore */.elementType,
197
+ component: _propTypes.default.elementType,
198
198
  /**
199
199
  * If `true`, the component is disabled.
200
200
  * @default false
@@ -323,7 +323,7 @@ process.env.NODE_ENV !== "production" ? ListItem.propTypes /* remove-proptypes *
323
323
  * The component used for the root node.
324
324
  * Either a string to use a HTML element or a component.
325
325
  */
326
- component: _propTypes.default /* @typescript-to-proptypes-ignore */.elementType,
326
+ component: _propTypes.default.elementType,
327
327
  /**
328
328
  * The components used for each slot inside.
329
329
  *
@@ -202,7 +202,7 @@ process.env.NODE_ENV !== "production" ? ListItemButton.propTypes /* remove-propt
202
202
  * The component used for the root node.
203
203
  * Either a string to use a HTML element or a component.
204
204
  */
205
- component: _propTypes.default /* @typescript-to-proptypes-ignore */.elementType,
205
+ component: _propTypes.default.elementType,
206
206
  /**
207
207
  * If `true`, compact vertical padding designed for keyboard and mouse input is used.
208
208
  * The prop defaults to the value inherited from the parent List component.
package/node/Menu/Menu.js CHANGED
@@ -22,7 +22,7 @@ var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps"));
22
22
  var _menuClasses = require("./menuClasses");
23
23
  var _jsxRuntime = require("react/jsx-runtime");
24
24
  const _excluded = ["onEntering"],
25
- _excluded2 = ["autoFocus", "children", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant"];
25
+ _excluded2 = ["autoFocus", "children", "className", "disableAutoFocusItem", "MenuListProps", "onClose", "open", "PaperProps", "PopoverClasses", "transitionDuration", "TransitionProps", "variant", "slots", "slotProps"];
26
26
  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); }
27
27
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
28
28
  const RTL_ORIGIN = {
@@ -72,6 +72,7 @@ const MenuMenuList = (0, _styled.default)(_MenuList.default, {
72
72
  outline: 0
73
73
  });
74
74
  const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
75
+ var _slots$paper, _slotProps$paper;
75
76
  const props = (0, _useThemeProps.default)({
76
77
  props: inProps,
77
78
  name: 'MuiMenu'
@@ -79,6 +80,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
79
80
  const {
80
81
  autoFocus = true,
81
82
  children,
83
+ className,
82
84
  disableAutoFocusItem = false,
83
85
  MenuListProps = {},
84
86
  onClose,
@@ -89,7 +91,9 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
89
91
  TransitionProps: {
90
92
  onEntering
91
93
  } = {},
92
- variant = 'selectedMenu'
94
+ variant = 'selectedMenu',
95
+ slots = {},
96
+ slotProps = {}
93
97
  } = props,
94
98
  TransitionProps = (0, _objectWithoutPropertiesLoose2.default)(props.TransitionProps, _excluded),
95
99
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
@@ -151,6 +155,20 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
151
155
  }
152
156
  }
153
157
  });
158
+ const PaperSlot = (_slots$paper = slots.paper) != null ? _slots$paper : MenuPaper;
159
+ const paperExternalSlotProps = (_slotProps$paper = slotProps.paper) != null ? _slotProps$paper : PaperProps;
160
+ const rootSlotProps = (0, _base.useSlotProps)({
161
+ elementType: slots.root,
162
+ externalSlotProps: slotProps.root,
163
+ ownerState,
164
+ className: [classes.root, className]
165
+ });
166
+ const paperSlotProps = (0, _base.useSlotProps)({
167
+ elementType: PaperSlot,
168
+ externalSlotProps: paperExternalSlotProps,
169
+ ownerState,
170
+ className: classes.paper
171
+ });
154
172
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(MenuRoot, (0, _extends2.default)({
155
173
  onClose: onClose,
156
174
  anchorOrigin: {
@@ -159,16 +177,13 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(inProps, ref) {
159
177
  },
160
178
  transformOrigin: isRtl ? RTL_ORIGIN : LTR_ORIGIN,
161
179
  slots: {
162
- paper: MenuPaper
180
+ paper: PaperSlot,
181
+ root: slots.root
163
182
  },
164
183
  slotProps: {
165
- paper: (0, _extends2.default)({}, PaperProps, {
166
- classes: (0, _extends2.default)({}, PaperProps.classes, {
167
- root: classes.paper
168
- })
169
- })
184
+ root: rootSlotProps,
185
+ paper: paperSlotProps
170
186
  },
171
- className: classes.root,
172
187
  open: open,
173
188
  ref: ref,
174
189
  transitionDuration: transitionDuration,
@@ -216,6 +231,10 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
216
231
  * Override or extend the styles applied to the component.
217
232
  */
218
233
  classes: _propTypes.default.object,
234
+ /**
235
+ * @ignore
236
+ */
237
+ className: _propTypes.default.string,
219
238
  /**
220
239
  * When opening the menu will not focus the active item but the `[role="menu"]`
221
240
  * unless `autoFocus` is also set to `false`. Not using the default means not
@@ -248,6 +267,25 @@ process.env.NODE_ENV !== "production" ? Menu.propTypes /* remove-proptypes */ =
248
267
  * `classes` prop applied to the [`Popover`](/material-ui/api/popover/) element.
249
268
  */
250
269
  PopoverClasses: _propTypes.default.object,
270
+ /**
271
+ * The extra props for the slot components.
272
+ * You can override the existing props or add new ones.
273
+ *
274
+ * @default {}
275
+ */
276
+ slotProps: _propTypes.default.shape({
277
+ paper: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
278
+ root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
279
+ }),
280
+ /**
281
+ * The components used for each slot inside.
282
+ *
283
+ * @default {}
284
+ */
285
+ slots: _propTypes.default.shape({
286
+ paper: _propTypes.default.elementType,
287
+ root: _propTypes.default.elementType
288
+ }),
251
289
  /**
252
290
  * The system prop that allows defining system overrides as well as additional CSS styles.
253
291
  */
@@ -218,7 +218,7 @@ process.env.NODE_ENV !== "production" ? MenuItem.propTypes /* remove-proptypes *
218
218
  * The component used for the root node.
219
219
  * Either a string to use a HTML element or a component.
220
220
  */
221
- component: _propTypes.default /* @typescript-to-proptypes-ignore */.elementType,
221
+ component: _propTypes.default.elementType,
222
222
  /**
223
223
  * If `true`, compact vertical padding designed for keyboard and mouse input is used.
224
224
  * The prop defaults to the value inherited from the parent Menu component.
@@ -230,7 +230,7 @@ process.env.NODE_ENV !== "production" ? Select.propTypes /* remove-proptypes */
230
230
  /**
231
231
  * Callback fired when a menu item is selected.
232
232
  *
233
- * @param {SelectChangeEvent<T>} event The event source of the callback.
233
+ * @param {SelectChangeEvent<Value>} event The event source of the callback.
234
234
  * You can pull out the new value by accessing `event.target.value` (any).
235
235
  * **Warning**: This is a generic event, not a change event, unless the change event is caused by browser autofill.
236
236
  * @param {object} [child] The react element that was selected when `native` is `false` (default).
package/node/Tabs/Tabs.js CHANGED
@@ -287,10 +287,9 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
287
287
  }
288
288
  const [mounted, setMounted] = React.useState(false);
289
289
  const [indicatorStyle, setIndicatorStyle] = React.useState(defaultIndicatorStyle);
290
- const [displayScroll, setDisplayScroll] = React.useState({
291
- start: false,
292
- end: false
293
- });
290
+ const [displayStartScroll, setDisplayStartScroll] = React.useState(false);
291
+ const [displayEndScroll, setDisplayEndScroll] = React.useState(false);
292
+ const [updateScrollObserver, setUpdateScrollObserver] = React.useState(false);
294
293
  const [scrollerStyle, setScrollerStyle] = React.useState({
295
294
  overflow: 'hidden',
296
295
  scrollbarWidth: 0
@@ -441,7 +440,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
441
440
  onChange: handleScrollbarSizeChange,
442
441
  className: (0, _clsx.default)(classes.scrollableX, classes.hideScrollbar)
443
442
  }) : null;
444
- const scrollButtonsActive = displayScroll.start || displayScroll.end;
443
+ const scrollButtonsActive = displayStartScroll || displayEndScroll;
445
444
  const showScrollButtons = scrollable && (scrollButtons === 'auto' && scrollButtonsActive || scrollButtons === true);
446
445
  conditionalElements.scrollButtonStart = showScrollButtons ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ScrollButtonComponent, (0, _extends2.default)({
447
446
  slots: {
@@ -453,7 +452,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
453
452
  orientation: orientation,
454
453
  direction: isRtl ? 'right' : 'left',
455
454
  onClick: handleStartScrollClick,
456
- disabled: !displayScroll.start
455
+ disabled: !displayStartScroll
457
456
  }, TabScrollButtonProps, {
458
457
  className: (0, _clsx.default)(classes.scrollButtons, TabScrollButtonProps.className)
459
458
  })) : null;
@@ -467,7 +466,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
467
466
  orientation: orientation,
468
467
  direction: isRtl ? 'left' : 'right',
469
468
  onClick: handleEndScrollClick,
470
- disabled: !displayScroll.end
469
+ disabled: !displayEndScroll
471
470
  }, TabScrollButtonProps, {
472
471
  className: (0, _clsx.default)(classes.scrollButtons, TabScrollButtonProps.className)
473
472
  })) : null;
@@ -497,30 +496,7 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
497
496
  });
498
497
  const updateScrollButtonState = (0, _useEventCallback.default)(() => {
499
498
  if (scrollable && scrollButtons !== false) {
500
- const {
501
- scrollTop,
502
- scrollHeight,
503
- clientHeight,
504
- scrollWidth,
505
- clientWidth
506
- } = tabsRef.current;
507
- let showStartScroll;
508
- let showEndScroll;
509
- if (vertical) {
510
- showStartScroll = scrollTop > 1;
511
- showEndScroll = scrollTop < scrollHeight - clientHeight - 1;
512
- } else {
513
- const scrollLeft = (0, _scrollLeft.getNormalizedScrollLeft)(tabsRef.current, theme.direction);
514
- // use 1 for the potential rounding error with browser zooms.
515
- showStartScroll = isRtl ? scrollLeft < scrollWidth - clientWidth - 1 : scrollLeft > 1;
516
- showEndScroll = !isRtl ? scrollLeft < scrollWidth - clientWidth - 1 : scrollLeft > 1;
517
- }
518
- if (showStartScroll !== displayScroll.start || showEndScroll !== displayScroll.end) {
519
- setDisplayScroll({
520
- start: showStartScroll,
521
- end: showEndScroll
522
- });
523
- }
499
+ setUpdateScrollObserver(!updateScrollObserver);
524
500
  }
525
501
  });
526
502
  React.useEffect(() => {
@@ -533,7 +509,6 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
533
509
  // replaced by Suspense with a fallback, once React is updated to version 18
534
510
  if (tabsRef.current) {
535
511
  updateIndicatorState();
536
- updateScrollButtonState();
537
512
  }
538
513
  });
539
514
  const win = (0, _ownerWindow.default)(tabsRef.current);
@@ -552,21 +527,44 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
552
527
  resizeObserver.disconnect();
553
528
  }
554
529
  };
555
- }, [updateIndicatorState, updateScrollButtonState]);
556
- const handleTabsScroll = React.useMemo(() => (0, _debounce.default)(() => {
557
- updateScrollButtonState();
558
- }), [updateScrollButtonState]);
530
+ }, [updateIndicatorState]);
531
+
532
+ /**
533
+ * Toggle visibility of start and end scroll buttons
534
+ * Using IntersectionObserver on first and last Tabs.
535
+ */
559
536
  React.useEffect(() => {
560
- return () => {
561
- handleTabsScroll.clear();
562
- };
563
- }, [handleTabsScroll]);
537
+ const tabListChildren = Array.from(tabListRef.current.children);
538
+ const length = tabListChildren.length;
539
+ if (typeof IntersectionObserver !== 'undefined' && length > 0 && scrollable && scrollButtons !== false) {
540
+ const firstTab = tabListChildren[0];
541
+ const lastTab = tabListChildren[length - 1];
542
+ const observerOptions = {
543
+ root: tabsRef.current,
544
+ threshold: 0.99
545
+ };
546
+ const handleScrollButtonStart = entries => {
547
+ setDisplayStartScroll(!entries[0].isIntersecting);
548
+ };
549
+ const firstObserver = new IntersectionObserver(handleScrollButtonStart, observerOptions);
550
+ firstObserver.observe(firstTab);
551
+ const handleScrollButtonEnd = entries => {
552
+ setDisplayEndScroll(!entries[0].isIntersecting);
553
+ };
554
+ const lastObserver = new IntersectionObserver(handleScrollButtonEnd, observerOptions);
555
+ lastObserver.observe(lastTab);
556
+ return () => {
557
+ firstObserver.disconnect();
558
+ lastObserver.disconnect();
559
+ };
560
+ }
561
+ return undefined;
562
+ }, [scrollable, scrollButtons, updateScrollObserver, childrenProp == null ? void 0 : childrenProp.length]);
564
563
  React.useEffect(() => {
565
564
  setMounted(true);
566
565
  }, []);
567
566
  React.useEffect(() => {
568
567
  updateIndicatorState();
569
- updateScrollButtonState();
570
568
  });
571
569
  React.useEffect(() => {
572
570
  // Don't animate on the first render.
@@ -660,7 +658,6 @@ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(inProps, ref) {
660
658
  [vertical ? `margin${isRtl ? 'Left' : 'Right'}` : 'marginBottom']: visibleScrollbar ? undefined : -scrollerStyle.scrollbarWidth
661
659
  },
662
660
  ref: tabsRef,
663
- onScroll: handleTabsScroll,
664
661
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FlexContainer, {
665
662
  "aria-label": ariaLabel,
666
663
  "aria-labelledby": ariaLabelledBy,
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v5.14.1
2
+ * @mui/material v5.14.3
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "5.14.1",
3
+ "version": "5.14.3",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "React components that implement Google's Material Design.",
@@ -46,13 +46,13 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@babel/runtime": "^7.22.6",
49
- "@mui/base": "5.0.0-beta.8",
50
- "@mui/core-downloads-tracker": "^5.14.1",
51
- "@mui/system": "^5.14.1",
49
+ "@mui/base": "5.0.0-beta.9",
50
+ "@mui/core-downloads-tracker": "^5.14.3",
51
+ "@mui/system": "^5.14.3",
52
52
  "@mui/types": "^7.2.4",
53
- "@mui/utils": "^5.14.1",
53
+ "@mui/utils": "^5.14.3",
54
54
  "@types/react-transition-group": "^4.4.6",
55
- "clsx": "^1.2.1",
55
+ "clsx": "^2.0.0",
56
56
  "csstype": "^3.1.2",
57
57
  "prop-types": "^15.8.1",
58
58
  "react-is": "^18.2.0",
@@ -12,6 +12,6 @@ export interface ThemeProviderProps<Theme = DefaultTheme> {
12
12
  *
13
13
  * - [ThemeProvider API](https://mui.com/material-ui/customization/theming/#themeprovider)
14
14
  */
15
- export default function ThemeProvider<T = DefaultTheme>(
16
- props: ThemeProviderProps<T>,
17
- ): React.ReactElement<ThemeProviderProps<T>>;
15
+ export default function ThemeProvider<Theme = DefaultTheme>(
16
+ props: ThemeProviderProps<Theme>,
17
+ ): React.ReactElement<ThemeProviderProps<Theme>>;
@@ -443,6 +443,7 @@ export interface Components<Theme = unknown> {
443
443
  };
444
444
  MuiStack?: {
445
445
  defaultProps?: ComponentsProps['MuiStack'];
446
+ styleOverrides?: ComponentsOverrides<Theme>['MuiStack'];
446
447
  variants?: ComponentsVariants['MuiStack'];
447
448
  };
448
449
  MuiStep?: {
@@ -17,16 +17,15 @@ export type Variant =
17
17
  | 'button'
18
18
  | 'overline';
19
19
 
20
- export interface FontStyle
21
- extends Required<{
22
- fontFamily: React.CSSProperties['fontFamily'];
23
- fontSize: number;
24
- fontWeightLight: React.CSSProperties['fontWeight'];
25
- fontWeightRegular: React.CSSProperties['fontWeight'];
26
- fontWeightMedium: React.CSSProperties['fontWeight'];
27
- fontWeightBold: React.CSSProperties['fontWeight'];
28
- htmlFontSize: number;
29
- }> {}
20
+ export interface FontStyle {
21
+ fontFamily: React.CSSProperties['fontFamily'];
22
+ fontSize: number;
23
+ fontWeightLight: React.CSSProperties['fontWeight'];
24
+ fontWeightRegular: React.CSSProperties['fontWeight'];
25
+ fontWeightMedium: React.CSSProperties['fontWeight'];
26
+ fontWeightBold: React.CSSProperties['fontWeight'];
27
+ htmlFontSize: number;
28
+ }
30
29
 
31
30
  export type NormalCssProperties = CSS.Properties<number | string>;
32
31
  export type Fontface = CSS.AtRule.FontFace & { fallbacks?: CSS.AtRule.FontFace[] };
@@ -86,6 +86,7 @@ import { SnackbarContentClassKey } from '../SnackbarContent';
86
86
  import { SpeedDialClassKey } from '../SpeedDial';
87
87
  import { SpeedDialActionClassKey } from '../SpeedDialAction';
88
88
  import { SpeedDialIconClassKey } from '../SpeedDialIcon';
89
+ import { StackClassKey } from '../Stack';
89
90
  import { StepButtonClasskey } from '../StepButton';
90
91
  import { StepClasskey } from '../Step';
91
92
  import { StepConnectorClasskey } from '../StepConnector';
@@ -225,6 +226,7 @@ export interface ComponentNameToClassKey {
225
226
  MuiSpeedDial: SpeedDialClassKey;
226
227
  MuiSpeedDialAction: SpeedDialActionClassKey;
227
228
  MuiSpeedDialIcon: SpeedDialIconClassKey;
229
+ MuiStack: StackClassKey;
228
230
  MuiStep: StepClasskey;
229
231
  MuiStepButton: StepButtonClasskey;
230
232
  MuiStepConnector: StepConnectorClasskey;
package/styles/props.d.ts CHANGED
@@ -179,7 +179,7 @@ export interface ComponentsPropsList {
179
179
  MuiInputBase: InputBaseProps;
180
180
  MuiInputLabel: InputLabelProps;
181
181
  MuiLinearProgress: LinearProgressProps;
182
- MuiLink: LinkProps<React.ElementType>;
182
+ MuiLink: LinkProps;
183
183
  MuiList: ListProps;
184
184
  MuiListItem: ListItemProps;
185
185
  MuiListItemButton: ListItemButtonProps;
@@ -6,26 +6,26 @@ declare module '@mui/material/OverridableComponent' {
6
6
  *
7
7
  * Adjusts valid props based on the type of `component`.
8
8
  */
9
- interface OverridableComponent<M extends OverridableTypeMap> {
10
- <C extends React.ElementType>(props: {
9
+ interface OverridableComponent<TypeMap extends OverridableTypeMap> {
10
+ <DefaultComponent extends React.ElementType>(props: {
11
11
  /**
12
12
  * The component used for the root node.
13
13
  * Either a string to use a HTML element or a component.
14
14
  */
15
- component: C;
16
- } & OverridePropsVer2<M, C>): JSX.Element;
17
- (props: DefaultComponentPropsVer2<M>): JSX.Element;
15
+ component: DefaultComponent;
16
+ } & OverridePropsVer2<TypeMap, DefaultComponent>): JSX.Element;
17
+ (props: DefaultComponentPropsVer2<TypeMap>): JSX.Element;
18
18
  }
19
19
  /**
20
20
  * Props of the component if `component={Component}` is used.
21
21
  */
22
- type OverridePropsVer2<M extends OverridableTypeMap, C extends React.ElementType> = (BaseProps<M> & DistributiveOmit<React.ComponentPropsWithoutRef<C>, keyof BaseProps<M>> & {
22
+ type OverridePropsVer2<TypeMap extends OverridableTypeMap, RootComponent extends React.ElementType> = (BaseProps<TypeMap> & DistributiveOmit<React.ComponentPropsWithoutRef<RootComponent>, keyof BaseProps<TypeMap>> & {
23
23
  ref?: React.Ref<Element>;
24
24
  });
25
25
  /**
26
26
  * Props if `component={Component}` is NOT used.
27
27
  */
28
- type DefaultComponentPropsVer2<M extends OverridableTypeMap> = BaseProps<M> & DistributiveOmit<React.ComponentPropsWithoutRef<M['defaultComponent']>, keyof BaseProps<M>> & {
28
+ type DefaultComponentPropsVer2<TypeMap extends OverridableTypeMap> = BaseProps<TypeMap> & DistributiveOmit<React.ComponentPropsWithoutRef<TypeMap['defaultComponent']>, keyof BaseProps<TypeMap>> & {
29
29
  ref?: React.Ref<Element>;
30
30
  };
31
31
  }