@bundle-stats/ui 4.13.0-beta.9 → 4.13.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) 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 +44 -10
  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-totals/bundle-assets-totals.js +14 -12
  11. package/lib/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
  12. package/lib/components/bundle-modules/bundle-modules.i18n.js +1 -1
  13. package/lib/components/bundle-modules/bundle-modules.js +38 -15
  14. package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
  15. package/lib/components/bundle-modules/bundle-modules.module.css +0 -5
  16. package/lib/components/bundle-packages/bundle-packages.js +43 -9
  17. package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
  18. package/lib/components/bundle-packages/bundle-packages.module.css +0 -5
  19. package/lib/components/delta/delta.js +1 -1
  20. package/lib/components/delta/delta.js.map +1 -1
  21. package/lib/components/delta/delta.module.css +10 -1
  22. package/lib/components/jobs-header/jobs-header.module.css +0 -4
  23. package/lib/components/metrics-display-selector/metrics-display-selector.js +41 -4
  24. package/lib/components/metrics-display-selector/metrics-display-selector.js.map +1 -1
  25. package/lib/components/metrics-display-selector/metrics-display-selector.module.css +15 -7
  26. package/lib/components/metrics-treemap/index.js +4 -0
  27. package/lib/components/metrics-treemap/index.js.map +1 -1
  28. package/lib/components/metrics-treemap/metrics-treemap.constants.js +3 -0
  29. package/lib/components/metrics-treemap/metrics-treemap.constants.js.map +1 -0
  30. package/lib/components/metrics-treemap/metrics-treemap.i18n.js +6 -0
  31. package/lib/components/metrics-treemap/metrics-treemap.i18n.js.map +1 -0
  32. package/lib/components/metrics-treemap/metrics-treemap.js +100 -62
  33. package/lib/components/metrics-treemap/metrics-treemap.js.map +1 -1
  34. package/lib/components/metrics-treemap/metrics-treemap.module.css +139 -51
  35. package/lib/components/metrics-treemap/metrics-treemap.utils.js +109 -0
  36. package/lib/components/metrics-treemap/metrics-treemap.utils.js.map +1 -0
  37. package/lib/components/module-info/module-info.js +1 -2
  38. package/lib/components/module-info/module-info.js.map +1 -1
  39. package/lib/components/run-info/run-info.module.css +7 -7
  40. package/lib/css/variables.css +14 -13
  41. package/lib/hooks/metrics-display-type.js +45 -24
  42. package/lib/hooks/metrics-display-type.js.map +1 -1
  43. package/lib/hooks/search-params.js +1 -0
  44. package/lib/hooks/search-params.js.map +1 -1
  45. package/lib/layout/box/box.module.css +4 -2
  46. package/lib/layout/flex-stack/flex-stack.js +3 -4
  47. package/lib/layout/flex-stack/flex-stack.js.map +1 -1
  48. package/lib/layout/flex-stack/flex-stack.module.css +19 -23
  49. package/lib/ui/button/button.js +5 -4
  50. package/lib/ui/button/button.js.map +1 -1
  51. package/lib/ui/button/button.module.css +55 -53
  52. package/lib/ui/dropdown/dropdown.js +2 -2
  53. package/lib/ui/dropdown/dropdown.js.map +1 -1
  54. package/lib/ui/filters/filters.js +2 -2
  55. package/lib/ui/filters/filters.js.map +1 -1
  56. package/lib/ui/filters/filters.module.css +8 -1
  57. package/lib/ui/hover-card/hover-card.js +1 -1
  58. package/lib/ui/hover-card/hover-card.js.map +1 -1
  59. package/lib/ui/icon/icon.js +2 -1
  60. package/lib/ui/icon/icon.js.map +1 -1
  61. package/lib/ui/input-search/input-search.js +1 -1
  62. package/lib/ui/input-search/input-search.js.map +1 -1
  63. package/lib/ui/loader/loader.js +1 -1
  64. package/lib/ui/loader/loader.js.map +1 -1
  65. package/lib/ui/table/table.module.css +30 -0
  66. package/lib/ui/tag/tag.module.css +3 -3
  67. package/lib/ui/toolbar/toolbar.module.css +1 -3
  68. package/lib-esm/app/app.js +4 -8
  69. package/lib-esm/app/app.js.map +1 -1
  70. package/lib-esm/app/app.module.css +2 -2
  71. package/lib-esm/assets/icons.svg +70 -67
  72. package/lib-esm/assets/icons.svg.js +14 -12
  73. package/lib-esm/assets/icons.svg.js.map +1 -1
  74. package/lib-esm/components/bundle-assets/bundle-assets.js +45 -11
  75. package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
  76. package/lib-esm/components/bundle-assets/bundle-assets.module.css +0 -5
  77. package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js +15 -13
  78. package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
  79. package/lib-esm/components/bundle-modules/bundle-modules.i18n.js +1 -1
  80. package/lib-esm/components/bundle-modules/bundle-modules.js +39 -16
  81. package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
  82. package/lib-esm/components/bundle-modules/bundle-modules.module.css +0 -5
  83. package/lib-esm/components/bundle-packages/bundle-packages.js +44 -10
  84. package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
  85. package/lib-esm/components/bundle-packages/bundle-packages.module.css +0 -5
  86. package/lib-esm/components/delta/delta.js +1 -1
  87. package/lib-esm/components/delta/delta.js.map +1 -1
  88. package/lib-esm/components/delta/delta.module.css +10 -1
  89. package/lib-esm/components/jobs-header/jobs-header.module.css +0 -4
  90. package/lib-esm/components/metrics-display-selector/metrics-display-selector.js +41 -4
  91. package/lib-esm/components/metrics-display-selector/metrics-display-selector.js.map +1 -1
  92. package/lib-esm/components/metrics-display-selector/metrics-display-selector.module.css +15 -7
  93. package/lib-esm/components/metrics-treemap/index.js +1 -0
  94. package/lib-esm/components/metrics-treemap/index.js.map +1 -1
  95. package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js +2 -0
  96. package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js.map +1 -0
  97. package/lib-esm/components/metrics-treemap/metrics-treemap.i18n.js +3 -0
  98. package/lib-esm/components/metrics-treemap/metrics-treemap.i18n.js.map +1 -0
  99. package/lib-esm/components/metrics-treemap/metrics-treemap.js +102 -63
  100. package/lib-esm/components/metrics-treemap/metrics-treemap.js.map +1 -1
  101. package/lib-esm/components/metrics-treemap/metrics-treemap.module.css +139 -51
  102. package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js +105 -0
  103. package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js.map +1 -0
  104. package/lib-esm/components/module-info/module-info.js +1 -2
  105. package/lib-esm/components/module-info/module-info.js.map +1 -1
  106. package/lib-esm/components/run-info/run-info.module.css +7 -7
  107. package/lib-esm/css/variables.css +14 -13
  108. package/lib-esm/hooks/metrics-display-type.js +46 -24
  109. package/lib-esm/hooks/metrics-display-type.js.map +1 -1
  110. package/lib-esm/hooks/search-params.js +1 -0
  111. package/lib-esm/hooks/search-params.js.map +1 -1
  112. package/lib-esm/layout/box/box.module.css +4 -2
  113. package/lib-esm/layout/flex-stack/flex-stack.js +3 -4
  114. package/lib-esm/layout/flex-stack/flex-stack.js.map +1 -1
  115. package/lib-esm/layout/flex-stack/flex-stack.module.css +19 -23
  116. package/lib-esm/ui/button/button.js +5 -4
  117. package/lib-esm/ui/button/button.js.map +1 -1
  118. package/lib-esm/ui/button/button.module.css +55 -53
  119. package/lib-esm/ui/dropdown/dropdown.js +2 -2
  120. package/lib-esm/ui/dropdown/dropdown.js.map +1 -1
  121. package/lib-esm/ui/filters/filters.js +2 -2
  122. package/lib-esm/ui/filters/filters.js.map +1 -1
  123. package/lib-esm/ui/filters/filters.module.css +8 -1
  124. package/lib-esm/ui/hover-card/hover-card.js +1 -1
  125. package/lib-esm/ui/hover-card/hover-card.js.map +1 -1
  126. package/lib-esm/ui/icon/icon.js +2 -1
  127. package/lib-esm/ui/icon/icon.js.map +1 -1
  128. package/lib-esm/ui/input-search/input-search.js +1 -1
  129. package/lib-esm/ui/input-search/input-search.js.map +1 -1
  130. package/lib-esm/ui/loader/loader.js +1 -1
  131. package/lib-esm/ui/loader/loader.js.map +1 -1
  132. package/lib-esm/ui/table/table.module.css +30 -0
  133. package/lib-esm/ui/tag/tag.module.css +3 -3
  134. package/lib-esm/ui/toolbar/toolbar.module.css +1 -3
  135. package/package.json +9 -9
  136. package/src/app/app.jsx +4 -12
  137. package/src/app/app.module.css +2 -2
  138. package/src/assets/icons/check.svg +4 -0
  139. package/src/assets/icons.svg +70 -67
  140. package/src/assets/icons.svg.jsx +12 -12
  141. package/src/components/bundle-assets/bundle-assets.jsx +82 -25
  142. package/src/components/bundle-assets/bundle-assets.module.css +0 -5
  143. package/src/components/bundle-assets-totals/bundle-assets-totals.jsx +53 -46
  144. package/src/components/bundle-modules/bundle-modules.i18n.ts +1 -1
  145. package/src/components/bundle-modules/bundle-modules.module.css +0 -5
  146. package/src/components/bundle-modules/bundle-modules.tsx +116 -53
  147. package/src/components/bundle-packages/bundle-packages.jsx +77 -20
  148. package/src/components/bundle-packages/bundle-packages.module.css +0 -5
  149. package/src/components/delta/delta.jsx +1 -1
  150. package/src/components/delta/delta.module.css +10 -1
  151. package/src/components/jobs-header/jobs-header.module.css +0 -4
  152. package/src/components/metrics-display-selector/metrics-display-selector.module.css +15 -7
  153. package/src/components/metrics-display-selector/metrics-display-selector.stories.tsx +33 -0
  154. package/src/components/metrics-display-selector/metrics-display-selector.tsx +83 -25
  155. package/src/components/metrics-treemap/__tests__/metrics-treemap.utils.ts +188 -0
  156. package/src/components/metrics-treemap/index.ts +1 -0
  157. package/src/components/metrics-treemap/metrics-treemap.constants.ts +52 -0
  158. package/src/components/metrics-treemap/metrics-treemap.i18n.ts +2 -0
  159. package/src/components/metrics-treemap/metrics-treemap.module.css +139 -51
  160. package/src/components/metrics-treemap/metrics-treemap.stories.tsx +44 -10
  161. package/src/components/metrics-treemap/metrics-treemap.tsx +329 -121
  162. package/src/components/metrics-treemap/metrics-treemap.utils.ts +162 -0
  163. package/src/components/module-info/module-info.tsx +1 -1
  164. package/src/components/run-info/run-info.module.css +7 -7
  165. package/src/css/variables.css +14 -13
  166. package/src/hooks/metrics-display-type.ts +79 -29
  167. package/src/hooks/search-params.js +1 -0
  168. package/src/layout/box/box.module.css +4 -2
  169. package/src/layout/flex-stack/flex-stack.module.css +19 -23
  170. package/src/layout/flex-stack/flex-stack.tsx +2 -8
  171. package/src/ui/button/button.module.css +55 -53
  172. package/src/ui/button/button.stories.tsx +16 -9
  173. package/src/ui/button/button.tsx +8 -7
  174. package/src/ui/dropdown/dropdown.tsx +2 -3
  175. package/src/ui/filters/filters.module.css +8 -1
  176. package/src/ui/filters/filters.tsx +2 -3
  177. package/src/ui/hover-card/hover-card.tsx +1 -1
  178. package/src/ui/icon/icon.tsx +2 -1
  179. package/src/ui/input-search/input-search.tsx +1 -0
  180. package/src/ui/loader/loader.jsx +1 -1
  181. package/src/ui/table/table.module.css +30 -0
  182. package/src/ui/tag/tag.module.css +3 -3
  183. package/src/ui/toolbar/toolbar.module.css +1 -3
  184. package/types/components/bundle-modules/bundle-modules.i18n.d.ts +1 -1
  185. package/types/components/delta/delta.d.ts +2 -2
  186. package/types/components/metrics-display-selector/metrics-display-selector.d.ts +3 -1
  187. package/types/components/metrics-treemap/index.d.ts +1 -0
  188. package/types/components/metrics-treemap/metrics-treemap.constants.d.ts +20 -0
  189. package/types/components/metrics-treemap/metrics-treemap.d.ts +7 -5
  190. package/types/components/metrics-treemap/metrics-treemap.i18n.d.ts +2 -0
  191. package/types/components/metrics-treemap/metrics-treemap.utils.d.ts +5 -0
  192. package/types/hooks/metrics-display-type.d.ts +8 -2
  193. package/types/ui/dropdown/dropdown.d.ts +0 -1
  194. package/types/ui/icon/icon.d.ts +4 -2
  195. package/types/ui/loader/loader.d.ts +2 -2
  196. package/lib/components/bundle-assets-totals/bundle-assets-totals.module.css +0 -7
  197. package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.module.css +0 -7
  198. package/src/components/bundle-assets-totals/bundle-assets-totals.module.css +0 -7
