@bundle-stats/ui 3.2.0-beta.2 → 3.2.1-beta.7

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 (130) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/lib/assets/icons/arrow.svg +1 -0
  3. package/lib/assets/icons/cancel.svg +1 -0
  4. package/lib/assets/icons/clock.svg +1 -0
  5. package/lib/assets/icons/close.svg +1 -0
  6. package/lib/assets/icons/commit.svg +1 -0
  7. package/lib/assets/icons/filter.svg +1 -0
  8. package/lib/assets/icons/help.svg +1 -0
  9. package/lib/assets/icons/menu.svg +1 -0
  10. package/lib/{ui/icon/assets → assets/icons}/sort.svg +0 -0
  11. package/lib/assets/icons/warning.svg +1 -0
  12. package/lib/assets/icons.svg +1 -0
  13. package/lib/ui/icon/icon.js +4 -191
  14. package/lib/utils.js +6 -3
  15. package/lib-esm/app/app.js +60 -50
  16. package/lib-esm/app/header/header.js +22 -19
  17. package/lib-esm/assets/icons/arrow.svg +1 -0
  18. package/lib-esm/assets/icons/cancel.svg +1 -0
  19. package/lib-esm/assets/icons/clock.svg +1 -0
  20. package/lib-esm/assets/icons/close.svg +1 -0
  21. package/lib-esm/assets/icons/commit.svg +1 -0
  22. package/lib-esm/assets/icons/filter.svg +1 -0
  23. package/lib-esm/assets/icons/help.svg +1 -0
  24. package/lib-esm/assets/icons/menu.svg +1 -0
  25. package/lib-esm/{ui/icon/assets → assets/icons}/sort.svg +0 -0
  26. package/lib-esm/assets/icons/warning.svg +1 -0
  27. package/lib-esm/assets/icons.svg +1 -0
  28. package/lib-esm/components/asset-info/asset-info.js +8 -6
  29. package/lib-esm/components/bundle-assets/bundle-assets.js +93 -80
  30. package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +15 -12
  31. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +6 -5
  32. package/lib-esm/components/bundle-modules/bundle-modules.js +82 -67
  33. package/lib-esm/components/bundle-modules/bundle-modules.utils.js +9 -6
  34. package/lib-esm/components/bundle-modules/index.js +6 -3
  35. package/lib-esm/components/bundle-packages/bundle-packages.js +29 -24
  36. package/lib-esm/components/component-link.js +7 -6
  37. package/lib-esm/components/delta/delta.js +7 -6
  38. package/lib-esm/components/job-meta/job-meta.js +5 -4
  39. package/lib-esm/components/job-name/job-name.js +14 -11
  40. package/lib-esm/components/metric/metric.js +10 -9
  41. package/lib-esm/components/metrics-table/metrics-table.js +24 -20
  42. package/lib-esm/components/metrics-table-options/metrics-table-options.js +7 -5
  43. package/lib-esm/components/summary/summary.js +44 -32
  44. package/lib-esm/components/summary/summary.stories.js +11 -8
  45. package/lib-esm/components/summary-item/summary-item.js +18 -15
  46. package/lib-esm/components/total-size-type-title/total-size-type-title.js +17 -14
  47. package/lib-esm/hooks/rows-filter.js +7 -6
  48. package/lib-esm/hooks/rows-sort.js +8 -7
  49. package/lib-esm/hooks/search-params.js +73 -69
  50. package/lib-esm/layout/footer/footer.js +33 -30
  51. package/lib-esm/layout/header/header.js +17 -14
  52. package/lib-esm/layout/header/header.stories.js +45 -30
  53. package/lib-esm/prototypes/typography.stories.js +5 -4
  54. package/lib-esm/stories/wrapper.js +20 -14
  55. package/lib-esm/ui/container/container.js +12 -9
  56. package/lib-esm/ui/dropdown/dropdown.stories.js +9 -6
  57. package/lib-esm/ui/file-name/file-name.js +10 -7
  58. package/lib-esm/ui/filters/filters.container.js +14 -8
  59. package/lib-esm/ui/filters/filters.js +41 -19
  60. package/lib-esm/ui/filters/filters.stories.js +4 -3
  61. package/lib-esm/ui/filters/filters.utils.js +12 -6
  62. package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.js +7 -6
  63. package/lib-esm/ui/icon/icon.js +12 -209
  64. package/lib-esm/ui/input/input.js +6 -5
  65. package/lib-esm/ui/loader/loader.js +10 -7
  66. package/lib-esm/ui/logo/logo.js +7 -6
  67. package/lib-esm/ui/logo/logo.stories.js +7 -1
  68. package/lib-esm/ui/panels/panels.js +10 -7
  69. package/lib-esm/ui/popover/popover.js +8 -7
  70. package/lib-esm/ui/sort-dropdown/sort-dropdown.js +10 -7
  71. package/lib-esm/ui/table/table.js +8 -7
  72. package/lib-esm/ui/tabs/tabs.js +9 -6
  73. package/lib-esm/ui/toolbar/toolbar.stories.js +10 -7
  74. package/lib-esm/utils.js +13 -4
  75. package/package.json +24 -20
  76. package/src/assets/icons/arrow.svg +1 -0
  77. package/src/assets/icons/cancel.svg +1 -0
  78. package/src/assets/icons/clock.svg +1 -0
  79. package/src/assets/icons/close.svg +1 -0
  80. package/src/assets/icons/commit.svg +1 -0
  81. package/src/assets/icons/filter.svg +1 -0
  82. package/src/assets/icons/help.svg +1 -0
  83. package/src/assets/icons/menu.svg +1 -0
  84. package/src/{ui/icon/assets → assets/icons}/sort.svg +0 -0
  85. package/src/assets/icons/warning.svg +1 -0
  86. package/src/assets/icons.svg +1 -0
  87. package/src/ui/icon/icon.jsx +7 -42
  88. package/src/utils.jsx +5 -3
  89. package/lib/ui/icon/assets/arrow.svg +0 -4
  90. package/lib/ui/icon/assets/branch.svg +0 -3
  91. package/lib/ui/icon/assets/cancel.svg +0 -4
  92. package/lib/ui/icon/assets/clock.svg +0 -3
  93. package/lib/ui/icon/assets/close.svg +0 -4
  94. package/lib/ui/icon/assets/commit.svg +0 -3
  95. package/lib/ui/icon/assets/filter.svg +0 -4
  96. package/lib/ui/icon/assets/help.svg +0 -4
  97. package/lib/ui/icon/assets/job.svg +0 -3
  98. package/lib/ui/icon/assets/menu.svg +0 -4
  99. package/lib/ui/icon/assets/package.svg +0 -3
  100. package/lib/ui/icon/assets/pull-request.svg +0 -3
  101. package/lib/ui/icon/assets/repository.svg +0 -3
  102. package/lib/ui/icon/assets/warning.svg +0 -4
  103. package/lib-esm/ui/icon/assets/arrow.svg +0 -4
  104. package/lib-esm/ui/icon/assets/branch.svg +0 -3
  105. package/lib-esm/ui/icon/assets/cancel.svg +0 -4
  106. package/lib-esm/ui/icon/assets/clock.svg +0 -3
  107. package/lib-esm/ui/icon/assets/close.svg +0 -4
  108. package/lib-esm/ui/icon/assets/commit.svg +0 -3
  109. package/lib-esm/ui/icon/assets/filter.svg +0 -4
  110. package/lib-esm/ui/icon/assets/help.svg +0 -4
  111. package/lib-esm/ui/icon/assets/job.svg +0 -3
  112. package/lib-esm/ui/icon/assets/menu.svg +0 -4
  113. package/lib-esm/ui/icon/assets/package.svg +0 -3
  114. package/lib-esm/ui/icon/assets/pull-request.svg +0 -3
  115. package/lib-esm/ui/icon/assets/repository.svg +0 -3
  116. package/lib-esm/ui/icon/assets/warning.svg +0 -4
  117. package/src/ui/icon/assets/arrow.svg +0 -4
  118. package/src/ui/icon/assets/branch.svg +0 -3
  119. package/src/ui/icon/assets/cancel.svg +0 -4
  120. package/src/ui/icon/assets/clock.svg +0 -3
  121. package/src/ui/icon/assets/close.svg +0 -4
  122. package/src/ui/icon/assets/commit.svg +0 -3
  123. package/src/ui/icon/assets/filter.svg +0 -4
  124. package/src/ui/icon/assets/help.svg +0 -4
  125. package/src/ui/icon/assets/job.svg +0 -3
  126. package/src/ui/icon/assets/menu.svg +0 -4
  127. package/src/ui/icon/assets/package.svg +0 -3
  128. package/src/ui/icon/assets/pull-request.svg +0 -3
  129. package/src/ui/icon/assets/repository.svg +0 -3
  130. package/src/ui/icon/assets/warning.svg +0 -4
