@spaced-out/ui-design-system 0.1.16 → 0.1.18

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 (91) hide show
  1. package/.cspell/custom-words.txt +3 -0
  2. package/.flowconfig +1 -1
  3. package/CHANGELOG.md +19 -0
  4. package/CONTRIBUTING.md +52 -6
  5. package/README.md +144 -8
  6. package/gulpfile.js +1 -0
  7. package/lib/components/AvatarGroup/AvatarGroup.js +4 -3
  8. package/lib/components/AvatarGroup/AvatarGroup.js.flow +119 -110
  9. package/lib/components/Badge/Badge.js +4 -3
  10. package/lib/components/Badge/Badge.js.flow +21 -21
  11. package/lib/components/Badge/index.js +11 -7
  12. package/lib/components/Badge/index.js.flow +1 -2
  13. package/lib/components/Banner/Banner.js +3 -2
  14. package/lib/components/Banner/Banner.js.flow +42 -35
  15. package/lib/components/Button/Button.js +50 -10
  16. package/lib/components/Button/Button.js.flow +87 -23
  17. package/lib/components/Button/Button.module.css +14 -0
  18. package/lib/components/ButtonTabs/ButtonTab/ButtonTab.js +3 -2
  19. package/lib/components/ButtonTabs/ButtonTab/ButtonTab.js.flow +48 -38
  20. package/lib/components/ButtonTabs/ButtonTabs.js +3 -2
  21. package/lib/components/ButtonTabs/ButtonTabs.js.flow +50 -41
  22. package/lib/components/Card/Card.js +16 -7
  23. package/lib/components/Card/Card.js.flow +73 -55
  24. package/lib/components/Chip/Chip.js +3 -2
  25. package/lib/components/Chip/Chip.js.flow +66 -59
  26. package/lib/components/CircularLoader/CircularLoader.js +9 -4
  27. package/lib/components/CircularLoader/CircularLoader.js.flow +38 -24
  28. package/lib/components/CollapsibleCard/CollapsibleCard.js +4 -3
  29. package/lib/components/CollapsibleCard/CollapsibleCard.js.flow +68 -59
  30. package/lib/components/Dropdown/Dropdown.js +4 -3
  31. package/lib/components/Dropdown/Dropdown.js.flow +83 -74
  32. package/lib/components/EmptyState/EmptyState.js +4 -3
  33. package/lib/components/EmptyState/EmptyState.js.flow +53 -44
  34. package/lib/components/ErrorMessage/ErrorMessage.js +4 -3
  35. package/lib/components/ErrorMessage/ErrorMessage.js.flow +58 -49
  36. package/lib/components/InContextAlert/InContextAlert.js +4 -3
  37. package/lib/components/InContextAlert/InContextAlert.js.flow +79 -73
  38. package/lib/components/InlineDropdown/InlineDropdown.js +4 -3
  39. package/lib/components/InlineDropdown/InlineDropdown.js.flow +94 -85
  40. package/lib/components/LinearLoader/LinearLoader.js +4 -3
  41. package/lib/components/LinearLoader/LinearLoader.js.flow +20 -18
  42. package/lib/components/Link/Link.js +8 -1
  43. package/lib/components/Link/Link.js.flow +44 -36
  44. package/lib/components/Notification/Notification.js +8 -6
  45. package/lib/components/Notification/Notification.js.flow +96 -84
  46. package/lib/components/OptionButton/OptionButton.js +7 -4
  47. package/lib/components/OptionButton/OptionButton.js.flow +69 -59
  48. package/lib/components/PageTitle/PageTitle.js +4 -3
  49. package/lib/components/PageTitle/PageTitle.js.flow +46 -44
  50. package/lib/components/Pagination/PaginationItem.js +2 -2
  51. package/lib/components/Pagination/PaginationItem.js.flow +2 -2
  52. package/lib/components/SearchInput/SearchInput.js +3 -2
  53. package/lib/components/SearchInput/SearchInput.js.flow +59 -50
  54. package/lib/components/SearchInput/SearchInput.module.css +1 -1
  55. package/lib/components/SideMenuLink/SideMenuLink.js +4 -3
  56. package/lib/components/SideMenuLink/SideMenuLink.js.flow +54 -45
  57. package/lib/components/StatusIndicator/StatusIndicator.js +3 -2
  58. package/lib/components/StatusIndicator/StatusIndicator.js.flow +32 -23
  59. package/lib/components/SubMenu/SubMenu.js +4 -3
  60. package/lib/components/SubMenu/SubMenu.js.flow +41 -38
  61. package/lib/components/Table/{Row.js.flow → DefaultRow.js.flow} +1 -1
  62. package/lib/components/Table/{TableHeader.js → DefaultTableHeader.js} +2 -2
  63. package/lib/components/Table/{TableHeader.js.flow → DefaultTableHeader.js.flow} +1 -1
  64. package/lib/components/Table/StaticTable.js +8 -5
  65. package/lib/components/Table/StaticTable.js.flow +5 -2
  66. package/lib/components/Table/Table.js +10 -0
  67. package/lib/components/Table/Table.js.flow +12 -2
  68. package/lib/components/Table/hooks.js +1 -0
  69. package/lib/components/Table/hooks.js.flow +1 -0
  70. package/lib/components/Table/index.js +15 -15
  71. package/lib/components/Table/index.js.flow +2 -2
  72. package/lib/components/Tabs/TabList/TabList.js +3 -2
  73. package/lib/components/Tabs/TabList/TabList.js.flow +127 -117
  74. package/lib/components/Toggle/index.js +11 -7
  75. package/lib/components/Toggle/index.js.flow +1 -1
  76. package/lib/components/Tooltip/Tooltip.js.flow +2 -2
  77. package/lib/components/index.js +511 -0
  78. package/lib/components/index.js.flow +48 -0
  79. package/lib/index.js +60 -0
  80. package/lib/index.js.flow +7 -0
  81. package/lib/styles/index.css +15 -0
  82. package/lib/styles/index.js +104 -0
  83. package/lib/styles/index.js.flow +12 -0
  84. package/lib/styles/typography.module.css +0 -1
  85. package/lib/styles/utils.module.css +26 -0
  86. package/lib/types/index.js +38 -0
  87. package/lib/types/index.js.flow +5 -0
  88. package/lib/utils/index.js +93 -0
  89. package/lib/utils/index.js.flow +10 -0
  90. package/package.json +2 -1
  91. /package/lib/components/Table/{Row.js → DefaultRow.js} +0 -0
