@bundle-stats/ui 3.2.4 → 3.2.5-alpha.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.
Files changed (101) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/lib/app/app.js +13 -6
  3. package/lib/app/app.module.css +17 -15
  4. package/lib/app/header/header.js +14 -8
  5. package/lib/app/header/header.module.css +11 -18
  6. package/lib/components/bundle-assets/bundle-assets.module.css +1 -0
  7. package/lib/components/bundle-packages/bundle-packages.module.css +9 -5
  8. package/lib/components/delta/delta.js +22 -15
  9. package/lib/components/delta/delta.module.css +13 -6
  10. package/lib/components/duplicate-packages-warning/duplicate-packages-warning.js +2 -2
  11. package/lib/components/job-header/job-header.js +8 -5
  12. package/lib/components/job-header/job-header.module.css +6 -10
  13. package/lib/components/jobs-header/jobs-header.js +1 -1
  14. package/lib/components/jobs-header/jobs-header.module.css +1 -4
  15. package/lib/components/metric/metric.js +1 -4
  16. package/lib/components/metric/metric.module.css +7 -7
  17. package/lib/components/metrics-table-search/metrics-table-search.module.css +5 -4
  18. package/lib/components/summary-item/summary-item.js +3 -3
  19. package/lib/components/summary-item/summary-item.module.css +2 -9
  20. package/lib/css/default.css +13 -7
  21. package/lib/css/variables.css +24 -24
  22. package/lib/layout/box/box.module.css +9 -0
  23. package/lib/layout/footer/footer.module.css +2 -1
  24. package/lib/layout/index.js +8 -0
  25. package/lib/layout/separator.js +48 -0
  26. package/lib/layout/separator.module.css +5 -0
  27. package/lib/ui/dropdown/dropdown.js +1 -2
  28. package/lib/ui/dropdown/dropdown.module.css +7 -8
  29. package/lib/ui/filters/filters.js +10 -5
  30. package/lib/ui/filters/filters.module.css +10 -0
  31. package/lib/ui/popover/popover.module.css +1 -1
  32. package/lib/ui/table/table.module.css +1 -9
  33. package/lib/ui/tabs/tabs.module.css +1 -2
  34. package/lib/ui/tooltip/tooltip.module.css +1 -1
  35. package/lib-esm/app/app.js +12 -6
  36. package/lib-esm/app/app.module.css +17 -15
  37. package/lib-esm/app/header/header.js +13 -8
  38. package/lib-esm/app/header/header.module.css +11 -18
  39. package/lib-esm/components/bundle-assets/bundle-assets.module.css +1 -0
  40. package/lib-esm/components/bundle-packages/bundle-packages.module.css +9 -5
  41. package/lib-esm/components/delta/delta.js +20 -13
  42. package/lib-esm/components/delta/delta.module.css +13 -6
  43. package/lib-esm/components/duplicate-packages-warning/duplicate-packages-warning.js +2 -2
  44. package/lib-esm/components/job-header/job-header.js +8 -5
  45. package/lib-esm/components/job-header/job-header.module.css +6 -10
  46. package/lib-esm/components/jobs-header/jobs-header.js +1 -1
  47. package/lib-esm/components/jobs-header/jobs-header.module.css +1 -4
  48. package/lib-esm/components/metric/metric.js +1 -4
  49. package/lib-esm/components/metric/metric.module.css +7 -7
  50. package/lib-esm/components/metrics-table-search/metrics-table-search.module.css +5 -4
  51. package/lib-esm/components/summary-item/summary-item.js +3 -3
  52. package/lib-esm/components/summary-item/summary-item.module.css +2 -9
  53. package/lib-esm/css/default.css +13 -7
  54. package/lib-esm/css/variables.css +24 -24
  55. package/lib-esm/layout/box/box.module.css +9 -0
  56. package/lib-esm/layout/footer/footer.module.css +2 -1
  57. package/lib-esm/layout/index.js +1 -0
  58. package/lib-esm/layout/separator.js +28 -0
  59. package/lib-esm/layout/separator.module.css +5 -0
  60. package/lib-esm/ui/dropdown/dropdown.js +1 -2
  61. package/lib-esm/ui/dropdown/dropdown.module.css +7 -8
  62. package/lib-esm/ui/filters/filters.js +9 -4
  63. package/lib-esm/ui/filters/filters.module.css +10 -0
  64. package/lib-esm/ui/popover/popover.module.css +1 -1
  65. package/lib-esm/ui/table/table.module.css +1 -9
  66. package/lib-esm/ui/tabs/tabs.module.css +1 -2
  67. package/lib-esm/ui/tooltip/tooltip.module.css +1 -1
  68. package/package.json +13 -11
  69. package/src/app/app.jsx +23 -15
  70. package/src/app/app.module.css +17 -15
  71. package/src/app/header/header.jsx +15 -10
  72. package/src/app/header/header.module.css +11 -18
  73. package/src/components/bundle-assets/bundle-assets.module.css +1 -0
  74. package/src/components/bundle-packages/bundle-packages.module.css +9 -5
  75. package/src/components/delta/delta.jsx +17 -9
  76. package/src/components/delta/delta.module.css +13 -6
  77. package/src/components/duplicate-packages-warning/duplicate-packages-warning.jsx +7 -2
  78. package/src/components/job-header/job-header.jsx +9 -5
  79. package/src/components/job-header/job-header.module.css +6 -10
  80. package/src/components/jobs-header/jobs-header.jsx +1 -1
  81. package/src/components/jobs-header/jobs-header.module.css +1 -4
  82. package/src/components/metric/metric.jsx +2 -9
  83. package/src/components/metric/metric.module.css +7 -7
  84. package/src/components/metrics-table-search/metrics-table-search.module.css +5 -4
  85. package/src/components/summary-item/summary-item.jsx +1 -1
  86. package/src/components/summary-item/summary-item.module.css +2 -9
  87. package/src/css/default.css +13 -7
  88. package/src/css/variables.css +24 -24
  89. package/src/layout/box/box.module.css +9 -0
  90. package/src/layout/footer/footer.module.css +2 -1
  91. package/src/layout/index.js +1 -0
  92. package/src/layout/separator.jsx +25 -0
  93. package/src/layout/separator.module.css +5 -0
  94. package/src/ui/dropdown/dropdown.jsx +4 -6
  95. package/src/ui/dropdown/dropdown.module.css +7 -8
  96. package/src/ui/filters/filters.jsx +53 -50
  97. package/src/ui/filters/filters.module.css +10 -0
  98. package/src/ui/popover/popover.module.css +1 -1
  99. package/src/ui/table/table.module.css +1 -9
  100. package/src/ui/tabs/tabs.module.css +1 -2
  101. package/src/ui/tooltip/tooltip.module.css +1 -1
