@bundle-stats/ui 3.2.1-alpha.0 → 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.
Files changed (53) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/lib/utils.js +6 -3
  3. package/lib-esm/app/app.js +60 -50
  4. package/lib-esm/app/header/header.js +22 -19
  5. package/lib-esm/components/asset-info/asset-info.js +8 -6
  6. package/lib-esm/components/bundle-assets/bundle-assets.js +93 -80
  7. package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +15 -12
  8. package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +6 -5
  9. package/lib-esm/components/bundle-modules/bundle-modules.js +82 -67
  10. package/lib-esm/components/bundle-modules/bundle-modules.utils.js +9 -6
  11. package/lib-esm/components/bundle-modules/index.js +6 -3
  12. package/lib-esm/components/bundle-packages/bundle-packages.js +29 -24
  13. package/lib-esm/components/component-link.js +7 -6
  14. package/lib-esm/components/delta/delta.js +7 -6
  15. package/lib-esm/components/job-meta/job-meta.js +5 -4
  16. package/lib-esm/components/job-name/job-name.js +14 -11
  17. package/lib-esm/components/metric/metric.js +10 -9
  18. package/lib-esm/components/metrics-table/metrics-table.js +24 -20
  19. package/lib-esm/components/metrics-table-options/metrics-table-options.js +7 -5
  20. package/lib-esm/components/summary/summary.js +44 -32
  21. package/lib-esm/components/summary/summary.stories.js +11 -8
  22. package/lib-esm/components/summary-item/summary-item.js +18 -15
  23. package/lib-esm/components/total-size-type-title/total-size-type-title.js +17 -14
  24. package/lib-esm/hooks/rows-filter.js +7 -6
  25. package/lib-esm/hooks/rows-sort.js +8 -7
  26. package/lib-esm/hooks/search-params.js +73 -69
  27. package/lib-esm/layout/footer/footer.js +33 -30
  28. package/lib-esm/layout/header/header.js +17 -14
  29. package/lib-esm/layout/header/header.stories.js +45 -30
  30. package/lib-esm/prototypes/typography.stories.js +5 -4
  31. package/lib-esm/stories/wrapper.js +20 -14
  32. package/lib-esm/ui/container/container.js +12 -9
  33. package/lib-esm/ui/dropdown/dropdown.stories.js +9 -6
  34. package/lib-esm/ui/file-name/file-name.js +10 -7
  35. package/lib-esm/ui/filters/filters.container.js +14 -8
  36. package/lib-esm/ui/filters/filters.js +41 -19
  37. package/lib-esm/ui/filters/filters.stories.js +4 -3
  38. package/lib-esm/ui/filters/filters.utils.js +12 -6
  39. package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.js +7 -6
  40. package/lib-esm/ui/icon/icon.js +16 -13
  41. package/lib-esm/ui/input/input.js +6 -5
  42. package/lib-esm/ui/loader/loader.js +10 -7
  43. package/lib-esm/ui/logo/logo.js +7 -6
  44. package/lib-esm/ui/logo/logo.stories.js +7 -1
  45. package/lib-esm/ui/panels/panels.js +10 -7
  46. package/lib-esm/ui/popover/popover.js +8 -7
  47. package/lib-esm/ui/sort-dropdown/sort-dropdown.js +10 -7
  48. package/lib-esm/ui/table/table.js +8 -7
  49. package/lib-esm/ui/tabs/tabs.js +9 -6
  50. package/lib-esm/ui/toolbar/toolbar.stories.js +10 -7
  51. package/lib-esm/utils.js +13 -4
  52. package/package.json +14 -14
  53. package/src/utils.jsx +5 -3
@@ -65,34 +65,51 @@ const FilterGroup = props => {
65
65
  ...groupData
66
66
  } = data;
67
67
  const groupItems = Object.entries(groupData);
