@mui/material 5.15.5 → 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.
- package/Accordion/index.js +0 -2
- package/AccordionActions/index.js +0 -2
- package/AccordionDetails/index.js +0 -2
- package/AccordionSummary/index.js +0 -2
- package/Avatar/Avatar.js +33 -16
- package/AvatarGroup/AvatarGroup.js +19 -39
- package/Badge/Badge.js +2 -2
- package/ButtonBase/TouchRipple.js +9 -14
- package/CHANGELOG.md +401 -249
- package/Collapse/Collapse.js +3 -8
- package/Grow/Grow.js +3 -8
- package/PaginationItem/PaginationItem.js +1 -1
- package/PaginationItem/paginationItemClasses.d.ts +20 -4
- package/PaginationItem/paginationItemClasses.js +1 -1
- package/README.md +5 -5
- package/Rating/Rating.js +1 -0
- package/Rating/index.js +0 -2
- package/Select/Select.js +1 -1
- package/SpeedDial/SpeedDial.js +7 -12
- package/TablePagination/TablePagination.d.ts +1 -1
- package/Toolbar/index.js +0 -2
- package/Tooltip/Tooltip.js +29 -40
- package/index.js +1 -3
- package/legacy/Accordion/index.js +0 -2
- package/legacy/AccordionActions/index.js +0 -2
- package/legacy/AccordionDetails/index.js +0 -2
- package/legacy/AccordionSummary/index.js +0 -2
- package/legacy/Avatar/Avatar.js +33 -16
- package/legacy/AvatarGroup/AvatarGroup.js +6 -31
- package/legacy/Badge/Badge.js +2 -2
- package/legacy/ButtonBase/TouchRipple.js +9 -14
- package/legacy/Collapse/Collapse.js +3 -8
- package/legacy/Grow/Grow.js +3 -8
- package/legacy/PaginationItem/PaginationItem.js +1 -1
- package/legacy/PaginationItem/paginationItemClasses.js +1 -1
- package/legacy/Rating/Rating.js +1 -0
- package/legacy/Rating/index.js +0 -2
- package/legacy/Select/Select.js +1 -1
- package/legacy/SpeedDial/SpeedDial.js +7 -12
- package/legacy/Toolbar/index.js +0 -2
- package/legacy/Tooltip/Tooltip.js +29 -38
- package/legacy/index.js +1 -3
- package/legacy/zero-styled/index.js +7 -2
- package/modern/Accordion/index.js +0 -2
- package/modern/AccordionActions/index.js +0 -2
- package/modern/AccordionDetails/index.js +0 -2
- package/modern/AccordionSummary/index.js +0 -2
- package/modern/Avatar/Avatar.js +33 -16
- package/modern/AvatarGroup/AvatarGroup.js +19 -39
- package/modern/Badge/Badge.js +2 -2
- package/modern/ButtonBase/TouchRipple.js +9 -14
- package/modern/Collapse/Collapse.js +3 -8
- package/modern/Grow/Grow.js +3 -8
- package/modern/PaginationItem/PaginationItem.js +1 -1
- package/modern/PaginationItem/paginationItemClasses.js +1 -1
- package/modern/Rating/Rating.js +1 -0
- package/modern/Rating/index.js +0 -2
- package/modern/Select/Select.js +1 -1
- package/modern/SpeedDial/SpeedDial.js +7 -12
- package/modern/Toolbar/index.js +0 -2
- package/modern/Tooltip/Tooltip.js +29 -40
- package/modern/index.js +1 -3
- package/modern/zero-styled/index.js +7 -2
- package/node/Accordion/index.js +0 -1
- package/node/AccordionActions/index.js +0 -1
- package/node/AccordionDetails/index.js +0 -1
- package/node/AccordionSummary/index.js +0 -1
- package/node/Avatar/Avatar.js +33 -16
- package/node/AvatarGroup/AvatarGroup.js +19 -39
- package/node/Badge/Badge.js +2 -2
- package/node/ButtonBase/TouchRipple.js +9 -14
- package/node/Collapse/Collapse.js +2 -7
- package/node/Grow/Grow.js +2 -7
- package/node/PaginationItem/PaginationItem.js +1 -1
- package/node/PaginationItem/paginationItemClasses.js +1 -1
- package/node/Rating/Rating.js +1 -0
- package/node/Rating/index.js +0 -1
- package/node/Select/Select.js +1 -1
- package/node/SpeedDial/SpeedDial.js +6 -11
- package/node/Toolbar/index.js +0 -1
- package/node/Tooltip/Tooltip.js +28 -39
- package/node/index.js +1 -3
- package/node/zero-styled/index.js +7 -1
- package/package.json +7 -7
- package/styles/experimental_extendTheme.d.ts +3 -2
- package/umd/material-ui.development.js +400 -292
- package/umd/material-ui.production.min.js +4 -4
- package/zero-styled/index.d.ts +2 -1
- package/zero-styled/index.js +7 -2
|
@@ -10,6 +10,7 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import { TransitionGroup } from 'react-transition-group';
|
|
11
11
|
import clsx from 'clsx';
|
|
12
12
|
import { keyframes } from '@mui/system';
|
|
13
|
+
import { unstable_useTimeout as useTimeout } from '@mui/utils';
|
|
13
14
|
import styled from '../styles/styled';
|
|
14
15
|
import useThemeProps from '../styles/useThemeProps';
|
|
15
16
|
import Ripple from './Ripple';
|
|
@@ -86,18 +87,11 @@ var TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, re
|
|
|
86
87
|
var ignoringMouseDown = React.useRef(false);
|
|
87
88
|
// We use a timer in order to only show the ripples for touch "click" like events.
|
|
88
89
|
// We don't want to display the ripple for touch scroll events.
|
|
89
|
-
var startTimer =
|
|
90
|
+
var startTimer = useTimeout();
|
|
90
91
|
|
|
91
92
|
// This is the hook called once the previous timeout is ready.
|
|
92
93
|
var startTimerCommit = React.useRef(null);
|
|
93
94
|
var container = React.useRef(null);
|
|
94
|
-
React.useEffect(function () {
|
|
95
|
-
return function () {
|
|
96
|
-
if (startTimer.current) {
|
|
97
|
-
clearTimeout(startTimer.current);
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
}, []);
|
|
101
95
|
var startCommit = React.useCallback(function (params) {
|
|
102
96
|
var pulsate = params.pulsate,
|
|
103
97
|
rippleX = params.rippleX,
|
|
@@ -193,12 +187,13 @@ var TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, re
|
|
|
193
187
|
});
|
|
194
188
|
};
|
|
195
189
|
// Delay the execution of the ripple effect.
|
|
196
|
-
|
|
190
|
+
// We have to make a tradeoff with this delay value.
|
|
191
|
+
startTimer.start(DELAY_RIPPLE, function () {
|
|
197
192
|
if (startTimerCommit.current) {
|
|
198
193
|
startTimerCommit.current();
|
|
199
194
|
startTimerCommit.current = null;
|
|
200
195
|
}
|
|
201
|
-
}
|
|
196
|
+
});
|
|
202
197
|
}
|
|
203
198
|
} else {
|
|
204
199
|
startCommit({
|
|
@@ -209,21 +204,21 @@ var TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, re
|
|
|
209
204
|
cb: cb
|
|
210
205
|
});
|
|
211
206
|
}
|
|
212
|
-
}, [centerProp, startCommit]);
|
|
207
|
+
}, [centerProp, startCommit, startTimer]);
|
|
213
208
|
var pulsate = React.useCallback(function () {
|
|
214
209
|
start({}, {
|
|
215
210
|
pulsate: true
|
|
216
211
|
});
|
|
217
212
|
}, [start]);
|
|
218
213
|
var stop = React.useCallback(function (event, cb) {
|
|
219
|
-
|
|
214
|
+
startTimer.clear();
|
|
220
215
|
|
|
221
216
|
// The touch interaction occurs too quickly.
|
|
222
217
|
// We still want to show ripple effect.
|
|
223
218
|
if ((event == null ? void 0 : event.type) === 'touchend' && startTimerCommit.current) {
|
|
224
219
|
startTimerCommit.current();
|
|
225
220
|
startTimerCommit.current = null;
|
|
226
|
-
startTimer.
|
|
221
|
+
startTimer.start(0, function () {
|
|
227
222
|
stop(event, cb);
|
|
228
223
|
});
|
|
229
224
|
return;
|
|
@@ -236,7 +231,7 @@ var TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, re
|
|
|
236
231
|
return oldRipples;
|
|
237
232
|
});
|
|
238
233
|
rippleCallback.current = cb;
|
|
239
|
-
}, []);
|
|
234
|
+
}, [startTimer]);
|
|
240
235
|
React.useImperativeHandle(ref, function () {
|
|
241
236
|
return {
|
|
242
237
|
pulsate: pulsate,
|
|
@@ -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';
|
|
@@ -127,17 +127,12 @@ var Collapse = /*#__PURE__*/React.forwardRef(function Collapse(inProps, ref) {
|
|
|
127
127
|
});
|
|
128
128
|
var classes = useUtilityClasses(ownerState);
|
|
129
129
|
var theme = useTheme();
|
|
130
|
-
var timer =
|
|
130
|
+
var timer = useTimeout();
|
|
131
131
|
var wrapperRef = React.useRef(null);
|
|
132
132
|
var autoTransitionDuration = React.useRef();
|
|
133
133
|
var collapsedSize = typeof collapsedSizeProp === 'number' ? "".concat(collapsedSizeProp, "px") : collapsedSizeProp;
|
|
134
134
|
var isHorizontal = orientation === 'horizontal';
|
|
135
135
|
var size = isHorizontal ? 'width' : 'height';
|
|
136
|
-
React.useEffect(function () {
|
|
137
|
-
return function () {
|
|
138
|
-
clearTimeout(timer.current);
|
|
139
|
-
};
|
|
140
|
-
}, []);
|
|
141
136
|
var nodeRef = React.useRef(null);
|
|
142
137
|
var handleRef = useForkRef(ref, nodeRef);
|
|
143
138
|
var normalizedTransitionCallback = function normalizedTransitionCallback(callback) {
|
|
@@ -236,7 +231,7 @@ var Collapse = /*#__PURE__*/React.forwardRef(function Collapse(inProps, ref) {
|
|
|
236
231
|
});
|
|
237
232
|
var handleAddEndListener = function handleAddEndListener(next) {
|
|
238
233
|
if (timeout === 'auto') {
|
|
239
|
-
timer.
|
|
234
|
+
timer.start(autoTransitionDuration.current || 0, next);
|
|
240
235
|
}
|
|
241
236
|
if (addEndListener) {
|
|
242
237
|
// Old call signature before `react-transition-group` implemented `nodeRef`
|
package/legacy/Grow/Grow.js
CHANGED
|
@@ -4,7 +4,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import { elementAcceptingRef } from '@mui/utils';
|
|
7
|
+
import { elementAcceptingRef, unstable_useTimeout as useTimeout } from '@mui/utils';
|
|
8
8
|
import { Transition } from 'react-transition-group';
|
|
9
9
|
import useTheme from '../styles/useTheme';
|
|
10
10
|
import { getTransitionProps, reflow } from '../transitions/utils';
|
|
@@ -54,7 +54,7 @@ var Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {
|
|
|
54
54
|
_props$TransitionComp = props.TransitionComponent,
|
|
55
55
|
TransitionComponent = _props$TransitionComp === void 0 ? Transition : _props$TransitionComp,
|
|
56
56
|
other = _objectWithoutProperties(props, ["addEndListener", "appear", "children", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"]);
|
|
57
|
-
var timer =
|
|
57
|
+
var timer = useTimeout();
|
|
58
58
|
var autoTimeout = React.useRef();
|
|
59
59
|
var theme = useTheme();
|
|
60
60
|
var nodeRef = React.useRef(null);
|
|
@@ -142,18 +142,13 @@ var Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {
|
|
|
142
142
|
var handleExited = normalizedTransitionCallback(onExited);
|
|
143
143
|
var handleAddEndListener = function handleAddEndListener(next) {
|
|
144
144
|
if (timeout === 'auto') {
|
|
145
|
-
timer.
|
|
145
|
+
timer.start(autoTimeout.current || 0, next);
|
|
146
146
|
}
|
|
147
147
|
if (addEndListener) {
|
|
148
148
|
// Old call signature before `react-transition-group` implemented `nodeRef`
|
|
149
149
|
addEndListener(nodeRef.current, next);
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
|
-
React.useEffect(function () {
|
|
153
|
-
return function () {
|
|
154
|
-
clearTimeout(timer.current);
|
|
155
|
-
};
|
|
156
|
-
}, []);
|
|
157
152
|
return /*#__PURE__*/_jsx(TransitionComponent, _extends({
|
|
158
153
|
appear: appear,
|
|
159
154
|
in: inProp,
|
|
@@ -34,7 +34,7 @@ var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
|
34
34
|
type = ownerState.type,
|
|
35
35
|
variant = ownerState.variant;
|
|
36
36
|
var slots = {
|
|
37
|
-
root: ['root', "size".concat(capitalize(size)), variant, shape, color !== 'standard' && "".concat(variant).concat(capitalize(color)), disabled && 'disabled', selected && 'selected', {
|
|
37
|
+
root: ['root', "size".concat(capitalize(size)), variant, shape, color !== 'standard' && "color".concat(capitalize(color)), color !== 'standard' && "".concat(variant).concat(capitalize(color)), disabled && 'disabled', selected && 'selected', {
|
|
38
38
|
page: 'page',
|
|
39
39
|
first: 'firstLast',
|
|
40
40
|
last: 'firstLast',
|
|
@@ -3,5 +3,5 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
|
3
3
|
export function getPaginationItemUtilityClass(slot) {
|
|
4
4
|
return generateUtilityClass('MuiPaginationItem', slot);
|
|
5
5
|
}
|
|
6
|
-
var paginationItemClasses = generateUtilityClasses('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon']);
|
|
6
|
+
var paginationItemClasses = generateUtilityClasses('MuiPaginationItem', ['root', 'page', 'sizeSmall', 'sizeLarge', 'text', 'textPrimary', 'textSecondary', 'outlined', 'outlinedPrimary', 'outlinedSecondary', 'rounded', 'ellipsis', 'firstLast', 'previousNext', 'focusVisible', 'disabled', 'selected', 'icon', 'colorPrimary', 'colorSecondary']);
|
|
7
7
|
export default paginationItemClasses;
|
package/legacy/Rating/Rating.js
CHANGED
|
@@ -69,6 +69,7 @@ var RatingRoot = styled('span', {
|
|
|
69
69
|
color: '#faaf00',
|
|
70
70
|
cursor: 'pointer',
|
|
71
71
|
textAlign: 'left',
|
|
72
|
+
width: 'min-content',
|
|
72
73
|
WebkitTapHighlightColor: 'transparent'
|
|
73
74
|
}, "&.".concat(ratingClasses.disabled), {
|
|
74
75
|
opacity: (theme.vars || theme).palette.action.disabledOpacity,
|
package/legacy/Rating/index.js
CHANGED
package/legacy/Select/Select.js
CHANGED
|
@@ -129,7 +129,7 @@ var Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
129
129
|
}, inputProps, {
|
|
130
130
|
classes: inputProps ? deepmerge(restOfClasses, inputProps.classes) : restOfClasses
|
|
131
131
|
}, input ? input.props.inputProps : {})
|
|
132
|
-
}, multiple && native && variant === 'outlined' ? {
|
|
132
|
+
}, (multiple && native || displayEmpty) && variant === 'outlined' ? {
|
|
133
133
|
notched: true
|
|
134
134
|
} : {}, {
|
|
135
135
|
ref: inputComponentRef,
|
|
@@ -9,7 +9,7 @@ import { isFragment } from 'react-is';
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import clsx from 'clsx';
|
|
11
11
|
import { unstable_composeClasses as composeClasses } from '@mui/base/composeClasses';
|
|
12
|
-
import { clamp } from '@mui/utils';
|
|
12
|
+
import { clamp, unstable_useTimeout as useTimeout } from '@mui/utils';
|
|
13
13
|
import styled from '../styles/styled';
|
|
14
14
|
import useThemeProps from '../styles/useThemeProps';
|
|
15
15
|
import useTheme from '../styles/useTheme';
|
|
@@ -164,12 +164,7 @@ var SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref) {
|
|
|
164
164
|
direction: direction
|
|
165
165
|
});
|
|
166
166
|
var classes = useUtilityClasses(ownerState);
|
|
167
|
-
var eventTimer =
|
|
168
|
-
React.useEffect(function () {
|
|
169
|
-
return function () {
|
|
170
|
-
clearTimeout(eventTimer.current);
|
|
171
|
-
};
|
|
172
|
-
}, []);
|
|
167
|
+
var eventTimer = useTimeout();
|
|
173
168
|
|
|
174
169
|
/**
|
|
175
170
|
* an index in actions.current
|
|
@@ -252,9 +247,9 @@ var SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref) {
|
|
|
252
247
|
if (event.type === 'blur' && onBlur) {
|
|
253
248
|
onBlur(event);
|
|
254
249
|
}
|
|
255
|
-
|
|
250
|
+
eventTimer.clear();
|
|
256
251
|
if (event.type === 'blur') {
|
|
257
|
-
eventTimer.
|
|
252
|
+
eventTimer.start(0, function () {
|
|
258
253
|
setOpenState(false);
|
|
259
254
|
if (onClose) {
|
|
260
255
|
onClose(event, 'blur');
|
|
@@ -271,7 +266,7 @@ var SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref) {
|
|
|
271
266
|
if (FabProps.onClick) {
|
|
272
267
|
FabProps.onClick(event);
|
|
273
268
|
}
|
|
274
|
-
|
|
269
|
+
eventTimer.clear();
|
|
275
270
|
if (open) {
|
|
276
271
|
setOpenState(false);
|
|
277
272
|
if (onClose) {
|
|
@@ -295,10 +290,10 @@ var 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
|
-
|
|
293
|
+
eventTimer.clear();
|
|
299
294
|
if (!open) {
|
|
300
295
|
// Wait for a future focus or click event
|
|
301
|
-
eventTimer.
|
|
296
|
+
eventTimer.start(0, function () {
|
|
302
297
|
setOpenState(true);
|
|
303
298
|
if (onOpen) {
|
|
304
299
|
var eventMap = {
|
package/legacy/Toolbar/index.js
CHANGED
|
@@ -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 =
|
|
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
|
-
|
|
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 =
|
|
274
|
-
var enterTimer =
|
|
275
|
-
var leaveTimer =
|
|
276
|
-
var touchTimer =
|
|
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 =
|
|
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
|
-
|
|
305
|
-
}
|
|
304
|
+
touchTimer.clear();
|
|
305
|
+
});
|
|
306
306
|
React.useEffect(function () {
|
|
307
|
-
return
|
|
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
|
-
|
|
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
|
-
|
|
332
|
-
hystersisTimer = setTimeout(function () {
|
|
326
|
+
hystersisTimer.start(800 + leaveDelay, function () {
|
|
333
327
|
hystersisOpen = false;
|
|
334
|
-
}
|
|
328
|
+
});
|
|
335
329
|
setOpenState(false);
|
|
336
330
|
if (onClose && open) {
|
|
337
331
|
onClose(event);
|
|
338
332
|
}
|
|
339
|
-
|
|
340
|
-
closeTimer.current = setTimeout(function () {
|
|
333
|
+
closeTimer.start(theme.transitions.duration.shortest, function () {
|
|
341
334
|
ignoreNonTouchEvents.current = false;
|
|
342
|
-
}
|
|
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
|
-
|
|
356
|
-
|
|
348
|
+
enterTimer.clear();
|
|
349
|
+
leaveTimer.clear();
|
|
357
350
|
if (enterDelay || hystersisOpen && enterNextDelay) {
|
|
358
|
-
enterTimer.
|
|
351
|
+
enterTimer.start(hystersisOpen ? enterNextDelay : enterDelay, function () {
|
|
359
352
|
handleOpen(event);
|
|
360
|
-
}
|
|
353
|
+
});
|
|
361
354
|
} else {
|
|
362
355
|
handleOpen(event);
|
|
363
356
|
}
|
|
364
357
|
};
|
|
365
358
|
var handleLeave = function handleLeave(event) {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
leaveTimer.current = setTimeout(function () {
|
|
359
|
+
enterTimer.clear();
|
|
360
|
+
leaveTimer.start(leaveDelay, function () {
|
|
369
361
|
handleClose(event);
|
|
370
|
-
}
|
|
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
|
-
|
|
412
|
-
|
|
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.
|
|
409
|
+
touchTimer.start(enterTouchDelay, function () {
|
|
418
410
|
document.body.style.WebkitUserSelect = prevUserSelect.current;
|
|
419
411
|
handleEnter(event);
|
|
420
|
-
}
|
|
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
|
-
|
|
428
|
-
leaveTimer.current = setTimeout(function () {
|
|
419
|
+
leaveTimer.start(leaveTouchDelay, function () {
|
|
429
420
|
handleClose(event);
|
|
430
|
-
}
|
|
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.
|
|
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 };
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
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
|
+
}
|
package/modern/Avatar/Avatar.js
CHANGED
|
@@ -35,9 +35,8 @@ const AvatarRoot = styled('div', {
|
|
|
35
35
|
return [styles.root, styles[ownerState.variant], ownerState.colorDefault && styles.colorDefault];
|
|
36
36
|
}
|
|
37
37
|
})(({
|
|
38
|
-
theme
|
|
39
|
-
|
|
40
|
-
}) => _extends({
|
|
38
|
+
theme
|
|
39
|
+
}) => ({
|
|
41
40
|
position: 'relative',
|
|
42
41
|
display: 'flex',
|
|
43
42
|
alignItems: 'center',
|
|
@@ -50,18 +49,36 @@ const AvatarRoot = styled('div', {
|
|
|
50
49
|
lineHeight: 1,
|
|
51
50
|
borderRadius: '50%',
|
|
52
51
|
overflow: 'hidden',
|
|
53
|
-
userSelect: 'none'
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
52
|
+
userSelect: 'none',
|
|
53
|
+
variants: [{
|
|
54
|
+
props: {
|
|
55
|
+
variant: 'rounded'
|
|
56
|
+
},
|
|
57
|
+
style: {
|
|
58
|
+
borderRadius: (theme.vars || theme).shape.borderRadius
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
props: {
|
|
62
|
+
variant: 'square'
|
|
63
|
+
},
|
|
64
|
+
style: {
|
|
65
|
+
borderRadius: 0
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
props: {
|
|
69
|
+
colorDefault: true
|
|
70
|
+
},
|
|
71
|
+
style: _extends({
|
|
72
|
+
color: (theme.vars || theme).palette.background.default
|
|
73
|
+
}, theme.vars ? {
|
|
74
|
+
backgroundColor: theme.vars.palette.Avatar.defaultBg
|
|
75
|
+
} : _extends({
|
|
76
|
+
backgroundColor: theme.palette.grey[400]
|
|
77
|
+
}, theme.applyStyles('dark', {
|
|
78
|
+
backgroundColor: theme.palette.grey[600]
|
|
79
|
+
})))
|
|
80
|
+
}]
|
|
81
|
+
}));
|
|
65
82
|
const AvatarImg = styled('img', {
|
|
66
83
|
name: 'MuiAvatar',
|
|
67
84
|
slot: 'Img',
|
|
@@ -164,7 +181,7 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(inProps, ref) {
|
|
|
164
181
|
ownerState: ownerState,
|
|
165
182
|
className: classes.img
|
|
166
183
|
}, imgProps));
|
|
167
|
-
} else if (childrenProp != null) {
|
|
184
|
+
} else if (childrenProp != null && childrenProp !== '' && typeof childrenProp !== 'boolean') {
|
|
168
185
|
children = childrenProp;
|
|
169
186
|
} else if (hasImg && alt) {
|
|
170
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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(
|
|
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(
|
|
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
|
})]
|
package/modern/Badge/Badge.js
CHANGED
|
@@ -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,
|