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.
Files changed (256) hide show
  1. package/dist/styled-components.browser.cjs.js +1 -1
  2. package/dist/styled-components.browser.cjs.js.map +1 -1
  3. package/dist/styled-components.browser.esm.js +1 -1
  4. package/dist/styled-components.browser.esm.js.map +1 -1
  5. package/dist/styled-components.cjs.js +1 -1
  6. package/dist/styled-components.cjs.js.map +1 -1
  7. package/dist/styled-components.esm.js +1 -1
  8. package/dist/styled-components.esm.js.map +1 -1
  9. package/dist/styled-components.js +1 -1
  10. package/dist/styled-components.js.map +1 -1
  11. package/dist/styled-components.min.js +1 -1
  12. package/dist/styled-components.min.js.map +1 -1
  13. package/native/dist/base.d.ts +3 -9
  14. package/native/dist/constructors/constructWithOptions.d.ts +39 -14
  15. package/native/dist/constructors/createGlobalStyle.d.ts +2 -2
  16. package/native/dist/constructors/css.d.ts +4 -4
  17. package/native/dist/constructors/keyframes.d.ts +1 -1
  18. package/native/dist/constructors/styled.d.ts +176 -180
  19. package/native/dist/hoc/withTheme.d.ts +2 -2
  20. package/native/dist/index.d.ts +2 -2
  21. package/native/dist/models/ComponentStyle.d.ts +0 -1
  22. package/native/dist/models/GlobalStyle.d.ts +1 -1
  23. package/native/dist/models/InlineStyle.d.ts +1 -1
  24. package/native/dist/models/StyleSheetManager.d.ts +58 -15
  25. package/native/dist/models/StyledComponent.d.ts +1 -1
  26. package/native/dist/models/StyledNativeComponent.d.ts +2 -2
  27. package/native/dist/models/ThemeProvider.d.ts +5 -4
  28. package/native/dist/native/index.d.ts +28 -33
  29. package/native/dist/sheet/GroupedTag.d.ts +1 -1
  30. package/native/dist/sheet/Sheet.d.ts +3 -3
  31. package/native/dist/sheet/types.d.ts +1 -1
  32. package/native/dist/styled-components.native.cjs.js +6 -6
  33. package/native/dist/styled-components.native.cjs.js.map +1 -1
  34. package/native/dist/styled-components.native.esm.js +6 -6
  35. package/native/dist/styled-components.native.esm.js.map +1 -1
  36. package/native/dist/test/types.d.ts +9 -0
  37. package/native/dist/test/utils.d.ts +176 -180
  38. package/native/dist/test/veryLargeUnionType.d.ts +1 -0
  39. package/native/dist/types.d.ts +85 -62
  40. package/native/dist/utils/determineTheme.d.ts +4 -2
  41. package/native/dist/utils/domElements.d.ts +1 -1
  42. package/native/dist/utils/empties.d.ts +2 -2
  43. package/native/dist/utils/flatten.d.ts +3 -3
  44. package/native/dist/utils/hoist.d.ts +3 -3
  45. package/native/dist/utils/interleave.d.ts +1 -1
  46. package/native/dist/utils/isFunction.d.ts +1 -1
  47. package/native/dist/utils/isPlainObject.d.ts +1 -1
  48. package/native/dist/utils/isStatelessFunction.d.ts +1 -1
  49. package/native/dist/utils/isStaticRules.d.ts +1 -1
  50. package/native/dist/utils/joinStrings.d.ts +2 -1
  51. package/native/dist/utils/mixinDeep.d.ts +1 -2
  52. package/native/dist/utils/stylis.d.ts +3 -3
  53. package/package.json +2 -4
  54. package/primitives/dist/styled-components-primitives.cjs.js +6 -6
  55. package/primitives/dist/styled-components-primitives.cjs.js.map +1 -1
  56. package/primitives/dist/styled-components-primitives.esm.js +6 -6
  57. package/primitives/dist/styled-components-primitives.esm.js.map +1 -1
  58. package/native/dist/base.d.ts.map +0 -1
  59. package/native/dist/constants.d.ts.map +0 -1
  60. package/native/dist/constructors/constructWithOptions.d.ts.map +0 -1
  61. package/native/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  62. package/native/dist/constructors/css.d.ts.map +0 -1
  63. package/native/dist/constructors/keyframes.d.ts.map +0 -1
  64. package/native/dist/constructors/styled.d.ts.map +0 -1
  65. package/native/dist/dist/base.d.ts +0 -18
  66. package/native/dist/dist/base.d.ts.map +0 -1
  67. package/native/dist/dist/constants.d.ts +0 -9
  68. package/native/dist/dist/constants.d.ts.map +0 -1
  69. package/native/dist/dist/constructors/constructWithOptions.d.ts +0 -20
  70. package/native/dist/dist/constructors/constructWithOptions.d.ts.map +0 -1
  71. package/native/dist/dist/constructors/createGlobalStyle.d.ts +0 -4
  72. package/native/dist/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  73. package/native/dist/dist/constructors/css.d.ts +0 -5
  74. package/native/dist/dist/constructors/css.d.ts.map +0 -1
  75. package/native/dist/dist/constructors/keyframes.d.ts +0 -4
  76. package/native/dist/dist/constructors/keyframes.d.ts.map +0 -1
  77. package/native/dist/dist/constructors/styled.d.ts +0 -186
  78. package/native/dist/dist/constructors/styled.d.ts.map +0 -1
  79. package/native/dist/dist/hoc/withTheme.d.ts +0 -4
  80. package/native/dist/dist/hoc/withTheme.d.ts.map +0 -1
  81. package/native/dist/dist/hoc/withTheme.spec.d.ts +0 -2
  82. package/native/dist/dist/hoc/withTheme.spec.d.ts.map +0 -1
  83. package/native/dist/dist/hooks/useTheme.d.ts +0 -4
  84. package/native/dist/dist/hooks/useTheme.d.ts.map +0 -1
  85. package/native/dist/dist/index-standalone.d.ts +0 -3
  86. package/native/dist/dist/index-standalone.d.ts.map +0 -1
  87. package/native/dist/dist/index.d.ts +0 -4
  88. package/native/dist/dist/index.d.ts.map +0 -1
  89. package/native/dist/dist/macro/index.d.ts +0 -3
  90. package/native/dist/dist/macro/index.d.ts.map +0 -1
  91. package/native/dist/dist/macro/test/babel.config.d.ts +0 -1
  92. package/native/dist/dist/macro/test/babel.config.d.ts.map +0 -1
  93. package/native/dist/dist/models/ComponentStyle.d.ts +0 -16
  94. package/native/dist/dist/models/ComponentStyle.d.ts.map +0 -1
  95. package/native/dist/dist/models/GlobalStyle.d.ts +0 -12
  96. package/native/dist/dist/models/GlobalStyle.d.ts.map +0 -1
  97. package/native/dist/dist/models/InlineStyle.d.ts +0 -7
  98. package/native/dist/dist/models/InlineStyle.d.ts.map +0 -1
  99. package/native/dist/dist/models/Keyframes.d.ts +0 -12
  100. package/native/dist/dist/models/Keyframes.d.ts.map +0 -1
  101. package/native/dist/dist/models/ServerStyleSheet.d.ts +0 -16
  102. package/native/dist/dist/models/ServerStyleSheet.d.ts.map +0 -1
  103. package/native/dist/dist/models/StyleSheetManager.d.ts +0 -22
  104. package/native/dist/dist/models/StyleSheetManager.d.ts.map +0 -1
  105. package/native/dist/dist/models/StyledComponent.d.ts +0 -4
  106. package/native/dist/dist/models/StyledComponent.d.ts.map +0 -1
  107. package/native/dist/dist/models/StyledNativeComponent.d.ts +0 -4
  108. package/native/dist/dist/models/StyledNativeComponent.d.ts.map +0 -1
  109. package/native/dist/dist/models/ThemeProvider.d.ts +0 -18
  110. package/native/dist/dist/models/ThemeProvider.d.ts.map +0 -1
  111. package/native/dist/dist/native/index.d.ts +0 -65
  112. package/native/dist/dist/native/index.d.ts.map +0 -1
  113. package/native/dist/dist/primitives/index.d.ts +0 -23
  114. package/native/dist/dist/primitives/index.d.ts.map +0 -1
  115. package/native/dist/dist/secretInternals.d.ts +0 -6
  116. package/native/dist/dist/secretInternals.d.ts.map +0 -1
  117. package/native/dist/dist/sheet/GroupIDAllocator.d.ts +0 -5
  118. package/native/dist/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  119. package/native/dist/dist/sheet/GroupedTag.d.ts +0 -12
  120. package/native/dist/dist/sheet/GroupedTag.d.ts.map +0 -1
  121. package/native/dist/dist/sheet/Rehydration.d.ts +0 -4
  122. package/native/dist/dist/sheet/Rehydration.d.ts.map +0 -1
  123. package/native/dist/dist/sheet/Sheet.d.ts +0 -41
  124. package/native/dist/dist/sheet/Sheet.d.ts.map +0 -1
  125. package/native/dist/dist/sheet/Tag.d.ts +0 -55
  126. package/native/dist/dist/sheet/Tag.d.ts.map +0 -1
  127. package/native/dist/dist/sheet/dom.d.ts +0 -5
  128. package/native/dist/dist/sheet/dom.d.ts.map +0 -1
  129. package/native/dist/dist/sheet/index.d.ts +0 -2
  130. package/native/dist/dist/sheet/index.d.ts.map +0 -1
  131. package/native/dist/dist/sheet/types.d.ts +0 -35
  132. package/native/dist/dist/sheet/types.d.ts.map +0 -1
  133. package/native/dist/dist/test/globals.d.ts +0 -3
  134. package/native/dist/dist/test/globals.d.ts.map +0 -1
  135. package/native/dist/dist/test/utils.d.ts +0 -192
  136. package/native/dist/dist/test/utils.d.ts.map +0 -1
  137. package/native/dist/dist/types.d.ts +0 -121
  138. package/native/dist/dist/types.d.ts.map +0 -1
  139. package/native/dist/dist/utils/addUnitIfNeeded.d.ts +0 -2
  140. package/native/dist/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  141. package/native/dist/dist/utils/checkDynamicCreation.d.ts +0 -2
  142. package/native/dist/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  143. package/native/dist/dist/utils/createWarnTooManyClasses.d.ts +0 -4
  144. package/native/dist/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  145. package/native/dist/dist/utils/determineTheme.d.ts +0 -3
  146. package/native/dist/dist/utils/determineTheme.d.ts.map +0 -1
  147. package/native/dist/dist/utils/domElements.d.ts +0 -3
  148. package/native/dist/dist/utils/domElements.d.ts.map +0 -1
  149. package/native/dist/dist/utils/empties.d.ts +0 -4
  150. package/native/dist/dist/utils/empties.d.ts.map +0 -1
  151. package/native/dist/dist/utils/error.d.ts +0 -6
  152. package/native/dist/dist/utils/error.d.ts.map +0 -1
  153. package/native/dist/dist/utils/errors.d.ts +0 -21
  154. package/native/dist/dist/utils/errors.d.ts.map +0 -1
  155. package/native/dist/dist/utils/escape.d.ts +0 -6
  156. package/native/dist/dist/utils/escape.d.ts.map +0 -1
  157. package/native/dist/dist/utils/flatten.d.ts +0 -5
  158. package/native/dist/dist/utils/flatten.d.ts.map +0 -1
  159. package/native/dist/dist/utils/generateAlphabeticName.d.ts +0 -2
  160. package/native/dist/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  161. package/native/dist/dist/utils/generateComponentId.d.ts +0 -2
  162. package/native/dist/dist/utils/generateComponentId.d.ts.map +0 -1
  163. package/native/dist/dist/utils/generateDisplayName.d.ts +0 -3
  164. package/native/dist/dist/utils/generateDisplayName.d.ts.map +0 -1
  165. package/native/dist/dist/utils/getComponentName.d.ts +0 -3
  166. package/native/dist/dist/utils/getComponentName.d.ts.map +0 -1
  167. package/native/dist/dist/utils/hash.d.ts +0 -4
  168. package/native/dist/dist/utils/hash.d.ts.map +0 -1
  169. package/native/dist/dist/utils/hoist.d.ts +0 -52
  170. package/native/dist/dist/utils/hoist.d.ts.map +0 -1
  171. package/native/dist/dist/utils/hyphenateStyleName.d.ts +0 -15
  172. package/native/dist/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  173. package/native/dist/dist/utils/interleave.d.ts +0 -3
  174. package/native/dist/dist/utils/interleave.d.ts.map +0 -1
  175. package/native/dist/dist/utils/isFunction.d.ts +0 -2
  176. package/native/dist/dist/utils/isFunction.d.ts.map +0 -1
  177. package/native/dist/dist/utils/isPlainObject.d.ts +0 -2
  178. package/native/dist/dist/utils/isPlainObject.d.ts.map +0 -1
  179. package/native/dist/dist/utils/isStatelessFunction.d.ts +0 -2
  180. package/native/dist/dist/utils/isStatelessFunction.d.ts.map +0 -1
  181. package/native/dist/dist/utils/isStaticRules.d.ts +0 -3
  182. package/native/dist/dist/utils/isStaticRules.d.ts.map +0 -1
  183. package/native/dist/dist/utils/isStyledComponent.d.ts +0 -3
  184. package/native/dist/dist/utils/isStyledComponent.d.ts.map +0 -1
  185. package/native/dist/dist/utils/isTag.d.ts +0 -3
  186. package/native/dist/dist/utils/isTag.d.ts.map +0 -1
  187. package/native/dist/dist/utils/joinStrings.d.ts +0 -5
  188. package/native/dist/dist/utils/joinStrings.d.ts.map +0 -1
  189. package/native/dist/dist/utils/mixinDeep.d.ts +0 -8
  190. package/native/dist/dist/utils/mixinDeep.d.ts.map +0 -1
  191. package/native/dist/dist/utils/nonce.d.ts +0 -2
  192. package/native/dist/dist/utils/nonce.d.ts.map +0 -1
  193. package/native/dist/dist/utils/stylis.d.ts +0 -10
  194. package/native/dist/dist/utils/stylis.d.ts.map +0 -1
  195. package/native/dist/hoc/withTheme.d.ts.map +0 -1
  196. package/native/dist/hoc/withTheme.spec.d.ts.map +0 -1
  197. package/native/dist/hooks/useTheme.d.ts +0 -3
  198. package/native/dist/hooks/useTheme.d.ts.map +0 -1
  199. package/native/dist/index-standalone.d.ts.map +0 -1
  200. package/native/dist/index.d.ts.map +0 -1
  201. package/native/dist/macro/index.d.ts.map +0 -1
  202. package/native/dist/macro/test/babel.config.d.ts +0 -1
  203. package/native/dist/macro/test/babel.config.d.ts.map +0 -1
  204. package/native/dist/models/ComponentStyle.d.ts.map +0 -1
  205. package/native/dist/models/GlobalStyle.d.ts.map +0 -1
  206. package/native/dist/models/InlineStyle.d.ts.map +0 -1
  207. package/native/dist/models/Keyframes.d.ts.map +0 -1
  208. package/native/dist/models/ServerStyleSheet.d.ts.map +0 -1
  209. package/native/dist/models/StyleSheetManager.d.ts.map +0 -1
  210. package/native/dist/models/StyledComponent.d.ts.map +0 -1
  211. package/native/dist/models/StyledNativeComponent.d.ts.map +0 -1
  212. package/native/dist/models/ThemeProvider.d.ts.map +0 -1
  213. package/native/dist/native/index.d.ts.map +0 -1
  214. package/native/dist/primitives/index.d.ts +0 -23
  215. package/native/dist/primitives/index.d.ts.map +0 -1
  216. package/native/dist/secretInternals.d.ts.map +0 -1
  217. package/native/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  218. package/native/dist/sheet/GroupedTag.d.ts.map +0 -1
  219. package/native/dist/sheet/Rehydration.d.ts.map +0 -1
  220. package/native/dist/sheet/Sheet.d.ts.map +0 -1
  221. package/native/dist/sheet/Tag.d.ts.map +0 -1
  222. package/native/dist/sheet/dom.d.ts.map +0 -1
  223. package/native/dist/sheet/index.d.ts.map +0 -1
  224. package/native/dist/sheet/types.d.ts.map +0 -1
  225. package/native/dist/test/globals.d.ts.map +0 -1
  226. package/native/dist/test/utils.d.ts.map +0 -1
  227. package/native/dist/types.d.ts.map +0 -1
  228. package/native/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  229. package/native/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  230. package/native/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  231. package/native/dist/utils/determineTheme.d.ts.map +0 -1
  232. package/native/dist/utils/domElements.d.ts.map +0 -1
  233. package/native/dist/utils/empties.d.ts.map +0 -1
  234. package/native/dist/utils/error.d.ts.map +0 -1
  235. package/native/dist/utils/errors.d.ts.map +0 -1
  236. package/native/dist/utils/escape.d.ts.map +0 -1
  237. package/native/dist/utils/flatten.d.ts.map +0 -1
  238. package/native/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  239. package/native/dist/utils/generateComponentId.d.ts.map +0 -1
  240. package/native/dist/utils/generateDisplayName.d.ts.map +0 -1
  241. package/native/dist/utils/getComponentName.d.ts.map +0 -1
  242. package/native/dist/utils/hash.d.ts.map +0 -1
  243. package/native/dist/utils/hoist.d.ts.map +0 -1
  244. package/native/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  245. package/native/dist/utils/interleave.d.ts.map +0 -1
  246. package/native/dist/utils/isFunction.d.ts.map +0 -1
  247. package/native/dist/utils/isPlainObject.d.ts.map +0 -1
  248. package/native/dist/utils/isStatelessFunction.d.ts.map +0 -1
  249. package/native/dist/utils/isStaticRules.d.ts.map +0 -1
  250. package/native/dist/utils/isStyledComponent.d.ts.map +0 -1
  251. package/native/dist/utils/isTag.d.ts.map +0 -1
  252. package/native/dist/utils/joinStrings.d.ts.map +0 -1
  253. package/native/dist/utils/mixinDeep.d.ts.map +0 -1
  254. package/native/dist/utils/nonce.d.ts.map +0 -1
  255. package/native/dist/utils/stylis.d.ts.map +0 -1
  256. 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 type Props = {
5
- children?: React.ReactChild;
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
- disableVendorPrefixes?: boolean;
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 const StyleSheetContext: React.Context<void | StyleSheet>;
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 {}, Statics = unknown>(target: Target, options: StyledOptions<'web', OuterProps>, rules: RuleSet<OuterProps>): ReturnType<IStyledComponentFactory<'web', Target, OuterProps, Statics>>;
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 { ExtensibleObject, IInlineStyleConstructor, IStyledComponent, IStyledComponentFactory, NativeTarget, RuleSet, StyledOptions } from '../types';
2
- declare const _default: (InlineStyle: IInlineStyleConstructor<any>) => <Target extends NativeTarget, OuterProps extends ExtensibleObject, Statics = unknown>(target: Target, options: StyledOptions<"native", OuterProps>, rules: RuleSet<OuterProps>) => IStyledComponent<"native", Target, OuterProps> & Statics;
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
- declare type ThemeFn = (outerTheme?: DefaultTheme) => DefaultTheme;
28
- declare type ThemeArgument = DefaultTheme | ThemeFn;
29
- declare type Props = {
30
- children?: React.ReactChild;
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 '../hooks/useTheme';
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
- <Props extends {} = {}, Statics = unknown>(initialStyles: import("../types").Styles<(Target extends import("../types").KnownTarget ? React.ComponentProps<Target> : unknown) & Props>, ...interpolations: import("../types").Interpolation<import("../types").ExecutionContext & (Target extends import("../types").KnownTarget ? React.ComponentProps<Target> : unknown) & Props>[]): import("../types").IStyledComponent<"native", Target, (Target extends import("../types").KnownTarget ? React.ComponentProps<Target> : unknown) & Props> & Statics;
11
- attrs(attrs: import("../types").Attrs<import("../types").ExtensibleObject & (Target extends import("../types").KnownTarget ? React.ComponentProps<Target> : unknown)>): any;
12
- withConfig(config: import("../types").StyledOptions<"native", Target extends import("../types").KnownTarget ? React.ComponentProps<Target> : unknown>): any;
13
- }) & {
14
- ActivityIndicator: Styled<"native", typeof import("react-native").ActivityIndicator, import("react-native").ActivityIndicatorProps, {}, unknown>;
15
- Button: Styled<"native", typeof import("react-native").Button, import("react-native").ButtonProps, {}, unknown>;
16
- DatePickerIOS: Styled<"native", typeof import("react-native").DatePickerIOS, import("react-native").DatePickerIOSProps, {}, unknown>;
17
- DrawerLayoutAndroid: Styled<"native", typeof import("react-native").DrawerLayoutAndroid, import("react-native").DrawerLayoutAndroidProps, {}, unknown>;
18
- FlatList: Styled<"native", typeof import("react-native").FlatList, import("react-native").FlatListProps<unknown>, {}, unknown>;
19
- Image: Styled<"native", typeof import("react-native").Image, import("react-native").ImageProps, {}, unknown>;
20
- ImageBackground: Styled<"native", typeof import("react-native").ImageBackground, import("react-native").ImageBackgroundProps, {}, unknown>;
21
- KeyboardAvoidingView: Styled<"native", typeof import("react-native").KeyboardAvoidingView, import("react-native").KeyboardAvoidingViewProps, {}, unknown>;
22
- Modal: Styled<"native", typeof import("react-native").Modal, import("react-native").ModalProps, {}, unknown>;
23
- 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>, {}, unknown>;
24
- ProgressBarAndroid: Styled<"native", typeof import("react-native").ProgressBarAndroid, import("react-native").ProgressBarAndroidProps, {}, unknown>;
25
- ProgressViewIOS: Styled<"native", typeof import("react-native").ProgressViewIOS, import("react-native").ProgressViewIOSProps, {}, unknown>;
26
- RefreshControl: Styled<"native", typeof import("react-native").RefreshControl, import("react-native").RefreshControlProps, {}, unknown>;
27
- SafeAreaView: Styled<"native", typeof import("react-native").SafeAreaView, import("react-native").ViewProps, {}, unknown>;
28
- ScrollView: Styled<"native", typeof import("react-native").ScrollView, import("react-native").ScrollViewProps, {}, unknown>;
29
- SectionList: Styled<"native", typeof import("react-native").SectionList, import("react-native").SectionListProps<unknown, unknown>, {}, unknown>;
30
- Slider: Styled<"native", typeof import("react-native").Slider, import("react-native").SliderProps, {}, unknown>;
31
- Switch: Styled<"native", typeof import("react-native").Switch, import("react-native").SwitchProps, {}, unknown>;
32
- Text: Styled<"native", typeof import("react-native").Text, import("react-native").TextProps, {}, unknown>;
33
- TextInput: Styled<"native", typeof import("react-native").TextInput, import("react-native").TextInputProps, {}, unknown>;
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 styled;
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 | string[]): void;
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
- declare type SheetConstructorArgs = {
2
+ type SheetConstructorArgs = {
3
3
  isServer?: boolean;
4
4
  useCSSOMInjection?: boolean;
5
5
  target?: HTMLElement;
6
6
  };
7
- declare type GlobalStylesAllocationMap = {
7
+ type GlobalStylesAllocationMap = {
8
8
  [key: string]: number;
9
9
  };
10
- declare type NamesAllocationMap = Map<string, Set<string>>;
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;
@@ -14,7 +14,7 @@ export interface GroupedTag {
14
14
  length: number;
15
15
  tag: Tag;
16
16
  }
17
- export declare type SheetOptions = {
17
+ export type SheetOptions = {
18
18
  isServer: boolean;
19
19
  target?: HTMLElement;
20
20
  useCSSOMInjection: boolean;
@@ -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.6";
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 !== 'undefined' && 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'); // Shared empty execution context when generating static styles
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);