@elliemae/ds-global-header 3.56.0-rc.1 → 3.57.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.
Files changed (91) hide show
  1. package/dist/cjs/DSGlobalHeader.js +1 -1
  2. package/dist/cjs/DSGlobalHeader.js.map +2 -2
  3. package/dist/cjs/DSGlobalHeaderContext.js.map +2 -2
  4. package/dist/cjs/config/useGlobalHeader.js +2 -2
  5. package/dist/cjs/config/useGlobalHeader.js.map +2 -2
  6. package/dist/cjs/config/useValidateProps.js.map +2 -2
  7. package/dist/cjs/exported-related/index.js +13 -3
  8. package/dist/cjs/exported-related/index.js.map +2 -2
  9. package/dist/cjs/index.js +10 -3
  10. package/dist/cjs/index.js.map +3 -3
  11. package/dist/cjs/parts/Breadcrumb/GlobalHeaderBreadcrumb.js +1 -1
  12. package/dist/cjs/parts/Breadcrumb/GlobalHeaderBreadcrumb.js.map +2 -2
  13. package/dist/cjs/parts/Breadcrumb/PureBreadcrumb.js +3 -14
  14. package/dist/cjs/parts/Breadcrumb/PureBreadcrumb.js.map +2 -2
  15. package/dist/cjs/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js +2 -2
  16. package/dist/cjs/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js.map +2 -2
  17. package/dist/cjs/parts/Toolbar/GlobalHeaderToolbar.js +89 -115
  18. package/dist/cjs/parts/Toolbar/GlobalHeaderToolbar.js.map +3 -3
  19. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js +5 -12
  20. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js.map +2 -2
  21. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js +4 -6
  22. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js.map +2 -2
  23. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js +3 -5
  24. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js.map +2 -2
  25. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js +8 -10
  26. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js.map +2 -2
  27. package/dist/cjs/react-desc-prop-types.js +28 -23
  28. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  29. package/dist/cjs/sharedTypes.js.map +1 -1
  30. package/dist/cjs/typescript-testing/typescript-global-header-breadcrumb-types.js +67 -0
  31. package/dist/cjs/typescript-testing/typescript-global-header-breadcrumb-types.js.map +7 -0
  32. package/dist/cjs/typescript-testing/typescript-global-header-deprecated.js +73 -0
  33. package/dist/cjs/typescript-testing/typescript-global-header-deprecated.js.map +7 -0
  34. package/dist/cjs/typescript-testing/typescript-global-header-toolbar-types.js +285 -0
  35. package/dist/cjs/typescript-testing/typescript-global-header-toolbar-types.js.map +7 -0
  36. package/dist/cjs/typescript-testing/typescript-global-header-valid.js +21 -11
  37. package/dist/cjs/typescript-testing/typescript-global-header-valid.js.map +2 -2
  38. package/dist/esm/DSGlobalHeader.js +2 -2
  39. package/dist/esm/DSGlobalHeader.js.map +2 -2
  40. package/dist/esm/DSGlobalHeaderContext.js.map +2 -2
  41. package/dist/esm/config/useGlobalHeader.js +2 -2
  42. package/dist/esm/config/useGlobalHeader.js.map +2 -2
  43. package/dist/esm/config/useValidateProps.js +5 -5
  44. package/dist/esm/config/useValidateProps.js.map +2 -2
  45. package/dist/esm/exported-related/index.js +9 -2
  46. package/dist/esm/exported-related/index.js.map +2 -2
  47. package/dist/esm/index.js +16 -2
  48. package/dist/esm/index.js.map +3 -3
  49. package/dist/esm/parts/Breadcrumb/GlobalHeaderBreadcrumb.js +1 -1
  50. package/dist/esm/parts/Breadcrumb/GlobalHeaderBreadcrumb.js.map +2 -2
  51. package/dist/esm/parts/Breadcrumb/PureBreadcrumb.js +3 -14
  52. package/dist/esm/parts/Breadcrumb/PureBreadcrumb.js.map +2 -2
  53. package/dist/esm/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js +3 -3
  54. package/dist/esm/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js.map +2 -2
  55. package/dist/esm/parts/Toolbar/GlobalHeaderToolbar.js +87 -113
  56. package/dist/esm/parts/Toolbar/GlobalHeaderToolbar.js.map +3 -3
  57. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js +5 -12
  58. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js.map +2 -2
  59. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js +4 -6
  60. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js.map +2 -2
  61. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js +3 -5
  62. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js.map +2 -2
  63. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js +6 -8
  64. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js.map +2 -2
  65. package/dist/esm/react-desc-prop-types.js +28 -23
  66. package/dist/esm/react-desc-prop-types.js.map +2 -2
  67. package/dist/esm/typescript-testing/typescript-global-header-breadcrumb-types.js +37 -0
  68. package/dist/esm/typescript-testing/typescript-global-header-breadcrumb-types.js.map +7 -0
  69. package/dist/esm/typescript-testing/typescript-global-header-deprecated.js +50 -0
  70. package/dist/esm/typescript-testing/typescript-global-header-deprecated.js.map +7 -0
  71. package/dist/esm/typescript-testing/typescript-global-header-toolbar-types.js +255 -0
  72. package/dist/esm/typescript-testing/typescript-global-header-toolbar-types.js.map +7 -0
  73. package/dist/esm/typescript-testing/typescript-global-header-valid.js +21 -11
  74. package/dist/esm/typescript-testing/typescript-global-header-valid.js.map +2 -2
  75. package/dist/types/DSGlobalHeader.d.ts +1 -1
  76. package/dist/types/DSGlobalHeaderContext.d.ts +2 -2
  77. package/dist/types/config/useGlobalHeader.d.ts +2 -3
  78. package/dist/types/exported-related/index.d.ts +2 -2
  79. package/dist/types/index.d.ts +4 -4
  80. package/dist/types/parts/Breadcrumb/PureBreadcrumb.d.ts +6 -2
  81. package/dist/types/parts/Breadcrumb/useGlobalHeaderBreadcrumb.d.ts +4 -4
  82. package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.d.ts +6 -2
  83. package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.d.ts +2 -2
  84. package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.d.ts +2 -2
  85. package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.d.ts +2 -2
  86. package/dist/types/react-desc-prop-types.d.ts +151 -6
  87. package/dist/types/sharedTypes.d.ts +47 -133
  88. package/dist/types/typescript-testing/typescript-global-header-breadcrumb-types.d.ts +3 -0
  89. package/dist/types/typescript-testing/typescript-global-header-deprecated.d.ts +1 -0
  90. package/dist/types/typescript-testing/typescript-global-header-toolbar-types.d.ts +3 -0
  91. package/package.json +11 -11
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import {\n throwToolbarPopupItemError,\n throwToolbarAppPickerItemError,\n throwToolbarItemGenericError,\n throwLogoError,\n throwBreadcrumbItemError,\n isValidToolbarType,\n isObject,\n} from './validateHelpers.js';\nimport type { DSGlobalHeaderT } from '../react-desc-prop-types.js';\nimport type { DSGlobalHeaderInternalsT } from '../sharedTypes.js';\n\nconst validatePopupItem = (componentProps: DSGlobalHeaderInternalsT.PopupMenuComponentProps): void => {\n if (componentProps.options && !Array.isArray(componentProps.options)) {\n throwToolbarPopupItemError('options', componentProps.options);\n }\n if (componentProps.closeOnClick && typeof componentProps.closeOnClick !== 'boolean') {\n throwToolbarPopupItemError('closeOnClick', componentProps.closeOnClick);\n }\n};\n\nconst validateAppPickerItem = (componentProps: DSGlobalHeaderInternalsT.AppPickerComponentProps): void => {\n if (componentProps.apps && !Array.isArray(componentProps.apps)) {\n throwToolbarAppPickerItemError('apps', componentProps.apps);\n }\n if (componentProps.customApps && !Array.isArray(componentProps.customApps)) {\n throwToolbarAppPickerItemError('customApps', componentProps.customApps);\n }\n if (componentProps.sectionTitle && typeof componentProps.sectionTitle !== 'string') {\n throwToolbarAppPickerItemError('sectionTitle', componentProps.sectionTitle);\n }\n if (componentProps.customSectionTitle && typeof componentProps.customSectionTitle !== 'string') {\n throwToolbarAppPickerItemError('customSectionTitle', componentProps.customSectionTitle);\n }\n};\n\nexport const useValidateProps = (props: DSGlobalHeaderT.Props): void => {\n const { breadcrumb, toolbar, Logo, LogoWithBrand } = props;\n\n if (Logo && typeof Logo !== 'function') {\n throwLogoError('Logo', Logo);\n }\n\n if (LogoWithBrand && typeof LogoWithBrand !== 'function') {\n throwLogoError('LogoWithBrand', LogoWithBrand);\n }\n\n breadcrumb?.forEach((breadcrumbItem) => {\n if (breadcrumbItem.label && typeof breadcrumbItem.label !== 'string') {\n throwBreadcrumbItemError('label', breadcrumbItem.label);\n }\n if (breadcrumbItem.onClick && typeof breadcrumbItem.onClick !== 'function') {\n throwBreadcrumbItemError('onClick', breadcrumbItem.onClick);\n }\n if (breadcrumbItem.hasNext && typeof breadcrumbItem.hasNext !== 'boolean') {\n throwBreadcrumbItemError('hasNext', breadcrumbItem.hasNext);\n }\n if (breadcrumbItem.isSelected && typeof breadcrumbItem.isSelected !== 'boolean') {\n throwBreadcrumbItemError('isSelected', breadcrumbItem.isSelected);\n }\n });\n\n toolbar?.forEach((toolbarItem) => {\n if (toolbarItem.type) {\n if (!isValidToolbarType(toolbarItem.type)) {\n throwToolbarItemGenericError('type', toolbarItem.type);\n }\n if (toolbarItem.componentProps && !isObject(toolbarItem.componentProps)) {\n throwToolbarItemGenericError('componentProps', toolbarItem.componentProps);\n }\n if (toolbarItem.type === 'ds-popup-menu') {\n validatePopupItem(toolbarItem.componentProps as DSGlobalHeaderInternalsT.PopupMenuComponentProps);\n }\n if (toolbarItem.type === 'ds-app-picker' && toolbarItem.componentProps) {\n validateAppPickerItem(toolbarItem.componentProps as DSGlobalHeaderInternalsT.AppPickerComponentProps);\n }\n }\n });\n};\n\n// Validation Needs to be checked carefully to avoid any breaking change\n// const validateGenericToolbarItem = (item: DSGlobalHeaderInternalsT.ToolbarItem): void => {\n// if (item.label && typeof item.label !== 'string') {\n// throwToolbarItemGenericError('label', item.label);\n// }\n// if (item.onClick && typeof item.onClick !== 'function') {\n// throwToolbarItemGenericError('onClick', item.onClick);\n// }\n// if (item.Icon && typeof item.Icon !== 'function') {\n// if (item.type === 'ds-app-picker') return;\n// throwToolbarItemGenericError('Icon', item.Icon);\n// }\n// };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,MAAM,oBAAoB,CAAC,mBAA2E;AACpG,MAAI,eAAe,WAAW,CAAC,MAAM,QAAQ,eAAe,OAAO,GAAG;AACpE,+BAA2B,WAAW,eAAe,OAAO;AAAA,EAC9D;AACA,MAAI,eAAe,gBAAgB,OAAO,eAAe,iBAAiB,WAAW;AACnF,+BAA2B,gBAAgB,eAAe,YAAY;AAAA,EACxE;AACF;AAEA,MAAM,wBAAwB,CAAC,mBAA2E;AACxG,MAAI,eAAe,QAAQ,CAAC,MAAM,QAAQ,eAAe,IAAI,GAAG;AAC9D,mCAA+B,QAAQ,eAAe,IAAI;AAAA,EAC5D;AACA,MAAI,eAAe,cAAc,CAAC,MAAM,QAAQ,eAAe,UAAU,GAAG;AAC1E,mCAA+B,cAAc,eAAe,UAAU;AAAA,EACxE;AACA,MAAI,eAAe,gBAAgB,OAAO,eAAe,iBAAiB,UAAU;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ACF;AAAA,EACF,CAAC;AACH;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSGlobalHeaderT } from '../react-desc-prop-types.js';\nimport {\n isObject,\n isValidToolbarType,\n throwBreadcrumbItemError,\n throwLogoError,\n throwToolbarAppPickerItemError,\n throwToolbarItemGenericError,\n throwToolbarPopupItemError,\n} from './validateHelpers.js';\n\nconst validatePopupItem = (componentProps: DSGlobalHeaderT.PopupMenuComponentProps): void => {\n if (componentProps.options && !Array.isArray(componentProps.options)) {\n throwToolbarPopupItemError('options', componentProps.options);\n }\n if (componentProps.closeOnClick && typeof componentProps.closeOnClick !== 'boolean') {\n throwToolbarPopupItemError('closeOnClick', componentProps.closeOnClick);\n }\n};\n\nconst validateAppPickerItem = (componentProps: DSGlobalHeaderT.AppPickerComponentProps): void => {\n if (componentProps.apps && !Array.isArray(componentProps.apps)) {\n throwToolbarAppPickerItemError('apps', componentProps.apps);\n }\n if (componentProps.customApps && !Array.isArray(componentProps.customApps)) {\n throwToolbarAppPickerItemError('customApps', componentProps.customApps);\n }\n if (componentProps.sectionTitle && typeof componentProps.sectionTitle !== 'string') {\n throwToolbarAppPickerItemError('sectionTitle', componentProps.sectionTitle);\n }\n if (componentProps.customSectionTitle && typeof componentProps.customSectionTitle !== 'string') {\n throwToolbarAppPickerItemError('customSectionTitle', componentProps.customSectionTitle);\n }\n};\n\nexport const useValidateProps = (props: DSGlobalHeaderT.Props): void => {\n const { breadcrumb, toolbar, Logo, LogoWithBrand } = props;\n\n if (Logo && typeof Logo !== 'function') {\n throwLogoError('Logo', Logo);\n }\n\n if (LogoWithBrand && typeof LogoWithBrand !== 'function') {\n throwLogoError('LogoWithBrand', LogoWithBrand);\n }\n\n breadcrumb?.forEach((breadcrumbItem) => {\n if (breadcrumbItem.label && typeof breadcrumbItem.label !== 'string') {\n throwBreadcrumbItemError('label', breadcrumbItem.label);\n }\n if (breadcrumbItem.onClick && typeof breadcrumbItem.onClick !== 'function') {\n throwBreadcrumbItemError('onClick', breadcrumbItem.onClick);\n }\n if (breadcrumbItem.hasNext && typeof breadcrumbItem.hasNext !== 'boolean') {\n throwBreadcrumbItemError('hasNext', breadcrumbItem.hasNext);\n }\n if (breadcrumbItem.isSelected && typeof breadcrumbItem.isSelected !== 'boolean') {\n throwBreadcrumbItemError('isSelected', breadcrumbItem.isSelected);\n }\n });\n\n toolbar?.forEach((toolbarItem) => {\n if (toolbarItem.type) {\n if (!isValidToolbarType(toolbarItem.type)) {\n throwToolbarItemGenericError('type', toolbarItem.type);\n }\n if (toolbarItem.componentProps && !isObject(toolbarItem.componentProps)) {\n throwToolbarItemGenericError('componentProps', toolbarItem.componentProps);\n }\n if (toolbarItem.type === 'ds-popup-menu') {\n validatePopupItem(toolbarItem.componentProps);\n }\n if (toolbarItem.type === 'ds-app-picker' && toolbarItem.componentProps) {\n validateAppPickerItem(toolbarItem.componentProps);\n }\n }\n });\n};\n\n// Validation Needs to be checked carefully to avoid any breaking change\n// const validateGenericToolbarItem = (item: DSGlobalHeaderT.ToolbarItem): void => {\n// if (item.label && typeof item.label !== 'string') {\n// throwToolbarItemGenericError('label', item.label);\n// }\n// if (item.onClick && typeof item.onClick !== 'function') {\n// throwToolbarItemGenericError('onClick', item.onClick);\n// }\n// if (item.Icon && typeof item.Icon !== 'function') {\n// if (item.type === 'ds-app-picker') return;\n// throwToolbarItemGenericError('Icon', item.Icon);\n// }\n// };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,oBAAoB,CAAC,mBAAkE;AAC3F,MAAI,eAAe,WAAW,CAAC,MAAM,QAAQ,eAAe,OAAO,GAAG;AACpE,+BAA2B,WAAW,eAAe,OAAO;AAAA,EAC9D;AACA,MAAI,eAAe,gBAAgB,OAAO,eAAe,iBAAiB,WAAW;AACnF,+BAA2B,gBAAgB,eAAe,YAAY;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I,GAAG;AACzC,qCAA6B,QAAQ,YAAY,IAAI;AAAA,MACvD;AACA,UAAI,YAAY,kBAAkB,CAAC,SAAS,YAAY,cAAc,GAAG;AACvE,qCAA6B,kBAAkB,YAAY,cAAc;AAAA,MAC3E;AACA,UAAI,YAAY,SAAS,iBAAiB;AACxC,0BAAkB,YAAY,cAAc;AAAA,MAC9C;AACA,UAAI,YAAY,SAAS,mBAAmB,YAAY,gBAAgB;AACtE,8BAAsB,YAAY,cAAc;AAAA,MAClD;AAAA,IACF;AAAA,EACF,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,11 @@
1
1
  import * as React from "react";
