@elliemae/ds-global-header 2.2.0-alpha.2 → 2.2.0-next.1
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/GlobalHeader.js +35 -55
- package/cjs/GlobalHeaderContainer.js +23 -40
- package/cjs/GlobalHeaderContext.js +13 -39
- package/cjs/GlobalHeaderTypes.js +2 -27
- package/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js +59 -59
- package/cjs/components/Breadcrumb/PureBreadcrumb.js +59 -50
- package/cjs/components/Breadcrumb/styles.js +58 -82
- package/cjs/components/Title/GlobalHeaderTitle.js +24 -43
- package/cjs/components/Toolbar/GlobalHeaderToolbar.js +22 -41
- package/cjs/components/Toolbar/ToolbarItems.js +94 -83
- package/cjs/components/Toolbar/styles.js +24 -60
- package/cjs/config/useGetPropsWithDefaults.js +30 -42
- package/cjs/config/useGlobalHeader.js +30 -44
- package/cjs/config/useValidateProps.js +64 -81
- package/cjs/config/validateHelpers.js +41 -95
- package/cjs/defaultProps.js +7 -34
- package/cjs/index.js +11 -36
- package/cjs/outOfTheBox/AppPicker/AppPicker.js +90 -83
- package/cjs/outOfTheBox/PopupMenu/PopupMenu.js +75 -70
- package/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js +83 -76
- package/cjs/outOfTheBox/PopupMenu/styles.js +31 -66
- package/cjs/outOfTheBox/SearchToggle/SearchToggle.js +85 -80
- package/cjs/outOfTheBox/SearchToggle/styles.js +9 -76
- package/cjs/outOfTheBox/index.js +13 -30
- package/cjs/propTypes.js +25 -52
- package/cjs/styles.js +20 -42
- package/esm/GlobalHeader.js +21 -21
- package/esm/GlobalHeaderContainer.js +15 -11
- package/esm/GlobalHeaderContext.js +8 -9
- package/esm/GlobalHeaderTypes.js +1 -2
- package/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js +45 -26
- package/esm/components/Breadcrumb/PureBreadcrumb.js +49 -22
- package/esm/components/Breadcrumb/styles.js +48 -54
- package/esm/components/Title/GlobalHeaderTitle.js +15 -13
- package/esm/components/Toolbar/GlobalHeaderToolbar.js +14 -12
- package/esm/components/Toolbar/ToolbarItems.js +83 -53
- package/esm/components/Toolbar/styles.js +17 -32
- package/esm/config/useGetPropsWithDefaults.js +22 -13
- package/esm/config/useGlobalHeader.js +19 -12
- package/esm/config/useValidateProps.js +58 -58
- package/esm/config/validateHelpers.js +28 -66
- package/esm/defaultProps.js +3 -5
- package/esm/index.js +1 -7
- package/esm/outOfTheBox/AppPicker/AppPicker.js +76 -50
- package/esm/outOfTheBox/PopupMenu/PopupMenu.js +61 -37
- package/esm/outOfTheBox/PopupMenu/PopupMenuContent.js +71 -45
- package/esm/outOfTheBox/PopupMenu/styles.js +21 -38
- package/esm/outOfTheBox/SearchToggle/SearchToggle.js +70 -46
- package/esm/outOfTheBox/SearchToggle/styles.js +5 -51
- package/esm/outOfTheBox/index.js +3 -5
- package/esm/propTypes.js +17 -21
- package/esm/styles.js +13 -14
- package/package.json +7 -7
- package/cjs/GlobalHeader.js.map +0 -7
- package/cjs/GlobalHeaderContainer.js.map +0 -7
- package/cjs/GlobalHeaderContext.js.map +0 -7
- package/cjs/GlobalHeaderTypes.js.map +0 -7
- package/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js.map +0 -7
- package/cjs/components/Breadcrumb/PureBreadcrumb.js.map +0 -7
- package/cjs/components/Breadcrumb/styles.js.map +0 -7
- package/cjs/components/Title/GlobalHeaderTitle.js.map +0 -7
- package/cjs/components/Toolbar/GlobalHeaderToolbar.js.map +0 -7
- package/cjs/components/Toolbar/ToolbarItems.js.map +0 -7
- package/cjs/components/Toolbar/styles.js.map +0 -7
- package/cjs/config/useGetPropsWithDefaults.js.map +0 -7
- package/cjs/config/useGlobalHeader.js.map +0 -7
- package/cjs/config/useValidateProps.js.map +0 -7
- package/cjs/config/validateHelpers.js.map +0 -7
- package/cjs/defaultProps.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/outOfTheBox/AppPicker/AppPicker.js.map +0 -7
- package/cjs/outOfTheBox/PopupMenu/PopupMenu.js.map +0 -7
- package/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js.map +0 -7
- package/cjs/outOfTheBox/PopupMenu/styles.js.map +0 -7
- package/cjs/outOfTheBox/SearchToggle/SearchToggle.js.map +0 -7
- package/cjs/outOfTheBox/SearchToggle/styles.js.map +0 -7
- package/cjs/outOfTheBox/index.js.map +0 -7
- package/cjs/propTypes.js.map +0 -7
- package/cjs/styles.js.map +0 -7
- package/esm/GlobalHeader.js.map +0 -7
- package/esm/GlobalHeaderContainer.js.map +0 -7
- package/esm/GlobalHeaderContext.js.map +0 -7
- package/esm/GlobalHeaderTypes.js.map +0 -7
- package/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js.map +0 -7
- package/esm/components/Breadcrumb/PureBreadcrumb.js.map +0 -7
- package/esm/components/Breadcrumb/styles.js.map +0 -7
- package/esm/components/Title/GlobalHeaderTitle.js.map +0 -7
- package/esm/components/Toolbar/GlobalHeaderToolbar.js.map +0 -7
- package/esm/components/Toolbar/ToolbarItems.js.map +0 -7
- package/esm/components/Toolbar/styles.js.map +0 -7
- package/esm/config/useGetPropsWithDefaults.js.map +0 -7
- package/esm/config/useGlobalHeader.js.map +0 -7
- package/esm/config/useValidateProps.js.map +0 -7
- package/esm/config/validateHelpers.js.map +0 -7
- package/esm/defaultProps.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/outOfTheBox/AppPicker/AppPicker.js.map +0 -7
- package/esm/outOfTheBox/PopupMenu/PopupMenu.js.map +0 -7
- package/esm/outOfTheBox/PopupMenu/PopupMenuContent.js.map +0 -7
- package/esm/outOfTheBox/PopupMenu/styles.js.map +0 -7
- package/esm/outOfTheBox/SearchToggle/SearchToggle.js.map +0 -7
- package/esm/outOfTheBox/SearchToggle/styles.js.map +0 -7
- package/esm/outOfTheBox/index.js.map +0 -7
- package/esm/propTypes.js.map +0 -7
- package/esm/styles.js.map +0 -7
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Wrapper } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { Wrapper } from './styles.js';
|
|
4
|
+
|
|
5
|
+
const GlobalHeaderContainer = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
children
|
|
8
|
+
} = _ref;
|
|
9
|
+
return /*#__PURE__*/_jsx("header", {
|
|
10
|
+
"data-testid": "ds-global-header"
|
|
11
|
+
}, void 0, /*#__PURE__*/_jsx(Wrapper, {
|
|
12
|
+
cols: ['auto', '1fr', 'auto']
|
|
13
|
+
}, void 0, children));
|
|
11
14
|
};
|
|
12
|
-
|
|
15
|
+
|
|
16
|
+
export { GlobalHeaderContainer };
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import { defaultProps } from './defaultProps.js';
|
|
3
|
+
|
|
4
4
|
const noop = () => null;
|
|
5
|
+
|
|
5
6
|
const defaultContext = {
|
|
6
7
|
props: defaultProps,
|
|
7
8
|
showIconOnly: false,
|
|
8
9
|
setShowIconOnly: noop,
|
|
9
|
-
instanceUID:
|
|
10
|
+
instanceUID: '',
|
|
10
11
|
globalHeaderToolbarGrid: [],
|
|
11
12
|
globalHeaderBreadcrumbGrid: []
|
|
12
13
|
};
|
|
13
|
-
const GlobalHeaderContext = createContext(defaultContext);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=GlobalHeaderContext.js.map
|
|
14
|
+
const GlobalHeaderContext = /*#__PURE__*/createContext(defaultContext);
|
|
15
|
+
|
|
16
|
+
export { GlobalHeaderContext };
|
package/esm/GlobalHeaderTypes.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=GlobalHeaderTypes.js.map
|
|
1
|
+
|
|
@@ -1,12 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
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';
|
|
11
|
+
import { useContext, useRef, useEffect } from 'react';
|
|
12
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
13
|
+
import { Pipe } from './styles.js';
|
|
14
|
+
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
15
|
+
import { PureBreadcrumb } from './PureBreadcrumb.js';
|
|
16
|
+
import { jsx } from 'react/jsx-runtime';
|
|
17
|
+
|
|
18
|
+
const _excluded = ["label"];
|
|
19
|
+
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
23
|
const GlobalHeaderBreadcrumb = () => {
|
|
8
24
|
const {
|
|
9
|
-
props: {
|
|
25
|
+
props: {
|
|
26
|
+
breadcrumb
|
|
27
|
+
},
|
|
10
28
|
instanceUID,
|
|
11
29
|
showIconOnly,
|
|
12
30
|
setShowIconOnly,
|
|
@@ -16,7 +34,7 @@ const GlobalHeaderBreadcrumb = () => {
|
|
|
16
34
|
const flexRegion = useRef(null);
|
|
17
35
|
useEffect(() => {
|
|
18
36
|
const evaluateShowIconOnly = () => {
|
|
19
|
-
if (flexRegion && flexRegion.current && flexRegion
|
|
37
|
+
if (flexRegion && flexRegion.current && (flexRegion === null || flexRegion === void 0 ? void 0 : flexRegion.current.offsetWidth) <= 0 && !breakpoint.current) {
|
|
20
38
|
setShowIconOnly(true);
|
|
21
39
|
breakpoint.current = window.innerWidth;
|
|
22
40
|
} else if (breakpoint && breakpoint.current !== null && window.innerWidth >= breakpoint.current) {
|
|
@@ -24,33 +42,34 @@ const GlobalHeaderBreadcrumb = () => {
|
|
|
24
42
|
breakpoint.current = null;
|
|
25
43
|
}
|
|
26
44
|
};
|
|
45
|
+
|
|
27
46
|
evaluateShowIconOnly();
|
|
28
|
-
window.addEventListener(
|
|
29
|
-
return () => window.removeEventListener(
|
|
47
|
+
window.addEventListener('resize', evaluateShowIconOnly);
|
|
48
|
+
return () => window.removeEventListener('resize', evaluateShowIconOnly);
|
|
30
49
|
}, [breakpoint, flexRegion, setShowIconOnly]);
|
|
31
|
-
return
|
|
50
|
+
return /*#__PURE__*/_jsx(Grid, {
|
|
32
51
|
height: "100%",
|
|
33
52
|
alignItems: "center",
|
|
34
53
|
justifyContent: "flex-start",
|
|
35
54
|
"aria-label": "breadcrumbs",
|
|
36
55
|
cols: globalHeaderBreadcrumbGrid,
|
|
37
56
|
role: "navigation"
|
|
38
|
-
},
|
|
39
|
-
showIconOnly
|
|
40
|
-
}), breadcrumb
|
|
41
|
-
const {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
}, void 0, /*#__PURE__*/_jsx(Pipe, {
|
|
58
|
+
showIconOnly: showIconOnly
|
|
59
|
+
}), breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.map(item => {
|
|
60
|
+
const {
|
|
61
|
+
label
|
|
62
|
+
} = item,
|
|
63
|
+
rest = _objectWithoutProperties(item, _excluded);
|
|
64
|
+
|
|
65
|
+
return /*#__PURE__*/jsx(PureBreadcrumb, _objectSpread({
|
|
66
|
+
label: label,
|
|
67
|
+
length: breadcrumb.length
|
|
68
|
+
}, rest), "".concat(instanceUID, "-breadcrumb-item-").concat(label));
|
|
69
|
+
}), /*#__PURE__*/jsx("div", {
|
|
49
70
|
id: "global-header-flex-region",
|
|
50
71
|
ref: flexRegion
|
|
51
72
|
}));
|
|
52
73
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=GlobalHeaderBreadcrumb.js.map
|
|
74
|
+
|
|
75
|
+
export { GlobalHeaderBreadcrumb };
|
|
@@ -1,22 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
|
|
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';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { ChevronSmallRight } from '@elliemae/ds-icons';
|
|
11
|
+
import { getDataProps } from '@elliemae/ds-props-helpers';
|
|
12
|
+
import { BreadcrumbItem, LabelButton, Label } from './styles.js';
|
|
13
|
+
import { jsx } from 'react/jsx-runtime';
|
|
14
|
+
|
|
15
|
+
var _ChevronSmallRight;
|
|
16
|
+
|
|
17
|
+
const _excluded = ["onClick", "isSelected", "length", "label", "hasNext", "id"];
|
|
18
|
+
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
+
|
|
21
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22
|
+
const PureBreadcrumb = /*#__PURE__*/React.memo(_ref => {
|
|
23
|
+
let {
|
|
24
|
+
onClick,
|
|
25
|
+
isSelected,
|
|
26
|
+
length,
|
|
27
|
+
label,
|
|
28
|
+
hasNext,
|
|
29
|
+
id
|
|
30
|
+
} = _ref,
|
|
31
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
+
|
|
33
|
+
return /*#__PURE__*/_jsx(BreadcrumbItem, {}, void 0, /*#__PURE__*/jsx(LabelButton, _objectSpread(_objectSpread({
|
|
34
|
+
onClick: onClick,
|
|
35
|
+
"aria-selected": isSelected,
|
|
36
|
+
"data-testid": "gh-breadcrumb-btn",
|
|
37
|
+
id: id
|
|
38
|
+
}, getDataProps(rest)), {}, {
|
|
39
|
+
children: /*#__PURE__*/_jsx(Label, {
|
|
40
|
+
isSelected: !!isSelected,
|
|
41
|
+
isOnlyItem: length === 1
|
|
42
|
+
}, void 0, label)
|
|
43
|
+
})), hasNext && (_ChevronSmallRight || (_ChevronSmallRight = /*#__PURE__*/_jsx(ChevronSmallRight, {
|
|
44
|
+
size: "m",
|
|
45
|
+
fill: "#FFF"
|
|
46
|
+
}))));
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export { PureBreadcrumb };
|
|
@@ -1,54 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const Pipe = styled.span
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
export {
|
|
49
|
-
BreadcrumbItem,
|
|
50
|
-
Label,
|
|
51
|
-
LabelButton,
|
|
52
|
-
Pipe
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=styles.js.map
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
const Pipe = /*#__PURE__*/styled.span.withConfig({
|
|
4
|
+
componentId: "sc-1n5l527-0"
|
|
5
|
+
})(["margin:0 7px 0 0;border-left:", ";height:20px;"], _ref => {
|
|
6
|
+
let {
|
|
7
|
+
showIconOnly
|
|
8
|
+
} = _ref;
|
|
9
|
+
return showIconOnly ? 'none' : '1px solid #fff';
|
|
10
|
+
});
|
|
11
|
+
const BreadcrumbItem = /*#__PURE__*/styled.div.withConfig({
|
|
12
|
+
componentId: "sc-1n5l527-1"
|
|
13
|
+
})(["display:flex;align-items:center;height:100%;"]);
|
|
14
|
+
const LabelButton = /*#__PURE__*/styled.button.withConfig({
|
|
15
|
+
componentId: "sc-1n5l527-2"
|
|
16
|
+
})(["width:fit-content;height:100%;margin:0;padding:0;border:1px solid transparent;background-color:transparent;outline:none;cursor:pointer;position:relative;&:focus{:before{content:'';position:absolute;z-index:2;top:2px;left:-5px;width:calc(100% + 10px);height:calc(100% - 4px);border:2px solid ", ";border-radius:4px;}}"], _ref2 => {
|
|
17
|
+
let {
|
|
18
|
+
theme
|
|
19
|
+
} = _ref2;
|
|
20
|
+
return theme.colors.neutral['000'];
|
|
21
|
+
});
|
|
22
|
+
const Label = /*#__PURE__*/styled.p.withConfig({
|
|
23
|
+
componentId: "sc-1n5l527-3"
|
|
24
|
+
})(["color:", ";", ";font-size:16px;text-transform:uppercase;border-bottom:", ";margin:3px 5px 0 5px;:hover{", ";}"], _ref3 => {
|
|
25
|
+
let {
|
|
26
|
+
theme
|
|
27
|
+
} = _ref3;
|
|
28
|
+
return theme.colors.neutral['000'];
|
|
29
|
+
}, _ref4 => {
|
|
30
|
+
let {
|
|
31
|
+
theme,
|
|
32
|
+
isSelected
|
|
33
|
+
} = _ref4;
|
|
34
|
+
return "-webkit-text-stroke: 0.4px ".concat(isSelected ? theme.colors.neutral['000'] : 'transparent');
|
|
35
|
+
}, _ref5 => {
|
|
36
|
+
let {
|
|
37
|
+
isSelected,
|
|
38
|
+
isOnlyItem
|
|
39
|
+
} = _ref5;
|
|
40
|
+
return "2px solid ".concat(isSelected && !isOnlyItem ? '#FFF' : 'transparent');
|
|
41
|
+
}, _ref6 => {
|
|
42
|
+
let {
|
|
43
|
+
theme
|
|
44
|
+
} = _ref6;
|
|
45
|
+
return "-webkit-text-stroke: 0.4px ".concat(theme.colors.neutral['000']);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export { BreadcrumbItem, Label, LabelButton, Pipe };
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Grid } from
|
|
4
|
-
import { GlobalHeaderContext } from
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
4
|
+
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
5
|
+
|
|
5
6
|
const GlobalHeaderTitle = () => {
|
|
6
7
|
const {
|
|
7
|
-
props: {
|
|
8
|
+
props: {
|
|
9
|
+
Logo,
|
|
10
|
+
LogoWithBrand
|
|
11
|
+
},
|
|
8
12
|
showIconOnly
|
|
9
13
|
} = useContext(GlobalHeaderContext);
|
|
10
|
-
return
|
|
14
|
+
return /*#__PURE__*/_jsx(Grid, {
|
|
11
15
|
alignItems: "center",
|
|
12
|
-
pr: showIconOnly ?
|
|
13
|
-
cols: showIconOnly ? [
|
|
14
|
-
}, Logo && showIconOnly &&
|
|
16
|
+
pr: showIconOnly ? '0px' : '36px',
|
|
17
|
+
cols: showIconOnly ? ['auto'] : ['auto', '1fr']
|
|
18
|
+
}, void 0, Logo && showIconOnly && /*#__PURE__*/_jsx(Logo, {}), LogoWithBrand && !showIconOnly && /*#__PURE__*/_jsx(LogoWithBrand, {}));
|
|
15
19
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=GlobalHeaderTitle.js.map
|
|
20
|
+
|
|
21
|
+
export { GlobalHeaderTitle };
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Grid } from
|
|
4
|
-
import { ToolbarItems } from
|
|
5
|
-
import { GlobalHeaderContext } from
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
4
|
+
import { ToolbarItems } from './ToolbarItems.js';
|
|
5
|
+
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
6
|
+
|
|
7
|
+
var _ToolbarItems;
|
|
6
8
|
const GlobalHeaderToolbar = () => {
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
+
const {
|
|
10
|
+
globalHeaderToolbarGrid
|
|
11
|
+
} = useContext(GlobalHeaderContext);
|
|
12
|
+
return /*#__PURE__*/_jsx(Grid, {
|
|
9
13
|
height: "100%",
|
|
10
14
|
alignItems: "center",
|
|
11
15
|
justifyContent: "center",
|
|
12
16
|
gutter: "xxs",
|
|
13
17
|
cols: globalHeaderToolbarGrid,
|
|
14
18
|
role: "toolbar"
|
|
15
|
-
},
|
|
19
|
+
}, void 0, _ToolbarItems || (_ToolbarItems = /*#__PURE__*/_jsx(ToolbarItems, {})));
|
|
16
20
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=GlobalHeaderToolbar.js.map
|
|
21
|
+
|
|
22
|
+
export { GlobalHeaderToolbar };
|
|
@@ -1,67 +1,97 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
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';
|
|
11
|
+
import { useContext, useMemo } from 'react';
|
|
12
|
+
import { AppPicker } from '../../outOfTheBox/AppPicker/AppPicker.js';
|
|
13
|
+
import { PopupMenu } from '../../outOfTheBox/PopupMenu/PopupMenu.js';
|
|
14
|
+
import { SearchToggle } from '../../outOfTheBox/SearchToggle/SearchToggle.js';
|
|
15
|
+
import { Button } from './styles.js';
|
|
16
|
+
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
17
|
+
import { getDataProps } from '@elliemae/ds-props-helpers';
|
|
18
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
19
|
+
|
|
20
|
+
const _excluded = ["Icon", "type", "onClick", "componentProps", "label", "onKeyPress", "id", "CustomComponent"];
|
|
21
|
+
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
25
|
const ToolbarItems = () => {
|
|
8
26
|
const {
|
|
9
|
-
props: {
|
|
27
|
+
props: {
|
|
28
|
+
toolbar
|
|
29
|
+
},
|
|
10
30
|
instanceUID
|
|
11
31
|
} = useContext(GlobalHeaderContext);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
32
|
+
const itemsList = useMemo(() => toolbar === null || toolbar === void 0 ? void 0 : toolbar.map(item => {
|
|
33
|
+
var _Icon;
|
|
34
|
+
|
|
35
|
+
const {
|
|
36
|
+
Icon,
|
|
37
|
+
type,
|
|
38
|
+
onClick,
|
|
39
|
+
componentProps,
|
|
40
|
+
label,
|
|
41
|
+
onKeyPress,
|
|
42
|
+
id,
|
|
43
|
+
CustomComponent
|
|
44
|
+
} = item,
|
|
45
|
+
otherProps = _objectWithoutProperties(item, _excluded);
|
|
46
|
+
|
|
15
47
|
switch (type) {
|
|
16
|
-
case
|
|
17
|
-
return
|
|
48
|
+
case 'ds-popup-menu':
|
|
49
|
+
return /*#__PURE__*/jsx(PopupMenu, _objectSpread(_objectSpread({
|
|
18
50
|
title: label,
|
|
19
|
-
Icon,
|
|
20
|
-
onClick,
|
|
21
|
-
onKeyPress,
|
|
22
|
-
id
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
51
|
+
Icon: Icon,
|
|
52
|
+
onClick: onClick,
|
|
53
|
+
onKeyPress: onKeyPress,
|
|
54
|
+
id: id
|
|
55
|
+
}, otherProps), {}, {
|
|
56
|
+
componentProps: componentProps
|
|
57
|
+
}), "".concat(instanceUID, "-ds-popup-menu-").concat(label));
|
|
58
|
+
|
|
59
|
+
case 'ds-app-picker':
|
|
60
|
+
return /*#__PURE__*/jsx(AppPicker, _objectSpread({
|
|
61
|
+
label: label,
|
|
62
|
+
id: id,
|
|
63
|
+
componentProps: componentProps
|
|
64
|
+
}, otherProps), "".concat(instanceUID, "-ds-app-picker-").concat(label));
|
|
65
|
+
|
|
66
|
+
case 'ds-search-toggle':
|
|
67
|
+
return /*#__PURE__*/jsx(SearchToggle, _objectSpread({
|
|
68
|
+
id: id,
|
|
69
|
+
componentProps: componentProps
|
|
70
|
+
}, otherProps), "".concat(instanceUID, "-ds-search-toggle-").concat(id));
|
|
71
|
+
|
|
72
|
+
case 'custom':
|
|
73
|
+
if (CustomComponent) return /*#__PURE__*/_jsx(CustomComponent, {
|
|
74
|
+
item: item
|
|
26
75
|
});
|
|
27
|
-
case "ds-app-picker":
|
|
28
|
-
return /* @__PURE__ */ React2.createElement(AppPicker, {
|
|
29
|
-
label,
|
|
30
|
-
key: `${instanceUID}-ds-app-picker-${label}`,
|
|
31
|
-
id,
|
|
32
|
-
componentProps,
|
|
33
|
-
...otherProps
|
|
34
|
-
});
|
|
35
|
-
case "ds-search-toggle":
|
|
36
|
-
return /* @__PURE__ */ React2.createElement(SearchToggle, {
|
|
37
|
-
key: `${instanceUID}-ds-search-toggle-${id}`,
|
|
38
|
-
id,
|
|
39
|
-
componentProps,
|
|
40
|
-
...otherProps
|
|
41
|
-
});
|
|
42
|
-
case "custom":
|
|
43
|
-
if (CustomComponent)
|
|
44
|
-
return /* @__PURE__ */ React2.createElement(CustomComponent, {
|
|
45
|
-
item
|
|
46
|
-
});
|
|
47
76
|
return null;
|
|
77
|
+
|
|
48
78
|
default:
|
|
49
|
-
return
|
|
50
|
-
onClick,
|
|
51
|
-
key: `${instanceUID}-ds-toolbar-button-${label}`,
|
|
79
|
+
return /*#__PURE__*/jsx(Button, _objectSpread(_objectSpread({
|
|
80
|
+
onClick: onClick,
|
|
52
81
|
title: label,
|
|
53
82
|
"data-testid": "gh-toolbar-item",
|
|
54
|
-
id
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
83
|
+
id: id
|
|
84
|
+
}, getDataProps(otherProps)), {}, {
|
|
85
|
+
children: _Icon || (_Icon = /*#__PURE__*/_jsx(Icon, {
|
|
86
|
+
fill: "#FFF",
|
|
87
|
+
size: "m"
|
|
88
|
+
}))
|
|
89
|
+
}), "".concat(instanceUID, "-ds-toolbar-button-").concat(label));
|
|
60
90
|
}
|
|
61
91
|
}), [toolbar, instanceUID]);
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
ToolbarItems
|
|
92
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
93
|
+
children: itemsList
|
|
94
|
+
});
|
|
66
95
|
};
|
|
67
|
-
|
|
96
|
+
|
|
97
|
+
export { ToolbarItems };
|
|
@@ -1,32 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const Button = styled.button
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
position: absolute;
|
|
19
|
-
z-index: 2;
|
|
20
|
-
top: 2px;
|
|
21
|
-
left: 2px;
|
|
22
|
-
width: calc(100% - 4px);
|
|
23
|
-
height: calc(100% - 4px);
|
|
24
|
-
border: 2px solid ${({ theme }) => theme.colors.neutral["000"]};
|
|
25
|
-
border-radius: 4px;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
export {
|
|
30
|
-
Button
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=styles.js.map
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
const Button = /*#__PURE__*/styled.button.withConfig({
|
|
4
|
+
componentId: "sc-1gqj0i3-0"
|
|
5
|
+
})(["height:40px;width:40px;border:none;background-color:transparent;cursor:pointer;position:relative;outline:none;&:hover:not(:focus){background-color:", ";outline:none;}&:focus{:before{content:'';position:absolute;z-index:2;top:2px;left:2px;width:calc(100% - 4px);height:calc(100% - 4px);border:2px solid ", ";border-radius:4px;}}"], _ref => {
|
|
6
|
+
let {
|
|
7
|
+
theme
|
|
8
|
+
} = _ref;
|
|
9
|
+
return theme.colors.brand[700];
|
|
10
|
+
}, _ref2 => {
|
|
11
|
+
let {
|
|
12
|
+
theme
|
|
13
|
+
} = _ref2;
|
|
14
|
+
return theme.colors.neutral['000'];
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export { Button };
|