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

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 (85) 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/chart-colors.json +44 -58
  5. package/lib/components/asset-name/asset-name.js +3 -3
  6. package/lib/components/asset-name/asset-name.js.map +1 -1
  7. package/lib/components/asset-name/asset-name.module.css +0 -9
  8. package/lib/components/bundle-modules/bundle-modules.js +1 -1
  9. package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
  10. package/lib/components/bundle-modules/bundle-modules.module.css +0 -6
  11. package/lib/components/bundle-packages/bundle-packages.js +1 -1
  12. package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
  13. package/lib/components/bundle-packages/bundle-packages.module.css +0 -3
  14. package/lib/components/jobs-header/jobs-header.js +1 -1
  15. package/lib/components/jobs-header/jobs-header.js.map +1 -1
  16. package/lib/components/jobs-header/jobs-header.module.css +0 -1
  17. package/lib/components/metrics-treemap/metrics-treemap.js +6 -4
  18. package/lib/components/metrics-treemap/metrics-treemap.js.map +1 -1
  19. package/lib/components/metrics-treemap/metrics-treemap.module.css +0 -7
  20. package/lib/components/summary/summary.js +5 -4
  21. package/lib/components/summary/summary.js.map +1 -1
  22. package/lib/components/summary/summary.module.css +0 -11
  23. package/lib/css/variables.css +11 -10
  24. package/lib/ui/button/button.module.css +6 -1
  25. package/lib/ui/control-group/control-group.js +1 -1
  26. package/lib/ui/control-group/control-group.js.map +1 -1
  27. package/lib/ui/filters/filters.js +1 -1
  28. package/lib/ui/filters/filters.js.map +1 -1
  29. package/lib/ui/toolbar/toolbar.js +2 -1
  30. package/lib/ui/toolbar/toolbar.js.map +1 -1
  31. package/lib/ui/toolbar/toolbar.module.css +0 -6
  32. package/lib-esm/app/app.js +2 -1
  33. package/lib-esm/app/app.js.map +1 -1
  34. package/lib-esm/app/app.module.css +0 -5
  35. package/lib-esm/chart-colors.json +44 -58
  36. package/lib-esm/components/asset-name/asset-name.js +3 -3
  37. package/lib-esm/components/asset-name/asset-name.js.map +1 -1
  38. package/lib-esm/components/asset-name/asset-name.module.css +0 -9
  39. package/lib-esm/components/bundle-modules/bundle-modules.js +1 -1
  40. package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
  41. package/lib-esm/components/bundle-modules/bundle-modules.module.css +0 -6
  42. package/lib-esm/components/bundle-packages/bundle-packages.js +1 -1
  43. package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
  44. package/lib-esm/components/bundle-packages/bundle-packages.module.css +0 -3
  45. package/lib-esm/components/jobs-header/jobs-header.js +1 -1
  46. package/lib-esm/components/jobs-header/jobs-header.js.map +1 -1
  47. package/lib-esm/components/jobs-header/jobs-header.module.css +0 -1
  48. package/lib-esm/components/metrics-treemap/metrics-treemap.js +6 -4
  49. package/lib-esm/components/metrics-treemap/metrics-treemap.js.map +1 -1
  50. package/lib-esm/components/metrics-treemap/metrics-treemap.module.css +0 -7
  51. package/lib-esm/components/summary/summary.js +5 -4
  52. package/lib-esm/components/summary/summary.js.map +1 -1
  53. package/lib-esm/components/summary/summary.module.css +0 -11
  54. package/lib-esm/css/variables.css +11 -10
  55. package/lib-esm/ui/button/button.module.css +6 -1
  56. package/lib-esm/ui/control-group/control-group.js +1 -1
  57. package/lib-esm/ui/control-group/control-group.js.map +1 -1
  58. package/lib-esm/ui/filters/filters.js +1 -1
  59. package/lib-esm/ui/filters/filters.js.map +1 -1
  60. package/lib-esm/ui/toolbar/toolbar.js +2 -1
  61. package/lib-esm/ui/toolbar/toolbar.js.map +1 -1
  62. package/lib-esm/ui/toolbar/toolbar.module.css +0 -6
  63. package/package.json +3 -3
  64. package/src/app/app.jsx +3 -2
  65. package/src/app/app.module.css +0 -5
  66. package/src/chart-colors.json +44 -58
  67. package/src/components/asset-name/asset-name.module.css +0 -9
  68. package/src/components/asset-name/asset-name.tsx +12 -5
  69. package/src/components/bundle-modules/bundle-modules.module.css +0 -6
  70. package/src/components/bundle-modules/bundle-modules.tsx +2 -2
  71. package/src/components/bundle-packages/bundle-packages.jsx +9 -2
  72. package/src/components/bundle-packages/bundle-packages.module.css +0 -3
  73. package/src/components/jobs-header/jobs-header.module.css +0 -1
  74. package/src/components/jobs-header/jobs-header.tsx +2 -2
  75. package/src/components/metrics-treemap/metrics-treemap.module.css +0 -7
  76. package/src/components/metrics-treemap/metrics-treemap.tsx +18 -7
  77. package/src/components/summary/summary.module.css +0 -11
  78. package/src/components/summary/summary.tsx +9 -8
  79. package/src/css/variables.css +11 -10
  80. package/src/ui/button/button.module.css +6 -1
  81. package/src/ui/button/button.stories.tsx +1 -1
  82. package/src/ui/control-group/control-group.tsx +1 -1
  83. package/src/ui/filters/filters.tsx +1 -6
  84. package/src/ui/toolbar/toolbar.jsx +4 -1
  85. package/src/ui/toolbar/toolbar.module.css +0 -6
