@dxc-technology/halstack-react 0.0.0-9b45027 → 0.0.0-9bd9511

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 (294) hide show
  1. package/BackgroundColorContext.d.ts +2 -2
  2. package/BackgroundColorContext.js +1 -11
  3. package/HalstackContext.d.ts +13 -0
  4. package/HalstackContext.js +318 -0
  5. package/accordion/Accordion.d.ts +1 -1
  6. package/accordion/Accordion.js +124 -179
  7. package/accordion/Accordion.stories.tsx +115 -27
  8. package/accordion/Accordion.test.js +56 -0
  9. package/accordion/types.d.ts +12 -11
  10. package/accordion-group/AccordionGroup.d.ts +1 -1
  11. package/accordion-group/AccordionGroup.js +28 -77
  12. package/accordion-group/AccordionGroup.stories.tsx +28 -2
  13. package/accordion-group/AccordionGroup.test.js +108 -0
  14. package/accordion-group/types.d.ts +19 -12
  15. package/alert/Alert.js +18 -46
  16. package/alert/Alert.stories.tsx +28 -0
  17. package/alert/Alert.test.js +75 -0
  18. package/alert/types.d.ts +3 -3
  19. package/badge/Badge.d.ts +4 -0
  20. package/badge/Badge.js +6 -16
  21. package/badge/types.d.ts +5 -0
  22. package/bleed/Bleed.d.ts +2 -2
  23. package/bleed/Bleed.js +14 -55
  24. package/bleed/Bleed.stories.tsx +94 -95
  25. package/bleed/types.d.ts +26 -2
  26. package/box/Box.js +34 -63
  27. package/box/Box.stories.tsx +15 -0
  28. package/box/Box.test.js +13 -0
  29. package/box/types.d.ts +5 -4
  30. package/bulleted-list/BulletedList.d.ts +7 -0
  31. package/bulleted-list/BulletedList.js +98 -0
  32. package/bulleted-list/BulletedList.stories.tsx +200 -0
  33. package/bulleted-list/types.d.ts +11 -0
  34. package/bulleted-list/types.js +5 -0
  35. package/button/Button.js +61 -100
  36. package/button/Button.stories.tsx +159 -8
  37. package/button/Button.test.js +26 -0
  38. package/button/types.d.ts +8 -8
  39. package/card/Card.js +44 -70
  40. package/card/Card.test.js +39 -0
  41. package/card/types.d.ts +4 -3
  42. package/checkbox/Checkbox.d.ts +2 -2
  43. package/checkbox/Checkbox.js +115 -162
  44. package/checkbox/Checkbox.stories.tsx +198 -130
  45. package/checkbox/Checkbox.test.js +128 -0
  46. package/checkbox/types.d.ts +14 -6
  47. package/chip/Chip.d.ts +1 -1
  48. package/chip/Chip.js +29 -91
  49. package/chip/Chip.stories.tsx +98 -13
  50. package/chip/Chip.test.js +42 -0
  51. package/chip/types.d.ts +8 -16
  52. package/common/utils.js +1 -6
  53. package/common/variables.d.ts +1431 -0
  54. package/common/variables.js +480 -554
  55. package/date-input/Calendar.d.ts +4 -0
  56. package/date-input/Calendar.js +215 -0
  57. package/date-input/DateInput.js +164 -300
  58. package/date-input/DateInput.stories.tsx +199 -33
  59. package/date-input/DateInput.test.js +648 -0
  60. package/date-input/DatePicker.d.ts +4 -0
  61. package/date-input/DatePicker.js +116 -0
  62. package/date-input/Icons.d.ts +6 -0
  63. package/date-input/Icons.js +63 -0
  64. package/date-input/YearPicker.d.ts +4 -0
  65. package/date-input/YearPicker.js +101 -0
  66. package/date-input/types.d.ts +71 -13
  67. package/dialog/Dialog.js +52 -84
  68. package/dialog/Dialog.stories.tsx +99 -22
  69. package/dialog/Dialog.test.js +56 -0
  70. package/dialog/types.d.ts +4 -3
  71. package/dropdown/Dropdown.d.ts +1 -1
  72. package/dropdown/Dropdown.js +240 -323
  73. package/dropdown/Dropdown.stories.tsx +255 -64
  74. package/dropdown/Dropdown.test.js +479 -0
  75. package/dropdown/DropdownMenu.d.ts +4 -0
  76. package/dropdown/DropdownMenu.js +60 -0
  77. package/dropdown/DropdownMenuItem.d.ts +4 -0
  78. package/dropdown/DropdownMenuItem.js +70 -0
  79. package/dropdown/types.d.ts +30 -19
  80. package/file-input/FileInput.d.ts +2 -2
  81. package/file-input/FileInput.js +224 -351
  82. package/file-input/FileInput.stories.tsx +122 -11
  83. package/file-input/FileInput.test.js +445 -0
  84. package/file-input/FileItem.d.ts +4 -14
  85. package/file-input/FileItem.js +48 -97
  86. package/file-input/types.d.ts +24 -7
  87. package/flex/Flex.d.ts +4 -0
  88. package/flex/Flex.js +57 -0
  89. package/flex/Flex.stories.tsx +103 -0
  90. package/flex/types.d.ts +32 -0
  91. package/flex/types.js +5 -0
  92. package/footer/Footer.js +36 -143
  93. package/footer/Footer.stories.tsx +99 -1
  94. package/footer/Footer.test.js +92 -0
  95. package/footer/Icons.js +1 -5
  96. package/footer/types.d.ts +7 -6
  97. package/header/Header.js +112 -177
  98. package/header/Header.stories.tsx +189 -36
  99. package/header/Header.test.js +66 -0
  100. package/header/Icons.js +2 -6
  101. package/header/types.d.ts +4 -3
  102. package/heading/Heading.js +8 -29
  103. package/heading/Heading.test.js +169 -0
  104. package/heading/types.d.ts +3 -3
  105. package/inset/Inset.js +14 -55
  106. package/inset/Inset.stories.tsx +36 -36
  107. package/inset/types.d.ts +26 -2
  108. package/layout/ApplicationLayout.d.ts +16 -6
  109. package/layout/ApplicationLayout.js +71 -164
  110. package/layout/ApplicationLayout.stories.tsx +84 -93
  111. package/layout/Icons.d.ts +5 -0
  112. package/layout/Icons.js +11 -10
  113. package/layout/SidenavContext.d.ts +5 -0
  114. package/layout/SidenavContext.js +15 -0
  115. package/layout/types.d.ts +18 -33
  116. package/link/Link.d.ts +3 -2
  117. package/link/Link.js +61 -106
  118. package/link/Link.stories.tsx +159 -52
  119. package/link/Link.test.js +65 -0
  120. package/link/types.d.ts +9 -29
  121. package/main.d.ts +11 -15
  122. package/main.js +48 -121
  123. package/nav-tabs/NavTabs.d.ts +8 -0
  124. package/nav-tabs/NavTabs.js +95 -0
  125. package/nav-tabs/NavTabs.stories.tsx +260 -0
  126. package/nav-tabs/NavTabs.test.js +75 -0
  127. package/nav-tabs/Tab.d.ts +4 -0
  128. package/nav-tabs/Tab.js +120 -0
  129. package/nav-tabs/types.d.ts +53 -0
  130. package/nav-tabs/types.js +5 -0
  131. package/number-input/NumberInput.js +21 -38
  132. package/number-input/NumberInput.stories.tsx +5 -5
  133. package/number-input/NumberInput.test.js +406 -0
  134. package/number-input/NumberInputContext.js +0 -5
  135. package/number-input/numberInputContextTypes.d.ts +1 -1
  136. package/number-input/types.d.ts +21 -14
  137. package/package.json +22 -25
  138. package/paginator/Icons.d.ts +5 -0
  139. package/paginator/Icons.js +16 -38
  140. package/paginator/Paginator.js +31 -82
  141. package/paginator/Paginator.stories.tsx +24 -0
  142. package/paginator/Paginator.test.js +266 -0
  143. package/paginator/types.d.ts +1 -1
  144. package/paragraph/Paragraph.d.ts +6 -0
  145. package/paragraph/Paragraph.js +28 -0
  146. package/paragraph/Paragraph.stories.tsx +44 -0
  147. package/password-input/PasswordInput.js +28 -54
  148. package/password-input/PasswordInput.test.js +138 -0
  149. package/password-input/types.d.ts +18 -15
  150. package/progress-bar/ProgressBar.d.ts +2 -2
  151. package/progress-bar/ProgressBar.js +65 -84
  152. package/progress-bar/ProgressBar.stories.jsx +47 -12
  153. package/progress-bar/ProgressBar.test.js +93 -0
  154. package/progress-bar/types.d.ts +3 -4
  155. package/quick-nav/QuickNav.d.ts +4 -0
  156. package/quick-nav/QuickNav.js +95 -0
  157. package/quick-nav/QuickNav.stories.tsx +356 -0
  158. package/quick-nav/types.d.ts +21 -0
  159. package/quick-nav/types.js +5 -0
  160. package/radio-group/Radio.d.ts +1 -1
  161. package/radio-group/Radio.js +61 -66
  162. package/radio-group/RadioGroup.js +99 -129
  163. package/radio-group/RadioGroup.stories.tsx +171 -36
  164. package/radio-group/RadioGroup.test.js +620 -0
  165. package/radio-group/types.d.ts +85 -7
  166. package/resultsetTable/Icons.d.ts +7 -0
  167. package/resultsetTable/Icons.js +48 -0
  168. package/resultsetTable/ResultsetTable.js +66 -157
  169. package/resultsetTable/ResultsetTable.stories.tsx +50 -25
  170. package/resultsetTable/ResultsetTable.test.js +292 -0
  171. package/resultsetTable/types.d.ts +5 -5
  172. package/select/Icons.d.ts +10 -0
  173. package/select/Icons.js +90 -0
  174. package/select/Listbox.d.ts +4 -0
  175. package/select/Listbox.js +144 -0
  176. package/select/Option.d.ts +4 -0
  177. package/select/Option.js +81 -0
  178. package/select/Select.js +201 -485
  179. package/select/Select.stories.tsx +600 -201
  180. package/select/Select.test.js +1845 -0
  181. package/select/types.d.ts +62 -22
  182. package/sidenav/Sidenav.d.ts +6 -5
  183. package/sidenav/Sidenav.js +164 -74
  184. package/sidenav/Sidenav.stories.tsx +249 -149
  185. package/sidenav/Sidenav.test.js +37 -0
  186. package/sidenav/types.d.ts +50 -27
  187. package/slider/Slider.d.ts +2 -2
  188. package/slider/Slider.js +143 -164
  189. package/slider/Slider.stories.tsx +72 -9
  190. package/slider/Slider.test.js +222 -0
  191. package/slider/types.d.ts +11 -3
  192. package/spinner/Spinner.js +12 -41
  193. package/spinner/Spinner.stories.jsx +27 -1
  194. package/spinner/Spinner.test.js +55 -0
  195. package/spinner/types.d.ts +3 -3
  196. package/switch/Switch.d.ts +2 -2
  197. package/switch/Switch.js +148 -107
  198. package/switch/Switch.stories.tsx +53 -42
  199. package/switch/Switch.test.js +180 -0
  200. package/switch/types.d.ts +13 -5
  201. package/table/Table.js +5 -23
  202. package/table/Table.stories.jsx +80 -1
  203. package/table/Table.test.js +21 -0
  204. package/table/types.d.ts +3 -3
  205. package/tabs/Tab.d.ts +4 -0
  206. package/tabs/Tab.js +115 -0
  207. package/tabs/Tabs.d.ts +1 -1
  208. package/tabs/Tabs.js +318 -139
  209. package/tabs/Tabs.stories.tsx +119 -13
  210. package/tabs/Tabs.test.js +295 -0
  211. package/tabs/types.d.ts +21 -7
  212. package/tag/Tag.d.ts +1 -1
  213. package/tag/Tag.js +36 -75
  214. package/tag/Tag.stories.tsx +37 -27
  215. package/tag/Tag.test.js +49 -0
  216. package/tag/types.d.ts +25 -16
  217. package/text-input/Icons.d.ts +8 -0
  218. package/text-input/Icons.js +57 -0
  219. package/text-input/Suggestion.d.ts +4 -0
  220. package/text-input/Suggestion.js +68 -0
  221. package/text-input/Suggestions.d.ts +4 -0
  222. package/text-input/Suggestions.js +109 -0
  223. package/text-input/TextInput.js +232 -438
  224. package/text-input/TextInput.stories.tsx +310 -197
  225. package/text-input/TextInput.test.js +1404 -0
  226. package/text-input/types.d.ts +55 -17
  227. package/textarea/Textarea.js +53 -96
  228. package/textarea/Textarea.stories.jsx +93 -13
  229. package/textarea/Textarea.test.js +360 -0
  230. package/textarea/types.d.ts +22 -15
  231. package/toggle-group/ToggleGroup.d.ts +1 -1
  232. package/toggle-group/ToggleGroup.js +23 -57
  233. package/toggle-group/ToggleGroup.stories.tsx +46 -4
  234. package/toggle-group/ToggleGroup.test.js +124 -0
  235. package/toggle-group/types.d.ts +19 -11
  236. package/translatedLabelsType.d.ts +82 -0
  237. package/translatedLabelsType.js +5 -0
  238. package/typography/Typography.d.ts +4 -0
  239. package/typography/Typography.js +119 -0
  240. package/typography/Typography.stories.tsx +198 -0
  241. package/typography/types.d.ts +18 -0
  242. package/typography/types.js +5 -0
  243. package/useTheme.d.ts +1 -1
  244. package/useTheme.js +3 -9
  245. package/useTranslatedLabels.d.ts +3 -0
  246. package/useTranslatedLabels.js +15 -0
  247. package/wizard/Wizard.d.ts +1 -1
  248. package/wizard/Wizard.js +68 -98
  249. package/wizard/Wizard.stories.tsx +48 -19
  250. package/wizard/Wizard.test.js +114 -0
  251. package/wizard/types.d.ts +12 -7
  252. package/ThemeContext.d.ts +0 -15
  253. package/ThemeContext.js +0 -243
  254. package/V3Select/V3Select.js +0 -455
  255. package/V3Select/index.d.ts +0 -27
  256. package/V3Textarea/V3Textarea.js +0 -260
  257. package/V3Textarea/index.d.ts +0 -27
  258. package/common/RequiredComponent.js +0 -32
  259. package/date/Date.js +0 -373
  260. package/date/index.d.ts +0 -27
  261. package/input-text/Icons.js +0 -22
  262. package/input-text/InputText.js +0 -611
  263. package/input-text/index.d.ts +0 -36
  264. package/list/List.d.ts +0 -8
  265. package/list/List.js +0 -47
  266. package/list/List.stories.tsx +0 -95
  267. package/radio/Radio.d.ts +0 -4
  268. package/radio/Radio.js +0 -174
  269. package/radio/Radio.stories.tsx +0 -192
  270. package/radio/types.d.ts +0 -54
  271. package/row/Row.d.ts +0 -11
  272. package/row/Row.js +0 -127
  273. package/row/Row.stories.tsx +0 -239
  274. package/stack/Stack.d.ts +0 -10
  275. package/stack/Stack.js +0 -97
  276. package/stack/Stack.stories.tsx +0 -166
  277. package/text/Text.d.ts +0 -7
  278. package/text/Text.js +0 -30
  279. package/text/Text.stories.tsx +0 -19
  280. package/toggle/Toggle.js +0 -186
  281. package/toggle/index.d.ts +0 -21
  282. package/upload/Upload.js +0 -201
  283. package/upload/buttons-upload/ButtonsUpload.js +0 -111
  284. package/upload/buttons-upload/Icons.js +0 -40
  285. package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
  286. package/upload/dragAndDropArea/Icons.js +0 -39
  287. package/upload/file-upload/FileToUpload.js +0 -115
  288. package/upload/file-upload/Icons.js +0 -66
  289. package/upload/files-upload/FilesToUpload.js +0 -109
  290. package/upload/index.d.ts +0 -15
  291. package/upload/transaction/Icons.js +0 -160
  292. package/upload/transaction/Transaction.js +0 -104
  293. package/upload/transactions/Transactions.js +0 -94
  294. /package/{radio → badge}/types.js +0 -0
