@mui/material 6.4.4 → 7.0.0-alpha.0

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 (195) hide show
  1. package/Accordion/Accordion.d.ts +3 -3
  2. package/AccordionActions/AccordionActions.d.ts +2 -2
  3. package/AccordionDetails/AccordionDetails.d.ts +2 -2
  4. package/AccordionSummary/AccordionSummary.d.ts +3 -3
  5. package/Alert/Alert.d.ts +3 -3
  6. package/AlertTitle/AlertTitle.d.ts +3 -3
  7. package/AppBar/AppBar.d.ts +3 -3
  8. package/Autocomplete/Autocomplete.d.ts +2 -2
  9. package/Avatar/Avatar.d.ts +2 -2
  10. package/AvatarGroup/AvatarGroup.d.ts +2 -2
  11. package/Backdrop/Backdrop.d.ts +3 -3
  12. package/Badge/Badge.d.ts +3 -3
  13. package/BottomNavigation/BottomNavigation.d.ts +2 -2
  14. package/BottomNavigationAction/BottomNavigationAction.d.ts +3 -3
  15. package/Box/Box.d.ts +2 -2
  16. package/Breadcrumbs/Breadcrumbs.d.ts +3 -3
  17. package/Button/Button.d.ts +4 -4
  18. package/ButtonBase/ButtonBase.d.ts +2 -2
  19. package/ButtonGroup/ButtonGroup.d.ts +2 -2
  20. package/CHANGELOG.md +24 -2272
  21. package/Card/Card.d.ts +3 -3
  22. package/CardActionArea/CardActionArea.d.ts +3 -3
  23. package/CardActions/CardActions.d.ts +2 -2
  24. package/CardContent/CardContent.d.ts +2 -2
  25. package/CardHeader/CardHeader.d.ts +2 -2
  26. package/CardMedia/CardMedia.d.ts +2 -2
  27. package/Checkbox/Checkbox.d.ts +4 -4
  28. package/Chip/Chip.d.ts +2 -2
  29. package/CircularProgress/CircularProgress.d.ts +3 -7
  30. package/ClickAwayListener/ClickAwayListener.d.ts +3 -3
  31. package/ClickAwayListener/ClickAwayListener.js +3 -3
  32. package/Collapse/Collapse.d.ts +5 -5
  33. package/Container/Container.d.ts +2 -2
  34. package/CssBaseline/CssBaseline.d.ts +2 -2
  35. package/Dialog/Dialog.d.ts +3 -3
  36. package/DialogActions/DialogActions.d.ts +2 -2
  37. package/DialogContent/DialogContent.d.ts +2 -2
  38. package/DialogContentText/DialogContentText.d.ts +3 -3
  39. package/DialogTitle/DialogTitle.d.ts +3 -3
  40. package/Divider/Divider.d.ts +3 -3
  41. package/Drawer/Drawer.d.ts +3 -3
  42. package/Fab/Fab.d.ts +3 -3
  43. package/Fade/Fade.d.ts +3 -3
  44. package/FilledInput/FilledInput.d.ts +3 -3
  45. package/FormControl/FormControl.d.ts +6 -6
  46. package/FormControlLabel/FormControlLabel.d.ts +4 -4
  47. package/FormGroup/FormGroup.d.ts +3 -3
  48. package/FormHelperText/FormHelperText.d.ts +2 -2
  49. package/FormLabel/FormLabel.d.ts +4 -4
  50. package/GlobalStyles/GlobalStyles.d.ts +2 -2
  51. package/Grid/Grid.d.ts +2 -2
  52. package/Grid2/Grid2.d.ts +2 -2
  53. package/Grid2/Grid2.js +2 -2
  54. package/Grow/Grow.d.ts +5 -5
  55. package/Hidden/Hidden.d.ts +2 -2
  56. package/Icon/Icon.d.ts +3 -3
  57. package/IconButton/IconButton.d.ts +4 -4
  58. package/ImageList/ImageList.d.ts +2 -2
  59. package/ImageListItem/ImageListItem.d.ts +2 -2
  60. package/ImageListItemBar/ImageListItemBar.d.ts +2 -2
  61. package/Input/Input.d.ts +3 -3
  62. package/InputAdornment/InputAdornment.d.ts +2 -2
  63. package/InputBase/InputBase.d.ts +2 -2
  64. package/InputLabel/InputLabel.d.ts +3 -3
  65. package/LinearProgress/LinearProgress.d.ts +3 -7
  66. package/Link/Link.d.ts +4 -4
  67. package/List/List.d.ts +3 -3
  68. package/ListItem/ListItem.d.ts +3 -3
  69. package/ListItemAvatar/ListItemAvatar.d.ts +2 -2
  70. package/ListItemButton/ListItemButton.d.ts +3 -3
  71. package/ListItemIcon/ListItemIcon.d.ts +2 -2
  72. package/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +2 -2
  73. package/ListItemText/ListItemText.d.ts +2 -2
  74. package/ListSubheader/ListSubheader.d.ts +2 -2
  75. package/Menu/Menu.d.ts +4 -4
  76. package/Menu/Menu.js +6 -2
  77. package/MenuItem/MenuItem.d.ts +3 -3
  78. package/MenuList/MenuList.d.ts +4 -4
  79. package/MobileStepper/MobileStepper.d.ts +4 -72
  80. package/MobileStepper/MobileStepper.js +18 -76
  81. package/Modal/Modal.d.ts +7 -7
  82. package/Modal/Modal.js +9 -10
  83. package/NativeSelect/NativeSelect.d.ts +3 -3
  84. package/NoSsr/NoSsr.d.ts +2 -2
  85. package/NoSsr/NoSsr.js +2 -2
  86. package/OutlinedInput/OutlinedInput.d.ts +3 -3
  87. package/Pagination/Pagination.d.ts +2 -2
  88. package/PaginationItem/PaginationItem.d.ts +2 -2
  89. package/Paper/Paper.d.ts +3 -3
  90. package/PigmentContainer/PigmentContainer.d.ts +2 -2
  91. package/PigmentContainer/PigmentContainer.js +2 -2
  92. package/PigmentGrid/PigmentGrid.d.ts +2 -2
  93. package/PigmentGrid/PigmentGrid.js +2 -2
  94. package/PigmentHidden/PigmentHidden.d.ts +2 -2
  95. package/PigmentHidden/PigmentHidden.js +2 -2
  96. package/PigmentStack/PigmentStack.d.ts +2 -2
  97. package/PigmentStack/PigmentStack.js +2 -2
  98. package/Popover/Popover.d.ts +64 -10
  99. package/Popover/Popover.js +78 -51
  100. package/Popper/Popper.d.ts +4 -4
  101. package/Popper/Popper.js +4 -4
  102. package/Portal/Portal.d.ts +2 -2
  103. package/Portal/Portal.js +2 -2
  104. package/README.md +4 -3
  105. package/Radio/Radio.d.ts +3 -3
  106. package/RadioGroup/RadioGroup.d.ts +3 -3
  107. package/Rating/Rating.d.ts +2 -2
  108. package/ScopedCssBaseline/ScopedCssBaseline.d.ts +2 -2
  109. package/Select/Select.d.ts +3 -3
  110. package/Skeleton/Skeleton.d.ts +2 -2
  111. package/Slide/Slide.d.ts +4 -4
  112. package/Slider/Slider.d.ts +20 -11
  113. package/Slider/Slider.js +2 -2
  114. package/Slider/sliderClasses.d.ts +7 -21
  115. package/Snackbar/Snackbar.d.ts +80 -3
  116. package/Snackbar/Snackbar.js +122 -32
  117. package/SnackbarContent/SnackbarContent.d.ts +3 -3
  118. package/SpeedDial/SpeedDial.d.ts +2 -2
  119. package/SpeedDialAction/SpeedDialAction.d.ts +3 -3
  120. package/SpeedDialIcon/SpeedDialIcon.d.ts +2 -2
  121. package/Stack/Stack.d.ts +2 -2
  122. package/Step/Step.d.ts +2 -2
  123. package/StepButton/StepButton.d.ts +3 -3
  124. package/StepConnector/StepConnector.d.ts +2 -2
  125. package/StepContent/StepContent.d.ts +2 -2
  126. package/StepIcon/StepIcon.d.ts +3 -3
  127. package/StepLabel/StepLabel.d.ts +2 -2
  128. package/Stepper/Stepper.d.ts +2 -2
  129. package/SvgIcon/SvgIcon.d.ts +3 -3
  130. package/SwipeableDrawer/SwipeableDrawer.d.ts +3 -3
  131. package/Switch/Switch.d.ts +4 -4
  132. package/Tab/Tab.d.ts +3 -3
  133. package/TabScrollButton/TabScrollButton.d.ts +2 -2
  134. package/Table/Table.d.ts +2 -2
  135. package/TableBody/TableBody.d.ts +2 -2
  136. package/TableCell/TableCell.d.ts +2 -2
  137. package/TableContainer/TableContainer.d.ts +2 -2
  138. package/TableFooter/TableFooter.d.ts +2 -2
  139. package/TableHead/TableHead.d.ts +2 -2
  140. package/TablePagination/TablePagination.d.ts +4 -4
  141. package/TableRow/TableRow.d.ts +2 -2
  142. package/TableSortLabel/TableSortLabel.d.ts +3 -3
  143. package/Tabs/Tabs.d.ts +2 -2
  144. package/TextField/TextField.d.ts +10 -10
  145. package/TextareaAutosize/TextareaAutosize.d.ts +2 -2
  146. package/TextareaAutosize/TextareaAutosize.js +2 -2
  147. package/ToggleButton/ToggleButton.d.ts +3 -3
  148. package/ToggleButtonGroup/ToggleButtonGroup.d.ts +2 -2
  149. package/Toolbar/Toolbar.d.ts +2 -2
  150. package/Tooltip/Tooltip.d.ts +2 -2
  151. package/Typography/Typography.d.ts +3 -3
  152. package/Zoom/Zoom.d.ts +3 -3
  153. package/index.js +1 -1
  154. package/internal/SwitchBase.d.ts +33 -1
  155. package/internal/SwitchBase.js +84 -30
  156. package/modern/ClickAwayListener/ClickAwayListener.js +3 -3
  157. package/modern/Grid2/Grid2.js +2 -2
  158. package/modern/Menu/Menu.js +6 -2
  159. package/modern/MobileStepper/MobileStepper.js +18 -76
  160. package/modern/Modal/Modal.js +9 -10
  161. package/modern/NoSsr/NoSsr.js +2 -2
  162. package/modern/PigmentContainer/PigmentContainer.js +2 -2
  163. package/modern/PigmentGrid/PigmentGrid.js +2 -2
  164. package/modern/PigmentHidden/PigmentHidden.js +2 -2
  165. package/modern/PigmentStack/PigmentStack.js +2 -2
  166. package/modern/Popover/Popover.js +78 -51
  167. package/modern/Popper/Popper.js +4 -4
  168. package/modern/Portal/Portal.js +2 -2
  169. package/modern/Slider/Slider.js +2 -2
  170. package/modern/Snackbar/Snackbar.js +122 -32
  171. package/modern/TextareaAutosize/TextareaAutosize.js +2 -2
  172. package/modern/index.js +1 -1
  173. package/modern/internal/SwitchBase.js +84 -30
  174. package/modern/version/index.js +5 -5
  175. package/node/ClickAwayListener/ClickAwayListener.js +3 -3
  176. package/node/Grid2/Grid2.js +2 -2
  177. package/node/Menu/Menu.js +6 -2
  178. package/node/MobileStepper/MobileStepper.js +18 -76
  179. package/node/Modal/Modal.js +9 -10
  180. package/node/NoSsr/NoSsr.js +2 -2
  181. package/node/PigmentContainer/PigmentContainer.js +2 -2
  182. package/node/PigmentGrid/PigmentGrid.js +2 -2
  183. package/node/PigmentHidden/PigmentHidden.js +2 -2
  184. package/node/PigmentStack/PigmentStack.js +2 -2
  185. package/node/Popover/Popover.js +78 -51
  186. package/node/Popper/Popper.js +4 -4
  187. package/node/Portal/Portal.js +2 -2
  188. package/node/Slider/Slider.js +2 -2
  189. package/node/Snackbar/Snackbar.js +122 -32
  190. package/node/TextareaAutosize/TextareaAutosize.js +2 -2
  191. package/node/index.js +1 -1
  192. package/node/internal/SwitchBase.js +84 -30
  193. package/node/version/index.js +5 -5
  194. package/package.json +7 -7
  195. package/version/index.js +5 -5
