@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,149 @@
1
+ import * as React from "react";
2
+ import React2, { useMemo, useContext } from "react";
3
+ import { Carousel } from "../carousel/Carousel";
4
+ import { useTabBar } from "./useTabBar";
5
+ import {
6
+ StyledTabButton,
7
+ StyledTabList,
8
+ StyledTabWrapper,
9
+ StyledSelectionIndicator,
10
+ StyledSubTabsList,
11
+ StyledRequiredMark
12
+ } from "./styles";
13
+ import { DSTabsContext, DSTabsCrossRefContext } from "../../DSTabsCTX";
14
+ import { useKeyboardNavigation } from "../../utils/hooks/useKeyboardNavigation";
15
+ import { centerTab } from "../../utils/helpers";
16
+ import { TabTypes } from "../../utils/constants";
17
+ import { useTabsCallbacks } from "../../utils/hooks/useTabsCallbacks";
18
+ import { DSTabsDatatestid } from "../../DSTabsDatatestid";
19
+ const TabBar = () => {
20
+ const {
21
+ tabsRef,
22
+ focusableTabsRef,
23
+ tabsListRef,
24
+ tabsRefAsArray,
25
+ carouselOnlyListRef,
26
+ actualActiveTab,
27
+ props: { type, fixedTabsHeaders, withCarousel, isDSMobile, showSeparator, children: tabs }
28
+ } = useContext(DSTabsContext);
29
+ const { lastTabInternalRef, firstSubtabInternalRef } = useContext(DSTabsCrossRefContext);
30
+ const { handleOnTabChange } = useTabsCallbacks();
31
+ const { handleOnKeyDown } = useKeyboardNavigation();
32
+ const { indicatorStyle, mobileGradients, updateMobileGradients, updateIndicatorStyle } = useTabBar();
33
+ const renderTabs = useMemo(() => {
34
+ const availableTabIndexes = [];
35
+ return React2.Children.map(tabs, (tab, index) => {
36
+ const { tabId = "", title = "", style, required = false, disabled = false, ref, onClick, onKeyDown } = tab.props;
37
+ if (!disabled)
38
+ availableTabIndexes.push(index);
39
+ return /* @__PURE__ */ React2.createElement(StyledTabButton, {
40
+ key: tabId,
41
+ role: "tab",
42
+ ref: (tabButtonRef) => {
43
+ if (tabButtonRef && tabsRefAsArray.current && focusableTabsRef.current && tabsRef.current) {
44
+ tabsRefAsArray.current[index] = tabButtonRef;
45
+ if (!disabled && !focusableTabsRef.current.includes(tabButtonRef))
46
+ focusableTabsRef.current.push(tabButtonRef);
47
+ tabsRef.current[index] = tabButtonRef;
48
+ if (type === TabTypes.SUBTABS && firstSubtabInternalRef && index === availableTabIndexes[0]) {
49
+ firstSubtabInternalRef.current = tabButtonRef;
50
+ }
51
+ if (type !== TabTypes.SUBTABS && index === availableTabIndexes[availableTabIndexes.length - 1]) {
52
+ lastTabInternalRef.current = tabButtonRef;
53
+ }
54
+ if (ref)
55
+ ref.current = tabButtonRef;
56
+ }
57
+ },
58
+ type: "button",
59
+ "aria-controls": tabId,
60
+ "aria-selected": actualActiveTab === tabId,
61
+ "aria-disabled": disabled,
62
+ "aria-labelledby": `${tabId}-label`,
63
+ isDSMobile,
64
+ fixedTabsHeaders,
65
+ tabType: type,
66
+ title,
67
+ "data-required": required,
68
+ "data-tab-id": tabId,
69
+ "data-index": index,
70
+ withCarousel,
71
+ isActive: actualActiveTab === tabId,
72
+ disabled,
73
+ showSeparator: showSeparator && type !== TabTypes.NORMAL,
74
+ "data-testid": type === TabTypes.NORMAL ? DSTabsDatatestid.TAB_BUTTON : DSTabsDatatestid.SUBTAB_BUTTON,
75
+ id: `${tabId}-label`,
76
+ onClick: (e) => {
77
+ if (!disabled) {
78
+ handleOnTabChange(tabId, e);
79
+ updateIndicatorStyle();
80
+ }
81
+ if (onClick && !disabled)
82
+ onClick(tabId, e);
83
+ },
84
+ onFocus: (e) => {
85
+ if (withCarousel)
86
+ centerTab({ e, listRef: carouselOnlyListRef });
87
+ },
88
+ onKeyDown: (e) => {
89
+ if (e.key === "Enter")
90
+ e.stopPropagation();
91
+ if (!disabled)
92
+ handleOnKeyDown(e);
93
+ if (onKeyDown && !disabled)
94
+ onKeyDown(e);
95
+ },
96
+ style
97
+ }, title, required && /* @__PURE__ */ React2.createElement(StyledRequiredMark, null, "\u25CF"));
98
+ });
99
+ }, [
100
+ tabs,
101
+ actualActiveTab,
102
+ isDSMobile,
103
+ fixedTabsHeaders,
104
+ type,
105
+ withCarousel,
106
+ showSeparator,
107
+ tabsRefAsArray,
108
+ focusableTabsRef,
109
+ tabsRef,
110
+ firstSubtabInternalRef,
111
+ lastTabInternalRef,
112
+ handleOnTabChange,
113
+ updateIndicatorStyle,
114
+ carouselOnlyListRef,
115
+ handleOnKeyDown
116
+ ]);
117
+ if (type === TabTypes.SUBTABS && !isDSMobile) {
118
+ return /* @__PURE__ */ React2.createElement(StyledSubTabsList, {
119
+ withCarousel,
120
+ "data-testid": DSTabsDatatestid.SUB_TAB_LIST,
121
+ ref: tabsListRef,
122
+ role: "tablist"
123
+ }, withCarousel ? /* @__PURE__ */ React2.createElement(Carousel, null, renderTabs) : renderTabs);
124
+ }
125
+ return /* @__PURE__ */ React2.createElement(StyledTabList, {
126
+ withCarousel,
127
+ ref: tabsListRef,
128
+ role: "tablist",
129
+ "data-testid": DSTabsDatatestid.TAB_LIST,
130
+ isDSMobile,
131
+ fixedTabsHeaders,
132
+ mobileGradients,
133
+ onScroll: updateMobileGradients,
134
+ indicatorStyle,
135
+ tabType: type
136
+ }, /* @__PURE__ */ React2.createElement(StyledTabWrapper, {
137
+ isDSMobile,
138
+ fixedTabsHeaders
139
+ }, !isDSMobile && withCarousel ? /* @__PURE__ */ React2.createElement(Carousel, {
140
+ updateIndicatorStyle
141
+ }, renderTabs) : renderTabs), /* @__PURE__ */ React2.createElement(StyledSelectionIndicator, {
142
+ isDSMobile,
143
+ tabType: type
144
+ }));
145
+ };
146
+ export {
147
+ TabBar
148
+ };
149
+ //# sourceMappingURL=TabBar.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/tabBar/TabBar.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useMemo, useContext } from 'react';\nimport { Carousel } from '../carousel/Carousel';\nimport { useTabBar } from './useTabBar';\nimport {\n StyledTabButton,\n StyledTabList,\n StyledTabWrapper,\n StyledSelectionIndicator,\n StyledSubTabsList,\n StyledRequiredMark,\n} from './styles';\nimport { DSTabsContext, DSTabsCrossRefContext } from '../../DSTabsCTX';\nimport { useKeyboardNavigation } from '../../utils/hooks/useKeyboardNavigation';\nimport { centerTab } from '../../utils/helpers';\nimport { TabTypes } from '../../utils/constants';\nimport { useTabsCallbacks } from '../../utils/hooks/useTabsCallbacks';\nimport { DSTabsDatatestid } from '../../DSTabsDatatestid';\nimport type { DSTabPropsWithDefaultT } from '../../DSTabsTypes';\n\nexport const TabBar = (): JSX.Element => {\n const {\n tabsRef,\n focusableTabsRef,\n tabsListRef,\n tabsRefAsArray,\n carouselOnlyListRef,\n actualActiveTab,\n props: { type, fixedTabsHeaders, withCarousel, isDSMobile, showSeparator, children: tabs },\n } = useContext(DSTabsContext);\n\n const { lastTabInternalRef, firstSubtabInternalRef } = useContext(DSTabsCrossRefContext);\n const { handleOnTabChange } = useTabsCallbacks();\n const { handleOnKeyDown } = useKeyboardNavigation();\n\n const { indicatorStyle, mobileGradients, updateMobileGradients, updateIndicatorStyle } = useTabBar();\n\n const renderTabs: React.ReactNode[] = useMemo(() => {\n const availableTabIndexes: number[] = [];\n\n return React.Children.map(tabs, (tab: React.ReactElement<DSTabPropsWithDefaultT>, index) => {\n const { tabId = '', title = '', style, required = false, disabled = false, ref, onClick, onKeyDown } = tab.props;\n if (!disabled) availableTabIndexes.push(index);\n return (\n <StyledTabButton\n key={tabId}\n role=\"tab\"\n ref={(tabButtonRef: HTMLButtonElement) => {\n if (tabButtonRef && tabsRefAsArray.current && focusableTabsRef.current && tabsRef.current) {\n tabsRefAsArray.current[index] = tabButtonRef;\n if (!disabled && !focusableTabsRef.current.includes(tabButtonRef))\n focusableTabsRef.current.push(tabButtonRef);\n tabsRef.current[index] = tabButtonRef;\n if (type === TabTypes.SUBTABS && firstSubtabInternalRef && index === availableTabIndexes[0]) {\n firstSubtabInternalRef.current = tabButtonRef;\n }\n if (type !== TabTypes.SUBTABS && index === availableTabIndexes[availableTabIndexes.length - 1]) {\n lastTabInternalRef.current = tabButtonRef;\n }\n if (ref) ref.current = tabButtonRef;\n }\n }}\n type=\"button\"\n aria-controls={tabId}\n aria-selected={actualActiveTab === tabId}\n aria-disabled={disabled}\n aria-labelledby={`${tabId}-label`}\n isDSMobile={isDSMobile}\n fixedTabsHeaders={fixedTabsHeaders}\n tabType={type}\n title={title}\n data-required={required}\n data-tab-id={tabId}\n data-index={index}\n withCarousel={withCarousel}\n isActive={actualActiveTab === tabId}\n disabled={disabled}\n showSeparator={showSeparator && type !== TabTypes.NORMAL}\n data-testid={type === TabTypes.NORMAL ? DSTabsDatatestid.TAB_BUTTON : DSTabsDatatestid.SUBTAB_BUTTON}\n id={`${tabId}-label`}\n onClick={(e) => {\n if (!disabled) {\n handleOnTabChange(tabId, e);\n updateIndicatorStyle();\n }\n if (onClick && !disabled) onClick(tabId, e);\n }}\n onFocus={(e) => {\n if (withCarousel) centerTab({ e, listRef: carouselOnlyListRef });\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') e.stopPropagation();\n if (!disabled) handleOnKeyDown(e);\n if (onKeyDown && !disabled) onKeyDown(e);\n }}\n style={style}\n >\n {title}\n {required && <StyledRequiredMark>&#9679;</StyledRequiredMark>}\n </StyledTabButton>\n );\n });\n }, [\n tabs,\n actualActiveTab,\n isDSMobile,\n fixedTabsHeaders,\n type,\n withCarousel,\n showSeparator,\n tabsRefAsArray,\n focusableTabsRef,\n tabsRef,\n firstSubtabInternalRef,\n lastTabInternalRef,\n handleOnTabChange,\n updateIndicatorStyle,\n carouselOnlyListRef,\n handleOnKeyDown,\n ]);\n\n if (type === TabTypes.SUBTABS && !isDSMobile) {\n return (\n <StyledSubTabsList\n withCarousel={withCarousel}\n data-testid={DSTabsDatatestid.SUB_TAB_LIST}\n ref={tabsListRef}\n role=\"tablist\"\n >\n {withCarousel ? <Carousel>{renderTabs}</Carousel> : renderTabs}\n </StyledSubTabsList>\n );\n }\n\n return (\n <StyledTabList\n withCarousel={withCarousel}\n ref={tabsListRef}\n role=\"tablist\"\n data-testid={DSTabsDatatestid.TAB_LIST}\n isDSMobile={isDSMobile}\n fixedTabsHeaders={fixedTabsHeaders}\n mobileGradients={mobileGradients}\n onScroll={updateMobileGradients}\n indicatorStyle={indicatorStyle}\n tabType={type}\n >\n <StyledTabWrapper isDSMobile={isDSMobile} fixedTabsHeaders={fixedTabsHeaders}>\n {!isDSMobile && withCarousel ? (\n <Carousel updateIndicatorStyle={updateIndicatorStyle}>{renderTabs}</Carousel>\n ) : (\n renderTabs\n )}\n </StyledTabWrapper>\n <StyledSelectionIndicator isDSMobile={isDSMobile} tabType={type} />\n </StyledTabList>\n );\n};\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA;AACA;AACA;AACA;AACA;AACA;AAGO,MAAM,SAAS,MAAmB;AACvC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,MAAM,kBAAkB,cAAc,YAAY,eAAe,UAAU;AAAA,MAClF,WAAW;AAEf,QAAM,EAAE,oBAAoB,2BAA2B,WAAW;AAClE,QAAM,EAAE,sBAAsB;AAC9B,QAAM,EAAE,oBAAoB;AAE5B,QAAM,EAAE,gBAAgB,iBAAiB,uBAAuB,yBAAyB;AAEzF,QAAM,aAAgC,QAAQ,MAAM;AAClD,UAAM,sBAAgC;AAEtC,WAAO,OAAM,SAAS,IAAI,MAAM,CAAC,KAAiD,UAAU;AAC1F,YAAM,EAAE,QAAQ,IAAI,QAAQ,IAAI,OAAO,WAAW,OAAO,WAAW,OAAO,KAAK,SAAS,cAAc,IAAI;AAC3G,UAAI,CAAC;AAAU,4BAAoB,KAAK;AACxC,aACE,qCAAC,iBAAD;AAAA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ExC;AAAA,SAEC,OACA,YAAY,qCAAC,oBAAD,MAAoB;AAAA;AAAA,KAItC;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGF,MAAI,SAAS,SAAS,WAAW,CAAC,YAAY;AAC5C,WACE,qCAAC,mBAAD;AAAA,MACE;AAAA,MACA,eAAa,iBAAiB;AAAA,MAC9B,KAAK;AAAA,MACL,MAAK;AAAA,OAEJ,eAAe,qCAAC,UAAD,MAAW,cAAyB;AAAA;AAK1D,SACE,qCAAC,eAAD;AAAA,IACE;AAAA,IACA,KAAK;AAAA,IACL,MAAK;AAAA,IACL,eAAa,iBAAiB;AAAA,IAC9B;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,SAAS;AAAA,KAET,qCAAC,kBAAD;AAAA,IAAkB;AAAA,IAAwB;AAAA,KACvC,CAAC,cAAc,eACd,qCAAC,UAAD;AAAA,IAAU;AAAA,KAA6C,cAEvD,aAGJ,qCAAC,0BAAD;AAAA,IAA0B;AAAA,IAAwB,SAAS;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,265 @@
1
+ import * as React from "react";
2
+ import styled from "styled-components";
3
+ import { safariAndFirefoxBold, onlySafariAndFirefox, css } from "@elliemae/ds-system";
4
+ import { TabTypes } from "../../utils/constants";
5
+ const StyledSelectionIndicator = styled.div`
6
+ position: absolute;
7
+ height: 3px;
8
+ top: ${({ tabType, isDSMobile }) => {
9
+ if (isDSMobile)
10
+ return `35px`;
11
+ if (tabType === TabTypes.NORMAL_SMALL)
12
+ return `15px`;
13
+ return `25px`;
14
+ }};
15
+ margin-top: ${({ theme }) => theme.space.xxxs};
16
+ pointer-events: none;
17
+ transition: 200ms cubic-bezier(0.36, 0, 1, 1);
18
+ z-index: 10;
19
+ ${({ isDSMobile }) => isDSMobile ? `
20
+ margin-left: 0;
21
+ margin-top: 3px;
22
+ ` : ``}
23
+ `;
24
+ const mobileGradientsSettings = css`
25
+ ${({ theme, mobileGradients, isDSMobile, fixedTabsHeaders }) => {
26
+ if (isDSMobile && !fixedTabsHeaders) {
27
+ if (mobileGradients.right && mobileGradients.left)
28
+ return `background: linear-gradient(90deg, rgba(238,238,238,0) 0%, ${theme.colors.brand[200]} 20%, ${theme.colors.brand[200]} 80%, rgba(238,238,238,0) 100%);`;
29
+ if (mobileGradients.right)
30
+ return `background: linear-gradient(90deg, ${theme.colors.brand[200]} 0%, ${theme.colors.brand[200]} 80%, rgba(238,238,238,0) 100%);`;
31
+ if (mobileGradients.left)
32
+ return `background: linear-gradient(90deg, rgba(238,238,238,0) 0%, ${theme.colors.brand[200]} 20%, ${theme.colors.brand[200]} 100%);`;
33
+ }
34
+ return ``;
35
+ }}
36
+ `;
37
+ const StyledTabWrapper = styled.div`
38
+ display: flex;
39
+ flex: 1;
40
+ flex-wrap: nowrap;
41
+ ${({ fixedTabsHeaders, isDSMobile }) => !fixedTabsHeaders && isDSMobile ? "" : "overflow-x: hidden;"}
42
+ ${({ theme, isDSMobile }) => isDSMobile ? `border-bottom: 1px solid ${theme.colors.brand[300]};` : ``}
43
+ `;
44
+ const StyledTabButton = styled.button`
45
+ position: relative;
46
+ background-color: transparent;
47
+ border: none;
48
+ cursor: pointer;
49
+ transition: 100ms cubic-bezier(0, 0, 0.42, 1);
50
+ text-transform: ${({ tabType }) => tabType === TabTypes.SUBTABS ? `capitalize` : `uppercase`};
51
+ letter-spacing: 0px;
52
+ white-space: nowrap;
53
+ padding: 2px 0;
54
+ margin-right: ${({ fixedTabsHeaders, isDSMobile }) => {
55
+ if (fixedTabsHeaders)
56
+ return "0px";
57
+ if (!fixedTabsHeaders && isDSMobile)
58
+ return "14px";
59
+ return "16px";
60
+ }};
61
+
62
+ margin-left: ${({ fixedTabsHeaders, isDSMobile }) => {
63
+ if (fixedTabsHeaders)
64
+ return "0px";
65
+ if (!fixedTabsHeaders && isDSMobile)
66
+ return "14px";
67
+ return "16px";
68
+ }};
69
+
70
+ color: ${({ theme }) => theme.colors.neutral[700]};
71
+ ${onlySafariAndFirefox("-webkit-text-stroke: 0.4px transparent;")}
72
+
73
+ ${({ tabType }) => tabType === TabTypes.NORMAL ? `height: 32px;` : `height: 22px;`}
74
+
75
+ ${({ theme, isActive, disabled }) => isActive && !disabled ? `
76
+ font-weight: ${theme.fontWeights.semibold};
77
+ ${safariAndFirefoxBold(`#353C46`)}
78
+
79
+ &:hover {
80
+ ${safariAndFirefoxBold(`#1E79C2`)}
81
+ }
82
+
83
+ ` : `
84
+
85
+ `}
86
+
87
+ ${({ theme, disabled }) => disabled ? `
88
+ color: ${theme.colors.neutral[500]};
89
+ cursor: not-allowed;
90
+ ` : `
91
+ &:hover {
92
+ color: ${theme.colors.brand[600]};
93
+ }
94
+ `}
95
+
96
+
97
+ ${({ theme, showSeparator, tabType }) => showSeparator ? `
98
+ &:not(:last-of-type):before
99
+ {
100
+ content: "";
101
+ position: absolute;
102
+ width: 1px;
103
+ right: -16px;
104
+ top: 50%;
105
+ transform: translateY(-50%);
106
+ height: ${tabType === TabTypes.SUBTABS ? `10px` : `16px`};
107
+ background: ${theme.colors.neutral[400]};
108
+ }` : ``}
109
+
110
+ ${({ theme, isDSMobile, tabType, isActive }) => !isDSMobile ? `
111
+ &:focus {
112
+ outline: none;
113
+ &:after {
114
+ position: absolute;
115
+ content: '';
116
+ top: 0;
117
+ left: -16px;
118
+ width: calc(100% + 32px);
119
+ height: 100%;
120
+ z-index: 5;
121
+ border-radius: 2px;
122
+ border: 2px solid ${theme.colors.brand[700]};
123
+ }
124
+
125
+ ${tabType !== TabTypes.SUBTABS && isActive ? `
126
+ &:before {
127
+ position: absolute;
128
+ content: '';
129
+ left: -16px;
130
+ right: 0;
131
+ top: calc(100% - 2px);
132
+ transform: none;
133
+ width: calc(100% + 32px);
134
+ height: 2px;
135
+ z-index: 10;
136
+ background: linear-gradient(to right, transparent 0px, transparent 12px, white 12px, white 16px, transparent 16px,transparent calc(100% - 16px), white calc(100% - 16px), white calc(100% - 12px), transparent calc(100% - 12px), transparent 100%);
137
+ }
138
+ ` : ``}
139
+ }
140
+
141
+ ` : ``}
142
+
143
+
144
+
145
+ ${({ theme, isActive, disabled, isDSMobile }) => isDSMobile ? `
146
+ height: 40px;
147
+ color: ${theme.colors.brand[600]};
148
+ font-weight: ${theme.fontWeights.regular};
149
+ padding: 0;
150
+ font-size: 13px;
151
+ line-height: 1.3;
152
+ ${onlySafariAndFirefox("-webkit-text-stroke: 0.4px transparent;")}
153
+
154
+ &:focus {
155
+ font-weight: ${theme.fontWeights.regular};
156
+ font-size: 13px;
157
+ ${safariAndFirefoxBold("#006AA9")}
158
+ }
159
+
160
+ ${isActive ? `
161
+ font-weight: ${theme.fontWeights.regular};
162
+ font-size: 13px;
163
+ ${safariAndFirefoxBold("#006AA9")}
164
+ ` : ``}
165
+
166
+ ${isActive && !disabled ? `
167
+ font-size: 13px;
168
+ color: ${theme.colors.brand[700]};
169
+ line-height: 1.3;
170
+ font-weight: ${theme.fontWeights.regular};
171
+ -webkit-font-smoothing: subpixel-antialiased;
172
+ -webkit-text-stroke: 0.4px ${theme.colors.brand[700]};` : ``}
173
+
174
+ ${!disabled ? `
175
+ &:hover,
176
+ &:focus {
177
+ outline: none;
178
+ color: ${theme.colors.brand[700]};
179
+ ${safariAndFirefoxBold("#006AA9")}
180
+ }` : ``}
181
+
182
+ ` : ``}
183
+ `;
184
+ const StyledSubTabsList = styled.div`
185
+ position: relative;
186
+ display: flex;
187
+ flex-wrap: nowrap;
188
+ flex: 1;
189
+ width: 100%;
190
+ ${({ withCarousel }) => withCarousel ? "max-width: 100%;" : ""}
191
+ `;
192
+ const StyledTabList = styled.div`
193
+ position: relative;
194
+ display: flex;
195
+ flex-wrap: nowrap;
196
+ flex: 1;
197
+ width: 100%;
198
+ ${({ withCarousel, isDSMobile }) => withCarousel && !isDSMobile ? `max-width: 100%;` : ""}
199
+
200
+ ${({ theme, isDSMobile, tabType }) => tabType !== TabTypes.NORMAL_SMALL && !isDSMobile ? `
201
+ &:after {
202
+ content: '';
203
+ position: absolute;
204
+ width: 100%;
205
+ height: 1px;
206
+ box-shadow: 0px 0px 0px 1px ${theme.colors.neutral[400]};
207
+ pointer-events: none;
208
+ bottom: 0px;
209
+ }
210
+ ` : ``}
211
+
212
+ ${StyledTabButton} {
213
+ padding-bottom: 0;
214
+ padding-top: 0;
215
+ }
216
+
217
+ ${({ theme, isDSMobile }) => isDSMobile ? `
218
+
219
+ background: ${theme.colors.brand[200]};` : ``}
220
+
221
+ ${mobileGradientsSettings}
222
+
223
+
224
+ ${({ isDSMobile, fixedTabsHeaders }) => isDSMobile ? `
225
+ ${!fixedTabsHeaders ? `
226
+ z-index: 0;
227
+ overflow-x: auto;
228
+ overflow-y: hidden;
229
+ scrollbar-width: thin;
230
+ &::-webkit-scrollbar {
231
+ display: none;
232
+ }` : `
233
+ display: flex;
234
+ ${StyledTabButton} {
235
+ flex: 1;
236
+ overflow-x: hidden;
237
+ }`}` : ``}
238
+
239
+ ${StyledSelectionIndicator} {
240
+ ${({ indicatorStyle }) => `
241
+ width: ${indicatorStyle.width};
242
+ left: ${indicatorStyle.left};
243
+ `}
244
+ }
245
+
246
+ ${StyledSelectionIndicator} {
247
+ background: ${({ theme, indicatorStyle, isDSMobile }) => !isDSMobile ? indicatorStyle.backgroundWithTransparent : theme.colors.brand[600]};
248
+ }
249
+ `;
250
+ const StyledRequiredMark = styled.span`
251
+ color: ${({ theme }) => theme.colors.danger[900]};
252
+ font-size: 6px;
253
+ margin-left: 2px;
254
+ position: absolute;
255
+ top: 5px;
256
+ `;
257
+ export {
258
+ StyledRequiredMark,
259
+ StyledSelectionIndicator,
260
+ StyledSubTabsList,
261
+ StyledTabButton,
262
+ StyledTabList,
263
+ StyledTabWrapper
264
+ };
265
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/tabBar/styles.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { safariAndFirefoxBold, onlySafariAndFirefox, css } from '@elliemae/ds-system';\nimport { TabTypes } from '../../utils/constants';\nimport type {\n StyledSelectionIndicatoPropsT,\n StyledSubTabsListPropsT,\n StyledTabListPropsT,\n StyledTabButtonPropsT,\n StyledTabWrapperPropsT,\n} from '../../DSTabsTypes';\n\nexport const StyledSelectionIndicator = styled.div<StyledSelectionIndicatoPropsT>`\n position: absolute;\n height: 3px;\n top: ${({ tabType, isDSMobile }) => {\n if (isDSMobile) return `35px`;\n if (tabType === TabTypes.NORMAL_SMALL) return `15px`;\n return `25px`;\n }};\n margin-top: ${({ theme }) => theme.space.xxxs};\n pointer-events: none;\n transition: 200ms cubic-bezier(0.36, 0, 1, 1);\n z-index: 10;\n ${({ isDSMobile }) =>\n isDSMobile\n ? ` \n margin-left: 0;\n margin-top: 3px;\n `\n : ``}\n`;\n\nconst mobileGradientsSettings = css<StyledTabListPropsT>`\n ${({ theme, mobileGradients, isDSMobile, fixedTabsHeaders }) => {\n if (isDSMobile && !fixedTabsHeaders) {\n if (mobileGradients.right && mobileGradients.left)\n return `background: linear-gradient(90deg, rgba(238,238,238,0) 0%, ${theme.colors.brand[200]} 20%, ${theme.colors.brand[200]} 80%, rgba(238,238,238,0) 100%);`;\n if (mobileGradients.right)\n return `background: linear-gradient(90deg, ${theme.colors.brand[200]} 0%, ${theme.colors.brand[200]} 80%, rgba(238,238,238,0) 100%);`;\n if (mobileGradients.left)\n return `background: linear-gradient(90deg, rgba(238,238,238,0) 0%, ${theme.colors.brand[200]} 20%, ${theme.colors.brand[200]} 100%);`;\n }\n return ``;\n }}\n`;\n\nexport const StyledTabWrapper = styled.div<StyledTabWrapperPropsT>`\n display: flex;\n flex: 1;\n flex-wrap: nowrap;\n ${({ fixedTabsHeaders, isDSMobile }) => (!fixedTabsHeaders && isDSMobile ? '' : 'overflow-x: hidden;')}\n ${({ theme, isDSMobile }) => (isDSMobile ? `border-bottom: 1px solid ${theme.colors.brand[300]};` : ``)}\n`;\n\nexport const StyledTabButton = styled.button<StyledTabButtonPropsT>`\n position: relative;\n background-color: transparent;\n border: none;\n cursor: pointer;\n transition: 100ms cubic-bezier(0, 0, 0.42, 1);\n text-transform: ${({ tabType }) => (tabType === TabTypes.SUBTABS ? `capitalize` : `uppercase`)};\n letter-spacing: 0px;\n white-space: nowrap;\n padding: 2px 0;\n margin-right: ${({ fixedTabsHeaders, isDSMobile }) => {\n if (fixedTabsHeaders) return '0px';\n if (!fixedTabsHeaders && isDSMobile) return '14px';\n return '16px';\n }};\n\n margin-left: ${({ fixedTabsHeaders, isDSMobile }) => {\n if (fixedTabsHeaders) return '0px';\n if (!fixedTabsHeaders && isDSMobile) return '14px';\n return '16px';\n }};\n\n color: ${({ theme }) => theme.colors.neutral[700]};\n ${onlySafariAndFirefox('-webkit-text-stroke: 0.4px transparent;')}\n\n ${({ tabType }) => (tabType === TabTypes.NORMAL ? `height: 32px;` : `height: 22px;`)}\n\n ${({ theme, isActive, disabled }) =>\n isActive && !disabled\n ? `\n font-weight: ${theme.fontWeights.semibold};\n ${safariAndFirefoxBold(`#353C46`)}\n\n &:hover {\n ${safariAndFirefoxBold(`#1E79C2`)}\n }\n \n `\n : `\n \n `}\n\n ${({ theme, disabled }) =>\n disabled\n ? `\n color: ${theme.colors.neutral[500]};\n cursor: not-allowed;\n `\n : `\n &:hover {\n color: ${theme.colors.brand[600]};\n }\n `}\n\n\n ${({ theme, showSeparator, tabType }) =>\n showSeparator\n ? `\n &:not(:last-of-type):before\n {\n content: \"\";\n position: absolute;\n width: 1px;\n right: -16px;\n top: 50%;\n transform: translateY(-50%);\n height: ${tabType === TabTypes.SUBTABS ? `10px` : `16px`};\n background: ${theme.colors.neutral[400]};\n }`\n : ``}\n\n ${({ theme, isDSMobile, tabType, isActive }) =>\n !isDSMobile\n ? `\n &:focus {\n outline: none;\n &:after {\n position: absolute;\n content: '';\n top: 0;\n left: -16px;\n width: calc(100% + 32px);\n height: 100%;\n z-index: 5;\n border-radius: 2px;\n border: 2px solid ${theme.colors.brand[700]};\n }\n\n ${\n tabType !== TabTypes.SUBTABS && isActive\n ? `\n &:before {\n position: absolute;\n content: '';\n left: -16px;\n right: 0;\n top: calc(100% - 2px);\n transform: none;\n width: calc(100% + 32px);\n height: 2px;\n z-index: 10;\n background: linear-gradient(to right, transparent 0px, transparent 12px, white 12px, white 16px, transparent 16px,transparent calc(100% - 16px), white calc(100% - 16px), white calc(100% - 12px), transparent calc(100% - 12px), transparent 100%);\n }\n `\n : ``\n }\n }\n \n `\n : ``}\n\n \n \n${({ theme, isActive, disabled, isDSMobile }) =>\n isDSMobile\n ? `\n height: 40px;\n color: ${theme.colors.brand[600]};\n font-weight: ${theme.fontWeights.regular};\n padding: 0;\n font-size: 13px;\n line-height: 1.3;\n ${onlySafariAndFirefox('-webkit-text-stroke: 0.4px transparent;')} \n\n &:focus {\n font-weight: ${theme.fontWeights.regular};\n font-size: 13px;\n ${safariAndFirefoxBold('#006AA9')}\n }\n\n ${\n isActive\n ? `\n font-weight: ${theme.fontWeights.regular};\n font-size: 13px;\n ${safariAndFirefoxBold('#006AA9')}\n `\n : ``\n }\n\n ${\n isActive && !disabled\n ? `\n font-size: 13px;\n color: ${theme.colors.brand[700]};\n line-height: 1.3;\n font-weight: ${theme.fontWeights.regular};\n -webkit-font-smoothing: subpixel-antialiased; \n -webkit-text-stroke: 0.4px ${theme.colors.brand[700]};`\n : ``\n }\n\n ${\n !disabled\n ? `\n &:hover,\n &:focus {\n outline: none;\n color: ${theme.colors.brand[700]};\n ${safariAndFirefoxBold('#006AA9')}\n }`\n : ``\n }\n\n `\n : ``}\n`;\n\nexport const StyledSubTabsList = styled.div<StyledSubTabsListPropsT>`\n position: relative;\n display: flex;\n flex-wrap: nowrap;\n flex: 1;\n width: 100%;\n ${({ withCarousel }) => (withCarousel ? 'max-width: 100%;' : '')}\n`;\n\nexport const StyledTabList = styled.div<StyledTabListPropsT>`\n position: relative;\n display: flex;\n flex-wrap: nowrap;\n flex: 1;\n width: 100%;\n ${({ withCarousel, isDSMobile }) => (withCarousel && !isDSMobile ? `max-width: 100%;` : '')}\n\n ${({ theme, isDSMobile, tabType }) =>\n tabType !== TabTypes.NORMAL_SMALL && !isDSMobile\n ? `\n &:after {\n content: '';\n position: absolute;\n width: 100%;\n height: 1px;\n box-shadow: 0px 0px 0px 1px ${theme.colors.neutral[400]};\n pointer-events: none;\n bottom: 0px;\n }\n `\n : ``}\n\n ${StyledTabButton} {\n padding-bottom: 0;\n padding-top: 0;\n }\n\n ${({ theme, isDSMobile }) =>\n isDSMobile\n ? `\n \n background: ${theme.colors.brand[200]};`\n : ``}\n\n ${mobileGradientsSettings}\n\n\n ${({ isDSMobile, fixedTabsHeaders }) =>\n isDSMobile\n ? `\n ${\n !fixedTabsHeaders\n ? `\n z-index: 0;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: thin;\n &::-webkit-scrollbar {\n display: none;\n }`\n : `\n display: flex;\n ${StyledTabButton} {\n flex: 1;\n overflow-x: hidden;\n }`\n }`\n : ``}\n\n ${StyledSelectionIndicator} {\n ${({ indicatorStyle }) => `\n width: ${indicatorStyle.width};\n left: ${indicatorStyle.left};\n `}\n }\n\n ${StyledSelectionIndicator} {\n background: ${({ theme, indicatorStyle, isDSMobile }) =>\n !isDSMobile ? indicatorStyle.backgroundWithTransparent : theme.colors.brand[600]};\n }\n`;\n\nexport const StyledRequiredMark = styled.span`\n color: ${({ theme }) => theme.colors.danger[900]};\n font-size: 6px;\n margin-left: 2px;\n position: absolute;\n top: 5px;\n`;\n"],
5
+ "mappings": "AAAA;ACEA;AACA;AACA;AASO,MAAM,2BAA2B,OAAO;AA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,IAI3B;AAAA,kBACc,CAAC,EAAE,OAAO,gBAAgB,iBACtC,CAAC,aAAa,eAAe,4BAA4B,MAAM,OAAO,MAAM;AAAA;AAAA;AAI3E,MAAM,qBAAqB,OAAO;AAAA,WAC9B,CAAC,EAAE,YAAY,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,57 +1,41 @@
1
- import 'core-js/modules/web.dom-collections.iterator.js';
2
- import { useContext, useState, useCallback, useLayoutEffect } from 'react';
3
- import useResizeObserver from '@react-hook/resize-observer';
4
- import { isElementVisible, shouldHaveLeftGradient, shouldHaveRightGradient } from '../../utils/helpers.js';
5
- import { DSTabsContext } from '../../DSTabsCTX.js';
6
- import { defaultIndicatorStyles } from '../../utils/constants.js';
7
-
1
+ import * as React from "react";
2
+ import { useCallback, useLayoutEffect, useState, useContext } from "react";
3
+ import useResizeObserver from "@react-hook/resize-observer";
4
+ import { isElementVisible, shouldHaveLeftGradient, shouldHaveRightGradient } from "../../utils/helpers";
5
+ import { DSTabsContext } from "../../DSTabsCTX";
6
+ import { defaultIndicatorStyles } from "../../utils/constants";
8
7
  const useTabBar = () => {
9
8
  const {
10
9
  actualActiveTab,
11
10
  actualActiveTabRef,
12
11
  tabsListRef,
13
- props: {
14
- showSelectionIndicator,
15
- isDSMobile,
16
- fixedTabsHeaders
17
- }
12
+ props: { showSelectionIndicator, isDSMobile, fixedTabsHeaders }
18
13
  } = useContext(DSTabsContext);
19
- const [mobileGradients, setMobileGradients] = useState({
20
- left: false,
21
- right: false
22
- });
14
+ const [mobileGradients, setMobileGradients] = useState({ left: false, right: false });
23
15
  const [indicatorStyle, setIndicatorStyle] = useState(defaultIndicatorStyles);
24
16
  const getIndicatorStyles = useCallback(() => {
25
17
  if (tabsListRef.current) {
26
18
  const tabList = tabsListRef.current;
27
19
  const activeTabButton = actualActiveTabRef.current;
28
- if (!activeTabButton || !isElementVisible(activeTabButton, tabList)) return defaultIndicatorStyles; // The missingMargins are to make the selection indicator white marks work properly in desktop, we need
29
- // the full width of the tab button with margins.
30
-
20
+ if (!activeTabButton || !isElementVisible(activeTabButton, tabList))
21
+ return defaultIndicatorStyles;
31
22
  const missingMargins = isDSMobile ? 0 : 16;
32
- const tabClientWidth = isDSMobile && !fixedTabsHeaders ? activeTabButton.clientWidth : activeTabButton.clientWidth + missingMargins * 2; // The reason why we use the tabList.scrollLeft is due to the centerOnTabChange (only in Mobile and FlexibleTabs)
33
- // behavior that adds scroll to the tabList
34
-
23
+ const tabClientWidth = isDSMobile && !fixedTabsHeaders ? activeTabButton.clientWidth : activeTabButton.clientWidth + missingMargins * 2;
35
24
  const position = isDSMobile && !fixedTabsHeaders ? activeTabButton.getBoundingClientRect().left - tabList.getBoundingClientRect().left + tabList.scrollLeft : activeTabButton.getBoundingClientRect().left - tabList.getBoundingClientRect().left - missingMargins;
36
- const backgroundWithTransparent = "linear-gradient(to right, transparent 0px, transparent 16px, #1E79C2 16px, #1E79C2 ".concat(tabClientWidth - 16, "px,transparent ").concat(tabClientWidth - 16, "px,transparent ").concat(tabClientWidth, "px )");
25
+ const backgroundWithTransparent = `linear-gradient(to right, transparent 0px, transparent 16px, #1E79C2 16px, #1E79C2 ${tabClientWidth - 16}px,transparent ${tabClientWidth - 16}px,transparent ${tabClientWidth}px )`;
37
26
  return {
38
- left: "".concat(position, "px"),
39
- width: "".concat(tabClientWidth, "px"),
27
+ left: `${position}px`,
28
+ width: `${tabClientWidth}px`,
40
29
  backgroundWithTransparent
41
30
  };
42
31
  }
43
-
44
32
  return defaultIndicatorStyles;
45
33
  }, [actualActiveTabRef, fixedTabsHeaders, isDSMobile, tabsListRef]);
46
34
  const updateIndicatorStyle = useCallback(() => setTimeout(() => setIndicatorStyle(getIndicatorStyles()), 100), [getIndicatorStyles, setIndicatorStyle]);
47
35
  useResizeObserver(tabsListRef, updateIndicatorStyle);
48
36
  const updateMobileGradients = useCallback(() => {
49
37
  if (tabsListRef.current && isDSMobile && !fixedTabsHeaders) {
50
- const {
51
- scrollLeft,
52
- scrollWidth,
53
- clientWidth
54
- } = tabsListRef.current;
38
+ const { scrollLeft, scrollWidth, clientWidth } = tabsListRef.current;
55
39
  setMobileGradients({
56
40
  left: shouldHaveLeftGradient(scrollLeft),
57
41
  right: shouldHaveRightGradient(scrollLeft, clientWidth, scrollWidth)
@@ -62,11 +46,17 @@ const useTabBar = () => {
62
46
  if (showSelectionIndicator) {
63
47
  updateIndicatorStyle();
64
48
  }
65
-
66
49
  if (isDSMobile && !fixedTabsHeaders) {
67
50
  updateMobileGradients();
68
51
  }
69
- }, [updateMobileGradients, showSelectionIndicator, updateIndicatorStyle, isDSMobile, fixedTabsHeaders, actualActiveTab]);
52
+ }, [
53
+ updateMobileGradients,
54
+ showSelectionIndicator,
55
+ updateIndicatorStyle,
56
+ isDSMobile,
57
+ fixedTabsHeaders,
58
+ actualActiveTab
59
+ ]);
70
60
  return {
71
61
  updateIndicatorStyle,
72
62
  setIndicatorStyle,
@@ -75,5 +65,7 @@ const useTabBar = () => {
75
65
  updateMobileGradients
76
66
  };
77
67
  };
78
-
79
- export { useTabBar };
68
+ export {
69
+ useTabBar
70
+ };
71
+ //# sourceMappingURL=useTabBar.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/tabBar/useTabBar.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\nimport { useCallback, useLayoutEffect, useState, useContext } from 'react';\nimport useResizeObserver from '@react-hook/resize-observer';\nimport { isElementVisible, shouldHaveLeftGradient, shouldHaveRightGradient } from '../../utils/helpers';\nimport { DSTabsContext } from '../../DSTabsCTX';\nimport { defaultIndicatorStyles } from '../../utils/constants';\nimport type { IndicatorStyleT, MobileGradientsT, UseTabBarReturnTypeT } from '../../DSTabsTypes';\n\nexport const useTabBar = (): UseTabBarReturnTypeT => {\n const {\n actualActiveTab,\n actualActiveTabRef,\n tabsListRef,\n props: { showSelectionIndicator, isDSMobile, fixedTabsHeaders },\n } = useContext(DSTabsContext);\n\n const [mobileGradients, setMobileGradients] = useState<MobileGradientsT>({ left: false, right: false });\n const [indicatorStyle, setIndicatorStyle] = useState<IndicatorStyleT>(defaultIndicatorStyles);\n\n const getIndicatorStyles = useCallback(() => {\n if (tabsListRef.current) {\n const tabList = tabsListRef.current;\n const activeTabButton = actualActiveTabRef.current;\n\n if (!activeTabButton || !isElementVisible(activeTabButton, tabList)) return defaultIndicatorStyles;\n\n // The missingMargins are to make the selection indicator white marks work properly in desktop, we need\n // the full width of the tab button with margins.\n const missingMargins = isDSMobile ? 0 : 16;\n\n const tabClientWidth =\n isDSMobile && !fixedTabsHeaders\n ? activeTabButton.clientWidth\n : activeTabButton.clientWidth + missingMargins * 2;\n\n // The reason why we use the tabList.scrollLeft is due to the centerOnTabChange (only in Mobile and FlexibleTabs)\n // behavior that adds scroll to the tabList\n const position =\n isDSMobile && !fixedTabsHeaders\n ? activeTabButton.getBoundingClientRect().left - tabList.getBoundingClientRect().left + tabList.scrollLeft\n : activeTabButton.getBoundingClientRect().left - tabList.getBoundingClientRect().left - missingMargins;\n\n const backgroundWithTransparent = `linear-gradient(to right, transparent 0px, transparent 16px, #1E79C2 16px, #1E79C2 ${\n tabClientWidth - 16\n }px,transparent ${tabClientWidth - 16}px,transparent ${tabClientWidth}px )`;\n\n return {\n left: `${position}px`,\n width: `${tabClientWidth}px`,\n backgroundWithTransparent,\n };\n }\n return defaultIndicatorStyles;\n }, [actualActiveTabRef, fixedTabsHeaders, isDSMobile, tabsListRef]);\n\n const updateIndicatorStyle = useCallback(\n () => setTimeout(() => setIndicatorStyle(getIndicatorStyles()), 100),\n [getIndicatorStyles, setIndicatorStyle],\n );\n\n useResizeObserver(tabsListRef, updateIndicatorStyle);\n\n const updateMobileGradients = useCallback(() => {\n if (tabsListRef.current && isDSMobile && !fixedTabsHeaders) {\n const { scrollLeft, scrollWidth, clientWidth } = tabsListRef.current;\n setMobileGradients({\n left: shouldHaveLeftGradient(scrollLeft),\n right: shouldHaveRightGradient(scrollLeft, clientWidth, scrollWidth),\n });\n }\n }, [fixedTabsHeaders, isDSMobile, tabsListRef]);\n\n useLayoutEffect(() => {\n if (showSelectionIndicator) {\n updateIndicatorStyle();\n }\n if (isDSMobile && !fixedTabsHeaders) {\n updateMobileGradients();\n }\n }, [\n updateMobileGradients,\n showSelectionIndicator,\n updateIndicatorStyle,\n isDSMobile,\n fixedTabsHeaders,\n actualActiveTab,\n ]);\n\n return {\n updateIndicatorStyle,\n setIndicatorStyle,\n indicatorStyle,\n mobileGradients,\n updateMobileGradients,\n };\n};\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AAGO,MAAM,YAAY,MAA4B;AACnD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,wBAAwB,YAAY;AAAA,MAC3C,WAAW;AAEf,QAAM,CAAC,iBAAiB,sBAAsB,SAA2B,EAAE,MAAM,OAAO,OAAO;AAC/F,QAAM,CAAC,gBAAgB,qBAAqB,SAA0B;AAEtE,QAAM,qBAAqB,YAAY,MAAM;AAC3C,QAAI,YAAY,SAAS;AACvB,YAAM,UAAU,YAAY;AAC5B,YAAM,kBAAkB,mBAAmB;AAE3C,UAAI,CAAC,mBAAmB,CAAC,iBAAiB,iBAAiB;AAAU,eAAO;AAI5E,YAAM,iBAAiB,aAAa,IAAI;AAExC,YAAM,iBACJ,cAAc,CAAC,mBACX,gBAAgB,cAChB,gBAAgB,cAAc,iBAAiB;AAIrD,YAAM,WACJ,cAAc,CAAC,mBACX,gBAAgB,wBAAwB,OAAO,QAAQ,wBAAwB,OAAO,QAAQ,aAC9F,gBAAgB,wBAAwB,OAAO,QAAQ,wBAAwB,OAAO;AAE5F,YAAM,4BAA4B,uFAChC,iBAAiB,oBACD,iBAAiB,oBAAoB;AAEvD,aAAO;AAAA,QACL,MAAM,GAAG;AAAA,QACT,OAAO,GAAG;AAAA,QACV;AAAA;AAAA;AAGJ,WAAO;AAAA,KACN,CAAC,oBAAoB,kBAAkB,YAAY;AAEtD,QAAM,uBAAuB,YAC3B,MAAM,WAAW,MAAM,kBAAkB,uBAAuB,MAChE,CAAC,oBAAoB;AAGvB,oBAAkB,aAAa;AAE/B,QAAM,wBAAwB,YAAY,MAAM;AAC9C,QAAI,YAAY,WAAW,cAAc,CAAC,kBAAkB;AAC1D,YAAM,EAAE,YAAY,aAAa,gBAAgB,YAAY;AAC7D,yBAAmB;AAAA,QACjB,MAAM,uBAAuB;AAAA,QAC7B,OAAO,wBAAwB,YAAY,aAAa;AAAA;AAAA;AAAA,KAG3D,CAAC,kBAAkB,YAAY;AAElC,kBAAgB,MAAM;AACpB,QAAI,wBAAwB;AAC1B;AAAA;AAEF,QAAI,cAAc,CAAC,kBAAkB;AACnC;AAAA;AAAA,KAED;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,42 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import * as React from "react";
21
+ import React2, { useContext } from "react";
22
+ import { TabsPanels } from "../tabsPanel/TabsPanels";
23
+ import { TabBar } from "../tabBar/TabBar";
24
+ import { StyledTabBarContainer } from "./styles";
25
+ import { DSTabsContext } from "../../DSTabsCTX";
26
+ import { DSTabsDatatestid } from "../../DSTabsDatatestid";
27
+ const TabsContent = () => {
28
+ const {
29
+ props: { containerProps, innerRef, tabsListAriaLabel, tabBarExtraContent }
30
+ } = useContext(DSTabsContext);
31
+ return /* @__PURE__ */ React2.createElement("div", __spreadProps(__spreadValues({}, containerProps), {
32
+ ref: innerRef,
33
+ "data-testid": DSTabsDatatestid.TABS_CONTAINER
34
+ }), /* @__PURE__ */ React2.createElement(StyledTabBarContainer, {
35
+ "aria-label": tabsListAriaLabel,
36
+ role: "tablist"
37
+ }, /* @__PURE__ */ React2.createElement(TabBar, null), tabBarExtraContent), /* @__PURE__ */ React2.createElement(TabsPanels, null));
38
+ };
39
+ export {
40
+ TabsContent
41
+ };
42
+ //# sourceMappingURL=TabsContent.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/tabsContent/TabsContent.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { TabsPanels } from '../tabsPanel/TabsPanels';\nimport { TabBar } from '../tabBar/TabBar';\nimport { StyledTabBarContainer } from './styles';\nimport { DSTabsContext } from '../../DSTabsCTX';\nimport { DSTabsDatatestid } from '../../DSTabsDatatestid';\n\nexport const TabsContent = (): JSX.Element => {\n const {\n props: { containerProps, innerRef, tabsListAriaLabel, tabBarExtraContent },\n } = useContext(DSTabsContext);\n\n return (\n <div {...containerProps} ref={innerRef} data-testid={DSTabsDatatestid.TABS_CONTAINER}>\n <StyledTabBarContainer aria-label={tabsListAriaLabel} role=\"tablist\">\n <TabBar />\n {tabBarExtraContent}\n </StyledTabBarContainer>\n <TabsPanels />\n </div>\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AAEO,MAAM,cAAc,MAAmB;AAC5C,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB,UAAU,mBAAmB;AAAA,MACpD,WAAW;AAEf,SACE,qCAAC,OAAD,iCAAS,iBAAT;AAAA,IAAyB,KAAK;AAAA,IAAU,eAAa,iBAAiB;AAAA,MACpE,qCAAC,uBAAD;AAAA,IAAuB,cAAY;AAAA,IAAmB,MAAK;AAAA,KACzD,qCAAC,QAAD,OACC,qBAEH,qCAAC,YAAD;AAAA;",
6
+ "names": []
7
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import styled from "styled-components";
3
+ const StyledTabBarContainer = styled.div`
4
+ display: flex;
5
+ overflow-x: hidden;
6
+ `;
7
+ export {
8
+ StyledTabBarContainer
9
+ };
10
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/tabsContent/styles.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\n\nexport const StyledTabBarContainer = styled.div`\n display: flex;\n overflow-x: hidden;\n`;\n"],
5
+ "mappings": "AAAA;ACAA;AAEO,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }