@bundle-stats/ui 3.2.5 → 3.2.6-beta.3
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 +29 -0
- package/lib/components/bundle-assets/bundle-assets.js +23 -13
- package/lib/components/bundle-assets/bundle-assets.module.css +18 -26
- package/lib/components/bundle-modules/bundle-modules.js +4 -5
- package/lib/components/bundle-packages/bundle-packages.js +14 -8
- package/lib/components/bundle-packages/bundle-packages.module.css +8 -12
- package/lib/components/delta/delta.module.css +1 -0
- package/lib/components/metrics-table-search/metrics-table-search.module.css +5 -4
- package/lib/components/metrics-table-title/metrics-table-title.js +9 -7
- package/lib/components/metrics-table-title/metrics-table-title.module.css +2 -0
- package/lib/components/module-info/module-info.module.css +1 -0
- package/lib/components/summary-item/summary-item.js +14 -17
- package/lib/components/summary-item/summary-item.module.css +1 -19
- package/lib/components/total-size-type-title/total-size-type-title.js +7 -3
- package/lib/css/variables.css +3 -3
- package/lib/hooks/search-params.js +6 -6
- package/lib/layout/box/box.module.css +9 -0
- package/lib/ui/dropdown/dropdown.js +16 -26
- package/lib/ui/dropdown/dropdown.module.css +11 -12
- package/lib/ui/dropdown/dropdown.stories.js +2 -9
- package/lib/ui/filters/filters.js +10 -5
- package/lib/ui/filters/filters.module.css +10 -0
- package/lib/ui/hover-card/hover-card.js +100 -0
- package/lib/ui/hover-card/hover-card.module.css +52 -0
- package/lib/ui/hover-card/hover-card.stories.js +56 -0
- package/lib/ui/hover-card/index.js +18 -0
- package/lib/ui/icon/icon.js +6 -6
- package/lib/ui/index.js +8 -8
- package/lib/ui/table/table.module.css +0 -4
- package/lib/ui/{popover → tag}/index.js +4 -4
- package/lib/ui/tag/tag.js +72 -0
- package/lib/ui/tag/tag.module.css +55 -0
- package/lib/ui/tag/tag.stories.js +38 -0
- package/lib/ui/tooltip/tooltip.js +10 -9
- package/lib/ui/tooltip/tooltip.module.css +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.js +22 -13
- package/lib-esm/components/bundle-assets/bundle-assets.module.css +18 -26
- package/lib-esm/components/bundle-modules/bundle-modules.js +4 -5
- package/lib-esm/components/bundle-packages/bundle-packages.js +13 -8
- package/lib-esm/components/bundle-packages/bundle-packages.module.css +8 -12
- package/lib-esm/components/delta/delta.module.css +1 -0
- package/lib-esm/components/metrics-table-search/metrics-table-search.module.css +5 -4
- package/lib-esm/components/metrics-table-title/metrics-table-title.js +8 -7
- package/lib-esm/components/metrics-table-title/metrics-table-title.module.css +2 -0
- package/lib-esm/components/module-info/module-info.module.css +1 -0
- package/lib-esm/components/summary-item/summary-item.js +13 -17
- package/lib-esm/components/summary-item/summary-item.module.css +1 -19
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +6 -3
- package/lib-esm/css/variables.css +3 -3
- package/lib-esm/hooks/search-params.js +6 -6
- package/lib-esm/layout/box/box.module.css +9 -0
- package/lib-esm/ui/dropdown/dropdown.js +15 -25
- package/lib-esm/ui/dropdown/dropdown.module.css +11 -12
- package/lib-esm/ui/dropdown/dropdown.stories.js +2 -7
- package/lib-esm/ui/filters/filters.js +9 -4
- package/lib-esm/ui/filters/filters.module.css +10 -0
- package/lib-esm/ui/hover-card/hover-card.js +86 -0
- package/lib-esm/ui/hover-card/hover-card.module.css +52 -0
- package/lib-esm/ui/hover-card/hover-card.stories.js +35 -0
- package/lib-esm/ui/hover-card/index.js +1 -0
- package/lib-esm/ui/icon/icon.js +3 -3
- package/lib-esm/ui/index.js +1 -1
- package/lib-esm/ui/table/table.module.css +0 -4
- package/lib-esm/ui/tag/index.js +1 -0
- package/lib-esm/ui/tag/tag.js +45 -0
- package/lib-esm/ui/tag/tag.module.css +55 -0
- package/lib-esm/ui/tag/tag.stories.js +23 -0
- package/lib-esm/ui/tooltip/tooltip.js +10 -9
- package/lib-esm/ui/tooltip/tooltip.module.css +1 -1
- package/package.json +9 -9
- package/src/components/bundle-assets/bundle-assets.jsx +61 -42
- package/src/components/bundle-assets/bundle-assets.module.css +18 -26
- package/src/components/bundle-modules/bundle-modules.jsx +24 -14
- package/src/components/bundle-packages/bundle-packages.jsx +21 -8
- package/src/components/bundle-packages/bundle-packages.module.css +8 -12
- package/src/components/delta/delta.module.css +1 -0
- package/src/components/metrics-table-search/metrics-table-search.module.css +5 -4
- package/src/components/metrics-table-title/metrics-table-title.jsx +20 -21
- package/src/components/metrics-table-title/metrics-table-title.module.css +2 -0
- package/src/components/module-info/module-info.jsx +1 -5
- package/src/components/module-info/module-info.module.css +1 -0
- package/src/components/summary-item/summary-item.jsx +20 -26
- package/src/components/summary-item/summary-item.module.css +1 -19
- package/src/components/total-size-type-title/total-size-type-title.jsx +6 -9
- package/src/css/variables.css +3 -3
- package/src/hooks/search-params.js +18 -11
- package/src/layout/box/box.module.css +9 -0
- package/src/ui/dropdown/dropdown.jsx +12 -22
- package/src/ui/dropdown/dropdown.module.css +11 -12
- package/src/ui/filters/filters.jsx +53 -50
- package/src/ui/filters/filters.module.css +10 -0
- package/src/ui/hover-card/hover-card.jsx +79 -0
- package/src/ui/hover-card/hover-card.module.css +52 -0
- package/src/ui/hover-card/index.js +1 -0
- package/src/ui/icon/icon.jsx +11 -7
- package/src/ui/index.js +1 -1
- package/src/ui/table/table.module.css +0 -4
- package/src/ui/tag/index.js +1 -0
- package/src/ui/tag/tag.jsx +49 -0
- package/src/ui/tag/tag.module.css +55 -0
- package/src/ui/tooltip/tooltip.jsx +10 -14
- package/src/ui/tooltip/tooltip.module.css +1 -1
- package/lib/ui/popover/popover.js +0 -92
- package/lib/ui/popover/popover.module.css +0 -66
- package/lib/ui/popover/popover.stories.js +0 -26
- package/lib-esm/ui/popover/index.js +0 -1
- package/lib-esm/ui/popover/popover.js +0 -71
- package/lib-esm/ui/popover/popover.module.css +0 -66
- package/lib-esm/ui/popover/popover.stories.js +0 -14
- package/src/ui/popover/index.js +0 -1
- package/src/ui/popover/popover.jsx +0 -79
- package/src/ui/popover/popover.module.css +0 -66
|
@@ -2,15 +2,21 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import { get, map } from 'lodash';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
ASSET_ENTRY_TYPE,
|
|
7
|
+
ASSET_FILE_TYPE,
|
|
8
|
+
ASSET_FILTERS,
|
|
9
|
+
FILE_TYPE_LABELS,
|
|
10
|
+
} from '@bundle-stats/utils';
|
|
6
11
|
|
|
7
12
|
import config from '../../config.json';
|
|
8
13
|
import I18N from '../../i18n';
|
|
9
14
|
import { FlexStack } from '../../layout/flex-stack';
|
|
10
15
|
import { Icon } from '../../ui/icon';
|
|
11
16
|
import { FileName } from '../../ui/file-name';
|
|
12
|
-
import {
|
|
17
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
13
18
|
import { Tooltip } from '../../ui/tooltip';
|
|
19
|
+
import { Tag } from '../../ui/tag';
|
|
14
20
|
import { Filters } from '../../ui/filters';
|
|
15
21
|
import { SortDropdown } from '../../ui/sort-dropdown';
|
|
16
22
|
import { EmptySet } from '../../ui/empty-set';
|
|
@@ -71,47 +77,60 @@ TooltipNotPredictive.propTypes = {
|
|
|
71
77
|
runs: PropTypes.array, // eslint-disable-line react/forbid-prop-types
|
|
72
78
|
};
|
|
73
79
|
|
|
74
|
-
const getRenderRowHeader =
|
|
75
|
-
|
|
80
|
+
const getRenderRowHeader =
|
|
81
|
+
({ labels, CustomComponentLink, chunks }) =>
|
|
82
|
+
(item) => {
|
|
83
|
+
const { label, isNotPredictive, runs, isChunk, isEntry, isInitial } = item;
|
|
76
84
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
85
|
+
return (
|
|
86
|
+
<HoverCard
|
|
87
|
+
label={
|
|
88
|
+
<FlexStack space="xxxsmall" className={css.assetName}>
|
|
89
|
+
<div className={css.assetInfoFlags}>
|
|
90
|
+
{isNotPredictive && (
|
|
91
|
+
<Tooltip className={css.notPredictive} title={<TooltipNotPredictive runs={runs} />}>
|
|
92
|
+
<Icon className={css.notPredictiveIcon} glyph="warning" />
|
|
93
|
+
</Tooltip>
|
|
94
|
+
)}
|
|
95
|
+
{isChunk && (
|
|
96
|
+
<Tag
|
|
97
|
+
title="Chunk"
|
|
98
|
+
size={Tag.SIZES.SMALL}
|
|
99
|
+
kind={Tag.KINDS.INFO}
|
|
100
|
+
className={cx(css.tag, css.tagChunk)}
|
|
101
|
+
/>
|
|
102
|
+
)}
|
|
103
|
+
{isEntry && (
|
|
104
|
+
<Tag
|
|
105
|
+
title="Entrypoint"
|
|
106
|
+
size={Tag.SIZES.SMALL}
|
|
107
|
+
kind={Tag.KINDS.INFO}
|
|
108
|
+
className={cx(css.tag, css.tagEntry)}
|
|
109
|
+
/>
|
|
110
|
+
)}
|
|
111
|
+
{isInitial && (
|
|
112
|
+
<Tag
|
|
113
|
+
title="Initial"
|
|
114
|
+
size={Tag.SIZES.SMALL}
|
|
115
|
+
kind={Tag.KINDS.INFO}
|
|
116
|
+
className={cx(css.tag, css.tagInitial)}
|
|
117
|
+
/>
|
|
118
|
+
)}
|
|
119
|
+
</div>
|
|
120
|
+
<FileName name={label} />
|
|
121
|
+
</FlexStack>
|
|
122
|
+
}
|
|
123
|
+
>
|
|
124
|
+
<AssetInfo
|
|
125
|
+
className={css.assetInfo}
|
|
126
|
+
item={item}
|
|
127
|
+
labels={labels}
|
|
128
|
+
chunks={chunks}
|
|
129
|
+
CustomComponentLink={CustomComponentLink}
|
|
130
|
+
/>
|
|
131
|
+
</HoverCard>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
115
134
|
|
|
116
135
|
export const BundleAssets = (props) => {
|
|
117
136
|
const {
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
margin-right: -1px; /** collapse border */
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
.assetName {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
11
16
|
.notPredictive {
|
|
12
17
|
margin-right: var(--space-xxsmall);
|
|
13
18
|
display: inline-block;
|
|
@@ -30,41 +35,28 @@
|
|
|
30
35
|
display: none;
|
|
31
36
|
}
|
|
32
37
|
|
|
33
|
-
.
|
|
34
|
-
display: inline-block;
|
|
35
|
-
width: var(--space-xsmall);
|
|
36
|
-
height: var(--space-xsmall);
|
|
37
|
-
font-family: var(--font-family);
|
|
38
|
-
font-size: 8px;
|
|
39
|
-
font-weight: bold;
|
|
40
|
-
background: var(--color-highlight);
|
|
41
|
-
color: var(--color-text-light);
|
|
42
|
-
line-height: var(--space-xsmall);
|
|
43
|
-
text-align: center;
|
|
44
|
-
text-transform: uppercase;
|
|
45
|
-
vertical-align: middle;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.flag + .flag {
|
|
38
|
+
.tag + .tag {
|
|
49
39
|
margin-left: 2px;
|
|
50
40
|
}
|
|
51
41
|
|
|
52
|
-
.
|
|
53
|
-
composes: flag;
|
|
42
|
+
.tagEntry {
|
|
54
43
|
background: var(--color-info-light);
|
|
55
|
-
color: var(--color-background);
|
|
56
44
|
}
|
|
57
45
|
|
|
58
|
-
.
|
|
59
|
-
|
|
46
|
+
.tagEntry::before {
|
|
47
|
+
content: 'e';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.tagInitial {
|
|
60
51
|
background: var(--color-info-light);
|
|
61
|
-
color: var(--color-background);
|
|
62
52
|
}
|
|
63
53
|
|
|
64
|
-
.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
54
|
+
.tagInitial::before {
|
|
55
|
+
content: 'i';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.tagChunk::before {
|
|
59
|
+
content: 'c';
|
|
68
60
|
}
|
|
69
61
|
|
|
70
62
|
/* Tooltip not predictive */
|
|
@@ -18,7 +18,7 @@ import { FlexStack } from '../../layout/flex-stack';
|
|
|
18
18
|
import { EmptySet } from '../../ui/empty-set';
|
|
19
19
|
import { FileName } from '../../ui/file-name';
|
|
20
20
|
import { Filters } from '../../ui/filters';
|
|
21
|
-
import {
|
|
21
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
22
22
|
import { SortDropdown } from '../../ui/sort-dropdown';
|
|
23
23
|
import { Toolbar } from '../../ui/toolbar';
|
|
24
24
|
import { MetricsTable } from '../metrics-table';
|
|
@@ -37,11 +37,11 @@ const RowHeader = ({ row, chunks, labels, CustomComponentLink }) => {
|
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<div onMouseEnter={handleOnMouseEnter}>
|
|
40
|
-
{!showPopopver ?
|
|
40
|
+
{!showPopopver ? (
|
|
41
41
|
content
|
|
42
|
-
|
|
43
|
-
<
|
|
44
|
-
{({
|
|
42
|
+
) : (
|
|
43
|
+
<HoverCard label={content}>
|
|
44
|
+
{({ close }) => (
|
|
45
45
|
<ModuleInfo
|
|
46
46
|
className={css.namePopover}
|
|
47
47
|
item={row}
|
|
@@ -49,10 +49,10 @@ const RowHeader = ({ row, chunks, labels, CustomComponentLink }) => {
|
|
|
49
49
|
chunkIds={chunkIds}
|
|
50
50
|
labels={labels}
|
|
51
51
|
customComponentLink={CustomComponentLink}
|
|
52
|
-
onClick={
|
|
52
|
+
onClick={close}
|
|
53
53
|
/>
|
|
54
54
|
)}
|
|
55
|
-
</
|
|
55
|
+
</HoverCard>
|
|
56
56
|
)}
|
|
57
57
|
</div>
|
|
58
58
|
);
|
|
@@ -76,9 +76,17 @@ RowHeader.defaultProps = {
|
|
|
76
76
|
chunks: [],
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
-
const getRenderRowHeader =
|
|
80
|
-
|
|
81
|
-
)
|
|
79
|
+
const getRenderRowHeader =
|
|
80
|
+
({ labels, chunks, CustomComponentLink }) =>
|
|
81
|
+
(row) =>
|
|
82
|
+
(
|
|
83
|
+
<RowHeader
|
|
84
|
+
row={row}
|
|
85
|
+
chunks={chunks}
|
|
86
|
+
labels={labels}
|
|
87
|
+
CustomComponentLink={CustomComponentLink}
|
|
88
|
+
/>
|
|
89
|
+
);
|
|
82
90
|
|
|
83
91
|
export const BundleModules = ({
|
|
84
92
|
className,
|
|
@@ -240,10 +248,12 @@ BundleModules.propTypes = {
|
|
|
240
248
|
jobs: PropTypes.array, // eslint-disable-line react/forbid-prop-types
|
|
241
249
|
|
|
242
250
|
/** Chunks data */
|
|
243
|
-
chunks: PropTypes.arrayOf(
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
251
|
+
chunks: PropTypes.arrayOf(
|
|
252
|
+
PropTypes.shape({
|
|
253
|
+
id: PropTypes.string,
|
|
254
|
+
name: PropTypes.string,
|
|
255
|
+
}),
|
|
256
|
+
).isRequired,
|
|
247
257
|
|
|
248
258
|
/** total row count */
|
|
249
259
|
totalRowCount: PropTypes.number,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {useCallback} from 'react';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import {
|
|
@@ -15,8 +15,9 @@ import { Stack } from '../../layout/stack';
|
|
|
15
15
|
import { FlexStack } from '../../layout/flex-stack';
|
|
16
16
|
import { EmptySet } from '../../ui/empty-set';
|
|
17
17
|
import { Filters } from '../../ui/filters';
|
|
18
|
-
import {
|
|
18
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
19
19
|
import { SortDropdown } from '../../ui/sort-dropdown';
|
|
20
|
+
import { Tag } from '../../ui/tag';
|
|
20
21
|
import { Toolbar } from '../../ui/toolbar';
|
|
21
22
|
import { FileName } from '../../ui/file-name';
|
|
22
23
|
import { ComponentLink } from '../component-link';
|
|
@@ -27,7 +28,8 @@ import { MetricsTableTitle } from '../metrics-table-title';
|
|
|
27
28
|
import css from './bundle-packages.module.css';
|
|
28
29
|
|
|
29
30
|
const PackagePopoverContent = ({ name, fullName, path, duplicate, CustomComponentLink }) => {
|
|
30
|
-
const normalizedPackagePath =
|
|
31
|
+
const normalizedPackagePath =
|
|
32
|
+
path || `node_modules/${fullName.split(PACKAGES_SEPARATOR).join('/node_modules/')}/`;
|
|
31
33
|
const [normalizedName, packageId] = name.split(PACKAGE_ID_SEPARATOR);
|
|
32
34
|
|
|
33
35
|
return (
|
|
@@ -105,13 +107,24 @@ const PackageRowHeader = ({ item, CustomComponentLink }) => {
|
|
|
105
107
|
{packageNames.map((packageName, index) => {
|
|
106
108
|
// Render duplicate flag only for the last entry
|
|
107
109
|
const duplicateFlag = index === packageNames.length - 1 && item.duplicate && (
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
<Tag
|
|
111
|
+
title="Duplicate package"
|
|
112
|
+
kind={Tag.KINDS.DANGER}
|
|
113
|
+
size={Tag.SIZES.SMALL}
|
|
114
|
+
className={css.tagDuplicate}
|
|
115
|
+
/>
|
|
111
116
|
);
|
|
112
117
|
|
|
113
118
|
return (
|
|
114
|
-
<
|
|
119
|
+
<HoverCard
|
|
120
|
+
className={css.packageName}
|
|
121
|
+
label={
|
|
122
|
+
<FlexStack space="xxxsmall" className={css.packageNameLabel}>
|
|
123
|
+
{duplicateFlag}
|
|
124
|
+
<span>{packageName}</span>
|
|
125
|
+
</FlexStack>
|
|
126
|
+
}
|
|
127
|
+
>
|
|
115
128
|
<PackagePopoverContent
|
|
116
129
|
name={packageName}
|
|
117
130
|
path={path}
|
|
@@ -119,7 +132,7 @@ const PackageRowHeader = ({ item, CustomComponentLink }) => {
|
|
|
119
132
|
duplicate={item.duplicate}
|
|
120
133
|
CustomComponentLink={CustomComponentLink}
|
|
121
134
|
/>
|
|
122
|
-
</
|
|
135
|
+
</HoverCard>
|
|
123
136
|
);
|
|
124
137
|
})}
|
|
125
138
|
</span>
|
|
@@ -12,20 +12,12 @@
|
|
|
12
12
|
margin-right: -1px; /** collapse border */
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.
|
|
15
|
+
.tagDuplicate {
|
|
16
16
|
margin-right: var(--space-xxxsmall);
|
|
17
|
-
|
|
18
|
-
width: var(--space-small);
|
|
19
|
-
height: var(--space-small);
|
|
20
|
-
font-size: 10px;
|
|
21
|
-
font-weight: bold;
|
|
22
|
-
line-height: var(--space-small);
|
|
23
|
-
text-align: center;
|
|
24
|
-
text-transform: uppercase;
|
|
25
|
-
vertical-align: middle;
|
|
17
|
+
}
|
|
26
18
|
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
.tagDuplicate::before {
|
|
20
|
+
content: 'd';
|
|
29
21
|
}
|
|
30
22
|
|
|
31
23
|
.packageName {
|
|
@@ -43,6 +35,10 @@
|
|
|
43
35
|
color: var(--color-text-ultra-light);
|
|
44
36
|
}
|
|
45
37
|
|
|
38
|
+
.packageNameLabel {
|
|
39
|
+
align-items: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
46
42
|
.packagePopover {
|
|
47
43
|
min-width: 320px;
|
|
48
44
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.input {
|
|
8
|
+
border-radius: var(--radius-small) 0 0 var(--radius-small);
|
|
8
9
|
height: var(--space-large);
|
|
9
10
|
border-color: var(--color-outline);
|
|
10
11
|
}
|
|
@@ -21,12 +22,12 @@
|
|
|
21
22
|
cursor: pointer;
|
|
22
23
|
border-radius: 50%;
|
|
23
24
|
position: absolute;
|
|
24
|
-
right:
|
|
25
|
+
right: 2px;
|
|
25
26
|
top: 50%;
|
|
26
27
|
transform: translateY(-50%);
|
|
27
|
-
padding: var(--space-
|
|
28
|
-
width: var(--space-
|
|
29
|
-
height: var(--space-
|
|
28
|
+
padding: var(--space-xxxsmall);
|
|
29
|
+
width: var(--space-medium);
|
|
30
|
+
height: var(--space-medium);
|
|
30
31
|
background: radial-gradient(var(--color-background) 50%, transparent);
|
|
31
32
|
color: var(--color-text-ultra-light);
|
|
32
33
|
transition: var(--transition-in);
|
|
@@ -5,7 +5,8 @@ import cx from 'classnames';
|
|
|
5
5
|
import I18N from '../../i18n';
|
|
6
6
|
import { FlexStack } from '../../layout/flex-stack';
|
|
7
7
|
import { Stack } from '../../layout/stack';
|
|
8
|
-
import {
|
|
8
|
+
import { Icon } from '../../ui/icon';
|
|
9
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
9
10
|
import css from './metrics-table-title.module.css';
|
|
10
11
|
|
|
11
12
|
export const MetricsTableTitle = (props) => {
|
|
@@ -13,26 +14,24 @@ export const MetricsTableTitle = (props) => {
|
|
|
13
14
|
const rootClassName = cx(css.root, className);
|
|
14
15
|
|
|
15
16
|
return (
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</FlexStack>
|
|
35
|
-
</Stack>
|
|
17
|
+
<FlexStack space="xxxsmall" className={rootClassName}>
|
|
18
|
+
<span>{title}</span>
|
|
19
|
+
{info && <span className={css.info}>{info}</span>}
|
|
20
|
+
{(popoverInfo || popoverHref) && (
|
|
21
|
+
<HoverCard label={<Icon glyph="help" />}>
|
|
22
|
+
<Stack space="xxxsmall">
|
|
23
|
+
{popoverInfo && <p>{popoverInfo}</p>}
|
|
24
|
+
{popoverHref && (
|
|
25
|
+
<p>
|
|
26
|
+
<a href={popoverHref} target="_blank" rel="noreferrer">
|
|
27
|
+
{I18N.READ_MORE}
|
|
28
|
+
</a>
|
|
29
|
+
</p>
|
|
30
|
+
)}
|
|
31
|
+
</Stack>
|
|
32
|
+
</HoverCard>
|
|
33
|
+
)}
|
|
34
|
+
</FlexStack>
|
|
36
35
|
);
|
|
37
36
|
};
|
|
38
37
|
|
|
@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import { getGlobalMetricType, getMetricRunInfo } from '@bundle-stats/utils';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
7
|
+
import { Icon } from '../../ui/icon';
|
|
7
8
|
import { Skeleton } from '../../ui/skeleton';
|
|
8
9
|
import { Stack } from '../../layout/stack';
|
|
9
10
|
import { FlexStack } from '../../layout/flex-stack';
|
|
@@ -11,32 +12,25 @@ import { Metric } from '../metric';
|
|
|
11
12
|
import { Delta } from '../delta';
|
|
12
13
|
import css from './summary-item.module.css';
|
|
13
14
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</p>
|
|
29
|
-
)}
|
|
30
|
-
</Stack>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
MetricInfoPopover.propTypes = {
|
|
15
|
+
const MetricInfo = ({ description, url }) => (
|
|
16
|
+
<Stack space="xxxsmall">
|
|
17
|
+
<p>{description}</p>
|
|
18
|
+
{url && (
|
|
19
|
+
<p>
|
|
20
|
+
<a href={url} className={css.readMoreLink}>
|
|
21
|
+
Read more
|
|
22
|
+
</a>
|
|
23
|
+
</p>
|
|
24
|
+
)}
|
|
25
|
+
</Stack>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
MetricInfo.propTypes = {
|
|
35
29
|
description: PropTypes.string.isRequired,
|
|
36
30
|
url: PropTypes.string,
|
|
37
31
|
};
|
|
38
32
|
|
|
39
|
-
|
|
33
|
+
MetricInfo.defaultProps = {
|
|
40
34
|
url: '',
|
|
41
35
|
};
|
|
42
36
|
|
|
@@ -65,9 +59,9 @@ export const SummaryItem = ({
|
|
|
65
59
|
<span>{metric.label}</span>
|
|
66
60
|
|
|
67
61
|
{showMetricDescriptionTooltip && (
|
|
68
|
-
<
|
|
69
|
-
<
|
|
70
|
-
</
|
|
62
|
+
<HoverCard className={css.icon} label={<Icon glyph="help" />}>
|
|
63
|
+
<MetricInfo {...metric} />
|
|
64
|
+
</HoverCard>
|
|
71
65
|
)}
|
|
72
66
|
</FlexStack>
|
|
73
67
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.title {
|
|
2
|
+
align-items: center;
|
|
2
3
|
color: var(--color-text-ultra-light);
|
|
3
4
|
font-weight: bold;
|
|
4
5
|
font-size: var(--size-xsmall);
|
|
@@ -7,25 +8,6 @@
|
|
|
7
8
|
white-space: nowrap;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
.readMoreBtn {
|
|
11
|
-
appearance: none;
|
|
12
|
-
padding: 0;
|
|
13
|
-
border: 0;
|
|
14
|
-
background: none;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
/* simulate link */
|
|
17
|
-
color: var(--color-primary);
|
|
18
|
-
text-decoration: underline;
|
|
19
|
-
line-height: var(--space-small);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.readMoreBtn:hover,
|
|
23
|
-
.readMoreBtn:active,
|
|
24
|
-
.readMoreBtn:focus {
|
|
25
|
-
color: var(--color-primary-dark);
|
|
26
|
-
text-decoration: none;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
11
|
.currentMetric {
|
|
30
12
|
display: block;
|
|
31
13
|
color: var(--color-heading);
|
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import cx from 'classnames'
|
|
3
|
+
import cx from 'classnames';
|
|
4
4
|
|
|
5
5
|
import config from '../../config.json';
|
|
6
6
|
import I18N from '../../i18n';
|
|
7
7
|
import { FlexStack } from '../../layout/flex-stack';
|
|
8
8
|
import { Stack } from '../../layout/stack';
|
|
9
|
-
import {
|
|
9
|
+
import { Icon } from '../../ui/icon';
|
|
10
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
10
11
|
import css from './total-size-type-title.module.css';
|
|
11
12
|
|
|
12
13
|
export const TotalSizeTypeTitle = ({ className }) => (
|
|
13
14
|
<FlexStack space="xxxsmall" className={cx(css.title, className)}>
|
|
14
15
|
<span>{I18N.ASSET_TOTALS}</span>
|
|
15
|
-
<
|
|
16
|
+
<HoverCard label={<Icon glyph="help" />}>
|
|
16
17
|
<Stack space="xxxsmall">
|
|
17
18
|
<p>{I18N.ASSET_TOTALS_INFO}</p>
|
|
18
19
|
<p>
|
|
19
|
-
<a
|
|
20
|
-
href={config.documentation.assets}
|
|
21
|
-
target="_blank"
|
|
22
|
-
rel="noreferrer"
|
|
23
|
-
>
|
|
20
|
+
<a href={config.documentation.assets} target="_blank" rel="noreferrer">
|
|
24
21
|
{I18N.READ_MORE}
|
|
25
22
|
</a>
|
|
26
23
|
</p>
|
|
27
24
|
</Stack>
|
|
28
|
-
</
|
|
25
|
+
</HoverCard>
|
|
29
26
|
</FlexStack>
|
|
30
27
|
);
|
|
31
28
|
|
package/src/css/variables.css
CHANGED
|
@@ -181,9 +181,9 @@
|
|
|
181
181
|
--layer-high: 1000;
|
|
182
182
|
--layer-xhigh: 10000;
|
|
183
183
|
|
|
184
|
-
--radius-small:
|
|
185
|
-
--radius-medium: var(--space-
|
|
186
|
-
--radius-large: var(--space-
|
|
184
|
+
--radius-small: 2px;
|
|
185
|
+
--radius-medium: var(--space-xxxsmall);
|
|
186
|
+
--radius-large: var(--space-xxsmall);
|
|
187
187
|
|
|
188
188
|
/** Layout */
|
|
189
189
|
--max-width: 80rem;
|