@mui/material 6.1.10 → 6.2.1
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 +6 -6
- package/AvatarGroup/AvatarGroup.js +5 -4
- package/Box/Box.d.ts +3 -1
- package/CHANGELOG.md +72 -2
- package/CardHeader/CardHeader.js +7 -5
- package/FormControl/FormControl.js +5 -8
- package/FormLabel/FormLabel.js +5 -8
- package/Grid/Grid.js +2 -2
- package/ListItemText/ListItemText.d.ts +36 -1
- package/ListItemText/ListItemText.js +46 -7
- package/PigmentGrid/PigmentGrid.js +1 -1
- package/Select/SelectInput.js +8 -0
- package/Slider/useSlider.js +64 -10
- package/TextField/TextField.d.ts +1 -0
- package/TextField/TextField.js +1 -0
- package/index.js +1 -1
- package/modern/Autocomplete/Autocomplete.js +6 -6
- package/modern/AvatarGroup/AvatarGroup.js +5 -4
- package/modern/CardHeader/CardHeader.js +7 -5
- package/modern/FormControl/FormControl.js +5 -8
- package/modern/FormLabel/FormLabel.js +5 -8
- package/modern/Grid/Grid.js +2 -2
- package/modern/ListItemText/ListItemText.js +46 -7
- package/modern/PigmentGrid/PigmentGrid.js +1 -1
- package/modern/Select/SelectInput.js +8 -0
- package/modern/Slider/useSlider.js +64 -10
- package/modern/TextField/TextField.js +1 -0
- package/modern/index.js +1 -1
- package/modern/usePagination/usePagination.js +1 -1
- package/modern/version/index.js +3 -3
- package/node/Autocomplete/Autocomplete.js +6 -6
- package/node/AvatarGroup/AvatarGroup.js +5 -4
- package/node/CardHeader/CardHeader.js +7 -5
- package/node/FormControl/FormControl.js +5 -8
- package/node/FormLabel/FormLabel.js +5 -8
- package/node/Grid/Grid.js +2 -2
- package/node/ListItemText/ListItemText.js +46 -7
- package/node/PigmentGrid/PigmentGrid.js +2 -2
- package/node/Select/SelectInput.js +8 -0
- package/node/Slider/useSlider.js +64 -10
- package/node/TextField/TextField.js +1 -0
- package/node/index.js +1 -1
- package/node/usePagination/usePagination.js +1 -1
- package/node/version/index.js +3 -3
- package/package.json +8 -8
- package/styles/useThemeProps.d.ts +27 -0
- package/useLazyRipple/useLazyRipple.d.ts +1 -1
- package/usePagination/usePagination.js +1 -1
- package/utils/memoTheme.d.ts +1 -1
- package/version/index.js +3 -3
|
@@ -251,12 +251,12 @@ const AutocompleteClearIndicator = styled(IconButton, {
|
|
|
251
251
|
const AutocompletePopupIndicator = styled(IconButton, {
|
|
252
252
|
name: 'MuiAutocomplete',
|
|
253
253
|
slot: 'PopupIndicator',
|
|
254
|
-
overridesResolver: ({
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
254
|
+
overridesResolver: (props, styles) => {
|
|
255
|
+
const {
|
|
256
|
+
ownerState
|
|
257
|
+
} = props;
|
|
258
|
+
return [styles.popupIndicator, ownerState.popupOpen && styles.popupIndicatorOpen];
|
|
259
|
+
}
|
|
260
260
|
})({
|
|
261
261
|
padding: 2,
|
|
262
262
|
marginRight: -2,
|
|
@@ -30,10 +30,11 @@ const useUtilityClasses = ownerState => {
|
|
|
30
30
|
const AvatarGroupRoot = styled('div', {
|
|
31
31
|
name: 'MuiAvatarGroup',
|
|
32
32
|
slot: 'Root',
|
|
33
|
-
overridesResolver: (props, styles) =>
|
|
34
|
-
[
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
overridesResolver: (props, styles) => {
|
|
34
|
+
return [{
|
|
35
|
+
[`& .${avatarGroupClasses.avatar}`]: styles.avatar
|
|
36
|
+
}, styles.root];
|
|
37
|
+
}
|
|
37
38
|
})(memoTheme(({
|
|
38
39
|
theme
|
|
39
40
|
}) => ({
|
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/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,82 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 6.2.1
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v6.2.0..master -->
|
|
6
|
+
|
|
7
|
+
_Dec 17, 2024_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 10 contributors who made this release possible.
|
|
10
|
+
|
|
11
|
+
### `@mui/material@6.2.1`
|
|
12
|
+
|
|
13
|
+
- Update `overridesResolver` return from object to array of styles (#44752) @siddhantantil39
|
|
14
|
+
- [Pagination] Use correct `aria-current` value (#44753) @jacklaurencegaray
|
|
15
|
+
- [Select] Set `aria-required` & `aria-invalid` on `combobox` instead of hidden input (#44731) @ben-pomelo
|
|
16
|
+
|
|
17
|
+
### `@mui/system@6.2.1`
|
|
18
|
+
|
|
19
|
+
- Warns if the hex color contains trailing space (#44538) @siriwatknp
|
|
20
|
+
|
|
21
|
+
### Docs
|
|
22
|
+
|
|
23
|
+
- [material-ui][Dialog] Fix crashing of DraggableDialog demo (#44747) @sai6855
|
|
24
|
+
- [material-ui][TextField] Update `react-number-format` demo to use the recommended prop (#44743) @siriwatknp
|
|
25
|
+
- [material-ui][TextField] Add size default prop to api docs (#44714) @sai6855
|
|
26
|
+
- [material-ui][TextField] Add suffix shrink demo (#44744) @siriwatknp
|
|
27
|
+
|
|
28
|
+
### Core
|
|
29
|
+
|
|
30
|
+
- [api-docs-builder] Preserve multiline prop descriptions with `rawDescriptions` option (#44737) @vladmoroz
|
|
31
|
+
- Fix running mocha related scripts on Windows locally (#44664) @ChristopherJamesL
|
|
32
|
+
- Update `eslint-plugin-jsx-a11y` (#44701) @ZeeshanTamboli
|
|
33
|
+
- Add documentation to `useThemeProps`, `deepmerge` and `composeClasses` functions (#44703) @JCQuintas
|
|
34
|
+
- [examples] Add Theme Mode Switch to Next.js TS example (#43576) @TurtIeSocks
|
|
35
|
+
|
|
36
|
+
All contributors of this release in alphabetical order: @ben-pomelo, @ChristopherJamesL, @jacklaurencegaray, @JCQuintas, @sai6855, @siddhantantil39, @siriwatknp, @TurtIeSocks, @vladmoroz, @ZeeshanTamboli
|
|
37
|
+
|
|
38
|
+
## 6.2.0
|
|
39
|
+
|
|
40
|
+
<!-- generated comparing v6.1.10..master -->
|
|
41
|
+
|
|
42
|
+
_Dec 10, 2024_
|
|
43
|
+
|
|
44
|
+
A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
45
|
+
|
|
46
|
+
- Material UI is now compatible with React 19 (#44672) @DiegoAndai
|
|
47
|
+
- 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
|
|
48
|
+
|
|
49
|
+
### `@mui/material@6.2.0`
|
|
50
|
+
|
|
51
|
+
- [Box] Add missing `component` to `BoxProps` type (#44643) @DiegoAndai
|
|
52
|
+
- [Grid] Fix spacing when using css variables (#44663) @DiegoAndai
|
|
53
|
+
- [ListItemText] Add `slots` and `slotProps` (#44571) @sai6855
|
|
54
|
+
|
|
55
|
+
### Docs
|
|
56
|
+
|
|
57
|
+
- Add Toolpad Core template link (#44415) @bharatkashyap
|
|
58
|
+
|
|
59
|
+
### Core
|
|
60
|
+
|
|
61
|
+
- [docs-infra] Allow custom annotations (#44707) @vladmoroz
|
|
62
|
+
- [Box] Fix `component` prop test (#44651) @DiegoAndai
|
|
63
|
+
- React 19 useRef cleanup (#44704) @DiegoAndai
|
|
64
|
+
- Remove obselete lerna options (#44676) @ZeeshanTamboli
|
|
65
|
+
- Fix Regular Expression Denial of Service (ReDoS) vulnerabilities (#44627) @SuperMaxine
|
|
66
|
+
- Fix number of contributors (#44650) @aarongarciah
|
|
67
|
+
- [docs-infra] Add support for data attributes in the API generation (#44709) @mnajdova
|
|
68
|
+
- [docs-infra] Fix RTL dark mode (#41803) @alexfauquette
|
|
69
|
+
- [Grid] Remove deeply nested imports (#43605) @Janpot
|
|
70
|
+
|
|
71
|
+
All contributors of this release in alphabetical order: @aarongarciah, @alexfauquette, @bharatkashyap, @DiegoAndai, @Janpot, @mj12albert, @mnajdova, @sai6855, @SuperMaxine, @vladmoroz, @ZeeshanTamboli
|
|
72
|
+
|
|
3
73
|
## 6.1.10
|
|
4
74
|
|
|
5
75
|
<!-- generated comparing v6.1.9..master -->
|
|
6
76
|
|
|
7
77
|
_Dec 3, 2024_
|
|
8
78
|
|
|
9
|
-
A big thanks to the
|
|
79
|
+
A big thanks to the 11 contributors who made this release possible.
|
|
10
80
|
|
|
11
81
|
### `@mui/material@6.1.10`
|
|
12
82
|
|
|
@@ -45,7 +115,7 @@ A big thanks to the 10 contributors who made this release possible.
|
|
|
45
115
|
- [docs-infra] Fix TOC RTL padding regression (#44535) @oliviertassinari
|
|
46
116
|
- [test-utils] Remove leftover React.ReactElement<any> from describeConformance.tsx (#44639) @sai6855
|
|
47
117
|
|
|
48
|
-
All contributors of this release in alphabetical order: @albarv340, @arishoham, @DiegoAndai, @joserodolfofreitas, @MBilalShafi, @mnajdova, @oliviertassinari, @
|
|
118
|
+
All contributors of this release in alphabetical order: @albarv340, @arishoham, @DiegoAndai, @joserodolfofreitas, @MBilalShafi, @mnajdova, @oliviertassinari, @sai6855, @samuelsycamore, @siriwatknp, @ZeeshanTamboli
|
|
49
119
|
|
|
50
120
|
## 6.1.9
|
|
51
121
|
|
package/CardHeader/CardHeader.js
CHANGED
|
@@ -26,11 +26,13 @@ const useUtilityClasses = ownerState => {
|
|
|
26
26
|
const CardHeaderRoot = styled('div', {
|
|
27
27
|
name: 'MuiCardHeader',
|
|
28
28
|
slot: 'Root',
|
|
29
|
-
overridesResolver: (props, styles) =>
|
|
30
|
-
[
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
overridesResolver: (props, styles) => {
|
|
30
|
+
return [{
|
|
31
|
+
[`& .${cardHeaderClasses.title}`]: styles.title
|
|
32
|
+
}, {
|
|
33
|
+
[`& .${cardHeaderClasses.subheader}`]: styles.subheader
|
|
34
|
+
}, styles.root];
|
|
35
|
+
}
|
|
34
36
|
})({
|
|
35
37
|
display: 'flex',
|
|
36
38
|
alignItems: 'center',
|
|
@@ -26,14 +26,11 @@ const useUtilityClasses = ownerState => {
|
|
|
26
26
|
const FormControlRoot = styled('div', {
|
|
27
27
|
name: 'MuiFormControl',
|
|
28
28
|
slot: 'Root',
|
|
29
|
-
overridesResolver: ({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
...styles[`margin${capitalize(ownerState.margin)}`],
|
|
35
|
-
...(ownerState.fullWidth && styles.fullWidth)
|
|
36
|
-
};
|
|
29
|
+
overridesResolver: (props, styles) => {
|
|
30
|
+
const {
|
|
31
|
+
ownerState
|
|
32
|
+
} = props;
|
|
33
|
+
return [styles.root, styles[`margin${capitalize(ownerState.margin)}`], ownerState.fullWidth && styles.fullWidth];
|
|
37
34
|
}
|
|
38
35
|
})({
|
|
39
36
|
display: 'inline-flex',
|
package/FormLabel/FormLabel.js
CHANGED
|
@@ -32,14 +32,11 @@ const useUtilityClasses = ownerState => {
|
|
|
32
32
|
export const FormLabelRoot = styled('label', {
|
|
33
33
|
name: 'MuiFormLabel',
|
|
34
34
|
slot: 'Root',
|
|
35
|
-
overridesResolver: ({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
...(ownerState.color === 'secondary' && styles.colorSecondary),
|
|
41
|
-
...(ownerState.filled && styles.filled)
|
|
42
|
-
};
|
|
35
|
+
overridesResolver: (props, styles) => {
|
|
36
|
+
const {
|
|
37
|
+
ownerState
|
|
38
|
+
} = props;
|
|
39
|
+
return [styles.root, ownerState.color === 'secondary' && styles.colorSecondary, ownerState.filled && styles.filled];
|
|
43
40
|
}
|
|
44
41
|
})(memoTheme(({
|
|
45
42
|
theme
|
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,
|
|
@@ -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
|
*/
|
|
@@ -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/Select/SelectInput.js
CHANGED
|
@@ -133,6 +133,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
133
133
|
open: openProp,
|
|
134
134
|
readOnly,
|
|
135
135
|
renderValue,
|
|
136
|
+
required,
|
|
136
137
|
SelectDisplayProps = {},
|
|
137
138
|
tabIndex: tabIndexProp,
|
|
138
139
|
// catching `type` from Input which makes no sense for SelectInput
|
|
@@ -449,6 +450,8 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
449
450
|
"aria-label": ariaLabel,
|
|
450
451
|
"aria-labelledby": [labelId, buttonId].filter(Boolean).join(' ') || undefined,
|
|
451
452
|
"aria-describedby": ariaDescribedby,
|
|
453
|
+
"aria-required": required ? 'true' : undefined,
|
|
454
|
+
"aria-invalid": error ? 'true' : undefined,
|
|
452
455
|
onKeyDown: handleKeyDown,
|
|
453
456
|
onMouseDown: disabled || readOnly ? null : handleMouseDown,
|
|
454
457
|
onBlur: handleBlur,
|
|
@@ -476,6 +479,7 @@ const SelectInput = /*#__PURE__*/React.forwardRef(function SelectInput(props, re
|
|
|
476
479
|
disabled: disabled,
|
|
477
480
|
className: classes.nativeInput,
|
|
478
481
|
autoFocus: autoFocus,
|
|
482
|
+
required: required,
|
|
479
483
|
...other,
|
|
480
484
|
ownerState: ownerState
|
|
481
485
|
}), /*#__PURE__*/_jsx(SelectIcon, {
|
|
@@ -641,6 +645,10 @@ process.env.NODE_ENV !== "production" ? SelectInput.propTypes = {
|
|
|
641
645
|
* @returns {ReactNode}
|
|
642
646
|
*/
|
|
643
647
|
renderValue: PropTypes.func,
|
|
648
|
+
/**
|
|
649
|
+
* If `true`, the component is required.
|
|
650
|
+
*/
|
|
651
|
+
required: PropTypes.bool,
|
|
644
652
|
/**
|
|
645
653
|
* Props applied to the clickable div element.
|
|
646
654
|
*/
|
package/Slider/useSlider.js
CHANGED
|
@@ -5,6 +5,9 @@ import { unstable_ownerDocument as ownerDocument, unstable_useControlled as useC
|
|
|
5
5
|
import extractEventHandlers from '@mui/utils/extractEventHandlers';
|
|
6
6
|
import areArraysEqual from "../utils/areArraysEqual.js";
|
|
7
7
|
const INTENTIONAL_DRAG_COUNT_THRESHOLD = 2;
|
|
8
|
+
function getNewValue(currentValue, step, direction, min, max) {
|
|
9
|
+
return direction === 1 ? Math.min(currentValue + step, max) : Math.max(currentValue - step, min);
|
|
10
|
+
}
|
|
8
11
|
function asc(a, b) {
|
|
9
12
|
return a - b;
|
|
10
13
|
}
|
|
@@ -280,20 +283,65 @@ export function useSlider(parameters) {
|
|
|
280
283
|
}
|
|
281
284
|
};
|
|
282
285
|
const createHandleHiddenInputKeyDown = otherHandlers => event => {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
if (step !== null) {
|
|
286
|
+
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'PageUp', 'PageDown', 'Home', 'End'].includes(event.key)) {
|
|
287
|
+
event.preventDefault();
|
|
286
288
|
const index = Number(event.currentTarget.getAttribute('data-index'));
|
|
287
289
|
const value = values[index];
|
|
288
290
|
let newValue = null;
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
// Keys actions that change the value by more than the most granular `step`
|
|
292
|
+
// value are only applied if the step not `null`.
|
|
293
|
+
// When step is `null`, the `marks` prop is used instead to define valid values.
|
|
294
|
+
if (step != null) {
|
|
295
|
+
const stepSize = event.shiftKey ? shiftStep : step;
|
|
296
|
+
switch (event.key) {
|
|
297
|
+
case 'ArrowUp':
|
|
298
|
+
newValue = getNewValue(value, stepSize, 1, min, max);
|
|
299
|
+
break;
|
|
300
|
+
case 'ArrowRight':
|
|
301
|
+
newValue = getNewValue(value, stepSize, isRtl ? -1 : 1, min, max);
|
|
302
|
+
break;
|
|
303
|
+
case 'ArrowDown':
|
|
304
|
+
newValue = getNewValue(value, stepSize, -1, min, max);
|
|
305
|
+
break;
|
|
306
|
+
case 'ArrowLeft':
|
|
307
|
+
newValue = getNewValue(value, stepSize, isRtl ? 1 : -1, min, max);
|
|
308
|
+
break;
|
|
309
|
+
case 'PageUp':
|
|
310
|
+
newValue = getNewValue(value, shiftStep, 1, min, max);
|
|
311
|
+
break;
|
|
312
|
+
case 'PageDown':
|
|
313
|
+
newValue = getNewValue(value, shiftStep, -1, min, max);
|
|
314
|
+
break;
|
|
315
|
+
case 'Home':
|
|
316
|
+
newValue = min;
|
|
317
|
+
break;
|
|
318
|
+
case 'End':
|
|
319
|
+
newValue = max;
|
|
320
|
+
break;
|
|
321
|
+
default:
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
} else if (marks) {
|
|
325
|
+
const maxMarksValue = marksValues[marksValues.length - 1];
|
|
326
|
+
const currentMarkIndex = marksValues.indexOf(value);
|
|
327
|
+
const decrementKeys = [isRtl ? 'ArrowRight' : 'ArrowLeft', 'ArrowDown', 'PageDown', 'Home'];
|
|
328
|
+
const incrementKeys = [isRtl ? 'ArrowLeft' : 'ArrowRight', 'ArrowUp', 'PageUp', 'End'];
|
|
329
|
+
if (decrementKeys.includes(event.key)) {
|
|
330
|
+
if (currentMarkIndex === 0) {
|
|
331
|
+
newValue = marksValues[0];
|
|
332
|
+
} else {
|
|
333
|
+
newValue = marksValues[currentMarkIndex - 1];
|
|
334
|
+
}
|
|
335
|
+
} else if (incrementKeys.includes(event.key)) {
|
|
336
|
+
if (currentMarkIndex === marksValues.length - 1) {
|
|
337
|
+
newValue = maxMarksValue;
|
|
338
|
+
} else {
|
|
339
|
+
newValue = marksValues[currentMarkIndex + 1];
|
|
340
|
+
}
|
|
341
|
+
}
|
|
293
342
|
}
|
|
294
|
-
if (newValue
|
|
343
|
+
if (newValue != null) {
|
|
295
344
|
changeValue(event, newValue);
|
|
296
|
-
event.preventDefault();
|
|
297
345
|
}
|
|
298
346
|
}
|
|
299
347
|
otherHandlers?.onKeyDown?.(event);
|
|
@@ -315,6 +363,7 @@ export function useSlider(parameters) {
|
|
|
315
363
|
}
|
|
316
364
|
const createHandleHiddenInputChange = otherHandlers => event => {
|
|
317
365
|
otherHandlers.onChange?.(event);
|
|
366
|
+
// this handles value change by Pointer or Touch events
|
|
318
367
|
// @ts-ignore
|
|
319
368
|
changeValue(event, event.target.valueAsNumber);
|
|
320
369
|
};
|
|
@@ -591,6 +640,10 @@ export function useSlider(parameters) {
|
|
|
591
640
|
pointerEvents: active !== -1 && active !== index ? 'none' : undefined
|
|
592
641
|
};
|
|
593
642
|
};
|
|
643
|
+
let cssWritingMode;
|
|
644
|
+
if (orientation === 'vertical') {
|
|
645
|
+
cssWritingMode = isRtl ? 'vertical-rl' : 'vertical-lr';
|
|
646
|
+
}
|
|
594
647
|
const getHiddenInputProps = (externalProps = {}) => {
|
|
595
648
|
const externalHandlers = extractEventHandlers(externalProps);
|
|
596
649
|
const ownEventHandlers = {
|
|
@@ -622,7 +675,8 @@ export function useSlider(parameters) {
|
|
|
622
675
|
direction: isRtl ? 'rtl' : 'ltr',
|
|
623
676
|
// So that VoiceOver's focus indicator matches the thumb's dimensions
|
|
624
677
|
width: '100%',
|
|
625
|
-
height: '100%'
|
|
678
|
+
height: '100%',
|
|
679
|
+
writingMode: cssWritingMode
|
|
626
680
|
}
|
|
627
681
|
};
|
|
628
682
|
};
|
package/TextField/TextField.d.ts
CHANGED
package/TextField/TextField.js
CHANGED
|
@@ -400,6 +400,7 @@ process.env.NODE_ENV !== "production" ? TextField.propTypes /* remove-proptypes
|
|
|
400
400
|
SelectProps: PropTypes.object,
|
|
401
401
|
/**
|
|
402
402
|
* The size of the component.
|
|
403
|
+
* @default 'medium'
|
|
403
404
|
*/
|
|
404
405
|
size: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),
|
|
405
406
|
/**
|
package/index.js
CHANGED
|
@@ -251,12 +251,12 @@ const AutocompleteClearIndicator = styled(IconButton, {
|
|
|
251
251
|
const AutocompletePopupIndicator = styled(IconButton, {
|
|
252
252
|
name: 'MuiAutocomplete',
|
|
253
253
|
slot: 'PopupIndicator',
|
|
254
|
-
overridesResolver: ({
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
254
|
+
overridesResolver: (props, styles) => {
|
|
255
|
+
const {
|
|
256
|
+
ownerState
|
|
257
|
+
} = props;
|
|
258
|
+
return [styles.popupIndicator, ownerState.popupOpen && styles.popupIndicatorOpen];
|
|
259
|
+
}
|
|
260
260
|
})({
|
|
261
261
|
padding: 2,
|
|
262
262
|
marginRight: -2,
|
|
@@ -30,10 +30,11 @@ const useUtilityClasses = ownerState => {
|
|
|
30
30
|
const AvatarGroupRoot = styled('div', {
|
|
31
31
|
name: 'MuiAvatarGroup',
|
|
32
32
|
slot: 'Root',
|
|
33
|
-
overridesResolver: (props, styles) =>
|
|
34
|
-
[
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
overridesResolver: (props, styles) => {
|
|
34
|
+
return [{
|
|
35
|
+
[`& .${avatarGroupClasses.avatar}`]: styles.avatar
|
|
36
|
+
}, styles.root];
|
|
37
|
+
}
|
|
37
38
|
})(memoTheme(({
|
|
38
39
|
theme
|
|
39
40
|
}) => ({
|
|
@@ -26,11 +26,13 @@ const useUtilityClasses = ownerState => {
|
|
|
26
26
|
const CardHeaderRoot = styled('div', {
|
|
27
27
|
name: 'MuiCardHeader',
|
|
28
28
|
slot: 'Root',
|
|
29
|
-
overridesResolver: (props, styles) =>
|
|
30
|
-
[
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
overridesResolver: (props, styles) => {
|
|
30
|
+
return [{
|
|
31
|
+
[`& .${cardHeaderClasses.title}`]: styles.title
|
|
32
|
+
}, {
|
|
33
|
+
[`& .${cardHeaderClasses.subheader}`]: styles.subheader
|
|
34
|
+
}, styles.root];
|
|
35
|
+
}
|
|
34
36
|
})({
|
|
35
37
|
display: 'flex',
|
|
36
38
|
alignItems: 'center',
|
|
@@ -26,14 +26,11 @@ const useUtilityClasses = ownerState => {
|
|
|
26
26
|
const FormControlRoot = styled('div', {
|
|
27
27
|
name: 'MuiFormControl',
|
|
28
28
|
slot: 'Root',
|
|
29
|
-
overridesResolver: ({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
...styles[`margin${capitalize(ownerState.margin)}`],
|
|
35
|
-
...(ownerState.fullWidth && styles.fullWidth)
|
|
36
|
-
};
|
|
29
|
+
overridesResolver: (props, styles) => {
|
|
30
|
+
const {
|
|
31
|
+
ownerState
|
|
32
|
+
} = props;
|
|
33
|
+
return [styles.root, styles[`margin${capitalize(ownerState.margin)}`], ownerState.fullWidth && styles.fullWidth];
|
|
37
34
|
}
|
|
38
35
|
})({
|
|
39
36
|
display: 'inline-flex',
|