@bundle-stats/ui 4.4.2 → 4.5.0-beta.1

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.
Files changed (167) hide show
  1. package/lib/assets/icons.svg +16 -10
  2. package/lib/assets/icons.svg.js +14 -10
  3. package/lib/assets/icons.svg.js.map +1 -1
  4. package/lib/components/bundle-assets/bundle-assets.js +2 -10
  5. package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
  6. package/lib/components/bundle-assets/bundle-assets.utils.js +8 -20
  7. package/lib/components/bundle-assets/bundle-assets.utils.js.map +1 -1
  8. package/lib/components/bundle-assets/index.js +0 -2
  9. package/lib/components/bundle-assets/index.js.map +1 -1
  10. package/lib/components/bundle-modules/bundle-modules.js +2 -10
  11. package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
  12. package/lib/components/bundle-modules/bundle-modules.utils.js +1 -13
  13. package/lib/components/bundle-modules/bundle-modules.utils.js.map +1 -1
  14. package/lib/components/bundle-modules/index.js +2 -4
  15. package/lib/components/bundle-modules/index.js.map +1 -1
  16. package/lib/components/bundle-packages/bundle-packages.js +2 -10
  17. package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
  18. package/lib/components/bundle-packages/bundle-packages.utils.js +1 -13
  19. package/lib/components/bundle-packages/bundle-packages.utils.js.map +1 -1
  20. package/lib/components/bundle-packages/index.js +2 -4
  21. package/lib/components/bundle-packages/index.js.map +1 -1
  22. package/lib/components/entry-info/entry-info.js +5 -6
  23. package/lib/components/entry-info/entry-info.js.map +1 -1
  24. package/lib/components/entry-info/entry-info.module.css +4 -6
  25. package/lib/components/metrics-table/metrics-table.js +41 -104
  26. package/lib/components/metrics-table/metrics-table.js.map +1 -1
  27. package/lib/components/metrics-table/metrics-table.module.css +10 -15
  28. package/lib/components/metrics-table-title/metrics-table-title.js +1 -1
  29. package/lib/components/metrics-table-title/metrics-table-title.js.map +1 -1
  30. package/lib/components/metrics-table-title/metrics-table-title.module.css +3 -1
  31. package/lib/components/run-info/run-info.js +7 -3
  32. package/lib/components/run-info/run-info.js.map +1 -1
  33. package/lib/{ui/sort-dropdown → components/sort-button}/index.js +1 -1
  34. package/lib/components/sort-button/index.js.map +1 -0
  35. package/lib/components/sort-button/sort-button.js +73 -0
  36. package/lib/components/sort-button/sort-button.js.map +1 -0
  37. package/lib/components/sort-button/sort-button.module.css +89 -0
  38. package/lib/constants.js +5 -1
  39. package/lib/constants.js.map +1 -1
  40. package/lib/hooks/rows-sort.js +13 -5
  41. package/lib/hooks/rows-sort.js.map +1 -1
  42. package/lib/ui/icon/icon.js +2 -0
  43. package/lib/ui/icon/icon.js.map +1 -1
  44. package/lib/ui/index.js +1 -3
  45. package/lib/ui/index.js.map +1 -1
  46. package/lib-esm/assets/icons.svg +16 -10
  47. package/lib-esm/assets/icons.svg.js +14 -10
  48. package/lib-esm/assets/icons.svg.js.map +1 -1
  49. package/lib-esm/components/bundle-assets/bundle-assets.js +2 -10
  50. package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
  51. package/lib-esm/components/bundle-assets/bundle-assets.utils.js +8 -21
  52. package/lib-esm/components/bundle-assets/bundle-assets.utils.js.map +1 -1
  53. package/lib-esm/components/bundle-assets/index.js +0 -2
  54. package/lib-esm/components/bundle-assets/index.js.map +1 -1
  55. package/lib-esm/components/bundle-modules/bundle-modules.js +2 -10
  56. package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
  57. package/lib-esm/components/bundle-modules/bundle-modules.utils.js +1 -14
  58. package/lib-esm/components/bundle-modules/bundle-modules.utils.js.map +1 -1
  59. package/lib-esm/components/bundle-modules/index.js +2 -4
  60. package/lib-esm/components/bundle-modules/index.js.map +1 -1
  61. package/lib-esm/components/bundle-packages/bundle-packages.js +2 -10
  62. package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
  63. package/lib-esm/components/bundle-packages/bundle-packages.utils.js +1 -14
  64. package/lib-esm/components/bundle-packages/bundle-packages.utils.js.map +1 -1
  65. package/lib-esm/components/bundle-packages/index.js +2 -4
  66. package/lib-esm/components/bundle-packages/index.js.map +1 -1
  67. package/lib-esm/components/entry-info/entry-info.js +5 -6
  68. package/lib-esm/components/entry-info/entry-info.js.map +1 -1
  69. package/lib-esm/components/entry-info/entry-info.module.css +4 -6
  70. package/lib-esm/components/metrics-table/metrics-table.js +41 -81
  71. package/lib-esm/components/metrics-table/metrics-table.js.map +1 -1
  72. package/lib-esm/components/metrics-table/metrics-table.module.css +10 -15
  73. package/lib-esm/components/metrics-table-title/metrics-table-title.js +1 -1
  74. package/lib-esm/components/metrics-table-title/metrics-table-title.js.map +1 -1
  75. package/lib-esm/components/metrics-table-title/metrics-table-title.module.css +3 -1
  76. package/lib-esm/components/run-info/run-info.js +7 -3
  77. package/lib-esm/components/run-info/run-info.js.map +1 -1
  78. package/lib-esm/components/sort-button/index.js +2 -0
  79. package/lib-esm/components/sort-button/index.js.map +1 -0
  80. package/lib-esm/components/sort-button/sort-button.js +43 -0
  81. package/lib-esm/components/sort-button/sort-button.js.map +1 -0
  82. package/lib-esm/components/sort-button/sort-button.module.css +89 -0
  83. package/lib-esm/constants.js +4 -0
  84. package/lib-esm/constants.js.map +1 -1
  85. package/lib-esm/hooks/rows-sort.js +11 -4
  86. package/lib-esm/hooks/rows-sort.js.map +1 -1
  87. package/lib-esm/ui/icon/icon.js +2 -0
  88. package/lib-esm/ui/icon/icon.js.map +1 -1
  89. package/lib-esm/ui/index.js +0 -1
  90. package/lib-esm/ui/index.js.map +1 -1
  91. package/package.json +3 -3
  92. package/src/assets/icons/chevron-down.svg +1 -0
  93. package/src/assets/icons/chevron-up.svg +1 -0
  94. package/src/assets/icons.svg +16 -10
  95. package/src/assets/icons.svg.jsx +24 -10
  96. package/src/components/bundle-assets/bundle-assets.jsx +2 -9
  97. package/src/components/bundle-assets/bundle-assets.utils.js +8 -24
  98. package/src/components/bundle-assets/index.jsx +0 -2
  99. package/src/components/bundle-modules/bundle-modules.jsx +2 -14
  100. package/src/components/bundle-modules/bundle-modules.utils.js +1 -17
  101. package/src/components/bundle-modules/index.jsx +2 -4
  102. package/src/components/bundle-packages/bundle-packages.jsx +2 -9
  103. package/src/components/bundle-packages/bundle-packages.utils.js +1 -17
  104. package/src/components/bundle-packages/index.jsx +2 -4
  105. package/src/components/entry-info/entry-info.module.css +4 -6
  106. package/src/components/entry-info/entry-info.tsx +13 -14
  107. package/src/components/metrics-table/metrics-table.jsx +134 -131
  108. package/src/components/metrics-table/metrics-table.module.css +10 -15
  109. package/src/components/metrics-table-title/metrics-table-title.jsx +1 -1
  110. package/src/components/metrics-table-title/metrics-table-title.module.css +3 -1
  111. package/src/components/run-info/run-info.stories.tsx +7 -0
  112. package/src/components/run-info/run-info.tsx +14 -2
  113. package/src/components/sort-button/index.ts +1 -0
  114. package/src/components/sort-button/sort-button.module.css +89 -0
  115. package/src/components/sort-button/sort-button.tsx +108 -0
  116. package/src/constants.js +5 -0
  117. package/src/hooks/rows-sort.ts +48 -0
  118. package/src/types.d.ts +4 -0
  119. package/src/ui/icon/icon.tsx +2 -0
  120. package/src/ui/index.js +0 -1
  121. package/types/components/bundle-assets/bundle-assets.d.ts +0 -1
  122. package/types/components/bundle-assets/bundle-assets.utils.d.ts +1 -1
  123. package/types/components/bundle-modules/bundle-modules.d.ts +1 -3
  124. package/types/components/bundle-modules/bundle-modules.utils.d.ts +1 -1
  125. package/types/components/bundle-packages/bundle-packages.d.ts +0 -1
  126. package/types/components/bundle-packages/bundle-packages.utils.d.ts +1 -1
  127. package/types/components/metrics-table/metrics-table.d.ts +3 -7
  128. package/types/components/run-info/run-info.d.ts +2 -1
  129. package/types/components/sort-button/index.d.ts +1 -0
  130. package/types/components/sort-button/sort-button.d.ts +11 -0
  131. package/types/constants.d.ts +4 -0
  132. package/types/hooks/rows-sort.d.ts +14 -11
  133. package/types/ui/icon/icon.d.ts +4 -0
  134. package/types/ui/index.d.ts +0 -1
  135. package/lib/components/bundle-assets/bundle-assets.constants.js +0 -21
  136. package/lib/components/bundle-assets/bundle-assets.constants.js.map +0 -1
  137. package/lib/components/bundle-modules/bundle-modules.constants.js +0 -21
  138. package/lib/components/bundle-modules/bundle-modules.constants.js.map +0 -1
  139. package/lib/components/bundle-packages/bundle-packages.constants.js +0 -21
  140. package/lib/components/bundle-packages/bundle-packages.constants.js.map +0 -1
  141. package/lib/ui/sort-dropdown/index.js.map +0 -1
  142. package/lib/ui/sort-dropdown/sort-dropdown.js +0 -101
  143. package/lib/ui/sort-dropdown/sort-dropdown.js.map +0 -1
  144. package/lib/ui/sort-dropdown/sort-dropdown.module.css +0 -22
  145. package/lib-esm/components/bundle-assets/bundle-assets.constants.js +0 -18
  146. package/lib-esm/components/bundle-assets/bundle-assets.constants.js.map +0 -1
  147. package/lib-esm/components/bundle-modules/bundle-modules.constants.js +0 -18
  148. package/lib-esm/components/bundle-modules/bundle-modules.constants.js.map +0 -1
  149. package/lib-esm/components/bundle-packages/bundle-packages.constants.js +0 -18
  150. package/lib-esm/components/bundle-packages/bundle-packages.constants.js.map +0 -1
  151. package/lib-esm/ui/sort-dropdown/index.js +0 -2
  152. package/lib-esm/ui/sort-dropdown/index.js.map +0 -1
  153. package/lib-esm/ui/sort-dropdown/sort-dropdown.js +0 -71
  154. package/lib-esm/ui/sort-dropdown/sort-dropdown.js.map +0 -1
  155. package/lib-esm/ui/sort-dropdown/sort-dropdown.module.css +0 -22
  156. package/src/components/bundle-assets/bundle-assets.constants.js +0 -18
  157. package/src/components/bundle-modules/bundle-modules.constants.js +0 -18
  158. package/src/components/bundle-packages/bundle-packages.constants.js +0 -18
  159. package/src/hooks/rows-sort.js +0 -24
  160. package/src/ui/sort-dropdown/index.js +0 -1
  161. package/src/ui/sort-dropdown/sort-dropdown.jsx +0 -121
  162. package/src/ui/sort-dropdown/sort-dropdown.module.css +0 -22
  163. package/types/components/bundle-assets/bundle-assets.constants.d.ts +0 -21
  164. package/types/components/bundle-modules/bundle-modules.constants.d.ts +0 -21
  165. package/types/components/bundle-packages/bundle-packages.constants.d.ts +0 -21
  166. package/types/ui/sort-dropdown/index.d.ts +0 -1
  167. package/types/ui/sort-dropdown/sort-dropdown.d.ts +0 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bundle-stats/ui",
