@mui/material 6.1.0 → 6.1.1-dev.20240919-130050-82a6448768
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/Backdrop/Backdrop.js +9 -2
- package/CHANGELOG.md +63 -0
- package/ClickAwayListener/ClickAwayListener.js +1 -1
- package/FormControl/FormControl.js +1 -2
- package/Grid/Grid.d.ts +6 -0
- package/Hidden/withWidth.js +1 -0
- package/Icon/Icon.js +1 -1
- package/InputBase/InputBase.js +2 -0
- package/Modal/Modal.js +1 -1
- package/Modal/ModalManager.js +4 -4
- package/Popover/Popover.js +1 -1
- package/Select/SelectInput.js +2 -0
- package/Skeleton/Skeleton.js +5 -3
- package/Slider/useSlider.js +2 -2
- package/SwipeableDrawer/SwipeableDrawer.js +1 -0
- package/ToggleButtonGroup/isValueSelected.js +1 -1
- package/Tooltip/Tooltip.js +6 -3
- package/Unstable_TrapFocus/FocusTrap.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/modern/Backdrop/Backdrop.js +9 -2
- package/modern/ClickAwayListener/ClickAwayListener.js +1 -1
- package/modern/FormControl/FormControl.js +1 -2
- package/modern/Hidden/withWidth.js +1 -0
- package/modern/Icon/Icon.js +1 -1
- package/modern/InputBase/InputBase.js +2 -0
- package/modern/Modal/Modal.js +1 -1
- package/modern/Modal/ModalManager.js +4 -4
- package/modern/Popover/Popover.js +1 -1
- package/modern/Select/SelectInput.js +2 -0
- package/modern/Skeleton/Skeleton.js +5 -3
- package/modern/Slider/useSlider.js +2 -2
- package/modern/SwipeableDrawer/SwipeableDrawer.js +1 -0
- package/modern/ToggleButtonGroup/isValueSelected.js +1 -1
- package/modern/Tooltip/Tooltip.js +6 -3
- package/modern/Unstable_TrapFocus/FocusTrap.js +1 -1
- package/modern/index.js +1 -1
- package/modern/styles/createColorScheme.js +1 -1
- package/modern/styles/excludeVariablesFromRoot.js +1 -1
- package/modern/styles/useTheme.js +1 -0
- package/modern/useAutocomplete/useAutocomplete.js +2 -2
- package/modern/useScrollTrigger/useScrollTrigger.js +1 -0
- package/modern/version/index.js +3 -3
- package/node/Backdrop/Backdrop.js +9 -2
- package/node/ClickAwayListener/ClickAwayListener.js +1 -1
- package/node/FormControl/FormControl.js +1 -2
- package/node/Hidden/withWidth.js +1 -0
- package/node/Icon/Icon.js +1 -1
- package/node/InputBase/InputBase.js +2 -0
- package/node/Modal/Modal.js +1 -1
- package/node/Modal/ModalManager.js +4 -4
- package/node/Popover/Popover.js +1 -1
- package/node/Select/SelectInput.js +2 -0
- package/node/Skeleton/Skeleton.js +5 -3
- package/node/Slider/useSlider.js +2 -2
- package/node/SwipeableDrawer/SwipeableDrawer.js +1 -0
- package/node/ToggleButtonGroup/isValueSelected.js +1 -1
- package/node/Tooltip/Tooltip.js +6 -3
- package/node/Unstable_TrapFocus/FocusTrap.js +1 -1
- package/node/index.js +1 -1
- package/node/styles/createColorScheme.js +1 -1
- package/node/styles/excludeVariablesFromRoot.js +1 -1
- package/node/styles/useTheme.js +1 -0
- package/node/useAutocomplete/useAutocomplete.js +2 -2
- package/node/useScrollTrigger/useScrollTrigger.js +1 -0
- package/node/version/index.js +3 -3
- package/package.json +7 -7
- package/styles/createColorScheme.d.ts +1 -1
- package/styles/createColorScheme.js +1 -1
- package/styles/excludeVariablesFromRoot.js +1 -1
- package/styles/useTheme.js +1 -0
- package/useAutocomplete/useAutocomplete.js +2 -2
- package/useScrollTrigger/useScrollTrigger.js +1 -0
- package/version/index.js +3 -3
package/Backdrop/Backdrop.js
CHANGED
|
@@ -10,6 +10,13 @@ import useSlot from "../utils/useSlot.js";
|
|
|
10
10
|
import Fade from "../Fade/index.js";
|
|
11
11
|
import { getBackdropUtilityClass } from "./backdropClasses.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const removeOwnerState = props => {
|
|
14
|
+
const {
|
|
15
|
+
ownerState,
|
|
16
|
+
...rest
|
|
17
|
+
} = props;
|
|
18
|
+
return rest;
|
|
19
|
+
};
|
|
13
20
|
const useUtilityClasses = ownerState => {
|
|
14
21
|
const {
|
|
15
22
|
classes,
|
|
@@ -98,12 +105,12 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
|
|
|
98
105
|
externalForwardedProps,
|
|
99
106
|
ownerState
|
|
100
107
|
});
|
|
101
|
-
|
|
108
|
+
const transitionPropsRemoved = removeOwnerState(transitionProps);
|
|
102
109
|
return /*#__PURE__*/_jsx(TransitionSlot, {
|
|
103
110
|
in: open,
|
|
104
111
|
timeout: transitionDuration,
|
|
105
112
|
...other,
|
|
106
|
-
...
|
|
113
|
+
...transitionPropsRemoved,
|
|
107
114
|
children: /*#__PURE__*/_jsx(RootSlot, {
|
|
108
115
|
"aria-hidden": true,
|
|
109
116
|
...rootProps,
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## v6.1.1
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v6.1.0..master -->
|
|
6
|
+
|
|
7
|
+
_Sep 19, 2024_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 18 contributors who made this release possible.
|
|
10
|
+
|
|
11
|
+
### `@mui/material@6.1.1`
|
|
12
|
+
|
|
13
|
+
- [Grid] Bring back `GridProps` and `GridTypeMap` (#43717) @DiegoAndai
|
|
14
|
+
- [Paper] Fix wrong background-image on Paper when elevation is 0 (#43723) @ZeeshanTamboli
|
|
15
|
+
- [Skeleton] Fix wave animation for styled-components (#43740) @siriwatknp
|
|
16
|
+
- [Modal] Fix event handlers overriding behavior (#43757) @sai6855
|
|
17
|
+
|
|
18
|
+
### `@mui/system@6.1.1`
|
|
19
|
+
|
|
20
|
+
- Pass the stylesheet directly to `GlobalStyles` (#43739) @siriwatknp
|
|
21
|
+
|
|
22
|
+
### `@mui/utils@6.1.1`
|
|
23
|
+
|
|
24
|
+
- Fix "useId" & "useSyncExternalStore" imports to not be statically analyzable (#43360) @yash49
|
|
25
|
+
|
|
26
|
+
### Docs
|
|
27
|
+
|
|
28
|
+
- [material-ui][Breadcrumbs] Document CondensedWithMenu option for Breadcrumbs (#42973) @Sergio16T
|
|
29
|
+
- [material-ui][CircularProgress] Add Circular size demo (#43734) @sai6855
|
|
30
|
+
- [material-ui][slider] Fix slider in color customization playground twitches when sliding (#43671) @Nashyn
|
|
31
|
+
- [material-ui][slider] Polish Music player demo (#43748) @oliviertassinari
|
|
32
|
+
- [material-ui] Document Typography color prop breaking change (#43735) @aarongarciah
|
|
33
|
+
- [material-ui] Add docs for complementary Table components (#43756) @Juneezee
|
|
34
|
+
- [material-ui] Improve minimizing bundle docs (#43781) @ZeeshanTamboli
|
|
35
|
+
- [pigment-css] Call out Pigment being in alpha (#43725) @aarongarciah
|
|
36
|
+
- [pigment-css] Fix typo globalCSS -> globalCss (#43754) @hiro0218
|
|
37
|
+
- [test] Improve demos for better regression screenshots (#43742) @aarongarciah
|
|
38
|
+
- Fix minor typo (#42899) @xconverge
|
|
39
|
+
- Revert icon search virtualization (#43569) @Janpot
|
|
40
|
+
- Fix MUI Treasury Layout broken links (#43752) @oliviertassinari
|
|
41
|
+
- Fix 301 link to design asset @oliviertassinari
|
|
42
|
+
- Update release schedule table after v6 stable (#43726) @sahil-ag
|
|
43
|
+
- Fix bundle size link regression @oliviertassinari
|
|
44
|
+
|
|
45
|
+
### Core
|
|
46
|
+
|
|
47
|
+
- [code-infra] Allow overriding all `options` of `useFakeTimers` function (#43729) @LukasTy
|
|
48
|
+
- [core] Fix 301 link to Next.js and git diff @oliviertassinari
|
|
49
|
+
- [core] Fix package.json repository rule @oliviertassinari
|
|
50
|
+
- [core] Remove redundant window @oliviertassinari
|
|
51
|
+
- [core] Fix some issues reported by eslint-plugin-react-compiler (#43117) @binsmyth
|
|
52
|
+
- [core] Replace more `indexOf` with `includes` (#43694) @Juneezee
|
|
53
|
+
- [core] Remove /.yarn (#43712) @oliviertassinari
|
|
54
|
+
- [docs-infra] Enable synthetic default imports in TypeScript config (#43747) @morozow
|
|
55
|
+
- [docs-infra] Fix Vale config for TypeScript references (#43751) @oliviertassinari
|
|
56
|
+
- [docs-infra] Fix toolbar arrow order (#43627) @oliviertassinari
|
|
57
|
+
- [docs-infra] Fix missing dependencies in multi-tab demos (#43713) @cherniavskii
|
|
58
|
+
- [docs-infra] Fix API search link regression (#43662) @oliviertassinari
|
|
59
|
+
- [test] Update font-awesome CSS file in regression tests fixture (#43745) @Janpot
|
|
60
|
+
- [test] Remove position:relative from regression container (#43743) @aarongarciah
|
|
61
|
+
- [test] Remove top-level inline-block from the regression tests (#43656) @Janpot
|
|
62
|
+
- [website] Match pricing page with linked page h1 @oliviertassinari
|
|
63
|
+
|
|
64
|
+
All contributors of this release in alphabetical order: @aarongarciah, @binsmyth, @cherniavskii, @DiegoAndai, @Janpot, @Juneezee, @LukasTy, @mnajdova, @morozow, @Nashyn, @oliviertassinari, @sahil-ag, @sai6855, @Sergio16T, @siriwatknp, @xconverge, @yash49, @ZeeshanTamboli
|
|
65
|
+
|
|
3
66
|
## v6.1.0
|
|
4
67
|
|
|
5
68
|
<!-- generated comparing v6.0.2..master -->
|
|
@@ -79,7 +79,7 @@ function ClickAwayListener(props) {
|
|
|
79
79
|
|
|
80
80
|
// If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js
|
|
81
81
|
if (event.composedPath) {
|
|
82
|
-
insideDOM = event.composedPath().
|
|
82
|
+
insideDOM = event.composedPath().includes(nodeRef.current);
|
|
83
83
|
} else {
|
|
84
84
|
insideDOM = !doc.documentElement.contains(
|
|
85
85
|
// @ts-expect-error returns `false` as intended when not dispatched from a Node
|
|
@@ -170,9 +170,8 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
170
170
|
}
|
|
171
171
|
const focused = visuallyFocused !== undefined && !disabled ? visuallyFocused : focusedState;
|
|
172
172
|
let registerEffect;
|
|
173
|
+
const registeredInput = React.useRef(false);
|
|
173
174
|
if (process.env.NODE_ENV !== 'production') {
|
|
174
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
175
|
-
const registeredInput = React.useRef(false);
|
|
176
175
|
registerEffect = () => {
|
|
177
176
|
if (registeredInput.current) {
|
|
178
177
|
console.error(['MUI: There are multiple `InputBase` components inside a FormControl.', 'This creates visual inconsistencies, only use one `InputBase`.'].join('\n'));
|
package/Grid/Grid.d.ts
CHANGED
|
@@ -149,6 +149,9 @@ export interface GridOwnProps extends SystemProps<Theme>, Breakpoints {
|
|
|
149
149
|
zeroMinWidth?: boolean;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
/**
|
|
153
|
+
* @deprecated Use the [`Grid2`](https://mui.com/material-ui/react-grid2/) component instead.
|
|
154
|
+
*/
|
|
152
155
|
export interface GridTypeMap<
|
|
153
156
|
AdditionalProps = {},
|
|
154
157
|
RootComponent extends React.ElementType = 'div',
|
|
@@ -171,6 +174,9 @@ export interface GridTypeMap<
|
|
|
171
174
|
*/
|
|
172
175
|
declare const Grid: OverridableComponent<GridTypeMap>;
|
|
173
176
|
|
|
177
|
+
/**
|
|
178
|
+
* @deprecated Use the [`Grid2`](https://mui.com/material-ui/react-grid2/) component instead.
|
|
179
|
+
*/
|
|
174
180
|
export type GridProps<
|
|
175
181
|
RootComponent extends React.ElementType = GridTypeMap['defaultComponent'],
|
|
176
182
|
AdditionalProps = {},
|
package/Hidden/withWidth.js
CHANGED
|
@@ -53,6 +53,7 @@ const withWidth = (options = {}) => Component => {
|
|
|
53
53
|
*/
|
|
54
54
|
const keys = theme.breakpoints.keys.slice().reverse();
|
|
55
55
|
const widthComputed = keys.reduce((output, key) => {
|
|
56
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
56
57
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
57
58
|
const matches = useMediaQuery(theme.breakpoints.up(key));
|
|
58
59
|
return !output && matches ? key : output;
|
package/Icon/Icon.js
CHANGED
|
@@ -37,7 +37,7 @@ const IconRoot = styled('span', {
|
|
|
37
37
|
userSelect: 'none',
|
|
38
38
|
width: '1em',
|
|
39
39
|
height: '1em',
|
|
40
|
-
// Chrome fix for https://
|
|
40
|
+
// Chrome fix for https://issues.chromium.org/issues/41375697
|
|
41
41
|
// To remove at some point.
|
|
42
42
|
overflow: 'hidden',
|
|
43
43
|
display: 'inline-block',
|
package/InputBase/InputBase.js
CHANGED
|
@@ -298,6 +298,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
298
298
|
const [focused, setFocused] = React.useState(false);
|
|
299
299
|
const muiFormControl = useFormControl();
|
|
300
300
|
if (process.env.NODE_ENV !== 'production') {
|
|
301
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
301
302
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
302
303
|
React.useEffect(() => {
|
|
303
304
|
if (muiFormControl) {
|
|
@@ -391,6 +392,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
391
392
|
// or auto filled by the browser before the hydration (for SSR).
|
|
392
393
|
React.useEffect(() => {
|
|
393
394
|
checkDirty(inputRef.current);
|
|
395
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
394
396
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
395
397
|
}, []);
|
|
396
398
|
const handleClick = event => {
|
package/Modal/Modal.js
CHANGED
|
@@ -158,6 +158,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
158
158
|
childProps.onExited = onExited;
|
|
159
159
|
}
|
|
160
160
|
const externalForwardedProps = {
|
|
161
|
+
...other,
|
|
161
162
|
slots: {
|
|
162
163
|
root: components.Root,
|
|
163
164
|
backdrop: components.Backdrop,
|
|
@@ -209,7 +210,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
209
210
|
disablePortal: disablePortal,
|
|
210
211
|
children: /*#__PURE__*/_jsxs(RootSlot, {
|
|
211
212
|
...rootProps,
|
|
212
|
-
...other,
|
|
213
213
|
children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/_jsx(BackdropSlot, {
|
|
214
214
|
...backdropProps,
|
|
215
215
|
ref: backdropRef
|
package/Modal/ModalManager.js
CHANGED
|
@@ -22,14 +22,14 @@ function isAriaHiddenForbiddenOnElement(element) {
|
|
|
22
22
|
// can be children of body and can't have aria-hidden attribute.
|
|
23
23
|
// cf. https://www.w3.org/TR/html-aria/#docconformance
|
|
24
24
|
const forbiddenTagNames = ['TEMPLATE', 'SCRIPT', 'STYLE', 'LINK', 'MAP', 'META', 'NOSCRIPT', 'PICTURE', 'COL', 'COLGROUP', 'PARAM', 'SLOT', 'SOURCE', 'TRACK'];
|
|
25
|
-
const isForbiddenTagName = forbiddenTagNames.
|
|
25
|
+
const isForbiddenTagName = forbiddenTagNames.includes(element.tagName);
|
|
26
26
|
const isInputHidden = element.tagName === 'INPUT' && element.getAttribute('type') === 'hidden';
|
|
27
27
|
return isForbiddenTagName || isInputHidden;
|
|
28
28
|
}
|
|
29
29
|
function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude, show) {
|
|
30
30
|
const blacklist = [mountElement, currentElement, ...elementsToExclude];
|
|
31
31
|
[].forEach.call(container.children, element => {
|
|
32
|
-
const isNotExcludedElement = blacklist.
|
|
32
|
+
const isNotExcludedElement = !blacklist.includes(element);
|
|
33
33
|
const isNotForbiddenElement = !isAriaHiddenForbiddenOnElement(element);
|
|
34
34
|
if (isNotExcludedElement && isNotForbiddenElement) {
|
|
35
35
|
ariaHidden(element, show);
|
|
@@ -165,7 +165,7 @@ export class ModalManager {
|
|
|
165
165
|
return modalIndex;
|
|
166
166
|
}
|
|
167
167
|
mount(modal, props) {
|
|
168
|
-
const containerIndex = findIndexOf(this.containers, item => item.modals.
|
|
168
|
+
const containerIndex = findIndexOf(this.containers, item => item.modals.includes(modal));
|
|
169
169
|
const containerInfo = this.containers[containerIndex];
|
|
170
170
|
if (!containerInfo.restore) {
|
|
171
171
|
containerInfo.restore = handleContainer(containerInfo, props);
|
|
@@ -176,7 +176,7 @@ export class ModalManager {
|
|
|
176
176
|
if (modalIndex === -1) {
|
|
177
177
|
return modalIndex;
|
|
178
178
|
}
|
|
179
|
-
const containerIndex = findIndexOf(this.containers, item => item.modals.
|
|
179
|
+
const containerIndex = findIndexOf(this.containers, item => item.modals.includes(modal));
|
|
180
180
|
const containerInfo = this.containers[containerIndex];
|
|
181
181
|
containerInfo.modals.splice(containerInfo.modals.indexOf(modal), 1);
|
|
182
182
|
this.modals.splice(modalIndex, 1);
|
package/Popover/Popover.js
CHANGED
|
@@ -241,7 +241,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
241
241
|
}
|
|
242
242
|
const positioning = getPositioningStyle(element);
|
|
243
243
|
if (positioning.top !== null) {
|
|
244
|
-
element.style.top
|
|
244
|
+
element.style.setProperty('top', positioning.top);
|
|
245
245
|
}
|
|
246
246
|
if (positioning.left !== null) {
|
|
247
247
|
element.style.left = positioning.left;
|
package/Select/SelectInput.js
CHANGED
|
@@ -180,6 +180,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
180
180
|
setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
|
|
181
181
|
displayRef.current.focus();
|
|
182
182
|
}
|
|
183
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
183
184
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
184
185
|
}, [displayNode, autoWidth]);
|
|
185
186
|
// `isOpenControlled` is ignored because the component should never switch between controlled and uncontrolled modes.
|
|
@@ -383,6 +384,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
383
384
|
});
|
|
384
385
|
});
|
|
385
386
|
if (process.env.NODE_ENV !== 'production') {
|
|
387
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
386
388
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
387
389
|
React.useEffect(() => {
|
|
388
390
|
if (!foundMatch && !multiple && value !== '') {
|
package/Skeleton/Skeleton.js
CHANGED
|
@@ -59,7 +59,9 @@ const pulseAnimation = typeof pulseKeyframe !== 'string' ? css`
|
|
|
59
59
|
animation: ${pulseKeyframe} 2s ease-in-out 0.5s infinite;
|
|
60
60
|
` : null;
|
|
61
61
|
const waveAnimation = typeof waveKeyframe !== 'string' ? css`
|
|
62
|
-
|
|
62
|
+
&::after {
|
|
63
|
+
animation: ${waveKeyframe} 2s linear 0.5s infinite;
|
|
64
|
+
}
|
|
63
65
|
` : null;
|
|
64
66
|
const SkeletonRoot = styled('span', {
|
|
65
67
|
name: 'MuiSkeleton',
|
|
@@ -168,8 +170,8 @@ const SkeletonRoot = styled('span', {
|
|
|
168
170
|
props: {
|
|
169
171
|
animation: 'wave'
|
|
170
172
|
},
|
|
171
|
-
style: {
|
|
172
|
-
'&::after':
|
|
173
|
+
style: waveAnimation || {
|
|
174
|
+
'&::after': {
|
|
173
175
|
animation: `${waveKeyframe} 2s linear 0.5s infinite`
|
|
174
176
|
}
|
|
175
177
|
}
|
package/Slider/useSlider.js
CHANGED
|
@@ -337,12 +337,12 @@ export function useSlider(parameters) {
|
|
|
337
337
|
left
|
|
338
338
|
} = slider.getBoundingClientRect();
|
|
339
339
|
let percent;
|
|
340
|
-
if (axis.
|
|
340
|
+
if (axis.startsWith('vertical')) {
|
|
341
341
|
percent = (bottom - finger.y) / height;
|
|
342
342
|
} else {
|
|
343
343
|
percent = (finger.x - left) / width;
|
|
344
344
|
}
|
|
345
|
-
if (axis.
|
|
345
|
+
if (axis.includes('-reverse')) {
|
|
346
346
|
percent = 1 - percent;
|
|
347
347
|
}
|
|
348
348
|
let newValue;
|
|
@@ -203,6 +203,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
203
203
|
if (!touchDetected.current) {
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- claimedSwipeInstance is a singleton
|
|
206
207
|
claimedSwipeInstance = null;
|
|
207
208
|
touchDetected.current = false;
|
|
208
209
|
ReactDOM.flushSync(() => {
|
package/Tooltip/Tooltip.js
CHANGED
|
@@ -369,12 +369,14 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
369
369
|
});
|
|
370
370
|
let open = openState;
|
|
371
371
|
if (process.env.NODE_ENV !== 'production') {
|
|
372
|
-
// eslint-disable-next-line react-
|
|
372
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
373
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
|
|
373
374
|
const {
|
|
374
375
|
current: isControlled
|
|
375
376
|
} = React.useRef(openProp !== undefined);
|
|
376
377
|
|
|
377
|
-
// eslint-disable-next-line react-
|
|
378
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
379
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
|
|
378
380
|
React.useEffect(() => {
|
|
379
381
|
if (childNode && childNode.disabled && !isControlled && title !== '' && childNode.tagName.toLowerCase() === 'button') {
|
|
380
382
|
console.error(['MUI: You are providing a disabled `button` child to the Tooltip component.', 'A disabled element does not fire events.', "Tooltip needs to listen to the child element's events to display the title.", '', 'Add a simple wrapper element, such as a `span`.'].join('\n'));
|
|
@@ -556,7 +558,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
556
558
|
if (process.env.NODE_ENV !== 'production') {
|
|
557
559
|
childrenProps['data-mui-internal-clone-element'] = true;
|
|
558
560
|
|
|
559
|
-
// eslint-disable-next-line react-
|
|
561
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
562
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
|
|
560
563
|
React.useEffect(() => {
|
|
561
564
|
if (childNode && !childNode.getAttribute('data-mui-internal-clone-element')) {
|
|
562
565
|
console.error(['MUI: The `children` component of the Tooltip is not forwarding its props correctly.', 'Please make sure that props are spread on the same element that the ref is applied to.'].join('\n'));
|
|
@@ -14,7 +14,7 @@ function getTabIndex(node) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
// Browsers do not return `tabIndex` correctly for contentEditable nodes;
|
|
17
|
-
// https://
|
|
17
|
+
// https://issues.chromium.org/issues/41283952
|
|
18
18
|
// so if they don't have a tabindex attribute specifically set, assume it's 0.
|
|
19
19
|
// in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
|
|
20
20
|
// `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
|
package/index.d.ts
CHANGED
|
@@ -204,6 +204,7 @@ export { default as FormLabel } from './FormLabel';
|
|
|
204
204
|
export * from './FormLabel';
|
|
205
205
|
|
|
206
206
|
export { default as Grid } from './Grid';
|
|
207
|
+
export { GridProps, GridTypeMap } from './Grid';
|
|
207
208
|
|
|
208
209
|
export { default as Grid2 } from './Grid2';
|
|
209
210
|
export * from './Grid2';
|
package/index.js
CHANGED
|
@@ -10,6 +10,13 @@ import useSlot from "../utils/useSlot.js";
|
|
|
10
10
|
import Fade from "../Fade/index.js";
|
|
11
11
|
import { getBackdropUtilityClass } from "./backdropClasses.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const removeOwnerState = props => {
|
|
14
|
+
const {
|
|
15
|
+
ownerState,
|
|
16
|
+
...rest
|
|
17
|
+
} = props;
|
|
18
|
+
return rest;
|
|
19
|
+
};
|
|
13
20
|
const useUtilityClasses = ownerState => {
|
|
14
21
|
const {
|
|
15
22
|
classes,
|
|
@@ -98,12 +105,12 @@ const Backdrop = /*#__PURE__*/React.forwardRef(function Backdrop(inProps, ref) {
|
|
|
98
105
|
externalForwardedProps,
|
|
99
106
|
ownerState
|
|
100
107
|
});
|
|
101
|
-
|
|
108
|
+
const transitionPropsRemoved = removeOwnerState(transitionProps);
|
|
102
109
|
return /*#__PURE__*/_jsx(TransitionSlot, {
|
|
103
110
|
in: open,
|
|
104
111
|
timeout: transitionDuration,
|
|
105
112
|
...other,
|
|
106
|
-
...
|
|
113
|
+
...transitionPropsRemoved,
|
|
107
114
|
children: /*#__PURE__*/_jsx(RootSlot, {
|
|
108
115
|
"aria-hidden": true,
|
|
109
116
|
...rootProps,
|
|
@@ -79,7 +79,7 @@ function ClickAwayListener(props) {
|
|
|
79
79
|
|
|
80
80
|
// If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js
|
|
81
81
|
if (event.composedPath) {
|
|
82
|
-
insideDOM = event.composedPath().
|
|
82
|
+
insideDOM = event.composedPath().includes(nodeRef.current);
|
|
83
83
|
} else {
|
|
84
84
|
insideDOM = !doc.documentElement.contains(
|
|
85
85
|
// @ts-expect-error returns `false` as intended when not dispatched from a Node
|
|
@@ -170,9 +170,8 @@ const FormControl = /*#__PURE__*/React.forwardRef(function FormControl(inProps,
|
|
|
170
170
|
}
|
|
171
171
|
const focused = visuallyFocused !== undefined && !disabled ? visuallyFocused : focusedState;
|
|
172
172
|
let registerEffect;
|
|
173
|
+
const registeredInput = React.useRef(false);
|
|
173
174
|
if (process.env.NODE_ENV !== 'production') {
|
|
174
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
175
|
-
const registeredInput = React.useRef(false);
|
|
176
175
|
registerEffect = () => {
|
|
177
176
|
if (registeredInput.current) {
|
|
178
177
|
console.error(['MUI: There are multiple `InputBase` components inside a FormControl.', 'This creates visual inconsistencies, only use one `InputBase`.'].join('\n'));
|
|
@@ -53,6 +53,7 @@ const withWidth = (options = {}) => Component => {
|
|
|
53
53
|
*/
|
|
54
54
|
const keys = theme.breakpoints.keys.slice().reverse();
|
|
55
55
|
const widthComputed = keys.reduce((output, key) => {
|
|
56
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
56
57
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
57
58
|
const matches = useMediaQuery(theme.breakpoints.up(key));
|
|
58
59
|
return !output && matches ? key : output;
|
package/modern/Icon/Icon.js
CHANGED
|
@@ -37,7 +37,7 @@ const IconRoot = styled('span', {
|
|
|
37
37
|
userSelect: 'none',
|
|
38
38
|
width: '1em',
|
|
39
39
|
height: '1em',
|
|
40
|
-
// Chrome fix for https://
|
|
40
|
+
// Chrome fix for https://issues.chromium.org/issues/41375697
|
|
41
41
|
// To remove at some point.
|
|
42
42
|
overflow: 'hidden',
|
|
43
43
|
display: 'inline-block',
|
|
@@ -298,6 +298,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
298
298
|
const [focused, setFocused] = React.useState(false);
|
|
299
299
|
const muiFormControl = useFormControl();
|
|
300
300
|
if (process.env.NODE_ENV !== 'production') {
|
|
301
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
301
302
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
302
303
|
React.useEffect(() => {
|
|
303
304
|
if (muiFormControl) {
|
|
@@ -391,6 +392,7 @@ const InputBase = /*#__PURE__*/React.forwardRef(function InputBase(inProps, ref)
|
|
|
391
392
|
// or auto filled by the browser before the hydration (for SSR).
|
|
392
393
|
React.useEffect(() => {
|
|
393
394
|
checkDirty(inputRef.current);
|
|
395
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
394
396
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
395
397
|
}, []);
|
|
396
398
|
const handleClick = event => {
|
package/modern/Modal/Modal.js
CHANGED
|
@@ -158,6 +158,7 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
158
158
|
childProps.onExited = onExited;
|
|
159
159
|
}
|
|
160
160
|
const externalForwardedProps = {
|
|
161
|
+
...other,
|
|
161
162
|
slots: {
|
|
162
163
|
root: components.Root,
|
|
163
164
|
backdrop: components.Backdrop,
|
|
@@ -209,7 +210,6 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
209
210
|
disablePortal: disablePortal,
|
|
210
211
|
children: /*#__PURE__*/_jsxs(RootSlot, {
|
|
211
212
|
...rootProps,
|
|
212
|
-
...other,
|
|
213
213
|
children: [!hideBackdrop && BackdropComponent ? /*#__PURE__*/_jsx(BackdropSlot, {
|
|
214
214
|
...backdropProps,
|
|
215
215
|
ref: backdropRef
|
|
@@ -22,14 +22,14 @@ function isAriaHiddenForbiddenOnElement(element) {
|
|
|
22
22
|
// can be children of body and can't have aria-hidden attribute.
|
|
23
23
|
// cf. https://www.w3.org/TR/html-aria/#docconformance
|
|
24
24
|
const forbiddenTagNames = ['TEMPLATE', 'SCRIPT', 'STYLE', 'LINK', 'MAP', 'META', 'NOSCRIPT', 'PICTURE', 'COL', 'COLGROUP', 'PARAM', 'SLOT', 'SOURCE', 'TRACK'];
|
|
25
|
-
const isForbiddenTagName = forbiddenTagNames.
|
|
25
|
+
const isForbiddenTagName = forbiddenTagNames.includes(element.tagName);
|
|
26
26
|
const isInputHidden = element.tagName === 'INPUT' && element.getAttribute('type') === 'hidden';
|
|
27
27
|
return isForbiddenTagName || isInputHidden;
|
|
28
28
|
}
|
|
29
29
|
function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude, show) {
|
|
30
30
|
const blacklist = [mountElement, currentElement, ...elementsToExclude];
|
|
31
31
|
[].forEach.call(container.children, element => {
|
|
32
|
-
const isNotExcludedElement = blacklist.
|
|
32
|
+
const isNotExcludedElement = !blacklist.includes(element);
|
|
33
33
|
const isNotForbiddenElement = !isAriaHiddenForbiddenOnElement(element);
|
|
34
34
|
if (isNotExcludedElement && isNotForbiddenElement) {
|
|
35
35
|
ariaHidden(element, show);
|
|
@@ -165,7 +165,7 @@ export class ModalManager {
|
|
|
165
165
|
return modalIndex;
|
|
166
166
|
}
|
|
167
167
|
mount(modal, props) {
|
|
168
|
-
const containerIndex = findIndexOf(this.containers, item => item.modals.
|
|
168
|
+
const containerIndex = findIndexOf(this.containers, item => item.modals.includes(modal));
|
|
169
169
|
const containerInfo = this.containers[containerIndex];
|
|
170
170
|
if (!containerInfo.restore) {
|
|
171
171
|
containerInfo.restore = handleContainer(containerInfo, props);
|
|
@@ -176,7 +176,7 @@ export class ModalManager {
|
|
|
176
176
|
if (modalIndex === -1) {
|
|
177
177
|
return modalIndex;
|
|
178
178
|
}
|
|
179
|
-
const containerIndex = findIndexOf(this.containers, item => item.modals.
|
|
179
|
+
const containerIndex = findIndexOf(this.containers, item => item.modals.includes(modal));
|
|
180
180
|
const containerInfo = this.containers[containerIndex];
|
|
181
181
|
containerInfo.modals.splice(containerInfo.modals.indexOf(modal), 1);
|
|
182
182
|
this.modals.splice(modalIndex, 1);
|
|
@@ -241,7 +241,7 @@ const Popover = /*#__PURE__*/React.forwardRef(function Popover(inProps, ref) {
|
|
|
241
241
|
}
|
|
242
242
|
const positioning = getPositioningStyle(element);
|
|
243
243
|
if (positioning.top !== null) {
|
|
244
|
-
element.style.top
|
|
244
|
+
element.style.setProperty('top', positioning.top);
|
|
245
245
|
}
|
|
246
246
|
if (positioning.left !== null) {
|
|
247
247
|
element.style.left = positioning.left;
|
|
@@ -180,6 +180,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
180
180
|
setMenuMinWidthState(autoWidth ? null : anchorElement.clientWidth);
|
|
181
181
|
displayRef.current.focus();
|
|
182
182
|
}
|
|
183
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
183
184
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
184
185
|
}, [displayNode, autoWidth]);
|
|
185
186
|
// `isOpenControlled` is ignored because the component should never switch between controlled and uncontrolled modes.
|
|
@@ -383,6 +384,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
383
384
|
});
|
|
384
385
|
});
|
|
385
386
|
if (process.env.NODE_ENV !== 'production') {
|
|
387
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
386
388
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
387
389
|
React.useEffect(() => {
|
|
388
390
|
if (!foundMatch && !multiple && value !== '') {
|
|
@@ -59,7 +59,9 @@ const pulseAnimation = typeof pulseKeyframe !== 'string' ? css`
|
|
|
59
59
|
animation: ${pulseKeyframe} 2s ease-in-out 0.5s infinite;
|
|
60
60
|
` : null;
|
|
61
61
|
const waveAnimation = typeof waveKeyframe !== 'string' ? css`
|
|
62
|
-
|
|
62
|
+
&::after {
|
|
63
|
+
animation: ${waveKeyframe} 2s linear 0.5s infinite;
|
|
64
|
+
}
|
|
63
65
|
` : null;
|
|
64
66
|
const SkeletonRoot = styled('span', {
|
|
65
67
|
name: 'MuiSkeleton',
|
|
@@ -168,8 +170,8 @@ const SkeletonRoot = styled('span', {
|
|
|
168
170
|
props: {
|
|
169
171
|
animation: 'wave'
|
|
170
172
|
},
|
|
171
|
-
style: {
|
|
172
|
-
'&::after':
|
|
173
|
+
style: waveAnimation || {
|
|
174
|
+
'&::after': {
|
|
173
175
|
animation: `${waveKeyframe} 2s linear 0.5s infinite`
|
|
174
176
|
}
|
|
175
177
|
}
|
|
@@ -337,12 +337,12 @@ export function useSlider(parameters) {
|
|
|
337
337
|
left
|
|
338
338
|
} = slider.getBoundingClientRect();
|
|
339
339
|
let percent;
|
|
340
|
-
if (axis.
|
|
340
|
+
if (axis.startsWith('vertical')) {
|
|
341
341
|
percent = (bottom - finger.y) / height;
|
|
342
342
|
} else {
|
|
343
343
|
percent = (finger.x - left) / width;
|
|
344
344
|
}
|
|
345
|
-
if (axis.
|
|
345
|
+
if (axis.includes('-reverse')) {
|
|
346
346
|
percent = 1 - percent;
|
|
347
347
|
}
|
|
348
348
|
let newValue;
|
|
@@ -203,6 +203,7 @@ const SwipeableDrawer = /*#__PURE__*/React.forwardRef(function SwipeableDrawer(i
|
|
|
203
203
|
if (!touchDetected.current) {
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- claimedSwipeInstance is a singleton
|
|
206
207
|
claimedSwipeInstance = null;
|
|
207
208
|
touchDetected.current = false;
|
|
208
209
|
ReactDOM.flushSync(() => {
|
|
@@ -369,12 +369,14 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
369
369
|
});
|
|
370
370
|
let open = openState;
|
|
371
371
|
if (process.env.NODE_ENV !== 'production') {
|
|
372
|
-
// eslint-disable-next-line react-
|
|
372
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
373
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
|
|
373
374
|
const {
|
|
374
375
|
current: isControlled
|
|
375
376
|
} = React.useRef(openProp !== undefined);
|
|
376
377
|
|
|
377
|
-
// eslint-disable-next-line react-
|
|
378
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
379
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
|
|
378
380
|
React.useEffect(() => {
|
|
379
381
|
if (childNode && childNode.disabled && !isControlled && title !== '' && childNode.tagName.toLowerCase() === 'button') {
|
|
380
382
|
console.error(['MUI: You are providing a disabled `button` child to the Tooltip component.', 'A disabled element does not fire events.', "Tooltip needs to listen to the child element's events to display the title.", '', 'Add a simple wrapper element, such as a `span`.'].join('\n'));
|
|
@@ -556,7 +558,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
556
558
|
if (process.env.NODE_ENV !== 'production') {
|
|
557
559
|
childrenProps['data-mui-internal-clone-element'] = true;
|
|
558
560
|
|
|
559
|
-
// eslint-disable-next-line react-
|
|
561
|
+
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler
|
|
562
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- process.env never changes
|
|
560
563
|
React.useEffect(() => {
|
|
561
564
|
if (childNode && !childNode.getAttribute('data-mui-internal-clone-element')) {
|
|
562
565
|
console.error(['MUI: The `children` component of the Tooltip is not forwarding its props correctly.', 'Please make sure that props are spread on the same element that the ref is applied to.'].join('\n'));
|
|
@@ -14,7 +14,7 @@ function getTabIndex(node) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
// Browsers do not return `tabIndex` correctly for contentEditable nodes;
|
|
17
|
-
// https://
|
|
17
|
+
// https://issues.chromium.org/issues/41283952
|
|
18
18
|
// so if they don't have a tabindex attribute specifically set, assume it's 0.
|
|
19
19
|
// in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
|
|
20
20
|
// `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
|