@elliemae/ds-left-navigation 2.0.0-next.9 → 2.0.0-rc.12

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 (105) 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 +6 -7
  9. package/cjs/exported-related/ItemRenderer/styled.js +27 -17
  10. package/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js +8 -2
  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 +14 -4
  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 +5 -2
  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/cjs/prop-types.js +2 -1
  41. package/esm/LeftNavigationContext.js +0 -4
  42. package/esm/common/getLeftBorderStyle.js +2 -2
  43. package/esm/common/index.js +0 -1
  44. package/esm/configs/useLeftNavConfig.js +13 -21
  45. package/esm/configs/useLeftNavItems.js +7 -7
  46. package/esm/exported-related/ChevronItem/index.js +7 -2
  47. package/esm/exported-related/Icon/index.js +5 -0
  48. package/esm/exported-related/ItemRenderer/index.js +6 -7
  49. package/esm/exported-related/ItemRenderer/styled.js +27 -18
  50. package/esm/exported-related/ItemRenderer/usePropsWithDefaults.js +8 -2
  51. package/esm/exported-related/Notifications/index.js +41 -37
  52. package/esm/exported-related/OpenWindowItem/index.js +7 -2
  53. package/esm/hooks/useExpandableOnClickHandler.js +7 -6
  54. package/esm/hooks/useKeyboardNavigation.js +7 -7
  55. package/esm/hooks/useOpenableOnClickHandler.js +8 -7
  56. package/esm/hooks/useSelectFirstBodyItem.js +14 -4
  57. package/esm/outOfTheBox/ItemControlledDrilldown/index.js +14 -11
  58. package/esm/outOfTheBox/ItemControlledDrilldown/styled.js +7 -4
  59. package/esm/outOfTheBox/ItemHeader/index.js +20 -13
  60. package/esm/outOfTheBox/ItemHeader/styled.js +3 -3
  61. package/esm/outOfTheBox/ItemLink/index.js +18 -14
  62. package/esm/outOfTheBox/ItemSection/index.js +6 -6
  63. package/esm/outOfTheBox/ItemSeparator/index.js +6 -6
  64. package/esm/outOfTheBox/ItemSubmenu/index.js +12 -12
  65. package/esm/outOfTheBox/ItemSubmenu/styled.js +3 -3
  66. package/esm/outOfTheBox/ItemTextLabel/index.js +11 -9
  67. package/esm/outOfTheBox/ItemTextLabel/styled.js +7 -4
  68. package/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js +11 -10
  69. package/esm/outOfTheBox/ItemUncontrolledDrilldown/styled.js +7 -4
  70. package/esm/outOfTheBox/ItemWithDate/index.js +9 -8
  71. package/esm/outOfTheBox/ItemWithDate/styled.js +7 -4
  72. package/esm/outOfTheBox/index.js +6 -6
  73. package/esm/parts/LeftNavContent/index.js +5 -2
  74. package/esm/parts/LeftNavContent/styled.js +9 -6
  75. package/esm/parts/LeftNavContentWithScrollbar/index.js +6 -1
  76. package/esm/parts/LeftNavFooterItem/index.js +1 -9
  77. package/esm/parts/LeftNavFooterItem/styled.js +3 -4
  78. package/esm/parts/LeftNavLoading/index.js +13 -10
  79. package/esm/parts/OutOfTheBoxMapItem.js +5 -0
  80. package/esm/prop-types.js +2 -1
  81. package/package.json +12 -17
  82. package/types/LeftNavigation.d.ts +46 -11
  83. package/types/LeftNavigationContext.d.ts +0 -4
  84. package/types/common/index.d.ts +0 -1
  85. package/types/exported-related/ItemRenderer/styled.d.ts +3 -2
  86. package/types/hooks/useKeyboardNavigation.d.ts +1 -1
  87. package/types/hooks/useSelectFirstBodyItem.d.ts +1 -1
  88. package/types/index.d.d.ts +7 -2
  89. package/types/outOfTheBox/ItemControlledDrilldown/styled.d.ts +2 -2
  90. package/types/outOfTheBox/ItemHeader/styled.d.ts +2 -2
  91. package/types/outOfTheBox/ItemLink/styled.d.ts +1 -1
  92. package/types/outOfTheBox/ItemSection/styled.d.ts +3 -3
  93. package/types/outOfTheBox/ItemSubmenu/styled.d.ts +2 -2
  94. package/types/outOfTheBox/ItemTextLabel/styled.d.ts +1 -1
  95. package/types/outOfTheBox/ItemUncontrolledDrilldown/styled.d.ts +2 -2
  96. package/types/outOfTheBox/ItemWithDate/styled.d.ts +2 -2
  97. package/types/parts/LeftNavContent/styled.d.ts +7 -11
  98. package/types/parts/LeftNavFooterItem/styled.d.ts +10 -6
  99. package/types/prop-types.d.ts +87 -18
  100. package/cjs/common/getFocusedByKeyboardStyle.js +0 -12
  101. package/cjs/configs/useGlobalKeyListeners.js +0 -31
  102. package/esm/common/getFocusedByKeyboardStyle.js +0 -8
  103. package/esm/configs/useGlobalKeyListeners.js +0 -22
  104. package/types/common/getFocusedByKeyboardStyle.d.ts +0 -4
  105. package/types/configs/useGlobalKeyListeners.d.ts +0 -6
