@spaced-out/ui-design-system 0.1.15 → 0.1.17

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 (102) hide show
  1. package/.cspell/custom-words.txt +3 -0
  2. package/.flowconfig +1 -1
  3. package/CHANGELOG.md +15 -0
  4. package/CONTRIBUTING.md +52 -6
  5. package/README.md +144 -8
  6. package/gulpfile.js +1 -0
  7. package/lib/components/Avatar/Avatar.module.css +8 -2
  8. package/lib/components/AvatarGroup/AvatarGroup.js +25 -14
  9. package/lib/components/AvatarGroup/AvatarGroup.js.flow +118 -103
  10. package/lib/components/Badge/Badge.js +4 -3
  11. package/lib/components/Badge/Badge.js.flow +21 -21
  12. package/lib/components/Badge/index.js +11 -7
  13. package/lib/components/Badge/index.js.flow +1 -2
  14. package/lib/components/Banner/Banner.js +3 -2
  15. package/lib/components/Banner/Banner.js.flow +42 -35
  16. package/lib/components/Button/Button.js +50 -10
  17. package/lib/components/Button/Button.js.flow +87 -23
  18. package/lib/components/Button/Button.module.css +14 -0
  19. package/lib/components/ButtonTabs/ButtonTab/ButtonTab.js +3 -2
  20. package/lib/components/ButtonTabs/ButtonTab/ButtonTab.js.flow +48 -38
  21. package/lib/components/ButtonTabs/ButtonTabs.js +3 -2
  22. package/lib/components/ButtonTabs/ButtonTabs.js.flow +50 -41
  23. package/lib/components/Card/Card.js +16 -7
  24. package/lib/components/Card/Card.js.flow +73 -55
  25. package/lib/components/Checkbox/Checkbox.js +15 -10
  26. package/lib/components/Checkbox/Checkbox.js.flow +121 -100
  27. package/lib/components/Checkbox/Checkbox.module.css +4 -1
  28. package/lib/components/Checkbox/CheckboxGroup.js +4 -3
  29. package/lib/components/Checkbox/CheckboxGroup.js.flow +76 -65
  30. package/lib/components/Chip/Chip.js +3 -2
  31. package/lib/components/Chip/Chip.js.flow +66 -59
  32. package/lib/components/CircularLoader/CircularLoader.js +9 -4
  33. package/lib/components/CircularLoader/CircularLoader.js.flow +38 -24
  34. package/lib/components/CollapsibleCard/CollapsibleCard.js +4 -3
  35. package/lib/components/CollapsibleCard/CollapsibleCard.js.flow +68 -59
  36. package/lib/components/Dropdown/Dropdown.js +4 -3
  37. package/lib/components/Dropdown/Dropdown.js.flow +83 -74
  38. package/lib/components/EmptyState/EmptyState.js +4 -3
  39. package/lib/components/EmptyState/EmptyState.js.flow +53 -44
  40. package/lib/components/ErrorMessage/ErrorMessage.js +4 -3
  41. package/lib/components/ErrorMessage/ErrorMessage.js.flow +58 -49
  42. package/lib/components/InContextAlert/InContextAlert.js +4 -3
  43. package/lib/components/InContextAlert/InContextAlert.js.flow +79 -73
  44. package/lib/components/InlineDropdown/InlineDropdown.js +4 -3
  45. package/lib/components/InlineDropdown/InlineDropdown.js.flow +94 -85
  46. package/lib/components/LinearLoader/LinearLoader.js +4 -3
  47. package/lib/components/LinearLoader/LinearLoader.js.flow +20 -18
  48. package/lib/components/Link/Link.js +8 -1
  49. package/lib/components/Link/Link.js.flow +44 -36
  50. package/lib/components/Notification/Notification.js +8 -6
  51. package/lib/components/Notification/Notification.js.flow +96 -84
  52. package/lib/components/OptionButton/OptionButton.js +7 -4
  53. package/lib/components/OptionButton/OptionButton.js.flow +69 -59
  54. package/lib/components/PageTitle/PageTitle.js +4 -3
  55. package/lib/components/PageTitle/PageTitle.js.flow +46 -44
  56. package/lib/components/Pagination/PaginationItem.js +2 -2
  57. package/lib/components/Pagination/PaginationItem.js.flow +2 -2
  58. package/lib/components/RadioButton/RadioButton.js +15 -9
  59. package/lib/components/RadioButton/RadioButton.js.flow +91 -70
  60. package/lib/components/RadioButton/RadioButton.module.css +4 -1
  61. package/lib/components/RadioButton/RadioGroup.js +4 -3
  62. package/lib/components/RadioButton/RadioGroup.js.flow +56 -47
  63. package/lib/components/SearchInput/SearchInput.js +3 -2
  64. package/lib/components/SearchInput/SearchInput.js.flow +59 -50
  65. package/lib/components/SideMenuLink/SideMenuLink.js +4 -3
  66. package/lib/components/SideMenuLink/SideMenuLink.js.flow +54 -45
  67. package/lib/components/StatusIndicator/StatusIndicator.js +3 -2
  68. package/lib/components/StatusIndicator/StatusIndicator.js.flow +32 -23
  69. package/lib/components/SubMenu/SubMenu.js +4 -3
  70. package/lib/components/SubMenu/SubMenu.js.flow +41 -38
  71. package/lib/components/Table/StaticTable.js +3 -0
  72. package/lib/components/Table/StaticTable.js.flow +3 -0
  73. package/lib/components/Table/Table.js +10 -0
  74. package/lib/components/Table/Table.js.flow +10 -0
  75. package/lib/components/Table/hooks.js +1 -0
  76. package/lib/components/Table/hooks.js.flow +1 -0
  77. package/lib/components/Tabs/TabList/TabList.js +3 -2
  78. package/lib/components/Tabs/TabList/TabList.js.flow +127 -117
  79. package/lib/components/Toast/Toast.js +8 -10
  80. package/lib/components/Toast/Toast.js.flow +19 -27
  81. package/lib/components/Toast/Toast.module.css +8 -0
  82. package/lib/components/Toggle/Toggle.js +11 -7
  83. package/lib/components/Toggle/Toggle.js.flow +16 -12
  84. package/lib/components/Toggle/Toggle.module.css +2 -0
  85. package/lib/components/Toggle/index.js +11 -7
  86. package/lib/components/Toggle/index.js.flow +1 -1
  87. package/lib/components/Tooltip/Tooltip.js.flow +2 -2
  88. package/lib/components/index.js +511 -0
  89. package/lib/components/index.js.flow +48 -0
  90. package/lib/index.js +60 -0
  91. package/lib/index.js.flow +7 -0
  92. package/lib/styles/index.css +15 -0
  93. package/lib/styles/index.js +104 -0
  94. package/lib/styles/index.js.flow +12 -0
  95. package/lib/styles/typography.module.css +0 -1
  96. package/lib/styles/utils.module.css +26 -0
  97. package/lib/types/index.js +38 -0
  98. package/lib/types/index.js.flow +5 -0
  99. package/lib/utils/click-away.js.flow +1 -1
  100. package/lib/utils/index.js +93 -0
  101. package/lib/utils/index.js.flow +10 -0
  102. package/package.json +2 -1
