@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.
Files changed (160) hide show
  1. package/dist/cjs/LeftNavigation.js +3 -3
  2. package/dist/cjs/LeftNavigation.js.map +2 -2
  3. package/dist/cjs/LeftNavigationContext.js +2 -1
  4. package/dist/cjs/LeftNavigationContext.js.map +2 -2
  5. package/dist/cjs/common/getItemBackgroundStyle.js.map +2 -2
  6. package/dist/cjs/common/getLeftBorderStyle.js.map +2 -2
  7. package/dist/cjs/configs/useLeftNavConfig.js +31 -26
  8. package/dist/cjs/configs/useLeftNavConfig.js.map +2 -2
  9. package/dist/cjs/configs/useLeftNavItems.js +4 -2
  10. package/dist/cjs/configs/useLeftNavItems.js.map +2 -2
  11. package/dist/cjs/configs/useLeftNavSmoothExpand.js.map +2 -2
  12. package/dist/cjs/exported-related/ChevronItem/index.js.map +2 -2
  13. package/dist/cjs/exported-related/Icon/index.js.map +2 -2
  14. package/dist/cjs/exported-related/ItemRenderer/index.js +8 -5
  15. package/dist/cjs/exported-related/ItemRenderer/index.js.map +2 -2
  16. package/dist/cjs/exported-related/ItemRenderer/styled.js.map +1 -1
  17. package/dist/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js.map +2 -2
  18. package/dist/cjs/exported-related/OpenWindowItem/index.js.map +2 -2
  19. package/dist/cjs/exported-related/constants.js +13 -1
  20. package/dist/cjs/exported-related/constants.js.map +2 -2
  21. package/dist/cjs/hooks/useExpandableOnClickHandler.js.map +2 -2
  22. package/dist/cjs/hooks/useKeyboardNavigation.js +2 -2
  23. package/dist/cjs/hooks/useKeyboardNavigation.js.map +2 -2
  24. package/dist/cjs/hooks/useOpenableOnClickHandler.js.map +2 -2
  25. package/dist/cjs/hooks/useSelectFirstBodyItem.js.map +2 -2
  26. package/dist/cjs/index.js +3 -3
  27. package/dist/cjs/index.js.map +2 -2
  28. package/dist/cjs/outOfTheBox/ItemControlledDrilldown/index.js.map +2 -2
  29. package/dist/cjs/outOfTheBox/ItemHeader/index.js +2 -1
  30. package/dist/cjs/outOfTheBox/ItemHeader/index.js.map +2 -2
  31. package/dist/cjs/outOfTheBox/ItemLink/index.js.map +2 -2
  32. package/dist/cjs/outOfTheBox/ItemSection/index.js.map +2 -2
  33. package/dist/cjs/outOfTheBox/ItemSeparator/index.js.map +2 -2
  34. package/dist/cjs/outOfTheBox/ItemSkeleton/index.js +7 -5
  35. package/dist/cjs/outOfTheBox/ItemSkeleton/index.js.map +2 -2
  36. package/dist/cjs/outOfTheBox/ItemSubmenu/index.js +2 -1
  37. package/dist/cjs/outOfTheBox/ItemSubmenu/index.js.map +2 -2
  38. package/dist/cjs/outOfTheBox/ItemTextLabel/index.js.map +2 -2
  39. package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +2 -2
  40. package/dist/cjs/outOfTheBox/ItemWithDate/index.js +1 -1
  41. package/dist/cjs/outOfTheBox/ItemWithDate/index.js.map +2 -2
  42. package/dist/cjs/outOfTheBox/index.js.map +2 -2
  43. package/dist/cjs/outOfTheBox/styled.js.map +1 -1
  44. package/dist/cjs/parts/LeftNavContent/index.js +30 -4
  45. package/dist/cjs/parts/LeftNavContent/index.js.map +2 -2
  46. package/dist/cjs/parts/LeftNavContent/styled.js +2 -2
  47. package/dist/cjs/parts/LeftNavContent/styled.js.map +2 -2
  48. package/dist/cjs/parts/LeftNavFooterItem/index.js +14 -5
  49. package/dist/cjs/parts/LeftNavFooterItem/index.js.map +2 -2
  50. package/dist/cjs/parts/LeftNavFooterItem/styled.js +1 -1
  51. package/dist/cjs/parts/LeftNavFooterItem/styled.js.map +2 -2
  52. package/dist/cjs/parts/OutOfTheBoxMapItem.js +7 -1
  53. package/dist/cjs/parts/OutOfTheBoxMapItem.js.map +2 -2
  54. package/dist/cjs/{prop-types.js → react-desc-prop-types.js} +9 -6
  55. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  56. package/dist/cjs/typescript-testing/typescript-left-navigation-valid.js +186 -0
  57. package/dist/cjs/typescript-testing/typescript-left-navigation-valid.js.map +7 -0
  58. package/dist/esm/LeftNavigation.js +1 -1
  59. package/dist/esm/LeftNavigation.js.map +2 -2
  60. package/dist/esm/LeftNavigationContext.js +2 -1
  61. package/dist/esm/LeftNavigationContext.js.map +2 -2
  62. package/dist/esm/common/getItemBackgroundStyle.js.map +2 -2
  63. package/dist/esm/common/getLeftBorderStyle.js.map +2 -2
  64. package/dist/esm/configs/useLeftNavConfig.js +31 -26
  65. package/dist/esm/configs/useLeftNavConfig.js.map +2 -2
  66. package/dist/esm/configs/useLeftNavItems.js +4 -2
  67. package/dist/esm/configs/useLeftNavItems.js.map +2 -2
  68. package/dist/esm/configs/useLeftNavSmoothExpand.js.map +2 -2
  69. package/dist/esm/exported-related/ChevronItem/index.js.map +2 -2
  70. package/dist/esm/exported-related/Icon/index.js.map +2 -2
  71. package/dist/esm/exported-related/ItemRenderer/index.js +8 -5
  72. package/dist/esm/exported-related/ItemRenderer/index.js.map +2 -2
  73. package/dist/esm/exported-related/ItemRenderer/styled.js.map +1 -1
  74. package/dist/esm/exported-related/ItemRenderer/usePropsWithDefaults.js.map +2 -2
  75. package/dist/esm/exported-related/OpenWindowItem/index.js.map +2 -2
  76. package/dist/esm/exported-related/constants.js +13 -1
  77. package/dist/esm/exported-related/constants.js.map +2 -2
  78. package/dist/esm/hooks/useExpandableOnClickHandler.js.map +2 -2
  79. package/dist/esm/hooks/useKeyboardNavigation.js +2 -2
  80. package/dist/esm/hooks/useKeyboardNavigation.js.map +2 -2
  81. package/dist/esm/hooks/useOpenableOnClickHandler.js.map +2 -2
  82. package/dist/esm/hooks/useSelectFirstBodyItem.js.map +2 -2
  83. package/dist/esm/index.js +1 -1
  84. package/dist/esm/index.js.map +2 -2
  85. package/dist/esm/outOfTheBox/ItemControlledDrilldown/index.js.map +2 -2
  86. package/dist/esm/outOfTheBox/ItemHeader/index.js +2 -1
  87. package/dist/esm/outOfTheBox/ItemHeader/index.js.map +2 -2
  88. package/dist/esm/outOfTheBox/ItemLink/index.js.map +2 -2
  89. package/dist/esm/outOfTheBox/ItemSection/index.js.map +2 -2
  90. package/dist/esm/outOfTheBox/ItemSeparator/index.js.map +2 -2
  91. package/dist/esm/outOfTheBox/ItemSkeleton/index.js +7 -5
  92. package/dist/esm/outOfTheBox/ItemSkeleton/index.js.map +2 -2
  93. package/dist/esm/outOfTheBox/ItemSubmenu/index.js +2 -1
  94. package/dist/esm/outOfTheBox/ItemSubmenu/index.js.map +2 -2
  95. package/dist/esm/outOfTheBox/ItemTextLabel/index.js.map +2 -2
  96. package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +2 -2
  97. package/dist/esm/outOfTheBox/ItemWithDate/index.js +1 -1
  98. package/dist/esm/outOfTheBox/ItemWithDate/index.js.map +2 -2
  99. package/dist/esm/outOfTheBox/index.js.map +2 -2
  100. package/dist/esm/outOfTheBox/styled.js.map +1 -1
  101. package/dist/esm/parts/LeftNavContent/index.js +30 -4
  102. package/dist/esm/parts/LeftNavContent/index.js.map +2 -2
  103. package/dist/esm/parts/LeftNavContent/styled.js +2 -2
  104. package/dist/esm/parts/LeftNavContent/styled.js.map +2 -2
  105. package/dist/esm/parts/LeftNavFooterItem/index.js +15 -6
  106. package/dist/esm/parts/LeftNavFooterItem/index.js.map +2 -2
  107. package/dist/esm/parts/LeftNavFooterItem/styled.js +1 -1
  108. package/dist/esm/parts/LeftNavFooterItem/styled.js.map +2 -2
  109. package/dist/esm/parts/OutOfTheBoxMapItem.js +7 -1
  110. package/dist/esm/parts/OutOfTheBoxMapItem.js.map +2 -2
  111. package/dist/esm/{prop-types.js → react-desc-prop-types.js} +6 -3
  112. package/dist/esm/react-desc-prop-types.js.map +7 -0
  113. package/dist/esm/typescript-testing/typescript-left-navigation-valid.js +163 -0
  114. package/dist/esm/typescript-testing/typescript-left-navigation-valid.js.map +7 -0
  115. package/dist/types/LeftNavigation.d.ts +6 -17
  116. package/dist/types/LeftNavigationContext.d.ts +4 -4
  117. package/dist/types/common/getItemBackgroundStyle.d.ts +2 -2
  118. package/dist/types/common/getLeftBorderStyle.d.ts +2 -2
  119. package/dist/types/configs/useLeftNavConfig.d.ts +16 -3
  120. package/dist/types/configs/useLeftNavItems.d.ts +5 -5
  121. package/dist/types/configs/useLeftNavSmoothExpand.d.ts +2 -2
  122. package/dist/types/exported-related/ChevronItem/index.d.ts +3 -1
  123. package/dist/types/exported-related/Icon/index.d.ts +2 -1
  124. package/dist/types/exported-related/ItemRenderer/index.d.ts +2 -2
  125. package/dist/types/exported-related/ItemRenderer/styled.d.ts +1 -0
  126. package/dist/types/exported-related/ItemRenderer/usePropsWithDefaults.d.ts +2 -2
  127. package/dist/types/exported-related/Notifications/index.d.ts +1 -0
  128. package/dist/types/exported-related/OpenWindowItem/index.d.ts +3 -1
  129. package/dist/types/exported-related/constants.d.ts +11 -0
  130. package/dist/types/hooks/useExpandableOnClickHandler.d.ts +2 -2
  131. package/dist/types/hooks/useKeyboardNavigation.d.ts +4 -4
  132. package/dist/types/hooks/useOpenableOnClickHandler.d.ts +2 -2
  133. package/dist/types/hooks/useSelectFirstBodyItem.d.ts +2 -2
  134. package/dist/types/index.d.ts +1 -1
  135. package/dist/types/outOfTheBox/ItemControlledDrilldown/index.d.ts +3 -2
  136. package/dist/types/outOfTheBox/ItemHeader/index.d.ts +3 -2
  137. package/dist/types/outOfTheBox/ItemLink/index.d.ts +3 -2
  138. package/dist/types/outOfTheBox/ItemSection/index.d.ts +3 -2
  139. package/dist/types/outOfTheBox/ItemSeparator/index.d.ts +3 -2
  140. package/dist/types/outOfTheBox/ItemSkeleton/index.d.ts +8 -2
  141. package/dist/types/outOfTheBox/ItemSubmenu/index.d.ts +3 -2
  142. package/dist/types/outOfTheBox/ItemTextLabel/index.d.ts +3 -2
  143. package/dist/types/outOfTheBox/ItemUncontrolledDrilldown/index.d.ts +3 -2
  144. package/dist/types/outOfTheBox/ItemWithDate/index.d.ts +3 -2
  145. package/dist/types/outOfTheBox/index.d.ts +2 -2
  146. package/dist/types/outOfTheBox/styled.d.ts +2 -1
  147. package/dist/types/parts/LeftNavContent/styled.d.ts +2 -0
  148. package/dist/types/parts/LeftNavFooterItem/styled.d.ts +6 -4
  149. package/dist/types/parts/OutOfTheBoxMapItem.d.ts +2 -2
  150. package/dist/types/react-desc-prop-types.d.ts +100 -0
  151. package/dist/types/typescript-testing/typescript-left-navigation-valid.d.ts +1 -0
  152. package/package.json +13 -11
  153. package/dist/cjs/index.d.js +0 -28
  154. package/dist/cjs/index.d.js.map +0 -7
  155. package/dist/cjs/prop-types.js.map +0 -7
  156. package/dist/esm/index.d.js +0 -2
  157. package/dist/esm/index.d.js.map +0 -7
  158. package/dist/esm/prop-types.js.map +0 -7
  159. package/dist/types/index.d.d.ts +0 -78
  160. package/dist/types/prop-types.d.ts +0 -22
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/LeftNavContent/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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';\n\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 },\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 {HeaderComponent ? <OutOfTheBoxMapItem item={HeaderComponent} /> : null}\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 >\n {BodyHeaderComponent ? <OutOfTheBoxMapItem item={BodyHeaderComponent} /> : null}\n </StyledLeftNavBodyHeaderArea>\n <StyledLeftNavBodyItemsArea\n selected={!withoutBodyShadow && openedItem !== null}\n data-testid=\"leftnav-body-items-area\"\n tabIndex={-1}\n role=\"group\"\n >\n {items.map((item) => (\n <OutOfTheBoxMapItem item={item} key={item.dsId} />\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"],
5
- "mappings": "AAAA,YAAY,WAAW;AC2BnB,mBAMuB,KAErB,YARF;AA3BJ,OAAOA,YAAW;AAClB,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAE/B,MAAM,kCACJ;AAKF,MAAM,sBAAsB,MAAM;AAChC,QAAM;AAAA,IACJ,cAAc,EAAE,iBAAiB,qBAAqB,YAAY,OAAO,kBAAkB;AAAA,IAC3F;AAAA,EACF,IAAIA,OAAM,WAAW,cAAc;AACnC,SACE,iCACE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,eAAY;AAAA,QACZ,UAAU,CAAC,CAAC,mBAAmB,CAAC,cAAc,UAAU,EAAE,SAAS,gBAAgB,IAAc;AAAA,QACjG,MAAK;AAAA,QAEJ,4BAAkB,oBAAC,sBAAmB,MAAM,iBAAiB,IAAK;AAAA;AAAA,IACrE;AAAA,IACA,qBAAC,mCAAgC,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,QAAQ,KAAK,GAAG,MAAK,SAC1E;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,eAAY;AAAA,UACZ,UAAU,CAAC,CAAC,uBAAuB,CAAC,cAAc,UAAU,EAAE,SAAS,oBAAoB,IAAc;AAAA,UACzG,MAAK;AAAA,UAEJ,gCAAsB,oBAAC,sBAAmB,MAAM,qBAAqB,IAAK;AAAA;AAAA,MAC7E;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,UAAU,CAAC,qBAAqB,eAAe;AAAA,UAC/C,eAAY;AAAA,UACZ,UAAU;AAAA,UACV,MAAK;AAAA,UAEJ,gBAAM,IAAI,CAAC,SACV,oBAAC,sBAAmB,QAAiB,KAAK,IAAM,CACjD;AAAA;AAAA,MACH;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,IAAIA,OAAM,WAAW,cAAc;AAEnC,QAAM,cAAc,uBAAuB,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,oBAAC,kBAAe,UAAU,sBAAsB;AAAA,YAC3D,CAAC,WAAW,oBAAC,uBAAoB;AAAA,YAClC,oBAAC,qBAAkB,aAA0B,gBAAgC,eAA8B;AAAA;AAAA;AAAA,MAC7G;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,yBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkCb,SAEA,UAFA,KAEA,YAFA;AAlCV,OAAOA,YAAW;AAClB,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,MAAM,kCACJ;AAKF,MAAM,sBAAsB,MAAM;AAChC,QAAM;AAAA,IACJ,cAAc,EAAE,iBAAiB,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gCACG,gBAAM,IAAI,CAAC,SACV,oBAAC,sBAAmB,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,IAAIA,OAAM,WAAW,cAAc;AAEnC,QAAM,cAAc,uBAAuB,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,oBAAC,kBAAe,UAAU,sBAAsB;AAAA,YAC3D,CAAC,WAAW,oBAAC,uBAAoB;AAAA,YAClC,oBAAC,qBAAkB,aAA0B,gBAAgC,eAA8B;AAAA;AAAA;AAAA,MAC7G;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,yBAAQ;",
6
6
  "names": ["React"]
