@elliemae/ds-tabs 3.38.0 → 3.39.0-rc.1
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/DSTabs.js +2 -2
- package/dist/cjs/DSTabs.js.map +2 -2
- package/dist/cjs/DSTabsCTX.js +2 -2
- package/dist/cjs/DSTabsCTX.js.map +2 -2
- package/dist/cjs/config/useTabs.js +2 -2
- package/dist/cjs/config/useTabs.js.map +2 -2
- package/dist/cjs/exported-related/DSTab.js +3 -5
- package/dist/cjs/exported-related/DSTab.js.map +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/parts/tabBar/TabBar.js +14 -3
- package/dist/cjs/parts/tabBar/TabBar.js.map +2 -2
- package/dist/cjs/parts/tabBar/styles.js +9 -0
- 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/tabsPanel/TabsPanels.js +1 -1
- package/dist/cjs/parts/tabsPanel/TabsPanels.js.map +2 -2
- package/dist/cjs/{propTypes.js → react-desc-prop-types.js} +8 -5
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/sharedTypes.js.map +1 -1
- package/dist/cjs/typescript-testing/typescript-tabs-valid.js +13 -8
- package/dist/cjs/typescript-testing/typescript-tabs-valid.js.map +2 -2
- package/dist/esm/DSTabs.js +1 -1
- package/dist/esm/DSTabs.js.map +2 -2
- package/dist/esm/DSTabsCTX.js +1 -1
- package/dist/esm/DSTabsCTX.js.map +1 -1
- package/dist/esm/config/useTabs.js +1 -1
- package/dist/esm/config/useTabs.js.map +1 -1
- package/dist/esm/exported-related/DSTab.js +2 -4
- package/dist/esm/exported-related/DSTab.js.map +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/parts/tabBar/TabBar.js +14 -3
- package/dist/esm/parts/tabBar/TabBar.js.map +2 -2
- package/dist/esm/parts/tabBar/styles.js +9 -0
- package/dist/esm/parts/tabBar/styles.js.map +2 -2
- package/dist/esm/parts/tabsContent/TabsContent.js +1 -1
- package/dist/esm/parts/tabsContent/TabsContent.js.map +2 -2
- package/dist/esm/parts/tabsPanel/TabsPanels.js +2 -2
- package/dist/esm/parts/tabsPanel/TabsPanels.js.map +2 -2
- package/dist/esm/{propTypes.js → react-desc-prop-types.js} +5 -2
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-tabs-valid.js +13 -8
- package/dist/esm/typescript-testing/typescript-tabs-valid.js.map +2 -2
- package/dist/types/DSTabs.d.ts +1 -1
- package/dist/types/config/useTabs.d.ts +1 -1
- package/dist/types/exported-related/DSTab.d.ts +3 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/parts/tabsPanel/TabsPanels.d.ts +1 -1
- package/dist/types/{propTypes.d.ts → react-desc-prop-types.d.ts} +3 -1
- package/dist/types/sharedTypes.d.ts +1 -1
- package/dist/types/tests/DSTabs.a11y.test.d.ts +1 -0
- package/package.json +7 -7
- package/dist/cjs/propTypes.js.map +0 -7
- package/dist/esm/propTypes.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-tabs-valid.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport React from 'react';\nimport { DSTabs, DSTab, TabTypes } from '../index.js';\nimport type { DSTabsT, DSTabT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForTabs = DSTabsT.Props;\ntype ComponentPropsTabsInternals = DSTabsT.InternalProps;\ntype ComponentPropsTabsDefaultProps = DSTabsT.DefaultProps;\ntype ComponentPropsTabsOptionalProps = DSTabsT.PropsOptional;\n\ntype ComponentPropsForTab = DSTabT.Props;\ntype ComponentPropsTabDefaultProps = DSTabT.DefaultProps;\ntype ComponentPropsTabOptionalProps = DSTabT.PropsOptional;\ntype ComponentPropsTabRequiredProps = DSTabT.PropsRequired;\n\nconst buttonRef = React.createRef() as React.MutableRefObject<HTMLButtonElement>;\nconst divRef = React.createRef() as React.MutableRefObject<HTMLDivElement>;\nconst MockComponent: React.ComponentType = () => <div></div>;\n\n// Tabs\nconst testTabsOptionalProps: ComponentPropsTabsOptionalProps = {\n activeTab: '',\n innerRef: divRef,\n firstSubtabRef: buttonRef,\n lastTabRef: buttonRef,\n TabBarExtraContent: MockComponent,\n tabBarExtraContent: '',\n};\n\n// Tab\nconst testTabRequiredProps: ComponentPropsTabRequiredProps = {\n children: <div></div>,\n};\n\nconst testTabOptionalProps: ComponentPropsTabOptionalProps = {\n disabled: false,\n onClick: () => {},\n onKeyDown: () => {},\n ref: buttonRef,\n required: true,\n style: {},\n title: '',\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\n\n// Tabs\nconst testTabsPartialDefaults: Partial<ComponentPropsTabsDefaultProps> = {\n allowTextSelection: false,\n isDSMobile: false,\n onTabChange: (tabId: string) => {},\n type: TabTypes.NORMAL,\n showSeparator: true,\n};\n\nconst testTabsProps: ComponentPropsForTabs = {\n ...testTabsOptionalProps,\n ...testTabsPartialDefaults,\n};\n\nconst testTabsPropsAsSyntax = {\n ...testTabsOptionalProps,\n ...testTabsPartialDefaults,\n} as ComponentPropsForTabs;\n\n// Tab\nconst testTabPartialDefaults: Partial<ComponentPropsTabDefaultProps> = {\n tabId: '',\n};\n\nconst testTabProps: ComponentPropsForTab = {\n ...testTabRequiredProps,\n ...testTabOptionalProps,\n ...testTabPartialDefaults,\n};\n\nconst testTabPropsAsSyntax = {\n ...testTabRequiredProps,\n ...testTabOptionalProps,\n ...testTabPartialDefaults,\n} as ComponentPropsForTab;\n\n// InternalProps requires all defaults to be filled in\n\n// Tabs\nconst testTabsCompleteDefaults: Required<ComponentPropsTabsDefaultProps> = {\n containerProps: {},\n animated: true,\n enableMouseEvents: false,\n allowTextSelection: false,\n onTabChange: (tabId: string) => {},\n tabsListAriaLabel: 'Tab list',\n type: TabTypes.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\nconst testTabsInternalProps: ComponentPropsTabsInternals = {\n ...testTabsOptionalProps,\n ...testTabsCompleteDefaults,\n};\n\nconst testTabsInternalPropsAsSyntax = {\n ...testTabsOptionalProps,\n ...testTabsCompleteDefaults,\n} as ComponentPropsTabsInternals;\n\n// Tab\nconst testTabCompleteDefaults: Required<ComponentPropsTabDefaultProps> = {\n tabId: '',\n};\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\n\n// Tabs\nconst testTabsExplicitDefinition: ComponentPropsForTabs = {\n containerProps: {},\n animated: true,\n enableMouseEvents: false,\n allowTextSelection: false,\n onTabChange: (tabId: string) => {},\n tabsListAriaLabel: 'Tab list',\n type: TabTypes.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 activeTab: '',\n innerRef: divRef,\n firstSubtabRef: buttonRef,\n lastTabRef: buttonRef,\n TabBarExtraContent: MockComponent,\n tabBarExtraContent: '',\n};\n\n// Tab\nconst testTabExplicitDefinition: ComponentPropsForTab = {\n children: [],\n disabled: false,\n onClick: () => {},\n onKeyDown: () => {},\n ref: buttonRef,\n required: true,\n style: {},\n title: '',\n tabId: '',\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\n\n// Tabs\nconst testTabsInferedTypeCompatibility = {\n containerProps: {},\n animated: true,\n enableMouseEvents: false,\n allowTextSelection: false,\n onTabChange: (tabId: string) => {},\n tabsListAriaLabel: 'Tab list',\n type: TabTypes.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 activeTab: '',\n innerRef: divRef,\n firstSubtabRef: buttonRef,\n lastTabRef: buttonRef,\n TabBarExtraContent: MockComponent,\n tabBarExtraContent: '',\n} as ComponentPropsForTabs;\n\nconst testTabsDefinitionAsConst = {\n containerProps: {},\n animated: true,\n enableMouseEvents: false,\n allowTextSelection: false,\n onTabChange: (tabId: string) => {},\n tabsListAriaLabel: 'Tab list',\n type: TabTypes.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 activeTab: '',\n innerRef: divRef,\n firstSubtabRef: buttonRef,\n lastTabRef: buttonRef,\n TabBarExtraContent: MockComponent,\n tabBarExtraContent: '',\n} as const;\n\n// Tab\nconst testTabInferedTypeCompatibility = {\n children: <div></div>,\n disabled: false,\n onClick: () => {},\n onKeyDown: () => {},\n ref: buttonRef,\n required: true,\n style: {},\n title: '',\n tabId: '',\n} as ComponentPropsForTab;\n\nconst testTabDefinitionAsConst = {\n children: <div></div>,\n disabled: false,\n onClick: () => {},\n onKeyDown: () => {},\n ref: buttonRef,\n required: true,\n style: {},\n title: '',\n tabId: '',\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSTabs {...testTabsExplicitDefinition} />\n <DSTabs {...testTabsInferedTypeCompatibility}></DSTabs>\n <DSTabs {...testTabsDefinitionAsConst}></DSTabs>\n\n <DSTab {...testTabExplicitDefinition} />\n <DSTab {...testTabInferedTypeCompatibility} />\n <DSTab {...testTabDefinitionAsConst} />\n\n {/* works with inline values */}\n <DSTabs\n containerProps={{}}\n animated
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/jsx-no-duplicate-props */\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport React from 'react';\nimport { DSTabs, DSTab, TabTypes } from '../index.js';\nimport type { DSTabsT, DSTabT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForTabs = DSTabsT.Props;\ntype ComponentPropsTabsInternals = DSTabsT.InternalProps;\ntype ComponentPropsTabsDefaultProps = DSTabsT.DefaultProps;\ntype ComponentPropsTabsOptionalProps = DSTabsT.PropsOptional;\n\ntype ComponentPropsForTab = DSTabT.Props;\ntype ComponentPropsTabDefaultProps = DSTabT.DefaultProps;\ntype ComponentPropsTabOptionalProps = DSTabT.PropsOptional;\ntype ComponentPropsTabRequiredProps = DSTabT.PropsRequired;\n\nconst buttonRef = React.createRef() as React.MutableRefObject<HTMLButtonElement>;\nconst divRef = React.createRef() as React.MutableRefObject<HTMLDivElement>;\nconst MockComponent: React.ComponentType = () => <div></div>;\n\n// Tabs\nconst testTabsOptionalProps: ComponentPropsTabsOptionalProps = {\n activeTab: '',\n innerRef: divRef,\n firstSubtabRef: buttonRef,\n lastTabRef: buttonRef,\n TabBarExtraContent: MockComponent,\n tabBarExtraContent: '',\n};\n\n// Tab\nconst testTabRequiredProps: ComponentPropsTabRequiredProps = {\n children: <div></div>,\n};\n\nconst testTabOptionalProps: ComponentPropsTabOptionalProps = {\n disabled: false,\n onClick: () => {},\n onKeyDown: () => {},\n ref: buttonRef,\n required: true,\n style: {},\n title: '',\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\n\n// Tabs\nconst testTabsPartialDefaults: Partial<ComponentPropsTabsDefaultProps> = {\n allowTextSelection: false,\n isDSMobile: false,\n onTabChange: (tabId: string) => {},\n type: TabTypes.NORMAL,\n showSeparator: true,\n};\n\nconst testTabsProps: ComponentPropsForTabs = {\n ...testTabsOptionalProps,\n ...testTabsPartialDefaults,\n};\n\nconst testTabsPropsAsSyntax = {\n ...testTabsOptionalProps,\n ...testTabsPartialDefaults,\n} as ComponentPropsForTabs;\n\n// Tab\nconst testTabPartialDefaults: Partial<ComponentPropsTabDefaultProps> = {\n tabId: '',\n};\n\nconst testTabProps: ComponentPropsForTab = {\n ...testTabRequiredProps,\n ...testTabOptionalProps,\n ...testTabPartialDefaults,\n};\n\nconst testTabPropsAsSyntax = {\n ...testTabRequiredProps,\n ...testTabOptionalProps,\n ...testTabPartialDefaults,\n} as ComponentPropsForTab;\n\n// InternalProps requires all defaults to be filled in\n\n// Tabs\nconst testTabsCompleteDefaults: Required<ComponentPropsTabsDefaultProps> = {\n containerProps: {},\n animated: true,\n enableMouseEvents: false,\n allowTextSelection: false,\n onTabChange: (tabId: string) => {},\n tabsListAriaLabel: 'Tab list',\n type: TabTypes.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\nconst testTabsInternalProps: ComponentPropsTabsInternals = {\n ...testTabsOptionalProps,\n ...testTabsCompleteDefaults,\n};\n\nconst testTabsInternalPropsAsSyntax = {\n ...testTabsOptionalProps,\n ...testTabsCompleteDefaults,\n} as ComponentPropsTabsInternals;\n\n// Tab\nconst testTabCompleteDefaults: Required<ComponentPropsTabDefaultProps> = {\n tabId: '',\n applyAriaDisabled: false,\n};\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\n\n// Tabs\nconst testTabsExplicitDefinition: ComponentPropsForTabs = {\n containerProps: {},\n animated: true,\n enableMouseEvents: false,\n allowTextSelection: false,\n onTabChange: (tabId: string) => {},\n tabsListAriaLabel: 'Tab list',\n type: TabTypes.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 activeTab: '',\n innerRef: divRef,\n firstSubtabRef: buttonRef,\n lastTabRef: buttonRef,\n TabBarExtraContent: MockComponent,\n tabBarExtraContent: '',\n};\n\n// Tab\nconst testTabExplicitDefinition: ComponentPropsForTab = {\n children: [],\n disabled: false,\n onClick: () => {},\n onKeyDown: () => {},\n ref: buttonRef,\n required: true,\n style: {},\n title: '',\n tabId: '',\n applyAriaDisabled: false,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\n\n// Tabs\nconst testTabsInferedTypeCompatibility = {\n containerProps: {},\n animated: true,\n enableMouseEvents: false,\n allowTextSelection: false,\n onTabChange: (tabId: string) => {},\n tabsListAriaLabel: 'Tab list',\n type: TabTypes.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 activeTab: '',\n innerRef: divRef,\n firstSubtabRef: buttonRef,\n lastTabRef: buttonRef,\n TabBarExtraContent: MockComponent,\n tabBarExtraContent: '',\n} as ComponentPropsForTabs;\n\nconst testTabsDefinitionAsConst = {\n containerProps: {},\n animated: true,\n enableMouseEvents: false,\n allowTextSelection: false,\n onTabChange: (tabId: string) => {},\n tabsListAriaLabel: 'Tab list',\n type: TabTypes.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 activeTab: '',\n innerRef: divRef,\n firstSubtabRef: buttonRef,\n lastTabRef: buttonRef,\n TabBarExtraContent: MockComponent,\n tabBarExtraContent: '',\n} as const;\n\n// Tab\nconst testTabInferedTypeCompatibility = {\n children: <div></div>,\n disabled: false,\n onClick: () => {},\n onKeyDown: () => {},\n ref: buttonRef,\n required: true,\n style: {},\n title: '',\n tabId: '',\n applyAriaDisabled: false,\n} as ComponentPropsForTab;\n\nconst testTabDefinitionAsConst = {\n children: <div></div>,\n disabled: false,\n onClick: () => {},\n onKeyDown: () => {},\n ref: buttonRef,\n required: true,\n style: {},\n title: '',\n tabId: '',\n applyAriaDisabled: false,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSTabs {...testTabsExplicitDefinition} />\n <DSTabs {...testTabsInferedTypeCompatibility}></DSTabs>\n <DSTabs {...testTabsDefinitionAsConst}></DSTabs>\n\n <DSTab {...testTabExplicitDefinition} />\n <DSTab {...testTabInferedTypeCompatibility} />\n <DSTab {...testTabDefinitionAsConst} />\n\n {/* works with inline values */}\n <DSTabs\n containerProps={{}}\n animated\n enableMouseEvents={false}\n allowTextSelection={false}\n onTabChange={(tabId: string) => {}}\n tabsListAriaLabel=\"Tab list\"\n type={TabTypes.NORMAL}\n onlyRenderActiveTab={false}\n withCarousel={false}\n isDSMobile={false}\n showSelectionIndicator\n fixedTabsHeaders={false}\n showSeparator\n tabPanelsProps={{}}\n swipeableViewsContainerProps={{}}\n activeTab=\"\"\n innerRef={divRef}\n firstSubtabRef={buttonRef}\n lastTabRef={buttonRef}\n TabBarExtraContent={MockComponent}\n tabBarExtraContent=\"\"\n >\n {[]}\n </DSTabs>\n\n <DSTab\n disabled={false}\n onClick={() => {}}\n onKeyDown={() => {}}\n ref={buttonRef}\n required\n style={{}}\n title=\"\"\n tabId=\"\"\n applyAriaDisabled={false}\n >\n <div></div>\n </DSTab>\n </>\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACoB0B;AAj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;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
package/dist/esm/DSTabs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
|
-
import { tabsPropTypes } from "./
|
|
4
|
+
import { tabsPropTypes } from "./react-desc-prop-types.js";
|
|
5
5
|
import { DSTabsContext, DSTabsCrossRefContext } from "./DSTabsCTX.js";
|
|
6
6
|
import { TabsContent } from "./parts/tabsContent/TabsContent.js";
|
|
7
7
|
import { useTabs } from "./config/useTabs.js";
|
package/dist/esm/DSTabs.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSTabs.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, type ValidationMap } from '@elliemae/ds-props-helpers';\nimport { tabsPropTypes } from './react-desc-prop-types.js';\nimport { DSTabsContext, DSTabsCrossRefContext } from './DSTabsCTX.js';\nimport { TabsContent } from './parts/tabsContent/TabsContent.js';\nimport { useTabs } from './config/useTabs.js';\nimport { useCrossRef } from './config/useCrossRef.js';\nimport { TabTypes } from './utils/constants.js';\nimport type { DSTabsT } from './react-desc-prop-types.js';\n\nconst DSTabs = (props: DSTabsT.Props): JSX.Element => {\n const ctx = useTabs(props);\n const crossRefsCtx = useCrossRef();\n\n const { type } = props;\n\n if (type === TabTypes.SUBTABS) {\n return (\n <DSTabsContext.Provider value={ctx}>\n <TabsContent />\n </DSTabsContext.Provider>\n );\n }\n\n return (\n <DSTabsCrossRefContext.Provider value={crossRefsCtx}>\n <DSTabsContext.Provider value={ctx}>\n <TabsContent />\n </DSTabsContext.Provider>\n </DSTabsCrossRefContext.Provider>\n );\n};\n\nDSTabs.displayName = 'DSTabs';\nconst DSTabsWithSchema = describe(DSTabs);\nDSTabsWithSchema.propTypes = tabsPropTypes as unknown as ValidationMap<DSTabsT.Props>;\n\nexport { DSTabs, DSTabsWithSchema };\nexport default DSTabs;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmBf;AAlBR,SAAS,gBAAoC;AAC7C,SAAS,qBAAqB;AAC9B,SAAS,eAAe,6BAA6B;AACrD,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AAGzB,MAAM,SAAS,CAAC,UAAsC;AACpD,QAAM,MAAM,QAAQ,KAAK;AACzB,QAAM,eAAe,YAAY;AAEjC,QAAM,EAAE,KAAK,IAAI;AAEjB,MAAI,SAAS,SAAS,SAAS;AAC7B,WACE,oBAAC,cAAc,UAAd,EAAuB,OAAO,KAC7B,8BAAC,eAAY,GACf;AAAA,EAEJ;AAEA,SACE,oBAAC,sBAAsB,UAAtB,EAA+B,OAAO,cACrC,8BAAC,cAAc,UAAd,EAAuB,OAAO,KAC7B,8BAAC,eAAY,GACf,GACF;AAEJ;AAEA,OAAO,cAAc;AACrB,MAAM,mBAAmB,SAAS,MAAM;AACxC,iBAAiB,YAAY;AAG7B,IAAO,iBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSTabsCTX.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { createContext, createRef } from "react";
|
|
3
|
-
import { tabsDefaultProps as defaultProps } from "./
|
|
3
|
+
import { tabsDefaultProps as defaultProps } from "./react-desc-prop-types.js";
|
|
4
4
|
const noop = () => {
|
|
5
5
|
};
|
|
6
6
|
const defaultContext = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSTabsCTX.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext, createRef } from 'react';\nimport { tabsDefaultProps as defaultProps } from './
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createContext, createRef } from 'react';\nimport { tabsDefaultProps as defaultProps } from './react-desc-prop-types.js';\nimport type { DSTabsInternalsT } from './sharedTypes.js';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nconst defaultContext = {\n props: defaultProps,\n tabsRef: createRef<Record<number, HTMLButtonElement> | null>(),\n tabsListRef: createRef<HTMLDivElement | null>(),\n carouselOnlyListRef: createRef<HTMLDivElement | null>(),\n focusableTabsRef: createRef<HTMLButtonElement[] | null>(),\n tabsRefAsArray: createRef<HTMLButtonElement[] | null>(),\n actualActiveTabRef: createRef<HTMLButtonElement | null>(),\n setInternalActiveTab: noop,\n actualActiveTab: '',\n};\n\nconst defaultCrossRefsContext = {\n lastTabInternalRef: createRef<HTMLButtonElement | null>(),\n firstSubtabInternalRef: createRef<HTMLButtonElement | null>(),\n};\n\nexport const DSTabsContext = createContext<DSTabsInternalsT.DSTabsUseTabsContextT>(defaultContext);\nexport const DSTabsCrossRefContext = createContext<DSTabsInternalsT.DSTabsUseCrossRefContextT>(defaultCrossRefsContext);\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe,iBAAiB;AACzC,SAAS,oBAAoB,oBAAoB;AAIjD,MAAM,OAAO,MAAM;AAAC;AAEpB,MAAM,iBAAiB;AAAA,EACrB,OAAO;AAAA,EACP,SAAS,UAAoD;AAAA,EAC7D,aAAa,UAAiC;AAAA,EAC9C,qBAAqB,UAAiC;AAAA,EACtD,kBAAkB,UAAsC;AAAA,EACxD,gBAAgB,UAAsC;AAAA,EACtD,oBAAoB,UAAoC;AAAA,EACxD,sBAAsB;AAAA,EACtB,iBAAiB;AACnB;AAEA,MAAM,0BAA0B;AAAA,EAC9B,oBAAoB,UAAoC;AAAA,EACxD,wBAAwB,UAAoC;AAC9D;AAEO,MAAM,gBAAgB,cAAsD,cAAc;AAC1F,MAAM,wBAAwB,cAA0D,uBAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useRef, useState, useMemo, useEffect } from "react";
|
|
3
3
|
import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
4
|
-
import { tabsDefaultProps } from "../
|
|
4
|
+
import { tabsDefaultProps } from "../react-desc-prop-types.js";
|
|
5
5
|
const useTabs = (props) => {
|
|
6
6
|
const propsWithDefaults = useMemoMergePropsWithDefault(props, tabsDefaultProps);
|
|
7
7
|
const { activeTab } = propsWithDefaults;
|
|
@@ -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", "import { useRef, useState, useMemo, useEffect } from 'react';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { tabsDefaultProps } from '../
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useRef, useState, useMemo, useEffect } from 'react';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { tabsDefaultProps } from '../react-desc-prop-types.js';\nimport type { DSTabsT } from '../react-desc-prop-types.js';\nimport type { DSTabsInternalsT } from '../sharedTypes.js';\n\nexport const useTabs = (props: DSTabsT.Props): DSTabsInternalsT.DSTabsUseTabsContextT => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSTabsT.InternalProps>(props, tabsDefaultProps);\n\n const { activeTab } = 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 const [internalActiveTab, setInternalActiveTab] = useState<string>('');\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');\n setInternalActiveTab(firstAvailableTab?.dataset.tabId || '');\n }\n }, [activeTab]);\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 }),\n [actualActiveTab, propsWithDefaults],\n );\n\n return ctx;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,UAAU,SAAS,iBAAiB;AACrD,SAAS,oCAAoC;AAC7C,SAAS,wBAAwB;AAI1B,MAAM,UAAU,CAAC,UAAiE;AACvF,QAAM,oBAAoB,6BAAoD,OAAO,gBAAgB;AAErG,QAAM,EAAE,UAAU,IAAI;AAEtB,QAAM,UAAU,OAA0C,CAAC,CAAC;AAC5D,QAAM,iBAAiB,OAA4B,CAAC,CAAC;AACrD,QAAM,mBAAmB,OAA4B,CAAC,CAAC;AACvD,QAAM,sBAAsB,OAA8B,IAAI;AAC9D,QAAM,cAAc,OAA8B,IAAI;AACtD,QAAM,qBAAqB,OAAiC,IAAI;AAEhE,QAAM,CAAC,mBAAmB,oBAAoB,IAAI,SAAiB,EAAE;AAErE,QAAM,kBAAkB,QAAQ,MAAM;AACpC,QAAI,cAAc,OAAW,QAAO;AACpC,WAAO;AAAA,EACT,GAAG,CAAC,WAAW,iBAAiB,CAAC;AAEjC,YAAU,MAAM;AACd,uBAAmB,UAAU,iBAAiB,QAAQ,KAAK,CAAC,OAAO,GAAG,QAAQ,UAAU,eAAe,KAAK;AAAA,EAC9G,GAAG,CAAC,eAAe,CAAC;AAEpB,YAAU,MAAM;AACd,QAAI,cAAc,QAAW;AAC3B,YAAM,oBAAoB,iBAAiB,QAAQ,KAAK,CAAC,OAAO,GAAG,iBAAiB,MAAM;AAC1F,2BAAqB,mBAAmB,QAAQ,SAAS,EAAE;AAAA,IAC7D;AAAA,EACF,GAAG,CAAC,SAAS,CAAC;AAEd,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,IACF;AAAA,IACA,CAAC,iBAAiB,iBAAiB;AAAA,EACrC;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import React2 from "react";
|
|
4
2
|
import { describe } from "@elliemae/ds-props-helpers";
|
|
5
|
-
import { tabPropTypes } from "../
|
|
6
|
-
const DSTab = (props) =>
|
|
3
|
+
import { tabPropTypes } from "../react-desc-prop-types.js";
|
|
4
|
+
const DSTab = (props) => props.children;
|
|
7
5
|
DSTab.displayName = "DSTab";
|
|
8
6
|
const DSTabWithSchema = describe(DSTab);
|
|
9
7
|
DSTabWithSchema.propTypes = tabPropTypes;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/exported-related/DSTab.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { describe, type ValidationMap } from '@elliemae/ds-props-helpers';\nimport { tabPropTypes } from '../react-desc-prop-types.js';\nimport type { DSTabT } from '../react-desc-prop-types.js';\n\n// const DSTab = (props: DSTabT.Props): JSX.Element => <React.Fragment {...props} />;\nconst DSTab = (props: DSTabT.Props) => props.children;\n\nDSTab.displayName = 'DSTab';\nconst DSTabWithSchema = describe(DSTab);\nDSTabWithSchema.propTypes = tabPropTypes as unknown as ValidationMap<DSTabT.Props>;\n\nexport { DSTab, DSTabWithSchema };\nexport default DSTab;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,gBAAoC;AAC7C,SAAS,oBAAoB;AAI7B,MAAM,QAAQ,CAAC,UAAwB,MAAM;AAE7C,MAAM,cAAc;AACpB,MAAM,kBAAkB,SAAS,KAAK;AACtC,gBAAgB,YAAY;AAG5B,IAAO,gBAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
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 * from './exported-related/DSTab.js';\nexport * from './DSTabs.js';\nexport { TabTypes } from './utils/constants.js';\nexport * from './DSTabsDatatestid.js';\nexport type { DSTabT, DSTabsT } from './
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './exported-related/DSTab.js';\nexport * from './DSTabs.js';\nexport { TabTypes } from './utils/constants.js';\nexport * from './DSTabsDatatestid.js';\nexport type { DSTabT, DSTabsT } from './react-desc-prop-types.js';\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,SAAS,gBAAgB;AACzB,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -35,7 +35,17 @@ const TabBar = () => {
|
|
|
35
35
|
const renderTabs = useMemo(() => {
|
|
36
36
|
const availableTabIndexes = [];
|
|
37
37
|
return React2.Children.map(tabs, (tab, index) => {
|
|
38
|
-
const {
|
|
38
|
+
const {
|
|
39
|
+
tabId = "",
|
|
40
|
+
title = "",
|
|
41
|
+
style,
|
|
42
|
+
required = false,
|
|
43
|
+
disabled = false,
|
|
44
|
+
applyAriaDisabled = false,
|
|
45
|
+
ref,
|
|
46
|
+
onClick,
|
|
47
|
+
onKeyDown
|
|
48
|
+
} = tab.props;
|
|
39
49
|
if (!disabled) availableTabIndexes.push(index);
|
|
40
50
|
return /* @__PURE__ */ jsxs(
|
|
41
51
|
StyledTabButton,
|
|
@@ -58,8 +68,8 @@ const TabBar = () => {
|
|
|
58
68
|
},
|
|
59
69
|
type: "button",
|
|
60
70
|
"aria-controls": tabId,
|
|
61
|
-
"aria-selected": actualActiveTab === tabId,
|
|
62
|
-
"aria-disabled": disabled,
|
|
71
|
+
"aria-selected": actualActiveTab === tabId && !applyAriaDisabled,
|
|
72
|
+
"aria-disabled": disabled || applyAriaDisabled,
|
|
63
73
|
isDSMobile,
|
|
64
74
|
fixedTabsHeaders,
|
|
65
75
|
tabType: type,
|
|
@@ -73,6 +83,7 @@ const TabBar = () => {
|
|
|
73
83
|
"data-testid": type === TabTypes.NORMAL ? DSTabsDatatestid.TAB_BUTTON : DSTabsDatatestid.SUBTAB_BUTTON,
|
|
74
84
|
id: `${tabId}-label`,
|
|
75
85
|
onClick: (e) => {
|
|
86
|
+
if (applyAriaDisabled) return;
|
|
76
87
|
if (!disabled) {
|
|
77
88
|
handleOnTabChange(tabId, e);
|
|
78
89
|
updateIndicatorStyle();
|
|
@@ -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, { useMemo, useContext } from 'react';\nimport { Carousel } from '../carousel/Carousel.js';\nimport { useTabBar } from './useTabBar.js';\nimport {\n StyledTabButton,\n StyledMobileGradient,\n StyledTabList,\n StyledTabWrapper,\n StyledSelectionIndicator,\n StyledSubTabsList,\n StyledRequiredMark,\n} from './styles.js';\nimport { DSTabsContext, DSTabsCrossRefContext } from '../../DSTabsCTX.js';\nimport { useKeyboardNavigation } from '../../utils/hooks/useKeyboardNavigation.js';\nimport { centerTab } from '../../utils/helpers.js';\nimport { TabTypes } from '../../utils/constants.js';\nimport { useTabsCallbacks } from '../../utils/hooks/useTabsCallbacks.js';\nimport { DSTabsDatatestid } from '../../DSTabsDatatestid.js';\nimport type { DSTabT } from '../../
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useMemo, useContext } from 'react';\nimport { Carousel } from '../carousel/Carousel.js';\nimport { useTabBar } from './useTabBar.js';\nimport {\n StyledTabButton,\n StyledMobileGradient,\n StyledTabList,\n StyledTabWrapper,\n StyledSelectionIndicator,\n StyledSubTabsList,\n StyledRequiredMark,\n} from './styles.js';\nimport { DSTabsContext, DSTabsCrossRefContext } from '../../DSTabsCTX.js';\nimport { useKeyboardNavigation } from '../../utils/hooks/useKeyboardNavigation.js';\nimport { centerTab } from '../../utils/helpers.js';\nimport { TabTypes } from '../../utils/constants.js';\nimport { useTabsCallbacks } from '../../utils/hooks/useTabsCallbacks.js';\nimport { DSTabsDatatestid } from '../../DSTabsDatatestid.js';\nimport type { DSTabT } from '../../react-desc-prop-types.js';\n\nexport const TabBar = (): JSX.Element => {\n const {\n tabsRef,\n focusableTabsRef,\n tabsListRef,\n tabsRefAsArray,\n carouselOnlyListRef,\n actualActiveTab,\n props: { type, fixedTabsHeaders, withCarousel, isDSMobile, showSeparator, children: tabs },\n } = useContext(DSTabsContext);\n\n const { lastTabInternalRef, firstSubtabInternalRef } = useContext(DSTabsCrossRefContext);\n const { handleOnTabChange } = useTabsCallbacks();\n const { handleOnKeyDown } = useKeyboardNavigation();\n\n const { indicatorStyle, mobileGradients, updateMobileGradients, updateIndicatorStyle } = useTabBar();\n\n const renderTabs = useMemo(() => {\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 } = tab.props;\n\n if (!disabled) availableTabIndexes.push(index);\n return (\n <StyledTabButton\n key={tabId}\n role=\"tab\"\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 === TabTypes.SUBTABS && firstSubtabInternalRef && index === availableTabIndexes[0]) {\n firstSubtabInternalRef.current = tabButtonRef;\n }\n if (type !== TabTypes.SUBTABS && index === availableTabIndexes[availableTabIndexes.length - 1]) {\n lastTabInternalRef.current = tabButtonRef;\n }\n if (ref) ref.current = tabButtonRef;\n }\n }}\n type=\"button\"\n aria-controls={tabId}\n aria-selected={actualActiveTab === tabId && !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 !== TabTypes.NORMAL}\n data-testid={type === TabTypes.NORMAL ? DSTabsDatatestid.TAB_BUTTON : DSTabsDatatestid.SUBTAB_BUTTON}\n id={`${tabId}-label`}\n onClick={(e) => {\n if (applyAriaDisabled) return;\n if (!disabled) {\n handleOnTabChange(tabId, e);\n updateIndicatorStyle();\n }\n if (onClick && !disabled) onClick(tabId, e);\n }}\n onFocus={(e) => {\n if (withCarousel) centerTab({ e, listRef: carouselOnlyListRef });\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') e.stopPropagation();\n if (!disabled) handleOnKeyDown(e);\n if (onKeyDown && !disabled) onKeyDown(e);\n }}\n style={style}\n >\n {title}\n {required && <StyledRequiredMark>●</StyledRequiredMark>}\n </StyledTabButton>\n );\n });\n }, [\n tabs,\n actualActiveTab,\n isDSMobile,\n fixedTabsHeaders,\n type,\n withCarousel,\n showSeparator,\n tabsRefAsArray,\n focusableTabsRef,\n tabsRef,\n firstSubtabInternalRef,\n lastTabInternalRef,\n handleOnTabChange,\n updateIndicatorStyle,\n carouselOnlyListRef,\n handleOnKeyDown,\n ]);\n\n if (type === TabTypes.SUBTABS && !isDSMobile) {\n return (\n <StyledSubTabsList\n withCarousel={withCarousel}\n data-testid={DSTabsDatatestid.SUB_TAB_LIST}\n role={withCarousel ? undefined : 'tablist'}\n innerRef={tabsListRef}\n >\n {withCarousel ? <Carousel>{renderTabs}</Carousel> : renderTabs}\n </StyledSubTabsList>\n );\n }\n\n return (\n <StyledTabList\n withCarousel={withCarousel}\n role={withCarousel ? undefined : 'tablist'}\n innerRef={tabsListRef}\n data-testid={DSTabsDatatestid.TAB_LIST}\n isDSMobile={isDSMobile}\n fixedTabsHeaders={fixedTabsHeaders}\n mobileGradients={mobileGradients}\n onScroll={updateMobileGradients}\n indicatorStyle={indicatorStyle}\n tabType={type}\n >\n <StyledTabWrapper data-testid=\"tab-wrapper\" isDSMobile={isDSMobile} fixedTabsHeaders={fixedTabsHeaders}>\n {!isDSMobile && withCarousel ? (\n <Carousel updateIndicatorStyle={updateIndicatorStyle}>{renderTabs}</Carousel>\n ) : (\n renderTabs\n )}\n </StyledTabWrapper>\n <StyledSelectionIndicator isDSMobile={isDSMobile} tabType={type} />\n {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;ACwDf,SAqDe,KArDf;AAvDR,OAAOA,UAAS,SAAS,kBAAkB;AAC3C,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe,6BAA6B;AACrD,SAAS,6BAA6B;AACtC,SAAS,iBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAG1B,MAAM,SAAS,MAAmB;AACvC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,MAAM,kBAAkB,cAAc,YAAY,eAAe,UAAU,KAAK;AAAA,EAC3F,IAAI,WAAW,aAAa;AAE5B,QAAM,EAAE,oBAAoB,uBAAuB,IAAI,WAAW,qBAAqB;AACvF,QAAM,EAAE,kBAAkB,IAAI,iBAAiB;AAC/C,QAAM,EAAE,gBAAgB,IAAI,sBAAsB;AAElD,QAAM,EAAE,gBAAgB,iBAAiB,uBAAuB,qBAAqB,IAAI,UAAU;AAEnG,QAAM,aAAa,QAAQ,MAAM;AAC/B,UAAM,sBAAgC,CAAC;AAEvC,WAAOA,OAAM,SAAS,IAAI,MAAM,CAAC,KAAuC,UAAU;AAChF,YAAM;AAAA,QACJ,QAAQ;AAAA,QACR,QAAQ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,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": ["React"]
|
|
7
7
|
}
|
|
@@ -96,6 +96,15 @@ const StyledTabButton = styled.button`
|
|
|
96
96
|
}
|
|
97
97
|
`}
|
|
98
98
|
|
|
99
|
+
${({ theme }) => `
|
|
100
|
+
&[aria-disabled='true'] {
|
|
101
|
+
color: ${theme.colors.neutral[500]};
|
|
102
|
+
cursor: not-allowed;
|
|
103
|
+
&:hover {
|
|
104
|
+
color: ${theme.colors.brand[600]};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`}
|
|
99
108
|
|
|
100
109
|
${({ theme, showSeparator, tabType }) => showSeparator ? `
|
|
101
110
|
&:not(:last-of-type):before
|
|
@@ -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';\nimport { TabTypes } from '../../utils/constants.js';\nimport type { DSTabsInternalsT } from '../../sharedTypes.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 === TabTypes.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 === TabTypes.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 === TabTypes.NORMAL ? `height: 32px;` : `height: 22px;`)}\n\n ${({ theme, isActive, disabled }) =>\n isActive && !disabled\n ? `\n font-weight: ${theme.fontWeights.semibold};\n ${safariAndFirefoxBold(`#353C46`)}\n\n &:hover {\n ${safariAndFirefoxBold(`#1E79C2`)}\n }\n \n `\n : `\n \n `}\n\n ${({ theme, disabled }) =>\n disabled\n ? `\n color: ${theme.colors.neutral[500]};\n cursor: not-allowed;\n `\n : `\n &:hover {\n color: ${theme.colors.brand[600]};\n }\n `}\n\n\n ${({ theme, showSeparator, tabType }) =>\n showSeparator\n ? `\n &:not(:last-of-type):before\n {\n content: \"\";\n position: absolute;\n width: 1px;\n right: -16px;\n top: 50%;\n transform: translateY(-50%);\n height: ${tabType === TabTypes.SUBTABS ? `10px` : `16px`};\n background: ${theme.colors.neutral[400]};\n }`\n : ``}\n\n ${({ theme, isDSMobile, tabType, isActive }) =>\n !isDSMobile\n ? `\n &:focus {\n outline: none;\n &:after {\n position: absolute;\n content: '';\n top: 0;\n left: -16px;\n width: calc(100% + 32px);\n height: 100%;\n z-index: 5;\n border-radius: 2px;\n border: 2px solid ${theme.colors.brand[700]};\n }\n\n ${\n tabType !== TabTypes.SUBTABS && isActive\n ? `\n &:before {\n position: absolute;\n content: '';\n left: -16px;\n right: 0;\n top: calc(100% - 2px);\n transform: none;\n width: calc(100% + 32px);\n height: 2px;\n z-index: 10;\n background: linear-gradient(to right, transparent 0px, transparent 12px, white 12px, white 16px, transparent 16px,transparent calc(100% - 16px), white calc(100% - 16px), white calc(100% - 12px), transparent calc(100% - 12px), transparent 100%);\n }\n `\n : ``\n }\n }\n \n `\n : ``}\n\n \n \n${({ theme, isActive, disabled, isDSMobile }) =>\n isDSMobile\n ? `\n height: 40px;\n color: ${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 !== TabTypes.NORMAL_SMALL && !isDSMobile\n ? `\n &:after {\n content: '';\n position: absolute;\n width: 100%;\n height: 1px;\n box-shadow: 0px 0px 0px 1px ${theme.colors.neutral[400]};\n pointer-events: none;\n bottom: 0px;\n }\n `\n : ``}\n\n ${StyledTabButton} {\n padding-bottom: 0;\n padding-top: 0;\n }\n\n ${({ theme, isDSMobile }) =>\n isDSMobile\n ? `\n \n background: ${theme.colors.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.dan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M;AAC7C,MAAI,YAAY,SAAS,QAAS,QAAO;AACzC,SAAO,aAAa,SAAS;AAC/B,CAAC;AAAA;AAAA;AAAA;AAAA,kBAIe,CAAC,EAAE,kBAAkB,WAAW,MAAM;AACpD,MAAI,iBAAkB,QAAO;AAC7B,MAAI,CAAC,oBAAoB,WAAY,QAAO;AAC5C,SAAO;AACT,CAAC;AAAA;AAAA,iBAEc,CAAC,EAAE,kBAAkB,WAAW,MAAM;AACnD,MAAI,iBAAkB,QAAO;AAC7B,MAAI,CAAC,oBAAoB,WAAY,QAAO;AAC5C,SAAO;AACT,CAAC;AAAA;AAAA,WAEQ,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA,IAC/C,qBAAqB,yCAAyC,CAAC;AAAA;AAAA,IAE/D,CAAC,EAAE,QAAQ,MAAO,YAAY,SAAS,SAAS,kBAAkB,eAAgB;AAAA;AAAA,IAElF,CAAC,EAAE,OAAO,UAAU,SAAS,MAC7B,YAAY,CAAC,WACT;AAAA,0BACkB,MAAM,YAAY,QAAQ;AAAA,YACxC,qBAAqB,SAAS,CAAC;AAAA;AAAA;AAAA,cAG7B,qBAAqB,SAAS,CAAC;AAAA;AAAA;AAAA,YAIrC;AAAA;AAAA,OAED;AAAA;AAAA,IAEH,CAAC,EAAE,OAAO,SAAS,MACnB,WACI;AAAA,mBACW,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA,YAGpC;AAAA;AAAA,iBAES,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA,WAE7B;AAAA;AAAA;AAAA,
|
|
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';\nimport { TabTypes } from '../../utils/constants.js';\nimport type { DSTabsInternalsT } from '../../sharedTypes.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 === TabTypes.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 === TabTypes.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 === TabTypes.NORMAL ? `height: 32px;` : `height: 22px;`)}\n\n ${({ theme, isActive, disabled }) =>\n isActive && !disabled\n ? `\n font-weight: ${theme.fontWeights.semibold};\n ${safariAndFirefoxBold(`#353C46`)}\n\n &:hover {\n ${safariAndFirefoxBold(`#1E79C2`)}\n }\n \n `\n : `\n \n `}\n\n ${({ theme, disabled }) =>\n disabled\n ? `\n color: ${theme.colors.neutral[500]};\n cursor: not-allowed;\n `\n : `\n &:hover {\n color: ${theme.colors.brand[600]};\n }\n `}\n\n ${({ theme }) => `\n &[aria-disabled='true'] {\n color: ${theme.colors.neutral[500]};\n cursor: not-allowed;\n &:hover {\n color: ${theme.colors.brand[600]};\n }\n }\n `}\n\n ${({ theme, showSeparator, tabType }) =>\n showSeparator\n ? `\n &:not(:last-of-type):before\n {\n content: \"\";\n position: absolute;\n width: 1px;\n right: -16px;\n top: 50%;\n transform: translateY(-50%);\n height: ${tabType === TabTypes.SUBTABS ? `10px` : `16px`};\n background: ${theme.colors.neutral[400]};\n }`\n : ``}\n\n ${({ theme, isDSMobile, tabType, isActive }) =>\n !isDSMobile\n ? `\n &:focus {\n outline: none;\n &:after {\n position: absolute;\n content: '';\n top: 0;\n left: -16px;\n width: calc(100% + 32px);\n height: 100%;\n z-index: 5;\n border-radius: 2px;\n border: 2px solid ${theme.colors.brand[700]};\n }\n\n ${\n tabType !== TabTypes.SUBTABS && isActive\n ? `\n &:before {\n position: absolute;\n content: '';\n left: -16px;\n right: 0;\n top: calc(100% - 2px);\n transform: none;\n width: calc(100% + 32px);\n height: 2px;\n z-index: 10;\n background: linear-gradient(to right, transparent 0px, transparent 12px, white 12px, white 16px, transparent 16px,transparent calc(100% - 16px), white calc(100% - 16px), white calc(100% - 12px), transparent calc(100% - 12px), transparent 100%);\n }\n `\n : ``\n }\n }\n \n `\n : ``}\n\n \n \n${({ theme, isActive, disabled, isDSMobile }) =>\n isDSMobile\n ? `\n height: 40px;\n color: ${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 !== TabTypes.NORMAL_SMALL && !isDSMobile\n ? `\n &:after {\n content: '';\n position: absolute;\n width: 100%;\n height: 1px;\n box-shadow: 0px 0px 0px 1px ${theme.colors.neutral[400]};\n pointer-events: none;\n bottom: 0px;\n }\n `\n : ``}\n\n ${StyledTabButton} {\n padding-bottom: 0;\n padding-top: 0;\n }\n\n ${({ theme, isDSMobile }) =>\n isDSMobile\n ? `\n \n background: ${theme.colors.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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,QAAQ,sBAAsB,sBAAsB,UAAU;AACvE,SAAS,gBAAgB;AA0ClB,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,SAAS,aAAc,QAAO;AAC9C,SAAO;AACT,CAAC;AAAA;AAAA,gBAEa,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,IAAI;AAAA;AAAA;AAAA;AAAA,IAI3C,CAAC,EAAE,WAAW,MACd,aACI;AAAA;AAAA;AAAA,MAIA,EAAE;AAAA;AAGH,MAAM,uBAAuB,OAAO,IAAI,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,EAAE,OAAmC;AAAA,EAC7G,OAAO,EAAE,MAAM,OAAO,IAAI,UAAU,QAAQ,KAAK;AACnD,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQE,CAAC,EAAE,iBAAiB,EAAE,MAAM,MAAM,EAAE,MAAM;AAC1C,MAAI,SAAS;AACX,WAAO;AACT,MAAI;AACF,WAAO;AACT,MAAI,KAAM,QAAO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AwB;AAAA,MACtB,CAAC,EAAE,eAAe,MAAM;AAAA,eACf,eAAe,KAAK;AAAA,cACrB,eAAe,IAAI;AAAA,OAC1B;AAAA;AAAA;AAAA,IAGH,wBAAwB;AAAA,kBACV,CAAC,UAAU;AACvB,QAAM,EAAE,OAAO,gBAAgB,WAAW,IAAI;AAC9C,SAAO,CAAC,aACJ,gEAAgE,GAAG,MAAM,WAAW;AAAA,IAClF;AAAA,EACF,CAAC,UAAU,GAAG,MAAM,WAAW,EAAE,KAAK,CAAC,IAAI,eAAe,QAAQ,EAAE,mBAClE,eAAe,QAAQ,EACzB,mBAAmB,eAAe,KAAK,SACvC,MAAM,OAAO,MAAM,GAAG;AAC5B,CAAC;AAAA;AAAA;AAIE,MAAM,qBAAqB,OAAO;AAAA,WAC9B,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,OAAO,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -26,7 +26,7 @@ const TabsContent = () => {
|
|
|
26
26
|
/* @__PURE__ */ jsxs(StyledTabBarContainer, { "aria-label": tabsListAriaLabel, children: [
|
|
27
27
|
/* @__PURE__ */ jsx(TabBar, {}),
|
|
28
28
|
TabBarExtraContent ? /* @__PURE__ */ jsx(TabBarExtraContent, {}) : null,
|
|
29
|
-
tabBarExtraContent
|
|
29
|
+
tabBarExtraContent || null
|
|
30
30
|
] }),
|
|
31
31
|
/* @__PURE__ */ jsx(TabsPanels, {})
|
|
32
32
|
]
|
|
@@ -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';\nimport { DSTabsDatatestid } from '../../DSTabsDatatestid.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\n return (\n <div\n {...globalProps}\n {...xstyledProps}\n {...containerProps}\n ref={innerRef}\n data-testid={DSTabsDatatestid.TABS_CONTAINER}\n >\n <StyledTabBarContainer aria-label={tabsListAriaLabel}>\n <TabBar />\n {TabBarExtraContent ? <TabBarExtraContent /> : null}\n {tabBarExtraContent
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACyBjB,SACE,KADF;AAzBN,SAAgB,kBAAkB;AAClC,SAAS,wBAAwB,0BAA0B;AAC3D,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AAE1B,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;AAE7C,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,eAAa,iBAAiB;AAAA,MAE9B;AAAA,6BAAC,yBAAsB,cAAY,mBACjC;AAAA,8BAAC,UAAO;AAAA,UACP,qBAAqB,oBAAC,sBAAmB,IAAK;AAAA,UAC9C,
|
|
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';\nimport { DSTabsDatatestid } from '../../DSTabsDatatestid.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\n return (\n <div\n {...globalProps}\n {...xstyledProps}\n {...containerProps}\n ref={innerRef}\n data-testid={DSTabsDatatestid.TABS_CONTAINER}\n >\n <StyledTabBarContainer aria-label={tabsListAriaLabel}>\n <TabBar />\n {TabBarExtraContent ? <TabBarExtraContent /> : null}\n {tabBarExtraContent || null}\n </StyledTabBarContainer>\n <TabsPanels />\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACyBjB,SACE,KADF;AAzBN,SAAgB,kBAAkB;AAClC,SAAS,wBAAwB,0BAA0B;AAC3D,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AACvB,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AAE1B,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;AAE7C,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,eAAa,iBAAiB;AAAA,MAE9B;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,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createElement } from "react";
|
|
4
4
|
import React2, { useMemo, useContext, useCallback } from "react";
|
|
5
5
|
import SwipeableViews from "react-swipeable-views";
|
|
@@ -90,7 +90,7 @@ const TabsPanels = () => {
|
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
|
-
return
|
|
93
|
+
return panels;
|
|
94
94
|
};
|
|
95
95
|
export {
|
|
96
96
|
TabsPanels
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/tabsPanel/TabsPanels.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\nimport React, { useMemo, useContext, useCallback } from 'react';\nimport SwipeableViews from 'react-swipeable-views';\nimport { StyledPanelContainer } from './styles.js';\nimport { DSTabsContext } from '../../DSTabsCTX.js';\nimport { useTabsCallbacks } from '../../utils/hooks/useTabsCallbacks.js';\nimport type { DSTabT } from '../../
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACuGjB
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\nimport React, { useMemo, useContext, useCallback } from 'react';\nimport SwipeableViews from 'react-swipeable-views';\nimport { StyledPanelContainer } from './styles.js';\nimport { DSTabsContext } from '../../DSTabsCTX.js';\nimport { useTabsCallbacks } from '../../utils/hooks/useTabsCallbacks.js';\nimport type { DSTabT } from '../../react-desc-prop-types.js';\n\nexport const TabsPanels = (): JSX.Element | JSX.Element[] => {\n const {\n actualActiveTab,\n focusableTabsRef,\n props: {\n animated,\n enableMouseEvents,\n onlyRenderActiveTab,\n children: tabs,\n isDSMobile,\n tabPanelsProps,\n swipeableViewsContainerProps,\n },\n } = useContext(DSTabsContext);\n\n const { handleOnTabChange, handleOnMouseDown } = useTabsCallbacks();\n\n const handleOnChangeIndex = useCallback(\n (index: number, indexLatest: number) => {\n if (!focusableTabsRef.current) return;\n\n const offset = index - indexLatest;\n\n if (focusableTabsRef.current) {\n const currentIndexFocusable = focusableTabsRef.current?.findIndex((el) => el.dataset.tabId === actualActiveTab);\n\n const newFocusableIndex = currentIndexFocusable >= 0 ? currentIndexFocusable + offset : -1;\n\n if (\n newFocusableIndex < 0 ||\n newFocusableIndex > focusableTabsRef.current?.length ||\n !focusableTabsRef.current?.[newFocusableIndex]\n )\n return;\n handleOnTabChange(focusableTabsRef.current[newFocusableIndex].dataset?.tabId as string);\n\n // swiping does not trigger centerTab function inside handleOnTabChange because there is no event\n // by clicking we are manually forcing to center the tab\n\n focusableTabsRef.current[newFocusableIndex].click();\n }\n },\n [actualActiveTab, focusableTabsRef, handleOnTabChange],\n );\n\n const firstSlideToShow = useMemo(() => {\n const childrenArray = React.Children.toArray(tabs) as React.ReactElement<DSTabT.Props>[];\n const index = childrenArray\n .filter((tab) => tab.props.disabled !== true)\n .findIndex((tab) => tab.props.tabId === actualActiveTab);\n\n if (index === -1) return 0;\n return index;\n }, [actualActiveTab, tabs]);\n\n const panels = useMemo(\n () =>\n React.Children.map(tabs, (tab: React.ReactElement<DSTabT.Props>) => {\n const { tabId: panelId = '', style, children: content, disabled } = tab.props;\n const isActive = actualActiveTab === panelId;\n const shouldRender = !onlyRenderActiveTab || isActive;\n\n if (disabled) return null;\n return (\n shouldRender && (\n <StyledPanelContainer\n {...tabPanelsProps}\n key={panelId}\n id={panelId}\n aria-labelledby={`${panelId}-label`}\n aria-hidden={!isActive}\n data-panel-id={panelId}\n data-testid=\"ds-tabs-tab-panel\"\n hide={!isActive}\n onMouseDown={handleOnMouseDown}\n role=\"tabpanel\"\n style={{\n ...(tabPanelsProps?.style || {}),\n ...(style || {}),\n }}\n isDSMobile={isDSMobile}\n >\n {content}\n </StyledPanelContainer>\n )\n );\n }),\n [actualActiveTab, handleOnMouseDown, isDSMobile, onlyRenderActiveTab, tabs, tabPanelsProps],\n );\n\n if (animated) {\n // Ignore ts errors on the next line because the 'react-swipeable-views' package does not export a type for the SwipeableViews component\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n const Comp = (SwipeableViews as any)?.default ?? SwipeableViews;\n return (\n <Comp\n {...swipeableViewsContainerProps}\n style={{\n overflow: 'hidden', // https://jira.elliemae.io/browse/PUI-9906\n ...(swipeableViewsContainerProps?.style || {}),\n }}\n enableMouseEvents={enableMouseEvents}\n index={firstSlideToShow}\n onChangeIndex={handleOnChangeIndex}\n >\n {panels}\n </Comp>\n );\n }\n\n return panels;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACuGjB;AA9BM;AAxEZ,OAAOA,UAAS,SAAS,YAAY,mBAAmB;AACxD,OAAO,oBAAoB;AAC3B,SAAS,4BAA4B;AACrC,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AAG1B,MAAM,aAAa,MAAmC;AAC3D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,IAAI,WAAW,aAAa;AAE5B,QAAM,EAAE,mBAAmB,kBAAkB,IAAI,iBAAiB;AAElE,QAAM,sBAAsB;AAAA,IAC1B,CAAC,OAAe,gBAAwB;AACtC,UAAI,CAAC,iBA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AAA,YACL,GAAI,gBAAgB,SAAS,CAAC;AAAA,YAC9B,GAAI,SAAS,CAAC;AAAA,UAChB;AAAA,UACA;AAAA;AAAA,QAEC;AAAA,MACH;AAAA,IAGN,CAAC;AAAA,IACH,CAAC,iBAAiB,mBAAmB,YAAY,qBAAqB,MAAM,cAAc;AAAA,EAC5F;AAEA,MAAI,UAAU;AAGZ,UAAM,OAAQ,gBAAwB,WAAW;AACjD,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,OAAO;AAAA,UACL,UAAU;AAAA;AAAA,UACV,GAAI,8BAA8B,SAAS,CAAC;AAAA,QAC9C;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP,eAAe;AAAA,QAEd;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -7,7 +7,10 @@ const tabPropTypes = {
|
|
|
7
7
|
tabId: PropTypes.string.description("Unique Tab id.").defaultValue(""),
|
|
8
8
|
title: PropTypes.string.description("Tab title.").defaultValue(""),
|
|
9
9
|
required: PropTypes.bool.description("Show a required mark next to the title.").defaultValue(false),
|
|
10
|
-
disabled: PropTypes.bool.description("Disables Tab.").defaultValue(false)
|
|
10
|
+
disabled: PropTypes.bool.description("Disables Tab.").defaultValue(false),
|
|
11
|
+
applyAriaDisabled: PropTypes.bool.description(
|
|
12
|
+
"Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION."
|
|
13
|
+
).defaultValue(false)
|
|
11
14
|
};
|
|
12
15
|
const tabsPropTypes = {
|
|
13
16
|
...globalAttributesPropTypes,
|
|
@@ -52,4 +55,4 @@ export {
|
|
|
52
55
|
tabsDefaultProps,
|
|
53
56
|
tabsPropTypes
|
|
54
57
|
};
|
|
55
|
-
//# sourceMappingURL=
|
|
58
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { XstyledProps, GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport type { SwipeableViewsProps } from 'react-swipeable-views';\nimport { TabTypes, TabTypesValuesAsArray } from './utils/constants.js';\nimport type { DSTabsInternalsT } from './sharedTypes.js';\n\nconst noop = (): void => {};\n\nexport declare namespace DSTabT {\n export interface DefaultProps {\n tabId: string;\n applyAriaDisabled: boolean;\n }\n\n export interface PropsOptional {\n style?: Record<string, unknown>;\n title?: string;\n required?: boolean;\n disabled?: boolean;\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 PropsRequired {\n children: React.ReactNode;\n }\n\n export interface Props extends Partial<DefaultProps>, PropsOptional, PropsRequired {}\n}\n\nexport declare namespace DSTabsT {\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 tabsListAriaLabel: string;\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: SwipeableViewsProps;\n }\n\n export interface PropsOptional {\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 Partial<DefaultProps>,\n PropsOptional,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof PropsOptional>,\n XstyledProps {}\n\n export interface InternalProps extends DefaultProps, PropsOptional {}\n}\n\nexport const tabPropTypes = {\n tabId: PropTypes.string.description('Unique Tab id.').defaultValue(''),\n title: PropTypes.string.description('Tab title.').defaultValue(''),\n required: PropTypes.bool.description('Show a required mark next to the title.').defaultValue(false),\n disabled: PropTypes.bool.description('Disables Tab.').defaultValue(false),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n};\n\nexport const tabsPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n animated: PropTypes.bool.description('Whether the Tab transition should animate or not.').defaultValue(true),\n enableMouseEvents: PropTypes.bool.description('Enables Tab transition with mouse drag events.').defaultValue(false),\n allowTextSelection: PropTypes.bool\n .description('Allows text selection when mouse drag events are active.')\n .defaultValue(false),\n onTabChange: PropTypes.func.description('Handler when a user clicks on a different Tab.').defaultValue('() => {}'),\n type: PropTypes.oneOf(TabTypesValuesAsArray).description('Tab type.').defaultValue(TabTypesValuesAsArray[0]),\n tabBarExtraContent: PropTypes.element.description('Extra content next to the Tab Bar.').defaultValue(undefined),\n TabBarExtraContent: PropTypes.func\n .description('Extra content next to the Tab Bar as a react component instead of JSX')\n .defaultValue(undefined),\n onlyRenderActiveTab: PropTypes.bool.description('Only renders the active Tab in the DOM.').defaultValue(false),\n withCarousel: PropTypes.bool.description('Activate carousel behavior.').defaultValue(false),\n activeTab: PropTypes.string\n .description('Passing a value makes DSTabs a controlled component.')\n .defaultValue('First DSTab children.'),\n children: PropTypes.node.description('Use DSTab component as children.').isRequired,\n tabsListAriaLabel: PropTypes.string.description('Aria label for the list.').defaultValue('Tab list.'),\n containerProps: PropTypes.object.description('Additional properties for the container.').defaultValue({}),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })])\n .description('Ref to the container.')\n .defaultValue(undefined),\n 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({}),\n};\n\nexport const tabsDefaultProps: DSTabsT.DefaultProps = {\n containerProps: {},\n animated: true,\n enableMouseEvents: false,\n allowTextSelection: false,\n onTabChange: noop,\n tabsListAriaLabel: 'Tab list',\n type: TabTypes.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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,2BAA2B,wBAAwB;AAGvE,SAAS,UAAU,6BAA6B;AAGhD,MAAM,OAAO,MAAY;AAAC;AA+DnB,MAAM,eAAe;AAAA,EAC1B,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;AACvB;AAEO,MAAM,gBAAgB;AAAA,EAC3B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,UAAU,KAAK,YAAY,mDAAmD,EAAE,aAAa,IAAI;AAAA,EAC3G,mBAAmB,UAAU,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AAM,SAAS;AAAA,EACf,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
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -84,7 +84,8 @@ const testTabsInternalPropsAsSyntax = {
|
|
|
84
84
|
...testTabsCompleteDefaults
|
|
85
85
|
};
|
|
86
86
|
const testTabCompleteDefaults = {
|
|
87
|
-
tabId: ""
|
|
87
|
+
tabId: "",
|
|
88
|
+
applyAriaDisabled: false
|
|
88
89
|
};
|
|
89
90
|
const testTabsExplicitDefinition = {
|
|
90
91
|
containerProps: {},
|
|
@@ -122,7 +123,8 @@ const testTabExplicitDefinition = {
|
|
|
122
123
|
required: true,
|
|
123
124
|
style: {},
|
|
124
125
|
title: "",
|
|
125
|
-
tabId: ""
|
|
126
|
+
tabId: "",
|
|
127
|
+
applyAriaDisabled: false
|
|
126
128
|
};
|
|
127
129
|
const testTabsInferedTypeCompatibility = {
|
|
128
130
|
containerProps: {},
|
|
@@ -185,7 +187,8 @@ const testTabInferedTypeCompatibility = {
|
|
|
185
187
|
required: true,
|
|
186
188
|
style: {},
|
|
187
189
|
title: "",
|
|
188
|
-
tabId: ""
|
|
190
|
+
tabId: "",
|
|
191
|
+
applyAriaDisabled: false
|
|
189
192
|
};
|
|
190
193
|
const testTabDefinitionAsConst = {
|
|
191
194
|
children: /* @__PURE__ */ jsx("div", {}),
|
|
@@ -198,7 +201,8 @@ const testTabDefinitionAsConst = {
|
|
|
198
201
|
required: true,
|
|
199
202
|
style: {},
|
|
200
203
|
title: "",
|
|
201
|
-
tabId: ""
|
|
204
|
+
tabId: "",
|
|
205
|
+
applyAriaDisabled: false
|
|
202
206
|
};
|
|
203
207
|
const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
204
208
|
/* @__PURE__ */ jsx(DSTabs, { ...testTabsExplicitDefinition }),
|
|
@@ -222,7 +226,6 @@ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
|
222
226
|
withCarousel: false,
|
|
223
227
|
isDSMobile: false,
|
|
224
228
|
showSelectionIndicator: true,
|
|
225
|
-
children: [],
|
|
226
229
|
fixedTabsHeaders: false,
|
|
227
230
|
showSeparator: true,
|
|
228
231
|
tabPanelsProps: {},
|
|
@@ -232,13 +235,13 @@ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
|
232
235
|
firstSubtabRef: buttonRef,
|
|
233
236
|
lastTabRef: buttonRef,
|
|
234
237
|
TabBarExtraContent: MockComponent,
|
|
235
|
-
tabBarExtraContent: ""
|
|
238
|
+
tabBarExtraContent: "",
|
|
239
|
+
children: []
|
|
236
240
|
}
|
|
237
241
|
),
|
|
238
242
|
/* @__PURE__ */ jsx(
|
|
239
243
|
DSTab,
|
|
240
244
|
{
|
|
241
|
-
children: /* @__PURE__ */ jsx("div", {}),
|
|
242
245
|
disabled: false,
|
|
243
246
|
onClick: () => {
|
|
244
247
|
},
|
|
@@ -248,7 +251,9 @@ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
|
248
251
|
required: true,
|
|
249
252
|
style: {},
|
|
250
253
|
title: "",
|
|
251
|
-
tabId: ""
|
|
254
|
+
tabId: "",
|
|
255
|
+
applyAriaDisabled: false,
|
|
256
|
+
children: /* @__PURE__ */ jsx("div", {})
|
|
252
257
|
}
|
|
253
258
|
)
|
|
254
259
|
] });
|