styled-components 6.2.0 → 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 (98) 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 +165 -100
  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/dist/constants.d.ts +5 -0
  16. package/native/dist/dist/hoc/withTheme.spec.d.ts +1 -0
  17. package/native/dist/dist/index.d.ts +2 -2
  18. package/native/dist/dist/models/ComponentStyle.d.ts +4 -1
  19. package/native/dist/dist/sheet/Tag.d.ts +4 -4
  20. package/native/dist/dist/test/utils.d.ts +33 -14
  21. package/native/dist/dist/types.d.ts +11 -3
  22. package/native/dist/dist/utils/domElements.d.ts +2 -2
  23. package/native/dist/dist/utils/isRSC.d.ts +11 -0
  24. package/native/dist/hoc/withTheme.spec.d.ts +1 -0
  25. package/native/dist/index.d.ts +2 -2
  26. package/native/dist/models/ComponentStyle.d.ts +4 -1
  27. package/native/dist/sheet/Tag.d.ts +4 -4
  28. package/native/dist/styled-components.native.cjs.js +1 -1
  29. package/native/dist/styled-components.native.cjs.js.map +1 -1
  30. package/native/dist/styled-components.native.esm.js +1 -1
  31. package/native/dist/styled-components.native.esm.js.map +1 -1
  32. package/native/dist/test/utils.d.ts +32 -13
  33. package/native/dist/types.d.ts +11 -3
  34. package/native/dist/utils/domElements.d.ts +2 -2
  35. package/native/dist/utils/isRSC.d.ts +11 -0
  36. package/package.json +6 -6
  37. package/dist/base.d.ts +0 -12
  38. package/dist/constants.d.ts +0 -8
  39. package/dist/constructors/constructWithOptions.d.ts +0 -17
  40. package/dist/constructors/createGlobalStyle.d.ts +0 -3
  41. package/dist/constructors/css.d.ts +0 -4
  42. package/dist/constructors/keyframes.d.ts +0 -3
  43. package/dist/constructors/styled.d.ts +0 -17
  44. package/dist/hoc/withTheme.d.ts +0 -4
  45. package/dist/index-standalone.d.ts +0 -2
  46. package/dist/index.d.ts +0 -4
  47. package/dist/models/ComponentStyle.d.ts +0 -15
  48. package/dist/models/GlobalStyle.d.ts +0 -11
  49. package/dist/models/InlineStyle.d.ts +0 -7
  50. package/dist/models/Keyframes.d.ts +0 -10
  51. package/dist/models/ServerStyleSheet.d.ts +0 -15
  52. package/dist/models/StyleSheetManager.d.ts +0 -65
  53. package/dist/models/StyledComponent.d.ts +0 -3
  54. package/dist/models/StyledNativeComponent.d.ts +0 -3
  55. package/dist/models/ThemeProvider.d.ts +0 -47
  56. package/dist/native/index.d.ts +0 -19
  57. package/dist/secretInternals.d.ts +0 -5
  58. package/dist/sheet/GroupIDAllocator.d.ts +0 -4
  59. package/dist/sheet/GroupedTag.d.ts +0 -11
  60. package/dist/sheet/Rehydration.d.ts +0 -3
  61. package/dist/sheet/Sheet.d.ts +0 -40
  62. package/dist/sheet/Tag.d.ts +0 -55
  63. package/dist/sheet/dom.d.ts +0 -5
  64. package/dist/sheet/index.d.ts +0 -1
  65. package/dist/sheet/types.d.ts +0 -36
  66. package/dist/test/globals.d.ts +0 -2
  67. package/dist/test/utils.d.ts +0 -144
  68. package/dist/test/veryLargeUnionType.d.ts +0 -1
  69. package/dist/types.d.ts +0 -204
  70. package/dist/utils/addUnitIfNeeded.d.ts +0 -1
  71. package/dist/utils/checkDynamicCreation.d.ts +0 -1
  72. package/dist/utils/createWarnTooManyClasses.d.ts +0 -3
  73. package/dist/utils/determineTheme.d.ts +0 -4
  74. package/dist/utils/domElements.d.ts +0 -4
  75. package/dist/utils/empties.d.ts +0 -3
  76. package/dist/utils/error.d.ts +0 -5
  77. package/dist/utils/errors.d.ts +0 -21
  78. package/dist/utils/escape.d.ts +0 -5
  79. package/dist/utils/flatten.d.ts +0 -4
  80. package/dist/utils/generateAlphabeticName.d.ts +0 -1
  81. package/dist/utils/generateComponentId.d.ts +0 -1
  82. package/dist/utils/generateDisplayName.d.ts +0 -2
  83. package/dist/utils/getComponentName.d.ts +0 -2
  84. package/dist/utils/hash.d.ts +0 -3
  85. package/dist/utils/hoist.d.ts +0 -51
  86. package/dist/utils/hyphenateStyleName.d.ts +0 -14
  87. package/dist/utils/interleave.d.ts +0 -2
  88. package/dist/utils/isFunction.d.ts +0 -1
  89. package/dist/utils/isPlainObject.d.ts +0 -1
  90. package/dist/utils/isStatelessFunction.d.ts +0 -1
  91. package/dist/utils/isStaticRules.d.ts +0 -2
  92. package/dist/utils/isStyledComponent.d.ts +0 -2
  93. package/dist/utils/isTag.d.ts +0 -2
  94. package/dist/utils/joinStrings.d.ts +0 -5
  95. package/dist/utils/mixinDeep.d.ts +0 -6
  96. package/dist/utils/nonce.d.ts +0 -1
  97. package/dist/utils/setToString.d.ts +0 -17
  98. package/dist/utils/stylis.d.ts +0 -10