2
- export * from "./theming.js";
3
- export * from "./DSGlobalHeaderDatatestid.js";
2
+ import { DSGlobalHeaderName, DSGlobalHeaderSlots, DSGlobalHeaderSlotsFlattened } from "./theming.js";
3
+ import { DSGlobalHeaderDatatestid, DSGlobalHeaderDatatestidFlattened } from "./DSGlobalHeaderDatatestid.js";
4
+ export {
5
+ DSGlobalHeaderDatatestid,
6
+ DSGlobalHeaderDatatestidFlattened,
7
+ DSGlobalHeaderName,
8
+ DSGlobalHeaderSlots,
9
+ DSGlobalHeaderSlotsFlattened
10
+ };
4
11
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/exported-related/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './theming.js';\nexport * from './DSGlobalHeaderDatatestid.js';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSGlobalHeaderName, DSGlobalHeaderSlots, DSGlobalHeaderSlotsFlattened } from './theming.js';\nexport { DSGlobalHeaderDatatestid, DSGlobalHeaderDatatestidFlattened } from './DSGlobalHeaderDatatestid.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,oBAAoB,qBAAqB,oCAAoC;AACtF,SAAS,0BAA0B,yCAAyC;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,9 +1,23 @@
1
1
  import * as React from "react";
2
2
  import { DSGlobalHeader } from "./DSGlobalHeader.js";
3
- export * from "./DSGlobalHeader.js";
4
- export * from "./exported-related/index.js";
5
3
  var index_default = DSGlobalHeader;
