@swc/plugin-styled-jsx 1.5.83 → 1.5.86

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 (217) hide show
  1. package/package.json +1 -1
  2. package/swc_plugin_styled_jsx.wasm +0 -0
  3. package/transform/Cargo.toml +0 -39
  4. package/transform/src/lib.rs +0 -7
  5. package/transform/src/lifetime.rs +0 -408
  6. package/transform/src/style.rs +0 -25
  7. package/transform/src/transform_css_lightningcss.rs +0 -589
  8. package/transform/src/transform_css_swc.rs +0 -392
  9. package/transform/src/utils.rs +0 -371
  10. package/transform/src/visitor.rs +0 -963
  11. package/transform/tests/errors/nested-style-tags/input.js +0 -31
  12. package/transform/tests/errors/nested-style-tags/output-lightningcss.js +0 -58
  13. package/transform/tests/errors/nested-style-tags/output-lightningcss.stderr +0 -27
  14. package/transform/tests/errors/nested-style-tags/output-swc.js +0 -58
  15. package/transform/tests/errors/nested-style-tags/output-swc.stderr +0 -27
  16. package/transform/tests/errors/nested-style-tags/output.js +0 -58
  17. package/transform/tests/errors/no-child/input.js +0 -6
  18. package/transform/tests/errors/no-child/output-lightningcss.js +0 -8
  19. package/transform/tests/errors/no-child/output-lightningcss.stderr +0 -9
  20. package/transform/tests/errors/no-child/output-swc.js +0 -8
  21. package/transform/tests/errors/no-child/output-swc.stderr +0 -9
  22. package/transform/tests/errors/no-child/output.js +0 -8
  23. package/transform/tests/errors/ts-with-css-resolve/input.js +0 -10
  24. package/transform/tests/errors/ts-with-css-resolve/output-lightningcss.js +0 -5
  25. package/transform/tests/errors/ts-with-css-resolve/output-lightningcss.stderr +0 -2
  26. package/transform/tests/errors/ts-with-css-resolve/output-swc.js +0 -5
  27. package/transform/tests/errors/ts-with-css-resolve/output-swc.stderr +0 -2
  28. package/transform/tests/errors/ts-with-css-resolve/output.js +0 -5
  29. package/transform/tests/errors/two-children/input.js +0 -8
  30. package/transform/tests/errors/two-children/output-lightningcss.js +0 -12
  31. package/transform/tests/errors/two-children/output-lightningcss.stderr +0 -11
  32. package/transform/tests/errors/two-children/output-swc.js +0 -12
  33. package/transform/tests/errors/two-children/output-swc.stderr +0 -11
  34. package/transform/tests/errors/two-children/output.js +0 -12
  35. package/transform/tests/errors/wrong-child-type/input.js +0 -7
  36. package/transform/tests/errors/wrong-child-type/output-lightningcss.js +0 -10
  37. package/transform/tests/errors/wrong-child-type/output-lightningcss.stderr +0 -10
  38. package/transform/tests/errors/wrong-child-type/output-swc.js +0 -10
  39. package/transform/tests/errors/wrong-child-type/output-swc.stderr +0 -10
  40. package/transform/tests/errors/wrong-child-type/output.js +0 -10
  41. package/transform/tests/errors/wrong-jsx-expression-type/input.js +0 -7
  42. package/transform/tests/errors/wrong-jsx-expression-type/output-lightningcss.js +0 -10
  43. package/transform/tests/errors/wrong-jsx-expression-type/output-lightningcss.stderr +0 -10
  44. package/transform/tests/errors/wrong-jsx-expression-type/output-swc.js +0 -10
  45. package/transform/tests/errors/wrong-jsx-expression-type/output-swc.stderr +0 -10
  46. package/transform/tests/errors/wrong-jsx-expression-type/output.js +0 -10
  47. package/transform/tests/fixture/.expressions/input.js +0 -90
  48. package/transform/tests/fixture/absent/input.js +0 -6
  49. package/transform/tests/fixture/absent/output.lightningcss.js +0 -7
  50. package/transform/tests/fixture/absent/output.swc.js +0 -7
  51. package/transform/tests/fixture/attribute-generation-classname-rewriting/input.js +0 -55
  52. package/transform/tests/fixture/attribute-generation-classname-rewriting/output.lightningcss.js +0 -112
  53. package/transform/tests/fixture/attribute-generation-classname-rewriting/output.swc.js +0 -112
  54. package/transform/tests/fixture/attribute-generation-modes/input.js +0 -166
  55. package/transform/tests/fixture/attribute-generation-modes/output.lightningcss.js +0 -228
  56. package/transform/tests/fixture/attribute-generation-modes/output.swc.js +0 -228
  57. package/transform/tests/fixture/class/input.js +0 -14
  58. package/transform/tests/fixture/class/output.lightningcss.js +0 -12
  59. package/transform/tests/fixture/class/output.swc.js +0 -12
  60. package/transform/tests/fixture/comments/input.js +0 -18
  61. package/transform/tests/fixture/comments/output.lightningcss.js +0 -12
  62. package/transform/tests/fixture/comments/output.swc.js +0 -12
  63. package/transform/tests/fixture/component-attribute/input.js +0 -11
  64. package/transform/tests/fixture/component-attribute/output.lightningcss.js +0 -10
  65. package/transform/tests/fixture/component-attribute/output.swc.js +0 -10
  66. package/transform/tests/fixture/conflicts/input.js +0 -16
  67. package/transform/tests/fixture/conflicts/output.lightningcss.js +0 -14
  68. package/transform/tests/fixture/conflicts/output.swc.js +0 -14
  69. package/transform/tests/fixture/css-selector-after-pseudo/input.js +0 -18
  70. package/transform/tests/fixture/css-selector-after-pseudo/output.lightningcss.js +0 -11
  71. package/transform/tests/fixture/css-selector-after-pseudo/output.swc.js +0 -11
  72. package/transform/tests/fixture/css-tag-same-file/input.js +0 -25
  73. package/transform/tests/fixture/css-tag-same-file/output.lightningcss.js +0 -21
  74. package/transform/tests/fixture/css-tag-same-file/output.swc.js +0 -21
  75. package/transform/tests/fixture/different-jsx-ids/input.js +0 -23
  76. package/transform/tests/fixture/different-jsx-ids/output.lightningcss.js +0 -24
  77. package/transform/tests/fixture/different-jsx-ids/output.swc.js +0 -24
  78. package/transform/tests/fixture/dynamic-element/input.js +0 -56
  79. package/transform/tests/fixture/dynamic-element/output.lightningcss.js +0 -40
  80. package/transform/tests/fixture/dynamic-element/output.swc.js +0 -40
  81. package/transform/tests/fixture/dynamic-element-class/input.js +0 -32
  82. package/transform/tests/fixture/dynamic-element-class/output.lightningcss.js +0 -25
  83. package/transform/tests/fixture/dynamic-element-class/output.swc.js +0 -25
  84. package/transform/tests/fixture/dynamic-element-external/input.js +0 -12
  85. package/transform/tests/fixture/dynamic-element-external/output.lightningcss.js +0 -12
  86. package/transform/tests/fixture/dynamic-element-external/output.swc.js +0 -12
  87. package/transform/tests/fixture/dynamic-this-in-arrow/input.js +0 -41
  88. package/transform/tests/fixture/dynamic-this-in-arrow/output.lightningcss.js +0 -39
  89. package/transform/tests/fixture/dynamic-this-in-arrow/output.swc.js +0 -39
  90. package/transform/tests/fixture/exported-jsx-style/input.js +0 -1
  91. package/transform/tests/fixture/exported-jsx-style/output.lightningcss.js +0 -1
  92. package/transform/tests/fixture/exported-jsx-style/output.swc.js +0 -1
  93. package/transform/tests/fixture/exported-non-jsx-style/input.js +0 -1
  94. package/transform/tests/fixture/exported-non-jsx-style/output.lightningcss.js +0 -1
  95. package/transform/tests/fixture/exported-non-jsx-style/output.swc.js +0 -1
  96. package/transform/tests/fixture/external-nested-scope/input.js +0 -5
  97. package/transform/tests/fixture/external-nested-scope/output.lightningcss.js +0 -7
  98. package/transform/tests/fixture/external-nested-scope/output.swc.js +0 -7
  99. package/transform/tests/fixture/external-stylesheet/input.js +0 -41
  100. package/transform/tests/fixture/external-stylesheet/output.lightningcss.js +0 -34
  101. package/transform/tests/fixture/external-stylesheet/output.swc.js +0 -34
  102. package/transform/tests/fixture/external-stylesheet-global/input.js +0 -19
  103. package/transform/tests/fixture/external-stylesheet-global/output.lightningcss.js +0 -18
  104. package/transform/tests/fixture/external-stylesheet-global/output.swc.js +0 -18
  105. package/transform/tests/fixture/external-stylesheet-multi-line/input.js +0 -9
  106. package/transform/tests/fixture/external-stylesheet-multi-line/output.lightningcss.js +0 -9
  107. package/transform/tests/fixture/external-stylesheet-multi-line/output.swc.js +0 -9
  108. package/transform/tests/fixture/fragment/input.js +0 -51
  109. package/transform/tests/fixture/fragment/output.lightningcss.js +0 -47
  110. package/transform/tests/fixture/fragment/output.swc.js +0 -47
  111. package/transform/tests/fixture/global/input.js +0 -22
  112. package/transform/tests/fixture/global/output.lightningcss.js +0 -7
  113. package/transform/tests/fixture/global/output.swc.js +0 -7
  114. package/transform/tests/fixture/global-child-selector/input.js +0 -10
  115. package/transform/tests/fixture/global-child-selector/output.lightningcss.js +0 -8
  116. package/transform/tests/fixture/global-child-selector/output.swc.js +0 -8
  117. package/transform/tests/fixture/global-redundant/input.js +0 -12
  118. package/transform/tests/fixture/global-redundant/output.lightningcss.js +0 -10
  119. package/transform/tests/fixture/global-redundant/output.swc.js +0 -10
  120. package/transform/tests/fixture/issue-30480/input.js +0 -11
  121. package/transform/tests/fixture/issue-30480/output.lightningcss.js +0 -15
  122. package/transform/tests/fixture/issue-30480/output.swc.js +0 -15
  123. package/transform/tests/fixture/issue-30570/input.js +0 -15
  124. package/transform/tests/fixture/issue-30570/output.lightningcss.js +0 -12
  125. package/transform/tests/fixture/issue-30570/output.swc.js +0 -12
  126. package/transform/tests/fixture/issue-31562-interpolation-in-mdea/input.js +0 -30
  127. package/transform/tests/fixture/issue-31562-interpolation-in-mdea/output.lightningcss.js +0 -43
  128. package/transform/tests/fixture/issue-31562-interpolation-in-mdea/output.swc.js +0 -43
  129. package/transform/tests/fixture/mixed-global-scoped/input.js +0 -9
  130. package/transform/tests/fixture/mixed-global-scoped/output.lightningcss.js +0 -11
  131. package/transform/tests/fixture/mixed-global-scoped/output.swc.js +0 -11
  132. package/transform/tests/fixture/multiple-jsx/input.js +0 -43
  133. package/transform/tests/fixture/multiple-jsx/output.lightningcss.js +0 -32
  134. package/transform/tests/fixture/multiple-jsx/output.swc.js +0 -32
  135. package/transform/tests/fixture/nested-style-tags/index.js +0 -0
  136. package/transform/tests/fixture/next-54653/input.js +0 -10
  137. package/transform/tests/fixture/next-54653/output.lightningcss.js +0 -3
  138. package/transform/tests/fixture/next-54653/output.swc.js +0 -3
  139. package/transform/tests/fixture/non-styled-jsx-style/input.js +0 -7
  140. package/transform/tests/fixture/non-styled-jsx-style/output.lightningcss.js +0 -12
  141. package/transform/tests/fixture/non-styled-jsx-style/output.swc.js +0 -12
  142. package/transform/tests/fixture/not-styled-jsx-tagged-templates/input.js +0 -30
  143. package/transform/tests/fixture/not-styled-jsx-tagged-templates/output.lightningcss.js +0 -23
  144. package/transform/tests/fixture/not-styled-jsx-tagged-templates/output.swc.js +0 -23
  145. package/transform/tests/fixture/number-after-placeholder/input.js +0 -17
  146. package/transform/tests/fixture/number-after-placeholder/output.lightningcss.js +0 -17
  147. package/transform/tests/fixture/number-after-placeholder/output.swc.js +0 -17
  148. package/transform/tests/fixture/one-off-global-selectors/input.js +0 -10
  149. package/transform/tests/fixture/one-off-global-selectors/output.lightningcss.js +0 -8
  150. package/transform/tests/fixture/one-off-global-selectors/output.swc.js +0 -8
  151. package/transform/tests/fixture/source-maps/input.js +0 -8
  152. package/transform/tests/fixture/source-maps/output.lightningcss.js +0 -8
  153. package/transform/tests/fixture/source-maps/output.swc.js +0 -8
  154. package/transform/tests/fixture/stateless/input.js +0 -8
  155. package/transform/tests/fixture/stateless/output.lightningcss.js +0 -12
  156. package/transform/tests/fixture/stateless/output.swc.js +0 -12
  157. package/transform/tests/fixture/styles/input.js +0 -57
  158. package/transform/tests/fixture/styles/output.lightningcss.js +0 -39
  159. package/transform/tests/fixture/styles/output.swc.js +0 -39
  160. package/transform/tests/fixture/styles-external-invalid/input.js +0 -13
  161. package/transform/tests/fixture/styles-external-invalid/output.lightningcss.js +0 -9
  162. package/transform/tests/fixture/styles-external-invalid/output.swc.js +0 -9
  163. package/transform/tests/fixture/styles-external-invalid2/input.js +0 -11
  164. package/transform/tests/fixture/styles-external-invalid2/output.lightningcss.js +0 -8
  165. package/transform/tests/fixture/styles-external-invalid2/output.swc.js +0 -8
  166. package/transform/tests/fixture/styles2/input.js +0 -6
  167. package/transform/tests/fixture/styles2/output.lightningcss.js +0 -5
  168. package/transform/tests/fixture/styles2/output.swc.js +0 -5
  169. package/transform/tests/fixture/too-many/input.js +0 -35
  170. package/transform/tests/fixture/too-many/output.lightningcss.js +0 -49
  171. package/transform/tests/fixture/too-many/output.swc.js +0 -49
  172. package/transform/tests/fixture/tpl-escape-1/input.js +0 -14
  173. package/transform/tests/fixture/tpl-escape-1/output.lightningcss.js +0 -12
  174. package/transform/tests/fixture/tpl-escape-1/output.swc.js +0 -12
  175. package/transform/tests/fixture/tpl-escape-2/input.js +0 -17
  176. package/transform/tests/fixture/tpl-escape-2/output.lightningcss.js +0 -17
  177. package/transform/tests/fixture/tpl-escape-2/output.swc.js +0 -17
  178. package/transform/tests/fixture/tpl-placeholder-1-as-property/input.js +0 -17
  179. package/transform/tests/fixture/tpl-placeholder-1-as-property/output.lightningcss.js +0 -28
  180. package/transform/tests/fixture/tpl-placeholder-1-as-property/output.swc.js +0 -28
  181. package/transform/tests/fixture/tpl-placeholder-2-as-part-of-value/input.js +0 -21
  182. package/transform/tests/fixture/tpl-placeholder-2-as-part-of-value/output.lightningcss.js +0 -34
  183. package/transform/tests/fixture/tpl-placeholder-2-as-part-of-value/output.swc.js +0 -34
  184. package/transform/tests/fixture/tpl-placeholder-3-as-value/input.js +0 -17
  185. package/transform/tests/fixture/tpl-placeholder-3-as-value/output.lightningcss.js +0 -28
  186. package/transform/tests/fixture/tpl-placeholder-3-as-value/output.swc.js +0 -28
  187. package/transform/tests/fixture/tpl-placeholder-4-as-part-of-value-in-multiple/input.js +0 -17
  188. package/transform/tests/fixture/tpl-placeholder-4-as-part-of-value-in-multiple/output.lightningcss.js +0 -31
  189. package/transform/tests/fixture/tpl-placeholder-4-as-part-of-value-in-multiple/output.swc.js +0 -31
  190. package/transform/tests/fixture/tpl-placeholder-5-values-of-multiple-properties/input.js +0 -16
  191. package/transform/tests/fixture/tpl-placeholder-5-values-of-multiple-properties/output.lightningcss.js +0 -31
  192. package/transform/tests/fixture/tpl-placeholder-5-values-of-multiple-properties/output.swc.js +0 -31
  193. package/transform/tests/fixture/transform-css/input.js +0 -176
  194. package/transform/tests/fixture/transform-css/output.lightningcss.js +0 -8
  195. package/transform/tests/fixture/transform-css/output.swc.js +0 -8
  196. package/transform/tests/fixture/transform-css-complex-selector/input.js +0 -116
  197. package/transform/tests/fixture/transform-css-complex-selector/output.lightningcss.js +0 -8
  198. package/transform/tests/fixture/transform-css-complex-selector/output.swc.js +0 -8
  199. package/transform/tests/fixture/transform-css-complex-selector-2/input.js +0 -12
  200. package/transform/tests/fixture/transform-css-complex-selector-2/output.lightningcss.js +0 -8
  201. package/transform/tests/fixture/transform-css-complex-selector-2/output.swc.js +0 -8
  202. package/transform/tests/fixture/transform-css-global/input.js +0 -32
  203. package/transform/tests/fixture/transform-css-global/output.lightningcss.js +0 -8
  204. package/transform/tests/fixture/transform-css-global/output.swc.js +0 -8
  205. package/transform/tests/fixture/transform-css-media-query/input.js +0 -24
  206. package/transform/tests/fixture/transform-css-media-query/output.lightningcss.js +0 -8
  207. package/transform/tests/fixture/transform-css-media-query/output.swc.js +0 -8
  208. package/transform/tests/fixture/transform-css-normal/input.js +0 -22
  209. package/transform/tests/fixture/transform-css-normal/output.lightningcss.js +0 -8
  210. package/transform/tests/fixture/transform-css-normal/output.swc.js +0 -8
  211. package/transform/tests/fixture/transform-css-nth-1/input.js +0 -10
  212. package/transform/tests/fixture/transform-css-nth-1/output.lightningcss.js +0 -8
  213. package/transform/tests/fixture/transform-css-nth-1/output.swc.js +0 -8
  214. package/transform/tests/fixture/whitespace/input.js +0 -12
  215. package/transform/tests/fixture/whitespace/output.lightningcss.js +0 -12
  216. package/transform/tests/fixture/whitespace/output.swc.js +0 -12
  217. package/transform/tests/fixture.rs +0 -129
