@bundle-stats/ui 3.4.0-alpha.4 → 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 (149) hide show
  1. package/lib/app/app.js +9 -22
  2. package/lib/app/app.stories.js +1 -22
  3. package/lib/app/header/header.js +2 -1
  4. package/lib/assets/icons.svg +0 -8
  5. package/lib/components/asset-info/asset-info.js +1 -1
  6. package/lib/components/bundle-assets/bundle-assets.js +3 -2
  7. package/lib/components/bundle-assets/index.js +1 -1
  8. package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +1 -1
  9. package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.js +8 -44
  10. package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
  11. package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +1 -20
  12. package/lib/components/bundle-modules/bundle-modules.js +3 -4
  13. package/lib/components/bundle-modules/index.js +1 -1
  14. package/lib/components/bundle-packages/bundle-packages.js +3 -2
  15. package/lib/components/bundle-packages/index.js +1 -1
  16. package/lib/components/component-link.js +1 -1
  17. package/lib/components/index.js +0 -8
  18. package/lib/components/job-meta/job-meta.js +1 -1
  19. package/lib/components/job-name/job-name.js +1 -1
  20. package/lib/components/metrics-table/metrics-table.js +1 -1
  21. package/lib/components/metrics-table-options/metrics-table-options.js +1 -1
  22. package/lib/components/module-info/module-info.js +1 -1
  23. package/lib/components/summary/summary.js +13 -24
  24. package/lib/components/summary/summary.module.css +1 -45
  25. package/lib/components/summary/summary.stories.js +1 -30
  26. package/lib/components/summary-item/summary-item.js +14 -37
  27. package/lib/components/summary-item/summary-item.module.css +25 -13
  28. package/lib/components/summary-item/summary-item.stories.js +53 -51
  29. package/lib/constants.js +4 -4
  30. package/lib/layout/box/box.js +1 -1
  31. package/lib/layout/flex-stack/flex-stack.js +1 -1
  32. package/lib/layout/footer/footer.js +1 -1
  33. package/lib/layout/separator.js +1 -1
  34. package/lib/layout/stack/stack.js +1 -1
  35. package/lib/query-state.js +1 -1
  36. package/lib/ui/alert/alert.js +3 -13
  37. package/lib/ui/container/container.js +1 -1
  38. package/lib/ui/filters/filters.container.js +3 -3
  39. package/lib/ui/filters/filters.js +1 -1
  40. package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.js +2 -2
  41. package/lib/ui/hover-card/hover-card.js +8 -2
  42. package/lib/ui/hover-card/hover-card.stories.js +1 -1
  43. package/lib/ui/icon/icon.js +1 -3
  44. package/lib/ui/input/input.js +1 -1
  45. package/lib/ui/loader/loader.js +1 -1
  46. package/lib/ui/logo/logo.js +1 -1
  47. package/lib/ui/panels/panels.js +1 -1
  48. package/lib/ui/skeleton/skeleton.js +1 -1
  49. package/lib/ui/sort-dropdown/sort-dropdown.js +1 -1
  50. package/lib/ui/tag/tag.js +1 -1
  51. package/lib/ui/tooltip/tooltip.js +1 -1
  52. package/lib-esm/app/app.js +9 -21
  53. package/lib-esm/app/app.stories.js +1 -22
  54. package/lib-esm/app/header/header.js +2 -1
  55. package/lib-esm/assets/icons.svg +0 -8
  56. package/lib-esm/components/asset-info/asset-info.js +1 -1
  57. package/lib-esm/components/bundle-assets/bundle-assets.js +3 -2
  58. package/lib-esm/components/bundle-assets/bundle-assets.utils.js +1 -0
  59. package/lib-esm/components/bundle-assets/index.js +1 -1
  60. package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +1 -1
  61. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +8 -25
  62. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
  63. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +0 -18
  64. package/lib-esm/components/bundle-modules/bundle-modules.js +3 -4
  65. package/lib-esm/components/bundle-modules/index.js +1 -1
  66. package/lib-esm/components/bundle-packages/bundle-packages.js +3 -2
  67. package/lib-esm/components/bundle-packages/bundle-packages.utils.js +1 -0
  68. package/lib-esm/components/bundle-packages/index.js +1 -1
  69. package/lib-esm/components/component-link.js +1 -1
  70. package/lib-esm/components/index.js +0 -1
  71. package/lib-esm/components/job-meta/job-meta.js +1 -1
  72. package/lib-esm/components/job-name/job-name.js +1 -1
  73. package/lib-esm/components/metrics-table/metrics-table.js +1 -1
  74. package/lib-esm/components/metrics-table-options/metrics-table-options.js +1 -1
  75. package/lib-esm/components/module-info/module-info.js +1 -1
  76. package/lib-esm/components/summary/summary.js +14 -22
  77. package/lib-esm/components/summary/summary.module.css +1 -45
  78. package/lib-esm/components/summary/summary.stories.js +1 -28
  79. package/lib-esm/components/summary-item/summary-item.js +11 -33
  80. package/lib-esm/components/summary-item/summary-item.module.css +25 -13
  81. package/lib-esm/components/summary-item/summary-item.stories.js +38 -50
  82. package/lib-esm/constants.js +4 -4
  83. package/lib-esm/layout/box/box.js +1 -1
  84. package/lib-esm/layout/flex-stack/flex-stack.js +1 -1
  85. package/lib-esm/layout/footer/footer.js +1 -1
  86. package/lib-esm/layout/separator.js +1 -1
  87. package/lib-esm/layout/stack/stack.js +1 -1
  88. package/lib-esm/query-state.js +1 -1
  89. package/lib-esm/ui/alert/alert.js +3 -6
  90. package/lib-esm/ui/container/container.js +1 -1
  91. package/lib-esm/ui/filters/filters.container.js +1 -1
  92. package/lib-esm/ui/filters/filters.js +2 -1
  93. package/lib-esm/ui/hover-card/hover-card.js +8 -2
  94. package/lib-esm/ui/hover-card/hover-card.stories.js +1 -1
  95. package/lib-esm/ui/icon/icon.js +1 -3
  96. package/lib-esm/ui/input/input.js +1 -1
  97. package/lib-esm/ui/loader/loader.js +1 -1
  98. package/lib-esm/ui/logo/logo.js +1 -1
  99. package/lib-esm/ui/panels/panels.js +1 -1
  100. package/lib-esm/ui/skeleton/skeleton.js +1 -1
  101. package/lib-esm/ui/sort-dropdown/sort-dropdown.js +1 -1
  102. package/lib-esm/ui/tag/tag.js +1 -1
  103. package/lib-esm/ui/tooltip/tooltip.js +1 -1
  104. package/package.json +31 -31
  105. package/src/app/app.jsx +7 -14
  106. package/src/app/header/header.jsx +1 -1
  107. package/src/assets/icons.svg +0 -8
  108. package/src/components/bundle-assets/bundle-assets.jsx +1 -1
  109. package/src/components/bundle-assets-totals-table/bundle-assets-totals-table.jsx +13 -27
  110. package/src/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
  111. package/src/components/bundle-modules/bundle-modules.jsx +1 -2
  112. package/src/components/bundle-packages/bundle-packages.jsx +2 -2
  113. package/src/components/index.js +0 -1
  114. package/src/components/summary/summary.jsx +19 -24
  115. package/src/components/summary/summary.module.css +1 -45
  116. package/src/components/summary-item/summary-item.jsx +10 -23
  117. package/src/components/summary-item/summary-item.module.css +25 -13
  118. package/src/constants.js +11 -7
  119. package/src/ui/alert/alert.jsx +2 -7
  120. package/src/ui/hover-card/hover-card.jsx +5 -0
  121. package/src/ui/icon/icon.jsx +0 -2
  122. package/lib/assets/icons/alert-circle.svg +0 -1
  123. package/lib/assets/icons/check-circle.svg +0 -1
  124. package/lib/components/budget-info/budget-info.js +0 -80
  125. package/lib/components/budget-info/budget-info.module.css +0 -40
  126. package/lib/components/budget-info/budget-info.stories.js +0 -44
  127. package/lib/components/budget-info/index.js +0 -18
  128. package/lib/components/budget-insights/budget-insights.js +0 -200
  129. package/lib/components/budget-insights/budget-insights.module.css +0 -53
  130. package/lib/components/budget-insights/budget-insights.stories.js +0 -104
  131. package/lib/components/budget-insights/index.js +0 -18
  132. package/lib-esm/assets/icons/alert-circle.svg +0 -1
  133. package/lib-esm/assets/icons/check-circle.svg +0 -1
  134. package/lib-esm/components/budget-info/budget-info.js +0 -58
  135. package/lib-esm/components/budget-info/budget-info.module.css +0 -40
  136. package/lib-esm/components/budget-info/budget-info.stories.js +0 -30
  137. package/lib-esm/components/budget-info/index.js +0 -1
  138. package/lib-esm/components/budget-insights/budget-insights.js +0 -148
  139. package/lib-esm/components/budget-insights/budget-insights.module.css +0 -53
  140. package/lib-esm/components/budget-insights/budget-insights.stories.js +0 -84
  141. package/lib-esm/components/budget-insights/index.js +0 -1
  142. package/src/assets/icons/alert-circle.svg +0 -1
  143. package/src/assets/icons/check-circle.svg +0 -1
  144. package/src/components/budget-info/budget-info.jsx +0 -65
  145. package/src/components/budget-info/budget-info.module.css +0 -40
  146. package/src/components/budget-info/index.js +0 -1
  147. package/src/components/budget-insights/budget-insights.jsx +0 -157
  148. package/src/components/budget-insights/budget-insights.module.css +0 -53
  149. package/src/components/budget-insights/index.js +0 -1
