@bundle-stats/ui 3.2.1 → 3.3.0-alpha.1

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 (121) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/lib/app/app.js +31 -6
  3. package/lib/app/app.stories.js +31 -3
  4. package/lib/assets/icons/alert-circle.svg +1 -0
  5. package/lib/assets/icons/arrow-right-circle.svg +1 -0
  6. package/lib/assets/icons/check-circle.svg +1 -0
  7. package/lib/assets/icons/close.svg +1 -1
  8. package/lib/assets/icons.svg +50 -1
  9. package/lib/components/browsertime-table/browsertime-table.js +1 -1
  10. package/lib/components/browsertime-table/browsertime-table.stories.js +1 -1
  11. package/lib/components/budget-info/budget-info.js +80 -0
  12. package/lib/components/budget-info/budget-info.module.css +40 -0
  13. package/lib/components/budget-info/budget-info.stories.js +44 -0
  14. package/lib/components/budget-info/index.js +18 -0
  15. package/lib/components/budget-insights/budget-insights.js +200 -0
  16. package/lib/components/budget-insights/budget-insights.module.css +53 -0
  17. package/lib/components/budget-insights/budget-insights.stories.js +104 -0
  18. package/lib/components/budget-insights/index.js +18 -0
  19. package/lib/components/bundle-assets/bundle-assets.js +3 -3
  20. package/lib/components/bundle-assets/bundle-assets.utils.js +2 -2
  21. package/lib/components/bundle-assets/index.js +3 -3
  22. package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +1 -1
  23. package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.js +44 -8
  24. package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
  25. package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +58 -43
  26. package/lib/components/bundle-modules/bundle-modules.js +3 -3
  27. package/lib/components/bundle-modules/bundle-modules.utils.js +2 -2
  28. package/lib/components/bundle-modules/index.js +3 -3
  29. package/lib/components/bundle-packages/bundle-packages.js +1 -1
  30. package/lib/components/bundle-packages/bundle-packages.utils.js +2 -2
  31. package/lib/components/bundle-packages/index.js +1 -1
  32. package/lib/components/index.js +8 -0
  33. package/lib/components/lighthouse-table/lighthouse-table.js +1 -1
  34. package/lib/components/metrics-table/metrics-table.js +1 -1
  35. package/lib/components/metrics-table-search/metrics-table-search.js +1 -1
  36. package/lib/components/metrics-table-search/metrics-table-search.stories.js +1 -1
  37. package/lib/components/summary/summary.js +40 -62
  38. package/lib/components/summary/summary.module.css +31 -14
  39. package/lib/components/summary/summary.stories.js +29 -0
  40. package/lib/components/summary-item/summary-item.js +30 -13
  41. package/lib/components/summary-item/summary-item.module.css +18 -9
  42. package/lib/components/summary-item/summary-item.stories.js +67 -52
  43. package/lib/constants.js +6 -6
  44. package/lib/css/variables.css +15 -11
  45. package/lib/hooks/search-params.js +2 -2
  46. package/lib/query-state.js +1 -1
  47. package/lib/stories/wrapper.js +2 -2
  48. package/lib/ui/alert/alert.js +13 -3
  49. package/lib/ui/filters/filters.container.js +5 -5
  50. package/lib/ui/filters/filters.js +2 -2
  51. package/lib/ui/filters/filters.stories.js +3 -3
  52. package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.js +3 -3
  53. package/lib/ui/icon/icon.js +3 -0
  54. package/lib/ui/icon/icon.stories.js +40 -22
  55. package/lib/ui/panels/panels.js +2 -2
  56. package/lib/ui/popover/popover.js +3 -3
  57. package/lib/ui/popover/popover.module.css +2 -1
  58. package/lib/ui/tabs/tabs.js +2 -2
  59. package/lib/ui/tooltip/tooltip.module.css +1 -0
  60. package/lib/utils.js +2 -2
  61. package/lib-esm/app/app.js +57 -31
  62. package/lib-esm/app/app.stories.js +29 -1
  63. package/lib-esm/assets/icons/alert-circle.svg +1 -0
  64. package/lib-esm/assets/icons/arrow-right-circle.svg +1 -0
  65. package/lib-esm/assets/icons/check-circle.svg +1 -0
  66. package/lib-esm/assets/icons/close.svg +1 -1
  67. package/lib-esm/assets/icons.svg +50 -1
  68. package/lib-esm/components/budget-info/budget-info.js +58 -0
  69. package/lib-esm/components/budget-info/budget-info.module.css +40 -0
  70. package/lib-esm/components/budget-info/budget-info.stories.js +30 -0
  71. package/lib-esm/components/budget-info/index.js +1 -0
  72. package/lib-esm/components/budget-insights/budget-insights.js +148 -0
  73. package/lib-esm/components/budget-insights/budget-insights.module.css +53 -0
  74. package/lib-esm/components/budget-insights/budget-insights.stories.js +84 -0
  75. package/lib-esm/components/budget-insights/index.js +1 -0
  76. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +23 -7
  77. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
  78. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +46 -21
  79. package/lib-esm/components/index.js +1 -0
  80. package/lib-esm/components/summary/summary.js +26 -45
  81. package/lib-esm/components/summary/summary.module.css +31 -14
  82. package/lib-esm/components/summary/summary.stories.js +27 -0
  83. package/lib-esm/components/summary-item/summary-item.js +28 -12
  84. package/lib-esm/components/summary-item/summary-item.module.css +18 -9
  85. package/lib-esm/components/summary-item/summary-item.stories.js +52 -42
  86. package/lib-esm/constants.js +4 -4
  87. package/lib-esm/css/variables.css +15 -11
  88. package/lib-esm/ui/alert/alert.js +6 -3
  89. package/lib-esm/ui/filters/filters.container.js +39 -41
  90. package/lib-esm/ui/icon/icon.js +3 -0
  91. package/lib-esm/ui/icon/icon.stories.js +22 -11
  92. package/lib-esm/ui/popover/popover.js +2 -2
  93. package/lib-esm/ui/popover/popover.module.css +2 -1
  94. package/lib-esm/ui/tooltip/tooltip.module.css +1 -0
  95. package/package.json +15 -15
  96. package/src/app/app.jsx +24 -8
  97. package/src/assets/icons/alert-circle.svg +1 -0
  98. package/src/assets/icons/arrow-right-circle.svg +1 -0
  99. package/src/assets/icons/check-circle.svg +1 -0
  100. package/src/assets/icons/close.svg +1 -1
  101. package/src/assets/icons.svg +50 -1
  102. package/src/components/budget-info/budget-info.jsx +65 -0
  103. package/src/components/budget-info/budget-info.module.css +40 -0
  104. package/src/components/budget-info/index.js +1 -0
  105. package/src/components/budget-insights/budget-insights.jsx +157 -0
  106. package/src/components/budget-insights/budget-insights.module.css +53 -0
  107. package/src/components/budget-insights/index.js +1 -0
  108. package/src/components/bundle-assets-totals-table/bundle-assets-totals-table.jsx +27 -13
  109. package/src/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +2 -2
  110. package/src/components/index.js +1 -0
  111. package/src/components/summary/summary.jsx +26 -44
  112. package/src/components/summary/summary.module.css +31 -14
  113. package/src/components/summary-item/summary-item.jsx +26 -24
  114. package/src/components/summary-item/summary-item.module.css +18 -9
  115. package/src/constants.js +7 -7
  116. package/src/css/variables.css +15 -11
  117. package/src/ui/alert/alert.jsx +7 -2
  118. package/src/ui/icon/icon.jsx +3 -0
  119. package/src/ui/popover/popover.jsx +3 -3
  120. package/src/ui/popover/popover.module.css +2 -1
  121. package/src/ui/tooltip/tooltip.module.css +1 -0
