@elliemae/ds-left-navigation 2.0.0-next.7 → 2.0.0-rc.10

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 (103) hide show
  1. package/cjs/LeftNavigationContext.js +0 -4
  2. package/cjs/common/getLeftBorderStyle.js +2 -2
  3. package/cjs/common/index.js +0 -2
  4. package/cjs/configs/useLeftNavConfig.js +13 -21
  5. package/cjs/configs/useLeftNavItems.js +7 -7
  6. package/cjs/exported-related/ChevronItem/index.js +7 -3
  7. package/cjs/exported-related/Icon/index.js +5 -0
  8. package/cjs/exported-related/ItemRenderer/index.js +4 -5
  9. package/cjs/exported-related/ItemRenderer/styled.js +27 -17
  10. package/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js +5 -0
  11. package/cjs/exported-related/Notifications/index.js +41 -41
  12. package/cjs/exported-related/OpenWindowItem/index.js +7 -3
  13. package/cjs/hooks/useExpandableOnClickHandler.js +7 -6
  14. package/cjs/hooks/useKeyboardNavigation.js +7 -7
  15. package/cjs/hooks/useOpenableOnClickHandler.js +8 -7
  16. package/cjs/hooks/useSelectFirstBodyItem.js +13 -3
  17. package/cjs/outOfTheBox/ItemControlledDrilldown/index.js +17 -16
  18. package/cjs/outOfTheBox/ItemControlledDrilldown/styled.js +7 -4
  19. package/cjs/outOfTheBox/ItemHeader/index.js +20 -13
  20. package/cjs/outOfTheBox/ItemHeader/styled.js +3 -4
  21. package/cjs/outOfTheBox/ItemLink/index.js +18 -14
  22. package/cjs/outOfTheBox/ItemSection/index.js +6 -6
  23. package/cjs/outOfTheBox/ItemSeparator/index.js +6 -6
  24. package/cjs/outOfTheBox/ItemSubmenu/index.js +12 -12
  25. package/cjs/outOfTheBox/ItemSubmenu/styled.js +3 -4
  26. package/cjs/outOfTheBox/ItemTextLabel/index.js +11 -9
  27. package/cjs/outOfTheBox/ItemTextLabel/styled.js +7 -4
  28. package/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js +12 -13
  29. package/cjs/outOfTheBox/ItemUncontrolledDrilldown/styled.js +7 -4
  30. package/cjs/outOfTheBox/ItemWithDate/index.js +9 -8
  31. package/cjs/outOfTheBox/ItemWithDate/styled.js +7 -4
  32. package/cjs/outOfTheBox/index.js +6 -6
  33. package/cjs/parts/LeftNavContent/index.js +2 -0
  34. package/cjs/parts/LeftNavContent/styled.js +9 -6
  35. package/cjs/parts/LeftNavContentWithScrollbar/index.js +6 -1
  36. package/cjs/parts/LeftNavFooterItem/index.js +2 -11
  37. package/cjs/parts/LeftNavFooterItem/styled.js +8 -9
  38. package/cjs/parts/LeftNavLoading/index.js +13 -10
  39. package/cjs/parts/OutOfTheBoxMapItem.js +5 -0
  40. package/esm/LeftNavigationContext.js +0 -4
  41. package/esm/common/getLeftBorderStyle.js +2 -2
  42. package/esm/common/index.js +0 -1
  43. package/esm/configs/useLeftNavConfig.js +13 -21
  44. package/esm/configs/useLeftNavItems.js +7 -7
  45. package/esm/exported-related/ChevronItem/index.js +7 -2
  46. package/esm/exported-related/Icon/index.js +5 -0
  47. package/esm/exported-related/ItemRenderer/index.js +4 -5
  48. package/esm/exported-related/ItemRenderer/styled.js +27 -18
  49. package/esm/exported-related/ItemRenderer/usePropsWithDefaults.js +5 -0
  50. package/esm/exported-related/Notifications/index.js +41 -37
  51. package/esm/exported-related/OpenWindowItem/index.js +7 -2
  52. package/esm/hooks/useExpandableOnClickHandler.js +7 -6
  53. package/esm/hooks/useKeyboardNavigation.js +7 -7
  54. package/esm/hooks/useOpenableOnClickHandler.js +8 -7
  55. package/esm/hooks/useSelectFirstBodyItem.js +13 -3
  56. package/esm/outOfTheBox/ItemControlledDrilldown/index.js +14 -11
  57. package/esm/outOfTheBox/ItemControlledDrilldown/styled.js +7 -4
  58. package/esm/outOfTheBox/ItemHeader/index.js +20 -13
  59. package/esm/outOfTheBox/ItemHeader/styled.js +3 -3
  60. package/esm/outOfTheBox/ItemLink/index.js +18 -14
  61. package/esm/outOfTheBox/ItemSection/index.js +6 -6
  62. package/esm/outOfTheBox/ItemSeparator/index.js +6 -6
  63. package/esm/outOfTheBox/ItemSubmenu/index.js +12 -12
  64. package/esm/outOfTheBox/ItemSubmenu/styled.js +3 -3
  65. package/esm/outOfTheBox/ItemTextLabel/index.js +11 -9
  66. package/esm/outOfTheBox/ItemTextLabel/styled.js +7 -4
  67. package/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js +11 -10
  68. package/esm/outOfTheBox/ItemUncontrolledDrilldown/styled.js +7 -4
  69. package/esm/outOfTheBox/ItemWithDate/index.js +9 -8
  70. package/esm/outOfTheBox/ItemWithDate/styled.js +7 -4
  71. package/esm/outOfTheBox/index.js +6 -6
  72. package/esm/parts/LeftNavContent/index.js +2 -0
  73. package/esm/parts/LeftNavContent/styled.js +9 -6
  74. package/esm/parts/LeftNavContentWithScrollbar/index.js +6 -1
  75. package/esm/parts/LeftNavFooterItem/index.js +1 -9
  76. package/esm/parts/LeftNavFooterItem/styled.js +3 -4
  77. package/esm/parts/LeftNavLoading/index.js +13 -10
  78. package/esm/parts/OutOfTheBoxMapItem.js +5 -0
  79. package/package.json +12 -17
  80. package/types/LeftNavigation.d.ts +43 -11
  81. package/types/LeftNavigationContext.d.ts +0 -4
  82. package/types/common/index.d.ts +0 -1
  83. package/types/exported-related/ItemRenderer/styled.d.ts +3 -2
  84. package/types/hooks/useKeyboardNavigation.d.ts +1 -1
  85. package/types/hooks/useSelectFirstBodyItem.d.ts +1 -1
  86. package/types/index.d.d.ts +5 -2
  87. package/types/outOfTheBox/ItemControlledDrilldown/styled.d.ts +2 -2
  88. package/types/outOfTheBox/ItemHeader/styled.d.ts +2 -2
  89. package/types/outOfTheBox/ItemLink/styled.d.ts +1 -1
  90. package/types/outOfTheBox/ItemSection/styled.d.ts +3 -3
  91. package/types/outOfTheBox/ItemSubmenu/styled.d.ts +2 -2
  92. package/types/outOfTheBox/ItemTextLabel/styled.d.ts +1 -1
  93. package/types/outOfTheBox/ItemUncontrolledDrilldown/styled.d.ts +2 -2
  94. package/types/outOfTheBox/ItemWithDate/styled.d.ts +2 -2
  95. package/types/parts/LeftNavContent/styled.d.ts +7 -11
  96. package/types/parts/LeftNavFooterItem/styled.d.ts +10 -6
  97. package/types/prop-types.d.ts +84 -18
  98. package/cjs/common/getFocusedByKeyboardStyle.js +0 -12
  99. package/cjs/configs/useGlobalKeyListeners.js +0 -31
  100. package/esm/common/getFocusedByKeyboardStyle.js +0 -8
  101. package/esm/configs/useGlobalKeyListeners.js +0 -22
  102. package/types/common/getFocusedByKeyboardStyle.d.ts +0 -4
  103. package/types/configs/useGlobalKeyListeners.d.ts +0 -6
