styled-components 5.3.6 → 5.3.7

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 (246) 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 -3
  14. package/native/dist/constructors/constructWithOptions.d.ts +24 -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/GlobalStyle.d.ts +1 -1
  22. package/native/dist/models/InlineStyle.d.ts +1 -1
  23. package/native/dist/models/StyleSheetManager.d.ts +58 -14
  24. package/native/dist/models/StyledComponent.d.ts +1 -1
  25. package/native/dist/models/StyledNativeComponent.d.ts +2 -2
  26. package/native/dist/models/ThemeProvider.d.ts +1 -1
  27. package/native/dist/native/index.d.ts +27 -31
  28. package/native/dist/styled-components.native.cjs.js +4 -4
  29. package/native/dist/styled-components.native.cjs.js.map +1 -1
  30. package/native/dist/styled-components.native.esm.js +4 -4
  31. package/native/dist/styled-components.native.esm.js.map +1 -1
  32. package/native/dist/test/types.d.ts +1 -0
  33. package/native/dist/test/utils.d.ts +176 -180
  34. package/native/dist/types.d.ts +66 -48
  35. package/native/dist/utils/determineTheme.d.ts +2 -2
  36. package/native/dist/utils/domElements.d.ts +1 -1
  37. package/native/dist/utils/empties.d.ts +2 -2
  38. package/native/dist/utils/flatten.d.ts +3 -3
  39. package/native/dist/utils/interleave.d.ts +1 -1
  40. package/native/dist/utils/isStaticRules.d.ts +1 -1
  41. package/native/dist/utils/joinStrings.d.ts +1 -1
  42. package/native/dist/utils/mixinDeep.d.ts +1 -2
  43. package/native/dist/utils/stylis.d.ts +3 -3
  44. package/package.json +2 -4
  45. package/primitives/dist/styled-components-primitives.cjs.js +4 -4
  46. package/primitives/dist/styled-components-primitives.cjs.js.map +1 -1
  47. package/primitives/dist/styled-components-primitives.esm.js +4 -4
  48. package/primitives/dist/styled-components-primitives.esm.js.map +1 -1
  49. package/native/dist/base.d.ts.map +0 -1
  50. package/native/dist/constants.d.ts.map +0 -1
  51. package/native/dist/constructors/constructWithOptions.d.ts.map +0 -1
  52. package/native/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  53. package/native/dist/constructors/css.d.ts.map +0 -1
  54. package/native/dist/constructors/keyframes.d.ts.map +0 -1
  55. package/native/dist/constructors/styled.d.ts.map +0 -1
  56. package/native/dist/dist/base.d.ts +0 -18
  57. package/native/dist/dist/base.d.ts.map +0 -1
  58. package/native/dist/dist/constants.d.ts +0 -9
  59. package/native/dist/dist/constants.d.ts.map +0 -1
  60. package/native/dist/dist/constructors/constructWithOptions.d.ts +0 -20
  61. package/native/dist/dist/constructors/constructWithOptions.d.ts.map +0 -1
  62. package/native/dist/dist/constructors/createGlobalStyle.d.ts +0 -4
  63. package/native/dist/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  64. package/native/dist/dist/constructors/css.d.ts +0 -5
  65. package/native/dist/dist/constructors/css.d.ts.map +0 -1
  66. package/native/dist/dist/constructors/keyframes.d.ts +0 -4
  67. package/native/dist/dist/constructors/keyframes.d.ts.map +0 -1
  68. package/native/dist/dist/constructors/styled.d.ts +0 -186
  69. package/native/dist/dist/constructors/styled.d.ts.map +0 -1
  70. package/native/dist/dist/hoc/withTheme.d.ts +0 -4
  71. package/native/dist/dist/hoc/withTheme.d.ts.map +0 -1
  72. package/native/dist/dist/hoc/withTheme.spec.d.ts +0 -2
  73. package/native/dist/dist/hoc/withTheme.spec.d.ts.map +0 -1
  74. package/native/dist/dist/hooks/useTheme.d.ts +0 -4
  75. package/native/dist/dist/hooks/useTheme.d.ts.map +0 -1
  76. package/native/dist/dist/index-standalone.d.ts +0 -3
  77. package/native/dist/dist/index-standalone.d.ts.map +0 -1
  78. package/native/dist/dist/index.d.ts +0 -4
  79. package/native/dist/dist/index.d.ts.map +0 -1
  80. package/native/dist/dist/macro/index.d.ts +0 -3
  81. package/native/dist/dist/macro/index.d.ts.map +0 -1
  82. package/native/dist/dist/macro/test/babel.config.d.ts +0 -1
  83. package/native/dist/dist/macro/test/babel.config.d.ts.map +0 -1
  84. package/native/dist/dist/models/ComponentStyle.d.ts +0 -16
  85. package/native/dist/dist/models/ComponentStyle.d.ts.map +0 -1
  86. package/native/dist/dist/models/GlobalStyle.d.ts +0 -12
  87. package/native/dist/dist/models/GlobalStyle.d.ts.map +0 -1
  88. package/native/dist/dist/models/InlineStyle.d.ts +0 -7
  89. package/native/dist/dist/models/InlineStyle.d.ts.map +0 -1
  90. package/native/dist/dist/models/Keyframes.d.ts +0 -12
  91. package/native/dist/dist/models/Keyframes.d.ts.map +0 -1
  92. package/native/dist/dist/models/ServerStyleSheet.d.ts +0 -16
  93. package/native/dist/dist/models/ServerStyleSheet.d.ts.map +0 -1
  94. package/native/dist/dist/models/StyleSheetManager.d.ts +0 -22
  95. package/native/dist/dist/models/StyleSheetManager.d.ts.map +0 -1
  96. package/native/dist/dist/models/StyledComponent.d.ts +0 -4
  97. package/native/dist/dist/models/StyledComponent.d.ts.map +0 -1
  98. package/native/dist/dist/models/StyledNativeComponent.d.ts +0 -4
  99. package/native/dist/dist/models/StyledNativeComponent.d.ts.map +0 -1
  100. package/native/dist/dist/models/ThemeProvider.d.ts +0 -18
  101. package/native/dist/dist/models/ThemeProvider.d.ts.map +0 -1
  102. package/native/dist/dist/native/index.d.ts +0 -65
  103. package/native/dist/dist/native/index.d.ts.map +0 -1
  104. package/native/dist/dist/primitives/index.d.ts +0 -23
  105. package/native/dist/dist/primitives/index.d.ts.map +0 -1
  106. package/native/dist/dist/secretInternals.d.ts +0 -6
  107. package/native/dist/dist/secretInternals.d.ts.map +0 -1
  108. package/native/dist/dist/sheet/GroupIDAllocator.d.ts +0 -5
  109. package/native/dist/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  110. package/native/dist/dist/sheet/GroupedTag.d.ts +0 -12
  111. package/native/dist/dist/sheet/GroupedTag.d.ts.map +0 -1
  112. package/native/dist/dist/sheet/Rehydration.d.ts +0 -4
  113. package/native/dist/dist/sheet/Rehydration.d.ts.map +0 -1
  114. package/native/dist/dist/sheet/Sheet.d.ts +0 -41
  115. package/native/dist/dist/sheet/Sheet.d.ts.map +0 -1
  116. package/native/dist/dist/sheet/Tag.d.ts +0 -55
  117. package/native/dist/dist/sheet/Tag.d.ts.map +0 -1
  118. package/native/dist/dist/sheet/dom.d.ts +0 -5
  119. package/native/dist/dist/sheet/dom.d.ts.map +0 -1
  120. package/native/dist/dist/sheet/index.d.ts +0 -2
  121. package/native/dist/dist/sheet/index.d.ts.map +0 -1
  122. package/native/dist/dist/sheet/types.d.ts +0 -35
  123. package/native/dist/dist/sheet/types.d.ts.map +0 -1
  124. package/native/dist/dist/test/globals.d.ts +0 -3
  125. package/native/dist/dist/test/globals.d.ts.map +0 -1
  126. package/native/dist/dist/test/utils.d.ts +0 -192
  127. package/native/dist/dist/test/utils.d.ts.map +0 -1
  128. package/native/dist/dist/types.d.ts +0 -121
  129. package/native/dist/dist/types.d.ts.map +0 -1
  130. package/native/dist/dist/utils/addUnitIfNeeded.d.ts +0 -2
  131. package/native/dist/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  132. package/native/dist/dist/utils/checkDynamicCreation.d.ts +0 -2
  133. package/native/dist/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  134. package/native/dist/dist/utils/createWarnTooManyClasses.d.ts +0 -4
  135. package/native/dist/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  136. package/native/dist/dist/utils/determineTheme.d.ts +0 -3
  137. package/native/dist/dist/utils/determineTheme.d.ts.map +0 -1
  138. package/native/dist/dist/utils/domElements.d.ts +0 -3
  139. package/native/dist/dist/utils/domElements.d.ts.map +0 -1
  140. package/native/dist/dist/utils/empties.d.ts +0 -4
  141. package/native/dist/dist/utils/empties.d.ts.map +0 -1
  142. package/native/dist/dist/utils/error.d.ts +0 -6
  143. package/native/dist/dist/utils/error.d.ts.map +0 -1
  144. package/native/dist/dist/utils/errors.d.ts +0 -21
  145. package/native/dist/dist/utils/errors.d.ts.map +0 -1
  146. package/native/dist/dist/utils/escape.d.ts +0 -6
  147. package/native/dist/dist/utils/escape.d.ts.map +0 -1
  148. package/native/dist/dist/utils/flatten.d.ts +0 -5
  149. package/native/dist/dist/utils/flatten.d.ts.map +0 -1
  150. package/native/dist/dist/utils/generateAlphabeticName.d.ts +0 -2
  151. package/native/dist/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  152. package/native/dist/dist/utils/generateComponentId.d.ts +0 -2
  153. package/native/dist/dist/utils/generateComponentId.d.ts.map +0 -1
  154. package/native/dist/dist/utils/generateDisplayName.d.ts +0 -3
  155. package/native/dist/dist/utils/generateDisplayName.d.ts.map +0 -1
  156. package/native/dist/dist/utils/getComponentName.d.ts +0 -3
  157. package/native/dist/dist/utils/getComponentName.d.ts.map +0 -1
  158. package/native/dist/dist/utils/hash.d.ts +0 -4
  159. package/native/dist/dist/utils/hash.d.ts.map +0 -1
  160. package/native/dist/dist/utils/hoist.d.ts +0 -52
  161. package/native/dist/dist/utils/hoist.d.ts.map +0 -1
  162. package/native/dist/dist/utils/hyphenateStyleName.d.ts +0 -15
  163. package/native/dist/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  164. package/native/dist/dist/utils/interleave.d.ts +0 -3
  165. package/native/dist/dist/utils/interleave.d.ts.map +0 -1
  166. package/native/dist/dist/utils/isFunction.d.ts +0 -2
  167. package/native/dist/dist/utils/isFunction.d.ts.map +0 -1
  168. package/native/dist/dist/utils/isPlainObject.d.ts +0 -2
  169. package/native/dist/dist/utils/isPlainObject.d.ts.map +0 -1
  170. package/native/dist/dist/utils/isStatelessFunction.d.ts +0 -2
  171. package/native/dist/dist/utils/isStatelessFunction.d.ts.map +0 -1
  172. package/native/dist/dist/utils/isStaticRules.d.ts +0 -3
  173. package/native/dist/dist/utils/isStaticRules.d.ts.map +0 -1
  174. package/native/dist/dist/utils/isStyledComponent.d.ts +0 -3
  175. package/native/dist/dist/utils/isStyledComponent.d.ts.map +0 -1
  176. package/native/dist/dist/utils/isTag.d.ts +0 -3
  177. package/native/dist/dist/utils/isTag.d.ts.map +0 -1
  178. package/native/dist/dist/utils/joinStrings.d.ts +0 -5
  179. package/native/dist/dist/utils/joinStrings.d.ts.map +0 -1
  180. package/native/dist/dist/utils/mixinDeep.d.ts +0 -8
  181. package/native/dist/dist/utils/mixinDeep.d.ts.map +0 -1
  182. package/native/dist/dist/utils/nonce.d.ts +0 -2
  183. package/native/dist/dist/utils/nonce.d.ts.map +0 -1
  184. package/native/dist/dist/utils/stylis.d.ts +0 -10
  185. package/native/dist/dist/utils/stylis.d.ts.map +0 -1
  186. package/native/dist/hoc/withTheme.d.ts.map +0 -1
  187. package/native/dist/hoc/withTheme.spec.d.ts.map +0 -1
  188. package/native/dist/hooks/useTheme.d.ts.map +0 -1
  189. package/native/dist/index-standalone.d.ts.map +0 -1
  190. package/native/dist/index.d.ts.map +0 -1
  191. package/native/dist/macro/index.d.ts.map +0 -1
  192. package/native/dist/macro/test/babel.config.d.ts +0 -1
  193. package/native/dist/macro/test/babel.config.d.ts.map +0 -1
  194. package/native/dist/models/ComponentStyle.d.ts.map +0 -1
  195. package/native/dist/models/GlobalStyle.d.ts.map +0 -1
  196. package/native/dist/models/InlineStyle.d.ts.map +0 -1
  197. package/native/dist/models/Keyframes.d.ts.map +0 -1
  198. package/native/dist/models/ServerStyleSheet.d.ts.map +0 -1
  199. package/native/dist/models/StyleSheetManager.d.ts.map +0 -1
  200. package/native/dist/models/StyledComponent.d.ts.map +0 -1
  201. package/native/dist/models/StyledNativeComponent.d.ts.map +0 -1
  202. package/native/dist/models/ThemeProvider.d.ts.map +0 -1
  203. package/native/dist/native/index.d.ts.map +0 -1
  204. package/native/dist/primitives/index.d.ts +0 -23
  205. package/native/dist/primitives/index.d.ts.map +0 -1
  206. package/native/dist/secretInternals.d.ts.map +0 -1
  207. package/native/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  208. package/native/dist/sheet/GroupedTag.d.ts.map +0 -1
  209. package/native/dist/sheet/Rehydration.d.ts.map +0 -1
  210. package/native/dist/sheet/Sheet.d.ts.map +0 -1
  211. package/native/dist/sheet/Tag.d.ts.map +0 -1
  212. package/native/dist/sheet/dom.d.ts.map +0 -1
  213. package/native/dist/sheet/index.d.ts.map +0 -1
  214. package/native/dist/sheet/types.d.ts.map +0 -1
  215. package/native/dist/test/globals.d.ts.map +0 -1
  216. package/native/dist/test/utils.d.ts.map +0 -1
  217. package/native/dist/types.d.ts.map +0 -1
  218. package/native/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  219. package/native/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  220. package/native/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  221. package/native/dist/utils/determineTheme.d.ts.map +0 -1
  222. package/native/dist/utils/domElements.d.ts.map +0 -1
  223. package/native/dist/utils/empties.d.ts.map +0 -1
  224. package/native/dist/utils/error.d.ts.map +0 -1
  225. package/native/dist/utils/errors.d.ts.map +0 -1
  226. package/native/dist/utils/escape.d.ts.map +0 -1
  227. package/native/dist/utils/flatten.d.ts.map +0 -1
  228. package/native/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  229. package/native/dist/utils/generateComponentId.d.ts.map +0 -1
  230. package/native/dist/utils/generateDisplayName.d.ts.map +0 -1
  231. package/native/dist/utils/getComponentName.d.ts.map +0 -1
  232. package/native/dist/utils/hash.d.ts.map +0 -1
  233. package/native/dist/utils/hoist.d.ts.map +0 -1
  234. package/native/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  235. package/native/dist/utils/interleave.d.ts.map +0 -1
  236. package/native/dist/utils/isFunction.d.ts.map +0 -1
  237. package/native/dist/utils/isPlainObject.d.ts.map +0 -1
  238. package/native/dist/utils/isStatelessFunction.d.ts.map +0 -1
  239. package/native/dist/utils/isStaticRules.d.ts.map +0 -1
  240. package/native/dist/utils/isStyledComponent.d.ts.map +0 -1
  241. package/native/dist/utils/isTag.d.ts.map +0 -1
  242. package/native/dist/utils/joinStrings.d.ts.map +0 -1
  243. package/native/dist/utils/mixinDeep.d.ts.map +0 -1
  244. package/native/dist/utils/nonce.d.ts.map +0 -1
  245. package/native/dist/utils/stylis.d.ts.map +0 -1
  246. package/postinstall.js +0 -82
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { AnyComponent, ExecutionContext } from '../types';
3
- export default function withTheme<T extends AnyComponent>(Component: T): React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<T, ExecutionContext>> & React.RefAttributes<T>> & { [key in Exclude<keyof T, T extends React.MemoExoticComponent<any> ? "propTypes" | "defaultProps" | "displayName" | "$$typeof" | "type" | "compare" : T extends React.ForwardRefExoticComponent<any> ? "propTypes" | "defaultProps" | "displayName" | "$$typeof" | "render" : "length" | "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "defaultProps" | "displayName" | "getDerivedStateFromProps" | "getDerivedStateFromError" | "type" | "getDefaultProps" | "mixins" | "name" | "prototype" | "caller" | "callee" | "arguments" | "arity">]: T[key]; };
2
+ import { AnyComponent, ExecutionProps } from '../types';
3
+ export default function withTheme<T extends AnyComponent>(Component: T): React.ForwardRefExoticComponent<React.PropsWithoutRef<JSX.LibraryManagedAttributes<T, ExecutionProps>> & React.RefAttributes<T>> & { [key in Exclude<keyof T, T extends React.MemoExoticComponent<any> ? "propTypes" | "defaultProps" | "displayName" | "$$typeof" | "type" | "compare" : T extends React.ForwardRefExoticComponent<any> ? "propTypes" | "defaultProps" | "displayName" | "$$typeof" | "render" : "length" | "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "defaultProps" | "displayName" | "getDerivedStateFromProps" | "getDerivedStateFromError" | "type" | "getDefaultProps" | "mixins" | "name" | "prototype" | "caller" | "callee" | "arguments" | "arity">]: T[key]; };
@@ -1,4 +1,4 @@
1
1
  import styled from './constructors/styled';
2
2
  export * from './base';
3
- export { CSSProp, IStyledComponent, IStyledComponentFactory, IStyledStatics, StyledOptions, WebTarget, } from './types';
4
- export { styled as default };
3
+ export { CSSProp, DefaultTheme, ExecutionContext, ExecutionProps, IStyledComponent, IStyledComponentFactory, IStyledStatics, PolymorphicComponent, PolymorphicComponentProps, Runtime, StyledObject, StyledOptions, WebTarget, } from './types';
4
+ export { styled, styled as default };
@@ -1,6 +1,6 @@
1
1
  import StyleSheet from '../sheet';
2
2
  import { ExecutionContext, FlattenerResult, RuleSet, Stringifier } from '../types';
3
- export default class GlobalStyle<Props = unknown> {
3
+ export default class GlobalStyle<Props extends object> {
4
4
  componentId: string;
5
5
  isStatic: boolean;
6
6
  rules: FlattenerResult<Props>;
@@ -3,4 +3,4 @@ export declare const resetStyleCache: () => void;
3
3
  /**
4
4
  * InlineStyle takes arbitrary CSS and generates a flat object
5
5
  */
6
- export default function makeInlineStyleClass<Props = unknown>(styleSheet: StyleSheet): IInlineStyleConstructor<Props>;
6
+ export default function makeInlineStyleClass<Props extends object>(styleSheet: StyleSheet): IInlineStyleConstructor<Props>;
@@ -1,21 +1,65 @@
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;
6
- disableCSSOMInjection?: boolean;
7
- disableVendorPrefixes?: boolean;
8
- sheet?: StyleSheet;
9
- stylisPlugins?: stylis.Middleware[];
10
- target?: HTMLElement;
3
+ import { ShouldForwardProp, Stringifier } from '../types';
4
+ export declare type IStyleSheetContext = {
5
+ shouldForwardProp?: ShouldForwardProp<'web'>;
6
+ styleSheet?: StyleSheet;
11
7
  };
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>;
8
+ export declare const StyleSheetContext: React.Context<IStyleSheetContext>;
9
+ export declare const StyleSheetConsumer: React.Consumer<IStyleSheetContext>;
10
+ export declare type IStylisContext = Stringifier | void;
11
+ export declare const StylisContext: React.Context<IStylisContext>;
12
+ export declare const StylisConsumer: React.Consumer<IStylisContext>;
16
13
  export declare const mainSheet: StyleSheet;
17
14
  export declare const mainStylis: Stringifier;
15
+ export declare function useShouldForwardProp(): ShouldForwardProp<"web"> | undefined;
18
16
  export declare function useStyleSheet(): StyleSheet;
19
17
  export declare function useStylis(): Stringifier;
20
- export default function StyleSheetManager(props: Props): JSX.Element;
21
- export {};
18
+ export declare type IStyleSheetManager = React.PropsWithChildren<{
19
+ /**
20
+ * If desired, you can pass this prop to disable "speedy" insertion mode, which
21
+ * uses the browser [CSSOM APIs](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet).
22
+ * When disabled, rules are inserted as simple text into style blocks.
23
+ */
24
+ disableCSSOMInjection?: boolean;
25
+ /**
26
+ * If you are working exclusively with modern browsers, vendor prefixes can often be omitted
27
+ * to reduce the weight of CSS on the page.
28
+ */
29
+ disableVendorPrefixes?: boolean;
30
+ /**
31
+ * Provide an optional selector to be prepended to all generated style rules.
32
+ */
33
+ namespace?: string;
34
+ /**
35
+ * Create and provide your own `StyleSheet` if necessary for advanced SSR scenarios.
36
+ */
37
+ sheet?: StyleSheet;
38
+ /**
39
+ * Starting in v6, styled-components no longer does its own prop validation
40
+ * and recommends use of transient props "$prop" to pass style-only props to
41
+ * components. If for some reason you are not able to use transient props, a
42
+ * prop validation function can be provided via `StyleSheetManager`, such as
43
+ * `@emotion/is-prop-valid`.
44
+ *
45
+ * When the return value is `true`, props will be forwarded to the DOM/underlying
46
+ * component. If return value is `false`, the prop will be discarded after styles
47
+ * are calculated.
48
+ *
49
+ * Manually composing `styled.{element}.withConfig({shouldForwardProp})` will
50
+ * override this default.
51
+ */
52
+ shouldForwardProp?: IStyleSheetContext['shouldForwardProp'];
53
+ /**
54
+ * An array of plugins to be run by stylis (style processor) during compilation.
55
+ * Check out [what's available on npm*](https://www.npmjs.com/search?q=keywords%3Astylis).
56
+ *
57
+ * \* The plugin(s) must be compatible with stylis v4 or above.
58
+ */
59
+ stylisPlugins?: stylis.Middleware[];
60
+ /**
61
+ * Provide an alternate DOM node to host generated styles; useful for iframes.
62
+ */
63
+ target?: HTMLElement;
64
+ }>;
65
+ 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;
@@ -27,7 +27,7 @@ export interface DefaultTheme {
27
27
  declare type ThemeFn = (outerTheme?: DefaultTheme) => DefaultTheme;
28
28
  declare type ThemeArgument = DefaultTheme | ThemeFn;
29
29
  declare type Props = {
30
- children?: React.ReactChild;
30
+ children?: React.ReactNode;
31
31
  theme: ThemeArgument;
32
32
  };
33
33
  export declare const ThemeContext: React.Context<DefaultTheme | undefined>;
@@ -6,36 +6,32 @@ import useTheme from '../hooks/useTheme';
6
6
  import ThemeProvider, { ThemeConsumer, ThemeContext } from '../models/ThemeProvider';
7
7
  import { NativeTarget } from '../types';
8
8
  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>;
9
+ declare const styled: (<Target extends NativeTarget>(tag: Target) => Styled<"native", Target, Target extends import("../types").KnownTarget ? React.ComponentPropsWithRef<Target> : object, object, object>) & {
10
+ ActivityIndicator: Styled<"native", typeof import("react-native").ActivityIndicator, object, object, object>;
11
+ Button: Styled<"native", typeof import("react-native").Button, object, object, object>;
12
+ DatePickerIOS: Styled<"native", typeof import("react-native").DatePickerIOS, object, object, object>;
13
+ DrawerLayoutAndroid: Styled<"native", typeof import("react-native").DrawerLayoutAndroid, object, object, object>;
14
+ FlatList: Styled<"native", typeof import("react-native").FlatList, object, object, object>;
15
+ Image: Styled<"native", typeof import("react-native").Image, object, object, object>;
16
+ ImageBackground: Styled<"native", typeof import("react-native").ImageBackground, object, object, object>;
17
+ KeyboardAvoidingView: Styled<"native", typeof import("react-native").KeyboardAvoidingView, object, object, object>;
18
+ Modal: Styled<"native", typeof import("react-native").Modal, object, object, object>;
19
+ Pressable: Styled<"native", import("react").ForwardRefExoticComponent<import("react-native").PressableProps & import("react").RefAttributes<import("react-native").View>>, object, object, object>;
20
+ ProgressBarAndroid: Styled<"native", typeof import("react-native").ProgressBarAndroid, object, object, object>;
21
+ ProgressViewIOS: Styled<"native", typeof import("react-native").ProgressViewIOS, object, object, object>;
22
+ RefreshControl: Styled<"native", typeof import("react-native").RefreshControl, object, object, object>;
23
+ SafeAreaView: Styled<"native", typeof import("react-native").SafeAreaView, object, object, object>;
24
+ ScrollView: Styled<"native", typeof import("react-native").ScrollView, object, object, object>;
25
+ SectionList: Styled<"native", typeof import("react-native").SectionList, object, object, object>;
26
+ Slider: Styled<"native", typeof import("react-native").Slider, object, object, object>;
27
+ Switch: Styled<"native", typeof import("react-native").Switch, object, object, object>;
28
+ Text: Styled<"native", typeof import("react-native").Text, object, object, object>;
29
+ TextInput: Styled<"native", typeof import("react-native").TextInput, object, object, object>;
30
+ TouchableHighlight: Styled<"native", typeof import("react-native").TouchableHighlight, object, object, object>;
31
+ TouchableOpacity: Styled<"native", typeof import("react-native").TouchableOpacity, object, object, object>;
32
+ View: Styled<"native", typeof import("react-native").View, object, object, object>;
33
+ VirtualizedList: Styled<"native", typeof import("react-native").VirtualizedList, object, object, object>;
38
34
  };
39
- export { IStyledComponent, IStyledComponentFactory, IStyledStatics, NativeTarget, StyledOptions, } from '../types';
35
+ export { DefaultTheme, ExecutionContext, ExecutionProps, IStyledComponent, IStyledComponentFactory, IStyledStatics, NativeTarget, PolymorphicComponent, PolymorphicComponentProps, Runtime, StyledObject, StyledOptions, } from '../types';
40
36
  export { css, isStyledComponent, ThemeProvider, ThemeConsumer, ThemeContext, withTheme, useTheme };
41
- export default styled;
37
+ export { styled, styled as default };
@@ -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.7";
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 !== 'undefined' && typeof process.env !== '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 && process.env.NODE_ENV !== 'production'); // Shared empty execution context when generating static styles
161
161
 
162
162
  //
163
163
  var EMPTY_ARRAY = Object.freeze([]);
@@ -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);