styled-components 6.0.0-alpha.5 → 6.0.0-alpha.6

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 (310) hide show
  1. package/dist/constructors/constructWithOptions.d.ts +27 -14
  2. package/dist/constructors/css.d.ts +2 -2
  3. package/dist/constructors/styled.d.ts +178 -178
  4. package/dist/hoc/withTheme.d.ts +1 -1
  5. package/dist/native/index.d.ts +29 -53
  6. package/dist/sheet/Tag.d.ts +3 -3
  7. package/dist/sheet/dom.d.ts +1 -1
  8. package/dist/styled-components-macro.cjs.js +1 -1
  9. package/dist/styled-components-macro.cjs.js.map +1 -1
  10. package/dist/styled-components-macro.esm.js +1 -1
  11. package/dist/styled-components-macro.esm.js.map +1 -1
  12. package/dist/styled-components.browser.cjs.js +1 -1
  13. package/dist/styled-components.browser.cjs.js.map +1 -1
  14. package/dist/styled-components.browser.esm.js +1 -1
  15. package/dist/styled-components.browser.esm.js.map +1 -1
  16. package/dist/styled-components.cjs.js +1 -1
  17. package/dist/styled-components.cjs.js.map +1 -1
  18. package/dist/styled-components.esm.js +1 -1
  19. package/dist/styled-components.esm.js.map +1 -1
  20. package/dist/styled-components.js +1 -1
  21. package/dist/styled-components.js.map +1 -1
  22. package/dist/styled-components.min.js +1 -1
  23. package/dist/styled-components.min.js.map +1 -1
  24. package/dist/test/utils.d.ts +178 -178
  25. package/dist/tsconfig.tsbuildinfo +1 -1
  26. package/dist/types.d.ts +17 -20
  27. package/dist/utils/checkDynamicCreation.d.ts +1 -1
  28. package/dist/utils/flatten.d.ts +1 -1
  29. package/native/dist/constructors/constructWithOptions.d.ts +27 -14
  30. package/native/dist/constructors/css.d.ts +2 -2
  31. package/native/dist/constructors/styled.d.ts +178 -178
  32. package/native/dist/hoc/withTheme.d.ts +1 -1
  33. package/native/dist/native/index.d.ts +29 -53
  34. package/native/dist/sheet/Tag.d.ts +3 -3
  35. package/native/dist/sheet/dom.d.ts +1 -1
  36. package/native/dist/styled-components.native.cjs.js +404 -468
  37. package/native/dist/styled-components.native.cjs.js.map +1 -1
  38. package/native/dist/styled-components.native.esm.js +401 -465
  39. package/native/dist/styled-components.native.esm.js.map +1 -1
  40. package/native/dist/test/utils.d.ts +178 -178
  41. package/native/dist/types.d.ts +17 -20
  42. package/native/dist/utils/checkDynamicCreation.d.ts +1 -1
  43. package/native/dist/utils/flatten.d.ts +1 -1
  44. package/package.json +25 -29
  45. package/dist/primitives/index.d.ts +0 -23
  46. package/primitives/dist/base.d.ts +0 -18
  47. package/primitives/dist/base.d.ts.map +0 -1
  48. package/primitives/dist/constants.d.ts +0 -8
  49. package/primitives/dist/constants.d.ts.map +0 -1
  50. package/primitives/dist/constructors/constructWithOptions.d.ts +0 -19
  51. package/primitives/dist/constructors/constructWithOptions.d.ts.map +0 -1
  52. package/primitives/dist/constructors/createGlobalStyle.d.ts +0 -3
  53. package/primitives/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  54. package/primitives/dist/constructors/css.d.ts +0 -4
  55. package/primitives/dist/constructors/css.d.ts.map +0 -1
  56. package/primitives/dist/constructors/keyframes.d.ts +0 -3
  57. package/primitives/dist/constructors/keyframes.d.ts.map +0 -1
  58. package/primitives/dist/constructors/styled.d.ts +0 -185
  59. package/primitives/dist/constructors/styled.d.ts.map +0 -1
  60. package/primitives/dist/dist/base.d.ts +0 -18
  61. package/primitives/dist/dist/base.d.ts.map +0 -1
  62. package/primitives/dist/dist/constants.d.ts +0 -9
  63. package/primitives/dist/dist/constants.d.ts.map +0 -1
  64. package/primitives/dist/dist/constructors/constructWithOptions.d.ts +0 -20
  65. package/primitives/dist/dist/constructors/constructWithOptions.d.ts.map +0 -1
  66. package/primitives/dist/dist/constructors/createGlobalStyle.d.ts +0 -4
  67. package/primitives/dist/dist/constructors/createGlobalStyle.d.ts.map +0 -1
  68. package/primitives/dist/dist/constructors/css.d.ts +0 -5
  69. package/primitives/dist/dist/constructors/css.d.ts.map +0 -1
  70. package/primitives/dist/dist/constructors/keyframes.d.ts +0 -4
  71. package/primitives/dist/dist/constructors/keyframes.d.ts.map +0 -1
  72. package/primitives/dist/dist/constructors/styled.d.ts +0 -186
  73. package/primitives/dist/dist/constructors/styled.d.ts.map +0 -1
  74. package/primitives/dist/dist/hoc/withTheme.d.ts +0 -4
  75. package/primitives/dist/dist/hoc/withTheme.d.ts.map +0 -1
  76. package/primitives/dist/dist/hoc/withTheme.spec.d.ts +0 -2
  77. package/primitives/dist/dist/hoc/withTheme.spec.d.ts.map +0 -1
  78. package/primitives/dist/dist/hooks/useTheme.d.ts +0 -4
  79. package/primitives/dist/dist/hooks/useTheme.d.ts.map +0 -1
  80. package/primitives/dist/dist/index-standalone.d.ts +0 -3
  81. package/primitives/dist/dist/index-standalone.d.ts.map +0 -1
  82. package/primitives/dist/dist/index.d.ts +0 -4
  83. package/primitives/dist/dist/index.d.ts.map +0 -1
  84. package/primitives/dist/dist/macro/index.d.ts +0 -3
  85. package/primitives/dist/dist/macro/index.d.ts.map +0 -1
  86. package/primitives/dist/dist/macro/test/babel.config.d.ts +0 -1
  87. package/primitives/dist/dist/macro/test/babel.config.d.ts.map +0 -1
  88. package/primitives/dist/dist/models/ComponentStyle.d.ts +0 -16
  89. package/primitives/dist/dist/models/ComponentStyle.d.ts.map +0 -1
  90. package/primitives/dist/dist/models/GlobalStyle.d.ts +0 -12
  91. package/primitives/dist/dist/models/GlobalStyle.d.ts.map +0 -1
  92. package/primitives/dist/dist/models/InlineStyle.d.ts +0 -7
  93. package/primitives/dist/dist/models/InlineStyle.d.ts.map +0 -1
  94. package/primitives/dist/dist/models/Keyframes.d.ts +0 -12
  95. package/primitives/dist/dist/models/Keyframes.d.ts.map +0 -1
  96. package/primitives/dist/dist/models/ServerStyleSheet.d.ts +0 -16
  97. package/primitives/dist/dist/models/ServerStyleSheet.d.ts.map +0 -1
  98. package/primitives/dist/dist/models/StyleSheetManager.d.ts +0 -22
  99. package/primitives/dist/dist/models/StyleSheetManager.d.ts.map +0 -1
  100. package/primitives/dist/dist/models/StyledComponent.d.ts +0 -4
  101. package/primitives/dist/dist/models/StyledComponent.d.ts.map +0 -1
  102. package/primitives/dist/dist/models/StyledNativeComponent.d.ts +0 -4
  103. package/primitives/dist/dist/models/StyledNativeComponent.d.ts.map +0 -1
  104. package/primitives/dist/dist/models/ThemeProvider.d.ts +0 -18
  105. package/primitives/dist/dist/models/ThemeProvider.d.ts.map +0 -1
  106. package/primitives/dist/dist/native/index.d.ts +0 -65
  107. package/primitives/dist/dist/native/index.d.ts.map +0 -1
  108. package/primitives/dist/dist/primitives/index.d.ts +0 -23
  109. package/primitives/dist/dist/primitives/index.d.ts.map +0 -1
  110. package/primitives/dist/dist/secretInternals.d.ts +0 -6
  111. package/primitives/dist/dist/secretInternals.d.ts.map +0 -1
  112. package/primitives/dist/dist/sheet/GroupIDAllocator.d.ts +0 -5
  113. package/primitives/dist/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  114. package/primitives/dist/dist/sheet/GroupedTag.d.ts +0 -12
  115. package/primitives/dist/dist/sheet/GroupedTag.d.ts.map +0 -1
  116. package/primitives/dist/dist/sheet/Rehydration.d.ts +0 -4
  117. package/primitives/dist/dist/sheet/Rehydration.d.ts.map +0 -1
  118. package/primitives/dist/dist/sheet/Sheet.d.ts +0 -41
  119. package/primitives/dist/dist/sheet/Sheet.d.ts.map +0 -1
  120. package/primitives/dist/dist/sheet/Tag.d.ts +0 -55
  121. package/primitives/dist/dist/sheet/Tag.d.ts.map +0 -1
  122. package/primitives/dist/dist/sheet/dom.d.ts +0 -5
  123. package/primitives/dist/dist/sheet/dom.d.ts.map +0 -1
  124. package/primitives/dist/dist/sheet/index.d.ts +0 -2
  125. package/primitives/dist/dist/sheet/index.d.ts.map +0 -1
  126. package/primitives/dist/dist/sheet/types.d.ts +0 -35
  127. package/primitives/dist/dist/sheet/types.d.ts.map +0 -1
  128. package/primitives/dist/dist/test/globals.d.ts +0 -3
  129. package/primitives/dist/dist/test/globals.d.ts.map +0 -1
  130. package/primitives/dist/dist/test/utils.d.ts +0 -192
  131. package/primitives/dist/dist/test/utils.d.ts.map +0 -1
  132. package/primitives/dist/dist/types.d.ts +0 -121
  133. package/primitives/dist/dist/types.d.ts.map +0 -1
  134. package/primitives/dist/dist/utils/addUnitIfNeeded.d.ts +0 -2
  135. package/primitives/dist/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  136. package/primitives/dist/dist/utils/checkDynamicCreation.d.ts +0 -2
  137. package/primitives/dist/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  138. package/primitives/dist/dist/utils/createWarnTooManyClasses.d.ts +0 -4
  139. package/primitives/dist/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  140. package/primitives/dist/dist/utils/determineTheme.d.ts +0 -3
  141. package/primitives/dist/dist/utils/determineTheme.d.ts.map +0 -1
  142. package/primitives/dist/dist/utils/domElements.d.ts +0 -3
  143. package/primitives/dist/dist/utils/domElements.d.ts.map +0 -1
  144. package/primitives/dist/dist/utils/empties.d.ts +0 -4
  145. package/primitives/dist/dist/utils/empties.d.ts.map +0 -1
  146. package/primitives/dist/dist/utils/error.d.ts +0 -6
  147. package/primitives/dist/dist/utils/error.d.ts.map +0 -1
  148. package/primitives/dist/dist/utils/errors.d.ts +0 -21
  149. package/primitives/dist/dist/utils/errors.d.ts.map +0 -1
  150. package/primitives/dist/dist/utils/escape.d.ts +0 -6
  151. package/primitives/dist/dist/utils/escape.d.ts.map +0 -1
  152. package/primitives/dist/dist/utils/flatten.d.ts +0 -5
  153. package/primitives/dist/dist/utils/flatten.d.ts.map +0 -1
  154. package/primitives/dist/dist/utils/generateAlphabeticName.d.ts +0 -2
  155. package/primitives/dist/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  156. package/primitives/dist/dist/utils/generateComponentId.d.ts +0 -2
  157. package/primitives/dist/dist/utils/generateComponentId.d.ts.map +0 -1
  158. package/primitives/dist/dist/utils/generateDisplayName.d.ts +0 -3
  159. package/primitives/dist/dist/utils/generateDisplayName.d.ts.map +0 -1
  160. package/primitives/dist/dist/utils/getComponentName.d.ts +0 -3
  161. package/primitives/dist/dist/utils/getComponentName.d.ts.map +0 -1
  162. package/primitives/dist/dist/utils/hash.d.ts +0 -4
  163. package/primitives/dist/dist/utils/hash.d.ts.map +0 -1
  164. package/primitives/dist/dist/utils/hoist.d.ts +0 -52
  165. package/primitives/dist/dist/utils/hoist.d.ts.map +0 -1
  166. package/primitives/dist/dist/utils/hyphenateStyleName.d.ts +0 -15
  167. package/primitives/dist/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  168. package/primitives/dist/dist/utils/interleave.d.ts +0 -3
  169. package/primitives/dist/dist/utils/interleave.d.ts.map +0 -1
  170. package/primitives/dist/dist/utils/isFunction.d.ts +0 -2
  171. package/primitives/dist/dist/utils/isFunction.d.ts.map +0 -1
  172. package/primitives/dist/dist/utils/isPlainObject.d.ts +0 -2
  173. package/primitives/dist/dist/utils/isPlainObject.d.ts.map +0 -1
  174. package/primitives/dist/dist/utils/isStatelessFunction.d.ts +0 -2
  175. package/primitives/dist/dist/utils/isStatelessFunction.d.ts.map +0 -1
  176. package/primitives/dist/dist/utils/isStaticRules.d.ts +0 -3
  177. package/primitives/dist/dist/utils/isStaticRules.d.ts.map +0 -1
  178. package/primitives/dist/dist/utils/isStyledComponent.d.ts +0 -3
  179. package/primitives/dist/dist/utils/isStyledComponent.d.ts.map +0 -1
  180. package/primitives/dist/dist/utils/isTag.d.ts +0 -3
  181. package/primitives/dist/dist/utils/isTag.d.ts.map +0 -1
  182. package/primitives/dist/dist/utils/joinStrings.d.ts +0 -5
  183. package/primitives/dist/dist/utils/joinStrings.d.ts.map +0 -1
  184. package/primitives/dist/dist/utils/mixinDeep.d.ts +0 -8
  185. package/primitives/dist/dist/utils/mixinDeep.d.ts.map +0 -1
  186. package/primitives/dist/dist/utils/nonce.d.ts +0 -2
  187. package/primitives/dist/dist/utils/nonce.d.ts.map +0 -1
  188. package/primitives/dist/dist/utils/stylis.d.ts +0 -10
  189. package/primitives/dist/dist/utils/stylis.d.ts.map +0 -1
  190. package/primitives/dist/hoc/withTheme.d.ts +0 -3
  191. package/primitives/dist/hoc/withTheme.d.ts.map +0 -1
  192. package/primitives/dist/hoc/withTheme.spec.d.ts +0 -1
  193. package/primitives/dist/hoc/withTheme.spec.d.ts.map +0 -1
  194. package/primitives/dist/hooks/useTheme.d.ts +0 -3
  195. package/primitives/dist/hooks/useTheme.d.ts.map +0 -1
  196. package/primitives/dist/index-standalone.d.ts +0 -2
  197. package/primitives/dist/index-standalone.d.ts.map +0 -1
  198. package/primitives/dist/index.d.ts +0 -4
  199. package/primitives/dist/index.d.ts.map +0 -1
  200. package/primitives/dist/macro/index.d.ts +0 -2
  201. package/primitives/dist/macro/index.d.ts.map +0 -1
  202. package/primitives/dist/macro/test/babel.config.d.ts +0 -1
  203. package/primitives/dist/macro/test/babel.config.d.ts.map +0 -1
  204. package/primitives/dist/models/ComponentStyle.d.ts +0 -15
  205. package/primitives/dist/models/ComponentStyle.d.ts.map +0 -1
  206. package/primitives/dist/models/GlobalStyle.d.ts +0 -11
  207. package/primitives/dist/models/GlobalStyle.d.ts.map +0 -1
  208. package/primitives/dist/models/InlineStyle.d.ts +0 -6
  209. package/primitives/dist/models/InlineStyle.d.ts.map +0 -1
  210. package/primitives/dist/models/Keyframes.d.ts +0 -11
  211. package/primitives/dist/models/Keyframes.d.ts.map +0 -1
  212. package/primitives/dist/models/ServerStyleSheet.d.ts +0 -15
  213. package/primitives/dist/models/ServerStyleSheet.d.ts.map +0 -1
  214. package/primitives/dist/models/StyleSheetManager.d.ts +0 -21
  215. package/primitives/dist/models/StyleSheetManager.d.ts.map +0 -1
  216. package/primitives/dist/models/StyledComponent.d.ts +0 -3
  217. package/primitives/dist/models/StyledComponent.d.ts.map +0 -1
  218. package/primitives/dist/models/StyledNativeComponent.d.ts +0 -3
  219. package/primitives/dist/models/StyledNativeComponent.d.ts.map +0 -1
  220. package/primitives/dist/models/ThemeProvider.d.ts +0 -39
  221. package/primitives/dist/models/ThemeProvider.d.ts.map +0 -1
  222. package/primitives/dist/native/index.d.ts +0 -65
  223. package/primitives/dist/native/index.d.ts.map +0 -1
  224. package/primitives/dist/primitives/index.d.ts +0 -23
  225. package/primitives/dist/primitives/index.d.ts.map +0 -1
  226. package/primitives/dist/secretInternals.d.ts +0 -5
  227. package/primitives/dist/secretInternals.d.ts.map +0 -1
  228. package/primitives/dist/sheet/GroupIDAllocator.d.ts +0 -4
  229. package/primitives/dist/sheet/GroupIDAllocator.d.ts.map +0 -1
  230. package/primitives/dist/sheet/GroupedTag.d.ts +0 -11
  231. package/primitives/dist/sheet/GroupedTag.d.ts.map +0 -1
  232. package/primitives/dist/sheet/Rehydration.d.ts +0 -3
  233. package/primitives/dist/sheet/Rehydration.d.ts.map +0 -1
  234. package/primitives/dist/sheet/Sheet.d.ts +0 -40
  235. package/primitives/dist/sheet/Sheet.d.ts.map +0 -1
  236. package/primitives/dist/sheet/Tag.d.ts +0 -54
  237. package/primitives/dist/sheet/Tag.d.ts.map +0 -1
  238. package/primitives/dist/sheet/dom.d.ts +0 -4
  239. package/primitives/dist/sheet/dom.d.ts.map +0 -1
  240. package/primitives/dist/sheet/index.d.ts +0 -1
  241. package/primitives/dist/sheet/index.d.ts.map +0 -1
  242. package/primitives/dist/sheet/types.d.ts +0 -34
  243. package/primitives/dist/sheet/types.d.ts.map +0 -1
  244. package/primitives/dist/styled-components-primitives.cjs.js +0 -1292
  245. package/primitives/dist/styled-components-primitives.cjs.js.map +0 -1
  246. package/primitives/dist/styled-components-primitives.esm.js +0 -1274
  247. package/primitives/dist/styled-components-primitives.esm.js.map +0 -1
  248. package/primitives/dist/test/globals.d.ts +0 -2
  249. package/primitives/dist/test/globals.d.ts.map +0 -1
  250. package/primitives/dist/test/utils.d.ts +0 -191
  251. package/primitives/dist/test/utils.d.ts.map +0 -1
  252. package/primitives/dist/types.d.ts +0 -143
  253. package/primitives/dist/types.d.ts.map +0 -1
  254. package/primitives/dist/utils/addUnitIfNeeded.d.ts +0 -1
  255. package/primitives/dist/utils/addUnitIfNeeded.d.ts.map +0 -1
  256. package/primitives/dist/utils/checkDynamicCreation.d.ts +0 -1
  257. package/primitives/dist/utils/checkDynamicCreation.d.ts.map +0 -1
  258. package/primitives/dist/utils/createWarnTooManyClasses.d.ts +0 -3
  259. package/primitives/dist/utils/createWarnTooManyClasses.d.ts.map +0 -1
  260. package/primitives/dist/utils/determineTheme.d.ts +0 -2
  261. package/primitives/dist/utils/determineTheme.d.ts.map +0 -1
  262. package/primitives/dist/utils/domElements.d.ts +0 -2
  263. package/primitives/dist/utils/domElements.d.ts.map +0 -1
  264. package/primitives/dist/utils/empties.d.ts +0 -3
  265. package/primitives/dist/utils/empties.d.ts.map +0 -1
  266. package/primitives/dist/utils/error.d.ts +0 -5
  267. package/primitives/dist/utils/error.d.ts.map +0 -1
  268. package/primitives/dist/utils/errors.d.ts +0 -20
  269. package/primitives/dist/utils/errors.d.ts.map +0 -1
  270. package/primitives/dist/utils/escape.d.ts +0 -5
  271. package/primitives/dist/utils/escape.d.ts.map +0 -1
  272. package/primitives/dist/utils/flatten.d.ts +0 -4
  273. package/primitives/dist/utils/flatten.d.ts.map +0 -1
  274. package/primitives/dist/utils/generateAlphabeticName.d.ts +0 -1
  275. package/primitives/dist/utils/generateAlphabeticName.d.ts.map +0 -1
  276. package/primitives/dist/utils/generateComponentId.d.ts +0 -1
  277. package/primitives/dist/utils/generateComponentId.d.ts.map +0 -1
  278. package/primitives/dist/utils/generateDisplayName.d.ts +0 -2
  279. package/primitives/dist/utils/generateDisplayName.d.ts.map +0 -1
  280. package/primitives/dist/utils/getComponentName.d.ts +0 -2
  281. package/primitives/dist/utils/getComponentName.d.ts.map +0 -1
  282. package/primitives/dist/utils/hash.d.ts +0 -3
  283. package/primitives/dist/utils/hash.d.ts.map +0 -1
  284. package/primitives/dist/utils/hoist.d.ts +0 -51
  285. package/primitives/dist/utils/hoist.d.ts.map +0 -1
  286. package/primitives/dist/utils/hyphenateStyleName.d.ts +0 -14
  287. package/primitives/dist/utils/hyphenateStyleName.d.ts.map +0 -1
  288. package/primitives/dist/utils/interleave.d.ts +0 -2
  289. package/primitives/dist/utils/interleave.d.ts.map +0 -1
  290. package/primitives/dist/utils/isFunction.d.ts +0 -1
  291. package/primitives/dist/utils/isFunction.d.ts.map +0 -1
  292. package/primitives/dist/utils/isPlainObject.d.ts +0 -1
  293. package/primitives/dist/utils/isPlainObject.d.ts.map +0 -1
  294. package/primitives/dist/utils/isStatelessFunction.d.ts +0 -1
  295. package/primitives/dist/utils/isStatelessFunction.d.ts.map +0 -1
  296. package/primitives/dist/utils/isStaticRules.d.ts +0 -2
  297. package/primitives/dist/utils/isStaticRules.d.ts.map +0 -1
  298. package/primitives/dist/utils/isStyledComponent.d.ts +0 -2
  299. package/primitives/dist/utils/isStyledComponent.d.ts.map +0 -1
  300. package/primitives/dist/utils/isTag.d.ts +0 -2
  301. package/primitives/dist/utils/isTag.d.ts.map +0 -1
  302. package/primitives/dist/utils/joinStrings.d.ts +0 -4
  303. package/primitives/dist/utils/joinStrings.d.ts.map +0 -1
  304. package/primitives/dist/utils/mixinDeep.d.ts +0 -7
  305. package/primitives/dist/utils/mixinDeep.d.ts.map +0 -1
  306. package/primitives/dist/utils/nonce.d.ts +0 -1
  307. package/primitives/dist/utils/nonce.d.ts.map +0 -1
  308. package/primitives/dist/utils/stylis.d.ts +0 -9
  309. package/primitives/dist/utils/stylis.d.ts.map +0 -1
  310. package/primitives/package.json +0 -8
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var tslib = require('tslib');
6
5
  var React = require('react');