@@ -34,53 +34,62 @@ export type ErrorMessageProps = {
34
34
  ...
35
35
  };
36
36
 
37
- export const ErrorMessage = ({
38
- classNames,
39
- children,
40
- imageVariant,
41
- title,
42
- description,
43
- customImageUrl,
44
- heading,
45
- ...props
46
- }: ErrorMessageProps): React.Node => (
47
- <div
48
- {...props}
49
- data-testid="ErrorMessage"
50
- className={classify(css.wrapper, classNames?.wrapper)}
51
- >
52
- {!!imageVariant && !customImageUrl && (
53
- <div className={classify(css.image, classNames?.image)}>
54
- {imageVariant === 'unauthorized' && <UnauthorizedImage />}
55
- {imageVariant === 'forbidden' && <ForbiddenImage />}
56
- {imageVariant === 'notFound' && <NotFoundImage />}
57
- {imageVariant === 'serverError' && <ServerErrorImage />}
58
- </div>
59
- )}
60
- {customImageUrl && (
61
- <img
62
- className={classify(css.image, classNames?.image)}
63
- src={customImageUrl}
64
- alt="Empty State"
65
- />
66
- )}
67
- {!!heading && (
68
- <div className={classify(css.heading, classNames?.heading)}>
69
- {heading}
70
- </div>
71
- )}
72
- {!!title && (
73
- <div className={classify(css.title, classNames?.title)}>{title}</div>
74
- )}
75
- {!!description && (
76
- <div className={classify(css.description, classNames?.description)}>
77
- {description}
78
- </div>
79
- )}
80
- {!!children && (
81
- <div className={classify(css.childrenWrapper, classNames?.children)}>
82
- {children}
83
- </div>
84
- )}
85
- </div>
37
+ export const ErrorMessage: React$AbstractComponent<
38
+ ErrorMessageProps,
39
+ HTMLDivElement,
40
+ > = React.forwardRef<ErrorMessageProps, HTMLDivElement>(
41
+ (
42
+ {
43
+ classNames,
44
+ children,
45
+ imageVariant,
46
+ title,
47
+ description,
48
+ customImageUrl,
49
+ heading,
50
+ ...props
51
+ }: ErrorMessageProps,
52
+ ref,
53
+ ): React.Node => (
54
+ <div
55
+ {...props}
56
+ data-testid="ErrorMessage"
57
+ className={classify(css.wrapper, classNames?.wrapper)}
58
+ ref={ref}
59
+ >
60
+ {!!imageVariant && !customImageUrl && (
61
+ <div className={classify(css.image, classNames?.image)}>
62
+ {imageVariant === 'unauthorized' && <UnauthorizedImage />}
63
+ {imageVariant === 'forbidden' && <ForbiddenImage />}
64
+ {imageVariant === 'notFound' && <NotFoundImage />}
65
+ {imageVariant === 'serverError' && <ServerErrorImage />}
66
+ </div>
67
+ )}
68
+ {customImageUrl && (
69
+ <img
70
+ className={classify(css.image, classNames?.image)}
71
+ src={customImageUrl}
72
+ alt="Empty State"
73
+ />
74
+ )}
75
+ {!!heading && (
76
+ <div className={classify(css.heading, classNames?.heading)}>
77
+ {heading}
78
+ </div>
79
+ )}
80
+ {!!title && (
81
+ <div className={classify(css.title, classNames?.title)}>{title}</div>
82
+ )}
83
+ {!!description && (
84
+ <div className={classify(css.description, classNames?.description)}>
85
+ {description}
86
+ </div>
87
+ )}
88
+ {!!children && (
89
+ <div className={classify(css.childrenWrapper, classNames?.children)}>
90
+ {children}
91
+ </div>
92
+ )}
93
+ </div>
94
+ ),
86
95
  );
@@ -75,7 +75,7 @@ const AlertIcon = _ref => {
75
75
  });
