@elliemae/ds-left-navigation 3.11.0-next.2 → 3.11.0-next.3

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 (139) hide show
  1. package/dist/cjs/LeftNavigationContext.js +2 -1
  2. package/dist/cjs/LeftNavigationContext.js.map +2 -2
  3. package/dist/cjs/common/getItemBackgroundStyle.js.map +2 -2
  4. package/dist/cjs/common/getLeftBorderStyle.js +1 -5
  5. package/dist/cjs/common/getLeftBorderStyle.js.map +2 -2
  6. package/dist/cjs/constants/constants.js +65 -0
  7. package/dist/cjs/constants/constants.js.map +7 -0
  8. package/dist/cjs/{outOfTheBox/ItemLink/styled.js → constants/index.js} +5 -17
  9. package/dist/cjs/constants/index.js.map +7 -0
  10. package/dist/cjs/exported-related/ItemRenderer/index.js +36 -44
  11. package/dist/cjs/exported-related/ItemRenderer/index.js.map +3 -3
  12. package/dist/cjs/exported-related/ItemRenderer/styled.js +24 -9
  13. package/dist/cjs/exported-related/ItemRenderer/styled.js.map +2 -2
  14. package/dist/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js +1 -1
  15. package/dist/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js.map +2 -2
  16. package/dist/cjs/exported-related/Notifications/index.js +9 -5
  17. package/dist/cjs/exported-related/Notifications/index.js.map +2 -2
  18. package/dist/cjs/index.d.js.map +1 -1
  19. package/dist/cjs/index.js +7 -4
  20. package/dist/cjs/index.js.map +3 -3
  21. package/dist/cjs/outOfTheBox/ItemControlledDrilldown/index.js +11 -12
  22. package/dist/cjs/outOfTheBox/ItemControlledDrilldown/index.js.map +3 -3
  23. package/dist/cjs/outOfTheBox/ItemHeader/index.js +8 -10
  24. package/dist/cjs/outOfTheBox/ItemHeader/index.js.map +3 -3
  25. package/dist/cjs/outOfTheBox/ItemLink/index.js +8 -10
  26. package/dist/cjs/outOfTheBox/ItemLink/index.js.map +3 -3
  27. package/dist/cjs/outOfTheBox/ItemSection/index.js +4 -5
  28. package/dist/cjs/outOfTheBox/ItemSection/index.js.map +3 -3
  29. package/dist/cjs/outOfTheBox/ItemSeparator/index.js +2 -1
  30. package/dist/cjs/outOfTheBox/ItemSeparator/index.js.map +2 -2
  31. package/dist/cjs/outOfTheBox/ItemSubmenu/index.js +8 -9
  32. package/dist/cjs/outOfTheBox/ItemSubmenu/index.js.map +3 -3
  33. package/dist/cjs/outOfTheBox/ItemTextLabel/index.js +1 -1
  34. package/dist/cjs/outOfTheBox/ItemTextLabel/index.js.map +1 -1
  35. package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js +12 -12
  36. package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +3 -3
  37. package/dist/cjs/outOfTheBox/ItemWithDate/index.js +7 -10
  38. package/dist/cjs/outOfTheBox/ItemWithDate/index.js.map +3 -3
  39. package/dist/cjs/outOfTheBox/styled.js +122 -0
  40. package/dist/cjs/outOfTheBox/styled.js.map +7 -0
  41. package/dist/cjs/parts/LeftNavContent/index.js +14 -7
  42. package/dist/cjs/parts/LeftNavContent/index.js.map +2 -2
  43. package/dist/cjs/parts/LeftNavContent/styled.js +32 -43
  44. package/dist/cjs/parts/LeftNavContent/styled.js.map +2 -2
  45. package/dist/cjs/parts/LeftNavFooterItem/index.js +54 -67
  46. package/dist/cjs/parts/LeftNavFooterItem/index.js.map +3 -3
  47. package/dist/cjs/parts/LeftNavFooterItem/styled.js +22 -15
  48. package/dist/cjs/parts/LeftNavFooterItem/styled.js.map +2 -2
  49. package/dist/cjs/parts/LeftNavLoading/index.js +2 -1
  50. package/dist/cjs/parts/LeftNavLoading/index.js.map +2 -2
  51. package/dist/cjs/parts/OutOfTheBoxMapItem.js +2 -0
  52. package/dist/cjs/parts/OutOfTheBoxMapItem.js.map +2 -2
  53. package/dist/cjs/prop-types.js +0 -1
  54. package/dist/cjs/prop-types.js.map +2 -2
  55. package/dist/esm/LeftNavigationContext.js +2 -1
  56. package/dist/esm/LeftNavigationContext.js.map +2 -2
  57. package/dist/esm/common/getItemBackgroundStyle.js.map +2 -2
  58. package/dist/esm/common/getLeftBorderStyle.js +1 -5
  59. package/dist/esm/common/getLeftBorderStyle.js.map +2 -2
  60. package/dist/esm/constants/constants.js +39 -0
  61. package/dist/esm/constants/constants.js.map +7 -0
  62. package/dist/esm/constants/index.js +3 -0
  63. package/dist/esm/constants/index.js.map +7 -0
  64. package/dist/esm/exported-related/ItemRenderer/index.js +37 -45
  65. package/dist/esm/exported-related/ItemRenderer/index.js.map +2 -2
  66. package/dist/esm/exported-related/ItemRenderer/styled.js +24 -9
  67. package/dist/esm/exported-related/ItemRenderer/styled.js.map +2 -2
  68. package/dist/esm/exported-related/ItemRenderer/usePropsWithDefaults.js +1 -1
  69. package/dist/esm/exported-related/ItemRenderer/usePropsWithDefaults.js.map +2 -2
  70. package/dist/esm/exported-related/Notifications/index.js +9 -5
  71. package/dist/esm/exported-related/Notifications/index.js.map +2 -2
  72. package/dist/esm/index.js +6 -3
  73. package/dist/esm/index.js.map +2 -2
  74. package/dist/esm/outOfTheBox/ItemControlledDrilldown/index.js +11 -12
  75. package/dist/esm/outOfTheBox/ItemControlledDrilldown/index.js.map +2 -2
  76. package/dist/esm/outOfTheBox/ItemHeader/index.js +14 -10
  77. package/dist/esm/outOfTheBox/ItemHeader/index.js.map +3 -3
  78. package/dist/esm/outOfTheBox/ItemLink/index.js +8 -10
  79. package/dist/esm/outOfTheBox/ItemLink/index.js.map +2 -2
  80. package/dist/esm/outOfTheBox/ItemSection/index.js +10 -5
  81. package/dist/esm/outOfTheBox/ItemSection/index.js.map +2 -2
  82. package/dist/esm/outOfTheBox/ItemSeparator/index.js +2 -1
  83. package/dist/esm/outOfTheBox/ItemSeparator/index.js.map +2 -2
  84. package/dist/esm/outOfTheBox/ItemSubmenu/index.js +14 -9
  85. package/dist/esm/outOfTheBox/ItemSubmenu/index.js.map +3 -3
  86. package/dist/esm/outOfTheBox/ItemTextLabel/index.js +1 -1
  87. package/dist/esm/outOfTheBox/ItemTextLabel/index.js.map +1 -1
  88. package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js +12 -12
  89. package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +2 -2
  90. package/dist/esm/outOfTheBox/ItemWithDate/index.js +7 -10
  91. package/dist/esm/outOfTheBox/ItemWithDate/index.js.map +2 -2
  92. package/dist/esm/outOfTheBox/styled.js +96 -0
  93. package/dist/esm/outOfTheBox/styled.js.map +7 -0
  94. package/dist/esm/parts/LeftNavContent/index.js +14 -8
  95. package/dist/esm/parts/LeftNavContent/index.js.map +2 -2
  96. package/dist/esm/parts/LeftNavContent/styled.js +33 -48
  97. package/dist/esm/parts/LeftNavContent/styled.js.map +2 -2
  98. package/dist/esm/parts/LeftNavFooterItem/index.js +57 -71
  99. package/dist/esm/parts/LeftNavFooterItem/index.js.map +2 -2
  100. package/dist/esm/parts/LeftNavFooterItem/styled.js +22 -15
  101. package/dist/esm/parts/LeftNavFooterItem/styled.js.map +2 -2
  102. package/dist/esm/parts/LeftNavLoading/index.js +2 -1
  103. package/dist/esm/parts/LeftNavLoading/index.js.map +2 -2
  104. package/dist/esm/parts/OutOfTheBoxMapItem.js +2 -0
  105. package/dist/esm/parts/OutOfTheBoxMapItem.js.map +2 -2
  106. package/dist/esm/prop-types.js +0 -1
  107. package/dist/esm/prop-types.js.map +2 -2
  108. package/package.json +8 -8
  109. package/dist/cjs/outOfTheBox/ItemControlledDrilldown/styled.js +0 -46
  110. package/dist/cjs/outOfTheBox/ItemControlledDrilldown/styled.js.map +0 -7
  111. package/dist/cjs/outOfTheBox/ItemHeader/styled.js +0 -46
  112. package/dist/cjs/outOfTheBox/ItemHeader/styled.js.map +0 -7
  113. package/dist/cjs/outOfTheBox/ItemLink/styled.js.map +0 -7
  114. package/dist/cjs/outOfTheBox/ItemSection/styled.js +0 -50
  115. package/dist/cjs/outOfTheBox/ItemSection/styled.js.map +0 -7
  116. package/dist/cjs/outOfTheBox/ItemSubmenu/styled.js +0 -46
  117. package/dist/cjs/outOfTheBox/ItemSubmenu/styled.js.map +0 -7
  118. package/dist/cjs/outOfTheBox/ItemTextLabel/styled.js +0 -40
  119. package/dist/cjs/outOfTheBox/ItemTextLabel/styled.js.map +0 -7
  120. package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/styled.js +0 -46
  121. package/dist/cjs/outOfTheBox/ItemUncontrolledDrilldown/styled.js.map +0 -7
  122. package/dist/cjs/outOfTheBox/ItemWithDate/styled.js +0 -46
  123. package/dist/cjs/outOfTheBox/ItemWithDate/styled.js.map +0 -7
  124. package/dist/esm/outOfTheBox/ItemControlledDrilldown/styled.js +0 -20
  125. package/dist/esm/outOfTheBox/ItemControlledDrilldown/styled.js.map +0 -7
  126. package/dist/esm/outOfTheBox/ItemHeader/styled.js +0 -20
  127. package/dist/esm/outOfTheBox/ItemHeader/styled.js.map +0 -7
  128. package/dist/esm/outOfTheBox/ItemLink/styled.js +0 -12
  129. package/dist/esm/outOfTheBox/ItemLink/styled.js.map +0 -7
  130. package/dist/esm/outOfTheBox/ItemSection/styled.js +0 -24
  131. package/dist/esm/outOfTheBox/ItemSection/styled.js.map +0 -7
  132. package/dist/esm/outOfTheBox/ItemSubmenu/styled.js +0 -20
  133. package/dist/esm/outOfTheBox/ItemSubmenu/styled.js.map +0 -7
  134. package/dist/esm/outOfTheBox/ItemTextLabel/styled.js +0 -14
  135. package/dist/esm/outOfTheBox/ItemTextLabel/styled.js.map +0 -7
  136. package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/styled.js +0 -20
  137. package/dist/esm/outOfTheBox/ItemUncontrolledDrilldown/styled.js.map +0 -7
  138. package/dist/esm/outOfTheBox/ItemWithDate/styled.js +0 -20
  139. package/dist/esm/outOfTheBox/ItemWithDate/styled.js.map +0 -7
