@elliemae/ds-tabs 2.3.1 → 3.0.0-alpha.3

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 +74 -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 +58 -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 +69 -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 +95 -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 +84 -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 +45 -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 +31 -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 +42 -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 +66 -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 +19 -26
  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/package.json +78 -69
  102. package/cjs/DSTabs.js +0 -45
  103. package/cjs/DSTabsCTX.js +0 -30
  104. package/cjs/DSTabsDatatestid.js +0 -18
  105. package/cjs/DSTabsTypes.js +0 -2
  106. package/cjs/config/useCrossRef.js +0 -17
  107. package/cjs/config/useTabs.js +0 -54
  108. package/cjs/defaultProps.js +0 -27
  109. package/cjs/exportsRelated/DSTab.js +0 -32
  110. package/cjs/index.js +0 -17
  111. package/cjs/parts/carousel/Carousel.js +0 -69
  112. package/cjs/parts/carousel/styles.js +0 -65
  113. package/cjs/parts/carousel/useCarousel.js +0 -78
  114. package/cjs/parts/carousel/useCarouselCallbacks.js +0 -72
  115. package/cjs/parts/tabBar/TabBar.js +0 -168
  116. package/cjs/parts/tabBar/styles.js +0 -200
  117. package/cjs/parts/tabBar/useTabBar.js +0 -87
  118. package/cjs/parts/tabsContent/TabsContent.js +0 -49
  119. package/cjs/parts/tabsContent/styles.js +0 -15
  120. package/cjs/parts/tabsPanel/TabsPanels.js +0 -102
  121. package/cjs/parts/tabsPanel/styles.js +0 -25
  122. package/cjs/propTypes.js +0 -33
  123. package/cjs/utils/constants.js +0 -28
  124. package/cjs/utils/helpers.js +0 -71
  125. package/cjs/utils/hooks/useKeyboardNavigation.js +0 -61
  126. package/cjs/utils/hooks/useTabsCallbacks.js +0 -41
  127. package/esm/DSTabs.js +0 -35
  128. package/esm/DSTabsCTX.js +0 -25
  129. package/esm/DSTabsDatatestid.js +0 -14
  130. package/esm/DSTabsTypes.js +0 -1
  131. package/esm/config/useTabs.js +0 -50
  132. package/esm/exportsRelated/DSTab.js +0 -21
  133. package/esm/index.js +0 -4
  134. package/esm/parts/carousel/Carousel.js +0 -61
  135. package/esm/parts/carousel/styles.js +0 -54
  136. package/esm/parts/tabBar/TabBar.js +0 -159
  137. package/esm/parts/tabBar/styles.js +0 -186
  138. package/esm/parts/tabsContent/TabsContent.js +0 -40
  139. package/esm/parts/tabsContent/styles.js +0 -7
  140. package/esm/parts/tabsPanel/TabsPanels.js +0 -92
  141. package/esm/parts/tabsPanel/styles.js +0 -17
  142. package/esm/propTypes.js +0 -28
  143. package/esm/utils/constants.js +0 -20
  144. package/esm/utils/hooks/useKeyboardNavigation.js +0 -57
  145. package/esm/utils/hooks/useTabsCallbacks.js +0 -37
  146. package/types/DSTabs.d.ts +0 -14
  147. package/types/DSTabsCTX.d.ts +0 -4
  148. package/types/DSTabsDatatestid.d.ts +0 -12
  149. package/types/DSTabsTypes.d.ts +0 -205
  150. package/types/config/useCrossRef.d.ts +0 -2
  151. package/types/config/useTabs.d.ts +0 -2
  152. package/types/defaultProps.d.ts +0 -2
  153. package/types/exportsRelated/DSTab.d.ts +0 -14
  154. package/types/index.d.ts +0 -5
  155. package/types/parts/carousel/Carousel.d.ts +0 -3
  156. package/types/parts/carousel/styles.d.ts +0 -6
  157. package/types/parts/carousel/useCarousel.d.ts +0 -2
  158. package/types/parts/carousel/useCarouselCallbacks.d.ts +0 -2
  159. package/types/parts/tabBar/TabBar.d.ts +0 -2
  160. package/types/parts/tabBar/styles.d.ts +0 -7
  161. package/types/parts/tabBar/useTabBar.d.ts +0 -2
  162. package/types/parts/tabsContent/TabsContent.d.ts +0 -2
  163. package/types/parts/tabsContent/styles.d.ts +0 -1
  164. package/types/parts/tabsPanel/TabsPanels.d.ts +0 -2
  165. package/types/parts/tabsPanel/styles.d.ts +0 -2
  166. package/types/propTypes.d.ts +0 -54
  167. package/types/tests/DSTabs.callbacks.test.d.ts +0 -1
  168. package/types/tests/DSTabs.func.test.d.ts +0 -1
  169. package/types/tests/DSTabs.keyboard.test.d.ts +0 -1
  170. package/types/tests/DSTabs.test.d.ts +0 -1
  171. package/types/utils/constants.d.ts +0 -18
  172. package/types/utils/helpers.d.ts +0 -7
  173. package/types/utils/hooks/useKeyboardNavigation.d.ts +0 -2
  174. package/types/utils/hooks/useTabsCallbacks.d.ts +0 -2
