@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
|
@@ -31,59 +31,6 @@ type BaseNotificationProps = {
|
|
|
31
31
|
onCloseClick?: ?(SyntheticEvent<HTMLElement>) => mixed,
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
// Base Notification will not have any state.
|
|
35
|
-
|
|
36
|
-
const BaseNotification = (props: BaseNotificationProps): React.Node => {
|
|
37
|
-
const {
|
|
38
|
-
classNames,
|
|
39
|
-
semantic = NOTIFICATION_SEMANTIC.success,
|
|
40
|
-
iconLeftName,
|
|
41
|
-
iconLeftType = 'regular',
|
|
42
|
-
dismissable,
|
|
43
|
-
children,
|
|
44
|
-
onCloseClick,
|
|
45
|
-
} = props;
|
|
46
|
-
return (
|
|
47
|
-
<div
|
|
48
|
-
className={classify(
|
|
49
|
-
css.baseContainer,
|
|
50
|
-
{
|
|
51
|
-
[css.success]: semantic === NOTIFICATION_SEMANTIC.success,
|
|
52
|
-
[css.information]: semantic === NOTIFICATION_SEMANTIC.information,
|
|
53
|
-
[css.danger]: semantic === NOTIFICATION_SEMANTIC.danger,
|
|
54
|
-
[css.dismissable]: dismissable,
|
|
55
|
-
},
|
|
56
|
-
classNames?.wrapper,
|
|
57
|
-
)}
|
|
58
|
-
>
|
|
59
|
-
{iconLeftName ? (
|
|
60
|
-
<Icon
|
|
61
|
-
name={iconLeftName}
|
|
62
|
-
color={TEXT_COLORS.inversePrimary}
|
|
63
|
-
size="small"
|
|
64
|
-
type={iconLeftType}
|
|
65
|
-
/>
|
|
66
|
-
) : null}
|
|
67
|
-
<SubTitleSmall
|
|
68
|
-
className={classify(classNames?.text)}
|
|
69
|
-
color={TEXT_COLORS.inversePrimary}
|
|
70
|
-
>
|
|
71
|
-
{children}
|
|
72
|
-
</SubTitleSmall>
|
|
73
|
-
{dismissable && (
|
|
74
|
-
<Icon
|
|
75
|
-
color={TEXT_COLORS.inversePrimary}
|
|
76
|
-
name="close"
|
|
77
|
-
size="small"
|
|
78
|
-
type="regular"
|
|
79
|
-
onClick={onCloseClick}
|
|
80
|
-
className={css.closeIcon}
|
|
81
|
-
/>
|
|
82
|
-
)}
|
|
83
|
-
</div>
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
34
|
type NotificationBaseProps = {
|
|
88
35
|
...BaseNotificationProps,
|
|
89
36
|
classNames?: ClassNames,
|
|
@@ -101,37 +48,102 @@ export type NotificationProps = {
|
|
|
101
48
|
semantic: NotificationSemanticType,
|
|
102
49
|
};
|
|
103
50
|
|
|
104
|
-
|
|
105
|
-
const {
|
|
106
|
-
classNames,
|
|
107
|
-
semantic = NOTIFICATION_SEMANTIC.success,
|
|
108
|
-
iconLeftName,
|
|
109
|
-
iconLeftType,
|
|
110
|
-
dismissable,
|
|
111
|
-
children,
|
|
112
|
-
selfDismiss = false,
|
|
113
|
-
onCloseClick,
|
|
114
|
-
} = props;
|
|
115
|
-
const [dismissed, setDismissed] = React.useState(false);
|
|
116
|
-
const closeClickHandler = (e) => {
|
|
117
|
-
onCloseClick && onCloseClick(e);
|
|
118
|
-
selfDismiss && setDismissed(true);
|
|
119
|
-
};
|
|
51
|
+
// Base Notification will not have any state.
|
|
120
52
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
53
|
+
const BaseNotification: React$AbstractComponent<
|
|
54
|
+
BaseNotificationProps,
|
|
55
|
+
HTMLDivElement,
|
|
56
|
+
> = React.forwardRef<BaseNotificationProps, HTMLDivElement>(
|
|
57
|
+
(props: BaseNotificationProps, ref): React.Node => {
|
|
58
|
+
const {
|
|
59
|
+
classNames,
|
|
60
|
+
semantic = NOTIFICATION_SEMANTIC.success,
|
|
61
|
+
iconLeftName,
|
|
62
|
+
iconLeftType = 'regular',
|
|
63
|
+
dismissable,
|
|
64
|
+
children,
|
|
65
|
+
onCloseClick,
|
|
66
|
+
} = props;
|
|
67
|
+
return (
|
|
68
|
+
<div
|
|
69
|
+
className={classify(
|
|
70
|
+
css.baseContainer,
|
|
71
|
+
{
|
|
72
|
+
[css.success]: semantic === NOTIFICATION_SEMANTIC.success,
|
|
73
|
+
[css.information]: semantic === NOTIFICATION_SEMANTIC.information,
|
|
74
|
+
[css.danger]: semantic === NOTIFICATION_SEMANTIC.danger,
|
|
75
|
+
[css.dismissable]: dismissable,
|
|
76
|
+
},
|
|
77
|
+
classNames?.wrapper,
|
|
78
|
+
)}
|
|
79
|
+
ref={ref}
|
|
80
|
+
>
|
|
81
|
+
{iconLeftName ? (
|
|
82
|
+
<Icon
|
|
83
|
+
name={iconLeftName}
|
|
84
|
+
color={TEXT_COLORS.inversePrimary}
|
|
85
|
+
size="small"
|
|
86
|
+
type={iconLeftType}
|
|
87
|
+
/>
|
|
88
|
+
) : null}
|
|
89
|
+
<SubTitleSmall
|
|
90
|
+
className={classify(classNames?.text)}
|
|
91
|
+
color={TEXT_COLORS.inversePrimary}
|
|
131
92
|
>
|
|
132
93
|
{children}
|
|
133
|
-
</
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
94
|
+
</SubTitleSmall>
|
|
95
|
+
{dismissable && (
|
|
96
|
+
<Icon
|
|
97
|
+
color={TEXT_COLORS.inversePrimary}
|
|
98
|
+
name="close"
|
|
99
|
+
size="small"
|
|
100
|
+
type="regular"
|
|
101
|
+
onClick={onCloseClick}
|
|
102
|
+
className={css.closeIcon}
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
},
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
export const Notification: React$AbstractComponent<
|
|
111
|
+
NotificationProps,
|
|
112
|
+
HTMLDivElement,
|
|
113
|
+
> = React.forwardRef<NotificationProps, HTMLDivElement>(
|
|
114
|
+
(props: NotificationProps, ref): React.Node => {
|
|
115
|
+
const {
|
|
116
|
+
classNames,
|
|
117
|
+
semantic = NOTIFICATION_SEMANTIC.success,
|
|
118
|
+
iconLeftName,
|
|
119
|
+
iconLeftType,
|
|
120
|
+
dismissable,
|
|
121
|
+
children,
|
|
122
|
+
selfDismiss = false,
|
|
123
|
+
onCloseClick,
|
|
124
|
+
} = props;
|
|
125
|
+
const [dismissed, setDismissed] = React.useState(false);
|
|
126
|
+
const closeClickHandler = (e) => {
|
|
127
|
+
onCloseClick && onCloseClick(e);
|
|
128
|
+
selfDismiss && setDismissed(true);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<>
|
|
133
|
+
{!dismissed && (
|
|
134
|
+
<BaseNotification
|
|
135
|
+
classNames={classNames}
|
|
136
|
+
iconLeftName={iconLeftName}
|
|
137
|
+
iconLeftType={iconLeftType}
|
|
138
|
+
semantic={semantic}
|
|
139
|
+
dismissable={dismissable}
|
|
140
|
+
onCloseClick={closeClickHandler}
|
|
141
|
+
ref={ref}
|
|
142
|
+
>
|
|
143
|
+
{children}
|
|
144
|
+
</BaseNotification>
|
|
145
|
+
)}
|
|
146
|
+
</>
|
|
147
|
+
);
|
|
148
|
+
},
|
|
149
|
+
);
|
|
@@ -12,7 +12,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
|
14
14
|
|
|
15
|
-
const OptionButton = _ref => {
|
|
15
|
+
const OptionButton = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
16
16
|
let {
|
|
17
17
|
children,
|
|
18
18
|
iconLeftName,
|
|
@@ -21,6 +21,7 @@ const OptionButton = _ref => {
|
|
|
21
21
|
isFluid,
|
|
22
22
|
disabled,
|
|
23
23
|
size,
|
|
24
|
+
isLoading,
|
|
24
25
|
menu,
|
|
25
26
|
anchorPosition,
|
|
26
27
|
onOptionSelect,
|
|
@@ -32,7 +33,8 @@ const OptionButton = _ref => {
|
|
|
32
33
|
} = _ref;
|
|
33
34
|
const [iconName, setIconName] = React.useState('chevron-down');
|
|
34
35
|
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
className: _OptionButtonModule.default.container
|
|
36
|
+
className: _OptionButtonModule.default.container,
|
|
37
|
+
ref: ref
|
|
36
38
|
}, /*#__PURE__*/React.createElement(_Button.Button, {
|
|
37
39
|
iconLeftName: iconLeftName,
|
|
38
40
|
iconLeftType: iconLeftType,
|
|
@@ -45,7 +47,8 @@ const OptionButton = _ref => {
|
|
|
45
47
|
disabled: disabled,
|
|
46
48
|
isFluid: isFluid,
|
|
47
49
|
ariaLabel: ariaLabel,
|
|
48
|
-
actionType: actionType
|
|
50
|
+
actionType: actionType,
|
|
51
|
+
isLoading: isLoading
|
|
49
52
|
}, children), /*#__PURE__*/React.createElement(_ButtonDropdown.ButtonDropdown, {
|
|
50
53
|
anchorPosition: anchorPosition,
|
|
51
54
|
ariaLabel: ariaLabel,
|
|
@@ -68,5 +71,5 @@ const OptionButton = _ref => {
|
|
|
68
71
|
onOptionSelect: onOptionSelect,
|
|
69
72
|
size: size
|
|
70
73
|
}));
|
|
71
|
-
};
|
|
74
|
+
});
|
|
72
75
|
exports.OptionButton = OptionButton;
|
|
@@ -22,63 +22,73 @@ export type OptionButtonProps = {
|
|
|
22
22
|
...
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
export const OptionButton
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
25
|
+
export const OptionButton: React$AbstractComponent<
|
|
26
|
+
OptionButtonProps,
|
|
27
|
+
HTMLDivElement,
|
|
28
|
+
> = React.forwardRef<OptionButtonProps, HTMLDivElement>(
|
|
29
|
+
(
|
|
30
|
+
{
|
|
31
|
+
children,
|
|
32
|
+
iconLeftName,
|
|
33
|
+
iconLeftType,
|
|
34
|
+
type,
|
|
35
|
+
isFluid,
|
|
36
|
+
disabled,
|
|
37
|
+
size,
|
|
38
|
+
isLoading,
|
|
39
|
+
menu,
|
|
40
|
+
anchorPosition,
|
|
41
|
+
onOptionSelect,
|
|
42
|
+
onButtonClick,
|
|
43
|
+
onMenuOpen,
|
|
44
|
+
onMenuClose,
|
|
45
|
+
ariaLabel,
|
|
46
|
+
actionType,
|
|
47
|
+
}: OptionButtonProps,
|
|
48
|
+
ref,
|
|
49
|
+
): React.Node => {
|
|
50
|
+
const [iconName, setIconName] = React.useState('chevron-down');
|
|
43
51
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
52
|
+
return (
|
|
53
|
+
<div className={css.container} ref={ref}>
|
|
54
|
+
<Button
|
|
55
|
+
iconLeftName={iconLeftName}
|
|
56
|
+
iconLeftType={iconLeftType}
|
|
57
|
+
onClick={onButtonClick}
|
|
58
|
+
size={size}
|
|
59
|
+
type={type}
|
|
60
|
+
classNames={{wrapper: css.leftButton}}
|
|
61
|
+
disabled={disabled}
|
|
62
|
+
isFluid={isFluid}
|
|
63
|
+
ariaLabel={ariaLabel}
|
|
64
|
+
actionType={actionType}
|
|
65
|
+
isLoading={isLoading}
|
|
66
|
+
>
|
|
67
|
+
{children}
|
|
68
|
+
</Button>
|
|
69
|
+
<ButtonDropdown
|
|
70
|
+
anchorPosition={anchorPosition}
|
|
71
|
+
ariaLabel={ariaLabel}
|
|
72
|
+
iconLeftName={iconName}
|
|
73
|
+
classNames={{
|
|
74
|
+
buttonWrapper: css.rightButton,
|
|
75
|
+
dropdownContainer: css.dropDownContainer,
|
|
76
|
+
}}
|
|
77
|
+
type={type}
|
|
78
|
+
disabled={disabled}
|
|
79
|
+
menu={menu}
|
|
80
|
+
onMenuClose={() => {
|
|
81
|
+
setIconName('chevron-down');
|
|
82
|
+
onMenuOpen && onMenuOpen();
|
|
83
|
+
}}
|
|
84
|
+
onMenuOpen={() => {
|
|
85
|
+
setIconName('chevron-up');
|
|
86
|
+
onMenuClose && onMenuClose();
|
|
87
|
+
}}
|
|
88
|
+
onOptionSelect={onOptionSelect}
|
|
89
|
+
size={size}
|
|
90
|
+
/>
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
},
|
|
94
|
+
);
|
|
@@ -144,7 +144,7 @@ const PageName = _ref3 => {
|
|
|
144
144
|
};
|
|
145
145
|
exports.PageName = PageName;
|
|
146
146
|
PageName.displayName = 'PageName';
|
|
147
|
-
const PageTitle = _ref4 => {
|
|
147
|
+
const PageTitle = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
148
148
|
let {
|
|
149
149
|
classNames,
|
|
150
150
|
children,
|
|
@@ -165,7 +165,8 @@ const PageTitle = _ref4 => {
|
|
|
165
165
|
};
|
|
166
166
|
return /*#__PURE__*/React.createElement("div", {
|
|
167
167
|
"data-testid": "PageTitle",
|
|
168
|
-
className: (0, _classify.default)(_PageTitleModule.default.pageTitleWrapper, classNames?.wrapper)
|
|
168
|
+
className: (0, _classify.default)(_PageTitleModule.default.pageTitleWrapper, classNames?.wrapper),
|
|
169
|
+
ref: ref
|
|
169
170
|
}, /*#__PURE__*/React.createElement("div", {
|
|
170
171
|
className: (0, _classify.default)(_PageTitleModule.default.leftSlot, classNames?.leftSlot)
|
|
171
172
|
}, pageNameKey && PAGE_NAME_LIST[pageNameKey] ? /*#__PURE__*/React.createElement(PageName, null, /*#__PURE__*/React.createElement(_Text.TitleMedium, null, PAGE_NAME_LIST[pageNameKey].title, " "), /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
@@ -177,5 +178,5 @@ const PageTitle = _ref4 => {
|
|
|
177
178
|
})) : getNamedComp('PageName'), getNamedComp('TabSlot')), /*#__PURE__*/React.createElement("div", {
|
|
178
179
|
className: (0, _classify.default)(_PageTitleModule.default.rightSlot, classNames?.rightSlot)
|
|
179
180
|
}, getNamedComp('RightSlot')));
|
|
180
|
-
};
|
|
181
|
+
});
|
|
181
182
|
exports.PageTitle = PageTitle;
|
|
@@ -161,50 +161,52 @@ export const PageName = ({children, ...props}: PageNameProps): React.Node => (
|
|
|
161
161
|
);
|
|
162
162
|
PageName.displayName = 'PageName';
|
|
163
163
|
|
|
164
|
-
export const PageTitle
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}: PageTitleProps): React.Node => {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
164
|
+
export const PageTitle: React$AbstractComponent<
|
|
165
|
+
PageTitleProps,
|
|
166
|
+
HTMLDivElement,
|
|
167
|
+
> = React.forwardRef<PageTitleProps, HTMLDivElement>(
|
|
168
|
+
({classNames, children, pageNameKey}: PageTitleProps, ref): React.Node => {
|
|
169
|
+
const getNamedComp = (comp: string) => {
|
|
170
|
+
const childrenArray = React.Children.toArray(children);
|
|
171
|
+
if (childrenArray.length) {
|
|
172
|
+
const nodes: React.Node[] = [];
|
|
173
|
+
for (const child of childrenArray) {
|
|
174
|
+
if (child?.type?.displayName === comp) {
|
|
175
|
+
nodes.push(child);
|
|
176
|
+
}
|
|
176
177
|
}
|
|
178
|
+
return nodes.length > 1 ? nodes : nodes[0];
|
|
177
179
|
}
|
|
178
|
-
return
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
180
|
+
return null;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
return (
|
|
184
|
+
<div
|
|
185
|
+
data-testid="PageTitle"
|
|
186
|
+
className={classify(css.pageTitleWrapper, classNames?.wrapper)}
|
|
187
|
+
ref={ref}
|
|
188
|
+
>
|
|
189
|
+
<div className={classify(css.leftSlot, classNames?.leftSlot)}>
|
|
190
|
+
{pageNameKey && PAGE_NAME_LIST[pageNameKey] ? (
|
|
191
|
+
<PageName>
|
|
192
|
+
<TitleMedium>{PAGE_NAME_LIST[pageNameKey].title} </TitleMedium>
|
|
193
|
+
<Icon
|
|
194
|
+
type={PAGE_NAME_LIST[pageNameKey].iconType}
|
|
195
|
+
name={PAGE_NAME_LIST[pageNameKey].iconName}
|
|
196
|
+
size="medium"
|
|
197
|
+
color={TEXT_COLORS.primary}
|
|
198
|
+
swapOpacity={PAGE_NAME_LIST[pageNameKey].iconSwapOpacity}
|
|
199
|
+
/>
|
|
200
|
+
</PageName>
|
|
201
|
+
) : (
|
|
202
|
+
getNamedComp('PageName')
|
|
203
|
+
)}
|
|
204
|
+
{getNamedComp('TabSlot')}
|
|
205
|
+
</div>
|
|
206
|
+
<div className={classify(css.rightSlot, classNames?.rightSlot)}>
|
|
207
|
+
{getNamedComp('RightSlot')}
|
|
208
|
+
</div>
|
|
207
209
|
</div>
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
210
|
+
);
|
|
211
|
+
},
|
|
212
|
+
);
|
|
@@ -23,10 +23,10 @@ const PaginationButton = props => {
|
|
|
23
23
|
} = props;
|
|
24
24
|
const paginationBtnRef = React.useRef(null);
|
|
25
25
|
React.useEffect(() => {
|
|
26
|
-
if (
|
|
26
|
+
if (selected) {
|
|
27
27
|
paginationBtnRef.current?.blur();
|
|
28
28
|
}
|
|
29
|
-
}, [
|
|
29
|
+
}, [selected]);
|
|
30
30
|
switch (type) {
|
|
31
31
|
case 'first':
|
|
32
32
|
return /*#__PURE__*/React.createElement(_Button.Button, {
|
|
@@ -16,10 +16,10 @@ export const PaginationButton = (props: PaginationItemProps): React.Node => {
|
|
|
16
16
|
const paginationBtnRef = React.useRef(null);
|
|
17
17
|
|
|
18
18
|
React.useEffect(() => {
|
|
19
|
-
if (
|
|
19
|
+
if (selected) {
|
|
20
20
|
paginationBtnRef.current?.blur();
|
|
21
21
|
}
|
|
22
|
-
}, [
|
|
22
|
+
}, [selected]);
|
|
23
23
|
|
|
24
24
|
switch (type) {
|
|
25
25
|
case 'first':
|
|
@@ -13,7 +13,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
13
13
|
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); }
|
|
14
14
|
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; }
|
|
15
15
|
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); }
|
|
16
|
-
const SearchInput = _ref => {
|
|
16
|
+
const SearchInput = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
17
17
|
let {
|
|
18
18
|
value,
|
|
19
19
|
disabled,
|
|
@@ -33,6 +33,7 @@ const SearchInput = _ref => {
|
|
|
33
33
|
className: (0, _classify.default)(_SearchInputModule.default.searchInputWrapper, classNames?.wrapper)
|
|
34
34
|
}, /*#__PURE__*/React.createElement(_Input.Input, _extends({}, searchInputProps, {
|
|
35
35
|
type: "text",
|
|
36
|
+
ref: ref,
|
|
36
37
|
classNames: {
|
|
37
38
|
iconRight: value && !(disabled || locked) ? _SearchInputModule.default.clickable : '',
|
|
38
39
|
iconLeft: value && !disabled ? _SearchInputModule.default.primaryText : '',
|
|
@@ -55,5 +56,5 @@ const SearchInput = _ref => {
|
|
|
55
56
|
className: _SearchInputModule.default.loader,
|
|
56
57
|
size: "small"
|
|
57
58
|
})));
|
|
58
|
-
};
|
|
59
|
+
});
|
|
59
60
|
exports.SearchInput = SearchInput;
|
|
@@ -24,54 +24,63 @@ export type SearchInputProps = {
|
|
|
24
24
|
...
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
export const SearchInput
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
export const SearchInput: React$AbstractComponent<
|
|
28
|
+
SearchInputProps,
|
|
29
|
+
HTMLInputElement,
|
|
30
|
+
> = React.forwardRef<SearchInputProps, HTMLInputElement>(
|
|
31
|
+
(
|
|
32
|
+
{
|
|
33
|
+
value,
|
|
34
|
+
disabled,
|
|
35
|
+
locked,
|
|
36
|
+
placeholder = 'Search...',
|
|
37
|
+
classNames,
|
|
38
|
+
onClear,
|
|
39
|
+
isLoading,
|
|
40
|
+
size,
|
|
41
|
+
iconLeftName = 'magnifying-glass',
|
|
42
|
+
...searchInputProps
|
|
43
|
+
}: SearchInputProps,
|
|
44
|
+
ref,
|
|
45
|
+
): React.Node => {
|
|
46
|
+
const handleClearClick = () => {
|
|
47
|
+
onClear?.();
|
|
48
|
+
};
|
|
42
49
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
50
|
+
return (
|
|
51
|
+
<div className={classify(css.searchInputWrapper, classNames?.wrapper)}>
|
|
52
|
+
<Input
|
|
53
|
+
{...searchInputProps}
|
|
54
|
+
type="text"
|
|
55
|
+
ref={ref}
|
|
56
|
+
classNames={{
|
|
57
|
+
iconRight: value && !(disabled || locked) ? css.clickable : '',
|
|
58
|
+
iconLeft: value && !disabled ? css.primaryText : '',
|
|
59
|
+
box: classNames?.box,
|
|
60
|
+
}}
|
|
61
|
+
placeholder={placeholder}
|
|
62
|
+
value={value}
|
|
63
|
+
disabled={disabled}
|
|
64
|
+
locked={locked}
|
|
65
|
+
iconLeftName={iconLeftName}
|
|
66
|
+
size={size}
|
|
67
|
+
iconRightName={value && !(disabled || locked) ? 'xmark' : 'fw'}
|
|
68
|
+
onIconRightClick={handleClearClick}
|
|
69
|
+
/>
|
|
70
|
+
{isLoading && (
|
|
71
|
+
<div
|
|
72
|
+
className={classify(css.loaderContainer, {
|
|
73
|
+
[css.small]: size === 'small',
|
|
74
|
+
})}
|
|
75
|
+
>
|
|
76
|
+
<CircularLoader
|
|
77
|
+
colorToken="colorFillPrimary"
|
|
78
|
+
className={css.loader}
|
|
79
|
+
size="small"
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
)}
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
},
|
|
86
|
+
);
|