-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypescriptreact.json
More file actions
397 lines (397 loc) · 9.9 KB
/
typescriptreact.json
File metadata and controls
397 lines (397 loc) · 9.9 KB
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
{
"MUI Typography Component": {
"prefix": "muiTypography",
"body": [
"<Typography fontWeight={${1:500}} fontSize=\"${2:SIZE}\" lineHeight=\"${3:HEIGHT}\">",
" ${4:TEXT}",
"</Typography>"
],
"description": "Insert a Typography component with customizable weight, size, height, and text."
},
"New React Component": {
"prefix": "newComponent",
"body": [
"type ${1:NewComponent}PropsType = {",
" // Add props here",
"}",
"",
"const ${1:NewComponent} = (props: ${1:NewComponent}PropsType) => {",
" // Add logic here",
" return (",
" <div>",
" ${1:NewComponent}",
" </div>",
" )",
"}",
"",
"export default ${1:NewComponent}"
],
"description": "Create a new React component with a type definition and multi-cursor support for the component name."
},
"Custom React Hook": {
"prefix": "customHook",
"body": [
"import { useState, useEffect } from 'react'",
"",
"const use${1:CustomHook} = () => {",
" const [state, setState] = useState()",
"",
" useEffect(() => {",
" // Fetch data or perform side effects here",
" }, [])",
"",
" return {",
" state,",
" setState,",
" }",
"}",
"",
"export default use${1:CustomHook}"
],
"description": "Create a custom React hook with useState and useEffect, with multi-cursor support for the hook name."
},
"API Service Method with Types": {
"prefix": "createService",
"body": [
"export type ${1:METHOD}${2:SERVICE_NAME}ParamsType = {",
" // TODO: Add params here",
"}",
"",
"export type ${1:METHOD}${2:SERVICE_NAME}ResponseType = {",
" // TODO: Add response fields here",
"}",
"",
"export const ${1:METHOD}${2:SERVICE_NAME} = (params: ${1:METHOD}${2:SERVICE_NAME}ParamsType) =>",
" client.${1:METHOD}<${1:METHOD}${2:SERVICE_NAME}ResponseType, true>({",
" url: '${3:ENDPOINT}',",
" params: params,",
" })"
],
"description": "Create an API service method with type definitions for params and response, and multi-cursor support for the HTTP method."
},
"Flex Row": {
"prefix": "flexRow",
"body": ["display: 'flex', flexDirection: 'row',"],
"description": "Creates a flex container with row direction"
},
"Flex Column": {
"prefix": "flexCol",
"body": ["display: 'flex', flexDirection: 'column',"],
"description": "Creates a flex container with column direction"
},
"Items Center": {
"prefix": "itemsCenter",
"body": ["alignItems: 'center',"],
"description": "Centers items along the cross axis"
},
"Justify Between": {
"prefix": "justifyBetween",
"body": ["justifyContent: 'space-between',"],
"description": "Justifies content with space between"
},
"Justify Center": {
"prefix": "justifyCenter",
"body": ["justifyContent: 'center',"],
"description": "Centers content along the main axis"
},
"Flex Center": {
"prefix": "flexCenter",
"body": ["display: 'flex', alignItems: 'center', justifyContent: 'center',"],
"description": "Centers content both vertically and horizontally"
},
"Gap": {
"prefix": "gap",
"body": ["gap: ${1:1},"],
"description": "Adds gap between flex/grid items"
},
"Width Full": {
"prefix": "wFull",
"body": ["width: '100%',"],
"description": "Sets width to 100%"
},
"Height Full": {
"prefix": "hFull",
"body": ["height: '100%',"],
"description": "Sets height to 100%"
},
"Grow": {
"prefix": "grow",
"body": ["flexGrow: 1,"],
"description": "Sets flex-grow to 1"
},
"Padding": {
"prefix": "p",
"body": ["padding: ${1:1},"],
"description": "Add padding"
},
"Margin": {
"prefix": "m",
"body": ["margin: ${1:1},"],
"description": "Add margin"
},
"Position Absolute": {
"prefix": "posAbs",
"body": ["position: 'absolute',"],
"description": "Position absolute"
},
"Position Relative": {
"prefix": "posRel",
"body": ["position: 'relative',"],
"description": "Position relative"
},
"Border": {
"prefix": "border",
"body": ["border: '1px solid',"],
"description": "Add border"
},
"Border Radius": {
"prefix": "rounded",
"body": ["borderRadius: ${1:1},"],
"description": "Add border radius"
},
"Background Color": {
"prefix": "bg",
"body": ["backgroundColor: '${1:color}',"],
"description": "Add background color"
},
"Text Color": {
"prefix": "color",
"body": ["color: '${1:color}',"],
"description": "Add text color"
},
"Hide Overflow": {
"prefix": "hideOverflow",
"body": ["overflow: 'hidden',"],
"description": "Hide overflow content"
},
"Grid": {
"prefix": "grid",
"body": ["display: 'grid',"],
"description": "Display grid"
},
"Grid Columns": {
"prefix": "gridCols",
"body": ["gridTemplateColumns: 'repeat(${1:count}, 1fr)',"],
"description": "Grid template columns"
},
"Cursor Pointer": {
"prefix": "pointer",
"body": ["cursor: 'pointer',"],
"description": "Add pointer cursor"
},
"Text Align": {
"prefix": "textAlign",
"body": ["textAlign: '${1:center}',"],
"description": "Set text alignment"
},
"Font Weight": {
"prefix": "fw",
"body": ["fontWeight: ${1:500},"],
"description": "Set font weight"
},
"Transition": {
"prefix": "transition",
"body": ["transition: '${1:all} 0.3s ease',"],
"description": "Add transition"
},
"Scale Transform": {
"prefix": "scale",
"body": ["transform: 'scale(${1:1.1})',"],
"description": "Scale transform"
},
"Padding X": {
"prefix": "px",
"body": ["paddingX: ${1:1},"],
"description": "Add horizontal padding"
},
"Padding Y": {
"prefix": "py",
"body": ["paddingY: ${1:1},"],
"description": "Add vertical padding"
},
"Margin X": {
"prefix": "mx",
"body": ["marginX: ${1:1},"],
"description": "Add horizontal margin"
},
"Margin Y": {
"prefix": "my",
"body": ["marginY: ${1:1},"],
"description": "Add vertical margin"
},
"Box Shadow": {
"prefix": "shadow",
"body": ["boxShadow: ${1:1},"],
"description": "Add box shadow"
},
"Z Index": {
"prefix": "z",
"body": ["zIndex: ${1:1},"],
"description": "Set z-index"
},
"Opacity": {
"prefix": "opacity",
"body": ["opacity: ${1:0.8},"],
"description": "Set opacity"
},
"Position Top": {
"prefix": "top",
"body": ["top: ${1:0},"],
"description": "Set top position"
},
"Position Bottom": {
"prefix": "bottom",
"body": ["bottom: ${1:0},"],
"description": "Set bottom position"
},
"Position Left": {
"prefix": "left",
"body": ["left: ${1:0},"],
"description": "Set left position"
},
"Position Right": {
"prefix": "right",
"body": ["right: ${1:0},"],
"description": "Set right position"
},
"Min Width": {
"prefix": "minw",
"body": ["minWidth: ${1:0},"],
"description": "Set minimum width"
},
"Min Height": {
"prefix": "minh",
"body": ["minHeight: ${1:0},"],
"description": "Set minimum height"
},
"Max Width": {
"prefix": "maxw",
"body": ["maxWidth: ${1:100},"],
"description": "Set maximum width"
},
"Max Height": {
"prefix": "maxh",
"body": ["maxHeight: ${1:100},"],
"description": "Set maximum height"
},
"Hover": {
"prefix": "hover",
"body": ["'&:hover': { ${1} },"],
"description": "Add hover state styles"
},
"Media Query": {
"prefix": "media",
"body": ["'@media (min-width: ${1:600}px)': { ${2} },"],
"description": "Add media query"
},
"Text Decoration": {
"prefix": "underline",
"body": ["textDecoration: 'underline',"],
"description": "Add underline to text"
},
"Text Transform": {
"prefix": "uppercase",
"body": ["textTransform: 'uppercase',"],
"description": "Transform text to uppercase"
},
"Blur Filter": {
"prefix": "blur",
"body": ["filter: 'blur(${1:4}px)',"],
"description": "Add blur filter"
},
"Grid Area": {
"prefix": "gridArea",
"body": ["gridArea: '${1:auto}',"],
"description": "Set grid area"
},
"Grid Gap": {
"prefix": "gridGap",
"body": ["gap: '${1:8}px ${2:8}px',"],
"description": "Set grid gap"
},
"Border Bottom": {
"prefix": "borderB",
"body": ["borderBottom: '${1:1}px solid',"],
"description": "Add bottom border"
},
"Border Top": {
"prefix": "borderT",
"body": ["borderTop: '${1:1}px solid',"],
"description": "Add top border"
},
"Rotate": {
"prefix": "rotate",
"body": ["transform: 'rotate(${1:45}deg)',"],
"description": "Rotate element"
},
"Object Fit": {
"prefix": "objFit",
"body": ["objectFit: '${1:cover}',"],
"description": "Set object-fit property"
},
"White Space": {
"prefix": "nowrap",
"body": ["whiteSpace: 'nowrap',"],
"description": "Prevent text wrapping"
},
"Text Overflow": {
"prefix": "ellipsis",
"body": ["textOverflow: 'ellipsis',"],
"description": "Add ellipsis to overflowing text"
},
"Border None": {
"prefix": "borderNone",
"body": ["border: 'none',"],
"description": "Remove all borders"
},
"Background None": {
"prefix": "bgNone",
"body": ["background: 'none',"],
"description": "Remove background"
},
"Border Left": {
"prefix": "borderL",
"body": ["borderLeft: '${1:1}px solid',"],
"description": "Add left border"
},
"Border Right": {
"prefix": "borderR",
"body": ["borderRight: '${1:1}px solid',"],
"description": "Add right border"
},
"Border Top Left": {
"prefix": "borderTL",
"body": ["borderTopLeftRadius: ${1:4},"],
"description": "Add top left border radius"
},
"Border Top Right": {
"prefix": "borderTR",
"body": ["borderTopRightRadius: ${1:4},"],
"description": "Add top right border radius"
},
"Border Bottom Left": {
"prefix": "borderBL",
"body": ["borderBottomLeftRadius: ${1:4},"],
"description": "Add bottom left border radius"
},
"Border Bottom Right": {
"prefix": "borderBR",
"body": ["borderBottomRightRadius: ${1:4},"],
"description": "Add bottom right border radius"
},
"Border Color": {
"prefix": "borderC",
"body": ["borderColor: '${1:color}',"],
"description": "Set border color"
},
"Border Style": {
"prefix": "borderS",
"body": ["borderStyle: '${1:solid}',"],
"description": "Set border style"
},
"Border Width": {
"prefix": "borderW",
"body": ["borderWidth: ${1:1},"],
"description": "Set border width"
}
}