@@ -1,10 +1,11 @@
1
1
  export declare const seedNextClassnames: (names: string[]) => string[];
2
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>;
3
4
  object: import("../constructors/constructWithOptions").Styled<"web", "object", import("react").DetailedHTMLProps<import("react").ObjectHTMLAttributes<HTMLObjectElement>, HTMLObjectElement>, import("../types").BaseObject>;
4
5
  g: import("../constructors/constructWithOptions").Styled<"web", "g", import("react").SVGProps<SVGGElement>, import("../types").BaseObject>;
5
6
  map: import("../constructors/constructWithOptions").Styled<"web", "map", import("react").DetailedHTMLProps<import("react").MapHTMLAttributes<HTMLMapElement>, HTMLMapElement>, import("../types").BaseObject>;
6
- big: import("../constructors/constructWithOptions").Styled<"web", "big", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
7
- 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>;
8
9
  small: import("../constructors/constructWithOptions").Styled<"web", "small", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
9
10
  sub: import("../constructors/constructWithOptions").Styled<"web", "sub", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
10
11
  sup: import("../constructors/constructWithOptions").Styled<"web", "sup", 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>;
@@ -62,24 +61,19 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
62
61
  img: import("../constructors/constructWithOptions").Styled<"web", "img", import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, import("../types").BaseObject>;
63
62
  ins: import("../constructors/constructWithOptions").Styled<"web", "ins", import("react").DetailedHTMLProps<import("react").InsHTMLAttributes<HTMLModElement>, HTMLModElement>, import("../types").BaseObject>;
64
63
  kbd: import("../constructors/constructWithOptions").Styled<"web", "kbd", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
65
- keygen: import("../constructors/constructWithOptions").Styled<"web", "keygen", import("react").DetailedHTMLProps<import("react").KeygenHTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
66
64
  label: import("../constructors/constructWithOptions").Styled<"web", "label", import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, import("../types").BaseObject>;
67
65
  legend: import("../constructors/constructWithOptions").Styled<"web", "legend", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, import("../types").BaseObject>;
68
66
  li: import("../constructors/constructWithOptions").Styled<"web", "li", import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, import("../types").BaseObject>;
69
67
  main: import("../constructors/constructWithOptions").Styled<"web", "main", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
70
68
  mark: import("../constructors/constructWithOptions").Styled<"web", "mark", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
71
69
  menu: import("../constructors/constructWithOptions").Styled<"web", "menu", import("react").DetailedHTMLProps<import("react").MenuHTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
72
- menuitem: import("../constructors/constructWithOptions").Styled<"web", "menuitem", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
73
- meta: import("../constructors/constructWithOptions").Styled<"web", "meta", import("react").DetailedHTMLProps<import("react").MetaHTMLAttributes<HTMLMetaElement>, HTMLMetaElement>, import("../types").BaseObject>;
74
70
  meter: import("../constructors/constructWithOptions").Styled<"web", "meter", import("react").DetailedHTMLProps<import("react").MeterHTMLAttributes<HTMLMeterElement>, HTMLMeterElement>, import("../types").BaseObject>;
