@bundle-stats/ui 4.23.0-beta.1 → 4.23.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/app.module.css +1 -1
- package/lib/chart-colors.json +58 -44
- package/lib/components/entry-info/entry-info.js +1 -1
- package/lib/components/entry-info/entry-info.js.map +1 -1
- package/lib/components/entry-info/entry-info.module.css +1 -1
- package/lib/components/metric-change-legend/metric-change-legend.js +2 -2
- package/lib/components/metric-change-legend/metric-change-legend.js.map +1 -1
- package/lib/components/metric-change-legend/metric-change-legend.module.css +11 -0
- package/lib/components/metric-run-info/metric-run-info.js +1 -9
- package/lib/components/metric-run-info/metric-run-info.js.map +1 -1
- package/lib/components/metrics-table-options/metrics-table-options.js +3 -4
- package/lib/components/metrics-table-options/metrics-table-options.js.map +1 -1
- package/lib/components/metrics-treemap/metrics-treemap.constants.js +3 -1
- package/lib/components/metrics-treemap/metrics-treemap.constants.js.map +1 -1
- package/lib/components/metrics-treemap/metrics-treemap.js +68 -57
- package/lib/components/metrics-treemap/metrics-treemap.js.map +1 -1
- package/lib/components/metrics-treemap/metrics-treemap.module.css +9 -16
- package/lib/components/metrics-treemap/metrics-treemap.utils.js +72 -16
- package/lib/components/metrics-treemap/metrics-treemap.utils.js.map +1 -1
- package/lib/ui/button/button.js +2 -2
- package/lib/ui/button/button.js.map +1 -1
- package/lib/ui/dropdown/dropdown.js +11 -3
- package/lib/ui/dropdown/dropdown.js.map +1 -1
- package/lib/ui/dropdown/dropdown.module.css +40 -6
- package/lib/ui/filters/filters.js +22 -11
- package/lib/ui/filters/filters.js.map +1 -1
- package/lib/ui/filters/filters.module.css +0 -14
- package/lib/ui/hover-card/hover-card.js +7 -1
- package/lib/ui/hover-card/hover-card.js.map +1 -1
- package/lib/ui/tooltip/tooltip.js +6 -1
- package/lib/ui/tooltip/tooltip.js.map +1 -1
- package/lib-esm/app/app.module.css +1 -1
- package/lib-esm/chart-colors.json +58 -44
- package/lib-esm/components/entry-info/entry-info.js +1 -1
- package/lib-esm/components/entry-info/entry-info.js.map +1 -1
- package/lib-esm/components/entry-info/entry-info.module.css +1 -1
- package/lib-esm/components/metric-change-legend/metric-change-legend.js +2 -2
- package/lib-esm/components/metric-change-legend/metric-change-legend.js.map +1 -1
- package/lib-esm/components/metric-change-legend/metric-change-legend.module.css +11 -0
- package/lib-esm/components/metric-run-info/metric-run-info.js +2 -10
- package/lib-esm/components/metric-run-info/metric-run-info.js.map +1 -1
- package/lib-esm/components/metrics-table-options/metrics-table-options.js +4 -5
- package/lib-esm/components/metrics-table-options/metrics-table-options.js.map +1 -1
- package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js +2 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js.map +1 -1
- package/lib-esm/components/metrics-treemap/metrics-treemap.js +74 -63
- package/lib-esm/components/metrics-treemap/metrics-treemap.js.map +1 -1
- package/lib-esm/components/metrics-treemap/metrics-treemap.module.css +9 -16
- package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js +71 -17
- package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js.map +1 -1
- package/lib-esm/ui/button/button.js +2 -2
- package/lib-esm/ui/button/button.js.map +1 -1
- package/lib-esm/ui/dropdown/dropdown.js +9 -2
- package/lib-esm/ui/dropdown/dropdown.js.map +1 -1
- package/lib-esm/ui/dropdown/dropdown.module.css +40 -6
- package/lib-esm/ui/filters/filters.js +23 -12
- package/lib-esm/ui/filters/filters.js.map +1 -1
- package/lib-esm/ui/filters/filters.module.css +0 -14
- package/lib-esm/ui/hover-card/hover-card.js +7 -1
- package/lib-esm/ui/hover-card/hover-card.js.map +1 -1
- package/lib-esm/ui/tooltip/tooltip.js +6 -1
- package/lib-esm/ui/tooltip/tooltip.js.map +1 -1
- package/package.json +12 -12
- package/src/app/app.module.css +1 -1
- package/src/chart-colors.json +58 -44
- package/src/components/entry-info/entry-info.module.css +1 -1
- package/src/components/entry-info/entry-info.tsx +2 -2
- package/src/components/metric-change-legend/metric-change-legend.module.css +11 -0
- package/src/components/metric-change-legend/metric-change-legend.tsx +2 -2
- package/src/components/metric-run-info/metric-run-info.tsx +2 -11
- package/src/components/metrics-table-options/metrics-table-options.tsx +6 -7
- package/src/components/metrics-treemap/metrics-treemap.constants.ts +8 -0
- package/src/components/metrics-treemap/metrics-treemap.module.css +9 -16
- package/src/components/metrics-treemap/metrics-treemap.tsx +160 -135
- package/src/components/metrics-treemap/metrics-treemap.utils.ts +141 -27
- package/src/ui/button/button.tsx +2 -1
- package/src/ui/dropdown/dropdown.module.css +40 -6
- package/src/ui/dropdown/dropdown.tsx +13 -2
- package/src/ui/filters/filters.module.css +0 -14
- package/src/ui/filters/filters.tsx +111 -47
- package/src/ui/hover-card/hover-card.tsx +7 -1
- package/src/ui/tooltip/tooltip.tsx +6 -1
- package/types/components/metric-run-info/metric-run-info.d.ts +1 -0
- package/types/components/metrics-treemap/metrics-treemap.constants.d.ts +2 -0
- package/types/components/metrics-treemap/metrics-treemap.utils.d.ts +11 -5
- package/types/ui/dropdown/dropdown.d.ts +3 -1
- package/types/ui/filters/filters.d.ts +2 -1
- package/vitest.config.ts +4 -0
- package/lib/components/metrics-table-options/metrics-table-options.module.css +0 -15
- package/lib-esm/components/metrics-table-options/metrics-table-options.module.css +0 -15
- package/src/components/metrics-table-options/metrics-table-options.module.css +0 -15
package/src/app/app.module.css
CHANGED
package/src/chart-colors.json
CHANGED
|
@@ -1,45 +1,59 @@
|
|
|
1
1
|
[
|
|
2
|
-
"rgba(
|
|
3
|
-
"rgba(
|
|
4
|
-
"rgba(
|
|
5
|
-
"rgba(
|
|
6
|
-
"rgba(
|
|
7
|
-
"rgba(
|
|
8
|
-
"rgba(
|
|
9
|
-
"rgba(
|
|
10
|
-
"rgba(
|
|
11
|
-
"rgba(
|
|
12
|
-
"rgba(
|
|
13
|
-
"rgba(
|
|
14
|
-
"rgba(
|
|
15
|
-
"rgba(
|
|
16
|
-
"rgba(
|
|
17
|
-
"rgba(
|
|
18
|
-
"rgba(
|
|
19
|
-
"rgba(
|
|
20
|
-
"rgba(
|
|
21
|
-
"rgba(
|
|
22
|
-
"rgba(
|
|
23
|
-
"rgba(
|
|
24
|
-
"rgba(
|
|
25
|
-
"rgba(
|
|
26
|
-
"rgba(
|
|
27
|
-
"rgba(
|
|
28
|
-
"rgba(
|
|
29
|
-
"rgba(
|
|
30
|
-
"rgba(
|
|
31
|
-
"rgba(
|
|
32
|
-
"rgba(
|
|
33
|
-
"rgba(
|
|
34
|
-
"rgba(
|
|
35
|
-
"rgba(
|
|
36
|
-
"rgba(
|
|
37
|
-
"rgba(
|
|
38
|
-
"rgba(
|
|
39
|
-
"rgba(
|
|
40
|
-
"rgba(
|
|
41
|
-
"rgba(
|
|
42
|
-
"rgba(
|
|
43
|
-
"rgba(
|
|
44
|
-
"rgba(255,
|
|
45
|
-
|
|
2
|
+
"rgba(0,85,172,1)",
|
|
3
|
+
"rgba(13,85,174,1)",
|
|
4
|
+
"rgba(26,85,175,1)",
|
|
5
|
+
"rgba(39,85,177,1)",
|
|
6
|
+
"rgba(52,85,178,1)",
|
|
7
|
+
"rgba(65,84,180,1)",
|
|
8
|
+
"rgba(78,84,181,1)",
|
|
9
|
+
"rgba(91,84,183,1)",
|
|
10
|
+
"rgba(104,84,184,1)",
|
|
11
|
+
"rgba(112,83,184,1)",
|
|
12
|
+
"rgba(119,82,183,1)",
|
|
13
|
+
"rgba(127,81,183,1)",
|
|
14
|
+
"rgba(134,80,183,1)",
|
|
15
|
+
"rgba(142,79,182,1)",
|
|
16
|
+
"rgba(149,78,182,1)",
|
|
17
|
+
"rgba(157,77,181,1)",
|
|
18
|
+
"rgba(164,76,181,1)",
|
|
19
|
+
"rgba(170,75,179,1)",
|
|
20
|
+
"rgba(176,74,177,1)",
|
|
21
|
+
"rgba(182,73,174,1)",
|
|
22
|
+
"rgba(189,72,172,1)",
|
|
23
|
+
"rgba(195,71,170,1)",
|
|
24
|
+
"rgba(201,70,168,1)",
|
|
25
|
+
"rgba(207,69,165,1)",
|
|
26
|
+
"rgba(213,68,163,1)",
|
|
27
|
+
"rgba(217,68,160,1)",
|
|
28
|
+
"rgba(222,69,156,1)",
|
|
29
|
+
"rgba(226,69,153,1)",
|
|
30
|
+
"rgba(231,69,149,1)",
|
|
31
|
+
"rgba(235,69,146,1)",
|
|
32
|
+
"rgba(239,70,142,1)",
|
|
33
|
+
"rgba(244,70,139,1)",
|
|
34
|
+
"rgba(248,70,135,1)",
|
|
35
|
+
"rgba(249,73,131,1)",
|
|
36
|
+
"rgba(250,76,127,1)",
|
|
37
|
+
"rgba(251,78,122,1)",
|
|
38
|
+
"rgba(252,81,118,1)",
|
|
39
|
+
"rgba(252,84,114,1)",
|
|
40
|
+
"rgba(253,87,110,1)",
|
|
41
|
+
"rgba(254,89,105,1)",
|
|
42
|
+
"rgba(255,92,101,1)",
|
|
43
|
+
"rgba(255,96,96,1)",
|
|
44
|
+
"rgba(255,101,91,1)",
|
|
45
|
+
"rgba(255,105,86,1)",
|
|
46
|
+
"rgba(255,110,82,1)",
|
|
47
|
+
"rgba(255,114,77,1)",
|
|
48
|
+
"rgba(255,118,72,1)",
|
|
49
|
+
"rgba(255,123,67,1)",
|
|
50
|
+
"rgba(255,127,62,1)",
|
|
51
|
+
"rgba(255,132,54,1)",
|
|
52
|
+
"rgba(255,137,47,1)",
|
|
53
|
+
"rgba(255,142,39,1)",
|
|
54
|
+
"rgba(255,147,31,1)",
|
|
55
|
+
"rgba(255,151,23,1)",
|
|
56
|
+
"rgba(255,156,16,1)",
|
|
57
|
+
"rgba(255,161,8,1)",
|
|
58
|
+
"rgba(255,166,0,1)"
|
|
59
|
+
]
|
|
@@ -63,8 +63,8 @@ function defaultRenderRunInfo(item: ReportMetricRow) {
|
|
|
63
63
|
return (
|
|
64
64
|
<RunInfo
|
|
65
65
|
current={metricRunInfo.displayValue}
|
|
66
|
-
delta={metricRunInfo.
|
|
67
|
-
deltaPercentage={metricRunInfo.
|
|
66
|
+
delta={metricRunInfo.displayDelta}
|
|
67
|
+
deltaPercentage={metricRunInfo.displayDeltaPercentage}
|
|
68
68
|
deltaType={metricRunInfo.deltaType}
|
|
69
69
|
baseline={baselineRun?.displayValue || '0B'}
|
|
70
70
|
size="large"
|
|
@@ -135,8 +135,8 @@ export const MetricChangeLegend = (props: MetricChangeLegendProps) => {
|
|
|
135
135
|
anchorClassName={css.itemAnchor}
|
|
136
136
|
label={
|
|
137
137
|
<FlexStack inline alignItems="center" space="xxsmall" className={css.item}>
|
|
138
|
-
<Variants kind={id} variants={variants} />
|
|
139
|
-
<span>{label}</span>
|
|
138
|
+
<Variants kind={id} variants={variants} className={css.itemVariants} />
|
|
139
|
+
<span className={css.itemLabel}>{label}</span>
|
|
140
140
|
</FlexStack>
|
|
141
141
|
}
|
|
142
142
|
>
|
|
@@ -56,6 +56,7 @@ export type MetricRunInfoProps = {
|
|
|
56
56
|
baseline?: number;
|
|
57
57
|
showMetricDescription?: boolean;
|
|
58
58
|
titleWrapper?: ElementType;
|
|
59
|
+
showDeltaValue?: boolean;
|
|
59
60
|
} & Pick<RunInfoProps, 'showDelta' | 'showBaseline' | 'size' | 'loading'>;
|
|
60
61
|
|
|
61
62
|
export const MetricRunInfo = (props: MetricRunInfoProps & React.ComponentProps<'div'>) => {
|
|
@@ -113,20 +114,10 @@ export const MetricRunInfo = (props: MetricRunInfoProps & React.ComponentProps<'
|
|
|
113
114
|
};
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
// For file sizes, show the real data
|
|
117
|
-
if (metric.type === MetricTypes.FileSize) {
|
|
118
|
-
return {
|
|
119
|
-
showDelta: true,
|
|
120
|
-
delta: metricRunInfo.displayDelta,
|
|
121
|
-
deltaType: metricRunInfo.deltaType,
|
|
122
|
-
deltaPercentage: metricRunInfo.displayDeltaPercentage,
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
117
|
return {
|
|
127
118
|
showDelta: true,
|
|
128
|
-
delta: metricRunInfo.displayDelta,
|
|
129
119
|
deltaType: metricRunInfo.deltaType,
|
|
120
|
+
deltaPercentage: metricRunInfo.displayDeltaPercentage,
|
|
130
121
|
};
|
|
131
122
|
}, [metric, metricRunInfo, showDelta]);
|
|
132
123
|
|
|
@@ -2,8 +2,7 @@ import type { ComponentProps } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import I18N from '../../i18n';
|
|
5
|
-
import { Dropdown, DropdownItem } from '../../ui/dropdown';
|
|
6
|
-
import css from './metrics-table-options.module.css';
|
|
5
|
+
import { Dropdown, DropdownGroup, DropdownItem } from '../../ui/dropdown';
|
|
7
6
|
|
|
8
7
|
type MetricsTableOptionsProps = {
|
|
9
8
|
onViewAllClick?: () => void;
|
|
@@ -15,19 +14,19 @@ export const MetricsTableOptions = (props: MetricsTableOptionsProps) => {
|
|
|
15
14
|
const { onViewAllClick, onResetClick, onExportClick, ...restProps } = props;
|
|
16
15
|
|
|
17
16
|
return (
|
|
18
|
-
<Dropdown glyph="more-vertical" placement="bottom-end"
|
|
19
|
-
<
|
|
17
|
+
<Dropdown glyph="more-vertical" placement="bottom-end" {...restProps}>
|
|
18
|
+
<DropdownGroup>
|
|
20
19
|
{onResetClick && <DropdownItem onClick={onResetClick}>{I18N.RESET_FILTERS}</DropdownItem>}
|
|
21
20
|
{onViewAllClick && <DropdownItem onClick={onViewAllClick}>{I18N.VIEW_ALL}</DropdownItem>}
|
|
22
|
-
</
|
|
23
|
-
<
|
|
21
|
+
</DropdownGroup>
|
|
22
|
+
<DropdownGroup>
|
|
24
23
|
{onExportClick && (
|
|
25
24
|
<>
|
|
26
25
|
<DropdownItem onClick={() => onExportClick('csv')}>{I18N.EXPORT_CSV}</DropdownItem>
|
|
27
26
|
<DropdownItem onClick={() => onExportClick('json')}>{I18N.EXPORT_JSON}</DropdownItem>
|
|
28
27
|
</>
|
|
29
28
|
)}
|
|
30
|
-
</
|
|
29
|
+
</DropdownGroup>
|
|
31
30
|
</Dropdown>
|
|
32
31
|
);
|
|
33
32
|
};
|
|
@@ -55,6 +55,14 @@ export type TileGroupSizeDisplay = 'minimal' | 'small' | 'default';
|
|
|
55
55
|
|
|
56
56
|
export type TileSizeDisplay = 'minimal' | 'small' | 'default';
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* DOM marker set on every tile and tile group title (see `metrics-treemap.tsx`).
|
|
60
|
+
* `MetricsTreemap` uses it to resolve the hovered node from a single delegated
|
|
61
|
+
* pointer handler, instead of attaching hover listeners to every cell.
|
|
62
|
+
*/
|
|
63
|
+
export const NODE_ID_ATTRIBUTE = 'data-treemap-id';
|
|
64
|
+
export const NODE_ID_SELECTOR = `[${NODE_ID_ATTRIBUTE}]`;
|
|
65
|
+
|
|
58
66
|
export const SQUARIFY_RATIO = 1.66;
|
|
59
67
|
export const PADDING_OUTER = 1;
|
|
60
68
|
export const PADDING_INNER = 2;
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* Tile group
|
|
21
21
|
*/
|
|
22
22
|
.tileGroup {
|
|
23
|
+
border-radius: var(--radius-xsmall);
|
|
23
24
|
position: absolute;
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -31,6 +32,7 @@
|
|
|
31
32
|
.tileGroupTitleContent {
|
|
32
33
|
width: 100%;
|
|
33
34
|
padding: var(--space-xxxsmall) 2px var(--space-xxxsmall) var(--space-xxsmall);
|
|
35
|
+
border-radius: var(--radius-xsmall);
|
|
34
36
|
display: flex;
|
|
35
37
|
align-items: center;
|
|
36
38
|
color: var(--color-text);
|
|
@@ -66,12 +68,6 @@
|
|
|
66
68
|
.tileGroup {
|
|
67
69
|
transition: var(--transition-out);
|
|
68
70
|
transition-property: background-color, outline;
|
|
69
|
-
border-radius: var(--radius-xsmall);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.tileGroup--minimal,
|
|
73
|
-
.tileGroup--small {
|
|
74
|
-
border-radius: calc(var(--radius-xsmall) / 2);
|
|
75
71
|
}
|
|
76
72
|
|
|
77
73
|
.tileGroup--minimal .tileGroupTitle,
|
|
@@ -136,9 +132,8 @@
|
|
|
136
132
|
position: absolute;
|
|
137
133
|
appearance: none;
|
|
138
134
|
border: 0;
|
|
139
|
-
border-radius:
|
|
135
|
+
border-radius: var(--radius-xsmall);
|
|
140
136
|
padding: 0;
|
|
141
|
-
border-radius: calc(var(--radius-xsmall) / 2);
|
|
142
137
|
background: var(--color-background);
|
|
143
138
|
display: flex;
|
|
144
139
|
align-items: center;
|
|
@@ -159,6 +154,7 @@
|
|
|
159
154
|
top: 0;
|
|
160
155
|
width: 100%;
|
|
161
156
|
height: 100%;
|
|
157
|
+
border-radius: inherit;
|
|
162
158
|
background-color: currentColor;
|
|
163
159
|
}
|
|
164
160
|
|
|
@@ -170,9 +166,10 @@
|
|
|
170
166
|
display: flex;
|
|
171
167
|
flex-flow: column;
|
|
172
168
|
justify-content: center;
|
|
173
|
-
padding: var(--space-xxsmall)
|
|
169
|
+
padding: var(--space-xxsmall);
|
|
174
170
|
gap: var(--space-xxxsmall);
|
|
175
171
|
line-height: var(--line-height-heading);
|
|
172
|
+
cursor: default;
|
|
176
173
|
}
|
|
177
174
|
|
|
178
175
|
/** Align label to other elements on the first column cells */
|
|
@@ -213,7 +210,7 @@
|
|
|
213
210
|
/** Tile size variation */
|
|
214
211
|
.tileSizeSmall .tileContent {
|
|
215
212
|
padding: var(--space-xxxsmall);
|
|
216
|
-
font-size:
|
|
213
|
+
font-size: var(--size-xsmall);
|
|
217
214
|
}
|
|
218
215
|
|
|
219
216
|
.tileSizeSmall .tileContentLabel {
|
|
@@ -298,11 +295,6 @@
|
|
|
298
295
|
}
|
|
299
296
|
|
|
300
297
|
/** tooltip */
|
|
301
|
-
.tileContentTooltipAnchor {
|
|
302
|
-
width: 100%;
|
|
303
|
-
height: 100%;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
298
|
.tooltip {
|
|
307
299
|
z-index: var(--layer-high);
|
|
308
300
|
padding: var(--space-xsmall) var(--space-small);
|
|
@@ -326,7 +318,8 @@
|
|
|
326
318
|
font-size: var(--size-small);
|
|
327
319
|
}
|
|
328
320
|
|
|
329
|
-
/* prevent tooltip portal wrapper from capturing events
|
|
321
|
+
/* prevent the tooltip portal wrapper from capturing pointer events - the
|
|
322
|
+
treemap relies on pointer events reaching the canvas to track the hovered cell */
|
|
330
323
|
div[role='presentation']:has(.tooltip) {
|
|
331
324
|
pointer-events: none;
|
|
332
325
|
}
|