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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/.cspell/custom-words.txt +3 -0
  2. package/.flowconfig +1 -1
  3. package/CHANGELOG.md +15 -0
  4. package/CONTRIBUTING.md +52 -6
  5. package/README.md +144 -8
  6. package/gulpfile.js +1 -0
  7. package/lib/components/Avatar/Avatar.module.css +8 -2
  8. package/lib/components/AvatarGroup/AvatarGroup.js +25 -14
  9. package/lib/components/AvatarGroup/AvatarGroup.js.flow +118 -103
  10. package/lib/components/Badge/Badge.js +4 -3
  11. package/lib/components/Badge/Badge.js.flow +21 -21
  12. package/lib/components/Badge/index.js +11 -7
  13. package/lib/components/Badge/index.js.flow +1 -2
  14. package/lib/components/Banner/Banner.js +3 -2
  15. package/lib/components/Banner/Banner.js.flow +42 -35
  16. package/lib/components/Button/Button.js +50 -10
  17. package/lib/components/Button/Button.js.flow +87 -23
  18. package/lib/components/Button/Button.module.css +14 -0
  19. package/lib/components/ButtonTabs/ButtonTab/ButtonTab.js +3 -2
  20. package/lib/components/ButtonTabs/ButtonTab/ButtonTab.js.flow +48 -38
  21. package/lib/components/ButtonTabs/ButtonTabs.js +3 -2
  22. package/lib/components/ButtonTabs/ButtonTabs.js.flow +50 -41
  23. package/lib/components/Card/Card.js +16 -7
  24. package/lib/components/Card/Card.js.flow +73 -55
  25. package/lib/components/Checkbox/Checkbox.js +15 -10
  26. package/lib/components/Checkbox/Checkbox.js.flow +121 -100
  27. package/lib/components/Checkbox/Checkbox.module.css +4 -1
  28. package/lib/components/Checkbox/CheckboxGroup.js +4 -3
  29. package/lib/components/Checkbox/CheckboxGroup.js.flow +76 -65
  30. package/lib/components/Chip/Chip.js +3 -2
  31. package/lib/components/Chip/Chip.js.flow +66 -59
  32. package/lib/components/CircularLoader/CircularLoader.js +9 -4
  33. package/lib/components/CircularLoader/CircularLoader.js.flow +38 -24
  34. package/lib/components/CollapsibleCard/CollapsibleCard.js +4 -3
  35. package/lib/components/CollapsibleCard/CollapsibleCard.js.flow +68 -59
  36. package/lib/components/Dropdown/Dropdown.js +4 -3
  37. package/lib/components/Dropdown/Dropdown.js.flow +83 -74
  38. package/lib/components/EmptyState/EmptyState.js +4 -3
  39. package/lib/components/EmptyState/EmptyState.js.flow +53 -44
  40. package/lib/components/ErrorMessage/ErrorMessage.js +4 -3
  41. package/lib/components/ErrorMessage/ErrorMessage.js.flow +58 -49
  42. package/lib/components/InContextAlert/InContextAlert.js +4 -3
  43. package/lib/components/InContextAlert/InContextAlert.js.flow +79 -73
  44. package/lib/components/InlineDropdown/InlineDropdown.js +4 -3
  45. package/lib/components/InlineDropdown/InlineDropdown.js.flow +94 -85
  46. package/lib/components/LinearLoader/LinearLoader.js +4 -3
  47. package/lib/components/LinearLoader/LinearLoader.js.flow +20 -18
  48. package/lib/components/Link/Link.js +8 -1
  49. package/lib/components/Link/Link.js.flow +44 -36
  50. package/lib/components/Notification/Notification.js +8 -6
  51. package/lib/components/Notification/Notification.js.flow +96 -84
  52. package/lib/components/OptionButton/OptionButton.js +7 -4
  53. package/lib/components/OptionButton/OptionButton.js.flow +69 -59
  54. package/lib/components/PageTitle/PageTitle.js +4 -3
  55. package/lib/components/PageTitle/PageTitle.js.flow +46 -44
  56. package/lib/components/Pagination/PaginationItem.js +2 -2
  57. package/lib/components/Pagination/PaginationItem.js.flow +2 -2
  58. package/lib/components/RadioButton/RadioButton.js +15 -9
  59. package/lib/components/RadioButton/RadioButton.js.flow +91 -70
  60. package/lib/components/RadioButton/RadioButton.module.css +4 -1
  61. package/lib/components/RadioButton/RadioGroup.js +4 -3
  62. package/lib/components/RadioButton/RadioGroup.js.flow +56 -47
  63. package/lib/components/SearchInput/SearchInput.js +3 -2
  64. package/lib/components/SearchInput/SearchInput.js.flow +59 -50
  65. package/lib/components/SideMenuLink/SideMenuLink.js +4 -3
  66. package/lib/components/SideMenuLink/SideMenuLink.js.flow +54 -45
  67. package/lib/components/StatusIndicator/StatusIndicator.js +3 -2
  68. package/lib/components/StatusIndicator/StatusIndicator.js.flow +32 -23
  69. package/lib/components/SubMenu/SubMenu.js +4 -3
  70. package/lib/components/SubMenu/SubMenu.js.flow +41 -38
  71. package/lib/components/Table/StaticTable.js +3 -0
  72. package/lib/components/Table/StaticTable.js.flow +3 -0
  73. package/lib/components/Table/Table.js +10 -0
  74. package/lib/components/Table/Table.js.flow +10 -0
  75. package/lib/components/Table/hooks.js +1 -0
  76. package/lib/components/Table/hooks.js.flow +1 -0
  77. package/lib/components/Tabs/TabList/TabList.js +3 -2
  78. package/lib/components/Tabs/TabList/TabList.js.flow +127 -117
  79. package/lib/components/Toast/Toast.js +8 -10
  80. package/lib/components/Toast/Toast.js.flow +19 -27
  81. package/lib/components/Toast/Toast.module.css +8 -0
  82. package/lib/components/Toggle/Toggle.js +11 -7
  83. package/lib/components/Toggle/Toggle.js.flow +16 -12
  84. package/lib/components/Toggle/Toggle.module.css +2 -0
  85. package/lib/components/Toggle/index.js +11 -7
  86. package/lib/components/Toggle/index.js.flow +1 -1
  87. package/lib/components/Tooltip/Tooltip.js.flow +2 -2
  88. package/lib/components/index.js +511 -0
  89. package/lib/components/index.js.flow +48 -0
  90. package/lib/index.js +60 -0
  91. package/lib/index.js.flow +7 -0
  92. package/lib/styles/index.css +15 -0
  93. package/lib/styles/index.js +104 -0
  94. package/lib/styles/index.js.flow +12 -0
  95. package/lib/styles/typography.module.css +0 -1
  96. package/lib/styles/utils.module.css +26 -0
  97. package/lib/types/index.js +38 -0
  98. package/lib/types/index.js.flow +5 -0
  99. package/lib/utils/click-away.js.flow +1 -1
  100. package/lib/utils/index.js +93 -0
  101. package/lib/utils/index.js.flow +10 -0
  102. package/package.json +2 -1
