@bundle-stats/ui 3.3.5 → 3.3.6-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.
@@ -17,8 +17,6 @@ var _utils = require("@bundle-stats/utils");
17
17
 
18
18
  var _constants = require("../../constants");
19
19
 
20
- var _icon = require("../../ui/icon");
21
-
22
20
  var _box = require("../../layout/box");
23
21
 
24
22
  var _flexStack = require("../../layout/flex-stack");
@@ -70,22 +68,18 @@ var Summary = function Summary(_ref) {
70
68
  metricId = _ref5[0],
71
69
  metricOptions = _ref5[1];
72
70
 
73
- return /*#__PURE__*/_react["default"].createElement("div", {
71
+ return /*#__PURE__*/_react["default"].createElement(_summaryItem.SummaryItem, _extends({
74
72
  key: metricId,
75
- className: _summaryModule["default"].item
76
- }, /*#__PURE__*/_react["default"].createElement(_summaryItem.SummaryItem, {
73
+ className: _summaryModule["default"].item,
74
+ as: SummaryItemCustomLink
75
+ }, metricOptions.link, {
77
76
  size: size,
78
77
  id: metricId,
79
78
  data: (0, _get2["default"])(data, metricId),
80
79
  loading: loading,
81
80
  showMetricDescription: true,
82
81
  showDelta: showSummaryItemDelta && metricOptions.showDelta !== false
83
- }), !loading && /*#__PURE__*/_react["default"].createElement(SummaryItemCustomLink, _extends({}, metricOptions.link, {
84
- className: _summaryModule["default"].readMore
85
- }), /*#__PURE__*/_react["default"].createElement(_icon.Icon, {
86
- className: _summaryModule["default"].readMoreIcon,
87
- glyph: _icon.Icon.ICONS.ARROW_RIGHT_CIRLCE
88
- })));
82
+ }));
89
83
  })));
90
84
  };
91
85
 
@@ -4,51 +4,7 @@
4
4
  }
5
5
 
6
6
  .item {
7
- padding: var(--space-small) var(--space-xxlarge) var(--space-small) var(--space-small);
8
- flex: 1 0 25%; /* force equal sizes */
9
- position: relative;
10
- z-index: 1;
11
- }
12
-
13
- .item::before {
14
- content: '';
15
- display: block;
16
- width: 1px;
17
- position: absolute;
18
- left: -1px;
19
- top: var(--space-small);
20
- bottom: var(--space-small);
21
- background: var(--color-outline);
22
- }
23
-
24
- .readMore {
25
- display: block;
26
- position: absolute;
27
- right: 0;
28
- bottom: 0;
29
7
  padding: var(--space-small);
30
- color: var(--color-text-ultra-light);
31
- transition: var(--transition-out);
32
- }
33
-
34
- .readMore:hover,
35
- .readMore:focus {
36
- color: var(--color-primary);
37
- transition: var(--transition-in);
38
- }
39
-
40
- .readMoreIcon {
41
- display: block;
42
- }
43
-
44
- /** hover state */
45
- .readMore {
46
- opacity: 0;
47
- }
48
-
49
- .item:hover .readMore,
50
- .item:active .readMore,
51
- .item:focus .readMore {
52
- opacity: 1;
53
- transition: var(--transition-in);
8
+ flex: 1 0 25%; /* force equal sizes */
9
+ text-decoration: none;
54
10
  }
@@ -15,14 +15,10 @@ var _utils = require("@bundle-stats/utils");
15
15
 
16
16
  var _hoverCard = require("../../ui/hover-card");
17
17
 
18
- var _icon = require("../../ui/icon");
19
-
20
18
  var _skeleton = require("../../ui/skeleton");
21
19
 
22
20
  var _stack = require("../../layout/stack");
23
21
 
24
- var _flexStack = require("../../layout/flex-stack");
25
-
26
22
  var _metric = require("../metric");
27
23
 
28
24
  var _delta = require("../delta");
