@mui/material 6.1.9 → 6.2.0
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/Box/Box.d.ts +3 -1
- package/ButtonBase/ButtonBase.js +21 -22
- package/CHANGELOG.md +82 -0
- package/ClickAwayListener/ClickAwayListener.js +1 -4
- package/FilledInput/FilledInput.js +1 -1
- package/FormHelperText/FormHelperText.js +1 -0
- package/Grid/Grid.js +2 -2
- package/Grid2/Grid2.js +9 -2
- package/Hidden/HiddenJs.js +4 -8
- package/InputAdornment/InputAdornment.js +1 -0
- package/ListItemText/ListItemText.d.ts +36 -1
- package/ListItemText/ListItemText.js +46 -7
- 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/PigmentGrid/PigmentGrid.js +1 -1
- package/Portal/Portal.js +2 -7
- package/Select/SelectInput.js +1 -0
- package/Slider/SliderValueLabel.d.ts +4 -1
- package/Slider/SliderValueLabel.types.d.ts +4 -1
- package/Slider/useSlider.js +64 -10
- 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/Grid/Grid.js +2 -2
- package/modern/Grid2/Grid2.js +9 -2
- package/modern/Hidden/HiddenJs.js +4 -8
- package/modern/InputAdornment/InputAdornment.js +1 -0
- package/modern/ListItemText/ListItemText.js +46 -7
- package/modern/Modal/useModal.js +3 -2
- package/modern/NoSsr/NoSsr.js +2 -5
- package/modern/OutlinedInput/NotchedOutline.js +1 -0
- package/modern/PigmentGrid/PigmentGrid.js +1 -1
- package/modern/Portal/Portal.js +2 -7
- package/modern/Select/SelectInput.js +1 -0
- package/modern/Slider/useSlider.js +64 -10
- 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 +3 -3
- 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/Grid/Grid.js +2 -2
- package/node/Grid2/Grid2.js +9 -2
- package/node/Hidden/HiddenJs.js +7 -10
- package/node/InputAdornment/InputAdornment.js +1 -0
- package/node/ListItemText/ListItemText.js +46 -7
- package/node/Modal/useModal.js +3 -2
- package/node/NoSsr/NoSsr.js +2 -5
- package/node/OutlinedInput/NotchedOutline.js +1 -0
- package/node/PigmentGrid/PigmentGrid.js +2 -2
- package/node/Portal/Portal.js +2 -7
- package/node/Select/SelectInput.js +1 -0
- package/node/Slider/useSlider.js +64 -10
- 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 +3 -3
- package/package.json +7 -7
- package/styles/createThemeWithVars.js +2 -2
- package/useLazyRipple/useLazyRipple.d.ts +1 -1
- package/utils/memoTheme.d.ts +1 -1
- package/utils/useSlot.d.ts +0 -7
- package/utils/useSlot.js +1 -10
- package/version/index.js +3 -3
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/Box/Box.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ declare const Box: OverridableComponent<BoxTypeMap<{}, 'div', MaterialTheme>>;
|
|
|
18
18
|
export type BoxProps<
|
|
19
19
|
RootComponent extends React.ElementType = BoxTypeMap['defaultComponent'],
|
|
20
20
|
AdditionalProps = {},
|
|
21
|
-
> = OverrideProps<BoxTypeMap<AdditionalProps, RootComponent, MaterialTheme>, RootComponent
|
|
21
|
+
> = OverrideProps<BoxTypeMap<AdditionalProps, RootComponent, MaterialTheme>, RootComponent> & {
|
|
22
|
+
component?: React.ElementType;
|
|
23
|
+
};
|
|
22
24
|
|
|
23
25
|
export default Box;
|
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,87 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 6.2.0
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v6.1.10..master -->
|
|
6
|
+
|
|
7
|
+
_Dec 10, 2024_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- Material UI is now compatible with React 19 (#44672) @DiegoAndai
|
|
12
|
+
- Fixed incorrect `aria-orientation` for vertical sliders. <kbd>ArrowRight</kbd> now increases the value and <kbd>ArrowLeft</kbd> decreases the value in vertical sliders; they were reversed in prior versions. (#44537) @mj12albert
|
|
13
|
+
|
|
14
|
+
### `@mui/material@6.2.0`
|
|
15
|
+
|
|
16
|
+
- [Box] Add missing `component` to `BoxProps` type (#44643) @DiegoAndai
|
|
17
|
+
- [Grid] Fix spacing when using css variables (#44663) @DiegoAndai
|
|
18
|
+
- [ListItemText] Add `slots` and `slotProps` (#44571) @sai6855
|
|
19
|
+
|
|
20
|
+
### Docs
|
|
21
|
+
|
|
22
|
+
- Add Toolpad Core template link (#44415) @bharatkashyap
|
|
23
|
+
|
|
24
|
+
### Core
|
|
25
|
+
|
|
26
|
+
- [docs-infra] Allow custom annotations (#44707) @vladmoroz
|
|
27
|
+
- [Box] Fix `component` prop test (#44651) @DiegoAndai
|
|
28
|
+
- React 19 useRef cleanup (#44704) @DiegoAndai
|
|
29
|
+
- Remove obselete lerna options (#44676) @ZeeshanTamboli
|
|
30
|
+
- Fix Regular Expression Denial of Service (ReDoS) vulnerabilities (#44627) @SuperMaxine
|
|
31
|
+
- Fix number of contributors (#44650) @aarongarciah
|
|
32
|
+
- [docs-infra] Add support for data attributes in the API generation (#44709) @mnajdova
|
|
33
|
+
- [docs-infra] Fix RTL dark mode (#41803) @alexfauquette
|
|
34
|
+
- [Grid] Remove deeply nested imports (#43605) @Janpot
|
|
35
|
+
|
|
36
|
+
All contributors of this release in alphabetical order: @aarongarciah, @alexfauquette, @bharatkashyap, @DiegoAndai, @Janpot, @mj12albert, @mnajdova, @sai6855, @SuperMaxine, @vladmoroz, @ZeeshanTamboli
|
|
37
|
+
|
|
38
|
+
## 6.1.10
|
|
39
|
+
|
|
40
|
+
<!-- generated comparing v6.1.9..master -->
|
|
41
|
+
|
|
42
|
+
_Dec 3, 2024_
|
|
43
|
+
|
|
44
|
+
A big thanks to the 11 contributors who made this release possible.
|
|
45
|
+
|
|
46
|
+
### `@mui/material@6.1.10`
|
|
47
|
+
|
|
48
|
+
- [Avatar] Fix `slotProps.img` not spread to hook (#44536) @siriwatknp
|
|
49
|
+
- [FilledInput] Use `slotProps` instead of `componentsProps` (#44552) @siriwatknp
|
|
50
|
+
- [Grid2] Fix theme scoping error (#44599) @siriwatknp
|
|
51
|
+
- [Grid2] Add container styles from styleOverrides (#44598) @sai6855
|
|
52
|
+
- Skip `tonalOffset` from setting color channel (#44585) @siriwatknp
|
|
53
|
+
- Remove few more React.ReactElement<any> types (#44290) @sai6855
|
|
54
|
+
- [Tabs] Fix `ScrollbarSize` ref being overriden (#44593) @DiegoAndai
|
|
55
|
+
- [Select][TextField] Fix screen reader from saying `&ZeroWidthSpace` (#44631) @arishoham
|
|
56
|
+
|
|
57
|
+
### `@mui/system@6.1.10`
|
|
58
|
+
|
|
59
|
+
- [ThemeProvider] Optimize `theme` changes when enabling CSS theme variables (#44588) @siriwatknp
|
|
60
|
+
|
|
61
|
+
### Docs
|
|
62
|
+
|
|
63
|
+
- Notification for the MUI X v8 alpha zero announcement blog post (#44629) @joserodolfofreitas
|
|
64
|
+
- Bump React Router to ^7.0.1 (#44531) @oliviertassinari
|
|
65
|
+
- [material-ui] Replace testid with id in migration guide (#44636) @sai6855
|
|
66
|
+
- [material-ui][TextField] Update usage of `InputLabelProps` in docs (#44634) @sai6855
|
|
67
|
+
- [material-ui][ListItem] Add missing diffs in migration guide (#44638) @sai6855
|
|
68
|
+
- [examples] Use Next.js 14 on examples (#44486) @DiegoAndai
|
|
69
|
+
- Update links and sidebar nav for Base UI components in Material UI (#44581) @samuelsycamore
|
|
70
|
+
|
|
71
|
+
### Core
|
|
72
|
+
|
|
73
|
+
- Remove `getSlotOwnerState` from `useSlot` util (#44403) @ZeeshanTamboli
|
|
74
|
+
- Extract useRippleHandler outside of ButtonBase (#44591) @albarv340
|
|
75
|
+
- Update eslint config (#44586) @MBilalShafi
|
|
76
|
+
- [core-infra] Remove useless fragments (#44516) @oliviertassinari
|
|
77
|
+
- [docs-infra] Fix Banner CLS (#44632) @oliviertassinari
|
|
78
|
+
- [docs-infra] Change CSS vars generation to be extracted from Enum (#44587) @mnajdova
|
|
79
|
+
- [docs-infra] Automatically hide Black Friday banner (#44630) @oliviertassinari
|
|
80
|
+
- [docs-infra] Fix TOC RTL padding regression (#44535) @oliviertassinari
|
|
81
|
+
- [test-utils] Remove leftover React.ReactElement<any> from describeConformance.tsx (#44639) @sai6855
|
|
82
|
+
|
|
83
|
+
All contributors of this release in alphabetical order: @albarv340, @arishoham, @DiegoAndai, @joserodolfofreitas, @MBilalShafi, @mnajdova, @oliviertassinari, @sai6855, @samuelsycamore, @siriwatknp, @ZeeshanTamboli
|
|
84
|
+
|
|
3
85
|
## 6.1.9
|
|
4
86
|
|
|
5
87
|
<!-- generated comparing v6.1.8..master -->
|
|
@@ -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/Grid/Grid.js
CHANGED
|
@@ -167,7 +167,7 @@ export function generateRowGap({
|
|
|
167
167
|
const themeSpacing = theme.spacing(propValue);
|
|
168
168
|
if (themeSpacing !== '0px') {
|
|
169
169
|
return {
|
|
170
|
-
marginTop:
|
|
170
|
+
marginTop: `calc(-1 * ${themeSpacing})`,
|
|
171
171
|
[`& > .${gridClasses.item}`]: {
|
|
172
172
|
paddingTop: themeSpacing
|
|
173
173
|
}
|
|
@@ -212,7 +212,7 @@ export function generateColumnGap({
|
|
|
212
212
|
}, columnSpacingValues, (propValue, breakpoint) => {
|
|
213
213
|
const themeSpacing = theme.spacing(propValue);
|
|
214
214
|
if (themeSpacing !== '0px') {
|
|
215
|
-
const negativeValue =
|
|
215
|
+
const negativeValue = `calc(-1 * ${themeSpacing})`;
|
|
216
216
|
return {
|
|
217
217
|
width: `calc(100% + ${themeSpacing})`,
|
|
218
218
|
marginLeft: negativeValue,
|
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/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
|
})
|
|
@@ -3,11 +3,44 @@ import { SxProps } from '@mui/system';
|
|
|
3
3
|
import { InternalStandardProps as StandardProps, Theme } from '..';
|
|
4
4
|
import { TypographyProps } from '../Typography';
|
|
5
5
|
import { ListItemTextClasses } from './listItemTextClasses';
|
|
6
|
+
import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types';
|
|
7
|
+
|
|
8
|
+
export interface ListItemTextSlots {
|
|
9
|
+
/**
|
|
10
|
+
* The component that renders the primary slot.
|
|
11
|
+
* @default Typography
|
|
12
|
+
*/
|
|
13
|
+
primary?: React.ElementType;
|
|
14
|
+
/**
|
|
15
|
+
* The component that renders the secondary slot.
|
|
16
|
+
* @default Typography
|
|
17
|
+
*/
|
|
18
|
+
secondary?: React.ElementType;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type ListItemTextSlotsAndSlotProps = CreateSlotsAndSlotProps<
|
|
22
|
+
ListItemTextSlots,
|
|
23
|
+
{
|
|
24
|
+
/**
|
|
25
|
+
* Props forwared to the primary slot (as long as disableTypography is not `true`)
|
|
26
|
+
* By default, the available props are based on the [Typography](https://mui.com/material-ui/api/typography/#props) component
|
|
27
|
+
*/
|
|
28
|
+
primary: SlotProps<React.ElementType<TypographyProps>, {}, ListItemTextOwnerState>;
|
|
29
|
+
/**
|
|
30
|
+
* Props forwarded to the secondary slot (as long as disableTypography is not `true`)
|
|
31
|
+
* By default, the available props are based on the [Typography](https://mui.com/material-ui/api/typography/#props) component
|
|
32
|
+
*/
|
|
33
|
+
secondary: SlotProps<React.ElementType<TypographyProps>, {}, ListItemTextOwnerState>;
|
|
34
|
+
}
|
|
35
|
+
>;
|
|
36
|
+
|
|
37
|
+
export interface ListItemTextOwnerState extends ListItemTextProps {}
|
|
6
38
|
|
|
7
39
|
export interface ListItemTextProps<
|
|
8
40
|
PrimaryTypographyComponent extends React.ElementType = 'span',
|
|
9
41
|
SecondaryTypographyComponent extends React.ElementType = 'p',
|
|
10
|
-
> extends StandardProps<React.HTMLAttributes<HTMLDivElement
|
|
42
|
+
> extends StandardProps<React.HTMLAttributes<HTMLDivElement>>,
|
|
43
|
+
ListItemTextSlotsAndSlotProps {
|
|
11
44
|
/**
|
|
12
45
|
* Alias for the `primary` prop.
|
|
13
46
|
*/
|
|
@@ -37,6 +70,7 @@ export interface ListItemTextProps<
|
|
|
37
70
|
/**
|
|
38
71
|
* These props will be forwarded to the primary typography component
|
|
39
72
|
* (as long as disableTypography is not `true`).
|
|
73
|
+
* @deprecated Use `slotProps.primary` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
40
74
|
*/
|
|
41
75
|
primaryTypographyProps?: TypographyProps<
|
|
42
76
|
PrimaryTypographyComponent,
|
|
@@ -49,6 +83,7 @@ export interface ListItemTextProps<
|
|
|
49
83
|
/**
|
|
50
84
|
* These props will be forwarded to the secondary typography component
|
|
51
85
|
* (as long as disableTypography is not `true`).
|
|
86
|
+
* @deprecated Use `slotProps.secondary` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
52
87
|
*/
|
|
53
88
|
secondaryTypographyProps?: TypographyProps<
|
|
54
89
|
SecondaryTypographyComponent,
|
|
@@ -9,6 +9,7 @@ import ListContext from "../List/ListContext.js";
|
|
|
9
9
|
import { styled } from "../zero-styled/index.js";
|
|
10
10
|
import { useDefaultProps } from "../DefaultPropsProvider/index.js";
|
|
11
11
|
import listItemTextClasses, { getListItemTextUtilityClass } from "./listItemTextClasses.js";
|
|
12
|
+
import useSlot from "../utils/useSlot.js";
|
|
12
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
14
|
const useUtilityClasses = ownerState => {
|
|
14
15
|
const {
|
|
@@ -80,6 +81,8 @@ const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps
|
|
|
80
81
|
primaryTypographyProps,
|
|
81
82
|
secondary: secondaryProp,
|
|
82
83
|
secondaryTypographyProps,
|
|
84
|
+
slots = {},
|
|
85
|
+
slotProps = {},
|
|
83
86
|
...other
|
|
84
87
|
} = props;
|
|
85
88
|
const {
|
|
@@ -96,21 +99,39 @@ const ListItemText = /*#__PURE__*/React.forwardRef(function ListItemText(inProps
|
|
|
96
99
|
dense
|
|
97
100
|
};
|
|
98
101
|
const classes = useUtilityClasses(ownerState);
|
|
102
|
+
const externalForwardedProps = {
|
|
103
|
+
slots,
|
|
104
|
+
slotProps: {
|
|
105
|
+
primary: primaryTypographyProps,
|
|
106
|
+
secondary: secondaryTypographyProps,
|
|
107
|
+
...slotProps
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
const [PrimarySlot, primarySlotProps] = useSlot('primary', {
|
|
111
|
+
className: classes.primary,
|
|
112
|
+
elementType: Typography,
|
|
113
|
+
externalForwardedProps,
|
|
114
|
+
ownerState
|
|
115
|
+
});
|
|
116
|
+
const [SecondarySlot, secondarySlotProps] = useSlot('secondary', {
|
|
117
|
+
className: classes.secondary,
|
|
118
|
+
elementType: Typography,
|
|
119
|
+
externalForwardedProps,
|
|
120
|
+
ownerState
|
|
121
|
+
});
|
|
99
122
|
if (primary != null && primary.type !== Typography && !disableTypography) {
|
|
100
|
-
primary = /*#__PURE__*/_jsx(
|
|
123
|
+
primary = /*#__PURE__*/_jsx(PrimarySlot, {
|
|
101
124
|
variant: dense ? 'body2' : 'body1',
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
...primaryTypographyProps,
|
|
125
|
+
component: primarySlotProps?.variant ? undefined : 'span',
|
|
126
|
+
...primarySlotProps,
|
|
105
127
|
children: primary
|
|
106
128
|
});
|
|
107
129
|
}
|
|
108
130
|
if (secondary != null && secondary.type !== Typography && !disableTypography) {
|
|
109
|
-
secondary = /*#__PURE__*/_jsx(
|
|
131
|
+
secondary = /*#__PURE__*/_jsx(SecondarySlot, {
|
|
110
132
|
variant: "body2",
|
|
111
|
-
className: classes.secondary,
|
|
112
133
|
color: "textSecondary",
|
|
113
|
-
...
|
|
134
|
+
...secondarySlotProps,
|
|
114
135
|
children: secondary
|
|
115
136
|
});
|
|
116
137
|
}
|
|
@@ -160,6 +181,7 @@ process.env.NODE_ENV !== "production" ? ListItemText.propTypes /* remove-proptyp
|
|
|
160
181
|
/**
|
|
161
182
|
* These props will be forwarded to the primary typography component
|
|
162
183
|
* (as long as disableTypography is not `true`).
|
|
184
|
+
* @deprecated Use `slotProps.primary` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
163
185
|
*/
|
|
164
186
|
primaryTypographyProps: PropTypes.object,
|
|
165
187
|
/**
|
|
@@ -169,8 +191,25 @@ process.env.NODE_ENV !== "production" ? ListItemText.propTypes /* remove-proptyp
|
|
|
169
191
|
/**
|
|
170
192
|
* These props will be forwarded to the secondary typography component
|
|
171
193
|
* (as long as disableTypography is not `true`).
|
|
194
|
+
* @deprecated Use `slotProps.secondary` instead. This prop will be removed in v7. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
|
|
172
195
|
*/
|
|
173
196
|
secondaryTypographyProps: PropTypes.object,
|
|
197
|
+
/**
|
|
198
|
+
* The props used for each slot inside.
|
|
199
|
+
* @default {}
|
|
200
|
+
*/
|
|
201
|
+
slotProps: PropTypes.shape({
|
|
202
|
+
primary: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
203
|
+
secondary: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
204
|
+
}),
|
|
205
|
+
/**
|
|
206
|
+
* The components used for each slot inside.
|
|
207
|
+
* @default {}
|
|
208
|
+
*/
|
|
209
|
+
slots: PropTypes.shape({
|
|
210
|
+
primary: PropTypes.elementType,
|
|
211
|
+
secondary: PropTypes.elementType
|
|
212
|
+
}),
|
|
174
213
|
/**
|
|
175
214
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
176
215
|
*/
|
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
|
})
|
|
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import Grid from '@mui/material-pigment-css/Grid';
|
|
6
6
|
import composeClasses from '@mui/utils/composeClasses';
|
|
7
7
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
8
|
-
import { generateDirectionClasses, generateSizeClassNames, generateSpacingClassNames } from '@mui/system/Grid
|
|
8
|
+
import { unstable_generateDirectionClasses as generateDirectionClasses, unstable_generateSizeClassNames as generateSizeClassNames, unstable_generateSpacingClassNames as generateSpacingClassNames } from '@mui/system/Grid';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
const useUtilityClasses = ownerState => {
|
|
11
11
|
const {
|
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/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
|
}
|