styled-components 6.0.0-beta.2 → 6.0.0-beta.4
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/base.d.ts +1 -1
- package/dist/constructors/constructWithOptions.d.ts +21 -26
- package/dist/constructors/createGlobalStyle.d.ts +2 -2
- package/dist/constructors/css.d.ts +4 -4
- package/dist/constructors/keyframes.d.ts +1 -1
- package/dist/constructors/styled.d.ts +176 -180
- package/dist/hoc/withTheme.d.ts +2 -2
- package/dist/models/GlobalStyle.d.ts +1 -1
- package/dist/models/InlineStyle.d.ts +1 -1
- package/dist/models/StyledComponent.d.ts +1 -1
- package/dist/models/StyledNativeComponent.d.ts +2 -2
- package/dist/native/index.d.ts +25 -29
- package/dist/styled-components.browser.cjs.js +52 -64
- package/dist/styled-components.browser.cjs.js.map +1 -1
- package/dist/styled-components.browser.esm.js +52 -64
- package/dist/styled-components.browser.esm.js.map +1 -1
- package/dist/styled-components.cjs.js +52 -64
- package/dist/styled-components.cjs.js.map +1 -1
- package/dist/styled-components.esm.js +52 -64
- package/dist/styled-components.esm.js.map +1 -1
- package/dist/styled-components.js +52 -64
- 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/dist/test/utils.d.ts +176 -180
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +56 -42
- package/dist/utils/determineTheme.d.ts +2 -2
- package/dist/utils/empties.d.ts +2 -2
- package/dist/utils/flatten.d.ts +3 -3
- package/dist/utils/interleave.d.ts +1 -1
- package/dist/utils/isStaticRules.d.ts +1 -1
- package/dist/utils/isStyledComponent.d.ts +1 -1
- package/dist/utils/joinStrings.d.ts +1 -1
- package/dist/utils/mixinDeep.d.ts +1 -2
- package/native/dist/base.d.ts +1 -1
- package/native/dist/constructors/constructWithOptions.d.ts +21 -26
- package/native/dist/constructors/createGlobalStyle.d.ts +2 -2
- package/native/dist/constructors/css.d.ts +4 -4
- package/native/dist/constructors/keyframes.d.ts +1 -1
- package/native/dist/constructors/styled.d.ts +176 -180
- package/native/dist/hoc/withTheme.d.ts +2 -2
- package/native/dist/models/GlobalStyle.d.ts +1 -1
- package/native/dist/models/InlineStyle.d.ts +1 -1
- package/native/dist/models/StyledComponent.d.ts +1 -1
- package/native/dist/models/StyledNativeComponent.d.ts +2 -2
- package/native/dist/native/index.d.ts +25 -29
- package/native/dist/styled-components.native.cjs.js +24 -37
- package/native/dist/styled-components.native.cjs.js.map +1 -1
- package/native/dist/styled-components.native.esm.js +24 -37
- package/native/dist/styled-components.native.esm.js.map +1 -1
- package/native/dist/test/utils.d.ts +176 -180
- package/native/dist/types.d.ts +56 -42
- package/native/dist/utils/determineTheme.d.ts +2 -2
- package/native/dist/utils/empties.d.ts +2 -2
- package/native/dist/utils/flatten.d.ts +3 -3
- package/native/dist/utils/interleave.d.ts +1 -1
- package/native/dist/utils/isStaticRules.d.ts +1 -1
- package/native/dist/utils/isStyledComponent.d.ts +1 -1
- package/native/dist/utils/joinStrings.d.ts +1 -1
- package/native/dist/utils/mixinDeep.d.ts +1 -2
- package/package.json +3 -3
- package/test-utils/index.ts +10 -6
- package/native/dist/base.d.ts.map +0 -1
- package/native/dist/constants.d.ts.map +0 -1
- package/native/dist/constructors/constructWithOptions.d.ts.map +0 -1
- package/native/dist/constructors/createGlobalStyle.d.ts.map +0 -1
- package/native/dist/constructors/css.d.ts.map +0 -1
- package/native/dist/constructors/keyframes.d.ts.map +0 -1
- package/native/dist/constructors/styled.d.ts.map +0 -1
- package/native/dist/dist/base.d.ts +0 -18
- package/native/dist/dist/base.d.ts.map +0 -1
- package/native/dist/dist/constants.d.ts +0 -9
- package/native/dist/dist/constants.d.ts.map +0 -1
- package/native/dist/dist/constructors/constructWithOptions.d.ts +0 -20
- package/native/dist/dist/constructors/constructWithOptions.d.ts.map +0 -1
- package/native/dist/dist/constructors/createGlobalStyle.d.ts +0 -4
- package/native/dist/dist/constructors/createGlobalStyle.d.ts.map +0 -1
- package/native/dist/dist/constructors/css.d.ts +0 -5
- package/native/dist/dist/constructors/css.d.ts.map +0 -1
- package/native/dist/dist/constructors/keyframes.d.ts +0 -4
- package/native/dist/dist/constructors/keyframes.d.ts.map +0 -1
- package/native/dist/dist/constructors/styled.d.ts +0 -186
- package/native/dist/dist/constructors/styled.d.ts.map +0 -1
- package/native/dist/dist/hoc/withTheme.d.ts +0 -4
- package/native/dist/dist/hoc/withTheme.d.ts.map +0 -1
- package/native/dist/dist/hoc/withTheme.spec.d.ts +0 -2
- package/native/dist/dist/hoc/withTheme.spec.d.ts.map +0 -1
- package/native/dist/dist/hooks/useTheme.d.ts +0 -4
- package/native/dist/dist/hooks/useTheme.d.ts.map +0 -1
- package/native/dist/dist/index-standalone.d.ts +0 -3
- package/native/dist/dist/index-standalone.d.ts.map +0 -1
- package/native/dist/dist/index.d.ts +0 -4
- package/native/dist/dist/index.d.ts.map +0 -1
- package/native/dist/dist/macro/index.d.ts +0 -3
- package/native/dist/dist/macro/index.d.ts.map +0 -1
- package/native/dist/dist/macro/test/babel.config.d.ts +0 -1
- package/native/dist/dist/macro/test/babel.config.d.ts.map +0 -1
- package/native/dist/dist/models/ComponentStyle.d.ts +0 -16
- package/native/dist/dist/models/ComponentStyle.d.ts.map +0 -1
- package/native/dist/dist/models/GlobalStyle.d.ts +0 -12
- package/native/dist/dist/models/GlobalStyle.d.ts.map +0 -1
- package/native/dist/dist/models/InlineStyle.d.ts +0 -7
- package/native/dist/dist/models/InlineStyle.d.ts.map +0 -1
- package/native/dist/dist/models/Keyframes.d.ts +0 -12
- package/native/dist/dist/models/Keyframes.d.ts.map +0 -1
- package/native/dist/dist/models/ServerStyleSheet.d.ts +0 -16
- package/native/dist/dist/models/ServerStyleSheet.d.ts.map +0 -1
- package/native/dist/dist/models/StyleSheetManager.d.ts +0 -22
- package/native/dist/dist/models/StyleSheetManager.d.ts.map +0 -1
- package/native/dist/dist/models/StyledComponent.d.ts +0 -4
- package/native/dist/dist/models/StyledComponent.d.ts.map +0 -1
- package/native/dist/dist/models/StyledNativeComponent.d.ts +0 -4
- package/native/dist/dist/models/StyledNativeComponent.d.ts.map +0 -1
- package/native/dist/dist/models/ThemeProvider.d.ts +0 -18
- package/native/dist/dist/models/ThemeProvider.d.ts.map +0 -1
- package/native/dist/dist/native/index.d.ts +0 -65
- package/native/dist/dist/native/index.d.ts.map +0 -1
- package/native/dist/dist/primitives/index.d.ts +0 -23
- package/native/dist/dist/primitives/index.d.ts.map +0 -1
- package/native/dist/dist/secretInternals.d.ts +0 -6
- package/native/dist/dist/secretInternals.d.ts.map +0 -1
- package/native/dist/dist/sheet/GroupIDAllocator.d.ts +0 -5
- package/native/dist/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
- package/native/dist/dist/sheet/GroupedTag.d.ts +0 -12
- package/native/dist/dist/sheet/GroupedTag.d.ts.map +0 -1
- package/native/dist/dist/sheet/Rehydration.d.ts +0 -4
- package/native/dist/dist/sheet/Rehydration.d.ts.map +0 -1
- package/native/dist/dist/sheet/Sheet.d.ts +0 -41
- package/native/dist/dist/sheet/Sheet.d.ts.map +0 -1
- package/native/dist/dist/sheet/Tag.d.ts +0 -55
- package/native/dist/dist/sheet/Tag.d.ts.map +0 -1
- package/native/dist/dist/sheet/dom.d.ts +0 -5
- package/native/dist/dist/sheet/dom.d.ts.map +0 -1
- package/native/dist/dist/sheet/index.d.ts +0 -2
- package/native/dist/dist/sheet/index.d.ts.map +0 -1
- package/native/dist/dist/sheet/types.d.ts +0 -35
- package/native/dist/dist/sheet/types.d.ts.map +0 -1
- package/native/dist/dist/test/globals.d.ts +0 -3
- package/native/dist/dist/test/globals.d.ts.map +0 -1
- package/native/dist/dist/test/utils.d.ts +0 -192
- package/native/dist/dist/test/utils.d.ts.map +0 -1
- package/native/dist/dist/types.d.ts +0 -121
- package/native/dist/dist/types.d.ts.map +0 -1
- package/native/dist/dist/utils/addUnitIfNeeded.d.ts +0 -2
- package/native/dist/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
- package/native/dist/dist/utils/checkDynamicCreation.d.ts +0 -2
- package/native/dist/dist/utils/checkDynamicCreation.d.ts.map +0 -1
- package/native/dist/dist/utils/createWarnTooManyClasses.d.ts +0 -4
- package/native/dist/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
- package/native/dist/dist/utils/determineTheme.d.ts +0 -3
- package/native/dist/dist/utils/determineTheme.d.ts.map +0 -1
- package/native/dist/dist/utils/domElements.d.ts +0 -3
- package/native/dist/dist/utils/domElements.d.ts.map +0 -1
- package/native/dist/dist/utils/empties.d.ts +0 -4
- package/native/dist/dist/utils/empties.d.ts.map +0 -1
- package/native/dist/dist/utils/error.d.ts +0 -6
- package/native/dist/dist/utils/error.d.ts.map +0 -1
- package/native/dist/dist/utils/errors.d.ts +0 -21
- package/native/dist/dist/utils/errors.d.ts.map +0 -1
- package/native/dist/dist/utils/escape.d.ts +0 -6
- package/native/dist/dist/utils/escape.d.ts.map +0 -1
- package/native/dist/dist/utils/flatten.d.ts +0 -5
- package/native/dist/dist/utils/flatten.d.ts.map +0 -1
- package/native/dist/dist/utils/generateAlphabeticName.d.ts +0 -2
- package/native/dist/dist/utils/generateAlphabeticName.d.ts.map +0 -1
- package/native/dist/dist/utils/generateComponentId.d.ts +0 -2
- package/native/dist/dist/utils/generateComponentId.d.ts.map +0 -1
- package/native/dist/dist/utils/generateDisplayName.d.ts +0 -3
- package/native/dist/dist/utils/generateDisplayName.d.ts.map +0 -1
- package/native/dist/dist/utils/getComponentName.d.ts +0 -3
- package/native/dist/dist/utils/getComponentName.d.ts.map +0 -1
- package/native/dist/dist/utils/hash.d.ts +0 -4
- package/native/dist/dist/utils/hash.d.ts.map +0 -1
- package/native/dist/dist/utils/hoist.d.ts +0 -52
- package/native/dist/dist/utils/hoist.d.ts.map +0 -1
- package/native/dist/dist/utils/hyphenateStyleName.d.ts +0 -15
- package/native/dist/dist/utils/hyphenateStyleName.d.ts.map +0 -1
- package/native/dist/dist/utils/interleave.d.ts +0 -3
- package/native/dist/dist/utils/interleave.d.ts.map +0 -1
- package/native/dist/dist/utils/isFunction.d.ts +0 -2
- package/native/dist/dist/utils/isFunction.d.ts.map +0 -1
- package/native/dist/dist/utils/isPlainObject.d.ts +0 -2
- package/native/dist/dist/utils/isPlainObject.d.ts.map +0 -1
- package/native/dist/dist/utils/isStatelessFunction.d.ts +0 -2
- package/native/dist/dist/utils/isStatelessFunction.d.ts.map +0 -1
- package/native/dist/dist/utils/isStaticRules.d.ts +0 -3
- package/native/dist/dist/utils/isStaticRules.d.ts.map +0 -1
- package/native/dist/dist/utils/isStyledComponent.d.ts +0 -3
- package/native/dist/dist/utils/isStyledComponent.d.ts.map +0 -1
- package/native/dist/dist/utils/isTag.d.ts +0 -3
- package/native/dist/dist/utils/isTag.d.ts.map +0 -1
- package/native/dist/dist/utils/joinStrings.d.ts +0 -5
- package/native/dist/dist/utils/joinStrings.d.ts.map +0 -1
- package/native/dist/dist/utils/mixinDeep.d.ts +0 -8
- package/native/dist/dist/utils/mixinDeep.d.ts.map +0 -1
- package/native/dist/dist/utils/nonce.d.ts +0 -2
- package/native/dist/dist/utils/nonce.d.ts.map +0 -1
- package/native/dist/dist/utils/stylis.d.ts +0 -10
- package/native/dist/dist/utils/stylis.d.ts.map +0 -1
- package/native/dist/hoc/withTheme.d.ts.map +0 -1
- package/native/dist/hoc/withTheme.spec.d.ts.map +0 -1
- package/native/dist/hooks/useTheme.d.ts.map +0 -1
- package/native/dist/index-standalone.d.ts.map +0 -1
- package/native/dist/index.d.ts.map +0 -1
- package/native/dist/macro/index.d.ts.map +0 -1
- package/native/dist/macro/test/babel.config.d.ts +0 -1
- package/native/dist/macro/test/babel.config.d.ts.map +0 -1
- package/native/dist/models/ComponentStyle.d.ts.map +0 -1
- package/native/dist/models/GlobalStyle.d.ts.map +0 -1
- package/native/dist/models/InlineStyle.d.ts.map +0 -1
- package/native/dist/models/Keyframes.d.ts.map +0 -1
- package/native/dist/models/ServerStyleSheet.d.ts.map +0 -1
- package/native/dist/models/StyleSheetManager.d.ts.map +0 -1
- package/native/dist/models/StyledComponent.d.ts.map +0 -1
- package/native/dist/models/StyledNativeComponent.d.ts.map +0 -1
- package/native/dist/models/ThemeProvider.d.ts.map +0 -1
- package/native/dist/native/index.d.ts.map +0 -1
- package/native/dist/primitives/index.d.ts +0 -23
- package/native/dist/primitives/index.d.ts.map +0 -1
- package/native/dist/secretInternals.d.ts.map +0 -1
- package/native/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
- package/native/dist/sheet/GroupedTag.d.ts.map +0 -1
- package/native/dist/sheet/Rehydration.d.ts.map +0 -1
- package/native/dist/sheet/Sheet.d.ts.map +0 -1
- package/native/dist/sheet/Tag.d.ts.map +0 -1
- package/native/dist/sheet/dom.d.ts.map +0 -1
- package/native/dist/sheet/index.d.ts.map +0 -1
- package/native/dist/sheet/types.d.ts.map +0 -1
- package/native/dist/test/globals.d.ts.map +0 -1
- package/native/dist/test/utils.d.ts.map +0 -1
- package/native/dist/types.d.ts.map +0 -1
- package/native/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
- package/native/dist/utils/checkDynamicCreation.d.ts.map +0 -1
- package/native/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
- package/native/dist/utils/determineTheme.d.ts.map +0 -1
- package/native/dist/utils/domElements.d.ts.map +0 -1
- package/native/dist/utils/empties.d.ts.map +0 -1
- package/native/dist/utils/error.d.ts.map +0 -1
- package/native/dist/utils/errors.d.ts.map +0 -1
- package/native/dist/utils/escape.d.ts.map +0 -1
- package/native/dist/utils/flatten.d.ts.map +0 -1
- package/native/dist/utils/generateAlphabeticName.d.ts.map +0 -1
- package/native/dist/utils/generateComponentId.d.ts.map +0 -1
- package/native/dist/utils/generateDisplayName.d.ts.map +0 -1
- package/native/dist/utils/getComponentName.d.ts.map +0 -1
- package/native/dist/utils/hash.d.ts.map +0 -1
- package/native/dist/utils/hoist.d.ts.map +0 -1
- package/native/dist/utils/hyphenateStyleName.d.ts.map +0 -1
- package/native/dist/utils/interleave.d.ts.map +0 -1
- package/native/dist/utils/isFunction.d.ts.map +0 -1
- package/native/dist/utils/isPlainObject.d.ts.map +0 -1
- package/native/dist/utils/isStatelessFunction.d.ts.map +0 -1
- package/native/dist/utils/isStaticRules.d.ts.map +0 -1
- package/native/dist/utils/isStyledComponent.d.ts.map +0 -1
- package/native/dist/utils/isTag.d.ts.map +0 -1
- package/native/dist/utils/joinStrings.d.ts.map +0 -1
- package/native/dist/utils/mixinDeep.d.ts.map +0 -1
- package/native/dist/utils/nonce.d.ts.map +0 -1
- package/native/dist/utils/stylis.d.ts.map +0 -1
package/native/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import ComponentStyle from './models/ComponentStyle';
|
|
3
3
|
import { DefaultTheme } from './models/ThemeProvider';
|
|
4
4
|
import createWarnTooManyClasses from './utils/createWarnTooManyClasses';
|
|
5
|
-
interface ExoticComponentWithDisplayName<P =
|
|
5
|
+
interface ExoticComponentWithDisplayName<P = any> extends React.ExoticComponent<P> {
|
|
6
6
|
defaultProps?: Partial<P>;
|
|
7
7
|
displayName?: string;
|
|
8
8
|
}
|
|
@@ -12,8 +12,8 @@ export declare type OmitNever<T> = {
|
|
|
12
12
|
export declare type Runtime = 'web' | 'native';
|
|
13
13
|
export { DefaultTheme };
|
|
14
14
|
export declare type AnyComponent<P = any> = ExoticComponentWithDisplayName<P> | React.ComponentType<P>;
|
|
15
|
-
export interface StyledOptions<R extends Runtime, Props> {
|
|
16
|
-
attrs?:
|
|
15
|
+
export interface StyledOptions<R extends Runtime, Props extends object> {
|
|
16
|
+
attrs?: AttrsArg<Props>[];
|
|
17
17
|
componentId?: R extends 'web' ? string : never;
|
|
18
18
|
displayName?: string;
|
|
19
19
|
parentComponentId?: R extends 'web' ? string : never;
|
|
@@ -22,26 +22,35 @@ export interface StyledOptions<R extends Runtime, Props> {
|
|
|
22
22
|
export declare type KnownTarget = keyof JSX.IntrinsicElements | AnyComponent;
|
|
23
23
|
export declare type WebTarget = string | KnownTarget;
|
|
24
24
|
export declare type NativeTarget = AnyComponent;
|
|
25
|
-
export
|
|
26
|
-
[key: string]:
|
|
27
|
-
}
|
|
28
|
-
export interface
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
export declare type Dict<T> = {
|
|
26
|
+
[key: string]: T;
|
|
27
|
+
};
|
|
28
|
+
export interface ExecutionProps {
|
|
29
|
+
/**
|
|
30
|
+
* Dynamically adjust the rendered component or HTML tag, e.g.
|
|
31
|
+
* ```
|
|
32
|
+
* const StyledButton = styled.button``
|
|
33
|
+
*
|
|
34
|
+
* <StyledButton as="a" href="/foo">
|
|
35
|
+
* I'm an anchor now
|
|
36
|
+
* </StyledButton>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
31
39
|
as?: KnownTarget;
|
|
32
40
|
forwardedAs?: KnownTarget;
|
|
33
41
|
theme?: DefaultTheme;
|
|
34
42
|
}
|
|
35
|
-
export interface ExecutionContext extends
|
|
43
|
+
export interface ExecutionContext extends ExecutionProps {
|
|
36
44
|
theme: DefaultTheme;
|
|
37
45
|
}
|
|
38
|
-
export interface StyleFunction<Props
|
|
39
|
-
(executionContext: ExecutionContext & Props): Interpolation<Props>;
|
|
46
|
+
export interface StyleFunction<Props extends object> {
|
|
47
|
+
(executionContext: Omit<ExecutionContext, keyof Props> & Props): Interpolation<Props>;
|
|
40
48
|
}
|
|
41
|
-
export declare type Interpolation<Props> = StyleFunction<Props> | StyledObject<Props> | TemplateStringsArray | string | number | undefined | null | Keyframes | IStyledComponent<'web', any, any
|
|
42
|
-
export declare type
|
|
43
|
-
export declare type
|
|
44
|
-
export declare type
|
|
49
|
+
export declare type Interpolation<Props extends object> = StyleFunction<Props> | StyledObject<Props> | TemplateStringsArray | string | number | false | undefined | null | Keyframes | OmitSignatures<IStyledComponent<'web', any, any>> | Interpolation<Props>[];
|
|
50
|
+
export declare type AttrsArg<Props extends object> = (Omit<ExecutionProps, keyof Props> & Props) | ((props: Omit<ExecutionContext, keyof Props> & Props) => Partial<Props>);
|
|
51
|
+
export declare type Attrs = object | ((...args: any) => object);
|
|
52
|
+
export declare type RuleSet<Props extends object> = Interpolation<Props>[];
|
|
53
|
+
export declare type Styles<Props extends object> = TemplateStringsArray | StyledObject<Props> | StyleFunction<Props>;
|
|
45
54
|
export declare type NameGenerator = (hash: number) => string;
|
|
46
55
|
export interface StyleSheet {
|
|
47
56
|
create: Function;
|
|
@@ -51,58 +60,63 @@ export interface Keyframes {
|
|
|
51
60
|
name: string;
|
|
52
61
|
rules: string;
|
|
53
62
|
}
|
|
54
|
-
export interface Flattener<Props> {
|
|
63
|
+
export interface Flattener<Props extends object> {
|
|
55
64
|
(chunks: Interpolation<Props>[], executionContext: Object | null | undefined, styleSheet: Object | null | undefined): Interpolation<Props>[];
|
|
56
65
|
}
|
|
57
|
-
export declare type FlattenerResult<Props> = RuleSet<Props> | number | string | string[] | IStyledComponent<any, any> | Keyframes;
|
|
66
|
+
export declare type FlattenerResult<Props extends object> = RuleSet<Props> | number | string | string[] | IStyledComponent<'web', any, any> | Keyframes;
|
|
58
67
|
export interface Stringifier {
|
|
59
68
|
(css: string, selector?: string, prefix?: string, componentId?: string): string[];
|
|
60
69
|
hash: string;
|
|
61
70
|
}
|
|
62
71
|
export interface ShouldForwardProp<R extends Runtime> {
|
|
63
|
-
(prop: string, elementToBeCreated
|
|
72
|
+
(prop: string, elementToBeCreated: StyledTarget<R>): boolean;
|
|
64
73
|
}
|
|
65
|
-
export interface CommonStatics<R extends Runtime, Props> {
|
|
66
|
-
attrs:
|
|
74
|
+
export interface CommonStatics<R extends Runtime, Props extends object> {
|
|
75
|
+
attrs: AttrsArg<Props>[];
|
|
67
76
|
target: StyledTarget<R>;
|
|
68
77
|
shouldForwardProp?: ShouldForwardProp<R>;
|
|
69
78
|
withComponent: any;
|
|
70
79
|
}
|
|
71
|
-
export interface IStyledStatics<R extends Runtime, OuterProps
|
|
80
|
+
export interface IStyledStatics<R extends Runtime, OuterProps extends object> extends CommonStatics<R, OuterProps> {
|
|
72
81
|
componentStyle: R extends 'web' ? ComponentStyle : never;
|
|
73
82
|
foldedComponentIds: R extends 'web' ? Array<string> : never;
|
|
74
83
|
inlineStyle: R extends 'native' ? InstanceType<IInlineStyleConstructor<OuterProps>> : never;
|
|
75
84
|
target: StyledTarget<R>;
|
|
76
85
|
styledComponentId: R extends 'web' ? string : never;
|
|
77
86
|
warnTooManyClasses?: R extends 'web' ? ReturnType<typeof createWarnTooManyClasses> : never;
|
|
78
|
-
withComponent: <Target extends StyledTarget<R>, Props =
|
|
79
|
-
}
|
|
80
|
-
declare type PolymorphicComponentProps<R extends Runtime,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
withComponent: <Target extends StyledTarget<R>, Props extends object = object>(tag: Target) => IStyledComponent<R, Target, OuterProps & Props>;
|
|
88
|
+
}
|
|
89
|
+
declare type PolymorphicComponentProps<R extends Runtime, E extends StyledTarget<R>, P extends object> = Omit<P & (E extends KnownTarget ? Omit<React.ComponentProps<E>, keyof P> : object), 'as' | 'theme'> & {
|
|
90
|
+
as?: P extends {
|
|
91
|
+
as?: string | AnyComponent;
|
|
92
|
+
} ? P['as'] : E;
|
|
93
|
+
theme?: DefaultTheme;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Remove the function call signature, keeping the additional properties.
|
|
97
|
+
* https://stackoverflow.com/a/62502740/347386
|
|
98
|
+
*/
|
|
99
|
+
declare type OmitSignatures<T> = Pick<T, keyof T>;
|
|
100
|
+
interface PolymorphicComponent<R extends Runtime, P extends object, FallbackComponent extends StyledTarget<R>> extends OmitSignatures<React.ForwardRefExoticComponent<P>> {
|
|
101
|
+
<E extends StyledTarget<R> = FallbackComponent>(props: PolymorphicComponentProps<R, E, P>): React.ReactElement | null;
|
|
102
|
+
}
|
|
103
|
+
export interface IStyledComponent<R extends Runtime, Target extends StyledTarget<R>, Props extends object> extends PolymorphicComponent<R, Props, Target>, IStyledStatics<R, Props> {
|
|
104
|
+
defaultProps?: Partial<ExecutionProps & (Target extends KnownTarget ? React.ComponentProps<Target> : {}) & Props>;
|
|
91
105
|
toString: () => string;
|
|
92
106
|
}
|
|
93
|
-
export interface IStyledComponentFactory<R extends Runtime, Target extends StyledTarget<R>,
|
|
94
|
-
(target: Target, options: StyledOptions<R,
|
|
107
|
+
export interface IStyledComponentFactory<R extends Runtime, Target extends StyledTarget<R>, OuterProps extends object, OuterStatics extends object = object> {
|
|
108
|
+
<Props extends object = object, Statics extends object = object>(target: Target, options: StyledOptions<R, OuterProps>, rules: RuleSet<OuterProps & Props>): IStyledComponent<R, Target, OuterProps & Props> & OuterStatics & Statics;
|
|
95
109
|
}
|
|
96
|
-
export interface IInlineStyleConstructor<Props
|
|
110
|
+
export interface IInlineStyleConstructor<Props extends object> {
|
|
97
111
|
new (rules: RuleSet<Props>): IInlineStyle<Props>;
|
|
98
112
|
}
|
|
99
|
-
export interface IInlineStyle<Props
|
|
113
|
+
export interface IInlineStyle<Props extends object> {
|
|
100
114
|
rules: RuleSet<Props>;
|
|
101
115
|
generateStyleObject(executionContext: Object): Object;
|
|
102
116
|
}
|
|
103
117
|
export declare type StyledTarget<R extends Runtime> = R extends 'web' ? WebTarget : NativeTarget;
|
|
104
|
-
export interface StyledObject<Props
|
|
105
|
-
[key: string]:
|
|
118
|
+
export interface StyledObject<Props extends object> {
|
|
119
|
+
[key: string]: Dict<any> | string | number | StyleFunction<Props> | StyledObject<Props>;
|
|
106
120
|
}
|
|
107
121
|
/**
|
|
108
122
|
* Override DefaultTheme to get accurate typings for your project.
|
|
@@ -126,4 +140,4 @@ export interface StyledObject<Props = ExecutionContext> {
|
|
|
126
140
|
* }
|
|
127
141
|
* ```
|
|
128
142
|
*/
|
|
129
|
-
export declare type CSSProp = string | StyledObject | StyleFunction
|
|
143
|
+
export declare type CSSProp = string | StyledObject<any> | StyleFunction<any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default function determineTheme(props:
|
|
1
|
+
import { ExecutionProps } from '../types';
|
|
2
|
+
export default function determineTheme(props: ExecutionProps, providedTheme: any, defaultProps?: any): any;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dict } from '../types';
|
|
2
2
|
export declare const EMPTY_ARRAY: readonly any[];
|
|
3
|
-
export declare const EMPTY_OBJECT: Readonly<
|
|
3
|
+
export declare const EMPTY_OBJECT: Readonly<Dict<any>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import StyleSheet from '../sheet';
|
|
2
|
-
import {
|
|
3
|
-
export declare const objToCssArray: (obj:
|
|
4
|
-
export default function flatten<Props
|
|
2
|
+
import { Dict, ExecutionContext, Interpolation, RuleSet, Stringifier } from '../types';
|
|
3
|
+
export declare const objToCssArray: (obj: Dict<any>, prevKey?: string) => string[];
|
|
4
|
+
export default function flatten<Props extends object>(chunk: Interpolation<Props>, executionContext?: ExecutionContext & Props, styleSheet?: StyleSheet, stylisInstance?: Stringifier): RuleSet<Props>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Interpolation } from '../types';
|
|
2
|
-
export default function interleave<Props
|
|
2
|
+
export default function interleave<Props extends object>(strings: readonly string[], interpolations: Interpolation<Props>[]): Interpolation<Props>[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { RuleSet } from '../types';
|
|
2
|
-
export default function isStaticRules<Props
|
|
2
|
+
export default function isStaticRules<Props extends object>(rules: RuleSet<Props>): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IStyledComponent } from '../types';
|
|
2
|
-
export default function isStyledComponent(target: any): target is IStyledComponent<'web', any>;
|
|
2
|
+
export default function isStyledComponent(target: any): target is IStyledComponent<'web', any, any>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ExtensibleObject } from '../types';
|
|
2
1
|
/**
|
|
3
2
|
* Arrays & POJOs merged recursively, other objects and value types are overridden
|
|
4
3
|
* If target is not a POJO or an Array, it will get source properties injected via shallow merge
|
|
5
4
|
* Source objects applied left to right. Mutates & returns target. Similar to lodash merge.
|
|
6
5
|
*/
|
|
7
|
-
export default function mixinDeep(target
|
|
6
|
+
export default function mixinDeep(target: any, ...sources: any[]): any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "styled-components",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.4",
|
|
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",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@emotion/unitless": "^0.7.4",
|
|
73
73
|
"css-to-react-native": "^3.0.0",
|
|
74
74
|
"shallowequal": "^1.1.0",
|
|
75
|
-
"stylis": "^4.1.
|
|
75
|
+
"stylis": "^4.1.2"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"babel-plugin-styled-components": ">= 2",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
135
135
|
"rollup-plugin-terser": "^7.0.2",
|
|
136
136
|
"stylis-plugin-rtl": "^2.1.1",
|
|
137
|
-
"typescript": "^4.
|
|
137
|
+
"typescript": "^4.8.4",
|
|
138
138
|
"utility-types": "^3.10.0"
|
|
139
139
|
},
|
|
140
140
|
"bundlewatch": {
|
package/test-utils/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactWrapper } from
|
|
2
|
-
import { IStyledComponent } from
|
|
1
|
+
import { ReactWrapper } from 'enzyme';
|
|
2
|
+
import { IStyledComponent } from '../src/types';
|
|
3
3
|
|
|
4
4
|
function assertElement(element: any) {
|
|
5
5
|
if (!(element instanceof HTMLElement)) {
|
|
@@ -9,7 +9,8 @@ function assertElement(element: any) {
|
|
|
9
9
|
|
|
10
10
|
function assertStyledComponent(styledComponent: any) {
|
|
11
11
|
if (
|
|
12
|
-
!
|
|
12
|
+
!styledComponent?.styledComponentId ||
|
|
13
|
+
typeof styledComponent.styledComponentId !== 'string'
|
|
13
14
|
) {
|
|
14
15
|
throw new Error(
|
|
15
16
|
`${
|
|
@@ -19,19 +20,22 @@ function assertStyledComponent(styledComponent: any) {
|
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
export function enzymeFind(
|
|
23
|
+
export function enzymeFind(
|
|
24
|
+
wrapper: ReactWrapper,
|
|
25
|
+
styledComponent: IStyledComponent<'web', any, any>
|
|
26
|
+
) {
|
|
23
27
|
assertStyledComponent(styledComponent);
|
|
24
28
|
|
|
25
29
|
return wrapper.find(`.${styledComponent.styledComponentId}`);
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
export function find(element: Element, styledComponent: IStyledComponent) {
|
|
32
|
+
export function find(element: Element, styledComponent: IStyledComponent<'web', any, any>) {
|
|
29
33
|
assertElement(element);
|
|
30
34
|
assertStyledComponent(styledComponent);
|
|
31
35
|
return element.querySelector(`.${styledComponent.styledComponentId}`);
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
export function findAll(element: Element, styledComponent: IStyledComponent) {
|
|
38
|
+
export function findAll(element: Element, styledComponent: IStyledComponent<'web', any, any>) {
|
|
35
39
|
assertElement(element);
|
|
36
40
|
assertStyledComponent(styledComponent);
|
|
37
41
|
return element.querySelectorAll(`.${styledComponent.styledComponentId}`);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["src/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,GAAG,MAAM,oBAAoB,CAAC;AACrC,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAExC,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;AACzD,OAAO,iBAAiB,EAAE,EACxB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,aAAa,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAI1D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,4BAA4B,CAAC,EAAE,MAAM,CAAC;KACvC;CACF;AAsCD,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,iBAAiB,EACjB,GAAG,EACH,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,UAAU,IAAI,OAAO,EACrB,SAAS,GACV,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["src/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,EAAE,MAEP,CAAC;AAEhB,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,eAAe,wBAAwB,CAAC;AACrD,eAAO,MAAM,UAAU,QAAc,CAAC;AACtC,eAAO,MAAM,QAAQ,cAAc,CAAC;AAEpC,eAAO,MAAM,UAAU,SAA2D,CAAC;AAEnF,eAAO,MAAM,cAAc,SAgB1B,CAAC;AAGF,eAAO,MAAM,wBAAwB,IAAK,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constructWithOptions.d.ts","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/C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../src/constructors/css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA+B,MAAM,EAAE,MAAM,UAAU,CAAC;AAmB9E,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,KAAK,EAC/B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,EACrB,GAAG,cAAc,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE;;GA0B1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyframes.d.ts","sourceRoot":"","sources":["../src/constructors/keyframes.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIjD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,GAAG,OAAO,EAC/C,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EACtB,GAAG,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GAC7C,SAAS,CAgBX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../src/constructors/styled.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAA6B,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKzE,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEX,CAAC;AAQF,eAAe,MAAM,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SC_VERSION } from './constants';
|
|
2
|
-
import createGlobalStyle from './constructors/createGlobalStyle';
|
|
3
|
-
import css from './constructors/css';
|
|
4
|
-
import keyframes from './constructors/keyframes';
|
|
5
|
-
import withTheme from './hoc/withTheme';
|
|
6
|
-
import useTheme from './hooks/useTheme';
|
|
7
|
-
import ServerStyleSheet from './models/ServerStyleSheet';
|
|
8
|
-
import StyleSheetManager, { StyleSheetConsumer, StyleSheetContext } from './models/StyleSheetManager';
|
|
9
|
-
import ThemeProvider, { ThemeConsumer, ThemeContext } from './models/ThemeProvider';
|
|
10
|
-
import isStyledComponent from './utils/isStyledComponent';
|
|
11
|
-
declare global {
|
|
12
|
-
interface Window {
|
|
13
|
-
'__styled-components-init__'?: number;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export * from './secretInternals';
|
|
17
|
-
export { createGlobalStyle, css, isStyledComponent, keyframes, ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, useTheme, SC_VERSION as version, withTheme, };
|
|
18
|
-
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,GAAG,MAAM,oBAAoB,CAAC;AACrC,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAExC,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,gBAAgB,MAAM,2BAA2B,CAAC;AACzD,OAAO,iBAAiB,EAAE,EACxB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,aAAa,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAI1D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,4BAA4B,CAAC,EAAE,MAAM,CAAC;KACvC;CACF;AAsCD,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,iBAAiB,EACjB,GAAG,EACH,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,UAAU,IAAI,OAAO,EACrB,SAAS,GACV,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const SC_ATTR: string;
|
|
2
|
-
export declare const SC_ATTR_ACTIVE = "active";
|
|
3
|
-
export declare const SC_ATTR_VERSION = "data-styled-version";
|
|
4
|
-
export declare const SC_VERSION: string;
|
|
5
|
-
export declare const SPLITTER = "/*!sc*/\n";
|
|
6
|
-
export declare const IS_BROWSER: boolean;
|
|
7
|
-
export declare const DISABLE_SPEEDY: boolean;
|
|
8
|
-
export declare const STATIC_EXECUTION_CONTEXT: {};
|
|
9
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,EAAE,MAEP,CAAC;AAEhB,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,eAAe,wBAAwB,CAAC;AACrD,eAAO,MAAM,UAAU,QAAc,CAAC;AACtC,eAAO,MAAM,QAAQ,cAAc,CAAC;AAEpC,eAAO,MAAM,UAAU,SAA2D,CAAC;AAEnF,eAAO,MAAM,cAAc,SAgB1B,CAAC;AAGF,eAAO,MAAM,wBAAwB,IAAK,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Attrs, Interpolation, IStyledComponent, IStyledComponentFactory, IStyledNativeComponent, IStyledNativeComponentFactory, NativeTarget, StyledNativeOptions, StyledOptions, StyledTarget, Styles, WebTarget } from '../types';
|
|
2
|
-
export interface NativeStyled<Target extends NativeTarget, OuterProps = unknown, OuterStatics = unknown> {
|
|
3
|
-
<Props = unknown, Statics = unknown>(initialStyles: Styles<OuterProps & Props>, ...interpolations: Exclude<Interpolation<OuterProps & Props>, IStyledComponent<any>>[]): IStyledNativeComponent<Target, OuterProps & Props> & OuterStatics & Statics;
|
|
4
|
-
attrs(attrs: Attrs<OuterProps>): NativeStyled<Target, OuterProps, OuterStatics>;
|
|
5
|
-
withConfig(config: StyledNativeOptions<OuterProps>): NativeStyled<Target, OuterProps, OuterStatics>;
|
|
6
|
-
}
|
|
7
|
-
export interface WebStyled<Target extends WebTarget, OuterProps = unknown, OuterStatics = unknown> {
|
|
8
|
-
<Props = unknown, Statics = unknown>(initialStyles: Styles<OuterProps & Props>, ...interpolations: Interpolation<OuterProps & Props>[]): IStyledComponent<Target, OuterProps & Props> & OuterStatics & Statics;
|
|
9
|
-
attrs(attrs: Attrs<OuterProps>): WebStyled<Target, OuterProps, OuterStatics>;
|
|
10
|
-
withConfig(config: StyledOptions<OuterProps>): WebStyled<Target, OuterProps, OuterStatics>;
|
|
11
|
-
}
|
|
12
|
-
export default function constructWithOptions<Environment extends 'web' | 'native', Target extends StyledTarget, OuterProps = unknown, // used for styled<{}>().attrs() so attrs() gets the generic prop context
|
|
13
|
-
OuterStatics = unknown>(componentConstructor: Environment extends 'web' ? IStyledComponentFactory<any, any, any> : IStyledNativeComponentFactory<any, any, any>, tag: Target, options?: Environment extends 'web' ? StyledOptions<OuterProps> : StyledNativeOptions<OuterProps>): {
|
|
14
|
-
<Props = unknown, Statics = unknown>(initialStyles: Styles<OuterProps & Props>, ...interpolations: Interpolation<OuterProps & Props>[]): ReturnType<Environment extends "web" ? IStyledComponentFactory<Target, OuterProps & Props, OuterStatics & Statics> : IStyledNativeComponentFactory<Target, OuterProps & Props, OuterStatics & Statics>>;
|
|
15
|
-
attrs(attrs: Attrs<OuterProps>): any;
|
|
16
|
-
/**
|
|
17
|
-
* If config methods are called, wrap up a new template function and merge options */
|
|
18
|
-
withConfig(config: Environment extends 'web' ? StyledOptions<OuterProps> : StyledNativeOptions<OuterProps>): any;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=constructWithOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constructWithOptions.d.ts","sourceRoot":"","sources":["../../src/constructors/constructWithOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,6BAA6B,EAC7B,YAAY,EAEZ,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,MAAM,EACN,SAAS,EACV,MAAM,UAAU,CAAC;AAKlB,MAAM,WAAW,YAAY,CAC3B,MAAM,SAAS,YAAY,EAC3B,UAAU,GAAG,OAAO,EACpB,YAAY,GAAG,OAAO;IAEtB,CAAC,KAAK,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EACjC,aAAa,EAAE,MAAM,CAAC,UAAU,GAAG,KAAK,CAAC,EACzC,GAAG,cAAc,EAAE,OAAO,CAAC,aAAa,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE,GACrF,sBAAsB,CAAC,MAAM,EAAE,UAAU,GAAG,KAAK,CAAC,GAAG,YAAY,GAAG,OAAO,CAAC;IAC/E,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;IAChF,UAAU,CACR,MAAM,EAAE,mBAAmB,CAAC,UAAU,CAAC,GACtC,YAAY,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,SAAS,CA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';
|
|
3
|
-
export default function createGlobalStyle<Props = unknown>(strings: Styles<Props>, ...interpolations: Array<Interpolation<Props>>): React.NamedExoticComponent<ExtensibleObject>;
|
|
4
|
-
//# sourceMappingURL=createGlobalStyle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createGlobalStyle.d.ts","sourceRoot":"","sources":["../../src/constructors/createGlobalStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;AAMnE,OAAO,EAEL,gBAAgB,EAChB,aAAa,EAGb,MAAM,EACP,MAAM,UAAU,CAAC;AAMlB,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,GAAG,OAAO,EACvD,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EACtB,GAAG,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,gDA6E/C"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Interpolation, Styles } from '../types';
|
|
2
|
-
export default function css<Props>(styles: Styles<Props>, ...interpolations: Interpolation<Props>[]): TemplateStringsArray | (Interpolation<Props> & {
|
|
3
|
-
isCss?: boolean | undefined;
|
|
4
|
-
});
|
|
5
|
-
//# sourceMappingURL=css.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/constructors/css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA+B,MAAM,EAAE,MAAM,UAAU,CAAC;AAmB9E,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,KAAK,EAC/B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,EACrB,GAAG,cAAc,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE;;GA0B1C"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import Keyframes from '../models/Keyframes';
|
|
2
|
-
import { Interpolation, Styles } from '../types';
|
|
3
|
-
export default function keyframes<Props = unknown>(strings: Styles<Props>, ...interpolations: Array<Interpolation<Props>>): Keyframes;
|
|
4
|
-
//# sourceMappingURL=keyframes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keyframes.d.ts","sourceRoot":"","sources":["../../src/constructors/keyframes.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIjD,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,GAAG,OAAO,EAC/C,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EACtB,GAAG,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,GAC7C,SAAS,CAgBX"}
|