@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,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;
@@ -34,7 +34,6 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
34
34
  });
35
35
  /**
36
36
  * Apply styling to the Menu slots based on the state
37
- * {@docCategory Menu }
38
37
  */
39
38
 
40
39
 
@@ -1 +1 @@
1
- {"version":3,"sources":["components/MenuPopover/useMenuPopoverStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAGA,IAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAaA;;;AAGG;;;AACI,IAAM,oBAAoB,GAAG,UAAC,KAAD,EAAwB;AAC1D,MAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CAAa,MAAM,CAAC,IAApB,EAA0B,KAAK,CAAC,IAAN,CAAW,SAArC,CAAvB;AACA,SAAO,KAAP;AACD,CAJM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/MenuPopover/useMenuPopoverStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAGA,IAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAaA;;AAEG;;;AACI,IAAM,oBAAoB,GAAG,UAAC,KAAD,EAAwB;AAC1D,MAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CAAa,MAAM,CAAC,IAApB,EAA0B,KAAK,CAAC,IAAN,CAAW,SAArC,CAAvB;AACA,SAAO,KAAP;AACD,CAJM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","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"],"sourceRoot":"../src/"}
@@ -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>;
@@ -11,7 +11,6 @@ var renderMenuTrigger_1 = /*#__PURE__*/require("./renderMenuTrigger");
11
11
  /**
12
12
  * Wraps a trigger element as an only child
13
13
  * and adds the necessary event handling to open a popup menu
14
- * {@docCategory MenuTrigger }
15
14
  */
16
15
 
17
16
 