3
- "version": "4.4.2",
3
+ "version": "4.5.0-beta.1",
4
4
  "description": "UI components for BundleStats projects.",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -76,11 +76,11 @@
76
76
  "react-router-dom": "^5.0.0"
77
77
  },
78
78
  "dependencies": {
79
- "@bundle-stats/utils": "^4.4.2",
79
+ "@bundle-stats/utils": "^4.5.0-beta.1",
80
80
  "ariakit": "2.0.0-next.44",
81
81
  "modern-css-reset": "1.4.0",
82
82
  "query-string": "7.1.3",
83
83
  "use-query-params": "2.2.1"
84
84
  },
85
- "gitHead": "0c227cc1fbf945e5e710f27ad77c70e7c3507bca"
85
+ "gitHead": "69b774bd837c26a5e9f170fa740a7b9ff25e61f9"
86
86
  }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-down"><path d="m6 9 6 6 6-6"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-up"><path d="m18 15-6-6-6 6"/></svg>
@@ -1,20 +1,26 @@
1
1
  <svg width="0" height="0" style="position:absolute">
2
- <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down" id="arrow" xmlns="http://www.w3.org/2000/svg">
2
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="arrow" xmlns="http://www.w3.org/2000/svg">
3
3
  <path d="M12 5v14M19 12l-7 7-7-7"/>
