@onewelcome/react-lib-components 1.2.0 → 1.4.0

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 (97) hide show
  1. package/dist/Button/IconButton.d.ts +2 -1
  2. package/dist/DataGrid/DataGrid.d.ts +1 -0
  3. package/dist/DataGrid/DataGridActions/DataGridActions.d.ts +2 -1
  4. package/dist/Form/Form.d.ts +3 -3
  5. package/dist/Notifications/SlideInModal/SlideInModal.d.ts +1 -1
  6. package/dist/Tabs/Tab.d.ts +5 -9
  7. package/dist/Tabs/TabButton.d.ts +3 -6
  8. package/dist/Tabs/Tabs.d.ts +1 -2
  9. package/dist/hooks/useDebouncedCallback.d.ts +1 -0
  10. package/dist/index.d.ts +1 -0
  11. package/dist/react-lib-components.cjs.development.js +472 -395
  12. package/dist/react-lib-components.cjs.development.js.map +1 -1
  13. package/dist/react-lib-components.cjs.production.min.js +1 -1
  14. package/dist/react-lib-components.cjs.production.min.js.map +1 -1
  15. package/dist/react-lib-components.esm.js +473 -397
  16. package/dist/react-lib-components.esm.js.map +1 -1
  17. package/package.json +1 -1
  18. package/src/Breadcrumbs/Breadcrumbs.tsx +46 -38
  19. package/src/Button/BaseButton.tsx +23 -20
  20. package/src/Button/Button.module.scss +9 -0
  21. package/src/Button/Button.tsx +40 -40
  22. package/src/Button/IconButton.tsx +28 -28
  23. package/src/ContextMenu/ContextMenu.tsx +161 -160
  24. package/src/ContextMenu/ContextMenuItem.tsx +55 -49
  25. package/src/DataGrid/DataGrid.tsx +1 -0
  26. package/src/DataGrid/DataGridActions/DataGridActions.module.scss +1 -1
  27. package/src/DataGrid/DataGridActions/DataGridActions.test.tsx +4 -2
  28. package/src/DataGrid/DataGridActions/DataGridActions.tsx +95 -87
  29. package/src/DataGrid/DataGridActions/DataGridColumnsToggle.tsx +64 -64
  30. package/src/DataGrid/DataGridBody/DataGridCell.tsx +42 -44
  31. package/src/DataGrid/DataGridBody/DataGridRow.tsx +29 -29
  32. package/src/DataGrid/DataGridHeader/DataGridHeader.tsx +78 -78
  33. package/src/DataGrid/DataGridHeader/DataGridHeaderCell.tsx +48 -48
  34. package/src/Form/Checkbox/Checkbox.tsx +134 -130
  35. package/src/Form/Fieldset/Fieldset.tsx +81 -78
  36. package/src/Form/Form.tsx +9 -4
  37. package/src/Form/FormControl/FormControl.module.scss +1 -20
  38. package/src/Form/FormControl/FormControl.tsx +36 -35
  39. package/src/Form/FormGroup/FormGroup.tsx +62 -62
  40. package/src/Form/FormHelperText/FormHelperText.tsx +19 -18
  41. package/src/Form/FormSelectorWrapper/FormSelectorWrapper.tsx +58 -53
  42. package/src/Form/Input/Input.tsx +90 -87
  43. package/src/Form/Label/Label.tsx +17 -16
  44. package/src/Form/Radio/Radio.tsx +91 -91
  45. package/src/Form/Select/Option.tsx +66 -60
  46. package/src/Form/Select/Select.tsx +207 -209
  47. package/src/Form/Textarea/Textarea.tsx +51 -53
  48. package/src/Form/Toggle/Toggle.tsx +26 -23
  49. package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.tsx +51 -43
  50. package/src/Form/Wrapper/InputWrapper/InputWrapper.tsx +112 -106
  51. package/src/Form/Wrapper/RadioWrapper/RadioWrapper.tsx +67 -62
  52. package/src/Form/Wrapper/SelectWrapper/SelectWrapper.tsx +42 -37
  53. package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.tsx +94 -94
  54. package/src/Form/Wrapper/Wrapper/Wrapper.tsx +73 -73
  55. package/src/Icon/Icon.module.scss +1 -0
  56. package/src/Icon/Icon.tsx +19 -16
  57. package/src/Link/Link.tsx +68 -63
  58. package/src/Notifications/BaseModal/BaseModal.tsx +68 -68
  59. package/src/Notifications/BaseModal/BaseModalActions/BaseModalActions.tsx +13 -10
  60. package/src/Notifications/BaseModal/BaseModalContent/BaseModalContent.tsx +33 -25
  61. package/src/Notifications/BaseModal/BaseModalHeader/BaseModalHeader.tsx +20 -17
  62. package/src/Notifications/Dialog/Dialog.tsx +83 -83
  63. package/src/Notifications/Dialog/DialogActions/DialogActions.tsx +17 -14
  64. package/src/Notifications/Dialog/DialogTitle/DialogTitle.tsx +15 -12
  65. package/src/Notifications/DiscardChangesModal/DiscardChangesDialog/DiscardChangesDialog.tsx +40 -40
  66. package/src/Notifications/SlideInModal/SlideInModal.module.scss +5 -5
  67. package/src/Notifications/SlideInModal/SlideInModal.test.tsx +7 -2
  68. package/src/Notifications/SlideInModal/SlideInModal.tsx +47 -27
  69. package/src/Pagination/Pagination.tsx +169 -169
  70. package/src/Popover/Popover.module.scss +1 -0
  71. package/src/Popover/Popover.tsx +43 -33
  72. package/src/ProgressBar/ProgressBar.tsx +17 -14
  73. package/src/Skeleton/Skeleton.tsx +23 -20
  74. package/src/StatusIndicator/StatusIndicator.tsx +18 -15
  75. package/src/Tabs/{TabPanel.module.scss → Tab.module.scss} +1 -1
  76. package/src/Tabs/Tab.test.tsx +1 -39
  77. package/src/Tabs/Tab.tsx +16 -10
  78. package/src/Tabs/TabButton.module.scss +0 -4
  79. package/src/Tabs/TabButton.test.tsx +3 -31
  80. package/src/Tabs/TabButton.tsx +35 -49
  81. package/src/Tabs/Tabs.test.tsx +40 -33
  82. package/src/Tabs/Tabs.tsx +107 -101
  83. package/src/TextEllipsis/TextEllipsis.tsx +50 -41
  84. package/src/Tiles/Tile.tsx +58 -56
  85. package/src/Tiles/Tiles.tsx +44 -41
  86. package/src/Tooltip/Tooltip.tsx +101 -100
  87. package/src/Typography/Typography.tsx +47 -44
  88. package/src/Wizard/BaseWizardSteps/BaseWizardSteps.tsx +55 -52
  89. package/src/Wizard/WizardSteps/WizardSteps.tsx +25 -22
  90. package/src/hooks/useDebouncedCallback.test.ts +140 -0
  91. package/src/hooks/useDebouncedCallback.tsx +32 -0
  92. package/src/index.ts +1 -0
  93. package/src/mixins.module.scss +2 -2
  94. package/src/util/helper.test.tsx +0 -28
  95. package/dist/Tabs/TabPanel.d.ts +0 -8
  96. package/src/Tabs/TabPanel.test.tsx +0 -92
  97. package/src/Tabs/TabPanel.tsx +0 -43
