@mui/material 6.1.0 → 6.1.1

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 (68) 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/InputBase/InputBase.js +2 -0
  8. package/Modal/Modal.js +1 -1
  9. package/Modal/ModalManager.js +4 -4
  10. package/Popover/Popover.js +1 -1
  11. package/Select/SelectInput.js +2 -0
  12. package/Skeleton/Skeleton.js +5 -3
  13. package/Slider/useSlider.js +2 -2
  14. package/SwipeableDrawer/SwipeableDrawer.js +1 -0
  15. package/ToggleButtonGroup/isValueSelected.js +1 -1
  16. package/Tooltip/Tooltip.js +6 -3
  17. package/index.d.ts +1 -0
  18. package/index.js +1 -1
  19. package/modern/Backdrop/Backdrop.js +9 -2
  20. package/modern/ClickAwayListener/ClickAwayListener.js +1 -1
  21. package/modern/FormControl/FormControl.js +1 -2
  22. package/modern/Hidden/withWidth.js +1 -0
  23. package/modern/InputBase/InputBase.js +2 -0
  24. package/modern/Modal/Modal.js +1 -1
  25. package/modern/Modal/ModalManager.js +4 -4
  26. package/modern/Popover/Popover.js +1 -1
  27. package/modern/Select/SelectInput.js +2 -0
  28. package/modern/Skeleton/Skeleton.js +5 -3
  29. package/modern/Slider/useSlider.js +2 -2
  30. package/modern/SwipeableDrawer/SwipeableDrawer.js +1 -0
  31. package/modern/ToggleButtonGroup/isValueSelected.js +1 -1
  32. package/modern/Tooltip/Tooltip.js +6 -3
  33. package/modern/index.js +1 -1
  34. package/modern/styles/createColorScheme.js +1 -1
  35. package/modern/styles/excludeVariablesFromRoot.js +1 -1
  36. package/modern/styles/useTheme.js +1 -0
  37. package/modern/useAutocomplete/useAutocomplete.js +2 -2
  38. package/modern/useScrollTrigger/useScrollTrigger.js +1 -0
  39. package/modern/version/index.js +2 -2
  40. package/node/Backdrop/Backdrop.js +9 -2
  41. package/node/ClickAwayListener/ClickAwayListener.js +1 -1
  42. package/node/FormControl/FormControl.js +1 -2
  43. package/node/Hidden/withWidth.js +1 -0
  44. package/node/InputBase/InputBase.js +2 -0
  45. package/node/Modal/Modal.js +1 -1
  46. package/node/Modal/ModalManager.js +4 -4
  47. package/node/Popover/Popover.js +1 -1
  48. package/node/Select/SelectInput.js +2 -0
  49. package/node/Skeleton/Skeleton.js +5 -3
  50. package/node/Slider/useSlider.js +2 -2
  51. package/node/SwipeableDrawer/SwipeableDrawer.js +1 -0
  52. package/node/ToggleButtonGroup/isValueSelected.js +1 -1
  53. package/node/Tooltip/Tooltip.js +6 -3
  54. package/node/index.js +1 -1
  55. package/node/styles/createColorScheme.js +1 -1
  56. package/node/styles/excludeVariablesFromRoot.js +1 -1
  57. package/node/styles/useTheme.js +1 -0
  58. package/node/useAutocomplete/useAutocomplete.js +2 -2
  59. package/node/useScrollTrigger/useScrollTrigger.js +1 -0
  60. package/node/version/index.js +2 -2
  61. package/package.json +7 -7
  62. package/styles/createColorScheme.d.ts +1 -1
  63. package/styles/createColorScheme.js +1 -1
  64. package/styles/excludeVariablesFromRoot.js +1 -1
  65. package/styles/useTheme.js +1 -0
  66. package/useAutocomplete/useAutocomplete.js +2 -2
  67. package/useScrollTrigger/useScrollTrigger.js +1 -0
  68. package/version/index.js +2 -2
@@ -10,6 +10,13 @@ import useSlot from "../utils/useSlot.js";
10
10
  import Fade from "../Fade/index.js";
