@dxc-technology/halstack-react 0.0.0-50c4df3 → 0.0.0-51152f3

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 (278) hide show
  1. package/BackgroundColorContext.d.ts +1 -10
  2. package/BackgroundColorContext.js +5 -22
  3. package/HalstackContext.d.ts +1231 -6
  4. package/HalstackContext.js +67 -100
  5. package/README.md +47 -0
  6. package/accordion/Accordion.d.ts +1 -1
  7. package/accordion/Accordion.js +30 -87
  8. package/accordion/Accordion.stories.tsx +2 -114
  9. package/accordion/Accordion.test.js +19 -34
  10. package/accordion/types.d.ts +5 -17
  11. package/accordion-group/AccordionGroup.d.ts +4 -3
  12. package/accordion-group/AccordionGroup.js +29 -77
  13. package/accordion-group/AccordionGroup.stories.tsx +78 -77
  14. package/accordion-group/AccordionGroup.test.js +44 -72
  15. package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
  16. package/accordion-group/AccordionGroupAccordion.js +31 -0
  17. package/accordion-group/types.d.ts +6 -18
  18. package/action-icon/ActionIcon.d.ts +4 -0
  19. package/action-icon/ActionIcon.js +47 -0
  20. package/action-icon/ActionIcon.stories.tsx +41 -0
  21. package/action-icon/ActionIcon.test.js +64 -0
  22. package/action-icon/types.d.ts +26 -0
  23. package/alert/Alert.js +19 -58
  24. package/alert/Alert.test.js +29 -46
  25. package/alert/types.d.ts +5 -5
  26. package/badge/Badge.d.ts +1 -1
  27. package/badge/Badge.js +141 -43
  28. package/badge/Badge.stories.tsx +210 -0
  29. package/badge/Badge.test.js +30 -0
  30. package/badge/types.d.ts +52 -3
  31. package/bleed/Bleed.js +13 -21
  32. package/bleed/Bleed.stories.tsx +1 -0
  33. package/bleed/types.d.ts +2 -2
  34. package/box/Box.d.ts +1 -1
  35. package/box/Box.js +18 -59
  36. package/box/Box.stories.tsx +25 -53
  37. package/box/Box.test.js +2 -7
  38. package/box/types.d.ts +3 -15
  39. package/bulleted-list/BulletedList.js +19 -53
  40. package/bulleted-list/BulletedList.stories.tsx +8 -93
  41. package/bulleted-list/types.d.ts +32 -5
  42. package/button/Button.d.ts +1 -1
  43. package/button/Button.js +68 -102
  44. package/button/Button.stories.tsx +9 -90
  45. package/button/Button.test.js +20 -17
  46. package/button/types.d.ts +8 -4
  47. package/card/Card.d.ts +1 -1
  48. package/card/Card.js +48 -89
  49. package/card/Card.stories.tsx +12 -42
  50. package/card/Card.test.js +11 -22
  51. package/card/types.d.ts +6 -12
  52. package/checkbox/Checkbox.js +87 -122
  53. package/checkbox/Checkbox.stories.tsx +16 -54
  54. package/checkbox/Checkbox.test.js +108 -64
  55. package/checkbox/types.d.ts +8 -4
  56. package/chip/Chip.js +36 -70
  57. package/chip/Chip.stories.tsx +25 -17
  58. package/chip/Chip.test.js +16 -31
  59. package/chip/types.d.ts +4 -4
  60. package/common/OpenSans.css +68 -80
  61. package/common/coreTokens.d.ts +237 -0
  62. package/common/coreTokens.js +184 -0
  63. package/common/utils.d.ts +1 -0
  64. package/common/utils.js +6 -12
  65. package/common/variables.d.ts +1383 -0
  66. package/common/variables.js +880 -1163
  67. package/container/Container.d.ts +4 -0
  68. package/container/Container.js +194 -0
  69. package/container/Container.stories.tsx +214 -0
  70. package/container/types.d.ts +74 -0
  71. package/date-input/Calendar.js +15 -59
  72. package/date-input/DateInput.js +50 -96
  73. package/date-input/DateInput.stories.tsx +11 -30
  74. package/date-input/DateInput.test.js +674 -701
  75. package/date-input/DatePicker.js +11 -42
  76. package/date-input/Icons.d.ts +6 -6
  77. package/date-input/Icons.js +6 -23
  78. package/date-input/YearPicker.js +8 -34
  79. package/date-input/types.d.ts +27 -21
  80. package/dialog/Dialog.d.ts +1 -1
  81. package/dialog/Dialog.js +61 -117
  82. package/dialog/Dialog.stories.tsx +292 -216
  83. package/dialog/Dialog.test.js +269 -32
  84. package/dialog/types.d.ts +18 -26
  85. package/dropdown/Dropdown.js +50 -102
  86. package/dropdown/Dropdown.test.js +393 -379
  87. package/dropdown/DropdownMenu.js +13 -20
  88. package/dropdown/DropdownMenuItem.js +5 -19
  89. package/dropdown/types.d.ts +17 -19
  90. package/file-input/FileInput.js +181 -250
  91. package/file-input/FileInput.stories.tsx +1 -1
  92. package/file-input/FileInput.test.js +357 -355
  93. package/file-input/FileItem.js +14 -41
  94. package/file-input/types.d.ts +10 -10
  95. package/flex/Flex.js +27 -39
  96. package/flex/Flex.stories.tsx +35 -26
  97. package/flex/types.d.ts +74 -9
  98. package/footer/Footer.d.ts +1 -1
  99. package/footer/Footer.js +70 -117
  100. package/footer/Footer.stories.tsx +38 -95
  101. package/footer/Footer.test.js +33 -57
  102. package/footer/Icons.d.ts +3 -2
  103. package/footer/Icons.js +66 -7
  104. package/footer/types.d.ts +25 -27
  105. package/grid/Grid.d.ts +7 -0
  106. package/grid/Grid.js +76 -0
  107. package/grid/Grid.stories.tsx +219 -0
  108. package/grid/types.d.ts +115 -0
  109. package/grid/types.js +5 -0
  110. package/header/Header.d.ts +4 -3
  111. package/header/Header.js +34 -117
  112. package/header/Header.stories.tsx +7 -71
  113. package/header/Header.test.js +13 -26
  114. package/header/Icons.d.ts +2 -2
  115. package/header/Icons.js +2 -7
  116. package/header/types.d.ts +5 -20
  117. package/heading/Heading.js +10 -32
  118. package/heading/Heading.test.js +71 -88
  119. package/heading/types.d.ts +7 -7
  120. package/image/Image.d.ts +4 -0
  121. package/image/Image.js +70 -0
  122. package/image/Image.stories.tsx +127 -0
  123. package/image/types.d.ts +72 -0
  124. package/image/types.js +5 -0
  125. package/inset/Inset.js +13 -21
  126. package/inset/Inset.stories.tsx +2 -1
  127. package/inset/types.d.ts +2 -2
  128. package/layout/ApplicationLayout.d.ts +5 -5
  129. package/layout/ApplicationLayout.js +29 -66
  130. package/layout/ApplicationLayout.stories.tsx +1 -1
  131. package/layout/Icons.d.ts +8 -5
  132. package/layout/Icons.js +51 -59
  133. package/layout/SidenavContext.d.ts +1 -1
  134. package/layout/SidenavContext.js +3 -9
  135. package/layout/types.d.ts +5 -6
  136. package/link/Link.js +24 -45
  137. package/link/Link.test.js +24 -44
  138. package/link/types.d.ts +14 -14
  139. package/main.d.ts +7 -4
  140. package/main.js +32 -58
  141. package/nav-tabs/NavTabs.d.ts +2 -2
  142. package/nav-tabs/NavTabs.js +22 -54
  143. package/nav-tabs/NavTabs.stories.tsx +21 -5
  144. package/nav-tabs/NavTabs.test.js +39 -45
  145. package/nav-tabs/Tab.js +43 -75
  146. package/nav-tabs/types.d.ts +14 -15
  147. package/number-input/NumberInput.d.ts +7 -0
  148. package/number-input/NumberInput.js +47 -37
  149. package/number-input/NumberInput.stories.tsx +42 -26
  150. package/number-input/NumberInput.test.js +860 -413
  151. package/number-input/types.d.ts +11 -5
  152. package/package.json +31 -29
  153. package/paginator/Icons.d.ts +5 -5
  154. package/paginator/Icons.js +5 -19
  155. package/paginator/Paginator.js +17 -47
  156. package/paginator/Paginator.test.js +235 -215
  157. package/paginator/types.d.ts +3 -3
  158. package/paragraph/Paragraph.d.ts +3 -4
  159. package/paragraph/Paragraph.js +6 -22
  160. package/paragraph/Paragraph.stories.tsx +0 -17
  161. package/password-input/Icons.d.ts +6 -0
  162. package/password-input/Icons.js +35 -0
  163. package/password-input/PasswordInput.js +57 -126
  164. package/password-input/PasswordInput.stories.tsx +1 -33
  165. package/password-input/PasswordInput.test.js +158 -141
  166. package/password-input/types.d.ts +8 -7
  167. package/progress-bar/ProgressBar.d.ts +2 -2
  168. package/progress-bar/ProgressBar.js +22 -54
  169. package/progress-bar/{ProgressBar.stories.jsx → ProgressBar.stories.tsx} +1 -1
  170. package/progress-bar/ProgressBar.test.js +36 -53
  171. package/progress-bar/types.d.ts +4 -3
  172. package/quick-nav/QuickNav.js +4 -27
  173. package/quick-nav/QuickNav.stories.tsx +1 -1
  174. package/quick-nav/types.d.ts +10 -10
  175. package/radio-group/Radio.d.ts +1 -1
  176. package/radio-group/Radio.js +31 -63
  177. package/radio-group/RadioGroup.js +45 -93
  178. package/radio-group/RadioGroup.stories.tsx +10 -10
  179. package/radio-group/RadioGroup.test.js +505 -471
  180. package/radio-group/types.d.ts +8 -8
  181. package/resultset-table/Icons.d.ts +7 -0
  182. package/{resultsetTable → resultset-table}/Icons.js +1 -5
  183. package/resultset-table/ResultsetTable.d.ts +7 -0
  184. package/{resultsetTable → resultset-table}/ResultsetTable.js +38 -66
  185. package/{resultsetTable → resultset-table}/ResultsetTable.stories.tsx +86 -5
  186. package/{resultsetTable → resultset-table}/ResultsetTable.test.js +139 -93
  187. package/{resultsetTable → resultset-table}/types.d.ts +13 -7
  188. package/resultset-table/types.js +5 -0
  189. package/select/Icons.d.ts +7 -7
  190. package/select/Icons.js +1 -5
  191. package/select/Listbox.js +13 -39
  192. package/select/Option.js +17 -27
  193. package/select/Select.js +94 -168
  194. package/select/Select.stories.tsx +3 -3
  195. package/select/Select.test.js +1952 -1810
  196. package/select/types.d.ts +14 -15
  197. package/sidenav/Icons.d.ts +7 -0
  198. package/sidenav/Icons.js +47 -0
  199. package/sidenav/Sidenav.d.ts +2 -2
  200. package/sidenav/Sidenav.js +81 -151
  201. package/sidenav/Sidenav.stories.tsx +60 -60
  202. package/sidenav/Sidenav.test.js +3 -10
  203. package/sidenav/types.d.ts +31 -28
  204. package/slider/Slider.js +70 -128
  205. package/slider/Slider.test.js +108 -104
  206. package/slider/types.d.ts +4 -4
  207. package/spinner/Spinner.js +29 -73
  208. package/spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +28 -28
  209. package/spinner/Spinner.test.js +26 -35
  210. package/spinner/types.d.ts +3 -3
  211. package/status-light/StatusLight.d.ts +4 -0
  212. package/status-light/StatusLight.js +51 -0
  213. package/status-light/StatusLight.stories.tsx +74 -0
  214. package/status-light/StatusLight.test.js +25 -0
  215. package/status-light/types.d.ts +17 -0
  216. package/status-light/types.js +5 -0
  217. package/switch/Switch.js +51 -99
  218. package/switch/Switch.stories.tsx +0 -34
  219. package/switch/Switch.test.js +52 -97
  220. package/switch/types.d.ts +4 -4
  221. package/table/ActionsCell.d.ts +4 -0
  222. package/table/ActionsCell.js +55 -0
  223. package/table/DropdownTheme.js +58 -0
  224. package/table/Table.d.ts +4 -1
  225. package/table/Table.js +27 -32
  226. package/table/{Table.stories.jsx → Table.stories.tsx} +261 -2
  227. package/table/Table.test.js +94 -7
  228. package/table/types.d.ts +45 -6
  229. package/tabs/Tab.js +23 -40
  230. package/tabs/Tabs.js +62 -145
  231. package/tabs/Tabs.stories.tsx +1 -1
  232. package/tabs/Tabs.test.js +66 -123
  233. package/tabs/types.d.ts +19 -19
  234. package/tag/Tag.js +28 -60
  235. package/tag/Tag.test.js +20 -31
  236. package/tag/types.d.ts +7 -7
  237. package/text-input/Icons.d.ts +5 -5
  238. package/text-input/Icons.js +1 -5
  239. package/text-input/Suggestion.js +11 -28
  240. package/text-input/Suggestions.d.ts +1 -1
  241. package/text-input/Suggestions.js +15 -65
  242. package/text-input/TextInput.js +220 -328
  243. package/text-input/TextInput.stories.tsx +48 -152
  244. package/text-input/TextInput.test.js +1228 -1196
  245. package/text-input/types.d.ts +25 -17
  246. package/textarea/Textarea.js +70 -113
  247. package/textarea/{Textarea.stories.jsx → Textarea.stories.tsx} +58 -100
  248. package/textarea/Textarea.test.js +152 -183
  249. package/textarea/types.d.ts +9 -5
  250. package/toggle-group/ToggleGroup.d.ts +2 -2
  251. package/toggle-group/ToggleGroup.js +92 -106
  252. package/toggle-group/ToggleGroup.stories.tsx +7 -4
  253. package/toggle-group/ToggleGroup.test.js +69 -88
  254. package/toggle-group/types.d.ts +26 -17
  255. package/typography/Typography.d.ts +2 -2
  256. package/typography/Typography.js +15 -123
  257. package/typography/Typography.stories.tsx +1 -1
  258. package/typography/types.d.ts +1 -1
  259. package/useTheme.d.ts +1135 -1
  260. package/useTheme.js +2 -9
  261. package/useTranslatedLabels.d.ts +84 -1
  262. package/useTranslatedLabels.js +1 -7
  263. package/utils/BaseTypography.d.ts +21 -0
  264. package/utils/BaseTypography.js +94 -0
  265. package/utils/FocusLock.d.ts +13 -0
  266. package/utils/FocusLock.js +124 -0
  267. package/wizard/Wizard.js +16 -51
  268. package/wizard/Wizard.test.js +54 -81
  269. package/wizard/types.d.ts +8 -9
  270. package/card/ice-cream.jpg +0 -0
  271. package/number-input/NumberInputContext.d.ts +0 -4
  272. package/number-input/NumberInputContext.js +0 -19
  273. package/number-input/numberInputContextTypes.d.ts +0 -19
  274. package/resultsetTable/Icons.d.ts +0 -7
  275. package/resultsetTable/ResultsetTable.d.ts +0 -4
  276. package/slider/Slider.stories.tsx +0 -240
  277. /package/{resultsetTable → action-icon}/types.js +0 -0
  278. /package/{number-input/numberInputContextTypes.js → container/types.js} +0 -0
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _ActionIcon = _interopRequireDefault(require("../action-icon/ActionIcon"));
10
+ var _main = require("../main");
11
+ var _DropdownTheme = _interopRequireDefault(require("./DropdownTheme"));
12
+ var moreVertIcon = /*#__PURE__*/_react["default"].createElement("svg", {
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ height: "24",
15
+ viewBox: "0 -960 960 960",
16
+ width: "24",
17
+ fill: "currentColor"
18
+ }, /*#__PURE__*/_react["default"].createElement("path", {
19
+ d: "M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"
20
+ }));
21
+ var DxcActionsCell = function DxcActionsCell(_ref) {
22
+ var actions = _ref.actions;
23
+ var actionIcons = actions.filter(function (action) {
24
+ return !action.options;
25
+ });
26
+ var actionDropdown = actions.find(function (action) {
27
+ return action.options;
28
+ });
29
+ var maxNumberOfActions = actionDropdown ? 2 : 3;
30
+ return /*#__PURE__*/_react["default"].createElement(_main.DxcFlex, {
31
+ gap: "0.5rem",
32
+ alignItems: "center"
33
+ }, actionIcons.map(function (action, index) {
34
+ var _action$disabled, _action$tabIndex;
35
+ return index < maxNumberOfActions && /*#__PURE__*/_react["default"].createElement(_ActionIcon["default"], {
36
+ icon: action.icon,
37
+ title: action.title,
38
+ onClick: action.onClick,
39
+ disabled: (_action$disabled = action.disabled) !== null && _action$disabled !== void 0 ? _action$disabled : false,
40
+ tabIndex: (_action$tabIndex = action.tabIndex) !== null && _action$tabIndex !== void 0 ? _action$tabIndex : 0,
41
+ key: "action-".concat(index)
42
+ });
43
+ }), actionDropdown && /*#__PURE__*/_react["default"].createElement(_main.HalstackProvider, {
44
+ advancedTheme: _DropdownTheme["default"],
45
+ key: "provider-dropdown"
46
+ }, /*#__PURE__*/_react["default"].createElement(_main.DxcDropdown, {
47
+ options: actionDropdown.options,
48
+ onSelectOption: actionDropdown.onClick,
49
+ disabled: actionDropdown.disabled,
50
+ icon: moreVertIcon,
51
+ tabIndex: actionDropdown.tabIndex,
52
+ caretHidden: true
53
+ })));
54
+ };
55
+ var _default = exports["default"] = DxcActionsCell;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _variables = require("../common/variables");
8
+ var _default = exports["default"] = {
9
+ dropdown: {
10
+ // Breadcrumbs tokens
11
+ buttonIconSize: "16px",
12
+ buttonPaddingTop: "4px",
13
+ buttonPaddingBottom: "4px",
14
+ buttonPaddingLeft: "4px",
15
+ buttonPaddingRight: "4px",
16
+ buttonHeight: "24px",
17
+ buttonBorderRadius: "2px",
18
+ buttonBorderColor: "transparent",
19
+ optionFontSize: "14px",
20
+ optionPaddingTop: "0px",
21
+ optionPaddingBottom: "0px",
22
+ optionPaddingLeft: "16px",
23
+ optionPaddingRight: "16px",
24
+ // Dropdown tokens
25
+ buttonBackgroundColor: _variables.componentTokens.table.actionBackgroundColor,
26
+ hoverButtonBackgroundColor: _variables.componentTokens.table.hoverActionBackgroundColor,
27
+ activeButtonBackgroundColor: _variables.componentTokens.table.activeActionBackgroundColor,
28
+ buttonFontFamily: _variables.componentTokens.dropdown.buttonFontFamily,
29
+ buttonFontSize: _variables.componentTokens.dropdown.buttonFontSize,
30
+ buttonFontStyle: _variables.componentTokens.dropdown.buttonFontStyle,
31
+ buttonFontWeight: _variables.componentTokens.dropdown.buttonFontWeight,
32
+ buttonFontColor: _variables.componentTokens.dropdown.buttonFontColor,
33
+ buttonIconSpacing: _variables.componentTokens.dropdown.buttonIconSpacing,
34
+ buttonIconColor: _variables.componentTokens.table.actionIconColor,
35
+ disabledColor: _variables.componentTokens.table.disabledActionIconColor,
36
+ disabledButtonBackgroundColor: _variables.componentTokens.table.disabledActionBackgroundColor,
37
+ disabledBorderColor: _variables.componentTokens.dropdown.disabledBorderColor,
38
+ optionBackgroundColor: _variables.componentTokens.dropdown.optionBackgroundColor,
39
+ hoverOptionBackgroundColor: _variables.componentTokens.dropdown.hoverOptionBackgroundColor,
40
+ activeOptionBackgroundColor: _variables.componentTokens.dropdown.activeOptionBackgroundColor,
41
+ optionFontFamily: _variables.componentTokens.dropdown.optionFontFamily,
42
+ optionFontStyle: _variables.componentTokens.dropdown.optionFontStyle,
43
+ optionFontWeight: _variables.componentTokens.dropdown.optionFontWeight,
44
+ optionFontColor: _variables.componentTokens.dropdown.optionFontColor,
45
+ optionIconSize: _variables.componentTokens.dropdown.optionIconSize,
46
+ optionIconSpacing: _variables.componentTokens.dropdown.optionIconSpacing,
47
+ optionIconColor: _variables.componentTokens.dropdown.optionIconColor,
48
+ caretIconSize: _variables.componentTokens.dropdown.caretIconSize,
49
+ caretIconColor: _variables.componentTokens.dropdown.caretIconColor,
50
+ caretIconSpacing: _variables.componentTokens.dropdown.caretIconSpacing,
51
+ borderRadius: _variables.componentTokens.dropdown.borderRadius,
52
+ borderStyle: _variables.componentTokens.dropdown.borderStyle,
53
+ borderThickness: _variables.componentTokens.dropdown.borderThickness,
54
+ borderColor: _variables.componentTokens.dropdown.borderColor,
55
+ scrollBarThumbColor: _variables.componentTokens.dropdown.scrollBarThumbColor,
56
+ scrollBarTrackColor: _variables.componentTokens.dropdown.scrollBarTrackColor
57
+ }
58
+ };
package/table/Table.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import TablePropsType from "./types";
3
- declare const DxcTable: ({ children, margin }: TablePropsType) => JSX.Element;
3
+ declare const DxcTable: {
4
+ ({ children, margin, mode }: TablePropsType): JSX.Element;
5
+ ActionsCell: ({ actions }: import("./types").ActionCellsPropsType) => JSX.Element;
6
+ };
4
7
  export default DxcTable;
