styled-components 6.0.0-beta.5 → 6.0.0-beta.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 (38) hide show
  1. package/dist/base.d.ts +2 -2
  2. package/dist/constructors/constructWithOptions.d.ts +2 -2
  3. package/dist/constructors/styled.d.ts +1 -1
  4. package/dist/index.d.ts +2 -2
  5. package/dist/models/StyleSheetManager.d.ts +38 -13
  6. package/dist/native/index.d.ts +27 -27
  7. package/dist/styled-components-macro.cjs.js +2 -7
  8. package/dist/styled-components-macro.cjs.js.map +1 -1
  9. package/dist/styled-components.browser.cjs.js +36 -40
  10. package/dist/styled-components.browser.cjs.js.map +1 -1
  11. package/dist/styled-components.browser.esm.js +17 -16
  12. package/dist/styled-components.browser.esm.js.map +1 -1
  13. package/dist/styled-components.cjs.js +35 -39
  14. package/dist/styled-components.cjs.js.map +1 -1
  15. package/dist/styled-components.esm.js +17 -16
  16. package/dist/styled-components.esm.js.map +1 -1
  17. package/dist/styled-components.js +33 -131
  18. package/dist/styled-components.js.map +1 -1
  19. package/dist/styled-components.min.js +1 -1
  20. package/dist/styled-components.min.js.map +1 -1
  21. package/dist/test/utils.d.ts +1 -1
  22. package/dist/tsconfig.tsbuildinfo +1 -1
  23. package/dist/types.d.ts +15 -5
  24. package/dist/utils/stylis.d.ts +3 -3
  25. package/native/dist/base.d.ts +2 -2
  26. package/native/dist/constructors/constructWithOptions.d.ts +2 -2
  27. package/native/dist/constructors/styled.d.ts +1 -1
  28. package/native/dist/index.d.ts +2 -2
  29. package/native/dist/models/StyleSheetManager.d.ts +38 -13
  30. package/native/dist/native/index.d.ts +27 -27
  31. package/native/dist/styled-components.native.cjs.js +24 -25
  32. package/native/dist/styled-components.native.cjs.js.map +1 -1
  33. package/native/dist/styled-components.native.esm.js +13 -9
  34. package/native/dist/styled-components.native.esm.js.map +1 -1
  35. package/native/dist/test/utils.d.ts +1 -1
  36. package/native/dist/types.d.ts +15 -5
  37. package/native/dist/utils/stylis.d.ts +3 -3
  38. package/package.json +32 -33
@@ -69,7 +69,7 @@ var SC_ATTR = (typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR
69
69
  'data-styled';
70
70
  var SC_ATTR_ACTIVE = 'active';
71
71
  var SC_ATTR_VERSION = 'data-styled-version';
72
- var SC_VERSION = "6.0.0-beta.5";
72
+ var SC_VERSION = "6.0.0-beta.7";
73
73
  var SPLITTER = '/*!sc*/\n';
74
74
  var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
75
75
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
@@ -572,7 +572,11 @@ function createStylisInstance(_a) {
572
572
  props[0] = props[0].replace(_selectorRegexp, selfReferenceReplacer);
573
573
  }
574
574
  };
575
- var stringifyRules = function (css, selector, prefix, componentId) {
575
+ var stringifyRules = function (css, selector,
576
+ /**
577
+ * This "prefix" referes to a _selector_ prefix.
578
+ */
579
+ prefix, componentId) {
576
580
  if (selector === void 0) { selector = ''; }
577
581
  if (prefix === void 0) { prefix = ''; }
578
582
  if (componentId === void 0) { componentId = '&'; }
@@ -585,11 +589,16 @@ function createStylisInstance(_a) {
585
589
  _selectorRegexp = new RegExp("\\".concat(_selector, "\\b"), 'g');
586
590
  _consecutiveSelfRefRegExp = new RegExp("(\\".concat(_selector, "\\b){2,}"));
587
591
  var middlewares = plugins.slice();
592
+ /**
593
+ * Enables automatic vendor-prefixing for styles.
594
+ */
588
595
  if (options.prefix || options.prefix === undefined) {
589
596
  middlewares.unshift(prefixer);
590
597
  }
591
598
  middlewares.push(selfReferenceReplacementPlugin, stringify);
592
- return serialize(compile(prefix || selector ? "".concat(prefix, " ").concat(selector, " { ").concat(flatCSS, " }") : flatCSS), middleware(middlewares));
599
+ return serialize(compile(options.namespace || prefix || selector
600
+ ? "".concat(options.namespace ? options.namespace + ' ' : '').concat(prefix, " ").concat(selector, " { ").concat(flatCSS, " }")
601
+ : flatCSS), middleware(middlewares));
593
602
  };
594
603
  stringifyRules.hash = plugins.length
595
604
  ? plugins
@@ -1201,10 +1210,6 @@ var _StyledNativeComponent = (function (InlineStyle) {
1201
1210
  WrappedStyledComponent.styledComponentId = true;
1202
1211
  // fold the underlying StyledComponent target up since we folded the styles
1203
1212
  WrappedStyledComponent.target = isTargetStyledComp ? styledComponentTarget.target : target;
1204
- WrappedStyledComponent.withComponent = function withComponent(tag) {
1205
- var newOptions = __assign(__assign({}, options), { attrs: finalAttrs });
1206
- return createStyledNativeComponent(tag, newOptions, rules);
1207
- };
1208
1213
  Object.defineProperty(WrappedStyledComponent, 'defaultProps', {
1209
1214
  get: function () {
1210
1215
  return this._foldedDefaultProps;
@@ -1222,7 +1227,6 @@ var _StyledNativeComponent = (function (InlineStyle) {
1222
1227
  displayName: true,
1223
1228
  shouldForwardProp: true,
1224
1229
  target: true,
1225
- withComponent: true,
1226
1230
  });
1227
1231
  return WrappedStyledComponent;
1228
1232
  };
@@ -1280,5 +1284,5 @@ aliases.forEach(function (alias) {
1280
1284
  });
1281
1285
  });
1282
1286
 
1283
- export { ThemeConsumer, ThemeContext, ThemeProvider, css, styled as default, isStyledComponent, useTheme, withTheme };
1287
+ export { ThemeConsumer, ThemeContext, ThemeProvider, css, styled as default, isStyledComponent, styled, useTheme, withTheme };
1284
1288
  //# sourceMappingURL=styled-components.native.esm.js.map