76
76
  }
77
77
  };
78
- const InContextAlert = props => {
78
+ const InContextAlert = /*#__PURE__*/React.forwardRef((props, ref) => {
79
79
  const {
80
80
  classNames,
81
81
  semantic = ALERT_SEMANTIC.neutral,
@@ -100,7 +100,8 @@ const InContextAlert = props => {
100
100
  [_InContextAlertModule.default.information]: semantic === ALERT_SEMANTIC.information,
101
101
  [_InContextAlertModule.default.warning]: semantic === ALERT_SEMANTIC.warning,
102
102
  [_InContextAlertModule.default.danger]: semantic === ALERT_SEMANTIC.danger
103
- }, classNames?.wrapper)
103
+ }, classNames?.wrapper),
104
+ ref: ref
104
105
  }, /*#__PURE__*/React.createElement(AlertIcon, {
105
106
  semantic: semantic,
106
107
  leftIconName: leftIconName,
@@ -122,5 +123,5 @@ const InContextAlert = props => {
122
123
  onClick: closeClickHandler,
123
124
  className: _InContextAlertModule.default.closeIcon
124
125
  }))));
125
- };
126
+ });
126
127
  exports.InContextAlert = InContextAlert;
@@ -120,77 +120,83 @@ const AlertIcon = ({
120
120
  }
121
121
  };
