@@ -19,6 +19,15 @@ const kindIcon = (letterPath: JSX.Element, color: string, circular = false) => (
19
19
</ svg >
20
20
) ;
21
21
22
+ const textIcon = ( letter : string , color : string , circular = false ) =>
23
+ kindIcon (
24
+ < text fill = "var(--color-icon-text)" x = "50%" y = "50%" dominant-baseline = "central" text-anchor = "middle" >
25
+ { letter }
26
+ </ text > ,
27
+ color ,
28
+ circular ,
29
+ ) ;
30
+
22
31
export function buildRefIcons < T extends Record < string , ( ) => JSX . Element > > (
23
32
icons : T ,
24
33
context : DefaultThemeRenderContext ,
@@ -50,239 +59,52 @@ export const icons: Record<
50
59
ReflectionKind | "chevronDown" | "checkbox" | "menu" | "search" | "chevronSmall" | "anchor" | "folder" ,
51
60
( ) => JSX . Element
52
61
> = {
53
- [ ReflectionKind . Accessor ] : ( ) =>
54
- kindIcon (
55
- < text
56
- fill = "var(--color-icon-text)"
57
- font-family = "var(--icon-font-family)"
58
- font-size = "var(--icon-font-size)"
59
- font-weight = "var(--icon-font-weight)"
60
- font-style = "var(--icon-font-style)"
61
- x = "6.5"
62
- y = "17.5"
63
- >
64
- A
65
- </ text > ,
66
- "var(--color-ts-accessor)" ,
67
- true ,
68
- ) ,
62
+ [ ReflectionKind . Accessor ] : ( ) => textIcon ( "A" , "var(--color-ts-accessor)" , true ) ,
69
63
[ ReflectionKind . CallSignature ] ( ) {
70
64
return this [ ReflectionKind . Function ] ( ) ;
71
65
} ,
72
- [ ReflectionKind . Class ] : ( ) =>
73
- kindIcon (
74
- < text
75
- fill = "var(--color-icon-text)"
76
- font-family = "var(--icon-font-family)"
77
- font-size = "var(--icon-font-size)"
78
- font-weight = "var(--icon-font-weight)"
79
- font-style = "var(--icon-font-style)"
80
- x = "6.5"
81
- y = "18"
82
- >
83
- C
84
- </ text > ,
85
- "var(--color-ts-class)" ,
86
- ) ,
87
- [ ReflectionKind . Constructor ] : ( ) =>
88
- kindIcon (
89
- < text
90
- fill = "var(--color-icon-text)"
91
- font-family = "var(--icon-font-family)"
92
- font-size = "var(--icon-font-size)"
93
- font-weight = "var(--icon-font-weight)"
94
- font-style = "var(--icon-font-style)"
95
- x = "6"
96
- y = "17.5"
97
- >
98
- C
99
- </ text > ,
100
- "var(--color-ts-constructor)" ,
101
- true ,
102
- ) ,
66
+ [ ReflectionKind . Class ] : ( ) => textIcon ( "C" , "var(--color-ts-class)" ) ,
67
+ [ ReflectionKind . Constructor ] : ( ) => textIcon ( "C" , "var(--color-ts-constructor)" , true ) ,
103
68
[ ReflectionKind . ConstructorSignature ] ( ) {
104
69
return this [ ReflectionKind . Constructor ] ( ) ;
105
70
} ,
106
- [ ReflectionKind . Enum ] : ( ) =>
107
- kindIcon (
108
- < text
109
- fill = "var(--color-icon-text)"
110
- font-family = "var(--icon-font-family)"
111
- font-size = "var(--icon-font-size)"
112
- font-weight = "var(--icon-font-weight)"
113
- font-style = "var(--icon-font-style)"
114
- x = "7"
115
- y = "17.5"
116
- >
117
- E
118
- </ text > ,
119
- "var(--color-ts-enum)" ,
120
- ) ,
71
+ [ ReflectionKind . Enum ] : ( ) => textIcon ( "E" , "var(--color-ts-enum)" ) ,
121
72
[ ReflectionKind . EnumMember ] ( ) {
122
73
return this [ ReflectionKind . Property ] ( ) ;
123
74
} ,
124
- [ ReflectionKind . Function ] : ( ) =>
125
- kindIcon (
126
- < text
127
- fill = "var(--color-icon-text)"
128
- font-family = "var(--icon-font-family)"
129
- font-size = "var(--icon-font-size)"
130
- font-weight = "var(--icon-font-weight)"
131
- font-style = "var(--icon-font-style)"
132
- x = "7"
133
- y = "18"
134
- >
135
- F
136
- </ text > ,
137
- "var(--color-ts-function)" ,
138
- ) ,
75
+ [ ReflectionKind . Function ] : ( ) => textIcon ( "F" , "var(--color-ts-function)" ) ,
139
76
[ ReflectionKind . GetSignature ] ( ) {
140
77
return this [ ReflectionKind . Accessor ] ( ) ;
141
78
} ,
142
79
[ ReflectionKind . IndexSignature ] ( ) {
143
80
return this [ ReflectionKind . Property ] ( ) ;
144
81
} ,
145
- [ ReflectionKind . Interface ] : ( ) =>
146
- kindIcon (
147
- < text
148
- fill = "var(--color-icon-text)"
149
- font-family = "var(--icon-font-family)"
150
- font-size = "var(--icon-font-size)"
151
- font-weight = "var(--icon-font-weight)"
152
- font-style = "var(--icon-font-style)"
153
- x = "10"
154
- y = "18"
155
- >
156
- I
157
- </ text > ,
158
- "var(--color-ts-interface)" ,
159
- ) ,
160
- [ ReflectionKind . Method ] : ( ) =>
161
- kindIcon (
162
- < text
163
- fill = "var(--color-icon-text)"
164
- font-family = "var(--icon-font-family)"
165
- font-size = "var(--icon-font-size)"
166
- font-weight = "var(--icon-font-weight)"
167
- font-style = "var(--icon-font-style)"
168
- x = "5"
169
- y = "17.5"
170
- >
171
- M
172
- </ text > ,
173
- "var(--color-ts-method)" ,
174
- true ,
175
- ) ,
176
- [ ReflectionKind . Module ] : ( ) =>
177
- kindIcon (
178
- < text
179
- fill = "var(--color-icon-text)"
180
- font-family = "var(--icon-font-family)"
181
- font-size = "var(--icon-font-size)"
182
- font-weight = "var(--icon-font-weight)"
183
- font-style = "var(--icon-font-style)"
184
- x = "5"
185
- y = "17.5"
186
- >
187
- M
188
- </ text > ,
189
- "var(--color-ts-module)" ,
190
- ) ,
191
- [ ReflectionKind . Namespace ] : ( ) =>
192
- kindIcon (
193
- < text
194
- fill = "var(--color-icon-text)"
195
- font-family = "var(--icon-font-family)"
196
- font-size = "var(--icon-font-size)"
197
- font-weight = "var(--icon-font-weight)"
198
- font-style = "var(--icon-font-style)"
199
- x = "6"
200
- y = "18"
201
- >
202
- N
203
- </ text > ,
204
- "var(--color-ts-namespace)" ,
205
- ) ,
82
+ [ ReflectionKind . Interface ] : ( ) => textIcon ( "I" , "var(--color-ts-interface)" ) ,
83
+ [ ReflectionKind . Method ] : ( ) => textIcon ( "M" , "var(--color-ts-method)" , true ) ,
84
+ [ ReflectionKind . Module ] : ( ) => textIcon ( "M" , "var(--color-ts-module)" ) ,
85
+ [ ReflectionKind . Namespace ] : ( ) => textIcon ( "N" , "var(--color-ts-namespace)" ) ,
206
86
[ ReflectionKind . Parameter ] ( ) {
207
87
return this [ ReflectionKind . Property ] ( ) ;
208
88
} ,
209
89
[ ReflectionKind . Project ] ( ) {
210
90
return this [ ReflectionKind . Module ] ( ) ;
211
91
} ,
212
- [ ReflectionKind . Property ] : ( ) =>
213
- kindIcon (
214
- < text
215
- fill = "var(--color-icon-text)"
216
- font-family = "var(--icon-font-family)"
217
- font-size = "var(--icon-font-size)"
218
- font-weight = "var(--icon-font-weight)"
219
- font-style = "var(--icon-font-style)"
220
- x = "7.5"
221
- y = "18"
222
- >
223
- P
224
- </ text > ,
225
- "var(--color-ts-property)" ,
226
- true ,
227
- ) ,
228
- [ ReflectionKind . Reference ] : ( ) =>
229
- kindIcon (
230
- < text
231
- fill = "var(--color-icon-text)"
232
- font-family = "var(--icon-font-family)"
233
- font-size = "var(--icon-font-size)"
234
- font-weight = "var(--icon-font-weight)"
235
- font-style = "var(--icon-font-style)"
236
- x = "7"
237
- y = "17.5"
238
- >
239
- R
240
- </ text > ,
241
- "var(--color-ts-reference)" ,
242
- true ,
243
- ) ,
92
+ [ ReflectionKind . Property ] : ( ) => textIcon ( "P" , "var(--color-ts-property)" , true ) ,
93
+ [ ReflectionKind . Reference ] : ( ) => textIcon ( "R" , "var(--color-ts-reference)" , true ) ,
244
94
[ ReflectionKind . SetSignature ] ( ) {
245
95
return this [ ReflectionKind . Accessor ] ( ) ;
246
96
} ,
247
- [ ReflectionKind . TypeAlias ] : ( ) =>
248
- kindIcon (
249
- < text
250
- fill = "var(--color-icon-text)"
251
- font-family = "var(--icon-font-family)"
252
- font-size = "var(--icon-font-size)"
253
- font-weight = "var(--icon-font-weight)"
254
- font-style = "var(--icon-font-style)"
255
- x = "7"
256
- y = "17.5"
257
- >
258
- T
259
- </ text > ,
260
- "var(--color-ts-type-alias)" ,
261
- ) ,
97
+ [ ReflectionKind . TypeAlias ] : ( ) => textIcon ( "T" , "var(--color-ts-type-alias)" ) ,
262
98
[ ReflectionKind . TypeLiteral ] ( ) {
263
99
return this [ ReflectionKind . TypeAlias ] ( ) ;
264
100
} ,
265
101
[ ReflectionKind . TypeParameter ] ( ) {
266
102
return this [ ReflectionKind . TypeAlias ] ( ) ;
267
103
} ,
268
- [ ReflectionKind . Variable ] : ( ) =>
269
- kindIcon (
270
- < text
271
- fill = "var(--color-icon-text)"
272
- font-family = "var(--icon-font-family)"
273
- font-size = "var(--icon-font-size)"
274
- font-weight = "var(--icon-font-weight)"
275
- font-style = "var(--icon-font-style)"
276
- x = "7"
277
- y = "18"
278
- >
279
- V
280
- </ text > ,
281
- "var(--color-ts-variable)" ,
282
- ) ,
104
+ [ ReflectionKind . Variable ] : ( ) => textIcon ( "V" , "var(--color-ts-variable)" ) ,
283
105
[ ReflectionKind . Document ] : ( ) =>
284
106
kindIcon (
285
- < g stroke = "var(--color-text)" fill = "none" stroke-width = "1.5" >
107
+ < g stroke = "var(--color-icon- text)" fill = "none" stroke-width = "1.5" >
286
108
< polygon points = "6,5 6,19 18,19, 18,10 13,5" />
287
109
< line x1 = "9" y1 = "9" x2 = "13" y2 = "9" />
288
110
< line x1 = "9" y1 = "12" x2 = "15" y2 = "12" />
@@ -292,7 +114,7 @@ export const icons: Record<
292
114
) ,
293
115
folder : ( ) =>
294
116
kindIcon (
295
- < g stroke = "var(--color-text)" fill = "none" stroke-width = "1.5" >
117
+ < g stroke = "var(--color-icon- text)" fill = "none" stroke-width = "1.5" >
296
118
< polygon points = "5,5 10,5 12,8 19,8 19,18 5,18" />
297
119
</ g > ,
298
120
"var(--color-document)" ,
0 commit comments