@bundle-stats/ui 3.2.5-alpha.0 → 3.2.5-alpha.21
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 +69 -21
- package/lib/app/app.js +6 -13
- package/lib/app/app.module.css +15 -17
- package/lib/app/header/header.js +8 -14
- package/lib/app/header/header.module.css +18 -11
- package/lib/components/bundle-assets/bundle-assets.module.css +0 -1
- package/lib/components/bundle-packages/bundle-packages.module.css +5 -9
- package/lib/components/delta/delta.js +15 -22
- package/lib/components/delta/delta.module.css +6 -13
- package/lib/components/duplicate-packages-warning/duplicate-packages-warning.js +2 -2
- package/lib/components/job-header/job-header.js +5 -8
- package/lib/components/job-header/job-header.module.css +10 -6
- package/lib/components/jobs-header/jobs-header.js +1 -1
- package/lib/components/jobs-header/jobs-header.module.css +4 -1
- package/lib/components/metric/metric.js +4 -1
- package/lib/components/metric/metric.module.css +7 -7
- package/lib/components/metrics-table-search/metrics-table-search.module.css +4 -5
- package/lib/components/summary-item/summary-item.js +3 -3
- package/lib/components/summary-item/summary-item.module.css +9 -2
- package/lib/css/default.css +7 -13
- package/lib/css/variables.css +24 -24
- package/lib/layout/box/box.module.css +0 -9
- package/lib/layout/footer/footer.module.css +1 -2
- package/lib/layout/index.js +0 -8
- package/lib/ui/dropdown/dropdown.js +2 -1
- package/lib/ui/dropdown/dropdown.module.css +8 -7
- package/lib/ui/filters/filters.js +5 -10
- package/lib/ui/filters/filters.module.css +0 -10
- package/lib/ui/popover/popover.module.css +1 -1
- package/lib/ui/table/table.module.css +9 -1
- package/lib/ui/tabs/tabs.module.css +2 -1
- package/lib/ui/tooltip/tooltip.module.css +1 -1
- package/lib-esm/app/app.js +6 -12
- package/lib-esm/app/app.module.css +15 -17
- package/lib-esm/app/header/header.js +8 -13
- package/lib-esm/app/header/header.module.css +18 -11
- package/lib-esm/components/bundle-assets/bundle-assets.module.css +0 -1
- package/lib-esm/components/bundle-packages/bundle-packages.module.css +5 -9
- package/lib-esm/components/delta/delta.js +13 -20
- package/lib-esm/components/delta/delta.module.css +6 -13
- package/lib-esm/components/duplicate-packages-warning/duplicate-packages-warning.js +2 -2
- package/lib-esm/components/job-header/job-header.js +5 -8
- package/lib-esm/components/job-header/job-header.module.css +10 -6
- package/lib-esm/components/jobs-header/jobs-header.js +1 -1
- package/lib-esm/components/jobs-header/jobs-header.module.css +4 -1
- package/lib-esm/components/metric/metric.js +4 -1
- package/lib-esm/components/metric/metric.module.css +7 -7
- package/lib-esm/components/metrics-table-search/metrics-table-search.module.css +4 -5
- package/lib-esm/components/summary-item/summary-item.js +3 -3
- package/lib-esm/components/summary-item/summary-item.module.css +9 -2
- package/lib-esm/css/default.css +7 -13
- package/lib-esm/css/variables.css +24 -24
- package/lib-esm/layout/box/box.module.css +0 -9
- package/lib-esm/layout/footer/footer.module.css +1 -2
- package/lib-esm/layout/index.js +0 -1
- package/lib-esm/ui/dropdown/dropdown.js +2 -1
- package/lib-esm/ui/dropdown/dropdown.module.css +8 -7
- package/lib-esm/ui/filters/filters.js +4 -9
- package/lib-esm/ui/filters/filters.module.css +0 -10
- package/lib-esm/ui/popover/popover.module.css +1 -1
- package/lib-esm/ui/table/table.module.css +9 -1
- package/lib-esm/ui/tabs/tabs.module.css +2 -1
- package/lib-esm/ui/tooltip/tooltip.module.css +1 -1
- package/package.json +3 -4
- package/src/app/app.jsx +15 -23
- package/src/app/app.module.css +15 -17
- package/src/app/header/header.jsx +10 -15
- package/src/app/header/header.module.css +18 -11
- package/src/components/bundle-assets/bundle-assets.module.css +0 -1
- package/src/components/bundle-packages/bundle-packages.module.css +5 -9
- package/src/components/delta/delta.jsx +9 -17
- package/src/components/delta/delta.module.css +6 -13
- package/src/components/duplicate-packages-warning/duplicate-packages-warning.jsx +2 -7
- package/src/components/job-header/job-header.jsx +5 -9
- package/src/components/job-header/job-header.module.css +10 -6
- package/src/components/jobs-header/jobs-header.jsx +1 -1
- package/src/components/jobs-header/jobs-header.module.css +4 -1
- package/src/components/metric/metric.jsx +9 -2
- package/src/components/metric/metric.module.css +7 -7
- package/src/components/metrics-table-search/metrics-table-search.module.css +4 -5
- package/src/components/summary-item/summary-item.jsx +1 -1
- package/src/components/summary-item/summary-item.module.css +9 -2
- package/src/css/default.css +7 -13
- package/src/css/variables.css +24 -24
- package/src/layout/box/box.module.css +0 -9
- package/src/layout/footer/footer.module.css +1 -2
- package/src/layout/index.js +0 -1
- package/src/ui/dropdown/dropdown.jsx +6 -4
- package/src/ui/dropdown/dropdown.module.css +8 -7
- package/src/ui/filters/filters.jsx +50 -53
- package/src/ui/filters/filters.module.css +0 -10
- package/src/ui/popover/popover.module.css +1 -1
- package/src/ui/table/table.module.css +9 -1
- package/src/ui/tabs/tabs.module.css +2 -1
- package/src/ui/tooltip/tooltip.module.css +1 -1
- package/lib/layout/separator.js +0 -48
- package/lib/layout/separator.module.css +0 -5
- package/lib-esm/layout/separator.js +0 -28
- package/lib-esm/layout/separator.module.css +0 -5
- package/src/layout/separator.jsx +0 -25
- package/src/layout/separator.module.css +0 -5
|
@@ -13,8 +13,12 @@
|
|
|
13
13
|
text-align: left;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
tr:last-child .cell {
|
|
17
|
+
border-bottom-width: 1px;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
.root thead .cell {
|
|
17
|
-
border-width: 0 0
|
|
21
|
+
border-width: 0 0 2px;
|
|
18
22
|
text-transform: uppercase;
|
|
19
23
|
vertical-align: top;
|
|
20
24
|
}
|
|
@@ -40,6 +44,10 @@
|
|
|
40
44
|
text-decoration: underline;
|
|
41
45
|
}
|
|
42
46
|
|
|
47
|
+
.root tbody tr:nth-child(odd) .cell {
|
|
48
|
+
background-color: var(--color-highlight);
|
|
49
|
+
}
|
|
50
|
+
|
|
43
51
|
.root tbody tr:hover .cell {
|
|
44
52
|
background-color: var(--color-highlight-warning);
|
|
45
53
|
}
|
|
@@ -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-small);
|
|
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.5-alpha.
|
|
3
|
+
"version": "3.2.5-alpha.21",
|
|
4
4
|
"description": "UI components for BundleStats projects.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -85,12 +85,11 @@
|
|
|
85
85
|
"react-router-dom": "5.3.0"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@bundle-stats/utils": "^3.2.5-alpha.
|
|
88
|
+
"@bundle-stats/utils": "^3.2.5-alpha.21",
|
|
89
89
|
"date-fns": "2.28.0",
|
|
90
|
-
"modern-css-reset": "1.4.0",
|
|
91
90
|
"query-string": "7.1.0",
|
|
92
91
|
"reakit": "1.3.11",
|
|
93
92
|
"use-query-params": "1.2.3"
|
|
94
93
|
},
|
|
95
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "d9f02fd380c75a3f804f70a91106be3eb7e168f6"
|
|
96
95
|
}
|
package/src/app/app.jsx
CHANGED
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
URLS,
|
|
12
12
|
} from '../constants';
|
|
13
13
|
import { Box } from '../layout/box';
|
|
14
|
-
import { Separator } from '../layout/separator';
|
|
15
14
|
import { Container } from '../ui/container';
|
|
16
15
|
import { DuplicatePackagesWarning } from '../components/duplicate-packages-warning';
|
|
17
16
|
import { Summary } from '../components/summary';
|
|
@@ -43,7 +42,7 @@ const Layout = ({ jobs, version, ...props }) => (
|
|
|
43
42
|
<div className={css.root}>
|
|
44
43
|
<Header className={css.header} jobs={jobs} />
|
|
45
44
|
<main className={css.main} {...props} />
|
|
46
|
-
<Footer
|
|
45
|
+
<Footer version={version} />
|
|
47
46
|
</div>
|
|
48
47
|
);
|
|
49
48
|
|
|
@@ -59,12 +58,8 @@ Layout.defaultProps = {
|
|
|
59
58
|
|
|
60
59
|
const AppComponent = ({ version, jobs }) => {
|
|
61
60
|
const [bundleStatsState, bundleStatsSetState] = useComponentQueryState(COMPONENT.BUNDLE_ASSETS);
|
|
62
|
-
const [bundlePackagesState, bundlePackagesSetState] = useComponentQueryState(
|
|
63
|
-
|
|
64
|
-
);
|
|
65
|
-
const [bundleModulesState, bundleModulesSetState] = useComponentQueryState(
|
|
66
|
-
COMPONENT.BUNDLE_MODULES,
|
|
67
|
-
);
|
|
61
|
+
const [bundlePackagesState, bundlePackagesSetState] = useComponentQueryState(COMPONENT.BUNDLE_PACKAGES);
|
|
62
|
+
const [bundleModulesState, bundleModulesSetState] = useComponentQueryState(COMPONENT.BUNDLE_MODULES);
|
|
68
63
|
|
|
69
64
|
if (jobs.length === 0) {
|
|
70
65
|
return (
|
|
@@ -183,23 +178,20 @@ const AppComponent = ({ version, jobs }) => {
|
|
|
183
178
|
exact
|
|
184
179
|
path={URLS.OVERVIEW}
|
|
185
180
|
render={() => (
|
|
186
|
-
<Stack space="
|
|
181
|
+
<Stack space="large">
|
|
182
|
+
{duplicatePackagesInsights && (
|
|
183
|
+
<Container>
|
|
184
|
+
<DuplicatePackagesWarning
|
|
185
|
+
duplicatePackagesCount={duplicatePackagesCount}
|
|
186
|
+
showDelta={jobs.length > 1}
|
|
187
|
+
/>
|
|
188
|
+
</Container>
|
|
189
|
+
)}
|
|
187
190
|
<Container>
|
|
188
|
-
<Stack space="
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
duplicatePackagesCount={duplicatePackagesCount}
|
|
192
|
-
showDelta={jobs.length > 1}
|
|
193
|
-
/>
|
|
194
|
-
)}
|
|
191
|
+
<Stack space="small">
|
|
192
|
+
<TotalSizeTypeTitle />
|
|
193
|
+
<BundleAssetsTotalsChartBars jobs={jobs} />
|
|
195
194
|
<Box outline>
|
|
196
|
-
<Box padding="small">
|
|
197
|
-
<Stack space="small">
|
|
198
|
-
<TotalSizeTypeTitle />
|
|
199
|
-
<BundleAssetsTotalsChartBars jobs={jobs} />
|
|
200
|
-
</Stack>
|
|
201
|
-
</Box>
|
|
202
|
-
<Separator />
|
|
203
195
|
<BundleAssetsTotalsTable jobs={jobs} />
|
|
204
196
|
</Box>
|
|
205
197
|
</Stack>
|
package/src/app/app.module.css
CHANGED
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.root {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
.header {
|
|
9
|
-
border-bottom: 1px solid var(--color-outline);
|
|
6
|
+
padding-top: var(--header-height);
|
|
10
7
|
}
|
|
11
8
|
|
|
12
9
|
.empty {
|
|
@@ -16,12 +13,16 @@
|
|
|
16
13
|
}
|
|
17
14
|
|
|
18
15
|
.summaryContainer {
|
|
19
|
-
padding-top: var(--space-
|
|
20
|
-
padding-bottom: var(--space-
|
|
16
|
+
padding-top: var(--space-large);
|
|
17
|
+
padding-bottom: var(--space-small);
|
|
21
18
|
}
|
|
22
19
|
|
|
23
20
|
.tabsContainer {
|
|
24
|
-
|
|
21
|
+
border-bottom: 1px solid var(--color-outline);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.tabs {
|
|
25
|
+
margin-bottom: -1px;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
.tabActive {
|
|
@@ -33,27 +34,24 @@
|
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
.tabsContent {
|
|
36
|
-
padding-top: var(--space-
|
|
37
|
-
padding-bottom: var(--space-
|
|
37
|
+
padding-top: var(--space-large);
|
|
38
|
+
padding-bottom: var(--space-large);
|
|
38
39
|
min-height: 480px;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
@media (min-width: 600px) {
|
|
42
43
|
:root {
|
|
43
|
-
--header-height:
|
|
44
|
+
--header-height: 80px;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
.header {
|
|
47
|
-
position:
|
|
48
|
+
position: fixed;
|
|
48
49
|
z-index: var(--layer-high);
|
|
50
|
+
left: 0;
|
|
49
51
|
top: 0;
|
|
52
|
+
right: 0;
|
|
50
53
|
height: var(--header-height);
|
|
51
54
|
background-color: var(--color-background);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.tabsContainer {
|
|
55
|
-
position: sticky;
|
|
56
|
-
top: var(--header-height);
|
|
57
|
-
z-index: 100;
|
|
55
|
+
border-bottom: 1px solid var(--color-outline);
|
|
58
56
|
}
|
|
59
57
|
}
|
|
@@ -2,7 +2,6 @@ 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';
|
|
6
5
|
import { Container } from '../../ui/container';
|
|
7
6
|
import { JobsHeader } from '../../components/jobs-header';
|
|
8
7
|
import { Logo } from '../../ui/logo';
|
|
@@ -11,21 +10,17 @@ import css from './header.module.css';
|
|
|
11
10
|
|
|
12
11
|
export const Header = ({ className, jobs }) => (
|
|
13
12
|
<Container as="header" className={cx(css.root, className)}>
|
|
14
|
-
<
|
|
13
|
+
<div className={css.inner}>
|
|
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>
|
|
15
22
|
<JobsHeader className={css.jobs} jobs={jobs} />
|
|
16
|
-
|
|
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>
|
|
23
|
+
</div>
|
|
29
24
|
</Container>
|
|
30
25
|
);
|
|
31
26
|
|
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
.inner {
|
|
2
|
+
display: flex;
|
|
2
3
|
align-items: center;
|
|
3
4
|
}
|
|
4
5
|
|
|
5
|
-
.
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
.branding {
|
|
7
|
+
padding: var(--space-small);
|
|
8
|
+
flex: 0 0 auto;
|
|
9
|
+
color: var(--color-text);
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
8
12
|
}
|
|
9
13
|
|
|
10
|
-
.
|
|
11
|
-
flex:
|
|
14
|
+
.jobs {
|
|
15
|
+
flex: 1 1 auto;
|
|
12
16
|
}
|
|
13
17
|
|
|
14
|
-
.
|
|
15
|
-
|
|
18
|
+
.tools {
|
|
19
|
+
border-left: 1px solid var(--color-outline);
|
|
20
|
+
padding: var(--space-small);
|
|
21
|
+
margin: 0 0 0 auto;
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
color: var(--color-text-light);
|
|
16
25
|
}
|
|
17
26
|
|
|
18
|
-
.
|
|
19
|
-
|
|
20
|
-
color: var(--color-text-ultra-light);
|
|
27
|
+
.toolsGithub {
|
|
28
|
+
color: inherit;
|
|
21
29
|
width: var(--space-medium);
|
|
22
|
-
height: var(--space-medium);
|
|
23
30
|
}
|
|
@@ -13,21 +13,17 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.duplicate {
|
|
16
|
-
|
|
16
|
+
margin-right: var(--space-xxxsmall);
|
|
17
17
|
display: inline-block;
|
|
18
|
-
width: var(--space-
|
|
19
|
-
height: var(--space-
|
|
20
|
-
font-
|
|
21
|
-
font-size: 8px;
|
|
18
|
+
width: var(--space-small);
|
|
19
|
+
height: var(--space-small);
|
|
20
|
+
font-size: 10px;
|
|
22
21
|
font-weight: bold;
|
|
23
|
-
|
|
24
|
-
color: var(--color-text-light);
|
|
25
|
-
line-height: var(--space-xsmall);
|
|
22
|
+
line-height: var(--space-small);
|
|
26
23
|
text-align: center;
|
|
27
24
|
text-transform: uppercase;
|
|
28
25
|
vertical-align: middle;
|
|
29
26
|
|
|
30
|
-
margin-right: var(--space-xxxsmall);
|
|
31
27
|
background: var(--color-danger);
|
|
32
28
|
color: var(--color-light);
|
|
33
29
|
}
|
|
@@ -4,27 +4,19 @@ import cx from 'classnames';
|
|
|
4
4
|
|
|
5
5
|
import css from './delta.module.css';
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
className
|
|
9
|
-
displayValue
|
|
10
|
-
deltaType: PropTypes.string.isRequired,
|
|
11
|
-
inverted: PropTypes.bool,
|
|
7
|
+
export const Delta = ({ className, displayValue, deltaType, inverted }) => {
|
|
8
|
+
const rootClassName = cx(css.root, className, inverted && css.inverted, css[deltaType]);
|
|
9
|
+
return <span className={rootClassName}>{displayValue}</span>;
|
|
12
10
|
};
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
Delta.defaultProps = {
|
|
15
13
|
className: '',
|
|
16
14
|
inverted: false,
|
|
17
15
|
};
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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>;
|
|
17
|
+
Delta.propTypes = {
|
|
18
|
+
className: PropTypes.string,
|
|
19
|
+
displayValue: PropTypes.string.isRequired,
|
|
20
|
+
deltaType: PropTypes.string.isRequired,
|
|
21
|
+
inverted: PropTypes.bool,
|
|
27
22
|
};
|
|
28
|
-
|
|
29
|
-
Delta.defaultProps = defaultProps;
|
|
30
|
-
Delta.propTypes = propTypes;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.root {
|
|
2
2
|
white-space: nowrap;
|
|
3
|
+
color: var(--color-gray-ultra-light);
|
|
3
4
|
}
|
|
4
5
|
|
|
5
6
|
.HIGH_NEGATIVE {
|
|
@@ -7,7 +8,7 @@
|
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
.NEGATIVE {
|
|
10
|
-
color: var(--color-red);
|
|
11
|
+
color: var(--color-red-dark);
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
.LOW_NEGATIVE {
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
.POSITIVE {
|
|
22
|
-
color: var(--color-green);
|
|
23
|
+
color: var(--color-green-dark);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
.HIGH_POSITIVE {
|
|
@@ -27,38 +28,30 @@
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
.inverted {
|
|
30
|
-
|
|
31
|
-
border-radius: var(--radius-small);
|
|
32
|
-
background: var(--color-gray-ultra-light);
|
|
31
|
+
background-color: var(--color-gray-ultra-light);
|
|
33
32
|
color: var(--color-light);
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
.inverted.HIGH_NEGATIVE {
|
|
37
36
|
background: var(--color-red-dark);
|
|
38
|
-
color: var(--color-highlight-danger);
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
.inverted.NEGATIVE {
|
|
42
|
-
background: var(--color-red);
|
|
43
|
-
color: var(--color-highlight-danger);
|
|
40
|
+
background: var(--color-red-dark);
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
.inverted.LOW_NEGATIVE {
|
|
47
44
|
background: var(--color-red-light);
|
|
48
|
-
color: var(--color-highlight-danger);
|
|
49
45
|
}
|
|
50
46
|
|
|
51
47
|
.inverted.LOW_POSITIVE {
|
|
52
48
|
background: var(--color-green-light);
|
|
53
|
-
color: var(--color-highlight-success);
|
|
54
49
|
}
|
|
55
50
|
|
|
56
51
|
.inverted.POSITIVE {
|
|
57
|
-
background: var(--color-green);
|
|
58
|
-
color: var(--color-highlight-success);
|
|
52
|
+
background: var(--color-green-dark);
|
|
59
53
|
}
|
|
60
54
|
|
|
61
55
|
.inverted.HIGH_POSITIVE {
|
|
62
56
|
background: var(--color-green-dark);
|
|
63
|
-
color: var(--color-highlight-success);
|
|
64
57
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import cx from 'classnames';
|
|
4
|
-
import {
|
|
5
|
-
BUNDLE_PACKAGES_DUPLICATE,
|
|
6
|
-
METRIC_TYPE_NUMERIC,
|
|
7
|
-
METRIC_TYPES,
|
|
8
|
-
getMetricRunInfo,
|
|
9
|
-
} from '@bundle-stats/utils';
|
|
4
|
+
import { BUNDLE_PACKAGES_DUPLICATE, METRIC_TYPE_NUMERIC, METRIC_TYPES, getMetricRunInfo } from '@bundle-stats/utils';
|
|
10
5
|
|
|
11
6
|
import { Alert } from '../../ui/alert';
|
|
12
7
|
import { ComponentLink } from '../component-link';
|
|
@@ -37,9 +32,9 @@ export const DuplicatePackagesWarning = (props) => {
|
|
|
37
32
|
{showDelta && metricRunInfo.delta !== 0 && (
|
|
38
33
|
<Delta
|
|
39
34
|
className={css.titleDelta}
|
|
35
|
+
inverted
|
|
40
36
|
displayValue={metricRunInfo.displayDelta}
|
|
41
37
|
deltaType={metricRunInfo.deltaType}
|
|
42
|
-
inverted
|
|
43
38
|
/>
|
|
44
39
|
)}
|
|
45
40
|
{` duplicate ${metricRunInfo.value === 1 ? 'package' : 'packages'}.`}
|
|
@@ -17,30 +17,26 @@ 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="xxsmall">
|
|
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
|
-
<
|
|
28
|
-
className={css.metaItem}
|
|
29
|
-
title={`${formatDate(builtAt)} ${formatTime(builtAt)}`}
|
|
30
|
-
space="xxxsmall"
|
|
31
|
-
>
|
|
27
|
+
<span className={css.metaItem} title={`${formatDate(builtAt)} ${formatTime(builtAt)}`}>
|
|
32
28
|
<Icon glyph="clock" className={css.metaIcon} />
|
|
33
29
|
<span className={css.metaLabel}>
|
|
34
30
|
{formatDistanceToNow(new Date(builtAt), { addSuffix: true })}
|
|
35
31
|
</span>
|
|
36
|
-
</
|
|
32
|
+
</span>
|
|
37
33
|
)}
|
|
38
34
|
|
|
39
35
|
{hash && (
|
|
40
|
-
<
|
|
36
|
+
<span className={css.metaItem} title="Webpack bundle hash">
|
|
41
37
|
<Icon glyph="commit" className={css.metaIcon} />
|
|
42
38
|
<span className={css.metaLabel}>{hash}</span>
|
|
43
|
-
</
|
|
39
|
+
</span>
|
|
44
40
|
)}
|
|
45
41
|
|
|
46
42
|
<div className={css.content}>{children}</div>
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
.title {
|
|
2
|
-
|
|
2
|
+
line-height: 1;
|
|
3
|
+
font-weight: bold;
|
|
3
4
|
vertical-align: top;
|
|
4
5
|
}
|
|
5
6
|
|
|
6
7
|
.tag {
|
|
7
8
|
padding: var(--space-xxxsmall);
|
|
8
9
|
margin-left: var(--space-xxxsmall);
|
|
9
|
-
background: var(--color-highlight);
|
|
10
|
+
background-color: var(--color-highlight);
|
|
10
11
|
color: var(--color-text-light);
|
|
11
12
|
display: inline-block;
|
|
12
|
-
font-size:
|
|
13
|
+
font-size: 9px;
|
|
13
14
|
line-height: var(--space-xxsmall);
|
|
14
15
|
font-weight: normal;
|
|
15
16
|
vertical-align: top;
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
.meta {
|
|
20
|
+
color: var(--color-text-light);
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
.metaItem {
|
|
19
24
|
display: inline-flex;
|
|
20
25
|
align-items: center;
|
|
21
|
-
white-space: nowrap;
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
.metaIcon {
|
|
25
29
|
width: var(--space-small);
|
|
26
30
|
height: var(--space-small);
|
|
27
|
-
|
|
31
|
+
margin-right: var(--space-xxxsmall);
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
.metaLabel {
|
|
31
|
-
|
|
35
|
+
line-height: var(--space-small);
|
|
32
36
|
}
|
|
@@ -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="none">
|
|
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, anchored, children, enhanced }) => {
|
|
10
|
+
export const Metric = ({ className, value, formatter, inline, anchored, children, enhanced }) => {
|
|
11
11
|
const formattedValue = formatter(value);
|
|
12
12
|
|
|
13
13
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -16,7 +16,12 @@ export const Metric = ({ className, value, formatter, anchored, children, enhanc
|
|
|
16
16
|
? formattedValue.match(EXTRACT_VALUE_UNIT_PATTERN)
|
|
17
17
|
: [null, formattedValue, null];
|
|
18
18
|
|
|
19
|
-
const rootClassName = cx(
|
|
19
|
+
const rootClassName = cx(
|
|
20
|
+
className,
|
|
21
|
+
styles.root,
|
|
22
|
+
inline && styles.inline,
|
|
23
|
+
anchored && styles.anchored,
|
|
24
|
+
);
|
|
20
25
|
|
|
21
26
|
return (
|
|
22
27
|
<span className={rootClassName}>
|
|
@@ -33,6 +38,7 @@ Metric.defaultProps = {
|
|
|
33
38
|
className: '',
|
|
34
39
|
anchored: false,
|
|
35
40
|
enhanced: false,
|
|
41
|
+
inline: false,
|
|
36
42
|
value: 0,
|
|
37
43
|
children: [],
|
|
38
44
|
formatter: (val) => val,
|
|
@@ -41,6 +47,7 @@ Metric.defaultProps = {
|
|
|
41
47
|
Metric.propTypes = {
|
|
42
48
|
className: PropTypes.string,
|
|
43
49
|
enhanced: PropTypes.bool,
|
|
50
|
+
inline: PropTypes.bool,
|
|
44
51
|
anchored: PropTypes.bool,
|
|
45
52
|
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
46
53
|
formatter: PropTypes.func,
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
.root {
|
|
2
2
|
display: block;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
.display {
|
|
6
|
-
vertical-align: middle;
|
|
3
|
+
letter-spacing: 0.05em;
|
|
7
4
|
}
|
|
8
5
|
|
|
9
6
|
.displayUnit {
|
|
@@ -11,9 +8,7 @@
|
|
|
11
8
|
}
|
|
12
9
|
|
|
13
10
|
.delta {
|
|
14
|
-
display:
|
|
15
|
-
vertical-align: middle;
|
|
16
|
-
margin: 0 0 0 var(--space-xxxsmall);
|
|
11
|
+
display: block;
|
|
17
12
|
font-size: var(--size-xsmall);
|
|
18
13
|
}
|
|
19
14
|
|
|
@@ -28,3 +23,8 @@
|
|
|
28
23
|
line-height: 1;
|
|
29
24
|
margin-top: -2px;
|
|
30
25
|
}
|
|
26
|
+
|
|
27
|
+
.inline .delta {
|
|
28
|
+
display: inline-block;
|
|
29
|
+
margin: 0 0 0 var(--space-xxxsmall);
|
|
30
|
+
}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.input {
|
|
8
|
-
border-radius: var(--radius-medium) 0 0 var(--radius-medium);
|
|
9
8
|
height: var(--space-large);
|
|
10
9
|
border-color: var(--color-outline);
|
|
11
10
|
}
|
|
@@ -22,12 +21,12 @@
|
|
|
22
21
|
cursor: pointer;
|
|
23
22
|
border-radius: 50%;
|
|
24
23
|
position: absolute;
|
|
25
|
-
right:
|
|
24
|
+
right: 0;
|
|
26
25
|
top: 50%;
|
|
27
26
|
transform: translateY(-50%);
|
|
28
|
-
padding: var(--space-
|
|
29
|
-
width: var(--space-
|
|
30
|
-
height: var(--space-
|
|
27
|
+
padding: var(--space-xxsmall);
|
|
28
|
+
width: var(--space-large);
|
|
29
|
+
height: var(--space-large);
|
|
31
30
|
background: radial-gradient(var(--color-background) 50%, transparent);
|
|
32
31
|
color: var(--color-text-ultra-light);
|
|
33
32
|
transition: var(--transition-in);
|
|
@@ -78,13 +78,13 @@ export const SummaryItem = ({
|
|
|
78
78
|
value={current}
|
|
79
79
|
formatter={metric.formatter}
|
|
80
80
|
enhanced
|
|
81
|
+
inline
|
|
81
82
|
>
|
|
82
83
|
{showDelta && (
|
|
83
84
|
<Delta
|
|
84
85
|
className={css.delta}
|
|
85
86
|
displayValue={runInfo.displayDeltaPercentage}
|
|
86
87
|
deltaType={runInfo.deltaType}
|
|
87
|
-
inverted
|
|
88
88
|
/>
|
|
89
89
|
)}
|
|
90
90
|
</Metric>
|