@bundle-stats/ui 4.23.0-beta.5 → 4.23.0-beta.6

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 (79) hide show
  1. package/lib/app/app.js +2 -1
  2. package/lib/app/app.js.map +1 -1
  3. package/lib/app/app.module.css +0 -5
  4. package/lib/components/asset-name/asset-name.js +3 -3
  5. package/lib/components/asset-name/asset-name.js.map +1 -1
  6. package/lib/components/asset-name/asset-name.module.css +0 -9
  7. package/lib/components/bundle-modules/bundle-modules.js +1 -1
  8. package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
  9. package/lib/components/bundle-modules/bundle-modules.module.css +0 -6
  10. package/lib/components/bundle-packages/bundle-packages.js +1 -1
  11. package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
  12. package/lib/components/bundle-packages/bundle-packages.module.css +0 -3
  13. package/lib/components/jobs-header/jobs-header.js +1 -1
  14. package/lib/components/jobs-header/jobs-header.js.map +1 -1
  15. package/lib/components/jobs-header/jobs-header.module.css +0 -1
  16. package/lib/components/metrics-treemap/metrics-treemap.js +6 -4
  17. package/lib/components/metrics-treemap/metrics-treemap.js.map +1 -1
  18. package/lib/components/metrics-treemap/metrics-treemap.module.css +0 -7
  19. package/lib/components/summary/summary.js +5 -4
  20. package/lib/components/summary/summary.js.map +1 -1
  21. package/lib/components/summary/summary.module.css +0 -11
  22. package/lib/css/variables.css +3 -3
  23. package/lib/ui/control-group/control-group.js +1 -1
  24. package/lib/ui/control-group/control-group.js.map +1 -1
  25. package/lib/ui/filters/filters.js +1 -1
  26. package/lib/ui/filters/filters.js.map +1 -1
  27. package/lib/ui/toolbar/toolbar.js +2 -1
  28. package/lib/ui/toolbar/toolbar.js.map +1 -1
  29. package/lib/ui/toolbar/toolbar.module.css +0 -6
  30. package/lib-esm/app/app.js +2 -1
  31. package/lib-esm/app/app.js.map +1 -1
  32. package/lib-esm/app/app.module.css +0 -5
  33. package/lib-esm/components/asset-name/asset-name.js +3 -3
  34. package/lib-esm/components/asset-name/asset-name.js.map +1 -1
  35. package/lib-esm/components/asset-name/asset-name.module.css +0 -9
  36. package/lib-esm/components/bundle-modules/bundle-modules.js +1 -1
  37. package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
  38. package/lib-esm/components/bundle-modules/bundle-modules.module.css +0 -6
  39. package/lib-esm/components/bundle-packages/bundle-packages.js +1 -1
  40. package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
  41. package/lib-esm/components/bundle-packages/bundle-packages.module.css +0 -3
  42. package/lib-esm/components/jobs-header/jobs-header.js +1 -1
  43. package/lib-esm/components/jobs-header/jobs-header.js.map +1 -1
  44. package/lib-esm/components/jobs-header/jobs-header.module.css +0 -1
  45. package/lib-esm/components/metrics-treemap/metrics-treemap.js +6 -4
  46. package/lib-esm/components/metrics-treemap/metrics-treemap.js.map +1 -1
  47. package/lib-esm/components/metrics-treemap/metrics-treemap.module.css +0 -7
  48. package/lib-esm/components/summary/summary.js +5 -4
  49. package/lib-esm/components/summary/summary.js.map +1 -1
  50. package/lib-esm/components/summary/summary.module.css +0 -11
  51. package/lib-esm/css/variables.css +3 -3
  52. package/lib-esm/ui/control-group/control-group.js +1 -1
  53. package/lib-esm/ui/control-group/control-group.js.map +1 -1
  54. package/lib-esm/ui/filters/filters.js +1 -1
  55. package/lib-esm/ui/filters/filters.js.map +1 -1
  56. package/lib-esm/ui/toolbar/toolbar.js +2 -1
  57. package/lib-esm/ui/toolbar/toolbar.js.map +1 -1
  58. package/lib-esm/ui/toolbar/toolbar.module.css +0 -6
  59. package/package.json +3 -3
  60. package/src/app/app.jsx +3 -2
  61. package/src/app/app.module.css +0 -5
  62. package/src/components/asset-name/asset-name.module.css +0 -9
  63. package/src/components/asset-name/asset-name.tsx +12 -5
  64. package/src/components/bundle-modules/bundle-modules.module.css +0 -6
  65. package/src/components/bundle-modules/bundle-modules.tsx +2 -2
  66. package/src/components/bundle-packages/bundle-packages.jsx +9 -2
  67. package/src/components/bundle-packages/bundle-packages.module.css +0 -3
  68. package/src/components/jobs-header/jobs-header.module.css +0 -1
  69. package/src/components/jobs-header/jobs-header.tsx +2 -2
  70. package/src/components/metrics-treemap/metrics-treemap.module.css +0 -7
  71. package/src/components/metrics-treemap/metrics-treemap.tsx +18 -7
  72. package/src/components/summary/summary.module.css +0 -11
  73. package/src/components/summary/summary.tsx +9 -8
  74. package/src/css/variables.css +3 -3
  75. package/src/ui/button/button.stories.tsx +1 -1
  76. package/src/ui/control-group/control-group.tsx +1 -1
  77. package/src/ui/filters/filters.tsx +1 -6
  78. package/src/ui/toolbar/toolbar.jsx +4 -1
  79. package/src/ui/toolbar/toolbar.module.css +0 -6