@@ -1,31 +0,0 @@
1
- const Component = () => (
2
- <>
3
- <header>
4
- <Comp>
5
- <style jsx>{styles}</style>
6
- <style jsx global>{``}</style>
7
- </Comp>
8
- <p><style jsx>{``}</style></p>
9
- </header>
10
- <div>
11
- <h1>
12
- Welcome!
13
- <style jsx>{``}</style>
14
- </h1>
15
- <style jsx>{``}</style>
16
- </div>
17
- <div>
18
- <style jsx>{``}</style>
19
- <h1>
20
- Hello world!
21
- <style jsx global>{``}</style>
22
- </h1>
23
- </div>
24
- <div>
25
- <>
26
- <style jsx>{styles}</style>
27
- </>
28
- <style jsx>{``}</style>
29
- </div>
30
- </>
31
- )
@@ -1,58 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- const Component = ()=><>
3
-
4
- <header>
5
-
6
- <Comp>
7
-
8
- <_JSXStyle id={styles.__hash}>{styles}</_JSXStyle>
9
-
10
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle>
11
-
12
- </Comp>
13
-
14
- <p className={"jsx-b3e1b6a7c9b96113"}><_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle></p>
15
-
16
- </header>
17
-
18
- <div className={"jsx-b3e1b6a7c9b96113"}>
19
-
20
- <h1 className={"jsx-b3e1b6a7c9b96113"}>
21
-
22
- Welcome!
23
-
24
- <style jsx>{``}</style>
25
-
26
- </h1>
27
-
28
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle>
29
-
30
- </div>
31
-
32
- <div className={"jsx-b3e1b6a7c9b96113"}>
33
-
34
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle>
35
-
36
- <h1 className={"jsx-b3e1b6a7c9b96113"}>
37
-
38
- Hello world!
39
-
40
- <style jsx global>{``}</style>
41
-
42
- </h1>
43
-
44
- </div>
45
-
46
- <div className={"jsx-b3e1b6a7c9b96113"}>
47
-
48
- <>
49
-
50
- <style jsx>{styles}</style>
51
-
52
- </>
53
-
54
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle>
55
-
56
- </div>
57
-
58
- </>;
@@ -1,27 +0,0 @@
1
-
2
- x Detected nested styled-jsx tag.
3
- | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
4
- ,-[input.js:12:1]
5
- 12 | Welcome!
6
- 13 | <style jsx>{``}</style>
7
- : ^^^^^^^^^^^^^^^^^^^^^^^
8
- 14 | </h1>
9
- `----
10
-
11
- x Detected nested styled-jsx tag.
12
- | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
13
- ,-[input.js:20:1]
14
- 20 | Hello world!
15
- 21 | <style jsx global>{``}</style>
16
- : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17
- 22 | </h1>
18
- `----
19
-
20
- x Detected nested styled-jsx tag.
21
- | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
22
- ,-[input.js:25:1]
23
- 25 | <>
24
- 26 | <style jsx>{styles}</style>
25
- : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
26
- 27 | </>
27
- `----
@@ -1,58 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- const Component = ()=><>
3
-
4
- <header>
5
-
6
- <Comp>
7
-
8
- <_JSXStyle id={styles.__hash}>{styles}</_JSXStyle>
9
-
10
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle>
11
-
12
- </Comp>
13
-
14
- <p className={"jsx-b3e1b6a7c9b96113"}><_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle></p>
15
-
16
- </header>
17
-
18
- <div className={"jsx-b3e1b6a7c9b96113"}>
19
-
20
- <h1 className={"jsx-b3e1b6a7c9b96113"}>
21
-
22
- Welcome!
23
-
24
- <style jsx>{``}</style>
25
-
26
- </h1>
27
-
28
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle>
29
-
30
- </div>
31
-
32
- <div className={"jsx-b3e1b6a7c9b96113"}>
33
-
34
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle>
35
-
36
- <h1 className={"jsx-b3e1b6a7c9b96113"}>
37
-
38
- Hello world!
39
-
40
- <style jsx global>{``}</style>
41
-
42
- </h1>
43
-
44
- </div>
45
-
46
- <div className={"jsx-b3e1b6a7c9b96113"}>
47
-
48
- <>
49
-
50
- <style jsx>{styles}</style>
51
-
52
- </>
53
-
54
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle>
55
-
56
- </div>
57
-
58
- </>;
@@ -1,27 +0,0 @@
1
-
2
- x Detected nested styled-jsx tag.
3
- | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
4
- ,-[input.js:12:1]
5
- 12 | Welcome!
6
- 13 | <style jsx>{``}</style>
7
- : ^^^^^^^^^^^^^^^^^^^^^^^
8
- 14 | </h1>
9
- `----
10
-
11
- x Detected nested styled-jsx tag.
12
- | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
13
- ,-[input.js:20:1]
14
- 20 | Hello world!
15
- 21 | <style jsx global>{``}</style>
16
- : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17
- 22 | </h1>
18
- `----
19
-
20
- x Detected nested styled-jsx tag.
21
- | Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
22
- ,-[input.js:25:1]
23
- 25 | <>
24
- 26 | <style jsx>{styles}</style>
25
- : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
26
- 27 | </>
27
- `----
@@ -1,58 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- const Component = ()=><>
3
-
4
- <header>
5
-
6
- <Comp>
7
-
8
- <_JSXStyle id={styles.__hash}>{styles}</_JSXStyle>
9
-
10
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle>
11
-
12
- </Comp>
13
-
14
- <p className={"jsx-b3e1b6a7c9b96113"}><_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle></p>
15
-
16
- </header>
17
-
18
- <div className={"jsx-b3e1b6a7c9b96113"}>
19
-
20
- <h1 className={"jsx-b3e1b6a7c9b96113"}>
21
-
22
- Welcome!
23
-
24
- <style jsx>{``}</style>
25
-
26
- </h1>
27
-
28
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle>
29
-
30
- </div>
31
-
32
- <div className={"jsx-b3e1b6a7c9b96113"}>
33
-
34
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle>
35
-
36
- <h1 className={"jsx-b3e1b6a7c9b96113"}>
37
-
38
- Hello world!
39
-
40
- <style jsx global>{``}</style>
41
-
42
- </h1>
43
-
44
- </div>
45
-
46
- <div className={"jsx-b3e1b6a7c9b96113"}>
47
-
48
- <>
49
-
50
- <style jsx>{styles}</style>
51
-
52
- </>
53
-
54
- <_JSXStyle id={"b3e1b6a7c9b96113"}>{""}</_JSXStyle>
55
-
56
- </div>
57
-
58
- </>;
@@ -1,6 +0,0 @@
1
- export default () => (
2
- <div>
3
- <style jsx>
4
- </style>
5
- </div>
6
- )
@@ -1,8 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default (()=><div>
3
-
4
- <style jsx>
5
-
6
- </style>
7
-
8
- </div>);
@@ -1,9 +0,0 @@
1
-
2
- x Expected one child under JSX style tag, but got 0.
3
- | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
4
- ,-[input.js:2:1]
5
- 2 | <div>
6
- 3 | ,-> <style jsx>
7
- 4 | `-> </style>
8
- 5 | </div>
9
- `----
@@ -1,8 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default (()=><div>
3
-
4
- <style jsx>
5
-
6
- </style>
7
-
8
- </div>);
@@ -1,9 +0,0 @@
1
-
2
- x Expected one child under JSX style tag, but got 0.
3
- | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
4
- ,-[input.js:2:1]
5
- 2 | <div>
6
- 3 | ,-> <style jsx>
7
- 4 | `-> </style>
8
- 5 | </div>
9
- `----
@@ -1,8 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default (()=><div>
3
-
4
- <style jsx>
5
-
6
- </style>
7
-
8
- </div>);
@@ -1,10 +0,0 @@
1
- import css from 'styled-jsx/css'
2
-
3
- export default css.resolve`
4
- .container {
5
- background: #000;
6
- color: white;
7
- font-weight: 700;
8
- height: 100px;
9
- }
10
- `
@@ -1,5 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default {
3
- styles: <_JSXStyle id={"71f03d42ea0ec6"}>{".container.jsx-71f03d42ea0ec6{color:#fff;background:#000;height:100px;font-weight:700}"}</_JSXStyle>,
4
- className: "jsx-71f03d42ea0ec6"
5
- };
@@ -1,2 +0,0 @@
1
-
2
- x /some-project/src/some-file.ts uses `css.resolve`, but ends with `.ts`. The file extension needs to be `.tsx` so that the jsx injected by `css.resolve` will be transformed.
@@ -1,5 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default {
3
- styles: <_JSXStyle id={"71f03d42ea0ec6"}>{".container.jsx-71f03d42ea0ec6{background:#000;color:white;font-weight:700;height:100px}"}</_JSXStyle>,
4
- className: "jsx-71f03d42ea0ec6"
5
- };
@@ -1,2 +0,0 @@
1
-
2
- x /some-project/src/some-file.ts uses `css.resolve`, but ends with `.ts`. The file extension needs to be `.tsx` so that the jsx injected by `css.resolve` will be transformed.
@@ -1,5 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default {
3
- styles: <_JSXStyle id={"71f03d42ea0ec6"}>{".container.jsx-71f03d42ea0ec6{background:#000;color:white;font-weight:700;height:100px}"}</_JSXStyle>,
4
- className: "jsx-71f03d42ea0ec6"
5
- };
@@ -1,8 +0,0 @@
1
- export default () => (
2
- <div>
3
- <style jsx>
4
- {`.p {}`}
5
- {`.p {}`}
6
- </style>
7
- </div>
8
- )
@@ -1,12 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default (()=><div>
3
-
4
- <style jsx>
5
-
6
- {`.p {}`}
7
-
8
- {`.p {}`}
9
-
10
- </style>
11
-
12
- </div>);
@@ -1,11 +0,0 @@
1
-
2
- x Expected one child under JSX style tag, but got 2.
3
- | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
4
- ,-[input.js:2:1]
5
- 2 | <div>
6
- 3 | ,-> <style jsx>
7
- 4 | | {`.p {}`}
8
- 5 | | {`.p {}`}
9
- 6 | `-> </style>
10
- 7 | </div>
11
- `----
@@ -1,12 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default (()=><div>
3
-
4
- <style jsx>
5
-
6
- {`.p {}`}
7
-
8
- {`.p {}`}
9
-
10
- </style>
11
-
12
- </div>);
@@ -1,11 +0,0 @@
1
-
2
- x Expected one child under JSX style tag, but got 2.
3
- | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
4
- ,-[input.js:2:1]
5
- 2 | <div>
6
- 3 | ,-> <style jsx>
7
- 4 | | {`.p {}`}
8
- 5 | | {`.p {}`}
9
- 6 | `-> </style>
10
- 7 | </div>
11
- `----
@@ -1,12 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default (()=><div>
3
-
4
- <style jsx>
5
-
6
- {`.p {}`}
7
-
8
- {`.p {}`}
9
-
10
- </style>
11
-
12
- </div>);
@@ -1,7 +0,0 @@
1
- export default () => (
2
- <div>
3
- <style jsx>
4
- 10
5
- </style>
6
- </div>
7
- )
@@ -1,10 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default (()=><div>
3
-
4
- <style jsx>
5
-
6
- 10
7
-
8
- </style>
9
-
10
- </div>);
@@ -1,10 +0,0 @@
1
-
2
- x Expected a single child of type JSXExpressionContainer under JSX Style tag.
3
- | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
4
- ,-[input.js:2:1]
5
- 2 | <div>
6
- 3 | ,-> <style jsx>
7
- 4 | | 10
8
- 5 | `-> </style>
9
- 6 | </div>
10
- `----
@@ -1,10 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default (()=><div>
3
-
4
- <style jsx>
5
-
6
- 10
7
-
8
- </style>
9
-
10
- </div>);
@@ -1,10 +0,0 @@
1
-
2
- x Expected a single child of type JSXExpressionContainer under JSX Style tag.
3
- | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
4
- ,-[input.js:2:1]
5
- 2 | <div>
6
- 3 | ,-> <style jsx>
7
- 4 | | 10
8
- 5 | `-> </style>
9
- 6 | </div>
10
- `----
@@ -1,10 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default (()=><div>
3
-
4
- <style jsx>
5
-
6
- 10
7
-
8
- </style>
9
-
10
- </div>);
@@ -1,7 +0,0 @@
1
- export default () => (
2
- <div>
3
- <style jsx>
4
- {[]}
5
- </style>
6
- </div>
7
- )
@@ -1,10 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default (()=><div>
3
-
4
- <style jsx>
5
-
6
- {[]}
7
-
8
- </style>
9
-
10
- </div>);
@@ -1,10 +0,0 @@
1
-
2
- x Expected a template literal, string or identifier inside the JSXExpressionContainer.
3
- | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
4
- ,-[input.js:2:1]
5
- 2 | <div>
6
- 3 | ,-> <style jsx>
7
- 4 | | {[]}
8
- 5 | `-> </style>
9
- 6 | </div>
10
- `----
@@ -1,10 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default (()=><div>
3
-
4
- <style jsx>
5
-
6
- {[]}
7
-
8
- </style>
9
-
10
- </div>);
@@ -1,10 +0,0 @@
1
-
2
- x Expected a template literal, string or identifier inside the JSXExpressionContainer.
3
- | Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
4
- ,-[input.js:2:1]
5
- 2 | <div>
6
- 3 | ,-> <style jsx>
7
- 4 | | {[]}
8
- 5 | `-> </style>
9
- 6 | </div>
10
- `----
@@ -1,10 +0,0 @@
1
- import _JSXStyle from "styled-jsx/style";
2
- export default (()=><div>
3
-
4
- <style jsx>
5
-
6
- {[]}
7
-
8
- </style>
9
-
10
- </div>);
@@ -1,90 +0,0 @@
1
- const darken = c => c
2
- const color = 'red'
3
- const otherColor = 'green'
4
- const mediumScreen = '680px'
5
- const animationDuration = '200ms'
6
- const animationName = 'my-cool-animation'
7
- const obj = { display: 'block' }
8
-
9
- export default ({ display }) => (
10
- <div>
11
- <p>test</p>
12
- <style jsx>{`
13
- p.${color} {
14
- color: ${otherColor};
15
- display: ${obj.display};
16
- }
17
- `}</style>
18
- <style jsx>{'p { color: red }'}</style>
19
- <style jsx global>{`
20
- body {
21
- background: ${color};
22
- }
23
- `}</style>
24
- <style jsx global>{`
25
- body {
26
- background: ${color};
27
- }
28
- `}</style>
29
- // TODO: the next two should have the same hash
30
- <style jsx>{`
31
- p {
32
- color: ${color};
33
- }
34
- `}</style>
35
- <style jsx>{`
36
- p {
37
- color: ${color};
38
- }
39
- `}</style>
40
- <style jsx>{`
41
- p {
42
- color: ${darken(color)};
43
- }
44
- `}</style>
45
- <style jsx>{`
46
- p {
47
- color: ${darken(color) + 2};
48
- }
49
- `}</style>
50
- <style jsx>{`
51
- @media (min-width: ${mediumScreen}) {
52
- p {
53
- color: green;
54
- }
55
- p {
56
- color: ${`red`};
57
- }
58
- }
59
- p {
60
- color: red;
61
- }
62
- `}</style>
63
- <style jsx>{`
64
- p {
65
- animation-duration: ${animationDuration};
66
- }
67
- `}</style>
68
- <style jsx>{`
69
- p {
70
- animation: ${animationDuration} forwards ${animationName};
71
- }
72
- div {
73
- background: ${color};
74
- }
75
- `}</style>
76
-
77
- <style jsx>{`
78
- span {
79
- display: ${display ? 'block' : 'none'};
80
- }
81
- `}</style>
82
- // TODO: causes bad syntax
83
- {/* <style jsx>{`
84
- span:before {
85
- display: ${display ? 'block' : 'none'};
86
- content: '\`';
87
- }
88
- `}</style> */}
89
- </div>
90
- )
@@ -1,6 +0,0 @@
1
- const a = () => (
2
- <div>
3
- <p>hi</p>
4
- <style>{'woot'}</style>
5
- </div>
6
- )