@@ -1 +1 @@
1
- {"version":3,"sources":["components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAGA;;;;AAIG;;;AACI,IAAM,WAAW,GAA+B,UAAA,KAAA,EAAK;AAC1D,MAAM,KAAK,GAAG,gBAAA,CAAA,cAAA,CAAe,KAAf,CAAd;AAEA,SAAO,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,WAAA,GAAW,WAAX;AAMb,OAAA,CAAA,WAAA,CAAY,WAAZ,GAA0B,aAA1B","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAGA;;;AAGG;;;AACI,IAAM,WAAW,GAA+B,UAAA,KAAA,EAAK;AAC1D,MAAM,KAAK,GAAG,gBAAA,CAAA,cAAA,CAAe,KAAf,CAAd;AAEA,SAAO,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,WAAA,GAAW,WAAX;AAMb,OAAA,CAAA,WAAA,CAAY,WAAZ,GAA0B,aAA1B","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"],"sourceRoot":"../src/"}
@@ -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;
@@ -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;
@@ -12,7 +12,6 @@ var menuTriggerContext_1 = /*#__PURE__*/require("../../contexts/menuTriggerConte
12
12
  * Render the final JSX of MenuTrigger
13
13
  *
14
14
  * Only renders children
15
- * {@docCategory MenuTrigger }
16
15
  */
17
16
 
18
17
 
@@ -1 +1 @@
1
- {"version":3,"sources":["components/MenuTrigger/renderMenuTrigger.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,oBAAA,gBAAA,OAAA,CAAA,mCAAA,CAAA;AAGA;;;;;AAKG;;;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAAwB;AACvD,SAAO,KAAA,CAAA,aAAA,CAAC,oBAAA,CAAA,0BAAD,EAA2B;AAAC,IAAA,KAAK,EAAE;AAAR,GAA3B,EAA0C,KAAK,CAAC,QAAhD,CAAP;AACD,CAFM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/MenuTrigger/renderMenuTrigger.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,oBAAA,gBAAA,OAAA,CAAA,mCAAA,CAAA;AAGA;;;;AAIG;;;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAAwB;AACvD,SAAO,KAAA,CAAA,aAAA,CAAC,oBAAA,CAAA,0BAAD,EAA2B;AAAC,IAAA,KAAK,EAAE;AAAR,GAA3B,EAA0C,KAAK,CAAC,QAAhD,CAAP;AACD,CAFM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","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"],"sourceRoot":"../src/"}
@@ -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;
@@ -13,8 +13,6 @@ var useTriggerElement_1 = /*#__PURE__*/require("./useTriggerElement");
13
13
  * Clones the only child component and adds necessary event handling behaviours to open a popup menu
14
14
  *
15
15
  * @param props - props from this instance of MenuTrigger
16
- *
17
- * {@docCategory MenuTrigger }
18
16
  */
19
17
 
20
18
 
@@ -1 +1 @@
1
- {"version":3,"sources":["components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAGA;;;;;;;AAOG;;;AACI,IAAM,cAAc,GAAG,UAAC,KAAD,EAAwB;AACpD,MAAM,KAAK,GAAA,OAAA,CAAA,QAAA,CAAA,EAAA,EAAQ,KAAR,CAAX,CADoD,CAGpD;;;AACA,SAAO,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,CAAP;AACD,CALM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAGA;;;;;AAKG;;;AACI,IAAM,cAAc,GAAG,UAAC,KAAD,EAAwB;AACpD,MAAM,KAAK,GAAA,OAAA,CAAA,QAAA,CAAA,EAAA,EAAQ,KAAR,CAAX,CADoD,CAGpD;;;AACA,SAAO,mBAAA,CAAA,iBAAA,CAAkB,KAAlB,CAAP;AACD,CALM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd","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"],"sourceRoot":"../src/"}
@@ -30,7 +30,7 @@ var noop = function () {
30
30
 
31
31
 
32
32
  var useTriggerElement = function (state) {
33
- var _a;
33
+ var _a, _b;
34
34
 
35
35
  var triggerRef = menuContext_1.useMenuContext(function (context) {
36
36
  return context.triggerRef;
@@ -62,9 +62,8 @@ var useTriggerElement = function (state) {
62
62
  var openedWithKeyboardRef = React.useRef(false);
63
63
  var hasMouseMoved = React.useRef(false);
64
64
  var dir = react_shared_contexts_1.useFluent().dir;
65
- var OpenArrowKey = dir === 'ltr' ? keyboard_keys_1.ArrowRight : keyboard_keys_1.ArrowLeft; // TODO also need to warn on React.Fragment usage
66
-
67
- var child = React.Children.only(state.children);
65
+ var OpenArrowKey = dir === 'ltr' ? keyboard_keys_1.ArrowRight : keyboard_keys_1.ArrowLeft;
66
+ var child = React.isValidElement(state.children) ? react_utilities_1.onlyChild(state.children) : undefined;
68
67
  var onContextMenu = react_utilities_1.useEventCallback(function (e) {
69
68
  var _a, _b;
70
69
 
@@ -76,7 +75,7 @@ var useTriggerElement = function (state) {
76
75
  });
77
76
  }
78
77
 
79
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onContextMenu) === null || _b === void 0 ? void 0 : _b.call(_a, e);
78
+ (_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);
80
79
  });
81
80
  var onClick = react_utilities_1.useEventCallback(function (e) {
82
81
  var _a, _b;
@@ -89,7 +88,7 @@ var useTriggerElement = function (state) {
89
88
  openedWithKeyboardRef.current = false;
90
89
  }
91
90
 
92
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
91
+ (_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);
93
92
  });
94
93
  var onKeyDown = react_utilities_1.useEventCallback(function (e) {
95
94
  var _a, _b, _c;
@@ -125,7 +124,7 @@ var useTriggerElement = function (state) {
125
124
  focusFirst();
126
125
  }
127
126
 
128
- (_c = (_b = child.props) === null || _b === void 0 ? void 0 : _b.onKeyDown) === null || _c === void 0 ? void 0 : _c.call(_b, e);
127
+ (_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);
129
128
  });
130
129
  var onMouseEnter = react_utilities_1.useEventCallback(function (e) {
131
130
  var _a, _b;
@@ -137,7 +136,7 @@ var useTriggerElement = function (state) {
137
136
  });
138
137
  }
139
138
 
140
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseEnter) === null || _b === void 0 ? void 0 : _b.call(_a, e);
139
+ (_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);
141
140
  }); // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience
142
141
  // First time open the mouse using mousemove and then continue with mouseenter
143
142
  // Only use once to determine that the user is using the mouse since it is an expensive event to handle
@@ -161,14 +160,14 @@ var useTriggerElement = function (state) {
161
160
  });
162
161
  }
163
162
 
164
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onMouseLeave) === null || _b === void 0 ? void 0 : _b.call(_a, e);
163
+ (_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);
165
164
  });