75
71
  nav: import("../constructors/constructWithOptions").Styled<"web", "nav", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
76
- noscript: import("../constructors/constructWithOptions").Styled<"web", "noscript", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
77
72
  ol: import("../constructors/constructWithOptions").Styled<"web", "ol", import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, import("../types").BaseObject>;
78
73
  optgroup: import("../constructors/constructWithOptions").Styled<"web", "optgroup", import("react").DetailedHTMLProps<import("react").OptgroupHTMLAttributes<HTMLOptGroupElement>, HTMLOptGroupElement>, import("../types").BaseObject>;
79
74
  option: import("../constructors/constructWithOptions").Styled<"web", "option", import("react").DetailedHTMLProps<import("react").OptionHTMLAttributes<HTMLOptionElement>, HTMLOptionElement>, import("../types").BaseObject>;
80
75
  output: import("../constructors/constructWithOptions").Styled<"web", "output", import("react").DetailedHTMLProps<import("react").OutputHTMLAttributes<HTMLOutputElement>, HTMLOutputElement>, import("../types").BaseObject>;
81
76
  p: import("../constructors/constructWithOptions").Styled<"web", "p", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, import("../types").BaseObject>;
82
- param: import("../constructors/constructWithOptions").Styled<"web", "param", import("react").DetailedHTMLProps<import("react").ParamHTMLAttributes<HTMLParamElement>, HTMLParamElement>, import("../types").BaseObject>;
83
77
  picture: import("../constructors/constructWithOptions").Styled<"web", "picture", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
84
78
  pre: import("../constructors/constructWithOptions").Styled<"web", "pre", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, import("../types").BaseObject>;
85
79
  progress: import("../constructors/constructWithOptions").Styled<"web", "progress", import("react").DetailedHTMLProps<import("react").ProgressHTMLAttributes<HTMLProgressElement>, HTMLProgressElement>, import("../types").BaseObject>;
@@ -89,15 +83,14 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
89
83
  ruby: import("../constructors/constructWithOptions").Styled<"web", "ruby", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
90
84
  s: import("../constructors/constructWithOptions").Styled<"web", "s", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
91
85
  samp: import("../constructors/constructWithOptions").Styled<"web", "samp", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
92
- 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>;
93
87
  section: import("../constructors/constructWithOptions").Styled<"web", "section", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
94
88
  select: import("../constructors/constructWithOptions").Styled<"web", "select", import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, import("../types").BaseObject>;
95
- source: import("../constructors/constructWithOptions").Styled<"web", "source", import("react").DetailedHTMLProps<import("react").SourceHTMLAttributes<HTMLSourceElement>, HTMLSourceElement>, import("../types").BaseObject>;
96
89
  span: import("../constructors/constructWithOptions").Styled<"web", "span", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, import("../types").BaseObject>;
97
90
  strong: import("../constructors/constructWithOptions").Styled<"web", "strong", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
98
- style: import("../constructors/constructWithOptions").Styled<"web", "style", import("react").DetailedHTMLProps<import("react").StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>, import("../types").BaseObject>;
99
91
  summary: import("../constructors/constructWithOptions").Styled<"web", "summary", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
100
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>;
101
94
  tbody: import("../constructors/constructWithOptions").Styled<"web", "tbody", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, import("../types").BaseObject>;
102
95
  td: import("../constructors/constructWithOptions").Styled<"web", "td", import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, import("../types").BaseObject>;
103
96
  textarea: import("../constructors/constructWithOptions").Styled<"web", "textarea", import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, import("../types").BaseObject>;
@@ -106,7 +99,6 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
106
99
  thead: import("../constructors/constructWithOptions").Styled<"web", "thead", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, import("../types").BaseObject>;
107
100
  time: import("../constructors/constructWithOptions").Styled<"web", "time", import("react").DetailedHTMLProps<import("react").TimeHTMLAttributes<HTMLTimeElement>, HTMLTimeElement>, import("../types").BaseObject>;
108
101
  tr: import("../constructors/constructWithOptions").Styled<"web", "tr", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, import("../types").BaseObject>;