4
4
  </symbol>
5
- <symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right-circle" viewBox="0 0 24 24" id="arrow-right-circle" xmlns="http://www.w3.org/2000/svg">
5
+ <symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="arrow-right-circle" xmlns="http://www.w3.org/2000/svg">
6
6
  <circle cx="12" cy="12" r="10"/>
7
7
  <path d="M12 16l4-4-4-4M8 12h8"/>
8
8
  </symbol>
9
- <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock" id="clock" xmlns="http://www.w3.org/2000/svg">
9
+ <symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="chevron-down" xmlns="http://www.w3.org/2000/svg">
10
+ <path d="M6 9l6 6 6-6"/>
11
+ </symbol>
12
+ <symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="chevron-up" xmlns="http://www.w3.org/2000/svg">
13
+ <path d="M18 15l-6-6-6 6"/>
14
+ </symbol>
15
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="clock" xmlns="http://www.w3.org/2000/svg">
10
16
  <circle cx="12" cy="12" r="10"/>
11
17
  <path d="M12 6v6l4 2"/>
12
18
  </symbol>
13
- <symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x-circle" viewBox="0 0 24 24" id="close" xmlns="http://www.w3.org/2000/svg">
19
+ <symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="close" xmlns="http://www.w3.org/2000/svg">
14
20
  <circle cx="12" cy="12" r="10"/>
