@mui/styled-engine 7.0.2 → 7.1.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 +169 -0
- package/esm/index.d.ts +17 -12
- package/esm/index.js +1 -1
- package/index.d.ts +17 -12
- package/index.js +1 -1
- package/package.json +3 -3
- package/modern/GlobalStyles/GlobalStyles.d.ts +0 -7
- package/modern/GlobalStyles/index.d.ts +0 -2
- package/modern/StyledEngineProvider/StyledEngineProvider.d.ts +0 -7
- package/modern/StyledEngineProvider/index.d.ts +0 -2
- package/modern/index.d.ts +0 -119
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,174 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 7.1.1
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v7.1.0..master -->
|
|
6
|
+
|
|
7
|
+
_May 30, 2025_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 15 contributors who made this release possible.
|
|
10
|
+
|
|
11
|
+
### `@mui/material@7.1.1`
|
|
12
|
+
|
|
13
|
+
- [Autocomplete] Fix label shrink issue when `renderValue` is used with empty array in multiple mode (#46047) @ZeeshanTamboli
|
|
14
|
+
- [Autocomplete] Prevent `renderValue` from being skipped when value is 0 (#46145) @LakshitAgarwal
|
|
15
|
+
- [Autocomplete] Add note in JSDoc for non-TextField components in `renderInput` (#46141) @khllbnomrn
|
|
16
|
+
- [Chip] Add slots and slotProps (#46098) @sai6855
|
|
17
|
+
- [Menu] Remove depreacted `MenuListProps` from demos (#46144) @sai6855
|
|
18
|
+
- [TablePaginationActions] Export TablePaginationActions as new component (#46149) @sai6855
|
|
19
|
+
- [SnackbarContent] Fix `square` prop not working (#46196) @0210shivam
|
|
20
|
+
- [SnackbarContent] Fix error when theme value is CSS variable (#46198) @0210shivam
|
|
21
|
+
|
|
22
|
+
### `@mui/codemod@7.1.1`
|
|
23
|
+
|
|
24
|
+
- Add package name option (#45977) @siriwatknp
|
|
25
|
+
|
|
26
|
+
### `@mui/system@7.1.1`
|
|
27
|
+
|
|
28
|
+
- Skip styled component from being transformed (#46129) @siriwatknp
|
|
29
|
+
- Update the type for borderRadius (#46154) @codiini
|
|
30
|
+
|
|
31
|
+
### `@mui/styled-engine@7.1.1`
|
|
32
|
+
|
|
33
|
+
- Fix variant props callback type to spread `ownerState` (#46187) @siriwatknp
|
|
34
|
+
|
|
35
|
+
### `@mui/stylis-plugin-rtl@7.1.1`
|
|
36
|
+
|
|
37
|
+
- Fix RTL does not work with CSS layer with a new package (#46230) @siriwatknp
|
|
38
|
+
|
|
39
|
+
### Docs
|
|
40
|
+
|
|
41
|
+
- [Dialog] Remove deprecated TransitionComponent from demo (#46185) @sai6855
|
|
42
|
+
- [Grid] Remove direction `column` and `column-reverse` from the demo (#46127) @0210shivam
|
|
43
|
+
- [Grid] Update grid migration guide (#46057) @sai6855
|
|
44
|
+
- [templates] Fix rendering of logos in dark mode (#46221) @sai6855
|
|
45
|
+
- [ToggleButtonGroup] Add spacing demo (#46058) @sai6855
|
|
46
|
+
- Fix typo in dark mode docs (#46229) @ZeeshanTamboli
|
|
47
|
+
- Clarify Next.js + Tailwind CSS v3 integration requirements (#46176) @chaitanyasharma1011
|
|
48
|
+
- Fix GridLegacy docs order (#46135) @oliviertassinari
|
|
49
|
+
- Update upgrade guide for resolution of `react-is` (#46002) @siriwatknp
|
|
50
|
+
- Remove oudated scaffoldhub ad (#46090) @oliviertassinari
|
|
51
|
+
- Show how to target global state classes with CSS Modules (#45992) @RubemMazzetto
|
|
52
|
+
|
|
53
|
+
### Core
|
|
54
|
+
|
|
55
|
+
- [code-infra] Add plugin to check for index file access (#46178) @Janpot
|
|
56
|
+
- [code-infra] Bump eslint to v9 (#46222) @brijeshb42
|
|
57
|
+
- [code-infra] Move packages to mui/mui-public (#46155) @Janpot
|
|
58
|
+
- [code-infra] Move `chai` to peerDep (#46227) @JCQuintas
|
|
59
|
+
- [code-infra] Avoid loading barrel file during type checking (#46177) @Janpot
|
|
60
|
+
- [code-infra] Remove unnecessary ref from `HighlightedCode` component (#46151) @ZeeshanTamboli
|
|
61
|
+
- [code-infra] Import mocha type instead of global (#46108) @JCQuintas
|
|
62
|
+
- [code-infra] Dependabot also create branches (795a481) @oliviertassinari
|
|
63
|
+
- [code-infra] Avoid running continuous release on forks (#46103) @Janpot
|
|
64
|
+
- [code-infra] Remove checkout job altogether (#46100) @Janpot
|
|
65
|
+
- [code-infra] Remove required checkout workflows in circleci (#46099) @Janpot
|
|
66
|
+
- Run pnpm docs:sync-team (c8f1da5) @oliviertassinari
|
|
67
|
+
- Upgrade MUI X packages to v8 (#45990) @KenanYusuf
|
|
68
|
+
- Minor detail to reduce confusion (4c64b72) @oliviertassinari
|
|
69
|
+
- Update security.md (#45839) @DiegoAndai
|
|
70
|
+
- Apply yml convention, blank line only at top level (f273220) @oliviertassinari
|
|
71
|
+
- Add comment that lab should be in alpha (#45999) @oliviertassinari
|
|
72
|
+
|
|
73
|
+
All contributors of this release in alphabetical order: @0210shivam, @brijeshb42, @chaitanyasharma1011, @codiini, @DiegoAndai, @Janpot, @JCQuintas, @KenanYusuf, @khllbnomrn, @LakshitAgarwal, @oliviertassinari, @RubemMazzetto, @sai6855, @siriwatknp, @ZeeshanTamboli
|
|
74
|
+
|
|
75
|
+
## 7.1.0
|
|
76
|
+
|
|
77
|
+
<!-- generated comparing v7.0.2..master -->
|
|
78
|
+
|
|
79
|
+
_May 6, 2025_
|
|
80
|
+
|
|
81
|
+
A big thanks to the 21 contributors who made this release possible. Here are some highlights ✨:
|
|
82
|
+
|
|
83
|
+
- 🎉 Material UI now works with **Tailwind CSS v4**! Check out the [setup guide](https://mui.com/material-ui/integrations/tailwindcss/tailwindcss-v4/).
|
|
84
|
+
|
|
85
|
+
### `@mui/material@7.1.0`
|
|
86
|
+
|
|
87
|
+
- [InputBase] Text cursor jumps several lines up when inserting text fragment with new line at the end (#45246) @yermartee
|
|
88
|
+
- [OutlinedInput] Add missing `notchedOutline` slot (#45917) @siriwatknp
|
|
89
|
+
- [Snackbar] Skip default `onClickAway` behavior when `defaultMuiPrevented` is provided (#45629) @sai6855
|
|
90
|
+
- [Avatar] Fix img slot types and add missing slots (#45483) @siriwatknp
|
|
91
|
+
- [Badge] Replace useSlotProps with useSlot hook (#45871) @sai6855
|
|
92
|
+
- [BottomNavigationAction] Add slots and slotProps (#45776) @sai6855
|
|
93
|
+
- [CardActionArea] Add slots and slotProps (#45866) @sai6855
|
|
94
|
+
- [useMediaQuery] Add warning and docs for using `useMediaQuery('print')` (#44790) @good-jinu
|
|
95
|
+
- Remove unnecessary clsx usages (#46084) @sai6855
|
|
96
|
+
- Corrected generic type definition in `SelectChangeEvent` (#45941) @SuyashShukla0007
|
|
97
|
+
- Fix theme object changes between renders (#45863) @siriwatknp
|
|
98
|
+
|
|
99
|
+
### `@mui/material-nextjs@7.1.0`
|
|
100
|
+
|
|
101
|
+
- Add option to enable CSS layers for pages router (#45596) @siriwatknp
|
|
102
|
+
- Do not wrap `@layer` order rules in App Router (#45864) @Nayeem-XTREME
|
|
103
|
+
|
|
104
|
+
### `@mui/system@7.1.0`
|
|
105
|
+
|
|
106
|
+
- Fix `@mui/system` types organization (#45860) @Janpot
|
|
107
|
+
|
|
108
|
+
### `@mui/styled-engine@7.1.0`
|
|
109
|
+
|
|
110
|
+
- Infer `ownerState` from props in `styled` (#46083) @siriwatknp
|
|
111
|
+
- Fix style overrides variants type (#45478) @siriwatknp
|
|
112
|
+
|
|
113
|
+
### Docs
|
|
114
|
+
|
|
115
|
+
- [Avatar] Add avatar upload demo (#45986) @Demianeen
|
|
116
|
+
- [Dialog] Remove deprecated props usage in demos (#45923) @sai6855
|
|
117
|
+
- [Menu] Update `paper` slot JSDoc default from `Paper` to `PopoverPaper` (#45722) @andreachiera
|
|
118
|
+
- [examples] Remove create-react-app usages (#45426) @CodeLeom
|
|
119
|
+
- Add `AccordionSummary` to the v5 breaking change migration (#45947) @siriwatknp
|
|
120
|
+
- Update CSS variable usage in migration guide for Pigment CSS (#46033) @sai6855
|
|
121
|
+
- Fix docs API dark mode color (#46086) @alexfauquette
|
|
122
|
+
- Add a guide for extending Material UI classes in Tailwind CSS (#46039) @siriwatknp
|
|
123
|
+
- Add `InitColorSchemeScript` docs and API (#45927) @siriwatknp
|
|
124
|
+
- Add Tailwind CSS v4 integration guide (#45906) @siriwatknp
|
|
125
|
+
- Fix 301 links to the system v6 (#45931) @oliviertassinari
|
|
126
|
+
- Add notification for MUI X v8 announcement (#45942) @joserodolfofreitas
|
|
127
|
+
- Fix som 301 redirections (ae84b35) @oliviertassinari
|
|
128
|
+
- Fix some 301 redirections (057384e) @oliviertassinari
|
|
129
|
+
- Fix logo is not centered on small screens (#45920) @crabsim
|
|
130
|
+
- Fix line break typo (a2a62d5) @oliviertassinari
|
|
131
|
+
- Fix markdown typo in templates.md (#45914) @scyzoryck
|
|
132
|
+
- Add Next.js App Router guide for custom classnames (#45852) @siriwatknp
|
|
133
|
+
|
|
134
|
+
### Core
|
|
135
|
+
|
|
136
|
+
- [code-infra] Give a stable name to dev tool app (3889ded) @oliviertassinari
|
|
137
|
+
- [code-infra] Normalize author package in org (8135638) @oliviertassinari
|
|
138
|
+
- [code-infra] Correct some manually curated .d.ts files (#46054) @Janpot
|
|
139
|
+
- [code-infra] Align deps versions (#46048) @Janpot
|
|
140
|
+
- [code-infra] Fix dynamic import in imports resolver (#46046) @Janpot
|
|
141
|
+
- [code-infra] Eliminate `@mui/utils` deep imports (#46004) @Janpot
|
|
142
|
+
- [code-infra] Expand renovate.json for react types (#45935) @Janpot
|
|
143
|
+
- [code-infra] Make Argos upload script reusable (#45883) @Janpot
|
|
144
|
+
- [code-infra] Disallow redundant window prefixes for globals (#45880) @Janpot
|
|
145
|
+
- [code-infra] Remove type generation of modern build (#45912) @Janpot
|
|
146
|
+
- [code-infra] Clean up bundle size checker (#45622) @Janpot
|
|
147
|
+
- [code-infra] Fix `StrictMode` effects not being called twice in React 19 tests (#45812) @bernardobelchior
|
|
148
|
+
- [code-infra] Convert `@mui/utils` to typescript (#45671) @Janpot
|
|
149
|
+
- [docs-infra] Improve export into sandbox package.json (#46044) @oliviertassinari
|
|
150
|
+
- [docs-infra] Update feedback Node.js to v22 (#46064) @oliviertassinari
|
|
151
|
+
- [docs-infra] Normalize netlify.toml in org (b101d5c) @oliviertassinari
|
|
152
|
+
- [docs-infra] Uniformize Vale between repositories (0f79796) @oliviertassinari
|
|
153
|
+
- [docs-infra] Fix Vale no longer working (#46029) @oliviertassinari
|
|
154
|
+
- [docs-infra] Remove demo styling switch (#45926) @Janpot
|
|
155
|
+
- [docs-infra] StackBlitz WebContainer demos (#45924) @Janpot
|
|
156
|
+
- [docs-infra] Fix feedback management (#45872) @alexfauquette
|
|
157
|
+
- [test] Replace `playwright` with `@playwright/test` (#45998) @ZeeshanTamboli
|
|
158
|
+
- Fix internal version duplication (#46051) @oliviertassinari
|
|
159
|
+
- Avoid the need for `@mui/material/themeCssVarsAugmentation` (#46053) @Janpot
|
|
160
|
+
- Add security label to dependabot PRs (0a5c027) @oliviertassinari
|
|
161
|
+
- Remove unecessary versions (#46034) @oliviertassinari
|
|
162
|
+
- Remove redundant overrides resolver (#45970) @romgrk
|
|
163
|
+
- Fix duplicate branch reference (#45915) @oliviertassinari
|
|
164
|
+
- Fix outdated <link rel="shortcut icon" (#45916) @oliviertassinari
|
|
165
|
+
- Fix redirection chains (#45930) @oliviertassinari
|
|
166
|
+
- Run pnpm docs:sync-team (beee09f) @oliviertassinari
|
|
167
|
+
- Add `pkg.pr.new` publishing (#42984) @Aslemammad
|
|
168
|
+
- Remove @mui/base from the master branch (#45857) @mnajdova
|
|
169
|
+
|
|
170
|
+
All contributors of this release in alphabetical order: @alexfauquette, @andreachiera, @Aslemammad, @bernardobelchior, @CodeLeom, @crabsim, @Demianeen, @good-jinu, @Janpot, @joserodolfofreitas, @mnajdova, @Nayeem-XTREME, @oliviertassinari, @renovate[bot], @romgrk, @sai6855, @scyzoryck, @siriwatknp, @SuyashShukla0007, @yermartee, @ZeeshanTamboli
|
|
171
|
+
|
|
3
172
|
## 7.0.2
|
|
4
173
|
|
|
5
174
|
_Apr 9, 2025_
|
package/esm/index.d.ts
CHANGED
|
@@ -42,17 +42,7 @@ export interface CSSOthersObjectForCSSObject {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// Omit variants as a key, because we have a special handling for it
|
|
45
|
-
export interface CSSObject extends CSSPropertiesWithMultiValues, CSSPseudos,
|
|
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
|
-
}
|
|
45
|
+
export interface CSSObject extends CSSPropertiesWithMultiValues, CSSPseudos, CSSOthersObject {}
|
|
56
46
|
export interface ComponentSelector {
|
|
57
47
|
__emotion_styles: any;
|
|
58
48
|
}
|
|
@@ -69,7 +59,22 @@ export interface FunctionInterpolation<Props> {
|
|
|
69
59
|
(props: Props): Interpolation<Props>;
|
|
70
60
|
}
|
|
71
61
|
export interface ArrayInterpolation<Props> extends ReadonlyArray<Interpolation<Props>> {}
|
|
72
|
-
export type Interpolation<Props> =
|
|
62
|
+
export type Interpolation<Props> = null | undefined | boolean | number | string | ComponentSelector | Keyframes | SerializedStyles | CSSPropertiesWithMultiValues | (CSSObject & {
|
|
63
|
+
variants?: Array<{
|
|
64
|
+
props: (Props extends {
|
|
65
|
+
ownerState: infer O;
|
|
66
|
+
} ? Partial<Omit<Props, 'ownerState'> & O> : Partial<Props>) | ((props: Props extends {
|
|
67
|
+
ownerState: infer O;
|
|
68
|
+
} ? Props & O & {
|
|
69
|
+
ownerState: O;
|
|
70
|
+
} : Props) => boolean);
|
|
71
|
+
style: CSSObject | ((args: Props extends {
|
|
72
|
+
theme: any;
|
|
73
|
+
} ? {
|
|
74
|
+
theme: Props['theme'];
|
|
75
|
+
} : any) => CSSObject);
|
|
76
|
+
}>;
|
|
77
|
+
}) | ArrayInterpolation<Props> | FunctionInterpolation<Props>;
|
|
73
78
|
export function shouldForwardProp(propName: PropertyKey): boolean;
|
|
74
79
|
|
|
75
80
|
/** Same as StyledOptions but shouldForwardProp must be a type guard */
|
package/esm/index.js
CHANGED
package/index.d.ts
CHANGED
|
@@ -42,17 +42,7 @@ export interface CSSOthersObjectForCSSObject {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
// Omit variants as a key, because we have a special handling for it
|
|
45
|
-
export interface CSSObject extends CSSPropertiesWithMultiValues, CSSPseudos,
|
|
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
|
-
}
|
|
45
|
+
export interface CSSObject extends CSSPropertiesWithMultiValues, CSSPseudos, CSSOthersObject {}
|
|
56
46
|
export interface ComponentSelector {
|
|
57
47
|
__emotion_styles: any;
|
|
58
48
|
}
|
|
@@ -69,7 +59,22 @@ export interface FunctionInterpolation<Props> {
|
|
|
69
59
|
(props: Props): Interpolation<Props>;
|
|
70
60
|
}
|
|
71
61
|
export interface ArrayInterpolation<Props> extends ReadonlyArray<Interpolation<Props>> {}
|
|
72
|
-
export type Interpolation<Props> =
|
|
62
|
+
export type Interpolation<Props> = null | undefined | boolean | number | string | ComponentSelector | Keyframes | SerializedStyles | CSSPropertiesWithMultiValues | (CSSObject & {
|
|
63
|
+
variants?: Array<{
|
|
64
|
+
props: (Props extends {
|
|
65
|
+
ownerState: infer O;
|
|
66
|
+
} ? Partial<Omit<Props, 'ownerState'> & O> : Partial<Props>) | ((props: Props extends {
|
|
67
|
+
ownerState: infer O;
|
|
68
|
+
} ? Props & O & {
|
|
69
|
+
ownerState: O;
|
|
70
|
+
} : Props) => boolean);
|
|
71
|
+
style: CSSObject | ((args: Props extends {
|
|
72
|
+
theme: any;
|
|
73
|
+
} ? {
|
|
74
|
+
theme: Props['theme'];
|
|
75
|
+
} : any) => CSSObject);
|
|
76
|
+
}>;
|
|
77
|
+
}) | ArrayInterpolation<Props> | FunctionInterpolation<Props>;
|
|
73
78
|
export function shouldForwardProp(propName: PropertyKey): boolean;
|
|
74
79
|
|
|
75
80
|
/** Same as StyledOptions but shouldForwardProp must be a type guard */
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/styled-engine",
|
|
3
|
-
"version": "7.
|
|
4
|
-
"private": false,
|
|
3
|
+
"version": "7.1.1",
|
|
5
4
|
"author": "MUI Team",
|
|
6
5
|
"description": "styled() API wrapper package for emotion.",
|
|
7
6
|
"main": "./index.js",
|
|
@@ -26,7 +25,7 @@
|
|
|
26
25
|
"url": "https://opencollective.com/mui-org"
|
|
27
26
|
},
|
|
28
27
|
"dependencies": {
|
|
29
|
-
"@babel/runtime": "^7.27.
|
|
28
|
+
"@babel/runtime": "^7.27.1",
|
|
30
29
|
"@emotion/cache": "^11.13.5",
|
|
31
30
|
"@emotion/serialize": "^1.3.3",
|
|
32
31
|
"@emotion/sheet": "^1.4.0",
|
|
@@ -54,6 +53,7 @@
|
|
|
54
53
|
"engines": {
|
|
55
54
|
"node": ">=14.0.0"
|
|
56
55
|
},
|
|
56
|
+
"private": false,
|
|
57
57
|
"module": "./esm/index.js",
|
|
58
58
|
"exports": {
|
|
59
59
|
"./package.json": "./package.json",
|
|
@@ -1,7 +0,0 @@
|
|
|
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/modern/index.d.ts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
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
|
-
}
|