109
- track: import("../constructors/constructWithOptions").Styled<"web", "track", import("react").DetailedHTMLProps<import("react").TrackHTMLAttributes<HTMLTrackElement>, HTMLTrackElement>, import("../types").BaseObject>;
110
102
  u: import("../constructors/constructWithOptions").Styled<"web", "u", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
111
103
  ul: import("../constructors/constructWithOptions").Styled<"web", "ul", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, import("../types").BaseObject>;
112
104
  var: import("../constructors/constructWithOptions").Styled<"web", "var", import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, import("../types").BaseObject>;
@@ -116,6 +108,31 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
116
108
  clipPath: import("../constructors/constructWithOptions").Styled<"web", "clipPath", import("react").SVGProps<SVGClipPathElement>, import("../types").BaseObject>;
117
109
  defs: import("../constructors/constructWithOptions").Styled<"web", "defs", import("react").SVGProps<SVGDefsElement>, import("../types").BaseObject>;
118
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>;
119
136
  foreignObject: import("../constructors/constructWithOptions").Styled<"web", "foreignObject", import("react").SVGProps<SVGForeignObjectElement>, import("../types").BaseObject>;
120
137
  image: import("../constructors/constructWithOptions").Styled<"web", "image", import("react").SVGProps<SVGImageElement>, import("../types").BaseObject>;
121
138
  line: import("../constructors/constructWithOptions").Styled<"web", "line", import("react").SVGLineElementAttributes<SVGLineElement>, import("../types").BaseObject>;
@@ -130,7 +147,9 @@ export declare const resetStyled: (isServer?: boolean) => (<Target extends impor
130
147
  rect: import("../constructors/constructWithOptions").Styled<"web", "rect", import("react").SVGProps<SVGRectElement>, import("../types").BaseObject>;
131
148
  stop: import("../constructors/constructWithOptions").Styled<"web", "stop", import("react").SVGProps<SVGStopElement>, import("../types").BaseObject>;
132
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>;
133
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>;
134
153
  tspan: import("../constructors/constructWithOptions").Styled<"web", "tspan", import("react").SVGProps<SVGTSpanElement>, import("../types").BaseObject>;
135
154
  use: import("../constructors/constructWithOptions").Styled<"web", "use", import("react").SVGProps<SVGUseElement>, import("../types").BaseObject>;
136
155
  };
@@ -80,7 +80,7 @@ export interface StyleFunction<Props extends BaseObject> {
80
80
  (executionContext: ExecutionContext & Props): Interpolation<Props>;
81
81
  }
82
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<Props>) | ((props: ExecutionContext & Props) => ExecutionProps & Partial<Props>);
83
+ export type Attrs<Props extends BaseObject = BaseObject> = (ExecutionProps & Partial<OverrideStyle<Props>>) | ((props: ExecutionContext & Props) => ExecutionProps & Partial<OverrideStyle<Props>>);
84
84
  export type RuleSet<Props extends BaseObject = BaseObject> = Interpolation<Props>[];
85
85
  export type Styles<Props extends BaseObject> = TemplateStringsArray | StyledObject<Props> | StyleFunction<Props>;
86
86
  export type NameGenerator = (hash: number) => string;
@@ -118,10 +118,10 @@ export interface IStyledStatics<R extends Runtime, OuterProps extends BaseObject
118
118
  /**
119
119
  * Used by PolymorphicComponent to define prop override cascading order.
120
120
  */
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> : {}> = 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
@@ -167,6 +167,14 @@ export interface IInlineStyle<Props extends BaseObject> {
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
  };
@@ -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" | "input" | "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" | "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" | "circle" | "clipPath" | "defs" | "ellipse" | "foreignObject" | "image" | "line" | "linearGradient" | "marker" | "mask" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "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];
@@ -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.2.0",
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,17 +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
26
  "size": "bundlewatch",
27
27
  "prettier": "prettier src --write",
28
28
  "prettier:check": "prettier src --check",
29
- "prepublishOnly": "cp ../../README.md . && yarn run build"
29
+ "prepublishOnly": "cp ../../README.md . && pnpm run build"
30
30
  },
