-
Notifications
You must be signed in to change notification settings - Fork 26.1k
/
output.js
228 lines (188 loc) · 5.95 KB
/
output.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
import _JSXStyle from "next/dist/shared/lib/styled-jsx/style";
import styles from './styles';
const styles2 = require('./styles2');
// external only
export const Test1 = ()=><div className={`jsx-${styles2.__hash} jsx-${styles.__hash}`}>
<p className={`jsx-${styles2.__hash} jsx-${styles.__hash}`}>external only</p>
<_JSXStyle id={styles.__hash}>{styles}</_JSXStyle>
<_JSXStyle id={styles2.__hash}>{styles2}</_JSXStyle>
</div>;
// external and static
export const Test2 = ()=><div className={"jsx-81a68341e430a972 " + `jsx-${styles.__hash}`}>
<p className={"jsx-81a68341e430a972 " + `jsx-${styles.__hash}`}>external and static</p>
<_JSXStyle id={"81a68341e430a972"}>{"p.jsx-81a68341e430a972{color:red}"}</_JSXStyle>
<_JSXStyle id={styles.__hash}>{styles}</_JSXStyle>
</div>;
// external and dynamic
export const Test3 = ({ color })=><div className={`jsx-${styles.__hash}` + " " + _JSXStyle.dynamic([
[
"e7486f61219e66af",
[
color
]
]
])}>
<p className={`jsx-${styles.__hash}` + " " + _JSXStyle.dynamic([
[
"e7486f61219e66af",
[
color
]
]
])}>external and dynamic</p>
<_JSXStyle id={"e7486f61219e66af"} dynamic={[
color
]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle>
<_JSXStyle id={styles.__hash}>{styles}</_JSXStyle>
</div>;
// external, static and dynamic
export const Test4 = ({ color })=><div className={`jsx-${styles.__hash}` + " jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([
[
"9ef7fdf2e339f135",
[
color
]
]
])}>
<p className={`jsx-${styles.__hash}` + " jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([
[
"9ef7fdf2e339f135",
[
color
]
]
])}>external, static and dynamic</p>
<_JSXStyle id={"ceba8c9ce34e3d0c"}>{"p.jsx-ceba8c9ce34e3d0c{display:inline-block}"}</_JSXStyle>
<_JSXStyle id={"9ef7fdf2e339f135"} dynamic={[
color
]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle>
<_JSXStyle id={styles.__hash}>{styles}</_JSXStyle>
</div>;
// static only
export const Test5 = ()=><div className={"jsx-df0159ebd3f9fb6f"}>
<p className={"jsx-df0159ebd3f9fb6f"}>static only</p>
<_JSXStyle id={"ceba8c9ce34e3d0c"}>{"p.jsx-df0159ebd3f9fb6f{display:inline-block}"}</_JSXStyle>
<_JSXStyle id={"81a68341e430a972"}>{"p.jsx-df0159ebd3f9fb6f{color:red}"}</_JSXStyle>
</div>;
// static and dynamic
export const Test6 = ({ color })=><div className={"jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([
[
"9ef7fdf2e339f135",
[
color
]
]
])}>
<p className={"jsx-ceba8c9ce34e3d0c " + _JSXStyle.dynamic([
[
"9ef7fdf2e339f135",
[
color
]
]
])}>static and dynamic</p>
<_JSXStyle id={"ceba8c9ce34e3d0c"}>{"p.jsx-ceba8c9ce34e3d0c{display:inline-block}"}</_JSXStyle>
<_JSXStyle id={"9ef7fdf2e339f135"} dynamic={[
color
]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle>
</div>;
// dynamic only
export const Test7 = ({ color })=><div className={_JSXStyle.dynamic([
[
"e7486f61219e66af",
[
color
]
]
])}>
<p className={_JSXStyle.dynamic([
[
"e7486f61219e66af",
[
color
]
]
])}>dynamic only</p>
<_JSXStyle id={"e7486f61219e66af"} dynamic={[
color
]}>{`p.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle>
</div>;
// dynamic with scoped compound variable
export const Test8 = ({ color })=>{
if (color) {
const innerProps = {
color
};
return <div className={_JSXStyle.dynamic([
[
"1f1fbf7e754ca7cb",
[
innerProps.color
]
]
])}>
<p className={_JSXStyle.dynamic([
[
"1f1fbf7e754ca7cb",
[
innerProps.color
]
]
])}>dynamic with scoped compound variable</p>
<_JSXStyle id={"1f1fbf7e754ca7cb"} dynamic={[
innerProps.color
]}>{`p.__jsx-style-dynamic-selector{color:${innerProps.color}}`}</_JSXStyle>
</div>;
}
};
// dynamic with compound variable
export const Test9 = ({ color })=>{
const innerProps = {
color
};
return <div className={_JSXStyle.dynamic([
[
"460abeb3d95fb60d",
[
innerProps.color
]
]
])}>
<p className={_JSXStyle.dynamic([
[
"460abeb3d95fb60d",
[
innerProps.color
]
]
])}>dynamic with compound variable</p>
<_JSXStyle id={"460abeb3d95fb60d"} dynamic={[
innerProps.color
]}>{`p.__jsx-style-dynamic-selector{color:${innerProps.color}}`}</_JSXStyle>
</div>;
};
const foo = 'red';
// dynamic with constant variable
export const Test10 = ()=><div className={"jsx-f849b7a02be96503"}>
<p className={"jsx-f849b7a02be96503"}>dynamic with constant variable</p>
<_JSXStyle id={"f849b7a02be96503"}>{`p.jsx-f849b7a02be96503{color:${foo}}`}</_JSXStyle>
</div>;
// dynamic with complex scope
export const Test11 = ({ color })=>{
const items = Array.from({
length: 5
}).map((item, i)=><li key={i} className={_JSXStyle.dynamic([
[
"307a31332e39b502",
[
color
]
]
]) + " " + "item"}>
<_JSXStyle id={"307a31332e39b502"} dynamic={[
color
]}>{`.item.__jsx-style-dynamic-selector{color:${color}}`}</_JSXStyle>
Item #{i + 1}
</li>);
return <ul className="items">{items}</ul>;
};