@bundle-stats/ui 3.2.1-beta.8 → 3.2.2

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 (63) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/lib/app/app.stories.js +8 -1
  3. package/lib/assets/icons/arrow-right-circle.svg +1 -0
  4. package/lib/assets/icons/close.svg +1 -1
  5. package/lib/assets/icons.svg +42 -1
  6. package/lib/components/browsertime-table/browsertime-table.stories.js +1 -0
  7. package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +17 -18
  8. package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +39 -43
  9. package/lib/components/job-meta/job-meta.js +1 -1
  10. package/lib/components/summary/summary.js +13 -22
  11. package/lib/components/summary/summary.module.css +31 -14
  12. package/lib/components/summary-item/summary-item.js +9 -9
  13. package/lib/components/summary-item/summary-item.module.css +3 -9
  14. package/lib/components/summary-item/summary-item.stories.js +35 -18
  15. package/lib/css/variables.css +15 -11
  16. package/lib/hooks/search-params.js +1 -1
  17. package/lib/layout/box/box.js +2 -2
  18. package/lib/layout/stack/stack.js +13 -3
  19. package/lib/ui/icon/icon.js +1 -0
  20. package/lib/ui/icon/icon.stories.js +40 -22
  21. package/lib/ui/popover/popover.js +2 -2
  22. package/lib/ui/popover/popover.module.css +2 -1
  23. package/lib/ui/tooltip/tooltip.module.css +1 -0
  24. package/lib-esm/app/app.stories.js +8 -1
  25. package/lib-esm/assets/icons/arrow-right-circle.svg +1 -0
  26. package/lib-esm/assets/icons/close.svg +1 -1
  27. package/lib-esm/assets/icons.svg +42 -1
  28. package/lib-esm/components/browsertime-table/browsertime-table.stories.js +2 -1
  29. package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +14 -14
  30. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +28 -21
  31. package/lib-esm/components/job-meta/job-meta.js +1 -1
  32. package/lib-esm/components/summary/summary.js +12 -17
  33. package/lib-esm/components/summary/summary.module.css +31 -14
  34. package/lib-esm/components/summary-item/summary-item.js +9 -9
  35. package/lib-esm/components/summary-item/summary-item.module.css +3 -9
  36. package/lib-esm/components/summary-item/summary-item.stories.js +14 -16
  37. package/lib-esm/css/variables.css +15 -11
  38. package/lib-esm/hooks/search-params.js +1 -1
  39. package/lib-esm/layout/box/box.js +2 -2
  40. package/lib-esm/layout/stack/stack.js +6 -3
  41. package/lib-esm/ui/icon/icon.js +1 -0
  42. package/lib-esm/ui/icon/icon.stories.js +22 -11
  43. package/lib-esm/ui/popover/popover.js +2 -2
  44. package/lib-esm/ui/popover/popover.module.css +2 -1
  45. package/lib-esm/ui/tooltip/tooltip.module.css +1 -0
  46. package/package.json +15 -15
  47. package/src/assets/icons/arrow-right-circle.svg +1 -0
  48. package/src/assets/icons/close.svg +1 -1
  49. package/src/assets/icons.svg +42 -1
  50. package/src/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.jsx +15 -15
  51. package/src/components/job-meta/job-meta.jsx +1 -3
  52. package/src/components/summary/summary.jsx +19 -22
  53. package/src/components/summary/summary.module.css +31 -14
  54. package/src/components/summary-item/summary-item.jsx +13 -22
  55. package/src/components/summary-item/summary-item.module.css +3 -9
  56. package/src/css/variables.css +15 -11
  57. package/src/hooks/search-params.js +1 -1
  58. package/src/layout/box/box.jsx +1 -1
  59. package/src/layout/stack/stack.jsx +2 -2
  60. package/src/ui/icon/icon.jsx +1 -0
  61. package/src/ui/popover/popover.jsx +3 -3
  62. package/src/ui/popover/popover.module.css +2 -1
  63. package/src/ui/tooltip/tooltip.module.css +1 -0
@@ -1,20 +1,18 @@
1
1
  import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { getWrapperDecorator } from '../../stories';