@@ -1,8 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useContext, useMemo, useCallback } from "react";
4
- import Grid from "@elliemae/ds-grid";
5
- import { StyledItemWrapper, StyledItem } from "./styled";
4
+ import { StyledItem, StyledCollapsedContainer, StyledBorderBottom } from "./styled";
6
5
  import { LeftNavContext } from "../../LeftNavigationContext";
7
6
  import { usePropsWithDefaults } from "./usePropsWithDefaults";
8
7
  import { useKeyboardNavigation } from "../../hooks";
@@ -60,52 +59,45 @@ const ItemRenderer = (props) => {
60
59
  }
61
60
  return /* @__PURE__ */ jsxs(Fragment, {
62
61
  children: [
63
- /* @__PURE__ */ jsxs(StyledItemWrapper, {
62
+ /* @__PURE__ */ jsxs(StyledItem, {
63
+ ref: visibleItemsRefs.current[dsId],
64
+ pt: paddingTop,
65
+ pl: indent === void 0 ? "xxxs" : `${indent}px`,
66
+ minHeight,
64
67
  shadowStyle: shadowStyle(opened, item.type),
65
- "data-testid": "leftnav-item-wrapper",
68
+ alignItems: "flex-start",
69
+ cols,
70
+ onClick: !opened ? handleOnClick : () => null,
71
+ onKeyDown,
72
+ selectable,
73
+ selected: isSelected,
74
+ selectedParent: selectedParent === dsId,
75
+ opened,
76
+ onFocus: handleFocus,
77
+ "data-testid": "leftnav-item-container",
78
+ tabIndex: focuseable ? 0 : -1,
79
+ "aria-describedby": ariaDescribedBy,
80
+ "aria-expanded": ariaExpanded,
81
+ role: ariaRole,
82
+ "data-selected": isSelected,
83
+ "data-selectedparent": selectedParent === dsId,
84
+ "data-opened": opened,
85
+ "data-type": item.type,
86
+ "aria-label": ariaLabel,
87
+ "aria-hidden": !focuseable,
88
+ "aria-live": ariaLive,
66
89
  children: [
67
- /* @__PURE__ */ jsx(StyledItem, {
68
- ref: visibleItemsRefs.current[dsId],
69
- pt: paddingTop,
70
- pl: indent === void 0 ? "xxxs" : `${indent}px`,
71
- minHeight,
72
- shadowStyle: shadowStyle(opened, item.type),
73
- alignItems: "flex-start",
74
- cols,
75
- onClick: !opened ? handleOnClick : () => null,
76
- onKeyDown,
77
- selectable,
78
- selected: isSelected,
79
- selectedParent: selectedParent === dsId,
90
+ !expandedForAnimation ? /* @__PURE__ */ jsx(StyledCollapsedContainer, {
91
+ "data-testid": "leftnav-leftcomponent",
92
+ justifyContent: "center",
93
+ children: CollapsedComponent && /* @__PURE__ */ jsx(CollapsedComponent, {
94
+ item,
95
+ ctx
96
+ })
97
+ }) : children,
98
+ hasBorderBottom && /* @__PURE__ */ jsx(StyledBorderBottom, {
80
99
  opened,
81
- onFocus: handleFocus,
82
- "data-testid": "leftnav-item-container",
83
- tabIndex: focuseable ? 0 : -1,
84
- "aria-describedby": ariaDescribedBy,
85
- "aria-expanded": ariaExpanded,
86
- role: ariaRole,
87
- "data-selected": isSelected,
88
- "data-selectedparent": selectedParent === dsId,
89
- "aria-label": ariaLabel,
90
- "aria-hidden": !focuseable,
91
- "aria-live": ariaLive,
92
- children: !expandedForAnimation ? /* @__PURE__ */ jsx(Grid, {
93
- "data-testid": "leftnav-leftcomponent",
94
- justifyContent: "center",
95
- children: /* @__PURE__ */ jsx(CollapsedComponent, {
96
- item,
97
- ctx
98
- })
99
- }) : children
100
- }),
101
- hasBorderBottom && /* @__PURE__ */ jsx("div", {
102
- style: {
103
- marginLeft: opened ? "16px" : "0px",
104
- marginRight: borderBottomMr,
105
- height: "1px",
106
- width: `calc(100% - ${borderBottomMr} - ${opened ? "16px" : "0px"})`,
107
- backgroundColor: "#E0E3E8"
108
- }
100
+ borderBottomMr
109
101
  })
110
102
  ]
111
103
  }),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/ItemRenderer/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useContext, useMemo, useCallback } from 'react';\nimport Grid from '@elliemae/ds-grid';\nimport { StyledItemWrapper, StyledItem } from './styled';\n\nimport { ItemRendererT } from '../../index.d';\nimport { LeftNavContext } from '../../LeftNavigationContext';\nimport { usePropsWithDefaults } from './usePropsWithDefaults';\nimport { useKeyboardNavigation } from '../../hooks';\n\nexport const ItemRenderer = (props: ItemRendererT): JSX.Element => {\n const propsWithDefault = usePropsWithDefaults(props);\n const {\n item,\n item: {\n dsId,\n itemOpts: { selectable, focuseable, indent, ariaLabel, ariaRole, ariaLive, ariaExpanded, ariaDescribedBy },\n CollapsedComponent,\n },\n subitems,\n minHeight,\n paddingTop,\n onClick,\n shadowStyle,\n hasBorderBottom,\n borderBottomMr,\n children,\n } = propsWithDefault;\n\n const ctx = useContext(LeftNavContext);\n const {\n leftNavProps: { onItemClick, openedItem },\n expandedForAnimation,\n selectedParent,\n selectedItem,\n setSelectedItem,\n setFocusedItem,\n visibleItemsRefs,\n } = ctx;\n\n const opened = dsId === openedItem;\n\n const handleOnClick = useCallback(\n (e) => {\n if (onClick) onClick(); // used by uncontrolled drilldowns\n onItemClick(item, e);\n if (selectable) setSelectedItem(item.dsId);\n },\n [onItemClick, item, setSelectedItem, selectable, onClick],\n );\n\n const handleFocus = useCallback(() => {\n if (focuseable) setFocusedItem(dsId);\n }, [dsId, setFocusedItem, focuseable]);\n\n const onKeyDown = useKeyboardNavigation({\n item,\n onClick: handleOnClick,\n });\n\n const cols = useMemo(() => (expandedForAnimation ? ['auto', '1fr', 'auto'] : ['38px']), [expandedForAnimation]);\n const isSelected = useMemo(() => selectedItem === dsId, [selectedItem, dsId]);\n\n if (!expandedForAnimation && !CollapsedComponent) {\n return null;\n }\n\n return (\n <>\n <StyledItemWrapper shadowStyle={shadowStyle(opened, item.type)} data-testid=\"leftnav-item-wrapper\">\n <StyledItem\n ref={visibleItemsRefs.current[dsId]}\n pt={paddingTop}\n pl={indent === undefined ? 'xxxs' : `${indent}px`}\n minHeight={minHeight}\n shadowStyle={shadowStyle(opened, item.type)}\n alignItems=\"flex-start\"\n cols={cols}\n onClick={!opened ? handleOnClick : () => null}\n onKeyDown={onKeyDown}\n selectable={selectable}\n selected={isSelected}\n selectedParent={selectedParent === dsId}\n opened={opened}\n onFocus={handleFocus}\n data-testid=\"leftnav-item-container\"\n tabIndex={focuseable ? 0 : -1}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n role={ariaRole}\n data-selected={isSelected}\n data-selectedparent={selectedParent === dsId}\n aria-label={ariaLabel}\n aria-hidden={!focuseable}\n aria-live={ariaLive}\n >\n {!expandedForAnimation ? (\n <Grid data-testid=\"leftnav-leftcomponent\" justifyContent=\"center\">\n <CollapsedComponent item={item} ctx={ctx} />\n </Grid>\n ) : (\n children\n )}\n </StyledItem>\n {hasBorderBottom && (\n <div\n style={{\n marginLeft: opened ? '16px' : '0px',\n marginRight: borderBottomMr,\n height: '1px',\n width: `calc(100% - ${borderBottomMr} - ${opened ? '16px' : '0px'})`,\n backgroundColor: '#E0E3E8',\n }}\n />\n )}\n </StyledItemWrapper>\n {subitems}\n </>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,SAAgB,YAAY,SAAS,mBAAmB;AACxD,OAAO,UAAU;AACjB,SAAS,mBAAmB,kBAAkB;AAG9C,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AAE/B,MAAM,eAAe,CAAC,UAAsC;AACjE,QAAM,mBAAmB,qBAAqB,KAAK;AACnD,QAAM;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ;AAAA,MACA,UAAU,EAAE,YAAY,YAAY,QAAQ,WAAW,UAAU,UAAU,cAAc,gBAAgB;AAAA,MACzG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,MAAM,WAAW,cAAc;AACrC,QAAM;AAAA,IACJ,cAAc,EAAE,aAAa,WAAW;AAAA,IACxC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,SAAS,SAAS;A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A,YACxC,cAAY;AAAA,YACZ,eAAa,CAAC;AAAA,YACd,aAAW;AAAA,YAEV,WAAC,uBACA,oBAAC;AAAA,cAAK,eAAY;AAAA,cAAwB,gBAAe;AAAA,cACvD,8BAAC;AAAA,gBAAmB;AAAA,gBAAY;AAAA,eAAU;AAAA,aAC5C,IAEA;AAAA,WAEJ;AAAA,UACC,mBACC,oBAAC;AAAA,YACC,OAAO;AAAA,cACL,YAAY,SAAS,SAAS;AAAA,cAC9B,aAAa;AAAA,cACb,QAAQ;AAAA,cACR,OAAO,eAAe,oBAAoB,SAAS,SAAS;AAAA,cAC5D,iBAAiB;AAAA,YACnB;AAAA,WACF;AAAA;AAAA,OAEJ;AAAA,MACC;AAAA;AAAA,GACH;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useContext, useMemo, useCallback } from 'react';\nimport { StyledItem, StyledCollapsedContainer, StyledBorderBottom } from './styled';\n\nimport { ItemRendererT } from '../../index.d';\nimport { LeftNavContext } from '../../LeftNavigationContext';\nimport { usePropsWithDefaults } from './usePropsWithDefaults';\nimport { useKeyboardNavigation } from '../../hooks';\n\nexport const ItemRenderer: React.ComponentType<ItemRendererT> = (props) => {\n const propsWithDefault = usePropsWithDefaults(props);\n const {\n item,\n item: {\n dsId,\n itemOpts: { selectable, focuseable, indent, ariaLabel, ariaRole, ariaLive, ariaExpanded, ariaDescribedBy },\n CollapsedComponent,\n },\n subitems,\n minHeight,\n paddingTop,\n onClick,\n shadowStyle,\n hasBorderBottom,\n borderBottomMr,\n children,\n } = propsWithDefault;\n\n const ctx = useContext(LeftNavContext);\n const {\n leftNavProps: { onItemClick, openedItem },\n expandedForAnimation,\n selectedParent,\n selectedItem,\n setSelectedItem,\n setFocusedItem,\n visibleItemsRefs,\n } = ctx;\n\n const opened = dsId === openedItem;\n\n const handleOnClick = useCallback(\n (e: React.MouseEvent<HTMLElement>) => {\n if (onClick) onClick(); // used by uncontrolled drilldowns\n onItemClick(item, e);\n if (selectable) setSelectedItem(item.dsId as string);\n },\n [onItemClick, item, setSelectedItem, selectable, onClick],\n );\n\n const handleFocus = useCallback(() => {\n if (focuseable) setFocusedItem(dsId as string);\n }, [dsId, setFocusedItem, focuseable]);\n\n const onKeyDown = useKeyboardNavigation({\n item,\n onClick: handleOnClick,\n });\n\n const cols = useMemo(() => (expandedForAnimation ? ['auto', '1fr', 'auto'] : ['38px']), [expandedForAnimation]);\n const isSelected = useMemo(() => selectedItem === dsId, [selectedItem, dsId]);\n\n if (!expandedForAnimation && !CollapsedComponent) {\n return null;\n }\n\n return (\n <>\n <StyledItem\n ref={visibleItemsRefs.current[dsId]}\n pt={paddingTop}\n pl={indent === undefined ? 'xxxs' : `${indent}px`}\n minHeight={minHeight}\n shadowStyle={shadowStyle(opened, item.type)}\n alignItems=\"flex-start\"\n cols={cols}\n onClick={!opened ? handleOnClick : () => null}\n onKeyDown={onKeyDown}\n selectable={selectable}\n selected={isSelected}\n selectedParent={selectedParent === dsId}\n opened={opened}\n onFocus={handleFocus}\n data-testid=\"leftnav-item-container\"\n tabIndex={focuseable ? 0 : -1}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n role={ariaRole}\n data-selected={isSelected}\n data-selectedparent={selectedParent === dsId}\n data-opened={opened}\n data-type={item.type}\n aria-label={ariaLabel}\n aria-hidden={!focuseable}\n aria-live={ariaLive}\n >\n {!expandedForAnimation ? (\n <StyledCollapsedContainer data-testid=\"leftnav-leftcomponent\" justifyContent=\"center\">\n {CollapsedComponent && <CollapsedComponent item={item} ctx={ctx} />}\n </StyledCollapsedContainer>\n ) : (\n children\n )}\n {hasBorderBottom && <StyledBorderBottom opened={opened} borderBottomMr={borderBottomMr} />}\n </StyledItem>\n {subitems}\n </>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,SAAgB,YAAY,SAAS,mBAAmB;AACxD,SAAS,YAAY,0BAA0B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;AAAA,IACE;AAAA,2BAAC;AAAA,QACC,KAAK,iBAAiB,QAAQ;AAAA,QAC9B,IAAI;AAAA,QACJ,IAAI,WAAW,SAAY,SAAS,GAAG;AAAA,QACvC;AAAA,QACA,aAAa,YAAY,QAAQ,KAAK,IAAI;AAAA,QAC1C,YAAW;AAAA,QACX;AAAA,QACA,SAAS,CAAC,SAAS,gBAAgB,MAAM;AAAA,QACzC;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QACV,gBAAgB,mBAAmB;AAAA,QACnC;AAAA,QACA,SAAS;AAAA,QACT,eAAY;AAAA,QACZ,UAAU,aAAa,IAAI;AAAA,QAC3B,oBAAkB;AAAA,QAClB,iBAAe;AAAA,QACf,MAAM;AAAA,QACN,iBAAe;AAAA,QACf,uBAAqB,mBAAmB;AAAA,QACxC,eAAa;AAAA,QACb,aAAW,KAAK;AAAA,QAChB,cAAY;AAAA,QACZ,eAAa,CAAC;AAAA,QACd,aAAW;AAAA,QAEV;AAAA,WAAC,uBACA,oBAAC;AAAA,YAAyB,eAAY;AAAA,YAAwB,gBAAe;AAAA,YAC1E,gCAAsB,oBAAC;AAAA,cAAmB;AAAA,cAAY;AAAA,aAAU;AAAA,WACnE,IAEA;AAAA,UAED,mBAAmB,oBAAC;AAAA,YAAmB;AAAA,YAAgB;AAAA,WAAgC;AAAA;AAAA,OAC1F;AAAA,MACC;AAAA;AAAA,GACH;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
  import Grid from "@elliemae/ds-grid";
3
3
  import { styled } from "@elliemae/ds-system";
4
+ import { DSLeftNavigationName, DSLeftNavigationSlots } from "../../constants";
4
5
  const borderOutside = (color, weight = 2) => `&:before {
5
6
  content: '';
6
7
  position: absolute;
@@ -11,10 +12,6 @@ const borderOutside = (color, weight = 2) => `&:before {
11
12
  border: ${weight}px solid ${color};
12
13
  pointer-events: none;
13
14
  }`;
14
- const StyledItemWrapper = styled(Grid)`
15
- position: relative;
16
- ${(props) => props.shadowStyle(props.theme)}
17
- `;
18
15
  const getItemBackground = ({ selectable, opened, selected, theme }) => {
19
16
  if (!selectable)
20
17
  return "white";
@@ -29,7 +26,8 @@ const getItemHoverBackground = ({ selectable, opened, selected, theme }) => {
29
26
  return theme.colors.brand[200];
30
27
  return theme.colors.brand["200"];
31
28
  };
32
- const StyledItem = styled(Grid)`
29
+ const StyledItem = styled(Grid, { name: DSLeftNavigationName, slot: DSLeftNavigationSlots.ITEM })`
30
+ position: relative;
33
31
  cursor: ${(props) => props.selectable && !props.opened ? "pointer" : "auto"};
34
32
  min-height: ${(props) => props.minHeight};
35
33
 
@@ -49,13 +47,30 @@ const StyledItem = styled(Grid)`
49
47
 
50
48
  outline: none;
51
49
 
52
- ${(props) => props.tabIndex !== -1 ? `:focus {
53
- ${borderOutside(props.theme.colors.brand[700])}
54
- }` : ""}
50
+ :focus {
51
+ ${(props) => borderOutside(props.theme.colors.brand[700])}
52
+ }
53
+ `;
54
+ const StyledCollapsedContainer = styled(Grid, {
55
+ name: DSLeftNavigationName,
56
+ slot: DSLeftNavigationSlots.COLLAPSED_CONTAINER
57
+ })``;
58
+ const StyledBorderBottom = styled("div", {
59
+ name: DSLeftNavigationName,
60
+ slot: DSLeftNavigationSlots.ITEM_BORDER_BOTTOM
61
+ })`
62
+ margin-left: ${({ opened }) => opened ? "16px" : "0px"};
63
+ margin-right: ${({ borderBottomMr }) => borderBottomMr};
64
+ height: 1px;
65
+ width: calc(100% - ${({ borderBottomMr }) => borderBottomMr} - ${({ opened }) => opened ? "16px" : "0px"});
66
+ background-color: #e0e3e8;
67
+ grid-column: span 3;
68
+ align-self: end;
55
69
  `;
56
70
  export {
71
+ StyledBorderBottom,
72
+ StyledCollapsedContainer,
57
73
  StyledItem,
58
- StyledItemWrapper,
59
74
  borderOutside
60
75
  };
61
76
  //# sourceMappingURL=styled.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/ItemRenderer/styled.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport Grid from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\n\ninterface ItemProps {\n selected: boolean;\n selectable: boolean;\n opened: boolean;\n theme: any;\n shadowStyle: (theme: any) => string;\n}\n\nexport const borderOutside = (color, weight = 2): string => `&:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: ${weight}px solid ${color};\n pointer-events: none;\n}`;\n\nexport const StyledItemWrapper = styled(Grid)<{\n shadowStyle: (theme: any) => string;\n}>`\n position: relative;\n ${(props) => props.shadowStyle(props.theme)}\n`;\n\nconst getItemBackground = ({ selectable, opened, selected, theme }: ItemProps) => {\n if (!selectable) return 'white';\n if (selected && !opened) return theme.colors.brand[200];\n return theme.colors.neutral['000'];\n};\n\nconst getItemHoverBackground = ({ selectable, opened, selected, theme }: ItemProps) => {\n if (!selectable) return 'white';\n if (selected && !opened) return theme.colors.brand[200];\n return theme.colors.brand['200'];\n};\n\nexport const StyledItem = styled(Grid)<{ minHeight: string } & ItemProps>`\n cursor: ${(props) => (props.selectable && !props.opened ? 'pointer' : 'auto')};\n min-height: ${(props) => props.minHeight};\n\n background: ${getItemBackground};\n\n ${(props) => (props.selected && !props.opened ? borderOutside(props.theme.colors.brand[500], 1) : '')}\n\n :hover {\n background: ${getItemHoverBackground};\n }\n\n :active {\n background: ${({ selectable, theme }) => (selectable ? theme.colors.brand[200] : 'white')};\n }\n\n ${(props) => props.shadowStyle(props.theme)};\n\n outline: none;\n\n ${(props) =>\n props.tabIndex !== -1\n ? `:focus {\n ${borderOutside(props.theme.colors.brand[700])}\n }`\n : ''}\n`;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACEvB,OAAO,UAAU;AACjB,SAAS,cAAc;AAUhB,MAAM,gBAAgB,CAAC,OAAO,SAAS,MAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAOhD,kBAAkB;AAAA;AAAA;AAIvB,MAAM,oBAAoB,OAAO,IAAI;AAAA;AAAA,IAIxC,CAAC,UAAU,MAAM,YAAY,MAAM,KAAK;AAAA;AAG5C,MAAM,oBAAoB,CAAC,EAAE,YAAY,QAAQ,UAAU,MAAM,MAAiB;AAChF,MAAI,CAAC;AAAY,WAAO;AACxB,MAAI,YAAY,CAAC;AAAQ,WAAO,MAAM,OAAO,MAAM;AACnD,SAAO,MAAM,OAAO,QAAQ;AAC9B;AAEA,MAAM,yBAAyB,CAAC,EAAE,YAAY,QAAQ,UAAU,MAAM,MAAiB;AACrF,MAAI,CAAC;AAAY,WAAO;AACxB,MAAI,YAAY,CAAC;AAAQ,WAAO,MAAM,OAAO,MAAM;AACnD,SAAO,MAAM,OAAO,MAAM;AAC5B;AAEO,MAAM,aAAa,OAAO,IAAI;AAAA,YACzB,CAAC,UAAW,MAAM,cAAc,CAAC,MAAM,SAAS,YAAY;AAAA,gBACxD,CAAC,UAAU,MAAM;AAAA;AAAA,gBAEjB;AAAA;AAAA,IAEZ,CAAC,UAAW,MAAM,YAAY,CAAC,MAAM,SAAS,cAAc,MAAM,MAAM,OAAO,MAAM,MAAM,CAAC,IAAI;AAAA;AAAA;AAAA,kBAGlF;AAAA;AAAA;AAAA;AAAA,kBAIA,CAAC,EAAE,YAAY,MAAM,MAAO,aAAa,MAAM,OAAO,MAAM,OAAO;AAAA;AAAA;AAAA,IAGjF,CAAC,UAAU,MAAM,YAAY,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA,IAIxC,CAAC,UACD,MAAM,aAAa,KACf;AAAA,MACF,cAAc,MAAM,MAAM,OAAO,MAAM,IAAI;AAAA,aAEzC;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport Grid from '@elliemae/ds-grid';\nimport { styled, type Theme } from '@elliemae/ds-system';\nimport { DSLeftNavigationName, DSLeftNavigationSlots } from '../../constants';\n\ninterface ItemProps {\n selected: boolean;\n selectable: boolean;\n opened: boolean;\n theme: Theme;\n shadowStyle: (theme: Theme) => string;\n}\n\nexport const borderOutside = (color: string, weight = 2): string => `&:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: ${weight}px solid ${color};\n pointer-events: none;\n}`;\n\nconst getItemBackground = ({ selectable, opened, selected, theme }: ItemProps) => {\n if (!selectable) return 'white';\n if (selected && !opened) return theme.colors.brand[200];\n return theme.colors.neutral['000'];\n};\n\nconst getItemHoverBackground = ({ selectable, opened, selected, theme }: ItemProps) => {\n if (!selectable) return 'white';\n if (selected && !opened) return theme.colors.brand[200];\n return theme.colors.brand['200'];\n};\n\nexport const StyledItem = styled(Grid, { name: DSLeftNavigationName, slot: DSLeftNavigationSlots.ITEM })<\n { minHeight: string } & ItemProps\n>`\n position: relative;\n cursor: ${(props) => (props.selectable && !props.opened ? 'pointer' : 'auto')};\n min-height: ${(props) => props.minHeight};\n\n background: ${getItemBackground};\n\n ${(props) => (props.selected && !props.opened ? borderOutside(props.theme.colors.brand[500], 1) : '')}\n\n :hover {\n background: ${getItemHoverBackground};\n }\n\n :active {\n background: ${({ selectable, theme }) => (selectable ? theme.colors.brand[200] : 'white')};\n }\n\n ${(props) => props.shadowStyle(props.theme)};\n\n outline: none;\n\n :focus {\n ${(props) => borderOutside(props.theme.colors.brand[700])}\n }\n`;\n\nexport const StyledCollapsedContainer = styled(Grid, {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.COLLAPSED_CONTAINER,\n})``;\n\nexport const StyledBorderBottom = styled('div', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.ITEM_BORDER_BOTTOM,\n})<{ opened: boolean; borderBottomMr?: string }>`\n margin-left: ${({ opened }) => (opened ? '16px' : '0px')};\n margin-right: ${({ borderBottomMr }) => borderBottomMr};\n height: 1px;\n width: calc(100% - ${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Ac,MAAM,MAAM,OAAO,MAAM,IAAI;AAAA;AAAA;AAIrD,MAAM,2BAA2B,OAAO,MAAM;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAEM,MAAM,qBAAqB,OAAO,OAAO;AAAA,EAC9C,MAAM;AAAA,EACN,MAAM,sBAAsB;AAC9B,CAAC;AAAA,iBACgB,CAAC,EAAE,OAAO,MAAO,SAAS,SAAS;AAAA,kBAClC,CAAC,EAAE,eAAe,MAAM;AAAA;AAAA,uBAEnB,CAAC,EAAE,eAAe,MAAM,oBAAoB,CAAC,EAAE,OAAO,MAAO,SAAS,SAAS;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -25,7 +25,7 @@ const usePropsWithDefaults = (props) => {
25
25
  minHeight: "48px",
26
26
  paddingTop: "12px",
27
27
  subitems: [],
28
- shadowStyle: (opened, type) => (theme) => `box-shadow: ${opened || !itemWithoutShadows.includes(type) ? "inset 4px 0 0 0 #52A6EC" : "inset 4px 0 0 0 white"}`,
28
+ shadowStyle: (opened, type) => () => `box-shadow: ${opened || !itemWithoutShadows.includes(type) ? "inset 4px 0 0 0 #52A6EC" : "inset 4px 0 0 0 white"}`,
29
29
  hasBorderBottom: false,
30
30
  borderBottomMr: "0px",
31
31
  ...props,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/ItemRenderer/usePropsWithDefaults.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport { itemOptsT, ItemRendererT } from '../../index.d';\n\nconst itemDefaultProps: itemOptsT = {\n label: '',\n labelOverflow: 'truncate',\n selectable: true,\n focuseable: true,\n openable: false,\n closable: false,\n ariaLabel: '',\n ariaRole: 'menuitem',\n ariaLive: 'off',\n ariaExpanded: undefined,\n ariaDescribedBy: undefined,\n};\n\nconst itemWithoutShadows = ['ds-left-nav-item-header', 'ds-left-nav-item-link', 'ds-left-nav-item-submenu'];\n\n// Make use Item props with defaults\nexport const usePropsWithDefaults = (props: ItemRendererT): ItemRendererT => {\n const propsWithDefault = useMemo(() => {\n const itemWithDefaults = {\n CollapsedComponent: () => null,\n ...props.item,\n itemOpts: { ...itemDefaultProps, ...props.item.itemOpts },\n };\n return {\n minHeight: '48px',\n paddingTop: '12px',\n subitems: [],\n shadowStyle: (opened: boolean, type: string) => (theme: any) =>\n `box-shadow: ${\n opened || !itemWithoutShadows.includes(type) ? 'inset 4px 0 0 0 #52A6EC' : 'inset 4px 0 0 0 white'\n }`,\n hasBorderBottom: false,\n borderBottomMr: '0px',\n ...props,\n item: itemWithDefaults,\n };\n }, [props]);\n\n return propsWithDefault;\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAGxB,MAAM,mBAA8B;AAAA,EAClC,OAAO;AAAA,EACP,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,iBAAiB;AACnB;AAEA,MAAM,qBAAqB,CAAC,2BAA2B,yBAAyB,0BAA0B;AAGnG,MAAM,uBAAuB,CAAC,UAAwC;AAC3E,QAAM,mBAAmB,QAAQ,MAAM;AACrC,UAAM,mBAAmB;AAAA,MACvB,oBAAoB,MAAM;AAAA,MAC1B,GAAG,MAAM;AAAA,MACT,UAAU,EAAE,GAAG,kBAAkB,GAAG,MAAM,KAAK,SAAS;AAAA,IAC1D;AACA,WAAO;AAAA,MACL,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,UAAU,CAAC;AAAA,MACX,aAAa,CAAC,QAAiB,SAAiB,CAAC,UAC/C,eACE,UAAU,CAAC,mBAAmB,SAAS,IAAI,IAAI,4BAA4B;AAAA,MAE/E,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,IACR;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AAEV,SAAO;AACT;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport { ItemOptsT, ItemRendererT } from '../../index.d';\n\nconst itemDefaultProps: ItemOptsT = {\n label: '',\n labelOverflow: 'truncate',\n selectable: true,\n focuseable: true,\n openable: false,\n closable: false,\n ariaLabel: '',\n ariaRole: 'menuitem',\n ariaLive: 'off',\n ariaExpanded: undefined,\n ariaDescribedBy: undefined,\n};\n\nconst itemWithoutShadows = ['ds-left-nav-item-header', 'ds-left-nav-item-link', 'ds-left-nav-item-submenu'];\n\n// Make use Item props with defaults\nexport const usePropsWithDefaults = (props: ItemRendererT): Required<ItemRendererT> => {\n const propsWithDefault = useMemo(() => {\n const itemWithDefaults = {\n CollapsedComponent: () => null,\n ...props.item,\n itemOpts: { ...itemDefaultProps, ...props.item.itemOpts },\n };\n return {\n minHeight: '48px',\n paddingTop: '12px',\n subitems: [],\n shadowStyle: (opened: boolean, type: string) => () =>\n `box-shadow: ${\n opened || !itemWithoutShadows.includes(type) ? 'inset 4px 0 0 0 #52A6EC' : 'inset 4px 0 0 0 white'\n }`,\n hasBorderBottom: false,\n borderBottomMr: '0px',\n ...props,\n item: itemWithDefaults,\n };\n }, [props]);\n\n return propsWithDefault as Required<ItemRendererT>;\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAGxB,MAAM,mBAA8B;AAAA,EAClC,OAAO;AAAA,EACP,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU;AAAA,EACV,UAAU;AAAA,EACV,cAAc;AAAA,EACd,iBAAiB;AACnB;AAEA,MAAM,qBAAqB,CAAC,2BAA2B,yBAAyB,0BAA0B;AAGnG,MAAM,uBAAuB,CAAC,UAAkD;AACrF,QAAM,mBAAmB,QAAQ,MAAM;AACrC,UAAM,mBAAmB;AAAA,MACvB,oBAAoB,MAAM;AAAA,MAC1B,GAAG,MAAM;AAAA,MACT,UAAU,EAAE,GAAG,kBAAkB,GAAG,MAAM,KAAK,SAAS;AAAA,IAC1D;AACA,WAAO;AAAA,MACL,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,UAAU,CAAC;AAAA,MACX,aAAa,CAAC,QAAiB,SAAiB,MAC9C,eACE,UAAU,CAAC,mBAAmB,SAAS,IAAI,IAAI,4BAA4B;AAAA,MAE/E,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,MAChB,GAAG;AAAA,MACH,MAAM;AAAA,IACR;AAAA,EACF,GAAG,CAAC,KAAK,CAAC;AAEV,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -8,7 +8,11 @@ import {
8
8
  } from "@elliemae/ds-icons";
9
9
  import { styled } from "@elliemae/ds-system";
10
10
  import Grid from "@elliemae/ds-grid";
11
- const StyledIcon = styled.div`
11
+ import { DSLeftNavigationName, DSLeftNavigationSlots } from "../../constants";
12
+ const StyledIconContainer = styled("div", {
13
+ name: DSLeftNavigationName,
14
+ slot: DSLeftNavigationSlots.NOTIFICATIONS_CONTAINER
15
+ })`
12
16
  display: flex;
13
17
  flex-direction: column;
14
18
  align-items: center;
@@ -17,7 +21,7 @@ const Notifications = ({
17
21
  exceptions = false,
18
22
  alerts = false,
19
23
  messages = false
20
- }) => /* @__PURE__ */ jsxs(StyledIcon, {
24
+ }) => /* @__PURE__ */ jsxs(StyledIconContainer, {
21
25
  children: [
22
26
  /* @__PURE__ */ jsx(InternalNotifications, {
23
27
  size: "m",
@@ -36,7 +40,7 @@ const Notifications = ({
36
40
  children: exceptions && /* @__PURE__ */ jsx(ExceptionsSmallFill, {
37
41
  width: "6px",
38
42
  height: "6px",
39
- color: ["warning", 900]
43
+ color: ["warning", "900"]
40
44
  })
41
45
  }),
42
46
  /* @__PURE__ */ jsx(Grid, {
@@ -46,7 +50,7 @@ const Notifications = ({
46
50
  children: alerts && /* @__PURE__ */ jsx(AlertsSmallFill, {
47
51
  width: "6px",
48
52
  height: "6px",
49
- color: ["danger", 900]
53
+ color: ["danger", "900"]
50
54
  })
51
55
  }),
52
56
  /* @__PURE__ */ jsx(Grid, {
@@ -56,7 +60,7 @@ const Notifications = ({
56
60
  children: messages && /* @__PURE__ */ jsx(MessagesSmallFill, {
57
61
  width: "6px",
58
62
  height: "6px",
59
- color: ["success", 900]
63
+ color: ["success", "900"]
60
64
  })
61
65
  })
62
66
  ]
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Notifications/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport {\n AlertsSmallFill,\n Notifications as InternalNotifications,\n ExceptionsSmallFill,\n MessagesSmallFill,\n} from '@elliemae/ds-icons';\nimport { styled } from '@elliemae/ds-system';\nimport Grid from '@elliemae/ds-grid';\n\nconst StyledIcon = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\ntype NotificationsProps = {\n exceptions?: boolean;\n alerts?: boolean;\n messages?: boolean;\n};\n\nexport const Notifications = ({\n exceptions = false,\n alerts = false,\n messages = false,\n}: NotificationsProps): JSX.Element => (\n <StyledIcon>\n <InternalNotifications size=\"m\" color={['brand-primary', 800]} data-testid=\"left-nav-notifications-icon\" />\n {(exceptions || alerts || messages) && (\n <Grid cols={['1fr', '1fr', '1fr']} gutter=\"xxxs\" mt=\"2px\">\n <Grid width=\"6px\" height=\"6px\" data-testid=\"left-nav-exceptions-icon\">\n {exceptions && <ExceptionsSmallFill width=\"6px\" height=\"6px\" color={['warning', 900]} />}\n </Grid>\n <Grid width=\"6px\" height=\"6px\" data-testid=\"left-nav-alerts-icon\">\n {alerts && <AlertsSmallFill width=\"6px\" height=\"6px\" color={['danger', 900]} />}\n </Grid>\n <Grid width=\"6px\" height=\"6px\" data-testid=\"left-nav-messages-icon\">\n {messages && <MessagesSmallFill width=\"6px\" height=\"6px\" color={['success', 900]} />}\n </Grid>\n </Grid>\n )}\n </StyledIcon>\n);\n\nexport default Notifications;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB;AACA;AAAA,EACE;AAAA,EACA,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AACvB,OAAO,UAAU;AAEjB,MAAM,aAAa,OAAO;AAAA;AAAA;AAAA;AAAA;AAYnB,MAAM,gBAAgB,CAAC;AAAA,EAC5B,aAAa;AAAA,EACb,SAAS;AAAA,EACT,WAAW;AACb,MACE,qBAAC;AAAA,EACC;AAAA,wBAAC;AAAA,MAAsB,MAAK;AAAA,MAAI,OAAO,CAAC,iBAAiB,GAAG;AAAA,MAAG,eAAY;AAAA,KAA8B;AAAA,KACvG,cAAc,UAAU,aACxB,qBAAC;AAAA,MAAK,MAAM,CAAC,OAAO,OAAO,KAAK;AAAA,MAAG,QAAO;AAAA,MAAO,IAAG;AAAA,MAClD;AAAA,4BAAC;AAAA,UAAK,OAAM;AAAA,UAAM,QAAO;AAAA,UAAM,eAAY;AAAA,UACxC,wBAAc,oBAAC;AAAA,YAAoB,OAAM;AAAA,YAAM,QAAO;AAAA,YAAM,OAAO,CAAC,WAAW,GAAG;AAAA,WAAG;AAAA,SACxF;AAAA,QACA,oBAAC;AAAA,UAAK,OAAM;AAAA,UAAM,QAAO;AAAA,UAAM,eAAY;AAAA,UACxC,oBAAU,oBAAC;AAAA,YAAgB,OAAM;AAAA,YAAM,QAAO;AAAA,YAAM,OAAO,CAAC,UAAU,GAAG;AAAA,WAAG;AAAA,SAC/E;AAAA,QACA,oBAAC;AAAA,UAAK,OAAM;AAAA,UAAM,QAAO;AAAA,UAAM,eAAY;AAAA,UACxC,sBAAY,oBAAC;AAAA,YAAkB,OAAM;AAAA,YAAM,QAAO;AAAA,YAAM,OAAO,CAAC,WAAW,GAAG;AAAA,WAAG;AAAA,SACpF;AAAA;AAAA,KACF;AAAA;AAAA,CAEJ;AAGF,IAAO,wBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport {\n AlertsSmallFill,\n Notifications as InternalNotifications,\n ExceptionsSmallFill,\n MessagesSmallFill,\n} from '@elliemae/ds-icons';\nimport { styled } from '@elliemae/ds-system';\nimport Grid from '@elliemae/ds-grid';\nimport { DSLeftNavigationName, DSLeftNavigationSlots } from '../../constants';\n\nconst StyledIconContainer = styled('div', {\n name: DSLeftNavigationName,\n slot: DSLeftNavigationSlots.NOTIFICATIONS_CONTAINER,\n})`\n display: flex;\n flex-direction: column;\n align-items: center;\n`;\n\ntype NotificationsProps = {\n exceptions?: boolean;\n alerts?: boolean;\n messages?: boolean;\n};\n\nexport const Notifications = ({\n exceptions = false,\n alerts = false,\n messages = false,\n}: NotificationsProps): JSX.Element => (\n <StyledIconContainer>\n <InternalNotifications size=\"m\" color={['brand-primary', 800]} data-testid=\"left-nav-notifications-icon\" />\n {(exceptions || alerts || messages) && (\n <Grid cols={['1fr', '1fr', '1fr']} gutter=\"xxxs\" mt=\"2px\">\n <Grid width=\"6px\" height=\"6px\" data-testid=\"left-nav-exceptions-icon\">\n {exceptions && <ExceptionsSmallFill width=\"6px\" height=\"6px\" color={['warning', '900']} />}\n </Grid>\n <Grid width=\"6px\" height=\"6px\" data-testid=\"left-nav-alerts-icon\">\n {alerts && <AlertsSmallFill width=\"6px\" height=\"6px\" color={['danger', '900']} />}\n </Grid>\n <Grid width=\"6px\" height=\"6px\" data-testid=\"left-nav-messages-icon\">\n {messages && <MessagesSmallFill width=\"6px\" height=\"6px\" color={['success', '900']} />}\n </Grid>\n </Grid>\n )}\n </StyledIconContainer>\n);\n\nexport default Notifications;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AACA;AAAA,EACE;AAAA,EACA,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA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* as React from "react";
2
+ import { LeftNavigation } from "./LeftNavigation";
3
+ var src_default = LeftNavigation;
2
4
  import { LeftNavItemPropsSchema, LeftNavItemOptionsSchema } from "./prop-types";
3
- import { LeftNavigation, LeftNavigationWithSchema, LeftNavigation as LeftNavigation2 } from "./LeftNavigation";
5
+ import { LeftNavigation as LeftNavigation2, LeftNavigationWithSchema } from "./LeftNavigation";
4
6
  export * from "./exported-related";
7
+ export * from "./constants";
5
8
  export {
6
9
  LeftNavItemOptionsSchema,
7
10
  LeftNavItemPropsSchema,
8
- LeftNavigation,
11
+ LeftNavigation2 as LeftNavigation,
9
12
  LeftNavigationWithSchema,
10
- LeftNavigation2 as default
13
+ src_default as default
11
14
  };
12
15
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { LeftNavItemPropsSchema, LeftNavItemOptionsSchema } from './prop-types';\nexport { LeftNavigation, LeftNavigationWithSchema, LeftNavigation as default } from './LeftNavigation';\nexport * from './exported-related';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,wBAAwB,gCAAgC;AACjE,SAAS,gBAAgB,0BAA4C,kBAAlBA,uBAAiC;AACpF,cAAc;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { LeftNavigation } from './LeftNavigation';\n\nexport default LeftNavigation;\nexport { LeftNavItemPropsSchema, LeftNavItemOptionsSchema } from './prop-types';\nexport { LeftNavigation, LeftNavigationWithSchema } from './LeftNavigation';\nexport * from './exported-related';\nexport * from './constants';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sBAAsB;AAE/B,IAAO,cAAQ;AACf,SAAS,wBAAwB,gCAAgC;AACjE,SAAS,kBAAAA,iBAAgB,gCAAgC;AACzD,cAAc;AACd,cAAc;",
6
6
  "names": ["LeftNavigation"]
7
7
  }
@@ -1,11 +1,10 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useMemo } from "react";
4
- import Grid from "@elliemae/ds-grid";
5
4
  import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
6
5
  import { ArrowheadDown, ArrowheadRight } from "@elliemae/ds-icons";
7
6
  import { ItemRenderer, ITEM_TYPES } from "../../exported-related/index";
8
- import { StyledLabel, StyledDate } from "./styled";
7
+ import { StyledLabel, StyledDate, StyledArrowContainer, StyledRightContainer } from "../styled";
9
8
  import { ItemSeparator } from "../ItemSeparator";
10
9
  import { ItemWithDate } from "../ItemWithDate";
11
10
  import { ItemTextLabel } from "../ItemTextLabel";
@@ -32,6 +31,8 @@ const OutOfTheBoxMapSubitem = (props) => {
32
31
  ctx
33
32
  });
34
33
  }
34
+ if (!Component)
35
+ return null;
35
36
  return /* @__PURE__ */ jsx(Component, {
36
37
  item,
37
38
  ctx
@@ -74,7 +75,7 @@ const ItemControlledDrilldown = (props) => {
74
75
  item: subitem,
75
76
  ctx
76
77
  }, subitem.dsId));
77
- }, [items, isOpened]);
78
+ }, [isOpened, items, ctx]);
78
79
  return /* @__PURE__ */ jsxs(ItemRenderer, {
79
80
  item: {
80
81
  ...item,
@@ -91,7 +92,7 @@ const ItemControlledDrilldown = (props) => {
91
92
  minHeight: "32px",
92
93
  paddingTop: "8px",
93
94
  children: [
94
- /* @__PURE__ */ jsx(Grid, {
95
+ /* @__PURE__ */ jsx(StyledArrowContainer, {
95
96
  pl: "xxs",
96
97
  mt: "-2px",
97
98
  children: arrowIcon
@@ -107,23 +108,21 @@ const ItemControlledDrilldown = (props) => {
107
108
  placement: "bottom-start"
108
109
  }) : label
109
110
  }),
110
- /* @__PURE__ */ jsxs(Grid, {
111
+ /* @__PURE__ */ jsxs(StyledRightContainer, {
111
112
  pr: "xxs2",
112
113
  cols: ["auto", "auto"],
113
114
  alignItems: "center",
115
+ gutter: "xxs",
116
+ "data-testid": "leftnav-right-component",
114
117
  children: [
115
118
  /* @__PURE__ */ jsx(StyledDate, {
116
119
  ml: "xxs",
117
120
  "data-testid": "leftnav-list-item-date",
118
121
  children: labelRightSection
119
122
  }),
120
- /* @__PURE__ */ jsx(Grid, {
121
- pl: RightComponent ? "xxs" : "0px",
122
- "data-testid": "leftnav-right-component",
123
- children: RightComponent && /* @__PURE__ */ jsx(RightComponent, {
124
- ctx,
125
- item
126
- })
123
+ RightComponent && /* @__PURE__ */ jsx(RightComponent, {
124
+ ctx,
125
+ item
127
126
  })
128
127
  ]
129
128
  })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/ItemControlledDrilldown/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport Grid from '@elliemae/ds-grid';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { ItemRenderer, ITEM_TYPES } from '../../exported-related/index';\nimport { StyledLabel, StyledDate } from './styled';\nimport { ItemSeparator } from '../ItemSeparator';\nimport { ItemWithDate } from '../ItemWithDate';\nimport { ItemTextLabel } from '../ItemTextLabel';\nimport type { ComponentProps } from '../../index.d';\n\nconst outOfTheBoxSubitemsComponents: Record<string, React.ComponentType<ComponentProps>> = {\n [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR]: ItemSeparator,\n [ITEM_TYPES.LEFT_NAV_ITEM_WITH_DATE]: ItemWithDate,\n [ITEM_TYPES.LEFT_NAV_ITEM_TEXT_LABEL]: ItemTextLabel,\n};\n\nconst OutOfTheBoxMapSubitem = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: { type, Component },\n ctx,\n } = props;\n\n if (typeof type === 'string' && !!outOfTheBoxSubitemsComponents[type]) {\n const OutOfTheBoxComponent = outOfTheBoxSubitemsComponents[type];\n const currentIndent = item.itemOpts?.indent ?? 0;\n const newItem = {\n ...item,\n itemOpts: { ...item.itemOpts, indent: currentIndent + 44 },\n };\n return <OutOfTheBoxComponent item={newItem} ctx={ctx} />;\n }\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\nexport const ItemControlledDrilldown = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n itemOpts: {\n label,\n RightComponent,\n labelRightSection,\n labelOverflow: itemLabelOverflow,\n labelBold,\n labelColor,\n isOpened,\n items,\n labelDataTestId,\n },\n },\n ctx,\n ctx: {\n leftNavProps: { labelOverflow: leftNavLabelOverflow },\n },\n } = props;\n\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const arrowIcon = useMemo(() => {\n const Component = isOpened ? ArrowheadDown : ArrowheadRight;\n return <Component width=\"24px\" height=\"18px\" color={['brand-primary', '800']} />;\n }, [isOpened]);\n\n const subitems = useMemo(() => {\n if (!isOpened || !items) return [];\n return items.map((subitem) => <OutOfTheBoxMapSubitem item={subitem} ctx={ctx} key={subitem.dsId} />);\n }, [items, isOpened]);\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaExpanded: isOpened,\n ariaRole: 'menuitem',\n ...item.itemOpts,\n openable: !isOpened,\n closable: isOpened,\n },\n CollapsedComponent: null,\n }}\n subitems={subitems}\n minHeight=\"32px\"\n paddingTop=\"8px\"\n >\n <Grid pl=\"xxs\" mt=\"-2px\">\n {arrowIcon}\n </Grid>\n <StyledLabel\n pb=\"xxxs\"\n data-testid={labelDataTestId || 'leftnav-list-item-label'}\n labelOverflow={labelOverflow}\n labelBold={labelBold}\n labelColor={labelColor}\n >\n {labelOverflow === 'truncate' ? <SimpleTruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledLabel>\n <Grid pr=\"xxs2\" cols={['auto', 'auto']} alignItems=\"center\">\n <StyledDate ml=\"xxs\" data-testid=\"leftnav-list-item-date\">\n {labelRightSection}\n </StyledDate>\n <Grid pl={RightComponent ? 'xxs' : '0px'} data-testid=\"leftnav-right-component\">\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </Grid>\n </Grid>\n </ItemRenderer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,SAAgB,eAAe;AAC/B,OAAO,UAAU;AACjB,SAAS,kCAAkC;AAC3C,SAAS,eAAe,sBAAsB;AAC9C,SAAS,cAAc,kBAAkB;AACzC,SAAS,aAAa,kBAAkB;AACxC,SAAS,qBAAqB;AAC9B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAG9B,MAAM,gCAAqF;AAAA,EACzF,CAAC,WAAW,0BAA0B;AAAA,EACtC,CAAC,WAAW,0BAA0B;AAAA,EACtC,CAAC,WAAW,2BAA2B;AACzC;AAEA,MAAM,wBAAwB,CAAC,UAAuC;AACpE,QAAM;AAAA,IACJ;AAAA,IACA,MAAM,EAAE,MAAM,UAAU;AAAA,IACxB;AAAA,EACF,IAAI;AAEJ,MAAI,OAAO,SAAS,YAAY,CAAC,CAAC,8BAA8B,OAAO;AACrE,UAAM,uBAAuB,8BAA8B;AAC3D,UAAM,gBAAgB,KAAK,UAAU,UAAU;AAC/C,UAAM,UAAU;AAAA,MACd,GAAG;AAAA,MACH,UAAU,EAAE,GAAG,KAAK,UAAU,QAAQ,gBAAgB,GAAG;AAAA,IAC3D;AACA,WAAO,oBAAC;AAAA,MAAqB,MAAM;AAAA,MAAS;AAAA,KAAU;AAAA,EACxD;AAEA,SAAO,oBAAC;AAAA,IAAU;AAAA,IAAY;AAAA,GAAU;AAC1C;AAEO,MAAM,0BAA0B,CAAC,UAAuC;AAC7E,QAAM;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ,UAAU;AAAA,QACR;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA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AA,8BAAC;AAAA,YAAW,IAAG;AAAA,YAAM,eAAY;AAAA,YAC9B;AAAA,WACH;AAAA,UACA,oBAAC;AAAA,YAAK,IAAI,iBAAiB,QAAQ;AAAA,YAAO,eAAY;AAAA,YACnD,4BAAkB,oBAAC;AAAA,cAAe;AAAA,cAAU;AAAA,aAAY;AAAA,WAC3D;AAAA;AAAA,OACF;AAAA;AAAA,GACF;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { ItemRenderer, ITEM_TYPES } from '../../exported-related/index';\nimport { StyledLabel, StyledDate, StyledArrowContainer, StyledRightContainer } from '../styled';\nimport { ItemSeparator } from '../ItemSeparator';\nimport { ItemWithDate } from '../ItemWithDate';\nimport { ItemTextLabel } from '../ItemTextLabel';\nimport type { ComponentProps } from '../../index.d';\n\nconst outOfTheBoxSubitemsComponents: Record<string, React.ComponentType<ComponentProps>> = {\n [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR]: ItemSeparator,\n [ITEM_TYPES.LEFT_NAV_ITEM_WITH_DATE]: ItemWithDate,\n [ITEM_TYPES.LEFT_NAV_ITEM_TEXT_LABEL]: ItemTextLabel,\n};\n\nconst OutOfTheBoxMapSubitem: React.ComponentType<ComponentProps> = (props) => {\n const {\n item,\n item: { type, Component },\n ctx,\n } = props;\n\n if (typeof type === 'string' && !!outOfTheBoxSubitemsComponents[type]) {\n const OutOfTheBoxComponent = outOfTheBoxSubitemsComponents[type];\n const currentIndent = item.itemOpts?.indent ?? 0;\n const newItem = {\n ...item,\n itemOpts: { ...item.itemOpts, indent: currentIndent + 44 },\n };\n return <OutOfTheBoxComponent item={newItem} 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\nexport const ItemControlledDrilldown = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n itemOpts: {\n label,\n RightComponent,\n labelRightSection,\n labelOverflow: itemLabelOverflow,\n labelBold,\n labelColor,\n isOpened,\n items,\n labelDataTestId,\n },\n },\n ctx,\n ctx: {\n leftNavProps: { labelOverflow: leftNavLabelOverflow },\n },\n } = props;\n\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const arrowIcon = useMemo(() => {\n const Component = isOpened ? ArrowheadDown : ArrowheadRight;\n return <Component width=\"24px\" height=\"18px\" color={['brand-primary', '800']} />;\n }, [isOpened]);\n\n const subitems = useMemo(() => {\n if (!isOpened || !items) return [];\n return items.map((subitem) => <OutOfTheBoxMapSubitem item={subitem} ctx={ctx} key={subitem.dsId} />);\n }, [isOpened, items, ctx]);\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaExpanded: isOpened,\n ariaRole: 'menuitem',\n ...item.itemOpts,\n openable: !isOpened,\n closable: isOpened,\n },\n CollapsedComponent: null,\n }}\n subitems={subitems}\n minHeight=\"32px\"\n paddingTop=\"8px\"\n >\n <StyledArrowContainer pl=\"xxs\" mt=\"-2px\">\n {arrowIcon}\n </StyledArrowContainer>\n <StyledLabel\n pb=\"xxxs\"\n data-testid={labelDataTestId || 'leftnav-list-item-label'}\n labelOverflow={labelOverflow}\n labelBold={labelBold}\n labelColor={labelColor}\n >\n {labelOverflow === 'truncate' ? <SimpleTruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledLabel>\n <StyledRightContainer\n pr=\"xxs2\"\n cols={['auto', 'auto']}\n alignItems=\"center\"\n gutter=\"xxs\"\n data-testid=\"leftnav-right-component\"\n >\n <StyledDate ml=\"xxs\" data-testid=\"leftnav-list-item-date\">\n {labelRightSection}\n </StyledDate>\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </StyledRightContainer>\n </ItemRenderer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY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AAAA;AAAA,OAC3D;AAAA;AAAA,GACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,10 +1,15 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useCallback } from "react";
4
- import Grid from "@elliemae/ds-grid";
5
4
  import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
6
5
  import { ItemRenderer } from "../../exported-related/index";
7
- import { StyledLabel, StyledChevronLeft } from "./styled";
6
+ import {
7
+ StyledItemLabel,
8
+ StyledChevronLeft,
9
+ StyledBottomContainer,
10
+ StyledLeftContainer,
11
+ StyledRightContainer
12
+ } from "../styled";
8
13
  import { CHEVRON_BACK_DS_ID } from "../../exported-related/constants";
9
14
  const notOpenedShadowStyle = (isSelected) => (theme) => `
10
15
  box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : "transparent"};
@@ -39,8 +44,8 @@ const ItemHeader = (props) => {
39
44
  const ariaLabel = item.itemOpts.ariaLabel ?? (typeof label === "string" ? label : "menuitem");
40
45
  const isSelected = selectedItem === dsId || selectedParent === dsId;
41
46
  const shadowStyle = useCallback(
42
- (opened2) => (theme) => !opened2 ? notOpenedShadowStyle(isSelected)(theme) : `box-shadow: inset 4px 0 0 0 #52A6EC`,
43
- [isSelected, openedItem]
47
+ (opened_) => (theme) => !opened_ ? notOpenedShadowStyle(isSelected)(theme) : `box-shadow: inset 4px 0 0 0 #52A6EC`,
48
+ [isSelected]
44
49
  );
45
50
  return /* @__PURE__ */ jsxs(ItemRenderer, {
46
51
  item: {
@@ -58,7 +63,7 @@ const ItemHeader = (props) => {
58
63
  borderBottomMr: opened ? "12px" : "0px",
59
64
  shadowStyle,
60
65
  children: [
61
- /* @__PURE__ */ jsxs(Grid, {
66
+ /* @__PURE__ */ jsxs(StyledLeftContainer, {
62
67
  cols: opened ? ["auto", "auto"] : ["38px"],
63
68
  gutter: "1px",
64
69
  pl: opened ? "xxs" : 0,
@@ -80,13 +85,13 @@ const ItemHeader = (props) => {
80
85
  role: "button",
81
86
  "aria-label": `Close ${ariaLabel}`
82
87
  }),
83
- /* @__PURE__ */ jsx(CollapsedComponent, {
88
+ CollapsedComponent && /* @__PURE__ */ jsx(CollapsedComponent, {
84
89
  item,
85
90
  ctx
86
91
  })
87
92
  ]
88
93
  }),
89
- /* @__PURE__ */ jsx(StyledLabel, {
94
+ /* @__PURE__ */ jsx(StyledItemLabel, {
90
95
  ml: opened ? "xxs" : "1px",
91
96
  mt: "xxxs",
92
97
  mb: "15px",
@@ -97,7 +102,7 @@ const ItemHeader = (props) => {
97
102
  placement: "bottom-start"
98
103
  }) : label
99
104
  }),
100
- /* @__PURE__ */ jsx(Grid, {
105
+ /* @__PURE__ */ jsx(StyledRightContainer, {
101
106
  pl: "xs",
102
107
  pr: opened ? "xxs2" : "xxs",
103
108
  onFocus: (e) => {
@@ -111,8 +116,7 @@ const ItemHeader = (props) => {
111
116
  item
112
117
  })
113
118
  }),
114
- BottomComponent && /* @__PURE__ */ jsx(Grid, {
115
- style: { gridColumn: "span 3" },
119
+ BottomComponent && /* @__PURE__ */ jsx(StyledBottomContainer, {
116
120
  pb: "xxxs",
117
121
  pl: "xxs",
118
122
  pr: "xxs",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/ItemHeader/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback } from 'react';\nimport Grid from '@elliemae/ds-grid';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { ItemRenderer } from '../../exported-related/index';\nimport type { ComponentProps } from '../../index.d';\nimport { StyledLabel, StyledChevronLeft } from './styled';\nimport { CHEVRON_BACK_DS_ID } from '../../exported-related/constants';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst notOpenedShadowStyle = (isSelected: boolean) => (theme: any) =>\n `\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : 'transparent'};\n\n :hover {\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : theme.colors.brand[300]};\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};\n }\n`;\n\nexport const ItemHeader = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: { label, RightComponent, BottomComponent, labelDataTestId, labelOverflow: itemLabelOverflow },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps: { openedItem, labelOverflow: leftNavLabelOverflow, onItemClick },\n expandedForAnimation,\n setFocusedItem,\n selectedItem,\n selectedParent,\n },\n } = props;\n\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const opened = openedItem === dsId;\n\n const ariaLabel = item.itemOpts.ariaLabel ?? (typeof label === 'string' ? label : 'menuitem');\n\n const isSelected = selectedItem === dsId || selectedParent === dsId;\n\n const shadowStyle = useCallback(\n (opened) => (theme: any) =>\n !opened ? notOpenedShadowStyle(isSelected)(theme) : `box-shadow: inset 4px 0 0 0 #52A6EC`,\n [isSelected, openedItem],\n );\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaLabel,\n ariaExpanded: opened,\n ...item.itemOpts,\n openable: expandedForAnimation && !opened,\n closable: expandedForAnimation && opened,\n selectable: !opened,\n },\n }}\n hasBorderBottom\n borderBottomMr={opened ? '12px' : '0px'}\n shadowStyle={shadowStyle}\n >\n <Grid\n cols={opened ? ['auto', 'auto'] : ['38px']}\n gutter=\"1px\"\n pl={opened ? 'xxs' : 0}\n justifyItems=\"center\"\n data-testid=\"leftnav-leftcomponent\"\n >\n {opened && (\n <StyledChevronLeft\n size=\"m\"\n color={['brand-primary', 800]}\n onClick={(e) => {\n onItemClick(item, e);\n }}\n data-testid=\"leftnav-leftcomponent-chevron\"\n tabIndex={0}\n onFocus={(e) => {\n e.stopPropagation();\n setFocusedItem(CHEVRON_BACK_DS_ID);\n }}\n role=\"button\"\n aria-label={`Close ${ariaLabel}`}\n />\n )}\n <CollapsedComponent item={item} ctx={ctx} />\n </Grid>\n <StyledLabel\n ml={opened ? 'xxs' : '1px'}\n mt=\"xxxs\"\n mb=\"15px\"\n data-testid={labelDataTestId || 'leftnav-itemlabel'}\n labelOverflow={labelOverflow}\n >\n {labelOverflow === 'truncate' ? <SimpleTruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledLabel>\n <Grid\n pl=\"xs\"\n pr={opened ? 'xxs2' : 'xxs'}\n onFocus={(e) => {\n setFocusedItem(null);\n e.stopPropagation();\n }}\n onKeyDown={(e) => e.stopPropagation()}\n data-testid=\"leftnav-right-component\"\n >\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </Grid>\n {BottomComponent && (\n <Grid\n style={{ gridColumn: 'span 3' }}\n pb=\"xxxs\"\n pl=\"xxs\"\n pr=\"xxs\"\n onFocus={(e) => {\n setFocusedItem(null);\n e.stopPropagation();\n }}\n onKeyDown={(e) => e.stopPropagation()}\n >\n <BottomComponent ctx={ctx} item={item} />\n </Grid>\n )}\n </ItemRenderer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,SAAgB,mBAAmB;AACnC,OAAO,UAAU;AACjB,SAAS,kCAAkC;AAC3C,SAAS,oBAAoB;AAE7B,SAAS,aAAa,yBAAyB;AAC/C,SAAS,0BAA0B;AAGnC,MAAM,uBAAuB,CAAC,eAAwB,CAAC,UACrD;AAAA,gCAC8B,aAAa,MAAM,OAAO,MAAM,OAAO;AAAA;AAAA;AAAA,kCAGrC,aAAa,MAAM,OAAO,MAAM,OAAO,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA,kCAI1D,MAAM,OAAO,MAAM;AAAA;AAAA;AAI9C,MAAM,aAAa,CAAC,UAAuC;AAChE,QAAM;AAAA,IACJ;AAAA,IACA,MA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,CAAC,MAAM;AACd,gBAAE,gBAAgB;AAClB,6BAAe,kBAAkB;AAAA,YACnC;AAAA,YACA,MAAK;AAAA,YACL,cAAY,SAAS;AAAA,WACvB;AAAA,UAEF,oBAAC;AAAA,YAAmB;AAAA,YAAY;AAAA,WAAU;AAAA;AAAA,OAC5C;AAAA,MACA,oBAAC;AAAA,QACC,IAAI,SAAS,QAAQ;AAAA,QACrB,IAAG;AAAA,QACH,IAAG;AAAA,QACH,eAAa,mBAAmB;AAAA,QAChC;AAAA,QAEC,4BAAkB,aAAa,oBAAC;AAAA,UAA2B,OAAO;AAAA,UAAO,WAAU;AAAA,SAAe,IAAK;AAAA,OAC1G;AAAA,MACA,oBAAC;AAAA,QACC,IAAG;AAAA,QACH,IAAI,SAAS,SAAS;AAAA,QACtB,SAAS,CAAC,MAAM;AACd,yBAAe,IAAI;AACnB,YAAE,gBAAgB;AAAA,QACpB;AAAA,QACA,WAAW,CAAC,MAAM,EAAE,gBAAgB;AAAA,QACpC,eAAY;AAAA,QAEX,4BAAkB,oBAAC;AAAA,UAAe;AAAA,UAAU;AAAA,SAAY;AAAA,OAC3D;AAAA,MACC,mBACC,oBAAC;AAAA,QACC,OAAO,EAAE,YAAY,SAAS;AAAA,QAC9B,IAAG;AAAA,QACH,IAAG;AAAA,QACH,IAAG;AAAA,QACH,SAAS,CAAC,MAAM;AACd,yBAAe,IAAI;AACnB,YAAE,gBAAgB;AAAA,QACpB;AAAA,QACA,WAAW,CAAC,MAAM,EAAE,gBAAgB;AAAA,QAEpC,8BAAC;AAAA,UAAgB;AAAA,UAAU;AAAA,SAAY;AAAA,OACzC;AAAA;AAAA,GAEJ;AAEJ;",
6
- "names": ["opened"]
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React, { useCallback } from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { Theme } from '@elliemae/ds-system';\nimport { ItemRenderer } from '../../exported-related/index';\nimport type { ComponentProps } from '../../index.d';\nimport {\n StyledItemLabel,\n StyledChevronLeft,\n StyledBottomContainer,\n StyledLeftContainer,\n StyledRightContainer,\n} from '../styled';\nimport { CHEVRON_BACK_DS_ID } from '../../exported-related/constants';\n\nconst notOpenedShadowStyle = (isSelected: boolean) => (theme: Theme) =>\n `\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : 'transparent'};\n\n :hover {\n box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : theme.colors.brand[300]};\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};\n }\n`;\n\nexport const ItemHeader = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: { label, RightComponent, BottomComponent, labelDataTestId, labelOverflow: itemLabelOverflow },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps: { openedItem, labelOverflow: leftNavLabelOverflow, onItemClick },\n expandedForAnimation,\n setFocusedItem,\n selectedItem,\n selectedParent,\n },\n } = props;\n\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const opened = openedItem === dsId;\n\n const ariaLabel = item.itemOpts.ariaLabel ?? (typeof label === 'string' ? label : 'menuitem');\n\n const isSelected = selectedItem === dsId || selectedParent === dsId;\n\n const shadowStyle = useCallback(\n (opened_: boolean) => (theme: Theme) =>\n !opened_ ? notOpenedShadowStyle(isSelected)(theme) : `box-shadow: inset 4px 0 0 0 #52A6EC`,\n [isSelected],\n );\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaLabel,\n ariaExpanded: opened,\n ...item.itemOpts,\n openable: expandedForAnimation && !opened,\n closable: expandedForAnimation && opened,\n selectable: !opened,\n },\n }}\n hasBorderBottom\n borderBottomMr={opened ? '12px' : '0px'}\n shadowStyle={shadowStyle}\n >\n <StyledLeftContainer\n cols={opened ? ['auto', 'auto'] : ['38px']}\n gutter=\"1px\"\n pl={opened ? 'xxs' : 0}\n justifyItems=\"center\"\n data-testid=\"leftnav-leftcomponent\"\n >\n {opened && (\n <StyledChevronLeft\n size=\"m\"\n color={['brand-primary', 800]}\n onClick={(e: React.MouseEvent<HTMLElement>) => {\n onItemClick(item, e);\n }}\n data-testid=\"leftnav-leftcomponent-chevron\"\n tabIndex={0}\n onFocus={(e: React.FocusEvent) => {\n e.stopPropagation();\n setFocusedItem(CHEVRON_BACK_DS_ID);\n }}\n role=\"button\"\n aria-label={`Close ${ariaLabel}`}\n />\n )}\n {CollapsedComponent && <CollapsedComponent item={item} ctx={ctx} />}\n </StyledLeftContainer>\n <StyledItemLabel\n ml={opened ? 'xxs' : '1px'}\n mt=\"xxxs\"\n mb=\"15px\"\n data-testid={labelDataTestId || 'leftnav-itemlabel'}\n labelOverflow={labelOverflow}\n >\n {labelOverflow === 'truncate' ? <SimpleTruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledItemLabel>\n <StyledRightContainer\n pl=\"xs\"\n pr={opened ? 'xxs2' : 'xxs'}\n onFocus={(e) => {\n setFocusedItem(null);\n e.stopPropagation();\n }}\n onKeyDown={(e) => e.stopPropagation()}\n data-testid=\"leftnav-right-component\"\n >\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </StyledRightContainer>\n {BottomComponent && (\n <StyledBottomContainer\n pb=\"xxxs\"\n pl=\"xxs\"\n pr=\"xxs\"\n onFocus={(e) => {\n setFocusedItem(null);\n e.stopPropagation();\n }}\n onKeyDown={(e) => e.stopPropagation()}\n >\n <BottomComponent ctx={ctx} item={item} />\n </StyledBottomContainer>\n )}\n </ItemRenderer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,SAAgB,mBAAmB;AACnC,SAAS,kCAAkC;AAE3C,SAAS,oBAAoB;AAE7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AAEnC,MAAM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