@@ -15,12 +15,12 @@ import { useDefaultProps } from "../DefaultPropsProvider/index.js";
15
15
  import debounce from "../utils/debounce.js";
16
16
  import ownerDocument from "../utils/ownerDocument.js";
17
17
  import ownerWindow from "../utils/ownerWindow.js";
18
- import useForkRef from "../utils/useForkRef.js";
19
18
  import Grow from "../Grow/index.js";
20
19
  import Modal from "../Modal/index.js";
21
20
  import PaperBase from "../Paper/index.js";
22
21
  import { getPopoverUtilityClass } from "./popoverClasses.js";
23
22
  import useSlot from "../utils/useSlot.js";
23
+ import { mergeSlotProps } from "../utils/index.js";
24
24
  import { jsx as _jsx } from "react/jsx-runtime";
25
25
  export function getOffsetTop(rect, vertical) {
26
26
  let offset = 0;
@@ -103,22 +103,21 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
103
103
  marginThreshold = 16,
104
104
  open,
105
105
  PaperProps: PaperPropsProp = {},
106
+ // TODO: remove in v7
106
107
  slots = {},
107
108
  slotProps = {},
108
109
  transformOrigin = {
109
110
  vertical: 'top',
110
111
  horizontal: 'left'
111
112
  },
112
- TransitionComponent = Grow,
113
+ TransitionComponent,
114
+ // TODO: remove in v7
113
115
  transitionDuration: transitionDurationProp = 'auto',
114
- TransitionProps: {
115
- onEntering,
116
- ...TransitionProps
117
- } = {},
116
+ TransitionProps = {},
117
+ // TODO: remove in v7
118
118
  disableScrollLock = false,
119
119
  ...other
120
120
  } = props;
