@bundle-stats/ui 3.4.0-beta.0 → 4.0.0-alpha.10

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.
Files changed (141) hide show
  1. package/lib/app/app.js +6 -21
  2. package/lib/app/app.stories.js +1 -22
  3. package/lib/assets/icons.svg +0 -8
  4. package/lib/components/asset-info/asset-info.js +1 -1
  5. package/lib/components/bundle-assets/bundle-assets.js +1 -1
  6. package/lib/components/bundle-assets/index.js +1 -1
  7. package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +1 -1
  8. package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.js +8 -43
  9. package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
  10. package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +1 -20
  11. package/lib/components/bundle-modules/bundle-modules.js +2 -3
  12. package/lib/components/bundle-modules/index.js +1 -1
  13. package/lib/components/bundle-packages/bundle-packages.js +3 -2
  14. package/lib/components/bundle-packages/index.js +1 -1
  15. package/lib/components/component-link.js +1 -1
  16. package/lib/components/index.js +0 -8
  17. package/lib/components/job-meta/job-meta.js +1 -1
  18. package/lib/components/job-name/job-name.js +1 -1
  19. package/lib/components/metrics-table/metrics-table.js +1 -1
  20. package/lib/components/metrics-table-options/metrics-table-options.js +1 -1
  21. package/lib/components/module-info/module-info.js +1 -1
  22. package/lib/components/summary/summary.js +8 -13
  23. package/lib/components/summary/summary.stories.js +1 -58
  24. package/lib/components/summary-item/summary-item.js +6 -21
  25. package/lib/components/summary-item/summary-item.module.css +0 -6
  26. package/lib/components/summary-item/summary-item.stories.js +53 -65
  27. package/lib/constants.js +4 -4
  28. package/lib/layout/box/box.js +1 -1
  29. package/lib/layout/flex-stack/flex-stack.js +1 -1
  30. package/lib/layout/footer/footer.js +1 -1
  31. package/lib/layout/separator.js +1 -1
  32. package/lib/layout/stack/stack.js +1 -1
  33. package/lib/query-state.js +1 -1
  34. package/lib/ui/alert/alert.js +3 -13
  35. package/lib/ui/container/container.js +1 -1
  36. package/lib/ui/filters/filters.container.js +3 -3
  37. package/lib/ui/filters/filters.js +1 -1
  38. package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.js +2 -2
  39. package/lib/ui/hover-card/hover-card.js +1 -1
  40. package/lib/ui/hover-card/hover-card.stories.js +1 -1
  41. package/lib/ui/icon/icon.js +1 -3
  42. package/lib/ui/input/input.js +1 -1
  43. package/lib/ui/loader/loader.js +1 -1
  44. package/lib/ui/logo/logo.js +1 -1
  45. package/lib/ui/panels/panels.js +1 -1
  46. package/lib/ui/skeleton/skeleton.js +1 -1
  47. package/lib/ui/sort-dropdown/sort-dropdown.js +1 -1
  48. package/lib/ui/tag/tag.js +1 -1
  49. package/lib/ui/tooltip/tooltip.js +1 -1
  50. package/lib-esm/app/app.js +6 -20
  51. package/lib-esm/app/app.stories.js +1 -22
  52. package/lib-esm/assets/icons.svg +0 -8
  53. package/lib-esm/components/asset-info/asset-info.js +1 -1
  54. package/lib-esm/components/bundle-assets/bundle-assets.js +1 -1
  55. package/lib-esm/components/bundle-assets/bundle-assets.utils.js +1 -0
  56. package/lib-esm/components/bundle-assets/index.js +1 -1
  57. package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +1 -1
  58. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +8 -24
  59. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
  60. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +0 -18
  61. package/lib-esm/components/bundle-modules/bundle-modules.js +2 -3
  62. package/lib-esm/components/bundle-modules/index.js +1 -1
  63. package/lib-esm/components/bundle-packages/bundle-packages.js +3 -2
  64. package/lib-esm/components/bundle-packages/bundle-packages.utils.js +1 -0
  65. package/lib-esm/components/bundle-packages/index.js +1 -1
  66. package/lib-esm/components/component-link.js +1 -1
  67. package/lib-esm/components/index.js +0 -1
  68. package/lib-esm/components/job-meta/job-meta.js +1 -1
  69. package/lib-esm/components/job-name/job-name.js +1 -1
  70. package/lib-esm/components/metrics-table/metrics-table.js +1 -1
  71. package/lib-esm/components/metrics-table-options/metrics-table-options.js +1 -1
  72. package/lib-esm/components/module-info/module-info.js +1 -1
  73. package/lib-esm/components/summary/summary.js +9 -12
  74. package/lib-esm/components/summary/summary.stories.js +1 -56
  75. package/lib-esm/components/summary-item/summary-item.js +5 -18
  76. package/lib-esm/components/summary-item/summary-item.module.css +0 -6
  77. package/lib-esm/components/summary-item/summary-item.stories.js +38 -64
  78. package/lib-esm/constants.js +4 -4
  79. package/lib-esm/layout/box/box.js +1 -1
  80. package/lib-esm/layout/flex-stack/flex-stack.js +1 -1
  81. package/lib-esm/layout/footer/footer.js +1 -1
  82. package/lib-esm/layout/separator.js +1 -1
  83. package/lib-esm/layout/stack/stack.js +1 -1
  84. package/lib-esm/query-state.js +1 -1
  85. package/lib-esm/ui/alert/alert.js +3 -6
  86. package/lib-esm/ui/container/container.js +1 -1
  87. package/lib-esm/ui/filters/filters.container.js +1 -1
  88. package/lib-esm/ui/filters/filters.js +2 -1
  89. package/lib-esm/ui/hover-card/hover-card.js +1 -1
  90. package/lib-esm/ui/hover-card/hover-card.stories.js +1 -1
  91. package/lib-esm/ui/icon/icon.js +1 -3
  92. package/lib-esm/ui/input/input.js +1 -1
  93. package/lib-esm/ui/loader/loader.js +1 -1
  94. package/lib-esm/ui/logo/logo.js +1 -1
  95. package/lib-esm/ui/panels/panels.js +1 -1
  96. package/lib-esm/ui/skeleton/skeleton.js +1 -1
  97. package/lib-esm/ui/sort-dropdown/sort-dropdown.js +1 -1
  98. package/lib-esm/ui/tag/tag.js +1 -1
  99. package/lib-esm/ui/tooltip/tooltip.js +1 -1
  100. package/package.json +22 -22
  101. package/src/app/app.jsx +5 -12
  102. package/src/assets/icons.svg +0 -8
  103. package/src/components/bundle-assets-totals-table/bundle-assets-totals-table.jsx +13 -27
  104. package/src/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
  105. package/src/components/bundle-modules/bundle-modules.jsx +0 -1
  106. package/src/components/bundle-packages/bundle-packages.jsx +2 -2
  107. package/src/components/index.js +0 -1
  108. package/src/components/summary/summary.jsx +7 -8
  109. package/src/components/summary-item/summary-item.jsx +3 -10
  110. package/src/components/summary-item/summary-item.module.css +0 -6
  111. package/src/constants.js +11 -7
  112. package/src/ui/alert/alert.jsx +2 -7
  113. package/src/ui/icon/icon.jsx +0 -2
  114. package/lib/assets/icons/alert-circle.svg +0 -1
  115. package/lib/assets/icons/check-circle.svg +0 -1
  116. package/lib/components/budget-info/budget-info.js +0 -74
  117. package/lib/components/budget-info/budget-info.module.css +0 -40
  118. package/lib/components/budget-info/budget-info.stories.js +0 -59
  119. package/lib/components/budget-info/index.js +0 -18
  120. package/lib/components/budget-insights/budget-insights.js +0 -162
  121. package/lib/components/budget-insights/budget-insights.module.css +0 -61
  122. package/lib/components/budget-insights/budget-insights.stories.js +0 -165
  123. package/lib/components/budget-insights/index.js +0 -18
  124. package/lib-esm/assets/icons/alert-circle.svg +0 -1
  125. package/lib-esm/assets/icons/check-circle.svg +0 -1
  126. package/lib-esm/components/budget-info/budget-info.js +0 -57
  127. package/lib-esm/components/budget-info/budget-info.module.css +0 -40
  128. package/lib-esm/components/budget-info/budget-info.stories.js +0 -45
  129. package/lib-esm/components/budget-info/index.js +0 -1
  130. package/lib-esm/components/budget-insights/budget-insights.js +0 -112
  131. package/lib-esm/components/budget-insights/budget-insights.module.css +0 -61
  132. package/lib-esm/components/budget-insights/budget-insights.stories.js +0 -144
  133. package/lib-esm/components/budget-insights/index.js +0 -1
  134. package/src/assets/icons/alert-circle.svg +0 -1
  135. package/src/assets/icons/check-circle.svg +0 -1
  136. package/src/components/budget-info/budget-info.jsx +0 -55
  137. package/src/components/budget-info/budget-info.module.css +0 -40
  138. package/src/components/budget-info/index.js +0 -1
  139. package/src/components/budget-insights/budget-insights.jsx +0 -124
  140. package/src/components/budget-insights/budget-insights.module.css +0 -61
  141. package/src/components/budget-insights/index.js +0 -1
