@elliemae/ds-left-navigation 1.59.8 → 1.60.0

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 (63) hide show
  1. package/cjs/LeftNavigation.js +2 -2
  2. package/cjs/configs/useLeftNavConfig.js +1 -1
  3. package/cjs/configs/useLeftNavConfig.js.map +1 -1
  4. package/cjs/exported-related/ItemRenderer/index.js +4 -2
  5. package/cjs/exported-related/ItemRenderer/index.js.map +1 -1
  6. package/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js +6 -3
  7. package/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js.map +1 -1
  8. package/cjs/exported-related/Notifications/index.js +8 -4
  9. package/cjs/exported-related/Notifications/index.js.map +1 -1
  10. package/cjs/hooks/useSelectFirstBodyItem.js +3 -3
  11. package/cjs/hooks/useSelectFirstBodyItem.js.map +1 -1
  12. package/cjs/index.js +2 -2
  13. package/cjs/outOfTheBox/ItemControlledDrilldown/index.js +5 -2
  14. package/cjs/outOfTheBox/ItemControlledDrilldown/index.js.map +1 -1
  15. package/cjs/outOfTheBox/ItemHeader/index.js +6 -3
  16. package/cjs/outOfTheBox/ItemHeader/index.js.map +1 -1
  17. package/cjs/outOfTheBox/ItemLink/index.js +6 -3
  18. package/cjs/outOfTheBox/ItemLink/index.js.map +1 -1
  19. package/cjs/outOfTheBox/ItemSubmenu/index.js +6 -3
  20. package/cjs/outOfTheBox/ItemSubmenu/index.js.map +1 -1
  21. package/cjs/outOfTheBox/ItemTextLabel/index.js +2 -1
  22. package/cjs/outOfTheBox/ItemTextLabel/index.js.map +1 -1
  23. package/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js +2 -1
  24. package/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +1 -1
  25. package/cjs/outOfTheBox/ItemWithDate/index.js +2 -1
  26. package/cjs/outOfTheBox/ItemWithDate/index.js.map +1 -1
  27. package/cjs/parts/LeftNavContent/index.js +4 -3
  28. package/cjs/parts/LeftNavContent/index.js.map +1 -1
  29. package/cjs/parts/OutOfTheBoxMapItem.js +2 -2
  30. package/cjs/prop-types.js +4 -3
  31. package/cjs/prop-types.js.map +1 -1
  32. package/esm/LeftNavigation.js +2 -2
  33. package/esm/configs/useLeftNavConfig.js +1 -1
  34. package/esm/configs/useLeftNavConfig.js.map +1 -1
  35. package/esm/exported-related/ItemRenderer/index.js +4 -2
  36. package/esm/exported-related/ItemRenderer/index.js.map +1 -1
  37. package/esm/exported-related/ItemRenderer/usePropsWithDefaults.js +6 -3
  38. package/esm/exported-related/ItemRenderer/usePropsWithDefaults.js.map +1 -1
  39. package/esm/exported-related/Notifications/index.js +8 -4
  40. package/esm/exported-related/Notifications/index.js.map +1 -1
  41. package/esm/hooks/useSelectFirstBodyItem.js +3 -3
  42. package/esm/hooks/useSelectFirstBodyItem.js.map +1 -1
  43. package/esm/index.js +2 -2
  44. package/esm/outOfTheBox/ItemControlledDrilldown/index.js +5 -2
  45. package/esm/outOfTheBox/ItemControlledDrilldown/index.js.map +1 -1
  46. package/esm/outOfTheBox/ItemHeader/index.js +6 -3
  47. package/esm/outOfTheBox/ItemHeader/index.js.map +1 -1
  48. package/esm/outOfTheBox/ItemLink/index.js +6 -3
  49. package/esm/outOfTheBox/ItemLink/index.js.map +1 -1
  50. package/esm/outOfTheBox/ItemSubmenu/index.js +6 -3
  51. package/esm/outOfTheBox/ItemSubmenu/index.js.map +1 -1
  52. package/esm/outOfTheBox/ItemTextLabel/index.js +2 -1
  53. package/esm/outOfTheBox/ItemTextLabel/index.js.map +1 -1
  54. package/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js +2 -1
  55. package/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js.map +1 -1
  56. package/esm/outOfTheBox/ItemWithDate/index.js +2 -1
  57. package/esm/outOfTheBox/ItemWithDate/index.js.map +1 -1
  58. package/esm/parts/LeftNavContent/index.js +4 -3
  59. package/esm/parts/LeftNavContent/index.js.map +1 -1
  60. package/esm/parts/OutOfTheBoxMapItem.js +2 -2
  61. package/esm/prop-types.js +4 -3
  62. package/esm/prop-types.js.map +1 -1
  63. package/package.json +6 -6
@@ -20,9 +20,9 @@ var isItemInsideTheTree = function isItemInsideTheTree(item, itemID) {
20
20
  }));
21
21
  };
22
22
 
23
- var useSelectFirstBodyItem = function useSelectFirstBodyItem(items, openedItem, selectedItem, setSelectedItem) {
23
+ var useSelectFirstBodyItem = function useSelectFirstBodyItem(items, openedItem, selectedItem, setSelectedItem, disableDefaultSelection) {
24
24
  useEffect(function () {
25
- if (items && items.length && openedItem) {
25
+ if (!disableDefaultSelection && items && items.length && openedItem) {
26
26
  var index = items.findIndex(function (elem) {
27
27
  return isSelectableOutOfTheBox(elem) || isSelectableCustom(elem);
28
28
  });
@@ -31,7 +31,7 @@ var useSelectFirstBodyItem = function useSelectFirstBodyItem(items, openedItem,
31
31
  });
32
32
  if (isItemInside) setSelectedItem(selectedItem);else if (index !== -1) setSelectedItem(items[index].dsId);
33
33
  }
34
- }, [openedItem, setSelectedItem]);
34
+ }, [openedItem, setSelectedItem, disableDefaultSelection]);
35
35
  };
36
36
 
37
37
  export { useSelectFirstBodyItem };