package/table/Table.js CHANGED
@@ -1,53 +1,40 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  var _typeof3 = require("@babel/runtime/helpers/typeof");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports["default"] = void 0;
11
-
12
9
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
-
14
10
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
-
16
11
  var _react = _interopRequireDefault(require("react"));
17
-
18
12
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
19
-
20
- var _variables = require("../common/variables.js");
21
-
22
- var _utils = require("../common/utils.js");
23
-
13
+ var _variables = require("../common/variables");
14
+ var _utils = require("../common/utils");
24
15
  var _useTheme = _interopRequireDefault(require("../useTheme"));
25
-
26
- var _BackgroundColorContext = require("../BackgroundColorContext");
27
-
16
+ var _coreTokens = _interopRequireDefault(require("../common/coreTokens"));
17
+ var _ActionsCell = _interopRequireDefault(require("./ActionsCell"));
28
18
  var _templateObject, _templateObject2;
29
-
30
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
-
32
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
33
-
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
34
21
  var DxcTable = function DxcTable(_ref) {
35
22
  var children = _ref.children,
36
- margin = _ref.margin;
23
+ margin = _ref.margin,
24
+ _ref$mode = _ref.mode,
25
+ mode = _ref$mode === void 0 ? "default" : _ref$mode;
37
26
  var colorsTheme = (0, _useTheme["default"])();
38
27
  return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
39
28
  theme: colorsTheme.table
40
29
  }, /*#__PURE__*/_react["default"].createElement(DxcTableContainer, {
41
30
  margin: margin
42
- }, /*#__PURE__*/_react["default"].createElement(DxcTableContent, null, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
43
- color: colorsTheme.table.dataBackgroundColor
44
- }, children))));
31
+ }, /*#__PURE__*/_react["default"].createElement(DxcTableContent, {
32
+ mode: mode
33
+ }, children)));
45
34
  };