@@ -11,6 +11,7 @@
11
11
  }
12
12
 
13
13
  .filterInput {
14
+ border-radius: var(--radius-medium) 0 0 var(--radius-medium);
14
15
  flex: 0 0 auto;
15
16
  height: 1em;
16
17
  cursor: pointer;
@@ -129,11 +130,20 @@
129
130
  }
130
131
 
131
132
  .item {
133
+ border-radius: 0;
132
134
  position: relative;
133
135
  flex: 0 0 auto;
134
136
  margin-right: -1px;
135
137
  }
136
138
 
139
+ .item:first-child {
140
+ border-radius: var(--radius-medium) 0 0 var(--radius-medium);
141
+ }
142
+
143
+ .item:last-child {
144
+ border-radius: 0 var(--radius-medium) var(--radius-medium) 0;
145
+ }
146
+
137
147
  .item:hover {
138
148
  z-index: var(--layer-low); /* show collapsed border */
139
149
  }
@@ -24,7 +24,7 @@
24
24
 
25
25
  .popover {
26
26
  padding: var(--space-small) var(--space-large) var(--space-small) var(--space-small);
27
- border-radius: var(--radius-small);
27
+ border-radius: var(--radius-large);
28
28
  max-width: 360px;
29
29
  outline: none;
30
30
  filter: drop-shadow(0 0 var(--space-xxxsmall) var(--color-shadow));
@@ -13,12 +13,8 @@
13
13
  text-align: left;
14
14
  }
