@mui/material 5.15.6 → 5.15.7

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 (79) hide show
  1. package/Accordion/index.js +0 -2
  2. package/AccordionActions/index.js +0 -2
  3. package/AccordionDetails/index.js +0 -2
  4. package/AccordionSummary/index.js +0 -2
  5. package/Avatar/Avatar.js +2 -2
  6. package/AvatarGroup/AvatarGroup.js +19 -39
  7. package/Badge/Badge.js +2 -2
  8. package/ButtonBase/TouchRipple.js +9 -14
  9. package/CHANGELOG.md +97 -3
  10. package/Collapse/Collapse.js +3 -8
  11. package/Grow/Grow.js +3 -8
  12. package/Rating/index.js +0 -2
  13. package/Select/Select.js +1 -1
  14. package/SpeedDial/SpeedDial.js +7 -12
  15. package/Toolbar/index.js +0 -2
  16. package/Tooltip/Tooltip.js +29 -40
  17. package/index.js +1 -3
  18. package/legacy/Accordion/index.js +0 -2
  19. package/legacy/AccordionActions/index.js +0 -2
  20. package/legacy/AccordionDetails/index.js +0 -2
  21. package/legacy/AccordionSummary/index.js +0 -2
  22. package/legacy/Avatar/Avatar.js +2 -2
  23. package/legacy/AvatarGroup/AvatarGroup.js +6 -31
  24. package/legacy/Badge/Badge.js +2 -2
  25. package/legacy/ButtonBase/TouchRipple.js +9 -14
  26. package/legacy/Collapse/Collapse.js +3 -8
  27. package/legacy/Grow/Grow.js +3 -8
  28. package/legacy/Rating/index.js +0 -2
  29. package/legacy/Select/Select.js +1 -1
  30. package/legacy/SpeedDial/SpeedDial.js +7 -12
  31. package/legacy/Toolbar/index.js +0 -2
  32. package/legacy/Tooltip/Tooltip.js +29 -38
  33. package/legacy/index.js +1 -3
  34. package/legacy/styles/createTheme.js +1 -13
  35. package/legacy/zero-styled/index.js +7 -2
  36. package/modern/Accordion/index.js +0 -2
  37. package/modern/AccordionActions/index.js +0 -2
  38. package/modern/AccordionDetails/index.js +0 -2
  39. package/modern/AccordionSummary/index.js +0 -2
  40. package/modern/Avatar/Avatar.js +2 -2
  41. package/modern/AvatarGroup/AvatarGroup.js +19 -39
  42. package/modern/Badge/Badge.js +2 -2
  43. package/modern/ButtonBase/TouchRipple.js +9 -14
  44. package/modern/Collapse/Collapse.js +3 -8
  45. package/modern/Grow/Grow.js +3 -8
  46. package/modern/Rating/index.js +0 -2
  47. package/modern/Select/Select.js +1 -1
  48. package/modern/SpeedDial/SpeedDial.js +7 -12
  49. package/modern/Toolbar/index.js +0 -2
  50. package/modern/Tooltip/Tooltip.js +29 -40
  51. package/modern/index.js +1 -3
  52. package/modern/styles/createTheme.js +1 -15
  53. package/modern/zero-styled/index.js +7 -2
  54. package/node/Accordion/index.js +0 -1
  55. package/node/AccordionActions/index.js +0 -1
  56. package/node/AccordionDetails/index.js +0 -1
  57. package/node/AccordionSummary/index.js +0 -1
  58. package/node/Avatar/Avatar.js +2 -2
  59. package/node/AvatarGroup/AvatarGroup.js +19 -39
  60. package/node/Badge/Badge.js +2 -2
  61. package/node/ButtonBase/TouchRipple.js +9 -14
  62. package/node/Collapse/Collapse.js +2 -7
  63. package/node/Grow/Grow.js +2 -7
  64. package/node/Rating/index.js +0 -1
  65. package/node/Select/Select.js +1 -1
  66. package/node/SpeedDial/SpeedDial.js +6 -11
  67. package/node/Toolbar/index.js +0 -1
  68. package/node/Tooltip/Tooltip.js +28 -39
  69. package/node/index.js +1 -3
  70. package/node/styles/createTheme.js +1 -15
  71. package/node/zero-styled/index.js +7 -1
  72. package/package.json +6 -6
  73. package/styles/createTheme.d.ts +0 -1
  74. package/styles/createTheme.js +1 -15
  75. package/styles/experimental_extendTheme.d.ts +3 -2
  76. package/umd/material-ui.development.js +367 -289
  77. package/umd/material-ui.production.min.js +4 -4
  78. package/zero-styled/index.d.ts +2 -1
  79. package/zero-styled/index.js +7 -2