4
+ import { DSGlobalHeader as DSGlobalHeader2, DSGlobalHeaderWithSchema, GlobalHeader } from "./DSGlobalHeader.js";
5
+ import {
6
+ DSGlobalHeaderDatatestid,
7
+ DSGlobalHeaderDatatestidFlattened,
8
+ DSGlobalHeaderName,
9
+ DSGlobalHeaderSlots,
10
+ DSGlobalHeaderSlotsFlattened
11
+ } from "./exported-related/index.js";
6
12
  export {
13
+ DSGlobalHeader2 as DSGlobalHeader,
14
+ DSGlobalHeaderDatatestid,
15
+ DSGlobalHeaderDatatestidFlattened,
16
+ DSGlobalHeaderName,
17
+ DSGlobalHeaderSlots,
18
+ DSGlobalHeaderSlotsFlattened,
19
+ DSGlobalHeaderWithSchema,
20
+ GlobalHeader,
7
21
  index_default as default
8
22
  };
9
23
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSGlobalHeader } from './DSGlobalHeader.js';\nexport * from './DSGlobalHeader.js';\nexport * from './exported-related/index.js';\nexport type { DSGlobalHeaderInternalsT } from './sharedTypes.js';\nexport type { DSGlobalHeaderT } from './react-desc-prop-types.js';\nexport default DSGlobalHeader;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sBAAsB;AAC/B,cAAc;AACd,cAAc;AAGd,IAAO,gBAAQ;",
6
- "names": []
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSGlobalHeader } from './DSGlobalHeader.js';\n\nexport default DSGlobalHeader;\nexport { DSGlobalHeader, DSGlobalHeaderWithSchema, GlobalHeader } from './DSGlobalHeader.js';\nexport {\n DSGlobalHeaderDatatestid,\n DSGlobalHeaderDatatestidFlattened,\n DSGlobalHeaderName,\n DSGlobalHeaderSlots,\n DSGlobalHeaderSlotsFlattened,\n} from './exported-related/index.js';\nexport type { DSGlobalHeaderT } from './react-desc-prop-types.js';\nexport type { DSGlobalHeaderInternalsT } from './sharedTypes.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sBAAsB;AAE/B,IAAO,gBAAQ;AACf,SAAS,kBAAAA,iBAAgB,0BAA0B,oBAAoB;AACvE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
+ "names": ["DSGlobalHeader"]
7
7
  }
@@ -42,7 +42,7 @@ const GlobalHeaderBreadcrumb = () => {
42
42
  onKeyDown: onClick && handleOnKeyDown(onClick),
43
43
  ...getGlobalAttributes(rest),
44
44
  onClick,
45
- length: breadcrumb.length
45
+ fullBreadcrumbListLength: breadcrumb.length
46
46
  },
47
47
  `${instanceUID}-breadcrumb-item-${label}`
