@fluentui/react-menu 9.4.0 → 9.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. package/CHANGELOG.json +143 -1
  2. package/CHANGELOG.md +36 -2
  3. package/dist/index.d.ts +46 -5
  4. package/lib/components/Menu/Menu.types.js.map +1 -1
  5. package/lib/components/Menu/useMenu.js +13 -7
  6. package/lib/components/Menu/useMenu.js.map +1 -1
  7. package/lib/components/MenuItem/useMenuItem.js +3 -1
  8. package/lib/components/MenuItem/useMenuItem.js.map +1 -1
  9. package/lib/components/MenuPopover/useMenuPopover.js +20 -14
  10. package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
  11. package/lib/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
  12. package/lib/components/MenuTrigger/useMenuTrigger.js +46 -31
  13. package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  14. package/lib/index.js.map +1 -1
  15. package/lib-amd/Menu.js +6 -0
  16. package/lib-amd/Menu.js.map +1 -0
  17. package/lib-amd/MenuDivider.js +6 -0
  18. package/lib-amd/MenuDivider.js.map +1 -0
  19. package/lib-amd/MenuGroup.js +6 -0
  20. package/lib-amd/MenuGroup.js.map +1 -0
  21. package/lib-amd/MenuGroupHeader.js +6 -0
  22. package/lib-amd/MenuGroupHeader.js.map +1 -0
  23. package/lib-amd/MenuItem.js +6 -0
  24. package/lib-amd/MenuItem.js.map +1 -0
  25. package/lib-amd/MenuItemCheckbox.js +6 -0
  26. package/lib-amd/MenuItemCheckbox.js.map +1 -0
  27. package/lib-amd/MenuItemRadio.js +6 -0
  28. package/lib-amd/MenuItemRadio.js.map +1 -0
  29. package/lib-amd/MenuList.js +6 -0
  30. package/lib-amd/MenuList.js.map +1 -0
  31. package/lib-amd/MenuPopover.js +6 -0
  32. package/lib-amd/MenuPopover.js.map +1 -0
  33. package/lib-amd/MenuSplitGroup.js +6 -0
  34. package/lib-amd/MenuSplitGroup.js.map +1 -0
  35. package/lib-amd/MenuTrigger.js +6 -0
  36. package/lib-amd/MenuTrigger.js.map +1 -0
  37. package/lib-amd/components/Menu/Menu.js +16 -0
  38. package/lib-amd/components/Menu/Menu.js.map +1 -0
  39. package/lib-amd/components/Menu/Menu.types.js +5 -0
  40. package/lib-amd/components/Menu/Menu.types.js.map +1 -0
  41. package/lib-amd/components/Menu/index.js +10 -0
  42. package/lib-amd/components/Menu/index.js.map +1 -0
  43. package/lib-amd/components/Menu/renderMenu.js +15 -0
  44. package/lib-amd/components/Menu/renderMenu.js.map +1 -0
  45. package/lib-amd/components/Menu/useMenu.js +233 -0
  46. package/lib-amd/components/Menu/useMenu.js.map +1 -0
  47. package/lib-amd/components/Menu/useMenuContextValues.js +29 -0
  48. package/lib-amd/components/Menu/useMenuContextValues.js.map +1 -0
  49. package/lib-amd/components/MenuDivider/MenuDivider.js +15 -0
  50. package/lib-amd/components/MenuDivider/MenuDivider.js.map +1 -0
  51. package/lib-amd/components/MenuDivider/MenuDivider.types.js +5 -0
  52. package/lib-amd/components/MenuDivider/MenuDivider.types.js.map +1 -0
  53. package/lib-amd/components/MenuDivider/index.js +10 -0
  54. package/lib-amd/components/MenuDivider/index.js.map +1 -0
  55. package/lib-amd/components/MenuDivider/renderMenuDivider.js +15 -0
  56. package/lib-amd/components/MenuDivider/renderMenuDivider.js.map +1 -0
  57. package/lib-amd/components/MenuDivider/useMenuDivider.js +18 -0
  58. package/lib-amd/components/MenuDivider/useMenuDivider.js.map +1 -0
  59. package/lib-amd/components/MenuDivider/useMenuDividerStyles.js +18 -0
  60. package/lib-amd/components/MenuDivider/useMenuDividerStyles.js.map +1 -0
  61. package/lib-amd/components/MenuGroup/MenuGroup.js +16 -0
  62. package/lib-amd/components/MenuGroup/MenuGroup.js.map +1 -0
  63. package/lib-amd/components/MenuGroup/MenuGroup.types.js +5 -0
  64. package/lib-amd/components/MenuGroup/MenuGroup.types.js.map +1 -0
  65. package/lib-amd/components/MenuGroup/index.js +11 -0
  66. package/lib-amd/components/MenuGroup/index.js.map +1 -0
  67. package/lib-amd/components/MenuGroup/renderMenuGroup.js +16 -0
  68. package/lib-amd/components/MenuGroup/renderMenuGroup.js.map +1 -0
  69. package/lib-amd/components/MenuGroup/useMenuGroup.js +20 -0
  70. package/lib-amd/components/MenuGroup/useMenuGroup.js.map +1 -0
  71. package/lib-amd/components/MenuGroup/useMenuGroupContextValues.js +12 -0
  72. package/lib-amd/components/MenuGroup/useMenuGroupContextValues.js.map +1 -0
  73. package/lib-amd/components/MenuGroup/useMenuGroupStyles.js +14 -0
  74. package/lib-amd/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
  75. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.js +15 -0
  76. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -0
  77. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.types.js +5 -0
  78. package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -0
  79. package/lib-amd/components/MenuGroupHeader/index.js +10 -0
  80. package/lib-amd/components/MenuGroupHeader/index.js.map +1 -0
  81. package/lib-amd/components/MenuGroupHeader/renderMenuGroupHeader.js +15 -0
  82. package/lib-amd/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -0
  83. package/lib-amd/components/MenuGroupHeader/useMenuGroupHeader.js +19 -0
  84. package/lib-amd/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -0
  85. package/lib-amd/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +27 -0
  86. package/lib-amd/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -0
  87. package/lib-amd/components/MenuItem/MenuItem.js +15 -0
  88. package/lib-amd/components/MenuItem/MenuItem.js.map +1 -0
  89. package/lib-amd/components/MenuItem/MenuItem.types.js +5 -0
  90. package/lib-amd/components/MenuItem/MenuItem.types.js.map +1 -0
  91. package/lib-amd/components/MenuItem/index.js +10 -0
  92. package/lib-amd/components/MenuItem/index.js.map +1 -0
  93. package/lib-amd/components/MenuItem/renderMenuItem.js +19 -0
  94. package/lib-amd/components/MenuItem/renderMenuItem.js.map +1 -0
  95. package/lib-amd/components/MenuItem/useCharacterSearch.js +22 -0
  96. package/lib-amd/components/MenuItem/useCharacterSearch.js.map +1 -0
  97. package/lib-amd/components/MenuItem/useMenuItem.js +80 -0
  98. package/lib-amd/components/MenuItem/useMenuItem.js.map +1 -0
  99. package/lib-amd/components/MenuItem/useMenuItemStyles.js +100 -0
  100. package/lib-amd/components/MenuItem/useMenuItemStyles.js.map +1 -0
  101. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.js +15 -0
  102. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -0
  103. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.types.js +5 -0
  104. package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -0
  105. package/lib-amd/components/MenuItemCheckbox/index.js +10 -0
  106. package/lib-amd/components/MenuItemCheckbox/index.js.map +1 -0
  107. package/lib-amd/components/MenuItemCheckbox/renderMenuItemCheckbox.js +16 -0
  108. package/lib-amd/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -0
  109. package/lib-amd/components/MenuItemCheckbox/useMenuItemCheckbox.js +26 -0
  110. package/lib-amd/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -0
  111. package/lib-amd/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +31 -0
  112. package/lib-amd/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -0
  113. package/lib-amd/components/MenuItemRadio/MenuItemRadio.js +15 -0
  114. package/lib-amd/components/MenuItemRadio/MenuItemRadio.js.map +1 -0
  115. package/lib-amd/components/MenuItemRadio/MenuItemRadio.types.js +5 -0
  116. package/lib-amd/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -0
  117. package/lib-amd/components/MenuItemRadio/index.js +10 -0
  118. package/lib-amd/components/MenuItemRadio/index.js.map +1 -0
  119. package/lib-amd/components/MenuItemRadio/renderMenuItemRadio.js +19 -0
  120. package/lib-amd/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -0
  121. package/lib-amd/components/MenuItemRadio/useMenuItemRadio.js +27 -0
  122. package/lib-amd/components/MenuItemRadio/useMenuItemRadio.js.map +1 -0
  123. package/lib-amd/components/MenuItemRadio/useMenuItemRadioStyles.js +31 -0
  124. package/lib-amd/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -0
  125. package/lib-amd/components/MenuList/MenuList.js +16 -0
  126. package/lib-amd/components/MenuList/MenuList.js.map +1 -0
  127. package/lib-amd/components/MenuList/MenuList.types.js +5 -0
  128. package/lib-amd/components/MenuList/MenuList.types.js.map +1 -0
  129. package/lib-amd/components/MenuList/index.js +11 -0
  130. package/lib-amd/components/MenuList/index.js.map +1 -0
  131. package/lib-amd/components/MenuList/renderMenuList.js +15 -0
  132. package/lib-amd/components/MenuList/renderMenuList.js.map +1 -0
  133. package/lib-amd/components/MenuList/useMenuList.js +119 -0
  134. package/lib-amd/components/MenuList/useMenuList.js.map +1 -0
  135. package/lib-amd/components/MenuList/useMenuListContextValues.js +21 -0
  136. package/lib-amd/components/MenuList/useMenuListContextValues.js.map +1 -0
  137. package/lib-amd/components/MenuList/useMenuListStyles.js +21 -0
  138. package/lib-amd/components/MenuList/useMenuListStyles.js.map +1 -0
  139. package/lib-amd/components/MenuPopover/MenuPopover.js +15 -0
  140. package/lib-amd/components/MenuPopover/MenuPopover.js.map +1 -0
  141. package/lib-amd/components/MenuPopover/MenuPopover.types.js +5 -0
  142. package/lib-amd/components/MenuPopover/MenuPopover.types.js.map +1 -0
  143. package/lib-amd/components/MenuPopover/index.js +10 -0
  144. package/lib-amd/components/MenuPopover/index.js.map +1 -0
  145. package/lib-amd/components/MenuPopover/renderMenuPopover.js +18 -0
  146. package/lib-amd/components/MenuPopover/renderMenuPopover.js.map +1 -0
  147. package/lib-amd/components/MenuPopover/useMenuPopover.js +82 -0
  148. package/lib-amd/components/MenuPopover/useMenuPopover.js.map +1 -0
  149. package/lib-amd/components/MenuPopover/useMenuPopoverStyles.js +21 -0
  150. package/lib-amd/components/MenuPopover/useMenuPopoverStyles.js.map +1 -0
  151. package/lib-amd/components/MenuSplitGroup/MenuSplitGroup.js +15 -0
  152. package/lib-amd/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
  153. package/lib-amd/components/MenuSplitGroup/MenuSplitGroup.types.js +5 -0
  154. package/lib-amd/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
  155. package/lib-amd/components/MenuSplitGroup/index.js +10 -0
  156. package/lib-amd/components/MenuSplitGroup/index.js.map +1 -0
  157. package/lib-amd/components/MenuSplitGroup/renderMenuSplitGroup.js +14 -0
  158. package/lib-amd/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
  159. package/lib-amd/components/MenuSplitGroup/useMenuSplitGroup.js +47 -0
  160. package/lib-amd/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
  161. package/lib-amd/components/MenuSplitGroup/useMenuSplitGroupStyles.js +43 -0
  162. package/lib-amd/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
  163. package/lib-amd/components/MenuTrigger/MenuTrigger.js +18 -0
  164. package/lib-amd/components/MenuTrigger/MenuTrigger.js.map +1 -0
  165. package/lib-amd/components/MenuTrigger/MenuTrigger.types.js +5 -0
  166. package/lib-amd/components/MenuTrigger/MenuTrigger.types.js.map +1 -0
  167. package/lib-amd/components/MenuTrigger/index.js +9 -0
  168. package/lib-amd/components/MenuTrigger/index.js.map +1 -0
  169. package/lib-amd/components/MenuTrigger/renderMenuTrigger.js +15 -0
  170. package/lib-amd/components/MenuTrigger/renderMenuTrigger.js.map +1 -0
  171. package/lib-amd/components/MenuTrigger/useMenuTrigger.js +112 -0
  172. package/lib-amd/components/MenuTrigger/useMenuTrigger.js.map +1 -0
  173. package/lib-amd/components/index.js +7 -0
  174. package/lib-amd/components/index.js.map +1 -0
  175. package/lib-amd/contexts/menuContext.js +32 -0
  176. package/lib-amd/contexts/menuContext.js.map +1 -0
  177. package/lib-amd/contexts/menuGroupContext.js +13 -0
  178. package/lib-amd/contexts/menuGroupContext.js.map +1 -0
  179. package/lib-amd/contexts/menuListContext.js +24 -0
  180. package/lib-amd/contexts/menuListContext.js.map +1 -0
  181. package/lib-amd/contexts/menuTriggerContext.js +14 -0
  182. package/lib-amd/contexts/menuTriggerContext.js.map +1 -0
  183. package/lib-amd/index.js +69 -0
  184. package/lib-amd/index.js.map +1 -0
  185. package/lib-amd/selectable/index.js +7 -0
  186. package/lib-amd/selectable/index.js.map +1 -0
  187. package/lib-amd/selectable/types.js +5 -0
  188. package/lib-amd/selectable/types.js.map +1 -0
  189. package/lib-amd/selectable/useCheckmarkStyles.js +28 -0
  190. package/lib-amd/selectable/useCheckmarkStyles.js.map +1 -0
  191. package/lib-amd/utils/index.js +6 -0
  192. package/lib-amd/utils/index.js.map +1 -0
  193. package/lib-amd/utils/useIsSubmenu.js +20 -0
  194. package/lib-amd/utils/useIsSubmenu.js.map +1 -0
  195. package/lib-amd/utils/useOnMenuEnter.js +59 -0
  196. package/lib-amd/utils/useOnMenuEnter.js.map +1 -0
  197. package/lib-commonjs/components/Menu/useMenu.js +13 -7
  198. package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
  199. package/lib-commonjs/components/MenuItem/useMenuItem.js +3 -1
  200. package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
  201. package/lib-commonjs/components/MenuPopover/useMenuPopover.js +20 -14
  202. package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
  203. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +46 -31
  204. package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
  205. package/lib-commonjs/index.js.map +1 -1
  206. package/package.json +11 -11
