@mui/material 6.1.0 → 6.1.1-dev.20240919-130050-82a6448768

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 (74) hide show
  1. package/Backdrop/Backdrop.js +9 -2
  2. package/CHANGELOG.md +63 -0
  3. package/ClickAwayListener/ClickAwayListener.js +1 -1
  4. package/FormControl/FormControl.js +1 -2
  5. package/Grid/Grid.d.ts +6 -0
  6. package/Hidden/withWidth.js +1 -0
  7. package/Icon/Icon.js +1 -1
  8. package/InputBase/InputBase.js +2 -0
  9. package/Modal/Modal.js +1 -1
  10. package/Modal/ModalManager.js +4 -4
  11. package/Popover/Popover.js +1 -1
  12. package/Select/SelectInput.js +2 -0
  13. package/Skeleton/Skeleton.js +5 -3
  14. package/Slider/useSlider.js +2 -2
  15. package/SwipeableDrawer/SwipeableDrawer.js +1 -0
  16. package/ToggleButtonGroup/isValueSelected.js +1 -1
  17. package/Tooltip/Tooltip.js +6 -3
  18. package/Unstable_TrapFocus/FocusTrap.js +1 -1
  19. package/index.d.ts +1 -0
  20. package/index.js +1 -1
  21. package/modern/Backdrop/Backdrop.js +9 -2
  22. package/modern/ClickAwayListener/ClickAwayListener.js +1 -1
  23. package/modern/FormControl/FormControl.js +1 -2
  24. package/modern/Hidden/withWidth.js +1 -0
  25. package/modern/Icon/Icon.js +1 -1
  26. package/modern/InputBase/InputBase.js +2 -0
  27. package/modern/Modal/Modal.js +1 -1
  28. package/modern/Modal/ModalManager.js +4 -4
  29. package/modern/Popover/Popover.js +1 -1
  30. package/modern/Select/SelectInput.js +2 -0
  31. package/modern/Skeleton/Skeleton.js +5 -3
  32. package/modern/Slider/useSlider.js +2 -2
  33. package/modern/SwipeableDrawer/SwipeableDrawer.js +1 -0
  34. package/modern/ToggleButtonGroup/isValueSelected.js +1 -1
  35. package/modern/Tooltip/Tooltip.js +6 -3
  36. package/modern/Unstable_TrapFocus/FocusTrap.js +1 -1
  37. package/modern/index.js +1 -1
  38. package/modern/styles/createColorScheme.js +1 -1
  39. package/modern/styles/excludeVariablesFromRoot.js +1 -1
  40. package/modern/styles/useTheme.js +1 -0
  41. package/modern/useAutocomplete/useAutocomplete.js +2 -2
  42. package/modern/useScrollTrigger/useScrollTrigger.js +1 -0
  43. package/modern/version/index.js +3 -3
  44. package/node/Backdrop/Backdrop.js +9 -2
  45. package/node/ClickAwayListener/ClickAwayListener.js +1 -1
  46. package/node/FormControl/FormControl.js +1 -2
  47. package/node/Hidden/withWidth.js +1 -0
  48. package/node/Icon/Icon.js +1 -1
  49. package/node/InputBase/InputBase.js +2 -0
  50. package/node/Modal/Modal.js +1 -1
  51. package/node/Modal/ModalManager.js +4 -4
  52. package/node/Popover/Popover.js +1 -1
  53. package/node/Select/SelectInput.js +2 -0
  54. package/node/Skeleton/Skeleton.js +5 -3
  55. package/node/Slider/useSlider.js +2 -2
  56. package/node/SwipeableDrawer/SwipeableDrawer.js +1 -0
  57. package/node/ToggleButtonGroup/isValueSelected.js +1 -1
  58. package/node/Tooltip/Tooltip.js +6 -3
  59. package/node/Unstable_TrapFocus/FocusTrap.js +1 -1
  60. package/node/index.js +1 -1
  61. package/node/styles/createColorScheme.js +1 -1
  62. package/node/styles/excludeVariablesFromRoot.js +1 -1
  63. package/node/styles/useTheme.js +1 -0
  64. package/node/useAutocomplete/useAutocomplete.js +2 -2
  65. package/node/useScrollTrigger/useScrollTrigger.js +1 -0
  66. package/node/version/index.js +3 -3
  67. package/package.json +7 -7
  68. package/styles/createColorScheme.d.ts +1 -1
  69. package/styles/createColorScheme.js +1 -1
  70. package/styles/excludeVariablesFromRoot.js +1 -1
  71. package/styles/useTheme.js +1 -0
  72. package/useAutocomplete/useAutocomplete.js +2 -2
  73. package/useScrollTrigger/useScrollTrigger.js +1 -0
  74. package/version/index.js +3 -3
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.1.0
2
+ * @mui/material v6.1.1-dev.20240919-130050-82a6448768
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -2,7 +2,7 @@ import createPalette from "./createPalette.js";
2
2
  import getOverlayAlpha from "./getOverlayAlpha.js";