@@ -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
  );
@@ -111,17 +111,17 @@
111
111
  --color-green-ultra-dark: var(--color-green-900);
112
112
 
113
113
  --color-yellow-25: #fffdf2;
114
- /* https://hihayk.github.io/scale/#4/5/40/80/0/-0/0/0/E5C110/229/193/16/white */
114
+ /* https://hihayk.github.io/scale/#4/5/20/80/0/-0/0/0/E5C110/229/193/16/white */
115
115
  --color-yellow-50: #faf3cf;
116
116
  --color-yellow-100: #f6e9a9;
117
117
  --color-yellow-200: #f2df83;
118
118
  --color-yellow-300: #edd55d;
119
119
  --color-yellow-400: #e9cb36;
120
120
  --color-yellow-500: #e5c110;
121
- --color-yellow-600: #ceae0e;
122
- --color-yellow-700: #b79a0d;
123
- --color-yellow-800: #a0870b;
124
- --color-yellow-900: #89740a;
121
+ --color-yellow-600: #dab70f;
122
+ --color-yellow-700: #ceae0e;
123
+ --color-yellow-800: #c3a40e;
124
+ --color-yellow-900: #b79a0d;
125
125
 
126
126
  --color-yellow-ultra-light: var(--color-yellow-100);
127
127
  --color-yellow-light: var(--color-yellow-300);
@@ -132,9 +132,10 @@
132
132
  --color-dark: #111;
133
133
  --color-light: #fff;
134
134
 
135
- --color-branding-light: #2b76d4;
135
+ /* https://hihayk.github.io/scale/#4/4/40/40/0/-0/0/0/1a477f/26/71/127/white */
136
+ --color-branding-light: #31598c;
136
137
  --color-branding: #1a477f;
137
- --color-branding-dark: #09182a;
138
+ --color-branding-dark: #102b4c;
138
139
  }
139
140
 
140
141
  body {
@@ -146,9 +147,9 @@ body {
146
147
  --color-text-ultra-dark: var(--color-gray-ultra-dark);
147
148
  --color-heading: var(--color-gray-ultra-dark);
148
149
 
149
- --color-accent-light: var(--color-gray);
150
- --color-accent: var(--color-gray-dark);
151
- --color-accent-dark: var(--color-gray-ultra-dark);
150
+ --color-accent-light: var(--color-branding-light);
151
+ --color-accent: var(--color-branding);
152
+ --color-accent-dark: var(--color-branding-dark);
152
153
 
153
154
  --color-success-light: var(--color-green-light);
154
155
  --color-success: var(--color-green);
@@ -361,5 +361,10 @@ a.root {
361
361
  * Disabled state
362
362
  */
363
363
  .root[disabled] {
364
- filter: grayscale(1);
364
+ opacity: 0.9;
365
+ }
366
+
367
+ .root[disabled] .icon,
368
+ .root[disabled] .content {
369
+ opacity: 0.8;
365
370
  }
@@ -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;