@fluentui/react-menu 9.0.0-alpha.77 → 9.0.0-alpha.80

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. package/CHANGELOG.json +116 -1
  2. package/CHANGELOG.md +38 -2
  3. package/Spec.md +138 -137
  4. package/dist/react-menu.d.ts +161 -136
  5. package/lib/components/Menu/Menu.d.ts +0 -1
  6. package/lib/components/Menu/Menu.js +0 -1
  7. package/lib/components/Menu/Menu.js.map +1 -1
  8. package/lib/components/Menu/Menu.types.d.ts +10 -14
  9. package/lib/components/Menu/Menu.types.js.map +1 -1
  10. package/lib/components/Menu/renderMenu.d.ts +0 -1
  11. package/lib/components/Menu/renderMenu.js +0 -1
  12. package/lib/components/Menu/renderMenu.js.map +1 -1
  13. package/lib/components/Menu/useMenu.d.ts +0 -2
  14. package/lib/components/Menu/useMenu.js +0 -2
  15. package/lib/components/Menu/useMenu.js.map +1 -1
  16. package/lib/components/MenuDivider/MenuDivider.d.ts +19 -3
  17. package/lib/components/MenuDivider/MenuDivider.js +0 -1
  18. package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
  19. package/lib/components/MenuDivider/MenuDivider.types.d.ts +2 -10
  20. package/lib/components/MenuDivider/MenuDivider.types.js.map +1 -1
  21. package/lib/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  22. package/lib/components/MenuGroup/MenuGroup.d.ts +19 -3
  23. package/lib/components/MenuGroup/MenuGroup.js +0 -1
  24. package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
  25. package/lib/components/MenuGroup/MenuGroup.types.d.ts +5 -12
  26. package/lib/components/MenuGroup/MenuGroup.types.js.map +1 -1
  27. package/lib/components/MenuGroupHeader/MenuGroupHeader.d.ts +19 -3
  28. package/lib/components/MenuGroupHeader/MenuGroupHeader.js +0 -1
  29. package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  30. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -10
  31. package/lib/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  32. package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  33. package/lib/components/MenuItem/MenuItem.d.ts +0 -1
  34. package/lib/components/MenuItem/MenuItem.js +0 -1
  35. package/lib/components/MenuItem/MenuItem.js.map +1 -1
  36. package/lib/components/MenuItem/MenuItem.types.d.ts +4 -6
  37. package/lib/components/MenuItem/MenuItem.types.js.map +1 -1
  38. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -1
  39. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +0 -1
  40. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  41. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +2 -10
  42. package/lib/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  43. package/lib/components/MenuItemRadio/MenuItemRadio.d.ts +1 -3
  44. package/lib/components/MenuItemRadio/MenuItemRadio.js +0 -1
  45. package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  46. package/lib/components/MenuItemRadio/MenuItemRadio.types.d.ts +2 -10
  47. package/lib/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  48. package/lib/components/MenuList/MenuList.d.ts +19 -3
  49. package/lib/components/MenuList/MenuList.js +0 -1
  50. package/lib/components/MenuList/MenuList.js.map +1 -1
  51. package/lib/components/MenuList/MenuList.types.d.ts +8 -10
  52. package/lib/components/MenuList/MenuList.types.js.map +1 -1
  53. package/lib/components/MenuPopover/MenuPopover.d.ts +19 -2
  54. package/lib/components/MenuPopover/MenuPopover.types.d.ts +3 -4
  55. package/lib/components/MenuPopover/MenuPopover.types.js.map +1 -1
  56. package/lib/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -1
  57. package/lib/components/MenuPopover/useMenuPopoverStyles.js +0 -1
  58. package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  59. package/lib/components/MenuTrigger/MenuTrigger.d.ts +0 -1
  60. package/lib/components/MenuTrigger/MenuTrigger.js +0 -1
  61. package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
  62. package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +10 -14
  63. package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  64. package/lib/components/MenuTrigger/renderMenuTrigger.d.ts +0 -1
  65. package/lib/components/MenuTrigger/renderMenuTrigger.js +0 -1
  66. package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  67. package/lib/components/MenuTrigger/useMenuTrigger.d.ts +0 -2
  68. package/lib/components/MenuTrigger/useMenuTrigger.js +0 -2
  69. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  70. package/lib/components/MenuTrigger/useTriggerElement.js +13 -14
  71. package/lib/components/MenuTrigger/useTriggerElement.js.map +1 -1
  72. package/lib/contexts/menuContext.d.ts +2 -2
  73. package/lib/contexts/menuContext.js.map +1 -1
  74. package/lib/contexts/menuGroupContext.d.ts +2 -2
  75. package/lib/contexts/menuGroupContext.js.map +1 -1
  76. package/lib/contexts/menuListContext.d.ts +2 -2
  77. package/lib/contexts/menuListContext.js.map +1 -1
  78. package/lib/selectable/types.d.ts +4 -4
  79. package/lib/selectable/types.js.map +1 -1
  80. package/lib-amd/components/Menu/Menu.d.ts +0 -1
  81. package/lib-amd/components/Menu/Menu.js +0 -1
  82. package/lib-amd/components/Menu/Menu.js.map +1 -1
  83. package/lib-amd/components/Menu/Menu.types.d.ts +10 -14
  84. package/lib-amd/components/Menu/Menu.types.js.map +1 -1
  85. package/lib-amd/components/Menu/renderMenu.d.ts +0 -1
  86. package/lib-amd/components/Menu/renderMenu.js +0 -1
  87. package/lib-amd/components/Menu/renderMenu.js.map +1 -1
  88. package/lib-amd/components/Menu/useMenu.d.ts +0 -2
  89. package/lib-amd/components/Menu/useMenu.js +0 -2
  90. package/lib-amd/components/Menu/useMenu.js.map +1 -1
  91. package/lib-amd/components/MenuDivider/MenuDivider.d.ts +19 -3
  92. package/lib-amd/components/MenuDivider/MenuDivider.js +0 -1
  93. package/lib-amd/components/MenuDivider/MenuDivider.js.map +1 -1
  94. package/lib-amd/components/MenuDivider/MenuDivider.types.d.ts +2 -10
  95. package/lib-amd/components/MenuDivider/MenuDivider.types.js.map +1 -1
  96. package/lib-amd/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  97. package/lib-amd/components/MenuGroup/MenuGroup.d.ts +19 -3
  98. package/lib-amd/components/MenuGroup/MenuGroup.js +0 -1
  99. package/lib-amd/components/MenuGroup/MenuGroup.js.map +1 -1
  100. package/lib-amd/components/MenuGroup/MenuGroup.types.d.ts +5 -12
  101. package/lib-amd/components/MenuGroup/MenuGroup.types.js.map +1 -1
  102. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.d.ts +19 -3
  103. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.js +0 -1
  104. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  105. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -10
  106. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
  107. package/lib-amd/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  108. package/lib-amd/components/MenuItem/MenuItem.d.ts +0 -1
  109. package/lib-amd/components/MenuItem/MenuItem.js +0 -1
  110. package/lib-amd/components/MenuItem/MenuItem.js.map +1 -1
  111. package/lib-amd/components/MenuItem/MenuItem.types.d.ts +4 -6
  112. package/lib-amd/components/MenuItem/MenuItem.types.js.map +1 -1
  113. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -1
  114. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.js +0 -1
  115. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  116. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +2 -10
  117. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
  118. package/lib-amd/components/MenuItemRadio/MenuItemRadio.d.ts +1 -3
  119. package/lib-amd/components/MenuItemRadio/MenuItemRadio.js +0 -1
  120. package/lib-amd/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  121. package/lib-amd/components/MenuItemRadio/MenuItemRadio.types.d.ts +2 -10
  122. package/lib-amd/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
  123. package/lib-amd/components/MenuList/MenuList.d.ts +19 -3
  124. package/lib-amd/components/MenuList/MenuList.js +0 -1
  125. package/lib-amd/components/MenuList/MenuList.js.map +1 -1
  126. package/lib-amd/components/MenuList/MenuList.types.d.ts +8 -10
  127. package/lib-amd/components/MenuList/MenuList.types.js.map +1 -1
  128. package/lib-amd/components/MenuPopover/MenuPopover.d.ts +19 -2
  129. package/lib-amd/components/MenuPopover/MenuPopover.types.d.ts +3 -4
  130. package/lib-amd/components/MenuPopover/MenuPopover.types.js.map +1 -1
  131. package/lib-amd/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -1
  132. package/lib-amd/components/MenuPopover/useMenuPopoverStyles.js +0 -1
  133. package/lib-amd/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  134. package/lib-amd/components/MenuTrigger/MenuTrigger.d.ts +0 -1
  135. package/lib-amd/components/MenuTrigger/MenuTrigger.js +0 -1
  136. package/lib-amd/components/MenuTrigger/MenuTrigger.js.map +1 -1
  137. package/lib-amd/components/MenuTrigger/MenuTrigger.types.d.ts +10 -14
  138. package/lib-amd/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  139. package/lib-amd/components/MenuTrigger/renderMenuTrigger.d.ts +0 -1
  140. package/lib-amd/components/MenuTrigger/renderMenuTrigger.js +0 -1
  141. package/lib-amd/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  142. package/lib-amd/components/MenuTrigger/useMenuTrigger.d.ts +0 -2
  143. package/lib-amd/components/MenuTrigger/useMenuTrigger.js +0 -2
  144. package/lib-amd/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  145. package/lib-amd/components/MenuTrigger/useTriggerElement.js +10 -11
  146. package/lib-amd/components/MenuTrigger/useTriggerElement.js.map +1 -1
  147. package/lib-amd/contexts/menuContext.d.ts +2 -2
  148. package/lib-amd/contexts/menuContext.js.map +1 -1
  149. package/lib-amd/contexts/menuGroupContext.d.ts +2 -2
  150. package/lib-amd/contexts/menuGroupContext.js.map +1 -1
  151. package/lib-amd/contexts/menuListContext.d.ts +2 -2
  152. package/lib-amd/contexts/menuListContext.js.map +1 -1
  153. package/lib-amd/selectable/types.d.ts +4 -4
  154. package/lib-amd/selectable/types.js.map +1 -1
  155. package/lib-commonjs/components/Menu/Menu.d.ts +0 -1
  156. package/lib-commonjs/components/Menu/Menu.js +0 -1
  157. package/lib-commonjs/components/Menu/Menu.js.map +1 -1
  158. package/lib-commonjs/components/Menu/Menu.types.d.ts +10 -14
  159. package/lib-commonjs/components/Menu/renderMenu.d.ts +0 -1
  160. package/lib-commonjs/components/Menu/renderMenu.js +0 -1
  161. package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
  162. package/lib-commonjs/components/Menu/useMenu.d.ts +0 -2
  163. package/lib-commonjs/components/Menu/useMenu.js +0 -2
  164. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  165. package/lib-commonjs/components/MenuDivider/MenuDivider.d.ts +19 -3
  166. package/lib-commonjs/components/MenuDivider/MenuDivider.js +0 -1
  167. package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
  168. package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +2 -10
  169. package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.d.ts +1 -1
  170. package/lib-commonjs/components/MenuGroup/MenuGroup.d.ts +19 -3
  171. package/lib-commonjs/components/MenuGroup/MenuGroup.js +0 -1
  172. package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
  173. package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +5 -12
  174. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.d.ts +19 -3
  175. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +0 -1
  176. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
  177. package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -10
  178. package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.d.ts +1 -1
  179. package/lib-commonjs/components/MenuItem/MenuItem.d.ts +0 -1
  180. package/lib-commonjs/components/MenuItem/MenuItem.js +0 -1
  181. package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
  182. package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +4 -6
  183. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.d.ts +0 -1
  184. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +0 -1
  185. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
  186. package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.d.ts +2 -10
  187. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.d.ts +1 -3
  188. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +0 -1
  189. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
  190. package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.d.ts +2 -10
  191. package/lib-commonjs/components/MenuList/MenuList.d.ts +19 -3
  192. package/lib-commonjs/components/MenuList/MenuList.js +0 -1
  193. package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
  194. package/lib-commonjs/components/MenuList/MenuList.types.d.ts +8 -10
  195. package/lib-commonjs/components/MenuPopover/MenuPopover.d.ts +19 -2
  196. package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +3 -4
  197. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.d.ts +0 -1
  198. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +0 -1
  199. package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
  200. package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +0 -1
  201. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +0 -1
  202. package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
  203. package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +10 -14
  204. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.d.ts +0 -1
  205. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +0 -1
  206. package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
  207. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +0 -2
  208. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +0 -2
  209. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  210. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js +12 -13
  211. package/lib-commonjs/components/MenuTrigger/useTriggerElement.js.map +1 -1
  212. package/lib-commonjs/contexts/menuContext.d.ts +2 -2
  213. package/lib-commonjs/contexts/menuContext.js.map +1 -1
  214. package/lib-commonjs/contexts/menuGroupContext.d.ts +2 -2
  215. package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
  216. package/lib-commonjs/contexts/menuListContext.d.ts +2 -2
  217. package/lib-commonjs/contexts/menuListContext.js.map +1 -1
  218. package/lib-commonjs/selectable/types.d.ts +4 -4
  219. package/package.json +13 -13