@@ -1,47 +1,51 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import 'react';
3
- import InternalNotifications from '@elliemae/ds-icons/Notifications';
4
- import ExceptionsSmallFill from '@elliemae/ds-icons/ExceptionsSmallFill';
5
- import AlertsSmallFill from '@elliemae/ds-icons/AlertsSmallFill';
6
- import MessagesSmallFill from '@elliemae/ds-icons/MessagesSmallFill';
3
+ import { Notifications as Notifications$1, ExceptionsSmallFill, AlertsSmallFill, MessagesSmallFill } from '@elliemae/ds-icons';
7
4
  import styled from 'styled-components';
8
5
  import Grid from '@elliemae/ds-grid';
9
6
 
10
7
  const StyledIcon = /*#__PURE__*/styled.div.withConfig({
11
8
  componentId: "sc-hasbsd-0"
12
9
  })(["display:flex;flex-direction:column;align-items:center;"]);
13
- const Notifications = ({
14
- exceptions = false,
15
- alerts = false,
16
- messages = false
17
- }) => /*#__PURE__*/_jsx(StyledIcon, {}, void 0, /*#__PURE__*/_jsx(InternalNotifications, {
18
- size: "m",
19
- color: ['brand-primary', 800]
20
- }), (exceptions || alerts || messages) && /*#__PURE__*/_jsx(Grid, {
21
- cols: ['1fr', '1fr', '1fr'],
22
- gutter: "xxxs",
23
- mt: "2px"
24
- }, void 0, /*#__PURE__*/_jsx(Grid, {
25
- width: "6px",
26
- height: "6px"
27
- }, void 0, exceptions && /*#__PURE__*/_jsx(ExceptionsSmallFill, {
28
- width: "6px",
29
- height: "6px",
30
- color: ['warning', 900]
31
- })), /*#__PURE__*/_jsx(Grid, {
32
- width: "6px",
33
- height: "6px"
34
- }, void 0, alerts && /*#__PURE__*/_jsx(AlertsSmallFill, {
35
- width: "6px",
36
- height: "6px",
37
- color: ['danger', 900]
38
- })), /*#__PURE__*/_jsx(Grid, {
39
- width: "6px",
40
- height: "6px"
41
- }, void 0, messages && /*#__PURE__*/_jsx(MessagesSmallFill, {
42
- width: "6px",
43
- height: "6px",
44
- color: ['success', 900]
45
- }))));
10
+ const Notifications = _ref => {
11
+ let {
12
+ exceptions = false,
13
+ alerts = false,
14
+ messages = false
15
+ } = _ref;
16
+ return /*#__PURE__*/_jsx(StyledIcon, {}, void 0, /*#__PURE__*/_jsx(Notifications$1, {
17
+ size: "m",
18
+ color: ['brand-primary', 800],
19
+ "data-testid": "left-nav-notifications-icon"
20
+ }), (exceptions || alerts || messages) && /*#__PURE__*/_jsx(Grid, {
21
+ cols: ['1fr', '1fr', '1fr'],
22
+ gutter: "xxxs",
23
+ mt: "2px"
24
+ }, void 0, /*#__PURE__*/_jsx(Grid, {
25
+ width: "6px",
26
+ height: "6px",
27
+ "data-testid": "left-nav-exceptions-icon"
28
+ }, void 0, exceptions && /*#__PURE__*/_jsx(ExceptionsSmallFill, {
29
+ width: "6px",
30
+ height: "6px",
31
+ color: ['warning', 900]
32
+ })), /*#__PURE__*/_jsx(Grid, {
33
+ width: "6px",
34
+ height: "6px",
35
+ "data-testid": "left-nav-alerts-icon"
36
+ }, void 0, alerts && /*#__PURE__*/_jsx(AlertsSmallFill, {
37
+ width: "6px",
38
+ height: "6px",
39
+ color: ['danger', 900]
40
+ })), /*#__PURE__*/_jsx(Grid, {
41
+ width: "6px",
42
+ height: "6px",
43
+ "data-testid": "left-nav-messages-icon"
44
+ }, void 0, messages && /*#__PURE__*/_jsx(MessagesSmallFill, {
45
+ width: "6px",
46
+ height: "6px",
47
+ color: ['success', 900]
48
+ }))));
49
+ };
46
50
 