68
- const groupCheckboxes = groupItems.filter(([itemKey, item]) => typeof (item == null ? void 0 : item.defaultValue) !== 'undefined');
69
- const isGroupChecked = groupCheckboxes.map(([itemKey]) => _get(values, `${groupKey}.${itemKey}`)).reduce((agg, val) => agg && val, true);
68
+ const groupCheckboxes = groupItems.filter(_ref => {
69
+ let [itemKey, item] = _ref;
70
+ return typeof (item == null ? void 0 : item.defaultValue) !== 'undefined';
71
+ });
72
+ const isGroupChecked = groupCheckboxes.map(_ref2 => {
73
+ let [itemKey] = _ref2;
74
+ return _get(values, `${groupKey}.${itemKey}`);
75
+ }).reduce((agg, val) => agg && val, true);
70
76
  const filterSuffix = getGroupFiltersLabelSuffix(groupItems);
71
77
  const hasCustomFilterSuffix = !Object.values(LABELS).includes(filterSuffix);
72
78
  const dropdownLabel = /*#__PURE__*/React.createElement(React.Fragment, null, `${groupLabel}:`, "\xA0", /*#__PURE__*/React.createElement("span", {
73
79
  className: cx(hasCustomFilterSuffix && css.labelSuffixCustom)
74
80
  }, filterSuffix));
75
81
 
