@elliemae/ds-tabs 2.3.0-next.0 → 3.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/cjs/DSTabs.js +63 -0
  2. package/dist/cjs/DSTabs.js.map +7 -0
  3. package/dist/cjs/DSTabsCTX.js +56 -0
  4. package/dist/cjs/DSTabsCTX.js.map +7 -0
  5. package/dist/cjs/DSTabsDatatestid.js +46 -0
  6. package/dist/cjs/DSTabsDatatestid.js.map +7 -0
  7. package/dist/cjs/DSTabsTypes.js +27 -0
  8. package/dist/cjs/DSTabsTypes.js.map +7 -0
  9. package/dist/cjs/config/useCrossRef.js +44 -0
  10. package/dist/cjs/config/useCrossRef.js.map +7 -0
  11. package/dist/cjs/config/useTabs.js +68 -0
  12. package/dist/cjs/config/useTabs.js.map +7 -0
  13. package/dist/cjs/defaultProps.js +53 -0
  14. package/dist/cjs/defaultProps.js.map +7 -0
  15. package/dist/cjs/exportsRelated/DSTab.js +46 -0
  16. package/dist/cjs/exportsRelated/DSTab.js.map +7 -0
  17. package/dist/cjs/index.js +38 -0
  18. package/dist/cjs/index.js.map +7 -0
  19. package/dist/cjs/parts/carousel/Carousel.js +77 -0
  20. package/dist/cjs/parts/carousel/Carousel.js.map +7 -0
  21. package/dist/cjs/parts/carousel/styles.js +79 -0
  22. package/dist/cjs/parts/carousel/styles.js.map +7 -0
  23. package/dist/cjs/parts/carousel/useCarousel.js +80 -0
  24. package/dist/cjs/parts/carousel/useCarousel.js.map +7 -0
  25. package/dist/cjs/parts/carousel/useCarouselCallbacks.js +89 -0
  26. package/dist/cjs/parts/carousel/useCarouselCallbacks.js.map +7 -0
  27. package/dist/cjs/parts/tabBar/TabBar.js +171 -0
  28. package/dist/cjs/parts/tabBar/TabBar.js.map +7 -0
  29. package/dist/cjs/parts/tabBar/styles.js +294 -0
  30. package/dist/cjs/parts/tabBar/styles.js.map +7 -0
  31. package/dist/cjs/parts/tabBar/useTabBar.js +100 -0
  32. package/dist/cjs/parts/tabBar/useTabBar.js.map +7 -0
  33. package/dist/cjs/parts/tabsContent/TabsContent.js +53 -0
  34. package/dist/cjs/parts/tabsContent/TabsContent.js.map +7 -0
  35. package/dist/cjs/parts/tabsContent/styles.js +39 -0
  36. package/dist/cjs/parts/tabsContent/styles.js.map +7 -0
  37. package/dist/cjs/parts/tabsPanel/TabsPanels.js +79 -0
  38. package/dist/cjs/parts/tabsPanel/TabsPanels.js.map +7 -0
  39. package/dist/cjs/parts/tabsPanel/styles.js +45 -0
  40. package/dist/cjs/parts/tabsPanel/styles.js.map +7 -0
  41. package/dist/cjs/propTypes.js +58 -0
  42. package/dist/cjs/propTypes.js.map +7 -0
  43. package/dist/cjs/utils/constants.js +56 -0
  44. package/dist/cjs/utils/constants.js.map +7 -0
  45. package/dist/cjs/utils/helpers.js +88 -0
  46. package/dist/cjs/utils/helpers.js.map +7 -0
  47. package/dist/cjs/utils/hooks/useKeyboardNavigation.js +77 -0
  48. package/dist/cjs/utils/hooks/useKeyboardNavigation.js.map +7 -0
  49. package/dist/cjs/utils/hooks/useTabsCallbacks.js +60 -0
  50. package/dist/cjs/utils/hooks/useTabsCallbacks.js.map +7 -0
  51. package/dist/esm/DSTabs.js +34 -0
  52. package/dist/esm/DSTabs.js.map +7 -0
  53. package/dist/esm/DSTabsCTX.js +27 -0
  54. package/dist/esm/DSTabsCTX.js.map +7 -0
  55. package/dist/esm/DSTabsDatatestid.js +17 -0
  56. package/dist/esm/DSTabsDatatestid.js.map +7 -0
  57. package/dist/esm/DSTabsTypes.js +2 -0
  58. package/dist/esm/DSTabsTypes.js.map +7 -0
  59. package/{esm → dist/esm}/config/useCrossRef.js +6 -4
  60. package/dist/esm/config/useCrossRef.js.map +7 -0
  61. package/dist/esm/config/useTabs.js +39 -0
  62. package/dist/esm/config/useTabs.js.map +7 -0
  63. package/{esm → dist/esm}/defaultProps.js +9 -8
  64. package/dist/esm/defaultProps.js.map +7 -0
  65. package/dist/esm/exportsRelated/DSTab.js +17 -0
  66. package/dist/esm/exportsRelated/DSTab.js.map +7 -0
  67. package/dist/esm/index.js +9 -0
  68. package/dist/esm/index.js.map +7 -0
  69. package/dist/esm/parts/carousel/Carousel.js +48 -0
  70. package/dist/esm/parts/carousel/Carousel.js.map +7 -0
  71. package/dist/esm/parts/carousel/styles.js +50 -0
  72. package/dist/esm/parts/carousel/styles.js.map +7 -0
  73. package/{esm → dist/esm}/parts/carousel/useCarousel.js +15 -34
  74. package/dist/esm/parts/carousel/useCarousel.js.map +7 -0
  75. package/{esm → dist/esm}/parts/carousel/useCarouselCallbacks.js +20 -28
  76. package/dist/esm/parts/carousel/useCarouselCallbacks.js.map +7 -0
  77. package/dist/esm/parts/tabBar/TabBar.js +149 -0
  78. package/dist/esm/parts/tabBar/TabBar.js.map +7 -0
  79. package/dist/esm/parts/tabBar/styles.js +265 -0
  80. package/dist/esm/parts/tabBar/styles.js.map +7 -0
  81. package/{esm → dist/esm}/parts/tabBar/useTabBar.js +27 -35
  82. package/dist/esm/parts/tabBar/useTabBar.js.map +7 -0
  83. package/dist/esm/parts/tabsContent/TabsContent.js +24 -0
  84. package/dist/esm/parts/tabsContent/TabsContent.js.map +7 -0
  85. package/dist/esm/parts/tabsContent/styles.js +10 -0
  86. package/dist/esm/parts/tabsContent/styles.js.map +7 -0
  87. package/dist/esm/parts/tabsPanel/TabsPanels.js +50 -0
  88. package/dist/esm/parts/tabsPanel/TabsPanels.js.map +7 -0
  89. package/dist/esm/parts/tabsPanel/styles.js +16 -0
  90. package/dist/esm/parts/tabsPanel/styles.js.map +7 -0
  91. package/dist/esm/propTypes.js +29 -0
  92. package/dist/esm/propTypes.js.map +7 -0
  93. package/dist/esm/utils/constants.js +27 -0
  94. package/dist/esm/utils/constants.js.map +7 -0
  95. package/{esm → dist/esm}/utils/helpers.js +23 -28
  96. package/dist/esm/utils/helpers.js.map +7 -0
  97. package/dist/esm/utils/hooks/useKeyboardNavigation.js +48 -0
  98. package/dist/esm/utils/hooks/useKeyboardNavigation.js.map +7 -0
  99. package/dist/esm/utils/hooks/useTabsCallbacks.js +31 -0
  100. package/dist/esm/utils/hooks/useTabsCallbacks.js.map +7 -0
  101. package/{types → dist/types}/DSTabs.d.ts +2 -2
  102. package/{types → dist/types}/DSTabsCTX.d.ts +0 -0
  103. package/{types → dist/types}/DSTabsDatatestid.d.ts +0 -0
  104. package/{types → dist/types}/DSTabsTypes.d.ts +0 -0
  105. package/{types → dist/types}/config/useCrossRef.d.ts +0 -0
  106. package/{types → dist/types}/config/useTabs.d.ts +0 -0
  107. package/{types → dist/types}/defaultProps.d.ts +0 -0
  108. package/{types → dist/types}/exportsRelated/DSTab.d.ts +0 -0
  109. package/{types → dist/types}/index.d.ts +0 -0
  110. package/{types → dist/types}/parts/carousel/Carousel.d.ts +0 -0
  111. package/{types → dist/types}/parts/carousel/styles.d.ts +1 -1
  112. package/{types → dist/types}/parts/carousel/useCarousel.d.ts +0 -0
  113. package/{types → dist/types}/parts/carousel/useCarouselCallbacks.d.ts +0 -0
  114. package/{types → dist/types}/parts/tabBar/TabBar.d.ts +0 -0
  115. package/{types → dist/types}/parts/tabBar/styles.d.ts +0 -0
  116. package/{types → dist/types}/parts/tabBar/useTabBar.d.ts +0 -0
  117. package/{types → dist/types}/parts/tabsContent/TabsContent.d.ts +0 -0
  118. package/{types → dist/types}/parts/tabsContent/styles.d.ts +0 -0
  119. package/{types → dist/types}/parts/tabsPanel/TabsPanels.d.ts +0 -0
  120. package/{types → dist/types}/parts/tabsPanel/styles.d.ts +0 -0
  121. package/{types → dist/types}/propTypes.d.ts +0 -0
  122. package/{types → dist/types}/tests/DSTabs.callbacks.test.d.ts +0 -0
  123. package/{types → dist/types}/tests/DSTabs.func.test.d.ts +0 -0
  124. package/{types → dist/types}/tests/DSTabs.keyboard.test.d.ts +0 -0
  125. package/{types → dist/types}/tests/DSTabs.test.d.ts +0 -0
  126. package/{types → dist/types}/utils/constants.d.ts +0 -0
  127. package/{types → dist/types}/utils/helpers.d.ts +0 -0
  128. package/{types → dist/types}/utils/hooks/useKeyboardNavigation.d.ts +0 -0
  129. package/{types → dist/types}/utils/hooks/useTabsCallbacks.d.ts +0 -0
  130. package/package.json +77 -69
  131. package/cjs/DSTabs.js +0 -45
  132. package/cjs/DSTabsCTX.js +0 -30
  133. package/cjs/DSTabsDatatestid.js +0 -18
  134. package/cjs/DSTabsTypes.js +0 -2
  135. package/cjs/config/useCrossRef.js +0 -17
  136. package/cjs/config/useTabs.js +0 -51
  137. package/cjs/defaultProps.js +0 -27
  138. package/cjs/exportsRelated/DSTab.js +0 -32
  139. package/cjs/index.js +0 -17
  140. package/cjs/parts/carousel/Carousel.js +0 -69
  141. package/cjs/parts/carousel/styles.js +0 -65
  142. package/cjs/parts/carousel/useCarousel.js +0 -78
  143. package/cjs/parts/carousel/useCarouselCallbacks.js +0 -72
  144. package/cjs/parts/tabBar/TabBar.js +0 -168
  145. package/cjs/parts/tabBar/styles.js +0 -200
  146. package/cjs/parts/tabBar/useTabBar.js +0 -87
  147. package/cjs/parts/tabsContent/TabsContent.js +0 -49
  148. package/cjs/parts/tabsContent/styles.js +0 -15
  149. package/cjs/parts/tabsPanel/TabsPanels.js +0 -77
  150. package/cjs/parts/tabsPanel/styles.js +0 -25
  151. package/cjs/propTypes.js +0 -33
  152. package/cjs/utils/constants.js +0 -28
  153. package/cjs/utils/helpers.js +0 -75
  154. package/cjs/utils/hooks/useKeyboardNavigation.js +0 -61
  155. package/cjs/utils/hooks/useTabsCallbacks.js +0 -41
  156. package/esm/DSTabs.js +0 -35
  157. package/esm/DSTabsCTX.js +0 -25
  158. package/esm/DSTabsDatatestid.js +0 -14
  159. package/esm/DSTabsTypes.js +0 -1
  160. package/esm/config/useTabs.js +0 -47
  161. package/esm/exportsRelated/DSTab.js +0 -21
  162. package/esm/index.js +0 -4
  163. package/esm/parts/carousel/Carousel.js +0 -61
  164. package/esm/parts/carousel/styles.js +0 -54
  165. package/esm/parts/tabBar/TabBar.js +0 -159
  166. package/esm/parts/tabBar/styles.js +0 -186
  167. package/esm/parts/tabsContent/TabsContent.js +0 -40
  168. package/esm/parts/tabsContent/styles.js +0 -7
  169. package/esm/parts/tabsPanel/TabsPanels.js +0 -67
  170. package/esm/parts/tabsPanel/styles.js +0 -17
  171. package/esm/propTypes.js +0 -28
  172. package/esm/utils/constants.js +0 -20
  173. package/esm/utils/hooks/useKeyboardNavigation.js +0 -57
  174. package/esm/utils/hooks/useTabsCallbacks.js +0 -37