15
21
  <path d="M15 9l-6 6M9 9l6 6"/>
16
22
  </symbol>
17
- <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit" id="commit" xmlns="http://www.w3.org/2000/svg">
23
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="commit" xmlns="http://www.w3.org/2000/svg">
18
24
  <circle cx="12" cy="12" r="4"/>
19
25
  <path d="M1.05 12H7M17.01 12h5.95"/>
20
26
  </symbol>
@@ -22,16 +28,16 @@
22
28
  <circle cx="12" cy="12" r="10"/>
23
29
  <path d="M12 8v4M12 16h.01"/>
24
30
  </symbol>
25
- <symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link" viewBox="0 0 24 24" id="external-link" xmlns="http://www.w3.org/2000/svg">
31
+ <symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="external-link" xmlns="http://www.w3.org/2000/svg">
26
32
  <path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6M15 3h6v6M10 14L21 3"/>
27
33
  </symbol>
28
- <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bar-chart" id="filter" xmlns="http://www.w3.org/2000/svg">
34
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="filter" xmlns="http://www.w3.org/2000/svg">
29
35
  <path d="M12 20V10M18 20V4M6 20v-4"/>
30
36
  </symbol>
31
37
  <symbol viewBox="0 0 98 96" id="github" xmlns="http://www.w3.org/2000/svg">
32
38
  <path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0112.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="currentColor"/>
33
39
  </symbol>
34
- <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-help-circle" id="help" xmlns="http://www.w3.org/2000/svg">
40
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="help" xmlns="http://www.w3.org/2000/svg">
35
41
  <circle cx="12" cy="12" r="10"/>
36
42
  <path d="M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3M12 17h.01"/>
37
43
  </symbol>
@@ -39,7 +45,7 @@
39
45
  <circle cx="12" cy="12" r="10"/>
40
46
  <path d="M12 16v-4M12 8h.01"/>
41
47
  </symbol>
42
- <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu" id="menu" xmlns="http://www.w3.org/2000/svg">
48
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="menu" xmlns="http://www.w3.org/2000/svg">
43
49
  <path d="M3 12h18M3 6h18M3 18h18"/>
44
50
  </symbol>
45
51
  <symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="more-vertical" xmlns="http://www.w3.org/2000/svg">
@@ -51,7 +57,7 @@
51
57
  <path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"/>
52
58
  <path d="M0 0h24v24H0z" fill="none"/>
53
59
  </symbol>
54
- <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-alert-triangle" id="warning" xmlns="http://www.w3.org/2000/svg">
60
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="warning" xmlns="http://www.w3.org/2000/svg">
55
61
  <path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0zM12 9v4M12 17h.01"/>
56
62
  </symbol>
57
63
  </svg>
