@bundle-stats/ui 3.2.3 → 3.2.4-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.
- package/CHANGELOG.md +17 -0
- package/lib/components/bundle-assets/bundle-assets.js +9 -7
- package/lib/components/bundle-assets/bundle-assets.module.css +5 -0
- package/lib/components/bundle-modules/bundle-modules.js +34 -63
- package/lib/components/bundle-modules/bundle-modules.module.css +0 -4
- package/lib/components/bundle-packages/bundle-packages.js +29 -24
- package/lib/components/bundle-packages/bundle-packages.module.css +37 -20
- package/lib/components/metrics-table-title/metrics-table-title.js +7 -3
- package/lib/components/summary-item/summary-item.js +16 -18
- package/lib/components/total-size-type-title/total-size-type-title.js +7 -3
- package/lib/ui/dropdown/dropdown.js +15 -19
- package/lib/ui/filters/filters.js +3 -5
- package/lib/ui/hover-card/hover-card.js +65 -0
- package/lib/ui/hover-card/hover-card.module.css +29 -0
- package/lib/ui/hover-card/hover-card.stories.js +26 -0
- package/lib/ui/{popover → hover-card}/index.js +4 -4
- package/lib/ui/icon/icon.module.css +1 -0
- package/lib/ui/index.js +8 -8
- package/lib/ui/sort-dropdown/sort-dropdown.js +2 -5
- package/lib/ui/tooltip/tooltip.js +22 -14
- package/lib/ui/tooltip/tooltip.module.css +5 -3
- package/lib-esm/components/bundle-assets/bundle-assets.js +9 -7
- package/lib-esm/components/bundle-assets/bundle-assets.module.css +5 -0
- package/lib-esm/components/bundle-modules/bundle-modules.js +17 -29
- package/lib-esm/components/bundle-modules/bundle-modules.module.css +0 -4
- package/lib-esm/components/bundle-packages/bundle-packages.js +28 -23
- package/lib-esm/components/bundle-packages/bundle-packages.module.css +37 -20
- package/lib-esm/components/metrics-table-title/metrics-table-title.js +6 -3
- package/lib-esm/components/summary-item/summary-item.js +15 -18
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +6 -3
- package/lib-esm/ui/dropdown/dropdown.js +9 -19
- package/lib-esm/ui/filters/filters.js +3 -5
- package/lib-esm/ui/hover-card/hover-card.js +45 -0
- package/lib-esm/ui/hover-card/hover-card.module.css +29 -0
- package/lib-esm/ui/hover-card/hover-card.stories.js +9 -0
- package/lib-esm/ui/hover-card/index.js +1 -0
- package/lib-esm/ui/icon/icon.module.css +1 -0
- package/lib-esm/ui/index.js +1 -1
- package/lib-esm/ui/sort-dropdown/sort-dropdown.js +2 -5
- package/lib-esm/ui/tooltip/tooltip.js +15 -14
- package/lib-esm/ui/tooltip/tooltip.module.css +5 -3
- package/package.json +25 -22
- package/src/components/bundle-assets/bundle-assets.jsx +51 -42
- package/src/components/bundle-assets/bundle-assets.module.css +5 -0
- package/src/components/bundle-modules/bundle-modules.jsx +28 -31
- package/src/components/bundle-modules/bundle-modules.module.css +0 -4
- package/src/components/bundle-packages/bundle-packages.jsx +31 -25
- package/src/components/bundle-packages/bundle-packages.module.css +37 -20
- package/src/components/metrics-table-options/metrics-table-options.jsx +1 -1
- package/src/components/metrics-table-title/metrics-table-title.jsx +4 -3
- package/src/components/summary-item/summary-item.jsx +21 -26
- package/src/components/total-size-type-title/total-size-type-title.jsx +6 -9
- package/src/ui/dropdown/dropdown.jsx +14 -18
- package/src/ui/filters/filters.jsx +30 -39
- package/src/ui/hover-card/hover-card.jsx +42 -0
- package/src/ui/hover-card/hover-card.module.css +29 -0
- package/src/ui/hover-card/index.js +1 -0
- package/src/ui/icon/icon.module.css +1 -0
- package/src/ui/index.js +1 -1
- package/src/ui/sort-dropdown/sort-dropdown.jsx +9 -11
- package/src/ui/tooltip/tooltip.jsx +20 -27
- package/src/ui/tooltip/tooltip.module.css +5 -3
- package/lib/ui/popover/popover.js +0 -92
- package/lib/ui/popover/popover.module.css +0 -66
- package/lib/ui/popover/popover.stories.js +0 -26
- package/lib-esm/ui/popover/index.js +0 -1
- package/lib-esm/ui/popover/popover.js +0 -71
- package/lib-esm/ui/popover/popover.module.css +0 -66
- package/lib-esm/ui/popover/popover.stories.js +0 -14
- package/src/ui/popover/index.js +0 -1
- package/src/ui/popover/popover.jsx +0 -79
- package/src/ui/popover/popover.module.css +0 -66
|
@@ -12,20 +12,8 @@
|
|
|
12
12
|
margin-right: -1px; /** collapse border */
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.
|
|
16
|
-
|
|
17
|
-
display: inline-block;
|
|
18
|
-
width: var(--space-small);
|
|
19
|
-
height: var(--space-small);
|
|
20
|
-
font-size: 10px;
|
|
21
|
-
font-weight: bold;
|
|
22
|
-
line-height: var(--space-small);
|
|
23
|
-
text-align: center;
|
|
24
|
-
text-transform: uppercase;
|
|
25
|
-
vertical-align: middle;
|
|
26
|
-
|
|
27
|
-
background: var(--color-danger);
|
|
28
|
-
color: var(--color-light);
|
|
15
|
+
.packageNames {
|
|
16
|
+
align-items: center;
|
|
29
17
|
}
|
|
30
18
|
|
|
31
19
|
.packageName {
|
|
@@ -38,27 +26,56 @@
|
|
|
38
26
|
|
|
39
27
|
.packageName + .packageName::before {
|
|
40
28
|
display: inline-block;
|
|
41
|
-
margin: 0 var(--space-xxxsmall);
|
|
29
|
+
margin: 0 var(--space-xxxsmall) 0 0;
|
|
42
30
|
content: '/';
|
|
43
31
|
color: var(--color-text-ultra-light);
|
|
44
32
|
}
|
|
45
33
|
|
|
46
|
-
.
|
|
47
|
-
|
|
34
|
+
.packageNameLabel {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.packageNameDuplicate {
|
|
40
|
+
margin-right: var(--space-xxxsmall);
|
|
41
|
+
display: inline-block;
|
|
42
|
+
width: var(--space-xsmall);
|
|
43
|
+
height: var(--space-xsmall);
|
|
44
|
+
font-size: 8px;
|
|
45
|
+
font-weight: bold;
|
|
46
|
+
line-height: var(--space-xsmall);
|
|
47
|
+
text-align: center;
|
|
48
|
+
text-transform: uppercase;
|
|
49
|
+
vertical-align: middle;
|
|
50
|
+
|
|
51
|
+
background: var(--color-danger);
|
|
52
|
+
color: var(--color-light);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.packageName:hover,
|
|
56
|
+
.packageName:active,
|
|
57
|
+
.packageName:focus {
|
|
58
|
+
text-decoration: none !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.packageName:hover .packageNameText,
|
|
62
|
+
.packageName:active .packageNameText,
|
|
63
|
+
.packageName:focus .packageNameText {
|
|
64
|
+
text-decoration: underline !important;
|
|
48
65
|
}
|
|
49
66
|
|
|
50
|
-
.
|
|
67
|
+
.packageCardTitleIndex {
|
|
51
68
|
color: var(--color-text-light);
|
|
52
69
|
font-weight: normal;
|
|
53
70
|
}
|
|
54
71
|
|
|
55
|
-
.
|
|
72
|
+
.packageCardPathValue {
|
|
56
73
|
padding: var(--space-xxxsmall);
|
|
57
74
|
background: var(--color-highlight-warning);
|
|
58
75
|
font-family: var(--font-family-monospace);
|
|
59
76
|
}
|
|
60
77
|
|
|
61
|
-
.
|
|
78
|
+
.packageCardList {
|
|
62
79
|
padding: 0;
|
|
63
80
|
list-style: inside;
|
|
64
81
|
}
|
|
@@ -4,7 +4,8 @@ import cx from 'classnames';
|
|
|
4
4
|
import I18N from '../../i18n';
|
|
5
5
|
import { FlexStack } from '../../layout/flex-stack';
|
|
6
6
|
import { Stack } from '../../layout/stack';
|
|
7
|
-
import {
|
|
7
|
+
import { Icon } from '../../ui/icon';
|
|
8
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
8
9
|
import css from './metrics-table-title.module.css';
|
|
9
10
|
export const MetricsTableTitle = props => {
|
|
10
11
|
const {
|
|
@@ -22,8 +23,10 @@ export const MetricsTableTitle = props => {
|
|
|
22
23
|
space: "xxxsmall"
|
|
23
24
|
}, /*#__PURE__*/React.createElement("span", null, title), info && /*#__PURE__*/React.createElement("span", {
|
|
24
25
|
className: css.info
|
|
25
|
-
}, info), (popoverInfo || popoverHref) && /*#__PURE__*/React.createElement(
|
|
26
|
-
|
|
26
|
+
}, info), (popoverInfo || popoverHref) && /*#__PURE__*/React.createElement(HoverCard, {
|
|
27
|
+
label: /*#__PURE__*/React.createElement(Icon, {
|
|
28
|
+
glyph: "help"
|
|
29
|
+
})
|
|
27
30
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
28
31
|
space: "xxxsmall"
|
|
29
32
|
}, popoverInfo && /*#__PURE__*/React.createElement("p", null, popoverInfo), popoverHref && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
|
|
@@ -4,7 +4,8 @@ import React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import cx from 'classnames';
|
|
6
6
|
import { getGlobalMetricType, getMetricRunInfo } from '@bundle-stats/utils';
|
|
7
|
-
import {
|
|
7
|
+
import { Icon } from '../../ui/icon';
|
|
8
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
8
9
|
import { Skeleton } from '../../ui/skeleton';
|
|
9
10
|
import { Stack } from '../../layout/stack';
|
|
10
11
|
import { FlexStack } from '../../layout/flex-stack';
|
|
@@ -12,31 +13,25 @@ import { Metric } from '../metric';
|
|
|
12
13
|
import { Delta } from '../delta';
|
|
13
14
|
import css from './summary-item.module.css';
|
|
14
15
|
|
|
15
|
-
const
|
|
16
|
+
const MetricDescriptionCard = _ref => {
|
|
16
17
|
let {
|
|
17
18
|
description,
|
|
18
19
|
url
|
|
19
20
|
} = _ref;
|
|
20
|
-
|
|
21
|
-
// Workaround cases where the parent is a link
|
|
22
|
-
const readMoreOnClick = () => {
|
|
23
|
-
window.open(url);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
21
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
27
|
-
space: "
|
|
28
|
-
}, /*#__PURE__*/React.createElement("p", null, description), url && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
space: "xxsmall"
|
|
23
|
+
}, /*#__PURE__*/React.createElement("p", null, description), url && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
|
|
24
|
+
href: url,
|
|
25
|
+
target: "_blank",
|
|
26
|
+
rel: "noopener noreferrer"
|
|
32
27
|
}, "Read more")));
|
|
33
28
|
};
|
|
34
29
|
|
|
35
|
-
|
|
30
|
+
MetricDescriptionCard.propTypes = {
|
|
36
31
|
description: PropTypes.string.isRequired,
|
|
37
32
|
url: PropTypes.string
|
|
38
33
|
};
|
|
39
|
-
|
|
34
|
+
MetricDescriptionCard.defaultProps = {
|
|
40
35
|
url: ''
|
|
41
36
|
};
|
|
42
37
|
export const SummaryItem = _ref2 => {
|
|
@@ -70,10 +65,12 @@ export const SummaryItem = _ref2 => {
|
|
|
70
65
|
as: "h3",
|
|
71
66
|
space: "xxxsmall",
|
|
72
67
|
className: css.title
|
|
73
|
-
}, /*#__PURE__*/React.createElement("span", null, metric.label), showMetricDescriptionTooltip && /*#__PURE__*/React.createElement(
|
|
68
|
+
}, /*#__PURE__*/React.createElement("span", null, metric.label), showMetricDescriptionTooltip && /*#__PURE__*/React.createElement(HoverCard, {
|
|
74
69
|
className: css.icon,
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
label: /*#__PURE__*/React.createElement(Icon, {
|
|
71
|
+
glyph: "help"
|
|
72
|
+
})
|
|
73
|
+
}, /*#__PURE__*/React.createElement(MetricDescriptionCard, metric))), !loading ? /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Metric, {
|
|
77
74
|
className: css.currentMetric,
|
|
78
75
|
value: current,
|
|
79
76
|
formatter: metric.formatter,
|
|
@@ -5,7 +5,8 @@ import config from '../../config.json';
|
|
|
5
5
|
import I18N from '../../i18n';
|
|
6
6
|
import { FlexStack } from '../../layout/flex-stack';
|
|
7
7
|
import { Stack } from '../../layout/stack';
|
|
8
|
-
import {
|
|
8
|
+
import { Icon } from '../../ui/icon';
|
|
9
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
9
10
|
import css from './total-size-type-title.module.css';
|
|
10
11
|
export const TotalSizeTypeTitle = _ref => {
|
|
11
12
|
let {
|
|
@@ -14,8 +15,10 @@ export const TotalSizeTypeTitle = _ref => {
|
|
|
14
15
|
return /*#__PURE__*/React.createElement(FlexStack, {
|
|
15
16
|
space: "xxxsmall",
|
|
16
17
|
className: cx(css.title, className)
|
|
17
|
-
}, /*#__PURE__*/React.createElement("span", null, I18N.ASSET_TOTALS), /*#__PURE__*/React.createElement(
|
|
18
|
-
|
|
18
|
+
}, /*#__PURE__*/React.createElement("span", null, I18N.ASSET_TOTALS), /*#__PURE__*/React.createElement(HoverCard, {
|
|
19
|
+
label: /*#__PURE__*/React.createElement(Icon, {
|
|
20
|
+
glyph: "help"
|
|
21
|
+
})
|
|
19
22
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
20
23
|
space: "xxxsmall"
|
|
21
24
|
}, /*#__PURE__*/React.createElement("p", null, I18N.ASSET_TOTALS_INFO), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
import React from 'react';
|
|
4
2
|
import PropTypes from 'prop-types';
|
|
5
3
|
import cx from 'classnames';
|
|
6
|
-
import
|
|
4
|
+
import * as BaseDropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
7
5
|
import { FlexStack } from '../../layout/flex-stack';
|
|
8
6
|
import { Icon } from '../icon';
|
|
9
7
|
import css from './dropdown.module.css';
|
|
@@ -17,25 +15,20 @@ export const Dropdown = props => {
|
|
|
17
15
|
children
|
|
18
16
|
} = props;
|
|
19
17
|
const rootClassName = cx(css.root, activeLabel && css.activeLabel, className);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MenuButton, _extends({}, menu, {
|
|
25
|
-
className: rootClassName,
|
|
26
|
-
tabIndex: null
|
|
27
|
-
}), /*#__PURE__*/React.createElement(FlexStack, {
|
|
18
|
+
return /*#__PURE__*/React.createElement(BaseDropdownMenu.Root, null, /*#__PURE__*/React.createElement(BaseDropdownMenu.Trigger, {
|
|
19
|
+
className: rootClassName
|
|
20
|
+
}, /*#__PURE__*/React.createElement(FlexStack, {
|
|
28
21
|
space: "xxxsmall",
|
|
29
22
|
className: css.label
|
|
30
23
|
}, glyph && /*#__PURE__*/React.createElement(Icon, {
|
|
31
24
|
className: css.labelIcon,
|
|
32
25
|
glyph: glyph
|
|
33
|
-
}), label)), /*#__PURE__*/React.createElement(
|
|
26
|
+
}), label)), /*#__PURE__*/React.createElement(BaseDropdownMenu.Content, {
|
|
27
|
+
className: css.dropdown,
|
|
34
28
|
"aria-label": ariaLabel || label,
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
MenuItem,
|
|
38
|
-
menu,
|
|
29
|
+
align: "start"
|
|
30
|
+
}, typeof children === 'function' ? children({
|
|
31
|
+
MenuItem: BaseDropdownMenu.Item,
|
|
39
32
|
menuItemClassName: css.menuItem,
|
|
40
33
|
menuItemActiveClassName: css.menuItemActive
|
|
41
34
|
}) : children));
|
|
@@ -60,9 +53,6 @@ Dropdown.propTypes = {
|
|
|
60
53
|
/** Icon glyph */
|
|
61
54
|
glyph: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
62
55
|
|
|
63
|
-
/** Dropdown open state */
|
|
64
|
-
open: PropTypes.bool.isRequired,
|
|
65
|
-
|
|
66
56
|
/** Active label flag */
|
|
67
57
|
activeLabel: PropTypes.bool,
|
|
68
58
|
|
|
@@ -103,7 +103,6 @@ const FilterGroup = props => {
|
|
|
103
103
|
}, _ref4 => {
|
|
104
104
|
let {
|
|
105
105
|
MenuItem,
|
|
106
|
-
menu,
|
|
107
106
|
menuItemClassName
|
|
108
107
|
} = _ref4;
|
|
109
108
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -116,11 +115,10 @@ const FilterGroup = props => {
|
|
|
116
115
|
[id]: true
|
|
117
116
|
});
|
|
118
117
|
|
|
119
|
-
return /*#__PURE__*/React.createElement(MenuItem,
|
|
120
|
-
key: id
|
|
121
|
-
}, menu, {
|
|
118
|
+
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
119
|
+
key: id,
|
|
122
120
|
className: cx(menuItemClassName, css.filterGroupItem)
|
|
123
|
-
}
|
|
121
|
+
}, /*#__PURE__*/React.createElement(Filter, {
|
|
124
122
|
name: id,
|
|
125
123
|
label: itemData.label,
|
|
126
124
|
onChange: onCheckboxChange,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import cx from 'classnames';
|
|
4
|
+
import * as BaseHoverCard from '@radix-ui/react-hover-card';
|
|
5
|
+
import css from './hover-card.module.css';
|
|
6
|
+
const OFFSET = 8;
|
|
7
|
+
const DELAY = 300;
|
|
8
|
+
const propTypes = {
|
|
9
|
+
className: PropTypes.string,
|
|
10
|
+
label: PropTypes.element.isRequired,
|
|
11
|
+
side: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
|
12
|
+
children: PropTypes.element.isRequired
|
|
13
|
+
};
|
|
14
|
+
const defaultProps = {
|
|
15
|
+
className: '',
|
|
16
|
+
side: 'top'
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* @param {PropTypes.InferProps<typeof propTypes>} props
|
|
20
|
+
* @return {React.FunctionComponentElement}
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export const HoverCard = props => {
|
|
24
|
+
const {
|
|
25
|
+
className,
|
|
26
|
+
label,
|
|
27
|
+
side,
|
|
28
|
+
children
|
|
29
|
+
} = props;
|
|
30
|
+
return /*#__PURE__*/React.createElement(BaseHoverCard.Root, {
|
|
31
|
+
openDelay: DELAY,
|
|
32
|
+
closeDelay: DELAY
|
|
33
|
+
}, /*#__PURE__*/React.createElement(BaseHoverCard.Trigger, {
|
|
34
|
+
className: cx(css.label, className)
|
|
35
|
+
}, label), /*#__PURE__*/React.createElement(BaseHoverCard.Content, {
|
|
36
|
+
className: css.card,
|
|
37
|
+
sideOffset: OFFSET,
|
|
38
|
+
side: side
|
|
39
|
+
}, /*#__PURE__*/React.createElement(BaseHoverCard.Arrow, {
|
|
40
|
+
className: css.arrow,
|
|
41
|
+
offset: OFFSET
|
|
42
|
+
}), children));
|
|
43
|
+
};
|
|
44
|
+
HoverCard.propTypes = propTypes;
|
|
45
|
+
HoverCard.defaultProps = defaultProps;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.label {
|
|
2
|
+
color: inherit;
|
|
3
|
+
cursor: pointer;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.label:hover,
|
|
7
|
+
.label:focus,
|
|
8
|
+
.label:active {
|
|
9
|
+
color: var(--color-primary);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.label:hover {
|
|
13
|
+
text-decoration: underline;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.card {
|
|
17
|
+
padding: var(--space-small);
|
|
18
|
+
border-radius: var(--radius-small);
|
|
19
|
+
width: 320px;
|
|
20
|
+
outline: none;
|
|
21
|
+
filter: drop-shadow(0 0 var(--space-xxxsmall) var(--color-shadow));
|
|
22
|
+
background: var(--color-light);
|
|
23
|
+
font-size: var(--size-small);
|
|
24
|
+
line-height: 1.6;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.arrow {
|
|
28
|
+
fill: var(--color-light);
|
|
29
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HoverCard } from '.';
|
|
3
|
+
export default {
|
|
4
|
+
name: 'UI/HoverCard',
|
|
5
|
+
component: HoverCard
|
|
6
|
+
};
|
|
7
|
+
export const Default = () => /*#__PURE__*/React.createElement(HoverCard, {
|
|
8
|
+
label: "Open popover"
|
|
9
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './hover-card';
|
package/lib-esm/ui/index.js
CHANGED
|
@@ -7,10 +7,10 @@ export { Filters } from './filters';
|
|
|
7
7
|
export { HorizontalBarChart } from './horizontal-bar-chart';
|
|
8
8
|
export { Icon } from './icon';
|
|
9
9
|
export { Input } from './input';
|
|
10
|
+
export { HoverCard } from './hover-card';
|
|
10
11
|
export { Loader } from './loader';
|
|
11
12
|
export { Logo } from './logo';
|
|
12
13
|
export { Panels } from './panels';
|
|
13
|
-
export { Popover } from './popover';
|
|
14
14
|
export { Skeleton } from './skeleton';
|
|
15
15
|
export { SortDropdown } from './sort-dropdown';
|
|
16
16
|
export { Table } from './table';
|
|
@@ -20,12 +20,10 @@ export const SortDropdown = props => {
|
|
|
20
20
|
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
21
21
|
className: rootClassName,
|
|
22
22
|
label: customLabel,
|
|
23
|
-
glyph: "sort"
|
|
24
|
-
align: "right"
|
|
23
|
+
glyph: "sort"
|
|
25
24
|
}, _ref => {
|
|
26
25
|
let {
|
|
27
26
|
MenuItem,
|
|
28
|
-
menu,
|
|
29
27
|
menuItemClassName,
|
|
30
28
|
menuItemActiveClassName
|
|
31
29
|
} = _ref;
|
|
@@ -35,7 +33,6 @@ export const SortDropdown = props => {
|
|
|
35
33
|
field: newField,
|
|
36
34
|
direction: newDirection
|
|
37
35
|
});
|
|
38
|
-
menu.toggle();
|
|
39
36
|
};
|
|
40
37
|
|
|
41
38
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -53,7 +50,7 @@ export const SortDropdown = props => {
|
|
|
53
50
|
const isActive = field === key;
|
|
54
51
|
return /*#__PURE__*/React.createElement(MenuItem, _extends({
|
|
55
52
|
key: key
|
|
56
|
-
},
|
|
53
|
+
}, buttonProps, {
|
|
57
54
|
className: cx(buttonProps.className, menuItemClassName, css.item, isActive && menuItemActiveClassName, isActive && css.active)
|
|
58
55
|
}), /*#__PURE__*/React.createElement("span", {
|
|
59
56
|
className: css.itemLabel
|
|
@@ -3,8 +3,10 @@ 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
|
-
import
|
|
6
|
+
import * as BaseTooltip from '@radix-ui/react-tooltip';
|
|
7
7
|
import css from './tooltip.module.css';
|
|
8
|
+
const OFFSET = 9;
|
|
9
|
+
const DELAY = 200;
|
|
8
10
|
export const Tooltip = props => {
|
|
9
11
|
const {
|
|
10
12
|
className,
|
|
@@ -16,21 +18,20 @@ export const Tooltip = props => {
|
|
|
16
18
|
...restProps
|
|
17
19
|
} = props;
|
|
18
20
|
const rootClassName = cx(css.root, className);
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const tooltipClassName = cx(css.tooltip, darkMode && css.tooltipDarkMode);
|
|
22
|
+
return /*#__PURE__*/React.createElement(BaseTooltip.Provider, null, /*#__PURE__*/React.createElement(BaseTooltip.Root, {
|
|
23
|
+
delayDuration: DELAY
|
|
24
|
+
}, /*#__PURE__*/React.createElement(BaseTooltip.Trigger, {
|
|
25
|
+
asChild: true
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Component, _extends({
|
|
25
27
|
className: rootClassName
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
className: cx(css.tooltip, darkMode && css.tooltipDarkMode)
|
|
30
|
-
}), /*#__PURE__*/React.createElement(UITooltipArrow, _extends({}, tooltipProps, {
|
|
28
|
+
}, restProps), children)), title && /*#__PURE__*/React.createElement(BaseTooltip.Content, {
|
|
29
|
+
className: tooltipClassName
|
|
30
|
+
}, /*#__PURE__*/React.createElement(BaseTooltip.Arrow, {
|
|
31
31
|
className: css.arrow,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
startOffset: OFFSET,
|
|
33
|
+
offset: OFFSET
|
|
34
|
+
}), title)));
|
|
34
35
|
};
|
|
35
36
|
Tooltip.defaultProps = {
|
|
36
37
|
className: '',
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
.root {
|
|
2
|
+
appearance: none;
|
|
3
|
+
border: none;
|
|
4
|
+
background: none;
|
|
2
5
|
position: relative;
|
|
3
6
|
color: inherit;
|
|
4
7
|
line-height: inherit;
|
|
@@ -20,8 +23,7 @@
|
|
|
20
23
|
line-height: var(--space-small);
|
|
21
24
|
}
|
|
22
25
|
|
|
23
|
-
.arrow
|
|
24
|
-
display: block;
|
|
26
|
+
.arrow {
|
|
25
27
|
fill: var(--color-light);
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -30,6 +32,6 @@
|
|
|
30
32
|
color: var(--color-light);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
.tooltipDarkMode .arrow
|
|
35
|
+
.tooltipDarkMode .arrow {
|
|
34
36
|
fill: var(--color-text);
|
|
35
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bundle-stats/ui",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.4-alpha.0",
|
|
4
4
|
"description": "UI components for BundleStats projects.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -36,38 +36,38 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/relative-ci/bundle-stats/blob/master/packages/ui#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/cli": "7.16.
|
|
40
|
-
"@babel/core": "7.16.
|
|
41
|
-
"@babel/plugin-proposal-class-properties": "7.16.
|
|
42
|
-
"@babel/preset-env": "7.16.
|
|
43
|
-
"@babel/preset-react": "7.16.
|
|
39
|
+
"@babel/cli": "7.16.8",
|
|
40
|
+
"@babel/core": "7.16.7",
|
|
41
|
+
"@babel/plugin-proposal-class-properties": "7.16.7",
|
|
42
|
+
"@babel/preset-env": "7.16.8",
|
|
43
|
+
"@babel/preset-react": "7.16.7",
|
|
44
44
|
"@simplyianm/babel-plugin-inline-react-svg": "1.2.0",
|
|
45
45
|
"@storybook/addon-knobs": "6.4.0",
|
|
46
46
|
"@storybook/addon-postcss": "2.0.0",
|
|
47
|
-
"@storybook/addon-storyshots": "6.4.
|
|
48
|
-
"@storybook/addons": "6.4.
|
|
49
|
-
"@storybook/builder-webpack5": "6.4.
|
|
50
|
-
"@storybook/manager-webpack5": "6.4.
|
|
51
|
-
"@storybook/react": "6.4.
|
|
47
|
+
"@storybook/addon-storyshots": "6.4.12",
|
|
48
|
+
"@storybook/addons": "6.4.12",
|
|
49
|
+
"@storybook/builder-webpack5": "6.4.12",
|
|
50
|
+
"@storybook/manager-webpack5": "6.4.12",
|
|
51
|
+
"@storybook/react": "6.4.12",
|
|
52
52
|
"babel-core": "7.0.0-bridge.0",
|
|
53
|
-
"babel-jest": "27.4.
|
|
53
|
+
"babel-jest": "27.4.6",
|
|
54
54
|
"babel-plugin-lodash": "3.3.4",
|
|
55
55
|
"babel-plugin-require-context-hook": "1.0.0",
|
|
56
|
-
"chromatic": "6.
|
|
56
|
+
"chromatic": "6.3.4",
|
|
57
57
|
"classnames": "2.3.1",
|
|
58
58
|
"colormap": "2.3.2",
|
|
59
|
-
"core-js": "3.20.
|
|
59
|
+
"core-js": "3.20.2",
|
|
60
60
|
"cross-env": "7.0.3",
|
|
61
61
|
"enzyme": "3.11.0",
|
|
62
62
|
"enzyme-adapter-react-16": "1.15.6",
|
|
63
63
|
"enzyme-to-json": "3.6.2",
|
|
64
64
|
"hex-rgb": "5.0.0",
|
|
65
65
|
"identity-obj-proxy": "3.0.0",
|
|
66
|
-
"jest": "27.4.
|
|
66
|
+
"jest": "27.4.7",
|
|
67
67
|
"jest-date-mock": "1.0.8",
|
|
68
68
|
"lodash": "4.17.21",
|
|
69
69
|
"postcss": "8.4.5",
|
|
70
|
-
"prop-types": "15.
|
|
70
|
+
"prop-types": "15.8.1",
|
|
71
71
|
"react": "16.14.0",
|
|
72
72
|
"react-dom": "16.14.0",
|
|
73
73
|
"react-router-dom": "5.3.0",
|
|
@@ -84,11 +84,14 @@
|
|
|
84
84
|
"react-router-dom": "5.3.0"
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@bundle-stats/utils": "^3.2.
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
87
|
+
"@bundle-stats/utils": "^3.2.4-alpha.0",
|
|
88
|
+
"@radix-ui/react-dropdown-menu": "0.1.3",
|
|
89
|
+
"@radix-ui/react-hover-card": "0.1.3",
|
|
90
|
+
"@radix-ui/react-tooltip": "0.1.3",
|
|
91
|
+
"date-fns": "2.28.0",
|
|
92
|
+
"query-string": "7.1.0",
|
|
93
|
+
"reakit": "1.3.11",
|
|
94
|
+
"use-query-params": "1.2.3"
|
|
92
95
|
},
|
|
93
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "4387528449c1ea441c018705c2d08437b2352797"
|
|
94
97
|
}
|