@bundle-stats/ui 3.2.3-alpha.2 → 3.2.5-alpha.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.
- package/CHANGELOG.md +27 -3
- package/lib/app/app.js +13 -6
- package/lib/app/app.module.css +17 -15
- package/lib/app/header/header.js +14 -8
- package/lib/app/header/header.module.css +11 -18
- package/lib/components/bundle-assets/bundle-assets.module.css +1 -0
- package/lib/components/bundle-packages/bundle-packages.module.css +9 -5
- package/lib/components/delta/delta.js +22 -15
- package/lib/components/delta/delta.module.css +13 -6
- package/lib/components/duplicate-packages-warning/duplicate-packages-warning.js +2 -2
- package/lib/components/job-header/job-header.js +8 -5
- package/lib/components/job-header/job-header.module.css +6 -10
- package/lib/components/jobs-header/jobs-header.js +1 -1
- package/lib/components/jobs-header/jobs-header.module.css +1 -4
- package/lib/components/metric/metric.js +1 -4
- package/lib/components/metric/metric.module.css +7 -7
- package/lib/components/metrics-table-search/metrics-table-search.module.css +5 -4
- package/lib/components/summary-item/summary-item.js +3 -3
- package/lib/components/summary-item/summary-item.module.css +2 -9
- package/lib/css/default.css +13 -7
- package/lib/css/variables.css +24 -24
- package/lib/layout/box/box.module.css +9 -0
- package/lib/layout/footer/footer.module.css +2 -1
- package/lib/layout/index.js +8 -0
- package/lib/layout/separator.js +48 -0
- package/lib/layout/separator.module.css +5 -0
- package/lib/ui/dropdown/dropdown.js +1 -2
- package/lib/ui/dropdown/dropdown.module.css +7 -8
- package/lib/ui/filters/filters.js +10 -5
- package/lib/ui/filters/filters.module.css +10 -0
- package/lib/ui/popover/popover.module.css +1 -1
- package/lib/ui/table/table.module.css +1 -9
- package/lib/ui/tabs/tabs.module.css +1 -2
- package/lib/ui/tooltip/tooltip.module.css +1 -1
- package/lib-esm/app/app.js +12 -6
- package/lib-esm/app/app.module.css +17 -15
- package/lib-esm/app/header/header.js +13 -8
- package/lib-esm/app/header/header.module.css +11 -18
- package/lib-esm/components/bundle-assets/bundle-assets.module.css +1 -0
- package/lib-esm/components/bundle-packages/bundle-packages.module.css +9 -5
- package/lib-esm/components/delta/delta.js +20 -13
- package/lib-esm/components/delta/delta.module.css +13 -6
- package/lib-esm/components/duplicate-packages-warning/duplicate-packages-warning.js +2 -2
- package/lib-esm/components/job-header/job-header.js +8 -5
- package/lib-esm/components/job-header/job-header.module.css +6 -10
- package/lib-esm/components/jobs-header/jobs-header.js +1 -1
- package/lib-esm/components/jobs-header/jobs-header.module.css +1 -4
- package/lib-esm/components/metric/metric.js +1 -4
- package/lib-esm/components/metric/metric.module.css +7 -7
- package/lib-esm/components/metrics-table-search/metrics-table-search.module.css +5 -4
- package/lib-esm/components/summary-item/summary-item.js +3 -3
- package/lib-esm/components/summary-item/summary-item.module.css +2 -9
- package/lib-esm/css/default.css +13 -7
- package/lib-esm/css/variables.css +24 -24
- package/lib-esm/layout/box/box.module.css +9 -0
- package/lib-esm/layout/footer/footer.module.css +2 -1
- package/lib-esm/layout/index.js +1 -0
- package/lib-esm/layout/separator.js +28 -0
- package/lib-esm/layout/separator.module.css +5 -0
- package/lib-esm/ui/dropdown/dropdown.js +1 -2
- package/lib-esm/ui/dropdown/dropdown.module.css +7 -8
- package/lib-esm/ui/filters/filters.js +9 -4
- package/lib-esm/ui/filters/filters.module.css +10 -0
- package/lib-esm/ui/popover/popover.module.css +1 -1
- package/lib-esm/ui/table/table.module.css +1 -9
- package/lib-esm/ui/tabs/tabs.module.css +1 -2
- package/lib-esm/ui/tooltip/tooltip.module.css +1 -1
- package/package.json +13 -11
- package/src/app/app.jsx +23 -15
- package/src/app/app.module.css +17 -15
- package/src/app/header/header.jsx +15 -10
- package/src/app/header/header.module.css +11 -18
- package/src/components/bundle-assets/bundle-assets.module.css +1 -0
- package/src/components/bundle-packages/bundle-packages.module.css +9 -5
- package/src/components/delta/delta.jsx +17 -9
- package/src/components/delta/delta.module.css +13 -6
- package/src/components/duplicate-packages-warning/duplicate-packages-warning.jsx +7 -2
- package/src/components/job-header/job-header.jsx +9 -5
- package/src/components/job-header/job-header.module.css +6 -10
- package/src/components/jobs-header/jobs-header.jsx +1 -1
- package/src/components/jobs-header/jobs-header.module.css +1 -4
- package/src/components/metric/metric.jsx +2 -9
- package/src/components/metric/metric.module.css +7 -7
- package/src/components/metrics-table-search/metrics-table-search.module.css +5 -4
- package/src/components/summary-item/summary-item.jsx +1 -1
- package/src/components/summary-item/summary-item.module.css +2 -9
- package/src/css/default.css +13 -7
- package/src/css/variables.css +24 -24
- package/src/layout/box/box.module.css +9 -0
- package/src/layout/footer/footer.module.css +2 -1
- package/src/layout/index.js +1 -0
- package/src/layout/separator.jsx +25 -0
- package/src/layout/separator.module.css +5 -0
- package/src/ui/dropdown/dropdown.jsx +4 -6
- package/src/ui/dropdown/dropdown.module.css +7 -8
- package/src/ui/filters/filters.jsx +53 -50
- package/src/ui/filters/filters.module.css +10 -0
- package/src/ui/popover/popover.module.css +1 -1
- package/src/ui/table/table.module.css +1 -9
- package/src/ui/tabs/tabs.module.css +1 -2
- package/src/ui/tooltip/tooltip.module.css +1 -1
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.filterInput {
|
|
14
|
+
border-radius: var(--radius-medium) 0 0 var(--radius-medium);
|
|
14
15
|
flex: 0 0 auto;
|
|
15
16
|
height: 1em;
|
|
16
17
|
cursor: pointer;
|
|
@@ -129,11 +130,20 @@
|
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
.item {
|
|
133
|
+
border-radius: 0;
|
|
132
134
|
position: relative;
|
|
133
135
|
flex: 0 0 auto;
|
|
134
136
|
margin-right: -1px;
|
|
135
137
|
}
|
|
136
138
|
|
|
139
|
+
.item:first-child {
|
|
140
|
+
border-radius: var(--radius-medium) 0 0 var(--radius-medium);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.item:last-child {
|
|
144
|
+
border-radius: 0 var(--radius-medium) var(--radius-medium) 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
137
147
|
.item:hover {
|
|
138
148
|
z-index: var(--layer-low); /* show collapsed border */
|
|
139
149
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
.popover {
|
|
26
26
|
padding: var(--space-small) var(--space-large) var(--space-small) var(--space-small);
|
|
27
|
-
border-radius: var(--radius-
|
|
27
|
+
border-radius: var(--radius-large);
|
|
28
28
|
max-width: 360px;
|
|
29
29
|
outline: none;
|
|
30
30
|
filter: drop-shadow(0 0 var(--space-xxxsmall) var(--color-shadow));
|
|
@@ -13,12 +13,8 @@
|
|
|
13
13
|
text-align: left;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
tr:last-child .cell {
|
|
17
|
-
border-bottom-width: 1px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
16
|
.root thead .cell {
|
|
21
|
-
border-width: 0 0
|
|
17
|
+
border-width: 0 0 1px;
|
|
22
18
|
text-transform: uppercase;
|
|
23
19
|
vertical-align: top;
|
|
24
20
|
}
|
|
@@ -44,10 +40,6 @@ tr:last-child .cell {
|
|
|
44
40
|
text-decoration: underline;
|
|
45
41
|
}
|
|
46
42
|
|
|
47
|
-
.root tbody tr:nth-child(odd) .cell {
|
|
48
|
-
background-color: var(--color-highlight);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
43
|
.root tbody tr:hover .cell {
|
|
52
44
|
background-color: var(--color-highlight-warning);
|
|
53
45
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
.tooltip {
|
|
14
14
|
padding: var(--space-xxxsmall) var(--space-xxsmall);
|
|
15
|
-
border-radius: var(--radius-
|
|
15
|
+
border-radius: var(--radius-large);
|
|
16
16
|
background: var(--color-light);
|
|
17
17
|
color: var(--color-text);
|
|
18
18
|
filter: drop-shadow(0 0 var(--space-xxxsmall) var(--color-shadow));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bundle-stats/ui",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.5-alpha.0",
|
|
4
4
|
"description": "UI components for BundleStats projects.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -37,23 +37,24 @@
|
|
|
37
37
|
"homepage": "https://github.com/relative-ci/bundle-stats/blob/master/packages/ui#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@babel/cli": "7.16.8",
|
|
40
|
-
"@babel/core": "7.16.
|
|
40
|
+
"@babel/core": "7.16.12",
|
|
41
41
|
"@babel/plugin-proposal-class-properties": "7.16.7",
|
|
42
|
-
"@babel/preset-env": "7.16.
|
|
42
|
+
"@babel/preset-env": "7.16.11",
|
|
43
43
|
"@babel/preset-react": "7.16.7",
|
|
44
44
|
"@simplyianm/babel-plugin-inline-react-svg": "1.2.0",
|
|
45
|
+
"@storybook/addon-essentials": "6.4.14",
|
|
45
46
|
"@storybook/addon-knobs": "6.4.0",
|
|
46
47
|
"@storybook/addon-postcss": "2.0.0",
|
|
47
|
-
"@storybook/addon-storyshots": "6.4.
|
|
48
|
-
"@storybook/addons": "6.4.
|
|
49
|
-
"@storybook/builder-webpack5": "6.4.
|
|
50
|
-
"@storybook/manager-webpack5": "6.4.
|
|
51
|
-
"@storybook/react": "6.4.
|
|
48
|
+
"@storybook/addon-storyshots": "6.4.14",
|
|
49
|
+
"@storybook/addons": "6.4.14",
|
|
50
|
+
"@storybook/builder-webpack5": "6.4.14",
|
|
51
|
+
"@storybook/manager-webpack5": "6.4.14",
|
|
52
|
+
"@storybook/react": "6.4.14",
|
|
52
53
|
"babel-core": "7.0.0-bridge.0",
|
|
53
54
|
"babel-jest": "27.4.6",
|
|
54
55
|
"babel-plugin-lodash": "3.3.4",
|
|
55
56
|
"babel-plugin-require-context-hook": "1.0.0",
|
|
56
|
-
"chromatic": "6.
|
|
57
|
+
"chromatic": "6.4.1",
|
|
57
58
|
"classnames": "2.3.1",
|
|
58
59
|
"colormap": "2.3.2",
|
|
59
60
|
"core-js": "3.20.2",
|
|
@@ -84,11 +85,12 @@
|
|
|
84
85
|
"react-router-dom": "5.3.0"
|
|
85
86
|
},
|
|
86
87
|
"dependencies": {
|
|
87
|
-
"@bundle-stats/utils": "^3.2.
|
|
88
|
+
"@bundle-stats/utils": "^3.2.5-alpha.0",
|
|
88
89
|
"date-fns": "2.28.0",
|
|
90
|
+
"modern-css-reset": "1.4.0",
|
|
89
91
|
"query-string": "7.1.0",
|
|
90
92
|
"reakit": "1.3.11",
|
|
91
93
|
"use-query-params": "1.2.3"
|
|
92
94
|
},
|
|
93
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "9e6c922005aec32e13b7140e395449d32ae47328"
|
|
94
96
|
}
|
package/src/app/app.jsx
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
URLS,
|
|
12
12
|
} from '../constants';
|
|
13
13
|
import { Box } from '../layout/box';
|
|
14
|
+
import { Separator } from '../layout/separator';
|
|
14
15
|
import { Container } from '../ui/container';
|
|
15
16
|
import { DuplicatePackagesWarning } from '../components/duplicate-packages-warning';
|
|
16
17
|
import { Summary } from '../components/summary';
|
|
@@ -42,7 +43,7 @@ const Layout = ({ jobs, version, ...props }) => (
|
|
|
42
43
|
<div className={css.root}>
|
|
43
44
|
<Header className={css.header} jobs={jobs} />
|
|
44
45
|
<main className={css.main} {...props} />
|
|
45
|
-
<Footer version={version} />
|
|
46
|
+
<Footer className={css.footer} version={version} />
|
|
46
47
|
</div>
|
|
47
48
|
);
|
|
48
49
|
|
|
@@ -58,8 +59,12 @@ Layout.defaultProps = {
|
|
|
58
59
|
|
|
59
60
|
const AppComponent = ({ version, jobs }) => {
|
|
60
61
|
const [bundleStatsState, bundleStatsSetState] = useComponentQueryState(COMPONENT.BUNDLE_ASSETS);
|
|
61
|
-
const [bundlePackagesState, bundlePackagesSetState] = useComponentQueryState(
|
|
62
|
-
|
|
62
|
+
const [bundlePackagesState, bundlePackagesSetState] = useComponentQueryState(
|
|
63
|
+
COMPONENT.BUNDLE_PACKAGES,
|
|
64
|
+
);
|
|
65
|
+
const [bundleModulesState, bundleModulesSetState] = useComponentQueryState(
|
|
66
|
+
COMPONENT.BUNDLE_MODULES,
|
|
67
|
+
);
|
|
63
68
|
|
|
64
69
|
if (jobs.length === 0) {
|
|
65
70
|
return (
|
|
@@ -178,20 +183,23 @@ const AppComponent = ({ version, jobs }) => {
|
|
|
178
183
|
exact
|
|
179
184
|
path={URLS.OVERVIEW}
|
|
180
185
|
render={() => (
|
|
181
|
-
<Stack space="
|
|
182
|
-
{duplicatePackagesInsights && (
|
|
183
|
-
<Container>
|
|
184
|
-
<DuplicatePackagesWarning
|
|
185
|
-
duplicatePackagesCount={duplicatePackagesCount}
|
|
186
|
-
showDelta={jobs.length > 1}
|
|
187
|
-
/>
|
|
188
|
-
</Container>
|
|
189
|
-
)}
|
|
186
|
+
<Stack space="medium">
|
|
190
187
|
<Container>
|
|
191
|
-
<Stack space="
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
<Stack space="medium">
|
|
189
|
+
{duplicatePackagesInsights && (
|
|
190
|
+
<DuplicatePackagesWarning
|
|
191
|
+
duplicatePackagesCount={duplicatePackagesCount}
|
|
192
|
+
showDelta={jobs.length > 1}
|
|
193
|
+
/>
|
|
194
|
+
)}
|
|
194
195
|
<Box outline>
|
|
196
|
+
<Box padding="small">
|
|
197
|
+
<Stack space="small">
|
|
198
|
+
<TotalSizeTypeTitle />
|
|
199
|
+
<BundleAssetsTotalsChartBars jobs={jobs} />
|
|
200
|
+
</Stack>
|
|
201
|
+
</Box>
|
|
202
|
+
<Separator />
|
|
195
203
|
<BundleAssetsTotalsTable jobs={jobs} />
|
|
196
204
|
</Box>
|
|
197
205
|
</Stack>
|
package/src/app/app.module.css
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.root {
|
|
6
|
-
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.header {
|
|
9
|
+
border-bottom: 1px solid var(--color-outline);
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
.empty {
|
|
@@ -13,16 +16,12 @@
|
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
.summaryContainer {
|
|
16
|
-
padding-top: var(--space-
|
|
17
|
-
padding-bottom: var(--space-
|
|
19
|
+
padding-top: var(--space-medium);
|
|
20
|
+
padding-bottom: var(--space-xsmall);
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
.tabsContainer {
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.tabs {
|
|
25
|
-
margin-bottom: -1px;
|
|
24
|
+
background: var(--color-light);
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
.tabActive {
|
|
@@ -34,24 +33,27 @@
|
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
.tabsContent {
|
|
37
|
-
padding-top: var(--space-
|
|
38
|
-
padding-bottom: var(--space-
|
|
36
|
+
padding-top: var(--space-medium);
|
|
37
|
+
padding-bottom: var(--space-medium);
|
|
39
38
|
min-height: 480px;
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
@media (min-width: 600px) {
|
|
43
42
|
:root {
|
|
44
|
-
--header-height:
|
|
43
|
+
--header-height: 78px;
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
.header {
|
|
48
|
-
position:
|
|
47
|
+
position: sticky;
|
|
49
48
|
z-index: var(--layer-high);
|
|
50
|
-
left: 0;
|
|
51
49
|
top: 0;
|
|
52
|
-
right: 0;
|
|
53
50
|
height: var(--header-height);
|
|
54
51
|
background-color: var(--color-background);
|
|
55
|
-
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.tabsContainer {
|
|
55
|
+
position: sticky;
|
|
56
|
+
top: var(--header-height);
|
|
57
|
+
z-index: 100;
|
|
56
58
|
}
|
|
57
59
|
}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
|
|
5
|
+
import { FlexStack } from '../../layout/flex-stack';
|
|
5
6
|
import { Container } from '../../ui/container';
|
|
6
7
|
import { JobsHeader } from '../../components/jobs-header';
|
|
7
8
|
import { Logo } from '../../ui/logo';
|
|
@@ -10,17 +11,21 @@ import css from './header.module.css';
|
|
|
10
11
|
|
|
11
12
|
export const Header = ({ className, jobs }) => (
|
|
12
13
|
<Container as="header" className={cx(css.root, className)}>
|
|
13
|
-
<
|
|
14
|
-
<a
|
|
15
|
-
className={css.branding}
|
|
16
|
-
href="https://github.com/relative-ci/bundle-stats"
|
|
17
|
-
target="_blank"
|
|
18
|
-
rel="noopener noreferrer nofollow"
|
|
19
|
-
>
|
|
20
|
-
<Logo className={css.brandingLogo}>BundleStats</Logo>
|
|
21
|
-
</a>
|
|
14
|
+
<FlexStack space="small" className={css.inner}>
|
|
22
15
|
<JobsHeader className={css.jobs} jobs={jobs} />
|
|
23
|
-
|
|
16
|
+
<div className={css.options}>
|
|
17
|
+
<a
|
|
18
|
+
href="https://github.com/relative-ci/bundle-stats"
|
|
19
|
+
target="_blank"
|
|
20
|
+
rel="noopener noreferrer nofollow"
|
|
21
|
+
title="View bundle-stats on GitHub"
|
|
22
|
+
>
|
|
23
|
+
<Logo className={css.github} kind="github">
|
|
24
|
+
GitHub
|
|
25
|
+
</Logo>
|
|
26
|
+
</a>
|
|
27
|
+
</div>
|
|
28
|
+
</FlexStack>
|
|
24
29
|
</Container>
|
|
25
30
|
);
|
|
26
31
|
|
|
@@ -1,30 +1,23 @@
|
|
|
1
1
|
.inner {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.branding {
|
|
7
|
-
padding: var(--space-small);
|
|
8
|
-
flex: 0 0 auto;
|
|
9
|
-
color: var(--color-text);
|
|
10
|
-
display: flex;
|
|
11
2
|
align-items: center;
|
|
12
3
|
}
|
|
13
4
|
|
|
14
5
|
.jobs {
|
|
15
6
|
flex: 1 1 auto;
|
|
7
|
+
overflow-x: auto;
|
|
16
8
|
}
|
|
17
9
|
|
|
18
|
-
.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
color: var(--color-text-light);
|
|
10
|
+
.options {
|
|
11
|
+
flex: 0 0 var(--space-large);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.option {
|
|
15
|
+
display: inline-block;
|
|
25
16
|
}
|
|
26
17
|
|
|
27
|
-
.
|
|
28
|
-
|
|
18
|
+
.github {
|
|
19
|
+
display: block;
|
|
20
|
+
color: var(--color-text-ultra-light);
|
|
29
21
|
width: var(--space-medium);
|
|
22
|
+
height: var(--space-medium);
|
|
30
23
|
}
|
|
@@ -13,17 +13,21 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.duplicate {
|
|
16
|
-
|
|
16
|
+
border-radius: var(--radius-small);
|
|
17
17
|
display: inline-block;
|
|
18
|
-
width: var(--space-
|
|
19
|
-
height: var(--space-
|
|
20
|
-
font-
|
|
18
|
+
width: var(--space-xsmall);
|
|
19
|
+
height: var(--space-xsmall);
|
|
20
|
+
font-family: var(--font-family);
|
|
21
|
+
font-size: 8px;
|
|
21
22
|
font-weight: bold;
|
|
22
|
-
|
|
23
|
+
background: var(--color-highlight);
|
|
24
|
+
color: var(--color-text-light);
|
|
25
|
+
line-height: var(--space-xsmall);
|
|
23
26
|
text-align: center;
|
|
24
27
|
text-transform: uppercase;
|
|
25
28
|
vertical-align: middle;
|
|
26
29
|
|
|
30
|
+
margin-right: var(--space-xxxsmall);
|
|
27
31
|
background: var(--color-danger);
|
|
28
32
|
color: var(--color-light);
|
|
29
33
|
}
|
|
@@ -4,19 +4,27 @@ import cx from 'classnames';
|
|
|
4
4
|
|
|
5
5
|
import css from './delta.module.css';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const propTypes = {
|
|
8
|
+
className: PropTypes.string,
|
|
9
|
+
displayValue: PropTypes.string.isRequired,
|
|
10
|
+
deltaType: PropTypes.string.isRequired,
|
|
11
|
+
inverted: PropTypes.bool,
|
|
10
12
|
};
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
const defaultProps = {
|
|
13
15
|
className: '',
|
|
14
16
|
inverted: false,
|
|
15
17
|
};
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @param {PropTypes.InferProps<typeof propTypes>} props
|
|
21
|
+
* @return {React.FunctionComponentElement}
|
|
22
|
+
*/
|
|
23
|
+
export const Delta = (props) => {
|
|
24
|
+
const { className, displayValue, deltaType, inverted } = props;
|
|
25
|
+
const rootClassName = cx(css.root, className, inverted && css.inverted, css[deltaType]);
|
|
26
|
+
return <span className={rootClassName}>{displayValue}</span>;
|
|
22
27
|
};
|
|
28
|
+
|
|
29
|
+
Delta.defaultProps = defaultProps;
|
|
30
|
+
Delta.propTypes = propTypes;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
.root {
|
|
2
2
|
white-space: nowrap;
|
|
3
|
-
color: var(--color-gray-ultra-light);
|
|
4
3
|
}
|
|
5
4
|
|
|
6
5
|
.HIGH_NEGATIVE {
|
|
@@ -8,7 +7,7 @@
|
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
.NEGATIVE {
|
|
11
|
-
color: var(--color-red
|
|
10
|
+
color: var(--color-red);
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
.LOW_NEGATIVE {
|
|
@@ -20,7 +19,7 @@
|
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
.POSITIVE {
|
|
23
|
-
color: var(--color-green
|
|
22
|
+
color: var(--color-green);
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
.HIGH_POSITIVE {
|
|
@@ -28,30 +27,38 @@
|
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
.inverted {
|
|
31
|
-
|
|
30
|
+
padding: 2px;
|
|
31
|
+
border-radius: var(--radius-small);
|
|
32
|
+
background: var(--color-gray-ultra-light);
|
|
32
33
|
color: var(--color-light);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
.inverted.HIGH_NEGATIVE {
|
|
36
37
|
background: var(--color-red-dark);
|
|
38
|
+
color: var(--color-highlight-danger);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
.inverted.NEGATIVE {
|
|
40
|
-
background: var(--color-red
|
|
42
|
+
background: var(--color-red);
|
|
43
|
+
color: var(--color-highlight-danger);
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
.inverted.LOW_NEGATIVE {
|
|
44
47
|
background: var(--color-red-light);
|
|
48
|
+
color: var(--color-highlight-danger);
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
.inverted.LOW_POSITIVE {
|
|
48
52
|
background: var(--color-green-light);
|
|
53
|
+
color: var(--color-highlight-success);
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
.inverted.POSITIVE {
|
|
52
|
-
background: var(--color-green
|
|
57
|
+
background: var(--color-green);
|
|
58
|
+
color: var(--color-highlight-success);
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
.inverted.HIGH_POSITIVE {
|
|
56
62
|
background: var(--color-green-dark);
|
|
63
|
+
color: var(--color-highlight-success);
|
|
57
64
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import cx from 'classnames';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
BUNDLE_PACKAGES_DUPLICATE,
|
|
6
|
+
METRIC_TYPE_NUMERIC,
|
|
7
|
+
METRIC_TYPES,
|
|
8
|
+
getMetricRunInfo,
|
|
9
|
+
} from '@bundle-stats/utils';
|
|
5
10
|
|
|
6
11
|
import { Alert } from '../../ui/alert';
|
|
7
12
|
import { ComponentLink } from '../component-link';
|
|
@@ -32,9 +37,9 @@ export const DuplicatePackagesWarning = (props) => {
|
|
|
32
37
|
{showDelta && metricRunInfo.delta !== 0 && (
|
|
33
38
|
<Delta
|
|
34
39
|
className={css.titleDelta}
|
|
35
|
-
inverted
|
|
36
40
|
displayValue={metricRunInfo.displayDelta}
|
|
37
41
|
deltaType={metricRunInfo.deltaType}
|
|
42
|
+
inverted
|
|
38
43
|
/>
|
|
39
44
|
)}
|
|
40
45
|
{` duplicate ${metricRunInfo.value === 1 ? 'package' : 'packages'}.`}
|
|
@@ -17,26 +17,30 @@ export const JobHeader = (props) => {
|
|
|
17
17
|
const rootClassName = cx(css.root, className);
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
|
-
<Stack className={rootClassName} space="
|
|
20
|
+
<Stack className={rootClassName} space="xxxsmall">
|
|
21
21
|
<h1 className={css.title}>
|
|
22
22
|
<span>{`#${job.internalBuildNumber}`}</span>
|
|
23
23
|
{tag && <span className={css.tag}>{tag}</span>}
|
|
24
24
|
</h1>
|
|
25
25
|
<FlexStack className={css.meta} space="xxsmall">
|
|
26
26
|
{builtAt && (
|
|
27
|
-
<
|
|
27
|
+
<FlexStack
|
|
28
|
+
className={css.metaItem}
|
|
29
|
+
title={`${formatDate(builtAt)} ${formatTime(builtAt)}`}
|
|
30
|
+
space="xxxsmall"
|
|
31
|
+
>
|
|
28
32
|
<Icon glyph="clock" className={css.metaIcon} />
|
|
29
33
|
<span className={css.metaLabel}>
|
|
30
34
|
{formatDistanceToNow(new Date(builtAt), { addSuffix: true })}
|
|
31
35
|
</span>
|
|
32
|
-
</
|
|
36
|
+
</FlexStack>
|
|
33
37
|
)}
|
|
34
38
|
|
|
35
39
|
{hash && (
|
|
36
|
-
<span className={css.metaItem} title="Webpack bundle hash">
|
|
40
|
+
<FlexStack span className={css.metaItem} title="Webpack bundle hash" space="xxxsmall">
|
|
37
41
|
<Icon glyph="commit" className={css.metaIcon} />
|
|
38
42
|
<span className={css.metaLabel}>{hash}</span>
|
|
39
|
-
</
|
|
43
|
+
</FlexStack>
|
|
40
44
|
)}
|
|
41
45
|
|
|
42
46
|
<div className={css.content}>{children}</div>
|
|
@@ -1,36 +1,32 @@
|
|
|
1
1
|
.title {
|
|
2
|
-
|
|
3
|
-
font-weight: bold;
|
|
2
|
+
font-size: var(--size-xlarge);
|
|
4
3
|
vertical-align: top;
|
|
5
4
|
}
|
|
6
5
|
|
|
7
6
|
.tag {
|
|
8
7
|
padding: var(--space-xxxsmall);
|
|
9
8
|
margin-left: var(--space-xxxsmall);
|
|
10
|
-
background
|
|
9
|
+
background: var(--color-highlight);
|
|
11
10
|
color: var(--color-text-light);
|
|
12
11
|
display: inline-block;
|
|
13
|
-
font-size:
|
|
12
|
+
font-size: var(--size-xsmall);
|
|
14
13
|
line-height: var(--space-xxsmall);
|
|
15
14
|
font-weight: normal;
|
|
16
15
|
vertical-align: top;
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
.meta {
|
|
20
|
-
color: var(--color-text-light);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
18
|
.metaItem {
|
|
24
19
|
display: inline-flex;
|
|
25
20
|
align-items: center;
|
|
21
|
+
white-space: nowrap;
|
|
26
22
|
}
|
|
27
23
|
|
|
28
24
|
.metaIcon {
|
|
29
25
|
width: var(--space-small);
|
|
30
26
|
height: var(--space-small);
|
|
31
|
-
|
|
27
|
+
color: var(--color-text-ultra-light);
|
|
32
28
|
}
|
|
33
29
|
|
|
34
30
|
.metaLabel {
|
|
35
|
-
|
|
31
|
+
color: var(--color-text-light);
|
|
36
32
|
}
|
|
@@ -12,7 +12,7 @@ export const JobsHeader = (props) => {
|
|
|
12
12
|
const rootClassName = cx(css.root, className);
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
|
-
<FlexStack className={rootClassName} space="
|
|
15
|
+
<FlexStack className={rootClassName} space="small">
|
|
16
16
|
{jobs?.map((job, index) => (
|
|
17
17
|
<JobHeader
|
|
18
18
|
key={job.internalBuildNumber || index}
|
|
@@ -7,7 +7,7 @@ import styles from './metric.module.css';
|
|
|
7
7
|
// Separate value and unit
|
|
8
8
|
const EXTRACT_VALUE_UNIT_PATTERN = /([\d|.|,| ]*)(\w*|%)$/;
|
|
9
9
|
|
|
10
|
-
export const Metric = ({ className, value, formatter,
|
|
10
|
+
export const Metric = ({ className, value, formatter, anchored, children, enhanced }) => {
|
|
11
11
|
const formattedValue = formatter(value);
|
|
12
12
|
|
|
13
13
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -16,12 +16,7 @@ export const Metric = ({ className, value, formatter, inline, anchored, children
|
|
|
16
16
|
? formattedValue.match(EXTRACT_VALUE_UNIT_PATTERN)
|
|
17
17
|
: [null, formattedValue, null];
|
|
18
18
|
|
|
19
|
-
const rootClassName = cx(
|
|
20
|
-
className,
|
|
21
|
-
styles.root,
|
|
22
|
-
inline && styles.inline,
|
|
23
|
-
anchored && styles.anchored,
|
|
24
|
-
);
|
|
19
|
+
const rootClassName = cx(className, styles.root, anchored && styles.anchored);
|
|
25
20
|
|
|
26
21
|
return (
|
|
27
22
|
<span className={rootClassName}>
|
|
@@ -38,7 +33,6 @@ Metric.defaultProps = {
|
|
|
38
33
|
className: '',
|
|
39
34
|
anchored: false,
|
|
40
35
|
enhanced: false,
|
|
41
|
-
inline: false,
|
|
42
36
|
value: 0,
|
|
43
37
|
children: [],
|
|
44
38
|
formatter: (val) => val,
|
|
@@ -47,7 +41,6 @@ Metric.defaultProps = {
|
|
|
47
41
|
Metric.propTypes = {
|
|
48
42
|
className: PropTypes.string,
|
|
49
43
|
enhanced: PropTypes.bool,
|
|
50
|
-
inline: PropTypes.bool,
|
|
51
44
|
anchored: PropTypes.bool,
|
|
52
45
|
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
53
46
|
formatter: PropTypes.func,
|