@@ -1,6 +1,23 @@
1
1
  import * as React from 'react';
2
- import type { MenuPopoverProps } from './MenuPopover.types';
3
2
  /**
4
3
  * Popover intended to wrap `MenuList` and adds styling and interaction support specific to menus
5
4
  */
6
- export declare const MenuPopover: React.ForwardRefExoticComponent<MenuPopoverProps & React.RefAttributes<HTMLElement>>;
5
+ export declare const MenuPopover: React.ForwardRefExoticComponent<Pick<{
6
+ root?: import("@fluentui/react-utilities").ShorthandProps<{
7
+ as?: "div" | undefined;
8
+ } & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
9
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
10
+ } & {
11
+ children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | import("@fluentui/react-utilities").ShorthandRenderFunction<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
12
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
13
+ }> | null | undefined;
14
+ }>;
15
+ }, never> & Pick<{
16
+ as?: "div" | undefined;
17
+ } & Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
18
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
19
+ } & {
20
+ children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | import("@fluentui/react-utilities").ShorthandRenderFunction<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
21
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
22
+ }> | null | undefined;
23
+ }, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "as"> & React.RefAttributes<HTMLElement>>;
@@ -5,15 +5,14 @@ export declare type MenuPopoverSlots = {
5
5
  /**
6
6
  * MenuPopover Props
7
7
  */
8
- export interface MenuPopoverProps extends ComponentProps<MenuPopoverSlots> {
9
- }
8
+ export declare type MenuPopoverProps = ComponentProps<MenuPopoverSlots>;
10
9
  /**
11
10
  * State used in rendering MenuPopover
12
11
  */
13
- export interface MenuPopoverState extends ComponentState<MenuPopoverSlots> {
12
+ export declare type MenuPopoverState = ComponentState<MenuPopoverSlots> & {
14
13
  /**
15
14
  * Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order
16
15
  * This option is disregarded for submenus
17
16
  */
18
17
  inline: boolean;
19
- }
18
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"MenuPopover.types.js","sourceRoot":"../src/","sources":["components/MenuPopover/MenuPopover.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';\n\nexport type MenuPopoverSlots = {\n root: IntrinsicShorthandProps<'div'>;\n};\n\n/**\n * MenuPopover Props\n */\nexport interface MenuPopoverProps extends ComponentProps<MenuPopoverSlots> {}\n\n/**\n * State used in rendering MenuPopover\n */\nexport interface MenuPopoverState extends ComponentState<MenuPopoverSlots> {\n /**\n * Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order\n * This option is disregarded for submenus\n */\n inline: boolean;\n}\n"]}
1
+ {"version":3,"file":"MenuPopover.types.js","sourceRoot":"../src/","sources":["components/MenuPopover/MenuPopover.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';\n\nexport type MenuPopoverSlots = {\n root: IntrinsicShorthandProps<'div'>;\n};\n\n/**\n * MenuPopover Props\n */\nexport type MenuPopoverProps = ComponentProps<MenuPopoverSlots>;\n\n/**\n * State used in rendering MenuPopover\n */\nexport type MenuPopoverState = ComponentState<MenuPopoverSlots> & {\n /**\n * Root menus are rendered out of DOM order on `document.body`, use this to render the menu in DOM order\n * This option is disregarded for submenus\n */\n inline: boolean;\n};\n"]}
@@ -1,6 +1,5 @@
1
1
  import type { MenuPopoverState } from './MenuPopover.types';
2
2
  /**
3
3
  * Apply styling to the Menu slots based on the state
4
- * {@docCategory Menu }
5
4
  */
6
5
  export declare const useMenuPopoverStyles: (state: MenuPopoverState) => MenuPopoverState;
@@ -16,7 +16,6 @@ define(["require", "exports", "@fluentui/react-make-styles"], function (require,
16
16
  });
17
17
  /**
18
18
  * Apply styling to the Menu slots based on the state
19
- * {@docCategory Menu }
20
19
  */
21
20
  var useMenuPopoverStyles = function (state) {
22
21
  var styles = useStyles();
@@ -1 +1 @@
1
- {"version":3,"file":"useMenuPopoverStyles.js","sourceRoot":"../src/","sources":["components/MenuPopover/useMenuPopoverStyles.ts"],"names":[],"mappings":";;;;IAGA,IAAM,SAAS,GAAG,8BAAU,CAAC;QAC3B,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YACd,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;YAC7D,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,aAAa;YACpB,SAAS,EAAE,KAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAU;YAC3C,UAAU,EAAE,KAAK;YACjB,aAAa,EAAE,KAAK;YACpB,MAAM,EAAE,eAAa,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAmB;SACnE,CAAC,EATa,CASb;KACH,CAAC,CAAC;IAEH;;;OAGG;IACI,IAAM,oBAAoB,GAAG,UAAC,KAAuB;QAC1D,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,gCAAY,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACvE,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAJW,QAAA,oBAAoB,wBAI/B","sourcesContent":["import { mergeClasses, makeStyles } from '@fluentui/react-make-styles';\nimport type { MenuPopoverState } from './MenuPopover.types';\n\nconst useStyles = makeStyles({\n root: theme => ({\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n minWidth: '128px',\n maxWidth: '300px',\n width: 'max-content',\n boxShadow: `${theme.alias.shadow.shadow16}`,\n paddingTop: '4px',\n paddingBottom: '4px',\n border: `1px solid ${theme.alias.color.neutral.transparentStroke}`,\n }),\n});\n\n/**\n * Apply styling to the Menu slots based on the state\n * {@docCategory Menu }\n */\nexport const useMenuPopoverStyles = (state: MenuPopoverState): MenuPopoverState => {\n const styles = useStyles();\n state.root.className = mergeClasses(styles.root, state.root.className);\n return state;\n};\n"]}
1
+ {"version":3,"file":"useMenuPopoverStyles.js","sourceRoot":"../src/","sources":["components/MenuPopover/useMenuPopoverStyles.ts"],"names":[],"mappings":";;;;IAGA,IAAM,SAAS,GAAG,8BAAU,CAAC;QAC3B,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YACd,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;YAC7D,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,aAAa;YACpB,SAAS,EAAE,KAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAU;YAC3C,UAAU,EAAE,KAAK;YACjB,aAAa,EAAE,KAAK;YACpB,MAAM,EAAE,eAAa,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAmB;SACnE,CAAC,EATa,CASb;KACH,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,oBAAoB,GAAG,UAAC,KAAuB;QAC1D,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,gCAAY,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACvE,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAJW,QAAA,oBAAoB,wBAI/B","sourcesContent":["import { mergeClasses, makeStyles } from '@fluentui/react-make-styles';\nimport type { MenuPopoverState } from './MenuPopover.types';\n\nconst useStyles = makeStyles({\n root: theme => ({\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n minWidth: '128px',\n maxWidth: '300px',\n width: 'max-content',\n boxShadow: `${theme.alias.shadow.shadow16}`,\n paddingTop: '4px',\n paddingBottom: '4px',\n border: `1px solid ${theme.alias.color.neutral.transparentStroke}`,\n }),\n});\n\n/**\n * Apply styling to the Menu slots based on the state\n */\nexport const useMenuPopoverStyles = (state: MenuPopoverState): MenuPopoverState => {\n const styles = useStyles();\n state.root.className = mergeClasses(styles.root, state.root.className);\n return state;\n};\n"]}
@@ -3,6 +3,5 @@ import type { MenuTriggerProps } from './MenuTrigger.types';
3
3
  /**
4
4
  * Wraps a trigger element as an only child
5
5
  * and adds the necessary event handling to open a popup menu
6
- * {@docCategory MenuTrigger }
7
6
  */
8
7
  export declare const MenuTrigger: React.FC<MenuTriggerProps>;
@@ -5,7 +5,6 @@ define(["require", "exports", "./useMenuTrigger", "./renderMenuTrigger"], functi
5
5
  /**
6
6
  * Wraps a trigger element as an only child
7
7
  * and adds the necessary event handling to open a popup menu
8
- * {@docCategory MenuTrigger }
9
8
  */
10
9
  var MenuTrigger = function (props) {
11
10
  var state = useMenuTrigger_1.useMenuTrigger(props);
@@ -1 +1 @@
1
- {"version":3,"file":"MenuTrigger.js","sourceRoot":"../src/","sources":["components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":";;;;IAKA;;;;OAIG;IACI,IAAM,WAAW,GAA+B,UAAA,KAAK;QAC1D,IAAM,KAAK,GAAG,+BAAc,CAAC,KAAK,CAAC,CAAC;QAEpC,OAAO,qCAAiB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC,CAAC;IAJW,QAAA,WAAW,eAItB;IAEF,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport { useMenuTrigger } from './useMenuTrigger';\nimport { renderMenuTrigger } from './renderMenuTrigger';\nimport type { MenuTriggerProps } from './MenuTrigger.types';\n\n/**\n * Wraps a trigger element as an only child\n * and adds the necessary event handling to open a popup menu\n * {@docCategory MenuTrigger }\n */\nexport const MenuTrigger: React.FC<MenuTriggerProps> = props => {\n const state = useMenuTrigger(props);\n\n return renderMenuTrigger(state);\n};\n\nMenuTrigger.displayName = 'MenuTrigger';\n"]}
1
+ {"version":3,"file":"MenuTrigger.js","sourceRoot":"../src/","sources":["components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":";;;;IAKA;;;OAGG;IACI,IAAM,WAAW,GAA+B,UAAA,KAAK;QAC1D,IAAM,KAAK,GAAG,+BAAc,CAAC,KAAK,CAAC,CAAC;QAEpC,OAAO,qCAAiB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC,CAAC;IAJW,QAAA,WAAW,eAItB;IAEF,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport { useMenuTrigger } from './useMenuTrigger';\nimport { renderMenuTrigger } from './renderMenuTrigger';\nimport type { MenuTriggerProps } from './MenuTrigger.types';\n\n/**\n * Wraps a trigger element as an only child\n * and adds the necessary event handling to open a popup menu\n */\nexport const MenuTrigger: React.FC<MenuTriggerProps> = props => {\n const state = useMenuTrigger(props);\n\n return renderMenuTrigger(state);\n};\n\nMenuTrigger.displayName = 'MenuTrigger';\n"]}
@@ -1,20 +1,16 @@
1
1
  import * as React from 'react';
2
- /**
3
- * {@docCategory MenuTrigger }
4
- */
5
- export interface MenuTriggerProps {
2
+ export declare type MenuTriggerProps = {
6
3
  /**
7
- * Explicitly require single child
4
+ * Explicitly require single child or render function
8
5
  */
9
- children: React.ReactElement;
10
- }
6
+ children: (React.ReactElement & {
7
+ ref?: React.Ref<unknown>;
8
+ }) | ((props: MenuTriggerChildProps) => React.ReactNode);
9
+ };
11
10
  /**
12
11
  * Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu
13
12
  */
14
- export interface MenuTriggerChildProps extends Required<Pick<React.HTMLAttributes<HTMLElement>, 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onContextMenu' | 'onKeyDown' | 'aria-haspopup' | 'aria-expanded' | 'id'>> {
15
- }
16
- /**
17
- * {@docCategory MenuTrigger }
18
- */
19
- export interface MenuTriggerState extends MenuTriggerProps {
20
- }
13
+ export declare type MenuTriggerChildProps = Required<Pick<React.HTMLAttributes<HTMLElement>, 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onContextMenu' | 'onKeyDown' | 'aria-haspopup' | 'aria-expanded' | 'id'>> & {
14
+ ref?: React.Ref<never>;
15
+ };
16
+ export declare type MenuTriggerState = MenuTriggerProps;
@@ -1 +1 @@
1
- {"version":3,"file":"MenuTrigger.types.js","sourceRoot":"../src/","sources":["components/MenuTrigger/MenuTrigger.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\n/**\n * {@docCategory MenuTrigger }\n */\nexport interface MenuTriggerProps {\n /**\n * Explicitly require single child\n */\n children: React.ReactElement;\n}\n\n/**\n * Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu\n */\nexport interface MenuTriggerChildProps\n extends Required<\n Pick<\n React.HTMLAttributes<HTMLElement>,\n | 'onClick'\n | 'onMouseEnter'\n | 'onMouseLeave'\n | 'onContextMenu'\n | 'onKeyDown'\n | 'aria-haspopup'\n | 'aria-expanded'\n | 'id'\n >\n > {}\n\n/**\n * {@docCategory MenuTrigger }\n */\nexport interface MenuTriggerState extends MenuTriggerProps {}\n"]}
1
+ {"version":3,"file":"MenuTrigger.types.js","sourceRoot":"../src/","sources":["components/MenuTrigger/MenuTrigger.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\nexport type MenuTriggerProps = {\n /**\n * Explicitly require single child or render function\n */\n children: (React.ReactElement & { ref?: React.Ref<unknown> }) | ((props: MenuTriggerChildProps) => React.ReactNode);\n};\n\n/**\n * Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu\n */\nexport type MenuTriggerChildProps = Required<\n Pick<\n React.HTMLAttributes<HTMLElement>,\n | 'onClick'\n | 'onMouseEnter'\n | 'onMouseLeave'\n | 'onContextMenu'\n | 'onKeyDown'\n | 'aria-haspopup'\n | 'aria-expanded'\n | 'id'\n >\n> & {\n ref?: React.Ref<never>;\n};\n\nexport type MenuTriggerState = MenuTriggerProps;\n"]}
@@ -3,6 +3,5 @@ import type { MenuTriggerState } from './MenuTrigger.types';
3
3
  * Render the final JSX of MenuTrigger
4
4
  *
5
5
  * Only renders children
6
- * {@docCategory MenuTrigger }
7
6
  */
8
7
  export declare const renderMenuTrigger: (state: MenuTriggerState) => JSX.Element;
@@ -6,7 +6,6 @@ define(["require", "exports", "react", "../../contexts/menuTriggerContext"], fun
6
6
  * Render the final JSX of MenuTrigger
7
7
  *
8
8
  * Only renders children
9
- * {@docCategory MenuTrigger }
10
9
  */
11
10
  var renderMenuTrigger = function (state) {
12
11
  return React.createElement(menuTriggerContext_1.MenuTriggerContextProvider, { value: true }, state.children);
@@ -1 +1 @@
1
- {"version":3,"file":"renderMenuTrigger.js","sourceRoot":"../src/","sources":["components/MenuTrigger/renderMenuTrigger.tsx"],"names":[],"mappings":";;;;IAIA;;;;;OAKG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAuB;QACvD,OAAO,oBAAC,+CAA0B,IAAC,KAAK,EAAE,IAAI,IAAG,KAAK,CAAC,QAAQ,CAA8B,CAAC;IAChG,CAAC,CAAC;IAFW,QAAA,iBAAiB,qBAE5B","sourcesContent":["import * as React from 'react';\nimport { MenuTriggerContextProvider } from '../../contexts/menuTriggerContext';\nimport type { MenuTriggerState } from './MenuTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n * {@docCategory MenuTrigger }\n */\nexport const renderMenuTrigger = (state: MenuTriggerState) => {\n return <MenuTriggerContextProvider value={true}>{state.children}</MenuTriggerContextProvider>;\n};\n"]}
1
+ {"version":3,"file":"renderMenuTrigger.js","sourceRoot":"../src/","sources":["components/MenuTrigger/renderMenuTrigger.tsx"],"names":[],"mappings":";;;;IAIA;;;;OAIG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAuB;QACvD,OAAO,oBAAC,+CAA0B,IAAC,KAAK,EAAE,IAAI,IAAG,KAAK,CAAC,QAAQ,CAA8B,CAAC;IAChG,CAAC,CAAC;IAFW,QAAA,iBAAiB,qBAE5B","sourcesContent":["import * as React from 'react';\nimport { MenuTriggerContextProvider } from '../../contexts/menuTriggerContext';\nimport type { MenuTriggerState } from './MenuTrigger.types';\n\n/**\n * Render the final JSX of MenuTrigger\n *\n * Only renders children\n */\nexport const renderMenuTrigger = (state: MenuTriggerState) => {\n return <MenuTriggerContextProvider value={true}>{state.children}</MenuTriggerContextProvider>;\n};\n"]}
@@ -4,7 +4,5 @@ import type { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';
4
4
  * Clones the only child component and adds necessary event handling behaviours to open a popup menu
5
5
  *
6
6
  * @param props - props from this instance of MenuTrigger
7
- *
8
- * {@docCategory MenuTrigger }
9
7
  */
10
8
  export declare const useMenuTrigger: (props: MenuTriggerProps) => MenuTriggerState;
@@ -7,8 +7,6 @@ define(["require", "exports", "tslib", "./useTriggerElement"], function (require
7
7
  * Clones the only child component and adds necessary event handling behaviours to open a popup menu
8
8
  *
9
9
  * @param props - props from this instance of MenuTrigger
10
- *
11
- * {@docCategory MenuTrigger }
12
10
  */
13
11
  var useMenuTrigger = function (props) {
14
12
  var state = tslib_1.__assign({}, props);
@@ -1 +1 @@
1
- {"version":3,"file":"useMenuTrigger.js","sourceRoot":"../src/","sources":["components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":";;;;IAGA;;;;;;;OAOG;IACI,IAAM,cAAc,GAAG,UAAC,KAAuB;QACpD,IAAM,KAAK,wBAAQ,KAAK,CAAE,CAAC;QAE3B,gDAAgD;QAChD,OAAO,qCAAiB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC,CAAC;IALW,QAAA,cAAc,kBAKzB","sourcesContent":["import { useTriggerElement } from './useTriggerElement';\nimport type { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';\n\n/**\n * Create the state required to render MenuTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup menu\n *\n * @param props - props from this instance of MenuTrigger\n *\n * {@docCategory MenuTrigger }\n */\nexport const useMenuTrigger = (props: MenuTriggerProps): MenuTriggerState => {\n const state = { ...props };\n\n // TODO just move the contents of this hook here\n return useTriggerElement(state);\n};\n"]}
1
+ {"version":3,"file":"useMenuTrigger.js","sourceRoot":"../src/","sources":["components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":";;;;IAGA;;;;;OAKG;IACI,IAAM,cAAc,GAAG,UAAC,KAAuB;QACpD,IAAM,KAAK,wBAAQ,KAAK,CAAE,CAAC;QAE3B,gDAAgD;QAChD,OAAO,qCAAiB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC,CAAC;IALW,QAAA,cAAc,kBAKzB","sourcesContent":["import { useTriggerElement } from './useTriggerElement';\nimport type { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';\n\n/**\n * Create the state required to render MenuTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup menu\n *\n * @param props - props from this instance of MenuTrigger\n */\nexport const useMenuTrigger = (props: MenuTriggerProps): MenuTriggerState => {\n const state = { ...props };\n\n // TODO just move the contents of this hook here\n return useTriggerElement(state);\n};\n"]}
@@ -7,7 +7,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/keyboard-keys", "@flu
7
7
  * Adds the necessary props to the trigger element
8
8
  */
9
9
  var useTriggerElement = function (state) {
10
- var _a;
10
+ var _a, _b;
11
11
  var triggerRef = menuContext_1.useMenuContext(function (context) { return context.triggerRef; });
12
12
  var menuPopoverRef = menuContext_1.useMenuContext(function (context) { return context.menuPopoverRef; });
13
13
  var setOpen = menuContext_1.useMenuContext(function (context) { return context.setOpen; });
@@ -25,15 +25,14 @@ define(["require", "exports", "tslib", "react", "@fluentui/keyboard-keys", "@flu
25
25
  var hasMouseMoved = React.useRef(false);
26
26
  var dir = react_shared_contexts_1.useFluent().dir;
27
27
  var OpenArrowKey = dir === 'ltr' ? keyboard_keys_1.ArrowRight : keyboard_keys_1.ArrowLeft;
28
- // TODO also need to warn on React.Fragment usage
29
- var child = React.Children.only(state.children);
28
+ var child = React.isValidElement(state.children) ? react_utilities_1.onlyChild(state.children) : undefined;
30
29
  var onContextMenu = react_utilities_1.useEventCallback(function (e) {
31
30
  var _a, _b;
32
31
  if (openOnContext) {
33
32
  e.preventDefault();
34
33
  setOpen(e, { open: true, keyboard: false });
35
34
  }
36
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onContextMenu) === null || _b === void 0 ? void 0 : _b.call(_a, e);
35
+ (_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onContextMenu) === null || _b === void 0 ? void 0 : _b.call(_a, e);
37
36
  });
38
37
  var onClick = react_utilities_1.useEventCallback(function (e) {
39
38
  var _a, _b;
@@ -41,7 +40,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/keyboard-keys", "@flu
41
40
  setOpen(e, { open: !open, keyboard: openedWithKeyboardRef.current });
42
41
  openedWithKeyboardRef.current = false;
43
42
  }
44
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
43
+ (_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
45
44
  });
46
45
  var onKeyDown = react_utilities_1.useEventCallback(function (e) {
47
46
  var _a, _b, _c;
@@ -64,14 +63,14 @@ define(["require", "exports", "tslib", "react", "@fluentui/keyboard-keys", "@flu
64
63
  if (open && key === keyboard_keys_1.ArrowDown && !isSubmenu) {
65
64
  focusFirst();
66
65
  }
67
- (_c = (_b = child.props) === null || _b === void 0 ? void 0 : _b.onKeyDown) === null || _c === void 0 ? void 0 : _c.call(_b, e);
66
+ (_c = (_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.onKeyDown) === null || _c === void 0 ? void 0 : _c.call(_b, e);
68
67
  });
69
68
  var onMouseEnter = react_utilities_1.useEventCallback(function (e) {
70
69
  var _a, _b;
71
70
  if (openOnHover && hasMouseMoved.current) {
72
71
  setOpen(e, { open: true, keyboard: false });
73
72
  }
74
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseEnter) === null || _b === void 0 ? void 0 : _b.call(_a, e);
73
+ (_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onMouseEnter) === null || _b === void 0 ? void 0 : _b.call(_a, e);
75
74
  });
76
75
  // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience
77
76
  // First time open the mouse using mousemove and then continue with mouseenter
@@ -87,10 +86,10 @@ define(["require", "exports", "tslib", "react", "@fluentui/keyboard-keys", "@flu
87
86
  if (openOnHover) {
88
87
  setOpen(e, { open: false, keyboard: false });
89
88
  }
90
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseLeave) === null || _b === void 0 ? void 0 : _b.call(_a, e);
89
+ (_b = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onMouseLeave) === null || _b === void 0 ? void 0 : _b.call(_a, e);
91
90
  });
92
- var disabled = (_a = child.props) === null || _a === void 0 ? void 0 : _a.disabled;
93
- var triggerProps = tslib_1.__assign({ 'aria-haspopup': true, 'aria-expanded': open, id: child.props.id || triggerId }, (!disabled
91
+ var disabled = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.disabled;
92
+ var triggerProps = tslib_1.__assign({ 'aria-haspopup': true, 'aria-expanded': open, id: ((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.id) || triggerId }, (!disabled
94
93
  ? {
95
94
  onClick: onClick,
96
95
  onMouseEnter: onMouseEnter,
@@ -108,7 +107,7 @@ define(["require", "exports", "tslib", "react", "@fluentui/keyboard-keys", "@flu
108
107
  onKeyDown: noop,
109
108
  onMouseMove: noop,
110
109
  }));
111
- state.children = React.cloneElement(child, tslib_1.__assign(tslib_1.__assign({}, triggerProps), { ref: react_utilities_1.useMergedRefs(child.ref, triggerRef) }));
110
+ state.children = react_utilities_1.applyTriggerPropsToChildren(state.children, tslib_1.__assign(tslib_1.__assign({}, triggerProps), { ref: react_utilities_1.useMergedRefs((typeof state.children !== 'function' && state.children.ref) || null, triggerRef) }));
112
111
  return state;
113
112
  };
114
113
  exports.useTriggerElement = useTriggerElement;
@@ -1 +1 @@
1
- {"version":3,"file":"useTriggerElement.js","sourceRoot":"../src/","sources":["components/MenuTrigger/useTriggerElement.ts"],"names":[],"mappings":";;;;IASA,IAAM,IAAI,GAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;IAExB;;OAEG;IACI,IAAM,iBAA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AG,IAAI,CAAC;aAC9B;QACH,CAAC,CAAC,CAAC;QAEH,IAAM,YAAY,GAAG,kCAAgB,CAAC,UAAC,CAAgC;;YACrE,IAAI,WAAW,EAAE;gBACf,OAAO,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;aAC9C;YAED,YAAA,KAAK,CAAC,KAAK,0CAAE,YAAY,mDAAG,CAAC,EAAE;QACjC,CAAC,CAAC,CAAC;QAEH,IAAM,QAAQ,SAAG,KAAK,CAAC,KAAK,0CAAE,QAAQ,CAAC;QACvC,IAAM,YAAY,sBAChB,eAAe,EAAE,IAAI,EACrB,eAAe,EAAE,IAAI,EACrB,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,IAAI,SAAS,IAE5B,CAAC,CAAC,QAAQ;YACX,CAAC,CAAC;gBACE,OAAO,SAAA;gBACP,YAAY,cAAA;gBACZ,YAAY,cAAA;gBACZ,aAAa,eAAA;gBACb,SAAS,WAAA;gBACT,WAAW,aAAA;aACZ;YACH,CAAC,CAAC,qGAAqG;gBACrG;oBACE,OAAO,EAAE,IAAI;oBACb,YAAY,EAAE,IAAI;oBAClB,YAAY,EAAE,IAAI;oBAClB,aAAa,EAAE,IAAI;oBACnB,SAAS,EAAE,IAAI;oBACf,WAAW,EAAE,IAAI;iBAClB,CAAC,CACP,CAAC;QAEF,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,wCACpC,YAAY,KACf,GAAG,EAAE,+BAAa,CAAG,KAAuE,CAAC,GAAG,EAAE,UAAU,CAAC,IAC7G,CAAC;QAEH,OAAO,KAAyB,CAAC;IACnC,CAAC,CAAC;IA/HW,QAAA,iBAAiB,qBA+H5B","sourcesContent":["import * as React from 'react';\nimport { ArrowRight, ArrowDown, ArrowLeft, Escape } from '@fluentui/keyboard-keys';\nimport { useMergedRefs, useEventCallback, shouldPreventDefaultOnKeyDown } from '@fluentui/react-utilities';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useMenuContext } from '../../contexts/menuContext';\nimport { useFluent } from '@fluentui/react-shared-contexts';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport type { MenuTriggerChildProps, MenuTriggerState } from './MenuTrigger.types';\n\nconst noop = () => null;\n\n/**\n * Adds the necessary props to the trigger element\n */\nexport const useTriggerElement = (state: MenuTriggerState): MenuTriggerState => {\n const triggerRef = useMenuContext(context => context.triggerRef);\n const menuPopoverRef = useMenuContext(context => context.menuPopoverRef);\n const setOpen = useMenuContext(context => context.setOpen);\n const open = useMenuContext(context => context.open);\n const triggerId = useMenuContext(context => context.triggerId);\n const openOnHover = useMenuContext(context => context.openOnHover);\n const openOnContext = useMenuContext(context => context.openOnContext);\n const isSubmenu = useIsSubmenu();\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(menuPopoverRef.current);\n firstFocusable?.focus();\n }, [findFirstFocusable, menuPopoverRef]);\n\n const openedWithKeyboardRef = React.useRef(false);\n const hasMouseMoved = React.useRef(false);\n\n const { dir } = useFluent();\n const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;\n\n // TODO also need to warn on React.Fragment usage\n const child = React.Children.only(state.children);\n\n const onContextMenu = useEventCallback((e: React.MouseEvent<HTMLElement>) => {\n if (openOnContext) {\n e.preventDefault();\n setOpen(e, { open: true, keyboard: false });\n }\n child.props?.onContextMenu?.(e);\n });\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLElement>) => {\n if (!openOnContext) {\n setOpen(e, { open: !open, keyboard: openedWithKeyboardRef.current });\n openedWithKeyboardRef.current = false;\n }\n child.props?.onClick?.(e);\n });\n\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLElement>) => {\n if (shouldPreventDefaultOnKeyDown(e)) {\n e.preventDefault();\n openedWithKeyboardRef.current = true;\n (e.target as HTMLElement)?.click();\n }\n\n const key = e.key;\n\n if (!openOnContext && ((isSubmenu && key === OpenArrowKey) || (!isSubmenu && key === ArrowDown))) {\n setOpen(e, { open: true, keyboard: true });\n }\n\n if (key === Escape && !isSubmenu) {\n setOpen(e, { open: false, keyboard: true });\n }\n\n // if menu is already open, can't rely on effects to focus\n if (open && key === OpenArrowKey && isSubmenu) {\n focusFirst();\n }\n\n if (open && key === ArrowDown && !isSubmenu) {\n focusFirst();\n }\n\n child.props?.onKeyDown?.(e);\n });\n\n const onMouseEnter = useEventCallback((e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover && hasMouseMoved.current) {\n setOpen(e, { open: true, keyboard: false });\n }\n\n child.props?.onMouseEnter?.(e);\n });\n\n // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience\n // First time open the mouse using mousemove and then continue with mouseenter\n // Only use once to determine that the user is using the mouse since it is an expensive event to handle\n const onMouseMove = useEventCallback((e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover && !hasMouseMoved.current) {\n setOpen(e, { open: true, keyboard: false });\n hasMouseMoved.current = true;\n }\n });\n\n const onMouseLeave = useEventCallback((e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, { open: false, keyboard: false });\n }\n\n child.props?.onMouseLeave?.(e);\n });\n\n const disabled = child.props?.disabled;\n const triggerProps: MenuTriggerChildProps = {\n 'aria-haspopup': true,\n 'aria-expanded': open,\n id: child.props.id || triggerId,\n\n ...(!disabled\n ? {\n onClick,\n onMouseEnter,\n onMouseLeave,\n onContextMenu,\n onKeyDown,\n onMouseMove,\n }\n : // Spread disabled event handlers to implement contract and avoid specific disabled logic in handlers\n {\n onClick: noop,\n onMouseEnter: noop,\n onMouseLeave: noop,\n onContextMenu: noop,\n onKeyDown: noop,\n onMouseMove: noop,\n }),\n };\n\n state.children = React.cloneElement(child, {\n ...triggerProps,\n ref: useMergedRefs(((child as unknown) as React.ReactElement & React.RefAttributes<unknown>).ref, triggerRef),\n });\n\n return state as MenuTriggerState;\n};\n"]}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AE,IAAI;oBACf,WAAW,EAAE,IAAI;iBAClB,CAAC,CACP,CAAC;QAEF,KAAK,CAAC,QAAQ,GAAG,6CAA2B,CAAC,KAAK,CAAC,QAAQ,wCACtD,YAAY,KACf,GAAG,EAAE,+BAAa,CAAC,CAAC,OAAO,KAAK,CAAC,QAAQ,KAAK,UAAU,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,UAAU,CAAC,IAC9E,CAAC;QAEzB,OAAO,KAAyB,CAAC;IACnC,CAAC,CAAC;IAhIW,QAAA,iBAAiB,qBAgI5B","sourcesContent":["import * as React from 'react';\nimport { ArrowRight, ArrowDown, ArrowLeft, Escape } from '@fluentui/keyboard-keys';\nimport {\n applyTriggerPropsToChildren,\n onlyChild,\n shouldPreventDefaultOnKeyDown,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useMenuContext } from '../../contexts/menuContext';\nimport { useFluent } from '@fluentui/react-shared-contexts';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport type { MenuTriggerChildProps, MenuTriggerState } from './MenuTrigger.types';\n\nconst noop = () => null;\n\n/**\n * Adds the necessary props to the trigger element\n */\nexport const useTriggerElement = (state: MenuTriggerState): MenuTriggerState => {\n const triggerRef = useMenuContext(context => context.triggerRef);\n const menuPopoverRef = useMenuContext(context => context.menuPopoverRef);\n const setOpen = useMenuContext(context => context.setOpen);\n const open = useMenuContext(context => context.open);\n const triggerId = useMenuContext(context => context.triggerId);\n const openOnHover = useMenuContext(context => context.openOnHover);\n const openOnContext = useMenuContext(context => context.openOnContext);\n const isSubmenu = useIsSubmenu();\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(menuPopoverRef.current);\n firstFocusable?.focus();\n }, [findFirstFocusable, menuPopoverRef]);\n\n const openedWithKeyboardRef = React.useRef(false);\n const hasMouseMoved = React.useRef(false);\n\n const { dir } = useFluent();\n const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;\n\n const child = React.isValidElement(state.children) ? onlyChild(state.children) : undefined;\n\n const onContextMenu = useEventCallback((e: React.MouseEvent<HTMLElement>) => {\n if (openOnContext) {\n e.preventDefault();\n setOpen(e, { open: true, keyboard: false });\n }\n\n child?.props?.onContextMenu?.(e);\n });\n\n const onClick = useEventCallback((e: React.MouseEvent<HTMLElement>) => {\n if (!openOnContext) {\n setOpen(e, { open: !open, keyboard: openedWithKeyboardRef.current });\n openedWithKeyboardRef.current = false;\n }\n\n child?.props?.onClick?.(e);\n });\n\n const onKeyDown = useEventCallback((e: React.KeyboardEvent<HTMLElement>) => {\n if (shouldPreventDefaultOnKeyDown(e)) {\n e.preventDefault();\n openedWithKeyboardRef.current = true;\n (e.target as HTMLElement)?.click();\n }\n\n const key = e.key;\n\n if (!openOnContext && ((isSubmenu && key === OpenArrowKey) || (!isSubmenu && key === ArrowDown))) {\n setOpen(e, { open: true, keyboard: true });\n }\n\n if (key === Escape && !isSubmenu) {\n setOpen(e, { open: false, keyboard: true });\n }\n\n // if menu is already open, can't rely on effects to focus\n if (open && key === OpenArrowKey && isSubmenu) {\n focusFirst();\n }\n\n if (open && key === ArrowDown && !isSubmenu) {\n focusFirst();\n }\n\n child?.props?.onKeyDown?.(e);\n });\n\n const onMouseEnter = useEventCallback((e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover && hasMouseMoved.current) {\n setOpen(e, { open: true, keyboard: false });\n }\n\n child?.props?.onMouseEnter?.(e);\n });\n\n // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience\n // First time open the mouse using mousemove and then continue with mouseenter\n // Only use once to determine that the user is using the mouse since it is an expensive event to handle\n const onMouseMove = useEventCallback((e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover && !hasMouseMoved.current) {\n setOpen(e, { open: true, keyboard: false });\n hasMouseMoved.current = true;\n }\n });\n\n const onMouseLeave = useEventCallback((e: React.MouseEvent<HTMLElement>) => {\n if (openOnHover) {\n setOpen(e, { open: false, keyboard: false });\n }\n\n child?.props?.onMouseLeave?.(e);\n });\n\n const disabled = child?.props?.disabled;\n const triggerProps: MenuTriggerChildProps = {\n 'aria-haspopup': true,\n 'aria-expanded': open,\n id: child?.props?.id || triggerId,\n\n ...(!disabled\n ? {\n onClick,\n onMouseEnter,\n onMouseLeave,\n onContextMenu,\n onKeyDown,\n onMouseMove,\n }\n : // Spread disabled event handlers to implement contract and avoid specific disabled logic in handlers\n {\n onClick: noop,\n onMouseEnter: noop,\n onMouseLeave: noop,\n onContextMenu: noop,\n onKeyDown: noop,\n onMouseMove: noop,\n }),\n };\n\n state.children = applyTriggerPropsToChildren(state.children, {\n ...triggerProps,\n ref: useMergedRefs((typeof state.children !== 'function' && state.children.ref) || null, triggerRef),\n }) as React.ReactElement;\n\n return state as MenuTriggerState;\n};\n"]}
@@ -8,9 +8,9 @@ export declare const MenuContext: Context<MenuContextValue>;
8
8
  *
9
9
  * Extends and drills down MenuList props to simplify API
10
10
  */
11
- export interface MenuContextValue extends MenuListProps, Pick<MenuState, 'openOnHover' | 'openOnContext' | 'triggerRef' | 'menuPopoverRef' | 'setOpen' | 'isSubmenu' | 'triggerId' | 'hasIcons' | 'hasCheckmarks' | 'persistOnItemClick' | 'inline'> {
11
+ export declare type MenuContextValue = MenuListProps & Pick<MenuState, 'openOnHover' | 'openOnContext' | 'triggerRef' | 'menuPopoverRef' | 'setOpen' | 'isSubmenu' | 'triggerId' | 'hasIcons' | 'hasCheckmarks' | 'persistOnItemClick' | 'inline'> & {
12
12
  open: boolean;
13
13
  triggerId: string;
14
- }
14
+ };
15
15
  export declare const MenuProvider: React.Provider<MenuContextValue> & React.FC<React.ProviderProps<MenuContextValue>>;
16
16
  export declare const useMenuContext: <T>(selector: ContextSelector<MenuContextValue, T>) => T;
@@ -1 +1 @@
1
- {"version":3,"file":"menuContext.js","sourceRoot":"../src/","sources":["contexts/menuContext.ts"],"names":[],"mappings":";;;;IAMa,QAAA,WAAW,GAA8B,sCAAa,CAAmB;QACpF,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,cAAM,OAAA,KAAK,EAAL,CAAK;QACpB,aAAa,EAAE,EAAE;QACjB,oBAAoB,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;QAChC,oBAAoB,EAAE,EAAE;QACxB,SAAS,EAAE,KAAK;QAChB,UAAU,EAAG,EAAE,OAAO,EAAE,IAAI,EAAqD;QACjF,cAAc,EAAG,EAAE,OAAO,EAAE,IAAI,EAAqD;QACrF,SAAS,EAAE,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;IA2BU,QAAA,YAAY,GAAG,mBAAW,CAAC,QAAQ,CAAC;IAE1C,IAAM,cAAc,GAAG,UAAI,QAA8C;QAC9E,OAAA,2CAAkB,CAAC,mBAAW,EAAE,QAAQ,CAAC;IAAzC,CAAyC,CAAC;IAD/B,QAAA,cAAc,kBACiB","sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { MenuListProps } from '../components/index';\nimport type { MenuState } from '../components/Menu/index';\n\nexport const MenuContext: Context<MenuContextValue> = createContext<MenuContextValue>({\n open: false,\n setOpen: () => false,\n checkedValues: {},\n onCheckedValueChange: () => null,\n defaultCheckedValues: {},\n isSubmenu: false,\n triggerRef: ({ current: null } as unknown) as React.MutableRefObject<HTMLElement>,\n menuPopoverRef: ({ current: null } as unknown) as React.MutableRefObject<HTMLElement>,\n triggerId: '',\n openOnContext: false,\n openOnHover: false,\n hasIcons: false,\n hasCheckmarks: false,\n});\n\n/**\n * Context shared between Menu and its children components\n *\n * Extends and drills down MenuList props to simplify API\n */\nexport interface MenuContextValue\n extends MenuListProps,\n Pick<\n MenuState,\n | 'openOnHover'\n | 'openOnContext'\n | 'triggerRef'\n | 'menuPopoverRef'\n | 'setOpen'\n | 'isSubmenu'\n | 'triggerId'\n | 'hasIcons'\n | 'hasCheckmarks'\n | 'persistOnItemClick'\n | 'inline'\n > {\n open: boolean;\n triggerId: string;\n}\n\nexport const MenuProvider = MenuContext.Provider;\n\nexport const useMenuContext = <T>(selector: ContextSelector<MenuContextValue, T>) =>\n useContextSelector(MenuContext, selector);\n"]}
1
+ {"version":3,"file":"menuContext.js","sourceRoot":"../src/","sources":["contexts/menuContext.ts"],"names":[],"mappings":";;;;IAMa,QAAA,WAAW,GAA8B,sCAAa,CAAmB;QACpF,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,cAAM,OAAA,KAAK,EAAL,CAAK;QACpB,aAAa,EAAE,EAAE;QACjB,oBAAoB,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;QAChC,oBAAoB,EAAE,EAAE;QACxB,SAAS,EAAE,KAAK;QAChB,UAAU,EAAG,EAAE,OAAO,EAAE,IAAI,EAAqD;QACjF,cAAc,EAAG,EAAE,OAAO,EAAE,IAAI,EAAqD;QACrF,SAAS,EAAE,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;IA0BU,QAAA,YAAY,GAAG,mBAAW,CAAC,QAAQ,CAAC;IAE1C,IAAM,cAAc,GAAG,UAAI,QAA8C;QAC9E,OAAA,2CAAkB,CAAC,mBAAW,EAAE,QAAQ,CAAC;IAAzC,CAAyC,CAAC;IAD/B,QAAA,cAAc,kBACiB","sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { MenuListProps } from '../components/index';\nimport type { MenuState } from '../components/Menu/index';\n\nexport const MenuContext: Context<MenuContextValue> = createContext<MenuContextValue>({\n open: false,\n setOpen: () => false,\n checkedValues: {},\n onCheckedValueChange: () => null,\n defaultCheckedValues: {},\n isSubmenu: false,\n triggerRef: ({ current: null } as unknown) as React.MutableRefObject<HTMLElement>,\n menuPopoverRef: ({ current: null } as unknown) as React.MutableRefObject<HTMLElement>,\n triggerId: '',\n openOnContext: false,\n openOnHover: false,\n hasIcons: false,\n hasCheckmarks: false,\n});\n\n/**\n * Context shared between Menu and its children components\n *\n * Extends and drills down MenuList props to simplify API\n */\nexport type MenuContextValue = MenuListProps &\n Pick<\n MenuState,\n | 'openOnHover'\n | 'openOnContext'\n | 'triggerRef'\n | 'menuPopoverRef'\n | 'setOpen'\n | 'isSubmenu'\n | 'triggerId'\n | 'hasIcons'\n | 'hasCheckmarks'\n | 'persistOnItemClick'\n | 'inline'\n > & {\n open: boolean;\n triggerId: string;\n };\n\nexport const MenuProvider = MenuContext.Provider;\n\nexport const useMenuContext = <T>(selector: ContextSelector<MenuContextValue, T>) =>\n useContextSelector(MenuContext, selector);\n"]}
@@ -3,11 +3,11 @@ import * as React from 'react';
3
3
  * Context used to guarantee correct aria-relationship between header
4
4
  * and group information
5
5
  */
6
- export interface MenuGroupContextValue {
6
+ export declare type MenuGroupContextValue = {
7
7
  /**
8
8
  * Element id applied to the `MenuGroupHeader` component
9
9
  */
10
10
  headerId: string;
11
- }
11
+ };
12
12
  export declare const MenuGroupContextProvider: React.Provider<MenuGroupContextValue>;
13
13
  export declare const useMenuGroupContext: () => MenuGroupContextValue;
@@ -1 +1 @@
1
- {"version":3,"file":"menuGroupContext.js","sourceRoot":"../src/","sources":["contexts/menuGroupContext.ts"],"names":[],"mappings":";;;;IAEA,IAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAwB,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;IAazE,QAAA,wBAAwB,GAAG,gBAAgB,CAAC,QAAQ,CAAC;IAC3D,IAAM,mBAAmB,GAAG,cAAM,OAAA,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAlC,CAAkC,CAAC;IAA/D,QAAA,mBAAmB,uBAA4C","sourcesContent":["import * as React from 'react';\n\nconst MenuGroupContext = React.createContext<MenuGroupContextValue>({ headerId: '' });\n\n/**\n * Context used to guarantee correct aria-relationship between header\n * and group information\n */\nexport interface MenuGroupContextValue {\n /**\n * Element id applied to the `MenuGroupHeader` component\n */\n headerId: string;\n}\n\nexport const MenuGroupContextProvider = MenuGroupContext.Provider;\nexport const useMenuGroupContext = () => React.useContext(MenuGroupContext);\n"]}
1
+ {"version":3,"file":"menuGroupContext.js","sourceRoot":"../src/","sources":["contexts/menuGroupContext.ts"],"names":[],"mappings":";;;;IAEA,IAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAwB,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;IAazE,QAAA,wBAAwB,GAAG,gBAAgB,CAAC,QAAQ,CAAC;IAC3D,IAAM,mBAAmB,GAAG,cAAM,OAAA,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAlC,CAAkC,CAAC;IAA/D,QAAA,mBAAmB,uBAA4C","sourcesContent":["import * as React from 'react';\n\nconst MenuGroupContext = React.createContext<MenuGroupContextValue>({ headerId: '' });\n\n/**\n * Context used to guarantee correct aria-relationship between header\n * and group information\n */\nexport type MenuGroupContextValue = {\n /**\n * Element id applied to the `MenuGroupHeader` component\n */\n headerId: string;\n};\n\nexport const MenuGroupContextProvider = MenuGroupContext.Provider;\nexport const useMenuGroupContext = () => React.useContext(MenuGroupContext);\n"]}
@@ -6,10 +6,10 @@ export declare const MenuListContext: Context<MenuListContextValue>;
6
6
  /**
7
7
  * Context shared between MenuList and its children components
8
8
  */
9
- export interface MenuListContextValue extends Pick<MenuListProps, 'checkedValues' | 'onCheckedValueChange' | 'hasIcons' | 'hasCheckmarks'> {
9
+ export declare type MenuListContextValue = Pick<MenuListProps, 'checkedValues' | 'onCheckedValueChange' | 'hasIcons' | 'hasCheckmarks'> & {
10
10
  setFocusByFirstCharacter?: (e: React.KeyboardEvent<HTMLElement>, itemEl: HTMLElement) => void;
11
11
  toggleCheckbox?: SelectableHandler;
12
12
  selectRadio?: SelectableHandler;
13
- }
13
+ };
14
14
  export declare const MenuListProvider: React.Provider<MenuListContextValue> & React.FC<React.ProviderProps<MenuListContextValue>>;
15
15
  export declare const useMenuListContext: <T>(selector: ContextSelector<MenuListContextValue, T>) => T;
@@ -1 +1 @@
1
- {"version":3,"file":"menuListContext.js","sourceRoot":"../src/","sources":["contexts/menuListContext.tsx"],"names":[],"mappings":";;;;IAMa,QAAA,eAAe,GAAkC,sCAAa,CAAuB;QAChG,aAAa,EAAE,EAAE;QACjB,oBAAoB,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;QAChC,wBAAwB,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;QACpC,cAAc,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;QAC1B,WAAW,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;QACvB,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;IAYU,QAAA,gBAAgB,GAAG,uBAAe,CAAC,QAAQ,CAAC;IAElD,IAAM,kBAAkB,GAAG,UAAK,QAAkD;QACvF,OAAA,2CAAkB,CAAC,uBAAe,EAAE,QAAQ,CAAC;IAA7C,CAA6C,CAAC;IADnC,QAAA,kBAAkB,sBACiB","sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { SelectableHandler } from '../selectable/index';\nimport type { MenuListProps } from '../components/index';\n\nexport const MenuListContext: Context<MenuListContextValue> = createContext<MenuListContextValue>({\n checkedValues: {},\n onCheckedValueChange: () => null,\n setFocusByFirstCharacter: () => null,\n toggleCheckbox: () => null,\n selectRadio: () => null,\n hasIcons: false,\n hasCheckmarks: false,\n});\n\n/**\n * Context shared between MenuList and its children components\n */\nexport interface MenuListContextValue\n extends Pick<MenuListProps, 'checkedValues' | 'onCheckedValueChange' | 'hasIcons' | 'hasCheckmarks'> {\n setFocusByFirstCharacter?: (e: React.KeyboardEvent<HTMLElement>, itemEl: HTMLElement) => void;\n toggleCheckbox?: SelectableHandler;\n selectRadio?: SelectableHandler;\n}\n\nexport const MenuListProvider = MenuListContext.Provider;\n\nexport const useMenuListContext = <T,>(selector: ContextSelector<MenuListContextValue, T>) =>\n useContextSelector(MenuListContext, selector);\n"]}
1
+ {"version":3,"file":"menuListContext.js","sourceRoot":"../src/","sources":["contexts/menuListContext.tsx"],"names":[],"mappings":";;;;IAMa,QAAA,eAAe,GAAkC,sCAAa,CAAuB;QAChG,aAAa,EAAE,EAAE;QACjB,oBAAoB,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;QAChC,wBAAwB,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;QACpC,cAAc,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;QAC1B,WAAW,EAAE,cAAM,OAAA,IAAI,EAAJ,CAAI;QACvB,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;IAcU,QAAA,gBAAgB,GAAG,uBAAe,CAAC,QAAQ,CAAC;IAElD,IAAM,kBAAkB,GAAG,UAAK,QAAkD;QACvF,OAAA,2CAAkB,CAAC,uBAAe,EAAE,QAAQ,CAAC;IAA7C,CAA6C,CAAC;IADnC,QAAA,kBAAkB,sBACiB","sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { SelectableHandler } from '../selectable/index';\nimport type { MenuListProps } from '../components/index';\n\nexport const MenuListContext: Context<MenuListContextValue> = createContext<MenuListContextValue>({\n checkedValues: {},\n onCheckedValueChange: () => null,\n setFocusByFirstCharacter: () => null,\n toggleCheckbox: () => null,\n selectRadio: () => null,\n hasIcons: false,\n hasCheckmarks: false,\n});\n\n/**\n * Context shared between MenuList and its children components\n */\nexport type MenuListContextValue = Pick<\n MenuListProps,\n 'checkedValues' | 'onCheckedValueChange' | 'hasIcons' | 'hasCheckmarks'\n> & {\n setFocusByFirstCharacter?: (e: React.KeyboardEvent<HTMLElement>, itemEl: HTMLElement) => void;\n toggleCheckbox?: SelectableHandler;\n selectRadio?: SelectableHandler;\n};\n\nexport const MenuListProvider = MenuListContext.Provider;\n\nexport const useMenuListContext = <T,>(selector: ContextSelector<MenuListContextValue, T>) =>\n useContextSelector(MenuListContext, selector);\n"]}
@@ -3,7 +3,7 @@ export declare type SelectableHandler = (e: React.MouseEvent | React.KeyboardEve
3
3
  /**
4
4
  * Props for selecatble menu items
5
5
  */
6
- export interface MenuItemSelectableProps {
6
+ export declare type MenuItemSelectableProps = {
7
7
  /**
8
8
  * Follows input convention
9
9
  * https://www.w3schools.com/jsref/prop_checkbox_name.asp
@@ -14,11 +14,11 @@ export interface MenuItemSelectableProps {
14
14
  * https://www.w3schools.com/jsref/prop_checkbox_value.asp
15
15
  */
16
16
  value: string;
17
- }
17
+ };
18
18
  /**
19
19
  * State for selectable menu items
20
20
  */
21
- export interface MenuItemSelectableState extends MenuItemSelectableProps {
21
+ export declare type MenuItemSelectableState = MenuItemSelectableProps & {
22
22
  /**
23
23
  * Checked items for a value with `name`
24
24
  */
@@ -31,4 +31,4 @@ export interface MenuItemSelectableState extends MenuItemSelectableProps {
31
31
  * Selectable is checked
32
32
  */
33
33
  checked: boolean;
34
- }
34
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"../src/","sources":["selectable/types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\nexport type SelectableHandler = (\n e: React.MouseEvent | React.KeyboardEvent,\n name: string,\n value: string,\n checked: boolean,\n) => void;\n\n/**\n * Props for selecatble menu items\n */\nexport interface MenuItemSelectableProps {\n /**\n * Follows input convention\n * https://www.w3schools.com/jsref/prop_checkbox_name.asp\n */\n name: string;\n\n /**\n * Follows input convention\n * https://www.w3schools.com/jsref/prop_checkbox_value.asp\n */\n value: string;\n}\n\n/**\n * State for selectable menu items\n */\nexport interface MenuItemSelectableState extends MenuItemSelectableProps {\n /**\n * Checked items for a value with `name`\n */\n checkedItems: string[];\n\n /**\n * Callback when checked items changes for a given value with `name`\n */\n onCheckedValueChange: (e: React.MouseEvent | React.KeyboardEvent, name: string, checkedItems: string[]) => void;\n\n /**\n * Selectable is checked\n */\n checked: boolean;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"../src/","sources":["selectable/types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\nexport type SelectableHandler = (\n e: React.MouseEvent | React.KeyboardEvent,\n name: string,\n value: string,\n checked: boolean,\n) => void;\n\n/**\n * Props for selecatble menu items\n */\nexport type MenuItemSelectableProps = {\n /**\n * Follows input convention\n * https://www.w3schools.com/jsref/prop_checkbox_name.asp\n */\n name: string;\n\n /**\n * Follows input convention\n * https://www.w3schools.com/jsref/prop_checkbox_value.asp\n */\n value: string;\n};\n\n/**\n * State for selectable menu items\n */\nexport type MenuItemSelectableState = MenuItemSelectableProps & {\n /**\n * Checked items for a value with `name`\n */\n checkedItems: string[];\n\n /**\n * Callback when checked items changes for a given value with `name`\n */\n onCheckedValueChange: (e: React.MouseEvent | React.KeyboardEvent, name: string, checkedItems: string[]) => void;\n\n /**\n * Selectable is checked\n */\n checked: boolean;\n};\n"]}
@@ -2,6 +2,5 @@ import * as React from 'react';
2
2
  import type { MenuProps } from './Menu.types';
3
3
  /**
4
4
  * Wrapper component that manages state for a popup MenuList and a MenuTrigger
5
- * {@docCategory Menu }
6
5
  */
7
6
  export declare const Menu: React.FC<MenuProps>;
@@ -12,7 +12,6 @@ var useMenuContextValues_1 = /*#__PURE__*/require("./useMenuContextValues");
12
12
  var renderMenu_1 = /*#__PURE__*/require("./renderMenu");
13
13
  /**
14
14
  * Wrapper component that manages state for a popup MenuList and a MenuTrigger
15
- * {@docCategory Menu }
16
15
  */
17
16
 
18
17
 
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Menu/Menu.tsx"],"names":[],"mappings":";;;;;;;AACA,IAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AACA,IAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,IAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAGA;;;AAGG;;;AACI,IAAM,IAAI,GAAwB,UAAA,KAAA,EAAK;AAC5C,MAAM,KAAK,GAAG,SAAA,CAAA,OAAA,CAAQ,KAAR,CAAd;AACA,MAAM,aAAa,GAAG,sBAAA,CAAA,oBAAA,CAAqB,KAArB,CAAtB;AAEA,SAAO,YAAA,CAAA,UAAA,CAAW,KAAX,EAAkB,aAAlB,CAAP;AACD,CALM;;AAAM,OAAA,CAAA,IAAA,GAAI,IAAJ;AAOb,OAAA,CAAA,IAAA,CAAK,WAAL,GAAmB,MAAnB","sourcesContent":["import * as React from 'react';\nimport { useMenu } from './useMenu';\nimport { useMenuContextValues } from './useMenuContextValues';\nimport { renderMenu } from './renderMenu';\nimport type { MenuProps } from './Menu.types';\n\n/**\n * Wrapper component that manages state for a popup MenuList and a MenuTrigger\n * {@docCategory Menu }\n */\nexport const Menu: React.FC<MenuProps> = props => {\n const state = useMenu(props);\n const contextValues = useMenuContextValues(state);\n\n return renderMenu(state, contextValues);\n};\n\nMenu.displayName = 'Menu';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/Menu/Menu.tsx"],"names":[],"mappings":";;;;;;;AACA,IAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AACA,IAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,IAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,IAAI,GAAwB,UAAA,KAAA,EAAK;AAC5C,MAAM,KAAK,GAAG,SAAA,CAAA,OAAA,CAAQ,KAAR,CAAd;AACA,MAAM,aAAa,GAAG,sBAAA,CAAA,oBAAA,CAAqB,KAArB,CAAtB;AAEA,SAAO,YAAA,CAAA,UAAA,CAAW,KAAX,EAAkB,aAAlB,CAAP;AACD,CALM;;AAAM,OAAA,CAAA,IAAA,GAAI,IAAJ;AAOb,OAAA,CAAA,IAAA,CAAK,WAAL,GAAmB,MAAnB","sourcesContent":["import * as React from 'react';\nimport { useMenu } from './useMenu';\nimport { useMenuContextValues } from './useMenuContextValues';\nimport { renderMenu } from './renderMenu';\nimport type { MenuProps } from './Menu.types';\n\n/**\n * Wrapper component that manages state for a popup MenuList and a MenuTrigger\n */\nexport const Menu: React.FC<MenuProps> = props => {\n const state = useMenu(props);\n const contextValues = useMenuContextValues(state);\n\n return renderMenu(state, contextValues);\n};\n\nMenu.displayName = 'Menu';\n"],"sourceRoot":"../src/"}