@bundle-stats/ui 4.16.0 → 4.17.0-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.
Files changed (103) hide show
  1. package/lib/components/asset-info/asset-info.js +14 -5
  2. package/lib/components/asset-info/asset-info.js.map +1 -1
  3. package/lib/components/asset-info/asset-info.module.css +9 -0
  4. package/lib/components/asset-meta-tag/asset-meta-tag.js +17 -0
  5. package/lib/components/asset-meta-tag/asset-meta-tag.js.map +1 -0
  6. package/lib/components/asset-meta-tag/asset-meta-tag.module.css +56 -0
  7. package/lib/components/asset-meta-tag/index.js +18 -0
  8. package/lib/components/asset-meta-tag/index.js.map +1 -0
  9. package/lib/components/asset-name/asset-name.js +31 -0
  10. package/lib/components/asset-name/asset-name.js.map +1 -0
  11. package/lib/components/asset-name/asset-name.module.css +32 -0
  12. package/lib/components/asset-name/index.js +18 -0
  13. package/lib/components/asset-name/index.js.map +1 -0
  14. package/lib/components/asset-not-predictive/asset-not-predictive.js +6 -4
  15. package/lib/components/asset-not-predictive/asset-not-predictive.js.map +1 -1
  16. package/lib/components/asset-not-predictive/asset-not-predictive.module.css +6 -1
  17. package/lib/components/bundle-assets/bundle-assets.js +3 -38
  18. package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
  19. package/lib/components/bundle-assets/bundle-assets.module.css +0 -64
  20. package/lib/components/bundle-assets/bundle-assets.utils.js +62 -29
  21. package/lib/components/bundle-assets/bundle-assets.utils.js.map +1 -1
  22. package/lib/components/bundle-assets/index.js +1 -1
  23. package/lib/components/bundle-assets/index.js.map +1 -1
  24. package/lib/components/entry-info/entry-info.js +4 -3
  25. package/lib/components/entry-info/entry-info.js.map +1 -1
  26. package/lib/components/metrics-treemap/metrics-treemap.utils.js +0 -1
  27. package/lib/components/metrics-treemap/metrics-treemap.utils.js.map +1 -1
  28. package/lib/components/preview-source/preview-source.js +1 -1
  29. package/lib/components/preview-source/preview-source.js.map +1 -1
  30. package/lib/stories/wrapper.js +5 -2
  31. package/lib/stories/wrapper.js.map +1 -1
  32. package/lib/ui/tag/tag.js.map +1 -1
  33. package/lib-esm/components/asset-info/asset-info.js +14 -5
  34. package/lib-esm/components/asset-info/asset-info.js.map +1 -1
  35. package/lib-esm/components/asset-info/asset-info.module.css +9 -0
  36. package/lib-esm/components/asset-meta-tag/asset-meta-tag.js +10 -0
  37. package/lib-esm/components/asset-meta-tag/asset-meta-tag.js.map +1 -0
  38. package/lib-esm/components/asset-meta-tag/asset-meta-tag.module.css +56 -0
  39. package/lib-esm/components/asset-meta-tag/index.js +2 -0
  40. package/lib-esm/components/asset-meta-tag/index.js.map +1 -0
  41. package/lib-esm/components/asset-name/asset-name.js +24 -0
  42. package/lib-esm/components/asset-name/asset-name.js.map +1 -0
  43. package/lib-esm/components/asset-name/asset-name.module.css +32 -0
  44. package/lib-esm/components/asset-name/index.js +2 -0
  45. package/lib-esm/components/asset-name/index.js.map +1 -0
  46. package/lib-esm/components/asset-not-predictive/asset-not-predictive.js +6 -4
  47. package/lib-esm/components/asset-not-predictive/asset-not-predictive.js.map +1 -1
  48. package/lib-esm/components/asset-not-predictive/asset-not-predictive.module.css +6 -1
  49. package/lib-esm/components/bundle-assets/bundle-assets.js +3 -38
  50. package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
  51. package/lib-esm/components/bundle-assets/bundle-assets.module.css +0 -64
  52. package/lib-esm/components/bundle-assets/bundle-assets.utils.js +58 -25
  53. package/lib-esm/components/bundle-assets/bundle-assets.utils.js.map +1 -1
  54. package/lib-esm/components/bundle-assets/index.js +2 -2
  55. package/lib-esm/components/bundle-assets/index.js.map +1 -1
  56. package/lib-esm/components/entry-info/entry-info.js +4 -3
  57. package/lib-esm/components/entry-info/entry-info.js.map +1 -1
  58. package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js +0 -1
  59. package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js.map +1 -1
  60. package/lib-esm/components/preview-source/preview-source.js +1 -1
  61. package/lib-esm/components/preview-source/preview-source.js.map +1 -1
  62. package/lib-esm/stories/wrapper.js +5 -2
  63. package/lib-esm/stories/wrapper.js.map +1 -1
  64. package/lib-esm/ui/tag/tag.js.map +1 -1
  65. package/package.json +11 -11
  66. package/src/app/app-gladys.stories.tsx +41 -0
  67. package/src/app/app-home-assistant.stories.tsx +41 -0
  68. package/src/app/app-outline.stories.tsx +41 -0
  69. package/src/app/app.stories.tsx +127 -0
  70. package/src/components/asset-info/asset-info.module.css +9 -0
  71. package/src/components/asset-info/asset-info.tsx +46 -14
  72. package/src/components/asset-meta-tag/asset-meta-tag.module.css +56 -0
  73. package/src/components/asset-meta-tag/asset-meta-tag.tsx +34 -0
  74. package/src/components/asset-meta-tag/index.ts +1 -0
  75. package/src/components/asset-name/asset-name.module.css +32 -0
  76. package/src/components/asset-name/asset-name.stories.tsx +85 -0
  77. package/src/components/asset-name/asset-name.tsx +59 -0
  78. package/src/components/asset-name/index.ts +1 -0
  79. package/src/components/asset-not-predictive/asset-not-predictive.module.css +6 -1
  80. package/src/components/asset-not-predictive/asset-not-predictive.tsx +16 -12
  81. package/src/components/bundle-assets/__tests__/add-metric-report-asset-row-data.ts +235 -0
  82. package/src/components/bundle-assets/__tests__/get-asset-meta-status.ts +21 -0
  83. package/src/components/bundle-assets/__tests__/get-is-not-predictive.ts +119 -0
  84. package/src/components/bundle-assets/bundle-assets.jsx +15 -84
  85. package/src/components/bundle-assets/bundle-assets.module.css +0 -64
  86. package/src/components/bundle-assets/bundle-assets.utils.js +95 -26
  87. package/src/components/bundle-assets/index.jsx +2 -7
  88. package/src/components/entry-info/entry-info.tsx +18 -13
  89. package/src/components/metrics-treemap/metrics-treemap.utils.ts +0 -1
  90. package/src/components/preview-source/preview-source.tsx +11 -1
  91. package/src/stories/wrapper.jsx +21 -15
  92. package/src/types.d.ts +30 -1
  93. package/src/ui/tag/tag.tsx +4 -3
  94. package/types/components/asset-info/asset-info.d.ts +5 -4
  95. package/types/components/asset-meta-tag/asset-meta-tag.d.ts +8 -0
  96. package/types/components/asset-meta-tag/index.d.ts +1 -0
  97. package/types/components/asset-name/asset-name.d.ts +8 -0
  98. package/types/components/asset-name/index.d.ts +1 -0
  99. package/types/components/asset-not-predictive/asset-not-predictive.d.ts +6 -6
  100. package/types/components/bundle-assets/bundle-assets.utils.d.ts +3 -3
  101. package/types/components/entry-info/entry-info.d.ts +7 -1
  102. package/types/stories/wrapper.d.ts +1 -1
  103. package/types/ui/tag/tag.d.ts +4 -4