4
2
  import { SummaryItem } from './summary-item';
5
- const stories = storiesOf('Components/SummaryItem', module);
6
- stories.addDecorator(getWrapperDecorator({
7
- maxWidth: '320px'
8
- }));
9
- stories.add('default', () => /*#__PURE__*/React.createElement(SummaryItem, {
3
+ export default {
4
+ title: 'Components/SummaryItem',
5
+ component: SummaryItem
6
+ };
7
+ export const Standard = () => /*#__PURE__*/React.createElement(SummaryItem, {
10
8
  loading: false,
11
9
  id: "webpack.totalSizeByTypeALL",
12
10
  data: {
13
11
  current: 120 * 1000,
14
12
  baseline: 100 * 1000
15
13
  }
16
- }));
17
- stories.add('size large', () => /*#__PURE__*/React.createElement(SummaryItem, {
14
+ });
15
+ export const SizeLarge = () => /*#__PURE__*/React.createElement(SummaryItem, {
18
16
  size: "large",
19
17
  loading: false,
20
18
  id: "webpack.totalSizeByTypeALL",
@@ -22,8 +20,8 @@ stories.add('size large', () => /*#__PURE__*/React.createElement(SummaryItem, {
22
20
  current: 120 * 1000,
23
21
  baseline: 100 * 1000
24
22
  }
25
- }));
26
- stories.add('showMetricDescription', () => /*#__PURE__*/React.createElement(SummaryItem, {
23
+ });
24
+ export const ShowMetricDescription = () => /*#__PURE__*/React.createElement(SummaryItem, {
27
25
  loading: false,
28
26
  id: "webpack.totalSizeByTypeALL",
29
27
  data: {
@@ -31,8 +29,8 @@ stories.add('showMetricDescription', () => /*#__PURE__*/React.createElement(Summ
31
29
  baseline: 100 * 1000
32
30
  },
33
31
  showMetricDescription: true
34
- }));
35
- stories.add('showDelta false', () => /*#__PURE__*/React.createElement(SummaryItem, {
32
+ });
33
+ export const ShowDeltaFalse = () => /*#__PURE__*/React.createElement(SummaryItem, {
36
34
  loading: false,
37
35
  id: "webpack.totalSizeByTypeALL",
38
36
  data: {
@@ -40,8 +38,8 @@ stories.add('showDelta false', () => /*#__PURE__*/React.createElement(SummaryIte
40
38
  baseline: 0
41
39
  },
42
40
  showDelta: false
43
- }));
44
- stories.add('loading', () => /*#__PURE__*/React.createElement(SummaryItem, {
41
+ });
42
+ export const Loading = () => /*#__PURE__*/React.createElement(SummaryItem, {
45
43
  loading: true,
46
44
  id: "webpack.totalSizeByTypeALL"
47
- }));
45
+ });
@@ -27,20 +27,20 @@
27
27
 
28
28
  /*
29
29
  * Color scheme:
30
- * http://mcg.mbitson.com/#!?mcgpalette0=%23dd555e&mcgpalette1=%2363bf5e&mcgpalette2=%23f7e37d&mcgpalette3=%23484a4d&mcgpalette4=%233385d6&themename=mcgtheme
30
+ * http://mcg.mbitson.com/#!?mcgpalette0=%23dd555e&mcgpalette1=%2363bf5e&mcgpalette2=%23f7e37d&mcgpalette3=%23636568&mcgpalette4=%233385d6&themename=mcgtheme
31
31
  * https://coolors.co/3385d6-dd555e-63bf5e-f7e37d-192339
32
32
  */
33
33
  --color-gray-25: #fafafa;
34
- --color-gray-50: #e9e9ea;
35
- --color-gray-100: #c8c9ca;
36
- --color-gray-200: #a4a5a6;
37
- --color-gray-300: #7f8082;
38
- --color-gray-400: #636568;
39
- --color-gray-500: #484a4d;
40
- --color-gray-600: #414346;
41
- --color-gray-700: #383a3d;
42
- --color-gray-800: #303234;
43
- --color-gray-900: #212225;
34
+ --color-gray-50: #eceded;
35
+ --color-gray-100: #d0d1d2;
36
+ --color-gray-200: #b1b2b4;
37
+ --color-gray-300: #929395;
38
+ --color-gray-400: #7a7c7f;
39
+ --color-gray-500: #636568;
40
+ --color-gray-600: #5b5d60;
41
+ --color-gray-700: #515355;
42
+ --color-gray-800: #47494b;
43
+ --color-gray-900: #35373a;
44
44
 
45
45
  --color-gray-ultra-light: var(--color-gray-200);
46
46
  --color-gray-light: var(--color-gray-300);
@@ -181,6 +181,10 @@
181
181
  --layer-high: 1000;
182
182
  --layer-xhigh: 10000;
183
183
 
184
+ --radius-small: var(--space-xxxsmall);
185
+ --radius-medium: var(--space-xxsmall);
186
+ --radius-large: var(--space-small);
187
+
184
188
  /** Layout */
185
189
  --max-width: 80rem;
186
190
  }
@@ -8,7 +8,7 @@ const ACTION_RESET_ALL = 'RESET_ALL';
8
8
  const ACTION_SET = 'SET';
9
9
 
10
10
  const getSearchPattern = search => {
11
- let searchPattern = new RegExp(/.*/);
11
+ let searchPattern = /.*/;
12
12
 
13
13
  if (!search || !search.trim()) {
14
14
  return searchPattern;
@@ -17,9 +17,9 @@ export const Box = props => {
17
17
  } = props;
18
18
  const [resolvedPadding, resolvedVerticalPadding, resolvedHorizontalPadding] = Array.isArray(padding) ? [null, ...padding] : [padding, verticalPadding, horizontalPadding];
19
19
  const rootClassName = cx(css.root, className, resolvedPadding && css[`padding-${resolvedPadding}`], resolvedVerticalPadding && css[`vertical-padding-${resolvedVerticalPadding}`], resolvedHorizontalPadding && css[`horizontal-padding-${resolvedHorizontalPadding}`], outline && css.outline);
20
- return /*#__PURE__*/React.createElement(Component, _extends({
20
+ return /*#__PURE__*/React.createElement(Component, _extends({}, restProps, {
21
21
  className: rootClassName
22
- }, restProps));
22
+ }));
23
23
  };
24
24
  Box.defaultProps = {
25
25
  className: '',
@@ -1,3 +1,5 @@
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
+
1
3
  import React from 'react';
2
4
  import PropTypes from 'prop-types';
3
5
  import cx from 'classnames';
@@ -9,12 +11,13 @@ export const Stack = props => {
9
11
  as: Component,
10
12
  className,
11
13
  space,
12
- children
14
+ children,
15
+ ...restProps
13
16
  } = props;
14
17
  const rootClassName = cx(className, css.root, css[`space--${space}`]);
15
- return /*#__PURE__*/React.createElement(Component, {
18
+ return /*#__PURE__*/React.createElement(Component, _extends({}, restProps, {
16
19
  className: rootClassName
17
- }, React.Children.map(children, getRenderChildWithClassName(css.item)));
20
+ }), React.Children.map(children, getRenderChildWithClassName(css.item)));
18
21
  };
19
22
  Stack.defaultProps = {
20
23
  as: 'div',
@@ -6,6 +6,7 @@ import cx from 'classnames';
6
6
  import css from './icon.module.css';
7
7
  const ICONS = {
8
8
  ARROW: 'arrow',
9
+ ARROW_RIGHT_CIRLCE: 'arrow-right-circle',
9
10
  CANCEL: 'cancel',
10
11
  CLOSE: 'close',
11
12
  CLOCK: 'clock',
@@ -1,21 +1,32 @@
1
1
  import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { getWrapperDecorator } from '../../stories';
4
2
  import { Icon } from '.';
5
- const stories = storiesOf('UI/Icon', module);
6
- stories.addDecorator(getWrapperDecorator());
7
- stories.add('default', () => /*#__PURE__*/React.createElement(Icon, {
3
+ export default {
4
+ title: 'UI/Icon',
5
+ component: Icon
6
+ };
7
+
8
+ const Template = args => /*#__PURE__*/React.createElement(Icon, args);
9
+
10
+ export const Standard = Template.bind();
11
+ Standard.args = {
8
12
  glyph: Icon.ICONS.ARROW
9
- }));
10
- stories.add('with size', () => /*#__PURE__*/React.createElement(Icon, {
13
+ };
14
+ export const CustomSize = Template.bind();
15
+ CustomSize.args = {
11
16
  glyph: Icon.ICONS.ARROW,
12
17
  size: Icon.SIZE_LARGE
13
- }));
14
- stories.add('all', () => /*#__PURE__*/React.createElement(React.Fragment, null, Object.values(Icon.ICONS).map(glyph => /*#__PURE__*/React.createElement("span", {
18
+ };
19
+ export const All = () => /*#__PURE__*/React.createElement(React.Fragment, null, Object.values(Icon.ICONS).map(glyph => /*#__PURE__*/React.createElement("div", {
15
20
  style: {
16
- margin: '0.3rem'
21
+ display: 'inline-block',
22
+ padding: '1rem',
23
+ textAlign: 'center'
17
24
  }
18
25
  }, /*#__PURE__*/React.createElement(Icon, {
19
26
  glyph: glyph,
20
27
  key: glyph
21
- })))));
28
+ }), /*#__PURE__*/React.createElement("code", {
29
+ style: {
30
+ display: 'block'
31
+ }
32
+ }, glyph))));
@@ -16,7 +16,7 @@ export const Popover = _ref => {
16
16
  } = _ref;
17
17
  const popover = usePopoverState({
18
18
  baseId: process.env.NODE_ENV === 'test' && 'id-test',
19
- gutter: 24,
19
+ gutter: 12,
20
20
  modal: true,
21
21
  placement: 'top'
22
22
  });
@@ -45,7 +45,7 @@ export const Popover = _ref => {
45
45
  }), /*#__PURE__*/React.createElement(UIPopoverArrow, _extends({
46
46
  className: css.arrow
47
47
  }, popover, {
48
- size: 24
48
+ size: 16
49
49
  })), typeof children === 'function' ? children({
50
50
  popoverToggle: popover.toggle
51
51
  }) : children, /*#__PURE__*/React.createElement(Icon, {
@@ -23,7 +23,8 @@
23
23
  }
24
24
 
25
25
  .popover {
26
- padding: var(--space-xsmall) var(--space-large) var(--space-xsmall) var(--space-small);
26
+ padding: var(--space-small) var(--space-large) var(--space-small) var(--space-small);
27
+ border-radius: var(--radius-small);
27
28
  max-width: 360px;
28
29
  outline: none;
29
30
  filter: drop-shadow(0 0 var(--space-xxxsmall) var(--color-shadow));
@@ -12,6 +12,7 @@
12
12
 
13
13
  .tooltip {
14
14
  padding: var(--space-xxxsmall) var(--space-xxsmall);
15
+ border-radius: var(--radius-small);
15
16
  background: var(--color-light);
16
17
  color: var(--color-text);
17
18
  filter: drop-shadow(0 0 var(--space-xxxsmall) var(--color-shadow));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bundle-stats/ui",
3
- "version": "3.2.1-beta.8",
3
+ "version": "3.2.2",
4
4
  "description": "UI components for BundleStats projects.",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -12,7 +12,7 @@
12
12
  "build-esm": "babel -D src -d lib-esm --ignore **/__tests__/**/* --ignore /prototypes/**",
13
13
  "build-storybook": "npx build-storybook -c ./build/storybook",
14
14
  "generate-chart-colors": "node scripts/generate-chart-colors.js",
15
- "generate-svg-sprite": "npx svg-sprite -s --si src/assets/icons/*.svg && mv symbol/svg/sprite.symbol.svg src/assets/icons.svg",
15
+ "generate-svg-sprite": "npx svg-sprite -s --si --no-svg-namespace-classnames src/assets/icons/*.svg && mv symbol/svg/sprite.symbol.svg src/assets/icons.svg",
16
16
  "lint": "../../node_modules/.bin/eslint . --ext .jsx,.js",
17
17
  "start": "cross-env NODE_ENV=development start-storybook -c ./build/storybook -p 8080",
18
18
  "test": "npm run test:unit && npm run test:storyshots",
@@ -42,31 +42,31 @@
42
42
  "@babel/preset-env": "7.16.4",
43
43
  "@babel/preset-react": "7.16.0",
44
44
  "@simplyianm/babel-plugin-inline-react-svg": "1.2.0",
45
- "@storybook/addon-knobs": "6.3.1",
45
+ "@storybook/addon-knobs": "6.4.0",
46
46
  "@storybook/addon-postcss": "2.0.0",
47
- "@storybook/addon-storyshots": "6.3.12",
48
- "@storybook/addons": "6.3.12",
49
- "@storybook/builder-webpack5": "^6.3.12",
50
- "@storybook/manager-webpack5": "^6.3.12",
51
- "@storybook/react": "6.3.12",
47
+ "@storybook/addon-storyshots": "6.4.8",
48
+ "@storybook/addons": "6.4.8",
49
+ "@storybook/builder-webpack5": "6.4.8",
50
+ "@storybook/manager-webpack5": "6.4.8",
51
+ "@storybook/react": "6.4.8",
52
52
  "babel-core": "7.0.0-bridge.0",
53
- "babel-jest": "27.3.1",
53
+ "babel-jest": "27.4.2",
54
54
  "babel-plugin-lodash": "3.3.4",
55
55
  "babel-plugin-require-context-hook": "1.0.0",
56
- "chromatic": "6.0.6",
56
+ "chromatic": "6.2.0",
57
57
  "classnames": "2.3.1",
58
58
  "colormap": "2.3.2",
59
- "core-js": "3.19.1",
59
+ "core-js": "3.19.3",
60
60
  "cross-env": "7.0.3",
61
61
  "enzyme": "3.11.0",
62
62
  "enzyme-adapter-react-16": "1.15.6",
63
63
  "enzyme-to-json": "3.6.2",
64
64
  "hex-rgb": "5.0.0",
65
65
  "identity-obj-proxy": "3.0.0",
66
- "jest": "27.3.1",
66
+ "jest": "27.4.3",
67
67
  "jest-date-mock": "1.0.8",
68
68
  "lodash": "4.17.21",
69
- "postcss": "8.3.11",
69
+ "postcss": "8.4.4",
70
70
  "prop-types": "15.7.2",
71
71
  "react": "16.14.0",
72
72
  "react-dom": "16.14.0",
@@ -84,11 +84,11 @@
84
84
  "react-router-dom": "^5.3.0"
85
85
  },
86
86
  "dependencies": {
87
- "@bundle-stats/utils": "^3.2.1-beta.8",
87
+ "@bundle-stats/utils": "^3.2.2",
88
88
  "date-fns": "^2.6.0",
89
89
  "query-string": "^7.0.0",
90
90
  "reakit": "^1.3.6",
91
91
  "use-query-params": "^1.2.2"
92
92
  },
93
- "gitHead": "46335ff5ced2c000c843d25fe83b040fb3c43477"
93
+ "gitHead": "e9caf650b9f5c2e4408011ccb302c2dfa3ccdb0f"
94
94
  }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right-circle"><circle cx="12" cy="12" r="10"></circle><polyline points="12 16 16 12 12 8"></polyline><line x1="8" y1="12" x2="16" y2="12"></line></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x-circle"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>
@@ -1 +1,42 @@
1
- <svg width="16" height="16"><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="afeather afeather-arrow-down" id="arrow" xmlns="http://www.w3.org/2000/svg"><path d="M12 5v14M19 12l-7 7-7-7"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="bfeather bfeather-x-circle" id="cancel" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><path d="M15 9l-6 6M9 9l6 6"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="cfeather cfeather-clock" id="clock" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="dfeather dfeather-x" id="close" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="efeather efeather-git-commit" id="commit" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="4"/><path d="M1.05 12H7M17.01 12h5.95"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ffeather ffeather-bar-chart" id="filter" xmlns="http://www.w3.org/2000/svg"><path d="M12 20V10M18 20V4M6 20v-4"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="gfeather gfeather-help-circle" id="help" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3M12 17h.01"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="hfeather hfeather-menu" id="menu" xmlns="http://www.w3.org/2000/svg"><path d="M3 12h18M3 6h18M3 18h18"/></symbol><symbol viewBox="0 0 24 24" fill="currentColor" id="sort" xmlns="http://www.w3.org/2000/svg"><path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"/><path d="M0 0h24v24H0z" fill="none"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="jfeather jfeather-alert-triangle" id="warning" xmlns="http://www.w3.org/2000/svg"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0zM12 9v4M12 17h.01"/></symbol></svg>
1
+ <svg width="16" height="16">
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">
3
+ <path d="M12 5v14M19 12l-7 7-7-7"/>
4
+ </symbol>
5
+ <symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right-circle" viewBox="0 0 24 24" id="arrow-right-circle" xmlns="http://www.w3.org/2000/svg">
6
+ <circle cx="12" cy="12" r="10"/>
7
+ <path d="M12 16l4-4-4-4M8 12h8"/>
8
+ </symbol>
9
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x-circle" id="cancel" xmlns="http://www.w3.org/2000/svg">
10
+ <circle cx="12" cy="12" r="10"/>
11
+ <path d="M15 9l-6 6M9 9l6 6"/>
12
+ </symbol>
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">
14
+ <circle cx="12" cy="12" r="10"/>
15
+ <path d="M12 6v6l4 2"/>
16
+ </symbol>
17
+ <symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x-circle" viewBox="0 0 24 24" id="close" xmlns="http://www.w3.org/2000/svg">
18
+ <circle cx="12" cy="12" r="10"/>
19
+ <path d="M15 9l-6 6M9 9l6 6"/>
20
+ </symbol>
21
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit" id="commit" xmlns="http://www.w3.org/2000/svg">
22
+ <circle cx="12" cy="12" r="4"/>
23
+ <path d="M1.05 12H7M17.01 12h5.95"/>
24
+ </symbol>
25
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bar-chart" id="filter" xmlns="http://www.w3.org/2000/svg">
26
+ <path d="M12 20V10M18 20V4M6 20v-4"/>
27
+ </symbol>
28
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-help-circle" id="help" xmlns="http://www.w3.org/2000/svg">
29
+ <circle cx="12" cy="12" r="10"/>
30
+ <path d="M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3M12 17h.01"/>
31
+ </symbol>
32
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu" id="menu" xmlns="http://www.w3.org/2000/svg">
33
+ <path d="M3 12h18M3 6h18M3 18h18"/>
34
+ </symbol>
35
+ <symbol viewBox="0 0 24 24" fill="currentColor" id="sort" xmlns="http://www.w3.org/2000/svg">
36
+ <path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"/>
37
+ <path d="M0 0h24v24H0z" fill="none"/>
38
+ </symbol>
39
+ <symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-alert-triangle" id="warning" xmlns="http://www.w3.org/2000/svg">
40
+ <path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0zM12 9v4M12 17h.01"/>
41
+ </symbol>
42
+ </svg>
@@ -13,6 +13,20 @@ import { Stack } from '../../layout/stack';
13
13
  import { SummaryItem } from '../summary-item';
14
14
  import css from './bundle-assets-totals-chart-bars.module.css';
15
15
 
16
+ const getTooltip = (items, jobs, itemIndex, runIndex) => () => (
17
+ <SummaryItem
18
+ className={css.itemTooltip}
19
+ id={get(items, [itemIndex, 'key'])}
20
+ data={{
21
+ current: get(items, [itemIndex, 'runs', runIndex, 'value'], 0),
22
+ baseline: get(items, [itemIndex, 'runs', runIndex + 1, 'value'], 0),
23
+ }}
24
+ showDelta={runIndex < jobs.length - 1}
25
+ showBaselineValue={runIndex < jobs.length - 1}
26
+ size="large"
27
+ />
28
+ );
29
+
16
30
  export const BundleAssetsTotalsChartBars = ({
17
31
  className,
18
32
  jobs,
@@ -43,20 +57,6 @@ export const BundleAssetsTotalsChartBars = ({
43
57
  });
44
58
  const colors = getColors(max(map(dataGraphs, (values) => values.length)));
45
59
 
46
- const getTooltip = (itemIndex, runIndex) => () => (
47
- <SummaryItem
48
- className={css.itemTooltip}
49
- id={get(items, [itemIndex, 'key'])}
50
- data={{
51
- current: get(items, [itemIndex, 'runs', runIndex, 'value'], 0),
52
- baseline: get(items, [itemIndex, 'runs', runIndex + 1, 'value'], 0),
53
- }}
54
- showDelta={runIndex < jobs.length - 1}
55
- showBaselineValue={runIndex < jobs.length - 1}
56
- size="large"
57
- />
58
- );
59
-
60
60
  return (
61
61
  <Stack className={rootClassName} space="medium">
62
62
  {dataGraphs.map((data, runIndex) => {
@@ -66,7 +66,7 @@ export const BundleAssetsTotalsChartBars = ({
66
66
  value,
67
67
  color: colors[valueIndex],
68
68
  label: labels[valueIndex],
69
- getItemTooltip: getTooltip(valueIndex, runIndex),
69
+ getItemTooltip: getTooltip(items, jobs, valueIndex, runIndex),
70
70
  }));
71
71
 
72
72
  return (
@@ -19,9 +19,7 @@ export const JobMeta = (props) => {
19
19
  return (
20
20
  <div className={css.item} key={key}>
21
21
  {title && (<h2 className={css.itemTitle}>{title}</h2>)}
22
- {content.map((item) => (
23
- <>{item}</>
24
- ))}
22
+ {content.map((item) => item)}
25
23
  </div>
26
24
  );
27
25
  })}
@@ -5,6 +5,7 @@ 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';
8
9
  import { Box } from '../../layout/box';
9
10
  import { FlexStack } from '../../layout/flex-stack';
10
11
  import { ComponentLink } from '../component-link';
@@ -22,29 +23,25 @@ export const Summary = ({
22
23
  }) => (
23
24
  <Box outline className={cx(css.root, className)}>
24
25
  <FlexStack className={css.items}>
25
- {Array.from(METRIC_COMPONENT_LINKS).filter(([metricId]) => keys.includes(metricId)).map(
26
- ([metricId, metricOptions]) => (
27
- <SummaryItem
28
- as={({ className: itemClassName, ...itemProps }) => (
29
- <Box
30
- padding={['xsmall', 'small']}
31
- className={cx(itemClassName, css.summaryItemLink)}
32
- {...itemProps}
33
- as={SummaryItemCustomLink}
34
- {...metricOptions.link}
35
- />
26
+ {Array.from(METRIC_COMPONENT_LINKS)
27
+ .filter(([metricId]) => keys.includes(metricId))
28
+ .map(([metricId, metricOptions]) => (
29
+ <div key={metricId} className={css.item}>
30
+ <SummaryItem
31
+ size={size}
32
+ id={metricId}
33
+ data={get(data, metricId)}
34
+ loading={loading}
35
+ showMetricDescription
36
+ showDelta={showSummaryItemDelta && metricOptions.showDelta !== false}
37
+ />
38
+ {!loading && (
39
+ <SummaryItemCustomLink {...metricOptions.link} className={css.readMore}>
40
+ <Icon className={css.readMoreIcon} glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE} />
41
+ </SummaryItemCustomLink>
36
42
  )}
37
- size={size}
38
- key={metricId}
39
- id={metricId}
40
- data={get(data, metricId)}
41
- loading={loading}
42
- showMetricDescription
43
- showDelta={showSummaryItemDelta && metricOptions.showDelta !== false}
44
- className={css.item}
45
- />
46
- )
47
- )}
43
+ </div>
44
+ ))}
48
45
  </FlexStack>
49
46
  </Box>
50
47
  );
@@ -3,35 +3,52 @@
3
3
  overflow: auto;
4
4
  }
5
5
 
6
- .items {}
7
-
8
6
  .item {
7
+ padding: var(--space-small) var(--space-xxlarge) var(--space-small) var(--space-small);
9
8
  flex: 1 0 25%; /* force equal sizes */
10
9
  position: relative;
11
10
  z-index: 1;
12
11
  }
13
12
 
14
- .item:focus-visible {
15
- background: var(--color-highlight);
16
- outline: none;
17
- }
18
-
19
13
  .item::before {
20
14
  content: '';
21
15
  display: block;
22
16
  width: 1px;
23
17
  position: absolute;
24
18
  left: -1px;
25
- top: var(--space-xsmall);
26
- bottom: var(--space-xsmall);
19
+ top: var(--space-small);
20
+ bottom: var(--space-small);
27
21
  background: var(--color-outline);
28
22
  }
29
23
 
30
- .item:hover {
31
- background: var(--color-highlight);
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;
32
47
  }
33
48
 
34
- .summaryItemLink {
35
- color: inherit;
36
- text-decoration: none;
49
+ .item:hover .readMore,
50
+ .item:active .readMore,
51
+ .item:focus .readMore {
52
+ opacity: 1;
53
+ transition: var(--transition-in);
37
54
  }
@@ -11,7 +11,7 @@ import { Metric } from '../metric';
11
11
  import { Delta } from '../delta';
12
12
  import css from './summary-item.module.css';
13
13
 
14
- const MetricInfo = ({ description, url }) => {
14
+ const MetricInfoPopover = ({ description, url }) => {
15
15
  // Workaround cases where the parent is a link
16
16
  const readMoreOnClick = () => {
17
17
  window.open(url);
@@ -31,12 +31,12 @@ const MetricInfo = ({ description, url }) => {
31
31
  );
32
32
  };
33
33
 
34
- MetricInfo.propTypes = {
34
+ MetricInfoPopover.propTypes = {
35
35
  description: PropTypes.string.isRequired,
36
36
  url: PropTypes.string,
37
37
  };
38
38
 
39
- MetricInfo.defaultProps = {
39
+ MetricInfoPopover.defaultProps = {
40
40
  url: '',
41
41
  };
42
42
 
@@ -57,14 +57,7 @@ export const SummaryItem = ({
57
57
  const runInfo = getMetricRunInfo(metric, current, baseline);
58
58
  const showMetricDescriptionTooltip = showMetricDescription && metric?.description;
59
59
 
60
- const rootClassName = cx(
61
- css.root,
62
- className,
63
- css[size],
64
- showMetricDescription && css.showMetricDescription,
65
- showMetricDescriptionTooltip && css.showMetricDescription,
66
- showDelta && css.showDelta,
67
- );
60
+ const rootClassName = cx(css.root, className, css[size], showDelta && css.showDelta);
68
61
 
69
62
  return (
70
63
  <Stack space="xxsmall" as={Component} className={rootClassName} {...props}>
@@ -73,13 +66,13 @@ export const SummaryItem = ({
73
66
 
74
67
  {showMetricDescriptionTooltip && (
75
68
  <Popover className={css.icon} icon="help">
76
- <MetricInfo {...metric} />
69
+ <MetricInfoPopover {...metric} />
77
70
  </Popover>
78
71
  )}
79
72
  </FlexStack>
80
73
 
81
- <Stack>
82
- {!loading ? (
74
+ {!loading ? (
75
+ <Stack>
83
76
  <Metric
84
77
  className={css.currentMetric}
85
78
  value={current}
@@ -95,16 +88,14 @@ export const SummaryItem = ({
95
88
  />
96
89
  )}
97
90
  </Metric>
98
- ) : (
99
- <Skeleton className={cx(css.currentMetric, css.loading)} />
100
- )}
101
-
102
- {!loading ? (
103
91
  <Metric className={css.baselineMetric} value={baseline} formatter={metric.formatter} />
104
- ) : (
92
+ </Stack>
93
+ ) : (
94
+ <Stack>
95
+ <Skeleton className={cx(css.currentMetric, css.loading)} />
105
96
  <Skeleton className={cx(css.baselineMetric, css.loading)} />
106
- )}
107
- </Stack>
97
+ </Stack>
98
+ )}
108
99
  </Stack>
109
100
  );
110
101
  };