3
3
  const defaultDarkOverlays = [...Array(25)].map((_, index) => {
4
4
  if (index === 0) {
5
- return undefined;
5
+ return 'none';
6
6
  }
7
7
  const overlay = getOverlayAlpha(index);
8
8
  return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * @internal These variables should not appear in the :root stylesheet when the `defaultColorScheme="dark"`
3
3
  */
4
- const excludeVariablesFromRoot = cssVarPrefix => [...[...Array(24)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}overlays-${index + 1}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkColor`];
4
+ const excludeVariablesFromRoot = cssVarPrefix => [...[...Array(25)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}overlays-${index}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkColor`];
5
5
  export default excludeVariablesFromRoot;
@@ -7,6 +7,7 @@ import THEME_ID from "./identifier.js";
7
7
  export default function useTheme() {
8
8
  const theme = useThemeSystem(defaultTheme);
9
9
  if (process.env.NODE_ENV !== 'production') {
10
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
10
11
  // eslint-disable-next-line react-hooks/rules-of-hooks
11
12
  React.useDebugValue(theme);
12
13
  }
@@ -36,7 +36,7 @@ export function createFilterOptions(config = {}) {
36
36
  if (ignoreAccents) {
37
37
  candidate = stripDiacritics(candidate);
38
38
  }
39
- return matchFrom === 'start' ? candidate.indexOf(input) === 0 : candidate.indexOf(input) > -1;
39
+ return matchFrom === 'start' ? candidate.startsWith(input) : candidate.includes(input);
40
40
  });
41
41
  return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions;
42
42
  };
@@ -586,7 +586,7 @@ function useAutocomplete(props) {
586
586
  if (event.defaultMuiPrevented) {
587
587
  return;
588
588
  }
589
- if (focusedTag !== -1 && ['ArrowLeft', 'ArrowRight'].indexOf(event.key) === -1) {
589
+ if (focusedTag !== -1 && !['ArrowLeft', 'ArrowRight'].includes(event.key)) {
590
590
  setFocusedTag(-1);
591
591
  focusTag(-1);
592
592
  }
@@ -45,6 +45,7 @@ export default function useScrollTrigger(options = {}) {
45
45
  });
46
46
  };
47
47
  // See Option 3. https://github.com/facebook/react/issues/14476#issuecomment-471199055
48
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
48
49
  // eslint-disable-next-line react-hooks/exhaustive-deps
49
50
  }, [target, getTrigger, JSON.stringify(other)]);
50
51
  return trigger;
@@ -1,6 +1,6 @@
1
- export const version = "6.1.0";
1
+ export const version = "6.1.1-dev.20240919-130050-82a6448768";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("1");
4
- export const patch = Number("0");
5
- export const prerelease = undefined;
4
+ export const patch = Number("1");
5
+ export const prerelease = "dev.20240919";
6
6
  export default version;
@@ -17,6 +17,13 @@ var _useSlot = _interopRequireDefault(require("../utils/useSlot"));
17
17
  var _Fade = _interopRequireDefault(require("../Fade"));
18
18
  var _backdropClasses = require("./backdropClasses");
19
19
  var _jsxRuntime = require("react/jsx-runtime");
