styled-components 6.1.19 → 6.2.1-prerelease.0

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 (114) hide show
  1. package/README.md +2 -1
  2. package/dist/styled-components.browser.cjs.js +1 -1
  3. package/dist/styled-components.browser.cjs.js.map +1 -1
  4. package/dist/styled-components.browser.esm.js +1 -1
  5. package/dist/styled-components.browser.esm.js.map +1 -1
  6. package/dist/styled-components.cjs.js +1 -1
  7. package/dist/styled-components.cjs.js.map +1 -1
  8. package/dist/styled-components.esm.js +1 -1
  9. package/dist/styled-components.esm.js.map +1 -1
  10. package/dist/styled-components.js +186 -114
  11. package/dist/styled-components.js.map +1 -1
  12. package/dist/styled-components.min.js +1 -1
  13. package/dist/styled-components.min.js.map +1 -1
  14. package/native/dist/constants.d.ts +5 -0
  15. package/native/dist/constructors/constructWithOptions.d.ts +0 -1
  16. package/native/dist/constructors/styled.d.ts +2 -135
  17. package/native/dist/dist/constants.d.ts +5 -0
  18. package/native/dist/dist/constructors/constructWithOptions.d.ts +0 -1
  19. package/native/dist/dist/constructors/styled.d.ts +2 -135
  20. package/native/dist/dist/hoc/withTheme.d.ts +1 -1
  21. package/native/dist/dist/index.d.ts +2 -2
  22. package/native/dist/dist/models/ComponentStyle.d.ts +4 -1
  23. package/native/dist/dist/models/ServerStyleSheet.d.ts +2 -3
  24. package/native/dist/dist/models/StyledComponent.d.ts +1 -1
  25. package/native/dist/dist/models/StyledNativeComponent.d.ts +1 -1
  26. package/native/dist/dist/native/index.d.ts +8 -26
  27. package/native/dist/dist/sheet/Tag.d.ts +4 -4
  28. package/native/dist/dist/test/utils.d.ts +35 -17
  29. package/native/dist/dist/types.d.ts +32 -24
  30. package/native/dist/dist/utils/domElements.d.ts +2 -2
  31. package/native/dist/dist/utils/empties.d.ts +1 -1
  32. package/native/dist/dist/utils/isRSC.d.ts +11 -0
  33. package/native/dist/hoc/withTheme.d.ts +1 -1
  34. package/native/dist/index.d.ts +2 -2
  35. package/native/dist/models/ComponentStyle.d.ts +4 -1
  36. package/native/dist/models/ServerStyleSheet.d.ts +2 -3
  37. package/native/dist/models/StyledComponent.d.ts +1 -1
  38. package/native/dist/models/StyledNativeComponent.d.ts +1 -1
  39. package/native/dist/native/index.d.ts +8 -26
  40. package/native/dist/sheet/Tag.d.ts +4 -4
  41. package/native/dist/styled-components.native.cjs.js +1 -1
  42. package/native/dist/styled-components.native.cjs.js.map +1 -1
  43. package/native/dist/styled-components.native.esm.js +1 -1
  44. package/native/dist/styled-components.native.esm.js.map +1 -1
  45. package/native/dist/test/utils.d.ts +34 -16
  46. package/native/dist/types.d.ts +32 -24
  47. package/native/dist/utils/domElements.d.ts +2 -2
  48. package/native/dist/utils/empties.d.ts +1 -1
  49. package/native/dist/utils/isRSC.d.ts +11 -0
  50. package/package.json +60 -57
  51. package/test-utils/setupTestFramework.ts +7 -2
  52. package/dist/base.d.ts +0 -12
  53. package/dist/constants.d.ts +0 -8
  54. package/dist/constructors/constructWithOptions.d.ts +0 -18
  55. package/dist/constructors/createGlobalStyle.d.ts +0 -3
  56. package/dist/constructors/css.d.ts +0 -4
  57. package/dist/constructors/keyframes.d.ts +0 -3
  58. package/dist/constructors/styled.d.ts +0 -150
  59. package/dist/hoc/withTheme.d.ts +0 -4
  60. package/dist/hoc/withTheme.spec.d.ts +0 -1
  61. package/dist/index-standalone.d.ts +0 -2
  62. package/dist/index.d.ts +0 -4
  63. package/dist/models/ComponentStyle.d.ts +0 -15
  64. package/dist/models/GlobalStyle.d.ts +0 -11
  65. package/dist/models/InlineStyle.d.ts +0 -7
  66. package/dist/models/Keyframes.d.ts +0 -10
  67. package/dist/models/ServerStyleSheet.d.ts +0 -16
  68. package/dist/models/StyleSheetManager.d.ts +0 -65
  69. package/dist/models/StyledComponent.d.ts +0 -3
  70. package/dist/models/StyledNativeComponent.d.ts +0 -3
  71. package/dist/models/ThemeProvider.d.ts +0 -47
  72. package/dist/native/index.d.ts +0 -37
  73. package/dist/secretInternals.d.ts +0 -5
  74. package/dist/sheet/GroupIDAllocator.d.ts +0 -4
  75. package/dist/sheet/GroupedTag.d.ts +0 -11
  76. package/dist/sheet/Rehydration.d.ts +0 -3
  77. package/dist/sheet/Sheet.d.ts +0 -40
  78. package/dist/sheet/Tag.d.ts +0 -55
  79. package/dist/sheet/dom.d.ts +0 -5
  80. package/dist/sheet/index.d.ts +0 -1
  81. package/dist/sheet/types.d.ts +0 -36
  82. package/dist/test/globals.d.ts +0 -2
  83. package/dist/test/utils.d.ts +0 -145
  84. package/dist/test/veryLargeUnionType.d.ts +0 -1
  85. package/dist/types.d.ts +0 -204
  86. package/dist/utils/addUnitIfNeeded.d.ts +0 -1
  87. package/dist/utils/checkDynamicCreation.d.ts +0 -1
  88. package/dist/utils/createWarnTooManyClasses.d.ts +0 -3
  89. package/dist/utils/determineTheme.d.ts +0 -4
  90. package/dist/utils/domElements.d.ts +0 -4
  91. package/dist/utils/empties.d.ts +0 -3
  92. package/dist/utils/error.d.ts +0 -5
  93. package/dist/utils/errors.d.ts +0 -21
  94. package/dist/utils/escape.d.ts +0 -5
  95. package/dist/utils/flatten.d.ts +0 -4
  96. package/dist/utils/generateAlphabeticName.d.ts +0 -1
  97. package/dist/utils/generateComponentId.d.ts +0 -1
  98. package/dist/utils/generateDisplayName.d.ts +0 -2
  99. package/dist/utils/getComponentName.d.ts +0 -2
  100. package/dist/utils/hash.d.ts +0 -3
  101. package/dist/utils/hoist.d.ts +0 -51
  102. package/dist/utils/hyphenateStyleName.d.ts +0 -14
  103. package/dist/utils/interleave.d.ts +0 -2
  104. package/dist/utils/isFunction.d.ts +0 -1
  105. package/dist/utils/isPlainObject.d.ts +0 -1
  106. package/dist/utils/isStatelessFunction.d.ts +0 -1
  107. package/dist/utils/isStaticRules.d.ts +0 -2
  108. package/dist/utils/isStyledComponent.d.ts +0 -2
  109. package/dist/utils/isTag.d.ts +0 -2
  110. package/dist/utils/joinStrings.d.ts +0 -5
  111. package/dist/utils/mixinDeep.d.ts +0 -6
  112. package/dist/utils/nonce.d.ts +0 -1
  113. package/dist/utils/setToString.d.ts +0 -17
  114. package/dist/utils/stylis.d.ts +0 -10