@@ -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(opened => theme => !opened ? notOpenedShadowStyle(isSelected || selectedParent === dsId)(theme) : "box-shadow: inset 4px 0 0 0 #52A6EC", [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 };
@@ -1,17 +1,17 @@
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 { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
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
14
  import '@elliemae/ds-grid';
14
- import '@elliemae/ds-icons/OpenWindow';
15
15
  import { StyledLabel } from './styled.js';
16
16
 
17
17
  var _div;
@@ -27,7 +27,8 @@ const ItemTextLabel = props => {
27
27
  label,
28
28
  labelOverflow: itemLabelOverflow,
29
29
  labelBold,
30
- labelColor
30
+ labelColor,
31
+ labelDataTestId
31
32
  }
32
33
  },
33
34
  ctx: {
@@ -44,12 +45,13 @@ const ItemTextLabel = props => {
44
45
  minHeight: "32px",
45
46
  paddingTop: "8px"
46
47
  }, void 0, " ", _div || (_div = /*#__PURE__*/_jsx("div", {})), /*#__PURE__*/_jsx(StyledLabel, {
47
- "data-testid": "leftnav-list-item-label",
48
+ "data-testid": labelDataTestId || 'leftnav-list-item-label',
48
49
  pl: "24px",
49
50
  labelOverflow: labelOverflow,
50
51
  labelBold: labelBold,
51
52
  labelColor: labelColor,
52
- mr: "xxs2"
53
+ mr: "xxs2",
54
+ pb: "xxxs"
53
55
  }, void 0, labelOverflow === 'truncate' ? /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
54
56
  value: label,
55
57
  placement: "bottom-start"
@@ -3,9 +3,12 @@ import Grid from '@elliemae/ds-grid';
3
3
 
4
4
  const StyledLabel = /*#__PURE__*/styled(Grid).withConfig({
5
5
  componentId: "sc-1v26p1i-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
 
11
14
  export { StyledLabel };
@@ -1,21 +1,21 @@
1
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
2
+ import 'core-js/modules/esnext.iterator.for-each.js';
1
3
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
4
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
5
  import 'core-js/modules/web.dom-collections.iterator.js';
6
+ import 'core-js/modules/esnext.async-iterator.map.js';
7
+ import 'core-js/modules/esnext.iterator.map.js';
8
+ import 'core-js/modules/esnext.async-iterator.filter.js';
9
+ import 'core-js/modules/esnext.iterator.constructor.js';
10
+ import 'core-js/modules/esnext.iterator.filter.js';
4
11
  import { useEffect, useMemo, useCallback } from 'react';
5
12
  import Grid from '@elliemae/ds-grid';
6
13
  import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
7
- import ArrowheadRight from '@elliemae/ds-icons/ArrowheadRight';
8
- import ArrowheadDown from '@elliemae/ds-icons/ArrowheadDown';
14
+ import { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';
9
15
  import { ITEM_TYPES } from '../../exported-related/constants.js';
10
16
  import { ItemRenderer } from '../../exported-related/ItemRenderer/index.js';
11
- import '@elliemae/ds-icons/ChevronSmallRight';
12
17
  import 'react/jsx-runtime';
13
- import '@elliemae/ds-icons/Notifications';
14
- import '@elliemae/ds-icons/ExceptionsSmallFill';
15
- import '@elliemae/ds-icons/AlertsSmallFill';
16
- import '@elliemae/ds-icons/MessagesSmallFill';
17
18
  import 'styled-components';
18
- import '@elliemae/ds-icons/OpenWindow';
19
19
  import { StyledLabel, StyledDate } from './styled.js';
20
20
  import { ItemSeparator } from '../ItemSeparator/index.js';
21
21
  import { ItemWithDate } from '../ItemWithDate/index.js';
@@ -79,7 +79,8 @@ const ItemUncontrolledDrilldown = props => {
79
79
  labelBold,
80
80
  labelColor,
81
81
  startOpened,
82
- items
82
+ items,
83
+ labelDataTestId
83
84
  }
84
85
  },
85
86
  ctx,
@@ -136,7 +137,7 @@ const ItemUncontrolledDrilldown = props => {
136
137
  mt: "-2px"
137
138
  }, void 0, arrowIcon), /*#__PURE__*/_jsx(StyledLabel, {
138
139
  pb: "xxxs",
139
- "data-testid": "leftnav-list-item-label",
140
+ "data-testid": labelDataTestId || 'leftnav-list-item-label',
140
141
  labelOverflow: labelOverflow,
141
142
  labelBold: labelBold,
142
143
  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-17rk89j-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-17rk89j-1"
12
15
  })(["font-size:12px;color:", ";line-height:14px;"], props => props.theme.colors.neutral[600]);
@@ -1,17 +1,17 @@
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 { 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, StyledDate } from './styled.js';
16
16
 
17
17
  var _div;
@@ -29,7 +29,8 @@ const ItemWithDate = props => {
29
29
  labelRightSection,
30
30
  labelOverflow: itemLabelOverflow,
31
31
  labelBold,
32
- labelColor
32
+ labelColor,
33
+ labelDataTestId
33
34
  }
34
35
  },
35
36
  ctx,
@@ -49,7 +50,7 @@ const ItemWithDate = props => {
49
50
  }, void 0, " ", _div || (_div = /*#__PURE__*/_jsx("div", {})), /*#__PURE__*/_jsx(StyledLabel, {
50
51
  pl: "xxs",
51
52
  pb: "xxxs",
52
- "data-testid": "leftnav-list-item-label",
53
+ "data-testid": labelDataTestId || 'leftnav-list-item-label',
53
54
  labelOverflow: labelOverflow,
54
55
  labelBold: labelBold,
55
56
  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-govmsc-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-govmsc-1"
12
15
  })(["font-size:12px;color:", ";line-height:14px;"], props => props.theme.colors.neutral[600]);
@@ -3,14 +3,14 @@ import '@babel/runtime/helpers/esm/jsx';
3
3
  import 'react';
4
4
  import '@elliemae/ds-grid';
5
5
  import 'styled-components';
6
+ import 'core-js/modules/esnext.async-iterator.filter.js';
7
+ import 'core-js/modules/esnext.iterator.constructor.js';
8
+ import 'core-js/modules/esnext.iterator.filter.js';
9
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
10
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
11
  import '@babel/runtime/helpers/esm/defineProperty';
7
12
  import 'react/jsx-runtime';
8
- import '@elliemae/ds-icons/ChevronSmallRight';
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
- import '@elliemae/ds-icons/OpenWindow';
13
+ import '@elliemae/ds-icons';
14
14
  import { ItemControlledDrilldown } from './ItemControlledDrilldown/index.js';
15
15
  export { ItemControlledDrilldown } from './ItemControlledDrilldown/index.js';
16
16
  import { ItemUncontrolledDrilldown } from './ItemUncontrolledDrilldown/index.js';
@@ -1,4 +1,6 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'core-js/modules/esnext.async-iterator.map.js';
3
+ import 'core-js/modules/esnext.iterator.map.js';
2
4
  import React from 'react';
3
5
  import { LeftNavContext } from '../../LeftNavigationContext.js';
4
6
  import { LeftNavFooterItem } from '../LeftNavFooterItem/index.js';
@@ -17,7 +19,8 @@ const LeftNavInnerContent = () => {
17
19
  HeaderComponent,
18
20
  BodyHeaderComponent,
19
21
  openedItem,
20
- items
22
+ items,
23
+ withoutBodyShadow
21
24
  },
22
25
  selectedItem
23
26
  } = React.useContext(LeftNavContext);
@@ -33,7 +36,7 @@ const LeftNavInnerContent = () => {
33
36
  }, void 0, BodyHeaderComponent ? /*#__PURE__*/_jsx(OutOfTheBoxMapItem, {
34
37
  item: BodyHeaderComponent
35
38
  }) : null), /*#__PURE__*/_jsx(StyledLeftNavBodyItemsArea, {
36
- selected: openedItem !== null,
39
+ selected: !withoutBodyShadow && openedItem !== null,
37
40
  "data-testid": "leftnav-body-items-area",
38
41
  tabIndex: -1
39
42
  }, void 0, /*#__PURE__*/_jsx(LeftNavContentWithScrollbar, {}, void 0, items.map(item => /*#__PURE__*/_jsx(OutOfTheBoxMapItem, {
@@ -1,11 +1,14 @@
1
1
  import styled from 'styled-components';
2
2
 
3
- const getLeftShadowStyles = ({
4
- selected,
5
- theme
6
- }) => {
7
- if (!selected) {
8
- return "\n box-shadow: inset 4px 0 0 0 transparent;\n :hover {\n box-shadow: inset 4px 0 0 0 ".concat(theme.colors.neutral[300], ";\n }\n :active {\n box-shadow: inset 4px 0 0 0 ").concat(theme.colors.brand[400], ";\n }\n ");
3
+ const getLeftShadowStyles = _ref => {
4
+ let {
5
+ selected,
6
+ selectedParent,
7
+ theme
8
+ } = _ref;
9
+
10
+ if (!selected && !selectedParent) {
11
+ return "\n box-shadow: inset 4px 0 0 0 transparent;\n :hover {\n box-shadow: inset 4px 0 0 0 ".concat(theme.colors.brand[300], ";\n }\n :active {\n box-shadow: inset 4px 0 0 0 ").concat(theme.colors.brand[400], ";\n }\n ");
9
12
  }
10
13
 
11
14
  return "box-shadow: inset 4px 0 0 0 ".concat(theme.colors.brand[400], ";");
@@ -1,9 +1,14 @@
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 'core-js/modules/web.dom-collections.iterator.js';
4
9
  import { useState, useRef, useEffect } from 'react';
5
- import OverlayScrollbars from 'overlayscrollbars';
6
10
  import 'overlayscrollbars/css/OverlayScrollbars.css';
11
+ import OverlayScrollbars from 'overlayscrollbars';
7
12
  import styled from 'styled-components';
8
13
  import { jsxs } from 'react/jsx-runtime';
9
14
 
@@ -1,6 +1,6 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import { useContext } from 'react';
3
- import MenuExpand from '@elliemae/ds-icons/MenuExpand';
3
+ import { MenuExpand } from '@elliemae/ds-icons';
4
4
  import Grid from '@elliemae/ds-grid';
5
5
  import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
6
6
  import { StyledFooterMenu, StyledItemWrapper, StyledItem, StyledLabel, StyledSeparator, StyledMenuCollapse } from './styled.js';
@@ -23,9 +23,7 @@ const LeftNavFooterItem = props => {
23
23
  },
24
24
  expandedForAnimation,
25
25
  setSelectedItem,
26
- focusedItem,
27
26
  setFocusedItem,
28
- focusedByKey,
29
27
  visibleItemsRefs
30
28
  } = useContext(LeftNavContext);
31
29
  const id = FOOTER_DS_ID;
@@ -54,8 +52,6 @@ const LeftNavFooterItem = props => {
54
52
  cols: expandedForAnimation ? ['auto', '1fr', 'auto'] : ['38px'],
55
53
  onClick: expandedForAnimation ? () => null : handleOnClick,
56
54
  onKeyDown: onKeyDown,
57
- focused: focusedItem === id,
58
- focusedByKey: focusedByKey,
59
55
  onFocus: () => setFocusedItem(id),
60
56
  "data-testid": "leftnav-item-container",
61
57
  role: "menuitem",
@@ -83,13 +79,9 @@ const LeftNavFooterItem = props => {
83
79
  size: "m",
84
80
  color: ['brand-primary', 800],
85
81
  onClick: e => {
86
- if (openedItem) setSelectedItem(openedItem);
87
82
  e.stopPropagation();
88
83
  handleOnClick(e);
89
84
  },
90
- onKeyDown: e => {
91
- if (['Space', 'Enter'].includes(e.code) && openedItem) setSelectedItem(openedItem);
92
- },
93
85
  "data-testid": "leftnav-footer-btn",
94
86
  tabIndex: 0,
95
87
  onFocus: e => {
@@ -1,7 +1,6 @@
1
1
  import styled from 'styled-components';
2
- import { Grid } from '@elliemae/ds-basic';
2
+ import { Grid } from '@elliemae/ds-grid';
3
3
  import { MenuCollapse } from '@elliemae/ds-icons';
4
- import { getFocusedByKeyboardBorderStyle } from '../../common/getFocusedByKeyboardStyle.js';
5
4
  import { getItemBackgroundStyle } from '../../common/getItemBackgroundStyle.js';
6
5
  import { getLeftBorderStyle } from '../../common/getLeftBorderStyle.js';
7
6
 
@@ -13,7 +12,7 @@ const StyledItemWrapper = /*#__PURE__*/styled(Grid).withConfig({
13
12
  })(["position:relative;padding-left:", ";"], props => props.theme.space.xxxs);
14
13
  const StyledItem = /*#__PURE__*/styled(Grid).withConfig({
15
14
  componentId: "sc-1mcbjxr-2"
16
- })(["min-height:48px;cursor:", ";", " outline:none;", ""], props => props.expanded ? 'auto' : 'pointer', getItemBackgroundStyle, getFocusedByKeyboardBorderStyle);
15
+ })(["min-height:48px;cursor:", ";", " outline:none;:focus{&:before{content:'';position:absolute;height:100%;width:100%;top:0;left:0px;border:2px solid ", ";pointer-events:none;}}"], props => props.expanded ? 'auto' : 'pointer', getItemBackgroundStyle, props => props.theme.colors.brand[600]);
17
16
  const StyledLabel = /*#__PURE__*/styled(Grid).withConfig({
18
17
  componentId: "sc-1mcbjxr-3"
19
18
  })(["font-size:11px;color:", ";line-height:14px;word-break:", ";"], props => props.theme.colors.neutral[500], props => props.labelOverflow === 'wrapAll' ? 'break-all' : 'normal');
@@ -22,6 +21,6 @@ const StyledSeparator = /*#__PURE__*/styled(Grid).withConfig({
22
21
  })(["height:16px;width:1px;background-color:", ";"], props => props.theme.colors.neutral[100]);
23
22
  const StyledMenuCollapse = /*#__PURE__*/styled(MenuCollapse).withConfig({
24
23
  componentId: "sc-1mcbjxr-5"
25
- })(["cursor:pointer;:focus{outline:1px solid ", ";}"], props => props.theme.colors.brand[800]);
24
+ })(["cursor:pointer;:focus{outline:2px solid ", ";}"], props => props.theme.colors.brand[700]);
26
25
 
27
26
  export { StyledFooterMenu, StyledItem, StyledItemWrapper, StyledLabel, StyledMenuCollapse, StyledSeparator };
@@ -1,20 +1,23 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import 'react';
3
- import DSCircularProgressIndicator from '@elliemae/ds-basic/CircularProgressIndicator';
3
+ import DSCircularProgressIndicator from '@elliemae/ds-circular-progress-indicator';
4
4
  import Grid from '@elliemae/ds-grid';
5
5
  import styled from 'styled-components';
6
6
 
7
7
  const StyledLoaderWrapper = /*#__PURE__*/styled(Grid).withConfig({
8
8
  componentId: "sc-mqgtxd-0"
9
9
  })(["grid-area:left-nav-body;height:100%;place-items:center;z-index:0;background-color:white;"]);
10
- const LeftNavLoading = ({
11
- expanded
12
- }) => /*#__PURE__*/_jsx(StyledLoaderWrapper, {}, void 0, /*#__PURE__*/_jsx(DSCircularProgressIndicator, {
13
- size: expanded ? 'xl' : 'm',
14
- loading: true,
15
- showLabel: expanded,
16
- waiting: false,
17
- showTooltip: !expanded
18
- }));
10
+ const LeftNavLoading = _ref => {
11
+ let {
12
+ expanded
13
+ } = _ref;
14
+ return /*#__PURE__*/_jsx(StyledLoaderWrapper, {}, void 0, /*#__PURE__*/_jsx(DSCircularProgressIndicator, {
15
+ size: expanded ? 'xl' : 'm',
16
+ loading: true,
17
+ showLabel: expanded,
18
+ waiting: false,
19
+ showTooltip: !expanded
20
+ }));
21
+ };
19
22
 
20
23
  export { LeftNavLoading };
@@ -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 React from 'react';
package/esm/prop-types.js CHANGED
@@ -23,7 +23,8 @@ const leftNavigationProps = {
23
23
  onFooterClose: PropTypes.func.description('The function to call when the left-nav is closed via the footer'),
24
24
  onSelectedChange: PropTypes.func.description('A callback which triggers when the selected item changes').defaultValue(() => null),
25
25
  onFocusChange: PropTypes.func.description('A callback which triggers when the focused item changes').defaultValue(() => null),
26
- items: PropTypes.arrayOf(PropTypes.object).description('The array of items you want to render inside the left nav').defaultValue([])
26
+ items: PropTypes.arrayOf(PropTypes.object).description('The array of items you want to render inside the left nav').defaultValue([]),
27
+ disableDefaultSelection: PropTypes.bool.description('Whether you do not want to automatically select the first body item').defaultValue(false)
27
28
  };
28
29
 
29
30
  const LeftNavItemProps = () => null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-left-navigation",
3
- "version": "2.0.0-next.9",
3
+ "version": "2.0.0-rc.12",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Left Navigation",
6
6
  "module": "./esm/index.js",
@@ -191,10 +191,6 @@
191
191
  "import": "./esm/configs/useLeftNavConfig.js",
192
192
  "require": "./cjs/configs/useLeftNavConfig.js"
193
193
  },
194
- "./configs/useGlobalKeyListeners": {
195
- "import": "./esm/configs/useGlobalKeyListeners.js",
196
- "require": "./cjs/configs/useGlobalKeyListeners.js"
197
- },
198
194
  "./configs": {
199
195
  "import": "./esm/configs/index.js",
200
196
  "require": "./cjs/configs/index.js"
@@ -214,10 +210,6 @@
214
210
  "./common/getItemBackgroundStyle": {
215
211
  "import": "./esm/common/getItemBackgroundStyle.js",
216
212
  "require": "./cjs/common/getItemBackgroundStyle.js"
217
- },
218
- "./common/getFocusedByKeyboardStyle": {
219
- "import": "./esm/common/getFocusedByKeyboardStyle.js",
220
- "require": "./cjs/common/getFocusedByKeyboardStyle.js"
221
213
  }
222
214
  },
223
215
  "repository": {
@@ -241,21 +233,24 @@
241
233
  "generateSubmodules": true
242
234
  },
243
235
  "dependencies": {
244
- "@elliemae/ds-basic": "2.0.0-next.9",
245
- "@elliemae/ds-icons": "2.0.0-next.9",
246
- "@elliemae/ds-system": "2.0.0-next.9",
247
- "overlayscrollbars": "^1.13.1",
236
+ "@elliemae/ds-circular-progress-indicator": "2.0.0-rc.12",
237
+ "@elliemae/ds-grid": "2.0.0-rc.12",
238
+ "@elliemae/ds-icons": "2.0.0-rc.12",
239
+ "@elliemae/ds-system": "2.0.0-rc.12",
240
+ "@elliemae/ds-truncated-tooltip-text": "2.0.0-rc.12",
241
+ "overlayscrollbars": "1.13.1",
248
242
  "prop-types": "~15.7.2",
249
- "react-virtual": "~2.3.2",
250
- "tree-model": "~1.0.7"
243
+ "react-desc": "~4.1.3"
251
244
  },
252
245
  "devDependencies": {
253
- "styled-components": "~5.3.1"
246
+ "@testing-library/react": "~12.1.2",
247
+ "@testing-library/user-event": "~13.5.0",
248
+ "styled-components": "~5.3.3"
254
249
  },
255
250
  "peerDependencies": {
256
251
  "lodash": "^4.17.21",
257
252
  "react": "~17.0.2",
258
253
  "react-dom": "^17.0.2",
259
- "styled-components": "^5.3.1"
254
+ "styled-components": "^5.3.3"
260
255
  }
261
256
  }
@@ -1,19 +1,54 @@
1
+ /// <reference path="../../../../shared/typings/react-desc.d.ts" />
1
2
  /// <reference types="react" />
2
3
  import type { LeftNavProps } from './index.d';
3
4
  export declare const LeftNavigation: {
4
5
  (props: LeftNavProps): JSX.Element;
5
6
  propTypes: {
6
- containerProps: any;
7
- expanded: any;
8
- loading: any;
9
- tabIndex: any;
10
- openedItem: any;
11
- footerLabel: any;
12
- onFooterExpand: any;
13
- onFooterClose: any;
14
- onSelectedChange: any;
15
- onFocusChange: any;
16
- items: any;
7
+ containerProps: {
8
+ deprecated: import("react-desc").PropTypesDescValidator;
9
+ };
10
+ expanded: {
11
+ deprecated: import("react-desc").PropTypesDescValidator;
12
+ };
13
+ loading: {
14
+ deprecated: import("react-desc").PropTypesDescValidator;
15
+ };
16
+ tabIndex: {
17
+ deprecated: import("react-desc").PropTypesDescValidator;
18
+ };
19
+ openedItem: {
20
+ deprecated: import("react-desc").PropTypesDescValidator;
21
+ };
22
+ footerLabel: {
23
+ defaultValue<T = unknown>(arg: T): {
24
+ deprecated: import("react-desc").PropTypesDescValidator;
25
+ };
26
+ isRequired: import("react-desc").PropTypesDescValidator;
27
+ };
28
+ onFooterExpand: {
29
+ defaultValue<T = unknown>(arg: T): {
30
+ deprecated: import("react-desc").PropTypesDescValidator;
31
+ };
32
+ isRequired: import("react-desc").PropTypesDescValidator;
33
+ };
34
+ onFooterClose: {
35
+ defaultValue<T = unknown>(arg: T): {
36
+ deprecated: import("react-desc").PropTypesDescValidator;
37
+ };
38
+ isRequired: import("react-desc").PropTypesDescValidator;
39
+ };
40
+ onSelectedChange: {
41
+ deprecated: import("react-desc").PropTypesDescValidator;
42
+ };
43
+ onFocusChange: {
44
+ deprecated: import("react-desc").PropTypesDescValidator;
45
+ };
46
+ items: {
47
+ deprecated: import("react-desc").PropTypesDescValidator;
48
+ };
49
+ disableDefaultSelection: {
50
+ deprecated: import("react-desc").PropTypesDescValidator;
51
+ };
17
52
  };
18
53
  defaultProps: LeftNavProps;
19
54
  };