@@ -1 +1 @@
1
- {"version":3,"file":"useSelectFirstBodyItem.js","sources":["../../../src/hooks/useSelectFirstBodyItem.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { GenericItemItemProps } from '../index.d';\nimport { ITEM_TYPES } from '../exported-related/constants';\n\nconst { LEFT_NAV_ITEM_SEPARATOR, LEFT_NAV_ITEM_SECTION } = ITEM_TYPES;\n\nconst isSelectableOutOfTheBox = (elem: GenericItemItemProps) =>\n typeof elem.type === 'string' && elem.type !== LEFT_NAV_ITEM_SEPARATOR && elem.type !== LEFT_NAV_ITEM_SECTION;\nconst isSelectableCustom = (elem: GenericItemItemProps) => elem.itemOpts.selectable;\n\nconst isItemInsideTheTree = (item: GenericItemItemProps, itemID: string) =>\n item.dsId === itemID || item?.itemOpts?.items?.some((it) => isItemInsideTheTree(it, itemID));\n\nexport const useSelectFirstBodyItem = (\n items: GenericItemItemProps[],\n openedItem: string,\n selectedItem: string,\n setSelectedItem: React.Dispatch<React.SetStateAction<string>>,\n): void => {\n useEffect(() => {\n if (items && items.length && openedItem) {\n const index = items.findIndex((elem) => isSelectableOutOfTheBox(elem) || isSelectableCustom(elem));\n const isItemInside = items.some((it) => isItemInsideTheTree(it, selectedItem));\n if (isItemInside) setSelectedItem(selectedItem);\n else if (index !== -1) setSelectedItem(items[index].dsId);\n }\n }, [openedItem, setSelectedItem]);\n};\n"],"names":["LEFT_NAV_ITEM_SEPARATOR","ITEM_TYPES","LEFT_NAV_ITEM_SECTION","isSelectableOutOfTheBox","elem","type","isSelectableCustom","itemOpts","selectable","isItemInsideTheTree","item","itemID","dsId","items","some","it","useSelectFirstBodyItem","openedItem","selectedItem","setSelectedItem","useEffect","length","index","findIndex","isItemInside"],"mappings":";;;AAIA,IAAQA,uBAAR,GAA2DC,UAA3D,CAAQD,uBAAR;AAAA,IAAiCE,qBAAjC,GAA2DD,UAA3D,CAAiCC,qBAAjC;;AAEA,IAAMC,uBAAuB,GAAG,SAA1BA,uBAA0B,CAACC,IAAD;AAAA,SAC9B,OAAOA,IAAI,CAACC,IAAZ,KAAqB,QAArB,IAAiCD,IAAI,CAACC,IAAL,KAAcL,uBAA/C,IAA0EI,IAAI,CAACC,IAAL,KAAcH,qBAD1D;AAAA,CAAhC;;AAEA,IAAMI,kBAAkB,GAAG,SAArBA,kBAAqB,CAACF,IAAD;AAAA,SAAgCA,IAAI,CAACG,QAAL,CAAcC,UAA9C;AAAA,CAA3B;;AAEA,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,IAAD,EAA6BC,MAA7B;AAAA;;AAAA,SAC1BD,IAAI,CAACE,IAAL,KAAcD,MAAd,KAAwBD,IAAxB,aAAwBA,IAAxB,yCAAwBA,IAAI,CAAEH,QAA9B,2EAAwB,eAAgBM,KAAxC,yDAAwB,qBAAuBC,IAAvB,CAA4B,UAACC,EAAD;AAAA,WAAQN,mBAAmB,CAACM,EAAD,EAAKJ,MAAL,CAA3B;AAAA,GAA5B,CAAxB,CAD0B;AAAA,CAA5B;;IAGaK,sBAAsB,GAAG,SAAzBA,sBAAyB,CACpCH,KADoC,EAEpCI,UAFoC,EAGpCC,YAHoC,EAIpCC,eAJoC,EAK3B;AACTC,EAAAA,SAAS,CAAC,YAAM;AACd,QAAIP,KAAK,IAAIA,KAAK,CAACQ,MAAf,IAAyBJ,UAA7B,EAAyC;AACvC,UAAMK,KAAK,GAAGT,KAAK,CAACU,SAAN,CAAgB,UAACnB,IAAD;AAAA,eAAUD,uBAAuB,CAACC,IAAD,CAAvB,IAAiCE,kBAAkB,CAACF,IAAD,CAA7D;AAAA,OAAhB,CAAd;AACA,UAAMoB,YAAY,GAAGX,KAAK,CAACC,IAAN,CAAW,UAACC,EAAD;AAAA,eAAQN,mBAAmB,CAACM,EAAD,EAAKG,YAAL,CAA3B;AAAA,OAAX,CAArB;AACA,UAAIM,YAAJ,EAAkBL,eAAe,CAACD,YAAD,CAAf,CAAlB,KACK,IAAII,KAAK,KAAK,CAAC,CAAf,EAAkBH,eAAe,CAACN,KAAK,CAACS,KAAD,CAAL,CAAaV,IAAd,CAAf;AACxB;AACF,GAPQ,EAON,CAACK,UAAD,EAAaE,eAAb,CAPM,CAAT;AAQD;;;;"}
1
+ {"version":3,"file":"useSelectFirstBodyItem.js","sources":["../../../src/hooks/useSelectFirstBodyItem.tsx"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { GenericItemItemProps } from '../index.d';\nimport { ITEM_TYPES } from '../exported-related/constants';\n\nconst { LEFT_NAV_ITEM_SEPARATOR, LEFT_NAV_ITEM_SECTION } = ITEM_TYPES;\n\nconst isSelectableOutOfTheBox = (elem: GenericItemItemProps) =>\n typeof elem.type === 'string' && elem.type !== LEFT_NAV_ITEM_SEPARATOR && elem.type !== LEFT_NAV_ITEM_SECTION;\nconst isSelectableCustom = (elem: GenericItemItemProps) => elem.itemOpts.selectable;\n\nconst isItemInsideTheTree = (item: GenericItemItemProps, itemID: string) =>\n item.dsId === itemID || item?.itemOpts?.items?.some((it) => isItemInsideTheTree(it, itemID));\n\nexport const useSelectFirstBodyItem = (\n items: GenericItemItemProps[],\n openedItem: string,\n selectedItem: string,\n setSelectedItem: React.Dispatch<React.SetStateAction<string>>,\n disableDefaultSelection: boolean,\n): void => {\n useEffect(() => {\n if (!disableDefaultSelection && items && items.length && openedItem) {\n const index = items.findIndex((elem) => isSelectableOutOfTheBox(elem) || isSelectableCustom(elem));\n const isItemInside = items.some((it) => isItemInsideTheTree(it, selectedItem));\n if (isItemInside) setSelectedItem(selectedItem);\n else if (index !== -1) setSelectedItem(items[index].dsId);\n }\n }, [openedItem, setSelectedItem, disableDefaultSelection]);\n};\n"],"names":["LEFT_NAV_ITEM_SEPARATOR","ITEM_TYPES","LEFT_NAV_ITEM_SECTION","isSelectableOutOfTheBox","elem","type","isSelectableCustom","itemOpts","selectable","isItemInsideTheTree","item","itemID","dsId","items","some","it","useSelectFirstBodyItem","openedItem","selectedItem","setSelectedItem","disableDefaultSelection","useEffect","length","index","findIndex","isItemInside"],"mappings":";;;AAIA,IAAQA,uBAAR,GAA2DC,UAA3D,CAAQD,uBAAR;AAAA,IAAiCE,qBAAjC,GAA2DD,UAA3D,CAAiCC,qBAAjC;;AAEA,IAAMC,uBAAuB,GAAG,SAA1BA,uBAA0B,CAACC,IAAD;AAAA,SAC9B,OAAOA,IAAI,CAACC,IAAZ,KAAqB,QAArB,IAAiCD,IAAI,CAACC,IAAL,KAAcL,uBAA/C,IAA0EI,IAAI,CAACC,IAAL,KAAcH,qBAD1D;AAAA,CAAhC;;AAEA,IAAMI,kBAAkB,GAAG,SAArBA,kBAAqB,CAACF,IAAD;AAAA,SAAgCA,IAAI,CAACG,QAAL,CAAcC,UAA9C;AAAA,CAA3B;;AAEA,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACC,IAAD,EAA6BC,MAA7B;AAAA;;AAAA,SAC1BD,IAAI,CAACE,IAAL,KAAcD,MAAd,KAAwBD,IAAxB,aAAwBA,IAAxB,yCAAwBA,IAAI,CAAEH,QAA9B,2EAAwB,eAAgBM,KAAxC,yDAAwB,qBAAuBC,IAAvB,CAA4B,UAACC,EAAD;AAAA,WAAQN,mBAAmB,CAACM,EAAD,EAAKJ,MAAL,CAA3B;AAAA,GAA5B,CAAxB,CAD0B;AAAA,CAA5B;;IAGaK,sBAAsB,GAAG,SAAzBA,sBAAyB,CACpCH,KADoC,EAEpCI,UAFoC,EAGpCC,YAHoC,EAIpCC,eAJoC,EAKpCC,uBALoC,EAM3B;AACTC,EAAAA,SAAS,CAAC,YAAM;AACd,QAAI,CAACD,uBAAD,IAA4BP,KAA5B,IAAqCA,KAAK,CAACS,MAA3C,IAAqDL,UAAzD,EAAqE;AACnE,UAAMM,KAAK,GAAGV,KAAK,CAACW,SAAN,CAAgB,UAACpB,IAAD;AAAA,eAAUD,uBAAuB,CAACC,IAAD,CAAvB,IAAiCE,kBAAkB,CAACF,IAAD,CAA7D;AAAA,OAAhB,CAAd;AACA,UAAMqB,YAAY,GAAGZ,KAAK,CAACC,IAAN,CAAW,UAACC,EAAD;AAAA,eAAQN,mBAAmB,CAACM,EAAD,EAAKG,YAAL,CAA3B;AAAA,OAAX,CAArB;AACA,UAAIO,YAAJ,EAAkBN,eAAe,CAACD,YAAD,CAAf,CAAlB,KACK,IAAIK,KAAK,KAAK,CAAC,CAAf,EAAkBJ,eAAe,CAACN,KAAK,CAACU,KAAD,CAAL,CAAaX,IAAd,CAAf;AACxB;AACF,GAPQ,EAON,CAACK,UAAD,EAAaE,eAAb,EAA8BC,uBAA9B,CAPM,CAAT;AAQD;;;;"}
package/esm/index.js CHANGED
@@ -24,11 +24,11 @@ import './exported-related/ItemRenderer/usePropsWithDefaults.js';
24
24
  import './hooks/useKeyboardNavigation.js';
25
25
  import './outOfTheBox/ItemWithDate/index.js';
26
26
  import './outOfTheBox/ItemWithDate/styled.js';
27
+ import './outOfTheBox/ItemTextLabel/index.js';
28
+ import './outOfTheBox/ItemTextLabel/styled.js';
27
29
  import './outOfTheBox/ItemUncontrolledDrilldown/index.js';
28
30
  import '@babel/runtime/helpers/esm/toConsumableArray';
29
31
  import './outOfTheBox/ItemUncontrolledDrilldown/styled.js';
30
- import './outOfTheBox/ItemTextLabel/index.js';
31
- import './outOfTheBox/ItemTextLabel/styled.js';
32
32
  import './outOfTheBox/ItemHeader/index.js';
33
33
  import './outOfTheBox/ItemHeader/styled.js';
34
34
  import './outOfTheBox/ItemLink/index.js';
@@ -10,18 +10,20 @@ import 'styled-components';
10
10
  import { StyledLabel, StyledDate } from './styled.js';
11
11
  import { ItemSeparator } from '../ItemSeparator/index.js';
12
12
  import { ItemWithDate } from '../ItemWithDate/index.js';
13
+ import { ItemTextLabel } from '../ItemTextLabel/index.js';
13
14
  import '../../exported-related/ItemRenderer/styled.js';
14
15
  import '../../LeftNavigationContext.js';
15
16
  import '../../exported-related/ItemRenderer/usePropsWithDefaults.js';
16
17
  import '../../hooks/useKeyboardNavigation.js';
17
18
  import '../ItemWithDate/styled.js';
19
+ import '../ItemTextLabel/styled.js';
18
20
 
19
21
  var _outOfTheBoxSubitemsC;
20
22
 
21
23
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
22
24
 
23
25
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
24
- var outOfTheBoxSubitemsComponents = (_outOfTheBoxSubitemsC = {}, _defineProperty(_outOfTheBoxSubitemsC, ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, ItemSeparator), _defineProperty(_outOfTheBoxSubitemsC, ITEM_TYPES.LEFT_NAV_ITEM_WITH_DATE, ItemWithDate), _outOfTheBoxSubitemsC);
26
+ var outOfTheBoxSubitemsComponents = (_outOfTheBoxSubitemsC = {}, _defineProperty(_outOfTheBoxSubitemsC, ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, ItemSeparator), _defineProperty(_outOfTheBoxSubitemsC, ITEM_TYPES.LEFT_NAV_ITEM_WITH_DATE, ItemWithDate), _defineProperty(_outOfTheBoxSubitemsC, ITEM_TYPES.LEFT_NAV_ITEM_TEXT_LABEL, ItemTextLabel), _outOfTheBoxSubitemsC);
25
27
 
26
28
  var OutOfTheBoxMapSubitem = function OutOfTheBoxMapSubitem(props) {
27
29
  var item = props.item,
@@ -66,6 +68,7 @@ var ItemControlledDrilldown = function ItemControlledDrilldown(props) {
66
68
  labelColor = _props$item$itemOpts.labelColor,
67
69
  isOpened = _props$item$itemOpts.isOpened,
68
70
  items = _props$item$itemOpts.items,
71
+ labelDataTestId = _props$item$itemOpts.labelDataTestId,
69
72
  ctx = props.ctx,
70
73
  leftNavLabelOverflow = props.ctx.leftNavProps.labelOverflow;
71
74
  var labelOverflow = itemLabelOverflow || leftNavLabelOverflow;
@@ -106,7 +109,7 @@ var ItemControlledDrilldown = function ItemControlledDrilldown(props) {
106
109
  mt: "-2px"
107
110
  }, arrowIcon), /*#__PURE__*/React.createElement(StyledLabel, {
108
111
  pb: "xxxs",
109
- "data-testid": "leftnav-list-item-label",
112
+ "data-testid": labelDataTestId || 'leftnav-list-item-label',
110
113
  labelOverflow: labelOverflow,
111
114
  labelBold: labelBold,
112
115
  labelColor: labelColor
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemControlledDrilldown/index.tsx"],"sourcesContent":["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 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};\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 },\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=\"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"],"names":["outOfTheBoxSubitemsComponents","ITEM_TYPES","LEFT_NAV_ITEM_SEPARATOR","ItemSeparator","LEFT_NAV_ITEM_WITH_DATE","ItemWithDate","OutOfTheBoxMapSubitem","props","item","type","Component","ctx","OutOfTheBoxComponent","currentIndent","itemOpts","indent","newItem","ItemControlledDrilldown","label","RightComponent","labelRightSection","itemLabelOverflow","labelOverflow","labelBold","labelColor","isOpened","items","leftNavLabelOverflow","leftNavProps","arrowIcon","useMemo","ArrowheadDown","ArrowheadRight","subitems","map","subitem","dsId","ariaExpanded","ariaRole","openable","closable","CollapsedComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAMA,6BAAkF,uEACrFC,UAAU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,QAJL;AAKNe,QAAAA,QAAQ,EAAEf;AALJ,QAFN;AASFgB,MAAAA,kBAAkB,EAAE;AATlB,MADN;AAYE,IAAA,QAAQ,EAAER,QAZZ;AAaE,IAAA,SAAS,EAAC,MAbZ;AAcE,IAAA,UAAU,EAAC;AAdb,kBAgBE,oBAAC,IAAD;AAAM,IAAA,EAAE,EAAC,KAAT;AAAe,IAAA,EAAE,EAAC;AAAlB,KACGJ,SADH,CAhBF,eAmBE,oBAAC,WAAD;AACE,IAAA,EAAE,EAAC,MADL;AAEE,mBAAY,yBAFd;AAGE,IAAA,aAAa,EAAEP,aAHjB;AAIE,IAAA,SAAS,EAAEC,SAJb;AAKE,IAAA,UAAU,EAAEC;AALd,KAOGF,aAAa,KAAK,UAAlB,gBAA+B,oBAAC,0BAAD;AAA4B,IAAA,KAAK,EAAEJ,KAAnC;AAA0C,IAAA,SAAS,EAAC;AAApD,IAA/B,GAAuGA,KAP1G,CAnBF,eA4BE,oBAAC,IAAD;AAAM,IAAA,EAAE,EAAC,MAAT;AAAgB,IAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CAAtB;AAAwC,IAAA,UAAU,EAAC;AAAnD,kBACE,oBAAC,UAAD;AAAY,IAAA,EAAE,EAAC,KAAf;AAAqB,mBAAY;AAAjC,KACGE,iBADH,CADF,eAIE,oBAAC,IAAD;AAAM,IAAA,EAAE,EAAED,cAAc,GAAG,KAAH,GAAW,KAAnC;AAA0C,mBAAY;AAAtD,KACGA,cAAc,iBAAI,oBAAC,cAAD;AAAgB,IAAA,GAAG,EAAER,GAArB;AAA0B,IAAA,IAAI,EAAEH;AAAhC,IADrB,CAJF,CA5BF,CADF;AAuCD;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemControlledDrilldown/index.tsx"],"sourcesContent":["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"],"names":["outOfTheBoxSubitemsComponents","ITEM_TYPES","LEFT_NAV_ITEM_SEPARATOR","ItemSeparator","LEFT_NAV_ITEM_WITH_DATE","ItemWithDate","LEFT_NAV_ITEM_TEXT_LABEL","ItemTextLabel","OutOfTheBoxMapSubitem","props","item","type","Component","ctx","OutOfTheBoxComponent","currentIndent","itemOpts","indent","newItem","ItemControlledDrilldown","label","RightComponent","labelRightSection","itemLabelOverflow","labelOverflow","labelBold","labelColor","isOpened","items","labelDataTestId","leftNavLabelOverflow","leftNavProps","arrowIcon","useMemo","ArrowheadDown","ArrowheadRight","subitems","map","subitem","dsId","ariaExpanded","ariaRole","openable","closable","CollapsedComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAA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$itemOpts.label,
34
34
  RightComponent = _props$item$itemOpts.RightComponent,
35
35
  BottomComponent = _props$item$itemOpts.BottomComponent,
36
+ labelDataTestId = _props$item$itemOpts.labelDataTestId,
36
37
  _props$item$Collapsed = _props$item.CollapsedComponent,
37
38
  CollapsedComponent = _props$item$Collapsed === void 0 ? function () {
38
39
  return null;
@@ -50,8 +51,10 @@ var ItemHeader = function ItemHeader(props) {
50
51
  var opened = openedItem === dsId;
51
52
  var ariaLabel = (_item$itemOpts$ariaLa = item.itemOpts.ariaLabel) !== null && _item$itemOpts$ariaLa !== void 0 ? _item$itemOpts$ariaLa : typeof label === 'string' ? label : 'menuitem';
52
53
  var isSelected = selectedItem === dsId || selectedParent === dsId;
53
- var shadowStyle = useCallback(function (theme) {
54
- return !openedItem ? notOpenedShadowStyle(isSelected)(theme) : "box-shadow: inherit";
54
+ var shadowStyle = useCallback(function (opened) {
55
+ return function (theme) {
56
+ return !opened ? notOpenedShadowStyle(isSelected)(theme) : "box-shadow: inset 4px 0 0 0 #52A6EC";
57
+ };
55
58
  }, [isSelected, openedItem]);
56
59
  return /*#__PURE__*/React.createElement(ItemRenderer, {
57
60
  item: _objectSpread(_objectSpread({}, item), {}, {
@@ -94,7 +97,7 @@ var ItemHeader = function ItemHeader(props) {
94
97
  ml: opened ? 'xxs' : '1px',
95
98
  mt: "xxxs",
96
99
  mb: "15px",
97
- "data-testid": "leftnav-itemlabel",
100
+ "data-testid": labelDataTestId || 'leftnav-itemlabel',
98
101
  labelOverflow: labelOverflow
99
102
  }, labelOverflow === 'truncate' ? /*#__PURE__*/React.createElement(SimpleTruncatedTooltipText, {
100
103
  value: label,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemHeader/index.tsx"],"sourcesContent":["/* 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 },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps: { openedItem, labelOverflow, onItemClick },\n expandedForAnimation,\n setFocusedItem,\n selectedItem,\n selectedParent,\n },\n } = props;\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 (theme) => (!openedItem ? notOpenedShadowStyle(isSelected)(theme) : `box-shadow: inherit`),\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=\"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"],"names":["notOpenedShadowStyle","isSelected","theme","colors","brand","ItemHeader","props","item","dsId","itemOpts","label","RightComponent","BottomComponent","CollapsedComponent","ctx","leftNavProps","openedItem","labelOverflow","onItemClick","expandedForAnimation","setFocusedItem","selectedItem","selectedParent","opened","ariaLabel","shadowStyle","useCallback","ariaExpanded","openable","closable","selectable","e","stopPropagation","CHEVRON_BACK_DS_ID","gridColumn"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,UAAD;AAAA,SAAyB,UAACC,KAAD;AAAA,qDAEtBD,UAAU,GAAGC,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAmB,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ACdX,MAAAA,cAAc,CAAC,IAAD,CAAd;AACAW,MAAAA,CAAC,CAACC,eAAF;AACD,KARH;AASE,IAAA,SAAS,EAAE,mBAACD,CAAD;AAAA,aAAOA,CAAC,CAACC,eAAF,EAAP;AAAA;AATb,kBAWE,oBAAC,eAAD;AAAiB,IAAA,GAAG,EAAElB,GAAtB;AAA2B,IAAA,IAAI,EAAEP;AAAjC,IAXF,CAhEJ,CADF;AAiFD;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemHeader/index.tsx"],"sourcesContent":["/* 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 },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps: { openedItem, labelOverflow, onItemClick },\n expandedForAnimation,\n setFocusedItem,\n selectedItem,\n selectedParent,\n },\n } = props;\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"],"names":["notOpenedShadowStyle","isSelected","theme","colors","brand","ItemHeader","props","item","dsId","itemOpts","label","RightComponent","BottomComponent","labelDataTestId","CollapsedComponent","ctx","leftNavProps","openedItem","labelOverflow","onItemClick","expandedForAnimation","setFocusedItem","selectedItem","selectedParent","opened","ariaLabel","shadowStyle","useCallback","ariaExpanded","openable","closable","selectable","e","stopPropagation","CHEVRON_BACK_DS_ID","gridColumn"],"mappings":";;;;;;;;;;;;;;;;;;;AAWA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,UAAD;AAAA,SAAyB,UAACC,KAAD;AAAA,qDAEtBD,UAAU,GAAGC,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAmB,GAAnB,CAAH,GAA6B,aAFjB,8DAKpBH,UAAU,GAAGC,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAmB,GAAnB,CAAH,GAA6BF,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAmB,GAAnB,CALnB,oEASpBF,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAmB,GAAnB,CAToB;AAAA,GAAzB;AAAA,CAA7B;;IAaaC,UAAU,GAAG,SAAbA,UAAa,CAACC,KAAD,EAAwC;AAAA;;AAChE,MACEC,IADF,GAeID,KAfJ,CACEC,IADF;AAAA,oBAeID,KAfJ,CAEEC,IAFF;AAAA,MAGIC,IAHJ,eAGIA,IAHJ;AAAA,yCAIIC,QAJJ;AAAA,MAIgBC,KAJhB,wBAIgBA,KAJhB;AAAA,MAIuBC,cAJvB,wBAIuBA,cAJvB;AAAA,MAIuCC,eAJvC,wBAIuCA,eAJvC;AAAA,MAIwDC,eAJxD,wBAIwDA,eAJxD;AAAA,0CAKIC,kBALJ;AAAA,MAKIA,kBALJ,sCAKyB;AAAA,WAAM,IAAN;AAAA,GALzB;A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AAE,EAAC,IADL;AAEE,IAAA,EAAE,EAAEc,MAAM,GAAG,MAAH,GAAY,KAFxB;AAGE,IAAA,OAAO,EAAE,iBAACQ,CAAD,EAAO;AACdX,MAAAA,cAAc,CAAC,IAAD,CAAd;AACAW,MAAAA,CAAC,CAACC,eAAF;AACD,KANH;AAOE,IAAA,SAAS,EAAE,mBAACD,CAAD;AAAA,aAAOA,CAAC,CAACC,eAAF,EAAP;AAAA,KAPb;AAQE,mBAAY;AARd,KAUGtB,cAAc,iBAAI,oBAAC,cAAD;AAAgB,IAAA,GAAG,EAAEI,GAArB;AAA0B,IAAA,IAAI,EAAER;AAAhC,IAVrB,CAnDF,EA+DGK,eAAe,iBACd,oBAAC,IAAD;AACE,IAAA,KAAK,EAAE;AAAEuB,MAAAA,UAAU,EAAE;AAAd,KADT;AAEE,IAAA,EAAE,EAAC,MAFL;AAGE,IAAA,EAAE,EAAC,KAHL;AAIE,IAAA,EAAE,EAAC,KAJL;AAKE,IAAA,OAAO,EAAE,iBAACH,CAAD,EAAO;AACdX,MAAAA,cAAc,CAAC,IAAD,CAAd;AACAW,MAAAA,CAAC,CAACC,eAAF;AACD,KARH;AASE,IAAA,SAAS,EAAE,mBAACD,CAAD;AAAA,aAAOA,CAAC,CAACC,eAAF,EAAP;AAAA;AATb,kBAWE,oBAAC,eAAD;AAAiB,IAAA,GAAG,EAAElB,GAAtB;AAA2B,IAAA,IAAI,EAAER;AAAjC,IAXF,CAhEJ,CADF;AAiFD;;;;"}
@@ -30,6 +30,7 @@ var ItemLink = function ItemLink(props) {
30
30
  _props$item$itemOpts = _props$item.itemOpts,
31
31
  label = _props$item$itemOpts.label,
32
32
  RightComponent = _props$item$itemOpts.RightComponent,
33
+ labelDataTestId = _props$item$itemOpts.labelDataTestId,
33
34
  _props$item$Collapsed = _props$item.CollapsedComponent,
34
35
  CollapsedComponent = _props$item$Collapsed === void 0 ? function () {
35
36
  return null;
@@ -42,8 +43,10 @@ var ItemLink = function ItemLink(props) {
42
43
  selectedItem = _props$ctx.selectedItem,
43
44
  selectedParent = _props$ctx.selectedParent;
44
45
  var isSelected = selectedItem === dsId || selectedParent === dsId;
45
- var shadowStyle = useCallback(function (theme) {
46
- return !openedItem ? notOpenedShadowStyle(isSelected)(theme) : "box-shadow: inherit";
46
+ var shadowStyle = useCallback(function (opened) {
47
+ return function (theme) {
48
+ return !opened ? notOpenedShadowStyle(isSelected)(theme) : "box-shadow: inset 4px 0 0 0 #52A6EC";
49
+ };
47
50
  }, [isSelected, openedItem]);
48
51
  return /*#__PURE__*/React.createElement(ItemRenderer, {
49
52
  item: _objectSpread(_objectSpread({}, item), {}, {
@@ -68,7 +71,7 @@ var ItemLink = function ItemLink(props) {
68
71
  ml: "1px",
69
72
  mt: "xxxs",
70
73
  mb: "15px",
71
- "data-testid": "leftnav-itemlabel",
74
+ "data-testid": labelDataTestId || 'leftnav-itemlabel',
72
75
  labelOverflow: labelOverflow
73
76
  }, labelOverflow === 'truncate' ? /*#__PURE__*/React.createElement(SimpleTruncatedTooltipText, {
74
77
  value: label,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemLink/index.tsx"],"sourcesContent":["/* eslint-disable indent */\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 } from './styled';\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 ItemLink = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: { label, RightComponent },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps: { labelOverflow, openedItem },\n selectedItem,\n selectedParent,\n },\n } = props;\n\n const isSelected = selectedItem === dsId || selectedParent === dsId;\n\n const shadowStyle = useCallback(\n (theme) => (!openedItem ? notOpenedShadowStyle(isSelected)(theme) : `box-shadow: inherit`),\n [isSelected, openedItem],\n );\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaLabel: typeof label === 'string' ? label : '',\n ariaRole: 'link',\n ...item.itemOpts,\n selectable: true,\n },\n }}\n shadowStyle={shadowStyle}\n >\n <Grid cols={['38px']} gutter=\"1px\" pl={0} justifyItems=\"center\" data-testid=\"leftnav-leftcomponent\">\n <CollapsedComponent item={item} ctx={ctx} />\n </Grid>\n <StyledLabel ml=\"1px\" mt=\"xxxs\" mb=\"15px\" data-testid=\"leftnav-itemlabel\" labelOverflow={labelOverflow}>\n {labelOverflow === 'truncate' ? <SimpleTruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledLabel>\n <Grid mt=\"xxxs\" pr=\"xxs2\" data-testid=\"leftnav-right-component\">\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </Grid>\n </ItemRenderer>\n );\n};\n"],"names":["notOpenedShadowStyle","isSelected","theme","colors","brand","ItemLink","props","item","dsId","itemOpts","label","RightComponent","CollapsedComponent","ctx","leftNavProps","labelOverflow","openedItem","selectedItem","selectedParent","shadowStyle","useCallback","ariaLabel","ariaRole","selectable"],"mappings":";;;;;;;;;;;;;;;;;;;AASA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,UAAD;AAAA,SAAyB,UAACC,KAAD;AAAA,qDAEtBD,UAAU,GAAGC,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAmB,GAAnB,CAAH,GAA6B,aAFjB,8DAKpBH,UAAU,GAAGC,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAm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QAHF;AAINc,QAAAA,UAAU,EAAE;AAJN;AAFN,MADN;AAUE,IAAA,WAAW,EAAEJ;AAVf,kBAYE,oBAAC,IAAD;AAAM,IAAA,IAAI,EAAE,CAAC,MAAD,CAAZ;AAAsB,IAAA,MAAM,EAAC,KAA7B;AAAmC,IAAA,EAAE,EAAE,CAAvC;AAA0C,IAAA,YAAY,EAAC,QAAvD;AAAgE,mBAAY;AAA5E,kBACE,oBAAC,kBAAD;AAAoB,IAAA,IAAI,EAAEZ,IAA1B;AAAgC,IAAA,GAAG,EAAEM;AAArC,IADF,CAZF,eAeE,oBAAC,WAAD;AAAa,IAAA,EAAE,EAAC,KAAhB;AAAsB,IAAA,EAAE,EAAC,MAAzB;AAAgC,IAAA,EAAE,EAAC,MAAnC;AAA0C,mBAAY,mBAAtD;AAA0E,IAAA,aAAa,EAAEE;AAAzF,KACGA,aAAa,KAAK,UAAlB,gBAA+B,oBAAC,0BAAD;AAA4B,IAAA,KAAK,EAAEL,KAAnC;AAA0C,IAAA,SAAS,EAAC;AAApD,IAA/B,GAAuGA,KAD1G,CAfF,eAkBE,oBAAC,IAAD;AAAM,IAAA,EAAE,EAAC,MAAT;AAAgB,IAAA,EAAE,EAAC,MAAnB;AAA0B,mBAAY;AAAtC,KACGC,cAAc,iBAAI,oBAAC,cAAD;AAAgB,IAAA,GAAG,EAAEE,GAArB;AAA0B,IAAA,IAAI,EAAEN;AAAhC,IADrB,CAlBF,CADF;AAwBD;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemLink/index.tsx"],"sourcesContent":["/* eslint-disable indent */\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 } from './styled';\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 ItemLink = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: { label, RightComponent, labelDataTestId },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps: { labelOverflow, openedItem },\n selectedItem,\n selectedParent,\n },\n } = props;\n\n const isSelected = selectedItem === dsId || selectedParent === dsId;\n\n const shadowStyle = useCallback(\n (opened) => (theme: any) => !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: typeof label === 'string' ? label : '',\n ariaRole: 'link',\n ...item.itemOpts,\n selectable: true,\n },\n }}\n shadowStyle={shadowStyle}\n >\n <Grid cols={['38px']} gutter=\"1px\" pl={0} justifyItems=\"center\" data-testid=\"leftnav-leftcomponent\">\n <CollapsedComponent item={item} ctx={ctx} />\n </Grid>\n <StyledLabel\n ml=\"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 mt=\"xxxs\" pr=\"xxs2\" data-testid=\"leftnav-right-component\">\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </Grid>\n </ItemRenderer>\n );\n};\n"],"names":["notOpenedShadowStyle","isSelected","theme","colors","brand","ItemLink","props","item","dsId","itemOpts","label","RightComponent","labelDataTestId","CollapsedComponent","ctx","leftNavProps","labelOverflow","openedItem","selected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EAAEG,GAArB;AAA0B,IAAA,IAAI,EAAEP;AAAhC,IADrB,CAxBF,CADF;AA8BD;;;;"}
@@ -33,6 +33,7 @@ var ItemSubmenu = function ItemSubmenu(props) {
33
33
  label = _props$item$itemOpts.label,
34
34
  RightComponent = _props$item$itemOpts.RightComponent,
35
35
  BottomComponent = _props$item$itemOpts.BottomComponent,
36
+ labelDataTestId = _props$item$itemOpts.labelDataTestId,
36
37
  _props$item$Collapsed = _props$item.CollapsedComponent,
37
38
  CollapsedComponent = _props$item$Collapsed === void 0 ? function () {
38
39
  return null;
@@ -49,8 +50,10 @@ var ItemSubmenu = function ItemSubmenu(props) {
49
50
  setFocusedItem = _props$ctx.setFocusedItem;
50
51
  var opened = openedItem === dsId;
51
52
  var isSelected = selectedItem === dsId;
52
- var shadowStyle = useCallback(function (theme) {
53
- return !openedItem ? notOpenedShadowStyle(isSelected || selectedParent === dsId)(theme) : "box-shadow: inherit";
53
+ var shadowStyle = useCallback(function (opened) {
54
+ return function (theme) {
55
+ return !opened ? notOpenedShadowStyle(isSelected || selectedParent === dsId)(theme) : "box-shadow: inset 4px 0 0 0 #52A6EC";
56
+ };
54
57
  }, [dsId, isSelected, openedItem, selectedParent]);
55
58
  var ariaLabel = (_item$itemOpts$ariaLa = item.itemOpts.ariaLabel) !== null && _item$itemOpts$ariaLa !== void 0 ? _item$itemOpts$ariaLa : typeof label === 'string' ? label : 'menuitem';
56
59
  return /*#__PURE__*/React.createElement(ItemRenderer, {
@@ -93,7 +96,7 @@ var ItemSubmenu = function ItemSubmenu(props) {
93
96
  ml: opened ? 'xxs' : '1px',
94
97
  mt: "xxxs",
95
98
  mb: "15px",
96
- "data-testid": "leftnav-itemlabel",
99
+ "data-testid": labelDataTestId || 'leftnav-itemlabel',
97
100
  labelOverflow: labelOverflow
98
101
  }, labelOverflow === 'truncate' ? /*#__PURE__*/React.createElement(SimpleTruncatedTooltipText, {
99
102
  value: label,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemSubmenu/index.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable indent */\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 ItemSubmenu = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: { label, RightComponent, BottomComponent },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps: { openedItem, labelOverflow, onItemClick },\n expandedForAnimation,\n selectedItem,\n selectedParent,\n setFocusedItem,\n },\n } = props;\n\n const opened = openedItem === dsId;\n\n const isSelected = selectedItem === dsId;\n\n const shadowStyle = useCallback(\n (theme) =>\n !openedItem ? notOpenedShadowStyle(isSelected || selectedParent === dsId)(theme) : `box-shadow: inherit`,\n [dsId, isSelected, openedItem, selectedParent],\n );\n\n const ariaLabel = item.itemOpts.ariaLabel ?? (typeof label === 'string' ? label : 'menuitem');\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ...item.itemOpts,\n ariaLabel,\n ariaExpanded: opened,\n openable: expandedForAnimation && !opened,\n closable: expandedForAnimation && opened,\n selectable: !opened,\n },\n }}\n shadowStyle={shadowStyle}\n hasBorderBottom={opened}\n borderBottomMr=\"12px\"\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=\"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 e.stopPropagation();\n setFocusedItem(null);\n }}\n onKeyDown={(e) => e.stopPropagation()}\n onClick={(e) => openedItem && 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 e.stopPropagation();\n setFocusedItem(null);\n }}\n onKeyDown={(e) => e.stopPropagation()}\n onClick={(e) => openedItem && e.stopPropagation()}\n >\n <BottomComponent ctx={ctx} item={item} />\n </Grid>\n )}\n </ItemRenderer>\n );\n};\n"],"names":["notOpenedShadowStyle","isSelected","theme","colors","brand","ItemSubmenu","props","item","dsId","itemOpts","label","RightComponent","BottomComponent","CollapsedComponent","ctx","leftNavProps","openedItem","labelOverflow","onItemClick","expandedForAnimation","selectedItem","selectedParent","setFocusedItem","opened","shadowStyle","useCallback","ariaLabel","ariaExpanded","openable","closable","selectable","e","stopPropagation","CHEVRON_BACK_DS_ID","gridColumn"],"mappings":";;;;;;;;;;;;;;;;;;;AAYA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,UAAD;AAAA,SAAyB,UAACC,KAAD;AAAA,qDAEtBD,UAAU,GAAGC,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAmB,GAAnB,CAAH,GAA6B,aAFjB,8DAKpBH,UAAU,GAAGC,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAmB,GAAnB,CAAH,GAA6BF,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAmB,GAAnB,CALnB,oEASpBF,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAmB,GAAnB,CAToB;AAAA,GAAzB;AAAA,CAA7B;;IAaaC,WAAW,GAAG,SAAdA,WAAc,CAACC,KAAD,EAAwC;AAAA;;AACjE,MACEC,IADF,GAeID,KAfJ,CACEC,IADF;AAAA,oBAeID,KAfJ,CAEEC,IAFF;AAAA,MAGIC,IAHJ,eAGIA,IAHJ;AAAA,yCAIIC,QAJJ;AAAA,MAIgBC,KAJhB,wBAIgBA,KAJhB;AAAA,MAIuBC,cAJvB,wBAIuBA,cAJvB;AAAA,MAIuCC,eAJvC,wBAIuCA,eAJvC;AAAA,0CAKIC,kBALJ;AAAA,MAKIA,kBALJ,sCAKyB;AAAA,WAAM,IAAN;AAAA,GALzB;AAAA,MAOEC,GAPF,GAeIR,KAfJ,CAOEQ,GAPF;AAAA,mBAeIR,KAfJ,CAQEQ,GARF;AAAA,yCASIC,YATJ;AAAA,MASoBC,UATpB,yBASoBA,UATpB;AAAA,MASgCC,aAThC,yBASgCA,aAThC;AAAA,MAS+CC,WAT/C,yBAS+CA,WAT/C;AAAA,MAUIC,oBAVJ,cAUIA,oBAVJ;AAAA,MAWIC,YAXJ,cAWIA,YAXJ;AAAA,MAYIC,cAZJ,cAYIA,cAZ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CAACC,eAAF,EAArB;AAAA,KARX;AASE,mBAAY;AATd,KAWGrB,cAAc,iBAAI,oBAAC,cAAD;AAAgB,IAAA,GAAG,EAAEG,GAArB;AAA0B,IAAA,IAAI,EAAEP;AAAhC,IAXrB,CAnDF,EAgEGK,eAAe,iBACd,oBAAC,IAAD;AACE,IAAA,KAAK,EAAE;AAAEsB,MAAAA,UAAU,EAAE;AAAd,KADT;AAEE,IAAA,EAAE,EAAC,MAFL;AAGE,IAAA,EAAE,EAAC,KAHL;AAIE,IAAA,EAAE,EAAC,KAJL;AAKE,IAAA,OAAO,EAAE,iBAACH,CAAD,EAAO;AACdA,MAAAA,CAAC,CAACC,eAAF;AACAV,MAAAA,cAAc,CAAC,IAAD,CAAd;AACD,KARH;AASE,IAAA,SAAS,EAAE,mBAACS,CAAD;AAAA,aAAOA,CAAC,CAACC,eAAF,EAAP;AAAA,KATb;AAUE,IAAA,OAAO,EAAE,iBAACD,CAAD;AAAA,aAAOf,UAAU,IAAIe,CAAC,CAACC,eAAF,EAArB;AAAA;AAVX,kBAYE,oBAAC,eAAD;AAAiB,IAAA,GAAG,EAAElB,GAAtB;AAA2B,IAAA,IAAI,EAAEP;AAAjC,IAZF,CAjEJ,CADF;AAmFD;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemSubmenu/index.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable indent */\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 ItemSubmenu = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: { label, RightComponent, BottomComponent, labelDataTestId },\n CollapsedComponent = () => null,\n },\n ctx,\n ctx: {\n leftNavProps: { openedItem, labelOverflow, onItemClick },\n expandedForAnimation,\n selectedItem,\n selectedParent,\n setFocusedItem,\n },\n } = props;\n\n const opened = openedItem === dsId;\n\n const isSelected = selectedItem === dsId;\n\n const shadowStyle = useCallback(\n (opened) => (theme: any) =>\n !opened ? notOpenedShadowStyle(isSelected || selectedParent === dsId)(theme) : `box-shadow: inset 4px 0 0 0 #52A6EC`,\n [dsId, isSelected, openedItem, selectedParent],\n );\n\n const ariaLabel = item.itemOpts.ariaLabel ?? (typeof label === 'string' ? label : 'menuitem');\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ...item.itemOpts,\n ariaLabel,\n ariaExpanded: opened,\n openable: expandedForAnimation && !opened,\n closable: expandedForAnimation && opened,\n selectable: !opened,\n },\n }}\n shadowStyle={shadowStyle}\n hasBorderBottom={opened}\n borderBottomMr=\"12px\"\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 e.stopPropagation();\n setFocusedItem(null);\n }}\n onKeyDown={(e) => e.stopPropagation()}\n onClick={(e) => openedItem && 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 e.stopPropagation();\n setFocusedItem(null);\n }}\n onKeyDown={(e) => e.stopPropagation()}\n onClick={(e) => openedItem && e.stopPropagation()}\n >\n <BottomComponent ctx={ctx} item={item} />\n </Grid>\n )}\n </ItemRenderer>\n );\n};\n"],"names":["notOpenedShadowStyle","isSelected","theme","colors","brand","ItemSubmenu","props","item","dsId","itemOpts","label","RightComponent","BottomComponent","labelDataTestId","CollapsedComponent","ctx","leftNavProps","openedItem","labelOverflow","onItemClick","expandedForAnimation","selectedItem","selectedParent","setFocusedItem","opened","shadowStyle","useCallback","ariaLabel","ariaExpanded","openable","closable","selectable","e","stopPropagation","CHEVRON_BACK_DS_ID","gridColumn"],"mappings":";;;;;;;;;;;;;;;;;;;AAYA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,UAAD;AAAA,SAAyB,UAACC,KAAD;AAAA,qDAEtBD,UAAU,GAAGC,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAmB,GAAnB,CAAH,GAA6B,aAFjB,8DAKpBH,UAAU,GAAGC,KAAK,CAACC,MAAN,CAAaC,KAAb,CAAmB,GAAnB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,IAAA,EAAE,EAAC,KAHL;AAIE,IAAA,EAAE,EAAC,KAJL;AAKE,IAAA,OAAO,EAAE,iBAACH,CAAD,EAAO;AACdA,MAAAA,CAAC,CAACC,eAAF;AACAV,MAAAA,cAAc,CAAC,IAAD,CAAd;AACD,KARH;AASE,IAAA,SAAS,EAAE,mBAACS,CAAD;AAAA,aAAOA,CAAC,CAACC,eAAF,EAAP;AAAA,KATb;AAUE,IAAA,OAAO,EAAE,iBAACD,CAAD;AAAA,aAAOf,UAAU,IAAIe,CAAC,CAACC,eAAF,EAArB;AAAA;AAVX,kBAYE,oBAAC,eAAD;AAAiB,IAAA,GAAG,EAAElB,GAAtB;AAA2B,IAAA,IAAI,EAAER;AAAjC,IAZF,CAjEJ,CADF;AAmFD;;;;"}
@@ -23,6 +23,7 @@ var ItemTextLabel = function ItemTextLabel(props) {
23
23
  itemLabelOverflow = _props$item$itemOpts.labelOverflow,
24
24
  labelBold = _props$item$itemOpts.labelBold,
25
25
  labelColor = _props$item$itemOpts.labelColor,
26
+ labelDataTestId = _props$item$itemOpts.labelDataTestId,
26
27
  leftNavLabelOverflow = props.ctx.leftNavProps.labelOverflow;
27
28
  var labelOverflow = itemLabelOverflow || leftNavLabelOverflow;
28
29
  return /*#__PURE__*/React.createElement(ItemRenderer, {
@@ -32,7 +33,7 @@ var ItemTextLabel = function ItemTextLabel(props) {
32
33
  minHeight: "32px",
33
34
  paddingTop: "8px"
34
35
  }, " ", /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement(StyledLabel, {
35
- "data-testid": "leftnav-list-item-label",
36
+ "data-testid": labelDataTestId || 'leftnav-list-item-label',
36
37
  pl: "24px",
37
38
  labelOverflow: labelOverflow,
38
39
  labelBold: labelBold,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemTextLabel/index.tsx"],"sourcesContent":["import React from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { ItemRenderer } from '../../exported-related/index';\nimport type { ComponentProps } from '../../index.d';\nimport { StyledLabel } from './styled';\n\nexport const ItemTextLabel = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n itemOpts: { label, labelOverflow: itemLabelOverflow, labelBold, labelColor },\n },\n ctx: {\n leftNavProps: { labelOverflow: leftNavLabelOverflow },\n },\n } = props;\n\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n return (\n <ItemRenderer\n item={{\n ...item,\n CollapsedComponent: null,\n }}\n minHeight=\"32px\"\n paddingTop=\"8px\"\n >\n {/* Empty LeftComponent */} <div />\n <StyledLabel\n data-testid=\"leftnav-list-item-label\"\n pl=\"24px\"\n labelOverflow={labelOverflow}\n labelBold={labelBold}\n labelColor={labelColor}\n mr=\"xxs2\"\n pb=\"xxxs\"\n >\n {labelOverflow === 'truncate' ? <SimpleTruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledLabel>\n </ItemRenderer>\n );\n};\n"],"names":["ItemTextLabel","props","item","itemOpts","label","itemLabelOverflow","labelOverflow","labelBold","labelColor","leftNavLabelOverflow","ctx","leftNavProps","CollapsedComponent"],"mappings":";;;;;;;;;;;;;;;;;;IAMaA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD,EAAwC;AACnE,MACEC,IADF,GAQID,KARJ,CACEC,IADF;AAAA,6BAQID,KARJ,CAEEC,IAFF,CAGIC,QAHJ;AAAA,MAGgBC,KAHhB,wBAGgBA,KAHhB;AAAA,MAGsCC,iBAHtC,wBAGuBC,aAHvB;AAAA,MAGyDC,SAHzD,wBAGyDA,SAHzD;AAAA,MAGoEC,UAHpE,wBAGoEA,UAHpE;AAAA,MAMmCC,oBANnC,GAQIR,KARJ,CAKES,GALF,CAMIC,YANJ,CAMoBL,aANpB;AAUA,MAAMA,aAAa,GAAGD,iBAAiB,IAAII,oBAA3C;AAEA,sBACE,oBAAC,YAAD;AACE,IAAA,IAAI,kCACCP,IADD;AAEFU,MAAAA,kBAAkB,EAAE;AAFlB,MADN;AAKE,IAAA,SAAS,EAAC,MALZ;AAME,IAAA,UAAU,EAAC;AANb,uBAQ8B,gCAR9B,eASE,oBAAC,WAAD;AACE,mBAAY,yBADd;AAEE,IAAA,EAAE,EAAC,MAFL;AAGE,IAAA,aAAa,EAAEN,aAHjB;AAIE,IAAA,SAAS,EAAEC,SAJb;AAKE,IAAA,UAAU,EAAEC,UALd;AAME,IAAA,EAAE,EAAC,MANL;AAOE,IAAA,EAAE,EAAC;AAPL,KASGF,aAAa,KAAK,UAAlB,gBAA+B,oBAAC,0BAAD;AAA4B,IAAA,KAAK,EAAEF,KAAnC;AAA0C,IAAA,SAAS,EAAC;AAApD,IAA/B,GAAuGA,KAT1G,CATF,CADF;AAuBD;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemTextLabel/index.tsx"],"sourcesContent":["import React from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { ItemRenderer } from '../../exported-related/index';\nimport type { ComponentProps } from '../../index.d';\nimport { StyledLabel } from './styled';\n\nexport const ItemTextLabel = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n itemOpts: { label, labelOverflow: itemLabelOverflow, labelBold, labelColor, labelDataTestId },\n },\n ctx: {\n leftNavProps: { labelOverflow: leftNavLabelOverflow },\n },\n } = props;\n\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n return (\n <ItemRenderer\n item={{\n ...item,\n CollapsedComponent: null,\n }}\n minHeight=\"32px\"\n paddingTop=\"8px\"\n >\n {/* Empty LeftComponent */} <div />\n <StyledLabel\n data-testid={labelDataTestId || 'leftnav-list-item-label'}\n pl=\"24px\"\n labelOverflow={labelOverflow}\n labelBold={labelBold}\n labelColor={labelColor}\n mr=\"xxs2\"\n pb=\"xxxs\"\n >\n {labelOverflow === 'truncate' ? <SimpleTruncatedTooltipText value={label} placement=\"bottom-start\" /> : label}\n </StyledLabel>\n </ItemRenderer>\n );\n};\n"],"names":["ItemTextLabel","props","item","itemOpts","label","itemLabelOverflow","labelOverflow","labelBold","labelColor","labelDataTestId","leftNavLabelOverflow","ctx","leftNavProps","CollapsedComponent"],"mappings":";;;;;;;;;;;;;;;;;;IAMaA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,KAAD,EAAwC;AACnE,MACEC,IADF,GAQID,KARJ,CACEC,IADF;AAAA,6BAQID,KARJ,CAEEC,IAFF,CAGIC,QAHJ;AAAA,MAGgBC,KAHhB,wBAGgBA,KAHhB;AAAA,MAGsCC,iBAHtC,wBAGuBC,aAHvB;AAAA,MAGyDC,SAHzD,wBAGyDA,SAHzD;AAAA,MAGoEC,UAHpE,wBAGoEA,UAHpE;AAAA,MAGgFC,eAHhF,wBAGgFA,eAHhF;AAAA,MAMmCC,oBANnC,GAQIT,KARJ,CAKEU,GALF,CAMIC,YANJ,CAMoBN,aANpB;AAUA,MAAMA,aAAa,GAAGD,iBAAiB,IAAIK,oBAA3C;AAEA,sBACE,oBAAC,YAAD;AACE,IAAA,IAAI,kCACCR,IADD;AAEFW,MAAAA,kBAAkB,EAAE;AAFlB,MADN;AAKE,IAAA,SAAS,EAAC,MALZ;AAME,IAAA,UAAU,EAAC;AANb,uBAQ8B,gCAR9B,eASE,oBAAC,WAAD;AACE,mBAAaJ,eAAe,IAAI,yBADlC;AAEE,IAAA,EAAE,EAAC,MAFL;AAGE,IAAA,aAAa,EAAEH,aAHjB;AAIE,IAAA,SAAS,EAAEC,SAJb;AAKE,IAAA,UAAU,EAAEC,UALd;AAME,IAAA,EAAE,EAAC,MANL;AAOE,IAAA,EAAE,EAAC;AAPL,KASGF,aAAa,KAAK,UAAlB,gBAA+B,oBAAC,0BAAD;AAA4B,IAAA,KAAK,EAAEF,KAAnC;AAA0C,IAAA,SAAS,EAAC;AAApD,IAA/B,GAAuGA,KAT1G,CATF,CADF;AAuBD;;;;"}
@@ -72,6 +72,7 @@ var ItemUncontrolledDrilldown = function ItemUncontrolledDrilldown(props) {
72
72
  labelColor = _props$item2$itemOpts.labelColor,
73
73
  startOpened = _props$item2$itemOpts.startOpened,
74
74
  items = _props$item2$itemOpts.items,
75
+ labelDataTestId = _props$item2$itemOpts.labelDataTestId,
75
76
  ctx = props.ctx,
76
77
  _props$ctx = props.ctx,
77
78
  leftNavLabelOverflow = _props$ctx.leftNavProps.labelOverflow,
@@ -127,7 +128,7 @@ var ItemUncontrolledDrilldown = function ItemUncontrolledDrilldown(props) {
127
128
  mt: "-2px"
128
129
  }, arrowIcon), /*#__PURE__*/React.createElement(StyledLabel, {
129
130
  pb: "xxxs",
130
- "data-testid": "leftnav-list-item-label",
131
+ "data-testid": labelDataTestId || 'leftnav-list-item-label',
131
132
  labelOverflow: labelOverflow,
132
133
  labelBold: labelBold,
133
134
  labelColor: labelColor
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemUncontrolledDrilldown/index.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, { useMemo, useCallback, useEffect } 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\n// Subitem mapping\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 ItemUncontrolledDrilldown = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: {\n label,\n RightComponent,\n labelRightSection,\n labelOverflow: itemLabelOverflow,\n labelBold,\n labelColor,\n startOpened,\n items,\n },\n },\n ctx,\n ctx: {\n leftNavProps: { labelOverflow: leftNavLabelOverflow },\n openedDrilldowns,\n setOpenedDrilldowns,\n },\n } = props;\n\n // Start opened functionality\n useEffect(() => {\n if (startOpened) setOpenedDrilldowns([...openedDrilldowns, dsId]);\n }, []);\n\n const opened = openedDrilldowns.includes(dsId);\n\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const arrowIcon = useMemo(() => {\n const Component = opened ? ArrowheadDown : ArrowheadRight;\n return <Component width=\"24px\" height=\"18px\" color={['brand-primary', '800']} />;\n }, [opened]);\n\n // Array of subitems\n const subitems = useMemo(() => {\n if (!opened || !items) return [];\n return items.map((subitem) => <OutOfTheBoxMapSubitem item={subitem} ctx={ctx} key={subitem.dsId} />);\n }, [items, opened]);\n\n const handleOnClick = useCallback(() => {\n if (opened) setOpenedDrilldowns(openedDrilldowns.filter((openedDrilldown) => openedDrilldown !== dsId));\n else setOpenedDrilldowns([...openedDrilldowns, dsId]);\n }, [opened, setOpenedDrilldowns, openedDrilldowns]);\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaExpanded: opened,\n ariaRole: 'menuitem',\n ...item.itemOpts,\n openable: !opened,\n closable: opened,\n },\n CollapsedComponent: null,\n }}\n subitems={subitems}\n minHeight=\"32px\"\n paddingTop=\"8px\"\n onClick={handleOnClick}\n >\n <Grid pl=\"xxs\" mt=\"-2px\">\n {arrowIcon}\n </Grid>\n <StyledLabel\n pb=\"xxxs\"\n data-testid=\"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'}>{RightComponent && <RightComponent ctx={ctx} item={item} />}</Grid>\n </Grid>\n </ItemRenderer>\n );\n};\n"],"names":["outOfTheBoxSubitemsComponents","ITEM_TYPES","LEFT_NAV_ITEM_SEPARATOR","ItemSeparator","LEFT_NAV_ITEM_WITH_DATE","ItemWithDate","LEFT_NAV_ITEM_TEXT_LABEL","ItemTextLabel","OutOfTheBoxMapSubitem","props","item","type","Component","ctx","OutOfTheBoxComponent","currentIndent","itemOpts","indent","newItem","ItemUncontrolledDrilldown","dsId","label","RightComponent","labelRightSection","itemLabelOverflow","labelOverflow","labelBold","labelColor","startOpened","items","leftNavLabelOverflow","leftNavProps","openedDrilldowns","setOpenedDrilldowns","useEffect","opened","includes","arrowIcon","useMemo","ArrowheadDown","ArrowheadRight","subitems","map","subitem","handleOnClick","useCallback","filter","openedDrilldown","ariaExpanded","ariaRole","openable","closable","CollapsedComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA;AACA,IAAMA,6BAAkF,uEACrFC,UAAU,CAACC,uBAD0E,EAChDC,aADgD,0CAErFF,UAAU,CAACG,uBAF0E,EAEhDC,YAFgD,0CAGrFJ,UAAU,CAACK,wBAH0E,EAG/CC,aAH+C,yB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1G,CApBF,eA6BE,oBAAC,IAAD;AAAM,IAAA,EAAE,EAAC,MAAT;AAAgB,IAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CAAtB;AAAwC,IAAA,UAAU,EAAC;AAAnD,kBACE,oBAAC,UAAD;AAAY,IAAA,EAAE,EAAC,KAAf;AAAqB,mBAAY;AAAjC,KACGE,iBADH,CADF,eAIE,oBAAC,IAAD;AAAM,IAAA,EAAE,EAAED,cAAc,GAAG,KAAH,GAAW;AAAnC,KAA2CA,cAAc,iBAAI,oBAAC,cAAD;AAAgB,IAAA,GAAG,EAAET,GAArB;AAA0B,IAAA,IAAI,EAAEH;AAAhC,IAA7D,CAJF,CA7BF,CADF;AAsCD;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemUncontrolledDrilldown/index.tsx"],"sourcesContent":["/* eslint-disable max-lines */\nimport React, { useMemo, useCallback, useEffect } 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\n// Subitem mapping\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 ItemUncontrolledDrilldown = (props: ComponentProps): JSX.Element => {\n const {\n item,\n item: {\n dsId,\n itemOpts: {\n label,\n RightComponent,\n labelRightSection,\n labelOverflow: itemLabelOverflow,\n labelBold,\n labelColor,\n startOpened,\n items,\n labelDataTestId,\n },\n },\n ctx,\n ctx: {\n leftNavProps: { labelOverflow: leftNavLabelOverflow },\n openedDrilldowns,\n setOpenedDrilldowns,\n },\n } = props;\n\n // Start opened functionality\n useEffect(() => {\n if (startOpened) setOpenedDrilldowns([...openedDrilldowns, dsId]);\n }, []);\n\n const opened = openedDrilldowns.includes(dsId);\n\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n const arrowIcon = useMemo(() => {\n const Component = opened ? ArrowheadDown : ArrowheadRight;\n return <Component width=\"24px\" height=\"18px\" color={['brand-primary', '800']} />;\n }, [opened]);\n\n // Array of subitems\n const subitems = useMemo(() => {\n if (!opened || !items) return [];\n return items.map((subitem) => <OutOfTheBoxMapSubitem item={subitem} ctx={ctx} key={subitem.dsId} />);\n }, [items, opened]);\n\n const handleOnClick = useCallback(() => {\n if (opened) setOpenedDrilldowns(openedDrilldowns.filter((openedDrilldown) => openedDrilldown !== dsId));\n else setOpenedDrilldowns([...openedDrilldowns, dsId]);\n }, [opened, setOpenedDrilldowns, openedDrilldowns]);\n\n return (\n <ItemRenderer\n item={{\n ...item,\n itemOpts: {\n ariaExpanded: opened,\n ariaRole: 'menuitem',\n ...item.itemOpts,\n openable: !opened,\n closable: opened,\n },\n CollapsedComponent: null,\n }}\n subitems={subitems}\n minHeight=\"32px\"\n paddingTop=\"8px\"\n onClick={handleOnClick}\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'}>{RightComponent && <RightComponent ctx={ctx} item={item} />}</Grid>\n </Grid>\n </ItemRenderer>\n );\n};\n"],"names":["outOfTheBoxSubitemsComponents","ITEM_TYPES","LEFT_NAV_ITEM_SEPARATOR","ItemSeparator","LEFT_NAV_ITEM_WITH_DATE","ItemWithDate","LEFT_NAV_ITEM_TEXT_LABEL","ItemTextLabel","OutOfTheBoxMapSubitem","props","item","type","Component","ctx","OutOfTheBoxComponent","currentIndent","itemOpts","indent","newItem","ItemUncontrolledDrilldown","dsId","label","RightComponent","labelRightSection","itemLabelOverflow","labelOverflow","labelBold","labelColor","startOpened","items","labelDataTestId","leftNavLabelOverflow","leftNavProps","openedDrilldowns","setOpenedDrilldowns","useEffect","opened","includes","arrowIcon","useMemo","ArrowheadDown","ArrowheadRight","subitems","map","subitem","handleOnClick","useCallback","filter","openedDrilldown","ariaExpanded","ariaRole","openable","closable","CollapsedComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA;AACA,IAAMA,6BAAkF,uEACrFC,UAAU,CAACC,uBAD0E,EAChDC,aADgD,0CAErFF,UAAU,CAACG,uBAF0E,EAEhDC,YAFgD,0CAGrFJ,UAAU,CAACK,wBAH0E,EAG/CC,aAH+C,yBAAxF;;AAMA,IAAMC,qBAAqB,GAAG,SA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AA/B,GAAuGA,KAP1G,CApBF,eA6BE,oBAAC,IAAD;AAAM,IAAA,EAAE,EAAC,MAAT;AAAgB,IAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CAAtB;AAAwC,IAAA,UAAU,EAAC;AAAnD,kBACE,oBAAC,UAAD;AAAY,IAAA,EAAE,EAAC,KAAf;AAAqB,mBAAY;AAAjC,KACGE,iBADH,CADF,eAIE,oBAAC,IAAD;AAAM,IAAA,EAAE,EAAED,cAAc,GAAG,KAAH,GAAW;AAAnC,KAA2CA,cAAc,iBAAI,oBAAC,cAAD;AAAgB,IAAA,GAAG,EAAET,GAArB;AAA0B,IAAA,IAAI,EAAEH;AAAhC,IAA7D,CAJF,CA7BF,CADF;AAsCD;;;;"}
@@ -25,6 +25,7 @@ var ItemWithDate = function ItemWithDate(props) {
25
25
  itemLabelOverflow = _props$item$itemOpts.labelOverflow,
26
26
  labelBold = _props$item$itemOpts.labelBold,
27
27
  labelColor = _props$item$itemOpts.labelColor,
28
+ labelDataTestId = _props$item$itemOpts.labelDataTestId,
28
29
  ctx = props.ctx,
29
30
  leftNavLabelOverflow = props.ctx.leftNavProps.labelOverflow;
30
31
  var labelOverflow = itemLabelOverflow || leftNavLabelOverflow;
@@ -37,7 +38,7 @@ var ItemWithDate = function ItemWithDate(props) {
37
38
  }, " ", /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement(StyledLabel, {
38
39
  pl: "xxs",
39
40
  pb: "xxxs",
40
- "data-testid": "leftnav-list-item-label",
41
+ "data-testid": labelDataTestId || 'leftnav-list-item-label',
41
42
  labelOverflow: labelOverflow,
42
43
  labelBold: labelBold,
43
44
  labelColor: labelColor
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemWithDate/index.tsx"],"sourcesContent":["import React 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, StyledDate } from './styled';\n\nexport const ItemWithDate = (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 },\n },\n ctx,\n ctx: {\n leftNavProps: { labelOverflow: leftNavLabelOverflow },\n },\n } = props;\n\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n return (\n <ItemRenderer\n item={{\n ...item,\n CollapsedComponent: null,\n }}\n minHeight=\"32px\"\n paddingTop=\"8px\"\n >\n {/* Empty LeftComponent */} <div />\n <StyledLabel\n pl=\"xxs\"\n pb=\"xxxs\"\n data-testid=\"leftnav-list-item-label\"\n labelOverflow={labelOverflow}\n labelBold={labelBold}\n labelColor={labelColor}\n >\n {labelOverflow === 'truncate' ? (\n <SimpleTruncatedTooltipText value={label} placement=\"bottom-start\" />\n ) : (\n label\n )}\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\n pl={RightComponent ? 'xxs' : '0px'}\n data-testid=\"leftnav-right-component\"\n >\n {RightComponent && <RightComponent ctx={ctx} item={item} />}\n </Grid>\n </Grid>\n </ItemRenderer>\n );\n};\n"],"names":["ItemWithDate","props","item","itemOpts","label","RightComponent","labelRightSection","itemLabelOverflow","labelOverflow","labelBold","labelColor","ctx","leftNavLabelOverflow","leftNavProps","CollapsedComponent"],"mappings":";;;;;;;;;;;;;;;;;;IAOaA,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAwC;AAClE,MACEC,IADF,GAgBID,KAhBJ,CACEC,IADF;AAAA,6BAgBID,KAhBJ,CAEEC,IAFF,CAGIC,QAHJ;AAAA,MAIMC,KAJN,wBAIMA,KAJN;AAAA,MAKMC,cALN,wBAKMA,cALN;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JrB,CAJF,CAvBF,CADF;AAqCD;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/outOfTheBox/ItemWithDate/index.tsx"],"sourcesContent":["import React 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, StyledDate } from './styled';\n\nexport const ItemWithDate = (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 labelDataTestId,\n },\n },\n ctx,\n ctx: {\n leftNavProps: { labelOverflow: leftNavLabelOverflow },\n },\n } = props;\n\n const labelOverflow = itemLabelOverflow || leftNavLabelOverflow;\n\n return (\n <ItemRenderer\n item={{\n ...item,\n CollapsedComponent: null,\n }}\n minHeight=\"32px\"\n paddingTop=\"8px\"\n >\n {/* Empty LeftComponent */} <div />\n <StyledLabel\n pl=\"xxs\"\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"],"names":["ItemWithDate","props","item","itemOpts","label","RightComponent","labelRightSection","itemLabelOverflow","labelOverflow","labelBold","labelColor","labelDataTestId","ctx","leftNavLabelOverflow","leftNavProps","CollapsedComponent"],"mappings":";;;;;;;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ACE,oBAAC,UAAD;AAAY,IAAA,EAAE,EAAC,KAAf;AAAqB,mBAAY;AAAjC,KACGE,iBADH,CADF,eAIE,oBAAC,IAAD;AAAM,IAAA,EAAE,EAAED,cAAc,GAAG,KAAH,GAAW,KAAnC;AAA0C,mBAAY;AAAtD,KACGA,cAAc,iBAAI,oBAAC,cAAD;AAAgB,IAAA,GAAG,EAAEO,GAArB;AAA0B,IAAA,IAAI,EAAEV;AAAhC,IADrB,CAJF,CAnBF,CADF;AA8BD;;;;"}
@@ -29,11 +29,11 @@ import '../../outOfTheBox/ItemControlledDrilldown/styled.js';
29
29
  import '../../outOfTheBox/ItemSeparator/index.js';
30
30
  import '../../outOfTheBox/ItemWithDate/index.js';
31
31
  import '../../outOfTheBox/ItemWithDate/styled.js';
32
+ import '../../outOfTheBox/ItemTextLabel/index.js';
33
+ import '../../outOfTheBox/ItemTextLabel/styled.js';
32
34
  import '../../outOfTheBox/ItemUncontrolledDrilldown/index.js';
33
35
  import '@babel/runtime/helpers/esm/toConsumableArray';
34
36
  import '../../outOfTheBox/ItemUncontrolledDrilldown/styled.js';
35
- import '../../outOfTheBox/ItemTextLabel/index.js';
36
- import '../../outOfTheBox/ItemTextLabel/styled.js';
37
37
  import '../../outOfTheBox/ItemHeader/index.js';
38
38
  import '../../outOfTheBox/ItemHeader/styled.js';
39
39
  import '../../outOfTheBox/ItemLink/index.js';
@@ -53,6 +53,7 @@ var LeftNavInnerContent = function LeftNavInnerContent() {
53
53
  BodyHeaderComponent = _React$useContext$lef.BodyHeaderComponent,
54
54
  openedItem = _React$useContext$lef.openedItem,
55
55
  items = _React$useContext$lef.items,
56
+ withoutBodyShadow = _React$useContext$lef.withoutBodyShadow,
56
57
  selectedItem = _React$useContext.selectedItem;
57
58
 
58
59
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledLeftNavHeaderArea, {
@@ -66,7 +67,7 @@ var LeftNavInnerContent = function LeftNavInnerContent() {
66
67
  }, BodyHeaderComponent ? /*#__PURE__*/React.createElement(OutOfTheBoxMapItem, {
67
68
  item: BodyHeaderComponent
68
69
  }) : null), /*#__PURE__*/React.createElement(StyledLeftNavBodyItemsArea, {
69
- selected: openedItem !== null,
70
+ selected: !withoutBodyShadow && openedItem !== null,
70
71
  "data-testid": "leftnav-body-items-area",
71
72
  tabIndex: -1
72
73
  }, /*#__PURE__*/React.createElement(LeftNavContentWithScrollbar, null, items.map(function (item) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/parts/LeftNavContent/index.tsx"],"sourcesContent":["import React from 'react';\nimport { LeftNavContext } from '../../LeftNavigationContext';\nimport { LeftNavFooterItem } from '../LeftNavFooterItem';\nimport { LeftNavContentWithScrollbar } from '../LeftNavContentWithScrollbar';\nimport { OutOfTheBoxMapItem } from '../OutOfTheBoxMapItem';\nimport {\n StyledLeftNavExpandAnimationWrapper,\n StyledLeftNavAreasContainer,\n StyledLeftNavHeaderArea,\n StyledLeftNavBodyAreasContainer,\n StyledLeftNavBodyHeaderArea,\n StyledLeftNavBodyItemsArea,\n StyledLeftNavFooterArea,\n} from './styled';\nimport { LeftNavLoading } from '../LeftNavLoading';\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 },\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)}\n >\n {HeaderComponent ? <OutOfTheBoxMapItem item={HeaderComponent} /> : null}\n </StyledLeftNavHeaderArea>\n <StyledLeftNavBodyAreasContainer>\n <StyledLeftNavBodyHeaderArea\n data-testid=\"leftnav-body-header-area\"\n selected={BodyHeaderComponent && [selectedItem, openedItem].includes(BodyHeaderComponent.dsId)}\n >\n {BodyHeaderComponent ? <OutOfTheBoxMapItem item={BodyHeaderComponent} /> : null}\n </StyledLeftNavBodyHeaderArea>\n <StyledLeftNavBodyItemsArea selected={openedItem !== null} data-testid=\"leftnav-body-items-area\" tabIndex={-1}>\n <LeftNavContentWithScrollbar>\n {items.map((item) => (\n <OutOfTheBoxMapItem item={item} key={item.dsId} />\n ))}\n </LeftNavContentWithScrollbar>\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 } = React.useContext(LeftNavContext);\n\n return (\n <StyledLeftNavExpandAnimationWrapper\n expandedWidth={expandedWidth}\n expanded={expanded}\n data-testid=\"leftnav-component\"\n aria-label={leftNavScreenReaderInstructions}\n >\n <StyledLeftNavAreasContainer expandedWidth={expandedWidth} expanded={expandedForAnimation}>\n {loading && <LeftNavLoading expanded={expandedForAnimation} />}\n {!loading && <LeftNavInnerContent />}\n <StyledLeftNavFooterArea>\n <LeftNavFooterItem footerLabel={footerLabel} onFooterExpand={onFooterExpand} onFooterClose={onFooterClose} />\n </StyledLeftNavFooterArea>\n </StyledLeftNavAreasContainer>\n </StyledLeftNavExpandAnimationWrapper>\n );\n};\n\nexport default LeftNavContent;\n"],"names":["leftNavScreenReaderInstructions","LeftNavInnerContent","React","useContext","LeftNavContext","leftNavProps","HeaderComponent","BodyHeaderComponent","openedItem","items","selectedItem","includes","dsId","map","item","LeftNavContent","expandedForAnimation","expanded","expandedWidth","footerLabel","onFooterExpand","onFooterClose","loading"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAMA,+BAA+B,GACnC,mFACA,mEADA,GAEA,yEAFA,GAGA,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,GAAM;AAChD,2BAGIb,KAAK,CAACC,UAAN,CAAiBC,cAAjB,CAHJ;AAAA,MACEY,oBADF,sBACEA,oBADF;AAAA,iDAEEX,YAFF;AAAA,MAEkBY,QAFlB,yBAEkBA,QAFlB;AAAA,MAE4BC,aAF5B,yBAE4BA,aAF5B;AAAA,MAE2CC,WAF3C,yBAE2CA,WAF3C;AAAA,MAEwDC,cAFxD,yBAEwDA,cAFxD;AAAA,MAEwEC,aAFxE,yBAEwEA,aAFxE;AAAA,MAEuFC,OAFvF,yBAEuFA,OAFvF;;AAKA,sBACE,oBAAC,mCAAD;AACE,IAAA,aAAa,EAAEJ,aADjB;AAEE,IAAA,QAAQ,EAAED,QAFZ;AAGE,mBAAY,mBAHd;AAIE,kBAAYjB;AAJd,kBAME,oBAAC,2BAAD;AAA6B,IAAA,aAAa,EAAEkB,aAA5C;AAA2D,IAAA,QAAQ,EAAEF;AAArE,KACGM,OAAO,iBAAI,oBAAC,cAAD;AAAgB,IAAA,QAAQ,EAAEN;AAA1B,IADd,EAEG,CAACM,OAAD,iBAAY,oBAAC,mBAAD,OAFf,eAGE,oBAAC,uBAAD,qBACE,oBAAC,iBAAD;AAAmB,IAAA,WAAW,EAAEH,WAAhC;AAA6C,IAAA,cAAc,EAAEC,cAA7D;AAA6E,IAAA,aAAa,EAAEC;AAA5F,IADF,CAHF,CANF,CADF;AAgBD;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/parts/LeftNavContent/index.tsx"],"sourcesContent":["import React from 'react';\nimport { LeftNavContext } from '../../LeftNavigationContext';\nimport { LeftNavFooterItem } from '../LeftNavFooterItem';\nimport { LeftNavContentWithScrollbar } from '../LeftNavContentWithScrollbar';\nimport { OutOfTheBoxMapItem } from '../OutOfTheBoxMapItem';\nimport {\n StyledLeftNavExpandAnimationWrapper,\n StyledLeftNavAreasContainer,\n StyledLeftNavHeaderArea,\n StyledLeftNavBodyAreasContainer,\n StyledLeftNavBodyHeaderArea,\n StyledLeftNavBodyItemsArea,\n StyledLeftNavFooterArea,\n} from './styled';\nimport { LeftNavLoading } from '../LeftNavLoading';\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)}\n >\n {HeaderComponent ? <OutOfTheBoxMapItem item={HeaderComponent} /> : null}\n </StyledLeftNavHeaderArea>\n <StyledLeftNavBodyAreasContainer>\n <StyledLeftNavBodyHeaderArea\n data-testid=\"leftnav-body-header-area\"\n selected={BodyHeaderComponent && [selectedItem, openedItem].includes(BodyHeaderComponent.dsId)}\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 >\n <LeftNavContentWithScrollbar>\n {items.map((item) => (\n <OutOfTheBoxMapItem item={item} key={item.dsId} />\n ))}\n </LeftNavContentWithScrollbar>\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 } = React.useContext(LeftNavContext);\n\n return (\n <StyledLeftNavExpandAnimationWrapper\n expandedWidth={expandedWidth}\n expanded={expanded}\n data-testid=\"leftnav-component\"\n aria-label={leftNavScreenReaderInstructions}\n >\n <StyledLeftNavAreasContainer expandedWidth={expandedWidth} expanded={expandedForAnimation}>\n {loading && <LeftNavLoading expanded={expandedForAnimation} />}\n {!loading && <LeftNavInnerContent />}\n <StyledLeftNavFooterArea>\n <LeftNavFooterItem footerLabel={footerLabel} onFooterExpand={onFooterExpand} onFooterClose={onFooterClose} />\n </StyledLeftNavFooterArea>\n </StyledLeftNavAreasContainer>\n </StyledLeftNavExpandAnimationWrapper>\n );\n};\n\nexport default LeftNavContent;\n"],"names":["leftNavScreenReaderInstructions","LeftNavInnerContent","React","useContext","LeftNavContext","leftNavProps","HeaderComponent","BodyHeaderComponent","openedItem","items","withoutBodyShadow","selectedItem","includes","dsId","map","item","LeftNavContent","expandedForAnimation","expanded","expandedWidth","footerLabel","onFooterExpand","onFooterClose","loading"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAMA,+BAA+B,GACnC,mFACA,mEADA,GAEA,yEAFA,GAGA,8EAJF;;AAMA,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAsB,GAAM;AAChC,0BAGIC,KAAK,CAACC,UAAN,CAAiBC,cAAjB,CAHJ;AAAA,gDACEC,YADF;AAAA,MACkBC,eADlB,yBACkBA,eADlB;AAAA,MACmCC,mBADnC,yBACmCA,mBADnC;AAAA,MACwDC,UADxD,yBACwDA,UADxD;AAAA,MACoEC,KADpE,yBACoEA,KADpE;AAAA,MAC2EC,iBAD3E,yBAC2EA,iBAD3E;AAAA,MAEEC,YAFF,qBAEEA,YAFF;;AAIA,sBACE,uDACE,oBAAC,uBAAD;AACE,mBAAY,qBADd;AAEE,IAAA,QAAQ,EAAEL,eAAe,IAAI,CAACK,YAAD,EAAeH,UAAf,EAA2BI,QAA3B,CAAoCN,eAAe,CAACO,IAApD;AAF/B,KAIGP,eAAe,gBAAG,oBAAC,kBAAD;AAAoB,IAAA,IAAI,EAAEA;AAA1B,IAAH,GAAmD,IAJrE,CADF,eAOE,oBAAC,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AArE,KACGM,OAAO,iBAAI,oBAAC,cAAD;AAAgB,IAAA,QAAQ,EAAEN;AAA1B,IADd,EAEG,CAACM,OAAD,iBAAY,oBAAC,mBAAD,OAFf,eAGE,oBAAC,uBAAD,qBACE,oBAAC,iBAAD;AAAmB,IAAA,WAAW,EAAEH,WAAhC;AAA6C,IAAA,cAAc,EAAEC,cAA7D;AAA6E,IAAA,aAAa,EAAEC;AAA5F,IADF,CAHF,CANF,CADF;AAgBD;;;;"}
@@ -17,11 +17,11 @@ import '../outOfTheBox/ItemControlledDrilldown/styled.js';
17
17
  import '../outOfTheBox/ItemSeparator/index.js';
18
18
  import '../outOfTheBox/ItemWithDate/index.js';
19
19
  import '../outOfTheBox/ItemWithDate/styled.js';
20
+ import '../outOfTheBox/ItemTextLabel/index.js';
21
+ import '../outOfTheBox/ItemTextLabel/styled.js';
20
22
  import '../outOfTheBox/ItemUncontrolledDrilldown/index.js';
21
23
  import '@babel/runtime/helpers/esm/toConsumableArray';
22
24
  import '../outOfTheBox/ItemUncontrolledDrilldown/styled.js';
23
- import '../outOfTheBox/ItemTextLabel/index.js';
24
- import '../outOfTheBox/ItemTextLabel/styled.js';
25
25
  import '../outOfTheBox/ItemHeader/index.js';
26
26
  import '../outOfTheBox/ItemHeader/styled.js';
27
27
  import '../outOfTheBox/ItemLink/index.js';