@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
package/lib-esm/ui/icon/icon.js
CHANGED
|
@@ -1,199 +1,11 @@
|
|
|
1
|
-
var _excluded = ["className", "glyph", "as", "size"];
|
|
2
|
-
|
|
3
|
-
var _ICON_MAP;
|
|
4
|
-
|
|
5
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); }
|
|
6
2
|
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
3
|
import React from 'react';
|
|
10
4
|
import PropTypes from 'prop-types';
|
|
11
5
|
import cx from 'classnames';
|
|
12
|
-
|
|
13
|
-
var ArrowIcon = function ArrowIcon(props) {
|
|
14
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
15
|
-
fill: "none",
|
|
16
|
-
d: "M0 0h24v24H0V0z"
|
|
17
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
18
|
-
d: "M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
|
19
|
-
}));
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
ArrowIcon.defaultProps = {
|
|
23
|
-
viewBox: "0 0 24 24",
|
|
24
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
-
fill: "currentColor"
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
var BranchIcon = function BranchIcon(props) {
|
|
29
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
30
|
-
d: "M512 192c-70.625 0-128 57.344-128 128 0 47.219 25.875 88.062 64 110.281V448s0 128-128 128c-53.062 0-94.656 11.375-128 28.812V302.281c38.156-22.219 64-63.062 64-110.281 0-70.656-57.344-128-128-128S0 121.344 0 192c0 47.219 25.844 88.062 64 110.281V721.75C25.844 743.938 0 784.75 0 832c0 70.625 57.344 128 128 128s128-57.375 128-128c0-33.5-13.188-63.75-34.25-86.625C240.375 722.5 270.656 704 320 704c254 0 256-256 256-256v-17.719c38.125-22.219 64-63.062 64-110.281 0-70.656-57.375-128-128-128zm-384-64c35.406 0 64 28.594 64 64s-28.594 64-64 64-64-28.594-64-64 28.594-64 64-64zm0 768c-35.406 0-64-28.625-64-64 0-35.312 28.594-64 64-64s64 28.688 64 64c0 35.375-28.594 64-64 64zm384-512c-35.375 0-64-28.594-64-64s28.625-64 64-64 64 28.594 64 64-28.625 64-64 64z"
|
|
31
|
-
}));
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
BranchIcon.defaultProps = {
|
|
35
|
-
viewBox: "0 0 640 1024",
|
|
36
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
37
|
-
fill: "currentColor"
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
var CancelIcon = function CancelIcon(props) {
|
|
41
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
42
|
-
d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"
|
|
43
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
44
|
-
d: "M0 0h24v24H0z",
|
|
45
|
-
fill: "none"
|
|
46
|
-
}));
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
CancelIcon.defaultProps = {
|
|
50
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
51
|
-
height: "24",
|
|
52
|
-
viewBox: "0 0 24 24",
|
|
53
|
-
width: "24",
|
|
54
|
-
fill: "currentColor"
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
var ClockIcon = function ClockIcon(props) {
|
|
58
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
59
|
-
fillRule: "evenodd",
|
|
60
|
-
d: "M8 8h3v2H7c-.55 0-1-.45-1-1V4h2v4zM7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7z"
|
|
61
|
-
}));
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
ClockIcon.defaultProps = {
|
|
65
|
-
viewBox: "0 0 14 16",
|
|
66
|
-
fill: "currentColor"
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
var CloseIcon = function CloseIcon(props) {
|
|
70
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
71
|
-
d: "M0 0h24v24H0z",
|
|
72
|
-
fill: "none"
|
|
73
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
74
|
-
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
75
|
-
}));
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
CloseIcon.defaultProps = {
|
|
79
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
80
|
-
viewBox: "0 0 24 24",
|
|
81
|
-
fill: "currentColor"
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
var CommitIcon = function CommitIcon(props) {
|
|
85
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
86
|
-
d: "M694.875 448C666.375 337.781 567.125 256 448 256c-119.094 0-218.375 81.781-246.906 192H0v128h201.094C229.625 686.25 328.906 768 448 768c119.125 0 218.375-81.75 246.875-192H896V448H694.875zM448 640c-70.656 0-128-57.375-128-128 0-70.656 57.344-128 128-128 70.625 0 128 57.344 128 128 0 70.625-57.375 128-128 128z"
|
|
87
|
-
}));
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
CommitIcon.defaultProps = {
|
|
91
|
-
viewBox: "0 0 896 1024",
|
|
92
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
93
|
-
fill: "currentColor"
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
var FilterIcon = function FilterIcon(props) {
|
|
97
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
98
|
-
d: "M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"
|
|
99
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
100
|
-
d: "M0 0h24v24H0z",
|
|
101
|
-
fill: "none"
|
|
102
|
-
}));
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
FilterIcon.defaultProps = {
|
|
106
|
-
viewBox: "0 0 24 24",
|
|
107
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
108
|
-
fill: "currentColor"
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
var HelpIcon = function HelpIcon(props) {
|
|
112
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
113
|
-
d: "M0 0h24v24H0z",
|
|
114
|
-
fill: "none"
|
|
115
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
116
|
-
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"
|
|
117
|
-
}));
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
HelpIcon.defaultProps = {
|
|
121
|
-
viewBox: "0 0 24 24",
|
|
122
|
-
fill: "currentColor"
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
var MenuIcon = function MenuIcon(props) {
|
|
126
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
127
|
-
d: "M0 0h24v24H0z",
|
|
128
|
-
fill: "none"
|
|
129
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
130
|
-
d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
|
|
131
|
-
}));
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
MenuIcon.defaultProps = {
|
|
135
|
-
viewBox: "0 0 24 24",
|
|
136
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
137
|
-
fill: "currentColor"
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
var PackageIcon = function PackageIcon(props) {
|
|
141
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
142
|
-
d: "M480 64L0 192v576l480 128 480-128V192L480 64zM63.875 720.934L63.5 288l384.498 102.533.001 432.833L63.875 720.934zM63.5 224l160.254-42.734L640 292.265v.135l-160 42.667L63.5 224zm832.625 496.934L512.001 823.366l.001-432.833L640 356.4v156l128-34.135V322.267L896.5 288l-.375 432.934zM768 258.267v-.125L351.734 147.138 480 112.934 896.5 224 768 258.267z"
|
|
143
|
-
}));
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
PackageIcon.defaultProps = {
|
|
147
|
-
viewBox: "0 0 1024 1024",
|
|
148
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
149
|
-
fill: "currentColor"
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
var PullRequestIcon = function PullRequestIcon(props) {
|
|
153
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
154
|
-
d: "M128 64C57.344 64 0 121.344 0 192c0 47.219 25.906 88.062 64 110.281V721.75C25.906 743.938 0 784.75 0 832c0 70.625 57.344 128 128 128s128-57.375 128-128c0-47.25-25.844-88.062-64-110.25V302.281c38.156-22.219 64-63.062 64-110.281 0-70.656-57.344-128-128-128zm0 832c-35.312 0-64-28.625-64-64 0-35.312 28.688-64 64-64 35.406 0 64 28.688 64 64 0 35.375-28.594 64-64 64zm0-640c-35.312 0-64-28.594-64-64s28.688-64 64-64c35.406 0 64 28.594 64 64s-28.594 64-64 64zm576 465.75V320c0-192.5-192-192-192-192h-64V0L256 192l192 192V256h64c56.438 0 64 64 64 64v401.75c-38.125 22.188-64 62.938-64 110.25 0 70.625 57.375 128 128 128s128-57.375 128-128c0-47.25-25.875-88.062-64-110.25zM640 896c-35.312 0-64-28.625-64-64 0-35.312 28.688-64 64-64 35.375 0 64 28.688 64 64 0 35.375-28.625 64-64 64z"
|
|
155
|
-
}));
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
PullRequestIcon.defaultProps = {
|
|
159
|
-
viewBox: "0 0 768 1024",
|
|
160
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
161
|
-
fill: "currentColor"
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
var SortIcon = function SortIcon(props) {
|
|
165
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
166
|
-
d: "M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"
|
|
167
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
168
|
-
d: "M0 0h24v24H0z",
|
|
169
|
-
fill: "none"
|
|
170
|
-
}));
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
SortIcon.defaultProps = {
|
|
174
|
-
viewBox: "0 0 24 24",
|
|
175
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
176
|
-
fill: "currentColor"
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
var WarningIcon = function WarningIcon(props) {
|
|
180
|
-
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
181
|
-
d: "M0 0h24v24H0z",
|
|
182
|
-
fill: "none"
|
|
183
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
184
|
-
d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"
|
|
185
|
-
}));
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
WarningIcon.defaultProps = {
|
|
189
|
-
viewBox: "0 0 24 24",
|
|
190
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
191
|
-
fill: "currentColor"
|
|
192
|
-
};
|
|
193
6
|
import css from './icon.module.css';
|
|
194
|
-
|
|
7
|
+
const ICONS = {
|
|
195
8
|
ARROW: 'arrow',
|
|
196
|
-
BRANCH: 'branch',
|
|
197
9
|
CANCEL: 'cancel',
|
|
198
10
|
CLOSE: 'close',
|
|
199
11
|
CLOCK: 'clock',
|
|
@@ -201,25 +13,24 @@ var ICONS = {
|
|
|
201
13
|
FILTER: 'filter',
|
|
202
14
|
HELP: 'help',
|
|
203
15
|
MENU: 'menu',
|
|
204
|
-
PACKAGE: 'package',
|
|
205
|
-
PR: 'pr',
|
|
206
16
|
SORT: 'sort',
|
|
207
17
|
WARNING: 'warning'
|
|
208
18
|
};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
var Svg = typeof glyph === 'string' ? ICON_MAP[glyph] : glyph;
|
|
19
|
+
export const Icon = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
className,
|
|
22
|
+
glyph,
|
|
23
|
+
as: Component,
|
|
24
|
+
size,
|
|
25
|
+
...restProps
|
|
26
|
+
} = _ref;
|
|
218
27
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
219
28
|
className: cx(css.root, className, css[size])
|
|
220
|
-
}, restProps), /*#__PURE__*/React.createElement(
|
|
29
|
+
}, restProps), /*#__PURE__*/React.createElement("svg", {
|
|
221
30
|
className: css.icon
|
|
222
|
-
}
|
|
31
|
+
}, /*#__PURE__*/React.createElement("use", {
|
|
32
|
+
xlinkHref: `#${glyph}`
|
|
33
|
+
})));
|
|
223
34
|
};
|
|
224
35
|
Icon.ICONS = ICONS;
|
|
225
36
|
Icon.SIZE_SMALL = 'small';
|
|
@@ -2,28 +2,20 @@ import React from 'react';
|
|
|
2
2
|
import { storiesOf } from '@storybook/react';
|
|
3
3
|
import { getWrapperDecorator } from '../../stories';
|
|
4
4
|
import { Icon } from '.';
|
|
5
|
-
|
|
5
|
+
const stories = storiesOf('UI/Icon', module);
|
|
6
6
|
stories.addDecorator(getWrapperDecorator());
|
|
7
|
-
stories.add('default',
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
margin: '0.3rem'
|
|
23
|
-
}
|
|
24
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
25
|
-
glyph: glyph,
|
|
26
|
-
key: glyph
|
|
27
|
-
}));
|
|
28
|
-
}));
|
|
29
|
-
});
|
|
7
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(Icon, {
|
|
8
|
+
glyph: Icon.ICONS.ARROW
|
|
9
|
+
}));
|
|
10
|
+
stories.add('with size', () => /*#__PURE__*/React.createElement(Icon, {
|
|
11
|
+
glyph: Icon.ICONS.ARROW,
|
|
12
|
+
size: Icon.SIZE_LARGE
|
|
13
|
+
}));
|
|
14
|
+
stories.add('all', () => /*#__PURE__*/React.createElement(React.Fragment, null, Object.values(Icon.ICONS).map(glyph => /*#__PURE__*/React.createElement("span", {
|
|
15
|
+
style: {
|
|
16
|
+
margin: '0.3rem'
|
|
17
|
+
}
|
|
18
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
19
|
+
glyph: glyph,
|
|
20
|
+
key: glyph
|
|
21
|
+
})))));
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
var _excluded = ["className", "size"];
|
|
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 cx from 'classnames';
|
|
9
5
|
import PropTypes from 'prop-types';
|
|
10
6
|
import css from './input.module.css';
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
export const Input = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
className,
|
|
10
|
+
size,
|
|
11
|
+
...restProps
|
|
12
|
+
} = _ref;
|
|
13
|
+
const rootClassName = cx(css.root, className, css[size]);
|
|
17
14
|
return /*#__PURE__*/React.createElement("input", _extends({
|
|
18
15
|
className: rootClassName
|
|
19
16
|
}, restProps));
|
|
@@ -2,16 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { storiesOf } from '@storybook/react';
|
|
3
3
|
import { getWrapperDecorator } from '../../stories';
|
|
4
4
|
import { Input } from '.';
|
|
5
|
-
|
|
5
|
+
const stories = storiesOf('UI/Input', module);
|
|
6
6
|
stories.addDecorator(getWrapperDecorator());
|
|
7
|
-
stories.add('default',
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
size: "small",
|
|
15
|
-
placeholder: "Search"
|
|
16
|
-
});
|
|
17
|
-
});
|
|
7
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(Input, {
|
|
8
|
+
placeholder: "Search"
|
|
9
|
+
}));
|
|
10
|
+
stories.add('with size', () => /*#__PURE__*/React.createElement(Input, {
|
|
11
|
+
size: "small",
|
|
12
|
+
placeholder: "Search"
|
|
13
|
+
}));
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
var _excluded = ["className", "size"];
|
|
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 './loader.module.css';
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
export const Loader = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
className,
|
|
10
|
+
size,
|
|
11
|
+
...restProps
|
|
12
|
+
} = _ref;
|
|
16
13
|
return /*#__PURE__*/React.createElement("span", _extends({
|
|
17
14
|
className: cx(css.root, className, css[size])
|
|
18
15
|
}, restProps));
|
|
@@ -2,13 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { storiesOf } from '@storybook/react';
|
|
3
3
|
import { getWrapperDecorator } from '../../stories';
|
|
4
4
|
import { Loader } from '.';
|
|
5
|
-
|
|
5
|
+
const stories = storiesOf('UI/Loader', module);
|
|
6
6
|
stories.addDecorator(getWrapperDecorator());
|
|
7
|
-
stories.add('default',
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return /*#__PURE__*/React.createElement(Loader, {
|
|
12
|
-
size: Loader.SIZE_LARGE
|
|
13
|
-
});
|
|
14
|
-
});
|
|
7
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(Loader, null));
|
|
8
|
+
stories.add('with size', () => /*#__PURE__*/React.createElement(Loader, {
|
|
9
|
+
size: Loader.SIZE_LARGE
|
|
10
|
+
}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
export const KIND_LOGO = 'logo';
|
|
2
|
+
export const KIND_LOGOTYPE = 'logotype';
|
|
3
|
+
export const KIND_GITHUB = 'github';
|
|
4
|
+
export const KIND_WEBPACK = 'webpack';
|
|
5
|
+
export const KIND_DEFAULT = KIND_LOGO;
|
|
6
|
+
export const KINDS = [KIND_LOGO, KIND_LOGOTYPE, KIND_GITHUB, KIND_WEBPACK];
|
package/lib-esm/ui/logo/logo.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
var _excluded = ["className", "as", "kind"];
|
|
2
|
-
|
|
3
|
-
var _ICONS;
|
|
4
|
-
|
|
5
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); }
|
|
6
2
|
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
3
|
import React from 'react';
|
|
10
4
|
import PropTypes from 'prop-types';
|
|
11
5
|
import cx from 'classnames';
|
|
@@ -78,15 +72,21 @@ WebpackSvg.defaultProps = {
|
|
|
78
72
|
};
|
|
79
73
|
import { KIND_DEFAULT, KIND_LOGO, KIND_LOGOTYPE, KIND_GITHUB, KIND_WEBPACK, KINDS } from './logo.constants';
|
|
80
74
|
import css from './logo.module.css';
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
75
|
+
const ICONS = {
|
|
76
|
+
[KIND_GITHUB]: GithubSvg,
|
|
77
|
+
[KIND_LOGOTYPE]: LogotypeSvg,
|
|
78
|
+
[KIND_LOGO]: LogoSvg,
|
|
79
|
+
[KIND_WEBPACK]: WebpackSvg
|
|
80
|
+
};
|
|
81
|
+
export const Logo = _ref => {
|
|
82
|
+
let {
|
|
83
|
+
className,
|
|
84
|
+
as: Component,
|
|
85
|
+
kind,
|
|
86
|
+
...props
|
|
87
|
+
} = _ref;
|
|
88
|
+
const rootClassName = cx(css.root, css[kind], className);
|
|
89
|
+
const Svg = ICONS[kind] || LogoSvg;
|
|
90
90
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
91
91
|
className: rootClassName
|
|
92
92
|
}, props), /*#__PURE__*/React.createElement(Svg, {
|
|
@@ -5,7 +5,7 @@ import { getWrapperDecorator } from '../../stories';
|
|
|
5
5
|
import { KIND_DEFAULT, KIND_LOGOTYPE, KINDS } from './logo.constants';
|
|
6
6
|
import { Logo } from '.';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const selectKind = function (value) {
|
|
9
9
|
if (value === void 0) {
|
|
10
10
|
value = KIND_DEFAULT;
|
|
11
11
|
}
|
|
@@ -13,31 +13,23 @@ var selectKind = function selectKind(value) {
|
|
|
13
13
|
return select('Kind', KINDS, value);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
const stories = storiesOf('UI/Logo', module);
|
|
17
17
|
stories.addDecorator(getWrapperDecorator());
|
|
18
18
|
stories.addDecorator(withKnobs);
|
|
19
|
-
stories.add('default',
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
});
|
|
19
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(Logo, {
|
|
20
|
+
kind: selectKind()
|
|
21
|
+
}));
|
|
24
22
|
/* eslint-disable jsx-a11y/anchor-has-content */
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
return /*#__PURE__*/React.createElement("a", props);
|
|
28
|
-
};
|
|
24
|
+
const LogoComponent = props => /*#__PURE__*/React.createElement("a", props);
|
|
29
25
|
/* eslint-enable jsx-a11y/anchor-has-content */
|
|
30
26
|
|
|
31
27
|
|
|
32
|
-
stories.add('with custom component',
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return /*#__PURE__*/React.createElement(Logo, {
|
|
41
|
-
kind: selectKind(KIND_LOGOTYPE)
|
|
42
|
-
});
|
|
43
|
-
});
|
|
28
|
+
stories.add('with custom component', () => /*#__PURE__*/React.createElement(Logo, {
|
|
29
|
+
as: LogoComponent,
|
|
30
|
+
href: "https://relative-ci.com",
|
|
31
|
+
kind: selectKind()
|
|
32
|
+
}));
|
|
33
|
+
stories.add('with custom kind', () => /*#__PURE__*/React.createElement(Logo, {
|
|
34
|
+
kind: selectKind(KIND_LOGOTYPE)
|
|
35
|
+
}));
|
|
@@ -1,36 +1,26 @@
|
|
|
1
|
-
var _excluded = ["className"],
|
|
2
|
-
_excluded2 = ["className", "children"];
|
|
3
|
-
|
|
4
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); }
|
|
5
2
|
|
|
6
|
-
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; }
|
|
7
|
-
|
|
8
|
-
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; }
|
|
9
|
-
|
|
10
|
-
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; }
|
|
11
|
-
|
|
12
|
-
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; }
|
|
13
|
-
|
|
14
3
|
import React from 'react';
|
|
15
4
|
import PropTypes from 'prop-types';
|
|
16
5
|
import cx from 'classnames';
|
|
17
6
|
import css from './panels.module.css';
|
|
18
7
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return /*#__PURE__*/React.cloneElement(element,
|
|
8
|
+
const cloneElement = element => {
|
|
9
|
+
const {
|
|
10
|
+
className,
|
|
11
|
+
...restProps
|
|
12
|
+
} = element.props;
|
|
13
|
+
return /*#__PURE__*/React.cloneElement(element, { ...restProps,
|
|
25
14
|
className: cx(css.panel, className)
|
|
26
|
-
})
|
|
15
|
+
});
|
|
27
16
|
};
|
|
28
17
|
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
export const Panels = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
className,
|
|
21
|
+
children,
|
|
22
|
+
...restProps
|
|
23
|
+
} = _ref;
|
|
34
24
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
35
25
|
className: cx(css.root, className)
|
|
36
26
|
}, restProps), React.Children.map(children, cloneElement));
|
|
@@ -2,20 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import { storiesOf } from '@storybook/react';
|
|
3
3
|
import { getWrapperDecorator } from '../../stories';
|
|
4
4
|
import { Panels } from '.';
|
|
5
|
-
|
|
5
|
+
const stories = storiesOf('UI/Panels', module);
|
|
6
6
|
stories.addDecorator(getWrapperDecorator());
|
|
7
|
-
stories.add('default',
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, "Panel 2"));
|
|
21
|
-
});
|
|
7
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(Panels, {
|
|
8
|
+
style: {
|
|
9
|
+
outline: '1px dotted hotpink'
|
|
10
|
+
}
|
|
11
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
style: {
|
|
13
|
+
padding: '24px'
|
|
14
|
+
}
|
|
15
|
+
}, "Panel 1"), /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
style: {
|
|
17
|
+
padding: '24px'
|
|
18
|
+
}
|
|
19
|
+
}, "Panel 2")));
|
|
@@ -6,23 +6,25 @@ import cx from 'classnames';
|
|
|
6
6
|
import { usePopoverState, Popover as UIPopover, PopoverDisclosure as UIPopoverDisclosure, PopoverArrow as UIPopoverArrow } from 'reakit/Popover';
|
|
7
7
|
import { Icon } from '../icon';
|
|
8
8
|
import css from './popover.module.css';
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
export const Popover = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
className,
|
|
12
|
+
icon,
|
|
13
|
+
label,
|
|
14
|
+
ariaLabel,
|
|
15
|
+
children
|
|
16
|
+
} = _ref;
|
|
17
|
+
const popover = usePopoverState({
|
|
16
18
|
baseId: process.env.NODE_ENV === 'test' && 'id-test',
|
|
17
19
|
gutter: 24,
|
|
18
20
|
modal: true,
|
|
19
21
|
placement: 'top'
|
|
20
22
|
});
|
|
21
|
-
|
|
23
|
+
const onCloseButtonClick = useCallback(event => {
|
|
22
24
|
event.preventDefault();
|
|
23
25
|
popover.toggle();
|
|
24
26
|
}, [popover]);
|
|
25
|
-
|
|
27
|
+
const onButtonClick = useCallback(event => {
|
|
26
28
|
event.preventDefault();
|
|
27
29
|
popover.toggle();
|
|
28
30
|
}, [popover]);
|
|
@@ -2,17 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { storiesOf } from '@storybook/react';
|
|
3
3
|
import { getWrapperDecorator } from '../../stories';
|
|
4
4
|
import { Popover } from '.';
|
|
5
|
-
|
|
5
|
+
const stories = storiesOf('UI/Popover', module);
|
|
6
6
|
stories.addDecorator(getWrapperDecorator({
|
|
7
7
|
padding: '64px'
|
|
8
8
|
}));
|
|
9
|
-
stories.add('default',
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return /*#__PURE__*/React.createElement(Popover, {
|
|
16
|
-
icon: "help"
|
|
17
|
-
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
|
|
18
|
-
});
|
|
9
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(Popover, {
|
|
10
|
+
label: "Job #100"
|
|
11
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."));
|
|
12
|
+
stories.add('with icon', () => /*#__PURE__*/React.createElement(Popover, {
|
|
13
|
+
icon: "help"
|
|
14
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."));
|