@@ -0,0 +1,45 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var styles_exports = {};
29
+ __export(styles_exports, {
30
+ StyledPanelContainer: () => StyledPanelContainer
31
+ });
32
+ var React = __toESM(require("react"));
33
+ var import_styled_components = __toESM(require("styled-components"));
34
+ const StyledPanelContainer = import_styled_components.default.div`
35
+ padding-top: 8px;
36
+ &:focus {
37
+ outline: none;
38
+ }
39
+
40
+ ${({ hidden }) => hidden ? "visibility: hidden;" : ""}
41
+
42
+ ${({ isDSMobile }) => isDSMobile ? `padding-top: 0;` : ``}
43
+ `;
44
+ module.exports = __toCommonJS(styles_exports);
45
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/parts/tabsPanel/styles.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import styled from 'styled-components';\nimport type { StyledPanelContainerPropsT } from '../../DSTabsTypes';\n\nexport const StyledPanelContainer = styled.div<StyledPanelContainerPropsT>`\n padding-top: 8px;\n &:focus {\n outline: none;\n }\n\n ${({ hidden }) => (hidden ? 'visibility: hidden;' : '')}\n\n ${({ isDSMobile }) => (isDSMobile ? `padding-top: 0;` : ``)}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AAGZ,MAAM,uBAAuB,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMvC,CAAC,EAAE,aAAc,SAAS,wBAAwB;AAAA;AAAA,IAElD,CAAC,EAAE,iBAAkB,aAAa,oBAAoB;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,58 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var propTypes_exports = {};
29
+ __export(propTypes_exports, {
30
+ tabPropTypes: () => tabPropTypes,
31
+ tabsPropTypes: () => tabsPropTypes
32
+ });
33
+ var React = __toESM(require("react"));
34
+ var import_react_desc = require("react-desc");
35
+ var import_constants = require("./utils/constants");
36
+ const tabPropTypes = {
37
+ tabId: import_react_desc.PropTypes.string.description("Unique Tab id.").defaultValue(""),
38
+ title: import_react_desc.PropTypes.string.description("Tab title.").defaultValue(""),
39
+ required: import_react_desc.PropTypes.bool.description("Show a required mark next to the title.").defaultValue(false),
40
+ disabled: import_react_desc.PropTypes.bool.description("Disables Tab.").defaultValue(false)
41
+ };
42
+ const tabsPropTypes = {
43
+ animated: import_react_desc.PropTypes.bool.description("Whether the Tab transition should animate or not.").defaultValue(true),
44
+ enableMouseEvents: import_react_desc.PropTypes.bool.description("Enables Tab transition with mouse drag events.").defaultValue(false),
45
+ allowTextSelection: import_react_desc.PropTypes.bool.description("Allows text selection when mouse drag events are active.").defaultValue(false),
46
+ onTabChange: import_react_desc.PropTypes.func.description("Handler when a user clicks on a different Tab.").defaultValue("() => {}"),
47
+ type: import_react_desc.PropTypes.oneOf(import_constants.TabTypesValuesAsArray).description("Tab type.").defaultValue(import_constants.TabTypesValuesAsArray[0]),
48
+ tabBarExtraContent: import_react_desc.PropTypes.element.description("Extra content next to the Tab Bar.").defaultValue(void 0),
49
+ onlyRenderActiveTab: import_react_desc.PropTypes.bool.description("Only renders the active Tab in the DOM.").defaultValue(false),
50
+ withCarousel: import_react_desc.PropTypes.bool.description("Activate carousel behavior.").defaultValue(false),
51
+ activeTab: import_react_desc.PropTypes.string.description("Passing a value makes DSTabs a controlled component.").defaultValue("First DSTab children."),
52
+ children: import_react_desc.PropTypes.node.description("Use DSTab component as children.").isRequired,
53
+ tabsListAriaLabel: import_react_desc.PropTypes.string.description("Aria label for the list.").defaultValue("Tab list."),
54
+ containerProps: import_react_desc.PropTypes.object.description("Additional properties for the container.").defaultValue({}),
55
+ innerRef: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.func, import_react_desc.PropTypes.shape({ current: import_react_desc.PropTypes.any })]).description("Ref to the container.").defaultValue(void 0)
56
+ };
57
+ module.exports = __toCommonJS(propTypes_exports);
58
+ //# sourceMappingURL=propTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { PropTypes } from 'react-desc';\nimport { TabTypesValuesAsArray } from './utils/constants';\n\nexport const tabPropTypes = {\n tabId: PropTypes.string.description('Unique Tab id.').defaultValue(''),\n title: PropTypes.string.description('Tab title.').defaultValue(''),\n required: PropTypes.bool.description('Show a required mark next to the title.').defaultValue(false),\n disabled: PropTypes.bool.description('Disables Tab.').defaultValue(false),\n};\n\nexport const tabsPropTypes = {\n animated: PropTypes.bool.description('Whether the Tab transition should animate or not.').defaultValue(true),\n enableMouseEvents: PropTypes.bool.description('Enables Tab transition with mouse drag events.').defaultValue(false),\n allowTextSelection: PropTypes.bool\n .description('Allows text selection when mouse drag events are active.')\n .defaultValue(false),\n onTabChange: PropTypes.func.description('Handler when a user clicks on a different Tab.').defaultValue('() => {}'),\n type: PropTypes.oneOf(TabTypesValuesAsArray).description('Tab type.').defaultValue(TabTypesValuesAsArray[0]),\n tabBarExtraContent: PropTypes.element.description('Extra content next to the Tab Bar.').defaultValue(undefined),\n onlyRenderActiveTab: PropTypes.bool.description('Only renders the active Tab in the DOM.').defaultValue(false),\n withCarousel: PropTypes.bool.description('Activate carousel behavior.').defaultValue(false),\n activeTab: PropTypes.string\n .description('Passing a value makes DSTabs a controlled component.')\n .defaultValue('First DSTab children.'),\n children: PropTypes.node.description('Use DSTab component as children.').isRequired,\n tabsListAriaLabel: PropTypes.string.description('Aria label for the list.').defaultValue('Tab list.'),\n containerProps: PropTypes.object.description('Additional properties for the container.').defaultValue({}),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })])\n .description('Ref to the container.')\n .defaultValue(undefined),\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAC1B,uBAAsC;AAE/B,MAAM,eAAe;AAAA,EAC1B,OAAO,4BAAU,OAAO,YAAY,kBAAkB,aAAa;AAAA,EACnE,OAAO,4BAAU,OAAO,YAAY,cAAc,aAAa;AAAA,EAC/D,UAAU,4BAAU,KAAK,YAAY,2CAA2C,aAAa;AAAA,EAC7F,UAAU,4BAAU,KAAK,YAAY,iBAAiB,aAAa;AAAA;AAG9D,MAAM,gBAAgB;AAAA,EAC3B,UAAU,4BAAU,KAAK,YAAY,qDAAqD,aAAa;AAAA,EACvG,mBAAmB,4BAAU,KAAK,YAAY,kDAAkD,aAAa;AAAA,EAC7G,oBAAoB,4BAAU,KAC3B,YAAY,4DACZ,aAAa;AAAA,EAChB,aAAa,4BAAU,KAAK,YAAY,kDAAkD,aAAa;AAAA,EACvG,MAAM,4BAAU,MAAM,wCAAuB,YAAY,aAAa,aAAa,uCAAsB;AAAA,EACzG,oBAAoB,4BAAU,QAAQ,YAAY,sCAAsC,aAAa;AAAA,EACrG,qBAAqB,4BAAU,KAAK,YAAY,2CAA2C,aAAa;AAAA,EACxG,cAAc,4BAAU,KAAK,YAAY,+BAA+B,aAAa;AAAA,EACrF,WAAW,4BAAU,OAClB,YAAY,wDACZ,aAAa;AAAA,EAChB,UAAU,4BAAU,KAAK,YAAY,oCAAoC;AAAA,EACzE,mBAAmB,4BAAU,OAAO,YAAY,4BAA4B,aAAa;AAAA,EACzF,gBAAgB,4BAAU,OAAO,YAAY,4CAA4C,aAAa;AAAA,EACtG,UAAU,4BAAU,UAAU,CAAC,4BAAU,MAAM,4BAAU,MAAM,EAAE,SAAS,4BAAU,SACjF,YAAY,yBACZ,aAAa;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,56 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var constants_exports = {};
29
+ __export(constants_exports, {
30
+ MOBILE_GRADIENT_WIDTH: () => MOBILE_GRADIENT_WIDTH,
31
+ TabTypes: () => TabTypes,
32
+ TabTypesValuesAsArray: () => TabTypesValuesAsArray,
33
+ defaultIndicatorStyles: () => defaultIndicatorStyles,
34
+ gradientOffsetsAccordingType: () => gradientOffsetsAccordingType
35
+ });
36
+ var React = __toESM(require("react"));
37
+ const TabTypes = {
38
+ NORMAL: "normal",
39
+ NORMAL_SMALL: "normal_small",
40
+ SUBTABS: "subtabs"
41
+ };
42
+ const TabTypesValuesAsArray = Object.values(TabTypes);
43
+ const MOBILE_GRADIENT_WIDTH = 24;
44
+ const defaultIndicatorStyles = {
45
+ left: "0px",
46
+ width: "0px",
47
+ backgroundWithTransparent: ""
48
+ };
49
+ const gradientOffsetsAccordingType = {
50
+ normal_small: 14,
51
+ normal: 16,
52
+ subtabs: 16,
53
+ fixedTabsHeaders: 0
54
+ };
55
+ module.exports = __toCommonJS(constants_exports);
56
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/utils/constants.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export const TabTypes = {\n NORMAL: 'normal' as const,\n NORMAL_SMALL: 'normal_small' as const,\n SUBTABS: 'subtabs' as const,\n};\n\nexport const TabTypesValuesAsArray = Object.values(TabTypes);\n\nexport const MOBILE_GRADIENT_WIDTH = 24;\n\nexport const defaultIndicatorStyles = {\n left: '0px',\n width: '0px',\n backgroundWithTransparent: '',\n};\n\nexport const gradientOffsetsAccordingType = {\n normal_small: 14,\n normal: 16,\n subtabs: 16,\n fixedTabsHeaders: 0,\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,WAAW;AAAA,EACtB,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,SAAS;AAAA;AAGJ,MAAM,wBAAwB,OAAO,OAAO;AAE5C,MAAM,wBAAwB;AAE9B,MAAM,yBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,2BAA2B;AAAA;AAGtB,MAAM,+BAA+B;AAAA,EAC1C,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,kBAAkB;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,88 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var helpers_exports = {};
29
+ __export(helpers_exports, {
30
+ centerTab: () => centerTab,
31
+ getIdByIndex: () => getIdByIndex,
32
+ getIndexById: () => getIndexById,
33
+ getVisibleDimensions: () => getVisibleDimensions,
34
+ isElementVisible: () => isElementVisible,
35
+ isElementVisibleCarousel: () => isElementVisibleCarousel,
36
+ shouldHaveLeftGradient: () => shouldHaveLeftGradient,
37
+ shouldHaveRightGradient: () => shouldHaveRightGradient
38
+ });
39
+ var React = __toESM(require("react"));
40
+ var import_constants = require("./constants");
41
+ const isElementVisible = (tab, tabList) => {
42
+ const tabDimensions = tab.getBoundingClientRect();
43
+ const tabListDimensions = tabList.getBoundingClientRect();
44
+ return tabDimensions.left <= tabListDimensions.left ? tabListDimensions.left - tabDimensions.left <= tabDimensions.width : tabDimensions.right - tabListDimensions.right <= tabDimensions.width;
45
+ };
46
+ const isElementVisibleCarousel = (tab, tabContainer, firstOrLastItem = true) => {
47
+ if (tab && tabContainer) {
48
+ const tabDimensions = tab.getBoundingClientRect();
49
+ const tabContainerDimensions = tabContainer.getBoundingClientRect();
50
+ const offset = firstOrLastItem ? 16 : 32;
51
+ const tabDimensionsLeft = Math.floor(tabDimensions.left - offset);
52
+ const tabDimensionsRight = Math.floor(tabDimensions.right + offset);
53
+ const tabContainerDimensionsLeft = Math.floor(tabContainerDimensions.left);
54
+ const tabContainerDimensionsRight = Math.floor(tabContainerDimensions.right);
55
+ return tabDimensionsLeft >= tabContainerDimensionsLeft && tabDimensionsRight <= tabContainerDimensionsRight;
56
+ }
57
+ return false;
58
+ };
59
+ const centerTab = ({ e, listRef }) => {
60
+ if (listRef.current) {
61
+ const { offsetLeft } = e?.target;
62
+ const { width: tabWidth } = (e?.target).getBoundingClientRect();
63
+ const { width: listWidth } = listRef.current.getBoundingClientRect();
64
+ const extraSideSpace = listWidth - tabWidth;
65
+ const leftOffsetToCenter = extraSideSpace > 0 ? extraSideSpace / 2 : 0;
66
+ const centeredLeftOffset = offsetLeft > leftOffsetToCenter ? offsetLeft - leftOffsetToCenter : 0;
67
+ listRef.current.scrollTo({
68
+ top: 0,
69
+ left: centeredLeftOffset,
70
+ behavior: "smooth"
71
+ });
72
+ e?.preventDefault();
73
+ }
74
+ };
75
+ const getVisibleDimensions = (node, referenceNode) => {
76
+ const nodeDimensions = node.getBoundingClientRect();
77
+ const referenceNodeDimensions = referenceNode.getBoundingClientRect();
78
+ return {
79
+ width: Math.min(node.clientWidth, referenceNodeDimensions.left + referenceNode.clientWidth - nodeDimensions.left, node.clientWidth - (referenceNodeDimensions.left - nodeDimensions.left)),
80
+ height: Math.min(node.clientHeight, referenceNodeDimensions.top + referenceNode.clientHeight - nodeDimensions.top, node.clientHeight - (referenceNodeDimensions.top - nodeDimensions.top))
81
+ };
82
+ };
83
+ const getIndexById = (children, activeId) => children && children.findIndex((item) => item.props.tabId === activeId);
84
+ const getIdByIndex = (children, index) => children && children[index].props.tabId || "";
85
+ const shouldHaveLeftGradient = (scrollLeft) => Math.abs(scrollLeft) > import_constants.MOBILE_GRADIENT_WIDTH;
86
+ const shouldHaveRightGradient = (scrollLeft, clientWidth, scrollWidth) => Math.abs(scrollLeft) <= scrollWidth - (clientWidth + import_constants.MOBILE_GRADIENT_WIDTH);
87
+ module.exports = __toCommonJS(helpers_exports);
88
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/utils/helpers.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import type { CenterTabPropsT, DSTabPropsWithDefaultT, VisibleDimensionsT } from '../DSTabsTypes';\nimport { MOBILE_GRADIENT_WIDTH } from './constants';\n\nexport const isElementVisible = (tab: HTMLElement, tabList: HTMLElement): boolean => {\n const tabDimensions = tab.getBoundingClientRect();\n const tabListDimensions = tabList.getBoundingClientRect();\n\n return tabDimensions.left <= tabListDimensions.left\n ? tabListDimensions.left - tabDimensions.left <= tabDimensions.width\n : tabDimensions.right - tabListDimensions.right <= tabDimensions.width;\n};\n\nexport const isElementVisibleCarousel = (\n tab: HTMLElement | null,\n tabContainer: HTMLDivElement | null,\n firstOrLastItem = true,\n): boolean => {\n if (tab && tabContainer) {\n const tabDimensions = tab.getBoundingClientRect();\n const tabContainerDimensions = tabContainer.getBoundingClientRect();\n\n const offset = firstOrLastItem ? 16 : 32;\n const tabDimensionsLeft = Math.floor(tabDimensions.left - offset);\n const tabDimensionsRight = Math.floor(tabDimensions.right + offset);\n\n const tabContainerDimensionsLeft = Math.floor(tabContainerDimensions.left);\n const tabContainerDimensionsRight = Math.floor(tabContainerDimensions.right);\n\n return tabDimensionsLeft >= tabContainerDimensionsLeft && tabDimensionsRight <= tabContainerDimensionsRight;\n }\n return false;\n};\n\nexport const centerTab = ({ e, listRef }: CenterTabPropsT) => {\n if (listRef.current) {\n const { offsetLeft } = e?.target as HTMLButtonElement;\n const { width: tabWidth } = (e?.target as HTMLButtonElement).getBoundingClientRect();\n const { width: listWidth } = listRef.current.getBoundingClientRect();\n const extraSideSpace = listWidth - tabWidth;\n const leftOffsetToCenter = extraSideSpace > 0 ? extraSideSpace / 2 : 0;\n const centeredLeftOffset = offsetLeft > leftOffsetToCenter ? offsetLeft - leftOffsetToCenter : 0;\n listRef.current.scrollTo({\n top: 0,\n left: centeredLeftOffset,\n behavior: 'smooth',\n });\n\n e?.preventDefault();\n }\n};\n\nexport const getVisibleDimensions = (node: HTMLElement, referenceNode: HTMLElement): VisibleDimensionsT => {\n const nodeDimensions = node.getBoundingClientRect();\n const referenceNodeDimensions = referenceNode.getBoundingClientRect();\n\n return {\n width: Math.min(\n node.clientWidth,\n referenceNodeDimensions.left + referenceNode.clientWidth - nodeDimensions.left,\n node.clientWidth - (referenceNodeDimensions.left - nodeDimensions.left),\n ),\n height: Math.min(\n node.clientHeight,\n referenceNodeDimensions.top + referenceNode.clientHeight - nodeDimensions.top,\n node.clientHeight - (referenceNodeDimensions.top - nodeDimensions.top),\n ),\n };\n};\n\nexport const getIndexById = (children: React.ReactElement<DSTabPropsWithDefaultT>[], activeId?: string): number =>\n children && children.findIndex((item: React.ReactElement<DSTabPropsWithDefaultT>) => item.props.tabId === activeId);\n\nexport const getIdByIndex = (children: React.ReactElement<DSTabPropsWithDefaultT>[], index: number): string =>\n (children && children[index].props.tabId) || '';\n\nexport const shouldHaveLeftGradient = (scrollLeft: number): boolean => Math.abs(scrollLeft) > MOBILE_GRADIENT_WIDTH;\n\nexport const shouldHaveRightGradient = (scrollLeft: number, clientWidth: number, scrollWidth: number): boolean =>\n Math.abs(scrollLeft) <= scrollWidth - (clientWidth + MOBILE_GRADIENT_WIDTH);\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAsC;AAE/B,MAAM,mBAAmB,CAAC,KAAkB,YAAkC;AACnF,QAAM,gBAAgB,IAAI;AAC1B,QAAM,oBAAoB,QAAQ;AAElC,SAAO,cAAc,QAAQ,kBAAkB,OAC3C,kBAAkB,OAAO,cAAc,QAAQ,cAAc,QAC7D,cAAc,QAAQ,kBAAkB,SAAS,cAAc;AAAA;AAG9D,MAAM,2BAA2B,CACtC,KACA,cACA,kBAAkB,SACN;AACZ,MAAI,OAAO,cAAc;AACvB,UAAM,gBAAgB,IAAI;AAC1B,UAAM,yBAAyB,aAAa;AAE5C,UAAM,SAAS,kBAAkB,KAAK;AACtC,UAAM,oBAAoB,KAAK,MAAM,cAAc,OAAO;AAC1D,UAAM,qBAAqB,KAAK,MAAM,cAAc,QAAQ;AAE5D,UAAM,6BAA6B,KAAK,MAAM,uBAAuB;AACrE,UAAM,8BAA8B,KAAK,MAAM,uBAAuB;AAEtE,WAAO,qBAAqB,8BAA8B,sBAAsB;AAAA;AAElF,SAAO;AAAA;AAGF,MAAM,YAAY,CAAC,EAAE,GAAG,cAA+B;AAC5D,MAAI,QAAQ,SAAS;AACnB,UAAM,EAAE,eAAe,GAAG;AAC1B,UAAM,EAAE,OAAO,aAAc,IAAG,QAA6B;AAC7D,UAAM,EAAE,OAAO,cAAc,QAAQ,QAAQ;AAC7C,UAAM,iBAAiB,YAAY;AACnC,UAAM,qBAAqB,iBAAiB,IAAI,iBAAiB,IAAI;AACrE,UAAM,qBAAqB,aAAa,qBAAqB,aAAa,qBAAqB;AAC/F,YAAQ,QAAQ,SAAS;AAAA,MACvB,KAAK;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA;AAGZ,OAAG;AAAA;AAAA;AAIA,MAAM,uBAAuB,CAAC,MAAmB,kBAAmD;AACzG,QAAM,iBAAiB,KAAK;AAC5B,QAAM,0BAA0B,cAAc;AAE9C,SAAO;AAAA,IACL,OAAO,KAAK,IACV,KAAK,aACL,wBAAwB,OAAO,cAAc,cAAc,eAAe,MAC1E,KAAK,cAAe,yBAAwB,OAAO,eAAe;AAAA,IAEpE,QAAQ,KAAK,IACX,KAAK,cACL,wBAAwB,MAAM,cAAc,eAAe,eAAe,KAC1E,KAAK,eAAgB,yBAAwB,MAAM,eAAe;AAAA;AAAA;AAKjE,MAAM,eAAe,CAAC,UAAwD,aACnF,YAAY,SAAS,UAAU,CAAC,SAAqD,KAAK,MAAM,UAAU;AAErG,MAAM,eAAe,CAAC,UAAwD,UAClF,YAAY,SAAS,OAAO,MAAM,SAAU;AAExC,MAAM,yBAAyB,CAAC,eAAgC,KAAK,IAAI,cAAc;AAEvF,MAAM,0BAA0B,CAAC,YAAoB,aAAqB,gBAC/E,KAAK,IAAI,eAAe,cAAe,eAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,77 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var useKeyboardNavigation_exports = {};
29
+ __export(useKeyboardNavigation_exports, {
30
+ useKeyboardNavigation: () => useKeyboardNavigation
31
+ });
32
+ var React = __toESM(require("react"));
33
+ var import_react = require("react");
34
+ var import_DSTabsCTX = require("../../DSTabsCTX");
35
+ const useKeyboardNavigation = () => {
36
+ const { focusableTabsRef } = (0, import_react.useContext)(import_DSTabsCTX.DSTabsContext);
37
+ const { firstSubtabInternalRef, lastTabInternalRef } = (0, import_react.useContext)(import_DSTabsCTX.DSTabsCrossRefContext);
38
+ const handleOnKeyDown = (0, import_react.useCallback)((e) => {
39
+ if (e.key === "ArrowRight" && focusableTabsRef.current) {
40
+ e.preventDefault();
41
+ e.stopPropagation();
42
+ const nextTab = focusableTabsRef.current[focusableTabsRef?.current?.indexOf?.(e.target) + 1];
43
+ if (nextTab)
44
+ nextTab.focus();
45
+ if (!nextTab)
46
+ return;
47
+ }
48
+ if (e.key === "ArrowLeft" && focusableTabsRef.current) {
49
+ e.preventDefault();
50
+ e.stopPropagation();
51
+ const prevTab = focusableTabsRef.current[focusableTabsRef?.current?.indexOf?.(e.target) - 1];
52
+ if (prevTab)
53
+ prevTab.focus();
54
+ if (!prevTab)
55
+ return;
56
+ }
57
+ if (e.key === "ArrowDown") {
58
+ e.preventDefault();
59
+ e.stopPropagation();
60
+ const canFocusCrossTabs = firstSubtabInternalRef?.current && lastTabInternalRef?.current;
61
+ if (canFocusCrossTabs)
62
+ firstSubtabInternalRef.current?.focus();
63
+ }
64
+ if (e.key === "ArrowUp") {
65
+ e.preventDefault();
66
+ e.stopPropagation();
67
+ const canFocusCrossTabs = firstSubtabInternalRef?.current && lastTabInternalRef?.current;
68
+ if (canFocusCrossTabs)
69
+ lastTabInternalRef.current?.focus();
70
+ }
71
+ }, [firstSubtabInternalRef, lastTabInternalRef, focusableTabsRef]);
72
+ return {
73
+ handleOnKeyDown
74
+ };
75
+ };
76
+ module.exports = __toCommonJS(useKeyboardNavigation_exports);
77
+ //# sourceMappingURL=useKeyboardNavigation.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/utils/hooks/useKeyboardNavigation.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport React, { useCallback, useContext } from 'react';\nimport { DSTabsContext, DSTabsCrossRefContext } from '../../DSTabsCTX';\nimport type { UseKeyboardNavigationReturnTypeT } from '../../DSTabsTypes';\n\nexport const useKeyboardNavigation = (): UseKeyboardNavigationReturnTypeT => {\n const { focusableTabsRef } = useContext(DSTabsContext);\n const { firstSubtabInternalRef, lastTabInternalRef } = useContext(DSTabsCrossRefContext);\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'ArrowRight' && focusableTabsRef.current) {\n e.preventDefault();\n e.stopPropagation();\n const nextTab =\n focusableTabsRef.current[focusableTabsRef?.current?.indexOf?.(e.target as HTMLButtonElement) + 1];\n if (nextTab) nextTab.focus();\n if (!nextTab) return;\n }\n\n if (e.key === 'ArrowLeft' && focusableTabsRef.current) {\n e.preventDefault();\n e.stopPropagation();\n const prevTab =\n focusableTabsRef.current[focusableTabsRef?.current?.indexOf?.(e.target as HTMLButtonElement) - 1];\n if (prevTab) prevTab.focus();\n if (!prevTab) return;\n }\n\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n e.stopPropagation();\n const canFocusCrossTabs = firstSubtabInternalRef?.current && lastTabInternalRef?.current;\n if (canFocusCrossTabs) firstSubtabInternalRef.current?.focus();\n }\n\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n e.stopPropagation();\n const canFocusCrossTabs = firstSubtabInternalRef?.current && lastTabInternalRef?.current;\n if (canFocusCrossTabs) lastTabInternalRef.current?.focus();\n }\n },\n [firstSubtabInternalRef, lastTabInternalRef, focusableTabsRef],\n );\n\n return {\n handleOnKeyDown,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAA+C;AAC/C,uBAAqD;AAG9C,MAAM,wBAAwB,MAAwC;AAC3E,QAAM,EAAE,qBAAqB,6BAAW;AACxC,QAAM,EAAE,wBAAwB,uBAAuB,6BAAW;AAElE,QAAM,kBAAkB,8BACtB,CAAC,MAA2B;AAC1B,QAAI,EAAE,QAAQ,gBAAgB,iBAAiB,SAAS;AACtD,QAAE;AACF,QAAE;AACF,YAAM,UACJ,iBAAiB,QAAQ,kBAAkB,SAAS,UAAU,EAAE,UAA+B;AACjG,UAAI;AAAS,gBAAQ;AACrB,UAAI,CAAC;AAAS;AAAA;AAGhB,QAAI,EAAE,QAAQ,eAAe,iBAAiB,SAAS;AACrD,QAAE;AACF,QAAE;AACF,YAAM,UACJ,iBAAiB,QAAQ,kBAAkB,SAAS,UAAU,EAAE,UAA+B;AACjG,UAAI;AAAS,gBAAQ;AACrB,UAAI,CAAC;AAAS;AAAA;AAGhB,QAAI,EAAE,QAAQ,aAAa;AACzB,QAAE;AACF,QAAE;AACF,YAAM,oBAAoB,wBAAwB,WAAW,oBAAoB;AACjF,UAAI;AAAmB,+BAAuB,SAAS;AAAA;AAGzD,QAAI,EAAE,QAAQ,WAAW;AACvB,QAAE;AACF,QAAE;AACF,YAAM,oBAAoB,wBAAwB,WAAW,oBAAoB;AACjF,UAAI;AAAmB,2BAAmB,SAAS;AAAA;AAAA,KAGvD,CAAC,wBAAwB,oBAAoB;AAG/C,SAAO;AAAA,IACL;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,60 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var useTabsCallbacks_exports = {};
29
+ __export(useTabsCallbacks_exports, {
30
+ useTabsCallbacks: () => useTabsCallbacks
31
+ });
32
+ var React = __toESM(require("react"));
33
+ var import_react = require("react");
34
+ var import_helpers = require("../helpers");
35
+ var import_DSTabsCTX = require("../../DSTabsCTX");
36
+ const useTabsCallbacks = () => {
37
+ const {
38
+ setInternalActiveTab,
39
+ tabsListRef,
40
+ props: { onTabChange, isDSMobile, allowTextSelection, fixedTabsHeaders }
41
+ } = (0, import_react.useContext)(import_DSTabsCTX.DSTabsContext);
42
+ const handleOnTabChange = (0, import_react.useCallback)((tabId, e) => {
43
+ setInternalActiveTab(tabId);
44
+ onTabChange(tabId, e);
45
+ if (isDSMobile && !fixedTabsHeaders && e) {
46
+ (0, import_helpers.centerTab)({ e, listRef: tabsListRef });
47
+ }
48
+ }, [fixedTabsHeaders, isDSMobile, onTabChange, setInternalActiveTab, tabsListRef]);
49
+ const handleOnMouseDown = (0, import_react.useCallback)((e) => {
50
+ const role = e.target.getAttribute("role");
51
+ if (role !== "tabpanel" && allowTextSelection)
52
+ e.stopPropagation();
53
+ }, [allowTextSelection]);
54
+ return {
55
+ handleOnTabChange,
56
+ handleOnMouseDown
57
+ };
58
+ };
59
+ module.exports = __toCommonJS(useTabsCallbacks_exports);
60
+ //# sourceMappingURL=useTabsCallbacks.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/utils/hooks/useTabsCallbacks.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React, { useCallback, useContext } from 'react';\nimport { centerTab } from '../helpers';\nimport { DSTabsContext } from '../../DSTabsCTX';\nimport type { UseTabsCallbacksReturnTypeT } from '../../DSTabsTypes';\n\nexport const useTabsCallbacks = (): UseTabsCallbacksReturnTypeT => {\n const {\n setInternalActiveTab,\n tabsListRef,\n props: { onTabChange, isDSMobile, allowTextSelection, fixedTabsHeaders },\n } = useContext(DSTabsContext);\n\n const handleOnTabChange = useCallback(\n (tabId: string, e?: React.MouseEvent) => {\n setInternalActiveTab(tabId);\n onTabChange(tabId, e);\n if (isDSMobile && !fixedTabsHeaders && e) {\n centerTab({ e, listRef: tabsListRef });\n }\n },\n [fixedTabsHeaders, isDSMobile, onTabChange, setInternalActiveTab, tabsListRef],\n );\n\n const handleOnMouseDown = useCallback(\n (e: React.MouseEvent) => {\n const role = (e.target as HTMLElement).getAttribute('role');\n if (role !== 'tabpanel' && allowTextSelection) e.stopPropagation();\n },\n [allowTextSelection],\n );\n\n return {\n handleOnTabChange,\n handleOnMouseDown,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA+C;AAC/C,qBAA0B;AAC1B,uBAA8B;AAGvB,MAAM,mBAAmB,MAAmC;AACjE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,OAAO,EAAE,aAAa,YAAY,oBAAoB;AAAA,MACpD,6BAAW;AAEf,QAAM,oBAAoB,8BACxB,CAAC,OAAe,MAAyB;AACvC,yBAAqB;AACrB,gBAAY,OAAO;AACnB,QAAI,cAAc,CAAC,oBAAoB,GAAG;AACxC,oCAAU,EAAE,GAAG,SAAS;AAAA;AAAA,KAG5B,CAAC,kBAAkB,YAAY,aAAa,sBAAsB;AAGpE,QAAM,oBAAoB,8BACxB,CAAC,MAAwB;AACvB,UAAM,OAAQ,EAAE,OAAuB,aAAa;AACpD,QAAI,SAAS,cAAc;AAAoB,QAAE;AAAA,KAEnD,CAAC;AAGH,SAAO;AAAA,IACL;AAAA,IACA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,34 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { describe } from "react-desc";
4
+ import { tabsPropTypes } from "./propTypes";
5
+ import { DSTabsContext, DSTabsCrossRefContext } from "./DSTabsCTX";
6
+ import { TabsContent } from "./parts/tabsContent/TabsContent";
7
+ import { useTabs } from "./config/useTabs";
8
+ import { useCrossRef } from "./config/useCrossRef";
9
+ import { TabTypes } from "./utils/constants";
10
+ const DSTabs = (props) => {
11
+ const ctx = useTabs(props);
12
+ const crossRefsCtx = useCrossRef();
13
+ const { type } = props;
14
+ if (type === TabTypes.SUBTABS) {
15
+ return /* @__PURE__ */ React2.createElement(DSTabsContext.Provider, {
16
+ value: ctx
17
+ }, /* @__PURE__ */ React2.createElement(TabsContent, null));
18
+ }
19
+ return /* @__PURE__ */ React2.createElement(DSTabsCrossRefContext.Provider, {
20
+ value: crossRefsCtx
21
+ }, /* @__PURE__ */ React2.createElement(DSTabsContext.Provider, {
22
+ value: ctx
23
+ }, /* @__PURE__ */ React2.createElement(TabsContent, null)));
24
+ };
25
+ DSTabs.propTypes = tabsPropTypes;
26
+ const DSTabsWithSchema = describe(DSTabs);
27
+ DSTabsWithSchema.propTypes = tabsPropTypes;
28
+ var DSTabs_default = DSTabs;
29
+ export {
30
+ DSTabs,
31
+ DSTabsWithSchema,
32
+ DSTabs_default as default
33
+ };
34
+ //# sourceMappingURL=DSTabs.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSTabs.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { WeakValidationMap } from 'react';\nimport { describe } from 'react-desc';\nimport { tabsPropTypes } from './propTypes';\nimport { DSTabsContext, DSTabsCrossRefContext } from './DSTabsCTX';\nimport { TabsContent } from './parts/tabsContent/TabsContent';\nimport { useTabs } from './config/useTabs';\nimport { useCrossRef } from './config/useCrossRef';\nimport { TabTypes } from './utils/constants';\nimport type { DSTabsPropsT } from './DSTabsTypes';\n\nconst DSTabs = (props: DSTabsPropsT): JSX.Element => {\n const ctx = useTabs(props);\n const crossRefsCtx = useCrossRef();\n\n const { type } = props;\n\n if (type === TabTypes.SUBTABS) {\n return (\n <DSTabsContext.Provider value={ctx}>\n <TabsContent />\n </DSTabsContext.Provider>\n );\n }\n\n return (\n <DSTabsCrossRefContext.Provider value={crossRefsCtx}>\n <DSTabsContext.Provider value={ctx}>\n <TabsContent />\n </DSTabsContext.Provider>\n </DSTabsCrossRefContext.Provider>\n );\n};\n\nDSTabs.propTypes = tabsPropTypes as WeakValidationMap<unknown>;\nconst DSTabsWithSchema = describe<DSTabsPropsT>(DSTabs);\nDSTabsWithSchema.propTypes = tabsPropTypes;\n\nexport { DSTabs, DSTabsWithSchema };\nexport default DSTabs;\n"],
5
+ "mappings": "AAAA;ACAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,SAAS,CAAC,UAAqC;AACnD,QAAM,MAAM,QAAQ;AACpB,QAAM,eAAe;AAErB,QAAM,EAAE,SAAS;AAEjB,MAAI,SAAS,SAAS,SAAS;AAC7B,WACE,qCAAC,cAAc,UAAf;AAAA,MAAwB,OAAO;AAAA,OAC7B,qCAAC,aAAD;AAAA;AAKN,SACE,qCAAC,sBAAsB,UAAvB;AAAA,IAAgC,OAAO;AAAA,KACrC,qCAAC,cAAc,UAAf;AAAA,IAAwB,OAAO;AAAA,KAC7B,qCAAC,aAAD;AAAA;AAMR,OAAO,YAAY;AACnB,MAAM,mBAAmB,SAAuB;AAChD,iBAAiB,YAAY;AAG7B,IAAO,iBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ import { createContext, createRef } from "react";
3
+ import { tabsDefaultProps as defaultProps } from "./defaultProps";
4
+ const noop = () => {
5
+ };
6
+ const defaultContext = {
7
+ props: defaultProps,
8
+ tabsRef: createRef(),
9
+ tabsListRef: createRef(),
10
+ carouselOnlyListRef: createRef(),
11
+ focusableTabsRef: createRef(),
12
+ tabsRefAsArray: createRef(),
13
+ actualActiveTabRef: createRef(),
14
+ setInternalActiveTab: noop,
15
+ actualActiveTab: ""
16
+ };
17
+ const defaultCrossRefsContext = {
18
+ lastTabInternalRef: createRef(),
19
+ firstSubtabInternalRef: createRef()
20
+ };
21
+ const DSTabsContext = createContext(defaultContext);
22
+ const DSTabsCrossRefContext = createContext(defaultCrossRefsContext);
23
+ export {
24
+ DSTabsContext,
25
+ DSTabsCrossRefContext
26
+ };
27
+ //# sourceMappingURL=DSTabsCTX.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSTabsCTX.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext, createRef } from 'react';\nimport { tabsDefaultProps as defaultProps } from './defaultProps';\nimport type { DSTabsUseCrossRefContextT, DSTabsUseTabsContextT } from './DSTabsTypes';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nconst defaultContext = {\n props: defaultProps,\n tabsRef: createRef<Record<number, HTMLButtonElement> | null>(),\n tabsListRef: createRef<HTMLDivElement | null>(),\n carouselOnlyListRef: createRef<HTMLDivElement | null>(),\n focusableTabsRef: createRef<HTMLButtonElement[] | null>(),\n tabsRefAsArray: createRef<HTMLButtonElement[] | null>(),\n actualActiveTabRef: createRef<HTMLButtonElement | null>(),\n setInternalActiveTab: noop,\n actualActiveTab: '',\n};\n\nconst defaultCrossRefsContext = {\n lastTabInternalRef: createRef<HTMLButtonElement | null>(),\n firstSubtabInternalRef: createRef<HTMLButtonElement | null>(),\n};\n\nexport const DSTabsContext = createContext<DSTabsUseTabsContextT>(defaultContext);\nexport const DSTabsCrossRefContext = createContext<DSTabsUseCrossRefContextT>(defaultCrossRefsContext);\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AAIA,MAAM,OAAO,MAAM;AAAA;AAEnB,MAAM,iBAAiB;AAAA,EACrB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA;AAGnB,MAAM,0BAA0B;AAAA,EAC9B,oBAAoB;AAAA,EACpB,wBAAwB;AAAA;AAGnB,MAAM,gBAAgB,cAAqC;AAC3D,MAAM,wBAAwB,cAAyC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ const DSTabsDatatestid = {
3
+ TABS_CONTAINER: "ds-tabs-container",
4
+ TAB_BUTTON: "ds-tabs-tab-button",
5
+ SUBTAB_BUTTON: "ds-tabs-subtab-button",
6
+ TAB_PANEL: "ds-tabs-tab-panel",
7
+ SUB_TAB_LIST: "subtabs-list",
8
+ TAB_LIST: "tab-list",
9
+ CAROUSEL: {
10
+ BUTTON_RIGHT: "chevron-right",
11
+ BUTTON_LEFT: "chevron-left"
12
+ }
13
+ };
14
+ export {
15
+ DSTabsDatatestid
16
+ };
17
+ //# sourceMappingURL=DSTabsDatatestid.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSTabsDatatestid.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSTabsDatatestid = {\n TABS_CONTAINER: 'ds-tabs-container',\n TAB_BUTTON: 'ds-tabs-tab-button',\n SUBTAB_BUTTON: 'ds-tabs-subtab-button',\n TAB_PANEL: 'ds-tabs-tab-panel',\n SUB_TAB_LIST: 'subtabs-list',\n TAB_LIST: 'tab-list',\n CAROUSEL: {\n BUTTON_RIGHT: 'chevron-right',\n BUTTON_LEFT: 'chevron-left',\n },\n};\n"],
5
+ "mappings": "AAAA;ACAO,MAAM,mBAAmB;AAAA,EAC9B,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,WAAW;AAAA,EACX,cAAc;AAAA,EACd,UAAU;AAAA,EACV,UAAU;AAAA,IACR,cAAc;AAAA,IACd,aAAa;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ import * as React from "react";
2
+ //# sourceMappingURL=DSTabsTypes.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": "AAAA;",
6
+ "names": []
7
+ }
@@ -1,5 +1,5 @@
1
- import { useRef, useMemo } from 'react';
2
-
1
+ import * as React from "react";
2
+ import { useRef, useMemo } from "react";
3
3
  const useCrossRef = () => {
4
4
  const firstSubtabInternalRef = useRef();
5
5
  const lastTabInternalRef = useRef();
@@ -9,5 +9,7 @@ const useCrossRef = () => {
9
9
  }), []);
10
10
  return ctx;
11
11
  };
12
-
13
- export { useCrossRef };
12
+ export {
13
+ useCrossRef
14
+ };
15
+ //# sourceMappingURL=useCrossRef.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useCrossRef.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useRef, useMemo } from 'react';\nimport type { DSTabsUseCrossRefContextT } from '../DSTabsTypes';\n\nexport const useCrossRef = (): DSTabsUseCrossRefContextT => {\n const firstSubtabInternalRef = useRef<HTMLButtonElement>();\n const lastTabInternalRef = useRef<HTMLButtonElement>();\n\n const ctx = useMemo(\n () => ({\n firstSubtabInternalRef,\n lastTabInternalRef,\n }),\n [],\n );\n\n return ctx;\n};\n"],
5
+ "mappings": "AAAA;ACAA;AAGO,MAAM,cAAc,MAAiC;AAC1D,QAAM,yBAAyB;AAC/B,QAAM,qBAAqB;AAE3B,QAAM,MAAM,QACV,MAAO;AAAA,IACL;AAAA,IACA;AAAA,MAEF;AAGF,SAAO;AAAA;",
6
+ "names": []
7
+ }