styled-components 6.0.0-beta.6 → 6.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/base.d.ts +2 -2
  2. package/dist/index.d.ts +1 -1
  3. package/dist/models/StyleSheetManager.d.ts +38 -13
  4. package/dist/models/ThemeProvider.d.ts +1 -1
  5. package/dist/native/index.d.ts +1 -1
  6. package/dist/styled-components.browser.cjs.js +15 -13
  7. package/dist/styled-components.browser.cjs.js.map +1 -1
  8. package/dist/styled-components.browser.esm.js +17 -16
  9. package/dist/styled-components.browser.esm.js.map +1 -1
  10. package/dist/styled-components.cjs.js +15 -13
  11. package/dist/styled-components.cjs.js.map +1 -1
  12. package/dist/styled-components.esm.js +17 -16
  13. package/dist/styled-components.esm.js.map +1 -1
  14. package/dist/styled-components.js +15 -109
  15. package/dist/styled-components.js.map +1 -1
  16. package/dist/styled-components.min.js +1 -1
  17. package/dist/styled-components.min.js.map +1 -1
  18. package/dist/tsconfig.tsbuildinfo +1 -1
  19. package/dist/types.d.ts +0 -2
  20. package/dist/utils/stylis.d.ts +3 -3
  21. package/native/dist/base.d.ts +2 -2
  22. package/native/dist/index.d.ts +1 -1
  23. package/native/dist/models/StyleSheetManager.d.ts +38 -13
  24. package/native/dist/models/ThemeProvider.d.ts +1 -1
  25. package/native/dist/native/index.d.ts +1 -1
  26. package/native/dist/styled-components.native.cjs.js +13 -8
  27. package/native/dist/styled-components.native.cjs.js.map +1 -1
  28. package/native/dist/styled-components.native.esm.js +13 -9
  29. package/native/dist/styled-components.native.esm.js.map +1 -1
  30. package/native/dist/types.d.ts +0 -2
  31. package/native/dist/utils/stylis.d.ts +3 -3
  32. package/package.json +31 -32
  33. package/native/dist/base.d.ts.map +0 -1
  34. package/native/dist/constants.d.ts.map +0 -1
  35. package/native/dist/constructors/constructWithOptions.d.ts.map +0 -1
  36. package/native/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  37. package/native/dist/constructors/css.d.ts.map +0 -1
  38. package/native/dist/constructors/keyframes.d.ts.map +0 -1
  39. package/native/dist/constructors/styled.d.ts.map +0 -1
  40. package/native/dist/dist/base.d.ts +0 -18
  41. package/native/dist/dist/base.d.ts.map +0 -1
  42. package/native/dist/dist/constants.d.ts +0 -9
  43. package/native/dist/dist/constants.d.ts.map +0 -1
  44. package/native/dist/dist/constructors/constructWithOptions.d.ts +0 -20
  45. package/native/dist/dist/constructors/constructWithOptions.d.ts.map +0 -1
  46. package/native/dist/dist/constructors/createGlobalStyle.d.ts +0 -4
  47. package/native/dist/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  48. package/native/dist/dist/constructors/css.d.ts +0 -5
  49. package/native/dist/dist/constructors/css.d.ts.map +0 -1
  50. package/native/dist/dist/constructors/keyframes.d.ts +0 -4
  51. package/native/dist/dist/constructors/keyframes.d.ts.map +0 -1
  52. package/native/dist/dist/constructors/styled.d.ts +0 -186
  53. package/native/dist/dist/constructors/styled.d.ts.map +0 -1
  54. package/native/dist/dist/hoc/withTheme.d.ts +0 -4
  55. package/native/dist/dist/hoc/withTheme.d.ts.map +0 -1
  56. package/native/dist/dist/hoc/withTheme.spec.d.ts +0 -2
  57. package/native/dist/dist/hoc/withTheme.spec.d.ts.map +0 -1
  58. package/native/dist/dist/hooks/useTheme.d.ts +0 -4
  59. package/native/dist/dist/hooks/useTheme.d.ts.map +0 -1
  60. package/native/dist/dist/index-standalone.d.ts +0 -3
  61. package/native/dist/dist/index-standalone.d.ts.map +0 -1
  62. package/native/dist/dist/index.d.ts +0 -4
  63. package/native/dist/dist/index.d.ts.map +0 -1
  64. package/native/dist/dist/macro/index.d.ts +0 -3
  65. package/native/dist/dist/macro/index.d.ts.map +0 -1
  66. package/native/dist/dist/macro/test/babel.config.d.ts +0 -1
  67. package/native/dist/dist/macro/test/babel.config.d.ts.map +0 -1
  68. package/native/dist/dist/models/ComponentStyle.d.ts +0 -16
  69. package/native/dist/dist/models/ComponentStyle.d.ts.map +0 -1
  70. package/native/dist/dist/models/GlobalStyle.d.ts +0 -12
  71. package/native/dist/dist/models/GlobalStyle.d.ts.map +0 -1
  72. package/native/dist/dist/models/InlineStyle.d.ts +0 -7
  73. package/native/dist/dist/models/InlineStyle.d.ts.map +0 -1
  74. package/native/dist/dist/models/Keyframes.d.ts +0 -12
  75. package/native/dist/dist/models/Keyframes.d.ts.map +0 -1
  76. package/native/dist/dist/models/ServerStyleSheet.d.ts +0 -16
  77. package/native/dist/dist/models/ServerStyleSheet.d.ts.map +0 -1
  78. package/native/dist/dist/models/StyleSheetManager.d.ts +0 -22
  79. package/native/dist/dist/models/StyleSheetManager.d.ts.map +0 -1
  80. package/native/dist/dist/models/StyledComponent.d.ts +0 -4
  81. package/native/dist/dist/models/StyledComponent.d.ts.map +0 -1
  82. package/native/dist/dist/models/StyledNativeComponent.d.ts +0 -4
  83. package/native/dist/dist/models/StyledNativeComponent.d.ts.map +0 -1
  84. package/native/dist/dist/models/ThemeProvider.d.ts +0 -18
  85. package/native/dist/dist/models/ThemeProvider.d.ts.map +0 -1
  86. package/native/dist/dist/native/index.d.ts +0 -65
  87. package/native/dist/dist/native/index.d.ts.map +0 -1
  88. package/native/dist/dist/primitives/index.d.ts +0 -23
  89. package/native/dist/dist/primitives/index.d.ts.map +0 -1
  90. package/native/dist/dist/secretInternals.d.ts +0 -6
  91. package/native/dist/dist/secretInternals.d.ts.map +0 -1
  92. package/native/dist/dist/sheet/GroupIDAllocator.d.ts +0 -5
  93. package/native/dist/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  94. package/native/dist/dist/sheet/GroupedTag.d.ts +0 -12
  95. package/native/dist/dist/sheet/GroupedTag.d.ts.map +0 -1
  96. package/native/dist/dist/sheet/Rehydration.d.ts +0 -4
  97. package/native/dist/dist/sheet/Rehydration.d.ts.map +0 -1
  98. package/native/dist/dist/sheet/Sheet.d.ts +0 -41
  99. package/native/dist/dist/sheet/Sheet.d.ts.map +0 -1
  100. package/native/dist/dist/sheet/Tag.d.ts +0 -55
  101. package/native/dist/dist/sheet/Tag.d.ts.map +0 -1
  102. package/native/dist/dist/sheet/dom.d.ts +0 -5
  103. package/native/dist/dist/sheet/dom.d.ts.map +0 -1
  104. package/native/dist/dist/sheet/index.d.ts +0 -2
  105. package/native/dist/dist/sheet/index.d.ts.map +0 -1
  106. package/native/dist/dist/sheet/types.d.ts +0 -35
  107. package/native/dist/dist/sheet/types.d.ts.map +0 -1
  108. package/native/dist/dist/test/globals.d.ts +0 -3
  109. package/native/dist/dist/test/globals.d.ts.map +0 -1
  110. package/native/dist/dist/test/utils.d.ts +0 -192
  111. package/native/dist/dist/test/utils.d.ts.map +0 -1
  112. package/native/dist/dist/types.d.ts +0 -121
  113. package/native/dist/dist/types.d.ts.map +0 -1
  114. package/native/dist/dist/utils/addUnitIfNeeded.d.ts +0 -2
  115. package/native/dist/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  116. package/native/dist/dist/utils/checkDynamicCreation.d.ts +0 -2
  117. package/native/dist/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  118. package/native/dist/dist/utils/createWarnTooManyClasses.d.ts +0 -4
  119. package/native/dist/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  120. package/native/dist/dist/utils/determineTheme.d.ts +0 -3
  121. package/native/dist/dist/utils/determineTheme.d.ts.map +0 -1
  122. package/native/dist/dist/utils/domElements.d.ts +0 -3
  123. package/native/dist/dist/utils/domElements.d.ts.map +0 -1
  124. package/native/dist/dist/utils/empties.d.ts +0 -4
  125. package/native/dist/dist/utils/empties.d.ts.map +0 -1
  126. package/native/dist/dist/utils/error.d.ts +0 -6
  127. package/native/dist/dist/utils/error.d.ts.map +0 -1
  128. package/native/dist/dist/utils/errors.d.ts +0 -21
  129. package/native/dist/dist/utils/errors.d.ts.map +0 -1
  130. package/native/dist/dist/utils/escape.d.ts +0 -6
  131. package/native/dist/dist/utils/escape.d.ts.map +0 -1
  132. package/native/dist/dist/utils/flatten.d.ts +0 -5
  133. package/native/dist/dist/utils/flatten.d.ts.map +0 -1
  134. package/native/dist/dist/utils/generateAlphabeticName.d.ts +0 -2
  135. package/native/dist/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  136. package/native/dist/dist/utils/generateComponentId.d.ts +0 -2
  137. package/native/dist/dist/utils/generateComponentId.d.ts.map +0 -1
  138. package/native/dist/dist/utils/generateDisplayName.d.ts +0 -3
  139. package/native/dist/dist/utils/generateDisplayName.d.ts.map +0 -1
  140. package/native/dist/dist/utils/getComponentName.d.ts +0 -3
  141. package/native/dist/dist/utils/getComponentName.d.ts.map +0 -1
  142. package/native/dist/dist/utils/hash.d.ts +0 -4
  143. package/native/dist/dist/utils/hash.d.ts.map +0 -1
  144. package/native/dist/dist/utils/hoist.d.ts +0 -52
  145. package/native/dist/dist/utils/hoist.d.ts.map +0 -1
  146. package/native/dist/dist/utils/hyphenateStyleName.d.ts +0 -15
  147. package/native/dist/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  148. package/native/dist/dist/utils/interleave.d.ts +0 -3
  149. package/native/dist/dist/utils/interleave.d.ts.map +0 -1
  150. package/native/dist/dist/utils/isFunction.d.ts +0 -2
  151. package/native/dist/dist/utils/isFunction.d.ts.map +0 -1
  152. package/native/dist/dist/utils/isPlainObject.d.ts +0 -2
  153. package/native/dist/dist/utils/isPlainObject.d.ts.map +0 -1
  154. package/native/dist/dist/utils/isStatelessFunction.d.ts +0 -2
  155. package/native/dist/dist/utils/isStatelessFunction.d.ts.map +0 -1
  156. package/native/dist/dist/utils/isStaticRules.d.ts +0 -3
  157. package/native/dist/dist/utils/isStaticRules.d.ts.map +0 -1
  158. package/native/dist/dist/utils/isStyledComponent.d.ts +0 -3
  159. package/native/dist/dist/utils/isStyledComponent.d.ts.map +0 -1
  160. package/native/dist/dist/utils/isTag.d.ts +0 -3
  161. package/native/dist/dist/utils/isTag.d.ts.map +0 -1
  162. package/native/dist/dist/utils/joinStrings.d.ts +0 -5
  163. package/native/dist/dist/utils/joinStrings.d.ts.map +0 -1
  164. package/native/dist/dist/utils/mixinDeep.d.ts +0 -8
  165. package/native/dist/dist/utils/mixinDeep.d.ts.map +0 -1
  166. package/native/dist/dist/utils/nonce.d.ts +0 -2
  167. package/native/dist/dist/utils/nonce.d.ts.map +0 -1
  168. package/native/dist/dist/utils/stylis.d.ts +0 -10
  169. package/native/dist/dist/utils/stylis.d.ts.map +0 -1
  170. package/native/dist/hoc/withTheme.d.ts.map +0 -1
  171. package/native/dist/hoc/withTheme.spec.d.ts.map +0 -1
  172. package/native/dist/hooks/useTheme.d.ts.map +0 -1
  173. package/native/dist/index-standalone.d.ts.map +0 -1
  174. package/native/dist/index.d.ts.map +0 -1
  175. package/native/dist/macro/index.d.ts.map +0 -1
  176. package/native/dist/macro/test/babel.config.d.ts +0 -1
  177. package/native/dist/macro/test/babel.config.d.ts.map +0 -1
  178. package/native/dist/models/ComponentStyle.d.ts.map +0 -1
  179. package/native/dist/models/GlobalStyle.d.ts.map +0 -1
  180. package/native/dist/models/InlineStyle.d.ts.map +0 -1
  181. package/native/dist/models/Keyframes.d.ts.map +0 -1
  182. package/native/dist/models/ServerStyleSheet.d.ts.map +0 -1
  183. package/native/dist/models/StyleSheetManager.d.ts.map +0 -1
  184. package/native/dist/models/StyledComponent.d.ts.map +0 -1
  185. package/native/dist/models/StyledNativeComponent.d.ts.map +0 -1
  186. package/native/dist/models/ThemeProvider.d.ts.map +0 -1
  187. package/native/dist/native/index.d.ts.map +0 -1
  188. package/native/dist/primitives/index.d.ts +0 -23
  189. package/native/dist/primitives/index.d.ts.map +0 -1
  190. package/native/dist/secretInternals.d.ts.map +0 -1
  191. package/native/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  192. package/native/dist/sheet/GroupedTag.d.ts.map +0 -1
  193. package/native/dist/sheet/Rehydration.d.ts.map +0 -1
  194. package/native/dist/sheet/Sheet.d.ts.map +0 -1
  195. package/native/dist/sheet/Tag.d.ts.map +0 -1
  196. package/native/dist/sheet/dom.d.ts.map +0 -1
  197. package/native/dist/sheet/index.d.ts.map +0 -1
  198. package/native/dist/sheet/types.d.ts.map +0 -1
  199. package/native/dist/test/globals.d.ts.map +0 -1
  200. package/native/dist/test/utils.d.ts.map +0 -1
  201. package/native/dist/types.d.ts.map +0 -1
  202. package/native/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  203. package/native/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  204. package/native/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  205. package/native/dist/utils/determineTheme.d.ts.map +0 -1
  206. package/native/dist/utils/domElements.d.ts.map +0 -1
  207. package/native/dist/utils/empties.d.ts.map +0 -1
  208. package/native/dist/utils/error.d.ts.map +0 -1
  209. package/native/dist/utils/errors.d.ts.map +0 -1
  210. package/native/dist/utils/escape.d.ts.map +0 -1
  211. package/native/dist/utils/flatten.d.ts.map +0 -1
  212. package/native/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  213. package/native/dist/utils/generateComponentId.d.ts.map +0 -1
  214. package/native/dist/utils/generateDisplayName.d.ts.map +0 -1
  215. package/native/dist/utils/getComponentName.d.ts.map +0 -1
  216. package/native/dist/utils/hash.d.ts.map +0 -1
  217. package/native/dist/utils/hoist.d.ts.map +0 -1
  218. package/native/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  219. package/native/dist/utils/interleave.d.ts.map +0 -1
  220. package/native/dist/utils/isFunction.d.ts.map +0 -1
  221. package/native/dist/utils/isPlainObject.d.ts.map +0 -1
  222. package/native/dist/utils/isStatelessFunction.d.ts.map +0 -1
  223. package/native/dist/utils/isStaticRules.d.ts.map +0 -1
  224. package/native/dist/utils/isStyledComponent.d.ts.map +0 -1
  225. package/native/dist/utils/isTag.d.ts.map +0 -1
  226. package/native/dist/utils/joinStrings.d.ts.map +0 -1
  227. package/native/dist/utils/mixinDeep.d.ts.map +0 -1
  228. package/native/dist/utils/nonce.d.ts.map +0 -1
  229. package/native/dist/utils/stylis.d.ts.map +0 -1
