@bundle-stats/ui 4.13.0-beta.9 → 4.13.0-rc.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 (247) hide show
  1. package/lib/app/app.js +4 -8
  2. package/lib/app/app.js.map +1 -1
  3. package/lib/app/app.module.css +2 -2
  4. package/lib/assets/icons.svg +70 -67
  5. package/lib/assets/icons.svg.js +14 -12
  6. package/lib/assets/icons.svg.js.map +1 -1
  7. package/lib/components/bundle-assets/bundle-assets.js +61 -26
  8. package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
  9. package/lib/components/bundle-assets/bundle-assets.module.css +0 -5
  10. package/lib/components/bundle-assets/index.js +3 -1
  11. package/lib/components/bundle-assets/index.js.map +1 -1
  12. package/lib/components/bundle-assets-totals/bundle-assets-totals.js +14 -12
  13. package/lib/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
  14. package/lib/components/bundle-modules/bundle-modules.i18n.js +1 -1
  15. package/lib/components/bundle-modules/bundle-modules.js +42 -15
  16. package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
  17. package/lib/components/bundle-modules/bundle-modules.module.css +0 -5
  18. package/lib/components/bundle-modules/bundle-modules.utils.js +2 -13
  19. package/lib/components/bundle-modules/bundle-modules.utils.js.map +1 -1
  20. package/lib/components/bundle-modules/index.js +2 -1
  21. package/lib/components/bundle-modules/index.js.map +1 -1
  22. package/lib/components/bundle-packages/bundle-packages.js +48 -9
  23. package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
  24. package/lib/components/bundle-packages/bundle-packages.module.css +0 -5
  25. package/lib/components/delta/delta.js +1 -1
  26. package/lib/components/delta/delta.js.map +1 -1
  27. package/lib/components/delta/delta.module.css +10 -1
  28. package/lib/components/jobs-header/jobs-header.module.css +0 -4
  29. package/lib/components/metrics-display-selector/metrics-display-selector.js +41 -4
  30. package/lib/components/metrics-display-selector/metrics-display-selector.js.map +1 -1
  31. package/lib/components/metrics-display-selector/metrics-display-selector.module.css +15 -7
  32. package/lib/components/metrics-treemap/index.js +4 -0
  33. package/lib/components/metrics-treemap/index.js.map +1 -1
  34. package/lib/components/metrics-treemap/metrics-treemap.constants.js +10 -0
  35. package/lib/components/metrics-treemap/metrics-treemap.constants.js.map +1 -0
  36. package/lib/components/metrics-treemap/metrics-treemap.i18n.js +6 -0
  37. package/lib/components/metrics-treemap/metrics-treemap.i18n.js.map +1 -0
  38. package/lib/components/metrics-treemap/metrics-treemap.js +131 -95
  39. package/lib/components/metrics-treemap/metrics-treemap.js.map +1 -1
  40. package/lib/components/metrics-treemap/metrics-treemap.module.css +179 -54
  41. package/lib/components/metrics-treemap/metrics-treemap.utils.js +168 -0
  42. package/lib/components/metrics-treemap/metrics-treemap.utils.js.map +1 -0
  43. package/lib/components/module-info/module-info.js +1 -2
  44. package/lib/components/module-info/module-info.js.map +1 -1
  45. package/lib/components/run-info/run-info.module.css +7 -7
  46. package/lib/css/variables.css +14 -13
  47. package/lib/hooks/metrics-display-type.js +45 -24
  48. package/lib/hooks/metrics-display-type.js.map +1 -1
  49. package/lib/hooks/search-params.js +1 -0
  50. package/lib/hooks/search-params.js.map +1 -1
  51. package/lib/layout/box/box.module.css +4 -2
  52. package/lib/layout/flex-stack/flex-stack.js +3 -4
  53. package/lib/layout/flex-stack/flex-stack.js.map +1 -1
  54. package/lib/layout/flex-stack/flex-stack.module.css +19 -23
  55. package/lib/ui/button/button.js +5 -4
  56. package/lib/ui/button/button.js.map +1 -1
  57. package/lib/ui/button/button.module.css +55 -53
  58. package/lib/ui/dropdown/dropdown.js +2 -2
  59. package/lib/ui/dropdown/dropdown.js.map +1 -1
  60. package/lib/ui/filters/filters.js +2 -2
  61. package/lib/ui/filters/filters.js.map +1 -1
  62. package/lib/ui/filters/filters.module.css +8 -1
  63. package/lib/ui/hover-card/hover-card.js +1 -1
  64. package/lib/ui/hover-card/hover-card.js.map +1 -1
  65. package/lib/ui/icon/icon.js +2 -1
  66. package/lib/ui/icon/icon.js.map +1 -1
  67. package/lib/ui/input-search/input-search.js +1 -1
  68. package/lib/ui/input-search/input-search.js.map +1 -1
  69. package/lib/ui/loader/loader.js +1 -1
  70. package/lib/ui/loader/loader.js.map +1 -1
  71. package/lib/ui/table/table.module.css +30 -0
  72. package/lib/ui/tag/tag.module.css +3 -3
  73. package/lib/ui/toolbar/toolbar.module.css +1 -3
  74. package/lib/utils/colors.js +22 -0
  75. package/lib/utils/colors.js.map +1 -0
  76. package/lib/{utils.js → utils/components.js} +2 -17
  77. package/lib/utils/components.js.map +1 -0
  78. package/lib/utils/index.js +20 -0
  79. package/lib/utils/index.js.map +1 -0
  80. package/lib/utils/jobs.js +18 -0
  81. package/lib/utils/jobs.js.map +1 -0
  82. package/lib-esm/app/app.js +4 -8
  83. package/lib-esm/app/app.js.map +1 -1
  84. package/lib-esm/app/app.module.css +2 -2
  85. package/lib-esm/assets/icons.svg +70 -67
  86. package/lib-esm/assets/icons.svg.js +14 -12
  87. package/lib-esm/assets/icons.svg.js.map +1 -1
  88. package/lib-esm/components/bundle-assets/bundle-assets.js +62 -28
  89. package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
  90. package/lib-esm/components/bundle-assets/bundle-assets.module.css +0 -5
  91. package/lib-esm/components/bundle-assets/index.js +3 -1
  92. package/lib-esm/components/bundle-assets/index.js.map +1 -1
  93. package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js +15 -13
  94. package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
  95. package/lib-esm/components/bundle-modules/bundle-modules.i18n.js +1 -1
  96. package/lib-esm/components/bundle-modules/bundle-modules.js +43 -16
  97. package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
  98. package/lib-esm/components/bundle-modules/bundle-modules.module.css +0 -5
  99. package/lib-esm/components/bundle-modules/bundle-modules.utils.js +1 -11
  100. package/lib-esm/components/bundle-modules/bundle-modules.utils.js.map +1 -1
  101. package/lib-esm/components/bundle-modules/index.js +3 -2
  102. package/lib-esm/components/bundle-modules/index.js.map +1 -1
  103. package/lib-esm/components/bundle-packages/bundle-packages.js +49 -10
  104. package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
  105. package/lib-esm/components/bundle-packages/bundle-packages.module.css +0 -5
  106. package/lib-esm/components/delta/delta.js +1 -1
  107. package/lib-esm/components/delta/delta.js.map +1 -1
  108. package/lib-esm/components/delta/delta.module.css +10 -1
  109. package/lib-esm/components/jobs-header/jobs-header.module.css +0 -4
  110. package/lib-esm/components/metrics-display-selector/metrics-display-selector.js +41 -4
  111. package/lib-esm/components/metrics-display-selector/metrics-display-selector.js.map +1 -1
  112. package/lib-esm/components/metrics-display-selector/metrics-display-selector.module.css +15 -7
  113. package/lib-esm/components/metrics-treemap/index.js +1 -0
  114. package/lib-esm/components/metrics-treemap/index.js.map +1 -1
  115. package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js +7 -0
  116. package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js.map +1 -0
  117. package/lib-esm/components/metrics-treemap/metrics-treemap.i18n.js +3 -0
  118. package/lib-esm/components/metrics-treemap/metrics-treemap.i18n.js.map +1 -0
  119. package/lib-esm/components/metrics-treemap/metrics-treemap.js +134 -98
  120. package/lib-esm/components/metrics-treemap/metrics-treemap.js.map +1 -1
  121. package/lib-esm/components/metrics-treemap/metrics-treemap.module.css +179 -54
  122. package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js +162 -0
  123. package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js.map +1 -0
  124. package/lib-esm/components/module-info/module-info.js +1 -2
  125. package/lib-esm/components/module-info/module-info.js.map +1 -1
  126. package/lib-esm/components/run-info/run-info.module.css +7 -7
  127. package/lib-esm/css/variables.css +14 -13
  128. package/lib-esm/hooks/metrics-display-type.js +46 -24
  129. package/lib-esm/hooks/metrics-display-type.js.map +1 -1
  130. package/lib-esm/hooks/search-params.js +1 -0
  131. package/lib-esm/hooks/search-params.js.map +1 -1
  132. package/lib-esm/layout/box/box.module.css +4 -2
  133. package/lib-esm/layout/flex-stack/flex-stack.js +3 -4
  134. package/lib-esm/layout/flex-stack/flex-stack.js.map +1 -1
  135. package/lib-esm/layout/flex-stack/flex-stack.module.css +19 -23
  136. package/lib-esm/ui/button/button.js +5 -4
  137. package/lib-esm/ui/button/button.js.map +1 -1
  138. package/lib-esm/ui/button/button.module.css +55 -53
  139. package/lib-esm/ui/dropdown/dropdown.js +2 -2
  140. package/lib-esm/ui/dropdown/dropdown.js.map +1 -1
  141. package/lib-esm/ui/filters/filters.js +2 -2
  142. package/lib-esm/ui/filters/filters.js.map +1 -1
  143. package/lib-esm/ui/filters/filters.module.css +8 -1
  144. package/lib-esm/ui/hover-card/hover-card.js +1 -1
  145. package/lib-esm/ui/hover-card/hover-card.js.map +1 -1
  146. package/lib-esm/ui/icon/icon.js +2 -1
  147. package/lib-esm/ui/icon/icon.js.map +1 -1
  148. package/lib-esm/ui/input-search/input-search.js +1 -1
  149. package/lib-esm/ui/input-search/input-search.js.map +1 -1
  150. package/lib-esm/ui/loader/loader.js +1 -1
  151. package/lib-esm/ui/loader/loader.js.map +1 -1
  152. package/lib-esm/ui/table/table.module.css +30 -0
  153. package/lib-esm/ui/tag/tag.module.css +3 -3
  154. package/lib-esm/ui/toolbar/toolbar.module.css +1 -3
  155. package/lib-esm/utils/colors.js +15 -0
  156. package/lib-esm/utils/colors.js.map +1 -0
  157. package/lib-esm/utils/components.js +16 -0
  158. package/lib-esm/utils/components.js.map +1 -0
  159. package/lib-esm/utils/index.js +4 -0
  160. package/lib-esm/utils/index.js.map +1 -0
  161. package/lib-esm/utils/jobs.js +11 -0
  162. package/lib-esm/utils/jobs.js.map +1 -0
  163. package/package.json +9 -9
  164. package/src/app/app.jsx +4 -12
  165. package/src/app/app.module.css +2 -2
  166. package/src/assets/icons/check.svg +4 -0
  167. package/src/assets/icons.svg +70 -67
  168. package/src/assets/icons.svg.jsx +12 -12
  169. package/src/components/bundle-assets/bundle-assets.jsx +147 -66
  170. package/src/components/bundle-assets/bundle-assets.module.css +0 -5
  171. package/src/components/bundle-assets/index.jsx +4 -0
  172. package/src/components/bundle-assets-totals/bundle-assets-totals.jsx +53 -46
  173. package/src/components/bundle-modules/bundle-modules.i18n.ts +1 -1
  174. package/src/components/bundle-modules/bundle-modules.module.css +0 -5
  175. package/src/components/bundle-modules/bundle-modules.tsx +140 -56
  176. package/src/components/bundle-modules/bundle-modules.types.d.ts +2 -17
  177. package/src/components/bundle-modules/bundle-modules.utils.ts +7 -18
  178. package/src/components/bundle-modules/index.tsx +4 -3
  179. package/src/components/bundle-packages/bundle-packages.jsx +89 -20
  180. package/src/components/bundle-packages/bundle-packages.module.css +0 -5
  181. package/src/components/delta/delta.jsx +1 -1
  182. package/src/components/delta/delta.module.css +10 -1
  183. package/src/components/jobs-header/jobs-header.module.css +0 -4
  184. package/src/components/metrics-display-selector/metrics-display-selector.module.css +15 -7
  185. package/src/components/metrics-display-selector/metrics-display-selector.stories.tsx +33 -0
  186. package/src/components/metrics-display-selector/metrics-display-selector.tsx +83 -25
  187. package/src/components/metrics-treemap/__tests__/metrics-treemap.utils.ts +188 -0
  188. package/src/components/metrics-treemap/index.ts +1 -0
  189. package/src/components/metrics-treemap/metrics-treemap.constants.ts +63 -0
  190. package/src/components/metrics-treemap/metrics-treemap.i18n.ts +2 -0
  191. package/src/components/metrics-treemap/metrics-treemap.module.css +179 -54
  192. package/src/components/metrics-treemap/metrics-treemap.stories.tsx +44 -10
  193. package/src/components/metrics-treemap/metrics-treemap.tsx +453 -184
  194. package/src/components/metrics-treemap/metrics-treemap.utils.ts +268 -0
  195. package/src/components/module-info/module-info.tsx +1 -1
  196. package/src/components/run-info/run-info.module.css +7 -7
  197. package/src/css/variables.css +14 -13
  198. package/src/hooks/metrics-display-type.ts +79 -29
  199. package/src/hooks/search-params.js +1 -0
  200. package/src/layout/box/box.module.css +4 -2
  201. package/src/layout/flex-stack/flex-stack.module.css +19 -23
  202. package/src/layout/flex-stack/flex-stack.tsx +2 -8
  203. package/src/ui/button/button.module.css +55 -53
  204. package/src/ui/button/button.stories.tsx +16 -9
  205. package/src/ui/button/button.tsx +8 -7
  206. package/src/ui/dropdown/dropdown.tsx +2 -3
  207. package/src/ui/filters/filters.module.css +8 -1
  208. package/src/ui/filters/filters.tsx +2 -3
  209. package/src/ui/hover-card/hover-card.tsx +1 -1
  210. package/src/ui/icon/icon.tsx +2 -1
  211. package/src/ui/input-search/input-search.tsx +1 -0
  212. package/src/ui/loader/loader.jsx +1 -1
  213. package/src/ui/table/table.module.css +30 -0
  214. package/src/ui/tag/tag.module.css +3 -3
  215. package/src/ui/toolbar/toolbar.module.css +1 -3
  216. package/src/utils/colors.ts +19 -0
  217. package/src/utils/components.tsx +19 -0
  218. package/src/utils/index.ts +3 -0
  219. package/src/utils/jobs.ts +22 -0
  220. package/types/components/bundle-assets/bundle-assets.d.ts +1 -5
  221. package/types/components/bundle-modules/bundle-modules.d.ts +4 -2
  222. package/types/components/bundle-modules/bundle-modules.i18n.d.ts +1 -1
  223. package/types/components/bundle-modules/bundle-modules.utils.d.ts +3 -7
  224. package/types/components/bundle-modules/index.d.ts +2 -2
  225. package/types/components/delta/delta.d.ts +2 -2
  226. package/types/components/metrics-display-selector/metrics-display-selector.d.ts +3 -1
  227. package/types/components/metrics-treemap/index.d.ts +1 -0
  228. package/types/components/metrics-treemap/metrics-treemap.constants.d.ts +28 -0
  229. package/types/components/metrics-treemap/metrics-treemap.d.ts +7 -5
  230. package/types/components/metrics-treemap/metrics-treemap.i18n.d.ts +2 -0
  231. package/types/components/metrics-treemap/metrics-treemap.utils.d.ts +15 -0
  232. package/types/hooks/metrics-display-type.d.ts +8 -2
  233. package/types/ui/dropdown/dropdown.d.ts +0 -1
  234. package/types/ui/icon/icon.d.ts +4 -2
  235. package/types/ui/loader/loader.d.ts +2 -2
  236. package/types/utils/colors.d.ts +1 -0
  237. package/types/utils/components.d.ts +2 -0
  238. package/types/utils/index.d.ts +3 -0
  239. package/types/utils/jobs.d.ts +7 -0
  240. package/lib/components/bundle-assets-totals/bundle-assets-totals.module.css +0 -7
  241. package/lib/utils.js.map +0 -1
  242. package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.module.css +0 -7
  243. package/lib-esm/utils.js +0 -30
  244. package/lib-esm/utils.js.map +0 -1
  245. package/src/components/bundle-assets-totals/bundle-assets-totals.module.css +0 -7
  246. package/src/utils.jsx +0 -38
  247. package/types/utils.d.ts +0 -3