@@ -44,8 +40,11 @@ var MetricInfo = function MetricInfo(_ref) {
44
40
  url = _ref.url;
45
41
  return /*#__PURE__*/_react["default"].createElement(_stack.Stack, {
46
42
  space: "xxxsmall"
47
- }, /*#__PURE__*/_react["default"].createElement("p", null, description), url && /*#__PURE__*/_react["default"].createElement("p", null, /*#__PURE__*/_react["default"].createElement("a", {
48
- href: url,
43
+ }, /*#__PURE__*/_react["default"].createElement("p", null, description), url && /*#__PURE__*/_react["default"].createElement("p", null, /*#__PURE__*/_react["default"].createElement("button", {
44
+ type: "button",
45
+ onClick: function onClick() {
46
+ return window.open(url);
47
+ },
49
48
  className: _summaryItemModule["default"].readMoreLink
50
49
  }, "Read more")));
51
50
  };
@@ -81,19 +80,14 @@ var SummaryItem = function SummaryItem(_ref2) {
81
80
  var showMetricDescriptionTooltip = showMetricDescription && (metric === null || metric === void 0 ? void 0 : metric.description);
82
81
  var rootClassName = (0, _classnames["default"])(_summaryItemModule["default"].root, className, _summaryItemModule["default"][size], showDelta && _summaryItemModule["default"].showDelta);
83
82
  return /*#__PURE__*/_react["default"].createElement(_stack.Stack, _extends({
84
- space: "xxxsmall",
83
+ space: "xxsmall",
85
84
  as: Component,
86
85
  className: rootClassName
87
- }, props), /*#__PURE__*/_react["default"].createElement(_flexStack.FlexStack, {
88
- as: "h3",
89
- space: "xxxsmall",
86
+ }, props), /*#__PURE__*/_react["default"].createElement("h3", {
90
87
  className: _summaryItemModule["default"].title
91
- }, /*#__PURE__*/_react["default"].createElement("span", null, metric.label), showMetricDescriptionTooltip && /*#__PURE__*/_react["default"].createElement(_hoverCard.HoverCard, {
92
- className: _summaryItemModule["default"].icon,
93
- label: /*#__PURE__*/_react["default"].createElement(_icon.Icon, {
94
- glyph: "help"
95
- })
96
- }, /*#__PURE__*/_react["default"].createElement(MetricInfo, metric))), !loading ? /*#__PURE__*/_react["default"].createElement(_stack.Stack, null, /*#__PURE__*/_react["default"].createElement(_metric.Metric, {
88
+ }, showMetricDescriptionTooltip ? /*#__PURE__*/_react["default"].createElement(_hoverCard.HoverCard, {
89
+ label: metric.label
90
+ }, /*#__PURE__*/_react["default"].createElement(MetricInfo, metric)) : metric.label), !loading ? /*#__PURE__*/_react["default"].createElement(_stack.Stack, null, /*#__PURE__*/_react["default"].createElement(_metric.Metric, {
97
91
  className: _summaryItemModule["default"].currentMetric,
98
92
  value: current,
99
93
  formatter: metric.formatter,
@@ -1,9 +1,8 @@
1
1
  .title {
2
- align-items: center;
3
2
  color: var(--color-text-ultra-light);
4
3
  font-weight: bold;
5
4
  font-size: var(--size-xsmall);
6
- line-height: var(--space-small);
5
+ line-height: 1;
7
6
  text-transform: uppercase;
8
7
  white-space: nowrap;
9
8
  }
@@ -28,6 +27,30 @@
28
27
  line-height: var(--space-small);
29
28
  }
30
29
 
30
+ .readMoreLink {
31
+ appearance: none;
32
+ background: none;
33
+ margin: 0;
34
+ border: 0;
35
+ padding: 0;
36
+ color: var(--color-primary);
37
+ text-decoration: underline;
38
+ cursor: pointer;
39
+ }
40
+
41
+ .readMoreLink:hover,
42
+ .readMoreLink:active,
43
+ .readMoreLink:focus {
44
+ color: var(--color-primary-dark);
45
+ text-decoration: none;
46
+ }
47
+
48
+ /* Hover state */
49
+ .root:hover .title {
50
+ color: var(--color-text-light);
51
+ }
52
+
53
+
31
54
  /* Loading state */
32
55
  .loading.currentMetric {
33
56
  width: 8em;
@@ -53,6 +53,11 @@ var HoverCard = function HoverCard(props) {
53
53
  }); // Fallback to span if no href
54
54
 
55
55
  var Component = resolveComponent(as, href);
56
+
57
+ var handleOnClick = function handleOnClick(event) {
58
+ event.preventDefault();
59
+ };
60
+
56
61
  return /*#__PURE__*/_react["default"].createElement("div", {
57
62
  className: (0, _classnames["default"])(_hoverCardModule["default"].root, className)
58
63
  }, /*#__PURE__*/_react["default"].createElement(_hovercard.HovercardAnchor, {
@@ -65,7 +70,8 @@ var HoverCard = function HoverCard(props) {
65
70
  className: (0, _classnames["default"])(_hoverCardModule["default"].hoverCard, hoverCardClassName),
66
71
  style: {
67
72
  zIndex: 10000
68
- }
73
+ },
74
+ onClick: handleOnClick
69
75
  }), /*#__PURE__*/_react["default"].createElement(_hovercard.HovercardArrow, {
70
76
  size: 24
71
77
  }), typeof children === 'function' ? children({
@@ -7,7 +7,6 @@ import PropTypes from 'prop-types';
7
7
  import cx from 'classnames';
8
8
  import { METRIC_COMPONENT_LINKS } from '@bundle-stats/utils';
9
9
  import { METRICS_WEBPACK_GENERAL } from '../../constants';
10
- import { Icon } from '../../ui/icon';
11
10
  import { Box } from '../../layout/box';
12
11
  import { FlexStack } from '../../layout/flex-stack';
13
12
  import { ComponentLink } from '../component-link';
@@ -33,22 +32,18 @@ export const Summary = _ref => {
33
32
  return keys.includes(metricId);
34
33
  }).map(_ref3 => {
35
34
  let [metricId, metricOptions] = _ref3;
36
- return /*#__PURE__*/React.createElement("div", {
35
+ return /*#__PURE__*/React.createElement(SummaryItem, _extends({
37
36
  key: metricId,
38
- className: css.item
39
- }, /*#__PURE__*/React.createElement(SummaryItem, {
37
+ className: css.item,
38
+ as: SummaryItemCustomLink
39
+ }, metricOptions.link, {
40
40
  size: size,
41
41
  id: metricId,
42
42
  data: _get(data, metricId),
43
43
  loading: loading,
44
44
  showMetricDescription: true,
45
45
  showDelta: showSummaryItemDelta && metricOptions.showDelta !== false
46
- }), !loading && /*#__PURE__*/React.createElement(SummaryItemCustomLink, _extends({}, metricOptions.link, {
47
- className: css.readMore
48
- }), /*#__PURE__*/React.createElement(Icon, {
49
- className: css.readMoreIcon,
50
- glyph: Icon.ICONS.ARROW_RIGHT_CIRLCE
51
- })));
46
+ }));
52
47
  })));
53
48
  };
54
49
  Summary.defaultProps = {
@@ -4,51 +4,7 @@
4
4
  }
5
5
 
6
6
  .item {
7
- padding: var(--space-small) var(--space-xxlarge) var(--space-small) var(--space-small);
8
- flex: 1 0 25%; /* force equal sizes */
9
- position: relative;
10
- z-index: 1;
11
- }
12
-
13
- .item::before {
14
- content: '';
15
- display: block;
16
- width: 1px;
17
- position: absolute;
18
- left: -1px;
19
- top: var(--space-small);
20
- bottom: var(--space-small);
21
- background: var(--color-outline);
22
- }
23
-
24
- .readMore {
25
- display: block;
26
- position: absolute;
27
- right: 0;
28
- bottom: 0;
29
7
  padding: var(--space-small);
30
- color: var(--color-text-ultra-light);
31
- transition: var(--transition-out);
32
- }
33
-
34
- .readMore:hover,
35
- .readMore:focus {
36
- color: var(--color-primary);
37
- transition: var(--transition-in);
38
- }
39
-
40
- .readMoreIcon {
41
- display: block;
42
- }
43
-
44
- /** hover state */
45
- .readMore {
46
- opacity: 0;
47
- }
48
-
49
- .item:hover .readMore,
50
- .item:active .readMore,
51
- .item:focus .readMore {
52
- opacity: 1;
53
- transition: var(--transition-in);
8
+ flex: 1 0 25%; /* force equal sizes */
9
+ text-decoration: none;
54
10
  }
@@ -5,10 +5,8 @@ import PropTypes from 'prop-types';
5
5
  import cx from 'classnames';
6
6
  import { getGlobalMetricType, getMetricRunInfo } from '@bundle-stats/utils';
7
7
  import { HoverCard } from '../../ui/hover-card';
8
- import { Icon } from '../../ui/icon';
9
8
  import { Skeleton } from '../../ui/skeleton';
10
9
  import { Stack } from '../../layout/stack';
11
- import { FlexStack } from '../../layout/flex-stack';
12
10
  import { Metric } from '../metric';
13
11
  import { Delta } from '../delta';
14
12
  import css from './summary-item.module.css';
@@ -20,8 +18,9 @@ const MetricInfo = _ref => {
20
18
  } = _ref;
21
19
  return /*#__PURE__*/React.createElement(Stack, {
22
20
  space: "xxxsmall"
23
- }, /*#__PURE__*/React.createElement("p", null, description), url && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
24
- href: url,
21
+ }, /*#__PURE__*/React.createElement("p", null, description), url && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("button", {
22
+ type: "button",
23
+ onClick: () => window.open(url),
25
24
  className: css.readMoreLink
26
25
  }, "Read more")));
27
26
  };
@@ -57,19 +56,14 @@ export const SummaryItem = _ref2 => {
57
56
  const showMetricDescriptionTooltip = showMetricDescription && (metric == null ? void 0 : metric.description);
58
57
  const rootClassName = cx(css.root, className, css[size], showDelta && css.showDelta);
59
58
  return /*#__PURE__*/React.createElement(Stack, _extends({
60
- space: "xxxsmall",
59
+ space: "xxsmall",
61
60
  as: Component,
62
61
  className: rootClassName
63
- }, props), /*#__PURE__*/React.createElement(FlexStack, {
64
- as: "h3",
65
- space: "xxxsmall",
62
+ }, props), /*#__PURE__*/React.createElement("h3", {
66
63
  className: css.title
67
- }, /*#__PURE__*/React.createElement("span", null, metric.label), showMetricDescriptionTooltip && /*#__PURE__*/React.createElement(HoverCard, {
68
- className: css.icon,
69
- label: /*#__PURE__*/React.createElement(Icon, {
70
- glyph: "help"
71
- })
72
- }, /*#__PURE__*/React.createElement(MetricInfo, metric))), !loading ? /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Metric, {
64
+ }, showMetricDescriptionTooltip ? /*#__PURE__*/React.createElement(HoverCard, {
65
+ label: metric.label
66
+ }, /*#__PURE__*/React.createElement(MetricInfo, metric)) : metric.label), !loading ? /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Metric, {
73
67
  className: css.currentMetric,
74
68
  value: current,
75
69
  formatter: metric.formatter,
@@ -1,9 +1,8 @@
1
1
  .title {
2
- align-items: center;
3
2
  color: var(--color-text-ultra-light);
4
3
  font-weight: bold;
5
4
  font-size: var(--size-xsmall);
6
- line-height: var(--space-small);
5
+ line-height: 1;
7
6
  text-transform: uppercase;
8
7
  white-space: nowrap;
9
8
  }
@@ -28,6 +27,30 @@
28
27
  line-height: var(--space-small);
29
28
  }
30
29
 
30
+ .readMoreLink {
31
+ appearance: none;
32
+ background: none;
33
+ margin: 0;
34
+ border: 0;
35
+ padding: 0;
36
+ color: var(--color-primary);
37
+ text-decoration: underline;
38
+ cursor: pointer;
39
+ }
40
+
41
+ .readMoreLink:hover,
42
+ .readMoreLink:active,
43
+ .readMoreLink:focus {
44
+ color: var(--color-primary-dark);
45
+ text-decoration: none;
46
+ }
47
+
48
+ /* Hover state */
49
+ .root:hover .title {
50
+ color: var(--color-text-light);
51
+ }
52
+
53
+
31
54
  /* Loading state */
32
55
  .loading.currentMetric {
33
56
  width: 8em;
@@ -36,6 +36,11 @@ export const HoverCard = props => {
36
36
  }); // Fallback to span if no href
37
37
 
38
38
  const Component = resolveComponent(as, href);
39
+
40
+ const handleOnClick = event => {
41
+ event.preventDefault();
42
+ };
43
+
39
44
  return /*#__PURE__*/React.createElement("div", {
40
45
  className: cx(css.root, className)
41
46
  }, /*#__PURE__*/React.createElement(HovercardAnchor, {
@@ -48,7 +53,8 @@ export const HoverCard = props => {
48
53
  className: cx(css.hoverCard, hoverCardClassName),
49
54
  style: {
50
55
  zIndex: 10000
51
- }
56
+ },
57
+ onClick: handleOnClick
52
58
  }), /*#__PURE__*/React.createElement(HovercardArrow, {
53
59
  size: 24
54
60
  }), typeof children === 'function' ? children({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bundle-stats/ui",
3
- "version": "3.3.5",
3
+ "version": "3.3.6-alpha.0",
4
4
  "description": "UI components for BundleStats projects.",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -37,7 +37,7 @@
37
37
  "homepage": "https://github.com/relative-ci/bundle-stats/blob/master/packages/ui#readme",
38
38
  "devDependencies": {
39
39
  "@babel/cli": "7.17.6",
40
- "@babel/core": "7.17.8",
40
+ "@babel/core": "7.17.9",
41
41
  "@babel/plugin-proposal-class-properties": "7.16.7",
42
42
  "@babel/preset-env": "7.16.11",
43
43
  "@babel/preset-react": "7.16.7",
@@ -85,12 +85,12 @@
85
85
  "react-router-dom": "^5.0.0"
86
86
  },
87
87
  "dependencies": {
88
- "@bundle-stats/utils": "^3.3.5",
89
- "ariakit": "2.0.0-alpha.20",
88
+ "@bundle-stats/utils": "^3.3.6-alpha.0",
89
+ "ariakit": "2.0.0-alpha.21",
90
90
  "date-fns": "^2.28.0",
91
91
  "modern-css-reset": "^1.4.0",
92
92
  "query-string": "^7.1.0",
93
93
  "use-query-params": "^1.2.3"
94
94
  },
95
- "gitHead": "6e6561a49d81c675f993fdc892332528ba296140"
95
+ "gitHead": "b1f5e14599c55a56ce8086c4e2a22603ce86b7f6"
96
96
  }
@@ -5,7 +5,6 @@ import { get } from 'lodash';
5
5
  import { METRIC_COMPONENT_LINKS } from '@bundle-stats/utils';
6
6
 
7
7
  import { METRICS_WEBPACK_GENERAL } from '../../constants';
8
- import { Icon } from '../../ui/icon';
9
8
  import { Box } from '../../layout/box';
10
9
  import { FlexStack } from '../../layout/flex-stack';
11
10
  import { ComponentLink } from '../component-link';
@@ -26,21 +25,18 @@ export const Summary = ({
26
25
  {Array.from(METRIC_COMPONENT_LINKS)
27
26
  .filter(([metricId]) => keys.includes(metricId))
28
27
  .map(([metricId, metricOptions]) => (
29
- <div key={metricId} className={css.item}>
30
- <SummaryItem
31
- size={size}
32
- id={metricId}
33
- data={get(data, metricId)}
34
- loading={loading}
35
- showMetricDescription
36
- showDelta={showSummaryItemDelta && metricOptions.showDelta !== false}
37
- />
38
- {!loading && (
39
- <SummaryItemCustomLink {...metricOptions.link} className={css.readMore}>
40
- <Icon className={css.readMoreIcon} glyph={Icon.ICONS.ARROW_RIGHT_CIRLCE} />
41
- </SummaryItemCustomLink>
42
- )}
43
- </div>
28
+ <SummaryItem
29
+ key={metricId}
30
+ className={css.item}
31
+ as={SummaryItemCustomLink}
32
+ {...metricOptions.link}
33
+ size={size}
34
+ id={metricId}
35
+ data={get(data, metricId)}
36
+ loading={loading}
37
+ showMetricDescription
38
+ showDelta={showSummaryItemDelta && metricOptions.showDelta !== false}
39
+ />
44
40
  ))}
45
41
  </FlexStack>
46
42
  </Box>
@@ -4,51 +4,7 @@
4
4
  }
5
5
 
6
6
  .item {
7
- padding: var(--space-small) var(--space-xxlarge) var(--space-small) var(--space-small);
8
- flex: 1 0 25%; /* force equal sizes */
9
- position: relative;
10
- z-index: 1;
11
- }
12
-
13
- .item::before {
14
- content: '';
15
- display: block;
16
- width: 1px;
17
- position: absolute;
18
- left: -1px;
19
- top: var(--space-small);
20
- bottom: var(--space-small);
21
- background: var(--color-outline);
22
- }
23
-
24
- .readMore {
25
- display: block;
26
- position: absolute;
27
- right: 0;
28
- bottom: 0;
29
7
  padding: var(--space-small);
30
- color: var(--color-text-ultra-light);
31
- transition: var(--transition-out);
32
- }
33
-
34
- .readMore:hover,
35
- .readMore:focus {
36
- color: var(--color-primary);
37
- transition: var(--transition-in);
38
- }
39
-
40
- .readMoreIcon {
41
- display: block;
42
- }
43
-
44
- /** hover state */
45
- .readMore {
46
- opacity: 0;
47
- }
48
-
49
- .item:hover .readMore,
50
- .item:active .readMore,
51
- .item:focus .readMore {
52
- opacity: 1;
53
- transition: var(--transition-in);
8
+ flex: 1 0 25%; /* force equal sizes */
9
+ text-decoration: none;
54
10
  }
@@ -4,10 +4,8 @@ import cx from 'classnames';
4
4
  import { getGlobalMetricType, getMetricRunInfo } from '@bundle-stats/utils';
5
5
 
6
6
  import { HoverCard } from '../../ui/hover-card';
7
- import { Icon } from '../../ui/icon';
8
7
  import { Skeleton } from '../../ui/skeleton';
9
8
  import { Stack } from '../../layout/stack';
10
- import { FlexStack } from '../../layout/flex-stack';
11
9
  import { Metric } from '../metric';
12
10
  import { Delta } from '../delta';
13
11
  import css from './summary-item.module.css';
@@ -17,9 +15,9 @@ const MetricInfo = ({ description, url }) => (
17
15
  <p>{description}</p>
18
16
  {url && (
19
17
  <p>
20
- <a href={url} className={css.readMoreLink}>
18
+ <button type="button" onClick={() => window.open(url)} className={css.readMoreLink}>
21
19
  Read more
22
- </a>
20
+ </button>
23
21
  </p>
24
22
  )}
25
23
  </Stack>
@@ -54,16 +52,16 @@ export const SummaryItem = ({
54
52
  const rootClassName = cx(css.root, className, css[size], showDelta && css.showDelta);
55
53
 
56
54
  return (
57
- <Stack space="xxxsmall" as={Component} className={rootClassName} {...props}>
58
- <FlexStack as="h3" space="xxxsmall" className={css.title}>
59
- <span>{metric.label}</span>
60
-
61
- {showMetricDescriptionTooltip && (
62
- <HoverCard className={css.icon} label={<Icon glyph="help" />}>
55
+ <Stack space="xxsmall" as={Component} className={rootClassName} {...props}>
56
+ <h3 className={css.title}>
57
+ {showMetricDescriptionTooltip ? (
58
+ <HoverCard label={metric.label}>
63
59
  <MetricInfo {...metric} />
64
60
  </HoverCard>
61
+ ) : (
62
+ metric.label
65
63
  )}
66
- </FlexStack>
64
+ </h3>
67
65
 
68
66
  {!loading ? (
69
67
  <Stack>
@@ -1,9 +1,8 @@
1
1
  .title {
2
- align-items: center;
3
2
  color: var(--color-text-ultra-light);
4
3
  font-weight: bold;
5
4
  font-size: var(--size-xsmall);
6
- line-height: var(--space-small);
5
+ line-height: 1;
7
6
  text-transform: uppercase;
8
7
  white-space: nowrap;
9
8
  }
@@ -28,6 +27,30 @@
28
27
  line-height: var(--space-small);
29
28
  }
30
29
 
30
+ .readMoreLink {
31
+ appearance: none;
32
+ background: none;
33
+ margin: 0;
34
+ border: 0;
35
+ padding: 0;
36
+ color: var(--color-primary);
37
+ text-decoration: underline;
38
+ cursor: pointer;
39
+ }
40
+
41
+ .readMoreLink:hover,
42
+ .readMoreLink:active,
43
+ .readMoreLink:focus {
44
+ color: var(--color-primary-dark);
45
+ text-decoration: none;
46
+ }
47
+
48
+ /* Hover state */
49
+ .root:hover .title {
50
+ color: var(--color-text-light);
51
+ }
52
+
53
+
31
54
  /* Loading state */
32
55
  .loading.currentMetric {
33
56
  width: 8em;
@@ -31,6 +31,10 @@ export const HoverCard = (props) => {
31
31
  // Fallback to span if no href
32
32
  const Component = resolveComponent(as, href);
33
33
 
34
+ const handleOnClick = (event) => {
35
+ event.preventDefault();
36
+ };
37
+
34
38
  return (
35
39
  <div className={cx(css.root, className)}>
36
40
  <HovercardAnchor state={state} href={href} className={css.anchor} as={Component}>
@@ -41,6 +45,7 @@ export const HoverCard = (props) => {
41
45
  state={state}
42
46
  className={cx(css.hoverCard, hoverCardClassName)}
43
47
  style={{ zIndex: 10000 }}
48
+ onClick={handleOnClick}
44
49
  >
45
50
  <HovercardArrow size={24} />
46
51
  {typeof children === 'function' ? children({ close: state.hide }) : children}