@@ -5,62 +5,47 @@ 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';
11
12
  import { SummaryItem } from '../summary-item';
12
13
  import css from './summary.module.css';
13
14
 
14
- const CustomSummaryItem = ({ className, metricOptions, SummaryItemCustomLink, ...props }) => (
15
- <Box
16
- padding={['xsmall', 'small']}
17
- className={cx(className, css.summaryItemLink)}
18
- {...props}
19
- as={SummaryItemCustomLink}
20
- {...metricOptions.link}
21
- />
22
- );
23
-
24
- CustomSummaryItem.propTypes = {
25
- className: PropTypes.string,
26
- metricOptions: PropTypes.shape({
27
- link: PropTypes.any, // eslint-disable-line react/forbid-prop-types
28
- }).isRequired,
29
- SummaryItemCustomLink: PropTypes.elementType.isRequired,
30
- };
31
-
32
- CustomSummaryItem.defaultProps = {
33
- className: '',
34
- };
15
+ const getSourceMetricId = (fullMetricId) => fullMetricId.split('.').slice(1).join('.');
35
16
 
36
17
  export const Summary = ({
37
18
  className,
38
19
  size,
39
20
  keys,
40
21
  data,
22
+ budgets,
41
23
  loading,
42
24
  showSummaryItemDelta,
43
25
  summaryItemLink: SummaryItemCustomLink,
44
26
  }) => (
45
27
  <Box outline className={cx(css.root, className)}>
46
28
  <FlexStack className={css.items}>
47
- {Array.from(METRIC_COMPONENT_LINKS).filter(([metricId]) => keys.includes(metricId)).map(
48
- ([metricId, metricOptions]) => (
49
- <SummaryItem
50
- as={CustomSummaryItem}
51
- className={css.item}
52
- metricOptions={metricOptions}
53
- SummaryItemCustomLink={SummaryItemCustomLink}
54
- size={size}
55
- key={metricId}
56
- id={metricId}
57
- data={get(data, metricId)}
58
- loading={loading}
59
- showMetricDescription
60
- showDelta={showSummaryItemDelta && metricOptions.showDelta !== false}
61
- />
62
- )
63
- )}
29
+ {Array.from(METRIC_COMPONENT_LINKS)
30
+ .filter(([metricId]) => keys.includes(getSourceMetricId(metricId)))
31
+ .map(([metricId, metricOptions]) => (
32
+ <div key={metricId} className={css.item}>
33
+ <SummaryItem
34
+ size={size}
35
+ id={metricId}
36
+ data={get(data, metricId)}
37
+ budget={get(budgets, metricId)}
38
+ loading={loading}
39
+ showMetricDescription
40
+ showDelta={showSummaryItemDelta && metricOptions.showDelta !== false}
41
+ />
42
+ {!loading && (
43
+ <SummaryItemCustomLink {...metricOptions.link} className={css.readMore}>
44
+ <Icon className={css.readMoreIcon} glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE} />
45
+ </SummaryItemCustomLink>
46
+ )}
47
+ </div>
48
+ ))}
64
49
  </FlexStack>
