@elliemae/ds-left-navigation 3.22.0-next.2 → 3.22.0-next.21
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/LeftNavigation.js +3 -3
- package/dist/cjs/LeftNavigation.js.map +2 -2
- package/dist/cjs/LeftNavigationContext.js +2 -1
- package/dist/cjs/LeftNavigationContext.js.map +2 -2
- package/dist/cjs/common/getItemBackgroundStyle.js.map +2 -2
- package/dist/cjs/common/getLeftBorderStyle.js.map +2 -2
- package/dist/cjs/configs/useLeftNavConfig.js +31 -26
- package/dist/cjs/configs/useLeftNavConfig.js.map +2 -2
- package/dist/cjs/configs/useLeftNavItems.js +4 -2
- package/dist/cjs/configs/useLeftNavItems.js.map +2 -2
- package/dist/cjs/configs/useLeftNavSmoothExpand.js.map +2 -2
- package/dist/cjs/exported-related/ChevronItem/index.js.map +2 -2
- package/dist/cjs/exported-related/Icon/index.js.map +2 -2
- package/dist/cjs/exported-related/ItemRenderer/index.js +8 -5
- package/dist/cjs/exported-related/ItemRenderer/index.js.map +2 -2
- package/dist/cjs/exported-related/ItemRenderer/styled.js.map +1 -1
- package/dist/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js.map +2 -2
- package/dist/cjs/exported-related/OpenWindowItem/index.js.map +2 -2
- package/dist/cjs/exported-related/constants.js +13 -1
- package/dist/cjs/exported-related/constants.js.map +2 -2
- package/dist/cjs/hooks/useExpandableOnClickHandler.js.map +2 -2
- package/dist/cjs/hooks/useKeyboardNavigation.js +2 -2
- package/dist/cjs/hooks/useKeyboardNavigation.js.map +2 -2
- package/dist/cjs/hooks/useOpenableOnClickHandler.js.map +2 -2
- package/dist/cjs/hooks/useSelectFirstBodyItem.js.map +2 -2
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemControlledDrilldown/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemHeader/index.js +2 -1
- package/dist/cjs/outOfTheBox/ItemHeader/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemLink/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemSection/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemSeparator/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemSkeleton/index.js +7 -5
- package/dist/cjs/outOfTheBox/ItemSkeleton/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemSubmenu/index.js +2 -1
- package/dist/cjs/outOfTheBox/ItemSubmenu/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemTextLabel/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/ItemWithDate/index.js +1 -1
- package/dist/cjs/outOfTheBox/ItemWithDate/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/index.js.map +2 -2
- package/dist/cjs/outOfTheBox/styled.js.map +1 -1
- package/dist/cjs/parts/LeftNavContent/index.js +30 -4
- package/dist/cjs/parts/LeftNavContent/index.js.map +2 -2
- package/dist/cjs/parts/LeftNavContent/styled.js +2 -2
- package/dist/cjs/parts/LeftNavContent/styled.js.map +2 -2
- package/dist/cjs/parts/LeftNavFooterItem/index.js +14 -5
- package/dist/cjs/parts/LeftNavFooterItem/index.js.map +2 -2
- package/dist/cjs/parts/LeftNavFooterItem/styled.js +1 -1
- package/dist/cjs/parts/LeftNavFooterItem/styled.js.map +2 -2
- package/dist/cjs/parts/OutOfTheBoxMapItem.js +7 -1
- package/dist/cjs/parts/OutOfTheBoxMapItem.js.map +2 -2
- package/dist/cjs/{prop-types.js → react-desc-prop-types.js} +9 -6
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-left-navigation-valid.js +186 -0
- package/dist/cjs/typescript-testing/typescript-left-navigation-valid.js.map +7 -0
- package/dist/esm/LeftNavigation.js +1 -1
- package/dist/esm/LeftNavigation.js.map +2 -2
- package/dist/esm/LeftNavigationContext.js +2 -1
- package/dist/esm/LeftNavigationContext.js.map +2 -2
- package/dist/esm/common/getItemBackgroundStyle.js.map +2 -2
- package/dist/esm/common/getLeftBorderStyle.js.map +2 -2
- package/dist/esm/configs/useLeftNavConfig.js +31 -26
- package/dist/esm/configs/useLeftNavConfig.js.map +2 -2
- package/dist/esm/configs/useLeftNavItems.js +4 -2
- package/dist/esm/configs/useLeftNavItems.js.map +2 -2
- package/dist/esm/configs/useLeftNavSmoothExpand.js.map +2 -2
- package/dist/esm/exported-related/ChevronItem/index.js.map +2 -2
- package/dist/esm/exported-related/Icon/index.js.map +2 -2
- package/dist/esm/exported-related/ItemRenderer/index.js +8 -5
- package/dist/esm/exported-related/ItemRenderer/index.js.map +2 -2
- package/dist/esm/exported-related/ItemRenderer/styled.js.map +1 -1
- package/dist/esm/exported-related/ItemRenderer/usePropsWithDefaults.js.map +2 -2
- package/dist/esm/exported-related/OpenWindowItem/index.js.map +2 -2
- package/dist/esm/exported-related/constants.js +13 -1
- package/dist/esm/exported-related/constants.js.map +2 -2
- package/dist/esm/hooks/useExpandableOnClickHandler.js.map +2 -2
- package/dist/esm/hooks/useKeyboardNavigation.js +2 -2
- package/dist/esm/hooks/useKeyboardNavigation.js.map +2 -2
- package/dist/esm/hooks/useOpenableOnClickHandler.js.map +2 -2
- package/dist/esm/hooks/useSelectFirstBodyItem.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemControlledDrilldown/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemHeader/index.js +2 -1
- package/dist/esm/outOfTheBox/ItemHeader/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemLink/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemSection/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemSeparator/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemSkeleton/index.js +7 -5
- package/dist/esm/outOfTheBox/ItemSkeleton/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemSubmenu/index.js +2 -1
- package/dist/esm/outOfTheBox/ItemSubmenu/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemTextLabel/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +2 -2
- package/dist/esm/outOfTheBox/ItemWithDate/index.js +1 -1
- package/dist/esm/outOfTheBox/ItemWithDate/index.js.map +2 -2
- package/dist/esm/outOfTheBox/index.js.map +2 -2
- package/dist/esm/outOfTheBox/styled.js.map +1 -1
- package/dist/esm/parts/LeftNavContent/index.js +30 -4
- package/dist/esm/parts/LeftNavContent/index.js.map +2 -2
- package/dist/esm/parts/LeftNavContent/styled.js +2 -2
- package/dist/esm/parts/LeftNavContent/styled.js.map +2 -2
- package/dist/esm/parts/LeftNavFooterItem/index.js +15 -6
- package/dist/esm/parts/LeftNavFooterItem/index.js.map +2 -2
- package/dist/esm/parts/LeftNavFooterItem/styled.js +1 -1
- package/dist/esm/parts/LeftNavFooterItem/styled.js.map +2 -2
- package/dist/esm/parts/OutOfTheBoxMapItem.js +7 -1
- package/dist/esm/parts/OutOfTheBoxMapItem.js.map +2 -2
- package/dist/esm/{prop-types.js → react-desc-prop-types.js} +6 -3
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-left-navigation-valid.js +163 -0
- package/dist/esm/typescript-testing/typescript-left-navigation-valid.js.map +7 -0
- package/dist/types/LeftNavigation.d.ts +6 -17
- package/dist/types/LeftNavigationContext.d.ts +4 -4
- package/dist/types/common/getItemBackgroundStyle.d.ts +2 -2
- package/dist/types/common/getLeftBorderStyle.d.ts +2 -2
- package/dist/types/configs/useLeftNavConfig.d.ts +16 -3
- package/dist/types/configs/useLeftNavItems.d.ts +5 -5
- package/dist/types/configs/useLeftNavSmoothExpand.d.ts +2 -2
- package/dist/types/exported-related/ChevronItem/index.d.ts +3 -1
- package/dist/types/exported-related/Icon/index.d.ts +2 -1
- package/dist/types/exported-related/ItemRenderer/index.d.ts +2 -2
- package/dist/types/exported-related/ItemRenderer/styled.d.ts +1 -0
- package/dist/types/exported-related/ItemRenderer/usePropsWithDefaults.d.ts +2 -2
- package/dist/types/exported-related/Notifications/index.d.ts +1 -0
- package/dist/types/exported-related/OpenWindowItem/index.d.ts +3 -1
- package/dist/types/exported-related/constants.d.ts +11 -0
- package/dist/types/hooks/useExpandableOnClickHandler.d.ts +2 -2
- package/dist/types/hooks/useKeyboardNavigation.d.ts +4 -4
- package/dist/types/hooks/useOpenableOnClickHandler.d.ts +2 -2
- package/dist/types/hooks/useSelectFirstBodyItem.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/outOfTheBox/ItemControlledDrilldown/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemHeader/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemLink/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemSection/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemSeparator/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemSkeleton/index.d.ts +8 -2
- package/dist/types/outOfTheBox/ItemSubmenu/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemTextLabel/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemUncontrolledDrilldown/index.d.ts +3 -2
- package/dist/types/outOfTheBox/ItemWithDate/index.d.ts +3 -2
- package/dist/types/outOfTheBox/index.d.ts +2 -2
- package/dist/types/outOfTheBox/styled.d.ts +2 -1
- package/dist/types/parts/LeftNavContent/styled.d.ts +2 -0
- package/dist/types/parts/LeftNavFooterItem/styled.d.ts +6 -4
- package/dist/types/parts/OutOfTheBoxMapItem.d.ts +2 -2
- package/dist/types/react-desc-prop-types.d.ts +100 -0
- package/dist/types/typescript-testing/typescript-left-navigation-valid.d.ts +1 -0
- package/package.json +13 -11
- package/dist/cjs/index.d.js +0 -28
- package/dist/cjs/index.d.js.map +0 -7
- package/dist/cjs/prop-types.js.map +0 -7
- package/dist/esm/index.d.js +0 -2
- package/dist/esm/index.d.js.map +0 -7
- package/dist/esm/prop-types.js.map +0 -7
- package/dist/types/index.d.d.ts +0 -78
- package/dist/types/prop-types.d.ts +0 -22
|
@@ -39,11 +39,12 @@ var import_LeftNavigationContext = require("../../LeftNavigationContext.js");
|
|
|
39
39
|
var import_LeftNavFooterItem = require("../LeftNavFooterItem/index.js");
|
|
40
40
|
var import_OutOfTheBoxMapItem = require("../OutOfTheBoxMapItem.js");
|
|
41
41
|
var import_styled = require("./styled.js");
|
|
42
|
+
var import_ItemSkeleton = require("../../outOfTheBox/ItemSkeleton/index.js");
|
|
42
43
|
var import_LeftNavLoading = require("../LeftNavLoading/index.js");
|
|
43
44
|
const leftNavScreenReaderInstructions = "Left Navigation. You can navigate through the items using the Up/Down arrows. To expand or select an item, use the Enter/Return or Space keys. Expandable items can also be opened/closed with the Right/Left arrows. The Home and End keys will take you to the first and last item respectively.";
|
|
44
45
|
const LeftNavInnerContent = () => {
|
|
45
46
|
const {
|
|
46
|
-
leftNavProps: { HeaderComponent, BodyHeaderComponent, openedItem, items, withoutBodyShadow },
|
|
47
|
+
leftNavProps: { HeaderComponent, BodyHeaderComponent, openedItem, items, withoutBodyShadow, isSkeleton },
|
|
47
48
|
selectedItem
|
|
48
49
|
} = import_react.default.useContext(import_LeftNavigationContext.LeftNavContext);
|
|
49
50
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
@@ -53,7 +54,10 @@ const LeftNavInnerContent = () => {
|
|
|
53
54
|
"data-testid": "leftnav-header-area",
|
|
54
55
|
selected: !!HeaderComponent && [selectedItem, openedItem].includes(HeaderComponent.dsId),
|
|
55
56
|
role: "group",
|
|
56
|
-
children:
|
|
57
|
+
children: isSkeleton ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ItemSkeleton.ItemSkeleton, { item: { dsId: "header-skeleton", itemOpts: { skeletonVariant: "item" } }, hasBorderBottom: true }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
58
|
+
" ",
|
|
59
|
+
HeaderComponent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_OutOfTheBoxMapItem.OutOfTheBoxMapItem, { item: HeaderComponent }) : null
|
|
60
|
+
] })
|
|
57
61
|
}
|
|
58
62
|
),
|
|
59
63
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_styled.StyledLeftNavBodyAreasContainer, { cols: ["1fr"], rows: ["auto", "1fr"], role: "group", children: [
|
|
@@ -63,7 +67,18 @@ const LeftNavInnerContent = () => {
|
|
|
63
67
|
"data-testid": "leftnav-body-header-area",
|
|
64
68
|
selected: !!BodyHeaderComponent && [selectedItem, openedItem].includes(BodyHeaderComponent.dsId),
|
|
65
69
|
role: "group",
|
|
66
|
-
|
|
70
|
+
isSkeleton,
|
|
71
|
+
children: isSkeleton ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
72
|
+
import_ItemSkeleton.ItemSkeleton,
|
|
73
|
+
{
|
|
74
|
+
item: {
|
|
75
|
+
dsId: "body-header-skeleton",
|
|
76
|
+
itemOpts: {
|
|
77
|
+
skeletonVariant: "item"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: BodyHeaderComponent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_OutOfTheBoxMapItem.OutOfTheBoxMapItem, { item: BodyHeaderComponent }) : null })
|
|
67
82
|
}
|
|
68
83
|
),
|
|
69
84
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -73,7 +88,18 @@ const LeftNavInnerContent = () => {
|
|
|
73
88
|
"data-testid": "leftnav-body-items-area",
|
|
74
89
|
tabIndex: -1,
|
|
75
90
|
role: "group",
|
|
76
|
-
|
|
91
|
+
isSkeleton,
|
|
92
|
+
children: isSkeleton ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
93
|
+
import_ItemSkeleton.ItemSkeleton,
|
|
94
|
+
{
|
|
95
|
+
item: {
|
|
96
|
+
dsId: "action-items-skeleton",
|
|
97
|
+
itemOpts: {
|
|
98
|
+
skeletonVariant: "subitem"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_OutOfTheBoxMapItem.OutOfTheBoxMapItem, { item }, item.dsId)) })
|
|
77
103
|
}
|
|
78
104
|
)
|
|
79
105
|
] })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/LeftNavContent/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { LeftNavContext } from '../../LeftNavigationContext.js';\nimport { LeftNavFooterItem } from '../LeftNavFooterItem/index.js';\nimport { OutOfTheBoxMapItem } from '../OutOfTheBoxMapItem.js';\nimport {\n StyledLeftNavExpandAnimationWrapper,\n StyledLeftNavAreasContainer,\n StyledLeftNavHeaderArea,\n StyledLeftNavBodyAreasContainer,\n StyledLeftNavBodyHeaderArea,\n StyledLeftNavBodyItemsArea,\n} from './styled.js';\nimport { LeftNavLoading } from '../LeftNavLoading/index.js';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { LeftNavContext } from '../../LeftNavigationContext.js';\nimport { LeftNavFooterItem } from '../LeftNavFooterItem/index.js';\nimport { OutOfTheBoxMapItem } from '../OutOfTheBoxMapItem.js';\nimport {\n StyledLeftNavExpandAnimationWrapper,\n StyledLeftNavAreasContainer,\n StyledLeftNavHeaderArea,\n StyledLeftNavBodyAreasContainer,\n StyledLeftNavBodyHeaderArea,\n StyledLeftNavBodyItemsArea,\n} from './styled.js';\nimport { ItemSkeleton } from '../../outOfTheBox/ItemSkeleton/index.js';\nimport { LeftNavLoading } from '../LeftNavLoading/index.js';\nconst leftNavScreenReaderInstructions =\n 'Left Navigation. You can navigate through the items using the Up/Down arrows. ' +\n 'To expand or select an item, use the Enter/Return or Space keys. ' +\n 'Expandable items can also be opened/closed with the Right/Left arrows. ' +\n 'The Home and End keys will take you to the first and last item respectively.';\n\nconst LeftNavInnerContent = () => {\n const {\n leftNavProps: { HeaderComponent, BodyHeaderComponent, openedItem, items, withoutBodyShadow, isSkeleton },\n selectedItem,\n } = React.useContext(LeftNavContext);\n return (\n <>\n <StyledLeftNavHeaderArea\n data-testid=\"leftnav-header-area\"\n selected={!!HeaderComponent && [selectedItem, openedItem].includes(HeaderComponent.dsId as string)}\n role=\"group\"\n >\n {isSkeleton ? (\n <ItemSkeleton item={{ dsId: 'header-skeleton', itemOpts: { skeletonVariant: 'item' } }} hasBorderBottom />\n ) : (\n <> {HeaderComponent ? <OutOfTheBoxMapItem item={HeaderComponent} /> : null}</>\n )}\n </StyledLeftNavHeaderArea>\n <StyledLeftNavBodyAreasContainer cols={['1fr']} rows={['auto', '1fr']} role=\"group\">\n <StyledLeftNavBodyHeaderArea\n data-testid=\"leftnav-body-header-area\"\n selected={!!BodyHeaderComponent && [selectedItem, openedItem].includes(BodyHeaderComponent.dsId as string)}\n role=\"group\"\n isSkeleton={isSkeleton}\n >\n {isSkeleton ? (\n <ItemSkeleton\n item={{\n dsId: 'body-header-skeleton',\n itemOpts: {\n skeletonVariant: 'item',\n },\n }}\n />\n ) : (\n <>{BodyHeaderComponent ? <OutOfTheBoxMapItem item={BodyHeaderComponent} /> : null}</>\n )}\n </StyledLeftNavBodyHeaderArea>\n <StyledLeftNavBodyItemsArea\n selected={!withoutBodyShadow && openedItem !== null}\n data-testid=\"leftnav-body-items-area\"\n tabIndex={-1}\n role=\"group\"\n isSkeleton={isSkeleton}\n >\n {isSkeleton ? (\n <ItemSkeleton\n item={{\n dsId: 'action-items-skeleton',\n itemOpts: {\n skeletonVariant: 'subitem',\n },\n }}\n />\n ) : (\n <>\n {items.map((item) => (\n <OutOfTheBoxMapItem item={item} key={item.dsId} />\n ))}\n </>\n )}\n </StyledLeftNavBodyItemsArea>\n </StyledLeftNavBodyAreasContainer>\n </>\n );\n};\n\nconst LeftNavContent: React.ComponentType = () => {\n const {\n expandedForAnimation,\n leftNavProps: { expanded, expandedWidth, footerLabel, onFooterExpand, onFooterClose, loading },\n leftNavProps,\n } = React.useContext(LeftNavContext);\n\n const globalProps = useGetGlobalAttributes(leftNavProps);\n\n return (\n <StyledLeftNavExpandAnimationWrapper\n expandedWidth={expandedWidth}\n expanded={expanded}\n data-testid=\"leftnav-component\"\n aria-label={leftNavScreenReaderInstructions}\n {...globalProps}\n >\n <StyledLeftNavAreasContainer\n expandedWidth={expandedWidth}\n expanded={expandedForAnimation}\n rows={loading ? ['1fr', 'auto'] : ['auto', '1fr', 'auto']}\n cols={['1fr']}\n role={'menu'}\n >\n {loading && <LeftNavLoading expanded={expandedForAnimation} />}\n {!loading && <LeftNavInnerContent />}\n <LeftNavFooterItem footerLabel={footerLabel} onFooterExpand={onFooterExpand} onFooterClose={onFooterClose} />\n </StyledLeftNavAreasContainer>\n </StyledLeftNavExpandAnimationWrapper>\n );\n};\n\nexport default LeftNavContent;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCb;AAlCV,mBAAkB;AAClB,8BAAuC;AACvC,mCAA+B;AAC/B,+BAAkC;AAClC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AEC,uBACC;AAAA,YAAC;AAAA;AAAA,cACC,MAAM;AAAA,gBACJ,MAAM;AAAA,gBACN,UAAU;AAAA,kBACR,iBAAiB;AAAA,gBACnB;AAAA,cACF;AAAA;AAAA,UACF,IAEA,2EACG,gBAAM,IAAI,CAAC,SACV,4CAAC,gDAAmB,QAAiB,KAAK,IAAM,CACjD,GACH;AAAA;AAAA,MAEJ;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,MAAM,iBAAsC,MAAM;AAChD,QAAM;AAAA,IACJ;AAAA,IACA,cAAc,EAAE,UAAU,eAAe,aAAa,gBAAgB,eAAe,QAAQ;AAAA,IAC7F;AAAA,EACF,IAAI,aAAAA,QAAM,WAAW,2CAAc;AAEnC,QAAM,kBAAc,gDAAuB,YAAY;AAEvD,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,eAAY;AAAA,MACZ,cAAY;AAAA,MACX,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,UAAU;AAAA,UACV,MAAM,UAAU,CAAC,OAAO,MAAM,IAAI,CAAC,QAAQ,OAAO,MAAM;AAAA,UACxD,MAAM,CAAC,KAAK;AAAA,UACZ,MAAM;AAAA,UAEL;AAAA,uBAAW,4CAAC,wCAAe,UAAU,sBAAsB;AAAA,YAC3D,CAAC,WAAW,4CAAC,uBAAoB;AAAA,YAClC,4CAAC,8CAAkB,aAA0B,gBAAgC,eAA8B;AAAA;AAAA;AAAA,MAC7G;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,yBAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -94,7 +94,7 @@ const StyledLeftNavBodyHeaderArea = (0, import_ds_system.styled)("div", {
|
|
|
94
94
|
slot: import_constants.DSLeftNavigationSlots.BODY_HEADER_AREA
|
|
95
95
|
})`
|
|
96
96
|
width: 100%;
|
|
97
|
-
${getLeftShadowStyles}
|
|
97
|
+
${({ isSkeleton }) => !isSkeleton ? getLeftShadowStyles : ""}
|
|
98
98
|
`;
|
|
99
99
|
const StyledLeftNavBodyItemsArea = (0, import_ds_system.styled)("div", {
|
|
100
100
|
name: import_constants.DSLeftNavigationName,
|
|
@@ -102,6 +102,6 @@ const StyledLeftNavBodyItemsArea = (0, import_ds_system.styled)("div", {
|
|
|
102
102
|
})`
|
|
103
103
|
width: 100%;
|
|
104
104
|
overflow: auto;
|
|
105
|
-
box-shadow: inset 4px 0 0 0 ${
|
|
105
|
+
box-shadow: ${({ isSkeleton, selected, theme }) => !isSkeleton ? `inset 4px 0 0 0 ${selected ? theme.colors.brand[400] : "transparent"}` : ""};
|
|
106
106
|
`;
|
|
107
107
|
//# sourceMappingURL=styled.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/LeftNavContent/styled.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { Grid } from '@elliemae/ds-grid';\nimport type { Theme } from '@elliemae/ds-system';\nimport { styled } from '@elliemae/ds-system';\nimport { DSLeftNavigationName, DSLeftNavigationSlots } from '../../constants/index.js';\n\ntype LeftNavProps = {\n expanded: boolean;\n expandedWidth: string;\n};\n\nconst getLeftShadowStyles = ({\n selected,\n selectedParent,\n theme,\n}: {\n selected: boolean;\n selectedParent?: boolean;\n theme: Theme;\n}) => {\n if (!selected && !selectedParent) {\n return `\n box-shadow: inset 4px 0 0 0 transparent;\n :hover {\n box-shadow: inset 4px 0 0 0 ${theme.colors.brand[300]};\n }\n :active {\n box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};\n }\n `;\n }\n return `box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};`;\n};\n\nexport const StyledLeftNavExpandAnimationWrapper = styled('nav', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.ROOT,\n})<LeftNavProps>`\n width: ${(props) => (props.expanded ? props.expandedWidth : '48px')};\n transition: width ${(props) => (props.expanded ? 'ease-out' : 'ease-in')} 350ms;\n box-shadow: -1px 0 0 0 ${(props) => props.theme.colors.neutral[100]};\n border: 1px solid ${(props) => props.theme.colors.neutral[100]};\n overflow: hidden;\n height: 100%;\n position: relative;\n`;\n\nexport const StyledLeftNavAreasContainer = styled(Grid, {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.AREAS_CONTAINER,\n})<LeftNavProps>`\n width: ${(props) => (props.expanded ? `calc(${props.expandedWidth} - 2px)` : '46px')};\n height: 100%;\n`;\n\nexport const StyledLeftNavHeaderArea = styled('div', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.HEADER_AREA,\n})<{ selected: boolean; selectedParent?: boolean }>`\n ${getLeftShadowStyles}\n`;\n\nexport const StyledLeftNavBodyAreasContainer = styled(Grid, {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.BODY_AREAS_CONTAINER,\n})`\n width: 100%;\n`;\n\nexport const StyledLeftNavBodyHeaderArea = styled('div', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.BODY_HEADER_AREA,\n})<{ selected: boolean; selectedParent?: boolean }>`\n width: 100%;\n ${getLeftShadowStyles}\n`;\n\nexport const StyledLeftNavBodyItemsArea = styled('div', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.BODY_ITEMS_AREA,\n})<{ selected: boolean }>`\n width: 100%;\n overflow: auto;\n box-shadow: inset 4px 0 0 0 ${
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAAqB;AAErB,uBAAuB;AACvB,uBAA4D;AAO5D,MAAM,sBAAsB,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AACF,MAIM;AACJ,MAAI,CAAC,YAAY,CAAC,gBAAgB;AAChC,WAAO;AAAA;AAAA;AAAA,sCAG2B,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,sCAGtB,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,EAG1D;AACA,SAAO,+BAA+B,MAAM,OAAO,MAAM,GAAG;AAC9D;AAEO,MAAM,0CAAsC,yBAAO,OAAO;AAAA,EAC/D,MAAM;AAAA,EACN,MAAM,uCAAsB;AAC9B,CAAC;AAAA,WACU,CAAC,UAAW,MAAM,WAAW,MAAM,gBAAgB;AAAA,sBACxC,CAAC,UAAW,MAAM,WAAW,aAAa;AAAA,2BACrC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA,sBAC9C,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAMxD,MAAM,kCAA8B,yBAAO,qBAAM;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,uCAAsB;AAC9B,CAAC;AAAA,WACU,CAAC,UAAW,MAAM,WAAW,QAAQ,MAAM,yBAAyB;AAAA;AAAA;AAIxE,MAAM,8BAA0B,yBAAO,OAAO;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,uCAAsB;AAC9B,CAAC;AAAA,IACG;AAAA;AAGG,MAAM,sCAAkC,yBAAO,qBAAM;AAAA,EAC1D,MAAM;AAAA,EACN,MAAM,uCAAsB;AAC9B,CAAC;AAAA;AAAA;AAIM,MAAM,kCAA8B,yBAAO,OAAO;AAAA,EACvD,MAAM;AAAA,EACN,MAAM,uCAAsB;AAC9B,CAAC;AAAA;AAAA,IAEG;AAAA;
|
|
4
|
+
"sourcesContent": ["import { Grid } from '@elliemae/ds-grid';\nimport type { Theme } from '@elliemae/ds-system';\nimport { styled } from '@elliemae/ds-system';\nimport { DSLeftNavigationName, DSLeftNavigationSlots } from '../../constants/index.js';\n\ntype LeftNavProps = {\n expanded: boolean;\n expandedWidth: string;\n};\n\nconst getLeftShadowStyles = ({\n selected,\n selectedParent,\n theme,\n}: {\n selected: boolean;\n selectedParent?: boolean;\n theme: Theme;\n}) => {\n if (!selected && !selectedParent) {\n return `\n box-shadow: inset 4px 0 0 0 transparent;\n :hover {\n box-shadow: inset 4px 0 0 0 ${theme.colors.brand[300]};\n }\n :active {\n box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};\n }\n `;\n }\n return `box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};`;\n};\n\nexport const StyledLeftNavExpandAnimationWrapper = styled('nav', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.ROOT,\n})<LeftNavProps>`\n width: ${(props) => (props.expanded ? props.expandedWidth : '48px')};\n transition: width ${(props) => (props.expanded ? 'ease-out' : 'ease-in')} 350ms;\n box-shadow: -1px 0 0 0 ${(props) => props.theme.colors.neutral[100]};\n border: 1px solid ${(props) => props.theme.colors.neutral[100]};\n overflow: hidden;\n height: 100%;\n position: relative;\n`;\n\nexport const StyledLeftNavAreasContainer = styled(Grid, {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.AREAS_CONTAINER,\n})<LeftNavProps>`\n width: ${(props) => (props.expanded ? `calc(${props.expandedWidth} - 2px)` : '46px')};\n height: 100%;\n`;\n\nexport const StyledLeftNavHeaderArea = styled('div', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.HEADER_AREA,\n})<{ selected: boolean; selectedParent?: boolean }>`\n ${getLeftShadowStyles}\n`;\n\nexport const StyledLeftNavBodyAreasContainer = styled(Grid, {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.BODY_AREAS_CONTAINER,\n})`\n width: 100%;\n`;\n\nexport const StyledLeftNavBodyHeaderArea = styled('div', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.BODY_HEADER_AREA,\n})<{ selected: boolean; selectedParent?: boolean; isSkeleton: boolean }>`\n width: 100%;\n ${({ isSkeleton }) => (!isSkeleton ? getLeftShadowStyles : '')}\n`;\n\nexport const StyledLeftNavBodyItemsArea = styled('div', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.BODY_ITEMS_AREA,\n})<{ selected: boolean; isSkeleton: boolean }>`\n width: 100%;\n overflow: auto;\n box-shadow: ${({ isSkeleton, selected, theme }) =>\n !isSkeleton ? `inset 4px 0 0 0 ${selected ? theme.colors.brand[400] : 'transparent'}` : ''};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAAqB;AAErB,uBAAuB;AACvB,uBAA4D;AAO5D,MAAM,sBAAsB,CAAC;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AACF,MAIM;AACJ,MAAI,CAAC,YAAY,CAAC,gBAAgB;AAChC,WAAO;AAAA;AAAA;AAAA,sCAG2B,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,sCAGtB,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,EAG1D;AACA,SAAO,+BAA+B,MAAM,OAAO,MAAM,GAAG;AAC9D;AAEO,MAAM,0CAAsC,yBAAO,OAAO;AAAA,EAC/D,MAAM;AAAA,EACN,MAAM,uCAAsB;AAC9B,CAAC;AAAA,WACU,CAAC,UAAW,MAAM,WAAW,MAAM,gBAAgB;AAAA,sBACxC,CAAC,UAAW,MAAM,WAAW,aAAa;AAAA,2BACrC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA,sBAC9C,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAMxD,MAAM,kCAA8B,yBAAO,qBAAM;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,uCAAsB;AAC9B,CAAC;AAAA,WACU,CAAC,UAAW,MAAM,WAAW,QAAQ,MAAM,yBAAyB;AAAA;AAAA;AAIxE,MAAM,8BAA0B,yBAAO,OAAO;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,uCAAsB;AAC9B,CAAC;AAAA,IACG;AAAA;AAGG,MAAM,sCAAkC,yBAAO,qBAAM;AAAA,EAC1D,MAAM;AAAA,EACN,MAAM,uCAAsB;AAC9B,CAAC;AAAA;AAAA;AAIM,MAAM,kCAA8B,yBAAO,OAAO;AAAA,EACvD,MAAM;AAAA,EACN,MAAM,uCAAsB;AAC9B,CAAC;AAAA;AAAA,IAEG,CAAC,EAAE,WAAW,MAAO,CAAC,aAAa,sBAAsB;AAAA;AAGtD,MAAM,iCAA6B,yBAAO,OAAO;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,uCAAsB;AAC9B,CAAC;AAAA;AAAA;AAAA,gBAGe,CAAC,EAAE,YAAY,UAAU,MAAM,MAC3C,CAAC,aAAa,mBAAmB,WAAW,MAAM,OAAO,MAAM,GAAG,IAAI,kBAAkB;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -36,6 +36,8 @@ var React = __toESM(require("react"));
|
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
var import_react = require("react");
|
|
38
38
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
39
|
+
var import_ds_skeleton = require("@elliemae/ds-skeleton");
|
|
40
|
+
var import_ds_grid = require("@elliemae/ds-grid");
|
|
39
41
|
var import_ds_truncated_tooltip_text = require("@elliemae/ds-truncated-tooltip-text");
|
|
40
42
|
var import_styled = require("./styled.js");
|
|
41
43
|
var import_hooks = require("../../hooks/index.js");
|
|
@@ -44,7 +46,7 @@ var import_constants = require("../../exported-related/constants.js");
|
|
|
44
46
|
const LeftNavFooterItem = (props) => {
|
|
45
47
|
const { footerLabel, onFooterExpand = () => null, onFooterClose = () => null } = props;
|
|
46
48
|
const {
|
|
47
|
-
leftNavProps: { labelOverflow },
|
|
49
|
+
leftNavProps: { labelOverflow, isSkeleton },
|
|
48
50
|
expandedForAnimation,
|
|
49
51
|
setFocusedItem,
|
|
50
52
|
visibleItemsRefs
|
|
@@ -62,6 +64,16 @@ const LeftNavFooterItem = (props) => {
|
|
|
62
64
|
},
|
|
63
65
|
onClick: handleOnClick
|
|
64
66
|
});
|
|
67
|
+
const handleMenuCollapseClick = (0, import_react.useCallback)(
|
|
68
|
+
(e) => {
|
|
69
|
+
e.stopPropagation();
|
|
70
|
+
handleOnClick(e);
|
|
71
|
+
},
|
|
72
|
+
[handleOnClick]
|
|
73
|
+
);
|
|
74
|
+
if (isSkeleton) {
|
|
75
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledFooterMenu, { "data-testid": "leftnav-container", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_grid.Grid, { height: "48px", justifyContent: "center", alignItems: "center", cols: ["1fr"], p: "xxs", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_skeleton.DSSkeleton, { variant: "rectangular", height: "24px" }) }) }, id);
|
|
76
|
+
}
|
|
65
77
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledFooterMenu, { "data-testid": "leftnav-container", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
78
|
import_styled.StyledFooterItem,
|
|
67
79
|
{
|
|
@@ -97,10 +109,7 @@ const LeftNavFooterItem = (props) => {
|
|
|
97
109
|
import_styled.StyledMenuCollapse,
|
|
98
110
|
{
|
|
99
111
|
buttonType: "raw",
|
|
100
|
-
onClick:
|
|
101
|
-
e.stopPropagation();
|
|
102
|
-
handleOnClick(e);
|
|
103
|
-
},
|
|
112
|
+
onClick: handleMenuCollapseClick,
|
|
104
113
|
"data-testid": "leftnav-footer-btn",
|
|
105
114
|
tabIndex: 0,
|
|
106
115
|
onFocus: (e) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/LeftNavFooterItem/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { MenuExpand, MenuCollapse } from '@elliemae/ds-icons';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport {\n StyledFooterMenu,\n StyledFooterItem,\n StyledFooterLabel,\n StyledFooterSeparator,\n StyledMenuCollapse,\n} from './styled.js';\nimport { useKeyboardNavigation } from '../../hooks/index.js';\nimport LeftNavigationContext from '../../LeftNavigationContext.js';\nimport { FOOTER_DS_ID, FOOTER_MENU_CLOSE_DS_ID } from '../../exported-related/constants.js';\n\ntype LeftNavFooterItemProps = {\n footerLabel: string | JSX.Element;\n onFooterExpand: React.MouseEventHandler & React.KeyboardEventHandler;\n onFooterClose: React.MouseEventHandler & React.KeyboardEventHandler;\n};\n\nexport const LeftNavFooterItem: React.ComponentType<LeftNavFooterItemProps> = (props) => {\n const { footerLabel, onFooterExpand = () => null, onFooterClose = () => null } = props;\n const {\n leftNavProps: { labelOverflow },\n expandedForAnimation,\n setFocusedItem,\n visibleItemsRefs,\n } = useContext(LeftNavigationContext);\n\n const id = FOOTER_DS_ID;\n\n const handleOnClick = expandedForAnimation ? onFooterClose : onFooterExpand;\n\n const onKeyDown = useKeyboardNavigation({\n item: {\n dsId: id,\n itemOpts: {\n selectable: !expandedForAnimation,\n openable: false,\n closable: false,\n },\n },\n onClick: handleOnClick,\n });\n\n return (\n <StyledFooterMenu key={id} data-testid=\"leftnav-container\">\n <StyledFooterItem\n ref={visibleItemsRefs.current[id]
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useContext, useCallback } from 'react';\nimport { MenuExpand, MenuCollapse } from '@elliemae/ds-icons';\nimport { DSSkeleton } from '@elliemae/ds-skeleton';\nimport { Grid } from '@elliemae/ds-grid';\n\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport {\n StyledFooterMenu,\n StyledFooterItem,\n StyledFooterLabel,\n StyledFooterSeparator,\n StyledMenuCollapse,\n} from './styled.js';\nimport { useKeyboardNavigation } from '../../hooks/index.js';\nimport LeftNavigationContext from '../../LeftNavigationContext.js';\nimport { FOOTER_DS_ID, FOOTER_MENU_CLOSE_DS_ID } from '../../exported-related/constants.js';\n\ntype LeftNavFooterItemProps = {\n footerLabel: string | JSX.Element;\n onFooterExpand: React.MouseEventHandler & React.KeyboardEventHandler;\n onFooterClose: React.MouseEventHandler & React.KeyboardEventHandler;\n};\n\n// eslint-disable-next-line complexity\nexport const LeftNavFooterItem: React.ComponentType<LeftNavFooterItemProps> = (props) => {\n const { footerLabel, onFooterExpand = () => null, onFooterClose = () => null } = props;\n const {\n leftNavProps: { labelOverflow, isSkeleton },\n expandedForAnimation,\n setFocusedItem,\n visibleItemsRefs,\n } = useContext(LeftNavigationContext);\n\n const id = FOOTER_DS_ID;\n\n const handleOnClick = expandedForAnimation ? onFooterClose : onFooterExpand;\n\n const onKeyDown = useKeyboardNavigation({\n item: {\n dsId: id,\n itemOpts: {\n selectable: !expandedForAnimation,\n openable: false,\n closable: false,\n },\n },\n onClick: handleOnClick,\n });\n\n const handleMenuCollapseClick = useCallback(\n (e: React.MouseEvent<HTMLButtonElement, MouseEvent> | React.KeyboardEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n handleOnClick(e as React.MouseEvent<HTMLButtonElement, MouseEvent>);\n },\n [handleOnClick],\n );\n\n if (isSkeleton) {\n return (\n <StyledFooterMenu key={id} data-testid=\"leftnav-container\">\n <Grid height=\"48px\" justifyContent=\"center\" alignItems=\"center\" cols={['1fr']} p=\"xxs\">\n <DSSkeleton variant=\"rectangular\" height=\"24px\" />\n </Grid>\n </StyledFooterMenu>\n );\n }\n\n return (\n <StyledFooterMenu key={id} data-testid=\"leftnav-container\">\n <StyledFooterItem\n ref={visibleItemsRefs.current[id]}\n tabIndex={expandedForAnimation ? -1 : 0}\n expanded={expandedForAnimation}\n pt=\"xxs2\"\n height={expandedForAnimation ? 'auto' : '48px'}\n alignItems=\"flex-start\"\n pl=\"xxs2\"\n cols={expandedForAnimation ? ['auto', '1fr', 'auto'] : ['38px']}\n onClick={expandedForAnimation ? () => null : handleOnClick}\n onKeyDown={onKeyDown}\n onFocus={() => setFocusedItem(id)}\n data-testid=\"leftnav-item-container\"\n role=\"menuitem\"\n aria-label={\n expandedForAnimation\n ? `Footer, ${typeof footerLabel === 'string' ? footerLabel : ''}`\n : `Expand left navigation`\n }\n >\n {!expandedForAnimation ? (\n <MenuExpand size=\"m\" color={['brand-primary', '800']} data-testid=\"leftnav-footer-btn\" />\n ) : (\n <>\n <StyledFooterLabel\n mt=\"5px\"\n mr=\"12px\"\n mb=\"16px\"\n data-testid=\"leftnav-itemlabel\"\n labelOverflow={labelOverflow}\n aria-live=\"polite\"\n >\n {labelOverflow === 'truncate' ? (\n <SimpleTruncatedTooltipText value={footerLabel} placement=\"bottom-start\" />\n ) : (\n footerLabel\n )}\n </StyledFooterLabel>\n <StyledFooterSeparator mt=\"xxxs\" />\n <StyledMenuCollapse\n buttonType=\"raw\"\n onClick={handleMenuCollapseClick}\n data-testid=\"leftnav-footer-btn\"\n tabIndex={0}\n onFocus={(e: React.FocusEvent) => {\n e.stopPropagation();\n setFocusedItem(FOOTER_MENU_CLOSE_DS_ID);\n }}\n role=\"button\"\n aria-label=\"Collapse left navigation\"\n >\n <MenuCollapse size=\"m\" color={['brand-primary', '800']} />\n </StyledMenuCollapse>\n </>\n )}\n </StyledFooterItem>\n </StyledFooterMenu>\n );\n};\n\nexport default LeftNavFooterItem;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD8Db;AA7DV,mBAA+C;AAC/C,sBAAyC;AACzC,yBAA2B;AAC3B,qBAAqB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MAAM,OAAO;AAAA,MAC7C;AAAA,MACA,SAAS,MAAM,eAAe,EAAE;AAAA,MAChC,eAAY;AAAA,MACZ,MAAK;AAAA,MACL,cACE,uBACI,WAAW,OAAO,gBAAgB,WAAW,cAAc,OAC3D;AAAA,MAGL,WAAC,uBACA,4CAAC,8BAAW,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG,eAAY,sBAAqB,IAEvF,4EACE;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAG;AAAA,YACH,IAAG;AAAA,YACH,eAAY;AAAA,YACZ;AAAA,YACA,aAAU;AAAA,YAET,4BAAkB,aACjB,4CAAC,+DAA2B,OAAO,aAAa,WAAU,gBAAe,IAEzE;AAAA;AAAA,QAEJ;AAAA,QACA,4CAAC,uCAAsB,IAAG,QAAO;AAAA,QACjC;AAAA,UAAC;AAAA;AAAA,YACC,YAAW;AAAA,YACX,SAAS;AAAA,YACT,eAAY;AAAA,YACZ,UAAU;AAAA,YACV,SAAS,CAAC,MAAwB;AAChC,gBAAE,gBAAgB;AAClB,6BAAe,wCAAuB;AAAA,YACxC;AAAA,YACA,MAAK;AAAA,YACL,cAAW;AAAA,YAEX,sDAAC,gCAAa,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,QAC1D;AAAA,SACF;AAAA;AAAA,EAEJ,KAxDqB,EAyDvB;AAEJ;AAEA,IAAO,4BAAQ;",
|
|
6
6
|
"names": ["LeftNavigationContext"]
|
|
7
7
|
}
|
|
@@ -50,7 +50,7 @@ const StyledFooterMenu = (0, import_ds_system.styled)(import_ds_grid.Grid, { nam
|
|
|
50
50
|
`;
|
|
51
51
|
const StyledFooterItem = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSLeftNavigationName, slot: import_constants.DSLeftNavigationSlots.FOOTER_ITEM })`
|
|
52
52
|
position: relative;
|
|
53
|
-
${import_common.getLeftBorderStyle}
|
|
53
|
+
${(props) => (0, import_common.getLeftBorderStyle)({ ...props })}
|
|
54
54
|
|
|
55
55
|
min-height: 48px;
|
|
56
56
|
cursor: ${(props) => props.expanded ? "auto" : "pointer"};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/LeftNavFooterItem/styled.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { Grid } from '@elliemae/ds-grid';\nimport { getLeftBorderStyle, getItemBackgroundStyle } from '../../common/index.js';\nimport { DSLeftNavigationName, DSLeftNavigationSlots } from '../../constants/index.js';\n\nexport const StyledFooterMenu = styled(Grid, { name: DSLeftNavigationName, slot: DSLeftNavigationSlots.FOOTER_MENU })`\n width: 100%;\n margin-top: auto;\n background: ${(props) => props.theme.colors.neutral['000']};\n\n border-top: 1px solid ${(props) => props.theme.colors.neutral[100]};\n`;\n\nexport const StyledFooterItem = styled(Grid, { name: DSLeftNavigationName, slot: DSLeftNavigationSlots.FOOTER_ITEM })<{\n expanded
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AACvB,0BAA2B;AAC3B,qBAAqB;AACrB,oBAA2D;AAC3D,uBAA4D;
|
|
4
|
+
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { Grid } from '@elliemae/ds-grid';\nimport { getLeftBorderStyle, getItemBackgroundStyle } from '../../common/index.js';\nimport { DSLeftNavigationName, DSLeftNavigationSlots } from '../../constants/index.js';\nimport type { DSLeftNavigationT } from '../../react-desc-prop-types.js';\n\nexport const StyledFooterMenu = styled(Grid, { name: DSLeftNavigationName, slot: DSLeftNavigationSlots.FOOTER_MENU })`\n width: 100%;\n margin-top: auto;\n background: ${(props) => props.theme.colors.neutral['000']};\n\n border-top: 1px solid ${(props) => props.theme.colors.neutral[100]};\n`;\n\nexport const StyledFooterItem = styled(Grid, { name: DSLeftNavigationName, slot: DSLeftNavigationSlots.FOOTER_ITEM })<{\n expanded?: boolean;\n opened?: boolean;\n selected?: boolean;\n selectedParent?: boolean;\n}>`\n position: relative;\n ${(props) => getLeftBorderStyle({ ...props })}\n\n min-height: 48px;\n cursor: ${(props) => (props.expanded ? 'auto' : 'pointer')};\n\n ${getItemBackgroundStyle}\n\n outline: none;\n\n :focus {\n &:before {\n content: '';\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0px;\n border: 2px solid ${(props) => props.theme.colors.brand[600]};\n pointer-events: none;\n }\n }\n`;\n\nexport const StyledFooterLabel = styled(Grid, {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.FOOTER_LABEL,\n})<{ labelOverflow?: DSLeftNavigationT.LabelOveflowT }>`\n font-size: 11px;\n color: ${(props) => props.theme.colors.neutral[500]};\n line-height: 14px;\n word-break: ${(props) => (props.labelOverflow === 'wrapAll' ? 'break-all' : 'normal')};\n`;\n\nexport const StyledFooterSeparator = styled(Grid, {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.FOOTER_SEPARATOR,\n})`\n height: 16px;\n width: 1px;\n background-color: ${(props) => props.theme.colors.neutral[100]};\n`;\n\nexport const StyledMenuCollapse = styled(DSButtonV2, {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.FOOTER_MENU_COLLAPSE,\n})`\n padding: 0;\n margin: 0 12px;\n :focus {\n outline: 2px solid ${(props) => props.theme.colors.brand[800]};\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;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
"names": []
|
|
7
7
|
}
|
|
@@ -42,9 +42,15 @@ const OutOfTheBoxMapItem = (props) => {
|
|
|
42
42
|
item: { type, Component }
|
|
43
43
|
} = props;
|
|
44
44
|
const ctx = import_react.default.useContext(import_LeftNavigationContext.LeftNavContext);
|
|
45
|
+
const finalItem = {
|
|
46
|
+
...item,
|
|
47
|
+
itemOpts: {
|
|
48
|
+
...item.itemOpts
|
|
49
|
+
}
|
|
50
|
+
};
|
|
45
51
|
if (typeof type === "string" && !!import_outOfTheBox.outOfTheBoxComponents[type]) {
|
|
46
52
|
const OutOfTheBoxComponent = import_outOfTheBox.outOfTheBoxComponents[type];
|
|
47
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OutOfTheBoxComponent, { item:
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OutOfTheBoxComponent, { item: finalItem, ctx });
|
|
48
54
|
}
|
|
49
55
|
if (!Component)
|
|
50
56
|
return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/OutOfTheBoxMapItem.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { outOfTheBoxComponents } from '../outOfTheBox/index.js';\nimport type {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { outOfTheBoxComponents } from '../outOfTheBox/index.js';\nimport type { DSLeftNavigationT } from '../react-desc-prop-types.js';\nimport { LeftNavContext } from '../LeftNavigationContext.js';\n\nexport const OutOfTheBoxMapItem: React.ComponentType<DSLeftNavigationT.OutOfTheBoxMapItemT> = (props) => {\n const {\n item,\n item: { type, Component },\n } = props;\n const ctx = React.useContext(LeftNavContext);\n\n const finalItem = {\n ...item,\n itemOpts: {\n ...item.itemOpts,\n },\n };\n if (typeof type === 'string' && !!outOfTheBoxComponents[type]) {\n const OutOfTheBoxComponent = outOfTheBoxComponents[type];\n return <OutOfTheBoxComponent item={finalItem} ctx={ctx} />;\n }\n if (!Component) return null;\n // we expect an error to be threw if Component is not defined and type is not a valid out-of-the-box...\n return <Component item={item} ctx={ctx} />;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoBZ;AApBX,mBAAkB;AAClB,yBAAsC;AAEtC,mCAA+B;AAExB,MAAM,qBAAiF,CAAC,UAAU;AACvG,QAAM;AAAA,IACJ;AAAA,IACA,MAAM,EAAE,MAAM,UAAU;AAAA,EAC1B,IAAI;AACJ,QAAM,MAAM,aAAAA,QAAM,WAAW,2CAAc;AAE3C,QAAM,YAAY;AAAA,IAChB,GAAG;AAAA,IACH,UAAU;AAAA,MACR,GAAG,KAAK;AAAA,IACV;AAAA,EACF;AACA,MAAI,OAAO,SAAS,YAAY,CAAC,CAAC,yCAAsB,IAAI,GAAG;AAC7D,UAAM,uBAAuB,yCAAsB,IAAI;AACvD,WAAO,4CAAC,wBAAqB,MAAM,WAAW,KAAU;AAAA,EAC1D;AACA,MAAI,CAAC;AAAW,WAAO;AAEvB,SAAO,4CAAC,aAAU,MAAY,KAAU;AAC1C;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -26,14 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
31
|
LeftNavItemOptionsSchema: () => LeftNavItemOptionsSchema,
|
|
32
32
|
LeftNavItemPropsSchema: () => LeftNavItemPropsSchema,
|
|
33
33
|
leftNavItemProps: () => leftNavItemProps,
|
|
34
34
|
leftNavigationProps: () => leftNavigationProps
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
36
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
37
37
|
var React = __toESM(require("react"));
|
|
38
38
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
39
|
var import_outOfTheBox = require("./outOfTheBox/index.js");
|
|
@@ -51,13 +51,16 @@ const leftNavigationProps = {
|
|
|
51
51
|
expanded: import_ds_props_helpers.PropTypes.bool.description("Whether to show the left navigation expanded or collapsed").defaultValue(false),
|
|
52
52
|
loading: import_ds_props_helpers.PropTypes.bool.description("Whether the left-nav is loading").defaultValue(false),
|
|
53
53
|
openedItem: import_ds_props_helpers.PropTypes.string.description("The id of the left navigation item you want to be opened").defaultValue(null),
|
|
54
|
-
footerLabel: import_ds_props_helpers.PropTypes.string.description(
|
|
54
|
+
footerLabel: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.node, import_ds_props_helpers.PropTypes.string]).description(
|
|
55
|
+
"The label to show in the footer item"
|
|
56
|
+
),
|
|
55
57
|
onFooterExpand: import_ds_props_helpers.PropTypes.func.description("The function to call when the left-nav is opened via the footer"),
|
|
56
58
|
onFooterClose: import_ds_props_helpers.PropTypes.func.description("The function to call when the left-nav is closed via the footer"),
|
|
57
59
|
onSelectedChange: import_ds_props_helpers.PropTypes.func.description("A callback which triggers when the selected item changes").defaultValue(() => null),
|
|
58
60
|
onFocusChange: import_ds_props_helpers.PropTypes.func.description("A callback which triggers when the focused item changes").defaultValue(() => null),
|
|
59
61
|
items: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.object).description("The array of items you want to render inside the left nav").defaultValue([]),
|
|
60
|
-
disableDefaultSelection: import_ds_props_helpers.PropTypes.bool.description("Whether you do not want to automatically select the first body item").defaultValue(false)
|
|
62
|
+
disableDefaultSelection: import_ds_props_helpers.PropTypes.bool.description("Whether you do not want to automatically select the first body item").defaultValue(false),
|
|
63
|
+
isSkeleton: import_ds_props_helpers.PropTypes.bool.description("Whether the component is in skeleton mode").defaultValue(false)
|
|
61
64
|
};
|
|
62
65
|
const LeftNavItemProps = () => null;
|
|
63
66
|
LeftNavItemProps.displayName = "LeftNavItemProps";
|
|
@@ -67,4 +70,4 @@ const LeftNavItemOptions = () => null;
|
|
|
67
70
|
LeftNavItemOptions.displayName = "LeftNavItemOptions";
|
|
68
71
|
const LeftNavItemOptionsSchema = (0, import_ds_props_helpers.describe)(LeftNavItemOptions);
|
|
69
72
|
LeftNavItemOptionsSchema.propTypes = leftNavItemProps;
|
|
70
|
-
//# sourceMappingURL=prop-types.js.map
|
|
73
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-props-helpers';\nimport { type Theme } from '@elliemae/ds-system';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\n\nimport { outOfTheBoxTypes } from './outOfTheBox/index.js';\nimport type { ContextProps } from './LeftNavigationContext.js';\n\ntype ColorsKey = keyof Theme['colors'];\n\nexport declare namespace DSLeftNavigationT {\n export type LabelOveflowT = 'wrap' | 'wrapAll' | 'truncate';\n\n export interface DefaultProps {\n expanded: boolean;\n expandedWidth: string;\n openedItem: string | null;\n items: GenericItemItemProps[];\n footerLabel: string | JSX.Element;\n labelOverflow: LabelOveflowT;\n onSelectedChange: (item: string | null) => void;\n onFocusChange: (item: string | null) => void;\n onFooterExpand: () => void;\n onFooterClose: () => void;\n onItemClick: (item: GenericItemItemProps, e: React.MouseEvent<HTMLElement>) => void;\n loading: boolean;\n isSkeleton: boolean;\n }\n export interface OptionalProps {\n selectedItem?: string | null;\n selectedParent?: string | null;\n disableDefaultSelection?: boolean;\n withoutBodyShadow?: boolean;\n actionRef?: React.RefObject<{ setFocusedItem: React.Dispatch<React.SetStateAction<string | null>> }>;\n HeaderComponent?: GenericItemItemProps;\n BodyHeaderComponent?: GenericItemItemProps;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n\n export type OutOfTheBoxT =\n | 'ds-left-nav-item-header'\n | 'ds-left-nav-item-link'\n | 'ds-left-nav-item-submenu'\n | 'ds-left-nav-item-controlled-drilldown'\n | 'ds-left-nav-item-uncontrolled-drilldown'\n | 'ds-left-nav-item-section'\n | 'ds-left-nav-item-separator'\n | 'ds-left-nav-item-text-label'\n | 'ds-left-nav-item-with-date';\n\n export interface ItemOptsT extends Record<string, unknown> {\n label?: string | JSX.Element;\n labelBold?: boolean;\n labelColor?: [ColorsKey, keyof Theme['colors'][ColorsKey]];\n labelOverflow?: LabelOveflowT;\n labelRightSection?: string | JSX.Element;\n selectable?: boolean;\n focuseable?: boolean;\n startOpened?: boolean;\n isOpened?: boolean;\n openable?: boolean;\n closable?: boolean;\n indent?: number;\n LeftComponent?: React.ComponentType<ComponentProps>;\n RightComponent?: React.ComponentType<ComponentProps>;\n BottomComponent?: React.ComponentType<ComponentProps>;\n ariaLabel?: string;\n ariaRole?: string;\n ariaLive?: string;\n ariaExpanded?: boolean;\n ariaDescribedBy?: string;\n items?: GenericItemItemProps[];\n labelDataTestId?: string;\n skeletonVariant?: 'item' | 'subitem';\n }\n\n export interface ComponentProps {\n item: GenericItemItemProps;\n ctx: ContextProps;\n }\n export interface GenericItemItemProps {\n dsId?: string;\n type?: string;\n CollapsedComponent?: React.ComponentType<ComponentProps> | null;\n Component?: React.ComponentType<ComponentProps>;\n itemOpts: ItemOptsT;\n }\n export interface OutOfTheBoxMapItemT {\n item: GenericItemItemProps;\n }\n export interface ItemRendererT {\n item: GenericItemItemProps;\n subitems?: JSX.Element[];\n minHeight?: string;\n paddingTop?: string;\n onClick?: () => void;\n shadowStyle?: (opened: boolean, type?: string) => (theme: Theme) => string;\n hasBorderBottom?: boolean;\n borderBottomMr?: string;\n children: React.ReactNode;\n }\n}\nexport const leftNavItemProps = {\n type: PropTypes.oneOf(outOfTheBoxTypes).description('out of the box types'),\n dsId: PropTypes.string.description('unique identifier for the left nav item'),\n Component: PropTypes.func.description(\n \"A custom component, receives the item as prop. This is used only when type is not defined or doesn't matches any out-of-the-box\",\n ),\n CollapsedComponent: PropTypes.func.description('A component which is renderer when the left-nav is collapsed'),\n itemOpts: PropTypes.object.description('Item options'),\n};\n\nexport const leftNavigationProps = {\n containerProps: PropTypes.shape({ expandedWidth: PropTypes.string })\n .description('Set of Properties attached to the main container')\n .defaultValue({ expandedWidth: '240px' }),\n expanded: PropTypes.bool.description('Whether to show the left navigation expanded or collapsed').defaultValue(false),\n loading: PropTypes.bool.description('Whether the left-nav is loading').defaultValue(false),\n openedItem: PropTypes.string\n .description('The id of the left navigation item you want to be opened')\n .defaultValue(null),\n footerLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.string]).description(\n 'The label to show in the footer item',\n ),\n onFooterExpand: PropTypes.func.description('The function to call when the left-nav is opened via the footer'),\n onFooterClose: PropTypes.func.description('The function to call when the left-nav is closed via the footer'),\n onSelectedChange: PropTypes.func\n .description('A callback which triggers when the selected item changes')\n .defaultValue(() => null),\n onFocusChange: PropTypes.func\n .description('A callback which triggers when the focused item changes')\n .defaultValue(() => null),\n items: PropTypes.arrayOf(PropTypes.object)\n .description('The array of items you want to render inside the left nav')\n .defaultValue([]),\n disableDefaultSelection: PropTypes.bool\n .description('Whether you do not want to automatically select the first body item')\n .defaultValue(false),\n isSkeleton: PropTypes.bool.description('Whether the component is in skeleton mode').defaultValue(false),\n} as unknown as WeakValidationMap<DSLeftNavigationT.Props>;\n\nconst LeftNavItemProps = () => null;\nLeftNavItemProps.displayName = 'LeftNavItemProps';\nexport const LeftNavItemPropsSchema = describe(LeftNavItemProps);\nLeftNavItemPropsSchema.propTypes = leftNavItemProps;\n\nconst LeftNavItemOptions = () => null;\nLeftNavItemOptions.displayName = 'LeftNavItemOptions';\nexport const LeftNavItemOptionsSchema = describe(LeftNavItemOptions);\nLeftNavItemOptionsSchema.propTypes = leftNavItemProps;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAAoC;AAIpC,yBAAiC;AA2G1B,MAAM,mBAAmB;AAAA,EAC9B,MAAM,kCAAU,MAAM,mCAAgB,EAAE,YAAY,sBAAsB;AAAA,EAC1E,MAAM,kCAAU,OAAO,YAAY,yCAAyC;AAAA,EAC5E,WAAW,kCAAU,KAAK;AAAA,IACxB;AAAA,EACF;AAAA,EACA,oBAAoB,kCAAU,KAAK,YAAY,8DAA8D;AAAA,EAC7G,UAAU,kCAAU,OAAO,YAAY,cAAc;AACvD;AAEO,MAAM,sBAAsB;AAAA,EACjC,gBAAgB,kCAAU,MAAM,EAAE,eAAe,kCAAU,OAAO,CAAC,EAChE,YAAY,kDAAkD,EAC9D,aAAa,EAAE,eAAe,QAAQ,CAAC;AAAA,EAC1C,UAAU,kCAAU,KAAK,YAAY,2DAA2D,EAAE,aAAa,KAAK;AAAA,EACpH,SAAS,kCAAU,KAAK,YAAY,iCAAiC,EAAE,aAAa,KAAK;AAAA,EACzF,YAAY,kCAAU,OACnB,YAAY,0DAA0D,EACtE,aAAa,IAAI;AAAA,EACpB,aAAa,kCAAU,UAAU,CAAC,kCAAU,MAAM,kCAAU,MAAM,CAAC,EAAE;AAAA,IACnE;AAAA,EACF;AAAA,EACA,gBAAgB,kCAAU,KAAK,YAAY,iEAAiE;AAAA,EAC5G,eAAe,kCAAU,KAAK,YAAY,iEAAiE;AAAA,EAC3G,kBAAkB,kCAAU,KACzB,YAAY,0DAA0D,EACtE,aAAa,MAAM,IAAI;AAAA,EAC1B,eAAe,kCAAU,KACtB,YAAY,yDAAyD,EACrE,aAAa,MAAM,IAAI;AAAA,EAC1B,OAAO,kCAAU,QAAQ,kCAAU,MAAM,EACtC,YAAY,2DAA2D,EACvE,aAAa,CAAC,CAAC;AAAA,EAClB,yBAAyB,kCAAU,KAChC,YAAY,qEAAqE,EACjF,aAAa,KAAK;AAAA,EACrB,YAAY,kCAAU,KAAK,YAAY,2CAA2C,EAAE,aAAa,KAAK;AACxG;AAEA,MAAM,mBAAmB,MAAM;AAC/B,iBAAiB,cAAc;AACxB,MAAM,6BAAyB,kCAAS,gBAAgB;AAC/D,uBAAuB,YAAY;AAEnC,MAAM,qBAAqB,MAAM;AACjC,mBAAmB,cAAc;AAC1B,MAAM,+BAA2B,kCAAS,kBAAkB;AACnE,yBAAyB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
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
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react = require("react");
|
|
27
|
+
var import__ = require("../index.js");
|
|
28
|
+
var import_constants = require("../exported-related/constants.js");
|
|
29
|
+
const ref = (0, import_react.createRef)();
|
|
30
|
+
const testOptionalProps = {
|
|
31
|
+
selectedItem: "selected item",
|
|
32
|
+
selectedParent: "parent",
|
|
33
|
+
disableDefaultSelection: true,
|
|
34
|
+
withoutBodyShadow: true,
|
|
35
|
+
actionRef: ref,
|
|
36
|
+
HeaderComponent: {
|
|
37
|
+
type: import_constants.ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
|
|
38
|
+
dsId: "application-header-id",
|
|
39
|
+
CollapsedComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
40
|
+
itemOpts: {
|
|
41
|
+
label: "Notifications"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
BodyHeaderComponent: {
|
|
45
|
+
type: import_constants.ITEM_TYPES.LEFT_NAV_ITEM_SUBMENU,
|
|
46
|
+
dsId: "application-submenu-forms-id",
|
|
47
|
+
CollapsedComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
48
|
+
itemOpts: {
|
|
49
|
+
label: "Forms"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const testPartialDefaults = {};
|
|
54
|
+
const testProps = {
|
|
55
|
+
...testOptionalProps,
|
|
56
|
+
...testPartialDefaults
|
|
57
|
+
};
|
|
58
|
+
const testPropsAsSyntax = {
|
|
59
|
+
...testOptionalProps,
|
|
60
|
+
...testPartialDefaults
|
|
61
|
+
};
|
|
62
|
+
const testCompleteDefaults = {
|
|
63
|
+
expanded: true,
|
|
64
|
+
expandedWidth: "100px",
|
|
65
|
+
openedItem: "opened item",
|
|
66
|
+
items: [
|
|
67
|
+
{
|
|
68
|
+
type: import_constants.ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
|
|
69
|
+
dsId: "application-header-id",
|
|
70
|
+
CollapsedComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
71
|
+
itemOpts: {
|
|
72
|
+
label: "Notifications"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
footerLabel: "",
|
|
77
|
+
onSelectedChange: () => null,
|
|
78
|
+
onFocusChange: () => null,
|
|
79
|
+
onFooterExpand: () => null,
|
|
80
|
+
onFooterClose: () => null,
|
|
81
|
+
labelOverflow: "wrap",
|
|
82
|
+
onItemClick: () => null,
|
|
83
|
+
isSkeleton: false,
|
|
84
|
+
loading: false
|
|
85
|
+
};
|
|
86
|
+
const testInternalProps = {
|
|
87
|
+
...testOptionalProps,
|
|
88
|
+
...testCompleteDefaults
|
|
89
|
+
};
|
|
90
|
+
const testInternalPropsAsSyntax = {
|
|
91
|
+
...testOptionalProps,
|
|
92
|
+
...testCompleteDefaults
|
|
93
|
+
};
|
|
94
|
+
const testExplicitDefinition = {
|
|
95
|
+
expanded: true,
|
|
96
|
+
expandedWidth: "100px",
|
|
97
|
+
openedItem: "opened item",
|
|
98
|
+
items: [
|
|
99
|
+
{
|
|
100
|
+
type: import_constants.ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
|
|
101
|
+
dsId: "application-header-id",
|
|
102
|
+
CollapsedComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
103
|
+
itemOpts: {
|
|
104
|
+
label: "Notifications"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
footerLabel: "",
|
|
109
|
+
onSelectedChange: () => null,
|
|
110
|
+
onFocusChange: () => null,
|
|
111
|
+
onFooterExpand: () => null,
|
|
112
|
+
onFooterClose: () => null,
|
|
113
|
+
labelOverflow: "wrap",
|
|
114
|
+
onItemClick: () => null,
|
|
115
|
+
isSkeleton: false,
|
|
116
|
+
loading: false
|
|
117
|
+
};
|
|
118
|
+
const testInferedTypeCompatibility = {
|
|
119
|
+
expanded: true,
|
|
120
|
+
expandedWidth: "100px",
|
|
121
|
+
openedItem: "opened item",
|
|
122
|
+
items: [
|
|
123
|
+
{
|
|
124
|
+
type: import_constants.ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
|
|
125
|
+
dsId: "application-header-id",
|
|
126
|
+
CollapsedComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
127
|
+
itemOpts: {
|
|
128
|
+
label: "Notifications"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
footerLabel: "",
|
|
133
|
+
onSelectedChange: () => null,
|
|
134
|
+
onFocusChange: () => null,
|
|
135
|
+
onFooterExpand: () => null,
|
|
136
|
+
onFooterClose: () => null,
|
|
137
|
+
labelOverflow: "wrap",
|
|
138
|
+
onItemClick: () => null,
|
|
139
|
+
isSkeleton: false,
|
|
140
|
+
loading: false
|
|
141
|
+
};
|
|
142
|
+
const testDefinitionAsConst = {
|
|
143
|
+
expanded: true,
|
|
144
|
+
expandedWidth: "100px",
|
|
145
|
+
openedItem: "opened item",
|
|
146
|
+
footerLabel: "",
|
|
147
|
+
onSelectedChange: () => null,
|
|
148
|
+
onFocusChange: () => null,
|
|
149
|
+
onFooterExpand: () => null,
|
|
150
|
+
onFooterClose: () => null,
|
|
151
|
+
labelOverflow: "wrap",
|
|
152
|
+
onItemClick: () => null,
|
|
153
|
+
isSkeleton: false,
|
|
154
|
+
loading: false
|
|
155
|
+
};
|
|
156
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.LeftNavigation, { ...testExplicitDefinition }),
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.LeftNavigation, { ...testInferedTypeCompatibility }),
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.LeftNavigation, { ...testDefinitionAsConst }),
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
+
import__.LeftNavigation,
|
|
162
|
+
{
|
|
163
|
+
expanded: true,
|
|
164
|
+
expandedWidth: "100px",
|
|
165
|
+
openedItem: "opened item",
|
|
166
|
+
items: [
|
|
167
|
+
{
|
|
168
|
+
type: import_constants.ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
|
|
169
|
+
dsId: "application-header-id",
|
|
170
|
+
CollapsedComponent: () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
171
|
+
itemOpts: {
|
|
172
|
+
label: "Notifications"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
footerLabel: "",
|
|
177
|
+
onSelectedChange: () => null,
|
|
178
|
+
onFocusChange: () => null,
|
|
179
|
+
onFooterExpand: () => null,
|
|
180
|
+
onFooterClose: () => null,
|
|
181
|
+
labelOverflow: "wrap",
|
|
182
|
+
onItemClick: () => null
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] });
|
|
186
|
+
//# sourceMappingURL=typescript-left-navigation-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-left-navigation-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { createRef } from 'react';\nimport { LeftNavigation } from '../index.js';\nimport type { DSLeftNavigationT } from '../index.js';\nimport { ITEM_TYPES } from '../exported-related/constants.js';\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSLeftNavigationT.Props;\ntype ComponentPropsInternals = DSLeftNavigationT.InternalProps;\ntype ComponentPropsDefaultProps = DSLeftNavigationT.DefaultProps;\ntype ComponentPropsOptionalProps = DSLeftNavigationT.OptionalProps;\n\nconst ref = createRef<{ setFocusedItem: React.Dispatch<React.SetStateAction<string | null>> }>();\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n selectedItem: 'selected item',\n selectedParent: 'parent',\n disableDefaultSelection: true,\n withoutBodyShadow: true,\n actionRef: ref,\n HeaderComponent: {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n BodyHeaderComponent: {\n type: ITEM_TYPES.LEFT_NAV_ITEM_SUBMENU,\n dsId: 'application-submenu-forms-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Forms',\n },\n },\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {};\nconst testProps: ComponentPropsForApp = {\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n expanded: true,\n expandedWidth: '100px',\n openedItem: 'opened item',\n items: [\n {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n ],\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n labelOverflow: 'wrap',\n onItemClick: () => null,\n isSkeleton: false,\n loading: false,\n};\nconst testInternalProps: ComponentPropsInternals = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n expanded: true,\n expandedWidth: '100px',\n openedItem: 'opened item',\n items: [\n {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n ],\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n labelOverflow: 'wrap',\n onItemClick: () => null,\n isSkeleton: false,\n loading: 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\nconst testInferedTypeCompatibility = {\n expanded: true,\n expandedWidth: '100px',\n openedItem: 'opened item',\n items: [\n {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n ],\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n labelOverflow: 'wrap',\n onItemClick: () => null,\n isSkeleton: false,\n loading: false,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n expanded: true,\n expandedWidth: '100px',\n openedItem: 'opened item',\n footerLabel: '',\n onSelectedChange: () => null,\n onFocusChange: () => null,\n onFooterExpand: () => null,\n onFooterClose: () => null,\n labelOverflow: 'wrap',\n onItemClick: () => null,\n isSkeleton: false,\n loading: false,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <LeftNavigation {...testExplicitDefinition} />\n <LeftNavigation {...testInferedTypeCompatibility} />\n <LeftNavigation {...testDefinitionAsConst} />\n {/* works with inline values */}\n <LeftNavigation\n expanded\n expandedWidth=\"100px\"\n openedItem=\"opened item\"\n items={[\n {\n type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,\n dsId: 'application-header-id',\n CollapsedComponent: () => <div />,\n itemOpts: {\n label: 'Notifications',\n },\n },\n ]}\n footerLabel=\"\"\n onSelectedChange={() => null}\n onFocusChange={() => null}\n onFooterExpand={() => null}\n onFooterClose={() => null}\n labelOverflow=\"wrap\"\n onItemClick={() => null}\n />\n </>\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACsBO;AArB9B,mBAA0B;AAC1B,eAA+B;AAE/B,uBAA2B;AAO3B,MAAM,UAAM,wBAAmF;AAE/F,MAAM,oBAAiD;AAAA,EACrD,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,iBAAiB;AAAA,IACf,MAAM,4BAAW;AAAA,IACjB,MAAM;AAAA,IACN,oBAAoB,MAAM,4CAAC,SAAI;AAAA,IAC/B,UAAU;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,qBAAqB;AAAA,IACnB,MAAM,4BAAW;AAAA,IACjB,MAAM;AAAA,IACN,oBAAoB,MAAM,4CAAC,SAAI;AAAA,IAC/B,UAAU;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AACF;AAIA,MAAM,sBAA2D,CAAC;AAClE,MAAM,YAAkC;AAAA,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+
}
|
|
@@ -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 { leftNavigationProps } from "./prop-types.js";
|
|
4
|
+
import { leftNavigationProps } from "./react-desc-prop-types.js";
|
|
5
5
|
import LeftNavigationContext, { defaultProps } from "./LeftNavigationContext.js";
|
|
6
6
|
import { useLeftNavConfig } from "./configs/useLeftNavConfig.js";
|
|
7
7
|
import LeftNavContent from "./parts/LeftNavContent/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/LeftNavigation.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { leftNavigationProps } from './prop-types.js';\nimport LeftNavigationContext, { defaultProps } from './LeftNavigationContext.js';\nimport { useLeftNavConfig } from './configs/useLeftNavConfig.js';\nimport LeftNavContent from './parts/LeftNavContent/index.js';\nimport type {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACajB;AAZN,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AACpC,OAAO,yBAAyB,oBAAoB;AACpD,SAAS,wBAAwB;AACjC,OAAO,oBAAoB;AAGpB,MAAM,iBAAiB,CAAC,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { leftNavigationProps } from './react-desc-prop-types.js';\nimport LeftNavigationContext, { defaultProps } from './LeftNavigationContext.js';\nimport { useLeftNavConfig } from './configs/useLeftNavConfig.js';\nimport LeftNavContent from './parts/LeftNavContent/index.js';\nimport type { DSLeftNavigationT } from './react-desc-prop-types.js';\n\nexport const LeftNavigation = (props: DSLeftNavigationT.Props): JSX.Element => {\n const leftNavConfig = useLeftNavConfig(props);\n\n return (\n <LeftNavigationContext.Provider value={leftNavConfig}>\n <LeftNavContent />\n </LeftNavigationContext.Provider>\n );\n};\n\nLeftNavigation.propTypes = leftNavigationProps;\nLeftNavigation.defaultProps = defaultProps;\nLeftNavigation.displayName = 'LeftNavigation';\nexport const LeftNavigationWithSchema = describe(LeftNavigation).description('Left Navigation');\nLeftNavigationWithSchema.propTypes = leftNavigationProps;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACajB;AAZN,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AACpC,OAAO,yBAAyB,oBAAoB;AACpD,SAAS,wBAAwB;AACjC,OAAO,oBAAoB;AAGpB,MAAM,iBAAiB,CAAC,UAAgD;AAC7E,QAAM,gBAAgB,iBAAiB,KAAK;AAE5C,SACE,oBAAC,sBAAsB,UAAtB,EAA+B,OAAO,eACrC,8BAAC,kBAAe,GAClB;AAEJ;AAEA,eAAe,YAAY;AAC3B,eAAe,eAAe;AAC9B,eAAe,cAAc;AACtB,MAAM,2BAA2B,SAAS,cAAc,EAAE,YAAY,iBAAiB;AAC9F,yBAAyB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|