package/tabs/Tabs.js CHANGED
@@ -1,106 +1,312 @@
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 _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
-
18
- var _react = _interopRequireDefault(require("react"));
19
-
20
- var _Tabs = _interopRequireDefault(require("@material-ui/core/Tabs"));
21
-
22
- var _Tab = _interopRequireDefault(require("@material-ui/core/Tab"));
23
-
12
+ var _react = _interopRequireWildcard(require("react"));
24
13
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
25
-
26
- var _variables = require("../common/variables.js");
27
-
28
- var _Badge = _interopRequireDefault(require("../badge/Badge"));
29
-
14
+ var _variables = require("../common/variables");
30
15
  var _useTheme = _interopRequireDefault(require("../useTheme"));
31
-
32
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
33
-
16
+ var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
17
+ var _Tab = _interopRequireDefault(require("./Tab"));
18
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
34
19
  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); }
35
-
36
20
  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; }
37
-
21
+ var arrowIcons = {
22
+ left: /*#__PURE__*/_react["default"].createElement("svg", {
23
+ focusable: "false",
24
+ viewBox: "0 0 24 24",
25
+ "aria-hidden": "true"
26
+ }, /*#__PURE__*/_react["default"].createElement("path", {
27
+ d: "M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"
28
+ })),
29
+ right: /*#__PURE__*/_react["default"].createElement("svg", {
30
+ focusable: "false",
31
+ viewBox: "0 0 24 24",
32
+ "aria-hidden": "true"
33
+ }, /*#__PURE__*/_react["default"].createElement("path", {
34
+ d: "M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"
35
+ }))
36
+ };
37
+ var useResize = function useResize(refTabList) {
38
+ var _useState = (0, _react.useState)(0),
39
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
40
+ viewWidth = _useState2[0],
41
+ setViewWidth = _useState2[1];
42
+ var handleWindowSizeChange = (0, _react.useCallback)(function () {
43
+ var _refTabList$current;
44
+ setViewWidth(refTabList === null || refTabList === void 0 ? void 0 : (_refTabList$current = refTabList.current) === null || _refTabList$current === void 0 ? void 0 : _refTabList$current.offsetWidth);
45
+ }, [refTabList]);
46
+ (0, _react.useEffect)(function () {
47
+ window.addEventListener("load", handleWindowSizeChange);
48
+ window.addEventListener("resize", handleWindowSizeChange);
49
+ return function () {
50
+ window.removeEventListener("load", handleWindowSizeChange);
51
+ window.removeEventListener("resize", handleWindowSizeChange);
52
+ };
53
+ }, [handleWindowSizeChange]);
54
+ return viewWidth;
55
+ };
38
56
  var DxcTabs = function DxcTabs(_ref) {
39
- var activeTabIndex = _ref.activeTabIndex,
40
- tabs = _ref.tabs,
41
- onTabClick = _ref.onTabClick,
42
- onTabHover = _ref.onTabHover,
43
- margin = _ref.margin,
44
- _ref$iconPosition = _ref.iconPosition,
45
- iconPosition = _ref$iconPosition === void 0 ? "top" : _ref$iconPosition,
46
- _ref$tabIndex = _ref.tabIndex,
47
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
48
-
49
- var _React$useState = _react["default"].useState(0),
50
- _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
51
- innerActiveTabIndex = _React$useState2[0],
52
- setInnerActiveTabIndex = _React$useState2[1];
53
-
57
+ var defaultActiveTabIndex = _ref.defaultActiveTabIndex,
58
+ activeTabIndex = _ref.activeTabIndex,
59
+ tabs = _ref.tabs,
60
+ onTabClick = _ref.onTabClick,
61
+ onTabHover = _ref.onTabHover,
62
+ margin = _ref.margin,
63
+ _ref$iconPosition = _ref.iconPosition,
64
+ iconPosition = _ref$iconPosition === void 0 ? "top" : _ref$iconPosition,
65
+ _ref$tabIndex = _ref.tabIndex,
66
+ tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
54
67
  var colorsTheme = (0, _useTheme["default"])();
55
68
  var hasLabelAndIcon = tabs && tabs.filter(function (tab) {
56
69
  return tab.label && tab.icon;
57
70
  }).length > 0;
58
-
59
- var handleChange = function handleChange(event, newValue) {
60
- if (activeTabIndex == null) {
61
- setInnerActiveTabIndex(newValue);
71
+ var firstFocus = tabs && tabs.findIndex(function (tab) {
72
+ return !tab.isDisabled;
73
+ });
74
+ var _useState3 = (0, _react.useState)(tabs && defaultActiveTabIndex && !tabs[defaultActiveTabIndex].isDisabled ? defaultActiveTabIndex : firstFocus),
75
+ _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
76
+ innerActiveTabIndex = _useState4[0],
77
+ setInnerActiveTabIndex = _useState4[1];
78
+ var _useState5 = (0, _react.useState)(0),
79
+ _useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
80
+ activeIndicatorWidth = _useState6[0],
81
+ setActiveIndicatorWidth = _useState6[1];
82
+ var _useState7 = (0, _react.useState)(0),
83
+ _useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
84
+ activeIndicatorLeft = _useState8[0],
85
+ setActiveIndicatorLeft = _useState8[1];
86
+ var _useState9 = (0, _react.useState)(0),
87
+ _useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
88
+ translateScroll = _useState10[0],
89
+ setTranslateScroll = _useState10[1];
90
+ var _useState11 = (0, _react.useState)(true),
91
+ _useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
92
+ scrollRightEnabled = _useState12[0],
93
+ setScrollRightEnabled = _useState12[1];
94
+ var _useState13 = (0, _react.useState)(false),
95
+ _useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
96
+ scrollLeftEnabled = _useState14[0],
97
+ setScrollLeftEnabled = _useState14[1];
98
+ var _useState15 = (0, _react.useState)(0),
99
+ _useState16 = (0, _slicedToArray2["default"])(_useState15, 2),
100
+ countClick = _useState16[0],
101
+ setCountClick = _useState16[1];
102
+ var _useState17 = (0, _react.useState)(0),
103
+ _useState18 = (0, _slicedToArray2["default"])(_useState17, 2),
104
+ totalTabsWidth = _useState18[0],
105
+ setTotalTabsWidth = _useState18[1];
106
+ var _useState19 = (0, _react.useState)(activeTabIndex !== null && activeTabIndex !== void 0 ? activeTabIndex : innerActiveTabIndex),
107
+ _useState20 = (0, _slicedToArray2["default"])(_useState19, 2),
108
+ currentFocusIndex = _useState20[0],
109
+ setCurrentFocusIndex = _useState20[1];
110
+ var _useState21 = (0, _react.useState)(activeTabIndex !== null && activeTabIndex !== void 0 ? activeTabIndex : innerActiveTabIndex),
111
+ _useState22 = (0, _slicedToArray2["default"])(_useState21, 2),
112
+ temporalFocusIndex = _useState22[0],
113
+ setTemporalFocusIndex = _useState22[1];
114
+ var _useState23 = (0, _react.useState)(0),
115
+ _useState24 = (0, _slicedToArray2["default"])(_useState23, 2),
116
+ minHeightTabs = _useState24[0],
117
+ setMinHeightTabs = _useState24[1];
118
+ var refTabs = (0, _react.useRef)([]);
119
+ var refTabList = (0, _react.useRef)(null);
120
+ var viewWidth = useResize(refTabList);
121
+ var translatedLabels = (0, _useTranslatedLabels["default"])();
122
+ var enabledIndicator = (0, _react.useMemo)(function () {
123
+ return viewWidth < totalTabsWidth;
124
+ }, [viewWidth]);
125
+ (0, _react.useEffect)(function () {
126
+ var _refTabs$current, _refTabs$current2, _refTabs$current3;
127
+ var sumWidth = refTabs === null || refTabs === void 0 ? void 0 : (_refTabs$current = refTabs.current) === null || _refTabs$current === void 0 ? void 0 : _refTabs$current.reduce(function (count, obj) {
128
+ return count + obj.offsetWidth;
129
+ }, 0);
130
+ setTotalTabsWidth(sumWidth);
131
+ setActiveIndicatorWidth(refTabs === null || refTabs === void 0 ? void 0 : (_refTabs$current2 = refTabs.current[activeTabIndex !== null && activeTabIndex !== void 0 ? activeTabIndex : innerActiveTabIndex]) === null || _refTabs$current2 === void 0 ? void 0 : _refTabs$current2.offsetWidth);
132
+ setActiveIndicatorLeft(refTabs === null || refTabs === void 0 ? void 0 : (_refTabs$current3 = refTabs.current[activeTabIndex !== null && activeTabIndex !== void 0 ? activeTabIndex : innerActiveTabIndex]) === null || _refTabs$current3 === void 0 ? void 0 : _refTabs$current3.offsetLeft);
133
+ }, [refTabs]);
134
+ (0, _react.useEffect)(function () {
135
+ var _refTabList$current2;
136
+ setMinHeightTabs((refTabList === null || refTabList === void 0 ? void 0 : (_refTabList$current2 = refTabList.current) === null || _refTabList$current2 === void 0 ? void 0 : _refTabList$current2.offsetHeight) + 1);
137
+ }, [refTabList]);
138
+ (0, _react.useEffect)(function () {
139
+ if (activeTabIndex >= 0) {
140
+ var _refTabs$current$acti, _refTabs$current$acti2;
141
+ setActiveIndicatorWidth(refTabs === null || refTabs === void 0 ? void 0 : (_refTabs$current$acti = refTabs.current[activeTabIndex]) === null || _refTabs$current$acti === void 0 ? void 0 : _refTabs$current$acti.offsetWidth);
142
+ setActiveIndicatorLeft(refTabs === null || refTabs === void 0 ? void 0 : (_refTabs$current$acti2 = refTabs.current[activeTabIndex]) === null || _refTabs$current$acti2 === void 0 ? void 0 : _refTabs$current$acti2.offsetLeft);
62
143
  }
63
-
144
+ }, [activeTabIndex]);
145
+ var handleSelected = function handleSelected(newValue) {
146
+ activeTabIndex !== null && activeTabIndex !== void 0 ? activeTabIndex : setInnerActiveTabIndex(newValue);
64
147
  onTabClick === null || onTabClick === void 0 ? void 0 : onTabClick(newValue);
148
+ if (activeTabIndex === undefined) {
149
+ var _refTabs$current$newV, _refTabs$current$newV2;
150
+ setActiveIndicatorWidth(refTabs === null || refTabs === void 0 ? void 0 : (_refTabs$current$newV = refTabs.current[newValue]) === null || _refTabs$current$newV === void 0 ? void 0 : _refTabs$current$newV.offsetWidth);
151
+ setActiveIndicatorLeft(refTabs === null || refTabs === void 0 ? void 0 : (_refTabs$current$newV2 = refTabs.current[newValue]) === null || _refTabs$current$newV2 === void 0 ? void 0 : _refTabs$current$newV2.offsetLeft);
152
+ }
65
153
  };
66
-
67
- var getLabelForTab = function getLabelForTab(tab) {
68
- return /*#__PURE__*/_react["default"].createElement(ParentLabelSpan, null, /*#__PURE__*/_react["default"].createElement(MainLabelContainer, {
69
- hasBadge: tab.notificationNumber
70
- }, /*#__PURE__*/_react["default"].createElement(TabLabelContainer, {
71
- hasLabelAndIcon: hasLabelAndIcon,
72
- iconPosition: iconPosition
73
- }, tab.icon && /*#__PURE__*/_react["default"].createElement(TabIconContainer, {
74
- hasLabelAndIcon: hasLabelAndIcon,
75
- iconPosition: iconPosition
76
- }, typeof tab.icon === "string" ? /*#__PURE__*/_react["default"].createElement(TabIcon, {
77
- src: tab.icon
78
- }) : tab.icon), /*#__PURE__*/_react["default"].createElement(LabelTextContainer, null, tab.label))), tab.notificationNumber && tab.notificationNumber !== false && /*#__PURE__*/_react["default"].createElement(BadgeContainer, {
79
- hasLabelAndIcon: hasLabelAndIcon,
80
- iconPosition: iconPosition
81
- }, /*#__PURE__*/_react["default"].createElement(_Badge["default"], {
82
- notificationText: tab.notificationNumber > 99 ? "+99" : tab.notificationNumber
83
- })));
154
+ var scrollLeft = function scrollLeft() {
155
+ var _refTabList$current3;
156
+ var scrollWidth = (refTabList === null || refTabList === void 0 ? void 0 : (_refTabList$current3 = refTabList.current) === null || _refTabList$current3 === void 0 ? void 0 : _refTabList$current3.offsetWidth) * 0.75;
157
+ var moveX;
158
+ if (countClick <= scrollWidth) {
159
+ moveX = 0;
160
+ setScrollLeftEnabled(false);
161
+ setScrollRightEnabled(true);
162
+ } else {
163
+ moveX = countClick - scrollWidth;
164
+ setScrollRightEnabled(true);
165
+ setScrollLeftEnabled(true);
166
+ }
167
+ setTranslateScroll(-moveX);
168
+ setCountClick(moveX);
84
169
  };
85
-
170
+ var scrollRight = function scrollRight() {
171
+ var _refTabList$current4, _refTabList$current5;
172
+ var scrollWidth = (refTabList === null || refTabList === void 0 ? void 0 : (_refTabList$current4 = refTabList.current) === null || _refTabList$current4 === void 0 ? void 0 : _refTabList$current4.offsetWidth) * 0.75;
173
+ var moveX;
174
+ if (countClick + scrollWidth + (refTabList === null || refTabList === void 0 ? void 0 : (_refTabList$current5 = refTabList.current) === null || _refTabList$current5 === void 0 ? void 0 : _refTabList$current5.offsetWidth) >= totalTabsWidth) {
175
+ var _refTabList$current6;
176
+ moveX = totalTabsWidth - (refTabList === null || refTabList === void 0 ? void 0 : (_refTabList$current6 = refTabList.current) === null || _refTabList$current6 === void 0 ? void 0 : _refTabList$current6.offsetWidth);
177
+ setScrollRightEnabled(false);
178
+ setScrollLeftEnabled(true);
179
+ } else {
180
+ moveX = countClick + scrollWidth;
181
+ setScrollLeftEnabled(true);
182
+ setScrollRightEnabled(true);
183
+ }
184
+ setTranslateScroll(-moveX);
185
+ setCountClick(moveX);
186
+ };
187
+ var setPreviousTabFocus = function setPreviousTabFocus() {
188
+ setTemporalFocusIndex(function (temporalFocusIndex) {
189
+ var index = temporalFocusIndex === 0 ? tabs.length - 1 : temporalFocusIndex - 1;
190
+ while (tabs[index].isDisabled) {
191
+ index = index === 0 ? tabs.length - 1 : index - 1;
192
+ }
193
+ refTabs === null || refTabs === void 0 ? void 0 : refTabs.current[index].focus({
194
+ preventScroll: true
195
+ });
196
+ setScrollFocus(index);
197
+ return index;
198
+ });
199
+ };
200
+ var setNextTabFocus = function setNextTabFocus() {
201
+ setTemporalFocusIndex(function (temporalFocusIndex) {
202
+ var index = temporalFocusIndex === tabs.length - 1 ? 0 : temporalFocusIndex + 1;
203
+ while (tabs[index].isDisabled) {
204
+ index = index === tabs.length - 1 ? 0 : index + 1;
205
+ }
206
+ refTabs === null || refTabs === void 0 ? void 0 : refTabs.current[index].focus({
207
+ preventScroll: true
208
+ });
209
+ setScrollFocus(index);
210
+ return index;
211
+ });
212
+ };
213
+ var setScrollFocus = function setScrollFocus(actualIndex) {
214
+ var _refTabs$current4, _refTabList$current8;
215
+ var sumPrev = 0;
216
+ refTabs === null || refTabs === void 0 ? void 0 : (_refTabs$current4 = refTabs.current) === null || _refTabs$current4 === void 0 ? void 0 : _refTabs$current4.map(function (item, index) {
217
+ if (index <= actualIndex) {
218
+ sumPrev += item.offsetWidth;
219
+ }
220
+ });
221
+ var moveX = 0;
222
+ if (actualIndex === tabs.length - 1) {
223
+ var _refTabList$current7;
224
+ moveX = totalTabsWidth - (refTabList === null || refTabList === void 0 ? void 0 : (_refTabList$current7 = refTabList.current) === null || _refTabList$current7 === void 0 ? void 0 : _refTabList$current7.offsetWidth);
225
+ setScrollLeftEnabled(true);
226
+ setScrollRightEnabled(false);
227
+ } else if (sumPrev > (refTabList === null || refTabList === void 0 ? void 0 : (_refTabList$current8 = refTabList.current) === null || _refTabList$current8 === void 0 ? void 0 : _refTabList$current8.offsetWidth)) {
228
+ var _refTabList$current9;
229
+ moveX = sumPrev - (refTabList === null || refTabList === void 0 ? void 0 : (_refTabList$current9 = refTabList.current) === null || _refTabList$current9 === void 0 ? void 0 : _refTabList$current9.offsetWidth) + 1; //plus 1px for the outline
230
+ setScrollLeftEnabled(true);
231
+ setScrollRightEnabled(true);
232
+ } else {
233
+ setScrollLeftEnabled(false);
234
+ setScrollRightEnabled(true);
235
+ }
236
+ setTranslateScroll(-moveX);
237
+ setCountClick(moveX);
238
+ };
239
+ var handleOnKeyDown = function handleOnKeyDown(event) {
240
+ switch (event.key) {
241
+ case "Left":
242
+ case "ArrowLeft":
243
+ event.preventDefault();
244
+ setPreviousTabFocus();
245
+ break;
246
+ case "Right":
247
+ case "ArrowRight":
248
+ event.preventDefault();
249
+ setNextTabFocus();
250
+ break;
251
+ case "Enter":
252
+ case " ":
253
+ event.preventDefault();
254
+ setCurrentFocusIndex(temporalFocusIndex);
255
+ handleSelected(temporalFocusIndex);
256
+ break;
257
+ case "Tab":
258
+ if (temporalFocusIndex !== currentFocusIndex) {
259
+ event.preventDefault();
260
+ setTemporalFocusIndex(currentFocusIndex);
261
+ refTabs === null || refTabs === void 0 ? void 0 : refTabs.current[currentFocusIndex].focus();
262
+ }
263
+ handleSelected(currentFocusIndex);
264
+ break;
265
+ }
266
+ };
267
+ var isTabActive = function isTabActive(index) {
268
+ return activeTabIndex >= 0 ? activeTabIndex === index : innerActiveTabIndex === index;
269
+ };
270
+ var isActiveIndicatorDisabled = firstFocus === -1 || tabs && activeTabIndex >= 0 && tabs[activeTabIndex].isDisabled;
86
271
  return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
87
- theme: colorsTheme.tabs
88
- }, /*#__PURE__*/_react["default"].createElement(DxCTabs, {
89
- margin: margin,
272
+ theme: colorsTheme["tabs"]
273
+ }, /*#__PURE__*/_react["default"].createElement(TabsContainer, {
274
+ margin: margin
275
+ }, /*#__PURE__*/_react["default"].createElement(Underline, null), /*#__PURE__*/_react["default"].createElement(Tabs, {
90
276
  hasLabelAndIcon: hasLabelAndIcon,
91
277
  iconPosition: iconPosition
92
- }, /*#__PURE__*/_react["default"].createElement(Underline, null), /*#__PURE__*/_react["default"].createElement(_Tabs["default"], {
93
- value: activeTabIndex != null ? activeTabIndex : innerActiveTabIndex,
94
- onChange: handleChange,
95
- variant: "scrollable",
96
- scrollButtons: "auto"
278
+ }, /*#__PURE__*/_react["default"].createElement(ScrollIndicator, {
279
+ onClick: scrollLeft,
280
+ scrollLeftEnabled: scrollLeftEnabled,
281
+ enabled: enabledIndicator,
282
+ "aria-disabled": !scrollLeftEnabled,
283
+ "aria-label": translatedLabels.tabs.scrollLeft,
284
+ tabIndex: scrollLeftEnabled ? tabIndex : -1,
285
+ minHeightTabs: minHeightTabs
286
+ }, arrowIcons.left), /*#__PURE__*/_react["default"].createElement(TabsContent, null, /*#__PURE__*/_react["default"].createElement(TabsContentScroll, {
287
+ translateScroll: translateScroll,
288
+ ref: refTabList,
289
+ enabled: enabledIndicator
290
+ }, /*#__PURE__*/_react["default"].createElement(TabList, {
291
+ role: "tablist",
292
+ onKeyDown: handleOnKeyDown,
293
+ minHeightTabs: minHeightTabs
97
294
  }, tabs.map(function (tab, i) {
98
295
  return /*#__PURE__*/_react["default"].createElement(_Tab["default"], {
99
- tabIndex: (activeTabIndex === i || innerActiveTabIndex === i) && !tab.isDisabled ? tabIndex : -1,
296
+ tab: tab,
100
297
  key: "tab".concat(i).concat(tab.label),
101
- label: getLabelForTab(tab),
102
- disabled: tab.isDisabled,
103
- disableRipple: true,
298
+ active: isTabActive(i),
299
+ tabIndex: isTabActive(i) && !tab.isDisabled ? tabIndex : -1,
300
+ hasLabelAndIcon: hasLabelAndIcon,
301
+ iconPosition: iconPosition,
302
+ ref: function ref(el) {
303
+ return refTabs.current[i] = el;
304
+ },
305
+ onClick: function onClick() {
306
+ setCurrentFocusIndex(i);
307
+ setTemporalFocusIndex(i);
308
+ handleSelected(i);
309
+ },
104
310
  onMouseEnter: function onMouseEnter() {
105
311
  onTabHover === null || onTabHover === void 0 ? void 0 : onTabHover(i);
106
312
  },
@@ -108,34 +314,26 @@ var DxcTabs = function DxcTabs(_ref) {
108
314
  onTabHover === null || onTabHover === void 0 ? void 0 : onTabHover(null);
109
315
  }
110
316
  });
111
- }))));
317
+ })), /*#__PURE__*/_react["default"].createElement(ActiveIndicator, {
318
+ tabWidth: activeIndicatorWidth,
319
+ tabLeft: activeIndicatorLeft,
320
+ "aria-disabled": isActiveIndicatorDisabled
321
+ }))), /*#__PURE__*/_react["default"].createElement(ScrollIndicator, {
322
+ onClick: scrollRight,
323
+ scrollRightEnabled: scrollRightEnabled,
324
+ enabled: enabledIndicator,
325
+ "aria-disabled": !scrollRightEnabled,
326
+ "aria-label": translatedLabels.tabs.scrollRight,
327
+ tabIndex: scrollRightEnabled ? tabIndex : -1,
328
+ minHeightTabs: minHeightTabs
329
+ }, arrowIcons.right))));
112
330
  };
