@bundle-stats/ui 3.2.6-beta.1 → 3.2.6-beta.2

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 (80) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/lib/components/bundle-assets/bundle-assets.js +8 -6
  3. package/lib/components/bundle-assets/bundle-assets.module.css +5 -0
  4. package/lib/components/bundle-modules/bundle-modules.js +4 -5
  5. package/lib/components/bundle-packages/bundle-packages.js +6 -4
  6. package/lib/components/bundle-packages/bundle-packages.module.css +4 -0
  7. package/lib/components/metrics-table-title/metrics-table-title.js +9 -7
  8. package/lib/components/metrics-table-title/metrics-table-title.module.css +2 -0
  9. package/lib/components/module-info/module-info.module.css +1 -0
  10. package/lib/components/summary-item/summary-item.js +14 -17
  11. package/lib/components/summary-item/summary-item.module.css +1 -19
  12. package/lib/components/total-size-type-title/total-size-type-title.js +7 -3
  13. package/lib/css/variables.css +1 -1
  14. package/lib/hooks/search-params.js +6 -6
  15. package/lib/ui/dropdown/dropdown.js +15 -24
  16. package/lib/ui/dropdown/dropdown.module.css +7 -7
  17. package/lib/ui/dropdown/dropdown.stories.js +2 -9
  18. package/lib/ui/hover-card/hover-card.js +100 -0
  19. package/lib/ui/hover-card/hover-card.module.css +52 -0
  20. package/lib/ui/hover-card/hover-card.stories.js +56 -0
  21. package/lib/ui/{popover → hover-card}/index.js +4 -4
  22. package/lib/ui/icon/icon.js +6 -6
  23. package/lib/ui/index.js +0 -8
  24. package/lib/ui/tooltip/tooltip.js +10 -9
  25. package/lib-esm/components/bundle-assets/bundle-assets.js +8 -6
  26. package/lib-esm/components/bundle-assets/bundle-assets.module.css +5 -0
  27. package/lib-esm/components/bundle-modules/bundle-modules.js +4 -5
  28. package/lib-esm/components/bundle-packages/bundle-packages.js +6 -4
  29. package/lib-esm/components/bundle-packages/bundle-packages.module.css +4 -0
  30. package/lib-esm/components/metrics-table-title/metrics-table-title.js +8 -7
  31. package/lib-esm/components/metrics-table-title/metrics-table-title.module.css +2 -0
  32. package/lib-esm/components/module-info/module-info.module.css +1 -0
  33. package/lib-esm/components/summary-item/summary-item.js +13 -17
  34. package/lib-esm/components/summary-item/summary-item.module.css +1 -19
  35. package/lib-esm/components/total-size-type-title/total-size-type-title.js +6 -3
  36. package/lib-esm/css/variables.css +1 -1
  37. package/lib-esm/hooks/search-params.js +6 -6
  38. package/lib-esm/ui/dropdown/dropdown.js +14 -23
  39. package/lib-esm/ui/dropdown/dropdown.module.css +7 -7
  40. package/lib-esm/ui/dropdown/dropdown.stories.js +2 -7
  41. package/lib-esm/ui/hover-card/hover-card.js +86 -0
  42. package/lib-esm/ui/hover-card/hover-card.module.css +52 -0
  43. package/lib-esm/ui/hover-card/hover-card.stories.js +35 -0
  44. package/lib-esm/ui/hover-card/index.js +1 -0
  45. package/lib-esm/ui/icon/icon.js +3 -3
  46. package/lib-esm/ui/index.js +0 -1
  47. package/lib-esm/ui/tooltip/tooltip.js +10 -9
  48. package/package.json +5 -5
  49. package/src/components/bundle-assets/bundle-assets.jsx +38 -36
  50. package/src/components/bundle-assets/bundle-assets.module.css +5 -0
  51. package/src/components/bundle-modules/bundle-modules.jsx +24 -14
  52. package/src/components/bundle-packages/bundle-packages.jsx +11 -3
  53. package/src/components/bundle-packages/bundle-packages.module.css +4 -0
  54. package/src/components/metrics-table-title/metrics-table-title.jsx +20 -21
  55. package/src/components/metrics-table-title/metrics-table-title.module.css +2 -0
  56. package/src/components/module-info/module-info.jsx +1 -5
  57. package/src/components/module-info/module-info.module.css +1 -0
  58. package/src/components/summary-item/summary-item.jsx +20 -26
  59. package/src/components/summary-item/summary-item.module.css +1 -19
  60. package/src/components/total-size-type-title/total-size-type-title.jsx +6 -9
  61. package/src/css/variables.css +1 -1
  62. package/src/hooks/search-params.js +18 -11
  63. package/src/ui/dropdown/dropdown.jsx +9 -17
  64. package/src/ui/dropdown/dropdown.module.css +7 -7
  65. package/src/ui/hover-card/hover-card.jsx +79 -0
  66. package/src/ui/hover-card/hover-card.module.css +52 -0
  67. package/src/ui/hover-card/index.js +1 -0
  68. package/src/ui/icon/icon.jsx +11 -7
  69. package/src/ui/index.js +0 -1
  70. package/src/ui/tooltip/tooltip.jsx +10 -14
  71. package/lib/ui/popover/popover.js +0 -92
  72. package/lib/ui/popover/popover.module.css +0 -66
  73. package/lib/ui/popover/popover.stories.js +0 -26
  74. package/lib-esm/ui/popover/index.js +0 -1
  75. package/lib-esm/ui/popover/popover.js +0 -71
  76. package/lib-esm/ui/popover/popover.module.css +0 -66
  77. package/lib-esm/ui/popover/popover.stories.js +0 -14
  78. package/src/ui/popover/index.js +0 -1
  79. package/src/ui/popover/popover.jsx +0 -79
  80. package/src/ui/popover/popover.module.css +0 -66
