@bundle-stats/ui 4.16.0-beta.1 → 4.16.0-beta.11
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 +5 -3
- package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js +4 -2
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.js +4 -2
- package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib/components/bundle-packages/bundle-packages.js +4 -2
- package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib/components/insights/insights.module.css +1 -0
- package/lib/components/metrics-table-export/metrics-table-export.js +10 -12
- package/lib/components/metrics-table-export/metrics-table-export.js.map +1 -1
- package/lib/components/metrics-table-options/metrics-table-options.js +7 -5
- package/lib/components/metrics-table-options/metrics-table-options.js.map +1 -1
- package/lib/components/metrics-table-options/metrics-table-options.module.css +5 -0
- package/lib/components/preview-source/preview-source.js +8 -5
- package/lib/components/preview-source/preview-source.js.map +1 -1
- package/lib/components/preview-source/preview-source.module.css +12 -0
- package/lib/css/variables.css +4 -0
- package/lib/i18n.js +2 -0
- package/lib/i18n.js.map +1 -1
- package/lib/ui/dialog/dialog.module.css +3 -3
- package/lib/ui/index.js +3 -1
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/markdown/index.js +18 -0
- package/lib/ui/markdown/index.js.map +1 -0
- package/lib/ui/markdown/markdown.js +40 -0
- package/lib/ui/markdown/markdown.js.map +1 -0
- package/lib/ui/markdown/markdown.module.css +7 -0
- package/lib/ui/skeleton/skeleton.module.css +3 -3
- package/lib/ui/tabs/index.js +15 -3
- package/lib/ui/tabs/index.js.map +1 -1
- package/lib/ui/tabs/tabs.js +9 -20
- package/lib/ui/tabs/tabs.js.map +1 -1
- package/lib/ui/tabs/tabs.module.css +6 -5
- package/lib/ui/textarea/textarea.js +2 -2
- package/lib/ui/textarea/textarea.js.map +1 -1
- package/lib/ui/textarea/textarea.module.css +0 -7
- package/lib-esm/components/bundle-assets/bundle-assets.js +6 -4
- package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js +5 -3
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.js +5 -3
- package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib-esm/components/bundle-packages/bundle-packages.js +5 -3
- package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib-esm/components/insights/insights.module.css +1 -0
- package/lib-esm/components/metrics-table-export/metrics-table-export.js +11 -10
- package/lib-esm/components/metrics-table-export/metrics-table-export.js.map +1 -1
- package/lib-esm/components/metrics-table-options/metrics-table-options.js +7 -5
- package/lib-esm/components/metrics-table-options/metrics-table-options.js.map +1 -1
- package/lib-esm/components/metrics-table-options/metrics-table-options.module.css +5 -0
- package/lib-esm/components/preview-source/preview-source.js +8 -5
- package/lib-esm/components/preview-source/preview-source.js.map +1 -1
- package/lib-esm/components/preview-source/preview-source.module.css +12 -0
- package/lib-esm/css/variables.css +4 -0
- package/lib-esm/i18n.js +2 -0
- package/lib-esm/i18n.js.map +1 -1
- package/lib-esm/ui/dialog/dialog.module.css +3 -3
- package/lib-esm/ui/index.js +1 -0
- package/lib-esm/ui/index.js.map +1 -1
- package/lib-esm/ui/markdown/index.js +2 -0
- package/lib-esm/ui/markdown/index.js.map +1 -0
- package/lib-esm/ui/markdown/markdown.js +10 -0
- package/lib-esm/ui/markdown/markdown.js.map +1 -0
- package/lib-esm/ui/markdown/markdown.module.css +7 -0
- package/lib-esm/ui/skeleton/skeleton.module.css +3 -3
- package/lib-esm/ui/tabs/index.js +1 -1
- package/lib-esm/ui/tabs/index.js.map +1 -1
- package/lib-esm/ui/tabs/tabs.js +7 -19
- package/lib-esm/ui/tabs/tabs.js.map +1 -1
- package/lib-esm/ui/tabs/tabs.module.css +6 -5
- package/lib-esm/ui/textarea/textarea.js +2 -2
- package/lib-esm/ui/textarea/textarea.js.map +1 -1
- package/lib-esm/ui/textarea/textarea.module.css +0 -7
- package/package.json +11 -10
- package/src/components/bundle-assets/bundle-assets.jsx +16 -8
- package/src/components/bundle-assets-totals/bundle-assets-totals.jsx +11 -3
- package/src/components/bundle-modules/bundle-modules.tsx +11 -3
- package/src/components/bundle-packages/bundle-packages.jsx +11 -3
- package/src/components/insights/insights.module.css +1 -0
- package/src/components/metrics-table-export/metrics-table-export.tsx +28 -20
- package/src/components/metrics-table-options/metrics-table-options.module.css +5 -0
- package/src/components/metrics-table-options/metrics-table-options.tsx +14 -6
- package/src/components/preview-source/preview-source.module.css +12 -0
- package/src/components/preview-source/preview-source.stories.tsx +19 -1
- package/src/components/preview-source/preview-source.tsx +30 -21
- package/src/css/variables.css +4 -0
- package/src/i18n.js +2 -0
- package/src/ui/dialog/dialog.module.css +3 -3
- package/src/ui/index.js +1 -0
- package/src/ui/markdown/index.ts +1 -0
- package/src/ui/markdown/markdown.module.css +7 -0
- package/src/ui/markdown/markdown.stories.tsx +29 -0
- package/src/ui/markdown/markdown.tsx +24 -0
- package/src/ui/skeleton/skeleton.module.css +3 -3
- package/src/ui/tabs/index.ts +1 -0
- package/src/ui/tabs/tabs.module.css +6 -5
- package/src/ui/tabs/tabs.stories.tsx +25 -0
- package/src/ui/tabs/tabs.tsx +32 -0
- package/src/ui/textarea/textarea.module.css +0 -7
- package/src/ui/textarea/textarea.tsx +2 -8
- package/types/components/metrics-table-export/metrics-table-export.d.ts +1 -0
- package/types/components/metrics-table-options/metrics-table-options.d.ts +1 -1
- package/types/components/preview-source/preview-source.d.ts +2 -1
- package/types/i18n.d.ts +2 -0
- package/types/ui/index.d.ts +1 -0
- package/types/ui/markdown/index.d.ts +1 -0
- package/types/ui/markdown/markdown.d.ts +7 -0
- package/types/ui/tabs/index.d.ts +1 -1
- package/types/ui/tabs/tabs.d.ts +11 -41
- package/types/ui/textarea/textarea.d.ts +0 -1
- package/lib/components/metrics-table-export/metrics-table-export.module.css +0 -8
- package/lib-esm/components/metrics-table-export/metrics-table-export.module.css +0 -8
- package/src/components/metrics-table-export/metrics-table-export.module.css +0 -8
- package/src/ui/tabs/index.js +0 -1
- package/src/ui/tabs/tabs.jsx +0 -39
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
z-index: 2;
|
|
8
8
|
top: var(--space-xsmall);
|
|
9
9
|
right: var(--space-xsmall);
|
|
10
|
+
background: var(--color-background);
|
|
11
|
+
border-radius: var(--radius-medium);
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
/** fix control group with nested components */
|
|
@@ -21,8 +23,18 @@
|
|
|
21
23
|
box-shadow: none;
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
/** Source content */
|
|
24
27
|
.content {
|
|
25
28
|
position: relative;
|
|
26
29
|
z-index: 1;
|
|
27
30
|
height: 100%;
|
|
31
|
+
background: var(--color-highlight);
|
|
32
|
+
color: var(--color-text);
|
|
33
|
+
font-family: var(--font-family-fixed);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Empty / loading state */
|
|
37
|
+
.isEmpty .content {
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
background: var(--color-highlight);
|
|
28
40
|
}
|
|
@@ -29,7 +29,25 @@ const SOURCE = JSON.stringify(
|
|
|
29
29
|
|
|
30
30
|
export const Default: Story = {
|
|
31
31
|
args: {
|
|
32
|
-
source:
|
|
32
|
+
source: JSON.stringify(
|
|
33
|
+
[
|
|
34
|
+
{
|
|
35
|
+
label: 'Hey',
|
|
36
|
+
runs: [
|
|
37
|
+
{ value: 1, name: 'a' },
|
|
38
|
+
{ value: 2, name: 'b' },
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
null,
|
|
43
|
+
2,
|
|
44
|
+
),
|
|
45
|
+
download: 'bundle-stats--assets.json',
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Empty: Story = {
|
|
50
|
+
args: {
|
|
33
51
|
download: 'bundle-stats--assets.json',
|
|
34
52
|
},
|
|
35
53
|
};
|
|
@@ -9,8 +9,14 @@ import { Tooltip } from '../../ui/tooltip';
|
|
|
9
9
|
import { Textarea } from '../../ui/textarea';
|
|
10
10
|
import css from './preview-source.module.css';
|
|
11
11
|
|
|
12
|
+
const DEFAULT_ROWS = 10;
|
|
13
|
+
|
|
12
14
|
type PreviewSourceProps = {
|
|
13
|
-
source
|
|
15
|
+
source?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Textarea rows
|
|
18
|
+
*/
|
|
19
|
+
rows?: number;
|
|
14
20
|
/**
|
|
15
21
|
* Link download attribute
|
|
16
22
|
* @example
|
|
@@ -20,28 +26,31 @@ type PreviewSourceProps = {
|
|
|
20
26
|
} & ComponentProps<'div'>;
|
|
21
27
|
|
|
22
28
|
export const PreviewSource = (props: PreviewSourceProps) => {
|
|
23
|
-
const { className = '', source, download = false, ...restProps } = props;
|
|
29
|
+
const { className = '', source, rows = DEFAULT_ROWS, download = false, ...restProps } = props;
|
|
30
|
+
|
|
31
|
+
const isEmpty = !source;
|
|
32
|
+
const rootClassName = cx(css.root, className, isEmpty && css.isEmpty);
|
|
24
33
|
|
|
25
34
|
return (
|
|
26
|
-
<div className={
|
|
27
|
-
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
<div className={rootClassName} {...restProps}>
|
|
36
|
+
{source && (
|
|
37
|
+
<ControlGroup className={css.toolbar}>
|
|
38
|
+
<CopyToClipboard outline size="small" text={source} />
|
|
39
|
+
{download && (
|
|
40
|
+
<Tooltip title={`Download ${download}`} className={css.downloadTooltip}>
|
|
41
|
+
<Button
|
|
42
|
+
outline
|
|
43
|
+
rightGlyph={BUTTON_GLYPHS.DOWNLOAD}
|
|
44
|
+
size="small"
|
|
45
|
+
as="a"
|
|
46
|
+
href={`data:application/json,${encodeURIComponent(source)}`}
|
|
47
|
+
download={download}
|
|
48
|
+
/>
|
|
49
|
+
</Tooltip>
|
|
50
|
+
)}
|
|
51
|
+
</ControlGroup>
|
|
52
|
+
)}
|
|
53
|
+
<Textarea readOnly rows={rows} value={source} className={css.content} />
|
|
45
54
|
</div>
|
|
46
55
|
);
|
|
47
56
|
};
|
package/src/css/variables.css
CHANGED
|
@@ -201,6 +201,10 @@
|
|
|
201
201
|
|
|
202
202
|
--outline-hover: 0 0 0 var(--space-xxxsmall) var(--color-highlight);
|
|
203
203
|
|
|
204
|
+
--skeleton-inline-background: linear-gradient(transparent 10%, currentColor 10.1%, currentColor 89.9%, transparent 90%);
|
|
205
|
+
--skeleton-block-background: currentColor;
|
|
206
|
+
--skeleton-opacity: 0.06;
|
|
207
|
+
|
|
204
208
|
/** Layout */
|
|
205
209
|
--max-width: 88rem;
|
|
206
210
|
--entry-info-width: 64rem;
|
package/src/i18n.js
CHANGED
|
@@ -22,6 +22,8 @@ export default {
|
|
|
22
22
|
RESET_FILTERS: 'Reset filters',
|
|
23
23
|
VIEW_ALL: 'View all entries',
|
|
24
24
|
EXPORT: 'Export',
|
|
25
|
+
EXPORT_CSV: 'Export CSV',
|
|
26
|
+
EXPORT_JSON: 'Export JSON',
|
|
25
27
|
|
|
26
28
|
COPY_TO_CLIPBOARD: 'Copy to clipboard',
|
|
27
29
|
COPY_TO_CLIPBOARD_DONE: 'Copied to clipboard',
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
|
|
62
62
|
/** Width variation */
|
|
63
63
|
.width--narrow {
|
|
64
|
-
max-width:
|
|
64
|
+
max-width: 360px;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.width--medium {
|
|
68
|
-
max-width:
|
|
68
|
+
max-width: 640px;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
.width--wide {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.width--extra-wide {
|
|
76
|
-
max-width: var(--max-width);
|
|
76
|
+
max-width: calc(var(--max-width) + 2 * var(--space-medium));
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/** Center variation */
|
package/src/ui/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export { Icon } from './icon';
|
|
|
13
13
|
export { Input } from './input';
|
|
14
14
|
export { InputSearch } from './input-search';
|
|
15
15
|
export { Loader } from './loader';
|
|
16
|
+
export { Markdown } from './markdown';
|
|
16
17
|
export { Skeleton } from './skeleton';
|
|
17
18
|
export { Table } from './table';
|
|
18
19
|
export { Tabs } from './tabs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './markdown';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Markdown } from '.';
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Markdown> = {
|
|
5
|
+
title: 'UI/Markdown',
|
|
6
|
+
component: Markdown,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default meta;
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
content: '**One line** _markdown_ content',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const MULTI_LINE_MARKDOWN = `
|
|
20
|
+
**Lorem ipsum** dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Habitant morbi tristique senectus et netus et malesuada.
|
|
21
|
+
|
|
22
|
+
Eget nunc scelerisque viverra mauris in. Ipsum dolor sit amet consectetur adipiscing.
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
export const MultiLine: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
content: MULTI_LINE_MARKDOWN,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { ComponentProps, ElementType, useMemo } from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import snarkdown from 'snarkdown';
|
|
4
|
+
|
|
5
|
+
import css from './markdown.module.css';
|
|
6
|
+
|
|
7
|
+
type MarkdownProps = {
|
|
8
|
+
content?: string;
|
|
9
|
+
as?: ElementType;
|
|
10
|
+
} & ComponentProps<'div'>;
|
|
11
|
+
|
|
12
|
+
export const Markdown = (props: MarkdownProps) => {
|
|
13
|
+
const { className = '', content = '', as: Component = 'div', ...restProps } = props;
|
|
14
|
+
|
|
15
|
+
const html = useMemo(() => snarkdown(content), [content]);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Component
|
|
19
|
+
className={cx(css.root, className)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
dangerouslySetInnerHTML={{ __html: html }}
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.root {
|
|
2
|
-
background:
|
|
3
|
-
opacity:
|
|
2
|
+
background: var(--skeleton-inline-background);
|
|
3
|
+
opacity: var(--skeleton-opacity);
|
|
4
4
|
pointer-events: none;
|
|
5
5
|
min-width: 6em;
|
|
6
6
|
border-radius: var(--radius-medium);
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.block {
|
|
17
|
-
background:
|
|
17
|
+
background: var(--skeleton-block-background);
|
|
18
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tabs';
|
|
@@ -4,12 +4,16 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.item {
|
|
7
|
+
appearance: none;
|
|
8
|
+
background: none;
|
|
9
|
+
border: 0;
|
|
7
10
|
position: relative;
|
|
8
11
|
display: inline-block;
|
|
9
12
|
padding: var(--space-xsmall) var(--space-small);
|
|
10
13
|
color: var(--color-text-ultra-light);
|
|
11
14
|
font-weight: bold;
|
|
12
15
|
text-decoration: none;
|
|
16
|
+
transition: var(--ui-transition-out);
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
.item::after {
|
|
@@ -26,8 +30,9 @@
|
|
|
26
30
|
.item:hover,
|
|
27
31
|
.item:active,
|
|
28
32
|
.item:focus {
|
|
29
|
-
color: var(--color-primary
|
|
33
|
+
color: var(--color-primary);
|
|
30
34
|
outline: none;
|
|
35
|
+
transition: var(--ui-transition-out);
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
.item:hover::after,
|
|
@@ -43,7 +48,3 @@
|
|
|
43
48
|
.itemActive::after {
|
|
44
49
|
background: currentColor;
|
|
45
50
|
}
|
|
46
|
-
|
|
47
|
-
.item + .item {
|
|
48
|
-
_margin-left: var(--space-medium);
|
|
49
|
-
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
|
|
4
|
+
import { getWrapperDecorator } from '../../stories';
|
|
5
|
+
import { Tabs, TabItem } from '.';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Tabs> = {
|
|
8
|
+
title: 'UI/Tabs',
|
|
9
|
+
component: Tabs,
|
|
10
|
+
decorators: [getWrapperDecorator()],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
render: () => (
|
|
19
|
+
<Tabs>
|
|
20
|
+
<TabItem isTabActive>Option A</TabItem>
|
|
21
|
+
<TabItem>Option B</TabItem>
|
|
22
|
+
<TabItem>Option C</TabItem>
|
|
23
|
+
</Tabs>
|
|
24
|
+
),
|
|
25
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ComponentProps, ElementType } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import cx from 'classnames';
|
|
4
|
+
|
|
5
|
+
import css from './tabs.module.css';
|
|
6
|
+
|
|
7
|
+
export type TabItemProps<T extends ElementType> = {
|
|
8
|
+
isTabActive?: boolean;
|
|
9
|
+
as?: T;
|
|
10
|
+
} & ComponentProps<T>;
|
|
11
|
+
|
|
12
|
+
export const TabItem = <T extends ElementType = 'button'>(props: TabItemProps<T>) => {
|
|
13
|
+
const { className = '', as: Component = 'button', isTabActive = false, ...restProps } = props;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Component
|
|
17
|
+
role="tab"
|
|
18
|
+
className={cx(css.item, className, isTabActive && css.itemActive)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type TabsProps = ComponentProps<'div'>;
|
|
25
|
+
|
|
26
|
+
export const Tabs = (props: TabsProps) => {
|
|
27
|
+
const { className = '', ...restProps } = props;
|
|
28
|
+
|
|
29
|
+
return <div role="tablist" className={cx(css.root, className)} {...restProps} />;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
Tabs.Item = TabItem;
|
|
@@ -5,19 +5,13 @@ import cx from 'classnames';
|
|
|
5
5
|
import css from './textarea.module.css';
|
|
6
6
|
|
|
7
7
|
export type TextareaProps = {
|
|
8
|
-
previewSource?: boolean;
|
|
9
8
|
size?: 'small' | 'medium' | 'large';
|
|
10
9
|
} & ComponentProps<'textarea'>;
|
|
11
10
|
|
|
12
11
|
export const Textarea = (props: TextareaProps) => {
|
|
13
|
-
const { className = '',
|
|
12
|
+
const { className = '', size = '', ...restProps } = props;
|
|
14
13
|
|
|
15
|
-
const rootClassName = cx(
|
|
16
|
-
css.root,
|
|
17
|
-
previewSource && css.previewSource,
|
|
18
|
-
size && css[size],
|
|
19
|
-
className,
|
|
20
|
-
);
|
|
14
|
+
const rootClassName = cx(css.root, size && css[size], className);
|
|
21
15
|
|
|
22
16
|
return <textarea className={rootClassName} {...restProps} />;
|
|
23
17
|
};
|
|
@@ -4,6 +4,7 @@ import type { ReportMetricRow } from '@bundle-stats/utils';
|
|
|
4
4
|
import { Stack } from '../../layout/stack';
|
|
5
5
|
type MetricsTableExportProps = {
|
|
6
6
|
items: Array<ReportMetricRow>;
|
|
7
|
+
initialSourceType?: string;
|
|
7
8
|
download: string;
|
|
8
9
|
} & ComponentProps<typeof Stack>;
|
|
9
10
|
export declare const MetricsTableExport: (props: MetricsTableExportProps) => React.JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { Dropdown } from '../../ui/dropdown';
|
|
|
4
4
|
type MetricsTableOptionsProps = {
|
|
5
5
|
onViewAllClick?: () => void;
|
|
6
6
|
onResetClick?: () => void;
|
|
7
|
-
onExportClick?: () => void;
|
|
7
|
+
onExportClick?: (sourceType: string) => void;
|
|
8
8
|
} & ComponentProps<typeof Dropdown>;
|
|
9
9
|
export declare const MetricsTableOptions: (props: MetricsTableOptionsProps) => React.JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
type PreviewSourceProps = {
|
|
4
|
-
source
|
|
4
|
+
source?: string;
|
|
5
|
+
rows?: number;
|
|
5
6
|
download?: string;
|
|
6
7
|
} & ComponentProps<'div'>;
|
|
7
8
|
export declare const PreviewSource: (props: PreviewSourceProps) => React.JSX.Element;
|
package/types/i18n.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ declare namespace _default {
|
|
|
15
15
|
let RESET_FILTERS: string;
|
|
16
16
|
let VIEW_ALL: string;
|
|
17
17
|
let EXPORT: string;
|
|
18
|
+
let EXPORT_CSV: string;
|
|
19
|
+
let EXPORT_JSON: string;
|
|
18
20
|
let COPY_TO_CLIPBOARD: string;
|
|
19
21
|
let COPY_TO_CLIPBOARD_DONE: string;
|
|
20
22
|
let GITHUB_LINK_TITLE: string;
|
package/types/ui/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { Icon } from "./icon";
|
|
|
13
13
|
export { Input } from "./input";
|
|
14
14
|
export { InputSearch } from "./input-search";
|
|
15
15
|
export { Loader } from "./loader";
|
|
16
|
+
export { Markdown } from "./markdown";
|
|
16
17
|
export { Skeleton } from "./skeleton";
|
|
17
18
|
export { Table } from "./table";
|
|
18
19
|
export { Tabs } from "./tabs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './markdown';
|
package/types/ui/tabs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './tabs';
|
package/types/ui/tabs/tabs.d.ts
CHANGED
|
@@ -1,42 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
[x: string]: any;
|
|
3
|
-
className?: string | undefined;
|
|
4
|
-
}): React.JSX.Element;
|
|
5
|
-
export namespace Tabs {
|
|
6
|
-
export namespace defaultProps {
|
|
7
|
-
let className: string;
|
|
8
|
-
}
|
|
9
|
-
export namespace propTypes {
|
|
10
|
-
let className_1: PropTypes.Requireable<string>;
|
|
11
|
-
export { className_1 as className };
|
|
12
|
-
export let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
13
|
-
}
|
|
14
|
-
export { Item };
|
|
15
|
-
}
|
|
1
|
+
import type { ComponentProps, ElementType } from 'react';
|
|
16
2
|
import React from 'react';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
let className_2: string;
|
|
28
|
-
export { className_2 as className };
|
|
29
|
-
export let as: string;
|
|
30
|
-
}
|
|
31
|
-
export { defaultProps_1 as defaultProps };
|
|
32
|
-
export namespace propTypes_1 {
|
|
33
|
-
let isTabActive_1: PropTypes.Requireable<boolean>;
|
|
34
|
-
export { isTabActive_1 as isTabActive };
|
|
35
|
-
let className_3: PropTypes.Requireable<string>;
|
|
36
|
-
export { className_3 as className };
|
|
37
|
-
let as_1: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
|
38
|
-
export { as_1 as as };
|
|
39
|
-
}
|
|
40
|
-
export { propTypes_1 as propTypes };
|
|
41
|
-
}
|
|
42
|
-
export {};
|
|
3
|
+
export type TabItemProps<T extends ElementType> = {
|
|
4
|
+
isTabActive?: boolean;
|
|
5
|
+
as?: T;
|
|
6
|
+
} & ComponentProps<T>;
|
|
7
|
+
export declare const TabItem: <T extends ElementType = "button">(props: TabItemProps<T>) => React.JSX.Element;
|
|
8
|
+
export type TabsProps = ComponentProps<'div'>;
|
|
9
|
+
export declare const Tabs: {
|
|
10
|
+
(props: TabsProps): React.JSX.Element;
|
|
11
|
+
Item: <T extends ElementType = "button">(props: TabItemProps<T>) => React.JSX.Element;
|
|
12
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export type TextareaProps = {
|
|
4
|
-
previewSource?: boolean;
|
|
5
4
|
size?: 'small' | 'medium' | 'large';
|
|
6
5
|
} & ComponentProps<'textarea'>;
|
|
7
6
|
export declare const Textarea: (props: TextareaProps) => React.JSX.Element;
|
package/src/ui/tabs/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Tabs } from './tabs';
|
package/src/ui/tabs/tabs.jsx
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import cx from 'classnames';
|
|
4
|
-
|
|
5
|
-
import css from './tabs.module.css';
|
|
6
|
-
|
|
7
|
-
const Item = ({ isTabActive, as: Component = 'span', className = '', ...restProps }) => (
|
|
8
|
-
<Component className={cx(css.item, className, isTabActive && css.itemActive)} {...restProps} />
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
Item.defaultProps = {
|
|
12
|
-
isTabActive: false,
|
|
13
|
-
className: '',
|
|
14
|
-
as: 'span',
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
Item.propTypes = {
|
|
18
|
-
isTabActive: PropTypes.bool,
|
|
19
|
-
className: PropTypes.string,
|
|
20
|
-
as: PropTypes.elementType,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const Tabs = ({ className = '', ...restProps }) => (
|
|
24
|
-
<nav className={cx(css.root, className)} {...restProps} />
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
Tabs.defaultProps = {
|
|
28
|
-
className: '',
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
Tabs.propTypes = {
|
|
32
|
-
/** Adopted child class name */
|
|
33
|
-
className: PropTypes.string,
|
|
34
|
-
|
|
35
|
-
/** Component children */
|
|
36
|
-
children: PropTypes.node.isRequired,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
Tabs.Item = Item;
|