121
- const externalPaperSlotProps = slotProps?.paper ?? PaperPropsProp;
122
121
  const paperRef = React.useRef();
123
122
  const ownerState = {
124
123
  ...props,
@@ -126,7 +125,6 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
126
125
  anchorReference,
127
126
  elevation,
128
127
  marginThreshold,
129
- externalPaperSlotProps,
130
128
  transformOrigin,
131
129
  TransitionComponent,
132
130
  transitionDuration: transitionDurationProp,
@@ -255,10 +253,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
255
253
  }
256
254
  return () => window.removeEventListener('scroll', setPositioningStyles);
257
255
  }, [anchorEl, disableScrollLock, setPositioningStyles]);
258
- const handleEntering = (element, isAppearing) => {
259
- if (onEntering) {
260
- onEntering(element, isAppearing);
261
- }
256
+ const handleEntering = () => {
262
257
  setPositioningStyles();
263
258
  };
264
259
  const handleExited = () => {
@@ -289,45 +284,65 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
289
284
  };
290
285
  }, [anchorEl, open, setPositioningStyles]);
291
286
  let transitionDuration = transitionDurationProp;
292
- if (transitionDurationProp === 'auto' && !TransitionComponent.muiSupportAuto) {
293
- transitionDuration = undefined;
294
- }
295
-
296
- // If the container prop is provided, use that
297
- // If the anchorEl prop is provided, use its parent body element as the container
298
- // If neither are provided let the Modal take care of choosing the container
299
- const container = containerProp || (anchorEl ? ownerDocument(resolveAnchorEl(anchorEl)).body : undefined);
300
287
  const externalForwardedProps = {
301
- slots,
288
+ slots: {
289
+ transition: TransitionComponent,
290
+ ...slots
291
+ },
302
292
  slotProps: {
303
- ...slotProps,
304
- paper: externalPaperSlotProps
293
+ transition: TransitionProps,
294
+ paper: PaperPropsProp,
295
+ ...slotProps
305
296
  }
306
297
  };