@@ -56,52 +56,60 @@ const useMenuTrigger_unstable = props => {
56
56
  const OpenArrowKey = dir === 'ltr' ? keyboard_keys_1.ArrowRight : keyboard_keys_1.ArrowLeft;
57
57
  const child = react_utilities_1.getTriggerChild(children);
58
58
 
59
- const onContextMenu = e => {
60
- if (isTargetDisabled(e)) {
59
+ const onContextMenu = event => {
60
+ if (isTargetDisabled(event)) {
61
61
  return;
62
62
  }
63
63
 
64
64
  if (openOnContext) {
65
- e.preventDefault();
66
- setOpen(e, {
65
+ event.preventDefault();
66
+ setOpen(event, {
67
67
  open: true,
68
- keyboard: false
68
+ keyboard: false,
69
+ type: 'menuTriggerContextMenu',
70
+ event
69
71
  });
70
72
  }
71
73
  };
72
74
 
73
- const onClick = e => {
74
- if (isTargetDisabled(e)) {
75
+ const onClick = event => {
76
+ if (isTargetDisabled(event)) {
75
77
  return;
76
78
  }
77
79
 
78
80
  if (!openOnContext) {
79
- setOpen(e, {
81
+ setOpen(event, {
80
82
  open: !open,
81
- keyboard: openedWithKeyboardRef.current
83
+ keyboard: openedWithKeyboardRef.current,
84
+ type: 'menuTriggerClick',
85
+ event
82
86
  });
83
87
  openedWithKeyboardRef.current = false;
84
88
  }
85
89
  };
86
90
 
87
- const onKeyDown = e => {
88
- if (isTargetDisabled(e)) {
91
+ const onKeyDown = event => {
92
+ if (isTargetDisabled(event)) {
89
93
  return;
90
94
  }
91
95
 
92
- const key = e.key;
96
+ const key = event.key;
93
97
 
94
98
  if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === keyboard_keys_1.ArrowDown)) {
95
- setOpen(e, {
99
+ setOpen(event, {
96
100
  open: true,
97
- keyboard: true
101
+ keyboard: true,
102
+ type: 'menuTriggerKeyDown',
103
+ event
98
104
  });
99
105
  }
100
106
 
101
107
  if (key === keyboard_keys_1.Escape && !isSubmenu) {
102
- setOpen(e, {
108
+ setOpen(event, {
103
109
  open: false,
104
- keyboard: true
110
+ keyboard: true,
111
+ type: 'menuTriggerKeyDown',
112
+ event
105
113
  });
106
114
  } // if menu is already open, can't rely on effects to focus
107
115
 
@@ -111,15 +119,17 @@ const useMenuTrigger_unstable = props => {
111
119
  }
112
120
  };
113
121
 
114
- const onMouseEnter = e => {
115
- if (isTargetDisabled(e)) {
122
+ const onMouseEnter = event => {
123
+ if (isTargetDisabled(event)) {
116
124
  return;
117
125
  }
118
126
 
119
127
  if (openOnHover && hasMouseMoved.current) {
120
- setOpen(e, {
128
+ setOpen(event, {
121
129
  open: true,
122
- keyboard: false
130
+ keyboard: false,
131
+ type: 'menuTriggerMouseEnter',
132
+ event
123
133
  });
124
134
  }
125
135
  }; // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience
@@ -127,36 +137,38 @@ const useMenuTrigger_unstable = props => {
127
137
  // Only use once to determine that the user is using the mouse since it is an expensive event to handle
128
138
 
129
139
 
130
- const onMouseMove = e => {
131
- if (isTargetDisabled(e)) {
140
+ const onMouseMove = event => {
141
+ if (isTargetDisabled(event)) {
132
142
  return;
133
143
  }
134
144
 
135
145
  if (openOnHover && !hasMouseMoved.current) {
136
- setOpen(e, {
146
+ setOpen(event, {
137
147
  open: true,
138
- keyboard: false
148
+ keyboard: false,
149
+ type: 'menuTriggerMouseMove',
150
+ event
139
151
  });
140
152
  hasMouseMoved.current = true;
141
153
  }
142
154
  };
143
155
 
144
- const onMouseLeave = e => {
145
- if (isTargetDisabled(e)) {
156
+ const onMouseLeave = event => {
157
+ if (isTargetDisabled(event)) {
146
158
  return;
147
159
  }
148
160
 
149
161
  if (openOnHover) {
150
- setOpen(e, {
162
+ setOpen(event, {
151
163
  open: false,
152
- keyboard: false
164
+ keyboard: false,
165
+ type: 'menuTriggerMouseLeave',
166
+ event
153
167
  });
154
168
  }
155
169
  };
156
170
 
157
171
  const contextMenuProps = {
158
- 'aria-haspopup': 'menu',
159
- 'aria-expanded': !open && !isSubmenu ? undefined : open,
160
172
  id: triggerId,
161
173
  ...(child === null || child === void 0 ? void 0 : child.props),
162
174
  ref: react_utilities_1.useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref),
@@ -165,7 +177,10 @@ const useMenuTrigger_unstable = props => {
165
177
  onContextMenu: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onContextMenu, onContextMenu)),
166
178
  onMouseMove: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseMove, onMouseMove))
167
179
  };
168
- const triggerChildProps = { ...contextMenuProps,
180
+ const triggerChildProps = {
181
+ 'aria-haspopup': 'menu',
182
+ 'aria-expanded': !open && !isSubmenu ? undefined : open,
183
+ ...contextMenuProps,
169
184
  onClick: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onClick, onClick)),
170
185
  onKeyDown: react_utilities_1.useEventCallback(react_utilities_1.mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onKeyDown, onKeyDown))
171
186
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-menu/src/components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAEA,MAAA,aAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAOA,MAAA,YAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;AAEA;;;;;AAKG;;;AACI,MAAM,uBAAuB,GAAI,KAAD,IAA8C;EACnF,MAAM;IAAE,QAAF;IAAY,wBAAwB,GAAG;EAAvC,IAAiD,KAAvD;EAEA,MAAM,UAAU,GAAG,aAAA,CAAA,uBAAA,CAAwB,OAAO,IAAI,OAAO,CAAC,UAA3C,CAAnB;EACA,MAAM,cAAc,GAAG,aAAA,CAAA,uB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GAAG,YAAA,CAAA,kBAAA,CAClC,CAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,IAAP,MAAgB,QAAhB,IAA4B,CAAA,KAAK,KAAA,IAAL,IAAA,KAAK,KAAA,KAAA,CAAL,GAAK,KAAA,CAAL,GAAA,KAAK,CAAE,IAAP,MAAgB,GAA5C,GAAkD,KAAK,CAAC,IAAxD,GAA+D,KAD7B,EAElC,iBAFkC,CAApC;EAKA,OAAO;IACL,SADK;IAEL,QAAQ,EAAE,iBAAA,CAAA,2BAAA,CACR,QADQ,EAER,aAAa,GAAG,gBAAH,GAAsB,wBAAwB,GAAG,iBAAH,GAAuB,2BAF1E;EAFL,CAAP;AAOD,CAnIM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB;;AAqIb,MAAM,gBAAgB,GAAI,CAAD,IAAoC;EAC3D,MAAM,UAAU,GAAI,EAAD,IACjB,EAAE,CAAC,YAAH,CAAgB,UAAhB,KAAgC,EAAE,CAAC,YAAH,CAAgB,eAAhB,KAAoC,EAAE,CAAC,YAAH,CAAgB,eAAhB,MAAqC,MAD3G;;EAEA,IAAI,CAAC,CAAC,MAAF,YAAoB,WAApB,IAAmC,UAAU,CAAC,CAAC,CAAC,MAAH,CAAjD,EAA6D;IAC3D,OAAO,IAAP;EACD;;EAED,OAAO,CAAC,CAAC,aAAF,YAA2B,WAA3B,IAA0C,UAAU,CAAC,CAAC,CAAC,aAAH,CAA3D;AACD,CARD","sourcesContent":["import * as React from 'react';\nimport { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n mergeCallbacks,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\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_unstable = (props: MenuTriggerProps): MenuTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n\n const triggerRef = useMenuContext_unstable(context => context.triggerRef);\n const menuPopoverRef = useMenuContext_unstable(context => context.menuPopoverRef);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n const open = useMenuContext_unstable(context => context.open);\n const triggerId = useMenuContext_unstable(context => context.triggerId);\n const openOnHover = useMenuContext_unstable(context => context.openOnHover);\n const openOnContext = useMenuContext_unstable(context => context.openOnContext);\n\n const isSubmenu = useIsSubmenu();\n\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 = getTriggerChild(children);\n\n const onContextMenu = (e: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(e)) {\n return;\n }\n\n if (openOnContext) {\n e.preventDefault();\n setOpen(e, { open: true, keyboard: false });\n }\n };\n\n const onClick = (e: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(e)) {\n return;\n }\n\n if (!openOnContext) {\n setOpen(e, { open: !open, keyboard: openedWithKeyboardRef.current });\n openedWithKeyboardRef.current = false;\n }\n };\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(e)) {\n return;\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\n const onMouseEnter = (e: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(e)) {\n return;\n }\n if (openOnHover && hasMouseMoved.current) {\n setOpen(e, { open: true, keyboard: false });\n }\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 = (e: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(e)) {\n return;\n }\n if (openOnHover && !hasMouseMoved.current) {\n setOpen(e, { open: true, keyboard: false });\n hasMouseMoved.current = true;\n }\n };\n\n const onMouseLeave = (e: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(e)) {\n return;\n }\n if (openOnHover) {\n setOpen(e, { open: false, keyboard: false });\n }\n };\n\n const contextMenuProps = {\n 'aria-haspopup': 'menu',\n 'aria-expanded': !open && !isSubmenu ? undefined : open,\n id: triggerId,\n ...child?.props,\n ref: useMergedRefs(triggerRef, child?.ref),\n onMouseEnter: useEventCallback(mergeCallbacks(child?.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks(child?.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child?.props.onContextMenu, onContextMenu)),\n onMouseMove: useEventCallback(mergeCallbacks(child?.props.onMouseMove, onMouseMove)),\n } as const;\n\n const triggerChildProps = {\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks(child?.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child?.props.onKeyDown, onKeyDown)),\n };\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n triggerChildProps,\n );\n\n return {\n isSubmenu,\n children: applyTriggerPropsToChildren(\n children,\n openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n\nconst isTargetDisabled = (e: React.SyntheticEvent | Event) => {\n const isDisabled = (el: HTMLElement) =>\n el.hasAttribute('disabled') || (el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true');\n if (e.target instanceof HTMLElement && isDisabled(e.target)) {\n return true;\n }\n\n return e.currentTarget instanceof HTMLElement && isDisabled(e.currentTarget);\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-menu/src/components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAEA,MAAA,aAAA,gBAAA,OAAA,CAAA,4BAAA,CAAA;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAOA,MAAA,YAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;AAEA;;;;;AAKG;;;AACI,MAAM,uBAAuB,GAAI,KAAD,IAA8C;EACnF,MAAM;IAAE,QAAF;IAAY,wBAAwB,GAAG;EAAvC,IAAiD,KAAvD;EAEA,MAAM,UAAU,GAAG,aAAA,CAAA,uBAAA,C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ACD;;EAED,OAAO,CAAC,CAAC,aAAF,YAA2B,WAA3B,IAA0C,UAAU,CAAC,CAAC,CAAC,aAAH,CAA3D;AACD,CARD","sourcesContent":["import * as React from 'react';\nimport { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n mergeCallbacks,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\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_unstable = (props: MenuTriggerProps): MenuTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n\n const triggerRef = useMenuContext_unstable(context => context.triggerRef);\n const menuPopoverRef = useMenuContext_unstable(context => context.menuPopoverRef);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n const open = useMenuContext_unstable(context => context.open);\n const triggerId = useMenuContext_unstable(context => context.triggerId);\n const openOnHover = useMenuContext_unstable(context => context.openOnHover);\n const openOnContext = useMenuContext_unstable(context => context.openOnContext);\n\n const isSubmenu = useIsSubmenu();\n\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 = getTriggerChild(children);\n\n const onContextMenu = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n if (openOnContext) {\n event.preventDefault();\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerContextMenu', event });\n }\n };\n\n const onClick = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n if (!openOnContext) {\n setOpen(event, { open: !open, keyboard: openedWithKeyboardRef.current, type: 'menuTriggerClick', event });\n openedWithKeyboardRef.current = false;\n }\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n const key = event.key;\n\n if (!openOnContext && ((isSubmenu && key === OpenArrowKey) || (!isSubmenu && key === ArrowDown))) {\n setOpen(event, { open: true, keyboard: true, type: 'menuTriggerKeyDown', event });\n }\n\n if (key === Escape && !isSubmenu) {\n setOpen(event, { open: false, keyboard: true, type: 'menuTriggerKeyDown', event });\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\n const onMouseEnter = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && hasMouseMoved.current) {\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerMouseEnter', event });\n }\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 = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && !hasMouseMoved.current) {\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerMouseMove', event });\n hasMouseMoved.current = true;\n }\n };\n\n const onMouseLeave = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover) {\n setOpen(event, { open: false, keyboard: false, type: 'menuTriggerMouseLeave', event });\n }\n };\n\n const contextMenuProps = {\n id: triggerId,\n ...child?.props,\n ref: useMergedRefs(triggerRef, child?.ref),\n onMouseEnter: useEventCallback(mergeCallbacks(child?.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks(child?.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child?.props.onContextMenu, onContextMenu)),\n onMouseMove: useEventCallback(mergeCallbacks(child?.props.onMouseMove, onMouseMove)),\n };\n\n const triggerChildProps = {\n 'aria-haspopup': 'menu',\n 'aria-expanded': !open && !isSubmenu ? undefined : open,\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks(child?.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child?.props.onKeyDown, onKeyDown)),\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n triggerChildProps,\n );\n\n return {\n isSubmenu,\n children: applyTriggerPropsToChildren(\n children,\n openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n\nconst isTargetDisabled = (e: React.SyntheticEvent | Event) => {\n const isDisabled = (el: HTMLElement) =>\n el.hasAttribute('disabled') || (el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true');\n if (e.target instanceof HTMLElement && isDisabled(e.target)) {\n return true;\n }\n\n return e.currentTarget instanceof HTMLElement && isDisabled(e.currentTarget);\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-menu/src/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,IAAA,aAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;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AA,OAAA,EAAA,aAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,aAAA,CAAA,WAAA;EAAW;AAAX,CAAA;AAAa,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,4BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,aAAA,CAAA,0BAAA;EAA0B;AAA1B,CAAA;AAA4B,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,aAAA,CAAA,uBAAA;EAAuB;AAAvB,CAAA;;AAGlD,IAAA,OAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,6BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,2BAAA;EAA2B;AAA3B,CAAA","sourcesContent":["export { MenuProvider, useMenuContext_unstable } from './contexts/menuContext';\nexport type { MenuContextValue } from './contexts/menuContext';\nexport { MenuTriggerContextProvider, useMenuTriggerContext_unstable } from './contexts/menuTriggerContext';\nexport { MenuGroupContextProvider, useMenuGroupContext_unstable } from './contexts/menuGroupContext';\nexport type { MenuGroupContextValue } from './contexts/menuGroupContext';\nexport { MenuListProvider, useMenuListContext_unstable } from './contexts/menuListContext';\nexport type { MenuListContextValue } from './contexts/menuListContext';\n\nexport { Menu, renderMenu_unstable, useMenuContextValues_unstable, useMenu_unstable } from './Menu';\nexport type { MenuContextValues, MenuOpenChangeData, MenuOpenEvents, MenuProps, MenuSlots, MenuState } from './Menu';\nexport {\n MenuDivider,\n menuDividerClassNames,\n renderMenuDivider_unstable,\n useMenuDividerStyles_unstable,\n useMenuDivider_unstable,\n} from './MenuDivider';\nexport type { MenuDividerProps, MenuDividerSlots, MenuDividerState } from './MenuDivider';\nexport {\n MenuGroup,\n menuGroupClassNames,\n renderMenuGroup_unstable,\n useMenuGroupContextValues_unstable,\n useMenuGroupStyles_unstable,\n useMenuGroup_unstable,\n} from './MenuGroup';\nexport type { MenuGroupContextValues, MenuGroupProps, MenuGroupSlots, MenuGroupState } from './MenuGroup';\nexport {\n MenuGroupHeader,\n menuGroupHeaderClassNames,\n renderMenuGroupHeader_unstable,\n useMenuGroupHeaderStyles_unstable,\n useMenuGroupHeader_unstable,\n} from './MenuGroupHeader';\nexport type { MenuGroupHeaderProps, MenuGroupHeaderSlots, MenuGroupHeaderState } from './MenuGroupHeader';\nexport {\n MenuItem,\n menuItemClassNames,\n renderMenuItem_unstable,\n useMenuItemStyles_unstable,\n useMenuItem_unstable,\n} from './MenuItem';\nexport type { MenuItemProps, MenuItemSlots, MenuItemState } from './MenuItem';\nexport {\n MenuItemCheckbox,\n menuItemCheckboxClassNames,\n renderMenuItemCheckbox_unstable,\n useMenuItemCheckboxStyles_unstable,\n useMenuItemCheckbox_unstable,\n} from './MenuItemCheckbox';\nexport type { MenuItemCheckboxProps, MenuItemCheckboxState } from './MenuItemCheckbox';\nexport {\n MenuItemRadio,\n menuItemRadioClassNames,\n renderMenuItemRadio_unstable,\n useMenuItemRadioStyles_unstable,\n useMenuItemRadio_unstable,\n} from './MenuItemRadio';\nexport type { MenuItemRadioProps, MenuItemRadioState } from './MenuItemRadio';\nexport {\n MenuList,\n menuListClassNames,\n renderMenuList_unstable,\n useMenuListContextValues_unstable,\n useMenuListStyles_unstable,\n useMenuList_unstable,\n} from './MenuList';\nexport type {\n MenuCheckedValueChangeData,\n MenuCheckedValueChangeEvent,\n MenuListContextValues,\n MenuListProps,\n MenuListSlots,\n MenuListState,\n UninitializedMenuListState,\n} from './MenuList';\nexport {\n MenuPopover,\n menuPopoverClassNames,\n renderMenuPopover_unstable,\n useMenuPopoverStyles_unstable,\n useMenuPopover_unstable,\n} from './MenuPopover';\nexport type { MenuPopoverProps, MenuPopoverSlots, MenuPopoverState } from './MenuPopover';\nexport {\n MenuSplitGroup,\n menuSplitGroupClassNames,\n renderMenuSplitGroup_unstable,\n useMenuSplitGroupStyles_unstable,\n useMenuSplitGroup_unstable,\n} from './MenuSplitGroup';\nexport type { MenuSplitGroupProps, MenuSplitGroupSlots, MenuSplitGroupState } from './MenuSplitGroup';\nexport { MenuTrigger, renderMenuTrigger_unstable, useMenuTrigger_unstable } from './MenuTrigger';\nexport type { MenuTriggerChildProps, MenuTriggerProps, MenuTriggerState } from './MenuTrigger';\n\nexport { useCheckmarkStyles_unstable } from './selectable/index';\nexport type { MenuItemSelectableProps, MenuItemSelectableState, SelectableHandler } from './selectable/index';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-menu/src/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,IAAA,aAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,cAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,aAAA,CAAA,YAAA;EAAY;AAAZ,CAAA;AAAc,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,aAAA,CAAA,uBAAA;EAAuB;AAAvB,CAAA;;AAEvB,IAAA,oBAAA,gBAAA,OAAA,CAAA,+BAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,4BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,oBAAA,CAAA,0BAAA;EAA0B;AAA1B,CAAA;AAA4B,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gCAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,oBAAA,CAAA,8BAAA;EAA8B;AAA9B,CAAA;;AACrC,I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/menuContext';\nexport type { MenuContextValue } from './contexts/menuContext';\nexport { MenuTriggerContextProvider, useMenuTriggerContext_unstable } from './contexts/menuTriggerContext';\nexport { MenuGroupContextProvider, useMenuGroupContext_unstable } from './contexts/menuGroupContext';\nexport type { MenuGroupContextValue } from './contexts/menuGroupContext';\nexport { MenuListProvider, useMenuListContext_unstable } from './contexts/menuListContext';\nexport type { MenuListContextValue } from './contexts/menuListContext';\n\nexport { Menu, renderMenu_unstable, useMenuContextValues_unstable, useMenu_unstable } from './Menu';\nexport type {\n MenuContextValues,\n MenuOpenChangeData,\n MenuOpenEvent,\n // MenuOpenEvents is deprecated but removing it would be a breaking change\n // eslint-disable-next-line deprecation/deprecation\n MenuOpenEvents,\n MenuProps,\n MenuSlots,\n MenuState,\n} from './Menu';\nexport {\n MenuDivider,\n menuDividerClassNames,\n renderMenuDivider_unstable,\n useMenuDividerStyles_unstable,\n useMenuDivider_unstable,\n} from './MenuDivider';\nexport type { MenuDividerProps, MenuDividerSlots, MenuDividerState } from './MenuDivider';\nexport {\n MenuGroup,\n menuGroupClassNames,\n renderMenuGroup_unstable,\n useMenuGroupContextValues_unstable,\n useMenuGroupStyles_unstable,\n useMenuGroup_unstable,\n} from './MenuGroup';\nexport type { MenuGroupContextValues, MenuGroupProps, MenuGroupSlots, MenuGroupState } from './MenuGroup';\nexport {\n MenuGroupHeader,\n menuGroupHeaderClassNames,\n renderMenuGroupHeader_unstable,\n useMenuGroupHeaderStyles_unstable,\n useMenuGroupHeader_unstable,\n} from './MenuGroupHeader';\nexport type { MenuGroupHeaderProps, MenuGroupHeaderSlots, MenuGroupHeaderState } from './MenuGroupHeader';\nexport {\n MenuItem,\n menuItemClassNames,\n renderMenuItem_unstable,\n useMenuItemStyles_unstable,\n useMenuItem_unstable,\n} from './MenuItem';\nexport type { MenuItemProps, MenuItemSlots, MenuItemState } from './MenuItem';\nexport {\n MenuItemCheckbox,\n menuItemCheckboxClassNames,\n renderMenuItemCheckbox_unstable,\n useMenuItemCheckboxStyles_unstable,\n useMenuItemCheckbox_unstable,\n} from './MenuItemCheckbox';\nexport type { MenuItemCheckboxProps, MenuItemCheckboxState } from './MenuItemCheckbox';\nexport {\n MenuItemRadio,\n menuItemRadioClassNames,\n renderMenuItemRadio_unstable,\n useMenuItemRadioStyles_unstable,\n useMenuItemRadio_unstable,\n} from './MenuItemRadio';\nexport type { MenuItemRadioProps, MenuItemRadioState } from './MenuItemRadio';\nexport {\n MenuList,\n menuListClassNames,\n renderMenuList_unstable,\n useMenuListContextValues_unstable,\n useMenuListStyles_unstable,\n useMenuList_unstable,\n} from './MenuList';\nexport type {\n MenuCheckedValueChangeData,\n MenuCheckedValueChangeEvent,\n MenuListContextValues,\n MenuListProps,\n MenuListSlots,\n MenuListState,\n UninitializedMenuListState,\n} from './MenuList';\nexport {\n MenuPopover,\n menuPopoverClassNames,\n renderMenuPopover_unstable,\n useMenuPopoverStyles_unstable,\n useMenuPopover_unstable,\n} from './MenuPopover';\nexport type { MenuPopoverProps, MenuPopoverSlots, MenuPopoverState } from './MenuPopover';\nexport {\n MenuSplitGroup,\n menuSplitGroupClassNames,\n renderMenuSplitGroup_unstable,\n useMenuSplitGroupStyles_unstable,\n useMenuSplitGroup_unstable,\n} from './MenuSplitGroup';\nexport type { MenuSplitGroupProps, MenuSplitGroupSlots, MenuSplitGroupState } from './MenuSplitGroup';\nexport { MenuTrigger, renderMenuTrigger_unstable, useMenuTrigger_unstable } from './MenuTrigger';\nexport type { MenuTriggerChildProps, MenuTriggerProps, MenuTriggerState } from './MenuTrigger';\n\nexport { useCheckmarkStyles_unstable } from './selectable/index';\nexport type { MenuItemSelectableProps, MenuItemSelectableState, SelectableHandler } from './selectable/index';\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-menu",
3
- "version": "9.4.0",
3
+ "version": "9.5.0",
4
4
  "description": "Fluent UI menu component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -29,20 +29,20 @@
29
29
  "devDependencies": {
30
30
  "@fluentui/eslint-plugin": "*",
31
31
  "@fluentui/react-conformance": "*",
32
- "@fluentui/react-conformance-griffel": "9.0.0-beta.17",
32
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.18",
33
33
  "@fluentui/scripts": "^1.0.0"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui/react-aria": "^9.3.0",
37
- "@fluentui/keyboard-keys": "^9.0.0",
38
- "@fluentui/react-context-selector": "^9.1.0",
36
+ "@fluentui/react-aria": "^9.3.2",
37
+ "@fluentui/keyboard-keys": "^9.0.1",
38
+ "@fluentui/react-context-selector": "^9.1.2",
39
39
  "@fluentui/react-icons": "^2.0.175",
40
- "@fluentui/react-portal": "^9.0.9",
41
- "@fluentui/react-positioning": "^9.3.0",
42
- "@fluentui/react-shared-contexts": "^9.1.0",
43
- "@fluentui/react-tabster": "^9.2.1",
44
- "@fluentui/react-theme": "^9.1.1",
45
- "@fluentui/react-utilities": "^9.2.0",
40
+ "@fluentui/react-portal": "^9.0.11",
41
+ "@fluentui/react-positioning": "^9.3.2",
42
+ "@fluentui/react-shared-contexts": "^9.1.1",
43
+ "@fluentui/react-tabster": "^9.3.1",
44
+ "@fluentui/react-theme": "^9.1.2",
45
+ "@fluentui/react-utilities": "^9.2.2",
46
46
  "@griffel/react": "^1.4.2",
47
47
  "tslib": "^2.1.0"
48
48
  },