@bundle-stats/ui 4.1.1-alpha.3 → 4.1.2-alpha.0

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 (265) hide show
  1. package/lib/app/app.js +20 -85
  2. package/lib/app/app.stories.js +2 -20
  3. package/lib/app/header/header.js +2 -11
  4. package/lib/app/header/index.js +0 -2
  5. package/lib/app/index.js +0 -2
  6. package/lib/components/asset-info/asset-info.js +7 -25
  7. package/lib/components/asset-info/asset-info.stories.js +0 -5
  8. package/lib/components/asset-info/index.js +0 -2
  9. package/lib/components/browsertime-table/browsertime-table.js +1 -12
  10. package/lib/components/browsertime-table/browsertime-table.stories.js +1 -11
  11. package/lib/components/browsertime-table/index.js +0 -2
  12. package/lib/components/bundle-assets/bundle-assets.constants.js +0 -3
  13. package/lib/components/bundle-assets/bundle-assets.js +29 -86
  14. package/lib/components/bundle-assets/bundle-assets.stories.js +2 -23
  15. package/lib/components/bundle-assets/bundle-assets.utils.js +0 -26
  16. package/lib/components/bundle-assets/index.js +21 -49
  17. package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +3 -33
  18. package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.stories.js +0 -8
  19. package/lib/components/bundle-assets-totals-chart-bars/index.js +0 -2
  20. package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.js +7 -29
  21. package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +0 -10
  22. package/lib/components/bundle-assets-totals-table/index.js +0 -2
  23. package/lib/components/bundle-modules/bundle-modules.constants.js +0 -3
  24. package/lib/components/bundle-modules/bundle-modules.js +24 -77
  25. package/lib/components/bundle-modules/bundle-modules.stories.js +16 -30
  26. package/lib/components/bundle-modules/bundle-modules.utils.js +19 -54
  27. package/lib/components/bundle-modules/index.js +25 -56
  28. package/lib/components/bundle-packages/bundle-packages.constants.js +0 -3
  29. package/lib/components/bundle-packages/bundle-packages.js +33 -83
  30. package/lib/components/bundle-packages/bundle-packages.stories.js +2 -22
  31. package/lib/components/bundle-packages/bundle-packages.utils.js +0 -23
  32. package/lib/components/bundle-packages/index.js +23 -49
  33. package/lib/components/component-link.js +4 -17
  34. package/lib/components/delta/delta.js +3 -10
  35. package/lib/components/delta/delta.stories.js +0 -5
  36. package/lib/components/delta/index.js +0 -2
  37. package/lib/components/duplicate-packages-warning/duplicate-packages-warning.js +3 -15
  38. package/lib/components/duplicate-packages-warning/duplicate-packages-warning.module.css +1 -0
  39. package/lib/components/duplicate-packages-warning/duplicate-packages-warning.stories.js +0 -5
  40. package/lib/components/duplicate-packages-warning/index.js +0 -2
  41. package/lib/components/index.js +0 -22
  42. package/lib/components/job-header/index.js +0 -2
  43. package/lib/components/job-header/job-header.js +6 -22
  44. package/lib/components/job-header/job-header.stories.js +0 -5
  45. package/lib/components/job-meta/index.js +0 -2
  46. package/lib/components/job-meta/job-meta.js +4 -18
  47. package/lib/components/job-meta/job-meta.stories.js +0 -5
  48. package/lib/components/job-name/index.js +0 -2
  49. package/lib/components/job-name/job-name.js +4 -19
  50. package/lib/components/job-name/job-name.stories.js +0 -5
  51. package/lib/components/jobs-header/index.js +0 -2
  52. package/lib/components/jobs-header/jobs-header.js +1 -12
  53. package/lib/components/jobs-header/jobs-header.stories.js +0 -5
  54. package/lib/components/lighthouse-table/index.js +0 -2
  55. package/lib/components/lighthouse-table/lighthouse-table.js +1 -12
  56. package/lib/components/lighthouse-table/lighthouse-table.stories.js +0 -7
  57. package/lib/components/metric/index.js +0 -2
  58. package/lib/components/metric/metric.js +27 -45
  59. package/lib/components/metric/metric.stories.js +0 -6
  60. package/lib/components/metrics-table/index.js +0 -2
  61. package/lib/components/metrics-table/metrics-table.js +36 -75
  62. package/lib/components/metrics-table/metrics-table.stories.js +0 -5
  63. package/lib/components/metrics-table-options/index.js +0 -2
  64. package/lib/components/metrics-table-options/metrics-table-options.js +5 -19
  65. package/lib/components/metrics-table-options/metrics-table-options.stories.js +0 -5
  66. package/lib/components/metrics-table-search/index.js +0 -2
  67. package/lib/components/metrics-table-search/metrics-table-search.js +9 -28
  68. package/lib/components/metrics-table-search/metrics-table-search.stories.js +3 -19
  69. package/lib/components/metrics-table-title/index.js +0 -2
  70. package/lib/components/metrics-table-title/metrics-table-title.js +4 -16
  71. package/lib/components/module-info/index.js +0 -2
  72. package/lib/components/module-info/module-info.js +6 -22
  73. package/lib/components/module-info/module-info.stories.js +0 -5
  74. package/lib/components/summary/index.js +0 -2
  75. package/lib/components/summary/summary.js +9 -33
  76. package/lib/components/summary/summary.module.css +4 -1
  77. package/lib/components/summary/summary.stories.js +1 -15
  78. package/lib/components/summary-item/index.js +0 -2
  79. package/lib/components/summary-item/summary-item.js +26 -49
  80. package/lib/components/summary-item/summary-item.module.css +10 -4
  81. package/lib/components/summary-item/summary-item.stories.js +0 -14
  82. package/lib/components/total-size-type-title/index.js +0 -2
  83. package/lib/components/total-size-type-title/total-size-type-title.js +0 -13
  84. package/lib/constants.js +0 -8
  85. package/lib/css/default.css +4 -1
  86. package/lib/css/variables.css +5 -4
  87. package/lib/hooks/rows-filter.js +3 -7
  88. package/lib/hooks/rows-sort.js +12 -25
  89. package/lib/hooks/search-params.js +21 -51
  90. package/lib/index.js +0 -10
  91. package/lib/layout/box/box.js +10 -39
  92. package/lib/layout/box/box.stories.js +0 -5
  93. package/lib/layout/box/index.js +0 -1
  94. package/lib/layout/flex-stack/flex-stack.js +4 -18
  95. package/lib/layout/flex-stack/flex-stack.stories.js +0 -6
  96. package/lib/layout/flex-stack/index.js +0 -2
  97. package/lib/layout/footer/footer.js +1 -16
  98. package/lib/layout/footer/footer.stories.js +0 -5
  99. package/lib/layout/footer/index.js +0 -1
  100. package/lib/layout/header/header.js +3 -13
  101. package/lib/layout/header/header.stories.js +0 -7
  102. package/lib/layout/header/index.js +0 -1
  103. package/lib/layout/index.js +0 -7
  104. package/lib/layout/separator.js +2 -14
  105. package/lib/layout/stack/index.js +0 -2
  106. package/lib/layout/stack/stack.js +4 -18
  107. package/lib/layout/stack/stack.stories.js +0 -6
  108. package/lib/layout/sub-header/index.js +0 -2
  109. package/lib/layout/sub-header/sub-header.js +6 -16
  110. package/lib/layout/sub-header/sub-header.stories.js +0 -6
  111. package/lib/prototypes/typography.stories.js +6 -15
  112. package/lib/query-state.js +5 -28
  113. package/lib/stories/index.js +0 -2
  114. package/lib/stories/wrapper.js +0 -9
  115. package/lib/ui/alert/alert.js +2 -10
  116. package/lib/ui/alert/alert.stories.js +0 -5
  117. package/lib/ui/alert/index.js +0 -2
  118. package/lib/ui/container/container.js +2 -15
  119. package/lib/ui/container/container.stories.js +0 -4
  120. package/lib/ui/container/index.js +0 -1
  121. package/lib/ui/dropdown/dropdown.js +5 -20
  122. package/lib/ui/dropdown/dropdown.stories.js +0 -5
  123. package/lib/ui/dropdown/index.js +0 -2
  124. package/lib/ui/empty-set/empty-set.js +3 -17
  125. package/lib/ui/empty-set/empty-set.stories.js +0 -5
  126. package/lib/ui/empty-set/index.js +0 -2
  127. package/lib/ui/file-name/file-name.js +2 -11
  128. package/lib/ui/file-name/file-name.stories.js +0 -4
  129. package/lib/ui/file-name/index.js +0 -1
  130. package/lib/ui/filters/filters.js +29 -73
  131. package/lib/ui/filters/filters.stories.js +7 -28
  132. package/lib/ui/filters/filters.utils.js +13 -42
  133. package/lib/ui/filters/index.js +8 -35
  134. package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.js +18 -61
  135. package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.stories.js +0 -5
  136. package/lib/ui/horizontal-bar-chart/index.js +0 -2
  137. package/lib/ui/hover-card/hover-card.js +8 -28
  138. package/lib/ui/hover-card/hover-card.stories.js +0 -10
  139. package/lib/ui/hover-card/index.js +0 -2
  140. package/lib/ui/icon/icon.js +4 -17
  141. package/lib/ui/icon/icon.stories.js +0 -8
  142. package/lib/ui/icon/index.js +0 -2
  143. package/lib/ui/index.js +0 -19
  144. package/lib/ui/input/index.js +0 -2
  145. package/lib/ui/input/input.js +2 -14
  146. package/lib/ui/input/input.stories.js +0 -5
  147. package/lib/ui/loader/index.js +0 -2
  148. package/lib/ui/loader/loader.js +2 -15
  149. package/lib/ui/loader/loader.stories.js +0 -5
  150. package/lib/ui/logo/index.js +0 -1
  151. package/lib/ui/logo/logo.js +3 -28
  152. package/lib/ui/logo/logo.stories.js +1 -10
  153. package/lib/ui/panels/index.js +0 -1
  154. package/lib/ui/panels/panels.js +5 -23
  155. package/lib/ui/panels/panels.stories.js +0 -5
  156. package/lib/ui/skeleton/index.js +0 -2
  157. package/lib/ui/skeleton/skeleton.js +3 -15
  158. package/lib/ui/skeleton/skeleton.stories.js +0 -8
  159. package/lib/ui/sort-dropdown/index.js +0 -2
  160. package/lib/ui/sort-dropdown/sort-dropdown.js +18 -50
  161. package/lib/ui/sort-dropdown/sort-dropdown.stories.js +1 -5
  162. package/lib/ui/table/index.js +0 -2
  163. package/lib/ui/table/table.js +4 -13
  164. package/lib/ui/table/table.stories.js +4 -9
  165. package/lib/ui/tabs/index.js +0 -1
  166. package/lib/ui/tabs/tabs.js +5 -21
  167. package/lib/ui/tabs/tabs.module.css +6 -2
  168. package/lib/ui/tabs/tabs.stories.js +0 -5
  169. package/lib/ui/tag/index.js +0 -2
  170. package/lib/ui/tag/tag.js +8 -21
  171. package/lib/ui/tag/tag.stories.js +0 -6
  172. package/lib/ui/toolbar/index.js +0 -2
  173. package/lib/ui/toolbar/toolbar.js +2 -9
  174. package/lib/ui/toolbar/toolbar.stories.js +0 -5
  175. package/lib/ui/tooltip/index.js +0 -2
  176. package/lib/ui/tooltip/tooltip.js +8 -21
  177. package/lib/ui/tooltip/tooltip.stories.js +0 -7
  178. package/lib/utils.js +0 -18
  179. package/lib-esm/app/app.js +1 -18
  180. package/lib-esm/app/app.stories.js +3 -5
  181. package/lib-esm/app/header/header.js +1 -1
  182. package/lib-esm/components/asset-info/asset-info.js +0 -8
  183. package/lib-esm/components/browsertime-table/browsertime-table.js +0 -1
  184. package/lib-esm/components/browsertime-table/browsertime-table.stories.js +2 -1
  185. package/lib-esm/components/bundle-assets/bundle-assets.js +2 -14
  186. package/lib-esm/components/bundle-assets/bundle-assets.stories.js +0 -2
  187. package/lib-esm/components/bundle-assets/bundle-assets.utils.js +4 -11
  188. package/lib-esm/components/bundle-assets/index.js +0 -1
  189. package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +0 -7
  190. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +1 -4
  191. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +0 -2
  192. package/lib-esm/components/bundle-modules/bundle-modules.js +4 -16
  193. package/lib-esm/components/bundle-modules/bundle-modules.stories.js +4 -2
  194. package/lib-esm/components/bundle-modules/bundle-modules.utils.js +15 -25
  195. package/lib-esm/components/bundle-modules/index.js +0 -6
  196. package/lib-esm/components/bundle-packages/bundle-packages.js +2 -11
  197. package/lib-esm/components/bundle-packages/bundle-packages.utils.js +4 -8
  198. package/lib-esm/components/bundle-packages/index.js +0 -1
  199. package/lib-esm/components/component-link.js +1 -2
  200. package/lib-esm/components/duplicate-packages-warning/duplicate-packages-warning.module.css +1 -0
  201. package/lib-esm/components/job-header/job-header.js +1 -3
  202. package/lib-esm/components/job-meta/job-meta.js +0 -3
  203. package/lib-esm/components/job-name/job-name.js +0 -4
  204. package/lib-esm/components/jobs-header/jobs-header.js +0 -1
  205. package/lib-esm/components/lighthouse-table/lighthouse-table.js +0 -1
  206. package/lib-esm/components/metric/metric.js +2 -6
  207. package/lib-esm/components/metrics-table/metrics-table.js +14 -18
  208. package/lib-esm/components/metrics-table-options/metrics-table-options.js +0 -3
  209. package/lib-esm/components/metrics-table-search/metrics-table-search.js +4 -2
  210. package/lib-esm/components/metrics-table-search/metrics-table-search.stories.js +0 -2
  211. package/lib-esm/components/module-info/module-info.js +0 -4
  212. package/lib-esm/components/summary/summary.js +0 -2
  213. package/lib-esm/components/summary/summary.module.css +4 -1
  214. package/lib-esm/components/summary/summary.stories.js +0 -1
  215. package/lib-esm/components/summary-item/summary-item.js +12 -14
  216. package/lib-esm/components/summary-item/summary-item.module.css +10 -4
  217. package/lib-esm/constants.js +2 -1
  218. package/lib-esm/css/default.css +4 -1
  219. package/lib-esm/css/variables.css +5 -4
  220. package/lib-esm/hooks/rows-filter.js +0 -1
  221. package/lib-esm/hooks/search-params.js +9 -17
  222. package/lib-esm/layout/box/box.js +0 -6
  223. package/lib-esm/layout/flex-stack/flex-stack.js +0 -1
  224. package/lib-esm/layout/footer/footer.js +1 -4
  225. package/lib-esm/layout/header/header.js +0 -3
  226. package/lib-esm/layout/separator.js +1 -2
  227. package/lib-esm/layout/stack/stack.js +0 -1
  228. package/lib-esm/prototypes/typography.stories.js +4 -4
  229. package/lib-esm/query-state.js +2 -5
  230. package/lib-esm/stories/wrapper.js +0 -1
  231. package/lib-esm/ui/container/container.js +0 -2
  232. package/lib-esm/ui/dropdown/dropdown.js +0 -5
  233. package/lib-esm/ui/file-name/file-name.js +0 -2
  234. package/lib-esm/ui/filters/filters.js +4 -14
  235. package/lib-esm/ui/filters/filters.stories.js +5 -4
  236. package/lib-esm/ui/filters/filters.utils.js +9 -15
  237. package/lib-esm/ui/filters/index.js +4 -10
  238. package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.js +0 -12
  239. package/lib-esm/ui/hover-card/hover-card.js +2 -12
  240. package/lib-esm/ui/hover-card/hover-card.stories.js +0 -3
  241. package/lib-esm/ui/icon/icon.js +0 -1
  242. package/lib-esm/ui/icon/icon.stories.js +0 -2
  243. package/lib-esm/ui/input/input.js +0 -1
  244. package/lib-esm/ui/loader/loader.js +0 -2
  245. package/lib-esm/ui/logo/logo.js +0 -11
  246. package/lib-esm/ui/logo/logo.stories.js +1 -5
  247. package/lib-esm/ui/panels/panels.js +2 -5
  248. package/lib-esm/ui/skeleton/skeleton.js +0 -1
  249. package/lib-esm/ui/sort-dropdown/sort-dropdown.js +0 -8
  250. package/lib-esm/ui/sort-dropdown/sort-dropdown.stories.js +1 -0
  251. package/lib-esm/ui/table/table.js +0 -2
  252. package/lib-esm/ui/tabs/tabs.js +0 -4
  253. package/lib-esm/ui/tabs/tabs.module.css +6 -2
  254. package/lib-esm/ui/tag/tag.js +0 -1
  255. package/lib-esm/ui/tooltip/tooltip.js +1 -2
  256. package/lib-esm/ui/tooltip/tooltip.stories.js +0 -2
  257. package/lib-esm/utils.js +2 -9
  258. package/package.json +15 -15
  259. package/src/components/duplicate-packages-warning/duplicate-packages-warning.module.css +1 -0
  260. package/src/components/summary/summary.module.css +4 -1
  261. package/src/components/summary-item/summary-item.jsx +11 -7
  262. package/src/components/summary-item/summary-item.module.css +10 -4
  263. package/src/css/default.css +4 -1
  264. package/src/css/variables.css +5 -4
  265. package/src/ui/tabs/tabs.module.css +6 -2
