@mui/material 6.1.9 → 6.1.10

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 (61) hide show
  1. package/Avatar/Avatar.js +7 -6
  2. package/ButtonBase/ButtonBase.js +21 -22
  3. package/CHANGELOG.md +47 -0
  4. package/ClickAwayListener/ClickAwayListener.js +1 -4
  5. package/FilledInput/FilledInput.js +1 -1
  6. package/FormHelperText/FormHelperText.js +1 -0
  7. package/Grid2/Grid2.js +9 -2
  8. package/Hidden/HiddenJs.js +4 -8
  9. package/InputAdornment/InputAdornment.js +1 -0
  10. package/Modal/useModal.js +3 -2
  11. package/Modal/useModal.types.d.ts +5 -1
  12. package/NoSsr/NoSsr.js +2 -5
  13. package/OutlinedInput/NotchedOutline.js +1 -0
  14. package/Portal/Portal.js +2 -7
  15. package/Select/SelectInput.js +1 -0
  16. package/Slider/SliderValueLabel.d.ts +4 -1
  17. package/Slider/SliderValueLabel.types.d.ts +4 -1
  18. package/Tabs/ScrollbarSize.js +2 -2
  19. package/Unstable_TrapFocus/FocusTrap.types.d.ts +4 -1
  20. package/index.js +1 -1
  21. package/modern/Avatar/Avatar.js +7 -6
  22. package/modern/ButtonBase/ButtonBase.js +21 -22
  23. package/modern/ClickAwayListener/ClickAwayListener.js +1 -4
  24. package/modern/FilledInput/FilledInput.js +1 -1
  25. package/modern/FormHelperText/FormHelperText.js +1 -0
  26. package/modern/Grid2/Grid2.js +9 -2
  27. package/modern/Hidden/HiddenJs.js +4 -8
  28. package/modern/InputAdornment/InputAdornment.js +1 -0
  29. package/modern/Modal/useModal.js +3 -2
  30. package/modern/NoSsr/NoSsr.js +2 -5
  31. package/modern/OutlinedInput/NotchedOutline.js +1 -0
  32. package/modern/Portal/Portal.js +2 -7
  33. package/modern/Select/SelectInput.js +1 -0
  34. package/modern/Tabs/ScrollbarSize.js +2 -2
  35. package/modern/index.js +1 -1
  36. package/modern/styles/createThemeWithVars.js +2 -2
  37. package/modern/utils/useSlot.js +1 -10
  38. package/modern/version/index.js +2 -2
  39. package/node/Avatar/Avatar.js +7 -6
  40. package/node/ButtonBase/ButtonBase.js +21 -22
  41. package/node/ClickAwayListener/ClickAwayListener.js +1 -4
  42. package/node/FilledInput/FilledInput.js +1 -1
  43. package/node/FormHelperText/FormHelperText.js +1 -0
  44. package/node/Grid2/Grid2.js +9 -2
  45. package/node/Hidden/HiddenJs.js +7 -10
  46. package/node/InputAdornment/InputAdornment.js +1 -0
  47. package/node/Modal/useModal.js +3 -2
  48. package/node/NoSsr/NoSsr.js +2 -5
  49. package/node/OutlinedInput/NotchedOutline.js +1 -0
  50. package/node/Portal/Portal.js +2 -7
  51. package/node/Select/SelectInput.js +1 -0
  52. package/node/Tabs/ScrollbarSize.js +2 -2
  53. package/node/index.js +1 -1
  54. package/node/styles/createThemeWithVars.js +2 -2
  55. package/node/utils/useSlot.js +1 -10
  56. package/node/version/index.js +2 -2
  57. package/package.json +5 -5
  58. package/styles/createThemeWithVars.js +2 -2
  59. package/utils/useSlot.d.ts +0 -7
  60. package/utils/useSlot.js +1 -10
  61. package/version/index.js +2 -2
package/Avatar/Avatar.js CHANGED
@@ -161,21 +161,22 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(inProps, ref) {
161
161
  ...other
162
162
  } = props;
163
163
  let children = null;
164
+ const ownerState = {
165
+ ...props,
166
+ component,
167
+ variant
168
+ };
164
169
 