@@ -0,0 +1,95 @@
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 TabsPanels_exports = {};
29
+ __export(TabsPanels_exports, {
30
+ TabsPanels: () => TabsPanels
31
+ });
32
+ var React = __toESM(require("react"));
33
+ var import_react = __toESM(require("react"));
34
+ var import_react_swipeable_views = __toESM(require("react-swipeable-views"));
35
+ var import_styles = require("./styles");
36
+ var import_DSTabsCTX = require("../../DSTabsCTX");
37
+ var import_useTabsCallbacks = require("../../utils/hooks/useTabsCallbacks");
38
+ const TabsPanels = () => {
39
+ const {
40
+ actualActiveTab,
41
+ focusableTabsRef,
42
+ props: { animated, enableMouseEvents, onlyRenderActiveTab, children: tabs, isDSMobile }
43
+ } = (0, import_react.useContext)(import_DSTabsCTX.DSTabsContext);
44
+ const { handleOnTabChange, handleOnMouseDown } = (0, import_useTabsCallbacks.useTabsCallbacks)();
45
+ const handleOnChangeIndex = (0, import_react.useCallback)((index, indexLatest) => {
46
+ if (!focusableTabsRef.current)
47
+ return;
48
+ const offset = index - indexLatest;
49
+ if (focusableTabsRef.current) {
50
+ const currentIndexFocusable = focusableTabsRef.current?.findIndex((el) => el.dataset.tabId === actualActiveTab);
51
+ const newFocusableIndex = currentIndexFocusable >= 0 ? currentIndexFocusable + offset : -1;
52
+ if (newFocusableIndex < 0 || newFocusableIndex > focusableTabsRef.current?.length || !focusableTabsRef.current?.[newFocusableIndex])
53
+ return;
54
+ handleOnTabChange(focusableTabsRef.current[newFocusableIndex].dataset?.tabId);
55
+ focusableTabsRef.current[newFocusableIndex].click();
56
+ }
57
+ }, [actualActiveTab, focusableTabsRef, handleOnTabChange]);
58
+ const firstSlideToShow = (0, import_react.useMemo)(() => {
59
+ const childrenArray = import_react.default.Children.toArray(tabs);
60
+ const index = childrenArray.filter((tab) => tab.props.disabled !== true).findIndex((tab) => tab.props.tabId === actualActiveTab);
61
+ if (index === -1)
62
+ return 0;
63
+ return index;
64
+ }, [actualActiveTab, tabs]);
65
+ const panels = (0, import_react.useMemo)(() => import_react.default.Children.map(tabs, (tab) => {
66
+ const { tabId: panelId = "", style, children: content, disabled } = tab.props;
67
+ const isActive = actualActiveTab === panelId;
68
+ const shouldRender = !onlyRenderActiveTab || isActive;
69
+ if (disabled)
70
+ return null;
71
+ return shouldRender && /* @__PURE__ */ import_react.default.createElement(import_styles.StyledPanelContainer, {
72
+ key: panelId,
73
+ id: panelId,
74
+ "aria-labelledby": `${panelId}-label`,
75
+ "aria-hidden": !isActive,
76
+ "data-panel-id": panelId,
77
+ "data-testid": "ds-tabs-tab-panel",
78
+ hidden: !isActive,
79
+ onMouseDown: handleOnMouseDown,
80
+ role: "tabpanel",
81
+ style,
82
+ isDSMobile
83
+ }, content);
84
+ }), [actualActiveTab, handleOnMouseDown, isDSMobile, onlyRenderActiveTab, tabs]);
85
+ if (animated) {
86
+ return /* @__PURE__ */ import_react.default.createElement(import_react_swipeable_views.default, {
87
+ enableMouseEvents,
88
+ index: firstSlideToShow,
89
+ onChangeIndex: handleOnChangeIndex
90
+ }, panels);
91
+ }
92
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, panels);
93
+ };
94
+ module.exports = __toCommonJS(TabsPanels_exports);
95
+ //# sourceMappingURL=TabsPanels.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/parts/tabsPanel/TabsPanels.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\nimport React, { useMemo, useContext, useCallback } from 'react';\nimport SwipeableViews from 'react-swipeable-views';\nimport { StyledPanelContainer } from './styles';\nimport { DSTabsContext } from '../../DSTabsCTX';\nimport { useTabsCallbacks } from '../../utils/hooks/useTabsCallbacks';\nimport { DSTabPropsWithDefaultT } from '../../DSTabsTypes';\n\nexport const TabsPanels = (): JSX.Element => {\n const {\n actualActiveTab,\n focusableTabsRef,\n props: { animated, enableMouseEvents, onlyRenderActiveTab, children: tabs, isDSMobile },\n } = useContext(DSTabsContext);\n\n const { handleOnTabChange, handleOnMouseDown } = useTabsCallbacks();\n\n const handleOnChangeIndex = useCallback(\n (index: number, indexLatest: number) => {\n if (!focusableTabsRef.current) return;\n\n const offset = index - indexLatest;\n\n if (focusableTabsRef.current) {\n const currentIndexFocusable = focusableTabsRef.current?.findIndex((el) => el.dataset.tabId === actualActiveTab);\n\n const newFocusableIndex = currentIndexFocusable >= 0 ? currentIndexFocusable + offset : -1;\n\n if (\n newFocusableIndex < 0 ||\n newFocusableIndex > focusableTabsRef.current?.length ||\n !focusableTabsRef.current?.[newFocusableIndex]\n )\n return;\n handleOnTabChange(focusableTabsRef.current[newFocusableIndex].dataset?.tabId as string);\n\n // swiping does not trigger centerTab function inside handleOnTabChange because there is no event\n // by clicking we are manually forcing to center the tab\n\n focusableTabsRef.current[newFocusableIndex].click();\n }\n },\n [actualActiveTab, focusableTabsRef, handleOnTabChange],\n );\n\n const firstSlideToShow = useMemo(() => {\n const childrenArray = React.Children.toArray(tabs) as React.ReactElement<DSTabPropsWithDefaultT>[];\n const index = childrenArray\n .filter((tab) => tab.props.disabled !== true)\n .findIndex((tab) => tab.props.tabId === actualActiveTab);\n\n if (index === -1) return 0;\n return index;\n }, [actualActiveTab, tabs]);\n\n const panels = useMemo(\n () =>\n React.Children.map(tabs, (tab: React.ReactElement<DSTabPropsWithDefaultT>) => {\n const { tabId: panelId = '', style, children: content, disabled } = tab.props;\n const isActive = actualActiveTab === panelId;\n const shouldRender = !onlyRenderActiveTab || isActive;\n\n if (disabled) return null;\n return (\n shouldRender && (\n <StyledPanelContainer\n key={panelId}\n id={panelId}\n aria-labelledby={`${panelId}-label`}\n aria-hidden={!isActive}\n data-panel-id={panelId}\n data-testid=\"ds-tabs-tab-panel\"\n hidden={!isActive}\n onMouseDown={handleOnMouseDown}\n role=\"tabpanel\"\n style={style}\n isDSMobile={isDSMobile}\n >\n {content}\n </StyledPanelContainer>\n )\n );\n }),\n [actualActiveTab, handleOnMouseDown, isDSMobile, onlyRenderActiveTab, tabs],\n );\n\n if (animated) {\n return (\n <SwipeableViews\n enableMouseEvents={enableMouseEvents}\n index={firstSlideToShow}\n onChangeIndex={handleOnChangeIndex}\n >\n {panels}\n </SwipeableViews>\n );\n }\n\n return <>{panels}</>;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwD;AACxD,mCAA2B;AAC3B,oBAAqC;AACrC,uBAA8B;AAC9B,8BAAiC;AAG1B,MAAM,aAAa,MAAmB;AAC3C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,OAAO,EAAE,UAAU,mBAAmB,qBAAqB,UAAU,MAAM;AAAA,MACzE,6BAAW;AAEf,QAAM,EAAE,mBAAmB,sBAAsB;AAEjD,QAAM,sBAAsB,8BAC1B,CAAC,OAAe,gBAAwB;AACtC,QAAI,CAAC,iBAAiB;AAAS;AAE/B,UAAM,SAAS,QAAQ;AAEvB,QAAI,iBAAiB,SAAS;AAC5B,YAAM,wBAAwB,iBAAiB,SAAS,UAAU,CAAC,OAAO,GAAG,QAAQ,UAAU;AAE/F,YAAM,oBAAoB,yBAAyB,IAAI,wBAAwB,SAAS;AAExF,UACE,oBAAoB,KACpB,oBAAoB,iBAAiB,SAAS,UAC9C,CAAC,iBAAiB,UAAU;AAE5B;AACF,wBAAkB,iBAAiB,QAAQ,mBAAmB,SAAS;AAKvE,uBAAiB,QAAQ,mBAAmB;AAAA;AAAA,KAGhD,CAAC,iBAAiB,kBAAkB;AAGtC,QAAM,mBAAmB,0BAAQ,MAAM;AACrC,UAAM,gBAAgB,qBAAM,SAAS,QAAQ;AAC7C,UAAM,QAAQ,cACX,OAAO,CAAC,QAAQ,IAAI,MAAM,aAAa,MACvC,UAAU,CAAC,QAAQ,IAAI,MAAM,UAAU;AAE1C,QAAI,UAAU;AAAI,aAAO;AACzB,WAAO;AAAA,KACN,CAAC,iBAAiB;AAErB,QAAM,SAAS,0BACb,MACE,qBAAM,SAAS,IAAI,MAAM,CAAC,QAAoD;AAC5E,UAAM,EAAE,OAAO,UAAU,IAAI,OAAO,UAAU,SAAS,aAAa,IAAI;AACxE,UAAM,WAAW,oBAAoB;AACrC,UAAM,eAAe,CAAC,uBAAuB;AAE7C,QAAI;AAAU,aAAO;AACrB,WACE,gBACE,mDAAC,oCAAD;AAAA,MACE,KAAK;AAAA,MACL,IAAI;AAAA,MACJ,mBAAiB,GAAG;AAAA,MACpB,eAAa,CAAC;AAAA,MACd,iBAAe;AAAA,MACf,eAAY;AAAA,MACZ,QAAQ,CAAC;AAAA,MACT,aAAa;AAAA,MACb,MAAK;AAAA,MACL;AAAA,MACA;AAAA,OAEC;AAAA,MAKX,CAAC,iBAAiB,mBAAmB,YAAY,qBAAqB;AAGxE,MAAI,UAAU;AACZ,WACE,mDAAC,sCAAD;AAAA,MACE;AAAA,MACA,OAAO;AAAA,MACP,eAAe;AAAA,OAEd;AAAA;AAKP,SAAO,wFAAG;AAAA;",
6
+ "names": []
7
+ }
@@ -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,84 @@
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
+ getVisibleDimensions: () => getVisibleDimensions,
32
+ isElementVisible: () => isElementVisible,
33
+ isElementVisibleCarousel: () => isElementVisibleCarousel,
34
+ shouldHaveLeftGradient: () => shouldHaveLeftGradient,
35
+ shouldHaveRightGradient: () => shouldHaveRightGradient
36
+ });
37
+ var React = __toESM(require("react"));
38
+ var import_constants = require("./constants");
39
+ const isElementVisible = (tab, tabList) => {
40
+ const tabDimensions = tab.getBoundingClientRect();
41
+ const tabListDimensions = tabList.getBoundingClientRect();
42
+ return tabDimensions.left <= tabListDimensions.left ? tabListDimensions.left - tabDimensions.left <= tabDimensions.width : tabDimensions.right - tabListDimensions.right <= tabDimensions.width;
43
+ };
44
+ const isElementVisibleCarousel = (tab, tabContainer, firstOrLastItem = true) => {
45
+ if (tab && tabContainer) {
46
+ const tabDimensions = tab.getBoundingClientRect();
47
+ const tabContainerDimensions = tabContainer.getBoundingClientRect();
48
+ const offset = firstOrLastItem ? 16 : 32;
49
+ const tabDimensionsLeft = Math.floor(tabDimensions.left - offset);
50
+ const tabDimensionsRight = Math.floor(tabDimensions.right + offset);
51
+ const tabContainerDimensionsLeft = Math.floor(tabContainerDimensions.left);
52
+ const tabContainerDimensionsRight = Math.floor(tabContainerDimensions.right);
53
+ return tabDimensionsLeft >= tabContainerDimensionsLeft && tabDimensionsRight <= tabContainerDimensionsRight;
54
+ }
55
+ return false;
56
+ };
57
+ const centerTab = ({ e, listRef }) => {
58
+ if (listRef.current) {
59
+ const { offsetLeft } = e?.target;
60
+ const { width: tabWidth } = (e?.target).getBoundingClientRect();
61
+ const { width: listWidth } = listRef.current.getBoundingClientRect();
62
+ const extraSideSpace = listWidth - tabWidth;
63
+ const leftOffsetToCenter = extraSideSpace > 0 ? extraSideSpace / 2 : 0;
64
+ const centeredLeftOffset = offsetLeft > leftOffsetToCenter ? offsetLeft - leftOffsetToCenter : 0;
65
+ listRef.current.scrollTo({
66
+ top: 0,
67
+ left: centeredLeftOffset,
68
+ behavior: "smooth"
69
+ });
70
+ e?.preventDefault();
71
+ }
72
+ };
73
+ const getVisibleDimensions = (node, referenceNode) => {
74
+ const nodeDimensions = node.getBoundingClientRect();
75
+ const referenceNodeDimensions = referenceNode.getBoundingClientRect();
76
+ return {
77
+ width: Math.min(node.clientWidth, referenceNodeDimensions.left + referenceNode.clientWidth - nodeDimensions.left, node.clientWidth - (referenceNodeDimensions.left - nodeDimensions.left)),
78
+ height: Math.min(node.clientHeight, referenceNodeDimensions.top + referenceNode.clientHeight - nodeDimensions.top, node.clientHeight - (referenceNodeDimensions.top - nodeDimensions.top))
79
+ };
80
+ };
81
+ const shouldHaveLeftGradient = (scrollLeft) => Math.abs(scrollLeft) > import_constants.MOBILE_GRADIENT_WIDTH;
82
+ const shouldHaveRightGradient = (scrollLeft, clientWidth, scrollWidth) => Math.abs(scrollLeft) <= scrollWidth - (clientWidth + import_constants.MOBILE_GRADIENT_WIDTH);
83
+ module.exports = __toCommonJS(helpers_exports);
84
+ //# 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 React from 'react';\nimport type { CenterTabPropsT, 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 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;ACAA,YAAuB;ADEvB,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,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
+ }