@elliemae/ds-global-header 2.0.0-alpha.1 → 2.0.0-alpha.13

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 (48) hide show
  1. package/cjs/GlobalHeader.js +2 -2
  2. package/cjs/GlobalHeaderContainer.js +10 -7
  3. package/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js +14 -12
  4. package/cjs/components/Breadcrumb/PureBreadcrumb.js +22 -20
  5. package/cjs/components/Breadcrumb/styles.js +44 -23
  6. package/cjs/components/Title/GlobalHeaderTitle.js +2 -2
  7. package/cjs/components/Toolbar/GlobalHeaderToolbar.js +2 -2
  8. package/cjs/components/Toolbar/ToolbarItems.js +20 -19
  9. package/cjs/components/Toolbar/styles.js +17 -8
  10. package/cjs/config/useGetPropsWithDefaults.js +6 -1
  11. package/cjs/config/useGlobalHeader.js +12 -3
  12. package/cjs/config/useValidateProps.js +5 -2
  13. package/cjs/config/validateHelpers.js +5 -28
  14. package/cjs/defaultProps.js +4 -2
  15. package/cjs/index.js +1 -1
  16. package/cjs/outOfTheBox/AppPicker/AppPicker.js +62 -41
  17. package/cjs/outOfTheBox/PopupMenu/PopupMenu.js +22 -36
  18. package/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js +34 -16
  19. package/cjs/outOfTheBox/PopupMenu/styles.js +10 -7
  20. package/cjs/styles.js +7 -4
  21. package/esm/GlobalHeaderContainer.js +10 -7
  22. package/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js +11 -9
  23. package/esm/components/Breadcrumb/PureBreadcrumb.js +22 -19
  24. package/esm/components/Breadcrumb/styles.js +40 -19
  25. package/esm/components/Toolbar/ToolbarItems.js +17 -17
  26. package/esm/components/Toolbar/styles.js +16 -7
  27. package/esm/config/useGetPropsWithDefaults.js +5 -0
  28. package/esm/config/useGlobalHeader.js +11 -2
  29. package/esm/config/useValidateProps.js +5 -2
  30. package/esm/config/validateHelpers.js +5 -28
  31. package/esm/defaultProps.js +4 -2
  32. package/esm/outOfTheBox/AppPicker/AppPicker.js +62 -40
  33. package/esm/outOfTheBox/PopupMenu/PopupMenu.js +22 -35
  34. package/esm/outOfTheBox/PopupMenu/PopupMenuContent.js +35 -18
  35. package/esm/outOfTheBox/PopupMenu/styles.js +6 -3
  36. package/esm/styles.js +6 -3
  37. package/package.json +9 -9
  38. package/types/GlobalHeader.d.ts +30 -5
  39. package/types/components/Breadcrumb/styles.d.ts +4 -4
  40. package/types/components/Toolbar/styles.d.ts +1 -1
  41. package/types/config/validateHelpers.d.ts +4 -4
  42. package/types/index.d.d.ts +10 -16
  43. package/types/outOfTheBox/AppPicker/AppPicker.d.ts +8 -3
  44. package/types/outOfTheBox/PopupMenu/styles.d.ts +4 -4
  45. package/types/propTypes.d.ts +27 -6
  46. package/types/styles.d.ts +1 -1
  47. package/cjs/package.json +0 -7
  48. package/esm/package.json +0 -7
@@ -3,70 +3,91 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _jsx = require('@babel/runtime/helpers/jsx');
6
+ require('core-js/modules/web.dom-collections.iterator.js');
6
7
  var React = require('react');
7
8
  var dsAppPicker = require('@elliemae/ds-app-picker');
8
- var MenuPicker = require('@elliemae/ds-icons/MenuPicker');
9
+ var dsUtilities = require('@elliemae/ds-utilities');
10
+ var dsIcons = require('@elliemae/ds-icons');
9
11
  var styles = require('../../components/Toolbar/styles.js');
10
12
  var jsxRuntime = require('react/jsx-runtime');
11
13
 
12
14
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
15
 
14
16
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
15
- var MenuPicker__default = /*#__PURE__*/_interopDefaultLegacy(MenuPicker);
16
17
 
17
18
  var _MenuPicker;