165
170
  // Use a hook instead of onError on the img element to support server-side rendering.
166
171
  const loaded = useLoaded({
167
172
  ...imgProps,
173
+ ...(typeof slotProps.img === 'function' ? slotProps.img(ownerState) : slotProps.img),
168
174
  src,
169
175
  srcSet
170
176
  });
171
177
  const hasImg = src || srcSet;
172
178
  const hasImgNotFailing = hasImg && loaded !== 'error';
173
- const ownerState = {
174
- ...props,
175
- colorDefault: !hasImgNotFailing,
176
- component,
177
- variant
178
- };
179
+ ownerState.colorDefault = !hasImgNotFailing;
179
180
  // This issue explains why this is required: https://github.com/mui/material-ui/issues/42184
180
181
  delete ownerState.ownerState;
181
182
  const classes = useUtilityClasses(ownerState);
@@ -136,34 +136,22 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
136
136
  ripple.pulsate();
137
137
  }
138
138
  }, [disableRipple, focusRipple, focusVisible, ripple]);
139
- function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {
140
- return useEventCallback(event => {
141
- if (eventCallback) {
142
- eventCallback(event);
143
- }
144
- const ignore = skipRippleAction;
145
- if (!ignore) {
146
- ripple[rippleAction](event);
147
- }
148
- return true;
149
- });
150
- }
151
- const handleMouseDown = useRippleHandler('start', onMouseDown);
152
- const handleContextMenu = useRippleHandler('stop', onContextMenu);
153
- const handleDragLeave = useRippleHandler('stop', onDragLeave);
154
- const handleMouseUp = useRippleHandler('stop', onMouseUp);
155
- const handleMouseLeave = useRippleHandler('stop', event => {
139
+ const handleMouseDown = useRippleHandler(ripple, 'start', onMouseDown, disableTouchRipple);
140
+ const handleContextMenu = useRippleHandler(ripple, 'stop', onContextMenu, disableTouchRipple);
141
+ const handleDragLeave = useRippleHandler(ripple, 'stop', onDragLeave, disableTouchRipple);
142
+ const handleMouseUp = useRippleHandler(ripple, 'stop', onMouseUp, disableTouchRipple);
143
+ const handleMouseLeave = useRippleHandler(ripple, 'stop', event => {
156
144
  if (focusVisible) {
157
145
  event.preventDefault();
158
146
  }
159
147
  if (onMouseLeave) {
160
148
  onMouseLeave(event);
161
149
  }
162
- });
163
- const handleTouchStart = useRippleHandler('start', onTouchStart);
164
- const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
165
- const handleTouchMove = useRippleHandler('stop', onTouchMove);
166
- const handleBlur = useRippleHandler('stop', event => {
150
+ }, disableTouchRipple);
151
+ const handleTouchStart = useRippleHandler(ripple, 'start', onTouchStart, disableTouchRipple);
152
+ const handleTouchEnd = useRippleHandler(ripple, 'stop', onTouchEnd, disableTouchRipple);
153
+ const handleTouchMove = useRippleHandler(ripple, 'stop', onTouchMove, disableTouchRipple);
154
+ const handleBlur = useRippleHandler(ripple, 'stop', event => {
167
155
  if (!isFocusVisible(event.target)) {
168
156
  setFocusVisible(false);
169
157
  }
@@ -287,6 +275,17 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
287
275
  }) : null]
288
276
  });
289
277
  });