11
11
  import { getBackdropUtilityClass } from "./backdropClasses.js";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ const removeOwnerState = props => {
14
+ const {
15
+ ownerState,
16
+ ...rest
17
+ } = props;
18
+ return rest;
19
+ };
13
20
  const useUtilityClasses = ownerState => {
14
21
  const {
15
22
  classes,
@@ -98,12 +105,12 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
98
105
  externalForwardedProps,
99
106
  ownerState
100
107
  });
101
- delete transitionProps.ownerState;
108
+ const transitionPropsRemoved = removeOwnerState(transitionProps);
102
109
  return /*#__PURE__*/_jsx(TransitionSlot, {
103
110
  in: open,
104
111
  timeout: transitionDuration,
105
112
  ...other,
106
- ...transitionProps,
113
+ ...transitionPropsRemoved,
107
114
  children: /*#__PURE__*/_jsx(RootSlot, {
108
115
  "aria-hidden": true,
109
116
  ...rootProps,
package/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## v6.1.1
4
+
5
+ <!-- generated comparing v6.1.0..master -->
6
+
7
+ _Sep 19, 2024_
8
+
9
+ A big thanks to the 18 contributors who made this release possible.
10
+
11
+ ### `@mui/material@6.1.1`
12
+
13
+ - [Grid] Bring back `GridProps` and `GridTypeMap` (#43717) @DiegoAndai
14
+ - [Paper] Fix wrong background-image on Paper when elevation is 0 (#43723) @ZeeshanTamboli
15
+ - [Skeleton] Fix wave animation for styled-components (#43740) @siriwatknp
16
+ - [Modal] Fix event handlers overriding behavior (#43757) @sai6855
17
+
18
+ ### `@mui/system@6.1.1`
19
+
20
+ - Pass the stylesheet directly to `GlobalStyles` (#43739) @siriwatknp
21
+
22
+ ### `@mui/utils@6.1.1`
23
+
24
+ - Fix "useId" & "useSyncExternalStore" imports to not be statically analyzable (#43360) @yash49
25
+
26
+ ### Docs
27
+
28
+ - [material-ui][Breadcrumbs] Document CondensedWithMenu option for Breadcrumbs (#42973) @Sergio16T
29
+ - [material-ui][CircularProgress] Add Circular size demo (#43734) @sai6855
30
+ - [material-ui][slider] Fix slider in color customization playground twitches when sliding (#43671) @Nashyn
31
+ - [material-ui][slider] Polish Music player demo (#43748) @oliviertassinari
32
+ - [material-ui] Document Typography color prop breaking change (#43735) @aarongarciah
33
+ - [material-ui] Add docs for complementary Table components (#43756) @Juneezee
34
+ - [material-ui] Improve minimizing bundle docs (#43781) @ZeeshanTamboli
35
+ - [pigment-css] Call out Pigment being in alpha (#43725) @aarongarciah
36
+ - [pigment-css] Fix typo globalCSS -> globalCss (#43754) @hiro0218
37
+ - [test] Improve demos for better regression screenshots (#43742) @aarongarciah
38
+ - Fix minor typo (#42899) @xconverge
39
+ - Revert icon search virtualization (#43569) @Janpot
40
+ - Fix MUI Treasury Layout broken links (#43752) @oliviertassinari
41
+ - Fix 301 link to design asset @oliviertassinari
42
+ - Update release schedule table after v6 stable (#43726) @sahil-ag
43
+ - Fix bundle size link regression @oliviertassinari
44
+
45
+ ### Core
46
+
47
+ - [code-infra] Allow overriding all `options` of `useFakeTimers` function (#43729) @LukasTy
48
+ - [core] Fix 301 link to Next.js and git diff @oliviertassinari
49
+ - [core] Fix package.json repository rule @oliviertassinari
50
+ - [core] Remove redundant window @oliviertassinari
51
+ - [core] Fix some issues reported by eslint-plugin-react-compiler (#43117) @binsmyth
52
+ - [core] Replace more `indexOf` with `includes` (#43694) @Juneezee
53
+ - [core] Remove /.yarn (#43712) @oliviertassinari
54
+ - [docs-infra] Enable synthetic default imports in TypeScript config (#43747) @morozow
55
+ - [docs-infra] Fix Vale config for TypeScript references (#43751) @oliviertassinari
56
+ - [docs-infra] Fix toolbar arrow order (#43627) @oliviertassinari
57
+ - [docs-infra] Fix missing dependencies in multi-tab demos (#43713) @cherniavskii
58
+ - [docs-infra] Fix API search link regression (#43662) @oliviertassinari
59
+ - [test] Update font-awesome CSS file in regression tests fixture (#43745) @Janpot
60
+ - [test] Remove position:relative from regression container (#43743) @aarongarciah
61
+ - [test] Remove top-level inline-block from the regression tests (#43656) @Janpot
62
+ - [website] Match pricing page with linked page h1 @oliviertassinari
63
+
64
+ All contributors of this release in alphabetical order: @aarongarciah, @binsmyth, @cherniavskii, @DiegoAndai, @Janpot, @Juneezee, @LukasTy, @mnajdova, @morozow, @Nashyn, @oliviertassinari, @sahil-ag, @sai6855, @Sergio16T, @siriwatknp, @xconverge, @yash49, @ZeeshanTamboli
65
+
3
66
  ## v6.1.0
4
67
 
5
68
  <!-- generated comparing v6.0.2..master -->
@@ -79,7 +79,7 @@ function ClickAwayListener(props) {
79
79
 
80
80
  // If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js
81
81
  if (event.composedPath) {
82
- insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;
82
+ insideDOM = event.composedPath().includes(nodeRef.current);
83
83
  } else {
84
84
  insideDOM = !doc.documentElement.contains(
85
85
  // @ts-expect-error returns `false` as intended when not dispatched from a Node
@@ -170,9 +170,8 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
170
170
  }
171
171
  const focused = visuallyFocused !== undefined && !disabled ? visuallyFocused : focusedState;
172
172
  let registerEffect;
173
+ const registeredInput = React.useRef(false);
173
174
  if (process.env.NODE_ENV !== 'production') {
174
- // eslint-disable-next-line react-hooks/rules-of-hooks
175
- const registeredInput = React.useRef(false);
176
175
  registerEffect = () => {
177
176
  if (registeredInput.current) {
178
177
  console.error(['MUI: There are multiple `InputBase` components inside a FormControl.', 'This creates visual inconsistencies, only use one `InputBase`.'].join('\n'));
package/Grid/Grid.d.ts CHANGED
@@ -149,6 +149,9 @@ export interface GridOwnProps extends SystemProps<Theme>, Breakpoints {
149
149
  zeroMinWidth?: boolean;
150
150
  }
151
151
 
152
+ /**
153
+ * @deprecated Use the [`Grid2`](https://mui.com/material-ui/react-grid2/) component instead.
154
+ */
152
155
  export interface GridTypeMap<
153
156
  AdditionalProps = {},
154
157
  RootComponent extends React.ElementType = 'div',
@@ -171,6 +174,9 @@ export interface GridTypeMap<
171
174
  */
172
175
  declare const Grid: OverridableComponent<GridTypeMap>;
173
176
 
177
+ /**
178
+ * @deprecated Use the [`Grid2`](https://mui.com/material-ui/react-grid2/) component instead.
179
+ */
174
180
  export type GridProps<
175
181
  RootComponent extends React.ElementType = GridTypeMap['defaultComponent'],
176
182
  AdditionalProps = {},
@@ -53,6 +53,7 @@ const withWidth = (options = {}) => Component => {
53
53
  */
54
54
  const keys = theme.breakpoints.keys.slice().reverse();
55
55
  const widthComputed = keys.reduce((output, key) => {
56
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
56
57
  // eslint-disable-next-line react-hooks/rules-of-hooks
57
58
  const matches = useMediaQuery(theme.breakpoints.up(key));
58
59
  return !output && matches ? key : output;
@@ -298,6 +298,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
298
298
  const [focused, setFocused] = React.useState(false);
299
299
  const muiFormControl = useFormControl();
300
300
  if (process.env.NODE_ENV !== 'production') {
301
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
301
302
  // eslint-disable-next-line react-hooks/rules-of-hooks
302
303
  React.useEffect(() => {
303
304
  if (muiFormControl) {
@@ -391,6 +392,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
391
392
  // or auto filled by the browser before the hydration (for SSR).
392
393
  React.useEffect(() => {
393
394
  checkDirty(inputRef.current);
395
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
394
396
  // eslint-disable-next-line react-hooks/exhaustive-deps
395
397
  }, []);
396
398
  const handleClick = event => {
package/Modal/Modal.js CHANGED
@@ -158,6 +158,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
158
158
  childProps.onExited = onExited;
159
159
  }
160
160
  const externalForwardedProps = {
161
+ ...other,
161
162
  slots: {
162
163
  root: components.Root,
163
164
  backdrop: components.Backdrop,
@@ -209,7 +210,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
209
210
  disablePortal: disablePortal,
210
211
  children: /*#__PURE__*/_jsxs(RootSlot, {
211
212
  ...rootProps,
212
- ...other,
213
213
  children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/_jsx(BackdropSlot, {
214
214
  ...backdropProps,
215
215
  ref: backdropRef
@@ -22,14 +22,14 @@ function isAriaHiddenForbiddenOnElement(element) {
22
22
  // can be children of body and can't have aria-hidden attribute.
23
23
  // cf. https://www.w3.org/TR/html-aria/#docconformance
24
24
  const forbiddenTagNames = ['TEMPLATE', 'SCRIPT', 'STYLE', 'LINK', 'MAP', 'META', 'NOSCRIPT', 'PICTURE', 'COL', 'COLGROUP', 'PARAM', 'SLOT', 'SOURCE', 'TRACK'];
25
- const isForbiddenTagName = forbiddenTagNames.indexOf(element.tagName) !== -1;
25
+ const isForbiddenTagName = forbiddenTagNames.includes(element.tagName);
26
26
  const isInputHidden = element.tagName === 'INPUT' && element.getAttribute('type') === 'hidden';
27
27
  return isForbiddenTagName || isInputHidden;
28
28
  }
29
29
  function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude, show) {
30
30
  const blacklist = [mountElement, currentElement, ...elementsToExclude];
31
31
  [].forEach.call(container.children, element => {
32
- const isNotExcludedElement = blacklist.indexOf(element) === -1;
32
+ const isNotExcludedElement = !blacklist.includes(element);
33
33
  const isNotForbiddenElement = !isAriaHiddenForbiddenOnElement(element);
34
34
  if (isNotExcludedElement && isNotForbiddenElement) {
35
35
  ariaHidden(element, show);
@@ -165,7 +165,7 @@ export class ModalManager {
165
165
  return modalIndex;
166
166
  }
167
167
  mount(modal, props) {
168
- const containerIndex = findIndexOf(this.containers, item => item.modals.indexOf(modal) !== -1);
168
+ const containerIndex = findIndexOf(this.containers, item => item.modals.includes(modal));
169
169
  const containerInfo = this.containers[containerIndex];
170
170
  if (!containerInfo.restore) {
171
171
  containerInfo.restore = handleContainer(containerInfo, props);
@@ -176,7 +176,7 @@ export class ModalManager {
176
176
  if (modalIndex === -1) {
177
177
  return modalIndex;
178
178
  }
179
- const containerIndex = findIndexOf(this.containers, item => item.modals.indexOf(modal) !== -1);
179
+ const containerIndex = findIndexOf(this.containers, item => item.modals.includes(modal));
180
180
  const containerInfo = this.containers[containerIndex];
181
181
  containerInfo.modals.splice(containerInfo.modals.indexOf(modal), 1);
182
182
  this.modals.splice(modalIndex, 1);
@@ -241,7 +241,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
241
241
  }
242
242
  const positioning = getPositioningStyle(element);
243
243
  if (positioning.top !== null) {
244
- element.style.top = positioning.top;
244
+ element.style.setProperty('top', positioning.top);
245
245
  }
246
246
  if (positioning.left !== null) {
247
247
  element.style.left = positioning.left;
@@ -180,6 +180,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
180
180
  setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
181
181
  displayRef.current.focus();
182
182
  }
183
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
183
184
  // eslint-disable-next-line react-hooks/exhaustive-deps
184
185
  }, [displayNode, autoWidth]);
185
186
  // `isOpenControlled` is ignored because the component should never switch between controlled and uncontrolled modes.
@@ -383,6 +384,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
383
384
  });
384
385
  });
385
386
  if (process.env.NODE_ENV !== 'production') {
387
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
386
388
  // eslint-disable-next-line react-hooks/rules-of-hooks
387
389
  React.useEffect(() => {
388
390
  if (!foundMatch && !multiple && value !== '') {
@@ -59,7 +59,9 @@ const pulseAnimation = typeof pulseKeyframe !== 'string' ? css`
59
59
  animation: ${pulseKeyframe} 2s ease-in-out 0.5s infinite;
60
60
  ` : null;
61
61
  const waveAnimation = typeof waveKeyframe !== 'string' ? css`
62
- animation: ${waveKeyframe} 2s linear 0.5s infinite;
62
+ &::after {
63
+ animation: ${waveKeyframe} 2s linear 0.5s infinite;
64
+ }
63
65
  ` : null;
64
66
  const SkeletonRoot = styled('span', {
65
67
  name: 'MuiSkeleton',
@@ -168,8 +170,8 @@ const SkeletonRoot = styled('span', {
168
170
  props: {
169
171
  animation: 'wave'
170
172
  },
171
- style: {
172
- '&::after': waveAnimation || {
173
+ style: waveAnimation || {
174
+ '&::after': {
173
175
  animation: `${waveKeyframe} 2s linear 0.5s infinite`
174
176
  }
175
177
  }
@@ -337,12 +337,12 @@ export function useSlider(parameters) {
337
337
  left
338
338
  } = slider.getBoundingClientRect();
339
339
  let percent;
340
- if (axis.indexOf('vertical') === 0) {
340
+ if (axis.startsWith('vertical')) {
341
341
  percent = (bottom - finger.y) / height;
342
342
  } else {
343
343
  percent = (finger.x - left) / width;
344
344
  }
345
- if (axis.indexOf('-reverse') !== -1) {
345
+ if (axis.includes('-reverse')) {
346
346
  percent = 1 - percent;
347
347
  }
348
348
  let newValue;
@@ -203,6 +203,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
203
203
  if (!touchDetected.current) {
204
204
  return;
205
205
  }
206
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- claimedSwipeInstance is a singleton
206
207
  claimedSwipeInstance = null;
207
208
  touchDetected.current = false;
208
209
  ReactDOM.flushSync(() => {
@@ -5,7 +5,7 @@ export default function isValueSelected(value, candidate) {
5
5
  return false;
6
6
  }
7
7
  if (Array.isArray(candidate)) {
8
- return candidate.indexOf(value) >= 0;
8
+ return candidate.includes(value);
9
9
  }
10
10
  return value === candidate;
11
11
  }
@@ -369,12 +369,14 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
369
369
  });
370
370
  let open = openState;
371
371
  if (process.env.NODE_ENV !== 'production') {
372
- // eslint-disable-next-line react-hooks/rules-of-hooks
372
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
373
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
373
374
  const {
374
375
  current: isControlled
375
376
  } = React.useRef(openProp !== undefined);
376
377
 
377
- // eslint-disable-next-line react-hooks/rules-of-hooks
378
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
379
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
378
380
  React.useEffect(() => {
379
381
  if (childNode && childNode.disabled && !isControlled && title !== '' && childNode.tagName.toLowerCase() === 'button') {
380
382
  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'));
@@ -556,7 +558,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
556
558
  if (process.env.NODE_ENV !== 'production') {
557
559
  childrenProps['data-mui-internal-clone-element'] = true;
558
560
 
559
- // eslint-disable-next-line react-hooks/rules-of-hooks
561
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
562
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
560
563
  React.useEffect(() => {
561
564
  if (childNode && !childNode.getAttribute('data-mui-internal-clone-element')) {
562
565
  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'));
package/index.d.ts CHANGED
@@ -204,6 +204,7 @@ export { default as FormLabel } from './FormLabel';
204
204
  export * from './FormLabel';
205
205
 
206
206
  export { default as Grid } from './Grid';
207
+ export { GridProps, GridTypeMap } from './Grid';
207
208
 
208
209
  export { default as Grid2 } from './Grid2';
209
210
  export * from './Grid2';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.1.0
2
+ * @mui/material v6.1.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -10,6 +10,13 @@ import useSlot from "../utils/useSlot.js";
10
10
  import Fade from "../Fade/index.js";
11
11
  import { getBackdropUtilityClass } from "./backdropClasses.js";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ const removeOwnerState = props => {
14
+ const {
15
+ ownerState,
16
+ ...rest
17
+ } = props;
18
+ return rest;
19
+ };
13
20
  const useUtilityClasses = ownerState => {
14
21
  const {
15
22
  classes,
@@ -98,12 +105,12 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
98
105
  externalForwardedProps,
99
106
  ownerState
100
107
  });
101
- delete transitionProps.ownerState;
108
+ const transitionPropsRemoved = removeOwnerState(transitionProps);
102
109
  return /*#__PURE__*/_jsx(TransitionSlot, {
103
110
  in: open,
104
111
  timeout: transitionDuration,
105
112
  ...other,
106
- ...transitionProps,
113
+ ...transitionPropsRemoved,
107
114
  children: /*#__PURE__*/_jsx(RootSlot, {
108
115
  "aria-hidden": true,
109
116
  ...rootProps,
@@ -79,7 +79,7 @@ function ClickAwayListener(props) {
79
79
 
80
80
  // If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js
81
81
  if (event.composedPath) {
82
- insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;
82
+ insideDOM = event.composedPath().includes(nodeRef.current);
83
83
  } else {
84
84
  insideDOM = !doc.documentElement.contains(
85
85
  // @ts-expect-error returns `false` as intended when not dispatched from a Node
@@ -170,9 +170,8 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
170
170
  }
171
171
  const focused = visuallyFocused !== undefined && !disabled ? visuallyFocused : focusedState;
172
172
  let registerEffect;
173
+ const registeredInput = React.useRef(false);
173
174
  if (process.env.NODE_ENV !== 'production') {
174
- // eslint-disable-next-line react-hooks/rules-of-hooks
175
- const registeredInput = React.useRef(false);
176
175
  registerEffect = () => {
177
176
  if (registeredInput.current) {
178
177
  console.error(['MUI: There are multiple `InputBase` components inside a FormControl.', 'This creates visual inconsistencies, only use one `InputBase`.'].join('\n'));
@@ -53,6 +53,7 @@ const withWidth = (options = {}) => Component => {
53
53
  */
54
54
  const keys = theme.breakpoints.keys.slice().reverse();
55
55
  const widthComputed = keys.reduce((output, key) => {
56
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
56
57
  // eslint-disable-next-line react-hooks/rules-of-hooks
57
58
  const matches = useMediaQuery(theme.breakpoints.up(key));
58
59
  return !output && matches ? key : output;
@@ -298,6 +298,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
298
298
  const [focused, setFocused] = React.useState(false);
299
299
  const muiFormControl = useFormControl();
300
300
  if (process.env.NODE_ENV !== 'production') {
301
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
301
302
  // eslint-disable-next-line react-hooks/rules-of-hooks
302
303
  React.useEffect(() => {
303
304
  if (muiFormControl) {
@@ -391,6 +392,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
391
392
  // or auto filled by the browser before the hydration (for SSR).
392
393
  React.useEffect(() => {
393
394
  checkDirty(inputRef.current);
395
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
394
396
  // eslint-disable-next-line react-hooks/exhaustive-deps
395
397
  }, []);
396
398
  const handleClick = event => {
@@ -158,6 +158,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
158
158
  childProps.onExited = onExited;
159
159
  }
160
160
  const externalForwardedProps = {
161
+ ...other,
161
162
  slots: {
162
163
  root: components.Root,
163
164
  backdrop: components.Backdrop,
@@ -209,7 +210,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
209
210
  disablePortal: disablePortal,
210
211
  children: /*#__PURE__*/_jsxs(RootSlot, {
211
212
  ...rootProps,
212
- ...other,
213
213
  children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/_jsx(BackdropSlot, {
214
214
  ...backdropProps,
215
215
  ref: backdropRef
@@ -22,14 +22,14 @@ function isAriaHiddenForbiddenOnElement(element) {
22
22
  // can be children of body and can't have aria-hidden attribute.
23
23
  // cf. https://www.w3.org/TR/html-aria/#docconformance
24
24
  const forbiddenTagNames = ['TEMPLATE', 'SCRIPT', 'STYLE', 'LINK', 'MAP', 'META', 'NOSCRIPT', 'PICTURE', 'COL', 'COLGROUP', 'PARAM', 'SLOT', 'SOURCE', 'TRACK'];
25
- const isForbiddenTagName = forbiddenTagNames.indexOf(element.tagName) !== -1;
25
+ const isForbiddenTagName = forbiddenTagNames.includes(element.tagName);
26
26
  const isInputHidden = element.tagName === 'INPUT' && element.getAttribute('type') === 'hidden';
27
27
  return isForbiddenTagName || isInputHidden;
28
28
  }
29
29
  function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude, show) {
30
30
  const blacklist = [mountElement, currentElement, ...elementsToExclude];
31
31
  [].forEach.call(container.children, element => {
32
- const isNotExcludedElement = blacklist.indexOf(element) === -1;
32
+ const isNotExcludedElement = !blacklist.includes(element);
33
33
  const isNotForbiddenElement = !isAriaHiddenForbiddenOnElement(element);
34
34
  if (isNotExcludedElement && isNotForbiddenElement) {
35
35
  ariaHidden(element, show);
@@ -165,7 +165,7 @@ export class ModalManager {
165
165
  return modalIndex;
166
166
  }
167
167
  mount(modal, props) {
168
- const containerIndex = findIndexOf(this.containers, item => item.modals.indexOf(modal) !== -1);
168
+ const containerIndex = findIndexOf(this.containers, item => item.modals.includes(modal));
169
169
  const containerInfo = this.containers[containerIndex];
170
170
  if (!containerInfo.restore) {
171
171
  containerInfo.restore = handleContainer(containerInfo, props);
@@ -176,7 +176,7 @@ export class ModalManager {
176
176
  if (modalIndex === -1) {
177
177
  return modalIndex;
178
178
  }
179
- const containerIndex = findIndexOf(this.containers, item => item.modals.indexOf(modal) !== -1);
179
+ const containerIndex = findIndexOf(this.containers, item => item.modals.includes(modal));
180
180
  const containerInfo = this.containers[containerIndex];
181
181
  containerInfo.modals.splice(containerInfo.modals.indexOf(modal), 1);
182
182
  this.modals.splice(modalIndex, 1);
@@ -241,7 +241,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
241
241
  }
242
242
  const positioning = getPositioningStyle(element);
243
243
  if (positioning.top !== null) {
244
- element.style.top = positioning.top;
244
+ element.style.setProperty('top', positioning.top);
245
245
  }
246
246
  if (positioning.left !== null) {
247
247
  element.style.left = positioning.left;
@@ -180,6 +180,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
180
180
  setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
181
181
  displayRef.current.focus();
182
182
  }
183
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
183
184
  // eslint-disable-next-line react-hooks/exhaustive-deps
184
185
  }, [displayNode, autoWidth]);
185
186
  // `isOpenControlled` is ignored because the component should never switch between controlled and uncontrolled modes.
@@ -383,6 +384,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
383
384
  });
384
385
  });
385
386
  if (process.env.NODE_ENV !== 'production') {
387
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
386
388
  // eslint-disable-next-line react-hooks/rules-of-hooks
387
389
  React.useEffect(() => {
388
390
  if (!foundMatch && !multiple && value !== '') {
@@ -59,7 +59,9 @@ const pulseAnimation = typeof pulseKeyframe !== 'string' ? css`
59
59
  animation: ${pulseKeyframe} 2s ease-in-out 0.5s infinite;
60
60
  ` : null;
61
61
  const waveAnimation = typeof waveKeyframe !== 'string' ? css`
62
- animation: ${waveKeyframe} 2s linear 0.5s infinite;
62
+ &::after {
63
+ animation: ${waveKeyframe} 2s linear 0.5s infinite;
64
+ }
63
65
  ` : null;
64
66
  const SkeletonRoot = styled('span', {
65
67
  name: 'MuiSkeleton',
@@ -168,8 +170,8 @@ const SkeletonRoot = styled('span', {
168
170
  props: {
169
171
  animation: 'wave'
170
172
  },
171
- style: {
172
- '&::after': waveAnimation || {
173
+ style: waveAnimation || {
174
+ '&::after': {
173
175
  animation: `${waveKeyframe} 2s linear 0.5s infinite`
174
176
  }
175
177
  }
@@ -337,12 +337,12 @@ export function useSlider(parameters) {
337
337
  left
338
338
  } = slider.getBoundingClientRect();
339
339
  let percent;
340
- if (axis.indexOf('vertical') === 0) {
340
+ if (axis.startsWith('vertical')) {
341
341
  percent = (bottom - finger.y) / height;
342
342
  } else {
343
343
  percent = (finger.x - left) / width;
344
344
  }
345
- if (axis.indexOf('-reverse') !== -1) {
345
+ if (axis.includes('-reverse')) {
346
346
  percent = 1 - percent;
347
347
  }
348
348
  let newValue;
@@ -203,6 +203,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
203
203
  if (!touchDetected.current) {
204
204
  return;
205
205
  }
206
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- claimedSwipeInstance is a singleton
206
207
  claimedSwipeInstance = null;
207
208
  touchDetected.current = false;
208
209
  ReactDOM.flushSync(() => {
@@ -5,7 +5,7 @@ export default function isValueSelected(value, candidate) {
5
5
  return false;
6
6
  }
7
7
  if (Array.isArray(candidate)) {
8
- return candidate.indexOf(value) >= 0;
8
+ return candidate.includes(value);
9
9
  }
10
10
  return value === candidate;
11
11
  }
@@ -369,12 +369,14 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
369
369
  });
370
370
  let open = openState;
371
371
  if (process.env.NODE_ENV !== 'production') {
372
- // eslint-disable-next-line react-hooks/rules-of-hooks
372
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
373
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
373
374
  const {
374
375
  current: isControlled
375
376
  } = React.useRef(openProp !== undefined);
376
377
 
377
- // eslint-disable-next-line react-hooks/rules-of-hooks
378
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
379
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
378
380
  React.useEffect(() => {
379
381
  if (childNode && childNode.disabled && !isControlled && title !== '' && childNode.tagName.toLowerCase() === 'button') {
380
382
  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'));
@@ -556,7 +558,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
556
558
  if (process.env.NODE_ENV !== 'production') {
557
559
  childrenProps['data-mui-internal-clone-element'] = true;
558
560
 
559
- // eslint-disable-next-line react-hooks/rules-of-hooks
561
+ // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
562
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
560
563
  React.useEffect(() => {
561
564
  if (childNode && !childNode.getAttribute('data-mui-internal-clone-element')) {
562
565
  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'));
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.1.0
2
+ * @mui/material v6.1.1
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";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("1");
4
- export const patch = Number("0");
4
+ export const patch = Number("1");
5
5
  export const prerelease = undefined;
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;
@@ -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'));
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.1.0
2
+ * @mui/material v6.1.1
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";
8
8
  const major = exports.major = Number("6");
9
9
  const minor = exports.minor = Number("1");
10
- const patch = exports.patch = Number("0");
10
+ const patch = exports.patch = Number("1");
11
11
  const prerelease = exports.prerelease = undefined;
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",
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/utils": "^6.1.1",
40
+ "@mui/system": "^6.1.1",
41
+ "@mui/types": "^7.2.17"
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"
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";
2
2
  export const major = Number("6");
3
3
  export const minor = Number("1");
4
- export const patch = Number("0");
4
+ export const patch = Number("1");
5
5
  export const prerelease = undefined;
6
6
  export default version;