@@ -1,16 +1,16 @@
1
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
-
3
2
  import React, { useCallback } from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import cx from 'classnames';
6
5
  import { getGlobalMetricType, getMetricRunInfo } from '@bundle-stats/utils';
6
+ import { Icon } from '../../ui/icon';
7
7
  import { HoverCard } from '../../ui/hover-card';
8
8
  import { Skeleton } from '../../ui/skeleton';
9
+ import { FlexStack } from '../../layout/flex-stack';
9
10
  import { Stack } from '../../layout/stack';
10
11
  import { Metric } from '../metric';
11
12
  import { Delta } from '../delta';
12
13
  import css from './summary-item.module.css';
13
-
14
14
  const MetricInfo = _ref => {
15
15
  let {
16
16
  description,
@@ -31,7 +31,6 @@ const MetricInfo = _ref => {
31
31
  className: css.readMoreLink
32
32
  }, "Read more")));
33
33
  };
34
-
35
34
  MetricInfo.propTypes = {
36
35
  description: PropTypes.string.isRequired,
37
36
  url: PropTypes.string
@@ -63,14 +62,19 @@ export const SummaryItem = _ref2 => {
63
62
  const showMetricDescriptionTooltip = showMetricDescription && (metric == null ? void 0 : metric.description);
64
63
  const rootClassName = cx(css.root, className, css[size], showDelta && css.showDelta);
65
64
  return /*#__PURE__*/React.createElement(Stack, _extends({
66
- space: "xxxsmall",
65
+ space: "xxsmall",
67
66
  as: Component,
68
67
  className: rootClassName
69
- }, props), /*#__PURE__*/React.createElement("h3", {
68
+ }, props), /*#__PURE__*/React.createElement(FlexStack, {
69
+ space: "xxxsmall",
70
+ as: "h3",
70
71
  className: css.title
71
- }, showMetricDescriptionTooltip ? /*#__PURE__*/React.createElement(HoverCard, {
72
- label: metric.label
73
- }, /*#__PURE__*/React.createElement(MetricInfo, metric)) : metric.label), !loading ? /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Metric, {
72
+ }, /*#__PURE__*/React.createElement("span", null, metric.label), showMetricDescriptionTooltip && /*#__PURE__*/React.createElement(HoverCard, {
73
+ label: /*#__PURE__*/React.createElement(Icon, {
74
+ glyph: Icon.ICONS.HELP
75
+ }),
76
+ className: css.titleIcon
77
+ }, /*#__PURE__*/React.createElement(MetricInfo, metric))), !loading ? /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Metric, {
74
78
  className: css.currentMetric,
75
79
  value: current,
76
80
  formatter: metric.formatter,
@@ -104,26 +108,20 @@ SummaryItem.defaultProps = {
104
108
  SummaryItem.propTypes = {
105
109
  /** Adopted child class name */
106
110
  className: PropTypes.string,
107
-
108
111
  /** Custom component */
109
112
  as: PropTypes.elementType,
110
-
111
113
  /** Size modifier */
112
114
  size: PropTypes.oneOf(['medium', 'large']),
113
-
114
115
  /** Metric id */
115
116
  id: PropTypes.string.isRequired,
116
-
117
117
  /** Loading flag */
118
118
  loading: PropTypes.bool,
119
-
120
119
  /** Summary data */
121
120
  data: PropTypes.object,
122
121
  // eslint-disable-line react/forbid-prop-types
123
122
 
124
123
  /** Show description */
125
124
  showMetricDescription: PropTypes.bool,
126
-
127
125
  /** Show delta */
128
126
  showDelta: PropTypes.bool
129
127
  };
@@ -2,14 +2,19 @@
2
2
  color: var(--color-text-ultra-light);
3
3
  font-weight: bold;
4
4
  font-size: var(--size-xsmall);
5
- line-height: 1;
6
5
  text-transform: uppercase;
7
6
  white-space: nowrap;
7
+ align-items: center;
8
+ }
9
+
10
+ .titleIcon {
11
+ opacity: 0;
12
+ pointer-events: none;
8
13
  }
9
14
 
10
15
  .currentMetric {
11
16
  color: var(--color-heading);
12
- font-size: var(--size-xlarge);
17
+ font-size: var(--size-large);
13
18
  white-space: nowrap;
14
19
  font-weight: bold;
15
20
  }
@@ -38,8 +43,9 @@
38
43
  }
39
44
 
40
45
  /* Hover state */
41
- .root:hover .title {
42
- color: var(--color-text-light);
46
+ .root:hover .titleIcon {
47
+ opacity: 1;
48
+ pointer-events: auto;
43
49
  }
44
50
 
45
51
 
@@ -22,7 +22,8 @@ export const SECTION_URLS = {
22
22
  [SECTIONS.MODULES]: URLS.MODULES,
23
23
  [SECTIONS.PACKAGES]: URLS.PACKAGES
24
24
  };
25
- export const ASSETS_SIZES_FILE_TYPE_MAP = FILE_TYPES.reduce((agg, fileType) => ({ ...agg,
25
+ export const ASSETS_SIZES_FILE_TYPE_MAP = FILE_TYPES.reduce((agg, fileType) => ({
26
+ ...agg,
26
27
  [`webpack.sizes.totalSizeByType${fileType}`]: fileType
27
28
  }), {});
28
29
  export const METRICS_WEBPACK_GENERAL = ['webpack.totalSizeByTypeALL', 'webpack.totalInitialSizeJS', 'webpack.totalInitialSizeCSS', 'webpack.cacheInvalidation'];
@@ -26,6 +26,7 @@ body {
26
26
  h1, h2, h3, h4, h5, h6 {
27
27
  color: var(--color-heading);
28
28
  font-weight: 500;
29
+ line-height: var(--line-height-heading);
29
30
  }
30
31
 
31
32
  h1 {
@@ -63,8 +64,10 @@ a {
63
64
  }
64
65
 
65
66
  a:hover,
66
- a:active {
67
+ a:active,
68
+ a:focus {
67
69
  color: var(--color-primary-dark);
70
+ outline: none;
68
71
  }
69
72
 
70
73
  .ui-button--primary {
@@ -24,13 +24,14 @@
24
24
  --size-xxxlarge: 1.602rem;
25
25
 
26
26
  --line-height: 1.66em;
27
+ --line-height-heading: 1.33em;
27
28
 
28
29
  /*
29
30
  * Color scheme:
30
31
  * https://coolors.co/287acc-da444e-55b950-f6e179-192339
31
32
  * http://mcg.mbitson.com/#!?mcgpalette0=%23da444e&mcgpalette1=%2355b950&mcgpalette2=%23f6e179&mcgpalette3=%23505861&mcgpalette4=%23287acc&themename=mcgtheme
32
33
  */
33
- --color-gray-25: #f3f3f4;
34
+ --color-gray-25: #F7F7F7;
34
35
  --color-gray-50 : #eaebec;
35
36
  --color-gray-100: #cbcdd0;
36
37
  --color-gray-200: #a8acb0;
@@ -182,9 +183,9 @@
182
183
  --layer-high: 1000;
183
184
  --layer-xhigh: 10000;
184
185
 
185
- --radius-small: 3px;
186
- --radius-medium: var(--space-xxxsmall);
187
- --radius-large: var(--space-xxsmall);
186
+ --radius-small: 2px;
187
+ --radius-medium: 3px;
188
+ --radius-large: 5px;
188
189
 
189
190
  /** Layout */
190
191
  --max-width: 80rem;
@@ -12,7 +12,6 @@ export const useRowsFilter = _ref => {
12
12
  if (searchPattern && !searchPattern.test(row == null ? void 0 : row.key)) {
13
13
  return false;
14
14
  }
15
-
16
15
  return filterRow(row);
17
16
  });
18
17
  }, [rows, searchPattern, filters, getRowFilter]);
@@ -8,14 +8,11 @@ const ACTION_RESET_ALL = 'RESET_ALL';
8
8
  const ACTION_SET = 'SET';
9
9
  const SEARCH_DEFAULT = '';
10
10
  const SEARCH_DEFAULT_PATTERN = /.*/;
11
-
12
11
  const getSearchPattern = search => {
13
12
  let searchPattern = SEARCH_DEFAULT_PATTERN;
14
-
15
13
  if (!search || !search.trim()) {
16
14
  return searchPattern;
17
15
  }
18
-
19
16
  try {
20
17
  searchPattern = new RegExp(search, 'i');
21
18
  } catch (err) {
@@ -25,7 +22,6 @@ const getSearchPattern = search => {
25
22
 
26
23
  return searchPattern;
27
24
  };
28
-
29
25
  const getSearchReducer = _ref => {
30
26
  let {
31
27
  defaultFilters,
@@ -37,7 +33,6 @@ const getSearchReducer = _ref => {
37
33
  type,
38
34
  payload
39
35
  } = action;
40
-
41
36
  switch (type) {
42
37
  case ACTION_SET_FILTERS:
43
38
  {
@@ -48,7 +43,6 @@ const getSearchReducer = _ref => {
48
43
  setParentState(newState);
49
44
  return newState;
50
45
  }
51
-
52
46
  case ACTION_SET_SEARCH:
53
47
  {
54
48
  const newState = {
@@ -56,11 +50,11 @@ const getSearchReducer = _ref => {
56
50
  search: payload
57
51
  };
58
52
  setParentState(newState);
59
- return { ...newState,
53
+ return {
54
+ ...newState,
60
55
  searchPattern: getSearchPattern(payload)
61
56
  };
62
57
  }
63
-
64
58
  case ACTION_RESET_DEFAULT:
65
59
  {
66
60
  const newState = {
@@ -68,11 +62,11 @@ const getSearchReducer = _ref => {
68
62
  search: SEARCH_DEFAULT
69
63
  };
70
64
  setParentState(newState);
71
- return { ...newState,
65
+ return {
66
+ ...newState,
72
67
  searchPattern: getSearchPattern()
73
68
  };
74
69
  }
75
-
76
70
  case ACTION_RESET_ALL:
77
71
  {
78
72
  const newState = {
@@ -80,22 +74,20 @@ const getSearchReducer = _ref => {
80
74
  search: SEARCH_DEFAULT
81
75
  };
82
76
  setParentState(newState);
83
- return { ...newState,
77
+ return {
78
+ ...newState,
84
79
  searchPattern: getSearchPattern()
85
80
  };
86
81
  }
87
-
88
82
  case ACTION_SET:
89
83
  {
90
84
  return payload;
91
85
  }
92
-
93
86
  default:
94
87
  return state;
95
88
  }
96
89
  };
97
90
  };
98
-
99
91
  export const generateState = (filters, search) => ({
100
92
  filters,
101
93
  search,
@@ -119,21 +111,21 @@ export const useSearchParams = _ref2 => {
119
111
  defaultFilters,
120
112
  allEntriesFilters,
121
113
  setParentState
122
- }), generateState(initialFilters, parentSearch)); // Update state when the custom filters/search are changing - initial load or route updates
114
+ }), generateState(initialFilters, parentSearch));
123
115
 
116
+ // Update state when the custom filters/search are changing - initial load or route updates
124
117
  useLayoutEffect(() => {
125
118
  // Run a deep comparison to prevent circular setState triggering
126
119
  if (parentSearch === search && _isEqual(initialFilters, filters)) {
127
120
  return;
128
121
  }
129
-
130
122
  dispatch({
131
123
  type: ACTION_SET,
132
124
  payload: generateState(initialFilters, parentSearch)
133
125
  });
134
126
  }, [dispatch, search, filters, parentSearch, initialFilters]);
135
- /** Callbacks */
136
127
 
128
+ /** Callbacks */
137
129
  const handleUpdateSearch = useCallback(newValue => {
138
130
  dispatch({
139
131
  type: ACTION_SET_SEARCH,
@@ -1,5 +1,4 @@
1
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
-
3
2
  import React from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import cx from 'classnames';
@@ -32,19 +31,14 @@ Box.defaultProps = {
32
31
  Box.propTypes = {
33
32
  /** Adopted child class name */
34
33
  className: PropTypes.string,
35
-
36
34
  /** Rendered component */
37
35
  as: PropTypes.elementType,
38
-
39
36
  /** Padding space size */
40
37
  padding: PropTypes.oneOfType([PropTypes.oneOf(SPACES), PropTypes.arrayOf(PropTypes.oneOf(SPACES))]),
41
-
42
38
  /** Horizonatl padding space size */
43
39
  horizontalPadding: PropTypes.oneOf(SPACES),
44
-
45
40
  /** Vertical padding space size */
46
41
  verticalPadding: PropTypes.oneOf(SPACES),
47
-
48
42
  /** Outline flag */
49
43
  outline: PropTypes.bool
50
44
  };
@@ -1,5 +1,4 @@
1
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
-
3
2
  import React from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import cx from 'classnames';
@@ -1,5 +1,4 @@
1
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
-
3
2
  import React from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import cx from 'classnames';
@@ -8,15 +7,14 @@ import { Container } from '../../ui/container';
8
7
  import { Box } from '../box';
9
8
  import { Stack } from '../stack';
10
9
  import css from './footer.module.css';
11
- /* eslint-disable jsx-a11y/anchor-has-content */
12
10
 
11
+ /* eslint-disable jsx-a11y/anchor-has-content */
13
12
  const ExternalLink = props => /*#__PURE__*/React.createElement("a", _extends({
14
13
  target: "_blank",
15
14
  rel: "noopener noreferrer"
16
15
  }, props));
17
16
  /* eslint-enable jsx-a11y/anchor-has-content */
18
17
 
19
-
20
18
  ExternalLink.propTypes = {
21
19
  /** Link to value */
22
20
  to: PropTypes.string.isRequired
@@ -61,7 +59,6 @@ Footer.defaultProps = {
61
59
  Footer.propTypes = {
62
60
  /** Adopted child class name */
63
61
  className: PropTypes.string,
64
-
65
62
  /** Content */
66
63
  version: PropTypes.string
67
64
  };
@@ -28,13 +28,10 @@ Header.defaultProps = {
28
28
  Header.propTypes = {
29
29
  /* Adopted child class name */
30
30
  className: PropTypes.string,
31
-
32
31
  /* Render left area */
33
32
  renderLeft: PropTypes.func,
34
-
35
33
  /* Render center area */
36
34
  render: PropTypes.func,
37
-
38
35
  /* Render right area */
39
36
  renderRight: PropTypes.func
40
37
  };
@@ -1,5 +1,4 @@
1
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
-
3
2
  import React from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import cx from 'classnames';
@@ -10,11 +9,11 @@ const propTypes = {
10
9
  const defaultProps = {
11
10
  className: ''
12
11
  };
12
+
13
13
  /**
14
14
  * @param {PropTypes.InferProps<typeof propTypes>} props
15
15
  * @return {React.FunctionComponentElement}
16
16
  */
17
-
18
17
  export const Separator = props => {
19
18
  const {
20
19
  className,
@@ -1,5 +1,4 @@
1
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
-
3
2
  import React from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import cx from 'classnames';
@@ -25,8 +25,9 @@ stories.add('typography', () => /*#__PURE__*/React.createElement(React.Fragment,
25
25
  dangerouslySetInnerHTML: {
26
26
  __html: content
27
27
  }
28
- })))); // eslint-disable-next-line react/prop-types
28
+ }))));
29
29
 
30
+ // eslint-disable-next-line react/prop-types
30
31
  const Item = _ref => {
31
32
  let {
32
33
  colorName,
@@ -41,9 +42,9 @@ const Item = _ref => {
41
42
  flex: '1 1 20%'
42
43
  }
43
44
  }, `${colorName} ${valueName}`);
44
- }; // eslint-disable-next-line react/prop-types
45
-
45
+ };
46
46
 
47
+ // eslint-disable-next-line react/prop-types
47
48
  const ItemColorValue = _ref2 => {
48
49
  let {
49
50
  value
@@ -57,7 +58,6 @@ const ItemColorValue = _ref2 => {
57
58
  }
58
59
  }, value);
59
60
  };
60
-
61
61
  const COLORS = ['blue', 'red', 'green', 'yellow', 'gray'];
62
62
  const NAMES = ['ultra-light', 'light', 'normal', 'dark', 'ultra-dark'];
63
63
  stories.add('color sheme', () => /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Item, {
@@ -1,8 +1,6 @@
1
1
  import _merge from "lodash/merge";
2
2
  import _isEqual from "lodash/isEqual";
3
-
4
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
5
-
6
4
  import React, { useCallback } from 'react';
7
5
  import { JsonParam, QueryParamProvider, useQueryParams } from 'use-query-params';
8
6
  import { ReactRouter5Adapter } from 'use-query-params/adapters/react-router-5';
@@ -20,13 +18,12 @@ export const useComponentQueryState = componentName => {
20
18
  });
21
19
  const state = search[componentName];
22
20
  const setState = useCallback(newState => {
23
- const newComponentState = _merge({}, state, newState); // Deep check to prevent unnecessary state changes
24
-
21
+ const newComponentState = _merge({}, state, newState);
25
22
 
23
+ // Deep check to prevent unnecessary state changes
26
24
  if (_isEqual(newComponentState, state)) {
27
25
  return;
28
26
  }
29
-
30
27
  setSearch({
31
28
  [componentName]: newComponentState
32
29
  });
@@ -4,7 +4,6 @@ export const getWrapperDecorator = function (customWrapperStyles) {
4
4
  if (customWrapperStyles === void 0) {
5
5
  customWrapperStyles = {};
6
6
  }
7
-
8
7
  return storyFn => {
9
8
  const wrapperStyles = {
10
9
  width: '100%',
@@ -1,5 +1,4 @@
1
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
-
3
2
  import React from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import cx from 'classnames';
@@ -23,7 +22,6 @@ Container.defaultProps = {
23
22
  Container.propTypes = {
24
23
  /** Adopted child class name */
25
24
  className: PropTypes.string,
26
-
27
25
  /** Custom component */
28
26
  as: PropTypes.elementType
29
27
  };
@@ -51,19 +51,14 @@ Dropdown.defaultProps = {
51
51
  Dropdown.propTypes = {
52
52
  /** Adopted child class name */
53
53
  className: PropTypes.string,
54
-
55
54
  /** Button adopted child class name */
56
55
  buttonClassName: PropTypes.string,
57
-
58
56
  /** Button label */
59
57
  label: PropTypes.node,
60
-
61
58
  /** Aria label */
62
59
  ariaLabel: PropTypes.string,
63
-
64
60
  /** Icon glyph */
65
61
  glyph: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
66
-
67
62
  /** Content */
68
63
  children: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]).isRequired
69
64
  };
@@ -20,10 +20,8 @@ FileName.defaultProps = {
20
20
  FileName.propTypes = {
21
21
  /** Adopted child class name */
22
22
  className: PropTypes.string,
23
-
24
23
  /** Element type */
25
24
  as: PropTypes.elementType,
26
-
27
25
  /** File name source */
28
26
  name: PropTypes.string
29
27
  };
@@ -1,5 +1,4 @@
1
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
-
3
2
  import React, { useCallback } from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import cx from 'classnames';
@@ -7,7 +6,6 @@ import { FlexStack } from '../../layout/flex-stack';
7
6
  import { Dropdown } from '../dropdown';
8
7
  import { getGroupFiltersLabelSuffix, LABELS } from './filters.utils';
9
8
  import css from './filters.module.css';
10
-
11
9
  const Filter = props => {
12
10
  const {
13
11
  className,
@@ -40,7 +38,6 @@ const Filter = props => {
40
38
  onClick: getOnOnlyClick(name)
41
39
  }, "only"));
42
40
  };
43
-
44
41
  Filter.propTypes = {
45
42
  className: PropTypes.string,
46
43
  as: PropTypes.elementType,
@@ -55,7 +52,6 @@ Filter.defaultProps = {
55
52
  buttonClassName: '',
56
53
  getOnOnlyClick: null
57
54
  };
58
-
59
55
  const FilterGroup = props => {
60
56
  const {
61
57
  className,
@@ -84,25 +80,24 @@ const FilterGroup = props => {
84
80
  const dropdownLabel = /*#__PURE__*/React.createElement(React.Fragment, null, `${groupLabel}:`, "\xA0", /*#__PURE__*/React.createElement("span", {
85
81
  className: cx(hasCustomFilterSuffix && css.labelSuffixCustom)
86
82
  }, filterSuffix));
87
-
88
83
  const getOnGroupCheck = function (value, overrides) {
89
84
  if (overrides === void 0) {
90
85
  overrides = {};
91
86
  }
92
-
93
87
  return () => {
94
88
  const newFilters = groupCheckboxes.reduce((agg, _ref3) => {
95
89
  let [itemKey] = _ref3;
96
- return { ...agg,
90
+ return {
91
+ ...agg,
97
92
  [`${groupKey}.${itemKey}`]: value
98
93
  };
99
94
  }, {});
100
- toggleFilters({ ...newFilters,
95
+ toggleFilters({
96
+ ...newFilters,
101
97
  ...overrides
102
98
  });
103
99
  };
104
100
  };
105
-
106
101
  return /*#__PURE__*/React.createElement(Dropdown, {
107
102
  className: className,
108
103
  buttonClassName: buttonClassName,
@@ -119,11 +114,9 @@ const FilterGroup = props => {
119
114
  }, groupItems.map(_ref5 => {
120
115
  let [itemKey, itemData] = _ref5;
121
116
  const id = [groupKey, itemKey].join('.');
122
-
123
117
  const getOnOnlyClick = () => getOnGroupCheck(false, {
124
118
  [id]: true
125
119
  });
126
-
127
120
  return /*#__PURE__*/React.createElement(Filter, {
128
121
  key: id,
129
122
  className: menuItemClassName,
@@ -152,7 +145,6 @@ const FilterGroup = props => {
152
145
  }, "Check all")));
153
146
  });
154
147
  };
155
-
156
148
  FilterGroup.propTypes = {
157
149
  className: PropTypes.string,
158
150
  buttonClassName: PropTypes.string,
@@ -190,7 +182,6 @@ export const Filters = props => {
190
182
  className: css.items
191
183
  }, Object.entries(filters).map(_ref6 => {
192
184
  let [name, data] = _ref6;
193
-
194
185
  if (typeof (data == null ? void 0 : data.defaultValue) !== 'undefined') {
195
186
  return /*#__PURE__*/React.createElement(Filter, {
196
187
  key: name,
@@ -203,7 +194,6 @@ export const Filters = props => {
203
194
  disabled: data.disabled
204
195
  });
205
196
  }
206
-
207
197
  return /*#__PURE__*/React.createElement(FilterGroup, {
208
198
  className: css.item,
209
199
  buttonClassName: css.itemButton,
@@ -7,7 +7,6 @@ const stories = storiesOf('UI/Filters', module);
7
7
  stories.addDecorator(getWrapperDecorator({
8
8
  paddingLeft: '200px'
9
9
  }));
10
-
11
10
  const FiltersState = _ref => {
12
11
  let {
13
12
  children
@@ -17,14 +16,14 @@ const FiltersState = _ref => {
17
16
  'assetType.entrypoint': true
18
17
  });
19
18
  const handleSetValues = useCallback(newValues => {
20
- setValues({ ...values,
19
+ setValues({
20
+ ...values,
21
21
  ...newValues
22
22
  });
23
23
  console.info(newValues);
24
24
  }, [values]);
25
25
  return children(values, handleSetValues);
26
26
  };
27
-
28
27
  stories.add('default', () => /*#__PURE__*/React.createElement(FiltersState, null, (values, setValues) => /*#__PURE__*/React.createElement(Filters, {
29
28
  onChange: setValues,
30
29
  filters: {
@@ -62,7 +61,8 @@ stories.add('overflow', () => /*#__PURE__*/React.createElement(FiltersState, nul
62
61
  },
63
62
  chunks: {
64
63
  label: 'Chunks',
65
- ...Array(22).fill('').reduce((agg, value, currentIndex) => ({ ...agg,
64
+ ...Array(22).fill('').reduce((agg, value, currentIndex) => ({
65
+ ...agg,
66
66
  [`chunk-${currentIndex}`]: {
67
67
  label: `Chunk ${currentIndex + 1}`,
68
68
  defaultValue: _get(values, `chunks.chunk-${currentIndex}`)
@@ -75,6 +75,7 @@ stories.add('disable options', () => /*#__PURE__*/React.createElement(Filters, {
75
75
  onChange: state => {
76
76
  console.log(state); // eslint-disable-line no-console
77
77
  },
78
+
78
79
  filters: {
79
80
  changed: {
80
81
  label: 'Changed',