@mui/styled-engine 7.0.0-beta.0 → 7.0.0-beta.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 7.0.0-beta.1
4
+
5
+ <!-- generated comparing v7.0.0-beta.0..master -->
6
+
7
+ _Feb 27, 2025_
8
+
9
+ This release fixes incorrect build output from the previous release (`beta.0`).
10
+
11
+ ### Core
12
+
13
+ - [code-infra] Fix build:types script omitting folders with a dot in their name (#45422) @Janpot
14
+ - [release] Fix versions (#45420) @mj12albert
15
+
16
+ All contributors of this release in alphabetical order: @Janpot, @mj12albert
17
+
3
18
  ## 7.0.0-beta.0
4
19
 
5
20
  <!-- generated comparing v7.0.0-alpha.2..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;
@@ -0,0 +1,2 @@
1
+ export { default } from "./GlobalStyles.js";
2
+ export * from "./GlobalStyles.js";
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface StyledEngineProviderProps {
3
+ children?: React.ReactNode;
4
+ injectFirst?: boolean;
5
+ }
6
+ export default function StyledEngineProvider(props: StyledEngineProviderProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from "./StyledEngineProvider.js";
2
+ export * from "./StyledEngineProvider.js";
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/styled-engine v7.0.0-beta.0
2
+ * @mui/styled-engine v7.0.0-beta.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/styled-engine v7.0.0-beta.0
2
+ * @mui/styled-engine v7.0.0-beta.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -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;
@@ -0,0 +1,2 @@
1
+ export { default } from "./GlobalStyles.js";
2
+ export * from "./GlobalStyles.js";
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface StyledEngineProviderProps {
3
+ children?: React.ReactNode;
4
+ injectFirst?: boolean;
5
+ }
6
+ export default function StyledEngineProvider(props: StyledEngineProviderProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { default } from "./StyledEngineProvider.js";
2
+ export * from "./StyledEngineProvider.js";
@@ -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/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/styled-engine v7.0.0-beta.0
2
+ * @mui/styled-engine v7.0.0-beta.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/styled-engine",
3
- "version": "7.0.0-beta.0",
3
+ "version": "7.0.0-beta.1",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "styled() API wrapper package for emotion.",
@@ -86,5 +86,6 @@
86
86
  },
87
87
  "./esm": null,
88
88
  "./modern": null
89
- }
89
+ },
90
+ "types": "./index.d.ts"
90
91
  }