@mui/material 5.3.1 → 5.4.3

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 (201) hide show
  1. package/Autocomplete/Autocomplete.d.ts +5 -0
  2. package/Autocomplete/Autocomplete.js +11 -3
  3. package/AvatarGroup/AvatarGroup.d.ts +10 -0
  4. package/AvatarGroup/AvatarGroup.js +19 -7
  5. package/Badge/Badge.js +3 -2
  6. package/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
  7. package/ButtonBase/ButtonBase.d.ts +5 -1
  8. package/ButtonBase/ButtonBase.js +15 -2
  9. package/ButtonBase/TouchRipple.js +1 -2
  10. package/CHANGELOG.md +295 -27
  11. package/Dialog/Dialog.d.ts +4 -1
  12. package/Dialog/Dialog.js +10 -6
  13. package/Drawer/Drawer.d.ts +4 -1
  14. package/Drawer/Drawer.js +11 -9
  15. package/Fab/Fab.d.ts +4 -1
  16. package/Fab/Fab.js +8 -20
  17. package/Fab/fabClasses.js +1 -1
  18. package/Fade/Fade.d.ts +2 -2
  19. package/Fade/Fade.js +8 -8
  20. package/FormControlLabel/FormControlLabel.js +11 -3
  21. package/FormControlLabel/formControlLabelClasses.d.ts +2 -0
  22. package/FormControlLabel/formControlLabelClasses.js +1 -1
  23. package/FormGroup/FormGroup.js +14 -3
  24. package/FormGroup/formGroupClasses.d.ts +2 -0
  25. package/FormGroup/formGroupClasses.js +1 -1
  26. package/FormHelperText/FormHelperText.js +7 -9
  27. package/Grid/Grid.js +2 -4
  28. package/ImageList/ImageList.js +3 -1
  29. package/InputAdornment/InputAdornment.js +6 -9
  30. package/Modal/Modal.js +1 -1
  31. package/OutlinedInput/NotchedOutline.js +14 -16
  32. package/OutlinedInput/OutlinedInput.js +1 -1
  33. package/README.md +6 -6
  34. package/Radio/RadioButtonIcon.js +2 -6
  35. package/Rating/Rating.js +1 -1
  36. package/Select/Select.js +19 -7
  37. package/Select/SelectInput.js +12 -10
  38. package/Slide/Slide.d.ts +4 -4
  39. package/Slide/Slide.js +14 -14
  40. package/Slider/Slider.js +3 -1
  41. package/Snackbar/Snackbar.d.ts +2 -2
  42. package/Snackbar/Snackbar.js +12 -9
  43. package/SpeedDial/SpeedDial.d.ts +2 -2
  44. package/SpeedDial/SpeedDial.js +9 -7
  45. package/Step/StepContext.d.ts +20 -0
  46. package/Step/StepContext.js +10 -2
  47. package/Step/index.d.ts +3 -0
  48. package/Step/index.js +3 -1
  49. package/SwipeableDrawer/SwipeArea.js +1 -3
  50. package/SwipeableDrawer/SwipeableDrawer.js +8 -6
  51. package/TextField/TextField.js +1 -1
  52. package/ToggleButton/ToggleButton.d.ts +15 -0
  53. package/ToggleButton/ToggleButton.js +8 -2
  54. package/Zoom/Zoom.d.ts +2 -2
  55. package/Zoom/Zoom.js +8 -8
  56. package/index.d.ts +11 -3
  57. package/index.js +8 -3
  58. package/internal/SwitchBase.js +2 -6
  59. package/legacy/Autocomplete/Autocomplete.js +12 -3
  60. package/legacy/AvatarGroup/AvatarGroup.js +20 -7
  61. package/legacy/Badge/Badge.js +4 -2
  62. package/legacy/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
  63. package/legacy/ButtonBase/ButtonBase.js +15 -2
  64. package/legacy/ButtonBase/TouchRipple.js +1 -2
  65. package/legacy/Dialog/Dialog.js +10 -6
  66. package/legacy/Drawer/Drawer.js +11 -9
  67. package/legacy/Fab/Fab.js +8 -20
  68. package/legacy/Fab/fabClasses.js +1 -1
  69. package/legacy/Fade/Fade.js +8 -8
  70. package/legacy/FormControlLabel/FormControlLabel.js +11 -3
  71. package/legacy/FormControlLabel/formControlLabelClasses.js +1 -1
  72. package/legacy/FormGroup/FormGroup.js +14 -3
  73. package/legacy/FormGroup/formGroupClasses.js +1 -1
  74. package/legacy/FormHelperText/FormHelperText.js +7 -9
  75. package/legacy/Grid/Grid.js +2 -4
  76. package/legacy/ImageList/ImageList.js +3 -1
  77. package/legacy/InputAdornment/InputAdornment.js +6 -9
  78. package/legacy/Modal/Modal.js +1 -1
  79. package/legacy/OutlinedInput/NotchedOutline.js +14 -16
  80. package/legacy/OutlinedInput/OutlinedInput.js +1 -1
  81. package/legacy/Radio/RadioButtonIcon.js +2 -6
  82. package/legacy/Rating/Rating.js +1 -1
  83. package/legacy/Select/Select.js +23 -7
  84. package/legacy/Select/SelectInput.js +12 -10
  85. package/legacy/Slide/Slide.js +14 -14
  86. package/legacy/Slider/Slider.js +3 -1
  87. package/legacy/Snackbar/Snackbar.js +12 -9
  88. package/legacy/SpeedDial/SpeedDial.js +9 -7
  89. package/legacy/Step/StepContext.js +10 -2
  90. package/legacy/Step/index.js +3 -1
  91. package/legacy/SwipeableDrawer/SwipeArea.js +1 -3
  92. package/legacy/SwipeableDrawer/SwipeableDrawer.js +8 -6
  93. package/legacy/TextField/TextField.js +1 -1
  94. package/legacy/ToggleButton/ToggleButton.js +8 -2
  95. package/legacy/Zoom/Zoom.js +8 -8
  96. package/legacy/index.js +8 -3
  97. package/legacy/internal/SwitchBase.js +2 -6
  98. package/legacy/locale/index.js +86 -78
  99. package/legacy/styles/makeStyles.js +1 -1
  100. package/legacy/styles/withStyles.js +1 -1
  101. package/legacy/styles/withTheme.js +1 -1
  102. package/legacy/useMediaQuery/useMediaQuery.js +87 -32
  103. package/locale/index.js +12 -6
  104. package/modern/Autocomplete/Autocomplete.js +11 -3
  105. package/modern/AvatarGroup/AvatarGroup.js +17 -7
  106. package/modern/Badge/Badge.js +3 -2
  107. package/modern/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
  108. package/modern/ButtonBase/ButtonBase.js +15 -2
  109. package/modern/ButtonBase/TouchRipple.js +1 -2
  110. package/modern/Dialog/Dialog.js +10 -6
  111. package/modern/Drawer/Drawer.js +11 -9
  112. package/modern/Fab/Fab.js +8 -20
  113. package/modern/Fab/fabClasses.js +1 -1
  114. package/modern/Fade/Fade.js +8 -8
  115. package/modern/FormControlLabel/FormControlLabel.js +11 -3
  116. package/modern/FormControlLabel/formControlLabelClasses.js +1 -1
  117. package/modern/FormGroup/FormGroup.js +14 -3
  118. package/modern/FormGroup/formGroupClasses.js +1 -1
  119. package/modern/FormHelperText/FormHelperText.js +7 -9
  120. package/modern/Grid/Grid.js +2 -4
  121. package/modern/ImageList/ImageList.js +3 -1
  122. package/modern/InputAdornment/InputAdornment.js +6 -9
  123. package/modern/Modal/Modal.js +1 -1
  124. package/modern/OutlinedInput/NotchedOutline.js +14 -16
  125. package/modern/OutlinedInput/OutlinedInput.js +1 -1
  126. package/modern/Radio/RadioButtonIcon.js +2 -6
  127. package/modern/Rating/Rating.js +1 -1
  128. package/modern/Select/Select.js +19 -7
  129. package/modern/Select/SelectInput.js +12 -10
  130. package/modern/Slide/Slide.js +14 -14
  131. package/modern/Slider/Slider.js +3 -1
  132. package/modern/Snackbar/Snackbar.js +12 -9
  133. package/modern/SpeedDial/SpeedDial.js +9 -7
  134. package/modern/Step/StepContext.js +10 -2
  135. package/modern/Step/index.js +3 -1
  136. package/modern/SwipeableDrawer/SwipeArea.js +1 -3
  137. package/modern/SwipeableDrawer/SwipeableDrawer.js +8 -6
  138. package/modern/TextField/TextField.js +1 -1
  139. package/modern/ToggleButton/ToggleButton.js +8 -2
  140. package/modern/Zoom/Zoom.js +8 -8
  141. package/modern/index.js +8 -3
  142. package/modern/internal/SwitchBase.js +2 -6
  143. package/modern/locale/index.js +12 -6
  144. package/modern/styles/makeStyles.js +1 -1
  145. package/modern/styles/withStyles.js +1 -1
  146. package/modern/styles/withTheme.js +1 -1
  147. package/modern/useMediaQuery/useMediaQuery.js +69 -27
  148. package/node/Autocomplete/Autocomplete.js +11 -3
  149. package/node/AvatarGroup/AvatarGroup.js +19 -7
  150. package/node/Badge/Badge.js +3 -2
  151. package/node/Breadcrumbs/BreadcrumbCollapsed.js +1 -3
  152. package/node/ButtonBase/ButtonBase.js +15 -2
  153. package/node/ButtonBase/TouchRipple.js +1 -2
  154. package/node/Dialog/Dialog.js +11 -7
  155. package/node/Drawer/Drawer.js +11 -10
  156. package/node/Fab/Fab.js +8 -20
  157. package/node/Fab/fabClasses.js +1 -1
  158. package/node/Fade/Fade.js +7 -9
  159. package/node/FormControlLabel/FormControlLabel.js +12 -3
  160. package/node/FormControlLabel/formControlLabelClasses.js +1 -1
  161. package/node/FormGroup/FormGroup.js +15 -3
  162. package/node/FormGroup/formGroupClasses.js +1 -1
  163. package/node/FormHelperText/FormHelperText.js +6 -9
  164. package/node/Grid/Grid.js +2 -4
  165. package/node/ImageList/ImageList.js +3 -1
  166. package/node/InputAdornment/InputAdornment.js +5 -9
  167. package/node/Modal/Modal.js +1 -1
  168. package/node/OutlinedInput/NotchedOutline.js +12 -16
  169. package/node/OutlinedInput/OutlinedInput.js +1 -1
  170. package/node/Radio/RadioButtonIcon.js +2 -6
  171. package/node/Rating/Rating.js +1 -1
  172. package/node/Select/Select.js +22 -9
  173. package/node/Select/SelectInput.js +11 -10
  174. package/node/Slide/Slide.js +14 -16
  175. package/node/Slider/Slider.js +3 -1
  176. package/node/Snackbar/Snackbar.js +12 -10
  177. package/node/SpeedDial/SpeedDial.js +9 -7
  178. package/node/Step/StepContext.js +11 -1
  179. package/node/Step/index.js +22 -1
  180. package/node/SwipeableDrawer/SwipeArea.js +1 -3
  181. package/node/SwipeableDrawer/SwipeableDrawer.js +8 -7
  182. package/node/TextField/TextField.js +1 -1
  183. package/node/ToggleButton/ToggleButton.js +8 -2
  184. package/node/Zoom/Zoom.js +7 -9
  185. package/node/index.js +62 -16
  186. package/node/internal/SwitchBase.js +2 -6
  187. package/node/locale/index.js +12 -6
  188. package/node/styles/makeStyles.js +1 -1
  189. package/node/styles/withStyles.js +1 -1
  190. package/node/styles/withTheme.js +1 -1
  191. package/node/useMediaQuery/useMediaQuery.js +69 -27
  192. package/package.json +8 -8
  193. package/styles/ThemeProvider.d.ts +1 -1
  194. package/styles/index.d.ts +3 -0
  195. package/styles/makeStyles.js +1 -1
  196. package/styles/withStyles.js +1 -1
  197. package/styles/withTheme.js +1 -1
  198. package/umd/material-ui.development.js +5022 -7146
  199. package/umd/material-ui.production.min.js +21 -21
  200. package/useMediaQuery/useMediaQuery.d.ts +4 -0
  201. package/useMediaQuery/useMediaQuery.js +69 -27
