styled-components 6.0.0-beta.10 → 6.0.0-beta.12

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.
Files changed (36) hide show
  1. package/dist/constructors/constructWithOptions.d.ts +4 -4
  2. package/dist/hoc/withTheme.d.ts +1 -1
  3. package/dist/models/StyleSheetManager.d.ts +3 -3
  4. package/dist/models/ThemeProvider.d.ts +3 -3
  5. package/dist/sheet/Sheet.d.ts +3 -3
  6. package/dist/sheet/types.d.ts +1 -1
  7. package/dist/styled-components.browser.cjs.js +2 -1
  8. package/dist/styled-components.browser.cjs.js.map +1 -1
  9. package/dist/styled-components.browser.esm.js +2 -1
  10. package/dist/styled-components.browser.esm.js.map +1 -1
  11. package/dist/styled-components.cjs.js +2 -1
  12. package/dist/styled-components.cjs.js.map +1 -1
  13. package/dist/styled-components.esm.js +2 -1
  14. package/dist/styled-components.esm.js.map +1 -1
  15. package/dist/styled-components.js +8 -7
  16. package/dist/styled-components.js.map +1 -1
  17. package/dist/styled-components.min.js +1 -1
  18. package/dist/styled-components.min.js.map +1 -1
  19. package/dist/tsconfig.tsbuildinfo +1 -1
  20. package/dist/types.d.ts +20 -20
  21. package/dist/utils/hoist.d.ts +3 -3
  22. package/dist/utils/stylis.d.ts +1 -1
  23. package/native/dist/constructors/constructWithOptions.d.ts +4 -4
  24. package/native/dist/hoc/withTheme.d.ts +1 -1
  25. package/native/dist/models/StyleSheetManager.d.ts +3 -3
  26. package/native/dist/models/ThemeProvider.d.ts +3 -3
  27. package/native/dist/sheet/Sheet.d.ts +3 -3
  28. package/native/dist/sheet/types.d.ts +1 -1
  29. package/native/dist/styled-components.native.cjs.js +2 -1
  30. package/native/dist/styled-components.native.cjs.js.map +1 -1
  31. package/native/dist/styled-components.native.esm.js +2 -1
  32. package/native/dist/styled-components.native.esm.js.map +1 -1
  33. package/native/dist/types.d.ts +20 -20
  34. package/native/dist/utils/hoist.d.ts +3 -3
  35. package/native/dist/utils/stylis.d.ts +1 -1
  36. package/package.json +31 -24
@@ -6,16 +6,16 @@ interface ExoticComponentWithDisplayName<P = any> extends React.ExoticComponent<
6
6
  defaultProps?: Partial<P>;
7
7
  displayName?: string;
8
8
  }
