@bundle-stats/ui 3.3.0-alpha.1 → 3.3.1-beta.8
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 +65 -13
- package/build-storybook.log +4691 -0
- package/lib/app/app.js +137 -102
- package/lib/app/app.module.css +11 -4
- package/lib/app/header/header.js +1 -10
- package/lib/components/asset-info/asset-info.module.css +1 -0
- package/lib/components/bundle-assets/bundle-assets.js +104 -52
- package/lib/components/bundle-assets/bundle-assets.module.css +24 -26
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.js +13 -3
- package/lib/components/bundle-modules/bundle-modules.js +68 -68
- package/lib/components/bundle-modules/bundle-modules.module.css +11 -2
- package/lib/components/bundle-modules/bundle-modules.utils.js +14 -10
- package/lib/components/bundle-modules/index.js +4 -4
- package/lib/components/bundle-packages/bundle-packages.js +100 -44
- package/lib/components/bundle-packages/bundle-packages.module.css +17 -21
- package/lib/components/delta/delta.module.css +1 -0
- package/lib/components/job-header/job-header.js +3 -1
- package/lib/components/job-header/job-header.module.css +6 -8
- package/lib/components/jobs-header/jobs-header.module.css +5 -0
- package/lib/components/metrics-table/metrics-table.js +72 -59
- package/lib/components/metrics-table/metrics-table.module.css +18 -7
- 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.js +2 -2
- package/lib/components/module-info/module-info.module.css +1 -0
- package/lib/components/summary/summary.js +1 -1
- package/lib/components/summary-item/summary-item.js +15 -18
- package/lib/components/summary-item/summary-item.module.css +1 -23
- package/lib/components/total-size-type-title/total-size-type-title.js +7 -3
- package/lib/constants.js +1 -1
- package/lib/css/default.css +14 -3
- package/lib/css/variables.css +17 -17
- package/lib/hooks/search-params.js +31 -31
- package/lib/layout/box/box.module.css +9 -0
- package/lib/layout/footer/footer.module.css +1 -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 +21 -26
- package/lib/ui/dropdown/dropdown.module.css +11 -12
- package/lib/ui/dropdown/dropdown.stories.js +2 -9
- package/lib/ui/empty-set/empty-set.js +5 -4
- package/lib/ui/empty-set/empty-set.module.css +2 -2
- package/lib/ui/filters/filters.container.js +1 -1
- package/lib/ui/filters/filters.js +22 -7
- package/lib/ui/filters/filters.module.css +3 -3
- package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.js +1 -1
- package/lib/ui/hover-card/hover-card.js +102 -0
- package/lib/ui/hover-card/hover-card.module.css +29 -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/icon/icon.module.css +1 -0
- package/lib/ui/index.js +8 -8
- package/lib/ui/table/table.js +5 -74
- package/lib/ui/table/table.module.css +41 -25
- package/lib/ui/table/table.stories.js +1 -1
- 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 +2 -1
- package/lib-esm/app/app.js +132 -102
- package/lib-esm/app/app.module.css +11 -4
- package/lib-esm/app/header/header.js +1 -9
- package/lib-esm/components/asset-info/asset-info.module.css +1 -0
- package/lib-esm/components/bundle-assets/bundle-assets.js +97 -56
- package/lib-esm/components/bundle-assets/bundle-assets.module.css +24 -26
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +7 -3
- package/lib-esm/components/bundle-modules/bundle-modules.js +50 -51
- package/lib-esm/components/bundle-modules/bundle-modules.module.css +11 -2
- package/lib-esm/components/bundle-modules/bundle-modules.utils.js +14 -6
- package/lib-esm/components/bundle-modules/index.js +5 -3
- package/lib-esm/components/bundle-packages/bundle-packages.js +88 -41
- package/lib-esm/components/bundle-packages/bundle-packages.module.css +17 -21
- package/lib-esm/components/delta/delta.module.css +1 -0
- package/lib-esm/components/job-header/job-header.js +2 -1
- package/lib-esm/components/job-header/job-header.module.css +6 -8
- package/lib-esm/components/jobs-header/jobs-header.module.css +5 -0
- package/lib-esm/components/metrics-table/metrics-table.js +61 -53
- package/lib-esm/components/metrics-table/metrics-table.module.css +18 -7
- 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.js +2 -2
- package/lib-esm/components/module-info/module-info.module.css +1 -0
- package/lib-esm/components/summary/summary.js +1 -1
- package/lib-esm/components/summary-item/summary-item.js +14 -18
- package/lib-esm/components/summary-item/summary-item.module.css +1 -23
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +6 -3
- package/lib-esm/constants.js +1 -1
- package/lib-esm/css/default.css +14 -3
- package/lib-esm/css/variables.css +17 -17
- package/lib-esm/hooks/search-params.js +27 -28
- package/lib-esm/layout/box/box.module.css +9 -0
- package/lib-esm/layout/footer/footer.module.css +1 -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 +20 -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/empty-set/empty-set.js +4 -4
- package/lib-esm/ui/empty-set/empty-set.module.css +2 -2
- package/lib-esm/ui/filters/filters.js +20 -5
- package/lib-esm/ui/filters/filters.module.css +3 -3
- package/lib-esm/ui/hover-card/hover-card.js +83 -0
- package/lib-esm/ui/hover-card/hover-card.module.css +29 -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/icon/icon.module.css +1 -0
- package/lib-esm/ui/index.js +1 -1
- package/lib-esm/ui/table/table.js +5 -65
- package/lib-esm/ui/table/table.module.css +41 -25
- package/lib-esm/ui/table/table.stories.js +1 -1
- 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 +2 -1
- package/package.json +33 -31
- package/src/app/app.jsx +136 -146
- package/src/app/app.module.css +11 -4
- package/src/app/header/header.jsx +1 -11
- package/src/assets/icons.svg +0 -8
- package/src/components/asset-info/asset-info.module.css +1 -0
- package/src/components/bundle-assets/bundle-assets.jsx +85 -31
- package/src/components/bundle-assets/bundle-assets.module.css +24 -26
- package/src/components/bundle-assets-totals-table/bundle-assets-totals-table.jsx +13 -25
- package/src/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
- package/src/components/bundle-modules/bundle-modules.jsx +53 -36
- package/src/components/bundle-modules/bundle-modules.module.css +11 -2
- package/src/components/bundle-modules/bundle-modules.utils.js +16 -4
- package/src/components/bundle-modules/index.jsx +3 -0
- package/src/components/bundle-packages/bundle-packages.jsx +89 -39
- package/src/components/bundle-packages/bundle-packages.module.css +17 -21
- package/src/components/delta/delta.module.css +1 -0
- package/src/components/index.js +0 -1
- package/src/components/job-header/job-header.jsx +2 -1
- package/src/components/job-header/job-header.module.css +6 -8
- package/src/components/jobs-header/jobs-header.module.css +5 -0
- package/src/components/metrics-table/metrics-table.jsx +53 -44
- package/src/components/metrics-table/metrics-table.module.css +18 -7
- 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 +3 -7
- package/src/components/module-info/module-info.module.css +1 -0
- package/src/components/summary/summary.jsx +7 -8
- package/src/components/summary/summary.module.css +1 -1
- package/src/components/summary-item/summary-item.jsx +23 -40
- package/src/components/summary-item/summary-item.module.css +1 -34
- package/src/components/total-size-type-title/total-size-type-title.jsx +6 -9
- package/src/constants.js +11 -7
- package/src/css/default.css +14 -3
- package/src/css/variables.css +17 -17
- package/src/hooks/search-params.js +42 -33
- package/src/layout/box/box.module.css +9 -0
- package/src/layout/footer/footer.module.css +1 -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/alert/alert.jsx +2 -7
- package/src/ui/dropdown/dropdown.jsx +16 -22
- package/src/ui/dropdown/dropdown.module.css +11 -12
- package/src/ui/empty-set/empty-set.jsx +25 -21
- package/src/ui/empty-set/empty-set.module.css +2 -2
- package/src/ui/filters/filters.jsx +64 -53
- package/src/ui/filters/filters.module.css +3 -3
- package/src/ui/hover-card/hover-card.jsx +73 -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.jsx +11 -9
- package/src/ui/icon/icon.module.css +1 -0
- package/src/ui/index.js +1 -1
- package/src/ui/table/table.jsx +5 -52
- package/src/ui/table/table.module.css +41 -25
- 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 +2 -1
- package/storybook-static/favicon.ico +0 -0
- 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/assets/icons/alert-circle.svg +0 -1
- package/src/assets/icons/check-circle.svg +0 -1
- package/src/components/budget-info/budget-info.jsx +0 -65
- package/src/components/budget-info/budget-info.module.css +0 -40
- package/src/components/budget-info/index.js +0 -1
- package/src/components/budget-insights/budget-insights.jsx +0 -157
- package/src/components/budget-insights/budget-insights.module.css +0 -53
- package/src/components/budget-insights/index.js +0 -1
- 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
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
.title {
|
|
2
|
+
font-size: var(--size-xlarge);
|
|
2
3
|
line-height: 1;
|
|
3
4
|
font-weight: bold;
|
|
4
5
|
vertical-align: top;
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
.tag {
|
|
8
|
-
|
|
9
|
-
margin-left: var(--space-xxxsmall);
|
|
10
|
-
background-color: var(--color-highlight);
|
|
11
|
-
color: var(--color-text-light);
|
|
12
|
-
display: inline-block;
|
|
13
|
-
font-size: 9px;
|
|
14
|
-
line-height: var(--space-xxsmall);
|
|
15
|
-
font-weight: normal;
|
|
9
|
+
margin-left: var(--space-xxsmall);
|
|
16
10
|
vertical-align: top;
|
|
11
|
+
outline: 1px solid var(--color-outline);
|
|
12
|
+
background: var(--color-highlight);
|
|
13
|
+
color: var(--color-text-light);
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
.meta {
|
|
17
|
+
font-size: var(--size-small);
|
|
20
18
|
color: var(--color-text-light);
|
|
21
19
|
}
|
|
22
20
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import _sum from "lodash/sum";
|
|
2
2
|
import _isEmpty from "lodash/isEmpty";
|
|
3
3
|
import _get from "lodash/get";
|
|
4
|
+
|
|
5
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
|
+
|
|
4
7
|
import React, { useMemo } from 'react';
|
|
5
8
|
import PropTypes from 'prop-types';
|
|
6
9
|
import cx from 'classnames';
|
|
@@ -85,47 +88,60 @@ const getHeaderRows = (runs, items, showHeaderSum, title) => [{
|
|
|
85
88
|
cells: runs.map(getHeaderTotalCells(items)).flat()
|
|
86
89
|
}] : [])];
|
|
87
90
|
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
const MetricsTableRow = _ref => {
|
|
92
|
+
let {
|
|
93
|
+
item,
|
|
94
|
+
renderRowHeader
|
|
95
|
+
} = _ref;
|
|
96
|
+
return /*#__PURE__*/React.createElement(Table.Tr, {
|
|
97
|
+
className: cx(!item.changed && styles.unchanged)
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Table.Th, {
|
|
99
|
+
className: styles.metricName
|
|
100
|
+
}, renderRowHeader(item)), item.runs.map((run, index) => {
|
|
101
|
+
const isBaseline = index === item.runs.length - 1;
|
|
102
|
+
const valueClassName = cx(styles.value, !isBaseline && styles.current); // Empty cells if no value
|
|
94
103
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
value: displayValue
|
|
103
|
-
})];
|
|
104
|
+
if (!run || typeof run.value === 'undefined') {
|
|
105
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Table.Td, {
|
|
106
|
+
className: valueClassName
|
|
107
|
+
}, "-"), !isBaseline && /*#__PURE__*/React.createElement(Table.Td, {
|
|
108
|
+
className: styles.delta
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
104
111
|
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
const {
|
|
113
|
+
displayValue,
|
|
114
|
+
deltaPercentage,
|
|
115
|
+
displayDeltaPercentage,
|
|
116
|
+
deltaType
|
|
117
|
+
} = run;
|
|
118
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Table.Td, {
|
|
119
|
+
className: valueClassName
|
|
120
|
+
}, /*#__PURE__*/React.createElement(Metric, {
|
|
121
|
+
value: displayValue
|
|
122
|
+
})), !isBaseline && typeof deltaPercentage === 'number' && /*#__PURE__*/React.createElement(Table.Td, {
|
|
123
|
+
className: styles.delta
|
|
124
|
+
}, /*#__PURE__*/React.createElement(Delta, {
|
|
107
125
|
displayValue: displayDeltaPercentage,
|
|
108
126
|
deltaType: deltaType
|
|
109
|
-
}));
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return cells;
|
|
127
|
+
})));
|
|
128
|
+
}));
|
|
113
129
|
};
|
|
114
130
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
changed
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
export const MetricsTable =
|
|
131
|
+
MetricsTableRow.propTypes = {
|
|
132
|
+
item: PropTypes.shape({
|
|
133
|
+
changed: PropTypes.bool,
|
|
134
|
+
runs: PropTypes.arrayOf(PropTypes.shape({
|
|
135
|
+
value: PropTypes.number,
|
|
136
|
+
displayValue: PropTypes.string,
|
|
137
|
+
deltaPercentage: PropTypes.number,
|
|
138
|
+
displayDeltaPercentage: PropTypes.string,
|
|
139
|
+
deltaType: PropTypes.string
|
|
140
|
+
}))
|
|
141
|
+
}).isRequired,
|
|
142
|
+
renderRowHeader: PropTypes.func.isRequired
|
|
143
|
+
};
|
|
144
|
+
export const MetricsTable = _ref2 => {
|
|
129
145
|
let {
|
|
130
146
|
className,
|
|
131
147
|
renderRowHeader,
|
|
@@ -134,8 +150,9 @@ export const MetricsTable = _ref => {
|
|
|
134
150
|
emptyMessage,
|
|
135
151
|
showHeaderSum,
|
|
136
152
|
headerRows,
|
|
137
|
-
title
|
|
138
|
-
|
|
153
|
+
title,
|
|
154
|
+
...restProps
|
|
155
|
+
} = _ref2;
|
|
139
156
|
const {
|
|
140
157
|
headers,
|
|
141
158
|
columnClassNames
|
|
@@ -147,12 +164,11 @@ export const MetricsTable = _ref => {
|
|
|
147
164
|
columnClassNames: headerColumns[0].cells.map(headerColumn => headerColumn.className)
|
|
148
165
|
};
|
|
149
166
|
}, [headerRows, runs, items, showHeaderSum, title]);
|
|
150
|
-
const rows = useMemo(() => getRows(runs, items, renderRowHeader), [runs, items, renderRowHeader]);
|
|
151
167
|
const rootClassName = cx(styles.root, className, runs.length > 1 && styles.multipleRuns, showHeaderSum && styles.showHeaderSum);
|
|
152
|
-
return /*#__PURE__*/React.createElement(Table, {
|
|
168
|
+
return /*#__PURE__*/React.createElement(Table, _extends({
|
|
153
169
|
className: rootClassName,
|
|
154
170
|
compact: true
|
|
155
|
-
}, /*#__PURE__*/React.createElement(Table.THead, null, headers.map(headerRow => {
|
|
171
|
+
}, restProps), /*#__PURE__*/React.createElement(Table.THead, null, headers.map(headerRow => {
|
|
156
172
|
const {
|
|
157
173
|
cells,
|
|
158
174
|
className: rowClassName
|
|
@@ -162,19 +178,11 @@ export const MetricsTable = _ref => {
|
|
|
162
178
|
return /*#__PURE__*/React.createElement(Table.Tr, {
|
|
163
179
|
className: rowClassName
|
|
164
180
|
}, cells.map(header => /*#__PURE__*/React.createElement(Table.Th, header)));
|
|
165
|
-
})), /*#__PURE__*/React.createElement(Table.TBody, null, !_isEmpty(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
} = _ref2;
|
|
171
|
-
return /*#__PURE__*/React.createElement(Table.Tr, {
|
|
172
|
-
key: key,
|
|
173
|
-
className: rowClassName
|
|
174
|
-
}, cells.map((cell, index) => /*#__PURE__*/React.createElement(Table.Td, {
|
|
175
|
-
className: columnClassNames[index]
|
|
176
|
-
}, cell)));
|
|
177
|
-
}) : /*#__PURE__*/React.createElement(Table.Tr, null, /*#__PURE__*/React.createElement(Table.Td, {
|
|
181
|
+
})), /*#__PURE__*/React.createElement(Table.TBody, null, !_isEmpty(items) ? items.map(item => /*#__PURE__*/React.createElement(MetricsTableRow, {
|
|
182
|
+
key: item.key,
|
|
183
|
+
item: item,
|
|
184
|
+
renderRowHeader: renderRowHeader
|
|
185
|
+
})) : /*#__PURE__*/React.createElement(Table.Tr, null, /*#__PURE__*/React.createElement(Table.Td, {
|
|
178
186
|
className: styles.empty,
|
|
179
187
|
colSpan: (columnClassNames == null ? void 0 : columnClassNames.length) || 1
|
|
180
188
|
}, emptyMessage))));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
.
|
|
1
|
+
.root a {
|
|
2
2
|
color: inherit;
|
|
3
3
|
text-decoration: none;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.
|
|
7
|
-
.
|
|
8
|
-
.
|
|
6
|
+
.root a:hover,
|
|
7
|
+
.root a:active,
|
|
8
|
+
.root a:focus {
|
|
9
9
|
color: var(--color-primary);
|
|
10
10
|
text-decoration: underline;
|
|
11
11
|
}
|
|
@@ -15,21 +15,31 @@
|
|
|
15
15
|
width: 100%;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.value {
|
|
18
|
+
.root .value {
|
|
19
19
|
padding-left: var(--space-large);
|
|
20
20
|
text-align: right;
|
|
21
|
+
vertical-align: baseline;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
.delta {
|
|
24
|
+
.root .delta {
|
|
24
25
|
padding-left: 0;
|
|
25
26
|
text-align: left;
|
|
26
27
|
font-size: var(--size-xsmall);
|
|
28
|
+
vertical-align: baseline;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
.
|
|
31
|
+
.root tbody .delta {
|
|
32
|
+
line-height: 1.6rem; /* baseline alignment with the value */
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.root .value.current {
|
|
30
36
|
padding-right: var(--space-xxsmall);
|
|
31
37
|
}
|
|
32
38
|
|
|
39
|
+
.jobName {
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
}
|
|
42
|
+
|
|
33
43
|
/* columns overrides for showHeaderSum */
|
|
34
44
|
.showHeaderSum .headerRowColumns .value,
|
|
35
45
|
.showHeaderSum .headerRowColumns .delta {
|
|
@@ -45,6 +55,7 @@
|
|
|
45
55
|
}
|
|
46
56
|
|
|
47
57
|
/** rows */
|
|
58
|
+
.multipleRuns .unchanged th,
|
|
48
59
|
.multipleRuns .unchanged td {
|
|
49
60
|
color: var(--color-text-light);
|
|
50
61
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.input {
|
|
8
|
+
border-radius: 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);
|
|
@@ -4,7 +4,8 @@ import cx from 'classnames';
|
|
|
4
4
|
import I18N from '../../i18n';
|
|
5
5
|
import { FlexStack } from '../../layout/flex-stack';
|
|
6
6
|
import { Stack } from '../../layout/stack';
|
|
7
|
-
import {
|
|
7
|
+
import { Icon } from '../../ui/icon';
|
|
8
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
8
9
|
import css from './metrics-table-title.module.css';
|
|
9
10
|
export const MetricsTableTitle = props => {
|
|
10
11
|
const {
|
|
@@ -15,22 +16,22 @@ export const MetricsTableTitle = props => {
|
|
|
15
16
|
popoverHref
|
|
16
17
|
} = props;
|
|
17
18
|
const rootClassName = cx(css.root, className);
|
|
18
|
-
return /*#__PURE__*/React.createElement(
|
|
19
|
+
return /*#__PURE__*/React.createElement(FlexStack, {
|
|
19
20
|
space: "xxxsmall",
|
|
20
21
|
className: rootClassName
|
|
21
|
-
}, /*#__PURE__*/React.createElement(FlexStack, {
|
|
22
|
-
space: "xxxsmall"
|
|
23
22
|
}, /*#__PURE__*/React.createElement("span", null, title), info && /*#__PURE__*/React.createElement("span", {
|
|
24
23
|
className: css.info
|
|
25
|
-
}, info), (popoverInfo || popoverHref) && /*#__PURE__*/React.createElement(
|
|
26
|
-
|
|
24
|
+
}, info), (popoverInfo || popoverHref) && /*#__PURE__*/React.createElement(HoverCard, {
|
|
25
|
+
label: /*#__PURE__*/React.createElement(Icon, {
|
|
26
|
+
glyph: "help"
|
|
27
|
+
})
|
|
27
28
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
28
29
|
space: "xxxsmall"
|
|
29
30
|
}, popoverInfo && /*#__PURE__*/React.createElement("p", null, popoverInfo), popoverHref && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
|
|
30
31
|
href: popoverHref,
|
|
31
32
|
target: "_blank",
|
|
32
33
|
rel: "noreferrer"
|
|
33
|
-
}, I18N.READ_MORE)))))
|
|
34
|
+
}, I18N.READ_MORE)))));
|
|
34
35
|
};
|
|
35
36
|
MetricsTableTitle.propTypes = {
|
|
36
37
|
className: PropTypes.string,
|
|
@@ -22,7 +22,7 @@ export const ModuleInfo = props => {
|
|
|
22
22
|
onClick
|
|
23
23
|
} = props;
|
|
24
24
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
25
|
-
space: "
|
|
25
|
+
space: "xsmall",
|
|
26
26
|
className: className
|
|
27
27
|
}, item.runs.map((run, index) => {
|
|
28
28
|
const TitleComponent = index !== 0 ? 'h4' : 'h3';
|
|
@@ -32,7 +32,7 @@ export const ModuleInfo = props => {
|
|
|
32
32
|
key: key
|
|
33
33
|
}, /*#__PURE__*/React.createElement(TitleComponent, null, labels[index]), index === 0 && !_isEmpty(run == null ? void 0 : run.chunkIds) && /*#__PURE__*/React.createElement("div", {
|
|
34
34
|
className: css.chunks
|
|
35
|
-
}, /*#__PURE__*/React.createElement("
|
|
35
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
36
36
|
className: css.chunksTitle
|
|
37
37
|
}, "Chunks:"), run.chunkIds.map(chunkId => {
|
|
38
38
|
const chunk = _find(chunks, {
|
|
@@ -44,7 +44,7 @@ export const Summary = _ref => {
|
|
|
44
44
|
size: size,
|
|
45
45
|
id: metricId,
|
|
46
46
|
data: _get(data, metricId),
|
|
47
|
-
budget: _get(budgets, metricId),
|
|
47
|
+
budget: _get(budgets, getSourceMetricId(metricId)),
|
|
48
48
|
loading: loading,
|
|
49
49
|
showMetricDescription: true,
|
|
50
50
|
showDelta: showSummaryItemDelta && metricOptions.showDelta !== false
|
|
@@ -4,7 +4,8 @@ import React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import cx from 'classnames';
|
|
6
6
|
import { getGlobalMetricType, getMetricRunInfo } from '@bundle-stats/utils';
|
|
7
|
-
import {
|
|
7
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
8
|
+
import { Icon } from '../../ui/icon';
|
|
8
9
|
import { Skeleton } from '../../ui/skeleton';
|
|
9
10
|
import { Stack } from '../../layout/stack';
|
|
10
11
|
import { FlexStack } from '../../layout/flex-stack';
|
|
@@ -13,31 +14,24 @@ import { Delta } from '../delta';
|
|
|
13
14
|
import { BudgetInfo } from '../budget-info';
|
|
14
15
|
import css from './summary-item.module.css';
|
|
15
16
|
|
|
16
|
-
const
|
|
17
|
+
const MetricInfo = _ref => {
|
|
17
18
|
let {
|
|
18
19
|
description,
|
|
19
20
|
url
|
|
20
21
|
} = _ref;
|
|
21
|
-
|
|
22
|
-
// Workaround cases where the parent is a link
|
|
23
|
-
const readMoreOnClick = () => {
|
|
24
|
-
window.open(url);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
22
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
28
23
|
space: "xxxsmall"
|
|
29
|
-
}, /*#__PURE__*/React.createElement("p", null, description), url && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("
|
|
30
|
-
|
|
31
|
-
className: css.
|
|
32
|
-
onClick: readMoreOnClick
|
|
24
|
+
}, /*#__PURE__*/React.createElement("p", null, description), url && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
|
|
25
|
+
href: url,
|
|
26
|
+
className: css.readMoreLink
|
|
33
27
|
}, "Read more")));
|
|
34
28
|
};
|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
MetricInfo.propTypes = {
|
|
37
31
|
description: PropTypes.string.isRequired,
|
|
38
32
|
url: PropTypes.string
|
|
39
33
|
};
|
|
40
|
-
|
|
34
|
+
MetricInfo.defaultProps = {
|
|
41
35
|
url: ''
|
|
42
36
|
};
|
|
43
37
|
export const SummaryItem = _ref2 => {
|
|
@@ -65,7 +59,7 @@ export const SummaryItem = _ref2 => {
|
|
|
65
59
|
const showMetricDescriptionTooltip = showMetricDescription && (metric == null ? void 0 : metric.description);
|
|
66
60
|
const rootClassName = cx(css.root, className, css[size], showDelta && css.showDelta);
|
|
67
61
|
return /*#__PURE__*/React.createElement(Stack, _extends({
|
|
68
|
-
space: "
|
|
62
|
+
space: "xxxsmall",
|
|
69
63
|
as: Component,
|
|
70
64
|
className: rootClassName
|
|
71
65
|
}, props), /*#__PURE__*/React.createElement(FlexStack, {
|
|
@@ -74,10 +68,12 @@ export const SummaryItem = _ref2 => {
|
|
|
74
68
|
className: css.title
|
|
75
69
|
}, /*#__PURE__*/React.createElement("span", {
|
|
76
70
|
className: css.titleLabel
|
|
77
|
-
}, metric.label), showMetricDescriptionTooltip && /*#__PURE__*/React.createElement(
|
|
71
|
+
}, metric.label), showMetricDescriptionTooltip && /*#__PURE__*/React.createElement(HoverCard, {
|
|
78
72
|
className: css.icon,
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
label: /*#__PURE__*/React.createElement(Icon, {
|
|
74
|
+
glyph: "help"
|
|
75
|
+
})
|
|
76
|
+
}, /*#__PURE__*/React.createElement(MetricInfo, metric)), budget && /*#__PURE__*/React.createElement(BudgetInfo, {
|
|
81
77
|
className: css.budgetInfo,
|
|
82
78
|
metricId: id,
|
|
83
79
|
budgetInsight: budget
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.title {
|
|
7
|
+
align-items: center;
|
|
7
8
|
color: var(--color-text-ultra-light);
|
|
8
9
|
font-weight: bold;
|
|
9
10
|
font-size: var(--size-xsmall);
|
|
@@ -12,29 +13,6 @@
|
|
|
12
13
|
white-space: nowrap;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
.titleLabel {
|
|
16
|
-
flex: 0 0 auto;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.readMoreBtn {
|
|
20
|
-
appearance: none;
|
|
21
|
-
padding: 0;
|
|
22
|
-
border: 0;
|
|
23
|
-
background: none;
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
/* simulate link */
|
|
26
|
-
color: var(--color-primary);
|
|
27
|
-
text-decoration: underline;
|
|
28
|
-
line-height: var(--space-small);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.readMoreBtn:hover,
|
|
32
|
-
.readMoreBtn:active,
|
|
33
|
-
.readMoreBtn:focus {
|
|
34
|
-
color: var(--color-primary-dark);
|
|
35
|
-
text-decoration: none;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
16
|
.budgetInfo {
|
|
39
17
|
position: absolute;
|
|
40
18
|
right: 0;
|
|
@@ -5,7 +5,8 @@ import config from '../../config.json';
|
|
|
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 './total-size-type-title.module.css';
|
|
10
11
|
export const TotalSizeTypeTitle = _ref => {
|
|
11
12
|
let {
|
|
@@ -14,8 +15,10 @@ export const TotalSizeTypeTitle = _ref => {
|
|
|
14
15
|
return /*#__PURE__*/React.createElement(FlexStack, {
|
|
15
16
|
space: "xxxsmall",
|
|
16
17
|
className: cx(css.title, className)
|
|
17
|
-
}, /*#__PURE__*/React.createElement("span", null, I18N.ASSET_TOTALS), /*#__PURE__*/React.createElement(
|
|
18
|
-
|
|
18
|
+
}, /*#__PURE__*/React.createElement("span", null, I18N.ASSET_TOTALS), /*#__PURE__*/React.createElement(HoverCard, {
|
|
19
|
+
label: /*#__PURE__*/React.createElement(Icon, {
|
|
20
|
+
glyph: "help"
|
|
21
|
+
})
|
|
19
22
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
20
23
|
space: "xxxsmall"
|
|
21
24
|
}, /*#__PURE__*/React.createElement("p", null, I18N.ASSET_TOTALS_INFO), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
|
package/lib-esm/constants.js
CHANGED
|
@@ -27,5 +27,5 @@ export const ASSETS_SIZES_FILE_TYPE_MAP = FILE_TYPES.reduce((agg, fileType) => (
|
|
|
27
27
|
}), {});
|
|
28
28
|
export const METRICS_WEBPACK_GENERAL = ['totalSizeByTypeALL', 'totalInitialSizeJS', 'totalInitialSizeCSS', 'cacheInvalidation'];
|
|
29
29
|
export const METRICS_WEBPACK_ASSETS = ['assetCount', 'chunkCount'];
|
|
30
|
-
export const METRICS_WEBPACK_MODULES = ['moduleCount'];
|
|
30
|
+
export const METRICS_WEBPACK_MODULES = ['moduleCount', 'duplicateModulesCount', 'duplicateCode'];
|
|
31
31
|
export const METRICS_WEBPACK_PACKAGES = ['packageCount', 'duplicatePackagesCount'];
|
package/lib-esm/css/default.css
CHANGED
|
@@ -1,18 +1,29 @@
|
|
|
1
|
+
@import url("~modern-css-reset/dist/reset.css");
|
|
2
|
+
|
|
1
3
|
:root {
|
|
2
4
|
--chart-height: 180px;
|
|
3
5
|
}
|
|
4
6
|
|
|
7
|
+
/** modern-css-reset updates */
|
|
8
|
+
pre,
|
|
9
|
+
ul,
|
|
10
|
+
ol,
|
|
11
|
+
button {
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
5
15
|
html {
|
|
16
|
+
font-family: var(--font-family);
|
|
6
17
|
font-size: 81.25%;
|
|
7
|
-
line-height: 1.
|
|
18
|
+
line-height: 1.6;
|
|
8
19
|
}
|
|
9
20
|
|
|
10
21
|
body {
|
|
22
|
+
background: var(--color-background);
|
|
11
23
|
color: var(--color-text);
|
|
12
24
|
}
|
|
13
25
|
|
|
14
|
-
h1, h2, h3, h4, h5 {
|
|
15
|
-
margin-bottom: var(--space-small);
|
|
26
|
+
h1, h2, h3, h4, h5, h6 {
|
|
16
27
|
color: var(--color-heading);
|
|
17
28
|
font-weight: 500;
|
|
18
29
|
}
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
--size-xxlarge: 1.424rem;
|
|
24
24
|
--size-xxxlarge: 1.602rem;
|
|
25
25
|
|
|
26
|
-
--line-height:
|
|
26
|
+
--line-height: 1.6em;
|
|
27
27
|
|
|
28
28
|
/*
|
|
29
29
|
* Color scheme:
|
|
30
|
-
* http://mcg.mbitson.com/#!?mcgpalette0=%23dd555e&mcgpalette1=%2363bf5e&mcgpalette2=%23f7e37d&mcgpalette3=%23636568&mcgpalette4=%233385d6&themename=mcgtheme
|
|
31
30
|
* https://coolors.co/3385d6-dd555e-63bf5e-f7e37d-192339
|
|
31
|
+
* http://mcg.mbitson.com/#!?mcgpalette0=%23dd555e&mcgpalette1=%2363bf5e&mcgpalette2=%23f7e37d&mcgpalette3=%235b5d60&mcgpalette4=%233385d6&themename=mcgtheme
|
|
32
32
|
*/
|
|
33
33
|
--color-gray-25: #fafafa;
|
|
34
|
-
--color-gray-50: #
|
|
35
|
-
--color-gray-100: #
|
|
36
|
-
--color-gray-200: #
|
|
37
|
-
--color-gray-300: #
|
|
38
|
-
--color-gray-400: #
|
|
39
|
-
--color-gray-500: #
|
|
40
|
-
--color-gray-600: #
|
|
41
|
-
--color-gray-700: #
|
|
42
|
-
--color-gray-800: #
|
|
43
|
-
--color-gray-900: #
|
|
34
|
+
--color-gray-50: #e4e4e5;
|
|
35
|
+
--color-gray-100: #cececf;
|
|
36
|
+
--color-gray-200: #adaeb0;
|
|
37
|
+
--color-gray-300: #8c8e90;
|
|
38
|
+
--color-gray-400: #747578;
|
|
39
|
+
--color-gray-500: #5b5d60;
|
|
40
|
+
--color-gray-600: #535558;
|
|
41
|
+
--color-gray-700: #494b4e;
|
|
42
|
+
--color-gray-800: #404144;
|
|
43
|
+
--color-gray-900: #2f3033;
|
|
44
44
|
|
|
45
45
|
--color-gray-ultra-light: var(--color-gray-200);
|
|
46
46
|
--color-gray-light: var(--color-gray-300);
|
|
47
47
|
--color-gray: var(--color-gray-500);
|
|
48
|
-
--color-gray-dark: var(--color-gray-
|
|
49
|
-
--color-gray-ultra-dark: var(--color-gray-
|
|
48
|
+
--color-gray-dark: var(--color-gray-600);
|
|
49
|
+
--color-gray-ultra-dark: var(--color-gray-700);
|
|
50
50
|
|
|
51
51
|
--color-red-25: #fdf5f6;
|
|
52
52
|
--color-red-50: #fbebec;
|
|
@@ -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: 3px;
|
|
185
|
+
--radius-medium: var(--space-xxxsmall);
|
|
186
|
+
--radius-large: var(--space-xxsmall);
|
|
187
187
|
|
|
188
188
|
/** Layout */
|
|
189
189
|
--max-width: 80rem;
|