@elliemae/ds-tabs 3.53.1-rc.0 → 3.54.0-next.2
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.
- package/dist/cjs/DSTabsCTX.js +7 -1
- package/dist/cjs/DSTabsCTX.js.map +2 -2
- package/dist/cjs/{parts/tabBar → config}/useResizeObserver.js.map +1 -1
- package/dist/cjs/config/useTabs.js +105 -3
- package/dist/cjs/config/useTabs.js.map +2 -2
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/parts/carousel/Carousel.js +7 -2
- package/dist/cjs/parts/carousel/Carousel.js.map +2 -2
- package/dist/cjs/parts/carousel/styles.js +15 -2
- package/dist/cjs/parts/carousel/styles.js.map +2 -2
- package/dist/cjs/parts/tabBar/TabBar.js +15 -12
- package/dist/cjs/parts/tabBar/TabBar.js.map +2 -2
- package/dist/cjs/parts/tabBar/TabBarItemRenderer.js +9 -8
- package/dist/cjs/parts/tabBar/TabBarItemRenderer.js.map +2 -2
- package/dist/cjs/parts/tabBar/styles.js +19 -3
- package/dist/cjs/parts/tabBar/styles.js.map +2 -2
- package/dist/cjs/parts/tabsContent/TabsContent.js +5 -4
- package/dist/cjs/parts/tabsContent/TabsContent.js.map +2 -2
- package/dist/cjs/parts/tabsContent/styles.js +4 -1
- package/dist/cjs/parts/tabsContent/styles.js.map +2 -2
- package/dist/cjs/parts/tabsPanel/TabsPanels.js +16 -9
- package/dist/cjs/parts/tabsPanel/TabsPanels.js.map +2 -2
- package/dist/cjs/parts/tabsPanel/styles.js +5 -1
- package/dist/cjs/parts/tabsPanel/styles.js.map +2 -2
- package/dist/cjs/sharedTypes.js.map +1 -1
- package/dist/esm/DSTabsCTX.js +7 -1
- package/dist/esm/DSTabsCTX.js.map +2 -2
- package/dist/esm/{parts/tabBar → config}/useResizeObserver.js.map +1 -1
- package/dist/esm/config/useTabs.js +105 -3
- package/dist/esm/config/useTabs.js.map +2 -2
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/parts/carousel/Carousel.js +14 -3
- package/dist/esm/parts/carousel/Carousel.js.map +2 -2
- package/dist/esm/parts/carousel/styles.js +17 -4
- package/dist/esm/parts/carousel/styles.js.map +2 -2
- package/dist/esm/parts/tabBar/TabBar.js +15 -12
- package/dist/esm/parts/tabBar/TabBar.js.map +2 -2
- package/dist/esm/parts/tabBar/TabBarItemRenderer.js +10 -9
- package/dist/esm/parts/tabBar/TabBarItemRenderer.js.map +2 -2
- package/dist/esm/parts/tabBar/styles.js +21 -5
- package/dist/esm/parts/tabBar/styles.js.map +2 -2
- package/dist/esm/parts/tabsContent/TabsContent.js +7 -6
- package/dist/esm/parts/tabsContent/TabsContent.js.map +2 -2
- package/dist/esm/parts/tabsContent/styles.js +4 -1
- package/dist/esm/parts/tabsContent/styles.js.map +2 -2
- package/dist/esm/parts/tabsPanel/TabsPanels.js +16 -9
- package/dist/esm/parts/tabsPanel/TabsPanels.js.map +2 -2
- package/dist/esm/parts/tabsPanel/styles.js +5 -1
- package/dist/esm/parts/tabsPanel/styles.js.map +2 -2
- package/dist/types/DSTabs.d.ts +0 -1
- package/dist/types/DSTabsCTX.d.ts +0 -1
- package/dist/types/{parts/tabBar → config}/useResizeObserver.d.ts +0 -1
- package/dist/types/exported-related/DSTab.d.ts +0 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/parts/carousel/Carousel.d.ts +0 -1
- package/dist/types/parts/carousel/styles.d.ts +2 -2
- package/dist/types/parts/carousel/useCarousel.d.ts +0 -1
- package/dist/types/parts/carousel/useCarouselCallbacks.d.ts +0 -1
- package/dist/types/parts/tabBar/TabBar.d.ts +0 -1
- package/dist/types/parts/tabBar/styles.d.ts +1 -0
- package/dist/types/parts/tabsContent/TabsContent.d.ts +0 -1
- package/dist/types/parts/tabsContent/styles.d.ts +1 -0
- package/dist/types/parts/tabsPanel/TabsPanels.d.ts +0 -1
- package/dist/types/react-desc-prop-types.d.ts +0 -1
- package/dist/types/sharedTypes.d.ts +11 -1
- package/dist/types/tests/DSTabs.PUI-16477.test.d.ts +1 -0
- package/package.json +10 -9
- package/dist/cjs/parts/tabBar/useTabBar.js +0 -105
- package/dist/cjs/parts/tabBar/useTabBar.js.map +0 -7
- package/dist/cjs/utils/hooks/useTabsCallbacks.js +0 -66
- package/dist/cjs/utils/hooks/useTabsCallbacks.js.map +0 -7
- package/dist/esm/parts/tabBar/useTabBar.js +0 -75
- package/dist/esm/parts/tabBar/useTabBar.js.map +0 -7
- package/dist/esm/utils/hooks/useTabsCallbacks.js +0 -36
- package/dist/esm/utils/hooks/useTabsCallbacks.js.map +0 -7
- package/dist/types/parts/tabBar/useTabBar.d.ts +0 -11
- package/dist/types/utils/hooks/useTabsCallbacks.d.ts +0 -7
- /package/dist/cjs/{parts/tabBar → config}/useResizeObserver.js +0 -0
- /package/dist/esm/{parts/tabBar → config}/useResizeObserver.js +0 -0
|
@@ -4,7 +4,14 @@ import { useContext } from "react";
|
|
|
4
4
|
import { DSIconSizes } from "@elliemae/ds-icon";
|
|
5
5
|
import { BUTTON_TYPES } from "@elliemae/ds-button-v2";
|
|
6
6
|
import { ChevronRight, ChevronLeft } from "@elliemae/ds-icons";
|
|
7
|
-
import {
|
|
7
|
+
import { useOwnerProps } from "@elliemae/ds-props-helpers";
|
|
8
|
+
import {
|
|
9
|
+
StyledCarouselBtnLeft,
|
|
10
|
+
StyledCarouselBtnRight,
|
|
11
|
+
StyledCarouselButtonWrapper,
|
|
12
|
+
StyledCarouselWrapper,
|
|
13
|
+
StyledChildrenWrap
|
|
14
|
+
} from "./styles.js";
|
|
8
15
|
import { useCarousel } from "./useCarousel.js";
|
|
9
16
|
import { DSTabsContext } from "../../DSTabsCTX.js";
|
|
10
17
|
import { TABS_DATA_TESTID } from "../../constants/index.js";
|
|
@@ -14,11 +21,13 @@ const Carousel = ({ children, updateIndicatorStyle }) => {
|
|
|
14
21
|
});
|
|
15
22
|
const {
|
|
16
23
|
carouselOnlyListRef,
|
|
24
|
+
props,
|
|
17
25
|
props: { type }
|
|
18
26
|
} = useContext(DSTabsContext);
|
|
27
|
+
const { getOwnerProps } = useOwnerProps(props);
|
|
19
28
|
return /* @__PURE__ */ jsxs(StyledCarouselWrapper, { children: [
|
|
20
29
|
showChevrons.left && /* @__PURE__ */ jsx(StyledCarouselButtonWrapper, { tabType: type, children: /* @__PURE__ */ jsx(
|
|
21
|
-
|
|
30
|
+
StyledCarouselBtnLeft,
|
|
22
31
|
{
|
|
23
32
|
size: "s",
|
|
24
33
|
onClick: leftButtonOnClick,
|
|
@@ -26,11 +35,12 @@ const Carousel = ({ children, updateIndicatorStyle }) => {
|
|
|
26
35
|
"data-testid": TABS_DATA_TESTID.CAROUSEL_BUTTON_LEFT,
|
|
27
36
|
buttonType: BUTTON_TYPES.ICON,
|
|
28
37
|
"aria-label": "Scroll Left",
|
|
38
|
+
getOwnerProps,
|
|
29
39
|
children: /* @__PURE__ */ jsx(ChevronLeft, { size: DSIconSizes.S })
|
|
30
40
|
}
|
|
31
41
|
) }),
|
|
32
42
|
showChevrons.right && /* @__PURE__ */ jsx(StyledCarouselButtonWrapper, { tabType: type, right: showChevrons.right, children: /* @__PURE__ */ jsx(
|
|
33
|
-
|
|
43
|
+
StyledCarouselBtnRight,
|
|
34
44
|
{
|
|
35
45
|
size: "s",
|
|
36
46
|
onClick: rightButtonOnClick,
|
|
@@ -38,6 +48,7 @@ const Carousel = ({ children, updateIndicatorStyle }) => {
|
|
|
38
48
|
"data-testid": TABS_DATA_TESTID.CAROUSEL_BUTTON_RIGHT,
|
|
39
49
|
buttonType: BUTTON_TYPES.ICON,
|
|
40
50
|
"aria-label": "Scroll Right",
|
|
51
|
+
getOwnerProps,
|
|
41
52
|
children: /* @__PURE__ */ jsx(ChevronRight, { size: DSIconSizes.S })
|
|
42
53
|
}
|
|
43
54
|
) }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/carousel/Carousel.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext } from 'react';\nimport { DSIconSizes } from '@elliemae/ds-icon';\nimport { BUTTON_TYPES } from '@elliemae/ds-button-v2';\nimport { ChevronRight, ChevronLeft } from '@elliemae/ds-icons';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext } from 'react';\nimport { DSIconSizes } from '@elliemae/ds-icon';\nimport { BUTTON_TYPES } from '@elliemae/ds-button-v2';\nimport { ChevronRight, ChevronLeft } from '@elliemae/ds-icons';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport {\n StyledCarouselBtnLeft,\n StyledCarouselBtnRight,\n StyledCarouselButtonWrapper,\n StyledCarouselWrapper,\n StyledChildrenWrap,\n} from './styles.js';\nimport { useCarousel } from './useCarousel.js';\nimport { DSTabsContext } from '../../DSTabsCTX.js';\nimport { TABS_DATA_TESTID } from '../../constants/index.js';\n\ninterface CarouselPropsT {\n children: React.ReactNode;\n updateIndicatorStyle?: () => void;\n}\n\nexport const Carousel = ({ children, updateIndicatorStyle }: CarouselPropsT): JSX.Element => {\n const { showChevrons, leftButtonOnClick, rightButtonOnClick, handleOnClick, handleOnScroll } = useCarousel({\n updateIndicatorStyle,\n });\n\n const {\n carouselOnlyListRef,\n props,\n props: { type },\n } = useContext(DSTabsContext);\n\n const { getOwnerProps } = useOwnerProps(props);\n\n return (\n <StyledCarouselWrapper>\n {showChevrons.left && (\n <StyledCarouselButtonWrapper tabType={type}>\n <StyledCarouselBtnLeft\n size=\"s\"\n onClick={leftButtonOnClick}\n tabIndex={-1}\n data-testid={TABS_DATA_TESTID.CAROUSEL_BUTTON_LEFT}\n buttonType={BUTTON_TYPES.ICON}\n aria-label=\"Scroll Left\"\n getOwnerProps={getOwnerProps}\n >\n <ChevronLeft size={DSIconSizes.S} />\n </StyledCarouselBtnLeft>\n </StyledCarouselButtonWrapper>\n )}\n {showChevrons.right && (\n <StyledCarouselButtonWrapper tabType={type} right={showChevrons.right}>\n <StyledCarouselBtnRight\n size=\"s\"\n onClick={rightButtonOnClick}\n tabIndex={-1}\n data-testid={TABS_DATA_TESTID.CAROUSEL_BUTTON_RIGHT}\n buttonType={BUTTON_TYPES.ICON}\n aria-label=\"Scroll Right\"\n getOwnerProps={getOwnerProps}\n >\n <ChevronRight size={DSIconSizes.S} />\n </StyledCarouselBtnRight>\n </StyledCarouselButtonWrapper>\n )}\n <StyledChildrenWrap\n role=\"tablist\"\n innerRef={carouselOnlyListRef}\n onClick={handleOnClick}\n onScroll={handleOnScroll}\n >\n {children}\n </StyledChildrenWrap>\n </StyledCarouselWrapper>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmCnB,SAYQ,KAZR;AAnCJ,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,cAAc,mBAAmB;AAC1C,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AAO1B,MAAM,WAAW,CAAC,EAAE,UAAU,qBAAqB,MAAmC;AAC3F,QAAM,EAAE,cAAc,mBAAmB,oBAAoB,eAAe,eAAe,IAAI,YAAY;AAAA,IACzG;AAAA,EACF,CAAC;AAED,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,OAAO,EAAE,KAAK;AAAA,EAChB,IAAI,WAAW,aAAa;AAE5B,QAAM,EAAE,cAAc,IAAI,cAAc,KAAK;AAE7C,SACE,qBAAC,yBACE;AAAA,iBAAa,QACZ,oBAAC,+BAA4B,SAAS,MACpC;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,UAAU;AAAA,QACV,eAAa,iBAAiB;AAAA,QAC9B,YAAY,aAAa;AAAA,QACzB,cAAW;AAAA,QACX;AAAA,QAEA,8BAAC,eAAY,MAAM,YAAY,GAAG;AAAA;AAAA,IACpC,GACF;AAAA,IAED,aAAa,SACZ,oBAAC,+BAA4B,SAAS,MAAM,OAAO,aAAa,OAC9D;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,UAAU;AAAA,QACV,eAAa,iBAAiB;AAAA,QAC9B,YAAY,aAAa;AAAA,QACzB,cAAW;AAAA,QACX;AAAA,QAEA,8BAAC,gBAAa,MAAM,YAAY,GAAG;AAAA;AAAA,IACrC,GACF;AAAA,IAEF;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,UAAU;AAAA,QACV,SAAS;AAAA,QACT,UAAU;AAAA,QAET;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { styled } from "@elliemae/ds-system";
|
|
2
|
+
import { css, styled } from "@elliemae/ds-system";
|
|
3
3
|
import { DSButtonV2 } from "@elliemae/ds-button-v2";
|
|
4
|
-
import { TAB_TYPES } from "../../constants/index.js";
|
|
5
|
-
const
|
|
4
|
+
import { DSTabsName, TABS_SLOTS, TAB_TYPES } from "../../constants/index.js";
|
|
5
|
+
const baseCarouselButtonStyles = css`
|
|
6
6
|
margin: 0;
|
|
7
7
|
min-width: ${({ theme }) => theme.space.xs};
|
|
8
8
|
width: ${({ theme }) => theme.space.xs};
|
|
@@ -17,6 +17,18 @@ const StyledCarouselBtn = styled(DSButtonV2)`
|
|
|
17
17
|
fill: ${({ theme }) => theme.colors.brand[600]};
|
|
18
18
|
}
|
|
19
19
|
`;
|
|
20
|
+
const StyledCarouselBtnLeft = styled(DSButtonV2, {
|
|
21
|
+
name: DSTabsName,
|
|
22
|
+
slot: TABS_SLOTS.CAROUSEL_BUTTON_LEFT
|
|
23
|
+
})`
|
|
24
|
+
${baseCarouselButtonStyles}
|
|
25
|
+
`;
|
|
26
|
+
const StyledCarouselBtnRight = styled(DSButtonV2, {
|
|
27
|
+
name: DSTabsName,
|
|
28
|
+
slot: TABS_SLOTS.CAROUSEL_BUTTON_RIGHT
|
|
29
|
+
})`
|
|
30
|
+
${baseCarouselButtonStyles}
|
|
31
|
+
`;
|
|
20
32
|
const StyledCarouselWrapper = styled.span`
|
|
21
33
|
position: relative;
|
|
22
34
|
width: 100%;
|
|
@@ -42,7 +54,8 @@ const StyledCarouselButtonWrapper = styled.div`
|
|
|
42
54
|
` : ``};
|
|
43
55
|
`;
|
|
44
56
|
export {
|
|
45
|
-
|
|
57
|
+
StyledCarouselBtnLeft,
|
|
58
|
+
StyledCarouselBtnRight,
|
|
46
59
|
StyledCarouselButtonWrapper,
|
|
47
60
|
StyledCarouselWrapper,
|
|
48
61
|
StyledChildrenWrap
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/carousel/styles.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\n\nimport type { DSTabsInternalsT } from '../../sharedTypes.js';\nimport { TAB_TYPES } from '../../constants/index.js';\n\ninterface StyledCarouselButtonWrapperPropsT {\n right?: boolean;\n tabType: DSTabsInternalsT.TabTypesT;\n}\n\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { css, styled } from '@elliemae/ds-system';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\n\nimport type { DSTabsInternalsT } from '../../sharedTypes.js';\nimport { DSTabsName, TABS_SLOTS, TAB_TYPES } from '../../constants/index.js';\n\ninterface StyledCarouselButtonWrapperPropsT {\n right?: boolean;\n tabType: DSTabsInternalsT.TabTypesT;\n}\n\nconst baseCarouselButtonStyles = css`\n margin: 0;\n min-width: ${({ theme }) => theme.space.xs};\n width: ${({ theme }) => theme.space.xs};\n\n &:hover:not(:disabled) {\n background-color: transparent;\n }\n background-color: transparent;\n border-radius: 0px;\n\n & .em-ds-icon svg {\n fill: ${({ theme }) => theme.colors.brand[600]};\n }\n`;\n\nexport const StyledCarouselBtnLeft = styled(DSButtonV2, {\n name: DSTabsName,\n slot: TABS_SLOTS.CAROUSEL_BUTTON_LEFT,\n})`\n ${baseCarouselButtonStyles}\n`;\n\nexport const StyledCarouselBtnRight = styled(DSButtonV2, {\n name: DSTabsName,\n slot: TABS_SLOTS.CAROUSEL_BUTTON_RIGHT,\n})`\n ${baseCarouselButtonStyles}\n`;\n\nexport const StyledCarouselWrapper = styled.span`\n position: relative;\n width: 100%;\n display: flex;\n`;\n\nexport const StyledChildrenWrap = styled.div`\n display: flex;\n flex-wrap: nowrap;\n flex: 1;\n overflow-x: hidden;\n`;\n\nexport const StyledCarouselButtonWrapper = styled.div<StyledCarouselButtonWrapperPropsT>`\n max-width: 16px;\n position: absolute;\n z-index: 200;\n ${({ right }) => (right ? 'right: 0;' : `left: 0;`)}\n width: 16px;\n height: ${({ tabType }) => (tabType === TAB_TYPES.NORMAL ? '32px' : '22px')};\n padding-top: ${({ tabType }) => (tabType === TAB_TYPES.NORMAL ? '5px' : '0px')};\n background: white;\n ${({ theme, tabType }) =>\n tabType === TAB_TYPES.NORMAL\n ? `\n background: linear-gradient(to bottom, white 0px, white 30px, ${theme.colors.neutral[400]} 30px, ${theme.colors.neutral[400]} 31px, white 31px , white 32px );\n `\n : ``};\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,KAAK,cAAc;AAC5B,SAAS,kBAAkB;AAG3B,SAAS,YAAY,YAAY,iBAAiB;AAOlD,MAAM,2BAA2B;AAAA;AAAA,eAElB,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,EAAE;AAAA,WACjC,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAS5B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAI3C,MAAM,wBAAwB,OAAO,YAAY;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,WAAW;AACnB,CAAC;AAAA,IACG,wBAAwB;AAAA;AAGrB,MAAM,yBAAyB,OAAO,YAAY;AAAA,EACvD,MAAM;AAAA,EACN,MAAM,WAAW;AACnB,CAAC;AAAA,IACG,wBAAwB;AAAA;AAGrB,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;AAAA;AAMrC,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOlC,MAAM,8BAA8B,OAAO;AAAA;AAAA;AAAA;AAAA,IAI9C,CAAC,EAAE,MAAM,MAAO,QAAQ,cAAc,UAAW;AAAA;AAAA,YAEzC,CAAC,EAAE,QAAQ,MAAO,YAAY,UAAU,SAAS,SAAS,MAAO;AAAA,iBAC5D,CAAC,EAAE,QAAQ,MAAO,YAAY,UAAU,SAAS,QAAQ,KAAM;AAAA;AAAA,IAE5E,CAAC,EAAE,OAAO,QAAQ,MAClB,YAAY,UAAU,SAClB;AAAA,sEAC8D,MAAM,OAAO,QAAQ,GAAG,CAAC,UAAU,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,KAE1H,EAAE;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useContext } from "react";
|
|
4
|
+
import { useOwnerProps } from "@elliemae/ds-props-helpers";
|
|
4
5
|
import { Carousel } from "../carousel/Carousel.js";
|
|
5
|
-
import { useTabBar } from "./useTabBar.js";
|
|
6
6
|
import {
|
|
7
7
|
StyledMobileGradient,
|
|
8
8
|
StyledTabList,
|
|
@@ -13,18 +13,24 @@ import {
|
|
|
13
13
|
import { DSTabsContext } from "../../DSTabsCTX.js";
|
|
14
14
|
import { TABS_DATA_TESTID, TAB_TYPES } from "../../constants/index.js";
|
|
15
15
|
import { TabBarItemRenderer } from "./TabBarItemRenderer.js";
|
|
16
|
-
import { useTabsCallbacks } from "../../utils/hooks/useTabsCallbacks.js";
|
|
17
16
|
const TabBar = () => {
|
|
18
17
|
const {
|
|
19
18
|
tabsListRef,
|
|
20
|
-
props
|
|
19
|
+
props,
|
|
20
|
+
props: { type, fixedTabsHeaders, withCarousel, isDSMobile },
|
|
21
|
+
globalClickHandler,
|
|
22
|
+
indicatorStyle,
|
|
23
|
+
mobileGradients,
|
|
24
|
+
updateMobileGradients,
|
|
25
|
+
updateIndicatorStyle
|
|
21
26
|
} = useContext(DSTabsContext);
|
|
22
|
-
const {
|
|
23
|
-
const { indicatorStyle, mobileGradients, updateMobileGradients, updateIndicatorStyle } = useTabBar();
|
|
27
|
+
const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);
|
|
24
28
|
if (type === TAB_TYPES.SUBTABS && !isDSMobile) {
|
|
25
29
|
return /* @__PURE__ */ jsx(
|
|
26
30
|
StyledSubTabsList,
|
|
27
31
|
{
|
|
32
|
+
getOwnerProps,
|
|
33
|
+
getOwnerPropsArguments,
|
|
28
34
|
withCarousel,
|
|
29
35
|
"data-testid": TABS_DATA_TESTID.SUB_TAB_LIST,
|
|
30
36
|
role: withCarousel ? void 0 : "tablist",
|
|
@@ -36,6 +42,8 @@ const TabBar = () => {
|
|
|
36
42
|
return /* @__PURE__ */ jsxs(
|
|
37
43
|
StyledTabList,
|
|
38
44
|
{
|
|
45
|
+
getOwnerProps,
|
|
46
|
+
getOwnerPropsArguments,
|
|
39
47
|
withCarousel,
|
|
40
48
|
role: withCarousel ? void 0 : "tablist",
|
|
41
49
|
innerRef: tabsListRef,
|
|
@@ -46,13 +54,8 @@ const TabBar = () => {
|
|
|
46
54
|
onScroll: updateMobileGradients,
|
|
47
55
|
indicatorStyle,
|
|
48
56
|
tabType: type,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const { dataset, ariaDisabled } = target;
|
|
52
|
-
if (dataset.tabId && ariaDisabled !== "true") {
|
|
53
|
-
handleOnTabChange(dataset.tabId, e);
|
|
54
|
-
updateIndicatorStyle();
|
|
55
|
-
}
|
|
57
|
+
onClick: (e) => {
|
|
58
|
+
globalClickHandler({ event: e, target: "tabsList" });
|
|
56
59
|
},
|
|
57
60
|
children: [
|
|
58
61
|
/* @__PURE__ */ jsx(StyledTabWrapper, { "data-testid": "tab-wrapper", isDSMobile, fixedTabsHeaders, children: !isDSMobile && withCarousel ? /* @__PURE__ */ jsx(Carousel, { updateIndicatorStyle, children: /* @__PURE__ */ jsx(TabBarItemRenderer, {}) }) : /* @__PURE__ */ jsx(TabBarItemRenderer, {}) }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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, { useContext } from 'react';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { Carousel } from '../carousel/Carousel.js';\nimport {\n StyledMobileGradient,\n StyledTabList,\n StyledTabWrapper,\n StyledSelectionIndicator,\n StyledSubTabsList,\n} from './styles.js';\nimport { DSTabsContext } from '../../DSTabsCTX.js';\n\nimport { TABS_DATA_TESTID, TAB_TYPES } from '../../constants/index.js';\n\nimport { TabBarItemRenderer } from './TabBarItemRenderer.js';\n\nexport const TabBar = (): JSX.Element => {\n const {\n tabsListRef,\n props,\n props: { type, fixedTabsHeaders, withCarousel, isDSMobile },\n globalClickHandler,\n indicatorStyle,\n mobileGradients,\n updateMobileGradients,\n updateIndicatorStyle,\n } = useContext(DSTabsContext);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n if (type === TAB_TYPES.SUBTABS && !isDSMobile) {\n return (\n <StyledSubTabsList\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n withCarousel={withCarousel}\n data-testid={TABS_DATA_TESTID.SUB_TAB_LIST}\n role={withCarousel ? undefined : 'tablist'}\n innerRef={tabsListRef}\n >\n {withCarousel ? (\n <Carousel>\n <TabBarItemRenderer />\n </Carousel>\n ) : (\n <TabBarItemRenderer />\n )}\n </StyledSubTabsList>\n );\n }\n\n return (\n <StyledTabList\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n withCarousel={withCarousel}\n role={withCarousel ? undefined : 'tablist'}\n innerRef={tabsListRef}\n data-testid={TABS_DATA_TESTID.TAB_LIST}\n isDSMobile={isDSMobile}\n fixedTabsHeaders={fixedTabsHeaders}\n mobileGradients={mobileGradients}\n onScroll={updateMobileGradients}\n indicatorStyle={indicatorStyle}\n tabType={type}\n onClick={(e) => {\n globalClickHandler({ event: e, target: 'tabsList' });\n }}\n >\n <StyledTabWrapper data-testid=\"tab-wrapper\" isDSMobile={isDSMobile} fixedTabsHeaders={fixedTabsHeaders}>\n {!isDSMobile && withCarousel ? (\n <Carousel updateIndicatorStyle={updateIndicatorStyle}>\n <TabBarItemRenderer />\n </Carousel>\n ) : (\n <TabBarItemRenderer />\n )}\n </StyledTabWrapper>\n <StyledSelectionIndicator isDSMobile={isDSMobile} tabType={type} />\n {isDSMobile && !fixedTabsHeaders && (\n <StyledMobileGradient\n mobileGradients={mobileGradients}\n left={tabsListRef.current?.scrollLeft}\n width={tabsListRef.current?.scrollWidth}\n />\n )}\n </StyledTabList>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC0CX,cAUR,YAVQ;AAzCZ,SAAgB,kBAAkB;AAClC,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAE9B,SAAS,kBAAkB,iBAAiB;AAE5C,SAAS,0BAA0B;AAE5B,MAAM,SAAS,MAAmB;AACvC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,OAAO,EAAE,MAAM,kBAAkB,cAAc,WAAW;AAAA,IAC1D;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,aAAa;AAC5B,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAc,KAAK;AAErE,MAAI,SAAS,UAAU,WAAW,CAAC,YAAY;AAC7C,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAa,iBAAiB;AAAA,QAC9B,MAAM,eAAe,SAAY;AAAA,QACjC,UAAU;AAAA,QAET,yBACC,oBAAC,YACC,8BAAC,sBAAmB,GACtB,IAEA,oBAAC,sBAAmB;AAAA;AAAA,IAExB;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM,eAAe,SAAY;AAAA,MACjC,UAAU;AAAA,MACV,eAAa,iBAAiB;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA,SAAS;AAAA,MACT,SAAS,CAAC,MAAM;AACd,2BAAmB,EAAE,OAAO,GAAG,QAAQ,WAAW,CAAC;AAAA,MACrD;AAAA,MAEA;AAAA,4BAAC,oBAAiB,eAAY,eAAc,YAAwB,kBACjE,WAAC,cAAc,eACd,oBAAC,YAAS,sBACR,8BAAC,sBAAmB,GACtB,IAEA,oBAAC,sBAAmB,GAExB;AAAA,QACA,oBAAC,4BAAyB,YAAwB,SAAS,MAAM;AAAA,QAChE,cAAc,CAAC,oBACd;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,MAAM,YAAY,SAAS;AAAA,YAC3B,OAAO,YAAY,SAAS;AAAA;AAAA,QAC9B;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,12 +2,10 @@ import * as React from "react";
|
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createElement } from "react";
|
|
4
4
|
import React2, { useContext } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import { StyledTabButton, StyledRequiredMark, ScreenReaderOnly } from "./styles.js";
|
|
5
|
+
import { StyledTabButton, StyledRequiredMark, ScreenReaderOnly, StyledSubTabButton } from "./styles.js";
|
|
7
6
|
import { DSTabsContext, DSTabsCrossRefContext } from "../../DSTabsCTX.js";
|
|
8
7
|
import { useKeyboardNavigation } from "../../utils/hooks/useKeyboardNavigation.js";
|
|
9
8
|
import { centerTab } from "../../utils/helpers.js";
|
|
10
|
-
import { useTabsCallbacks } from "../../utils/hooks/useTabsCallbacks.js";
|
|
11
9
|
import { TABS_DATA_TESTID, TAB_TYPES } from "../../constants/index.js";
|
|
12
10
|
const TabBarItemRenderer = React2.memo(() => {
|
|
13
11
|
const {
|
|
@@ -16,12 +14,11 @@ const TabBarItemRenderer = React2.memo(() => {
|
|
|
16
14
|
tabsRefAsArray,
|
|
17
15
|
carouselOnlyListRef,
|
|
18
16
|
actualActiveTab,
|
|
19
|
-
props: { type, fixedTabsHeaders, withCarousel, isDSMobile, showSeparator, children: tabs }
|
|
17
|
+
props: { type, fixedTabsHeaders, withCarousel, isDSMobile, showSeparator, children: tabs },
|
|
18
|
+
globalClickHandler
|
|
20
19
|
} = useContext(DSTabsContext);
|
|
21
20
|
const { lastTabInternalRef, firstSubtabInternalRef } = useContext(DSTabsCrossRefContext);
|
|
22
|
-
const { handleOnTabChange } = useTabsCallbacks();
|
|
23
21
|
const { handleOnKeyDown } = useKeyboardNavigation();
|
|
24
|
-
const { updateIndicatorStyle } = useTabBar();
|
|
25
22
|
const availableTabIndexes = [];
|
|
26
23
|
return React2.Children.map(tabs, (tab, index) => {
|
|
27
24
|
const {
|
|
@@ -36,11 +33,16 @@ const TabBarItemRenderer = React2.memo(() => {
|
|
|
36
33
|
onKeyDown,
|
|
37
34
|
...rest
|
|
38
35
|
} = tab.props;
|
|
36
|
+
const getOwnerProps = () => tab.props;
|
|
37
|
+
const getOwnerPropsArguments = () => ({ tabId });
|
|
39
38
|
if (!disabled) availableTabIndexes.push(index);
|
|
39
|
+
const ButtonComponent = type === TAB_TYPES.SUBTABS ? StyledSubTabButton : StyledTabButton;
|
|
40
40
|
return /* @__PURE__ */ createElement(
|
|
41
|
-
|
|
41
|
+
ButtonComponent,
|
|
42
42
|
{
|
|
43
43
|
...rest,
|
|
44
|
+
getOwnerProps,
|
|
45
|
+
getOwnerPropsArguments,
|
|
44
46
|
key: tabId,
|
|
45
47
|
role: "tab",
|
|
46
48
|
innerRef: (tabButtonRef) => {
|
|
@@ -77,8 +79,7 @@ const TabBarItemRenderer = React2.memo(() => {
|
|
|
77
79
|
onClick: (e) => {
|
|
78
80
|
if (applyAriaDisabled) return;
|
|
79
81
|
if (!disabled) {
|
|
80
|
-
|
|
81
|
-
updateIndicatorStyle();
|
|
82
|
+
globalClickHandler({ event: e, target: "tabItem", tabId });
|
|
82
83
|
}
|
|
83
84
|
if (onClick && !disabled) onClick(tabId, e);
|
|
84
85
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/tabBar/TabBarItemRenderer.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACsHb,mBACE,KADF;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { StyledTabButton, StyledRequiredMark, ScreenReaderOnly, StyledSubTabButton } from './styles.js';\nimport { DSTabsContext, DSTabsCrossRefContext } from '../../DSTabsCTX.js';\nimport { useKeyboardNavigation } from '../../utils/hooks/useKeyboardNavigation.js';\nimport { centerTab } from '../../utils/helpers.js';\nimport type { DSTabT } from '../../react-desc-prop-types.js';\nimport { TABS_DATA_TESTID, TAB_TYPES } from '../../constants/index.js';\n\nexport const TabBarItemRenderer: React.ComponentType<Record<never, never>> = React.memo(() => {\n const {\n tabsRef,\n focusableTabsRef,\n tabsRefAsArray,\n carouselOnlyListRef,\n actualActiveTab,\n props: { type, fixedTabsHeaders, withCarousel, isDSMobile, showSeparator, children: tabs },\n globalClickHandler,\n } = useContext(DSTabsContext);\n\n const { lastTabInternalRef, firstSubtabInternalRef } = useContext(DSTabsCrossRefContext);\n const { handleOnKeyDown } = useKeyboardNavigation();\n\n const availableTabIndexes: number[] = [];\n\n return React.Children.map(tabs, (tab: React.ReactElement<DSTabT.Props>, index) => {\n const {\n tabId = '',\n title = '',\n style,\n required = false,\n disabled = false,\n applyAriaDisabled = false,\n ref,\n onClick,\n onKeyDown,\n ...rest\n } = tab.props;\n const getOwnerProps = () => tab.props;\n const getOwnerPropsArguments = () => ({ tabId });\n\n if (!disabled) availableTabIndexes.push(index);\n const ButtonComponent = type === TAB_TYPES.SUBTABS ? StyledSubTabButton : StyledTabButton;\n\n return (\n <ButtonComponent\n {...rest}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n key={tabId}\n role=\"tab\"\n // eslint-disable-next-line complexity\n innerRef={(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 === TAB_TYPES.SUBTABS && firstSubtabInternalRef && index === availableTabIndexes[0]) {\n firstSubtabInternalRef.current = tabButtonRef;\n }\n if (type !== TAB_TYPES.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 && !applyAriaDisabled}\n aria-disabled={disabled || applyAriaDisabled}\n isDSMobile={isDSMobile}\n fixedTabsHeaders={fixedTabsHeaders}\n tabType={type}\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 !== TAB_TYPES.NORMAL}\n data-testid={type === TAB_TYPES.NORMAL ? TABS_DATA_TESTID.TAB_BUTTON : TABS_DATA_TESTID.SUBTAB_BUTTON}\n id={`${tabId}-label`}\n onClick={(e) => {\n /** [PUI-15772] - Tabs Pre Refactor\n * Click handler for tab buttons. It:\n * 1. Prevents tab change if aria-disabled is true\n * 2. Updates active tab and indicator style if not disabled\n * 3. Calls the user's onClick callback if provided\n */\n if (applyAriaDisabled) return;\n if (!disabled) {\n globalClickHandler({ event: e, target: 'tabItem', tabId });\n }\n if (onClick && !disabled) onClick(tabId, e);\n }}\n onFocus={(e) => {\n /** [PUI-15772] - Tabs Pre Refactor\n * Focus handler for carousel tabs. It:\n * 1. Centers the focused tab in the carousel viewport\n * 2. Only applies when withCarousel prop is true\n */\n if (withCarousel) centerTab({ e, listRef: carouselOnlyListRef });\n }}\n onKeyDown={(e) => {\n /** [PUI-15772] - Tabs Pre Refactor\n * Keyboard navigation handler. It:\n * 1. Prevents Enter key propagation\n * 2. Handles keyboard navigation if not disabled\n * 3. Calls the user's onKeyDown callback if provided\n */\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 && (\n <>\n <StyledRequiredMark aria-hidden=\"true\">●</StyledRequiredMark>\n <ScreenReaderOnly>Required</ScreenReaderOnly>\n </>\n )}\n </ButtonComponent>\n );\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACsHb,mBACE,KADF;AA1EJ;AA5CN,OAAOA,UAAS,kBAAkB;AAClC,SAAS,iBAAiB,oBAAoB,kBAAkB,0BAA0B;AAC1F,SAAS,eAAe,6BAA6B;AACrD,SAAS,6BAA6B;AACtC,SAAS,iBAAiB;AAE1B,SAAS,kBAAkB,iBAAiB;AAErC,MAAM,qBAAgEA,OAAM,KAAK,MAAM;AAC5F,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,MAAM,kBAAkB,cAAc,YAAY,eAAe,UAAU,KAAK;AAAA,IACzF;AAAA,EACF,IAAI,WAAW,aAAa;AAE5B,QAAM,EAAE,oBAAoB,uBAAuB,IAAI,WAAW,qBAAqB;AACvF,QAAM,EAAE,gBAAgB,IAAI,sBAAsB;AAElD,QAAM,sBAAgC,CAAC;AAEvC,SAAOA,OAAM,SAAS,IAAI,MAAM,CAAC,KAAuC,UAAU;AAChF,UAAM;AAAA,MACJ,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR;AAAA,MACA,WAAW;AAAA,MACX,WAAW;AAAA,MACX,oBAAoB;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,IAAI,IAAI;AACR,UAAM,gBAAgB,MAAM,IAAI;AAChC,UAAM,yBAAyB,OAAO,EAAE,MAAM;AAE9C,QAA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AAC,SAAU,SAAQ,OAAO,CAAC;AAAA,QAC5C;AAAA,QACA,SAAS,CAAC,MAAM;AAMd,cAAI,aAAc,WAAU,EAAE,GAAG,SAAS,oBAAoB,CAAC;AAAA,QACjE;AAAA,QACA,WAAW,CAAC,MAAM;AAOhB,cAAI,EAAE,QAAQ,QAAS,GAAE,gBAAgB;AACzC,cAAI,CAAC,SAAU,iBAAgB,CAAC;AAChC,cAAI,aAAa,CAAC,SAAU,WAAU,CAAC;AAAA,QACzC;AAAA,QACA;AAAA;AAAA,MAEC;AAAA,MACA,YACC,iCACE;AAAA,4BAAC,sBAAmB,eAAY,QAAO,oBAAO;AAAA,QAC9C,oBAAC,oBAAiB,sBAAQ;AAAA,SAC5B;AAAA,IAEJ;AAAA,EAEJ,CAAC;AACH,CAAC;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { styled, safariAndFirefoxBold, onlySafariAndFirefox, th } from "@elliemae/ds-system";
|
|
3
|
-
import { TAB_TYPES } from "../../constants/index.js";
|
|
2
|
+
import { styled, safariAndFirefoxBold, onlySafariAndFirefox, th, css } from "@elliemae/ds-system";
|
|
3
|
+
import { DSTabsName, TABS_SLOTS, TAB_TYPES } from "../../constants/index.js";
|
|
4
4
|
const StyledSelectionIndicator = styled.div`
|
|
5
5
|
position: absolute;
|
|
6
6
|
height: ${({ isDSMobile }) => isDSMobile ? "2px" : "3px"};
|
|
@@ -45,7 +45,7 @@ const StyledTabWrapper = styled.div`
|
|
|
45
45
|
${({ fixedTabsHeaders, isDSMobile }) => !fixedTabsHeaders && isDSMobile ? "" : "overflow-x: hidden;"}
|
|
46
46
|
${({ theme, isDSMobile }) => isDSMobile ? `border-bottom: 1px solid ${theme.colors.neutral[200]};` : ``}
|
|
47
47
|
`;
|
|
48
|
-
const
|
|
48
|
+
const baseButtonStyles = css`
|
|
49
49
|
position: relative;
|
|
50
50
|
background-color: transparent;
|
|
51
51
|
border: none;
|
|
@@ -187,7 +187,22 @@ ${({ theme, isActive, disabled, isDSMobile }) => isDSMobile ? `
|
|
|
187
187
|
|
|
188
188
|
` : ``}
|
|
189
189
|
`;
|
|
190
|
-
const
|
|
190
|
+
const StyledTabButton = styled("button", {
|
|
191
|
+
name: DSTabsName,
|
|
192
|
+
slot: TABS_SLOTS.TAB_BUTTON
|
|
193
|
+
})`
|
|
194
|
+
${baseButtonStyles}
|
|
195
|
+
`;
|
|
196
|
+
const StyledSubTabButton = styled("button", {
|
|
197
|
+
name: DSTabsName,
|
|
198
|
+
slot: TABS_SLOTS.SUBTAB_BUTTON
|
|
199
|
+
})`
|
|
200
|
+
${baseButtonStyles}
|
|
201
|
+
`;
|
|
202
|
+
const StyledSubTabsList = styled("div", {
|
|
203
|
+
name: DSTabsName,
|
|
204
|
+
slot: TABS_SLOTS.SUB_TAB_LIST
|
|
205
|
+
})`
|
|
191
206
|
position: relative;
|
|
192
207
|
display: flex;
|
|
193
208
|
flex-wrap: nowrap;
|
|
@@ -195,7 +210,7 @@ const StyledSubTabsList = styled.div`
|
|
|
195
210
|
width: 100%;
|
|
196
211
|
${({ withCarousel }) => withCarousel ? "max-width: 100%;" : ""}
|
|
197
212
|
`;
|
|
198
|
-
const StyledTabList = styled.
|
|
213
|
+
const StyledTabList = styled("div", { name: DSTabsName, slot: TABS_SLOTS.TAB_LIST })`
|
|
199
214
|
position: relative;
|
|
200
215
|
display: flex;
|
|
201
216
|
flex-wrap: nowrap;
|
|
@@ -276,6 +291,7 @@ export {
|
|
|
276
291
|
StyledMobileGradient,
|
|
277
292
|
StyledRequiredMark,
|
|
278
293
|
StyledSelectionIndicator,
|
|
294
|
+
StyledSubTabButton,
|
|
279
295
|
StyledSubTabsList,
|
|
280
296
|
StyledTabButton,
|
|
281
297
|
StyledTabList,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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, safariAndFirefoxBold, onlySafariAndFirefox, th } from '@elliemae/ds-system';\n\nimport type { DSTabsInternalsT } from '../../sharedTypes.js';\nimport { TAB_TYPES } from '../../constants/index.js';\n\ninterface StyledSelectionIndicatoPropsT {\n isDSMobile: boolean;\n tabType: DSTabsInternalsT.TabTypesT;\n}\n\ninterface StyledSubTabsListPropsT {\n withCarousel: boolean;\n}\n\ninterface StyledTabButtonPropsT {\n isActive: boolean;\n disabled: boolean;\n showSeparator: boolean;\n isDSMobile: boolean;\n fixedTabsHeaders: boolean;\n withCarousel: boolean;\n tabType: DSTabsInternalsT.TabTypesT;\n}\n\ninterface StyledTabListPropsT {\n withCarousel: boolean;\n isDSMobile: boolean;\n fixedTabsHeaders: boolean;\n mobileGradients: DSTabsInternalsT.MobileGradientsT;\n indicatorStyle: DSTabsInternalsT.IndicatorStyleT;\n tabType: DSTabsInternalsT.TabTypesT;\n}\n\ninterface StyledMobileGradientPropsT {\n mobileGradients: DSTabsInternalsT.MobileGradientsT;\n left: number | undefined;\n width: number | undefined;\n}\n\ninterface StyledTabWrapperPropsT {\n isDSMobile: boolean;\n fixedTabsHeaders: boolean;\n}\n\nexport const StyledSelectionIndicator = styled.div<StyledSelectionIndicatoPropsT>`\n position: absolute;\n height: ${({ isDSMobile }) => (isDSMobile ? '2px' : '3px')};\n top: ${({ tabType, isDSMobile }) => {\n if (isDSMobile) return `35px`;\n if (tabType === TAB_TYPES.NORMAL_SMALL) return `15px`;\n return `25px`;\n }};\n z-index: 1;\n margin-top: ${({ theme }) => theme.space.xxxs};\n pointer-events: none;\n transition: 200ms cubic-bezier(0.36, 0, 1, 1);\n\n ${({ isDSMobile }) =>\n isDSMobile\n ? ` \n margin-left: 0;\n margin-top: 3px;\n `\n : ``}\n`;\n\nexport const StyledMobileGradient = styled.div.attrs(({ left = 0, width = 0 }: StyledMobileGradientPropsT) => ({\n style: { left: left - 10, maxWidth: width - left },\n}))<StyledMobileGradientPropsT>`\n position: fixed;\n z-index: 15;\n top: 0;\n width: calc(100% + 20px);\n height: 40px;\n pointer-events: none;\n\n ${({ mobileGradients: { left, right } }) => {\n if (right && left)\n return `background: linear-gradient(90deg, #FFFFFF 10px, #FFFFFF00 34px, #FFFFFF00 calc(100% - 44px), #FFFFFF calc(100% - 20px));`;\n if (right)\n return `background: linear-gradient(90deg, #FFFFFF00 0%, #FFFFFF00 calc(100% - 44px), #FFFFFF calc(100% - 20px));`;\n if (left) return `background: linear-gradient(90deg, #FFFFFF 10px, #FFFFFF00 34px, #FFFFFF00 100%);`;\n return '';\n }};\n`;\n\n/** CSS Setters */\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.neutral[200]};` : ``)}\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, isDSMobile }) => {\n if (tabType === TAB_TYPES.SUBTABS) return 'capitalize';\n return isDSMobile ? 'none' : 'uppercase';\n }};\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 === TAB_TYPES.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 ${({ theme }) => `\n &[aria-disabled='true'] {\n color: ${theme.colors.neutral[500]};\n cursor: not-allowed;\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 === TAB_TYPES.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 !== TAB_TYPES.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: ${disabled ? theme.colors.neutral[500] : theme.colors.neutral[700]};\n font-weight: ${theme.fontWeights.regular};\n padding: 0;\n font-size: 16px;\n line-height: 1.3;\n ${String(onlySafariAndFirefox('-webkit-text-stroke: 0.4px transparent;'))} \n\n &:focus {\n font-weight: ${theme.fontWeights.regular};\n ${safariAndFirefoxBold('#006AA9')}\n }\n\n ${\n isActive\n ? `\n font-weight: ${theme.fontWeights.regular};\n ${safariAndFirefoxBold('#006AA9')}\n `\n : ``\n }\n\n ${\n isActive && !disabled\n ? `\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 z-index: 0;\n ${({ withCarousel, isDSMobile }) => (withCarousel && !isDSMobile ? `max-width: 100%;` : '')}\n\n ${({ theme, isDSMobile, tabType }) =>\n tabType !== TAB_TYPES.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.neutral['000']};`\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 &::-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}px;\n left: ${indicatorStyle.left}px;\n `}\n }\n\n ${StyledSelectionIndicator} {\n background: ${(props) => {\n const { theme, indicatorStyle, isDSMobile } = props;\n return !isDSMobile\n ? `linear-gradient(to right, transparent 0px, transparent 16px, ${th.color('brand-600')(\n props,\n )} 16px, ${th.color('brand-600')(props)} ${indicatorStyle.width - 16}px, transparent ${\n indicatorStyle.width - 16\n }px, transparent ${indicatorStyle.width}px )`\n : theme.colors.brand[600];\n }};\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\nexport const ScreenReaderOnly = styled.div`\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n`;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,QAAQ,sBAAsB,sBAAsB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable max-lines */\nimport { styled, safariAndFirefoxBold, onlySafariAndFirefox, th, css } from '@elliemae/ds-system';\n\nimport type { DSTabsInternalsT } from '../../sharedTypes.js';\nimport { DSTabsName, TABS_SLOTS, TAB_TYPES } from '../../constants/index.js';\n\ninterface StyledSelectionIndicatoPropsT {\n isDSMobile: boolean;\n tabType: DSTabsInternalsT.TabTypesT;\n}\n\ninterface StyledSubTabsListPropsT {\n withCarousel: boolean;\n}\n\ninterface StyledTabButtonPropsT {\n isActive: boolean;\n disabled: boolean;\n showSeparator: boolean;\n isDSMobile: boolean;\n fixedTabsHeaders: boolean;\n withCarousel: boolean;\n tabType: DSTabsInternalsT.TabTypesT;\n}\n\ninterface StyledTabListPropsT {\n withCarousel: boolean;\n isDSMobile: boolean;\n fixedTabsHeaders: boolean;\n mobileGradients: DSTabsInternalsT.MobileGradientsT;\n indicatorStyle: DSTabsInternalsT.IndicatorStyleT;\n tabType: DSTabsInternalsT.TabTypesT;\n}\n\ninterface StyledMobileGradientPropsT {\n mobileGradients: DSTabsInternalsT.MobileGradientsT;\n left: number | undefined;\n width: number | undefined;\n}\n\ninterface StyledTabWrapperPropsT {\n isDSMobile: boolean;\n fixedTabsHeaders: boolean;\n}\n\nexport const StyledSelectionIndicator = styled.div<StyledSelectionIndicatoPropsT>`\n position: absolute;\n height: ${({ isDSMobile }) => (isDSMobile ? '2px' : '3px')};\n top: ${({ tabType, isDSMobile }) => {\n if (isDSMobile) return `35px`;\n if (tabType === TAB_TYPES.NORMAL_SMALL) return `15px`;\n return `25px`;\n }};\n z-index: 1;\n margin-top: ${({ theme }) => theme.space.xxxs};\n pointer-events: none;\n transition: 200ms cubic-bezier(0.36, 0, 1, 1);\n\n ${({ isDSMobile }) =>\n isDSMobile\n ? ` \n margin-left: 0;\n margin-top: 3px;\n `\n : ``}\n`;\n\nexport const StyledMobileGradient = styled.div.attrs(({ left = 0, width = 0 }: StyledMobileGradientPropsT) => ({\n style: { left: left - 10, maxWidth: width - left },\n}))<StyledMobileGradientPropsT>`\n position: fixed;\n z-index: 15;\n top: 0;\n width: calc(100% + 20px);\n height: 40px;\n pointer-events: none;\n\n ${({ mobileGradients: { left, right } }) => {\n if (right && left)\n return `background: linear-gradient(90deg, #FFFFFF 10px, #FFFFFF00 34px, #FFFFFF00 calc(100% - 44px), #FFFFFF calc(100% - 20px));`;\n if (right)\n return `background: linear-gradient(90deg, #FFFFFF00 0%, #FFFFFF00 calc(100% - 44px), #FFFFFF calc(100% - 20px));`;\n if (left) return `background: linear-gradient(90deg, #FFFFFF 10px, #FFFFFF00 34px, #FFFFFF00 100%);`;\n return '';\n }};\n`;\n\n/** CSS Setters */\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.neutral[200]};` : ``)}\n`;\n\nconst baseButtonStyles = css<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, isDSMobile }) => {\n if (tabType === TAB_TYPES.SUBTABS) return 'capitalize';\n return isDSMobile ? 'none' : 'uppercase';\n }};\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 === TAB_TYPES.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 ${({ theme }) => `\n &[aria-disabled='true'] {\n color: ${theme.colors.neutral[500]};\n cursor: not-allowed;\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 === TAB_TYPES.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 !== TAB_TYPES.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: ${disabled ? theme.colors.neutral[500] : theme.colors.neutral[700]};\n font-weight: ${theme.fontWeights.regular};\n padding: 0;\n font-size: 16px;\n line-height: 1.3;\n ${String(onlySafariAndFirefox('-webkit-text-stroke: 0.4px transparent;'))} \n\n &:focus {\n font-weight: ${theme.fontWeights.regular};\n ${safariAndFirefoxBold('#006AA9')}\n }\n\n ${\n isActive\n ? `\n font-weight: ${theme.fontWeights.regular};\n ${safariAndFirefoxBold('#006AA9')}\n `\n : ``\n }\n\n ${\n isActive && !disabled\n ? `\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 StyledTabButton = styled('button', {\n name: DSTabsName,\n slot: TABS_SLOTS.TAB_BUTTON,\n})<StyledTabButtonPropsT>`\n ${baseButtonStyles}\n`;\nexport const StyledSubTabButton = styled('button', {\n name: DSTabsName,\n slot: TABS_SLOTS.SUBTAB_BUTTON,\n})<StyledTabButtonPropsT>`\n ${baseButtonStyles}\n`;\n\nexport const StyledSubTabsList = styled('div', {\n name: DSTabsName,\n slot: TABS_SLOTS.SUB_TAB_LIST,\n})<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', { name: DSTabsName, slot: TABS_SLOTS.TAB_LIST })<StyledTabListPropsT>`\n position: relative;\n display: flex;\n flex-wrap: nowrap;\n flex: 1;\n width: 100%;\n z-index: 0;\n ${({ withCarousel, isDSMobile }) => (withCarousel && !isDSMobile ? `max-width: 100%;` : '')}\n\n ${({ theme, isDSMobile, tabType }) =>\n tabType !== TAB_TYPES.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.neutral['000']};`\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 &::-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}px;\n left: ${indicatorStyle.left}px;\n `}\n }\n\n ${StyledSelectionIndicator} {\n background: ${(props) => {\n const { theme, indicatorStyle, isDSMobile } = props;\n return !isDSMobile\n ? `linear-gradient(to right, transparent 0px, transparent 16px, ${th.color('brand-600')(\n props,\n )} 16px, ${th.color('brand-600')(props)} ${indicatorStyle.width - 16}px, transparent ${\n indicatorStyle.width - 16\n }px, transparent ${indicatorStyle.width}px )`\n : theme.colors.brand[600];\n }};\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\nexport const ScreenReaderOnly = styled.div`\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,QAAQ,sBAAsB,sBAAsB,IAAI,WAAW;AAG5E,SAAS,YAAY,YAAY,iBAAiB;AAyC3C,MAAM,2BAA2B,OAAO;AAAA;AAAA,YAEnC,CAAC,EAAE,WAAW,MAAO,aAAa,QAAQ,KAAM;AAAA,SACnD,CAAC,EAAE,SAAS,WAAW,MAAM;AAClC,MAAI,WAAY,QAAO;AACvB,MAAI,YAAY,UAAU,aAAc,QAAO;AAC/C,SAAO;AACT,CAAC;AAAA;AAAA,gBAEa,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,IAAI;AAAA;AAAA;AAAA;AAAA,IAI3C,CAAC,EAAE,WAAW,M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AAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useContext } from "react";
|
|
4
|
-
import { useGetGlobalAttributes, useGetXstyledProps } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from "@elliemae/ds-props-helpers";
|
|
5
5
|
import { TabsPanels } from "../tabsPanel/TabsPanels.js";
|
|
6
6
|
import { TabBar } from "../tabBar/TabBar.js";
|
|
7
|
-
import { StyledTabBarContainer } from "./styles.js";
|
|
7
|
+
import { StyledTabBarContainer, StyledTabsContainer } from "./styles.js";
|
|
8
8
|
import { DSTabsContext } from "../../DSTabsCTX.js";
|
|
9
|
-
import { TABS_DATA_TESTID } from "../../constants/index.js";
|
|
10
9
|
const TabsContent = () => {
|
|
11
10
|
const {
|
|
12
11
|
props,
|
|
@@ -14,14 +13,16 @@ const TabsContent = () => {
|
|
|
14
13
|
} = useContext(DSTabsContext);
|
|
15
14
|
const globalProps = useGetGlobalAttributes(props);
|
|
16
15
|
const xstyledProps = useGetXstyledProps(props);
|
|
16
|
+
const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);
|
|
17
17
|
return /* @__PURE__ */ jsxs(
|
|
18
|
-
|
|
18
|
+
StyledTabsContainer,
|
|
19
19
|
{
|
|
20
20
|
...globalProps,
|
|
21
21
|
...xstyledProps,
|
|
22
22
|
...containerProps,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
innerRef,
|
|
24
|
+
getOwnerProps,
|
|
25
|
+
getOwnerPropsArguments,
|
|
25
26
|
children: [
|
|
26
27
|
/* @__PURE__ */ jsxs(StyledTabBarContainer, { "aria-label": tabsListAriaLabel, children: [
|
|
27
28
|
/* @__PURE__ */ jsx(TabBar, {}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { TabsPanels } from '../tabsPanel/TabsPanels.js';\nimport { TabBar } from '../tabBar/TabBar.js';\nimport { StyledTabBarContainer } from './styles.js';\nimport { DSTabsContext } from '../../DSTabsCTX.js';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { TabsPanels } from '../tabsPanel/TabsPanels.js';\nimport { TabBar } from '../tabBar/TabBar.js';\nimport { StyledTabBarContainer, StyledTabsContainer } from './styles.js';\nimport { DSTabsContext } from '../../DSTabsCTX.js';\n\nexport const TabsContent = (): JSX.Element => {\n const {\n props,\n props: { containerProps, innerRef, tabsListAriaLabel, tabBarExtraContent, TabBarExtraContent },\n } = useContext(DSTabsContext);\n\n const globalProps = useGetGlobalAttributes(props);\n const xstyledProps = useGetXstyledProps(props);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n return (\n <StyledTabsContainer\n {...globalProps}\n {...xstyledProps}\n {...containerProps}\n innerRef={innerRef}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledTabBarContainer aria-label={tabsListAriaLabel}>\n <TabBar />\n {TabBarExtraContent ? <TabBarExtraContent /> : null}\n {tabBarExtraContent || null}\n </StyledTabBarContainer>\n <TabsPanels />\n </StyledTabsContainer>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC0BjB,SACE,KADF;AA1BN,SAAgB,kBAAkB;AAClC,SAAS,wBAAwB,oBAAoB,qBAAqB;AAC1E,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,SAAS,uBAAuB,2BAA2B;AAC3D,SAAS,qBAAqB;AAEvB,MAAM,cAAc,MAAmB;AAC5C,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,gBAAgB,UAAU,mBAAmB,oBAAoB,mBAAmB;AAAA,EAC/F,IAAI,WAAW,aAAa;AAE5B,QAAM,cAAc,uBAAuB,KAAK;AAChD,QAAM,eAAe,mBAAmB,KAAK;AAC7C,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAc,KAAK;AAErE,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,6BAAC,yBAAsB,cAAY,mBACjC;AAAA,8BAAC,UAAO;AAAA,UACP,qBAAqB,oBAAC,sBAAmB,IAAK;AAAA,UAC9C,sBAAsB;AAAA,WACzB;AAAA,QACA,oBAAC,cAAW;AAAA;AAAA;AAAA,EACd;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { styled } from "@elliemae/ds-system";
|
|
3
|
+
import { DSTabsName, TABS_SLOTS } from "../../constants/index.js";
|
|
4
|
+
const StyledTabsContainer = styled("div", { name: DSTabsName, slot: TABS_SLOTS.TABS_CONTAINER })``;
|
|
3
5
|
const StyledTabBarContainer = styled.div`
|
|
4
6
|
display: flex;
|
|
5
7
|
overflow-x: hidden;
|
|
6
8
|
`;
|
|
7
9
|
export {
|
|
8
|
-
StyledTabBarContainer
|
|
10
|
+
StyledTabBarContainer,
|
|
11
|
+
StyledTabsContainer
|
|
9
12
|
};
|
|
10
13
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 '@elliemae/ds-system';\n\nexport const StyledTabBarContainer = styled.div`\n display: flex;\n overflow-x: hidden;\n`;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport { DSTabsName, TABS_SLOTS } from '../../constants/index.js';\n\nexport const StyledTabsContainer = styled('div', { name: DSTabsName, slot: TABS_SLOTS.TABS_CONTAINER })``;\nexport const StyledTabBarContainer = styled.div`\n display: flex;\n overflow-x: hidden;\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,YAAY,kBAAkB;AAEhC,MAAM,sBAAsB,OAAO,OAAO,EAAE,MAAM,YAAY,MAAM,WAAW,eAAe,CAAC;AAC/F,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|