@@ -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-alpha.4",
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.5",
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.19",
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.19",
49
- "@storybook/addons": "6.4.19",
50
- "@storybook/builder-webpack5": "6.4.19",
51
- "@storybook/manager-webpack5": "6.4.19",
52
- "@storybook/react": "6.4.19",
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.1",
57
+ "chromatic": "6.6.3",
58
58
  "classnames": "2.3.1",
59
59
  "colormap": "2.3.2",
60
- "core-js": "3.20.2",
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,30 +67,30 @@
67
67
  "jest": "27.5.1",
68
68
  "jest-date-mock": "1.0.8",
69
69
  "lodash": "4.17.21",
70
- "postcss": "8.4.7",
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
  },
78
78
  "peerDependencies": {
79
- "classnames": "2.2.6",
80
- "core-js": "3.20.2",
81
- "lodash": "4.17.21",
82
- "prop-types": "15.7.2",
83
- "react": "16.14.0",
84
- "react-dom": "16.14.0",
85
- "react-router-dom": "5.3.0"
79
+ "classnames": "^2.0.0",
80
+ "core-js": "^3.0.0",
81
+ "lodash": "^4.0.0",
82
+ "prop-types": "^15.0.0",
83
+ "react": "^16.0.0 || ^17.0.0",
84
+ "react-dom": "^16.0.0 || ^17.0.0",
85
+ "react-router-dom": "^5.0.0"
86
86
  },