46
-
47
35
  var calculateWidth = function calculateWidth(margin) {
48
36
  return "calc(100% - ".concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
49
37
  };
50
-
51
38
  var DxcTableContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n overflow: auto;\n &::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n &::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 6px;\n }\n &::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 6px;\n }\n"])), function (props) {
52
39
  return calculateWidth(props.margin);
53
40
  }, function (props) {
@@ -65,9 +52,10 @@ var DxcTableContainer = _styledComponents["default"].div(_templateObject || (_te
65
52
  }, function (props) {
66
53
  return props.theme.scrollBarTrackColor;
67
54
  });
68
-
69
- var DxcTableContent = _styledComponents["default"].table(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n border-collapse: collapse;\n width: 100%;\n\n & tr {\n border-bottom: ", ";\n height: 60px;\n }\n & td {\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n text-align: ", ";\n line-height: ", ";\n padding: ", ";\n }\n & th {\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n text-align: ", ";\n line-height: ", ";\n padding: ", ";\n }\n & th:first-child {\n border-top-left-radius: ", ";\n }\n & th:last-child {\n border-top-right-radius: ", ";\n }\n & td:last-child {\n padding-right: 40px;\n }\n"])), function (props) {
55
+ var DxcTableContent = _styledComponents["default"].table(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n border-collapse: collapse;\n width: 100%;\n\n & tr {\n border-bottom: ", ";\n height: ", ";\n }\n & td {\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n text-align: ", ";\n line-height: ", ";\n padding: ", ";\n }\n & th {\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n text-transform: ", ";\n text-align: ", ";\n line-height: ", ";\n padding: ", ";\n }\n & th:first-child {\n border-top-left-radius: ", ";\n padding-left: ", ";\n }\n & th:last-child {\n border-top-right-radius: ", ";\n padding-right: ", ";\n }\n & td:first-child {\n padding-left: ", ";\n }\n & td:last-child {\n padding-right: ", ";\n }\n"])), function (props) {
70
56
  return "".concat(props.theme.rowSeparatorThickness, " ").concat(props.theme.rowSeparatorStyle, " ").concat(props.theme.rowSeparatorColor);
57
+ }, function (props) {
58
+ return props.mode === "default" ? "60px" : "36px";
71
59
  }, function (props) {
72
60
  return props.theme.dataBackgroundColor;
73
61
  }, function (props) {
@@ -87,7 +75,7 @@ var DxcTableContent = _styledComponents["default"].table(_templateObject2 || (_t
87
75
  }, function (props) {
88
76
  return props.theme.dataTextLineHeight;
89
77
  }, function (props) {
90
- return "".concat(props.theme.dataPaddingTop, " ").concat(props.theme.dataPaddingRight, " ").concat(props.theme.dataPaddingBottom, " ").concat(props.theme.dataPaddingLeft);
78
+ return props.mode === "default" ? "".concat(props.theme.dataPaddingTop, " ").concat(props.theme.dataPaddingRight, " ").concat(props.theme.dataPaddingBottom, " ").concat(props.theme.dataPaddingLeft) : "".concat(_coreTokens["default"].spacing_8, " ").concat(_coreTokens["default"].spacing_16);
91
79
  }, function (props) {
92
80
  return props.theme.headerBackgroundColor;
93
81
  }, function (props) {
@@ -107,12 +95,19 @@ var DxcTableContent = _styledComponents["default"].table(_templateObject2 || (_t
107
95
  }, function (props) {
108
96
  return props.theme.headerTextLineHeight;
109
97
  }, function (props) {
110
- return "".concat(props.theme.headerPaddingTop, " ").concat(props.theme.headerPaddingRight, " ").concat(props.theme.headerPaddingBottom, " ").concat(props.theme.headerPaddingLeft);
98
+ return props.mode === "default" ? "".concat(props.theme.headerPaddingTop, " ").concat(props.theme.headerPaddingRight, " ").concat(props.theme.headerPaddingBottom, " ").concat(props.theme.headerPaddingLeft) : "".concat(_coreTokens["default"].spacing_8, " ").concat(_coreTokens["default"].spacing_16);
111
99
  }, function (props) {
112
100
  return props.theme.headerBorderRadius;
101
+ }, function (props) {
102
+ return props.mode === "default" ? _coreTokens["default"].spacing_24 : "20px";
113
103
  }, function (props) {
114
104
  return props.theme.headerBorderRadius;
105
+ }, function (props) {
106
+ return props.mode === "default" ? _coreTokens["default"].spacing_24 : "20px";
107
+ }, function (props) {
108
+ return props.mode === "default" ? _coreTokens["default"].spacing_24 : "20px";
109
+ }, function (props) {
110
+ return props.mode === "default" ? _coreTokens["default"].spacing_24 : "20px";
115
111
  });
116
-
117
- var _default = DxcTable;
118
- exports["default"] = _default;
112
+ DxcTable.ActionsCell = _ActionsCell["default"];
113
+ var _default = exports["default"] = DxcTable;
@@ -3,6 +3,7 @@ import DxcTable from "./Table";
3
3
  import Title from "../../.storybook/components/Title";
4
4
  import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
5
  import { HalstackProvider } from "../HalstackContext";
6
+ import { userEvent, within } from "@storybook/testing-library";
6
7
 
7
8
  export default {
8
9
  title: "Table",
@@ -17,11 +18,197 @@ const opinionatedTheme = {
17
18
  },
18
19
  };
19
20
 
21
+ const icon1 = (
22
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
23
+ <path d="M0 0h24v24H0V0z" fill="none" />
24
+ <path d="M7.77 6.76L6.23 5.48.82 12l5.41 6.52 1.54-1.28L3.42 12l4.35-5.24zM7 13h2v-2H7v2zm10-2h-2v2h2v-2zm-6 2h2v-2h-2v2zm6.77-7.52l-1.54 1.28L20.58 12l-4.35 5.24 1.54 1.28L23.18 12l-5.41-6.52z" />
25
+ </svg>
26
+ );
27
+
28
+ const actions = [
29
+ {
30
+ title: "icon",
31
+ onClick: (value?) => {
32
+ console.log(value);
33
+ },
34
+ options: [
35
+ {
36
+ value: "1",
37
+ label: "Amazon with a very long text",
38
+ },
39
+ {
40
+ value: "2",
41
+ label: "Ebay",
42
+ },
43
+ {
44
+ value: "3",
45
+ label: "Apple",
46
+ },
47
+ ],
48
+ },
49
+ {
50
+ title: "icon",
51
+ onClick: (value?) => {
52
+ console.log(value);
53
+ },
54
+ options: [
55
+ {
56
+ value: "1",
57
+ label: "Amazon with a very long text",
58
+ },
59
+ {
60
+ value: "2",
61
+ label: "Ebay",
62
+ },
63
+ {
64
+ value: "3",
65
+ label: "Apple",
66
+ },
67
+ ],
68
+ },
69
+ {
70
+ disabled: true,
71
+ title: "icon",
72
+ onClick: (value?) => {
73
+ console.log(value);
74
+ },
75
+ options: [
76
+ {
77
+ value: "1",
78
+ label: "Amazon with a very long text",
79
+ },
80
+ {
81
+ value: "2",
82
+ label: "Ebay",
83
+ },
84
+ {
85
+ value: "3",
86
+ label: "Apple",
87
+ },
88
+ ],
89
+ },
90
+ {
91
+ icon: icon1,
92
+ title: "icon",
93
+ onClick: () => {},
94
+ },
95
+ {
96
+ icon: icon1,
97
+ title: "icon",
98
+ onClick: () => {},
99
+ disabled: true,
100
+ },
101
+ ];
102
+
20
103
  export const Chromatic = () => (
21
104
  <>
22
105
  <ExampleContainer>
23
106
  <Title title="Default" theme="light" level={4} />
24
107
  <DxcTable>
108
+ <tr>
109
+ <th>header 1</th>
110
+ <th>header 2</th>
111
+ <th>actions</th>
112
+ </tr>
113
+ <tr>
114
+ <td>cell 1</td>
115
+ <td>cell 2</td>
116
+ <td>
117
+ <DxcTable.ActionsCell actions={actions} />
118
+ </td>
119
+ </tr>
120
+ <tr>
121
+ <td>cell 4</td>
122
+ <td>cell 5</td>
123
+ <td>
124
+ <DxcTable.ActionsCell actions={actions} />
125
+ </td>
126
+ </tr>
127
+ <tr>
128
+ <td>cell 7</td>
129
+ <td>cell 8</td>
130
+ <td>
131
+ <DxcTable.ActionsCell actions={actions} />
132
+ </td>
133
+ </tr>
134
+ </DxcTable>
135
+ </ExampleContainer>
136
+ <ExampleContainer>
137
+ <Title title="With scrollbar" theme="light" level={4} />
138
+ <div
139
+ style={{ height: 200 + "px", display: "flex", flexDirection: "row", width: 100 + "%", marginBottom: 50 + "px" }}
140
+ >
141
+ <DxcTable>
142
+ <tr>
143
+ <th>
144
+ header<br></br>subheader
145
+ </th>
146
+ <th>
147
+ header<br></br>subheader
148
+ </th>
149
+ <th>
150
+ header<br></br>subheader
151
+ </th>
152
+ </tr>
153
+ <tr>
154
+ <td>
155
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
156
+ dolore magna aliqua.
157
+ </td>
158
+ <td>
159
+ Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
160
+ consequat.
161
+ </td>
162
+ <td>
163
+ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
164
+ </td>
165
+ </tr>
166
+ <tr>
167
+ <td>cell data</td>
168
+ <td>cell data</td>
169
+ <td>cell data</td>
170
+ </tr>
171
+ <tr>
172
+ <td>cell data</td>
173
+ <td>cell data</td>
174
+ <td>cell data</td>
175
+ </tr>
176
+ <tr>
177
+ <td>cell data</td>
178
+ <td>cell data</td>
179
+ <td>cell data</td>
180
+ </tr>
181
+ <tr>
182
+ <td>cell data</td>
183
+ <td>cell data</td>
184
+ <td>cell data</td>
185
+ </tr>
186
+ <tr>
187
+ <td>cell data</td>
188
+ <td>cell data</td>
189
+ <td>cell data</td>
190
+ </tr>
191
+ <tr>
192
+ <td>cell data</td>
193
+ <td>cell data</td>
194
+ <td>cell data</td>
195
+ </tr>
196
+ <tr>
197
+ <td>cell data</td>
198
+ <td>cell data</td>
199
+ <td>cell data</td>
200
+ </tr>
201
+ <tr>
202
+ <td>cell data</td>
203
+ <td>cell data</td>
204
+ <td>cell data</td>
205
+ </tr>
206
+ </DxcTable>
207
+ </div>
208
+ </ExampleContainer>
209
+ <ExampleContainer>
210
+ <Title title="Default reduced" theme="light" level={4} />
211
+ <DxcTable mode="reduced">
25
212
  <tr>
26
213
  <th>header 1</th>
27
214
  <th>header 2</th>
@@ -45,11 +232,11 @@ export const Chromatic = () => (
45
232
  </DxcTable>
46
233
  </ExampleContainer>
47
234
  <ExampleContainer>
48
- <Title title="With scrollbar" theme="light" level={4} />
235
+ <Title title="Reduced with scrollbar" theme="light" level={4} />
49
236
  <div
50
237
  style={{ height: 200 + "px", display: "flex", flexDirection: "row", width: 100 + "%", marginBottom: 50 + "px" }}
51
238
  >
52
- <DxcTable>
239
+ <DxcTable mode="reduced">
53
240
  <tr>
54
241
  <th>
55
242
  header<br></br>subheader
@@ -117,6 +304,37 @@ export const Chromatic = () => (
117
304
  </DxcTable>
118
305
  </div>
119
306
  </ExampleContainer>
307
+ <ExampleContainer>
308
+ <Title title="Reduced table with actions" theme="light" level={4} />
309
+ <DxcTable mode="reduced">
310
+ <tr>
311
+ <th>header 1</th>
312
+ <th>header 2</th>
313
+ <th>header 3</th>
314
+ </tr>
315
+ <tr>
316
+ <td>cell 1</td>
317
+ <td>cell 2</td>
318
+ <td>
319
+ <DxcTable.ActionsCell actions={actions} />
320
+ </td>
321
+ </tr>
322
+ <tr>
323
+ <td>cell 4</td>
324
+ <td>cell 5</td>
325
+ <td>
326
+ <DxcTable.ActionsCell actions={actions} />
327
+ </td>
328
+ </tr>
329
+ <tr>
330
+ <td>cell 7</td>
331
+ <td>cell 8</td>
332
+ <td>
333
+ <DxcTable.ActionsCell actions={actions} />
334
+ </td>
335
+ </tr>
336
+ </DxcTable>
337
+ </ExampleContainer>
120
338
  <Title title="Margins" theme="light" level={2} />
121
339
  <ExampleContainer>
122
340
  <Title title="Xxsmall margin" theme="light" level={4} />
@@ -354,3 +572,44 @@ export const Chromatic = () => (
354
572
  </ExampleContainer>
355
573
  </>
356
574
  );
575
+
576
+ const ActionsCellDropdown = () => (
577
+ <ExampleContainer>
578
+ <Title title="Dropdown Action" theme="light" level={4} />
579
+ <DxcTable>
580
+ <tr>
581
+ <th>header 1</th>
582
+ <th>header 2</th>
583
+ <th>actions</th>
584
+ </tr>
585
+ <tr>
586
+ <td>cell 1</td>
587
+ <td>cell 2</td>
588
+ <td>
589
+ <DxcTable.ActionsCell actions={actions} />
590
+ </td>
591
+ </tr>
592
+ <tr>
593
+ <td>cell 4</td>
594
+ <td>cell 5</td>
595
+ <td>
596
+ <DxcTable.ActionsCell actions={actions} />
597
+ </td>
598
+ </tr>
599
+ <tr>
600
+ <td>cell 7</td>
601
+ <td>cell 8</td>
602
+ <td>
603
+ <DxcTable.ActionsCell actions={actions} />
604
+ </td>
605
+ </tr>
606
+ </DxcTable>
607
+ </ExampleContainer>
608
+ );
609
+
610
+ export const DropdownAction = ActionsCellDropdown.bind({});
611
+ DropdownAction.play = async ({ canvasElement }) => {
612
+ const canvas = within(canvasElement);
613
+ const nextButton = canvas.getAllByRole("button")[8];
614
+ await userEvent.click(nextButton);
615
+ };
@@ -1,18 +1,59 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
4
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
5
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
6
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
7
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
5
8
  var _react = _interopRequireDefault(require("react"));
6
-
7
9
  var _react2 = require("@testing-library/react");
8
-
9
- var _Table = _interopRequireDefault(require("./Table"));
10
-
10
+ var _Table = _interopRequireDefault(require("./Table.tsx"));
11
+ var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
12
+ global.globalThis = global;
13
+ global.DOMRect = {
14
+ fromRect: function fromRect() {
15
+ return {
16
+ top: 0,
17
+ left: 0,
18
+ bottom: 0,
19
+ right: 0,
20
+ width: 0,
21
+ height: 0
22
+ };
23
+ }
24
+ };
25
+ global.ResizeObserver = /*#__PURE__*/function () {
26
+ function ResizeObserver() {
27
+ (0, _classCallCheck2["default"])(this, ResizeObserver);
28
+ }
29
+ (0, _createClass2["default"])(ResizeObserver, [{
30
+ key: "observe",
31
+ value: function observe() {}
32
+ }, {
33
+ key: "unobserve",
34
+ value: function unobserve() {}
35
+ }, {
36
+ key: "disconnect",
37
+ value: function disconnect() {}
38
+ }]);
39
+ return ResizeObserver;
40
+ }();
41
+ var icon = /*#__PURE__*/_react["default"].createElement("svg", {
42
+ xmlns: "http://www.w3.org/2000/svg",
43
+ height: "24px",
44
+ viewBox: "0 0 24 24",
45
+ width: "24px",
46
+ fill: "currentColor"
47
+ }, /*#__PURE__*/_react["default"].createElement("path", {
48
+ d: "M0 0h24v24H0V0zm0 0h24v24H0V0z",
49
+ fill: "none"
50
+ }), /*#__PURE__*/_react["default"].createElement("path", {
51
+ d: "M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3c-1.65-1.66-4.34-1.66-6 0zm-4-4l2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13z"
52
+ }));
11
53
  describe("Table component tests", function () {
12
54
  test("Table renders with correct content", function () {
13
55
  var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Table["default"], null, /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("th", null, "header-1"), /*#__PURE__*/_react["default"].createElement("th", null, "header-2"), /*#__PURE__*/_react["default"].createElement("th", null, "header-3"))), /*#__PURE__*/_react["default"].createElement("tbody", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, "cell-1"), /*#__PURE__*/_react["default"].createElement("td", null, "cell-2"), /*#__PURE__*/_react["default"].createElement("td", null, "cell-3")), /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, "cell-4"), /*#__PURE__*/_react["default"].createElement("td", null, "cell-5"), /*#__PURE__*/_react["default"].createElement("td", null, "cell-6"))))),
14
- getByText = _render.getByText;
15
-
56
+ getByText = _render.getByText;
16
57
  expect(getByText("header-1")).toBeTruthy();
17
58
  expect(getByText("header-2")).toBeTruthy();
18
59
  expect(getByText("header-3")).toBeTruthy();
@@ -23,4 +64,50 @@ describe("Table component tests", function () {
23
64
  expect(getByText("cell-5")).toBeTruthy();
24
65
  expect(getByText("cell-6")).toBeTruthy();
25
66
  });
67
+ test("Table ActionsCell", /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
68
+ var onSelectOption, onClick, actions, _render2, getAllByRole, getByRole, getByText, dropdown, option, action;
69
+ return _regenerator["default"].wrap(function _callee$(_context) {
70
+ while (1) switch (_context.prev = _context.next) {
71
+ case 0:
72
+ onSelectOption = jest.fn();
73
+ onClick = jest.fn();
74
+ actions = [{
75
+ icon: icon,
76
+ title: "icon1",
77
+ onClick: onSelectOption,
78
+ options: [{
79
+ value: "1",
80
+ label: "Amazon"
81
+ }, {
82
+ value: "2",
83
+ label: "Ebay"
84
+ }, {
85
+ value: "3",
86
+ label: "Aliexpress"
87
+ }]
88
+ }, {
89
+ icon: icon,
90
+ title: "icon2",
91
+ onClick: onClick
92
+ }];
93
+ _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Table["default"], null, /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("th", null, "header-1"), /*#__PURE__*/_react["default"].createElement("th", null, "header-2"), /*#__PURE__*/_react["default"].createElement("th", null, "header-3"))), /*#__PURE__*/_react["default"].createElement("tbody", null, /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, "cell-1"), /*#__PURE__*/_react["default"].createElement("td", null, "cell-2"), /*#__PURE__*/_react["default"].createElement("td", null, "cell-3")), /*#__PURE__*/_react["default"].createElement("tr", null, /*#__PURE__*/_react["default"].createElement("td", null, "cell-4"), /*#__PURE__*/_react["default"].createElement("td", null, "cell-5"), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement(_Table["default"].ActionsCell, {
94
+ actions: actions
95
+ })))))), getAllByRole = _render2.getAllByRole, getByRole = _render2.getByRole, getByText = _render2.getByText;
96
+ dropdown = getAllByRole("button")[1];
97
+ (0, _react2.act)(function () {
98
+ _userEvent["default"].click(dropdown);
99
+ });
100
+ expect(getByRole("menu")).toBeTruthy();
101
+ option = getByText("Aliexpress");
102
+ _userEvent["default"].click(option);
103
+ expect(onSelectOption).toHaveBeenCalledWith("3");
104
+ action = getAllByRole("button")[0];
105
+ _userEvent["default"].click(action);
106
+ expect(onClick).toHaveBeenCalled();
107
+ case 13:
108
+ case "end":
109
+ return _context.stop();
110
+ }
111
+ }, _callee);
112
+ })));
26
113
  });