@mui/material 6.4.7 → 6.4.8
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/Accordion.d.ts +17 -2
- package/Accordion/Accordion.js +18 -6
- package/AccordionSummary/AccordionSummary.d.ts +59 -4
- package/AccordionSummary/AccordionSummary.js +67 -16
- package/CHANGELOG.md +47 -4
- package/ListItemText/ListItemText.d.ts +10 -0
- package/ListItemText/ListItemText.js +14 -5
- package/Snackbar/Snackbar.js +7 -1
- package/SpeedDial/SpeedDial.d.ts +10 -0
- package/SpeedDial/SpeedDial.js +40 -11
- package/SpeedDialAction/SpeedDialAction.js +1 -1
- package/TextareaAutosize/TextareaAutosize.js +26 -15
- package/Tooltip/Tooltip.d.ts +1 -13
- package/Tooltip/Tooltip.js +1 -1
- package/index.js +1 -1
- package/modern/Accordion/Accordion.js +18 -6
- package/modern/AccordionSummary/AccordionSummary.js +67 -16
- package/modern/ListItemText/ListItemText.js +14 -5
- package/modern/Snackbar/Snackbar.js +7 -1
- package/modern/SpeedDial/SpeedDial.js +40 -11
- package/modern/SpeedDialAction/SpeedDialAction.js +1 -1
- package/modern/TextareaAutosize/TextareaAutosize.js +26 -15
- package/modern/Tooltip/Tooltip.js +1 -1
- package/modern/index.js +1 -1
- package/modern/styles/ThemeProvider.js +11 -0
- package/modern/useScrollTrigger/useScrollTrigger.js +3 -0
- package/modern/version/index.js +2 -2
- package/node/Accordion/Accordion.js +18 -6
- package/node/AccordionSummary/AccordionSummary.js +67 -16
- package/node/ListItemText/ListItemText.js +14 -5
- package/node/Snackbar/Snackbar.js +7 -1
- package/node/SpeedDial/SpeedDial.js +40 -11
- package/node/SpeedDialAction/SpeedDialAction.js +1 -1
- package/node/TextareaAutosize/TextareaAutosize.js +25 -14
- package/node/Tooltip/Tooltip.js +1 -1
- package/node/index.js +1 -1
- package/node/styles/ThemeProvider.js +11 -0
- package/node/useScrollTrigger/useScrollTrigger.js +3 -0
- package/node/version/index.js +2 -2
- package/package.json +6 -6
- package/styles/ThemeProvider.js +11 -0
- package/useScrollTrigger/useScrollTrigger.d.ts +1 -1
- package/useScrollTrigger/useScrollTrigger.js +3 -0
- package/version/index.js +2 -2
|
@@ -114,6 +114,16 @@ const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps
|
|
|
114
114
|
...slotProps
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
|
+
const [RootSlot, rootSlotProps] = (0, _useSlot.default)('root', {
|
|
118
|
+
className: (0, _clsx.default)(classes.root, className),
|
|
119
|
+
elementType: ListItemTextRoot,
|
|
120
|
+
externalForwardedProps: {
|
|
121
|
+
...externalForwardedProps,
|
|
122
|
+
...other
|
|
123
|
+
},
|
|
124
|
+
ownerState,
|
|
125
|
+
ref
|
|
126
|
+
});
|
|
117
127
|
const [PrimarySlot, primarySlotProps] = (0, _useSlot.default)('primary', {
|
|
118
128
|
className: classes.primary,
|
|
119
129
|
elementType: _Typography.default,
|
|
@@ -142,11 +152,8 @@ const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps
|
|
|
142
152
|
children: secondary
|
|
143
153
|
});
|
|
144
154
|
}
|
|
145
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
146
|
-
|
|
147
|
-
ownerState: ownerState,
|
|
148
|
-
ref: ref,
|
|
149
|
-
...other,
|
|
155
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
|
|
156
|
+
...rootSlotProps,
|
|
150
157
|
children: [primary, secondary]
|
|
151
158
|
});
|
|
152
159
|
});
|
|
@@ -207,6 +214,7 @@ process.env.NODE_ENV !== "production" ? ListItemText.propTypes /* remove-proptyp
|
|
|
207
214
|
*/
|
|
208
215
|
slotProps: _propTypes.default.shape({
|
|
209
216
|
primary: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
217
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
210
218
|
secondary: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
211
219
|
}),
|
|
212
220
|
/**
|
|
@@ -215,6 +223,7 @@ process.env.NODE_ENV !== "production" ? ListItemText.propTypes /* remove-proptyp
|
|
|
215
223
|
*/
|
|
216
224
|
slots: _propTypes.default.shape({
|
|
217
225
|
primary: _propTypes.default.elementType,
|
|
226
|
+
root: _propTypes.default.elementType,
|
|
218
227
|
secondary: _propTypes.default.elementType
|
|
219
228
|
}),
|
|
220
229
|
/**
|
|
@@ -203,7 +203,10 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
203
203
|
},
|
|
204
204
|
ownerState
|
|
205
205
|
});
|
|
206
|
-
const [ClickAwaySlot,
|
|
206
|
+
const [ClickAwaySlot, {
|
|
207
|
+
ownerState: clickAwayOwnerStateProp,
|
|
208
|
+
...clickAwayListenerProps
|
|
209
|
+
}] = (0, _useSlot.default)('clickAwayListener', {
|
|
207
210
|
elementType: _ClickAwayListener.default,
|
|
208
211
|
externalForwardedProps,
|
|
209
212
|
getSlotProps: handlers => ({
|
|
@@ -252,6 +255,9 @@ const Snackbar = /*#__PURE__*/React.forwardRef(function Snackbar(inProps, ref) {
|
|
|
252
255
|
}
|
|
253
256
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ClickAwaySlot, {
|
|
254
257
|
...clickAwayListenerProps,
|
|
258
|
+
...(slots.clickAwayListener && {
|
|
259
|
+
ownerState: clickAwayOwnerStateProp
|
|
260
|
+
}),
|
|
255
261
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
256
262
|
...rootProps,
|
|
257
263
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionSlot, {
|
|
@@ -379,22 +379,49 @@ const SpeedDial = /*#__PURE__*/React.forwardRef(function SpeedDial(inProps, ref)
|
|
|
379
379
|
slots: backwardCompatibleSlots,
|
|
380
380
|
slotProps: backwardCompatibleSlotProps
|
|
381
381
|
};
|
|
382
|
+
const [RootSlot, rootSlotProps] = (0, _useSlot.default)('root', {
|
|
383
|
+
elementType: SpeedDialRoot,
|
|
384
|
+
externalForwardedProps: {
|
|
385
|
+
...externalForwardedProps,
|
|
386
|
+
...other
|
|
387
|
+
},
|
|
388
|
+
ownerState,
|
|
389
|
+
ref,
|
|
390
|
+
className: (0, _clsx.default)(classes.root, className),
|
|
391
|
+
additionalProps: {
|
|
392
|
+
role: 'presentation'
|
|
393
|
+
},
|
|
394
|
+
getSlotProps: handlers => ({
|
|
395
|
+
...handlers,
|
|
396
|
+
onKeyDown: event => {
|
|
397
|
+
handlers.onKeyDown?.(event);
|
|
398
|
+
handleKeyDown(event);
|
|
399
|
+
},
|
|
400
|
+
onBlur: event => {
|
|
401
|
+
handlers.onBlur?.(event);
|
|
402
|
+
handleClose(event);
|
|
403
|
+
},
|
|
404
|
+
onFocus: event => {
|
|
405
|
+
handlers.onFocus?.(event);
|
|
406
|
+
handleOpen(event);
|
|
407
|
+
},
|
|
408
|
+
onMouseEnter: event => {
|
|
409
|
+
handlers.onMouseEnter?.(event);
|
|
410
|
+
handleOpen(event);
|
|
411
|
+
},
|
|
412
|
+
onMouseLeave: event => {
|
|
413
|
+
handlers.onMouseLeave?.(event);
|
|
414
|
+
handleClose(event);
|
|
415
|
+
}
|
|
416
|
+
})
|
|
417
|
+
});
|
|
382
418
|
const [TransitionSlot, transitionProps] = (0, _useSlot.default)('transition', {
|
|
383
419
|
elementType: _Zoom.default,
|
|
384
420
|
externalForwardedProps,
|
|
385
421
|
ownerState
|
|
386
422
|
});
|
|
387
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
388
|
-
|
|
389
|
-
ref: ref,
|
|
390
|
-
role: "presentation",
|
|
391
|
-
onKeyDown: handleKeyDown,
|
|
392
|
-
onBlur: handleClose,
|
|
393
|
-
onFocus: handleOpen,
|
|
394
|
-
onMouseEnter: handleOpen,
|
|
395
|
-
onMouseLeave: handleClose,
|
|
396
|
-
ownerState: ownerState,
|
|
397
|
-
...other,
|
|
423
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(RootSlot, {
|
|
424
|
+
...rootSlotProps,
|
|
398
425
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(TransitionSlot, {
|
|
399
426
|
in: !hidden,
|
|
400
427
|
timeout: transitionDuration,
|
|
@@ -514,6 +541,7 @@ process.env.NODE_ENV !== "production" ? SpeedDial.propTypes /* remove-proptypes
|
|
|
514
541
|
* @default {}
|
|
515
542
|
*/
|
|
516
543
|
slotProps: _propTypes.default.shape({
|
|
544
|
+
root: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
517
545
|
transition: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object])
|
|
518
546
|
}),
|
|
519
547
|
/**
|
|
@@ -521,6 +549,7 @@ process.env.NODE_ENV !== "production" ? SpeedDial.propTypes /* remove-proptypes
|
|
|
521
549
|
* @default {}
|
|
522
550
|
*/
|
|
523
551
|
slots: _propTypes.default.shape({
|
|
552
|
+
root: _propTypes.default.elementType,
|
|
524
553
|
transition: _propTypes.default.elementType
|
|
525
554
|
}),
|
|
526
555
|
/**
|
|
@@ -348,7 +348,7 @@ process.env.NODE_ENV !== "production" ? SpeedDialAction.propTypes /* remove-prop
|
|
|
348
348
|
* @default 'left'
|
|
349
349
|
* @deprecated Use `slotProps.tooltip.placement` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
350
350
|
*/
|
|
351
|
-
tooltipPlacement: _propTypes.default.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
351
|
+
tooltipPlacement: _propTypes.default.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
352
352
|
/**
|
|
353
353
|
* Label to display in the tooltip.
|
|
354
354
|
* @deprecated Use `slotProps.tooltip.title` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
@@ -119,6 +119,15 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
|
|
|
119
119
|
overflowing
|
|
120
120
|
};
|
|
121
121
|
}, [maxRows, minRows, props.placeholder]);
|
|
122
|
+
const didHeightChange = (0, _utils.unstable_useEventCallback)(() => {
|
|
123
|
+
const textarea = textareaRef.current;
|
|
124
|
+
const textareaStyles = calculateTextareaStyles();
|
|
125
|
+
if (!textarea || !textareaStyles || isEmpty(textareaStyles)) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
const outerHeightStyle = textareaStyles.outerHeightStyle;
|
|
129
|
+
return heightRef.current != null && heightRef.current !== outerHeightStyle;
|
|
130
|
+
});
|
|
122
131
|
const syncHeight = React.useCallback(() => {
|
|
123
132
|
const textarea = textareaRef.current;
|
|
124
133
|
const textareaStyles = calculateTextareaStyles();
|
|
@@ -134,37 +143,39 @@ const TextareaAutosize = /*#__PURE__*/React.forwardRef(function TextareaAutosize
|
|
|
134
143
|
}, [calculateTextareaStyles]);
|
|
135
144
|
const frameRef = React.useRef(-1);
|
|
136
145
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
137
|
-
const
|
|
146
|
+
const debouncedHandleResize = (0, _utils.unstable_debounce)(syncHeight);
|
|
138
147
|
const textarea = textareaRef?.current;
|
|
139
148
|
if (!textarea) {
|
|
140
149
|
return undefined;
|
|
141
150
|
}
|
|
142
151
|
const containerWindow = (0, _utils.unstable_ownerWindow)(textarea);
|
|
143
|
-
containerWindow.addEventListener('resize',
|
|
152
|
+
containerWindow.addEventListener('resize', debouncedHandleResize);
|
|
144
153
|
let resizeObserver;
|
|
145
154
|
if (typeof ResizeObserver !== 'undefined') {
|
|
146
155
|
resizeObserver = new ResizeObserver(() => {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
if (didHeightChange()) {
|
|
157
|
+
// avoid "ResizeObserver loop completed with undelivered notifications" error
|
|
158
|
+
// by temporarily unobserving the textarea element while manipulating the height
|
|
159
|
+
// and reobserving one frame later
|
|
160
|
+
resizeObserver.unobserve(textarea);
|
|
161
|
+
cancelAnimationFrame(frameRef.current);
|
|
162
|
+
syncHeight();
|
|
163
|
+
frameRef.current = requestAnimationFrame(() => {
|
|
164
|
+
resizeObserver.observe(textarea);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
156
167
|
});
|
|
157
168
|
resizeObserver.observe(textarea);
|
|
158
169
|
}
|
|
159
170
|
return () => {
|
|
160
|
-
|
|
171
|
+
debouncedHandleResize.clear();
|
|
161
172
|
cancelAnimationFrame(frameRef.current);
|
|
162
|
-
containerWindow.removeEventListener('resize',
|
|
173
|
+
containerWindow.removeEventListener('resize', debouncedHandleResize);
|
|
163
174
|
if (resizeObserver) {
|
|
164
175
|
resizeObserver.disconnect();
|
|
165
176
|
}
|
|
166
177
|
};
|
|
167
|
-
}, [calculateTextareaStyles, syncHeight]);
|
|
178
|
+
}, [calculateTextareaStyles, syncHeight, didHeightChange]);
|
|
168
179
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
169
180
|
syncHeight();
|
|
170
181
|
});
|
package/node/Tooltip/Tooltip.js
CHANGED
|
@@ -849,7 +849,7 @@ process.env.NODE_ENV !== "production" ? Tooltip.propTypes /* remove-proptypes */
|
|
|
849
849
|
* Tooltip placement.
|
|
850
850
|
* @default 'bottom'
|
|
851
851
|
*/
|
|
852
|
-
placement: _propTypes.default.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
852
|
+
placement: _propTypes.default.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
853
853
|
/**
|
|
854
854
|
* The component used for the popper.
|
|
855
855
|
* @deprecated use the `slots.popper` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
package/node/index.js
CHANGED
|
@@ -24,6 +24,17 @@ function ThemeProvider({
|
|
|
24
24
|
}
|
|
25
25
|
const muiTheme = _identifier.default in theme ? theme[_identifier.default] : theme;
|
|
26
26
|
if (!('colorSchemes' in muiTheme)) {
|
|
27
|
+
if (!('vars' in muiTheme)) {
|
|
28
|
+
// For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
|
|
29
|
+
// The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeProviderNoVars.default, {
|
|
31
|
+
theme: {
|
|
32
|
+
...theme,
|
|
33
|
+
vars: null
|
|
34
|
+
},
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
27
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThemeProviderNoVars.default, {
|
|
28
39
|
theme: theme,
|
|
29
40
|
...props
|
|
@@ -35,6 +35,9 @@ function useScrollTrigger(options = {}) {
|
|
|
35
35
|
const store = React.useRef();
|
|
36
36
|
const [trigger, setTrigger] = React.useState(() => getTrigger(store, other));
|
|
37
37
|
React.useEffect(() => {
|
|
38
|
+
if (target === null) {
|
|
39
|
+
return setTrigger(false);
|
|
40
|
+
}
|
|
38
41
|
const handleScroll = () => {
|
|
39
42
|
setTrigger(getTrigger(store, {
|
|
40
43
|
target,
|
package/node/version/index.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
|
|
7
|
-
const version = exports.version = "6.4.
|
|
7
|
+
const version = exports.version = "6.4.8";
|
|
8
8
|
const major = exports.major = Number("6");
|
|
9
9
|
const minor = exports.minor = Number("4");
|
|
10
|
-
const patch = exports.patch = Number("
|
|
10
|
+
const patch = exports.patch = Number("8");
|
|
11
11
|
const prerelease = exports.prerelease = undefined;
|
|
12
12
|
var _default = exports.default = version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"prop-types": "^15.8.1",
|
|
36
36
|
"react-is": "^19.0.0",
|
|
37
37
|
"react-transition-group": "^4.4.5",
|
|
38
|
-
"@mui/utils": "^6.4.
|
|
39
|
-
"@mui/
|
|
40
|
-
"@mui/
|
|
41
|
-
"@mui/core-downloads-tracker": "^6.4.
|
|
38
|
+
"@mui/utils": "^6.4.8",
|
|
39
|
+
"@mui/types": "~7.2.24",
|
|
40
|
+
"@mui/system": "^6.4.8",
|
|
41
|
+
"@mui/core-downloads-tracker": "^6.4.8"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@emotion/react": "^11.5.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
47
47
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
48
48
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
49
|
-
"@mui/material-pigment-css": "^6.4.
|
|
49
|
+
"@mui/material-pigment-css": "^6.4.8"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@types/react": {
|
package/styles/ThemeProvider.js
CHANGED
|
@@ -17,6 +17,17 @@ export default function ThemeProvider({
|
|
|
17
17
|
}
|
|
18
18
|
const muiTheme = THEME_ID in theme ? theme[THEME_ID] : theme;
|
|
19
19
|
if (!('colorSchemes' in muiTheme)) {
|
|
20
|
+
if (!('vars' in muiTheme)) {
|
|
21
|
+
// For non-CSS variables themes, set `vars` to null to prevent theme inheritance from the upper theme.
|
|
22
|
+
// The example use case is the docs demo that uses ThemeProvider to customize the theme while the upper theme is using CSS variables.
|
|
23
|
+
return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
|
|
24
|
+
theme: {
|
|
25
|
+
...theme,
|
|
26
|
+
vars: null
|
|
27
|
+
},
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
20
31
|
return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
|
|
21
32
|
theme: theme,
|
|
22
33
|
...props
|
|
@@ -29,6 +29,9 @@ export default function useScrollTrigger(options = {}) {
|
|
|
29
29
|
const store = React.useRef();
|
|
30
30
|
const [trigger, setTrigger] = React.useState(() => getTrigger(store, other));
|
|
31
31
|
React.useEffect(() => {
|
|
32
|
+
if (target === null) {
|
|
33
|
+
return setTrigger(false);
|
|
34
|
+
}
|
|
32
35
|
const handleScroll = () => {
|
|
33
36
|
setTrigger(getTrigger(store, {
|
|
34
37
|
target,
|
package/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "6.4.
|
|
1
|
+
export const version = "6.4.8";
|
|
2
2
|
export const major = Number("6");
|
|
3
3
|
export const minor = Number("4");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("8");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|