@bundle-stats/ui 3.2.5 → 3.2.6-beta.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.
- package/CHANGELOG.md +19 -0
- package/lib/components/bundle-assets/bundle-assets.js +15 -7
- package/lib/components/bundle-assets/bundle-assets.module.css +13 -26
- package/lib/components/bundle-packages/bundle-packages.js +8 -4
- package/lib/components/bundle-packages/bundle-packages.module.css +4 -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/css/variables.css +4 -4
- package/lib/layout/box/box.module.css +9 -0
- package/lib/ui/dropdown/dropdown.js +1 -2
- package/lib/ui/dropdown/dropdown.module.css +7 -8
- package/lib/ui/filters/filters.js +10 -5
- package/lib/ui/filters/filters.module.css +10 -0
- package/lib/ui/index.js +8 -0
- package/lib/ui/table/table.module.css +0 -4
- package/lib/ui/tag/index.js +18 -0
- 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.module.css +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.js +14 -7
- package/lib-esm/components/bundle-assets/bundle-assets.module.css +13 -26
- package/lib-esm/components/bundle-packages/bundle-packages.js +7 -4
- package/lib-esm/components/bundle-packages/bundle-packages.module.css +4 -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/css/variables.css +4 -4
- package/lib-esm/layout/box/box.module.css +9 -0
- package/lib-esm/ui/dropdown/dropdown.js +1 -2
- package/lib-esm/ui/dropdown/dropdown.module.css +7 -8
- package/lib-esm/ui/filters/filters.js +9 -4
- package/lib-esm/ui/filters/filters.module.css +10 -0
- package/lib-esm/ui/index.js +1 -0
- 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.module.css +1 -1
- package/package.json +7 -7
- package/src/components/bundle-assets/bundle-assets.jsx +58 -41
- package/src/components/bundle-assets/bundle-assets.module.css +13 -26
- package/src/components/bundle-packages/bundle-packages.jsx +10 -5
- package/src/components/bundle-packages/bundle-packages.module.css +4 -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/css/variables.css +4 -4
- package/src/layout/box/box.module.css +9 -0
- package/src/ui/dropdown/dropdown.jsx +4 -6
- package/src/ui/dropdown/dropdown.module.css +7 -8
- package/src/ui/filters/filters.jsx +53 -50
- package/src/ui/filters/filters.module.css +10 -0
- package/src/ui/index.js +1 -0
- 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.module.css +1 -1
|
@@ -30,41 +30,28 @@
|
|
|
30
30
|
display: none;
|
|
31
31
|
}
|
|
32
32
|
|
|
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 {
|
|
33
|
+
.tag + .tag {
|
|
49
34
|
margin-left: 2px;
|
|
50
35
|
}
|
|
51
36
|
|
|
52
|
-
.
|
|
53
|
-
composes: flag;
|
|
37
|
+
.tagEntry {
|
|
54
38
|
background: var(--color-info-light);
|
|
55
|
-
color: var(--color-background);
|
|
56
39
|
}
|
|
57
40
|
|
|
58
|
-
.
|
|
59
|
-
|
|
41
|
+
.tagEntry::before {
|
|
42
|
+
content: 'e';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.tagInitial {
|
|
60
46
|
background: var(--color-info-light);
|
|
61
|
-
color: var(--color-background);
|
|
62
47
|
}
|
|
63
48
|
|
|
64
|
-
.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
49
|
+
.tagInitial::before {
|
|
50
|
+
content: 'i';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.tagChunk::before {
|
|
54
|
+
content: 'c';
|
|
68
55
|
}
|
|
69
56
|
|
|
70
57
|
/* Tooltip not predictive */
|
|
@@ -12,6 +12,7 @@ import { EmptySet } from '../../ui/empty-set';
|
|
|
12
12
|
import { Filters } from '../../ui/filters';
|
|
13
13
|
import { Popover } from '../../ui/popover';
|
|
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,10 +90,12 @@ 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
|
-
|
|
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
|
+
});
|
|
96
99
|
return /*#__PURE__*/React.createElement(Popover, {
|
|
97
100
|
className: css.packageName,
|
|
98
101
|
icon: duplicateFlag,
|
|
@@ -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 {
|
|
@@ -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);
|
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
--color-outline-warning: var(--color-yellow-200);
|
|
171
171
|
--color-outline-danger: var(--color-red-100);
|
|
172
172
|
|
|
173
|
-
--color-shadow: rgba(0, 0, 0, 0.
|
|
173
|
+
--color-shadow: rgba(0, 0, 0, 0.1);
|
|
174
174
|
|
|
175
175
|
--transition-in: all 0.2s ease-in;
|
|
176
176
|
--transition-out: all 0.17s ease-out;
|
|
@@ -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;
|
|
@@ -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 {
|
|
@@ -25,8 +25,7 @@ export const Dropdown = props => {
|
|
|
25
25
|
className: rootClassName,
|
|
26
26
|
tabIndex: null
|
|
27
27
|
}), /*#__PURE__*/React.createElement(FlexStack, {
|
|
28
|
-
space: "xxxsmall"
|
|
29
|
-
className: css.label
|
|
28
|
+
space: "xxxsmall"
|
|
30
29
|
}, glyph && /*#__PURE__*/React.createElement(Icon, {
|
|
31
30
|
className: css.labelIcon,
|
|
32
31
|
glyph: glyph
|
|
@@ -2,15 +2,9 @@
|
|
|
2
2
|
background: none;
|
|
3
3
|
border: none;
|
|
4
4
|
padding: 0;
|
|
5
|
-
}
|
|
6
5
|
|
|
7
|
-
.root:focus {
|
|
8
|
-
outline: none;
|
|
9
|
-
box-shadow: 0 0 var(--space-xxxsmall) var(--color-shadow);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.label {
|
|
13
6
|
border: 1px solid var(--color-outline);
|
|
7
|
+
border-radius: var(--radius-small);
|
|
14
8
|
padding: calc(var(--space-xxsmall) - 1px);
|
|
15
9
|
display: flex;
|
|
16
10
|
align-items: center;
|
|
@@ -24,7 +18,11 @@
|
|
|
24
18
|
color: var(--color-text-light);
|
|
25
19
|
}
|
|
26
20
|
|
|
27
|
-
.
|
|
21
|
+
.root:hover,
|
|
22
|
+
.root:focus,
|
|
23
|
+
.root:active {
|
|
24
|
+
outline: none;
|
|
25
|
+
box-shadow: 0 0 var(--space-xxxsmall) var(--color-shadow);
|
|
28
26
|
border-color: var(--color-outline-dark);
|
|
29
27
|
color: var(--color-text);
|
|
30
28
|
}
|
|
@@ -33,6 +31,7 @@
|
|
|
33
31
|
position: absolute;
|
|
34
32
|
left: 0;
|
|
35
33
|
top: 100%;
|
|
34
|
+
border-radius: var(--radius-medium);
|
|
36
35
|
box-shadow: 0 2px var(--space-xxsmall) var(--color-shadow);
|
|
37
36
|
background: var(--color-background);
|
|
38
37
|
min-width: 180px;
|
|
@@ -54,6 +54,7 @@ Filter.defaultProps = {
|
|
|
54
54
|
|
|
55
55
|
const FilterGroup = props => {
|
|
56
56
|
const {
|
|
57
|
+
className,
|
|
57
58
|
groupKey,
|
|
58
59
|
data,
|
|
59
60
|
values,
|
|
@@ -98,6 +99,7 @@ const FilterGroup = props => {
|
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
102
|
+
className: className,
|
|
101
103
|
label: dropdownLabel,
|
|
102
104
|
ariaLabel: `${groupLabel}: ${filterSuffix}`
|
|
103
105
|
}, _ref4 => {
|
|
@@ -147,6 +149,7 @@ const FilterGroup = props => {
|
|
|
147
149
|
};
|
|
148
150
|
|
|
149
151
|
FilterGroup.propTypes = {
|
|
152
|
+
className: PropTypes.string,
|
|
150
153
|
groupKey: PropTypes.string.isRequired,
|
|
151
154
|
data: PropTypes.object.isRequired,
|
|
152
155
|
// eslint-disable-line react/forbid-prop-types
|
|
@@ -155,6 +158,9 @@ FilterGroup.propTypes = {
|
|
|
155
158
|
onCheckboxChange: PropTypes.func.isRequired,
|
|
156
159
|
toggleFilters: PropTypes.func.isRequired
|
|
157
160
|
};
|
|
161
|
+
FilterGroup.defaultProps = {
|
|
162
|
+
className: ''
|
|
163
|
+
};
|
|
158
164
|
export const Filters = props => {
|
|
159
165
|
const {
|
|
160
166
|
className,
|
|
@@ -191,16 +197,15 @@ export const Filters = props => {
|
|
|
191
197
|
});
|
|
192
198
|
}
|
|
193
199
|
|
|
194
|
-
return /*#__PURE__*/React.createElement(
|
|
195
|
-
className: css.item
|
|
196
|
-
}, /*#__PURE__*/React.createElement(FilterGroup, {
|
|
200
|
+
return /*#__PURE__*/React.createElement(FilterGroup, {
|
|
201
|
+
className: css.item,
|
|
197
202
|
key: name,
|
|
198
203
|
groupKey: name,
|
|
199
204
|
data: data,
|
|
200
205
|
values: values,
|
|
201
206
|
onCheckboxChange: onCheckboxChange,
|
|
202
207
|
toggleFilters: toggleFilters
|
|
203
|
-
})
|
|
208
|
+
});
|
|
204
209
|
})));
|
|
205
210
|
};
|
|
206
211
|
Filters.defaultProps = {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.filterInput {
|
|
14
|
+
border-radius: var(--radius-small) 0 0 var(--radius-small);
|
|
14
15
|
flex: 0 0 auto;
|
|
15
16
|
height: 1em;
|
|
16
17
|
cursor: pointer;
|
|
@@ -129,11 +130,20 @@
|
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
.item {
|
|
133
|
+
border-radius: 0;
|
|
132
134
|
position: relative;
|
|
133
135
|
flex: 0 0 auto;
|
|
134
136
|
margin-right: -1px;
|
|
135
137
|
}
|
|
136
138
|
|
|
139
|
+
.item:first-child {
|
|
140
|
+
border-radius: var(--radius-small) 0 0 var(--radius-small);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.item:last-child {
|
|
144
|
+
border-radius: 0 var(--radius-small) var(--radius-small) 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
137
147
|
.item:hover {
|
|
138
148
|
z-index: var(--layer-low); /* show collapsed border */
|
|
139
149
|
}
|
package/lib-esm/ui/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tag';
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
import React from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import cx from 'classnames';
|
|
6
|
+
import css from './tag.module.css';
|
|
7
|
+
export const KINDS = {
|
|
8
|
+
DEFAULT: 'default',
|
|
9
|
+
SUCCESS: 'success',
|
|
10
|
+
INFO: 'info',
|
|
11
|
+
WARNING: 'warning',
|
|
12
|
+
DANGER: 'danger'
|
|
13
|
+
};
|
|
14
|
+
export const SIZES = {
|
|
15
|
+
SMALL: 'small',
|
|
16
|
+
MEDIUM: 'medium',
|
|
17
|
+
LARGE: 'large'
|
|
18
|
+
};
|
|
19
|
+
export const Tag = props => {
|
|
20
|
+
const {
|
|
21
|
+
className = '',
|
|
22
|
+
as: Component = 'span',
|
|
23
|
+
kind = KINDS.DEFAULT,
|
|
24
|
+
size = SIZES.MEDIUM,
|
|
25
|
+
...restProps
|
|
26
|
+
} = props;
|
|
27
|
+
const rootClassName = cx(css.root, className, css[kind], css[size]);
|
|
28
|
+
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
29
|
+
className: rootClassName
|
|
30
|
+
}, restProps));
|
|
31
|
+
};
|
|
32
|
+
Tag.propTypes = {
|
|
33
|
+
className: PropTypes.string,
|
|
34
|
+
as: PropTypes.elementType,
|
|
35
|
+
kind: PropTypes.oneOf(Object.values(KINDS)),
|
|
36
|
+
size: PropTypes.oneOf(Object.values(SIZES))
|
|
37
|
+
};
|
|
38
|
+
Tag.defaultProps = {
|
|
39
|
+
className: '',
|
|
40
|
+
as: 'span',
|
|
41
|
+
kind: KINDS.DEFAULT,
|
|
42
|
+
size: SIZES.MEDIUM
|
|
43
|
+
};
|
|
44
|
+
Tag.KINDS = KINDS;
|
|
45
|
+
Tag.SIZES = SIZES;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
font-family: var(--font-family);
|
|
4
|
+
font-weight: bold;
|
|
5
|
+
background: var(--color-text-light);
|
|
6
|
+
color: var(--color-light);
|
|
7
|
+
text-align: center;
|
|
8
|
+
text-transform: uppercase;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Kind variation */
|
|
12
|
+
.success {
|
|
13
|
+
background: var(--color-success);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.info {
|
|
17
|
+
background: var(--color-info);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.warning {
|
|
21
|
+
background: var(--color-warning-dark);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.danger {
|
|
25
|
+
background: var(--color-danger);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Size variation */
|
|
29
|
+
/** default: medium */
|
|
30
|
+
.root {
|
|
31
|
+
border-radius: var(--radius-medium);
|
|
32
|
+
padding: var(--space-xxxsmall);
|
|
33
|
+
min-width: var(--space-small);
|
|
34
|
+
height: var(--space-small);
|
|
35
|
+
font-size: 9px;
|
|
36
|
+
line-height: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.small {
|
|
40
|
+
border-radius: var(--radius-small);
|
|
41
|
+
padding: calc(var(--space-xxxsmall) / 2);
|
|
42
|
+
height: var(--space-xsmall);
|
|
43
|
+
min-width: var(--space-xsmall);
|
|
44
|
+
font-size: 8px;
|
|
45
|
+
line-height: 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.large {
|
|
49
|
+
border-radius: var(--radius-large);
|
|
50
|
+
padding: var(--space-xxxsmall) var(--space-xxsmall);
|
|
51
|
+
min-width: var(--space-medium);
|
|
52
|
+
height: var(--space-medium);
|
|
53
|
+
font-size: 12px;
|
|
54
|
+
line-height: var(--space-small);
|
|
55
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Tag } from '.';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'UI/Tag',
|
|
4
|
+
component: Tag,
|
|
5
|
+
argTypes: {
|
|
6
|
+
kind: {
|
|
7
|
+
control: 'select',
|
|
8
|
+
options: Object.values(Tag.KINDS)
|
|
9
|
+
},
|
|
10
|
+
size: {
|
|
11
|
+
control: 'select',
|
|
12
|
+
options: Object.values(Tag.SIZES)
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
children: 'tag'
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export const Default = Tag.bind();
|
|
20
|
+
export const OneLetter = Tag.bind();
|
|
21
|
+
OneLetter.args = {
|
|
22
|
+
children: 'd'
|
|
23
|
+
};
|
|
@@ -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));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bundle-stats/ui",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.6-beta.1",
|
|
4
4
|
"description": "UI components for BundleStats projects.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/relative-ci/bundle-stats/blob/master/packages/ui#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/cli": "7.17.
|
|
40
|
-
"@babel/core": "7.17.
|
|
39
|
+
"@babel/cli": "7.17.6",
|
|
40
|
+
"@babel/core": "7.17.5",
|
|
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",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"babel-jest": "27.5.1",
|
|
55
55
|
"babel-plugin-lodash": "3.3.4",
|
|
56
56
|
"babel-plugin-require-context-hook": "1.0.0",
|
|
57
|
-
"chromatic": "6.
|
|
57
|
+
"chromatic": "6.5.1",
|
|
58
58
|
"classnames": "2.3.1",
|
|
59
59
|
"colormap": "2.3.2",
|
|
60
60
|
"core-js": "3.20.2",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"jest": "27.5.1",
|
|
68
68
|
"jest-date-mock": "1.0.8",
|
|
69
69
|
"lodash": "4.17.21",
|
|
70
|
-
"postcss": "8.4.
|
|
70
|
+
"postcss": "8.4.7",
|
|
71
71
|
"prop-types": "15.8.1",
|
|
72
72
|
"react": "16.14.0",
|
|
73
73
|
"react-dom": "16.14.0",
|
|
@@ -85,12 +85,12 @@
|
|
|
85
85
|
"react-router-dom": "5.3.0"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@bundle-stats/utils": "^3.2.
|
|
88
|
+
"@bundle-stats/utils": "^3.2.6-beta.1",
|
|
89
89
|
"date-fns": "2.28.0",
|
|
90
90
|
"modern-css-reset": "1.4.0",
|
|
91
91
|
"query-string": "7.1.1",
|
|
92
92
|
"reakit": "1.3.11",
|
|
93
93
|
"use-query-params": "1.2.3"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "7131e3602cc523fb84d8dc712f88fb5b47773f70"
|
|
96
96
|
}
|
|
@@ -2,7 +2,12 @@ import React, { useMemo } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import { get, map } from 'lodash';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
ASSET_ENTRY_TYPE,
|
|
7
|
+
ASSET_FILE_TYPE,
|
|
8
|
+
ASSET_FILTERS,
|
|
9
|
+
FILE_TYPE_LABELS,
|
|
10
|
+
} from '@bundle-stats/utils';
|
|
6
11
|
|
|
7
12
|
import config from '../../config.json';
|
|
8
13
|
import I18N from '../../i18n';
|
|
@@ -11,6 +16,7 @@ import { Icon } from '../../ui/icon';
|
|
|
11
16
|
import { FileName } from '../../ui/file-name';
|
|
12
17
|
import { Popover } from '../../ui/popover';
|
|
13
18
|
import { Tooltip } from '../../ui/tooltip';
|
|
19
|
+
import { Tag } from '../../ui/tag';
|
|
14
20
|
import { Filters } from '../../ui/filters';
|
|
15
21
|
import { SortDropdown } from '../../ui/sort-dropdown';
|
|
16
22
|
import { EmptySet } from '../../ui/empty-set';
|
|
@@ -71,47 +77,58 @@ TooltipNotPredictive.propTypes = {
|
|
|
71
77
|
runs: PropTypes.array, // eslint-disable-line react/forbid-prop-types
|
|
72
78
|
};
|
|
73
79
|
|
|
74
|
-
const getRenderRowHeader =
|
|
75
|
-
|
|
80
|
+
const getRenderRowHeader =
|
|
81
|
+
({ labels, CustomComponentLink, chunks }) =>
|
|
82
|
+
(item) => {
|
|
83
|
+
const { label, isNotPredictive, runs, isChunk, isEntry, isInitial } = item;
|
|
76
84
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
85
|
+
return (
|
|
86
|
+
<Popover
|
|
87
|
+
label={<FileName name={label} />}
|
|
88
|
+
icon={
|
|
89
|
+
<div className={css.assetInfoFlags}>
|
|
90
|
+
{isNotPredictive && (
|
|
91
|
+
<Tooltip className={css.notPredictive} title={<TooltipNotPredictive runs={runs} />}>
|
|
92
|
+
<Icon className={css.notPredictiveIcon} glyph="warning" />
|
|
93
|
+
</Tooltip>
|
|
94
|
+
)}
|
|
95
|
+
{isChunk && (
|
|
96
|
+
<Tag
|
|
97
|
+
title="Chunk"
|
|
98
|
+
size={Tag.SIZES.SMALL}
|
|
99
|
+
kind={Tag.KINDS.INFO}
|
|
100
|
+
className={cx(css.tag, css.tagChunk)}
|
|
101
|
+
/>
|
|
102
|
+
)}
|
|
103
|
+
{isEntry && (
|
|
104
|
+
<Tag
|
|
105
|
+
title="Entrypoint"
|
|
106
|
+
size={Tag.SIZES.SMALL}
|
|
107
|
+
kind={Tag.KINDS.INFO}
|
|
108
|
+
className={cx(css.tag, css.tagEntry)}
|
|
109
|
+
/>
|
|
110
|
+
)}
|
|
111
|
+
{isInitial && (
|
|
112
|
+
<Tag
|
|
113
|
+
title="Initial"
|
|
114
|
+
size={Tag.SIZES.SMALL}
|
|
115
|
+
kind={Tag.KINDS.INFO}
|
|
116
|
+
className={cx(css.tag, css.tagInitial)}
|
|
117
|
+
/>
|
|
118
|
+
)}
|
|
119
|
+
</div>
|
|
120
|
+
}
|
|
121
|
+
>
|
|
122
|
+
<AssetInfo
|
|
123
|
+
className={css.assetInfo}
|
|
124
|
+
item={item}
|
|
125
|
+
labels={labels}
|
|
126
|
+
chunks={chunks}
|
|
127
|
+
CustomComponentLink={CustomComponentLink}
|
|
128
|
+
/>
|
|
129
|
+
</Popover>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
115
132
|
|
|
116
133
|
export const BundleAssets = (props) => {
|
|
117
134
|
const {
|