@@ -1,14 +1,15 @@
1
- /// <reference types="react" />
2
1
  export declare const seedNextClassnames: (names: string[]) => string[];
3
2
  export declare const resetStyled: (isServer?: boolean) => (<Target extends import("..").WebTarget, InjectedProps extends object = import("../types").BaseObject>(tag: Target) => import("../constructors/constructWithOptions").Styled<"web", Target, Target extends import("../types").KnownTarget ? import("react").ComponentPropsWithRef<Target> & InjectedProps : InjectedProps, import("../types").BaseObject>) & {
3
+ symbol: import("../constructors/constructWithOptions").Styled<"web", "symbol", import("react").SVGProps<SVGSymbolElement>, import("../types").BaseObject>;
4
4
  object: import("../constructors/constructWithOptions").Styled<"web", "object", import("react").DetailedHTMLProps<import("react").ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>, import("../types").BaseObject>;
5
5
  g: import("../constructors/constructWithOptions").Styled<"web", "g", import("react").SVGProps<SVGGElement>, import("../types").BaseObject>;
6
6
  map: import("../constructors/constructWithOptions").Styled<"web", "map", import("react").DetailedHTMLProps<import("react").MapHTMLAttributes<HTMLMapElement>, HTMLMapElement>, import("../types").BaseObject>;
7
- big: import("../constructors/constructWithOptions").Styled<"web", "big", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
8
- link: import("../constructors/constructWithOptions").Styled<"web", "link", import("react").DetailedHTMLProps<import("react").LinkHTMLAttributes<HTMLLinkElement>, HTMLLinkElement>, import("../types").BaseObject>;
7
+ filter: import("../constructors/constructWithOptions").Styled<"web", "filter", import("react").SVGProps<SVGFilterElement>, import("../types").BaseObject>;
8
+ search: import("../constructors/constructWithOptions").Styled<"web", "search", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
9
9
  small: import("../constructors/constructWithOptions").Styled<"web", "small", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
10
10
  sub: import("../constructors/constructWithOptions").Styled<"web", "sub", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
11
11
  sup: import("../constructors/constructWithOptions").Styled<"web", "sup", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
12
+ input: import("../constructors/constructWithOptions").Styled<"web", "input", import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, import("../types").BaseObject>;
12
13
  a: import("../constructors/constructWithOptions").Styled<"web", "a", import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, import("../types").BaseObject>;
13
14
  abbr: import("../constructors/constructWithOptions").Styled<"web", "abbr", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
14
15
  address: import("../constructors/constructWithOptions").Styled<"web", "address", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
@@ -17,12 +18,10 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
17
18
  aside: import("../constructors/constructWithOptions").Styled<"web", "aside", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
18
19
  audio: import("../constructors/constructWithOptions").Styled<"web", "audio", import("react").DetailedHTMLProps<import("react").AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, import("../types").BaseObject>;
19
20
  b: import("../constructors/constructWithOptions").Styled<"web", "b", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
20
- base: import("../constructors/constructWithOptions").Styled<"web", "base", import("react").DetailedHTMLProps<import("react").BaseHTMLAttributes<HTMLBaseElement>, HTMLBaseElement>, import("../types").BaseObject>;
21
21
  bdi: import("../constructors/constructWithOptions").Styled<"web", "bdi", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
22
22
  bdo: import("../constructors/constructWithOptions").Styled<"web", "bdo", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
23
23
  blockquote: import("../constructors/constructWithOptions").Styled<"web", "blockquote", import("react").DetailedHTMLProps<import("react").BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>, import("../types").BaseObject>;
24
24
  body: import("../constructors/constructWithOptions").Styled<"web", "body", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>, import("../types").BaseObject>;
25
- br: import("../constructors/constructWithOptions").Styled<"web", "br", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLBRElement>, HTMLBRElement>, import("../types").BaseObject>;
26
25
  button: import("../constructors/constructWithOptions").Styled<"web", "button", import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, import("../types").BaseObject>;
27
26
  canvas: import("../constructors/constructWithOptions").Styled<"web", "canvas", import("react").DetailedHTMLProps<import("react").CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>, import("../types").BaseObject>;
28
27
  caption: import("../constructors/constructWithOptions").Styled<"web", "caption", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
@@ -60,27 +59,21 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
60
59
  i: import("../constructors/constructWithOptions").Styled<"web", "i", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
61
60
  iframe: import("../constructors/constructWithOptions").Styled<"web", "iframe", import("react").DetailedHTMLProps<import("react").IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>, import("../types").BaseObject>;
62
61
  img: import("../constructors/constructWithOptions").Styled<"web", "img", import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, import("../types").BaseObject>;
63
- input: import("../constructors/constructWithOptions").Styled<"web", "input", import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, import("../types").BaseObject>;
64
62
  ins: import("../constructors/constructWithOptions").Styled<"web", "ins", import("react").DetailedHTMLProps<import("react").InsHTMLAttributes<HTMLModElement>, HTMLModElement>, import("../types").BaseObject>;
65
63
  kbd: import("../constructors/constructWithOptions").Styled<"web", "kbd", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
66
- keygen: import("../constructors/constructWithOptions").Styled<"web", "keygen", import("react").DetailedHTMLProps<import("react").KeygenHTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
67
64
  label: import("../constructors/constructWithOptions").Styled<"web", "label", import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, import("../types").BaseObject>;
68
65
  legend: import("../constructors/constructWithOptions").Styled<"web", "legend", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, import("../types").BaseObject>;
69
66
  li: import("../constructors/constructWithOptions").Styled<"web", "li", import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, import("../types").BaseObject>;
70
67
  main: import("../constructors/constructWithOptions").Styled<"web", "main", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
71
68
  mark: import("../constructors/constructWithOptions").Styled<"web", "mark", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
72
69
  menu: import("../constructors/constructWithOptions").Styled<"web", "menu", import("react").DetailedHTMLProps<import("react").MenuHTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
73
- menuitem: import("../constructors/constructWithOptions").Styled<"web", "menuitem", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
74
- meta: import("../constructors/constructWithOptions").Styled<"web", "meta", import("react").DetailedHTMLProps<import("react").MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>, import("../types").BaseObject>;
75
70
  meter: import("../constructors/constructWithOptions").Styled<"web", "meter", import("react").DetailedHTMLProps<import("react").MeterHTMLAttributes<HTMLMeterElement>, HTMLMeterElement>, import("../types").BaseObject>;
76
71
  nav: import("../constructors/constructWithOptions").Styled<"web", "nav", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
77
- noscript: import("../constructors/constructWithOptions").Styled<"web", "noscript", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
78
72
  ol: import("../constructors/constructWithOptions").Styled<"web", "ol", import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, import("../types").BaseObject>;
79
73
  optgroup: import("../constructors/constructWithOptions").Styled<"web", "optgroup", import("react").DetailedHTMLProps<import("react").OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>, import("../types").BaseObject>;
80
74
  option: import("../constructors/constructWithOptions").Styled<"web", "option", import("react").DetailedHTMLProps<import("react").OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>, import("../types").BaseObject>;
81
75
  output: import("../constructors/constructWithOptions").Styled<"web", "output", import("react").DetailedHTMLProps<import("react").OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>, import("../types").BaseObject>;
82
76
  p: import("../constructors/constructWithOptions").Styled<"web", "p", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, import("../types").BaseObject>;
83
- param: import("../constructors/constructWithOptions").Styled<"web", "param", import("react").DetailedHTMLProps<import("react").ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>, import("../types").BaseObject>;
84
77
  picture: import("../constructors/constructWithOptions").Styled<"web", "picture", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
85
78
  pre: import("../constructors/constructWithOptions").Styled<"web", "pre", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, import("../types").BaseObject>;
86
79
  progress: import("../constructors/constructWithOptions").Styled<"web", "progress", import("react").DetailedHTMLProps<import("react").ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>, import("../types").BaseObject>;
@@ -90,15 +83,14 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
90
83
  ruby: import("../constructors/constructWithOptions").Styled<"web", "ruby", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
91
84
  s: import("../constructors/constructWithOptions").Styled<"web", "s", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
92
85
  samp: import("../constructors/constructWithOptions").Styled<"web", "samp", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
93
- script: import("../constructors/constructWithOptions").Styled<"web", "script", import("react").DetailedHTMLProps<import("react").ScriptHTMLAttributes<HTMLScriptElement>, HTMLScriptElement>, import("../types").BaseObject>;
86
+ slot: import("../constructors/constructWithOptions").Styled<"web", "slot", import("react").DetailedHTMLProps<import("react").SlotHTMLAttributes<HTMLSlotElement>, HTMLSlotElement>, import("../types").BaseObject>;
94
87
  section: import("../constructors/constructWithOptions").Styled<"web", "section", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
95
88
  select: import("../constructors/constructWithOptions").Styled<"web", "select", import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, import("../types").BaseObject>;
96
- source: import("../constructors/constructWithOptions").Styled<"web", "source", import("react").DetailedHTMLProps<import("react").SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>, import("../types").BaseObject>;
97
89
  span: import("../constructors/constructWithOptions").Styled<"web", "span", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, import("../types").BaseObject>;
98
90
  strong: import("../constructors/constructWithOptions").Styled<"web", "strong", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
99
- style: import("../constructors/constructWithOptions").Styled<"web", "style", import("react").DetailedHTMLProps<import("react").StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>, import("../types").BaseObject>;
100
91
  summary: import("../constructors/constructWithOptions").Styled<"web", "summary", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
101
92
  table: import("../constructors/constructWithOptions").Styled<"web", "table", import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, import("../types").BaseObject>;
93
+ template: import("../constructors/constructWithOptions").Styled<"web", "template", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTemplateElement>, HTMLTemplateElement>, import("../types").BaseObject>;
102
94
  tbody: import("../constructors/constructWithOptions").Styled<"web", "tbody", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, import("../types").BaseObject>;
103
95
  td: import("../constructors/constructWithOptions").Styled<"web", "td", import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, import("../types").BaseObject>;
104
96
  textarea: import("../constructors/constructWithOptions").Styled<"web", "textarea", import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, import("../types").BaseObject>;
@@ -107,17 +99,40 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
107
99
  thead: import("../constructors/constructWithOptions").Styled<"web", "thead", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, import("../types").BaseObject>;
108
100
  time: import("../constructors/constructWithOptions").Styled<"web", "time", import("react").DetailedHTMLProps<import("react").TimeHTMLAttributes<HTMLTimeElement>, HTMLTimeElement>, import("../types").BaseObject>;
109
101
  tr: import("../constructors/constructWithOptions").Styled<"web", "tr", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, import("../types").BaseObject>;
110
- track: import("../constructors/constructWithOptions").Styled<"web", "track", import("react").DetailedHTMLProps<import("react").TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>, import("../types").BaseObject>;
111
102
  u: import("../constructors/constructWithOptions").Styled<"web", "u", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
112
103
  ul: import("../constructors/constructWithOptions").Styled<"web", "ul", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, import("../types").BaseObject>;
113
104
  var: import("../constructors/constructWithOptions").Styled<"web", "var", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
114
105
  video: import("../constructors/constructWithOptions").Styled<"web", "video", import("react").DetailedHTMLProps<import("react").VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, import("../types").BaseObject>;
115
106
  wbr: import("../constructors/constructWithOptions").Styled<"web", "wbr", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
116
- svg: import("../constructors/constructWithOptions").Styled<"web", "svg", import("react").SVGProps<SVGSVGElement>, import("../types").BaseObject>;
117
107
  circle: import("../constructors/constructWithOptions").Styled<"web", "circle", import("react").SVGProps<SVGCircleElement>, import("../types").BaseObject>;
118
108
  clipPath: import("../constructors/constructWithOptions").Styled<"web", "clipPath", import("react").SVGProps<SVGClipPathElement>, import("../types").BaseObject>;
119
109
  defs: import("../constructors/constructWithOptions").Styled<"web", "defs", import("react").SVGProps<SVGDefsElement>, import("../types").BaseObject>;
120
110
  ellipse: import("../constructors/constructWithOptions").Styled<"web", "ellipse", import("react").SVGProps<SVGEllipseElement>, import("../types").BaseObject>;
111
+ feBlend: import("../constructors/constructWithOptions").Styled<"web", "feBlend", import("react").SVGProps<SVGFEBlendElement>, import("../types").BaseObject>;
112
+ feColorMatrix: import("../constructors/constructWithOptions").Styled<"web", "feColorMatrix", import("react").SVGProps<SVGFEColorMatrixElement>, import("../types").BaseObject>;
113
+ feComponentTransfer: import("../constructors/constructWithOptions").Styled<"web", "feComponentTransfer", import("react").SVGProps<SVGFEComponentTransferElement>, import("../types").BaseObject>;
114
+ feComposite: import("../constructors/constructWithOptions").Styled<"web", "feComposite", import("react").SVGProps<SVGFECompositeElement>, import("../types").BaseObject>;
115
+ feConvolveMatrix: import("../constructors/constructWithOptions").Styled<"web", "feConvolveMatrix", import("react").SVGProps<SVGFEConvolveMatrixElement>, import("../types").BaseObject>;
116
+ feDiffuseLighting: import("../constructors/constructWithOptions").Styled<"web", "feDiffuseLighting", import("react").SVGProps<SVGFEDiffuseLightingElement>, import("../types").BaseObject>;
117
+ feDisplacementMap: import("../constructors/constructWithOptions").Styled<"web", "feDisplacementMap", import("react").SVGProps<SVGFEDisplacementMapElement>, import("../types").BaseObject>;
118
+ feDistantLight: import("../constructors/constructWithOptions").Styled<"web", "feDistantLight", import("react").SVGProps<SVGFEDistantLightElement>, import("../types").BaseObject>;
119
+ feDropShadow: import("../constructors/constructWithOptions").Styled<"web", "feDropShadow", import("react").SVGProps<SVGFEDropShadowElement>, import("../types").BaseObject>;
120
+ feFlood: import("../constructors/constructWithOptions").Styled<"web", "feFlood", import("react").SVGProps<SVGFEFloodElement>, import("../types").BaseObject>;
121
+ feFuncA: import("../constructors/constructWithOptions").Styled<"web", "feFuncA", import("react").SVGProps<SVGFEFuncAElement>, import("../types").BaseObject>;
122
+ feFuncB: import("../constructors/constructWithOptions").Styled<"web", "feFuncB", import("react").SVGProps<SVGFEFuncBElement>, import("../types").BaseObject>;
123
+ feFuncG: import("../constructors/constructWithOptions").Styled<"web", "feFuncG", import("react").SVGProps<SVGFEFuncGElement>, import("../types").BaseObject>;
124
+ feFuncR: import("../constructors/constructWithOptions").Styled<"web", "feFuncR", import("react").SVGProps<SVGFEFuncRElement>, import("../types").BaseObject>;
125
+ feGaussianBlur: import("../constructors/constructWithOptions").Styled<"web", "feGaussianBlur", import("react").SVGProps<SVGFEGaussianBlurElement>, import("../types").BaseObject>;
126
+ feImage: import("../constructors/constructWithOptions").Styled<"web", "feImage", import("react").SVGProps<SVGFEImageElement>, import("../types").BaseObject>;
127
+ feMerge: import("../constructors/constructWithOptions").Styled<"web", "feMerge", import("react").SVGProps<SVGFEMergeElement>, import("../types").BaseObject>;
128
+ feMergeNode: import("../constructors/constructWithOptions").Styled<"web", "feMergeNode", import("react").SVGProps<SVGFEMergeNodeElement>, import("../types").BaseObject>;
129
+ feMorphology: import("../constructors/constructWithOptions").Styled<"web", "feMorphology", import("react").SVGProps<SVGFEMorphologyElement>, import("../types").BaseObject>;
130
+ feOffset: import("../constructors/constructWithOptions").Styled<"web", "feOffset", import("react").SVGProps<SVGFEOffsetElement>, import("../types").BaseObject>;
131
+ fePointLight: import("../constructors/constructWithOptions").Styled<"web", "fePointLight", import("react").SVGProps<SVGFEPointLightElement>, import("../types").BaseObject>;
132
+ feSpecularLighting: import("../constructors/constructWithOptions").Styled<"web", "feSpecularLighting", import("react").SVGProps<SVGFESpecularLightingElement>, import("../types").BaseObject>;
133
+ feSpotLight: import("../constructors/constructWithOptions").Styled<"web", "feSpotLight", import("react").SVGProps<SVGFESpotLightElement>, import("../types").BaseObject>;
134
+ feTile: import("../constructors/constructWithOptions").Styled<"web", "feTile", import("react").SVGProps<SVGFETileElement>, import("../types").BaseObject>;
135
+ feTurbulence: import("../constructors/constructWithOptions").Styled<"web", "feTurbulence", import("react").SVGProps<SVGFETurbulenceElement>, import("../types").BaseObject>;
121
136
  foreignObject: import("../constructors/constructWithOptions").Styled<"web", "foreignObject", import("react").SVGProps<SVGForeignObjectElement>, import("../types").BaseObject>;
122
137
  image: import("../constructors/constructWithOptions").Styled<"web", "image", import("react").SVGProps<SVGImageElement>, import("../types").BaseObject>;
123
138
  line: import("../constructors/constructWithOptions").Styled<"web", "line", import("react").SVGLineElementAttributes<SVGLineElement>, import("../types").BaseObject>;
@@ -131,7 +146,10 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
131
146
  radialGradient: import("../constructors/constructWithOptions").Styled<"web", "radialGradient", import("react").SVGProps<SVGRadialGradientElement>, import("../types").BaseObject>;
132
147
  rect: import("../constructors/constructWithOptions").Styled<"web", "rect", import("react").SVGProps<SVGRectElement>, import("../types").BaseObject>;
133
148
  stop: import("../constructors/constructWithOptions").Styled<"web", "stop", import("react").SVGProps<SVGStopElement>, import("../types").BaseObject>;
149
+ svg: import("../constructors/constructWithOptions").Styled<"web", "svg", import("react").SVGProps<SVGSVGElement>, import("../types").BaseObject>;
150
+ switch: import("../constructors/constructWithOptions").Styled<"web", "switch", import("react").SVGProps<SVGSwitchElement>, import("../types").BaseObject>;
134
151
  text: import("../constructors/constructWithOptions").Styled<"web", "text", import("react").SVGTextElementAttributes<SVGTextElement>, import("../types").BaseObject>;
152
+ textPath: import("../constructors/constructWithOptions").Styled<"web", "textPath", import("react").SVGProps<SVGTextPathElement>, import("../types").BaseObject>;
135
153
  tspan: import("../constructors/constructWithOptions").Styled<"web", "tspan", import("react").SVGProps<SVGTSpanElement>, import("../types").BaseObject>;
136
154
  use: import("../constructors/constructWithOptions").Styled<"web", "use", import("react").SVGProps<SVGUseElement>, import("../types").BaseObject>;
137
155
  };
