@bundle-stats/ui 3.2.5 → 3.2.6-beta.3
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 +29 -0
- package/lib/components/bundle-assets/bundle-assets.js +23 -13
- package/lib/components/bundle-assets/bundle-assets.module.css +18 -26
- package/lib/components/bundle-modules/bundle-modules.js +4 -5
- package/lib/components/bundle-packages/bundle-packages.js +14 -8
- package/lib/components/bundle-packages/bundle-packages.module.css +8 -12
- package/lib/components/delta/delta.module.css +1 -0
- package/lib/components/metrics-table-search/metrics-table-search.module.css +5 -4
- package/lib/components/metrics-table-title/metrics-table-title.js +9 -7
- package/lib/components/metrics-table-title/metrics-table-title.module.css +2 -0
- package/lib/components/module-info/module-info.module.css +1 -0
- package/lib/components/summary-item/summary-item.js +14 -17
- package/lib/components/summary-item/summary-item.module.css +1 -19
- package/lib/components/total-size-type-title/total-size-type-title.js +7 -3
- package/lib/css/variables.css +3 -3
- package/lib/hooks/search-params.js +6 -6
- package/lib/layout/box/box.module.css +9 -0
- package/lib/ui/dropdown/dropdown.js +16 -26
- package/lib/ui/dropdown/dropdown.module.css +11 -12
- package/lib/ui/dropdown/dropdown.stories.js +2 -9
- package/lib/ui/filters/filters.js +10 -5
- package/lib/ui/filters/filters.module.css +10 -0
- package/lib/ui/hover-card/hover-card.js +100 -0
- package/lib/ui/hover-card/hover-card.module.css +52 -0
- package/lib/ui/hover-card/hover-card.stories.js +56 -0
- package/lib/ui/hover-card/index.js +18 -0
- package/lib/ui/icon/icon.js +6 -6
- package/lib/ui/index.js +8 -8
- package/lib/ui/table/table.module.css +0 -4
- package/lib/ui/{popover → tag}/index.js +4 -4
- package/lib/ui/tag/tag.js +72 -0
- package/lib/ui/tag/tag.module.css +55 -0
- package/lib/ui/tag/tag.stories.js +38 -0
- package/lib/ui/tooltip/tooltip.js +10 -9
- package/lib/ui/tooltip/tooltip.module.css +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.js +22 -13
- package/lib-esm/components/bundle-assets/bundle-assets.module.css +18 -26
- package/lib-esm/components/bundle-modules/bundle-modules.js +4 -5
- package/lib-esm/components/bundle-packages/bundle-packages.js +13 -8
- package/lib-esm/components/bundle-packages/bundle-packages.module.css +8 -12
- package/lib-esm/components/delta/delta.module.css +1 -0
- package/lib-esm/components/metrics-table-search/metrics-table-search.module.css +5 -4
- package/lib-esm/components/metrics-table-title/metrics-table-title.js +8 -7
- package/lib-esm/components/metrics-table-title/metrics-table-title.module.css +2 -0
- package/lib-esm/components/module-info/module-info.module.css +1 -0
- package/lib-esm/components/summary-item/summary-item.js +13 -17
- package/lib-esm/components/summary-item/summary-item.module.css +1 -19
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +6 -3
- package/lib-esm/css/variables.css +3 -3
- package/lib-esm/hooks/search-params.js +6 -6
- package/lib-esm/layout/box/box.module.css +9 -0
- package/lib-esm/ui/dropdown/dropdown.js +15 -25
- package/lib-esm/ui/dropdown/dropdown.module.css +11 -12
- package/lib-esm/ui/dropdown/dropdown.stories.js +2 -7
- package/lib-esm/ui/filters/filters.js +9 -4
- package/lib-esm/ui/filters/filters.module.css +10 -0
- package/lib-esm/ui/hover-card/hover-card.js +86 -0
- package/lib-esm/ui/hover-card/hover-card.module.css +52 -0
- package/lib-esm/ui/hover-card/hover-card.stories.js +35 -0
- package/lib-esm/ui/hover-card/index.js +1 -0
- package/lib-esm/ui/icon/icon.js +3 -3
- package/lib-esm/ui/index.js +1 -1
- package/lib-esm/ui/table/table.module.css +0 -4
- package/lib-esm/ui/tag/index.js +1 -0
- package/lib-esm/ui/tag/tag.js +45 -0
- package/lib-esm/ui/tag/tag.module.css +55 -0
- package/lib-esm/ui/tag/tag.stories.js +23 -0
- package/lib-esm/ui/tooltip/tooltip.js +10 -9
- package/lib-esm/ui/tooltip/tooltip.module.css +1 -1
- package/package.json +9 -9
- package/src/components/bundle-assets/bundle-assets.jsx +61 -42
- package/src/components/bundle-assets/bundle-assets.module.css +18 -26
- package/src/components/bundle-modules/bundle-modules.jsx +24 -14
- package/src/components/bundle-packages/bundle-packages.jsx +21 -8
- package/src/components/bundle-packages/bundle-packages.module.css +8 -12
- package/src/components/delta/delta.module.css +1 -0
- package/src/components/metrics-table-search/metrics-table-search.module.css +5 -4
- package/src/components/metrics-table-title/metrics-table-title.jsx +20 -21
- package/src/components/metrics-table-title/metrics-table-title.module.css +2 -0
- package/src/components/module-info/module-info.jsx +1 -5
- package/src/components/module-info/module-info.module.css +1 -0
- package/src/components/summary-item/summary-item.jsx +20 -26
- package/src/components/summary-item/summary-item.module.css +1 -19
- package/src/components/total-size-type-title/total-size-type-title.jsx +6 -9
- package/src/css/variables.css +3 -3
- package/src/hooks/search-params.js +18 -11
- package/src/layout/box/box.module.css +9 -0
- package/src/ui/dropdown/dropdown.jsx +12 -22
- package/src/ui/dropdown/dropdown.module.css +11 -12
- package/src/ui/filters/filters.jsx +53 -50
- package/src/ui/filters/filters.module.css +10 -0
- package/src/ui/hover-card/hover-card.jsx +79 -0
- package/src/ui/hover-card/hover-card.module.css +52 -0
- package/src/ui/hover-card/index.js +1 -0
- package/src/ui/icon/icon.jsx +11 -7
- package/src/ui/index.js +1 -1
- package/src/ui/table/table.module.css +0 -4
- package/src/ui/tag/index.js +1 -0
- package/src/ui/tag/tag.jsx +49 -0
- package/src/ui/tag/tag.module.css +55 -0
- package/src/ui/tooltip/tooltip.jsx +10 -14
- package/src/ui/tooltip/tooltip.module.css +1 -1
- 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
|
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _tooltip = require("ariakit/tooltip");
|
|
15
15
|
|
|
16
16
|
var _tooltipModule = _interopRequireDefault(require("./tooltip.module.css"));
|
|
17
17
|
|
|
@@ -34,22 +34,23 @@ var Tooltip = function Tooltip(props) {
|
|
|
34
34
|
darkMode = props.darkMode,
|
|
35
35
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
36
36
|
|
|
37
|
-
var
|
|
38
|
-
var tooltipProps = (0, _Tooltip.useTooltipState)({
|
|
39
|
-
baseId: process.env.NODE_ENV === 'test' && 'id-test',
|
|
37
|
+
var tooltip = (0, _tooltip.useTooltipState)({
|
|
40
38
|
placement: 'top'
|
|
41
39
|
});
|
|
42
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(
|
|
40
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_tooltip.TooltipAnchor, _extends({
|
|
43
41
|
as: Component,
|
|
44
|
-
className:
|
|
42
|
+
className: (0, _classnames["default"])(_tooltipModule["default"].root, className),
|
|
43
|
+
state: tooltip
|
|
45
44
|
}, ref ? {
|
|
46
45
|
ref: ref
|
|
47
|
-
} : {}, restProps
|
|
46
|
+
} : {}, restProps), children), title && /*#__PURE__*/_react["default"].createElement(_tooltip.Tooltip, {
|
|
47
|
+
state: tooltip,
|
|
48
48
|
className: (0, _classnames["default"])(_tooltipModule["default"].tooltip, darkMode && _tooltipModule["default"].tooltipDarkMode)
|
|
49
|
-
}
|
|
49
|
+
}, /*#__PURE__*/_react["default"].createElement(_tooltip.TooltipArrow, {
|
|
50
|
+
state: tooltip,
|
|
50
51
|
className: _tooltipModule["default"].arrow,
|
|
51
52
|
size: 12
|
|
52
|
-
})
|
|
53
|
+
}), title));
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
exports.Tooltip = Tooltip;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
.tooltip {
|
|
14
14
|
padding: var(--space-xxxsmall) var(--space-xxsmall);
|
|
15
|
-
border-radius: var(--radius-
|
|
15
|
+
border-radius: var(--radius-medium);
|
|
16
16
|
background: var(--color-light);
|
|
17
17
|
color: var(--color-text);
|
|
18
18
|
filter: drop-shadow(0 0 var(--space-xxxsmall) var(--color-shadow));
|
|
@@ -12,8 +12,9 @@ import I18N from '../../i18n';
|
|
|
12
12
|
import { FlexStack } from '../../layout/flex-stack';
|
|
13
13
|
import { Icon } from '../../ui/icon';
|
|
14
14
|
import { FileName } from '../../ui/file-name';
|
|
15
|
-
import {
|
|
15
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
16
16
|
import { Tooltip } from '../../ui/tooltip';
|
|
17
|
+
import { Tag } from '../../ui/tag';
|
|
17
18
|
import { Filters } from '../../ui/filters';
|
|
18
19
|
import { SortDropdown } from '../../ui/sort-dropdown';
|
|
19
20
|
import { EmptySet } from '../../ui/empty-set';
|
|
@@ -86,11 +87,11 @@ const getRenderRowHeader = _ref4 => {
|
|
|
86
87
|
isEntry,
|
|
87
88
|
isInitial
|
|
88
89
|
} = item;
|
|
89
|
-
return /*#__PURE__*/React.createElement(
|
|
90
|
-
label: /*#__PURE__*/React.createElement(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
91
|
+
label: /*#__PURE__*/React.createElement(FlexStack, {
|
|
92
|
+
space: "xxxsmall",
|
|
93
|
+
className: css.assetName
|
|
94
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
94
95
|
className: css.assetInfoFlags
|
|
95
96
|
}, isNotPredictive && /*#__PURE__*/React.createElement(Tooltip, {
|
|
96
97
|
className: css.notPredictive,
|
|
@@ -100,16 +101,24 @@ const getRenderRowHeader = _ref4 => {
|
|
|
100
101
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
101
102
|
className: css.notPredictiveIcon,
|
|
102
103
|
glyph: "warning"
|
|
103
|
-
})), isChunk && /*#__PURE__*/React.createElement(
|
|
104
|
+
})), isChunk && /*#__PURE__*/React.createElement(Tag, {
|
|
104
105
|
title: "Chunk",
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
size: Tag.SIZES.SMALL,
|
|
107
|
+
kind: Tag.KINDS.INFO,
|
|
108
|
+
className: cx(css.tag, css.tagChunk)
|
|
109
|
+
}), isEntry && /*#__PURE__*/React.createElement(Tag, {
|
|
107
110
|
title: "Entrypoint",
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
size: Tag.SIZES.SMALL,
|
|
112
|
+
kind: Tag.KINDS.INFO,
|
|
113
|
+
className: cx(css.tag, css.tagEntry)
|
|
114
|
+
}), isInitial && /*#__PURE__*/React.createElement(Tag, {
|
|
110
115
|
title: "Initial",
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
size: Tag.SIZES.SMALL,
|
|
117
|
+
kind: Tag.KINDS.INFO,
|
|
118
|
+
className: cx(css.tag, css.tagInitial)
|
|
119
|
+
})), /*#__PURE__*/React.createElement(FileName, {
|
|
120
|
+
name: label
|
|
121
|
+
}))
|
|
113
122
|
}, /*#__PURE__*/React.createElement(AssetInfo, {
|
|
114
123
|
className: css.assetInfo,
|
|
115
124
|
item: item,
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
margin-right: -1px; /** collapse border */
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
.assetName {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
11
16
|
.notPredictive {
|
|
12
17
|
margin-right: var(--space-xxsmall);
|
|
13
18
|
display: inline-block;
|
|
@@ -30,41 +35,28 @@
|
|
|
30
35
|
display: none;
|
|
31
36
|
}
|
|
32
37
|
|
|
33
|
-
.
|
|
34
|
-
display: inline-block;
|
|
35
|
-
width: var(--space-xsmall);
|
|
36
|
-
height: var(--space-xsmall);
|
|
37
|
-
font-family: var(--font-family);
|
|
38
|
-
font-size: 8px;
|
|
39
|
-
font-weight: bold;
|
|
40
|
-
background: var(--color-highlight);
|
|
41
|
-
color: var(--color-text-light);
|
|
42
|
-
line-height: var(--space-xsmall);
|
|
43
|
-
text-align: center;
|
|
44
|
-
text-transform: uppercase;
|
|
45
|
-
vertical-align: middle;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.flag + .flag {
|
|
38
|
+
.tag + .tag {
|
|
49
39
|
margin-left: 2px;
|
|
50
40
|
}
|
|
51
41
|
|
|
52
|
-
.
|
|
53
|
-
composes: flag;
|
|
42
|
+
.tagEntry {
|
|
54
43
|
background: var(--color-info-light);
|
|
55
|
-
color: var(--color-background);
|
|
56
44
|
}
|
|
57
45
|
|
|
58
|
-
.
|
|
59
|
-
|
|
46
|
+
.tagEntry::before {
|
|
47
|
+
content: 'e';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.tagInitial {
|
|
60
51
|
background: var(--color-info-light);
|
|
61
|
-
color: var(--color-background);
|
|
62
52
|
}
|
|
63
53
|
|
|
64
|
-
.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
54
|
+
.tagInitial::before {
|
|
55
|
+
content: 'i';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.tagChunk::before {
|
|
59
|
+
content: 'c';
|
|
68
60
|
}
|
|
69
61
|
|
|
70
62
|
/* Tooltip not predictive */
|
|
@@ -15,7 +15,7 @@ import { FlexStack } from '../../layout/flex-stack';
|
|
|
15
15
|
import { EmptySet } from '../../ui/empty-set';
|
|
16
16
|
import { FileName } from '../../ui/file-name';
|
|
17
17
|
import { Filters } from '../../ui/filters';
|
|
18
|
-
import {
|
|
18
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
19
19
|
import { SortDropdown } from '../../ui/sort-dropdown';
|
|
20
20
|
import { Toolbar } from '../../ui/toolbar';
|
|
21
21
|
import { MetricsTable } from '../metrics-table';
|
|
@@ -42,12 +42,11 @@ const RowHeader = _ref => {
|
|
|
42
42
|
});
|
|
43
43
|
return /*#__PURE__*/React.createElement("div", {
|
|
44
44
|
onMouseEnter: handleOnMouseEnter
|
|
45
|
-
}, !showPopopver ? content : /*#__PURE__*/React.createElement(
|
|
46
|
-
ariaLabel: "View module info",
|
|
45
|
+
}, !showPopopver ? content : /*#__PURE__*/React.createElement(HoverCard, {
|
|
47
46
|
label: content
|
|
48
47
|
}, _ref2 => {
|
|
49
48
|
let {
|
|
50
|
-
|
|
49
|
+
close
|
|
51
50
|
} = _ref2;
|
|
52
51
|
return /*#__PURE__*/React.createElement(ModuleInfo, {
|
|
53
52
|
className: css.namePopover,
|
|
@@ -56,7 +55,7 @@ const RowHeader = _ref => {
|
|
|
56
55
|
chunkIds: chunkIds,
|
|
57
56
|
labels: labels,
|
|
58
57
|
customComponentLink: CustomComponentLink,
|
|
59
|
-
onClick:
|
|
58
|
+
onClick: close
|
|
60
59
|
});
|
|
61
60
|
}));
|
|
62
61
|
};
|
|
@@ -10,8 +10,9 @@ import { Stack } from '../../layout/stack';
|
|
|
10
10
|
import { FlexStack } from '../../layout/flex-stack';
|
|
11
11
|
import { EmptySet } from '../../ui/empty-set';
|
|
12
12
|
import { Filters } from '../../ui/filters';
|
|
13
|
-
import {
|
|
13
|
+
import { HoverCard } from '../../ui/hover-card';
|
|
14
14
|
import { SortDropdown } from '../../ui/sort-dropdown';
|
|
15
|
+
import { Tag } from '../../ui/tag';
|
|
15
16
|
import { Toolbar } from '../../ui/toolbar';
|
|
16
17
|
import { FileName } from '../../ui/file-name';
|
|
17
18
|
import { ComponentLink } from '../component-link';
|
|
@@ -89,14 +90,18 @@ const PackageRowHeader = _ref2 => {
|
|
|
89
90
|
className: css.packageNames
|
|
90
91
|
}, packageNames.map((packageName, index) => {
|
|
91
92
|
// Render duplicate flag only for the last entry
|
|
92
|
-
const duplicateFlag = index === packageNames.length - 1 && item.duplicate && /*#__PURE__*/React.createElement(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
const duplicateFlag = index === packageNames.length - 1 && item.duplicate && /*#__PURE__*/React.createElement(Tag, {
|
|
94
|
+
title: "Duplicate package",
|
|
95
|
+
kind: Tag.KINDS.DANGER,
|
|
96
|
+
size: Tag.SIZES.SMALL,
|
|
97
|
+
className: css.tagDuplicate
|
|
98
|
+
});
|
|
99
|
+
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
97
100
|
className: css.packageName,
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
label: /*#__PURE__*/React.createElement(FlexStack, {
|
|
102
|
+
space: "xxxsmall",
|
|
103
|
+
className: css.packageNameLabel
|
|
104
|
+
}, duplicateFlag, /*#__PURE__*/React.createElement("span", null, packageName))
|
|
100
105
|
}, /*#__PURE__*/React.createElement(PackagePopoverContent, {
|
|
101
106
|
name: packageName,
|
|
102
107
|
path: path,
|
|
@@ -12,20 +12,12 @@
|
|
|
12
12
|
margin-right: -1px; /** collapse border */
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.
|
|
15
|
+
.tagDuplicate {
|
|
16
16
|
margin-right: var(--space-xxxsmall);
|
|
17
|
-
|
|
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;
|
|
17
|
+
}
|
|
26
18
|
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
.tagDuplicate::before {
|
|
20
|
+
content: 'd';
|
|
29
21
|
}
|
|
30
22
|
|
|
31
23
|
.packageName {
|
|
@@ -43,6 +35,10 @@
|
|
|
43
35
|
color: var(--color-text-ultra-light);
|
|
44
36
|
}
|
|
45
37
|
|
|
38
|
+
.packageNameLabel {
|
|
39
|
+
align-items: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
46
42
|
.packagePopover {
|
|
47
43
|
min-width: 320px;
|
|
48
44
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.input {
|
|
8
|
+
border-radius: var(--radius-small) 0 0 var(--radius-small);
|
|
8
9
|
height: var(--space-large);
|
|
9
10
|
border-color: var(--color-outline);
|
|
10
11
|
}
|
|
@@ -21,12 +22,12 @@
|
|
|
21
22
|
cursor: pointer;
|
|
22
23
|
border-radius: 50%;
|
|
23
24
|
position: absolute;
|
|
24
|
-
right:
|
|
25
|
+
right: 2px;
|
|
25
26
|
top: 50%;
|
|
26
27
|
transform: translateY(-50%);
|
|
27
|
-
padding: var(--space-
|
|
28
|
-
width: var(--space-
|
|
29
|
-
height: var(--space-
|
|
28
|
+
padding: var(--space-xxxsmall);
|
|
29
|
+
width: var(--space-medium);
|
|
30
|
+
height: var(--space-medium);
|
|
30
31
|
background: radial-gradient(var(--color-background) 50%, transparent);
|
|
31
32
|
color: var(--color-text-ultra-light);
|
|
32
33
|
transition: var(--transition-in);
|
|
@@ -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 {
|
|
@@ -15,22 +16,22 @@ export const MetricsTableTitle = props => {
|
|
|
15
16
|
popoverHref
|
|
16
17
|
} = props;
|
|
17
18
|
const rootClassName = cx(css.root, className);
|
|
18
|
-
return /*#__PURE__*/React.createElement(
|
|
19
|
+
return /*#__PURE__*/React.createElement(FlexStack, {
|
|
19
20
|
space: "xxxsmall",
|
|
20
21
|
className: rootClassName
|
|
21
|
-
}, /*#__PURE__*/React.createElement(FlexStack, {
|
|
22
|
-
space: "xxxsmall"
|
|
23
22
|
}, /*#__PURE__*/React.createElement("span", null, title), info && /*#__PURE__*/React.createElement("span", {
|
|
24
23
|
className: css.info
|
|
25
|
-
}, info), (popoverInfo || popoverHref) && /*#__PURE__*/React.createElement(
|
|
26
|
-
|
|
24
|
+
}, info), (popoverInfo || popoverHref) && /*#__PURE__*/React.createElement(HoverCard, {
|
|
25
|
+
label: /*#__PURE__*/React.createElement(Icon, {
|
|
26
|
+
glyph: "help"
|
|
27
|
+
})
|
|
27
28
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
28
29
|
space: "xxxsmall"
|
|
29
30
|
}, popoverInfo && /*#__PURE__*/React.createElement("p", null, popoverInfo), popoverHref && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
|
|
30
31
|
href: popoverHref,
|
|
31
32
|
target: "_blank",
|
|
32
33
|
rel: "noreferrer"
|
|
33
|
-
}, I18N.READ_MORE)))))
|
|
34
|
+
}, I18N.READ_MORE)))));
|
|
34
35
|
};
|
|
35
36
|
MetricsTableTitle.propTypes = {
|
|
36
37
|
className: PropTypes.string,
|
|
@@ -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 { HoverCard } from '../../ui/hover-card';
|
|
8
|
+
import { Icon } from '../../ui/icon';
|
|
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,24 @@ 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 MetricInfo = _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
22
|
space: "xxxsmall"
|
|
28
|
-
}, /*#__PURE__*/React.createElement("p", null, description), url && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("
|
|
29
|
-
|
|
30
|
-
className: css.
|
|
31
|
-
onClick: readMoreOnClick
|
|
23
|
+
}, /*#__PURE__*/React.createElement("p", null, description), url && /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
|
|
24
|
+
href: url,
|
|
25
|
+
className: css.readMoreLink
|
|
32
26
|
}, "Read more")));
|
|
33
27
|
};
|
|
34
28
|
|
|
35
|
-
|
|
29
|
+
MetricInfo.propTypes = {
|
|
36
30
|
description: PropTypes.string.isRequired,
|
|
37
31
|
url: PropTypes.string
|
|
38
32
|
};
|
|
39
|
-
|
|
33
|
+
MetricInfo.defaultProps = {
|
|
40
34
|
url: ''
|
|
41
35
|
};
|
|
42
36
|
export const SummaryItem = _ref2 => {
|
|
@@ -70,10 +64,12 @@ export const SummaryItem = _ref2 => {
|
|
|
70
64
|
as: "h3",
|
|
71
65
|
space: "xxxsmall",
|
|
72
66
|
className: css.title
|
|
73
|
-
}, /*#__PURE__*/React.createElement("span", null, metric.label), showMetricDescriptionTooltip && /*#__PURE__*/React.createElement(
|
|
67
|
+
}, /*#__PURE__*/React.createElement("span", null, metric.label), showMetricDescriptionTooltip && /*#__PURE__*/React.createElement(HoverCard, {
|
|
74
68
|
className: css.icon,
|
|
75
|
-
|
|
76
|
-
|
|
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, {
|
|
77
73
|
className: css.currentMetric,
|
|
78
74
|
value: current,
|
|
79
75
|
formatter: metric.formatter,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.title {
|
|
2
|
+
align-items: center;
|
|
2
3
|
color: var(--color-text-ultra-light);
|
|
3
4
|
font-weight: bold;
|
|
4
5
|
font-size: var(--size-xsmall);
|
|
@@ -7,25 +8,6 @@
|
|
|
7
8
|
white-space: nowrap;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
.readMoreBtn {
|
|
11
|
-
appearance: none;
|
|
12
|
-
padding: 0;
|
|
13
|
-
border: 0;
|
|
14
|
-
background: none;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
/* simulate link */
|
|
17
|
-
color: var(--color-primary);
|
|
18
|
-
text-decoration: underline;
|
|
19
|
-
line-height: var(--space-small);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.readMoreBtn:hover,
|
|
23
|
-
.readMoreBtn:active,
|
|
24
|
-
.readMoreBtn:focus {
|
|
25
|
-
color: var(--color-primary-dark);
|
|
26
|
-
text-decoration: none;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
11
|
.currentMetric {
|
|
30
12
|
display: block;
|
|
31
13
|
color: var(--color-heading);
|
|
@@ -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", {
|
|
@@ -181,9 +181,9 @@
|
|
|
181
181
|
--layer-high: 1000;
|
|
182
182
|
--layer-xhigh: 10000;
|
|
183
183
|
|
|
184
|
-
--radius-small:
|
|
185
|
-
--radius-medium: var(--space-
|
|
186
|
-
--radius-large: var(--space-
|
|
184
|
+
--radius-small: 2px;
|
|
185
|
+
--radius-medium: var(--space-xxxsmall);
|
|
186
|
+
--radius-large: var(--space-xxsmall);
|
|
187
187
|
|
|
188
188
|
/** Layout */
|
|
189
189
|
--max-width: 80rem;
|
|
@@ -124,7 +124,7 @@ export const useSearchParams = _ref2 => {
|
|
|
124
124
|
|
|
125
125
|
useLayoutEffect(() => {
|
|
126
126
|
// Run a deep comparison to prevent circular setState triggering
|
|
127
|
-
if (parentSearch === search
|
|
127
|
+
if (parentSearch === search && _isEqual(initialFilters, filters)) {
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
130
|
|
|
@@ -132,7 +132,7 @@ export const useSearchParams = _ref2 => {
|
|
|
132
132
|
type: ACTION_SET,
|
|
133
133
|
payload: generateState(initialFilters, parentSearch)
|
|
134
134
|
});
|
|
135
|
-
}, [search, filters,
|
|
135
|
+
}, [dispatch, search, filters, parentSearch, initialFilters]);
|
|
136
136
|
/** Callbacks */
|
|
137
137
|
|
|
138
138
|
const handleUpdateSearch = useCallback(newValue => {
|
|
@@ -140,23 +140,23 @@ export const useSearchParams = _ref2 => {
|
|
|
140
140
|
type: ACTION_SET_SEARCH,
|
|
141
141
|
payload: newValue
|
|
142
142
|
});
|
|
143
|
-
}, []);
|
|
143
|
+
}, [dispatch]);
|
|
144
144
|
const handleUpdateFilters = useCallback(newFilters => {
|
|
145
145
|
dispatch({
|
|
146
146
|
type: ACTION_SET_FILTERS,
|
|
147
147
|
payload: newFilters
|
|
148
148
|
});
|
|
149
|
-
}, []);
|
|
149
|
+
}, [dispatch]);
|
|
150
150
|
const handleResetFilters = useCallback(() => {
|
|
151
151
|
dispatch({
|
|
152
152
|
type: ACTION_RESET_DEFAULT
|
|
153
153
|
});
|
|
154
|
-
}, []);
|
|
154
|
+
}, [dispatch]);
|
|
155
155
|
const handleResetAllFilters = useCallback(() => {
|
|
156
156
|
dispatch({
|
|
157
157
|
type: ACTION_RESET_ALL
|
|
158
158
|
});
|
|
159
|
-
}, []);
|
|
159
|
+
}, [dispatch]);
|
|
160
160
|
return {
|
|
161
161
|
search,
|
|
162
162
|
searchPattern,
|
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
.outline {
|
|
6
6
|
border: 1px solid var(--color-outline);
|
|
7
|
+
border-radius: var(--radius-medium);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.outline > :first-child {
|
|
11
|
+
border-radius: var(--radius-medium) var(--radius-medium) 0 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.outline > :last-child {
|
|
15
|
+
border-radius: 0 0 var(--radius-medium) var(--radius-medium);
|
|
7
16
|
}
|
|
8
17
|
|
|
9
18
|
.padding-xxxsmall {
|
|
@@ -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 { Menu,
|
|
4
|
+
import { Menu, MenuButton, MenuItem, useMenuState } from 'ariakit/menu';
|
|
7
5
|
import { FlexStack } from '../../layout/flex-stack';
|
|
8
6
|
import { Icon } from '../icon';
|
|
9
7
|
import css from './dropdown.module.css';
|
|
@@ -13,29 +11,28 @@ export const Dropdown = props => {
|
|
|
13
11
|
label,
|
|
14
12
|
ariaLabel,
|
|
15
13
|
glyph,
|
|
16
|
-
activeLabel,
|
|
17
14
|
children
|
|
18
15
|
} = props;
|
|
19
|
-
const rootClassName = cx(css.root,
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
className:
|
|
16
|
+
const rootClassName = cx(css.root, className);
|
|
17
|
+
const menuState = useMenuState();
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
className: rootClassName
|
|
20
|
+
}, /*#__PURE__*/React.createElement(MenuButton, {
|
|
21
|
+
state: menuState,
|
|
22
|
+
className: css.button,
|
|
26
23
|
tabIndex: null
|
|
27
|
-
}
|
|
28
|
-
space: "xxxsmall"
|
|
29
|
-
className: css.label
|
|
24
|
+
}, /*#__PURE__*/React.createElement(FlexStack, {
|
|
25
|
+
space: "xxxsmall"
|
|
30
26
|
}, glyph && /*#__PURE__*/React.createElement(Icon, {
|
|
31
27
|
className: css.labelIcon,
|
|
32
28
|
glyph: glyph
|
|
33
|
-
}), label)), /*#__PURE__*/React.createElement(Menu,
|
|
29
|
+
}), label)), /*#__PURE__*/React.createElement(Menu, {
|
|
30
|
+
state: menuState,
|
|
34
31
|
"aria-label": ariaLabel || label,
|
|
35
32
|
className: css.dropdown
|
|
36
|
-
}
|
|
33
|
+
}, typeof children === 'function' ? children({
|
|
37
34
|
MenuItem,
|
|
38
|
-
menu,
|
|
35
|
+
menu: menuState,
|
|
39
36
|
menuItemClassName: css.menuItem,
|
|
40
37
|
menuItemActiveClassName: css.menuItemActive
|
|
41
38
|
}) : children));
|
|
@@ -44,8 +41,7 @@ Dropdown.defaultProps = {
|
|
|
44
41
|
className: '',
|
|
45
42
|
label: null,
|
|
46
43
|
ariaLabel: '',
|
|
47
|
-
glyph: null
|
|
48
|
-
activeLabel: false
|
|
44
|
+
glyph: null
|
|
49
45
|
};
|
|
50
46
|
Dropdown.propTypes = {
|
|
51
47
|
/** Adopted child class name */
|
|
@@ -60,12 +56,6 @@ Dropdown.propTypes = {
|
|
|
60
56
|
/** Icon glyph */
|
|
61
57
|
glyph: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
62
58
|
|
|
63
|
-
/** Dropdown open state */
|
|
64
|
-
open: PropTypes.bool.isRequired,
|
|
65
|
-
|
|
66
|
-
/** Active label flag */
|
|
67
|
-
activeLabel: PropTypes.bool,
|
|
68
|
-
|
|
69
59
|
/** Content */
|
|
70
60
|
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]).isRequired
|
|
71
61
|
};
|