18
- const AppPicker = ({
19
- label,
20
- apps,
21
- customApps,
22
- sectionTitle,
23
- customSectionTitle,
24
- onClick
25
- }) => {
26
- var _DSAppPicker;
27
-
19
+ const AppPicker = _ref => {
20
+ let {
21
+ label,
22
+ apps,
23
+ icon,
24
+ customApps,
25
+ sectionTitle,
26
+ customSectionTitle,
27
+ actionRef,
28
+ isOpen: userIsOpen,
29
+ onKeyDown: userOnKeyDown,
30
+ onClickOutside: userOnClickOutside,
31
+ renderTrigger: userRenderTrigger,
32
+ onClose,
33
+ triggerRef,
34
+ triggerOnClick
35
+ } = _ref;
28
36
  const [isOpen, setIsOpen] = React.useState(false);
29
- const buttonRef = React.useRef();
30
- const handleKeyDown = React.useCallback(e => {
37
+ const buttonRef = React.useRef(null);
38
+ const handleTriggerKeyDown = React.useCallback(e => {
31
39
  if (e.code === 'Enter' || e.code === 'Space') {
32
40
  setIsOpen(true);
33
41
  }
34
42
  }, []);
35
- const handleOnClose = React.useCallback(() => {
36
- var _buttonRef$current;
43
+ const handleAppPickerOnKeyDown = React.useCallback(e => {
44
+ if (e.code === 'Escape') {
45
+ var _buttonRef$current;
37
46
 
47
+ setIsOpen(false);
48
+ buttonRef === null || buttonRef === void 0 ? void 0 : (_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
49
+ }
50
+ }, []);
51
+ const handleOnClickOutside = React.useCallback(() => {
38
52
  setIsOpen(false);
39
- (_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
40
53
  }, []);
41
- const handleOnClick = React.useCallback(e => {
54
+ const handleOnClick = React.useCallback(() => {
42
55
  setIsOpen(true);
43
- onClick(e);
44
- }, [onClick]);
45
- const trigger = React.useMemo(() => ({
46
- ref
47
- }) => /*#__PURE__*/jsxRuntime.jsx("div", {
48
- ref: ref,
49
- children: /*#__PURE__*/jsxRuntime.jsx(styles.Button, {
50
- onClick: handleOnClick,
51
- onKeyDown: handleKeyDown,
52
- ref: buttonRef,
53
- title: label,
54
- "data-testid": "gh-toolbar-item",
55
- children: _MenuPicker || (_MenuPicker = /*#__PURE__*/_jsx__default['default'](MenuPicker__default['default'], {
56
- fill: "#FFF",
57
- size: "m"
58
- }))
59
- })
60
- }), [handleKeyDown, handleOnClick, label]);
61
- return React.useMemo(() => _DSAppPicker || (_DSAppPicker = /*#__PURE__*/_jsx__default['default'](dsAppPicker.DSAppPicker, {
62
- isOpen: isOpen,
56
+ }, []);
57
+ const renderTrigger = React.useMemo(() => _ref2 => {
58
+ let {
59
+ ref
60
+ } = _ref2;
61
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
62
+ ref: ref,
63
+ children: /*#__PURE__*/jsxRuntime.jsx(styles.Button, {
64
+ onClick: triggerOnClick !== null && triggerOnClick !== void 0 ? triggerOnClick : handleOnClick,
65
+ onKeyDown: handleTriggerKeyDown,
66
+ ref: dsUtilities.mergeRefs(buttonRef, triggerRef),
67
+ title: label,
68
+ "data-testid": "gh-toolbar-item",
69
+ children: _MenuPicker || (_MenuPicker = /*#__PURE__*/_jsx__default["default"](dsIcons.MenuPicker, {
70
+ fill: "#FFF",
71
+ width: 20.73,
72
+ height: 20.73
73
+ }))
74
+ })
75
+ });
76
+ }, [triggerOnClick, handleOnClick, handleTriggerKeyDown, label]);
77
+ return /*#__PURE__*/_jsx__default["default"](dsAppPicker.DSAppPicker, {
63
78
  apps: apps,
64
79
  customApps: customApps,
65
80
  sectionTitle: sectionTitle,
66
81
  customSectionTitle: customSectionTitle,
67
- onClose: handleOnClose,
68
- renderTrigger: trigger
69
- })), [apps, customApps, customSectionTitle, handleOnClose, isOpen, sectionTitle, trigger]);
82
+ icon: icon,
83
+ onKeyDown: userOnKeyDown !== null && userOnKeyDown !== void 0 ? userOnKeyDown : handleAppPickerOnKeyDown,
84
+ actionRef: actionRef,
85
+ onClickOutside: userOnClickOutside !== null && userOnClickOutside !== void 0 ? userOnClickOutside : handleOnClickOutside,
86
+ renderTrigger: userRenderTrigger !== null && userRenderTrigger !== void 0 ? userRenderTrigger : renderTrigger,
87
+ isOpen: userIsOpen !== null && userIsOpen !== void 0 ? userIsOpen : isOpen,
88
+ onClose: onClose,
89
+ triggerRef: triggerRef
90
+ });
70
91
  };
71
92
 
72
93
  exports.AppPicker = AppPicker;
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _jsx = require('@babel/runtime/helpers/jsx');
6
+ require('core-js/modules/web.dom-collections.iterator.js');
6
7
  var React = require('react');
7
- var Popover = require('@elliemae/ds-popover');
8
+ var dsPopperjs = require('@elliemae/ds-popperjs');
8
9
  var PopupMenuContent = require('./PopupMenuContent.js');
9
10
  var styles = require('../../components/Toolbar/styles.js');
10
11
  var jsxRuntime = require('react/jsx-runtime');
@@ -12,30 +13,28 @@ var jsxRuntime = require('react/jsx-runtime');
12
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
14
 
14
15
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
15
- var Popover__default = /*#__PURE__*/_interopDefaultLegacy(Popover);
16
16
 
17
- const PopupMenu = ({
18
- Icon,
19
- options,
20
- closeOnClick,
21
- title,
22
- onClick
23
- }) => {
17
+ const PopupMenu = _ref => {
24
18
  var _PopupMenuContent;
25
19
 
20
+ let {
21
+ Icon,
22
+ options,
23
+ closeOnClick,
24
+ title,
25
+ onClick
26
+ } = _ref;
26
27
  const [isOpen, setIsOpen] = React.useState(false);
27
- const buttonRef = React.useRef();
28
+ const [buttonRef, setButtonRef] = React.useState(null);
28
29
  const handleKeyPress = React.useCallback(e => {
29
30
  if (e.code === 'Enter' || e.code === 'Space') {
30
31
  setIsOpen(true);
31
32
  }
32
33
  }, []);
33
34
  const handleOnClose = React.useCallback(() => {
34
- var _buttonRef$current;
35
-
36
35
  setIsOpen(false);
37
- (_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.focus();
38
- }, []);
36
+ buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.focus();
37
+ }, [buttonRef]);
39
38
  const handleTriggerOnClick = React.useCallback(e => {
40
39
  setIsOpen(true);
41
40
  onClick(e);
@@ -43,39 +42,26 @@ const PopupMenu = ({
43
42
  const handleItemClick = React.useCallback(() => {
44
43
  if (closeOnClick) handleOnClose();
45
44
  }, [closeOnClick, handleOnClose]);
46
- const handleClickOutside = React.useCallback(() => setIsOpen(false), []);
47
- const content = React.useMemo(() => _PopupMenuContent || (_PopupMenuContent = /*#__PURE__*/_jsx__default['default'](PopupMenuContent.PopupMenuContent, {
45
+ const content = React.useMemo(() => _PopupMenuContent || (_PopupMenuContent = /*#__PURE__*/_jsx__default["default"](PopupMenuContent.PopupMenuContent, {
48
46
  options: options,
49
47
  onItemClick: handleItemClick,
50
48
  onClose: handleOnClose
51
49
  })), [options, handleItemClick, handleOnClose]);
52
- const trigger = React.useMemo(() => ({
53
- ref
54
- }) => /*#__PURE__*/jsxRuntime.jsx(styles.Button, {
50
+ return /*#__PURE__*/_jsx__default["default"]("div", {}, void 0, /*#__PURE__*/jsxRuntime.jsx(styles.Button, {
55
51
  onClick: handleTriggerOnClick,
56
52
  onKeyPress: handleKeyPress,
57
53
  title: title,
58
- ref: buttonRef,
54
+ ref: setButtonRef,
59
55
  "data-testid": "gh-toolbar-item",
60
- children: /*#__PURE__*/_jsx__default['default'](Icon, {
61
- innerRef: ref,
56
+ children: Icon && /*#__PURE__*/_jsx__default["default"](Icon, {
62
57
  fill: "#FFF",
63
58
  size: "m"
64
59
  })
65
- }), [Icon, handleKeyPress, handleTriggerOnClick, title]);
66
- return React.useMemo(() => /*#__PURE__*/_jsx__default['default'](Popover__default['default'], {
67
- isOpen: isOpen,
68
- content: content,
69
- onClickOutside: handleClickOutside,
70
- placement: "bottom",
71
- interactionType: "click",
72
- showArrow: true,
73
- style: {
74
- padding: '0',
75
- width: 'fit-content'
76
- },
77
- renderTrigger: trigger
78
- }), [content, handleClickOutside, isOpen, trigger]);
60
+ }), /*#__PURE__*/_jsx__default["default"](dsPopperjs.DSPopperJS, {
61
+ referenceElement: buttonRef,
62
+ showPopover: isOpen,
63
+ closeContextMenu: handleOnClose
64
+ }, void 0, content));
79
65
  };
80
66
 
81
67
  exports.PopupMenu = PopupMenu;
@@ -3,7 +3,16 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _jsx = require('@babel/runtime/helpers/jsx');
6
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
7
+ require('core-js/modules/esnext.async-iterator.map.js');
8
+ require('core-js/modules/esnext.iterator.map.js');
9
+ require('core-js/modules/esnext.async-iterator.filter.js');
10
+ require('core-js/modules/esnext.iterator.constructor.js');
11
+ require('core-js/modules/esnext.iterator.filter.js');
12
+ require('core-js/modules/esnext.async-iterator.for-each.js');
13
+ require('core-js/modules/esnext.iterator.for-each.js');
6
14
  var React = require('react');
15
+ var dsPropsHelpers = require('@elliemae/ds-props-helpers');
7
16
  var styles = require('./styles.js');
8
17
  var GlobalHeaderContext = require('../../GlobalHeaderContext.js');
9
18
  var jsxRuntime = require('react/jsx-runtime');
@@ -11,36 +20,41 @@ var jsxRuntime = require('react/jsx-runtime');
11
20
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
21
 
13
22
  var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
23
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
14
24
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
25
 
16
- const PopupMenuContent = /*#__PURE__*/React__default['default'].memo(({
17
- options,
18
- onItemClick,
19
- onClose
20
- }) => {
26
+ 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; }
27
+
28
+ 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; }
29
+ const PopupMenuContent = /*#__PURE__*/React__default["default"].memo(_ref => {
30
+ let {
31
+ options,
32
+ onItemClick,
33
+ onClose
34
+ } = _ref;
21
35
  const {
22
36
  instanceUID
23
37
  } = React.useContext(GlobalHeaderContext.GlobalHeaderContext);
24
- const menuRef = React.useRef();
38
+ const menuRef = React.useRef(null);
25
39
  React.useEffect(() => {
26
40
  var _menuRef$current, _menuRef$current$firs;
27
41
 
28
42
  (_menuRef$current = menuRef.current) === null || _menuRef$current === void 0 ? void 0 : (_menuRef$current$firs = _menuRef$current.firstChild) === null || _menuRef$current$firs === void 0 ? void 0 : _menuRef$current$firs.focus();
29
43
  }, []);
30
44
  const content = React.useMemo(() => options.map(option => {
31
- var _Content;
32
-
33
45
  const {
34
46
  type,
35
- icon,
36
- label,
47
+ Icon,
48
+ label = '',
37
49
  onClick,
38
50
  Content
39
51
  } = option;
40
52
 
53
+ const ariaAndDataProps = _objectSpread(_objectSpread({}, dsPropsHelpers.getAriaProps(option)), dsPropsHelpers.getDataProps(option));
54
+
41
55
  const handleClick = e => {
42
56
  onItemClick(e);
43
- onClick(e);
57
+ if (onClick) onClick(e);
44
58
  };
45
59
 
46
60
  const handleKeyDown = e => {
@@ -49,19 +63,23 @@ const PopupMenuContent = /*#__PURE__*/React__default['default'].memo(({
49
63
 
50
64
  switch (type) {
51
65
  case 'separator':
52
- return /*#__PURE__*/_jsx__default['default'](styles.Separator, {}, `${instanceUID}-separator-${label}`);
66
+ return /*#__PURE__*/jsxRuntime.jsx(styles.Separator, _objectSpread({}, ariaAndDataProps), "".concat(instanceUID, "-separator-").concat(label));
53
67
 
54
68
  case 'custom':
55
- return /*#__PURE__*/_jsx__default['default'](styles.ItemWrapper, {
69
+ return /*#__PURE__*/jsxRuntime.jsx(styles.ItemWrapper, _objectSpread(_objectSpread({
56
70
  onClick: handleClick,
57
71
  onKeyDown: handleKeyDown
58
- }, `${instanceUID}-popup-${label}`, _Content || (_Content = /*#__PURE__*/_jsx__default['default'](Content, {})));
72
+ }, ariaAndDataProps), {}, {
73
+ children: Content && /*#__PURE__*/_jsx__default["default"](Content, {})
74
+ }), "".concat(instanceUID, "-popup-").concat(label));
59
75
 
60
76
  default:
61
- return /*#__PURE__*/_jsx__default['default'](styles.ItemWrapper, {
77
+ return /*#__PURE__*/jsxRuntime.jsxs(styles.ItemWrapper, _objectSpread(_objectSpread({
62
78
  onClick: handleClick,
63
79
  onKeyDown: handleKeyDown
64
- }, `${instanceUID}-popup-${label}`, icon, styles.Label && /*#__PURE__*/_jsx__default['default'](styles.Label, {}, void 0, label));
80
+ }, ariaAndDataProps), {}, {
81
+ children: [Icon && /*#__PURE__*/_jsx__default["default"](Icon, {}), styles.Label && /*#__PURE__*/_jsx__default["default"](styles.Label, {}, void 0, label)]
82
+ }), "".concat(instanceUID, "-popup-").concat(label));
65
83
  }
66
84
  }), [onClose, onItemClick, options, instanceUID]);
67
85
  return /*#__PURE__*/jsxRuntime.jsx(styles.List, {
@@ -8,18 +8,21 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
8
8
 
9
9
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
10
10
 
11
- const List = /*#__PURE__*/styled__default['default'].div.withConfig({
11
+ const List = /*#__PURE__*/styled__default["default"].div.withConfig({
12
12
  componentId: "sc-snqcgs-0"
13
13
  })(["padding:5px 0px;"]);
14
- const ItemWrapper = /*#__PURE__*/styled__default['default'].button.withConfig({
14
+ const ItemWrapper = /*#__PURE__*/styled__default["default"].button.withConfig({
15
15
  componentId: "sc-snqcgs-1"
16
- })(["display:flex;align-items:center;justify-content:center;width:100%;padding:0 20px;cursor:pointer;border:1px solid transparent;background-color:transparent;outline:none;:hover,:focus{border:", ";}"], ({
17
- theme
18
- }) => `1px solid ${theme.colors.brand[600]}`);
19
- const Label = /*#__PURE__*/styled__default['default'].p.withConfig({
16
+ })(["display:flex;align-items:center;justify-content:center;width:100%;padding:0 20px;cursor:pointer;border:1px solid transparent;background-color:transparent;outline:none;:hover,:focus{border:", ";}"], _ref => {
17
+ let {
18
+ theme
19
+ } = _ref;
20
+ return "1px solid ".concat(theme.colors.brand[600]);
21
+ });
22
+ const Label = /*#__PURE__*/styled__default["default"].p.withConfig({
20
23
  componentId: "sc-snqcgs-2"
21
24
  })(["width:100%;font-size:14px;margin:10px;"]);
22
- const Separator = /*#__PURE__*/styled__default['default'].div.withConfig({
25
+ const Separator = /*#__PURE__*/styled__default["default"].div.withConfig({
23
26
  componentId: "sc-snqcgs-3"
24
27
  })(["width:100%;border:none;border-bottom:1px solid #ccc;"]);
25
28
 
package/cjs/styles.js CHANGED
@@ -9,10 +9,13 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
11
 
12
- const Wrapper = /*#__PURE__*/styled__default['default'](dsGrid.GridContainer).withConfig({
12
+ const Wrapper = /*#__PURE__*/styled__default["default"](dsGrid.GridContainer).withConfig({
13
13
  componentId: "sc-1v5zxxm-0"
14
- })(["background-image:linear-gradient(45deg,#0f364a 0%,#1b6392 54%,#164566 100%);color:", ";width:100%;height:40px;padding:0 24px 0 12px;"], ({
15
- theme
16
- }) => theme.colors.neutral['000']);
14
+ })(["background-image:linear-gradient(45deg,#0f364a 0%,#1b6392 54%,#164566 100%);color:", ";width:100%;height:40px;padding:0 24px 0 12px;"], _ref => {
15
+ let {
16
+ theme
17
+ } = _ref;
18
+ return theme.colors.neutral['000'];
19
+ });
17
20
 
18
21
  exports.Wrapper = Wrapper;
@@ -2,12 +2,15 @@ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import 'react';
3
3
  import { Wrapper } from './styles.js';
4
4
 
5
- const GlobalHeaderContainer = ({
6
- children
7
- }) => /*#__PURE__*/_jsx("header", {
8
- "data-testid": "ds-global-header"
9
- }, void 0, /*#__PURE__*/_jsx(Wrapper, {
10
- cols: ['auto', '1fr', 'auto']
11
- }, void 0, children));
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));
14
+ };
12
15
 
13
16
  export { GlobalHeaderContainer };
@@ -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 { useContext, useRef, useEffect } from 'react';
3
5
  import { Grid } from '@elliemae/ds-grid';
4
6
  import { Pipe } from './styles.js';
@@ -16,14 +18,14 @@ const GlobalHeaderBreadcrumb = () => {
16
18
  setShowIconOnly,
17
19
  globalHeaderBreadcrumbGrid
18
20
  } = useContext(GlobalHeaderContext);
19
- const breakpoint = useRef();
20
- const flexRegion = useRef();
21
+ const breakpoint = useRef(null);
22
+ const flexRegion = useRef(null);
21
23
  useEffect(() => {
22
24
  const evaluateShowIconOnly = () => {
23
- if ((flexRegion === null || flexRegion === void 0 ? void 0 : flexRegion.current.offsetWidth) <= 0 && !breakpoint.current) {
25
+ if (flexRegion && flexRegion.current && (flexRegion === null || flexRegion === void 0 ? void 0 : flexRegion.current.offsetWidth) <= 0 && !breakpoint.current) {
24
26
  setShowIconOnly(true);
25
27
  breakpoint.current = window.innerWidth;
26
- } else if (window.innerWidth >= breakpoint.current) {
28
+ } else if (breakpoint && breakpoint.current !== null && window.innerWidth >= breakpoint.current) {
27
29
  setShowIconOnly(false);
28
30
  breakpoint.current = null;
29
31
  }
@@ -36,13 +38,13 @@ const GlobalHeaderBreadcrumb = () => {
36
38
  return /*#__PURE__*/_jsx(Grid, {
37
39
  height: "100%",
38
40
  alignItems: "center",
39
- justifyContent: "left",
40
- role: "navigation",
41
+ justifyContent: "flex-start",
41
42
  "aria-label": "breadcrumbs",
42
- cols: globalHeaderBreadcrumbGrid
43
+ cols: globalHeaderBreadcrumbGrid,
44
+ role: "navigation"
43
45
  }, void 0, /*#__PURE__*/_jsx(Pipe, {
44
46
  showIconOnly: showIconOnly
45
- }), breadcrumb.map(item => {
47
+ }), breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.map(item => {
46
48
  const {
47
49
  label,
48
50
  hasNext,
@@ -55,7 +57,7 @@ const GlobalHeaderBreadcrumb = () => {
55
57
  isSelected: isSelected,
56
58
  onClick: onClick,
57
59
  length: breadcrumb.length
58
- }, `${instanceUID}-breadcrumb-item-${label}`);
60
+ }, "".concat(instanceUID, "-breadcrumb-item-").concat(label));
59
61
  }), /*#__PURE__*/jsx("div", {
60
62
  id: "global-header-flex-region",
61
63
  ref: flexRegion
@@ -1,25 +1,28 @@
1
1
  import _jsx from '@babel/runtime/helpers/esm/jsx';
2
2
  import React from 'react';
3
- import Chevron from '@elliemae/ds-icons/ChevronSmallRight';
3
+ import { ChevronSmallRight } from '@elliemae/ds-icons';
4
4
  import { BreadcrumbItem, LabelButton, Label } from './styles.js';
5
5
 
6
- var _Chevron;
7
- const PureBreadcrumb = /*#__PURE__*/React.memo(({
8
- onClick,
9
- isSelected,
10
- length,
11
- label,
12
- hasNext
13
- }) => /*#__PURE__*/_jsx(BreadcrumbItem, {}, void 0, /*#__PURE__*/_jsx(LabelButton, {
14
- onClick: onClick,
15
- "aria-selected": isSelected,
16
- "data-testid": "gh-breadcrumb-btn"
17
- }, void 0, /*#__PURE__*/_jsx(Label, {
18
- isSelected: isSelected,
19
- isOnlyItem: length === 1
20
- }, void 0, label)), hasNext && (_Chevron || (_Chevron = /*#__PURE__*/_jsx(Chevron, {
21
- size: "m",
22
- fill: "#FFF"
23
- })))));
6
+ var _ChevronSmallRight;
7
+ const PureBreadcrumb = /*#__PURE__*/React.memo(_ref => {
8
+ let {
9
+ onClick,
10
+ isSelected,
11
+ length,
12
+ label,
13
+ hasNext
14
+ } = _ref;
15
+ return /*#__PURE__*/_jsx(BreadcrumbItem, {}, void 0, /*#__PURE__*/_jsx(LabelButton, {
16
+ onClick: onClick,
17
+ "aria-selected": isSelected,
18
+ "data-testid": "gh-breadcrumb-btn"
19
+ }, void 0, /*#__PURE__*/_jsx(Label, {
20
+ isSelected: !!isSelected,
21
+ isOnlyItem: length === 1
22
+ }, void 0, label)), hasNext && (_ChevronSmallRight || (_ChevronSmallRight = /*#__PURE__*/_jsx(ChevronSmallRight, {
23
+ size: "m",
24
+ fill: "#FFF"
25
+ }))));
26
+ });
24
27
 
25
28
  export { PureBreadcrumb };
@@ -2,31 +2,52 @@ import styled from 'styled-components';
2
2
 
3
3
  const Pipe = /*#__PURE__*/styled.span.withConfig({
4
4
  componentId: "sc-1n5l527-0"
5
- })(["margin:0 7px 0 0;border-left:", ";height:20px;"], ({
6
- showIconOnly
7
- }) => showIconOnly ? 'none' : '1px solid #fff');
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
+ });
8
11
  const BreadcrumbItem = /*#__PURE__*/styled.div.withConfig({
9
12
  componentId: "sc-1n5l527-1"
10
13
  })(["display:flex;align-items:center;height:100%;"]);
11
14
  const LabelButton = /*#__PURE__*/styled.button.withConfig({
12
15
  componentId: "sc-1n5l527-2"
13
- })(["width:fit-content;height:100%;margin:0;padding:0;border:1px solid transparent;background-color:transparent;outline:none;cursor:pointer;position:relative;&:focus{:after{content:'';position:absolute;top:0;left:-7px;width:calc(100% + 14px);height:100%;border:4px solid ", ";border-radius:6px;}: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;}}"], ({
14
- theme
15
- }) => theme.colors.brand[700], ({
16
- theme
17
- }) => theme.colors.neutral['000']);
16
+ })(["width:fit-content;height:100%;margin:0;padding:0;border:1px solid transparent;background-color:transparent;outline:none;cursor:pointer;position:relative;&:focus{:after{content:'';position:absolute;top:0;left:-7px;width:calc(100% + 14px);height:100%;border:4px solid ", ";border-radius:6px;}: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.brand[700];
21
+ }, _ref3 => {
22
+ let {
23
+ theme
24
+ } = _ref3;
25
+ return theme.colors.neutral['000'];
26
+ });
18
27
  const Label = /*#__PURE__*/styled.p.withConfig({
19
28
  componentId: "sc-1n5l527-3"
20
- })(["color:", ";", ";font-size:16px;text-transform:uppercase;border-bottom:", ";margin:3px 5px 0 5px;:hover{", ";}"], ({
21
- theme
22
- }) => theme.colors.neutral['000'], ({
23
- theme,
24
- isSelected
25
- }) => `-webkit-text-stroke: 0.4px ${isSelected ? theme.colors.neutral['000'] : 'transparent'}`, ({
26
- isSelected,
27
- isOnlyItem
28
- }) => `2px solid ${isSelected && !isOnlyItem ? '#FFF' : 'transparent'}`, ({
29
- theme
30
- }) => `-webkit-text-stroke: 0.4px ${theme.colors.neutral['000']}`);
29
+ })(["color:", ";", ";font-size:16px;text-transform:uppercase;border-bottom:", ";margin:3px 5px 0 5px;:hover{", ";}"], _ref4 => {
30
+ let {
31
+ theme
32
+ } = _ref4;
33
+ return theme.colors.neutral['000'];
34
+ }, _ref5 => {
35
+ let {
36
+ theme,
37
+ isSelected
38
+ } = _ref5;
39
+ return "-webkit-text-stroke: 0.4px ".concat(isSelected ? theme.colors.neutral['000'] : 'transparent');
40
+ }, _ref6 => {
41
+ let {
42
+ isSelected,
43
+ isOnlyItem
44
+ } = _ref6;
45
+ return "2px solid ".concat(isSelected && !isOnlyItem ? '#FFF' : 'transparent');
46
+ }, _ref7 => {
47
+ let {
48
+ theme
49
+ } = _ref7;
50
+ return "-webkit-text-stroke: 0.4px ".concat(theme.colors.neutral['000']);
51
+ });
31
52
 
32
53
  export { BreadcrumbItem, Label, LabelButton, Pipe };
@@ -1,4 +1,12 @@
1
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
1
2
  import _jsx from '@babel/runtime/helpers/esm/jsx';
3
+ import 'core-js/modules/esnext.async-iterator.map.js';
4
+ import 'core-js/modules/esnext.iterator.map.js';
5
+ import 'core-js/modules/esnext.async-iterator.filter.js';
6
+ import 'core-js/modules/esnext.iterator.constructor.js';
7
+ import 'core-js/modules/esnext.iterator.filter.js';
8
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
9
+ import 'core-js/modules/esnext.iterator.for-each.js';
2
10
  import { useContext, useMemo } from 'react';
3
11
  import { AppPicker } from '../../outOfTheBox/AppPicker/AppPicker.js';
4
12
  import { PopupMenu } from '../../outOfTheBox/PopupMenu/PopupMenu.js';
@@ -6,6 +14,9 @@ import { Button } from './styles.js';
6
14
  import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
7
15
  import { jsx, Fragment } from 'react/jsx-runtime';
8
16
 
17
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
18
+
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; }
9
20
  const ToolbarItems = () => {
10
21
  const {
11
22
  props: {
@@ -13,7 +24,7 @@ const ToolbarItems = () => {
13
24
  },
14
25
  instanceUID
15
26
  } = useContext(GlobalHeaderContext);
16
- const itemsList = useMemo(() => toolbar.map(item => {
27
+ const itemsList = useMemo(() => toolbar === null || toolbar === void 0 ? void 0 : toolbar.map(item => {
17
28
  var _Icon;
18
29
 
19
30
  const {
@@ -36,30 +47,19 @@ const ToolbarItems = () => {
36
47
  Icon: Icon,
37
48
  options: options,
38
49
  closeOnClick: closeOnClick
39
- }, `${instanceUID}-ds-popup-menu-${label}`);
50
+ }, "".concat(instanceUID, "-ds-popup-menu-").concat(label));
40
51
 
41
52
  case 'ds-app-picker':
42
- const {
43
- apps,
44
- customApps,
45
- sectionTitle,
46
- customSectionTitle
47
- } = componentProps;
48
- return /*#__PURE__*/_jsx(AppPicker, {
49
- onClick: onClick,
50
- label: label,
51
- apps: apps,
52
- customApps: customApps,
53
- sectionTitle: sectionTitle,
54
- customSectionTitle: customSectionTitle
55
- }, `${instanceUID}-ds-app-picker-${label}`);
53
+ return /*#__PURE__*/jsx(AppPicker, _objectSpread({
54
+ label: label
55
+ }, componentProps), "".concat(instanceUID, "-ds-app-picker-").concat(label));
56
56
 
57
57
  default:
58
58
  return /*#__PURE__*/_jsx(Button, {
59
59
  onClick: onClick,
60
60
  title: label,
61
61
  "data-testid": "gh-toolbar-item"
62
- }, `${instanceUID}-ds-toolbar-button-${label}`, _Icon || (_Icon = /*#__PURE__*/_jsx(Icon, {
62
+ }, "".concat(instanceUID, "-ds-toolbar-button-").concat(label), _Icon || (_Icon = /*#__PURE__*/_jsx(Icon, {
63
63
  fill: "#FFF",
64
64
  size: "m"
65
65
  })));