@@ -6,18 +6,12 @@
6
6
 
7
7
  .actions {
8
8
  margin-top: var(--space-xsmall);
9
- display: flex;
10
- align-items: center;
11
9
  }
12
10
 
13
11
  .action {
14
12
  flex: 0 0 auto;
15
13
  }
16
14
 
17
- .action + .action {
18
- margin-left: var(--space-xsmall);
19
- }
20
-
21
15
  @media (min-width: 768px) {
22
16
  .root {
23
17
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bundle-stats/ui",
3
- "version": "4.23.0-beta.5",
3
+ "version": "4.23.0-beta.6",
4
4
  "description": "UI components for BundleStats projects.",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -83,7 +83,7 @@
83
83
  "react-router-dom": "^5.0.0"
84
84
  },
85
85
  "dependencies": {
86
- "@bundle-stats/utils": "^4.23.0-beta.5",
86
+ "@bundle-stats/utils": "^4.23.0-beta.6",
87
87
  "ariakit": "2.0.0-next.44",
88
88
  "d3": "7.9.0",
89
89
  "modern-css-reset": "1.4.0",
@@ -91,5 +91,5 @@
91
91
  "snarkdown": "2.0.0",
92
92
  "use-query-params": "2.2.2"
93
93
  },
94
- "gitHead": "af798896d85f2758e3cd1a5874b06207cef61c68"
94
+ "gitHead": "cd3d72f54ed809e9dfaea2bc3b8a6880b1482b44"
95
95
  }
package/src/app/app.jsx CHANGED
@@ -13,6 +13,7 @@ import { Insights } from '../components/insights';
13
13
  import { MetricChangeLegend, MetricsTableTitle } from '../components';
14
14
  import { Summary } from '../components/summary';
15
15
  import { Box } from '../layout/box';
16
+ import { FlexStack } from '../layout/flex-stack';
16
17
  import { Footer } from '../layout/footer';
17
18
  import { Stack } from '../layout/stack';
18
19
  import { Container } from '../ui/container';
@@ -151,9 +152,9 @@ const AppComponent = ({ version, jobs }) => {
151
152
  <JobsProvider jobs={jobs}>
152
153
  <Layout jobs={jobs} version={version}>
153
154
  <Container className={css.metricChangeLegendContainer}>
154
- <div className={css.metricChangeLegendContainerInner}>
155
+ <FlexStack justifyContent="flex-end">
155
156
  <MetricChangeLegend />
156
- </div>
157
+ </FlexStack>
157
158
  </Container>
158
159
  <Container className={css.summaryContainer}>
159
160
  <Summary
@@ -22,11 +22,6 @@
22
22
  padding-bottom: var(--space-xxsmall);
23
23
  }