@@ -1,26 +1,21 @@
1
- import { ASSET_ENTRY_TYPE, ASSET_FILE_TYPE, ASSET_FILTERS, getFileType } from '@bundle-stats/utils';
1
+ /**
2
+ * @type {import('@bundle-stats/utils').ReportMetricRow} ReportMetricRow
3
+ * @type {import('../../types').ReportMetricAssetRow} ReportMetricAssetRow
4
+ * @type {import('../../types').ReportMetricAssetRowMetaStatus} ReportMetricAssetRowFlagStatus
5
+ */
2
6
 
3
- export const addRowAssetFlags = (row) => {
4
- const { runs } = row;
7
+ import { ASSET_ENTRY_TYPE, ASSET_FILE_TYPE, ASSET_FILTERS, getFileType } from '@bundle-stats/utils';
5
8
 
6
- const isEntry = runs.map((run) => run?.isEntry).includes(true);
7
- const isInitial = runs.map((run) => run?.isInitial).includes(true);
8
- const isChunk = runs.map((run) => run?.isChunk).includes(true);
9
- const isAsset = !(isEntry || isInitial || isChunk);
10
- const fileType = getFileType(row.key);
9
+ /**
10
+ * Check if the asset cache is not predictive
11
+ *
12
+ * @param {ReportMetricRow} row
13
+ * @returns {boolean}
14
+ */
15
+ export const getIsNotPredictive = (row) => {
16
+ const { key, runs } = row;
11
17
 
12
- return {
13
- ...row,
14
- isEntry,
15
- isInitial,
16
- isChunk,
17
- isAsset,
18
- fileType,
19
- };
20
- };
21
-
22
- export const getIsNotPredictive = (key, runs) =>
23
- runs.reduce((agg, current, index) => {
18
+ return runs.reduce((agg, current, index) => {
24
19
  if (agg) {
25
20
  return agg;
26
21
  }
@@ -32,20 +27,94 @@ export const getIsNotPredictive = (key, runs) =>
32
27
  if (
33
28
  current &&
34
29
  runs[index + 1] &&
35
- current.delta !== 0 &&
36
30
  key !== current.name &&
37
- current.name === runs[index + 1].name
31
+ current.name === runs[index + 1].name &&
32
+ current.value !== runs[index + 1].value
38
33
  ) {
39
34
  return true;
40
35
  }
41
36
 
42
37
  return agg;
43
38
  }, false);
39
+ };
40
+
41
+ /**
42
+ * @param {Array<boolean>}
43
+ * @returns {ReportMetricAssetRowFlagStatus | boolean}
44
+ */
45
+ export const getAssetMetaStatus = (values) => {
46
+ if (!values.includes(true)) {
47
+ return false;
48
+ }
49
+
50
+ // filter empty runs
51
+ const metaValues = values.filter((value) => typeof value !== 'undefined');
52
+
53
+ const current = metaValues[0];
54
+ const metaValuesLength = metaValues.length;
55
+
56
+ if (metaValuesLength === 1) {
57
+ return Boolean(current);
58
+ }
59
+
60
+ const baseline = metaValues[metaValuesLength - 1];
44
61
 
45
- export const addRowIsNotPredictive = (row) => ({
46
- ...row,
47
- isNotPredictive: getIsNotPredictive(row.key, row.runs),
48
- });
62
+ if (current && !baseline) {
63
+ return 'added';
64
+ }
65
+
66
+ if (!current && baseline) {
67
+ return 'removed';
68
+ }
69
+
70
+ return true;
71
+ };
72
+
73
+ /**
74
+ * Add asset row flags
75
+ *
76
+ * @param {ReportMetricRow} row
77
+ * @returns {ReportMetricAssetRow}
78
+ */
79
+ export const addMetricReportAssetRowData = (row) => {
80
+ const { changed, runs } = row;
81
+
82
+ // Collect meta for each run
83
+ const runsEntry = [];
84
+ const runsInitial = [];
85
+ const runsChunk = [];
86
+
87
+ runs.forEach((run) => {
88
+ runsEntry.push(run?.isEntry);
89
+ runsInitial.push(run?.isInitial);
90
+ runsChunk.push(run?.isChunk);
91
+ });
92
+
93
+ const isEntry = getAssetMetaStatus(runsEntry);
94
+ const isInitial = getAssetMetaStatus(runsInitial);
95
+ const isChunk = getAssetMetaStatus(runsChunk);
96
+ const isAsset = !(isEntry || isInitial || isChunk);
97
+ const isNotPredictive = getIsNotPredictive(row);
98
+ const fileType = getFileType(row.key);
99
+
100
+ // Flag asset as changed if name and value are identical, if one of the meta tags is changed
101
+ const assetChanged =
102
+ changed ||
103
+ typeof isEntry !== 'boolean' ||
104
+ typeof isInitial !== 'boolean' ||
105
+ typeof isChunk !== 'boolean';
106
+
107
+ return {
108
+ ...row,
109
+ changed: assetChanged,
110
+ isEntry,
111
+ isInitial,
112
+ isChunk,
113
+ isAsset,
114
+ isNotPredictive,
115
+ fileType,
116
+ };
117
+ };
49
118
 
50
119
  export const getRowFilter = (filters) => (item) => {
51
120
  if (filters[ASSET_FILTERS.CHANGED] && !item.changed) {
@@ -13,12 +13,7 @@ import { useSearchParams } from '../../hooks/search-params';
13
13
  import { useEntryInfo } from '../../hooks/entry-info';
14
14
  import { getJobsChunksData } from '../../utils/jobs';
15
15
  import { BundleAssets as BundleAssetsComponent } from './bundle-assets';
16
- import {
17
- addRowAssetFlags,
18
- addRowIsNotPredictive,
19
- getRowFilter,
20
- getCustomSort,
21
- } from './bundle-assets.utils';
16
+ import { addMetricReportAssetRowData, getRowFilter, getCustomSort } from './bundle-assets.utils';
22
17
 
23
18
  export const BundleAssets = (props) => {
24
19
  const { jobs, filters, search, setState, sortBy, direction, ...restProps } = props;
@@ -50,7 +45,7 @@ export const BundleAssets = (props) => {
50
45
  });
51
46
 
52
47
  const { rows, totalRowCount } = useMemo(() => {
53
- const result = webpack.compareBySection.assets(jobs, [addRowAssetFlags, addRowIsNotPredictive]);
48
+ const result = webpack.compareBySection.assets(jobs, [addMetricReportAssetRowData]);
54
49
  return { rows: result, totalRowCount: result.length };
55
50
  }, [jobs]);
56
51
 
@@ -2,7 +2,7 @@ import type { ElementType, ReactNode } from 'react';
2
2
  import React from 'react';
3
3
  import cx from 'classnames';
4
4
  import { Portal } from 'ariakit/portal';
5
- import type { MetricRunInfo, ReportMetricRow } from '@bundle-stats/utils';
5
+ import type { MetricRunInfo, ReportMetricRow, ReportMetricRun } from '@bundle-stats/utils';
6
6
  import { METRIC_TYPE_CONFIGS, getMetricRunInfo } from '@bundle-stats/utils';
7
7
 
8
8
  import { Box } from '../../layout/box';
@@ -72,6 +72,12 @@ function defaultRenderRunInfo(item: ReportMetricRow) {
72
72
  );
73
73
  }
74
74
 
75
+ export type RenderRunNameProps<T extends ReportMetricRun = ReportMetricRun> = {
76
+ className?: string;
77
+ run: T;
78
+ runSelector: string;
79
+ };
80
+
75
81
  interface EntryInfoProps {
76
82
  itemTitle?: React.ReactNode;
77
83
  item: ReportMetricRow;
@@ -82,6 +88,7 @@ interface EntryInfoProps {
82
88
  tags?: React.ReactNode;
83
89
  onClose: () => void;
84
90
  renderRunInfo?: (item: ReportMetricRow) => React.ReactNode;
91
+ RunName?: React.ElementType;
85
92
  }
86
93
 
87
94
  export const EntryInfo = (props: EntryInfoProps & React.ComponentProps<'div'>) => {
@@ -93,10 +100,11 @@ export const EntryInfo = (props: EntryInfoProps & React.ComponentProps<'div'>) =
93
100
  runNameSelector = 'name',
94
101
  runNameLabel = I18N.PATH,
95
102
  runSizeLabel = I18N.SIZE,
96
- children,
97
103
  tags = null,
98
104
  onClose,
99
105
  renderRunInfo = defaultRenderRunInfo,
106
+ RunName = React.Fragment,
107
+ children,
100
108
  } = props;
101
109
 
102
110
  return (
@@ -145,17 +153,14 @@ export const EntryInfo = (props: EntryInfoProps & React.ComponentProps<'div'>) =
145
153
  </Table.Th>
146
154
  <Table.Td className={cx(css.runsCell, css.runsColName)}>
147
155
  {rowRun?.[runNameSelector] ? (
148
- <FlexStack
149
- space="xxxsmall"
150
- alignItems="center"
151
- as="h3"
152
- className={css.label}
153
- >
154
- <FileName
155
- as="code"
156
- name={rowRun[runNameSelector]}
157
- className={css.fileName}
158
- />
156
+ <FlexStack space="xxxsmall" alignItems="center" className={css.label}>
157
+ <RunName run={rowRun} nameSelector={runNameSelector}>
158
+ <FileName
159
+ as="code"
160
+ name={rowRun[runNameSelector]}
161
+ className={className}
162
+ />
163
+ </RunName>
159
164
  <CopyToClipboard text={item.label} size="small" />
160
165
  </FlexStack>
161
166
  ) : (
@@ -141,7 +141,6 @@ export function getTreemapNodesGroupedByPath(items: Array<ReportMetricRow>): Tre
141
141
  };
142
142
 
143
143
  const childrenTotal = setTreeNode(treeNodes, baseSlugs, 0, treeNode);
144
- console.log(childrenTotal);
145
144
 
146
145
  total.current += childrenTotal.current;
147
146
  total.baseline =
@@ -50,7 +50,17 @@ export const PreviewSource = (props: PreviewSourceProps) => {
50
50
  )}
51
51
  </ControlGroup>
52
52
  )}
53
- <Textarea readOnly rows={rows} value={source} className={css.content} />
53
+ <Textarea
54
+ rows={rows}
55
+ value={source}
56
+ readOnly
57
+ autoComplete="off"
58
+ autoCorrect="off"
59
+ autoCapitalize="off"
60
+ spellCheck="false"
61
+ translate="no"
62
+ className={css.content}
63
+ />
54
64
  </div>
55
65
  );
56
66
  };
@@ -1,19 +1,25 @@
1
1
  import React from 'react';
2
2
  import { MemoryRouter } from 'react-router-dom';
3
3
 
4
- export const getWrapperDecorator = (customWrapperStyles = {}) => (storyFn) => {
5
- const wrapperStyles = {
6
- width: '100%',
7
- height: '100%',
8
- padding: '24px',
9
- ...customWrapperStyles,
10
- };
4
+ import { QueryStateProvider } from '../query-state';
5
+
6
+ export const getWrapperDecorator =
7
+ (customWrapperStyles = {}) =>
8
+ (Story) => {
9
+ const wrapperStyles = {
10
+ width: '100%',
11
+ height: '100%',
12
+ padding: '24px',
13
+ ...customWrapperStyles,
14
+ };
11
15
 
12
- return (
13
- <MemoryRouter initialEntries={[{ pathname: '/', key: 'home' }]}>
14
- <div style={wrapperStyles}>
15
- {storyFn()}
16
- </div>
17
- </MemoryRouter>
18
- );
19
- };
16
+ return (
17
+ <MemoryRouter initialEntries={[{ pathname: '/', key: 'home' }]}>
18
+ <QueryStateProvider>
19
+ <div style={wrapperStyles}>
20
+ <Story />
21
+ </div>
22
+ </QueryStateProvider>
23
+ </MemoryRouter>
24
+ );
25
+ };
package/src/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ReportMetricRow } from '@bundle-stats/utils';
2
- import type { Module } from '@bundle-stats/utils/types/webpack/types';
2
+ import type { Asset, Module } from '@bundle-stats/utils/types/webpack/types';
3
3
 