@@ -7,36 +7,51 @@ import { Header } from '.';
7
7
  const stories = storiesOf('Layout/Header', module);
8
8
  stories.addDecorator(getWrapperDecorator());
9
9
  stories.add('default', () => /*#__PURE__*/React.createElement(Header, {
10
- renderLeft: ({
11
- className
12
- }) => /*#__PURE__*/React.createElement("div", {
13
- className: className
14
- }, /*#__PURE__*/React.createElement(Logo, null)),
15
- render: ({
16
- className
17
- }) => /*#__PURE__*/React.createElement("div", {
18
- className: className
19
- }, /*#__PURE__*/React.createElement(Tabs, null, /*#__PURE__*/React.createElement("span", null, "Totals"), /*#__PURE__*/React.createElement("span", null, "Assets"), /*#__PURE__*/React.createElement("span", null, "Modules"))),
20
- renderRight: ({
21
- className
22
- }) => /*#__PURE__*/React.createElement("div", {
23
- className: className
24
- }, /*#__PURE__*/React.createElement(Logo, {
25
- kind: "github"
26
- }))
10
+ renderLeft: _ref => {
11
+ let {
12
+ className
13
+ } = _ref;
14
+ return /*#__PURE__*/React.createElement("div", {
15
+ className: className
16
+ }, /*#__PURE__*/React.createElement(Logo, null));
17
+ },
18
+ render: _ref2 => {
19
+ let {
20
+ className
21
+ } = _ref2;
22
+ return /*#__PURE__*/React.createElement("div", {
23
+ className: className
24
+ }, /*#__PURE__*/React.createElement(Tabs, null, /*#__PURE__*/React.createElement("span", null, "Totals"), /*#__PURE__*/React.createElement("span", null, "Assets"), /*#__PURE__*/React.createElement("span", null, "Modules")));
25
+ },
26
+ renderRight: _ref3 => {
27
+ let {
28
+ className
29
+ } = _ref3;
30
+ return /*#__PURE__*/React.createElement("div", {
31
+ className: className
32
+ }, /*#__PURE__*/React.createElement(Logo, {
33
+ kind: "github"
34
+ }));
35
+ }
27
36
  }));