@@ -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
 
@@ -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,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';
@@ -0,0 +1,20 @@
1
+ import type { ReportMetricRow } from '@bundle-stats/utils';
2
+ export interface TreeTotal {
3
+ current: number;
4
+ baseline: number;
5
+ }
6
+ export interface TreeLeaf {
7
+ id: string;
8
+ label: string;
9
+ value: number;
10
+ item: ReportMetricRow;
11
+ }
12
+ export interface Tree {
13
+ id: string;
14
+ label: string;
15
+ value: number;
16
+ children: TreeNodeChildren;
17
+ total?: TreeTotal;
18
+ }
19
+ export type TreeNode = Tree | TreeLeaf;
20
+ export type TreeNodeChildren = Array<TreeNode>;
@@ -1,9 +1,11 @@
1
- import React from 'react';
2
- import type { ReportMetricRow } from '@bundle-stats/utils';
1
+ import React, { type ComponentProps, type ReactNode } from 'react';
2
+ import type { Tree } from './metrics-treemap.constants';
3
3
  interface MetricsTreemapProps {
4
- items: Array<ReportMetricRow>;
5
- emptyMessage?: React.ReactNode;
4
+ treeNodes: Tree;
5
+ emptyMessage?: ReactNode;
6
+ nested?: boolean;
6
7
  onItemClick?: (entryId: string) => void;
8
+ onGroupClick?: (entryId: string) => void;
7
9
  }