47
51
  export { Notifications, Notifications as default };
@@ -1,13 +1,18 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
7
  import 'react';
3
8
  import styled from 'styled-components';
4
- import InternalOpenWindow from '@elliemae/ds-icons/OpenWindow';
9
+ import { OpenWindow as OpenWindow$1 } from '@elliemae/ds-icons';
5
10
  import { jsx } from 'react/jsx-runtime';
6
11
 
7
12
  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; }
8
13
 
9
14
  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; }
10
- const StyledOpenWindow = /*#__PURE__*/styled(InternalOpenWindow).withConfig({
15
+ const StyledOpenWindow = /*#__PURE__*/styled(OpenWindow$1).withConfig({
11
16
  componentId: "sc-g53ios-0"
12
17
  })(["cursor:pointer;:focus{outline:1px solid ", ";}"], props => props.theme.colors.brand[800]);
13
18
  const OpenWindow = props => /*#__PURE__*/jsx(StyledOpenWindow, _objectSpread({
@@ -1,12 +1,13 @@
1
1
  import { useContext, useCallback } from 'react';
2
2
  import { LeftNavContext } from '../LeftNavigationContext.js';
3
3
 
4
- const useExpandableOnClickHandler = ({
5
- id,
6
- onExpand,
7
- onOpen,
8
- selectable = true
9
- }) => {
4
+ const useExpandableOnClickHandler = _ref => {
5
+ let {
6
+ id,
7
+ onExpand,
8
+ onOpen,
9
+ selectable = true
10
+ } = _ref;
10
11
  const {
11
12
  leftNavProps: {
12
13
  expanded
@@ -19,10 +19,11 @@ const nextIndex = (index, length) => (index + 1) % length;
19
19
 
20
20
  const prevIndex = (index, length) => (index - 1 + length) % length;
21
21
 
22
- const useKeyboardNavigation = ({
23
- item,
24
- onClick
25
- }) => {
22
+ const useKeyboardNavigation = _ref => {
23
+ let {
24
+ item,
25
+ onClick
26
+ } = _ref;
26
27
  const {
27
28
  dsId,
28
29
  itemOpts: {
@@ -37,7 +38,6 @@ const useKeyboardNavigation = ({
37
38
  } = useContext(LeftNavContext);
38
39
  const currentIndex = useMemo(() => visibleItems.findIndex(visibleItemDsId => visibleItemDsId === dsId), [dsId, visibleItems]);
39
40
  const {
40
- expandedForAnimation,
41
41
  setFocusedItem,
42
42
  focusedItem,
43
43
  setSelectedItem
@@ -79,7 +79,7 @@ const useKeyboardNavigation = ({
79
79
 
80
80
  if (closable && keyCode === KEY_CODES.LEFT_ARROW) {
81
81
  onClick(e);
82
- focusAndSelect(dsId);
82
+ setFocusedItem(dsId);
83
83
  }
84
84
 
85
85
  if (keyCode === KEY_CODES.DOWN_ARROW) {
@@ -99,7 +99,7 @@ const useKeyboardNavigation = ({
99
99
  if (keyCode === KEY_CODES.END) {
100
100
  setFocusedItem(visibleItems[visibleItems.length - 1]);
101
101
  }
102
- }, [dsId, expandedForAnimation, selectable, openable, closable, onClick, visibleItemsRefs, visibleItems, focusedItem, focusAndSelect]);
102
+ }, [openable, closable, selectable, focusedItem, onClick, focusAndSelect, dsId, setFocusedItem, visibleItems, currentIndex]);
103
103
  return onKeyDown;
104
104
  };
105
105
 
@@ -1,13 +1,14 @@
1
1
  import { useContext, useCallback } from 'react';
2
2
  import { LeftNavContext } from '../LeftNavigationContext.js';
3
3
 
4
- const useOpenableOnClickHandler = ({
5
- id,
6
- opened,
7
- onExpand,
8
- onOpen,
9
- onClose
10
- }) => {
4
+ const useOpenableOnClickHandler = _ref => {
5
+ let {
6
+ id,
7
+ opened,
8
+ onExpand,
9
+ onOpen,
10
+ onClose
11
+ } = _ref;
11
12
  const {
12
13
  leftNavProps: {
13
14
  expanded
@@ -1,3 +1,6 @@
1
+ import 'core-js/modules/esnext.async-iterator.some.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.some.js';
1
4
  import { useEffect } from 'react';
2
5
  import { ITEM_TYPES } from '../exported-related/constants.js';
3
6
 
@@ -10,13 +13,20 @@ const isSelectableOutOfTheBox = elem => typeof elem.type === 'string' && elem.ty
10
13
 
11
14
  const isSelectableCustom = elem => elem.itemOpts.selectable;
12
15
 
13
- const useSelectFirstBodyItem = (items, openedItem, setSelectedItem) => {
16
+ const isItemInsideTheTree = (item, itemID) => {
17
+ var _item$itemOpts, _item$itemOpts$items;
18
+
19
+ return item.dsId === itemID || (item === null || item === void 0 ? void 0 : (_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : (_item$itemOpts$items = _item$itemOpts.items) === null || _item$itemOpts$items === void 0 ? void 0 : _item$itemOpts$items.some(it => isItemInsideTheTree(it, itemID)));
20
+ };
21
+
22
+ const useSelectFirstBodyItem = (items, openedItem, selectedItem, setSelectedItem) => {
14
23
  useEffect(() => {
15
24
  if (items && items.length && openedItem) {
16
25
  const index = items.findIndex(elem => isSelectableOutOfTheBox(elem) || isSelectableCustom(elem));
17
- if (index !== -1) setSelectedItem(items[index].dsId);
26
+ const isItemInside = items.some(it => isItemInsideTheTree(it, selectedItem));
27
+ if (isItemInside) setSelectedItem(selectedItem);else if (index !== -1) setSelectedItem(items[index].dsId);
18
28
  }
19
- }, [openedItem]);
29
+ }, [openedItem, setSelectedItem]);
20
30
  };
21
31
 
22
32
  export { useSelectFirstBodyItem };
@@ -1,30 +1,32 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
8
+ import 'core-js/modules/esnext.async-iterator.map.js';
9
+ import 'core-js/modules/esnext.iterator.map.js';
3
10
  import { useMemo } from 'react';
4
11
  import Grid from '@elliemae/ds-grid';
5
12
  import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
6
- import ArrowheadRight from '@elliemae/ds-icons/ArrowheadRight';
7
- import ArrowheadDown from '@elliemae/ds-icons/ArrowheadDown';
13
+ import { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';
8
14
  import { ITEM_TYPES } from '../../exported-related/constants.js';
9
15
  import { ItemRenderer } from '../../exported-related/ItemRenderer/index.js';
10
- import '@elliemae/ds-icons/ChevronSmallRight';
11
16
  import 'react/jsx-runtime';
12
- import '@elliemae/ds-icons/Notifications';
13
- import '@elliemae/ds-icons/ExceptionsSmallFill';
14
- import '@elliemae/ds-icons/AlertsSmallFill';
15
- import '@elliemae/ds-icons/MessagesSmallFill';
16
17
  import 'styled-components';
17
- import '@elliemae/ds-icons/OpenWindow';
18
18
  import { StyledLabel, StyledDate } from './styled.js';
19
19
  import { ItemSeparator } from '../ItemSeparator/index.js';
20
20
  import { ItemWithDate } from '../ItemWithDate/index.js';
21
+ import { ItemTextLabel } from '../ItemTextLabel/index.js';
21
22
 
22
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; }
23
24
 
24
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; }
25
26
  const outOfTheBoxSubitemsComponents = {
26
27
  [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR]: ItemSeparator,
27
- [ITEM_TYPES.LEFT_NAV_ITEM_WITH_DATE]: ItemWithDate
28
+ [ITEM_TYPES.LEFT_NAV_ITEM_WITH_DATE]: ItemWithDate,
29
+ [ITEM_TYPES.LEFT_NAV_ITEM_TEXT_LABEL]: ItemTextLabel
28
30
  };
29
31
 
30
32
  const OutOfTheBoxMapSubitem = props => {
@@ -74,7 +76,8 @@ const ItemControlledDrilldown = props => {
74
76
  labelBold,
75
77
  labelColor,
76
78
  isOpened,
77
- items
79
+ items,
80
+ labelDataTestId
78
81
  }
79
82
  },
80
83
  ctx,
@@ -119,7 +122,7 @@ const ItemControlledDrilldown = props => {
119
122
  mt: "-2px"
120
123
  }, void 0, arrowIcon), /*#__PURE__*/_jsx(StyledLabel, {
121
124
  pb: "xxxs",
122
- "data-testid": "leftnav-list-item-label",
125
+ "data-testid": labelDataTestId || 'leftnav-list-item-label',
123
126
  labelOverflow: labelOverflow,
124
127
  labelBold: labelBold,
125
128
  labelColor: labelColor
@@ -3,10 +3,13 @@ import Grid from '@elliemae/ds-grid';
3
3
 
4
4
  const StyledLabel = /*#__PURE__*/styled(Grid).withConfig({
5
5
  componentId: "sc-1tjij7e-0"
6
- })(["font-size:13px;font-weight:", ";color:", ";line-height:14px;word-break:", ";"], props => props.labelBold ? props.theme.fontWeights.semibold : props.theme.fontWeights.regular, ({
7
- labelColor,
8
- theme
9
- }) => labelColor ? theme.colors[labelColor[0]][labelColor[1]] : theme.colors.neutral[800], props => props.labelOverflow === 'wrapAll' ? 'break-all' : 'normal');
6
+ })(["font-size:13px;font-weight:", ";color:", ";line-height:14px;word-break:", ";"], props => props.labelBold ? props.theme.fontWeights.semibold : props.theme.fontWeights.regular, _ref => {
7
+ let {
8
+ labelColor,
9
+ theme
10
+ } = _ref;
11
+ return labelColor ? theme.colors[labelColor[0]][labelColor[1]] : theme.colors.neutral[800];
12
+ }, props => props.labelOverflow === 'wrapAll' ? 'break-all' : 'normal');
10
13
  const StyledDate = /*#__PURE__*/styled(Grid).withConfig({
11
14
  componentId: "sc-1tjij7e-1"
12
15
  })(["font-size:12px;color:", ";line-height:14px;"], props => props.theme.colors.neutral[600]);
@@ -1,23 +1,26 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
- import 'react';
8
+ import { useCallback } from 'react';
4
9
  import Grid from '@elliemae/ds-grid';
5
10
  import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
6
11
  import { CHEVRON_BACK_DS_ID } from '../../exported-related/constants.js';
7
12
  import { ItemRenderer } from '../../exported-related/ItemRenderer/index.js';
8
- import '@elliemae/ds-icons/ChevronSmallRight';
13
+ import '@elliemae/ds-icons';
9
14
  import 'react/jsx-runtime';
10
- import '@elliemae/ds-icons/Notifications';
11
- import '@elliemae/ds-icons/ExceptionsSmallFill';
12
- import '@elliemae/ds-icons/AlertsSmallFill';
13
- import '@elliemae/ds-icons/MessagesSmallFill';
14
15
  import 'styled-components';
15
- import '@elliemae/ds-icons/OpenWindow';
16
16
  import { StyledChevronLeft, StyledLabel } from './styled.js';
17
17
 
18
18
  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; }
19
19
 
20
20
  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; }
21
+
22
+ const notOpenedShadowStyle = isSelected => theme => "\n box-shadow: inset 4px 0 0 0 ".concat(isSelected ? theme.colors.brand[400] : 'transparent', ";\n\n :hover {\n box-shadow: inset 4px 0 0 0 ").concat(isSelected ? theme.colors.brand[400] : theme.colors.brand[300], ";\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ").concat(theme.colors.brand[400], ";\n }\n");
23
+
21
24
  const ItemHeader = props => {
22
25
  var _item$itemOpts$ariaLa;
23
26
 
@@ -28,7 +31,8 @@ const ItemHeader = props => {
28
31
  itemOpts: {
29
32
  label,
30
33
  RightComponent,
31
- BottomComponent
34
+ BottomComponent,
35
+ labelDataTestId
32
36
  },
33
37
  CollapsedComponent = () => null
34
38
  },
@@ -40,12 +44,15 @@ const ItemHeader = props => {
40
44
  onItemClick
41
45
  },
42
46
  expandedForAnimation,
43
- setSelectedItem,
44
- setFocusedItem
47
+ setFocusedItem,
48
+ selectedItem,
49
+ selectedParent
45
50
  }
46
51
  } = props;
47
52
  const opened = openedItem === dsId;
48
53
  const ariaLabel = (_item$itemOpts$ariaLa = item.itemOpts.ariaLabel) !== null && _item$itemOpts$ariaLa !== void 0 ? _item$itemOpts$ariaLa : typeof label === 'string' ? label : 'menuitem';
54
+ const isSelected = selectedItem === dsId || selectedParent === dsId;
55
+ const shadowStyle = useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected)(theme) : "box-shadow: inherit", [isSelected, openedItem]);
49
56
  return /*#__PURE__*/_jsx(ItemRenderer, {
50
57
  item: _objectSpread(_objectSpread({}, item), {}, {
51
58
  itemOpts: _objectSpread(_objectSpread({
@@ -58,7 +65,8 @@ const ItemHeader = props => {
58
65
  })
59
66
  }),
60
67
  hasBorderBottom: true,
61
- borderBottomMr: opened ? '12px' : '0px'
68
+ borderBottomMr: opened ? '12px' : '0px',
69
+ shadowStyle: shadowStyle
62
70
  }, void 0, /*#__PURE__*/_jsx(Grid, {
63
71
  cols: opened ? ['auto', 'auto'] : ['38px'],
64
72
  gutter: "1px",
@@ -70,7 +78,6 @@ const ItemHeader = props => {
70
78
  color: ['brand-primary', 800],
71
79
  onClick: e => {
72
80
  onItemClick(item, e);
73
- setSelectedItem(dsId);
74
81
  },
75
82
  "data-testid": "leftnav-leftcomponent-chevron",
76
83
  tabIndex: 0,
@@ -87,7 +94,7 @@ const ItemHeader = props => {
87
94
  ml: opened ? 'xxs' : '1px',
88
95
  mt: "xxxs",
89
96
  mb: "15px",
90
- "data-testid": "leftnav-itemlabel",
97
+ "data-testid": labelDataTestId || 'leftnav-itemlabel',
91
98
  labelOverflow: labelOverflow
92
99
  }, void 0, labelOverflow === 'truncate' ? /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
93
100
  value: label,
@@ -1,12 +1,12 @@
1
1
  import Grid from '@elliemae/ds-grid';
2
- import ChevronLeft from '@elliemae/ds-icons/ChevronSmallLeft';
2
+ import { ChevronSmallLeft } from '@elliemae/ds-icons';
3
3
  import styled from 'styled-components';
4
4
 
5
5
  const StyledLabel = /*#__PURE__*/styled(Grid).withConfig({
6
6
  componentId: "sc-m5k4h8-0"
7
7
  })(["font-size:14px;color:", ";word-break:", ";"], props => props.theme.colors.neutral[800], props => props.labelOverflow === 'wrapAll' ? 'break-all' : 'normal');
8
- const StyledChevronLeft = /*#__PURE__*/styled(ChevronLeft).withConfig({
8
+ const StyledChevronLeft = /*#__PURE__*/styled(ChevronSmallLeft).withConfig({
9
9
  componentId: "sc-m5k4h8-1"
10
- })(["cursor:pointer;:focus{outline:1px solid ", ";}"], props => props.theme.colors.brand[800]);
10
+ })(["cursor:pointer;:focus{outline:2px solid ", ";}"], props => props.theme.colors.brand[800]);
11
11
 
12
12
  export { StyledChevronLeft, StyledLabel };
@@ -1,24 +1,24 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
8
  import { useCallback } from 'react';
4
9
  import Grid from '@elliemae/ds-grid';
5
10
  import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
6
11
  import { ItemRenderer } from '../../exported-related/ItemRenderer/index.js';
7
- import '@elliemae/ds-icons/ChevronSmallRight';
12
+ import '@elliemae/ds-icons';
8
13
  import 'react/jsx-runtime';
9
- import '@elliemae/ds-icons/Notifications';
10
- import '@elliemae/ds-icons/ExceptionsSmallFill';
11
- import '@elliemae/ds-icons/AlertsSmallFill';
12
- import '@elliemae/ds-icons/MessagesSmallFill';
13
14
  import 'styled-components';
14
- import '@elliemae/ds-icons/OpenWindow';
15
15
  import { StyledLabel } from './styled.js';
16
16
 
17
17
  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; }
18
18
 
19
19
  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; }
20
20
 
21
- const notOpenedShadowStyle = isSelected => theme => "\n box-shadow: inset 4px 0 0 0 ".concat(isSelected ? theme.colors.brand[400] : 'transparent', ";\n\n :hover {\n box-shadow: inset 4px 0 0 0 ").concat(isSelected ? theme.colors.brand[400] : theme.colors.neutral[300], ";\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ").concat(theme.colors.brand[400], ";\n }\n");
21
+ const notOpenedShadowStyle = isSelected => theme => "\n box-shadow: inset 4px 0 0 0 ".concat(isSelected ? theme.colors.brand[400] : 'transparent', ";\n\n :hover {\n box-shadow: inset 4px 0 0 0 ").concat(isSelected ? theme.colors.brand[400] : theme.colors.brand[300], ";\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ").concat(theme.colors.brand[400], ";\n }\n");
22
22
 
23
23
  const ItemLink = props => {
24
24
  const {
@@ -27,7 +27,8 @@ const ItemLink = props => {
27
27
  dsId,
28
28
  itemOpts: {
29
29
  label,
30
- RightComponent
30
+ RightComponent,
31
+ labelDataTestId
31
32
  },
32
33
  CollapsedComponent = () => null
33
34
  },
@@ -37,17 +38,20 @@ const ItemLink = props => {
37
38
  labelOverflow,
38
39
  openedItem
39
40
  },
40
- selectedItem
41
+ selectedItem,
42
+ selectedParent
41
43
  }
42
44
  } = props;
43
- const isSelected = selectedItem === dsId;
44
- const shadowStyle = useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected)(theme) : "box-shadow: inherit", [isSelected, !openedItem]);
45
+ const isSelected = selectedItem === dsId || selectedParent === dsId;
46
+ const shadowStyle = useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected)(theme) : "box-shadow: inherit", [isSelected, openedItem]);
45
47
  return /*#__PURE__*/_jsx(ItemRenderer, {
46
48
  item: _objectSpread(_objectSpread({}, item), {}, {
47
- itemOpts: _objectSpread({
49
+ itemOpts: _objectSpread(_objectSpread({
48
50
  ariaLabel: typeof label === 'string' ? label : '',
49
51
  ariaRole: 'link'
50
- }, item.itemOpts)
52
+ }, item.itemOpts), {}, {
53
+ selectable: true
54
+ })
51
55
  }),
52
56
  shadowStyle: shadowStyle
53
57
  }, void 0, /*#__PURE__*/_jsx(Grid, {
@@ -63,7 +67,7 @@ const ItemLink = props => {
63
67
  ml: "1px",
64
68
  mt: "xxxs",
65
69
  mb: "15px",
66
- "data-testid": "leftnav-itemlabel",
70
+ "data-testid": labelDataTestId || 'leftnav-itemlabel',
67
71
  labelOverflow: labelOverflow
68
72
  }, void 0, labelOverflow === 'truncate' ? /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
69
73
  value: label,
@@ -1,16 +1,16 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
8
  import 'react';
4
9
  import Grid from '@elliemae/ds-grid';
5
10
  import { ItemRenderer } from '../../exported-related/ItemRenderer/index.js';
6
- import '@elliemae/ds-icons/ChevronSmallRight';
11
+ import '@elliemae/ds-icons';
7
12
  import 'react/jsx-runtime';
8
- import '@elliemae/ds-icons/Notifications';
9
- import '@elliemae/ds-icons/ExceptionsSmallFill';
10
- import '@elliemae/ds-icons/AlertsSmallFill';
11
- import '@elliemae/ds-icons/MessagesSmallFill';
12
13
  import 'styled-components';
13
- import '@elliemae/ds-icons/OpenWindow';
14
14
  import { StyledLabel, StyledVerticalSeparator, StyledRightLabel } from './styled.js';
15
15
 
16
16
  var _div, _StyledVerticalSepara;
@@ -1,16 +1,16 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
8
  import 'react';
4
9
  import styled from 'styled-components';
5
10
  import { ItemRenderer } from '../../exported-related/ItemRenderer/index.js';
6
- import '@elliemae/ds-icons/ChevronSmallRight';
11
+ import '@elliemae/ds-icons';
7
12
  import 'react/jsx-runtime';
8
- import '@elliemae/ds-icons/Notifications';
9
- import '@elliemae/ds-icons/ExceptionsSmallFill';
10
- import '@elliemae/ds-icons/AlertsSmallFill';
11
- import '@elliemae/ds-icons/MessagesSmallFill';
12
13
  import '@elliemae/ds-grid';
13
- import '@elliemae/ds-icons/OpenWindow';
14
14
 
15
15
  var _StyledSeparator;
16
16
 
@@ -1,3 +1,8 @@
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
6
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
7
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
8
  import { useCallback } from 'react';
@@ -5,21 +10,16 @@ import Grid from '@elliemae/ds-grid';
5
10
  import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
6
11
  import { CHEVRON_BACK_DS_ID } from '../../exported-related/constants.js';
7
12
  import { ItemRenderer } from '../../exported-related/ItemRenderer/index.js';
8
- import '@elliemae/ds-icons/ChevronSmallRight';
13
+ import '@elliemae/ds-icons';
9
14
  import 'react/jsx-runtime';
10
- import '@elliemae/ds-icons/Notifications';
11
- import '@elliemae/ds-icons/ExceptionsSmallFill';
12
- import '@elliemae/ds-icons/AlertsSmallFill';
13
- import '@elliemae/ds-icons/MessagesSmallFill';
14
15
  import 'styled-components';
15
- import '@elliemae/ds-icons/OpenWindow';
16
16
  import { StyledChevronLeft, StyledLabel } from './styled.js';
17
17
 
18
18
  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; }
19
19
 
20
20
  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; }
21
21
 
22
- const notOpenedShadowStyle = isSelected => theme => "\n box-shadow: inset 4px 0 0 0 ".concat(isSelected ? theme.colors.brand[400] : 'transparent', ";\n\n :hover {\n box-shadow: inset 4px 0 0 0 ").concat(isSelected ? theme.colors.brand[400] : theme.colors.neutral[300], ";\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ").concat(theme.colors.brand[400], ";\n }\n");
22
+ const notOpenedShadowStyle = isSelected => theme => "\n box-shadow: inset 4px 0 0 0 ".concat(isSelected ? theme.colors.brand[400] : 'transparent', ";\n\n :hover {\n box-shadow: inset 4px 0 0 0 ").concat(isSelected ? theme.colors.brand[400] : theme.colors.brand[300], ";\n }\n\n :active {\n box-shadow: inset 4px 0 0 0 ").concat(theme.colors.brand[400], ";\n }\n");
23
23
 
24
24
  const ItemSubmenu = props => {
25
25
  var _item$itemOpts$ariaLa;
@@ -31,7 +31,8 @@ const ItemSubmenu = props => {
31
31
  itemOpts: {
32
32
  label,
33
33
  RightComponent,
34
- BottomComponent
34
+ BottomComponent,
35
+ labelDataTestId
35
36
  },
36
37
  CollapsedComponent = () => null
37
38
  },
@@ -44,13 +45,13 @@ const ItemSubmenu = props => {
44
45
  },
45
46
  expandedForAnimation,
46
47
  selectedItem,
47
- setSelectedItem,
48
+ selectedParent,
48
49
  setFocusedItem
49
50
  }
50
51
  } = props;
51
52
  const opened = openedItem === dsId;
52
53
  const isSelected = selectedItem === dsId;
53
- const shadowStyle = useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected)(theme) : "box-shadow: inherit", [isSelected, !openedItem]);
54
+ const shadowStyle = useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected || selectedParent === dsId)(theme) : "box-shadow: inherit", [dsId, isSelected, openedItem, selectedParent]);
54
55
  const ariaLabel = (_item$itemOpts$ariaLa = item.itemOpts.ariaLabel) !== null && _item$itemOpts$ariaLa !== void 0 ? _item$itemOpts$ariaLa : typeof label === 'string' ? label : 'menuitem';
55
56
  return /*#__PURE__*/_jsx(ItemRenderer, {
56
57
  item: _objectSpread(_objectSpread({}, item), {}, {
@@ -76,7 +77,6 @@ const ItemSubmenu = props => {
76
77
  color: ['brand-primary', 800],
77
78
  onClick: e => {
78
79
  onItemClick(item, e);
79
- setSelectedItem(dsId);
80
80
  },
81
81
  "data-testid": "leftnav-leftcomponent-chevron",
82
82
  tabIndex: 0,
@@ -93,7 +93,7 @@ const ItemSubmenu = props => {
93
93
  ml: opened ? 'xxs' : '1px',
94
94
  mt: "xxxs",
95
95
  mb: "15px",
96
- "data-testid": "leftnav-itemlabel",
96
+ "data-testid": labelDataTestId || 'leftnav-itemlabel',
97
97
  labelOverflow: labelOverflow
98
98
  }, void 0, labelOverflow === 'truncate' ? /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
99
99
  value: label,
@@ -1,12 +1,12 @@
1
1
  import Grid from '@elliemae/ds-grid';
2
- import ChevronLeft from '@elliemae/ds-icons/ChevronSmallLeft';
2
+ import { ChevronSmallLeft } from '@elliemae/ds-icons';
3
3
  import styled from 'styled-components';
4
4
 
5
5
  const StyledLabel = /*#__PURE__*/styled(Grid).withConfig({
6
6
  componentId: "sc-1hegp8y-0"
7
7
  })(["font-size:14px;color:", ";word-break:", ";"], props => props.theme.colors.neutral[800], props => props.labelOverflow === 'wrapAll' ? 'break-all' : 'normal');
8
- const StyledChevronLeft = /*#__PURE__*/styled(ChevronLeft).withConfig({
8
+ const StyledChevronLeft = /*#__PURE__*/styled(ChevronSmallLeft).withConfig({
9
9
  componentId: "sc-1hegp8y-1"
10
- })(["cursor:pointer;:focus{outline:1px solid ", ";}"], props => props.theme.colors.brand[800]);
10
+ })(["cursor:pointer;:focus{outline:2px solid ", ";}"], props => props.theme.colors.brand[700]);
11
11
 
12
12
  export { StyledChevronLeft, StyledLabel };