113
-
114
- var ParentLabelSpan = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n"])));
115
-
116
- var TabLabelContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n"])), function (props) {
117
- return props.hasLabelAndIcon && props.iconPosition === "top" && "column" || "row";
118
- });
119
-
120
- var LabelTextContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])([""])));
121
-
122
- var BadgeContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n right: 0;\n top: ", ";\n width: 23px;\n height: 17px;\n"])), function (props) {
123
- return props.hasLabelAndIcon && props.iconPosition === "top" && "0" || "5px";
124
- });
125
-
126
- var MainLabelContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n margin-left: ", ";\n margin-right: ", ";\n"])), function (props) {
127
- return props.hasBadge && "35px" || "unset";
128
- }, function (props) {
129
- return props.hasBadge && "35px" || "unset";
130
- });
131
-
132
- var Underline = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n left: 0px;\n bottom: 0;\n width: 100%;\n height: ", ";\n position: absolute;\n background-color: ", ";\n"])), function (props) {
331
+ var Underline = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n left: 0;\n bottom: 0;\n width: 100%;\n position: absolute;\n height: ", ";\n background-color: ", ";\n"])), function (props) {
133
332
  return props.theme.dividerThickness;
134
333
  }, function (props) {
135
334
  return props.theme.dividerColor;
136
335
  });
