@elliemae/ds-global-header 3.70.0-next.7 → 3.70.0-next.71

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 (155) hide show
  1. package/dist/cjs/DSGlobalHeader.js +16 -2
  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 +13 -2
  5. package/dist/cjs/config/useGlobalHeader.js.map +2 -2
  6. package/dist/cjs/constants/index.js +11 -5
  7. package/dist/cjs/constants/index.js.map +2 -2
  8. package/dist/cjs/index.js +3 -6
  9. package/dist/cjs/index.js.map +3 -3
  10. package/dist/cjs/package.json +1 -4
  11. package/dist/cjs/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js +33 -1
  12. package/dist/cjs/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js.map +2 -2
  13. package/dist/cjs/parts/Logo/GlobalHeaderLogo.js +16 -2
  14. package/dist/cjs/parts/Logo/GlobalHeaderLogo.js.map +2 -2
  15. package/dist/cjs/parts/Toolbar/GlobalHeaderToolbar.js +54 -16
  16. package/dist/cjs/parts/Toolbar/GlobalHeaderToolbar.js.map +2 -2
  17. package/dist/cjs/{utils/useCallbackAfterRender.js → parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.js} +7 -16
  18. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.js.map +7 -0
  19. package/dist/cjs/{hooks/useOnClickOutside.js → parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.js} +13 -30
  20. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.js.map +7 -0
  21. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.js +53 -0
  22. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.js.map +7 -0
  23. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.js +84 -0
  24. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.js.map +7 -0
  25. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.js +50 -0
  26. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.js.map +7 -0
  27. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.js +66 -0
  28. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.js.map +7 -0
  29. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js +118 -71
  30. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js.map +3 -3
  31. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js +27 -11
  32. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js.map +2 -2
  33. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js +52 -0
  34. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js.map +7 -0
  35. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.js +23 -15
  36. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.js.map +2 -2
  37. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js +54 -0
  38. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js.map +7 -0
  39. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js +28 -16
  40. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js.map +2 -2
  41. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js +61 -50
  42. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js.map +2 -2
  43. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.js +58 -0
  44. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.js.map +7 -0
  45. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.js +33 -25
  46. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.js.map +2 -2
  47. package/dist/cjs/parts/Toolbar/outOfTheBox/index.js +12 -4
  48. package/dist/cjs/parts/Toolbar/outOfTheBox/index.js.map +2 -2
  49. package/dist/cjs/parts/Toolbar/styles.js +6 -1
  50. package/dist/cjs/parts/Toolbar/styles.js.map +2 -2
  51. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  52. package/dist/cjs/sharedTypes.js.map +1 -1
  53. package/dist/cjs/typescript-testing/typescript-global-header-toolbar-types.js +52 -0
  54. package/dist/cjs/typescript-testing/typescript-global-header-toolbar-types.js.map +2 -2
  55. package/dist/esm/DSGlobalHeader.js +16 -2
  56. package/dist/esm/DSGlobalHeader.js.map +2 -2
  57. package/dist/esm/DSGlobalHeaderContext.js.map +2 -2
  58. package/dist/esm/config/useGlobalHeader.js +13 -2
  59. package/dist/esm/config/useGlobalHeader.js.map +2 -2
  60. package/dist/esm/constants/index.js +11 -5
  61. package/dist/esm/constants/index.js.map +2 -2
  62. package/dist/esm/index.js +3 -6
  63. package/dist/esm/index.js.map +3 -3
  64. package/dist/esm/package.json +1 -4
  65. package/dist/esm/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js +34 -2
  66. package/dist/esm/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js.map +2 -2
  67. package/dist/esm/parts/Logo/GlobalHeaderLogo.js +16 -2
  68. package/dist/esm/parts/Logo/GlobalHeaderLogo.js.map +2 -2
  69. package/dist/esm/parts/Toolbar/GlobalHeaderToolbar.js +55 -17
  70. package/dist/esm/parts/Toolbar/GlobalHeaderToolbar.js.map +2 -2
  71. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.js +8 -0
  72. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.js.map +7 -0
  73. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.js +13 -0
  74. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.js.map +7 -0
  75. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.js +23 -0
  76. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.js.map +7 -0
  77. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.js +54 -0
  78. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.js.map +7 -0
  79. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.js +20 -0
  80. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.js.map +7 -0
  81. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.js +36 -0
  82. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.js.map +7 -0
  83. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js +119 -72
  84. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js.map +2 -2
  85. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js +28 -12
  86. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js.map +2 -2
  87. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js +22 -0
  88. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js.map +7 -0
  89. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.js +24 -16
  90. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.js.map +2 -2
  91. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js +24 -0
  92. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js.map +7 -0
  93. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js +34 -17
  94. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js.map +2 -2
  95. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js +61 -50
  96. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js.map +2 -2
  97. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.js +28 -0
  98. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.js.map +7 -0
  99. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.js +33 -25
  100. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.js.map +2 -2
  101. package/dist/esm/parts/Toolbar/outOfTheBox/index.js +8 -3
  102. package/dist/esm/parts/Toolbar/outOfTheBox/index.js.map +2 -2
  103. package/dist/esm/parts/Toolbar/styles.js +6 -1
  104. package/dist/esm/parts/Toolbar/styles.js.map +2 -2
  105. package/dist/esm/react-desc-prop-types.js.map +2 -2
  106. package/dist/esm/typescript-testing/typescript-global-header-toolbar-types.js +52 -0
  107. package/dist/esm/typescript-testing/typescript-global-header-toolbar-types.js.map +2 -2
  108. package/dist/types/DSGlobalHeaderContext.d.ts +10 -2
  109. package/dist/types/config/useGlobalHeader.d.ts +3 -4
  110. package/dist/types/constants/index.d.ts +4 -3
  111. package/dist/types/index.d.ts +0 -2
  112. package/dist/types/parts/Breadcrumb/PureBreadcrumb.d.ts +1 -1
  113. package/dist/types/parts/Breadcrumb/styles.d.ts +1 -1
  114. package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.d.ts +4 -0
  115. package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.d.ts +2 -0
  116. package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.d.ts +1 -0
  117. package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.d.ts +2 -0
  118. package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.d.ts +23 -0
  119. package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.d.ts +456 -0
  120. package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.d.ts +2 -2
  121. package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.d.ts +2 -2
  122. package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.d.ts +28 -0
  123. package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.d.ts +9 -1
  124. package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.d.ts +26 -0
  125. package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.d.ts +2 -2
  126. package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.d.ts +3 -1
  127. package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.d.ts +26 -0
  128. package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.d.ts +2 -3
  129. package/dist/types/parts/Toolbar/outOfTheBox/index.d.ts +3 -3
  130. package/dist/types/parts/Toolbar/styles.d.ts +1 -0
  131. package/dist/types/react-desc-prop-types.d.ts +63 -72
  132. package/dist/types/sharedTypes.d.ts +16 -6
  133. package/package.json +20 -17
  134. package/dist/cjs/hooks/useOnClickOutside.js.map +0 -7
  135. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js +0 -127
  136. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js.map +0 -7
  137. package/dist/cjs/utils/useCallbackAfterRender.js.map +0 -7
  138. package/dist/esm/hooks/useOnClickOutside.js +0 -30
  139. package/dist/esm/hooks/useOnClickOutside.js.map +0 -7
  140. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js +0 -97
  141. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js.map +0 -7
  142. package/dist/esm/utils/useCallbackAfterRender.js +0 -17
  143. package/dist/esm/utils/useCallbackAfterRender.js.map +0 -7
  144. package/dist/types/hooks/useOnClickOutside.d.ts +0 -1
  145. package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.d.ts +0 -6
  146. package/dist/types/tests/GlobalHeader.a11y.test.d.ts +0 -1
  147. package/dist/types/tests/GlobalHeader.callback.test.d.ts +0 -1
  148. package/dist/types/tests/GlobalHeader.getOwnerProps.test.d.ts +0 -1
  149. package/dist/types/tests/GlobalHeader.keyboard.test.d.ts +0 -1
  150. package/dist/types/tests/GlobalHeader.setup.test.d.ts +0 -113
  151. package/dist/types/typescript-testing/typescript-global-header-breadcrumb-types.d.ts +0 -3
  152. package/dist/types/typescript-testing/typescript-global-header-deprecated.d.ts +0 -1
  153. package/dist/types/typescript-testing/typescript-global-header-toolbar-types.d.ts +0 -3
  154. package/dist/types/typescript-testing/typescript-global-header-valid.d.ts +0 -1
  155. package/dist/types/utils/useCallbackAfterRender.d.ts +0 -3
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/Toolbar/GlobalHeaderToolbar.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { getGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { useContext } from 'react';\nimport { FONT_DETECTOR, GLOBAL_HEADER_DATA_TESTID } from '../../constants/index.js';\nimport { DSGlobalHeaderContext } from '../../DSGlobalHeaderContext.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={GLOBAL_HEADER_DATA_TESTID.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={GLOBAL_HEADER_DATA_TESTID.MENUBAR_LIST}\n {...ownerProps}\n >\n {toolbar.map((item, index) => {\n const { type } = item;\n // inside a toolbar items needs to be navigable via arrow keys.\n // this setRef(index) is generating an index of references that can be \"focused\" when user is navigating with arrows\n // NOTE:\n // focus management based on DOM nodes.focus() in react is problematic due to unpredictable timing of refs assignment and react rendering\n // we should be using the \"focus tracker\" approach where we keep track of \"what we want to focuse\",\n // then have the ref callback functions invoke the focus to the element AFTER the LAST element is rendered, not tracking the DOM nodes directly.\n // We aren't changing this right now, but let's keep this in mind.\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={GLOBAL_HEADER_DATA_TESTID.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 ownerProps={ownerProps}\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={GLOBAL_HEADER_DATA_TESTID.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={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM}\n {...ownerProps}\n >\n <SearchToggle instanceUID={instanceUID} label={label} 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={GLOBAL_HEADER_DATA_TESTID.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={GLOBAL_HEADER_DATA_TESTID.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={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_BUTTON}\n innerRef={setRefIndex}\n {...getGlobalAttributes(otherProps)}\n type=\"button\"\n {...ownerProps}\n >\n {Icon && <Icon size=\"m\" />}\n </StyledButton>\n </StyledToolbarItem>\n );\n })}\n </StyledList>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OAAO;AAAA,oBACP,eAAa,2CAA0B;AAAA,oBACvC,UAAU;AAAA,oBACT,OAAG,6CAAoB,UAAU;AAAA,oBAClC,MAAK;AAAA,oBACJ,GAAG;AAAA,oBAEH,kBAAQ,4CAAC,QAAK,MAAK,KAAI;AAAA;AAAA,gBAC1B;AAAA;AAAA,cAbK,GAAG,WAAW,oBAAoB,KAAK;AAAA,YAc9C;AAAA,UAEJ,CAAC;AAAA;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;",
4
+ "sourcesContent": ["import { getGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport { useContext } from 'react';\nimport { FONT_DETECTOR, GLOBAL_HEADER_DATA_TESTID } from '../../constants/index.js';\nimport { DSGlobalHeaderContext } from '../../DSGlobalHeaderContext.js';\nimport { StyledButton } from '../styles.js';\nimport { AppPickerCTXRenderer, 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 instanceUID,\n globalHeaderToolbarGrid,\n fontDetector,\n /*\n * The slot layer, split into its two genuinely separate halves.\n *\n * `getOwnerProps` is the lookup table getPartProps indexes by data-dimsum-slot to find a consumer's\n * slot prop, so it can only come from DSGlobalHeader \u2014 that is what the verbose drilled name says out\n * loud when it reaches the out-of-the-box parts.\n *\n * `getOwnerPropsArguments` is the hydrator for function-form slot props and is used for nothing else,\n * so it belongs to whichever element renders the slot. Explicit and empty here: none of the toolbar's\n * own elements have render-time values worth passing. Stated rather than omitted, so \"what arguments\n * does this slot get?\" always has a visible answer.\n */\n getOwnerPropsAwareOfPropsPassedToGlobalHeader,\n noSlotArguments,\n } = useContext(DSGlobalHeaderContext);\n\n const { listRef, setRef, keyboardNavigation } = useGlobalHeaderToolbar();\n\n return (\n <StyledMenubarContainer\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_CONTAINER}\n aria-label=\"menubar\"\n withSpan={fontDetector > FONT_DETECTOR.SMALL}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\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={GLOBAL_HEADER_DATA_TESTID.MENUBAR_LIST}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n {toolbar.map((item, index) => {\n const { type } = item;\n /*\n * Each branch below strips `type` rather than forwarding it. It is toolbar configuration, but it\n * is ALSO a member of GlobalAttributesT \u2014 so any part that spreads item-level global attributes\n * onto a non-button element renders `type=\"ds-search-toggle\"` into the DOM. The button-rooted\n * parts escape that only incidentally, by re-declaring `type=\"button\"` after their spread.\n * Stripping here is what stops the outcome depending on that accident.\n */\n // inside a toolbar items needs to be navigable via arrow keys.\n // this setRef(index) is generating an index of references that can be \"focused\" when user is navigating with arrows\n // NOTE:\n // focus management based on DOM nodes.focus() in react is problematic due to unpredictable timing of refs assignment and react rendering\n // we should be using the \"focus tracker\" approach where we keep track of \"what we want to focuse\",\n // then have the ref callback functions invoke the focus to the element AFTER the LAST element is rendered, not tracking the DOM nodes directly.\n // We aren't changing this right now, but let's keep this in mind.\n const setRefIndex = setRef(index);\n\n if (type === 'ds-popup-menu') {\n const { label, type: strippedDiscriminator, ...otherProps } = item;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\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 getOwnerPropsAwareOfPropsPassedToGlobalHeader={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n />\n </StyledToolbarItem>\n );\n }\n if (type === 'ds-app-picker') {\n const { label, type: strippedDiscriminator, ...otherProps } = item;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n <AppPickerCTXRenderer\n label={label}\n setRef={setRefIndex}\n {...otherProps}\n getOwnerPropsAwareOfPropsPassedToGlobalHeader={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n />\n </StyledToolbarItem>\n );\n }\n if (type === 'ds-search-toggle') {\n const { label, type: strippedDiscriminator, ...otherProps } = item;\n return (\n <StyledToolbarItem\n role=\"menuitem\"\n key={`${instanceUID}-ds-toolbar-item-${label}`}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n <SearchToggle\n instanceUID={instanceUID}\n label={label}\n setRef={setRefIndex}\n {...otherProps}\n getOwnerPropsAwareOfPropsPassedToGlobalHeader={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n />\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={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\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={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n <StyledButton\n title={label} // this is captured as the standard HTML \"title\" attribute and is printed in output HTML\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_BUTTON}\n innerRef={setRefIndex}\n {...getGlobalAttributes(otherProps)}\n type=\"button\"\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n {Icon && <Icon size=\"m\" />}\n </StyledButton>\n </StyledToolbarItem>\n );\n })}\n </StyledList>\n </StyledMenubarContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkFP;AAlFhB,8BAAoC;AACpC,mBAA2B;AAC3B,uBAAyD;AACzD,mCAAsC;AACtC,oBAA6B;AAC7B,yBAA8D;AAC9D,IAAAA,iBAAsE;AACtE,oCAAuC;AAEhC,MAAM,sBAAsB,MAAmB;AACpD,QAAM;AAAA,IACJ,OAAO,EAAE,QAAQ;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kDAAqB;AAEpC,QAAM,EAAE,SAAS,QAAQ,mBAAmB,QAAI,sDAAuB;AAEvE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,2CAA0B;AAAA,MACvC,cAAW;AAAA,MACX,UAAU,eAAe,+BAAc;AAAA,MACvC,eAAe;AAAA,MACf,wBAAwB;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;",
6
6
  "names": ["import_styles", "label", "otherProps"]
7
7
  }
@@ -26,22 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var useCallbackAfterRender_exports = {};
30
- __export(useCallbackAfterRender_exports, {
31
- useCallbackAfterRender: () => useCallbackAfterRender
29
+ var AppPickerCTX_exports = {};
30
+ __export(AppPickerCTX_exports, {
31
+ AppPickerCtx: () => AppPickerCtx
32
32
  });
33
- module.exports = __toCommonJS(useCallbackAfterRender_exports);
33
+ module.exports = __toCommonJS(AppPickerCTX_exports);
34
34
  var React = __toESM(require("react"));
35
35
  var import_react = require("react");
36
- const useCallbackAfterRender = (isLayout = false) => {
37
- const lastRun = (0, import_react.useRef)(null);
38
- const effect = (0, import_react.useMemo)(() => isLayout ? import_react.useLayoutEffect : import_react.useEffect, [isLayout]);
39
- effect(() => {
40
- lastRun.current?.();
41
- lastRun.current = null;
42
- });
43
- return (callback) => {
44
- lastRun.current = callback;
45
- };
46
- };
47
- //# sourceMappingURL=useCallbackAfterRender.js.map
36
+ const defaultContext = {};
37
+ const AppPickerCtx = (0, import_react.createContext)(defaultContext);
38
+ //# sourceMappingURL=AppPickerCTX.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { createContext } from 'react';\nimport type { useAppPickerCTX } from './useAppPickerCTX.js';\n\nexport interface AppPickerCTX extends ReturnType<typeof useAppPickerCTX> {}\n\n// `{} as AppPickerCTX` rather than `null`, matching DSAppPickerContext and DSGlobalHeaderContext: the\n// provider always wraps the consumers, so a nullable context would only buy every reader a null check\n// that can never be true.\nconst defaultContext = {} as AppPickerCTX;\n\nexport const AppPickerCtx = createContext<AppPickerCTX>(defaultContext);\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAQ9B,MAAM,iBAAiB,CAAC;AAEjB,MAAM,mBAAe,4BAA4B,cAAc;",
6
+ "names": []
7
+ }
@@ -26,35 +26,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var useOnClickOutside_exports = {};
30
- __export(useOnClickOutside_exports, {
31
- useOnClickOutside: () => useOnClickOutside
29
+ var AppPickerCTXRenderer_exports = {};
30
+ __export(AppPickerCTXRenderer_exports, {
31
+ AppPickerCTXRenderer: () => AppPickerCTXRenderer
32
32
  });
33
- module.exports = __toCommonJS(useOnClickOutside_exports);
33
+ module.exports = __toCommonJS(AppPickerCTXRenderer_exports);
34
34
  var React = __toESM(require("react"));
35
- var import_react = __toESM(require("react"));
36
- function useOnClickOutside(ref, cb) {
37
- const cbRef = import_react.default.useRef(cb);
38
- (0, import_react.useEffect)(() => {
39
- cbRef.current = cb;
40
- }, [cb]);
41
- (0, import_react.useEffect)(() => {
42
- if (!ref) {
43
- return () => {
44
- };
45
- }
46
- const listener = (event) => {
47
- const target = event.target;
48
- if (!target) return;
49
- if (ref.contains(target)) return;
50
- cbRef.current(event);
51
- };
52
- document.addEventListener("mousedown", listener, true);
53
- document.addEventListener("touchstart", listener, true);
54
- return () => {
55
- document.removeEventListener("mousedown", listener, true);
56
- document.removeEventListener("touchstart", listener, true);
57
- };
58
- }, [ref]);
59
- }
60
- //# sourceMappingURL=useOnClickOutside.js.map
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_AppPickerRenderer = require("./AppPickerRenderer.js");
37
+ var import_useAppPickerCTX = require("./useAppPickerCTX.js");
38
+ var import_AppPickerCTX = require("./AppPickerCTX.js");
39
+ const AppPickerCTXRenderer = (appPickerProps) => {
40
+ const appPickerCTX = (0, import_useAppPickerCTX.useAppPickerCTX)(appPickerProps);
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_AppPickerCTX.AppPickerCtx.Provider, { value: appPickerCTX, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_AppPickerRenderer.AppPickerRenderer, {}) });
42
+ };
43
+ //# sourceMappingURL=AppPickerCTXRenderer.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { AppPickerRenderer } from './AppPickerRenderer.js';\nimport type { AppPickerT } from './react-desc-prop-types.js';\nimport { useAppPickerCTX } from './useAppPickerCTX.js';\nimport { AppPickerCtx } from './AppPickerCTX.js';\n\nexport const AppPickerCTXRenderer = (appPickerProps: AppPickerT.Props): JSX.Element => {\n const appPickerCTX = useAppPickerCTX(appPickerProps);\n\n return (\n <AppPickerCtx.Provider value={appPickerCTX}>\n <AppPickerRenderer />\n </AppPickerCtx.Provider>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADUjB;AAVN,+BAAkC;AAElC,6BAAgC;AAChC,0BAA6B;AAEtB,MAAM,uBAAuB,CAAC,mBAAkD;AACrF,QAAM,mBAAe,wCAAgB,cAAc;AAEnD,SACE,4CAAC,iCAAa,UAAb,EAAsB,OAAO,cAC5B,sDAAC,8CAAkB,GACrB;AAEJ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var AppPickerRenderer_exports = {};
30
+ __export(AppPickerRenderer_exports, {
31
+ AppPickerRenderer: () => AppPickerRenderer
32
+ });
33
+ module.exports = __toCommonJS(AppPickerRenderer_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_ds_app_picker = require("@elliemae/ds-app-picker");
37
+ var import_react = __toESM(require("react"));
38
+ var import_AppPickerCTX = require("./AppPickerCTX.js");
39
+ var import_TriggerDefaultComponent = require("./TriggerDefaultComponent.js");
40
+ const AppPickerRenderer = () => {
41
+ const { contractProps, id } = import_react.default.useContext(import_AppPickerCTX.AppPickerCtx);
42
+ const consumerOwnsTheTrigger = Boolean(contractProps.renderTrigger || contractProps.TriggerComponent);
43
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
44
+ import_ds_app_picker.DSAppPicker,
45
+ {
46
+ openAndFocusOnArrowKeys: true,
47
+ ...consumerOwnsTheTrigger ? {} : { TriggerComponent: import_TriggerDefaultComponent.TriggerDefaultComponent },
48
+ ...id ? { id } : {},
49
+ ...contractProps
50
+ }
51
+ );
52
+ };
53
+ //# sourceMappingURL=AppPickerRenderer.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { DSAppPicker } from '@elliemae/ds-app-picker';\nimport React from 'react';\nimport { AppPickerCtx } from './AppPickerCTX.js';\nimport { TriggerDefaultComponent } from './TriggerDefaultComponent.js';\n\nexport const AppPickerRenderer = (): JSX.Element => {\n const { contractProps, id } = React.useContext(AppPickerCtx);\n\n /*\n * Our default trigger applies only when the consumer supplied neither trigger API.\n *\n * This one cannot be expressed by spread order, unlike every other default below. DSAppPicker's\n * Trigger gives `TriggerComponent` precedence over `renderTrigger` (Trigger.tsx: \"TriggerComponent\n * wins when both custom APIs are supplied\"), so passing ours unconditionally would silently discard a\n * consumer's `renderTrigger` no matter where `contractProps` is spread \u2014 the spread would forward\n * their prop faithfully and DSAppPicker would then ignore it. Deciding here instead keeps both custom\n * trigger APIs working through the toolbar config.\n */\n const consumerOwnsTheTrigger = Boolean(contractProps.renderTrigger || contractProps.TriggerComponent);\n\n return (\n <DSAppPicker\n // Dimsum IoC direction: our default renders first and the consumer's contract props are spread over\n // it, so anything they put in `componentProps` wins and becomes theirs to own.\n // `getDSAppPickerContractProps` drops keys explicitly set to undefined, so an unset key in the config\n // never erases a default here.\n //\n // Note what is NOT passed: no `isOpen`, no `onKeyDown`, no `onClickOutside`. Passing `isOpen` makes\n // the picker controlled and passing `onKeyDown` switches off its Escape routing and focus return \u2014\n // either way this part would owe a reimplementation of behaviour DSAppPicker already has. See\n // useAppPickerCTX for the full statement.\n //\n // The toolbar is a menubar, so ArrowDown/ArrowUp on a toolbar item open it \u2014 that is this widget's\n // keyboard contract, not an application-level choice, which is why it is opted in here rather than\n // left to each consumer. The picker owns the whole flow: it records the arrow-key activation and\n // seeds focus on the selected app (first for ArrowDown, last for ArrowUp). Spread order still lets a\n // consumer turn it off through `componentProps`.\n openAndFocusOnArrowKeys\n // `TriggerComponent`, not the deprecated `renderTrigger`: DSAppPicker renders this one as JSX so it\n // gets its own fiber and may use hooks, and it is the only trigger API that receives the id the\n // panel's aria-labelledby points at. See TriggerDefaultComponent for the full reasoning.\n {...(consumerOwnsTheTrigger ? {} : { TriggerComponent: TriggerDefaultComponent })}\n /*\n * PUI-18985 \u2014 the item-level `id` names the App Picker, and DSAppPicker derives every id in the\n * widget from it: the root takes it unchanged, the trigger becomes `getIdForAppPickerTrigger(id)`, and the\n * dialog's `aria-labelledby` points at that same trigger id. Handing it over here is what makes\n * those three agree.\n *\n * Before this, `id` rode along in `otherProps` and was spread onto the trigger AFTER the id\n * DSAppPicker had supplied, so the trigger carried the bare item id while the dialog still pointed\n * at the generated one \u2014 a pointer to no element, and a dialog with no accessible name (axe\n * `aria-dialog-name`, serious). useAppPickerCTX now reads `id` out of `otherProps` so only this\n * route exists.\n *\n * Consumers who addressed the trigger by the bare item id migrate to `getIdForAppPickerTrigger`, exported by\n * ds-app-picker; the bare id now selects the picker root. Omitted when unset, so DSAppPicker's own\n * generated instance id is untouched.\n */\n {...(id ? { id } : {})}\n {...contractProps}\n />\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqBnB;AArBJ,2BAA4B;AAC5B,mBAAkB;AAClB,0BAA6B;AAC7B,qCAAwC;AAEjC,MAAM,oBAAoB,MAAmB;AAClD,QAAM,EAAE,eAAe,GAAG,IAAI,aAAAA,QAAM,WAAW,gCAAY;AAY3D,QAAM,yBAAyB,QAAQ,cAAc,iBAAiB,cAAc,gBAAgB;AAEpG,SACE;AAAA,IAAC;AAAA;AAAA,MAgBC,yBAAuB;AAAA,MAItB,GAAI,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,uDAAwB;AAAA,MAiB9E,GAAI,KAAK,EAAE,GAAG,IAAI,CAAC;AAAA,MACnB,GAAG;AAAA;AAAA,EACN;AAEJ;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var TriggerDefaultComponent_exports = {};
30
+ __export(TriggerDefaultComponent_exports, {
31
+ TriggerDefaultComponent: () => TriggerDefaultComponent
32
+ });
33
+ module.exports = __toCommonJS(TriggerDefaultComponent_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_ds_icons = require("@elliemae/ds-icons");
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_ds_system = require("@elliemae/ds-system");
39
+ var import_react = __toESM(require("react"));
40
+ var import_constants = require("../../../../constants/index.js");
41
+ var import_styles = require("../../../styles.js");
42
+ var import_AppPickerCTX = require("./AppPickerCTX.js");
43
+ const TriggerDefaultComponent = ({
44
+ innerRef,
45
+ id,
46
+ onClick: appPickerOnClick,
47
+ onKeyDown: appPickerOnKeyDown,
48
+ "aria-haspopup": ariaHasPopup
49
+ }) => {
50
+ const { triggerOnClick, setRef, triggerRef, label, otherProps, getOwnerPropsAwareOfPropsPassedToGlobalHeader } = import_react.default.useContext(import_AppPickerCTX.AppPickerCtx);
51
+ const handleTriggerRefs = import_react.default.useCallback(
52
+ (buttonRef) => {
53
+ setRef(buttonRef);
54
+ (0, import_ds_system.mergeRefs)(triggerRef, innerRef)(buttonRef);
55
+ },
56
+ [setRef, triggerRef, innerRef]
57
+ );
58
+ const handleOnClickComposed = import_react.default.useCallback(
59
+ (e) => {
60
+ appPickerOnClick(e);
61
+ triggerOnClick?.(e);
62
+ },
63
+ [appPickerOnClick, triggerOnClick]
64
+ );
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
+ import_styles.StyledButton,
67
+ {
68
+ id,
69
+ onClick: handleOnClickComposed,
70
+ onKeyDown: appPickerOnKeyDown,
71
+ innerRef: handleTriggerRefs,
72
+ "aria-label": label,
73
+ "data-testid": import_constants.GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_BUTTON,
74
+ "aria-haspopup": ariaHasPopup,
75
+ ...(0, import_ds_props_helpers.getGlobalAttributes)(otherProps),
76
+ ...(0, import_ds_props_helpers.getXstyledProps)(otherProps),
77
+ type: "button",
78
+ getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
79
+ getOwnerPropsArguments: () => ({}),
80
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.MenuPicker, { width: 20.73, height: 20.73 })
81
+ }
82
+ );
83
+ };
84
+ //# sourceMappingURL=TriggerDefaultComponent.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import type { DSAppPickerT } from '@elliemae/ds-app-picker';\nimport { MenuPicker } from '@elliemae/ds-icons';\nimport { getGlobalAttributes, getXstyledProps } from '@elliemae/ds-props-helpers';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport React from 'react';\nimport { GLOBAL_HEADER_DATA_TESTID } from '../../../../constants/index.js';\nimport { StyledButton } from '../../../styles.js';\nimport { AppPickerCtx } from './AppPickerCTX.js';\n\n/*\n * The toolbar's default App Picker trigger, as a real component with its own module.\n *\n * MUST be handed to DSAppPicker as `TriggerComponent`, never `renderTrigger`. Two reasons, both hard:\n *\n * 1. This component uses `useContext`. DSAppPicker renders `TriggerComponent` as JSX so React creates a\n * fiber for it, which is what makes hooks here legal. `renderTrigger` is invoked as a plain function\n * (`renderTrigger({ ref })`) to honour the legacy DSPopover render-prop contract, so any hook inside\n * it registers against DSAppPicker's Trigger fiber instead \u2014 a rules-of-hooks violation React cannot\n * detect at runtime.\n * 2. Only `TriggerComponent` receives `dialogLabelId`, the id the panel's `aria-labelledby` points at.\n * It arrives as `id` and is applied below; drop it and the dialog has no accessible name.\n */\nexport const TriggerDefaultComponent = ({\n innerRef,\n id,\n onClick: appPickerOnClick,\n onKeyDown: appPickerOnKeyDown,\n 'aria-haspopup': ariaHasPopup,\n}: DSAppPickerT.TriggerComponentProps): JSX.Element => {\n const { triggerOnClick, setRef, triggerRef, label, otherProps, getOwnerPropsAwareOfPropsPassedToGlobalHeader } =\n React.useContext(AppPickerCtx);\n\n /*\n * Three refs on one node: the toolbar's arrow-key roving registration, a consumer-supplied `triggerRef`,\n * and DSAppPicker's own \u2014 the last is what its focus return targets after a scoped Escape, so dropping\n * `innerRef` here silently strands focus when the panel closes.\n *\n * No focus logic beyond that. Returning focus to this trigger is DSAppPicker's job and it does it, which\n * is only true while this part supplies no `onKeyDown` to it \u2014 see useAppPickerCTX.\n */\n const handleTriggerRefs = React.useCallback(\n (buttonRef: HTMLButtonElement) => {\n setRef(buttonRef);\n mergeRefs(triggerRef, innerRef)(buttonRef);\n },\n [setRef, triggerRef, innerRef],\n );\n\n /*\n * DSAppPicker's `onClick` does the opening AND records whether the activation came from the keyboard\n * (`e.detail === 0`), which is what lets it land focus on the selected app rather than the panel. It must\n * always run.\n *\n * `triggerOnClick` is the consumer's own click callback and runs alongside it. It does not suppress the\n * open: a consumer who needs to own the transition supplies `componentProps.isOpen`, which makes the\n * picker controlled and renders its internal flip inert.\n */\n const handleOnClickComposed = React.useCallback(\n (e: React.MouseEvent | React.KeyboardEvent) => {\n appPickerOnClick(e);\n triggerOnClick?.(e as React.MouseEvent<HTMLButtonElement>);\n },\n [appPickerOnClick, triggerOnClick],\n );\n\n return (\n <StyledButton\n id={id}\n onClick={handleOnClickComposed}\n onKeyDown={appPickerOnKeyDown}\n innerRef={handleTriggerRefs}\n aria-label={label}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_BUTTON}\n aria-haspopup={ariaHasPopup}\n // No `aria-expanded`, matching DSAppPicker's own trigger. This one opens a `role=\"dialog\"`, and in\n // the dialog pattern the open state is conveyed by the dialog's presence, not by an attribute on the\n // control. The sibling toolbar items DO carry it correctly \u2014 `ds-popup-menu` opens a `role=\"menu\"`\n // and `ds-search-toggle` expands an inline region, which are the patterns the attribute belongs to.\n // Item-level global attributes land here, AFTER the handlers above, so an `onKeyDown` or `onClick`\n // set directly on the toolbar entry replaces the one this trigger wired. That is the documented\n // item-level override and `WithControlledAppPicker` relies on it \u2014 but note what an `onKeyDown`\n // override costs now: it takes over `openAndFocusOnArrowKeys`, so the arrow keys stop opening the\n // picker unless the consumer opens it themselves.\n //\n // `id` is the one global attribute that cannot reach this spread: useAppPickerCTX reads it out by\n // name and AppPickerRenderer hands it to DSAppPicker, which owns every id in this widget and derives\n // the `id` above from it. Left in here it would take that key back and strand the dialog's\n // `aria-labelledby` \u2014 PUI-18985.\n {...getGlobalAttributes(otherProps)}\n // The part-level xstyled layer, which the contract advertises \u2014 this is the element that serves it.\n {...getXstyledProps(otherProps)}\n type=\"button\"\n // Exposes the dsGlobalheaderMenubarItemButton slot on this trigger. Drop either prop and the slot\n // goes silently inert \u2014 getPartProps returns {} without the lookup table and generates no\n // data-dimsum-slot.\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n // Explicit and empty: no render-time values worth handing to a function-form slot prop. Stated so\n // \"what arguments does this slot get?\" always has a visible answer at the call site.\n getOwnerPropsArguments={() => ({})}\n >\n <MenuPicker width={20.73} height={20.73} />\n </StyledButton>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoGjB;AAnGN,sBAA2B;AAC3B,8BAAqD;AACrD,uBAA0B;AAC1B,mBAAkB;AAClB,uBAA0C;AAC1C,oBAA6B;AAC7B,0BAA6B;AAetB,MAAM,0BAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,WAAW;AAAA,EACX,iBAAiB;AACnB,MAAuD;AACrD,QAAM,EAAE,gBAAgB,QAAQ,YAAY,OAAO,YAAY,8CAA8C,IAC3G,aAAAA,QAAM,WAAW,gCAAY;AAU/B,QAAM,oBAAoB,aAAAA,QAAM;AAAA,IAC9B,CAAC,cAAiC;AAChC,aAAO,SAAS;AAChB,sCAAU,YAAY,QAAQ,EAAE,SAAS;AAAA,IAC3C;AAAA,IACA,CAAC,QAAQ,YAAY,QAAQ;AAAA,EAC/B;AAWA,QAAM,wBAAwB,aAAAA,QAAM;AAAA,IAClC,CAAC,MAA8C;AAC7C,uBAAiB,CAAC;AAClB,uBAAiB,CAAwC;AAAA,IAC3D;AAAA,IACA,CAAC,kBAAkB,cAAc;AAAA,EACnC;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAS;AAAA,MACT,WAAW;AAAA,MACX,UAAU;AAAA,MACV,cAAY;AAAA,MACZ,eAAa,2CAA0B;AAAA,MACvC,iBAAe;AAAA,MAed,OAAG,6CAAoB,UAAU;AAAA,MAEjC,OAAG,yCAAgB,UAAU;AAAA,MAC9B,MAAK;AAAA,MAIL,eAAe;AAAA,MAGf,wBAAwB,OAAO,CAAC;AAAA,MAEhC,sDAAC,8BAAW,OAAO,OAAO,QAAQ,OAAO;AAAA;AAAA,EAC3C;AAEJ;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ AppPickerPropTypes: () => AppPickerPropTypes,
32
+ AppPickerPropTypesSchema: () => AppPickerPropTypesSchema
33
+ });
34
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
37
+ const AppPickerPropTypes = {
38
+ ...import_ds_props_helpers.globalAttributesPropTypes,
39
+ ...import_ds_props_helpers.xstyledPropTypes,
40
+ label: import_ds_props_helpers.PropTypes.string.description("Accessible name for the trigger button, and the toolbar label").isRequired,
41
+ componentProps: import_ds_props_helpers.PropTypes.object.description(
42
+ "The consumer-authored DSAppPicker configuration; forwarded per DSAppPicker own contract via getDSAppPickerContractProps"
43
+ ).isRequired,
44
+ getOwnerPropsAwareOfPropsPassedToGlobalHeader: import_ds_props_helpers.PropTypes.func.description(
45
+ "Returns the props passed to DSGlobalHeader, so getPartProps can look up this slot consumer-supplied props. Must come from DSGlobalHeader; the function-form hydrator is supplied per slot render site instead"
46
+ ).signature("(() => Partial<DSGlobalHeaderT.DefaultProps> )").isRequired,
47
+ setRef: import_ds_props_helpers.PropTypes.func.description("Registers the trigger node with the toolbar focus management for arrow-key navigation").signature("(( ref: HTMLElement ) => void )").isRequired
48
+ };
49
+ const AppPickerPropTypesSchema = AppPickerPropTypes;
50
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.ts", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSGlobalHeaderT } from '../../../../react-desc-prop-types.js';\n\n/*\n * Relocated here from DSGlobalHeaderT.AppPickerProps, per the convention every other part in the repo\n * follows. Consumed by useAppPickerCTX / AppPickerCTXRenderer.\n *\n * This namespace describes what DSGlobalHeader passes DOWN to its own out-of-the-box App Picker\n * wrapper. It is NOT the shape an application developer authors \u2014 that is\n * DSGlobalHeaderT.ToolbarAppPickerItem (the toolbar config entry) and, inside it,\n * DSGlobalHeaderT.AppPickerComponentProps. The wrapper is an opinionated pre-configuration that\n * offloads work from the app developer onto Dimsum, so it generates props the developer never sees\n * (`setRef`, `getOwnerPropsAwareOfPropsPassedToGlobalHeader`) and is not meant to know about unless they\n * drop to atomic composition and render DSAppPicker themselves.\n *\n * The three IoC layers an out-of-the-box item is meant to expose are all present here:\n * 1. item-level global attributes, forwarded onto the rendered trigger \u2014 except `id`, which\n * useAppPickerCTX reads out by name and AppPickerRenderer hands to DSAppPicker, because that is\n * the component that owns every id this widget renders (PUI-18985)\n * 2. the slot layer, via `getOwnerPropsAwareOfPropsPassedToGlobalHeader` (parent-owned slots \u2014 see the\n * no-slots note below)\n * 3. `componentProps`, the wrapped component's own contract\n *\n * No slots of its own: every styled element this part renders is declared under the PARENT's name and\n * GLOBAL_HEADER_SLOTS, and those slot values are a published data-dimsum-slot / data-testid surface \u2014\n * re-declaring them here would change them, which the QA stability rule forbids. So, as with\n * ds-data-table-filters' FilterPopover, this file carries no PropsForGlobalOnSlots and no\n * getPropsPerSlotPropTypes. Consumers reach these slots through DSGlobalHeader, where they already do.\n *\n * KNOWN GAP (shared by all four out-of-the-box parts, no decision pending on this file) \u2014 `XstyledProps`\n * is declared below and `xstyledPropTypes` is spread into the schema, but no part forwards xstyled props\n * to any element. Global attributes ARE forwarded, via getGlobalAttributes in TriggerDefaultComponent.\n * The declaration comes from the part-generator template and the FilterPopover precedent; making it true\n * needs a styled target per part, which PopupMenu's bare-<div> root does not currently have.\n */\nexport declare namespace AppPickerT {\n export interface RequiredProps {\n /** Accessible name for the trigger, and the toolbar item's label. */\n label: string;\n /** The consumer-authored configuration object. Forwarded to DSAppPicker by its own contract. */\n componentProps: DSGlobalHeaderT.AppPickerComponentProps;\n /*\n * The slot IoC layer, and the ONLY half of it that may be drilled down.\n *\n * `getPartProps` uses this as the lookup table: it indexes the returned object by the styled\n * element's `data-dimsum-slot` (falling back to `data-testid`) to find the consumer's slot prop.\n * That table can therefore only come from DSGlobalHeader, because only DSGlobalHeader holds the\n * props the consumer passed \u2014 hence the deliberately verbose name. It is also what gates slot\n * generation at all: `styledFunction` sets `didDefinedGetOwnerProps: !!getOwnerProps`, and\n * `getPartProps` short-circuits to `{}` without it.\n *\n * Its former companion `getOwnerPropsArguments` is deliberately NOT here. That one is the hydrator\n * for function-form slot props \u2014 `getPartProps` calls `elementProps(getOwnerPropsArguments())` and\n * uses it for nothing else \u2014 so it must be defined by whichever element is rendering the slot,\n * which is the only place that knows the render-time values worth passing. Bundling the two forced\n * every slot in the package to share one hydrator; see ds-chat-bubble's ChatBubbleArrow and\n * ds-fast-list's List for what per-site hydration is actually for.\n */\n getOwnerPropsAwareOfPropsPassedToGlobalHeader: () => Partial<DSGlobalHeaderT.DefaultProps>;\n /** Focus-management registration, supplied by useGlobalHeaderToolbar for arrow-key navigation. */\n setRef: (ref: HTMLElement) => void;\n }\n\n /*\n * Intentionally empty, and intentionally still declared: `never` is a statement, not an oversight \u2014\n * \"this part has no default props, do not expect them\". Keeping the member present preserves\n * at-a-glance parity with every other part's namespace and makes adding a default a one-line change.\n */\n export interface DefaultProps {}\n\n export interface OptionalProps {}\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n keyof RequiredProps | keyof DefaultProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n keyof RequiredProps | keyof DefaultProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const AppPickerPropTypes: DSPropTypesSchema<AppPickerT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n label: PropTypes.string.description('Accessible name for the trigger button, and the toolbar label').isRequired,\n componentProps: PropTypes.object.description(\n 'The consumer-authored DSAppPicker configuration; forwarded per DSAppPicker own contract via getDSAppPickerContractProps',\n ).isRequired,\n getOwnerPropsAwareOfPropsPassedToGlobalHeader: PropTypes.func\n .description(\n 'Returns the props passed to DSGlobalHeader, so getPartProps can look up this slot consumer-supplied props. Must come from DSGlobalHeader; the function-form hydrator is supplied per slot render site instead',\n )\n .signature('(() => Partial<DSGlobalHeaderT.DefaultProps> )').isRequired,\n setRef: PropTypes.func\n .description('Registers the trigger node with the toolbar focus management for arrow-key navigation')\n .signature('(( ref: HTMLElement ) => void )').isRequired,\n};\n\nexport const AppPickerPropTypesSchema = AppPickerPropTypes as unknown as ValidationMap<AppPickerT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAAuE;AAiGhE,MAAM,qBAA0D;AAAA,EACrE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO,kCAAU,OAAO,YAAY,+DAA+D,EAAE;AAAA,EACrG,gBAAgB,kCAAU,OAAO;AAAA,IAC/B;AAAA,EACF,EAAE;AAAA,EACF,+CAA+C,kCAAU,KACtD;AAAA,IACC;AAAA,EACF,EACC,UAAU,gDAAgD,EAAE;AAAA,EAC/D,QAAQ,kCAAU,KACf,YAAY,uFAAuF,EACnG,UAAU,iCAAiC,EAAE;AAClD;AAEO,MAAM,2BAA2B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useAppPickerCTX_exports = {};
30
+ __export(useAppPickerCTX_exports, {
31
+ useAppPickerCTX: () => useAppPickerCTX
32
+ });
33
+ module.exports = __toCommonJS(useAppPickerCTX_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_ds_app_picker = require("@elliemae/ds-app-picker");
36
+ var import_react = __toESM(require("react"));
37
+ const useAppPickerCTX = (config) => {
38
+ const { label, componentProps, getOwnerPropsAwareOfPropsPassedToGlobalHeader, setRef, id, ...otherProps } = config;
39
+ const { triggerRef, triggerOnClick } = componentProps;
40
+ const contractProps = import_react.default.useMemo(() => (0, import_ds_app_picker.getDSAppPickerContractProps)(componentProps), [componentProps]);
41
+ return import_react.default.useMemo(
42
+ () => ({
43
+ id,
44
+ label,
45
+ componentProps,
46
+ otherProps,
47
+ getOwnerPropsAwareOfPropsPassedToGlobalHeader,
48
+ setRef,
49
+ contractProps,
50
+ triggerRef,
51
+ triggerOnClick
52
+ }),
53
+ [
54
+ id,
55
+ label,
56
+ componentProps,
57
+ otherProps,
58
+ getOwnerPropsAwareOfPropsPassedToGlobalHeader,
59
+ setRef,
60
+ contractProps,
61
+ triggerRef,
62
+ triggerOnClick
63
+ ]
64
+ );
65
+ };
66
+ //# sourceMappingURL=useAppPickerCTX.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { getDSAppPickerContractProps } from '@elliemae/ds-app-picker';\nimport React from 'react';\nimport type { AppPickerT } from './react-desc-prop-types.js';\n\n/*\n * This part owns NO open/close state, and that is deliberate.\n *\n * DSAppPicker owns the whole flow: its trigger click toggles the panel, `openAndFocusOnArrowKeys` gives\n * it ArrowDown/ArrowUp, a scoped Escape closes it and returns focus to the trigger, and a click outside\n * closes it. Lifting `isOpen` into this part would make the picker CONTROLLED, which switches every one\n * of those off \u2014 they would then have to be reimplemented here, against a component that already has\n * them and is tested for them.\n *\n * Two knock-on effects, worth knowing before adding state back:\n * - there is no `aria-expanded` on this item's trigger, so no open state is needed to feed one. The\n * picker opens a `role=\"dialog\"`, and that pattern conveys open state by the dialog's presence. The\n * sibling items keep the attribute because a menu and a disclosure region are what it is for.\n * - supplying `onKeyDown` to DSAppPicker sets `closeOnEscape: !onKeyDown`, i.e. it switches OFF the\n * picker's Escape routing AND its focus return. That is why this part supplies none, and why it needs\n * no focus tracker of its own.\n *\n * A consumer can still drive it: `componentProps.isOpen` reaches DSAppPicker through the contract\n * passthrough and makes it controlled for them, which is the supported way to own the transition.\n */\nexport const useAppPickerCTX = (config: AppPickerT.Props) => {\n /*\n * Read by name: only what this part needs for its own behaviour. `otherProps` is the item-level global\n * attributes, which reach the trigger via getGlobalAttributes. Everything a consumer put in\n * `componentProps` reaches DSAppPicker through `contractProps` instead \u2014 do not cherry-pick from\n * componentProps here, that is what the contract filter is for.\n *\n * `id` is read out by name so it does NOT stay in `otherProps` (PUI-18985). It is a member of\n * GlobalAttributesT, so left in there it would be spread onto the trigger and take the key back from\n * DSAppPicker \u2014 which owns every id this widget puts in the DOM and derives them all from this one\n * value. Naming the App Picker is what the item-level `id` means here; the trigger's own id is\n * `getIdForAppPickerTrigger(id)`, exported by ds-app-picker for exactly this reason.\n */\n const { label, componentProps, getOwnerPropsAwareOfPropsPassedToGlobalHeader, setRef, id, ...otherProps } = config;\n const { triggerRef, triggerOnClick } = componentProps;\n\n // `componentProps` is declared as DSAppPicker's own props plus this part's `triggerOnClick`, so every\n // DSAppPicker prop a consumer puts there is part of the contract \u2014 including all nine slot props.\n // Deriving the forwardable set from DSAppPicker's own contract is what keeps the two from drifting, and\n // it strips the one key in that object that belongs to this part rather than to DSAppPicker:\n // `triggerOnClick`. (`setRef` is a sibling field of `componentProps`, not inside it, so it never\n // reaches the filter.)\n const contractProps = React.useMemo(() => getDSAppPickerContractProps(componentProps), [componentProps]);\n\n return React.useMemo(\n () => ({\n id,\n label,\n componentProps,\n otherProps,\n getOwnerPropsAwareOfPropsPassedToGlobalHeader,\n setRef,\n contractProps,\n triggerRef,\n triggerOnClick,\n }),\n [\n id,\n label,\n componentProps,\n otherProps,\n getOwnerPropsAwareOfPropsPassedToGlobalHeader,\n setRef,\n contractProps,\n triggerRef,\n triggerOnClick,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,2BAA4C;AAC5C,mBAAkB;AAuBX,MAAM,kBAAkB,CAAC,WAA6B;AAa3D,QAAM,EAAE,OAAO,gBAAgB,+CAA+C,QAAQ,IAAI,GAAG,WAAW,IAAI;AAC5G,QAAM,EAAE,YAAY,eAAe,IAAI;AAQvC,QAAM,gBAAgB,aAAAA,QAAM,QAAQ,UAAM,kDAA4B,cAAc,GAAG,CAAC,cAAc,CAAC;AAEvG,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": ["React"]
7
+ }