122
122
 
123
- export const InContextAlert = (props: InContextAlertProps): React.Node => {
124
- const {
125
- classNames,
126
- semantic = ALERT_SEMANTIC.neutral,
127
- dismissable,
128
- children,
129
- selfDismiss = false,
130
- leftIconName = '',
131
- onCloseClick,
132
- actionText = '',
133
- onAction,
134
- leftIconType,
135
- } = props;
136
- const [dismissed, setDismissed] = React.useState(false);
137
- const closeClickHandler = (e) => {
138
- onCloseClick && onCloseClick(e);
139
- selfDismiss && setDismissed(true);
140
- };
123
+ export const InContextAlert: React$AbstractComponent<
124
+ InContextAlertProps,
125
+ HTMLDivElement,
126
+ > = React.forwardRef<InContextAlertProps, HTMLDivElement>(
127
+ (props: InContextAlertProps, ref): React.Node => {
128
+ const {
129
+ classNames,
130
+ semantic = ALERT_SEMANTIC.neutral,
131
+ dismissable,
132
+ children,
133
+ selfDismiss = false,
134
+ leftIconName = '',
135
+ onCloseClick,
136
+ actionText = '',
137
+ onAction,
138
+ leftIconType,
139
+ } = props;
140
+ const [dismissed, setDismissed] = React.useState(false);
141
+ const closeClickHandler = (e) => {
142
+ onCloseClick && onCloseClick(e);
143
+ selfDismiss && setDismissed(true);
144
+ };
141
145
 
142
- return (
143
- <>
144
- {!dismissed && (
145
- <div
146
- className={classify(
147
- css.alertContainer,
148
- {
149
- [css.neutral]: semantic === ALERT_SEMANTIC.neutral,
150
- [css.success]: semantic === ALERT_SEMANTIC.success,
151
- [css.information]: semantic === ALERT_SEMANTIC.information,
152
- [css.warning]: semantic === ALERT_SEMANTIC.warning,
153
- [css.danger]: semantic === ALERT_SEMANTIC.danger,
154
- },
155
- classNames?.wrapper,
156
- )}
157
- >
158
- <AlertIcon
159
- semantic={semantic}
160
- leftIconName={leftIconName}
161
- leftIconType={leftIconType}
162
- />
163
- {React.Children.count(children) > 0 && (
164
- <SubTitleExtraSmall className={classify(classNames?.alertText)}>
165
- <Truncate line={2}>{children}</Truncate>
166
- </SubTitleExtraSmall>
167
- )}
168
- {!!(actionText || dismissable) && (
169
- <div
170
- className={classify(
171
- css.actionContainer,
172
- classNames?.actionContainer,
173
- )}
174
- >
175
- {!!actionText && (
176
- <Link onClick={onAction} color="primary">
177
- {actionText}
178
- </Link>
179
- )}
180
- {!!dismissable && (
181
- <ClickableIcon
182
- color={TEXT_COLORS.primary}
183
- name="close"
184
- size="small"
185
- type="regular"
186
- onClick={closeClickHandler}
187
- className={css.closeIcon}
188
- />
189
- )}
190
- </div>
191
- )}
192
- </div>
193
- )}
194
- </>
195
- );
196
- };
146
+ return (
147
+ <>
148
+ {!dismissed && (
149
+ <div
150
+ className={classify(
151
+ css.alertContainer,
152
+ {
153
+ [css.neutral]: semantic === ALERT_SEMANTIC.neutral,
154
+ [css.success]: semantic === ALERT_SEMANTIC.success,
155
+ [css.information]: semantic === ALERT_SEMANTIC.information,
156
+ [css.warning]: semantic === ALERT_SEMANTIC.warning,
157
+ [css.danger]: semantic === ALERT_SEMANTIC.danger,
158
+ },
159
+ classNames?.wrapper,
160
+ )}
161
+ ref={ref}
162
+ >
163
+ <AlertIcon
164
+ semantic={semantic}
165
+ leftIconName={leftIconName}
166
+ leftIconType={leftIconType}
167
+ />
168
+ {React.Children.count(children) > 0 && (
169
+ <SubTitleExtraSmall className={classify(classNames?.alertText)}>
170
+ <Truncate line={2}>{children}</Truncate>
171
+ </SubTitleExtraSmall>
172
+ )}
173
+ {!!(actionText || dismissable) && (
174
+ <div
175
+ className={classify(
176
+ css.actionContainer,
177
+ classNames?.actionContainer,
178
+ )}
179
+ >
180
+ {!!actionText && (
181
+ <Link onClick={onAction} color="primary">
182
+ {actionText}
183
+ </Link>
184
+ )}
185
+ {!!dismissable && (
186
+ <ClickableIcon
187
+ color={TEXT_COLORS.primary}
188
+ name="close"
189
+ size="small"
190
+ type="regular"
191
+ onClick={closeClickHandler}
192
+ className={css.closeIcon}
193
+ />
194
+ )}
195
+ </div>
196
+ )}
197
+ </div>
198
+ )}
199
+ </>
200
+ );
201
+ },
202
+ );
@@ -18,7 +18,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
18
18
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
19
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
20
  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); }
