@saasmakers/ui 0.1.56 → 0.1.58

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.
@@ -0,0 +1,650 @@
1
+ .ct-label {
2
+ fill: rgba(0, 0, 0, 0.4);
3
+ color: rgba(0, 0, 0, 0.4);
4
+ font-size: 0.75rem;
5
+ line-height: 1;
6
+ }
7
+ .ct-chart-bar .ct-label,
8
+ .ct-chart-line .ct-label {
9
+ display: flex;
10
+ }
11
+ .ct-chart-donut .ct-label,
12
+ .ct-chart-pie .ct-label {
13
+ dominant-baseline: central;
14
+ }
15
+ .ct-label.ct-horizontal.ct-start {
16
+ align-items: flex-end;
17
+ justify-content: flex-start;
18
+ text-align: left;
19
+ }
20
+ .ct-label.ct-horizontal.ct-end {
21
+ align-items: flex-start;
22
+ justify-content: flex-start;
23
+ text-align: left;
24
+ }
25
+ .ct-label.ct-vertical.ct-start {
26
+ align-items: flex-end;
27
+ justify-content: flex-end;
28
+ text-align: right;
29
+ }
30
+ .ct-label.ct-vertical.ct-end {
31
+ align-items: flex-end;
32
+ justify-content: flex-start;
33
+ text-align: left;
34
+ }
35
+ .ct-chart-bar .ct-label.ct-horizontal.ct-start {
36
+ align-items: flex-end;
37
+ justify-content: center;
38
+ text-align: center;
39
+ }
40
+ .ct-chart-bar .ct-label.ct-horizontal.ct-end {
41
+ align-items: flex-start;
42
+ justify-content: center;
43
+ text-align: center;
44
+ }
45
+ .ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start {
46
+ align-items: flex-end;
47
+ justify-content: flex-start;
48
+ text-align: left;
49
+ }
50
+ .ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end {
51
+ align-items: flex-start;
52
+ justify-content: flex-start;
53
+ text-align: left;
54
+ }
55
+ .ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start {
56
+ align-items: center;
57
+ justify-content: flex-end;
58
+ text-align: right;
59
+ }
60
+ .ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end {
61
+ align-items: center;
62
+ justify-content: flex-start;
63
+ text-align: left;
64
+ }
65
+ .ct-grid {
66
+ stroke: rgba(0, 0, 0, 0.2);
67
+ stroke-width: 1px;
68
+ stroke-dasharray: 2px;
69
+ }
70
+ .ct-grid-background {
71
+ fill: none;
72
+ }
73
+ .ct-point {
74
+ stroke-width: 10px;
75
+ stroke-linecap: round;
76
+ }
77
+ .ct-line {
78
+ fill: none;
79
+ stroke-width: 4px;
80
+ }
81
+ .ct-area {
82
+ stroke: none;
83
+ fill-opacity: 0.1;
84
+ }
85
+ .ct-bar {
86
+ fill: none;
87
+ stroke-width: 10px;
88
+ }
89
+ .ct-slice-donut {
90
+ fill: none;
91
+ stroke-width: 60px;
92
+ }
93
+ .ct-series-a .ct-bar,
94
+ .ct-series-a .ct-line,
95
+ .ct-series-a .ct-point,
96
+ .ct-series-a .ct-slice-donut {
97
+ stroke: #d70206;
98
+ }
99
+ .ct-series-a .ct-area,
100
+ .ct-series-a .ct-slice-pie {
101
+ fill: #d70206;
102
+ }
103
+ .ct-series-b .ct-bar,
104
+ .ct-series-b .ct-line,
105
+ .ct-series-b .ct-point,
106
+ .ct-series-b .ct-slice-donut {
107
+ stroke: #f05b4f;
108
+ }
109
+ .ct-series-b .ct-area,
110
+ .ct-series-b .ct-slice-pie {
111
+ fill: #f05b4f;
112
+ }
113
+ .ct-series-c .ct-bar,
114
+ .ct-series-c .ct-line,
115
+ .ct-series-c .ct-point,
116
+ .ct-series-c .ct-slice-donut {
117
+ stroke: #f4c63d;
118
+ }
119
+ .ct-series-c .ct-area,
120
+ .ct-series-c .ct-slice-pie {
121
+ fill: #f4c63d;
122
+ }
123
+ .ct-series-d .ct-bar,
124
+ .ct-series-d .ct-line,
125
+ .ct-series-d .ct-point,
126
+ .ct-series-d .ct-slice-donut {
127
+ stroke: #d17905;
128
+ }
129
+ .ct-series-d .ct-area,
130
+ .ct-series-d .ct-slice-pie {
131
+ fill: #d17905;
132
+ }
133
+ .ct-series-e .ct-bar,
134
+ .ct-series-e .ct-line,
135
+ .ct-series-e .ct-point,
136
+ .ct-series-e .ct-slice-donut {
137
+ stroke: #453d3f;
138
+ }
139
+ .ct-series-e .ct-area,
140
+ .ct-series-e .ct-slice-pie {
141
+ fill: #453d3f;
142
+ }
143
+ .ct-series-f .ct-bar,
144
+ .ct-series-f .ct-line,
145
+ .ct-series-f .ct-point,
146
+ .ct-series-f .ct-slice-donut {
147
+ stroke: #59922b;
148
+ }
149
+ .ct-series-f .ct-area,
150
+ .ct-series-f .ct-slice-pie {
151
+ fill: #59922b;
152
+ }
153
+ .ct-series-g .ct-bar,
154
+ .ct-series-g .ct-line,
155
+ .ct-series-g .ct-point,
156
+ .ct-series-g .ct-slice-donut {
157
+ stroke: #0544d3;
158
+ }
159
+ .ct-series-g .ct-area,
160
+ .ct-series-g .ct-slice-pie {
161
+ fill: #0544d3;
162
+ }
163
+ .ct-series-h .ct-bar,
164
+ .ct-series-h .ct-line,
165
+ .ct-series-h .ct-point,
166
+ .ct-series-h .ct-slice-donut {
167
+ stroke: #6b0392;
168
+ }
169
+ .ct-series-h .ct-area,
170
+ .ct-series-h .ct-slice-pie {
171
+ fill: #6b0392;
172
+ }
173
+ .ct-series-i .ct-bar,
174
+ .ct-series-i .ct-line,
175
+ .ct-series-i .ct-point,
176
+ .ct-series-i .ct-slice-donut {
177
+ stroke: #e6805e;
178
+ }
179
+ .ct-series-i .ct-area,
180
+ .ct-series-i .ct-slice-pie {
181
+ fill: #e6805e;
182
+ }
183
+ .ct-series-j .ct-bar,
184
+ .ct-series-j .ct-line,
185
+ .ct-series-j .ct-point,
186
+ .ct-series-j .ct-slice-donut {
187
+ stroke: #dda458;
188
+ }
189
+ .ct-series-j .ct-area,
190
+ .ct-series-j .ct-slice-pie {
191
+ fill: #dda458;
192
+ }
193
+ .ct-series-k .ct-bar,
194
+ .ct-series-k .ct-line,
195
+ .ct-series-k .ct-point,
196
+ .ct-series-k .ct-slice-donut {
197
+ stroke: #eacf7d;
198
+ }
199
+ .ct-series-k .ct-area,
200
+ .ct-series-k .ct-slice-pie {
201
+ fill: #eacf7d;
202
+ }
203
+ .ct-series-l .ct-bar,
204
+ .ct-series-l .ct-line,
205
+ .ct-series-l .ct-point,
206
+ .ct-series-l .ct-slice-donut {
207
+ stroke: #86797d;
208
+ }
209
+ .ct-series-l .ct-area,
210
+ .ct-series-l .ct-slice-pie {
211
+ fill: #86797d;
212
+ }
213
+ .ct-series-m .ct-bar,
214
+ .ct-series-m .ct-line,
215
+ .ct-series-m .ct-point,
216
+ .ct-series-m .ct-slice-donut {
217
+ stroke: #b2c326;
218
+ }
219
+ .ct-series-m .ct-area,
220
+ .ct-series-m .ct-slice-pie {
221
+ fill: #b2c326;
222
+ }
223
+ .ct-series-n .ct-bar,
224
+ .ct-series-n .ct-line,
225
+ .ct-series-n .ct-point,
226
+ .ct-series-n .ct-slice-donut {
227
+ stroke: #6188e2;
228
+ }
229
+ .ct-series-n .ct-area,
230
+ .ct-series-n .ct-slice-pie {
231
+ fill: #6188e2;
232
+ }
233
+ .ct-series-o .ct-bar,
234
+ .ct-series-o .ct-line,
235
+ .ct-series-o .ct-point,
236
+ .ct-series-o .ct-slice-donut {
237
+ stroke: #a748ca;
238
+ }
239
+ .ct-series-o .ct-area,
240
+ .ct-series-o .ct-slice-pie {
241
+ fill: #a748ca;
242
+ }
243
+ .ct-square {
244
+ display: block;
245
+ position: relative;
246
+ width: 100%;
247
+ }
248
+ .ct-square:before {
249
+ display: block;
250
+ float: left;
251
+ content: "";
252
+ width: 0;
253
+ height: 0;
254
+ padding-bottom: 100%;
255
+ }
256
+ .ct-square:after {
257
+ content: "";
258
+ display: table;
259
+ clear: both;
260
+ }
261
+ .ct-square > svg {
262
+ display: block;
263
+ position: absolute;
264
+ top: 0;
265
+ left: 0;
266
+ }
267
+ .ct-minor-second {
268
+ display: block;
269
+ position: relative;
270
+ width: 100%;
271
+ }
272
+ .ct-minor-second:before {
273
+ display: block;
274
+ float: left;
275
+ content: "";
276
+ width: 0;
277
+ height: 0;
278
+ padding-bottom: 93.75%;
279
+ }
280
+ .ct-minor-second:after {
281
+ content: "";
282
+ display: table;
283
+ clear: both;
284
+ }
285
+ .ct-minor-second > svg {
286
+ display: block;
287
+ position: absolute;
288
+ top: 0;
289
+ left: 0;
290
+ }
291
+ .ct-major-second {
292
+ display: block;
293
+ position: relative;
294
+ width: 100%;
295
+ }
296
+ .ct-major-second:before {
297
+ display: block;
298
+ float: left;
299
+ content: "";
300
+ width: 0;
301
+ height: 0;
302
+ padding-bottom: 88.8888888889%;
303
+ }
304
+ .ct-major-second:after {
305
+ content: "";
306
+ display: table;
307
+ clear: both;
308
+ }
309
+ .ct-major-second > svg {
310
+ display: block;
311
+ position: absolute;
312
+ top: 0;
313
+ left: 0;
314
+ }
315
+ .ct-minor-third {
316
+ display: block;
317
+ position: relative;
318
+ width: 100%;
319
+ }
320
+ .ct-minor-third:before {
321
+ display: block;
322
+ float: left;
323
+ content: "";
324
+ width: 0;
325
+ height: 0;
326
+ padding-bottom: 83.3333333333%;
327
+ }
328
+ .ct-minor-third:after {
329
+ content: "";
330
+ display: table;
331
+ clear: both;
332
+ }
333
+ .ct-minor-third > svg {
334
+ display: block;
335
+ position: absolute;
336
+ top: 0;
337
+ left: 0;
338
+ }
339
+ .ct-major-third {
340
+ display: block;
341
+ position: relative;
342
+ width: 100%;
343
+ }
344
+ .ct-major-third:before {
345
+ display: block;
346
+ float: left;
347
+ content: "";
348
+ width: 0;
349
+ height: 0;
350
+ padding-bottom: 80%;
351
+ }
352
+ .ct-major-third:after {
353
+ content: "";
354
+ display: table;
355
+ clear: both;
356
+ }
357
+ .ct-major-third > svg {
358
+ display: block;
359
+ position: absolute;
360
+ top: 0;
361
+ left: 0;
362
+ }
363
+ .ct-perfect-fourth {
364
+ display: block;
365
+ position: relative;
366
+ width: 100%;
367
+ }
368
+ .ct-perfect-fourth:before {
369
+ display: block;
370
+ float: left;
371
+ content: "";
372
+ width: 0;
373
+ height: 0;
374
+ padding-bottom: 75%;
375
+ }
376
+ .ct-perfect-fourth:after {
377
+ content: "";
378
+ display: table;
379
+ clear: both;
380
+ }
381
+ .ct-perfect-fourth > svg {
382
+ display: block;
383
+ position: absolute;
384
+ top: 0;
385
+ left: 0;
386
+ }
387
+ .ct-perfect-fifth {
388
+ display: block;
389
+ position: relative;
390
+ width: 100%;
391
+ }
392
+ .ct-perfect-fifth:before {
393
+ display: block;
394
+ float: left;
395
+ content: "";
396
+ width: 0;
397
+ height: 0;
398
+ padding-bottom: 66.6666666667%;
399
+ }
400
+ .ct-perfect-fifth:after {
401
+ content: "";
402
+ display: table;
403
+ clear: both;
404
+ }
405
+ .ct-perfect-fifth > svg {
406
+ display: block;
407
+ position: absolute;
408
+ top: 0;
409
+ left: 0;
410
+ }
411
+ .ct-minor-sixth {
412
+ display: block;
413
+ position: relative;
414
+ width: 100%;
415
+ }
416
+ .ct-minor-sixth:before {
417
+ display: block;
418
+ float: left;
419
+ content: "";
420
+ width: 0;
421
+ height: 0;
422
+ padding-bottom: 62.5%;
423
+ }
424
+ .ct-minor-sixth:after {
425
+ content: "";
426
+ display: table;
427
+ clear: both;
428
+ }
429
+ .ct-minor-sixth > svg {
430
+ display: block;
431
+ position: absolute;
432
+ top: 0;
433
+ left: 0;
434
+ }
435
+ .ct-golden-section {
436
+ display: block;
437
+ position: relative;
438
+ width: 100%;
439
+ }
440
+ .ct-golden-section:before {
441
+ display: block;
442
+ float: left;
443
+ content: "";
444
+ width: 0;
445
+ height: 0;
446
+ padding-bottom: 61.804697157%;
447
+ }
448
+ .ct-golden-section:after {
449
+ content: "";
450
+ display: table;
451
+ clear: both;
452
+ }
453
+ .ct-golden-section > svg {
454
+ display: block;
455
+ position: absolute;
456
+ top: 0;
457
+ left: 0;
458
+ }
459
+ .ct-major-sixth {
460
+ display: block;
461
+ position: relative;
462
+ width: 100%;
463
+ }
464
+ .ct-major-sixth:before {
465
+ display: block;
466
+ float: left;
467
+ content: "";
468
+ width: 0;
469
+ height: 0;
470
+ padding-bottom: 60%;
471
+ }
472
+ .ct-major-sixth:after {
473
+ content: "";
474
+ display: table;
475
+ clear: both;
476
+ }
477
+ .ct-major-sixth > svg {
478
+ display: block;
479
+ position: absolute;
480
+ top: 0;
481
+ left: 0;
482
+ }
483
+ .ct-minor-seventh {
484
+ display: block;
485
+ position: relative;
486
+ width: 100%;
487
+ }
488
+ .ct-minor-seventh:before {
489
+ display: block;
490
+ float: left;
491
+ content: "";
492
+ width: 0;
493
+ height: 0;
494
+ padding-bottom: 56.25%;
495
+ }
496
+ .ct-minor-seventh:after {
497
+ content: "";
498
+ display: table;
499
+ clear: both;
500
+ }
501
+ .ct-minor-seventh > svg {
502
+ display: block;
503
+ position: absolute;
504
+ top: 0;
505
+ left: 0;
506
+ }
507
+ .ct-major-seventh {
508
+ display: block;
509
+ position: relative;
510
+ width: 100%;
511
+ }
512
+ .ct-major-seventh:before {
513
+ display: block;
514
+ float: left;
515
+ content: "";
516
+ width: 0;
517
+ height: 0;
518
+ padding-bottom: 53.3333333333%;
519
+ }
520
+ .ct-major-seventh:after {
521
+ content: "";
522
+ display: table;
523
+ clear: both;
524
+ }
525
+ .ct-major-seventh > svg {
526
+ display: block;
527
+ position: absolute;
528
+ top: 0;
529
+ left: 0;
530
+ }
531
+ .ct-octave {
532
+ display: block;
533
+ position: relative;
534
+ width: 100%;
535
+ }
536
+ .ct-octave:before {
537
+ display: block;
538
+ float: left;
539
+ content: "";
540
+ width: 0;
541
+ height: 0;
542
+ padding-bottom: 50%;
543
+ }
544
+ .ct-octave:after {
545
+ content: "";
546
+ display: table;
547
+ clear: both;
548
+ }
549
+ .ct-octave > svg {
550
+ display: block;
551
+ position: absolute;
552
+ top: 0;
553
+ left: 0;
554
+ }
555
+ .ct-major-tenth {
556
+ display: block;
557
+ position: relative;
558
+ width: 100%;
559
+ }
560
+ .ct-major-tenth:before {
561
+ display: block;
562
+ float: left;
563
+ content: "";
564
+ width: 0;
565
+ height: 0;
566
+ padding-bottom: 40%;
567
+ }
568
+ .ct-major-tenth:after {
569
+ content: "";
570
+ display: table;
571
+ clear: both;
572
+ }
573
+ .ct-major-tenth > svg {
574
+ display: block;
575
+ position: absolute;
576
+ top: 0;
577
+ left: 0;
578
+ }
579
+ .ct-major-eleventh {
580
+ display: block;
581
+ position: relative;
582
+ width: 100%;
583
+ }
584
+ .ct-major-eleventh:before {
585
+ display: block;
586
+ float: left;
587
+ content: "";
588
+ width: 0;
589
+ height: 0;
590
+ padding-bottom: 37.5%;
591
+ }
592
+ .ct-major-eleventh:after {
593
+ content: "";
594
+ display: table;
595
+ clear: both;
596
+ }
597
+ .ct-major-eleventh > svg {
598
+ display: block;
599
+ position: absolute;
600
+ top: 0;
601
+ left: 0;
602
+ }
603
+ .ct-major-twelfth {
604
+ display: block;
605
+ position: relative;
606
+ width: 100%;
607
+ }
608
+ .ct-major-twelfth:before {
609
+ display: block;
610
+ float: left;
611
+ content: "";
612
+ width: 0;
613
+ height: 0;
614
+ padding-bottom: 33.3333333333%;
615
+ }
616
+ .ct-major-twelfth:after {
617
+ content: "";
618
+ display: table;
619
+ clear: both;
620
+ }
621
+ .ct-major-twelfth > svg {
622
+ display: block;
623
+ position: absolute;
624
+ top: 0;
625
+ left: 0;
626
+ }
627
+ .ct-double-octave {
628
+ display: block;
629
+ position: relative;
630
+ width: 100%;
631
+ }
632
+ .ct-double-octave:before {
633
+ display: block;
634
+ float: left;
635
+ content: "";
636
+ width: 0;
637
+ height: 0;
638
+ padding-bottom: 25%;
639
+ }
640
+ .ct-double-octave:after {
641
+ content: "";
642
+ display: table;
643
+ clear: both;
644
+ }
645
+ .ct-double-octave > svg {
646
+ display: block;
647
+ position: absolute;
648
+ top: 0;
649
+ left: 0;
650
+ }
@@ -0,0 +1,131 @@
1
+ :root {
2
+ /* Black */
3
+ --black: #000000;
4
+
5
+ /* Blue */
6
+ --blue-100: #ebf8ff;
7
+ --blue-200: #bee3f8;
8
+ --blue-300: #90cdf4;
9
+ --blue-400: #63b3ed;
10
+ --blue-500: #4299e1;
11
+ --blue-600: #3182ce;
12
+ --blue-700: #2b6cb0;
13
+ --blue-800: #2c5282;
14
+ --blue-900: #2a4365;
15
+
16
+ /* Gray */
17
+ --gray-100: #f7fafc;
18
+ --gray-200: #edf2f7;
19
+ --gray-300: #e2e8f0;
20
+ --gray-400: #cbd5e0;
21
+ --gray-500: #a0aec0;
22
+ --gray-600: #718096;
23
+ --gray-700: #4a5568;
24
+ --gray-800: #2d3748;
25
+ --gray-900: #1a202c;
26
+
27
+ /* Green */
28
+ --green-100: #f0fff4;
29
+ --green-200: #c6f6d5;
30
+ --green-300: #9ae6b4;
31
+ --green-400: #68d391;
32
+ --green-500: #48bb78;
33
+ --green-600: #38a169;
34
+ --green-700: #2f855a;
35
+ --green-800: #276749;
36
+ --green-900: #22543d;
37
+
38
+ /* Indigo */
39
+ --indigo-100: #ebf4ff;
40
+ --indigo-200: #c3dafe;
41
+ --indigo-300: #a3bffa;
42
+ --indigo-400: #7f9cf5;
43
+ --indigo-500: #667eea;
44
+ --indigo-600: #5a67d8;
45
+ --indigo-700: #4c51bf;
46
+ --indigo-800: #434190;
47
+ --indigo-900: #3c366b;
48
+
49
+ /* Orange */
50
+ --orange-100: #fffaf0;
51
+ --orange-200: #feebc8;
52
+ --orange-300: #fbd38d;
53
+ --orange-400: #f6ad55;
54
+ --orange-500: #ed8936;
55
+ --orange-600: #dd6b20;
56
+ --orange-700: #c05621;
57
+ --orange-800: #9c4221;
58
+ --orange-900: #7b341e;
59
+
60
+ /* Pink */
61
+ --pink-100: #fff5f7;
62
+ --pink-200: #fed7e2;
63
+ --pink-300: #fbb6ce;
64
+ --pink-400: #f687b3;
65
+ --pink-500: #ed64a6;
66
+ --pink-600: #d53f8c;
67
+ --pink-700: #b83280;
68
+ --pink-800: #97266d;
69
+ --pink-900: #702459;
70
+
71
+ /* Purple */
72
+ --purple-100: #faf5ff;
73
+ --purple-200: #e9d8fd;
74
+ --purple-300: #d6bcfa;
75
+ --purple-400: #b794f4;
76
+ --purple-500: #9f7aea;
77
+ --purple-600: #805ad5;
78
+ --purple-700: #6b46c1;
79
+ --purple-800: #553c9a;
80
+ --purple-900: #44337a;
81
+
82
+ /* Red */
83
+ --red-100: #fff5f5;
84
+ --red-200: #fed7d7;
85
+ --red-300: #feb2b2;
86
+ --red-400: #fc8181;
87
+ --red-500: #f56565;
88
+ --red-600: #e53e3e;
89
+ --red-700: #c53030;
90
+ --red-800: #9b2c2c;
91
+ --red-900: #742a2a;
92
+
93
+ /* Teal */
94
+ --teal-100: #e6fffa;
95
+ --teal-200: #b2f5ea;
96
+ --teal-300: #81e6d9;
97
+ --teal-400: #4fd1c5;
98
+ --teal-500: #38b2ac;
99
+ --teal-600: #319795;
100
+ --teal-700: #2c7a7b;
101
+ --teal-800: #285e61;
102
+ --teal-900: #234e52;
103
+
104
+ /* Yellow */
105
+ --yellow-100: #fffff0;
106
+ --yellow-200: #fefcbf;
107
+ --yellow-300: #faf089;
108
+ --yellow-400: #f6e05e;
109
+ --yellow-500: #ecc94b;
110
+ --yellow-600: #d69e2e;
111
+ --yellow-700: #b7791f;
112
+ --yellow-800: #975a16;
113
+ --yellow-900: #744210;
114
+
115
+ /* White */
116
+ --white: #ffffff;
117
+
118
+ /* Social networks */
119
+ --color-angellist: #101010;
120
+ --color-crunchbase: #005fff;
121
+ --color-dribbble: #eb4c89;
122
+ --color-facebook: #4267b2;
123
+ --color-github: #161b22;
124
+ --color-instagram: #c13584;
125
+ --color-linkedin: #0077b5;
126
+ --color-pinterest: #e60023;
127
+ --color-snapchat: #ecc94b;
128
+ --color-tiktok: #69c9d0;
129
+ --color-twitter: #1da1f2;
130
+ --color-youtube: #ff0000;
131
+ }
@@ -0,0 +1,59 @@
1
+ <script lang="ts" setup>
2
+ import type { BaseChart } from '../../types/bases'
3
+ import { BarChart, LineChart, PieChart } from 'chartist'
4
+
5
+ const props = withDefaults(defineProps<BaseChart>(), {
6
+ data: () => ({
7
+ labels: [],
8
+ series: [],
9
+ }),
10
+ fullWidth: false,
11
+ options: () => ({}),
12
+ type: 'line',
13
+ })
14
+
15
+ const chart = ref()
16
+ const root = ref<HTMLDivElement>()
17
+
18
+ watch(
19
+ () => props.data,
20
+ () => {
21
+ if (chart.value) {
22
+ if (props.type === 'line') {
23
+ chart.value.update((props.data as ChartistLineChartData), props.options)
24
+ }
25
+ else if (props.type === 'bar') {
26
+ chart.value.update((props.data as ChartistBarChartData), props.options)
27
+ }
28
+ else if (props.type === 'pie') {
29
+ chart.value.update((props.data as ChartistPieChartData), props.options)
30
+ }
31
+ }
32
+ },
33
+ { deep: true },
34
+ )
35
+
36
+ onMounted(() => {
37
+ if (root.value) {
38
+ if (props.type === 'line') {
39
+ chart.value = new LineChart(root.value, (props.data as ChartistLineChartData), props.options)
40
+ }
41
+ else if (props.type === 'bar') {
42
+ chart.value = new BarChart(root.value, (props.data as ChartistBarChartData), props.options)
43
+ }
44
+ else if (props.type === 'pie') {
45
+ chart.value = new PieChart(root.value, (props.data as ChartistPieChartData), props.options)
46
+ }
47
+ }
48
+ })
49
+
50
+ // Expose
51
+ defineExpose({ chart })
52
+ </script>
53
+
54
+ <template>
55
+ <div
56
+ ref="root"
57
+ :class="{ 'w-full': fullWidth }"
58
+ />
59
+ </template>
@@ -0,0 +1,115 @@
1
+ export default function useChartist() {
2
+ const progressiveLinePlugin = (params: {
3
+ animateArea?: boolean
4
+ delay?: number
5
+ duration?: number
6
+ easing?: any
7
+ stagger?: number
8
+ } = {}) => {
9
+ const {
10
+ animateArea = true,
11
+ delay = 0,
12
+ duration = 500,
13
+ easing = (window as any)?.Chartist?.Svg?.Easing?.easeOutQuart,
14
+ stagger = 0,
15
+ } = params
16
+
17
+ return (chart: any) => {
18
+ chart.on('draw', (ctx: any) => {
19
+ const begin = delay + (stagger ? stagger * (ctx.seriesIndex ?? 0) : 0)
20
+
21
+ // Animation for line charts
22
+ if (ctx.type === 'line') {
23
+ const node: SVGPathElement = ctx.element._node
24
+ const length = node.getTotalLength()
25
+
26
+ // Set the stroke dasharray and dashoffset
27
+ ctx.element.attr({
28
+ 'stroke-dasharray': `${length}px ${length}px`,
29
+ 'stroke-dashoffset': `${length}px`,
30
+ })
31
+
32
+ // Animate the stroke dashoffset to 0
33
+ ctx.element.animate({
34
+ 'stroke-dashoffset': {
35
+ begin,
36
+ dur: duration,
37
+ easing,
38
+ fill: 'freeze',
39
+ from: `${length}px`,
40
+ to: '0px',
41
+ },
42
+ }, false)
43
+
44
+ // Clean up the dash attributes after it finishes
45
+ const total = delay + duration + (stagger ? stagger * (ctx.seriesIndex ?? 0) : 0)
46
+
47
+ window.setTimeout(() => {
48
+ ctx.element.attr({
49
+ 'stroke-dasharray': null,
50
+ 'stroke-dashoffset': null,
51
+ })
52
+ }, total + 30)
53
+ }
54
+
55
+ // Animation for area charts
56
+ if (animateArea && ctx.type === 'area') {
57
+ ctx.element.animate({
58
+ // eslint-disable-next-line id-length -- SVG path attribute
59
+ d: {
60
+ begin,
61
+ dur: duration,
62
+ easing,
63
+ fill: 'freeze',
64
+ from: ctx.path
65
+ .clone()
66
+ .scale(1, 0)
67
+ .translate(0, ctx.chartRect.height())
68
+ .stringify(),
69
+ to: ctx.path.stringify(),
70
+ },
71
+ }, false)
72
+ }
73
+
74
+ // Animation for bar charts
75
+ if (ctx.type === 'bar') {
76
+ const horizontal = !!chart.options?.horizontalBars
77
+
78
+ // For vertical bars, y1 is baseline, y2 is top. For horizontal, x1 is baseline, x2 is end.
79
+ const from = horizontal ? ctx.x1 : ctx.y1
80
+ const to = horizontal ? ctx.x2 : ctx.y2
81
+
82
+ // Start collapsed at baseline
83
+ if (horizontal) {
84
+ ctx.element.attr({ x2: from })
85
+ ctx.element.animate({
86
+ x2: {
87
+ begin,
88
+ dur: duration,
89
+ easing,
90
+ fill: 'freeze',
91
+ from,
92
+ to,
93
+ },
94
+ }, false)
95
+ }
96
+ else {
97
+ ctx.element.attr({ y2: from })
98
+ ctx.element.animate({
99
+ y2: {
100
+ begin,
101
+ dur: duration,
102
+ easing,
103
+ fill: 'freeze',
104
+ from,
105
+ to,
106
+ },
107
+ }, false)
108
+ }
109
+ }
110
+ })
111
+ }
112
+ }
113
+
114
+ return { progressiveLinePlugin }
115
+ }
@@ -46,23 +46,6 @@ export interface BaseAvatar {
46
46
  to?: RouteLocationNamedI18n
47
47
  }