76
- const getOnGroupCheck = (value, overrides = {}) => () => {
77
- const newFilters = groupCheckboxes.reduce((agg, [itemKey]) => ({ ...agg,
78
- [`${groupKey}.${itemKey}`]: value
79
- }), {});
80
- toggleFilters({ ...newFilters,
81
- ...overrides
82
- });
82
+ const getOnGroupCheck = function (value, overrides) {
83
+ if (overrides === void 0) {
84
+ overrides = {};
85
+ }
86
+
87
+ return () => {
88
+ const newFilters = groupCheckboxes.reduce((agg, _ref3) => {
89
+ let [itemKey] = _ref3;
90
+ return { ...agg,
91
+ [`${groupKey}.${itemKey}`]: value
92
+ };
93
+ }, {});
94
+ toggleFilters({ ...newFilters,
95
+ ...overrides
96
+ });
97
+ };
83
98
  };
84
99
 
85
100
  return /*#__PURE__*/React.createElement(Dropdown, {
86
101
  label: dropdownLabel,
87
102
  ariaLabel: `${groupLabel}: ${filterSuffix}`
88
- }, ({
89
- MenuItem,
90
- menu,
91
- menuItemClassName
92
- }) => {
103
+ }, _ref4 => {
104
+ let {
105
+ MenuItem,
106
+ menu,
107
+ menuItemClassName
108
+ } = _ref4;
93
109
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
94
110
  className: css.filterGroupItems
95
- }, groupItems.map(([itemKey, itemData]) => {
111
+ }, groupItems.map(_ref5 => {
112
+ let [itemKey, itemData] = _ref5;
96
113
  const id = [groupKey, itemKey].join('.');
97
114
 
98
115
  const getOnOnlyClick = () => getOnGroupCheck(false, {
@@ -147,16 +164,21 @@ export const Filters = props => {
147
164
  toggleFilters
148
165
  } = props;
149
166
 
150
- const onCheckboxChange = ({
151
- target
152
- }) => toggleFilter(target.name, target.checked);
167
+ const onCheckboxChange = _ref6 => {
168
+ let {
169
+ target
170
+ } = _ref6;
171
+ return toggleFilter(target.name, target.checked);
172
+ };
153
173
 
154
174
  const rootClassName = cx(css.root, className);
155
175
  return /*#__PURE__*/React.createElement("form", {
156
176
  className: rootClassName
157
177
  }, /*#__PURE__*/React.createElement(FlexStack, {
158
178
  className: css.items
159
- }, Object.entries(filters).map(([name, data]) => {
179
+ }, Object.entries(filters).map(_ref7 => {
180
+ let [name, data] = _ref7;
181
+
160
182
  if (typeof (data == null ? void 0 : data.defaultValue) !== 'undefined') {
161
183
  return /*#__PURE__*/React.createElement(Filter, {
162
184
  key: name,
@@ -8,9 +8,10 @@ stories.addDecorator(getWrapperDecorator({
8
8
  paddingLeft: '200px'
9
9
  }));
10
10
 
11
- const FiltersState = ({
12
- children
13
- }) => {
11
+ const FiltersState = _ref => {
12
+ let {
13
+ children
14
+ } = _ref;
14
15
  const [values, setValues] = useState({
15
16
  changed: true,
16
17
  'assetType.entrypoint': true
@@ -13,9 +13,12 @@ export const LABELS = {
13
13
  export const getGroupFiltersLabelSuffix = filters => {
14
14
  const filterCount = filters.length; // eslint-disable-next-line no-unused-vars
15
15
 
16
- const checkedFilters = filters.filter(([_, {
17
- defaultValue
18
- }]) => defaultValue);
16
+ const checkedFilters = filters.filter(_ref => {
17
+ let [_, {
18
+ defaultValue
19
+ }] = _ref;
20
+ return defaultValue;
21
+ });
19
22
  const filterCheckedCount = checkedFilters.length;
20
23
 
21
24
  if (filterCheckedCount === 0) {
@@ -27,9 +30,12 @@ export const getGroupFiltersLabelSuffix = filters => {
27
30
  } // eslint-disable-next-line no-unused-vars
28
31
 
29
32
 
30
- const checkedFilterLabels = checkedFilters.map(([_, {
31
- label
32
- }]) => label);
33
+ const checkedFilterLabels = checkedFilters.map(_ref2 => {
34
+ let [_, {
35
+ label
36
+ }] = _ref2;
37
+ return label;
38
+ });
33
39
  let suffix = '';
34
40
  let inlinedLabelCount = 0;
35
41
  let done = false;
@@ -110,12 +110,13 @@ export const HorizontalBarChart = props => {
110
110
  }, []);
111
111
  return /*#__PURE__*/React.createElement("div", {
112
112
  className: cx(css.root, className)
113
- }, entries.map(({
114
- color,
115
- getItemTooltip,
116
- label,
117
- width
118
- }, index) => {
113
+ }, entries.map((_ref, index) => {
114
+ let {
115
+ color,
116
+ getItemTooltip,
117
+ label,
118
+ width
119
+ } = _ref;
119
120
  const key = index;
120
121
  return /*#__PURE__*/React.createElement(HorizontalBarChartItem, {
121
122
  key: key,
@@ -16,19 +16,22 @@ const ICONS = {
16
16
  SORT: 'sort',
17
17
  WARNING: 'warning'
18
18
  };
19
- export const Icon = ({
20
- className,
21
- glyph,
22
- as: Component,
23
- size,
24
- ...restProps
25
- }) => /*#__PURE__*/React.createElement(Component, _extends({
26
- className: cx(css.root, className, css[size])
27
- }, restProps), /*#__PURE__*/React.createElement("svg", {
28
- className: css.icon
29
- }, /*#__PURE__*/React.createElement("use", {
30
- xlinkHref: `#${glyph}`
31
- })));
19
+ export const Icon = _ref => {
20
+ let {
21
+ className,
22
+ glyph,
23
+ as: Component,
24
+ size,
25
+ ...restProps
26
+ } = _ref;
27
+ return /*#__PURE__*/React.createElement(Component, _extends({
28
+ className: cx(css.root, className, css[size])
29
+ }, restProps), /*#__PURE__*/React.createElement("svg", {
30
+ className: css.icon
31
+ }, /*#__PURE__*/React.createElement("use", {
32
+ xlinkHref: `#${glyph}`
33
+ })));
34
+ };
32
35
  Icon.ICONS = ICONS;
33
36
  Icon.SIZE_SMALL = 'small';
34
37
  Icon.SIZE_MEDIUM = 'medium';
@@ -4,11 +4,12 @@ import React from 'react';
4
4
  import cx from 'classnames';
5
5
  import PropTypes from 'prop-types';
6
6
  import css from './input.module.css';
7
- export const Input = ({
8
- className,
9
- size,
10
- ...restProps
11
- }) => {
7
+ export const Input = _ref => {
8
+ let {
9
+ className,
10
+ size,
11
+ ...restProps
12
+ } = _ref;
12
13
  const rootClassName = cx(css.root, className, css[size]);
13
14
  return /*#__PURE__*/React.createElement("input", _extends({
14
15
  className: rootClassName
@@ -4,13 +4,16 @@ import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import cx from 'classnames';
6
6
  import css from './loader.module.css';
7
- export const Loader = ({
8
- className,
9
- size,
10
- ...restProps
11
- }) => /*#__PURE__*/React.createElement("span", _extends({
12
- className: cx(css.root, className, css[size])
13
- }, restProps));
7
+ export const Loader = _ref => {
8
+ let {
9
+ className,
10
+ size,
11
+ ...restProps
12
+ } = _ref;
13
+ return /*#__PURE__*/React.createElement("span", _extends({
14
+ className: cx(css.root, className, css[size])
15
+ }, restProps));
16
+ };
14
17
  Loader.SIZE_SMALL = 'small';
15
18
  Loader.SIZE_MEDIUM = 'medium';
16
19
  Loader.SIZE_LARGE = 'large';
@@ -78,12 +78,13 @@ const ICONS = {
78
78
  [KIND_LOGO]: LogoSvg,
79
79
  [KIND_WEBPACK]: WebpackSvg
80
80
  };
81
- export const Logo = ({
82
- className,
83
- as: Component,
84
- kind,
85
- ...props
86
- }) => {
81
+ export const Logo = _ref => {
82
+ let {
83
+ className,
84
+ as: Component,
85
+ kind,
86
+ ...props
87
+ } = _ref;
87
88
  const rootClassName = cx(css.root, css[kind], className);
88
89
  const Svg = ICONS[kind] || LogoSvg;
89
90
  return /*#__PURE__*/React.createElement(Component, _extends({
@@ -5,7 +5,13 @@ import { getWrapperDecorator } from '../../stories';
5
5
  import { KIND_DEFAULT, KIND_LOGOTYPE, KINDS } from './logo.constants';
6
6
  import { Logo } from '.';
7
7
 
8
- const selectKind = (value = KIND_DEFAULT) => select('Kind', KINDS, value);
8
+ const selectKind = function (value) {
9
+ if (value === void 0) {
10
+ value = KIND_DEFAULT;
11
+ }
12
+
13
+ return select('Kind', KINDS, value);
14
+ };
9
15
 
10
16
  const stories = storiesOf('UI/Logo', module);
11
17
  stories.addDecorator(getWrapperDecorator());
@@ -15,13 +15,16 @@ const cloneElement = element => {
15
15
  });
16
16
  };
17
17
 
18
- export const Panels = ({
19
- className,
20
- children,
21
- ...restProps
22
- }) => /*#__PURE__*/React.createElement("div", _extends({
23
- className: cx(css.root, className)
24
- }, restProps), React.Children.map(children, cloneElement));
18
+ export const Panels = _ref => {
19
+ let {
20
+ className,
21
+ children,
22
+ ...restProps
23
+ } = _ref;
24
+ return /*#__PURE__*/React.createElement("div", _extends({
25
+ className: cx(css.root, className)
26
+ }, restProps), React.Children.map(children, cloneElement));
27
+ };
25
28
  Panels.defaultProps = {
26
29
  className: '',
27
30
  children: null
@@ -6,13 +6,14 @@ 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 const Popover = ({
10
- className,
11
- icon,
12
- label,
13
- ariaLabel,
14
- children
15
- }) => {
9
+ export const Popover = _ref => {
10
+ let {
11
+ className,
12
+ icon,
13
+ label,
14
+ ariaLabel,
15
+ children
16
+ } = _ref;
16
17
  const popover = usePopoverState({
17
18
  baseId: process.env.NODE_ENV === 'test' && 'id-test',
18
19
  gutter: 24,
@@ -22,12 +22,14 @@ export const SortDropdown = props => {
22
22
  label: customLabel,
23
23
  glyph: "sort",
24
24
  align: "right"
25
- }, ({
26
- MenuItem,
27
- menu,
28
- menuItemClassName,
29
- menuItemActiveClassName
30
- }) => {
25
+ }, _ref => {
26
+ let {
27
+ MenuItem,
28
+ menu,
29
+ menuItemClassName,
30
+ menuItemActiveClassName
31
+ } = _ref;
32
+
31
33
  const getButtonOnClick = (newField, newDirection) => () => {
32
34
  onChange({
33
35
  field: newField,
@@ -38,7 +40,8 @@ export const SortDropdown = props => {
38
40
 
39
41
  return /*#__PURE__*/React.createElement("div", {
40
42
  className: css.items
41
- }, Object.entries(fields).map(([key, item]) => {
43
+ }, Object.entries(fields).map(_ref2 => {
44
+ let [key, item] = _ref2;
42
45
  const buttonProps = direction === 'asc' ? {
43
46
  className: css.itemAsc,
44
47
  onClick: getButtonOnClick(key, 'desc'),
@@ -62,13 +62,14 @@ Td.propTypes = {
62
62
  /** Adopted child class name */
63
63
  className: PropTypes.string
64
64
  };
65
- export const Table = ({
66
- className,
67
- emptyMessage,
68
- compact,
69
- outline,
70
- children
71
- }) => {
65
+ export const Table = _ref => {
66
+ let {
67
+ className,
68
+ emptyMessage,
69
+ compact,
70
+ outline,
71
+ children
72
+ } = _ref;
72
73
  const rootClassName = cx(css.root, className, compact && css.compact, outline && css.outline);
73
74
 
74
75
  if (!children) {
@@ -14,12 +14,15 @@ const cloneElement = element => {
14
14
  });
15
15
  };
16
16
 
17
- export const Tabs = ({
18
- className,
19
- children
20
- }) => /*#__PURE__*/React.createElement("nav", {
21
- className: cx(css.root, className)
22
- }, React.Children.map(children, cloneElement));
17
+ export const Tabs = _ref => {
18
+ let {
19
+ className,
20
+ children
21
+ } = _ref;
22
+ return /*#__PURE__*/React.createElement("nav", {
23
+ className: cx(css.root, className)
24
+ }, React.Children.map(children, cloneElement));
25
+ };
23
26
  Tabs.defaultProps = {
24
27
  className: ''
25
28
  };
@@ -6,11 +6,14 @@ const stories = storiesOf('UI/Toolbar', module);
6
6
  stories.addDecorator(getWrapperDecorator());
7
7
  stories.add('default', () => /*#__PURE__*/React.createElement(Toolbar, null, /*#__PURE__*/React.createElement("div", null, "Content")));
8
8
  stories.add('with actions', () => /*#__PURE__*/React.createElement(Toolbar, {
9
- renderActions: ({
10
- actionClassName
11
- }) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
12
- className: actionClassName
13
- }, "Action 1"), /*#__PURE__*/React.createElement("div", {
14
- className: actionClassName
15
- }, "Action 2"))
9
+ renderActions: _ref => {
10
+ let {
11
+ actionClassName
12
+ } = _ref;
13
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
14
+ className: actionClassName
15
+ }, "Action 1"), /*#__PURE__*/React.createElement("div", {
16
+ className: actionClassName
17
+ }, "Action 2"));
18
+ }
16
19
  }, "Content"));
package/lib-esm/utils.js CHANGED
@@ -2,7 +2,11 @@ import _chunk from "lodash/chunk";
2
2
  import React from 'react';
3
3
  import cx from 'classnames';
4
4
  import COLORS from './chart-colors.json';
5
- export const getColors = (count = 2) => {
5
+ export const getColors = function (count) {
6
+ if (count === void 0) {
7
+ count = 2;
8
+ }
9
+
6
10
  const chunks = _chunk(COLORS, Math.round(COLORS.length / count));
7
11
 
8
12
  return chunks.map((chunkColors, index) => {
@@ -22,13 +26,18 @@ export const getRenderChildWithClassName = className => child => {
22
26
  return null;
23
27
  }
24
28
 
25
- if (!(child != null && child.props)) {
29
+ const {
30
+ props
31
+ } = child;
32
+
33
+ if (!props) {
26
34
  return /*#__PURE__*/React.createElement("div", {
27
35
  className: className
28
36
  }, child);
29
37
  }
30
38
 
31
- return /*#__PURE__*/React.cloneElement(child, { ...child.props,
32
- className: cx(className, child.props.className)
39
+ return /*#__PURE__*/React.cloneElement(child, { ...props,
40
+ className: cx(className, props.className) // eslint-disable-line react/prop-types
41
+
33
42
  });
34
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bundle-stats/ui",
3
- "version": "3.2.1-alpha.0",
3
+ "version": "3.2.1-beta.3",
4
4
  "description": "UI components for BundleStats projects.",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-esm/index.js",
@@ -36,30 +36,30 @@
36
36
  },
37
37
  "homepage": "https://github.com/relative-ci/bundle-stats/blob/master/packages/ui#readme",
38
38
  "devDependencies": {
39
- "@babel/cli": "7.15.7",
40
- "@babel/core": "7.15.8",
41
- "@babel/preset-env": "7.15.8",
42
- "@babel/preset-react": "7.14.5",
39
+ "@babel/cli": "7.16.0",
40
+ "@babel/core": "7.16.0",
41
+ "@babel/preset-env": "7.16.4",
42
+ "@babel/preset-react": "7.16.0",
43
43
  "@simplyianm/babel-plugin-inline-react-svg": "1.2.0",
44
44
  "@storybook/addon-knobs": "6.3.1",
45
- "@storybook/addon-storyshots": "6.2.9",
46
- "@storybook/addons": "6.2.9",
47
- "@storybook/react": "6.2.9",
45
+ "@storybook/addon-storyshots": "6.3.12",
46
+ "@storybook/addons": "6.3.12",
47
+ "@storybook/react": "6.3.12",
48
48
  "babel-core": "7.0.0-bridge.0",
49
- "babel-jest": "26.6.3",
49
+ "babel-jest": "27.3.1",
50
50
  "babel-plugin-lodash": "3.3.4",
51
51
  "babel-plugin-require-context-hook": "1.0.0",
52
- "chromatic": "6.0.5",
52
+ "chromatic": "6.0.6",
53
53
  "classnames": "2.3.1",
54
54
  "colormap": "2.3.2",
55
- "core-js": "3.19.0",
55
+ "core-js": "3.19.1",
56
56
  "cross-env": "7.0.3",
57
57
  "enzyme": "3.11.0",
58
58
  "enzyme-adapter-react-16": "1.15.6",
59
59
  "enzyme-to-json": "3.6.2",
60
60
  "hex-rgb": "5.0.0",
61
61
  "identity-obj-proxy": "3.0.0",
62
- "jest": "26.6.3",
62
+ "jest": "27.3.1",
63
63
  "jest-date-mock": "1.0.8",
64
64
  "lodash": "4.17.21",
65
65
  "prop-types": "15.7.2",
@@ -79,11 +79,11 @@
79
79
  "react-router-dom": "^5.3.0"
80
80
  },
81
81
  "dependencies": {
82
- "@bundle-stats/utils": "^3.2.1-alpha.0",
82
+ "@bundle-stats/utils": "^3.2.1-beta.3",
83
83
  "date-fns": "^2.6.0",
84
84
  "query-string": "^7.0.0",
85
85
  "reakit": "^1.3.6",
86
86
  "use-query-params": "^1.2.2"
87
87
  },
88
- "gitHead": "fdb4b6931ebbc35ad469608725603cde5ecab9b7"
88
+ "gitHead": "dc8af1ca0a607ef6443ceaa9311b2c0ae1e0037b"
89
89
  }
package/src/utils.jsx CHANGED
@@ -25,12 +25,14 @@ export const getRenderChildWithClassName = (className) => (child) => {
25
25
  return null;
26
26
  }
27
27
 
28
- if (!child?.props) {
28
+ const { props } = child;
29
+
30
+ if (!props) {
29
31
  return <div className={className}>{child}</div>;
30
32
  }
31
33
 
32
34
  return React.cloneElement(child, {
33
- ...child.props,
34
- className: cx(className, child.props.className),
35
+ ...props,
36
+ className: cx(className, props.className), // eslint-disable-line react/prop-types
35
37
  });
36
38
  };