8
- export declare const MetricsTreemap: (props: MetricsTreemapProps & React.ComponentProps<'div'>) => React.JSX.Element;
10
+ export declare const MetricsTreemap: (props: MetricsTreemapProps & ComponentProps<'div'>) => React.JSX.Element;
9
11
  export {};
@@ -0,0 +1,2 @@
1
+ export declare const TILE_GROUP_LABEL = "View children entries";
2
+ export declare const TILE_LABEL = "View entry info";
@@ -0,0 +1,5 @@
1
+ import { DeltaType, type MetricRunInfoBaseline, type MetricRunInfo, type ReportMetricRow } from '@bundle-stats/utils';
2
+ import type { Tree } from './metrics-treemap.constants';
3
+ export declare function getTreemapNodes(items: Array<ReportMetricRow>): Tree;
4
+ export declare function getTreemapNodesGroupedByPath(items: Array<ReportMetricRow>): Tree;
5
+ export declare function resolveGroupDeltaType(metricRunInfo?: MetricRunInfo | MetricRunInfoBaseline): DeltaType.NO_CHANGE | DeltaType.NEGATIVE | DeltaType.POSITIVE;
@@ -1,4 +1,10 @@
1
1
  import { MetricsDisplayType } from '../constants';
2
- type UseMetricsDisplayType = [MetricsDisplayType, (value: MetricsDisplayType) => void];
3
- export declare const useMetricsDisplayType: () => UseMetricsDisplayType;
2
+ type UseMetricsDisplayType = [
3
+ {
4
+ value: MetricsDisplayType;
5
+ groupBy?: string;
6
+ },
7
+ (newDisplayType: MetricsDisplayType, newGroupBy?: string) => void
8
+ ];
9
+ export declare const useMetricsDisplayType: (groups?: Partial<Record<MetricsDisplayType, Array<string>>>) => UseMetricsDisplayType;
4
10
  export {};