15
15
 
16
- tr:last-child .cell {
17
- border-bottom-width: 1px;
18
- }
19
-
20
16
  .root thead .cell {
21
- border-width: 0 0 2px;
17
+ border-width: 0 0 1px;
22
18
  text-transform: uppercase;
23
19
  vertical-align: top;
24
20
  }
@@ -44,10 +40,6 @@ tr:last-child .cell {
44
40
  text-decoration: underline;
45
41
  }
46
42
 
47
- .root tbody tr:nth-child(odd) .cell {
48
- background-color: var(--color-highlight);
49
- }
50
-
51
43
  .root tbody tr:hover .cell {
52
44
  background-color: var(--color-highlight-warning);
53
45
  }
@@ -7,8 +7,7 @@
7
7
  position: relative;
8
8
  display: inline-block;
9
9
  padding: var(--space-xsmall) 0;
10
- color: var(--color-text-ultra-light);
11
- font-weight: bold;
10
+ color: var(--color-text-light);
12
11
  text-decoration: none;
13
12
  }
14
13
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  .tooltip {
14
14
  padding: var(--space-xxxsmall) var(--space-xxsmall);
15
- border-radius: var(--radius-small);
15
+ border-radius: var(--radius-large);
16
16
  background: var(--color-light);
17
17
  color: var(--color-text);
18
18
  filter: drop-shadow(0 0 var(--space-xxxsmall) var(--color-shadow));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bundle-stats/ui",
3
- "version": "3.2.4",
3
+ "version": "3.2.5-alpha.0",
4
4
  "description": "UI components for BundleStats projects.",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -37,23 +37,24 @@
37
37
  "homepage": "https://github.com/relative-ci/bundle-stats/blob/master/packages/ui#readme",
38
38
  "devDependencies": {
39
39
  "@babel/cli": "7.16.8",
40
- "@babel/core": "7.16.7",
40
+ "@babel/core": "7.16.12",
41
41
  "@babel/plugin-proposal-class-properties": "7.16.7",
42
- "@babel/preset-env": "7.16.8",
42
+ "@babel/preset-env": "7.16.11",
43
43
  "@babel/preset-react": "7.16.7",
44
44
  "@simplyianm/babel-plugin-inline-react-svg": "1.2.0",
45
+ "@storybook/addon-essentials": "6.4.14",
45
46
  "@storybook/addon-knobs": "6.4.0",
46
47
  "@storybook/addon-postcss": "2.0.0",
47
- "@storybook/addon-storyshots": "6.4.12",
48
- "@storybook/addons": "6.4.12",
49
- "@storybook/builder-webpack5": "6.4.12",
50
- "@storybook/manager-webpack5": "6.4.12",
51
- "@storybook/react": "6.4.12",
48
+ "@storybook/addon-storyshots": "6.4.14",
49
+ "@storybook/addons": "6.4.14",
50
+ "@storybook/builder-webpack5": "6.4.14",
51
+ "@storybook/manager-webpack5": "6.4.14",
52
+ "@storybook/react": "6.4.14",
52
53
  "babel-core": "7.0.0-bridge.0",
53
54
  "babel-jest": "27.4.6",
54
55
  "babel-plugin-lodash": "3.3.4",
55
56
  "babel-plugin-require-context-hook": "1.0.0",
56
- "chromatic": "6.3.4",
57
+ "chromatic": "6.4.1",
57
58
  "classnames": "2.3.1",
58
59
  "colormap": "2.3.2",
59
60
  "core-js": "3.20.2",
@@ -84,11 +85,12 @@
84
85
  "react-router-dom": "5.3.0"
85
86
  },
86
87
  "dependencies": {
87
- "@bundle-stats/utils": "^3.2.4",
88
+ "@bundle-stats/utils": "^3.2.5-alpha.0",
88
89
  "date-fns": "2.28.0",
90
+ "modern-css-reset": "1.4.0",
89
91
  "query-string": "7.1.0",
90
92
  "reakit": "1.3.11",
91
93
  "use-query-params": "1.2.3"
92
94
  },
93
- "gitHead": "1c72cc1819a7fbee11ff8ad48218f943f69cb704"
95
+ "gitHead": "9e6c922005aec32e13b7140e395449d32ae47328"
94
96
  }
