@bundle-stats/ui 4.1.1-alpha.3 → 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 +1 -1
- 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 +6 -15
- 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 +1 -1
- 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 +4 -4
- 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 +1 -1
- package/src/ui/tabs/tabs.module.css +6 -2
|
@@ -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, useEffect, useState } from 'react';
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import { getInitialValues } from './filters.utils';
|
|
@@ -13,34 +11,30 @@ export const Filters = props => {
|
|
|
13
11
|
filters,
|
|
14
12
|
...restProps
|
|
15
13
|
} = props;
|
|
16
|
-
const [values, setValues] = useState(getInitialValues('', filters));
|
|
14
|
+
const [values, setValues] = useState(getInitialValues('', filters));
|
|
17
15
|
|
|
16
|
+
// Update values when the parent filters are changing (route with query string change)
|
|
18
17
|
useEffect(() => {
|
|
19
18
|
const parentValues = getInitialValues('', filters);
|
|
20
|
-
|
|
21
19
|
if (_isEqual(parentValues, values)) {
|
|
22
20
|
return;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
22
|
setValues(parentValues);
|
|
26
|
-
},
|
|
23
|
+
},
|
|
24
|
+
// Do not trigger effect when the values are changing locally
|
|
27
25
|
[filters, setValues]);
|
|
28
26
|
const toggleFilter = useCallback((key, value) => {
|
|
29
27
|
const nextValues = _merge({}, values, {
|
|
30
28
|
[key]: value
|
|
31
29
|
});
|
|
32
|
-
|
|
33
30
|
setValues(nextValues);
|
|
34
|
-
|
|
35
31
|
if (onChange) {
|
|
36
32
|
onChange(nextValues);
|
|
37
33
|
}
|
|
38
34
|
}, [onChange, setValues, values]);
|
|
39
35
|
const toggleFilters = useCallback(newFilters => {
|
|
40
36
|
const nextValues = _merge({}, values, newFilters);
|
|
41
|
-
|
|
42
37
|
setValues(nextValues);
|
|
43
|
-
|
|
44
38
|
if (onChange) {
|
|
45
39
|
onChange(nextValues);
|
|
46
40
|
}
|
|
@@ -7,7 +7,6 @@ import cx from 'classnames';
|
|
|
7
7
|
import { getColors } from '../../utils';
|
|
8
8
|
import { Tooltip } from '../tooltip';
|
|
9
9
|
import css from './horizontal-bar-chart.module.css';
|
|
10
|
-
|
|
11
10
|
class HorizontalBarChartItem extends React.Component {
|
|
12
11
|
constructor(props) {
|
|
13
12
|
super(props);
|
|
@@ -17,19 +16,15 @@ class HorizontalBarChartItem extends React.Component {
|
|
|
17
16
|
isTextOverflowing: true
|
|
18
17
|
};
|
|
19
18
|
}
|
|
20
|
-
|
|
21
19
|
componentDidMount() {
|
|
22
20
|
const wrapperWidth = _get(this, 'ref.current.clientWidth', 0);
|
|
23
|
-
|
|
24
21
|
const textWidth = _get(this, 'textRef.current.scrollWidth', 0);
|
|
25
|
-
|
|
26
22
|
if (wrapperWidth >= textWidth + 2 * 4) {
|
|
27
23
|
this.setState({
|
|
28
24
|
isTextOverflowing: false
|
|
29
25
|
});
|
|
30
26
|
}
|
|
31
27
|
}
|
|
32
|
-
|
|
33
28
|
render() {
|
|
34
29
|
const {
|
|
35
30
|
color,
|
|
@@ -57,9 +52,7 @@ class HorizontalBarChartItem extends React.Component {
|
|
|
57
52
|
ref: this.textRef
|
|
58
53
|
}, label)));
|
|
59
54
|
}
|
|
60
|
-
|
|
61
55
|
}
|
|
62
|
-
|
|
63
56
|
HorizontalBarChartItem.propTypes = {
|
|
64
57
|
width: PropTypes.string.isRequired,
|
|
65
58
|
color: PropTypes.string.isRequired,
|
|
@@ -69,15 +62,12 @@ HorizontalBarChartItem.propTypes = {
|
|
|
69
62
|
HorizontalBarChartItem.defaultProps = {
|
|
70
63
|
getItemTooltip: () => null
|
|
71
64
|
};
|
|
72
|
-
|
|
73
65
|
const getTotalValues = values => _sum(values.map(entry => {
|
|
74
66
|
if (typeof entry === 'object') {
|
|
75
67
|
return entry.value;
|
|
76
68
|
}
|
|
77
|
-
|
|
78
69
|
return entry;
|
|
79
70
|
}));
|
|
80
|
-
|
|
81
71
|
export const HorizontalBarChart = props => {
|
|
82
72
|
const {
|
|
83
73
|
className,
|
|
@@ -135,7 +125,6 @@ HorizontalBarChart.defaultProps = {
|
|
|
135
125
|
HorizontalBarChart.propTypes = {
|
|
136
126
|
/** Adopted child class name */
|
|
137
127
|
className: PropTypes.string,
|
|
138
|
-
|
|
139
128
|
/** Data */
|
|
140
129
|
data: PropTypes.shape({
|
|
141
130
|
labels: PropTypes.arrayOf(PropTypes.string),
|
|
@@ -145,7 +134,6 @@ HorizontalBarChart.propTypes = {
|
|
|
145
134
|
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
146
135
|
})]))
|
|
147
136
|
}).isRequired,
|
|
148
|
-
|
|
149
137
|
/** Mac value */
|
|
150
138
|
maxValue: PropTypes.number
|
|
151
139
|
};
|
|
@@ -1,23 +1,18 @@
|
|
|
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';
|
|
6
5
|
import { Hovercard, HovercardAnchor, HovercardArrow, useHovercard, useHovercardState } from 'ariakit/hovercard';
|
|
7
6
|
import css from './hover-card.module.css';
|
|
8
|
-
|
|
9
7
|
const resolveComponent = (as, href) => {
|
|
10
8
|
if (as) {
|
|
11
9
|
return as;
|
|
12
10
|
}
|
|
13
|
-
|
|
14
11
|
if (href) {
|
|
15
12
|
return 'a';
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
return 'span';
|
|
19
15
|
};
|
|
20
|
-
|
|
21
16
|
export const HoverCard = props => {
|
|
22
17
|
const {
|
|
23
18
|
className,
|
|
@@ -35,8 +30,9 @@ export const HoverCard = props => {
|
|
|
35
30
|
const hoverCardProps = useHovercard({
|
|
36
31
|
state,
|
|
37
32
|
portal: true
|
|
38
|
-
});
|
|
33
|
+
});
|
|
39
34
|
|
|
35
|
+
// Fallback to span if no href
|
|
40
36
|
const Component = resolveComponent(as, href);
|
|
41
37
|
return /*#__PURE__*/React.createElement("div", {
|
|
42
38
|
className: cx(css.root, className)
|
|
@@ -60,22 +56,16 @@ export const HoverCard = props => {
|
|
|
60
56
|
HoverCard.propTypes = {
|
|
61
57
|
/** Adopted child class name */
|
|
62
58
|
className: PropTypes.string,
|
|
63
|
-
|
|
64
59
|
/** Adopted child class name for hover card */
|
|
65
60
|
hoverCardClassName: PropTypes.string,
|
|
66
|
-
|
|
67
61
|
/** Adopted child class name for anchor */
|
|
68
62
|
anchorClassName: PropTypes.string,
|
|
69
|
-
|
|
70
63
|
/** Anchor label */
|
|
71
64
|
label: PropTypes.node,
|
|
72
|
-
|
|
73
65
|
/** Anchor href */
|
|
74
66
|
href: PropTypes.string,
|
|
75
|
-
|
|
76
67
|
/** Anchor component */
|
|
77
68
|
as: PropTypes.elementType,
|
|
78
|
-
|
|
79
69
|
/** Hover card component */
|
|
80
70
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired
|
|
81
71
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
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 { HoverCard } from '.';
|
|
5
4
|
export default {
|
|
6
5
|
title: 'UI/HoverCard',
|
|
7
6
|
component: HoverCard
|
|
8
7
|
};
|
|
9
|
-
|
|
10
8
|
const Template = props => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HoverCard, _extends({}, props, {
|
|
11
9
|
style: {
|
|
12
10
|
zIndex: 2
|
|
@@ -18,7 +16,6 @@ const Template = props => /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
|
18
16
|
maxWidth: 360
|
|
19
17
|
}
|
|
20
18
|
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras in neque ante. Curabitur vehicula, lorem sit amet fringilla dapibus, justo mauris varius elit, ut fermentum leo velit eget risus"));
|
|
21
|
-
|
|
22
19
|
export const Default = () => /*#__PURE__*/React.createElement(Template, {
|
|
23
20
|
label: "main.js"
|
|
24
21
|
}, /*#__PURE__*/React.createElement("h1", null, "main.js"), /*#__PURE__*/React.createElement("p", null, "info"));
|
package/lib-esm/ui/icon/icon.js
CHANGED
|
@@ -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 cx from 'classnames';
|
|
5
4
|
import PropTypes from 'prop-types';
|
|
@@ -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';
|
|
@@ -25,7 +24,6 @@ Loader.defaultProps = {
|
|
|
25
24
|
Loader.propTypes = {
|
|
26
25
|
/** Adopted child class name */
|
|
27
26
|
className: PropTypes.string,
|
|
28
|
-
|
|
29
27
|
/** Size modifier */
|
|
30
28
|
size: PropTypes.oneOf(Loader.SIZES)
|
|
31
29
|
};
|
package/lib-esm/ui/logo/logo.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
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';
|
|
6
|
-
|
|
7
5
|
var GithubSvg = function GithubSvg(props) {
|
|
8
6
|
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
9
7
|
fillRule: "evenodd",
|
|
@@ -12,13 +10,11 @@ var GithubSvg = function GithubSvg(props) {
|
|
|
12
10
|
transform: "scale(64)"
|
|
13
11
|
}));
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
GithubSvg.defaultProps = {
|
|
17
14
|
viewBox: "0 0 1024 1024",
|
|
18
15
|
fill: "currentColor",
|
|
19
16
|
xmlns: "http://www.w3.org/2000/svg"
|
|
20
17
|
};
|
|
21
|
-
|
|
22
18
|
var LogoSvg = function LogoSvg(props) {
|
|
23
19
|
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
24
20
|
d: "M256 42.67L69.33 149.33v213.34L256 469.33l186.67-106.66V149.33L256 42.67z",
|
|
@@ -34,25 +30,21 @@ var LogoSvg = function LogoSvg(props) {
|
|
|
34
30
|
fill: "#6f747b"
|
|
35
31
|
}));
|
|
36
32
|
};
|
|
37
|
-
|
|
38
33
|
LogoSvg.defaultProps = {
|
|
39
34
|
xmlns: "http://www.w3.org/2000/svg",
|
|
40
35
|
viewBox: "0 0 512 512"
|
|
41
36
|
};
|
|
42
|
-
|
|
43
37
|
var LogotypeSvg = function LogotypeSvg(props) {
|
|
44
38
|
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
45
39
|
className: "a",
|
|
46
40
|
d: "M12.68 53.56h-.33l-1.17 4.51H0V0h14.35v13.52l-.5 6h.33a15.46 15.46 0 0110.43-4.17c10.1 0 16.61 8.34 16.61 21.11 0 14.43-8.68 22.61-17.77 22.61-3.76 0-7.51-1.83-10.77-5.51zm13.85-16.85c0-6.84-2.08-9.68-6.17-9.68-2.25 0-4 .84-6 3v15.36a8.47 8.47 0 005.67 2c3.5 0 6.5-2.67 6.5-10.68zM48.57 42.05v-25.7h14.35v23.86c0 4.68 1 6.68 4.76 6.68 2.42 0 4.08-.67 6.25-3.67V16.35h14.35v41.72H76.6l-1-5.51h-.33c-3.51 4-7.68 6.51-13.52 6.51-9.34 0-13.18-6.67-13.18-17.02zM97.4 16.35h11.68l1 5h.33c3.34-3.17 7.85-6 13.94-6 9.26 0 13.26 6.68 13.26 17v25.7h-14.35V34.21c0-4.67-1.16-6.68-4.84-6.68-2.67 0-4.5 1.17-6.67 3.17v27.37H97.4zM144.8 37.21c0-13.68 8.68-21.86 17.44-21.86a12.27 12.27 0 019.76 4.17h.33l-.66-6V0H186v58.07h-11.66l-1-3.84H173c-2.92 2.84-7 4.84-10.76 4.84-10.6 0-17.44-8.34-17.44-21.86zm26.87 7.18V29a7.8 7.8 0 00-5.51-2c-3.5 0-6.67 2.67-6.67 10 0 7.51 2.41 10.35 6.5 10.35a6.15 6.15 0 005.68-2.96zM204.05 40.88v-29.7h-12.51V0h26.86v41.38c0 4.84 3.34 6.18 6.26 6.18a18.15 18.15 0 006-1.17l3.08 10.51a39.1 39.1 0 01-12.93 2.17c-11.09 0-16.76-7.34-16.76-18.19zM238 37.21c0-13.68 10.68-21.86 21.86-21.86 13.18 0 19.85 9 19.85 20.19a37.41 37.41 0 01-.58 6h-30.25V32.2h20.36l-2 2.51c0-5.51-2.17-8.51-6.84-8.51-5.51 0-8.51 3.5-8.51 11 0 7.84 3.84 11 11.51 11a23.26 23.26 0 0010-2.5l4.68 8.51a33.13 33.13 0 01-16.69 4.84c-13.17.02-23.39-7.99-23.39-21.84zM284.18 51.31l8.18-9.84c4.08 3.08 8.92 5.25 13.85 5.25 4.33 0 6-1.42 6-3.17 0-3.17-2.83-3.84-7.84-5.92l-6.76-2.84c-6.26-2.33-11.43-7.26-11.43-15.1 0-9.26 8.34-16.85 20.69-16.85a27.27 27.27 0 0118.53 7.25l-7.18 9c-3.92-2.59-7-3.93-12.18-3.93-3.17 0-5.34 1.17-5.34 3.68s3.09 3.42 8.51 5.42l6.26 2.59c7.26 2.67 11.43 7.34 11.43 14.85 0 9.17-7.68 17.35-21.7 17.35a32.65 32.65 0 01-21.02-7.74zM337.62 40.38V27.53h-10V16.85l10.68-.5 1.84-12.51H352v12.51h16.52v11.18H352v12.6c0 5.93 2.76 7.76 8.1 7.76a23.71 23.71 0 007.59-1.33l2.5 10.34a50.19 50.19 0 01-13.85 2.17c-13.71 0-18.72-7.51-18.72-18.69zM376.09 46.22c0-9.34 7.34-14.18 26.37-15.18-.51-3-3.34-4.34-8-4.34-3.51 0-7 1.17-12 3.5l-5-9.34a40.45 40.45 0 0119.86-5.51c11.85 0 19.53 5.84 19.53 19.52v23.2h-11.72l-1-4.34h-.33c-4.09 3-9 5.34-14.18 5.34-8.69 0-13.53-6.01-13.53-12.85zm26.37-1.33v-5.34c-10.18.33-12.69 2.67-12.69 5.5 0 1.92 1.5 3 4.51 3 3.34.01 5.92-1.49 8.18-3.16zM431.6 40.38V27.53h-10V16.85l10.68-.5 1.82-12.51H446v12.51h16.52v11.18H446v12.6c0 5.93 2.75 7.76 8.09 7.76a23.77 23.77 0 007.6-1.33l2.5 10.34a50.26 50.26 0 01-13.85 2.17c-13.73 0-18.74-7.51-18.74-18.69zM470.28 52.73l6-8.84a32.83 32.83 0 0016.35 4.67c3.68 0 5.18-1 5.18-2.5 0-2-2.17-2.34-9.18-3.84-11.5-2.51-15.63-6.84-15.63-13.35 0-8.18 7.76-13.52 19.86-13.52 7.84 0 14.1 3.09 18.52 5.84L505 29.7a27.79 27.79 0 00-13.51-3.84c-2.67 0-4.34.84-4.34 2.34 0 1.84 2.17 2 8.67 3.5C508.33 34.54 512 38.3 512 45.22c0 7.84-7.43 13.85-21.36 13.85a39.71 39.71 0 01-20.36-6.34z"
|
|
47
41
|
}));
|
|
48
42
|
};
|
|
49
|
-
|
|
50
43
|
LogotypeSvg.defaultProps = {
|
|
51
44
|
xmlns: "http://www.w3.org/2000/svg",
|
|
52
45
|
viewBox: "0 0 512 59.07",
|
|
53
46
|
fill: "currentColor"
|
|
54
47
|
};
|
|
55
|
-
|
|
56
48
|
var WebpackSvg = function WebpackSvg(props) {
|
|
57
49
|
return /*#__PURE__*/React.createElement("svg", props, /*#__PURE__*/React.createElement("path", {
|
|
58
50
|
fill: "#FFF",
|
|
@@ -65,7 +57,6 @@ var WebpackSvg = function WebpackSvg(props) {
|
|
|
65
57
|
d: "M290.4 444.8L162 374.1V234.2l128.4 74.1v136.5zm18.4 0l128.4-70.6v-140l-128.4 74.1v136.5zM299.6 303zm-129-85l129-70.9L428.5 218l-128.9 74.4-129-74.4z"
|
|
66
58
|
}));
|
|
67
59
|
};
|
|
68
|
-
|
|
69
60
|
WebpackSvg.defaultProps = {
|
|
70
61
|
xmlns: "http://www.w3.org/2000/svg",
|
|
71
62
|
viewBox: "0 0 600 600"
|
|
@@ -101,10 +92,8 @@ Logo.defaultProps = {
|
|
|
101
92
|
Logo.propTypes = {
|
|
102
93
|
/** Adopted child class name */
|
|
103
94
|
className: PropTypes.string,
|
|
104
|
-
|
|
105
95
|
/** Rendered component */
|
|
106
96
|
as: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
|
|
107
|
-
|
|
108
97
|
/** Kind modifier */
|
|
109
98
|
kind: PropTypes.oneOf(KINDS)
|
|
110
99
|
};
|
|
@@ -4,27 +4,23 @@ import { select, withKnobs } from '@storybook/addon-knobs';
|
|
|
4
4
|
import { getWrapperDecorator } from '../../stories';
|
|
5
5
|
import { KIND_DEFAULT, KIND_LOGOTYPE, KINDS } from './logo.constants';
|
|
6
6
|
import { Logo } from '.';
|
|
7
|
-
|
|
8
7
|
const selectKind = function (value) {
|
|
9
8
|
if (value === void 0) {
|
|
10
9
|
value = KIND_DEFAULT;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
return select('Kind', KINDS, value);
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
const stories = storiesOf('UI/Logo', module);
|
|
17
14
|
stories.addDecorator(getWrapperDecorator());
|
|
18
15
|
stories.addDecorator(withKnobs);
|
|
19
16
|
stories.add('default', () => /*#__PURE__*/React.createElement(Logo, {
|
|
20
17
|
kind: selectKind()
|
|
21
18
|
}));
|
|
22
|
-
/* eslint-disable jsx-a11y/anchor-has-content */
|
|
23
19
|
|
|
20
|
+
/* eslint-disable jsx-a11y/anchor-has-content */
|
|
24
21
|
const LogoComponent = props => /*#__PURE__*/React.createElement("a", props);
|
|
25
22
|
/* eslint-enable jsx-a11y/anchor-has-content */
|
|
26
23
|
|
|
27
|
-
|
|
28
24
|
stories.add('with custom component', () => /*#__PURE__*/React.createElement(Logo, {
|
|
29
25
|
as: LogoComponent,
|
|
30
26
|
href: "https://relative-ci.com",
|
|
@@ -1,20 +1,18 @@
|
|
|
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';
|
|
6
5
|
import css from './panels.module.css';
|
|
7
|
-
|
|
8
6
|
const cloneElement = element => {
|
|
9
7
|
const {
|
|
10
8
|
className,
|
|
11
9
|
...restProps
|
|
12
10
|
} = element.props;
|
|
13
|
-
return /*#__PURE__*/React.cloneElement(element, {
|
|
11
|
+
return /*#__PURE__*/React.cloneElement(element, {
|
|
12
|
+
...restProps,
|
|
14
13
|
className: cx(css.panel, className)
|
|
15
14
|
});
|
|
16
15
|
};
|
|
17
|
-
|
|
18
16
|
export const Panels = _ref => {
|
|
19
17
|
let {
|
|
20
18
|
className,
|
|
@@ -32,7 +30,6 @@ Panels.defaultProps = {
|
|
|
32
30
|
Panels.propTypes = {
|
|
33
31
|
/** Adopted child class anme */
|
|
34
32
|
className: PropTypes.string,
|
|
35
|
-
|
|
36
33
|
/** Content */
|
|
37
34
|
children: PropTypes.node
|
|
38
35
|
};
|
|
@@ -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,12 +1,10 @@
|
|
|
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, { useMemo } from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import cx from 'classnames';
|
|
6
5
|
import { Dropdown } from '../dropdown';
|
|
7
6
|
import { Icon } from '../icon';
|
|
8
7
|
import css from './sort-dropdown.module.css';
|
|
9
|
-
|
|
10
8
|
const Item = _ref => {
|
|
11
9
|
let {
|
|
12
10
|
className,
|
|
@@ -21,11 +19,9 @@ const Item = _ref => {
|
|
|
21
19
|
} = _ref;
|
|
22
20
|
const buttonProps = useMemo(() => {
|
|
23
21
|
let resolveNextDirection = defaultDirection;
|
|
24
|
-
|
|
25
22
|
if (active) {
|
|
26
23
|
resolveNextDirection = direction === 'asc' ? 'desc' : 'asc';
|
|
27
24
|
}
|
|
28
|
-
|
|
29
25
|
if (resolveNextDirection === 'desc') {
|
|
30
26
|
return {
|
|
31
27
|
className: css.itemAsc,
|
|
@@ -33,7 +29,6 @@ const Item = _ref => {
|
|
|
33
29
|
title: `Order data by ${label} descending`
|
|
34
30
|
};
|
|
35
31
|
}
|
|
36
|
-
|
|
37
32
|
return {
|
|
38
33
|
onClick: getButtonOnClick(id, 'asc'),
|
|
39
34
|
title: `Order data by ${label} ascending`
|
|
@@ -48,7 +43,6 @@ const Item = _ref => {
|
|
|
48
43
|
className: css.itemLabel
|
|
49
44
|
}, label));
|
|
50
45
|
};
|
|
51
|
-
|
|
52
46
|
Item.propTypes = {
|
|
53
47
|
className: PropTypes.string,
|
|
54
48
|
as: PropTypes.element.isRequired,
|
|
@@ -85,7 +79,6 @@ export const SortDropdown = props => {
|
|
|
85
79
|
menuItemClassName,
|
|
86
80
|
menuItemActiveClassName
|
|
87
81
|
} = _ref2;
|
|
88
|
-
|
|
89
82
|
const getButtonOnClick = (newField, newDirection) => () => {
|
|
90
83
|
onChange({
|
|
91
84
|
field: newField,
|
|
@@ -93,7 +86,6 @@ export const SortDropdown = props => {
|
|
|
93
86
|
});
|
|
94
87
|
menu.toggle();
|
|
95
88
|
};
|
|
96
|
-
|
|
97
89
|
return /*#__PURE__*/React.createElement("div", {
|
|
98
90
|
className: css.items
|
|
99
91
|
}, Object.entries(fields).map(_ref3 => {
|
|
@@ -11,13 +11,11 @@ export const Table = _ref => {
|
|
|
11
11
|
children
|
|
12
12
|
} = _ref;
|
|
13
13
|
const rootClassName = cx(css.root, className, compact && css.compact, outline && css.outline);
|
|
14
|
-
|
|
15
14
|
if (!children) {
|
|
16
15
|
return /*#__PURE__*/React.createElement("div", {
|
|
17
16
|
className: cx(rootClassName, css.empty)
|
|
18
17
|
}, emptyMessage);
|
|
19
18
|
}
|
|
20
|
-
|
|
21
19
|
return /*#__PURE__*/React.createElement("table", {
|
|
22
20
|
className: rootClassName
|
|
23
21
|
}, children);
|
package/lib-esm/ui/tabs/tabs.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
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';
|
|
6
5
|
import css from './tabs.module.css';
|
|
7
|
-
|
|
8
6
|
const Item = _ref => {
|
|
9
7
|
let {
|
|
10
8
|
isTabActive,
|
|
@@ -16,7 +14,6 @@ const Item = _ref => {
|
|
|
16
14
|
className: cx(css.item, className, isTabActive && css.itemActive)
|
|
17
15
|
}, restProps));
|
|
18
16
|
};
|
|
19
|
-
|
|
20
17
|
Item.defaultProps = {
|
|
21
18
|
isTabActive: false,
|
|
22
19
|
className: '',
|
|
@@ -42,7 +39,6 @@ Tabs.defaultProps = {
|
|
|
42
39
|
Tabs.propTypes = {
|
|
43
40
|
/** Adopted child class name */
|
|
44
41
|
className: PropTypes.string,
|
|
45
|
-
|
|
46
42
|
/** Component children */
|
|
47
43
|
children: PropTypes.node.isRequired
|
|
48
44
|
};
|
|
@@ -23,12 +23,16 @@
|
|
|
23
23
|
background: transparent;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.item:hover
|
|
26
|
+
.item:hover,
|
|
27
|
+
.item:active,
|
|
28
|
+
.item:focus {
|
|
27
29
|
color: var(--color-primary-dark);
|
|
28
30
|
outline: none;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
.item:hover::after
|
|
33
|
+
.item:hover::after,
|
|
34
|
+
.item:active::after,
|
|
35
|
+
.item:focus::after {
|
|
32
36
|
background: currentColor;
|
|
33
37
|
}
|
|
34
38
|
|
package/lib-esm/ui/tag/tag.js
CHANGED
|
@@ -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';
|
|
@@ -50,7 +49,7 @@ Tooltip.propTypes = {
|
|
|
50
49
|
as: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]),
|
|
51
50
|
containerRef: PropTypes.shape({
|
|
52
51
|
current: PropTypes.object // eslint-disable-line react/forbid-prop-types
|
|
53
|
-
|
|
54
52
|
}),
|
|
53
|
+
|
|
55
54
|
darkMode: PropTypes.bool
|
|
56
55
|
};
|
|
@@ -12,9 +12,7 @@ export default {
|
|
|
12
12
|
title: 'View job #123'
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
-
|
|
16
15
|
const Template = props => /*#__PURE__*/React.createElement(Tooltip, props, "Job #123");
|
|
17
|
-
|
|
18
16
|
export const Default = Template.bind();
|
|
19
17
|
export const LongTooltip = Template.bind();
|
|
20
18
|
LongTooltip.args = {
|
package/lib-esm/utils.js
CHANGED
|
@@ -6,18 +6,14 @@ export const getColors = function (count) {
|
|
|
6
6
|
if (count === void 0) {
|
|
7
7
|
count = 2;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
9
|
const chunks = _chunk(COLORS, Math.round(COLORS.length / count));
|
|
11
|
-
|
|
12
10
|
return chunks.map((chunkColors, index) => {
|
|
13
11
|
if (index === 0) {
|
|
14
12
|
return chunkColors[0];
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
if (index === chunks.length - 1) {
|
|
18
15
|
return chunkColors[chunkColors.length - 1];
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
return chunkColors[Math.floor(chunkColors.length / 2)];
|
|
22
18
|
});
|
|
23
19
|
};
|
|
@@ -25,19 +21,16 @@ export const getRenderChildWithClassName = className => child => {
|
|
|
25
21
|
if (child === null || child === '') {
|
|
26
22
|
return null;
|
|
27
23
|
}
|
|
28
|
-
|
|
29
24
|
const {
|
|
30
25
|
props
|
|
31
26
|
} = child;
|
|
32
|
-
|
|
33
27
|
if (!props) {
|
|
34
28
|
return /*#__PURE__*/React.createElement("div", {
|
|
35
29
|
className: className
|
|
36
30
|
}, child);
|
|
37
31
|
}
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
33
|
+
...props,
|
|
40
34
|
className: cx(className, props.className) // eslint-disable-line react/prop-types
|
|
41
|
-
|
|
42
35
|
});
|
|
43
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bundle-stats/ui",
|
|
3
|
-
"version": "4.1.1
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "UI components for BundleStats projects.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -37,27 +37,27 @@
|
|
|
37
37
|
"homepage": "https://github.com/relative-ci/bundle-stats/blob/master/packages/ui#readme",
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@babel/cli": "7.19.3",
|
|
40
|
-
"@babel/core": "7.19.
|
|
40
|
+
"@babel/core": "7.19.6",
|
|
41
41
|
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
42
|
-
"@babel/preset-env": "7.19.
|
|
42
|
+
"@babel/preset-env": "7.19.4",
|
|
43
43
|
"@babel/preset-react": "7.18.6",
|
|
44
44
|
"@simplyianm/babel-plugin-inline-react-svg": "1.2.0",
|
|
45
|
-
"@storybook/addon-essentials": "6.5.
|
|
45
|
+
"@storybook/addon-essentials": "6.5.13",
|
|
46
46
|
"@storybook/addon-knobs": "6.4.0",
|
|
47
47
|
"@storybook/addon-postcss": "2.0.0",
|
|
48
|
-
"@storybook/addon-storyshots": "6.5.
|
|
49
|
-
"@storybook/addons": "6.5.
|
|
50
|
-
"@storybook/builder-webpack5": "6.5.
|
|
51
|
-
"@storybook/manager-webpack5": "6.5.
|
|
52
|
-
"@storybook/react": "6.5.
|
|
48
|
+
"@storybook/addon-storyshots": "6.5.13",
|
|
49
|
+
"@storybook/addons": "6.5.13",
|
|
50
|
+
"@storybook/builder-webpack5": "6.5.13",
|
|
51
|
+
"@storybook/manager-webpack5": "6.5.13",
|
|
52
|
+
"@storybook/react": "6.5.13",
|
|
53
53
|
"babel-core": "7.0.0-bridge.0",
|
|
54
|
-
"babel-jest": "29.1
|
|
54
|
+
"babel-jest": "29.2.1",
|
|
55
55
|
"babel-plugin-lodash": "3.3.4",
|
|
56
56
|
"babel-plugin-require-context-hook": "1.0.0",
|
|
57
|
-
"chromatic": "6.
|
|
57
|
+
"chromatic": "6.11.0",
|
|
58
58
|
"classnames": "2.3.2",
|
|
59
59
|
"colormap": "2.3.2",
|
|
60
|
-
"core-js": "3.
|
|
60
|
+
"core-js": "3.26.0",
|
|
61
61
|
"cross-env": "7.0.3",
|
|
62
62
|
"enzyme": "3.11.0",
|
|
63
63
|
"enzyme-adapter-react-16": "1.15.6",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"jest": "27.5.1",
|
|
68
68
|
"jest-date-mock": "1.0.8",
|
|
69
69
|
"lodash": "4.17.21",
|
|
70
|
-
"postcss": "8.4.
|
|
70
|
+
"postcss": "8.4.18",
|
|
71
71
|
"prop-types": "15.8.1",
|
|
72
72
|
"react": "16.14.0",
|
|
73
73
|
"react-dom": "16.14.0",
|
|
@@ -85,12 +85,12 @@
|
|
|
85
85
|
"react-router-dom": "^5.0.0"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@bundle-stats/utils": "^4.1.1
|
|
88
|
+
"@bundle-stats/utils": "^4.1.1",
|
|
89
89
|
"ariakit": "^2.0.0-next.41",
|
|
90
90
|
"date-fns": "^2.28.0",
|
|
91
91
|
"modern-css-reset": "^1.4.0",
|
|
92
92
|
"query-string": "^7.1.0",
|
|
93
93
|
"use-query-params": "^2.0.0"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "ec3bcf5dcb6e9cf793bcfcf6e2f8f644f168af50"
|
|
96
96
|
}
|