307
- const [PaperSlot, paperProps] = useSlot('paper', {
308
- elementType: PopoverPaper,
298
+ const [TransitionSlot, transitionSlotProps] = useSlot('transition', {
299
+ elementType: Grow,
309
300
  externalForwardedProps,
310
- additionalProps: {
311
- elevation,
312
- className: clsx(classes.paper, externalPaperSlotProps?.className),
313
- style: isPositioned ? externalPaperSlotProps.style : {
314
- ...externalPaperSlotProps.style,
315
- opacity: 0
301
+ ownerState,
302
+ getSlotProps: handlers => ({
303
+ ...handlers,
304
+ onEntering: (element, isAppearing) => {
305
+ handlers.onEntering?.(element, isAppearing);
306
+ handleEntering();
307
+ },
308
+ onExited: element => {
309
+ handlers.onExited?.(element);
310
+ handleExited();
316
311
  }
317
- },
318
- ownerState
312
+ }),
313
+ additionalProps: {
314
+ appear: true,
315
+ in: open
316
+ }
319
317
  });
318
+ if (transitionDurationProp === 'auto' && !TransitionSlot.muiSupportAuto) {
319
+ transitionDuration = undefined;
320
+ }
321
+
322
+ // If the container prop is provided, use that
323
+ // If the anchorEl prop is provided, use its parent body element as the container
324
+ // If neither are provided let the Modal take care of choosing the container
325
+ const container = containerProp || (anchorEl ? ownerDocument(resolveAnchorEl(anchorEl)).body : undefined);
320
326
  const [RootSlot, {
327
+ slots: rootSlotsProp,
321
328
  slotProps: rootSlotPropsProp,
322
329
  ...rootProps
323
330
  }] = useSlot('root', {
331
+ ref,
324
332
  elementType: PopoverRoot,
325
- externalForwardedProps,
333
+ externalForwardedProps: {
334
+ ...externalForwardedProps,
335
+ ...other
336
+ },
337
+ shouldForwardComponentProp: true,
326
338
  additionalProps: {
339
+ slots: {
340
+ backdrop: slots.backdrop
341
+ },
327
342
  slotProps: {
328
- backdrop: {
343
+ backdrop: mergeSlotProps(typeof slotProps.backdrop === 'function' ? slotProps.backdrop(ownerState) : slotProps.backdrop, {
329
344
  invisible: true
330
- }
345
+ })
331
346
  },
332
347
  container,
333
348
  open
@@ -335,25 +350,32 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
335
350
  ownerState,
336
351
  className: clsx(classes.root, className)
337
352
  });
338
- const handlePaperRef = useForkRef(paperRef, paperProps.ref);
353
+ const [PaperSlot, paperProps] = useSlot('paper', {
354
+ ref: paperRef,
355
+ className: classes.paper,
356
+ elementType: PopoverPaper,
357
+ externalForwardedProps,
358
+ shouldForwardComponentProp: true,
359
+ additionalProps: {
360
+ elevation,
361
+ style: isPositioned ? undefined : {
362
+ opacity: 0
363
+ }
364
+ },
365
+ ownerState
366
+ });
339
367
  return /*#__PURE__*/_jsx(RootSlot, {
340
368
  ...rootProps,
341
369
  ...(!isHostComponent(RootSlot) && {
370
+ slots: rootSlotsProp,
342
371
  slotProps: rootSlotPropsProp,
343
372
  disableScrollLock
344
373
  }),
345
- ...other,
346
- ref: ref,
347
- children: /*#__PURE__*/_jsx(TransitionComponent, {
348
- appear: true,
349
- in: open,
350
- onEntering: handleEntering,
351
- onExited: handleExited,
374
+ children: /*#__PURE__*/_jsx(TransitionSlot, {
375
+ ...transitionSlotProps,
352
376
  timeout: transitionDuration,
353
- ...TransitionProps,
354
377
  children: /*#__PURE__*/_jsx(PaperSlot, {
355
378
  ...paperProps,
356
- ref: handlePaperRef,
357
379
  children: children
358
380
  })
359
381
  })
@@ -421,8 +443,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
421
443
  anchorReference: PropTypes.oneOf(['anchorEl', 'anchorPosition', 'none']),
422
444
  /**
423
445
  * A backdrop component. This prop enables custom backdrop rendering.
424
- * @deprecated Use `slotProps.root.slots.backdrop` instead. While this prop currently works, it will be removed in the next major version.
425
- * Use the `slotProps.root.slots.backdrop` prop to make your application ready for the next version of Material UI.
446
+ * @deprecated Use `slots.backdrop` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
426
447
  * @default styled(Backdrop, {
427
448
  * name: 'MuiModal',
428
449
  * slot: 'Backdrop',
@@ -436,7 +457,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
436
457
  BackdropComponent: PropTypes.elementType,
437
458
  /**
438
459
  * Props applied to the [`Backdrop`](/material-ui/api/backdrop/) element.
439
- * @deprecated Use `slotProps.root.slotProps.backdrop` instead.
460
+ * @deprecated Use `slotProps.backdrop` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
440
461
  */
441
462
  BackdropProps: PropTypes.object,
442
463
  /**
@@ -500,16 +521,20 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
500
521
  * @default {}
501
522
  */
502
523
  slotProps: PropTypes.shape({
524
+ backdrop: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
503
525
  paper: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
504
- root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
526
+ root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
527
+ transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
505
528
  }),
506
529
  /**
507
530
  * The components used for each slot inside.
508
531
  * @default {}
509
532
  */
510
533
  slots: PropTypes.shape({
534
+ backdrop: PropTypes.elementType,
511
535
  paper: PropTypes.elementType,
512
- root: PropTypes.elementType
536
+ root: PropTypes.elementType,
537
+ transition: PropTypes.elementType
513
538
  }),
514
539
  /**
515
540
  * The system prop that allows defining system overrides as well as additional CSS styles.
@@ -534,6 +559,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
534
559
  /**
535
560
  * The component used for the transition.
536
561
  * [Follow this guide](https://mui.com/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
562
+ * @deprecated use the `slots.transition` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
537
563
  * @default Grow
538
564
  */
539
565
  TransitionComponent: PropTypes.elementType,
@@ -549,6 +575,7 @@ process.env.NODE_ENV !== "production" ? Popover.propTypes /* remove-proptypes */
549
575
  /**
550
576
  * Props applied to the transition element.
551
577
  * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
578
+ * @deprecated use the `slotProps.transition` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
552
579
  * @default {}
553
580
  */
554
581
  TransitionProps: PropTypes.object
@@ -34,13 +34,13 @@ export interface PopperProps extends Omit<BasePopperProps, 'direction'> {
34
34
  *
35
35
  * Demos:
36
36
  *
37
- * - [Autocomplete](https://mui.com/material-ui/react-autocomplete/)
38
- * - [Menu](https://mui.com/material-ui/react-menu/)
39
- * - [Popper](https://mui.com/material-ui/react-popper/)
37
+ * - [Autocomplete](https://next.mui.com/material-ui/react-autocomplete/)
38
+ * - [Menu](https://next.mui.com/material-ui/react-menu/)
39
+ * - [Popper](https://next.mui.com/material-ui/react-popper/)
40
40
  *
41
41
  * API:
42
42
  *
43
- * - [Popper API](https://mui.com/material-ui/api/popper/)
43
+ * - [Popper API](https://next.mui.com/material-ui/api/popper/)
44
44
  */
45
45
  declare const Popper: React.ForwardRefExoticComponent<PopperProps & React.RefAttributes<HTMLDivElement>>;
46
46
  export default Popper;
package/Popper/Popper.js CHANGED
@@ -19,13 +19,13 @@ const PopperRoot = styled(BasePopper, {
19
19
  *
20
20
  * Demos:
21
21
  *
22
- * - [Autocomplete](https://mui.com/material-ui/react-autocomplete/)
23
- * - [Menu](https://mui.com/material-ui/react-menu/)
24
- * - [Popper](https://mui.com/material-ui/react-popper/)
22
+ * - [Autocomplete](https://next.mui.com/material-ui/react-autocomplete/)
23
+ * - [Menu](https://next.mui.com/material-ui/react-menu/)
24
+ * - [Popper](https://next.mui.com/material-ui/react-popper/)
25
25
  *
26
26
  * API:
27
27
  *
28
- * - [Popper API](https://mui.com/material-ui/api/popper/)
28
+ * - [Popper API](https://next.mui.com/material-ui/api/popper/)
29
29
  */
30
30
  const Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {
31
31
  const isRtl = useRtl();
@@ -6,11 +6,11 @@ import { PortalProps } from './Portal.types';
6
6
  *
7
7
  * Demos:
8
8
  *
9
- * - [Portal](https://mui.com/material-ui/react-portal/)
9
+ * - [Portal](https://next.mui.com/material-ui/react-portal/)
10
10
  *
11
11
  * API:
12
12
  *
13
- * - [Portal API](https://mui.com/material-ui/api/portal/)
13
+ * - [Portal API](https://next.mui.com/material-ui/api/portal/)
14
14
  */
15
15
  declare const Portal: React.ForwardRefExoticComponent<PortalProps & React.RefAttributes<Element>>;
16
16
  export default Portal;
package/Portal/Portal.js CHANGED
@@ -14,11 +14,11 @@ function getContainer(container) {
14
14
  *
15
15
  * Demos:
16
16
  *
17
- * - [Portal](https://mui.com/material-ui/react-portal/)
17
+ * - [Portal](https://next.mui.com/material-ui/react-portal/)
18
18
  *
19
19
  * API:
20
20
  *
21
- * - [Portal API](https://mui.com/material-ui/api/portal/)
21
+ * - [Portal API](https://next.mui.com/material-ui/api/portal/)
22
22
  */
23
23
  const Portal = /*#__PURE__*/React.forwardRef(function Portal(props, forwardedRef) {
24
24
  const {
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
+ <!-- #default-branch-switch -->
1
2
  <!-- markdownlint-disable-next-line -->
2
3
  <p align="center">
3
- <a href="https://mui.com/material-ui/" rel="noopener" target="_blank"><img width="150" height="133" src="https://mui.com/static/logo.svg" alt="Material UI logo"></a>
4
+ <a href="https://next.mui.com/material-ui/" rel="noopener" target="_blank"><img width="150" height="133" src="https://mui.com/static/logo.svg" alt="Material UI logo"></a>
4
5
  </p>
5
6
 
6
7
  <h1 align="center">Material UI</h1>
@@ -14,12 +15,12 @@ Install the package in your project directory with:
14
15
  <!-- #default-branch-switch -->
15
16
 
16
17
  ```bash
17
- npm install @mui/material @emotion/react @emotion/styled
18
+ npm install @mui/material@next @emotion/react @emotion/styled
18
19
  ```
19
20
 
20
21
  ## Documentation
21
22
 
22
- Visit [https://mui.com/material-ui/](https://mui.com/material-ui/) to view the full documentation.
23
+ Visit [https://next.mui.com/material-ui/](https://next.mui.com/material-ui/) to view the full documentation.
23
24
 
24
25
  ## Questions
25
26
 
package/Radio/Radio.d.ts CHANGED
@@ -55,11 +55,11 @@ export interface RadioProps
55
55
  *
56
56
  * Demos:
57
57
  *
58
- * - [Radio Group](https://mui.com/material-ui/react-radio-button/)
58
+ * - [Radio Group](https://next.mui.com/material-ui/react-radio-button/)
59
59
  *
60
60
  * API:
61
61
  *
62
- * - [Radio API](https://mui.com/material-ui/api/radio/)
63
- * - inherits [ButtonBase API](https://mui.com/material-ui/api/button-base/)
62
+ * - [Radio API](https://next.mui.com/material-ui/api/radio/)
63
+ * - inherits [ButtonBase API](https://next.mui.com/material-ui/api/button-base/)
64
64
  */
65
65
  export default function Radio(props: RadioProps): React.JSX.Element;
@@ -29,11 +29,11 @@ export interface RadioGroupProps extends Omit<FormGroupProps, 'onChange'> {
29
29
  *
30
30
  * Demos:
31
31
  *
32
- * - [Radio Group](https://mui.com/material-ui/react-radio-button/)
32
+ * - [Radio Group](https://next.mui.com/material-ui/react-radio-button/)
33
33
  *
34
34
  * API:
35
35
  *
36
- * - [RadioGroup API](https://mui.com/material-ui/api/radio-group/)
37
- * - inherits [FormGroup API](https://mui.com/material-ui/api/form-group/)
36
+ * - [RadioGroup API](https://next.mui.com/material-ui/api/radio-group/)
37
+ * - inherits [FormGroup API](https://next.mui.com/material-ui/api/form-group/)
38
38
  */
39
39
  export default function RadioGroup(props: RadioGroupProps): React.JSX.Element;
@@ -126,11 +126,11 @@ export type RatingTypeMap<
126
126
  *
127
127
  * Demos:
128
128
  *
129
- * - [Rating](https://mui.com/material-ui/react-rating/)
129
+ * - [Rating](https://next.mui.com/material-ui/react-rating/)
130
130
  *
131
131
  * API:
132
132
  *
133
- * - [Rating API](https://mui.com/material-ui/api/rating/)
133
+ * - [Rating API](https://next.mui.com/material-ui/api/rating/)
134
134
  */
135
135
  declare const Rating: OverridableComponent<RatingTypeMap>;
136
136
 
@@ -36,11 +36,11 @@ export interface ScopedCssBaselineTypeMap<
36
36
  *
37
37
  * Demos:
38
38
  *
39
- * - [CSS Baseline](https://mui.com/material-ui/react-css-baseline/)
39
+ * - [CSS Baseline](https://next.mui.com/material-ui/react-css-baseline/)
40
40
  *
41
41
  * API:
42
42
  *
43
- * - [ScopedCssBaseline API](https://mui.com/material-ui/api/scoped-css-baseline/)
43
+ * - [ScopedCssBaseline API](https://next.mui.com/material-ui/api/scoped-css-baseline/)
44
44
  */
45
45
  declare const ScopedCssBaseline: OverridableComponent<ScopedCssBaselineTypeMap>;
46
46
 
@@ -195,12 +195,12 @@ export type SelectProps<Value = unknown> =
195
195
  *
196
196
  * Demos:
197
197
  *
198
- * - [Select](https://mui.com/material-ui/react-select/)
198
+ * - [Select](https://next.mui.com/material-ui/react-select/)
199
199
  *
200
200
  * API:
201
201
  *
202
- * - [Select API](https://mui.com/material-ui/api/select/)
203
- * - inherits [OutlinedInput API](https://mui.com/material-ui/api/outlined-input/)
202
+ * - [Select API](https://next.mui.com/material-ui/api/select/)
203
+ * - inherits [OutlinedInput API](https://next.mui.com/material-ui/api/outlined-input/)
204
204
  */
205
205
  declare const Select: (<Value = unknown>(props: SelectProps<Value>) => React.JSX.Element) & {
206
206
  muiName: string;
@@ -58,11 +58,11 @@ export interface SkeletonTypeMap<
58
58
  *
59
59
  * Demos:
60
60
  *
61
- * - [Skeleton](https://mui.com/material-ui/react-skeleton/)
61
+ * - [Skeleton](https://next.mui.com/material-ui/react-skeleton/)
62
62
  *
63
63
  * API:
64
64
  *
65
- * - [Skeleton API](https://mui.com/material-ui/api/skeleton/)
65
+ * - [Skeleton API](https://next.mui.com/material-ui/api/skeleton/)
66
66
  */
67
67
  declare const Skeleton: OverridableComponent<SkeletonTypeMap>;
68
68
 
package/Slide/Slide.d.ts CHANGED
@@ -48,17 +48,17 @@ export interface SlideProps extends TransitionProps {
48
48
  }
49
49
 
50
50
  /**
51
- * The Slide transition is used by the [Drawer](https://mui.com/material-ui/react-drawer/) component.
51
+ * The Slide transition is used by the [Drawer](https://next.mui.com/material-ui/react-drawer/) component.
52
52
  * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
53
53
  *
54
54
  * Demos:
55
55
  *
56
- * - [Dialog](https://mui.com/material-ui/react-dialog/)
57
- * - [Transitions](https://mui.com/material-ui/transitions/)
56
+ * - [Dialog](https://next.mui.com/material-ui/react-dialog/)
57
+ * - [Transitions](https://next.mui.com/material-ui/transitions/)
58
58
  *
59
59
  * API:
60
60
  *
61
- * - [Slide API](https://mui.com/material-ui/api/slide/)
61
+ * - [Slide API](https://next.mui.com/material-ui/api/slide/)
62
62
  * - inherits [Transition API](https://reactcommunity.org/react-transition-group/transition/#Transition-props)
63
63
  */
64
64
  export default function Slide(props: SlideProps): React.JSX.Element;
@@ -20,7 +20,7 @@ export interface SliderOwnerState extends SliderProps {
20
20
  focusedThumbIndex: number;
21
21
  }
22
22
 
23
- export interface SliderOwnProps {
23
+ export interface SliderOwnProps<Value extends number | number[]> {
24
24
  /**
25
25
  * The label of the slider.
26
26
  */
@@ -93,7 +93,7 @@ export interface SliderOwnProps {
93
93
  /**
94
94
  * The default value. Use when the component is not controlled.
95
95
  */
96
- defaultValue?: number | number[];
96
+ defaultValue?: Value;
97
97
  /**
98
98
  * If `true`, the component is disabled.
99
99
  * @default false
@@ -148,17 +148,17 @@ export interface SliderOwnProps {
148
148
  * @param {Event} event The event source of the callback.
149
149
  * You can pull out the new value by accessing `event.target.value` (any).
150
150
  * **Warning**: This is a generic event not a change event.
151
- * @param {number | number[]} value The new value.
151
+ * @param {Value} value The new value.
152
152
  * @param {number} activeThumb Index of the currently moved thumb.
153
153
  */
154
- onChange?: (event: Event, value: number | number[], activeThumb: number) => void;
154
+ onChange?: (event: Event, value: Value, activeThumb: number) => void;
155
155
  /**
156
156
  * Callback function that is fired when the `mouseup` is triggered.
157
157
  *
158
158
  * @param {React.SyntheticEvent | Event} event The event source of the callback. **Warning**: This is a generic event not a change event.
159
- * @param {number | number[]} value The new value.
159
+ * @param {Value} value The new value.
160
160
  */
161
- onChangeCommitted?: (event: React.SyntheticEvent | Event, value: number | number[]) => void;
161
+ onChangeCommitted?: (event: React.SyntheticEvent | Event, value: Value) => void;
162
162
  /**
163
163
  * The component orientation.
164
164
  * @default 'horizontal'
@@ -246,7 +246,7 @@ export interface SliderOwnProps {
246
246
  * The value of the slider.
247
247
  * For ranged sliders, provide an array with two values.
248
248
  */
249
- value?: number | number[];
249
+ value?: Value;
250
250
  /**
251
251
  * Controls when the value label is displayed:
252
252
  *
@@ -275,11 +275,20 @@ export interface SliderOwnProps {
275
275
  export interface SliderTypeMap<
276
276
  RootComponent extends React.ElementType = 'span',
277
277
  AdditionalProps = {},
278
+ Value extends number | number[] = number | number[],
278
279
  > {
279
- props: AdditionalProps & SliderOwnProps;
280
+ props: AdditionalProps & SliderOwnProps<Value>;
280
281
  defaultComponent: RootComponent;
281
282
  }
282
283
 
284
+ export type SliderComponent<Value extends number | number[]> = OverridableComponent<
285
+ SliderTypeMap<'span', {}, Value>
286
+ >;
287
+
288
+ export type SliderType = SliderComponent<number> &
289
+ SliderComponent<number[]> &
290
+ SliderComponent<number | number[]>;
291
+
283
292
  export interface SliderValueLabelProps extends React.HTMLAttributes<HTMLSpanElement> {
284
293
  children: React.ReactElement<unknown>;
285
294
  index: number;
@@ -306,13 +315,13 @@ export declare const SliderValueLabel: React.FC<SliderValueLabelProps>;
306
315
  *
307
316
  * Demos:
308
317
  *
309
- * - [Slider](https://mui.com/material-ui/react-slider/)
318
+ * - [Slider](https://next.mui.com/material-ui/react-slider/)
310
319
  *
311
320
  * API:
312
321
  *
313
- * - [Slider API](https://mui.com/material-ui/api/slider/)
322
+ * - [Slider API](https://next.mui.com/material-ui/api/slider/)
314
323
  */
315
- declare const Slider: OverridableComponent<SliderTypeMap>;
324
+ declare const Slider: SliderType;
316
325
 
317
326
  export type SliderProps<
318
327
  RootComponent extends React.ElementType = SliderTypeMap['defaultComponent'],
package/Slider/Slider.js CHANGED
@@ -966,7 +966,7 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
966
966
  * @param {Event} event The event source of the callback.
967
967
  * You can pull out the new value by accessing `event.target.value` (any).
968
968
  * **Warning**: This is a generic event not a change event.
969
- * @param {number | number[]} value The new value.
969
+ * @param {Value} value The new value.
970
970
  * @param {number} activeThumb Index of the currently moved thumb.
971
971
  */
972
972
  onChange: PropTypes.func,
@@ -974,7 +974,7 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes /* remove-proptypes */
974
974
  * Callback function that is fired when the `mouseup` is triggered.
975
975
  *
976
976
  * @param {React.SyntheticEvent | Event} event The event source of the callback. **Warning**: This is a generic event not a change event.
977
- * @param {number | number[]} value The new value.
977
+ * @param {Value} value The new value.
978
978
  */
979
979
  onChangeCommitted: PropTypes.func,
980
980
  /**
@@ -45,33 +45,19 @@ export interface SliderClasses {
45
45
  markLabelActive: string;
46
46
  /** Styles applied to the root element if `size="small"`. */
47
47
  sizeSmall: string;
48
- /** Styles applied to the thumb element if `color="primary"`.
49
- * @deprecated Combine the [.MuiSlider-thumb](/material-ui/api/slider/#slider-classes-thumb) and [.MuiSlider-colorPrimary](/material-ui/api/slider/#slider-classes-colorPrimary) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
50
- */
48
+ /** Styles applied to the thumb element if `color="primary"`. */
51
49
  thumbColorPrimary: string;
52
- /** Styles applied to the thumb element if `color="secondary"`.
53
- * @deprecated Combine the [.MuiSlider-thumb](/material-ui/api/slider/#slider-classes-thumb) and [.MuiSlider-colorSecondary](/material-ui/api/slider/#slider-classes-colorSecondary) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
54
- */
50
+ /** Styles applied to the thumb element if `color="secondary"`. */
55
51
  thumbColorSecondary: string;
56
- /** Styles applied to the thumb element if `color="error"`.
57
- * @deprecated Combine the [.MuiSlider-thumb](/material-ui/api/slider/#slider-classes-thumb) and [.MuiSlider-colorError](/material-ui/api/slider/#slider-classes-colorError) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
58
- */
52
+ /** Styles applied to the thumb element if `color="error"`. */
59
53
  thumbColorError: string;
60
- /** Styles applied to the thumb element if `color="info"`.
61
- * @deprecated Combine the [.MuiSlider-thumb](/material-ui/api/slider/#slider-classes-thumb) and [.MuiSlider-colorInfo](/material-ui/api/slider/#slider-classes-colorInfo) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
62
- */
54
+ /** Styles applied to the thumb element if `color="info"`. */
63
55
  thumbColorInfo: string;
64
- /** Styles applied to the thumb element if `color="success"`.
65
- * @deprecated Combine the [.MuiSlider-thumb](/material-ui/api/slider/#slider-classes-thumb) and [.MuiSlider-colorSuccess](/material-ui/api/slider/#slider-classes-colorSuccess) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
66
- */
56
+ /** Styles applied to the thumb element if `color="success"`. */
67
57
  thumbColorSuccess: string;
68
- /** Styles applied to the thumb element if `color="warning"`.
69
- * @deprecated Combine the [.MuiSlider-thumb](/material-ui/api/slider/#slider-classes-thumb) and [.MuiSlider-colorWarning](/material-ui/api/slider/#slider-classes-colorWarning) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
70
- */
58
+ /** Styles applied to the thumb element if `color="warning"`. */
71
59
  thumbColorWarning: string;
72
- /** Styles applied to the thumb element if `size="small"`.
73
- * @deprecated Combine the [.MuiSlider-thumb](/material-ui/api/slider/#slider-classes-thumb) and [.MuiSlider-sizeSmall](/material-ui/api/slider/#slider-classes-sizeSmall) classes instead. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
74
- */
60
+ /** Styles applied to the thumb element if `size="small"`. */
75
61
  thumbSizeSmall: string;
76
62
  /** Styles applied to the thumb label element. */
77
63
  valueLabel: string;