styled-components 5.3.6 → 5.3.11
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/base.d.ts +3 -9
- package/native/dist/constructors/constructWithOptions.d.ts +39 -14
- 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/index.d.ts +2 -2
- package/native/dist/models/ComponentStyle.d.ts +0 -1
- package/native/dist/models/GlobalStyle.d.ts +1 -1
- package/native/dist/models/InlineStyle.d.ts +1 -1
- package/native/dist/models/StyleSheetManager.d.ts +58 -15
- package/native/dist/models/StyledComponent.d.ts +1 -1
- package/native/dist/models/StyledNativeComponent.d.ts +2 -2
- package/native/dist/models/ThemeProvider.d.ts +5 -4
- package/native/dist/native/index.d.ts +28 -33
- package/native/dist/sheet/GroupedTag.d.ts +1 -1
- 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 +6 -6
- package/native/dist/styled-components.native.cjs.js.map +1 -1
- package/native/dist/styled-components.native.esm.js +6 -6
- package/native/dist/styled-components.native.esm.js.map +1 -1
- package/native/dist/test/types.d.ts +9 -0
- package/native/dist/test/utils.d.ts +176 -180
- package/native/dist/test/veryLargeUnionType.d.ts +1 -0
- package/native/dist/types.d.ts +85 -62
- package/native/dist/utils/determineTheme.d.ts +4 -2
- package/native/dist/utils/domElements.d.ts +1 -1
- package/native/dist/utils/empties.d.ts +2 -2
- package/native/dist/utils/flatten.d.ts +3 -3
- package/native/dist/utils/hoist.d.ts +3 -3
- package/native/dist/utils/interleave.d.ts +1 -1
- package/native/dist/utils/isFunction.d.ts +1 -1
- package/native/dist/utils/isPlainObject.d.ts +1 -1
- package/native/dist/utils/isStatelessFunction.d.ts +1 -1
- package/native/dist/utils/isStaticRules.d.ts +1 -1
- package/native/dist/utils/joinStrings.d.ts +2 -1
- package/native/dist/utils/mixinDeep.d.ts +1 -2
- package/native/dist/utils/stylis.d.ts +3 -3
- package/package.json +2 -4
- package/primitives/dist/styled-components-primitives.cjs.js +6 -6
- package/primitives/dist/styled-components-primitives.cjs.js.map +1 -1
- package/primitives/dist/styled-components-primitives.esm.js +6 -6
- package/primitives/dist/styled-components-primitives.esm.js.map +1 -1
- 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 +0 -3
- 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/postinstall.js +0 -82
|
@@ -1,21 +1,64 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import StyleSheet from '../sheet';
|
|
3
|
-
import { Stringifier } from '../types';
|
|
4
|
-
declare
|
|
5
|
-
|
|
3
|
+
import { ShouldForwardProp, Stringifier } from '../types';
|
|
4
|
+
export declare const mainSheet: StyleSheet;
|
|
5
|
+
export declare const mainStylis: Stringifier;
|
|
6
|
+
export type IStyleSheetContext = {
|
|
7
|
+
shouldForwardProp?: ShouldForwardProp<'web'>;
|
|
8
|
+
styleSheet: StyleSheet;
|
|
9
|
+
stylis: Stringifier;
|
|
10
|
+
};
|
|
11
|
+
export declare const StyleSheetContext: React.Context<IStyleSheetContext>;
|
|
12
|
+
export declare const StyleSheetConsumer: React.Consumer<IStyleSheetContext>;
|
|
13
|
+
export type IStylisContext = Stringifier | void;
|
|
14
|
+
export declare const StylisContext: React.Context<IStylisContext>;
|
|
15
|
+
export declare const StylisConsumer: React.Consumer<IStylisContext>;
|
|
16
|
+
export declare function useStyleSheetContext(): IStyleSheetContext;
|
|
17
|
+
export type IStyleSheetManager = React.PropsWithChildren<{
|
|
18
|
+
/**
|
|
19
|
+
* If desired, you can pass this prop to disable "speedy" insertion mode, which
|
|
20
|
+
* uses the browser [CSSOM APIs](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet).
|
|
21
|
+
* When disabled, rules are inserted as simple text into style blocks.
|
|
22
|
+
*/
|
|
6
23
|
disableCSSOMInjection?: boolean;
|
|
7
|
-
|
|
24
|
+
/**
|
|
25
|
+
* If you are working exclusively with modern browsers, vendor prefixes can often be omitted
|
|
26
|
+
* to reduce the weight of CSS on the page.
|
|
27
|
+
*/
|
|
28
|
+
enableVendorPrefixes?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Provide an optional selector to be prepended to all generated style rules.
|
|
31
|
+
*/
|
|
32
|
+
namespace?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Create and provide your own `StyleSheet` if necessary for advanced SSR scenarios.
|
|
35
|
+
*/
|
|
8
36
|
sheet?: StyleSheet;
|
|
37
|
+
/**
|
|
38
|
+
* Starting in v6, styled-components no longer does its own prop validation
|
|
39
|
+
* and recommends use of transient props "$prop" to pass style-only props to
|
|
40
|
+
* components. If for some reason you are not able to use transient props, a
|
|
41
|
+
* prop validation function can be provided via `StyleSheetManager`, such as
|
|
42
|
+
* `@emotion/is-prop-valid`.
|
|
43
|
+
*
|
|
44
|
+
* When the return value is `true`, props will be forwarded to the DOM/underlying
|
|
45
|
+
* component. If return value is `false`, the prop will be discarded after styles
|
|
46
|
+
* are calculated.
|
|
47
|
+
*
|
|
48
|
+
* Manually composing `styled.{element}.withConfig({shouldForwardProp})` will
|
|
49
|
+
* override this default.
|
|
50
|
+
*/
|
|
51
|
+
shouldForwardProp?: IStyleSheetContext['shouldForwardProp'];
|
|
52
|
+
/**
|
|
53
|
+
* An array of plugins to be run by stylis (style processor) during compilation.
|
|
54
|
+
* Check out [what's available on npm*](https://www.npmjs.com/search?q=keywords%3Astylis).
|
|
55
|
+
*
|
|
56
|
+
* \* The plugin(s) must be compatible with stylis v4 or above.
|
|
57
|
+
*/
|
|
9
58
|
stylisPlugins?: stylis.Middleware[];
|
|
59
|
+
/**
|
|
60
|
+
* Provide an alternate DOM node to host generated styles; useful for iframes.
|
|
61
|
+
*/
|
|
10
62
|
target?: HTMLElement;
|
|
11
|
-
}
|
|
12
|
-
export declare
|
|
13
|
-
export declare const StyleSheetConsumer: React.Consumer<void | StyleSheet>;
|
|
14
|
-
export declare const StylisContext: React.Context<void | Stringifier>;
|
|
15
|
-
export declare const StylisConsumer: React.Consumer<void | Stringifier>;
|
|
16
|
-
export declare const mainSheet: StyleSheet;
|
|
17
|
-
export declare const mainStylis: Stringifier;
|
|
18
|
-
export declare function useStyleSheet(): StyleSheet;
|
|
19
|
-
export declare function useStylis(): Stringifier;
|
|
20
|
-
export default function StyleSheetManager(props: Props): JSX.Element;
|
|
21
|
-
export {};
|
|
63
|
+
}>;
|
|
64
|
+
export declare function StyleSheetManager(props: IStyleSheetManager): JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IStyledComponentFactory, RuleSet, StyledOptions, WebTarget } from '../types';
|
|
2
|
-
declare function createStyledComponent<Target extends WebTarget, OuterProps extends
|
|
2
|
+
declare function createStyledComponent<Target extends WebTarget, OuterProps extends object, Statics extends object = object>(target: Target, options: StyledOptions<'web', OuterProps>, rules: RuleSet<OuterProps>): ReturnType<IStyledComponentFactory<'web', Target, OuterProps, Statics>>;
|
|
3
3
|
export default createStyledComponent;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const _default: (InlineStyle: IInlineStyleConstructor<any>) => <Target extends NativeTarget, OuterProps extends
|
|
1
|
+
import type { ExecutionProps, IInlineStyleConstructor, IStyledComponent, IStyledComponentFactory, NativeTarget, RuleSet, StyledOptions } from '../types';
|
|
2
|
+
declare const _default: (InlineStyle: IInlineStyleConstructor<any>) => <Target extends NativeTarget, OuterProps extends ExecutionProps, Statics extends object = object>(target: Target, options: StyledOptions<"native", OuterProps>, rules: RuleSet<OuterProps>) => IStyledComponent<"native", Target, OuterProps & object> & Statics & object;
|
|
3
3
|
export default _default;
|
|
@@ -24,14 +24,15 @@ import React from 'react';
|
|
|
24
24
|
export interface DefaultTheme {
|
|
25
25
|
[key: string]: any;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
children?: React.
|
|
27
|
+
type ThemeFn = (outerTheme?: DefaultTheme) => DefaultTheme;
|
|
28
|
+
type ThemeArgument = DefaultTheme | ThemeFn;
|
|
29
|
+
type Props = {
|
|
30
|
+
children?: React.ReactNode;
|
|
31
31
|
theme: ThemeArgument;
|
|
32
32
|
};
|
|
33
33
|
export declare const ThemeContext: React.Context<DefaultTheme | undefined>;
|
|
34
34
|
export declare const ThemeConsumer: React.Consumer<DefaultTheme | undefined>;
|
|
35
|
+
export declare function useTheme(): DefaultTheme | undefined;
|
|
35
36
|
/**
|
|
36
37
|
* Provide a theme to an entire react component tree via context
|
|
37
38
|
*/
|
|
@@ -2,40 +2,35 @@ import React from 'react';
|
|
|
2
2
|
import { Styled } from '../constructors/constructWithOptions';
|
|
3
3
|
import css from '../constructors/css';
|
|
4
4
|
import withTheme from '../hoc/withTheme';
|
|
5
|
-
import useTheme from '../
|
|
6
|
-
import ThemeProvider, { ThemeConsumer, ThemeContext } from '../models/ThemeProvider';
|
|
5
|
+
import ThemeProvider, { ThemeConsumer, ThemeContext, useTheme } from '../models/ThemeProvider';
|
|
7
6
|
import { NativeTarget } from '../types';
|
|
8
7
|
import isStyledComponent from '../utils/isStyledComponent';
|
|
9
|
-
declare const styled: (<Target extends NativeTarget>(tag: Target) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
TouchableHighlight: Styled<"native", typeof import("react-native").TouchableHighlight, import("react-native").TouchableHighlightProps, {}, unknown>;
|
|
35
|
-
TouchableOpacity: Styled<"native", typeof import("react-native").TouchableOpacity, import("react-native").TouchableOpacityProps, {}, unknown>;
|
|
36
|
-
View: Styled<"native", typeof import("react-native").View, import("react-native").ViewProps, {}, unknown>;
|
|
37
|
-
VirtualizedList: Styled<"native", typeof import("react-native").VirtualizedList, import("react-native").VirtualizedListProps<unknown>, {}, unknown>;
|
|
8
|
+
declare const styled: (<Target extends NativeTarget>(tag: Target) => Styled<"native", Target, Target extends import("../types").KnownTarget ? React.ComponentPropsWithRef<Target> : object, object, object>) & {
|
|
9
|
+
ActivityIndicator: Styled<"native", typeof import("react-native").ActivityIndicator, import("react-native").ActivityIndicatorProps, object, object>;
|
|
10
|
+
Button: Styled<"native", typeof import("react-native").Button, import("react-native").ButtonProps, object, object>;
|
|
11
|
+
DatePickerIOS: Styled<"native", typeof import("react-native").DatePickerIOS, import("react-native").DatePickerIOSProps, object, object>;
|
|
12
|
+
DrawerLayoutAndroid: Styled<"native", typeof import("react-native").DrawerLayoutAndroid, import("react-native").DrawerLayoutAndroidProps, object, object>;
|
|
13
|
+
FlatList: Styled<"native", typeof import("react-native").FlatList, import("react-native").FlatListProps<unknown>, object, object>;
|
|
14
|
+
Image: Styled<"native", typeof import("react-native").Image, import("react-native").ImageProps, object, object>;
|
|
15
|
+
ImageBackground: Styled<"native", typeof import("react-native").ImageBackground, import("react-native").ImageBackgroundProps, object, object>;
|
|
16
|
+
KeyboardAvoidingView: Styled<"native", typeof import("react-native").KeyboardAvoidingView, import("react-native").KeyboardAvoidingViewProps, object, object>;
|
|
17
|
+
Modal: Styled<"native", typeof import("react-native").Modal, import("react-native").ModalBaseProps & import("react-native").ModalPropsIOS & import("react-native").ModalPropsAndroid & import("react-native").ViewProps, object, object>;
|
|
18
|
+
Pressable: Styled<"native", import("react").ForwardRefExoticComponent<import("react-native").PressableProps & import("react").RefAttributes<import("react-native").View>>, import("react-native").PressableProps & import("react").RefAttributes<import("react-native").View>, object, object>;
|
|
19
|
+
ProgressBarAndroid: Styled<"native", typeof import("react-native").ProgressBarAndroid, import("react-native").ProgressBarAndroidProps, object, object>;
|
|
20
|
+
ProgressViewIOS: Styled<"native", typeof import("react-native").ProgressViewIOS, import("react-native").ProgressViewIOSProps, object, object>;
|
|
21
|
+
RefreshControl: Styled<"native", typeof import("react-native").RefreshControl, import("react-native").RefreshControlProps, object, object>;
|
|
22
|
+
SafeAreaView: Styled<"native", typeof import("react-native").SafeAreaView, import("react-native").ViewProps, object, object>;
|
|
23
|
+
ScrollView: Styled<"native", typeof import("react-native").ScrollView, import("react-native").ScrollViewProps, object, object>;
|
|
24
|
+
SectionList: Styled<"native", typeof import("react-native").SectionList, import("react-native").SectionListProps<unknown, unknown>, object, object>;
|
|
25
|
+
Slider: Styled<"native", typeof import("react-native").Slider, import("react-native").SliderProps, object, object>;
|
|
26
|
+
Switch: Styled<"native", typeof import("react-native").Switch, import("react-native").SwitchProps, object, object>;
|
|
27
|
+
Text: Styled<"native", typeof import("react-native").Text, import("react-native").TextProps, object, object>;
|
|
28
|
+
TextInput: Styled<"native", typeof import("react-native").TextInput, import("react-native").TextInputProps, object, object>;
|
|
29
|
+
TouchableHighlight: Styled<"native", typeof import("react-native").TouchableHighlight, import("react-native").TouchableHighlightProps, object, object>;
|
|
30
|
+
TouchableOpacity: Styled<"native", typeof import("react-native").TouchableOpacity, import("react-native").TouchableOpacityProps, object, object>;
|
|
31
|
+
View: Styled<"native", typeof import("react-native").View, import("react-native").ViewProps, object, object>;
|
|
32
|
+
VirtualizedList: Styled<"native", typeof import("react-native").VirtualizedList, import("react-native").VirtualizedListProps<unknown>, object, object>;
|
|
38
33
|
};
|
|
39
|
-
export { IStyledComponent, IStyledComponentFactory, IStyledStatics, NativeTarget, StyledOptions, } from '../types';
|
|
34
|
+
export { DefaultTheme, ExecutionContext, ExecutionProps, IStyledComponent, IStyledComponentFactory, IStyledStatics, NativeTarget, PolymorphicComponent, PolymorphicComponentProps, Runtime, StyledObject, StyledOptions, } from '../types';
|
|
40
35
|
export { css, isStyledComponent, ThemeProvider, ThemeConsumer, ThemeContext, withTheme, useTheme };
|
|
41
|
-
export default
|
|
36
|
+
export { styled, styled as default };
|
|
@@ -5,7 +5,7 @@ export declare const makeGroupedTag: (tag: Tag) => {
|
|
|
5
5
|
length: number;
|
|
6
6
|
tag: Tag;
|
|
7
7
|
indexOfGroup(group: number): number;
|
|
8
|
-
insertRules(group: number, rules: string
|
|
8
|
+
insertRules(group: number, rules: string[]): void;
|
|
9
9
|
clearGroup(group: number): void;
|
|
10
10
|
getGroup(group: number): string;
|
|
11
11
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { GroupedTag, Sheet, SheetOptions } from './types';
|
|
2
|
-
|
|
2
|
+
type SheetConstructorArgs = {
|
|
3
3
|
isServer?: boolean;
|
|
4
4
|
useCSSOMInjection?: boolean;
|
|
5
5
|
target?: HTMLElement;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type GlobalStylesAllocationMap = {
|
|
8
8
|
[key: string]: number;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type NamesAllocationMap = Map<string, Set<string>>;
|
|
11
11
|
/** Contains the main stylesheet logic for stringification and caching */
|
|
12
12
|
export default class StyleSheet implements Sheet {
|
|
13
13
|
gs: GlobalStylesAllocationMap;
|
|
@@ -151,13 +151,13 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
//
|
|
154
|
-
var SC_ATTR = typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';
|
|
154
|
+
var SC_ATTR = typeof process !== 'undefined' && typeof process.env !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';
|
|
155
155
|
var SC_ATTR_ACTIVE = 'active';
|
|
156
156
|
var SC_ATTR_VERSION = 'data-styled-version';
|
|
157
|
-
var SC_VERSION = "5.3.
|
|
157
|
+
var SC_VERSION = "5.3.11";
|
|
158
158
|
var SPLITTER = '/*!sc*/\n';
|
|
159
159
|
var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
|
|
160
|
-
var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean' ? SC_DISABLE_SPEEDY : typeof process !== '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
|
|
160
|
+
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
|
|
161
161
|
|
|
162
162
|
//
|
|
163
163
|
var EMPTY_ARRAY = Object.freeze([]);
|
|
@@ -997,8 +997,8 @@ function addUnitIfNeeded(name, value) {
|
|
|
997
997
|
return '';
|
|
998
998
|
}
|
|
999
999
|
|
|
1000
|
-
if (typeof value === 'number' && value !== 0 && !(name in unitless)) {
|
|
1001
|
-
return value + "px"; // Presumes implicit 'px' suffix for unitless numbers
|
|
1000
|
+
if (typeof value === 'number' && value !== 0 && !(name in unitless) && !name.startsWith('--')) {
|
|
1001
|
+
return value + "px"; // Presumes implicit 'px' suffix for unitless numbers except for CSS variables
|
|
1002
1002
|
}
|
|
1003
1003
|
|
|
1004
1004
|
return String(value).trim();
|
|
@@ -5993,7 +5993,7 @@ var StyledNativeComponent = /*#__PURE__*/function (_Component) {
|
|
|
5993
5993
|
propsForElement.style = typeof style === 'function' ? function (state) {
|
|
5994
5994
|
return [generatedStyles].concat(style(state));
|
|
5995
5995
|
} : [generatedStyles].concat(style);
|
|
5996
|
-
propsForElement.testID = testID;
|
|
5996
|
+
propsForElement.testID = testID || propsForElement.testID;
|
|
5997
5997
|
if (forwardedRef) propsForElement.ref = forwardedRef;
|
|
5998
5998
|
if (forwardedAs) propsForElement.as = forwardedAs;
|
|
5999
5999
|
return React.createElement(elementToBeRendered, propsForElement);
|