package/Slide/Slide.js CHANGED
@@ -8,7 +8,6 @@ import { elementAcceptingRef, HTMLElementType, chainPropTypes } from '@mui/utils
8
8
  import debounce from '../utils/debounce';
9
9
  import useForkRef from '../utils/useForkRef';
10
10
  import useTheme from '../styles/useTheme';
11
- import { duration, easing } from '../styles/createTransitions';
12
11
  import { reflow, getTransitionProps } from '../transitions/utils';
13
12
  import { ownerWindow } from '../utils'; // Translate the node so it can't be seen on the screen.
14
13
  // Later, we're going to translate the node back to its original location with `none`.
@@ -82,20 +81,22 @@ export function setTranslateValue(direction, node, containerProp) {
82
81
  node.style.transform = transform;
83
82
  }
84
83
  }
85
- const defaultEasing = {
86
- enter: easing.easeOut,
87
- exit: easing.sharp
88
- };
89
- const defaultTimeout = {
90
- enter: duration.enteringScreen,
91
- exit: duration.leavingScreen
92
- };
93
84
  /**
94
85
  * The Slide transition is used by the [Drawer](/components/drawers/) component.
95
86
  * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
96
87
  */
97
88
 
98
89
  const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
90
+ const theme = useTheme();
91
+ const defaultEasing = {
92
+ enter: theme.transitions.easing.easeOut,
93
+ exit: theme.transitions.easing.sharp
94
+ };
95
+ const defaultTimeout = {
96
+ enter: theme.transitions.duration.enteringScreen,
97
+ exit: theme.transitions.duration.leavingScreen
98
+ };
99
+
99
100
  const {
100
101
  addEndListener,
101
102
  appear = true,
@@ -117,7 +118,6 @@ const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
117
118
  } = props,
