@mui/material 6.0.0-beta.5 → 6.0.0-beta.6
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 -1
- package/Breadcrumbs/Breadcrumbs.js +1 -1
- package/CHANGELOG.md +69 -0
- package/CardHeader/CardHeader.js +9 -5
- package/DialogContentText/DialogContentText.js +1 -1
- package/Divider/Divider.js +3 -2
- package/FormControlLabel/FormControlLabel.js +1 -3
- package/IconButton/IconButton.js +3 -0
- package/InputAdornment/InputAdornment.js +1 -1
- package/Link/Link.js +39 -4
- package/Link/getTextDecoration.d.ts +1 -2
- package/Link/getTextDecoration.js +1 -19
- package/ListItemText/ListItemText.js +8 -4
- package/Slider/useSlider.js +3 -3
- package/Typography/Typography.d.ts +21 -2
- package/Typography/Typography.js +28 -16
- package/index.js +1 -1
- package/modern/Autocomplete/Autocomplete.js +1 -1
- package/modern/Breadcrumbs/Breadcrumbs.js +1 -1
- package/modern/CardHeader/CardHeader.js +9 -5
- package/modern/DialogContentText/DialogContentText.js +1 -1
- package/modern/Divider/Divider.js +3 -2
- package/modern/FormControlLabel/FormControlLabel.js +1 -3
- package/modern/IconButton/IconButton.js +3 -0
- package/modern/InputAdornment/InputAdornment.js +1 -1
- package/modern/Link/Link.js +39 -4
- package/modern/Link/getTextDecoration.js +1 -19
- package/modern/ListItemText/ListItemText.js +8 -4
- package/modern/Slider/useSlider.js +3 -3
- package/modern/Typography/Typography.js +28 -16
- package/modern/index.js +1 -1
- package/modern/styles/createGetSelector.js +8 -2
- package/modern/useAutocomplete/useAutocomplete.js +0 -8
- package/modern/version/index.js +2 -2
- package/node/AppBar/AppBar.js +10 -13
- package/node/Autocomplete/Autocomplete.js +4 -7
- package/node/AvatarGroup/AvatarGroup.js +1 -2
- package/node/Badge/Badge.js +6 -7
- package/node/Breadcrumbs/Breadcrumbs.js +1 -1
- package/node/Button/Button.js +1 -2
- package/node/ButtonBase/TouchRipple.js +4 -4
- package/node/CardHeader/CardHeader.js +9 -5
- package/node/Checkbox/Checkbox.js +2 -3
- package/node/CssBaseline/CssBaseline.js +5 -10
- package/node/DialogContentText/DialogContentText.js +1 -1
- package/node/DialogTitle/DialogTitle.js +1 -1
- package/node/Divider/Divider.js +3 -2
- package/node/Fab/Fab.js +87 -90
- package/node/FilledInput/FilledInput.js +13 -17
- package/node/FormControlLabel/FormControlLabel.js +4 -7
- package/node/Grid/Grid.js +2 -4
- package/node/IconButton/IconButton.js +3 -0
- package/node/Input/Input.js +3 -4
- package/node/InputAdornment/InputAdornment.js +1 -1
- package/node/InputBase/InputBase.js +1 -2
- package/node/Link/Link.js +39 -4
- package/node/Link/getTextDecoration.js +2 -20
- package/node/ListItemText/ListItemText.js +9 -5
- package/node/Menu/Menu.js +2 -3
- package/node/Modal/Modal.js +4 -4
- package/node/Modal/ModalManager.js +1 -1
- package/node/Modal/useModal.js +4 -6
- package/node/OutlinedInput/OutlinedInput.js +3 -3
- package/node/PaginationItem/PaginationItem.js +4 -5
- package/node/Paper/Paper.js +1 -2
- package/node/Popover/Popover.js +2 -3
- package/node/Popper/BasePopper.js +1 -2
- package/node/Popper/Popper.js +2 -3
- package/node/Radio/Radio.js +2 -3
- package/node/ScopedCssBaseline/ScopedCssBaseline.js +2 -4
- package/node/Select/SelectInput.js +2 -3
- package/node/Slider/Slider.js +20 -21
- package/node/Slider/useSlider.js +17 -29
- package/node/Snackbar/useSnackbar.js +7 -7
- package/node/StepLabel/StepLabel.js +1 -1
- package/node/SvgIcon/SvgIcon.js +75 -81
- package/node/SwipeableDrawer/SwipeableDrawer.js +1 -2
- package/node/TabScrollButton/TabScrollButton.js +2 -3
- package/node/TablePagination/TablePagination.js +1 -2
- package/node/TablePagination/TablePaginationActions.js +10 -11
- package/node/Tabs/Tabs.js +5 -8
- package/node/Tooltip/Tooltip.js +13 -15
- package/node/Typography/Typography.js +28 -16
- package/node/Unstable_TrapFocus/FocusTrap.js +1 -2
- package/node/index.js +1 -1
- package/node/styles/createGetSelector.js +9 -3
- package/node/styles/createTheme.js +2 -2
- package/node/styles/createThemeNoVars.js +1 -1
- package/node/styles/createThemeWithVars.js +5 -7
- package/node/styles/shouldSkipGeneratingVar.js +1 -2
- package/node/transitions/utils.js +2 -3
- package/node/useAutocomplete/useAutocomplete.js +3 -18
- package/node/useLazyRipple/useLazyRipple.js +3 -12
- package/node/utils/useSlot.js +1 -1
- package/node/version/index.js +2 -2
- package/package.json +11 -11
- package/styles/createGetSelector.d.ts +5 -3
- package/styles/createGetSelector.js +8 -2
- package/useAutocomplete/useAutocomplete.d.ts +2 -2
- package/useAutocomplete/useAutocomplete.js +0 -8
- package/version/index.js +2 -2
|
@@ -52,10 +52,7 @@ const defaultFilterOptions = createFilterOptions();
|
|
|
52
52
|
|
|
53
53
|
// Number of options to jump in list box when `Page Up` and `Page Down` keys are used.
|
|
54
54
|
const pageSize = 5;
|
|
55
|
-
const defaultIsActiveElementInListbox = listboxRef =>
|
|
56
|
-
var _listboxRef$current$p;
|
|
57
|
-
return listboxRef.current !== null && ((_listboxRef$current$p = listboxRef.current.parentElement) == null ? void 0 : _listboxRef$current$p.contains(document.activeElement));
|
|
58
|
-
};
|
|
55
|
+
const defaultIsActiveElementInListbox = listboxRef => listboxRef.current !== null && listboxRef.current.parentElement?.contains(document.activeElement);
|
|
59
56
|
const MULTIPLE_DEFAULT_VALUE = [];
|
|
60
57
|
function useAutocomplete(props) {
|
|
61
58
|
const {
|
|
@@ -81,10 +78,7 @@ function useAutocomplete(props) {
|
|
|
81
78
|
freeSolo = false,
|
|
82
79
|
getOptionDisabled,
|
|
83
80
|
getOptionKey,
|
|
84
|
-
getOptionLabel: getOptionLabelProp = option =>
|
|
85
|
-
var _option$label;
|
|
86
|
-
return (_option$label = option.label) != null ? _option$label : option;
|
|
87
|
-
},
|
|
81
|
+
getOptionLabel: getOptionLabelProp = option => option.label ?? option,
|
|
88
82
|
groupBy,
|
|
89
83
|
handleHomeEndKeys = !props.freeSolo,
|
|
90
84
|
id: idProp,
|
|
@@ -200,14 +194,6 @@ function useAutocomplete(props) {
|
|
|
200
194
|
resetInputValue(null, value, 'reset');
|
|
201
195
|
}, [value, resetInputValue, focused, previousProps.value, freeSolo]);
|
|
202
196
|
const listboxAvailable = open && filteredOptions.length > 0 && !readOnly;
|
|
203
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
204
|
-
if (value !== null && !freeSolo && options.length > 0) {
|
|
205
|
-
const missingValue = (multiple ? value : [value]).filter(value2 => !options.some(option => isOptionEqualToValue(option, value2)));
|
|
206
|
-
if (missingValue.length > 0) {
|
|
207
|
-
console.warn([`MUI: The value provided to ${componentName} is invalid.`, `None of the options match with \`${missingValue.length > 1 ? JSON.stringify(missingValue) : JSON.stringify(missingValue[0])}\`.`, 'You can use the `isOptionEqualToValue` prop to customize the equality test.'].join('\n'));
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
197
|
const focusTag = (0, _utils.unstable_useEventCallback)(tagToFocus => {
|
|
212
198
|
if (tagToFocus === -1) {
|
|
213
199
|
inputRef.current.focus();
|
|
@@ -961,11 +947,10 @@ function useAutocomplete(props) {
|
|
|
961
947
|
index,
|
|
962
948
|
option
|
|
963
949
|
}) => {
|
|
964
|
-
var _getOptionKey;
|
|
965
950
|
const selected = (multiple ? value : [value]).some(value2 => value2 != null && isOptionEqualToValue(option, value2));
|
|
966
951
|
const disabled = getOptionDisabled ? getOptionDisabled(option) : false;
|
|
967
952
|
return {
|
|
968
|
-
key:
|
|
953
|
+
key: getOptionKey?.(option) ?? getOptionLabel(option),
|
|
969
954
|
tabIndex: -1,
|
|
970
955
|
role: 'option',
|
|
971
956
|
id: `${id}-option-${index}`,
|
|
@@ -69,22 +69,13 @@ class LazyRipple {
|
|
|
69
69
|
/* Ripple API */
|
|
70
70
|
|
|
71
71
|
start(...args) {
|
|
72
|
-
this.mount().then(() =>
|
|
73
|
-
var _this$ref$current;
|
|
74
|
-
return (_this$ref$current = this.ref.current) == null ? void 0 : _this$ref$current.start(...args);
|
|
75
|
-
});
|
|
72
|
+
this.mount().then(() => this.ref.current?.start(...args));
|
|
76
73
|
}
|
|
77
74
|
stop(...args) {
|
|
78
|
-
this.mount().then(() =>
|
|
79
|
-
var _this$ref$current2;
|
|
80
|
-
return (_this$ref$current2 = this.ref.current) == null ? void 0 : _this$ref$current2.stop(...args);
|
|
81
|
-
});
|
|
75
|
+
this.mount().then(() => this.ref.current?.stop(...args));
|
|
82
76
|
}
|
|
83
77
|
pulsate(...args) {
|
|
84
|
-
this.mount().then(() =>
|
|
85
|
-
var _this$ref$current3;
|
|
86
|
-
return (_this$ref$current3 = this.ref.current) == null ? void 0 : _this$ref$current3.pulsate(...args);
|
|
87
|
-
});
|
|
78
|
+
this.mount().then(() => this.ref.current?.pulsate(...args));
|
|
88
79
|
}
|
|
89
80
|
}
|
|
90
81
|
exports.LazyRipple = LazyRipple;
|
package/node/utils/useSlot.js
CHANGED
|
@@ -68,7 +68,7 @@ name, parameters) {
|
|
|
68
68
|
externalForwardedProps: name === 'root' ? other : undefined,
|
|
69
69
|
externalSlotProps: resolvedComponentsProps
|
|
70
70
|
});
|
|
71
|
-
const ref = (0, _useForkRef.default)(internalRef, resolvedComponentsProps
|
|
71
|
+
const ref = (0, _useForkRef.default)(internalRef, resolvedComponentsProps?.ref, parameters.ref);
|
|
72
72
|
const slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {};
|
|
73
73
|
const finalOwnerState = {
|
|
74
74
|
...ownerState,
|
package/node/version/index.js
CHANGED
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.preReleaseNumber = exports.preReleaseLabel = exports.patch = exports.minor = exports.major = exports.default = void 0;
|
|
7
|
-
const version = exports.version = "6.0.0-beta.
|
|
7
|
+
const version = exports.version = "6.0.0-beta.6";
|
|
8
8
|
const major = exports.major = Number("6");
|
|
9
9
|
const minor = exports.minor = Number("0");
|
|
10
10
|
const patch = exports.patch = Number("0");
|
|
11
11
|
const preReleaseLabel = exports.preReleaseLabel = "beta" || null;
|
|
12
|
-
const preReleaseNumber = exports.preReleaseNumber = Number("
|
|
12
|
+
const preReleaseNumber = exports.preReleaseNumber = Number("6") || null;
|
|
13
13
|
var _default = exports.default = version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.6",
|
|
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.",
|
|
@@ -29,24 +29,24 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.25.0",
|
|
31
31
|
"@popperjs/core": "^2.11.8",
|
|
32
|
-
"@types/react-transition-group": "^4.4.
|
|
32
|
+
"@types/react-transition-group": "^4.4.11",
|
|
33
33
|
"clsx": "^2.1.1",
|
|
34
34
|
"csstype": "^3.1.3",
|
|
35
35
|
"prop-types": "^15.8.1",
|
|
36
36
|
"react-is": "^18.3.1",
|
|
37
37
|
"react-transition-group": "^4.4.5",
|
|
38
|
-
"@mui/
|
|
39
|
-
"@mui/
|
|
40
|
-
"@mui/types": "^7.2.
|
|
41
|
-
"@mui/
|
|
38
|
+
"@mui/core-downloads-tracker": "^6.0.0-beta.6",
|
|
39
|
+
"@mui/system": "6.0.0-beta.6",
|
|
40
|
+
"@mui/types": "^7.2.15",
|
|
41
|
+
"@mui/utils": "6.0.0-beta.6"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@emotion/react": "^11.5.0",
|
|
45
45
|
"@emotion/styled": "^11.3.0",
|
|
46
|
-
"@types/react": "^17.0.0 || ^18.0.0",
|
|
47
|
-
"react": "^17.0.0 || ^18.0.0",
|
|
48
|
-
"react-dom": "^17.0.0 || ^18.0.0",
|
|
49
|
-
"@mui/material-pigment-css": "^6.0.0-beta.
|
|
46
|
+
"@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
47
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
48
|
+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
49
|
+
"@mui/material-pigment-css": "^6.0.0-beta.6"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@types/react": {
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"directory": "build"
|
|
69
69
|
},
|
|
70
70
|
"engines": {
|
|
71
|
-
"node": ">=
|
|
71
|
+
"node": ">=14.0.0"
|
|
72
72
|
},
|
|
73
73
|
"pigment-css": {
|
|
74
74
|
"vite": {
|
|
@@ -5,15 +5,17 @@ declare const _default: <T extends {
|
|
|
5
5
|
cssVarPrefix?: string | undefined;
|
|
6
6
|
}>(theme: T) => (colorScheme: keyof T['colorSchemes'] | undefined, css: Record<string, any>) => string | {
|
|
7
7
|
':root': Record<string, any>;
|
|
8
|
-
|
|
8
|
+
"@media (prefers-color-scheme: dark)": {
|
|
9
|
+
':root': Record<string, any>;
|
|
10
|
+
};
|
|
9
11
|
} | {
|
|
10
12
|
[x: string]: Record<string, any>;
|
|
11
13
|
':root'?: undefined;
|
|
12
|
-
|
|
14
|
+
"@media (prefers-color-scheme: dark)"?: undefined;
|
|
13
15
|
} | {
|
|
14
16
|
':root': {
|
|
15
17
|
[x: string]: any;
|
|
16
18
|
};
|
|
17
|
-
|
|
19
|
+
"@media (prefers-color-scheme: dark)"?: undefined;
|
|
18
20
|
};
|
|
19
21
|
export default _default;
|
|
@@ -22,7 +22,9 @@ export default (theme => (colorScheme, css) => {
|
|
|
22
22
|
if (rule === 'media') {
|
|
23
23
|
return {
|
|
24
24
|
':root': css,
|
|
25
|
-
|
|
25
|
+
[`@media (prefers-color-scheme: dark)`]: {
|
|
26
|
+
':root': excludedVariables
|
|
27
|
+
}
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
if (rule) {
|
|
@@ -43,7 +45,11 @@ export default (theme => (colorScheme, css) => {
|
|
|
43
45
|
}
|
|
44
46
|
} else if (colorScheme) {
|
|
45
47
|
if (rule === 'media') {
|
|
46
|
-
return
|
|
48
|
+
return {
|
|
49
|
+
[`@media (prefers-color-scheme: ${String(colorScheme)})`]: {
|
|
50
|
+
':root': css
|
|
51
|
+
}
|
|
52
|
+
};
|
|
47
53
|
}
|
|
48
54
|
if (rule) {
|
|
49
55
|
return rule.replace('%s', String(colorScheme));
|
|
@@ -49,7 +49,7 @@ export interface UseAutocompleteProps<
|
|
|
49
49
|
* Temporary for Joy UI because the parent listbox is the document object
|
|
50
50
|
* TODO v6: Normalize the logic and remove this param.
|
|
51
51
|
*/
|
|
52
|
-
unstable_isActiveElementInListbox?: (listbox: React.RefObject<HTMLElement>) => boolean;
|
|
52
|
+
unstable_isActiveElementInListbox?: (listbox: React.RefObject<HTMLElement | null>) => boolean;
|
|
53
53
|
/**
|
|
54
54
|
* If `true`, the portion of the selected suggestion that the user hasn't typed,
|
|
55
55
|
* known as the completion string, appears inline after the input cursor in the textbox.
|
|
@@ -281,7 +281,7 @@ export interface UseAutocompleteProps<
|
|
|
281
281
|
*/
|
|
282
282
|
openOnFocus?: boolean;
|
|
283
283
|
/**
|
|
284
|
-
*
|
|
284
|
+
* A list of options that will be shown in the Autocomplete.
|
|
285
285
|
*/
|
|
286
286
|
options: ReadonlyArray<Value>;
|
|
287
287
|
/**
|
|
@@ -187,14 +187,6 @@ function useAutocomplete(props) {
|
|
|
187
187
|
resetInputValue(null, value, 'reset');
|
|
188
188
|
}, [value, resetInputValue, focused, previousProps.value, freeSolo]);
|
|
189
189
|
const listboxAvailable = open && filteredOptions.length > 0 && !readOnly;
|
|
190
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
191
|
-
if (value !== null && !freeSolo && options.length > 0) {
|
|
192
|
-
const missingValue = (multiple ? value : [value]).filter(value2 => !options.some(option => isOptionEqualToValue(option, value2)));
|
|
193
|
-
if (missingValue.length > 0) {
|
|
194
|
-
console.warn([`MUI: The value provided to ${componentName} is invalid.`, `None of the options match with \`${missingValue.length > 1 ? JSON.stringify(missingValue) : JSON.stringify(missingValue[0])}\`.`, 'You can use the `isOptionEqualToValue` prop to customize the equality test.'].join('\n'));
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
190
|
const focusTag = useEventCallback(tagToFocus => {
|
|
199
191
|
if (tagToFocus === -1) {
|
|
200
192
|
inputRef.current.focus();
|
package/version/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export const version = "6.0.0-beta.
|
|
1
|
+
export const version = "6.0.0-beta.6";
|
|
2
2
|
export const major = Number("6");
|
|
3
3
|
export const minor = Number("0");
|
|
4
4
|
export const patch = Number("0");
|
|
5
5
|
export const preReleaseLabel = "beta" || null;
|
|
6
|
-
export const preReleaseNumber = Number("
|
|
6
|
+
export const preReleaseNumber = Number("6") || null;
|
|
7
7
|
export default version;
|