65
50
  </Box>
66
51
  );
@@ -68,6 +53,7 @@ export const Summary = ({
68
53
  Summary.defaultProps = {
69
54
  className: '',
70
55
  data: null,
56
+ budgets: null,
71
57
  loading: false,
72
58
  size: '',
73
59
  keys: METRICS_WEBPACK_GENERAL,
@@ -79,12 +65,8 @@ Summary.propTypes = {
79
65
  className: PropTypes.string,
80
66
  size: PropTypes.string,
81
67
  keys: PropTypes.arrayOf(PropTypes.string),
82
- data: PropTypes.shape({
83
- [PropTypes.string]: PropTypes.shape({
84
- baseline: PropTypes.number,
85
- current: PropTypes.number,
86
- }),
87
- }),
68
+ data: PropTypes.object, // eslint-disable-line react/forbid-prop-types
69
+ budgets: PropTypes.object, // eslint-disable-line react/forbid-prop-types
88
70
  loading: PropTypes.bool,
89
71
  showSummaryItemDelta: PropTypes.bool,
90
72
  summaryItemLink: PropTypes.elementType,
@@ -3,35 +3,52 @@
3
3
  overflow: auto;
4
4
  }
5
5
 
6
- .items {}
7
-
8
6
  .item {
7
+ padding: 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
  }
@@ -9,9 +9,10 @@ import { Stack } from '../../layout/stack';
9
9
  import { FlexStack } from '../../layout/flex-stack';
10
10
  import { Metric } from '../metric';
11
11
  import { Delta } from '../delta';
12
+ import { BudgetInfo } from '../budget-info';
12
13
  import css from './summary-item.module.css';
13
14
 
14
- const MetricInfo = ({ description, url }) => {
15
+ const MetricInfoPopover = ({ description, url }) => {
15
16
  // Workaround cases where the parent is a link
16
17
  const readMoreOnClick = () => {
17
18
  window.open(url);
@@ -31,12 +32,12 @@ const MetricInfo = ({ description, url }) => {
31
32
  );
32
33
  };
33
34
 
34
- MetricInfo.propTypes = {
35
+ MetricInfoPopover.propTypes = {
35
36
  description: PropTypes.string.isRequired,
36
37
  url: PropTypes.string,
37
38
  };
38
39
 
39
- MetricInfo.defaultProps = {
40
+ MetricInfoPopover.defaultProps = {
40
41
  url: '',
41
42
  };
42
43
 
@@ -49,6 +50,7 @@ export const SummaryItem = ({
49
50
  loading,
50
51
  showDelta,
51
52
  showMetricDescription,
53
+ budget,
52
54
  ...props
53
55
  }) => {
54
56
  const { baseline, current } = data || { baseline: 0, current: 0 };
@@ -56,30 +58,24 @@ export const SummaryItem = ({
56
58
  const metric = getGlobalMetricType(id);
57
59
  const runInfo = getMetricRunInfo(metric, current, baseline);
58
60
  const showMetricDescriptionTooltip = showMetricDescription && metric?.description;
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
- );
61
+ const rootClassName = cx(css.root, className, css[size], showDelta && css.showDelta);
68
62
 
69
63
  return (
70
64
  <Stack space="xxsmall" as={Component} className={rootClassName} {...props}>
71
65
  <FlexStack as="h3" space="xxxsmall" className={css.title}>
72
- <span>{metric.label}</span>
66
+ <span className={css.titleLabel}>{metric.label}</span>
73
67
 
74
68
  {showMetricDescriptionTooltip && (
75
69
  <Popover className={css.icon} icon="help">
76
- <MetricInfo {...metric} />
70
+ <MetricInfoPopover {...metric} />
77
71
  </Popover>
78
72
  )}
73
+
74
+ {budget && <BudgetInfo className={css.budgetInfo} metricId={id} budgetInsight={budget} />}
79
75
  </FlexStack>
80
76
 
81
- <Stack>
82
- {!loading ? (
77
+ {!loading ? (
78
+ <Stack>
83
79
  <Metric
84
80
  className={css.currentMetric}
85
81
  value={current}
@@ -95,16 +91,14 @@ export const SummaryItem = ({
95
91
  />
96
92
  )}
97
93
  </Metric>
98
- ) : (
99
- <Skeleton className={cx(css.currentMetric, css.loading)} />
100
- )}
101
-
102
- {!loading ? (
103
94
  <Metric className={css.baselineMetric} value={baseline} formatter={metric.formatter} />
104
- ) : (
95
+ </Stack>
96
+ ) : (
97
+ <Stack>
98
+ <Skeleton className={cx(css.currentMetric, css.loading)} />
105
99
  <Skeleton className={cx(css.baselineMetric, css.loading)} />
106
- )}
107
- </Stack>
100
+ </Stack>
101
+ )}
108
102
  </Stack>
109
103
  );
110
104
  };
@@ -117,6 +111,7 @@ SummaryItem.defaultProps = {
117
111
  loading: false,
118
112
  showMetricDescription: false,
119
113
  showDelta: true,
114
+ budget: undefined,
120
115
  };
121
116
 
122
117
  SummaryItem.propTypes = {
@@ -143,4 +138,11 @@ SummaryItem.propTypes = {
143
138
 
144
139
  /** Show delta */
145
140
  showDelta: PropTypes.bool,
141
+
142
+ /** Budget insight data */
143
+ budget: PropTypes.shape({
144
+ currentBalue: PropTypes.number,
145
+ budgetValue: PropTypes.number,
146
+ failed: PropTypes.bool,
147
+ }),
146
148
  };
@@ -1,5 +1,9 @@
1
+ .root {
2
+ position: relative;
3
+ padding-right: var(--space-xlarge);
4
+ }
5
+
1
6
  .title {
2
- margin: 0;
3
7
  color: var(--color-text-ultra-light);
4
8
  font-weight: bold;
5
9
  font-size: var(--size-xsmall);
@@ -8,6 +12,10 @@
8
12
  white-space: nowrap;
9
13
  }
10
14
 
15
+ .titleLabel {
16
+ flex: 0 0 auto;
17
+ }
18
+
11
19
  .readMoreBtn {
12
20
  appearance: none;
13
21
  padding: 0;
@@ -27,24 +35,30 @@
27
35
  text-decoration: none;
28
36
  }
29
37
 
38
+ .budgetInfo {
39
+ position: absolute;
40
+ right: 0;
41
+ top: 0;
42
+ }
43
+
30
44
  .currentMetric {
31
45
  display: block;
32
46
  color: var(--color-heading);
33
47
  font-size: var(--size-large);
34
- line-height: 1.3;
48
+ line-height: var(--space-medium);
35
49
  white-space: nowrap;
36
50
  font-weight: bold;
37
51
  }
38
52
 
39
53
  .delta {
40
- margin: var(--space-xxxsmall) 0 0;
41
54
  font-size: var(--size-small);
55
+ line-height: var(--space-medium);
42
56
  }
43
57
 
44
58
  .baselineMetric {
45
59
  color: var(--color-text-light);
46
60
  font-size: var(--size-small);
47
- line-height: 1.3;
61
+ line-height: var(--space-small);
48
62
  }
49
63
 
50
64
  /* Loading state */
@@ -60,9 +74,4 @@
60
74
  .large .currentMetric {
61
75
  font-size: var(--size-xxxlarge);
62
76
  line-height: var(--space-medium);
63
- min-height: var(--space-medium);
64
- }
65
-
66
- .large .baselineMetric {
67
- font-size: var(--size-medium);
68
77
  }
package/src/constants.js CHANGED
@@ -47,11 +47,11 @@ export const ASSETS_SIZES_FILE_TYPE_MAP = FILE_TYPES.reduce(
47
47
  );
48
48
 
49
49
  export const METRICS_WEBPACK_GENERAL = [
50
- 'webpack.totalSizeByTypeALL',
51
- 'webpack.totalInitialSizeJS',
52
- 'webpack.totalInitialSizeCSS',
53
- 'webpack.cacheInvalidation',
50
+ 'totalSizeByTypeALL',
51
+ 'totalInitialSizeJS',
52
+ 'totalInitialSizeCSS',
53
+ 'cacheInvalidation',
54
54
  ];
55
- export const METRICS_WEBPACK_ASSETS = ['webpack.assetCount', 'webpack.chunkCount'];
56
- export const METRICS_WEBPACK_MODULES = ['webpack.moduleCount'];
57
- export const METRICS_WEBPACK_PACKAGES = ['webpack.packageCount', 'webpack.duplicatePackagesCount'];
55
+ export const METRICS_WEBPACK_ASSETS = ['assetCount', 'chunkCount'];
56
+ export const METRICS_WEBPACK_MODULES = ['moduleCount'];
57
+ export const METRICS_WEBPACK_PACKAGES = ['packageCount', 'duplicatePackagesCount'];
@@ -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
  }
@@ -6,10 +6,15 @@ import { Box } from '../../layout/box';
6
6
  import css from './alert.module.css';
7
7
 
8
8
  export const Alert = (props) => {
9
- const { className, kind, children } = props;
9
+ const { className, kind, children, ...restProps } = props;
10
10
 
11
11
  return (
12
- <Box padding={['xsmall', 'small']} outline className={cx(css.root, className, css[kind])}>
12
+ <Box
13
+ padding={['xsmall', 'small']}
14
+ outline
15
+ className={cx(css.root, className, css[kind])}
16
+ {...restProps}
17
+ >
13
18
  {children}
14
19
  </Box>
15
20
  );
@@ -5,10 +5,13 @@ import cx from 'classnames';
5
5
  import css from './icon.module.css';
6
6
 
7
7
  const ICONS = {
8
+ ALERT_CIRCLE: 'alert-circle',
8
9
  ARROW: 'arrow',
10
+ ARROW_RIGHT_CIRLCE: 'arrow-right-circle',
9
11
  CANCEL: 'cancel',
10
12
  CLOSE: 'close',
11
13
  CLOCK: 'clock',
14
+ CHECK_CIRCLE: 'check-circle',
12
15
  COMMIT: 'commit',
13
16
  FILTER: 'filter',
14
17
  HELP: 'help',
@@ -14,7 +14,7 @@ import css from './popover.module.css';
14
14
  export const Popover = ({ className, icon, label, ariaLabel, children }) => {
15
15
  const popover = usePopoverState({
16
16
  baseId: process.env.NODE_ENV === 'test' && 'id-test',
17
- gutter: 24,
17
+ gutter: 12,
18
18
  modal: true,
19
19
  placement: 'top',
20
20
  });
@@ -32,7 +32,7 @@ export const Popover = ({ className, icon, label, ariaLabel, children }) => {
32
32
  event.preventDefault();
33
33
  popover.toggle();
34
34
  },
35
- [popover]
35
+ [popover],
36
36
  );
37
37
 
38
38
  return (
@@ -47,7 +47,7 @@ export const Popover = ({ className, icon, label, ariaLabel, children }) => {
47
47
  {label && <span className={css.label}>{label}</span>}
48
48
  </UIPopoverDisclosure>
49
49
  <UIPopover className={css.popover} {...popover} tabIndex={0}>
50
- <UIPopoverArrow className={css.arrow} {...popover} size={24} />
50
+ <UIPopoverArrow className={css.arrow} {...popover} size={16} />
51
51
 
52
52
  {typeof children === 'function' ? children({ popoverToggle: popover.toggle }) : children}
53
53
 
@@ -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));