@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/index.mjs CHANGED
@@ -1,12 +1,28 @@
1
1
  /**
2
- * @mui/styled-engine-sc v9.0.0
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
- import scStyled from 'styled-components';
9
- export default function styled(tag, options) {
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
- // eslint-disable-next-line @typescript-eslint/naming-convention
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/styled-engine-sc",
3
- "version": "9.0.0",
3
+ "version": "9.1.0",
4
4
  "author": "MUI Team",
5
5
  "description": "styled() API wrapper package for styled-components.",
6
6
  "license": "MIT",