@@ -7,7 +7,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
7
7
  import * as React from 'react';
8
8
  import PropTypes from 'prop-types';
9
9
  import clsx from 'clsx';
10
- import { elementAcceptingRef } from '@mui/utils';
10
+ import { elementAcceptingRef, unstable_useTimeout as useTimeout, unstable_Timeout as Timeout } from '@mui/utils';
11
11
  import { unstable_composeClasses as composeClasses, appendOwnerState } from '@mui/base';
12
12
  import { alpha } from '@mui/system';
13
13
  import styled from '../styles/styled';
@@ -184,14 +184,14 @@ var TooltipArrow = styled('span', {
184
184
  };
185
185
  });
186
186
  var hystersisOpen = false;
187
- var hystersisTimer = null;
187
+ var hystersisTimer = new Timeout();
188
188
  var cursorPosition = {
189
189
  x: 0,
190
190
  y: 0
191
191
  };
192
192
  export function testReset() {
193
193
  hystersisOpen = false;
194
- clearTimeout(hystersisTimer);
194
+ hystersisTimer.clear();
195
195
  }
196
196
  function composeEventHandler(handler, eventHandler) {
197
197
  return function (event) {
@@ -270,10 +270,10 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
270
270
  setArrowRef = _React$useState2[1];
271
271
  var ignoreNonTouchEvents = React.useRef(false);
272
272
  var disableInteractive = disableInteractiveProp || followCursor;
273
- var closeTimer = React.useRef();
274
- var enterTimer = React.useRef();
275
- var leaveTimer = React.useRef();
276
- var touchTimer = React.useRef();
273
+ var closeTimer = useTimeout();
274
+ var enterTimer = useTimeout();
275
+ var leaveTimer = useTimeout();
276
+ var touchTimer = useTimeout();
277
277
  var _useControlled = useControlled({
278
278
  controlled: openProp,
279
279
  default: false,
@@ -296,23 +296,18 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
296
296
  }
297
297
  var id = useId(idProp);
298
298
  var prevUserSelect = React.useRef();
299
- var stopTouchInteraction = React.useCallback(function () {
299
+ var stopTouchInteraction = useEventCallback(function () {
300
300
  if (prevUserSelect.current !== undefined) {
301
301
  document.body.style.WebkitUserSelect = prevUserSelect.current;
302
302
  prevUserSelect.current = undefined;
303
303
  }
304
- clearTimeout(touchTimer.current);
305
- }, []);
304
+ touchTimer.clear();
305
+ });
306
306
  React.useEffect(function () {
307
- return function () {
308
- clearTimeout(closeTimer.current);
309
- clearTimeout(enterTimer.current);
310
- clearTimeout(leaveTimer.current);
311
- stopTouchInteraction();
312
- };
307
+ return stopTouchInteraction;
313
308
  }, [stopTouchInteraction]);
314
309
  var handleOpen = function handleOpen(event) {
315
- clearTimeout(hystersisTimer);
310
+ hystersisTimer.clear();
316
311
  hystersisOpen = true;
317
312
 
318
313
  // The mouseover event will trigger for every nested element in the tooltip.
@@ -328,18 +323,16 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
328
323
  * @param {React.SyntheticEvent | Event} event
329
324
  */
330
325
  function (event) {
331
- clearTimeout(hystersisTimer);
332
- hystersisTimer = setTimeout(function () {
326
+ hystersisTimer.start(800 + leaveDelay, function () {
333
327
  hystersisOpen = false;
334
- }, 800 + leaveDelay);
328
+ });
335
329
  setOpenState(false);
336
330
  if (onClose && open) {
337
331
  onClose(event);
338
332
  }
339
- clearTimeout(closeTimer.current);
340
- closeTimer.current = setTimeout(function () {
333
+ closeTimer.start(theme.transitions.duration.shortest, function () {
341
334
  ignoreNonTouchEvents.current = false;
342
- }, theme.transitions.duration.shortest);
335
+ });
343
336
  });
344
337
  var handleEnter = function handleEnter(event) {
345
338
  if (ignoreNonTouchEvents.current && event.type !== 'touchstart') {
@@ -352,22 +345,21 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
352
345
  if (childNode) {
353
346
  childNode.removeAttribute('title');
354
347
  }
355
- clearTimeout(enterTimer.current);
356
- clearTimeout(leaveTimer.current);
348
+ enterTimer.clear();
349
+ leaveTimer.clear();
357
350
  if (enterDelay || hystersisOpen && enterNextDelay) {
358
- enterTimer.current = setTimeout(function () {
351
+ enterTimer.start(hystersisOpen ? enterNextDelay : enterDelay, function () {
359
352
  handleOpen(event);
360
- }, hystersisOpen ? enterNextDelay : enterDelay);
353
+ });
361
354
  } else {
362
355
  handleOpen(event);
363
356
  }
364
357
  };
365
358
  var handleLeave = function handleLeave(event) {
366
- clearTimeout(enterTimer.current);
367
- clearTimeout(leaveTimer.current);
368
- leaveTimer.current = setTimeout(function () {
359
+ enterTimer.clear();
360
+ leaveTimer.start(leaveDelay, function () {
369
361
  handleClose(event);
370
- }, leaveDelay);
362
+ });
371
363
  };
372
364
  var _useIsFocusVisible = useIsFocusVisible(),
373
365
  isFocusVisibleRef = _useIsFocusVisible.isFocusVisibleRef,
@@ -408,26 +400,25 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
408
400
  var handleMouseLeave = handleLeave;
409
401
  var handleTouchStart = function handleTouchStart(event) {
410
402
  detectTouchStart(event);
411
- clearTimeout(leaveTimer.current);
412
- clearTimeout(closeTimer.current);
403
+ leaveTimer.clear();
404
+ closeTimer.clear();
413
405
  stopTouchInteraction();
414
406
  prevUserSelect.current = document.body.style.WebkitUserSelect;
415
407
  // Prevent iOS text selection on long-tap.
416
408
  document.body.style.WebkitUserSelect = 'none';
417
- touchTimer.current = setTimeout(function () {
409
+ touchTimer.start(enterTouchDelay, function () {
418
410
  document.body.style.WebkitUserSelect = prevUserSelect.current;
419
411
  handleEnter(event);
420
- }, enterTouchDelay);
412
+ });
421
413
  };
422
414
  var handleTouchEnd = function handleTouchEnd(event) {
423
415
  if (children.props.onTouchEnd) {
424
416
  children.props.onTouchEnd(event);
425
417
  }
426
418
  stopTouchInteraction();
427
- clearTimeout(leaveTimer.current);
428
- leaveTimer.current = setTimeout(function () {
419
+ leaveTimer.start(leaveTouchDelay, function () {
429
420
  handleClose(event);
430
- }, leaveTouchDelay);
421
+ });
431
422
  };
432
423
  React.useEffect(function () {
433
424
  if (!open) {
package/legacy/index.js CHANGED
@@ -1,12 +1,10 @@
1
1
  /**
2
- * @mui/material v5.15.6
2
+ * @mui/material v5.15.7
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
- 'use client';
9
-
10
8
  /* eslint-disable import/export */
11
9
  import * as colors from './colors';
12
10
  export { colors };
@@ -37,19 +37,7 @@ function createTheme() {
37
37
  shadows: shadows.slice(),
38
38
  typography: createTypography(palette, typographyInput),
39
39
  transitions: createTransitions(transitionsInput),
40
- zIndex: _extends({}, zIndex),
41
- applyDarkStyles: function applyDarkStyles(css) {
42
- if (this.vars) {
43
- // If CssVarsProvider is used as a provider,
44
- // returns ':where([data-mui-color-scheme="light|dark"]) &'
45
- var selector = this.getColorSchemeSelector('dark').replace(/(\[[^\]]+\])/, ':where($1)');
46
- return _defineProperty({}, selector, css);
47
- }
48
- if (this.palette.mode === 'dark') {
49
- return css;
50
- }
51
- return {};
52
- }
40
+ zIndex: _extends({}, zIndex)
53
41
  });
54
42
  muiTheme = deepmerge(muiTheme, other);
55
43
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -1,2 +1,7 @@
1
- // eslint-disable-next-line import/prefer-default-export
2
- export { default as styled } from '../styles/styled';
1
+ import useThemeProps from '../styles/useThemeProps';
2
+ export { default as styled } from '../styles/styled';
3
+
4
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
+ export function createUseThemeProps(name) {
6
+ return useThemeProps;
7
+ }
@@ -1,5 +1,3 @@
1
- 'use client';
2
-
3
1
  export { default } from './Accordion';
4
2
  export { default as accordionClasses } from './accordionClasses';
5
3
  export * from './accordionClasses';
@@ -1,5 +1,3 @@
1
- 'use client';
2
-
3
1
  export { default } from './AccordionActions';
4
2
  export { default as accordionActionsClasses } from './accordionActionsClasses';
5
3
  export * from './accordionActionsClasses';
@@ -1,5 +1,3 @@
1
- 'use client';
2
-
3
1
  export { default } from './AccordionDetails';
4
2
  export { default as accordionDetailsClasses } from './accordionDetailsClasses';
5
3
  export * from './accordionDetailsClasses';
@@ -1,5 +1,3 @@
1
- 'use client';
2
-
3
1
  export { default } from './AccordionSummary';
4
2
  export { default as accordionSummaryClasses } from './accordionSummaryClasses';
5
3
  export * from './accordionSummaryClasses';
@@ -74,7 +74,7 @@ const AvatarRoot = styled('div', {
74
74
  backgroundColor: theme.vars.palette.Avatar.defaultBg
75
75
  } : _extends({
76
76
  backgroundColor: theme.palette.grey[400]
77
- }, theme.applyDarkStyles({
77
+ }, theme.applyStyles('dark', {
78
78
  backgroundColor: theme.palette.grey[600]
79
79
  })))
80
80
  }]
@@ -181,7 +181,7 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(inProps, ref) {
181
181
  ownerState: ownerState,
182
182
  className: classes.img
183
183
  }, imgProps));
184
- } else if (childrenProp != null) {
184
+ } else if (childrenProp != null && childrenProp !== '' && typeof childrenProp !== 'boolean') {
185
185
  children = childrenProp;
186
186
  } else if (hasImg && alt) {
187
187
  children = alt[0];
@@ -36,33 +36,23 @@ const AvatarGroupRoot = styled('div', {
36
36
  [`& .${avatarGroupClasses.avatar}`]: styles.avatar
37
37
  }, styles.root)
38
38
  })(({
39
- theme
40
- }) => ({
41
- [`& .${avatarClasses.root}`]: {
42
- border: `2px solid ${(theme.vars || theme).palette.background.default}`,
43
- boxSizing: 'content-box',
44
- marginLeft: -8,
45
- '&:last-child': {
46
- marginLeft: 0
47
- }
48
- },
49
- display: 'flex',
50
- flexDirection: 'row-reverse'
51
- }));
52
- const AvatarGroupAvatar = styled(Avatar, {
53
- name: 'MuiAvatarGroup',
54
- slot: 'Avatar',
55
- overridesResolver: (props, styles) => styles.avatar
56
- })(({
57
- theme
58
- }) => ({
59
- border: `2px solid ${(theme.vars || theme).palette.background.default}`,
60
- boxSizing: 'content-box',
61
- marginLeft: -8,
62
- '&:last-child': {
63
- marginLeft: 0
64
- }
65
- }));
39
+ theme,
40
+ ownerState
41
+ }) => {
42
+ const marginValue = ownerState.spacing && SPACINGS[ownerState.spacing] !== undefined ? SPACINGS[ownerState.spacing] : -ownerState.spacing;
43
+ return {
44
+ [`& .${avatarClasses.root}`]: {
45
+ border: `2px solid ${(theme.vars || theme).palette.background.default}`,
46
+ boxSizing: 'content-box',
47
+ marginLeft: marginValue ?? -8,
48
+ '&:last-child': {
49
+ marginLeft: 0
50
+ }
51
+ },
52
+ display: 'flex',
53
+ flexDirection: 'row-reverse'
54
+ };
55
+ });
66
56
  const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps, ref) {
67
57
  const props = useThemeProps({
68
58
  props: inProps,
@@ -105,7 +95,6 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
105
95
  const maxAvatars = Math.min(children.length, clampedMax - 1);
106
96
  const extraAvatars = Math.max(totalAvatars - clampedMax, totalAvatars - maxAvatars, 0);
107
97
  const extraAvatarsElement = renderSurplus ? renderSurplus(extraAvatars) : `+${extraAvatars}`;
108
- const marginLeft = spacing && SPACINGS[spacing] !== undefined ? SPACINGS[spacing] : -spacing;
109
98
  const additionalAvatarSlotProps = slotProps.additionalAvatar ?? componentsProps.additionalAvatar;
110
99
  return /*#__PURE__*/_jsxs(AvatarGroupRoot, _extends({
111
100
  as: component,
@@ -113,23 +102,14 @@ const AvatarGroup = /*#__PURE__*/React.forwardRef(function AvatarGroup(inProps,
113
102
  className: clsx(classes.root, className),
114
103
  ref: ref
115
104
  }, other, {
116
- children: [extraAvatars ? /*#__PURE__*/_jsx(AvatarGroupAvatar, _extends({
117
- ownerState: ownerState,
105
+ children: [extraAvatars ? /*#__PURE__*/_jsx(Avatar, _extends({
118
106
  variant: variant
119
107
  }, additionalAvatarSlotProps, {
120
108
  className: clsx(classes.avatar, additionalAvatarSlotProps?.className),
121
- style: _extends({
122
- marginLeft
123
- }, additionalAvatarSlotProps?.style),
124
109
  children: extraAvatarsElement
125
- })) : null, children.slice(0, maxAvatars).reverse().map((child, index) => {
110
+ })) : null, children.slice(0, maxAvatars).reverse().map(child => {
126
111
  return /*#__PURE__*/React.cloneElement(child, {
127
112
  className: clsx(child.props.className, classes.avatar),
128
- style: _extends({
129
- // Consistent with "&:last-child" styling for the default spacing,
130
- // we do not apply custom marginLeft spacing on the last child
131
- marginLeft: index === maxAvatars - 1 ? undefined : marginLeft
132
- }, child.props.style),
133
113
  variant: child.props.variant || variant
134
114
  });
135
115
  })]
@@ -10,14 +10,14 @@ import { usePreviousProps } from '@mui/utils';
10
10
  import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
11
11
  import { useBadge } from '@mui/base/useBadge';
12
12
  import { useSlotProps } from '@mui/base';
13
- import { styled } from '../zero-styled';
14
- import useThemeProps from '../styles/useThemeProps';
13
+ import { styled, createUseThemeProps } from '../zero-styled';
15
14
  import capitalize from '../utils/capitalize';
16
15
  import badgeClasses, { getBadgeUtilityClass } from './badgeClasses';
17
16
  import { jsx as _jsx } from "react/jsx-runtime";
18
17
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
18
  const RADIUS_STANDARD = 10;
20
19
  const RADIUS_DOT = 4;
20
+ const useThemeProps = createUseThemeProps('MuiBadge');
21
21
  const useUtilityClasses = ownerState => {
22
22
  const {
23
23
  color,
@@ -8,6 +8,7 @@ import PropTypes from 'prop-types';
8
8
  import { TransitionGroup } from 'react-transition-group';
9
9
  import clsx from 'clsx';
10
10
  import { keyframes } from '@mui/system';
11
+ import { unstable_useTimeout as useTimeout } from '@mui/utils';
11
12
  import styled from '../styles/styled';
12
13
  import useThemeProps from '../styles/useThemeProps';
13
14
  import Ripple from './Ripple';
@@ -151,18 +152,11 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
151
152
  const ignoringMouseDown = React.useRef(false);
152
153
  // We use a timer in order to only show the ripples for touch "click" like events.
153
154
  // We don't want to display the ripple for touch scroll events.
154
- const startTimer = React.useRef(0);
155
+ const startTimer = useTimeout();
155
156
 
156
157
  // This is the hook called once the previous timeout is ready.
157
158
  const startTimerCommit = React.useRef(null);
158
159
  const container = React.useRef(null);
159
- React.useEffect(() => {
160
- return () => {
161
- if (startTimer.current) {
162
- clearTimeout(startTimer.current);
163
- }
164
- };
165
- }, []);
166
160
  const startCommit = React.useCallback(params => {
167
161
  const {
168
162
  pulsate,
@@ -255,12 +249,13 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
255
249
  });
256
250
  };
257
251
  // Delay the execution of the ripple effect.
258
- startTimer.current = setTimeout(() => {
252
+ // We have to make a tradeoff with this delay value.
253
+ startTimer.start(DELAY_RIPPLE, () => {
259
254
  if (startTimerCommit.current) {
260
255
  startTimerCommit.current();
261
256
  startTimerCommit.current = null;
262
257
  }
263
- }, DELAY_RIPPLE); // We have to make a tradeoff with this value.
258
+ });
264
259
  }
265
260
  } else {
266
261
  startCommit({
@@ -271,21 +266,21 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
271
266
  cb
272
267
  });
273
268
  }
274
- }, [centerProp, startCommit]);
269
+ }, [centerProp, startCommit, startTimer]);
275
270
  const pulsate = React.useCallback(() => {
276
271
  start({}, {
277
272
  pulsate: true
278
273
  });
279
274
  }, [start]);
280
275
  const stop = React.useCallback((event, cb) => {
281
- clearTimeout(startTimer.current);
276
+ startTimer.clear();
282
277
 
283
278
  // The touch interaction occurs too quickly.
284
279
  // We still want to show ripple effect.
285
280
  if (event?.type === 'touchend' && startTimerCommit.current) {
286
281
  startTimerCommit.current();
287
282
  startTimerCommit.current = null;
288
- startTimer.current = setTimeout(() => {
283
+ startTimer.start(0, () => {
289
284
  stop(event, cb);
290
285
  });
291
286
  return;
@@ -298,7 +293,7 @@ const TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps,
298
293
  return oldRipples;
299
294
  });
300
295
  rippleCallback.current = cb;
301
- }, []);
296
+ }, [startTimer]);
302
297
  React.useImperativeHandle(ref, () => ({
303
298
  pulsate,
304
299
  start,
@@ -7,7 +7,7 @@ import * as React from 'react';
7
7
  import clsx from 'clsx';
8
8
  import PropTypes from 'prop-types';
9
9
  import { Transition } from 'react-transition-group';
10
- import { elementTypeAcceptingRef } from '@mui/utils';
10
+ import { elementTypeAcceptingRef, unstable_useTimeout as useTimeout } from '@mui/utils';
11
11
  import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
12
12
  import styled from '../styles/styled';
13
13
  import useThemeProps from '../styles/useThemeProps';
@@ -123,17 +123,12 @@ const Collapse = /*#__PURE__*/React.forwardRef(function Collapse(inProps, ref) {
123
123
  });
124
124
  const classes = useUtilityClasses(ownerState);
125
125
  const theme = useTheme();
126
- const timer = React.useRef();
126
+ const timer = useTimeout();
127
127
  const wrapperRef = React.useRef(null);
128
128
  const autoTransitionDuration = React.useRef();
129
129
  const collapsedSize = typeof collapsedSizeProp === 'number' ? `${collapsedSizeProp}px` : collapsedSizeProp;
130
130
  const isHorizontal = orientation === 'horizontal';
131
131
  const size = isHorizontal ? 'width' : 'height';
132
- React.useEffect(() => {
133
- return () => {
134
- clearTimeout(timer.current);
135
- };
136
- }, []);
137
132
  const nodeRef = React.useRef(null);
138
133
  const handleRef = useForkRef(ref, nodeRef);
139
134
  const normalizedTransitionCallback = callback => maybeIsAppearing => {
@@ -230,7 +225,7 @@ const Collapse = /*#__PURE__*/React.forwardRef(function Collapse(inProps, ref) {
230
225
  });
231
226
  const handleAddEndListener = next => {
232
227
  if (timeout === 'auto') {
233
- timer.current = setTimeout(next, autoTransitionDuration.current || 0);
228
+ timer.start(autoTransitionDuration.current || 0, next);
234
229
  }
235
230
  if (addEndListener) {
236
231
  // Old call signature before `react-transition-group` implemented `nodeRef`
@@ -5,7 +5,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
5
5
  const _excluded = ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
- import { elementAcceptingRef } from '@mui/utils';
8
+ import { elementAcceptingRef, unstable_useTimeout as useTimeout } from '@mui/utils';
9
9
  import { Transition } from 'react-transition-group';
10
10
  import useTheme from '../styles/useTheme';
11
11
  import { getTransitionProps, reflow } from '../transitions/utils';
@@ -55,7 +55,7 @@ const Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {
55
55
  TransitionComponent = Transition
56
56
  } = props,
57
57
  other = _objectWithoutPropertiesLoose(props, _excluded);
58
- const timer = React.useRef();
58
+ const timer = useTimeout();
59
59
  const autoTimeout = React.useRef();
60
60
  const theme = useTheme();
61
61
  const nodeRef = React.useRef(null);
@@ -144,18 +144,13 @@ const Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {
144
144
  const handleExited = normalizedTransitionCallback(onExited);
145
145
  const handleAddEndListener = next => {
146
146
  if (timeout === 'auto') {
147
- timer.current = setTimeout(next, autoTimeout.current || 0);
147
+ timer.start(autoTimeout.current || 0, next);
148
148
  }
149
149
  if (addEndListener) {
150
150
  // Old call signature before `react-transition-group` implemented `nodeRef`
151
151
  addEndListener(nodeRef.current, next);
152
152
  }
153
153
  };
154
- React.useEffect(() => {
155
- return () => {
156
- clearTimeout(timer.current);
157
- };
158
- }, []);
159
154
  return /*#__PURE__*/_jsx(TransitionComponent, _extends({
160
155
  appear: appear,
161
156
  in: inProp,
@@ -1,5 +1,3 @@
1
- 'use client';
2
-
3
1
  export { default } from './Rating';
4
2
  export { default as ratingClasses } from './ratingClasses';
5
3
  export * from './ratingClasses';
@@ -122,7 +122,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
122
122
  }, inputProps, {
123
123
  classes: inputProps ? deepmerge(restOfClasses, inputProps.classes) : restOfClasses
124
124
  }, input ? input.props.inputProps : {})
125
- }, multiple && native && variant === 'outlined' ? {
125
+ }, (multiple && native || displayEmpty) && variant === 'outlined' ? {
126
126
  notched: true
127
127
  } : {}, {
128
128
  ref: inputComponentRef,
@@ -10,7 +10,7 @@ import { isFragment } from 'react-is';
10
10
  import PropTypes from 'prop-types';
11
11
  import clsx from 'clsx';
12
12
  import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
13
- import { clamp } from '@mui/utils';
13
+ import { clamp, unstable_useTimeout as useTimeout } from '@mui/utils';
14
14
  import styled from '../styles/styled';
15
15
  import useThemeProps from '../styles/useThemeProps';
16
16
  import useTheme from '../styles/useTheme';
@@ -163,12 +163,7 @@ const SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref)
163
163
  direction
164
164
  });
165
165
  const classes = useUtilityClasses(ownerState);
166
- const eventTimer = React.useRef();
167
- React.useEffect(() => {
168
- return () => {
169
- clearTimeout(eventTimer.current);
170
- };
171
- }, []);
166
+ const eventTimer = useTimeout();
172
167
 
173
168
  /**
174
169
  * an index in actions.current
@@ -252,9 +247,9 @@ const SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref)
252
247
  if (event.type === 'blur' && onBlur) {
253
248
  onBlur(event);
254
249
  }
255
- clearTimeout(eventTimer.current);
250
+ eventTimer.clear();
256
251
  if (event.type === 'blur') {
257
- eventTimer.current = setTimeout(() => {
252
+ eventTimer.start(0, () => {
258
253
  setOpenState(false);
259
254
  if (onClose) {
260
255
  onClose(event, 'blur');
@@ -271,7 +266,7 @@ const SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref)
271
266
  if (FabProps.onClick) {
272
267
  FabProps.onClick(event);
273
268
  }
274
- clearTimeout(eventTimer.current);
269
+ eventTimer.clear();
275
270
  if (open) {
276
271
  setOpenState(false);
277
272
  if (onClose) {
@@ -295,10 +290,10 @@ const SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref)
295
290
  // When moving the focus between two items,
296
291
  // a chain if blur and focus event is triggered.
297
292
  // We only handle the last event.
298
- clearTimeout(eventTimer.current);
293
+ eventTimer.clear();
299
294
  if (!open) {
300
295
  // Wait for a future focus or click event
301
- eventTimer.current = setTimeout(() => {
296
+ eventTimer.start(0, () => {
302
297
  setOpenState(true);
303
298
  if (onOpen) {
304
299
  const eventMap = {
@@ -1,5 +1,3 @@
1
- 'use client';
2
-
3
1
  export { default } from './Toolbar';
4
2
  export { default as toolbarClasses } from './toolbarClasses';
5
3
  export * from './toolbarClasses';