28
37
  stories.add('menu on the right', () => /*#__PURE__*/React.createElement(Header, {
29
- renderLeft: ({
30
- className
31
- }) => /*#__PURE__*/React.createElement("div", {
32
- className: className
33
- }, /*#__PURE__*/React.createElement(Logo, null)),
34
- renderRight: ({
35
- className
36
- }) => /*#__PURE__*/React.createElement("div", {
37
- className: className,
38
- style: {
39
- flexBasis: '100%'
40
- }
41
- }, /*#__PURE__*/React.createElement(Tabs, null, /*#__PURE__*/React.createElement("span", null, "Totals"), /*#__PURE__*/React.createElement("span", null, "Assets"), /*#__PURE__*/React.createElement("span", null, "Modules")))
38
+ renderLeft: _ref4 => {
39
+ let {
40
+ className
41
+ } = _ref4;
42
+ return /*#__PURE__*/React.createElement("div", {
43
+ className: className
44
+ }, /*#__PURE__*/React.createElement(Logo, null));
45
+ },
46
+ renderRight: _ref5 => {
47
+ let {
48
+ className
49
+ } = _ref5;
50
+ return /*#__PURE__*/React.createElement("div", {
51
+ className: className,
52
+ style: {
53
+ flexBasis: '100%'
54
+ }
55
+ }, /*#__PURE__*/React.createElement(Tabs, null, /*#__PURE__*/React.createElement("span", null, "Totals"), /*#__PURE__*/React.createElement("span", null, "Assets"), /*#__PURE__*/React.createElement("span", null, "Modules")));
56
+ }
42
57
  }));
@@ -26,10 +26,11 @@ stories.add('typography', () => /*#__PURE__*/React.createElement(React.Fragment,
26
26
  }
27
27
  })))); // eslint-disable-next-line react/prop-types
28
28
 
