@bundle-stats/ui 3.3.0-alpha.1 → 3.3.1-beta.12
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/lib/app/app.js +126 -104
- package/lib/app/app.module.css +11 -4
- package/lib/app/app.stories.js +1 -22
- package/lib/app/header/header.js +3 -11
- package/lib/assets/icons.svg +0 -8
- package/lib/components/asset-info/asset-info.module.css +1 -0
- package/lib/components/bundle-assets/bundle-assets.js +105 -52
- package/lib/components/bundle-assets/bundle-assets.module.css +24 -26
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.js +16 -42
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +1 -20
- 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/index.js +0 -8
- 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 +7 -12
- package/lib/components/summary/summary.module.css +1 -1
- package/lib/components/summary/summary.stories.js +0 -29
- package/lib/components/summary-item/summary-item.js +18 -38
- package/lib/components/summary-item/summary-item.module.css +1 -34
- package/lib/components/summary-item/summary-item.stories.js +53 -51
- package/lib/components/total-size-type-title/total-size-type-title.js +7 -3
- package/lib/constants.js +4 -4
- 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/alert/alert.js +3 -13
- 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/{components/budget-info → ui/hover-card}/index.js +4 -4
- package/lib/ui/icon/icon.js +6 -8
- 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 +121 -103
- package/lib-esm/app/app.module.css +11 -4
- package/lib-esm/app/app.stories.js +1 -22
- package/lib-esm/app/header/header.js +3 -10
- package/lib-esm/assets/icons.svg +0 -8
- package/lib-esm/components/asset-info/asset-info.module.css +1 -0
- package/lib-esm/components/bundle-assets/bundle-assets.js +98 -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 +13 -26
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +0 -18
- 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/index.js +0 -1
- 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 +7 -11
- package/lib-esm/components/summary/summary.module.css +1 -1
- package/lib-esm/components/summary/summary.stories.js +0 -27
- package/lib-esm/components/summary-item/summary-item.js +16 -36
- package/lib-esm/components/summary-item/summary-item.module.css +1 -34
- package/lib-esm/components/summary-item/summary-item.stories.js +38 -50
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +6 -3
- package/lib-esm/constants.js +4 -4
- 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/alert/alert.js +3 -6
- 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 -5
- 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/lib/assets/icons/alert-circle.svg +0 -1
- package/lib/assets/icons/check-circle.svg +0 -1
- package/lib/components/budget-info/budget-info.js +0 -80
- package/lib/components/budget-info/budget-info.module.css +0 -40
- package/lib/components/budget-info/budget-info.stories.js +0 -44
- package/lib/components/budget-insights/budget-insights.js +0 -200
- package/lib/components/budget-insights/budget-insights.module.css +0 -53
- package/lib/components/budget-insights/budget-insights.stories.js +0 -104
- package/lib/components/budget-insights/index.js +0 -18
- 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/assets/icons/alert-circle.svg +0 -1
- package/lib-esm/assets/icons/check-circle.svg +0 -1
- package/lib-esm/components/budget-info/budget-info.js +0 -58
- package/lib-esm/components/budget-info/budget-info.module.css +0 -40
- package/lib-esm/components/budget-info/budget-info.stories.js +0 -30
- package/lib-esm/components/budget-info/index.js +0 -1
- package/lib-esm/components/budget-insights/budget-insights.js +0 -148
- package/lib-esm/components/budget-insights/budget-insights.module.css +0 -53
- package/lib-esm/components/budget-insights/budget-insights.stories.js +0 -84
- package/lib-esm/components/budget-insights/index.js +0 -1
- 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
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
font-family: var(--font-family);
|
|
4
|
+
font-weight: bold;
|
|
5
|
+
background: var(--color-text-light);
|
|
6
|
+
color: var(--color-light);
|
|
7
|
+
text-align: center;
|
|
8
|
+
text-transform: uppercase;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Kind variation */
|
|
12
|
+
.success {
|
|
13
|
+
background: var(--color-success);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.info {
|
|
17
|
+
background: var(--color-info);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.warning {
|
|
21
|
+
background: var(--color-warning-dark);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.danger {
|
|
25
|
+
background: var(--color-danger);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Size variation */
|
|
29
|
+
/** default: medium */
|
|
30
|
+
.root {
|
|
31
|
+
border-radius: var(--radius-medium);
|
|
32
|
+
padding: var(--space-xxxsmall);
|
|
33
|
+
min-width: var(--space-small);
|
|
34
|
+
height: var(--space-small);
|
|
35
|
+
font-size: 9px;
|
|
36
|
+
line-height: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.small {
|
|
40
|
+
border-radius: var(--radius-small);
|
|
41
|
+
padding: calc(var(--space-xxxsmall) / 2);
|
|
42
|
+
height: var(--space-xsmall);
|
|
43
|
+
min-width: var(--space-xsmall);
|
|
44
|
+
font-size: 8px;
|
|
45
|
+
line-height: 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.large {
|
|
49
|
+
border-radius: var(--radius-large);
|
|
50
|
+
padding: var(--space-xxxsmall) var(--space-xxsmall);
|
|
51
|
+
min-width: var(--space-medium);
|
|
52
|
+
height: var(--space-medium);
|
|
53
|
+
font-size: 12px;
|
|
54
|
+
line-height: var(--space-small);
|
|
55
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.OneLetter = exports.Default = void 0;
|
|
7
|
+
|
|
8
|
+
var _ = require(".");
|
|
9
|
+
|
|
10
|
+
var _default = {
|
|
11
|
+
title: 'UI/Tag',
|
|
12
|
+
component: _.Tag,
|
|
13
|
+
argTypes: {
|
|
14
|
+
kind: {
|
|
15
|
+
control: 'select',
|
|
16
|
+
options: Object.values(_.Tag.KINDS)
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
options: Object.values(_.Tag.SIZES)
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
args: {
|
|
24
|
+
children: 'tag'
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports["default"] = _default;
|
|
28
|
+
|
|
29
|
+
var Default = _.Tag.bind();
|
|
30
|
+
|
|
31
|
+
exports.Default = Default;
|
|
32
|
+
|
|
33
|
+
var OneLetter = _.Tag.bind();
|
|
34
|
+
|
|
35
|
+
exports.OneLetter = OneLetter;
|
|
36
|
+
OneLetter.args = {
|
|
37
|
+
children: 'd'
|
|
38
|
+
};
|
|
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _tooltip = require("ariakit/tooltip");
|
|
15
15
|
|
|
16
16
|
var _tooltipModule = _interopRequireDefault(require("./tooltip.module.css"));
|
|
17
17
|
|
|
@@ -34,22 +34,23 @@ var Tooltip = function Tooltip(props) {
|
|
|
34
34
|
darkMode = props.darkMode,
|
|
35
35
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
36
36
|
|
|
37
|
-
var
|
|
38
|
-
var tooltipProps = (0, _Tooltip.useTooltipState)({
|
|
39
|
-
baseId: process.env.NODE_ENV === 'test' && 'id-test',
|
|
37
|
+
var tooltip = (0, _tooltip.useTooltipState)({
|
|
40
38
|
placement: 'top'
|
|
41
39
|
});
|
|
42
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(
|
|
40
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_tooltip.TooltipAnchor, _extends({
|
|
43
41
|
as: Component,
|
|
44
|
-
className:
|
|
42
|
+
className: (0, _classnames["default"])(_tooltipModule["default"].root, className),
|
|
43
|
+
state: tooltip
|
|
45
44
|
}, ref ? {
|
|
46
45
|
ref: ref
|
|
47
|
-
} : {}, restProps
|
|
46
|
+
} : {}, restProps), children), title && /*#__PURE__*/_react["default"].createElement(_tooltip.Tooltip, {
|
|
47
|
+
state: tooltip,
|
|
48
48
|
className: (0, _classnames["default"])(_tooltipModule["default"].tooltip, darkMode && _tooltipModule["default"].tooltipDarkMode)
|
|
49
|
-
}
|
|
49
|
+
}, /*#__PURE__*/_react["default"].createElement(_tooltip.TooltipArrow, {
|
|
50
|
+
state: tooltip,
|
|
50
51
|
className: _tooltipModule["default"].arrow,
|
|
51
52
|
size: 12
|
|
52
|
-
})
|
|
53
|
+
}), title));
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
exports.Tooltip = Tooltip;
|
|
@@ -12,10 +12,11 @@
|
|
|
12
12
|
|
|
13
13
|
.tooltip {
|
|
14
14
|
padding: var(--space-xxxsmall) var(--space-xxsmall);
|
|
15
|
-
border-radius: var(--radius-
|
|
15
|
+
border-radius: var(--radius-medium);
|
|
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));
|
|
19
|
+
will-change: filter;
|
|
19
20
|
font-size: var(--size-xsmall);
|
|
20
21
|
line-height: var(--space-small);
|
|
21
22
|
}
|
package/lib-esm/app/app.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
|
-
import React, { useEffect, useMemo } from 'react';
|
|
3
|
+
import React, { useContext, useEffect, useMemo } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { HashRouter, NavLink, Route, Switch, useLocation } from 'react-router-dom';
|
|
6
6
|
import { COMPONENT } from '@bundle-stats/utils';
|
|
@@ -8,7 +8,6 @@ import { METRICS_WEBPACK_ASSETS, METRICS_WEBPACK_GENERAL, METRICS_WEBPACK_MODULE
|
|
|
8
8
|
import { Box } from '../layout/box';
|
|
9
9
|
import { Container } from '../ui/container';
|
|
10
10
|
import { DuplicatePackagesWarning } from '../components/duplicate-packages-warning';
|
|
11
|
-
import { BudgetInsights } from '../components/budget-insights';
|
|
12
11
|
import { Summary } from '../components/summary';
|
|
13
12
|
import { BundleAssets } from '../components/bundle-assets';
|
|
14
13
|
import { BundleAssetsTotalsChartBars } from '../components/bundle-assets-totals-chart-bars';
|
|
@@ -54,25 +53,129 @@ const Layout = _ref => {
|
|
|
54
53
|
|
|
55
54
|
Layout.propTypes = {
|
|
56
55
|
jobs: PropTypes.arrayOf(PropTypes.object),
|
|
56
|
+
// eslint-disable-line react/forbid-prop-types
|
|
57
57
|
version: PropTypes.string
|
|
58
58
|
};
|
|
59
59
|
Layout.defaultProps = {
|
|
60
60
|
jobs: null,
|
|
61
61
|
version: null
|
|
62
62
|
};
|
|
63
|
+
const JobsContext = /*#__PURE__*/React.createContext({
|
|
64
|
+
jobs: []
|
|
65
|
+
});
|
|
63
66
|
|
|
64
|
-
const
|
|
65
|
-
var _insights$webpack;
|
|
66
|
-
|
|
67
|
+
const JobsProvider = _ref2 => {
|
|
67
68
|
let {
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
jobs,
|
|
70
|
+
...restProps
|
|
70
71
|
} = _ref2;
|
|
72
|
+
const value = useMemo(() => ({
|
|
73
|
+
jobs
|
|
74
|
+
}), [jobs]);
|
|
75
|
+
return /*#__PURE__*/React.createElement(JobsContext.Provider, _extends({
|
|
76
|
+
value: value
|
|
77
|
+
}, restProps));
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
JobsProvider.propTypes = {
|
|
81
|
+
jobs: PropTypes.arrayOf(PropTypes.object).isRequired // eslint-disable-line react/forbid-prop-types
|
|
82
|
+
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const OverviewContent = () => {
|
|
86
|
+
const {
|
|
87
|
+
jobs
|
|
88
|
+
} = useContext(JobsContext);
|
|
89
|
+
const {
|
|
90
|
+
duplicatePackagesCount
|
|
91
|
+
} = jobs[0].summary.webpack;
|
|
92
|
+
const duplicatePackagesInsights = Boolean(duplicatePackagesCount.current || duplicatePackagesCount.baseline);
|
|
93
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
94
|
+
space: "medium"
|
|
95
|
+
}, duplicatePackagesInsights && /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(DuplicatePackagesWarning, {
|
|
96
|
+
duplicatePackagesCount: duplicatePackagesCount,
|
|
97
|
+
showDelta: jobs.length > 1
|
|
98
|
+
})), /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
99
|
+
space: "small"
|
|
100
|
+
}, /*#__PURE__*/React.createElement(TotalSizeTypeTitle, null), /*#__PURE__*/React.createElement(BundleAssetsTotalsChartBars, {
|
|
101
|
+
jobs: jobs
|
|
102
|
+
}), /*#__PURE__*/React.createElement(BundleAssetsTotalsTable, {
|
|
103
|
+
jobs: jobs,
|
|
104
|
+
outline: true
|
|
105
|
+
}))));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const AssetsContent = () => {
|
|
109
|
+
var _jobs$;
|
|
110
|
+
|
|
71
111
|
const [bundleStatsState, bundleStatsSetState] = useComponentQueryState(COMPONENT.BUNDLE_ASSETS);
|
|
72
|
-
const
|
|
112
|
+
const {
|
|
113
|
+
jobs
|
|
114
|
+
} = useContext(JobsContext);
|
|
115
|
+
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
116
|
+
space: "medium"
|
|
117
|
+
}, /*#__PURE__*/React.createElement(Summary, {
|
|
118
|
+
keys: METRICS_WEBPACK_ASSETS,
|
|
119
|
+
data: jobs == null ? void 0 : (_jobs$ = jobs[0]) == null ? void 0 : _jobs$.summary,
|
|
120
|
+
showSummaryItemDelta: (jobs == null ? void 0 : jobs.length) !== 1
|
|
121
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
122
|
+
outline: true
|
|
123
|
+
}, /*#__PURE__*/React.createElement(BundleAssets, _extends({
|
|
124
|
+
jobs: jobs,
|
|
125
|
+
setState: bundleStatsSetState
|
|
126
|
+
}, bundleStatsState)))));
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const ModulesContent = () => {
|
|
130
|
+
var _jobs$2;
|
|
131
|
+
|
|
73
132
|
const [bundleModulesState, bundleModulesSetState] = useComponentQueryState(COMPONENT.BUNDLE_MODULES);
|
|
133
|
+
const {
|
|
134
|
+
jobs
|
|
135
|
+
} = useContext(JobsContext);
|
|
136
|
+
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
137
|
+
space: "medium"
|
|
138
|
+
}, /*#__PURE__*/React.createElement(Summary, {
|
|
139
|
+
keys: METRICS_WEBPACK_MODULES,
|
|
140
|
+
data: jobs == null ? void 0 : (_jobs$2 = jobs[0]) == null ? void 0 : _jobs$2.summary,
|
|
141
|
+
showSummaryItemDelta: (jobs == null ? void 0 : jobs.length) !== 1
|
|
142
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
143
|
+
outline: true
|
|
144
|
+
}, /*#__PURE__*/React.createElement(BundleModules, _extends({
|
|
145
|
+
jobs: jobs,
|
|
146
|
+
setState: bundleModulesSetState
|
|
147
|
+
}, bundleModulesState)))));
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const PackagesContent = () => {
|
|
151
|
+
var _jobs$3;
|
|
152
|
+
|
|
153
|
+
const [bundlePackagesState, bundlePackagesSetState] = useComponentQueryState(COMPONENT.BUNDLE_PACKAGES);
|
|
154
|
+
const {
|
|
155
|
+
jobs
|
|
156
|
+
} = useContext(JobsContext);
|
|
157
|
+
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
158
|
+
space: "medium"
|
|
159
|
+
}, /*#__PURE__*/React.createElement(Summary, {
|
|
160
|
+
keys: METRICS_WEBPACK_PACKAGES,
|
|
161
|
+
data: jobs == null ? void 0 : (_jobs$3 = jobs[0]) == null ? void 0 : _jobs$3.summary,
|
|
162
|
+
showSummaryItemDelta: (jobs == null ? void 0 : jobs.length) !== 1
|
|
163
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
164
|
+
outline: true
|
|
165
|
+
}, /*#__PURE__*/React.createElement(BundlePackages, _extends({
|
|
166
|
+
jobs: jobs
|
|
167
|
+
}, bundlePackagesState, {
|
|
168
|
+
setState: bundlePackagesSetState
|
|
169
|
+
})))));
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const AppComponent = _ref3 => {
|
|
173
|
+
let {
|
|
174
|
+
version,
|
|
175
|
+
jobs
|
|
176
|
+
} = _ref3;
|
|
74
177
|
|
|
75
|
-
if (jobs.length === 0) {
|
|
178
|
+
if ((jobs == null ? void 0 : jobs.length) === 0) {
|
|
76
179
|
return /*#__PURE__*/React.createElement(Layout, {
|
|
77
180
|
version: version
|
|
78
181
|
}, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -80,15 +183,9 @@ const AppComponent = _ref2 => {
|
|
|
80
183
|
}, I18N.NO_DATA)));
|
|
81
184
|
}
|
|
82
185
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
} = useMemo(() => jobs[0], jobs);
|
|
87
|
-
const {
|
|
88
|
-
duplicatePackagesCount
|
|
89
|
-
} = summary.webpack;
|
|
90
|
-
const duplicatePackagesInsights = Boolean(duplicatePackagesCount.current || duplicatePackagesCount.baseline);
|
|
91
|
-
return /*#__PURE__*/React.createElement(Layout, {
|
|
186
|
+
return /*#__PURE__*/React.createElement(JobsProvider, {
|
|
187
|
+
jobs: jobs
|
|
188
|
+
}, /*#__PURE__*/React.createElement(Layout, {
|
|
92
189
|
jobs: jobs,
|
|
93
190
|
version: version
|
|
94
191
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
@@ -96,8 +193,7 @@ const AppComponent = _ref2 => {
|
|
|
96
193
|
}, /*#__PURE__*/React.createElement(Summary, {
|
|
97
194
|
size: "large",
|
|
98
195
|
keys: METRICS_WEBPACK_GENERAL,
|
|
99
|
-
data: summary,
|
|
100
|
-
budgets: insights == null ? void 0 : (_insights$webpack = insights.webpack) == null ? void 0 : _insights$webpack.budgets,
|
|
196
|
+
data: jobs[0].summary,
|
|
101
197
|
showSummaryItemDelta: jobs.length !== 1
|
|
102
198
|
})), /*#__PURE__*/React.createElement(Container, {
|
|
103
199
|
className: css.tabsContainer
|
|
@@ -124,98 +220,20 @@ const AppComponent = _ref2 => {
|
|
|
124
220
|
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
|
|
125
221
|
exact: true,
|
|
126
222
|
path: URLS.ASSETS,
|
|
127
|
-
|
|
128
|
-
var _insights$webpack2;
|
|
129
|
-
|
|
130
|
-
let {
|
|
131
|
-
location
|
|
132
|
-
} = _ref3;
|
|
133
|
-
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
134
|
-
space: "medium"
|
|
135
|
-
}, /*#__PURE__*/React.createElement(Summary, {
|
|
136
|
-
keys: METRICS_WEBPACK_ASSETS,
|
|
137
|
-
data: summary,
|
|
138
|
-
budgets: insights == null ? void 0 : (_insights$webpack2 = insights.webpack) == null ? void 0 : _insights$webpack2.budgets,
|
|
139
|
-
showSummaryItemDelta: jobs.length !== 1
|
|
140
|
-
}), /*#__PURE__*/React.createElement(Box, {
|
|
141
|
-
outline: true
|
|
142
|
-
}, /*#__PURE__*/React.createElement(BundleAssets, _extends({
|
|
143
|
-
jobs: jobs,
|
|
144
|
-
setState: bundleStatsSetState
|
|
145
|
-
}, bundleStatsState, {
|
|
146
|
-
key: `${location.pathname}_${location.search}`
|
|
147
|
-
})))));
|
|
148
|
-
}
|
|
223
|
+
component: AssetsContent
|
|
149
224
|
}), /*#__PURE__*/React.createElement(Route, {
|
|
150
225
|
exact: true,
|
|
151
226
|
path: URLS.MODULES,
|
|
152
|
-
|
|
153
|
-
var _insights$webpack3;
|
|
154
|
-
|
|
155
|
-
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
156
|
-
space: "medium"
|
|
157
|
-
}, /*#__PURE__*/React.createElement(Summary, {
|
|
158
|
-
keys: METRICS_WEBPACK_MODULES,
|
|
159
|
-
data: summary,
|
|
160
|
-
budgets: insights == null ? void 0 : (_insights$webpack3 = insights.webpack) == null ? void 0 : _insights$webpack3.budgets,
|
|
161
|
-
showSummaryItemDelta: jobs.length !== 1
|
|
162
|
-
}), /*#__PURE__*/React.createElement(Box, {
|
|
163
|
-
outline: true
|
|
164
|
-
}, /*#__PURE__*/React.createElement(BundleModules, _extends({
|
|
165
|
-
jobs: jobs,
|
|
166
|
-
setState: bundleModulesSetState
|
|
167
|
-
}, bundleModulesState)))));
|
|
168
|
-
}
|
|
227
|
+
component: ModulesContent
|
|
169
228
|
}), /*#__PURE__*/React.createElement(Route, {
|
|
170
229
|
exact: true,
|
|
171
230
|
path: URLS.PACKAGES,
|
|
172
|
-
|
|
173
|
-
var _insights$webpack4;
|
|
174
|
-
|
|
175
|
-
let {
|
|
176
|
-
location
|
|
177
|
-
} = _ref4;
|
|
178
|
-
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
179
|
-
space: "medium"
|
|
180
|
-
}, /*#__PURE__*/React.createElement(Summary, {
|
|
181
|
-
keys: METRICS_WEBPACK_PACKAGES,
|
|
182
|
-
data: summary,
|
|
183
|
-
budgets: insights == null ? void 0 : (_insights$webpack4 = insights.webpack) == null ? void 0 : _insights$webpack4.budgets,
|
|
184
|
-
showSummaryItemDelta: jobs.length !== 1
|
|
185
|
-
}), /*#__PURE__*/React.createElement(Box, {
|
|
186
|
-
outline: true
|
|
187
|
-
}, /*#__PURE__*/React.createElement(BundlePackages, _extends({
|
|
188
|
-
jobs: jobs
|
|
189
|
-
}, bundlePackagesState, {
|
|
190
|
-
setState: bundlePackagesSetState,
|
|
191
|
-
key: `${location.pathname}_${location.search}`
|
|
192
|
-
})))));
|
|
193
|
-
}
|
|
231
|
+
component: PackagesContent
|
|
194
232
|
}), /*#__PURE__*/React.createElement(Route, {
|
|
195
233
|
exact: true,
|
|
196
234
|
path: URLS.OVERVIEW,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return /*#__PURE__*/React.createElement(Stack, {
|
|
201
|
-
space: "large"
|
|
202
|
-
}, duplicatePackagesInsights && /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(DuplicatePackagesWarning, {
|
|
203
|
-
duplicatePackagesCount: duplicatePackagesCount,
|
|
204
|
-
showDelta: jobs.length > 1
|
|
205
|
-
})), (insights == null ? void 0 : (_insights$webpack5 = insights.webpack) == null ? void 0 : _insights$webpack5.budgets) && /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(BudgetInsights, {
|
|
206
|
-
source: "webpack",
|
|
207
|
-
budgets: insights.webpack.budgets
|
|
208
|
-
})), /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
209
|
-
space: "small"
|
|
210
|
-
}, /*#__PURE__*/React.createElement(TotalSizeTypeTitle, null), /*#__PURE__*/React.createElement(BundleAssetsTotalsChartBars, {
|
|
211
|
-
jobs: jobs
|
|
212
|
-
}), /*#__PURE__*/React.createElement(Box, {
|
|
213
|
-
outline: true
|
|
214
|
-
}, /*#__PURE__*/React.createElement(BundleAssetsTotalsTable, {
|
|
215
|
-
jobs: jobs
|
|
216
|
-
})))));
|
|
217
|
-
}
|
|
218
|
-
}))));
|
|
235
|
+
component: OverviewContent
|
|
236
|
+
})))));
|
|
219
237
|
};
|
|
220
238
|
|
|
221
239
|
AppComponent.defaultProps = {
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.summaryContainer {
|
|
16
|
-
padding-top: var(--space-
|
|
16
|
+
padding-top: var(--space-medium);
|
|
17
17
|
padding-bottom: var(--space-small);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.tabsContainer {
|
|
21
21
|
border-bottom: 1px solid var(--color-outline);
|
|
22
|
+
background: var(--color-light);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
.tabs {
|
|
@@ -34,14 +35,14 @@
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
.tabsContent {
|
|
37
|
-
padding-top: var(--space-
|
|
38
|
-
padding-bottom: var(--space-
|
|
38
|
+
padding-top: var(--space-medium);
|
|
39
|
+
padding-bottom: var(--space-medium);
|
|
39
40
|
min-height: 480px;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
@media (min-width: 600px) {
|
|
43
44
|
:root {
|
|
44
|
-
--header-height:
|
|
45
|
+
--header-height: 72px;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
.header {
|
|
@@ -54,4 +55,10 @@
|
|
|
54
55
|
background-color: var(--color-background);
|
|
55
56
|
border-bottom: 1px solid var(--color-outline);
|
|
56
57
|
}
|
|
58
|
+
|
|
59
|
+
.tabsContainer {
|
|
60
|
+
position: sticky;
|
|
61
|
+
top: var(--header-height);
|
|
62
|
+
z-index: 100;
|
|
63
|
+
}
|
|
57
64
|
}
|
|
@@ -28,28 +28,7 @@ const JOBS = createJobs([CURRENT_SOURCE, BASELINE_SOURCE], {
|
|
|
28
28
|
webpack: {
|
|
29
29
|
budgets: [{
|
|
30
30
|
metric: 'totalSizeByTypeALL',
|
|
31
|
-
value:
|
|
32
|
-
}, {
|
|
33
|
-
metric: 'totalInitialSizeJS',
|
|
34
|
-
value: 512 * 1024
|
|
35
|
-
}, {
|
|
36
|
-
metric: 'totalInitialSizeCSS',
|
|
37
|
-
value: 50 * 1024
|
|
38
|
-
}, {
|
|
39
|
-
metric: 'chunkCount',
|
|
40
|
-
value: 50
|
|
41
|
-
}, {
|
|
42
|
-
metric: 'moduleCount',
|
|
43
|
-
value: 2000
|
|
44
|
-
}, {
|
|
45
|
-
metric: 'duplicatePackagesCount',
|
|
46
|
-
value: 5
|
|
47
|
-
}, {
|
|
48
|
-
metric: 'sizes.totalSizeByTypeJS',
|
|
49
|
-
value: 2 * 1024 * 1024
|
|
50
|
-
}, {
|
|
51
|
-
metric: 'sizes.totalSizeByTypeCSS',
|
|
52
|
-
value: 20 * 1024
|
|
31
|
+
value: 1024 * 1024
|
|
53
32
|
}]
|
|
54
33
|
}
|
|
55
34
|
});
|
|
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import { Container } from '../../ui/container';
|
|
5
5
|
import { JobsHeader } from '../../components/jobs-header';
|
|
6
|
-
import { Logo } from '../../ui/logo';
|
|
7
6
|
import css from './header.module.css';
|
|
8
7
|
export const Header = _ref => {
|
|
9
8
|
let {
|
|
@@ -15,21 +14,15 @@ export const Header = _ref => {
|
|
|
15
14
|
className: cx(css.root, className)
|
|
16
15
|
}, /*#__PURE__*/React.createElement("div", {
|
|
17
16
|
className: css.inner
|
|
18
|
-
}, /*#__PURE__*/React.createElement(
|
|
19
|
-
className: css.branding,
|
|
20
|
-
href: "https://github.com/relative-ci/bundle-stats",
|
|
21
|
-
target: "_blank",
|
|
22
|
-
rel: "noopener noreferrer nofollow"
|
|
23
|
-
}, /*#__PURE__*/React.createElement(Logo, {
|
|
24
|
-
className: css.brandingLogo
|
|
25
|
-
}, "BundleStats")), /*#__PURE__*/React.createElement(JobsHeader, {
|
|
17
|
+
}, /*#__PURE__*/React.createElement(JobsHeader, {
|
|
26
18
|
className: css.jobs,
|
|
27
19
|
jobs: jobs
|
|
28
20
|
})));
|
|
29
21
|
};
|
|
30
22
|
Header.propTypes = {
|
|
31
23
|
className: PropTypes.string,
|
|
32
|
-
jobs: PropTypes.arrayOf(PropTypes.object)
|
|
24
|
+
jobs: PropTypes.arrayOf(PropTypes.object) // eslint-disable-line react/forbid-prop-types
|
|
25
|
+
|
|
33
26
|
};
|
|
34
27
|
Header.defaultProps = {
|
|
35
28
|
className: '',
|
package/lib-esm/assets/icons.svg
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
<svg width="16" height="16">
|
|
2
|
-
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-alert-circle" viewBox="0 0 24 24" id="alert-circle" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
-
<circle cx="12" cy="12" r="10"/>
|
|
4
|
-
<path d="M12 8v4M12 16h.01"/>
|
|
5
|
-
</symbol>
|
|
6
2
|
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down" id="arrow" xmlns="http://www.w3.org/2000/svg">
|
|
7
3
|
<path d="M12 5v14M19 12l-7 7-7-7"/>
|
|
8
4
|
</symbol>
|
|
@@ -14,10 +10,6 @@
|
|
|
14
10
|
<circle cx="12" cy="12" r="10"/>
|
|
15
11
|
<path d="M15 9l-6 6M9 9l6 6"/>
|
|
16
12
|
</symbol>
|
|
17
|
-
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check-circle" viewBox="0 0 24 24" id="check-circle" xmlns="http://www.w3.org/2000/svg">
|
|
18
|
-
<path d="M22 11.08V12a10 10 0 11-5.93-9.14"/>
|
|
19
|
-
<path d="M22 4L12 14.01l-3-3"/>
|
|
20
|
-
</symbol>
|
|
21
13
|
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock" id="clock" xmlns="http://www.w3.org/2000/svg">
|
|
22
14
|
<circle cx="12" cy="12" r="10"/>
|
|
23
15
|
<path d="M12 6v6l4 2"/>
|