@dxc-technology/halstack-react 0.0.0-d3554d7 → 0.0.0-d3df47e

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