@@ -16,6 +16,7 @@
16
16
 
17
17
  import React, {
18
18
  ComponentPropsWithRef,
19
+ ForwardRefRenderFunction,
19
20
  ReactElement,
20
21
  ReactNode,
21
22
  useEffect,
@@ -44,178 +45,178 @@ export interface Props extends ComponentPropsWithRef<"div"> {
44
45
  onClose?: () => void;
45
46
  }
46
47
 
47
- export const ContextMenu = React.forwardRef<HTMLDivElement, Props>(
48
- (
49
- {
50
- trigger,
51
- children,
52
- decorativeElement,
53
- id,
54
- show = false,
55
- onShow,
56
- onClose,
57
- placement = { horizontal: "right", vertical: "top" },
58
- offset = { top: 0, bottom: 0, left: 0, right: 0 },
59
- transformOrigin = { horizontal: "left", vertical: "top" },
60
- domRoot = document.body,
61
- ...rest
62
- }: Props,
63
- ref
64
- ) => {
65
- const anchorEl = useRef<HTMLButtonElement>(null);
66
- const [showContextMenu, setShowContextMenu] = useState(show);
67
- const [hasBeenClosed, setHasBeenClosed] = useState(false);
68
- const [selectedContextMenuItem, setSelectedContextMenuItem] = useState(-1);
69
- const [focusedContextMenuItem, setFocusedContextMenuItem] = useState(-1);
70
- const [shouldClick, setShouldClick] =
71
- useState(
72
- false
73
- ); /** We need this, because whenever we use the arrow keys to select the contextmenu item, and we focus the currently selected item it fires the "click" listener in ContextMenuItem component. Instead, we only want this to fire if we press "enter" or "spacebar" so we set this to true whenever that is the case, and back to false when it has been executed. */
74
- const [childrenCount] = useState(React.Children.count(children));
48
+ const ContextMenuComponent: ForwardRefRenderFunction<HTMLDivElement, Props> = (
49
+ {
50
+ trigger,
51
+ children,
52
+ decorativeElement,
53
+ id,
54
+ show = false,
55
+ onShow,
56
+ onClose,
57
+ placement = { horizontal: "right", vertical: "top" },
58
+ offset = { top: 0, bottom: 0, left: 0, right: 0 },
59
+ transformOrigin = { horizontal: "left", vertical: "top" },
60
+ domRoot = document.body,
61
+ ...rest
62
+ }: Props,
63
+ ref
64
+ ) => {
65
+ const anchorEl = useRef<HTMLButtonElement>(null);
66
+ const [showContextMenu, setShowContextMenu] = useState(show);
67
+ const [hasBeenClosed, setHasBeenClosed] = useState(false);
68
+ const [selectedContextMenuItem, setSelectedContextMenuItem] = useState(-1);
69
+ const [focusedContextMenuItem, setFocusedContextMenuItem] = useState(-1);
70
+ const [shouldClick, setShouldClick] =
71
+ useState(
72
+ false
73
+ ); /** We need this, because whenever we use the arrow keys to select the contextmenu item, and we focus the currently selected item it fires the "click" listener in ContextMenuItem component. Instead, we only want this to fire if we press "enter" or "spacebar" so we set this to true whenever that is the case, and back to false when it has been executed. */
74
+ const [childrenCount] = useState(React.Children.count(children));
75
75
 
76
- if (!id) {
77
- throw new Error("You need to provide an ID to the context menu");
78
- }
79
-
80
- const onArrowNavigation = (event: React.KeyboardEvent) => {
81
- if (focusedContextMenuItem === -1 && selectedContextMenuItem !== -1) {
82
- setFocusedContextMenuItem(selectedContextMenuItem);
83
- }
76
+ if (!id) {
77
+ throw new Error("You need to provide an ID to the context menu");
78
+ }
84
79
 
85
- const codesToPrevenDefault = [
86
- "ArrowDown",
87
- "ArrowUp",
88
- "ArrowLeft",
89
- "ArrowRight",
90
- "Enter",
91
- "Space",
92
- "Escape",
93
- "End",
94
- "Home"
95
- ];
80
+ const onArrowNavigation = (event: React.KeyboardEvent) => {
81
+ if (focusedContextMenuItem === -1 && selectedContextMenuItem !== -1) {
82
+ setFocusedContextMenuItem(selectedContextMenuItem);
83
+ }
96
84
 
97
- if (codesToPrevenDefault.includes(event.code)) {
98
- event.preventDefault();
99
- }
85
+ const codesToPrevenDefault = [
86
+ "ArrowDown",
87
+ "ArrowUp",
88
+ "ArrowLeft",
89
+ "ArrowRight",
90
+ "Enter",
91
+ "Space",
92
+ "Escape",
93
+ "End",
94
+ "Home"
95
+ ];
100
96
 
101
- switch (event.code) {
102
- case "ArrowDown":
103
- if (!showContextMenu) {
104
- setShowContextMenu(true);
105
- return;
106
- }
107
- setFocusedContextMenuItem(prevState => {
108
- return prevState + 1 > childrenCount - 1 ? 0 : prevState + 1;
109
- });
110
- return;
111
- case "ArrowUp":
112
- setFocusedContextMenuItem(prevState => {
113
- return prevState - 1 < 0 ? childrenCount - 1 : prevState - 1;
114
- });
115
- return;
116
- case "Enter":
117
- case "Space":
118
- if (!showContextMenu) {
119
- setShowContextMenu(true);
120
- return;
121
- }
97
+ if (codesToPrevenDefault.includes(event.code)) {
98
+ event.preventDefault();
99
+ }
122
100
 
123
- setShouldClick(true);
124
- setSelectedContextMenuItem(focusedContextMenuItem);
125
- setShowContextMenu(false);
126
- return;
127
- case "Tab":
128
- case "Escape":
129
- setShowContextMenu(false);
101
+ switch (event.code) {
102
+ case "ArrowDown":
103
+ if (!showContextMenu) {
104
+ setShowContextMenu(true);
130
105
  return;
131
- case "End":
132
- setFocusedContextMenuItem(childrenCount - 1);
133
- return;
134
- case "Home":
135
- setFocusedContextMenuItem(0);
106
+ }
107
+ setFocusedContextMenuItem(prevState => {
108
+ return prevState + 1 > childrenCount - 1 ? 0 : prevState + 1;
109
+ });
110
+ return;
111
+ case "ArrowUp":
112
+ setFocusedContextMenuItem(prevState => {
113
+ return prevState - 1 < 0 ? childrenCount - 1 : prevState - 1;
114
+ });
115
+ return;
116
+ case "Enter":
117
+ case "Space":
118
+ if (!showContextMenu) {
119
+ setShowContextMenu(true);
136
120
  return;
137
- }
138
- };
121
+ }
139
122
 
140
- useBodyClick(
141
- event => {
142
- return (
143
- showContextMenu &&
144
- anchorEl.current !== event.target &&
145
- anchorEl.current !== (event.target as HTMLElement).parentElement
146
- );
147
- },
148
- () => {
123
+ setShouldClick(true);
124
+ setSelectedContextMenuItem(focusedContextMenuItem);
125
+ setShowContextMenu(false);
126
+ return;
127
+ case "Tab":
128
+ case "Escape":
149
129
  setShowContextMenu(false);
150
- },
151
- showContextMenu
152
- );
130
+ return;
131
+ case "End":
132
+ setFocusedContextMenuItem(childrenCount - 1);
133
+ return;
134
+ case "Home":
135
+ setFocusedContextMenuItem(0);
136
+ return;
137
+ }
138
+ };
153
139
 
154
- useEffect(() => {
155
- if (showContextMenu === true) {
156
- onShow && onShow();
157
- } else {
158
- onClose && onClose();
159
- !hasBeenClosed && setHasBeenClosed(true);
160
- setFocusedContextMenuItem(-1);
161
- hasBeenClosed && anchorEl.current && anchorEl.current.focus();
162
- }
163
- }, [showContextMenu]);
140
+ useBodyClick(
141
+ event => {
142
+ return (
143
+ showContextMenu &&
144
+ anchorEl.current !== event.target &&
145
+ anchorEl.current !== (event.target as HTMLElement).parentElement
146
+ );
147
+ },
148
+ () => {
149
+ setShowContextMenu(false);
150
+ },
151
+ showContextMenu
152
+ );
164
153
 
165
- const renderTrigger = () =>
166
- React.cloneElement(trigger, {
167
- id: id,
168
- "aria-haspopup": "true",
169
- "aria-controls": `${id}-menu`,
170
- "aria-expanded": showContextMenu,
171
- onClick: () => setShowContextMenu(!showContextMenu),
172
- tabIndex: 0,
173
- ref: anchorEl
174
- });
154
+ useEffect(() => {
155
+ if (showContextMenu === true) {
156
+ onShow && onShow();
157
+ } else {
158
+ onClose && onClose();
159
+ !hasBeenClosed && setHasBeenClosed(true);
160
+ setFocusedContextMenuItem(-1);
161
+ hasBeenClosed && anchorEl.current && anchorEl.current.focus();
162
+ }
163
+ }, [showContextMenu]);
175
164
 
176
- const renderChildren = () => {
177
- return React.Children.map(children, (child, index) => {
178
- return React.cloneElement(child as ReactElement, {
179
- onFocusChange: (childIndex: number) => setFocusedContextMenuItem(childIndex),
180
- onSelectedChange: (childIndex: number) => {
181
- setSelectedContextMenuItem(childIndex);
182
- setShouldClick(false);
183
- },
184
- childIndex: index,
185
- hasFocus: focusedContextMenuItem === index,
186
- isSelected: selectedContextMenuItem === index,
187
- contextMenuOpened: showContextMenu,
188
- shouldClick: shouldClick
189
- });
165
+ const renderTrigger = () =>
166
+ React.cloneElement(trigger, {
167
+ id: id,
168
+ "aria-haspopup": "true",
169
+ "aria-controls": `${id}-menu`,
170
+ "aria-expanded": showContextMenu,
171
+ onClick: () => setShowContextMenu(!showContextMenu),
172
+ tabIndex: 0,
173
+ ref: anchorEl
174
+ });
175
+
176
+ const renderChildren = () => {
177
+ return React.Children.map(children, (child, index) => {
178
+ return React.cloneElement(child as ReactElement, {
179
+ onFocusChange: (childIndex: number) => setFocusedContextMenuItem(childIndex),
180
+ onSelectedChange: (childIndex: number) => {
181
+ setSelectedContextMenuItem(childIndex);
182
+ setShouldClick(false);
183
+ },
184
+ childIndex: index,
185
+ hasFocus: focusedContextMenuItem === index,
186
+ isSelected: selectedContextMenuItem === index,
187
+ contextMenuOpened: showContextMenu,
188
+ shouldClick: shouldClick
190
189
  });
191
- };
190
+ });
191
+ };
192
192
 
193
- return (
194
- <div {...rest} ref={ref} onKeyDown={onArrowNavigation} className={classes["context-menu"]}>
195
- {renderTrigger()}
196
- {createPortal(
197
- <Popover
198
- placement={placement}
199
- transformOrigin={transformOrigin}
200
- offset={offset}
201
- anchorEl={anchorEl}
202
- show={showContextMenu}
193
+ return (
194
+ <div {...rest} ref={ref} onKeyDown={onArrowNavigation} className={classes["context-menu"]}>
195
+ {renderTrigger()}
196
+ {createPortal(
197
+ <Popover
198
+ placement={placement}
199
+ transformOrigin={transformOrigin}
200
+ offset={offset}
201
+ anchorEl={anchorEl}
202
+ show={showContextMenu}
203
+ >
204
+ {decorativeElement && (
205
+ <div className={classes["decorative-element"]}>{decorativeElement}</div>
206
+ )}
207
+ <ul
208
+ className={`${classes["menu"]} ${decorativeElement ? classes["no-margin-top"] : ""}`}
209
+ id={`${id}-menu`}
210
+ aria-describedby={id}
211
+ role="menu"
203
212
  >
204
- {decorativeElement && (
205
- <div className={classes["decorative-element"]}>{decorativeElement}</div>
206
- )}
207
- <ul
208
- className={`${classes["menu"]} ${decorativeElement ? classes["no-margin-top"] : ""}`}
209
- id={`${id}-menu`}
210
- aria-describedby={id}
211
- role="menu"
212
- >
213
- {renderChildren()}
214
- </ul>
215
- </Popover>,
216
- domRoot
217
- )}
218
- </div>
219
- );
220
- }
221
- );
213
+ {renderChildren()}
214
+ </ul>
215
+ </Popover>,
216
+ domRoot
217
+ )}
218
+ </div>
219
+ );
220
+ };
221
+
222
+ export const ContextMenu = React.forwardRef(ContextMenuComponent);
@@ -14,7 +14,13 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import React, { ComponentPropsWithRef, createRef, RefObject, useEffect } from "react";
17
+ import React, {
18
+ ComponentPropsWithRef,
19
+ createRef,
20
+ ForwardRefRenderFunction,
21
+ RefObject,
22
+ useEffect
23
+ } from "react";
18
24
  import classes from "./ContextMenuItem.module.scss";
19
25
 
20
26
  export interface Props extends Omit<ComponentPropsWithRef<"button">, "onClick"> {
@@ -29,54 +35,54 @@ export interface Props extends Omit<ComponentPropsWithRef<"button">, "onClick">
29
35
  onSelectedChange?: (childIndex: number) => void;
30
36
  }
31
37
 
32
- export const ContextMenuItem = React.forwardRef<HTMLButtonElement, Props>(
33
- (
34
- {
35
- children,
36
- onClick,
37
- onFocusChange,
38
- onSelectedChange,
39
- hasFocus,
40
- isSelected,
41
- childIndex,
42
- contextMenuOpened,
43
- shouldClick,
44
- className,
45
- ...rest
46
- }: Props,
47
- ref
48
- ) => {
49
- let innerButtonRef = (ref as RefObject<HTMLButtonElement>) || createRef<HTMLButtonElement>();
38
+ const ContextMenuItemComponent: ForwardRefRenderFunction<HTMLButtonElement, Props> = (
39
+ {
40
+ children,
41
+ onClick,
42
+ onFocusChange,
43
+ onSelectedChange,
44
+ hasFocus,
45
+ isSelected,
46
+ childIndex,
47
+ contextMenuOpened,
48
+ shouldClick,
49
+ className,
50
+ ...rest
51
+ }: Props,
52
+ ref
53
+ ) => {
54
+ let innerButtonRef = (ref as RefObject<HTMLButtonElement>) || createRef<HTMLButtonElement>();
50
55
 
51
- useEffect(() => {
52
- if (isSelected && innerButtonRef.current && shouldClick) {
53
- innerButtonRef.current.click();
54
- }
55
- }, [isSelected, shouldClick]);
56
+ useEffect(() => {
57
+ if (isSelected && innerButtonRef.current && shouldClick) {
58
+ innerButtonRef.current.click();
59
+ }
60
+ }, [isSelected, shouldClick]);
56
61
 
57
- useEffect(() => {
58
- if (innerButtonRef.current && hasFocus && contextMenuOpened) {
59
- onFocusChange && childIndex && onFocusChange(childIndex);
60
- innerButtonRef.current.focus();
61
- }
62
- }, [hasFocus, innerButtonRef, contextMenuOpened]);
62
+ useEffect(() => {
63
+ if (innerButtonRef.current && hasFocus && contextMenuOpened) {
64
+ onFocusChange && childIndex && onFocusChange(childIndex);
65
+ innerButtonRef.current.focus();
66
+ }
67
+ }, [hasFocus, innerButtonRef, contextMenuOpened]);
63
68
 
64
- return (
65
- <li role="none" className={`${classes["context-menu-item"]} ${className ?? ""}`}>
66
- <button
67
- role="menuitem"
68
- {...rest}
69
- ref={innerButtonRef}
70
- data-focus={hasFocus}
71
- tabIndex={-1}
72
- onClick={event => {
73
- onClick && onClick(event);
74
- onSelectedChange && childIndex && onSelectedChange(childIndex);
75
- }}
76
- >
77
- {children}
78
- </button>
79
- </li>
80
- );
81
- }
82
- );
69
+ return (
70
+ <li role="none" className={`${classes["context-menu-item"]} ${className ?? ""}`}>
71
+ <button
72
+ role="menuitem"
73
+ {...rest}
74
+ ref={innerButtonRef}
75
+ data-focus={hasFocus}
76
+ tabIndex={-1}
77
+ onClick={event => {
78
+ onClick && onClick(event);
79
+ onSelectedChange && childIndex && onSelectedChange(childIndex);
80
+ }}
81
+ >
82
+ {children}
83
+ </button>
84
+ </li>
85
+ );
86
+ };
87
+
88
+ export const ContextMenuItem = React.forwardRef(ContextMenuItemComponent);
@@ -37,6 +37,7 @@ export interface Props<T> extends Omit<ComponentPropsWithRef<"div">, "children">
37
37
  addBtnProps?: ButtonProps;
38
38
  columnsBtnProps?: ButtonProps;
39
39
  searchBtnProps?: ButtonProps;
40
+ searchIconBtnProps?: ButtonProps;
40
41
  };
41
42
  emptyLabel?: string;
42
43
  paginationProps?: PaginationProps;
@@ -42,7 +42,7 @@
42
42
 
43
43
  @media only screen and (min-width: 30em) {
44
44
  .desktop {
45
- display: block;
45
+ display: flex;
46
46
  }
47
47
 
48
48
  .mobile {
@@ -105,6 +105,7 @@ describe("DataGridActions should render", () => {
105
105
  const addBtnProps = { children: "button1", title: "title1" };
106
106
  const columnsBtnProps = { children: "button2", title: "title2" };
107
107
  const searchBtnProps = { children: "button3", title: "title3" };
108
+ const searchIconBtnProps = { title: "title4" };
108
109
  const { dataGridActions, getAllByRole } = createDataGridActions(params => ({
109
110
  ...params,
110
111
  enableAddBtn: true,
@@ -112,7 +113,8 @@ describe("DataGridActions should render", () => {
112
113
  enableSearchBtn: true,
113
114
  addBtnProps,
114
115
  columnsBtnProps,
115
- searchBtnProps
116
+ searchBtnProps,
117
+ searchIconBtnProps
116
118
  }));
117
119
 
118
120
  expect(dataGridActions).toBeDefined();
@@ -125,7 +127,7 @@ describe("DataGridActions should render", () => {
125
127
  expect(mobileColumnsBtn).toHaveTextContent(columnsBtnProps.title);
126
128
  expect(desktopSearchBtn).toHaveTextContent(searchBtnProps.children);
127
129
  expect(desktopSearchBtn).toHaveAttribute("title", searchBtnProps.title);
128
- expect(mobileSearchBtn).toHaveTextContent(searchBtnProps.title);
130
+ expect(mobileSearchBtn).toHaveTextContent(searchIconBtnProps.title);
129
131
  });
130
132
  });
131
133