@bundle-stats/ui 4.1.1-alpha.1 → 4.1.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.
- package/lib/app/app.js +20 -85
- package/lib/app/app.stories.js +2 -20
- package/lib/app/header/header.js +2 -11
- package/lib/app/header/index.js +0 -2
- package/lib/app/index.js +0 -2
- package/lib/components/asset-info/asset-info.js +7 -25
- package/lib/components/asset-info/asset-info.stories.js +0 -5
- package/lib/components/asset-info/index.js +0 -2
- package/lib/components/browsertime-table/browsertime-table.js +1 -12
- package/lib/components/browsertime-table/browsertime-table.stories.js +1 -11
- package/lib/components/browsertime-table/index.js +0 -2
- package/lib/components/bundle-assets/bundle-assets.constants.js +0 -3
- package/lib/components/bundle-assets/bundle-assets.js +29 -86
- package/lib/components/bundle-assets/bundle-assets.stories.js +2 -23
- package/lib/components/bundle-assets/bundle-assets.utils.js +0 -26
- package/lib/components/bundle-assets/index.js +21 -49
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +3 -33
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.stories.js +0 -8
- package/lib/components/bundle-assets-totals-chart-bars/index.js +0 -2
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.js +7 -29
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +0 -10
- package/lib/components/bundle-assets-totals-table/index.js +0 -2
- package/lib/components/bundle-modules/bundle-modules.constants.js +0 -3
- package/lib/components/bundle-modules/bundle-modules.js +24 -77
- package/lib/components/bundle-modules/bundle-modules.stories.js +16 -30
- package/lib/components/bundle-modules/bundle-modules.utils.js +19 -54
- package/lib/components/bundle-modules/index.js +25 -56
- package/lib/components/bundle-packages/bundle-packages.constants.js +0 -3
- package/lib/components/bundle-packages/bundle-packages.js +33 -83
- package/lib/components/bundle-packages/bundle-packages.stories.js +2 -22
- package/lib/components/bundle-packages/bundle-packages.utils.js +0 -23
- package/lib/components/bundle-packages/index.js +23 -49
- package/lib/components/component-link.js +4 -17
- package/lib/components/delta/delta.js +3 -10
- package/lib/components/delta/delta.stories.js +0 -5
- package/lib/components/delta/index.js +0 -2
- package/lib/components/duplicate-packages-warning/duplicate-packages-warning.js +3 -15
- package/lib/components/duplicate-packages-warning/duplicate-packages-warning.module.css +1 -0
- package/lib/components/duplicate-packages-warning/duplicate-packages-warning.stories.js +0 -5
- package/lib/components/duplicate-packages-warning/index.js +0 -2
- package/lib/components/index.js +0 -22
- package/lib/components/job-header/index.js +0 -2
- package/lib/components/job-header/job-header.js +6 -22
- package/lib/components/job-header/job-header.stories.js +0 -5
- package/lib/components/job-meta/index.js +0 -2
- package/lib/components/job-meta/job-meta.js +4 -18
- package/lib/components/job-meta/job-meta.stories.js +0 -5
- package/lib/components/job-name/index.js +0 -2
- package/lib/components/job-name/job-name.js +4 -19
- package/lib/components/job-name/job-name.stories.js +0 -5
- package/lib/components/jobs-header/index.js +0 -2
- package/lib/components/jobs-header/jobs-header.js +1 -12
- package/lib/components/jobs-header/jobs-header.stories.js +0 -5
- package/lib/components/lighthouse-table/index.js +0 -2
- package/lib/components/lighthouse-table/lighthouse-table.js +1 -12
- package/lib/components/lighthouse-table/lighthouse-table.stories.js +0 -7
- package/lib/components/metric/index.js +0 -2
- package/lib/components/metric/metric.js +27 -45
- package/lib/components/metric/metric.stories.js +0 -6
- package/lib/components/metrics-table/index.js +0 -2
- package/lib/components/metrics-table/metrics-table.js +36 -75
- package/lib/components/metrics-table/metrics-table.stories.js +0 -5
- package/lib/components/metrics-table-options/index.js +0 -2
- package/lib/components/metrics-table-options/metrics-table-options.js +5 -19
- package/lib/components/metrics-table-options/metrics-table-options.stories.js +0 -5
- package/lib/components/metrics-table-search/index.js +0 -2
- package/lib/components/metrics-table-search/metrics-table-search.js +9 -28
- package/lib/components/metrics-table-search/metrics-table-search.stories.js +3 -19
- package/lib/components/metrics-table-title/index.js +0 -2
- package/lib/components/metrics-table-title/metrics-table-title.js +4 -16
- package/lib/components/module-info/index.js +0 -2
- package/lib/components/module-info/module-info.js +6 -22
- package/lib/components/module-info/module-info.stories.js +0 -5
- package/lib/components/summary/index.js +0 -2
- package/lib/components/summary/summary.js +9 -33
- package/lib/components/summary/summary.module.css +4 -1
- package/lib/components/summary/summary.stories.js +1 -15
- package/lib/components/summary-item/index.js +0 -2
- package/lib/components/summary-item/summary-item.js +14 -44
- package/lib/components/summary-item/summary-item.stories.js +0 -14
- package/lib/components/total-size-type-title/index.js +0 -2
- package/lib/components/total-size-type-title/total-size-type-title.js +0 -13
- package/lib/constants.js +0 -8
- package/lib/css/default.css +3 -1
- package/lib/css/variables.css +56 -56
- package/lib/hooks/rows-filter.js +3 -7
- package/lib/hooks/rows-sort.js +12 -25
- package/lib/hooks/search-params.js +21 -51
- package/lib/index.js +0 -10
- package/lib/layout/box/box.js +10 -39
- package/lib/layout/box/box.stories.js +0 -5
- package/lib/layout/box/index.js +0 -1
- package/lib/layout/flex-stack/flex-stack.js +4 -18
- package/lib/layout/flex-stack/flex-stack.stories.js +0 -6
- package/lib/layout/flex-stack/index.js +0 -2
- package/lib/layout/footer/footer.js +1 -16
- package/lib/layout/footer/footer.stories.js +0 -5
- package/lib/layout/footer/index.js +0 -1
- package/lib/layout/header/header.js +3 -13
- package/lib/layout/header/header.stories.js +0 -7
- package/lib/layout/header/index.js +0 -1
- package/lib/layout/index.js +0 -7
- package/lib/layout/separator.js +2 -14
- package/lib/layout/stack/index.js +0 -2
- package/lib/layout/stack/stack.js +4 -18
- package/lib/layout/stack/stack.stories.js +0 -6
- package/lib/layout/sub-header/index.js +0 -2
- package/lib/layout/sub-header/sub-header.js +6 -16
- package/lib/layout/sub-header/sub-header.stories.js +0 -6
- package/lib/prototypes/typography.stories.js +29 -12
- package/lib/query-state.js +5 -28
- package/lib/stories/index.js +0 -2
- package/lib/stories/wrapper.js +0 -9
- package/lib/ui/alert/alert.js +2 -10
- package/lib/ui/alert/alert.stories.js +0 -5
- package/lib/ui/alert/index.js +0 -2
- package/lib/ui/container/container.js +2 -15
- package/lib/ui/container/container.stories.js +0 -4
- package/lib/ui/container/index.js +0 -1
- package/lib/ui/dropdown/dropdown.js +5 -20
- package/lib/ui/dropdown/dropdown.stories.js +0 -5
- package/lib/ui/dropdown/index.js +0 -2
- package/lib/ui/empty-set/empty-set.js +3 -17
- package/lib/ui/empty-set/empty-set.stories.js +0 -5
- package/lib/ui/empty-set/index.js +0 -2
- package/lib/ui/file-name/file-name.js +2 -11
- package/lib/ui/file-name/file-name.stories.js +0 -4
- package/lib/ui/file-name/index.js +0 -1
- package/lib/ui/filters/filters.js +29 -73
- package/lib/ui/filters/filters.stories.js +7 -28
- package/lib/ui/filters/filters.utils.js +13 -42
- package/lib/ui/filters/index.js +8 -35
- package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.js +18 -61
- package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.stories.js +0 -5
- package/lib/ui/horizontal-bar-chart/index.js +0 -2
- package/lib/ui/hover-card/hover-card.js +8 -28
- package/lib/ui/hover-card/hover-card.stories.js +0 -10
- package/lib/ui/hover-card/index.js +0 -2
- package/lib/ui/icon/icon.js +4 -17
- package/lib/ui/icon/icon.stories.js +0 -8
- package/lib/ui/icon/index.js +0 -2
- package/lib/ui/index.js +0 -19
- package/lib/ui/input/index.js +0 -2
- package/lib/ui/input/input.js +2 -14
- package/lib/ui/input/input.stories.js +0 -5
- package/lib/ui/loader/index.js +0 -2
- package/lib/ui/loader/loader.js +2 -15
- package/lib/ui/loader/loader.stories.js +0 -5
- package/lib/ui/logo/index.js +0 -1
- package/lib/ui/logo/logo.js +3 -28
- package/lib/ui/logo/logo.stories.js +1 -10
- package/lib/ui/panels/index.js +0 -1
- package/lib/ui/panels/panels.js +5 -23
- package/lib/ui/panels/panels.stories.js +0 -5
- package/lib/ui/skeleton/index.js +0 -2
- package/lib/ui/skeleton/skeleton.js +3 -15
- package/lib/ui/skeleton/skeleton.stories.js +0 -8
- package/lib/ui/sort-dropdown/index.js +0 -2
- package/lib/ui/sort-dropdown/sort-dropdown.js +18 -50
- package/lib/ui/sort-dropdown/sort-dropdown.stories.js +1 -5
- package/lib/ui/table/index.js +0 -2
- package/lib/ui/table/table.js +4 -13
- package/lib/ui/table/table.stories.js +4 -9
- package/lib/ui/tabs/index.js +0 -1
- package/lib/ui/tabs/tabs.js +5 -21
- package/lib/ui/tabs/tabs.module.css +6 -2
- package/lib/ui/tabs/tabs.stories.js +0 -5
- package/lib/ui/tag/index.js +0 -2
- package/lib/ui/tag/tag.js +8 -21
- package/lib/ui/tag/tag.stories.js +0 -6
- package/lib/ui/toolbar/index.js +0 -2
- package/lib/ui/toolbar/toolbar.js +2 -9
- package/lib/ui/toolbar/toolbar.stories.js +0 -5
- package/lib/ui/tooltip/index.js +0 -2
- package/lib/ui/tooltip/tooltip.js +8 -21
- package/lib/ui/tooltip/tooltip.stories.js +0 -7
- package/lib/utils.js +0 -18
- package/lib-esm/app/app.js +1 -18
- package/lib-esm/app/app.stories.js +3 -5
- package/lib-esm/app/header/header.js +1 -1
- package/lib-esm/components/asset-info/asset-info.js +0 -8
- package/lib-esm/components/browsertime-table/browsertime-table.js +0 -1
- package/lib-esm/components/browsertime-table/browsertime-table.stories.js +2 -1
- package/lib-esm/components/bundle-assets/bundle-assets.js +2 -14
- package/lib-esm/components/bundle-assets/bundle-assets.stories.js +0 -2
- package/lib-esm/components/bundle-assets/bundle-assets.utils.js +4 -11
- package/lib-esm/components/bundle-assets/index.js +0 -1
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +0 -7
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +1 -4
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +0 -2
- package/lib-esm/components/bundle-modules/bundle-modules.js +4 -16
- package/lib-esm/components/bundle-modules/bundle-modules.stories.js +4 -2
- package/lib-esm/components/bundle-modules/bundle-modules.utils.js +15 -25
- package/lib-esm/components/bundle-modules/index.js +0 -6
- package/lib-esm/components/bundle-packages/bundle-packages.js +2 -11
- package/lib-esm/components/bundle-packages/bundle-packages.utils.js +4 -8
- package/lib-esm/components/bundle-packages/index.js +0 -1
- package/lib-esm/components/component-link.js +1 -2
- package/lib-esm/components/duplicate-packages-warning/duplicate-packages-warning.module.css +1 -0
- package/lib-esm/components/job-header/job-header.js +1 -3
- package/lib-esm/components/job-meta/job-meta.js +0 -3
- package/lib-esm/components/job-name/job-name.js +0 -4
- package/lib-esm/components/jobs-header/jobs-header.js +0 -1
- package/lib-esm/components/lighthouse-table/lighthouse-table.js +0 -1
- package/lib-esm/components/metric/metric.js +2 -6
- package/lib-esm/components/metrics-table/metrics-table.js +14 -18
- package/lib-esm/components/metrics-table-options/metrics-table-options.js +0 -3
- package/lib-esm/components/metrics-table-search/metrics-table-search.js +4 -2
- package/lib-esm/components/metrics-table-search/metrics-table-search.stories.js +0 -2
- package/lib-esm/components/module-info/module-info.js +0 -4
- package/lib-esm/components/summary/summary.js +0 -2
- package/lib-esm/components/summary/summary.module.css +4 -1
- package/lib-esm/components/summary/summary.stories.js +0 -1
- package/lib-esm/components/summary-item/summary-item.js +0 -9
- package/lib-esm/constants.js +2 -1
- package/lib-esm/css/default.css +3 -1
- package/lib-esm/css/variables.css +56 -56
- package/lib-esm/hooks/rows-filter.js +0 -1
- package/lib-esm/hooks/search-params.js +9 -17
- package/lib-esm/layout/box/box.js +0 -6
- package/lib-esm/layout/flex-stack/flex-stack.js +0 -1
- package/lib-esm/layout/footer/footer.js +1 -4
- package/lib-esm/layout/header/header.js +0 -3
- package/lib-esm/layout/separator.js +1 -2
- package/lib-esm/layout/stack/stack.js +0 -1
- package/lib-esm/prototypes/typography.stories.js +27 -2
- package/lib-esm/query-state.js +2 -5
- package/lib-esm/stories/wrapper.js +0 -1
- package/lib-esm/ui/container/container.js +0 -2
- package/lib-esm/ui/dropdown/dropdown.js +0 -5
- package/lib-esm/ui/file-name/file-name.js +0 -2
- package/lib-esm/ui/filters/filters.js +4 -14
- package/lib-esm/ui/filters/filters.stories.js +5 -4
- package/lib-esm/ui/filters/filters.utils.js +9 -15
- package/lib-esm/ui/filters/index.js +4 -10
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.js +0 -12
- package/lib-esm/ui/hover-card/hover-card.js +2 -12
- package/lib-esm/ui/hover-card/hover-card.stories.js +0 -3
- package/lib-esm/ui/icon/icon.js +0 -1
- package/lib-esm/ui/icon/icon.stories.js +0 -2
- package/lib-esm/ui/input/input.js +0 -1
- package/lib-esm/ui/loader/loader.js +0 -2
- package/lib-esm/ui/logo/logo.js +0 -11
- package/lib-esm/ui/logo/logo.stories.js +1 -5
- package/lib-esm/ui/panels/panels.js +2 -5
- package/lib-esm/ui/skeleton/skeleton.js +0 -1
- package/lib-esm/ui/sort-dropdown/sort-dropdown.js +0 -8
- package/lib-esm/ui/sort-dropdown/sort-dropdown.stories.js +1 -0
- package/lib-esm/ui/table/table.js +0 -2
- package/lib-esm/ui/tabs/tabs.js +0 -4
- package/lib-esm/ui/tabs/tabs.module.css +6 -2
- package/lib-esm/ui/tag/tag.js +0 -1
- package/lib-esm/ui/tooltip/tooltip.js +1 -2
- package/lib-esm/ui/tooltip/tooltip.stories.js +0 -2
- package/lib-esm/utils.js +2 -9
- package/package.json +15 -15
- package/src/components/duplicate-packages-warning/duplicate-packages-warning.module.css +1 -0
- package/src/components/summary/summary.module.css +4 -1
- package/src/css/default.css +3 -1
- package/src/css/variables.css +56 -56
- package/src/ui/tabs/tabs.module.css +6 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React, { useCallback } from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import cx from 'classnames';
|
|
@@ -10,7 +9,6 @@ import { Stack } from '../../layout/stack';
|
|
|
10
9
|
import { Metric } from '../metric';
|
|
11
10
|
import { Delta } from '../delta';
|
|
12
11
|
import css from './summary-item.module.css';
|
|
13
|
-
|
|
14
12
|
const MetricInfo = _ref => {
|
|
15
13
|
let {
|
|
16
14
|
description,
|
|
@@ -31,7 +29,6 @@ const MetricInfo = _ref => {
|
|
|
31
29
|
className: css.readMoreLink
|
|
32
30
|
}, "Read more")));
|
|
33
31
|
};
|
|
34
|
-
|
|
35
32
|
MetricInfo.propTypes = {
|
|
36
33
|
description: PropTypes.string.isRequired,
|
|
37
34
|
url: PropTypes.string
|
|
@@ -104,26 +101,20 @@ SummaryItem.defaultProps = {
|
|
|
104
101
|
SummaryItem.propTypes = {
|
|
105
102
|
/** Adopted child class name */
|
|
106
103
|
className: PropTypes.string,
|
|
107
|
-
|
|
108
104
|
/** Custom component */
|
|
109
105
|
as: PropTypes.elementType,
|
|
110
|
-
|
|
111
106
|
/** Size modifier */
|
|
112
107
|
size: PropTypes.oneOf(['medium', 'large']),
|
|
113
|
-
|
|
114
108
|
/** Metric id */
|
|
115
109
|
id: PropTypes.string.isRequired,
|
|
116
|
-
|
|
117
110
|
/** Loading flag */
|
|
118
111
|
loading: PropTypes.bool,
|
|
119
|
-
|
|
120
112
|
/** Summary data */
|
|
121
113
|
data: PropTypes.object,
|
|
122
114
|
// eslint-disable-line react/forbid-prop-types
|
|
123
115
|
|
|
124
116
|
/** Show description */
|
|
125
117
|
showMetricDescription: PropTypes.bool,
|
|
126
|
-
|
|
127
118
|
/** Show delta */
|
|
128
119
|
showDelta: PropTypes.bool
|
|
129
120
|
};
|
package/lib-esm/constants.js
CHANGED
|
@@ -22,7 +22,8 @@ export const SECTION_URLS = {
|
|
|
22
22
|
[SECTIONS.MODULES]: URLS.MODULES,
|
|
23
23
|
[SECTIONS.PACKAGES]: URLS.PACKAGES
|
|
24
24
|
};
|
|
25
|
-
export const ASSETS_SIZES_FILE_TYPE_MAP = FILE_TYPES.reduce((agg, fileType) => ({
|
|
25
|
+
export const ASSETS_SIZES_FILE_TYPE_MAP = FILE_TYPES.reduce((agg, fileType) => ({
|
|
26
|
+
...agg,
|
|
26
27
|
[`webpack.sizes.totalSizeByType${fileType}`]: fileType
|
|
27
28
|
}), {});
|
|
28
29
|
export const METRICS_WEBPACK_GENERAL = ['webpack.totalSizeByTypeALL', 'webpack.totalInitialSizeJS', 'webpack.totalInitialSizeCSS', 'webpack.cacheInvalidation'];
|
package/lib-esm/css/default.css
CHANGED
|
@@ -23,42 +23,42 @@
|
|
|
23
23
|
--size-xxlarge: 1.424rem;
|
|
24
24
|
--size-xxxlarge: 1.602rem;
|
|
25
25
|
|
|
26
|
-
--line-height: 1.
|
|
26
|
+
--line-height: 1.66em;
|
|
27
27
|
|
|
28
28
|
/*
|
|
29
29
|
* Color scheme:
|
|
30
|
-
* https://coolors.co/
|
|
31
|
-
* http://mcg.mbitson.com/#!?mcgpalette0=%
|
|
30
|
+
* https://coolors.co/287acc-da444e-55b950-f6e179-192339
|
|
31
|
+
* http://mcg.mbitson.com/#!?mcgpalette0=%23da444e&mcgpalette1=%2355b950&mcgpalette2=%23f6e179&mcgpalette3=%23505861&mcgpalette4=%23287acc&themename=mcgtheme
|
|
32
32
|
*/
|
|
33
|
-
--color-gray-25: #
|
|
34
|
-
--color-gray-50: #
|
|
35
|
-
--color-gray-100: #
|
|
36
|
-
--color-gray-200: #
|
|
37
|
-
--color-gray-300: #
|
|
38
|
-
--color-gray-400: #
|
|
39
|
-
--color-gray-500: #
|
|
40
|
-
--color-gray-600: #
|
|
41
|
-
--color-gray-700: #
|
|
42
|
-
--color-gray-800: #
|
|
43
|
-
--color-gray-900: #
|
|
33
|
+
--color-gray-25: #F7F7F7;
|
|
34
|
+
--color-gray-50 : #eaebec;
|
|
35
|
+
--color-gray-100: #cbcdd0;
|
|
36
|
+
--color-gray-200: #a8acb0;
|
|
37
|
+
--color-gray-300: #858a90;
|
|
38
|
+
--color-gray-400: #6a7179;
|
|
39
|
+
--color-gray-500: #505861;
|
|
40
|
+
--color-gray-600: #495059;
|
|
41
|
+
--color-gray-700: #40474f;
|
|
42
|
+
--color-gray-800: #373d45;
|
|
43
|
+
--color-gray-900: #272d33;
|
|
44
44
|
|
|
45
45
|
--color-gray-ultra-light: var(--color-gray-200);
|
|
46
46
|
--color-gray-light: var(--color-gray-300);
|
|
47
47
|
--color-gray: var(--color-gray-500);
|
|
48
|
-
--color-gray-dark: var(--color-gray-
|
|
49
|
-
--color-gray-ultra-dark: var(--color-gray-
|
|
48
|
+
--color-gray-dark: var(--color-gray-700);
|
|
49
|
+
--color-gray-ultra-dark: var(--color-gray-900);
|
|
50
50
|
|
|
51
51
|
--color-red-25: #fdf5f6;
|
|
52
|
-
--color-red-50: #
|
|
53
|
-
--color-red-100: #
|
|
54
|
-
--color-red-200: #
|
|
55
|
-
--color-red-300: #
|
|
56
|
-
--color-red-400: #
|
|
57
|
-
--color-red-500: #
|
|
58
|
-
--color-red-600: #
|
|
59
|
-
--color-red-700: #
|
|
60
|
-
--color-red-800: #
|
|
61
|
-
--color-red-900: #
|
|
52
|
+
--color-red-50: #fbe9ea;
|
|
53
|
+
--color-red-100: #f4c7ca;
|
|
54
|
+
--color-red-200: #eda2a7;
|
|
55
|
+
--color-red-300: #e57c83;
|
|
56
|
+
--color-red-400: #e06069;
|
|
57
|
+
--color-red-500: #da444e;
|
|
58
|
+
--color-red-600: #d63e47;
|
|
59
|
+
--color-red-700: #d0353d;
|
|
60
|
+
--color-red-800: #cb2d35;
|
|
61
|
+
--color-red-900: #c21f25;
|
|
62
62
|
--color-red-ultra-light: var(--color-red-100);
|
|
63
63
|
--color-red-light: var(--color-red-300);
|
|
64
64
|
--color-red: var(--color-red-500);
|
|
@@ -66,16 +66,16 @@
|
|
|
66
66
|
--color-red-ultra-dark: var(--color-red-900);
|
|
67
67
|
|
|
68
68
|
--color-blue-25: #f3f8fd;
|
|
69
|
-
--color-blue-50: #
|
|
70
|
-
--color-blue-100: #
|
|
71
|
-
--color-blue-200: #
|
|
72
|
-
--color-blue-300: #
|
|
73
|
-
--color-blue-400: #
|
|
74
|
-
--color-blue-500: #
|
|
75
|
-
--color-blue-600: #
|
|
76
|
-
--color-blue-700: #
|
|
77
|
-
--color-blue-800: #
|
|
78
|
-
--color-blue-900: #
|
|
69
|
+
--color-blue-50: #e5eff9;
|
|
70
|
+
--color-blue-100: #bfd7f0;
|
|
71
|
+
--color-blue-200: #94bde6;
|
|
72
|
+
--color-blue-300: #69a2db;
|
|
73
|
+
--color-blue-400: #488ed4;
|
|
74
|
+
--color-blue-500: #287acc;
|
|
75
|
+
--color-blue-600: #2472c7;
|
|
76
|
+
--color-blue-700: #1e67c0;
|
|
77
|
+
--color-blue-800: #185db9;
|
|
78
|
+
--color-blue-900: #0f4aad;
|
|
79
79
|
|
|
80
80
|
--color-blue-ultra-light: var(--color-blue-100);
|
|
81
81
|
--color-blue-light: var(--color-blue-300);
|
|
@@ -84,16 +84,16 @@
|
|
|
84
84
|
--color-blue-ultra-dark: var(--color-blue-900);
|
|
85
85
|
|
|
86
86
|
--color-green-25: #f6fbf6;
|
|
87
|
-
--color-green-50: #
|
|
88
|
-
--color-green-100: #
|
|
89
|
-
--color-green-200: #
|
|
90
|
-
--color-green-300: #
|
|
91
|
-
--color-green-400: #
|
|
92
|
-
--color-green-500: #
|
|
93
|
-
--color-green-600: #
|
|
94
|
-
--color-green-700: #
|
|
95
|
-
--color-green-800: #
|
|
96
|
-
--color-green-900: #
|
|
87
|
+
--color-green-50: #ebf7ea;
|
|
88
|
+
--color-green-100: #cceacb;
|
|
89
|
+
--color-green-200: #aadca8;
|
|
90
|
+
--color-green-300: #88ce85;
|
|
91
|
+
--color-green-400: #6fc46a;
|
|
92
|
+
--color-green-500: #55b950;
|
|
93
|
+
--color-green-600: #4eb249;
|
|
94
|
+
--color-green-700: #44aa40;
|
|
95
|
+
--color-green-800: #3ba237;
|
|
96
|
+
--color-green-900: #2a9327;
|
|
97
97
|
|
|
98
98
|
--color-green-ultra-light: var(--color-green-100);
|
|
99
99
|
--color-green-light: var(--color-green-300);
|
|
@@ -102,16 +102,16 @@
|
|
|
102
102
|
--color-green-ultra-dark: var(--color-green-900);
|
|
103
103
|
|
|
104
104
|
--color-yellow-25: #FFFDF2;
|
|
105
|
-
--color-yellow-50: #
|
|
106
|
-
--color-yellow-100: #
|
|
107
|
-
--color-yellow-200: #
|
|
108
|
-
--color-yellow-300: #
|
|
109
|
-
--color-yellow-400: #
|
|
110
|
-
--color-yellow-500: #
|
|
111
|
-
--color-yellow-600: #
|
|
112
|
-
--color-yellow-700: #
|
|
113
|
-
--color-yellow-800: #
|
|
114
|
-
--color-yellow-900: #
|
|
105
|
+
--color-yellow-50: #fefbef;
|
|
106
|
+
--color-yellow-100: #fcf6d7;
|
|
107
|
+
--color-yellow-200: #fbf0bc;
|
|
108
|
+
--color-yellow-300: #f9eaa1;
|
|
109
|
+
--color-yellow-400: #f7e68d;
|
|
110
|
+
--color-yellow-500: #f6e179;
|
|
111
|
+
--color-yellow-600: #f5dd71;
|
|
112
|
+
--color-yellow-700: #f3d966;
|
|
113
|
+
--color-yellow-800: #f2d55c;
|
|
114
|
+
--color-yellow-900: #efcd49;
|
|
115
115
|
|
|
116
116
|
--color-yellow-light-background: var(--color-yellow-25);
|
|
117
117
|
--color-yellow-ultra-light: var(--color-yellow-100);
|
|
@@ -8,14 +8,11 @@ const ACTION_RESET_ALL = 'RESET_ALL';
|
|
|
8
8
|
const ACTION_SET = 'SET';
|
|
9
9
|
const SEARCH_DEFAULT = '';
|
|
10
10
|
const SEARCH_DEFAULT_PATTERN = /.*/;
|
|
11
|
-
|
|
12
11
|
const getSearchPattern = search => {
|
|
13
12
|
let searchPattern = SEARCH_DEFAULT_PATTERN;
|
|
14
|
-
|
|
15
13
|
if (!search || !search.trim()) {
|
|
16
14
|
return searchPattern;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
try {
|
|
20
17
|
searchPattern = new RegExp(search, 'i');
|
|
21
18
|
} catch (err) {
|
|
@@ -25,7 +22,6 @@ const getSearchPattern = search => {
|
|
|
25
22
|
|
|
26
23
|
return searchPattern;
|
|
27
24
|
};
|
|
28
|
-
|
|
29
25
|
const getSearchReducer = _ref => {
|
|
30
26
|
let {
|
|
31
27
|
defaultFilters,
|
|
@@ -37,7 +33,6 @@ const getSearchReducer = _ref => {
|
|
|
37
33
|
type,
|
|
38
34
|
payload
|
|
39
35
|
} = action;
|
|
40
|
-
|
|
41
36
|
switch (type) {
|
|
42
37
|
case ACTION_SET_FILTERS:
|
|
43
38
|
{
|
|
@@ -48,7 +43,6 @@ const getSearchReducer = _ref => {
|
|
|
48
43
|
setParentState(newState);
|
|
49
44
|
return newState;
|
|
50
45
|
}
|
|
51
|
-
|
|
52
46
|
case ACTION_SET_SEARCH:
|
|
53
47
|
{
|
|
54
48
|
const newState = {
|
|
@@ -56,11 +50,11 @@ const getSearchReducer = _ref => {
|
|
|
56
50
|
search: payload
|
|
57
51
|
};
|
|
58
52
|
setParentState(newState);
|
|
59
|
-
return {
|
|
53
|
+
return {
|
|
54
|
+
...newState,
|
|
60
55
|
searchPattern: getSearchPattern(payload)
|
|
61
56
|
};
|
|
62
57
|
}
|
|
63
|
-
|
|
64
58
|
case ACTION_RESET_DEFAULT:
|
|
65
59
|
{
|
|
66
60
|
const newState = {
|
|
@@ -68,11 +62,11 @@ const getSearchReducer = _ref => {
|
|
|
68
62
|
search: SEARCH_DEFAULT
|
|
69
63
|
};
|
|
70
64
|
setParentState(newState);
|
|
71
|
-
return {
|
|
65
|
+
return {
|
|
66
|
+
...newState,
|
|
72
67
|
searchPattern: getSearchPattern()
|
|
73
68
|
};
|
|
74
69
|
}
|
|
75
|
-
|
|
76
70
|
case ACTION_RESET_ALL:
|
|
77
71
|
{
|
|
78
72
|
const newState = {
|
|
@@ -80,22 +74,20 @@ const getSearchReducer = _ref => {
|
|
|
80
74
|
search: SEARCH_DEFAULT
|
|
81
75
|
};
|
|
82
76
|
setParentState(newState);
|
|
83
|
-
return {
|
|
77
|
+
return {
|
|
78
|
+
...newState,
|
|
84
79
|
searchPattern: getSearchPattern()
|
|
85
80
|
};
|
|
86
81
|
}
|
|
87
|
-
|
|
88
82
|
case ACTION_SET:
|
|
89
83
|
{
|
|
90
84
|
return payload;
|
|
91
85
|
}
|
|
92
|
-
|
|
93
86
|
default:
|
|
94
87
|
return state;
|
|
95
88
|
}
|
|
96
89
|
};
|
|
97
90
|
};
|
|
98
|
-
|
|
99
91
|
export const generateState = (filters, search) => ({
|
|
100
92
|
filters,
|
|
101
93
|
search,
|
|
@@ -119,21 +111,21 @@ export const useSearchParams = _ref2 => {
|
|
|
119
111
|
defaultFilters,
|
|
120
112
|
allEntriesFilters,
|
|
121
113
|
setParentState
|
|
122
|
-
}), generateState(initialFilters, parentSearch));
|
|
114
|
+
}), generateState(initialFilters, parentSearch));
|
|
123
115
|
|
|
116
|
+
// Update state when the custom filters/search are changing - initial load or route updates
|
|
124
117
|
useLayoutEffect(() => {
|
|
125
118
|
// Run a deep comparison to prevent circular setState triggering
|
|
126
119
|
if (parentSearch === search && _isEqual(initialFilters, filters)) {
|
|
127
120
|
return;
|
|
128
121
|
}
|
|
129
|
-
|
|
130
122
|
dispatch({
|
|
131
123
|
type: ACTION_SET,
|
|
132
124
|
payload: generateState(initialFilters, parentSearch)
|
|
133
125
|
});
|
|
134
126
|
}, [dispatch, search, filters, parentSearch, initialFilters]);
|
|
135
|
-
/** Callbacks */
|
|
136
127
|
|
|
128
|
+
/** Callbacks */
|
|
137
129
|
const handleUpdateSearch = useCallback(newValue => {
|
|
138
130
|
dispatch({
|
|
139
131
|
type: ACTION_SET_SEARCH,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import cx from 'classnames';
|
|
@@ -32,19 +31,14 @@ Box.defaultProps = {
|
|
|
32
31
|
Box.propTypes = {
|
|
33
32
|
/** Adopted child class name */
|
|
34
33
|
className: PropTypes.string,
|
|
35
|
-
|
|
36
34
|
/** Rendered component */
|
|
37
35
|
as: PropTypes.elementType,
|
|
38
|
-
|
|
39
36
|
/** Padding space size */
|
|
40
37
|
padding: PropTypes.oneOfType([PropTypes.oneOf(SPACES), PropTypes.arrayOf(PropTypes.oneOf(SPACES))]),
|
|
41
|
-
|
|
42
38
|
/** Horizonatl padding space size */
|
|
43
39
|
horizontalPadding: PropTypes.oneOf(SPACES),
|
|
44
|
-
|
|
45
40
|
/** Vertical padding space size */
|
|
46
41
|
verticalPadding: PropTypes.oneOf(SPACES),
|
|
47
|
-
|
|
48
42
|
/** Outline flag */
|
|
49
43
|
outline: PropTypes.bool
|
|
50
44
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import cx from 'classnames';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import cx from 'classnames';
|
|
@@ -8,15 +7,14 @@ import { Container } from '../../ui/container';
|
|
|
8
7
|
import { Box } from '../box';
|
|
9
8
|
import { Stack } from '../stack';
|
|
10
9
|
import css from './footer.module.css';
|
|
11
|
-
/* eslint-disable jsx-a11y/anchor-has-content */
|
|
12
10
|
|
|
11
|
+
/* eslint-disable jsx-a11y/anchor-has-content */
|
|
13
12
|
const ExternalLink = props => /*#__PURE__*/React.createElement("a", _extends({
|
|
14
13
|
target: "_blank",
|
|
15
14
|
rel: "noopener noreferrer"
|
|
16
15
|
}, props));
|
|
17
16
|
/* eslint-enable jsx-a11y/anchor-has-content */
|
|
18
17
|
|
|
19
|
-
|
|
20
18
|
ExternalLink.propTypes = {
|
|
21
19
|
/** Link to value */
|
|
22
20
|
to: PropTypes.string.isRequired
|
|
@@ -61,7 +59,6 @@ Footer.defaultProps = {
|
|
|
61
59
|
Footer.propTypes = {
|
|
62
60
|
/** Adopted child class name */
|
|
63
61
|
className: PropTypes.string,
|
|
64
|
-
|
|
65
62
|
/** Content */
|
|
66
63
|
version: PropTypes.string
|
|
67
64
|
};
|
|
@@ -28,13 +28,10 @@ Header.defaultProps = {
|
|
|
28
28
|
Header.propTypes = {
|
|
29
29
|
/* Adopted child class name */
|
|
30
30
|
className: PropTypes.string,
|
|
31
|
-
|
|
32
31
|
/* Render left area */
|
|
33
32
|
renderLeft: PropTypes.func,
|
|
34
|
-
|
|
35
33
|
/* Render center area */
|
|
36
34
|
render: PropTypes.func,
|
|
37
|
-
|
|
38
35
|
/* Render right area */
|
|
39
36
|
renderRight: PropTypes.func
|
|
40
37
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import cx from 'classnames';
|
|
@@ -10,11 +9,11 @@ const propTypes = {
|
|
|
10
9
|
const defaultProps = {
|
|
11
10
|
className: ''
|
|
12
11
|
};
|
|
12
|
+
|
|
13
13
|
/**
|
|
14
14
|
* @param {PropTypes.InferProps<typeof propTypes>} props
|
|
15
15
|
* @return {React.FunctionComponentElement}
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
17
|
export const Separator = props => {
|
|
19
18
|
const {
|
|
20
19
|
className,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import cx from 'classnames';
|
|
@@ -3,6 +3,7 @@ import { storiesOf } from '@storybook/react';
|
|
|
3
3
|
import { Container, Logo } from '../ui';
|
|
4
4
|
import { getWrapperDecorator } from '../stories';
|
|
5
5
|
import { Header, SubHeader } from '../layout';
|
|
6
|
+
import CHART_COLORS from '../chart-colors.json';
|
|
6
7
|
import content from './typography.md';
|
|
7
8
|
import css from './typography.module.css';
|
|
8
9
|
const stories = storiesOf('Prototypes/Styleguide', module);
|
|
@@ -24,8 +25,9 @@ stories.add('typography', () => /*#__PURE__*/React.createElement(React.Fragment,
|
|
|
24
25
|
dangerouslySetInnerHTML: {
|
|
25
26
|
__html: content
|
|
26
27
|
}
|
|
27
|
-
}))));
|
|
28
|
+
}))));
|
|
28
29
|
|
|
30
|
+
// eslint-disable-next-line react/prop-types
|
|
29
31
|
const Item = _ref => {
|
|
30
32
|
let {
|
|
31
33
|
colorName,
|
|
@@ -42,6 +44,20 @@ const Item = _ref => {
|
|
|
42
44
|
}, `${colorName} ${valueName}`);
|
|
43
45
|
};
|
|
44
46
|
|
|
47
|
+
// eslint-disable-next-line react/prop-types
|
|
48
|
+
const ItemColorValue = _ref2 => {
|
|
49
|
+
let {
|
|
50
|
+
value
|
|
51
|
+
} = _ref2;
|
|
52
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
53
|
+
style: {
|
|
54
|
+
background: value,
|
|
55
|
+
color: 'var(--color-light)',
|
|
56
|
+
padding: '12px',
|
|
57
|
+
flex: '1 1 20%'
|
|
58
|
+
}
|
|
59
|
+
}, value);
|
|
60
|
+
};
|
|
45
61
|
const COLORS = ['blue', 'red', 'green', 'yellow', 'gray'];
|
|
46
62
|
const NAMES = ['ultra-light', 'light', 'normal', 'dark', 'ultra-dark'];
|
|
47
63
|
stories.add('color sheme', () => /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Item, {
|
|
@@ -63,4 +79,13 @@ stories.add('color sheme', () => /*#__PURE__*/React.createElement(Container, nul
|
|
|
63
79
|
key: `${colorName}-${valueName}`,
|
|
64
80
|
colorName: colorName,
|
|
65
81
|
valueName: valueName
|
|
66
|
-
}))))))
|
|
82
|
+
})))), /*#__PURE__*/React.createElement("hr", null), /*#__PURE__*/React.createElement("h3", null, "Chart colors"), /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
style: {
|
|
84
|
+
display: 'flex',
|
|
85
|
+
marginBottom: '24px',
|
|
86
|
+
flexWrap: 'wrap'
|
|
87
|
+
}
|
|
88
|
+
}, CHART_COLORS.map(color => /*#__PURE__*/React.createElement(ItemColorValue, {
|
|
89
|
+
key: color,
|
|
90
|
+
value: color
|
|
91
|
+
})))));
|
package/lib-esm/query-state.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _merge from "lodash/merge";
|
|
2
2
|
import _isEqual from "lodash/isEqual";
|
|
3
|
-
|
|
4
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
-
|
|
6
4
|
import React, { useCallback } from 'react';
|
|
7
5
|
import { JsonParam, QueryParamProvider, useQueryParams } from 'use-query-params';
|
|
8
6
|
import { ReactRouter5Adapter } from 'use-query-params/adapters/react-router-5';
|
|
@@ -20,13 +18,12 @@ export const useComponentQueryState = componentName => {
|
|
|
20
18
|
});
|
|
21
19
|
const state = search[componentName];
|
|
22
20
|
const setState = useCallback(newState => {
|
|
23
|
-
const newComponentState = _merge({}, state, newState);
|
|
24
|
-
|
|
21
|
+
const newComponentState = _merge({}, state, newState);
|
|
25
22
|
|
|
23
|
+
// Deep check to prevent unnecessary state changes
|
|
26
24
|
if (_isEqual(newComponentState, state)) {
|
|
27
25
|
return;
|
|
28
26
|
}
|
|
29
|
-
|
|
30
27
|
setSearch({
|
|
31
28
|
[componentName]: newComponentState
|
|
32
29
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import cx from 'classnames';
|
|
@@ -23,7 +22,6 @@ Container.defaultProps = {
|
|
|
23
22
|
Container.propTypes = {
|
|
24
23
|
/** Adopted child class name */
|
|
25
24
|
className: PropTypes.string,
|
|
26
|
-
|
|
27
25
|
/** Custom component */
|
|
28
26
|
as: PropTypes.elementType
|
|
29
27
|
};
|
|
@@ -51,19 +51,14 @@ Dropdown.defaultProps = {
|
|
|
51
51
|
Dropdown.propTypes = {
|
|
52
52
|
/** Adopted child class name */
|
|
53
53
|
className: PropTypes.string,
|
|
54
|
-
|
|
55
54
|
/** Button adopted child class name */
|
|
56
55
|
buttonClassName: PropTypes.string,
|
|
57
|
-
|
|
58
56
|
/** Button label */
|
|
59
57
|
label: PropTypes.node,
|
|
60
|
-
|
|
61
58
|
/** Aria label */
|
|
62
59
|
ariaLabel: PropTypes.string,
|
|
63
|
-
|
|
64
60
|
/** Icon glyph */
|
|
65
61
|
glyph: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
66
|
-
|
|
67
62
|
/** Content */
|
|
68
63
|
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]).isRequired
|
|
69
64
|
};
|