20
+ const removeOwnerState = props => {
21
+ const {
22
+ ownerState,
23
+ ...rest
24
+ } = props;
25
+ return rest;
26
+ };
20
27
  const useUtilityClasses = ownerState => {
21
28
  const {
22
29
  classes,
@@ -105,12 +112,12 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
105
112
  externalForwardedProps,
106
113
  ownerState
107
114
  });
108
- delete transitionProps.ownerState;
115
+ const transitionPropsRemoved = removeOwnerState(transitionProps);
109
116
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionSlot, {
110
117
  in: open,
111
118
  timeout: transitionDuration,
112
119
  ...other,
113
- ...transitionProps,
120
+ ...transitionPropsRemoved,
114
121
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(RootSlot, {
115
122
  "aria-hidden": true,
116
123
  ...rootProps,
@@ -85,7 +85,7 @@ function ClickAwayListener(props) {
85
85
 
86
86
  // If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js
87
87
  if (event.composedPath) {
88
- insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;
88
+ insideDOM = event.composedPath().includes(nodeRef.current);
89
89
  } else {
90
90
  insideDOM = !doc.documentElement.contains(
91
91
  // @ts-expect-error returns `false` as intended when not dispatched from a Node
@@ -177,9 +177,8 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
177
177
  }
178
178
  const focused = visuallyFocused !== undefined && !disabled ? visuallyFocused : focusedState;
179
179
  let registerEffect;
180
+ const registeredInput = React.useRef(false);
180
181
  if (process.env.NODE_ENV !== 'production') {
181
- // eslint-disable-next-line react-hooks/rules-of-hooks
182
- const registeredInput = React.useRef(false);
183
182
  registerEffect = () => {
184
183
  if (registeredInput.current) {
185
184
  console.error(['MUI: There are multiple `InputBase` components inside a FormControl.', 'This creates visual inconsistencies, only use one `InputBase`.'].join('\n'));
@@ -63,6 +63,7 @@ const withWidth = (options = {}) => Component => {
63
63
  */
64
64
  const keys = theme.breakpoints.keys.slice().reverse();
65
65
  const widthComputed = keys.reduce((output, key) => {
66
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
66
67
  // eslint-disable-next-line react-hooks/rules-of-hooks
67
68
  const matches = (0, _useMediaQuery.default)(theme.breakpoints.up(key));
68
69
  return !output && matches ? key : output;
package/node/Icon/Icon.js CHANGED
@@ -44,7 +44,7 @@ const IconRoot = (0, _zeroStyled.styled)('span', {
44
44
  userSelect: 'none',
45
45
  width: '1em',
46
46
  height: '1em',
47
- // Chrome fix for https://bugs.chromium.org/p/chromium/issues/detail?id=820541
47
+ // Chrome fix for https://issues.chromium.org/issues/41375697
48
48
  // To remove at some point.
49
49
  overflow: 'hidden',
50
50
  display: 'inline-block',
@@ -307,6 +307,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
307
307
  const [focused, setFocused] = React.useState(false);
308
308
  const muiFormControl = (0, _useFormControl.default)();
309
309
  if (process.env.NODE_ENV !== 'production') {
310
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
310
311
  // eslint-disable-next-line react-hooks/rules-of-hooks
311
312
  React.useEffect(() => {
312
313
  if (muiFormControl) {
@@ -400,6 +401,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
400
401
  // or auto filled by the browser before the hydration (for SSR).
401
402
  React.useEffect(() => {
402
403
  checkDirty(inputRef.current);
404
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
403
405
  // eslint-disable-next-line react-hooks/exhaustive-deps
404
406
  }, []);
405
407
  const handleClick = event => {
@@ -165,6 +165,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
165
165
  childProps.onExited = onExited;
166
166
  }
167
167
  const externalForwardedProps = {
168
+ ...other,
168
169
  slots: {
169
170
  root: components.Root,
170
171
  backdrop: components.Backdrop,
@@ -216,7 +217,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
216
217
  disablePortal: disablePortal,
217
218
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
218
219
  ...rootProps,
219
- ...other,
220
220
  children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(BackdropSlot, {
221
221
  ...backdropProps,
222
222
  ref: backdropRef
@@ -29,14 +29,14 @@ function isAriaHiddenForbiddenOnElement(element) {
29
29
  // can be children of body and can't have aria-hidden attribute.
30
30
  // cf. https://www.w3.org/TR/html-aria/#docconformance
31
31
  const forbiddenTagNames = ['TEMPLATE', 'SCRIPT', 'STYLE', 'LINK', 'MAP', 'META', 'NOSCRIPT', 'PICTURE', 'COL', 'COLGROUP', 'PARAM', 'SLOT', 'SOURCE', 'TRACK'];
32
- const isForbiddenTagName = forbiddenTagNames.indexOf(element.tagName) !== -1;
32
+ const isForbiddenTagName = forbiddenTagNames.includes(element.tagName);
33
33
  const isInputHidden = element.tagName === 'INPUT' && element.getAttribute('type') === 'hidden';
34
34
  return isForbiddenTagName || isInputHidden;
35
35
  }
36
36
  function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude, show) {
37
37
  const blacklist = [mountElement, currentElement, ...elementsToExclude];
38
38
  [].forEach.call(container.children, element => {
39
- const isNotExcludedElement = blacklist.indexOf(element) === -1;
39
+ const isNotExcludedElement = !blacklist.includes(element);
40
40
  const isNotForbiddenElement = !isAriaHiddenForbiddenOnElement(element);
41
41
  if (isNotExcludedElement && isNotForbiddenElement) {
42
42
  ariaHidden(element, show);
@@ -172,7 +172,7 @@ class ModalManager {
172
172
  return modalIndex;
173
173
  }
174
174
  mount(modal, props) {
175
- const containerIndex = findIndexOf(this.containers, item => item.modals.indexOf(modal) !== -1);
175
+ const containerIndex = findIndexOf(this.containers, item => item.modals.includes(modal));
176
176
  const containerInfo = this.containers[containerIndex];
177
177
  if (!containerInfo.restore) {
178
178
  containerInfo.restore = handleContainer(containerInfo, props);
@@ -183,7 +183,7 @@ class ModalManager {
183
183
  if (modalIndex === -1) {
184
184
  return modalIndex;
185
185
  }
186
- const containerIndex = findIndexOf(this.containers, item => item.modals.indexOf(modal) !== -1);
186
+ const containerIndex = findIndexOf(this.containers, item => item.modals.includes(modal));
187
187
  const containerInfo = this.containers[containerIndex];
188
188
  containerInfo.modals.splice(containerInfo.modals.indexOf(modal), 1);
189
189
  this.modals.splice(modalIndex, 1);
@@ -250,7 +250,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
250
250
  }
251
251
  const positioning = getPositioningStyle(element);
252
252
  if (positioning.top !== null) {
253
- element.style.top = positioning.top;
253
+ element.style.setProperty('top', positioning.top);
254
254
  }
255
255
  if (positioning.left !== null) {
256
256
  element.style.left = positioning.left;
@@ -187,6 +187,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
187
187
  setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
188
188
  displayRef.current.focus();
189
189
  }
190
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
190
191
  // eslint-disable-next-line react-hooks/exhaustive-deps
191
192
  }, [displayNode, autoWidth]);
192
193
  // `isOpenControlled` is ignored because the component should never switch between controlled and uncontrolled modes.
@@ -390,6 +391,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
390
391
  });
391
392
  });
392
393
  if (process.env.NODE_ENV !== 'production') {
394
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
393
395
  // eslint-disable-next-line react-hooks/rules-of-hooks
394
396
  React.useEffect(() => {
395
397
  if (!foundMatch && !multiple && value !== '') {
@@ -66,7 +66,9 @@ const pulseAnimation = typeof pulseKeyframe !== 'string' ? (0, _zeroStyled.css)`
66
66
  animation: ${pulseKeyframe} 2s ease-in-out 0.5s infinite;
67
67
  ` : null;
68
68
  const waveAnimation = typeof waveKeyframe !== 'string' ? (0, _zeroStyled.css)`
69
- animation: ${waveKeyframe} 2s linear 0.5s infinite;
69
+ &::after {
70
+ animation: ${waveKeyframe} 2s linear 0.5s infinite;
71
+ }
70
72
  ` : null;
71
73
  const SkeletonRoot = (0, _zeroStyled.styled)('span', {
72
74
  name: 'MuiSkeleton',
@@ -175,8 +177,8 @@ const SkeletonRoot = (0, _zeroStyled.styled)('span', {
175
177
  props: {
176
178
  animation: 'wave'
177
179
  },
178
- style: {
179
- '&::after': waveAnimation || {
180
+ style: waveAnimation || {
181
+ '&::after': {
180
182
  animation: `${waveKeyframe} 2s linear 0.5s infinite`
181
183
  }
182
184
  }
@@ -347,12 +347,12 @@ function useSlider(parameters) {
347
347
  left
348
348
  } = slider.getBoundingClientRect();
349
349
  let percent;
350
- if (axis.indexOf('vertical') === 0) {
350
+ if (axis.startsWith('vertical')) {
351
351
  percent = (bottom - finger.y) / height;
352
352
  } else {
353
353
  percent = (finger.x - left) / width;
354
354
  }
355
- if (axis.indexOf('-reverse') !== -1) {
355
+ if (axis.includes('-reverse')) {
356
356
  percent = 1 - percent;
357
357
  }
358
358
  let newValue;
@@ -210,6 +210,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
210
210
  if (!touchDetected.current) {
211
211
  return;
212
212
  }
213
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- claimedSwipeInstance is a singleton
213
214
  claimedSwipeInstance = null;
214
215
  touchDetected.current = false;
215
216
  ReactDOM.flushSync(() => {
@@ -11,7 +11,7 @@ function isValueSelected(value, candidate) {
11
11
  return false;
12
12
  }
13
13
  if (Array.isArray(candidate)) {
14
- return candidate.indexOf(value) >= 0;
14
+ return candidate.includes(value);
15
15
  }
16
16
  return value === candidate;
17
17
  }
@@ -377,12 +377,14 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
377
377
  });
378
378
  let open = openState;
379
379
  if (process.env.NODE_ENV !== 'production') {
380
- // eslint-disable-next-line react-hooks/rules-of-hooks
380
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
381
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
381
382
  const {
382
383
  current: isControlled
383
384
  } = React.useRef(openProp !== undefined);
384
385
 
385
- // eslint-disable-next-line react-hooks/rules-of-hooks
386
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
387
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
386
388
  React.useEffect(() => {
387
389
  if (childNode && childNode.disabled && !isControlled && title !== '' && childNode.tagName.toLowerCase() === 'button') {
388
390
  console.error(['MUI: You are providing a disabled `button` child to the Tooltip component.', 'A disabled element does not fire events.', "Tooltip needs to listen to the child element's events to display the title.", '', 'Add a simple wrapper element, such as a `span`.'].join('\n'));
@@ -564,7 +566,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
564
566
  if (process.env.NODE_ENV !== 'production') {
565
567
  childrenProps['data-mui-internal-clone-element'] = true;
566
568
 
567
- // eslint-disable-next-line react-hooks/rules-of-hooks
569
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
570
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
568
571
  React.useEffect(() => {
569
572
  if (childNode && !childNode.getAttribute('data-mui-internal-clone-element')) {
570
573
  console.error(['MUI: The `children` component of the Tooltip is not forwarding its props correctly.', 'Please make sure that props are spread on the same element that the ref is applied to.'].join('\n'));
@@ -21,7 +21,7 @@ function getTabIndex(node) {
21
21
  }
22
22
 
23
23
  // Browsers do not return `tabIndex` correctly for contentEditable nodes;
24
- // https://bugs.chromium.org/p/chromium/issues/detail?id=661108&q=contenteditable%20tabindex&can=2
24
+ // https://issues.chromium.org/issues/41283952
25
25
  // so if they don't have a tabindex attribute specifically set, assume it's 0.
26
26
  // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
27
27
  // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.1.0
2
+ * @mui/material v6.1.1-dev.20240919-130050-82a6448768
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -11,7 +11,7 @@ var _createPalette = _interopRequireDefault(require("./createPalette"));
11
11
  var _getOverlayAlpha = _interopRequireDefault(require("./getOverlayAlpha"));
12
12
  const defaultDarkOverlays = [...Array(25)].map((_, index) => {
13
13
  if (index === 0) {
14
- return undefined;
14
+ return 'none';
15
15
  }
16
16
  const overlay = (0, _getOverlayAlpha.default)(index);
17
17
  return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
@@ -7,5 +7,5 @@ exports.default = void 0;
7
7
  /**
8
8
  * @internal These variables should not appear in the :root stylesheet when the `defaultColorScheme="dark"`
9
9
  */
10
- const excludeVariablesFromRoot = cssVarPrefix => [...[...Array(24)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}overlays-${index + 1}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkColor`];
10
+ const excludeVariablesFromRoot = cssVarPrefix => [...[...Array(25)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}overlays-${index}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkColor`];
11
11
  var _default = exports.default = excludeVariablesFromRoot;
@@ -14,6 +14,7 @@ var _identifier = _interopRequireDefault(require("./identifier"));
14
14
  function useTheme() {
15
15
  const theme = (0, _system.useTheme)(_defaultTheme.default);
16
16
  if (process.env.NODE_ENV !== 'production') {
17
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
17
18
  // eslint-disable-next-line react-hooks/rules-of-hooks
18
19
  React.useDebugValue(theme);
19
20
  }
@@ -42,7 +42,7 @@ function createFilterOptions(config = {}) {
42
42
  if (ignoreAccents) {
43
43
  candidate = stripDiacritics(candidate);
44
44
  }
45
- return matchFrom === 'start' ? candidate.indexOf(input) === 0 : candidate.indexOf(input) > -1;
45
+ return matchFrom === 'start' ? candidate.startsWith(input) : candidate.includes(input);
46
46
  });
47
47
  return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions;
48
48
  };
@@ -592,7 +592,7 @@ function useAutocomplete(props) {
592
592
  if (event.defaultMuiPrevented) {
593
593
  return;
594
594
  }
595
- if (focusedTag !== -1 && ['ArrowLeft', 'ArrowRight'].indexOf(event.key) === -1) {
595
+ if (focusedTag !== -1 && !['ArrowLeft', 'ArrowRight'].includes(event.key)) {
596
596
  setFocusedTag(-1);
597
597
  focusTag(-1);
598
598
  }
@@ -51,6 +51,7 @@ function useScrollTrigger(options = {}) {
51
51
  });
52
52
  };
53
53
  // See Option 3. https://github.com/facebook/react/issues/14476#issuecomment-471199055
54
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
54
55
  // eslint-disable-next-line react-hooks/exhaustive-deps
55
56
  }, [target, getTrigger, JSON.stringify(other)]);
56
57
  return trigger;
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
7
- const version = exports.version = "6.1.0";
7
+ const version = exports.version = "6.1.1-dev.20240919-130050-82a6448768";
8
8
  const major = exports.major = Number("6");
9
9
  const minor = exports.minor = Number("1");
10
- const patch = exports.patch = Number("0");
11
- const prerelease = exports.prerelease = undefined;
10
+ const patch = exports.patch = Number("1");
11
+ const prerelease = exports.prerelease = "dev.20240919";
12
12
  var _default = exports.default = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material",
3
- "version": "6.1.0",
3
+ "version": "6.1.1-dev.20240919-130050-82a6448768",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "https://github.com/mui/material-ui.git",
17
+ "url": "git+https://github.com/mui/material-ui.git",
18
18
  "directory": "packages/mui-material"
19
19
  },
20
20
  "license": "MIT",
@@ -35,10 +35,10 @@
35
35
  "prop-types": "^15.8.1",
36
36
  "react-is": "^18.3.1",
37
37
  "react-transition-group": "^4.4.5",
38
- "@mui/core-downloads-tracker": "^6.1.0",
39
- "@mui/system": "^6.1.0",
40
- "@mui/utils": "^6.1.0",
41
- "@mui/types": "^7.2.16"
38
+ "@mui/core-downloads-tracker": "^6.1.1",
39
+ "@mui/system": "^6.1.1-dev.20240919-130050-82a6448768",
40
+ "@mui/types": "^7.2.17",
41
+ "@mui/utils": "^6.1.1-dev.20240919-130050-82a6448768"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@emotion/react": "^11.5.0",
@@ -46,7 +46,7 @@
46
46
  "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
47
47
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
48
48
  "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
49
- "@mui/material-pigment-css": "^6.1.0"
49
+ "@mui/material-pigment-css": "^6.1.1-dev.20240919-130050-82a6448768"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@types/react": {
@@ -5,5 +5,5 @@ export declare function getOpacity(mode: 'light' | 'dark'): {
5
5
  switchTrackDisabled: number;
6
6
  switchTrack: number;
7
7
  };
8
- export declare function getOverlays(mode: 'light' | 'dark'): (string | undefined)[];
8
+ export declare function getOverlays(mode: 'light' | 'dark'): string[];
9
9
  export default function createColorScheme(options: ColorSystemOptions): ColorSystemOptions;
@@ -2,7 +2,7 @@ import createPalette from "./createPalette.js";
2
2
  import getOverlayAlpha from "./getOverlayAlpha.js";
3
3
  const defaultDarkOverlays = [...Array(25)].map((_, index) => {
4
4
  if (index === 0) {
5
- return undefined;
5
+ return 'none';
6
6
  }
7
7
  const overlay = getOverlayAlpha(index);
8
8
  return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * @internal These variables should not appear in the :root stylesheet when the `defaultColorScheme="dark"`
3
3
  */
4
- const excludeVariablesFromRoot = cssVarPrefix => [...[...Array(24)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}overlays-${index + 1}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkColor`];
4
+ const excludeVariablesFromRoot = cssVarPrefix => [...[...Array(25)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}overlays-${index}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkColor`];
5
5
  export default excludeVariablesFromRoot;
@@ -7,6 +7,7 @@ import THEME_ID from "./identifier.js";
7
7
  export default function useTheme() {
8
8
  const theme = useThemeSystem(defaultTheme);
9
9
  if (process.env.NODE_ENV !== 'production') {
10
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
10
11
  // eslint-disable-next-line react-hooks/rules-of-hooks
11
12
  React.useDebugValue(theme);
12
13
  }
@@ -36,7 +36,7 @@ export function createFilterOptions(config = {}) {
36
36
  if (ignoreAccents) {
37
37
  candidate = stripDiacritics(candidate);
38
38
  }
39
- return matchFrom === 'start' ? candidate.indexOf(input) === 0 : candidate.indexOf(input) > -1;
39
+ return matchFrom === 'start' ? candidate.startsWith(input) : candidate.includes(input);
40
40
  });
41
41
  return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions;
42
42
  };
@@ -586,7 +586,7 @@ function useAutocomplete(props) {
586
586
  if (event.defaultMuiPrevented) {
587
587
  return;
588
588
  }
589
- if (focusedTag !== -1 && ['ArrowLeft', 'ArrowRight'].indexOf(event.key) === -1) {
589
+ if (focusedTag !== -1 && !['ArrowLeft', 'ArrowRight'].includes(event.key)) {
590
590
  setFocusedTag(-1);
591
591
  focusTag(-1);
592
592
  }
@@ -45,6 +45,7 @@ export default function useScrollTrigger(options = {}) {
45
45
  });
46
46
  };
47
47
  // See Option 3. https://github.com/facebook/react/issues/14476#issuecomment-471199055
48
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
48
49
  // eslint-disable-next-line react-hooks/exhaustive-deps
49
50
  }, [target, getTrigger, JSON.stringify(other)]);
50
51
  return trigger;
package/version/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export const version = "6.1.0";
1
+ export const version = "6.1.1-dev.20240919-130050-82a6448768";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("1");
4
- export const patch = Number("0");
5
- export const prerelease = undefined;
4
+ export const patch = Number("1");
5
+ export const prerelease = "dev.20240919";
6
6
  export default version;