@xaypay/tui 0.1.9 → 0.2.0
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.
- package/.prettierignore +1 -0
- package/dist/index.es.js +89 -189
- package/dist/index.js +90 -189
- package/package.json +48 -42
- package/rollup.config.mjs +36 -0
- package/tui.config.js +106 -114
- package/vite.config.mjs +82 -0
package/tui.config.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
-
const boxSizing = 'border-box'
|
|
4
|
-
const fontStyle = 'normal'
|
|
5
|
-
const fontFamily = 'Arial'
|
|
6
|
-
const fontWeight = 500
|
|
3
|
+
const boxSizing = 'border-box';
|
|
4
|
+
const fontStyle = 'normal';
|
|
5
|
+
const fontFamily = 'Arial';
|
|
6
|
+
const fontWeight = 500;
|
|
7
7
|
|
|
8
|
-
const transparent = 'transparent'
|
|
8
|
+
const transparent = 'transparent';
|
|
9
9
|
|
|
10
10
|
const presetColors = {
|
|
11
11
|
info: '#F24C4C',
|
|
@@ -17,7 +17,7 @@ const presetColors = {
|
|
|
17
17
|
warning: '#FECD29',
|
|
18
18
|
secondary: '#D1D1D1',
|
|
19
19
|
primary: '#051942',
|
|
20
|
-
primarySecond: '#00236A'
|
|
20
|
+
primarySecond: '#00236A'
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const fontObject = {
|
|
@@ -42,7 +42,7 @@ export default {
|
|
|
42
42
|
disabled: false,
|
|
43
43
|
className: '',
|
|
44
44
|
transition: 'background-color 240ms, color 240ms',
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
box: {
|
|
47
47
|
sizing: boxSizing,
|
|
48
48
|
},
|
|
@@ -55,29 +55,18 @@ export default {
|
|
|
55
55
|
disabledBackground: 'rgba(238, 238, 238, 1)',
|
|
56
56
|
},
|
|
57
57
|
|
|
58
|
-
font: {
|
|
58
|
+
font: {...fontObject},
|
|
59
59
|
|
|
60
60
|
text: {
|
|
61
61
|
transform: 'none',
|
|
62
62
|
colors: {
|
|
63
63
|
hover: '#001745',
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
title: {
|
|
68
|
-
width: '',
|
|
69
|
-
color: '',
|
|
70
|
-
radius: '',
|
|
71
|
-
padding: '5px',
|
|
72
|
-
colors: {
|
|
73
|
-
backgroud: '#ccc',
|
|
74
|
-
},
|
|
75
|
-
font: { ...fontObject },
|
|
64
|
+
}
|
|
76
65
|
},
|
|
77
66
|
|
|
78
67
|
icon: {
|
|
79
|
-
marginRight: '10px'
|
|
80
|
-
}
|
|
68
|
+
marginRight: '10px'
|
|
69
|
+
}
|
|
81
70
|
},
|
|
82
71
|
// default properties for <Input /> component
|
|
83
72
|
INPUT: {
|
|
@@ -104,18 +93,18 @@ export default {
|
|
|
104
93
|
background: 'white',
|
|
105
94
|
backgroundDisable: presetColors.secondary,
|
|
106
95
|
},
|
|
107
|
-
|
|
108
|
-
font: {
|
|
109
|
-
|
|
96
|
+
|
|
97
|
+
font: {...fontObject},
|
|
98
|
+
|
|
110
99
|
label: {
|
|
111
100
|
color: presetColors.dark,
|
|
112
101
|
display: 'block',
|
|
113
102
|
lineHeight: '22px',
|
|
114
103
|
marginBottom: '6px',
|
|
115
104
|
|
|
116
|
-
font: {
|
|
105
|
+
font: {...fontObject}
|
|
117
106
|
},
|
|
118
|
-
|
|
107
|
+
|
|
119
108
|
error: {
|
|
120
109
|
left: '0px',
|
|
121
110
|
color: presetColors.danger,
|
|
@@ -124,7 +113,7 @@ export default {
|
|
|
124
113
|
marginTop: '10px',
|
|
125
114
|
lineHeight: '19px',
|
|
126
115
|
|
|
127
|
-
font: {
|
|
116
|
+
font: {...fontObject}
|
|
128
117
|
},
|
|
129
118
|
|
|
130
119
|
tel: {
|
|
@@ -137,10 +126,10 @@ export default {
|
|
|
137
126
|
color: presetColors.secondary,
|
|
138
127
|
|
|
139
128
|
colors: {
|
|
140
|
-
hover: presetColors.dark
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
129
|
+
hover: presetColors.dark
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
144
133
|
},
|
|
145
134
|
// default properties for <Tooltip /> component
|
|
146
135
|
TOOLTIP: {
|
|
@@ -150,7 +139,7 @@ export default {
|
|
|
150
139
|
radius: '3px',
|
|
151
140
|
className: '',
|
|
152
141
|
// icon: React.createElement(SvgChecked, { fill: 'red' }),
|
|
153
|
-
|
|
142
|
+
|
|
154
143
|
parent: {
|
|
155
144
|
width: '46px',
|
|
156
145
|
height: '46px',
|
|
@@ -158,14 +147,15 @@ export default {
|
|
|
158
147
|
|
|
159
148
|
colors: {
|
|
160
149
|
background: transparent,
|
|
161
|
-
}
|
|
162
|
-
},
|
|
150
|
+
}
|
|
163
151
|
|
|
152
|
+
},
|
|
153
|
+
|
|
164
154
|
colors: {
|
|
165
155
|
background: '#03a9f4',
|
|
166
156
|
},
|
|
167
|
-
|
|
168
|
-
font: {
|
|
157
|
+
|
|
158
|
+
font: {...fontObject}
|
|
169
159
|
},
|
|
170
160
|
// default properties for <Typography /> component
|
|
171
161
|
TYPOGRAPHY: {
|
|
@@ -277,7 +267,7 @@ export default {
|
|
|
277
267
|
lineHeighth5: 'normal',
|
|
278
268
|
lineHeighth6: 'normal',
|
|
279
269
|
lineHeightspan: 'normal',
|
|
280
|
-
}
|
|
270
|
+
}
|
|
281
271
|
},
|
|
282
272
|
// default properties for <Select /> component
|
|
283
273
|
SELECT: {
|
|
@@ -291,7 +281,7 @@ export default {
|
|
|
291
281
|
shadow: `0 0 0 2px ${presetColors.secondary}`, // like border
|
|
292
282
|
shadowHover: `0 0 0 2px ${presetColors.dark}`, // like border
|
|
293
283
|
},
|
|
294
|
-
|
|
284
|
+
|
|
295
285
|
label: {
|
|
296
286
|
color: presetColors.dark,
|
|
297
287
|
display: 'block',
|
|
@@ -299,7 +289,7 @@ export default {
|
|
|
299
289
|
marginBottom: '6px',
|
|
300
290
|
textTransform: 'none',
|
|
301
291
|
|
|
302
|
-
font: {
|
|
292
|
+
font: {...fontObject}
|
|
303
293
|
},
|
|
304
294
|
|
|
305
295
|
selected: {
|
|
@@ -310,7 +300,8 @@ export default {
|
|
|
310
300
|
minHeight: '46px',
|
|
311
301
|
lineHeight: '22px',
|
|
312
302
|
transition: 'border-color 240ms',
|
|
313
|
-
|
|
303
|
+
|
|
304
|
+
|
|
314
305
|
box: {
|
|
315
306
|
sizing: boxSizing,
|
|
316
307
|
},
|
|
@@ -321,7 +312,7 @@ export default {
|
|
|
321
312
|
backgroundDisable: presetColors.secondary,
|
|
322
313
|
},
|
|
323
314
|
|
|
324
|
-
font: {
|
|
315
|
+
font: {...fontObject}
|
|
325
316
|
},
|
|
326
317
|
|
|
327
318
|
options: {
|
|
@@ -342,18 +333,18 @@ export default {
|
|
|
342
333
|
minHeight: '46px',
|
|
343
334
|
lineHeight: '25px',
|
|
344
335
|
marginBottom: '2px',
|
|
345
|
-
|
|
336
|
+
|
|
346
337
|
box: {
|
|
347
338
|
sizing: boxSizing,
|
|
348
339
|
},
|
|
349
|
-
|
|
340
|
+
|
|
350
341
|
colors: {
|
|
351
342
|
hover: presetColors.primarySecond,
|
|
352
343
|
backgroud: '#ffffff',
|
|
353
344
|
backgroudHover: 'unset',
|
|
354
345
|
},
|
|
355
346
|
|
|
356
|
-
font: {
|
|
347
|
+
font: {...fontObject}
|
|
357
348
|
},
|
|
358
349
|
},
|
|
359
350
|
|
|
@@ -363,11 +354,11 @@ export default {
|
|
|
363
354
|
zIndex: 10,
|
|
364
355
|
|
|
365
356
|
box: {
|
|
366
|
-
shadow: `0 0 0 2px ${presetColors.danger}
|
|
357
|
+
shadow: `0 0 0 2px ${presetColors.danger}`
|
|
367
358
|
},
|
|
368
359
|
|
|
369
|
-
font: {
|
|
370
|
-
}
|
|
360
|
+
font: {...fontObject}
|
|
361
|
+
}
|
|
371
362
|
},
|
|
372
363
|
// default properties for <Textarea /> component
|
|
373
364
|
TEXTAREA: {
|
|
@@ -403,21 +394,21 @@ export default {
|
|
|
403
394
|
display: 'block',
|
|
404
395
|
marginBottom: '10px',
|
|
405
396
|
|
|
406
|
-
font: {
|
|
397
|
+
font: {...fontObject}
|
|
407
398
|
},
|
|
408
399
|
|
|
409
|
-
font: {
|
|
400
|
+
font: {...fontObject},
|
|
410
401
|
|
|
411
402
|
error: {
|
|
412
403
|
color: '#E40E00',
|
|
413
404
|
marginTop: '10px',
|
|
414
405
|
|
|
415
406
|
box: {
|
|
416
|
-
shadow: `0 0 0 2px ${presetColors.danger}
|
|
407
|
+
shadow: `0 0 0 2px ${presetColors.danger}` // like border
|
|
417
408
|
},
|
|
418
409
|
|
|
419
|
-
font: {
|
|
420
|
-
}
|
|
410
|
+
font: {...fontObject}
|
|
411
|
+
}
|
|
421
412
|
},
|
|
422
413
|
// default properties for <NewAutocomplete /> component
|
|
423
414
|
AUTOCOMPLETE: {
|
|
@@ -440,7 +431,7 @@ export default {
|
|
|
440
431
|
shadowHover: `0 0 0 2px ${presetColors.dark}`, // like border
|
|
441
432
|
shadowActive: `0 0 0 2px ${presetColors.primarySecond}`, // like border
|
|
442
433
|
},
|
|
443
|
-
font: {
|
|
434
|
+
font: {...fontObject},
|
|
444
435
|
|
|
445
436
|
parent: {
|
|
446
437
|
display: 'flex',
|
|
@@ -459,7 +450,7 @@ export default {
|
|
|
459
450
|
marginBottom: '6px',
|
|
460
451
|
textTransform: 'none',
|
|
461
452
|
|
|
462
|
-
font: {
|
|
453
|
+
font: {...fontObject}
|
|
463
454
|
},
|
|
464
455
|
|
|
465
456
|
contentBottom: {
|
|
@@ -497,28 +488,28 @@ export default {
|
|
|
497
488
|
backgroundHover: 'initial',
|
|
498
489
|
},
|
|
499
490
|
|
|
500
|
-
font: {
|
|
491
|
+
font: {...fontObject}
|
|
501
492
|
},
|
|
502
|
-
|
|
493
|
+
|
|
503
494
|
colors: {
|
|
504
495
|
background: presetColors.extraLight,
|
|
505
496
|
},
|
|
506
|
-
|
|
497
|
+
|
|
507
498
|
box: {
|
|
508
499
|
shadow: '0 0 10px rgba(60, 57, 62, 0.08)',
|
|
509
500
|
sizing: boxSizing,
|
|
510
|
-
}
|
|
501
|
+
}
|
|
511
502
|
},
|
|
512
503
|
|
|
513
504
|
error: {
|
|
514
505
|
color: presetColors.danger,
|
|
515
506
|
marginTop: '10px',
|
|
516
507
|
|
|
517
|
-
font: {
|
|
508
|
+
font: {...fontObject},
|
|
518
509
|
|
|
519
510
|
box: {
|
|
520
|
-
shadow: `0 0 0 2px ${presetColors.danger}
|
|
521
|
-
}
|
|
511
|
+
shadow: `0 0 0 2px ${presetColors.danger}` // like border
|
|
512
|
+
}
|
|
522
513
|
},
|
|
523
514
|
|
|
524
515
|
innerError: {
|
|
@@ -526,18 +517,18 @@ export default {
|
|
|
526
517
|
|
|
527
518
|
colors: {
|
|
528
519
|
background: 'gray',
|
|
529
|
-
}
|
|
530
|
-
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
531
522
|
},
|
|
532
523
|
// default properties for <Captcha /> component
|
|
533
524
|
CAPTCHA: {
|
|
534
525
|
className: '',
|
|
535
|
-
|
|
526
|
+
|
|
536
527
|
label: {
|
|
537
528
|
color: presetColors.dark,
|
|
538
529
|
|
|
539
|
-
font: {
|
|
540
|
-
}
|
|
530
|
+
font: {...fontObject}
|
|
531
|
+
}
|
|
541
532
|
},
|
|
542
533
|
// default properties for <File /> component
|
|
543
534
|
FILE: {
|
|
@@ -547,7 +538,7 @@ export default {
|
|
|
547
538
|
maxWidth: '440px',
|
|
548
539
|
className: '',
|
|
549
540
|
|
|
550
|
-
areaImage: {
|
|
541
|
+
areaImage: {
|
|
551
542
|
width: '27.8rem',
|
|
552
543
|
height: 'auto',
|
|
553
544
|
},
|
|
@@ -556,7 +547,7 @@ export default {
|
|
|
556
547
|
upload: 'Բեռնել',
|
|
557
548
|
uploadColor: presetColors.success,
|
|
558
549
|
putFileHere: 'Տեղադրել ֆայլը այստեղ',
|
|
559
|
-
|
|
550
|
+
|
|
560
551
|
sizeText: 'Առավելագույնը',
|
|
561
552
|
timeForRemoveError: 4000,
|
|
562
553
|
extentionsRowMarginTop: '40px',
|
|
@@ -568,7 +559,7 @@ export default {
|
|
|
568
559
|
|
|
569
560
|
colors: {
|
|
570
561
|
hover: presetColors.primarySecond,
|
|
571
|
-
}
|
|
562
|
+
}
|
|
572
563
|
},
|
|
573
564
|
|
|
574
565
|
colors: {
|
|
@@ -579,15 +570,15 @@ export default {
|
|
|
579
570
|
label: {
|
|
580
571
|
color: '#4A4A4D',
|
|
581
572
|
|
|
582
|
-
font: {
|
|
573
|
+
font: {...fontObject}
|
|
583
574
|
},
|
|
584
575
|
|
|
585
|
-
font: {
|
|
576
|
+
font: {...fontObject},
|
|
586
577
|
|
|
587
578
|
error: {
|
|
588
579
|
color: presetColors.danger,
|
|
589
580
|
|
|
590
|
-
font: {
|
|
581
|
+
font: {...fontObject},
|
|
591
582
|
|
|
592
583
|
format: 'ֆայլի սխալ ֆորմատ',
|
|
593
584
|
maxSize: 'Առավելագույն ծավալ',
|
|
@@ -604,7 +595,7 @@ export default {
|
|
|
604
595
|
loading: presetColors.primary,
|
|
605
596
|
},
|
|
606
597
|
|
|
607
|
-
font: {
|
|
598
|
+
font: {...fontObject}
|
|
608
599
|
},
|
|
609
600
|
|
|
610
601
|
uploadBtn: {
|
|
@@ -618,7 +609,7 @@ export default {
|
|
|
618
609
|
backgroundHover: 'rgba(0, 35, 106, 1)',
|
|
619
610
|
},
|
|
620
611
|
|
|
621
|
-
font: {
|
|
612
|
+
font: {...fontObject}
|
|
622
613
|
},
|
|
623
614
|
|
|
624
615
|
listItem: {
|
|
@@ -631,28 +622,29 @@ export default {
|
|
|
631
622
|
backgroundError: '#F6F8F8',
|
|
632
623
|
},
|
|
633
624
|
|
|
634
|
-
font: {
|
|
625
|
+
font: {...fontObject},
|
|
635
626
|
|
|
636
627
|
error: {
|
|
637
628
|
color: '#E40E00',
|
|
638
|
-
font: {
|
|
639
|
-
}
|
|
629
|
+
font: {...fontObject}
|
|
630
|
+
}
|
|
640
631
|
},
|
|
641
632
|
|
|
642
633
|
icon: {
|
|
643
|
-
// comment here for example,
|
|
644
|
-
|
|
645
|
-
//
|
|
646
|
-
//
|
|
647
|
-
//
|
|
648
|
-
//
|
|
649
|
-
//
|
|
650
|
-
//
|
|
651
|
-
//
|
|
652
|
-
//
|
|
653
|
-
//
|
|
634
|
+
// comment here for example,
|
|
635
|
+
|
|
636
|
+
// pdf: React.createElement(SvgChecked, { fill: 'green' }),
|
|
637
|
+
// png: React.createElement(SvgChecked, { fill: 'green' }),
|
|
638
|
+
// jpg: React.createElement(SvgChecked, { fill: 'green' }),
|
|
639
|
+
// jpeg: React.createElement(SvgChecked, { fill: 'green' }),
|
|
640
|
+
// heic: React.createElement(SvgChecked, { fill: 'green' }),
|
|
641
|
+
// wrong: React.createElement(SvgChecked, { fill: 'green' }),
|
|
642
|
+
// upload: React.createElement(SvgChecked, { fill: 'green' }),
|
|
643
|
+
// required: React.createElement(SvgChecked, { fill: 'green' }),
|
|
644
|
+
// removeFile: React.createElement(SvgChecked, { fill: 'green' }),
|
|
645
|
+
// deleteComponent: React.createElement(SvgChecked, { fill: 'green' }),
|
|
654
646
|
// deleteItem: React.createElement(SvgUnchecked, { fill: 'green' }),
|
|
655
|
-
}
|
|
647
|
+
}
|
|
656
648
|
},
|
|
657
649
|
// default properties for <Modal /> component
|
|
658
650
|
MODAL: {
|
|
@@ -684,7 +676,7 @@ export default {
|
|
|
684
676
|
header: {
|
|
685
677
|
color: presetColors.primarySecond,
|
|
686
678
|
height: '30px',
|
|
687
|
-
font: {
|
|
679
|
+
font: {...fontObject}
|
|
688
680
|
},
|
|
689
681
|
|
|
690
682
|
image: {
|
|
@@ -697,41 +689,41 @@ export default {
|
|
|
697
689
|
},
|
|
698
690
|
|
|
699
691
|
icon: {
|
|
700
|
-
// zoom: React.createElement(SvgChecked, { fill: 'green' }),
|
|
701
|
-
// prev: React.createElement(SvgChecked, { fill: 'green' }),
|
|
702
|
-
// next: React.createElement(SvgChecked, { fill: 'green' }),
|
|
703
|
-
// close: React.createElement(SvgChecked, { fill: 'green' }),
|
|
704
|
-
// closeSlide: React.createElement(SvgChecked, { fill: 'green' }),
|
|
692
|
+
// zoom: React.createElement(SvgChecked, { fill: 'green' }),
|
|
693
|
+
// prev: React.createElement(SvgChecked, { fill: 'green' }),
|
|
694
|
+
// next: React.createElement(SvgChecked, { fill: 'green' }),
|
|
695
|
+
// close: React.createElement(SvgChecked, { fill: 'green' }),
|
|
696
|
+
// closeSlide: React.createElement(SvgChecked, { fill: 'green' }),
|
|
705
697
|
},
|
|
706
|
-
closeAreaBackgroundColor: 'linear-gradient(to bottom, rgb(60, 57, 62), rgba(60, 57, 62, 0))'
|
|
698
|
+
closeAreaBackgroundColor: 'linear-gradient(to bottom, rgb(60, 57, 62), rgba(60, 57, 62, 0))' // for close div background color
|
|
707
699
|
},
|
|
708
700
|
// default properties for <Checkbox /> component
|
|
709
701
|
CHECKBOX: {
|
|
710
702
|
className: '',
|
|
711
703
|
marginBottom: '10px',
|
|
712
704
|
|
|
713
|
-
colors: {
|
|
705
|
+
colors: {
|
|
714
706
|
checked: presetColors.primarySecond,
|
|
715
707
|
unChecked: presetColors.secondary,
|
|
716
708
|
},
|
|
717
709
|
|
|
718
710
|
label: {
|
|
719
711
|
marginLeft: '10px',
|
|
720
|
-
}
|
|
712
|
+
}
|
|
721
713
|
|
|
722
|
-
// checkedIcon: React.createElement(SvgChecked, { fill: 'green' }),
|
|
714
|
+
// checkedIcon: React.createElement(SvgChecked, { fill: 'green' }),
|
|
723
715
|
// unCheckedIcon: React.createElement(<SvgUnchecked fill="#E00" />),
|
|
724
716
|
},
|
|
725
717
|
// default properties for <Table /> component
|
|
726
718
|
TABLE: {
|
|
727
719
|
className: '',
|
|
728
720
|
textAlign: 'center',
|
|
729
|
-
|
|
721
|
+
|
|
730
722
|
column: {
|
|
731
723
|
maxWidth: '',
|
|
732
724
|
minWidth: '',
|
|
733
725
|
},
|
|
734
|
-
|
|
726
|
+
|
|
735
727
|
head: {
|
|
736
728
|
color: presetColors.extraLight,
|
|
737
729
|
radius: '14px',
|
|
@@ -741,7 +733,7 @@ export default {
|
|
|
741
733
|
background: presetColors.primarySecond,
|
|
742
734
|
},
|
|
743
735
|
|
|
744
|
-
font: {
|
|
736
|
+
font: {...fontObject}
|
|
745
737
|
},
|
|
746
738
|
|
|
747
739
|
body: {
|
|
@@ -766,16 +758,16 @@ export default {
|
|
|
766
758
|
},
|
|
767
759
|
|
|
768
760
|
border: '1px solid',
|
|
769
|
-
borderColor: presetColors.light
|
|
761
|
+
borderColor: presetColors.light
|
|
770
762
|
},
|
|
771
763
|
|
|
772
|
-
font: {
|
|
764
|
+
font: {...fontObject}
|
|
773
765
|
},
|
|
774
|
-
|
|
766
|
+
|
|
775
767
|
openList: {
|
|
776
768
|
color: '#A3A5A9',
|
|
777
|
-
font: {
|
|
778
|
-
}
|
|
769
|
+
font: {...fontObject}
|
|
770
|
+
}
|
|
779
771
|
},
|
|
780
772
|
// default properties for <Pagination /> component
|
|
781
773
|
PAGINATION: {
|
|
@@ -787,10 +779,10 @@ export default {
|
|
|
787
779
|
icon: {
|
|
788
780
|
// info: React.createElement(SvgChecked, { just: 'must' }),
|
|
789
781
|
// warn: React.createElement(SvgUnchecked, { just: 'must' }),
|
|
790
|
-
// close: React.createElement(SvgChecked, { fill: 'green' }),
|
|
791
|
-
// error: React.createElement(SvgChecked, { fill: 'green' }),
|
|
792
|
-
// success: React.createElement(SvgChecked, { fill: 'green' }),
|
|
793
|
-
}
|
|
782
|
+
// close: React.createElement(SvgChecked, { fill: 'green' }),
|
|
783
|
+
// error: React.createElement(SvgChecked, { fill: 'green' }),
|
|
784
|
+
// success: React.createElement(SvgChecked, { fill: 'green' }),
|
|
785
|
+
}
|
|
794
786
|
},
|
|
795
787
|
// default properties for <Stepper /> component
|
|
796
788
|
STEPPER: {
|
|
@@ -818,7 +810,7 @@ export default {
|
|
|
818
810
|
color: '#3C3D46',
|
|
819
811
|
lineHeight: '21px',
|
|
820
812
|
|
|
821
|
-
font: {
|
|
822
|
-
}
|
|
813
|
+
font: {...fontObject}
|
|
814
|
+
}
|
|
823
815
|
},
|
|
824
816
|
}
|
package/vite.config.mjs
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import fs from 'fs'
|
|
2
|
+
import fsPromises from 'fs/promises'
|
|
3
|
+
import { defineConfig } from 'vite'
|
|
4
|
+
import react from '@vitejs/plugin-react'
|
|
5
|
+
import svgr from 'vite-plugin-svgr'
|
|
6
|
+
|
|
7
|
+
const folders = fs.readdirSync('./src', { withFileTypes: true })
|
|
8
|
+
const fileNames = folders.filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name)
|
|
9
|
+
|
|
10
|
+
const filePaths = fileNames.reduce(
|
|
11
|
+
(acc, cur) => ({
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
...acc,
|
|
14
|
+
[cur]: `/${cur === 'src' ? cur : 'src/' + cur}`,
|
|
15
|
+
}),
|
|
16
|
+
''
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
// https://vitejs.dev/config/
|
|
20
|
+
export default defineConfig({
|
|
21
|
+
plugins: [react(),svgr()],
|
|
22
|
+
resolve: {
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
alias: { ...filePaths },
|
|
25
|
+
},
|
|
26
|
+
// TODO: remove if unnecessary
|
|
27
|
+
// build: {
|
|
28
|
+
// // Output directory for the production build.
|
|
29
|
+
// outDir: 'dist',
|
|
30
|
+
// // Directory relative to outDir where built files will be served.
|
|
31
|
+
// assetsDir: '',
|
|
32
|
+
// // Inline the index.html's assets. If false, the assets folder will be created.
|
|
33
|
+
// assetsInlineLimit: 4096,
|
|
34
|
+
// // Whether to generate sourcemaps for production builds.
|
|
35
|
+
// sourcemap: false,
|
|
36
|
+
// // Minify the production build using terser.
|
|
37
|
+
// minify: false, // 'terser' or 'esbuild' or false
|
|
38
|
+
// // Specify additional rollup plugins.
|
|
39
|
+
// rollupOptions: {
|
|
40
|
+
// // Externalize certain dependencies, preventing them from being bundled.
|
|
41
|
+
// external: [],
|
|
42
|
+
// input: 'src/index.js',
|
|
43
|
+
// fileName: (format) => {
|
|
44
|
+
|
|
45
|
+
// }
|
|
46
|
+
// // output: {
|
|
47
|
+
// // entryFileNames: `[name].js`,
|
|
48
|
+
// // chunkFileNames: `[name].js`,
|
|
49
|
+
// // assetFileNames: `[name].[ext]`,
|
|
50
|
+
// // }
|
|
51
|
+
// },
|
|
52
|
+
// // lib: {
|
|
53
|
+
// // entry: './src/index.js',
|
|
54
|
+
// // name: 'TUI', // Adjust as needed for library name
|
|
55
|
+
// // fileName: (format) => {
|
|
56
|
+
// // return format === 'cjs' ? `index.js` : `index.${format}.js`
|
|
57
|
+
// // },
|
|
58
|
+
// // formats: ['cjs', 'es'],
|
|
59
|
+
// // }
|
|
60
|
+
// },
|
|
61
|
+
// external: ['prop-types', 'classnames'],
|
|
62
|
+
esbuild: {
|
|
63
|
+
loader: 'jsx',
|
|
64
|
+
include: /src\/.*\.jsx?$/,
|
|
65
|
+
exclude: [],
|
|
66
|
+
},
|
|
67
|
+
optimizeDeps: {
|
|
68
|
+
esbuildOptions: {
|
|
69
|
+
plugins: [
|
|
70
|
+
{
|
|
71
|
+
name: 'load-js-files-as-jsx',
|
|
72
|
+
setup(build) {
|
|
73
|
+
build.onLoad({ filter: /src\/.*\.js$/ }, async (args) => ({
|
|
74
|
+
loader: 'jsx',
|
|
75
|
+
contents: await fsPromises.readFile(args.path, 'utf8'),
|
|
76
|
+
}))
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
})
|