@bundle-stats/ui 3.2.0-beta.1 → 3.2.1-beta.3
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/.babelrc.js +3 -3
- package/CHANGELOG.md +20 -4
- package/lib/assets/icons/arrow.svg +1 -0
- package/lib/assets/icons/cancel.svg +1 -0
- package/lib/assets/icons/clock.svg +1 -0
- package/lib/assets/icons/close.svg +1 -0
- package/lib/assets/icons/commit.svg +1 -0
- package/lib/assets/icons/filter.svg +1 -0
- package/lib/assets/icons/help.svg +1 -0
- package/lib/assets/icons/menu.svg +1 -0
- package/lib/{ui/icon/assets → assets/icons}/sort.svg +0 -0
- package/lib/assets/icons/warning.svg +1 -0
- package/lib/assets/icons.svg +1 -0
- package/lib/components/bundle-assets/bundle-assets.js +3 -3
- package/lib/components/bundle-assets/bundle-assets.stories.js +19 -7
- package/lib/components/bundle-assets/bundle-assets.utils.js +95 -28
- package/lib/components/bundle-assets/index.js +115 -4
- package/lib/components/bundle-modules/bundle-modules.js +3 -3
- package/lib/components/bundle-modules/bundle-modules.utils.js +152 -0
- package/lib/components/bundle-modules/index.js +135 -4
- package/lib/components/bundle-packages/bundle-packages.js +3 -3
- package/lib/components/bundle-packages/{bundle-packages.container.js → bundle-packages.utils.js} +8 -42
- package/lib/components/bundle-packages/index.js +111 -3
- package/lib/components/metrics-table/metrics-table.js +3 -7
- package/lib/components/metrics-table-search/metrics-table-search.js +2 -1
- package/lib/components/metrics-table-search/metrics-table-search.module.css +2 -1
- package/lib/hooks/rows-filter.js +28 -0
- package/lib/hooks/rows-sort.js +54 -0
- package/lib/{hocs/with-search.js → hooks/search-params.js} +15 -64
- package/lib/ui/icon/icon.js +4 -191
- package/lib/ui/sort-dropdown/sort-dropdown.js +12 -13
- package/lib/ui/sort-dropdown/sort-dropdown.stories.js +2 -2
- package/lib/utils.js +6 -3
- package/lib-esm/app/app.js +60 -70
- package/lib-esm/app/app.stories.js +50 -71
- package/lib-esm/app/header/header.js +5 -3
- package/lib-esm/assets/icons/arrow.svg +1 -0
- package/lib-esm/assets/icons/cancel.svg +1 -0
- package/lib-esm/assets/icons/clock.svg +1 -0
- package/lib-esm/assets/icons/close.svg +1 -0
- package/lib-esm/assets/icons/commit.svg +1 -0
- package/lib-esm/assets/icons/filter.svg +1 -0
- package/lib-esm/assets/icons/help.svg +1 -0
- package/lib-esm/assets/icons/menu.svg +1 -0
- package/lib-esm/{ui/icon/assets → assets/icons}/sort.svg +0 -0
- package/lib-esm/assets/icons/warning.svg +1 -0
- package/lib-esm/assets/icons.svg +1 -0
- package/lib-esm/components/asset-info/asset-info.js +21 -17
- package/lib-esm/components/asset-info/asset-info.stories.js +29 -33
- package/lib-esm/components/browsertime-table/browsertime-table.js +6 -4
- package/lib-esm/components/browsertime-table/browsertime-table.stories.js +9 -13
- package/lib-esm/components/bundle-assets/bundle-assets.constants.js +17 -15
- package/lib-esm/components/bundle-assets/bundle-assets.js +107 -97
- package/lib-esm/components/bundle-assets/bundle-assets.stories.js +58 -63
- package/lib-esm/components/bundle-assets/bundle-assets.utils.js +65 -21
- package/lib-esm/components/bundle-assets/index.js +89 -2
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +49 -51
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.stories.js +9 -13
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +14 -13
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +13 -19
- package/lib-esm/components/bundle-modules/bundle-modules.constants.js +17 -15
- package/lib-esm/components/bundle-modules/bundle-modules.js +112 -110
- package/lib-esm/components/bundle-modules/bundle-modules.stories.js +46 -58
- package/lib-esm/components/bundle-modules/bundle-modules.utils.js +98 -0
- package/lib-esm/components/bundle-modules/index.js +114 -3
- package/lib-esm/components/bundle-packages/bundle-packages.constants.js +17 -15
- package/lib-esm/components/bundle-packages/bundle-packages.js +71 -69
- package/lib-esm/components/bundle-packages/bundle-packages.stories.js +34 -46
- package/lib-esm/components/bundle-packages/bundle-packages.utils.js +44 -0
- package/lib-esm/components/bundle-packages/index.js +87 -2
- package/lib-esm/components/component-link.js +10 -13
- package/lib-esm/components/delta/delta.js +8 -6
- package/lib-esm/components/delta/delta.stories.js +26 -38
- package/lib-esm/components/duplicate-packages-warning/duplicate-packages-warning.js +11 -9
- package/lib-esm/components/duplicate-packages-warning/duplicate-packages-warning.stories.js +20 -26
- package/lib-esm/components/job-header/job-header.js +14 -11
- package/lib-esm/components/job-header/job-header.stories.js +12 -18
- package/lib-esm/components/job-meta/job-meta.js +15 -18
- package/lib-esm/components/job-meta/job-meta.stories.js +10 -12
- package/lib-esm/components/job-name/job-name.js +9 -12
- package/lib-esm/components/job-name/job-name.stories.js +15 -23
- package/lib-esm/components/jobs-header/jobs-header.js +12 -12
- package/lib-esm/components/jobs-header/jobs-header.stories.js +80 -86
- package/lib-esm/components/lighthouse-table/lighthouse-table.js +6 -4
- package/lib-esm/components/lighthouse-table/lighthouse-table.stories.js +10 -14
- package/lib-esm/components/metric/metric.js +15 -19
- package/lib-esm/components/metric/metric.stories.js +36 -58
- package/lib-esm/components/metrics-table/metrics-table.js +128 -139
- package/lib-esm/components/metrics-table/metrics-table.stories.js +27 -35
- package/lib-esm/components/metrics-table-options/metrics-table-options.js +16 -19
- package/lib-esm/components/metrics-table-options/metrics-table-options.stories.js +6 -12
- package/lib-esm/components/metrics-table-search/metrics-table-search.js +17 -18
- package/lib-esm/components/metrics-table-search/metrics-table-search.module.css +2 -1
- package/lib-esm/components/metrics-table-search/metrics-table-search.stories.js +4 -9
- package/lib-esm/components/metrics-table-title/metrics-table-title.js +9 -7
- package/lib-esm/components/module-info/module-info.js +15 -13
- package/lib-esm/components/module-info/module-info.stories.js +20 -22
- package/lib-esm/components/summary/summary.js +25 -27
- package/lib-esm/components/summary/summary.stories.js +31 -46
- package/lib-esm/components/summary-item/summary-item.js +27 -28
- package/lib-esm/components/summary-item/summary-item.stories.js +40 -50
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +4 -2
- package/lib-esm/constants.js +25 -30
- package/lib-esm/hooks/rows-filter.js +20 -0
- package/lib-esm/hooks/rows-sort.js +22 -0
- package/lib-esm/hooks/search-params.js +170 -0
- package/lib-esm/layout/box/box.js +12 -19
- package/lib-esm/layout/box/box.stories.js +34 -46
- package/lib-esm/layout/flex-stack/flex-stack.js +9 -12
- package/lib-esm/layout/flex-stack/flex-stack.stories.js +39 -49
- package/lib-esm/layout/footer/footer.js +11 -11
- package/lib-esm/layout/footer/footer.stories.js +7 -11
- package/lib-esm/layout/header/header.js +10 -14
- package/lib-esm/layout/header/header.stories.js +50 -44
- package/lib-esm/layout/stack/stack.js +8 -6
- package/lib-esm/layout/stack/stack.stories.js +39 -49
- package/lib-esm/layout/sub-header/sub-header.js +14 -12
- package/lib-esm/layout/sub-header/sub-header.stories.js +57 -69
- package/lib-esm/prototypes/typography.stories.js +49 -58
- package/lib-esm/query-state.js +13 -16
- package/lib-esm/stories/wrapper.js +6 -12
- package/lib-esm/ui/alert/alert.js +6 -4
- package/lib-esm/ui/alert/alert.stories.js +14 -24
- package/lib-esm/ui/container/container.js +6 -9
- package/lib-esm/ui/container/container.stories.js +15 -17
- package/lib-esm/ui/dropdown/dropdown.js +13 -11
- package/lib-esm/ui/dropdown/dropdown.stories.js +22 -26
- package/lib-esm/ui/empty-set/empty-set.js +12 -12
- package/lib-esm/ui/empty-set/empty-set.stories.js +11 -19
- package/lib-esm/ui/file-name/file-name.js +6 -4
- package/lib-esm/ui/file-name/file-name.stories.js +12 -16
- package/lib-esm/ui/filters/filters.container.js +57 -76
- package/lib-esm/ui/filters/filters.js +71 -77
- package/lib-esm/ui/filters/filters.stories.js +82 -100
- package/lib-esm/ui/filters/filters.utils.js +26 -24
- package/lib-esm/ui/filters/index.js +1 -1
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.js +68 -78
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.stories.js +67 -77
- package/lib-esm/ui/icon/icon.js +13 -202
- package/lib-esm/ui/icon/icon.stories.js +16 -24
- package/lib-esm/ui/input/input.js +7 -10
- package/lib-esm/ui/input/input.stories.js +8 -12
- package/lib-esm/ui/loader/loader.js +6 -9
- package/lib-esm/ui/loader/loader.stories.js +5 -9
- package/lib-esm/ui/logo/logo.constants.js +6 -6
- package/lib-esm/ui/logo/logo.js +15 -15
- package/lib-esm/ui/logo/logo.stories.js +14 -22
- package/lib-esm/ui/panels/panels.js +13 -23
- package/lib-esm/ui/panels/panels.stories.js +14 -16
- package/lib-esm/ui/popover/popover.js +11 -9
- package/lib-esm/ui/popover/popover.stories.js +7 -11
- package/lib-esm/ui/skeleton/skeleton.js +6 -9
- package/lib-esm/ui/skeleton/skeleton.stories.js +2 -4
- package/lib-esm/ui/sort-dropdown/sort-dropdown.js +38 -38
- package/lib-esm/ui/sort-dropdown/sort-dropdown.stories.js +14 -16
- package/lib-esm/ui/table/table.js +26 -31
- package/lib-esm/ui/table/table.stories.js +84 -102
- package/lib-esm/ui/tabs/tabs.js +13 -21
- package/lib-esm/ui/tabs/tabs.stories.js +4 -6
- package/lib-esm/ui/toolbar/toolbar.js +7 -5
- package/lib-esm/ui/toolbar/toolbar.stories.js +14 -16
- package/lib-esm/ui/tooltip/tooltip.js +13 -16
- package/lib-esm/ui/tooltip/tooltip.stories.js +8 -12
- package/lib-esm/utils.js +20 -24
- package/package.json +25 -33
- package/src/assets/icons/arrow.svg +1 -0
- package/src/assets/icons/cancel.svg +1 -0
- package/src/assets/icons/clock.svg +1 -0
- package/src/assets/icons/close.svg +1 -0
- package/src/assets/icons/commit.svg +1 -0
- package/src/assets/icons/filter.svg +1 -0
- package/src/assets/icons/help.svg +1 -0
- package/src/assets/icons/menu.svg +1 -0
- package/src/{ui/icon/assets → assets/icons}/sort.svg +0 -0
- package/src/assets/icons/warning.svg +1 -0
- package/src/assets/icons.svg +1 -0
- package/src/components/bundle-assets/bundle-assets.jsx +3 -3
- package/src/components/bundle-assets/bundle-assets.utils.js +96 -17
- package/src/components/bundle-assets/index.jsx +89 -0
- package/src/components/bundle-modules/bundle-modules.jsx +3 -3
- package/src/components/bundle-modules/bundle-modules.utils.js +101 -0
- package/src/components/bundle-modules/index.jsx +107 -0
- package/src/components/bundle-packages/bundle-packages.jsx +3 -3
- package/src/components/bundle-packages/bundle-packages.utils.js +47 -0
- package/src/components/bundle-packages/index.jsx +84 -0
- package/src/components/metrics-table/metrics-table.jsx +2 -7
- package/src/components/metrics-table-search/metrics-table-search.jsx +1 -0
- package/src/components/metrics-table-search/metrics-table-search.module.css +2 -1
- package/src/hooks/rows-filter.js +16 -0
- package/src/hooks/rows-sort.js +24 -0
- package/src/hooks/search-params.js +153 -0
- package/src/ui/icon/icon.jsx +7 -42
- package/src/ui/sort-dropdown/sort-dropdown.jsx +11 -11
- package/src/utils.jsx +5 -3
- package/lib/components/bundle-assets/bundle-assets.container.js +0 -140
- package/lib/components/bundle-modules/bundle-modules.container.js +0 -222
- package/lib/hocs/with-custom-sort.js +0 -75
- package/lib/hocs/with-filtered-items.js +0 -54
- package/lib/ui/icon/assets/arrow.svg +0 -4
- package/lib/ui/icon/assets/branch.svg +0 -3
- package/lib/ui/icon/assets/cancel.svg +0 -4
- package/lib/ui/icon/assets/clock.svg +0 -3
- package/lib/ui/icon/assets/close.svg +0 -4
- package/lib/ui/icon/assets/commit.svg +0 -3
- package/lib/ui/icon/assets/filter.svg +0 -4
- package/lib/ui/icon/assets/help.svg +0 -4
- package/lib/ui/icon/assets/job.svg +0 -3
- package/lib/ui/icon/assets/menu.svg +0 -4
- package/lib/ui/icon/assets/package.svg +0 -3
- package/lib/ui/icon/assets/pull-request.svg +0 -3
- package/lib/ui/icon/assets/repository.svg +0 -3
- package/lib/ui/icon/assets/warning.svg +0 -4
- package/lib-esm/components/bundle-assets/bundle-assets.container.js +0 -119
- package/lib-esm/components/bundle-modules/bundle-modules.container.js +0 -175
- package/lib-esm/components/bundle-packages/bundle-packages.container.js +0 -91
- package/lib-esm/hocs/with-custom-sort.js +0 -43
- package/lib-esm/hocs/with-filtered-items.js +0 -35
- package/lib-esm/hocs/with-search.js +0 -214
- package/lib-esm/ui/icon/assets/arrow.svg +0 -4
- package/lib-esm/ui/icon/assets/branch.svg +0 -3
- package/lib-esm/ui/icon/assets/cancel.svg +0 -4
- package/lib-esm/ui/icon/assets/clock.svg +0 -3
- package/lib-esm/ui/icon/assets/close.svg +0 -4
- package/lib-esm/ui/icon/assets/commit.svg +0 -3
- package/lib-esm/ui/icon/assets/filter.svg +0 -4
- package/lib-esm/ui/icon/assets/help.svg +0 -4
- package/lib-esm/ui/icon/assets/job.svg +0 -3
- package/lib-esm/ui/icon/assets/menu.svg +0 -4
- package/lib-esm/ui/icon/assets/package.svg +0 -3
- package/lib-esm/ui/icon/assets/pull-request.svg +0 -3
- package/lib-esm/ui/icon/assets/repository.svg +0 -3
- package/lib-esm/ui/icon/assets/warning.svg +0 -4
- package/src/components/bundle-assets/bundle-assets.container.js +0 -146
- package/src/components/bundle-assets/index.js +0 -4
- package/src/components/bundle-modules/bundle-modules.container.js +0 -158
- package/src/components/bundle-modules/index.js +0 -4
- package/src/components/bundle-packages/bundle-packages.container.js +0 -93
- package/src/components/bundle-packages/index.js +0 -4
- package/src/hocs/with-custom-sort.jsx +0 -35
- package/src/hocs/with-filtered-items.jsx +0 -34
- package/src/hocs/with-search.jsx +0 -184
- package/src/ui/icon/assets/arrow.svg +0 -4
- package/src/ui/icon/assets/branch.svg +0 -3
- package/src/ui/icon/assets/cancel.svg +0 -4
- package/src/ui/icon/assets/clock.svg +0 -3
- package/src/ui/icon/assets/close.svg +0 -4
- package/src/ui/icon/assets/commit.svg +0 -3
- package/src/ui/icon/assets/filter.svg +0 -4
- package/src/ui/icon/assets/help.svg +0 -4
- package/src/ui/icon/assets/job.svg +0 -3
- package/src/ui/icon/assets/menu.svg +0 -4
- package/src/ui/icon/assets/package.svg +0 -3
- package/src/ui/icon/assets/pull-request.svg +0 -3
- package/src/ui/icon/assets/repository.svg +0 -3
- package/src/ui/icon/assets/warning.svg +0 -4
|
@@ -3,53 +3,43 @@ import { storiesOf } from '@storybook/react';
|
|
|
3
3
|
import { getWrapperDecorator } from '../../stories';
|
|
4
4
|
import { Box } from '../box';
|
|
5
5
|
import { Stack } from '.';
|
|
6
|
-
|
|
6
|
+
const stories = storiesOf('Layout/Stack', module);
|
|
7
7
|
stories.addDecorator(getWrapperDecorator());
|
|
8
|
-
stories.add('default',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
outline: true
|
|
47
|
-
}, "Lorem ipsum 3.1"), /*#__PURE__*/React.createElement(Box, {
|
|
48
|
-
outline: true
|
|
49
|
-
}, "Lorem ipsum 3.2")));
|
|
50
|
-
});
|
|
51
|
-
stories.add('single item', function () {
|
|
52
|
-
return /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Box, {
|
|
53
|
-
outline: true
|
|
54
|
-
}, "Lorem ipsum"));
|
|
55
|
-
});
|
|
8
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Box, {
|
|
9
|
+
outline: true
|
|
10
|
+
}, "Lorem ipsum 1"), /*#__PURE__*/React.createElement(Box, {
|
|
11
|
+
outline: true
|
|
12
|
+
}, "Lorem ipsum 2"), null, "Lorem ipsum 3"));
|
|
13
|
+
stories.add('with custom wrapper', () => /*#__PURE__*/React.createElement(Stack, {
|
|
14
|
+
as: "main",
|
|
15
|
+
className: "wrapper"
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
17
|
+
outline: true
|
|
18
|
+
}, "Lorem ipsum 1"), /*#__PURE__*/React.createElement(Box, {
|
|
19
|
+
outline: true
|
|
20
|
+
}, "Lorem ipsum 2")));
|
|
21
|
+
stories.add('with large space', () => /*#__PURE__*/React.createElement(Stack, {
|
|
22
|
+
space: "large"
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
24
|
+
outline: true
|
|
25
|
+
}, "Lorem ipsum 1"), /*#__PURE__*/React.createElement(Box, {
|
|
26
|
+
outline: true
|
|
27
|
+
}, "Lorem ipsum 2"), /*#__PURE__*/React.createElement(Box, {
|
|
28
|
+
outline: true
|
|
29
|
+
}, "Lorem ipsum 3")));
|
|
30
|
+
stories.add('with nested stack', () => /*#__PURE__*/React.createElement(Stack, {
|
|
31
|
+
space: "large"
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
33
|
+
outline: true
|
|
34
|
+
}, "Lorem ipsum 1"), /*#__PURE__*/React.createElement(Box, {
|
|
35
|
+
outline: true
|
|
36
|
+
}, "Lorem ipsum 2"), /*#__PURE__*/React.createElement(Stack, {
|
|
37
|
+
space: "small"
|
|
38
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
39
|
+
outline: true
|
|
40
|
+
}, "Lorem ipsum 3.1"), /*#__PURE__*/React.createElement(Box, {
|
|
41
|
+
outline: true
|
|
42
|
+
}, "Lorem ipsum 3.2"))));
|
|
43
|
+
stories.add('single item', () => /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Box, {
|
|
44
|
+
outline: true
|
|
45
|
+
}, "Lorem ipsum")));
|
|
@@ -4,18 +4,20 @@ import cx from 'classnames';
|
|
|
4
4
|
import { Container } from '../../ui/container';
|
|
5
5
|
import { Box } from '../box';
|
|
6
6
|
import css from './sub-header.module.css';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
const SIZE_SMALL = 'small';
|
|
8
|
+
const SIZE_DEFAULT = 'default';
|
|
9
|
+
const SIZES = [SIZE_SMALL, SIZE_DEFAULT];
|
|
10
|
+
export const SubHeader = props => {
|
|
11
|
+
const {
|
|
12
|
+
className,
|
|
13
|
+
size,
|
|
14
|
+
subtitle,
|
|
15
|
+
title,
|
|
16
|
+
icon,
|
|
17
|
+
children,
|
|
18
|
+
rightSide
|
|
19
|
+
} = props;
|
|
20
|
+
const rootClassName = cx(css.root, css[size], className);
|
|
19
21
|
return /*#__PURE__*/React.createElement(Box, {
|
|
20
22
|
padding: "small",
|
|
21
23
|
className: rootClassName
|
|
@@ -3,73 +3,61 @@ import { storiesOf } from '@storybook/react';
|
|
|
3
3
|
import { getWrapperDecorator } from '../../stories';
|
|
4
4
|
import { Logo } from '../../ui/logo';
|
|
5
5
|
import { SubHeader } from '.';
|
|
6
|
-
|
|
6
|
+
const stories = storiesOf('Layout/SubHeader', module);
|
|
7
7
|
stories.addDecorator(getWrapperDecorator());
|
|
8
|
-
stories.add('default',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
subtitle: "Tools",
|
|
65
|
-
icon: /*#__PURE__*/React.createElement(Logo, {
|
|
66
|
-
kind: "webpack",
|
|
67
|
-
style: {
|
|
68
|
-
width: '72px'
|
|
69
|
-
}
|
|
70
|
-
}),
|
|
71
|
-
rightSide: /*#__PURE__*/React.createElement("span", null, "Read more")
|
|
72
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
73
|
-
href: "#webpack"
|
|
74
|
-
}, "Visit webpack.js.org"));
|
|
75
|
-
});
|
|
8
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(SubHeader, {
|
|
9
|
+
title: "Webpack"
|
|
10
|
+
}));
|
|
11
|
+
stories.add('with subtitle', () => /*#__PURE__*/React.createElement(SubHeader, {
|
|
12
|
+
title: "Webpack",
|
|
13
|
+
subtitle: "Tools"
|
|
14
|
+
}));
|
|
15
|
+
stories.add('with icon', () => /*#__PURE__*/React.createElement(SubHeader, {
|
|
16
|
+
title: "Webpack",
|
|
17
|
+
subtitle: "Tools",
|
|
18
|
+
icon: /*#__PURE__*/React.createElement(Logo, {
|
|
19
|
+
kind: "webpack",
|
|
20
|
+
style: {
|
|
21
|
+
width: '48px'
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
}));
|
|
25
|
+
stories.add('with children', () => /*#__PURE__*/React.createElement(SubHeader, {
|
|
26
|
+
title: "Webpack",
|
|
27
|
+
subtitle: "Tools",
|
|
28
|
+
icon: /*#__PURE__*/React.createElement(Logo, {
|
|
29
|
+
kind: "webpack",
|
|
30
|
+
style: {
|
|
31
|
+
width: '72px'
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
35
|
+
href: "#webpack"
|
|
36
|
+
}, "Visit webpack.js.org")));
|
|
37
|
+
stories.add('with right side links', () => /*#__PURE__*/React.createElement(SubHeader, {
|
|
38
|
+
title: "Webpack",
|
|
39
|
+
subtitle: "Tools",
|
|
40
|
+
icon: /*#__PURE__*/React.createElement(Logo, {
|
|
41
|
+
kind: "webpack",
|
|
42
|
+
style: {
|
|
43
|
+
width: '72px'
|
|
44
|
+
}
|
|
45
|
+
}),
|
|
46
|
+
rightSide: /*#__PURE__*/React.createElement("span", null, "Read more")
|
|
47
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
48
|
+
href: "#webpack"
|
|
49
|
+
}, "Visit webpack.js.org")));
|
|
50
|
+
stories.add('with small size', () => /*#__PURE__*/React.createElement(SubHeader, {
|
|
51
|
+
size: "small",
|
|
52
|
+
title: "Webpack",
|
|
53
|
+
subtitle: "Tools",
|
|
54
|
+
icon: /*#__PURE__*/React.createElement(Logo, {
|
|
55
|
+
kind: "webpack",
|
|
56
|
+
style: {
|
|
57
|
+
width: '72px'
|
|
58
|
+
}
|
|
59
|
+
}),
|
|
60
|
+
rightSide: /*#__PURE__*/React.createElement("span", null, "Read more")
|
|
61
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
62
|
+
href: "#webpack"
|
|
63
|
+
}, "Visit webpack.js.org")));
|
|
@@ -5,71 +5,62 @@ import { getWrapperDecorator } from '../stories';
|
|
|
5
5
|
import { Header, SubHeader } from '../layout';
|
|
6
6
|
import content from './typography.md';
|
|
7
7
|
import css from './typography.module.css';
|
|
8
|
-
|
|
8
|
+
const stories = storiesOf('Prototypes/Styleguide', module);
|
|
9
9
|
stories.addDecorator(getWrapperDecorator());
|
|
10
|
-
stories.add('typography',
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
__html: content
|
|
29
|
-
}
|
|
30
|
-
})));
|
|
31
|
-
}); // eslint-disable-next-line react/prop-types
|
|
10
|
+
stories.add('typography', () => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, {
|
|
11
|
+
className: css.header,
|
|
12
|
+
renderLeft: sideProps => /*#__PURE__*/React.createElement("div", sideProps, /*#__PURE__*/React.createElement("h1", {
|
|
13
|
+
className: css.headerTitle
|
|
14
|
+
}, /*#__PURE__*/React.createElement(Logo, {
|
|
15
|
+
className: css.headerLogo
|
|
16
|
+
}), /*#__PURE__*/React.createElement("span", null, "BundleStats")))
|
|
17
|
+
}), /*#__PURE__*/React.createElement(SubHeader, {
|
|
18
|
+
className: css.subheader,
|
|
19
|
+
title: "HTML Ipsum presents",
|
|
20
|
+
subtitle: "Documentation"
|
|
21
|
+
}), /*#__PURE__*/React.createElement("main", {
|
|
22
|
+
className: css.main
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
24
|
+
dangerouslySetInnerHTML: {
|
|
25
|
+
__html: content
|
|
26
|
+
}
|
|
27
|
+
})))); // eslint-disable-next-line react/prop-types
|
|
32
28
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
const Item = _ref => {
|
|
30
|
+
let {
|
|
31
|
+
colorName,
|
|
32
|
+
valueName = 'normal'
|
|
33
|
+
} = _ref;
|
|
34
|
+
const colorFullName = valueName === 'normal' ? colorName : [colorName, valueName].join('-');
|
|
38
35
|
return /*#__PURE__*/React.createElement("div", {
|
|
39
36
|
style: {
|
|
40
|
-
background:
|
|
37
|
+
background: `var(--color-${colorFullName})`,
|
|
41
38
|
color: 'var(--color-light)',
|
|
42
39
|
padding: '12px',
|
|
43
40
|
flex: '1 1 20%'
|
|
44
41
|
}
|
|
45
|
-
}, colorName
|
|
42
|
+
}, `${colorName} ${valueName}`);
|
|
46
43
|
};
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
stories.add('color sheme',
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
colorName: colorName,
|
|
71
|
-
valueName: valueName
|
|
72
|
-
});
|
|
73
|
-
}));
|
|
74
|
-
}));
|
|
75
|
-
});
|
|
45
|
+
const COLORS = ['blue', 'red', 'green', 'yellow', 'gray'];
|
|
46
|
+
const NAMES = ['ultra-light', 'light', 'normal', 'dark', 'ultra-dark'];
|
|
47
|
+
stories.add('color sheme', () => /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Item, {
|
|
48
|
+
colorName: "branding",
|
|
49
|
+
valueName: "light"
|
|
50
|
+
}), /*#__PURE__*/React.createElement(Item, {
|
|
51
|
+
colorName: "branding"
|
|
52
|
+
}), /*#__PURE__*/React.createElement(Item, {
|
|
53
|
+
colorName: "branding",
|
|
54
|
+
valueName: "dark"
|
|
55
|
+
}), /*#__PURE__*/React.createElement("hr", null), /*#__PURE__*/React.createElement(Item, {
|
|
56
|
+
colorName: "dark"
|
|
57
|
+
}), /*#__PURE__*/React.createElement("hr", null), COLORS.map(colorName => /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
style: {
|
|
59
|
+
display: 'flex',
|
|
60
|
+
marginBottom: '24px'
|
|
61
|
+
}
|
|
62
|
+
}, NAMES.map(valueName => /*#__PURE__*/React.createElement(Item, {
|
|
63
|
+
key: `${colorName}-${valueName}`,
|
|
64
|
+
colorName: colorName,
|
|
65
|
+
valueName: valueName
|
|
66
|
+
}))))));
|
package/lib-esm/query-state.js
CHANGED
|
@@ -6,34 +6,31 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
import { Route, useHistory, useLocation } from 'react-router-dom';
|
|
8
8
|
import { JsonParam, QueryParamProvider, useQueryParams } from 'use-query-params';
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export const QueryStateProvider = props => {
|
|
10
|
+
const history = useHistory();
|
|
11
|
+
const location = useLocation();
|
|
12
12
|
return /*#__PURE__*/React.createElement(QueryParamProvider, _extends({
|
|
13
13
|
ReactRouterRoute: Route,
|
|
14
14
|
location: location,
|
|
15
15
|
history: history
|
|
16
16
|
}, props));
|
|
17
17
|
};
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var state = search[componentName];
|
|
26
|
-
var setState = useCallback(function (newState) {
|
|
27
|
-
var _setSearch;
|
|
28
|
-
|
|
29
|
-
var newComponentState = _merge({}, state, newState); // Deep check to prevent unnecessary state changes
|
|
18
|
+
export const useComponentQueryState = componentName => {
|
|
19
|
+
const [search, setSearch] = useQueryParams({
|
|
20
|
+
[componentName]: JsonParam
|
|
21
|
+
});
|
|
22
|
+
const state = search[componentName];
|
|
23
|
+
const setState = useCallback(newState => {
|
|
24
|
+
const newComponentState = _merge({}, state, newState); // Deep check to prevent unnecessary state changes
|
|
30
25
|
|
|
31
26
|
|
|
32
27
|
if (_isEqual(newComponentState, state)) {
|
|
33
28
|
return;
|
|
34
29
|
}
|
|
35
30
|
|
|
36
|
-
setSearch(
|
|
31
|
+
setSearch({
|
|
32
|
+
[componentName]: newComponentState
|
|
33
|
+
});
|
|
37
34
|
}, [state]);
|
|
38
35
|
return [state, setState];
|
|
39
36
|
};
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
-
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
1
|
import React from 'react';
|
|
8
2
|
import { MemoryRouter } from 'react-router-dom';
|
|
9
|
-
export
|
|
3
|
+
export const getWrapperDecorator = function (customWrapperStyles) {
|
|
10
4
|
if (customWrapperStyles === void 0) {
|
|
11
5
|
customWrapperStyles = {};
|
|
12
6
|
}
|
|
13
7
|
|
|
14
|
-
return
|
|
15
|
-
|
|
8
|
+
return storyFn => {
|
|
9
|
+
const wrapperStyles = {
|
|
16
10
|
width: '100%',
|
|
17
11
|
height: '100%',
|
|
18
|
-
padding: '24px'
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
padding: '24px',
|
|
13
|
+
...customWrapperStyles
|
|
14
|
+
};
|
|
21
15
|
return /*#__PURE__*/React.createElement(MemoryRouter, {
|
|
22
16
|
initialEntries: [{
|
|
23
17
|
pathname: '/',
|
|
@@ -3,10 +3,12 @@ import cx from 'classnames';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { Box } from '../../layout/box';
|
|
5
5
|
import css from './alert.module.css';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export const Alert = props => {
|
|
7
|
+
const {
|
|
8
|
+
className,
|
|
9
|
+
kind,
|
|
10
|
+
children
|
|
11
|
+
} = props;
|
|
10
12
|
return /*#__PURE__*/React.createElement(Box, {
|
|
11
13
|
padding: ['xsmall', 'small'],
|
|
12
14
|
outline: true,
|
|
@@ -2,28 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import { storiesOf } from '@storybook/react';
|
|
3
3
|
import { getWrapperDecorator } from '../../stories';
|
|
4
4
|
import { Alert } from '.';
|
|
5
|
-
|
|
5
|
+
const stories = storiesOf('UI/Alert', module);
|
|
6
6
|
stories.addDecorator(getWrapperDecorator());
|
|
7
|
-
stories.add('default',
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
stories.add('with kind warning', function () {
|
|
21
|
-
return /*#__PURE__*/React.createElement(Alert, {
|
|
22
|
-
kind: "warning"
|
|
23
|
-
}, "Lorem ipsum");
|
|
24
|
-
});
|
|
25
|
-
stories.add('with kind danger', function () {
|
|
26
|
-
return /*#__PURE__*/React.createElement(Alert, {
|
|
27
|
-
kind: "danger"
|
|
28
|
-
}, "Lorem ipsum");
|
|
29
|
-
});
|
|
7
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(Alert, null, "Lorem ipsum"));
|
|
8
|
+
stories.add('with kind success', () => /*#__PURE__*/React.createElement(Alert, {
|
|
9
|
+
kind: "success"
|
|
10
|
+
}, "Lorem ipsum"));
|
|
11
|
+
stories.add('with kind info', () => /*#__PURE__*/React.createElement(Alert, {
|
|
12
|
+
kind: "info"
|
|
13
|
+
}, "Lorem ipsum"));
|
|
14
|
+
stories.add('with kind warning', () => /*#__PURE__*/React.createElement(Alert, {
|
|
15
|
+
kind: "warning"
|
|
16
|
+
}, "Lorem ipsum"));
|
|
17
|
+
stories.add('with kind danger', () => /*#__PURE__*/React.createElement(Alert, {
|
|
18
|
+
kind: "danger"
|
|
19
|
+
}, "Lorem ipsum"));
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
var _excluded = ["className", "as"];
|
|
2
|
-
|
|
3
1
|
function _extends() { _extends = Object.assign || 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); }
|
|
4
2
|
|
|
5
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
|
-
|
|
7
3
|
import React from 'react';
|
|
8
4
|
import PropTypes from 'prop-types';
|
|
9
5
|
import cx from 'classnames';
|
|
10
6
|
import css from './container.module.css';
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
export const Container = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
className,
|
|
10
|
+
as: Component,
|
|
11
|
+
...restProps
|
|
12
|
+
} = _ref;
|
|
16
13
|
return /*#__PURE__*/React.createElement(Component, {
|
|
17
14
|
className: cx(css.root, className)
|
|
18
15
|
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { storiesOf } from '@storybook/react';
|
|
3
3
|
import { Container } from '.';
|
|
4
|
-
|
|
5
|
-
stories.add('default',
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}, "Content")));
|
|
20
|
-
});
|
|
4
|
+
const stories = storiesOf('UI/Container', module);
|
|
5
|
+
stories.add('default', () => /*#__PURE__*/React.createElement("div", {
|
|
6
|
+
style: {
|
|
7
|
+
background: 'hotpink'
|
|
8
|
+
}
|
|
9
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
10
|
+
style: {
|
|
11
|
+
background: 'white'
|
|
12
|
+
}
|
|
13
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
style: {
|
|
15
|
+
background: 'white',
|
|
16
|
+
padding: '24px'
|
|
17
|
+
}
|
|
18
|
+
}, "Content"))));
|
|
@@ -7,15 +7,17 @@ import { Menu, MenuItem, MenuButton, useMenuState } from 'reakit/Menu';
|
|
|
7
7
|
import { FlexStack } from '../../layout/flex-stack';
|
|
8
8
|
import { Icon } from '../icon';
|
|
9
9
|
import css from './dropdown.module.css';
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
export const Dropdown = props => {
|
|
11
|
+
const {
|
|
12
|
+
className,
|
|
13
|
+
label,
|
|
14
|
+
ariaLabel,
|
|
15
|
+
glyph,
|
|
16
|
+
activeLabel,
|
|
17
|
+
children
|
|
18
|
+
} = props;
|
|
19
|
+
const rootClassName = cx(css.root, activeLabel && css.activeLabel, className);
|
|
20
|
+
const menu = useMenuState({
|
|
19
21
|
baseId: process.env.NODE_ENV === 'test' && 'id-test',
|
|
20
22
|
modal: true
|
|
21
23
|
});
|
|
@@ -32,8 +34,8 @@ export var Dropdown = function Dropdown(props) {
|
|
|
32
34
|
"aria-label": ariaLabel || label,
|
|
33
35
|
className: css.dropdown
|
|
34
36
|
}), typeof children === 'function' ? children({
|
|
35
|
-
MenuItem
|
|
36
|
-
menu
|
|
37
|
+
MenuItem,
|
|
38
|
+
menu,
|
|
37
39
|
menuItemClassName: css.menuItem,
|
|
38
40
|
menuItemActiveClassName: css.menuItemActive
|
|
39
41
|
}) : children));
|