48
48
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Breadcrumb/GlobalHeaderBreadcrumb.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetLayoutMode } from '@elliemae/ds-system';\nimport { getGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { StyledBreadcrumbContainer, StyledPipe, StyledBreadcrumbList } from './styles.js';\nimport { useGlobalHeaderBreadcrumb } from './useGlobalHeaderBreadcrumb.js';\nimport { PureBreadcrumb } from './PureBreadcrumb.js';\nimport { DSGlobalHeaderDatatestid } from '../../exported-related/index.js';\n\nexport const GlobalHeaderBreadcrumb = (): JSX.Element => {\n const { breadcrumb, CustomNavigation, showIconOnly, flexRegionRef, handleOnKeyDown, instanceUID, ownerProps } =\n useGlobalHeaderBreadcrumb();\n const layoutMode = useGetLayoutMode();\n\n const smalScreen = layoutMode === 'xs' || layoutMode === 's' || (!layoutMode && showIconOnly);\n\n return (\n <StyledBreadcrumbContainer\n height=\"100%\"\n alignItems=\"center\"\n justifyContent=\"flex-start\"\n aria-label=\"breadcrumb\"\n cols={['auto', 'auto', '1fr']}\n forwardedAs=\"nav\"\n data-testid={DSGlobalHeaderDatatestid.BREADCRUMB.CONTAINER}\n {...ownerProps}\n >\n <StyledPipe\n showIconOnly={smalScreen}\n aria-hidden\n data-testid={DSGlobalHeaderDatatestid.BREADCRUMB.PIPE}\n {...ownerProps}\n />\n <StyledBreadcrumbList data-testid={DSGlobalHeaderDatatestid.BREADCRUMB.LIST} {...ownerProps}>\n {CustomNavigation !== undefined ? (\n <CustomNavigation />\n ) : (\n breadcrumb?.map((item) => {\n const { onClick, isSelected, label, hasNext, ...rest } = item;\n return (\n <PureBreadcrumb\n label={label}\n hasNext={hasNext}\n isSelected={isSelected}\n key={`${instanceUID}-breadcrumb-item-${label}`}\n onKeyDown={onClick && handleOnKeyDown(onClick)}\n {...getGlobalAttributes(rest)}\n onClick={onClick}\n length={breadcrumb.length}\n />\n );\n })\n )}\n </StyledBreadcrumbList>\n <div id=\"global-header-flex-region\" ref={flexRegionRef} aria-hidden />\n </StyledBreadcrumbContainer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACgBnB,SAUE,KAVF;AAfJ,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,2BAA2B,YAAY,4BAA4B;AAC5E,SAAS,iCAAiC;AAC1C,SAAS,sBAAsB;AAC/B,SAAS,gCAAgC;AAElC,MAAM,yBAAyB,MAAmB;AACvD,QAAM,EAAE,YAAY,kBAAkB,cAAc,eAAe,iBAAiB,aAAa,WAAW,IAC1G,0BAA0B;AAC5B,QAAM,aAAa,iBAAiB;AAEpC,QAAM,aAAa,eAAe,QAAQ,eAAe,OAAQ,CAAC,cAAc;AAEhF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,QAAO;AAAA,MACP,YAAW;AAAA,MACX,gBAAe;AAAA,MACf,cAAW;AAAA,MACX,MAAM,CAAC,QAAQ,QAAQ,KAAK;AAAA,MAC5B,aAAY;AAAA,MACZ,eAAa,yBAAyB,WAAW;AAAA,MAChD,GAAG;AAAA,MAEJ;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,cAAc;AAAA,YACd,eAAW;AAAA,YACX,eAAa,yBAAyB,WAAW;AAAA,YAChD,GAAG;AAAA;AAAA,QACN;AAAA,QACA,oBAAC,wBAAqB,eAAa,yBAAyB,WAAW,MAAO,GAAG,YAC9E,+BAAqB,SACpB,oBAAC,oBAAiB,IAElB,YAAY,IAAI,CAAC,SAAS;AACxB,gBAAM,EAAE,SAAS,YAAY,OAAO,SAAS,GAAG,KAAK,IAAI;AACzD,iBACE;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cAEA,WAAW,WAAW,gBAAgB,OAAO;AAAA,cAC5C,GAAG,oBAAoB,IAAI;AAAA,cAC5B;AAAA,cACA,QAAQ,WAAW;AAAA;AAAA,YAJd,GAAG,WAAW,oBAAoB,KAAK;AAAA,UAK9C;AAAA,QAEJ,CAAC,GAEL;AAAA,QACA,oBAAC,SAAI,IAAG,6BAA4B,KAAK,eAAe,eAAW,MAAC;AAAA;AAAA;AAAA,EACtE;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetLayoutMode } from '@elliemae/ds-system';\nimport { getGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { StyledBreadcrumbContainer, StyledPipe, StyledBreadcrumbList } from './styles.js';\nimport { useGlobalHeaderBreadcrumb } from './useGlobalHeaderBreadcrumb.js';\nimport { PureBreadcrumb } from './PureBreadcrumb.js';\nimport { DSGlobalHeaderDatatestid } from '../../exported-related/index.js';\n\nexport const GlobalHeaderBreadcrumb = (): JSX.Element => {\n const { breadcrumb, CustomNavigation, showIconOnly, flexRegionRef, handleOnKeyDown, instanceUID, ownerProps } =\n useGlobalHeaderBreadcrumb();\n const layoutMode = useGetLayoutMode();\n\n const smalScreen = layoutMode === 'xs' || layoutMode === 's' || (!layoutMode && showIconOnly);\n\n return (\n <StyledBreadcrumbContainer\n height=\"100%\"\n alignItems=\"center\"\n justifyContent=\"flex-start\"\n aria-label=\"breadcrumb\"\n cols={['auto', 'auto', '1fr']}\n forwardedAs=\"nav\"\n data-testid={DSGlobalHeaderDatatestid.BREADCRUMB.CONTAINER}\n {...ownerProps}\n >\n <StyledPipe\n showIconOnly={smalScreen}\n aria-hidden\n data-testid={DSGlobalHeaderDatatestid.BREADCRUMB.PIPE}\n {...ownerProps}\n />\n <StyledBreadcrumbList data-testid={DSGlobalHeaderDatatestid.BREADCRUMB.LIST} {...ownerProps}>\n {CustomNavigation !== undefined ? (\n <CustomNavigation />\n ) : (\n breadcrumb?.map((item) => {\n const { onClick, isSelected, label, hasNext, ...rest } = item;\n return (\n <PureBreadcrumb\n label={label}\n hasNext={hasNext}\n isSelected={isSelected}\n key={`${instanceUID}-breadcrumb-item-${label}`}\n onKeyDown={onClick && handleOnKeyDown(onClick)}\n {...getGlobalAttributes(rest)}\n onClick={onClick}\n fullBreadcrumbListLength={breadcrumb.length}\n />\n );\n })\n )}\n </StyledBreadcrumbList>\n <div id=\"global-header-flex-region\" ref={flexRegionRef} aria-hidden />\n </StyledBreadcrumbContainer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACgBnB,SAUE,KAVF;AAfJ,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,2BAA2B,YAAY,4BAA4B;AAC5E,SAAS,iCAAiC;AAC1C,SAAS,sBAAsB;AAC/B,SAAS,gCAAgC;AAElC,MAAM,yBAAyB,MAAmB;AACvD,QAAM,EAAE,YAAY,kBAAkB,cAAc,eAAe,iBAAiB,aAAa,WAAW,IAC1G,0BAA0B;AAC5B,QAAM,aAAa,iBAAiB;AAEpC,QAAM,aAAa,eAAe,QAAQ,eAAe,OAAQ,CAAC,cAAc;AAEhF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,QAAO;AAAA,MACP,YAAW;AAAA,MACX,gBAAe;AAAA,MACf,cAAW;AAAA,MACX,MAAM,CAAC,QAAQ,QAAQ,KAAK;AAAA,MAC5B,aAAY;AAAA,MACZ,eAAa,yBAAyB,WAAW;AAAA,MAChD,GAAG;AAAA,MAEJ;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,cAAc;AAAA,YACd,eAAW;AAAA,YACX,eAAa,yBAAyB,WAAW;AAAA,YAChD,GAAG;AAAA;AAAA,QACN;AAAA,QACA,oBAAC,wBAAqB,eAAa,yBAAyB,WAAW,MAAO,GAAG,YAC9E,+BAAqB,SACpB,oBAAC,oBAAiB,IAElB,YAAY,IAAI,CAAC,SAAS;AACxB,gBAAM,EAAE,SAAS,YAAY,OAAO,SAAS,GAAG,KAAK,IAAI;AACzD,iBACE;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cAEA,WAAW,WAAW,gBAAgB,OAAO;AAAA,cAC5C,GAAG,oBAAoB,IAAI;AAAA,cAC5B;AAAA,cACA,0BAA0B,WAAW;AAAA;AAAA,YAJhC,GAAG,WAAW,oBAAoB,KAAK;AAAA,UAK9C;AAAA,QAEJ,CAAC,GAEL;AAAA,QACA,oBAAC,SAAI,IAAG,6BAA4B,KAAK,eAAe,eAAW,MAAC;AAAA;AAAA;AAAA,EACtE;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,34 +1,23 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import React2 from "react";
4
- import { StyledBreadcrumbItem, StyledLink, StyledLabel, StyledChevron } from "./styles.js";
5
4
  import { DSGlobalHeaderDatatestid } from "../../exported-related/index.js";
5
+ import { StyledBreadcrumbItem, StyledChevron, StyledLabel, StyledLink } from "./styles.js";
6
6
  const PureBreadcrumb = React2.memo(
7
- ({
8
- onClick,
9
- onKeyDown,
10
- isSelected,
11
- length,
12
- label,
13
- hasNext,
14
- id,
15
- ...rest
16
- }) => /* @__PURE__ */ jsxs(StyledBreadcrumbItem, { "data-testid": DSGlobalHeaderDatatestid.BREADCRUMB.ITEM, children: [
7
+ ({ onClick, isSelected, fullBreadcrumbListLength, label, hasNext, ...rest }) => /* @__PURE__ */ jsxs(StyledBreadcrumbItem, { "data-testid": DSGlobalHeaderDatatestid.BREADCRUMB.ITEM, children: [
17
8
  /* @__PURE__ */ jsx(
18
9
  StyledLink,
19
10
  {
20
11
  onClick,
21
- onKeyDown,
22
12
  "data-testid": DSGlobalHeaderDatatestid.BREADCRUMB.ITEM_LINK,
23
13
  "aria-current": isSelected,
24
- id,
25
14
  tabIndex: 0,
26
15
  ...rest,
27
16
  children: /* @__PURE__ */ jsx(
28
17
  StyledLabel,
29
18
  {
30
19
  isSelected: !!isSelected,
31
- isOnlyItem: length === 1,
20
+ isOnlyItem: fullBreadcrumbListLength === 1,
32
21
  "data-testid": DSGlobalHeaderDatatestid.BREADCRUMB.ITEM_LINK_LABEL,
33
22
  children: label
34
23
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Breadcrumb/PureBreadcrumb.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { StyledBreadcrumbItem, StyledLink, StyledLabel, StyledChevron } from './styles.js';\nimport { DSGlobalHeaderDatatestid } from '../../exported-related/index.js';\nimport type { DSGlobalHeaderInternalsT } from '../../sharedTypes.js';\nexport const PureBreadcrumb = React.memo(\n ({\n onClick,\n onKeyDown,\n isSelected,\n length,\n label,\n hasNext,\n id,\n ...rest\n }: DSGlobalHeaderInternalsT.BreadcrumbItem) => (\n <StyledBreadcrumbItem data-testid={DSGlobalHeaderDatatestid.BREADCRUMB.ITEM}>\n <StyledLink\n onClick={onClick}\n onKeyDown={onKeyDown}\n data-testid={DSGlobalHeaderDatatestid.BREADCRUMB.ITEM_LINK}\n aria-current={isSelected}\n id={id}\n tabIndex={0}\n {...rest}\n >\n <StyledLabel\n isSelected={!!isSelected}\n isOnlyItem={length === 1}\n data-testid={DSGlobalHeaderDatatestid.BREADCRUMB.ITEM_LINK_LABEL}\n >\n {label}\n </StyledLabel>\n </StyledLink>\n {hasNext && <StyledChevron size=\"m\" aria-hidden />}\n </StyledBreadcrumbItem>\n ),\n);\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACenB,SAUI,KAVJ;AAfJ,OAAOA,YAAW;AAClB,SAAS,sBAAsB,YAAY,aAAa,qBAAqB;AAC7E,SAAS,gCAAgC;AAElC,MAAM,iBAAiBA,OAAM;AAAA,EAClC,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,MACE,qBAAC,wBAAqB,eAAa,yBAAyB,WAAW,MACrE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,eAAa,yBAAyB,WAAW;AAAA,QACjD,gBAAc;AAAA,QACd;AAAA,QACA,UAAU;AAAA,QACT,GAAG;AAAA,QAEJ;AAAA,UAAC;AAAA;AAAA,YACC,YAAY,CAAC,CAAC;AAAA,YACd,YAAY,WAAW;AAAA,YACvB,eAAa,yBAAyB,WAAW;AAAA,YAEhD;AAAA;AAAA,QACH;AAAA;AAAA,IACF;AAAA,IACC,WAAW,oBAAC,iBAAc,MAAK,KAAI,eAAW,MAAC;AAAA,KAClD;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSGlobalHeaderDatatestid } from '../../exported-related/index.js';\nimport type { DSGlobalHeaderT } from '../../react-desc-prop-types.js';\nimport { StyledBreadcrumbItem, StyledChevron, StyledLabel, StyledLink } from './styles.js';\n\ntype PureBreadcrumbProps = DSGlobalHeaderT.BreadcrumbItem & { fullBreadcrumbListLength: number };\n\nexport const PureBreadcrumb = React.memo(\n ({ onClick, isSelected, fullBreadcrumbListLength, label, hasNext, ...rest }: PureBreadcrumbProps) => (\n <StyledBreadcrumbItem data-testid={DSGlobalHeaderDatatestid.BREADCRUMB.ITEM}>\n <StyledLink\n onClick={onClick}\n data-testid={DSGlobalHeaderDatatestid.BREADCRUMB.ITEM_LINK}\n aria-current={isSelected}\n tabIndex={0}\n {...rest}\n >\n <StyledLabel\n isSelected={!!isSelected}\n isOnlyItem={fullBreadcrumbListLength === 1}\n data-testid={DSGlobalHeaderDatatestid.BREADCRUMB.ITEM_LINK_LABEL}\n >\n {label}\n </StyledLabel>\n </StyledLink>\n {hasNext && <StyledChevron size=\"m\" aria-hidden />}\n </StyledBreadcrumbItem>\n ),\n);\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACSnB,SAQI,KARJ;AATJ,OAAOA,YAAW;AAClB,SAAS,gCAAgC;AAEzC,SAAS,sBAAsB,eAAe,aAAa,kBAAkB;AAItE,MAAM,iBAAiBA,OAAM;AAAA,EAClC,CAAC,EAAE,SAAS,YAAY,0BAA0B,OAAO,SAAS,GAAG,KAAK,MACxE,qBAAC,wBAAqB,eAAa,yBAAyB,WAAW,MACrE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAa,yBAAyB,WAAW;AAAA,QACjD,gBAAc;AAAA,QACd,UAAU;AAAA,QACT,GAAG;AAAA,QAEJ;AAAA,UAAC;AAAA;AAAA,YACC,YAAY,CAAC,CAAC;AAAA,YACd,YAAY,6BAA6B;AAAA,YACzC,eAAa,yBAAyB,WAAW;AAAA,YAEhD;AAAA;AAAA,QACH;AAAA;AAAA,IACF;AAAA,IACC,WAAW,oBAAC,iBAAc,MAAK,KAAI,eAAW,MAAC;AAAA,KAClD;AAEJ;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
- import { useEffect, useRef, useContext, useCallback } from "react";
3
- import { DSGlobalHeaderContext } from "../../DSGlobalHeaderContext.js";
2
+ import { useCallback, useContext, useEffect, useRef } from "react";
4
3
  import { FONT_DETECTOR } from "../../config/constants.js";
4
+ import { DSGlobalHeaderContext } from "../../DSGlobalHeaderContext.js";
5
5
  const useGlobalHeaderBreadcrumb = () => {
6
6
  const {
7
7
  props: { breadcrumb, CustomNavigation },
@@ -30,7 +30,7 @@ const useGlobalHeaderBreadcrumb = () => {
30
30
  const handleOnKeyDown = useCallback(
31
31
  (onClick) => (e) => {
32
32
  if (e.key === " " || e.key === "Enter") {
33
- onClick();
33
+ onClick(e);
34
34
  }
35
35
  },
36
36
  []
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Breadcrumb/useGlobalHeaderBreadcrumb.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { useEffect, useRef, useContext, useCallback } from 'react';\nimport { DSGlobalHeaderContext } from '../../DSGlobalHeaderContext.js';\nimport type { DSGlobalHeaderInternalsT } from '../../sharedTypes.js';\nimport { FONT_DETECTOR } from '../../config/constants.js';\ninterface UseGlobalHeaderBreadcrumbReturnT {\n breadcrumb: DSGlobalHeaderInternalsT.BreadcrumbItem[];\n CustomNavigation: React.ComponentType;\n showIconOnly: boolean;\n flexRegionRef: React.MutableRefObject<HTMLDivElement | null>;\n handleOnKeyDown: (onClick: (event?: React.MouseEvent) => void) => (event: React.KeyboardEvent) => void;\n instanceUID: string;\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderInternalsT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n}\n\nexport const useGlobalHeaderBreadcrumb = (): UseGlobalHeaderBreadcrumbReturnT => {\n const {\n props: { breadcrumb, CustomNavigation },\n ownerProps,\n instanceUID,\n showIconOnly,\n setShowIconOnly,\n fontDetector,\n } = useContext(DSGlobalHeaderContext);\n\n const breakpointRef = useRef<number | null>(null);\n const flexRegionRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const evaluateShowIconOnly = () => {\n if (\n (flexRegionRef.current && flexRegionRef.current.offsetWidth <= 0 && !breakpointRef.current) ||\n fontDetector === FONT_DETECTOR.LARGE ||\n fontDetector === FONT_DETECTOR.MEDIUM\n ) {\n setShowIconOnly(true);\n breakpointRef.current = window.innerWidth;\n } else if (breakpointRef.current && window.innerWidth >= breakpointRef.current) {\n setShowIconOnly(false);\n breakpointRef.current = null;\n }\n };\n\n evaluateShowIconOnly();\n\n window.addEventListener('resize', evaluateShowIconOnly);\n return () => window.removeEventListener('resize', evaluateShowIconOnly);\n }, [breakpointRef, flexRegionRef, setShowIconOnly, fontDetector]);\n\n const handleOnKeyDown = useCallback(\n (onClick: (event?: React.MouseEvent) => void) => (e: React.KeyboardEvent) => {\n if (e.key === ' ' || e.key === 'Enter') {\n onClick();\n }\n },\n [],\n );\n\n return {\n breadcrumb,\n CustomNavigation,\n showIconOnly,\n flexRegionRef,\n handleOnKeyDown,\n instanceUID,\n ownerProps,\n };\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW,QAAQ,YAAY,mBAAmB;AAC3D,SAAS,6BAA6B;AAEtC,SAAS,qBAAqB;AAcvB,MAAM,4BAA4B,MAAwC;AAC/E,QAAM;AAAA,IACJ,OAAO,EAAE,YAAY,iBAAiB;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,qBAAqB;AAEpC,QAAM,gBAAgB,OAAsB,IAAI;AAChD,QAAM,gBAAgB,OAAuB,IAAI;AAEjD,YAAU,MAAM;AACd,UAAM,uBAAuB,MAAM;AACjC,UACG,cAAc,WAAW,cAAc,QAAQ,eAAe,KAAK,CAAC,cAAc,WACnF,iBAAiB,cAAc,SAC/B,iBAAiB,cAAc,QAC/B;AACA,wBAAgB,IAAI;AACpB,sBAAc,UAAU,OAAO;AAAA,MACjC,WAAW,cAAc,WAAW,OAAO,cAAc,cAAc,SAAS;AAC9E,wBAAgB,KAAK;AACrB,sBAAc,UAAU;AAAA,MAC1B;AAAA,IACF;AAEA,yBAAqB;AAErB,WAAO,iBAAiB,UAAU,oBAAoB;AACtD,WAAO,MAAM,OAAO,oBAAoB,UAAU,oBAAoB;AAAA,EACxE,GAAG,CAAC,eAAe,eAAe,iBAAiB,YAAY,CAAC;AAEhE,QAAM,kBAAkB;AAAA,IACtB,CAAC,YAAgD,CAAC,MAA2B;AAC3E,UAAI,EAAE,QAAQ,OAAO,EAAE,QAAQ,SAAS;AACtC,gBAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport { useCallback, useContext, useEffect, useRef } from 'react';\nimport { FONT_DETECTOR } from '../../config/constants.js';\nimport { DSGlobalHeaderContext } from '../../DSGlobalHeaderContext.js';\nimport type { DSGlobalHeaderT } from '../../react-desc-prop-types.js';\n\ninterface UseGlobalHeaderBreadcrumbReturnT {\n breadcrumb: DSGlobalHeaderT.BreadcrumbItem[];\n CustomNavigation: React.ComponentType;\n showIconOnly: boolean;\n flexRegionRef: React.MutableRefObject<HTMLDivElement | null>;\n handleOnKeyDown: (\n onClick: (event: React.MouseEvent | React.KeyboardEvent) => void,\n ) => (event: React.KeyboardEvent) => void;\n instanceUID: string;\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n}\n\nexport const useGlobalHeaderBreadcrumb = (): UseGlobalHeaderBreadcrumbReturnT => {\n const {\n props: { breadcrumb, CustomNavigation },\n ownerProps,\n instanceUID,\n showIconOnly,\n setShowIconOnly,\n fontDetector,\n } = useContext(DSGlobalHeaderContext);\n\n const breakpointRef = useRef<number | null>(null);\n const flexRegionRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const evaluateShowIconOnly = () => {\n if (\n (flexRegionRef.current && flexRegionRef.current.offsetWidth <= 0 && !breakpointRef.current) ||\n fontDetector === FONT_DETECTOR.LARGE ||\n fontDetector === FONT_DETECTOR.MEDIUM\n ) {\n setShowIconOnly(true);\n breakpointRef.current = window.innerWidth;\n } else if (breakpointRef.current && window.innerWidth >= breakpointRef.current) {\n setShowIconOnly(false);\n breakpointRef.current = null;\n }\n };\n\n evaluateShowIconOnly();\n\n window.addEventListener('resize', evaluateShowIconOnly);\n return () => window.removeEventListener('resize', evaluateShowIconOnly);\n }, [breakpointRef, flexRegionRef, setShowIconOnly, fontDetector]);\n\n const handleOnKeyDown = useCallback(\n (onClick: (event: React.MouseEvent | React.KeyboardEvent) => void) => (e: React.KeyboardEvent) => {\n if (e.key === ' ' || e.key === 'Enter') {\n onClick(e);\n }\n },\n [],\n );\n\n return {\n breadcrumb,\n CustomNavigation,\n showIconOnly,\n flexRegionRef,\n handleOnKeyDown,\n instanceUID,\n ownerProps,\n };\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,aAAa,YAAY,WAAW,cAAc;AAC3D,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AAkB/B,MAAM,4BAA4B,MAAwC;AAC/E,QAAM;AAAA,IACJ,OAAO,EAAE,YAAY,iBAAiB;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,qBAAqB;AAEpC,QAAM,gBAAgB,OAAsB,IAAI;AAChD,QAAM,gBAAgB,OAAuB,IAAI;AAEjD,YAAU,MAAM;AACd,UAAM,uBAAuB,MAAM;AACjC,UACG,cAAc,WAAW,cAAc,QAAQ,eAAe,KAAK,CAAC,cAAc,WACnF,iBAAiB,cAAc,SAC/B,iBAAiB,cAAc,QAC/B;AACA,wBAAgB,IAAI;AACpB,sBAAc,UAAU,OAAO;AAAA,MACjC,WAAW,cAAc,WAAW,OAAO,cAAc,cAAc,SAAS;AAC9E,wBAAgB,KAAK;AACrB,sBAAc,UAAU;AAAA,MAC1B;AAAA,IACF;AAEA,yBAAqB;AAErB,WAAO,iBAAiB,UAAU,oBAAoB;AACtD,WAAO,MAAM,OAAO,oBAAoB,UAAU,oBAAoB;AAAA,EACxE,GAAG,CAAC,eAAe,eAAe,iBAAiB,YAAY,CAAC;AAEhE,QAAM,kBAAkB;AAAA,IACtB,CAAC,YAAqE,CAAC,MAA2B;AAChG,UAAI,EAAE,QAAQ,OAAO,EAAE,QAAQ,SAAS;AACtC,gBAAQ,CAAC;AAAA,MACX;AAAA,IACF;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,14 +1,14 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { useContext } from "react";
4
3
  import { getGlobalAttributes } from "@elliemae/ds-props-helpers";
5
- import { StyledList, StyledMenubarContainer, StyledToolbarItem } from "./styles.js";
6
- import { AppPicker, PopupMenu, SearchToggle } from "./outOfTheBox/index.js";
7
- import { StyledButton } from "../styles.js";
4
+ import { useContext } from "react";
5
+ import { FONT_DETECTOR } from "../../config/constants.js";
8
6
  import { DSGlobalHeaderContext } from "../../DSGlobalHeaderContext.js";
9
7
  import { DSGlobalHeaderDatatestid } from "../../exported-related/index.js";
8
+ import { StyledButton } from "../styles.js";
9
+ import { AppPicker, PopupMenu, SearchToggle } from "./outOfTheBox/index.js";
10
+ import { StyledList, StyledMenubarContainer, StyledToolbarItem } from "./styles.js";
10
11
  import { useGlobalHeaderToolbar } from "./useGlobalHeaderToolbar.js";
11
- import { FONT_DETECTOR } from "../../config/constants.js";
12
12
  const GlobalHeaderToolbar = () => {
13
13
  const {
14
14
  props: { toolbar },
@@ -39,115 +39,89 @@ const GlobalHeaderToolbar = () => {
39
39
  "data-testid": DSGlobalHeaderDatatestid.MENUBAR.LIST,
40
40
  ...ownerProps,
41
41
  children: toolbar.map((item, index) => {
42
- const {
43
- Icon,
44
- type,
45
- onClick,
46
- onKeyPress,
47
- CustomComponent,
48
- label,
49
- id = "",
50
- componentProps = {},
51
- ...otherProps
52
- } = item;
53
- switch (type) {
54
- case "ds-popup-menu":
55
- return /* @__PURE__ */ jsx(
56
- StyledToolbarItem,
57
- {
58
- role: "menuitem",
59
- "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM,
60
- ...ownerProps,
61
- children: /* @__PURE__ */ jsx(
62
- PopupMenu,
63
- {
64
- title: label,
65
- Icon,
66
- onClick,
67
- onKeyPress,
68
- setRef: setRef(index),
69
- id,
70
- componentProps,
71
- ...otherProps
72
- }
73
- )
74
- },
75
- `${instanceUID}-ds-toolbar-item-${label}`
76
- );
77
- case "ds-app-picker":
78
- return /* @__PURE__ */ jsx(
79
- StyledToolbarItem,
80
- {
81
- role: "menuitem",
82
- "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM,
83
- ...ownerProps,
84
- children: /* @__PURE__ */ jsx(
85
- AppPicker,
86
- {
87
- label,
88
- id,
89
- setRef: setRef(index),
90
- componentProps,
91
- ...otherProps
92
- }
93
- )
94
- },
95
- `${instanceUID}-ds-toolbar-item-${label}`
96
- );
97
- case "ds-search-toggle":
98
- return /* @__PURE__ */ jsx(
99
- StyledToolbarItem,
100
- {
101
- role: "menuitem",
102
- "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM,
103
- ...ownerProps,
104
- children: /* @__PURE__ */ jsx(
105
- SearchToggle,
106
- {
107
- id,
108
- setRef: setRef(index),
109
- componentProps,
110
- ...otherProps
111
- }
112
- )
113
- },
114
- `${instanceUID}-ds-toolbar-item-${label}`
115
- );
116
- case "custom":
117
- return /* @__PURE__ */ jsx(
118
- StyledToolbarItem,
119
- {
120
- role: "menuitem",
121
- "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM,
122
- ...ownerProps,
123
- children: CustomComponent && /* @__PURE__ */ jsx(CustomComponent, { item, setRef: setRef(index) })
124
- },
125
- `${instanceUID}-ds-toolbar-item-${label}`
126
- );
127
- default:
128
- return /* @__PURE__ */ jsx(
129
- StyledToolbarItem,
130
- {
131
- role: "menuitem",
132
- "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM,
133
- ...ownerProps,
134
- children: /* @__PURE__ */ jsx(
135
- StyledButton,
136
- {
137
- onClick,
138
- title: label,
139
- "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM_BUTTON,
140
- id,
141
- innerRef: setRef(index),
142
- ...getGlobalAttributes(otherProps),
143
- type: "button",
144
- children: Icon && /* @__PURE__ */ jsx(Icon, { size: "m" })
145
- }
146
- )
147
- },
148
- `${instanceUID}-ds-toolbar-item-${label}`
149
- );
42
+ const { type } = item;
43
+ const setRefIndex = setRef(index);
44
+ if (type === "ds-popup-menu") {
45
+ const { label: label2, ...otherProps2 } = item;
46
+ return /* @__PURE__ */ jsx(
47
+ StyledToolbarItem,
48
+ {
49
+ role: "menuitem",
50
+ "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM,
51
+ ...ownerProps,
52
+ children: /* @__PURE__ */ jsx(
53
+ PopupMenu,
54
+ {
55
+ title: label2,
56
+ setRef: setRefIndex,
57
+ ...otherProps2
58
+ }
59
+ )
60
+ },
61
+ `${instanceUID}-ds-toolbar-item-${label2}`
62
+ );
150
63
  }
64
+ if (type === "ds-app-picker") {
65
+ const { label: label2, ...otherProps2 } = item;
66
+ return /* @__PURE__ */ jsx(
67
+ StyledToolbarItem,
68
+ {
69
+ role: "menuitem",
70
+ "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM,
71
+ ...ownerProps,
72
+ children: /* @__PURE__ */ jsx(AppPicker, { label: label2, setRef: setRefIndex, ...otherProps2 })
73
+ },
74
+ `${instanceUID}-ds-toolbar-item-${label2}`
75
+ );
76
+ }
77
+ if (type === "ds-search-toggle") {
78
+ const { label: label2, ...otherProps2 } = item;
79
+ return /* @__PURE__ */ jsx(
80
+ StyledToolbarItem,
81
+ {
82
+ role: "menuitem",
83
+ "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM,
84
+ ...ownerProps,
85
+ children: /* @__PURE__ */ jsx(SearchToggle, { setRef: setRefIndex, ...otherProps2 })
86
+ },
87
+ `${instanceUID}-ds-toolbar-item-${label2}`
88
+ );
89
+ }
90
+ if (type === "custom") {
91
+ const { label: label2, CustomComponent } = item;
92
+ if (!CustomComponent) return null;
93
+ return /* @__PURE__ */ jsx(
94
+ StyledToolbarItem,
95
+ {
96
+ role: "menuitem",
97
+ "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM,
98
+ ...ownerProps,
99
+ children: CustomComponent && /* @__PURE__ */ jsx(CustomComponent, { item, setRef: setRefIndex })
100
+ },
101
+ `${instanceUID}-ds-toolbar-item-${label2}`
102
+ );
103
+ }
104
+ const { label, Icon, ...otherProps } = item;
105
+ return /* @__PURE__ */ jsx(
106
+ StyledToolbarItem,
107
+ {
108
+ role: "menuitem",
109
+ "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM,
110
+ ...ownerProps,
111
+ children: /* @__PURE__ */ jsx(
112
+ StyledButton,
113
+ {
114
+ title: label,
115
+ "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM_BUTTON,
116
+ innerRef: setRefIndex,
117
+ ...getGlobalAttributes(otherProps),
118
+ type: "button",
119
+ children: Icon && /* @__PURE__ */ jsx(Icon, { size: "m" })
120
+ }
121
+ )
122
+ },
123
+ `${instanceUID}-ds-toolbar-item-${label}`
124
+ );
151
125
  })
152
126
  }
153
127
  )
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Toolbar/GlobalHeaderToolbar.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { getGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { StyledList, StyledMenubarContainer, StyledToolbarItem } from './styles.js';\nimport { AppPicker, PopupMenu, SearchToggle } from './outOfTheBox/index.js';\nimport { StyledButton } from '../styles.js';\nimport { DSGlobalHeaderContext } from '../../DSGlobalHeaderContext.js';\nimport { DSGlobalHeaderDatatestid } from '../../exported-related/index.js';\nimport { useGlobalHeaderToolbar } from './useGlobalHeaderToolbar.js';\nimport type { DSGlobalHeaderInternalsT } from '../../sharedTypes.js';\nimport { FONT_DETECTOR } from '../../config/constants.js';\nexport const GlobalHeaderToolbar = (): JSX.Element => {\n const {\n props: { toolbar },\n ownerProps,\n instanceUID,\n globalHeaderToolbarGrid,\n fontDetector,\n } = useContext(DSGlobalHeaderContext);\n\n const { listRef, setRef, keyboardNavigation } = useGlobalHeaderToolbar();\n\n return (\n <StyledMenubarContainer\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.CONTAINER}\n aria-label=\"menubar\"\n withSpan={fontDetector > FONT_DETECTOR.SMALL}\n {...ownerProps}\n >\n <StyledList\n height=\"100%\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gutter=\"xxs\"\n cols={globalHeaderToolbarGrid}\n role=\"menubar\"\n onKeyDown={keyboardNavigation}\n innerRef={listRef}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.LIST}\n {...ownerProps}\n >\n {toolbar.map((item, index) => {\n const {\n Icon,\n type,\n onClick,\n onKeyPress,\n CustomComponent,\n label,\n id = '',\n componentProps = {},\n ...otherProps\n } = item;\n\n switch (type) {\n case 'ds-popup-menu':\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM}\n {...ownerProps}\n >\n <PopupMenu\n title={label}\n Icon={Icon}\n onClick={onClick}\n onKeyPress={onKeyPress}\n setRef={setRef(index)}\n id={id}\n componentProps={componentProps as DSGlobalHeaderInternalsT.PopupMenuComponentProps}\n {...otherProps}\n />\n </StyledToolbarItem>\n );\n case 'ds-app-picker':\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM}\n {...ownerProps}\n >\n <AppPicker\n label={label}\n id={id}\n setRef={setRef(index)}\n componentProps={componentProps as DSGlobalHeaderInternalsT.AppPickerComponentProps}\n {...otherProps}\n />\n </StyledToolbarItem>\n );\n case 'ds-search-toggle':\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM}\n {...ownerProps}\n >\n <SearchToggle\n id={id}\n setRef={setRef(index)}\n componentProps={componentProps as DSGlobalHeaderInternalsT.ToggleSearchComponentProps}\n {...otherProps}\n />\n </StyledToolbarItem>\n );\n case 'custom':\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM}\n {...ownerProps}\n >\n {CustomComponent && <CustomComponent item={item} setRef={setRef(index)} />}\n </StyledToolbarItem>\n );\n\n default:\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM}\n {...ownerProps}\n >\n <StyledButton\n onClick={onClick}\n title={label}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM_BUTTON}\n id={id}\n innerRef={setRef(index)}\n {...getGlobalAttributes(otherProps)}\n type=\"button\"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,QAAQ;AAAA,oBAC7C,GAAG;AAAA,oBAEJ;AAAA,sBAAC;AAAA;AAAA,wBACC;AAAA,wBACA,OAAO;AAAA,wBACP,eAAa,yBAAyB,QAAQ;AAAA,wBAC9C;AAAA,wBACA,UAAU,OAAO,KAAK;AAAA,wBACrB,GAAG,oBAAoB,UAAU;AAAA,wBAClC,MAAK;AAAA,wBAEJ,kBAAQ,oBAAC,QAAK,MAAK,KAAI;AAAA;AAAA,oBAC1B;AAAA;AAAA,kBAdK,GAAG,WAAW,oBAAoB,KAAK;AAAA,gBAe9C;AAAA,YAEN;AAAA,UACF,CAAC;AAAA;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;",
6
- "names": []
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { getGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { useContext } from 'react';\nimport { FONT_DETECTOR } from '../../config/constants.js';\nimport { DSGlobalHeaderContext } from '../../DSGlobalHeaderContext.js';\nimport { DSGlobalHeaderDatatestid } from '../../exported-related/index.js';\nimport { StyledButton } from '../styles.js';\nimport { AppPicker, PopupMenu, SearchToggle } from './outOfTheBox/index.js';\nimport { StyledList, StyledMenubarContainer, StyledToolbarItem } from './styles.js';\nimport { useGlobalHeaderToolbar } from './useGlobalHeaderToolbar.js';\n\nexport const GlobalHeaderToolbar = (): JSX.Element => {\n const {\n props: { toolbar },\n ownerProps,\n instanceUID,\n globalHeaderToolbarGrid,\n fontDetector,\n } = useContext(DSGlobalHeaderContext);\n\n const { listRef, setRef, keyboardNavigation } = useGlobalHeaderToolbar();\n\n return (\n <StyledMenubarContainer\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.CONTAINER}\n aria-label=\"menubar\"\n withSpan={fontDetector > FONT_DETECTOR.SMALL}\n {...ownerProps}\n >\n <StyledList\n height=\"100%\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gutter=\"xxs\"\n cols={globalHeaderToolbarGrid}\n role=\"menubar\"\n onKeyDown={keyboardNavigation}\n innerRef={listRef}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.LIST}\n {...ownerProps}\n >\n {toolbar.map((item, index) => {\n const { type } = item;\n const setRefIndex = setRef(index);\n\n if (type === 'ds-popup-menu') {\n const { label, ...otherProps } = item;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM}\n {...ownerProps}\n >\n <PopupMenu\n title={label} // this is captured as the standard HTML \"title\" attribute and is printed in output HTML\n setRef={setRefIndex}\n {...otherProps}\n />\n </StyledToolbarItem>\n );\n }\n if (type === 'ds-app-picker') {\n const { label, ...otherProps } = item;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM}\n {...ownerProps}\n >\n <AppPicker label={label} setRef={setRefIndex} {...otherProps} />\n </StyledToolbarItem>\n );\n }\n if (type === 'ds-search-toggle') {\n const { label, ...otherProps } = item;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM}\n {...ownerProps}\n >\n <SearchToggle setRef={setRefIndex} {...otherProps} />\n </StyledToolbarItem>\n );\n }\n if (type === 'custom') {\n const { label, CustomComponent } = item;\n if (!CustomComponent) return null;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM}\n {...ownerProps}\n >\n {CustomComponent && <CustomComponent item={item} setRef={setRefIndex} />}\n </StyledToolbarItem>\n );\n }\n\n const { label, Icon, ...otherProps } = item;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM}\n {...ownerProps}\n >\n <StyledButton\n title={label} // this is captured as the standard HTML \"title\" attribute and is printed in output HTML\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM_BUTTON}\n innerRef={setRefIndex}\n {...getGlobalAttributes(otherProps)}\n type=\"button\"\n >\n {Icon && <Icon size=\"m\" />}\n </StyledButton>\n </StyledToolbarItem>\n );\n })}\n </StyledList>\n </StyledMenubarContainer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACqDP;AArDhB,SAAS,2BAA2B;AACpC,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,6BAA6B;AACtC,SAAS,gCAAgC;AACzC,SAAS,oBAAoB;AAC7B,SAAS,WAAW,WAAW,oBAAoB;AACnD,SAAS,YAAY,wBAAwB,yBAAyB;AACtE,SAAS,8BAA8B;AAEhC,MAAM,sBAAsB,MAAmB;AACpD,QAAM;AAAA,IACJ,OAAO,EAAE,QAAQ;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,qBAAqB;AAEpC,QAAM,EAAE,SAAS,QAAQ,mBAAmB,IAAI,uBAAuB;AAEvE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,yBAAyB,QAAQ;AAAA,MAC9C,cAAW;AAAA,MACX,UAAU,eAAe,cAAc;AAAA,MACtC,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACC,QAAO;AAAA,UACP,YAAW;AAAA,UACX,gBAAe;AAAA,UACf,QAAO;AAAA,UACP,MAAM;AAAA,UACN,MAAK;AAAA,UACL,WAAW;AAAA,UACX,UAAU;AAAA,UACV,eAAa,yBAAyB,QAAQ;AAAA,UAC7C,GAAG;AAAA,UAEH,kBAAQ,IAAI,CAAC,MAAM,UAAU;AAC5B,kBAAM,EAAE,KAAK,IAAI;AACjB,kBAAM,cAAc,OAAO,KAAK;AAEhC,gBAAI,SAAS,iBAAiB;AAC5B,oBAAM,EAAE,OAAAA,QAA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JjE,GAAG,WAAW,oBAAoBA,MAAK;AAAA,cAK9C;AAAA,YAEJ;AAEA,kBAAM,EAAE,OAAO,MAAM,GAAG,WAAW,IAAI;AACvC,mBACE;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBAEL,eAAa,yBAAyB,QAAQ;AAAA,gBAC7C,GAAG;AAAA,gBAEJ;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO;AAAA,oBACP,eAAa,yBAAyB,QAAQ;AAAA,oBAC9C,UAAU;AAAA,oBACT,GAAG,oBAAoB,UAAU;AAAA,oBAClC,MAAK;AAAA,oBAEJ,kBAAQ,oBAAC,QAAK,MAAK,KAAI;AAAA;AAAA,gBAC1B;AAAA;AAAA,cAZK,GAAG,WAAW,oBAAoB,KAAK;AAAA,YAa9C;AAAA,UAEJ,CAAC;AAAA;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;",
6
+ "names": ["label", "otherProps"]
7
7
  }
@@ -1,20 +1,14 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { useState, useRef, useCallback } from "react";
4
3
  import { DSAppPicker } from "@elliemae/ds-app-picker";
5
- import { mergeRefs } from "@elliemae/ds-system";
6
- import { getGlobalAttributes } from "@elliemae/ds-props-helpers";
7
4
  import { MenuPicker } from "@elliemae/ds-icons";
5
+ import { getGlobalAttributes } from "@elliemae/ds-props-helpers";
6
+ import { mergeRefs } from "@elliemae/ds-system";
7
+ import { useCallback, useRef, useState } from "react";
8
+ import { DSGlobalHeaderDatatestid } from "../../../../exported-related/index.js";
8
9
  import { useCallbackAfterRender } from "../../../../utils/useCallbackAfterRender.js";
9
10
  import { StyledButton } from "../../../styles.js";
10
- import { DSGlobalHeaderDatatestid } from "../../../../exported-related/index.js";
11
- const AppPicker = ({
12
- label,
13
- id,
14
- setRef,
15
- componentProps,
16
- ...otherProps
17
- }) => {
11
+ const AppPicker = ({ label, setRef, componentProps, ...otherProps }) => {
18
12
  const [isOpen, setIsOpen] = useState(false);
19
13
  const internalTriggerRef = useRef(null);
20
14
  const {
@@ -74,7 +68,6 @@ const AppPicker = ({
74
68
  "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM_BUTTON,
75
69
  "aria-haspopup": true,
76
70
  "aria-expanded": userIsOpen ?? isOpen,
77
- id,
78
71
  ...getGlobalAttributes(otherProps),
79
72
  type: "button",
80
73
  children: /* @__PURE__ */ jsx(MenuPicker, { width: 20.73, height: 20.73 })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useRef, useCallback } from 'react';\nimport { DSAppPicker } from '@elliemae/ds-app-picker';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport { getGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport { useCallbackAfterRender } from '../../../../utils/useCallbackAfterRender.js';\nimport { StyledButton } from '../../../styles.js';\nimport { DSGlobalHeaderDatatestid } from '../../../../exported-related/index.js';\nimport type { DSGlobalHeaderInternalsT } from '../../../../sharedTypes.js';\n\nexport const AppPicker = ({\n label,\n id,\n setRef,\n componentProps,\n ...otherProps\n}: DSGlobalHeaderInternalsT.AppPickerProps): JSX.Element => {\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const internalTriggerRef = useRef<HTMLButtonElement>(null);\n\n const {\n apps,\n icon,\n customApps,\n sectionTitle,\n customSectionTitle,\n actionRef,\n isOpen: userIsOpen,\n onKeyDown: userOnKeyDown,\n onClickOutside: userOnClickOutside,\n renderTrigger: userRenderTrigger,\n onClose,\n triggerRef,\n triggerOnClick,\n } = componentProps;\n\n const schedule = useCallbackAfterRender();\n\n // const appPickerRef = useRef(null);\n // const internalActionRef = useMemo(() => actionRef ?? appPickerRef, [actionRef]);\n\n const focusTrigger = useCallback(() => internalTriggerRef.current?.focus(), []);\n\n const handleTriggerKeyDown: React.KeyboardEventHandler = useCallback((e) => {\n if (e.code === 'Enter' || e.code === 'Space' || e.code === 'ArrowDown') {\n setIsOpen(true);\n }\n }, []);\n\n const handleAppPickerOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n setIsOpen(false);\n schedule(focusTrigger);\n }\n },\n [focusTrigger, schedule],\n );\n\n const handleOnClickOutside = useCallback(() => {\n setIsOpen(false);\n }, []);\n\n const handleOnClick: React.MouseEventHandler = useCallback(\n (e) => {\n setIsOpen(true);\n setTimeout(() => {\n if (e.detail === 0) actionRef?.current?.focusSelectedOrFirstAvailable?.();\n else actionRef?.current?.focusWrapper();\n }, 10);\n },\n [actionRef],\n );\n\n // eslint-disable-next-line react/no-unstable-nested-components\n const TriggerDefaultComponent = ({ ref }: { ref: React.MutableRefObject<HTMLButtonElement> }) => (\n <StyledButton\n onClick={triggerOnClick ?? handleOnClick}\n onKeyDown={handleTriggerKeyDown}\n innerRef={(buttonRef: HTMLButtonElement) => {\n setRef(buttonRef);\n mergeRefs(internalTriggerRef, triggerRef, ref)(buttonRef);\n }}\n aria-label={label}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM_BUTTON}\n aria-haspopup\n aria-expanded={userIsOpen ?? isOpen}\n id={id}\n {...getGlobalAttributes(otherProps)}\n type=\"button\"\n >\n <MenuPicker width={20.73} height={20.73} />\n </StyledButton>\n );\n\n return (\n <DSAppPicker\n apps={apps}\n customApps={customApps}\n sectionTitle={sectionTitle}\n customSectionTitle={customSectionTitle}\n icon={icon}\n onKeyDown={userOnKeyDown ?? handleAppPickerOnKeyDown}\n actionRef={actionRef}\n onClickOutside={userOnClickOutside ?? handleOnClickOutside}\n renderTrigger={userRenderTrigger || TriggerDefaultComponent}\n isOpen={userIsOpen ?? isOpen}\n onClose={onClose}\n triggerRef={triggerRef}\n />\n );\n};\n"],
5
- "mappings": "AAAA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AW,SAAS,gCAAgC;AAAA,YACnE,YAAW,SAAS,aAAa;AAAA,MACxC,GAAG,EAAE;AAAA,IACP;AAAA,IACA,CAAC,SAAS;AAAA,EACZ;AAGA,QAAM,0BAA0B,CAAC,EAAE,IAAI,MACrC;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,kBAAkB;AAAA,MAC3B,WAAW;AAAA,MACX,UAAU,CAAC,cAAiC;AAC1C,eAAO,SAAS;AAChB,kBAAU,oBAAoB,YAAY,GAAG,EAAE,SAAS;AAAA,MAC1D;AAAA,MACA,cAAY;AAAA,MACZ,eAAa,yBAAyB,QAAQ;AAAA,MAC9C,iBAAa;AAAA,MACb,iBAAe,cAAc;AAAA,MAC7B;AAAA,MACC,GAAG,oBAAoB,UAAU;AAAA,MAClC,MAAK;AAAA,MAEL,8BAAC,cAAW,OAAO,OAAO,QAAQ,OAAO;AAAA;AAAA,EAC3C;AAGF,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,iBAAiB;AAAA,MAC5B;AAAA,MACA,gBAAgB,sBAAsB;AAAA,MACtC,eAAe,qBAAqB;AAAA,MACpC,QAAQ,cAAc;AAAA,MACtB;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSAppPicker } from '@elliemae/ds-app-picker';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport { getGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport React, { useCallback, useRef, useState } from 'react';\nimport { DSGlobalHeaderDatatestid } from '../../../../exported-related/index.js';\nimport type { DSGlobalHeaderT } from '../../../../react-desc-prop-types.js';\nimport { useCallbackAfterRender } from '../../../../utils/useCallbackAfterRender.js';\nimport { StyledButton } from '../../../styles.js';\n\ntype AppPickerOutOfTheBoxProps =\n // what comes from\n // the prop toolbar (array)\n // specifically only if the type is 'ds-app-picker' so they give us the correct interface\n DSGlobalHeaderT.AppPickerProps & {\n // this interface is an addition that comes from our own implementation\n // GlobalHeaderToolbar -> useGlobalHeaderToolbar\n // is handling focus management for the user when using our out of the box\n setRef: (ref: HTMLElement) => void;\n };\n\nexport const AppPicker = ({ label, setRef, componentProps, ...otherProps }: AppPickerOutOfTheBoxProps): JSX.Element => {\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const internalTriggerRef = useRef<HTMLButtonElement>(null);\n\n const {\n apps,\n icon,\n customApps,\n sectionTitle,\n customSectionTitle,\n actionRef,\n isOpen: userIsOpen,\n onKeyDown: userOnKeyDown,\n onClickOutside: userOnClickOutside,\n renderTrigger: userRenderTrigger,\n onClose,\n triggerRef,\n triggerOnClick,\n } = componentProps;\n\n const schedule = useCallbackAfterRender();\n\n // const appPickerRef = useRef(null);\n // const internalActionRef = useMemo(() => actionRef ?? appPickerRef, [actionRef]);\n\n const focusTrigger = useCallback(() => internalTriggerRef.current?.focus(), []);\n\n const handleTriggerKeyDown: React.KeyboardEventHandler = useCallback((e) => {\n if (e.code === 'Enter' || e.code === 'Space' || e.code === 'ArrowDown') {\n setIsOpen(true);\n }\n }, []);\n\n const handleAppPickerOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape') {\n setIsOpen(false);\n schedule(focusTrigger);\n }\n },\n [focusTrigger, schedule],\n );\n\n const handleOnClickOutside = useCallback(() => {\n setIsOpen(false);\n }, []);\n\n const handleOnClick: React.MouseEventHandler = useCallback(\n (e) => {\n setIsOpen(true);\n setTimeout(() => {\n if (e.detail === 0) actionRef?.current?.focusSelectedOrFirstAvailable?.();\n else actionRef?.current?.focusWrapper();\n }, 10);\n },\n [actionRef],\n );\n\n // eslint-disable-next-line react/no-unstable-nested-components\n const TriggerDefaultComponent = ({ ref }: { ref: React.MutableRefObject<HTMLButtonElement> }) => (\n <StyledButton\n onClick={triggerOnClick ?? handleOnClick}\n onKeyDown={handleTriggerKeyDown}\n innerRef={(buttonRef: HTMLButtonElement) => {\n setRef(buttonRef);\n mergeRefs(internalTriggerRef, triggerRef, ref)(buttonRef);\n }}\n aria-label={label}\n data-testid={DSGlobalHeaderDatatestid.MENUBAR.ITEM_BUTTON}\n aria-haspopup\n aria-expanded={userIsOpen ?? isOpen}\n {...getGlobalAttributes(otherProps)}\n type=\"button\"\n >\n <MenuPicker width={20.73} height={20.73} />\n </StyledButton>\n );\n\n return (\n <DSAppPicker\n apps={apps}\n customApps={customApps}\n sectionTitle={sectionTitle}\n customSectionTitle={customSectionTitle}\n icon={icon}\n onKeyDown={userOnKeyDown ?? handleAppPickerOnKeyDown}\n actionRef={actionRef}\n onClickOutside={userOnClickOutside ?? handleOnClickOutside}\n renderTrigger={userRenderTrigger || TriggerDefaultComponent}\n isOpen={userIsOpen ?? isOpen}\n onClose={onClose}\n triggerRef={triggerRef}\n />\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC+FjB;AA/FN,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AACpC,SAAS,iBAAiB;AAC1B,SAAgB,aAAa,QAAQ,gBAAgB;AACrD,SAAS,gCAAgC;AAEzC,SAAS,8BAA8B;AACvC,SAAS,oBAAoB;AAatB,MAAM,YAAY,CAAC,EAAE,OAAO,QAAQ,gBAAgB,GAAG,WAAW,MAA8C;AACrH,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAkB,KAAK;AACnD,QAAM,qBAAqB,OAA0B,IAAI;AAEzD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,WAAW,uBAAuB;AAKxC,QAAM,eAAe,YAAY,MAAM,mBAAmB,SAAS,MAAM,GAAG,CAAC,CA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AAgB,sBAAsB;AAAA,MACtC,eAAe,qBAAqB;AAAA,MACpC,QAAQ,cAAc;AAAA,MACtB;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,15 +1,14 @@
1
1
  import * as React from "react";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { useState, useCallback } from "react";
4
- import { useGetGlobalAttributes } from "@elliemae/ds-props-helpers";
5
3
  import { DSPopperJS } from "@elliemae/ds-popperjs";
6
- import { PopupMenuContent } from "./menuContent/PopupMenuContent.js";
7
- import { StyledButton } from "../../../styles.js";
4
+ import { useGetGlobalAttributes } from "@elliemae/ds-props-helpers";
5
+ import { useCallback, useState } from "react";
8
6
  import { DSGlobalHeaderDatatestid } from "../../../../exported-related/index.js";
7
+ import { StyledButton } from "../../../styles.js";
8
+ import { PopupMenuContent } from "./menuContent/PopupMenuContent.js";
9
9
  const PopupMenu = ({
10
10
  Icon,
11
11
  onClick,
12
- id,
13
12
  setRef,
14
13
  componentProps,
15
14
  ...otherProps
@@ -66,7 +65,6 @@ const PopupMenu = ({
66
65
  "data-testid": DSGlobalHeaderDatatestid.MENUBAR.ITEM_BUTTON,
67
66
  "aria-haspopup": true,
68
67
  "aria-expanded": userIsOpen ?? isOpen,
69
- id,
70
68
  ...useGetGlobalAttributes(otherProps),
71
69
  type: "button",
72
70
  children: Icon && /* @__PURE__ */ jsx(Icon, { size: "m" })