137
-
138
- var DxCTabs = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n .MuiTabs-root {\n background: white;\n min-height: ", ";\n\n .MuiTabs-scroller {\n .MuiTabs-flexContainer + span {\n z-index: 4;\n }\n }\n .MuiTab-root {\n text-transform: ", " !important;\n }\n .MuiButtonBase-root {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n\n padding: ", ";\n height: ", ";\n min-width: 90px;\n max-width: 360px;\n min-height: ", ";\n\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n font-weight: ", ";\n }\n &:not(.Mui-selected) {\n background-color: ", ";\n color: ", ";\n svg {\n color: ", ";\n }\n }\n &.Mui-selected {\n background-color: ", ";\n color: ", ";\n svg {\n color: ", ";\n }\n }\n &.Mui-disabled {\n background-color: ", " !important;\n cursor: not-allowed !important;\n pointer-events: all;\n color: ", ";\n font-style: ", ";\n svg {\n color: ", ";\n }\n outline: none !important;\n }\n &:focus {\n outline: ", " auto 1px;\n }\n }\n .MuiTabs-indicator {\n background-color: ", ";\n height: ", ";\n }\n .MuiTabs-scrollButtons {\n min-width: ", ";\n width: ", ";\n padding: 0;\n }\n @media (max-width: 599.95px) {\n .MuiTabs-scrollButtonsDesktop {\n display: flex;\n }\n }\n }\n"])), function (props) {
336
+ var TabsContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
139
337
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
140
338
  }, function (props) {
141
339
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
@@ -145,69 +343,50 @@ var DxCTabs = _styledComponents["default"].div(_templateObject7 || (_templateObj
145
343
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
146
344
  }, function (props) {
147
345
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
148
- }, function (props) {
149
- return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
150
- }, function (props) {
151
- return props.theme.fontTextTransform;
152
- }, function (props) {
153
- return props.theme.fontFamily;
154
- }, function (props) {
155
- return props.theme.fontSize;
156
- }, function (props) {
157
- return props.theme.fontStyle;
158
- }, function (props) {
159
- return props.theme.fontWeight;
160
- }, function (props) {
161
- return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "12px 16px" || "8px 16px";
162
- }, function (props) {
346
+ });
347
+ var Tabs = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n min-height: ", ";\n height: ", ";\n display: flex;\n overflow: hidden;\n background-color: ", ";\n"])), function (props) {
163
348
  return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
164
349
  }, function (props) {
165
350
  return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
166
- }, function (props) {
167
- return "".concat(props.theme.hoverBackgroundColor, " !important");
168
- }, function (props) {
169
- return "".concat(props.theme.pressedBackgroundColor, " !important");
170
- }, function (props) {
171
- return "".concat(props.theme.pressedFontWeight, " !important");
172
351
  }, function (props) {
173
352
  return props.theme.unselectedBackgroundColor;
353
+ });
354
+ var ScrollIndicator = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n background-color: #ffffff;\n font-size: 1.25rem;\n min-width: ", ";\n height: ", "px;\n padding: 0;\n justify-content: center;\n cursor: pointer;\n border-bottom: solid ", " ", ";\n box-sizing: border-box;\n border: none;\n &:hover {\n background-color: ", ";\n }\n &:focus {\n outline: ", " solid 1px;\n outline-offset: -1px;\n }\n &:active {\n background-color: ", ";\n }\n svg {\n height: 20px;\n width: 20px;\n align-self: center;\n fill: ", ";\n visibility: visible;\n }\n &[aria-disabled=\"true\"] {\n pointer-events: none;\n cursor: default;\n svg {\n visibility: hidden;\n }\n &:focus {\n outline: none;\n }\n &:hover,\n &:active {\n background-color: transparent !important;\n }\n }\n"])), function (props) {
355
+ return props.enabled ? "flex" : "none";
174
356
  }, function (props) {
175
- return props.theme.unselectedFontColor;
176
- }, function (props) {
177
- return props.theme.unselectedIconColor;
357
+ return props.theme.scrollButtonsWidth;
178
358
  }, function (props) {
179
- return props.theme.selectedBackgroundColor;
359
+ return props.minHeightTabs - 1;
180
360
  }, function (props) {
181
- return props.theme.selectedFontColor;
361
+ return props.theme.dividerThickness;
182
362
  }, function (props) {
183
- return props.theme.selectedIconColor;
363
+ return props.theme.dividerColor;
184
364
  }, function (props) {
185
- return props.theme.unselectedBackgroundColor;
365
+ return "".concat(props.theme.hoverBackgroundColor, " !important");
186
366
  }, function (props) {
187
- return props.theme.disabledFontColor;
367
+ return props.theme.focusOutline;
188
368
  }, function (props) {
189
- return props.theme.disabledFontStyle;
369
+ return "".concat(props.theme.pressedBackgroundColor, " !important");
190
370
  }, function (props) {
191
- return props.theme.disabledIconColor;
371
+ return props.theme.unselectedFontColor;
372
+ });
373
+ var ActiveIndicator = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n left: ", ";\n width: ", ";\n background-color: ", ";\n bottom: 0;\n height: ", ";\n position: absolute;\n &[aria-disabled=\"true\"] {\n background-color: ", ";\n display: none;\n }\n"])), function (props) {
374
+ return "".concat(props.tabLeft, "px");
192
375
  }, function (props) {
193
- return props.theme.focusOutline;
376
+ return "".concat(props.tabWidth, "px");
194
377
  }, function (props) {
195
378
  return props.theme.selectedUnderlineColor;
196
379
  }, function (props) {
197
380
  return props.theme.selectedUnderlineThickness;
198
381
  }, function (props) {
199
- return props.theme.scrollButtonsWidth;
200
- }, function (props) {
201
- return props.theme.scrollButtonsWidth;
382
+ return props.theme.disabledFontColor;
202
383
  });
203
-
204
- var TabIcon = _styledComponents["default"].img(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])([""])));
205
-
206
- var TabIconContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 22px;\n max-width: 22px;\n margin-bottom: ", ";\n margin-right: ", ";\n overflow: hidden;\n display: flex;\n align-items: center;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
207
- return props.hasLabelAndIcon && props.iconPosition === "top" && "8px" || "";
208
- }, function (props) {
209
- return props.hasLabelAndIcon && props.iconPosition === "left" && "12px" || "";
384
+ var TabsContent = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex: 1 1 auto;\n display: inline-block;\n position: relative;\n white-space: nowrap;\n overflow-x: scroll;\n ::-webkit-scrollbar {\n display: none;\n }\n"])));
385
+ var TabList = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n min-height: ", "px;\n"])), function (props) {
386
+ return props.minHeightTabs;
387
+ });
388
+ var TabsContentScroll = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n ", ";\n transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n"])), function (props) {
389
+ return props.enabled ? "transform: translateX(".concat(props.translateScroll, "px)") : "transform: translateX(0px)";
210
390
  });
211
-
212
391
  var _default = DxcTabs;
213
392
  exports["default"] = _default;