@@ -1,14 +1,21 @@
1
1
  .root {
2
+ /* use for vertical padding and to compute gap and horizontal spacing */
3
+ --button-space: 0px;
4
+ /* button border width */
5
+ --border-width: 0px;
6
+
2
7
  display: inline-flex;
3
8
  align-items: center;
4
- gap: var(--space-xxsmall);
9
+ justify-content: center;
10
+ gap: calc(max(var(--button-space), var(--space-xxsmall)) * 0.66);
5
11
  appearance: none;
6
12
  padding: 0;
7
- border: 0;
13
+ border: var(--border-width) solid transparent;
8
14
  background: none;
9
15
  transition: var(--transition-out);
10
16
  color: var(--color-text-ultra-light);
11
17
  font-family: var(--font-family);
18
+ white-space: nowrap;
12
19
  }
13
20
 
14
21
  a.root {
@@ -18,6 +25,7 @@ a.root {
18
25
  .root:hover,
19
26
  .root:active,
20
27
  .root:focus {
28
+ outline: none;
21
29
  color: var(--color-text-light);
22
30
  transition: var(--transition-in);
23
31
  }
@@ -98,7 +106,7 @@ a.root {
98
106
  * Solid Kind variation
99
107
  */
100
108
  .solid {
101
- background: var(--color-text-light);
109
+ background: var(--color-text-ultra-light);
102
110
  color: var(--color-background);
103
111
  }
104
112
 
@@ -106,7 +114,7 @@ a.root {
106
114
  .solid:active,
107
115
  .solid:focus {
108
116
  box-shadow: var(--outline-hover);
109
- background: var(--color-text);
117
+ background: var(--color-text-light);
110
118
  color: var(--color-background);
111
119
  }
112
120
 
@@ -170,11 +178,51 @@ a.root {
170
178
  background: var(--color-success-dark);
171
179
  }
172
180
 
181
+ /**
182
+ * Size variation
183
+ */
184
+ .small {
185
+ --button-space: var(--space-xxsmall);
186
+
187
+ font-size: var(--size-small);
188
+ line-height: var(--space-small);
189
+ }
190
+
191
+ .small .glyph {
192
+ width: var(--space-small);
193
+ height: var(--space-small);
194
+ }
195
+
196
+ .medium {
197
+ --button-space: var(--space-xsmall);
198
+
199
+ font-size: var(--size-medium);
200
+ line-height: calc(var(--space-small) + var(--space-xxxsmall));
201
+ }
202
+
203
+ .medium .glyph {
204
+ width: calc(var(--space-small) + var(--space-xxxsmall));
205
+ height: calc(var(--space-small) + var(--space-xxxsmall));
206
+ }
207
+
208
+ .large {
209
+ --button-space: var(--space-small);
210
+
211
+ font-size: var(--size-large);
212
+ line-height: var(--space-medium);
213
+ }
214
+
215
+ .large .glyph {
216
+ width: var(--space-medium);
217
+ height: var(--space-medium);
218
+ }
219
+
173
220
  /**
174
221
  * Outline variation
175
222
  */
176
223
  .outline {
177
- border: 1px solid var(--color-outline);
224
+ --border-width: 1px;
225
+ border-color: var(--color-outline);
178
226
  }
179
227
 
180
228
  .outline:hover,
@@ -244,58 +292,12 @@ a.root {
244
292
  border-color: var(--color-outline-success-dark);
245
293
  }
246
294
 
247
- /**
248
- * Size variation
249
- */
250
- .small {
251
- font-size: var(--size-small);
252
- gap: var(--space-xxxsmall);
253
- line-height: var(--space-small);
254
- }
255
-
256
- .small .glyph {
257
- width: calc(var(--space-xsmall) + 2px);
258
- height: calc(var(--space-xsmall) + 2px);
259
- margin: 1px; /* compensate to keep the same height when the text is not provided */
260
- }
261
-
262
- .medium {
263
- font-size: var(--size-medium);
264
- gap: var(--space-xxsmall);
265
- line-height: var(--space-small);
266
- }
267
-
268
- .large {
269
- font-size: var(--size-large);
270
- gap: var(--space-xxsmall);
271
- line-height: var(--space-small);
272
- }
273
295
 
274
296
  /**
275
297
  * Padding variation
276
298
  */
277
- .padding--small {
278
- padding: var(--space-xxsmall);
279
- }
280
-
281
- .outline--padding--small {
282
- padding: calc(var(--space-xxsmall) - 1px);
283
- }
284
-
285
- .padding--medium {
286
- padding: var(--space-xsmall);
287
- }
288
-
289
- .outline--padding--medium {
290
- padding: calc(var(--space-xsmall) - 1px);
291
- }
292
-
293
- .padding--large {
294
- padding: var(--space-small);
295
- }
296
-
297
- .outline--padding--large {
298
- padding: calc(var(--space-small) - 1px);
299
+ .padding {
300
+ padding: calc(var(--button-space) - var(--border-width));
299
301
  }
300
302
 
301
303
  /**
@@ -62,7 +62,14 @@ export const All = () => (
62
62
  <h3>With icon</h3>
63
63
  <Items>
64
64
  {Object.values(BUTTON_KIND).map((kind) => (
65
- <Button glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE} kind={kind} key={kind}>
65
+ <Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} kind={kind} key={kind}>
66
+ Action {kind}
67
+ </Button>
68
+ ))}
69
+ </Items>
70
+ <Items>
71
+ {Object.values(BUTTON_KIND).map((kind) => (
72
+ <Button rightGlyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} kind={kind} key={kind}>
66
73
  Action {kind}
67
74
  </Button>
68
75
  ))}
@@ -106,12 +113,12 @@ export const All = () => (
106
113
  <h3>With icon</h3>
107
114
  {Object.values(BUTTON_SIZE).map((size) => (
108
115
  <Items key={size}>
109
- <Button glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE} outline size={size}>
116
+ <Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} outline size={size}>
110
117
  Action default
111
118
  </Button>
112
119
  {Object.values(BUTTON_KIND).map((kind) => (
113
120
  <Button
114
- glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE}
121
+ glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE}
115
122
  outline
116
123
  kind={kind}
117
124
  size={size}
@@ -125,10 +132,10 @@ export const All = () => (
125
132
  <h3>Only icon</h3>
126
133
  {Object.values(BUTTON_SIZE).map((size) => (
127
134
  <Items key={size}>
128
- <Button glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE} outline size={size} />
135
+ <Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} outline size={size} />
129
136
  {Object.values(BUTTON_KIND).map((kind) => (
130
137
  <Button
131
- glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE}
138
+ glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE}
132
139
  outline
133
140
  kind={kind}
134
141
  size={size}
@@ -179,12 +186,12 @@ export const All = () => (
179
186
  <h3>With icon</h3>
180
187
  {Object.values(BUTTON_SIZE).map((size) => (
181
188
  <Items key={size}>
182
- <Button glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE} solid size={size}>
189
+ <Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} solid size={size}>
183
190
  Action default
184
191
  </Button>
185
192
  {Object.values(BUTTON_KIND).map((kind) => (
186
193
  <Button
187
- glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE}
194
+ glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE}
188
195
  solid
189
196
  kind={kind}
190
197
  size={size}
@@ -198,10 +205,10 @@ export const All = () => (
198
205
  <h3>Only icon</h3>
199
206
  {Object.values(BUTTON_SIZE).map((size) => (
200
207
  <Items key={size}>
201
- <Button glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE} solid size={size} />
208
+ <Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} solid size={size} />
202
209
  {Object.values(BUTTON_KIND).map((kind) => (
203
210
  <Button
204
- glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE}
211
+ glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE}
205
212
  solid
206
213
  kind={kind}
207
214
  size={size}
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+
2
3
  import cx from 'classnames';
3
4
  import { Button as ButtonBaseComponent } from 'ariakit/button';
4
5
 
@@ -50,7 +51,7 @@ const ButtonComponent = <T extends React.ElementType = 'button'>(
50
51
  radius = '',
51
52
  padding = '',
52
53
  as: Component = ButtonBaseComponent,
53
- children,
54
+ children = null,
54
55
  Icon = BaseIcon,
55
56
  glyph,
56
57
  rightGlyph,
@@ -61,10 +62,12 @@ const ButtonComponent = <T extends React.ElementType = 'button'>(
61
62
  const resolvedPadding = padding || ((outline || solid) && size);
62
63
  const resolvedRadius = radius || ((outline || solid) && size);
63
64
 
65
+ const resolvedSize = Object.values(BUTTON_SIZE).includes(size) ? size : BUTTON_SIZE.MEDIUM;
66
+
64
67
  const rootClassName = cx(
65
68
  css.root,
66
- css[size],
67
69
  kind && css[kind],
70
+ css[resolvedSize],
68
71
 
69
72
  outline && css.outline,
70
73
  outline && css[`outline--${kind}`],
@@ -72,22 +75,20 @@ const ButtonComponent = <T extends React.ElementType = 'button'>(
72
75
  solid && css.solid,
73
76
  solid && css[`solid--${kind}`],
74
77
 
75
- resolvedPadding && css[`padding--${resolvedPadding}`],
76
- resolvedPadding && outline && css[`outline--padding--${resolvedPadding}`],
78
+ resolvedPadding && css.padding,
77
79
  resolvedRadius && css[`radius--${resolvedRadius}`],
78
80
 
79
81
  active && css.active,
80
82
  active && outline && css[`active-outline-${kind}`],
81
83
 
82
- css[size],
83
84
  className,
84
85
  );
85
86
 
86
87
  return (
87
88
  <Component {...restProps} className={rootClassName}>
88
- {glyph && <Icon glyph={glyph} size={size} className={css.glyph} />}
89
+ {glyph && <Icon glyph={glyph} className={css.glyph} />}
89
90
  {children && <span className={css.content}>{children}</span>}
90
- {rightGlyph && <Icon glyph={glyph} size={size} className={css.glyph} />}
91
+ {rightGlyph && <Icon glyph={rightGlyph} className={css.glyph} />}
91
92
  </Component>
92
93
  );
93
94
  };
@@ -18,7 +18,6 @@ export const DropdownItem = (props: DropdownItemProps & React.ComponentProps<typ
18
18
  };
19
19
 
20
20
  interface DropdownProps {
21
- buttonClassName?: string;
22
21
  dropdownClassName?: string;
23
22
  label?: React.ReactNode;
24
23
  ariaLabel?: string;
@@ -28,7 +27,7 @@ interface DropdownProps {
28
27
 
29
28
  export const Dropdown = (props: DropdownProps & React.ComponentProps<'div'>) => {
30
29
  const {
31
- buttonClassName = '',
30
+ className = '',
32
31
  dropdownClassName = '',
33
32
  label = null,
34
33
  ariaLabel = '',
@@ -50,7 +49,7 @@ export const Dropdown = (props: DropdownProps & React.ComponentProps<'div'>) =>
50
49
  disabled={disabled}
51
50
  state={menuState}
52
51
  tabIndex={null}
53
- className={cx(css.button, buttonClassName)}
52
+ className={cx(css.button, className)}
54
53
  >
55
54
  {label}
56
55
  </MenuButton>
@@ -13,6 +13,7 @@
13
13
  }
14
14
 
15
15
  .filterControl {
16
+ margin: 0;
16
17
  flex: 0 0 auto;
17
18
  height: 1em;
18
19
  }
@@ -41,12 +42,14 @@
41
42
  font-size: var(--size-small);
42
43
  line-height: var(--space-small);
43
44
  color: var(--color-text-ultra-light);
45
+ transition: var(--transition-out);
44
46
  }
45
47
 
46
48
  .filterSingle:hover,
47
49
  .filterSingle:active,
48
50
  .filterSingle:focus {
49
51
  border-color: var(--color-outline-dark);
52
+ transition: var(--transition-in);
50
53
  }
51
54
 
52
55
  /** Filter group */
@@ -57,7 +60,10 @@
57
60
 
58
61
  .filterGroupItem {
59
62
  position: relative;
60
- padding-right: 10em;
63
+ }
64
+
65
+ .filterGroupItemFilter {
66
+ padding-right: 24px; /* space for only button */
61
67
  }
62
68
 
63
69
  .filterGroupOnlyButton {
@@ -76,6 +82,7 @@
76
82
  content: ' ';
77
83
  display: block;
78
84
  position: absolute;
85
+ pointer-events: none;
79
86
  top: 0;
80
87
  right: 100%;
81
88
  bottom: 0;
@@ -50,11 +50,10 @@ interface FilterGroupProps extends React.ComponentProps<'div'> {
50
50
 
51
51
  const FilterGroup = (props: FilterGroupProps) => {
52
52
  const { className = '', groupKey, data, values, onCheckboxChange, toggleFilters } = props;
53
+ const { label: groupLabel, children: groupItems } = data;
53
54
 
54
55
  const [search, setSearch] = useState('');
55
56
 
56
- const { label: groupLabel, children: groupItems } = data;
57
-
58
57
  const areAllGroupItemsChecked = groupItems
59
58
  .map(({ key: itemKey }) => values?.[`${groupKey}.${itemKey}`])
60
59
  .reduce((agg, val) => agg && val, true);
@@ -98,7 +97,7 @@ const FilterGroup = (props: FilterGroupProps) => {
98
97
 
99
98
  return (
100
99
  <Dropdown
101
- buttonClassName={className}
100
+ className={className}
102
101
  label={dropdownLabel}
103
102
  ariaLabel={`${groupLabel}: ${filterSuffix}`}
104
103
  >
@@ -31,7 +31,7 @@ export const HoverCard = (props: HoverCardProps) => {
31
31
  children,
32
32
  } = props;
33
33
 
34
- const state = useHovercardState({ gutter: 8, timeout: 300 });
34
+ const state = useHovercardState({ gutter: 8, timeout: 300, placement: 'top' });
35
35
  const hovercardProps = useHovercard({ state, portal: true });
36
36
 
37
37
  // Fallback to span if no href
@@ -5,10 +5,11 @@ import css from './icon.module.css';
5
5
 
6
6
  const ICONS = {
7
7
  ARROW: 'arrow',
8
- ARROW_RIGHT_CIRLCE: 'arrow-right-circle',
8
+ ARROW_RIGHT_CIRCLE: 'arrow-right-circle',
9
9
  CANCEL: 'close',
10
10
  CHEVRON_DOWN: 'chevron-down',
11
11
  CHEVRON_UP: 'chevron-up',
12
+ CHECK: 'check',
12
13
  CLOSE: 'close',
13
14
  CLOCK: 'clock',
14
15
  COMMIT: 'commit',
@@ -70,6 +70,7 @@ export const InputSearch = (
70
70
  />
71
71
  {value && (
72
72
  <Button
73
+ size="small"
73
74
  radius="circle"
74
75
  glyph={Icon.ICONS.CANCEL}
75
76
  type="button"
@@ -4,7 +4,7 @@ import cx from 'classnames';
4
4
 
5
5
  import css from './loader.module.css';
6
6
 
7
- export const Loader = ({ className, size, ...restProps }) => (
7
+ export const Loader = ({ className = '', size = 'medium', ...restProps }) => (
8
8
  <span className={cx(css.root, className, css[size])} {...restProps} />
9
9
  );
10
10
 
@@ -89,6 +89,36 @@
89
89
  border-width: 1px;
90
90
  }
91
91
 
92
+ /** cascade border radius */
93
+ .root thead,
94
+ .root thead tr:first-child {
95
+ border-top-left-radius: inherit;
96
+ border-top-right-radius: inherit;
97
+ }
98
+
99
+ .root thead tr:first-child th:first-child {
100
+ border-top-left-radius: inherit;
101
+ }
102
+
103
+ .root thead tr:first-child th:last-child {
104
+ border-top-right-radius: inherit;
105
+ }
106
+
107
+ .root tbody:last-child,
108
+ .root tbody:last-child tr:last-child {
109
+ border-bottom-left-radius: inherit;
110
+ border-bottom-right-radius: inherit;
111
+ }
112
+
113
+ .root tbody:last-child tr:last-child th:first-child,
114
+ .root tbody:last-child tr:last-child td:first-child {
115
+ border-bottom-left-radius: inherit;
116
+ }
117
+
118
+ .root tbody:last-child tr:last-child td:last-child {
119
+ border-bottom-right-radius: inherit;
120
+ }
121
+
92
122
  /* compact variation */
93
123
  .compact td,
94
124
  .compact th {
@@ -42,7 +42,7 @@ a.root:active {
42
42
  /** Size variation */
43
43
  /** default: medium */
44
44
  .root {
45
- border-radius: var(--radius-medium);
45
+ border-radius: var(--radius-small);
46
46
  padding: calc(var(--space-xxxsmall) / 2) var(--space-xxxsmall);
47
47
  min-width: var(--space-small);
48
48
  height: var(--space-small);
@@ -51,7 +51,7 @@ a.root:active {
51
51
  }
52
52
 
53
53
  .small {
54
- border-radius: var(--radius-small);
54
+ border-radius: var(--radius-xsmall);
55
55
  padding: calc(var(--space-xxxsmall) / 2);
56
56
  height: var(--space-xsmall);
57
57
  min-width: var(--space-xsmall);
@@ -60,7 +60,7 @@ a.root:active {
60
60
  }
61
61
 
62
62
  .large {
63
- border-radius: var(--radius-large);
63
+ border-radius: var(--radius-medium);
64
64
  padding: var(--space-xxxsmall) var(--space-xxsmall);
65
65
  min-width: var(--space-medium);
66
66
  height: var(--space-medium);
@@ -1,6 +1,4 @@
1
- .root {
2
- padding: var(--space-small);
3
- }
1
+ .root { }
4
2
 
5
3
  .content {}
6
4
 
@@ -0,0 +1,19 @@
1
+ import chunk from 'lodash/chunk';
2
+
3
+ import COLORS from '../chart-colors.json';
4
+
5
+ export function getColors(count = 2) {
6
+ const chunks = chunk(COLORS, Math.round(COLORS.length / count));
7
+
8
+ return chunks.map((chunkColors, index) => {
9
+ if (index === 0) {
10
+ return chunkColors[0];
11
+ }
12
+
13
+ if (index === chunks.length - 1) {
14
+ return chunkColors[chunkColors.length - 1];
15
+ }
16
+
17
+ return chunkColors[Math.floor(chunkColors.length / 2)];
18
+ });
19
+ }
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import cx from 'classnames';
3
+
4
+ export const getRenderChildWithClassName = (className: string) => (child: any) => {
5
+ if (child === null || child === '') {
6
+ return null;
7
+ }
8
+
9
+ const { props } = child;
10
+
11
+ if (!props) {
12
+ return <div className={className}>{child}</div>;
13
+ }
14
+
15
+ return React.cloneElement(child, {
16
+ ...props,
17
+ className: cx(className, props.className), // eslint-disable-line react/prop-types
18
+ });
19
+ };
@@ -0,0 +1,3 @@
1
+ export * from './colors';
2
+ export * from './jobs';
3
+ export * from './components';
@@ -0,0 +1,22 @@
1
+ import uniqBy from 'lodash/uniqBy';
2
+
3
+ import type { Job, WebpackChunk } from '@bundle-stats/utils';
4
+
5
+ interface GetJobsChunksData {
6
+ chunks: Array<WebpackChunk>;
7
+ chunkIds: Array<string>;
8
+ }
9
+
10
+ /**
11
+ * Get chunks data from all jobs
12
+ */
13
+ export function getJobsChunksData(jobs: Array<Job>): GetJobsChunksData {
14
+ const jobChunks = jobs.map((job) => job?.meta?.webpack?.chunks || []);
15
+ const chunks = uniqBy(jobChunks.flat(), ({ id }) => id);
16
+ const chunkIds = chunks?.map(({ id }) => id);
17
+
18
+ return {
19
+ chunks,
20
+ chunkIds,
21
+ };
22
+ }
@@ -13,12 +13,8 @@ export namespace BundleAssets {
13
13
  export let jobs: PropTypes.Validator<(PropTypes.InferProps<{
14
14
  internalBuildNumber: PropTypes.Requireable<number>;
15
15
  label: PropTypes.Requireable<string>;
16
- meta: PropTypes.Requireable<PropTypes.InferProps<{
17
- webpack: PropTypes.Requireable<PropTypes.InferProps<{
18
- chunks: PropTypes.Requireable<any[]>;
19
- }>>;
20
- }>>;
21
16
  }> | null | undefined)[]>;
17
+ export let chunks: PropTypes.Validator<any[]>;
22
18
  export let items: PropTypes.Validator<(PropTypes.InferProps<{
23
19
  key: PropTypes.Requireable<string>;
24
20
  label: PropTypes.Requireable<string>;
@@ -1,12 +1,14 @@
1
1
  import React from 'react';
2
+ import { type Job } from '@bundle-stats/utils';
3
+ import { WebpackChunk } from '@bundle-stats/utils';
2
4
  import { SortAction } from '../../types';
3
5
  import { ModuleMetric } from './bundle-modules.constants';
4
- import type { Chunk, Job, ReportMetricModuleRow } from './bundle-modules.types';
6
+ import type { ReportMetricModuleRow } from './bundle-modules.types';
5
7
  interface BundleModulesProps extends React.ComponentProps<'div'> {
6
8
  jobs?: Array<Job>;
7
9
  items?: Array<ReportMetricModuleRow>;
8
10
  allItems?: Array<ReportMetricModuleRow>;
9
- chunks?: Array<Chunk>;
11
+ chunks?: Array<WebpackChunk>;
10
12
  totalRowCount: number;
11
13
  updateFilters: () => void;
12
14
  resetFilters: () => void;
@@ -1,4 +1,4 @@
1
- export declare const SEARCH = "Search by module name";
1
+ export declare const SEARCH = "Search by module path";
2
2
  export declare const CHANGED = "Changed";
3
3
  export declare const DUPLICATE = "Duplicate";
4
4
  export declare const CHUNK = "Chunk";
@@ -1,16 +1,12 @@
1
- import type { ReportMetricRow } from '@bundle-stats/utils';
1
+ import { type WebpackChunk, type ReportMetricRow } from '@bundle-stats/utils';
2
2
  import { type Module } from '@bundle-stats/utils/lib-esm/webpack';
3
3
  import type { FilterFieldsData } from '../../types';
4
- import type { Chunk, Job, ReportMetricModuleRow } from './bundle-modules.types';
4
+ import type { ReportMetricModuleRow } from './bundle-modules.types';
5
5
  export declare const addRowFlags: (row: Module & ReportMetricRow) => ReportMetricModuleRow;
6
6
  export declare const getCustomSort: (item: ReportMetricRow) => (string | boolean)[];
7
7
  export declare const generateGetRowFilter: ({ chunkIds }: {
8
8
  chunkIds: Array<string>;
9
9
  }) => (filters: Record<string, unknown>) => (row: ReportMetricModuleRow) => boolean;
10
- export declare const extractChunkData: (jobs: Array<Job>) => {
11
- chunks: Chunk[];
12
- chunkIds: string[];
13
- };
14
10
  export declare const generateFilters: (chunkIds: Array<string>, multipleJobs: boolean) => {
15
11
  defaultFilters: {
16
12
  [x: string]: boolean;
@@ -21,7 +17,7 @@ export declare const generateFilters: (chunkIds: Array<string>, multipleJobs: bo
21
17
  };
22
18
  interface GetFiltersFormDataParams {
23
19
  filters: Record<string, boolean>;
24
- chunks: Array<Chunk>;
20
+ chunks: Array<WebpackChunk>;
25
21
  compareMode: boolean;
26
22
  }
27
23
  export declare const generateFilterFieldsData: (params: GetFiltersFormDataParams) => FilterFieldsData;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
+ import type { Job } from '@bundle-stats/utils';
2
3
  import type { SortAction } from '../../types';
3
4
  import { BundleModules as BaseComponent } from './bundle-modules';
4
- import * as types from './bundle-modules.types';
5
5
  interface BundleModulesProps extends Omit<React.ComponentProps<typeof BaseComponent>, 'jobs' | 'items' | 'chunks' | 'updateFilters' | 'resetFilters' | 'resetAllFilters' | 'filters' | 'sort' | 'updateSort' | 'search' | 'updateSearch' | 'allItems' | 'totalRowCount' | 'hideEntryInfo' | 'showEntryInfo'> {
6
- jobs: Array<types.Job>;
6
+ jobs: Array<Job>;
7
7
  filters: Record<string, boolean>;
8
8
  search?: string;
9
9
  metric?: string;
@@ -1,8 +1,8 @@
1
1
  export function Delta({ className, displayValue, deltaType, inverted }: {
2
- className: any;
2
+ className?: string | undefined;
3
3
  displayValue: any;
4
4
  deltaType: any;
5
- inverted: any;
5
+ inverted?: boolean | undefined;
6
6
  }): React.JSX.Element;
7
7
  export namespace Delta {
8
8
  namespace defaultProps {
@@ -3,7 +3,9 @@ import { MetricsDisplayType } from '../../constants';
3
3
  import { ControlGroup } from '../../ui/control-group';
4
4
  interface MetricsDisplaySelectorProps {
5
5
  value: MetricsDisplayType;
6
- onSelect: (newValue: MetricsDisplayType) => void;
6
+ groupBy?: string;
7
+ groups?: Partial<Record<MetricsDisplayType, Array<string>>>;
8
+ onSelect: (newValue: MetricsDisplayType, groupBy?: string) => void;
7
9
  }
8
10
  export declare const MetricsDisplaySelector: (props: MetricsDisplaySelectorProps & Omit<React.ComponentProps<typeof ControlGroup>, 'onSelect' | 'value'>) => React.JSX.Element;
9
11
  export {};
@@ -1 +1,2 @@
1
1
  export * from './metrics-treemap';
2
+ export { getTreemapNodes, getTreemapNodesGroupedByPath } from './metrics-treemap.utils';