@@ -1,66 +0,0 @@
1
- .button {
2
- display: inline-flex;
3
- align-items: center;
4
- justify-content: flex-start;
5
- border: none;
6
- outline: none;
7
- padding: 0;
8
- background: none;
9
- color: inherit;
10
- cursor: pointer;
11
- line-height: inherit;
12
- text-align: inherit;
13
- }
14
-
15
- .button:hover,
16
- .button:active,
17
- .button:focus {
18
- color: var(--color-primary);
19
- }
20
-
21
- .button:hover .label {
22
- text-decoration: underline;
23
- }
24
-
25
- .popover {
26
- padding: var(--space-small) var(--space-large) var(--space-small) var(--space-small);
27
- border-radius: var(--radius-small);
28
- max-width: 360px;
29
- outline: none;
30
- filter: drop-shadow(0 0 var(--space-xxxsmall) var(--color-shadow));
31
- background: var(--color-light);
32
- font-size: var(--size-small);
33
- }
34
-
35
- .arrow svg {
36
- display: block;
37
- }
38
-
39
- .arrow :global .fill {
40
- fill: var(--color-light);
41
- }
42
-
43
- .arrow :global .stroke {
44
- fill: var(--color-light);
45
- }
46
-
47
- .closeBtn {
48
- position: absolute;
49
- right: 0;
50
- top: 0;
51
- width: var(--space-large);
52
- height: var(--space-large);
53
- padding: var(--space-xxsmall);
54
- background: none;
55
- border: none;
56
- cursor: pointer;
57
- color: var(--color-text-ultra-light);
58
- transition: var(--transition-out);
59
- }
60
-
61
- .closeBtn:hover,
62
- .closeBtn:active,
63
- .closeBtn:focus {
64
- color: var(--color-text-light);
65
- transition: var(--transition-in);
66
- }
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- var _react = _interopRequireDefault(require("react"));
4
-
5
- var _react2 = require("@storybook/react");
6
-
7
- var _stories = require("../../stories");
8
-
9
- var _ = require(".");
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
-
13
- var stories = (0, _react2.storiesOf)('UI/Popover', module);
14
- stories.addDecorator((0, _stories.getWrapperDecorator)({
15
- padding: '64px'
16
- }));
17
- stories.add('default', function () {
18
- return /*#__PURE__*/_react["default"].createElement(_.Popover, {
19
- label: "Job #100"
20
- }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
21
- });
22
- stories.add('with icon', function () {
23
- return /*#__PURE__*/_react["default"].createElement(_.Popover, {
24
- icon: "help"
25
- }, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
26
- });
@@ -1 +0,0 @@
1
- export * from './popover';
@@ -1,71 +0,0 @@
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); }
2
-
3
- import React, { useCallback } from 'react';
4
- import PropTypes from 'prop-types';
5
- import cx from 'classnames';
6
- import { usePopoverState, Popover as UIPopover, PopoverDisclosure as UIPopoverDisclosure, PopoverArrow as UIPopoverArrow } from 'reakit/Popover';
7
- import { Icon } from '../icon';
8
- import css from './popover.module.css';
9
- export const Popover = _ref => {
10
- let {
11
- className,
12
- icon,
13
- label,
14
- ariaLabel,
15
- children
16
- } = _ref;
17
- const popover = usePopoverState({
18
- baseId: process.env.NODE_ENV === 'test' && 'id-test',
19
- gutter: 12,
20
- modal: true,
21
- placement: 'top'
22
- });
23
- const onCloseButtonClick = useCallback(event => {
24
- event.preventDefault();
25
- popover.toggle();
26
- }, [popover]);
27
- const onButtonClick = useCallback(event => {
28
- event.preventDefault();
29
- popover.toggle();
30
- }, [popover]);
31
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(UIPopoverDisclosure, _extends({
32
- className: cx(css.button, className)
33
- }, popover, {
34
- onClick: onButtonClick,
35
- "aria-label": ariaLabel
36
- }), icon && (typeof icon === 'string' ? /*#__PURE__*/React.createElement(Icon, {
37
- className: css.icon,
38
- glyph: icon
39
- }) : icon), label && /*#__PURE__*/React.createElement("span", {
40
- className: css.label
41
- }, label)), /*#__PURE__*/React.createElement(UIPopover, _extends({
42
- className: css.popover
43
- }, popover, {
44
- tabIndex: 0
45
- }), /*#__PURE__*/React.createElement(UIPopoverArrow, _extends({
46
- className: css.arrow
47
- }, popover, {
48
- size: 16
49
- })), typeof children === 'function' ? children({
50
- popoverToggle: popover.toggle
51
- }) : children, /*#__PURE__*/React.createElement(Icon, {
52
- glyph: "close",
53
- as: "button",
54
- type: "button",
55
- className: css.closeBtn,
56
- onClick: onCloseButtonClick
57
- })));
58
- };
59
- Popover.propTypes = {
60
- className: PropTypes.string,
61
- label: PropTypes.element,
62
- icon: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
63
- children: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]).isRequired,
64
- ariaLabel: PropTypes.string
65
- };
66
- Popover.defaultProps = {
67
- className: '',
68
- icon: '',
69
- label: '',
70
- ariaLabel: 'View more info'
71
- };
@@ -1,66 +0,0 @@
1
- .button {
2
- display: inline-flex;
3
- align-items: center;
4
- justify-content: flex-start;
5
- border: none;
6
- outline: none;
7
- padding: 0;
8
- background: none;
9
- color: inherit;
10
- cursor: pointer;
11
- line-height: inherit;
12
- text-align: inherit;
13
- }
14
-
15
- .button:hover,
16
- .button:active,
17
- .button:focus {
18
- color: var(--color-primary);
19
- }
20
-
21
- .button:hover .label {
22
- text-decoration: underline;
23
- }
24
-
25
- .popover {
26
- padding: var(--space-small) var(--space-large) var(--space-small) var(--space-small);
27
- border-radius: var(--radius-small);
28
- max-width: 360px;
29
- outline: none;
30
- filter: drop-shadow(0 0 var(--space-xxxsmall) var(--color-shadow));
31
- background: var(--color-light);
32
- font-size: var(--size-small);
33
- }
34
-
35
- .arrow svg {
36
- display: block;
37
- }
38
-
39
- .arrow :global .fill {
40
- fill: var(--color-light);
41
- }
42
-
43
- .arrow :global .stroke {
44
- fill: var(--color-light);
45
- }
46
-
47
- .closeBtn {
48
- position: absolute;
49
- right: 0;
50
- top: 0;
51
- width: var(--space-large);
52
- height: var(--space-large);
53
- padding: var(--space-xxsmall);
54
- background: none;
55
- border: none;
56
- cursor: pointer;
57
- color: var(--color-text-ultra-light);
58
- transition: var(--transition-out);
59
- }
60
-
61
- .closeBtn:hover,
62
- .closeBtn:active,
63
- .closeBtn:focus {
64
- color: var(--color-text-light);
65
- transition: var(--transition-in);
66
- }
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { getWrapperDecorator } from '../../stories';
4
- import { Popover } from '.';
5
- const stories = storiesOf('UI/Popover', module);
6
- stories.addDecorator(getWrapperDecorator({
7
- padding: '64px'
8
- }));
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."));
@@ -1 +0,0 @@
1
- export * from './popover';
@@ -1,79 +0,0 @@
1
- import React, { useCallback } from 'react';
2
- import PropTypes from 'prop-types';
3
- import cx from 'classnames';
4
- import {
5
- usePopoverState,
6
- Popover as UIPopover,
7
- PopoverDisclosure as UIPopoverDisclosure,
8
- PopoverArrow as UIPopoverArrow,
9
- } from 'reakit/Popover';
10
-
11
- import { Icon } from '../icon';
12
- import css from './popover.module.css';
13
-
14
- export const Popover = ({ className, icon, label, ariaLabel, children }) => {
15
- const popover = usePopoverState({
16
- baseId: process.env.NODE_ENV === 'test' && 'id-test',
17
- gutter: 12,
18
- modal: true,
19
- placement: 'top',
20
- });
21
-
22
- const onCloseButtonClick = useCallback(
23
- (event) => {
24
- event.preventDefault();
25
- popover.toggle();
26
- },
27
- [popover],
28
- );
29
-
30
- const onButtonClick = useCallback(
31
- (event) => {
32
- event.preventDefault();
33
- popover.toggle();
34
- },
35
- [popover],
36
- );
37
-
38
- return (
39
- <>
40
- <UIPopoverDisclosure
41
- className={cx(css.button, className)}
42
- {...popover}
43
- onClick={onButtonClick}
44
- aria-label={ariaLabel}
45
- >
46
- {icon && (typeof icon === 'string' ? <Icon className={css.icon} glyph={icon} /> : icon)}
47
- {label && <span className={css.label}>{label}</span>}
48
- </UIPopoverDisclosure>
49
- <UIPopover className={css.popover} {...popover} tabIndex={0}>
50
- <UIPopoverArrow className={css.arrow} {...popover} size={16} />
51
-
52
- {typeof children === 'function' ? children({ popoverToggle: popover.toggle }) : children}
53
-
54
- <Icon
55
- glyph="close"
56
- as="button"
57
- type="button"
58
- className={css.closeBtn}
59
- onClick={onCloseButtonClick}
60
- />
61
- </UIPopover>
62
- </>
63
- );
64
- };
65
-
66
- Popover.propTypes = {
67
- className: PropTypes.string,
68
- label: PropTypes.element,
69
- icon: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
70
- children: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.func]).isRequired,
71
- ariaLabel: PropTypes.string,
72
- };
73
-
74
- Popover.defaultProps = {
75
- className: '',
76
- icon: '',
77
- label: '',
78
- ariaLabel: 'View more info',
79
- };
@@ -1,66 +0,0 @@
1
- .button {
2
- display: inline-flex;
3
- align-items: center;
4
- justify-content: flex-start;
5
- border: none;
6
- outline: none;
7
- padding: 0;
8
- background: none;
9
- color: inherit;
10
- cursor: pointer;
11
- line-height: inherit;
12
- text-align: inherit;
13
- }
14
-
15
- .button:hover,
16
- .button:active,
17
- .button:focus {
18
- color: var(--color-primary);
19
- }
20
-
21
- .button:hover .label {
22
- text-decoration: underline;
23
- }
24
-
25
- .popover {
26
- padding: var(--space-small) var(--space-large) var(--space-small) var(--space-small);
27
- border-radius: var(--radius-small);
28
- max-width: 360px;
29
- outline: none;
30
- filter: drop-shadow(0 0 var(--space-xxxsmall) var(--color-shadow));
31
- background: var(--color-light);
32
- font-size: var(--size-small);
33
- }
34
-
35
- .arrow svg {
36
- display: block;
37
- }
38
-
39
- .arrow :global .fill {
40
- fill: var(--color-light);
41
- }
42
-
43
- .arrow :global .stroke {
44
- fill: var(--color-light);
45
- }
46
-
47
- .closeBtn {
48
- position: absolute;
49
- right: 0;
50
- top: 0;
51
- width: var(--space-large);
52
- height: var(--space-large);
53
- padding: var(--space-xxsmall);
54
- background: none;
55
- border: none;
56
- cursor: pointer;
57
- color: var(--color-text-ultra-light);
58
- transition: var(--transition-out);
59
- }
60
-
61
- .closeBtn:hover,
62
- .closeBtn:active,
63
- .closeBtn:focus {
64
- color: var(--color-text-light);
65
- transition: var(--transition-in);
66
- }