package/src/app/app.jsx CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  URLS,
12
12
  } from '../constants';
13
13
  import { Box } from '../layout/box';
14
+ import { Separator } from '../layout/separator';
14
15
  import { Container } from '../ui/container';
15
16
  import { DuplicatePackagesWarning } from '../components/duplicate-packages-warning';
16
17
  import { Summary } from '../components/summary';
@@ -42,7 +43,7 @@ const Layout = ({ jobs, version, ...props }) => (
42
43
  <div className={css.root}>
43
44
  <Header className={css.header} jobs={jobs} />
44
45
  <main className={css.main} {...props} />
45
- <Footer version={version} />
46
+ <Footer className={css.footer} version={version} />
46
47
  </div>
47
48
  );
48
49
 
@@ -58,8 +59,12 @@ Layout.defaultProps = {
58
59
 
59
60
  const AppComponent = ({ version, jobs }) => {
60
61
  const [bundleStatsState, bundleStatsSetState] = useComponentQueryState(COMPONENT.BUNDLE_ASSETS);
61
- const [bundlePackagesState, bundlePackagesSetState] = useComponentQueryState(COMPONENT.BUNDLE_PACKAGES);
62
- const [bundleModulesState, bundleModulesSetState] = useComponentQueryState(COMPONENT.BUNDLE_MODULES);
62
+ const [bundlePackagesState, bundlePackagesSetState] = useComponentQueryState(
63
+ COMPONENT.BUNDLE_PACKAGES,
64
+ );
65
+ const [bundleModulesState, bundleModulesSetState] = useComponentQueryState(
66
+ COMPONENT.BUNDLE_MODULES,
67
+ );
63
68
 
64
69
  if (jobs.length === 0) {
65
70
  return (
@@ -178,20 +183,23 @@ const AppComponent = ({ version, jobs }) => {
178
183
  exact
179
184
  path={URLS.OVERVIEW}
180
185
  render={() => (
181
- <Stack space="large">
182
- {duplicatePackagesInsights && (
183
- <Container>
184
- <DuplicatePackagesWarning
185
- duplicatePackagesCount={duplicatePackagesCount}
186
- showDelta={jobs.length > 1}
187
- />
188
- </Container>
189
- )}
186
+ <Stack space="medium">
190
187
  <Container>
191
- <Stack space="small">
192
- <TotalSizeTypeTitle />
193
- <BundleAssetsTotalsChartBars jobs={jobs} />
188
+ <Stack space="medium">
189
+ {duplicatePackagesInsights && (
190
+ <DuplicatePackagesWarning
191
+ duplicatePackagesCount={duplicatePackagesCount}
192
+ showDelta={jobs.length > 1}
193
+ />
194
+ )}
194
195
  <Box outline>
196
+ <Box padding="small">
197
+ <Stack space="small">
198
+ <TotalSizeTypeTitle />
199
+ <BundleAssetsTotalsChartBars jobs={jobs} />
200
+ </Stack>
201
+ </Box>
202
+ <Separator />
195
203
  <BundleAssetsTotalsTable jobs={jobs} />
196
204
  </Box>
197
205
  </Stack>
@@ -3,7 +3,10 @@
3
3
  }
4
4
 
5
5
  .root {
6
- padding-top: var(--header-height);
6
+ }
7
+
8
+ .header {
9
+ border-bottom: 1px solid var(--color-outline);
7
10
  }
8
11
 
9
12
  .empty {
@@ -13,16 +16,12 @@
13
16
  }
14
17
 
15
18
  .summaryContainer {
16
- padding-top: var(--space-large);
17
- padding-bottom: var(--space-small);
19
+ padding-top: var(--space-medium);
20
+ padding-bottom: var(--space-xsmall);
18
21
  }
19
22
 
20
23
  .tabsContainer {
21
- border-bottom: 1px solid var(--color-outline);
22
- }
23
-
24
- .tabs {
25
- margin-bottom: -1px;
24
+ background: var(--color-light);
26
25
  }
27
26
 
28
27
  .tabActive {
@@ -34,24 +33,27 @@
34
33
  }
35
34
 
36
35
  .tabsContent {
37
- padding-top: var(--space-large);
38
- padding-bottom: var(--space-large);
36
+ padding-top: var(--space-medium);
37
+ padding-bottom: var(--space-medium);
39
38
  min-height: 480px;
40
39
  }
41
40
 
42
41
  @media (min-width: 600px) {
43
42
  :root {
44
- --header-height: 80px;
43
+ --header-height: 78px;
45
44
  }
46
45
 
47
46
  .header {
48
- position: fixed;
47
+ position: sticky;
49
48
  z-index: var(--layer-high);
50
- left: 0;
51
49
  top: 0;
52
- right: 0;
53
50
  height: var(--header-height);
54
51
  background-color: var(--color-background);
55
- border-bottom: 1px solid var(--color-outline);
52
+ }
53
+
54
+ .tabsContainer {
55
+ position: sticky;
56
+ top: var(--header-height);
57
+ z-index: 100;
56
58
  }
57
59
  }
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import cx from 'classnames';
4
4
 
5
+ import { FlexStack } from '../../layout/flex-stack';
5
6
  import { Container } from '../../ui/container';
6
7
  import { JobsHeader } from '../../components/jobs-header';
7
8
  import { Logo } from '../../ui/logo';
@@ -10,17 +11,21 @@ import css from './header.module.css';
10
11
 
11
12
  export const Header = ({ className, jobs }) => (
12
13
  <Container as="header" className={cx(css.root, className)}>
13
- <div className={css.inner}>
14
- <a
15
- className={css.branding}
16
- href="https://github.com/relative-ci/bundle-stats"
17
- target="_blank"
18
- rel="noopener noreferrer nofollow"
19
- >
20
- <Logo className={css.brandingLogo}>BundleStats</Logo>
21
- </a>
14
+ <FlexStack space="small" className={css.inner}>
22
15
  <JobsHeader className={css.jobs} jobs={jobs} />
23
- </div>
16
+ <div className={css.options}>
17
+ <a
18
+ href="https://github.com/relative-ci/bundle-stats"
19
+ target="_blank"
20
+ rel="noopener noreferrer nofollow"
21
+ title="View bundle-stats on GitHub"
22
+ >
23
+ <Logo className={css.github} kind="github">
24
+ GitHub
25
+ </Logo>
26
+ </a>
27
+ </div>
28
+ </FlexStack>
24
29
  </Container>
25
30
  );
26
31
 
@@ -1,30 +1,23 @@
1
1
  .inner {
2
- display: flex;
3
- align-items: center;
4
- }
5
-
6
- .branding {
7
- padding: var(--space-small);
8
- flex: 0 0 auto;
9
- color: var(--color-text);
10
- display: flex;
11
2
  align-items: center;
12
3
  }
13
4
 
14
5
  .jobs {
15
6
  flex: 1 1 auto;
7
+ overflow-x: auto;
16
8
  }
17
9
 
18
- .tools {
19
- border-left: 1px solid var(--color-outline);
20
- padding: var(--space-small);
21
- margin: 0 0 0 auto;
22
- display: flex;
23
- align-items: center;
24
- color: var(--color-text-light);
10
+ .options {
11
+ flex: 0 0 var(--space-large);
12
+ }
13
+
14
+ .option {
15
+ display: inline-block;
25
16
  }
26
17
 
27
- .toolsGithub {
28
- color: inherit;
18
+ .github {
19
+ display: block;
20
+ color: var(--color-text-ultra-light);
29
21
  width: var(--space-medium);
22
+ height: var(--space-medium);
30
23
  }
@@ -31,6 +31,7 @@
31
31
  }
32
32
 
33
33
  .flag {
34
+ border-radius: var(--radius-small);
34
35
  display: inline-block;
35
36
  width: var(--space-xsmall);
36
37
  height: var(--space-xsmall);
@@ -13,17 +13,21 @@
13
13
  }
14
14
 
15
15
  .duplicate {
16
- margin-right: var(--space-xxxsmall);
16
+ border-radius: var(--radius-small);
17
17
  display: inline-block;
18
- width: var(--space-small);
19
- height: var(--space-small);
20
- font-size: 10px;
18
+ width: var(--space-xsmall);
19
+ height: var(--space-xsmall);
20
+ font-family: var(--font-family);
21
+ font-size: 8px;
21
22
  font-weight: bold;
22
- line-height: var(--space-small);
23
+ background: var(--color-highlight);
24
+ color: var(--color-text-light);
25
+ line-height: var(--space-xsmall);
23
26
  text-align: center;
24
27
  text-transform: uppercase;
25
28
  vertical-align: middle;
26
29
 
30
+ margin-right: var(--space-xxxsmall);
27
31
  background: var(--color-danger);
28
32
  color: var(--color-light);
29
33
  }
@@ -4,19 +4,27 @@ import cx from 'classnames';
4
4
 
5
5
  import css from './delta.module.css';
6
6
 
7
- export const Delta = ({ className, displayValue, deltaType, inverted }) => {
8
- const rootClassName = cx(css.root, className, inverted && css.inverted, css[deltaType]);
9
- return <span className={rootClassName}>{displayValue}</span>;
7
+ const propTypes = {
8
+ className: PropTypes.string,
9
+ displayValue: PropTypes.string.isRequired,
10
+ deltaType: PropTypes.string.isRequired,
11
+ inverted: PropTypes.bool,
10
12
  };
11
13
 
12
- Delta.defaultProps = {
14
+ const defaultProps = {
13
15
  className: '',
14
16
  inverted: false,
15
17
  };
16
18
 
17
- Delta.propTypes = {
18
- className: PropTypes.string,
19
- displayValue: PropTypes.string.isRequired,
20
- deltaType: PropTypes.string.isRequired,
21
- inverted: PropTypes.bool,
19
+ /**
20
+ * @param {PropTypes.InferProps<typeof propTypes>} props
21
+ * @return {React.FunctionComponentElement}
22
+ */
23
+ export const Delta = (props) => {
24
+ const { className, displayValue, deltaType, inverted } = props;
25
+ const rootClassName = cx(css.root, className, inverted && css.inverted, css[deltaType]);
26
+ return <span className={rootClassName}>{displayValue}</span>;
22
27
  };
28
+
29
+ Delta.defaultProps = defaultProps;
30
+ Delta.propTypes = propTypes;
@@ -1,6 +1,5 @@
1
1
  .root {
2
2
  white-space: nowrap;
3
- color: var(--color-gray-ultra-light);
4
3
  }
5
4
 
6
5
  .HIGH_NEGATIVE {
@@ -8,7 +7,7 @@
8
7
  }
9
8
 
10
9
  .NEGATIVE {
11
- color: var(--color-red-dark);
10
+ color: var(--color-red);
12
11
  }
13
12
 
14
13
  .LOW_NEGATIVE {
@@ -20,7 +19,7 @@
20
19
  }
21
20
 
22
21
  .POSITIVE {
23
- color: var(--color-green-dark);
22
+ color: var(--color-green);
24
23
  }
25
24
 
26
25
  .HIGH_POSITIVE {
@@ -28,30 +27,38 @@
28
27
  }
29
28
 
30
29
  .inverted {
31
- background-color: var(--color-gray-ultra-light);
30
+ padding: 2px;
31
+ border-radius: var(--radius-small);
32
+ background: var(--color-gray-ultra-light);
32
33
  color: var(--color-light);
33
34
  }
34
35
 
35
36
  .inverted.HIGH_NEGATIVE {
36
37
  background: var(--color-red-dark);
38
+ color: var(--color-highlight-danger);
37
39
  }
38
40
 
39
41
  .inverted.NEGATIVE {
40
- background: var(--color-red-dark);
42
+ background: var(--color-red);
43
+ color: var(--color-highlight-danger);
41
44
  }
42
45
 
43
46
  .inverted.LOW_NEGATIVE {
44
47
  background: var(--color-red-light);
48
+ color: var(--color-highlight-danger);
45
49
  }
46
50
 
47
51
  .inverted.LOW_POSITIVE {
48
52
  background: var(--color-green-light);
53
+ color: var(--color-highlight-success);
49
54
  }
50
55
 
51
56
  .inverted.POSITIVE {
52
- background: var(--color-green-dark);
57
+ background: var(--color-green);
58
+ color: var(--color-highlight-success);
53
59
  }
54
60
 
55
61
  .inverted.HIGH_POSITIVE {
56
62
  background: var(--color-green-dark);
63
+ color: var(--color-highlight-success);
57
64
  }
@@ -1,7 +1,12 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import cx from 'classnames';
4
- import { BUNDLE_PACKAGES_DUPLICATE, METRIC_TYPE_NUMERIC, METRIC_TYPES, getMetricRunInfo } from '@bundle-stats/utils';
4
+ import {
5
+ BUNDLE_PACKAGES_DUPLICATE,
6
+ METRIC_TYPE_NUMERIC,
7
+ METRIC_TYPES,
8
+ getMetricRunInfo,
9
+ } from '@bundle-stats/utils';
5
10
 
6
11
  import { Alert } from '../../ui/alert';
7
12
  import { ComponentLink } from '../component-link';
@@ -32,9 +37,9 @@ export const DuplicatePackagesWarning = (props) => {
32
37
  {showDelta && metricRunInfo.delta !== 0 && (
33
38
  <Delta
34
39
  className={css.titleDelta}
35
- inverted
36
40
  displayValue={metricRunInfo.displayDelta}
37
41
  deltaType={metricRunInfo.deltaType}
42
+ inverted
38
43
  />
39
44
  )}
40
45
  {` duplicate ${metricRunInfo.value === 1 ? 'package' : 'packages'}.`}
@@ -17,26 +17,30 @@ export const JobHeader = (props) => {
17
17
  const rootClassName = cx(css.root, className);
18
18
 
19
19
  return (
20
- <Stack className={rootClassName} space="xxsmall">
20
+ <Stack className={rootClassName} space="xxxsmall">
21
21
  <h1 className={css.title}>
22
22
  <span>{`#${job.internalBuildNumber}`}</span>
23
23
  {tag && <span className={css.tag}>{tag}</span>}
24
24
  </h1>
25
25
  <FlexStack className={css.meta} space="xxsmall">
26
26
  {builtAt && (
27
- <span className={css.metaItem} title={`${formatDate(builtAt)} ${formatTime(builtAt)}`}>
27
+ <FlexStack
28
+ className={css.metaItem}
29
+ title={`${formatDate(builtAt)} ${formatTime(builtAt)}`}
30
+ space="xxxsmall"
31
+ >
28
32
  <Icon glyph="clock" className={css.metaIcon} />
29
33
  <span className={css.metaLabel}>
30
34
  {formatDistanceToNow(new Date(builtAt), { addSuffix: true })}
31
35
  </span>
32
- </span>
36
+ </FlexStack>
33
37
  )}
34
38
 
35
39
  {hash && (
36
- <span className={css.metaItem} title="Webpack bundle hash">
40
+ <FlexStack span className={css.metaItem} title="Webpack bundle hash" space="xxxsmall">
37
41
  <Icon glyph="commit" className={css.metaIcon} />
38
42
  <span className={css.metaLabel}>{hash}</span>
39
- </span>
43
+ </FlexStack>
40
44
  )}
41
45
 
42
46
  <div className={css.content}>{children}</div>
@@ -1,36 +1,32 @@
1
1
  .title {
2
- line-height: 1;
3
- font-weight: bold;
2
+ font-size: var(--size-xlarge);
4
3
  vertical-align: top;
5
4
  }
6
5
 
7
6
  .tag {
8
7
  padding: var(--space-xxxsmall);
9
8
  margin-left: var(--space-xxxsmall);
10
- background-color: var(--color-highlight);
9
+ background: var(--color-highlight);
11
10
  color: var(--color-text-light);
12
11
  display: inline-block;
13
- font-size: 9px;
12
+ font-size: var(--size-xsmall);
14
13
  line-height: var(--space-xxsmall);
15
14
  font-weight: normal;
16
15
  vertical-align: top;
17
16
  }
18
17
 
19
- .meta {
20
- color: var(--color-text-light);
21
- }
22
-
23
18
  .metaItem {
24
19
  display: inline-flex;
25
20
  align-items: center;
21
+ white-space: nowrap;
26
22
  }
27
23
 
28
24
  .metaIcon {
29
25
  width: var(--space-small);
30
26
  height: var(--space-small);
31
- margin-right: var(--space-xxxsmall);
27
+ color: var(--color-text-ultra-light);
32
28
  }
33
29
 
34
30
  .metaLabel {
35
- line-height: var(--space-small);
31
+ color: var(--color-text-light);
36
32
  }
@@ -12,7 +12,7 @@ export const JobsHeader = (props) => {
12
12
  const rootClassName = cx(css.root, className);
13
13
 
14
14
  return (
15
- <FlexStack className={rootClassName} space="none">
15
+ <FlexStack className={rootClassName} space="small">
16
16
  {jobs?.map((job, index) => (
17
17
  <JobHeader
18
18
  key={job.internalBuildNumber || index}
@@ -1,11 +1,8 @@
1
1
  .root {
2
2
  align-items: stretch;
3
- flex-wrap: wrap;
4
3
  padding: var(--space-small) 0;
5
4
  }
6
5
 
7
6
  .item {
8
- flex: 0 0 auto;
9
- padding: 0 var(--space-medium);
10
- border-left: 1px solid var(--color-outline);
7
+ flex: 0 1 auto;
11
8
  }
@@ -7,7 +7,7 @@ import styles from './metric.module.css';
7
7
  // Separate value and unit
8
8
  const EXTRACT_VALUE_UNIT_PATTERN = /([\d|.|,| ]*)(\w*|%)$/;
9
9
 
10
- export const Metric = ({ className, value, formatter, inline, anchored, children, enhanced }) => {
10
+ export const Metric = ({ className, value, formatter, anchored, children, enhanced }) => {
11
11
  const formattedValue = formatter(value);
12
12
 
13
13
  // eslint-disable-next-line no-unused-vars
@@ -16,12 +16,7 @@ export const Metric = ({ className, value, formatter, inline, anchored, children
16
16
  ? formattedValue.match(EXTRACT_VALUE_UNIT_PATTERN)
17
17
  : [null, formattedValue, null];
18
18
 
19
- const rootClassName = cx(
20
- className,
21
- styles.root,
22
- inline && styles.inline,
23
- anchored && styles.anchored,
24
- );
19
+ const rootClassName = cx(className, styles.root, anchored && styles.anchored);
25
20
 
26
21
  return (
27
22
  <span className={rootClassName}>
@@ -38,7 +33,6 @@ Metric.defaultProps = {
38
33
  className: '',
39
34
  anchored: false,
40
35
  enhanced: false,
41
- inline: false,
42
36
  value: 0,
43
37
  children: [],
44
38
  formatter: (val) => val,
@@ -47,7 +41,6 @@ Metric.defaultProps = {
47
41
  Metric.propTypes = {
48
42
  className: PropTypes.string,
49
43
  enhanced: PropTypes.bool,
50
- inline: PropTypes.bool,
51
44
  anchored: PropTypes.bool,
52
45
  value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
53
46
  formatter: PropTypes.func,