@@ -1,10 +1,4 @@
1
- .root {
2
- position: relative;
3
- padding-right: var(--space-xlarge);
4
- }
5
-
6
1
  .title {
7
- align-items: center;
8
2
  color: var(--color-text-ultra-light);
9
3
  font-weight: bold;
10
4
  font-size: var(--size-xsmall);
@@ -2,70 +2,44 @@ import React from 'react';
2
2
  import { SummaryItem } from './summary-item';
3
3
  export default {
4
4
  title: 'Components/SummaryItem',
5
- component: SummaryItem,
6
- decorators: [Story => /*#__PURE__*/React.createElement("div", {
7
- style: {
8
- maxWidth: '320px'
9
- }
10
- }, /*#__PURE__*/React.createElement(Story, null))],
11
- args: {
12
- loading: false,
13
- id: 'webpack.totalSizeByTypeALL',
14
- data: {
15
- current: 120 * 1000,
16
- baseline: 100 * 1000
17
- }
18
- }
19
- };
20
-
21
- const Template = args => /*#__PURE__*/React.createElement(SummaryItem, args);
22
-
23
- export const Standard = Template.bind();
24
- export const SizeLarge = Template.bind();
25
- SizeLarge.args = {
26
- size: 'large'
27
- };
28
- export const ShowMetricDescription = Template.bind();
29
- ShowMetricDescription.args = {
30
- showMetricDescription: true
31
- };
32
- export const ShowDeltaFalse = Template.bind();
33
- ShowDeltaFalse.args = {
34
- showDelta: false
5
+ component: SummaryItem
35
6
  };
36
- export const BudgetError = Template.bind();
37
- BudgetError.args = {
38
- showMetricDescription: true,
39
- budget: {
40
- type: 'ERROR',
41
- message: {
42
- text: 'Metric is over the budget',
43
- md: 'Metric is over the budget'
44
- },
45
- data: {
46
- currentValue: 120 * 1000,
47
- budgetValue: 100 * 1000,
48
- failed: true
49
- }
7
+ export const Standard = () => /*#__PURE__*/React.createElement(SummaryItem, {
8
+ loading: false,
9
+ id: "webpack.totalSizeByTypeALL",
10
+ data: {
11
+ current: 120 * 1000,
12
+ baseline: 100 * 1000
50
13
  }
51
- };
52
- export const BudgetSuccess = Template.bind();
53
- BudgetSuccess.args = {
54
- showMetricDescription: true,
55
- budget: {
56
- type: 'SUCCESS',
57
- message: {
58
- text: 'Metric is under the budget',
59
- md: 'Metric is under the budget'
60
- },
61
- data: {
62
- currentValue: 120 * 1000,
63
- budgetValue: 120 * 1024,
64
- failed: false
65
- }
14
+ });
15
+ export const SizeLarge = () => /*#__PURE__*/React.createElement(SummaryItem, {
16
+ size: "large",
17
+ loading: false,
18
+ id: "webpack.totalSizeByTypeALL",
19
+ data: {
20
+ current: 120 * 1000,
21
+ baseline: 100 * 1000
66
22
  }
67
- };
68
- export const Loading = Template.bind();
69
- Loading.args = {
70
- loading: true
71
- };
23
+ });
24
+ export const ShowMetricDescription = () => /*#__PURE__*/React.createElement(SummaryItem, {
25
+ loading: false,
26
+ id: "webpack.totalSizeByTypeALL",
27
+ data: {
28
+ current: 120 * 1000,
29
+ baseline: 100 * 1000
30
+ },
31
+ showMetricDescription: true
32
+ });
33
+ export const ShowDeltaFalse = () => /*#__PURE__*/React.createElement(SummaryItem, {
34
+ loading: false,
35
+ id: "webpack.totalSizeByTypeALL",
36
+ data: {
37
+ current: 120 * 1000,
38
+ baseline: 0
39
+ },
40
+ showDelta: false
41
+ });
42
+ export const Loading = () => /*#__PURE__*/React.createElement(SummaryItem, {
43
+ loading: true,
44
+ id: "webpack.totalSizeByTypeALL"
45
+ });
@@ -25,7 +25,7 @@ export const SECTION_URLS = {
25
25
  export const ASSETS_SIZES_FILE_TYPE_MAP = FILE_TYPES.reduce((agg, fileType) => ({ ...agg,
26
26
  [`webpack.sizes.totalSizeByType${fileType}`]: fileType
27
27
  }), {});
28
- export const METRICS_WEBPACK_GENERAL = ['totalSizeByTypeALL', 'totalInitialSizeJS', 'totalInitialSizeCSS', 'cacheInvalidation'];
29
- export const METRICS_WEBPACK_ASSETS = ['assetCount', 'chunkCount'];
30
- export const METRICS_WEBPACK_MODULES = ['moduleCount', 'duplicateModulesCount', 'duplicateCode'];
31
- export const METRICS_WEBPACK_PACKAGES = ['packageCount', 'duplicatePackagesCount'];
28
+ export const METRICS_WEBPACK_GENERAL = ['webpack.totalSizeByTypeALL', 'webpack.totalInitialSizeJS', 'webpack.totalInitialSizeCSS', 'webpack.cacheInvalidation'];
29
+ export const METRICS_WEBPACK_ASSETS = ['webpack.assetCount', 'webpack.chunkCount'];
30
+ export const METRICS_WEBPACK_MODULES = ['webpack.moduleCount', 'webpack.duplicateModulesCount', 'webpack.duplicateCode'];
31
+ export const METRICS_WEBPACK_PACKAGES = ['webpack.packageCount', 'webpack.duplicatePackagesCount'];
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,7 +1,7 @@
1
1
  import _merge from "lodash/merge";
2
2
  import _isEqual from "lodash/isEqual";
3
3
 
4
- 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); }
4
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
5
5
 
6
6
  import React, { useCallback } from 'react';
7
7
  import { Route, useHistory, useLocation } from 'react-router-dom';
@@ -1,5 +1,3 @@
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
-
3
1
  import React from 'react';
4
2
  import cx from 'classnames';
5
3
  import PropTypes from 'prop-types';
@@ -9,14 +7,13 @@ export const Alert = props => {
9
7
  const {
10
8
  className,
11
9
  kind,
12
- children,
13
- ...restProps
10
+ children
14
11
  } = props;
15
- return /*#__PURE__*/React.createElement(Box, _extends({
12
+ return /*#__PURE__*/React.createElement(Box, {
16
13
  padding: ['xsmall', 'small'],
17
14
  outline: true,
18
15
  className: cx(css.root, className, css[kind])
19
- }, restProps), children);
16
+ }, children);
20
17
  };
21
18
  Alert.propTypes = {
22
19
  className: PropTypes.string,
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,6 +1,6 @@
1
1
  import _isEqual from "lodash/isEqual";
2
2
 
3
- 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); }
3
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
4
4
 
5
5
  import React from 'react';
6
6
  import PropTypes from 'prop-types';
@@ -1,6 +1,7 @@
1
1
  import _get from "lodash/get";
2
+ import "core-js/modules/es.array.includes.js";
2
3
 
3
- 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); }
4
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
4
5
 