24
24
 
25
- .metricChangeLegendContainerInner {
26
- display: flex;
27
- justify-content: flex-end;
28
- }
29
-
30
25
  .summaryContainer {
31
26
  padding-top: var(--space-xxsmall);
32
27
  padding-bottom: var(--space-xxsmall);
@@ -1,9 +1,3 @@
1
- .root {
2
- display: inline-flex;
3
- gap: var(--space-xxxsmall);
4
- align-items: center;
5
- }
6
-
7
1
  .notPredictive {
8
2
  flex: 0 0 auto;
9
3
  width: var(--space-small);
@@ -20,9 +14,6 @@
20
14
 
21
15
  .link {
22
16
  flex: 1 1 auto;
23
- display: inline-flex;
24
- align-items: center;
25
- gap: var(--space-xxxsmall);
26
17
  }
27
18
 
28
19
  .tags {
@@ -1,6 +1,6 @@
1
1
  import React, { ElementType } from 'react';
2
- import cx from 'classnames';
3
2
 
3
+ import { FlexStack } from '../../layout/flex-stack';
4
4
  import { Icon } from '../../ui/icon';
5
5
  import { FileName } from '../../ui/file-name';
6
6
  import { HoverCard } from '../../ui/hover-card';
@@ -25,7 +25,7 @@ export const AssetName = (props: AssetNameProps) => {
25
25
  const { label, isNotPredictive, runs, isChunk, isEntry, isInitial } = row;
26
26
 
27
27
  return (
28
- <span className={cx(css.root, className)}>
28
+ <FlexStack as="span" inline alignItems="center" gap="xxxsmall" className={className}>
29
29
  {isNotPredictive && (
30
30
  <HoverCard
31
31
  label={<Icon className={css.notPredictiveIcon} glyph={Icon.ICONS.WARNING} />}
@@ -36,7 +36,14 @@ export const AssetName = (props: AssetNameProps) => {
36
36
  </HoverCard>
37
37
  )}
38
38
 
39
- <EntryComponentLink entryId={row.key} className={css.link}>
39
+ <FlexStack
40
+ as={EntryComponentLink}
41
+ entryId={row.key}
42
+ inline
43
+ alignItems="center"
44
+ gap="xxxsmall"
45
+ className={css.link}
46
+ >
40
47
  <span className={css.tags}>
41
48
  {isEntry && (
42
49
  <AssetMetaTag className={css.tag} title="Entrypoint" tag="entry" status={isEntry} />
@@ -49,7 +56,7 @@ export const AssetName = (props: AssetNameProps) => {
49
56
  )}
50
57
  </span>
51
58
  <FileName className={css.name} name={label} />
52
- </EntryComponentLink>
53
- </span>
59
+ </FlexStack>
60
+ </FlexStack>
54
61
  );
55
62
  };
@@ -11,12 +11,6 @@
11
11
  border-bottom: 1px solid var(--color-outline);
12
12
  }
13
13
 
14
- .name {
15
- display: inline-flex;
16
- align-items: center;
17
- gap: var(--space-xxxsmall);
18
- }
19
-
20
14
  .nameTagDuplicated {
21
15
  flex: 0 0 auto;
22
16
  }
@@ -58,12 +58,12 @@ const RowHeader = (props: RowHeaderProps) => {
58
58
  const moduleRow = row as ReportMetricModuleRow;
59
59
 
60
60
  return (
61
- <EntryComponentLink entryId={row.key} className={css.name}>
61
+ <FlexStack as={EntryComponentLink} entryId={row.key} inline alignItems="center" gap="xxxsmall">
62
62
  {moduleRow.duplicated && (
63
63
  <Tag className={css.nameTagDuplicated} size="small" kind={Tag.KINDS.DANGER} />
64
64
  )}
65
65
  <FileName className={css.nameText} name={moduleRow.label} />
66
- </EntryComponentLink>
66
+ </FlexStack>
67
67
  );
68
68
  };
69
69
 
@@ -49,7 +49,14 @@ const getDropdownFilters = ({ compareMode, filters }) => ({
49
49
 
50
50
  const PackageName = ({ row, packageName, showDetails, EntryComponentLink }) => {
51
51
  return (
52
- <EntryComponentLink entryId={showDetails ? row.key : packageName} className={css.packageName}>
52
+ <FlexStack
53
+ as={EntryComponentLink}
54
+ entryId={showDetails ? row.key : packageName}
55
+ inline
56
+ alignItems="center"
57
+ gap="xxxsmall"
58
+ className={css.packageName}
59
+ >
53
60
  {showDetails && row.duplicate && (
54
61
  <Tag
55
62
  className={css.packageNameTagDuplicate}
@@ -59,7 +66,7 @@ const PackageName = ({ row, packageName, showDetails, EntryComponentLink }) => {
59
66
  />
60
67
  )}
61
68
  <span className={css.packageNameLabel}>{packageName}</span>
62
- </EntryComponentLink>
69
+ </FlexStack>
63
70
  );
64
71
  };
65
72
 
@@ -12,9 +12,6 @@
12
12
  }
13
13
 
14
14
  .packageName {
15
- display: inline-flex;
16
- align-items: center;
17
- gap: var(--space-xxxsmall);
18
15
  color: var(--color-text-light);
19
16
  text-decoration: none;
20
17
  }
@@ -1,7 +1,6 @@
1
1
  .root {
2
2
  padding: var(--space-small) 0;
3
3
  width: 100%;
4
- display: flex;
5
4
  }
6
5
 
7
6
  .item {
@@ -76,7 +76,7 @@ export const JobsHeader = (props: JobsHeaderProps & React.ComponentProps<'header
76
76
  const rootClassName = cx(css.root, className);
77
77
 
78
78
  return (
79
- <header className={rootClassName}>
79
+ <FlexStack as="header" className={rootClassName}>
80
80
  {jobs?.map((job, index) => (
81
81
  <Item
82
82
  key={job.internalBuildNumber || index}
@@ -84,6 +84,6 @@ export const JobsHeader = (props: JobsHeaderProps & React.ComponentProps<'header
84
84
  tag={index === 0 ? I18N.CURRENT : I18N.BASELINE}
85
85
  />
86
86
  ))}
87
- </header>
87
+ </FlexStack>
88
88
  );
89
89
  };
@@ -163,11 +163,7 @@
163
163
  z-index: 1;
164
164
  width: 100%;
165
165
  height: 100%;
166
- display: flex;
167
- flex-flow: column;
168
- justify-content: center;
169
166
  padding: var(--space-xxsmall);
170
- gap: var(--space-xxxsmall);
171
167
  line-height: var(--line-height-heading);
172
168
  cursor: default;
173
169
  }
@@ -284,9 +280,6 @@
284
280
  top: 0;
285
281
  width: 100%;
286
282
  height: 100%;
287
- display: flex;
288
- align-items: center;
289
- justify-content: center;
290
283
  }
291
284
 
292
285
  .emptyMessageWrapper {
@@ -20,6 +20,7 @@ import {
20
20
  getMetricRunInfo,
21
21
  } from '@bundle-stats/utils';
22
22
 
23
+ import { FlexStack } from '../../layout/flex-stack';
23
24
  import { Stack } from '../../layout/stack';
24
25
  import { FileName } from '../../ui/file-name';
25
26
  import { Delta } from '../delta';
@@ -110,12 +111,22 @@ interface TileContentProps {
110
111
  runInfo: MetricRunInfo;
111
112
  }
112
113
 
114
+ const TileContentContainer = (props: ComponentProps<'div'>) => (
115
+ <FlexStack
116
+ direction="column"
117
+ justifyContent="center"
118
+ gap="xxxsmall"
119
+ className={css.tileContent}
120
+ {...props}
121
+ />
122
+ );
123
+
113
124
  const TileContent = (props: TileContentProps) => {
114
125
  const { label, sizeDisplay, item, runInfo } = props;
115
126
 
116
127
  // Render only the container
117
128
  if (sizeDisplay === 'minimal') {
118
- return <div className={css.tileContent} />;
129
+ return <TileContentContainer />;
119
130
  }
120
131
 
121
132
  const resolvedLabel = label || item.label;
@@ -123,14 +134,14 @@ const TileContent = (props: TileContentProps) => {
123
134
  // Render only the label
124
135
  if (sizeDisplay === 'small') {
125
136
  return (
126
- <div className={css.tileContent}>
137
+ <TileContentContainer>
127
138
  <p className={css.tileContentLabel}>{resolvedLabel}</p>
128
- </div>
139
+ </TileContentContainer>
129
140
  );
130
141
  }
131
142
 
132
143
  return (
133
- <div className={css.tileContent}>
144
+ <TileContentContainer>
134
145
  <p className={css.tileContentLabel}>{label || item.label}</p>
135
146
  <p className={css.tileContentValue}>
136
147
  <span className={css.tileContentMetric}>{runInfo.displayValue}</span>
@@ -140,7 +151,7 @@ const TileContent = (props: TileContentProps) => {
140
151
  deltaType={runInfo.deltaType}
141
152
  />
142
153
  </p>
143
- </div>
154
+ </TileContentContainer>
144
155
  );
145
156
  };
146
157
 
@@ -585,9 +596,9 @@ export const MetricsTreemap = (props: MetricsTreemapProps & ComponentProps<'div'
585
596
  {canvasContent}
586
597
  </div>
587
598
  ) : (
588
- <div className={css.emptyMessage}>
599
+ <FlexStack alignItems="center" justifyContent="center" className={css.emptyMessage}>
589
600
  <div className={css.emptyMessageWrapper}>{emptyMessage}</div>
590
- </div>
601
+ </FlexStack>
591
602
  )}
592
603
  {tooltipNode && (
593
604
  <Tooltip state={tooltipState} className={css.tooltip}>
@@ -5,10 +5,6 @@
5
5
 
6
6
  .row {
7
7
  width: 100%;
8
- display: flex;
9
- align-items: stretch;
10
- flex-wrap: wrap;
11
- gap: var(--space-small);
12
8
  }
13
9
 
14
10
  .rowGroup {
@@ -26,13 +22,6 @@
26
22
  margin-top: var(--summary-gap);
27
23
  }
28
24
 
29
- .items {
30
- display: flex;
31
- align-items: stretch;
32
- flex-wrap: wrap;
33
- gap: var(--space-medium);
34
- }
35
-
36
25
  .item {
37
26
  flex: 1 1 10%; /* force equal sizes */
38
27
  min-width: 8em;
@@ -10,6 +10,7 @@ import {
10
10
  METRICS_WEBPACK_GENERAL,
11
11
  } from '../../constants';
12
12
  import { Box } from '../../layout/box';
13
+ import { FlexStack } from '../../layout/flex-stack';
13
14
  import { ComponentLink } from '../component-link';
14
15
  import { MetricRunInfo, MetricRunInfoProps } from '../metric-run-info';
15
16
  import css from './summary.module.css';
@@ -77,9 +78,9 @@ export const Summary = ({
77
78
  summaryItemLink = ComponentLink,
78
79
  }: SummaryProps & React.ComponentProps<'div'>) => (
79
80
  <Box className={cx(css.root, className)}>
80
- <div className={css.row}>
81
+ <FlexStack wrap="wrap" gap="small" className={css.row}>
81
82
  <Box outline padding="small" className={css.rowGroup}>
82
- <div className={css.items}>
83
+ <FlexStack wrap="wrap" gap="medium">
83
84
  {METRICS_WEBPACK_GENERAL.map((metricId) => (
84
85
  <SummaryItem
85
86
  key={metricId}
@@ -93,15 +94,15 @@ export const Summary = ({
93
94
  showBaseline={showSummaryItemBaseline}
94
95
  />
95
96
  ))}
96
- </div>
97
+ </FlexStack>
97
98
  </Box>
98
- </div>
99
- <div className={css.row}>
99
+ </FlexStack>
100
+ <FlexStack wrap="wrap" gap="small" className={css.row}>
100
101
  {[METRICS_GROUP_ASSETS, METRICS_GROUP_MODULES, METRICS_GROUP_PACKAGES].map((metricGroup) => (
101
102
  <Stack className={css.rowGroup} key={metricGroup.title}>
102
103
  <h3 className={css.rowGroupTitle}>{metricGroup.title}</h3>
103
104
  <Box outline padding="small">
104
- <div className={css.items}>
105
+ <FlexStack wrap="wrap" gap="medium">
105
106
  {metricGroup.metrics.map((metricId) => (
106
107
  <SummaryItem
107
108
  key={metricId}
@@ -115,10 +116,10 @@ export const Summary = ({
115
116
  showBaseline={showSummaryItemBaseline}
116
117
  />
117
118
  ))}
118
- </div>
119
+ </FlexStack>
119
120
  </Box>
120
121
  </Stack>
121
122
  ))}
122
- </div>
123
+ </FlexStack>
123
124
  </Box>
124
125
  );
@@ -146,9 +146,9 @@ body {
146
146
  --color-text-ultra-dark: var(--color-gray-ultra-dark);
147
147
  --color-heading: var(--color-gray-ultra-dark);
148
148
 
149
- --color-accent-light: var(--color-gray);
150
- --color-accent: var(--color-gray-dark);
151
- --color-accent-dark: var(--color-gray-ultra-dark);
149
+ --color-accent-light: var(--color-branding-light);
150
+ --color-accent: var(--color-branding);
151
+ --color-accent-dark: var(--color-branding-dark);
152
152
 
153
153
  --color-success-light: var(--color-green-light);
154
154
  --color-success: var(--color-green);
@@ -19,7 +19,7 @@ export default meta;
19
19
  type Story = StoryObj<typeof meta>;
20
20
 
21
21
  const Items = (props: React.ComponentProps<typeof FlexStack>) => (
22
- <FlexStack alignItems="top" style={{ flexWrap: 'wrap', gap: '12px' }} {...props} />
22
+ <FlexStack alignItems="top" wrap="wrap" gap="xsmall" {...props} />
23
23
  );
24
24
 
25
25
  export const Default: Story = {};
@@ -9,7 +9,7 @@ export const ControlGroup = (props: React.ComponentProps<typeof FlexStack>) => {
9
9
  return (
10
10
  <FlexStack
11
11
  className={cx(css.root, className)}
12
- space="no-space"
12
+ gap="no-space"
13
13
  alignItems="center"
14
14
  {...restProps}
15
15
  />
@@ -20,12 +20,7 @@ const Filter = (props: FilterBooleanProps) => {
20
20
  const { className = '', label, name, ...inputProps } = props;
21
21
 
22
22
  return (
23
- <FlexStack
24
- space="xxxsmall"
25
- alignItems="center"
26
- as="label"
27
- className={cx(css.filter, className)}
28
- >
23
+ <FlexStack gap="xxxsmall" alignItems="center" as="label" className={cx(css.filter, className)}>
29
24
  <input
30
25
  type="checkbox"
31
26
  id={`filter-${name}`}
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import cx from 'classnames';
3
3
  import PropTypes from 'prop-types';
4
4
 
5
+ import { FlexStack } from '../../layout/flex-stack';
5
6
  import css from './toolbar.module.css';
6
7
 
7
8
  export const Toolbar = (props) => {
@@ -12,7 +13,9 @@ export const Toolbar = (props) => {
12
13
  <div className={rootClassName}>
13
14
  <div className={css.content}>{children}</div>
14
15
  {renderActions && (
15
- <div className={css.actions}>{renderActions({ actionClassName: css.action })}</div>
16
+ <FlexStack gap="xsmall" alignItems="center" className={css.actions}>
17
+ {renderActions({ actionClassName: css.action })}
18
+ </FlexStack>
16
19
  )}
17
20
  </div>
18
21
  );
@@ -6,18 +6,12 @@
6
6
 
7
7
  .actions {
8
8
  margin-top: var(--space-xsmall);
9
- display: flex;
10
- align-items: center;
11
9
  }
12
10
 
13
11
  .action {
14
12
  flex: 0 0 auto;
15
13
  }
16
14
 
17
- .action + .action {
18
- margin-left: var(--space-xsmall);
19
- }
20
-
21
15
  @media (min-width: 768px) {
22
16
  .root {
23
17
  display: flex;