@pandacss/studio 0.0.0-dev-20230928100320 → 0.0.0-dev-20230928113341
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/package.json +8 -8
- package/src/lib/panda.context.ts +0 -2
- package/styled-system/chunks/src__components__color-wrapper.css +16 -25
- package/styled-system/chunks/src__components__colors.css +0 -1
- package/styled-system/chunks/src__components__empty-state.css +0 -1
- package/styled-system/chunks/src__components__font-family.css +0 -1
- package/styled-system/chunks/src__components__font-tokens.css +0 -1
- package/styled-system/chunks/src__components__input.css +10 -16
- package/styled-system/chunks/src__components__layer-styles.css +5 -7
- package/styled-system/chunks/src__components__nav-item.css +3 -5
- package/styled-system/chunks/src__components__overview.css +4 -7
- package/styled-system/chunks/src__components__radii.css +0 -1
- package/styled-system/chunks/src__components__semantic-color.css +0 -1
- package/styled-system/chunks/src__components__side-nav-item.css +4 -7
- package/styled-system/chunks/src__components__side-nav.css +0 -1
- package/styled-system/chunks/src__components__text-styles.css +0 -1
- package/styled-system/chunks/src__components__theme-toggle.css +2 -4
- package/styled-system/chunks/src__components__token-content.css +0 -1
- package/styled-system/chunks/src__components__token-group.css +0 -1
- package/styled-system/chunks/src__components__typography-playground.css +0 -1
- package/styled-system/chunks/src__layouts__Sidebar.css +4 -4
- package/styled-system/styles.css +50 -319
- package/virtual-panda.ts +2 -12
- package/src/components/analyzer/category-utilities.tsx +0 -156
- package/src/components/analyzer/data-combobox.tsx +0 -154
- package/src/components/analyzer/data-table.tsx +0 -39
- package/src/components/analyzer/external-icon.tsx +0 -8
- package/src/components/analyzer/file-details.tsx +0 -101
- package/src/components/analyzer/get-report-infos-from.ts +0 -80
- package/src/components/analyzer/quick-tooltip.tsx +0 -15
- package/src/components/analyzer/report-item-columns.tsx +0 -52
- package/src/components/analyzer/report-item-link.tsx +0 -98
- package/src/components/analyzer/section.tsx +0 -24
- package/src/components/analyzer/sort-icon.tsx +0 -10
- package/src/components/analyzer/text-with-count.tsx +0 -28
- package/src/components/analyzer/token-search-combobox.tsx +0 -39
- package/src/components/analyzer/truncated-text.tsx +0 -28
- package/src/components/analyzer/utility-details.tsx +0 -325
- package/src/components/color-item.tsx +0 -37
- package/src/components/token-analyzer.tsx +0 -397
- package/src/lib/analysis-data.ts +0 -17
- package/src/lib/get-report-item.tsx +0 -41
- package/src/pages/token-analyzer/file.astro +0 -11
- package/src/pages/token-analyzer/index.astro +0 -11
- package/src/pages/token-analyzer/utility.astro +0 -11
- package/styled-system/chunks/src__components__analyzer__category-utilities.css +0 -118
- package/styled-system/chunks/src__components__analyzer__data-combobox.css +0 -137
- package/styled-system/chunks/src__components__analyzer__data-table.css +0 -46
- package/styled-system/chunks/src__components__analyzer__file-details.css +0 -98
- package/styled-system/chunks/src__components__analyzer__report-item-columns.css +0 -39
- package/styled-system/chunks/src__components__analyzer__report-item-link.css +0 -78
- package/styled-system/chunks/src__components__analyzer__section.css +0 -30
- package/styled-system/chunks/src__components__analyzer__text-with-count.css +0 -34
- package/styled-system/chunks/src__components__analyzer__truncated-text.css +0 -18
- package/styled-system/chunks/src__components__analyzer__utility-details.css +0 -139
- package/styled-system/chunks/src__components__color-item.css +0 -22
- package/styled-system/chunks/src__components__token-analyzer.css +0 -220
package/styled-system/styles.css
CHANGED
|
@@ -11,131 +11,6 @@
|
|
|
11
11
|
@import './tokens/keyframes.css';
|
|
12
12
|
|
|
13
13
|
@layer utilities {
|
|
14
|
-
.w_26px {
|
|
15
|
-
width: 26px
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.grid-cols_repeat\(2\,_minmax\(0\,_1fr\)\) {
|
|
19
|
-
grid-template-columns: repeat(2, minmax(0, 1fr))
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.col-span_span_2 {
|
|
23
|
-
grid-column: span 2
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.m_4 {
|
|
27
|
-
margin: var(--spacing-4)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.max-h_300px {
|
|
31
|
-
max-height: 300px
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.word-wrap_break-word {
|
|
35
|
-
word-wrap: break-word
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.highlighted\:bg_border[data-highlighted] {
|
|
39
|
-
background: var(--colors-border)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.isolation_isolate {
|
|
43
|
-
isolation: isolate
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.border-l_solid_1px {
|
|
47
|
-
border-left: solid 1px
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.expanded\:transform_rotate\(180deg\):is([aria-expanded=true], [data-expanded], [data-state="expanded"]) {
|
|
51
|
-
transform: rotate(180deg)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.transition_all_\.2s_ease {
|
|
55
|
-
transition: all .2s ease
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.top_0px {
|
|
59
|
-
top: 0px
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.right_0px {
|
|
63
|
-
right: 0px
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.pos_absolute {
|
|
67
|
-
position: absolute
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.z_2 {
|
|
71
|
-
z-index: 2
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.break_break-word {
|
|
75
|
-
word-break: break-word
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.grid-cols_80px_repeat\(auto-fit\,_minmax\(30px\,_1fr\)\) {
|
|
79
|
-
grid-template-columns: 80px repeat(auto-fit, minmax(30px, 1fr))
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.max-w_14px {
|
|
83
|
-
max-width: 14px
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.shrink_0 {
|
|
87
|
-
flex-shrink: 0
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.border_1px_solid_token\(colors\.border\) {
|
|
91
|
-
border: 1px solid var(--colors-border)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.text_red\.400 {
|
|
95
|
-
color: var(--colors-red-400)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.fs_75\% {
|
|
99
|
-
font-size: 75%
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.leading_0 {
|
|
103
|
-
line-height: 0
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.top_-0\.35em {
|
|
107
|
-
top: -0.35em
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.ml_1 {
|
|
111
|
-
margin-left: var(--spacing-1)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.bg_card {
|
|
115
|
-
background-color: var(--colors-card)
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.p_16 {
|
|
119
|
-
padding: var(--spacing-16)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.mt_1 {
|
|
123
|
-
margin-top: var(--spacing-1)
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.select_none {
|
|
127
|
-
-webkit-user-select: none;
|
|
128
|
-
user-select: none
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.px_3 {
|
|
132
|
-
padding-inline: var(--spacing-3)
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.h_16 {
|
|
136
|
-
height: var(--sizes-16)
|
|
137
|
-
}
|
|
138
|
-
|
|
139
14
|
.pt_16 {
|
|
140
15
|
padding-top: var(--spacing-16)
|
|
141
16
|
}
|
|
@@ -144,10 +19,18 @@
|
|
|
144
19
|
margin-top: var(--spacing-10)
|
|
145
20
|
}
|
|
146
21
|
|
|
22
|
+
.opacity_0\.5 {
|
|
23
|
+
opacity: 0.5
|
|
24
|
+
}
|
|
25
|
+
|
|
147
26
|
.justify_space-between {
|
|
148
27
|
justify-content: space-between
|
|
149
28
|
}
|
|
150
29
|
|
|
30
|
+
.p_2 {
|
|
31
|
+
padding: var(--spacing-2)
|
|
32
|
+
}
|
|
33
|
+
|
|
151
34
|
.ring_none {
|
|
152
35
|
outline: var(--borders-none)
|
|
153
36
|
}
|
|
@@ -164,22 +47,6 @@
|
|
|
164
47
|
flex: 1 1 0%
|
|
165
48
|
}
|
|
166
49
|
|
|
167
|
-
.w_auto {
|
|
168
|
-
width: auto
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.min-w_80px {
|
|
172
|
-
min-width: 80px
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.h_40px {
|
|
176
|
-
height: 40px
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.mb_2 {
|
|
180
|
-
margin-bottom: var(--spacing-2)
|
|
181
|
-
}
|
|
182
|
-
|
|
183
50
|
.h_10 {
|
|
184
51
|
height: var(--sizes-10)
|
|
185
52
|
}
|
|
@@ -224,6 +91,10 @@
|
|
|
224
91
|
background-image: var(--assets-check)
|
|
225
92
|
}
|
|
226
93
|
|
|
94
|
+
.fs_xl {
|
|
95
|
+
font-size: var(--font-sizes-xl)
|
|
96
|
+
}
|
|
97
|
+
|
|
227
98
|
.gap_0\.5 {
|
|
228
99
|
gap: var(--spacing-0\.5)
|
|
229
100
|
}
|
|
@@ -417,6 +288,10 @@
|
|
|
417
288
|
margin-top: var(--spacing-6)
|
|
418
289
|
}
|
|
419
290
|
|
|
291
|
+
.transition_all_0\.2s_ease {
|
|
292
|
+
transition: all 0.2s ease
|
|
293
|
+
}
|
|
294
|
+
|
|
420
295
|
.py_24 {
|
|
421
296
|
padding-block: var(--spacing-24)
|
|
422
297
|
}
|
|
@@ -441,6 +316,10 @@
|
|
|
441
316
|
padding: var(--spacing-8)
|
|
442
317
|
}
|
|
443
318
|
|
|
319
|
+
.flex-wrap_wrap {
|
|
320
|
+
flex-wrap: wrap
|
|
321
|
+
}
|
|
322
|
+
|
|
444
323
|
.gap_6 {
|
|
445
324
|
gap: var(--spacing-6)
|
|
446
325
|
}
|
|
@@ -489,6 +368,10 @@
|
|
|
489
368
|
border-color: var(--colors-neutral-700)
|
|
490
369
|
}
|
|
491
370
|
|
|
371
|
+
.fs_sm {
|
|
372
|
+
font-size: var(--font-sizes-sm)
|
|
373
|
+
}
|
|
374
|
+
|
|
492
375
|
.text_uppercase {
|
|
493
376
|
text-transform: uppercase
|
|
494
377
|
}
|
|
@@ -501,10 +384,18 @@
|
|
|
501
384
|
padding-block: var(--spacing-1\.5)
|
|
502
385
|
}
|
|
503
386
|
|
|
387
|
+
.fs_md {
|
|
388
|
+
font-size: var(--font-sizes-md)
|
|
389
|
+
}
|
|
390
|
+
|
|
504
391
|
.currentPage\:text_yellow\.300[aria-current=page] {
|
|
505
392
|
color: var(--colors-yellow-300)
|
|
506
393
|
}
|
|
507
394
|
|
|
395
|
+
.mt_8 {
|
|
396
|
+
margin-top: var(--spacing-8)
|
|
397
|
+
}
|
|
398
|
+
|
|
508
399
|
.fs_small {
|
|
509
400
|
font-size: small
|
|
510
401
|
}
|
|
@@ -517,6 +408,10 @@
|
|
|
517
408
|
list-style-type: none
|
|
518
409
|
}
|
|
519
410
|
|
|
411
|
+
.p_0 {
|
|
412
|
+
padding: var(--spacing-0)
|
|
413
|
+
}
|
|
414
|
+
|
|
520
415
|
.my_2 {
|
|
521
416
|
margin-block: var(--spacing-2)
|
|
522
417
|
}
|
|
@@ -595,6 +490,10 @@
|
|
|
595
490
|
font-weight: var(--font-weights-medium)
|
|
596
491
|
}
|
|
597
492
|
|
|
493
|
+
.cursor_pointer {
|
|
494
|
+
cursor: pointer
|
|
495
|
+
}
|
|
496
|
+
|
|
598
497
|
.\[\&\.active\]\:text_yellow\.300.active {
|
|
599
498
|
color: var(--colors-yellow-300)
|
|
600
499
|
}
|
|
@@ -615,164 +514,28 @@
|
|
|
615
514
|
flex-direction: row
|
|
616
515
|
}
|
|
617
516
|
|
|
618
|
-
.border-width_1px {
|
|
619
|
-
border-width: 1px
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
.self_flex-start {
|
|
623
|
-
align-self: flex-start
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
.text_inherit {
|
|
627
|
-
color: inherit
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
.py_20px {
|
|
631
|
-
padding-block: 20px
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
.p_4px_8px {
|
|
635
|
-
padding: 4px 8px
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
.\[\&_li\]\:cursor_pointer li {
|
|
639
|
-
cursor: pointer
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
.list-style_none {
|
|
643
|
-
list-style: none
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
.p_6 {
|
|
647
|
-
padding: var(--spacing-6)
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
.cursor_default {
|
|
651
|
-
cursor: default
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
.px_24 {
|
|
655
|
-
padding-inline: var(--spacing-24)
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
.w_100\% {
|
|
659
|
-
width: 100%
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
.w_5 {
|
|
663
|
-
width: var(--sizes-5)
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
.ml_auto {
|
|
667
|
-
margin-left: auto
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
.mt_8 {
|
|
671
|
-
margin-top: var(--spacing-8)
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
.fs_xl {
|
|
675
|
-
font-size: var(--font-sizes-xl)
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
.p_2 {
|
|
679
|
-
padding: var(--spacing-2)
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
.bg_gray\.100 {
|
|
683
|
-
background: var(--colors-gray-100)
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
.border_1px_solid_rgba\(0\,_0\,_0\,_0\.1\) {
|
|
687
|
-
border: 1px solid rgba(0, 0, 0, 0.1)
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
.fs_md {
|
|
691
|
-
font-size: var(--font-sizes-md)
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
.ml_2 {
|
|
695
|
-
margin-left: var(--spacing-2)
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
.d_inline-block {
|
|
699
|
-
display: inline-block
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
.p_0 {
|
|
703
|
-
padding: var(--spacing-0)
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
.py_2 {
|
|
707
|
-
padding-block: var(--spacing-2)
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
.transition_all_0\.2s_ease {
|
|
711
|
-
transition: all 0.2s ease
|
|
712
|
-
}
|
|
713
|
-
|
|
714
517
|
.rounded_md {
|
|
715
518
|
border-radius: var(--radii-md)
|
|
716
519
|
}
|
|
717
520
|
|
|
718
|
-
.
|
|
719
|
-
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
.pt_6 {
|
|
723
|
-
padding-top: var(--spacing-6)
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
.pl_6 {
|
|
727
|
-
padding-left: var(--spacing-6)
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
.pr_4 {
|
|
731
|
-
padding-right: var(--spacing-4)
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
.text_text {
|
|
735
|
-
color: var(--colors-text)
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
.mb_4 {
|
|
739
|
-
margin-bottom: var(--spacing-4)
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
.p_20px {
|
|
743
|
-
padding: 20px
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
.fs_lg {
|
|
747
|
-
font-size: var(--font-sizes-lg)
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
.d_inline-flex {
|
|
751
|
-
display: inline-flex
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
.opacity_0\.5 {
|
|
755
|
-
opacity: 0.5
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
.border-b_1px_solid_transparent {
|
|
759
|
-
border-bottom: 1px solid transparent
|
|
521
|
+
.px_2 {
|
|
522
|
+
padding-inline: var(--spacing-2)
|
|
760
523
|
}
|
|
761
524
|
|
|
762
|
-
.
|
|
763
|
-
|
|
525
|
+
.py_2 {
|
|
526
|
+
padding-block: var(--spacing-2)
|
|
764
527
|
}
|
|
765
528
|
|
|
766
|
-
.
|
|
767
|
-
|
|
529
|
+
.border-width_1px {
|
|
530
|
+
border-width: 1px
|
|
768
531
|
}
|
|
769
532
|
|
|
770
|
-
.
|
|
771
|
-
|
|
533
|
+
.self_flex-start {
|
|
534
|
+
align-self: flex-start
|
|
772
535
|
}
|
|
773
536
|
|
|
774
|
-
.
|
|
775
|
-
|
|
537
|
+
.text_inherit {
|
|
538
|
+
color: inherit
|
|
776
539
|
}
|
|
777
540
|
|
|
778
541
|
.gap_12 {
|
|
@@ -951,10 +714,6 @@
|
|
|
951
714
|
outline-color: var(--colors-neutral-400)
|
|
952
715
|
}
|
|
953
716
|
|
|
954
|
-
.hover\:bg_gray\.100:is(:hover, [data-hover]) {
|
|
955
|
-
background-color: var(--colors-gray-100)
|
|
956
|
-
}
|
|
957
|
-
|
|
958
717
|
.hover\:shadow_lg:is(:hover, [data-hover]) {
|
|
959
718
|
box-shadow: var(--shadows-lg)
|
|
960
719
|
}
|
|
@@ -971,34 +730,6 @@
|
|
|
971
730
|
color: var(--colors-yellow-300)
|
|
972
731
|
}
|
|
973
732
|
|
|
974
|
-
.hover\:opacity_0\.8:is(:hover, [data-hover]) {
|
|
975
|
-
opacity: 0.8
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
.hover\:bg_border:is(:hover, [data-hover]) {
|
|
979
|
-
background-color: var(--colors-border)
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
.hover\:bg_border:is(:hover, [data-hover]) {
|
|
983
|
-
background: var(--colors-border)
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
.hover\:opacity_0\.6:is(:hover, [data-hover]) {
|
|
987
|
-
opacity: 0.6
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
.hover\:opacity_1:is(:hover, [data-hover]) {
|
|
991
|
-
opacity: 1
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
.hover\:border-b_black:is(:hover, [data-hover]) {
|
|
995
|
-
border-bottom-color: var(--colors-black)
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
.\[\&_li\]\:hover\:opacity_0\.8 li:is(:hover, [data-hover]) {
|
|
999
|
-
opacity: 0.8
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
733
|
@media screen and (min-width: 48em) {
|
|
1003
734
|
.md\:px_6 {
|
|
1004
735
|
padding-inline: var(--spacing-6)
|
package/virtual-panda.ts
CHANGED
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
import { type PandaContext
|
|
2
|
-
import { stringify } from 'javascript-stringify'
|
|
1
|
+
import { loadConfigAndCreateContext, type PandaContext } from '@pandacss/node'
|
|
3
2
|
import type { AstroIntegration } from 'astro'
|
|
3
|
+
import { stringify } from 'javascript-stringify'
|
|
4
4
|
import type { PluginOption } from 'vite'
|
|
5
5
|
|
|
6
|
-
import { dirname, resolve } from 'path'
|
|
7
|
-
import { fileURLToPath } from 'url'
|
|
8
|
-
|
|
9
6
|
const virtualModuleId = 'virtual:panda'
|
|
10
7
|
const resolvedVirtualModuleId = '\0' + virtualModuleId
|
|
11
8
|
|
|
12
|
-
const _dirname = dirname(fileURLToPath(import.meta.url))
|
|
13
|
-
const analysisDataFilepath = 'src/lib/analysis.json'
|
|
14
|
-
const jsonPath = resolve(_dirname, analysisDataFilepath)
|
|
15
|
-
|
|
16
9
|
function vitePlugin(configPath: string): PluginOption {
|
|
17
10
|
let config: PandaContext['config']
|
|
18
11
|
|
|
19
12
|
async function loadPandaConfig() {
|
|
20
13
|
const ctx = await loadConfigAndCreateContext({ configPath })
|
|
21
14
|
config = ctx.config
|
|
22
|
-
|
|
23
|
-
const result = analyzeTokens(ctx)
|
|
24
|
-
await writeAnalyzeJSON(jsonPath, result, ctx)
|
|
25
15
|
}
|
|
26
16
|
|
|
27
17
|
return {
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { Grid, panda, Stack, Wrap } from '../../../styled-system/jsx'
|
|
2
|
-
import { gridItem, styledLink } from '../../../styled-system/patterns'
|
|
3
|
-
import { getReportItem, getUtilityLink } from '../../lib/get-report-item'
|
|
4
|
-
import { groupBy } from '../../lib/group-in'
|
|
5
|
-
import { Section } from './section'
|
|
6
|
-
import { TextWithCount } from './text-with-count'
|
|
7
|
-
import { TruncatedText } from './truncated-text'
|
|
8
|
-
|
|
9
|
-
import { Portal, Select, SelectContent, SelectOption, SelectPositioner, SelectTrigger } from '@ark-ui/react'
|
|
10
|
-
import { useState } from 'react'
|
|
11
|
-
import { css, cx } from '../../../styled-system/css'
|
|
12
|
-
import { ReportItemLink } from './report-item-link'
|
|
13
|
-
import { SortIcon } from './sort-icon'
|
|
14
|
-
|
|
15
|
-
const selectOptionClass = css({
|
|
16
|
-
padding: '4px 8px',
|
|
17
|
-
bg: 'card',
|
|
18
|
-
rounded: 'md',
|
|
19
|
-
'& li': {
|
|
20
|
-
cursor: 'pointer',
|
|
21
|
-
_hover: { opacity: 0.8 },
|
|
22
|
-
},
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
type SortBy = 'property name' | 'tokens count'
|
|
26
|
-
const defaultOption = { label: 'tokens count', value: 'tokens count' as SortBy }
|
|
27
|
-
|
|
28
|
-
export const ByCategory = ({ byCategory }: { byCategory: Record<string, number[]> }) => {
|
|
29
|
-
const { unknown, ...rest } = byCategory
|
|
30
|
-
const keys = Object.keys(rest)
|
|
31
|
-
const [sortedBy, setSortedBy] = useState<SortBy>('tokens count')
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<Section
|
|
35
|
-
p="0"
|
|
36
|
-
title={
|
|
37
|
-
<span>
|
|
38
|
-
<TextWithCount count={keys.length + 1}>Category </TextWithCount>
|
|
39
|
-
<panda.span ml="2">utilities</panda.span>
|
|
40
|
-
</span>
|
|
41
|
-
}
|
|
42
|
-
subTitle={
|
|
43
|
-
<panda.div ml="auto">
|
|
44
|
-
<Select
|
|
45
|
-
onChange={(option) => setSortedBy((option?.value as SortBy) ?? 'tokens count')}
|
|
46
|
-
defaultValue={defaultOption}
|
|
47
|
-
>
|
|
48
|
-
{({ selectedOption }) => (
|
|
49
|
-
<>
|
|
50
|
-
<SelectTrigger>
|
|
51
|
-
<panda.button display="flex" alignItems="center" cursor="pointer" _hover={{ opacity: 0.6 }}>
|
|
52
|
-
Sort by {selectedOption?.label}
|
|
53
|
-
<panda.div w="26px" ml="2" color="text">
|
|
54
|
-
<SortIcon />
|
|
55
|
-
</panda.div>
|
|
56
|
-
</panda.button>
|
|
57
|
-
</SelectTrigger>
|
|
58
|
-
<Portal>
|
|
59
|
-
<SelectPositioner>
|
|
60
|
-
<SelectContent className={cx(selectOptionClass, css({ listStyle: 'none' }))}>
|
|
61
|
-
<SelectOption
|
|
62
|
-
className={selectOptionClass}
|
|
63
|
-
value={defaultOption.value}
|
|
64
|
-
label={defaultOption.label}
|
|
65
|
-
/>
|
|
66
|
-
<SelectOption className={selectOptionClass} value="property name" label="property name" />
|
|
67
|
-
</SelectContent>
|
|
68
|
-
</SelectPositioner>
|
|
69
|
-
</Portal>
|
|
70
|
-
</>
|
|
71
|
-
)}
|
|
72
|
-
</Select>
|
|
73
|
-
</panda.div>
|
|
74
|
-
}
|
|
75
|
-
>
|
|
76
|
-
<Grid gap="4" columns={2}>
|
|
77
|
-
{/* TODO filter out variants from recipes ? */}
|
|
78
|
-
{keys.map((category) => (
|
|
79
|
-
<CategoryUtilities key={category} category={category} byCategory={byCategory} sortedBy={sortedBy} />
|
|
80
|
-
))}
|
|
81
|
-
{unknown ? (
|
|
82
|
-
<CategoryUtilities
|
|
83
|
-
className={gridItem({ colSpan: 2 })}
|
|
84
|
-
category="unknown"
|
|
85
|
-
byCategory={byCategory}
|
|
86
|
-
sortedBy={sortedBy}
|
|
87
|
-
/>
|
|
88
|
-
) : null}
|
|
89
|
-
</Grid>
|
|
90
|
-
</Section>
|
|
91
|
-
)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const CategoryUtilities = ({
|
|
95
|
-
category,
|
|
96
|
-
byCategory,
|
|
97
|
-
className,
|
|
98
|
-
sortedBy,
|
|
99
|
-
}: {
|
|
100
|
-
category: string
|
|
101
|
-
byCategory: Record<string, number[]>
|
|
102
|
-
className?: string
|
|
103
|
-
sortedBy: SortBy
|
|
104
|
-
}) => {
|
|
105
|
-
const reportItemIdList = byCategory[category as keyof typeof byCategory]
|
|
106
|
-
|
|
107
|
-
const categoryTokens = reportItemIdList.map(getReportItem)
|
|
108
|
-
const grouped = groupBy(categoryTokens, 'value')
|
|
109
|
-
const values = Object.entries(grouped)
|
|
110
|
-
const flattened = values.flatMap(([_value, reportItemList]) => reportItemList)
|
|
111
|
-
|
|
112
|
-
const sorted = flattened
|
|
113
|
-
.filter((item) => {
|
|
114
|
-
return item === grouped[String(item.value)][0]
|
|
115
|
-
})
|
|
116
|
-
.sort((a, b) => {
|
|
117
|
-
if (sortedBy === 'property name') {
|
|
118
|
-
const result = a.propName.localeCompare(b.propName)
|
|
119
|
-
if (result !== 0) {
|
|
120
|
-
return result
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return String(a.value).localeCompare(String(b.value))
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (sortedBy === 'tokens count') {
|
|
127
|
-
return grouped[String(b.value)].length - grouped[String(a.value)].length
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return 0
|
|
131
|
-
})
|
|
132
|
-
|
|
133
|
-
return (
|
|
134
|
-
<Stack key={category} p="4" bg="card" color="text" rounded="md" gap="2" className={className}>
|
|
135
|
-
<panda.h4>
|
|
136
|
-
<panda.a className={styledLink({})} href={getUtilityLink({ category })}>
|
|
137
|
-
<TextWithCount count={values.length}>
|
|
138
|
-
<TruncatedText text={category} fontWeight="semibold" />
|
|
139
|
-
</TextWithCount>
|
|
140
|
-
</panda.a>
|
|
141
|
-
</panda.h4>
|
|
142
|
-
<Wrap gap="2">
|
|
143
|
-
{sorted.map((reportItem) => {
|
|
144
|
-
return (
|
|
145
|
-
<ReportItemLink
|
|
146
|
-
key={reportItem.id}
|
|
147
|
-
value={reportItem.value}
|
|
148
|
-
category={reportItem.category}
|
|
149
|
-
propName={reportItem.propName}
|
|
150
|
-
/>
|
|
151
|
-
)
|
|
152
|
-
})}
|
|
153
|
-
</Wrap>
|
|
154
|
-
</Stack>
|
|
155
|
-
)
|
|
156
|
-
}
|