package/dist/base.d.ts CHANGED
@@ -5,7 +5,7 @@ import keyframes from './constructors/keyframes';
5
5
  import withTheme from './hoc/withTheme';
6
6
  import useTheme from './hooks/useTheme';
7
7
  import ServerStyleSheet from './models/ServerStyleSheet';
8
- import StyleSheetManager, { StyleSheetConsumer, StyleSheetContext } from './models/StyleSheetManager';
8
+ import { IStyleSheetContext, IStyleSheetManager, IStylisContext, StyleSheetConsumer, StyleSheetContext, StyleSheetManager } from './models/StyleSheetManager';
9
9
  import ThemeProvider, { ThemeConsumer, ThemeContext } from './models/ThemeProvider';
10
10
  import isStyledComponent from './utils/isStyledComponent';
11
11
  declare global {
@@ -15,4 +15,4 @@ declare global {
15
15
  }
16
16
  export * from './secretInternals';
17
17
  export { AttrsArg as Attrs, DefaultTheme, ShouldForwardProp } from './types';
18
- export { createGlobalStyle, css, isStyledComponent, keyframes, ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, useTheme, SC_VERSION as version, withTheme, };
18
+ export { createGlobalStyle, css, isStyledComponent, IStyleSheetManager, IStyleSheetContext, IStylisContext, keyframes, ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, useTheme, SC_VERSION as version, withTheme, };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import styled from './constructors/styled';
2
2
  export * from './base';
3
3
  export { CSSProp, DefaultTheme, ExecutionContext, ExecutionProps, IStyledComponent, IStyledComponentFactory, IStyledStatics, PolymorphicComponent, PolymorphicComponentProps, Runtime, StyledObject, StyledOptions, WebTarget, } from './types';
4
- export { styled as default };
4
+ export { styled, styled as default };
@@ -1,21 +1,46 @@
1
1
  import React from 'react';
2
2
  import StyleSheet from '../sheet';
3
3
  import { Stringifier } from '../types';
4
- declare type Props = {
5
- children?: React.ReactChild;
4
+ export declare type IStyleSheetContext = StyleSheet | void;
5
+ export declare const StyleSheetContext: React.Context<IStyleSheetContext>;
6
+ export declare const StyleSheetConsumer: React.Consumer<IStyleSheetContext>;
7
+ export declare type IStylisContext = Stringifier | void;
8
+ export declare const StylisContext: React.Context<IStylisContext>;
9
+ export declare const StylisConsumer: React.Consumer<IStylisContext>;
10
+ export declare const mainSheet: StyleSheet;
11
+ export declare const mainStylis: Stringifier;
12
+ export declare function useStyleSheet(): StyleSheet;
13
+ export declare function useStylis(): Stringifier;
14
+ export declare type IStyleSheetManager = React.PropsWithChildren<{
15
+ /**
16
+ * If desired, you can pass this prop to disable "speedy" insertion mode, which
17
+ * uses the browser [CSSOM APIs](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet).
18
+ * When disabled, rules are inserted as simple text into style blocks.
19
+ */
6
20
  disableCSSOMInjection?: boolean;
21
+ /**
22
+ * If you are working exclusively with modern browsers, vendor prefixes can often be omitted
23
+ * to reduce the weight of CSS on the page.
24
+ */
7
25
  disableVendorPrefixes?: boolean;
26
+ /**
27
+ * Provide an optional selector to be prepended to all generated style rules.
28
+ */
29
+ namespace?: string;
30
+ /**
31
+ * Create and provide your own `StyleSheet` if necessary for advanced SSR scenarios.
32
+ */
8
33
  sheet?: StyleSheet;
34
+ /**
35
+ * An array of plugins to be run by stylis (style processor) during compilation.
36
+ * Check out [what's available on npm*](https://www.npmjs.com/search?q=keywords%3Astylis).
37
+ *
38
+ * \* The plugin(s) must be compatible with stylis v4 or above.
39
+ */
9
40
  stylisPlugins?: stylis.Middleware[];
41
+ /**
42
+ * Provide an alternate DOM node to host generated styles; useful for iframes.
43
+ */
10
44
  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 {};
45
+ }>;
46
+ export declare function StyleSheetManager(props: IStyleSheetManager): JSX.Element;
@@ -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>;
@@ -34,4 +34,4 @@ declare const styled: (<Target extends NativeTarget>(tag: Target) => Styled<"nat
34
34
  };
35
35
  export { DefaultTheme, ExecutionContext, ExecutionProps, IStyledComponent, IStyledComponentFactory, IStyledStatics, NativeTarget, PolymorphicComponent, PolymorphicComponentProps, Runtime, StyledObject, StyledOptions, } from '../types';
36
36
  export { css, isStyledComponent, ThemeProvider, ThemeConsumer, ThemeContext, withTheme, useTheme };
37
- export default styled;
37
+ export { styled, styled as default };
@@ -18,7 +18,7 @@ var SC_ATTR = (typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR
18
18
  'data-styled';
19
19
  var SC_ATTR_ACTIVE = 'active';
20
20
  var SC_ATTR_VERSION = 'data-styled-version';
21
- var SC_VERSION = "6.0.0-beta.6";
21
+ var SC_VERSION = "6.0.0-beta.8";
22
22
  var SPLITTER = '/*!sc*/\n';
23
23
  var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
24
24
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
@@ -1026,7 +1026,11 @@ function createStylisInstance(_a) {
1026
1026
  props[0] = props[0].replace(_selectorRegexp, selfReferenceReplacer);
1027
1027
  }
1028
1028
  };
1029
- var stringifyRules = function (css, selector, prefix, componentId) {
1029
+ var stringifyRules = function (css, selector,
1030
+ /**
1031
+ * This "prefix" referes to a _selector_ prefix.
1032
+ */
1033
+ prefix, componentId) {
1030
1034
  if (selector === void 0) { selector = ''; }
1031
1035
  if (prefix === void 0) { prefix = ''; }
1032
1036
  if (componentId === void 0) { componentId = '&'; }
@@ -1039,11 +1043,16 @@ function createStylisInstance(_a) {
1039
1043
  _selectorRegexp = new RegExp("\\".concat(_selector, "\\b"), 'g');
1040
1044
  _consecutiveSelfRefRegExp = new RegExp("(\\".concat(_selector, "\\b){2,}"));
1041
1045
  var middlewares = plugins.slice();
1046
+ /**
1047
+ * Enables automatic vendor-prefixing for styles.
1048
+ */
1042
1049
  if (options.prefix || options.prefix === undefined) {
1043
1050
  middlewares.unshift(stylis.prefixer);
1044
1051
  }
1045
1052
  middlewares.push(selfReferenceReplacementPlugin, stylis.stringify);
1046
- return serialize(stylis.compile(prefix || selector ? "".concat(prefix, " ").concat(selector, " { ").concat(flatCSS, " }") : flatCSS), stylis.middleware(middlewares));
1053
+ return serialize(stylis.compile(options.namespace || prefix || selector
1054
+ ? "".concat(options.namespace ? options.namespace + ' ' : '').concat(prefix, " ").concat(selector, " { ").concat(flatCSS, " }")
1055
+ : flatCSS), stylis.middleware(middlewares));
1047
1056
  };
1048
1057
  stringifyRules.hash = plugins.length
1049
1058
  ? plugins
@@ -1089,10 +1098,10 @@ function StyleSheetManager(props) {
1089
1098
  }, [props.disableCSSOMInjection, props.sheet, props.target]);
1090
1099
  var stylis = React.useMemo(function () {
1091
1100
  return createStylisInstance({
1092
- options: { prefix: !props.disableVendorPrefixes },
1101
+ options: { namespace: props.namespace, prefix: !props.disableVendorPrefixes },
1093
1102
  plugins: plugins,
1094
1103
  });
1095
- }, [props.disableVendorPrefixes, plugins]);
1104
+ }, [props.disableVendorPrefixes, props.namespace, plugins]);
1096
1105
  React.useEffect(function () {
1097
1106
  if (!shallowequal__default["default"](plugins, props.stylisPlugins))
1098
1107
  setPlugins(props.stylisPlugins);
@@ -1504,13 +1513,6 @@ function createStyledComponent(target, options, rules) {
1504
1513
  WrappedStyledComponent.styledComponentId = styledComponentId;
1505
1514
  // fold the underlying StyledComponent target up since we folded the styles
1506
1515
  WrappedStyledComponent.target = isTargetStyledComp ? styledComponentTarget.target : target;
1507
- WrappedStyledComponent.withComponent = function withComponent(tag) {
1508
- var previousComponentId = options.componentId, optionsToCopy = tslib.__rest(options, ["componentId"]);
1509
- var newComponentId = previousComponentId &&
1510
- "".concat(previousComponentId, "-").concat(isTag(tag) ? tag : escape(getComponentName(tag)));
1511
- var newOptions = tslib.__assign(tslib.__assign({}, optionsToCopy), { attrs: finalAttrs, componentId: newComponentId });
1512
- return createStyledComponent(tag, newOptions, rules);
1513
- };
1514
1516
  Object.defineProperty(WrappedStyledComponent, 'defaultProps', {
1515
1517
  get: function () {
1516
1518
  return this._foldedDefaultProps;
@@ -1537,7 +1539,6 @@ function createStyledComponent(target, options, rules) {
1537
1539
  shouldForwardProp: true,
1538
1540
  styledComponentId: true,
1539
1541
  target: true,
1540
- withComponent: true,
1541
1542
  });
1542
1543
  }
1543
1544
  return WrappedStyledComponent;
@@ -1837,6 +1838,7 @@ exports.css = css;
1837
1838
  exports["default"] = styled;
1838
1839
  exports.isStyledComponent = isStyledComponent;
1839
1840
  exports.keyframes = keyframes;
1841
+ exports.styled = styled;
1840
1842
  exports.useTheme = useTheme;
1841
1843
  exports.version = SC_VERSION;
1842
1844
  exports.withTheme = withTheme;