@@ -5,7 +5,7 @@ import { DefaultTheme } from './models/ThemeProvider';
5
5
  import createWarnTooManyClasses from './utils/createWarnTooManyClasses';
6
6
  import type { SupportedHTMLElements } from './utils/domElements';
7
7
  export { CSS, DefaultTheme, SupportedHTMLElements };
8
- export interface ExoticComponentWithDisplayName<P extends object = {}> extends React.ExoticComponent<P> {
8
+ export interface ExoticComponentWithDisplayName<P extends BaseObject = {}> extends React.ExoticComponent<P> {
9
9
  defaultProps?: Partial<P> | undefined;
10
10
  displayName?: string | undefined;
11
11
  }
@@ -20,16 +20,16 @@ export type BaseObject = {};
20
20
  export type OmitNever<T> = {
21
21
  [K in keyof T as T[K] extends never ? never : K]: T[K];
22
22
  };
23
- export type FastOmit<T extends object, U extends string | number | symbol> = {
23
+ export type FastOmit<T extends BaseObject, U extends string | number | symbol> = {
24
24
  [K in keyof T as K extends U ? never : K]: T[K];
25
25
  };
26
26
  export type Runtime = 'web' | 'native';
27
- export type AnyComponent<P extends object = any> = ExoticComponentWithDisplayName<P> | React.ComponentType<P>;
27
+ export type AnyComponent<P extends BaseObject = any> = ExoticComponentWithDisplayName<P> | React.ComponentType<P>;
28
28
  export type KnownTarget = SupportedHTMLElements | AnyComponent;
29
29
  export type WebTarget = string | KnownTarget;
30
30
  export type NativeTarget = AnyComponent;
31
31
  export type StyledTarget<R extends Runtime> = R extends 'web' ? WebTarget : NativeTarget;
32
- export interface StyledOptions<R extends Runtime, Props extends object> {
32
+ export interface StyledOptions<R extends Runtime, Props extends BaseObject> {
33
33
  attrs?: Attrs<Props>[] | undefined;
34
34
  componentId?: (R extends 'web' ? string : never) | undefined;
35
35
  displayName?: string | undefined;
@@ -76,13 +76,13 @@ export type ExecutionProps = {
76
76
  export interface ExecutionContext extends ExecutionProps {
77
77
  theme: DefaultTheme;
78
78
  }
79
- export interface StyleFunction<Props extends object> {
79
+ export interface StyleFunction<Props extends BaseObject> {
80
80
  (executionContext: ExecutionContext & Props): Interpolation<Props>;
81
81
  }
82
- export type Interpolation<Props extends object> = StyleFunction<Props> | StyledObject<Props> | TemplateStringsArray | string | number | false | undefined | null | Keyframes | StyledComponentBrand | RuleSet<Props> | Interpolation<Props>[];
83
- export type Attrs<Props extends object = BaseObject> = (ExecutionProps & Partial<Props>) | ((props: ExecutionContext & Props) => ExecutionProps & Partial<Props>);
84
- export type RuleSet<Props extends object = BaseObject> = Interpolation<Props>[];
85
- export type Styles<Props extends object> = TemplateStringsArray | StyledObject<Props> | StyleFunction<Props>;
82
+ export type Interpolation<Props extends BaseObject> = StyleFunction<Props> | StyledObject<Props> | TemplateStringsArray | string | number | false | undefined | null | Keyframes | StyledComponentBrand | RuleSet<Props> | Interpolation<Props>[];
83
+ export type Attrs<Props extends BaseObject = BaseObject> = (ExecutionProps & Partial<OverrideStyle<Props>>) | ((props: ExecutionContext & Props) => ExecutionProps & Partial<OverrideStyle<Props>>);
84
+ export type RuleSet<Props extends BaseObject = BaseObject> = Interpolation<Props>[];
85
+ export type Styles<Props extends BaseObject> = TemplateStringsArray | StyledObject<Props> | StyleFunction<Props>;
86
86
  export type NameGenerator = (hash: number) => string;
87
87
  export interface StyleSheet {
88
88
  create: Function;
@@ -92,7 +92,7 @@ export interface Keyframes {
92
92
  name: string;
93
93
  rules: string;
94
94
  }
95
- export interface Flattener<Props extends object> {
95
+ export interface Flattener<Props extends BaseObject> {
96
96
  (chunks: Interpolation<Props>[], executionContext: object | null | undefined, styleSheet: StyleSheet | null | undefined): Interpolation<Props>[];
97
97
  }
98
98
  export interface Stringifier {
@@ -102,12 +102,12 @@ export interface Stringifier {
102
102
  export interface ShouldForwardProp<R extends Runtime> {
103
103
  (prop: string, elementToBeCreated: StyledTarget<R>): boolean;
104
104
  }
105
- export interface CommonStatics<R extends Runtime, Props extends object> {
105
+ export interface CommonStatics<R extends Runtime, Props extends BaseObject> {
106
106
  attrs: Attrs<Props>[];
107
107
  target: StyledTarget<R>;
108
108
  shouldForwardProp?: ShouldForwardProp<R> | undefined;
109
109
  }
110
- export interface IStyledStatics<R extends Runtime, OuterProps extends object> extends CommonStatics<R, OuterProps> {
110
+ export interface IStyledStatics<R extends Runtime, OuterProps extends BaseObject> extends CommonStatics<R, OuterProps> {
111
111
  componentStyle: R extends 'web' ? ComponentStyle : never;
112
112
  foldedComponentIds: R extends 'web' ? string : never;
113
113
  inlineStyle: R extends 'native' ? InstanceType<IInlineStyleConstructor<OuterProps>> : never;
@@ -118,10 +118,10 @@ export interface IStyledStatics<R extends Runtime, OuterProps extends object> ex
118
118
  /**
119
119
  * Used by PolymorphicComponent to define prop override cascading order.
120
120
  */
121
- export type PolymorphicComponentProps<R extends Runtime, BaseProps extends object, AsTarget extends StyledTarget<R> | void, ForwardedAsTarget extends StyledTarget<R> | void, AsTargetProps extends object = AsTarget extends KnownTarget ? React.ComponentPropsWithRef<AsTarget> : {}, ForwardedAsTargetProps extends object = ForwardedAsTarget extends KnownTarget ? React.ComponentPropsWithRef<ForwardedAsTarget> : {}> = NoInfer<FastOmit<Substitute<BaseProps, Substitute<ForwardedAsTargetProps, AsTargetProps>>, keyof ExecutionProps>> & FastOmit<ExecutionProps, 'as' | 'forwardedAs'> & {
121
+ export type PolymorphicComponentProps<R extends Runtime, BaseProps extends BaseObject, AsTarget extends StyledTarget<R> | void, ForwardedAsTarget extends StyledTarget<R> | void, AsTargetProps extends BaseObject = AsTarget extends KnownTarget ? React.ComponentPropsWithRef<AsTarget> : {}, ForwardedAsTargetProps extends BaseObject = ForwardedAsTarget extends KnownTarget ? React.ComponentPropsWithRef<ForwardedAsTarget> : {}> = OverrideStyle<NoInfer<FastOmit<Substitute<BaseProps, Substitute<ForwardedAsTargetProps, AsTargetProps>>, keyof ExecutionProps>> & FastOmit<ExecutionProps, 'as' | 'forwardedAs'> & {
122
122
  as?: AsTarget;
123
123
  forwardedAs?: ForwardedAsTarget;
124
- };
124
+ }>;
125
125
  /**
126
126
  * This type forms the signature for a forwardRef-enabled component
127
127
  * that accepts the "as" prop to dynamically change the underlying
@@ -129,14 +129,14 @@ export type PolymorphicComponentProps<R extends Runtime, BaseProps extends objec
129
129
  * props from the given rendering target to get proper typing for
130
130
  * any specialized props in the target component.
131
131
  */
132
- export interface PolymorphicComponent<R extends Runtime, BaseProps extends object> extends React.ForwardRefExoticComponent<BaseProps> {
132
+ export interface PolymorphicComponent<R extends Runtime, BaseProps extends BaseObject> extends React.ForwardRefExoticComponent<BaseProps> {
133
133
  <AsTarget extends StyledTarget<R> | void = void, ForwardedAsTarget extends StyledTarget<R> | void = void>(props: PolymorphicComponentProps<R, BaseProps, AsTarget, ForwardedAsTarget>): React.JSX.Element;
134
134
  }
135
- export interface IStyledComponentBase<R extends Runtime, Props extends object = BaseObject> extends PolymorphicComponent<R, Props>, IStyledStatics<R, Props>, StyledComponentBrand {
135
+ export interface IStyledComponentBase<R extends Runtime, Props extends BaseObject = BaseObject> extends PolymorphicComponent<R, Props>, IStyledStatics<R, Props>, StyledComponentBrand {
136
136
  defaultProps?: (ExecutionProps & Partial<Props>) | undefined;
137
137
  toString: () => string;
138
138
  }
139
- export type IStyledComponent<R extends Runtime, Props extends object = BaseObject> = IStyledComponentBase<R, Props> &
139
+ export type IStyledComponent<R extends Runtime, Props extends BaseObject = BaseObject> = IStyledComponentBase<R, Props> &
140
140
  /**
141
141
  * TypeScript doesn't allow using a styled component as a key inside object
142
142
  * styles because "A computed property name must be of type 'string', 'number',
@@ -156,25 +156,33 @@ export type IStyledComponent<R extends Runtime, Props extends object = BaseObjec
156
156
  * })
157
157
  */
158
158
  (R extends 'web' ? string : {});
159
- export interface IStyledComponentFactory<R extends Runtime, Target extends StyledTarget<R>, OuterProps extends object, OuterStatics extends object = BaseObject> {
160
- <Props extends object = BaseObject, Statics extends object = BaseObject>(target: Target, options: StyledOptions<R, OuterProps & Props>, rules: RuleSet<OuterProps & Props>): IStyledComponent<R, Substitute<OuterProps, Props>> & OuterStatics & Statics;
159
+ export interface IStyledComponentFactory<R extends Runtime, Target extends StyledTarget<R>, OuterProps extends BaseObject, OuterStatics extends BaseObject = BaseObject> {
160
+ <Props extends BaseObject = BaseObject, Statics extends BaseObject = BaseObject>(target: Target, options: StyledOptions<R, OuterProps & Props>, rules: RuleSet<OuterProps & Props>): IStyledComponent<R, Substitute<OuterProps, Props>> & OuterStatics & Statics;
161
161
  }
162
- export interface IInlineStyleConstructor<Props extends object> {
162
+ export interface IInlineStyleConstructor<Props extends BaseObject> {
163
163
  new (rules: RuleSet<Props>): IInlineStyle<Props>;
164
164
  }
165
- export interface IInlineStyle<Props extends object> {
165
+ export interface IInlineStyle<Props extends BaseObject> {
166
166
  rules: RuleSet<Props>;
167
167
  generateStyleObject(executionContext: ExecutionContext & Props): object;
168
168
  }
169
169
  export type CSSProperties = CSS.Properties<number | (string & {})>;
170
+ export type CSSPropertiesWithVars = CSSProperties & {
171
+ [key: `--${string}`]: string | number | undefined;
172
+ };
173
+ type OverrideStyle<P> = P extends {
174
+ style?: any;
175
+ } ? Omit<P, 'style'> & {
176
+ style?: CSSPropertiesWithVars;
177
+ } : P;
170
178
  export type CSSPseudos = {
171
179
  [K in CSS.Pseudos]?: CSSObject;
172
180
  };
173
181
  export type CSSKeyframes = object & {
174
182
  [key: string]: CSSObject;
175
183
  };
176
- export type CSSObject<Props extends object = BaseObject> = StyledObject<Props>;
177
- export interface StyledObject<Props extends object = BaseObject> extends CSSProperties, CSSPseudos {
184
+ export type CSSObject<Props extends BaseObject = BaseObject> = StyledObject<Props>;
185
+ export interface StyledObject<Props extends BaseObject = BaseObject> extends CSSProperties, CSSPseudos {
178
186
  [key: string]: StyledObject<Props> | string | number | StyleFunction<Props> | RuleSet<any> | undefined;
179
187
  }
180
188
  /**
@@ -200,5 +208,5 @@ export interface StyledObject<Props extends object = BaseObject> extends CSSProp
200
208
  */
201
209
  export type CSSProp = Interpolation<any>;
202
210
  export type NoInfer<T> = [T][T extends any ? 0 : never];
203
- export type Substitute<A extends object, B extends object> = FastOmit<A, keyof B> & B;
211
+ export type Substitute<A extends BaseObject, B extends BaseObject> = FastOmit<A, keyof B> & B;
204
212
  export type InsertionTarget = HTMLElement | ShadowRoot;
@@ -1,4 +1,4 @@
1
- declare const elements: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "use", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"];
2
- declare const _default: Set<"object" | "g" | "map" | "big" | "link" | "small" | "sub" | "sup" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "summary" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "svg" | "circle" | "clipPath" | "defs" | "ellipse" | "foreignObject" | "image" | "line" | "linearGradient" | "marker" | "mask" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "text" | "tspan" | "use">;
1
+ declare const elements: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "blockquote", "body", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "menu", "meter", "nav", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "slot", "small", "span", "strong", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "u", "ul", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "switch", "symbol", "text", "textPath", "tspan", "use"];
2
+ declare const _default: Set<"symbol" | "object" | "g" | "map" | "filter" | "search" | "small" | "sub" | "sup" | "input" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "bdi" | "bdo" | "blockquote" | "body" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "ins" | "kbd" | "label" | "legend" | "li" | "main" | "mark" | "menu" | "meter" | "nav" | "ol" | "optgroup" | "option" | "output" | "p" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "section" | "select" | "span" | "strong" | "summary" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "tr" | "u" | "ul" | "var" | "video" | "wbr" | "circle" | "clipPath" | "defs" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "image" | "line" | "linearGradient" | "marker" | "mask" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use">;
3
3
  export default _default;
4
4
  export type SupportedHTMLElements = (typeof elements)[number];
@@ -1,3 +1,3 @@
1
1
  import { Dict } from '../types';
2
- export declare const EMPTY_ARRAY: readonly any[];
2
+ export declare const EMPTY_ARRAY: Readonly<any[]>;
3
3
  export declare const EMPTY_OBJECT: Readonly<Dict<any>>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Detect if we're running in a React Server Component environment.
3
+ * RSC environments lack createContext, making this a reliable indicator.
4
+ * This is evaluated once at module load time and is deterministic per environment.
5
+ */
6
+ export declare const isRSC: boolean;
7
+ /**
8
+ * Check if React context APIs are available (opposite of isRSC).
9
+ * Used to guard context creation and usage.
10
+ */
11
+ export declare const canUseContext: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styled-components",
3
- "version": "6.1.19",
3
+ "version": "6.2.1-prerelease.0",
4
4
  "description": "CSS for the <Component> Age. Style components your way with speed, strong typing, and flexibility.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -16,18 +16,17 @@
16
16
  "sideEffects": false,
17
17
  "scripts": {
18
18
  "generateErrors": "node scripts/generateErrorMap.js",
19
- "prebuild": "rimraf dist && yarn run generateErrors",
19
+ "prebuild": "rimraf dist && pnpm run generateErrors",
20
20
  "build": "rollup -c",
21
- "postbuild": "yarn run size",
22
- "pretest": "yarn run generateErrors",
23
- "test": "yarn run test:web && yarn run test:native",
21
+ "postbuild": "pnpm run size",
22
+ "pretest": "pnpm run generateErrors",
23
+ "test": "pnpm run test:web && pnpm run test:native",
24
24
  "test:web": "jest -c jest.config.main.js",
25
25
  "test:native": "jest -c jest.config.native.js --forceExit",
26
- "test:integration": "jest -c jest.config.integration.js --runInBand --forceExit",
27
26
  "size": "bundlewatch",
28
27
  "prettier": "prettier src --write",
29
28
  "prettier:check": "prettier src --check",
30
- "prepublishOnly": "cp ../../README.md . && yarn run build"
29
+ "prepublishOnly": "cp ../../README.md . && pnpm run build"
31
30
  },
32
31
  "repository": {
33
32
  "type": "git",
@@ -56,12 +55,12 @@
56
55
  "dependencies": {
57
56
  "@emotion/is-prop-valid": "1.2.2",
58
57
  "@emotion/unitless": "0.8.1",
59
- "@types/stylis": "4.2.5",
58
+ "@types/stylis": "4.2.7",
60
59
  "css-to-react-native": "3.2.0",
61
- "csstype": "3.1.3",
60
+ "csstype": "3.2.3",
62
61
  "postcss": "8.4.49",
63
62
  "shallowequal": "1.1.0",
64
- "stylis": "4.3.2",
63
+ "stylis": "4.3.6",
65
64
  "tslib": "2.6.2"
66
65
  },
67
66
  "peerDependencies": {
@@ -69,53 +68,57 @@
69
68
  "react-dom": ">= 16.8.0"
70
69
  },
71
70
  "devDependencies": {
72
- "@babel/core": "7.24.5",
73
- "@babel/helper-module-imports": "7.24.3",
74
- "@babel/plugin-external-helpers": "7.24.1",
75
- "@babel/plugin-proposal-class-properties": "7.18.6",
76
- "@babel/plugin-proposal-object-rest-spread": "7.20.7",
77
- "@babel/plugin-transform-flow-strip-types": "7.24.1",
78
- "@babel/preset-env": "7.24.5",
79
- "@babel/preset-react": "7.24.1",
80
- "@babel/preset-typescript": "7.24.1",
81
- "@rollup/plugin-typescript": "11.1.6",
82
- "@types/enzyme": "3.10.18",
83
- "@types/jest": "29.5.12",
84
- "@types/js-beautify": "1.14.3",
85
- "@types/node": "18.19.31",
86
- "@types/react": "17.0.80",
87
- "@types/react-dom": "17.0.25",
88
- "@types/react-frame-component": "4.1.6",
89
- "@types/react-native": "0.69.26",
90
- "@types/react-test-renderer": "17.0.9",
91
- "@types/shallowequal": "1.1.5",
92
- "babel-jest": "29.7.0",
93
- "babel-plugin-add-module-exports": "1.0.4",
94
- "babel-plugin-styled-components": "2.1.4",
95
- "babel-plugin-tester": "10.1.0",
96
- "bundlewatch": "0.3.3",
97
- "jest": "29.7.0",
98
- "jest-environment-jsdom": "29.7.0",
99
- "jest-serializer-html": "7.1.0",
100
- "jest-watch-typeahead": "2.2.2",
101
- "js-beautify": "1.15.1",
102
- "prettier": "3.2.5",
103
- "prop-types": "15.8.1",
104
- "react": "17.0.2",
105
- "react-dom": "17.0.2",
106
- "react-frame-component": "4.1.3",
107
- "react-native": "0.70.15",
108
- "react-test-renderer": "17.0.2",
109
- "rollup": "3.29.4",
110
- "rollup-plugin-commonjs": "10.1.0",
111
- "rollup-plugin-json": "4.0.0",
112
- "rollup-plugin-node-resolve": "5.2.0",
113
- "rollup-plugin-replace": "2.2.0",
114
- "rollup-plugin-sourcemaps": "0.6.3",
115
- "rollup-plugin-terser": "7.0.2",
116
- "stylis-plugin-rtl": "2.1.1",
117
- "ts-toolbelt": "9.6.0",
118
- "typescript": "5.4.5"
71
+ "@babel/core": "^7.24.5",
72
+ "@babel/helper-module-imports": "^7.24.3",
73
+ "@babel/plugin-external-helpers": "^7.24.1",
74
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
75
+ "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
76
+ "@babel/plugin-transform-flow-strip-types": "^7.24.1",
77
+ "@babel/preset-env": "^7.24.5",
78
+ "@babel/preset-react": "^7.24.1",
79
+ "@babel/preset-typescript": "^7.24.1",
80
+ "@rollup/plugin-typescript": "^11.1.6",
81
+ "@testing-library/dom": "^10.4.1",
82
+ "@testing-library/jest-dom": "^6.8.0",
83
+ "@testing-library/react": "^16.3.0",
84
+ "@testing-library/user-event": "^14.6.1",
85
+ "@types/enzyme": "^3.10.18",
86
+ "@types/jest": "^30.0.0",
87
+ "@types/js-beautify": "^1.14.3",
88
+ "@types/node": "^18.19.31",
89
+ "@types/react": "^18",
90
+ "@types/react-dom": "^18",
91
+ "@types/react-frame-component": "^4.1.6",
92
+ "@types/react-native": "^0.71",
93
+ "@types/react-test-renderer": "^18.0.0",
94
+ "@types/shallowequal": "^1.1.5",
95
+ "babel-jest": "^30.1.2",
96
+ "babel-plugin-add-module-exports": "^1.0.4",
97
+ "babel-plugin-styled-components": "^2.1.4",
98
+ "babel-plugin-tester": "^10.1.0",
99
+ "bundlewatch": "^0.3.3",
100
+ "jest": "^30.1.3",
101
+ "jest-environment-jsdom": "^30.1.2",
102
+ "jest-serializer-html": "^7.1.0",
103
+ "jest-watch-typeahead": "^3.0.1",
104
+ "js-beautify": "^1.15.1",
105
+ "prettier": "^3.6.2",
106
+ "prop-types": "^15.8.1",
107
+ "react": "^18",
108
+ "react-dom": "^18",
109
+ "react-frame-component": "^4.1.3",
110
+ "react-native": "~0.71",
111
+ "react-test-renderer": "^18.0.0",
112
+ "rollup": "^3.29.4",
113
+ "rollup-plugin-commonjs": "^10.1.0",
114
+ "rollup-plugin-json": "^4.0.0",
115
+ "rollup-plugin-node-resolve": "^5.2.0",
116
+ "rollup-plugin-replace": "^2.2.0",
117
+ "rollup-plugin-sourcemaps": "^0.6.3",
118
+ "rollup-plugin-terser": "^7.0.2",
119
+ "stylis-plugin-rtl": "^2.1.1",
120
+ "ts-toolbelt": "^9.6.0",
121
+ "typescript": "^5.4.5"
119
122
  },
120
123
  "bundlewatch": {
121
124
  "files": [
@@ -4,12 +4,17 @@ const suppressedErrors = [
4
4
  'Error: Could not parse CSS stylesheet',
5
5
  'Warning: Use the `defaultValue` or `value` props instead of setting children on <textarea>',
6
6
  'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
7
+ 'Warning: <%s /> is using incorrect casing.',
8
+ 'Warning: The tag <%s> is unrecognized in this browser.',
9
+ 'Warning: React does not recognize the `%s` prop on a DOM element.',
10
+ 'Warning: %s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.',
11
+ 'Warning: renderToNodeStream is deprecated. Use renderToPipeableStream instead.',
7
12
  ];
8
13
 
9
14
  beforeEach(() => {
10
15
  // Suppress errors from JSDOM CSS parser
11
16
  // See: https://github.com/jsdom/jsdom/issues/2177
12
- console.error = (logged: any) => {
17
+ console.error = jest.fn((logged: any) => {
13
18
  const message = logged.stack || logged;
14
19
 
15
20
  if (
@@ -18,7 +23,7 @@ beforeEach(() => {
18
23
  ) {
19
24
  consoleError(logged);
20
25
  }
21
- };
26
+ });
22
27
  });
23
28
 
24
29
  afterEach(() => {
package/dist/base.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import { SC_VERSION } from './constants';
2
- import createGlobalStyle from './constructors/createGlobalStyle';
3
- import css from './constructors/css';
4
- import keyframes from './constructors/keyframes';
5
- import withTheme from './hoc/withTheme';
6
- import ServerStyleSheet from './models/ServerStyleSheet';
7
- import { IStyleSheetContext, IStyleSheetManager, IStylisContext, StyleSheetConsumer, StyleSheetContext, StyleSheetManager } from './models/StyleSheetManager';
8
- import ThemeProvider, { ThemeConsumer, ThemeContext, useTheme } from './models/ThemeProvider';
9
- import isStyledComponent from './utils/isStyledComponent';
10
- export * from './secretInternals';
11
- export { Attrs, DefaultTheme, ShouldForwardProp } from './types';
12
- export { IStyleSheetContext, IStyleSheetManager, IStylisContext, ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, createGlobalStyle, css, isStyledComponent, keyframes, useTheme, SC_VERSION as version, withTheme, };
@@ -1,8 +0,0 @@
1
- export declare const SC_ATTR: string;
2
- export declare const SC_ATTR_ACTIVE = "active";
3
- export declare const SC_ATTR_VERSION = "data-styled-version";
4
- export declare const SC_VERSION: string;
5
- export declare const SPLITTER = "/*!sc*/\n";
6
- export declare const IS_BROWSER: boolean;
7
- export declare const DISABLE_SPEEDY: boolean;
8
- export declare const STATIC_EXECUTION_CONTEXT: {};