166
- var disabled = (_a = child.props) === null || _a === void 0 ? void 0 : _a.disabled;
165
+ var disabled = (_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.disabled;
167
166
 
168
167
  var triggerProps = tslib_1.__assign({
169
168
  'aria-haspopup': true,
170
169
  'aria-expanded': open,
171
- id: child.props.id || triggerId
170
+ id: ((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.id) || triggerId
172
171
  }, !disabled ? {
173
172
  onClick: onClick,
174
173
  onMouseEnter: onMouseEnter,
@@ -186,8 +185,8 @@ var useTriggerElement = function (state) {
186
185
  onMouseMove: noop
187
186
  });
188
187
 
189
- state.children = React.cloneElement(child, tslib_1.__assign(tslib_1.__assign({}, triggerProps), {
190
- ref: react_utilities_1.useMergedRefs(child.ref, triggerRef)
188
+ state.children = react_utilities_1.applyTriggerPropsToChildren(state.children, tslib_1.__assign(tslib_1.__assign({}, triggerProps), {
189
+ ref: react_utilities_1.useMergedRefs(typeof state.children !== 'function' && state.children.ref || null, triggerRef)
191
190
  }));
192
191
  return state;
193
192
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["components/MenuTrigger/useTriggerElement.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,IAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;;AACA,IAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,IAAA,cAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AAGA,IAAM,IAAI,GAAG,YAAA;AAAM,SAAA,IAAA;AAAI,CAAvB;AAEA;;AAEG;;;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAAwB;;;AACvD,MAAM,UAAU,GAAG,aAAA,CAAA,cAAA,CAAe,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,UAAA;AAAkB,GAA5C,CAAnB;AACA,MAAM,cAAc,GAAG,aAAA,CAAA,cAAA,CAAe,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,cAAA;AAAsB,GAAhD,CAAvB;AACA,MAAM,OAAO,GAAG,aAAA,CAAA,cAAA,CAAe,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,OAAA;AAAe,GAAzC,CAAhB;AACA,MAAM,IAAI,GAAG,aAAA,CAAA,cAAA,CAAe,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAAP,IAAA;AAAY,GAAtC,CAAb;AACA,MAAM,SAAS,GAAG,aAAA,CAAA,cAAA,CAAe,UAAA,OAAA,EAAO;AAAI,WAAA,OAAO,CAA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CAAd,GAAc,KAAA,CAAd,GAAc,EAAA,CAAE,QAA9B;;AACA,MAAM,YAAY,GAAA,OAAA,CAAA,QAAA,CAAA;AAChB,qBAAiB,IADD;AAEhB,qBAAiB,IAFD;AAGhB,IAAA,EAAE,EAAE,KAAK,CAAC,KAAN,CAAY,EAAZ,IAAkB;AAHN,GAAA,EAKZ,CAAC,QAAD,GACA;AACE,IAAA,OAAO,EAAA,OADT;AAEE,IAAA,YAAY,EAAA,YAFd;AAGE,IAAA,YAAY,EAAA,YAHd;AAIE,IAAA,aAAa,EAAA,aAJf;AAKE,IAAA,SAAS,EAAA,SALX;AAME,IAAA,WAAW,EAAA;AANb,GADA,GASA;AACA;AACE,IAAA,OAAO,EAAE,IADX;AAEE,IAAA,YAAY,EAAE,IAFhB;AAGE,IAAA,YAAY,EAAE,IAHhB;AAIE,IAAA,aAAa,EAAE,IAJjB;AAKE,IAAA,SAAS,EAAE,IALb;AAME,IAAA,WAAW,EAAE;AANf,GAfY,CAAlB;;AAyBA,EAAA,KAAK,CAAC,QAAN,GAAiB,KAAK,CAAC,YAAN,CAAmB,KAAnB,EAAwB,OAAA,CAAA,QAAA,CAAA,OAAA,CAAA,QAAA,CAAA,EAAA,EACpC,YADoC,CAAA,EACxB;AACf,IAAA,GAAG,EAAE,iBAAA,CAAA,aAAA,CAAgB,KAAuE,CAAC,GAAxF,EAA6F,UAA7F;AADU,GADwB,CAAxB,CAAjB;AAKA,SAAO,KAAP;AACD,CA/HM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/MenuTrigger/useTriggerElement.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,I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,aAAA,CAAe,OAAO,KAAK,CAAC,QAAb,KAA0B,UAA1B,IAAwC,KAAK,CAAC,QAAN,CAAe,GAAxD,IAAgE,IAA9E,EAAoF,UAApF;AADU,GAD0C,CAA1C,CAAjB;AAKA,SAAO,KAAP;AACD,CAhIM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","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"],"sourceRoot":"../src/"}
@@ -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,"sources":["contexts/menuContext.ts"],"names":[],"mappings":";;;;;;;AACA,IAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAKa,OAAA,CAAA,WAAA,gBAAyC,wBAAA,CAAA,aAAA,CAAgC;AACpF,EAAA,IAAI,EAAE,KAD8E;AAEpF,EAAA,OAAO,EAAE,YAAA;AAAM,WAAA,KAAA;AAAK,GAFgE;AAGpF,EAAA,aAAa,EAAE,EAHqE;AAIpF,EAAA,oBAAoB,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAJoD;AAKpF,EAAA,oBAAoB,EAAE,EAL8D;AAMpF,EAAA,SAAS,EAAE,KANyE;AAOpF,EAAA,UAAU,EAAG;AAAE,IAAA,OAAO,EAAE;AAAX,GAPuE;AAQpF,EAAA,cAAc,EAAG;AAAE,IAAA,OAAO,EAAE;AAAX,GARmE;AASpF,EAAA,SAAS,EAAE,EATyE;AAUpF,EAAA,aAAa,EAAE,KAVqE;AAWpF,EAAA,WAAW,EAAE,KAXuE;AAYpF,EAAA,QAAQ,EAAE,KAZ0E;AAapF,EAAA,aAAa,EAAE;AAbqE,CAAhC,CAAzC;AAyCA,OAAA,CAAA,YAAA,GAAe,OAAA,CAAA,WAAA,CAAY,QAA3B;;AAEN,IAAM,cAAc,GAAG,UAAI,QAAJ,EAAkD;AAC9E,SAAA,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,WAAnB,EAAgC,QAAhC,CAAA;AAAyC,CADpC;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["contexts/menuContext.ts"],"names":[],"mappings":";;;;;;;AACA,IAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAKa,OAAA,CAAA,WAAA,gBAAyC,wBAAA,CAAA,aAAA,CAAgC;AACpF,EAAA,IAAI,EAAE,KAD8E;AAEpF,EAAA,OAAO,EAAE,YAAA;AAAM,WAAA,KAAA;AAAK,GAFgE;AAGpF,EAAA,aAAa,EAAE,EAHqE;AAIpF,EAAA,oBAAoB,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAJoD;AAKpF,EAAA,oBAAoB,EAAE,EAL8D;AAMpF,EAAA,SAAS,EAAE,KANyE;AAOpF,EAAA,UAAU,EAAG;AAAE,IAAA,OAAO,EAAE;AAAX,GAPuE;AAQpF,EAAA,cAAc,EAAG;AAAE,IAAA,OAAO,EAAE;AAAX,GARmE;AASpF,EAAA,SAAS,EAAE,EATyE;AAUpF,EAAA,aAAa,EAAE,KAVqE;AAWpF,EAAA,WAAW,EAAE,KAXuE;AAYpF,EAAA,QAAQ,EAAE,KAZ0E;AAapF,EAAA,aAAa,EAAE;AAbqE,CAAhC,CAAzC;AAwCA,OAAA,CAAA,YAAA,GAAe,OAAA,CAAA,WAAA,CAAY,QAA3B;;AAEN,IAAM,cAAc,GAAG,UAAI,QAAJ,EAAkD;AAC9E,SAAA,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,WAAnB,EAAgC,QAAhC,CAAA;AAAyC,CADpC;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd","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"],"sourceRoot":"../src/"}
@@ -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,"sources":["contexts/menuGroupContext.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAEA,IAAM,gBAAgB,gBAAG,KAAK,CAAC,aAAN,CAA2C;AAAE,EAAA,QAAQ,EAAE;AAAZ,CAA3C,CAAzB;AAaa,OAAA,CAAA,wBAAA,GAA2B,gBAAgB,CAAC,QAA5C;;AACN,IAAM,mBAAmB,GAAG,YAAA;AAAM,SAAA,KAAK,CAAC,UAAN,CAAA,gBAAA,CAAA;AAAkC,CAApE;;AAAM,OAAA,CAAA,mBAAA,GAAmB,mBAAnB","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["contexts/menuGroupContext.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAEA,IAAM,gBAAgB,gBAAG,KAAK,CAAC,aAAN,CAA2C;AAAE,EAAA,QAAQ,EAAE;AAAZ,CAA3C,CAAzB;AAaa,OAAA,CAAA,wBAAA,GAA2B,gBAAgB,CAAC,QAA5C;;AACN,IAAM,mBAAmB,GAAG,YAAA;AAAM,SAAA,KAAK,CAAC,UAAN,CAAA,gBAAA,CAAA;AAAkC,CAApE;;AAAM,OAAA,CAAA,mBAAA,GAAmB,mBAAnB","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"],"sourceRoot":"../src/"}
@@ -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,"sources":["contexts/menuListContext.tsx"],"names":[],"mappings":";;;;;;;AACA,IAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAKa,OAAA,CAAA,eAAA,gBAAiD,wBAAA,CAAA,aAAA,CAAoC;AAChG,EAAA,aAAa,EAAE,EADiF;AAEhG,EAAA,oBAAoB,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAFgE;AAGhG,EAAA,wBAAwB,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAH4D;AAIhG,EAAA,cAAc,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAJsE;AAKhG,EAAA,WAAW,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GALyE;AAMhG,EAAA,QAAQ,EAAE,KANsF;AAOhG,EAAA,aAAa,EAAE;AAPiF,CAApC,CAAjD;AAoBA,OAAA,CAAA,gBAAA,GAAmB,OAAA,CAAA,eAAA,CAAgB,QAAnC;;AAEN,IAAM,kBAAkB,GAAG,UAAK,QAAL,EAAuD;AACvF,SAAA,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,eAAnB,EAAoC,QAApC,CAAA;AAA6C,CADxC;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["contexts/menuListContext.tsx"],"names":[],"mappings":";;;;;;;AACA,IAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;;AAKa,OAAA,CAAA,eAAA,gBAAiD,wBAAA,CAAA,aAAA,CAAoC;AAChG,EAAA,aAAa,EAAE,EADiF;AAEhG,EAAA,oBAAoB,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAFgE;AAGhG,EAAA,wBAAwB,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAH4D;AAIhG,EAAA,cAAc,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GAJsE;AAKhG,EAAA,WAAW,EAAE,YAAA;AAAM,WAAA,IAAA;AAAI,GALyE;AAMhG,EAAA,QAAQ,EAAE,KANsF;AAOhG,EAAA,aAAa,EAAE;AAPiF,CAApC,CAAjD;AAsBA,OAAA,CAAA,gBAAA,GAAmB,OAAA,CAAA,eAAA,CAAgB,QAAnC;;AAEN,IAAM,kBAAkB,GAAG,UAAK,QAAL,EAAuD;AACvF,SAAA,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,eAAnB,EAAoC,QAApC,CAAA;AAA6C,CADxC;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB","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"],"sourceRoot":"../src/"}
@@ -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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-menu",
3
- "version": "9.0.0-alpha.77",
3
+ "version": "9.0.0-alpha.80",
4
4
  "description": "Fluent UI menu component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -26,11 +26,11 @@
26
26
  "test": "jest"
27
27
  },
28
28
  "devDependencies": {
29
- "@fluentui/babel-make-styles": "9.0.0-alpha.48",
30
- "@fluentui/eslint-plugin": "^1.4.1",
31
- "@fluentui/jest-serializer-make-styles": "9.0.0-alpha.41",
32
- "@fluentui/react-conformance": "^0.5.0",
33
- "@fluentui/react-conformance-make-styles": "9.0.0-alpha.10",
29
+ "@fluentui/babel-make-styles": "9.0.0-alpha.51",
30
+ "@fluentui/eslint-plugin": "*",
31
+ "@fluentui/jest-serializer-make-styles": "9.0.0-alpha.44",
32
+ "@fluentui/react-conformance": "*",
33
+ "@fluentui/react-conformance-make-styles": "9.0.0-alpha.13",
34
34
  "@fluentui/scripts": "^1.0.0",
35
35
  "@types/enzyme": "3.10.3",
36
36
  "@types/enzyme-adapter-react-16": "1.0.3",
@@ -45,14 +45,14 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@fluentui/keyboard-keys": "9.0.0-alpha.3",
48
- "@fluentui/react-context-selector": "9.0.0-alpha.31",
48
+ "@fluentui/react-context-selector": "9.0.0-alpha.32",
49
49
  "@fluentui/react-icons": "^1.1.136",
50
- "@fluentui/react-make-styles": "9.0.0-alpha.66",
51
- "@fluentui/react-portal": "9.0.0-alpha.48",
52
- "@fluentui/react-positioning": "9.0.0-alpha.54",
53
- "@fluentui/react-provider": "9.0.0-alpha.77",
54
- "@fluentui/react-tabster": "9.0.0-alpha.60",
55
- "@fluentui/react-utilities": "9.0.0-alpha.48",
50
+ "@fluentui/react-make-styles": "9.0.0-alpha.69",
51
+ "@fluentui/react-portal": "9.0.0-alpha.51",
52
+ "@fluentui/react-positioning": "9.0.0-alpha.57",
53
+ "@fluentui/react-provider": "9.0.0-alpha.80",
54
+ "@fluentui/react-tabster": "9.0.0-alpha.63",
55
+ "@fluentui/react-utilities": "9.0.0-alpha.49",
56
56
  "tslib": "^2.1.0"
57
57
  },
58
58
  "peerDependencies": {