5
6
  import React from 'react';
6
7
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React, { useCallback } from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import { HoverCard } from '.';
@@ -1,17 +1,15 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import cx from 'classnames';
6
6
  import css from './icon.module.css';
7
7
  const ICONS = {
8
- ALERT_CIRCLE: 'alert-circle',
9
8
  ARROW: 'arrow',
10
9
  ARROW_RIGHT_CIRLCE: 'arrow-right-circle',
11
10
  CANCEL: 'cancel',
12
11
  CLOSE: 'close',
13
12
  CLOCK: 'clock',
14
- CHECK_CIRCLE: 'check-circle',
15
13
  COMMIT: 'commit',
16
14
  FILTER: 'filter',
17
15
  HELP: 'help',
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import cx from 'classnames';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
@@ -1,4 +1,4 @@
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); }
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bundle-stats/ui",
3
- "version": "3.4.0-beta.0",
3
+ "version": "4.0.0-alpha.10",
4
4
  "description": "UI components for BundleStats projects.",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -36,28 +36,28 @@
36
36
  },
37
37
  "homepage": "https://github.com/relative-ci/bundle-stats/blob/master/packages/ui#readme",
38
38
  "devDependencies": {
39
- "@babel/cli": "7.17.6",
40
- "@babel/core": "7.17.9",
41
- "@babel/plugin-proposal-class-properties": "7.16.7",
42
- "@babel/preset-env": "7.16.11",
43
- "@babel/preset-react": "7.16.7",
39
+ "@babel/cli": "7.17.10",
40
+ "@babel/core": "7.18.5",
41
+ "@babel/plugin-proposal-class-properties": "7.17.12",
42
+ "@babel/preset-env": "7.18.2",
43
+ "@babel/preset-react": "7.17.12",
44
44
  "@simplyianm/babel-plugin-inline-react-svg": "1.2.0",
45
- "@storybook/addon-essentials": "6.4.20",
45
+ "@storybook/addon-essentials": "6.5.9",
46
46
  "@storybook/addon-knobs": "6.4.0",
47
47
  "@storybook/addon-postcss": "2.0.0",
48
- "@storybook/addon-storyshots": "6.4.20",
49
- "@storybook/addons": "6.4.20",
50
- "@storybook/builder-webpack5": "6.4.20",
51
- "@storybook/manager-webpack5": "6.4.20",
52
- "@storybook/react": "6.4.20",
48
+ "@storybook/addon-storyshots": "6.5.9",
49
+ "@storybook/addons": "6.5.9",
50
+ "@storybook/builder-webpack5": "6.5.9",
51
+ "@storybook/manager-webpack5": "6.5.9",
52
+ "@storybook/react": "6.5.9",
53
53
  "babel-core": "7.0.0-bridge.0",
54
- "babel-jest": "27.5.1",
54
+ "babel-jest": "28.1.1",
55
55
  "babel-plugin-lodash": "3.3.4",
56
56
  "babel-plugin-require-context-hook": "1.0.0",
57
- "chromatic": "6.5.3",
57
+ "chromatic": "6.6.3",
58
58
  "classnames": "2.3.1",
59
59
  "colormap": "2.3.2",
60
- "core-js": "3.21.1",
60
+ "core-js": "3.23.1",
61
61
  "cross-env": "7.0.3",
62
62
  "enzyme": "3.11.0",
63
63
  "enzyme-adapter-react-16": "1.15.6",
@@ -67,11 +67,11 @@
67
67
  "jest": "27.5.1",
68
68
  "jest-date-mock": "1.0.8",
69
69
  "lodash": "4.17.21",
70
- "postcss": "8.4.12",
70
+ "postcss": "8.4.14",
71
71
  "prop-types": "15.8.1",
72
72
  "react": "16.14.0",
73
73
  "react-dom": "16.14.0",
74
- "react-router-dom": "5.3.0",
74
+ "react-router-dom": "5.3.1",
75
75
  "react-test-renderer": "16.14.0",
76
76
  "rimraf": "3.0.2"
77
77
  },