@@ -5,7 +5,6 @@ interface DropdownItemProps {
5
5
  }
6
6
  export declare const DropdownItem: (props: DropdownItemProps & React.ComponentProps<typeof MenuItem>) => React.JSX.Element;
7
7
  interface DropdownProps {
8
- buttonClassName?: string;
9
8
  dropdownClassName?: string;
10
9
  label?: React.ReactNode;
11
10
  ariaLabel?: string;
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  declare const ICONS: {
3
3
  readonly ARROW: "arrow";
4
- readonly ARROW_RIGHT_CIRLCE: "arrow-right-circle";
4
+ readonly ARROW_RIGHT_CIRCLE: "arrow-right-circle";
5
5
  readonly CANCEL: "close";
6
6
  readonly CHEVRON_DOWN: "chevron-down";
7
7
  readonly CHEVRON_UP: "chevron-up";
8
+ readonly CHECK: "check";
8
9
  readonly CLOSE: "close";
9
10
  readonly CLOCK: "clock";
10
11
  readonly COMMIT: "commit";
@@ -36,10 +37,11 @@ export declare const Icon: {
36
37
  (props: IconProps & React.ComponentProps<'span'>): React.JSX.Element;
37
38
  ICONS: {
38
39
  readonly ARROW: "arrow";
39
- readonly ARROW_RIGHT_CIRLCE: "arrow-right-circle";
40
+ readonly ARROW_RIGHT_CIRCLE: "arrow-right-circle";
40
41
  readonly CANCEL: "close";
41
42
  readonly CHEVRON_DOWN: "chevron-down";
42
43
  readonly CHEVRON_UP: "chevron-up";
44
+ readonly CHECK: "check";
43
45
  readonly CLOSE: "close";
44
46
  readonly CLOCK: "clock";
45
47
  readonly COMMIT: "commit";
@@ -1,7 +1,7 @@
1
1
  export function Loader({ className, size, ...restProps }: {
2
2
  [x: string]: any;
3
- className: any;
4
- size: any;
3
+ className?: string | undefined;
4
+ size?: string | undefined;
5
5
  }): React.JSX.Element;
6
6
  export namespace Loader {
7
7
  let SIZE_SMALL: string;
@@ -1,7 +0,0 @@
1
- .title {
2
- color: var(--color-text-light);
3
- }
4
-
5
- .toolbar {
6
- border-bottom: 1px solid var(--color-outline);
7
- }
@@ -1,7 +0,0 @@
1
- .title {
2
- color: var(--color-text-light);
3
- }
4
-
5
- .toolbar {
6
- border-bottom: 1px solid var(--color-outline);
7
- }
@@ -1,7 +0,0 @@
1
- .title {
2
- color: var(--color-text-light);
3
- }
4
-
5
- .toolbar {
6
- border-bottom: 1px solid var(--color-outline);
7
- }