118
119
  other = _objectWithoutPropertiesLoose(props, _excluded);
119
120
 
120
- const theme = useTheme();
121
121
  const childrenRef = React.useRef(null);
122
122
  const handleRefIntermediary = useForkRef(children.ref, childrenRef);
123
123
  const handleRef = useForkRef(handleRefIntermediary, ref);
@@ -305,8 +305,8 @@ process.env.NODE_ENV !== "production" ? Slide.propTypes
305
305
  * The transition timing function.
306
306
  * You may specify a single easing or a object containing enter and exit values.
307
307
  * @default {
308
- * enter: easing.easeOut,
309
- * exit: easing.sharp,
308
+ * enter: theme.transitions.easing.easeOut,
309
+ * exit: theme.transitions.easing.sharp,
310
310
  * }
311
311
  */
312
312
  easing: PropTypes.oneOfType([PropTypes.shape({
@@ -358,8 +358,8 @@ process.env.NODE_ENV !== "production" ? Slide.propTypes
358
358
  * The duration for the transition, in milliseconds.
359
359
  * You may specify a single timeout for all transitions, or individually with an object.
360
360
  * @default {
361
- * enter: duration.enteringScreen,
362
- * exit: duration.leavingScreen,
361
+ * enter: theme.transitions.duration.enteringScreen,
362
+ * exit: theme.transitions.duration.leavingScreen,
363
363
  * }
364
364
  */
365
365
  timeout: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
package/Slider/Slider.js CHANGED
@@ -691,7 +691,9 @@ process.env.NODE_ENV !== "production" ? Slider.propTypes
691
691
  * The size of the slider.
692
692
  * @default 'medium'
693
693
  */
694
- size: PropTypes.oneOf(['small', 'medium']),
694
+ size: PropTypes
695
+ /* @typescript-to-proptypes-ignore */
696
+ .oneOfType([PropTypes.oneOf(['small', 'medium']), PropTypes.string]),
695
697
 
696
698
  /**
697
699
  * The granularity with which the slider can step through values. (A "discrete" slider.)
@@ -104,8 +104,8 @@ export interface SnackbarProps extends StandardProps<React.HTMLAttributes<HTMLDi
104
104
  * The duration for the transition, in milliseconds.
105
105
  * You may specify a single timeout for all transitions, or individually with an object.
106
106
  * @default {
107
- * enter: duration.enteringScreen,
108
- * exit: duration.leavingScreen,
107
+ * enter: theme.transitions.duration.enteringScreen,
108
+ * exit: theme.transitions.duration.leavingScreen,
109
109
  * }
110
110
  */
111
111
  transitionDuration?: TransitionProps['timeout'];
@@ -10,7 +10,6 @@ import ClickAwayListener from '@mui/base/ClickAwayListener';
10
10
  import styled from '../styles/styled';
11
11
  import useTheme from '../styles/useTheme';
12
12
  import useThemeProps from '../styles/useThemeProps';
13
- import { duration } from '../styles/createTransitions';
14
13
  import useEventCallback from '../utils/useEventCallback';
15
14
  import capitalize from '../utils/capitalize';
16
15
  import Grow from '../Grow';
@@ -93,6 +92,11 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
93
92
  props: inProps,
94
93
  name: 'MuiSnackbar'
95
94
  });
95
+ const theme = useTheme();
96
+ const defaultTransitionDuration = {
97
+ enter: theme.transitions.duration.enteringScreen,
98
+ exit: theme.transitions.duration.leavingScreen
99
+ };
96
100
 
97
101
  const {
98
102
  action,
@@ -118,10 +122,7 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
118
122
  open,
119
123
  resumeHideDuration,
120
124
  TransitionComponent = Grow,
121
- transitionDuration = {
122
- enter: duration.enteringScreen,
123
- exit: duration.leavingScreen
124
- },
125
+ transitionDuration = defaultTransitionDuration,
125
126
  TransitionProps: {
126
127
  onEnter,
127
128
  onExited
@@ -130,7 +131,6 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
130
131
  TransitionProps = _objectWithoutPropertiesLoose(props.TransitionProps, _excluded),
131
132
  other = _objectWithoutPropertiesLoose(props, _excluded2);
132
133
 
133
- const theme = useTheme();
134
134
  const isRtl = theme.direction === 'rtl';
135
135
 
136
136
  const ownerState = _extends({}, props, {
@@ -290,7 +290,10 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
290
290
  onMouseEnter: handleMouseEnter,
291
291
  onMouseLeave: handleMouseLeave,
292
292
  ownerState: ownerState,
293
- ref: ref
293
+ ref: ref // ClickAwayListener adds an `onClick` prop which results in the alert not being announced.
294
+ // See https://github.com/mui-org/material-ui/issues/29080
295
+ ,
296
+ role: "presentation"
294
297
  }, other, {
295
298
  children: /*#__PURE__*/_jsx(TransitionComponent, _extends({
296
299
  appear: true,
@@ -446,8 +449,8 @@ process.env.NODE_ENV !== "production" ? Snackbar.propTypes
446
449
  * The duration for the transition, in milliseconds.
447
450
  * You may specify a single timeout for all transitions, or individually with an object.
448
451
  * @default {
449
- * enter: duration.enteringScreen,
450
- * exit: duration.leavingScreen,
452
+ * enter: theme.transitions.duration.enteringScreen,
453
+ * exit: theme.transitions.duration.leavingScreen,
451
454
  * }
452
455
  */
453
456
  transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
@@ -80,8 +80,8 @@ export interface SpeedDialProps
80
80
  * The duration for the transition, in milliseconds.
81
81
  * You may specify a single timeout for all transitions, or individually with an object.
82
82
  * @default {
83
- * enter: duration.enteringScreen,
84
- * exit: duration.leavingScreen,
83
+ * enter: theme.transitions.duration.enteringScreen,
84
+ * exit: theme.transitions.duration.leavingScreen,
85
85
  * }
86
86
  */
87
87
  transitionDuration?: TransitionProps['timeout'];
@@ -10,7 +10,7 @@ import clsx from 'clsx';
10
10
  import { unstable_composeClasses as composeClasses } from '@mui/base';
11
11
  import styled from '../styles/styled';
12
12
  import useThemeProps from '../styles/useThemeProps';
13
- import { duration } from '../styles/createTransitions';
13
+ import useTheme from '../styles/useTheme';
14
14
  import Zoom from '../Zoom';
15
15
  import Fab from '../Fab';
16
16
  import capitalize from '../utils/capitalize';
@@ -137,6 +137,11 @@ const SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref)
137
137
  props: inProps,
138
138
  name: 'MuiSpeedDial'
139
139
  });
140
+ const theme = useTheme();
141
+ const defaultTransitionDuration = {
142
+ enter: theme.transitions.duration.enteringScreen,
143
+ exit: theme.transitions.duration.leavingScreen
144
+ };
140
145
 
141
146
  const {
142
147
  ariaLabel,
@@ -157,10 +162,7 @@ const SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref)
157
162
  onOpen,
158
163
  open: openProp,
159
164
  TransitionComponent = Zoom,
160
- transitionDuration = {
161
- enter: duration.enteringScreen,
162
- exit: duration.leavingScreen
163
- },
165
+ transitionDuration = defaultTransitionDuration,
164
166
  TransitionProps
165
167
  } = props,
166
168
  FabProps = _objectWithoutPropertiesLoose(props.FabProps, _excluded),
@@ -542,8 +544,8 @@ process.env.NODE_ENV !== "production" ? SpeedDial.propTypes
542
544
  * The duration for the transition, in milliseconds.
543
545
  * You may specify a single timeout for all transitions, or individually with an object.
544
546
  * @default {
545
- * enter: duration.enteringScreen,
546
- * exit: duration.leavingScreen,
547
+ * enter: theme.transitions.duration.enteringScreen,
548
+ * exit: theme.transitions.duration.leavingScreen,
547
549
  * }
548
550
  */
549
551
  transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ export interface StepContextType {
3
+ index: number;
4
+ last: boolean;
5
+ expanded: boolean;
6
+ icon: React.ReactNode;
7
+ active: boolean;
8
+ completed: boolean;
9
+ disabled: boolean;
10
+ }
11
+ /**
12
+ * Provides information about the current step in Stepper.
13
+ */
14
+ declare const StepContext: React.Context<{} | StepContextType>;
15
+ /**
16
+ * Returns the current StepContext or an empty object if no StepContext
17
+ * has been defined in the component tree.
18
+ */
19
+ export declare function useStepContext(): StepContextType | {};
20
+ export default StepContext;
@@ -1,12 +1,20 @@
1
1
  import * as React from 'react';
2
+
2
3
  /**
3
- * @ignore - internal component.
4
+ * Provides information about the current step in Stepper.
4
5
  */
5
-
6
6
  const StepContext = /*#__PURE__*/React.createContext({});
7
7
 
8
8
  if (process.env.NODE_ENV !== 'production') {
9
9
  StepContext.displayName = 'StepContext';
10
10
  }
11
+ /**
12
+ * Returns the current StepContext or an empty object if no StepContext
13
+ * has been defined in the component tree.
14
+ */
15
+
11
16
 
17
+ export function useStepContext() {
18
+ return React.useContext(StepContext);
19
+ }
12
20
  export default StepContext;
package/Step/index.d.ts CHANGED
@@ -3,3 +3,6 @@ export * from './Step';
3
3
 
4
4
  export { default as stepClasses } from './stepClasses';
5
5
  export * from './stepClasses';
6
+
7
+ export { default as StepContext } from './StepContext';
8
+ export * from './StepContext';
package/Step/index.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export { default } from './Step';
2
2
  export { default as stepClasses } from './stepClasses';
3
- export * from './stepClasses';
3
+ export * from './stepClasses';
4
+ export { default as StepContext } from './StepContext';
5
+ export * from './StepContext';
@@ -8,9 +8,7 @@ import styled from '../styles/styled';
8
8
  import capitalize from '../utils/capitalize';
9
9
  import { isHorizontal } from '../Drawer/Drawer';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
- const SwipeAreaRoot = styled('div', {
12
- skipSx: true
13
- })(({
11
+ const SwipeAreaRoot = styled('div')(({
14
12
  theme,
15
13
  ownerState
16
14
  }) => _extends({
@@ -12,7 +12,6 @@ import ownerDocument from '../utils/ownerDocument';
12
12
  import ownerWindow from '../utils/ownerWindow';
13
13
  import useEventCallback from '../utils/useEventCallback';
14
14
  import useEnhancedEffect from '../utils/useEnhancedEffect';
15
- import { duration } from '../styles/createTransitions';
16
15
  import useTheme from '../styles/useTheme';
17
16
  import { getTransitionProps } from '../transitions/utils';
18
17
  import SwipeArea from './SwipeArea'; // This value is closed to what browsers are using internally to
@@ -125,16 +124,16 @@ function computeHasNativeHandler({
125
124
  }
126
125
 
127
126
  const iOS = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent);
128
- const transitionDurationDefault = {
129
- enter: duration.enteringScreen,
130
- exit: duration.leavingScreen
131
- };
132
127
  const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(inProps, ref) {
133
128
  const props = useThemeProps({
134
129
  name: 'MuiSwipeableDrawer',
135
130
  props: inProps
136
131
  });
137
132
  const theme = useTheme();
133
+ const transitionDurationDefault = {
134
+ enter: theme.transitions.duration.enteringScreen,
135
+ exit: theme.transitions.duration.leavingScreen
136
+ };
138
137
 
139
138
  const {
140
139
  anchor = 'left',
@@ -612,7 +611,10 @@ process.env.NODE_ENV !== "production" ? SwipeableDrawer.propTypes
612
611
  /**
613
612
  * The duration for the transition, in milliseconds.
614
613
  * You may specify a single timeout for all transitions, or individually with an object.
615
- * @default { enter: duration.enteringScreen, exit: duration.leavingScreen }
614
+ * @default {
615
+ * enter: theme.transitions.duration.enteringScreen,
616
+ * exit: theme.transitions.duration.leavingScreen,
617
+ * }
616
618
  */
617
619
  transitionDuration: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
618
620
  appear: PropTypes.number,
@@ -191,7 +191,7 @@ const TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref)
191
191
  variant: variant,
192
192
  ownerState: ownerState
193
193
  }, other, {
194
- children: [label && /*#__PURE__*/_jsx(InputLabel, _extends({
194
+ children: [label != null && label !== '' && /*#__PURE__*/_jsx(InputLabel, _extends({
195
195
  htmlFor: id,
196
196
  id: inputLabelId
197
197
  }, InputLabelProps, {
@@ -1,5 +1,6 @@
1
1
  import { SxProps } from '@mui/system';
2
2
  import { OverridableStringUnion } from '@mui/types';
3
+ import * as React from 'react';
3
4
  import { Theme } from '..';
4
5
  import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase';
5
6
  import { OverrideProps } from '../OverridableComponent';
@@ -45,6 +46,20 @@ export type ToggleButtonTypeMap<
45
46
  * @default false
46
47
  */
47
48
  fullWidth?: boolean;
49
+ /**
50
+ * Callback fired when the state changes.
51
+ *
52
+ * @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
53
+ * @param {any} value of the selected button.
54
+ */
55
+ onChange?: (event: React.MouseEvent<HTMLElement>, value: any) => void;
56
+ /**
57
+ * Callback fired when the button is clicked.
58
+ *
59
+ * @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
60
+ * @param {any} value of the selected button.
61
+ */
62
+ onClick?: (event: React.MouseEvent<HTMLElement>, value: any) => void;
48
63
  /**
49
64
  * If `true`, the button is rendered in an active state.
50
65
  */
@@ -200,12 +200,18 @@ process.env.NODE_ENV !== "production" ? ToggleButton.propTypes
200
200
  fullWidth: PropTypes.bool,
201
201
 
202
202
  /**
203
- * @ignore
203
+ * Callback fired when the state changes.
204
+ *
205
+ * @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
206
+ * @param {any} value of the selected button.
204
207
  */
205
208
  onChange: PropTypes.func,
206
209
 
207
210
  /**
208
- * @ignore
211
+ * Callback fired when the button is clicked.
212
+ *
213
+ * @param {React.MouseEvent<HTMLElement>} event The event source of the callback.
214
+ * @param {any} value of the selected button.
209
215
  */
210
216
  onClick: PropTypes.func,
211
217
 
package/Zoom/Zoom.d.ts CHANGED
@@ -26,8 +26,8 @@ export interface ZoomProps extends TransitionProps {
26
26
  * The duration for the transition, in milliseconds.
27
27
  * You may specify a single timeout for all transitions, or individually with an object.
28
28
  * @default {
29
- * enter: duration.enteringScreen,
30
- * exit: duration.leavingScreen,
29
+ * enter: theme.transitions.duration.enteringScreen,
30
+ * exit: theme.transitions.duration.leavingScreen,
31
31
  * }
32
32
  */
33
33
  timeout?: TransitionProps['timeout'];
package/Zoom/Zoom.js CHANGED
@@ -5,7 +5,6 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { Transition } from 'react-transition-group';
7
7
  import { elementAcceptingRef } from '@mui/utils';
8
- import { duration } from '../styles/createTransitions';
9
8
  import useTheme from '../styles/useTheme';
10
9
  import { reflow, getTransitionProps } from '../transitions/utils';
11
10
  import useForkRef from '../utils/useForkRef';
@@ -18,10 +17,6 @@ const styles = {
18
17
  transform: 'none'
19
18
  }
20
19
  };
21
- const defaultTimeout = {
22
- enter: duration.enteringScreen,
23
- exit: duration.leavingScreen
24
- };
25
20
  /**
26
21
  * The Zoom transition can be used for the floating variant of the
27
22
  * [Button](/components/buttons/#floating-action-buttons) component.
@@ -29,6 +24,12 @@ const defaultTimeout = {
29
24
  */
30
25
 
31
26
  const Zoom = /*#__PURE__*/React.forwardRef(function Zoom(props, ref) {
27
+ const theme = useTheme();
28
+ const defaultTimeout = {
29
+ enter: theme.transitions.duration.enteringScreen,
30
+ exit: theme.transitions.duration.leavingScreen
31
+ };
32
+
32
33
  const {
33
34
  addEndListener,
34
35
  appear = true,
@@ -48,7 +49,6 @@ const Zoom = /*#__PURE__*/React.forwardRef(function Zoom(props, ref) {
48
49
  } = props,
49
50
  other = _objectWithoutPropertiesLoose(props, _excluded);
50
51
 
51
- const theme = useTheme();
52
52
  const nodeRef = React.useRef(null);
53
53
  const foreignRef = useForkRef(children.ref, ref);
54
54
  const handleRef = useForkRef(nodeRef, foreignRef);
@@ -213,8 +213,8 @@ process.env.NODE_ENV !== "production" ? Zoom.propTypes
213
213
  * The duration for the transition, in milliseconds.
214
214
  * You may specify a single timeout for all transitions, or individually with an object.
215
215
  * @default {
216
- * enter: duration.enteringScreen,
217
- * exit: duration.leavingScreen,
216
+ * enter: theme.transitions.duration.enteringScreen,
217
+ * exit: theme.transitions.duration.leavingScreen,
218
218
  * }
219
219
  */
220
220
  timeout: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
package/index.d.ts CHANGED
@@ -23,7 +23,7 @@ export type StandardProps<
23
23
 
24
24
  /**
25
25
  * @internal
26
- * ONLY USE FROM WITHIN mui-org/material-ui
26
+ * ONLY USE FROM WITHIN mui/material-ui
27
27
  *
28
28
  * Internal helper type for conform (describeConformance) components
29
29
  * However, we don't declare classes on this type.
@@ -74,8 +74,6 @@ export * from './styles';
74
74
 
75
75
  export * from './utils';
76
76
 
77
- export * from '@mui/base';
78
-
79
77
  export { default as Accordion } from './Accordion';
80
78
  export * from './Accordion';
81
79
 
@@ -328,6 +326,9 @@ export * from './Popover';
328
326
  export { default as Popper } from './Popper';
329
327
  export * from './Popper';
330
328
 
329
+ export { default as Portal } from './Portal';
330
+ export * from './Portal';
331
+
331
332
  export { default as Radio } from './Radio';
332
333
  export * from './Radio';
333
334
 
@@ -476,3 +477,10 @@ export * from './GlobalStyles';
476
477
  * @deprecated will be removed in v5.beta, please use StyledEngineProvider from @mui/material/styles instead
477
478
  */
478
479
  export { StyledEngineProvider } from './styles';
480
+
481
+ export { default as unstable_composeClasses } from '@mui/base/composeClasses';
482
+
483
+ export { default as generateUtilityClass } from '@mui/base/generateUtilityClass';
484
+ export * from '@mui/base/generateUtilityClass';
485
+
486
+ export { default as generateUtilityClasses } from '@mui/base/generateUtilityClasses';
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.3.1
1
+ /** @license MUI v5.4.3
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -8,7 +8,6 @@ import * as colors from './colors';
8
8
  export { colors };
9
9
  export * from './styles';
10
10
  export * from './utils';
11
- export * from '@mui/base';
12
11
  export { default as Accordion } from './Accordion';
13
12
  export * from './Accordion';
14
13
  export { default as AccordionActions } from './AccordionActions';
@@ -175,6 +174,8 @@ export { default as Popover } from './Popover';
175
174
  export * from './Popover';
176
175
  export { default as Popper } from './Popper';
177
176
  export * from './Popper';
177
+ export { default as Portal } from './Portal';
178
+ export * from './Portal';
178
179
  export { default as Radio } from './Radio';
179
180
  export * from './Radio';
180
181
  export { default as RadioGroup } from './RadioGroup';
@@ -273,4 +274,8 @@ export * from './Zoom'; // createFilterOptions is exported from Autocomplete
273
274
  export { default as useAutocomplete } from './useAutocomplete';
274
275
  export { default as GlobalStyles } from './GlobalStyles';
275
276
  export * from './GlobalStyles';
276
- export { StyledEngineProvider } from './styles';
277
+ export { StyledEngineProvider } from './styles';
278
+ export { default as unstable_composeClasses } from '@mui/base/composeClasses';
279
+ export { default as generateUtilityClass } from '@mui/base/generateUtilityClass';
280
+ export * from '@mui/base/generateUtilityClass';
281
+ export { default as generateUtilityClasses } from '@mui/base/generateUtilityClasses';
@@ -29,9 +29,7 @@ const useUtilityClasses = ownerState => {
29
29
  return composeClasses(slots, getSwitchBaseUtilityClass, classes);
30
30
  };
31
31
 
32
- const SwitchBaseRoot = styled(ButtonBase, {
33
- skipSx: true
34
- })(({
32
+ const SwitchBaseRoot = styled(ButtonBase)(({
35
33
  ownerState
36
34
  }) => _extends({
37
35
  padding: 9,
@@ -41,9 +39,7 @@ const SwitchBaseRoot = styled(ButtonBase, {
41
39
  }, ownerState.edge === 'end' && {
42
40
  marginRight: ownerState.size === 'small' ? -3 : -12
43
41
  }));
44
- const SwitchBaseInput = styled('input', {
45
- skipSx: true
46
- })({
42
+ const SwitchBaseInput = styled('input')({
47
43
  cursor: 'inherit',
48
44
  position: 'absolute',
49
45
  opacity: 0,
@@ -420,6 +420,8 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
420
420
  PopperComponent = _props$PopperComponen === void 0 ? Popper : _props$PopperComponen,
421
421
  _props$popupIcon = props.popupIcon,
422
422
  popupIcon = _props$popupIcon === void 0 ? _ArrowDropDownIcon || (_ArrowDropDownIcon = /*#__PURE__*/_jsx(ArrowDropDownIcon, {})) : _props$popupIcon,
423
+ _props$readOnly = props.readOnly,
424
+ readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
423
425
  renderGroupProp = props.renderGroup,
424
426
  renderInput = props.renderInput,
425
427
  renderOptionProp = props.renderOption,
@@ -429,7 +431,7 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
429
431
  _props$size = props.size,
430
432
  size = _props$size === void 0 ? 'medium' : _props$size,
431
433
  valueProp = props.value,
432
- other = _objectWithoutProperties(props, ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"]);
434
+ other = _objectWithoutProperties(props, ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "className", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "componentsProps", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "isOptionEqualToValue", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "readOnly", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"]);
433
435
  /* eslint-enable @typescript-eslint/no-unused-vars */
434
436
 
435
437
 
@@ -455,7 +457,7 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
455
457
  inputValue = _useAutocomplete.inputValue,
456
458
  groupedOptions = _useAutocomplete.groupedOptions;
457
459
 
458
- var hasClearIcon = !disableClearable && !disabled && dirty;
460
+ var hasClearIcon = !disableClearable && !disabled && dirty && !readOnly;
459
461
  var hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
460
462
 
461
463
  var ownerState = _extends({}, props, {
@@ -582,7 +584,8 @@ var Autocomplete = /*#__PURE__*/React.forwardRef(function Autocomplete(inProps,
582
584
  },
583
585
  inputProps: _extends({
584
586
  className: clsx(classes.input),
585
- disabled: disabled
587
+ disabled: disabled,
588
+ readOnly: readOnly
586
589
  }, getInputProps())
587
590
  })
588
591
  })), popupOpen && anchorEl ? /*#__PURE__*/_jsx(AutocompletePopper, {
@@ -1025,6 +1028,12 @@ process.env.NODE_ENV !== "production" ? Autocomplete.propTypes
1025
1028
  */
1026
1029
  popupIcon: PropTypes.node,
1027
1030
 
1031
+ /**
1032
+ * If `true`, the component becomes readonly. It is also supported for multiple tags where the tag cannot be deleted.
1033
+ * @default false
1034
+ */
1035
+ readOnly: PropTypes.bool,
1036
+
1028
1037
  /**
1029
1038
  * Render the group.
1030
1039
  *
@@ -63,6 +63,8 @@ var AvatarGroupAvatar = styled(Avatar, {
63
63
  };
64
64
  });
65
65
  var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
66
+ var _componentsProps$addi, _componentsProps$addi2;
67
+
66
68
  var props = useThemeProps({
67
69
  props: inProps,
68
70
  name: 'MuiAvatarGroup'
@@ -70,6 +72,8 @@ var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, re
70
72
 
71
73
  var childrenProp = props.children,
72
74
  className = props.className,
75
+ _props$componentsProp = props.componentsProps,
76
+ componentsProps = _props$componentsProp === void 0 ? {} : _props$componentsProp,
73
77
  _props$max = props.max,
74
78
  max = _props$max === void 0 ? 5 : _props$max,
75
79
  _props$spacing = props.spacing,
@@ -77,7 +81,7 @@ var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, re
77
81
  total = props.total,
78
82
  _props$variant = props.variant,
79
83
  variant = _props$variant === void 0 ? 'circular' : _props$variant,
80
- other = _objectWithoutProperties(props, ["children", "className", "max", "spacing", "total", "variant"]);
84
+ other = _objectWithoutProperties(props, ["children", "className", "componentsProps", "max", "spacing", "total", "variant"]);
81
85
 
82
86
  var clampedMax = max < 2 ? 2 : max;
83
87
 
@@ -112,15 +116,16 @@ var AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, re
112
116
  className: clsx(classes.root, className),
113
117
  ref: ref
114
118
  }, other, {
115
- children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, {
119
+ children: [extraAvatars ? /*#__PURE__*/_jsxs(AvatarGroupAvatar, _extends({
116
120
  ownerState: ownerState,
117
- className: classes.avatar,
118
- style: {
121
+ variant: variant
122
+ }, componentsProps.additionalAvatar, {
123
+ className: clsx(classes.avatar, (_componentsProps$addi = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi.className),
124
+ style: _extends({
119
125
  marginLeft: marginLeft
120
- },
121
- variant: variant,
126
+ }, (_componentsProps$addi2 = componentsProps.additionalAvatar) == null ? void 0 : _componentsProps$addi2.style),
122
127
  children: ["+", extraAvatars]
123
- }) : null, children.slice(0, maxAvatars).reverse().map(function (child) {
128
+ })) : null, children.slice(0, maxAvatars).reverse().map(function (child) {
124
129
  return /*#__PURE__*/React.cloneElement(child, {
125
130
  className: clsx(child.props.className, classes.avatar),
126
131
  style: _extends({
@@ -154,6 +159,14 @@ process.env.NODE_ENV !== "production" ? AvatarGroup.propTypes
154
159
  */
155
160
  className: PropTypes.string,
156
161
 
162
+ /**
163
+ * The props used for each slot inside the AvatarGroup.
164
+ * @default {}
165
+ */
166
+ componentsProps: PropTypes.shape({
167
+ additionalAvatar: PropTypes.object
168
+ }),
169
+
157
170
  /**
158
171
  * Max avatars to show before +x.
159
172
  * @default 5