@spaced-out/ui-design-system 0.1.16 → 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.
- package/.cspell/custom-words.txt +3 -0
- package/.flowconfig +1 -1
- package/CHANGELOG.md +7 -0
- package/CONTRIBUTING.md +52 -6
- package/README.md +144 -8
- package/gulpfile.js +1 -0
- package/lib/components/AvatarGroup/AvatarGroup.js +4 -3
- package/lib/components/AvatarGroup/AvatarGroup.js.flow +119 -110
- package/lib/components/Badge/Badge.js +4 -3
- package/lib/components/Badge/Badge.js.flow +21 -21
- package/lib/components/Badge/index.js +11 -7
- package/lib/components/Badge/index.js.flow +1 -2
- package/lib/components/Banner/Banner.js +3 -2
- package/lib/components/Banner/Banner.js.flow +42 -35
- package/lib/components/Button/Button.js +50 -10
- package/lib/components/Button/Button.js.flow +87 -23
- package/lib/components/Button/Button.module.css +14 -0
- package/lib/components/ButtonTabs/ButtonTab/ButtonTab.js +3 -2
- package/lib/components/ButtonTabs/ButtonTab/ButtonTab.js.flow +48 -38
- package/lib/components/ButtonTabs/ButtonTabs.js +3 -2
- package/lib/components/ButtonTabs/ButtonTabs.js.flow +50 -41
- package/lib/components/Card/Card.js +16 -7
- package/lib/components/Card/Card.js.flow +73 -55
- package/lib/components/Chip/Chip.js +3 -2
- package/lib/components/Chip/Chip.js.flow +66 -59
- package/lib/components/CircularLoader/CircularLoader.js +9 -4
- package/lib/components/CircularLoader/CircularLoader.js.flow +38 -24
- package/lib/components/CollapsibleCard/CollapsibleCard.js +4 -3
- package/lib/components/CollapsibleCard/CollapsibleCard.js.flow +68 -59
- package/lib/components/Dropdown/Dropdown.js +4 -3
- package/lib/components/Dropdown/Dropdown.js.flow +83 -74
- package/lib/components/EmptyState/EmptyState.js +4 -3
- package/lib/components/EmptyState/EmptyState.js.flow +53 -44
- package/lib/components/ErrorMessage/ErrorMessage.js +4 -3
- package/lib/components/ErrorMessage/ErrorMessage.js.flow +58 -49
- package/lib/components/InContextAlert/InContextAlert.js +4 -3
- package/lib/components/InContextAlert/InContextAlert.js.flow +79 -73
- package/lib/components/InlineDropdown/InlineDropdown.js +4 -3
- package/lib/components/InlineDropdown/InlineDropdown.js.flow +94 -85
- package/lib/components/LinearLoader/LinearLoader.js +4 -3
- package/lib/components/LinearLoader/LinearLoader.js.flow +20 -18
- package/lib/components/Link/Link.js +8 -1
- package/lib/components/Link/Link.js.flow +44 -36
- package/lib/components/Notification/Notification.js +8 -6
- package/lib/components/Notification/Notification.js.flow +96 -84
- package/lib/components/OptionButton/OptionButton.js +7 -4
- package/lib/components/OptionButton/OptionButton.js.flow +69 -59
- package/lib/components/PageTitle/PageTitle.js +4 -3
- package/lib/components/PageTitle/PageTitle.js.flow +46 -44
- package/lib/components/Pagination/PaginationItem.js +2 -2
- package/lib/components/Pagination/PaginationItem.js.flow +2 -2
- package/lib/components/SearchInput/SearchInput.js +3 -2
- package/lib/components/SearchInput/SearchInput.js.flow +59 -50
- package/lib/components/SideMenuLink/SideMenuLink.js +4 -3
- package/lib/components/SideMenuLink/SideMenuLink.js.flow +54 -45
- package/lib/components/StatusIndicator/StatusIndicator.js +3 -2
- package/lib/components/StatusIndicator/StatusIndicator.js.flow +32 -23
- package/lib/components/SubMenu/SubMenu.js +4 -3
- package/lib/components/SubMenu/SubMenu.js.flow +41 -38
- package/lib/components/Table/StaticTable.js +3 -0
- package/lib/components/Table/StaticTable.js.flow +3 -0
- package/lib/components/Table/Table.js +10 -0
- package/lib/components/Table/Table.js.flow +10 -0
- package/lib/components/Table/hooks.js +1 -0
- package/lib/components/Table/hooks.js.flow +1 -0
- package/lib/components/Tabs/TabList/TabList.js +3 -2
- package/lib/components/Tabs/TabList/TabList.js.flow +127 -117
- package/lib/components/Toggle/index.js +11 -7
- package/lib/components/Toggle/index.js.flow +1 -1
- package/lib/components/Tooltip/Tooltip.js.flow +2 -2
- package/lib/components/index.js +511 -0
- package/lib/components/index.js.flow +48 -0
- package/lib/index.js +60 -0
- package/lib/index.js.flow +7 -0
- package/lib/styles/index.css +15 -0
- package/lib/styles/index.js +104 -0
- package/lib/styles/index.js.flow +12 -0
- package/lib/styles/typography.module.css +0 -1
- package/lib/styles/utils.module.css +26 -0
- package/lib/types/index.js +38 -0
- package/lib/types/index.js.flow +5 -0
- package/lib/utils/index.js +93 -0
- package/lib/utils/index.js.flow +10 -0
- package/package.json +2 -1
|
@@ -112,7 +112,7 @@ const MENU_NAME_LIST = Object.freeze({
|
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
114
|
exports.MENU_NAME_LIST = MENU_NAME_LIST;
|
|
115
|
-
const SideMenuLink = _ref => {
|
|
115
|
+
const SideMenuLink = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
116
116
|
let {
|
|
117
117
|
classNames,
|
|
118
118
|
pageNameKey,
|
|
@@ -131,7 +131,8 @@ const SideMenuLink = _ref => {
|
|
|
131
131
|
[_SideMenuLinkModule.default.disabled]: disabled,
|
|
132
132
|
[_SideMenuLinkModule.default.closed]: !opened
|
|
133
133
|
}, classNames?.wrapper),
|
|
134
|
-
onClick: onChangeHandler
|
|
134
|
+
onClick: onChangeHandler,
|
|
135
|
+
ref: ref
|
|
135
136
|
}, pageNameKey && MENU_NAME_LIST[pageNameKey] ? /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
136
137
|
type: MENU_NAME_LIST[pageNameKey].iconType,
|
|
137
138
|
name: MENU_NAME_LIST[pageNameKey].iconName,
|
|
@@ -142,5 +143,5 @@ const SideMenuLink = _ref => {
|
|
|
142
143
|
color: _Text.TEXT_COLORS.inverseSecondary,
|
|
143
144
|
className: _SideMenuLinkModule.default.menuText
|
|
144
145
|
}, MENU_NAME_LIST[pageNameKey].title) : null);
|
|
145
|
-
};
|
|
146
|
+
});
|
|
146
147
|
exports.SideMenuLink = SideMenuLink;
|
|
@@ -121,48 +121,57 @@ export type SideMenuLinkProps = {
|
|
|
121
121
|
onChange?: (newValue: string) => mixed,
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
export const SideMenuLink
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
124
|
+
export const SideMenuLink: React$AbstractComponent<
|
|
125
|
+
SideMenuLinkProps,
|
|
126
|
+
HTMLDivElement,
|
|
127
|
+
> = React.forwardRef<SideMenuLinkProps, HTMLDivElement>(
|
|
128
|
+
(
|
|
129
|
+
{
|
|
130
|
+
classNames,
|
|
131
|
+
pageNameKey,
|
|
132
|
+
disabled,
|
|
133
|
+
opened,
|
|
134
|
+
selectedValue,
|
|
135
|
+
onChange,
|
|
136
|
+
}: SideMenuLinkProps,
|
|
137
|
+
ref,
|
|
138
|
+
): React.Node => {
|
|
139
|
+
const selected = selectedValue === pageNameKey;
|
|
140
|
+
const onChangeHandler = () => {
|
|
141
|
+
onChange && onChange(pageNameKey);
|
|
142
|
+
};
|
|
143
|
+
return (
|
|
144
|
+
<div
|
|
145
|
+
className={classify(
|
|
146
|
+
css.linkWrapper,
|
|
147
|
+
{
|
|
148
|
+
[css.selected]: selected,
|
|
149
|
+
[css.disabled]: disabled,
|
|
150
|
+
[css.closed]: !opened,
|
|
151
|
+
},
|
|
152
|
+
classNames?.wrapper,
|
|
153
|
+
)}
|
|
154
|
+
onClick={onChangeHandler}
|
|
155
|
+
ref={ref}
|
|
156
|
+
>
|
|
157
|
+
{pageNameKey && MENU_NAME_LIST[pageNameKey] ? (
|
|
158
|
+
<Icon
|
|
159
|
+
type={MENU_NAME_LIST[pageNameKey].iconType}
|
|
160
|
+
name={MENU_NAME_LIST[pageNameKey].iconName}
|
|
161
|
+
size="medium"
|
|
162
|
+
color={TEXT_COLORS.inverseSecondary}
|
|
163
|
+
className={css.menuIcon}
|
|
164
|
+
/>
|
|
165
|
+
) : null}
|
|
166
|
+
{pageNameKey && MENU_NAME_LIST[pageNameKey] && opened ? (
|
|
167
|
+
<SubTitleSmall
|
|
168
|
+
color={TEXT_COLORS.inverseSecondary}
|
|
169
|
+
className={css.menuText}
|
|
170
|
+
>
|
|
171
|
+
{MENU_NAME_LIST[pageNameKey].title}
|
|
172
|
+
</SubTitleSmall>
|
|
173
|
+
) : null}
|
|
174
|
+
</div>
|
|
175
|
+
);
|
|
176
|
+
},
|
|
177
|
+
);
|
|
@@ -20,7 +20,7 @@ const STATUS_SEMANTIC = Object.freeze({
|
|
|
20
20
|
neutral: 'neutral'
|
|
21
21
|
});
|
|
22
22
|
exports.STATUS_SEMANTIC = STATUS_SEMANTIC;
|
|
23
|
-
const StatusIndicator = _ref => {
|
|
23
|
+
const StatusIndicator = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
24
24
|
let {
|
|
25
25
|
classNames,
|
|
26
26
|
status = 'information',
|
|
@@ -33,9 +33,10 @@ const StatusIndicator = _ref => {
|
|
|
33
33
|
className: (0, _classify.default)(_StatusIndicatorModule.default.statusWrapper, _StatusIndicatorModule.default[status], {
|
|
34
34
|
[_StatusIndicatorModule.default.withBorder]: withBorder
|
|
35
35
|
}, classNames?.wrapper),
|
|
36
|
+
ref: ref,
|
|
36
37
|
style: {
|
|
37
38
|
'--border-color': COLORS[borderColorToken] || COLORS['colorBackgroundTertiary']
|
|
38
39
|
}
|
|
39
40
|
}));
|
|
40
|
-
};
|
|
41
|
+
});
|
|
41
42
|
exports.StatusIndicator = StatusIndicator;
|
|
@@ -28,27 +28,36 @@ export type StatusIndicatorProps = {
|
|
|
28
28
|
...
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export const StatusIndicator
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
31
|
+
export const StatusIndicator: React$AbstractComponent<
|
|
32
|
+
StatusIndicatorProps,
|
|
33
|
+
HTMLDivElement,
|
|
34
|
+
> = React.forwardRef<StatusIndicatorProps, HTMLDivElement>(
|
|
35
|
+
(
|
|
36
|
+
{
|
|
37
|
+
classNames,
|
|
38
|
+
status = 'information',
|
|
39
|
+
withBorder,
|
|
40
|
+
borderColorToken = 'colorBackgroundTertiary',
|
|
41
|
+
...props
|
|
42
|
+
}: StatusIndicatorProps,
|
|
43
|
+
ref,
|
|
44
|
+
): React.Node => (
|
|
45
|
+
<div
|
|
46
|
+
{...props}
|
|
47
|
+
data-testid="StatusIndicator"
|
|
48
|
+
className={classify(
|
|
49
|
+
css.statusWrapper,
|
|
50
|
+
css[status],
|
|
51
|
+
{
|
|
52
|
+
[css.withBorder]: withBorder,
|
|
53
|
+
},
|
|
54
|
+
classNames?.wrapper,
|
|
55
|
+
)}
|
|
56
|
+
ref={ref}
|
|
57
|
+
style={{
|
|
58
|
+
'--border-color':
|
|
59
|
+
COLORS[borderColorToken] || COLORS['colorBackgroundTertiary'],
|
|
60
|
+
}}
|
|
61
|
+
></div>
|
|
62
|
+
),
|
|
54
63
|
);
|
|
@@ -163,7 +163,7 @@ const SubMenuGroup = _ref5 => {
|
|
|
163
163
|
}, childrenWithProps));
|
|
164
164
|
};
|
|
165
165
|
exports.SubMenuGroup = SubMenuGroup;
|
|
166
|
-
const SubMenu = _ref6 => {
|
|
166
|
+
const SubMenu = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
167
167
|
let {
|
|
168
168
|
classNames,
|
|
169
169
|
children,
|
|
@@ -179,7 +179,8 @@ const SubMenu = _ref6 => {
|
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
return /*#__PURE__*/React.createElement("div", {
|
|
182
|
-
className: (0, _classify.default)(_SubMenuModule.default.subMenuWrapper, classNames?.wrapper)
|
|
182
|
+
className: (0, _classify.default)(_SubMenuModule.default.subMenuWrapper, classNames?.wrapper),
|
|
183
|
+
ref: ref
|
|
183
184
|
}, /*#__PURE__*/React.createElement("div", {
|
|
184
185
|
className: _SubMenuModule.default.subMenuTitleAndButton
|
|
185
186
|
}, /*#__PURE__*/React.createElement(_Text.SubTitleMedium, {
|
|
@@ -197,6 +198,6 @@ const SubMenu = _ref6 => {
|
|
|
197
198
|
icon: _SubMenuModule.default.subMenuCloseIcon
|
|
198
199
|
}
|
|
199
200
|
})), childrenWithProps);
|
|
200
|
-
};
|
|
201
|
+
});
|
|
201
202
|
exports.SubMenu = SubMenu;
|
|
202
203
|
SubMenu.displayName = 'SubMenu';
|
|
@@ -250,46 +250,49 @@ export type SubMenuProps = {
|
|
|
250
250
|
showClose?: boolean,
|
|
251
251
|
};
|
|
252
252
|
|
|
253
|
-
export const SubMenu =
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
});
|
|
253
|
+
export const SubMenu: React$AbstractComponent<SubMenuProps, HTMLDivElement> =
|
|
254
|
+
React.forwardRef<SubMenuProps, HTMLDivElement>(
|
|
255
|
+
(
|
|
256
|
+
{classNames, children, title, onClose, showClose = false}: SubMenuProps,
|
|
257
|
+
ref,
|
|
258
|
+
): React.Node => {
|
|
259
|
+
const childrenWithProps = React.Children.map(children, (child) => {
|
|
260
|
+
if (React.isValidElement(child)) {
|
|
261
|
+
return <div className={css.menuChildWrap}>{child}</div>;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
265
264
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
className={css.subMenuHeader}
|
|
271
|
-
color={TEXT_COLORS.inversePrimary}
|
|
265
|
+
return (
|
|
266
|
+
<div
|
|
267
|
+
className={classify(css.subMenuWrapper, classNames?.wrapper)}
|
|
268
|
+
ref={ref}
|
|
272
269
|
>
|
|
273
|
-
{
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
270
|
+
<div className={css.subMenuTitleAndButton}>
|
|
271
|
+
<SubTitleMedium
|
|
272
|
+
className={css.subMenuHeader}
|
|
273
|
+
color={TEXT_COLORS.inversePrimary}
|
|
274
|
+
>
|
|
275
|
+
{title}
|
|
276
|
+
</SubTitleMedium>
|
|
277
|
+
{showClose && (
|
|
278
|
+
<Button
|
|
279
|
+
ariaLabel="Icon Button"
|
|
280
|
+
iconRightName="close"
|
|
281
|
+
onClick={onClose}
|
|
282
|
+
size="small"
|
|
283
|
+
type="ghost"
|
|
284
|
+
actionType="button"
|
|
285
|
+
classNames={{
|
|
286
|
+
wrapper: css.subMenuCloseButton,
|
|
287
|
+
icon: css.subMenuCloseIcon,
|
|
288
|
+
}}
|
|
289
|
+
/>
|
|
290
|
+
)}
|
|
291
|
+
</div>
|
|
292
|
+
{childrenWithProps}
|
|
293
|
+
</div>
|
|
294
|
+
);
|
|
295
|
+
},
|
|
292
296
|
);
|
|
293
|
-
};
|
|
294
297
|
|
|
295
298
|
SubMenu.displayName = 'SubMenu';
|
|
@@ -39,8 +39,11 @@ function StaticTable(props) {
|
|
|
39
39
|
showHeader = true,
|
|
40
40
|
tableHeaderClassName,
|
|
41
41
|
sortable,
|
|
42
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
42
43
|
defaultSortKey,
|
|
44
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
43
45
|
defaultSortDirection = 'original',
|
|
46
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
44
47
|
onSort,
|
|
45
48
|
handleSortClick,
|
|
46
49
|
sortKey,
|
|
@@ -48,8 +48,11 @@ export function StaticTable<Data: GenericObject, Extras: GenericObject>(props: {
|
|
|
48
48
|
showHeader = true,
|
|
49
49
|
tableHeaderClassName,
|
|
50
50
|
sortable,
|
|
51
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
51
52
|
defaultSortKey,
|
|
53
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
52
54
|
defaultSortDirection = 'original',
|
|
55
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
53
56
|
onSort,
|
|
54
57
|
handleSortClick,
|
|
55
58
|
sortKey,
|
|
@@ -25,26 +25,36 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
25
25
|
*/
|
|
26
26
|
function Table(props) {
|
|
27
27
|
const {
|
|
28
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
28
29
|
className,
|
|
30
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
29
31
|
classNames,
|
|
32
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
30
33
|
Row,
|
|
31
34
|
entries,
|
|
35
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
32
36
|
extras,
|
|
37
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
33
38
|
headers,
|
|
39
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
34
40
|
showHeader = true,
|
|
41
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
35
42
|
tableHeaderClassName,
|
|
36
43
|
sortable = true,
|
|
37
44
|
defaultSortKey,
|
|
38
45
|
defaultSortDirection = 'original',
|
|
39
46
|
onSort,
|
|
47
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
40
48
|
isLoading,
|
|
41
49
|
idName = 'id',
|
|
50
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
42
51
|
emptyText
|
|
43
52
|
} = props;
|
|
44
53
|
|
|
45
54
|
/**
|
|
46
55
|
*
|
|
47
56
|
*/
|
|
57
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
48
58
|
const {
|
|
49
59
|
sortedEntries,
|
|
50
60
|
sortedKeys,
|
|
@@ -69,26 +69,36 @@ export function Table<Data: GenericObject, Extras: GenericObject>(
|
|
|
69
69
|
props: TableProps<Data, Extras>,
|
|
70
70
|
): React.Node {
|
|
71
71
|
const {
|
|
72
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
72
73
|
className,
|
|
74
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
73
75
|
classNames,
|
|
76
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
74
77
|
Row,
|
|
75
78
|
entries,
|
|
79
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
76
80
|
extras,
|
|
81
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
77
82
|
headers,
|
|
83
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
78
84
|
showHeader = true,
|
|
85
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
79
86
|
tableHeaderClassName,
|
|
80
87
|
sortable = true,
|
|
81
88
|
defaultSortKey,
|
|
82
89
|
defaultSortDirection = 'original',
|
|
83
90
|
onSort,
|
|
91
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
84
92
|
isLoading,
|
|
85
93
|
idName = 'id',
|
|
94
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
86
95
|
emptyText,
|
|
87
96
|
} = props;
|
|
88
97
|
|
|
89
98
|
/**
|
|
90
99
|
*
|
|
91
100
|
*/
|
|
101
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
92
102
|
const {sortedEntries, sortedKeys, ...sortableProps} = useSortableEntries(
|
|
93
103
|
entries,
|
|
94
104
|
idName,
|
|
@@ -33,6 +33,7 @@ function useSortableEntries(entries, idName, _ref) {
|
|
|
33
33
|
};
|
|
34
34
|
const advanceSortDirection = dir => {
|
|
35
35
|
const nextDirection = getNextDirection(dir);
|
|
36
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
36
37
|
setSortDirection(dir => nextDirection);
|
|
37
38
|
return nextDirection;
|
|
38
39
|
};
|
|
@@ -46,6 +46,7 @@ export function useSortableEntries<T: GenericObject>(
|
|
|
46
46
|
};
|
|
47
47
|
const advanceSortDirection = (dir: SortDirection) => {
|
|
48
48
|
const nextDirection = getNextDirection(dir);
|
|
49
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
49
50
|
setSortDirection((dir) => nextDirection);
|
|
50
51
|
return nextDirection;
|
|
51
52
|
};
|
|
@@ -14,7 +14,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
16
16
|
|
|
17
|
-
const TabList = _ref => {
|
|
17
|
+
const TabList = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
|
|
18
18
|
let {
|
|
19
19
|
classNames,
|
|
20
20
|
children,
|
|
@@ -24,6 +24,7 @@ const TabList = _ref => {
|
|
|
24
24
|
menuWidth
|
|
25
25
|
} = _ref;
|
|
26
26
|
const ref = React.useRef(null);
|
|
27
|
+
React.useImperativeHandle(forwardRef, () => ref.current);
|
|
27
28
|
const [containerWidth, setContainerWidth] = React.useState(0);
|
|
28
29
|
const childrenWithProps = () => {
|
|
29
30
|
const childrenArray = React.Children.toArray(children);
|
|
@@ -121,5 +122,5 @@ const TabList = _ref => {
|
|
|
121
122
|
[_TabListModule.default.smallSize]: size === 'small'
|
|
122
123
|
}, classNames?.wrapper)
|
|
123
124
|
}, containerWidth ? childrenWithProps() : null);
|
|
124
|
-
};
|
|
125
|
+
});
|
|
125
126
|
exports.TabList = TabList;
|