styled-components 5.3.7 → 5.3.8
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/dist/styled-components.browser.cjs.js +1 -1
- package/dist/styled-components.browser.cjs.js.map +1 -1
- package/dist/styled-components.browser.esm.js +1 -1
- package/dist/styled-components.browser.esm.js.map +1 -1
- package/dist/styled-components.cjs.js +1 -1
- package/dist/styled-components.cjs.js.map +1 -1
- package/dist/styled-components.esm.js +1 -1
- package/dist/styled-components.esm.js.map +1 -1
- package/dist/styled-components.js +1 -1
- package/dist/styled-components.js.map +1 -1
- package/dist/styled-components.min.js +1 -1
- package/dist/styled-components.min.js.map +1 -1
- package/native/dist/constructors/constructWithOptions.d.ts +4 -4
- package/native/dist/hoc/withTheme.d.ts +1 -1
- package/native/dist/models/StyleSheetManager.d.ts +3 -3
- package/native/dist/models/ThemeProvider.d.ts +3 -3
- package/native/dist/sheet/Sheet.d.ts +3 -3
- package/native/dist/sheet/types.d.ts +1 -1
- package/native/dist/styled-components.native.cjs.js +2 -2
- package/native/dist/styled-components.native.cjs.js.map +1 -1
- package/native/dist/styled-components.native.esm.js +2 -2
- package/native/dist/styled-components.native.esm.js.map +1 -1
- package/native/dist/types.d.ts +18 -18
- package/native/dist/utils/hoist.d.ts +3 -3
- package/native/dist/utils/stylis.d.ts +1 -1
- package/package.json +1 -1
- package/primitives/dist/styled-components-primitives.cjs.js +2 -2
- package/primitives/dist/styled-components-primitives.cjs.js.map +1 -1
- package/primitives/dist/styled-components-primitives.esm.js +2 -2
- package/primitives/dist/styled-components-primitives.esm.js.map +1 -1
package/native/dist/types.d.ts
CHANGED
|
@@ -6,16 +6,16 @@ interface ExoticComponentWithDisplayName<P = any> extends React.ExoticComponent<
|
|
|
6
6
|
defaultProps?: Partial<P>;
|
|
7
7
|
displayName?: string;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type OmitNever<T> = {
|
|
10
10
|
[K in keyof T as T[K] extends never ? never : K]: T[K];
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type Runtime = 'web' | 'native';
|
|
13
13
|
export { DefaultTheme };
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
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
|
|
26
|
+
export type Dict<T> = {
|
|
27
27
|
[key: string]: T;
|
|
28
28
|
};
|
|
29
29
|
export interface ExecutionProps {
|
|
@@ -50,12 +50,12 @@ export interface ExecutionContext extends ExecutionProps {
|
|
|
50
50
|
export interface StyleFunction<Props extends object> {
|
|
51
51
|
(executionContext: ExecutionContext & Omit<Props, keyof ExecutionContext>): Interpolation<Props>;
|
|
52
52
|
}
|
|
53
|
-
export
|
|
54
|
-
export
|
|
55
|
-
export
|
|
56
|
-
export
|
|
57
|
-
export
|
|
58
|
-
export
|
|
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
|
|
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
|
|
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<
|
|
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
|
|
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
|
-
|
|
44
|
-
|
|
43
|
+
type OmniComponent = AnyComponent;
|
|
44
|
+
type ExcludeList = {
|
|
45
45
|
[key: string]: true;
|
|
46
46
|
};
|
|
47
|
-
|
|
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>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "styled-components",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.8",
|
|
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
|
"main": "dist/styled-components.cjs.js",
|
|
6
6
|
"jsnext:main": "dist/styled-components.esm.js",
|
|
@@ -155,10 +155,10 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
155
155
|
var SC_ATTR = typeof process !== 'undefined' && typeof process.env !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';
|
|
156
156
|
var SC_ATTR_ACTIVE = 'active';
|
|
157
157
|
var SC_ATTR_VERSION = 'data-styled-version';
|
|
158
|
-
var SC_VERSION = "5.3.
|
|
158
|
+
var SC_VERSION = "5.3.8";
|
|
159
159
|
var SPLITTER = '/*!sc*/\n';
|
|
160
160
|
var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
|
|
161
|
-
var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean' ? SC_DISABLE_SPEEDY : typeof process !== 'undefined' && typeof process.env !== 'undefined'
|
|
161
|
+
var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean' ? SC_DISABLE_SPEEDY : typeof process !== 'undefined' && typeof process.env !== 'undefined' ? typeof process.env.REACT_APP_SC_DISABLE_SPEEDY !== 'undefined' && process.env.REACT_APP_SC_DISABLE_SPEEDY !== '' ? process.env.REACT_APP_SC_DISABLE_SPEEDY === 'false' ? false : process.env.REACT_APP_SC_DISABLE_SPEEDY : typeof process.env.SC_DISABLE_SPEEDY !== 'undefined' && process.env.SC_DISABLE_SPEEDY !== '' ? process.env.SC_DISABLE_SPEEDY === 'false' ? false : process.env.SC_DISABLE_SPEEDY : process.env.NODE_ENV !== 'production' : false); // Shared empty execution context when generating static styles
|
|
162
162
|
|
|
163
163
|
//
|
|
164
164
|
var EMPTY_ARRAY = Object.freeze([]);
|