@elliemae/ds-tabs 3.80.0-next.61 → 3.80.0-next.78
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/config/useTabs.js +3 -3
- package/dist/cjs/config/useTabs.js.map +2 -2
- package/dist/cjs/constants/index.js +11 -1
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/{exported-related → parts/DSTab}/DSTab.js +2 -4
- package/dist/cjs/parts/DSTab/DSTab.js.map +7 -0
- package/dist/cjs/parts/DSTab/index.js +37 -0
- package/dist/cjs/parts/DSTab/index.js.map +7 -0
- package/dist/cjs/parts/DSTab/react-desc-prop-types.js +55 -0
- package/dist/cjs/parts/DSTab/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/carousel/styles.js +2 -16
- package/dist/cjs/parts/carousel/styles.js.map +2 -2
- package/dist/cjs/parts/tabBar/TabBar.js +11 -1
- package/dist/cjs/parts/tabBar/TabBar.js.map +2 -2
- package/dist/cjs/parts/tabBar/TabBarItemRenderer.js.map +1 -1
- package/dist/cjs/parts/tabBar/styles.js +8 -20
- package/dist/cjs/parts/tabBar/styles.js.map +2 -2
- package/dist/cjs/parts/tabsContent/TabsContent.js +1 -1
- package/dist/cjs/parts/tabsContent/TabsContent.js.map +2 -2
- package/dist/cjs/parts/tabsContent/styles.js +1 -1
- package/dist/cjs/parts/tabsContent/styles.js.map +2 -2
- package/dist/cjs/parts/tabsPanel/TabsPanels.js +5 -4
- package/dist/cjs/parts/tabsPanel/TabsPanels.js.map +2 -2
- package/dist/cjs/parts/tabsPanel/styles.js.map +1 -1
- package/dist/cjs/react-desc-prop-types.js +1 -19
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/slot-props.js +61 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/config/useTabs.js +3 -3
- package/dist/esm/config/useTabs.js.map +2 -2
- package/dist/esm/constants/index.js +11 -1
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/{exported-related → parts/DSTab}/DSTab.js +2 -4
- package/dist/esm/parts/DSTab/DSTab.js.map +7 -0
- package/dist/esm/parts/DSTab/index.js +7 -0
- package/dist/esm/parts/DSTab/index.js.map +7 -0
- package/dist/esm/parts/DSTab/react-desc-prop-types.js +30 -0
- package/dist/esm/parts/DSTab/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/carousel/styles.js +3 -17
- package/dist/esm/parts/carousel/styles.js.map +2 -2
- package/dist/esm/parts/tabBar/TabBar.js +11 -1
- package/dist/esm/parts/tabBar/TabBar.js.map +2 -2
- package/dist/esm/parts/tabBar/TabBarItemRenderer.js.map +1 -1
- package/dist/esm/parts/tabBar/styles.js +8 -20
- package/dist/esm/parts/tabBar/styles.js.map +2 -2
- package/dist/esm/parts/tabsContent/TabsContent.js +7 -2
- package/dist/esm/parts/tabsContent/TabsContent.js.map +2 -2
- package/dist/esm/parts/tabsContent/styles.js +1 -1
- package/dist/esm/parts/tabsContent/styles.js.map +2 -2
- package/dist/esm/parts/tabsPanel/TabsPanels.js +5 -4
- package/dist/esm/parts/tabsPanel/TabsPanels.js.map +2 -2
- package/dist/esm/parts/tabsPanel/styles.js.map +1 -1
- package/dist/esm/react-desc-prop-types.js +2 -20
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +38 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/types/constants/index.d.ts +31 -2
- package/dist/types/index.d.ts +3 -2
- package/dist/types/{exported-related → parts/DSTab}/DSTab.d.ts +1 -2
- package/dist/types/parts/DSTab/index.d.ts +2 -0
- package/dist/types/parts/DSTab/react-desc-prop-types.d.ts +36 -0
- package/dist/types/parts/carousel/styles.d.ts +0 -7
- package/dist/types/parts/tabBar/styles.d.ts +0 -2
- package/dist/types/parts/tabsPanel/styles.d.ts +1 -1
- package/dist/types/react-desc-prop-types.d.ts +17 -23
- package/package.json +11 -11
- package/dist/cjs/exported-related/DSTab.js.map +0 -7
- package/dist/esm/exported-related/DSTab.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/tabsContent/styles.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["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 })`\n display: flex;\n flex-direction: column;\n`;\nexport const StyledTabBarContainer = styled.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AACvB,uBAAuC;AAEhC,MAAM,0BAAsB,yBAAO,OAAO,EAAE,MAAM,6BAAY,MAAM,4BAAW,eAAe,CAAC;AAAA;AAAA;AAAA;AAI/F,MAAM,
|
|
4
|
+
"sourcesContent": ["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 })`\n display: flex;\n flex-direction: column;\n`;\nexport const StyledTabBarContainer = styled('div', { name: DSTabsName, slot: TABS_SLOTS.TAB_BAR_CONTAINER })`\n display: flex;\n flex: 0 0 auto;\n overflow-x: hidden;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AACvB,uBAAuC;AAEhC,MAAM,0BAAsB,yBAAO,OAAO,EAAE,MAAM,6BAAY,MAAM,4BAAW,eAAe,CAAC;AAAA;AAAA;AAAA;AAI/F,MAAM,4BAAwB,yBAAO,OAAO,EAAE,MAAM,6BAAY,MAAM,4BAAW,kBAAkB,CAAC;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -81,17 +81,18 @@ const TabsPanels = () => {
|
|
|
81
81
|
(index, indexLatest) => {
|
|
82
82
|
if (!focusableTabsRef.current) return;
|
|
83
83
|
const offset = index - indexLatest;
|
|
84
|
+
const activatableTabs = focusableTabsRef.current.filter((el) => el.getAttribute("aria-disabled") !== "true");
|
|
84
85
|
if (focusableTabsRef.current) {
|
|
85
|
-
const currentIndexFocusable =
|
|
86
|
+
const currentIndexFocusable = activatableTabs.findIndex((el) => el.dataset.tabId === actualActiveTab);
|
|
86
87
|
const newFocusableIndex = currentIndexFocusable >= 0 ? currentIndexFocusable + offset : -1;
|
|
87
|
-
if (newFocusableIndex < 0 || newFocusableIndex >
|
|
88
|
+
if (newFocusableIndex < 0 || newFocusableIndex > activatableTabs.length || !activatableTabs[newFocusableIndex])
|
|
88
89
|
return;
|
|
89
90
|
globalClickHandler({
|
|
90
91
|
event: { type: "click" },
|
|
91
92
|
target: "swipeableViews",
|
|
92
|
-
tabId:
|
|
93
|
+
tabId: activatableTabs[newFocusableIndex].dataset.tabId
|
|
93
94
|
});
|
|
94
|
-
|
|
95
|
+
activatableTabs[newFocusableIndex].click();
|
|
95
96
|
}
|
|
96
97
|
},
|
|
97
98
|
[actualActiveTab, focusableTabsRef, globalClickHandler]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/tabsPanel/TabsPanels.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable arrow-body-style */\n/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport type { DSSwipeCardT } from '@elliemae/ds-swipe-card/src/react-desc-prop-types.js';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { DSTabsContext } from '../../DSTabsCTX.js';\nimport type { DSTabT } from '
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCnB;AAhCJ,8BAA8B;AAE9B,mBAAwD;AACxD,uBAA8B;AAG9B,oBAAwD;AASxD,MAAM,aAAiF,CAAC,UAAU;AAChG,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAGJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;AAEO,MAAM,aAAa,MAAmB;AAC3C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,qBAAqB,UAAU,MAAM,YAAY,gBAAgB,SAAS;AAAA,IACnF;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,8BAAa;AAE5B,QAAM,EAAE,eAAe,wBAAwB,wBAAwB,gCAAgC,QACrG,uCAAc,KAAK;AASrB,QAAM,0BAAsB;AAAA,IAC1B,CAAC,OAAe,gBAAwB;AACtC,UAAI,CAAC,iBAAiB,QAAS;AAE/B,YAAM,SAAS,QAAQ;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable arrow-body-style */\n/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport type { DSSwipeCardT } from '@elliemae/ds-swipe-card/src/react-desc-prop-types.js';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport { DSTabsContext } from '../../DSTabsCTX.js';\nimport type { DSTabT } from '../DSTab/index.js';\nimport type { PanelDescriptor } from './styles.js';\nimport { StyledDSSwipeCard, StyledPanelContainer } from './styles.js';\n/**\n * Describes the data needed to render a single Tab panel slide.\n */\n\n/**\n * Responsible for rendering a single slide using the provided panel descriptor.\n * Receives a `dsIndex` prop from DSSwipeCard which indicates the slide position.\n */\nconst CardRender: React.ComponentType<DSSwipeCardT.CardRenderProps<PanelDescriptor>> = (props) => {\n const {\n content,\n tabPanelsProps,\n isDSMobile,\n hide,\n style,\n role,\n tabId,\n renderKey,\n getOwnerProps,\n getOwnerPropsArguments,\n ...rest\n } = props;\n\n // We pass through all attributes, including accessibility and dataset attributes.\n return (\n <StyledPanelContainer\n id={tabId}\n {...tabPanelsProps}\n {...rest}\n // Styled component specific props\n isDSMobile={isDSMobile}\n hide={hide}\n style={style}\n role={role}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {content}\n </StyledPanelContainer>\n );\n};\n\nexport const TabsPanels = (): JSX.Element => {\n const {\n actualActiveTab,\n focusableTabsRef,\n props,\n props: { onlyRenderActiveTab, children: tabs, isDSMobile, tabPanelsProps, animated },\n globalClickHandler,\n userDidChangeTabAtleastOnceRef,\n } = useContext(DSTabsContext);\n\n const { getOwnerProps: getTabPanelsOwnerProps, getOwnerPropsArguments: getTabPanelsOwnerPropsArguments } =\n useOwnerProps(props);\n\n /** [PUI-15772] - Tabs Pre Refactor\n * Handler for swipe gestures and tab index changes. It:\n * 1. Calculates the offset between current and new tab index\n * 2. Finds the new focusable tab based on the offset\n * 3. Updates the active tab and forces a click event\n * 4. May cause unnecessary rerenders due to forced click events\n */\n const handleOnChangeIndex = useCallback(\n (index: number, indexLatest: number) => {\n if (!focusableTabsRef.current) return;\n\n const offset = index - indexLatest;\n // a swipe only lands on tabs that can be activated: applyAriaDisabled tabs stay in focusableTabsRef (arrow\n // navigation keeps them) but are skipped here, the same way disabled tabs are\n const activatableTabs = focusableTabsRef.current.filter((el) => el.getAttribute('aria-disabled') !== 'true');\n\n if (focusableTabsRef.current) {\n const currentIndexFocusable = activatableTabs.findIndex((el) => el.dataset.tabId === actualActiveTab);\n\n const newFocusableIndex = currentIndexFocusable >= 0 ? currentIndexFocusable + offset : -1;\n\n if (newFocusableIndex < 0 || newFocusableIndex > activatableTabs.length || !activatableTabs[newFocusableIndex])\n return;\n globalClickHandler({\n event: { type: 'click' } as React.MouseEvent<HTMLDivElement>,\n target: 'swipeableViews',\n tabId: activatableTabs[newFocusableIndex].dataset.tabId,\n });\n\n // swiping does not trigger centerTab function inside handleOnTabChange because there is no event\n // by clicking we are manually forcing to center the tab\n\n activatableTabs[newFocusableIndex].click();\n }\n },\n [actualActiveTab, focusableTabsRef, globalClickHandler],\n );\n\n const panels: PanelDescriptor[] = useMemo(() => {\n // To preserve indices for swipe behavior, we return a fully-typed placeholder panel\n // instead of null when a panel should not be rendered. This keeps array length stable.\n const mapResult = React.Children.map(tabs, (tab: React.ReactElement<DSTabT.Props>, index: number) => {\n const { tabId: panelId = '', style, children: content, disabled, applyAriaDisabled } = tab.props;\n const isActive = actualActiveTab === panelId;\n const shouldRender = !onlyRenderActiveTab || isActive;\n const getOwnerProps = () => tab.props;\n const getOwnerPropsArguments = () => ({ panelId });\n\n const baseDescriptor: PanelDescriptor = {\n index,\n tabId: panelId,\n isActive: Boolean(isActive),\n isDSMobile: Boolean(isDSMobile),\n content: shouldRender && !disabled ? content : null,\n style: {\n ...(tabPanelsProps?.style || {}),\n ...(style || {}),\n } as React.CSSProperties,\n tabPanelsProps,\n 'aria-hidden': !(isActive && !applyAriaDisabled),\n 'data-panel-id': panelId,\n 'data-testid': 'ds-tabs-tab-panel',\n hide: !isActive,\n onClick: (event: React.MouseEvent<HTMLDivElement>) => globalClickHandler({ event, target: 'panel' }),\n role: 'tabpanel',\n getOwnerProps,\n getOwnerPropsArguments,\n };\n\n return baseDescriptor;\n });\n\n // Children.map can return null if there are no children; ensure an array is returned\n return mapResult || [];\n }, [tabs, actualActiveTab, onlyRenderActiveTab, tabPanelsProps, globalClickHandler, isDSMobile]);\n\n // Safely compute the active slide index. Default to 0 when none found.\n const idx = panels.findIndex((panel) => panel.isActive);\n const activeSlide = idx >= 0 ? idx : 0;\n const handleOnSlide = React.useCallback(\n (index: number) => {\n handleOnChangeIndex(index, activeSlide);\n },\n [handleOnChangeIndex, activeSlide],\n );\n\n return (\n <StyledDSSwipeCard\n activeSlide={activeSlide}\n onSwipe={handleOnSlide}\n enableTouch\n enableAnimation={userDidChangeTabAtleastOnceRef.current && animated}\n CardRender={CardRender}\n slidesProps={panels}\n getOwnerProps={getTabPanelsOwnerProps}\n getOwnerPropsArguments={getTabPanelsOwnerPropsArguments}\n />\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCnB;AAhCJ,8BAA8B;AAE9B,mBAAwD;AACxD,uBAA8B;AAG9B,oBAAwD;AASxD,MAAM,aAAiF,CAAC,UAAU;AAChG,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAGJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MAEJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;AAEO,MAAM,aAAa,MAAmB;AAC3C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,qBAAqB,UAAU,MAAM,YAAY,gBAA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AAQ,UAAU;AAAA,QAC9B,SAAS,gBAAgB,CAAC,WAAW,UAAU;AAAA,QAC/C,OAAO;AAAA,UACL,GAAI,gBAAgB,SAAS,CAAC;AAAA,UAC9B,GAAI,SAAS,CAAC;AAAA,QAChB;AAAA,QACA;AAAA,QACA,eAAe,EAAE,YAAY,CAAC;AAAA,QAC9B,iBAAiB;AAAA,QACjB,eAAe;AAAA,QACf,MAAM,CAAC;AAAA,QACP,SAAS,CAAC,UAA4C,mBAAmB,EAAE,OAAO,QAAQ,QAAQ,CAAC;AAAA,QACnG,MAAM;AAAA,QACN;AAAA,QACA;AAAA,MACF;AAEA,aAAO;AAAA,IACT,CAAC;AAGD,WAAO,aAAa,CAAC;AAAA,EACvB,GAAG,CAAC,MAAM,iBAAiB,qBAAqB,gBAAgB,oBAAoB,UAAU,CAAC;AAG/F,QAAM,MAAM,OAAO,UAAU,CAAC,UAAU,MAAM,QAAQ;AACtD,QAAM,cAAc,OAAO,IAAI,MAAM;AACrC,QAAM,gBAAgB,aAAAA,QAAM;AAAA,IAC1B,CAAC,UAAkB;AACjB,0BAAoB,OAAO,WAAW;AAAA,IACxC;AAAA,IACA,CAAC,qBAAqB,WAAW;AAAA,EACnC;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAS;AAAA,MACT,aAAW;AAAA,MACX,iBAAiB,+BAA+B,WAAW;AAAA,MAC3D;AAAA,MACA,aAAa;AAAA,MACb,eAAe;AAAA,MACf,wBAAwB;AAAA;AAAA,EAC1B;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/tabsPanel/styles.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { GlobalAttributesT, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { DSSwipeCard } from '@elliemae/ds-swipe-card';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTabsName, TABS_SLOTS } from '../../constants/index.js';\nimport type { DSTabT } from '
|
|
4
|
+
"sourcesContent": ["import type { GlobalAttributesT, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { DSSwipeCard } from '@elliemae/ds-swipe-card';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTabsName, TABS_SLOTS } from '../../constants/index.js';\nimport type { DSTabT } from '../DSTab/index.js';\n\ninterface StyledPanelContainerPropsT {\n hide: boolean;\n isDSMobile: boolean;\n}\nexport interface PanelDescriptor extends Record<string, unknown>, ReturnType<typeof useOwnerProps<DSTabT.Props>> {\n index: number;\n tabId: string;\n isActive: boolean;\n isDSMobile: boolean;\n content: React.ReactNode;\n style: React.CSSProperties;\n tabPanelsProps?: GlobalAttributesT<HTMLDivElement>;\n 'aria-hidden': boolean;\n 'data-panel-id': string;\n 'data-testid': string;\n hide: boolean;\n onClick: (event: React.MouseEvent<HTMLDivElement>) => void;\n role: 'tabpanel';\n}\n\nexport const StyledPanelContainer = styled('div', {\n name: DSTabsName,\n slot: TABS_SLOTS.TAB_PANEL,\n})<StyledPanelContainerPropsT>`\n flex: 1 1 auto;\n min-height: 0;\n padding-top: 8px;\n ${({ isDSMobile }) => (isDSMobile ? `padding-top: 0;` : ``)}\n &:focus-visible {\n outline: 2px solid ${({ theme }) => theme.colors.brand[700]};\n outline-offset: -2px;\n }\n`;\n\nexport const StyledDSSwipeCard = styled(DSSwipeCard<PanelDescriptor>, {\n name: DSTabsName,\n slot: TABS_SLOTS.TABS_SWIPE_CARD,\n})``;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,2BAA4B;AAC5B,uBAAuB;AACvB,uBAAuC;AAuBhC,MAAM,2BAAuB,yBAAO,OAAO;AAAA,EAChD,MAAM;AAAA,EACN,MAAM,4BAAW;AACnB,CAAC;AAAA;AAAA;AAAA;AAAA,IAIG,CAAC,EAAE,WAAW,MAAO,aAAa,oBAAoB,EAAG;AAAA;AAAA,yBAEpC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAKxD,MAAM,wBAAoB,yBAAO,kCAA8B;AAAA,EACpE,MAAM;AAAA,EACN,MAAM,4BAAW;AACnB,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,7 +28,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var react_desc_prop_types_exports = {};
|
|
30
30
|
__export(react_desc_prop_types_exports, {
|
|
31
|
-
DSTabPropTypes: () => DSTabPropTypes,
|
|
32
31
|
DSTabsDefaultProps: () => DSTabsDefaultProps,
|
|
33
32
|
DSTabsPropTypes: () => DSTabsPropTypes
|
|
34
33
|
});
|
|
@@ -38,25 +37,8 @@ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
|
38
37
|
var import_constants = require("./constants/index.js");
|
|
39
38
|
const noop = () => {
|
|
40
39
|
};
|
|
41
|
-
const DSTabPropTypes = {
|
|
42
|
-
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
43
|
-
...import_ds_props_helpers.xstyledPropTypes,
|
|
44
|
-
tabId: import_ds_props_helpers.PropTypes.string.description("Unique Tab id.").defaultValue(""),
|
|
45
|
-
title: import_ds_props_helpers.PropTypes.string.description("Tab title.").defaultValue(""),
|
|
46
|
-
required: import_ds_props_helpers.PropTypes.bool.description("Show a required mark next to the title.").defaultValue(false),
|
|
47
|
-
disabled: import_ds_props_helpers.PropTypes.bool.description("Disables Tab.").defaultValue(false),
|
|
48
|
-
applyAriaDisabled: import_ds_props_helpers.PropTypes.bool.description(
|
|
49
|
-
"Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION."
|
|
50
|
-
).defaultValue(false),
|
|
51
|
-
style: import_ds_props_helpers.PropTypes.object.description("Custom styles for the tab.").defaultValue({}),
|
|
52
|
-
RenderBadge: import_ds_props_helpers.PropTypes.node.description("Additional content rendered inside the tab button (e.g. badges, icons).").defaultValue(void 0),
|
|
53
|
-
ref: import_ds_props_helpers.PropTypes.shape({ current: import_ds_props_helpers.PropTypes.any }).description("Ref to the tab element.").defaultValue(void 0),
|
|
54
|
-
onClick: import_ds_props_helpers.PropTypes.func.description("Click handler for the tab.").defaultValue(void 0),
|
|
55
|
-
onKeyDown: import_ds_props_helpers.PropTypes.func.description("Keydown handler for the tab.").defaultValue(void 0),
|
|
56
|
-
children: import_ds_props_helpers.PropTypes.node.description("Content of the tab.").isRequired
|
|
57
|
-
};
|
|
58
40
|
const DSTabsPropTypes = {
|
|
59
|
-
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSTabsName, import_constants.
|
|
41
|
+
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSTabsName, import_constants.DSTABS_SLOTS),
|
|
60
42
|
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
61
43
|
...import_ds_props_helpers.xstyledPropTypes,
|
|
62
44
|
animated: import_ds_props_helpers.PropTypes.bool.description("Whether the Tab transition should animate or not.").defaultValue(true),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { DSPropTypesSchema, GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSTabsInternalsT } from './sharedTypes.js';\n\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import type { DSPropTypesSchema, GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSTabsInternalsT } from './sharedTypes.js';\nimport type { DSTabT } from './parts/DSTab/index.js';\n\nimport { DSTABS_SLOTS, DSTabsName, TAB_TYPES, TAB_TYPES_VALUES_AS_ARRAY } from './constants/index.js';\n\nconst noop = (): void => {};\n\nexport declare namespace DSTabsT {\n // the slots printed once per tab (tab button, subtab button and tab panel) are customized from DSTab, see DSTabT\n export type SlotFunctionArguments = {\n dsTabsRoot: () => object;\n dsTabsContainer: () => object;\n dsTabsTabList: () => object;\n dsTabsSubtabsList: () => object;\n dsTabsChevronRight: () => object;\n dsTabsChevronLeft: () => object;\n dsTabsTabsSwipeCard: () => object;\n dsTabsTabBarContainer: () => object;\n dsTabsTabWrapper: () => object;\n dsTabsMobileGradient: () => object;\n dsTabsCarouselWrapper: () => object;\n dsTabsCarouselList: () => object;\n };\n\n export interface DefaultProps {\n containerProps: Record<string, unknown>;\n animated: boolean;\n enableMouseEvents: boolean;\n allowTextSelection: boolean;\n onTabChange: (tabId: string, e?: React.MouseEvent) => void;\n type: DSTabsInternalsT.TabTypesT;\n children: React.ReactElement<DSTabT.Props>[] | readonly React.ReactElement<DSTabT.Props>[];\n onlyRenderActiveTab: boolean;\n fixedTabsHeaders: boolean;\n withCarousel: boolean;\n isDSMobile: boolean;\n showSelectionIndicator: boolean;\n showSeparator: boolean;\n tabPanelsProps: GlobalAttributesT<HTMLDivElement>;\n swipeableViewsContainerProps: object;\n }\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSTabsName,\n typeof DSTABS_SLOTS\n > {\n tabsListAriaLabel?: string;\n firstSubtabRef?: React.MutableRefObject<HTMLElement>;\n lastTabRef?: React.MutableRefObject<HTMLElement>;\n TabBarExtraContent?: React.ComponentType;\n tabBarExtraContent?: React.ReactNode;\n activeTab?: string;\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n }\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps {}\n}\n\nexport const DSTabsPropTypes: DSPropTypesSchema<DSTabsT.Props> = {\n ...getPropsPerSlotPropTypes(DSTabsName, DSTABS_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n animated: PropTypes.bool.description('Whether the Tab transition should animate or not.').defaultValue(true),\n enableMouseEvents: PropTypes.bool\n .description('Enables Tab transition with mouse drag events.')\n .defaultValue(false)\n .deprecated({ version: '3.55.x', message: 'This prop is no longer supported.' }),\n allowTextSelection: PropTypes.bool\n .description('Allows text selection when mouse drag events are active.')\n .defaultValue(false),\n onTabChange: PropTypes.func.description('Handler when a user clicks on a different Tab.').defaultValue('() => {}'),\n type: PropTypes.oneOf(TAB_TYPES_VALUES_AS_ARRAY).description('Tab type.').defaultValue(TAB_TYPES_VALUES_AS_ARRAY[0]),\n fixedTabsHeaders: PropTypes.bool.description('Fixes the tab headers.').defaultValue(false),\n isDSMobile: PropTypes.bool.description('Indicates if the component is in mobile mode.').defaultValue(false),\n showSelectionIndicator: PropTypes.bool\n .description('Shows the selection indicator for the active tab.')\n .defaultValue(true),\n showSeparator: PropTypes.bool.description('Shows a separator between tabs.').defaultValue(true),\n\n onlyRenderActiveTab: PropTypes.bool.description('Only renders the active Tab in the DOM.').defaultValue(false),\n withCarousel: PropTypes.bool.description('Activate carousel behavior.').defaultValue(false),\n activeTab: PropTypes.string\n .description('Passing a value makes DSTabs a controlled component.')\n .defaultValue('First DSTab children.'),\n children: PropTypes.node.description('Use DSTab component as children.').isRequired,\n tabsListAriaLabel: PropTypes.string\n .description(\n 'Aria label for the tablist. Omitted by default so the tablist is named by its role; set it only when a meaningful, non-redundant name is required (avoid values like \"Tab list\" that duplicate the role).',\n )\n .defaultValue(undefined),\n containerProps: PropTypes.object.description('Additional properties for the container.').defaultValue({}),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })])\n .description('Ref to the container.')\n .defaultValue(undefined),\n tabPanelsProps: PropTypes.shape(globalAttributesPropTypes)\n .description('Additional properties for the tab container.')\n .defaultValue({}),\n swipeableViewsContainerProps: PropTypes.object\n .description('Additional properties for the swipeable container.')\n .defaultValue(undefined)\n .deprecated({ version: '3.55.x', message: 'This prop is no longer supported.' }),\n firstSubtabRef: PropTypes.shape({ current: PropTypes.any })\n .description('Ref to the first subtab element.')\n .defaultValue(undefined),\n lastTabRef: PropTypes.shape({ current: PropTypes.any })\n .description('Ref to the last tab element.')\n .defaultValue(undefined),\n TabBarExtraContent: PropTypes.element.description('Additional content to display in the tab bar.'),\n tabBarExtraContent: PropTypes.node\n .description('Additional content to display in the tab bar.')\n .defaultValue(undefined),\n};\n\nexport const DSTabsDefaultProps: DSTabsT.DefaultProps = {\n containerProps: {},\n animated: true,\n enableMouseEvents: false,\n allowTextSelection: false,\n onTabChange: noop,\n type: TAB_TYPES.NORMAL,\n onlyRenderActiveTab: false,\n withCarousel: false,\n isDSMobile: false,\n showSelectionIndicator: true,\n children: [],\n fixedTabsHeaders: false,\n showSeparator: true,\n tabPanelsProps: {},\n swipeableViewsContainerProps: {},\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA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AAY,0CAA0C,EAAE,aAAa,CAAC,CAAC;AAAA,EACxG,UAAU,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,EAAE,SAAS,kCAAU,IAAI,CAAC,CAAC,CAAC,EACxF,YAAY,uBAAuB,EACnC,aAAa,MAAS;AAAA,EACzB,gBAAgB,kCAAU,MAAM,iDAAyB,EACtD,YAAY,8CAA8C,EAC1D,aAAa,CAAC,CAAC;AAAA,EAClB,8BAA8B,kCAAU,OACrC,YAAY,oDAAoD,EAChE,aAAa,MAAS,EACtB,WAAW,EAAE,SAAS,UAAU,SAAS,oCAAoC,CAAC;AAAA,EACjF,gBAAgB,kCAAU,MAAM,EAAE,SAAS,kCAAU,IAAI,CAAC,EACvD,YAAY,kCAAkC,EAC9C,aAAa,MAAS;AAAA,EACzB,YAAY,kCAAU,MAAM,EAAE,SAAS,kCAAU,IAAI,CAAC,EACnD,YAAY,8BAA8B,EAC1C,aAAa,MAAS;AAAA,EACzB,oBAAoB,kCAAU,QAAQ,YAAY,+CAA+C;AAAA,EACjG,oBAAoB,kCAAU,KAC3B,YAAY,+CAA+C,EAC3D,aAAa,MAAS;AAC3B;AAEO,MAAM,qBAA2C;AAAA,EACtD,gBAAgB,CAAC;AAAA,EACjB,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,MAAM,2BAAU;AAAA,EAChB,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,wBAAwB;AAAA,EACxB,UAAU,CAAC;AAAA,EACX,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,gBAAgB,CAAC;AAAA,EACjB,8BAA8B,CAAC;AACjC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
const SlotPropsAsObj = {
|
|
26
|
+
dsTabsRoot: { "aria-label": "just a typescript test" },
|
|
27
|
+
dsTabsContainer: { "aria-label": "just a typescript test" },
|
|
28
|
+
dsTabsTabList: { "aria-label": "just a typescript test" },
|
|
29
|
+
dsTabsSubtabsList: { "aria-label": "just a typescript test" },
|
|
30
|
+
dsTabsChevronRight: { "aria-label": "just a typescript test" },
|
|
31
|
+
dsTabsChevronLeft: { "aria-label": "just a typescript test" },
|
|
32
|
+
dsTabsTabsSwipeCard: { "aria-label": "just a typescript test" },
|
|
33
|
+
dsTabsTabBarContainer: { "aria-label": "just a typescript test" },
|
|
34
|
+
dsTabsTabWrapper: { "aria-label": "just a typescript test" },
|
|
35
|
+
dsTabsMobileGradient: { "aria-label": "just a typescript test" },
|
|
36
|
+
dsTabsCarouselWrapper: { "aria-label": "just a typescript test" },
|
|
37
|
+
dsTabsCarouselList: { "aria-label": "just a typescript test" },
|
|
38
|
+
dsTabsTabButton: { "aria-label": "just a typescript test" },
|
|
39
|
+
dsTabsSubtabButton: { "aria-label": "just a typescript test" },
|
|
40
|
+
dsTabsTabPanel: { "aria-label": "just a typescript test" }
|
|
41
|
+
};
|
|
42
|
+
const SlotPropsAsFunctions = {
|
|
43
|
+
dsTabsRoot: () => ({ "aria-label": "just a typescript test" }),
|
|
44
|
+
dsTabsContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
45
|
+
dsTabsTabList: () => ({ "aria-label": "just a typescript test" }),
|
|
46
|
+
dsTabsSubtabsList: () => ({ "aria-label": "just a typescript test" }),
|
|
47
|
+
dsTabsChevronRight: () => ({ "aria-label": "just a typescript test" }),
|
|
48
|
+
dsTabsChevronLeft: () => ({ "aria-label": "just a typescript test" }),
|
|
49
|
+
dsTabsTabsSwipeCard: () => ({ "aria-label": "just a typescript test" }),
|
|
50
|
+
dsTabsTabBarContainer: () => ({ "aria-label": "just a typescript test" }),
|
|
51
|
+
dsTabsTabWrapper: () => ({ "aria-label": "just a typescript test" }),
|
|
52
|
+
dsTabsMobileGradient: () => ({ "aria-label": "just a typescript test" }),
|
|
53
|
+
dsTabsCarouselWrapper: () => ({ "aria-label": "just a typescript test" }),
|
|
54
|
+
dsTabsCarouselList: () => ({ "aria-label": "just a typescript test" }),
|
|
55
|
+
// the per-tab slots receive the tab they are printed for
|
|
56
|
+
dsTabsTabButton: ({ tabId }) => ({ "aria-label": `just a typescript test ${tabId}` }),
|
|
57
|
+
dsTabsSubtabButton: ({ tabId }) => ({ "aria-label": `just a typescript test ${tabId}` }),
|
|
58
|
+
dsTabsTabPanel: ({ panelId }) => ({ "aria-label": `just a typescript test ${panelId}` })
|
|
59
|
+
};
|
|
60
|
+
const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
|
|
61
|
+
//# sourceMappingURL=slot-props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/slot-props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\n\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSTabsName, TABS_SLOTS } from '../constants/index.js';\nimport type { DSTabsT } from '../react-desc-prop-types.js';\nimport type { DSTabT } from '../parts/DSTab/index.js';\n\n// ds-tabs spreads its slots across two components under the single `DSTabs` component name:\n// DSTabs reads the slots of the tab bar and the container, and each DSTab reads the slots that are printed once\n// per tab (tab button, subtab button and tab panel) and tells the function form which tab it is.\n// The combined objects below intersect both and the exhaustiveness check covers all the slots at once.\n\nconst SlotPropsAsObj: Partial<DSTabsT.Props> & Partial<DSTabT.Props> = {\n dsTabsRoot: { 'aria-label': 'just a typescript test' },\n dsTabsContainer: { 'aria-label': 'just a typescript test' },\n dsTabsTabList: { 'aria-label': 'just a typescript test' },\n dsTabsSubtabsList: { 'aria-label': 'just a typescript test' },\n dsTabsChevronRight: { 'aria-label': 'just a typescript test' },\n dsTabsChevronLeft: { 'aria-label': 'just a typescript test' },\n dsTabsTabsSwipeCard: { 'aria-label': 'just a typescript test' },\n dsTabsTabBarContainer: { 'aria-label': 'just a typescript test' },\n dsTabsTabWrapper: { 'aria-label': 'just a typescript test' },\n dsTabsMobileGradient: { 'aria-label': 'just a typescript test' },\n dsTabsCarouselWrapper: { 'aria-label': 'just a typescript test' },\n dsTabsCarouselList: { 'aria-label': 'just a typescript test' },\n dsTabsTabButton: { 'aria-label': 'just a typescript test' },\n dsTabsSubtabButton: { 'aria-label': 'just a typescript test' },\n dsTabsTabPanel: { 'aria-label': 'just a typescript test' },\n};\n\nconst SlotPropsAsFunctions: DSTabsT.SlotFunctionArguments & DSTabT.SlotFunctionArguments = {\n dsTabsRoot: () => ({ 'aria-label': 'just a typescript test' }),\n dsTabsContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsTabsTabList: () => ({ 'aria-label': 'just a typescript test' }),\n dsTabsSubtabsList: () => ({ 'aria-label': 'just a typescript test' }),\n dsTabsChevronRight: () => ({ 'aria-label': 'just a typescript test' }),\n dsTabsChevronLeft: () => ({ 'aria-label': 'just a typescript test' }),\n dsTabsTabsSwipeCard: () => ({ 'aria-label': 'just a typescript test' }),\n dsTabsTabBarContainer: () => ({ 'aria-label': 'just a typescript test' }),\n dsTabsTabWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsTabsMobileGradient: () => ({ 'aria-label': 'just a typescript test' }),\n dsTabsCarouselWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsTabsCarouselList: () => ({ 'aria-label': 'just a typescript test' }),\n // the per-tab slots receive the tab they are printed for\n dsTabsTabButton: ({ tabId }) => ({ 'aria-label': `just a typescript test ${tabId}` }),\n dsTabsSubtabButton: ({ tabId }) => ({ 'aria-label': `just a typescript test ${tabId}` }),\n dsTabsTabPanel: ({ panelId }) => ({ 'aria-label': `just a typescript test ${panelId}` }),\n};\n\n// Exhaustiveness check \u2014 fails compilation if a slot defined in TABS_SLOTS is\n// missing from the combined SlotFunctionArguments surface above.\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSTabsName, typeof TABS_SLOTS>\n> = SlotPropsAsFunctions;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACYvB,MAAM,iBAAiE;AAAA,EACrE,YAAY,EAAE,cAAc,yBAAyB;AAAA,EACrD,iBAAiB,EAAE,cAAc,yBAAyB;AAAA,EAC1D,eAAe,EAAE,cAAc,yBAAyB;AAAA,EACxD,mBAAmB,EAAE,cAAc,yBAAyB;A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AC,EAAE,QAAQ,OAAO,EAAE,cAAc,0BAA0B,OAAO,GAAG;AACxF;AAIA,MAAM,6CAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -34,7 +34,7 @@ const useTabs = (props) => {
|
|
|
34
34
|
}, [actualActiveTab]);
|
|
35
35
|
useEffect(() => {
|
|
36
36
|
if (activeTab === void 0) {
|
|
37
|
-
const firstAvailableTab = focusableTabsRef.current.find((el) => el.ariaDisabled !== "true");
|
|
37
|
+
const firstAvailableTab = focusableTabsRef.current.find((el) => el.ariaDisabled !== "true" && !el.disabled);
|
|
38
38
|
setInternalActiveTab(firstAvailableTab?.dataset.tabId || "");
|
|
39
39
|
}
|
|
40
40
|
}, [activeTab]);
|
|
@@ -77,8 +77,8 @@ const useTabs = (props) => {
|
|
|
77
77
|
}
|
|
78
78
|
if (data.target === "tabsList") {
|
|
79
79
|
const target = data.event.target;
|
|
80
|
-
const { dataset, ariaDisabled } = target;
|
|
81
|
-
if (dataset.tabId && ariaDisabled !== "true") {
|
|
80
|
+
const { dataset, ariaDisabled, disabled } = target;
|
|
81
|
+
if (dataset.tabId && ariaDisabled !== "true" && !disabled) {
|
|
82
82
|
if (isDSMobile && !fixedTabsHeaders && data.event) {
|
|
83
83
|
centerTab({ e: data.event, listRef: tabsListRef });
|
|
84
84
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useTabs.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport React, { useRef, useState, useMemo, useEffect } from 'react';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { DSTabsDefaultProps } from '../react-desc-prop-types.js';\nimport type { DSTabsT
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,OAAOA,UAAS,QAAQ,UAAU,SAAS,iBAAiB;AAC5D,SAAS,oCAAoC;AAC7C,SAAS,0BAA0B;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport React, { useRef, useState, useMemo, useEffect } from 'react';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { DSTabsDefaultProps } from '../react-desc-prop-types.js';\nimport type { DSTabsT } from '../react-desc-prop-types.js';\nimport type { DSTabT } from '../parts/DSTab/index.js';\nimport type { DSTabsInternalsT } from '../sharedTypes.js';\nimport { centerTab, shouldHaveLeftGradient, shouldHaveRightGradient } from '../utils/helpers.js';\n\nexport const useTabs = (props: DSTabsT.Props): DSTabsInternalsT.DSTabsUseTabsContextT => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSTabsT.InternalProps>(props, DSTabsDefaultProps);\n\n const { activeTab, children, onTabChange, isDSMobile, fixedTabsHeaders } = propsWithDefaults;\n\n const tabsRef = useRef<Record<number, HTMLButtonElement>>({});\n const tabsRefAsArray = useRef<HTMLButtonElement[]>([]);\n const focusableTabsRef = useRef<HTMLButtonElement[]>([]);\n const carouselOnlyListRef = useRef<HTMLDivElement | null>(null);\n const tabsListRef = useRef<HTMLDivElement | null>(null);\n const actualActiveTabRef = useRef<HTMLButtonElement | null>(null);\n\n // we can't activate disabled tabs, we search for the first activable tab\n const firstActivableTabId = useMemo(() => {\n const childrenArray = React.Children.toArray(children) as React.ReactElement<DSTabT.Props>[];\n const firstActivableTab = childrenArray.filter((tab) => tab.props.disabled !== true)[0];\n\n if (!firstActivableTab) return '';\n return firstActivableTab.props.tabId ?? '';\n }, [children]);\n\n const [internalActiveTab, setInternalActiveTab] = useState<string>(firstActivableTabId);\n const [focusedTabId, setFocusedTabId] = useState<string>(firstActivableTabId);\n\n useEffect(() => {\n if (activeTab !== undefined) {\n setFocusedTabId(activeTab);\n }\n }, [activeTab]);\n\n const actualActiveTab = useMemo(() => {\n if (activeTab !== undefined) return activeTab;\n return internalActiveTab;\n }, [activeTab, internalActiveTab]);\n\n useEffect(() => {\n actualActiveTabRef.current = focusableTabsRef.current.find((el) => el.dataset.tabId === actualActiveTab) ?? null;\n }, [actualActiveTab]);\n\n useEffect(() => {\n if (activeTab === undefined) {\n const firstAvailableTab = focusableTabsRef.current.find((el) => el.ariaDisabled !== 'true' && !el.disabled);\n setInternalActiveTab(firstAvailableTab?.dataset.tabId || '');\n }\n }, [activeTab]);\n\n const [mobileGradients, setMobileGradients] = useState<DSTabsInternalsT.MobileGradientsT>({\n left: false,\n right: false,\n });\n\n /** [PUI-15772] - Tabs Pre Refactor\n * Updates mobile gradient visibility. It:\n * 1. Calculates scroll position\n * 2. Updates gradient visibility based on scroll\n */\n const updateMobileGradients = React.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 React.useLayoutEffect(() => {\n if (isDSMobile && !fixedTabsHeaders) {\n updateMobileGradients();\n }\n }, [updateMobileGradients, isDSMobile, fixedTabsHeaders, actualActiveTab]);\n\n // due to a bunch of reasons and the component being biting more than it can chew\n // optimizing renders to make the swipe-card work \"as expected\"(not animating on first render)\n // simply isn't feasible at this time.\n // how do we fix this anyway?\n // we track the first time a tab change triggered by the user happens\n // after the first user interaction we enable animations,\n // after that we give the animation handling control back to the swipe-card.\n const userDidChangeTabAtleastOnceRef = useRef(false);\n\n const handleOnTabChange = React.useCallback(\n (tabId: string, e?: React.MouseEvent) => {\n setInternalActiveTab(tabId);\n onTabChange(tabId, e);\n userDidChangeTabAtleastOnceRef.current = true;\n if (isDSMobile && !fixedTabsHeaders && e) {\n centerTab({ e, listRef: tabsListRef });\n }\n },\n [fixedTabsHeaders, isDSMobile, onTabChange, setInternalActiveTab, tabsListRef],\n );\n\n const globalClickHandler = React.useCallback(\n (data: DSTabsInternalsT.GlobalClickHandlerT): void => {\n if (data.target === 'panel') {\n // we need to allow the text selection in the panel\n // this enters on conflict with the SwipeableViews component\n if (propsWithDefaults.allowTextSelection) {\n data.event.stopPropagation();\n }\n }\n\n if (data.target === 'tabsList') {\n const target = data.event.target as HTMLButtonElement;\n const { dataset, ariaDisabled, disabled } = target;\n if (dataset.tabId && ariaDisabled !== 'true' && !disabled) {\n // handleOnTabChange(dataset.tabId, data.event);\n if (isDSMobile && !fixedTabsHeaders && data.event) {\n centerTab({ e: data.event, listRef: tabsListRef });\n }\n }\n }\n if (data.target === 'swipeableViews') {\n handleOnTabChange(data.tabId!);\n }\n if (data.target === 'tabItem' && data.tabId && !(data.event.currentTarget as HTMLButtonElement).disabled) {\n handleOnTabChange(data.tabId, data.event);\n }\n },\n [propsWithDefaults.allowTextSelection, handleOnTabChange, tabsListRef, fixedTabsHeaders, isDSMobile],\n );\n const ctx = useMemo(\n () => ({\n props: propsWithDefaults,\n tabsRef,\n focusableTabsRef,\n tabsListRef,\n tabsRefAsArray,\n setInternalActiveTab,\n actualActiveTab,\n actualActiveTabRef,\n carouselOnlyListRef,\n globalClickHandler,\n mobileGradients,\n updateMobileGradients,\n handleOnTabChange,\n userDidChangeTabAtleastOnceRef,\n firstActivableTabId,\n focusedTabId,\n setFocusedTabId,\n }),\n [\n propsWithDefaults,\n actualActiveTab,\n globalClickHandler,\n mobileGradients,\n updateMobileGradients,\n handleOnTabChange,\n userDidChangeTabAtleastOnceRef,\n firstActivableTabId,\n focusedTabId,\n ],\n );\n\n return ctx;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,OAAOA,UAAS,QAAQ,UAAU,SAAS,iBAAiB;AAC5D,SAAS,oCAAoC;AAC7C,SAAS,0BAA0B;AAInC,SAAS,WAAW,wBAAwB,+BAA+B;AAEpE,MAAM,UAAU,CAAC,U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AC5C,YAAI,QAAQ,SAAS,iBAAiB,UAAU,CAAC,UAAU;AAEzD,cAAI,cAAc,CAAC,oBAAoB,KAAK,OAAO;AACjD,sBAAU,EAAE,GAAG,KAAK,OAAO,SAAS,YAAY,CAAC;AAAA,UACnD;AAAA,QACF;AAAA,MACF;AACA,UAAI,KAAK,WAAW,kBAAkB;AACpC,0BAAkB,KAAK,KAAM;AAAA,MAC/B;AACA,UAAI,KAAK,WAAW,aAAa,KAAK,SAAS,CAAE,KAAK,MAAM,cAAoC,UAAU;AACxG,0BAAkB,KAAK,OAAO,KAAK,KAAK;AAAA,MAC1C;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,oBAAoB,mBAAmB,aAAa,kBAAkB,UAAU;AAAA,EACrG;AACA,QAAM,MAAM;AAAA,IACV,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -28,8 +28,16 @@ const TABS_SLOTS = {
|
|
|
28
28
|
TAB_LIST: "tab-list",
|
|
29
29
|
CAROUSEL_BUTTON_RIGHT: "chevron-right",
|
|
30
30
|
CAROUSEL_BUTTON_LEFT: "chevron-left",
|
|
31
|
-
TABS_SWIPE_CARD: "tabs-swipe-card"
|
|
31
|
+
TABS_SWIPE_CARD: "tabs-swipe-card",
|
|
32
|
+
TAB_BAR_CONTAINER: "tab-bar-container",
|
|
33
|
+
TAB_WRAPPER: "tab-wrapper",
|
|
34
|
+
MOBILE_GRADIENT: "mobile-gradient",
|
|
35
|
+
CAROUSEL_WRAPPER: "carousel-wrapper",
|
|
36
|
+
CAROUSEL_LIST: "carousel-list"
|
|
32
37
|
};
|
|
38
|
+
const { TAB_BUTTON, SUBTAB_BUTTON, TAB_PANEL, ...DSTABS_LEVEL_SLOTS } = TABS_SLOTS;
|
|
39
|
+
const DSTAB_SLOTS = { TAB_BUTTON, SUBTAB_BUTTON, TAB_PANEL };
|
|
40
|
+
const DSTABS_SLOTS = DSTABS_LEVEL_SLOTS;
|
|
33
41
|
const TABS_DATA_TESTID = {
|
|
34
42
|
...slotObjectToDataTestIds(DSTabsName, TABS_SLOTS),
|
|
35
43
|
SUB_TAB_LIST: "subtabs-list",
|
|
@@ -43,6 +51,8 @@ const TABS_DATA_TESTID = {
|
|
|
43
51
|
};
|
|
44
52
|
export {
|
|
45
53
|
DEFAULT_INDICATOR_STYLES,
|
|
54
|
+
DSTABS_SLOTS,
|
|
55
|
+
DSTAB_SLOTS,
|
|
46
56
|
DSTabsName,
|
|
47
57
|
GRADIENT_OFFSETS_ACCORDING_TYPE,
|
|
48
58
|
MOBILE_GRADIENT_WIDTH,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSTabsName = 'DSTabs';\n\nexport const TAB_TYPES = {\n NORMAL: 'normal' as const,\n NORMAL_SMALL: 'normal_small' as const,\n SUBTABS: 'subtabs' as const,\n};\n\nexport const TAB_TYPES_VALUES_AS_ARRAY = Object.values(TAB_TYPES);\n\nexport const MOBILE_GRADIENT_WIDTH = 24;\n\nexport const DEFAULT_INDICATOR_STYLES = {\n left: 0,\n width: 0,\n};\n\nexport const GRADIENT_OFFSETS_ACCORDING_TYPE = {\n NORMAL_SMALL: 14,\n NORMAL: 16,\n SUBTABS: 16,\n FIXED_TABS_HEADERS: 0,\n};\n\nexport const TABS_SLOTS = {\n ROOT: 'root',\n TABS_CONTAINER: 'container',\n TAB_BUTTON: 'tab-button',\n SUBTAB_BUTTON: 'subtab-button',\n TAB_PANEL: 'tab-panel',\n SUB_TAB_LIST: 'subtabs-list',\n TAB_LIST: 'tab-list',\n CAROUSEL_BUTTON_RIGHT: 'chevron-right',\n CAROUSEL_BUTTON_LEFT: 'chevron-left',\n TABS_SWIPE_CARD: 'tabs-swipe-card',\n} as const;\n\nexport const TABS_DATA_TESTID = {\n ...(slotObjectToDataTestIds(DSTabsName, TABS_SLOTS) as Record<keyof typeof TABS_SLOTS, string>),\n SUB_TAB_LIST: 'subtabs-list',\n TAB_LIST: 'tab-list',\n CAROUSEL_BUTTON_RIGHT: 'chevron-right',\n CAROUSEL_BUTTON_LEFT: 'chevron-left',\n CAROUSEL: {\n BUTTON_RIGHT: 'chevron-right',\n BUTTON_LEFT: 'chevron-left',\n },\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,aAAa;AAEnB,MAAM,YAAY;AAAA,EACvB,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,SAAS;AACX;AAEO,MAAM,4BAA4B,OAAO,OAAO,SAAS;AAEzD,MAAM,wBAAwB;AAE9B,MAAM,2BAA2B;AAAA,EACtC,MAAM;AAAA,EACN,OAAO;AACT;AAEO,MAAM,kCAAkC;AAAA,EAC7C,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,oBAAoB;AACtB;AAEO,MAAM,aAAa;AAAA,EACxB,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,WAAW;AAAA,EACX,cAAc;AAAA,EACd,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,iBAAiB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSTabsName = 'DSTabs';\n\nexport const TAB_TYPES = {\n NORMAL: 'normal' as const,\n NORMAL_SMALL: 'normal_small' as const,\n SUBTABS: 'subtabs' as const,\n};\n\nexport const TAB_TYPES_VALUES_AS_ARRAY = Object.values(TAB_TYPES);\n\nexport const MOBILE_GRADIENT_WIDTH = 24;\n\nexport const DEFAULT_INDICATOR_STYLES = {\n left: 0,\n width: 0,\n};\n\nexport const GRADIENT_OFFSETS_ACCORDING_TYPE = {\n NORMAL_SMALL: 14,\n NORMAL: 16,\n SUBTABS: 16,\n FIXED_TABS_HEADERS: 0,\n};\n\nexport const TABS_SLOTS = {\n ROOT: 'root',\n TABS_CONTAINER: 'container',\n TAB_BUTTON: 'tab-button',\n SUBTAB_BUTTON: 'subtab-button',\n TAB_PANEL: 'tab-panel',\n SUB_TAB_LIST: 'subtabs-list',\n TAB_LIST: 'tab-list',\n CAROUSEL_BUTTON_RIGHT: 'chevron-right',\n CAROUSEL_BUTTON_LEFT: 'chevron-left',\n TABS_SWIPE_CARD: 'tabs-swipe-card',\n TAB_BAR_CONTAINER: 'tab-bar-container',\n TAB_WRAPPER: 'tab-wrapper',\n MOBILE_GRADIENT: 'mobile-gradient',\n CAROUSEL_WRAPPER: 'carousel-wrapper',\n CAROUSEL_LIST: 'carousel-list',\n} as const;\n\n// the slots below are printed once per tab and their props are read from each DSTab (not from DSTabs):\n// `dsTabsTabButton`, `dsTabsSubtabButton` and `dsTabsTabPanel` only take effect when passed to a DSTab\nconst { TAB_BUTTON, SUBTAB_BUTTON, TAB_PANEL, ...DSTABS_LEVEL_SLOTS } = TABS_SLOTS;\nexport const DSTAB_SLOTS = { TAB_BUTTON, SUBTAB_BUTTON, TAB_PANEL } as const;\nexport const DSTABS_SLOTS = DSTABS_LEVEL_SLOTS;\n\nexport const TABS_DATA_TESTID = {\n ...(slotObjectToDataTestIds(DSTabsName, TABS_SLOTS) as Record<keyof typeof TABS_SLOTS, string>),\n SUB_TAB_LIST: 'subtabs-list',\n TAB_LIST: 'tab-list',\n CAROUSEL_BUTTON_RIGHT: 'chevron-right',\n CAROUSEL_BUTTON_LEFT: 'chevron-left',\n CAROUSEL: {\n BUTTON_RIGHT: 'chevron-right',\n BUTTON_LEFT: 'chevron-left',\n },\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,aAAa;AAEnB,MAAM,YAAY;AAAA,EACvB,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,SAAS;AACX;AAEO,MAAM,4BAA4B,OAAO,OAAO,SAAS;AAEzD,MAAM,wBAAwB;AAE9B,MAAM,2BAA2B;AAAA,EACtC,MAAM;AAAA,EACN,OAAO;AACT;AAEO,MAAM,kCAAkC;AAAA,EAC7C,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,oBAAoB;AACtB;AAEO,MAAM,aAAa;AAAA,EACxB,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,WAAW;AAAA,EACX,cAAc;AAAA,EACd,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,kBAAkB;AAAA,EAClB,eAAe;AACjB;AAIA,MAAM,EAAE,YAAY,eAAe,WAAW,GAAG,mBAAmB,IAAI;AACjE,MAAM,cAAc,EAAE,YAAY,eAAe,UAAU;AAC3D,MAAM,eAAe;AAErB,MAAM,mBAAmB;AAAA,EAC9B,GAAI,wBAAwB,YAAY,UAAU;AAAA,EAClD,cAAc;AAAA,EACd,UAAU;AAAA,EACV,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,UAAU;AAAA,IACR,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
TAB_TYPES as TAB_TYPES2,
|
|
9
9
|
DSTabsName
|
|
10
10
|
} from "./constants/index.js";
|
|
11
|
-
import { DSTab, DSTabWithSchema } from "./
|
|
11
|
+
import { DSTab, DSTabWithSchema } from "./parts/DSTab/index.js";
|
|
12
12
|
export {
|
|
13
13
|
DSTab,
|
|
14
14
|
DSTabWithSchema,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSTabs, DSTabsWithSchema } from './DSTabs.js';\nexport type {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,wBAAwB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSTabs, DSTabsWithSchema } from './DSTabs.js';\nexport type { DSTabsT } from './react-desc-prop-types.js';\nexport type { DSTabT } from './parts/DSTab/index.js';\nexport {\n TABS_SLOTS,\n TABS_DATA_TESTID,\n TABS_DATA_TESTID as DSTabsDatatestid,\n TAB_TYPES,\n TAB_TYPES as TabTypes,\n DSTabsName,\n} from './constants/index.js';\nexport { DSTab, DSTabWithSchema } from './parts/DSTab/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,wBAAwB;AAGzC;AAAA,EACE;AAAA,EACA;AAAA,EACoB,oBAApBA;AAAA,EACA;AAAA,EACa,aAAbC;AAAA,EACA;AAAA,OACK;AACP,SAAS,OAAO,uBAAuB;",
|
|
6
6
|
"names": ["TABS_DATA_TESTID", "TAB_TYPES"]
|
|
7
7
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
3
|
-
import { DSTabPropTypes } from "
|
|
3
|
+
import { DSTabPropTypes } from "./react-desc-prop-types.js";
|
|
4
4
|
const DSTab = (props) => props.children;
|
|
5
5
|
DSTab.displayName = "DSTab";
|
|
6
6
|
const DSTabWithSchema = describe(DSTab);
|
|
7
7
|
DSTabWithSchema.propTypes = DSTabPropTypes;
|
|
8
|
-
var DSTab_default = DSTab;
|
|
9
8
|
export {
|
|
10
9
|
DSTab,
|
|
11
|
-
DSTabWithSchema
|
|
12
|
-
DSTab_default as default
|
|
10
|
+
DSTabWithSchema
|
|
13
11
|
};
|
|
14
12
|
//# sourceMappingURL=DSTab.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSTab/DSTab.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { describe, type ValidationMap } from '@elliemae/ds-props-helpers';\nimport { DSTabPropTypes, type DSTabT } from './react-desc-prop-types.js';\n\n// DSTab is a config-only component: it is never rendered by itself, DSTabs reads its props (and its slots props\n// through getOwnerProps) from the element and renders the tab button and the tab panel on its own\nconst DSTab = (props: DSTabT.Props) => props.children;\n\nDSTab.displayName = 'DSTab';\nconst DSTabWithSchema = describe(DSTab);\nDSTabWithSchema.propTypes = DSTabPropTypes as unknown as ValidationMap<DSTabT.Props>;\n\nexport { DSTab, DSTabWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,gBAAoC;AAC7C,SAAS,sBAAmC;AAI5C,MAAM,QAAQ,CAAC,UAAwB,MAAM;AAE7C,MAAM,cAAc;AACpB,MAAM,kBAAkB,SAAS,KAAK;AACtC,gBAAgB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSTab/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSTab, DSTabWithSchema } from './DSTab.js';\nexport type { DSTabT } from './react-desc-prop-types.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,OAAO,uBAAuB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
PropTypes,
|
|
4
|
+
getPropsPerSlotPropTypes,
|
|
5
|
+
globalAttributesPropTypes,
|
|
6
|
+
xstyledPropTypes
|
|
7
|
+
} from "@elliemae/ds-props-helpers";
|
|
8
|
+
import { DSTAB_SLOTS, DSTabsName } from "../../constants/index.js";
|
|
9
|
+
const DSTabPropTypes = {
|
|
10
|
+
...getPropsPerSlotPropTypes(DSTabsName, DSTAB_SLOTS),
|
|
11
|
+
...globalAttributesPropTypes,
|
|
12
|
+
...xstyledPropTypes,
|
|
13
|
+
tabId: PropTypes.string.description("Unique Tab id.").defaultValue(""),
|
|
14
|
+
title: PropTypes.string.description("Tab title.").defaultValue(""),
|
|
15
|
+
required: PropTypes.bool.description("Show a required mark next to the title.").defaultValue(false),
|
|
16
|
+
disabled: PropTypes.bool.description("Disables Tab.").defaultValue(false),
|
|
17
|
+
applyAriaDisabled: PropTypes.bool.description(
|
|
18
|
+
"Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. IGNORES EVERY ACTION (click, Enter, Space) AND THE CONSUMER HANDLERS FOR THEM."
|
|
19
|
+
).defaultValue(false),
|
|
20
|
+
style: PropTypes.object.description("Custom styles for the tab.").defaultValue({}),
|
|
21
|
+
RenderBadge: PropTypes.node.description("Additional content rendered inside the tab button (e.g. badges, icons).").defaultValue(void 0),
|
|
22
|
+
ref: PropTypes.shape({ current: PropTypes.any }).description("Ref to the tab element.").defaultValue(void 0),
|
|
23
|
+
onClick: PropTypes.func.description("Click handler for the tab.").defaultValue(void 0),
|
|
24
|
+
onKeyDown: PropTypes.func.description("Keydown handler for the tab.").defaultValue(void 0),
|
|
25
|
+
children: PropTypes.node.description("Content of the tab.").isRequired
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
DSTabPropTypes
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSTab/react-desc-prop-types.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSTAB_SLOTS, DSTabsName } from '../../constants/index.js';\n\nexport declare namespace DSTabT {\n export interface TabSlotArguments {\n tabId: string;\n }\n\n export interface TabPanelSlotArguments {\n panelId: string;\n }\n\n // the slots printed once per tab are customized from each DSTab, the function form receives which tab it is\n export type SlotFunctionArguments = {\n dsTabsTabButton: (args: TabSlotArguments) => object;\n dsTabsSubtabButton: (args: TabSlotArguments) => object;\n dsTabsTabPanel: (args: TabPanelSlotArguments) => object;\n };\n\n export interface DefaultProps {\n tabId: string;\n applyAriaDisabled: boolean;\n }\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSTabsName,\n typeof DSTAB_SLOTS\n > {\n style?: Record<string, unknown>;\n title?: string;\n required?: boolean;\n disabled?: boolean;\n RenderBadge?: React.ComponentType;\n ref?: React.MutableRefObject<HTMLButtonElement>;\n onClick?: (tabId: string | number, e: React.MouseEvent) => null | void;\n onKeyDown?: (e: React.KeyboardEvent) => null | void;\n }\n\n export interface RequiredProps {\n children: TypescriptHelpersT.ReactChildrenComplete;\n }\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {}\n}\n\nexport const DSTabPropTypes: DSPropTypesSchema<DSTabT.Props> = {\n ...getPropsPerSlotPropTypes(DSTabsName, DSTAB_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n tabId: PropTypes.string.description('Unique Tab id.').defaultValue(''),\n title: PropTypes.string.description('Tab title.').defaultValue(''),\n required: PropTypes.bool.description('Show a required mark next to the title.').defaultValue(false),\n disabled: PropTypes.bool.description('Disables Tab.').defaultValue(false),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. IGNORES EVERY ACTION (click, Enter, Space) AND THE CONSUMER HANDLERS FOR THEM.',\n )\n .defaultValue(false),\n style: PropTypes.object.description('Custom styles for the tab.').defaultValue({}),\n RenderBadge: PropTypes.node\n .description('Additional content rendered inside the tab button (e.g. badges, icons).')\n .defaultValue(undefined),\n ref: PropTypes.shape({ current: PropTypes.any }).description('Ref to the tab element.').defaultValue(undefined),\n onClick: PropTypes.func.description('Click handler for the tab.').defaultValue(undefined),\n onKeyDown: PropTypes.func.description('Keydown handler for the tab.').defaultValue(undefined),\n children: PropTypes.node.description('Content of the tab.').isRequired,\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,aAAa,kBAAkB;AA4CjC,MAAM,iBAAkD;AAAA,EAC7D,GAAG,yBAAyB,YAAY,WAAW;AAAA,EACnD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO,UAAU,OAAO,YAAY,gBAAgB,EAAE,aAAa,EAAE;AAAA,EACrE,OAAO,UAAU,OAAO,YAAY,YAAY,EAAE,aAAa,EAAE;AAAA,EACjE,UAAU,UAAU,KAAK,YAAY,yCAAyC,EAAE,aAAa,KAAK;AAAA,EAClG,UAAU,UAAU,KAAK,YAAY,eAAe,EAAE,aAAa,KAAK;AAAA,EACxE,mBAAmB,UAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,OAAO,UAAU,OAAO,YAAY,4BAA4B,EAAE,aAAa,CAAC,CAAC;AAAA,EACjF,aAAa,UAAU,KACpB,YAAY,yEAAyE,EACrF,aAAa,MAAS;AAAA,EACzB,KAAK,UAAU,MAAM,EAAE,SAAS,UAAU,IAAI,CAAC,EAAE,YAAY,yBAAyB,EAAE,aAAa,MAAS;AAAA,EAC9G,SAAS,UAAU,KAAK,YAAY,4BAA4B,EAAE,aAAa,MAAS;AAAA,EACxF,WAAW,UAAU,KAAK,YAAY,8BAA8B,EAAE,aAAa,MAAS;AAAA,EAC5F,UAAU,UAAU,KAAK,YAAY,qBAAqB,EAAE;AAC9D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { css, styled } from "@elliemae/ds-system";
|
|
3
3
|
import { DSButtonV2 } from "@elliemae/ds-button-v2";
|
|
4
|
-
import { DSTabsName, TABS_SLOTS
|
|
4
|
+
import { DSTabsName, TABS_SLOTS } from "../../constants/index.js";
|
|
5
5
|
const baseCarouselButtonStyles = css`
|
|
6
6
|
margin: 0;
|
|
7
7
|
min-width: ${({ theme }) => theme.space.xs};
|
|
@@ -29,12 +29,12 @@ const StyledCarouselBtnRight = styled(DSButtonV2, {
|
|
|
29
29
|
})`
|
|
30
30
|
${baseCarouselButtonStyles}
|
|
31
31
|
`;
|
|
32
|
-
const StyledCarouselWrapper = styled.
|
|
32
|
+
const StyledCarouselWrapper = styled("span", { name: DSTabsName, slot: TABS_SLOTS.CAROUSEL_WRAPPER })`
|
|
33
33
|
position: relative;
|
|
34
34
|
width: 100%;
|
|
35
35
|
display: flex;
|
|
36
36
|
`;
|
|
37
|
-
const StyledChildrenWrap = styled.
|
|
37
|
+
const StyledChildrenWrap = styled("div", { name: DSTabsName, slot: TABS_SLOTS.CAROUSEL_LIST })`
|
|
38
38
|
display: flex;
|
|
39
39
|
flex-wrap: nowrap;
|
|
40
40
|
flex: 1;
|
|
@@ -46,23 +46,9 @@ const StyledChildrenWrap = styled.div`
|
|
|
46
46
|
outline-offset: -2px;
|
|
47
47
|
}
|
|
48
48
|
`;
|
|
49
|
-
const StyledCarouselButtonWrapper = styled.div`
|
|
50
|
-
max-width: 16px;
|
|
51
|
-
position: absolute;
|
|
52
|
-
z-index: 200;
|
|
53
|
-
${({ right }) => right ? "right: 0;" : `left: 0;`}
|
|
54
|
-
width: 16px;
|
|
55
|
-
height: ${({ tabType }) => tabType === TAB_TYPES.NORMAL ? "32px" : "22px"};
|
|
56
|
-
padding-top: ${({ tabType }) => tabType === TAB_TYPES.NORMAL ? "5px" : "0px"};
|
|
57
|
-
background: white;
|
|
58
|
-
${({ theme, tabType }) => tabType === TAB_TYPES.NORMAL ? `
|
|
59
|
-
background: linear-gradient(to bottom, white 0px, white 30px, ${theme.colors.neutral[400]} 30px, ${theme.colors.neutral[400]} 31px, white 31px , white 32px );
|
|
60
|
-
` : ``};
|
|
61
|
-
`;
|
|
62
49
|
export {
|
|
63
50
|
StyledCarouselBtnLeft,
|
|
64
51
|
StyledCarouselBtnRight,
|
|
65
|
-
StyledCarouselButtonWrapper,
|
|
66
52
|
StyledCarouselWrapper,
|
|
67
53
|
StyledChildrenWrap
|
|
68
54
|
};
|
|
@@ -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 { css, styled } from '@elliemae/ds-system';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\n\nimport
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,KAAK,cAAc;AAC5B,SAAS,kBAAkB;
|
|
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 { DSTabsName, TABS_SLOTS } from '../../constants/index.js';\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', { name: DSTabsName, slot: TABS_SLOTS.CAROUSEL_WRAPPER })`\n position: relative;\n width: 100%;\n display: flex;\n`;\n\nexport const StyledChildrenWrap = styled('div', { name: DSTabsName, slot: TABS_SLOTS.CAROUSEL_LIST })`\n display: flex;\n flex-wrap: nowrap;\n flex: 1;\n overflow-x: auto;\n scrollbar-gutter: stable;\n\n &:focus-visible {\n outline: 2px solid ${({ theme }) => theme.colors.brand[700]};\n outline-offset: -2px;\n }\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,KAAK,cAAc;AAC5B,SAAS,kBAAkB;AAE3B,SAAS,YAAY,kBAAkB;AAEvC,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,QAAQ,EAAE,MAAM,YAAY,MAAM,WAAW,iBAAiB,CAAC;AAAA;AAAA;AAAA;AAAA;AAMpG,MAAM,qBAAqB,OAAO,OAAO,EAAE,MAAM,YAAY,MAAM,WAAW,cAAc,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAQ3E,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|