87
87
  "dependencies": {
88
- "@bundle-stats/utils": "^3.4.0-alpha.4",
89
- "ariakit": "2.0.0-alpha.19",
90
- "date-fns": "2.28.0",
91
- "modern-css-reset": "1.4.0",
92
- "query-string": "7.1.1",
93
- "use-query-params": "1.2.3"
88
+ "@bundle-stats/utils": "^4.0.0-alpha.10",
89
+ "ariakit": "2.0.0-next.30",
90
+ "date-fns": "^2.28.0",
91
+ "modern-css-reset": "^1.4.0",
92
+ "query-string": "^7.1.0",
93
+ "use-query-params": "^1.2.3"
94
94
  },
95
- "gitHead": "f7ec27ad6324e0e7c94f429b0ace7a72bf7096fe"
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';
@@ -48,7 +47,7 @@ const Layout = ({ jobs, version, ...props }) => (
48
47
  );
49
48
 
50
49
  Layout.propTypes = {
51
- jobs: PropTypes.arrayOf(PropTypes.object),
50
+ jobs: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
52
51
  version: PropTypes.string,
53
52
  };
54
53
 
@@ -64,7 +63,7 @@ const JobsProvider = ({ jobs, ...restProps }) => {
64
63
  };
65
64
 
66
65
  JobsProvider.propTypes = {
67
- jobs: PropTypes.arrayOf(PropTypes.object).isRequired,
66
+ jobs: PropTypes.arrayOf(PropTypes.object).isRequired, // eslint-disable-line react/forbid-prop-types
68
67
  };