7
6
  require('shallowequal');
8
7
  var stylis = require('stylis');
@@ -16,8 +15,8 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
15
  var unitless__default = /*#__PURE__*/_interopDefaultLegacy(unitless);
17
16
  var transformDeclPairs__default = /*#__PURE__*/_interopDefaultLegacy(transformDeclPairs);
18
17
 
19
- var EMPTY_ARRAY = Object.freeze([]);
20
- var EMPTY_OBJECT = Object.freeze({});
18
+ const EMPTY_ARRAY = Object.freeze([]);
19
+ const EMPTY_OBJECT = Object.freeze({});
21
20
 
22
21
  var errorMap = {
23
22
  '1': 'Cannot create styled-component for component: %s.\n\n',
@@ -39,21 +38,17 @@ var errorMap = {
39
38
  '17': "CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",
40
39
  };
41
40
 
42
- var ERRORS = process.env.NODE_ENV !== 'production' ? errorMap : {};
41
+ const ERRORS = process.env.NODE_ENV !== 'production' ? errorMap : {};
43
42
  /**
44
43
  * super basic version of sprintf
45
44
  */
46
- function format() {
47
- var args = [];
48
- for (var _i = 0; _i < arguments.length; _i++) {
49
- args[_i] = arguments[_i];
50
- }
51
- var a = args[0];
52
- var b = [];
53
- for (var c = 1, len = args.length; c < len; c += 1) {
45
+ function format(...args) {
46
+ let a = args[0];
47
+ const b = [];
48
+ for (let c = 1, len = args.length; c < len; c += 1) {
54
49
  b.push(args[c]);
55
50
  }
56
- b.forEach(function (d) {
51
+ b.forEach(d => {
57
52
  a = a.replace(/%[a-z]/, d);
58
53
  });
59
54
  return a;
@@ -62,27 +57,23 @@ function format() {
62
57
  * Create an error file out of errors.md for development and a simple web link to the full errors
63
58
  * in production mode.
64
59
  */
65
- function throwStyledComponentsError(code) {
66
- var interpolations = [];
67
- for (var _i = 1; _i < arguments.length; _i++) {
68
- interpolations[_i - 1] = arguments[_i];
69
- }
60
+ function throwStyledComponentsError(code, ...interpolations) {
70
61
  if (process.env.NODE_ENV === 'production') {
71
- return new Error("An error occurred. See https://git.io/JUIaE#".concat(code, " for more information.").concat(interpolations.length > 0 ? " Args: ".concat(interpolations.join(', ')) : ''));
62
+ return new Error(`An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${code} for more information.${interpolations.length > 0 ? ` Args: ${interpolations.join(', ')}` : ''}`);
72
63
  }
73
64
  else {
74
- return new Error(format.apply(void 0, tslib.__spreadArray([ERRORS[code]], tslib.__read(interpolations), false)).trim());
65
+ return new Error(format(ERRORS[code], ...interpolations).trim());
75
66
  }
76
67
  }
77
68
 
78
- var SC_ATTR = (typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR)) ||
69
+ const SC_ATTR = (typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR)) ||
79
70
  'data-styled';
80
- var SC_ATTR_ACTIVE = 'active';
81
- var SC_ATTR_VERSION = 'data-styled-version';
82
- var SC_VERSION = "6.0.0-alpha.5";
83
- var SPLITTER = '/*!sc*/\n';
84
- var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
85
- var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
71
+ const SC_ATTR_ACTIVE = 'active';
72
+ const SC_ATTR_VERSION = 'data-styled-version';
73
+ const SC_VERSION = "6.0.0-alpha.6";
74
+ const SPLITTER = '/*!sc*/\n';
75
+ const IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
76
+ const DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
86
77
  ? SC_DISABLE_SPEEDY
87
78
  : typeof process !== 'undefined' &&
88
79
  typeof process.env.REACT_APP_SC_DISABLE_SPEEDY !== 'undefined' &&
@@ -99,44 +90,47 @@ var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
99
90
  : process.env.NODE_ENV !== 'production');
100
91
 
101
92
  /** Create a GroupedTag with an underlying Tag implementation */
102
- var makeGroupedTag = function (tag) {
93
+ const makeGroupedTag = (tag) => {
103
94
  return new DefaultGroupedTag(tag);
104
95
  };
105
- var BASE_SIZE = 1 << 9;
106
- var DefaultGroupedTag = /** @class */ (function () {
107
- function DefaultGroupedTag(tag) {
96
+ const BASE_SIZE = 1 << 9;
97
+ const DefaultGroupedTag = class DefaultGroupedTag {
98
+ groupSizes;
99
+ length;
100
+ tag;
101
+ constructor(tag) {
108
102
  this.groupSizes = new Uint32Array(BASE_SIZE);
109
103
  this.length = BASE_SIZE;
110
104
  this.tag = tag;
111
105
  }
112
- DefaultGroupedTag.prototype.indexOfGroup = function (group) {
113
- var index = 0;
114
- for (var i = 0; i < group; i++) {
106
+ indexOfGroup(group) {
107
+ let index = 0;
108
+ for (let i = 0; i < group; i++) {
115
109
  index += this.groupSizes[i];
116
110
  }
117
111
  return index;
118
- };
119
- DefaultGroupedTag.prototype.insertRules = function (group, rules) {
112
+ }
113
+ insertRules(group, rules) {
120
114
  if (group >= this.groupSizes.length) {
121
- var oldBuffer = this.groupSizes;
122
- var oldSize = oldBuffer.length;
123
- var newSize = oldSize;
115
+ const oldBuffer = this.groupSizes;
116
+ const oldSize = oldBuffer.length;
117
+ let newSize = oldSize;
124
118
  while (group >= newSize) {
125
119
  newSize <<= 1;
126
120
  if (newSize < 0) {
127
- throw throwStyledComponentsError(16, "".concat(group));
121
+ throw throwStyledComponentsError(16, `${group}`);
128
122
  }
129
123
  }
130
124
  this.groupSizes = new Uint32Array(newSize);
131
125
  this.groupSizes.set(oldBuffer);
132
126
  this.length = newSize;
133
- for (var i = oldSize; i < newSize; i++) {
127
+ for (let i = oldSize; i < newSize; i++) {
134
128
  this.groupSizes[i] = 0;
135
129
  }
136
130
  }
137
- var ruleIndex = this.indexOfGroup(group + 1);
131
+ let ruleIndex = this.indexOfGroup(group + 1);
138
132
  if (Array.isArray(rules)) {
139
- for (var i = 0, l = rules.length; i < l; i++) {
133
+ for (let i = 0, l = rules.length; i < l; i++) {
140
134
  if (this.tag.insertRule(ruleIndex, rules[i])) {
141
135
  this.groupSizes[group]++;
142
136
  ruleIndex++;
@@ -148,115 +142,110 @@ var DefaultGroupedTag = /** @class */ (function () {
148
142
  this.groupSizes[group]++;
149
143
  }
150
144
  }
151
- };
152
- DefaultGroupedTag.prototype.clearGroup = function (group) {
145
+ }
146
+ clearGroup(group) {
153
147
  if (group < this.length) {
154
- var length_1 = this.groupSizes[group];
155
- var startIndex = this.indexOfGroup(group);
156
- var endIndex = startIndex + length_1;
148
+ const length = this.groupSizes[group];
149
+ const startIndex = this.indexOfGroup(group);
150
+ const endIndex = startIndex + length;
157
151
  this.groupSizes[group] = 0;
158
- for (var i = startIndex; i < endIndex; i++) {
152
+ for (let i = startIndex; i < endIndex; i++) {
159
153
  this.tag.deleteRule(startIndex);
160
154
  }
161
155
  }
162
- };
163
- DefaultGroupedTag.prototype.getGroup = function (group) {
164
- var css = '';
156
+ }
157
+ getGroup(group) {
158
+ let css = '';
165
159
  if (group >= this.length || this.groupSizes[group] === 0) {
166
160
  return css;
167
161
  }
168
- var length = this.groupSizes[group];
169
- var startIndex = this.indexOfGroup(group);
170
- var endIndex = startIndex + length;
171
- for (var i = startIndex; i < endIndex; i++) {
172
- css += "".concat(this.tag.getRule(i)).concat(SPLITTER);
162
+ const length = this.groupSizes[group];
163
+ const startIndex = this.indexOfGroup(group);
164
+ const endIndex = startIndex + length;
165
+ for (let i = startIndex; i < endIndex; i++) {
166
+ css += `${this.tag.getRule(i)}${SPLITTER}`;
173
167
  }
174
168
  return css;
175
- };
176
- return DefaultGroupedTag;
177
- }());
169
+ }
170
+ };
178
171
 
179
- var MAX_SMI = 1 << (31 - 1);
180
- var groupIDRegister = new Map();
181
- var reverseRegister = new Map();
182
- var nextFreeGroup = 1;
183
- var getGroupForId = function (id) {
172
+ const MAX_SMI = 1 << (31 - 1);
173
+ let groupIDRegister = new Map();
174
+ let reverseRegister = new Map();
175
+ let nextFreeGroup = 1;
176
+ const getGroupForId = (id) => {
184
177
  if (groupIDRegister.has(id)) {
185
178
  return groupIDRegister.get(id);
186
179
  }
187
180
  while (reverseRegister.has(nextFreeGroup)) {
188
181
  nextFreeGroup++;
189
182
  }
190
- var group = nextFreeGroup++;
183
+ const group = nextFreeGroup++;
191
184
  if (process.env.NODE_ENV !== 'production' && ((group | 0) < 0 || group > MAX_SMI)) {
192
- throw throwStyledComponentsError(16, "".concat(group));
185
+ throw throwStyledComponentsError(16, `${group}`);
193
186
  }
194
187
  groupIDRegister.set(id, group);
195
188
  reverseRegister.set(group, id);
196
189
  return group;
197
190
  };
198
- var getIdForGroup = function (group) {
191
+ const getIdForGroup = (group) => {
199
192
  return reverseRegister.get(group);
200
193
  };
201
- var setGroupForId = function (id, group) {
194
+ const setGroupForId = (id, group) => {
202
195
  groupIDRegister.set(id, group);
203
196
  reverseRegister.set(group, id);
204
197
  };
205
198
 
206
- var SELECTOR = "style[".concat(SC_ATTR, "][").concat(SC_ATTR_VERSION, "=\"").concat(SC_VERSION, "\"]");
207
- var MARKER_RE = new RegExp("^".concat(SC_ATTR, "\\.g(\\d+)\\[id=\"([\\w\\d-]+)\"\\].*?\"([^\"]*)"));
208
- var outputSheet = function (sheet) {
209
- var tag = sheet.getTag();
210
- var length = tag.length;
211
- var css = '';
212
- var _loop_1 = function (group) {
213
- var id = getIdForGroup(group);
199
+ const SELECTOR = `style[${SC_ATTR}][${SC_ATTR_VERSION}="${SC_VERSION}"]`;
200
+ const MARKER_RE = new RegExp(`^${SC_ATTR}\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)`);
201
+ const outputSheet = (sheet) => {
202
+ const tag = sheet.getTag();
203
+ const { length } = tag;
204
+ let css = '';
205
+ for (let group = 0; group < length; group++) {
206
+ const id = getIdForGroup(group);
214
207
  if (id === undefined)
215
- return "continue";
216
- var names = sheet.names.get(id);
217
- var rules = tag.getGroup(group);
208
+ continue;
209
+ const names = sheet.names.get(id);
210
+ const rules = tag.getGroup(group);
218
211
  if (names === undefined || rules.length === 0)
219
- return "continue";
220
- var selector = "".concat(SC_ATTR, ".g").concat(group, "[id=\"").concat(id, "\"]");
221
- var content = '';
212
+ continue;
213
+ const selector = `${SC_ATTR}.g${group}[id="${id}"]`;
214
+ let content = '';
222
215
  if (names !== undefined) {
223
- names.forEach(function (name) {
216
+ names.forEach(name => {
224
217
  if (name.length > 0) {
225
- content += "".concat(name, ",");
218
+ content += `${name},`;
226
219
  }
227
220
  });
228
221
  }
229
222
  // NOTE: It's easier to collect rules and have the marker
230
223
  // after the actual rules to simplify the rehydration
231
- css += "".concat(rules).concat(selector, "{content:\"").concat(content, "\"}").concat(SPLITTER);
232
- };
233
- for (var group = 0; group < length; group++) {
234
- _loop_1(group);
224
+ css += `${rules}${selector}{content:"${content}"}${SPLITTER}`;
235
225
  }
236
226
  return css;
237
227
  };
238
- var rehydrateNamesFromContent = function (sheet, id, content) {
239
- var names = content.split(',');
240
- var name;
241
- for (var i = 0, l = names.length; i < l; i++) {
228
+ const rehydrateNamesFromContent = (sheet, id, content) => {
229
+ const names = content.split(',');
230
+ let name;
231
+ for (let i = 0, l = names.length; i < l; i++) {
242
232
  // eslint-disable-next-line
243
233
  if ((name = names[i])) {
244
234
  sheet.registerName(id, name);
245
235
  }
246
236
  }
247
237
  };
248
- var rehydrateSheetFromTag = function (sheet, style) {
249
- var _a;
250
- var parts = ((_a = style.textContent) !== null && _a !== void 0 ? _a : '').split(SPLITTER);
251
- var rules = [];
252
- for (var i = 0, l = parts.length; i < l; i++) {
253
- var part = parts[i].trim();
238
+ const rehydrateSheetFromTag = (sheet, style) => {
239
+ const parts = (style.textContent ?? '').split(SPLITTER);
240
+ const rules = [];
241
+ for (let i = 0, l = parts.length; i < l; i++) {
242
+ const part = parts[i].trim();
254
243
  if (!part)
255
244
  continue;
256
- var marker = part.match(MARKER_RE);
245
+ const marker = part.match(MARKER_RE);
257
246
  if (marker) {
258
- var group = parseInt(marker[1], 10) | 0;
259
- var id = marker[2];
247
+ const group = parseInt(marker[1], 10) | 0;
248
+ const id = marker[2];
260
249
  if (group !== 0) {
261
250
  // Rehydrate componentId to group index mapping
262
251
  setGroupForId(id, group);
@@ -272,10 +261,10 @@ var rehydrateSheetFromTag = function (sheet, style) {
272
261
  }
273
262
  }
274
263
  };
275
- var rehydrateSheet = function (sheet) {
276
- var nodes = document.querySelectorAll(SELECTOR);
277
- for (var i = 0, l = nodes.length; i < l; i++) {
278
- var node = nodes[i];
264
+ const rehydrateSheet = (sheet) => {
265
+ const nodes = document.querySelectorAll(SELECTOR);
266
+ for (let i = 0, l = nodes.length; i < l; i++) {
267
+ const node = nodes[i];
279
268
  if (node && node.getAttribute(SC_ATTR) !== SC_ATTR_ACTIVE) {
280
269
  rehydrateSheetFromTag(sheet, node);
281
270
  if (node.parentNode) {
@@ -289,13 +278,13 @@ function getNonce() {
289
278
  return typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;
290
279
  }
291
280
 
292
- var ELEMENT_TYPE = 1;
281
+ const ELEMENT_TYPE = 1;
293
282
  /* Node.ELEMENT_TYPE */
294
283
  /** Find last style element if any inside target */
295
- var findLastStyleTag = function (target) {
296
- var childNodes = target.childNodes;
297
- for (var i = childNodes.length; i >= 0; i--) {
298
- var child = childNodes[i];
284
+ const findLastStyleTag = (target) => {
285
+ const { childNodes } = target;
286
+ for (let i = childNodes.length; i >= 0; i--) {
287
+ const child = childNodes[i];
299
288
  if (child && child.nodeType === ELEMENT_TYPE && child.hasAttribute(SC_ATTR)) {
300
289
  return child;
301
290
  }
@@ -303,29 +292,29 @@ var findLastStyleTag = function (target) {
303
292
  return undefined;
304
293
  };
305
294
  /** Create a style element inside `target` or <head> after the last */
306
- var makeStyleTag = function (target) {
307
- var head = document.head;
308
- var parent = target || head;
309
- var style = document.createElement('style');
310
- var prevStyle = findLastStyleTag(parent);
311
- var nextSibling = prevStyle !== undefined ? prevStyle.nextSibling : null;
295
+ const makeStyleTag = (target) => {
296
+ const head = document.head;
297
+ const parent = target || head;
298
+ const style = document.createElement('style');
299
+ const prevStyle = findLastStyleTag(parent);
300
+ const nextSibling = prevStyle !== undefined ? prevStyle.nextSibling : null;
312
301
  style.setAttribute(SC_ATTR, SC_ATTR_ACTIVE);
313
302
  style.setAttribute(SC_ATTR_VERSION, SC_VERSION);
314
- var nonce = getNonce();
303
+ const nonce = getNonce();
315
304
  if (nonce)
316
305
  style.setAttribute('nonce', nonce);
317
306
  parent.insertBefore(style, nextSibling);
318
307
  return style;
319
308
  };
320
309
  /** Get the CSSStyleSheet instance for a given style element */
321
- var getSheet = function (tag) {
310
+ const getSheet = (tag) => {
322
311
  if (tag.sheet) {
323
312
  return tag.sheet;
324
313
  }
325
314
  // Avoid Firefox quirk where the style element might not have a sheet property
326
- var styleSheets = document.styleSheets;
327
- for (var i = 0, l = styleSheets.length; i < l; i++) {
328
- var sheet = styleSheets[i];
315
+ const { styleSheets } = document;
316
+ for (let i = 0, l = styleSheets.length; i < l; i++) {
317
+ const sheet = styleSheets[i];
329
318
  if (sheet.ownerNode === tag) {
330
319
  return sheet;
331
320
  }
@@ -334,8 +323,7 @@ var getSheet = function (tag) {
334
323
  };
335
324
 
336
325
  /** Create a CSSStyleSheet-like tag depending on the environment */
337
- var makeTag = function (_a) {
338
- var isServer = _a.isServer, useCSSOMInjection = _a.useCSSOMInjection, target = _a.target;
326
+ const makeTag = ({ isServer, useCSSOMInjection, target }) => {
339
327
  if (isServer) {
340
328
  return new VirtualTag(target);
341
329
  }
@@ -346,15 +334,18 @@ var makeTag = function (_a) {
346
334
  return new TextTag(target);
347
335
  }
348
336
  };
349
- var CSSOMTag = /** @class */ (function () {
350
- function CSSOMTag(target) {
351
- var element = (this.element = makeStyleTag(target));
337
+ const CSSOMTag = class CSSOMTag {
338
+ element;
339
+ sheet;
340
+ length;
341
+ constructor(target) {
342
+ const element = (this.element = makeStyleTag(target));
352
343
  // Avoid Edge bug where empty style elements don't create sheets
353
344
  element.appendChild(document.createTextNode(''));
354
345
  this.sheet = getSheet(element);
355
346
  this.length = 0;
356
347
  }
357
- CSSOMTag.prototype.insertRule = function (index, rule) {
348
+ insertRule(index, rule) {
358
349
  try {
359
350
  this.sheet.insertRule(rule, index);
360
351
  this.length++;
@@ -363,13 +354,13 @@ var CSSOMTag = /** @class */ (function () {
363
354
  catch (_error) {
364
355
  return false;
365
356
  }
366
- };
367
- CSSOMTag.prototype.deleteRule = function (index) {
357
+ }
358
+ deleteRule(index) {
368
359
  this.sheet.deleteRule(index);
369
360
  this.length--;
370
- };
371
- CSSOMTag.prototype.getRule = function (index) {
372
- var rule = this.sheet.cssRules[index];
361
+ }
362
+ getRule(index) {
363
+ const rule = this.sheet.cssRules[index];
373
364
  // Avoid IE11 quirk where cssText is inaccessible on some invalid rules
374
365
  if (rule !== undefined && typeof rule.cssText === 'string') {
375
366
  return rule.cssText;
@@ -377,20 +368,22 @@ var CSSOMTag = /** @class */ (function () {
377
368
  else {
378
369
  return '';
379
370
  }
380
- };
381
- return CSSOMTag;
382
- }());
371
+ }
372
+ };
383
373
  /** A Tag that emulates the CSSStyleSheet API but uses text nodes */
384
- var TextTag = /** @class */ (function () {
385
- function TextTag(target) {
386
- var element = (this.element = makeStyleTag(target));
374
+ const TextTag = class TextTag {
375
+ element;
376
+ nodes;
377
+ length;
378
+ constructor(target) {
379
+ const element = (this.element = makeStyleTag(target));
387
380
  this.nodes = element.childNodes;
388
381
  this.length = 0;
389
382
  }
390
- TextTag.prototype.insertRule = function (index, rule) {
383
+ insertRule(index, rule) {
391
384
  if (index <= this.length && index >= 0) {
392
- var node = document.createTextNode(rule);
393
- var refNode = this.nodes[index];
385
+ const node = document.createTextNode(rule);
386
+ const refNode = this.nodes[index];
394
387
  this.element.insertBefore(node, refNode || null);
395
388
  this.length++;
396
389
  return true;
@@ -398,28 +391,29 @@ var TextTag = /** @class */ (function () {
398
391
  else {
399
392
  return false;
400
393
  }
401
- };
402
- TextTag.prototype.deleteRule = function (index) {
394
+ }
395
+ deleteRule(index) {
403
396
  this.element.removeChild(this.nodes[index]);
404
397
  this.length--;
405
- };
406
- TextTag.prototype.getRule = function (index) {
398
+ }
399
+ getRule(index) {
407
400
  if (index < this.length) {
408
401
  return this.nodes[index].textContent;
409
402
  }
410
403
  else {
411
404
  return '';
412
405
  }
413
- };
414
- return TextTag;
415
- }());
406
+ }
407
+ };
416
408
  /** A completely virtual (server-side) Tag that doesn't manipulate the DOM */
417
- var VirtualTag = /** @class */ (function () {
418
- function VirtualTag(_target) {
409
+ const VirtualTag = class VirtualTag {
410
+ rules;
411
+ length;
412
+ constructor(_target) {
419
413
  this.rules = [];
420
414
  this.length = 0;
421
415
  }
422
- VirtualTag.prototype.insertRule = function (index, rule) {
416
+ insertRule(index, rule) {
423
417
  if (index <= this.length) {
424
418
  this.rules.splice(index, 0, rule);
425
419
  this.length++;
@@ -428,33 +422,42 @@ var VirtualTag = /** @class */ (function () {
428
422
  else {
429
423
  return false;
430
424
  }
431
- };
432
- VirtualTag.prototype.deleteRule = function (index) {
425
+ }
426
+ deleteRule(index) {
433
427
  this.rules.splice(index, 1);
434
428
  this.length--;
435
- };
436
- VirtualTag.prototype.getRule = function (index) {
429
+ }
430
+ getRule(index) {
437
431
  if (index < this.length) {
438
432
  return this.rules[index];
439
433
  }
440
434
  else {
441
435
  return '';
442
436
  }
443
- };
444
- return VirtualTag;
445
- }());
437
+ }
438
+ };
446
439
 
447
- var SHOULD_REHYDRATE = IS_BROWSER;
448
- var defaultOptions = {
440
+ let SHOULD_REHYDRATE = IS_BROWSER;
441
+ const defaultOptions = {
449
442
  isServer: !IS_BROWSER,
450
443
  useCSSOMInjection: !DISABLE_SPEEDY,
451
444
  };
452
445
  /** Contains the main stylesheet logic for stringification and caching */
453
- var StyleSheet = /** @class */ (function () {
454
- function StyleSheet(options, globalStyles, names) {
455
- if (options === void 0) { options = EMPTY_OBJECT; }
456
- if (globalStyles === void 0) { globalStyles = {}; }
457
- this.options = tslib.__assign(tslib.__assign({}, defaultOptions), options);
446
+ class StyleSheet {
447
+ gs;
448
+ names;
449
+ options;
450
+ server;
451
+ tag;
452
+ /** Register a group ID to give it an index */
453
+ static registerId(id) {
454
+ return getGroupForId(id);
455
+ }
456
+ constructor(options = EMPTY_OBJECT, globalStyles = {}, names) {
457
+ this.options = {
458
+ ...defaultOptions,
459
+ ...options,
460
+ };
458
461
  this.gs = globalStyles;
459
462
  this.names = new Map(names);
460
463
  this.server = !!options.isServer;
@@ -464,96 +467,89 @@ var StyleSheet = /** @class */ (function () {
464
467
  rehydrateSheet(this);
465
468
  }
466
469
  }
467
- /** Register a group ID to give it an index */
468
- StyleSheet.registerId = function (id) {
469
- return getGroupForId(id);
470
- };
471
- StyleSheet.prototype.reconstructWithOptions = function (options, withNames) {
472
- if (withNames === void 0) { withNames = true; }
473
- return new StyleSheet(tslib.__assign(tslib.__assign({}, this.options), options), this.gs, (withNames && this.names) || undefined);
474
- };
475
- StyleSheet.prototype.allocateGSInstance = function (id) {
470
+ reconstructWithOptions(options, withNames = true) {
471
+ return new StyleSheet({ ...this.options, ...options }, this.gs, (withNames && this.names) || undefined);
472
+ }
473
+ allocateGSInstance(id) {
476
474
  return (this.gs[id] = (this.gs[id] || 0) + 1);
477
- };
475
+ }
478
476
  /** Lazily initialises a GroupedTag for when it's actually needed */
479
- StyleSheet.prototype.getTag = function () {
477
+ getTag() {
480
478
  return this.tag || (this.tag = makeGroupedTag(makeTag(this.options)));
481
- };
479
+ }
482
480
  /** Check whether a name is known for caching */
483
- StyleSheet.prototype.hasNameForId = function (id, name) {
481
+ hasNameForId(id, name) {
484
482
  return this.names.has(id) && this.names.get(id).has(name);
485
- };
483
+ }
486
484
  /** Mark a group's name as known for caching */
487
- StyleSheet.prototype.registerName = function (id, name) {
485
+ registerName(id, name) {
488
486
  getGroupForId(id);
489
487
  if (!this.names.has(id)) {
490
- var groupNames = new Set();
488
+ const groupNames = new Set();
491
489
  groupNames.add(name);
492
490
  this.names.set(id, groupNames);
493
491
  }
494
492
  else {
495
493
  this.names.get(id).add(name);
496
494
  }
497
- };
495
+ }
498
496
  /** Insert new rules which also marks the name as known */
499
- StyleSheet.prototype.insertRules = function (id, name, rules) {
497
+ insertRules(id, name, rules) {
500
498
  this.registerName(id, name);
501
499
  this.getTag().insertRules(getGroupForId(id), rules);
502
- };
500
+ }
503
501
  /** Clears all cached names for a given group ID */
504
- StyleSheet.prototype.clearNames = function (id) {
502
+ clearNames(id) {
505
503
  if (this.names.has(id)) {
506
504
  this.names.get(id).clear();
507
505
  }
508
- };
506
+ }
509
507
  /** Clears all rules for a given group ID */
510
- StyleSheet.prototype.clearRules = function (id) {
508
+ clearRules(id) {
511
509
  this.getTag().clearGroup(getGroupForId(id));
512
510
  this.clearNames(id);
513
- };
511
+ }
514
512
  /** Clears the entire tag which deletes all rules but not its names */
515
- StyleSheet.prototype.clearTag = function () {
513
+ clearTag() {
516
514
  // NOTE: This does not clear the names, since it's only used during SSR
517
515
  // so that we can continuously output only new rules
518
516
  this.tag = undefined;
519
- };
517
+ }
520
518
  /** Outputs the current sheet as a CSS string with markers for SSR */
521
- StyleSheet.prototype.toString = function () {
519
+ toString() {
522
520
  return outputSheet(this);
523
- };
524
- return StyleSheet;
525
- }());
521
+ }
522
+ }
526
523
 
527
- var SEED = 5381;
524
+ const SEED = 5381;
528
525
  // When we have separate strings it's useful to run a progressive
529
526
  // version of djb2 where we pretend that we're still looping over
530
527
  // the same string
531
- var phash = function (h, x) {
532
- var i = x.length;
528
+ const phash = (h, x) => {
529
+ let i = x.length;
533
530
  while (i) {
534
531
  h = (h * 33) ^ x.charCodeAt(--i);
535
532
  }
536
533
  return h;
537
534
  };
538
535
  // This is a djb2 hashing function
539
- var hash = function (x) {
536
+ const hash = (x) => {
540
537
  return phash(SEED, x);
541
538
  };
542
539
 
543
- var COMMENT_REGEX = /^\s*\/\/.*$/gm;
544
- var COMPLEX_SELECTOR_PREFIX = [':', '[', '.', '#'];
545
- function createStylisInstance(_a) {
546
- var _b = _a === void 0 ? EMPTY_OBJECT : _a, _c = _b.options, options = _c === void 0 ? EMPTY_OBJECT : _c, _d = _b.plugins, plugins = _d === void 0 ? EMPTY_ARRAY : _d;
547
- var _componentId;
548
- var _selector;
549
- var _selectorRegexp;
550
- var _consecutiveSelfRefRegExp;
551
- var selfReferenceReplacer = function (match, offset, string) {
540
+ const COMMENT_REGEX = /^\s*\/\/.*$/gm;
541
+ const COMPLEX_SELECTOR_PREFIX = [':', '[', '.', '#'];
542
+ function createStylisInstance({ options = EMPTY_OBJECT, plugins = EMPTY_ARRAY, } = EMPTY_OBJECT) {
543
+ let _componentId;
544
+ let _selector;
545
+ let _selectorRegexp;
546
+ let _consecutiveSelfRefRegExp;
547
+ const selfReferenceReplacer = (match, offset, string) => {
552
548
  if (
553
549
  // do not replace the first occurrence if it is complex (has a modifier)
554
550
  (offset === 0 ? !COMPLEX_SELECTOR_PREFIX.includes(string[_selector.length]) : true) && // no consecutive self refs (.b.b); that is a precedence boost and treated differently
555
551
  !string.match(_consecutiveSelfRefRegExp)) {
556
- return ".".concat(_componentId);
552
+ return `.${_componentId}`;
557
553
  }
558
554
  return match;
559
555
  };
@@ -569,34 +565,31 @@ function createStylisInstance(_a) {
569
565
  *
570
566
  * https://github.com/thysultan/stylis.js/tree/v4.0.2#abstract-syntax-structure
571
567
  */
572
- var selfReferenceReplacementPlugin = function (element) {
568
+ const selfReferenceReplacementPlugin = element => {
573
569
  if (element.type === stylis.RULESET && element.value.includes('&')) {
574
- var props = element.props;
570
+ const props = element.props;
575
571
  props[0] = props[0].replace(_selectorRegexp, selfReferenceReplacer);
576
572
  }
577
573
  };
578
- var stringifyRules = function (css, selector, prefix, componentId) {
579
- if (selector === void 0) { selector = ''; }
580
- if (prefix === void 0) { prefix = ''; }
581
- if (componentId === void 0) { componentId = '&'; }
582
- var flatCSS = css.replace(COMMENT_REGEX, '');
574
+ const stringifyRules = (css, selector = '', prefix = '', componentId = '&') => {
575
+ let flatCSS = css.replace(COMMENT_REGEX, '');
583
576
  // stylis has no concept of state to be passed to plugins
584
577
  // but since JS is single-threaded, we can rely on that to ensure
585
578
  // these properties stay in sync with the current stylis run
586
579
  _componentId = componentId;
587
580
  _selector = selector;
588
- _selectorRegexp = new RegExp("\\".concat(_selector, "\\b"), 'g');
589
- _consecutiveSelfRefRegExp = new RegExp("(\\".concat(_selector, "\\b){2,}"));
590
- var middlewares = plugins.slice();
581
+ _selectorRegexp = new RegExp(`\\${_selector}\\b`, 'g');
582
+ _consecutiveSelfRefRegExp = new RegExp(`(\\${_selector}\\b){2,}`);
583
+ const middlewares = plugins.slice();
591
584
  if (options.prefix || options.prefix === undefined) {
592
585
  middlewares.unshift(stylis.prefixer);
593
586
  }
594
587
  middlewares.push(selfReferenceReplacementPlugin, stylis.stringify);
595
- return stylis.serialize(stylis.compile(prefix || selector ? "".concat(prefix, " ").concat(selector, " { ").concat(flatCSS, " }") : flatCSS), stylis.middleware(middlewares));
588
+ return stylis.serialize(stylis.compile(prefix || selector ? `${prefix} ${selector} { ${flatCSS} }` : flatCSS), stylis.middleware(middlewares));
596
589
  };
597
590
  stringifyRules.hash = plugins.length
598
591
  ? plugins
599
- .reduce(function (acc, plugin) {
592
+ .reduce((acc, plugin) => {
600
593
  if (!plugin.name) {
601
594
  throwStyledComponentsError(15);
602
595
  }
@@ -607,36 +600,35 @@ function createStylisInstance(_a) {
607
600
  return stringifyRules;
608
601
  }
609
602
 
610
- var StyleSheetContext = React__default['default'].createContext(undefined);
603
+ const StyleSheetContext = React__default["default"].createContext(undefined);
611
604
  StyleSheetContext.Consumer;
612
- var StylisContext = React__default['default'].createContext(undefined);
605
+ const StylisContext = React__default["default"].createContext(undefined);
613
606
  StylisContext.Consumer;
614
607
  new StyleSheet();
615
- var mainStylis = createStylisInstance();
608
+ const mainStylis = createStylisInstance();
616
609
 
617
- var Keyframes = /** @class */ (function () {
618
- function Keyframes(name, rules) {
619
- var _this = this;
620
- this.inject = function (styleSheet, stylisInstance) {
621
- if (stylisInstance === void 0) { stylisInstance = mainStylis; }
622
- var resolvedName = _this.name + stylisInstance.hash;
623
- if (!styleSheet.hasNameForId(_this.id, resolvedName)) {
624
- styleSheet.insertRules(_this.id, resolvedName, stylisInstance(_this.rules, resolvedName, '@keyframes'));
625
- }
626
- };
627
- this.toString = function () {
628
- throw throwStyledComponentsError(12, String(_this.name));
629
- };
610
+ class Keyframes {
611
+ id;
612
+ name;
613
+ rules;
614
+ constructor(name, rules) {
630
615
  this.name = name;
631
- this.id = "sc-keyframes-".concat(name);
616
+ this.id = `sc-keyframes-${name}`;
632
617
  this.rules = rules;
633
618
  }
634
- Keyframes.prototype.getName = function (stylisInstance) {
635
- if (stylisInstance === void 0) { stylisInstance = mainStylis; }
636
- return this.name + stylisInstance.hash;
619
+ inject = (styleSheet, stylisInstance = mainStylis) => {
620
+ const resolvedName = this.name + stylisInstance.hash;
621
+ if (!styleSheet.hasNameForId(this.id, resolvedName)) {
622
+ styleSheet.insertRules(this.id, resolvedName, stylisInstance(this.rules, resolvedName, '@keyframes'));
623
+ }
624
+ };
625
+ toString = () => {
626
+ throw throwStyledComponentsError(12, String(this.name));
637
627
  };
638
- return Keyframes;
639
- }());
628
+ getName(stylisInstance = mainStylis) {
629
+ return this.name + stylisInstance.hash;
630
+ }
631
+ }
640
632
 
641
633
  // Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js
642
634
  function addUnitIfNeeded(name, value) {
@@ -644,8 +636,8 @@ function addUnitIfNeeded(name, value) {
644
636
  if (value == null || typeof value === 'boolean' || value === '') {
645
637
  return '';
646
638
  }
647
- if (typeof value === 'number' && value !== 0 && !(name in unitless__default['default'])) {
648
- return "".concat(value, "px"); // Presumes implicit 'px' suffix for unitless numbers
639
+ if (typeof value === 'number' && value !== 0 && !(name in unitless__default["default"])) {
640
+ return `${value}px`; // Presumes implicit 'px' suffix for unitless numbers
649
641
  }
650
642
  return String(value).trim();
651
643
  }
@@ -661,10 +653,10 @@ function getComponentName(target) {
661
653
  * inlined version of
662
654
  * https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/hyphenateStyleName.js
663
655
  */
664
- var uppercaseCheck = /([A-Z])/;
665
- var uppercasePattern = /([A-Z])/g;
666
- var msPattern = /^ms-/;
667
- var prefixAndLowerCase = function (char) { return "-".concat(char.toLowerCase()); };
656
+ const uppercaseCheck = /([A-Z])/;
657
+ const uppercasePattern = /([A-Z])/g;
658
+ const msPattern = /^ms-/;
659
+ const prefixAndLowerCase = (char) => `-${char.toLowerCase()}`;
668
660
  /**
669
661
  * Hyphenates a camelcased CSS property name, for example:
670
662
  *
@@ -710,35 +702,33 @@ function isStyledComponent(target) {
710
702
  /**
711
703
  * It's falsish not falsy because 0 is allowed.
712
704
  */
713
- var isFalsish = function (chunk) {
714
- return chunk === undefined || chunk === null || chunk === false || chunk === '';
715
- };
716
- var objToCssArray = function (obj, prevKey) {
717
- var rules = [];
718
- for (var key in obj) {
705
+ const isFalsish = (chunk) => chunk === undefined || chunk === null || chunk === false || chunk === '';
706
+ const objToCssArray = (obj, prevKey) => {
707
+ const rules = [];
708
+ for (const key in obj) {
719
709
  if (!obj.hasOwnProperty(key) || isFalsish(obj[key]))
720
710
  continue;
721
711
  if ((Array.isArray(obj[key]) && obj[key].isCss) || isFunction(obj[key])) {
722
- rules.push("".concat(hyphenateStyleName(key), ":"), obj[key], ';');
712
+ rules.push(`${hyphenateStyleName(key)}:`, obj[key], ';');
723
713
  }
724
714
  else if (isPlainObject(obj[key])) {
725
- rules.push.apply(rules, tslib.__spreadArray([], tslib.__read(objToCssArray(obj[key], key)), false));
715
+ rules.push(...objToCssArray(obj[key], key));
726
716
  }
727
717
  else {
728
- rules.push("".concat(hyphenateStyleName(key), ": ").concat(addUnitIfNeeded(key, obj[key]), ";"));
718
+ rules.push(`${hyphenateStyleName(key)}: ${addUnitIfNeeded(key, obj[key])};`);
729
719
  }
730
720
  }
731
- return prevKey ? tslib.__spreadArray(tslib.__spreadArray(["".concat(prevKey, " {")], tslib.__read(rules), false), ['}'], false) : rules;
721
+ return prevKey ? [`${prevKey} {`, ...rules, '}'] : rules;
732
722
  };
733
723
  function flatten(chunk, executionContext, styleSheet, stylisInstance) {
734
724
  if (Array.isArray(chunk)) {
735
- var ruleSet = [];
736
- for (var i = 0, len = chunk.length, result = void 0; i < len; i += 1) {
725
+ const ruleSet = [];
726
+ for (let i = 0, len = chunk.length, result; i < len; i += 1) {
737
727
  result = flatten(chunk[i], executionContext, styleSheet, stylisInstance);
738
728
  if (result === '')
739
729
  continue;
740
730
  else if (Array.isArray(result))
741
- ruleSet.push.apply(ruleSet, tslib.__spreadArray([], tslib.__read(result), false));
731
+ ruleSet.push(...result);
742
732
  else
743
733
  ruleSet.push(result);
744
734
  }
@@ -749,22 +739,22 @@ function flatten(chunk, executionContext, styleSheet, stylisInstance) {
749
739
  }
750
740
  /* Handle other components */
751
741
  if (isStyledComponent(chunk)) {
752
- return ".".concat(chunk.styledComponentId);
742
+ return `.${chunk.styledComponentId}`;
753
743
  }
754
744
  /* Either execute or defer the function */
755
745
  if (isFunction(chunk)) {
756
746
  if (isStatelessFunction(chunk) && executionContext) {
757
- var chunkFn = chunk;
758
- var result = chunkFn(executionContext);
747
+ const chunkFn = chunk;
748
+ const result = chunkFn(executionContext);
759
749
  if (process.env.NODE_ENV !== 'production' &&
760
750
  typeof result === 'object' &&
761
751
  !Array.isArray(result) &&
762
752
  !(result instanceof Keyframes) &&
763
753
  !isPlainObject(result)) {
764
754
  // eslint-disable-next-line no-console
765
- console.error("".concat(getComponentName(
755
+ console.error(`${getComponentName(
766
756
  // @ts-expect-error handling unexpected input
767
- chunkFn), " is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details."));
757
+ chunkFn)} is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.`);
768
758
  }
769
759
  return flatten(result, executionContext, styleSheet, stylisInstance);
770
760
  }
@@ -784,8 +774,8 @@ function flatten(chunk, executionContext, styleSheet, stylisInstance) {
784
774
  }
785
775
 
786
776
  function interleave(strings, interpolations) {
787
- var result = [strings[0]];
788
- for (var i = 0, len = interpolations.length; i < len; i += 1) {
777
+ const result = [strings[0]];
778
+ for (let i = 0, len = interpolations.length; i < len; i += 1) {
789
779
  result.push(interpolations[i], strings[i + 1]);
790
780
  }
791
781
  return result;
@@ -795,25 +785,22 @@ function interleave(strings, interpolations) {
795
785
  * Used when flattening object styles to determine if we should
796
786
  * expand an array of styles.
797
787
  */
798
- var addTag = function (arg) {
788
+ const addTag = (arg) => {
799
789
  if (Array.isArray(arg)) {
800
790
  // eslint-disable-next-line no-param-reassign
801
791
  arg.isCss = true;
802
792
  }
803
793
  return arg;
804
794
  };
805
- function css(styles) {
806
- var interpolations = [];
807
- for (var _i = 1; _i < arguments.length; _i++) {
808
- interpolations[_i - 1] = arguments[_i];
809
- }
795
+ function css(styles, ...interpolations) {
810
796
  if (isFunction(styles) || isPlainObject(styles)) {
811
- var styleFunctionOrObject = styles;
812
- return addTag(flatten(interleave(EMPTY_ARRAY, tslib.__spreadArray([
813
- styleFunctionOrObject
814
- ], tslib.__read(interpolations), false))));
797
+ const styleFunctionOrObject = styles;
798
+ return addTag(flatten(interleave(EMPTY_ARRAY, [
799
+ styleFunctionOrObject,
800
+ ...interpolations,
801
+ ])));
815
802
  }
816
- var styleStringArray = styles;
803
+ const styleStringArray = styles;
817
804
  if (interpolations.length === 0 &&
818
805
  styleStringArray.length === 1 &&
819
806
  typeof styleStringArray[0] === 'string') {
@@ -822,8 +809,7 @@ function css(styles) {
822
809
  return addTag(flatten(interleave(styleStringArray, interpolations)));
823
810
  }
824
811
 
825
- function constructWithOptions(componentConstructor, tag, options) {
826
- if (options === void 0) { options = EMPTY_OBJECT; }
812
+ function constructWithOptions(componentConstructor, tag, options = EMPTY_OBJECT) {
827
813
  // We trust that the tag is a valid component as long as it isn't falsish
828
814
  // Typically the tag here is a string or function (i.e. class or pure function component)
829
815
  // However a component may also be an object if it uses another utility, e.g. React.memo
@@ -832,34 +818,30 @@ function constructWithOptions(componentConstructor, tag, options) {
832
818
  throw throwStyledComponentsError(1, tag);
833
819
  }
834
820
  /* This is callable directly as a template function */
835
- var templateFunction = function (initialStyles) {
836
- var interpolations = [];
837
- for (var _i = 1; _i < arguments.length; _i++) {
838
- interpolations[_i - 1] = arguments[_i];
839
- }
840
- return componentConstructor(tag, options, css.apply(void 0, tslib.__spreadArray([initialStyles], tslib.__read(interpolations), false)));
841
- };
821
+ const templateFunction = (initialStyles, ...interpolations) => componentConstructor(tag, options, css(initialStyles, ...interpolations));
842
822
  /* Modify/inject new props at runtime */
843
- templateFunction.attrs = function (attrs) {
844
- return constructWithOptions(componentConstructor, tag, tslib.__assign(tslib.__assign({}, options), { attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean) }));
845
- };
823
+ templateFunction.attrs = (attrs) => constructWithOptions(componentConstructor, tag, {
824
+ ...options,
825
+ attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean),
826
+ });
846
827
  /**
847
828
  * If config methods are called, wrap up a new template function and merge options */
848
- templateFunction.withConfig = function (config) {
849
- return constructWithOptions(componentConstructor, tag, tslib.__assign(tslib.__assign({}, options), config));
850
- };
829
+ templateFunction.withConfig = (config) => constructWithOptions(componentConstructor, tag, {
830
+ ...options,
831
+ ...config,
832
+ });
851
833
  return templateFunction;
852
834
  }
853
835
 
854
- var ThemeContext = React__default['default'].createContext(undefined);
855
- var ThemeConsumer = ThemeContext.Consumer;
836
+ const ThemeContext = React__default["default"].createContext(undefined);
837
+ const ThemeConsumer = ThemeContext.Consumer;
856
838
  function mergeTheme(theme, outerTheme) {
857
839
  if (!theme) {
858
840
  throw throwStyledComponentsError(14);
859
841
  }
860
842
  if (isFunction(theme)) {
861
- var themeFn = theme;
862
- var mergedTheme = themeFn(outerTheme);
843
+ const themeFn = theme;
844
+ const mergedTheme = themeFn(outerTheme);
863
845
  if (process.env.NODE_ENV !== 'production' &&
864
846
  (mergedTheme === null || Array.isArray(mergedTheme) || typeof mergedTheme !== 'object')) {
865
847
  throw throwStyledComponentsError(7);
@@ -869,34 +851,32 @@ function mergeTheme(theme, outerTheme) {
869
851
  if (Array.isArray(theme) || typeof theme !== 'object') {
870
852
  throw throwStyledComponentsError(8);
871
853
  }
872
- return outerTheme ? tslib.__assign(tslib.__assign({}, outerTheme), theme) : theme;
854
+ return outerTheme ? { ...outerTheme, ...theme } : theme;
873
855
  }
874
856
  /**
875
857
  * Provide a theme to an entire react component tree via context
876
858
  */
877
859
  function ThemeProvider(props) {
878
- var outerTheme = React.useContext(ThemeContext);
879
- var themeContext = React.useMemo(function () { return mergeTheme(props.theme, outerTheme); }, [props.theme, outerTheme]);
860
+ const outerTheme = React.useContext(ThemeContext);
861
+ const themeContext = React.useMemo(() => mergeTheme(props.theme, outerTheme), [props.theme, outerTheme]);
880
862
  if (!props.children) {
881
863
  return null;
882
864
  }
883
- return React__default['default'].createElement(ThemeContext.Provider, { value: themeContext }, props.children);
865
+ return React__default["default"].createElement(ThemeContext.Provider, { value: themeContext }, props.children);
884
866
  }
885
867
 
886
- function determineTheme(props, providedTheme, defaultProps) {
887
- if (defaultProps === void 0) { defaultProps = EMPTY_OBJECT; }
868
+ function determineTheme(props, providedTheme, defaultProps = EMPTY_OBJECT) {
888
869
  return (props.theme !== defaultProps.theme && props.theme) || providedTheme || defaultProps.theme;
889
870
  }
890
871
 
891
- var _a;
892
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
872
+ const hasSymbol = typeof Symbol === 'function' && Symbol.for;
893
873
  // copied from react-is
894
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
895
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
874
+ const REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
875
+ const REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
896
876
  /**
897
877
  * Adapted from hoist-non-react-statics to avoid the react-is dependency.
898
878
  */
899
- var REACT_STATICS = {
879
+ const REACT_STATICS = {
900
880
  childContextTypes: true,
901
881
  contextType: true,
902
882
  contextTypes: true,
@@ -909,7 +889,7 @@ var REACT_STATICS = {
909
889
  propTypes: true,
910
890
  type: true,
911
891
  };
912
- var KNOWN_STATICS = {
892
+ const KNOWN_STATICS = {
913
893
  name: true,
914
894
  length: true,
915
895
  prototype: true,
@@ -918,14 +898,14 @@ var KNOWN_STATICS = {
918
898
  arguments: true,
919
899
  arity: true,
920
900
  };
921
- var FORWARD_REF_STATICS = {
901
+ const FORWARD_REF_STATICS = {
922
902
  $$typeof: true,
923
903
  render: true,
924
904
  defaultProps: true,
925
905
  displayName: true,
926
906
  propTypes: true,
927
907
  };
928
- var MEMO_STATICS = {
908
+ const MEMO_STATICS = {
929
909
  $$typeof: true,
930
910
  compare: true,
931
911
  defaultProps: true,
@@ -933,13 +913,13 @@ var MEMO_STATICS = {
933
913
  propTypes: true,
934
914
  type: true,
935
915
  };
936
- var TYPE_STATICS = (_a = {},
937
- _a[REACT_FORWARD_REF_TYPE] = FORWARD_REF_STATICS,
938
- _a[REACT_MEMO_TYPE] = MEMO_STATICS,
939
- _a);
916
+ const TYPE_STATICS = {
917
+ [REACT_FORWARD_REF_TYPE]: FORWARD_REF_STATICS,
918
+ [REACT_MEMO_TYPE]: MEMO_STATICS,
919
+ };
940
920
  // adapted from react-is
941
921
  function isMemo(object) {
942
- var $$typeofType = 'type' in object && object.type.$$typeof;
922
+ const $$typeofType = 'type' in object && object.type.$$typeof;
943
923
  return $$typeofType === REACT_MEMO_TYPE;
944
924
  }
945
925
  function getStatics(component) {
@@ -952,34 +932,34 @@ function getStatics(component) {
952
932
  ? TYPE_STATICS[component['$$typeof']]
953
933
  : REACT_STATICS;
954
934
  }
955
- var defineProperty = Object.defineProperty;
956
- var getOwnPropertyNames = Object.getOwnPropertyNames;
957
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
958
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
959
- var getPrototypeOf = Object.getPrototypeOf;
960
- var objectPrototype = Object.prototype;
935
+ const defineProperty = Object.defineProperty;
936
+ const getOwnPropertyNames = Object.getOwnPropertyNames;
937
+ const getOwnPropertySymbols = Object.getOwnPropertySymbols;
938
+ const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
939
+ const getPrototypeOf = Object.getPrototypeOf;
940
+ const objectPrototype = Object.prototype;
961
941
  function hoistNonReactStatics(targetComponent, sourceComponent, excludelist) {
962
942
  if (typeof sourceComponent !== 'string') {
963
943
  // don't hoist over string (html) components
964
944
  if (objectPrototype) {
965
- var inheritedComponent = getPrototypeOf(sourceComponent);
945
+ const inheritedComponent = getPrototypeOf(sourceComponent);
966
946
  if (inheritedComponent && inheritedComponent !== objectPrototype) {
967
947
  hoistNonReactStatics(targetComponent, inheritedComponent, excludelist);
968
948
  }
969
949
  }
970
- var keys = getOwnPropertyNames(sourceComponent);
950
+ let keys = getOwnPropertyNames(sourceComponent);
971
951
  if (getOwnPropertySymbols) {
972
952
  keys = keys.concat(getOwnPropertySymbols(sourceComponent));
973
953
  }
974
- var targetStatics = getStatics(targetComponent);
975
- var sourceStatics = getStatics(sourceComponent);
976
- for (var i = 0; i < keys.length; ++i) {
977
- var key = keys[i];
954
+ const targetStatics = getStatics(targetComponent);
955
+ const sourceStatics = getStatics(sourceComponent);
956
+ for (let i = 0; i < keys.length; ++i) {
957
+ const key = keys[i];
978
958
  if (!(key in KNOWN_STATICS) &&
979
959
  !(excludelist && excludelist[key]) &&
980
960
  !(sourceStatics && key in sourceStatics) &&
981
961
  !(targetStatics && key in targetStatics)) {
982
- var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
962
+ const descriptor = getOwnPropertyDescriptor(sourceComponent, key);
983
963
  try {
984
964
  // Avoid failures from read-only properties
985
965
  defineProperty(targetComponent, key, descriptor);
@@ -994,31 +974,31 @@ function hoistNonReactStatics(targetComponent, sourceComponent, excludelist) {
994
974
  }
995
975
 
996
976
  function withTheme(Component) {
997
- var WithTheme = React__default['default'].forwardRef(function (props, ref) {
998
- var theme = React__default['default'].useContext(ThemeContext);
999
- var themeProp = determineTheme(props, theme, Component.defaultProps);
977
+ const WithTheme = React__default["default"].forwardRef((props, ref) => {
978
+ const theme = React__default["default"].useContext(ThemeContext);
979
+ const themeProp = determineTheme(props, theme, Component.defaultProps);
1000
980
  if (process.env.NODE_ENV !== 'production' && themeProp === undefined) {
1001
981
  // eslint-disable-next-line no-console
1002
- console.warn("[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class \"".concat(getComponentName(Component), "\""));
982
+ console.warn(`[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "${getComponentName(Component)}"`);
1003
983
  }
1004
- return React__default['default'].createElement(Component, tslib.__assign({}, props, { theme: themeProp, ref: ref }));
984
+ return React__default["default"].createElement(Component, { ...props, theme: themeProp, ref: ref });
1005
985
  });
1006
- WithTheme.displayName = "WithTheme(".concat(getComponentName(Component), ")");
986
+ WithTheme.displayName = `WithTheme(${getComponentName(Component)})`;
1007
987
  return hoistNonReactStatics(WithTheme, Component);
1008
988
  }
1009
989
 
1010
- var useTheme = function () { return React.useContext(ThemeContext); };
990
+ const useTheme = () => React.useContext(ThemeContext);
1011
991
 
1012
- var AD_REPLACER_R = /(a)(d)/gi;
992
+ const AD_REPLACER_R = /(a)(d)/gi;
1013
993
  /* This is the "capacity" of our alphabet i.e. 2x26 for all letters plus their capitalised
1014
994
  * counterparts */
1015
- var charsLength = 52;
995
+ const charsLength = 52;
1016
996
  /* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */
1017
- var getAlphabeticChar = function (code) { return String.fromCharCode(code + (code > 25 ? 39 : 97)); };
997
+ const getAlphabeticChar = (code) => String.fromCharCode(code + (code > 25 ? 39 : 97));
1018
998
  /* input a number, usually a hash and convert it to base-52 */
1019
999
  function generateAlphabeticName(code) {
1020
- var name = '';
1021
- var x;
1000
+ let name = '';
1001
+ let x;
1022
1002
  /* get a char and divide by alphabet-length */
1023
1003
  for (x = Math.abs(code); x > charsLength; x = (x / charsLength) | 0) {
1024
1004
  name = getAlphabeticChar(x % charsLength) + name;
@@ -1030,41 +1010,41 @@ function generateComponentId(str) {
1030
1010
  return generateAlphabeticName(hash(str) >>> 0);
1031
1011
  }
1032
1012
 
1033
- var generated = {};
1013
+ let generated = {};
1034
1014
  /**
1035
1015
  * InlineStyle takes arbitrary CSS and generates a flat object
1036
1016
  */
1037
1017
  function makeInlineStyleClass(styleSheet) {
1038
- var InlineStyle = /** @class */ (function () {
1039
- function InlineStyle(rules) {
1018
+ const InlineStyle = class InlineStyle {
1019
+ rules;
1020
+ constructor(rules) {
1040
1021
  this.rules = rules;
1041
1022
  }
1042
- InlineStyle.prototype.generateStyleObject = function (executionContext) {
1023
+ generateStyleObject(executionContext) {
1043
1024
  // keyframes, functions, and component selectors are not allowed for React Native
1044
- var flatCSS = flatten(this.rules, executionContext).join('');
1045
- var hash = generateComponentId(flatCSS);
1025
+ const flatCSS = flatten(this.rules, executionContext).join('');
1026
+ const hash = generateComponentId(flatCSS);
1046
1027
  if (!generated[hash]) {
1047
- var root = postcss.parse(flatCSS);
1048
- var declPairs_1 = [];
1049
- root.each(function (node) {
1028
+ const root = postcss.parse(flatCSS);
1029
+ const declPairs = [];
1030
+ root.each(node => {
1050
1031
  if (node.type === 'decl') {
1051
- declPairs_1.push([node.prop, node.value]);
1032
+ declPairs.push([node.prop, node.value]);
1052
1033
  }
1053
1034
  else if (process.env.NODE_ENV !== 'production' && node.type !== 'comment') {
1054
1035
  /* eslint-disable no-console */
1055
- console.warn("Node of type ".concat(node.type, " not supported as an inline style"));
1036
+ console.warn(`Node of type ${node.type} not supported as an inline style`);
1056
1037
  }
1057
1038
  });
1058
- var styleObject = transformDeclPairs__default['default'](declPairs_1);
1059
- var styles = styleSheet.create({
1039
+ const styleObject = transformDeclPairs__default["default"](declPairs);
1040
+ const styles = styleSheet.create({
1060
1041
  generated: styleObject,
1061
1042
  });
1062
1043
  generated[hash] = styles.generated;
1063
1044
  }
1064
1045
  return generated[hash];
1065
- };
1066
- return InlineStyle;
1067
- }());
1046
+ }
1047
+ };
1068
1048
  return InlineStyle;
1069
1049
  }
1070
1050
 
@@ -1076,23 +1056,22 @@ function isTag(target) {
1076
1056
  }
1077
1057
 
1078
1058
  function generateDisplayName(target) {
1079
- return isTag(target) ? "styled.".concat(target) : "Styled(".concat(getComponentName(target), ")");
1059
+ return isTag(target) ? `styled.${target}` : `Styled(${getComponentName(target)})`;
1080
1060
  }
1081
1061
 
1082
- function mixinRecursively(target, source, forceMerge) {
1083
- if (forceMerge === void 0) { forceMerge = false; }
1062
+ function mixinRecursively(target, source, forceMerge = false) {
1084
1063
  /* only merge into POJOs, Arrays, but for top level objects only
1085
1064
  * allow to merge into anything by passing forceMerge = true */
1086
1065
  if (!forceMerge && !isPlainObject(target) && !Array.isArray(target)) {
1087
1066
  return source;
1088
1067
  }
1089
1068
  if (Array.isArray(source)) {
1090
- for (var key = 0; key < source.length; key++) {
1069
+ for (let key = 0; key < source.length; key++) {
1091
1070
  target[key] = mixinRecursively(target[key], source[key]);
1092
1071
  }
1093
1072
  }
1094
1073
  else if (isPlainObject(source)) {
1095
- for (var key in source) {
1074
+ for (const key in source) {
1096
1075
  target[key] = mixinRecursively(target[key], source[key]);
1097
1076
  }
1098
1077
  }
@@ -1103,39 +1082,23 @@ function mixinRecursively(target, source, forceMerge) {
1103
1082
  * If target is not a POJO or an Array, it will get source properties injected via shallow merge
1104
1083
  * Source objects applied left to right. Mutates & returns target. Similar to lodash merge.
1105
1084
  */
1106
- function mixinDeep(target) {
1107
- var e_1, _a;
1108
- if (target === void 0) { target = {}; }
1109
- var sources = [];
1110
- for (var _i = 1; _i < arguments.length; _i++) {
1111
- sources[_i - 1] = arguments[_i];
1112
- }
1113
- try {
1114
- for (var sources_1 = tslib.__values(sources), sources_1_1 = sources_1.next(); !sources_1_1.done; sources_1_1 = sources_1.next()) {
1115
- var source = sources_1_1.value;
1116
- mixinRecursively(target, source, true);
1117
- }
1118
- }
1119
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1120
- finally {
1121
- try {
1122
- if (sources_1_1 && !sources_1_1.done && (_a = sources_1.return)) _a.call(sources_1);
1123
- }
1124
- finally { if (e_1) throw e_1.error; }
1085
+ function mixinDeep(target = {}, ...sources) {
1086
+ for (const source of sources) {
1087
+ mixinRecursively(target, source, true);
1125
1088
  }
1126
1089
  return target;
1127
1090
  }
1128
1091
 
1129
- function useResolvedAttrs(theme, props, attrs) {
1130
- if (theme === void 0) { theme = EMPTY_OBJECT; }
1092
+ function useResolvedAttrs(theme = EMPTY_OBJECT, props, attrs) {
1131
1093
  // NOTE: can't memoize this
1132
1094
  // returns [context, resolvedAttrs]
1133
1095
  // where resolvedAttrs is only the things injected by the attrs themselves
1134
- var context = tslib.__assign(tslib.__assign({}, props), { theme: theme });
1135
- var resolvedAttrs = {};
1136
- attrs.forEach(function (attrDef) {
1137
- var resolvedAttrDef = typeof attrDef === 'function' ? attrDef(context) : attrDef;
1138
- var key;
1096
+ const context = { ...props, theme };
1097
+ const resolvedAttrs = {};
1098
+ attrs.forEach(attrDef => {
1099
+ // @ts-expect-error narrowing isn't working properly for some reason
1100
+ let resolvedAttrDef = typeof attrDef === 'function' ? attrDef(context) : attrDef;
1101
+ let key;
1139
1102
  /* eslint-disable guard-for-in */
1140
1103
  for (key in resolvedAttrDef) {
1141
1104
  // @ts-expect-error bad types
@@ -1146,21 +1109,21 @@ function useResolvedAttrs(theme, props, attrs) {
1146
1109
  return [context, resolvedAttrs];
1147
1110
  }
1148
1111
  // Validator defaults to true if not in HTML/DOM env
1149
- var validAttr = function () { return true; };
1112
+ const validAttr = () => true;
1150
1113
  function useStyledComponentImpl(forwardedComponent, props, forwardedRef) {
1151
- var componentAttrs = forwardedComponent.attrs, inlineStyle = forwardedComponent.inlineStyle, defaultProps = forwardedComponent.defaultProps, shouldForwardProp = forwardedComponent.shouldForwardProp, target = forwardedComponent.target;
1114
+ const { attrs: componentAttrs, inlineStyle, defaultProps, shouldForwardProp, target, } = forwardedComponent;
1152
1115
  // NOTE: the non-hooks version only subscribes to this when !componentStyle.isStatic,
1153
1116
  // but that'd be against the rules-of-hooks. We could be naughty and do it anyway as it
1154
1117
  // should be an immutable value, but behave for now.
1155
- var theme = determineTheme(props, React.useContext(ThemeContext), defaultProps);
1156
- var _a = tslib.__read(useResolvedAttrs(theme || EMPTY_OBJECT, props, componentAttrs), 2), context = _a[0], attrs = _a[1];
1157
- var generatedStyles = inlineStyle.generateStyleObject(context);
1158
- var refToForward = forwardedRef;
1159
- var elementToBeCreated = attrs.$as || props.$as || attrs.as || props.as || target;
1160
- var computedProps = attrs !== props ? tslib.__assign(tslib.__assign({}, props), attrs) : props;
1161
- var propsForElement = {};
1118
+ const theme = determineTheme(props, React.useContext(ThemeContext), defaultProps);
1119
+ const [context, attrs] = useResolvedAttrs(theme || EMPTY_OBJECT, props, componentAttrs);
1120
+ const generatedStyles = inlineStyle.generateStyleObject(context);
1121
+ const refToForward = forwardedRef;
1122
+ const elementToBeCreated = attrs.$as || props.$as || attrs.as || props.as || target;
1123
+ const computedProps = attrs !== props ? { ...props, ...attrs } : props;
1124
+ const propsForElement = {};
1162
1125
  // eslint-disable-next-line guard-for-in
1163
- for (var key in computedProps) {
1126
+ for (const key in computedProps) {
1164
1127
  if (key[0] === '$' || key === 'as')
1165
1128
  continue;
1166
1129
  else if (key === 'forwardedAs') {
@@ -1170,9 +1133,9 @@ function useStyledComponentImpl(forwardedComponent, props, forwardedRef) {
1170
1133
  propsForElement[key] = computedProps[key];
1171
1134
  }
1172
1135
  }
1173
- propsForElement.style = React.useMemo(function () {
1136
+ propsForElement.style = React.useMemo(() => {
1174
1137
  if (typeof props.style === 'function') {
1175
- return function (state) {
1138
+ return (state) => {
1176
1139
  return [generatedStyles].concat(props.style(state));
1177
1140
  };
1178
1141
  }
@@ -1186,42 +1149,39 @@ function useStyledComponentImpl(forwardedComponent, props, forwardedRef) {
1186
1149
  propsForElement.ref = refToForward;
1187
1150
  return React.createElement(elementToBeCreated, propsForElement);
1188
1151
  }
1189
- var _StyledNativeComponent = (function (InlineStyle) {
1190
- var createStyledNativeComponent = function (target, options, rules) {
1191
- var isTargetStyledComp = isStyledComponent(target);
1192
- var styledComponentTarget = target;
1193
- var _a = options.displayName, displayName = _a === void 0 ? generateDisplayName(target) : _a, _b = options.attrs, attrs = _b === void 0 ? EMPTY_ARRAY : _b;
1152
+ var _StyledNativeComponent = (InlineStyle) => {
1153
+ const createStyledNativeComponent = (target, options, rules) => {
1154
+ const isTargetStyledComp = isStyledComponent(target);
1155
+ const styledComponentTarget = target;
1156
+ const { displayName = generateDisplayName(target), attrs = EMPTY_ARRAY } = options;
1194
1157
  // fold the underlying StyledComponent attrs up (implicit extend)
1195
- var finalAttrs = isTargetStyledComp && styledComponentTarget.attrs
1158
+ const finalAttrs = isTargetStyledComp && styledComponentTarget.attrs
1196
1159
  ? styledComponentTarget.attrs.concat(attrs).filter(Boolean)
1197
1160
  : attrs;
1198
1161
  // eslint-disable-next-line prefer-destructuring
1199
- var shouldForwardProp = options.shouldForwardProp;
1162
+ let shouldForwardProp = options.shouldForwardProp;
1200
1163
  if (isTargetStyledComp && styledComponentTarget.shouldForwardProp) {
1201
- var shouldForwardPropFn_1 = styledComponentTarget.shouldForwardProp;
1164
+ const shouldForwardPropFn = styledComponentTarget.shouldForwardProp;
1202
1165
  if (options.shouldForwardProp) {
1203
- var passedShouldForwardPropFn_1 = options.shouldForwardProp;
1166
+ const passedShouldForwardPropFn = options.shouldForwardProp;
1204
1167
  // compose nested shouldForwardProp calls
1205
- shouldForwardProp = function (prop, filterFn, elementToBeCreated) {
1206
- return shouldForwardPropFn_1(prop, filterFn, elementToBeCreated) &&
1207
- passedShouldForwardPropFn_1(prop, filterFn, elementToBeCreated);
1208
- };
1168
+ shouldForwardProp = (prop, filterFn, elementToBeCreated) => shouldForwardPropFn(prop, filterFn, elementToBeCreated) &&
1169
+ passedShouldForwardPropFn(prop, filterFn, elementToBeCreated);
1209
1170
  }
1210
1171
  else {
1211
1172
  // eslint-disable-next-line prefer-destructuring
1212
- shouldForwardProp = shouldForwardPropFn_1;
1173
+ shouldForwardProp = shouldForwardPropFn;
1213
1174
  }
1214
1175
  }
1215
- var forwardRef = function (props, ref) {
1216
- // eslint-disable-next-line react-hooks/rules-of-hooks
1217
- return useStyledComponentImpl(WrappedStyledComponent, props, ref);
1218
- };
1176
+ const forwardRef = (props, ref) =>
1177
+ // eslint-disable-next-line react-hooks/rules-of-hooks
1178
+ useStyledComponentImpl(WrappedStyledComponent, props, ref);
1219
1179
  forwardRef.displayName = displayName;
1220
1180
  /**
1221
1181
  * forwardRef creates a new interim component, which we'll take advantage of
1222
1182
  * instead of extending ParentComponent to create _another_ interim class
1223
1183
  */
1224
- var WrappedStyledComponent = React__default['default'].forwardRef(forwardRef);
1184
+ let WrappedStyledComponent = React__default["default"].forwardRef(forwardRef);
1225
1185
  WrappedStyledComponent.attrs = finalAttrs;
1226
1186
  WrappedStyledComponent.inlineStyle = new InlineStyle(isTargetStyledComp ? styledComponentTarget.inlineStyle.rules.concat(rules) : rules);
1227
1187
  WrappedStyledComponent.displayName = displayName;
@@ -1231,14 +1191,17 @@ var _StyledNativeComponent = (function (InlineStyle) {
1231
1191
  // fold the underlying StyledComponent target up since we folded the styles
1232
1192
  WrappedStyledComponent.target = isTargetStyledComp ? styledComponentTarget.target : target;
1233
1193
  WrappedStyledComponent.withComponent = function withComponent(tag) {
1234
- var newOptions = tslib.__assign(tslib.__assign({}, options), { attrs: finalAttrs });
1194
+ const newOptions = {
1195
+ ...options,
1196
+ attrs: finalAttrs,
1197
+ };
1235
1198
  return createStyledNativeComponent(tag, newOptions, rules);
1236
1199
  };
1237
1200
  Object.defineProperty(WrappedStyledComponent, 'defaultProps', {
1238
- get: function () {
1201
+ get() {
1239
1202
  return this._foldedDefaultProps;
1240
1203
  },
1241
- set: function (obj) {
1204
+ set(obj) {
1242
1205
  this._foldedDefaultProps = isTargetStyledComp
1243
1206
  ? mixinDeep({}, styledComponentTarget.defaultProps, obj)
1244
1207
  : obj;
@@ -1256,87 +1219,60 @@ var _StyledNativeComponent = (function (InlineStyle) {
1256
1219
  return WrappedStyledComponent;
1257
1220
  };
1258
1221
  return createStyledNativeComponent;
1259
- });
1222
+ };
1260
1223
 
1261
1224
  // eslint-disable-next-line @typescript-eslint/no-var-requires
1262
- var reactNative = require('react-native');
1263
- var InlineStyle = makeInlineStyleClass(reactNative.StyleSheet);
1264
- var StyledNativeComponent = _StyledNativeComponent(InlineStyle);
1265
- var baseStyled = function (tag) {
1266
- return constructWithOptions(StyledNativeComponent, tag);
1267
- };
1225
+ const reactNative = require('react-native');
1226
+ const InlineStyle = makeInlineStyleClass(reactNative.StyleSheet);
1227
+ const StyledNativeComponent = _StyledNativeComponent(InlineStyle);
1228
+ const baseStyled = (tag) => constructWithOptions(StyledNativeComponent, tag);
1268
1229
  /* React native lazy-requires each of these modules for some reason, so let's
1269
1230
  * assume it's for a good reason and not eagerly load them all */
1270
- var aliases = [
1231
+ const aliases = [
1271
1232
  'ActivityIndicator',
1272
- 'ActivityIndicatorIOS',
1273
- 'ART',
1274
1233
  'Button',
1275
1234
  'DatePickerIOS',
1276
1235
  'DrawerLayoutAndroid',
1277
1236
  'FlatList',
1278
1237
  'Image',
1279
1238
  'ImageBackground',
1280
- 'ImageEditor',
1281
- 'ImageStore',
1282
1239
  'KeyboardAvoidingView',
1283
- 'ListView',
1284
- 'MapView',
1285
1240
  'Modal',
1286
- 'NavigatorIOS',
1287
- 'Picker',
1288
- 'PickerIOS',
1289
1241
  'Pressable',
1290
1242
  'ProgressBarAndroid',
1291
1243
  'ProgressViewIOS',
1292
- 'RecyclerViewBackedScrollView',
1293
1244
  'RefreshControl',
1294
1245
  'SafeAreaView',
1295
1246
  'ScrollView',
1296
1247
  'SectionList',
1297
- 'SegmentedControlIOS',
1298
1248
  'Slider',
1299
- 'SliderIOS',
1300
- 'SnapshotViewIOS',
1301
- 'StatusBar',
1302
- 'SwipeableListView',
1303
1249
  'Switch',
1304
- 'SwitchAndroid',
1305
- 'SwitchIOS',
1306
- 'TabBarIOS',
1307
1250
  'Text',
1308
1251
  'TextInput',
1309
- 'ToastAndroid',
1310
- 'ToolbarAndroid',
1311
- 'Touchable',
1312
1252
  'TouchableHighlight',
1313
- 'TouchableNativeFeedback',
1314
1253
  'TouchableOpacity',
1315
- 'TouchableWithoutFeedback',
1316
1254
  'View',
1317
- 'ViewPagerAndroid',
1318
1255
  'VirtualizedList',
1319
- 'WebView',
1320
1256
  ];
1321
- var styled = baseStyled;
1257
+ const styled = baseStyled;
1322
1258
  /* Define a getter for each alias which simply gets the reactNative component
1323
1259
  * and passes it to styled */
1324
- aliases.forEach(function (alias) {
1325
- return Object.defineProperty(styled, alias, {
1326
- enumerable: true,
1327
- configurable: false,
1328
- get: function () {
1329
- // @ts-expect-error supporting old imports in some cases
1260
+ aliases.forEach(alias => Object.defineProperty(styled, alias, {
1261
+ enumerable: true,
1262
+ configurable: false,
1263
+ get() {
1264
+ if (alias in reactNative && reactNative[alias]) {
1330
1265
  return styled(reactNative[alias]);
1331
- },
1332
- });
1333
- });
1266
+ }
1267
+ throw new Error(`${alias} is not available in the currently-installed version of react-native`);
1268
+ },
1269
+ }));
1334
1270
 
1335
1271
  exports.ThemeConsumer = ThemeConsumer;
1336
1272
  exports.ThemeContext = ThemeContext;
1337
1273
  exports.ThemeProvider = ThemeProvider;
1338
1274
  exports.css = css;
1339
- exports['default'] = styled;
1275
+ exports["default"] = styled;
1340
1276
  exports.isStyledComponent = isStyledComponent;
1341
1277
  exports.useTheme = useTheme;
1342
1278
  exports.withTheme = withTheme;