@spaced-out/ui-design-system 0.1.130 → 0.2.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/CHANGELOG.md +14 -0
- package/lib/components/ButtonDropdown/ButtonDropdown.js +6 -5
- package/lib/components/ButtonDropdown/ButtonDropdown.js.flow +4 -4
- package/lib/components/ButtonTabs/ButtonTabDropdown.js +6 -5
- package/lib/components/ButtonTabs/ButtonTabDropdown.js.flow +4 -4
- package/lib/components/Dropdown/Dropdown.js +7 -6
- package/lib/components/Dropdown/Dropdown.js.flow +5 -5
- package/lib/components/InlineDropdown/InlineDropdown.js +6 -5
- package/lib/components/InlineDropdown/InlineDropdown.js.flow +4 -4
- package/lib/components/SideMenuLink/SideMenuLink.js +5 -3
- package/lib/components/SideMenuLink/SideMenuLink.js.flow +7 -3
- package/lib/components/Tabs/TabList/TabDropdown.js +6 -5
- package/lib/components/Tabs/TabList/TabDropdown.js.flow +4 -4
- package/lib/components/Typeahead/Typeahead.js +3 -4
- package/lib/components/Typeahead/Typeahead.js.flow +2 -3
- package/lib/utils/click-away/click-away.js +20 -18
- package/lib/utils/click-away/click-away.js.flow +44 -27
- package/lib/utils/merge-refs/merge-refs.js.flow +2 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.2.1](https://github.com/spaced-out/ui-design-system/compare/v0.2.0...v0.2.1) (2024-09-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* 🖼️ support for custom text in sidemenu link component ([#271](https://github.com/spaced-out/ui-design-system/issues/271)) ([3fd98b8](https://github.com/spaced-out/ui-design-system/commit/3fd98b8ba58c1b60b164a1d43ea5a47c503eaed1))
|
|
11
|
+
|
|
12
|
+
## [0.2.0](https://github.com/spaced-out/ui-design-system/compare/v0.1.130...v0.2.0) (2024-09-27)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* upgrade genesis to react 17 and click away changes ([#270](https://github.com/spaced-out/ui-design-system/issues/270)) ([6ab5f93](https://github.com/spaced-out/ui-design-system/commit/6ab5f930813feb1dffaeb030983d13dbd8ebd3bf))
|
|
18
|
+
|
|
5
19
|
### [0.1.130](https://github.com/spaced-out/ui-design-system/compare/v0.1.130-beta.0...v0.1.130) (2024-09-12)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -10,6 +10,7 @@ var _size = require("../../styles/variables/_size");
|
|
|
10
10
|
var _space = require("../../styles/variables/_space");
|
|
11
11
|
var _classify = require("../../utils/classify");
|
|
12
12
|
var _clickAway = require("../../utils/click-away");
|
|
13
|
+
var _mergeRefs = require("../../utils/merge-refs");
|
|
13
14
|
var _Button = require("../Button");
|
|
14
15
|
var _ConditionalWrapper = require("../ConditionalWrapper");
|
|
15
16
|
var _Menu = require("../Menu");
|
|
@@ -84,8 +85,9 @@ const ButtonDropdown = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
|
|
|
84
85
|
let {
|
|
85
86
|
isOpen,
|
|
86
87
|
onOpen,
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
clickAway,
|
|
89
|
+
boundaryRef,
|
|
90
|
+
triggerRef
|
|
89
91
|
} = _ref2;
|
|
90
92
|
return /*#__PURE__*/React.createElement("div", {
|
|
91
93
|
"data-testid": "ButtonDropdown",
|
|
@@ -103,7 +105,7 @@ const ButtonDropdown = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
|
|
|
103
105
|
iconRightType: iconRightType,
|
|
104
106
|
disabled: disabled,
|
|
105
107
|
size: size,
|
|
106
|
-
ref: refs.setReference,
|
|
108
|
+
ref: (0, _mergeRefs.mergeRefs)([refs.setReference, triggerRef]),
|
|
107
109
|
onClick: e => {
|
|
108
110
|
onClick?.(e);
|
|
109
111
|
e.stopPropagation();
|
|
@@ -115,8 +117,7 @@ const ButtonDropdown = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
|
|
|
115
117
|
icon: classNames?.buttonIcon
|
|
116
118
|
}
|
|
117
119
|
}), children)), isOpen && menu && /*#__PURE__*/React.createElement("div", {
|
|
118
|
-
|
|
119
|
-
ref: refs.setFloating,
|
|
120
|
+
ref: (0, _mergeRefs.mergeRefs)([refs.setFloating, boundaryRef]),
|
|
120
121
|
style: {
|
|
121
122
|
display: 'flex',
|
|
122
123
|
position: strategy,
|
|
@@ -18,6 +18,7 @@ import {sizeFluid} from '../../styles/variables/_size';
|
|
|
18
18
|
import {spaceNone, spaceXXSmall} from '../../styles/variables/_space';
|
|
19
19
|
import {classify} from '../../utils/classify';
|
|
20
20
|
import {type ClickAwayRefType, ClickAway} from '../../utils/click-away';
|
|
21
|
+
import {mergeRefs} from '../../utils/merge-refs';
|
|
21
22
|
import type {ButtonProps} from '../Button';
|
|
22
23
|
import {Button} from '../Button';
|
|
23
24
|
import {ConditionalWrapper} from '../ConditionalWrapper';
|
|
@@ -115,7 +116,7 @@ export const ButtonDropdown: React$AbstractComponent<
|
|
|
115
116
|
|
|
116
117
|
return (
|
|
117
118
|
<ClickAway onChange={onMenuToggle} clickAwayRef={clickAwayRef}>
|
|
118
|
-
{({isOpen, onOpen,
|
|
119
|
+
{({isOpen, onOpen, clickAway, boundaryRef, triggerRef}) => (
|
|
119
120
|
<div
|
|
120
121
|
data-testid="ButtonDropdown"
|
|
121
122
|
className={classify(
|
|
@@ -148,7 +149,7 @@ export const ButtonDropdown: React$AbstractComponent<
|
|
|
148
149
|
iconRightType={iconRightType}
|
|
149
150
|
disabled={disabled}
|
|
150
151
|
size={size}
|
|
151
|
-
ref={refs.setReference}
|
|
152
|
+
ref={mergeRefs([refs.setReference, triggerRef])}
|
|
152
153
|
onClick={(e) => {
|
|
153
154
|
onClick?.(e);
|
|
154
155
|
e.stopPropagation();
|
|
@@ -166,8 +167,7 @@ export const ButtonDropdown: React$AbstractComponent<
|
|
|
166
167
|
|
|
167
168
|
{isOpen && menu && (
|
|
168
169
|
<div
|
|
169
|
-
|
|
170
|
-
ref={refs.setFloating}
|
|
170
|
+
ref={mergeRefs([refs.setFloating, boundaryRef])}
|
|
171
171
|
style={{
|
|
172
172
|
display: 'flex',
|
|
173
173
|
position: strategy,
|
|
@@ -10,6 +10,7 @@ var _lodash = require("lodash");
|
|
|
10
10
|
var _space = require("../../styles/variables/_space");
|
|
11
11
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
12
12
|
var _clickAway = require("../../utils/click-away");
|
|
13
|
+
var _mergeRefs = require("../../utils/merge-refs");
|
|
13
14
|
var _Menu = require("../Menu");
|
|
14
15
|
var _ButtonTab = require("./ButtonTab");
|
|
15
16
|
var _ButtonTabDropdownModule = _interopRequireDefault(require("./ButtonTabDropdown.module.css"));
|
|
@@ -75,23 +76,23 @@ const ButtonTabDropdown = _ref => {
|
|
|
75
76
|
let {
|
|
76
77
|
isOpen,
|
|
77
78
|
onOpen,
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
clickAway,
|
|
80
|
+
boundaryRef,
|
|
81
|
+
triggerRef
|
|
80
82
|
} = _ref3;
|
|
81
83
|
return /*#__PURE__*/React.createElement("div", {
|
|
82
84
|
"data-testid": "ButtonTabDropdown",
|
|
83
85
|
ref: menuBtnRef,
|
|
84
86
|
className: (0, _classify.default)(_ButtonTabDropdownModule.default.buttonTabDropDownWrapper, dropdownClass)
|
|
85
87
|
}, /*#__PURE__*/React.createElement(_ButtonTab.ButtonTab, _extends({}, buttonTabProps, {
|
|
86
|
-
ref: refs.setReference,
|
|
88
|
+
ref: (0, _mergeRefs.mergeRefs)([refs.setReference, triggerRef]),
|
|
87
89
|
selectedButtonTabId: moreTabSelectedId,
|
|
88
90
|
onButtonTabSelect: (id, e) => {
|
|
89
91
|
e?.stopPropagation();
|
|
90
92
|
onOpen();
|
|
91
93
|
}
|
|
92
94
|
}), title), isOpen && /*#__PURE__*/React.createElement("div", {
|
|
93
|
-
|
|
94
|
-
ref: refs.setFloating,
|
|
95
|
+
ref: (0, _mergeRefs.mergeRefs)([refs.setFloating, boundaryRef]),
|
|
95
96
|
style: {
|
|
96
97
|
display: 'flex',
|
|
97
98
|
position: strategy,
|
|
@@ -18,6 +18,7 @@ import {includes} from 'lodash';
|
|
|
18
18
|
import {spaceNone, spaceXXSmall} from '../../styles/variables/_space';
|
|
19
19
|
import classify from '../../utils/classify';
|
|
20
20
|
import {ClickAway} from '../../utils/click-away';
|
|
21
|
+
import {mergeRefs} from '../../utils/merge-refs';
|
|
21
22
|
import type {AnchorType} from '../ButtonDropdown';
|
|
22
23
|
import {Menu} from '../Menu';
|
|
23
24
|
|
|
@@ -87,7 +88,7 @@ export const ButtonTabDropdown = ({
|
|
|
87
88
|
|
|
88
89
|
return (
|
|
89
90
|
<ClickAway>
|
|
90
|
-
{({isOpen, onOpen,
|
|
91
|
+
{({isOpen, onOpen, clickAway, boundaryRef, triggerRef}) => (
|
|
91
92
|
<div
|
|
92
93
|
data-testid="ButtonTabDropdown"
|
|
93
94
|
ref={menuBtnRef}
|
|
@@ -95,7 +96,7 @@ export const ButtonTabDropdown = ({
|
|
|
95
96
|
>
|
|
96
97
|
<ButtonTab
|
|
97
98
|
{...buttonTabProps}
|
|
98
|
-
ref={refs.setReference}
|
|
99
|
+
ref={mergeRefs([refs.setReference, triggerRef])}
|
|
99
100
|
selectedButtonTabId={moreTabSelectedId}
|
|
100
101
|
onButtonTabSelect={(id, e) => {
|
|
101
102
|
e?.stopPropagation();
|
|
@@ -106,8 +107,7 @@ export const ButtonTabDropdown = ({
|
|
|
106
107
|
</ButtonTab>
|
|
107
108
|
{isOpen && (
|
|
108
109
|
<div
|
|
109
|
-
|
|
110
|
-
ref={refs.setFloating}
|
|
110
|
+
ref={mergeRefs([refs.setFloating, boundaryRef])}
|
|
111
111
|
style={{
|
|
112
112
|
display: 'flex',
|
|
113
113
|
position: strategy,
|
|
@@ -10,6 +10,7 @@ var _size = require("../../styles/variables/_size");
|
|
|
10
10
|
var _space = require("../../styles/variables/_space");
|
|
11
11
|
var _classify = require("../../utils/classify");
|
|
12
12
|
var _clickAway = require("../../utils/click-away");
|
|
13
|
+
var _mergeRefs = require("../../utils/merge-refs");
|
|
13
14
|
var _Input = require("../Input");
|
|
14
15
|
var _Menu = require("../Menu");
|
|
15
16
|
var _DropdownModule = _interopRequireDefault(require("./Dropdown.module.css"));
|
|
@@ -58,13 +59,14 @@ const Dropdown = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
58
59
|
let {
|
|
59
60
|
isOpen,
|
|
60
61
|
onOpen,
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
clickAway,
|
|
63
|
+
boundaryRef,
|
|
64
|
+
triggerRef
|
|
63
65
|
} = _ref2;
|
|
64
66
|
return /*#__PURE__*/React.createElement("div", {
|
|
65
67
|
"data-testid": "Dropdown",
|
|
66
68
|
className: (0, _classify.classify)(_DropdownModule.default.dropdownContainer, classNames?.wrapper),
|
|
67
|
-
ref: dropdownRef
|
|
69
|
+
ref: (0, _mergeRefs.mergeRefs)([dropdownRef, boundaryRef])
|
|
68
70
|
}, /*#__PURE__*/React.createElement(_Input.Input, _extends({}, inputProps, {
|
|
69
71
|
onKeyDown: e => {
|
|
70
72
|
if (e.keyCode === 32) {
|
|
@@ -72,7 +74,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
72
74
|
isOpen ? clickAway() : onOpen();
|
|
73
75
|
}
|
|
74
76
|
},
|
|
75
|
-
boxRef: refs.setReference,
|
|
77
|
+
boxRef: (0, _mergeRefs.mergeRefs)([refs.setReference, triggerRef]),
|
|
76
78
|
size: size,
|
|
77
79
|
placeholder: placeholder,
|
|
78
80
|
value: dropdownInputText,
|
|
@@ -87,8 +89,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
87
89
|
},
|
|
88
90
|
ref: ref
|
|
89
91
|
})), isOpen && menu && /*#__PURE__*/React.createElement("div", {
|
|
90
|
-
|
|
91
|
-
ref: refs.setFloating,
|
|
92
|
+
ref: (0, _mergeRefs.mergeRefs)([refs.setFloating, boundaryRef]),
|
|
92
93
|
style: {
|
|
93
94
|
position: strategy,
|
|
94
95
|
top: y ?? _space.spaceNone,
|
|
@@ -16,6 +16,7 @@ import {sizeFluid} from '../../styles/variables/_size';
|
|
|
16
16
|
import {spaceNone, spaceXXSmall} from '../../styles/variables/_space';
|
|
17
17
|
import {classify} from '../../utils/classify';
|
|
18
18
|
import {type ClickAwayRefType, ClickAway} from '../../utils/click-away';
|
|
19
|
+
import {mergeRefs} from '../../utils/merge-refs';
|
|
19
20
|
import type {InputProps} from '../Input';
|
|
20
21
|
import {Input} from '../Input';
|
|
21
22
|
import type {MenuOption, MenuProps} from '../Menu';
|
|
@@ -78,11 +79,11 @@ export const Dropdown: React$AbstractComponent<
|
|
|
78
79
|
|
|
79
80
|
return (
|
|
80
81
|
<ClickAway onChange={onMenuToggle} clickAwayRef={clickAwayRef}>
|
|
81
|
-
{({isOpen, onOpen,
|
|
82
|
+
{({isOpen, onOpen, clickAway, boundaryRef, triggerRef}) => (
|
|
82
83
|
<div
|
|
83
84
|
data-testid="Dropdown"
|
|
84
85
|
className={classify(css.dropdownContainer, classNames?.wrapper)}
|
|
85
|
-
ref={dropdownRef}
|
|
86
|
+
ref={mergeRefs([dropdownRef, boundaryRef])}
|
|
86
87
|
>
|
|
87
88
|
<Input
|
|
88
89
|
{...inputProps}
|
|
@@ -92,7 +93,7 @@ export const Dropdown: React$AbstractComponent<
|
|
|
92
93
|
isOpen ? clickAway() : onOpen();
|
|
93
94
|
}
|
|
94
95
|
}}
|
|
95
|
-
boxRef={refs.setReference}
|
|
96
|
+
boxRef={mergeRefs([refs.setReference, triggerRef])}
|
|
96
97
|
size={size}
|
|
97
98
|
placeholder={placeholder}
|
|
98
99
|
value={dropdownInputText}
|
|
@@ -108,8 +109,7 @@ export const Dropdown: React$AbstractComponent<
|
|
|
108
109
|
|
|
109
110
|
{isOpen && menu && (
|
|
110
111
|
<div
|
|
111
|
-
|
|
112
|
-
ref={refs.setFloating}
|
|
112
|
+
ref={mergeRefs([refs.setFloating, boundaryRef])}
|
|
113
113
|
style={{
|
|
114
114
|
position: strategy,
|
|
115
115
|
top: y ?? spaceNone,
|
|
@@ -9,6 +9,7 @@ var _react2 = require("@floating-ui/react");
|
|
|
9
9
|
var _space = require("../../styles/variables/_space");
|
|
10
10
|
var _classify = require("../../utils/classify");
|
|
11
11
|
var _clickAway = require("../../utils/click-away");
|
|
12
|
+
var _mergeRefs = require("../../utils/merge-refs");
|
|
12
13
|
var _Button = require("../Button");
|
|
13
14
|
var _Icon = require("../Icon");
|
|
14
15
|
var _Menu = require("../Menu");
|
|
@@ -56,8 +57,9 @@ const InlineDropdown = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
56
57
|
let {
|
|
57
58
|
isOpen,
|
|
58
59
|
onOpen,
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
clickAway,
|
|
61
|
+
boundaryRef,
|
|
62
|
+
triggerRef
|
|
61
63
|
} = _ref2;
|
|
62
64
|
return /*#__PURE__*/React.createElement("div", {
|
|
63
65
|
"data-testid": "InlineDropdown",
|
|
@@ -65,7 +67,7 @@ const InlineDropdown = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
65
67
|
ref: menuBtnRef
|
|
66
68
|
}, /*#__PURE__*/React.createElement(_Button.UnstyledButton, _extends({}, restButtonProps, {
|
|
67
69
|
disabled: disabled,
|
|
68
|
-
ref: refs.setReference,
|
|
70
|
+
ref: (0, _mergeRefs.mergeRefs)([refs.setReference, triggerRef]),
|
|
69
71
|
onClick: e => {
|
|
70
72
|
e.stopPropagation();
|
|
71
73
|
onOpen();
|
|
@@ -81,8 +83,7 @@ const InlineDropdown = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
81
83
|
[_InlineDropdownModule.default.disabled]: disabled
|
|
82
84
|
})
|
|
83
85
|
})), isOpen && menu && /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
|
|
85
|
-
ref: refs.setFloating,
|
|
86
|
+
ref: (0, _mergeRefs.mergeRefs)([refs.setFloating, boundaryRef]),
|
|
86
87
|
style: {
|
|
87
88
|
display: 'flex',
|
|
88
89
|
position: strategy,
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
import {spaceNone, spaceXXSmall} from '../../styles/variables/_space';
|
|
18
18
|
import {classify} from '../../utils/classify';
|
|
19
19
|
import {type ClickAwayRefType, ClickAway} from '../../utils/click-away';
|
|
20
|
+
import {mergeRefs} from '../../utils/merge-refs';
|
|
20
21
|
import type {UnstyledButtonProps} from '../Button';
|
|
21
22
|
import {UnstyledButton} from '../Button';
|
|
22
23
|
import type {AnchorType} from '../ButtonDropdown';
|
|
@@ -82,7 +83,7 @@ export const InlineDropdown: React$AbstractComponent<
|
|
|
82
83
|
|
|
83
84
|
return (
|
|
84
85
|
<ClickAway onChange={onMenuToggle} clickAwayRef={clickAwayRef}>
|
|
85
|
-
{({isOpen, onOpen,
|
|
86
|
+
{({isOpen, onOpen, clickAway, boundaryRef, triggerRef}) => (
|
|
86
87
|
<div
|
|
87
88
|
data-testid="InlineDropdown"
|
|
88
89
|
className={classify(
|
|
@@ -94,7 +95,7 @@ export const InlineDropdown: React$AbstractComponent<
|
|
|
94
95
|
<UnstyledButton
|
|
95
96
|
{...restButtonProps}
|
|
96
97
|
disabled={disabled}
|
|
97
|
-
ref={refs.setReference}
|
|
98
|
+
ref={mergeRefs([refs.setReference, triggerRef])}
|
|
98
99
|
onClick={(e) => {
|
|
99
100
|
e.stopPropagation();
|
|
100
101
|
onOpen();
|
|
@@ -120,8 +121,7 @@ export const InlineDropdown: React$AbstractComponent<
|
|
|
120
121
|
</UnstyledButton>
|
|
121
122
|
{isOpen && menu && (
|
|
122
123
|
<div
|
|
123
|
-
|
|
124
|
-
ref={refs.setFloating}
|
|
124
|
+
ref={mergeRefs([refs.setFloating, boundaryRef])}
|
|
125
125
|
style={{
|
|
126
126
|
display: 'flex',
|
|
127
127
|
position: strategy,
|
|
@@ -194,6 +194,7 @@ const SideMenuLink = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
194
194
|
linkComponent: LinkComponent,
|
|
195
195
|
rightSlot,
|
|
196
196
|
to,
|
|
197
|
+
customTitle,
|
|
197
198
|
...restButtonProps
|
|
198
199
|
} = _ref;
|
|
199
200
|
const selected = selectedValue === pageNameKey;
|
|
@@ -201,6 +202,7 @@ const SideMenuLink = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
201
202
|
const onChangeHandler = e => {
|
|
202
203
|
onChange && onChange(e, pageNameKey);
|
|
203
204
|
};
|
|
205
|
+
const linkTitle = customTitle || MENU_NAME_LIST[pageNameKey].title;
|
|
204
206
|
return /*#__PURE__*/React.createElement(_ConditionalWrapper.ConditionalWrapper, {
|
|
205
207
|
condition: to !== undefined,
|
|
206
208
|
wrapper: children => /*#__PURE__*/React.createElement(_Link.Link, {
|
|
@@ -215,7 +217,7 @@ const SideMenuLink = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
215
217
|
}, /*#__PURE__*/React.createElement(_ConditionalWrapper.ConditionalWrapper, {
|
|
216
218
|
condition: Boolean(!opened && !inActive),
|
|
217
219
|
wrapper: children => /*#__PURE__*/React.createElement(_Tooltip.Tooltip, _extends({
|
|
218
|
-
body:
|
|
220
|
+
body: linkTitle
|
|
219
221
|
}, tooltip), children)
|
|
220
222
|
}, /*#__PURE__*/React.createElement(_Button.UnstyledButton, _extends({}, restButtonProps, {
|
|
221
223
|
className: (0, _classify.default)(_SideMenuLinkModule.default.linkWrapper, {
|
|
@@ -239,9 +241,9 @@ const SideMenuLink = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
239
241
|
className: _SideMenuLinkModule.default.menuLabelContainer
|
|
240
242
|
}, pageNameKey && MENU_NAME_LIST[pageNameKey] ? isGroupMenuLink ? /*#__PURE__*/React.createElement(_Text.SubTitleSmall, {
|
|
241
243
|
className: _SideMenuLinkModule.default.groupMenuLinkText
|
|
242
|
-
},
|
|
244
|
+
}, linkTitle) : /*#__PURE__*/React.createElement(_Text.BodyMedium, {
|
|
243
245
|
className: _SideMenuLinkModule.default.menuLinkText
|
|
244
|
-
},
|
|
246
|
+
}, linkTitle) : null, rightSlot ? rightSlot : null) : null)));
|
|
245
247
|
});
|
|
246
248
|
exports.SideMenuLink = SideMenuLink;
|
|
247
249
|
SideMenuLink.displayName = 'SideMenuLink';
|
|
@@ -183,6 +183,7 @@ type ClassNames = $ReadOnly<{wrapper?: string}>;
|
|
|
183
183
|
export type SideMenuLinkProps = {
|
|
184
184
|
classNames?: ClassNames,
|
|
185
185
|
children?: React.Node,
|
|
186
|
+
customTitle?: string,
|
|
186
187
|
pageNameKey: string,
|
|
187
188
|
disabled?: boolean,
|
|
188
189
|
hovered?: boolean,
|
|
@@ -216,6 +217,7 @@ export const SideMenuLink: React$AbstractComponent<
|
|
|
216
217
|
linkComponent: LinkComponent,
|
|
217
218
|
rightSlot,
|
|
218
219
|
to,
|
|
220
|
+
customTitle,
|
|
219
221
|
...restButtonProps
|
|
220
222
|
}: SideMenuLinkProps,
|
|
221
223
|
ref,
|
|
@@ -226,6 +228,8 @@ export const SideMenuLink: React$AbstractComponent<
|
|
|
226
228
|
onChange && onChange(e, pageNameKey);
|
|
227
229
|
};
|
|
228
230
|
|
|
231
|
+
const linkTitle = customTitle || MENU_NAME_LIST[pageNameKey].title;
|
|
232
|
+
|
|
229
233
|
return (
|
|
230
234
|
<ConditionalWrapper
|
|
231
235
|
condition={to !== undefined}
|
|
@@ -246,7 +250,7 @@ export const SideMenuLink: React$AbstractComponent<
|
|
|
246
250
|
<ConditionalWrapper
|
|
247
251
|
condition={Boolean(!opened && !inActive)}
|
|
248
252
|
wrapper={(children) => (
|
|
249
|
-
<Tooltip body={
|
|
253
|
+
<Tooltip body={linkTitle} {...tooltip}>
|
|
250
254
|
{children}
|
|
251
255
|
</Tooltip>
|
|
252
256
|
)}
|
|
@@ -283,11 +287,11 @@ export const SideMenuLink: React$AbstractComponent<
|
|
|
283
287
|
{pageNameKey && MENU_NAME_LIST[pageNameKey] ? (
|
|
284
288
|
isGroupMenuLink ? (
|
|
285
289
|
<SubTitleSmall className={css.groupMenuLinkText}>
|
|
286
|
-
{
|
|
290
|
+
{linkTitle}
|
|
287
291
|
</SubTitleSmall>
|
|
288
292
|
) : (
|
|
289
293
|
<BodyMedium className={css.menuLinkText}>
|
|
290
|
-
{
|
|
294
|
+
{linkTitle}
|
|
291
295
|
</BodyMedium>
|
|
292
296
|
)
|
|
293
297
|
) : null}
|
|
@@ -9,6 +9,7 @@ var _react2 = require("@floating-ui/react");
|
|
|
9
9
|
var _space = require("../../../styles/variables/_space");
|
|
10
10
|
var _classify = require("../../../utils/classify");
|
|
11
11
|
var _clickAway = require("../../../utils/click-away");
|
|
12
|
+
var _mergeRefs = require("../../../utils/merge-refs");
|
|
12
13
|
var _Menu = require("../../Menu");
|
|
13
14
|
var _Tab = require("../Tab");
|
|
14
15
|
var _TabDropdownModule = _interopRequireDefault(require("./TabDropdown.module.css"));
|
|
@@ -41,8 +42,9 @@ const TabDropdown = _ref => {
|
|
|
41
42
|
let {
|
|
42
43
|
isOpen,
|
|
43
44
|
onOpen,
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
clickAway,
|
|
46
|
+
boundaryRef,
|
|
47
|
+
triggerRef
|
|
46
48
|
} = _ref2;
|
|
47
49
|
return /*#__PURE__*/React.createElement("div", {
|
|
48
50
|
"data-testid": "TabDropdown",
|
|
@@ -50,7 +52,7 @@ const TabDropdown = _ref => {
|
|
|
50
52
|
ref: menuBtnRef
|
|
51
53
|
}, /*#__PURE__*/React.createElement(_Tab.Tab, _extends({}, props?.tab, {
|
|
52
54
|
size: size,
|
|
53
|
-
ref: refs.setReference,
|
|
55
|
+
ref: (0, _mergeRefs.mergeRefs)([refs.setReference, triggerRef]),
|
|
54
56
|
onClick: e => {
|
|
55
57
|
e.stopPropagation();
|
|
56
58
|
onOpen();
|
|
@@ -60,8 +62,7 @@ const TabDropdown = _ref => {
|
|
|
60
62
|
iconTextWrap: _TabDropdownModule.default.dotTextWrap
|
|
61
63
|
}
|
|
62
64
|
})), isOpen && props?.menu && /*#__PURE__*/React.createElement("div", {
|
|
63
|
-
|
|
64
|
-
ref: refs.setFloating,
|
|
65
|
+
ref: (0, _mergeRefs.mergeRefs)([refs.setFloating, boundaryRef]),
|
|
65
66
|
style: {
|
|
66
67
|
display: 'flex',
|
|
67
68
|
position: strategy,
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
import {spaceNone, spaceXXSmall} from '../../../styles/variables/_space';
|
|
18
18
|
import {classify} from '../../../utils/classify';
|
|
19
19
|
import {ClickAway} from '../../../utils/click-away';
|
|
20
|
+
import {mergeRefs} from '../../../utils/merge-refs';
|
|
20
21
|
import type {AnchorType} from '../../ButtonDropdown';
|
|
21
22
|
import type {MenuOption, MenuProps} from '../../Menu';
|
|
22
23
|
import {Menu} from '../../Menu';
|
|
@@ -59,7 +60,7 @@ export const TabDropdown = ({
|
|
|
59
60
|
|
|
60
61
|
return (
|
|
61
62
|
<ClickAway>
|
|
62
|
-
{({isOpen, onOpen,
|
|
63
|
+
{({isOpen, onOpen, clickAway, boundaryRef, triggerRef}) => (
|
|
63
64
|
<div
|
|
64
65
|
data-testid="TabDropdown"
|
|
65
66
|
className={classify(css.tabDropdownContainer, classNames?.wrapper)}
|
|
@@ -68,7 +69,7 @@ export const TabDropdown = ({
|
|
|
68
69
|
<Tab
|
|
69
70
|
{...props?.tab}
|
|
70
71
|
size={size}
|
|
71
|
-
ref={refs.setReference}
|
|
72
|
+
ref={mergeRefs([refs.setReference, triggerRef])}
|
|
72
73
|
onClick={(e) => {
|
|
73
74
|
e.stopPropagation();
|
|
74
75
|
onOpen();
|
|
@@ -80,8 +81,7 @@ export const TabDropdown = ({
|
|
|
80
81
|
/>
|
|
81
82
|
{isOpen && props?.menu && (
|
|
82
83
|
<div
|
|
83
|
-
|
|
84
|
-
ref={refs.setFloating}
|
|
84
|
+
ref={mergeRefs([refs.setFloating, boundaryRef])}
|
|
85
85
|
style={{
|
|
86
86
|
display: 'flex',
|
|
87
87
|
position: strategy,
|
|
@@ -68,13 +68,13 @@ const Typeahead = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
68
68
|
let {
|
|
69
69
|
isOpen,
|
|
70
70
|
onOpen,
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
clickAway,
|
|
72
|
+
boundaryRef
|
|
73
73
|
} = _ref2;
|
|
74
74
|
return /*#__PURE__*/React.createElement("div", {
|
|
75
75
|
"data-testid": "Typeahead",
|
|
76
76
|
className: (0, _classify.classify)(_TypeaheadModule.default.typeaheadContainer, classNames?.wrapper),
|
|
77
|
-
|
|
77
|
+
ref: boundaryRef
|
|
78
78
|
}, /*#__PURE__*/React.createElement(_SearchInput.SearchInput, _extends({}, inputProps, {
|
|
79
79
|
ref: ref,
|
|
80
80
|
boxRef: refs.setReference,
|
|
@@ -106,7 +106,6 @@ const Typeahead = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
106
106
|
onClear?.();
|
|
107
107
|
}
|
|
108
108
|
})), isOpen && !isLoading && menu && filteredOptions && !!filteredOptions.length && /*#__PURE__*/React.createElement("div", {
|
|
109
|
-
onClickCapture: cancelNext,
|
|
110
109
|
ref: refs.setFloating,
|
|
111
110
|
style: {
|
|
112
111
|
position: strategy,
|
|
@@ -98,11 +98,11 @@ export const Typeahead: React$AbstractComponent<
|
|
|
98
98
|
|
|
99
99
|
return (
|
|
100
100
|
<ClickAway onChange={onMenuToggle} clickAwayRef={clickAwayRef}>
|
|
101
|
-
{({isOpen, onOpen,
|
|
101
|
+
{({isOpen, onOpen, clickAway, boundaryRef}) => (
|
|
102
102
|
<div
|
|
103
103
|
data-testid="Typeahead"
|
|
104
104
|
className={classify(css.typeaheadContainer, classNames?.wrapper)}
|
|
105
|
-
|
|
105
|
+
ref={boundaryRef}
|
|
106
106
|
>
|
|
107
107
|
<SearchInput
|
|
108
108
|
{...inputProps}
|
|
@@ -140,7 +140,6 @@ export const Typeahead: React$AbstractComponent<
|
|
|
140
140
|
filteredOptions &&
|
|
141
141
|
!!filteredOptions.length && (
|
|
142
142
|
<div
|
|
143
|
-
onClickCapture={cancelNext}
|
|
144
143
|
ref={refs.setFloating}
|
|
145
144
|
style={{
|
|
146
145
|
position: strategy,
|
|
@@ -22,7 +22,8 @@ class ClickAway extends React.Component {
|
|
|
22
22
|
pageBottom: null
|
|
23
23
|
});
|
|
24
24
|
_defineProperty(this, "el", null);
|
|
25
|
-
_defineProperty(this, "
|
|
25
|
+
_defineProperty(this, "boundaryRef", /*#__PURE__*/React.createRef());
|
|
26
|
+
_defineProperty(this, "triggerRef", /*#__PURE__*/React.createRef());
|
|
26
27
|
_defineProperty(this, "handleOpenClick", () => {
|
|
27
28
|
// NOTE (kyle): we recalculate the position on click because sibling and niece components
|
|
28
29
|
// could have changed.
|
|
@@ -33,21 +34,20 @@ class ClickAway extends React.Component {
|
|
|
33
34
|
pageBottom = this.pageBottom();
|
|
34
35
|
}
|
|
35
36
|
this.setState({
|
|
36
|
-
isOpen:
|
|
37
|
+
isOpen: !this.state.isOpen,
|
|
37
38
|
pageBottom
|
|
38
39
|
}, this.handleOnChange);
|
|
39
40
|
});
|
|
40
41
|
_defineProperty(this, "handleCloseClick", evt => {
|
|
41
|
-
if (this.
|
|
42
|
+
if (evt.target instanceof Node && this.boundaryRef && (this.boundaryRef === evt.target || this.boundaryRef.current?.contains(evt.target))) {
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
44
|
-
if (this.
|
|
45
|
-
|
|
46
|
-
} else {
|
|
47
|
-
this.setState({
|
|
48
|
-
isOpen: false
|
|
49
|
-
}, this.handleOnChange);
|
|
45
|
+
if (evt.target instanceof Node && this.triggerRef && (this.triggerRef === evt.target || this.triggerRef.current?.contains(evt.target))) {
|
|
46
|
+
return;
|
|
50
47
|
}
|
|
48
|
+
this.setState({
|
|
49
|
+
isOpen: false
|
|
50
|
+
}, this.handleOnChange);
|
|
51
51
|
});
|
|
52
52
|
_defineProperty(this, "handleCloseOnEscapeKeypress", evt => {
|
|
53
53
|
if (evt?.key === 'Escape') {
|
|
@@ -59,9 +59,6 @@ class ClickAway extends React.Component {
|
|
|
59
59
|
isOpen: false
|
|
60
60
|
}, this.handleOnChange);
|
|
61
61
|
});
|
|
62
|
-
_defineProperty(this, "cancelNextClickAway", () => {
|
|
63
|
-
this.cancelNext = true;
|
|
64
|
-
});
|
|
65
62
|
_defineProperty(this, "handleOnChange", () => this.props.onChange && this.props.onChange(this.state.isOpen));
|
|
66
63
|
}
|
|
67
64
|
componentDidMount() {
|
|
@@ -78,18 +75,24 @@ class ClickAway extends React.Component {
|
|
|
78
75
|
} = this.state;
|
|
79
76
|
if (prevState.isOpen !== isOpen) {
|
|
80
77
|
if (this.state.isOpen) {
|
|
81
|
-
window.document.addEventListener('click', this.handleCloseClick
|
|
78
|
+
window.document.addEventListener('click', this.handleCloseClick, {
|
|
79
|
+
capture: true
|
|
80
|
+
});
|
|
82
81
|
if (this.props.closeOnEscapeKeypress) {
|
|
83
82
|
window.document.addEventListener('keyup', this.handleCloseOnEscapeKeypress);
|
|
84
83
|
}
|
|
85
84
|
} else {
|
|
86
|
-
window.document.removeEventListener('click', this.handleCloseClick
|
|
85
|
+
window.document.removeEventListener('click', this.handleCloseClick, {
|
|
86
|
+
capture: true
|
|
87
|
+
});
|
|
87
88
|
window.document.removeEventListener('keyup', this.handleCloseOnEscapeKeypress);
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
componentWillUnmount() {
|
|
92
|
-
window.document.removeEventListener('click', this.handleCloseClick
|
|
93
|
+
window.document.removeEventListener('click', this.handleCloseClick, {
|
|
94
|
+
capture: true
|
|
95
|
+
});
|
|
93
96
|
window.document.removeEventListener('keyup', this.handleCloseOnEscapeKeypress);
|
|
94
97
|
}
|
|
95
98
|
render() {
|
|
@@ -112,9 +115,9 @@ class ClickAway extends React.Component {
|
|
|
112
115
|
isOpen,
|
|
113
116
|
height,
|
|
114
117
|
pageBottom,
|
|
115
|
-
cancelNext: this.cancelNextClickAway,
|
|
116
118
|
clickAway: this.forceClose,
|
|
117
|
-
|
|
119
|
+
boundaryRef: this.boundaryRef,
|
|
120
|
+
triggerRef: this.triggerRef
|
|
118
121
|
});
|
|
119
122
|
}
|
|
120
123
|
pageBottom() {
|
|
@@ -125,6 +128,5 @@ class ClickAway extends React.Component {
|
|
|
125
128
|
}
|
|
126
129
|
exports.ClickAway = ClickAway;
|
|
127
130
|
_defineProperty(ClickAway, "defaultProps", {
|
|
128
|
-
shouldCancel: () => false,
|
|
129
131
|
closeOnEscapeKeypress: true
|
|
130
132
|
});
|
|
@@ -6,14 +6,22 @@ import invariant from 'invariant';
|
|
|
6
6
|
import {pageHeight} from '../dom';
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
type BoundaryRefType<T> = {
|
|
10
|
+
current: ?T,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type TriggerRefType<T> = {
|
|
14
|
+
current: ?T,
|
|
15
|
+
};
|
|
16
|
+
|
|
9
17
|
export type ChildProps = {
|
|
10
18
|
onOpen: () => void,
|
|
11
19
|
isOpen: boolean,
|
|
12
20
|
height: ?number,
|
|
13
21
|
pageBottom: ?number,
|
|
14
|
-
cancelNext: () => void,
|
|
15
22
|
clickAway: () => void,
|
|
16
|
-
|
|
23
|
+
boundaryRef: BoundaryRefType<?HTMLElement>,
|
|
24
|
+
triggerRef: TriggerRefType<?HTMLElement>,
|
|
17
25
|
};
|
|
18
26
|
|
|
19
27
|
export type ClickAwayRefType = ?{
|
|
@@ -26,7 +34,6 @@ export type ClickAwayRefType = ?{
|
|
|
26
34
|
export type ClickAwayProps = {
|
|
27
35
|
closeOnEscapeKeypress?: boolean,
|
|
28
36
|
children: (props: ChildProps) => React.Node,
|
|
29
|
-
shouldCancel: (event: MouseEvent) => boolean,
|
|
30
37
|
onChange?: (isOpen: boolean) => mixed,
|
|
31
38
|
clickAwayRef?: ClickAwayRefType,
|
|
32
39
|
};
|
|
@@ -41,10 +48,8 @@ type ClickAwayState = {
|
|
|
41
48
|
|
|
42
49
|
export class ClickAway extends React.Component<ClickAwayProps, ClickAwayState> {
|
|
43
50
|
static defaultProps: {
|
|
44
|
-
shouldCancel: () => boolean,
|
|
45
51
|
closeOnEscapeKeypress?: boolean,
|
|
46
52
|
} = {
|
|
47
|
-
shouldCancel: () => false,
|
|
48
53
|
closeOnEscapeKeypress: true,
|
|
49
54
|
};
|
|
50
55
|
|
|
@@ -55,7 +60,8 @@ export class ClickAway extends React.Component<ClickAwayProps, ClickAwayState> {
|
|
|
55
60
|
};
|
|
56
61
|
|
|
57
62
|
el: ?HTMLElement = null;
|
|
58
|
-
|
|
63
|
+
boundaryRef: BoundaryRefType<?HTMLElement> = React.createRef();
|
|
64
|
+
triggerRef: TriggerRefType<?HTMLElement> = React.createRef();
|
|
59
65
|
|
|
60
66
|
componentDidMount() {
|
|
61
67
|
if (this.el) {
|
|
@@ -70,7 +76,9 @@ export class ClickAway extends React.Component<ClickAwayProps, ClickAwayState> {
|
|
|
70
76
|
const {isOpen} = this.state;
|
|
71
77
|
if (prevState.isOpen !== isOpen) {
|
|
72
78
|
if (this.state.isOpen) {
|
|
73
|
-
window.document.addEventListener('click', this.handleCloseClick
|
|
79
|
+
window.document.addEventListener('click', this.handleCloseClick, {
|
|
80
|
+
capture: true,
|
|
81
|
+
});
|
|
74
82
|
if (this.props.closeOnEscapeKeypress) {
|
|
75
83
|
window.document.addEventListener(
|
|
76
84
|
'keyup',
|
|
@@ -78,7 +86,9 @@ export class ClickAway extends React.Component<ClickAwayProps, ClickAwayState> {
|
|
|
78
86
|
);
|
|
79
87
|
}
|
|
80
88
|
} else {
|
|
81
|
-
window.document.removeEventListener('click', this.handleCloseClick
|
|
89
|
+
window.document.removeEventListener('click', this.handleCloseClick, {
|
|
90
|
+
capture: true,
|
|
91
|
+
});
|
|
82
92
|
window.document.removeEventListener(
|
|
83
93
|
'keyup',
|
|
84
94
|
this.handleCloseOnEscapeKeypress,
|
|
@@ -88,7 +98,9 @@ export class ClickAway extends React.Component<ClickAwayProps, ClickAwayState> {
|
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
componentWillUnmount() {
|
|
91
|
-
window.document.removeEventListener('click', this.handleCloseClick
|
|
101
|
+
window.document.removeEventListener('click', this.handleCloseClick, {
|
|
102
|
+
capture: true,
|
|
103
|
+
});
|
|
92
104
|
window.document.removeEventListener(
|
|
93
105
|
'keyup',
|
|
94
106
|
this.handleCloseOnEscapeKeypress,
|
|
@@ -98,7 +110,6 @@ export class ClickAway extends React.Component<ClickAwayProps, ClickAwayState> {
|
|
|
98
110
|
render(): React.Node {
|
|
99
111
|
const {height, isOpen, pageBottom} = this.state;
|
|
100
112
|
const {clickAwayRef} = this.props;
|
|
101
|
-
|
|
102
113
|
if (clickAwayRef) {
|
|
103
114
|
clickAwayRef.current = {
|
|
104
115
|
forceClose: this.forceClose,
|
|
@@ -110,9 +121,9 @@ export class ClickAway extends React.Component<ClickAwayProps, ClickAwayState> {
|
|
|
110
121
|
isOpen,
|
|
111
122
|
height,
|
|
112
123
|
pageBottom,
|
|
113
|
-
cancelNext: this.cancelNextClickAway,
|
|
114
124
|
clickAway: this.forceClose,
|
|
115
|
-
|
|
125
|
+
boundaryRef: this.boundaryRef,
|
|
126
|
+
triggerRef: this.triggerRef,
|
|
116
127
|
});
|
|
117
128
|
}
|
|
118
129
|
|
|
@@ -126,7 +137,7 @@ export class ClickAway extends React.Component<ClickAwayProps, ClickAwayState> {
|
|
|
126
137
|
|
|
127
138
|
this.setState(
|
|
128
139
|
{
|
|
129
|
-
isOpen:
|
|
140
|
+
isOpen: !this.state.isOpen,
|
|
130
141
|
pageBottom,
|
|
131
142
|
},
|
|
132
143
|
this.handleOnChange,
|
|
@@ -134,20 +145,30 @@ export class ClickAway extends React.Component<ClickAwayProps, ClickAwayState> {
|
|
|
134
145
|
};
|
|
135
146
|
|
|
136
147
|
handleCloseClick: (evt: MouseEvent) => void = (evt: MouseEvent) => {
|
|
137
|
-
if (
|
|
148
|
+
if (
|
|
149
|
+
evt.target instanceof Node &&
|
|
150
|
+
this.boundaryRef &&
|
|
151
|
+
(this.boundaryRef === evt.target ||
|
|
152
|
+
this.boundaryRef.current?.contains(evt.target))
|
|
153
|
+
) {
|
|
138
154
|
return;
|
|
139
155
|
}
|
|
140
156
|
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
this.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
this.handleOnChange,
|
|
149
|
-
);
|
|
157
|
+
if (
|
|
158
|
+
evt.target instanceof Node &&
|
|
159
|
+
this.triggerRef &&
|
|
160
|
+
(this.triggerRef === evt.target ||
|
|
161
|
+
this.triggerRef.current?.contains(evt.target))
|
|
162
|
+
) {
|
|
163
|
+
return;
|
|
150
164
|
}
|
|
165
|
+
|
|
166
|
+
this.setState(
|
|
167
|
+
{
|
|
168
|
+
isOpen: false,
|
|
169
|
+
},
|
|
170
|
+
this.handleOnChange,
|
|
171
|
+
);
|
|
151
172
|
};
|
|
152
173
|
|
|
153
174
|
handleCloseOnEscapeKeypress: (
|
|
@@ -162,10 +183,6 @@ export class ClickAway extends React.Component<ClickAwayProps, ClickAwayState> {
|
|
|
162
183
|
this.setState({isOpen: false}, this.handleOnChange);
|
|
163
184
|
};
|
|
164
185
|
|
|
165
|
-
cancelNextClickAway: () => void = () => {
|
|
166
|
-
this.cancelNext = true;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
186
|
handleOnChange: () => mixed = () =>
|
|
170
187
|
this.props.onChange && this.props.onChange(this.state.isOpen);
|
|
171
188
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @flow strict
|
|
2
2
|
export function mergeRefs(
|
|
3
|
-
refs: Array<{current: ?HTMLElement
|
|
4
|
-
): (value:
|
|
3
|
+
refs: Array<{current: ?HTMLElement}>,
|
|
4
|
+
): (value: ?HTMLElement) => void {
|
|
5
5
|
return (value) => {
|
|
6
6
|
refs.forEach((ref) => {
|
|
7
7
|
if (typeof ref === 'function') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spaced-out/ui-design-system",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "Sense UI components library",
|
|
6
6
|
"author": {
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"node-sass": "^7.0.0",
|
|
105
105
|
"paths.macro": "^3.0.1",
|
|
106
106
|
"prettier": "^2.5.1",
|
|
107
|
-
"react": "
|
|
108
|
-
"react-dom": "
|
|
107
|
+
"react": "17.0.2",
|
|
108
|
+
"react-dom": "17.0.2",
|
|
109
109
|
"rimraf": "^3.0.2",
|
|
110
110
|
"simple-git": "^3.12.0",
|
|
111
111
|
"standard-version": "^9.5.0",
|