@mui/material 6.4.0 → 6.4.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 (64) hide show
  1. package/ButtonBase/ButtonBase.d.ts +2 -0
  2. package/ButtonGroup/ButtonGroupButtonContext.js +2 -0
  3. package/ButtonGroup/ButtonGroupContext.js +2 -0
  4. package/CHANGELOG.md +42 -0
  5. package/Dialog/Dialog.d.ts +85 -1
  6. package/Dialog/Dialog.js +91 -20
  7. package/Dialog/DialogContext.js +2 -0
  8. package/Drawer/Drawer.js +1 -1
  9. package/Drawer/drawerClasses.d.ts +32 -8
  10. package/Drawer/drawerClasses.js +1 -1
  11. package/FormControl/FormControl.js +9 -7
  12. package/FormControl/FormControlContext.js +2 -0
  13. package/Hidden/withWidth.js +2 -0
  14. package/IconButton/IconButton.d.ts +3 -2
  15. package/IconButton/IconButton.js +18 -7
  16. package/IconButton/iconButtonClasses.d.ts +2 -0
  17. package/IconButton/iconButtonClasses.js +1 -1
  18. package/RadioGroup/RadioGroupContext.js +2 -0
  19. package/Step/StepContext.js +2 -0
  20. package/Stepper/StepperContext.js +2 -0
  21. package/Table/Tablelvl2Context.js +2 -0
  22. package/ToggleButtonGroup/ToggleButtonGroupButtonContext.js +2 -0
  23. package/ToggleButtonGroup/ToggleButtonGroupContext.js +2 -0
  24. package/index.js +1 -1
  25. package/modern/ButtonGroup/ButtonGroupButtonContext.js +2 -0
  26. package/modern/ButtonGroup/ButtonGroupContext.js +2 -0
  27. package/modern/Dialog/Dialog.js +91 -20
  28. package/modern/Dialog/DialogContext.js +2 -0
  29. package/modern/Drawer/Drawer.js +1 -1
  30. package/modern/Drawer/drawerClasses.js +1 -1
  31. package/modern/FormControl/FormControl.js +9 -7
  32. package/modern/FormControl/FormControlContext.js +2 -0
  33. package/modern/Hidden/withWidth.js +2 -0
  34. package/modern/IconButton/IconButton.js +18 -7
  35. package/modern/IconButton/iconButtonClasses.js +1 -1
  36. package/modern/RadioGroup/RadioGroupContext.js +2 -0
  37. package/modern/Step/StepContext.js +2 -0
  38. package/modern/Stepper/StepperContext.js +2 -0
  39. package/modern/Table/Tablelvl2Context.js +2 -0
  40. package/modern/ToggleButtonGroup/ToggleButtonGroupButtonContext.js +2 -0
  41. package/modern/ToggleButtonGroup/ToggleButtonGroupContext.js +2 -0
  42. package/modern/index.js +1 -1
  43. package/modern/version/index.js +2 -2
  44. package/node/ButtonGroup/ButtonGroupButtonContext.js +1 -0
  45. package/node/ButtonGroup/ButtonGroupContext.js +1 -0
  46. package/node/Dialog/Dialog.js +91 -20
  47. package/node/Dialog/DialogContext.js +1 -0
  48. package/node/Drawer/Drawer.js +1 -1
  49. package/node/Drawer/drawerClasses.js +1 -1
  50. package/node/FormControl/FormControl.js +9 -7
  51. package/node/FormControl/FormControlContext.js +1 -0
  52. package/node/Hidden/withWidth.js +1 -0
  53. package/node/IconButton/IconButton.js +18 -7
  54. package/node/IconButton/iconButtonClasses.js +1 -1
  55. package/node/RadioGroup/RadioGroupContext.js +1 -0
  56. package/node/Step/StepContext.js +1 -0
  57. package/node/Stepper/StepperContext.js +1 -0
  58. package/node/Table/Tablelvl2Context.js +1 -0
  59. package/node/ToggleButtonGroup/ToggleButtonGroupButtonContext.js +1 -0
  60. package/node/ToggleButtonGroup/ToggleButtonGroupContext.js +1 -0
  61. package/node/index.js +1 -1
  62. package/node/version/index.js +2 -2
  63. package/package.json +5 -5
  64. package/version/index.js +2 -2