9
- export declare type OmitNever<T> = {
9
+ export type OmitNever<T> = {
10
10
  [K in keyof T as T[K] extends never ? never : K]: T[K];
11
11
  };
12
- export declare type Runtime = 'web' | 'native';
12
+ export type Runtime = 'web' | 'native';
13
13
  export { DefaultTheme };
14
- export declare type AnyComponent<P = any> = ExoticComponentWithDisplayName<P> | React.ComponentType<P>;
15
- export declare type KnownTarget = keyof JSX.IntrinsicElements | AnyComponent;
16
- export declare type WebTarget = string | KnownTarget;
17
- export declare type NativeTarget = AnyComponent;
18
- export declare type StyledTarget<R extends Runtime> = R extends 'web' ? WebTarget : NativeTarget;
14
+ export type AnyComponent<P = any> = ExoticComponentWithDisplayName<P> | React.ComponentType<P>;
15
+ export type KnownTarget = keyof JSX.IntrinsicElements | AnyComponent;
16
+ export type WebTarget = string | KnownTarget;
17
+ export type NativeTarget = AnyComponent;
18
+ export type StyledTarget<R extends Runtime> = R extends 'web' ? WebTarget : NativeTarget;
19
19
  export interface StyledOptions<R extends Runtime, Props extends object> {
20
20
  attrs?: AttrsArg<Props>[];
21
21
  componentId?: R extends 'web' ? string : never;
@@ -23,7 +23,7 @@ export interface StyledOptions<R extends Runtime, Props extends object> {
23
23
  parentComponentId?: R extends 'web' ? string : never;
24
24
  shouldForwardProp?: ShouldForwardProp<R>;
25
25
  }
26
- export declare type Dict<T> = {
26
+ export type Dict<T> = {
27
27
  [key: string]: T;
28
28
  };
29
29
  export interface ExecutionProps {
@@ -48,14 +48,14 @@ export interface ExecutionContext extends ExecutionProps {
48
48
  theme: DefaultTheme;
49
49
  }
50
50
  export interface StyleFunction<Props extends object> {
51
- (executionContext: Omit<ExecutionContext, keyof Props> & Props): Interpolation<Props>;
52
- }
53
- export declare type Interpolation<Props extends object> = StyleFunction<Props> | StyledObject<Props> | TemplateStringsArray | string | number | false | undefined | null | Keyframes | IStyledComponent<'web', any, any> | Interpolation<Props>[];
54
- export declare type AttrsArg<Props extends object> = (Omit<ExecutionProps, keyof Props> & Props) | ((props: Omit<ExecutionContext, keyof Props> & Props) => Partial<Props>);
55
- export declare type Attrs = object | ((...args: any) => object);
56
- export declare type RuleSet<Props extends object> = Interpolation<Props>[];
57
- export declare type Styles<Props extends object> = TemplateStringsArray | StyledObject<Props> | StyleFunction<Props>;
58
- export declare type NameGenerator = (hash: number) => string;
51
+ (executionContext: ExecutionContext & Omit<Props, keyof ExecutionContext>): Interpolation<Props>;
52
+ }
53
+ export type Interpolation<Props extends object> = StyleFunction<Props> | StyledObject<Props> | TemplateStringsArray | string | number | false | undefined | null | Keyframes | IStyledComponent<'web', any, any> | Interpolation<Props>[];
54
+ export type AttrsArg<Props extends object> = (Omit<ExecutionProps, keyof Props> & Props) | ((props: Omit<ExecutionContext, keyof Props> & Props) => Partial<Props>);
55
+ export type Attrs = object | ((...args: any) => object);
56
+ export type RuleSet<Props extends object> = Interpolation<Props>[];
57
+ export type Styles<Props extends object> = TemplateStringsArray | StyledObject<Props> | StyleFunction<Props>;
58
+ export type NameGenerator = (hash: number) => string;
59
59
  export interface StyleSheet {
60
60
  create: Function;
61
61
  }
@@ -67,7 +67,7 @@ export interface Keyframes {
67
67
  export interface Flattener<Props extends object> {
68
68
  (chunks: Interpolation<Props>[], executionContext: Object | null | undefined, styleSheet: Object | null | undefined): Interpolation<Props>[];
69
69
  }
70
- export declare type FlattenerResult<Props extends object> = RuleSet<Props> | number | string | string[] | IStyledComponent<'web', any, any> | Keyframes;
70
+ export type FlattenerResult<Props extends object> = RuleSet<Props> | number | string | string[] | IStyledComponent<'web', any, any> | Keyframes;
71
71
  export interface Stringifier {
72
72
  (css: string, selector?: string, prefix?: string, componentId?: string): string[];
73
73
  hash: string;
@@ -91,7 +91,7 @@ export interface IStyledStatics<R extends Runtime, OuterProps extends object> ex
91
91
  /**
92
92
  * Used by PolymorphicComponent to define prop override cascading order.
93
93
  */
94
- export declare type PolymorphicComponentProps<R extends Runtime, E extends StyledTarget<R>, P extends object> = Omit<E extends KnownTarget ? P & Omit<React.ComponentPropsWithRef<E>, keyof P> : P, 'as' | 'theme'> & {
94
+ export type PolymorphicComponentProps<R extends Runtime, E extends StyledTarget<R>, P extends object> = Omit<E extends KnownTarget ? P & Omit<React.ComponentPropsWithRef<E>, keyof P> : P, 'as' | 'theme'> & {
95
95
  as?: P extends {
96
96
  as?: string | AnyComponent;
97
97
  } ? P['as'] : E;
@@ -103,7 +103,7 @@ export declare type PolymorphicComponentProps<R extends Runtime, E extends Style
103
103
  * automatically attempt to extract props from the given rendering target to
104
104
  * get proper typing for any specialized props in the target component.
105
105
  */
106
- export interface PolymorphicComponent<R extends Runtime, P extends object, FallbackComponent extends StyledTarget<R>> extends React.ForwardRefExoticComponent<object> {
106
+ export interface PolymorphicComponent<R extends Runtime, P extends object, FallbackComponent extends StyledTarget<R>> extends React.ForwardRefExoticComponent<P> {
107
107
  <E extends StyledTarget<R> = FallbackComponent>(props: PolymorphicComponentProps<R, E, P>): React.ReactElement | null;
108
108
  }
109
109
  export interface IStyledComponent<R extends Runtime, Target extends StyledTarget<R>, Props extends object> extends PolymorphicComponent<R, Props, Target>, IStyledStatics<R, Props> {
@@ -145,4 +145,4 @@ export interface StyledObject<Props extends object> {
145
145
  * }
146
146
  * ```
147
147
  */
148
- export declare type CSSProp = string | StyledObject<any> | StyleFunction<any>;
148
+ export type CSSProp = string | StyledObject<any> | StyleFunction<any>;
@@ -40,11 +40,11 @@ declare const MEMO_STATICS: {
40
40
  propTypes: boolean;
41
41
  type: boolean;
42
42
  };
43
- declare type OmniComponent = AnyComponent;
44
- declare type ExcludeList = {
43
+ type OmniComponent = AnyComponent;
44
+ type ExcludeList = {
45
45
  [key: string]: true;
46
46
  };
47
- declare type NonReactStatics<S extends OmniComponent, C extends ExcludeList = {}> = {
47
+ type NonReactStatics<S extends OmniComponent, C extends ExcludeList = {}> = {
48
48
  [key in Exclude<keyof S, S extends React.MemoExoticComponent<any> ? keyof typeof MEMO_STATICS | keyof C : S extends React.ForwardRefExoticComponent<any> ? keyof typeof FORWARD_REF_STATICS | keyof C : keyof typeof REACT_STATICS | keyof typeof KNOWN_STATICS | keyof C>]: S[key];
49
49
  };
50
50
  export default function hoistNonReactStatics<T extends OmniComponent, S extends OmniComponent, C extends ExcludeList = {}>(targetComponent: T, sourceComponent: S, excludelist?: C): T & NonReactStatics<S, C>;
@@ -1,6 +1,6 @@
1
1
  import { Middleware } from 'stylis';
2
2
  import { Stringifier } from '../types';
3
- export declare type ICreateStylisInstance = {
3
+ export type ICreateStylisInstance = {
4
4
  options?: {
5
5
  namespace?: string;
6
6
  prefix?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styled-components",
3
- "version": "6.0.0-beta.10",
3
+ "version": "6.0.0-beta.12",
4
4
  "description": "Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/styled-components.cjs.js",
@@ -10,9 +10,18 @@
10
10
  "./dist/styled-components.esm.js": "./dist/styled-components.browser.esm.js",
11
11
  "./dist/styled-components.cjs.js": "./dist/styled-components.browser.cjs.js"
12
12
  },
13
- "sideEffects": [
14
- "./src/base.js"
15
- ],
13
+ "sideEffects": false,
14
+ "exports": {
15
+ "types": "./dist/index.d.ts",
16
+ "node": {
17
+ "require": "./dist/styled-components.cjs.js",
18
+ "import": "./dist/styled-components.esm.js",
19
+ "default": "./dist/styled-components.cjs.js"
20
+ },
21
+ "require": "./dist/styled-components.browser.cjs.js",
22
+ "import": "./dist/styled-components.browser.esm.js",
23
+ "default": "./dist/styled-components.browser.cjs.js"
24
+ },
16
25
  "scripts": {
17
26
  "generateErrors": "node scripts/generateErrorMap.js",
18
27
  "prebuild": "rimraf dist && yarn generateErrors",
@@ -32,10 +41,8 @@
32
41
  "url": "git+https://github.com/styled-components/styled-components.git"
33
42
  },
34
43
  "files": [
35
- "CHANGELOG.md",
36
- "CODE_OF_CONDUCT.md",
37
- "CONTRIBUTING.md",
38
44
  "LICENSE",
45
+ "README.md",
39
46
  "dist",
40
47
  "native",
41
48
  "test-utils",
@@ -57,21 +64,21 @@
57
64
  },
58
65
  "homepage": "https://styled-components.com",
59
66
  "dependencies": {
60
- "@babel/cli": "^7.20.7",
61
- "@babel/core": "^7.20.7",
67
+ "@babel/cli": "^7.21.0",
68
+ "@babel/core": "^7.21.0",
62
69
  "@babel/helper-module-imports": "^7.18.6",
63
70
  "@babel/plugin-external-helpers": "^7.18.6",
64
71
  "@babel/plugin-proposal-class-properties": "^7.18.6",
65
72
  "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
66
73
  "@babel/preset-env": "^7.20.2",
67
74
  "@babel/preset-react": "^7.18.6",
68
- "@babel/preset-typescript": "^7.18.6",
69
- "@babel/traverse": "^7.20.10",
75
+ "@babel/preset-typescript": "^7.21.0",
76
+ "@babel/traverse": "^7.21.2",
70
77
  "@emotion/unitless": "^0.8.0",
71
- "css-to-react-native": "^3.0.0",
78
+ "css-to-react-native": "^3.2.0",
72
79
  "shallowequal": "^1.1.0",
73
80
  "stylis": "^4.1.3",
74
- "tslib": "^2.4.1"
81
+ "tslib": "^2.5.0"
75
82
  },
76
83
  "peerDependencies": {
77
84
  "babel-plugin-styled-components": ">= 2",
@@ -96,13 +103,13 @@
96
103
  }
97
104
  },
98
105
  "devDependencies": {
99
- "@babel/plugin-transform-flow-strip-types": "^7.19.0",
100
- "@rollup/plugin-typescript": "^10.0.1",
106
+ "@babel/plugin-transform-flow-strip-types": "^7.21.0",
107
+ "@rollup/plugin-typescript": "^11.0.0",
101
108
  "@types/babel-plugin-macros": "^2.8.4",
102
109
  "@types/enzyme": "^3.10.12",
103
- "@types/jest": "^29.2.4",
110
+ "@types/jest": "^29.4.0",
104
111
  "@types/js-beautify": "^1.13.1",
105
- "@types/node": "^18.11.17",
112
+ "@types/node": "^18.14.2",
106
113
  "@types/react": "^17.0.22",
107
114
  "@types/react-dom": "^17.0.9",
108
115
  "@types/react-frame-component": "^4.1.3",
@@ -110,25 +117,25 @@
110
117
  "@types/react-test-renderer": "^17.0.1",
111
118
  "@types/shallowequal": "^1.1.1",
112
119
  "@types/stylis": "^4.0.2",
113
- "babel-jest": "^29.3.1",
120
+ "babel-jest": "^29.4.3",
114
121
  "babel-plugin-add-module-exports": "^1.0.4",
115
122
  "babel-plugin-macros": "^3.1.0",
116
123
  "babel-plugin-styled-components": "^2.0.7",
117
124
  "babel-plugin-tester": "^10.0.0",
118
125
  "bundlewatch": "^0.3.3",
119
- "jest": "^29.3.1",
120
- "jest-environment-jsdom": "^29.3.1",
126
+ "jest": "^29.4.3",
127
+ "jest-environment-jsdom": "^29.4.3",
121
128
  "jest-serializer-html": "^7.0.0",
122
- "jest-watch-typeahead": "^2.0.0",
129
+ "jest-watch-typeahead": "^2.2.2",
123
130
  "js-beautify": "^1.14.7",
124
- "prettier": "^2.8.1",
131
+ "prettier": "^2.8.4",
125
132
  "prop-types": "^15.8.1",
126
133
  "react": "^17.0.2",
127
134
  "react-dom": "^17.0.2",
128
135
  "react-frame-component": "^4.0.2",
129
136
  "react-native": "^0.70.6",
130
137
  "react-test-renderer": "^17.0.2",
131
- "rollup": "^3.0.0",
138
+ "rollup": "^3.18.0",
132
139
  "rollup-plugin-commonjs": "^10.1.0",
133
140
  "rollup-plugin-json": "^4.0.0",
134
141
  "rollup-plugin-node-resolve": "^5.2.0",
@@ -136,7 +143,7 @@
136
143
  "rollup-plugin-sourcemaps": "^0.6.3",
137
144
  "rollup-plugin-terser": "^7.0.2",
138
145
  "stylis-plugin-rtl": "^2.1.1",
139
- "typescript": "^4.8.4",
146
+ "typescript": "^4.9.5",
140
147
  "utility-types": "^3.10.0"
141
148
  },
142
149
  "bundlewatch": {