@bundle-stats/ui 4.8.4 → 4.9.1-beta.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/lib/components/bundle-assets/bundle-assets.js +2 -2
- package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.js +2 -2
- package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib/components/bundle-packages/bundle-packages.js +2 -2
- package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib/components/entry-info/entry-info.js +2 -1
- package/lib/components/entry-info/entry-info.js.map +1 -1
- package/lib/components/entry-info/entry-info.module.css +0 -6
- package/lib/components/index.js +1 -3
- package/lib/components/index.js.map +1 -1
- package/lib/components/metric-run-info/metric-run-info.js +2 -1
- package/lib/components/metric-run-info/metric-run-info.js.map +1 -1
- package/lib/components/metric-run-info/metric-run-info.module.css +0 -18
- package/lib/components/metrics-table/metrics-table.js +2 -1
- package/lib/components/metrics-table/metrics-table.js.map +1 -1
- package/lib/components/metrics-table/metrics-table.module.css +0 -18
- package/lib/components/metrics-table-title/metrics-table-title.js +2 -1
- package/lib/components/metrics-table-title/metrics-table-title.js.map +1 -1
- package/lib/components/metrics-table-title/metrics-table-title.module.css +0 -18
- package/lib/components/sort-button/sort-button.js +4 -3
- package/lib/components/sort-button/sort-button.js.map +1 -1
- package/lib/components/sort-button/sort-button.module.css +0 -10
- package/lib/components/summary/summary.module.css +0 -18
- package/lib/components/total-size-type-title/total-size-type-title.js +2 -1
- package/lib/components/total-size-type-title/total-size-type-title.js.map +1 -1
- package/lib/components/total-size-type-title/total-size-type-title.module.css +0 -18
- package/lib/css/variables.css +14 -14
- package/lib/ui/button/button.js +34 -0
- package/lib/ui/button/button.js.map +1 -0
- package/lib/ui/button/button.module.css +285 -0
- package/lib/{components/metrics-table-search → ui/button}/index.js +1 -1
- package/lib/ui/button/index.js.map +1 -0
- package/lib/ui/dropdown/dropdown.module.css +1 -3
- package/lib/ui/empty-set/empty-set.js +4 -3
- package/lib/ui/empty-set/empty-set.js.map +1 -1
- package/lib/ui/empty-set/empty-set.module.css +0 -17
- package/lib/ui/filters/filters.i18n.js +5 -1
- package/lib/ui/filters/filters.i18n.js.map +1 -1
- package/lib/ui/filters/filters.js +24 -7
- package/lib/ui/filters/filters.js.map +1 -1
- package/lib/ui/filters/filters.module.css +13 -36
- package/lib/ui/index.js +5 -1
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/input/index.js.map +1 -1
- package/lib/ui/input/input.js +2 -10
- package/lib/ui/input/input.js.map +1 -1
- package/lib/ui/input-search/index.js +18 -0
- package/lib/ui/input-search/index.js.map +1 -0
- package/lib/ui/input-search/input-search.js +64 -0
- package/lib/ui/input-search/input-search.js.map +1 -0
- package/lib/{components/metrics-table-search/metrics-table-search.module.css → ui/input-search/input-search.module.css} +1 -18
- package/lib-esm/components/bundle-assets/bundle-assets.js +2 -2
- package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.js +2 -2
- package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib-esm/components/bundle-packages/bundle-packages.js +2 -2
- package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib-esm/components/entry-info/entry-info.js +2 -1
- package/lib-esm/components/entry-info/entry-info.js.map +1 -1
- package/lib-esm/components/entry-info/entry-info.module.css +0 -6
- package/lib-esm/components/index.js +0 -1
- package/lib-esm/components/index.js.map +1 -1
- package/lib-esm/components/metric-run-info/metric-run-info.js +2 -1
- package/lib-esm/components/metric-run-info/metric-run-info.js.map +1 -1
- package/lib-esm/components/metric-run-info/metric-run-info.module.css +0 -18
- package/lib-esm/components/metrics-table/metrics-table.js +2 -1
- package/lib-esm/components/metrics-table/metrics-table.js.map +1 -1
- package/lib-esm/components/metrics-table/metrics-table.module.css +0 -18
- package/lib-esm/components/metrics-table-title/metrics-table-title.js +2 -1
- package/lib-esm/components/metrics-table-title/metrics-table-title.js.map +1 -1
- package/lib-esm/components/metrics-table-title/metrics-table-title.module.css +0 -18
- package/lib-esm/components/sort-button/sort-button.js +4 -3
- package/lib-esm/components/sort-button/sort-button.js.map +1 -1
- package/lib-esm/components/sort-button/sort-button.module.css +0 -10
- package/lib-esm/components/summary/summary.module.css +0 -18
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +2 -1
- package/lib-esm/components/total-size-type-title/total-size-type-title.js.map +1 -1
- package/lib-esm/components/total-size-type-title/total-size-type-title.module.css +0 -18
- package/lib-esm/css/variables.css +14 -14
- package/lib-esm/ui/button/button.js +27 -0
- package/lib-esm/ui/button/button.js.map +1 -0
- package/lib-esm/ui/button/button.module.css +285 -0
- package/lib-esm/ui/button/index.js +2 -0
- package/lib-esm/ui/button/index.js.map +1 -0
- package/lib-esm/ui/dropdown/dropdown.module.css +1 -3
- package/lib-esm/ui/empty-set/empty-set.js +4 -3
- package/lib-esm/ui/empty-set/empty-set.js.map +1 -1
- package/lib-esm/ui/empty-set/empty-set.module.css +0 -17
- package/lib-esm/ui/filters/filters.i18n.js +4 -0
- package/lib-esm/ui/filters/filters.i18n.js.map +1 -1
- package/lib-esm/ui/filters/filters.js +25 -8
- package/lib-esm/ui/filters/filters.js.map +1 -1
- package/lib-esm/ui/filters/filters.module.css +13 -36
- package/lib-esm/ui/index.js +2 -0
- package/lib-esm/ui/index.js.map +1 -1
- package/lib-esm/ui/input/index.js.map +1 -1
- package/lib-esm/ui/input/input.js +2 -10
- package/lib-esm/ui/input/input.js.map +1 -1
- package/lib-esm/ui/input-search/index.js +2 -0
- package/lib-esm/ui/input-search/index.js.map +1 -0
- package/lib-esm/ui/input-search/input-search.js +34 -0
- package/lib-esm/ui/input-search/input-search.js.map +1 -0
- package/lib-esm/{components/metrics-table-search/metrics-table-search.module.css → ui/input-search/input-search.module.css} +1 -18
- package/package.json +10 -10
- package/src/components/bundle-assets/bundle-assets.jsx +4 -4
- package/src/components/bundle-modules/bundle-modules.tsx +4 -4
- package/src/components/bundle-packages/bundle-packages.jsx +4 -4
- package/src/components/entry-info/entry-info.module.css +0 -6
- package/src/components/entry-info/entry-info.tsx +4 -2
- package/src/components/index.js +0 -1
- package/src/components/metric-run-info/metric-run-info.module.css +0 -18
- package/src/components/metric-run-info/metric-run-info.tsx +3 -2
- package/src/components/metrics-table/metrics-table.module.css +0 -18
- package/src/components/metrics-table/metrics-table.tsx +9 -6
- package/src/components/metrics-table-title/metrics-table-title.jsx +7 -3
- package/src/components/metrics-table-title/metrics-table-title.module.css +0 -18
- package/src/components/sort-button/sort-button.module.css +0 -10
- package/src/components/sort-button/sort-button.tsx +5 -6
- package/src/components/summary/summary.module.css +0 -18
- package/src/components/total-size-type-title/total-size-type-title.jsx +4 -2
- package/src/components/total-size-type-title/total-size-type-title.module.css +0 -18
- package/src/css/variables.css +14 -14
- package/src/ui/button/button.module.css +285 -0
- package/src/ui/button/button.stories.tsx +108 -0
- package/src/ui/button/button.tsx +72 -0
- package/src/ui/button/index.ts +1 -0
- package/src/ui/dropdown/dropdown.module.css +1 -3
- package/src/ui/empty-set/empty-set.jsx +6 -5
- package/src/ui/empty-set/empty-set.module.css +0 -17
- package/src/ui/filters/filters.i18n.ts +4 -0
- package/src/ui/filters/filters.module.css +13 -36
- package/src/ui/filters/filters.tsx +76 -28
- package/src/ui/index.js +2 -0
- package/src/ui/input/input.stories.tsx +13 -0
- package/src/ui/input/input.tsx +16 -0
- package/src/ui/input-search/index.ts +1 -0
- package/src/{components/metrics-table-search/metrics-table-search.module.css → ui/input-search/input-search.module.css} +1 -18
- package/src/ui/input-search/input-search.tsx +85 -0
- package/types/components/index.d.ts +0 -1
- package/types/ui/button/button.d.ts +42 -0
- package/types/ui/button/index.d.ts +1 -0
- package/types/ui/filters/filters.i18n.d.ts +4 -0
- package/types/ui/index.d.ts +2 -0
- package/types/ui/input/index.d.ts +1 -1
- package/types/ui/input/input.d.ts +5 -18
- package/types/ui/input-search/index.d.ts +1 -0
- package/types/ui/input-search/input-search.d.ts +9 -0
- package/lib/components/metrics-table-search/index.js.map +0 -1
- package/lib/components/metrics-table-search/metrics-table-search.js +0 -73
- package/lib/components/metrics-table-search/metrics-table-search.js.map +0 -1
- package/lib-esm/components/metrics-table-search/index.js +0 -2
- package/lib-esm/components/metrics-table-search/index.js.map +0 -1
- package/lib-esm/components/metrics-table-search/metrics-table-search.js +0 -43
- package/lib-esm/components/metrics-table-search/metrics-table-search.js.map +0 -1
- package/src/components/metrics-table-search/index.js +0 -1
- package/src/components/metrics-table-search/metrics-table-search.jsx +0 -72
- package/src/ui/input/input.jsx +0 -20
- package/types/components/metrics-table-search/index.d.ts +0 -1
- package/types/components/metrics-table-search/metrics-table-search.d.ts +0 -17
- /package/src/ui/input/{index.js → index.ts} +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
3
|
import { FlexStack } from '../../layout/flex-stack';
|
|
4
|
+
import { Stack } from '../../layout/stack';
|
|
5
|
+
import { Button } from '../button';
|
|
4
6
|
import { Dropdown } from '../dropdown';
|
|
7
|
+
import { InputSearch } from '../input-search';
|
|
5
8
|
import * as I18N from './filters.i18n';
|
|
6
9
|
import { getGroupFiltersLabelSuffix, LABELS } from './filters.utils';
|
|
7
10
|
import css from './filters.module.css';
|
|
@@ -13,10 +16,11 @@ const Filter = (props) => {
|
|
|
13
16
|
React.createElement(FlexStack, { space: "xxxsmall", alignItems: "center", as: "label", className: cx(css.filterCheckbox, buttonClassName) },
|
|
14
17
|
React.createElement("input", { type: "checkbox", id: id, name: name, ...inputProps, className: css.filterInput }),
|
|
15
18
|
React.createElement("span", { title: label, className: css.filterLabel }, label)),
|
|
16
|
-
getOnOnlyClick && (React.createElement("
|
|
19
|
+
getOnOnlyClick && (React.createElement(Button, { kind: "info", solid: true, size: "small", type: "button", onClick: getOnOnlyClick(name), className: css.filterOnlyButton }, I18N.ONLY))));
|
|
17
20
|
};
|
|
18
21
|
const FilterGroup = (props) => {
|
|
19
22
|
const { className = '', buttonClassName = '', groupKey, data, values, onCheckboxChange, toggleFilters, } = props;
|
|
23
|
+
const [search, setSearch] = useState('');
|
|
20
24
|
const { label: groupLabel, children: groupItems } = data;
|
|
21
25
|
const areAllGroupItemsChecked = groupItems
|
|
22
26
|
.map(({ key: itemKey }) => values === null || values === void 0 ? void 0 : values[`${groupKey}.${itemKey}`])
|
|
@@ -37,14 +41,27 @@ const FilterGroup = (props) => {
|
|
|
37
41
|
...overrides,
|
|
38
42
|
});
|
|
39
43
|
};
|
|
44
|
+
const filteredGroupItems = useMemo(() => {
|
|
45
|
+
if (!search) {
|
|
46
|
+
return groupItems;
|
|
47
|
+
}
|
|
48
|
+
return groupItems.filter((item) => item.label.match(new RegExp(`${search}`, 'i')));
|
|
49
|
+
}, [search, groupItems]);
|
|
40
50
|
return (React.createElement(Dropdown, { className: className, buttonClassName: buttonClassName, label: dropdownLabel, ariaLabel: `${groupLabel}: ${filterSuffix}` }, ({ MenuItem, menuItemClassName }) => {
|
|
41
51
|
return (React.createElement(React.Fragment, null,
|
|
42
|
-
React.createElement("div", { className: css.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
groupItems.length > 10 && (React.createElement("div", { className: css.filterGroupSearchWrapper },
|
|
53
|
+
React.createElement(InputSearch, { defaultValue: search, onChange: setSearch, placeholder: I18N.GROUP_SEARCH, debounceWait: 0 }))),
|
|
54
|
+
React.createElement("div", { className: css.filterGroupItems },
|
|
55
|
+
filteredGroupItems.length === 0 && (React.createElement(Stack, { className: css.filterGroupSearchNotFound },
|
|
56
|
+
React.createElement("p", null, I18N.GROUP_NOT_FOUND),
|
|
57
|
+
React.createElement("div", null,
|
|
58
|
+
React.createElement(Button, { size: "small", kind: "primary", type: "button", onClick: () => setSearch(''), className: css.filterGroupSearchNotFoundClear }, I18N.GROUP_SEARCH_CLEAR)))),
|
|
59
|
+
filteredGroupItems.map(({ key: itemKey, ...itemData }) => {
|
|
60
|
+
const id = [groupKey, itemKey].join('.');
|
|
61
|
+
const getOnOnlyClick = () => getOnGroupCheck(false, { [id]: true });
|
|
62
|
+
return (React.createElement(Filter, { key: id, className: menuItemClassName, as: MenuItem, name: id, label: itemData.label, onChange: onCheckboxChange, checked: values[id], disabled: itemData.disabled, getOnOnlyClick: getOnOnlyClick }));
|
|
63
|
+
})),
|
|
64
|
+
filteredGroupItems.length !== 0 && (React.createElement("div", { className: css.filterGroupActions }, areAllGroupItemsChecked ? (React.createElement(MenuItem, { id: "clear-all", as: "button", className: menuItemClassName, type: "button", onClick: getOnGroupCheck(false) }, I18N.CLEAR)) : (React.createElement(MenuItem, { id: "clear-all", as: "button", className: menuItemClassName, type: "button", onClick: getOnGroupCheck(true) }, I18N.CHECK))))));
|
|
48
65
|
}));
|
|
49
66
|
};
|
|
50
67
|
export const Filters = (props) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../src/ui/filters/filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../src/ui/filters/filters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC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C1B,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAmB,GAClC,CACH,CAAC;aACH;YAED,OAAO,CACL,oBAAC,WAAW,IACV,SAAS,EAAE,GAAG,CAAC,IAAI,EACnB,eAAe,EAAE,GAAG,CAAC,UAAU,EAC/B,GAAG,EAAE,IAAI,EACT,QAAQ,EAAE,IAAI,EACd,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,GAC5B,CACH,CAAC;QACJ,CAAC,CAAC,CACQ,CACP,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -10,13 +10,11 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.filterCheckbox {
|
|
13
|
-
cursor: pointer;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
.filterInput {
|
|
17
16
|
flex: 0 0 auto;
|
|
18
17
|
height: 1em;
|
|
19
|
-
cursor: pointer;
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
.filterLabel {
|
|
@@ -28,29 +26,12 @@
|
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
.filterOnlyButton {
|
|
31
|
-
padding: 0 var(--space-xxxsmall);
|
|
32
29
|
display: none;
|
|
33
|
-
appearance: none;
|
|
34
|
-
border: none;
|
|
35
|
-
border-radius: var(--radius-small);
|
|
36
|
-
cursor: pointer;
|
|
37
30
|
position: absolute;
|
|
38
31
|
right: 2px;
|
|
39
32
|
top: 50%;
|
|
40
33
|
transform: translateY(-50%);
|
|
41
|
-
transition: var(--transition-in);
|
|
42
|
-
background: var(--color-info);
|
|
43
|
-
color: var(--color-background);
|
|
44
34
|
font-size: var(--size-xsmall);
|
|
45
|
-
line-height: var(--line-height-header);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.filterOnlyButton:hover,
|
|
49
|
-
.filterOnlyButton:active,
|
|
50
|
-
.filterOnlyButton:focus {
|
|
51
|
-
transition: var(--transition-out);
|
|
52
|
-
background: var(--color-info-dark);
|
|
53
|
-
color: var(--color-background);
|
|
54
35
|
}
|
|
55
36
|
|
|
56
37
|
/** cover item text */
|
|
@@ -116,6 +97,19 @@
|
|
|
116
97
|
text-transform: lowercase;
|
|
117
98
|
}
|
|
118
99
|
|
|
100
|
+
.filterGroupSearchWrapper {
|
|
101
|
+
padding-bottom: var(--space-xxxsmall);
|
|
102
|
+
margin-bottom: var(--space-xxxsmall);
|
|
103
|
+
border-bottom: 1px solid var(--color-outline);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.filterGroupSearchNotFound {
|
|
107
|
+
padding: var(--space-xxsmall) 0;
|
|
108
|
+
text-align: center;
|
|
109
|
+
font-size: var(--size-small);
|
|
110
|
+
color: var(--color-text-light);
|
|
111
|
+
}
|
|
112
|
+
|
|
119
113
|
.filterGroupItems {
|
|
120
114
|
max-height: calc(10 * (var(--space-small) + 2 * var(--space-xxxsmall)));
|
|
121
115
|
overflow: auto;
|
|
@@ -129,23 +123,6 @@
|
|
|
129
123
|
border-top: 1px solid var(--color-outline);
|
|
130
124
|
}
|
|
131
125
|
|
|
132
|
-
/* clear / check all */
|
|
133
|
-
.filterGroupButton {
|
|
134
|
-
margin-top: calc(0px - var(--space-xxxsmall));
|
|
135
|
-
margin-bottom: calc(0px - var(--space-xxxsmall));
|
|
136
|
-
margin-right: calc(0px - var(--space-xxxsmall));
|
|
137
|
-
padding: var(--space-xxxsmall) 0;
|
|
138
|
-
outline: none;
|
|
139
|
-
appearance: none;
|
|
140
|
-
border: none;
|
|
141
|
-
background: none;
|
|
142
|
-
cursor: pointer;
|
|
143
|
-
white-space: nowrap;
|
|
144
|
-
color: var(--color-primary);
|
|
145
|
-
font-size: var(--size-small);
|
|
146
|
-
line-height: 1;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
126
|
.item {
|
|
150
127
|
position: relative;
|
|
151
128
|
flex: 0 0 auto;
|
package/lib-esm/ui/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Alert } from './alert';
|
|
2
|
+
export { Button } from './button';
|
|
2
3
|
export { Container } from './container';
|
|
3
4
|
export { Dropdown } from './dropdown';
|
|
4
5
|
export { EmptySet } from './empty-set';
|
|
@@ -8,6 +9,7 @@ export { HorizontalBarChart } from './horizontal-bar-chart';
|
|
|
8
9
|
export { HoverCard } from './hover-card';
|
|
9
10
|
export { Icon } from './icon';
|
|
10
11
|
export { Input } from './input';
|
|
12
|
+
export { InputSearch } from './input-search';
|
|
11
13
|
export { Loader } from './loader';
|
|
12
14
|
export { Skeleton } from './skeleton';
|
|
13
15
|
export { Table } from './table';
|
package/lib-esm/ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/input/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/input/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import cx from 'classnames';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
3
|
import css from './input.module.css';
|
|
5
|
-
export const Input = (
|
|
4
|
+
export const Input = (props) => {
|
|
5
|
+
const { className = '', size = 'medium', ...restProps } = props;
|
|
6
6
|
const rootClassName = cx(css.root, className, css[size]);
|
|
7
7
|
return React.createElement("input", { className: rootClassName, ...restProps });
|
|
8
8
|
};
|
|
9
|
-
Input.propTypes = {
|
|
10
|
-
className: PropTypes.string,
|
|
11
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
12
|
-
};
|
|
13
|
-
Input.defaultProps = {
|
|
14
|
-
className: '',
|
|
15
|
-
size: 'medium',
|
|
16
|
-
};
|
|
17
9
|
//# sourceMappingURL=input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/ui/input/input.
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/ui/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,GAAG,MAAM,oBAAoB,CAAC;AAMrC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAA+D,EAAE,EAAE;IACvF,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,IAAI,GAAG,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAEhE,MAAM,aAAa,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAEzD,OAAO,+BAAO,SAAS,EAAE,aAAa,KAAM,SAAS,GAAI,CAAC;AAC5D,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ui/input-search/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import debounce from 'lodash/debounce';
|
|
4
|
+
import noop from 'lodash/noop';
|
|
5
|
+
import { Button } from '../button';
|
|
6
|
+
import { Icon } from '../icon';
|
|
7
|
+
import { Input } from '../input';
|
|
8
|
+
import css from './input-search.module.css';
|
|
9
|
+
export const InputSearch = (props) => {
|
|
10
|
+
const { className = '', placeholder = 'Search', defaultValue = '', onChange = noop, debounceWait = 500, } = props;
|
|
11
|
+
const rootClassname = cx(css.root, className);
|
|
12
|
+
const [value, setValue] = useState(defaultValue);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
setValue(defaultValue);
|
|
15
|
+
}, [defaultValue]);
|
|
16
|
+
const debouncedUpdateSearch = useCallback(debounce(onChange, debounceWait), [onChange]);
|
|
17
|
+
const changeValue = useCallback((newValue) => {
|
|
18
|
+
if (newValue !== value) {
|
|
19
|
+
debouncedUpdateSearch(newValue);
|
|
20
|
+
setValue(newValue);
|
|
21
|
+
}
|
|
22
|
+
}, [setValue, value]);
|
|
23
|
+
const inputOnChange = useCallback((event) => {
|
|
24
|
+
changeValue(event.target.value);
|
|
25
|
+
}, [changeValue]);
|
|
26
|
+
const clearButtonOnClick = useCallback(() => {
|
|
27
|
+
changeValue('');
|
|
28
|
+
}, [changeValue]);
|
|
29
|
+
return (React.createElement("div", { className: rootClassname },
|
|
30
|
+
React.createElement(Input, { className: css.input, placeholder: placeholder, onChange: inputOnChange, value: value, size: "small", autoComplete: "off" }),
|
|
31
|
+
value && (React.createElement(Button, { radius: "circle", padding: "small", type: "button", onClick: clearButtonOnClick, "aria-label": "Clear search", className: css.cancelButton },
|
|
32
|
+
React.createElement(Icon, { className: css.cancelButtonIcon, glyph: Icon.ICONS.CANCEL })))));
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=input-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-search.js","sourceRoot":"","sources":["../../../src/ui/input-search/input-search.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,IAAI,MAAM,aAAa,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,GAAG,MAAM,2BAA2B,CAAC;AAS5C,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,KAAuE,EACvE,EAAE;IACF,MAAM,EACJ,SAAS,GAAG,EAAE,EACd,WAAW,GAAG,QAAQ,EACtB,YAAY,GAAG,EAAE,EACjB,QAAQ,GAAG,IAAI,EACf,YAAY,GAAG,GAAG,GACnB,GAAG,KAAK,CAAC;IACV,MAAM,aAAa,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAE9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;IAGjD,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,YAAY,CAAC,CAAC;IACzB,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,MAAM,qBAAqB,GAAG,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAExF,MAAM,WAAW,GAAG,WAAW,CAC7B,CAAC,QAAgB,EAAE,EAAE;QACnB,I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-
border-radius: 50%;
|
|
18
12
|
position: absolute;
|
|
19
|
-
right:
|
|
13
|
+
right: var(--space-xxxsmall);
|
|
20
14
|
top: 50%;
|
|
21
15
|
transform: translateY(-50%);
|
|
22
|
-
padding: var(--space-xxxsmall);
|
|
23
|
-
width: var(--space-medium);
|
|
24
|
-
height: var(--space-medium);
|
|
25
16
|
background: radial-gradient(var(--color-background) 50%, transparent);
|
|
26
17
|
color: var(--color-text-ultra-light);
|
|
27
|
-
transition: var(--transition-in);
|
|
28
18
|
}
|
|
29
19
|
|
|
30
20
|
.cancelButton:focus,
|
|
31
21
|
.cancelButton:hover,
|
|
32
22
|
.cancelButton:active {
|
|
33
23
|
color: var(--color-text-light);
|
|
34
|
-
transition: var(--transition-out);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.cancelButtonIcon {
|
|
38
|
-
display: block;
|
|
39
|
-
width: var(--space-small);
|
|
40
|
-
height: var(--space-small);
|
|
41
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bundle-stats/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.1-beta.0",
|
|
4
4
|
"description": "UI components for BundleStats projects.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/relative-ci/bundle-stats/blob/master/packages/ui#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/preset-env": "7.23.
|
|
39
|
+
"@babel/preset-env": "7.23.8",
|
|
40
40
|
"@babel/preset-react": "7.23.3",
|
|
41
41
|
"@babel/preset-typescript": "7.23.3",
|
|
42
|
-
"@storybook/addon-essentials": "7.6.
|
|
42
|
+
"@storybook/addon-essentials": "7.6.7",
|
|
43
43
|
"@storybook/preset-scss": "^1.0.3",
|
|
44
|
-
"@storybook/react": "7.6.
|
|
45
|
-
"@storybook/react-webpack5": "7.6.
|
|
46
|
-
"@types/react": "18.2.
|
|
44
|
+
"@storybook/react": "7.6.7",
|
|
45
|
+
"@storybook/react-webpack5": "7.6.7",
|
|
46
|
+
"@types/react": "18.2.47",
|
|
47
47
|
"@types/react-router-dom": "5.3.3",
|
|
48
48
|
"babel-plugin-require-context-hook": "1.0.0",
|
|
49
|
-
"classnames": "2.5.
|
|
49
|
+
"classnames": "2.5.1",
|
|
50
50
|
"colormap": "2.3.2",
|
|
51
51
|
"cross-env": "7.0.3",
|
|
52
52
|
"hex-rgb": "5.0.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"react-dom": "18.2.0",
|
|
61
61
|
"react-router-dom": "5.3.4",
|
|
62
62
|
"rimraf": "5.0.5",
|
|
63
|
-
"storybook": "7.6.
|
|
63
|
+
"storybook": "7.6.7",
|
|
64
64
|
"typescript": "5.1.6",
|
|
65
65
|
"typescript-plugin-css-modules": "5.0.2"
|
|
66
66
|
},
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"react-router-dom": "^5.0.0"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@bundle-stats/utils": "
|
|
76
|
+
"@bundle-stats/utils": "4.9.1-beta.0",
|
|
77
77
|
"ariakit": "2.0.0-next.44",
|
|
78
78
|
"modern-css-reset": "1.4.0",
|
|
79
79
|
"use-query-params": "2.2.1"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "6b0ca3fd6fe0b9e50e5ae6d5aa24fdae13253e30"
|
|
82
82
|
}
|
|
@@ -15,6 +15,7 @@ import config from '../../config.json';
|
|
|
15
15
|
import I18N from '../../i18n';
|
|
16
16
|
import { FlexStack } from '../../layout/flex-stack';
|
|
17
17
|
import { Icon } from '../../ui/icon';
|
|
18
|
+
import { InputSearch } from '../../ui/input-search';
|
|
18
19
|
import { FileName } from '../../ui/file-name';
|
|
19
20
|
import { HoverCard } from '../../ui/hover-card';
|
|
20
21
|
import { Tag } from '../../ui/tag';
|
|
@@ -25,7 +26,6 @@ import { AssetInfo } from '../asset-info';
|
|
|
25
26
|
import { AssetNotPredictive } from '../asset-not-predictive';
|
|
26
27
|
import { ComponentLink } from '../component-link';
|
|
27
28
|
import { MetricsTable } from '../metrics-table';
|
|
28
|
-
import { MetricsTableSearch } from '../metrics-table-search';
|
|
29
29
|
import { MetricsTableOptions } from '../metrics-table-options';
|
|
30
30
|
import { MetricsTableTitle } from '../metrics-table-title';
|
|
31
31
|
import css from './bundle-assets.module.css';
|
|
@@ -235,11 +235,11 @@ export const BundleAssets = (props) => {
|
|
|
235
235
|
)}
|
|
236
236
|
>
|
|
237
237
|
<FlexStack space="xxsmall">
|
|
238
|
-
<
|
|
238
|
+
<InputSearch
|
|
239
239
|
className={css.toolbarSearch}
|
|
240
240
|
placeholder="Search by name"
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
defaultValue={search}
|
|
242
|
+
onChange={updateSearch}
|
|
243
243
|
/>
|
|
244
244
|
<Filters
|
|
245
245
|
className={css.toolbarFilters}
|
|
@@ -7,13 +7,13 @@ import config from '../../config.json';
|
|
|
7
7
|
import I18N from '../../i18n';
|
|
8
8
|
import { ComponentLink } from '../component-link';
|
|
9
9
|
import { FlexStack } from '../../layout/flex-stack';
|
|
10
|
+
import { InputSearch } from '../../ui/input-search';
|
|
10
11
|
import { EmptySet } from '../../ui/empty-set';
|
|
11
12
|
import { FileName } from '../../ui/file-name';
|
|
12
13
|
import { Filters } from '../../ui/filters';
|
|
13
14
|
import { Tag } from '../../ui/tag';
|
|
14
15
|
import { Toolbar } from '../../ui/toolbar';
|
|
15
16
|
import { MetricsTable } from '../metrics-table';
|
|
16
|
-
import { MetricsTableSearch } from '../metrics-table-search';
|
|
17
17
|
import { MetricsTableOptions } from '../metrics-table-options';
|
|
18
18
|
import { MetricsTableTitle } from '../metrics-table-title';
|
|
19
19
|
import { ModuleInfo } from '../module-info';
|
|
@@ -159,11 +159,11 @@ export const BundleModules = (props: BundleModulesProps) => {
|
|
|
159
159
|
)}
|
|
160
160
|
>
|
|
161
161
|
<FlexStack space="xxsmall">
|
|
162
|
-
<
|
|
162
|
+
<InputSearch
|
|
163
163
|
className={css.toolbarSearch}
|
|
164
|
-
search={search}
|
|
165
|
-
updateSearch={updateSearch}
|
|
166
164
|
placeholder={I18N_MODULES.SEARCH}
|
|
165
|
+
defaultValue={search}
|
|
166
|
+
onChange={updateSearch}
|
|
167
167
|
/>
|
|
168
168
|
<Filters
|
|
169
169
|
className={css.tableDropdown}
|
|
@@ -6,13 +6,13 @@ import { COMPONENT, PACKAGE_FILTERS, PACKAGES_SEPARATOR, SECTIONS } from '@bundl
|
|
|
6
6
|
import config from '../../config.json';
|
|
7
7
|
import I18N from '../../i18n';
|
|
8
8
|
import { FlexStack } from '../../layout/flex-stack';
|
|
9
|
+
import { InputSearch } from '../../ui/input-search';
|
|
9
10
|
import { EmptySet } from '../../ui/empty-set';
|
|
10
11
|
import { Filters } from '../../ui/filters';
|
|
11
12
|
import { Tag } from '../../ui/tag';
|
|
12
13
|
import { Toolbar } from '../../ui/toolbar';
|
|
13
14
|
import { ComponentLink } from '../component-link';
|
|
14
15
|
import { MetricsTable } from '../metrics-table';
|
|
15
|
-
import { MetricsTableSearch } from '../metrics-table-search';
|
|
16
16
|
import { MetricsTableOptions } from '../metrics-table-options';
|
|
17
17
|
import { MetricsTableTitle } from '../metrics-table-title';
|
|
18
18
|
import { PackageInfo } from '../package-info';
|
|
@@ -194,11 +194,11 @@ export const BundlePackages = (props) => {
|
|
|
194
194
|
)}
|
|
195
195
|
>
|
|
196
196
|
<FlexStack space="xxsmall">
|
|
197
|
-
<
|
|
197
|
+
<InputSearch
|
|
198
198
|
className={css.toolbarSearch}
|
|
199
199
|
placeholder="Search by name"
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
defaultValue={search}
|
|
201
|
+
onChange={updateSearch}
|
|
202
202
|
/>
|
|
203
203
|
<Filters
|
|
204
204
|
filters={dropdownFilters}
|
|
@@ -33,16 +33,10 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.headerClose {
|
|
36
|
-
appearance: none;
|
|
37
|
-
background: none;
|
|
38
|
-
border: 0;
|
|
39
|
-
display: block;
|
|
40
|
-
padding: var(--space-xxxsmall);
|
|
41
36
|
position: absolute;
|
|
42
37
|
right: calc(var(--space-small) - var(--space-xxxsmall));
|
|
43
38
|
top: calc(var(--space-small) - var(--space-xxxsmall));
|
|
44
39
|
color: var(--color-text-ultra-light);
|
|
45
|
-
cursor: pointer;
|
|
46
40
|
}
|
|
47
41
|
|
|
48
42
|
.headerClose:hover,
|
|
@@ -6,6 +6,7 @@ import { METRIC_TYPE_CONFIGS, MetricRunInfo, getMetricRunInfo } from '@bundle-st
|
|
|
6
6
|
import { Box } from '../../layout/box';
|
|
7
7
|
import { Stack } from '../../layout/stack';
|
|
8
8
|
import { FileName } from '../../ui/file-name';
|
|
9
|
+
import { Button } from '../../ui/button';
|
|
9
10
|
import { Icon } from '../../ui/icon';
|
|
10
11
|
import { Table } from '../../ui/table';
|
|
11
12
|
import { RunInfo } from '../run-info';
|
|
@@ -94,14 +95,15 @@ export const EntryInfo = (props: EntryInfoProps & React.ComponentProps<'div'>) =
|
|
|
94
95
|
size="large"
|
|
95
96
|
/>
|
|
96
97
|
</Stack>
|
|
97
|
-
<
|
|
98
|
+
<Button
|
|
99
|
+
radius="circle"
|
|
98
100
|
type="button"
|
|
99
101
|
onClick={onClose}
|
|
100
102
|
aria-label={I18N.CLOSE_TITLE}
|
|
101
103
|
className={css.headerClose}
|
|
102
104
|
>
|
|
103
105
|
<Icon glyph={Icon.ICONS.CLOSE} size="large" />
|
|
104
|
-
</
|
|
106
|
+
</Button>
|
|
105
107
|
</Box>
|
|
106
108
|
<Box padding="medium" as="main" className={css.contentWrapper}>
|
|
107
109
|
<Stack space="small" className={css.content}>
|
package/src/components/index.js
CHANGED
|
@@ -15,7 +15,6 @@ export { Metric } from './metric';
|
|
|
15
15
|
export { MetricRunInfo, MetricRunInfoProps } from './metric-run-info';
|
|
16
16
|
export { MetricsTable } from './metrics-table';
|
|
17
17
|
export { MetricsTableOptions } from './metrics-table-options';
|
|
18
|
-
export { MetricsTableSearch } from './metrics-table-search';
|
|
19
18
|
export { MetricsTableTitle } from './metrics-table-title';
|
|
20
19
|
export { ModuleInfo } from './module-info';
|
|
21
20
|
export { RunInfo, RunInfoProps } from './run-info';
|
|
@@ -2,21 +2,3 @@
|
|
|
2
2
|
font-weight: bold;
|
|
3
3
|
font-size: 1em;
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
.readMoreLink {
|
|
7
|
-
appearance: none;
|
|
8
|
-
background: none;
|
|
9
|
-
margin: 0;
|
|
10
|
-
border: 0;
|
|
11
|
-
padding: 0;
|
|
12
|
-
color: var(--color-primary);
|
|
13
|
-
text-decoration: underline;
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.readMoreLink:hover,
|
|
18
|
-
.readMoreLink:active,
|
|
19
|
-
.readMoreLink:focus {
|
|
20
|
-
color: var(--color-primary-dark);
|
|
21
|
-
text-decoration: none;
|
|
22
|
-
}
|
|
@@ -3,6 +3,7 @@ import { getGlobalMetricType, getMetricRunInfo } from '@bundle-stats/utils';
|
|
|
3
3
|
|
|
4
4
|
import { Stack } from '../../layout/stack';
|
|
5
5
|
import { FlexStack } from '../../layout/flex-stack';
|
|
6
|
+
import { Button } from '../../ui/button';
|
|
6
7
|
import { Icon } from '../../ui/icon';
|
|
7
8
|
import { RunInfo, RunInfoProps } from '../run-info';
|
|
8
9
|
import css from './metric-run-info.module.css';
|
|
@@ -28,12 +29,12 @@ const MetricHoverCard = ({ title, description, url }: MetricInfoProps) => {
|
|
|
28
29
|
<p className={css.metricHoverCardDescription}>{description}</p>
|
|
29
30
|
{url && (
|
|
30
31
|
<div>
|
|
31
|
-
<
|
|
32
|
+
<Button kind="primary" type="button" onClick={onClick} className={css.readMoreLink}>
|
|
32
33
|
<FlexStack alignItems="center" space="xxxsmall">
|
|
33
34
|
<span>Read more</span>
|
|
34
35
|
<Icon glyph={Icon.ICONS.EXTERNAL_LINK} size="small" />
|
|
35
36
|
</FlexStack>
|
|
36
|
-
</
|
|
37
|
+
</Button>
|
|
37
38
|
</div>
|
|
38
39
|
)}
|
|
39
40
|
</Stack>
|
|
@@ -82,24 +82,6 @@
|
|
|
82
82
|
text-align: center;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
/** show all */
|
|
86
|
-
.showAllItemsButton {
|
|
87
|
-
appearance: none;
|
|
88
|
-
background: none;
|
|
89
|
-
margin: 0;
|
|
90
|
-
border: 0;
|
|
91
|
-
padding: var(--space-xxxsmall);
|
|
92
|
-
color: var(--color-primary);
|
|
93
|
-
text-decoration: underline;
|
|
94
|
-
cursor: pointer;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.showAllItemsButton:hover,
|
|
98
|
-
.showAllItemsButton:focus,
|
|
99
|
-
.showAllItemsButton:active {
|
|
100
|
-
color: var(--color-primary-dark);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
85
|
/** Breakpoints */
|
|
104
86
|
.root tr {
|
|
105
87
|
display: flex;
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
getMetricRunInfo,
|
|
10
10
|
} from '@bundle-stats/utils';
|
|
11
11
|
|
|
12
|
+
import { Button } from '../../ui/button';
|
|
12
13
|
import { Icon } from '../../ui/icon';
|
|
13
14
|
import { Table } from '../../ui/table';
|
|
14
15
|
import { Stack } from '../../layout/stack';
|
|
@@ -274,21 +275,23 @@ export const MetricsTable = ({
|
|
|
274
275
|
<Table.Tr>
|
|
275
276
|
<Table.Td className={css.showAllItems} colSpan={columnCount}>
|
|
276
277
|
{showAllItems ? (
|
|
277
|
-
<
|
|
278
|
+
<Button
|
|
279
|
+
padding="small"
|
|
280
|
+
kind="primary"
|
|
278
281
|
onClick={() => setShowAllItems(false)}
|
|
279
282
|
type="button"
|
|
280
|
-
className={css.showAllItemsButton}
|
|
281
283
|
>
|
|
282
284
|
{I18N.SHOW_LESS}
|
|
283
|
-
</
|
|
285
|
+
</Button>
|
|
284
286
|
) : (
|
|
285
|
-
<
|
|
287
|
+
<Button
|
|
288
|
+
padding="small"
|
|
289
|
+
kind="primary"
|
|
286
290
|
onClick={() => setShowAllItems(true)}
|
|
287
291
|
type="button"
|
|
288
|
-
className={css.showAllItemsButton}
|
|
289
292
|
>
|
|
290
293
|
{I18N.SHOW_ALL}
|
|
291
|
-
</
|
|
294
|
+
</Button>
|
|
292
295
|
)}
|
|
293
296
|
</Table.Td>
|
|
294
297
|
</Table.Tr>
|