7
7
  }
@@ -56,7 +56,7 @@ const StyledLeftNavBodyHeaderArea = styled("div", {
56
56
  slot: DSLeftNavigationSlots.BODY_HEADER_AREA
57
57
  })`
58
58
  width: 100%;
59
- ${getLeftShadowStyles}
59
+ ${({ isSkeleton }) => !isSkeleton ? getLeftShadowStyles : ""}
60
60
  `;
61
61
  const StyledLeftNavBodyItemsArea = styled("div", {
62
62
  name: DSLeftNavigationName,
@@ -64,7 +64,7 @@ const StyledLeftNavBodyItemsArea = styled("div", {
64
64
  })`
65
65
  width: 100%;
66
66
  overflow: auto;
67
- box-shadow: inset 4px 0 0 0 ${(props) => props.selected ? props.theme.colors.brand[400] : "transparent"};
67
+ box-shadow: ${({ isSkeleton, selected, theme }) => !isSkeleton ? `inset 4px 0 0 0 ${selected ? theme.colors.brand[400] : "transparent"}` : ""};
68
68
  `;
69
69
  export {
70
70
  StyledLeftNavAreasContainer,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/LeftNavContent/styled.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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 ${(props) => (props.selected ? props.theme.colors.brand[400] : 'transparent')};\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY;AAErB,SAAS,cAAc;AACvB,SAAS,sBAAsB,6BAA6B;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,sCAAsC,OAAO,OAAO;AAAA,EAC/D,MAAM;AAAA,EACN,MAAM,sBAAsB;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,8BAA8B,OAAO,MAAM;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA,WACU,CAAC,UAAW,MAAM,WAAW,QAAQ,MAAM,yBAAyB;AAAA;AAAA;AAIxE,MAAM,0BAA0B,OAAO,OAAO;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA,IACG;AAAA;AAGG,MAAM,kCAAkC,OAAO,MAAM;AAAA,EAC1D,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA;AAAA;AAIM,MAAM,8BAA8B,OAAO,OAAO;AAAA,EACvD,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA;AAAA,IAEG;AAAA;AAGG,MAAM,6BAA6B,OAAO,OAAO;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA;AAAA;AAAA,gCAG+B,CAAC,UAAW,MAAM,WAAW,MAAM,MAAM,OAAO,MAAM,GAAG,IAAI;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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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B,CAAC;AAAA;AAAA,IAEG,CAAC,EAAE,WAAW,MAAO,CAAC,aAAa,sBAAsB;AAAA;AAGtD,MAAM,6BAA6B,OAAO,OAAO;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,sBAAsB;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
  }
@@ -1,7 +1,9 @@
1
1
  import * as React from "react";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { useContext } from "react";
3
+ import { useContext, useCallback } from "react";
4
4
  import { MenuExpand, MenuCollapse } from "@elliemae/ds-icons";
5
+ import { DSSkeleton } from "@elliemae/ds-skeleton";
6
+ import { Grid } from "@elliemae/ds-grid";
5
7
  import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
6
8
  import {
7
9
  StyledFooterMenu,
@@ -16,7 +18,7 @@ import { FOOTER_DS_ID, FOOTER_MENU_CLOSE_DS_ID } from "../../exported-related/co
16
18
  const LeftNavFooterItem = (props) => {
17
19
  const { footerLabel, onFooterExpand = () => null, onFooterClose = () => null } = props;
18
20
  const {
19
- leftNavProps: { labelOverflow },
21
+ leftNavProps: { labelOverflow, isSkeleton },
20
22
  expandedForAnimation,
21
23
  setFocusedItem,
22
24
  visibleItemsRefs
@@ -34,6 +36,16 @@ const LeftNavFooterItem = (props) => {
34
36
  },
35
37
  onClick: handleOnClick
36
38
  });
39
+ const handleMenuCollapseClick = useCallback(
40
+ (e) => {
41
+ e.stopPropagation();
42
+ handleOnClick(e);
43
+ },
44
+ [handleOnClick]
45
+ );
46
+ if (isSkeleton) {
47
+ return /* @__PURE__ */ jsx(StyledFooterMenu, { "data-testid": "leftnav-container", children: /* @__PURE__ */ jsx(Grid, { height: "48px", justifyContent: "center", alignItems: "center", cols: ["1fr"], p: "xxs", children: /* @__PURE__ */ jsx(DSSkeleton, { variant: "rectangular", height: "24px" }) }) }, id);
48
+ }
37
49
  return /* @__PURE__ */ jsx(StyledFooterMenu, { "data-testid": "leftnav-container", children: /* @__PURE__ */ jsx(
38
50
  StyledFooterItem,
39
51
  {
@@ -69,10 +81,7 @@ const LeftNavFooterItem = (props) => {
69
81
  StyledMenuCollapse,
70
82
  {
71
83
  buttonType: "raw",
72
- onClick: (e) => {
73
- e.stopPropagation();
74
- handleOnClick(e);
75
- },
84
+ onClick: handleMenuCollapseClick,
76
85
  "data-testid": "leftnav-footer-btn",
77
86
  tabIndex: 0,
78
87
  onFocus: (e) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/LeftNavFooterItem/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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] as React.RefObject<HTMLDivElement>}\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={(e: React.MouseEvent) => {\n e.stopPropagation();\n handleOnClick(e);\n }}\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"],
5
- "mappings": "AAAA,YAAY,WAAW;ACqEb,SAEA,UAFA,KAEA,YAFA;AApEV,SAAgB,kBAAkB;AAClC,SAAS,YAAY,oBAAoB;AACzC,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,OAAO,2BAA2B;AAClC,SAAS,cAAc,+BAA+B;AAQ/C,MAAM,oBAAiE,CAAC,UAAU;AACvF,QAAM,EAAE,aAAa,iBAAiB,MAAM,MAAM,gBAAgB,MAAM,KAAK,IAAI;AACjF,QAAM;AAAA,IACJ,cAAc,EAAE,cAAc;AAAA,IAC9B;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,qBAAqB;AAEpC,QAAM,KAAK;AAEX,QAAM,gBAAgB,uBAAuB,gBAAgB;AAE7D,QAAM,YAAY,sBAAsB;AAAA,IACtC,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,UAAU;AAAA,QACR,YAAY,CAAC;AAAA,QACb,UAAU;AAAA,QACV,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,SAAS;AAAA,EACX,CAAC;AAED,SACE,oBAAC,oBAA0B,eAAY,qBACrC;AAAA,IAAC;AAAA;AAAA,MACC,KAAK,iBAAiB,QAAQ,EAAE;AAAA,MAChC,UAAU,uBAAuB,KAAK;AAAA,MACtC,UAAU;AAAA,MACV,IAAG;AAAA,MACH,QAAQ,uBAAuB,SAAS;AAAA,MACxC,YAAW;AAAA,MACX,IAAG;AAAA,MACH,MAAM,uBAAuB,CAAC,QAAQ,OAAO,MAAM,IAAI,CAAC,MAAM;AAAA,MAC9D,SAAS,uBAAuB,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,oBAAC,cAAW,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG,eAAY,sBAAqB,IAEvF,iCACE;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,oBAAC,8BAA2B,OAAO,aAAa,WAAU,gBAAe,IAEzE;AAAA;AAAA,QAEJ;AAAA,QACA,oBAAC,yBAAsB,IAAG,QAAO;AAAA,QACjC;AAAA,UAAC;AAAA;AAAA,YACC,YAAW;AAAA,YACX,SAAS,CAAC,MAAwB;AAChC,gBAAE,gBAAgB;AAClB,4BAAc,CAAC;AAAA,YACjB;AAAA,YACA,eAAY;AAAA,YACZ,UAAU;AAAA,YACV,SAAS,CAAC,MAAwB;AAChC,gBAAE,gBAAgB;AAClB,6BAAe,uBAAuB;AAAA,YACxC;AAAA,YACA,MAAK;AAAA,YACL,cAAW;AAAA,YAEX,8BAAC,gBAAa,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,QAC1D;AAAA,SACF;AAAA;AAAA,EAEJ,KA3DqB,EA4DvB;AAEJ;AAEA,IAAO,4BAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC8Db,SA+BA,UA/BA,KA+BA,YA/BA;AA7DV,SAAgB,YAAY,mBAAmB;AAC/C,SAAS,YAAY,oBAAoB;AACzC,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AAErB,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,OAAO,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AAe,EAAE;AAAA,MAChC,eAAY;AAAA,MACZ,MAAK;AAAA,MACL,cACE,uBACI,WAAW,OAAO,gBAAgB,WAAW,cAAc,OAC3D;AAAA,MAGL,WAAC,uBACA,oBAAC,cAAW,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG,eAAY,sBAAqB,IAEvF,iCACE;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,oBAAC,8BAA2B,OAAO,aAAa,WAAU,gBAAe,IAEzE;AAAA;AAAA,QAEJ;AAAA,QACA,oBAAC,yBAAsB,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,uBAAuB;AAAA,YACxC;AAAA,YACA,MAAK;AAAA,YACL,cAAW;AAAA,YAEX,8BAAC,gBAAa,MAAK,KAAI,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,QAC1D;AAAA,SACF;AAAA;AAAA,EAEJ,KAxDqB,EAyDvB;AAEJ;AAEA,IAAO,4BAAQ;",
6
6
  "names": []
7
7
  }
@@ -13,7 +13,7 @@ const StyledFooterMenu = styled(Grid, { name: DSLeftNavigationName, slot: DSLeft
13
13
  `;
14
14
  const StyledFooterItem = styled(Grid, { name: DSLeftNavigationName, slot: DSLeftNavigationSlots.FOOTER_ITEM })`
15
15
  position: relative;
16
- ${getLeftBorderStyle}
16
+ ${(props) => getLeftBorderStyle({ ...props })}
17
17
 
18
18
  min-height: 48px;
19
19
  cursor: ${(props) => props.expanded ? "auto" : "pointer"};
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/LeftNavFooterItem/styled.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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: boolean;\n opened: boolean;\n selected: boolean;\n}>`\n position: relative;\n ${getLeftBorderStyle}\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: string }>`\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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A,EACnD,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA;AAAA;AAAA;AAAA,yBAIwB,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,YAAY;AACrB,SAAS,oBAAoB,8BAA8B;AAC3D,SAAS,sBAAsB,6BAA6B;AAGrD,MAAM,mBAAmB,OAAO,MAAM,EAAE,MAAM,sBAAsB,MAAM,sBAAsB,YAAY,CAAC;AAAA;AAAA;AAAA,gBAGpG,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA,0BAEjC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAG5D,MAAM,mBAAmB,OAAO,MAAM,EAAE,MAAM,sBAAsB,MAAM,sBAAsB,YAAY,CAAC;AAAA;AAAA,IAOhH,CAAC,UAAU,mBAAmB,EAAE,GAAG,MAAM,CAAC;AAAA;AAAA;AAAA,YAGlC,CAAC,UAAW,MAAM,WAAW,SAAS;AAAA;AAAA,IAE9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAYsB,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAM1D,MAAM,oBAAoB,OAAO,MAAM;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA;AAAA,WAEU,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA,gBAEpC,CAAC,UAAW,MAAM,kBAAkB,YAAY,cAAc;AAAA;AAGvE,MAAM,wBAAwB,OAAO,MAAM;AAAA,EAChD,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA;AAAA;AAAA,sBAGqB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG;AAAA;AAGxD,MAAM,qBAAqB,OAAO,YAAY;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA;AAAA;AAAA;AAAA,yBAIwB,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -9,9 +9,15 @@ const OutOfTheBoxMapItem = (props) => {
9
9
  item: { type, Component }
10
10
  } = props;
11
11
  const ctx = React2.useContext(LeftNavContext);
12
+ const finalItem = {
13
+ ...item,
14
+ itemOpts: {
15
+ ...item.itemOpts
16
+ }
17
+ };
12
18
  if (typeof type === "string" && !!outOfTheBoxComponents[type]) {
13
19
  const OutOfTheBoxComponent = outOfTheBoxComponents[type];
14
- return /* @__PURE__ */ jsx(OutOfTheBoxComponent, { item: { itemOpts: {}, ...item }, ctx });
20
+ return /* @__PURE__ */ jsx(OutOfTheBoxComponent, { item: finalItem, ctx });
15
21
  }
16
22
  if (!Component)
17
23
  return null;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/OutOfTheBoxMapItem.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { outOfTheBoxComponents } from '../outOfTheBox/index.js';\nimport type { OutOfTheBoxMapItemT } from '../index.d';\nimport { LeftNavContext } from '../LeftNavigationContext.js';\n\nexport const OutOfTheBoxMapItem: React.ComponentType<OutOfTheBoxMapItemT> = (props) => {\n const {\n item,\n item: { type, Component },\n } = props;\n const ctx = React.useContext(LeftNavContext);\n\n if (typeof type === 'string' && !!outOfTheBoxComponents[type]) {\n const OutOfTheBoxComponent = outOfTheBoxComponents[type];\n return <OutOfTheBoxComponent item={{ itemOpts: {}, ...item }} 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"],
5
- "mappings": "AAAA,YAAY,WAAW;ACcZ;AAdX,OAAOA,YAAW;AAClB,SAAS,6BAA6B;AAEtC,SAAS,sBAAsB;AAExB,MAAM,qBAA+D,CAAC,UAAU;AACrF,QAAM;AAAA,IACJ;AAAA,IACA,MAAM,EAAE,MAAM,UAAU;AAAA,EAC1B,IAAI;AACJ,QAAM,MAAMA,OAAM,WAAW,cAAc;AAE3C,MAAI,OAAO,SAAS,YAAY,CAAC,CAAC,sBAAsB,IAAI,GAAG;AAC7D,UAAM,uBAAuB,sBAAsB,IAAI;AACvD,WAAO,oBAAC,wBAAqB,MAAM,EAAE,UAAU,CAAC,GAAG,GAAG,KAAK,GAAG,KAAU;AAAA,EAC1E;AACA,MAAI,CAAC;AAAW,WAAO;AAEvB,SAAO,oBAAC,aAAU,MAAY,KAAU;AAC1C;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACoBZ;AApBX,OAAOA,YAAW;AAClB,SAAS,6BAA6B;AAEtC,SAAS,sBAAsB;AAExB,MAAM,qBAAiF,CAAC,UAAU;AACvG,QAAM;AAAA,IACJ;AAAA,IACA,MAAM,EAAE,MAAM,UAAU;AAAA,EAC1B,IAAI;AACJ,QAAM,MAAMA,OAAM,WAAW,cAAc;AAE3C,QAAM,YAAY;AAAA,IAChB,GAAG;AAAA,IACH,UAAU;AAAA,MACR,GAAG,KAAK;AAAA,IACV;AAAA,EACF;AACA,MAAI,OAAO,SAAS,YAAY,CAAC,CAAC,sBAAsB,IAAI,GAAG;AAC7D,UAAM,uBAAuB,sBAAsB,IAAI;AACvD,WAAO,oBAAC,wBAAqB,MAAM,WAAW,KAAU;AAAA,EAC1D;AACA,MAAI,CAAC;AAAW,WAAO;AAEvB,SAAO,oBAAC,aAAU,MAAY,KAAU;AAC1C;",
6
6
  "names": ["React"]
7
7
  }
@@ -15,13 +15,16 @@ const leftNavigationProps = {
15
15
  expanded: PropTypes.bool.description("Whether to show the left navigation expanded or collapsed").defaultValue(false),
16
16
  loading: PropTypes.bool.description("Whether the left-nav is loading").defaultValue(false),
17
17
  openedItem: PropTypes.string.description("The id of the left navigation item you want to be opened").defaultValue(null),
18
- footerLabel: PropTypes.string.description("The label to show in the footer item"),
18
+ footerLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.string]).description(
19
+ "The label to show in the footer item"
20
+ ),
19
21
  onFooterExpand: PropTypes.func.description("The function to call when the left-nav is opened via the footer"),
20
22
  onFooterClose: PropTypes.func.description("The function to call when the left-nav is closed via the footer"),
21
23
  onSelectedChange: PropTypes.func.description("A callback which triggers when the selected item changes").defaultValue(() => null),
22
24
  onFocusChange: PropTypes.func.description("A callback which triggers when the focused item changes").defaultValue(() => null),
23
25
  items: PropTypes.arrayOf(PropTypes.object).description("The array of items you want to render inside the left nav").defaultValue([]),
24
- disableDefaultSelection: PropTypes.bool.description("Whether you do not want to automatically select the first body item").defaultValue(false)
26
+ disableDefaultSelection: PropTypes.bool.description("Whether you do not want to automatically select the first body item").defaultValue(false),
27
+ isSkeleton: PropTypes.bool.description("Whether the component is in skeleton mode").defaultValue(false)
25
28
  };
26
29
  const LeftNavItemProps = () => null;
27
30
  LeftNavItemProps.displayName = "LeftNavItemProps";
@@ -37,4 +40,4 @@ export {
37
40
  leftNavItemProps,
38
41
  leftNavigationProps
39
42
  };
40
- //# sourceMappingURL=prop-types.js.map
43
+ //# 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 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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW,gBAAgB;AAIpC,SAAS,wBAAwB;AA2G1B,MAAM,mBAAmB;AAAA,EAC9B,MAAM,UAAU,MAAM,gBAAgB,EAAE,YAAY,sBAAsB;AAAA,EAC1E,MAAM,UAAU,OAAO,YAAY,yCAAyC;AAAA,EAC5E,WAAW,UAAU,KAAK;AAAA,IACxB;AAAA,EACF;AAAA,EACA,oBAAoB,UAAU,KAAK,YAAY,8DAA8D;AAAA,EAC7G,UAAU,UAAU,OAAO,YAAY,cAAc;AACvD;AAEO,MAAM,sBAAsB;AAAA,EACjC,gBAAgB,UAAU,MAAM,EAAE,eAAe,UAAU,OAAO,CAAC,EAChE,YAAY,kDAAkD,EAC9D,aAAa,EAAE,eAAe,QAAQ,CAAC;AAAA,EAC1C,UAAU,UAAU,KAAK,YAAY,2DAA2D,EAAE,aAAa,KAAK;AAAA,EACpH,SAAS,UAAU,KAAK,YAAY,iCAAiC,EAAE,aAAa,KAAK;AAAA,EACzF,YAAY,UAAU,OACnB,YAAY,0DAA0D,EACtE,aAAa,IAAI;AAAA,EACpB,aAAa,UAAU,UAAU,CAAC,UAAU,MAAM,UAAU,MAAM,CAAC,EAAE;AAAA,IACnE;AAAA,EACF;AAAA,EACA,gBAAgB,UAAU,KAAK,YAAY,iEAAiE;AAAA,EAC5G,eAAe,UAAU,KAAK,YAAY,iEAAiE;AAAA,EAC3G,kBAAkB,UAAU,KACzB,YAAY,0DAA0D,EACtE,aAAa,MAAM,IAAI;AAAA,EAC1B,eAAe,UAAU,KACtB,YAAY,yDAAyD,EACrE,aAAa,MAAM,IAAI;AAAA,EAC1B,OAAO,UAAU,QAAQ,UAAU,MAAM,EACtC,YAAY,2DAA2D,EACvE,aAAa,CAAC,CAAC;AAAA,EAClB,yBAAyB,UAAU,KAChC,YAAY,qEAAqE,EACjF,aAAa,KAAK;AAAA,EACrB,YAAY,UAAU,KAAK,YAAY,2CAA2C,EAAE,aAAa,KAAK;AACxG;AAEA,MAAM,mBAAmB,MAAM;AAC/B,iBAAiB,cAAc;AACxB,MAAM,yBAAyB,SAAS,gBAAgB;AAC/D,uBAAuB,YAAY;AAEnC,MAAM,qBAAqB,MAAM;AACjC,mBAAmB,cAAc;AAC1B,MAAM,2BAA2B,SAAS,kBAAkB;AACnE,yBAAyB,YAAY;",
6
+ "names": []
7
+ }
@@ -0,0 +1,163 @@
1
+ import * as React from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { createRef } from "react";
4
+ import { LeftNavigation } from "../index.js";
5
+ import { ITEM_TYPES } from "../exported-related/constants.js";
6
+ const ref = createRef();
7
+ const testOptionalProps = {
8
+ selectedItem: "selected item",
9
+ selectedParent: "parent",
10
+ disableDefaultSelection: true,
11
+ withoutBodyShadow: true,
12
+ actionRef: ref,
13
+ HeaderComponent: {
14
+ type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
15
+ dsId: "application-header-id",
16
+ CollapsedComponent: () => /* @__PURE__ */ jsx("div", {}),
17
+ itemOpts: {
18
+ label: "Notifications"
19
+ }
20
+ },
21
+ BodyHeaderComponent: {
22
+ type: ITEM_TYPES.LEFT_NAV_ITEM_SUBMENU,
23
+ dsId: "application-submenu-forms-id",
24
+ CollapsedComponent: () => /* @__PURE__ */ jsx("div", {}),
25
+ itemOpts: {
26
+ label: "Forms"
27
+ }
28
+ }
29
+ };
30
+ const testPartialDefaults = {};
31
+ const testProps = {
32
+ ...testOptionalProps,
33
+ ...testPartialDefaults
34
+ };
35
+ const testPropsAsSyntax = {
36
+ ...testOptionalProps,
37
+ ...testPartialDefaults
38
+ };
39
+ const testCompleteDefaults = {
40
+ expanded: true,
41
+ expandedWidth: "100px",
42
+ openedItem: "opened item",
43
+ items: [
44
+ {
45
+ type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
46
+ dsId: "application-header-id",
47
+ CollapsedComponent: () => /* @__PURE__ */ jsx("div", {}),
48
+ itemOpts: {
49
+ label: "Notifications"
50
+ }
51
+ }
52
+ ],
53
+ footerLabel: "",
54
+ onSelectedChange: () => null,
55
+ onFocusChange: () => null,
56
+ onFooterExpand: () => null,
57
+ onFooterClose: () => null,
58
+ labelOverflow: "wrap",
59
+ onItemClick: () => null,
60
+ isSkeleton: false,
61
+ loading: false
62
+ };
63
+ const testInternalProps = {
64
+ ...testOptionalProps,
65
+ ...testCompleteDefaults
66
+ };
67
+ const testInternalPropsAsSyntax = {
68
+ ...testOptionalProps,
69
+ ...testCompleteDefaults
70
+ };
71
+ const testExplicitDefinition = {
72
+ expanded: true,
73
+ expandedWidth: "100px",
74
+ openedItem: "opened item",
75
+ items: [
76
+ {
77
+ type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
78
+ dsId: "application-header-id",
79
+ CollapsedComponent: () => /* @__PURE__ */ jsx("div", {}),
80
+ itemOpts: {
81
+ label: "Notifications"
82
+ }
83
+ }
84
+ ],
85
+ footerLabel: "",
86
+ onSelectedChange: () => null,
87
+ onFocusChange: () => null,
88
+ onFooterExpand: () => null,
89
+ onFooterClose: () => null,
90
+ labelOverflow: "wrap",
91
+ onItemClick: () => null,
92
+ isSkeleton: false,
93
+ loading: false
94
+ };
95
+ const testInferedTypeCompatibility = {
96
+ expanded: true,
97
+ expandedWidth: "100px",
98
+ openedItem: "opened item",
99
+ items: [
100
+ {
101
+ type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
102
+ dsId: "application-header-id",
103
+ CollapsedComponent: () => /* @__PURE__ */ jsx("div", {}),
104
+ itemOpts: {
105
+ label: "Notifications"
106
+ }
107
+ }
108
+ ],
109
+ footerLabel: "",
110
+ onSelectedChange: () => null,
111
+ onFocusChange: () => null,
112
+ onFooterExpand: () => null,
113
+ onFooterClose: () => null,
114
+ labelOverflow: "wrap",
115
+ onItemClick: () => null,
116
+ isSkeleton: false,
117
+ loading: false
118
+ };
119
+ const testDefinitionAsConst = {
120
+ expanded: true,
121
+ expandedWidth: "100px",
122
+ openedItem: "opened item",
123
+ footerLabel: "",
124
+ onSelectedChange: () => null,
125
+ onFocusChange: () => null,
126
+ onFooterExpand: () => null,
127
+ onFooterClose: () => null,
128
+ labelOverflow: "wrap",
129
+ onItemClick: () => null,
130
+ isSkeleton: false,
131
+ loading: false
132
+ };
133
+ const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
134
+ /* @__PURE__ */ jsx(LeftNavigation, { ...testExplicitDefinition }),
135
+ /* @__PURE__ */ jsx(LeftNavigation, { ...testInferedTypeCompatibility }),
136
+ /* @__PURE__ */ jsx(LeftNavigation, { ...testDefinitionAsConst }),
137
+ /* @__PURE__ */ jsx(
138
+ LeftNavigation,
139
+ {
140
+ expanded: true,
141
+ expandedWidth: "100px",
142
+ openedItem: "opened item",
143
+ items: [
144
+ {
145
+ type: ITEM_TYPES.LEFT_NAV_ITEM_HEADER,
146
+ dsId: "application-header-id",
147
+ CollapsedComponent: () => /* @__PURE__ */ jsx("div", {}),
148
+ itemOpts: {
149
+ label: "Notifications"
150
+ }
151
+ }
152
+ ],
153
+ footerLabel: "",
154
+ onSelectedChange: () => null,
155
+ onFocusChange: () => null,
156
+ onFooterExpand: () => null,
157
+ onFooterClose: () => null,
158
+ labelOverflow: "wrap",
159
+ onItemClick: () => null
160
+ }
161
+ )
162
+ ] });
163
+ //# 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,YAAY,WAAW;ACsBO,SAgI5B,UAhI4B,KAgI5B,YAhI4B;AArB9B,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAE/B,SAAS,kBAAkB;AAO3B,MAAM,MAAM,UAAmF;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,WAAW;AAAA,IACjB,MAAM;AAAA,IACN,oBAAoB,MAAM,oBAAC,SAAI;AAAA,IAC/B,UAAU;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,qBAAqB;AAAA,IACnB,MAAM,WAAW;AAAA,IACjB,MAAM;AAAA,IACN,oBAAoB,MAAM,oBAAC,SAAI;AAAA,IAC/B,UAAU;AAAA,MACR,OAAO;AAAA,IACT;AAAA,EACF;AACF;AAIA,MAAM,sBAA2D,CAAC;AAClE,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,uBAA6D;AAAA,EACjE,UAAU;AAAA,EACV,eAAe;AAAA,EACf,YA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AM;AAAA,EACxB,eAAe,MAAM;AAAA,EACrB,gBAAgB,MAAM;AAAA,EACtB,eAAe,MAAM;AAAA,EACrB,eAAe;AAAA,EACf,aAAa,MAAM;AAAA,EACnB,YAAY;AAAA,EACZ,SAAS;AACX;AAEA,MAAM,wBAAwB;AAAA,EAC5B,UAAU;AAAA,EACV,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,kBAAkB,MAAM;AAAA,EACxB,eAAe,MAAM;AAAA,EACrB,gBAAgB,MAAM;AAAA,EACtB,eAAe,MAAM;AAAA,EACrB,eAAe;AAAA,EACf,aAAa,MAAM;AAAA,EACnB,YAAY;AAAA,EACZ,SAAS;AACX;AAEA,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,kBAAgB,GAAG,wBAAwB;AAAA,EAC5C,oBAAC,kBAAgB,GAAG,8BAA8B;AAAA,EAClD,oBAAC,kBAAgB,GAAG,uBAAuB;AAAA,EAE3C;AAAA,IAAC;AAAA;AAAA,MACC,UAAQ;AAAA,MACR,eAAc;AAAA,MACd,YAAW;AAAA,MACX,OAAO;AAAA,QACL;AAAA,UACE,MAAM,WAAW;AAAA,UACjB,MAAM;AAAA,UACN,oBAAoB,MAAM,oBAAC,SAAI;AAAA,UAC/B,UAAU;AAAA,YACR,OAAO;AAAA,UACT;AAAA,QACF;AAAA,MACF;AAAA,MACA,aAAY;AAAA,MACZ,kBAAkB,MAAM;AAAA,MACxB,eAAe,MAAM;AAAA,MACrB,gBAAgB,MAAM;AAAA,MACtB,eAAe,MAAM;AAAA,MACrB,eAAc;AAAA,MACd,aAAa,MAAM;AAAA;AAAA,EACrB;AAAA,GACF;",
6
+ "names": []
7
+ }
@@ -1,20 +1,9 @@
1
- import type { LeftNavProps } from './index.d';
1
+ import React from 'react';
2
+ import type { DSLeftNavigationT } from './react-desc-prop-types.js';
2
3
  export declare const LeftNavigation: {
3
- (props: LeftNavProps): JSX.Element;
4
- propTypes: {
5
- containerProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
6
- expanded: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
7
- loading: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
8
- openedItem: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
9
- footerLabel: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
10
- onFooterExpand: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
11
- onFooterClose: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
12
- onSelectedChange: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
13
- onFocusChange: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
14
- items: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
15
- disableDefaultSelection: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
16
- };
17
- defaultProps: LeftNavProps;
4
+ (props: DSLeftNavigationT.Props): JSX.Element;
5
+ propTypes: React.WeakValidationMap<DSLeftNavigationT.Props>;
6
+ defaultProps: DSLeftNavigationT.DefaultProps;
18
7
  displayName: string;
19
8
  };
20
- export declare const LeftNavigationWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<LeftNavProps>;
9
+ export declare const LeftNavigationWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSLeftNavigationT.Props>;
@@ -1,6 +1,6 @@
1
1
  import type { MutableRefObject, RefObject } from 'react';
2
2
  import type React from 'react';
3
- import type { LeftNavProps } from './index.d';
3
+ import type { DSLeftNavigationT } from './react-desc-prop-types.js';
4
4
  export type ContextProps = {
5
5
  selectedItem: string | null;
6
6
  setSelectedItem: React.Dispatch<React.SetStateAction<string | null>>;
@@ -11,11 +11,11 @@ export type ContextProps = {
11
11
  openedDrilldowns: string[];
12
12
  setOpenedDrilldowns: React.Dispatch<React.SetStateAction<string[]>>;
13
13
  visibleItems: string[];
14
- visibleItemsRefs: MutableRefObject<Record<string, RefObject<HTMLElement>>>;
15
- leftNavProps: LeftNavProps;
14
+ visibleItemsRefs: MutableRefObject<Record<string, RefObject<HTMLDivElement>>>;
15
+ leftNavProps: DSLeftNavigationT.InternalProps;
16
16
  expandedForAnimation: boolean;
17
17
  };
18
- export declare const defaultProps: LeftNavProps;
18
+ export declare const defaultProps: DSLeftNavigationT.DefaultProps;
19
19
  export declare const defaultContext: ContextProps;
20
20
  export declare const LeftNavContext: React.Context<ContextProps>;
21
21
  export default LeftNavContext;
@@ -1,6 +1,6 @@
1
1
  import type { Theme } from '@elliemae/ds-system';
2
2
  export declare const getItemBackgroundStyle: (props: {
3
3
  theme: Theme;
4
- selected: boolean;
5
- opened: boolean;
4
+ selected?: boolean;
5
+ opened?: boolean;
6
6
  }) => string;
@@ -1,6 +1,6 @@
1
1
  import type { Theme } from '@elliemae/ds-system';
2
2
  export declare const getLeftBorderStyle: (props: {
3
3
  theme: Theme;
4
- selected: boolean;
5
- selectedParent: boolean;
4
+ selected?: boolean;
5
+ selectedParent?: boolean;
6
6
  }) => string;
@@ -1,4 +1,17 @@
1
- import type { LeftNavProps } from '../index.d';
2
- import type { ContextProps } from '../LeftNavigationContext.js';
3
- export declare const useLeftNavConfig: (props: LeftNavProps) => ContextProps;
1
+ import React from 'react';
2
+ import type { DSLeftNavigationT } from '../react-desc-prop-types.js';
3
+ export declare const useLeftNavConfig: (props: DSLeftNavigationT.Props) => {
4
+ leftNavProps: DSLeftNavigationT.InternalProps;
5
+ expandedForAnimation: boolean;
6
+ selectedItem: string | null;
7
+ setSelectedItem: React.Dispatch<React.SetStateAction<string | null>>;
8
+ selectedParent: string | null;
9
+ setSelectedParent: React.Dispatch<React.SetStateAction<string | null>>;
10
+ focusedItem: string | null;
11
+ setFocusedItem: React.Dispatch<React.SetStateAction<string | null>>;
12
+ openedDrilldowns: string[];
13
+ setOpenedDrilldowns: React.Dispatch<React.SetStateAction<string[]>>;
14
+ visibleItems: string[];
15
+ visibleItemsRefs: React.MutableRefObject<Record<string, React.RefObject<HTMLDivElement>>>;
16
+ };
4
17
  export default useLeftNavConfig;
@@ -1,12 +1,12 @@
1
1
  import type { MutableRefObject, RefObject } from 'react';
2
- import type { GenericItemItemProps } from '../index.d';
2
+ import type { DSLeftNavigationT } from '../react-desc-prop-types.js';
3
3
  export declare const useLeftNavItems: (props: {
4
- headerItem: GenericItemItemProps;
5
- bodyHeaderItem: GenericItemItemProps;
6
- items: GenericItemItemProps[];
4
+ headerItem?: DSLeftNavigationT.GenericItemItemProps;
5
+ bodyHeaderItem?: DSLeftNavigationT.GenericItemItemProps;
6
+ items?: DSLeftNavigationT.GenericItemItemProps[];
7
7
  openedDrilldowns: string[];
8
8
  }) => {
9
9
  visibleItems: string[];
10
- visibleItemsRefs: MutableRefObject<Record<string, RefObject<HTMLElement>>>;
10
+ visibleItemsRefs: MutableRefObject<Record<string, RefObject<HTMLDivElement>>>;
11
11
  };
12
12
  export default useLeftNavItems;
@@ -1,10 +1,10 @@
1
1
  /// <reference types="node" />
2
2
  import React from 'react';
3
- import type { LeftNavProps } from '../index.d';
3
+ import type { DSLeftNavigationT } from '../react-desc-prop-types.js';
4
4
  interface SmoothExpandOptsT {
5
5
  expandedForAnimation: boolean;
6
6
  timeoutRef: React.MutableRefObject<NodeJS.Timeout | null>;
7
7
  setExpandedForAnimation: React.Dispatch<React.SetStateAction<boolean>>;
8
8
  }
9
- export declare const useLeftNavSmoothExpand: (props: LeftNavProps, smoothExpandOpts: SmoothExpandOptsT) => void;
9
+ export declare const useLeftNavSmoothExpand: (props: DSLeftNavigationT.Props, smoothExpandOpts: SmoothExpandOptsT) => void;
10
10
  export default useLeftNavSmoothExpand;
@@ -1,2 +1,4 @@
1
- export declare const ChevronItem: (props: unknown) => JSX.Element;
1
+ /// <reference types="react" />
2
+ import { type SvgIconT } from '@elliemae/ds-icons';
3
+ export declare const ChevronItem: (props?: SvgIconT.Props) => JSX.Element;
2
4
  export default ChevronItem;