4
4
  export interface SortAction {
5
5
  field: string;
@@ -19,6 +19,35 @@ type FilterGroupFieldData = {
19
19
 
20
20
  type FilterFieldsData = Record<string, FilterFieldData | FilterGroupFieldData>;
21
21
 
22
+ export type ReportMetricAssetRowMetaStatus = 'added' | 'removed';
23
+
24
+ export type ReportMetricAssetRow = {
25
+ /**
26
+ * Asset isEntry - at least one run has isEntry truthy
27
+ */
28
+ isEntry: ReportMetricAssetRowMetaStatus | boolean;
29
+ /**
30
+ * Asset isInitial - at least one run has isInitial truthy
31
+ */
32
+ isInitial: ReportMetricAssetRowMetaStatus | boolean;
33
+ /**
34
+ * Asset isChunk - at least one run has isChunk truthy
35
+ */
36
+ isChunk: ReportMetricAssetRowMetaStatus | boolean;
37
+ /**
38
+ * Asset isAsset - at least one run has isAsset truthy
39
+ */
40
+ isAsset: boolean;
41
+ /**
42
+ * Asset name is not predictive
43
+ */
44
+ isNotPredictive: boolean;
45
+ /**
46
+ * Report asset row isEntry - at least one run has isEntry
47
+ */
48
+ fileType: string;
49
+ } & Omit<ReportMetricRow, 'runs'> & { runs: Array<(Asset & ReportMetricRun) | null> };
50
+
22
51
  export type ReportMetricModuleRow = {
23
52
  thirdParty: boolean;
24
53
  duplicated: boolean;
@@ -1,16 +1,17 @@
1
+ import type { ComponentProps } from 'react';
1
2
  import React from 'react';
2
3
  import cx from 'classnames';
3
4
 
4
5
  import { KIND, SIZE } from '../../tokens';
5
6
  import css from './tag.module.css';
6
7
 
7
- interface TagProps {
8
+ export type TagProps = {
8
9
  as?: React.ElementType;
9
10
  kind?: (typeof KIND)[keyof typeof KIND];
10
11
  size?: (typeof SIZE)[keyof typeof SIZE];
11
- }
12
+ } & ComponentProps<'span'>;
12
13
 
13
- export const Tag = (props: TagProps & React.ComponentProps<'span'>) => {
14
+ export const Tag = (props: TagProps) => {
14
15
  const {
15
16
  className = '',
16
17
  as: Component = 'span',
@@ -1,6 +1,7 @@
1
+ import type { ComponentProps, ElementType } from 'react';
1
2
  import React from 'react';
2
3
  import { MetricRunInfo } from '@bundle-stats/utils';
3
- import { Asset, MetaChunk } from '@bundle-stats/utils/types/webpack';
4
+ import type { AssetMetricRun, MetaChunk } from '@bundle-stats/utils/types/webpack';
4
5
  interface AssetInfoProps {
5
6
  item: {
6
7
  label: string;
@@ -10,12 +11,12 @@ interface AssetInfoProps {
10
11
  isInitial?: boolean;
11
12
  isNotPredictive?: boolean;
12
13
  fileType?: string;
13
- runs: Array<Asset & MetricRunInfo>;
14
+ runs: Array<AssetMetricRun & MetricRunInfo>;
14
15
  };
15
16
  chunks?: Array<MetaChunk>;
16
17
  labels: Array<string>;
17
- customComponentLink?: React.ElementType;
18
+ customComponentLink?: ElementType;
18
19
  onClose: () => void;
19
20
  }
20
- export declare const AssetInfo: (props: AssetInfoProps & React.ComponentProps<"div">) => React.JSX.Element;
21
+ export declare const AssetInfo: (props: AssetInfoProps & ComponentProps<"div">) => React.JSX.Element;
21
22
  export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { TagProps } from '../../ui/tag';
3
+ import type { ReportMetricAssetRowMetaStatus } from '../../types';
4
+ export type AssetMetaTagProps = {
5
+ tag: 'entry' | 'initial' | 'chunk';
6
+ status?: ReportMetricAssetRowMetaStatus | boolean;
7
+ } & TagProps;
8
+ export declare const AssetMetaTag: (props: AssetMetaTagProps) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './asset-meta-tag';
@@ -0,0 +1,8 @@
1
+ import React, { ElementType } from 'react';
2
+ import type { ReportMetricAssetRow } from '../../types';
3
+ export type AssetNameProps = {
4
+ className?: string;
5
+ row: ReportMetricAssetRow;
6
+ customComponentLink: ElementType;
7
+ };
8
+ export declare const AssetName: (props: AssetNameProps) => React.JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './asset-name';
@@ -1,8 +1,8 @@
1
+ import type { ComponentProps } from 'react';
1
2
  import React from 'react';
2
- import type { Asset } from '@bundle-stats/utils/types/webpack';
3
- interface AssetNotPredictiveProps {
4
- runs?: Array<Asset>;
3
+ import type { AssetMetricRun } from '@bundle-stats/utils/types/webpack';
4
+ export type AssetNotPredictiveProps = {
5
+ runs?: Array<AssetMetricRun>;
5
6
  labels?: Array<string>;
6
- }
7
- export declare const AssetNotPredictive: (props: AssetNotPredictiveProps & React.ComponentProps<"div">) => React.JSX.Element;
8
- export {};
7
+ } & ComponentProps<'div'>;
8
+ export declare const AssetNotPredictive: (props: AssetNotPredictiveProps) => React.JSX.Element;
@@ -1,5 +1,5 @@
1
- export function addRowAssetFlags(row: any): any;
2
- export function getIsNotPredictive(key: any, runs: any): any;
3
- export function addRowIsNotPredictive(row: any): any;
1
+ export function getIsNotPredictive(row: ReportMetricRow): boolean;
2
+ export function getAssetMetaStatus(values: any): ReportMetricAssetRowFlagStatus | boolean;
3
+ export function addMetricReportAssetRowData(row: ReportMetricRow): ReportMetricAssetRow;
4
4
  export function getRowFilter(filters: any): (item: any) => boolean;
5
5
  export function getCustomSort(item: any): any[];
@@ -1,6 +1,6 @@
1
1
  import type { ElementType, ReactNode } from 'react';
2
2
  import React from 'react';
3
- import type { ReportMetricRow } from '@bundle-stats/utils';
3
+ import type { ReportMetricRow, ReportMetricRun } from '@bundle-stats/utils';
4
4
  interface EntryInfoMetaLinkProps {
5
5
  as?: ElementType;
6
6
  }
@@ -9,6 +9,11 @@ interface EntryInfoMetaProps {
9
9
  label: string;
10
10
  tooltip?: ReactNode;
11
11
  }
12
+ export type RenderRunNameProps<T extends ReportMetricRun = ReportMetricRun> = {
13
+ className?: string;
14
+ run: T;
15
+ runSelector: string;
16
+ };
12
17
  interface EntryInfoProps {
13
18
  itemTitle?: React.ReactNode;
14
19
  item: ReportMetricRow;
@@ -19,6 +24,7 @@ interface EntryInfoProps {
19
24
  tags?: React.ReactNode;
20
25
  onClose: () => void;
21
26
  renderRunInfo?: (item: ReportMetricRow) => React.ReactNode;
27
+ RunName?: React.ElementType;
22
28
  }
23
29
  export declare const EntryInfo: {
24
30
  (props: EntryInfoProps & React.ComponentProps<"div">): React.JSX.Element;
@@ -1,2 +1,2 @@
1
- export function getWrapperDecorator(customWrapperStyles?: {}): (storyFn: any) => React.JSX.Element;
1
+ export function getWrapperDecorator(customWrapperStyles?: {}): (Story: any) => React.JSX.Element;
2
2
  import React from 'react';
@@ -1,12 +1,13 @@
1
+ import type { ComponentProps } from 'react';
1
2
  import React from 'react';
2
3
  import { KIND, SIZE } from '../../tokens';
3
- interface TagProps {
4
+ export type TagProps = {
4
5
  as?: React.ElementType;
5
6
  kind?: (typeof KIND)[keyof typeof KIND];
6
7
  size?: (typeof SIZE)[keyof typeof SIZE];
7
- }
8
+ } & ComponentProps<'span'>;
8
9
  export declare const Tag: {
9
- (props: TagProps & React.ComponentProps<"span">): React.JSX.Element;
10
+ (props: TagProps): React.JSX.Element;
10
11
  KINDS: {
11
12
  readonly DEFAULT: "default";
12
13
  readonly SUCCESS: "success";
@@ -20,4 +21,3 @@ export declare const Tag: {
20
21
  readonly LARGE: "large";
21
22
  };
22
23
  };
23
- export {};