@elliemae/ds-left-navigation 2.0.0-alpha.10 → 2.0.0-alpha.11
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.
- package/cjs/common/getFocusedByKeyboardStyle.js +1 -12
- package/cjs/common/getItemBackgroundStyle.js +1 -12
- package/cjs/common/getLeftBorderStyle.js +1 -15
- package/cjs/common/getScrollbarStyle.js +1 -24
- package/cjs/configs/useLeftNavConfig.js +1 -0
- package/cjs/configs/useLeftNavItems.js +4 -4
- package/cjs/exported-related/ItemRenderer/index.js +5 -3
- package/cjs/exported-related/ItemRenderer/styled.js +1 -11
- package/cjs/exported-related/ItemRenderer/usePropsWithDefaults.js +2 -1
- package/cjs/index.js +0 -1
- package/cjs/outOfTheBox/ItemControlledDrilldown/index.js +2 -2
- package/cjs/outOfTheBox/ItemHeader/index.js +4 -2
- package/cjs/outOfTheBox/ItemLink/index.js +2 -12
- package/cjs/outOfTheBox/ItemSection/index.js +1 -2
- package/cjs/outOfTheBox/ItemSubmenu/index.js +6 -14
- package/cjs/outOfTheBox/ItemUncontrolledDrilldown/index.js +3 -2
- package/cjs/parts/LeftNavContent/styled.js +3 -11
- package/cjs/parts/LeftNavContentWithScrollbar/index.js +2 -0
- package/cjs/parts/LeftNavFooterItem/index.js +1 -1
- package/esm/common/getFocusedByKeyboardStyle.js +1 -12
- package/esm/common/getItemBackgroundStyle.js +1 -12
- package/esm/common/getLeftBorderStyle.js +1 -15
- package/esm/common/getScrollbarStyle.js +1 -24
- package/esm/configs/useLeftNavConfig.js +1 -0
- package/esm/configs/useLeftNavItems.js +4 -4
- package/esm/exported-related/ItemRenderer/index.js +5 -3
- package/esm/exported-related/ItemRenderer/styled.js +1 -11
- package/esm/exported-related/ItemRenderer/usePropsWithDefaults.js +2 -1
- package/esm/index.js +0 -1
- package/esm/outOfTheBox/ItemControlledDrilldown/index.js +2 -2
- package/esm/outOfTheBox/ItemHeader/index.js +4 -2
- package/esm/outOfTheBox/ItemLink/index.js +2 -12
- package/esm/outOfTheBox/ItemSection/index.js +1 -2
- package/esm/outOfTheBox/ItemSubmenu/index.js +6 -14
- package/esm/outOfTheBox/ItemUncontrolledDrilldown/index.js +3 -2
- package/esm/parts/LeftNavContent/styled.js +3 -11
- package/esm/parts/LeftNavContentWithScrollbar/index.js +2 -0
- package/esm/parts/LeftNavFooterItem/index.js +1 -1
- package/package.json +5 -4
- package/types/index.d.d.ts +1 -0
- package/types/index.d.ts +1 -2
- package/types/parts/LeftNavContentWithScrollbar/index.d.ts +1 -0
- package/types/parts/LeftNavFooterItem/styled.d.ts +1 -1
- package/cjs/package.json +0 -4
- package/esm/package.json +0 -4
|
@@ -2,18 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const commonFocusedByKeyboardBorder = (props, height, width) =>
|
|
6
|
-
&:before {
|
|
7
|
-
content: '';
|
|
8
|
-
position: absolute;
|
|
9
|
-
height: ${height};
|
|
10
|
-
width: ${width};
|
|
11
|
-
top: 0;
|
|
12
|
-
left: 0px;
|
|
13
|
-
border: 1px solid ${props.theme.colors.brand[600]};
|
|
14
|
-
pointer-events: none;
|
|
15
|
-
}
|
|
16
|
-
`;
|
|
5
|
+
const commonFocusedByKeyboardBorder = (props, height, width) => "\n &:before {\n content: '';\n position: absolute;\n height: ".concat(height, ";\n width: ").concat(width, ";\n top: 0;\n left: 0px;\n border: 1px solid ").concat(props.theme.colors.brand[600], ";\n pointer-events: none;\n }\n");
|
|
17
6
|
|
|
18
7
|
const getFocusedByKeyboardBorderStyle = (props, height = '100%', width = '100%') => {
|
|
19
8
|
if (props.focused && props.focusedByKey) return commonFocusedByKeyboardBorder(props, height, width);
|
|
@@ -2,18 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const commonItemBackgroundStyle = (color, hoverColor, activeColor) =>
|
|
6
|
-
|
|
7
|
-
background: ${color};
|
|
8
|
-
|
|
9
|
-
:hover {
|
|
10
|
-
background: ${hoverColor};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
:active {
|
|
14
|
-
background: ${activeColor};
|
|
15
|
-
}
|
|
16
|
-
`;
|
|
5
|
+
const commonItemBackgroundStyle = (color, hoverColor, activeColor) => "\n\n background: ".concat(color, ";\n\n :hover {\n background: ").concat(hoverColor, ";\n }\n\n :active {\n background: ").concat(activeColor, ";\n }\n");
|
|
17
6
|
|
|
18
7
|
const getItemBackgroundStyle = props => {
|
|
19
8
|
if (props.selected && !props.opened) return commonItemBackgroundStyle(props.theme.colors.brand[200], props.theme.colors.brand[200], props.theme.colors.brand[200]);
|
|
@@ -2,21 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const commonLeftBorderStyle = (color, hoverColor, activeColor) =>
|
|
6
|
-
|
|
7
|
-
-webkit-box-shadow: inset 4px 0 0 0 ${color};
|
|
8
|
-
box-shadow: inset 4px 0 0 0 ${color};
|
|
9
|
-
|
|
10
|
-
:hover {
|
|
11
|
-
-webkit-box-shadow: inset 4px 0 0 0 ${hoverColor};
|
|
12
|
-
box-shadow: inset 4px 0 0 0 ${hoverColor};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
:active {
|
|
16
|
-
-webkit-box-shadow: inset 4px 0 0 0 ${activeColor};
|
|
17
|
-
box-shadow: inset 4px 0 0 0 ${activeColor};
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
5
|
+
const commonLeftBorderStyle = (color, hoverColor, activeColor) => "\n\n -webkit-box-shadow: inset 4px 0 0 0 ".concat(color, ";\n box-shadow: inset 4px 0 0 0 ").concat(color, ";\n\n :hover {\n -webkit-box-shadow: inset 4px 0 0 0 ").concat(hoverColor, ";\n box-shadow: inset 4px 0 0 0 ").concat(hoverColor, ";\n }\n\n :active {\n -webkit-box-shadow: inset 4px 0 0 0 ").concat(activeColor, ";\n box-shadow: inset 4px 0 0 0 ").concat(activeColor, ";\n }\n");
|
|
20
6
|
|
|
21
7
|
const getLeftBorderStyle = props => {
|
|
22
8
|
if (props.selected) return commonLeftBorderStyle(props.theme.colors.brand[400], props.theme.colors.brand[400], props.theme.colors.brand[400]);
|
|
@@ -2,29 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const getScrolbarStyle = () =>
|
|
6
|
-
::-webkit-scrollbar {
|
|
7
|
-
width: 14px;
|
|
8
|
-
}
|
|
9
|
-
::-webkit-scrollbar-thumb {
|
|
10
|
-
height: 6px;
|
|
11
|
-
border: 4px solid rgba(0, 0, 0, 0);
|
|
12
|
-
|
|
13
|
-
background-clip: padding-box;
|
|
14
|
-
|
|
15
|
-
background-color: rgba(105, 116, 137, 0.5);
|
|
16
|
-
|
|
17
|
-
border-radius: 7px;
|
|
18
|
-
-webkit-border-radius: 7px;
|
|
19
|
-
}
|
|
20
|
-
::-webkit-scrollbar-button {
|
|
21
|
-
width: 0;
|
|
22
|
-
height: 0;
|
|
23
|
-
display: none;
|
|
24
|
-
}
|
|
25
|
-
::-webkit-scrollbar-corner {
|
|
26
|
-
background-color: transparent;
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
5
|
+
const getScrolbarStyle = () => "\n ::-webkit-scrollbar {\n width: 14px;\n }\n ::-webkit-scrollbar-thumb {\n height: 6px;\n border: 4px solid rgba(0, 0, 0, 0);\n\n background-clip: padding-box;\n\n background-color: rgba(105, 116, 137, 0.5);\n\n border-radius: 7px;\n -webkit-border-radius: 7px;\n }\n ::-webkit-scrollbar-button {\n width: 0;\n height: 0;\n display: none;\n }\n ::-webkit-scrollbar-corner {\n background-color: transparent;\n }\n";
|
|
29
6
|
|
|
30
7
|
exports.getScrolbarStyle = getScrolbarStyle;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var useGlobalKeyListeners = require('./useGlobalKeyListeners.js');
|
|
7
8
|
var useLeftNavItems = require('./useLeftNavItems.js');
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var constants = require('../exported-related/constants.js');
|
|
7
8
|
require('@babel/runtime/helpers/jsx');
|
|
@@ -16,23 +17,22 @@ require('@elliemae/ds-icons/AlertsSmallFill');
|
|
|
16
17
|
require('@elliemae/ds-icons/MessagesSmallFill');
|
|
17
18
|
require('@elliemae/ds-icons/OpenWindow');
|
|
18
19
|
|
|
19
|
-
/* eslint-disable complexity */
|
|
20
20
|
const notFocuseableItems = [constants.ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, constants.ITEM_TYPES.LEFT_NAV_ITEM_SECTION]; // Walks the array of items
|
|
21
21
|
// Drilldowns are tree-like structures
|
|
22
22
|
|
|
23
23
|
const walkItems = (items, openedDrilldowns, callback) => {
|
|
24
24
|
items.forEach(item => {
|
|
25
25
|
if (typeof item.type === 'string') {
|
|
26
|
-
var _item$itemOpts, _item$itemOpts2, _item$itemOpts3;
|
|
26
|
+
var _item$itemOpts$items, _item$itemOpts, _item$itemOpts2, _item$itemOpts$items2, _item$itemOpts3;
|
|
27
27
|
|
|
28
28
|
// Out of the box item
|
|
29
29
|
if (notFocuseableItems.includes(item.type)) return; // not focuseable
|
|
30
30
|
|
|
31
31
|
callback(item.dsId); // If it's an opened uncontrolled drilldown
|
|
32
32
|
|
|
33
|
-
if (item.type === constants.ITEM_TYPES.LEFT_NAV_ITEM_UNCONTROLLED_DRILLDOWN && openedDrilldowns.includes(item.dsId)) walkItems(((_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.items)
|
|
33
|
+
if (item.type === constants.ITEM_TYPES.LEFT_NAV_ITEM_UNCONTROLLED_DRILLDOWN && openedDrilldowns.includes(item.dsId)) walkItems((_item$itemOpts$items = (_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.items) !== null && _item$itemOpts$items !== void 0 ? _item$itemOpts$items : [], openedDrilldowns, callback); // If it's an opened controlled drilldown
|
|
34
34
|
|
|
35
|
-
if (item.type === constants.ITEM_TYPES.LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN && (_item$itemOpts2 = item.itemOpts) !== null && _item$itemOpts2 !== void 0 && _item$itemOpts2.isOpened) walkItems(((_item$itemOpts3 = item.itemOpts) === null || _item$itemOpts3 === void 0 ? void 0 : _item$itemOpts3.items)
|
|
35
|
+
if (item.type === constants.ITEM_TYPES.LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN && (_item$itemOpts2 = item.itemOpts) !== null && _item$itemOpts2 !== void 0 && _item$itemOpts2.isOpened) walkItems((_item$itemOpts$items2 = (_item$itemOpts3 = item.itemOpts) === null || _item$itemOpts3 === void 0 ? void 0 : _item$itemOpts3.items) !== null && _item$itemOpts$items2 !== void 0 ? _item$itemOpts$items2 : [], openedDrilldowns, callback);
|
|
36
36
|
} else {
|
|
37
37
|
var _item$itemOpts4;
|
|
38
38
|
|
|
@@ -29,7 +29,8 @@ const ItemRenderer = props => {
|
|
|
29
29
|
ariaLabel,
|
|
30
30
|
ariaRole,
|
|
31
31
|
ariaLive,
|
|
32
|
-
ariaExpanded
|
|
32
|
+
ariaExpanded,
|
|
33
|
+
ariaDescribedBy
|
|
33
34
|
},
|
|
34
35
|
CollapsedComponent
|
|
35
36
|
},
|
|
@@ -85,7 +86,7 @@ const ItemRenderer = props => {
|
|
|
85
86
|
}, void 0, /*#__PURE__*/jsxRuntime.jsx(styled.StyledItem, {
|
|
86
87
|
ref: visibleItemsRefs.current[dsId],
|
|
87
88
|
pt: paddingTop,
|
|
88
|
-
pl: indent === undefined ? 'xxxs' :
|
|
89
|
+
pl: indent === undefined ? 'xxxs' : "".concat(indent, "px"),
|
|
89
90
|
minHeight: minHeight,
|
|
90
91
|
shadowStyle: shadowStyle,
|
|
91
92
|
alignItems: "flex-start",
|
|
@@ -100,6 +101,7 @@ const ItemRenderer = props => {
|
|
|
100
101
|
onFocus: handleFocus,
|
|
101
102
|
"data-testid": "leftnav-item-container",
|
|
102
103
|
tabIndex: focuseable ? 0 : -1,
|
|
104
|
+
"aria-describedby": ariaDescribedBy,
|
|
103
105
|
"aria-expanded": ariaExpanded,
|
|
104
106
|
role: ariaRole,
|
|
105
107
|
"aria-label": ariaLabel,
|
|
@@ -117,7 +119,7 @@ const ItemRenderer = props => {
|
|
|
117
119
|
marginLeft: opened ? '16px' : '0px',
|
|
118
120
|
marginRight: borderBottomMr,
|
|
119
121
|
height: '1px',
|
|
120
|
-
width:
|
|
122
|
+
width: "calc(100% - ".concat(borderBottomMr, " - ").concat(opened ? '16px' : '0px', ")"),
|
|
121
123
|
backgroundColor: '#E0E3E8'
|
|
122
124
|
}
|
|
123
125
|
})), subitems]
|
|
@@ -42,17 +42,7 @@ const StyledItem = /*#__PURE__*/styled__default["default"](Grid__default["defaul
|
|
|
42
42
|
})(["cursor:", ";min-height:", ";background:", ";:hover{background:", ";}:active{background:", ";}", ";outline:none;", ""], props => props.selectable && !props.opened ? 'pointer' : 'auto', props => props.minHeight, getItemBackground, getItemHoverBackground, ({
|
|
43
43
|
selectable,
|
|
44
44
|
theme
|
|
45
|
-
}) => selectable ? theme.colors.brand[200] : 'white', props => props.shadowStyle(props.theme), props => props.focused && props.focusedByKey ?
|
|
46
|
-
&:before {
|
|
47
|
-
content: '';
|
|
48
|
-
position: absolute;
|
|
49
|
-
top: 0;
|
|
50
|
-
left: 0;
|
|
51
|
-
right: 0;
|
|
52
|
-
bottom: 0;
|
|
53
|
-
border: 1px solid ${props.theme.colors.brand[600]};
|
|
54
|
-
pointer-events: none;
|
|
55
|
-
}` : '');
|
|
45
|
+
}) => selectable ? theme.colors.brand[200] : 'white', props => props.shadowStyle(props.theme), props => props.focused && props.focusedByKey ? "\n &:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid ".concat(props.theme.colors.brand[600], ";\n pointer-events: none;\n }") : '');
|
|
56
46
|
|
|
57
47
|
exports.StyledItem = StyledItem;
|
|
58
48
|
exports.StyledItemWrapper = StyledItemWrapper;
|
|
@@ -22,7 +22,8 @@ const itemDefaultProps = {
|
|
|
22
22
|
ariaLabel: '',
|
|
23
23
|
ariaRole: 'menuitem',
|
|
24
24
|
ariaLive: 'off',
|
|
25
|
-
ariaExpanded: undefined
|
|
25
|
+
ariaExpanded: undefined,
|
|
26
|
+
ariaDescribedBy: undefined
|
|
26
27
|
}; // Make use Item props with defaults
|
|
27
28
|
|
|
28
29
|
const usePropsWithDefaults = props => {
|
package/cjs/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('overlayscrollbars/css/OverlayScrollbars.css');
|
|
6
5
|
var propTypes = require('./prop-types.js');
|
|
7
6
|
var LeftNavigation = require('./LeftNavigation.js');
|
|
8
7
|
var constants = require('./exported-related/constants.js');
|
|
@@ -50,10 +50,10 @@ const OutOfTheBoxMapSubitem = props => {
|
|
|
50
50
|
} = props;
|
|
51
51
|
|
|
52
52
|
if (typeof type === 'string' && !!outOfTheBoxSubitemsComponents[type]) {
|
|
53
|
-
var _item$itemOpts;
|
|
53
|
+
var _item$itemOpts$indent, _item$itemOpts;
|
|
54
54
|
|
|
55
55
|
const OutOfTheBoxComponent = outOfTheBoxSubitemsComponents[type];
|
|
56
|
-
const currentIndent = ((_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.indent)
|
|
56
|
+
const currentIndent = (_item$itemOpts$indent = (_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.indent) !== null && _item$itemOpts$indent !== void 0 ? _item$itemOpts$indent : 0;
|
|
57
57
|
|
|
58
58
|
const newItem = _objectSpread(_objectSpread({}, item), {}, {
|
|
59
59
|
itemOpts: _objectSpread(_objectSpread({}, item.itemOpts), {}, {
|
|
@@ -29,6 +29,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
29
29
|
|
|
30
30
|
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__default["default"](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; }
|
|
31
31
|
const ItemHeader = props => {
|
|
32
|
+
var _item$itemOpts$ariaLa;
|
|
33
|
+
|
|
32
34
|
const {
|
|
33
35
|
item,
|
|
34
36
|
item: {
|
|
@@ -53,7 +55,7 @@ const ItemHeader = props => {
|
|
|
53
55
|
}
|
|
54
56
|
} = props;
|
|
55
57
|
const opened = openedItem === dsId;
|
|
56
|
-
const ariaLabel = item.itemOpts.ariaLabel
|
|
58
|
+
const ariaLabel = (_item$itemOpts$ariaLa = item.itemOpts.ariaLabel) !== null && _item$itemOpts$ariaLa !== void 0 ? _item$itemOpts$ariaLa : typeof label === 'string' ? label : 'menuitem';
|
|
57
59
|
return /*#__PURE__*/_jsx__default["default"](index.ItemRenderer, {
|
|
58
60
|
item: _objectSpread(_objectSpread({}, item), {}, {
|
|
59
61
|
itemOpts: _objectSpread(_objectSpread({
|
|
@@ -87,7 +89,7 @@ const ItemHeader = props => {
|
|
|
87
89
|
setFocusedItem(constants.CHEVRON_BACK_DS_ID);
|
|
88
90
|
},
|
|
89
91
|
role: "button",
|
|
90
|
-
"aria-label":
|
|
92
|
+
"aria-label": "Close ".concat(ariaLabel)
|
|
91
93
|
}), /*#__PURE__*/_jsx__default["default"](CollapsedComponent, {
|
|
92
94
|
item: item,
|
|
93
95
|
ctx: ctx
|
|
@@ -28,17 +28,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
28
28
|
|
|
29
29
|
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__default["default"](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; }
|
|
30
30
|
|
|
31
|
-
const notOpenedShadowStyle = isSelected => theme =>
|
|
32
|
-
box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : 'transparent'};
|
|
33
|
-
|
|
34
|
-
:hover {
|
|
35
|
-
box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : theme.colors.neutral[300]};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
:active {
|
|
39
|
-
box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
31
|
+
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");
|
|
42
32
|
|
|
43
33
|
const ItemLink = props => {
|
|
44
34
|
const {
|
|
@@ -61,7 +51,7 @@ const ItemLink = props => {
|
|
|
61
51
|
}
|
|
62
52
|
} = props;
|
|
63
53
|
const isSelected = selectedItem === dsId;
|
|
64
|
-
const shadowStyle = React.useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected)(theme) :
|
|
54
|
+
const shadowStyle = React.useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected)(theme) : "box-shadow: inherit", [isSelected, !openedItem]);
|
|
65
55
|
return /*#__PURE__*/_jsx__default["default"](index.ItemRenderer, {
|
|
66
56
|
item: _objectSpread(_objectSpread({}, item), {}, {
|
|
67
57
|
itemOpts: _objectSpread({
|
|
@@ -48,8 +48,7 @@ const ItemSection = props => {
|
|
|
48
48
|
item: _objectSpread(_objectSpread({}, item), {}, {
|
|
49
49
|
itemOpts: _objectSpread(_objectSpread({}, item.itemOpts), {}, {
|
|
50
50
|
selectable: false,
|
|
51
|
-
focuseable: false
|
|
52
|
-
ariaLive: 'polite'
|
|
51
|
+
focuseable: false
|
|
53
52
|
}),
|
|
54
53
|
CollapsedComponent: null
|
|
55
54
|
}),
|
|
@@ -29,19 +29,11 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
29
29
|
|
|
30
30
|
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__default["default"](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; }
|
|
31
31
|
|
|
32
|
-
const notOpenedShadowStyle = isSelected => theme =>
|
|
33
|
-
box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : 'transparent'};
|
|
34
|
-
|
|
35
|
-
:hover {
|
|
36
|
-
box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : theme.colors.neutral[300]};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
:active {
|
|
40
|
-
box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
32
|
+
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");
|
|
43
33
|
|
|
44
34
|
const ItemSubmenu = props => {
|
|
35
|
+
var _item$itemOpts$ariaLa;
|
|
36
|
+
|
|
45
37
|
const {
|
|
46
38
|
item,
|
|
47
39
|
item: {
|
|
@@ -68,8 +60,8 @@ const ItemSubmenu = props => {
|
|
|
68
60
|
} = props;
|
|
69
61
|
const opened = openedItem === dsId;
|
|
70
62
|
const isSelected = selectedItem === dsId;
|
|
71
|
-
const shadowStyle = React.useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected)(theme) :
|
|
72
|
-
const ariaLabel = item.itemOpts.ariaLabel
|
|
63
|
+
const shadowStyle = React.useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected)(theme) : "box-shadow: inherit", [isSelected, !openedItem]);
|
|
64
|
+
const ariaLabel = (_item$itemOpts$ariaLa = item.itemOpts.ariaLabel) !== null && _item$itemOpts$ariaLa !== void 0 ? _item$itemOpts$ariaLa : typeof label === 'string' ? label : 'menuitem';
|
|
73
65
|
return /*#__PURE__*/_jsx__default["default"](index.ItemRenderer, {
|
|
74
66
|
item: _objectSpread(_objectSpread({}, item), {}, {
|
|
75
67
|
itemOpts: _objectSpread(_objectSpread({}, item.itemOpts), {}, {
|
|
@@ -103,7 +95,7 @@ const ItemSubmenu = props => {
|
|
|
103
95
|
setFocusedItem(constants.CHEVRON_BACK_DS_ID);
|
|
104
96
|
},
|
|
105
97
|
role: "button",
|
|
106
|
-
"aria-label":
|
|
98
|
+
"aria-label": "Close ".concat(ariaLabel)
|
|
107
99
|
}), /*#__PURE__*/_jsx__default["default"](CollapsedComponent, {
|
|
108
100
|
item: item,
|
|
109
101
|
ctx: ctx
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
8
|
var React = require('react');
|
|
8
9
|
var Grid = require('@elliemae/ds-grid');
|
|
9
10
|
var dsTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
@@ -53,10 +54,10 @@ const OutOfTheBoxMapSubitem = props => {
|
|
|
53
54
|
} = props;
|
|
54
55
|
|
|
55
56
|
if (typeof type === 'string' && !!outOfTheBoxSubitemsComponents[type]) {
|
|
56
|
-
var _item$itemOpts;
|
|
57
|
+
var _item$itemOpts$indent, _item$itemOpts;
|
|
57
58
|
|
|
58
59
|
const OutOfTheBoxComponent = outOfTheBoxSubitemsComponents[type];
|
|
59
|
-
const currentIndent = ((_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.indent)
|
|
60
|
+
const currentIndent = (_item$itemOpts$indent = (_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.indent) !== null && _item$itemOpts$indent !== void 0 ? _item$itemOpts$indent : 0;
|
|
60
61
|
|
|
61
62
|
const newItem = _objectSpread(_objectSpread({}, item), {}, {
|
|
62
63
|
itemOpts: _objectSpread(_objectSpread({}, item.itemOpts), {}, {
|
|
@@ -13,18 +13,10 @@ const getLeftShadowStyles = ({
|
|
|
13
13
|
theme
|
|
14
14
|
}) => {
|
|
15
15
|
if (!selected) {
|
|
16
|
-
return
|
|
17
|
-
box-shadow: inset 4px 0 0 0 transparent;
|
|
18
|
-
:hover {
|
|
19
|
-
box-shadow: inset 4px 0 0 0 ${theme.colors.neutral[300]};
|
|
20
|
-
}
|
|
21
|
-
:active {
|
|
22
|
-
box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
16
|
+
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 ");
|
|
25
17
|
}
|
|
26
18
|
|
|
27
|
-
return
|
|
19
|
+
return "box-shadow: inset 4px 0 0 0 ".concat(theme.colors.brand[400], ";");
|
|
28
20
|
};
|
|
29
21
|
|
|
30
22
|
const StyledLeftNavExpandAnimationWrapper = /*#__PURE__*/styled__default["default"].nav.withConfig({
|
|
@@ -32,7 +24,7 @@ const StyledLeftNavExpandAnimationWrapper = /*#__PURE__*/styled__default["defaul
|
|
|
32
24
|
})(["width:", ";transition:width ", " 350ms;box-shadow:-1px 0 0 0 ", ";border:1px solid ", ";overflow:hidden;height:100%;position:relative;"], props => props.expanded ? props.expandedWidth : '48px', props => props.expanded ? 'ease-out' : 'ease-in', props => props.theme.colors.neutral[100], props => props.theme.colors.neutral[100]);
|
|
33
25
|
const StyledLeftNavAreasContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
34
26
|
componentId: "sc-1hvvtkb-1"
|
|
35
|
-
})(["position:absolute;width:", ";height:100%;display:grid;grid-template-columns:1fr;grid-template-rows:auto 1fr auto;grid-template-areas:'left-nav-header' 'left-nav-body' 'left-nav-footer';"], props => props.expanded ?
|
|
27
|
+
})(["position:absolute;width:", ";height:100%;display:grid;grid-template-columns:1fr;grid-template-rows:auto 1fr auto;grid-template-areas:'left-nav-header' 'left-nav-body' 'left-nav-footer';"], props => props.expanded ? "calc(".concat(props.expandedWidth, " - 2px)") : '46px');
|
|
36
28
|
const StyledLeftNavHeaderArea = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
37
29
|
componentId: "sc-1hvvtkb-2"
|
|
38
30
|
})(["grid-area:left-nav-header;", ""], getLeftShadowStyles);
|
|
@@ -4,8 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
8
|
var React = require('react');
|
|
8
9
|
var OverlayScrollbars = require('overlayscrollbars');
|
|
10
|
+
require('overlayscrollbars/css/OverlayScrollbars.css');
|
|
9
11
|
var styled = require('styled-components');
|
|
10
12
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
13
|
|
|
@@ -69,7 +69,7 @@ const LeftNavFooterItem = props => {
|
|
|
69
69
|
onFocus: () => setFocusedItem(id),
|
|
70
70
|
"data-testid": "leftnav-item-container",
|
|
71
71
|
role: "menuitem",
|
|
72
|
-
"aria-label": expandedForAnimation ?
|
|
72
|
+
"aria-label": expandedForAnimation ? "Footer, ".concat(footerLabel) : "Expand left navigation",
|
|
73
73
|
children: !expandedForAnimation ? /*#__PURE__*/_jsx__default["default"](MenuExpand__default["default"], {
|
|
74
74
|
size: "m",
|
|
75
75
|
color: ['brand-primary', 800],
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
const commonFocusedByKeyboardBorder = (props, height, width) =>
|
|
2
|
-
&:before {
|
|
3
|
-
content: '';
|
|
4
|
-
position: absolute;
|
|
5
|
-
height: ${height};
|
|
6
|
-
width: ${width};
|
|
7
|
-
top: 0;
|
|
8
|
-
left: 0px;
|
|
9
|
-
border: 1px solid ${props.theme.colors.brand[600]};
|
|
10
|
-
pointer-events: none;
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
1
|
+
const commonFocusedByKeyboardBorder = (props, height, width) => "\n &:before {\n content: '';\n position: absolute;\n height: ".concat(height, ";\n width: ").concat(width, ";\n top: 0;\n left: 0px;\n border: 1px solid ").concat(props.theme.colors.brand[600], ";\n pointer-events: none;\n }\n");
|
|
13
2
|
|
|
14
3
|
const getFocusedByKeyboardBorderStyle = (props, height = '100%', width = '100%') => {
|
|
15
4
|
if (props.focused && props.focusedByKey) return commonFocusedByKeyboardBorder(props, height, width);
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
const commonItemBackgroundStyle = (color, hoverColor, activeColor) =>
|
|
2
|
-
|
|
3
|
-
background: ${color};
|
|
4
|
-
|
|
5
|
-
:hover {
|
|
6
|
-
background: ${hoverColor};
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
:active {
|
|
10
|
-
background: ${activeColor};
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
1
|
+
const commonItemBackgroundStyle = (color, hoverColor, activeColor) => "\n\n background: ".concat(color, ";\n\n :hover {\n background: ").concat(hoverColor, ";\n }\n\n :active {\n background: ").concat(activeColor, ";\n }\n");
|
|
13
2
|
|
|
14
3
|
const getItemBackgroundStyle = props => {
|
|
15
4
|
if (props.selected && !props.opened) return commonItemBackgroundStyle(props.theme.colors.brand[200], props.theme.colors.brand[200], props.theme.colors.brand[200]);
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
const commonLeftBorderStyle = (color, hoverColor, activeColor) =>
|
|
2
|
-
|
|
3
|
-
-webkit-box-shadow: inset 4px 0 0 0 ${color};
|
|
4
|
-
box-shadow: inset 4px 0 0 0 ${color};
|
|
5
|
-
|
|
6
|
-
:hover {
|
|
7
|
-
-webkit-box-shadow: inset 4px 0 0 0 ${hoverColor};
|
|
8
|
-
box-shadow: inset 4px 0 0 0 ${hoverColor};
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
:active {
|
|
12
|
-
-webkit-box-shadow: inset 4px 0 0 0 ${activeColor};
|
|
13
|
-
box-shadow: inset 4px 0 0 0 ${activeColor};
|
|
14
|
-
}
|
|
15
|
-
`;
|
|
1
|
+
const commonLeftBorderStyle = (color, hoverColor, activeColor) => "\n\n -webkit-box-shadow: inset 4px 0 0 0 ".concat(color, ";\n box-shadow: inset 4px 0 0 0 ").concat(color, ";\n\n :hover {\n -webkit-box-shadow: inset 4px 0 0 0 ").concat(hoverColor, ";\n box-shadow: inset 4px 0 0 0 ").concat(hoverColor, ";\n }\n\n :active {\n -webkit-box-shadow: inset 4px 0 0 0 ").concat(activeColor, ";\n box-shadow: inset 4px 0 0 0 ").concat(activeColor, ";\n }\n");
|
|
16
2
|
|
|
17
3
|
const getLeftBorderStyle = props => {
|
|
18
4
|
if (props.selected) return commonLeftBorderStyle(props.theme.colors.brand[400], props.theme.colors.brand[400], props.theme.colors.brand[400]);
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
const getScrolbarStyle = () =>
|
|
2
|
-
::-webkit-scrollbar {
|
|
3
|
-
width: 14px;
|
|
4
|
-
}
|
|
5
|
-
::-webkit-scrollbar-thumb {
|
|
6
|
-
height: 6px;
|
|
7
|
-
border: 4px solid rgba(0, 0, 0, 0);
|
|
8
|
-
|
|
9
|
-
background-clip: padding-box;
|
|
10
|
-
|
|
11
|
-
background-color: rgba(105, 116, 137, 0.5);
|
|
12
|
-
|
|
13
|
-
border-radius: 7px;
|
|
14
|
-
-webkit-border-radius: 7px;
|
|
15
|
-
}
|
|
16
|
-
::-webkit-scrollbar-button {
|
|
17
|
-
width: 0;
|
|
18
|
-
height: 0;
|
|
19
|
-
display: none;
|
|
20
|
-
}
|
|
21
|
-
::-webkit-scrollbar-corner {
|
|
22
|
-
background-color: transparent;
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
1
|
+
const getScrolbarStyle = () => "\n ::-webkit-scrollbar {\n width: 14px;\n }\n ::-webkit-scrollbar-thumb {\n height: 6px;\n border: 4px solid rgba(0, 0, 0, 0);\n\n background-clip: padding-box;\n\n background-color: rgba(105, 116, 137, 0.5);\n\n border-radius: 7px;\n -webkit-border-radius: 7px;\n }\n ::-webkit-scrollbar-button {\n width: 0;\n height: 0;\n display: none;\n }\n ::-webkit-scrollbar-corner {\n background-color: transparent;\n }\n";
|
|
25
2
|
|
|
26
3
|
export { getScrolbarStyle };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
1
2
|
import { useMemo, useRef, createRef } from 'react';
|
|
2
3
|
import { ITEM_TYPES, FOOTER_DS_ID } from '../exported-related/constants.js';
|
|
3
4
|
import '@babel/runtime/helpers/esm/jsx';
|
|
@@ -12,23 +13,22 @@ import '@elliemae/ds-icons/AlertsSmallFill';
|
|
|
12
13
|
import '@elliemae/ds-icons/MessagesSmallFill';
|
|
13
14
|
import '@elliemae/ds-icons/OpenWindow';
|
|
14
15
|
|
|
15
|
-
/* eslint-disable complexity */
|
|
16
16
|
const notFocuseableItems = [ITEM_TYPES.LEFT_NAV_ITEM_SEPARATOR, ITEM_TYPES.LEFT_NAV_ITEM_SECTION]; // Walks the array of items
|
|
17
17
|
// Drilldowns are tree-like structures
|
|
18
18
|
|
|
19
19
|
const walkItems = (items, openedDrilldowns, callback) => {
|
|
20
20
|
items.forEach(item => {
|
|
21
21
|
if (typeof item.type === 'string') {
|
|
22
|
-
var _item$itemOpts, _item$itemOpts2, _item$itemOpts3;
|
|
22
|
+
var _item$itemOpts$items, _item$itemOpts, _item$itemOpts2, _item$itemOpts$items2, _item$itemOpts3;
|
|
23
23
|
|
|
24
24
|
// Out of the box item
|
|
25
25
|
if (notFocuseableItems.includes(item.type)) return; // not focuseable
|
|
26
26
|
|
|
27
27
|
callback(item.dsId); // If it's an opened uncontrolled drilldown
|
|
28
28
|
|
|
29
|
-
if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_UNCONTROLLED_DRILLDOWN && openedDrilldowns.includes(item.dsId)) walkItems(((_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.items)
|
|
29
|
+
if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_UNCONTROLLED_DRILLDOWN && openedDrilldowns.includes(item.dsId)) walkItems((_item$itemOpts$items = (_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.items) !== null && _item$itemOpts$items !== void 0 ? _item$itemOpts$items : [], openedDrilldowns, callback); // If it's an opened controlled drilldown
|
|
30
30
|
|
|
31
|
-
if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN && (_item$itemOpts2 = item.itemOpts) !== null && _item$itemOpts2 !== void 0 && _item$itemOpts2.isOpened) walkItems(((_item$itemOpts3 = item.itemOpts) === null || _item$itemOpts3 === void 0 ? void 0 : _item$itemOpts3.items)
|
|
31
|
+
if (item.type === ITEM_TYPES.LEFT_NAV_ITEM_CONTROLLED_DRILLDOWN && (_item$itemOpts2 = item.itemOpts) !== null && _item$itemOpts2 !== void 0 && _item$itemOpts2.isOpened) walkItems((_item$itemOpts$items2 = (_item$itemOpts3 = item.itemOpts) === null || _item$itemOpts3 === void 0 ? void 0 : _item$itemOpts3.items) !== null && _item$itemOpts$items2 !== void 0 ? _item$itemOpts$items2 : [], openedDrilldowns, callback);
|
|
32
32
|
} else {
|
|
33
33
|
var _item$itemOpts4;
|
|
34
34
|
|
|
@@ -20,7 +20,8 @@ const ItemRenderer = props => {
|
|
|
20
20
|
ariaLabel,
|
|
21
21
|
ariaRole,
|
|
22
22
|
ariaLive,
|
|
23
|
-
ariaExpanded
|
|
23
|
+
ariaExpanded,
|
|
24
|
+
ariaDescribedBy
|
|
24
25
|
},
|
|
25
26
|
CollapsedComponent
|
|
26
27
|
},
|
|
@@ -76,7 +77,7 @@ const ItemRenderer = props => {
|
|
|
76
77
|
}, void 0, /*#__PURE__*/jsx(StyledItem, {
|
|
77
78
|
ref: visibleItemsRefs.current[dsId],
|
|
78
79
|
pt: paddingTop,
|
|
79
|
-
pl: indent === undefined ? 'xxxs' :
|
|
80
|
+
pl: indent === undefined ? 'xxxs' : "".concat(indent, "px"),
|
|
80
81
|
minHeight: minHeight,
|
|
81
82
|
shadowStyle: shadowStyle,
|
|
82
83
|
alignItems: "flex-start",
|
|
@@ -91,6 +92,7 @@ const ItemRenderer = props => {
|
|
|
91
92
|
onFocus: handleFocus,
|
|
92
93
|
"data-testid": "leftnav-item-container",
|
|
93
94
|
tabIndex: focuseable ? 0 : -1,
|
|
95
|
+
"aria-describedby": ariaDescribedBy,
|
|
94
96
|
"aria-expanded": ariaExpanded,
|
|
95
97
|
role: ariaRole,
|
|
96
98
|
"aria-label": ariaLabel,
|
|
@@ -108,7 +110,7 @@ const ItemRenderer = props => {
|
|
|
108
110
|
marginLeft: opened ? '16px' : '0px',
|
|
109
111
|
marginRight: borderBottomMr,
|
|
110
112
|
height: '1px',
|
|
111
|
-
width:
|
|
113
|
+
width: "calc(100% - ".concat(borderBottomMr, " - ").concat(opened ? '16px' : '0px', ")"),
|
|
112
114
|
backgroundColor: '#E0E3E8'
|
|
113
115
|
}
|
|
114
116
|
})), subitems]
|
|
@@ -33,16 +33,6 @@ const StyledItem = /*#__PURE__*/styled(Grid).withConfig({
|
|
|
33
33
|
})(["cursor:", ";min-height:", ";background:", ";:hover{background:", ";}:active{background:", ";}", ";outline:none;", ""], props => props.selectable && !props.opened ? 'pointer' : 'auto', props => props.minHeight, getItemBackground, getItemHoverBackground, ({
|
|
34
34
|
selectable,
|
|
35
35
|
theme
|
|
36
|
-
}) => selectable ? theme.colors.brand[200] : 'white', props => props.shadowStyle(props.theme), props => props.focused && props.focusedByKey ?
|
|
37
|
-
&:before {
|
|
38
|
-
content: '';
|
|
39
|
-
position: absolute;
|
|
40
|
-
top: 0;
|
|
41
|
-
left: 0;
|
|
42
|
-
right: 0;
|
|
43
|
-
bottom: 0;
|
|
44
|
-
border: 1px solid ${props.theme.colors.brand[600]};
|
|
45
|
-
pointer-events: none;
|
|
46
|
-
}` : '');
|
|
36
|
+
}) => selectable ? theme.colors.brand[200] : 'white', props => props.shadowStyle(props.theme), props => props.focused && props.focusedByKey ? "\n &:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid ".concat(props.theme.colors.brand[600], ";\n pointer-events: none;\n }") : '');
|
|
47
37
|
|
|
48
38
|
export { StyledItem, StyledItemWrapper };
|
|
@@ -14,7 +14,8 @@ const itemDefaultProps = {
|
|
|
14
14
|
ariaLabel: '',
|
|
15
15
|
ariaRole: 'menuitem',
|
|
16
16
|
ariaLive: 'off',
|
|
17
|
-
ariaExpanded: undefined
|
|
17
|
+
ariaExpanded: undefined,
|
|
18
|
+
ariaDescribedBy: undefined
|
|
18
19
|
}; // Make use Item props with defaults
|
|
19
20
|
|
|
20
21
|
const usePropsWithDefaults = props => {
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import 'overlayscrollbars/css/OverlayScrollbars.css';
|
|
2
1
|
export { LeftNavItemOptionsSchema, LeftNavItemPropsSchema } from './prop-types.js';
|
|
3
2
|
export { LeftNavigation, LeftNavigationWithSchema, LeftNavigation as default } from './LeftNavigation.js';
|
|
4
3
|
export { CHEVRON_BACK_DS_ID, FOOTER_DS_ID, FOOTER_MENU_CLOSE_DS_ID, ITEM_TYPES, LABEL_OVERFLOW } from './exported-related/constants.js';
|
|
@@ -38,10 +38,10 @@ const OutOfTheBoxMapSubitem = props => {
|
|
|
38
38
|
} = props;
|
|
39
39
|
|
|
40
40
|
if (typeof type === 'string' && !!outOfTheBoxSubitemsComponents[type]) {
|
|
41
|
-
var _item$itemOpts;
|
|
41
|
+
var _item$itemOpts$indent, _item$itemOpts;
|
|
42
42
|
|
|
43
43
|
const OutOfTheBoxComponent = outOfTheBoxSubitemsComponents[type];
|
|
44
|
-
const currentIndent = ((_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.indent)
|
|
44
|
+
const currentIndent = (_item$itemOpts$indent = (_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.indent) !== null && _item$itemOpts$indent !== void 0 ? _item$itemOpts$indent : 0;
|
|
45
45
|
|
|
46
46
|
const newItem = _objectSpread(_objectSpread({}, item), {}, {
|
|
47
47
|
itemOpts: _objectSpread(_objectSpread({}, item.itemOpts), {}, {
|
|
@@ -19,6 +19,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
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
|
const ItemHeader = props => {
|
|
22
|
+
var _item$itemOpts$ariaLa;
|
|
23
|
+
|
|
22
24
|
const {
|
|
23
25
|
item,
|
|
24
26
|
item: {
|
|
@@ -43,7 +45,7 @@ const ItemHeader = props => {
|
|
|
43
45
|
}
|
|
44
46
|
} = props;
|
|
45
47
|
const opened = openedItem === dsId;
|
|
46
|
-
const ariaLabel = item.itemOpts.ariaLabel
|
|
48
|
+
const ariaLabel = (_item$itemOpts$ariaLa = item.itemOpts.ariaLabel) !== null && _item$itemOpts$ariaLa !== void 0 ? _item$itemOpts$ariaLa : typeof label === 'string' ? label : 'menuitem';
|
|
47
49
|
return /*#__PURE__*/_jsx(ItemRenderer, {
|
|
48
50
|
item: _objectSpread(_objectSpread({}, item), {}, {
|
|
49
51
|
itemOpts: _objectSpread(_objectSpread({
|
|
@@ -77,7 +79,7 @@ const ItemHeader = props => {
|
|
|
77
79
|
setFocusedItem(CHEVRON_BACK_DS_ID);
|
|
78
80
|
},
|
|
79
81
|
role: "button",
|
|
80
|
-
"aria-label":
|
|
82
|
+
"aria-label": "Close ".concat(ariaLabel)
|
|
81
83
|
}), /*#__PURE__*/_jsx(CollapsedComponent, {
|
|
82
84
|
item: item,
|
|
83
85
|
ctx: ctx
|
|
@@ -18,17 +18,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
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 =>
|
|
22
|
-
box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : 'transparent'};
|
|
23
|
-
|
|
24
|
-
:hover {
|
|
25
|
-
box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : theme.colors.neutral[300]};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
:active {
|
|
29
|
-
box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
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");
|
|
32
22
|
|
|
33
23
|
const ItemLink = props => {
|
|
34
24
|
const {
|
|
@@ -51,7 +41,7 @@ const ItemLink = props => {
|
|
|
51
41
|
}
|
|
52
42
|
} = props;
|
|
53
43
|
const isSelected = selectedItem === dsId;
|
|
54
|
-
const shadowStyle = useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected)(theme) :
|
|
44
|
+
const shadowStyle = useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected)(theme) : "box-shadow: inherit", [isSelected, !openedItem]);
|
|
55
45
|
return /*#__PURE__*/_jsx(ItemRenderer, {
|
|
56
46
|
item: _objectSpread(_objectSpread({}, item), {}, {
|
|
57
47
|
itemOpts: _objectSpread({
|
|
@@ -38,8 +38,7 @@ const ItemSection = props => {
|
|
|
38
38
|
item: _objectSpread(_objectSpread({}, item), {}, {
|
|
39
39
|
itemOpts: _objectSpread(_objectSpread({}, item.itemOpts), {}, {
|
|
40
40
|
selectable: false,
|
|
41
|
-
focuseable: false
|
|
42
|
-
ariaLive: 'polite'
|
|
41
|
+
focuseable: false
|
|
43
42
|
}),
|
|
44
43
|
CollapsedComponent: null
|
|
45
44
|
}),
|
|
@@ -19,19 +19,11 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
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 =>
|
|
23
|
-
box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : 'transparent'};
|
|
24
|
-
|
|
25
|
-
:hover {
|
|
26
|
-
box-shadow: inset 4px 0 0 0 ${isSelected ? theme.colors.brand[400] : theme.colors.neutral[300]};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
:active {
|
|
30
|
-
box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
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");
|
|
33
23
|
|
|
34
24
|
const ItemSubmenu = props => {
|
|
25
|
+
var _item$itemOpts$ariaLa;
|
|
26
|
+
|
|
35
27
|
const {
|
|
36
28
|
item,
|
|
37
29
|
item: {
|
|
@@ -58,8 +50,8 @@ const ItemSubmenu = props => {
|
|
|
58
50
|
} = props;
|
|
59
51
|
const opened = openedItem === dsId;
|
|
60
52
|
const isSelected = selectedItem === dsId;
|
|
61
|
-
const shadowStyle = useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected)(theme) :
|
|
62
|
-
const ariaLabel = item.itemOpts.ariaLabel
|
|
53
|
+
const shadowStyle = useCallback(theme => !openedItem ? notOpenedShadowStyle(isSelected)(theme) : "box-shadow: inherit", [isSelected, !openedItem]);
|
|
54
|
+
const ariaLabel = (_item$itemOpts$ariaLa = item.itemOpts.ariaLabel) !== null && _item$itemOpts$ariaLa !== void 0 ? _item$itemOpts$ariaLa : typeof label === 'string' ? label : 'menuitem';
|
|
63
55
|
return /*#__PURE__*/_jsx(ItemRenderer, {
|
|
64
56
|
item: _objectSpread(_objectSpread({}, item), {}, {
|
|
65
57
|
itemOpts: _objectSpread(_objectSpread({}, item.itemOpts), {}, {
|
|
@@ -93,7 +85,7 @@ const ItemSubmenu = props => {
|
|
|
93
85
|
setFocusedItem(CHEVRON_BACK_DS_ID);
|
|
94
86
|
},
|
|
95
87
|
role: "button",
|
|
96
|
-
"aria-label":
|
|
88
|
+
"aria-label": "Close ".concat(ariaLabel)
|
|
97
89
|
}), /*#__PURE__*/_jsx(CollapsedComponent, {
|
|
98
90
|
item: item,
|
|
99
91
|
ctx: ctx
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
4
|
import { useEffect, useMemo, useCallback } from 'react';
|
|
4
5
|
import Grid from '@elliemae/ds-grid';
|
|
5
6
|
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
@@ -41,10 +42,10 @@ const OutOfTheBoxMapSubitem = props => {
|
|
|
41
42
|
} = props;
|
|
42
43
|
|
|
43
44
|
if (typeof type === 'string' && !!outOfTheBoxSubitemsComponents[type]) {
|
|
44
|
-
var _item$itemOpts;
|
|
45
|
+
var _item$itemOpts$indent, _item$itemOpts;
|
|
45
46
|
|
|
46
47
|
const OutOfTheBoxComponent = outOfTheBoxSubitemsComponents[type];
|
|
47
|
-
const currentIndent = ((_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.indent)
|
|
48
|
+
const currentIndent = (_item$itemOpts$indent = (_item$itemOpts = item.itemOpts) === null || _item$itemOpts === void 0 ? void 0 : _item$itemOpts.indent) !== null && _item$itemOpts$indent !== void 0 ? _item$itemOpts$indent : 0;
|
|
48
49
|
|
|
49
50
|
const newItem = _objectSpread(_objectSpread({}, item), {}, {
|
|
50
51
|
itemOpts: _objectSpread(_objectSpread({}, item.itemOpts), {}, {
|
|
@@ -5,18 +5,10 @@ const getLeftShadowStyles = ({
|
|
|
5
5
|
theme
|
|
6
6
|
}) => {
|
|
7
7
|
if (!selected) {
|
|
8
|
-
return
|
|
9
|
-
box-shadow: inset 4px 0 0 0 transparent;
|
|
10
|
-
:hover {
|
|
11
|
-
box-shadow: inset 4px 0 0 0 ${theme.colors.neutral[300]};
|
|
12
|
-
}
|
|
13
|
-
:active {
|
|
14
|
-
box-shadow: inset 4px 0 0 0 ${theme.colors.brand[400]};
|
|
15
|
-
}
|
|
16
|
-
`;
|
|
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 ");
|
|
17
9
|
}
|
|
18
10
|
|
|
19
|
-
return
|
|
11
|
+
return "box-shadow: inset 4px 0 0 0 ".concat(theme.colors.brand[400], ";");
|
|
20
12
|
};
|
|
21
13
|
|
|
22
14
|
const StyledLeftNavExpandAnimationWrapper = /*#__PURE__*/styled.nav.withConfig({
|
|
@@ -24,7 +16,7 @@ const StyledLeftNavExpandAnimationWrapper = /*#__PURE__*/styled.nav.withConfig({
|
|
|
24
16
|
})(["width:", ";transition:width ", " 350ms;box-shadow:-1px 0 0 0 ", ";border:1px solid ", ";overflow:hidden;height:100%;position:relative;"], props => props.expanded ? props.expandedWidth : '48px', props => props.expanded ? 'ease-out' : 'ease-in', props => props.theme.colors.neutral[100], props => props.theme.colors.neutral[100]);
|
|
25
17
|
const StyledLeftNavAreasContainer = /*#__PURE__*/styled.div.withConfig({
|
|
26
18
|
componentId: "sc-1hvvtkb-1"
|
|
27
|
-
})(["position:absolute;width:", ";height:100%;display:grid;grid-template-columns:1fr;grid-template-rows:auto 1fr auto;grid-template-areas:'left-nav-header' 'left-nav-body' 'left-nav-footer';"], props => props.expanded ?
|
|
19
|
+
})(["position:absolute;width:", ";height:100%;display:grid;grid-template-columns:1fr;grid-template-rows:auto 1fr auto;grid-template-areas:'left-nav-header' 'left-nav-body' 'left-nav-footer';"], props => props.expanded ? "calc(".concat(props.expandedWidth, " - 2px)") : '46px');
|
|
28
20
|
const StyledLeftNavHeaderArea = /*#__PURE__*/styled.div.withConfig({
|
|
29
21
|
componentId: "sc-1hvvtkb-2"
|
|
30
22
|
})(["grid-area:left-nav-header;", ""], getLeftShadowStyles);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
4
|
import { useState, useRef, useEffect } from 'react';
|
|
4
5
|
import OverlayScrollbars from 'overlayscrollbars';
|
|
6
|
+
import 'overlayscrollbars/css/OverlayScrollbars.css';
|
|
5
7
|
import styled from 'styled-components';
|
|
6
8
|
import { jsxs } from 'react/jsx-runtime';
|
|
7
9
|
|
|
@@ -59,7 +59,7 @@ const LeftNavFooterItem = props => {
|
|
|
59
59
|
onFocus: () => setFocusedItem(id),
|
|
60
60
|
"data-testid": "leftnav-item-container",
|
|
61
61
|
role: "menuitem",
|
|
62
|
-
"aria-label": expandedForAnimation ?
|
|
62
|
+
"aria-label": expandedForAnimation ? "Footer, ".concat(footerLabel) : "Expand left navigation",
|
|
63
63
|
children: !expandedForAnimation ? /*#__PURE__*/_jsx(MenuExpand, {
|
|
64
64
|
size: "m",
|
|
65
65
|
color: ['brand-primary', 800],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-left-navigation",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Left Navigation",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -241,9 +241,10 @@
|
|
|
241
241
|
"generateSubmodules": true
|
|
242
242
|
},
|
|
243
243
|
"dependencies": {
|
|
244
|
-
"@elliemae/ds-basic": "2.0.0-alpha.
|
|
245
|
-
"@elliemae/ds-icons": "2.0.0-alpha.
|
|
246
|
-
"@elliemae/ds-system": "2.0.0-alpha.
|
|
244
|
+
"@elliemae/ds-basic": "2.0.0-alpha.11",
|
|
245
|
+
"@elliemae/ds-icons": "2.0.0-alpha.11",
|
|
246
|
+
"@elliemae/ds-system": "2.0.0-alpha.11",
|
|
247
|
+
"overlayscrollbars": "^1.13.1",
|
|
247
248
|
"prop-types": "~15.7.2",
|
|
248
249
|
"react-virtual": "~2.3.2",
|
|
249
250
|
"tree-model": "~1.0.7"
|
package/types/index.d.d.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import 'overlayscrollbars/css/OverlayScrollbars.css';
|
|
2
1
|
export { LeftNavItemPropsSchema, LeftNavItemOptionsSchema } from './prop-types';
|
|
3
|
-
export { LeftNavigation, LeftNavigationWithSchema, LeftNavigation as default
|
|
2
|
+
export { LeftNavigation, LeftNavigationWithSchema, LeftNavigation as default } from './LeftNavigation';
|
|
4
3
|
export * from './exported-related';
|
|
@@ -7,4 +7,4 @@ export declare const StyledItemWrapper: import("styled-components").StyledCompon
|
|
|
7
7
|
export declare const StyledItem: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>, any, {}, never>;
|
|
8
8
|
export declare const StyledLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>, any, {}, never>;
|
|
9
9
|
export declare const StyledSeparator: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>>, any, {}, never>;
|
|
10
|
-
export declare const StyledMenuCollapse: import("styled-components").StyledComponent<(rest:
|
|
10
|
+
export declare const StyledMenuCollapse: import("styled-components").StyledComponent<(rest: Record<string, unknown>) => JSX.Element, any, {}, never>;
|
package/cjs/package.json
DELETED
package/esm/package.json
DELETED