@mui/styled-engine-sc 9.0.0 → 9.1.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 +216 -1245
- package/GlobalStyles/GlobalStyles.d.mts +4 -3
- package/GlobalStyles/GlobalStyles.d.ts +4 -3
- package/GlobalStyles/GlobalStyles.js +2 -2
- package/GlobalStyles/GlobalStyles.mjs +2 -2
- package/GlobalStyles/index.d.mts +1 -1
- package/GlobalStyles/index.d.ts +1 -1
- package/LICENSE +1 -1
- package/StyledEngineProvider/StyledEngineProvider.d.mts +1 -1
- package/StyledEngineProvider/StyledEngineProvider.d.ts +1 -1
- package/StyledEngineProvider/StyledEngineProvider.js +2 -2
- package/StyledEngineProvider/StyledEngineProvider.mjs +2 -2
- package/StyledEngineProvider/index.d.mts +1 -1
- package/StyledEngineProvider/index.d.ts +1 -1
- package/index.d.mts +16 -73
- package/index.d.ts +16 -73
- package/index.js +56 -12
- package/index.mjs +54 -8
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/styled-engine-sc v9.
|
|
2
|
+
* @mui/styled-engine-sc v9.1.0
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
9
|
+
import { styled as scStyled } from 'styled-components';
|
|
10
|
+
|
|
11
|
+
// Re-export the full `styled-components` *type* surface, matching the
|
|
12
|
+
// hand-written `.d.ts` that this conversion replaces. Type-only: emits
|
|
13
|
+
// nothing at runtime. Local declarations below intentionally shadow some
|
|
14
|
+
// styled-components names (`Keyframes`, `Interpolation`, `StyledComponent`,
|
|
15
|
+
// `CSSObject`, …) — local declarations win over re-exports.
|
|
16
|
+
|
|
17
|
+
// Helper type operators
|
|
18
|
+
// Pick that distributes over union types
|
|
19
|
+
|
|
20
|
+
// Any prop that has a default prop becomes optional, but its type is unchanged
|
|
21
|
+
// Undeclared default props are augmented into the resulting allowable attributes
|
|
22
|
+
// If declared props have indexed properties, ignore default props entirely as keyof gets widened
|
|
23
|
+
// Wrap in an outer-level conditional type to allow distribution over props that are unions
|
|
24
|
+
|
|
25
|
+
function styled(tag, options) {
|
|
10
26
|
let stylesFactory;
|
|
11
27
|
if (options) {
|
|
12
28
|
stylesFactory = scStyled(tag).withConfig({
|
|
@@ -31,8 +47,11 @@ export default function styled(tag, options) {
|
|
|
31
47
|
}
|
|
32
48
|
return stylesFactory;
|
|
33
49
|
}
|
|
50
|
+
export default styled;
|
|
34
51
|
|
|
35
|
-
|
|
52
|
+
/**
|
|
53
|
+
* For internal usage in `@mui/system` package
|
|
54
|
+
*/
|
|
36
55
|
export function internal_mutateStyles(tag, processor) {
|
|
37
56
|
// Styled-components attaches an instance to `componentStyle`.
|
|
38
57
|
// https://github.com/styled-components/styled-components/blob/da8151762dcf72735ffba358173d4c097f6d5888/packages/styled-components/src/models/StyledComponent.ts#L257
|
|
@@ -46,15 +65,42 @@ export function internal_mutateStyles(tag, processor) {
|
|
|
46
65
|
|
|
47
66
|
// Not needed anymore, but fixes https://github.com/mui/material-ui/issues/44112
|
|
48
67
|
// TODO: Remove it in v7
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
50
68
|
export function internal_processStyles(tag, processor) {
|
|
51
69
|
return internal_mutateStyles(tag, processor);
|
|
52
70
|
}
|
|
53
|
-
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
55
71
|
export function internal_serializeStyles(styles) {
|
|
56
72
|
return styles;
|
|
57
73
|
}
|
|
58
74
|
export { ThemeContext, keyframes, css } from 'styled-components';
|
|
59
75
|
export { default as StyledEngineProvider } from "./StyledEngineProvider/index.mjs";
|
|
60
|
-
export { default as GlobalStyles } from "./GlobalStyles/index.mjs";
|
|
76
|
+
export { default as GlobalStyles } from "./GlobalStyles/index.mjs";
|
|
77
|
+
|
|
78
|
+
// These are the same as the ones in @mui/styled-engine
|
|
79
|
+
// CSS.PropertiesFallback are necessary so that we support spreading of the mixins. For example:
|
|
80
|
+
// '@font-face'?: Fontface | Fontface[]
|
|
81
|
+
|
|
82
|
+
// Omit variants as a key, because we have a special handling for it
|
|
83
|
+
|
|
84
|
+
// cannot be made a self-referential interface, breaks WithPropNested
|
|
85
|
+
// see https://github.com/microsoft/TypeScript/issues/34796
|
|
86
|
+
|
|
87
|
+
// adapter for compatibility with @mui/styled-engine
|
|
88
|
+
|
|
89
|
+
// abuse Pick to strip the call signature from ForwardRefExoticComponent
|
|
90
|
+
|
|
91
|
+
// any doesn't count as assignable to never in the extends clause, and we default A to never
|
|
92
|
+
|
|
93
|
+
// remove the call signature from StyledComponent so Interpolation can still infer InterpolationFunction
|
|
94
|
+
|
|
95
|
+
// These are typings coming from styled-components
|
|
96
|
+
// They are adjusted to accept the extended options coming from mui
|
|
97
|
+
|
|
98
|
+
// Same as in styled-components, but copied here so that it would use the Interpolation & CSS typings from above
|
|
99
|
+
|
|
100
|
+
// same as ThemedStyledFunction in styled-components, but without attrs, and withConfig
|
|
101
|
+
|
|
102
|
+
// Config to be used with withConfig
|
|
103
|
+
|
|
104
|
+
/** Same as StyledConfig but shouldForwardProp must be a type guard */
|
|
105
|
+
|
|
106
|
+
// same as ThemedBaseStyledInterface in styled-components, but with added options & common props for MUI components
|