31
31
  "repository": {
32
32
  "type": "git",
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: {};
@@ -1,17 +0,0 @@
1
- import { Attrs, BaseObject, ExecutionProps, Interpolation, IStyledComponent, IStyledComponentFactory, KnownTarget, NoInfer, Runtime, StyledOptions, StyledTarget, Styles, Substitute } from '../types';
2
- type AttrsResult<T extends Attrs<any>> = T extends (...args: any) => infer P ? P extends object ? P : never : T extends object ? T : never;
3
- /**
4
- * Based on Attrs being a simple object or function that returns
5
- * a prop object, inspect the attrs result and attempt to extract
6
- * any "as" prop usage to modify the runtime target.
7
- */
8
- type AttrsTarget<R extends Runtime, T extends Attrs<any>, FallbackTarget extends StyledTarget<R>, Result extends ExecutionProps = AttrsResult<T>> = Result extends {
9
- as: infer RuntimeTarget;
10
- } ? RuntimeTarget extends KnownTarget ? RuntimeTarget : FallbackTarget : FallbackTarget;
11
- export interface Styled<R extends Runtime, Target extends StyledTarget<R>, OuterProps extends object, OuterStatics extends object = BaseObject> {
12
- <Props extends object = BaseObject, Statics extends object = BaseObject>(initialStyles: Styles<Substitute<OuterProps, NoInfer<Props>>>, ...interpolations: Interpolation<Substitute<OuterProps, NoInfer<Props>>>[]): IStyledComponent<R, Substitute<OuterProps, Props>> & OuterStatics & Statics & (R extends 'web' ? Target extends string ? {} : Omit<Target, keyof React.Component<any>> : {});
13
- attrs: <Props extends object = BaseObject, PrivateMergedProps extends object = Substitute<OuterProps, Props>, PrivateAttrsArg extends Attrs<PrivateMergedProps> = Attrs<PrivateMergedProps>, PrivateResolvedTarget extends StyledTarget<R> = AttrsTarget<R, PrivateAttrsArg, Target>>(attrs: PrivateAttrsArg) => Styled<R, PrivateResolvedTarget, PrivateResolvedTarget extends KnownTarget ? Substitute<Substitute<OuterProps, React.ComponentPropsWithRef<PrivateResolvedTarget>>, Props> : PrivateMergedProps, OuterStatics>;
14
- withConfig: (config: StyledOptions<R, OuterProps>) => Styled<R, Target, OuterProps, OuterStatics>;
15
- }
16
- export default function constructWithOptions<R extends Runtime, Target extends StyledTarget<R>, OuterProps extends object = Target extends KnownTarget ? React.ComponentPropsWithRef<Target> : BaseObject, OuterStatics extends object = BaseObject>(componentConstructor: IStyledComponentFactory<R, StyledTarget<R>, object, any>, tag: StyledTarget<R>, options?: StyledOptions<R, OuterProps>): Styled<R, Target, OuterProps, OuterStatics>;
17
- export {};
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { ExecutionProps, Interpolation, Styles } from '../types';
3
- export default function createGlobalStyle<Props extends object>(strings: Styles<Props>, ...interpolations: Array<Interpolation<Props>>): React.NamedExoticComponent<ExecutionProps & Props>;
@@ -1,4 +0,0 @@
1
- import { Interpolation, NoInfer, RuleSet, Styles } from '../types';
2
- declare function css(styles: Styles<object>, ...interpolations: Interpolation<object>[]): RuleSet<object>;
3
- declare function css<Props extends object>(styles: Styles<NoInfer<Props>>, ...interpolations: Interpolation<NoInfer<Props>>[]): RuleSet<NoInfer<Props>>;
4
- export default css;
@@ -1,3 +0,0 @@
1
- import Keyframes from '../models/Keyframes';
2
- import { Interpolation, Styles } from '../types';
3
- export default function keyframes<Props extends object = {}>(strings: Styles<Props>, ...interpolations: Array<Interpolation<Props>>): Keyframes;
@@ -1,17 +0,0 @@
1
- import * as React from 'react';
2
- import { BaseObject, KnownTarget, WebTarget } from '../types';
3
- import { SupportedHTMLElements } from '../utils/domElements';
4
- import { Styled as StyledInstance } from './constructWithOptions';
5
- declare const baseStyled: <Target extends WebTarget, InjectedProps extends object = BaseObject>(tag: Target) => StyledInstance<"web", Target, Target extends KnownTarget ? React.ComponentPropsWithRef<Target> & InjectedProps : InjectedProps, BaseObject>;
6
- declare const styled: typeof baseStyled & { [E in SupportedHTMLElements]: StyledInstance<"web", E, React.JSX.IntrinsicElements[E]>; };
7
- export default styled;
8
- export { StyledInstance };
9
- /**
10
- * This is the type of the `styled` HOC.
11
- */
12
- export type Styled = typeof styled;
13
- /**
14
- * Use this higher-order type for scenarios where you are wrapping `styled`
15
- * and providing extra props as a third-party library.
16
- */
17
- export type LibraryStyled<LibraryProps extends object = BaseObject> = <Target extends WebTarget>(tag: Target) => typeof baseStyled<Target, LibraryProps>;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { AnyComponent, ExecutionProps } from '../types';
3
- import { NonReactStatics } from '../utils/hoist';
4
- export default function withTheme<T extends AnyComponent>(Component: T): React.ForwardRefExoticComponent<React.PropsWithoutRef<React.ComponentPropsWithRef<T> & ExecutionProps> & React.RefAttributes<T>> & NonReactStatics<T>;
@@ -1,2 +0,0 @@
1
- import styled from './constructors/styled';
2
- export default styled;
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import styled, { LibraryStyled, Styled, StyledInstance } from './constructors/styled';
2
- export * from './base';
3
- export { CSSKeyframes, CSSObject, CSSProp, CSSProperties, CSSPseudos, DataAttributes, DefaultTheme, ExecutionContext, ExecutionProps, FastOmit, IStyledComponent, IStyledComponentFactory, IStyledStatics, Interpolation, PolymorphicComponent, PolymorphicComponentProps, RuleSet, Runtime, StyleFunction, StyledObject, StyledOptions, SupportedHTMLElements, WebTarget, } from './types';
4
- export { LibraryStyled, Styled, StyledInstance, styled as default, styled };
@@ -1,15 +0,0 @@
1
- import StyleSheet from '../sheet';
2
- import { ExecutionContext, RuleSet, Stringifier } from '../types';
3
- /**
4
- * ComponentStyle is all the CSS-specific stuff, not the React-specific stuff.
5
- */
6
- export default class ComponentStyle {
7
- baseHash: number;
8
- baseStyle: ComponentStyle | null | undefined;
9
- componentId: string;
10
- isStatic: boolean;
11
- rules: RuleSet<any>;
12
- staticRulesId: string;
13
- constructor(rules: RuleSet<any>, componentId: string, baseStyle?: ComponentStyle | undefined);
14
- generateAndInjectStyles(executionContext: ExecutionContext, styleSheet: StyleSheet, stylis: Stringifier): string;
15
- }
@@ -1,11 +0,0 @@
1
- import StyleSheet from '../sheet';
2
- import { ExecutionContext, RuleSet, Stringifier } from '../types';
3
- export default class GlobalStyle<Props extends object> {
4
- componentId: string;
5
- isStatic: boolean;
6
- rules: RuleSet<Props>;
7
- constructor(rules: RuleSet<Props>, componentId: string);
8
- createStyles(instance: number, executionContext: ExecutionContext & Props, styleSheet: StyleSheet, stylis: Stringifier): void;
9
- removeStyles(instance: number, styleSheet: StyleSheet): void;
10
- renderStyles(instance: number, executionContext: ExecutionContext & Props, styleSheet: StyleSheet, stylis: Stringifier): void;
11
- }
@@ -1,7 +0,0 @@
1
- import { IInlineStyleConstructor, StyleSheet } from '../types';
2
- export declare const RN_UNSUPPORTED_VALUES: string[];
3
- export declare const resetStyleCache: () => void;
4
- /**
5
- * InlineStyle takes arbitrary CSS and generates a flat object
6
- */
7
- export default function makeInlineStyleClass<Props extends object>(styleSheet: StyleSheet): IInlineStyleConstructor<Props>;
@@ -1,10 +0,0 @@
1
- import StyleSheet from '../sheet';
2
- import { Keyframes as KeyframesType, Stringifier } from '../types';
3
- export default class Keyframes implements KeyframesType {
4
- id: string;
5
- name: string;
6
- rules: string;
7
- constructor(name: string, rules: string);
8
- inject: (styleSheet: StyleSheet, stylisInstance?: Stringifier) => void;
9
- getName(stylisInstance?: Stringifier): string;
10
- }
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { type PipeableStream } from 'react-dom/server';
3
- import type * as streamInternal from 'stream';
4
- import StyleSheet from '../sheet';
5
- export default class ServerStyleSheet {
6
- instance: StyleSheet;
7
- sealed: boolean;
8
- constructor();
9
- _emitSheetCSS: () => string;
10
- collectStyles(children: any): React.JSX.Element;
11
- getStyleTags: () => string;
12
- getStyleElement: () => React.JSX.Element[];
13
- interleaveWithNodeStream(input: NodeJS.ReadableStream | PipeableStream): streamInternal.Transform;
14
- seal: () => void;
15
- }
@@ -1,65 +0,0 @@
1
- import React from 'react';
2
- import type stylis from 'stylis';
3
- import StyleSheet from '../sheet';
4
- import { InsertionTarget, ShouldForwardProp, Stringifier } from '../types';
5
- export declare const mainSheet: StyleSheet;
6
- export declare const mainStylis: Stringifier;
7
- export type IStyleSheetContext = {
8
- shouldForwardProp?: ShouldForwardProp<'web'> | undefined;
9
- styleSheet: StyleSheet;
10
- stylis: Stringifier;
11
- };
12
- export declare const StyleSheetContext: React.Context<IStyleSheetContext>;
13
- export declare const StyleSheetConsumer: React.Consumer<IStyleSheetContext>;
14
- export type IStylisContext = Stringifier | void;
15
- export declare const StylisContext: React.Context<IStylisContext>;
16
- export declare const StylisConsumer: React.Consumer<IStylisContext>;
17
- export declare function useStyleSheetContext(): IStyleSheetContext;
18
- export 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?: undefined | 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
- enableVendorPrefixes?: undefined | boolean;
30
- /**
31
- * Provide an optional selector to be prepended to all generated style rules.
32
- */
33
- namespace?: undefined | string;
34
- /**
35
- * Create and provide your own `StyleSheet` if necessary for advanced SSR scenarios.
36
- */
37
- sheet?: undefined | 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?: undefined | 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?: undefined | stylis.Middleware[];
60
- /**
61
- * Provide an alternate DOM node to host generated styles; useful for iframes.
62
- */
63
- target?: undefined | InsertionTarget;
64
- }>;
65
- export declare function StyleSheetManager(props: IStyleSheetManager): React.JSX.Element;
@@ -1,3 +0,0 @@
1
- import type { BaseObject, IStyledComponentFactory, RuleSet, StyledOptions, WebTarget } from '../types';
2
- declare function createStyledComponent<Target extends WebTarget, OuterProps extends BaseObject, Statics extends BaseObject = BaseObject>(target: Target, options: StyledOptions<'web', OuterProps>, rules: RuleSet<OuterProps>): ReturnType<IStyledComponentFactory<'web', Target, OuterProps, Statics>>;
3
- export default createStyledComponent;
@@ -1,3 +0,0 @@
1
- import type { BaseObject, ExecutionProps, IInlineStyleConstructor, IStyledComponentFactory, NativeTarget, RuleSet, StyledOptions } from '../types';
2
- declare const _default: (InlineStyle: IInlineStyleConstructor<any>) => <Target extends NativeTarget, OuterProps extends ExecutionProps, Statics extends object = BaseObject>(target: Target, options: StyledOptions<"native", OuterProps>, rules: RuleSet<OuterProps>) => ReturnType<IStyledComponentFactory<"native", Target, OuterProps, Statics>>;
3
- export default _default;
@@ -1,47 +0,0 @@
1
- import React from 'react';
2
- type DefaultThemeAsObject<T = object> = Record<keyof T, any>;
3
- /**
4
- * Override DefaultTheme to get accurate typings for your project.
5
- *
6
- * ```
7
- * // create styled-components.d.ts in your project source
8
- * // if it isn't being picked up, check tsconfig compilerOptions.types
9
- * import type { CSSProp } from "styled-components";
10
- * import Theme from './theme';
11
- *
12
- * type ThemeType = typeof Theme;
13
- *
14
- * declare module "styled-components" {
15
- * export interface DefaultTheme extends ThemeType {}
16
- * }
17
- *
18
- * declare module "react" {
19
- * interface DOMAttributes<T> {
20
- * css?: CSSProp;
21
- * }
22
- * }
23
- * ```
24
- */
25
- export interface DefaultTheme extends DefaultThemeAsObject {
26
- }
27
- type ThemeFn = (outerTheme?: DefaultTheme | undefined) => DefaultTheme;
28
- type ThemeArgument = DefaultTheme | ThemeFn;
29
- type Props = {
30
- children?: React.ReactNode;
31
- theme: ThemeArgument;
32
- };
33
- export declare const ThemeContext: React.Context<DefaultTheme | undefined>;
34
- export declare const ThemeConsumer: React.Consumer<DefaultTheme | undefined>;
35
- /**
36
- * Returns the current theme (as provided by the closest ancestor `ThemeProvider`.)
37
- *
38
- * If no `ThemeProvider` is found, the function will error. If you need access to the theme in an
39
- * uncertain composition scenario, `React.useContext(ThemeContext)` will not emit an error if there
40
- * is no `ThemeProvider` ancestor.
41
- */
42
- export declare function useTheme(): DefaultTheme;
43
- /**
44
- * Provide a theme to an entire react component tree via context
45
- */
46
- export default function ThemeProvider(props: Props): React.JSX.Element | null;
47
- export {};
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { Styled } from '../constructors/constructWithOptions';
3
- import css from '../constructors/css';
4
- import withTheme from '../hoc/withTheme';
5
- import ThemeProvider, { ThemeConsumer, ThemeContext, useTheme } from '../models/ThemeProvider';
6
- import { NativeTarget, RuleSet } from '../types';
7
- import isStyledComponent from '../utils/isStyledComponent';
8
- declare const reactNative: Awaited<typeof import("react-native")>;
9
- declare const baseStyled: <Target extends NativeTarget>(tag: Target) => Styled<"native", Target, Target extends import("../types").KnownTarget ? React.ComponentPropsWithRef<Target> : import("../types").BaseObject, import("../types").BaseObject>;
10
- declare const aliases: readonly ["ActivityIndicator", "Button", "DatePickerIOS", "DrawerLayoutAndroid", "FlatList", "Image", "ImageBackground", "KeyboardAvoidingView", "Modal", "Pressable", "ProgressBarAndroid", "ProgressViewIOS", "RefreshControl", "SafeAreaView", "ScrollView", "SectionList", "Slider", "Switch", "Text", "TextInput", "TouchableHighlight", "TouchableOpacity", "View", "VirtualizedList"];
11
- type KnownComponents = (typeof aliases)[number];
12
- /** Isolates RN-provided components since they don't expose a helper type for this. */
13
- type RNComponents = {
14
- [K in keyof typeof reactNative]: (typeof reactNative)[K] extends React.ComponentType<any> ? (typeof reactNative)[K] : never;
15
- };
16
- declare const styled: typeof baseStyled & { [E in KnownComponents]: Styled<"native", RNComponents[E], React.ComponentProps<RNComponents[E]>>; };
17
- declare const toStyleSheet: (rules: RuleSet<object>) => import("css-to-react-native").Style;
18
- export { CSSKeyframes, CSSObject, CSSProperties, CSSPseudos, DefaultTheme, ExecutionContext, ExecutionProps, IStyledComponent, IStyledComponentFactory, IStyledStatics, NativeTarget, PolymorphicComponent, PolymorphicComponentProps, Runtime, StyledObject, StyledOptions, } from '../types';
19
- export { ThemeConsumer, ThemeContext, ThemeProvider, css, styled as default, isStyledComponent, styled, toStyleSheet, useTheme, withTheme, };
@@ -1,5 +0,0 @@
1
- import StyleSheet from './sheet';
2
- export declare const __PRIVATE__: {
3
- StyleSheet: typeof StyleSheet;
4
- mainSheet: StyleSheet;
5
- };
@@ -1,4 +0,0 @@
1
- export declare const resetGroupIds: () => void;
2
- export declare const getGroupForId: (id: string) => number;
3
- export declare const getIdForGroup: (group: number) => void | string;
4
- export declare const setGroupForId: (id: string, group: number) => void;