29
- const Item = ({
30
- colorName,
31
- valueName = 'normal'
32
- }) => {
29
+ const Item = _ref => {
30
+ let {
31
+ colorName,
32
+ valueName = 'normal'
33
+ } = _ref;
33
34
  const colorFullName = valueName === 'normal' ? colorName : [colorName, valueName].join('-');
34
35
  return /*#__PURE__*/React.createElement("div", {
35
36
  style: {
@@ -1,18 +1,24 @@
1
1
  import React from 'react';
2
2
  import { MemoryRouter } from 'react-router-dom';
3
- export const getWrapperDecorator = (customWrapperStyles = {}) => storyFn => {
4
- const wrapperStyles = {
5
- width: '100%',
6
- height: '100%',
7
- padding: '24px',
8
- ...customWrapperStyles
3
+ export const getWrapperDecorator = function (customWrapperStyles) {
4
+ if (customWrapperStyles === void 0) {
5
+ customWrapperStyles = {};
6
+ }
7
+
8
+ return storyFn => {
9
+ const wrapperStyles = {
10
+ width: '100%',
11
+ height: '100%',
12
+ padding: '24px',
13
+ ...customWrapperStyles
14
+ };
15
+ return /*#__PURE__*/React.createElement(MemoryRouter, {
16
+ initialEntries: [{
17
+ pathname: '/',
18
+ key: 'home'
19
+ }]
20
+ }, /*#__PURE__*/React.createElement("div", {
21
+ style: wrapperStyles
22
+ }, storyFn()));
9
23
  };
10
- return /*#__PURE__*/React.createElement(MemoryRouter, {
11
- initialEntries: [{
12
- pathname: '/',
13
- key: 'home'
14
- }]
15
- }, /*#__PURE__*/React.createElement("div", {
16
- style: wrapperStyles
17
- }, storyFn()));
18
24
  };
@@ -4,15 +4,18 @@ import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import cx from 'classnames';
6
6
  import css from './container.module.css';
7
- export const Container = ({
8
- className,
9
- as: Component,
10
- ...restProps
11
- }) => /*#__PURE__*/React.createElement(Component, {
12
- className: cx(css.root, className)
13
- }, /*#__PURE__*/React.createElement("div", _extends({
14
- className: css.inner
15
- }, restProps)));
7
+ export const Container = _ref => {
8
+ let {
9
+ className,
10
+ as: Component,
11
+ ...restProps
12
+ } = _ref;
13
+ return /*#__PURE__*/React.createElement(Component, {
14
+ className: cx(css.root, className)
15
+ }, /*#__PURE__*/React.createElement("div", _extends({
16
+ className: css.inner
17
+ }, restProps)));
18
+ };
16
19
  Container.defaultProps = {
17
20
  className: '',
18
21
  as: 'div'
@@ -16,9 +16,12 @@ stories.add('with right alignement', () => /*#__PURE__*/React.createElement(Drop
16
16
  stories.add('with render function', () => /*#__PURE__*/React.createElement(Dropdown, {
17
17
  glyph: "filter",
18
18
  label: "Toggle"
19
- }, ({
20
- dropdownToggle
21
- }) => /*#__PURE__*/React.createElement("button", {
22
- type: "button",
23
- onClick: dropdownToggle
24
- }, "Toggle dropdown")));
19
+ }, _ref => {
20
+ let {
21
+ dropdownToggle
22
+ } = _ref;
23
+ return /*#__PURE__*/React.createElement("button", {
24
+ type: "button",
25
+ onClick: dropdownToggle
26
+ }, "Toggle dropdown");
27
+ }));
@@ -2,13 +2,16 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import cx from 'classnames';
4
4
  import css from './file-name.module.css';
5
- export const FileName = ({
6
- className,
7
- as: Component,
8
- name
9
- }) => /*#__PURE__*/React.createElement(Component, {
10
- className: cx(css.root, className)
11
- }, name);
5
+ export const FileName = _ref => {
6
+ let {
7
+ className,
8
+ as: Component,
9
+ name
10
+ } = _ref;
11
+ return /*#__PURE__*/React.createElement(Component, {
12
+ className: cx(css.root, className)
13
+ }, name);
14
+ };
12
15
  FileName.defaultProps = {
13
16
  className: '',
14
17
  as: 'span',
@@ -13,7 +13,10 @@ const getInitialValues = (key, filters) => {
13
13
  }
14
14
 
15
15
  if (typeof filters === 'object') {
16
- return Object.entries(filters).map(([groupKey, groupFilters]) => getInitialValues([...(key ? [key] : []), groupKey].join('.'), groupFilters)).reduce((agg, current) => ({ ...agg,
16
+ return Object.entries(filters).map(_ref => {
17
+ let [groupKey, groupFilters] = _ref;
18
+ return getInitialValues([...(key ? [key] : []), groupKey].join('.'), groupFilters);
19
+ }).reduce((agg, current) => ({ ...agg,
17
20
  ...current
18
21
  }), {});
19
22
  }
@@ -26,10 +29,11 @@ export const filtersDropdownContainer = BaseComponent => {
26
29
  constructor(props) {
27
30
  super(props);
28
31
 
29
- this.toggleFilter = (key, value) => this.setState(({
30
- values,
31
- ...state
32
- }) => {
32
+ this.toggleFilter = (key, value) => this.setState(_ref2 => {
33
+ let {
34
+ values,
35
+ ...state
36
+ } = _ref2;
33
37
  const newState = { ...state,
34
38
  values: { ...values,
35
39
  [key]: value
@@ -71,9 +75,11 @@ export const filtersDropdownContainer = BaseComponent => {
71
75
  };
72
76
  }
73
77
 
74
- static getDerivedStateFromProps({
75
- filters
76
- }, state) {
78
+ static getDerivedStateFromProps(_ref3, state) {
79
+ let {
80
+ filters
81
+ } = _ref3;
82
+
77
83
  if (_isEqual(filters, state.values)) {
78
84
  return null;
79
85
  }
@@ -65,34 +65,51 @@ const FilterGroup = props => {
65
65
  ...groupData
66
66
  } = data;
67
67
  const groupItems = Object.entries(groupData);
68
- const groupCheckboxes = groupItems.filter(([itemKey, item]) => typeof (item == null ? void 0 : item.defaultValue) !== 'undefined');
69
- const isGroupChecked = groupCheckboxes.map(([itemKey]) => _get(values, `${groupKey}.${itemKey}`)).reduce((agg, val) => agg && val, true);
68
+ const groupCheckboxes = groupItems.filter(_ref => {
69
+ let [itemKey, item] = _ref;
70
+ return typeof (item == null ? void 0 : item.defaultValue) !== 'undefined';
71
+ });
72
+ const isGroupChecked = groupCheckboxes.map(_ref2 => {
73
+ let [itemKey] = _ref2;
74
+ return _get(values, `${groupKey}.${itemKey}`);
75
+ }).reduce((agg, val) => agg && val, true);
70
76
  const filterSuffix = getGroupFiltersLabelSuffix(groupItems);
71
77
  const hasCustomFilterSuffix = !Object.values(LABELS).includes(filterSuffix);
72
78
  const dropdownLabel = /*#__PURE__*/React.createElement(React.Fragment, null, `${groupLabel}:`, "\xA0", /*#__PURE__*/React.createElement("span", {
73
79
  className: cx(hasCustomFilterSuffix && css.labelSuffixCustom)
74
80
  }, filterSuffix));
75
81
 
76
- const getOnGroupCheck = (value, overrides = {}) => () => {
77
- const newFilters = groupCheckboxes.reduce((agg, [itemKey]) => ({ ...agg,
78
- [`${groupKey}.${itemKey}`]: value
79
- }), {});
80
- toggleFilters({ ...newFilters,
81
- ...overrides
82
- });
82
+ const getOnGroupCheck = function (value, overrides) {
83
+ if (overrides === void 0) {
84
+ overrides = {};
85
+ }
86
+
87
+ return () => {
88
+ const newFilters = groupCheckboxes.reduce((agg, _ref3) => {
89
+ let [itemKey] = _ref3;
90
+ return { ...agg,
91
+ [`${groupKey}.${itemKey}`]: value
92
+ };
93
+ }, {});
94
+ toggleFilters({ ...newFilters,
95
+ ...overrides
96
+ });
97
+ };
83
98
  };
84
99
 
85
100
  return /*#__PURE__*/React.createElement(Dropdown, {
86
101
  label: dropdownLabel,
87
102
  ariaLabel: `${groupLabel}: ${filterSuffix}`
88
- }, ({
89
- MenuItem,
90
- menu,
91
- menuItemClassName
92
- }) => {
103
+ }, _ref4 => {
104
+ let {
105
+ MenuItem,
106
+ menu,
107
+ menuItemClassName
108
+ } = _ref4;
93
109
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
94
110
  className: css.filterGroupItems
95
- }, groupItems.map(([itemKey, itemData]) => {
111
+ }, groupItems.map(_ref5 => {
112
+ let [itemKey, itemData] = _ref5;
96
113
  const id = [groupKey, itemKey].join('.');
97
114
 
98
115
  const getOnOnlyClick = () => getOnGroupCheck(false, {
@@ -147,16 +164,21 @@ export const Filters = props => {
147
164
  toggleFilters
148
165
  } = props;
149
166
 
150
- const onCheckboxChange = ({
151
- target
152
- }) => toggleFilter(target.name, target.checked);
167
+ const onCheckboxChange = _ref6 => {
168
+ let {
169
+ target
170
+ } = _ref6;
171
+ return toggleFilter(target.name, target.checked);
172
+ };
153
173
 
154
174
  const rootClassName = cx(css.root, className);
155
175
  return /*#__PURE__*/React.createElement("form", {
156
176
  className: rootClassName
157
177
  }, /*#__PURE__*/React.createElement(FlexStack, {
158
178
  className: css.items
159
- }, Object.entries(filters).map(([name, data]) => {
179
+ }, Object.entries(filters).map(_ref7 => {
180
+ let [name, data] = _ref7;
181
+
160
182
  if (typeof (data == null ? void 0 : data.defaultValue) !== 'undefined') {
161
183
  return /*#__PURE__*/React.createElement(Filter, {
162
184
  key: name,
@@ -8,9 +8,10 @@ stories.addDecorator(getWrapperDecorator({
8
8
  paddingLeft: '200px'
9
9
  }));
10
10
 
11
- const FiltersState = ({
12
- children
13
- }) => {
11
+ const FiltersState = _ref => {
12
+ let {
13
+ children
14
+ } = _ref;
14
15
  const [values, setValues] = useState({
15
16
  changed: true,
16
17
  'assetType.entrypoint': true
@@ -13,9 +13,12 @@ export const LABELS = {
13
13
  export const getGroupFiltersLabelSuffix = filters => {
14
14
  const filterCount = filters.length; // eslint-disable-next-line no-unused-vars
15
15
 
16
- const checkedFilters = filters.filter(([_, {
17
- defaultValue
18
- }]) => defaultValue);
16
+ const checkedFilters = filters.filter(_ref => {
17
+ let [_, {
18
+ defaultValue
19
+ }] = _ref;
20
+ return defaultValue;
21
+ });
19
22
  const filterCheckedCount = checkedFilters.length;
20
23
 
21
24
  if (filterCheckedCount === 0) {
@@ -27,9 +30,12 @@ export const getGroupFiltersLabelSuffix = filters => {
27
30
  } // eslint-disable-next-line no-unused-vars
28
31
 
29
32
 
30
- const checkedFilterLabels = checkedFilters.map(([_, {
31
- label
32
- }]) => label);
33
+ const checkedFilterLabels = checkedFilters.map(_ref2 => {
34
+ let [_, {
35
+ label
36
+ }] = _ref2;
37
+ return label;
38
+ });
33
39
  let suffix = '';
34
40
  let inlinedLabelCount = 0;
35
41
  let done = false;
@@ -110,12 +110,13 @@ export const HorizontalBarChart = props => {
110
110
  }, []);
111
111
  return /*#__PURE__*/React.createElement("div", {
112
112
  className: cx(css.root, className)
113
- }, entries.map(({
114
- color,
115
- getItemTooltip,
116
- label,
117
- width
118
- }, index) => {
113
+ }, entries.map((_ref, index) => {
114
+ let {
115
+ color,
116
+ getItemTooltip,
117
+ label,
118
+ width
119
+ } = _ref;
119
120
  const key = index;
120
121
  return /*#__PURE__*/React.createElement(HorizontalBarChartItem, {
121
122
  key: key,
@@ -3,191 +3,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
3
3
  import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import cx from 'classnames';
6
-
7
- var ArrowIcon = function ArrowIcon(props) {
8
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
9
- fill: "none",
10
- d: "M0 0h24v24H0V0z"
11
- }), /*#__PURE__*/React.createElement("path", {
12
- d: "M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
13
- }));
14
- };
15
-
16
- ArrowIcon.defaultProps = {
17
- viewBox: "0 0 24 24",
18
- xmlns: "http://www.w3.org/2000/svg",
19
- fill: "currentColor"
20
- };
21
-
22
- var BranchIcon = function BranchIcon(props) {
23
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
24
- d: "M512 192c-70.625 0-128 57.344-128 128 0 47.219 25.875 88.062 64 110.281V448s0 128-128 128c-53.062 0-94.656 11.375-128 28.812V302.281c38.156-22.219 64-63.062 64-110.281 0-70.656-57.344-128-128-128S0 121.344 0 192c0 47.219 25.844 88.062 64 110.281V721.75C25.844 743.938 0 784.75 0 832c0 70.625 57.344 128 128 128s128-57.375 128-128c0-33.5-13.188-63.75-34.25-86.625C240.375 722.5 270.656 704 320 704c254 0 256-256 256-256v-17.719c38.125-22.219 64-63.062 64-110.281 0-70.656-57.375-128-128-128zm-384-64c35.406 0 64 28.594 64 64s-28.594 64-64 64-64-28.594-64-64 28.594-64 64-64zm0 768c-35.406 0-64-28.625-64-64 0-35.312 28.594-64 64-64s64 28.688 64 64c0 35.375-28.594 64-64 64zm384-512c-35.375 0-64-28.594-64-64s28.625-64 64-64 64 28.594 64 64-28.625 64-64 64z"
25
- }));
26
- };
27
-
28
- BranchIcon.defaultProps = {
29
- viewBox: "0 0 640 1024",
30
- xmlns: "http://www.w3.org/2000/svg",
31
- fill: "currentColor"
32
- };
33
-
34
- var CancelIcon = function CancelIcon(props) {
35
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
36
- d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"
37
- }), /*#__PURE__*/React.createElement("path", {
38
- d: "M0 0h24v24H0z",
39
- fill: "none"
40
- }));
41
- };
42
-
43
- CancelIcon.defaultProps = {
44
- xmlns: "http://www.w3.org/2000/svg",
45
- height: "24",
46
- viewBox: "0 0 24 24",
47
- width: "24",
48
- fill: "currentColor"
49
- };
50
-
51
- var ClockIcon = function ClockIcon(props) {
52
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
53
- fillRule: "evenodd",
54
- d: "M8 8h3v2H7c-.55 0-1-.45-1-1V4h2v4zM7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7z"
55
- }));
56
- };
57
-
58
- ClockIcon.defaultProps = {
59
- viewBox: "0 0 14 16",
60
- fill: "currentColor"
61
- };
62
-
63
- var CloseIcon = function CloseIcon(props) {
64
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
65
- d: "M0 0h24v24H0z",
66
- fill: "none"
67
- }), /*#__PURE__*/React.createElement("path", {
68
- d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
69
- }));
70
- };
71
-
72
- CloseIcon.defaultProps = {
73
- xmlns: "http://www.w3.org/2000/svg",
74
- viewBox: "0 0 24 24",
75
- fill: "currentColor"
76
- };
77
-
78
- var CommitIcon = function CommitIcon(props) {
79
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
80
- d: "M694.875 448C666.375 337.781 567.125 256 448 256c-119.094 0-218.375 81.781-246.906 192H0v128h201.094C229.625 686.25 328.906 768 448 768c119.125 0 218.375-81.75 246.875-192H896V448H694.875zM448 640c-70.656 0-128-57.375-128-128 0-70.656 57.344-128 128-128 70.625 0 128 57.344 128 128 0 70.625-57.375 128-128 128z"
81
- }));
82
- };
83
-
84
- CommitIcon.defaultProps = {
85
- viewBox: "0 0 896 1024",
86
- xmlns: "http://www.w3.org/2000/svg",
87
- fill: "currentColor"
88
- };
89
-
90
- var FilterIcon = function FilterIcon(props) {
91
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
92
- d: "M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"
93
- }), /*#__PURE__*/React.createElement("path", {
94
- d: "M0 0h24v24H0z",
95
- fill: "none"
96
- }));
97
- };
98
-
99
- FilterIcon.defaultProps = {
100
- viewBox: "0 0 24 24",
101
- xmlns: "http://www.w3.org/2000/svg",
102
- fill: "currentColor"
103
- };
104
-
105
- var HelpIcon = function HelpIcon(props) {
106
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
107
- d: "M0 0h24v24H0z",
108
- fill: "none"
109
- }), /*#__PURE__*/React.createElement("path", {
110
- d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
111
- }));
112
- };
113
-
114
- HelpIcon.defaultProps = {
115
- viewBox: "0 0 24 24",
116
- fill: "currentColor"
117
- };
118
-
119
- var MenuIcon = function MenuIcon(props) {
120
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
121
- d: "M0 0h24v24H0z",
122
- fill: "none"
123
- }), /*#__PURE__*/React.createElement("path", {
124
- d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
125
- }));
126
- };
127
-
128
- MenuIcon.defaultProps = {
129
- viewBox: "0 0 24 24",
130
- xmlns: "http://www.w3.org/2000/svg",
131
- fill: "currentColor"
132
- };
133
-
134
- var PackageIcon = function PackageIcon(props) {
135
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
136
- d: "M480 64L0 192v576l480 128 480-128V192L480 64zM63.875 720.934L63.5 288l384.498 102.533.001 432.833L63.875 720.934zM63.5 224l160.254-42.734L640 292.265v.135l-160 42.667L63.5 224zm832.625 496.934L512.001 823.366l.001-432.833L640 356.4v156l128-34.135V322.267L896.5 288l-.375 432.934zM768 258.267v-.125L351.734 147.138 480 112.934 896.5 224 768 258.267z"
137
- }));
138
- };
139
-
140
- PackageIcon.defaultProps = {
141
- viewBox: "0 0 1024 1024",
142
- xmlns: "http://www.w3.org/2000/svg",
143
- fill: "currentColor"
144
- };
145
-
146
- var PullRequestIcon = function PullRequestIcon(props) {
147
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
148
- d: "M128 64C57.344 64 0 121.344 0 192c0 47.219 25.906 88.062 64 110.281V721.75C25.906 743.938 0 784.75 0 832c0 70.625 57.344 128 128 128s128-57.375 128-128c0-47.25-25.844-88.062-64-110.25V302.281c38.156-22.219 64-63.062 64-110.281 0-70.656-57.344-128-128-128zm0 832c-35.312 0-64-28.625-64-64 0-35.312 28.688-64 64-64 35.406 0 64 28.688 64 64 0 35.375-28.594 64-64 64zm0-640c-35.312 0-64-28.594-64-64s28.688-64 64-64c35.406 0 64 28.594 64 64s-28.594 64-64 64zm576 465.75V320c0-192.5-192-192-192-192h-64V0L256 192l192 192V256h64c56.438 0 64 64 64 64v401.75c-38.125 22.188-64 62.938-64 110.25 0 70.625 57.375 128 128 128s128-57.375 128-128c0-47.25-25.875-88.062-64-110.25zM640 896c-35.312 0-64-28.625-64-64 0-35.312 28.688-64 64-64 35.375 0 64 28.688 64 64 0 35.375-28.625 64-64 64z"
149
- }));
150
- };
151
-
152
- PullRequestIcon.defaultProps = {
153
- viewBox: "0 0 768 1024",
154
- xmlns: "http://www.w3.org/2000/svg",
155
- fill: "currentColor"
156
- };
157
-
158
- var SortIcon = function SortIcon(props) {
159
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
160
- d: "M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"
161
- }), /*#__PURE__*/React.createElement("path", {
162
- d: "M0 0h24v24H0z",
163
- fill: "none"
164
- }));
165
- };
166
-
167
- SortIcon.defaultProps = {
168
- viewBox: "0 0 24 24",
169
- xmlns: "http://www.w3.org/2000/svg",
170
- fill: "currentColor"
171
- };
172
-
173
- var WarningIcon = function WarningIcon(props) {
174
- return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
175
- d: "M0 0h24v24H0z",
176
- fill: "none"
177
- }), /*#__PURE__*/React.createElement("path", {
178
- d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"
179
- }));
180
- };
181
-
182
- WarningIcon.defaultProps = {
183
- viewBox: "0 0 24 24",
184
- xmlns: "http://www.w3.org/2000/svg",
185
- fill: "currentColor"
186
- };
187
6
  import css from './icon.module.css';
188
7
  const ICONS = {
189
8
  ARROW: 'arrow',
190
- BRANCH: 'branch',
191
9
  CANCEL: 'cancel',
192
10
  CLOSE: 'close',
193
11
  CLOCK: 'clock',
@@ -195,39 +13,24 @@ const ICONS = {
195
13
  FILTER: 'filter',
196
14
  HELP: 'help',
197
15
  MENU: 'menu',
198
- PACKAGE: 'package',
199
- PR: 'pr',
200
16
  SORT: 'sort',
201
17
  WARNING: 'warning'
202
18
  };
203
- const ICON_MAP = {
204
- [ICONS.ARROW]: ArrowIcon,
205
- [ICONS.BRANCH]: BranchIcon,
206
- [ICONS.CANCEL]: CancelIcon,
207
- [ICONS.CLOCK]: ClockIcon,
208
- [ICONS.CLOSE]: CloseIcon,
209
- [ICONS.COMMIT]: CommitIcon,
210
- [ICONS.FILTER]: FilterIcon,
211
- [ICONS.HELP]: HelpIcon,
212
- [ICONS.MENU]: MenuIcon,
213
- [ICONS.PACKAGE]: PackageIcon,
214
- [ICONS.PR]: PullRequestIcon,
215
- [ICONS.SORT]: SortIcon,
216
- [ICONS.WARNING]: WarningIcon
217
- };
218
- export const Icon = ({
219
- className,
220
- glyph,
221
- as: Component,
222
- size,
223
- ...restProps
224
- }) => {
225
- const Svg = typeof glyph === 'string' ? ICON_MAP[glyph] : glyph;
19
+ export const Icon = _ref => {
20
+ let {
21
+ className,
22
+ glyph,
23
+ as: Component,
24
+ size,
25
+ ...restProps
26
+ } = _ref;
226
27
  return /*#__PURE__*/React.createElement(Component, _extends({
227
28
  className: cx(css.root, className, css[size])
228
- }, restProps), /*#__PURE__*/React.createElement(Svg, {
29
+ }, restProps), /*#__PURE__*/React.createElement("svg", {
229
30
  className: css.icon
230
- }));
31
+ }, /*#__PURE__*/React.createElement("use", {
32
+ xlinkHref: `#${glyph}`
33
+ })));
231
34
  };
232
35
  Icon.ICONS = ICONS;
233
36
  Icon.SIZE_SMALL = 'small';