@mui/material 6.1.1 → 6.1.3
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/Autocomplete/Autocomplete.js +1 -5
- package/Badge/Badge.d.ts +2 -2
- package/Badge/Badge.js +12 -8
- package/Button/Button.js +3 -4
- package/CHANGELOG.md +136 -0
- package/ClickAwayListener/ClickAwayListener.js +2 -2
- package/Fade/Fade.js +2 -2
- package/Grid2/Grid2.d.ts +16 -11
- package/Grid2/Grid2.js +29 -11
- package/Grow/Grow.js +2 -2
- package/Icon/Icon.js +1 -1
- package/InputBase/InputBase.js +1 -1
- package/LinearProgress/LinearProgress.js +7 -0
- package/MenuList/MenuList.js +2 -1
- package/Modal/Modal.js +3 -3
- package/Modal/ModalManager.d.ts +1 -1
- package/Modal/ModalManager.js +5 -5
- package/Modal/useModal.js +9 -5
- package/OutlinedInput/OutlinedInput.js +6 -6
- package/PigmentGrid/PigmentGrid.d.ts +0 -23
- package/PigmentGrid/PigmentGrid.js +0 -23
- package/Portal/Portal.js +2 -2
- package/Rating/Rating.d.ts +1 -1
- package/Rating/Rating.js +7 -2
- package/Select/Select.js +2 -2
- package/Select/SelectInput.js +1 -1
- package/Slide/Slide.js +2 -2
- package/SwipeableDrawer/SwipeableDrawer.d.ts +1 -1
- package/Tooltip/Tooltip.js +2 -2
- package/Unstable_TrapFocus/FocusTrap.js +3 -3
- package/Zoom/Zoom.js +2 -2
- package/index.js +1 -1
- package/modern/Autocomplete/Autocomplete.js +1 -5
- package/modern/Badge/Badge.js +12 -8
- package/modern/Button/Button.js +3 -4
- package/modern/ClickAwayListener/ClickAwayListener.js +2 -2
- package/modern/Fade/Fade.js +2 -2
- package/modern/Grid2/Grid2.js +29 -11
- package/modern/Grow/Grow.js +2 -2
- package/modern/Icon/Icon.js +1 -1
- package/modern/InputBase/InputBase.js +1 -1
- package/modern/LinearProgress/LinearProgress.js +7 -0
- package/modern/MenuList/MenuList.js +2 -1
- package/modern/Modal/Modal.js +3 -3
- package/modern/Modal/ModalManager.js +5 -5
- package/modern/Modal/useModal.js +9 -5
- package/modern/OutlinedInput/OutlinedInput.js +6 -6
- package/modern/PigmentGrid/PigmentGrid.js +0 -23
- package/modern/Portal/Portal.js +2 -2
- package/modern/Rating/Rating.js +7 -2
- package/modern/Select/Select.js +2 -2
- package/modern/Select/SelectInput.js +1 -1
- package/modern/Slide/Slide.js +2 -2
- package/modern/Tooltip/Tooltip.js +2 -2
- package/modern/Unstable_TrapFocus/FocusTrap.js +3 -3
- package/modern/Zoom/Zoom.js +2 -2
- package/modern/index.js +1 -1
- package/modern/styles/createGetSelector.js +8 -7
- package/modern/styles/createPalette.js +2 -16
- package/modern/styles/createThemeNoVars.js +1 -2
- package/modern/styles/createThemeWithVars.js +2 -0
- package/modern/styles/index.js +1 -1
- package/modern/styles/makeStyles.js +1 -3
- package/modern/styles/responsiveFontSizes.js +1 -2
- package/modern/styles/shouldSkipGeneratingVar.js +1 -1
- package/modern/styles/withStyles.js +1 -3
- package/modern/styles/withTheme.js +1 -3
- package/modern/useAutocomplete/useAutocomplete.js +3 -1
- package/modern/utils/memoTheme.js +3 -24
- package/modern/version/index.js +2 -2
- package/node/Autocomplete/Autocomplete.js +1 -5
- package/node/Badge/Badge.js +12 -8
- package/node/Button/Button.js +3 -4
- package/node/ClickAwayListener/ClickAwayListener.js +2 -2
- package/node/Fade/Fade.js +2 -2
- package/node/Grid2/Grid2.js +29 -11
- package/node/Grow/Grow.js +2 -2
- package/node/Icon/Icon.js +1 -1
- package/node/InputBase/InputBase.js +1 -1
- package/node/LinearProgress/LinearProgress.js +7 -0
- package/node/MenuList/MenuList.js +2 -1
- package/node/Modal/Modal.js +3 -3
- package/node/Modal/ModalManager.js +5 -5
- package/node/Modal/useModal.js +9 -5
- package/node/OutlinedInput/OutlinedInput.js +6 -6
- package/node/PigmentGrid/PigmentGrid.js +0 -23
- package/node/Portal/Portal.js +1 -1
- package/node/Rating/Rating.js +7 -2
- package/node/Select/Select.js +2 -2
- package/node/Select/SelectInput.js +1 -1
- package/node/Slide/Slide.js +2 -2
- package/node/Tooltip/Tooltip.js +2 -2
- package/node/Unstable_TrapFocus/FocusTrap.js +2 -2
- package/node/Zoom/Zoom.js +2 -2
- package/node/index.js +1 -1
- package/node/styles/createGetSelector.js +8 -7
- package/node/styles/createPalette.js +2 -16
- package/node/styles/createThemeNoVars.js +1 -2
- package/node/styles/createThemeWithVars.js +2 -0
- package/node/styles/index.js +1 -1
- package/node/styles/makeStyles.js +1 -3
- package/node/styles/responsiveFontSizes.js +1 -2
- package/node/styles/shouldSkipGeneratingVar.js +1 -1
- package/node/styles/withStyles.js +1 -3
- package/node/styles/withTheme.js +1 -3
- package/node/useAutocomplete/useAutocomplete.js +3 -1
- package/node/utils/memoTheme.js +4 -25
- package/node/version/index.js +2 -2
- package/package.json +6 -6
- package/styles/ThemeProvider.d.ts +6 -0
- package/styles/ThemeProviderWithVars.d.ts +2 -1
- package/styles/createGetSelector.d.ts +3 -8
- package/styles/createGetSelector.js +8 -7
- package/styles/createPalette.js +2 -16
- package/styles/createTheme.d.ts +1 -1
- package/styles/createThemeNoVars.d.ts +1 -0
- package/styles/createThemeNoVars.js +1 -2
- package/styles/createThemeWithVars.d.ts +8 -0
- package/styles/createThemeWithVars.js +2 -0
- package/styles/index.js +1 -1
- package/styles/makeStyles.js +1 -3
- package/styles/responsiveFontSizes.js +1 -2
- package/styles/shouldSkipGeneratingVar.js +1 -1
- package/styles/withStyles.js +1 -3
- package/styles/withTheme.js +1 -3
- package/useAutocomplete/useAutocomplete.js +3 -1
- package/utils/memoTheme.d.ts +4 -10
- package/utils/memoTheme.js +3 -24
- package/version/index.js +2 -2
|
@@ -300,6 +300,13 @@ const LinearProgressBar2 = (0, _zeroStyled.styled)('span', {
|
|
|
300
300
|
style: {
|
|
301
301
|
backgroundColor: 'var(--LinearProgressBar2-barColor, currentColor)'
|
|
302
302
|
}
|
|
303
|
+
}, {
|
|
304
|
+
props: ({
|
|
305
|
+
ownerState
|
|
306
|
+
}) => ownerState.variant !== 'buffer' && ownerState.color === 'inherit',
|
|
307
|
+
style: {
|
|
308
|
+
backgroundColor: 'currentColor'
|
|
309
|
+
}
|
|
303
310
|
}, {
|
|
304
311
|
props: {
|
|
305
312
|
color: 'inherit'
|
|
@@ -15,6 +15,7 @@ var _List = _interopRequireDefault(require("../List"));
|
|
|
15
15
|
var _getScrollbarSize = _interopRequireDefault(require("../utils/getScrollbarSize"));
|
|
16
16
|
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
17
17
|
var _useEnhancedEffect = _interopRequireDefault(require("../utils/useEnhancedEffect"));
|
|
18
|
+
var _utils = require("../utils");
|
|
18
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
20
|
function nextItem(list, item, disableListWrap) {
|
|
20
21
|
if (list === item) {
|
|
@@ -118,7 +119,7 @@ const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(props, ref) {
|
|
|
118
119
|
// of the menu.
|
|
119
120
|
const noExplicitWidth = !listRef.current.style.width;
|
|
120
121
|
if (containerElement.clientHeight < listRef.current.clientHeight && noExplicitWidth) {
|
|
121
|
-
const scrollbarSize = `${(0, _getScrollbarSize.default)((0,
|
|
122
|
+
const scrollbarSize = `${(0, _getScrollbarSize.default)((0, _utils.ownerWindow)(containerElement))}px`;
|
|
122
123
|
listRef.current.style[direction === 'rtl' ? 'paddingLeft' : 'paddingRight'] = scrollbarSize;
|
|
123
124
|
listRef.current.style.width = `calc(100% + ${scrollbarSize})`;
|
|
124
125
|
}
|
package/node/Modal/Modal.js
CHANGED
|
@@ -194,12 +194,12 @@ const Modal = /*#__PURE__*/React.forwardRef(function Modal(inProps, ref) {
|
|
|
194
194
|
getSlotProps: otherHandlers => {
|
|
195
195
|
return getBackdropProps({
|
|
196
196
|
...otherHandlers,
|
|
197
|
-
onClick:
|
|
197
|
+
onClick: event => {
|
|
198
198
|
if (onBackdropClick) {
|
|
199
|
-
onBackdropClick(
|
|
199
|
+
onBackdropClick(event);
|
|
200
200
|
}
|
|
201
201
|
if (otherHandlers?.onClick) {
|
|
202
|
-
otherHandlers.onClick(
|
|
202
|
+
otherHandlers.onClick(event);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
});
|
|
@@ -14,8 +14,8 @@ function isOverflowing(container) {
|
|
|
14
14
|
}
|
|
15
15
|
return container.scrollHeight > container.clientHeight;
|
|
16
16
|
}
|
|
17
|
-
function ariaHidden(element,
|
|
18
|
-
if (
|
|
17
|
+
function ariaHidden(element, hide) {
|
|
18
|
+
if (hide) {
|
|
19
19
|
element.setAttribute('aria-hidden', 'true');
|
|
20
20
|
} else {
|
|
21
21
|
element.removeAttribute('aria-hidden');
|
|
@@ -33,13 +33,13 @@ function isAriaHiddenForbiddenOnElement(element) {
|
|
|
33
33
|
const isInputHidden = element.tagName === 'INPUT' && element.getAttribute('type') === 'hidden';
|
|
34
34
|
return isForbiddenTagName || isInputHidden;
|
|
35
35
|
}
|
|
36
|
-
function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude,
|
|
36
|
+
function ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude, hide) {
|
|
37
37
|
const blacklist = [mountElement, currentElement, ...elementsToExclude];
|
|
38
38
|
[].forEach.call(container.children, element => {
|
|
39
39
|
const isNotExcludedElement = !blacklist.includes(element);
|
|
40
40
|
const isNotForbiddenElement = !isAriaHiddenForbiddenOnElement(element);
|
|
41
41
|
if (isNotExcludedElement && isNotForbiddenElement) {
|
|
42
|
-
ariaHidden(element,
|
|
42
|
+
ariaHidden(element, hide);
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -60,7 +60,7 @@ function handleContainer(containerInfo, props) {
|
|
|
60
60
|
if (!props.disableScrollLock) {
|
|
61
61
|
if (isOverflowing(container)) {
|
|
62
62
|
// Compute the size before applying overflow hidden to avoid any scroll jumps.
|
|
63
|
-
const scrollbarSize = (0, _utils.unstable_getScrollbarSize)((0, _utils.
|
|
63
|
+
const scrollbarSize = (0, _utils.unstable_getScrollbarSize)((0, _utils.unstable_ownerWindow)(container));
|
|
64
64
|
restoreStyle.push({
|
|
65
65
|
value: container.style.paddingRight,
|
|
66
66
|
property: 'padding-right',
|
package/node/Modal/useModal.js
CHANGED
|
@@ -20,7 +20,7 @@ function getHasTransition(children) {
|
|
|
20
20
|
|
|
21
21
|
// A modal manager used to track and manage the state of open Modals.
|
|
22
22
|
// Modals don't open on the server so this won't conflict with concurrent requests.
|
|
23
|
-
const
|
|
23
|
+
const manager = new _ModalManager.ModalManager();
|
|
24
24
|
/**
|
|
25
25
|
*
|
|
26
26
|
* Demos:
|
|
@@ -36,8 +36,6 @@ function useModal(parameters) {
|
|
|
36
36
|
container,
|
|
37
37
|
disableEscapeKeyDown = false,
|
|
38
38
|
disableScrollLock = false,
|
|
39
|
-
// @ts-ignore internal logic - Base UI supports the manager as a prop too
|
|
40
|
-
manager = defaultManager,
|
|
41
39
|
closeAfterTransition = false,
|
|
42
40
|
onTransitionEnter,
|
|
43
41
|
onTransitionExited,
|
|
@@ -83,7 +81,7 @@ function useModal(parameters) {
|
|
|
83
81
|
handleMounted();
|
|
84
82
|
}
|
|
85
83
|
});
|
|
86
|
-
const isTopModal =
|
|
84
|
+
const isTopModal = () => manager.isTopModal(getModal());
|
|
87
85
|
const handlePortalRef = (0, _utils.unstable_useEventCallback)(node => {
|
|
88
86
|
mountNodeRef.current = node;
|
|
89
87
|
if (!node) {
|
|
@@ -97,7 +95,7 @@ function useModal(parameters) {
|
|
|
97
95
|
});
|
|
98
96
|
const handleClose = React.useCallback(() => {
|
|
99
97
|
manager.remove(getModal(), ariaHiddenProp);
|
|
100
|
-
}, [ariaHiddenProp
|
|
98
|
+
}, [ariaHiddenProp]);
|
|
101
99
|
React.useEffect(() => {
|
|
102
100
|
return () => {
|
|
103
101
|
handleClose();
|
|
@@ -152,6 +150,12 @@ function useModal(parameters) {
|
|
|
152
150
|
...otherHandlers
|
|
153
151
|
};
|
|
154
152
|
return {
|
|
153
|
+
/*
|
|
154
|
+
* Marking an element with the role presentation indicates to assistive technology
|
|
155
|
+
* that this element should be ignored; it exists to support the web application and
|
|
156
|
+
* is not meant for humans to interact with directly.
|
|
157
|
+
* https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md
|
|
158
|
+
*/
|
|
155
159
|
role: 'presentation',
|
|
156
160
|
...externalEventHandlers,
|
|
157
161
|
onKeyDown: createHandleKeyDown(externalEventHandlers),
|
|
@@ -53,6 +53,12 @@ const OutlinedInputRoot = (0, _zeroStyled.styled)(_InputBase.InputBaseRoot, {
|
|
|
53
53
|
[`&:hover .${_outlinedInputClasses.default.notchedOutline}`]: {
|
|
54
54
|
borderColor: (theme.vars || theme).palette.text.primary
|
|
55
55
|
},
|
|
56
|
+
// Reset on touch devices, it doesn't add specificity
|
|
57
|
+
'@media (hover: none)': {
|
|
58
|
+
[`&:hover .${_outlinedInputClasses.default.notchedOutline}`]: {
|
|
59
|
+
borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
|
|
60
|
+
}
|
|
61
|
+
},
|
|
56
62
|
[`&.${_outlinedInputClasses.default.focused} .${_outlinedInputClasses.default.notchedOutline}`]: {
|
|
57
63
|
borderWidth: 2
|
|
58
64
|
},
|
|
@@ -69,12 +75,6 @@ const OutlinedInputRoot = (0, _zeroStyled.styled)(_InputBase.InputBaseRoot, {
|
|
|
69
75
|
props: {},
|
|
70
76
|
// to overide the above style
|
|
71
77
|
style: {
|
|
72
|
-
// Reset on touch devices, it doesn't add specificity
|
|
73
|
-
'@media (hover: none)': {
|
|
74
|
-
[`&:hover .${_outlinedInputClasses.default.notchedOutline}`]: {
|
|
75
|
-
borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
78
|
[`&.${_outlinedInputClasses.default.error} .${_outlinedInputClasses.default.notchedOutline}`]: {
|
|
79
79
|
borderColor: (theme.vars || theme).palette.error.main
|
|
80
80
|
},
|
|
@@ -122,29 +122,6 @@ process.env.NODE_ENV !== "production" ? PigmentGrid.propTypes /* remove-proptype
|
|
|
122
122
|
* @ignore
|
|
123
123
|
*/
|
|
124
124
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
125
|
-
/**
|
|
126
|
-
* @internal
|
|
127
|
-
* The level of the grid starts from `0`
|
|
128
|
-
* and increases when the grid nests inside another grid regardless of container or item.
|
|
129
|
-
*
|
|
130
|
-
* ```js
|
|
131
|
-
* <Grid> // level 0
|
|
132
|
-
* <Grid> // level 1
|
|
133
|
-
* <Grid> // level 2
|
|
134
|
-
* <Grid> // level 1
|
|
135
|
-
* ```
|
|
136
|
-
*
|
|
137
|
-
* Only consecutive grid is considered nesting.
|
|
138
|
-
* A grid container will start at `0` if there are non-Grid element above it.
|
|
139
|
-
*
|
|
140
|
-
* ```js
|
|
141
|
-
* <Grid> // level 0
|
|
142
|
-
* <div>
|
|
143
|
-
* <Grid> // level 0
|
|
144
|
-
* <Grid> // level 1
|
|
145
|
-
* ```
|
|
146
|
-
*/
|
|
147
|
-
unstable_level: _propTypes.default.number,
|
|
148
125
|
/**
|
|
149
126
|
* Defines the `flex-wrap` style property.
|
|
150
127
|
* It's applied for all screen sizes.
|
package/node/Portal/Portal.js
CHANGED
|
@@ -35,7 +35,7 @@ const Portal = /*#__PURE__*/React.forwardRef(function Portal(props, forwardedRef
|
|
|
35
35
|
disablePortal = false
|
|
36
36
|
} = props;
|
|
37
37
|
const [mountNode, setMountNode] = React.useState(null);
|
|
38
|
-
const handleRef = (0, _utils.unstable_useForkRef)((0, _utils.
|
|
38
|
+
const handleRef = (0, _utils.unstable_useForkRef)(/*#__PURE__*/React.isValidElement(children) ? (0, _utils.unstable_getReactElementRef)(children) : null, forwardedRef);
|
|
39
39
|
(0, _utils.unstable_useEnhancedEffect)(() => {
|
|
40
40
|
if (!disablePortal) {
|
|
41
41
|
setMountNode(getContainer(container) || document.body);
|
package/node/Rating/Rating.js
CHANGED
|
@@ -233,7 +233,12 @@ function RatingItem(props) {
|
|
|
233
233
|
const isHovered = itemValue <= hover;
|
|
234
234
|
const isFocused = itemValue <= focus;
|
|
235
235
|
const isChecked = itemValue === ratingValueRounded;
|
|
236
|
-
|
|
236
|
+
|
|
237
|
+
// "name" ensures unique IDs across different Rating components in React 17,
|
|
238
|
+
// preventing one component from affecting another. React 18's useId already handles this.
|
|
239
|
+
// Update to const id = useId(); when React 17 support is dropped.
|
|
240
|
+
// More details: https://github.com/mui/material-ui/issues/40997
|
|
241
|
+
const id = `${name}-${(0, _utils.unstable_useId)()}`;
|
|
237
242
|
const container = /*#__PURE__*/(0, _jsxRuntime.jsx)(RatingIcon, {
|
|
238
243
|
as: IconContainerComponent,
|
|
239
244
|
value: itemValue,
|
|
@@ -626,7 +631,7 @@ process.env.NODE_ENV !== "production" ? Rating.propTypes /* remove-proptypes */
|
|
|
626
631
|
/**
|
|
627
632
|
* The name attribute of the radio `input` elements.
|
|
628
633
|
* This input `name` should be unique within the page.
|
|
629
|
-
* Being unique within a form is insufficient since the `name` is used to
|
|
634
|
+
* Being unique within a form is insufficient since the `name` is used to generate IDs.
|
|
630
635
|
*/
|
|
631
636
|
name: _propTypes.default.string,
|
|
632
637
|
/**
|
package/node/Select/Select.js
CHANGED
|
@@ -11,7 +11,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
13
|
var _deepmerge = _interopRequireDefault(require("@mui/utils/deepmerge"));
|
|
14
|
-
var
|
|
14
|
+
var _getReactElementRef = _interopRequireDefault(require("@mui/utils/getReactElementRef"));
|
|
15
15
|
var _SelectInput = _interopRequireDefault(require("./SelectInput"));
|
|
16
16
|
var _formControlState = _interopRequireDefault(require("../FormControl/formControlState"));
|
|
17
17
|
var _useFormControl = _interopRequireDefault(require("../FormControl/useFormControl"));
|
|
@@ -99,7 +99,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select(inProps, ref) {
|
|
|
99
99
|
ownerState: ownerState
|
|
100
100
|
})
|
|
101
101
|
}[variant];
|
|
102
|
-
const inputComponentRef = (0, _useForkRef.default)(ref, (0,
|
|
102
|
+
const inputComponentRef = (0, _useForkRef.default)(ref, (0, _getReactElementRef.default)(InputComponent));
|
|
103
103
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
104
104
|
children: /*#__PURE__*/React.cloneElement(InputComponent, {
|
|
105
105
|
// Most of the logic is implemented in `SelectInput`.
|
|
@@ -354,7 +354,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
354
354
|
let selected;
|
|
355
355
|
if (multiple) {
|
|
356
356
|
if (!Array.isArray(value)) {
|
|
357
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
357
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: The `value` prop must be an array ' + 'when using the `Select` component with `multiple`.' : (0, _formatMuiErrorMessage2.default)(2));
|
|
358
358
|
}
|
|
359
359
|
selected = value.some(v => areEqualValues(v, child.props.value));
|
|
360
360
|
if (selected && computeDisplay) {
|
package/node/Slide/Slide.js
CHANGED
|
@@ -14,7 +14,7 @@ var _reactTransitionGroup = require("react-transition-group");
|
|
|
14
14
|
var _chainPropTypes = _interopRequireDefault(require("@mui/utils/chainPropTypes"));
|
|
15
15
|
var _HTMLElementType = _interopRequireDefault(require("@mui/utils/HTMLElementType"));
|
|
16
16
|
var _elementAcceptingRef = _interopRequireDefault(require("@mui/utils/elementAcceptingRef"));
|
|
17
|
-
var
|
|
17
|
+
var _getReactElementRef = _interopRequireDefault(require("@mui/utils/getReactElementRef"));
|
|
18
18
|
var _debounce = _interopRequireDefault(require("../utils/debounce"));
|
|
19
19
|
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
20
20
|
var _zeroStyled = require("../zero-styled");
|
|
@@ -113,7 +113,7 @@ const Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {
|
|
|
113
113
|
...other
|
|
114
114
|
} = props;
|
|
115
115
|
const childrenRef = React.useRef(null);
|
|
116
|
-
const handleRef = (0, _useForkRef.default)((0,
|
|
116
|
+
const handleRef = (0, _useForkRef.default)((0, _getReactElementRef.default)(children), childrenRef, ref);
|
|
117
117
|
const normalizedTransitionCallback = callback => isAppearing => {
|
|
118
118
|
if (callback) {
|
|
119
119
|
// onEnterXxx and onExitXxx callbacks have a different arguments.length value.
|
package/node/Tooltip/Tooltip.js
CHANGED
|
@@ -18,7 +18,7 @@ var _colorManipulator = require("@mui/system/colorManipulator");
|
|
|
18
18
|
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
19
19
|
var _isFocusVisible = _interopRequireDefault(require("@mui/utils/isFocusVisible"));
|
|
20
20
|
var _appendOwnerState = _interopRequireDefault(require("@mui/utils/appendOwnerState"));
|
|
21
|
-
var
|
|
21
|
+
var _getReactElementRef = _interopRequireDefault(require("@mui/utils/getReactElementRef"));
|
|
22
22
|
var _zeroStyled = require("../zero-styled");
|
|
23
23
|
var _memoTheme = _interopRequireDefault(require("../utils/memoTheme"));
|
|
24
24
|
var _DefaultPropsProvider = require("../DefaultPropsProvider");
|
|
@@ -522,7 +522,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {
|
|
|
522
522
|
document.removeEventListener('keydown', handleKeyDown);
|
|
523
523
|
};
|
|
524
524
|
}, [handleClose, open]);
|
|
525
|
-
const handleRef = (0, _useForkRef.default)((0,
|
|
525
|
+
const handleRef = (0, _useForkRef.default)((0, _getReactElementRef.default)(children), setChildNode, ref);
|
|
526
526
|
|
|
527
527
|
// There is no point in displaying an empty tooltip.
|
|
528
528
|
// So we exclude all falsy values, except 0, which is valid.
|
|
@@ -21,7 +21,7 @@ function getTabIndex(node) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// Browsers do not return `tabIndex` correctly for contentEditable nodes;
|
|
24
|
-
// https://
|
|
24
|
+
// https://issues.chromium.org/issues/41283952
|
|
25
25
|
// so if they don't have a tabindex attribute specifically set, assume it's 0.
|
|
26
26
|
// in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
|
|
27
27
|
// `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
|
|
@@ -99,7 +99,7 @@ function FocusTrap(props) {
|
|
|
99
99
|
// It waits for the active element to move into the component to activate.
|
|
100
100
|
const activated = React.useRef(false);
|
|
101
101
|
const rootRef = React.useRef(null);
|
|
102
|
-
const handleRef = (0, _utils.unstable_useForkRef)((0, _utils.
|
|
102
|
+
const handleRef = (0, _utils.unstable_useForkRef)((0, _utils.unstable_getReactElementRef)(children), rootRef);
|
|
103
103
|
const lastKeydown = React.useRef(null);
|
|
104
104
|
React.useEffect(() => {
|
|
105
105
|
// We might render an empty child.
|
package/node/Zoom/Zoom.js
CHANGED
|
@@ -11,7 +11,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _reactTransitionGroup = require("react-transition-group");
|
|
13
13
|
var _elementAcceptingRef = _interopRequireDefault(require("@mui/utils/elementAcceptingRef"));
|
|
14
|
-
var
|
|
14
|
+
var _getReactElementRef = _interopRequireDefault(require("@mui/utils/getReactElementRef"));
|
|
15
15
|
var _zeroStyled = require("../zero-styled");
|
|
16
16
|
var _utils = require("../transitions/utils");
|
|
17
17
|
var _useForkRef = _interopRequireDefault(require("../utils/useForkRef"));
|
|
@@ -55,7 +55,7 @@ const Zoom = /*#__PURE__*/React.forwardRef(function Zoom(props, ref) {
|
|
|
55
55
|
...other
|
|
56
56
|
} = props;
|
|
57
57
|
const nodeRef = React.useRef(null);
|
|
58
|
-
const handleRef = (0, _useForkRef.default)(nodeRef, (0,
|
|
58
|
+
const handleRef = (0, _useForkRef.default)(nodeRef, (0, _getReactElementRef.default)(children), ref);
|
|
59
59
|
const normalizedTransitionCallback = callback => maybeIsAppearing => {
|
|
60
60
|
if (callback) {
|
|
61
61
|
const node = nodeRef.current;
|
package/node/index.js
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _excludeVariablesFromRoot = _interopRequireDefault(require("./excludeVariablesFromRoot"));
|
|
9
9
|
var _default = theme => (colorScheme, css) => {
|
|
10
|
+
const root = theme.rootSelector || ':root';
|
|
10
11
|
const selector = theme.colorSchemeSelector;
|
|
11
12
|
let rule = selector;
|
|
12
13
|
if (selector === 'class') {
|
|
@@ -28,33 +29,33 @@ var _default = theme => (colorScheme, css) => {
|
|
|
28
29
|
});
|
|
29
30
|
if (rule === 'media') {
|
|
30
31
|
return {
|
|
31
|
-
|
|
32
|
+
[root]: css,
|
|
32
33
|
[`@media (prefers-color-scheme: dark)`]: {
|
|
33
|
-
|
|
34
|
+
[root]: excludedVariables
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
if (rule) {
|
|
38
39
|
return {
|
|
39
40
|
[rule.replace('%s', colorScheme)]: excludedVariables,
|
|
40
|
-
[
|
|
41
|
+
[`${root}, ${rule.replace('%s', colorScheme)}`]: css
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
44
|
return {
|
|
44
|
-
|
|
45
|
+
[root]: {
|
|
45
46
|
...css,
|
|
46
47
|
...excludedVariables
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
51
|
if (rule && rule !== 'media') {
|
|
51
|
-
return
|
|
52
|
+
return `${root}, ${rule.replace('%s', String(colorScheme))}`;
|
|
52
53
|
}
|
|
53
54
|
} else if (colorScheme) {
|
|
54
55
|
if (rule === 'media') {
|
|
55
56
|
return {
|
|
56
57
|
[`@media (prefers-color-scheme: ${String(colorScheme)})`]: {
|
|
57
|
-
|
|
58
|
+
[root]: css
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
61
|
}
|
|
@@ -62,6 +63,6 @@ var _default = theme => (colorScheme, css) => {
|
|
|
62
63
|
return rule.replace('%s', String(colorScheme));
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
|
-
return
|
|
66
|
+
return root;
|
|
66
67
|
};
|
|
67
68
|
exports.default = _default;
|
|
@@ -221,24 +221,10 @@ function createPalette(palette) {
|
|
|
221
221
|
color.main = color[mainShade];
|
|
222
222
|
}
|
|
223
223
|
if (!color.hasOwnProperty('main')) {
|
|
224
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
|
|
225
|
-
The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : (0, _formatMuiErrorMessage2.default)(11, name ? ` (${name})` : '', mainShade));
|
|
224
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : (0, _formatMuiErrorMessage2.default)(11, name ? ` (${name})` : '', mainShade));
|
|
226
225
|
}
|
|
227
226
|
if (typeof color.main !== 'string') {
|
|
228
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
|
|
229
|
-
\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.
|
|
230
|
-
|
|
231
|
-
Did you intend to use one of the following approaches?
|
|
232
|
-
|
|
233
|
-
import { green } from "@mui/material/colors";
|
|
234
|
-
|
|
235
|
-
const theme1 = createTheme({ palette: {
|
|
236
|
-
primary: green,
|
|
237
|
-
} });
|
|
238
|
-
|
|
239
|
-
const theme2 = createTheme({ palette: {
|
|
240
|
-
primary: { main: green[500] },
|
|
241
|
-
} });` : (0, _formatMuiErrorMessage2.default)(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
|
|
227
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n` + `\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.\n` + '\n' + 'Did you intend to use one of the following approaches?\n' + '\n' + 'import { green } from "@mui/material/colors";\n' + '\n' + 'const theme1 = createTheme({ palette: {\n' + ' primary: green,\n' + '} });\n' + '\n' + 'const theme2 = createTheme({ palette: {\n' + ' primary: { main: green[500] },\n' + '} });' : (0, _formatMuiErrorMessage2.default)(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
|
|
242
228
|
}
|
|
243
229
|
addLightOrDark(color, 'light', lightShade, tonalOffset);
|
|
244
230
|
addLightOrDark(color, 'dark', darkShade, tonalOffset);
|
|
@@ -30,8 +30,7 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
30
30
|
...other
|
|
31
31
|
} = options;
|
|
32
32
|
if (options.vars) {
|
|
33
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
34
|
-
Please use another name.` : (0, _formatMuiErrorMessage2.default)(20));
|
|
33
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `vars` is a private field used for CSS variables support.\n' + 'Please use another name.' : (0, _formatMuiErrorMessage2.default)(20));
|
|
35
34
|
}
|
|
36
35
|
const palette = (0, _createPalette.default)(paletteInput);
|
|
37
36
|
const systemTheme = (0, _createTheme.default)(options);
|
|
@@ -119,6 +119,7 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
119
119
|
cssVarPrefix = 'mui',
|
|
120
120
|
shouldSkipGeneratingVar = _shouldSkipGeneratingVar.default,
|
|
121
121
|
colorSchemeSelector: selector = colorSchemesInput.light && colorSchemesInput.dark ? 'media' : undefined,
|
|
122
|
+
rootSelector = ':root',
|
|
122
123
|
...input
|
|
123
124
|
} = options;
|
|
124
125
|
const firstColorScheme = Object.keys(colorSchemesInput)[0];
|
|
@@ -156,6 +157,7 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
156
157
|
...muiTheme,
|
|
157
158
|
cssVarPrefix,
|
|
158
159
|
colorSchemeSelector: selector,
|
|
160
|
+
rootSelector,
|
|
159
161
|
getCssVar,
|
|
160
162
|
colorSchemes,
|
|
161
163
|
font: {
|
package/node/styles/index.js
CHANGED
|
@@ -351,7 +351,7 @@ var _excludeVariablesFromRoot = _interopRequireDefault(require("./excludeVariabl
|
|
|
351
351
|
// TODO: Remove this function in v6.
|
|
352
352
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
353
353
|
function experimental_sx() {
|
|
354
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
354
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.' + 'For more details, see https://github.com/mui/material-ui/pull/35150.' : (0, _formatMuiErrorMessage2.default)(19));
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
// The legacy utilities from @mui/styles
|
|
@@ -7,7 +7,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = makeStyles;
|
|
8
8
|
var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
|
|
9
9
|
function makeStyles() {
|
|
10
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
11
|
-
You have to import it from @mui/styles.
|
|
12
|
-
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : (0, _formatMuiErrorMessage2.default)(14));
|
|
10
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: makeStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : (0, _formatMuiErrorMessage2.default)(14));
|
|
13
11
|
}
|
|
@@ -41,8 +41,7 @@ function responsiveFontSizes(themeInput, options = {}) {
|
|
|
41
41
|
lineHeight
|
|
42
42
|
} = style;
|
|
43
43
|
if (!(0, _cssUtils.isUnitless)(lineHeight) && !disableAlign) {
|
|
44
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
45
|
-
Use unitless line heights instead.` : (0, _formatMuiErrorMessage2.default)(6));
|
|
44
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: Unsupported non-unitless line height with grid alignment.\n' + 'Use unitless line heights instead.' : (0, _formatMuiErrorMessage2.default)(6));
|
|
46
45
|
}
|
|
47
46
|
if (!(0, _cssUtils.isUnitless)(lineHeight)) {
|
|
48
47
|
// make it unitless
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = shouldSkipGeneratingVar;
|
|
7
7
|
function shouldSkipGeneratingVar(keys) {
|
|
8
|
-
return !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
|
|
8
|
+
return !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
|
|
9
9
|
// ends with sxConfig
|
|
10
10
|
keys[0] === 'palette' && !!keys[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
|
|
11
11
|
}
|
|
@@ -7,7 +7,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = withStyles;
|
|
8
8
|
var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
|
|
9
9
|
function withStyles() {
|
|
10
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
11
|
-
You have to import it from @mui/styles.
|
|
12
|
-
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : (0, _formatMuiErrorMessage2.default)(15));
|
|
10
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withStyles is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : (0, _formatMuiErrorMessage2.default)(15));
|
|
13
11
|
}
|
package/node/styles/withTheme.js
CHANGED
|
@@ -7,7 +7,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = withTheme;
|
|
8
8
|
var _formatMuiErrorMessage2 = _interopRequireDefault(require("@mui/utils/formatMuiErrorMessage"));
|
|
9
9
|
function withTheme() {
|
|
10
|
-
throw new Error(process.env.NODE_ENV !== "production" ?
|
|
11
|
-
You have to import it from @mui/styles.
|
|
12
|
-
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : (0, _formatMuiErrorMessage2.default)(16));
|
|
10
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: withTheme is no longer exported from @mui/material/styles.\n' + 'You have to import it from @mui/styles.\n' + 'See https://mui.com/r/migration-v4/#mui-material-styles for more details.' : (0, _formatMuiErrorMessage2.default)(16));
|
|
13
11
|
}
|
|
@@ -844,6 +844,7 @@ function useAutocomplete(props) {
|
|
|
844
844
|
const handleInputMouseDown = event => {
|
|
845
845
|
if (!disabledProp && (inputValue === '' || !open)) {
|
|
846
846
|
handlePopupIndicator(event);
|
|
847
|
+
event.stopPropagation();
|
|
847
848
|
}
|
|
848
849
|
};
|
|
849
850
|
let dirty = freeSolo && inputValue.length > 0;
|
|
@@ -920,7 +921,8 @@ function useAutocomplete(props) {
|
|
|
920
921
|
getPopupIndicatorProps: () => ({
|
|
921
922
|
tabIndex: -1,
|
|
922
923
|
type: 'button',
|
|
923
|
-
onClick: handlePopupIndicator
|
|
924
|
+
onClick: handlePopupIndicator,
|
|
925
|
+
onMouseDown: event => event.stopPropagation()
|
|
924
926
|
}),
|
|
925
927
|
getTagProps: ({
|
|
926
928
|
index
|
package/node/utils/memoTheme.js
CHANGED
|
@@ -3,28 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
theme: undefined
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Memoize style function on theme.
|
|
15
|
-
* Intended to be used in styled() calls that only need access to the theme.
|
|
16
|
-
*/
|
|
17
|
-
function memoTheme(styleFn) {
|
|
18
|
-
let lastValue;
|
|
19
|
-
let lastTheme;
|
|
20
|
-
return props => {
|
|
21
|
-
let value = lastValue;
|
|
22
|
-
if (value === undefined || props.theme !== lastTheme) {
|
|
23
|
-
arg.theme = props.theme;
|
|
24
|
-
value = styleFn(arg);
|
|
25
|
-
lastValue = value;
|
|
26
|
-
lastTheme = props.theme;
|
|
27
|
-
}
|
|
28
|
-
return value;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _system = require("@mui/system");
|
|
8
|
+
const memoTheme = _system.unstable_memoTheme;
|
|
9
|
+
var _default = exports.default = memoTheme;
|
package/node/version/index.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.prerelease = exports.patch = exports.minor = exports.major = exports.default = void 0;
|
|
7
|
-
const version = exports.version = "6.1.
|
|
7
|
+
const version = exports.version = "6.1.3";
|
|
8
8
|
const major = exports.major = Number("6");
|
|
9
9
|
const minor = exports.minor = Number("1");
|
|
10
|
-
const patch = exports.patch = Number("
|
|
10
|
+
const patch = exports.patch = Number("3");
|
|
11
11
|
const prerelease = exports.prerelease = undefined;
|
|
12
12
|
var _default = exports.default = version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Material UI is an open-source React component library that implements Google's Material Design. It's comprehensive and can be used in production out of the box.",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"prop-types": "^15.8.1",
|
|
36
36
|
"react-is": "^18.3.1",
|
|
37
37
|
"react-transition-group": "^4.4.5",
|
|
38
|
-
"@mui/core-downloads-tracker": "^6.1.
|
|
39
|
-
"@mui/
|
|
40
|
-
"@mui/
|
|
41
|
-
"@mui/
|
|
38
|
+
"@mui/core-downloads-tracker": "^6.1.3",
|
|
39
|
+
"@mui/system": "^6.1.3",
|
|
40
|
+
"@mui/types": "^7.2.18",
|
|
41
|
+
"@mui/utils": "^6.1.3"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@emotion/react": "^11.5.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
47
47
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
48
48
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
49
|
-
"@mui/material-pigment-css": "^6.1.
|
|
49
|
+
"@mui/material-pigment-css": "^6.1.3"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@types/react": {
|
|
@@ -29,6 +29,12 @@ export interface ThemeProviderProps<Theme = DefaultTheme> extends ThemeProviderC
|
|
|
29
29
|
* @default document
|
|
30
30
|
*/
|
|
31
31
|
documentNode?: Document | null;
|
|
32
|
+
/**
|
|
33
|
+
* The default mode when the local storage has no mode yet,
|
|
34
|
+
* requires the theme to have `colorSchemes` with light and dark.
|
|
35
|
+
* @default 'system'
|
|
36
|
+
*/
|
|
37
|
+
defaultMode?: 'light' | 'dark' | 'system';
|
|
32
38
|
/**
|
|
33
39
|
* The window that attaches the 'storage' event listener
|
|
34
40
|
* @default window
|