@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
|
@@ -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/modern/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 ──────────────────────────────┐
|
|
@@ -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/modern/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 {
|
package/modern/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/modern/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 ──────────────────────────────┐
|
|
@@ -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, {
|
|
@@ -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 = {
|
package/modern/index.js
CHANGED
|
@@ -23,7 +23,7 @@ function setColor(obj, key, defaultValue) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
function toRgb(color) {
|
|
26
|
-
if (
|
|
26
|
+
if (typeof color !== 'string' || !color.startsWith('hsl')) {
|
|
27
27
|
return color;
|
|
28
28
|
}
|
|
29
29
|
return hslToRgb(color);
|
|
@@ -315,7 +315,7 @@ export default function createThemeWithVars(options = {}, ...args) {
|
|
|
315
315
|
|
|
316
316
|
// The default palettes (primary, secondary, error, info, success, and warning) errors are handled by the above `createTheme(...)`.
|
|
317
317
|
|
|
318
|
-
if (colors && typeof colors === 'object') {
|
|
318
|
+
if (color !== 'tonalOffset' && colors && typeof colors === 'object') {
|
|
319
319
|
// Silent the error for custom palettes.
|
|
320
320
|
if (colors.main) {
|
|
321
321
|
setColor(palette[color], 'mainChannel', safeColorChannel(toRgb(colors.main)));
|
package/modern/utils/useSlot.js
CHANGED
|
@@ -31,7 +31,6 @@ name, parameters) {
|
|
|
31
31
|
elementType: initialElementType,
|
|
32
32
|
ownerState,
|
|
33
33
|
externalForwardedProps,
|
|
34
|
-
getSlotOwnerState,
|
|
35
34
|
internalForwardedProps,
|
|
36
35
|
...useSlotPropsParams
|
|
37
36
|
} = parameters;
|
|
@@ -63,11 +62,6 @@ name, parameters) {
|
|
|
63
62
|
externalSlotProps: resolvedComponentsProps
|
|
64
63
|
});
|
|
65
64
|
const ref = useForkRef(internalRef, resolvedComponentsProps?.ref, parameters.ref);
|
|
66
|
-
const slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {};
|
|
67
|
-
const finalOwnerState = {
|
|
68
|
-
...ownerState,
|
|
69
|
-
...slotOwnerState
|
|
70
|
-
};
|
|
71
65
|
const LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent;
|
|
72
66
|
const props = appendOwnerState(elementType, {
|
|
73
67
|
...(name === 'root' && !rootComponent && !slots[name] && internalForwardedProps),
|
|
@@ -77,9 +71,6 @@ name, parameters) {
|
|
|
77
71
|
as: LeafComponent
|
|
78
72
|
}),
|
|
79
73
|
ref
|
|
80
|
-
},
|
|
81
|
-
Object.keys(slotOwnerState).forEach(propName => {
|
|
82
|
-
delete props[propName];
|
|
83
|
-
});
|
|
74
|
+
}, ownerState);
|
|
84
75
|
return [elementType, props];
|
|
85
76
|
}
|
package/modern/version/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export const version = "6.1.
|
|
1
|
+
export const version = "6.1.10";
|
|
2
2
|
export const major = Number("6");
|
|
3
3
|
export const minor = Number("1");
|
|
4
|
-
export const patch = Number("
|
|
4
|
+
export const patch = Number("10");
|
|
5
5
|
export const prerelease = undefined;
|
|
6
6
|
export default version;
|
package/node/Avatar/Avatar.js
CHANGED
|
@@ -168,21 +168,22 @@ const Avatar = /*#__PURE__*/React.forwardRef(function Avatar(inProps, ref) {
|
|
|
168
168
|
...other
|
|
169
169
|
} = props;
|
|
170
170
|
let children = null;
|
|
171
|
+
const ownerState = {
|
|
172
|
+
...props,
|
|
173
|
+
component,
|
|
174
|
+
variant
|
|
175
|
+
};
|
|
171
176
|
|
|
172
177
|
// Use a hook instead of onError on the img element to support server-side rendering.
|
|
173
178
|
const loaded = useLoaded({
|
|
174
179
|
...imgProps,
|
|
180
|
+
...(typeof slotProps.img === 'function' ? slotProps.img(ownerState) : slotProps.img),
|
|
175
181
|
src,
|
|
176
182
|
srcSet
|
|
177
183
|
});
|
|
178
184
|
const hasImg = src || srcSet;
|
|
179
185
|
const hasImgNotFailing = hasImg && loaded !== 'error';
|
|
180
|
-
|
|
181
|
-
...props,
|
|
182
|
-
colorDefault: !hasImgNotFailing,
|
|
183
|
-
component,
|
|
184
|
-
variant
|
|
185
|
-
};
|
|
186
|
+
ownerState.colorDefault = !hasImgNotFailing;
|
|
186
187
|
// This issue explains why this is required: https://github.com/mui/material-ui/issues/42184
|
|
187
188
|
delete ownerState.ownerState;
|
|
188
189
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -143,34 +143,22 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
143
143
|
ripple.pulsate();
|
|
144
144
|
}
|
|
145
145
|
}, [disableRipple, focusRipple, focusVisible, ripple]);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const ignore = skipRippleAction;
|
|
152
|
-
if (!ignore) {
|
|
153
|
-
ripple[rippleAction](event);
|
|
154
|
-
}
|
|
155
|
-
return true;
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
const handleMouseDown = useRippleHandler('start', onMouseDown);
|
|
159
|
-
const handleContextMenu = useRippleHandler('stop', onContextMenu);
|
|
160
|
-
const handleDragLeave = useRippleHandler('stop', onDragLeave);
|
|
161
|
-
const handleMouseUp = useRippleHandler('stop', onMouseUp);
|
|
162
|
-
const handleMouseLeave = useRippleHandler('stop', event => {
|
|
146
|
+
const handleMouseDown = useRippleHandler(ripple, 'start', onMouseDown, disableTouchRipple);
|
|
147
|
+
const handleContextMenu = useRippleHandler(ripple, 'stop', onContextMenu, disableTouchRipple);
|
|
148
|
+
const handleDragLeave = useRippleHandler(ripple, 'stop', onDragLeave, disableTouchRipple);
|
|
149
|
+
const handleMouseUp = useRippleHandler(ripple, 'stop', onMouseUp, disableTouchRipple);
|
|
150
|
+
const handleMouseLeave = useRippleHandler(ripple, 'stop', event => {
|
|
163
151
|
if (focusVisible) {
|
|
164
152
|
event.preventDefault();
|
|
165
153
|
}
|
|
166
154
|
if (onMouseLeave) {
|
|
167
155
|
onMouseLeave(event);
|
|
168
156
|
}
|
|
169
|
-
});
|
|
170
|
-
const handleTouchStart = useRippleHandler('start', onTouchStart);
|
|
171
|
-
const handleTouchEnd = useRippleHandler('stop', onTouchEnd);
|
|
172
|
-
const handleTouchMove = useRippleHandler('stop', onTouchMove);
|
|
173
|
-
const handleBlur = useRippleHandler('stop', event => {
|
|
157
|
+
}, disableTouchRipple);
|
|
158
|
+
const handleTouchStart = useRippleHandler(ripple, 'start', onTouchStart, disableTouchRipple);
|
|
159
|
+
const handleTouchEnd = useRippleHandler(ripple, 'stop', onTouchEnd, disableTouchRipple);
|
|
160
|
+
const handleTouchMove = useRippleHandler(ripple, 'stop', onTouchMove, disableTouchRipple);
|
|
161
|
+
const handleBlur = useRippleHandler(ripple, 'stop', event => {
|
|
174
162
|
if (!(0, _isFocusVisible.default)(event.target)) {
|
|
175
163
|
setFocusVisible(false);
|
|
176
164
|
}
|
|
@@ -294,6 +282,17 @@ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, re
|
|
|
294
282
|
}) : null]
|
|
295
283
|
});
|
|
296
284
|
});
|
|
285
|
+
function useRippleHandler(ripple, rippleAction, eventCallback, skipRippleAction = false) {
|
|
286
|
+
return (0, _useEventCallback.default)(event => {
|
|
287
|
+
if (eventCallback) {
|
|
288
|
+
eventCallback(event);
|
|
289
|
+
}
|
|
290
|
+
if (!skipRippleAction) {
|
|
291
|
+
ripple[rippleAction](event);
|
|
292
|
+
}
|
|
293
|
+
return true;
|
|
294
|
+
});
|
|
295
|
+
}
|
|
297
296
|
process.env.NODE_ENV !== "production" ? ButtonBase.propTypes /* remove-proptypes */ = {
|
|
298
297
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
299
298
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
@@ -11,7 +11,6 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _utils = require("@mui/utils");
|
|
13
13
|
var _getReactElementRef = _interopRequireDefault(require("@mui/utils/getReactElementRef"));
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
14
|
// TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase<EventName> : never` once generatePropTypes runs with TS 4.1
|
|
16
15
|
function mapEventPropToEvent(eventProp) {
|
|
17
16
|
return eventProp.substring(2).toLowerCase();
|
|
@@ -142,9 +141,7 @@ function ClickAwayListener(props) {
|
|
|
142
141
|
}
|
|
143
142
|
return undefined;
|
|
144
143
|
}, [handleClickAway, mouseEvent]);
|
|
145
|
-
return /*#__PURE__*/(
|
|
146
|
-
children: /*#__PURE__*/React.cloneElement(children, childrenProps)
|
|
147
|
-
});
|
|
144
|
+
return /*#__PURE__*/React.cloneElement(children, childrenProps);
|
|
148
145
|
}
|
|
149
146
|
process.env.NODE_ENV !== "production" ? ClickAwayListener.propTypes /* remove-proptypes */ = {
|
|
150
147
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -317,7 +317,7 @@ const FilledInput = /*#__PURE__*/React.forwardRef(function FilledInput(inProps,
|
|
|
317
317
|
root: RootSlot,
|
|
318
318
|
input: InputSlot
|
|
319
319
|
},
|
|
320
|
-
|
|
320
|
+
slotProps: componentsProps,
|
|
321
321
|
fullWidth: fullWidth,
|
|
322
322
|
inputComponent: inputComponent,
|
|
323
323
|
multiline: multiline,
|
|
@@ -127,6 +127,7 @@ const FormHelperText = /*#__PURE__*/React.forwardRef(function FormHelperText(inP
|
|
|
127
127
|
children: children === ' ' ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
128
128
|
_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
129
129
|
className: "notranslate",
|
|
130
|
+
"aria-hidden": true,
|
|
130
131
|
children: "\u200B"
|
|
131
132
|
})) : children
|
|
132
133
|
});
|
package/node/Grid2/Grid2.js
CHANGED
|
@@ -11,6 +11,7 @@ var _Grid = require("@mui/system/Grid");
|
|
|
11
11
|
var _requirePropFactory = _interopRequireDefault(require("../utils/requirePropFactory"));
|
|
12
12
|
var _styles = require("../styles");
|
|
13
13
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
14
|
+
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
14
15
|
/**
|
|
15
16
|
*
|
|
16
17
|
* Demos:
|
|
@@ -25,13 +26,19 @@ const Grid2 = (0, _Grid.createGrid)({
|
|
|
25
26
|
createStyledComponent: (0, _styles.styled)('div', {
|
|
26
27
|
name: 'MuiGrid2',
|
|
27
28
|
slot: 'Root',
|
|
28
|
-
overridesResolver: (props, styles) =>
|
|
29
|
+
overridesResolver: (props, styles) => {
|
|
30
|
+
const {
|
|
31
|
+
ownerState
|
|
32
|
+
} = props;
|
|
33
|
+
return [styles.root, ownerState.container && styles.container];
|
|
34
|
+
}
|
|
29
35
|
}),
|
|
30
36
|
componentName: 'MuiGrid2',
|
|
31
37
|
useThemeProps: inProps => (0, _DefaultPropsProvider.useDefaultProps)({
|
|
32
38
|
props: inProps,
|
|
33
39
|
name: 'MuiGrid2'
|
|
34
|
-
})
|
|
40
|
+
}),
|
|
41
|
+
useTheme: _useTheme.default
|
|
35
42
|
});
|
|
36
43
|
process.env.NODE_ENV !== "production" ? Grid2.propTypes /* remove-proptypes */ = {
|
|
37
44
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
package/node/Hidden/HiddenJs.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
4
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.default = void 0;
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
11
|
var _exactProp = _interopRequireDefault(require("@mui/utils/exactProp"));
|
|
13
12
|
var _withWidth = _interopRequireWildcard(require("./withWidth"));
|
|
14
13
|
var _useTheme = _interopRequireDefault(require("../styles/useTheme"));
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
14
|
/**
|
|
17
15
|
* @ignore - internal component.
|
|
18
|
-
*/
|
|
16
|
+
*/
|
|
17
|
+
function HiddenJs(props) {
|
|
19
18
|
const {
|
|
20
19
|
children,
|
|
21
20
|
only,
|
|
@@ -55,11 +54,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
55
54
|
if (!visible) {
|
|
56
55
|
return null;
|
|
57
56
|
}
|
|
58
|
-
return
|
|
59
|
-
children: children
|
|
60
|
-
});
|
|
57
|
+
return children;
|
|
61
58
|
}
|
|
62
|
-
|
|
59
|
+
HiddenJs.propTypes = {
|
|
63
60
|
/**
|
|
64
61
|
* The content of the component.
|
|
65
62
|
*/
|
|
@@ -123,8 +120,8 @@ process.env.NODE_ENV !== "production" ? HiddenJs.propTypes = {
|
|
|
123
120
|
*/
|
|
124
121
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
125
122
|
xsUp: _propTypes.default.bool
|
|
126
|
-
}
|
|
123
|
+
};
|
|
127
124
|
if (process.env.NODE_ENV !== 'production') {
|
|
128
|
-
|
|
125
|
+
HiddenJs.propTypes = (0, _exactProp.default)(HiddenJs.propTypes);
|
|
129
126
|
}
|
|
130
127
|
var _default = exports.default = (0, _withWidth.default)()(HiddenJs);
|
|
@@ -135,6 +135,7 @@ const InputAdornment = /*#__PURE__*/React.forwardRef(function InputAdornment(inP
|
|
|
135
135
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
136
136
|
children: [position === 'start' ? (/* notranslate needed while Google Translate will not fix zero-width space issue */_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
137
137
|
className: "notranslate",
|
|
138
|
+
"aria-hidden": true,
|
|
138
139
|
children: "\u200B"
|
|
139
140
|
}))) : null, children]
|
|
140
141
|
})
|
package/node/Modal/useModal.js
CHANGED
|
@@ -17,6 +17,7 @@ function getContainer(container) {
|
|
|
17
17
|
function getHasTransition(children) {
|
|
18
18
|
return children ? children.props.hasOwnProperty('in') : false;
|
|
19
19
|
}
|
|
20
|
+
const noop = () => {};
|
|
20
21
|
|
|
21
22
|
// A modal manager used to track and manage the state of open Modals.
|
|
22
23
|
// Modals don't open on the server so this won't conflict with concurrent requests.
|
|
@@ -188,8 +189,8 @@ function useModal(parameters) {
|
|
|
188
189
|
}
|
|
189
190
|
};
|
|
190
191
|
return {
|
|
191
|
-
onEnter: (0, _utils.unstable_createChainedFunction)(handleEnter, children?.props.onEnter),
|
|
192
|
-
onExited: (0, _utils.unstable_createChainedFunction)(handleExited, children?.props.onExited)
|
|
192
|
+
onEnter: (0, _utils.unstable_createChainedFunction)(handleEnter, children?.props.onEnter ?? noop),
|
|
193
|
+
onExited: (0, _utils.unstable_createChainedFunction)(handleExited, children?.props.onExited ?? noop)
|
|
193
194
|
};
|
|
194
195
|
};
|
|
195
196
|
return {
|
package/node/NoSsr/NoSsr.js
CHANGED
|
@@ -10,7 +10,6 @@ exports.default = void 0;
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _utils = require("@mui/utils");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
13
|
/**
|
|
15
14
|
* NoSsr purposely removes components from the subject of Server Side Rendering (SSR).
|
|
16
15
|
*
|
|
@@ -47,10 +46,8 @@ function NoSsr(props) {
|
|
|
47
46
|
}
|
|
48
47
|
}, [defer]);
|
|
49
48
|
|
|
50
|
-
//
|
|
51
|
-
return
|
|
52
|
-
children: mountedState ? children : fallback
|
|
53
|
-
});
|
|
49
|
+
// TODO casting won't be needed at one point https://github.com/DefinitelyTyped/DefinitelyTyped/pull/65135
|
|
50
|
+
return mountedState ? children : fallback;
|
|
54
51
|
}
|
|
55
52
|
process.env.NODE_ENV !== "production" ? NoSsr.propTypes /* remove-proptypes */ = {
|
|
56
53
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -127,6 +127,7 @@ function NotchedOutline(props) {
|
|
|
127
127
|
}) : // notranslate needed while Google Translate will not fix zero-width space issue
|
|
128
128
|
_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
129
129
|
className: "notranslate",
|
|
130
|
+
"aria-hidden": true,
|
|
130
131
|
children: "\u200B"
|
|
131
132
|
}))
|
|
132
133
|
})
|
package/node/Portal/Portal.js
CHANGED
|
@@ -11,7 +11,6 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _utils = require("@mui/utils");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
14
|
function getContainer(container) {
|
|
16
15
|
return typeof container === 'function' ? container() : container;
|
|
17
16
|
}
|
|
@@ -57,13 +56,9 @@ const Portal = /*#__PURE__*/React.forwardRef(function Portal(props, forwardedRef
|
|
|
57
56
|
};
|
|
58
57
|
return /*#__PURE__*/React.cloneElement(children, newProps);
|
|
59
58
|
}
|
|
60
|
-
return
|
|
61
|
-
children: children
|
|
62
|
-
});
|
|
59
|
+
return children;
|
|
63
60
|
}
|
|
64
|
-
return /*#__PURE__*/(
|
|
65
|
-
children: mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode
|
|
66
|
-
});
|
|
61
|
+
return mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode;
|
|
67
62
|
});
|
|
68
63
|
process.env.NODE_ENV !== "production" ? Portal.propTypes /* remove-proptypes */ = {
|
|
69
64
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
@@ -469,6 +469,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
469
469
|
children: isEmpty(display) ? // notranslate needed while Google Translate will not fix zero-width space issue
|
|
470
470
|
_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
471
471
|
className: "notranslate",
|
|
472
|
+
"aria-hidden": true,
|
|
472
473
|
children: "\u200B"
|
|
473
474
|
})) : display
|
|
474
475
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectNativeInput, {
|
|
@@ -56,8 +56,8 @@ function ScrollbarSize(props) {
|
|
|
56
56
|
}, [onChange]);
|
|
57
57
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
58
58
|
style: styles,
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
...other,
|
|
60
|
+
ref: nodeRef
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
process.env.NODE_ENV !== "production" ? ScrollbarSize.propTypes = {
|
package/node/index.js
CHANGED
|
@@ -32,7 +32,7 @@ function setColor(obj, key, defaultValue) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
function toRgb(color) {
|
|
35
|
-
if (
|
|
35
|
+
if (typeof color !== 'string' || !color.startsWith('hsl')) {
|
|
36
36
|
return color;
|
|
37
37
|
}
|
|
38
38
|
return (0, _colorManipulator.hslToRgb)(color);
|
|
@@ -325,7 +325,7 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
325
325
|
|
|
326
326
|
// The default palettes (primary, secondary, error, info, success, and warning) errors are handled by the above `createTheme(...)`.
|
|
327
327
|
|
|
328
|
-
if (colors && typeof colors === 'object') {
|
|
328
|
+
if (color !== 'tonalOffset' && colors && typeof colors === 'object') {
|
|
329
329
|
// Silent the error for custom palettes.
|
|
330
330
|
if (colors.main) {
|
|
331
331
|
setColor(palette[color], 'mainChannel', (0, _colorManipulator.private_safeColorChannel)(toRgb(colors.main)));
|
package/node/utils/useSlot.js
CHANGED
|
@@ -37,7 +37,6 @@ name, parameters) {
|
|
|
37
37
|
elementType: initialElementType,
|
|
38
38
|
ownerState,
|
|
39
39
|
externalForwardedProps,
|
|
40
|
-
getSlotOwnerState,
|
|
41
40
|
internalForwardedProps,
|
|
42
41
|
...useSlotPropsParams
|
|
43
42
|
} = parameters;
|
|
@@ -69,11 +68,6 @@ name, parameters) {
|
|
|
69
68
|
externalSlotProps: resolvedComponentsProps
|
|
70
69
|
});
|
|
71
70
|
const ref = (0, _useForkRef.default)(internalRef, resolvedComponentsProps?.ref, parameters.ref);
|
|
72
|
-
const slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {};
|
|
73
|
-
const finalOwnerState = {
|
|
74
|
-
...ownerState,
|
|
75
|
-
...slotOwnerState
|
|
76
|
-
};
|
|
77
71
|
const LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent;
|
|
78
72
|
const props = (0, _appendOwnerState.default)(elementType, {
|
|
79
73
|
...(name === 'root' && !rootComponent && !slots[name] && internalForwardedProps),
|
|
@@ -83,9 +77,6 @@ name, parameters) {
|
|
|
83
77
|
as: LeafComponent
|
|
84
78
|
}),
|
|
85
79
|
ref
|
|
86
|
-
},
|
|
87
|
-
Object.keys(slotOwnerState).forEach(propName => {
|
|
88
|
-
delete props[propName];
|
|
89
|
-
});
|
|
80
|
+
}, ownerState);
|
|
90
81
|
return [elementType, props];
|
|
91
82
|
}
|