@bundle-stats/ui 4.13.0-beta.9 → 4.13.0-rc.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/app/app.js +4 -8
- package/lib/app/app.js.map +1 -1
- package/lib/app/app.module.css +2 -2
- package/lib/assets/icons.svg +70 -67
- package/lib/assets/icons.svg.js +14 -12
- package/lib/assets/icons.svg.js.map +1 -1
- package/lib/components/bundle-assets/bundle-assets.js +44 -10
- package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib/components/bundle-assets/bundle-assets.module.css +0 -5
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js +14 -12
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.i18n.js +1 -1
- package/lib/components/bundle-modules/bundle-modules.js +38 -15
- package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.module.css +0 -5
- package/lib/components/bundle-packages/bundle-packages.js +43 -9
- package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib/components/bundle-packages/bundle-packages.module.css +0 -5
- package/lib/components/delta/delta.js +1 -1
- package/lib/components/delta/delta.js.map +1 -1
- package/lib/components/delta/delta.module.css +10 -1
- package/lib/components/jobs-header/jobs-header.module.css +0 -4
- package/lib/components/metrics-display-selector/metrics-display-selector.js +41 -4
- package/lib/components/metrics-display-selector/metrics-display-selector.js.map +1 -1
- package/lib/components/metrics-display-selector/metrics-display-selector.module.css +15 -7
- package/lib/components/metrics-treemap/index.js +4 -0
- package/lib/components/metrics-treemap/index.js.map +1 -1
- package/lib/components/metrics-treemap/metrics-treemap.constants.js +3 -0
- package/lib/components/metrics-treemap/metrics-treemap.constants.js.map +1 -0
- package/lib/components/metrics-treemap/metrics-treemap.i18n.js +6 -0
- package/lib/components/metrics-treemap/metrics-treemap.i18n.js.map +1 -0
- package/lib/components/metrics-treemap/metrics-treemap.js +100 -62
- package/lib/components/metrics-treemap/metrics-treemap.js.map +1 -1
- package/lib/components/metrics-treemap/metrics-treemap.module.css +139 -51
- package/lib/components/metrics-treemap/metrics-treemap.utils.js +109 -0
- package/lib/components/metrics-treemap/metrics-treemap.utils.js.map +1 -0
- package/lib/components/module-info/module-info.js +1 -2
- package/lib/components/module-info/module-info.js.map +1 -1
- package/lib/components/run-info/run-info.module.css +7 -7
- package/lib/css/variables.css +14 -13
- package/lib/hooks/metrics-display-type.js +45 -24
- package/lib/hooks/metrics-display-type.js.map +1 -1
- package/lib/hooks/search-params.js +1 -0
- package/lib/hooks/search-params.js.map +1 -1
- package/lib/layout/box/box.module.css +4 -2
- package/lib/layout/flex-stack/flex-stack.js +3 -4
- package/lib/layout/flex-stack/flex-stack.js.map +1 -1
- package/lib/layout/flex-stack/flex-stack.module.css +19 -23
- package/lib/ui/button/button.js +5 -4
- package/lib/ui/button/button.js.map +1 -1
- package/lib/ui/button/button.module.css +55 -53
- package/lib/ui/dropdown/dropdown.js +2 -2
- package/lib/ui/dropdown/dropdown.js.map +1 -1
- package/lib/ui/filters/filters.js +2 -2
- package/lib/ui/filters/filters.js.map +1 -1
- package/lib/ui/filters/filters.module.css +8 -1
- package/lib/ui/hover-card/hover-card.js +1 -1
- package/lib/ui/hover-card/hover-card.js.map +1 -1
- package/lib/ui/icon/icon.js +2 -1
- package/lib/ui/icon/icon.js.map +1 -1
- package/lib/ui/input-search/input-search.js +1 -1
- package/lib/ui/input-search/input-search.js.map +1 -1
- package/lib/ui/loader/loader.js +1 -1
- package/lib/ui/loader/loader.js.map +1 -1
- package/lib/ui/table/table.module.css +30 -0
- package/lib/ui/tag/tag.module.css +3 -3
- package/lib/ui/toolbar/toolbar.module.css +1 -3
- package/lib-esm/app/app.js +4 -8
- package/lib-esm/app/app.js.map +1 -1
- package/lib-esm/app/app.module.css +2 -2
- package/lib-esm/assets/icons.svg +70 -67
- package/lib-esm/assets/icons.svg.js +14 -12
- package/lib-esm/assets/icons.svg.js.map +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.js +45 -11
- package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.module.css +0 -5
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js +15 -13
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.i18n.js +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.js +39 -16
- package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.module.css +0 -5
- package/lib-esm/components/bundle-packages/bundle-packages.js +44 -10
- package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib-esm/components/bundle-packages/bundle-packages.module.css +0 -5
- package/lib-esm/components/delta/delta.js +1 -1
- package/lib-esm/components/delta/delta.js.map +1 -1
- package/lib-esm/components/delta/delta.module.css +10 -1
- package/lib-esm/components/jobs-header/jobs-header.module.css +0 -4
- package/lib-esm/components/metrics-display-selector/metrics-display-selector.js +41 -4
- package/lib-esm/components/metrics-display-selector/metrics-display-selector.js.map +1 -1
- package/lib-esm/components/metrics-display-selector/metrics-display-selector.module.css +15 -7
- package/lib-esm/components/metrics-treemap/index.js +1 -0
- package/lib-esm/components/metrics-treemap/index.js.map +1 -1
- package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js +2 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js.map +1 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.i18n.js +3 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.i18n.js.map +1 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.js +102 -63
- package/lib-esm/components/metrics-treemap/metrics-treemap.js.map +1 -1
- package/lib-esm/components/metrics-treemap/metrics-treemap.module.css +139 -51
- package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js +105 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js.map +1 -0
- package/lib-esm/components/module-info/module-info.js +1 -2
- package/lib-esm/components/module-info/module-info.js.map +1 -1
- package/lib-esm/components/run-info/run-info.module.css +7 -7
- package/lib-esm/css/variables.css +14 -13
- package/lib-esm/hooks/metrics-display-type.js +46 -24
- package/lib-esm/hooks/metrics-display-type.js.map +1 -1
- package/lib-esm/hooks/search-params.js +1 -0
- package/lib-esm/hooks/search-params.js.map +1 -1
- package/lib-esm/layout/box/box.module.css +4 -2
- package/lib-esm/layout/flex-stack/flex-stack.js +3 -4
- package/lib-esm/layout/flex-stack/flex-stack.js.map +1 -1
- package/lib-esm/layout/flex-stack/flex-stack.module.css +19 -23
- package/lib-esm/ui/button/button.js +5 -4
- package/lib-esm/ui/button/button.js.map +1 -1
- package/lib-esm/ui/button/button.module.css +55 -53
- package/lib-esm/ui/dropdown/dropdown.js +2 -2
- package/lib-esm/ui/dropdown/dropdown.js.map +1 -1
- package/lib-esm/ui/filters/filters.js +2 -2
- package/lib-esm/ui/filters/filters.js.map +1 -1
- package/lib-esm/ui/filters/filters.module.css +8 -1
- package/lib-esm/ui/hover-card/hover-card.js +1 -1
- package/lib-esm/ui/hover-card/hover-card.js.map +1 -1
- package/lib-esm/ui/icon/icon.js +2 -1
- package/lib-esm/ui/icon/icon.js.map +1 -1
- package/lib-esm/ui/input-search/input-search.js +1 -1
- package/lib-esm/ui/input-search/input-search.js.map +1 -1
- package/lib-esm/ui/loader/loader.js +1 -1
- package/lib-esm/ui/loader/loader.js.map +1 -1
- package/lib-esm/ui/table/table.module.css +30 -0
- package/lib-esm/ui/tag/tag.module.css +3 -3
- package/lib-esm/ui/toolbar/toolbar.module.css +1 -3
- package/package.json +9 -9
- package/src/app/app.jsx +4 -12
- package/src/app/app.module.css +2 -2
- package/src/assets/icons/check.svg +4 -0
- package/src/assets/icons.svg +70 -67
- package/src/assets/icons.svg.jsx +12 -12
- package/src/components/bundle-assets/bundle-assets.jsx +82 -25
- package/src/components/bundle-assets/bundle-assets.module.css +0 -5
- package/src/components/bundle-assets-totals/bundle-assets-totals.jsx +53 -46
- package/src/components/bundle-modules/bundle-modules.i18n.ts +1 -1
- package/src/components/bundle-modules/bundle-modules.module.css +0 -5
- package/src/components/bundle-modules/bundle-modules.tsx +116 -53
- package/src/components/bundle-packages/bundle-packages.jsx +77 -20
- package/src/components/bundle-packages/bundle-packages.module.css +0 -5
- package/src/components/delta/delta.jsx +1 -1
- package/src/components/delta/delta.module.css +10 -1
- package/src/components/jobs-header/jobs-header.module.css +0 -4
- package/src/components/metrics-display-selector/metrics-display-selector.module.css +15 -7
- package/src/components/metrics-display-selector/metrics-display-selector.stories.tsx +33 -0
- package/src/components/metrics-display-selector/metrics-display-selector.tsx +83 -25
- package/src/components/metrics-treemap/__tests__/metrics-treemap.utils.ts +188 -0
- package/src/components/metrics-treemap/index.ts +1 -0
- package/src/components/metrics-treemap/metrics-treemap.constants.ts +52 -0
- package/src/components/metrics-treemap/metrics-treemap.i18n.ts +2 -0
- package/src/components/metrics-treemap/metrics-treemap.module.css +139 -51
- package/src/components/metrics-treemap/metrics-treemap.stories.tsx +44 -10
- package/src/components/metrics-treemap/metrics-treemap.tsx +329 -121
- package/src/components/metrics-treemap/metrics-treemap.utils.ts +162 -0
- package/src/components/module-info/module-info.tsx +1 -1
- package/src/components/run-info/run-info.module.css +7 -7
- package/src/css/variables.css +14 -13
- package/src/hooks/metrics-display-type.ts +79 -29
- package/src/hooks/search-params.js +1 -0
- package/src/layout/box/box.module.css +4 -2
- package/src/layout/flex-stack/flex-stack.module.css +19 -23
- package/src/layout/flex-stack/flex-stack.tsx +2 -8
- package/src/ui/button/button.module.css +55 -53
- package/src/ui/button/button.stories.tsx +16 -9
- package/src/ui/button/button.tsx +8 -7
- package/src/ui/dropdown/dropdown.tsx +2 -3
- package/src/ui/filters/filters.module.css +8 -1
- package/src/ui/filters/filters.tsx +2 -3
- package/src/ui/hover-card/hover-card.tsx +1 -1
- package/src/ui/icon/icon.tsx +2 -1
- package/src/ui/input-search/input-search.tsx +1 -0
- package/src/ui/loader/loader.jsx +1 -1
- package/src/ui/table/table.module.css +30 -0
- package/src/ui/tag/tag.module.css +3 -3
- package/src/ui/toolbar/toolbar.module.css +1 -3
- package/types/components/bundle-modules/bundle-modules.i18n.d.ts +1 -1
- package/types/components/delta/delta.d.ts +2 -2
- package/types/components/metrics-display-selector/metrics-display-selector.d.ts +3 -1
- package/types/components/metrics-treemap/index.d.ts +1 -0
- package/types/components/metrics-treemap/metrics-treemap.constants.d.ts +20 -0
- package/types/components/metrics-treemap/metrics-treemap.d.ts +7 -5
- package/types/components/metrics-treemap/metrics-treemap.i18n.d.ts +2 -0
- package/types/components/metrics-treemap/metrics-treemap.utils.d.ts +5 -0
- package/types/hooks/metrics-display-type.d.ts +8 -2
- package/types/ui/dropdown/dropdown.d.ts +0 -1
- package/types/ui/icon/icon.d.ts +4 -2
- package/types/ui/loader/loader.d.ts +2 -2
- package/lib/components/bundle-assets-totals/bundle-assets-totals.module.css +0 -7
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.module.css +0 -7
- package/src/components/bundle-assets-totals/bundle-assets-totals.module.css +0 -7
|
@@ -62,7 +62,14 @@ export const All = () => (
|
|
|
62
62
|
<h3>With icon</h3>
|
|
63
63
|
<Items>
|
|
64
64
|
{Object.values(BUTTON_KIND).map((kind) => (
|
|
65
|
-
<Button glyph={Icon.ICONS.
|
|
65
|
+
<Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} kind={kind} key={kind}>
|
|
66
|
+
Action {kind}
|
|
67
|
+
</Button>
|
|
68
|
+
))}
|
|
69
|
+
</Items>
|
|
70
|
+
<Items>
|
|
71
|
+
{Object.values(BUTTON_KIND).map((kind) => (
|
|
72
|
+
<Button rightGlyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} kind={kind} key={kind}>
|
|
66
73
|
Action {kind}
|
|
67
74
|
</Button>
|
|
68
75
|
))}
|
|
@@ -106,12 +113,12 @@ export const All = () => (
|
|
|
106
113
|
<h3>With icon</h3>
|
|
107
114
|
{Object.values(BUTTON_SIZE).map((size) => (
|
|
108
115
|
<Items key={size}>
|
|
109
|
-
<Button glyph={Icon.ICONS.
|
|
116
|
+
<Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} outline size={size}>
|
|
110
117
|
Action default
|
|
111
118
|
</Button>
|
|
112
119
|
{Object.values(BUTTON_KIND).map((kind) => (
|
|
113
120
|
<Button
|
|
114
|
-
glyph={Icon.ICONS.
|
|
121
|
+
glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE}
|
|
115
122
|
outline
|
|
116
123
|
kind={kind}
|
|
117
124
|
size={size}
|
|
@@ -125,10 +132,10 @@ export const All = () => (
|
|
|
125
132
|
<h3>Only icon</h3>
|
|
126
133
|
{Object.values(BUTTON_SIZE).map((size) => (
|
|
127
134
|
<Items key={size}>
|
|
128
|
-
<Button glyph={Icon.ICONS.
|
|
135
|
+
<Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} outline size={size} />
|
|
129
136
|
{Object.values(BUTTON_KIND).map((kind) => (
|
|
130
137
|
<Button
|
|
131
|
-
glyph={Icon.ICONS.
|
|
138
|
+
glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE}
|
|
132
139
|
outline
|
|
133
140
|
kind={kind}
|
|
134
141
|
size={size}
|
|
@@ -179,12 +186,12 @@ export const All = () => (
|
|
|
179
186
|
<h3>With icon</h3>
|
|
180
187
|
{Object.values(BUTTON_SIZE).map((size) => (
|
|
181
188
|
<Items key={size}>
|
|
182
|
-
<Button glyph={Icon.ICONS.
|
|
189
|
+
<Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} solid size={size}>
|
|
183
190
|
Action default
|
|
184
191
|
</Button>
|
|
185
192
|
{Object.values(BUTTON_KIND).map((kind) => (
|
|
186
193
|
<Button
|
|
187
|
-
glyph={Icon.ICONS.
|
|
194
|
+
glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE}
|
|
188
195
|
solid
|
|
189
196
|
kind={kind}
|
|
190
197
|
size={size}
|
|
@@ -198,10 +205,10 @@ export const All = () => (
|
|
|
198
205
|
<h3>Only icon</h3>
|
|
199
206
|
{Object.values(BUTTON_SIZE).map((size) => (
|
|
200
207
|
<Items key={size}>
|
|
201
|
-
<Button glyph={Icon.ICONS.
|
|
208
|
+
<Button glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE} solid size={size} />
|
|
202
209
|
{Object.values(BUTTON_KIND).map((kind) => (
|
|
203
210
|
<Button
|
|
204
|
-
glyph={Icon.ICONS.
|
|
211
|
+
glyph={Icon.ICONS.ARROW_RIGHT_CIRCLE}
|
|
205
212
|
solid
|
|
206
213
|
kind={kind}
|
|
207
214
|
size={size}
|
package/src/ui/button/button.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
|
|
2
3
|
import cx from 'classnames';
|
|
3
4
|
import { Button as ButtonBaseComponent } from 'ariakit/button';
|
|
4
5
|
|
|
@@ -50,7 +51,7 @@ const ButtonComponent = <T extends React.ElementType = 'button'>(
|
|
|
50
51
|
radius = '',
|
|
51
52
|
padding = '',
|
|
52
53
|
as: Component = ButtonBaseComponent,
|
|
53
|
-
children,
|
|
54
|
+
children = null,
|
|
54
55
|
Icon = BaseIcon,
|
|
55
56
|
glyph,
|
|
56
57
|
rightGlyph,
|
|
@@ -61,10 +62,12 @@ const ButtonComponent = <T extends React.ElementType = 'button'>(
|
|
|
61
62
|
const resolvedPadding = padding || ((outline || solid) && size);
|
|
62
63
|
const resolvedRadius = radius || ((outline || solid) && size);
|
|
63
64
|
|
|
65
|
+
const resolvedSize = Object.values(BUTTON_SIZE).includes(size) ? size : BUTTON_SIZE.MEDIUM;
|
|
66
|
+
|
|
64
67
|
const rootClassName = cx(
|
|
65
68
|
css.root,
|
|
66
|
-
css[size],
|
|
67
69
|
kind && css[kind],
|
|
70
|
+
css[resolvedSize],
|
|
68
71
|
|
|
69
72
|
outline && css.outline,
|
|
70
73
|
outline && css[`outline--${kind}`],
|
|
@@ -72,22 +75,20 @@ const ButtonComponent = <T extends React.ElementType = 'button'>(
|
|
|
72
75
|
solid && css.solid,
|
|
73
76
|
solid && css[`solid--${kind}`],
|
|
74
77
|
|
|
75
|
-
resolvedPadding && css
|
|
76
|
-
resolvedPadding && outline && css[`outline--padding--${resolvedPadding}`],
|
|
78
|
+
resolvedPadding && css.padding,
|
|
77
79
|
resolvedRadius && css[`radius--${resolvedRadius}`],
|
|
78
80
|
|
|
79
81
|
active && css.active,
|
|
80
82
|
active && outline && css[`active-outline-${kind}`],
|
|
81
83
|
|
|
82
|
-
css[size],
|
|
83
84
|
className,
|
|
84
85
|
);
|
|
85
86
|
|
|
86
87
|
return (
|
|
87
88
|
<Component {...restProps} className={rootClassName}>
|
|
88
|
-
{glyph && <Icon glyph={glyph}
|
|
89
|
+
{glyph && <Icon glyph={glyph} className={css.glyph} />}
|
|
89
90
|
{children && <span className={css.content}>{children}</span>}
|
|
90
|
-
{rightGlyph && <Icon glyph={
|
|
91
|
+
{rightGlyph && <Icon glyph={rightGlyph} className={css.glyph} />}
|
|
91
92
|
</Component>
|
|
92
93
|
);
|
|
93
94
|
};
|
|
@@ -18,7 +18,6 @@ export const DropdownItem = (props: DropdownItemProps & React.ComponentProps<typ
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
interface DropdownProps {
|
|
21
|
-
buttonClassName?: string;
|
|
22
21
|
dropdownClassName?: string;
|
|
23
22
|
label?: React.ReactNode;
|
|
24
23
|
ariaLabel?: string;
|
|
@@ -28,7 +27,7 @@ interface DropdownProps {
|
|
|
28
27
|
|
|
29
28
|
export const Dropdown = (props: DropdownProps & React.ComponentProps<'div'>) => {
|
|
30
29
|
const {
|
|
31
|
-
|
|
30
|
+
className = '',
|
|
32
31
|
dropdownClassName = '',
|
|
33
32
|
label = null,
|
|
34
33
|
ariaLabel = '',
|
|
@@ -50,7 +49,7 @@ export const Dropdown = (props: DropdownProps & React.ComponentProps<'div'>) =>
|
|
|
50
49
|
disabled={disabled}
|
|
51
50
|
state={menuState}
|
|
52
51
|
tabIndex={null}
|
|
53
|
-
className={cx(css.button,
|
|
52
|
+
className={cx(css.button, className)}
|
|
54
53
|
>
|
|
55
54
|
{label}
|
|
56
55
|
</MenuButton>
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.filterControl {
|
|
16
|
+
margin: 0;
|
|
16
17
|
flex: 0 0 auto;
|
|
17
18
|
height: 1em;
|
|
18
19
|
}
|
|
@@ -41,12 +42,14 @@
|
|
|
41
42
|
font-size: var(--size-small);
|
|
42
43
|
line-height: var(--space-small);
|
|
43
44
|
color: var(--color-text-ultra-light);
|
|
45
|
+
transition: var(--transition-out);
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
.filterSingle:hover,
|
|
47
49
|
.filterSingle:active,
|
|
48
50
|
.filterSingle:focus {
|
|
49
51
|
border-color: var(--color-outline-dark);
|
|
52
|
+
transition: var(--transition-in);
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
/** Filter group */
|
|
@@ -57,7 +60,10 @@
|
|
|
57
60
|
|
|
58
61
|
.filterGroupItem {
|
|
59
62
|
position: relative;
|
|
60
|
-
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.filterGroupItemFilter {
|
|
66
|
+
padding-right: 24px; /* space for only button */
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
.filterGroupOnlyButton {
|
|
@@ -76,6 +82,7 @@
|
|
|
76
82
|
content: ' ';
|
|
77
83
|
display: block;
|
|
78
84
|
position: absolute;
|
|
85
|
+
pointer-events: none;
|
|
79
86
|
top: 0;
|
|
80
87
|
right: 100%;
|
|
81
88
|
bottom: 0;
|
|
@@ -50,11 +50,10 @@ interface FilterGroupProps extends React.ComponentProps<'div'> {
|
|
|
50
50
|
|
|
51
51
|
const FilterGroup = (props: FilterGroupProps) => {
|
|
52
52
|
const { className = '', groupKey, data, values, onCheckboxChange, toggleFilters } = props;
|
|
53
|
+
const { label: groupLabel, children: groupItems } = data;
|
|
53
54
|
|
|
54
55
|
const [search, setSearch] = useState('');
|
|
55
56
|
|
|
56
|
-
const { label: groupLabel, children: groupItems } = data;
|
|
57
|
-
|
|
58
57
|
const areAllGroupItemsChecked = groupItems
|
|
59
58
|
.map(({ key: itemKey }) => values?.[`${groupKey}.${itemKey}`])
|
|
60
59
|
.reduce((agg, val) => agg && val, true);
|
|
@@ -98,7 +97,7 @@ const FilterGroup = (props: FilterGroupProps) => {
|
|
|
98
97
|
|
|
99
98
|
return (
|
|
100
99
|
<Dropdown
|
|
101
|
-
|
|
100
|
+
className={className}
|
|
102
101
|
label={dropdownLabel}
|
|
103
102
|
ariaLabel={`${groupLabel}: ${filterSuffix}`}
|
|
104
103
|
>
|
|
@@ -31,7 +31,7 @@ export const HoverCard = (props: HoverCardProps) => {
|
|
|
31
31
|
children,
|
|
32
32
|
} = props;
|
|
33
33
|
|
|
34
|
-
const state = useHovercardState({ gutter: 8, timeout: 300 });
|
|
34
|
+
const state = useHovercardState({ gutter: 8, timeout: 300, placement: 'top' });
|
|
35
35
|
const hovercardProps = useHovercard({ state, portal: true });
|
|
36
36
|
|
|
37
37
|
// Fallback to span if no href
|
package/src/ui/icon/icon.tsx
CHANGED
|
@@ -5,10 +5,11 @@ import css from './icon.module.css';
|
|
|
5
5
|
|
|
6
6
|
const ICONS = {
|
|
7
7
|
ARROW: 'arrow',
|
|
8
|
-
|
|
8
|
+
ARROW_RIGHT_CIRCLE: 'arrow-right-circle',
|
|
9
9
|
CANCEL: 'close',
|
|
10
10
|
CHEVRON_DOWN: 'chevron-down',
|
|
11
11
|
CHEVRON_UP: 'chevron-up',
|
|
12
|
+
CHECK: 'check',
|
|
12
13
|
CLOSE: 'close',
|
|
13
14
|
CLOCK: 'clock',
|
|
14
15
|
COMMIT: 'commit',
|
package/src/ui/loader/loader.jsx
CHANGED
|
@@ -4,7 +4,7 @@ import cx from 'classnames';
|
|
|
4
4
|
|
|
5
5
|
import css from './loader.module.css';
|
|
6
6
|
|
|
7
|
-
export const Loader = ({ className, size, ...restProps }) => (
|
|
7
|
+
export const Loader = ({ className = '', size = 'medium', ...restProps }) => (
|
|
8
8
|
<span className={cx(css.root, className, css[size])} {...restProps} />
|
|
9
9
|
);
|
|
10
10
|
|
|
@@ -89,6 +89,36 @@
|
|
|
89
89
|
border-width: 1px;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
/** cascade border radius */
|
|
93
|
+
.root thead,
|
|
94
|
+
.root thead tr:first-child {
|
|
95
|
+
border-top-left-radius: inherit;
|
|
96
|
+
border-top-right-radius: inherit;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.root thead tr:first-child th:first-child {
|
|
100
|
+
border-top-left-radius: inherit;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.root thead tr:first-child th:last-child {
|
|
104
|
+
border-top-right-radius: inherit;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.root tbody:last-child,
|
|
108
|
+
.root tbody:last-child tr:last-child {
|
|
109
|
+
border-bottom-left-radius: inherit;
|
|
110
|
+
border-bottom-right-radius: inherit;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.root tbody:last-child tr:last-child th:first-child,
|
|
114
|
+
.root tbody:last-child tr:last-child td:first-child {
|
|
115
|
+
border-bottom-left-radius: inherit;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.root tbody:last-child tr:last-child td:last-child {
|
|
119
|
+
border-bottom-right-radius: inherit;
|
|
120
|
+
}
|
|
121
|
+
|
|
92
122
|
/* compact variation */
|
|
93
123
|
.compact td,
|
|
94
124
|
.compact th {
|
|
@@ -42,7 +42,7 @@ a.root:active {
|
|
|
42
42
|
/** Size variation */
|
|
43
43
|
/** default: medium */
|
|
44
44
|
.root {
|
|
45
|
-
border-radius: var(--radius-
|
|
45
|
+
border-radius: var(--radius-small);
|
|
46
46
|
padding: calc(var(--space-xxxsmall) / 2) var(--space-xxxsmall);
|
|
47
47
|
min-width: var(--space-small);
|
|
48
48
|
height: var(--space-small);
|
|
@@ -51,7 +51,7 @@ a.root:active {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.small {
|
|
54
|
-
border-radius: var(--radius-
|
|
54
|
+
border-radius: var(--radius-xsmall);
|
|
55
55
|
padding: calc(var(--space-xxxsmall) / 2);
|
|
56
56
|
height: var(--space-xsmall);
|
|
57
57
|
min-width: var(--space-xsmall);
|
|
@@ -60,7 +60,7 @@ a.root:active {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.large {
|
|
63
|
-
border-radius: var(--radius-
|
|
63
|
+
border-radius: var(--radius-medium);
|
|
64
64
|
padding: var(--space-xxxsmall) var(--space-xxsmall);
|
|
65
65
|
min-width: var(--space-medium);
|
|
66
66
|
height: var(--space-medium);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export function Delta({ className, displayValue, deltaType, inverted }: {
|
|
2
|
-
className
|
|
2
|
+
className?: string | undefined;
|
|
3
3
|
displayValue: any;
|
|
4
4
|
deltaType: any;
|
|
5
|
-
inverted
|
|
5
|
+
inverted?: boolean | undefined;
|
|
6
6
|
}): React.JSX.Element;
|
|
7
7
|
export namespace Delta {
|
|
8
8
|
namespace defaultProps {
|
|
@@ -3,7 +3,9 @@ import { MetricsDisplayType } from '../../constants';
|
|
|
3
3
|
import { ControlGroup } from '../../ui/control-group';
|
|
4
4
|
interface MetricsDisplaySelectorProps {
|
|
5
5
|
value: MetricsDisplayType;
|
|
6
|
-
|
|
6
|
+
groupBy?: string;
|
|
7
|
+
groups?: Partial<Record<MetricsDisplayType, Array<string>>>;
|
|
8
|
+
onSelect: (newValue: MetricsDisplayType, groupBy?: string) => void;
|
|
7
9
|
}
|
|
8
10
|
export declare const MetricsDisplaySelector: (props: MetricsDisplaySelectorProps & Omit<React.ComponentProps<typeof ControlGroup>, 'onSelect' | 'value'>) => React.JSX.Element;
|
|
9
11
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReportMetricRow } from '@bundle-stats/utils';
|
|
2
|
+
export interface TreeTotal {
|
|
3
|
+
current: number;
|
|
4
|
+
baseline: number;
|
|
5
|
+
}
|
|
6
|
+
export interface TreeLeaf {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
value: number;
|
|
10
|
+
item: ReportMetricRow;
|
|
11
|
+
}
|
|
12
|
+
export interface Tree {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
value: number;
|
|
16
|
+
children: TreeNodeChildren;
|
|
17
|
+
total?: TreeTotal;
|
|
18
|
+
}
|
|
19
|
+
export type TreeNode = Tree | TreeLeaf;
|
|
20
|
+
export type TreeNodeChildren = Array<TreeNode>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type {
|
|
1
|
+
import React, { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
+
import type { Tree } from './metrics-treemap.constants';
|
|
3
3
|
interface MetricsTreemapProps {
|
|
4
|
-
|
|
5
|
-
emptyMessage?:
|
|
4
|
+
treeNodes: Tree;
|
|
5
|
+
emptyMessage?: ReactNode;
|
|
6
|
+
nested?: boolean;
|
|
6
7
|
onItemClick?: (entryId: string) => void;
|
|
8
|
+
onGroupClick?: (entryId: string) => void;
|
|
7
9
|
}
|
|
8
|
-
export declare const MetricsTreemap: (props: MetricsTreemapProps &
|
|
10
|
+
export declare const MetricsTreemap: (props: MetricsTreemapProps & ComponentProps<'div'>) => React.JSX.Element;
|
|
9
11
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DeltaType, type MetricRunInfoBaseline, type MetricRunInfo, type ReportMetricRow } from '@bundle-stats/utils';
|
|
2
|
+
import type { Tree } from './metrics-treemap.constants';
|
|
3
|
+
export declare function getTreemapNodes(items: Array<ReportMetricRow>): Tree;
|
|
4
|
+
export declare function getTreemapNodesGroupedByPath(items: Array<ReportMetricRow>): Tree;
|
|
5
|
+
export declare function resolveGroupDeltaType(metricRunInfo?: MetricRunInfo | MetricRunInfoBaseline): DeltaType.NO_CHANGE | DeltaType.NEGATIVE | DeltaType.POSITIVE;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { MetricsDisplayType } from '../constants';
|
|
2
|
-
type UseMetricsDisplayType = [
|
|
3
|
-
|
|
2
|
+
type UseMetricsDisplayType = [
|
|
3
|
+
{
|
|
4
|
+
value: MetricsDisplayType;
|
|
5
|
+
groupBy?: string;
|
|
6
|
+
},
|
|
7
|
+
(newDisplayType: MetricsDisplayType, newGroupBy?: string) => void
|
|
8
|
+
];
|
|
9
|
+
export declare const useMetricsDisplayType: (groups?: Partial<Record<MetricsDisplayType, Array<string>>>) => UseMetricsDisplayType;
|
|
4
10
|
export {};
|
|
@@ -5,7 +5,6 @@ interface DropdownItemProps {
|
|
|
5
5
|
}
|
|
6
6
|
export declare const DropdownItem: (props: DropdownItemProps & React.ComponentProps<typeof MenuItem>) => React.JSX.Element;
|
|
7
7
|
interface DropdownProps {
|
|
8
|
-
buttonClassName?: string;
|
|
9
8
|
dropdownClassName?: string;
|
|
10
9
|
label?: React.ReactNode;
|
|
11
10
|
ariaLabel?: string;
|
package/types/ui/icon/icon.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const ICONS: {
|
|
3
3
|
readonly ARROW: "arrow";
|
|
4
|
-
readonly
|
|
4
|
+
readonly ARROW_RIGHT_CIRCLE: "arrow-right-circle";
|
|
5
5
|
readonly CANCEL: "close";
|
|
6
6
|
readonly CHEVRON_DOWN: "chevron-down";
|
|
7
7
|
readonly CHEVRON_UP: "chevron-up";
|
|
8
|
+
readonly CHECK: "check";
|
|
8
9
|
readonly CLOSE: "close";
|
|
9
10
|
readonly CLOCK: "clock";
|
|
10
11
|
readonly COMMIT: "commit";
|
|
@@ -36,10 +37,11 @@ export declare const Icon: {
|
|
|
36
37
|
(props: IconProps & React.ComponentProps<'span'>): React.JSX.Element;
|
|
37
38
|
ICONS: {
|
|
38
39
|
readonly ARROW: "arrow";
|
|
39
|
-
readonly
|
|
40
|
+
readonly ARROW_RIGHT_CIRCLE: "arrow-right-circle";
|
|
40
41
|
readonly CANCEL: "close";
|
|
41
42
|
readonly CHEVRON_DOWN: "chevron-down";
|
|
42
43
|
readonly CHEVRON_UP: "chevron-up";
|
|
44
|
+
readonly CHECK: "check";
|
|
43
45
|
readonly CLOSE: "close";
|
|
44
46
|
readonly CLOCK: "clock";
|
|
45
47
|
readonly COMMIT: "commit";
|