21
- const InlineDropdown = _ref => {
21
+ const InlineDropdown = /*#__PURE__*/React.forwardRef((_ref, ref) => {
22
22
  let {
23
23
  anchorPosition = 'bottom-start',
24
24
  size = 'medium',
@@ -31,7 +31,8 @@ const InlineDropdown = _ref => {
31
31
  children,
32
32
  ...restButtonProps
33
33
  } = _ref;
34
- const menuBtnRef = React.useRef();
34
+ const menuBtnRef = React.useRef(null);
35
+ React.useImperativeHandle(ref, () => menuBtnRef.current);
35
36
  const {
36
37
  x,
37
38
  y,
@@ -96,5 +97,5 @@ const InlineDropdown = _ref => {
96
97
  size: menu.size || 'medium'
97
98
  }))));
98
99
  });
99
- };
100
+ });
100
101
  exports.InlineDropdown = InlineDropdown;
@@ -45,96 +45,105 @@ export type InlineDropdownProps = {
45
45
  ...
46
46
  };
47
47
 
48
- export const InlineDropdown = ({
49
- anchorPosition = 'bottom-start',
50
- size = 'medium',
51
- onOptionSelect,
52
- menu,
53
- classNames,
54
- disabled,
55
- onMenuOpen,
56
- onMenuClose,
57
- children,
58
- ...restButtonProps
59
- }: InlineDropdownProps): React.Node => {
60
- const menuBtnRef = React.useRef();
61
- const {x, y, reference, floating, strategy} = useFloating({
62
- strategy: 'absolute',
63
- placement: anchorPosition,
64
- whileElementsMounted: autoUpdate,
65
- middleware: [shift(), flip(), offset(parseInt(spaceXXSmall))],
66
- });
48
+ export const InlineDropdown: React$AbstractComponent<
49
+ InlineDropdownProps,
50
+ HTMLDivElement,
51
+ > = React.forwardRef<InlineDropdownProps, HTMLDivElement>(
52
+ (
53
+ {
54
+ anchorPosition = 'bottom-start',
55
+ size = 'medium',
56
+ onOptionSelect,
57
+ menu,
58
+ classNames,
59
+ disabled,
60
+ onMenuOpen,
61
+ onMenuClose,
62
+ children,
63
+ ...restButtonProps
64
+ }: InlineDropdownProps,
65
+ ref,
66
+ ): React.Node => {
67
+ const menuBtnRef = React.useRef(null);
68
+ React.useImperativeHandle(ref, () => menuBtnRef.current);
69
+ const {x, y, reference, floating, strategy} = useFloating({
70
+ strategy: 'absolute',
71
+ placement: anchorPosition,
72
+ whileElementsMounted: autoUpdate,
73
+ middleware: [shift(), flip(), offset(parseInt(spaceXXSmall))],
74
+ });
67
75
 
68
- const onMenuToggle = (isOpen: boolean) => {
69
- isOpen ? onMenuOpen && onMenuOpen() : onMenuClose && onMenuClose();
70
- };
76
+ const onMenuToggle = (isOpen: boolean) => {
77
+ isOpen ? onMenuOpen && onMenuOpen() : onMenuClose && onMenuClose();
78
+ };
71
79
 
72
- return (
73
- <ClickAway onChange={onMenuToggle}>
74
- {({isOpen, onOpen, cancelNext, clickAway}) => (
75
- <div
76
- data-testid="InlineDropdown"
77
- className={classify(
78
- css.inlineDropdownContainer,
79
- classNames?.dropdownContainer,
80
- )}
81
- ref={menuBtnRef}
82
- >
83
- <UnstyledButton
84
- {...restButtonProps}
85
- disabled={disabled}
86
- ref={reference}
87
- onClick={(e) => {
88
- e.stopPropagation();
89
- onOpen();
90
- }}
80
+ return (
81
+ <ClickAway onChange={onMenuToggle}>
82
+ {({isOpen, onOpen, cancelNext, clickAway}) => (
83
+ <div
84
+ data-testid="InlineDropdown"
91
85
  className={classify(
92
- css.inlineButton,
93
- {
94
- [css.disabled]: disabled,
95
- },
96
- css[size],
97
- classNames?.buttonWrapper,
86
+ css.inlineDropdownContainer,
87
+ classNames?.dropdownContainer,
98
88
  )}
89
+ ref={menuBtnRef}
99
90
  >
100
- <Truncate>{children}</Truncate>
101
- <Icon
102
- name={isOpen ? 'caret-up' : 'caret-down'}
103
- size="small"
104
- type="solid"
105
- className={classify({
106
- [css.disabled]: disabled,
107
- })}
108
- />
109
- </UnstyledButton>
110
- {isOpen && menu && (
111
- <div
112
- onClickCapture={cancelNext}
113
- ref={floating}
114
- style={{
115
- display: 'flex',
116
- position: strategy,
117
- top: y ?? spaceNone,
118
- left: x ?? spaceNone,
91
+ <UnstyledButton
92
+ {...restButtonProps}
93
+ disabled={disabled}
94
+ ref={reference}
95
+ onClick={(e) => {
96
+ e.stopPropagation();
97
+ onOpen();
119
98
  }}
99
+ className={classify(
100
+ css.inlineButton,
101
+ {
102
+ [css.disabled]: disabled,
103
+ },
104
+ css[size],
105
+ classNames?.buttonWrapper,
106
+ )}
120
107
  >
121
- <Menu
122
- {...menu}
123
- onSelect={(option) => {
124
- onOptionSelect && onOptionSelect(option);
125
- if (
126
- !menu.optionsVariant ||
127
- menu.optionsVariant === 'normal'
128
- ) {
129
- clickAway();
130
- }
131
- }}
132
- size={menu.size || 'medium'}
108
+ <Truncate>{children}</Truncate>
109
+ <Icon
110
+ name={isOpen ? 'caret-up' : 'caret-down'}
111
+ size="small"
112
+ type="solid"
113
+ className={classify({
114
+ [css.disabled]: disabled,
115
+ })}
133
116
  />
134
- </div>
135
- )}
136
- </div>
137
- )}
138
- </ClickAway>
139
- );
140
- };
117
+ </UnstyledButton>
118
+ {isOpen && menu && (
119
+ <div
120
+ onClickCapture={cancelNext}
121
+ ref={floating}
122
+ style={{
123
+ display: 'flex',
124
+ position: strategy,
125
+ top: y ?? spaceNone,
126
+ left: x ?? spaceNone,
127
+ }}
128
+ >
129
+ <Menu
130
+ {...menu}
131
+ onSelect={(option) => {
132
+ onOptionSelect && onOptionSelect(option);
133
+ if (
134
+ !menu.optionsVariant ||
135
+ menu.optionsVariant === 'normal'
136
+ ) {
137
+ clickAway();
138
+ }
139
+ }}
140
+ size={menu.size || 'medium'}
141
+ />
142
+ </div>
143
+ )}
144
+ </div>
145
+ )}
146
+ </ClickAway>
147
+ );
148
+ },
149
+ );
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11
11
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
13
 
14
- const LinearLoader = _ref => {
14
+ const LinearLoader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
15
15
  let {
16
16
  value,
17
17
  size = 'medium',
@@ -22,12 +22,13 @@ const LinearLoader = _ref => {
22
22
  [_LinearLoaderModule.default.large]: size === 'large',
23
23
  [_LinearLoaderModule.default.medium]: size === 'medium',
24
24
  [_LinearLoaderModule.default.small]: size === 'small'
25
- }, className)
25
+ }, className),
26
+ ref: ref
26
27
  }, /*#__PURE__*/React.createElement("div", {
27
28
  className: _LinearLoaderModule.default.progressBar,
28
29
  style: {
29
30
  width: `${value + '%'}`
30
31
  }
31
32
  }));