48
48
 
49
- export interface BaseBordered {
50
- background?: BaseBackground
51
- borderColor?: BaseBorderedColor
52
- hasBorder?: boolean
53
- shadow?: boolean
54
- title: string
55
- }
56
-
57
- export interface BaseCharacter {
58
- character?: BaseCharacterCharacter
59
- size?: BaseCharacterSize
60
- }
61
-
62
- export type BaseCharacterCharacter = 'anthony' | 'julien' | 'mathieu' | 'nada' | 'power' | 'yoda'
63
-
64
- export type BaseCharacterSize = 'base' | 'lg' | 'sm' | 'xs'
65
-
66
49
  export type BaseBorderedColor = 'black' | 'gray'
67
50
 
68
51
  export interface BaseButton {
@@ -91,6 +74,32 @@ export type BaseButtonSize = '2xs' | 'base' | 'lg' | 'sm' | 'xl' | 'xs'
91
74
 
92
75
  export type BaseButtonType = 'button' | 'reset' | 'submit'
93
76
 
77
+ export interface BaseBordered {
78
+ background?: BaseBackground
79
+ borderColor?: BaseBorderedColor
80
+ hasBorder?: boolean
81
+ shadow?: boolean
82
+ title: string
83
+ }
84
+
85
+ export interface BaseCharacter {
86
+ character?: BaseCharacterCharacter
87
+ size?: BaseCharacterSize
88
+ }
89
+
90
+ export type BaseCharacterCharacter = 'anthony' | 'julien' | 'mathieu' | 'nada' | 'power' | 'yoda'
91
+
92
+ export type BaseCharacterSize = 'base' | 'lg' | 'sm' | 'xs'
93
+
94
+ export interface BaseChart {
95
+ data?: ChartistBarChartData | ChartistLineChartData | ChartistPieChartData
96
+ fullWidth?: boolean
97
+ options?: ChartistOptions
98
+ type?: BaseChartType
99
+ }
100
+
101
+ export type BaseChartType = 'bar' | 'line' | 'pie'
102
+
94
103
  export interface BaseDivider {
95
104
  borderStyle?: BaseDividerBorderStyle
96
105
  margin?: number
@@ -1,7 +1,11 @@
1
1
  import type * as Bases from './bases'
2
2
 
3
3
  declare global {
4
- // Packages
4
+ // Libraries
5
+ type ChartistBarChartData = import('chartist').BarChartData
6
+ type ChartistLineChartData = import('chartist').LineChartData
7
+ type ChartistOptions = import('chartist').Options
8
+ type ChartistPieChartData = import('chartist').PieChartData
5
9
  type RouteLocationNamedI18n = import('vue-router').RouteLocationNamedI18n
6
10
 
7
11
  // Bases
@@ -17,6 +21,8 @@ declare global {
17
21
  type BaseCharacter = Bases.BaseCharacter
18
22
  type BaseCharacterCharacter = Bases.BaseCharacterCharacter
19
23
  type BaseCharacterSize = Bases.BaseCharacterSize
24
+ type BaseChart = Bases.BaseChart
25
+ type BaseChartType = Bases.BaseChartType
20
26
  type BaseColor = Bases.BaseColor
21
27
  type BaseDivider = Bases.BaseDivider
22
28
  type BaseDividerBorderStyle = Bases.BaseDividerBorderStyle
package/nuxt.config.ts CHANGED
@@ -29,6 +29,8 @@ export default defineNuxtConfig({
29
29
 
30
30
  css: [
31
31
  '@unocss/reset/tailwind.css',
32
+ join(currentDir, './app/assets/styles/chartist.css'),
33
+ join(currentDir, './app/assets/styles/colors.css'),
32
34
  join(currentDir, './app/assets/styles/v-popper.css'),
33
35
  ],
34
36
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
3
  "type": "module",
4
- "version": "0.1.56",
4
+ "version": "0.1.58",
5
5
  "private": false,
6
6
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
7
7
  "license": "MIT",
@@ -41,6 +41,7 @@
41
41
  "@pinia/nuxt": "0.11.2",
42
42
  "@unocss/nuxt": "66.5.4",
43
43
  "@unocss/reset": "66.5.10",
44
+ "chartist": "1.5.0",
44
45
  "floating-vue": "5.2.2",
45
46
  "motion-v": "1.7.4",
46
47
  "numbro": "2.5.0",