@@ -72,40 +72,48 @@ export type LinkProps = {
72
72
  ...
73
73
  };
74
74
 
75
- export const Link: React$AbstractComponent<
76
- LinkProps,
77
- React.Element<'a'>,
78
- > = React.forwardRef<LinkProps, React.Element<'a'>>(
79
- (
80
- {
81
- color = TEXT_COLORS.clickable,
82
- children,
83
- className,
84
- as = 'buttonTextExtraSmall',
85
- underline = true,
86
- tabIndex = 0,
87
- disabled,
88
- ...props
89
- }: LinkProps,
90
- ref,
91
- ) => (
92
- <a
93
- {...props}
94
- tabIndex={disabled ? -1 : tabIndex}
95
- innerref={ref}
96
- data-testid="Link"
97
- className={classify(
98
- css.link,
99
- css[as],
100
- css[color],
101
- {
102
- [css.underline]: underline,
103
- [css.disabled]: disabled,
104
- },
75
+ export const Link: React$AbstractComponent<LinkProps, HTMLAnchorElement> =
76
+ React.forwardRef<LinkProps, HTMLAnchorElement>(
77
+ (
78
+ {
79
+ color = TEXT_COLORS.clickable,
80
+ children,
105
81
  className,
106
- )}
107
- >
108
- {children}
109
- </a>
110
- ),
111
- );
82
+ as = 'buttonTextExtraSmall',
83
+ underline = true,
84
+ tabIndex = 0,
85
+ disabled,
86
+ ...props
87
+ }: LinkProps,
88
+ ref,
89
+ ) => {
90
+ const linkRef = React.useRef(null);
91
+ React.useImperativeHandle(ref, () => linkRef.current);
92
+ React.useEffect(() => {
93
+ if (disabled) {
94
+ linkRef.current?.blur();
95
+ }
96
+ }, [disabled]);
97
+
98
+ return (
99
+ <a
100
+ {...props}
101
+ tabIndex={disabled ? -1 : tabIndex}
102
+ ref={linkRef}
103
+ data-testid="Link"
104
+ className={classify(
105
+ css.link,
106
+ css[as],
107
+ css[color],
108
+ {
109
+ [css.underline]: underline,
110
+ [css.disabled]: disabled,
111
+ },
112
+ className,
113
+ )}
114
+ >
115
+ {children}
116
+ </a>
117
+ );
118
+ },
119
+ );
@@ -22,7 +22,7 @@ const NOTIFICATION_SEMANTIC = Object.freeze({
22
22
  exports.NOTIFICATION_SEMANTIC = NOTIFICATION_SEMANTIC;
23
23
  // Base Notification will not have any state.
24
24
 
25
- const BaseNotification = props => {
25
+ const BaseNotification = /*#__PURE__*/React.forwardRef((props, ref) => {
26
26
  const {
27
27
  classNames,
28
28
  semantic = NOTIFICATION_SEMANTIC.success,
@@ -38,7 +38,8 @@ const BaseNotification = props => {
38
38
  [_NotificationModule.default.information]: semantic === NOTIFICATION_SEMANTIC.information,
39
39
  [_NotificationModule.default.danger]: semantic === NOTIFICATION_SEMANTIC.danger,
40
40
  [_NotificationModule.default.dismissable]: dismissable
41
- }, classNames?.wrapper)
41
+ }, classNames?.wrapper),
42
+ ref: ref
42
43
  }, iconLeftName ? /*#__PURE__*/React.createElement(_Icon.Icon, {
43
44
  name: iconLeftName,
44
45
  color: _typography.TEXT_COLORS.inversePrimary,
@@ -55,8 +56,8 @@ const BaseNotification = props => {
55
56
  onClick: onCloseClick,
56
57
  className: _NotificationModule.default.closeIcon
57
58
  }));
58
- };
59
- const Notification = props => {
59
+ });
60
+ const Notification = /*#__PURE__*/React.forwardRef((props, ref) => {
60
61
  const {
61
62
  classNames,
62
63
  semantic = NOTIFICATION_SEMANTIC.success,
@@ -78,7 +79,8 @@ const Notification = props => {
78
79
  iconLeftType: iconLeftType,
79
80
  semantic: semantic,
80
81
  dismissable: dismissable,
81
- onCloseClick: closeClickHandler
82
+ onCloseClick: closeClickHandler,
83
+ ref: ref
82
84
  }, children));
83
- };
85
+ });
84
86
  exports.Notification = Notification;
@@ -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':