@@ -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
- export const Notification = (props: NotificationProps): React.Node => {
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
- return (
122
- <>
123
- {!dismissed && (
124
- <BaseNotification
125
- classNames={classNames}
126
- iconLeftName={iconLeftName}
127
- iconLeftType={iconLeftType}
128
- semantic={semantic}
129
- dismissable={dismissable}
130
- onCloseClick={closeClickHandler}
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
- </BaseNotification>
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
- children,
27
- iconLeftName,
28
- iconLeftType,
29
- type,
30
- isFluid,
31
- disabled,
32
- size,
33
- menu,
34
- anchorPosition,
35
- onOptionSelect,
36
- onButtonClick,
37
- onMenuOpen,
38
- onMenuClose,
39
- ariaLabel,
40
- actionType,
41
- }: OptionButtonProps): React.Node => {
42
- const [iconName, setIconName] = React.useState('chevron-down');
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
- return (
45
- <div className={css.container}>
46
- <Button
47
- iconLeftName={iconLeftName}
48
- iconLeftType={iconLeftType}
49
- onClick={onButtonClick}
50
- size={size}
51
- type={type}
52
- classNames={{wrapper: css.leftButton}}
53
- disabled={disabled}
54
- isFluid={isFluid}
55
- ariaLabel={ariaLabel}
56
- actionType={actionType}
57
- >
58
- {children}
59
- </Button>
60
- <ButtonDropdown
61
- anchorPosition={anchorPosition}
62
- ariaLabel={ariaLabel}
63
- iconLeftName={iconName}
64
- classNames={{
65
- buttonWrapper: css.rightButton,
66
- dropdownContainer: css.dropDownContainer,
67
- }}
68
- type={type}
69
- disabled={disabled}
70
- menu={menu}
71
- onMenuClose={() => {
72
- setIconName('chevron-down');
73
- onMenuOpen && onMenuOpen();
74
- }}
75
- onMenuOpen={() => {
76
- setIconName('chevron-up');
77
- onMenuClose && onMenuClose();
78
- }}
79
- onOptionSelect={onOptionSelect}
80
- size={size}
81
- />
82
- </div>
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
- classNames,
166
- children,
167
- pageNameKey,
168
- }: PageTitleProps): 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);
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 nodes.length > 1 ? nodes : nodes[0];
179
- }
180
- return null;
181
- };
182
-
183
- return (
184
- <div
185
- data-testid="PageTitle"
186
- className={classify(css.pageTitleWrapper, classNames?.wrapper)}
187
- >
188
- <div className={classify(css.leftSlot, classNames?.leftSlot)}>
189
- {pageNameKey && PAGE_NAME_LIST[pageNameKey] ? (
190
- <PageName>
191
- <TitleMedium>{PAGE_NAME_LIST[pageNameKey].title} </TitleMedium>
192
- <Icon
193
- type={PAGE_NAME_LIST[pageNameKey].iconType}
194
- name={PAGE_NAME_LIST[pageNameKey].iconName}
195
- size="medium"
196
- color={TEXT_COLORS.primary}
197
- swapOpacity={PAGE_NAME_LIST[pageNameKey].iconSwapOpacity}
198
- />
199
- </PageName>
200
- ) : (
201
- getNamedComp('PageName')
202
- )}
203
- {getNamedComp('TabSlot')}
204
- </div>
205
- <div className={classify(css.rightSlot, classNames?.rightSlot)}>
206
- {getNamedComp('RightSlot')}
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
- </div>
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 (disabled || selected) {
26
+ if (selected) {
27
27
  paginationBtnRef.current?.blur();
28
28
  }
29
- }, [disabled, selected]);
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 (disabled || selected) {
19
+ if (selected) {
20
20
  paginationBtnRef.current?.blur();
21
21
  }
22
- }, [disabled, selected]);
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
- value,
29
- disabled,
30
- locked,
31
- placeholder = 'Search...',
32
- classNames,
33
- onClear,
34
- isLoading,
35
- size,
36
- iconLeftName = 'magnifying-glass',
37
- ...searchInputProps
38
- }: SearchInputProps): React.Node => {
39
- const handleClearClick = () => {
40
- onClear?.();
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
- return (
44
- <div className={classify(css.searchInputWrapper, classNames?.wrapper)}>
45
- <Input
46
- {...searchInputProps}
47
- type="text"
48
- classNames={{
49
- iconRight: value && !(disabled || locked) ? css.clickable : '',
50
- iconLeft: value && !disabled ? css.primaryText : '',
51
- box: classNames?.box,
52
- }}
53
- placeholder={placeholder}
54
- value={value}
55
- disabled={disabled}
56
- locked={locked}
57
- iconLeftName={iconLeftName}
58
- size={size}
59
- iconRightName={value && !(disabled || locked) ? 'xmark' : 'fw'}
60
- onIconRightClick={handleClearClick}
61
- />
62
- {isLoading && (
63
- <div
64
- className={classify(css.loaderContainer, {
65
- [css.small]: size === 'small',
66
- })}
67
- >
68
- <CircularLoader
69
- colorToken="colorFillPrimary"
70
- className={css.loader}
71
- size="small"
72
- />
73
- </div>
74
- )}
75
- </div>
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
+ );
@@ -11,7 +11,7 @@
11
11
  .searchInputWrapper {
12
12
  display: flex;
13
13
  position: relative;
14
- align-items: end;
14
+ align-items: flex-end;
15
15
  height: fit-content;
16
16
  }
17
17