@@ -9,7 +9,6 @@ export const SvgIcons = (props) => (
9
9
  stroke-width="2"
10
10
  stroke-linecap="round"
11
11
  stroke-linejoin="round"
12
- class="feather feather-arrow-down"
13
12
  id="arrow"
14
13
  xmlns="http://www.w3.org/2000/svg"
15
14
  >
@@ -21,7 +20,6 @@ export const SvgIcons = (props) => (
21
20
  stroke-width="2"
22
21
  stroke-linecap="round"
23
22
  stroke-linejoin="round"
24
- class="feather feather-arrow-right-circle"
25
23
  viewBox="0 0 24 24"
26
24
  id="arrow-right-circle"
27
25
  xmlns="http://www.w3.org/2000/svg"
@@ -29,6 +27,30 @@ export const SvgIcons = (props) => (
29
27
  <circle cx="12" cy="12" r="10" />
30
28
  <path d="M12 16l4-4-4-4M8 12h8" />
31
29
  </symbol>
30
+ <symbol
31
+ fill="none"
32
+ stroke="currentColor"
33
+ stroke-width="2"
34
+ stroke-linecap="round"
35
+ stroke-linejoin="round"
36
+ viewBox="0 0 24 24"
37
+ id="chevron-down"
38
+ xmlns="http://www.w3.org/2000/svg"
39
+ >
40
+ <path d="M6 9l6 6 6-6" />
41
+ </symbol>
42
+ <symbol
43
+ fill="none"
44
+ stroke="currentColor"
45
+ stroke-width="2"
46
+ stroke-linecap="round"
47
+ stroke-linejoin="round"
48
+ viewBox="0 0 24 24"
49
+ id="chevron-up"
50
+ xmlns="http://www.w3.org/2000/svg"
51
+ >
52
+ <path d="M18 15l-6-6-6 6" />
53
+ </symbol>
32
54
  <symbol
33
55
  viewBox="0 0 24 24"
34
56
  fill="none"
@@ -36,7 +58,6 @@ export const SvgIcons = (props) => (
36
58
  stroke-width="2"
37
59
  stroke-linecap="round"
38
60
  stroke-linejoin="round"
39
- class="feather feather-clock"
40
61
  id="clock"
41
62
  xmlns="http://www.w3.org/2000/svg"
42
63
  >
@@ -49,7 +70,6 @@ export const SvgIcons = (props) => (
49
70
  stroke-width="2"
50
71
  stroke-linecap="round"
51
72
  stroke-linejoin="round"
52
- class="feather feather-x-circle"
53
73
  viewBox="0 0 24 24"
54
74
  id="close"
55
75
  xmlns="http://www.w3.org/2000/svg"
@@ -64,7 +84,6 @@ export const SvgIcons = (props) => (
64
84
  stroke-width="2"
65
85
  stroke-linecap="round"
66
86
  stroke-linejoin="round"
67
- class="feather feather-git-commit"
68
87
  id="commit"
69
88
  xmlns="http://www.w3.org/2000/svg"
70
89
  >
@@ -90,7 +109,6 @@ export const SvgIcons = (props) => (
90
109
  stroke-width="2"
91
110
  stroke-linecap="round"
92
111
  stroke-linejoin="round"
93
- class="feather feather-external-link"
94
112
  viewBox="0 0 24 24"
95
113
  id="external-link"
96
114
  xmlns="http://www.w3.org/2000/svg"
@@ -104,7 +122,6 @@ export const SvgIcons = (props) => (
104
122
  stroke-width="2"
105
123
  stroke-linecap="round"
106
124
  stroke-linejoin="round"
107
- class="feather feather-bar-chart"
108
125
  id="filter"
109
126
  xmlns="http://www.w3.org/2000/svg"
110
127
  >
@@ -125,7 +142,6 @@ export const SvgIcons = (props) => (
125
142
  stroke-width="2"
126
143
  stroke-linecap="round"
127
144
  stroke-linejoin="round"
128
- class="feather feather-help-circle"
129
145
  id="help"
130
146
  xmlns="http://www.w3.org/2000/svg"
131
147
  >
@@ -152,7 +168,6 @@ export const SvgIcons = (props) => (
152
168
  stroke-width="2"
153
169
  stroke-linecap="round"
154
170
  stroke-linejoin="round"
155
- class="feather feather-menu"
156
171
  id="menu"
157
172
  xmlns="http://www.w3.org/2000/svg"
158
173
  >
@@ -183,7 +198,6 @@ export const SvgIcons = (props) => (
183
198
  stroke-width="2"
184
199
  stroke-linecap="round"
185
200
  stroke-linejoin="round"
186
- class="feather feather-alert-triangle"
187
201
  id="warning"
188
202
  xmlns="http://www.w3.org/2000/svg"
189
203
  >
@@ -19,7 +19,6 @@ import { FileName } from '../../ui/file-name';
19
19
  import { HoverCard } from '../../ui/hover-card';
20
20
  import { Tag } from '../../ui/tag';
21
21
  import { Filters } from '../../ui/filters';
22
- import { SortDropdown } from '../../ui/sort-dropdown';
23
22
  import { EmptySet } from '../../ui/empty-set';
24
23
  import { Toolbar } from '../../ui/toolbar';
25
24
  import { AssetInfo } from '../asset-info';
@@ -170,7 +169,6 @@ export const BundleAssets = (props) => {
170
169
  filters,
171
170
  entryId,
172
171
  hasActiveFilters,
173
- sortFields,
174
172
  sort,
175
173
  updateSort,
176
174
  search,
@@ -221,7 +219,6 @@ export const BundleAssets = (props) => {
221
219
  className={css.toolbar}
222
220
  renderActions={({ actionClassName }) => (
223
221
  <FlexStack space="xxsmall" className={cx(css.dropdown, actionClassName)}>
224
- <SortDropdown fields={sortFields} {...sort} onChange={updateSort} />
225
222
  <MetricsTableOptions
226
223
  handleViewAll={resetAllFilters}
227
224
  handleResetFilters={resetFilters}
@@ -252,6 +249,8 @@ export const BundleAssets = (props) => {
252
249
  emptyMessage={emptyMessage}
253
250
  showHeaderSum
254
251
  title={metricsTableTitle}
252
+ sort={sort}
253
+ updateSort={updateSort}
255
254
  />
256
255
  </main>
257
256
  </section>
@@ -313,12 +312,6 @@ BundleAssets.propTypes = {
313
312
  }).isRequired,
314
313
  entryId: PropTypes.string,
315
314
  hasActiveFilters: PropTypes.bool,
316
- sortFields: PropTypes.shape({
317
- [PropTypes.string]: PropTypes.shape({
318
- label: PropTypes.string,
319
- defaultDirection: PropTypes.bool,
320
- }),
321
- }).isRequired,
322
315
  search: PropTypes.string.isRequired,
323
316
  updateSearch: PropTypes.func.isRequired,
324
317
  sort: PropTypes.shape({
@@ -1,7 +1,5 @@
1
1
  import { ASSET_ENTRY_TYPE, ASSET_FILE_TYPE, ASSET_FILTERS, getFileType } from '@bundle-stats/utils';
2
2
 
3
- import { SORT_BY_NAME, SORT_BY_DELTA, SORT_BY_SIZE } from './bundle-assets.constants';
4
-
5
3
  export const addRowAssetFlags = (row) => {
6
4
  const { runs } = row;
7
5
 
@@ -72,25 +70,11 @@ export const getRowFilter = (filters) => (item) => {
72
70
  return true;
73
71
  };
74
72
 
75
- export const getCustomSort = (sortId) => (item) => {
76
- if (sortId === SORT_BY_NAME) {
77
- return item.key;
78
- }
79
-
80
- if (sortId === SORT_BY_DELTA) {
81
- return item?.runs?.[0]?.delta ? Math.abs(item.runs[0].delta) : 0;
82
- }
83
-
84
- if (sortId === SORT_BY_SIZE) {
85
- return item?.runs?.[0]?.value || 0;
86
- }
87
-
88
- return [
89
- !item.isNotPredictive,
90
- !item.changed,
91
- !item.isInitial,
92
- !item.isEntry,
93
- !item.isChunk,
94
- item.key,
95
- ];
96
- };
73
+ export const getCustomSort = (item) => [
74
+ !item.isNotPredictive,
75
+ !item.changed,
76
+ !item.isInitial,
77
+ !item.isEntry,
78
+ !item.isChunk,
79
+ item.key,
80
+ ];
@@ -12,7 +12,6 @@ import { useRowsSort } from '../../hooks/rows-sort';
12
12
  import { useSearchParams } from '../../hooks/search-params';
13
13
  import { BundleAssets as BundleAssetsComponent } from './bundle-assets';
14
14
  import { addRowAssetFlags, addRowIsNotPredictive, getRowFilter, getCustomSort } from './bundle-assets.utils';
15
- import { SORT_BY } from './bundle-assets.constants';
16
15
 
17
16
  export const BundleAssets = (props) => {
18
17
  const { jobs, filters, search, setState, sortBy, direction, ...restProps } = props;
@@ -55,7 +54,6 @@ export const BundleAssets = (props) => {
55
54
 
56
55
  const sortParams = useRowsSort({
57
56
  rows: filteredRows,
58
- sortFields: SORT_BY,
59
57
  sortBy,
60
58
  sortDirection: direction,
61
59
  getCustomSort,
@@ -21,7 +21,6 @@ import { FlexStack } from '../../layout/flex-stack';
21
21
  import { EmptySet } from '../../ui/empty-set';
22
22
  import { FileName } from '../../ui/file-name';
23
23
  import { Filters } from '../../ui/filters';
24
- import { SortDropdown } from '../../ui/sort-dropdown';
25
24
  import { Tag } from '../../ui/tag';
26
25
  import { Toolbar } from '../../ui/toolbar';
27
26
  import { MetricsTable } from '../metrics-table';
@@ -125,7 +124,6 @@ export const BundleModules = ({
125
124
  resetAllFilters,
126
125
  filters,
127
126
  entryId,
128
- sortFields,
129
127
  sort,
130
128
  updateSort,
131
129
  search,
@@ -179,12 +177,6 @@ export const BundleModules = ({
179
177
  className={css.toolbar}
180
178
  renderActions={({ actionClassName }) => (
181
179
  <FlexStack space="xxsmall" className={cx(css.dropdown, actionClassName)}>
182
- <SortDropdown
183
- className={css.tableDropdown}
184
- fields={sortFields}
185
- onChange={updateSort}
186
- {...sort}
187
- />
188
180
  <MetricsTableOptions
189
181
  handleViewAll={resetAllFilters}
190
182
  handleResetFilters={resetFilters}
@@ -216,6 +208,8 @@ export const BundleModules = ({
216
208
  emptyMessage={emptyMessage}
217
209
  showHeaderSum
218
210
  title={metricsTableTitle}
211
+ sort={sort}
212
+ updateSort={updateSort}
219
213
  />
220
214
  </div>
221
215
  {entryId && (
@@ -277,12 +271,6 @@ BundleModules.propTypes = {
277
271
 
278
272
  hasActiveFilters: PropTypes.bool,
279
273
 
280
- sortFields: PropTypes.shape({
281
- [PropTypes.string]: PropTypes.shape({
282
- label: PropTypes.string,
283
- defaultDirection: PropTypes.bool,
284
- }),
285
- }).isRequired,
286
274
  sort: PropTypes.shape({
287
275
  sortBy: PropTypes.string,
288
276
  direction: PropTypes.string,
@@ -11,8 +11,6 @@ import {
11
11
  getModuleSourceFileType,
12
12
  } from '@bundle-stats/utils';
13
13
 
14
- import { SORT_BY_NAME, SORT_BY_SIZE, SORT_BY_DELTA } from './bundle-modules.constants';
15
-
16
14
  export const addRowFlags = (row) => {
17
15
  const { key, runs } = row;
18
16
 
@@ -28,21 +26,7 @@ export const addRowFlags = (row) => {
28
26
  return row;
29
27
  };
30
28
 
31
- export const getCustomSort = (sortBy) => (item) => {
32
- if (sortBy === SORT_BY_NAME) {
33
- return item.key;
34
- }
35
-
36
- if (sortBy === SORT_BY_SIZE) {
37
- return item?.runs?.[0]?.value || 0;
38
- }
39
-
40
- if (sortBy === SORT_BY_DELTA) {
41
- return item?.runs?.[0]?.delta ? Math.abs(item.runs[0].delta) : 0;
42
- }
43
-
44
- return [!item.changed, item.key];
45
- };
29
+ export const getCustomSort = (item) => [!item.changed, item.key];
46
30
 
47
31
  export const getRowFilter = (filters) => (row) => {
48
32
  // Skip not changed rows
@@ -19,7 +19,6 @@ import {
19
19
  getCustomSort,
20
20
  useModuleFilterByChunk,
21
21
  } from './bundle-modules.utils';
22
- import { SORT_BY } from './bundle-modules.constants';
23
22
 
24
23
  export const BundleModules = (props) => {
25
24
  const { jobs, filters, search, setState, sortBy, direction, ...restProps } = props;
@@ -88,9 +87,8 @@ export const BundleModules = (props) => {
88
87
 
89
88
  const sortParams = useRowsSort({
90
89
  rows: filteredRows,
91
- sortFields: SORT_BY,
92
- sortBy,
93
- sortDirection: direction,
90
+ fieldPath: sortBy,
91
+ direction,
94
92
  getCustomSort,
95
93
  });
96
94
 
@@ -8,7 +8,6 @@ import I18N from '../../i18n';
8
8
  import { FlexStack } from '../../layout/flex-stack';
9
9
  import { EmptySet } from '../../ui/empty-set';
10
10
  import { Filters } from '../../ui/filters';
11
- import { SortDropdown } from '../../ui/sort-dropdown';
12
11
  import { Tag } from '../../ui/tag';
13
12
  import { Toolbar } from '../../ui/toolbar';
14
13
  import { ComponentLink } from '../component-link';
@@ -117,7 +116,6 @@ export const BundlePackages = (props) => {
117
116
  resetAllFilters,
118
117
  totalRowCount,
119
118
  filters,
120
- sortFields,
121
119
  sort,
122
120
  updateSort,
123
121
  search,
@@ -178,7 +176,6 @@ export const BundlePackages = (props) => {
178
176
  className={css.toolbar}
179
177
  renderActions={({ actionClassName }) => (
180
178
  <FlexStack space="xxsmall" className={cx(css.dropdown, actionClassName)}>
181
- <SortDropdown fields={sortFields} {...sort} onChange={updateSort} />
182
179
  <MetricsTableOptions
183
180
  handleViewAll={resetAllFilters}
184
181
  handleResetFilters={resetFilters}
@@ -209,6 +206,8 @@ export const BundlePackages = (props) => {
209
206
  renderRowHeader={renderRowHeader}
210
207
  showHeaderSum
211
208
  title={metricsTableTitle}
209
+ sort={sort}
210
+ updateSort={updateSort}
212
211
  />
213
212
  </main>
214
213
  </section>
@@ -259,12 +258,6 @@ BundlePackages.propTypes = {
259
258
  changed: PropTypes.bool,
260
259
  }).isRequired,
261
260
  hasActiveFilters: PropTypes.bool,
262
- sortFields: PropTypes.shape({
263
- [PropTypes.string]: PropTypes.shape({
264
- label: PropTypes.string,
265
- defaultDirection: PropTypes.bool,
266
- }),
267
- }).isRequired,
268
261
  sort: PropTypes.shape({
269
262
  sortBy: PropTypes.string,
270
263
  direction: PropTypes.string,
@@ -1,8 +1,6 @@
1
1
  import uniq from 'lodash/uniq';
2
2
  import { PACKAGE_FILTERS } from '@bundle-stats/utils';
3
3
 
4
- import { SORT_BY_NAME, SORT_BY_DELTA, SORT_BY_SIZE } from './bundle-packages.constants';
5
-
6
4
  // Get a list of duplicate packages across jobs
7
5
  export const getDuplicatePackages = (jobs) => {
8
6
  const jobsDuplicatePackages = jobs.map((job) => {
@@ -25,21 +23,7 @@ export const getRowFilter = (filters) => (item) => {
25
23
  return true;
26
24
  };
27
25
 
28
- export const getCustomSort = (sortId) => (item) => {
29
- if (sortId === SORT_BY_NAME) {
30
- return item.key;
31
- }
32
-
33
- if (sortId === SORT_BY_DELTA) {
34
- return item?.runs?.[0]?.delta ? Math.abs(item.runs[0].delta) : 0;
35
- }
36
-
37
- if (sortId === SORT_BY_SIZE) {
38
- return item?.runs?.[0]?.value || 0;
39
- }
40
-
41
- return [!item.changed, item.key];
42
- };
26
+ export const getCustomSort = (item) => [!item.changed, item.key];
43
27
 
44
28
  export const getAddRowDuplicateFlag = (duplicateJobs) => (row) => ({
45
29
  ...row,
@@ -6,7 +6,6 @@ import * as webpack from '@bundle-stats/utils/lib-esm/webpack/compare';
6
6
  import { useRowsFilter } from '../../hooks/rows-filter';
7
7
  import { useRowsSort } from '../../hooks/rows-sort';
8
8
  import { useSearchParams } from '../../hooks/search-params';
9
- import { SORT_BY } from './bundle-packages.constants';
10
9
  import { BundlePackages as BundlePackagesComponent } from './bundle-packages';
11
10
  import { getDuplicatePackages, getAddRowDuplicateFlag, getRowFilter, getCustomSort } from './bundle-packages.utils';
12
11
 
@@ -50,9 +49,8 @@ export const BundlePackages = (props) => {
50
49
 
51
50
  const sortParams = useRowsSort({
52
51
  rows: filteredRows,
53
- sortFields: SORT_BY,
54
- sortBy,
55
- sortDirection: direction,
52
+ fieldPath: sortBy,
53
+ direction,
56
54
  getCustomSort,
57
55
  });
58
56
 
@@ -30,6 +30,7 @@
30
30
  /** space for close icon */
31
31
  padding-right: calc(var(--space-medium) + var(--space-xxxsmall) + var(--space-xsmall));
32
32
  border-bottom: 1px solid var(--color-outline);
33
+ background: var(--color-highlight);
33
34
  }
34
35
 
35
36
  .headerClose {
@@ -67,10 +68,6 @@
67
68
  font-size: var(--size-small);
68
69
  }
69
70
 
70
- .runs .runsCell {
71
- padding: var(--space-xxxsmall) var(--space-xxsmall);
72
- }
73
-
74
71
  .runs .runsColJob {
75
72
  white-space: nowrap;
76
73
  }
@@ -88,6 +85,7 @@
88
85
  }
89
86
 
90
87
  .metaLabel {
91
- margin-right: .6em;
92
- color: var(--color-text-light);
88
+ display: inline-block;
89
+ margin-right: var(--space-xxxsmall);
90
+ min-width: 5em;
93
91
  }
@@ -71,29 +71,28 @@ export const EntryInfo = (props: EntryInfoProps & React.ComponentProps<'div'>) =
71
71
  <Stack space="small">
72
72
  {tags && <div>{tags}</div>}
73
73
 
74
- <Stack space="xxxsmall">
75
- <h3 className={css.label}>
76
- <FileName as="code" name={itemTitle || item.label} className={css.fileName} />
77
- </h3>
74
+ <h3 className={css.label}>
75
+ <FileName as="code" name={itemTitle || item.label} className={css.fileName} />
76
+ </h3>
78
77
 
79
- <RunInfo
80
- current={metricRunInfo.displayValue}
81
- delta={metricRunInfo.displayDeltaPercentage}
82
- deltaType={metricRunInfo.deltaType}
83
- baseline={baselineRun?.displayValue || '0B'}
84
- size="large"
85
- />
86
- </Stack>
78
+ <RunInfo
79
+ current={metricRunInfo.displayValue}
80
+ delta={metricRunInfo.displayDeltaPercentage}
81
+ deltaPercentage={metricRunInfo.displayDelta}
82
+ deltaType={metricRunInfo.deltaType}
83
+ baseline={baselineRun?.displayValue || '0B'}
84
+ size="large"
85
+ />
87
86
  </Stack>
88
87
  <button type="button" onClick={onClose} className={css.headerClose}>
89
- <Icon glyph={Icon.ICONS.CLOSE} />
88
+ <Icon glyph={Icon.ICONS.CLOSE} size="large" />
90
89
  </button>
91
90
  </Box>
92
91
  <Box padding="small" as="main" className={css.contentWrapper}>
93
92
  <Stack space="small" className={css.content}>
94
93
  {children}
95
94
 
96
- <Table outline className={css.runs}>
95
+ <Table outline compact className={css.runs}>
97
96
  <Table.THead>
98
97
  <Table.Tr>
99
98
  <Table.Th className={cx(css.runsCell, css.runsColJob)}>&nbsp;</Table.Th>