278
+ function useRippleHandler(ripple, rippleAction, eventCallback, skipRippleAction = false) {
279
+ return useEventCallback(event => {
280
+ if (eventCallback) {
281
+ eventCallback(event);
282
+ }
283
+ if (!skipRippleAction) {
284
+ ripple[rippleAction](event);
285
+ }
286
+ return true;
287
+ });
288
+ }
290
289
  process.env.NODE_ENV !== "production" ? ButtonBase.propTypes /* remove-proptypes */ = {
291
290
  // ┌────────────────────────────── Warning ──────────────────────────────┐
292
291
  // │ These PropTypes are generated from the TypeScript type definitions. │
package/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 6.1.10
4
+
5
+ <!-- generated comparing v6.1.9..master -->
6
+
7
+ _Dec 3, 2024_
8
+
9
+ A big thanks to the 10 contributors who made this release possible.
10
+
11
+ ### `@mui/material@6.1.10`
12
+
13
+ - [Avatar] Fix `slotProps.img` not spread to hook (#44536) @siriwatknp
14
+ - [FilledInput] Use `slotProps` instead of `componentsProps` (#44552) @siriwatknp
15
+ - [Grid2] Fix theme scoping error (#44599) @siriwatknp
16
+ - [Grid2] Add container styles from styleOverrides (#44598) @sai6855
17
+ - Skip `tonalOffset` from setting color channel (#44585) @siriwatknp
18
+ - Remove few more React.ReactElement<any> types (#44290) @sai6855
19
+ - [Tabs] Fix `ScrollbarSize` ref being overriden (#44593) @DiegoAndai
20
+ - [Select][TextField] Fix screen reader from saying `&ZeroWidthSpace` (#44631) @arishoham
21
+
22
+ ### `@mui/system@6.1.10`
23
+
24
+ - [ThemeProvider] Optimize `theme` changes when enabling CSS theme variables (#44588) @siriwatknp
25
+
26
+ ### Docs
27
+
28
+ - Notification for the MUI X v8 alpha zero announcement blog post (#44629) @joserodolfofreitas
29
+ - Bump React Router to ^7.0.1 (#44531) @oliviertassinari
30
+ - [material-ui] Replace testid with id in migration guide (#44636) @sai6855
31
+ - [material-ui][TextField] Update usage of `InputLabelProps` in docs (#44634) @sai6855
32
+ - [material-ui][ListItem] Add missing diffs in migration guide (#44638) @sai6855
33
+ - [examples] Use Next.js 14 on examples (#44486) @DiegoAndai
34
+ - Update links and sidebar nav for Base UI components in Material UI (#44581) @samuelsycamore
35
+
36
+ ### Core
37
+
38
+ - Remove `getSlotOwnerState` from `useSlot` util (#44403) @ZeeshanTamboli
39
+ - Extract useRippleHandler outside of ButtonBase (#44591) @albarv340
40
+ - Update eslint config (#44586) @MBilalShafi
41
+ - [core-infra] Remove useless fragments (#44516) @oliviertassinari
42
+ - [docs-infra] Fix Banner CLS (#44632) @oliviertassinari
43
+ - [docs-infra] Change CSS vars generation to be extracted from Enum (#44587) @mnajdova
44
+ - [docs-infra] Automatically hide Black Friday banner (#44630) @oliviertassinari
45
+ - [docs-infra] Fix TOC RTL padding regression (#44535) @oliviertassinari
46
+ - [test-utils] Remove leftover React.ReactElement<any> from describeConformance.tsx (#44639) @sai6855
47
+
48
+ All contributors of this release in alphabetical order: @albarv340, @arishoham, @DiegoAndai, @joserodolfofreitas, @MBilalShafi, @mnajdova, @oliviertassinari, @renovate[bot], @sai6855, @samuelsycamore, @siriwatknp, @ZeeshanTamboli
49
+
3
50
  ## 6.1.9
4
51
 
5
52
  <!-- generated comparing v6.1.8..master -->
@@ -6,7 +6,6 @@ import { elementAcceptingRef, exactProp, unstable_ownerDocument as ownerDocument
6
6
  import getReactElementRef from '@mui/utils/getReactElementRef';
7
7
 
8
8
  // TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase<EventName> : never` once generatePropTypes runs with TS 4.1
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
9
  function mapEventPropToEvent(eventProp) {
11
10
  return eventProp.substring(2).toLowerCase();
12
11
  }
@@ -136,9 +135,7 @@ function ClickAwayListener(props) {
136
135
  }
137
136
  return undefined;
138
137
  }, [handleClickAway, mouseEvent]);
139
- return /*#__PURE__*/_jsx(React.Fragment, {
140
- children: /*#__PURE__*/React.cloneElement(children, childrenProps)
141
- });
138
+ return /*#__PURE__*/React.cloneElement(children, childrenProps);
142
139
  }
143
140
  process.env.NODE_ENV !== "production" ? ClickAwayListener.propTypes /* remove-proptypes */ = {
144
141
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -310,7 +310,7 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
310
310
  root: RootSlot,
311
311
  input: InputSlot
312
312
  },
313
- componentsProps: componentsProps,
313
+ slotProps: componentsProps,
314
314
  fullWidth: fullWidth,
315
315
  inputComponent: inputComponent,
316
316
  multiline: multiline,
@@ -120,6 +120,7 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
120
120
  children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
121
121
  _span || (_span = /*#__PURE__*/_jsx("span", {
122
122
  className: "notranslate",
123
+ "aria-hidden": true,
123
124
  children: "\u200B"
124
125
  })) : children
125
126
  });
package/Grid2/Grid2.js CHANGED
@@ -5,6 +5,7 @@ import { createGrid as createGrid2 } from '@mui/system/Grid';
5
5
  import requirePropFactory from "../utils/requirePropFactory.js";
6
6
  import { styled } from "../styles/index.js";
7
7
  import { useDefaultProps } from "../DefaultPropsProvider/index.js";
8
+ import useTheme from "../styles/useTheme.js";
8
9
  /**
9
10
  *
10
11
  * Demos:
@@ -19,13 +20,19 @@ const Grid2 = createGrid2({
19
20
  createStyledComponent: styled('div', {
20
21
  name: 'MuiGrid2',
21
22
  slot: 'Root',
22
- overridesResolver: (props, styles) => styles.root
23
+ overridesResolver: (props, styles) => {
24
+ const {
25
+ ownerState
26
+ } = props;
27
+ return [styles.root, ownerState.container && styles.container];
28
+ }
23
29
  }),
24
30
  componentName: 'MuiGrid2',
25
31
  useThemeProps: inProps => useDefaultProps({
26
32
  props: inProps,
27
33
  name: 'MuiGrid2'
28
- })
34
+ }),
35
+ useTheme
29
36
  });
30
37
  process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ = {
31
38
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -1,6 +1,5 @@
1
1
  'use client';
2
2
 
3
- import * as React from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import exactProp from '@mui/utils/exactProp';
6
5
  import withWidth, { isWidthDown, isWidthUp } from "./withWidth.js";
@@ -9,7 +8,6 @@ import useTheme from "../styles/useTheme.js";
9
8
  /**
10
9
  * @ignore - internal component.
11
10
  */
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
11
  function HiddenJs(props) {
14
12
  const {
15
13
  children,
@@ -50,11 +48,9 @@ function HiddenJs(props) {
50
48
  if (!visible) {
51
49
  return null;
52
50
  }
53
- return /*#__PURE__*/_jsx(React.Fragment, {
54
- children: children
55
- });
51
+ return children;
56
52
  }
57
- process.env.NODE_ENV !== "production" ? HiddenJs.propTypes = {
53
+ HiddenJs.propTypes = {
58
54
  /**
59
55
  * The content of the component.
60
56
  */
@@ -118,8 +114,8 @@ process.env.NODE_ENV !== "production" ? HiddenJs.propTypes = {
118
114
  */
119
115
  // eslint-disable-next-line react/no-unused-prop-types
120
116
  xsUp: PropTypes.bool
121
- } : void 0;
117
+ };
122
118
  if (process.env.NODE_ENV !== 'production') {
123
- process.env.NODE_ENV !== "production" ? HiddenJs.propTypes = exactProp(HiddenJs.propTypes) : void 0;
119
+ HiddenJs.propTypes = exactProp(HiddenJs.propTypes);
124
120
  }
125
121
  export default withWidth()(HiddenJs);
@@ -128,6 +128,7 @@ const InputAdornment = /*#__PURE__*/React.forwardRef(function InputAdornment(inP
128
128
  }) : /*#__PURE__*/_jsxs(React.Fragment, {
129
129
  children: [position === 'start' ? (/* notranslate needed while Google Translate will not fix zero-width space issue */_span || (_span = /*#__PURE__*/_jsx("span", {
130
130
  className: "notranslate",
131
+ "aria-hidden": true,
131
132
  children: "\u200B"
132
133
  }))) : null, children]
133
134
  })
package/Modal/useModal.js CHANGED
@@ -10,6 +10,7 @@ function getContainer(container) {
10
10
  function getHasTransition(children) {
11
11
  return children ? children.props.hasOwnProperty('in') : false;
12
12
  }
13
+ const noop = () => {};
13
14
 
14
15
  // A modal manager used to track and manage the state of open Modals.
15
16
  // Modals don't open on the server so this won't conflict with concurrent requests.
@@ -181,8 +182,8 @@ function useModal(parameters) {
181
182
  }
182
183
  };
183
184
  return {
184
- onEnter: createChainedFunction(handleEnter, children?.props.onEnter),
185
- onExited: createChainedFunction(handleExited, children?.props.onExited)
185
+ onEnter: createChainedFunction(handleEnter, children?.props.onEnter ?? noop),
186
+ onExited: createChainedFunction(handleExited, children?.props.onExited ?? noop)
186
187
  };
187
188
  };
188
189
  return {
@@ -17,7 +17,11 @@ export type UseModalParameters = {
17
17
  /**
18
18
  * A single child content element.
19
19
  */
20
- children: React.ReactElement<any> | undefined | null;
20
+ children: React.ReactElement<{
21
+ in?: boolean;
22
+ onEnter?: (this: unknown) => void;
23
+ onExited?: (this: unknown) => void;
24
+ }> | undefined | null;
21
25
  /**
22
26
  * When set to true the Modal waits until a nested Transition is completed before closing.
23
27
  * @default false
package/NoSsr/NoSsr.js CHANGED
@@ -3,7 +3,6 @@
3
3
  import * as React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { exactProp, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
6
  /**
8
7
  * NoSsr purposely removes components from the subject of Server Side Rendering (SSR).
9
8
  *
@@ -40,10 +39,8 @@ function NoSsr(props) {
40
39
  }
41
40
  }, [defer]);
42
41
 
43
- // We need the Fragment here to force react-docgen to recognise NoSsr as a component.
44
- return /*#__PURE__*/_jsx(React.Fragment, {
45
- children: mountedState ? children : fallback
46
- });
42
+ // TODO casting won't be needed at one point https://github.com/DefinitelyTyped/DefinitelyTyped/pull/65135
43
+ return mountedState ? children : fallback;
47
44
  }
48
45
  process.env.NODE_ENV !== "production" ? NoSsr.propTypes /* remove-proptypes */ = {
49
46
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -120,6 +120,7 @@ export default function NotchedOutline(props) {
120
120
  }) : // notranslate needed while Google Translate will not fix zero-width space issue
121
121
  _span || (_span = /*#__PURE__*/_jsx("span", {
122
122
  className: "notranslate",
123
+ "aria-hidden": true,
123
124
  children: "\u200B"
124
125
  }))
125
126
  })
package/Portal/Portal.js CHANGED
@@ -4,7 +4,6 @@ import * as React from 'react';
4
4
  import * as ReactDOM from 'react-dom';
5
5
  import PropTypes from 'prop-types';
6
6
  import { exactProp, HTMLElementType, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useForkRef as useForkRef, unstable_setRef as setRef, unstable_getReactElementRef as getReactElementRef } from '@mui/utils';
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
7
  function getContainer(container) {
9
8
  return typeof container === 'function' ? container() : container;
10
9
  }
@@ -50,13 +49,9 @@ const Portal = /*#__PURE__*/React.forwardRef(function Portal(props, forwardedRef
50
49
  };
51
50
  return /*#__PURE__*/React.cloneElement(children, newProps);
52
51
  }
53
- return /*#__PURE__*/_jsx(React.Fragment, {
54
- children: children
55
- });
52
+ return children;
56
53
  }
57
- return /*#__PURE__*/_jsx(React.Fragment, {
58
- children: mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode
59
- });
54
+ return mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode;
60
55
  });
61
56
  process.env.NODE_ENV !== "production" ? Portal.propTypes /* remove-proptypes */ = {
62
57
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -462,6 +462,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
462
462
  children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
463
463
  _span || (_span = /*#__PURE__*/_jsx("span", {
464
464
  className: "notranslate",
465
+ "aria-hidden": true,
465
466
  children: "\u200B"
466
467
  })) : display
467
468
  }), /*#__PURE__*/_jsx(SelectNativeInput, {
@@ -3,7 +3,10 @@ import { SliderValueLabelProps } from './SliderValueLabel.types';
3
3
  /**
4
4
  * @ignore - internal component.
5
5
  */
6
- declare function SliderValueLabel(props: SliderValueLabelProps): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
6
+ declare function SliderValueLabel(props: SliderValueLabelProps): React.ReactElement<{
7
+ className?: string;
8
+ children?: React.ReactNode;
9
+ }, string | React.JSXElementConstructor<any>> | null;
7
10
  declare namespace SliderValueLabel {
8
11
  var propTypes: any;
9
12
  }
@@ -1,5 +1,8 @@
1
1
  export interface SliderValueLabelProps {
2
- children?: React.ReactElement<any>;
2
+ children?: React.ReactElement<{
3
+ className?: string;
4
+ children?: React.ReactNode;
5
+ }>;
3
6
  className?: string;
4
7
  style?: React.CSSProperties;
5
8
  /**
@@ -49,8 +49,8 @@ export default function ScrollbarSize(props) {
49
49
  }, [onChange]);
50
50
  return /*#__PURE__*/_jsx("div", {
51
51
  style: styles,
52
- ref: nodeRef,
53
- ...other
52
+ ...other,
53
+ ref: nodeRef
54
54
  });
55
55
  }
56
56
  process.env.NODE_ENV !== "production" ? ScrollbarSize.propTypes = {
@@ -23,7 +23,10 @@ export interface FocusTrapProps {
23
23
  /**
24
24
  * A single child content element.
25
25
  */
26
- children: React.ReactElement<any>;
26
+ children: React.ReactElement<{
27
+ onFocus?: React.FocusEventHandler;
28
+ ref?: React.RefCallback<any> | null;
29
+ }>;
27
30
  /**
28
31
  * If `true`, the focus trap will not automatically shift focus to itself when it opens, and
29
32
  * replace it to the last focused element when it closes.
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.1.9
2
+ * @mui/material v6.1.10
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -161,21 +161,22 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(inProps, ref) {
161
161
  ...other
162
162
  } = props;
163
163
  let children = null;
164
+ const ownerState = {
165
+ ...props,
166
+ component,
167
+ variant
168
+ };
164
169
 
165
170
  // Use a hook instead of onError on the img element to support server-side rendering.
166
171
  const loaded = useLoaded({
167
172
  ...imgProps,
173
+ ...(typeof slotProps.img === 'function' ? slotProps.img(ownerState) : slotProps.img),
168
174
  src,
169
175
  srcSet
170
176
  });
171
177
  const hasImg = src || srcSet;
172
178
  const hasImgNotFailing = hasImg && loaded !== 'error';
173
- const ownerState = {
174
- ...props,
175
- colorDefault: !hasImgNotFailing,
176
- component,
177
- variant
178
- };
179
+ ownerState.colorDefault = !hasImgNotFailing;
179
180
  // This issue explains why this is required: https://github.com/mui/material-ui/issues/42184
180
181
  delete ownerState.ownerState;
181
182
  const classes = useUtilityClasses(ownerState);
@@ -136,34 +136,22 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
136
136
  ripple.pulsate();
137
137
  }
138
138
  }, [disableRipple, focusRipple, focusVisible, ripple]);
139
- function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {
140
- return useEventCallback(event => {
141
- if (eventCallback) {
142
- eventCallback(event);
143
- }
144
- const ignore = skipRippleAction;
145
- if (!ignore) {
146
- ripple[rippleAction](event);
147
- }
148
- return true;
149
- });
150
- }
151
- const handleMouseDown = useRippleHandler('start', onMouseDown);
152
- const handleContextMenu = useRippleHandler('stop', onContextMenu);
153
- const handleDragLeave = useRippleHandler('stop', onDragLeave);
154
- const handleMouseUp = useRippleHandler('stop', onMouseUp);
155
- const handleMouseLeave = useRippleHandler('stop', event => {
139
+ const handleMouseDown = useRippleHandler(ripple, 'start', onMouseDown, disableTouchRipple);
140
+ const handleContextMenu = useRippleHandler(ripple, 'stop', onContextMenu, disableTouchRipple);
141
+ const handleDragLeave = useRippleHandler(ripple, 'stop', onDragLeave, disableTouchRipple);
142
+ const handleMouseUp = useRippleHandler(ripple, 'stop', onMouseUp, disableTouchRipple);
143
+ const handleMouseLeave = useRippleHandler(ripple, 'stop', event => {
156
144
  if (focusVisible) {
157
145
  event.preventDefault();
158
146
  }
159
147
  if (onMouseLeave) {
160
148
  onMouseLeave(event);
161
149
  }
162
- });
163
- const handleTouchStart = useRippleHandler('start', onTouchStart);
164
- const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
165
- const handleTouchMove = useRippleHandler('stop', onTouchMove);
166
- const handleBlur = useRippleHandler('stop', event => {
150
+ }, disableTouchRipple);
151
+ const handleTouchStart = useRippleHandler(ripple, 'start', onTouchStart, disableTouchRipple);
152
+ const handleTouchEnd = useRippleHandler(ripple, 'stop', onTouchEnd, disableTouchRipple);
153
+ const handleTouchMove = useRippleHandler(ripple, 'stop', onTouchMove, disableTouchRipple);
154
+ const handleBlur = useRippleHandler(ripple, 'stop', event => {
167
155
  if (!isFocusVisible(event.target)) {
168
156
  setFocusVisible(false);
169
157
  }
@@ -287,6 +275,17 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
287
275
  }) : null]
288
276
  });
289
277
  });
278
+ function useRippleHandler(ripple, rippleAction, eventCallback, skipRippleAction = false) {
279
+ return useEventCallback(event => {
280
+ if (eventCallback) {
281
+ eventCallback(event);
282
+ }
283
+ if (!skipRippleAction) {
284
+ ripple[rippleAction](event);
285
+ }
286
+ return true;
287
+ });
288
+ }
290
289
  process.env.NODE_ENV !== "production" ? ButtonBase.propTypes /* remove-proptypes */ = {
291
290
  // ┌────────────────────────────── Warning ──────────────────────────────┐
292
291
  // │ These PropTypes are generated from the TypeScript type definitions. │
@@ -6,7 +6,6 @@ import { elementAcceptingRef, exactProp, unstable_ownerDocument as ownerDocument
6
6
  import getReactElementRef from '@mui/utils/getReactElementRef';
7
7
 
8
8
  // TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase<EventName> : never` once generatePropTypes runs with TS 4.1
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
9
  function mapEventPropToEvent(eventProp) {
11
10
  return eventProp.substring(2).toLowerCase();
12
11
  }
@@ -136,9 +135,7 @@ function ClickAwayListener(props) {
136
135
  }
137
136
  return undefined;
138
137
  }, [handleClickAway, mouseEvent]);
139
- return /*#__PURE__*/_jsx(React.Fragment, {
140
- children: /*#__PURE__*/React.cloneElement(children, childrenProps)
141
- });
138
+ return /*#__PURE__*/React.cloneElement(children, childrenProps);
142
139
  }
143
140
  process.env.NODE_ENV !== "production" ? ClickAwayListener.propTypes /* remove-proptypes */ = {
144
141
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -310,7 +310,7 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
310
310
  root: RootSlot,
311
311
  input: InputSlot
312
312
  },
313
- componentsProps: componentsProps,
313
+ slotProps: componentsProps,
314
314
  fullWidth: fullWidth,
315
315
  inputComponent: inputComponent,
316
316
  multiline: multiline,
@@ -120,6 +120,7 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
120
120
  children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
121
121
  _span || (_span = /*#__PURE__*/_jsx("span", {
122
122
  className: "notranslate",
123
+ "aria-hidden": true,
123
124
  children: "\u200B"
124
125
  })) : children
125
126
  });
@@ -5,6 +5,7 @@ import { createGrid as createGrid2 } from '@mui/system/Grid';
5
5
  import requirePropFactory from "../utils/requirePropFactory.js";
6
6
  import { styled } from "../styles/index.js";
7
7
  import { useDefaultProps } from "../DefaultPropsProvider/index.js";
8
+ import useTheme from "../styles/useTheme.js";
8
9
  /**
9
10
  *
10
11
  * Demos:
@@ -19,13 +20,19 @@ const Grid2 = createGrid2({
19
20
  createStyledComponent: styled('div', {
20
21
  name: 'MuiGrid2',
21
22
  slot: 'Root',
22
- overridesResolver: (props, styles) => styles.root
23
+ overridesResolver: (props, styles) => {
24
+ const {
25
+ ownerState
26
+ } = props;
27
+ return [styles.root, ownerState.container && styles.container];
28
+ }
23
29
  }),
24
30
  componentName: 'MuiGrid2',
25
31
  useThemeProps: inProps => useDefaultProps({
26
32
  props: inProps,
27
33
  name: 'MuiGrid2'
28
- })
34
+ }),
35
+ useTheme
29
36
  });
30
37
  process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ = {
31
38
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -1,6 +1,5 @@
1
1
  'use client';
2
2
 
3
- import * as React from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import exactProp from '@mui/utils/exactProp';
6
5
  import withWidth, { isWidthDown, isWidthUp } from "./withWidth.js";
@@ -9,7 +8,6 @@ import useTheme from "../styles/useTheme.js";
9
8
  /**
10
9
  * @ignore - internal component.
11
10
  */
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
11
  function HiddenJs(props) {
14
12
  const {
15
13
  children,
@@ -50,11 +48,9 @@ function HiddenJs(props) {
50
48
  if (!visible) {
51
49
  return null;
52
50
  }
53
- return /*#__PURE__*/_jsx(React.Fragment, {
54
- children: children
55
- });
51
+ return children;
56
52
  }
57
- process.env.NODE_ENV !== "production" ? HiddenJs.propTypes = {
53
+ HiddenJs.propTypes = {
58
54
  /**
59
55
  * The content of the component.
60
56
  */
@@ -118,8 +114,8 @@ process.env.NODE_ENV !== "production" ? HiddenJs.propTypes = {
118
114
  */
119
115
  // eslint-disable-next-line react/no-unused-prop-types
120
116
  xsUp: PropTypes.bool
121
- } : void 0;
117
+ };
122
118
  if (process.env.NODE_ENV !== 'production') {
123
- process.env.NODE_ENV !== "production" ? HiddenJs.propTypes = exactProp(HiddenJs.propTypes) : void 0;
119
+ HiddenJs.propTypes = exactProp(HiddenJs.propTypes);
124
120
  }
125
121
  export default withWidth()(HiddenJs);
@@ -128,6 +128,7 @@ const InputAdornment = /*#__PURE__*/React.forwardRef(function InputAdornment(inP
128
128
  }) : /*#__PURE__*/_jsxs(React.Fragment, {
129
129
  children: [position === 'start' ? (/* notranslate needed while Google Translate will not fix zero-width space issue */_span || (_span = /*#__PURE__*/_jsx("span", {
130
130
  className: "notranslate",
131
+ "aria-hidden": true,
131
132
  children: "\u200B"
132
133
  }))) : null, children]
133
134
  })
@@ -10,6 +10,7 @@ function getContainer(container) {
10
10
  function getHasTransition(children) {
11
11
  return children ? children.props.hasOwnProperty('in') : false;
12
12
  }
13
+ const noop = () => {};
13
14
 
14
15
  // A modal manager used to track and manage the state of open Modals.
15
16
  // Modals don't open on the server so this won't conflict with concurrent requests.
@@ -181,8 +182,8 @@ function useModal(parameters) {
181
182
  }
182
183
  };
183
184
  return {
184
- onEnter: createChainedFunction(handleEnter, children?.props.onEnter),
185
- onExited: createChainedFunction(handleExited, children?.props.onExited)
185
+ onEnter: createChainedFunction(handleEnter, children?.props.onEnter ?? noop),
186
+ onExited: createChainedFunction(handleExited, children?.props.onExited ?? noop)
186
187
  };
187
188
  };
188
189
  return {