32
- };
33
+ });
33
34
  exports.LinearLoader = LinearLoader;
@@ -13,22 +13,24 @@ export type LinearLoaderProps = {
13
13
  className?: string,
14
14
  };
15
15
 
16
- export const LinearLoader = ({
17
- value,
18
- size = 'medium',
19
- className,
20
- }: LinearLoaderProps): React.Node => (
21
- <div
22
- className={classify(
23
- css.lineContainer,
24
- {
25
- [css.large]: size === 'large',
26
- [css.medium]: size === 'medium',
27
- [css.small]: size === 'small',
28
- },
29
- className,
30
- )}
31
- >
32
- <div className={css.progressBar} style={{width: `${value + '%'}`}}></div>
33
- </div>
16
+ export const LinearLoader: React$AbstractComponent<
17
+ LinearLoaderProps,
18
+ HTMLDivElement,
19
+ > = React.forwardRef<LinearLoaderProps, HTMLDivElement>(
20
+ ({value, size = 'medium', className}: LinearLoaderProps, ref): React.Node => (
21
+ <div
22
+ className={classify(
23
+ css.lineContainer,
24
+ {
25
+ [css.large]: size === 'large',
26
+ [css.medium]: size === 'medium',
27
+ [css.small]: size === 'small',
28
+ },
29
+ className,
30
+ )}
31
+ ref={ref}
32
+ >
33
+ <div className={css.progressBar} style={{width: `${value + '%'}`}}></div>
34
+ </div>
35
+ ),
34
36
  );
@@ -65,9 +65,16 @@ const Link = /*#__PURE__*/React.forwardRef((_ref, ref) => {
65
65
  disabled,
66
66
  ...props
67
67
  } = _ref;
68
+ const linkRef = React.useRef(null);
69
+ React.useImperativeHandle(ref, () => linkRef.current);
70
+ React.useEffect(() => {
71
+ if (disabled) {
72
+ linkRef.current?.blur();
73
+ }
74
+ }, [disabled]);
68
75
  return /*#__PURE__*/React.createElement("a", _extends({}, props, {
69
76
  tabIndex: disabled ? -1 : tabIndex,
70
- innerref: ref,
77
+ ref: linkRef,
71
78
  "data-testid": "Link",
72
79
  className: (0, _classify.default)(_typographyModule.default.link, _typographyModule.default[as], _typographyModule.default[color], {
73
80
  [_typographyModule.default.underline]: underline,