@bundle-stats/ui 3.2.2-beta.0 → 3.2.4-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 +26 -1
- package/lib/app/app.js +1 -1
- package/lib/app/app.stories.js +2 -2
- package/lib/components/browsertime-table/browsertime-table.js +1 -1
- package/lib/components/browsertime-table/browsertime-table.stories.js +1 -1
- package/lib/components/bundle-assets/bundle-assets.js +12 -10
- package/lib/components/bundle-assets/bundle-assets.module.css +5 -0
- package/lib/components/bundle-assets/bundle-assets.utils.js +2 -2
- package/lib/components/bundle-assets/index.js +3 -3
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +1 -1
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.js +1 -1
- package/lib/components/bundle-modules/bundle-modules.js +37 -66
- package/lib/components/bundle-modules/bundle-modules.module.css +0 -4
- package/lib/components/bundle-modules/bundle-modules.utils.js +2 -2
- package/lib/components/bundle-modules/index.js +3 -3
- package/lib/components/bundle-packages/bundle-packages.js +30 -25
- package/lib/components/bundle-packages/bundle-packages.module.css +37 -20
- package/lib/components/bundle-packages/bundle-packages.utils.js +2 -2
- package/lib/components/bundle-packages/index.js +1 -1
- package/lib/components/lighthouse-table/lighthouse-table.js +1 -1
- package/lib/components/metrics-table/metrics-table.js +1 -1
- package/lib/components/metrics-table-search/metrics-table-search.js +1 -1
- package/lib/components/metrics-table-search/metrics-table-search.stories.js +1 -1
- package/lib/components/metrics-table-title/metrics-table-title.js +7 -3
- package/lib/components/summary-item/summary-item.js +16 -18
- package/lib/components/total-size-type-title/total-size-type-title.js +7 -3
- package/lib/constants.js +2 -2
- package/lib/hooks/search-params.js +2 -2
- package/lib/query-state.js +1 -1
- package/lib/stories/wrapper.js +2 -2
- package/lib/ui/dropdown/dropdown.js +15 -19
- package/lib/ui/filters/filters.container.js +5 -5
- package/lib/ui/filters/filters.js +5 -7
- package/lib/ui/filters/filters.stories.js +3 -3
- package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.js +3 -3
- package/lib/ui/hover-card/hover-card.js +65 -0
- package/lib/ui/hover-card/hover-card.module.css +29 -0
- package/lib/ui/hover-card/hover-card.stories.js +26 -0
- package/lib/ui/{popover → hover-card}/index.js +4 -4
- package/lib/ui/icon/icon.module.css +1 -0
- package/lib/ui/index.js +8 -8
- package/lib/ui/panels/panels.js +2 -2
- package/lib/ui/sort-dropdown/sort-dropdown.js +2 -5
- package/lib/ui/tabs/tabs.js +2 -2
- package/lib/ui/tooltip/tooltip.js +22 -14
- package/lib/ui/tooltip/tooltip.module.css +5 -3
- package/lib/utils.js +2 -2
- package/lib-esm/components/bundle-assets/bundle-assets.js +9 -7
- package/lib-esm/components/bundle-assets/bundle-assets.module.css +5 -0
- package/lib-esm/components/bundle-modules/bundle-modules.js +17 -29
- package/lib-esm/components/bundle-modules/bundle-modules.module.css +0 -4
- package/lib-esm/components/bundle-packages/bundle-packages.js +28 -23
- package/lib-esm/components/bundle-packages/bundle-packages.module.css +37 -20
- package/lib-esm/components/metrics-table-title/metrics-table-title.js +6 -3
- package/lib-esm/components/summary-item/summary-item.js +15 -18
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +6 -3
- package/lib-esm/ui/dropdown/dropdown.js +9 -19
- package/lib-esm/ui/filters/filters.container.js +39 -41
- package/lib-esm/ui/filters/filters.js +3 -5
- package/lib-esm/ui/hover-card/hover-card.js +45 -0
- package/lib-esm/ui/hover-card/hover-card.module.css +29 -0
- package/lib-esm/ui/hover-card/hover-card.stories.js +9 -0
- package/lib-esm/ui/hover-card/index.js +1 -0
- package/lib-esm/ui/icon/icon.module.css +1 -0
- package/lib-esm/ui/index.js +1 -1
- package/lib-esm/ui/sort-dropdown/sort-dropdown.js +2 -5
- package/lib-esm/ui/tooltip/tooltip.js +15 -14
- package/lib-esm/ui/tooltip/tooltip.module.css +5 -3
- package/package.json +33 -30
- package/src/components/bundle-assets/bundle-assets.jsx +51 -42
- package/src/components/bundle-assets/bundle-assets.module.css +5 -0
- package/src/components/bundle-modules/bundle-modules.jsx +28 -31
- package/src/components/bundle-modules/bundle-modules.module.css +0 -4
- package/src/components/bundle-packages/bundle-packages.jsx +31 -25
- package/src/components/bundle-packages/bundle-packages.module.css +37 -20
- package/src/components/metrics-table-options/metrics-table-options.jsx +1 -1
- package/src/components/metrics-table-title/metrics-table-title.jsx +4 -3
- package/src/components/summary-item/summary-item.jsx +21 -26
- package/src/components/total-size-type-title/total-size-type-title.jsx +6 -9
- package/src/ui/dropdown/dropdown.jsx +14 -18
- package/src/ui/filters/filters.jsx +30 -39
- package/src/ui/hover-card/hover-card.jsx +42 -0
- package/src/ui/hover-card/hover-card.module.css +29 -0
- package/src/ui/hover-card/index.js +1 -0
- package/src/ui/icon/icon.module.css +1 -0
- package/src/ui/index.js +1 -1
- package/src/ui/sort-dropdown/sort-dropdown.jsx +9 -11
- package/src/ui/tooltip/tooltip.jsx +20 -27
- package/src/ui/tooltip/tooltip.module.css +5 -3
- 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bundle-stats/ui",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4-alpha.0",
|
|
4
4
|
"description": "UI components for BundleStats projects.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -36,38 +36,38 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/relative-ci/bundle-stats/blob/master/packages/ui#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/cli": "7.16.
|
|
40
|
-
"@babel/core": "7.16.
|
|
41
|
-
"@babel/plugin-proposal-class-properties": "7.16.
|
|
42
|
-
"@babel/preset-env": "7.16.
|
|
43
|
-
"@babel/preset-react": "7.16.
|
|
39
|
+
"@babel/cli": "7.16.8",
|
|
40
|
+
"@babel/core": "7.16.7",
|
|
41
|
+
"@babel/plugin-proposal-class-properties": "7.16.7",
|
|
42
|
+
"@babel/preset-env": "7.16.8",
|
|
43
|
+
"@babel/preset-react": "7.16.7",
|
|
44
44
|
"@simplyianm/babel-plugin-inline-react-svg": "1.2.0",
|
|
45
45
|
"@storybook/addon-knobs": "6.4.0",
|
|
46
46
|
"@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.
|
|
47
|
+
"@storybook/addon-storyshots": "6.4.12",
|
|
48
|
+
"@storybook/addons": "6.4.12",
|
|
49
|
+
"@storybook/builder-webpack5": "6.4.12",
|
|
50
|
+
"@storybook/manager-webpack5": "6.4.12",
|
|
51
|
+
"@storybook/react": "6.4.12",
|
|
52
52
|
"babel-core": "7.0.0-bridge.0",
|
|
53
|
-
"babel-jest": "27.4.
|
|
53
|
+
"babel-jest": "27.4.6",
|
|
54
54
|
"babel-plugin-lodash": "3.3.4",
|
|
55
55
|
"babel-plugin-require-context-hook": "1.0.0",
|
|
56
|
-
"chromatic": "6.
|
|
56
|
+
"chromatic": "6.3.4",
|
|
57
57
|
"classnames": "2.3.1",
|
|
58
58
|
"colormap": "2.3.2",
|
|
59
|
-
"core-js": "3.
|
|
59
|
+
"core-js": "3.20.2",
|
|
60
60
|
"cross-env": "7.0.3",
|
|
61
61
|
"enzyme": "3.11.0",
|
|
62
62
|
"enzyme-adapter-react-16": "1.15.6",
|
|
63
63
|
"enzyme-to-json": "3.6.2",
|
|
64
64
|
"hex-rgb": "5.0.0",
|
|
65
65
|
"identity-obj-proxy": "3.0.0",
|
|
66
|
-
"jest": "27.4.
|
|
66
|
+
"jest": "27.4.7",
|
|
67
67
|
"jest-date-mock": "1.0.8",
|
|
68
68
|
"lodash": "4.17.21",
|
|
69
|
-
"postcss": "8.4.
|
|
70
|
-
"prop-types": "15.
|
|
69
|
+
"postcss": "8.4.5",
|
|
70
|
+
"prop-types": "15.8.1",
|
|
71
71
|
"react": "16.14.0",
|
|
72
72
|
"react-dom": "16.14.0",
|
|
73
73
|
"react-router-dom": "5.3.0",
|
|
@@ -75,20 +75,23 @@
|
|
|
75
75
|
"rimraf": "3.0.2"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"classnames": "
|
|
79
|
-
"core-js": "
|
|
80
|
-
"lodash": "
|
|
81
|
-
"prop-types": "
|
|
82
|
-
"react": "
|
|
83
|
-
"react-dom": "
|
|
84
|
-
"react-router-dom": "
|
|
78
|
+
"classnames": "2.2.6",
|
|
79
|
+
"core-js": "3.16.2",
|
|
80
|
+
"lodash": "4.17.21",
|
|
81
|
+
"prop-types": "15.7.2",
|
|
82
|
+
"react": "16.14.0",
|
|
83
|
+
"react-dom": "16.14.0",
|
|
84
|
+
"react-router-dom": "5.3.0"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@bundle-stats/utils": "^3.2.
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
87
|
+
"@bundle-stats/utils": "^3.2.4-alpha.0",
|
|
88
|
+
"@radix-ui/react-dropdown-menu": "0.1.3",
|
|
89
|
+
"@radix-ui/react-hover-card": "0.1.3",
|
|
90
|
+
"@radix-ui/react-tooltip": "0.1.3",
|
|
91
|
+
"date-fns": "2.28.0",
|
|
92
|
+
"query-string": "7.1.0",
|
|
93
|
+
"reakit": "1.3.11",
|
|
94
|
+
"use-query-params": "1.2.3"
|
|
92
95
|
},
|
|
93
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "4387528449c1ea441c018705c2d08437b2352797"
|
|
94
97
|
}
|
|
@@ -2,14 +2,19 @@ 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';
|
|
14
19
|
import { Filters } from '../../ui/filters';
|
|
15
20
|
import { SortDropdown } from '../../ui/sort-dropdown';
|
|
@@ -71,47 +76,51 @@ TooltipNotPredictive.propTypes = {
|
|
|
71
76
|
runs: PropTypes.array, // eslint-disable-line react/forbid-prop-types
|
|
72
77
|
};
|
|
73
78
|
|
|
74
|
-
const getRenderRowHeader =
|
|
75
|
-
|
|
79
|
+
const getRenderRowHeader =
|
|
80
|
+
({ labels, CustomComponentLink, chunks }) =>
|
|
81
|
+
(item) => {
|
|
82
|
+
const { label, isNotPredictive, runs, isChunk, isEntry, isInitial } = item;
|
|
76
83
|
|
|
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
|
-
|
|
84
|
+
return (
|
|
85
|
+
<HoverCard
|
|
86
|
+
label={
|
|
87
|
+
<FlexStack space="xxxsmall" className={css.assetName}>
|
|
88
|
+
<div className={css.assetInfoFlags}>
|
|
89
|
+
{isNotPredictive && (
|
|
90
|
+
<Tooltip className={css.notPredictive} title={<TooltipNotPredictive runs={runs} />}>
|
|
91
|
+
<Icon className={css.notPredictiveIcon} glyph="warning" />
|
|
92
|
+
</Tooltip>
|
|
93
|
+
)}
|
|
94
|
+
{isChunk && (
|
|
95
|
+
<span title="Chunk" className={css.flagChunk}>
|
|
96
|
+
c
|
|
97
|
+
</span>
|
|
98
|
+
)}
|
|
99
|
+
{isEntry && (
|
|
100
|
+
<span title="Entrypoint" className={css.flagEntry}>
|
|
101
|
+
e
|
|
102
|
+
</span>
|
|
103
|
+
)}
|
|
104
|
+
{isInitial && (
|
|
105
|
+
<span title="Initial" className={css.flagInitial}>
|
|
106
|
+
i
|
|
107
|
+
</span>
|
|
108
|
+
)}
|
|
109
|
+
</div>
|
|
110
|
+
<FileName name={label} />
|
|
111
|
+
</FlexStack>
|
|
112
|
+
}
|
|
113
|
+
>
|
|
114
|
+
<AssetInfo
|
|
115
|
+
className={css.assetInfo}
|
|
116
|
+
item={item}
|
|
117
|
+
labels={labels}
|
|
118
|
+
chunks={chunks}
|
|
119
|
+
CustomComponentLink={CustomComponentLink}
|
|
120
|
+
/>
|
|
121
|
+
</HoverCard>
|
|
122
|
+
);
|
|
123
|
+
};
|
|
115
124
|
|
|
116
125
|
export const BundleAssets = (props) => {
|
|
117
126
|
const {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import { get, isEmpty, map } from 'lodash';
|
|
@@ -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';
|
|
@@ -30,31 +30,18 @@ import css from './bundle-modules.module.css';
|
|
|
30
30
|
|
|
31
31
|
const RowHeader = ({ row, chunks, labels, CustomComponentLink }) => {
|
|
32
32
|
const chunkIds = map(chunks, 'id');
|
|
33
|
-
|
|
34
|
-
const [showPopopver, setPopover] = useState(false);
|
|
35
|
-
const handleOnMouseEnter = useCallback(() => setPopover(true), [showPopopver]);
|
|
36
33
|
const content = <FileName name={row.label} />;
|
|
37
34
|
|
|
38
35
|
return (
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
chunks={chunks}
|
|
49
|
-
chunkIds={chunkIds}
|
|
50
|
-
labels={labels}
|
|
51
|
-
customComponentLink={CustomComponentLink}
|
|
52
|
-
onClick={popoverToggle}
|
|
53
|
-
/>
|
|
54
|
-
)}
|
|
55
|
-
</Popover>
|
|
56
|
-
)}
|
|
57
|
-
</div>
|
|
36
|
+
<HoverCard label={content}>
|
|
37
|
+
<ModuleInfo
|
|
38
|
+
item={row}
|
|
39
|
+
chunks={chunks}
|
|
40
|
+
chunkIds={chunkIds}
|
|
41
|
+
labels={labels}
|
|
42
|
+
customComponentLink={CustomComponentLink}
|
|
43
|
+
/>
|
|
44
|
+
</HoverCard>
|
|
58
45
|
);
|
|
59
46
|
};
|
|
60
47
|
|
|
@@ -76,9 +63,17 @@ RowHeader.defaultProps = {
|
|
|
76
63
|
chunks: [],
|
|
77
64
|
};
|
|
78
65
|
|
|
79
|
-
const getRenderRowHeader =
|
|
80
|
-
|
|
81
|
-
)
|
|
66
|
+
const getRenderRowHeader =
|
|
67
|
+
({ labels, chunks, CustomComponentLink }) =>
|
|
68
|
+
(row) =>
|
|
69
|
+
(
|
|
70
|
+
<RowHeader
|
|
71
|
+
row={row}
|
|
72
|
+
chunks={chunks}
|
|
73
|
+
labels={labels}
|
|
74
|
+
CustomComponentLink={CustomComponentLink}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
82
77
|
|
|
83
78
|
export const BundleModules = ({
|
|
84
79
|
className,
|
|
@@ -240,10 +235,12 @@ BundleModules.propTypes = {
|
|
|
240
235
|
jobs: PropTypes.array, // eslint-disable-line react/forbid-prop-types
|
|
241
236
|
|
|
242
237
|
/** Chunks data */
|
|
243
|
-
chunks: PropTypes.arrayOf(
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
238
|
+
chunks: PropTypes.arrayOf(
|
|
239
|
+
PropTypes.shape({
|
|
240
|
+
id: PropTypes.string,
|
|
241
|
+
name: PropTypes.string,
|
|
242
|
+
}),
|
|
243
|
+
).isRequired,
|
|
247
244
|
|
|
248
245
|
/** total row count */
|
|
249
246
|
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,7 +15,7 @@ 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
20
|
import { Toolbar } from '../../ui/toolbar';
|
|
21
21
|
import { FileName } from '../../ui/file-name';
|
|
@@ -26,28 +26,29 @@ import { MetricsTableOptions } from '../metrics-table-options';
|
|
|
26
26
|
import { MetricsTableTitle } from '../metrics-table-title';
|
|
27
27
|
import css from './bundle-packages.module.css';
|
|
28
28
|
|
|
29
|
-
const
|
|
30
|
-
const normalizedPackagePath =
|
|
29
|
+
const PackageCard = ({ name, fullName, path, duplicate, CustomComponentLink }) => {
|
|
30
|
+
const normalizedPackagePath =
|
|
31
|
+
path || `node_modules/${fullName.split(PACKAGES_SEPARATOR).join('/node_modules/')}/`;
|
|
31
32
|
const [normalizedName, packageId] = name.split(PACKAGE_ID_SEPARATOR);
|
|
32
33
|
|
|
33
34
|
return (
|
|
34
|
-
<Stack space="xxsmall" className={css.
|
|
35
|
+
<Stack space="xxsmall" className={css.packageCard}>
|
|
35
36
|
<Stack space="xxxsmall">
|
|
36
|
-
<h3 className={css.
|
|
37
|
+
<h3 className={css.packageCardTitle}>
|
|
37
38
|
{normalizedName}
|
|
38
39
|
{packageId && (
|
|
39
|
-
<span className={css.
|
|
40
|
+
<span className={css.packageCardTitleIndex}>
|
|
40
41
|
{`${PACKAGE_ID_SEPARATOR}${packageId}`}
|
|
41
42
|
</span>
|
|
42
43
|
)}
|
|
43
44
|
</h3>
|
|
44
|
-
<p className={css.
|
|
45
|
-
<FileName className={css.
|
|
45
|
+
<p className={css.packageCardPath}>
|
|
46
|
+
<FileName className={css.packageCardPathValue} name={normalizedPackagePath} />
|
|
46
47
|
</p>
|
|
47
48
|
</Stack>
|
|
48
49
|
|
|
49
|
-
<ul className={css.
|
|
50
|
-
<li className={css.
|
|
50
|
+
<ul className={css.packageCardList}>
|
|
51
|
+
<li className={css.packageCardItem}>
|
|
51
52
|
<a
|
|
52
53
|
href={`https://www.npmjs.com/package/${normalizedName}`}
|
|
53
54
|
target="_blank"
|
|
@@ -56,7 +57,7 @@ const PackagePopoverContent = ({ name, fullName, path, duplicate, CustomComponen
|
|
|
56
57
|
npmjs.com
|
|
57
58
|
</a>
|
|
58
59
|
</li>
|
|
59
|
-
<li className={css.
|
|
60
|
+
<li className={css.packageCardItem}>
|
|
60
61
|
<a
|
|
61
62
|
href={`https://bundlephobia.com/result?p=${normalizedName}`}
|
|
62
63
|
target="_blank"
|
|
@@ -67,7 +68,7 @@ const PackagePopoverContent = ({ name, fullName, path, duplicate, CustomComponen
|
|
|
67
68
|
</li>
|
|
68
69
|
</ul>
|
|
69
70
|
|
|
70
|
-
<Stack space="xxxsmall" className={css.
|
|
71
|
+
<Stack space="xxxsmall" className={css.packageCardActions}>
|
|
71
72
|
{duplicate && (
|
|
72
73
|
<div>
|
|
73
74
|
<CustomComponentLink {...getBundlePackagesByNameComponentLink(normalizedName)}>
|
|
@@ -84,7 +85,7 @@ const PackagePopoverContent = ({ name, fullName, path, duplicate, CustomComponen
|
|
|
84
85
|
);
|
|
85
86
|
};
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
PackageCard.propTypes = {
|
|
88
89
|
name: PropTypes.string.isRequired,
|
|
89
90
|
path: PropTypes.string,
|
|
90
91
|
fullName: PropTypes.string.isRequired,
|
|
@@ -92,7 +93,7 @@ PackagePopoverContent.propTypes = {
|
|
|
92
93
|
CustomComponentLink: PropTypes.elementType.isRequired,
|
|
93
94
|
};
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
PackageCard.defaultProps = {
|
|
96
97
|
path: '',
|
|
97
98
|
};
|
|
98
99
|
|
|
@@ -101,28 +102,33 @@ const PackageRowHeader = ({ item, CustomComponentLink }) => {
|
|
|
101
102
|
const { path } = item.runs[0] || {};
|
|
102
103
|
|
|
103
104
|
return (
|
|
104
|
-
<
|
|
105
|
+
<FlexStack space="xxxsmall" className={css.packageNames}>
|
|
105
106
|
{packageNames.map((packageName, index) => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
const label = (
|
|
108
|
+
<FlexStack space="xxxsmall" className={css.packageNameLabel}>
|
|
109
|
+
{/* Render duplicate flag only for the last entry */}
|
|
110
|
+
{index === packageNames.length - 1 && item.duplicate && (
|
|
111
|
+
<span className={css.packageNameDuplicate} title="Duplicate package">
|
|
112
|
+
D
|
|
113
|
+
</span>
|
|
114
|
+
)}
|
|
115
|
+
<span className={css.packageNameText}>{packageName}</span>
|
|
116
|
+
</FlexStack>
|
|
111
117
|
);
|
|
112
118
|
|
|
113
119
|
return (
|
|
114
|
-
<
|
|
115
|
-
<
|
|
120
|
+
<HoverCard label={label} key={packageName} className={css.packageName}>
|
|
121
|
+
<PackageCard
|
|
116
122
|
name={packageName}
|
|
117
123
|
path={path}
|
|
118
124
|
fullName={item.label}
|
|
119
125
|
duplicate={item.duplicate}
|
|
120
126
|
CustomComponentLink={CustomComponentLink}
|
|
121
127
|
/>
|
|
122
|
-
</
|
|
128
|
+
</HoverCard>
|
|
123
129
|
);
|
|
124
130
|
})}
|
|
125
|
-
</
|
|
131
|
+
</FlexStack>
|
|
126
132
|
);
|
|
127
133
|
};
|
|
128
134
|
|
|
@@ -12,20 +12,8 @@
|
|
|
12
12
|
margin-right: -1px; /** collapse border */
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.
|
|
16
|
-
|
|
17
|
-
display: inline-block;
|
|
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;
|
|
26
|
-
|
|
27
|
-
background: var(--color-danger);
|
|
28
|
-
color: var(--color-light);
|
|
15
|
+
.packageNames {
|
|
16
|
+
align-items: center;
|
|
29
17
|
}
|
|
30
18
|
|
|
31
19
|
.packageName {
|
|
@@ -38,27 +26,56 @@
|
|
|
38
26
|
|
|
39
27
|
.packageName + .packageName::before {
|
|
40
28
|
display: inline-block;
|
|
41
|
-
margin: 0 var(--space-xxxsmall);
|
|
29
|
+
margin: 0 var(--space-xxxsmall) 0 0;
|
|
42
30
|
content: '/';
|
|
43
31
|
color: var(--color-text-ultra-light);
|
|
44
32
|
}
|
|
45
33
|
|
|
46
|
-
.
|
|
47
|
-
|
|
34
|
+
.packageNameLabel {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.packageNameDuplicate {
|
|
40
|
+
margin-right: var(--space-xxxsmall);
|
|
41
|
+
display: inline-block;
|
|
42
|
+
width: var(--space-xsmall);
|
|
43
|
+
height: var(--space-xsmall);
|
|
44
|
+
font-size: 8px;
|
|
45
|
+
font-weight: bold;
|
|
46
|
+
line-height: var(--space-xsmall);
|
|
47
|
+
text-align: center;
|
|
48
|
+
text-transform: uppercase;
|
|
49
|
+
vertical-align: middle;
|
|
50
|
+
|
|
51
|
+
background: var(--color-danger);
|
|
52
|
+
color: var(--color-light);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.packageName:hover,
|
|
56
|
+
.packageName:active,
|
|
57
|
+
.packageName:focus {
|
|
58
|
+
text-decoration: none !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.packageName:hover .packageNameText,
|
|
62
|
+
.packageName:active .packageNameText,
|
|
63
|
+
.packageName:focus .packageNameText {
|
|
64
|
+
text-decoration: underline !important;
|
|
48
65
|
}
|
|
49
66
|
|
|
50
|
-
.
|
|
67
|
+
.packageCardTitleIndex {
|
|
51
68
|
color: var(--color-text-light);
|
|
52
69
|
font-weight: normal;
|
|
53
70
|
}
|
|
54
71
|
|
|
55
|
-
.
|
|
72
|
+
.packageCardPathValue {
|
|
56
73
|
padding: var(--space-xxxsmall);
|
|
57
74
|
background: var(--color-highlight-warning);
|
|
58
75
|
font-family: var(--font-family-monospace);
|
|
59
76
|
}
|
|
60
77
|
|
|
61
|
-
.
|
|
78
|
+
.packageCardList {
|
|
62
79
|
padding: 0;
|
|
63
80
|
list-style: inside;
|
|
64
81
|
}
|
|
@@ -5,7 +5,7 @@ import I18N from '../../i18n';
|
|
|
5
5
|
import { Dropdown } from '../../ui/dropdown';
|
|
6
6
|
|
|
7
7
|
export const MetricsTableOptions = (props) => {
|
|
8
|
-
const { className,
|
|
8
|
+
const { className, handleViewAll, handleResetFilters, ...restProps } = props;
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<Dropdown className={className} glyph="menu" {...restProps}>
|
|
@@ -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) => {
|
|
@@ -18,7 +19,7 @@ export const MetricsTableTitle = (props) => {
|
|
|
18
19
|
<span>{title}</span>
|
|
19
20
|
{info && <span className={css.info}>{info}</span>}
|
|
20
21
|
{(popoverInfo || popoverHref) && (
|
|
21
|
-
<
|
|
22
|
+
<HoverCard label={<Icon glyph="help" />}>
|
|
22
23
|
<Stack space="xxxsmall">
|
|
23
24
|
{popoverInfo && <p>{popoverInfo}</p>}
|
|
24
25
|
{popoverHref && (
|
|
@@ -29,7 +30,7 @@ export const MetricsTableTitle = (props) => {
|
|
|
29
30
|
</p>
|
|
30
31
|
)}
|
|
31
32
|
</Stack>
|
|
32
|
-
</
|
|
33
|
+
</HoverCard>
|
|
33
34
|
)}
|
|
34
35
|
</FlexStack>
|
|
35
36
|
</Stack>
|
|
@@ -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 { Icon } from '../../ui/icon';
|
|
7
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
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,26 @@ 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
|
-
|
|
29
|
-
)}
|
|
30
|
-
</Stack>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
MetricInfoPopover.propTypes = {
|
|
15
|
+
const MetricDescriptionCard = ({ description, url }) => (
|
|
16
|
+
<Stack space="xxsmall">
|
|
17
|
+
<p>{description}</p>
|
|
18
|
+
|
|
19
|
+
{url && (
|
|
20
|
+
<p>
|
|
21
|
+
<a href={url} target="_blank" rel="noopener noreferrer">
|
|
22
|
+
Read more
|
|
23
|
+
</a>
|
|
24
|
+
</p>
|
|
25
|
+
)}
|
|
26
|
+
</Stack>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
MetricDescriptionCard.propTypes = {
|
|
35
30
|
description: PropTypes.string.isRequired,
|
|
36
31
|
url: PropTypes.string,
|
|
37
32
|
};
|
|
38
33
|
|
|
39
|
-
|
|
34
|
+
MetricDescriptionCard.defaultProps = {
|
|
40
35
|
url: '',
|
|
41
36
|
};
|
|
42
37
|
|
|
@@ -65,9 +60,9 @@ export const SummaryItem = ({
|
|
|
65
60
|
<span>{metric.label}</span>
|
|
66
61
|
|
|
67
62
|
{showMetricDescriptionTooltip && (
|
|
68
|
-
<
|
|
69
|
-
<
|
|
70
|
-
</
|
|
63
|
+
<HoverCard className={css.icon} label={<Icon glyph="help" />}>
|
|
64
|
+
<MetricDescriptionCard {...metric} />
|
|
65
|
+
</HoverCard>
|
|
71
66
|
)}
|
|
72
67
|
</FlexStack>
|
|
73
68
|
|