@mui/material 5.2.5 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Autocomplete/Autocomplete.d.ts +2 -0
- package/Autocomplete/Autocomplete.js +10 -6
- package/Avatar/Avatar.d.ts +3 -1
- package/Backdrop/Backdrop.js +3 -1
- package/Badge/Badge.d.ts +25 -0
- package/Badge/Badge.js +31 -15
- package/ButtonGroup/ButtonGroupContext.d.ts +1 -1
- package/CHANGELOG.md +245 -32
- package/FilledInput/FilledInput.js +4 -1
- package/FormControlLabel/FormControlLabel.js +3 -1
- package/Input/Input.js +4 -1
- package/InputBase/InputBase.js +4 -1
- package/InputLabel/InputLabel.js +4 -0
- package/ListItem/ListItem.js +3 -1
- package/Modal/Modal.js +3 -1
- package/README.md +19 -24
- package/Select/Select.d.ts +9 -1
- package/Select/Select.js +10 -1
- package/Select/SelectInput.d.ts +1 -0
- package/Select/SelectInput.js +25 -4
- package/Slider/Slider.d.ts +2 -0
- package/Slider/Slider.js +126 -53
- package/StepLabel/StepLabel.js +3 -1
- package/SvgIcon/SvgIcon.d.ts +8 -0
- package/SvgIcon/SvgIcon.js +19 -3
- package/TextField/TextField.d.ts +1 -0
- package/TextField/TextField.js +1 -0
- package/Tooltip/Tooltip.js +6 -1
- package/index.js +1 -1
- package/legacy/Autocomplete/Autocomplete.js +10 -6
- package/legacy/Backdrop/Backdrop.js +3 -1
- package/legacy/Badge/Badge.js +36 -16
- package/legacy/FilledInput/FilledInput.js +4 -1
- package/legacy/FormControlLabel/FormControlLabel.js +3 -1
- package/legacy/Input/Input.js +4 -1
- package/legacy/InputBase/InputBase.js +4 -1
- package/legacy/InputLabel/InputLabel.js +4 -0
- package/legacy/ListItem/ListItem.js +3 -1
- package/legacy/Modal/Modal.js +3 -1
- package/legacy/Select/Select.js +11 -1
- package/legacy/Select/SelectInput.js +29 -7
- package/legacy/Slider/Slider.js +127 -54
- package/legacy/StepLabel/StepLabel.js +3 -1
- package/legacy/SvgIcon/SvgIcon.js +20 -3
- package/legacy/TextField/TextField.js +1 -0
- package/legacy/Tooltip/Tooltip.js +6 -1
- package/legacy/index.js +1 -1
- package/legacy/locale/index.js +224 -130
- package/legacy/utils/shouldSpreadAdditionalProps.js +7 -0
- package/locale/index.d.ts +1 -0
- package/locale/index.js +140 -50
- package/modern/Autocomplete/Autocomplete.js +9 -5
- package/modern/Backdrop/Backdrop.js +3 -1
- package/modern/Badge/Badge.js +31 -15
- package/modern/FilledInput/FilledInput.js +4 -1
- package/modern/FormControlLabel/FormControlLabel.js +3 -1
- package/modern/Input/Input.js +4 -1
- package/modern/InputBase/InputBase.js +4 -1
- package/modern/InputLabel/InputLabel.js +4 -0
- package/modern/ListItem/ListItem.js +3 -1
- package/modern/Modal/Modal.js +3 -1
- package/modern/Select/Select.js +10 -1
- package/modern/Select/SelectInput.js +25 -4
- package/modern/Slider/Slider.js +126 -53
- package/modern/StepLabel/StepLabel.js +3 -1
- package/modern/SvgIcon/SvgIcon.js +19 -3
- package/modern/TextField/TextField.js +1 -0
- package/modern/Tooltip/Tooltip.js +6 -1
- package/modern/index.js +1 -1
- package/modern/locale/index.js +140 -50
- package/modern/utils/shouldSpreadAdditionalProps.js +7 -0
- package/node/Autocomplete/Autocomplete.js +10 -6
- package/node/Backdrop/Backdrop.js +3 -1
- package/node/Badge/Badge.js +33 -16
- package/node/FilledInput/FilledInput.js +4 -1
- package/node/FormControlLabel/FormControlLabel.js +3 -1
- package/node/Input/Input.js +4 -1
- package/node/InputBase/InputBase.js +4 -1
- package/node/InputLabel/InputLabel.js +4 -0
- package/node/ListItem/ListItem.js +3 -1
- package/node/Modal/Modal.js +3 -1
- package/node/Select/Select.js +10 -1
- package/node/Select/SelectInput.js +25 -4
- package/node/Slider/Slider.js +112 -45
- package/node/StepLabel/StepLabel.js +3 -1
- package/node/SvgIcon/SvgIcon.js +19 -3
- package/node/TextField/TextField.js +1 -0
- package/node/Tooltip/Tooltip.js +6 -1
- package/node/index.js +1 -1
- package/node/locale/index.js +142 -51
- package/node/utils/shouldSpreadAdditionalProps.js +15 -0
- package/package.json +7 -7
- package/styles/components.d.ts +452 -113
- package/styles/createTheme.d.ts +12 -6
- package/styles/overrides.d.ts +16 -4
- package/styles/useThemeProps.d.ts +2 -1
- package/umd/material-ui.development.js +703 -332
- package/umd/material-ui.production.min.js +21 -21
- package/utils/shouldSpreadAdditionalProps.js +7 -0
package/styles/createTheme.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Components } from './components';
|
|
|
9
9
|
|
|
10
10
|
export interface ThemeOptions extends Omit<SystemThemeOptions, 'zIndex'> {
|
|
11
11
|
mixins?: MixinsOptions;
|
|
12
|
-
components?: Components
|
|
12
|
+
components?: Components<BaseTheme>;
|
|
13
13
|
palette?: PaletteOptions;
|
|
14
14
|
shadows?: Shadows;
|
|
15
15
|
transitions?: TransitionsOptions;
|
|
@@ -18,12 +18,8 @@ export interface ThemeOptions extends Omit<SystemThemeOptions, 'zIndex'> {
|
|
|
18
18
|
unstable_strictMode?: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
* Our [TypeScript guide on theme customization](https://mui.com/guides/typescript/#customization-of-theme) explains in detail how you would add custom properties.
|
|
23
|
-
*/
|
|
24
|
-
export interface Theme extends SystemTheme {
|
|
21
|
+
interface BaseTheme extends SystemTheme {
|
|
25
22
|
mixins: Mixins;
|
|
26
|
-
components?: Components;
|
|
27
23
|
palette: Palette;
|
|
28
24
|
shadows: Shadows;
|
|
29
25
|
transitions: Transitions;
|
|
@@ -32,6 +28,16 @@ export interface Theme extends SystemTheme {
|
|
|
32
28
|
unstable_strictMode?: boolean;
|
|
33
29
|
}
|
|
34
30
|
|
|
31
|
+
// shut off automatic exporting for the `BaseTheme` above
|
|
32
|
+
export {};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Our [TypeScript guide on theme customization](https://mui.com/guides/typescript/#customization-of-theme) explains in detail how you would add custom properties.
|
|
36
|
+
*/
|
|
37
|
+
export interface Theme extends BaseTheme {
|
|
38
|
+
components?: Components<BaseTheme>;
|
|
39
|
+
}
|
|
40
|
+
|
|
35
41
|
/**
|
|
36
42
|
* @deprecated
|
|
37
43
|
* Use `import { createTheme } from '@mui/material/styles'` instead.
|
package/styles/overrides.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CSSObject, CSSInterpolation } from '@mui/system';
|
|
2
|
+
import { ComponentsPropsList } from './props';
|
|
2
3
|
import { AccordionActionsClassKey } from '../AccordionActions';
|
|
3
4
|
import { AccordionClassKey } from '../Accordion';
|
|
4
5
|
import { AccordionDetailsClassKey } from '../AccordionDetails';
|
|
@@ -111,14 +112,25 @@ import { TooltipClassKey } from '../Tooltip';
|
|
|
111
112
|
import { TouchRippleClassKey } from '../ButtonBase/TouchRipple';
|
|
112
113
|
import { TypographyClassKey } from '../Typography';
|
|
113
114
|
|
|
114
|
-
export type OverridesStyleRules<
|
|
115
|
+
export type OverridesStyleRules<
|
|
116
|
+
ClassKey extends string = string,
|
|
117
|
+
ComponentName = keyof ComponentsPropsList,
|
|
118
|
+
Theme = unknown,
|
|
119
|
+
> = Record<
|
|
115
120
|
ClassKey,
|
|
116
|
-
CSSInterpolation
|
|
121
|
+
| CSSInterpolation
|
|
122
|
+
| ((
|
|
123
|
+
// Record<string, unknown> is for other props that the slot receive internally
|
|
124
|
+
// Documenting all ownerStates could be a huge work, let's wait until we have a real needs from developers.
|
|
125
|
+
props: (ComponentName extends keyof ComponentsPropsList
|
|
126
|
+
? { ownerState: ComponentsPropsList[ComponentName] & Record<string, unknown> }
|
|
127
|
+
: {}) & { theme: Theme } & Record<string, unknown>,
|
|
128
|
+
) => CSSInterpolation)
|
|
117
129
|
>;
|
|
118
130
|
|
|
119
|
-
export type ComponentsOverrides = {
|
|
131
|
+
export type ComponentsOverrides<Theme = unknown> = {
|
|
120
132
|
[Name in keyof ComponentNameToClassKey]?: Partial<
|
|
121
|
-
OverridesStyleRules<ComponentNameToClassKey[Name]>
|
|
133
|
+
OverridesStyleRules<ComponentNameToClassKey[Name], Name, Theme>
|
|
122
134
|
>;
|
|
123
135
|
} & {
|
|
124
136
|
MuiCssBaseline?: CSSObject | string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Theme } from './createTheme';
|
|
1
2
|
import { Components } from './components';
|
|
2
3
|
|
|
3
4
|
export interface ThemeWithProps {
|
|
4
|
-
components?: Components
|
|
5
|
+
components?: Components<Omit<Theme, 'components'>>;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
export type ThemedProps<Theme, Name extends keyof any> = Theme extends {
|