69
68
 
70
69
  const OverviewContent = () => {
@@ -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}>
@@ -16,7 +16,7 @@ export const Header = ({ className, jobs }) => (
16
16
 
17
17
  Header.propTypes = {
18
18
  className: PropTypes.string,
19
- jobs: PropTypes.arrayOf(PropTypes.object),
19
+ jobs: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
20
20
  };
21
21
 
22
22
  Header.defaultProps = {
@@ -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"/>
@@ -146,7 +146,7 @@ RowHeader.propTypes = {
146
146
  isChunk: PropTypes.bool,
147
147
  isInitial: PropTypes.bool,
148
148
  isEntry: PropTypes.bool,
149
- runs: PropTypes.arrayOf(PropTypes.object),
149
+ runs: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
150
150
  }).isRequired,
151
151
  chunks: PropTypes.arrayOf(
152
152
  PropTypes.shape({
@@ -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;
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="xxsmall" className={css.itemTitleText}>
34
- <span>{item.label}</span>
35
- {budget && <BudgetInfo metricId={item.key} 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
  }
@@ -131,9 +131,8 @@ export const BundleModules = ({
131
131
  disabled: jobs.length <= 1,
132
132
  },
133
133
  [MODULE_FILTERS.DUPLICATED]: {
134
- label: 'Duplicated',
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';
@@ -5,21 +5,17 @@ import { get } from 'lodash';
5
5
  import { METRIC_COMPONENT_LINKS } from '@bundle-stats/utils';
6
6
 
7
7
  import { METRICS_WEBPACK_GENERAL } from '../../constants';
8
- import { Icon } from '../../ui/icon';
9
8
  import { Box } from '../../layout/box';
10
9
  import { FlexStack } from '../../layout/flex-stack';
11
10
  import { ComponentLink } from '../component-link';
12
11
  import { SummaryItem } from '../summary-item';
13
12
  import css from './summary.module.css';
14
13
 
15
- const getSourceMetricId = (fullMetricId) => fullMetricId.split('.').slice(1).join('.');
16
-
17
14
  export const Summary = ({
18
15
  className,
19
16
  size,
20
17
  keys,
21
18
  data,
22
- budgets,
23
19
  loading,
24
20
  showSummaryItemDelta,
25
21
  summaryItemLink: SummaryItemCustomLink,
@@ -27,24 +23,20 @@ export const Summary = ({
27
23
  <Box outline className={cx(css.root, className)}>
28
24
  <FlexStack className={css.items}>
29
25
  {Array.from(METRIC_COMPONENT_LINKS)
30
- .filter(([metricId]) => keys.includes(getSourceMetricId(metricId)))
26
+ .filter(([metricId]) => keys.includes(metricId))
31
27
  .map(([metricId, metricOptions]) => (
32
- <div key={metricId} className={css.item}>
33
- <SummaryItem
34
- size={size}
35
- id={metricId}
36
- data={get(data, metricId)}
37
- budget={get(budgets, getSourceMetricId(metricId))}
38
- loading={loading}
39
- showMetricDescription
40
- showDelta={showSummaryItemDelta && metricOptions.showDelta !== false}
41
- />
42
- {!loading && (
43
- <SummaryItemCustomLink {...metricOptions.link} className={css.readMore}>
44
- <Icon className={css.readMoreIcon} glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE} />
45
- </SummaryItemCustomLink>
46
- )}
47
- </div>
28
+ <SummaryItem
29
+ key={metricId}
30
+ className={css.item}
31
+ as={SummaryItemCustomLink}
32
+ {...metricOptions.link}
33
+ size={size}
34
+ id={metricId}
35
+ data={get(data, metricId)}
36
+ loading={loading}
37
+ showMetricDescription
38
+ showDelta={showSummaryItemDelta && metricOptions.showDelta !== false}
39
+ />
48
40
  ))}
49
41
  </FlexStack>
50
42
  </Box>
@@ -53,7 +45,6 @@ export const Summary = ({
53
45
  Summary.defaultProps = {
54
46
  className: '',
55
47
  data: null,
56
- budgets: null,
57
48
  loading: false,
58
49
  size: '',
59
50
  keys: METRICS_WEBPACK_GENERAL,
@@ -65,8 +56,12 @@ Summary.propTypes = {
65
56
  className: PropTypes.string,
66
57
  size: PropTypes.string,
67
58
  keys: PropTypes.arrayOf(PropTypes.string),
68
- data: PropTypes.object, // eslint-disable-line react/forbid-prop-types
69
- budgets: PropTypes.object, // eslint-disable-line react/forbid-prop-types
59
+ data: PropTypes.shape({
60
+ [PropTypes.string]: PropTypes.shape({
61
+ baseline: PropTypes.number,
62
+ current: PropTypes.number,
63
+ }),
64
+ }),
70
65
  loading: PropTypes.bool,
71
66
  showSummaryItemDelta: PropTypes.bool,
72
67
  summaryItemLink: PropTypes.elementType,
@@ -6,49 +6,5 @@
6
6
  .item {
7
7
  padding: var(--space-small);
8
8
  flex: 1 0 25%; /* force equal sizes */
9
- position: relative;
10
- z-index: 1;
11
- }
12
-
13
- .item::before {
14
- content: '';
15
- display: block;
16
- width: 1px;
17
- position: absolute;
18
- left: -1px;
19
- top: var(--space-small);
20
- bottom: var(--space-small);
21
- background: var(--color-outline);
22
- }
23
-
24
- .readMore {
25
- display: block;
26
- position: absolute;
27
- right: 0;
28
- bottom: 0;
29
- padding: var(--space-small);
30
- color: var(--color-text-ultra-light);
31
- transition: var(--transition-out);
32
- }
33
-
34
- .readMore:hover,
35
- .readMore:focus {
36
- color: var(--color-primary);
37
- transition: var(--transition-in);
38
- }
39
-
40
- .readMoreIcon {
41
- display: block;
42
- }
43
-
44
- /** hover state */
45
- .readMore {
46
- opacity: 0;
47
- }
48
-
49
- .item:hover .readMore,
50
- .item:active .readMore,
51
- .item:focus .readMore {
52
- opacity: 1;
53
- transition: var(--transition-in);
9
+ text-decoration: none;
54
10
  }
@@ -4,13 +4,10 @@ import cx from 'classnames';
4
4
  import { getGlobalMetricType, getMetricRunInfo } from '@bundle-stats/utils';
5
5
 
6
6
  import { HoverCard } from '../../ui/hover-card';
7
- import { Icon } from '../../ui/icon';
8
7
  import { Skeleton } from '../../ui/skeleton';
9
8
  import { Stack } from '../../layout/stack';
10
- import { FlexStack } from '../../layout/flex-stack';
11
9
  import { Metric } from '../metric';
12
10
  import { Delta } from '../delta';
13
- import { BudgetInfo } from '../budget-info';
14
11
  import css from './summary-item.module.css';
15
12
 
16
13
  const MetricInfo = ({ description, url }) => (
@@ -18,9 +15,9 @@ const MetricInfo = ({ description, url }) => (
18
15
  <p>{description}</p>
19
16
  {url && (
20
17
  <p>
21
- <a href={url} className={css.readMoreLink}>
18
+ <button type="button" onClick={() => window.open(url)} className={css.readMoreLink}>
22
19
  Read more
23
- </a>
20
+ </button>
24
21
  </p>
25
22
  )}
26
23
  </Stack>
@@ -44,7 +41,6 @@ export const SummaryItem = ({
44
41
  loading,
45
42
  showDelta,
46
43
  showMetricDescription,
47
- budget,
48
44
  ...props
49
45
  }) => {
50
46
  const { baseline, current } = data || { baseline: 0, current: 0 };
@@ -52,21 +48,20 @@ export const SummaryItem = ({
52
48
  const metric = getGlobalMetricType(id);
53
49
  const runInfo = getMetricRunInfo(metric, current, baseline);
54
50
  const showMetricDescriptionTooltip = showMetricDescription && metric?.description;
51
+
55
52
  const rootClassName = cx(css.root, className, css[size], showDelta && css.showDelta);
56
53
 
57
54
  return (
58
- <Stack space="xxxsmall" as={Component} className={rootClassName} {...props}>
59
- <FlexStack as="h3" space="xxxsmall" className={css.title}>
60
- <span className={css.titleLabel}>{metric.label}</span>
61
-
62
- {showMetricDescriptionTooltip && (
63
- <HoverCard className={css.icon} label={<Icon glyph="help" />}>
55
+ <Stack space="xxsmall" as={Component} className={rootClassName} {...props}>
56
+ <h3 className={css.title}>
57
+ {showMetricDescriptionTooltip ? (
58
+ <HoverCard label={metric.label}>
64
59
  <MetricInfo {...metric} />
65
60
  </HoverCard>
61
+ ) : (
62
+ metric.label
66
63
  )}
67
-
68
- {budget && <BudgetInfo className={css.budgetInfo} metricId={id} budgetInsight={budget} />}
69
- </FlexStack>
64
+ </h3>
70
65
 
71
66
  {!loading ? (
72
67
  <Stack>
@@ -105,7 +100,6 @@ SummaryItem.defaultProps = {
105
100
  loading: false,
106
101
  showMetricDescription: false,
107
102
  showDelta: true,
108
- budget: undefined,
109
103
  };
110
104
 
111
105
  SummaryItem.propTypes = {
@@ -132,11 +126,4 @@ SummaryItem.propTypes = {
132
126
 
133
127
  /** Show delta */
134
128
  showDelta: PropTypes.bool,
135
-
136
- /** Budget insight data */
137
- budget: PropTypes.shape({
138
- currentBalue: PropTypes.number,
139
- budgetValue: PropTypes.number,
140
- failed: PropTypes.bool,
141
- }),
142
129
  };
@@ -1,24 +1,12 @@
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);
11
- line-height: var(--space-small);
5
+ line-height: 1;
12
6
  text-transform: uppercase;
13
7
  white-space: nowrap;
14
8
  }
15
9
 
16
- .budgetInfo {
17
- position: absolute;
18
- right: 0;
19
- top: 0;
20
- }
21
-
22
10
  .currentMetric {
23
11
  display: block;
24
12
  color: var(--color-heading);
@@ -39,6 +27,30 @@
39
27
  line-height: var(--space-small);
40
28
  }
41
29
 
30
+ .readMoreLink {
31
+ appearance: none;
32
+ background: none;
33
+ margin: 0;
34
+ border: 0;
35
+ padding: 0;
36
+ color: var(--color-primary);
37
+ text-decoration: underline;
38
+ cursor: pointer;
39
+ }
40
+
41
+ .readMoreLink:hover,
42
+ .readMoreLink:active,
43
+ .readMoreLink:focus {
44
+ color: var(--color-primary-dark);
45
+ text-decoration: none;
46
+ }
47
+
48
+ /* Hover state */
49
+ .root:hover .title {
50
+ color: var(--color-text-light);
51
+ }
52
+
53
+
42
54
  /* Loading state */
43
55
  .loading.currentMetric {
44
56
  width: 8em;