@mui/material 6.1.8 → 6.1.10
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/Avatar/Avatar.js +7 -6
- package/ButtonBase/ButtonBase.js +21 -22
- package/CHANGELOG.md +95 -2
- package/ClickAwayListener/ClickAwayListener.js +1 -4
- package/FilledInput/FilledInput.js +1 -1
- package/FormHelperText/FormHelperText.js +1 -0
- package/Grid2/Grid2.d.ts +0 -1
- package/Grid2/Grid2.js +9 -2
- package/Grid2/grid2Classes.d.ts +8 -3
- package/Hidden/HiddenJs.js +4 -8
- package/InputAdornment/InputAdornment.js +1 -0
- package/Modal/useModal.js +3 -2
- package/Modal/useModal.types.d.ts +5 -1
- package/NoSsr/NoSsr.js +2 -5
- package/OutlinedInput/NotchedOutline.js +1 -0
- package/Portal/Portal.js +2 -7
- package/Select/Select.d.ts +10 -4
- package/Select/SelectInput.js +1 -0
- package/Slider/SliderValueLabel.d.ts +4 -1
- package/Slider/SliderValueLabel.types.d.ts +4 -1
- package/Tabs/ScrollbarSize.js +2 -2
- package/Unstable_TrapFocus/FocusTrap.types.d.ts +4 -1
- package/index.js +1 -1
- package/modern/Avatar/Avatar.js +7 -6
- package/modern/ButtonBase/ButtonBase.js +21 -22
- package/modern/ClickAwayListener/ClickAwayListener.js +1 -4
- package/modern/FilledInput/FilledInput.js +1 -1
- package/modern/FormHelperText/FormHelperText.js +1 -0
- package/modern/Grid2/Grid2.js +9 -2
- package/modern/Hidden/HiddenJs.js +4 -8
- package/modern/InputAdornment/InputAdornment.js +1 -0
- package/modern/Modal/useModal.js +3 -2
- package/modern/NoSsr/NoSsr.js +2 -5
- package/modern/OutlinedInput/NotchedOutline.js +1 -0
- package/modern/Portal/Portal.js +2 -7
- package/modern/Select/SelectInput.js +1 -0
- package/modern/Tabs/ScrollbarSize.js +2 -2
- package/modern/index.js +1 -1
- package/modern/styles/createThemeWithVars.js +2 -2
- package/modern/utils/useSlot.js +1 -10
- package/modern/version/index.js +2 -2
- package/node/Avatar/Avatar.js +7 -6
- package/node/ButtonBase/ButtonBase.js +21 -22
- package/node/ClickAwayListener/ClickAwayListener.js +1 -4
- package/node/FilledInput/FilledInput.js +1 -1
- package/node/FormHelperText/FormHelperText.js +1 -0
- package/node/Grid2/Grid2.js +9 -2
- package/node/Hidden/HiddenJs.js +7 -10
- package/node/InputAdornment/InputAdornment.js +1 -0
- package/node/Modal/useModal.js +3 -2
- package/node/NoSsr/NoSsr.js +2 -5
- package/node/OutlinedInput/NotchedOutline.js +1 -0
- package/node/Portal/Portal.js +2 -7
- package/node/Select/SelectInput.js +1 -0
- package/node/Tabs/ScrollbarSize.js +2 -2
- package/node/index.js +1 -1
- package/node/styles/createThemeWithVars.js +2 -2
- package/node/utils/useSlot.js +1 -10
- package/node/version/index.js +2 -2
- package/package.json +5 -5
- package/styles/ThemeProvider.d.ts +1 -0
- package/styles/createThemeWithVars.js +2 -2
- package/styles/overrides.d.ts +2 -2
- package/utils/useSlot.d.ts +0 -7
- package/utils/useSlot.js +1 -10
- package/version/index.js +2 -2
package/Avatar/Avatar.js
CHANGED
|
@@ -161,21 +161,22 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(inProps, ref) {
|
|
|
161
161
|
...other
|
|
162
162
|
} = props;
|
|
163
163
|
let children = null;
|
|
164
|
+
const ownerState = {
|
|
165
|
+
...props,
|
|
166
|
+
component,
|
|
167
|
+
variant
|
|
168
|
+
};
|
|
164
169
|
|
|
165
170
|
// Use a hook instead of onError on the img element to support server-side rendering.
|
|
166
171
|
const loaded = useLoaded({
|
|
167
172
|
...imgProps,
|
|
173
|
+
...(typeof slotProps.img === 'function' ? slotProps.img(ownerState) : slotProps.img),
|
|
168
174
|
src,
|
|
169
175
|
srcSet
|
|
170
176
|
});
|
|
171
177
|
const hasImg = src || srcSet;
|
|
172
178
|
const hasImgNotFailing = hasImg && loaded !== 'error';
|
|
173
|
-
|
|
174
|
-
...props,
|
|
175
|
-
colorDefault: !hasImgNotFailing,
|
|
176
|
-
component,
|
|
177
|
-
variant
|
|
178
|
-
};
|
|
179
|
+
ownerState.colorDefault = !hasImgNotFailing;
|
|
179
180
|
// This issue explains why this is required: https://github.com/mui/material-ui/issues/42184
|
|
180
181
|
delete ownerState.ownerState;
|
|
181
182
|
const classes = useUtilityClasses(ownerState);
|
package/ButtonBase/ButtonBase.js
CHANGED
|
@@ -136,34 +136,22 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
136
136
|
ripple.pulsate();
|
|
137
137
|
}
|
|
138
138
|
}, [disableRipple, focusRipple, focusVisible, ripple]);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const ignore = skipRippleAction;
|
|
145
|
-
if (!ignore) {
|
|
146
|
-
ripple[rippleAction](event);
|
|
147
|
-
}
|
|
148
|
-
return true;
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
const handleMouseDown = useRippleHandler('start', onMouseDown);
|
|
152
|
-
const handleContextMenu = useRippleHandler('stop', onContextMenu);
|
|
153
|
-
const handleDragLeave = useRippleHandler('stop', onDragLeave);
|
|
154
|
-
const handleMouseUp = useRippleHandler('stop', onMouseUp);
|
|
155
|
-
const handleMouseLeave = useRippleHandler('stop', event => {
|
|
139
|
+
const handleMouseDown = useRippleHandler(ripple, 'start', onMouseDown, disableTouchRipple);
|
|
140
|
+
const handleContextMenu = useRippleHandler(ripple, 'stop', onContextMenu, disableTouchRipple);
|
|
141
|
+
const handleDragLeave = useRippleHandler(ripple, 'stop', onDragLeave, disableTouchRipple);
|
|
142
|
+
const handleMouseUp = useRippleHandler(ripple, 'stop', onMouseUp, disableTouchRipple);
|
|
143
|
+
const handleMouseLeave = useRippleHandler(ripple, 'stop', event => {
|
|
156
144
|
if (focusVisible) {
|
|
157
145
|
event.preventDefault();
|
|
158
146
|
}
|
|
159
147
|
if (onMouseLeave) {
|
|
160
148
|
onMouseLeave(event);
|
|
161
149
|
}
|
|
162
|
-
});
|
|
163
|
-
const handleTouchStart = useRippleHandler('start', onTouchStart);
|
|
164
|
-
const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
|
|
165
|
-
const handleTouchMove = useRippleHandler('stop', onTouchMove);
|
|
166
|
-
const handleBlur = useRippleHandler('stop', event => {
|
|
150
|
+
}, disableTouchRipple);
|
|
151
|
+
const handleTouchStart = useRippleHandler(ripple, 'start', onTouchStart, disableTouchRipple);
|
|
152
|
+
const handleTouchEnd = useRippleHandler(ripple, 'stop', onTouchEnd, disableTouchRipple);
|
|
153
|
+
const handleTouchMove = useRippleHandler(ripple, 'stop', onTouchMove, disableTouchRipple);
|
|
154
|
+
const handleBlur = useRippleHandler(ripple, 'stop', event => {
|
|
167
155
|
if (!isFocusVisible(event.target)) {
|
|
168
156
|
setFocusVisible(false);
|
|
169
157
|
}
|
|
@@ -287,6 +275,17 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
287
275
|
}) : null]
|
|
288
276
|
});
|
|
289
277
|
});
|
|
278
|
+
function useRippleHandler(ripple, rippleAction, eventCallback, skipRippleAction = false) {
|
|
279
|
+
return useEventCallback(event => {
|
|
280
|
+
if (eventCallback) {
|
|
281
|
+
eventCallback(event);
|
|
282
|
+
}
|
|
283
|
+
if (!skipRippleAction) {
|
|
284
|
+
ripple[rippleAction](event);
|
|
285
|
+
}
|
|
286
|
+
return true;
|
|
287
|
+
});
|
|
288
|
+
}
|
|
290
289
|
process.env.NODE_ENV !== "production" ? ButtonBase.propTypes /* remove-proptypes */ = {
|
|
291
290
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
292
291
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,100 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 6.1.10
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v6.1.9..master -->
|
|
6
|
+
|
|
7
|
+
_Dec 3, 2024_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 10 contributors who made this release possible.
|
|
10
|
+
|
|
11
|
+
### `@mui/material@6.1.10`
|
|
12
|
+
|
|
13
|
+
- [Avatar] Fix `slotProps.img` not spread to hook (#44536) @siriwatknp
|
|
14
|
+
- [FilledInput] Use `slotProps` instead of `componentsProps` (#44552) @siriwatknp
|
|
15
|
+
- [Grid2] Fix theme scoping error (#44599) @siriwatknp
|
|
16
|
+
- [Grid2] Add container styles from styleOverrides (#44598) @sai6855
|
|
17
|
+
- Skip `tonalOffset` from setting color channel (#44585) @siriwatknp
|
|
18
|
+
- Remove few more React.ReactElement<any> types (#44290) @sai6855
|
|
19
|
+
- [Tabs] Fix `ScrollbarSize` ref being overriden (#44593) @DiegoAndai
|
|
20
|
+
- [Select][TextField] Fix screen reader from saying `&ZeroWidthSpace` (#44631) @arishoham
|
|
21
|
+
|
|
22
|
+
### `@mui/system@6.1.10`
|
|
23
|
+
|
|
24
|
+
- [ThemeProvider] Optimize `theme` changes when enabling CSS theme variables (#44588) @siriwatknp
|
|
25
|
+
|
|
26
|
+
### Docs
|
|
27
|
+
|
|
28
|
+
- Notification for the MUI X v8 alpha zero announcement blog post (#44629) @joserodolfofreitas
|
|
29
|
+
- Bump React Router to ^7.0.1 (#44531) @oliviertassinari
|
|
30
|
+
- [material-ui] Replace testid with id in migration guide (#44636) @sai6855
|
|
31
|
+
- [material-ui][TextField] Update usage of `InputLabelProps` in docs (#44634) @sai6855
|
|
32
|
+
- [material-ui][ListItem] Add missing diffs in migration guide (#44638) @sai6855
|
|
33
|
+
- [examples] Use Next.js 14 on examples (#44486) @DiegoAndai
|
|
34
|
+
- Update links and sidebar nav for Base UI components in Material UI (#44581) @samuelsycamore
|
|
35
|
+
|
|
36
|
+
### Core
|
|
37
|
+
|
|
38
|
+
- Remove `getSlotOwnerState` from `useSlot` util (#44403) @ZeeshanTamboli
|
|
39
|
+
- Extract useRippleHandler outside of ButtonBase (#44591) @albarv340
|
|
40
|
+
- Update eslint config (#44586) @MBilalShafi
|
|
41
|
+
- [core-infra] Remove useless fragments (#44516) @oliviertassinari
|
|
42
|
+
- [docs-infra] Fix Banner CLS (#44632) @oliviertassinari
|
|
43
|
+
- [docs-infra] Change CSS vars generation to be extracted from Enum (#44587) @mnajdova
|
|
44
|
+
- [docs-infra] Automatically hide Black Friday banner (#44630) @oliviertassinari
|
|
45
|
+
- [docs-infra] Fix TOC RTL padding regression (#44535) @oliviertassinari
|
|
46
|
+
- [test-utils] Remove leftover React.ReactElement<any> from describeConformance.tsx (#44639) @sai6855
|
|
47
|
+
|
|
48
|
+
All contributors of this release in alphabetical order: @albarv340, @arishoham, @DiegoAndai, @joserodolfofreitas, @MBilalShafi, @mnajdova, @oliviertassinari, @renovate[bot], @sai6855, @samuelsycamore, @siriwatknp, @ZeeshanTamboli
|
|
49
|
+
|
|
50
|
+
## 6.1.9
|
|
51
|
+
|
|
52
|
+
<!-- generated comparing v6.1.8..master -->
|
|
53
|
+
|
|
54
|
+
_Nov 27, 2024_
|
|
55
|
+
|
|
56
|
+
A big thanks to the 8 contributors who made this release possible.
|
|
57
|
+
|
|
58
|
+
### `@mui/material@6.1.9`
|
|
59
|
+
|
|
60
|
+
- [Select] Omit `placeholder` from props (#44502) @Juneezee
|
|
61
|
+
- [Grid2] Add container class to `Grid2Classes` (#44562) @sai6855
|
|
62
|
+
|
|
63
|
+
### `@mui/system@6.1.9`
|
|
64
|
+
|
|
65
|
+
- Add ThemeProvider `noSsr` to prevent double rendering (#44451) @siriwatknp
|
|
66
|
+
|
|
67
|
+
### `@mui/codemod@6.1.9`
|
|
68
|
+
|
|
69
|
+
- [codemod] Fix handling of computed `paragraph` props (#44195) @joshkel
|
|
70
|
+
|
|
71
|
+
### `@mui/material-pigment-css@6.1.9`
|
|
72
|
+
|
|
73
|
+
- Make @pigment-css/react as peer dependency (#44498) @brijeshb42
|
|
74
|
+
|
|
75
|
+
### Docs
|
|
76
|
+
|
|
77
|
+
- [material-ui] Add missing required dependencies in dashboard template README (#44476) @mesqueeb
|
|
78
|
+
- [material-ui] Add missing Roboto import to Next.js integration docs (#44462) @StaceyD22
|
|
79
|
+
- [material-ui][Dialog] Fix padding in SimpleDialog demo (#44467) @oliviertassinari
|
|
80
|
+
- Fix template page issues (#44466) @oliviertassinari
|
|
81
|
+
- [examples] Add dark mode example for Material UI + Pigment CSS (#44480) @mnajdova
|
|
82
|
+
|
|
83
|
+
### Core
|
|
84
|
+
|
|
85
|
+
- Remove TODO line in the changelog (#44484) @mnajdova
|
|
86
|
+
- Polish image display (418e888) @oliviertassinari
|
|
87
|
+
- [core-infra] Add no-relative-packages (#44489) @oliviertassinari
|
|
88
|
+
- [docs-infra] Support CSS variables API info (#44559) @mnajdova
|
|
89
|
+
- [docs-infra] Fix display when ad-block triggers (#44567) @oliviertassinari
|
|
90
|
+
- [docs-infra] Improve locator finding using visible option (#44541) @siriwatknp
|
|
91
|
+
- [docs-infra] Correctly flatten the pages tree (#44514) @oliviertassinari
|
|
92
|
+
- [docs-infra] Fix Sponsor design regression (#44515) @oliviertassinari
|
|
93
|
+
- [test] Remove React.ReactElement<any> from describeConformance.tsx (#44318) @sai6855
|
|
94
|
+
- [test] Do not enforce the presence of `ownerState.className` in `describeConformance` (#44479) @flaviendelangle
|
|
95
|
+
|
|
96
|
+
All contributors of this release in alphabetical order: @brijeshb42, @flaviendelangle, @joshkel, @Juneezee, @mesqueeb, @mnajdova, @oliviertassinari, @sai6855, @siriwatknp, @StaceyD22
|
|
97
|
+
|
|
3
98
|
## v6.1.8
|
|
4
99
|
|
|
5
100
|
<!-- generated comparing v6.1.7..master -->
|
|
@@ -8,8 +103,6 @@ _Nov 20, 2024_
|
|
|
8
103
|
|
|
9
104
|
A big thanks to the 10 contributors who made this release possible.
|
|
10
105
|
|
|
11
|
-
TODO INSERT HIGHLIGHTS
|
|
12
|
-
|
|
13
106
|
### `@mui/material@6.1.8`
|
|
14
107
|
|
|
15
108
|
- [Autocomplete] Use `ul` element for the listbox (#44422) @DiegoAndai
|
|
@@ -6,7 +6,6 @@ import { elementAcceptingRef, exactProp, unstable_ownerDocument as ownerDocument
|
|
|
6
6
|
import getReactElementRef from '@mui/utils/getReactElementRef';
|
|
7
7
|
|
|
8
8
|
// TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase<EventName> : never` once generatePropTypes runs with TS 4.1
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
9
|
function mapEventPropToEvent(eventProp) {
|
|
11
10
|
return eventProp.substring(2).toLowerCase();
|
|
12
11
|
}
|
|
@@ -136,9 +135,7 @@ function ClickAwayListener(props) {
|
|
|
136
135
|
}
|
|
137
136
|
return undefined;
|
|
138
137
|
}, [handleClickAway, mouseEvent]);
|
|
139
|
-
return /*#__PURE__*/
|
|
140
|
-
children: /*#__PURE__*/React.cloneElement(children, childrenProps)
|
|
141
|
-
});
|
|
138
|
+
return /*#__PURE__*/React.cloneElement(children, childrenProps);
|
|
142
139
|
}
|
|
143
140
|
process.env.NODE_ENV !== "production" ? ClickAwayListener.propTypes /* remove-proptypes */ = {
|
|
144
141
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -310,7 +310,7 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
|
|
|
310
310
|
root: RootSlot,
|
|
311
311
|
input: InputSlot
|
|
312
312
|
},
|
|
313
|
-
|
|
313
|
+
slotProps: componentsProps,
|
|
314
314
|
fullWidth: fullWidth,
|
|
315
315
|
inputComponent: inputComponent,
|
|
316
316
|
multiline: multiline,
|
|
@@ -120,6 +120,7 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
|
|
|
120
120
|
children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
121
121
|
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
122
122
|
className: "notranslate",
|
|
123
|
+
"aria-hidden": true,
|
|
123
124
|
children: "\u200B"
|
|
124
125
|
})) : children
|
|
125
126
|
});
|
package/Grid2/Grid2.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SxProps, SystemProps } from '@mui/system';
|
|
2
2
|
import { OverridableComponent, OverrideProps } from '@mui/types';
|
|
3
3
|
import { Theme, Breakpoint } from '../styles';
|
|
4
|
-
export type Grid2Slot = 'root';
|
|
5
4
|
type ResponsiveStyleValue<T> = T | Array<T | null> | {
|
|
6
5
|
[key in Breakpoint]?: T | null;
|
|
7
6
|
};
|
package/Grid2/Grid2.js
CHANGED
|
@@ -5,6 +5,7 @@ import { createGrid as createGrid2 } from '@mui/system/Grid';
|
|
|
5
5
|
import requirePropFactory from "../utils/requirePropFactory.js";
|
|
6
6
|
import { styled } from "../styles/index.js";
|
|
7
7
|
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
8
|
+
import useTheme from "../styles/useTheme.js";
|
|
8
9
|
/**
|
|
9
10
|
*
|
|
10
11
|
* Demos:
|
|
@@ -19,13 +20,19 @@ const Grid2 = createGrid2({
|
|
|
19
20
|
createStyledComponent: styled('div', {
|
|
20
21
|
name: 'MuiGrid2',
|
|
21
22
|
slot: 'Root',
|
|
22
|
-
overridesResolver: (props, styles) =>
|
|
23
|
+
overridesResolver: (props, styles) => {
|
|
24
|
+
const {
|
|
25
|
+
ownerState
|
|
26
|
+
} = props;
|
|
27
|
+
return [styles.root, ownerState.container && styles.container];
|
|
28
|
+
}
|
|
23
29
|
}),
|
|
24
30
|
componentName: 'MuiGrid2',
|
|
25
31
|
useThemeProps: inProps => useDefaultProps({
|
|
26
32
|
props: inProps,
|
|
27
33
|
name: 'MuiGrid2'
|
|
28
|
-
})
|
|
34
|
+
}),
|
|
35
|
+
useTheme
|
|
29
36
|
});
|
|
30
37
|
process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ = {
|
|
31
38
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
package/Grid2/grid2Classes.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface Grid2Classes {
|
|
2
|
+
/** Styles applied to the root element. */
|
|
3
|
+
root: string;
|
|
4
|
+
/** Styles applied to the root element if `container={true}`. */
|
|
5
|
+
container: string;
|
|
6
|
+
}
|
|
7
|
+
export type Grid2ClassKey = keyof Grid2Classes;
|
|
3
8
|
export declare function getGrid2UtilityClass(slot: string): string;
|
|
4
|
-
declare const grid2Classes:
|
|
9
|
+
declare const grid2Classes: Grid2Classes;
|
|
5
10
|
export default grid2Classes;
|
package/Hidden/HiddenJs.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import * as React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import exactProp from '@mui/utils/exactProp';
|
|
6
5
|
import withWidth, { isWidthDown, isWidthUp } from "./withWidth.js";
|
|
@@ -9,7 +8,6 @@ import useTheme from "../styles/useTheme.js";
|
|
|
9
8
|
/**
|
|
10
9
|
* @ignore - internal component.
|
|
11
10
|
*/
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
11
|
function HiddenJs(props) {
|
|
14
12
|
const {
|
|
15
13
|
children,
|
|
@@ -50,11 +48,9 @@ function HiddenJs(props) {
|
|
|
50
48
|
if (!visible) {
|
|
51
49
|
return null;
|
|
52
50
|
}
|
|
53
|
-
return
|
|
54
|
-
children: children
|
|
55
|
-
});
|
|
51
|
+
return children;
|
|
56
52
|
}
|
|
57
|
-
|
|
53
|
+
HiddenJs.propTypes = {
|
|
58
54
|
/**
|
|
59
55
|
* The content of the component.
|
|
60
56
|
*/
|
|
@@ -118,8 +114,8 @@ process.env.NODE_ENV !== "production" ? HiddenJs.propTypes = {
|
|
|
118
114
|
*/
|
|
119
115
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
120
116
|
xsUp: PropTypes.bool
|
|
121
|
-
}
|
|
117
|
+
};
|
|
122
118
|
if (process.env.NODE_ENV !== 'production') {
|
|
123
|
-
|
|
119
|
+
HiddenJs.propTypes = exactProp(HiddenJs.propTypes);
|
|
124
120
|
}
|
|
125
121
|
export default withWidth()(HiddenJs);
|
|
@@ -128,6 +128,7 @@ const InputAdornment = /*#__PURE__*/React.forwardRef(function InputAdornment(inP
|
|
|
128
128
|
}) : /*#__PURE__*/_jsxs(React.Fragment, {
|
|
129
129
|
children: [position === 'start' ? (/* notranslate needed while Google Translate will not fix zero-width space issue */_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
130
130
|
className: "notranslate",
|
|
131
|
+
"aria-hidden": true,
|
|
131
132
|
children: "\u200B"
|
|
132
133
|
}))) : null, children]
|
|
133
134
|
})
|
package/Modal/useModal.js
CHANGED
|
@@ -10,6 +10,7 @@ function getContainer(container) {
|
|
|
10
10
|
function getHasTransition(children) {
|
|
11
11
|
return children ? children.props.hasOwnProperty('in') : false;
|
|
12
12
|
}
|
|
13
|
+
const noop = () => {};
|
|
13
14
|
|
|
14
15
|
// A modal manager used to track and manage the state of open Modals.
|
|
15
16
|
// Modals don't open on the server so this won't conflict with concurrent requests.
|
|
@@ -181,8 +182,8 @@ function useModal(parameters) {
|
|
|
181
182
|
}
|
|
182
183
|
};
|
|
183
184
|
return {
|
|
184
|
-
onEnter: createChainedFunction(handleEnter, children?.props.onEnter),
|
|
185
|
-
onExited: createChainedFunction(handleExited, children?.props.onExited)
|
|
185
|
+
onEnter: createChainedFunction(handleEnter, children?.props.onEnter ?? noop),
|
|
186
|
+
onExited: createChainedFunction(handleExited, children?.props.onExited ?? noop)
|
|
186
187
|
};
|
|
187
188
|
};
|
|
188
189
|
return {
|
|
@@ -17,7 +17,11 @@ export type UseModalParameters = {
|
|
|
17
17
|
/**
|
|
18
18
|
* A single child content element.
|
|
19
19
|
*/
|
|
20
|
-
children: React.ReactElement<
|
|
20
|
+
children: React.ReactElement<{
|
|
21
|
+
in?: boolean;
|
|
22
|
+
onEnter?: (this: unknown) => void;
|
|
23
|
+
onExited?: (this: unknown) => void;
|
|
24
|
+
}> | undefined | null;
|
|
21
25
|
/**
|
|
22
26
|
* When set to true the Modal waits until a nested Transition is completed before closing.
|
|
23
27
|
* @default false
|
package/NoSsr/NoSsr.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { exactProp, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
6
|
/**
|
|
8
7
|
* NoSsr purposely removes components from the subject of Server Side Rendering (SSR).
|
|
9
8
|
*
|
|
@@ -40,10 +39,8 @@ function NoSsr(props) {
|
|
|
40
39
|
}
|
|
41
40
|
}, [defer]);
|
|
42
41
|
|
|
43
|
-
//
|
|
44
|
-
return
|
|
45
|
-
children: mountedState ? children : fallback
|
|
46
|
-
});
|
|
42
|
+
// TODO casting won't be needed at one point https://github.com/DefinitelyTyped/DefinitelyTyped/pull/65135
|
|
43
|
+
return mountedState ? children : fallback;
|
|
47
44
|
}
|
|
48
45
|
process.env.NODE_ENV !== "production" ? NoSsr.propTypes /* remove-proptypes */ = {
|
|
49
46
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -120,6 +120,7 @@ export default function NotchedOutline(props) {
|
|
|
120
120
|
}) : // notranslate needed while Google Translate will not fix zero-width space issue
|
|
121
121
|
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
122
122
|
className: "notranslate",
|
|
123
|
+
"aria-hidden": true,
|
|
123
124
|
children: "\u200B"
|
|
124
125
|
}))
|
|
125
126
|
})
|
package/Portal/Portal.js
CHANGED
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import * as ReactDOM from 'react-dom';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { exactProp, HTMLElementType, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useForkRef as useForkRef, unstable_setRef as setRef, unstable_getReactElementRef as getReactElementRef } from '@mui/utils';
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
7
|
function getContainer(container) {
|
|
9
8
|
return typeof container === 'function' ? container() : container;
|
|
10
9
|
}
|
|
@@ -50,13 +49,9 @@ const Portal = /*#__PURE__*/React.forwardRef(function Portal(props, forwardedRef
|
|
|
50
49
|
};
|
|
51
50
|
return /*#__PURE__*/React.cloneElement(children, newProps);
|
|
52
51
|
}
|
|
53
|
-
return
|
|
54
|
-
children: children
|
|
55
|
-
});
|
|
52
|
+
return children;
|
|
56
53
|
}
|
|
57
|
-
return /*#__PURE__*/
|
|
58
|
-
children: mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode
|
|
59
|
-
});
|
|
54
|
+
return mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode;
|
|
60
55
|
});
|
|
61
56
|
process.env.NODE_ENV !== "production" ? Portal.propTypes /* remove-proptypes */ = {
|
|
62
57
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
package/Select/Select.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { FilledInputProps } from '../FilledInput';
|
|
|
11
11
|
export { SelectChangeEvent };
|
|
12
12
|
|
|
13
13
|
export interface BaseSelectProps<Value = unknown>
|
|
14
|
-
extends StandardProps<InputProps, 'value' | 'onChange'> {
|
|
14
|
+
extends StandardProps<InputProps, 'value' | 'onChange' | 'placeholder'> {
|
|
15
15
|
/**
|
|
16
16
|
* If `true`, the width of the popover will automatically be set according to the items inside the
|
|
17
17
|
* menu, otherwise it will be at least the width of the select input.
|
|
@@ -152,7 +152,10 @@ export interface BaseSelectProps<Value = unknown>
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
export interface FilledSelectProps
|
|
155
|
-
extends Omit<
|
|
155
|
+
extends Omit<
|
|
156
|
+
FilledInputProps,
|
|
157
|
+
'value' | 'onChange' | 'id' | 'classes' | 'inputProps' | 'placeholder'
|
|
158
|
+
> {
|
|
156
159
|
/**
|
|
157
160
|
* The variant to use.
|
|
158
161
|
* @default 'outlined'
|
|
@@ -161,7 +164,7 @@ export interface FilledSelectProps
|
|
|
161
164
|
}
|
|
162
165
|
|
|
163
166
|
export interface StandardSelectProps
|
|
164
|
-
extends Omit<InputProps, 'value' | 'onChange' | 'id' | 'classes' | 'inputProps'> {
|
|
167
|
+
extends Omit<InputProps, 'value' | 'onChange' | 'id' | 'classes' | 'inputProps' | 'placeholder'> {
|
|
165
168
|
/**
|
|
166
169
|
* The variant to use.
|
|
167
170
|
* @default 'outlined'
|
|
@@ -170,7 +173,10 @@ export interface StandardSelectProps
|
|
|
170
173
|
}
|
|
171
174
|
|
|
172
175
|
export interface OutlinedSelectProps
|
|
173
|
-
extends Omit<
|
|
176
|
+
extends Omit<
|
|
177
|
+
OutlinedInputProps,
|
|
178
|
+
'value' | 'onChange' | 'id' | 'classes' | 'inputProps' | 'placeholder'
|
|
179
|
+
> {
|
|
174
180
|
/**
|
|
175
181
|
* The variant to use.
|
|
176
182
|
* @default 'outlined'
|
package/Select/SelectInput.js
CHANGED
|
@@ -462,6 +462,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
462
462
|
children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
463
463
|
_span || (_span = /*#__PURE__*/_jsx("span", {
|
|
464
464
|
className: "notranslate",
|
|
465
|
+
"aria-hidden": true,
|
|
465
466
|
children: "\u200B"
|
|
466
467
|
})) : display
|
|
467
468
|
}), /*#__PURE__*/_jsx(SelectNativeInput, {
|
|
@@ -3,7 +3,10 @@ import { SliderValueLabelProps } from './SliderValueLabel.types';
|
|
|
3
3
|
/**
|
|
4
4
|
* @ignore - internal component.
|
|
5
5
|
*/
|
|
6
|
-
declare function SliderValueLabel(props: SliderValueLabelProps): React.ReactElement<
|
|
6
|
+
declare function SliderValueLabel(props: SliderValueLabelProps): React.ReactElement<{
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}, string | React.JSXElementConstructor<any>> | null;
|
|
7
10
|
declare namespace SliderValueLabel {
|
|
8
11
|
var propTypes: any;
|
|
9
12
|
}
|
package/Tabs/ScrollbarSize.js
CHANGED
|
@@ -49,8 +49,8 @@ export default function ScrollbarSize(props) {
|
|
|
49
49
|
}, [onChange]);
|
|
50
50
|
return /*#__PURE__*/_jsx("div", {
|
|
51
51
|
style: styles,
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
...other,
|
|
53
|
+
ref: nodeRef
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
process.env.NODE_ENV !== "production" ? ScrollbarSize.propTypes = {
|
|
@@ -23,7 +23,10 @@ export interface FocusTrapProps {
|
|
|
23
23
|
/**
|
|
24
24
|
* A single child content element.
|
|
25
25
|
*/
|
|
26
|
-
children: React.ReactElement<
|
|
26
|
+
children: React.ReactElement<{
|
|
27
|
+
onFocus?: React.FocusEventHandler;
|
|
28
|
+
ref?: React.RefCallback<any> | null;
|
|
29
|
+
}>;
|
|
27
30
|
/**
|
|
28
31
|
* If `true`, the focus trap will not automatically shift focus to itself when it opens, and
|
|
29
32
|
* replace it to the last focused element when it closes.
|
package/index.js
CHANGED
package/modern/Avatar/Avatar.js
CHANGED
|
@@ -161,21 +161,22 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(inProps, ref) {
|
|
|
161
161
|
...other
|
|
162
162
|
} = props;
|
|
163
163
|
let children = null;
|
|
164
|
+
const ownerState = {
|
|
165
|
+
...props,
|
|
166
|
+
component,
|
|
167
|
+
variant
|
|
168
|
+
};
|
|
164
169
|
|
|
165
170
|
// Use a hook instead of onError on the img element to support server-side rendering.
|
|
166
171
|
const loaded = useLoaded({
|
|
167
172
|
...imgProps,
|
|
173
|
+
...(typeof slotProps.img === 'function' ? slotProps.img(ownerState) : slotProps.img),
|
|
168
174
|
src,
|
|
169
175
|
srcSet
|
|
170
176
|
});
|
|
171
177
|
const hasImg = src || srcSet;
|
|
172
178
|
const hasImgNotFailing = hasImg && loaded !== 'error';
|
|
173
|
-
|
|
174
|
-
...props,
|
|
175
|
-
colorDefault: !hasImgNotFailing,
|
|
176
|
-
component,
|
|
177
|
-
variant
|
|
178
|
-
};
|
|
179
|
+
ownerState.colorDefault = !hasImgNotFailing;
|
|
179
180
|
// This issue explains why this is required: https://github.com/mui/material-ui/issues/42184
|
|
180
181
|
delete ownerState.ownerState;
|
|
181
182
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -136,34 +136,22 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
136
136
|
ripple.pulsate();
|
|
137
137
|
}
|
|
138
138
|
}, [disableRipple, focusRipple, focusVisible, ripple]);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const ignore = skipRippleAction;
|
|
145
|
-
if (!ignore) {
|
|
146
|
-
ripple[rippleAction](event);
|
|
147
|
-
}
|
|
148
|
-
return true;
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
const handleMouseDown = useRippleHandler('start', onMouseDown);
|
|
152
|
-
const handleContextMenu = useRippleHandler('stop', onContextMenu);
|
|
153
|
-
const handleDragLeave = useRippleHandler('stop', onDragLeave);
|
|
154
|
-
const handleMouseUp = useRippleHandler('stop', onMouseUp);
|
|
155
|
-
const handleMouseLeave = useRippleHandler('stop', event => {
|
|
139
|
+
const handleMouseDown = useRippleHandler(ripple, 'start', onMouseDown, disableTouchRipple);
|
|
140
|
+
const handleContextMenu = useRippleHandler(ripple, 'stop', onContextMenu, disableTouchRipple);
|
|
141
|
+
const handleDragLeave = useRippleHandler(ripple, 'stop', onDragLeave, disableTouchRipple);
|
|
142
|
+
const handleMouseUp = useRippleHandler(ripple, 'stop', onMouseUp, disableTouchRipple);
|
|
143
|
+
const handleMouseLeave = useRippleHandler(ripple, 'stop', event => {
|
|
156
144
|
if (focusVisible) {
|
|
157
145
|
event.preventDefault();
|
|
158
146
|
}
|
|
159
147
|
if (onMouseLeave) {
|
|
160
148
|
onMouseLeave(event);
|
|
161
149
|
}
|
|
162
|
-
});
|
|
163
|
-
const handleTouchStart = useRippleHandler('start', onTouchStart);
|
|
164
|
-
const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
|
|
165
|
-
const handleTouchMove = useRippleHandler('stop', onTouchMove);
|
|
166
|
-
const handleBlur = useRippleHandler('stop', event => {
|
|
150
|
+
}, disableTouchRipple);
|
|
151
|
+
const handleTouchStart = useRippleHandler(ripple, 'start', onTouchStart, disableTouchRipple);
|
|
152
|
+
const handleTouchEnd = useRippleHandler(ripple, 'stop', onTouchEnd, disableTouchRipple);
|
|
153
|
+
const handleTouchMove = useRippleHandler(ripple, 'stop', onTouchMove, disableTouchRipple);
|
|
154
|
+
const handleBlur = useRippleHandler(ripple, 'stop', event => {
|
|
167
155
|
if (!isFocusVisible(event.target)) {
|
|
168
156
|
setFocusVisible(false);
|
|
169
157
|
}
|
|
@@ -287,6 +275,17 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
287
275
|
}) : null]
|
|
288
276
|
});
|
|
289
277
|
});
|
|
278
|
+
function useRippleHandler(ripple, rippleAction, eventCallback, skipRippleAction = false) {
|
|
279
|
+
return useEventCallback(event => {
|
|
280
|
+
if (eventCallback) {
|
|
281
|
+
eventCallback(event);
|
|
282
|
+
}
|
|
283
|
+
if (!skipRippleAction) {
|
|
284
|
+
ripple[rippleAction](event);
|
|
285
|
+
}
|
|
286
|
+
return true;
|
|
287
|
+
});
|
|
288
|
+
}
|
|
290
289
|
process.env.NODE_ENV !== "production" ? ButtonBase.propTypes /* remove-proptypes */ = {
|
|
291
290
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
292
291
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
@@ -6,7 +6,6 @@ import { elementAcceptingRef, exactProp, unstable_ownerDocument as ownerDocument
|
|
|
6
6
|
import getReactElementRef from '@mui/utils/getReactElementRef';
|
|
7
7
|
|
|
8
8
|
// TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase<EventName> : never` once generatePropTypes runs with TS 4.1
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
9
|
function mapEventPropToEvent(eventProp) {
|
|
11
10
|
return eventProp.substring(2).toLowerCase();
|
|
12
11
|
}
|
|
@@ -136,9 +135,7 @@ function ClickAwayListener(props) {
|
|
|
136
135
|
}
|
|
137
136
|
return undefined;
|
|
138
137
|
}, [handleClickAway, mouseEvent]);
|
|
139
|
-
return /*#__PURE__*/
|
|
140
|
-
children: /*#__PURE__*/React.cloneElement(children, childrenProps)
|
|
141
|
-
});
|
|
138
|
+
return /*#__PURE__*/React.cloneElement(children, childrenProps);
|
|
142
139
|
}
|
|
143
140
|
process.env.NODE_ENV !== "production" ? ClickAwayListener.propTypes /* remove-proptypes */ = {
|
|
144
141
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|