@mui/styled-engine 7.0.0-alpha.2 → 7.0.0-beta.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/CHANGELOG.md +42 -0
- package/esm/GlobalStyles/GlobalStyles.d.ts +7 -0
- package/esm/GlobalStyles/index.d.ts +2 -0
- package/esm/StyledEngineProvider/StyledEngineProvider.d.ts +6 -0
- package/esm/StyledEngineProvider/index.d.ts +2 -0
- package/esm/index.d.ts +119 -0
- package/esm/index.js +1 -1
- package/index.js +1 -1
- package/modern/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 7.0.0-beta.0
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v7.0.0-alpha.2..master -->
|
|
6
|
+
|
|
7
|
+
_Feb 26, 2025_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 8 contributors who made this release possible.
|
|
10
|
+
|
|
11
|
+
### `@mui/material@7.0.0-beta.0`
|
|
12
|
+
|
|
13
|
+
- [Modal][Dialog] Remove deprecated `onBackdropClick` (#45395) @DiegoAndai
|
|
14
|
+
- [Grid] Improve Grid2 upgrade experience (#45304) @DiegoAndai
|
|
15
|
+
- [Grid] Rename to GridLegacy (#45363) @DiegoAndai
|
|
16
|
+
- [Grid2] Rename to Grid (#45381) @DiegoAndai
|
|
17
|
+
- Remove SvgIcon data-testid in production (#45333) @Janpot
|
|
18
|
+
- Allow nested theme creation with `vars` (#45335) @siriwatknp
|
|
19
|
+
- [Rating] Deprecate \*Props and complete `slots`, `slotProps` (#45295) @harry-whorlow
|
|
20
|
+
- [Slider] Fix css class selector in migration guide (#45402) @sai6855
|
|
21
|
+
- [Slider] Fix spacings in .md files (#45388) @sai6855
|
|
22
|
+
- [styles] Remove deprecated exports (#45397) @DiegoAndai
|
|
23
|
+
- [Menu] Deprecate \*Props and complete `slots`, `slotProps` (#44913) @siriwatknp
|
|
24
|
+
- [StepButton] Remove StepIconButton type (#45396) @DiegoAndai
|
|
25
|
+
|
|
26
|
+
### Docs
|
|
27
|
+
|
|
28
|
+
- [Autocomplete] Remove unnecessary renderTags prop from Sizes demo (#45401) @ZeeshanTamboli
|
|
29
|
+
- Add `overriding-component-structure` doc to Material UI (#45186) @siriwatknp
|
|
30
|
+
- Fix typo in slider docs (#45390) @sai6855
|
|
31
|
+
- Fix Context Menu selection lost on Safari (#44903) @NooBat
|
|
32
|
+
|
|
33
|
+
### Core
|
|
34
|
+
|
|
35
|
+
- [code-infra] Fix types for @mui/styled-engine (#45413) @Janpot
|
|
36
|
+
- [docs-infra] Fix theme toggle call (#45400) @siriwatknp
|
|
37
|
+
- [docs-infra] Add `color-scheme` to document in iframe demos (#45406) @KenanYusuf
|
|
38
|
+
- [docs-infra] Revert to use deprecated `CssVarsProvider` for MUI X (#45371) @siriwatknp
|
|
39
|
+
- [docs-infra] Fix dark mode flicker for API pages (#45354) @siriwatknp
|
|
40
|
+
- [examples] Remove unnecessary comma in Material UI Vite JS example (#45370) @ZeeshanTamboli
|
|
41
|
+
- [test] Remove unused renderTags prop and fix key warning in Autocomplete regression test (#45410) @ZeeshanTamboli
|
|
42
|
+
|
|
43
|
+
All contributors of this release in alphabetical order: @DiegoAndai, @harry-whorlow, @Janpot, @KenanYusuf, @NooBat, @sai6855, @siriwatknp, @ZeeshanTamboli
|
|
44
|
+
|
|
3
45
|
## 7.0.0-alpha.2
|
|
4
46
|
|
|
5
47
|
<!-- generated comparing v7.0.0-alpha.1..master -->
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Interpolation } from '@emotion/react';
|
|
3
|
+
export interface GlobalStylesProps<Theme = {}> {
|
|
4
|
+
defaultTheme?: object;
|
|
5
|
+
styles: Interpolation<Theme>;
|
|
6
|
+
}
|
|
7
|
+
export default function GlobalStyles<Theme = {}>(props: GlobalStylesProps<Theme>): React.JSX.Element;
|
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as CSS from 'csstype';
|
|
2
|
+
import { StyledComponent, StyledOptions } from '@emotion/styled';
|
|
3
|
+
import { PropsOf } from '@emotion/react';
|
|
4
|
+
export * from '@emotion/styled';
|
|
5
|
+
export { default } from '@emotion/styled';
|
|
6
|
+
export { ThemeContext, keyframes, css } from '@emotion/react';
|
|
7
|
+
export { default as StyledEngineProvider } from "./StyledEngineProvider/index.js";
|
|
8
|
+
export { default as GlobalStyles } from "./GlobalStyles/index.js";
|
|
9
|
+
export * from "./GlobalStyles/index.js";
|
|
10
|
+
export type MUIStyledComponent<ComponentProps extends {}, SpecificComponentProps extends {} = {}, JSXProps extends {} = {}> = StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* For internal usage in `@mui/system` package
|
|
14
|
+
*/
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
16
|
+
export function internal_mutateStyles(tag: React.ElementType, processor: (styles: any) => any): void;
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
19
|
+
export function internal_serializeStyles<P>(styles: Interpolation<P>): object;
|
|
20
|
+
export interface SerializedStyles {
|
|
21
|
+
name: string;
|
|
22
|
+
styles: string;
|
|
23
|
+
map?: string;
|
|
24
|
+
next?: SerializedStyles;
|
|
25
|
+
}
|
|
26
|
+
export type CSSProperties = CSS.PropertiesFallback<number | string>;
|
|
27
|
+
export type CSSPropertiesWithMultiValues = { [K in keyof CSSProperties]: CSSProperties[K] | ReadonlyArray<Extract<CSSProperties[K], string>> };
|
|
28
|
+
|
|
29
|
+
// TODO v6 - check if we can drop the unknown, as it breaks the autocomplete
|
|
30
|
+
// For more info on why it was added, see https://github.com/mui/material-ui/pull/26228
|
|
31
|
+
export type CSSPseudos = { [K in CSS.Pseudos]?: unknown | CSSObject };
|
|
32
|
+
|
|
33
|
+
// TODO v6 - check if we can drop the unknown, as it breaks the autocomplete
|
|
34
|
+
// For more info on why it was added, see https://github.com/mui/material-ui/pull/26228
|
|
35
|
+
export interface CSSOthersObject {
|
|
36
|
+
[propertiesName: string]: unknown | CSSInterpolation;
|
|
37
|
+
}
|
|
38
|
+
export type CSSPseudosForCSSObject = { [K in CSS.Pseudos]?: CSSObject };
|
|
39
|
+
export interface ArrayCSSInterpolation extends ReadonlyArray<CSSInterpolation> {}
|
|
40
|
+
export interface CSSOthersObjectForCSSObject {
|
|
41
|
+
[propertiesName: string]: CSSInterpolation;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Omit variants as a key, because we have a special handling for it
|
|
45
|
+
export interface CSSObject extends CSSPropertiesWithMultiValues, CSSPseudos, Omit<CSSOthersObject, 'variants'> {}
|
|
46
|
+
interface CSSObjectWithVariants<Props> extends Omit<CSSObject, 'variants'> {
|
|
47
|
+
variants: Array<{
|
|
48
|
+
props: Props | ((props: Props) => boolean);
|
|
49
|
+
style: CSSObject | ((args: Props extends {
|
|
50
|
+
theme: any;
|
|
51
|
+
} ? {
|
|
52
|
+
theme: Props['theme'];
|
|
53
|
+
} : any) => CSSObject);
|
|
54
|
+
}>;
|
|
55
|
+
}
|
|
56
|
+
export interface ComponentSelector {
|
|
57
|
+
__emotion_styles: any;
|
|
58
|
+
}
|
|
59
|
+
export type Keyframes = {
|
|
60
|
+
name: string;
|
|
61
|
+
styles: string;
|
|
62
|
+
anim: number;
|
|
63
|
+
toString: () => string;
|
|
64
|
+
} & string;
|
|
65
|
+
export type Equal<A, B, T, F> = A extends B ? (B extends A ? T : F) : F;
|
|
66
|
+
export type InterpolationPrimitive = null | undefined | boolean | number | string | ComponentSelector | Keyframes | SerializedStyles | CSSObject;
|
|
67
|
+
export type CSSInterpolation = InterpolationPrimitive | ArrayCSSInterpolation;
|
|
68
|
+
export interface FunctionInterpolation<Props> {
|
|
69
|
+
(props: Props): Interpolation<Props>;
|
|
70
|
+
}
|
|
71
|
+
export interface ArrayInterpolation<Props> extends ReadonlyArray<Interpolation<Props>> {}
|
|
72
|
+
export type Interpolation<Props> = InterpolationPrimitive | CSSObjectWithVariants<Props> | ArrayInterpolation<Props> | FunctionInterpolation<Props>;
|
|
73
|
+
export function shouldForwardProp(propName: PropertyKey): boolean;
|
|
74
|
+
|
|
75
|
+
/** Same as StyledOptions but shouldForwardProp must be a type guard */
|
|
76
|
+
export interface FilteringStyledOptions<Props, ForwardedProps extends keyof Props = keyof Props> {
|
|
77
|
+
label?: string;
|
|
78
|
+
shouldForwardProp?(propName: PropertyKey): propName is ForwardedProps;
|
|
79
|
+
target?: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @typeparam ComponentProps Props which will be included when withComponent is called
|
|
84
|
+
* @typeparam SpecificComponentProps Props which will *not* be included when withComponent is called
|
|
85
|
+
*/
|
|
86
|
+
export interface CreateStyledComponent<ComponentProps extends {}, SpecificComponentProps extends {} = {}, JSXProps extends {} = {}, T extends object = {}> {
|
|
87
|
+
(...styles: Array<Interpolation<ComponentProps & SpecificComponentProps & {
|
|
88
|
+
theme: T;
|
|
89
|
+
}>>): StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @typeparam AdditionalProps Additional props to add to your styled component
|
|
93
|
+
*/
|
|
94
|
+
<AdditionalProps extends {}>(...styles: Array<Interpolation<ComponentProps & SpecificComponentProps & AdditionalProps & {
|
|
95
|
+
theme: T;
|
|
96
|
+
}>>): StyledComponent<ComponentProps & AdditionalProps, SpecificComponentProps, JSXProps>;
|
|
97
|
+
(template: TemplateStringsArray, ...styles: Array<Interpolation<ComponentProps & SpecificComponentProps & {
|
|
98
|
+
theme: T;
|
|
99
|
+
}>>): StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @typeparam AdditionalProps Additional props to add to your styled component
|
|
103
|
+
*/
|
|
104
|
+
<AdditionalProps extends {}>(template: TemplateStringsArray, ...styles: Array<Interpolation<ComponentProps & SpecificComponentProps & AdditionalProps & {
|
|
105
|
+
theme: T;
|
|
106
|
+
}>>): StyledComponent<ComponentProps & AdditionalProps, SpecificComponentProps, JSXProps>;
|
|
107
|
+
}
|
|
108
|
+
export interface CreateMUIStyled<MUIStyledCommonProps extends {}, MuiStyledOptions, Theme extends object> {
|
|
109
|
+
<C extends React.ComponentClass<React.ComponentProps<C>>, ForwardedProps extends keyof React.ComponentProps<C> = keyof React.ComponentProps<C>>(component: C, options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps> & MuiStyledOptions): CreateStyledComponent<Pick<PropsOf<C>, ForwardedProps> & MUIStyledCommonProps, {}, {
|
|
110
|
+
ref?: React.Ref<InstanceType<C>>;
|
|
111
|
+
}, Theme>;
|
|
112
|
+
<C extends React.ComponentClass<React.ComponentProps<C>>>(component: C, options?: StyledOptions<PropsOf<C> & MUIStyledCommonProps> & MuiStyledOptions): CreateStyledComponent<PropsOf<C> & MUIStyledCommonProps, {}, {
|
|
113
|
+
ref?: React.Ref<InstanceType<C>>;
|
|
114
|
+
}, Theme>;
|
|
115
|
+
<C extends React.JSXElementConstructor<React.ComponentProps<C>>, ForwardedProps extends keyof React.ComponentProps<C> = keyof React.ComponentProps<C>>(component: C, options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps> & MuiStyledOptions): CreateStyledComponent<Pick<PropsOf<C>, ForwardedProps> & MUIStyledCommonProps, {}, {}, Theme>;
|
|
116
|
+
<C extends React.JSXElementConstructor<React.ComponentProps<C>>>(component: C, options?: StyledOptions<PropsOf<C> & MUIStyledCommonProps> & MuiStyledOptions): CreateStyledComponent<PropsOf<C> & MUIStyledCommonProps, {}, {}, Theme>;
|
|
117
|
+
<Tag extends keyof React.JSX.IntrinsicElements, ForwardedProps extends keyof React.JSX.IntrinsicElements[Tag] = keyof React.JSX.IntrinsicElements[Tag]>(tag: Tag, options: FilteringStyledOptions<React.JSX.IntrinsicElements[Tag], ForwardedProps> & MuiStyledOptions): CreateStyledComponent<MUIStyledCommonProps, Pick<React.JSX.IntrinsicElements[Tag], ForwardedProps>, {}, Theme>;
|
|
118
|
+
<Tag extends keyof React.JSX.IntrinsicElements>(tag: Tag, options?: StyledOptions<MUIStyledCommonProps> & MuiStyledOptions): CreateStyledComponent<MUIStyledCommonProps, React.JSX.IntrinsicElements[Tag], {}, Theme>;
|
|
119
|
+
}
|
package/esm/index.js
CHANGED
package/index.js
CHANGED
package/modern/index.js
CHANGED