@@ -5,6 +5,8 @@ import { TouchRippleActions, TouchRippleProps } from './TouchRipple';
5
5
  import { OverrideProps, OverridableComponent, OverridableTypeMap } from '../OverridableComponent';
6
6
  import { ButtonBaseClasses } from './buttonBaseClasses';
7
7
 
8
+ export { TouchRippleActions, TouchRippleProps };
9
+
8
10
  export interface ButtonBaseOwnProps {
9
11
  /**
10
12
  * A ref for imperative actions.
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  /**
3
5
  * @ignore - internal component.
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  /**
3
5
  * @ignore - internal component.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 6.4.1
4
+
5
+ <!-- generated comparing v6.4.0..master -->
6
+
7
+ _Jan 21, 2025_
8
+
9
+ A big thanks to the 9 contributors who made this release possible.
10
+
11
+ ### `@mui/material@6.4.1`
12
+
13
+ - [ButtonBase] Export types used in ButtonBase props (#43530) @Janpot
14
+ - [Dialog] Add slots and slotProps (#44792) @sai6855
15
+ - [Drawer] Deprecate composed classes (#44870) @yash49
16
+ - [IconButton] Set default loading to `null` (#45057) @siriwatknp
17
+ - [ListItem] Add codemod for deprecated props (#45022) @sai6855
18
+ - [Modal] Add migration guide and codemod for deprecated props (#45021) @sai6855
19
+ - [TextField] Fix filled state to be synced with autofill (#44135) @DiegoAndai
20
+
21
+ ### `@mui/system@6.4.1`
22
+
23
+ - Fix dark mode flicker using `useEnhancedEffect` (#44812) @siriwatknp
24
+
25
+ ### `@mui/utils@6.4.1`
26
+
27
+ - Do not deep merge React component (#45058) @siriwatknp
28
+
29
+ ### Docs
30
+
31
+ - Fix typo (#45070) @Fullchee
32
+ - Improve Toolpad templates section (#44914) @bharatkashyap
33
+ - Fix expand / collapse icons orientation (#44989) @zanivan
34
+ - Rename "Base UI" to "MUI Base" in all text (#45060) @mj12albert
35
+ - Add @mui/base deprecation callout (#45030) @mj12albert
36
+ - Update @mui/base deprecation message (#45064) @mj12albert
37
+
38
+ ### Core
39
+
40
+ - [code-infra] Add "use client" directive to files with React APIs (#45036) @Janpot
41
+ - [docs] 301 redirect `/base-ui` to `base-ui.com` (#45061) @mj12albert
42
+
43
+ All contributors of this release in alphabetical order: @bharatkashyap, @DiegoAndai, @Fullchee, @Janpot, @mj12albert, @sai6855, @siriwatknp, @yash49, @zanivan
44
+
3
45
  ## 6.4.0
4
46
 
5
47
  <!-- generated comparing v6.3.1..master -->
@@ -1,12 +1,91 @@
1
1
  import * as React from 'react';
2
2
  import { SxProps, Breakpoint } from '@mui/system';
3
3
  import { InternalStandardProps as StandardProps, Theme } from '..';
4
+ import { BackdropProps } from '../Backdrop';
4
5
  import { PaperProps } from '../Paper';
5
6
  import { ModalProps } from '../Modal';
6
7
  import { TransitionProps } from '../transitions/transition';
7
8
  import { DialogClasses } from './dialogClasses';
9
+ import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
8
10
 
9
- export interface DialogProps extends StandardProps<ModalProps, 'children'> {
11
+ export interface DialogSlots {
12
+ /**
13
+ * The component that renders the transition.
14
+ * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
15
+ * @default Collapse
16
+ */
17
+ transition?: React.ElementType;
18
+ /**
19
+ * The component that renders the paper.
20
+ * @default Paper
21
+ */
22
+ paper?: React.ElementType;
23
+ /**
24
+ * The component that renders the container.
25
+ */
26
+ container?: React.ElementType;
27
+ /**
28
+ * The component that renders the backdrop.
29
+ */
30
+ backdrop?: React.ElementType;
31
+ /**
32
+ * The component that renders the root.
33
+ */
34
+ root?: React.ElementType;
35
+ }
36
+
37
+ export interface DialogTransitionSlotPropsOverrides {}
38
+ export interface DialogPaperSlotPropsOverrides {}
39
+ export interface DialogContainerSlotPropsOverrides {}
40
+ export interface DialogBackdropSlotPropsOverrides {}
41
+ export interface DialogRootSlotPropsOverrides {}
42
+
43
+ export type DialogSlotsAndSlotProps = CreateSlotsAndSlotProps<
44
+ DialogSlots,
45
+ {
46
+ /**
47
+ * Props forwarded to the root slot.
48
+ * By default, the avaible props are based on the [Modal](https://mui.com/material-ui/api/modal/#props) component.
49
+ */
50
+ root: SlotProps<React.ElementType<ModalProps>, DialogRootSlotPropsOverrides, DialogOwnerState>;
51
+ /**
52
+ * Props forwarded to the backdrop slot.
53
+ * By default, the avaible props are based on the [Backdrop](https://mui.com/material-ui/api/backdrop/#props) component.
54
+ */
55
+ backdrop: SlotProps<
56
+ React.ElementType<BackdropProps>,
57
+ DialogBackdropSlotPropsOverrides,
58
+ DialogOwnerState
59
+ >;
60
+ /**
61
+ * Props forwarded to the container slot.
62
+ * By default, the avaible props are based on a div element.
63
+ */
64
+ container: SlotProps<'div', DialogContainerSlotPropsOverrides, DialogOwnerState>;
65
+ /**
66
+ * Props forwarded to the transition slot.
67
+ * By default, the avaible props are based on the [Fade](https://mui.com/material-ui/api/fade/#props) component.
68
+ */
69
+ transition: SlotProps<
70
+ React.ElementType<TransitionProps>,
71
+ DialogTransitionSlotPropsOverrides,
72
+ DialogOwnerState
73
+ >;
74
+ /**
75
+ * Props forwarded to the paper slot.
76
+ * By default, the avaible props are based on the [Paper](https://mui.com/material-ui/api/paper/#props) component.
77
+ */
78
+ paper: SlotProps<
79
+ React.ElementType<PaperProps>,
80
+ DialogPaperSlotPropsOverrides,
81
+ DialogOwnerState
82
+ >;
83
+ }
84
+ >;
85
+
86
+ export interface DialogProps
87
+ extends Omit<StandardProps<ModalProps, 'children'>, 'slots' | 'slotProps'>,
88
+ DialogSlotsAndSlotProps {
10
89
  /**
11
90
  * The id(s) of the element(s) that describe the dialog.
12
91
  */
@@ -77,6 +156,7 @@ export interface DialogProps extends StandardProps<ModalProps, 'children'> {
77
156
  /**
78
157
  * Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element.
79
158
  * @default {}
159
+ * @deprecated Use `slotProps.paper` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
80
160
  */
81
161
  PaperProps?: Partial<PaperProps<React.ElementType>>;
82
162
  /**
@@ -92,6 +172,7 @@ export interface DialogProps extends StandardProps<ModalProps, 'children'> {
92
172
  * The component used for the transition.
93
173
  * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
94
174
  * @default Fade
175
+ * @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
95
176
  */
96
177
  TransitionComponent?: React.JSXElementConstructor<
97
178
  TransitionProps & { children: React.ReactElement<unknown, any> }
@@ -108,6 +189,7 @@ export interface DialogProps extends StandardProps<ModalProps, 'children'> {
108
189
  /**
109
190
  * Props applied to the transition element.
110
191
  * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
192
+ * @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
111
193
  */
112
194
  TransitionProps?: TransitionProps;
113
195
  }
@@ -125,3 +207,5 @@ export interface DialogProps extends StandardProps<ModalProps, 'children'> {
125
207
  * - inherits [Modal API](https://mui.com/material-ui/api/modal/)
126
208
  */
127
209
  export default function Dialog(props: DialogProps): React.JSX.Element;
210
+
211
+ export interface DialogOwnerState extends Omit<DialogProps, 'slots' | 'slotProps'> {}
package/Dialog/Dialog.js CHANGED
@@ -15,6 +15,7 @@ import Backdrop from "../Backdrop/index.js";
15
15
  import { styled, useTheme } from "../zero-styled/index.js";
16
16
  import memoTheme from "../utils/memoTheme.js";
17
17
  import { useDefaultProps } from "../DefaultPropsProvider/index.js";
18
+ import useSlot from "../utils/useSlot.js";
18
19
  import { jsx as _jsx } from "react/jsx-runtime";
19
20
  const DialogBackdrop = styled(Backdrop, {
20
21
  name: 'MuiDialog',
@@ -218,6 +219,8 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
218
219
  PaperComponent = Paper,
219
220
  PaperProps = {},
220
221
  scroll = 'paper',
222
+ slots = {},
223
+ slotProps = {},
221
224
  TransitionComponent = Fade,
222
225
  transitionDuration = defaultTransitionDuration,
223
226
  TransitionProps,
@@ -261,46 +264,89 @@ const Dialog = /*#__PURE__*/React.forwardRef(function Dialog(inProps, ref) {
261
264
  titleId: ariaLabelledby
262
265
  };
263
266
  }, [ariaLabelledby]);
264
- return /*#__PURE__*/_jsx(DialogRoot, {
267
+ const backwardCompatibleSlots = {
268
+ transition: TransitionComponent,
269
+ ...slots
270
+ };
271
+ const backwardCompatibleSlotProps = {
272
+ transition: TransitionProps,
273
+ paper: PaperProps,
274
+ backdrop: BackdropProps,
275
+ ...slotProps
276
+ };
277
+ const externalForwardedProps = {
278
+ slots: backwardCompatibleSlots,
279
+ slotProps: backwardCompatibleSlotProps
280
+ };
281
+ const [RootSlot, rootSlotProps] = useSlot('root', {
282
+ elementType: DialogRoot,
283
+ shouldForwardComponentProp: true,
284
+ externalForwardedProps,
285
+ ownerState,
265
286
  className: clsx(classes.root, className),
287
+ ref
288
+ });
289
+ const [BackdropSlot, backdropSlotProps] = useSlot('backdrop', {
290
+ elementType: DialogBackdrop,
291
+ shouldForwardComponentProp: true,
292
+ externalForwardedProps,
293
+ ownerState
294
+ });
295
+ const [PaperSlot, paperSlotProps] = useSlot('paper', {
296
+ elementType: DialogPaper,
297
+ shouldForwardComponentProp: true,
298
+ externalForwardedProps,
299
+ ownerState,
300
+ className: clsx(classes.paper, PaperProps.className)
301
+ });
302
+ const [ContainerSlot, containerSlotProps] = useSlot('container', {
303
+ elementType: DialogContainer,
304
+ externalForwardedProps,
305
+ ownerState,
306
+ className: clsx(classes.container)
307
+ });
308
+ const [TransitionSlot, transitionSlotProps] = useSlot('transition', {
309
+ elementType: Fade,
310
+ externalForwardedProps,
311
+ ownerState,
312
+ additionalProps: {
313
+ appear: true,
314
+ in: open,
315
+ timeout: transitionDuration,
316
+ role: 'presentation'
317
+ }
318
+ });
319
+ return /*#__PURE__*/_jsx(RootSlot, {
266
320
  closeAfterTransition: true,
267
- components: {
268
- Backdrop: DialogBackdrop
321
+ slots: {
322
+ backdrop: BackdropSlot
269
323
  },
270
- componentsProps: {
324
+ slotProps: {
271
325
  backdrop: {
272
326
  transitionDuration,
273
327
  as: BackdropComponent,
274
- ...BackdropProps
328
+ ...backdropSlotProps
275
329
  }
276
330
  },
277
331
  disableEscapeKeyDown: disableEscapeKeyDown,
278
332
  onClose: onClose,
279
333
  open: open,
280
- ref: ref,
281
334
  onClick: handleBackdropClick,
282
- ownerState: ownerState,
335
+ ...rootSlotProps,
283
336
  ...other,
284
- children: /*#__PURE__*/_jsx(TransitionComponent, {
285
- appear: true,
286
- in: open,
287
- timeout: transitionDuration,
288
- role: "presentation",
289
- ...TransitionProps,
290
- children: /*#__PURE__*/_jsx(DialogContainer, {
291
- className: clsx(classes.container),
337
+ children: /*#__PURE__*/_jsx(TransitionSlot, {
338
+ ...transitionSlotProps,
339
+ children: /*#__PURE__*/_jsx(ContainerSlot, {
292
340
  onMouseDown: handleMouseDown,
293
- ownerState: ownerState,
294
- children: /*#__PURE__*/_jsx(DialogPaper, {
341
+ ...containerSlotProps,
342
+ children: /*#__PURE__*/_jsx(PaperSlot, {
295
343
  as: PaperComponent,
296
344
  elevation: 24,
297
345
  role: "dialog",
298
346
  "aria-describedby": ariaDescribedby,
299
347
  "aria-labelledby": ariaLabelledby,
300
348
  "aria-modal": ariaModal,
301
- ...PaperProps,
302
- className: clsx(classes.paper, PaperProps.className),
303
- ownerState: ownerState,
349
+ ...paperSlotProps,
304
350
  children: /*#__PURE__*/_jsx(DialogContext.Provider, {
305
351
  value: dialogContextValue,
306
352
  children: children
@@ -412,6 +458,7 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
412
458
  /**
413
459
  * Props applied to the [`Paper`](https://mui.com/material-ui/api/paper/) element.
414
460
  * @default {}
461
+ * @deprecated Use `slotProps.paper` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
415
462
  */
416
463
  PaperProps: PropTypes.object,
417
464
  /**
@@ -419,6 +466,28 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
419
466
  * @default 'paper'
420
467
  */
421
468
  scroll: PropTypes.oneOf(['body', 'paper']),
469
+ /**
470
+ * The props used for each slot inside.
471
+ * @default {}
472
+ */
473
+ slotProps: PropTypes.shape({
474
+ backdrop: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
475
+ container: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
476
+ paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
477
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
478
+ transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
479
+ }),
480
+ /**
481
+ * The components used for each slot inside.
482
+ * @default {}
483
+ */
484
+ slots: PropTypes.shape({
485
+ backdrop: PropTypes.elementType,
486
+ container: PropTypes.elementType,
487
+ paper: PropTypes.elementType,
488
+ root: PropTypes.elementType,
489
+ transition: PropTypes.elementType
490
+ }),
422
491
  /**
423
492
  * The system prop that allows defining system overrides as well as additional CSS styles.
424
493
  */
@@ -427,6 +496,7 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
427
496
  * The component used for the transition.
428
497
  * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
429
498
  * @default Fade
499
+ * @deprecated Use `slots.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
430
500
  */
431
501
  TransitionComponent: PropTypes.elementType,
432
502
  /**
@@ -445,6 +515,7 @@ process.env.NODE_ENV !== "production" ? Dialog.propTypes /* remove-proptypes */
445
515
  /**
446
516
  * Props applied to the transition element.
447
517
  * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
518
+ * @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
448
519
  */
449
520
  TransitionProps: PropTypes.object
450
521
  } : void 0;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  const DialogContext = /*#__PURE__*/React.createContext({});
3
5
  if (process.env.NODE_ENV !== 'production') {
package/Drawer/Drawer.js CHANGED
@@ -29,7 +29,7 @@ const useUtilityClasses = ownerState => {
29
29
  variant
30
30
  } = ownerState;
31
31
  const slots = {
32
- root: ['root'],
32
+ root: ['root', `anchor${capitalize(anchor)}`],
33
33
  docked: [(variant === 'permanent' || variant === 'persistent') && 'docked'],
34
34
  modal: ['modal'],
35
35
  paper: ['paper', `paperAnchor${capitalize(anchor)}`, variant !== 'temporary' && `paperAnchorDocked${capitalize(anchor)}`]
@@ -5,21 +5,45 @@ export interface DrawerClasses {
5
5
  docked: string;
6
6
  /** Styles applied to the Paper component. */
7
7
  paper: string;
8
- /** Styles applied to the Paper component if `anchor="left"`. */
8
+ /** Styles applied to the root element if `anchor="left"`. */
9
+ anchorLeft: string;
10
+ /** Styles applied to the root element if `anchor="right"`. */
11
+ anchorRight: string;
12
+ /** Styles applied to the root element if `anchor="top"`. */
13
+ anchorTop: string;
14
+ /** Styles applied to the root element if `anchor="bottom"`. */
15
+ anchorBottom: string;
16
+ /** Styles applied to the Paper component if `anchor="left"`.
17
+ * @deprecated Combine the [.MuiDrawer-anchorLeft](/material-ui/api/drawer/#drawer-classes-MuiDrawer-anchorLeft) and [.MuiDrawer-paper](/material-ui/api/drawer/#drawer-classes-MuiDrawer-paper) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
18
+ */
9
19
  paperAnchorLeft: string;
10
- /** Styles applied to the Paper component if `anchor="right"`. */
20
+ /** Styles applied to the Paper component if `anchor="right"`.
21
+ * @deprecated Combine the [.MuiDrawer-anchorRight](/material-ui/api/drawer/#drawer-classes-MuiDrawer-anchorRight) and [.MuiDrawer-paper](/material-ui/api/drawer/#drawer-classes-MuiDrawer-paper) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
22
+ */
11
23
  paperAnchorRight: string;
12
- /** Styles applied to the Paper component if `anchor="top"`. */
24
+ /** Styles applied to the Paper component if `anchor="top"`.
25
+ * @deprecated Combine the [.MuiDrawer-anchorTop](/material-ui/api/drawer/#drawer-classes-MuiDrawer-anchorTop) and [.MuiDrawer-paper](/material-ui/api/drawer/#drawer-classes-MuiDrawer-paper) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
26
+ */
13
27
  paperAnchorTop: string;
14
- /** Styles applied to the Paper component if `anchor="bottom"`. */
28
+ /** Styles applied to the Paper component if `anchor="bottom"`.
29
+ * @deprecated Combine the [.MuiDrawer-anchorBottom](/material-ui/api/drawer/#drawer-classes-MuiDrawer-anchorBottom) and [.MuiDrawer-paper](/material-ui/api/drawer/#drawer-classes-MuiDrawer-paper) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
30
+ */
15
31
  paperAnchorBottom: string;
16
- /** Styles applied to the Paper component if `anchor="left"` and `variant` is not "temporary". */
32
+ /** Styles applied to the Paper component if `anchor="left"` and `variant` is not "temporary".
33
+ * @deprecated Combine the [.MuiDrawer-anchorLeft](/material-ui/api/drawer/#drawer-classes-MuiDrawer-anchorLeft), [.MuiDrawer-docked](/material-ui/api/drawer/#drawer-classes-MuiDrawer-docked) and [.MuiDrawer-paper](/material-ui/api/drawer/#drawer-classes-MuiDrawer-paper) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
34
+ */
17
35
  paperAnchorDockedLeft: string;
18
- /** Styles applied to the Paper component if `anchor="top"` and `variant` is not "temporary". */
36
+ /** Styles applied to the Paper component if `anchor="top"` and `variant` is not "temporary".
37
+ * @deprecated Combine the [.MuiDrawer-anchorTop](/material-ui/api/drawer/#drawer-classes-MuiDrawer-anchorTop), [.MuiDrawer-docked](/material-ui/api/drawer/#drawer-classes-MuiDrawer-docked) and [.MuiDrawer-paper](/material-ui/api/drawer/#drawer-classes-MuiDrawer-paper) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
38
+ */
19
39
  paperAnchorDockedTop: string;
20
- /** Styles applied to the Paper component if `anchor="right"` and `variant` is not "temporary". */
40
+ /** Styles applied to the Paper component if `anchor="right"` and `variant` is not "temporary".
41
+ * @deprecated Combine the [.MuiDrawer-anchorRight](/material-ui/api/drawer/#drawer-classes-MuiDrawer-anchorRight), [.MuiDrawer-docked](/material-ui/api/drawer/#drawer-classes-MuiDrawer-docked) and [.MuiDrawer-paper](/material-ui/api/drawer/#drawer-classes-MuiDrawer-paper) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
42
+ */
21
43
  paperAnchorDockedRight: string;
22
- /** Styles applied to the Paper component if `anchor="bottom"` and `variant` is not "temporary". */
44
+ /** Styles applied to the Paper component if `anchor="bottom"` and `variant` is not "temporary".
45
+ * @deprecated Combine the [.MuiDrawer-anchorBottom](/material-ui/api/drawer/#drawer-classes-MuiDrawer-anchorBottom), [.MuiDrawer-docked](/material-ui/api/drawer/#drawer-classes-MuiDrawer-docked) and [.MuiDrawer-paper](/material-ui/api/drawer/#drawer-classes-MuiDrawer-paper) classes instead. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)
46
+ */
23
47
  paperAnchorDockedBottom: string;
24
48
  /** Styles applied to the Modal component. */
25
49
  modal: string;
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
3
3
  export function getDrawerUtilityClass(slot) {
4
4
  return generateUtilityClass('MuiDrawer', slot);
5
5
  }
6
- const drawerClasses = generateUtilityClasses('MuiDrawer', ['root', 'docked', 'paper', 'paperAnchorLeft', 'paperAnchorRight', 'paperAnchorTop', 'paperAnchorBottom', 'paperAnchorDockedLeft', 'paperAnchorDockedRight', 'paperAnchorDockedTop', 'paperAnchorDockedBottom', 'modal']);
6
+ const drawerClasses = generateUtilityClasses('MuiDrawer', ['root', 'docked', 'paper', 'anchorLeft', 'anchorRight', 'anchorTop', 'anchorBottom', 'paperAnchorLeft', 'paperAnchorRight', 'paperAnchorTop', 'paperAnchorBottom', 'paperAnchorDockedLeft', 'paperAnchorDockedRight', 'paperAnchorDockedTop', 'paperAnchorDockedBottom', 'modal']);
7
7
  export default drawerClasses;
@@ -179,6 +179,12 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
179
179
  };
180
180
  };
181
181
  }
182
+ const onFilled = React.useCallback(() => {
183
+ setFilled(true);
184
+ }, []);
185
+ const onEmpty = React.useCallback(() => {
186
+ setFilled(false);
187
+ }, []);
182
188
  const childContext = React.useMemo(() => {
183
189
  return {
184
190
  adornedStart,
@@ -194,20 +200,16 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
194
200
  onBlur: () => {
195
201
  setFocused(false);
196
202
  },
197
- onEmpty: () => {
198
- setFilled(false);
199
- },
200
- onFilled: () => {
201
- setFilled(true);
202
- },
203
203
  onFocus: () => {
204
204
  setFocused(true);
205
205
  },
206
+ onEmpty,
207
+ onFilled,
206
208
  registerEffect,
207
209
  required,
208
210
  variant
209
211
  };
210
- }, [adornedStart, color, disabled, error, filled, focused, fullWidth, hiddenLabel, registerEffect, required, size, variant]);
212
+ }, [adornedStart, color, disabled, error, filled, focused, fullWidth, hiddenLabel, registerEffect, onEmpty, onFilled, required, size, variant]);
211
213
  return /*#__PURE__*/_jsx(FormControlContext.Provider, {
212
214
  value: childContext,
213
215
  children: /*#__PURE__*/_jsx(FormControlRoot, {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  /**
3
5
  * @ignore - internal component.
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import PropTypes from 'prop-types';
3
5
  import getDisplayName from '@mui/utils/getDisplayName';
@@ -49,9 +49,10 @@ export interface IconButtonOwnProps {
49
49
  edge?: 'start' | 'end' | false;
50
50
  /**
51
51
  * If `true`, the loading indicator is visible and the button is disabled.
52
- * @default false
52
+ * If `true | false`, the loading wrapper is always rendered before the children to prevent [Google Translation Crash](https://github.com/mui/material-ui/issues/27853).
53
+ * @default null
53
54
  */
54
- loading?: boolean;
55
+ loading?: boolean | null;
55
56
  /**
56
57
  * Element placed before the children if the button is in loading state.
57
58
  * The node should contain an element with `role="progressbar"` with an accessible name.
@@ -27,7 +27,8 @@ const useUtilityClasses = ownerState => {
27
27
  } = ownerState;
28
28
  const slots = {
29
29
  root: ['root', loading && 'loading', disabled && 'disabled', color !== 'default' && `color${capitalize(color)}`, edge && `edge${capitalize(edge)}`, `size${capitalize(size)}`],
30
- loadingIndicator: ['loadingIndicator']
30
+ loadingIndicator: ['loadingIndicator'],
31
+ loadingWrapper: ['loadingWrapper']
31
32
  };
32
33
  return composeClasses(slots, getIconButtonUtilityClass, classes);
33
34
  };
@@ -188,7 +189,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
188
189
  disableFocusRipple = false,
189
190
  size = 'medium',
190
191
  id: idProp,
191
- loading = false,
192
+ loading = null,
192
193
  loadingIndicator: loadingIndicatorProp,
193
194
  ...other
194
195
  } = props;
@@ -218,10 +219,19 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(inProps, re
218
219
  ref: ref,
219
220
  ...other,
220
221
  ownerState: ownerState,
221
- children: [/*#__PURE__*/_jsx(IconButtonLoadingIndicator, {
222
- className: classes.loadingIndicator,
223
- ownerState: ownerState,
224
- children: loading && loadingIndicator
222
+ children: [typeof loading === 'boolean' &&
223
+ /*#__PURE__*/
224
+ // use plain HTML span to minimize the runtime overhead
225
+ _jsx("span", {
226
+ className: classes.loadingWrapper,
227
+ style: {
228
+ display: 'contents'
229
+ },
230
+ children: /*#__PURE__*/_jsx(IconButtonLoadingIndicator, {
231
+ className: classes.loadingIndicator,
232
+ ownerState: ownerState,
233
+ children: loading && loadingIndicator
234
+ })
225
235
  }), children]
226
236
  });
227
237
  });
@@ -287,7 +297,8 @@ process.env.NODE_ENV !== "production" ? IconButton.propTypes /* remove-proptypes
287
297
  id: PropTypes.string,
288
298
  /**
289
299
  * If `true`, the loading indicator is visible and the button is disabled.
290
- * @default false
300
+ * If `true | false`, the loading wrapper is always rendered before the children to prevent [Google Translation Crash](https://github.com/mui/material-ui/issues/27853).
301
+ * @default null
291
302
  */
292
303
  loading: PropTypes.bool,
293
304
  /**
@@ -31,6 +31,8 @@ export interface IconButtonClasses {
31
31
  loading: string;
32
32
  /** Styles applied to the loadingIndicator element. */
33
33
  loadingIndicator: string;
34
+ /** Styles applied to the loadingWrapper element. */
35
+ loadingWrapper: string;
34
36
  }
35
37
  export type IconButtonClassKey = keyof IconButtonClasses;
36
38
  export declare function getIconButtonUtilityClass(slot: string): string;
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
3
3
  export function getIconButtonUtilityClass(slot) {
4
4
  return generateUtilityClass('MuiIconButton', slot);
5
5
  }
6
- const iconButtonClasses = generateUtilityClasses('MuiIconButton', ['root', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning', 'edgeStart', 'edgeEnd', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'loading', 'loadingIndicator']);
6
+ const iconButtonClasses = generateUtilityClasses('MuiIconButton', ['root', 'disabled', 'colorInherit', 'colorPrimary', 'colorSecondary', 'colorError', 'colorInfo', 'colorSuccess', 'colorWarning', 'edgeStart', 'edgeEnd', 'sizeSmall', 'sizeMedium', 'sizeLarge', 'loading', 'loadingIndicator', 'loadingWrapper']);
7
7
  export default iconButtonClasses;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  /**
3
5
  * @ignore - internal component.
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  /**
3
5
  * Provides information about the current step in Stepper.
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  /**
3
5
  * Provides information about the current step in Stepper.
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
 
3
5
  /**
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  /**
3
5
  * @ignore - internal component.
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  /**
3
5
  * @ignore - internal component.
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/material v6.4.0
2
+ * @mui/material v6.4.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  /**
3
5
  * @ignore - internal component.
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  /**
3
5
  * @ignore - internal component.