@@ -80,17 +80,17 @@
80
80
  "core-js": "^3.0.0",
81
81
  "lodash": "^4.0.0",
82
82
  "prop-types": "^15.0.0",
83
- "react": "^16.0.0",
84
- "react-dom": "^16.0.0",
83
+ "react": "^16.0.0 || ^17.0.0",
84
+ "react-dom": "^16.0.0 || ^17.0.0",
85
85
  "react-router-dom": "^5.0.0"
86
86
  },
87
87
  "dependencies": {
88
- "@bundle-stats/utils": "^3.4.0-beta.0",
89
- "ariakit": "2.0.0-alpha.21",
88
+ "@bundle-stats/utils": "^4.0.0-alpha.10",
89
+ "ariakit": "2.0.0-next.30",
90
90
  "date-fns": "^2.28.0",
91
91
  "modern-css-reset": "^1.4.0",
92
92
  "query-string": "^7.1.0",
93
93
  "use-query-params": "^1.2.3"
94
94
  },
95
- "gitHead": "45774cba629c670df5528d72a67d3cfaddd8fed7"
95
+ "gitHead": "2c53bcf5bcdd840a987063767d12101a359e11ac"
96
96
  }
package/src/app/app.jsx CHANGED
@@ -13,7 +13,6 @@ import {
13
13
  import { Box } from '../layout/box';
14
14
  import { Container } from '../ui/container';
15
15
  import { DuplicatePackagesWarning } from '../components/duplicate-packages-warning';
16
- import { BudgetInsights } from '../components/budget-insights';
17
16
  import { Summary } from '../components/summary';
18
17
  import { BundleAssets } from '../components/bundle-assets';
19
18
  import { BundleAssetsTotalsChartBars } from '../components/bundle-assets-totals-chart-bars';
@@ -78,13 +77,10 @@ const OverviewContent = () => {
78
77
  <Stack space="medium">
79
78
  {duplicatePackagesInsights && (
80
79
  <Container>
81
- <Stack space="small">
82
- <DuplicatePackagesWarning
83
- duplicatePackagesCount={duplicatePackagesCount}
84
- showDelta={jobs.length > 1}
85
- />
86
- <BudgetInsights source="webpack" budgets={jobs[0].insights?.webpack?.budgets} />
87
- </Stack>
80
+ <DuplicatePackagesWarning
81
+ duplicatePackagesCount={duplicatePackagesCount}
82
+ showDelta={jobs.length > 1}
83
+ />
88
84
  </Container>
89
85
  )}
90
86
  <Container>
@@ -108,7 +104,6 @@ const AssetsContent = () => {
108
104
  <Summary
109
105
  keys={METRICS_WEBPACK_ASSETS}
110
106
  data={jobs?.[0]?.summary}
111
- budgets={jobs[0].insights?.webpack?.budgets}
112
107
  showSummaryItemDelta={jobs?.length !== 1}
113
108
  />
114
109
  <Box outline>
@@ -131,7 +126,6 @@ const ModulesContent = () => {
131
126
  <Summary
132
127
  keys={METRICS_WEBPACK_MODULES}
133
128
  data={jobs?.[0]?.summary}
134
- budgets={jobs[0].insights?.webpack?.budgets}
135
129
  showSummaryItemDelta={jobs?.length !== 1}
136
130
  />
137
131
  <Box outline>
@@ -154,7 +148,6 @@ const PackagesContent = () => {
154
148
  <Summary
155
149
  keys={METRICS_WEBPACK_PACKAGES}
156
150
  data={jobs?.[0]?.summary}
157
- budgets={jobs[0].insights?.webpack?.budgets}
158
151
  showSummaryItemDelta={jobs?.length !== 1}
159
152
  />
160
153
  <Box outline>
@@ -184,10 +177,10 @@ const AppComponent = ({ version, jobs }) => {
184
177
  size="large"
185
178
  keys={METRICS_WEBPACK_GENERAL}
186
179
  data={jobs[0].summary}
187
- budgets={jobs[0].insights?.webpack?.budgets}
188
180
  showSummaryItemDelta={jobs.length !== 1}
189
181
  />
190
182
  </Container>
183
+
191
184
  <Container className={css.tabsContainer}>
192
185
  <Tabs className={css.tabs}>
193
186
  <NavLink exact to={URLS.OVERVIEW} activeClassName={css.tabActive}>
@@ -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"/>
@@ -1,15 +1,11 @@
1
- import React, { useCallback, useMemo } from 'react';
1
+ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { get } from 'lodash';
4
3
  import { getBundleAssetsFileTypeComponentLink } from '@bundle-stats/utils';
5
4
  import * as webpack from '@bundle-stats/utils/lib-esm/webpack';
6
5
 
7
6
  import { ASSETS_SIZES_FILE_TYPE_MAP } from '../../constants';
8
- import { FlexStack } from '../../layout/flex-stack';
9
7
  import { MetricsTable } from '../metrics-table';
10
8
  import { ComponentLink } from '../component-link';
11
- import { BudgetInfo } from '../budget-info';
12
- import css from './bundle-assets-totals-table.module.css';
13
9
 
14
10
  export const BundleAssetsTotalsTable = ({
15
11
  className,
@@ -17,28 +13,18 @@ export const BundleAssetsTotalsTable = ({
17
13
  customComponentLink: CustomComponentLink,
18
14
  ...restProps
19
15
  }) => {
20
- const items = useMemo(() => webpack.compareBySection.sizes(jobs), [jobs]);
21
- const budgets = jobs[0].insights?.webpack?.budgets?.data;
22
-
23
- const renderRowHeader = useCallback(
24
- (item) => {
25
- const fileType = ASSETS_SIZES_FILE_TYPE_MAP[item.key];
26
- const { section, title, params } = getBundleAssetsFileTypeComponentLink(fileType, item.label);
27
- const [_, ...metricSlugs] = item.key.split('.');
28
- const metricKey = metricSlugs.join('.');
29
- const budget = get(budgets, metricKey);
30
-
31
- return (
32
- <CustomComponentLink section={section} title={title} params={params}>
33
- <FlexStack space="xxxsmall" className={css.itemTitleText}>
34
- <span>{item.label}</span>
35
- {budget && <BudgetInfo budgetInsight={budget} />}
36
- </FlexStack>
37
- </CustomComponentLink>
38
- );
39
- },
40
- [CustomComponentLink],
41
- );
16
+ const items = webpack.compareBySection.sizes(jobs);
17
+
18
+ const renderRowHeader = (item) => {
19
+ const fileType = ASSETS_SIZES_FILE_TYPE_MAP[item.key];
20
+ const { section, title, params } = getBundleAssetsFileTypeComponentLink(fileType, item.label);
21
+
22
+ return (
23
+ <CustomComponentLink section={section} title={title} params={params}>
24
+ {item.label}
25
+ </CustomComponentLink>
26
+ );
27
+ };
42
28
 
43
29
  return (
44
30
  <MetricsTable
@@ -1,3 +1,3 @@
1
- .itemTitleText {
2
- align-items: center;
1
+ .title {
2
+ color: var(--color-text-light);
3
3
  }
@@ -133,7 +133,6 @@ export const BundleModules = ({
133
133
  [MODULE_FILTERS.DUPLICATED]: {
134
134
  label: 'Duplicate',
135
135
  defaultValue: filters[MODULE_FILTERS.DUPLICATED],
136
- disabled: jobs.length <= 1,
137
136
  },
138
137
  [MODULE_SOURCE_TYPE]: {
139
138
  label: 'Source',
@@ -28,8 +28,8 @@ import { MetricsTableTitle } from '../metrics-table-title';
28
28
  import css from './bundle-packages.module.css';
29
29
 
30
30
  const PackagePopoverContent = ({ name, fullName, path, duplicate, CustomComponentLink }) => {
31
- const normalizedPackagePath =
32
- path || `node_modules/${fullName.split(PACKAGES_SEPARATOR).join('/node_modules/')}/`;
31
+ const fallbackPackagePath = `node_modules/${fullName.split(PACKAGES_SEPARATOR).join('/node_modules/')}`;
32
+ const normalizedPackagePath = `${path || fallbackPackagePath}/`;
33
33
  const [normalizedName, packageId] = name.split(PACKAGE_ID_SEPARATOR);
34
34
 
35
35
  return (
@@ -4,7 +4,6 @@ export { BundleAssetsTotalsTable } from './bundle-assets-totals-table';
4
4
  export { BundleAssetsTotalsChartBars } from './bundle-assets-totals-chart-bars';
5
5
  export { BundlePackages } from './bundle-packages';
6
6
  export { BundleModules } from './bundle-modules';
7
- export { BudgetInsights } from './budget-insights';
8
7
  export { ComponentLink } from './component-link';
9
8
  export { DuplicatePackagesWarning } from './duplicate-packages-warning';
10
9
  export { Delta } from './delta';