@mortenbrudvik/waveui 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (439) hide show
  1. package/README.md +564 -155
  2. package/dist/components/button/Button.cjs +1 -1
  3. package/dist/components/button/Button.cjs.map +1 -1
  4. package/dist/components/button/Button.mjs +36 -35
  5. package/dist/components/button/Button.mjs.map +1 -1
  6. package/dist/components/button/Button.slots.cjs +1 -1
  7. package/dist/components/button/Button.slots.cjs.map +1 -1
  8. package/dist/components/button/Button.slots.mjs +31 -21
  9. package/dist/components/button/Button.slots.mjs.map +1 -1
  10. package/dist/components/button/CompoundButton.cjs +1 -1
  11. package/dist/components/button/CompoundButton.cjs.map +1 -1
  12. package/dist/components/button/CompoundButton.mjs +31 -29
  13. package/dist/components/button/CompoundButton.mjs.map +1 -1
  14. package/dist/components/button/Link.cjs +1 -1
  15. package/dist/components/button/Link.cjs.map +1 -1
  16. package/dist/components/button/Link.mjs +24 -23
  17. package/dist/components/button/Link.mjs.map +1 -1
  18. package/dist/components/button/MenuButton.cjs +1 -1
  19. package/dist/components/button/MenuButton.cjs.map +1 -1
  20. package/dist/components/button/MenuButton.mjs +29 -28
  21. package/dist/components/button/MenuButton.mjs.map +1 -1
  22. package/dist/components/button/SplitButton.cjs +1 -1
  23. package/dist/components/button/SplitButton.cjs.map +1 -1
  24. package/dist/components/button/SplitButton.mjs +46 -45
  25. package/dist/components/button/SplitButton.mjs.map +1 -1
  26. package/dist/components/button/ToggleButton.cjs +1 -1
  27. package/dist/components/button/ToggleButton.cjs.map +1 -1
  28. package/dist/components/button/ToggleButton.mjs +38 -35
  29. package/dist/components/button/ToggleButton.mjs.map +1 -1
  30. package/dist/components/button/Toolbar.cjs +1 -1
  31. package/dist/components/button/Toolbar.cjs.map +1 -1
  32. package/dist/components/button/Toolbar.mjs +43 -42
  33. package/dist/components/button/Toolbar.mjs.map +1 -1
  34. package/dist/components/button/Toolbar.parts.cjs +1 -1
  35. package/dist/components/button/Toolbar.parts.cjs.map +1 -1
  36. package/dist/components/button/Toolbar.parts.mjs +76 -81
  37. package/dist/components/button/Toolbar.parts.mjs.map +1 -1
  38. package/dist/components/data-display/Avatar.cjs +1 -1
  39. package/dist/components/data-display/Avatar.cjs.map +1 -1
  40. package/dist/components/data-display/Avatar.mjs +72 -67
  41. package/dist/components/data-display/Avatar.mjs.map +1 -1
  42. package/dist/components/data-display/AvatarGroup.cjs +1 -1
  43. package/dist/components/data-display/AvatarGroup.cjs.map +1 -1
  44. package/dist/components/data-display/AvatarGroup.mjs +89 -88
  45. package/dist/components/data-display/AvatarGroup.mjs.map +1 -1
  46. package/dist/components/data-display/Badge.cjs +1 -1
  47. package/dist/components/data-display/Badge.cjs.map +1 -1
  48. package/dist/components/data-display/Badge.mjs +17 -16
  49. package/dist/components/data-display/Badge.mjs.map +1 -1
  50. package/dist/components/data-display/CounterBadge.cjs +1 -1
  51. package/dist/components/data-display/CounterBadge.cjs.map +1 -1
  52. package/dist/components/data-display/CounterBadge.mjs +18 -17
  53. package/dist/components/data-display/CounterBadge.mjs.map +1 -1
  54. package/dist/components/data-display/Divider.cjs +1 -1
  55. package/dist/components/data-display/Divider.cjs.map +1 -1
  56. package/dist/components/data-display/Divider.mjs +31 -30
  57. package/dist/components/data-display/Divider.mjs.map +1 -1
  58. package/dist/components/data-display/Image.cjs +1 -1
  59. package/dist/components/data-display/Image.cjs.map +1 -1
  60. package/dist/components/data-display/Image.mjs +16 -15
  61. package/dist/components/data-display/Image.mjs.map +1 -1
  62. package/dist/components/data-display/InfoButton.cjs +2 -0
  63. package/dist/components/data-display/InfoButton.cjs.map +1 -0
  64. package/dist/components/data-display/InfoButton.mjs +173 -0
  65. package/dist/components/data-display/InfoButton.mjs.map +1 -0
  66. package/dist/components/data-display/InfoLabel.cjs +1 -1
  67. package/dist/components/data-display/InfoLabel.cjs.map +1 -1
  68. package/dist/components/data-display/InfoLabel.mjs +36 -92
  69. package/dist/components/data-display/InfoLabel.mjs.map +1 -1
  70. package/dist/components/data-display/List.cjs +1 -1
  71. package/dist/components/data-display/List.cjs.map +1 -1
  72. package/dist/components/data-display/List.mjs +175 -174
  73. package/dist/components/data-display/List.mjs.map +1 -1
  74. package/dist/components/data-display/Persona.cjs +1 -1
  75. package/dist/components/data-display/Persona.cjs.map +1 -1
  76. package/dist/components/data-display/Persona.mjs +31 -29
  77. package/dist/components/data-display/Persona.mjs.map +1 -1
  78. package/dist/components/data-display/PresenceBadge.cjs +1 -1
  79. package/dist/components/data-display/PresenceBadge.cjs.map +1 -1
  80. package/dist/components/data-display/PresenceBadge.mjs +25 -24
  81. package/dist/components/data-display/PresenceBadge.mjs.map +1 -1
  82. package/dist/components/data-display/Tag.cjs +1 -1
  83. package/dist/components/data-display/Tag.cjs.map +1 -1
  84. package/dist/components/data-display/Tag.mjs +87 -82
  85. package/dist/components/data-display/Tag.mjs.map +1 -1
  86. package/dist/components/feedback/MessageBar.cjs +1 -1
  87. package/dist/components/feedback/MessageBar.cjs.map +1 -1
  88. package/dist/components/feedback/MessageBar.mjs +129 -71
  89. package/dist/components/feedback/MessageBar.mjs.map +1 -1
  90. package/dist/components/feedback/MessageBar.parts.cjs +2 -0
  91. package/dist/components/feedback/MessageBar.parts.cjs.map +1 -0
  92. package/dist/components/feedback/MessageBar.parts.mjs +84 -0
  93. package/dist/components/feedback/MessageBar.parts.mjs.map +1 -0
  94. package/dist/components/feedback/MessageBar.reflow.cjs +2 -0
  95. package/dist/components/feedback/MessageBar.reflow.cjs.map +1 -0
  96. package/dist/components/feedback/MessageBar.reflow.mjs +74 -0
  97. package/dist/components/feedback/MessageBar.reflow.mjs.map +1 -0
  98. package/dist/components/feedback/MessageBar.status.cjs +1 -1
  99. package/dist/components/feedback/MessageBar.status.cjs.map +1 -1
  100. package/dist/components/feedback/MessageBar.status.mjs +2 -1
  101. package/dist/components/feedback/MessageBar.status.mjs.map +1 -1
  102. package/dist/components/feedback/ProgressBar.cjs +1 -1
  103. package/dist/components/feedback/ProgressBar.cjs.map +1 -1
  104. package/dist/components/feedback/ProgressBar.mjs +44 -43
  105. package/dist/components/feedback/ProgressBar.mjs.map +1 -1
  106. package/dist/components/feedback/Skeleton.cjs +1 -1
  107. package/dist/components/feedback/Skeleton.cjs.map +1 -1
  108. package/dist/components/feedback/Skeleton.mjs +26 -24
  109. package/dist/components/feedback/Skeleton.mjs.map +1 -1
  110. package/dist/components/feedback/Spinner.cjs +1 -1
  111. package/dist/components/feedback/Spinner.cjs.map +1 -1
  112. package/dist/components/feedback/Spinner.mjs +32 -31
  113. package/dist/components/feedback/Spinner.mjs.map +1 -1
  114. package/dist/components/feedback/Toast.cjs +1 -1
  115. package/dist/components/feedback/Toast.cjs.map +1 -1
  116. package/dist/components/feedback/Toast.context.cjs +2 -0
  117. package/dist/components/feedback/Toast.context.cjs.map +1 -0
  118. package/dist/components/feedback/Toast.context.mjs +23 -0
  119. package/dist/components/feedback/Toast.context.mjs.map +1 -0
  120. package/dist/components/feedback/Toast.mjs +10 -342
  121. package/dist/components/feedback/Toast.mjs.map +1 -1
  122. package/dist/components/feedback/Toast.parts.cjs +2 -0
  123. package/dist/components/feedback/Toast.parts.cjs.map +1 -0
  124. package/dist/components/feedback/Toast.parts.mjs +98 -0
  125. package/dist/components/feedback/Toast.parts.mjs.map +1 -0
  126. package/dist/components/feedback/Toast.root.cjs +2 -0
  127. package/dist/components/feedback/Toast.root.cjs.map +1 -0
  128. package/dist/components/feedback/Toast.root.mjs +109 -0
  129. package/dist/components/feedback/Toast.root.mjs.map +1 -0
  130. package/dist/components/feedback/Toaster.cjs +2 -0
  131. package/dist/components/feedback/Toaster.cjs.map +1 -0
  132. package/dist/components/feedback/Toaster.mjs +564 -0
  133. package/dist/components/feedback/Toaster.mjs.map +1 -0
  134. package/dist/components/input/AlphaSlider.cjs +2 -0
  135. package/dist/components/input/AlphaSlider.cjs.map +1 -0
  136. package/dist/components/input/AlphaSlider.mjs +115 -0
  137. package/dist/components/input/AlphaSlider.mjs.map +1 -0
  138. package/dist/components/input/Checkbox.cjs +1 -1
  139. package/dist/components/input/Checkbox.cjs.map +1 -1
  140. package/dist/components/input/Checkbox.mjs +87 -70
  141. package/dist/components/input/Checkbox.mjs.map +1 -1
  142. package/dist/components/input/ColorArea.cjs +2 -0
  143. package/dist/components/input/ColorArea.cjs.map +1 -0
  144. package/dist/components/input/ColorArea.mjs +204 -0
  145. package/dist/components/input/ColorArea.mjs.map +1 -0
  146. package/dist/components/input/ColorPicker.cjs +5 -5
  147. package/dist/components/input/ColorPicker.cjs.map +1 -1
  148. package/dist/components/input/ColorPicker.mjs +142 -165
  149. package/dist/components/input/ColorPicker.mjs.map +1 -1
  150. package/dist/components/input/ColorPicker.parts.cjs +2 -0
  151. package/dist/components/input/ColorPicker.parts.cjs.map +1 -0
  152. package/dist/components/input/ColorPicker.parts.mjs +192 -0
  153. package/dist/components/input/ColorPicker.parts.mjs.map +1 -0
  154. package/dist/components/input/ColorSlider.cjs +2 -0
  155. package/dist/components/input/ColorSlider.cjs.map +1 -0
  156. package/dist/components/input/ColorSlider.mjs +138 -0
  157. package/dist/components/input/ColorSlider.mjs.map +1 -0
  158. package/dist/components/input/Combobox.cjs +1 -1
  159. package/dist/components/input/Combobox.cjs.map +1 -1
  160. package/dist/components/input/Combobox.expand.cjs +1 -1
  161. package/dist/components/input/Combobox.expand.cjs.map +1 -1
  162. package/dist/components/input/Combobox.expand.mjs +22 -22
  163. package/dist/components/input/Combobox.expand.mjs.map +1 -1
  164. package/dist/components/input/Combobox.mjs +151 -141
  165. package/dist/components/input/Combobox.mjs.map +1 -1
  166. package/dist/components/input/DatePicker.cjs +1 -1
  167. package/dist/components/input/DatePicker.cjs.map +1 -1
  168. package/dist/components/input/DatePicker.mjs +239 -234
  169. package/dist/components/input/DatePicker.mjs.map +1 -1
  170. package/dist/components/input/Dropdown.cjs +1 -1
  171. package/dist/components/input/Dropdown.cjs.map +1 -1
  172. package/dist/components/input/Dropdown.mjs +109 -100
  173. package/dist/components/input/Dropdown.mjs.map +1 -1
  174. package/dist/components/input/Field.cjs +1 -1
  175. package/dist/components/input/Field.cjs.map +1 -1
  176. package/dist/components/input/Field.mjs +139 -105
  177. package/dist/components/input/Field.mjs.map +1 -1
  178. package/dist/components/input/Input.cjs +1 -1
  179. package/dist/components/input/Input.cjs.map +1 -1
  180. package/dist/components/input/Input.mjs +80 -55
  181. package/dist/components/input/Input.mjs.map +1 -1
  182. package/dist/components/input/Label.cjs +1 -1
  183. package/dist/components/input/Label.cjs.map +1 -1
  184. package/dist/components/input/Label.mjs +19 -12
  185. package/dist/components/input/Label.mjs.map +1 -1
  186. package/dist/components/input/Option.cjs +1 -1
  187. package/dist/components/input/Option.cjs.map +1 -1
  188. package/dist/components/input/Option.mjs +100 -98
  189. package/dist/components/input/Option.mjs.map +1 -1
  190. package/dist/components/input/RadioGroup.cjs +1 -1
  191. package/dist/components/input/RadioGroup.cjs.map +1 -1
  192. package/dist/components/input/RadioGroup.mjs +89 -88
  193. package/dist/components/input/RadioGroup.mjs.map +1 -1
  194. package/dist/components/input/Rating.cjs +1 -1
  195. package/dist/components/input/Rating.cjs.map +1 -1
  196. package/dist/components/input/Rating.item.cjs +2 -0
  197. package/dist/components/input/Rating.item.cjs.map +1 -0
  198. package/dist/components/input/Rating.item.mjs +255 -0
  199. package/dist/components/input/Rating.item.mjs.map +1 -0
  200. package/dist/components/input/Rating.mjs +152 -152
  201. package/dist/components/input/Rating.mjs.map +1 -1
  202. package/dist/components/input/SearchBox.cjs +1 -1
  203. package/dist/components/input/SearchBox.cjs.map +1 -1
  204. package/dist/components/input/SearchBox.mjs +162 -132
  205. package/dist/components/input/SearchBox.mjs.map +1 -1
  206. package/dist/components/input/Select.cjs +1 -1
  207. package/dist/components/input/Select.cjs.map +1 -1
  208. package/dist/components/input/Select.mjs +34 -24
  209. package/dist/components/input/Select.mjs.map +1 -1
  210. package/dist/components/input/Slider.cjs +1 -1
  211. package/dist/components/input/Slider.cjs.map +1 -1
  212. package/dist/components/input/Slider.mjs +78 -54
  213. package/dist/components/input/Slider.mjs.map +1 -1
  214. package/dist/components/input/SpinButton.cjs +1 -1
  215. package/dist/components/input/SpinButton.cjs.map +1 -1
  216. package/dist/components/input/SpinButton.mjs +202 -99
  217. package/dist/components/input/SpinButton.mjs.map +1 -1
  218. package/dist/components/input/SwatchPicker.cjs +1 -1
  219. package/dist/components/input/SwatchPicker.cjs.map +1 -1
  220. package/dist/components/input/SwatchPicker.mjs +38 -37
  221. package/dist/components/input/SwatchPicker.mjs.map +1 -1
  222. package/dist/components/input/Switch.cjs +1 -1
  223. package/dist/components/input/Switch.cjs.map +1 -1
  224. package/dist/components/input/Switch.mjs +75 -58
  225. package/dist/components/input/Switch.mjs.map +1 -1
  226. package/dist/components/input/TagPicker.cjs +1 -1
  227. package/dist/components/input/TagPicker.cjs.map +1 -1
  228. package/dist/components/input/TagPicker.mjs +199 -169
  229. package/dist/components/input/TagPicker.mjs.map +1 -1
  230. package/dist/components/input/Textarea.cjs +1 -1
  231. package/dist/components/input/Textarea.cjs.map +1 -1
  232. package/dist/components/input/Textarea.mjs +31 -23
  233. package/dist/components/input/Textarea.mjs.map +1 -1
  234. package/dist/components/input/TimePicker.cjs +1 -1
  235. package/dist/components/input/TimePicker.cjs.map +1 -1
  236. package/dist/components/input/TimePicker.mjs +185 -177
  237. package/dist/components/input/TimePicker.mjs.map +1 -1
  238. package/dist/components/input/colorName.cjs +2 -0
  239. package/dist/components/input/colorName.cjs.map +1 -0
  240. package/dist/components/input/colorName.mjs +30 -0
  241. package/dist/components/input/colorName.mjs.map +1 -0
  242. package/dist/components/input/colorUtils.cjs +1 -1
  243. package/dist/components/input/colorUtils.cjs.map +1 -1
  244. package/dist/components/input/colorUtils.mjs +154 -56
  245. package/dist/components/input/colorUtils.mjs.map +1 -1
  246. package/dist/components/input/fieldLabel.cjs +2 -0
  247. package/dist/components/input/fieldLabel.cjs.map +1 -0
  248. package/dist/components/input/fieldLabel.mjs +17 -0
  249. package/dist/components/input/fieldLabel.mjs.map +1 -0
  250. package/dist/components/input/inputLook.cjs +2 -0
  251. package/dist/components/input/inputLook.cjs.map +1 -0
  252. package/dist/components/input/inputLook.mjs +28 -0
  253. package/dist/components/input/inputLook.mjs.map +1 -0
  254. package/dist/components/input/pickerStyles.cjs +1 -1
  255. package/dist/components/input/pickerStyles.cjs.map +1 -1
  256. package/dist/components/input/pickerStyles.mjs +42 -4
  257. package/dist/components/input/pickerStyles.mjs.map +1 -1
  258. package/dist/components/layout/Accordion.cjs +1 -1
  259. package/dist/components/layout/Accordion.cjs.map +1 -1
  260. package/dist/components/layout/Accordion.mjs +130 -129
  261. package/dist/components/layout/Accordion.mjs.map +1 -1
  262. package/dist/components/layout/Card.cjs +1 -1
  263. package/dist/components/layout/Card.cjs.map +1 -1
  264. package/dist/components/layout/Card.mjs +78 -77
  265. package/dist/components/layout/Card.mjs.map +1 -1
  266. package/dist/components/layout/Carousel.cjs +1 -1
  267. package/dist/components/layout/Carousel.cjs.map +1 -1
  268. package/dist/components/layout/Carousel.mjs +111 -110
  269. package/dist/components/layout/Carousel.mjs.map +1 -1
  270. package/dist/components/layout/Flex.cjs +1 -1
  271. package/dist/components/layout/Flex.cjs.map +1 -1
  272. package/dist/components/layout/Flex.mjs +22 -21
  273. package/dist/components/layout/Flex.mjs.map +1 -1
  274. package/dist/components/layout/Grid.cjs +1 -1
  275. package/dist/components/layout/Grid.cjs.map +1 -1
  276. package/dist/components/layout/Grid.mjs +19 -18
  277. package/dist/components/layout/Grid.mjs.map +1 -1
  278. package/dist/components/layout/Overflow.cjs +1 -1
  279. package/dist/components/layout/Overflow.cjs.map +1 -1
  280. package/dist/components/layout/Overflow.mjs +92 -91
  281. package/dist/components/layout/Overflow.mjs.map +1 -1
  282. package/dist/components/layout/Stack.cjs +1 -1
  283. package/dist/components/layout/Stack.cjs.map +1 -1
  284. package/dist/components/layout/Stack.mjs +14 -13
  285. package/dist/components/layout/Stack.mjs.map +1 -1
  286. package/dist/components/layout/TabList.cjs +1 -1
  287. package/dist/components/layout/TabList.cjs.map +1 -1
  288. package/dist/components/layout/TabList.mjs +118 -117
  289. package/dist/components/layout/TabList.mjs.map +1 -1
  290. package/dist/components/layout/Tree.cjs +1 -1
  291. package/dist/components/layout/Tree.cjs.map +1 -1
  292. package/dist/components/layout/Tree.context.cjs +2 -0
  293. package/dist/components/layout/Tree.context.cjs.map +1 -0
  294. package/dist/components/layout/Tree.context.mjs +33 -0
  295. package/dist/components/layout/Tree.context.mjs.map +1 -0
  296. package/dist/components/layout/Tree.core.cjs +2 -0
  297. package/dist/components/layout/Tree.core.cjs.map +1 -0
  298. package/dist/components/layout/Tree.core.mjs +416 -0
  299. package/dist/components/layout/Tree.core.mjs.map +1 -0
  300. package/dist/components/layout/Tree.itemPersonaLayout.cjs +2 -0
  301. package/dist/components/layout/Tree.itemPersonaLayout.cjs.map +1 -0
  302. package/dist/components/layout/Tree.itemPersonaLayout.mjs +46 -0
  303. package/dist/components/layout/Tree.itemPersonaLayout.mjs.map +1 -0
  304. package/dist/components/layout/Tree.mjs +7 -215
  305. package/dist/components/layout/Tree.mjs.map +1 -1
  306. package/dist/components/layout/Tree.selection.cjs +2 -0
  307. package/dist/components/layout/Tree.selection.cjs.map +1 -0
  308. package/dist/components/layout/Tree.selection.mjs +73 -0
  309. package/dist/components/layout/Tree.selection.mjs.map +1 -0
  310. package/dist/components/navigation/Breadcrumb.cjs +1 -1
  311. package/dist/components/navigation/Breadcrumb.cjs.map +1 -1
  312. package/dist/components/navigation/Breadcrumb.mjs +76 -75
  313. package/dist/components/navigation/Breadcrumb.mjs.map +1 -1
  314. package/dist/components/navigation/Menu.group.cjs +1 -1
  315. package/dist/components/navigation/Menu.group.cjs.map +1 -1
  316. package/dist/components/navigation/Menu.group.mjs +39 -37
  317. package/dist/components/navigation/Menu.group.mjs.map +1 -1
  318. package/dist/components/navigation/Menu.items.cjs +1 -1
  319. package/dist/components/navigation/Menu.items.cjs.map +1 -1
  320. package/dist/components/navigation/Menu.items.mjs +67 -61
  321. package/dist/components/navigation/Menu.items.mjs.map +1 -1
  322. package/dist/components/navigation/Menu.link.cjs +1 -1
  323. package/dist/components/navigation/Menu.link.cjs.map +1 -1
  324. package/dist/components/navigation/Menu.link.mjs +34 -28
  325. package/dist/components/navigation/Menu.link.mjs.map +1 -1
  326. package/dist/components/navigation/Menu.popover.cjs +1 -1
  327. package/dist/components/navigation/Menu.popover.cjs.map +1 -1
  328. package/dist/components/navigation/Menu.popover.mjs +114 -113
  329. package/dist/components/navigation/Menu.popover.mjs.map +1 -1
  330. package/dist/components/navigation/Menu.root.cjs +1 -1
  331. package/dist/components/navigation/Menu.root.cjs.map +1 -1
  332. package/dist/components/navigation/Menu.root.mjs +171 -170
  333. package/dist/components/navigation/Menu.root.mjs.map +1 -1
  334. package/dist/components/navigation/Menu.selectable.cjs +1 -1
  335. package/dist/components/navigation/Menu.selectable.cjs.map +1 -1
  336. package/dist/components/navigation/Menu.selectable.mjs +85 -63
  337. package/dist/components/navigation/Menu.selectable.mjs.map +1 -1
  338. package/dist/components/navigation/Menu.splitGroup.cjs +1 -1
  339. package/dist/components/navigation/Menu.splitGroup.cjs.map +1 -1
  340. package/dist/components/navigation/Menu.splitGroup.mjs +27 -26
  341. package/dist/components/navigation/Menu.splitGroup.mjs.map +1 -1
  342. package/dist/components/navigation/Menu.trigger.cjs +1 -1
  343. package/dist/components/navigation/Menu.trigger.cjs.map +1 -1
  344. package/dist/components/navigation/Menu.trigger.mjs +6 -6
  345. package/dist/components/navigation/Nav.cjs +1 -1
  346. package/dist/components/navigation/Nav.cjs.map +1 -1
  347. package/dist/components/navigation/Nav.mjs +170 -155
  348. package/dist/components/navigation/Nav.mjs.map +1 -1
  349. package/dist/components/navigation/Pagination.cjs +1 -1
  350. package/dist/components/navigation/Pagination.cjs.map +1 -1
  351. package/dist/components/navigation/Pagination.mjs +73 -65
  352. package/dist/components/navigation/Pagination.mjs.map +1 -1
  353. package/dist/components/navigation/Stepper.cjs +1 -1
  354. package/dist/components/navigation/Stepper.cjs.map +1 -1
  355. package/dist/components/navigation/Stepper.mjs +110 -109
  356. package/dist/components/navigation/Stepper.mjs.map +1 -1
  357. package/dist/components/overlays/Dialog.cjs +1 -1
  358. package/dist/components/overlays/Dialog.cjs.map +1 -1
  359. package/dist/components/overlays/Dialog.mjs +109 -108
  360. package/dist/components/overlays/Dialog.mjs.map +1 -1
  361. package/dist/components/overlays/Drawer.cjs +1 -1
  362. package/dist/components/overlays/Drawer.cjs.map +1 -1
  363. package/dist/components/overlays/Drawer.mjs +110 -109
  364. package/dist/components/overlays/Drawer.mjs.map +1 -1
  365. package/dist/components/overlays/Popover.cjs +1 -1
  366. package/dist/components/overlays/Popover.cjs.map +1 -1
  367. package/dist/components/overlays/Popover.mjs +148 -151
  368. package/dist/components/overlays/Popover.mjs.map +1 -1
  369. package/dist/components/overlays/Popover.shared.cjs +1 -1
  370. package/dist/components/overlays/Popover.shared.cjs.map +1 -1
  371. package/dist/components/overlays/Popover.shared.mjs +82 -77
  372. package/dist/components/overlays/Popover.shared.mjs.map +1 -1
  373. package/dist/components/overlays/TeachingPopover.cjs +1 -1
  374. package/dist/components/overlays/TeachingPopover.cjs.map +1 -1
  375. package/dist/components/overlays/TeachingPopover.mjs +41 -37
  376. package/dist/components/overlays/TeachingPopover.mjs.map +1 -1
  377. package/dist/components/overlays/Tooltip.cjs +1 -1
  378. package/dist/components/overlays/Tooltip.cjs.map +1 -1
  379. package/dist/components/overlays/Tooltip.mjs +87 -86
  380. package/dist/components/overlays/Tooltip.mjs.map +1 -1
  381. package/dist/components/portal/Portal.cjs +1 -1
  382. package/dist/components/portal/Portal.cjs.map +1 -1
  383. package/dist/components/portal/Portal.mjs +33 -32
  384. package/dist/components/portal/Portal.mjs.map +1 -1
  385. package/dist/components/provider/WaveProvider.cjs +1 -1
  386. package/dist/components/provider/WaveProvider.cjs.map +1 -1
  387. package/dist/components/provider/WaveProvider.mjs +36 -29
  388. package/dist/components/provider/WaveProvider.mjs.map +1 -1
  389. package/dist/components/table/DataGrid.cjs +1 -1
  390. package/dist/components/table/DataGrid.cjs.map +1 -1
  391. package/dist/components/table/DataGrid.mjs +228 -227
  392. package/dist/components/table/DataGrid.mjs.map +1 -1
  393. package/dist/components/table/Table.cjs +1 -1
  394. package/dist/components/table/Table.cjs.map +1 -1
  395. package/dist/components/table/Table.mjs +60 -59
  396. package/dist/components/table/Table.mjs.map +1 -1
  397. package/dist/components/typography/Text.cjs +1 -1
  398. package/dist/components/typography/Text.cjs.map +1 -1
  399. package/dist/components/typography/Text.mjs +12 -11
  400. package/dist/components/typography/Text.mjs.map +1 -1
  401. package/dist/hooks/useFieldControl.cjs.map +1 -1
  402. package/dist/hooks/useFieldControl.mjs.map +1 -1
  403. package/dist/hooks/useMediaQuery.cjs +2 -0
  404. package/dist/hooks/useMediaQuery.cjs.map +1 -0
  405. package/dist/hooks/useMediaQuery.mjs +20 -0
  406. package/dist/hooks/useMediaQuery.mjs.map +1 -0
  407. package/dist/hooks/usePrefersReducedMotion.cjs +1 -1
  408. package/dist/hooks/usePrefersReducedMotion.cjs.map +1 -1
  409. package/dist/hooks/usePrefersReducedMotion.mjs +4 -18
  410. package/dist/hooks/usePrefersReducedMotion.mjs.map +1 -1
  411. package/dist/hooks/useRovingTabIndex.cjs +1 -1
  412. package/dist/hooks/useRovingTabIndex.cjs.map +1 -1
  413. package/dist/hooks/useRovingTabIndex.mjs +3 -3
  414. package/dist/hooks/useRovingTabIndex.mjs.map +1 -1
  415. package/dist/index.cjs +1 -1
  416. package/dist/index.d.cts +2890 -197
  417. package/dist/index.d.ts +2890 -197
  418. package/dist/index.mjs +101 -87
  419. package/dist/lib/classNames.cjs +2 -0
  420. package/dist/lib/classNames.cjs.map +1 -0
  421. package/dist/lib/classNames.mjs +423 -0
  422. package/dist/lib/classNames.mjs.map +1 -0
  423. package/dist/lib/color.cjs +2 -0
  424. package/dist/lib/color.cjs.map +1 -0
  425. package/dist/lib/color.mjs +86 -0
  426. package/dist/lib/color.mjs.map +1 -0
  427. package/dist/lib/globalRegistry.cjs.map +1 -1
  428. package/dist/lib/globalRegistry.mjs.map +1 -1
  429. package/dist/lib/styles.cjs +1 -1
  430. package/dist/lib/styles.cjs.map +1 -1
  431. package/dist/lib/styles.mjs +21 -4
  432. package/dist/lib/styles.mjs.map +1 -1
  433. package/dist/lib/toaster.cjs +2 -0
  434. package/dist/lib/toaster.cjs.map +1 -0
  435. package/dist/lib/toaster.mjs +77 -0
  436. package/dist/lib/toaster.mjs.map +1 -0
  437. package/dist/styles.css +1 -1
  438. package/package.json +1 -1
  439. package/src/styles/tokens.css +13 -0
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("./Menu.shared.cjs"),r=require("./Menu.items.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o=e=>{let{as:i,icon:o,shortcut:s,disabled:c=!1,children:l,className:u,onClick:d,onKeyDown:f,ref:p,...m}=e,h=i??`a`;r.useMenuItemPlacementWarning(`Menu.ItemLink`);let g=r.useMenuItemActivation({disabled:c,persistOnClick:!1,onClick:d,onKeyDown:f,nativeEnter:!0}),_=typeof l==`string`?l:void 0,v=m[`data-roving-text`]!==void 0,y=c&&typeof h==`string`?{href:void 0}:null;return(0,a.jsx)(h,{role:`menuitem`,"data-roving-text":_,...m,...y,ref:p,"aria-disabled":c?!0:m[`aria-disabled`],"data-disabled":c?``:void 0,onClick:g.onClick,onKeyDown:g.onKeyDown,className:t.cn(n.menuItemClasses,`text-foreground no-underline`,u),children:(0,a.jsx)(r.MenuItemRow,{icon:o,label:l,shortcut:s,markLabel:!v})})};o.displayName=`MenuItemLink`,exports.MenuItemLink=o;
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/classNames.cjs"),r=require("./Menu.shared.cjs"),i=require("./Menu.items.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=e=>{let{as:a,icon:s,shortcut:c,disabled:l=!1,children:u,className:d,onClick:f,onKeyDown:p,ref:m,...h}=e,g=a??`a`;i.useMenuItemPlacementWarning(`Menu.ItemLink`);let _=i.useMenuItemActivation({disabled:l,persistOnClick:!1,onClick:f,onKeyDown:p,nativeEnter:!0}),v=typeof u==`string`?u:void 0,y=h[`data-roving-text`]!==void 0,b=l&&typeof g==`string`?{href:void 0}:null;return(0,o.jsx)(g,{role:`menuitem`,"data-roving-text":v,...h,...b,ref:m,"aria-disabled":l?!0:h[`aria-disabled`],"data-disabled":l?``:void 0,onClick:_.onClick,onKeyDown:_.onKeyDown,className:t.cn(n.menuItemClassNames.root,n.menuItemLinkClassNames.root,r.menuItemClasses,`text-foreground no-underline`,d),children:(0,o.jsx)(i.MenuItemRow,{icon:s,label:u,shortcut:c,markLabel:!y,partClassNames:{icon:t.cn(n.menuItemClassNames.icon,n.menuItemLinkClassNames.icon),content:t.cn(n.menuItemClassNames.content,n.menuItemLinkClassNames.content),shortcut:t.cn(n.menuItemClassNames.shortcut,n.menuItemLinkClassNames.shortcut)}})})};s.displayName=`MenuItemLink`,exports.MenuItemLink=s;
2
2
  //# sourceMappingURL=Menu.link.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.link.cjs","names":["useMenuItemActivation","cn","menuItemClasses","MenuItemRow","require_runtime","require_cn","require_Menu_shared","require_Menu_items","react","react_jsx_runtime","MenuItemLink","rest","props","Component","as","activation","stringLabel","children","ownRovingText","disabledHref","disabled","className"],"sources":["../../../src/components/navigation/Menu.link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport type { PolymorphicComponent, PolymorphicProps } from '../../lib/polymorphic';\nimport type { Slot } from '../../lib/types';\nimport { MenuItemRow, useMenuItemActivation, useMenuItemPlacementWarning } from './Menu.items';\nimport { menuItemClasses } from './Menu.shared';\n\n/** The MenuItemLink's own props (the XOwnProps rule: component-specific props only). */\nexport interface MenuItemLinkOwnProps {\n /** Icon before the label (decorative); the rules of `Menu.Item.icon`. */\n icon?: Slot<'span'>;\n /** Keyboard shortcut text at the end of the item; the rules of `Menu.Item.shortcut`. */\n shortcut?: string;\n /**\n * Unavailable: `aria-disabled`, skipped by the arrow keys, never activated, and its click is\n * cancelled (`preventDefault()`, which router links respect). On the default `'a'` the `href`\n * is removed too, so it cannot navigate at all; with `as` (a router link) the component's own\n * `to` still renders an `href`, so middle click or \"open in new tab\" can still follow it:\n * render a disabled router link without its target.\n * @default false\n */\n disabled?: boolean;\n /** Label of the link. */\n children: React.ReactNode;\n}\n\n/** Props of {@link MenuItemLink} rendered as `C` (default `'a'`, or a router link component). */\nexport type MenuItemLinkProps<C extends React.ElementType = 'a'> = PolymorphicProps<\n C,\n MenuItemLinkOwnProps\n>;\n\n/** The props the implementation reads, for any `as`. */\ntype MenuItemLinkImplProps = MenuItemLinkOwnProps &\n Omit<React.HTMLAttributes<HTMLElement>, 'onClick' | 'onKeyDown' | 'children'> & {\n as?: React.ElementType;\n ref?: React.Ref<HTMLElement>;\n onClick?: React.MouseEventHandler<HTMLElement>;\n onKeyDown?: React.KeyboardEventHandler<HTMLElement>;\n };\n\n/**\n * A menu item that navigates (`role=\"menuitem\"` on the link element). Enter follows the link the\n * way the browser does (Shift+Enter, Ctrl+Enter and Cmd+Enter open a new window or tab), Space\n * follows it too, and every click follows it and closes a popup menu (focus returns to the\n * trigger first), a Ctrl- or Cmd-click that opens a new tab included; the Menu's\n * `persistOnItemClick` does not keep it open. Middle click and the browser's link context menu\n * keep working and close nothing. A consumer `onClick` that calls `preventDefault()` cancels the\n * navigation and keeps the menu open. In a static menu a click navigates and closes nothing. In\n * forced colors the browser draws the text in its link color (`LinkText`). Typeahead matches the\n * label (`children`). `as` takes a router link component, which must forward `ref` and spread its\n * props onto the anchor.\n *\n * Also exported as `MenuItemLink` (import the flat name from React Server Components).\n *\n * @example\n * <Menu.ItemLink href=\"/settings\">Settings</Menu.ItemLink>\n * <Menu.ItemLink as={RouterLink} to=\"/billing\">Billing</Menu.ItemLink>\n */\nexport const MenuItemLink: PolymorphicComponent<'a', MenuItemLinkOwnProps> = (props) => {\n const {\n as,\n icon,\n shortcut,\n disabled = false,\n children,\n className,\n onClick,\n onKeyDown,\n ref,\n ...rest\n } = props as MenuItemLinkImplProps;\n const Component: React.ElementType = as ?? 'a';\n useMenuItemPlacementWarning('Menu.ItemLink');\n\n // Enter is the browser's (a link keeps Shift, Ctrl and Meta for a new window or tab); Space\n // clicks it. Every activation closes the popup menu: a navigation ends the menu's job.\n const activation = useMenuItemActivation({\n disabled,\n persistOnClick: false,\n onClick,\n onKeyDown,\n nativeEnter: true,\n });\n\n // Typeahead text: a string label directly; any other label through its marked element.\n const stringLabel = typeof children === 'string' ? children : undefined;\n const ownRovingText = (rest as Record<string, unknown>)['data-roving-text'] !== undefined;\n // A disabled element link cannot navigate at all (middle click, \"open in new tab\" included); a\n // router link keeps what its own props render, and its prevented click stops it.\n const disabledHref = disabled && typeof Component === 'string' ? { href: undefined } : null;\n\n return (\n <Component\n role=\"menuitem\"\n data-roving-text={stringLabel}\n {...rest}\n {...disabledHref}\n ref={ref}\n aria-disabled={disabled ? true : rest['aria-disabled']}\n data-disabled={disabled ? '' : undefined}\n onClick={activation.onClick}\n onKeyDown={activation.onKeyDown}\n className={cn(menuItemClasses, 'text-foreground no-underline', className)}\n >\n <MenuItemRow icon={icon} label={children} shortcut={shortcut} markLabel={!ownRovingText} />\n </Component>\n );\n};\nMenuItemLink.displayName = 'MenuItemLink';\n"],"mappings":"2OA2DA,IAAaU,EAAiE,GAAU,CACtF,GAAM,CACJ,KACA,OACA,WACA,WAAW,GACX,WACA,YACA,UACA,YACA,MACA,GAAGC,GACDC,EACEC,EAA+BC,GAAM,IAC3CP,EAAA,4BAA4B,eAAe,EAI3C,IAAMQ,EAAaf,EAAAA,sBAAsB,CACvC,WACA,eAAgB,GAChB,UACA,YACA,YAAa,EACf,CAAC,EAGKgB,EAAc,OAAOC,GAAa,SAAWA,EAAW,IAAA,GACxDC,EAAiBP,EAAiC,sBAAwB,IAAA,GAG1EQ,EAAeC,GAAY,OAAOP,GAAc,SAAW,CAAE,KAAM,IAAA,EAAU,EAAI,KAEvF,OACE,EAAAJ,EAAA,IAAA,CAACI,EAAD,CACE,KAAK,WACL,mBAAkBG,EAClB,GAAIL,EACJ,GAAIQ,EACC,MACL,gBAAeC,EAAW,GAAOT,EAAK,iBACtC,gBAAeS,EAAW,GAAK,IAAA,GAC/B,QAASL,EAAW,QACpB,UAAWA,EAAW,UACtB,UAAWd,EAAAA,GAAGC,EAAAA,gBAAiB,+BAAgCmB,CAAS,EAExE,UAAA,EAAAZ,EAAA,IAAA,CAACN,EAAAA,YAAD,CAAmB,OAAM,MAAOc,EAAoB,WAAU,UAAW,CAACC,CAAgB,CAAA,CACjF,CAAA,CAEf,EACA,EAAa,YAAc"}
1
+ {"version":3,"file":"Menu.link.cjs","names":["useMenuItemActivation","cn","menuItemClassNames","menuItemLinkClassNames","menuItemClasses","MenuItemRow","require_runtime","require_cn","require_classNames","require_Menu_shared","require_Menu_items","react","react_jsx_runtime","MenuItemLink","rest","props","Component","as","activation","stringLabel","children","ownRovingText","disabledHref","disabled","className"],"sources":["../../../src/components/navigation/Menu.link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { menuItemClassNames, menuItemLinkClassNames } from '../../lib/classNames';\nimport type { PolymorphicComponent, PolymorphicProps } from '../../lib/polymorphic';\nimport type { Slot } from '../../lib/types';\nimport { MenuItemRow, useMenuItemActivation, useMenuItemPlacementWarning } from './Menu.items';\nimport { menuItemClasses } from './Menu.shared';\n\n/** The MenuItemLink's own props (the XOwnProps rule: component-specific props only). */\nexport interface MenuItemLinkOwnProps {\n /** Icon before the label (decorative); the rules of `Menu.Item.icon`. */\n icon?: Slot<'span'>;\n /** Keyboard shortcut text at the end of the item; the rules of `Menu.Item.shortcut`. */\n shortcut?: string;\n /**\n * Unavailable: `aria-disabled`, skipped by the arrow keys, never activated, and its click is\n * cancelled (`preventDefault()`, which router links respect). On the default `'a'` the `href`\n * is removed too, so it cannot navigate at all; with `as` (a router link) the component's own\n * `to` still renders an `href`, so middle click or \"open in new tab\" can still follow it:\n * render a disabled router link without its target.\n * @default false\n */\n disabled?: boolean;\n /** Label of the link. */\n children: React.ReactNode;\n}\n\n/** Props of {@link MenuItemLink} rendered as `C` (default `'a'`, or a router link component). */\nexport type MenuItemLinkProps<C extends React.ElementType = 'a'> = PolymorphicProps<\n C,\n MenuItemLinkOwnProps\n>;\n\n/** The props the implementation reads, for any `as`. */\ntype MenuItemLinkImplProps = MenuItemLinkOwnProps &\n Omit<React.HTMLAttributes<HTMLElement>, 'onClick' | 'onKeyDown' | 'children'> & {\n as?: React.ElementType;\n ref?: React.Ref<HTMLElement>;\n onClick?: React.MouseEventHandler<HTMLElement>;\n onKeyDown?: React.KeyboardEventHandler<HTMLElement>;\n };\n\n/**\n * A menu item that navigates (`role=\"menuitem\"` on the link element). Enter follows the link the\n * way the browser does (Shift+Enter, Ctrl+Enter and Cmd+Enter open a new window or tab), Space\n * follows it too, and every click follows it and closes a popup menu (focus returns to the\n * trigger first), a Ctrl- or Cmd-click that opens a new tab included; the Menu's\n * `persistOnItemClick` does not keep it open. Middle click and the browser's link context menu\n * keep working and close nothing. A consumer `onClick` that calls `preventDefault()` cancels the\n * navigation and keeps the menu open. In a static menu a click navigates and closes nothing. In\n * forced colors the browser draws the text in its link color (`LinkText`). Typeahead matches the\n * label (`children`). `as` takes a router link component, which must forward `ref` and spread its\n * props onto the anchor.\n *\n * Also exported as `MenuItemLink` (import the flat name from React Server Components).\n *\n * @example\n * <Menu.ItemLink href=\"/settings\">Settings</Menu.ItemLink>\n * <Menu.ItemLink as={RouterLink} to=\"/billing\">Billing</Menu.ItemLink>\n */\nexport const MenuItemLink: PolymorphicComponent<'a', MenuItemLinkOwnProps> = (props) => {\n const {\n as,\n icon,\n shortcut,\n disabled = false,\n children,\n className,\n onClick,\n onKeyDown,\n ref,\n ...rest\n } = props as MenuItemLinkImplProps;\n const Component: React.ElementType = as ?? 'a';\n useMenuItemPlacementWarning('Menu.ItemLink');\n\n // Enter is the browser's (a link keeps Shift, Ctrl and Meta for a new window or tab); Space\n // clicks it. Every activation closes the popup menu: a navigation ends the menu's job.\n const activation = useMenuItemActivation({\n disabled,\n persistOnClick: false,\n onClick,\n onKeyDown,\n nativeEnter: true,\n });\n\n // Typeahead text: a string label directly; any other label through its marked element.\n const stringLabel = typeof children === 'string' ? children : undefined;\n const ownRovingText = (rest as Record<string, unknown>)['data-roving-text'] !== undefined;\n // A disabled element link cannot navigate at all (middle click, \"open in new tab\" included); a\n // router link keeps what its own props render, and its prevented click stops it.\n const disabledHref = disabled && typeof Component === 'string' ? { href: undefined } : null;\n\n return (\n <Component\n role=\"menuitem\"\n data-roving-text={stringLabel}\n {...rest}\n {...disabledHref}\n ref={ref}\n aria-disabled={disabled ? true : rest['aria-disabled']}\n data-disabled={disabled ? '' : undefined}\n onClick={activation.onClick}\n onKeyDown={activation.onKeyDown}\n className={cn(\n menuItemClassNames.root,\n menuItemLinkClassNames.root,\n menuItemClasses,\n 'text-foreground no-underline',\n className,\n )}\n >\n <MenuItemRow\n icon={icon}\n label={children}\n shortcut={shortcut}\n markLabel={!ownRovingText}\n partClassNames={{\n icon: cn(menuItemClassNames.icon, menuItemLinkClassNames.icon),\n content: cn(menuItemClassNames.content, menuItemLinkClassNames.content),\n shortcut: cn(menuItemClassNames.shortcut, menuItemLinkClassNames.shortcut),\n }}\n />\n </Component>\n );\n};\nMenuItemLink.displayName = 'MenuItemLink';\n"],"mappings":"iRA4DA,IAAaa,EAAiE,GAAU,CACtF,GAAM,CACJ,KACA,OACA,WACA,WAAW,GACX,WACA,YACA,UACA,YACA,MACA,GAAGC,GACDC,EACEC,EAA+BC,GAAM,IAC3CP,EAAA,4BAA4B,eAAe,EAI3C,IAAMQ,EAAalB,EAAAA,sBAAsB,CACvC,WACA,eAAgB,GAChB,UACA,YACA,YAAa,EACf,CAAC,EAGKmB,EAAc,OAAOC,GAAa,SAAWA,EAAW,IAAA,GACxDC,EAAiBP,EAAiC,sBAAwB,IAAA,GAG1EQ,EAAeC,GAAY,OAAOP,GAAc,SAAW,CAAE,KAAM,IAAA,EAAU,EAAI,KAEvF,OACE,EAAAJ,EAAA,IAAA,CAACI,EAAD,CACE,KAAK,WACL,mBAAkBG,EAClB,GAAIL,EACJ,GAAIQ,EACC,MACL,gBAAeC,EAAW,GAAOT,EAAK,iBACtC,gBAAeS,EAAW,GAAK,IAAA,GAC/B,QAASL,EAAW,QACpB,UAAWA,EAAW,UACtB,UAAWjB,EAAAA,GACTC,EAAAA,mBAAmB,KACnBC,EAAAA,uBAAuB,KACvBC,EAAAA,gBACA,+BACAoB,CACF,EAEA,UAAA,EAAAZ,EAAA,IAAA,CAACP,EAAAA,YAAD,CACQ,OACN,MAAOe,EACG,WACV,UAAW,CAACC,EACZ,eAAgB,CACd,KAAMpB,EAAAA,GAAGC,EAAAA,mBAAmB,KAAMC,EAAAA,uBAAuB,IAAI,EAC7D,QAASF,EAAAA,GAAGC,EAAAA,mBAAmB,QAASC,EAAAA,uBAAuB,OAAO,EACtE,SAAUF,EAAAA,GAAGC,EAAAA,mBAAmB,SAAUC,EAAAA,uBAAuB,QAAQ,CAC3E,CACD,CAAA,CACQ,CAAA,CAEf,EACA,EAAa,YAAc"}
@@ -1,41 +1,47 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../lib/cn.mjs";
3
- import { menuItemClasses as t } from "./Menu.shared.mjs";
4
- import { MenuItemRow as n, useMenuItemActivation as r, useMenuItemPlacementWarning as i } from "./Menu.items.mjs";
3
+ import { menuItemClassNames as t, menuItemLinkClassNames as n } from "../../lib/classNames.mjs";
4
+ import { menuItemClasses as r } from "./Menu.shared.mjs";
5
+ import { MenuItemRow as i, useMenuItemActivation as a, useMenuItemPlacementWarning as o } from "./Menu.items.mjs";
5
6
  import "react";
6
- import { jsx as a } from "react/jsx-runtime";
7
+ import { jsx as s } from "react/jsx-runtime";
7
8
  //#region src/components/navigation/Menu.link.tsx
8
- var o = (o) => {
9
- let { as: s, icon: c, shortcut: l, disabled: u = !1, children: d, className: f, onClick: p, onKeyDown: m, ref: h, ...g } = o, _ = s ?? "a";
10
- i("Menu.ItemLink");
11
- let v = r({
12
- disabled: u,
9
+ var c = (c) => {
10
+ let { as: l, icon: u, shortcut: d, disabled: f = !1, children: p, className: m, onClick: h, onKeyDown: g, ref: _, ...v } = c, y = l ?? "a";
11
+ o("Menu.ItemLink");
12
+ let b = a({
13
+ disabled: f,
13
14
  persistOnClick: !1,
14
- onClick: p,
15
- onKeyDown: m,
15
+ onClick: h,
16
+ onKeyDown: g,
16
17
  nativeEnter: !0
17
- }), y = typeof d == "string" ? d : void 0, b = g["data-roving-text"] !== void 0, x = u && typeof _ == "string" ? { href: void 0 } : null;
18
- return /* @__PURE__ */ a(_, {
18
+ }), x = typeof p == "string" ? p : void 0, S = v["data-roving-text"] !== void 0, C = f && typeof y == "string" ? { href: void 0 } : null;
19
+ return /* @__PURE__ */ s(y, {
19
20
  role: "menuitem",
20
- "data-roving-text": y,
21
- ...g,
22
- ...x,
23
- ref: h,
24
- "aria-disabled": u ? !0 : g["aria-disabled"],
25
- "data-disabled": u ? "" : void 0,
26
- onClick: v.onClick,
27
- onKeyDown: v.onKeyDown,
28
- className: e(t, "text-foreground no-underline", f),
29
- children: /* @__PURE__ */ a(n, {
30
- icon: c,
31
- label: d,
32
- shortcut: l,
33
- markLabel: !b
21
+ "data-roving-text": x,
22
+ ...v,
23
+ ...C,
24
+ ref: _,
25
+ "aria-disabled": f ? !0 : v["aria-disabled"],
26
+ "data-disabled": f ? "" : void 0,
27
+ onClick: b.onClick,
28
+ onKeyDown: b.onKeyDown,
29
+ className: e(t.root, n.root, r, "text-foreground no-underline", m),
30
+ children: /* @__PURE__ */ s(i, {
31
+ icon: u,
32
+ label: p,
33
+ shortcut: d,
34
+ markLabel: !S,
35
+ partClassNames: {
36
+ icon: e(t.icon, n.icon),
37
+ content: e(t.content, n.content),
38
+ shortcut: e(t.shortcut, n.shortcut)
39
+ }
34
40
  })
35
41
  });
36
42
  };
37
- o.displayName = "MenuItemLink";
43
+ c.displayName = "MenuItemLink";
38
44
  //#endregion
39
- export { o as MenuItemLink };
45
+ export { c as MenuItemLink };
40
46
 
41
47
  //# sourceMappingURL=Menu.link.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.link.mjs","names":["MenuItemLink","rest","props","Component","as","activation","useMenuItemActivation","stringLabel","children","ownRovingText","disabledHref","disabled","cn","menuItemClasses","className","MenuItemRow"],"sources":["../../../src/components/navigation/Menu.link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport type { PolymorphicComponent, PolymorphicProps } from '../../lib/polymorphic';\nimport type { Slot } from '../../lib/types';\nimport { MenuItemRow, useMenuItemActivation, useMenuItemPlacementWarning } from './Menu.items';\nimport { menuItemClasses } from './Menu.shared';\n\n/** The MenuItemLink's own props (the XOwnProps rule: component-specific props only). */\nexport interface MenuItemLinkOwnProps {\n /** Icon before the label (decorative); the rules of `Menu.Item.icon`. */\n icon?: Slot<'span'>;\n /** Keyboard shortcut text at the end of the item; the rules of `Menu.Item.shortcut`. */\n shortcut?: string;\n /**\n * Unavailable: `aria-disabled`, skipped by the arrow keys, never activated, and its click is\n * cancelled (`preventDefault()`, which router links respect). On the default `'a'` the `href`\n * is removed too, so it cannot navigate at all; with `as` (a router link) the component's own\n * `to` still renders an `href`, so middle click or \"open in new tab\" can still follow it:\n * render a disabled router link without its target.\n * @default false\n */\n disabled?: boolean;\n /** Label of the link. */\n children: React.ReactNode;\n}\n\n/** Props of {@link MenuItemLink} rendered as `C` (default `'a'`, or a router link component). */\nexport type MenuItemLinkProps<C extends React.ElementType = 'a'> = PolymorphicProps<\n C,\n MenuItemLinkOwnProps\n>;\n\n/** The props the implementation reads, for any `as`. */\ntype MenuItemLinkImplProps = MenuItemLinkOwnProps &\n Omit<React.HTMLAttributes<HTMLElement>, 'onClick' | 'onKeyDown' | 'children'> & {\n as?: React.ElementType;\n ref?: React.Ref<HTMLElement>;\n onClick?: React.MouseEventHandler<HTMLElement>;\n onKeyDown?: React.KeyboardEventHandler<HTMLElement>;\n };\n\n/**\n * A menu item that navigates (`role=\"menuitem\"` on the link element). Enter follows the link the\n * way the browser does (Shift+Enter, Ctrl+Enter and Cmd+Enter open a new window or tab), Space\n * follows it too, and every click follows it and closes a popup menu (focus returns to the\n * trigger first), a Ctrl- or Cmd-click that opens a new tab included; the Menu's\n * `persistOnItemClick` does not keep it open. Middle click and the browser's link context menu\n * keep working and close nothing. A consumer `onClick` that calls `preventDefault()` cancels the\n * navigation and keeps the menu open. In a static menu a click navigates and closes nothing. In\n * forced colors the browser draws the text in its link color (`LinkText`). Typeahead matches the\n * label (`children`). `as` takes a router link component, which must forward `ref` and spread its\n * props onto the anchor.\n *\n * Also exported as `MenuItemLink` (import the flat name from React Server Components).\n *\n * @example\n * <Menu.ItemLink href=\"/settings\">Settings</Menu.ItemLink>\n * <Menu.ItemLink as={RouterLink} to=\"/billing\">Billing</Menu.ItemLink>\n */\nexport const MenuItemLink: PolymorphicComponent<'a', MenuItemLinkOwnProps> = (props) => {\n const {\n as,\n icon,\n shortcut,\n disabled = false,\n children,\n className,\n onClick,\n onKeyDown,\n ref,\n ...rest\n } = props as MenuItemLinkImplProps;\n const Component: React.ElementType = as ?? 'a';\n useMenuItemPlacementWarning('Menu.ItemLink');\n\n // Enter is the browser's (a link keeps Shift, Ctrl and Meta for a new window or tab); Space\n // clicks it. Every activation closes the popup menu: a navigation ends the menu's job.\n const activation = useMenuItemActivation({\n disabled,\n persistOnClick: false,\n onClick,\n onKeyDown,\n nativeEnter: true,\n });\n\n // Typeahead text: a string label directly; any other label through its marked element.\n const stringLabel = typeof children === 'string' ? children : undefined;\n const ownRovingText = (rest as Record<string, unknown>)['data-roving-text'] !== undefined;\n // A disabled element link cannot navigate at all (middle click, \"open in new tab\" included); a\n // router link keeps what its own props render, and its prevented click stops it.\n const disabledHref = disabled && typeof Component === 'string' ? { href: undefined } : null;\n\n return (\n <Component\n role=\"menuitem\"\n data-roving-text={stringLabel}\n {...rest}\n {...disabledHref}\n ref={ref}\n aria-disabled={disabled ? true : rest['aria-disabled']}\n data-disabled={disabled ? '' : undefined}\n onClick={activation.onClick}\n onKeyDown={activation.onKeyDown}\n className={cn(menuItemClasses, 'text-foreground no-underline', className)}\n >\n <MenuItemRow icon={icon} label={children} shortcut={shortcut} markLabel={!ownRovingText} />\n </Component>\n );\n};\nMenuItemLink.displayName = 'MenuItemLink';\n"],"mappings":";;;;;;;AA2DA,IAAaA,KAAiE,MAAU;CACtF,IAAM,EACJ,OACA,SACA,aACA,cAAW,IACX,aACA,cACA,YACA,cACA,QACA,GAAGC,MACDC,GACEC,IAA+BC,KAAM;CAC3C,EAA4B,eAAe;CAI3C,IAAMC,IAAaC,EAAsB;EACvC;EACA,gBAAgB;EAChB;EACA;EACA,aAAa;CACf,CAAC,GAGKC,IAAc,OAAOC,KAAa,WAAWA,IAAW,KAAA,GACxDC,IAAiBR,EAAiC,wBAAwB,KAAA,GAG1ES,IAAeC,KAAY,OAAOR,KAAc,WAAW,EAAE,MAAM,KAAA,EAAU,IAAI;CAEvF,OACE,kBAACA,GAAD;EACE,MAAK;EACL,oBAAkBI;EAClB,GAAIN;EACJ,GAAIS;EACC;EACL,iBAAeC,IAAW,KAAOV,EAAK;EACtC,iBAAeU,IAAW,KAAK,KAAA;EAC/B,SAASN,EAAW;EACpB,WAAWA,EAAW;EACtB,WAAWO,EAAGC,GAAiB,gCAAgCC,CAAS;EAExE,UAAA,kBAACC,GAAD;GAAmB;GAAM,OAAOP;GAAoB;GAAU,WAAW,CAACC;EAAgB,CAAA;CACjF,CAAA;AAEf;AACA,EAAa,cAAc"}
1
+ {"version":3,"file":"Menu.link.mjs","names":["MenuItemLink","rest","props","Component","as","activation","useMenuItemActivation","stringLabel","children","ownRovingText","disabledHref","disabled","cn","menuItemClassNames","menuItemLinkClassNames","menuItemClasses","className","MenuItemRow"],"sources":["../../../src/components/navigation/Menu.link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { menuItemClassNames, menuItemLinkClassNames } from '../../lib/classNames';\nimport type { PolymorphicComponent, PolymorphicProps } from '../../lib/polymorphic';\nimport type { Slot } from '../../lib/types';\nimport { MenuItemRow, useMenuItemActivation, useMenuItemPlacementWarning } from './Menu.items';\nimport { menuItemClasses } from './Menu.shared';\n\n/** The MenuItemLink's own props (the XOwnProps rule: component-specific props only). */\nexport interface MenuItemLinkOwnProps {\n /** Icon before the label (decorative); the rules of `Menu.Item.icon`. */\n icon?: Slot<'span'>;\n /** Keyboard shortcut text at the end of the item; the rules of `Menu.Item.shortcut`. */\n shortcut?: string;\n /**\n * Unavailable: `aria-disabled`, skipped by the arrow keys, never activated, and its click is\n * cancelled (`preventDefault()`, which router links respect). On the default `'a'` the `href`\n * is removed too, so it cannot navigate at all; with `as` (a router link) the component's own\n * `to` still renders an `href`, so middle click or \"open in new tab\" can still follow it:\n * render a disabled router link without its target.\n * @default false\n */\n disabled?: boolean;\n /** Label of the link. */\n children: React.ReactNode;\n}\n\n/** Props of {@link MenuItemLink} rendered as `C` (default `'a'`, or a router link component). */\nexport type MenuItemLinkProps<C extends React.ElementType = 'a'> = PolymorphicProps<\n C,\n MenuItemLinkOwnProps\n>;\n\n/** The props the implementation reads, for any `as`. */\ntype MenuItemLinkImplProps = MenuItemLinkOwnProps &\n Omit<React.HTMLAttributes<HTMLElement>, 'onClick' | 'onKeyDown' | 'children'> & {\n as?: React.ElementType;\n ref?: React.Ref<HTMLElement>;\n onClick?: React.MouseEventHandler<HTMLElement>;\n onKeyDown?: React.KeyboardEventHandler<HTMLElement>;\n };\n\n/**\n * A menu item that navigates (`role=\"menuitem\"` on the link element). Enter follows the link the\n * way the browser does (Shift+Enter, Ctrl+Enter and Cmd+Enter open a new window or tab), Space\n * follows it too, and every click follows it and closes a popup menu (focus returns to the\n * trigger first), a Ctrl- or Cmd-click that opens a new tab included; the Menu's\n * `persistOnItemClick` does not keep it open. Middle click and the browser's link context menu\n * keep working and close nothing. A consumer `onClick` that calls `preventDefault()` cancels the\n * navigation and keeps the menu open. In a static menu a click navigates and closes nothing. In\n * forced colors the browser draws the text in its link color (`LinkText`). Typeahead matches the\n * label (`children`). `as` takes a router link component, which must forward `ref` and spread its\n * props onto the anchor.\n *\n * Also exported as `MenuItemLink` (import the flat name from React Server Components).\n *\n * @example\n * <Menu.ItemLink href=\"/settings\">Settings</Menu.ItemLink>\n * <Menu.ItemLink as={RouterLink} to=\"/billing\">Billing</Menu.ItemLink>\n */\nexport const MenuItemLink: PolymorphicComponent<'a', MenuItemLinkOwnProps> = (props) => {\n const {\n as,\n icon,\n shortcut,\n disabled = false,\n children,\n className,\n onClick,\n onKeyDown,\n ref,\n ...rest\n } = props as MenuItemLinkImplProps;\n const Component: React.ElementType = as ?? 'a';\n useMenuItemPlacementWarning('Menu.ItemLink');\n\n // Enter is the browser's (a link keeps Shift, Ctrl and Meta for a new window or tab); Space\n // clicks it. Every activation closes the popup menu: a navigation ends the menu's job.\n const activation = useMenuItemActivation({\n disabled,\n persistOnClick: false,\n onClick,\n onKeyDown,\n nativeEnter: true,\n });\n\n // Typeahead text: a string label directly; any other label through its marked element.\n const stringLabel = typeof children === 'string' ? children : undefined;\n const ownRovingText = (rest as Record<string, unknown>)['data-roving-text'] !== undefined;\n // A disabled element link cannot navigate at all (middle click, \"open in new tab\" included); a\n // router link keeps what its own props render, and its prevented click stops it.\n const disabledHref = disabled && typeof Component === 'string' ? { href: undefined } : null;\n\n return (\n <Component\n role=\"menuitem\"\n data-roving-text={stringLabel}\n {...rest}\n {...disabledHref}\n ref={ref}\n aria-disabled={disabled ? true : rest['aria-disabled']}\n data-disabled={disabled ? '' : undefined}\n onClick={activation.onClick}\n onKeyDown={activation.onKeyDown}\n className={cn(\n menuItemClassNames.root,\n menuItemLinkClassNames.root,\n menuItemClasses,\n 'text-foreground no-underline',\n className,\n )}\n >\n <MenuItemRow\n icon={icon}\n label={children}\n shortcut={shortcut}\n markLabel={!ownRovingText}\n partClassNames={{\n icon: cn(menuItemClassNames.icon, menuItemLinkClassNames.icon),\n content: cn(menuItemClassNames.content, menuItemLinkClassNames.content),\n shortcut: cn(menuItemClassNames.shortcut, menuItemLinkClassNames.shortcut),\n }}\n />\n </Component>\n );\n};\nMenuItemLink.displayName = 'MenuItemLink';\n"],"mappings":";;;;;;;;AA4DA,IAAaA,KAAiE,MAAU;CACtF,IAAM,EACJ,OACA,SACA,aACA,cAAW,IACX,aACA,cACA,YACA,cACA,QACA,GAAGC,MACDC,GACEC,IAA+BC,KAAM;CAC3C,EAA4B,eAAe;CAI3C,IAAMC,IAAaC,EAAsB;EACvC;EACA,gBAAgB;EAChB;EACA;EACA,aAAa;CACf,CAAC,GAGKC,IAAc,OAAOC,KAAa,WAAWA,IAAW,KAAA,GACxDC,IAAiBR,EAAiC,wBAAwB,KAAA,GAG1ES,IAAeC,KAAY,OAAOR,KAAc,WAAW,EAAE,MAAM,KAAA,EAAU,IAAI;CAEvF,OACE,kBAACA,GAAD;EACE,MAAK;EACL,oBAAkBI;EAClB,GAAIN;EACJ,GAAIS;EACC;EACL,iBAAeC,IAAW,KAAOV,EAAK;EACtC,iBAAeU,IAAW,KAAK,KAAA;EAC/B,SAASN,EAAW;EACpB,WAAWA,EAAW;EACtB,WAAWO,EACTC,EAAmB,MACnBC,EAAuB,MACvBC,GACA,gCACAC,CACF;EAEA,UAAA,kBAACC,GAAD;GACQ;GACN,OAAOT;GACG;GACV,WAAW,CAACC;GACZ,gBAAgB;IACd,MAAMG,EAAGC,EAAmB,MAAMC,EAAuB,IAAI;IAC7D,SAASF,EAAGC,EAAmB,SAASC,EAAuB,OAAO;IACtE,UAAUF,EAAGC,EAAmB,UAAUC,EAAuB,QAAQ;GAC3E;EACD,CAAA;CACQ,CAAA;AAEf;AACA,EAAa,cAAc"}
@@ -1,2 +1,2 @@
1
- "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/dev.cjs"),r=require("../../lib/composeEventHandlers.cjs"),i=require("../../hooks/useEventCallback.cjs"),a=require("../../lib/direction.cjs"),o=require("../../lib/focus.cjs"),ee=require("../../hooks/useRovingTabIndex.cjs"),te=require("../../hooks/useMergedRefs.cjs"),ne=require("../../hooks/usePresence.cjs"),re=require("../../hooks/useDismiss.cjs"),s=require("../portal/Portal.cjs"),ie=require("../../hooks/usePopupPosition.cjs"),ae=require("../../hooks/useRestoreFocus.cjs"),c=require("../../hooks/useTriggerElement.cjs"),l=require("../../lib/events.cjs"),u=require("./Menu.context.cjs"),d=require("./Menu.shared.cjs"),f=require("../../hooks/useHoverIntent.cjs");let p=require("react");p=e.__toESM(p,1);let m=require("react/jsx-runtime");var oe={padding:8,crossAxis:!0};function se(e){return!!e&&e.nodeType===1}function h(e){let[t]=p.useState(f.createHoverIntentGroup),n=p.useRef(!1);return{hoverGroup:t,isHoverFocusing:p.useCallback(()=>n.current,[]),onPointerMove:i.useEventCallback(r=>{if(r.pointerType===`touch`||r.pointerType===`pen`||!l.isOwnEvent(r))return;let i=r.target.closest(d.MENU_ITEM_SELECTOR);if(!i||!r.currentTarget.contains(i)||i.getAttribute(`aria-disabled`)===`true`||i.ownerDocument.activeElement===i)return;let a=e;for(;a.parent;)a=a.parent;a.listContainsFocus()&&!t.isHeld(r.clientX,r.clientY)&&(n.current=!0,i.focus({preventScroll:!0}),queueMicrotask(()=>{n.current=!1}))})}}var g=({side:e,align:f=`start`,offset:g,target:_,children:ce,className:le,style:ue,onKeyDown:de,onKeyDownCapture:fe,onFocus:pe,onPointerEnter:me,onPointerLeave:he,onPointerMove:ge,onContextMenu:_e,ref:ve,...v})=>{let y=u.useMenuContext(`Menu.Popover`),{popup:ye,open:b,takeInitialFocus:x,registerSurface:S,menuId:be,labelledBy:xe,triggerRef:C,triggerElement:w,isSubmenu:T,requestClose:Se,closeChain:E,dismiss:Ce,hoverSurfaceHandlers:D,isHoverClose:we,openOnContext:O,contextSurfaceHandlers:Te,contextAnchor:k,fromContext:A,contextOpener:j}=y;d.useStaticMenuPartWarning(`Menu.Popover`,ye);let M=se(_)?_:null,[N,Ee]=p.useState(null),P=p.useRef(null),De=p.useCallback(e=>{P.current=e,Ee(e)},[]),{isMounted:F,ref:Oe,presenceProps:ke}=ne.usePresence(b),{setReference:I,setFloating:Ae,floatingProps:L,isPositioned:R}=ie.usePopupPosition({open:b,side:e??(T?`end`:`bottom`),align:f,offset:g??(T?0:4),fitViewport:!0,shift:T?oe:void 0}),{maxHeight:je,maxWidth:Me,...Ne}=L.style;p.useLayoutEffect(()=>{I(A?k??c.getTriggerFocusTarget(w)??w:_??w)},[I,k,A,_,w]);let z=i.useEventCallback(()=>{let e=O?j.current:null;return e&&o.isConnectedAndFocusable(e)?e:c.getTriggerFocusTarget(C.current)||(M&&o.isConnectedAndFocusable(M)?M:null)}),Pe=p.useMemo(()=>({get current(){return z()??C.current}}),[z,C]),B={current:M},{layerId:V}=re.useDismiss({open:b,onDismiss:Ce,refs:O?[P,B]:[P,C,B],anchorRef:Pe,kind:`menu`,focusOutside:!0,outsidePress:O?e=>!(e.ctrlKey&&e.target instanceof Node&&C.current?.contains(e.target)):!0}),H=c.useTriggerFocusRef(C),U=p.useRef(null),W=p.useRef(!1),Fe=i.useEventCallback(()=>{let e=P.current,t=(C.current??e)?.ownerDocument??document,n=n=>!!n&&n!==t.body&&n!==t.documentElement&&!e?.contains(n),r=O?null:H.current,i=t.activeElement;U.current=n(r)?r:n(i)?i:null});p.useInsertionEffect(()=>{let e=W.current;W.current=b,b&&!e&&Fe()});let Ie=i.useEventCallback(()=>{let e=P.current;return[O?j.current:null,U.current,z()].find(t=>!!t&&o.isConnectedAndFocusable(t)&&!e?.contains(t))??null});ae.useRestoreFocus({enabled:b,container:N,triggerRef:O?void 0:H,finalFocusRef:O?j:void 0,fallback:z,onlyIfFocusInside:!0,isHoverClose:we});let G=F&&(O||_!=null&&!w)&&v[`aria-label`]===void 0&&v[`aria-labelledby`]===void 0;p.useEffect(()=>{G&&n.warnOnce(`Menu.Popover:name`,"Menu.Popover: this menu has no trigger to name it (a context menu, or a menu placed at a `target` without Menu.Trigger): give Menu.Popover an aria-label or aria-labelledby.")},[G]);let{containerProps:{ref:Le},handleKeyDown:Re,handleKeyDownCapture:ze,handleFocus:Be,focusFirst:K,focusLast:q}=ee.useRovingTabIndex({orientation:`vertical`,loop:!0,typeahead:!0,manageTabIndex:!0,itemSelector:d.MENU_ITEM_SELECTOR}),Ve=te.useMergedRefs(ve,De,Le,Ae,Oe);p.useLayoutEffect(()=>{if(N&&b)return S({focusFirst:K,focusLast:q,surface:N,layerId:V,getReturnFocus:z}),()=>S(null)},[N,b,S,K,q,V,z]);let J=p.useRef(!1);p.useLayoutEffect(()=>(J.current=!1,()=>{J.current=!0}),[]);let Y=i.useEventCallback(()=>{let e=P.current,t=e?.ownerDocument.activeElement;!J.current&&e&&t&&e.contains(t)&&Ie()?.focus({preventScroll:!0})});p.useLayoutEffect(()=>{if(b)return Y},[b,Y]),p.useLayoutEffect(()=>{if(!b||!N||N.contains(N.ownerDocument.activeElement))return;let e=x();e===`last`?q():e===`first`&&K()},[b,N,x,K,q]),p.useLayoutEffect(()=>{if(!R||!N)return;let e=N.ownerDocument.activeElement;e&&e!==N&&N.contains(e)&&e.scrollIntoView?.({block:`nearest`})},[R,N]);let X=p.useContext(s.PortalDepthContext)+1,Z=u.useCheckableRegistry(),{hoverGroup:Q,isHoverFocusing:$,onPointerMove:He}=h(y),Ue=p.useMemo(()=>({menu:y,isStatic:!1,portalDepth:X,closeFromItem:E,registerCheckable:Z,hoverGroup:Q,isHoverFocusing:$}),[y,X,E,Z,Q,$]),We=e=>{if(de?.(e),!e.defaultPrevented&&l.isOwnEvent(e)){if(e.key===`Tab`){E();return}if(T&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!l.isEditableTarget(e.target)&&a.getArrowIntent(e.key,{orientation:`horizontal`,dir:a.getDirection(e.currentTarget)})===`prev`){e.preventDefault(),z()?.focus({preventScroll:!0}),Se();return}Re(e)}};return F?(0,m.jsx)(s.Portal,{layerId:V,children:(0,m.jsx)(u.MenuListContext.Provider,{value:Ue,children:(0,m.jsx)(`div`,{role:`menu`,...v,"aria-labelledby":v[`aria-labelledby`]===void 0?w&&!O&&v[`aria-label`]===void 0?xe:void 0:v[`aria-labelledby`],...ke,ref:Ve,id:be,"data-state":b?`open`:`closed`,"data-side":L[`data-side`],"data-align":L[`data-align`],"data-roving-container":``,style:{...Ne,...ue},onKeyDown:We,onKeyDownCapture:d.withTypeaheadText(r.composeEventHandlers(fe,ze)),onFocus:r.composeEventHandlers(pe,Be,{checkDefaultPrevented:!1}),onPointerEnter:r.composeEventHandlers(me,D.onPointerEnter),onPointerLeave:r.composeEventHandlers(he,D.onPointerLeave),onPointerMove:r.composeEventHandlers(ge,He),onContextMenu:r.composeEventHandlers(_e,Te.onContextMenu),className:t.cn(d.menuPopoverClasses,le),children:ce})})}):null};g.displayName=`MenuPopover`,exports.MenuPopover=g,exports.useMenuListPointer=h;
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/dev.cjs"),r=require("../../lib/composeEventHandlers.cjs"),i=require("../../lib/classNames.cjs"),a=require("../../hooks/useEventCallback.cjs"),o=require("../../lib/direction.cjs"),s=require("../../lib/focus.cjs"),ee=require("../../hooks/useRovingTabIndex.cjs"),te=require("../../hooks/useMergedRefs.cjs"),ne=require("../../hooks/usePresence.cjs"),re=require("../../hooks/useDismiss.cjs"),c=require("../portal/Portal.cjs"),ie=require("../../hooks/usePopupPosition.cjs"),l=require("../../lib/events.cjs"),ae=require("../../hooks/useRestoreFocus.cjs"),u=require("../../hooks/useHoverIntent.cjs"),d=require("../../hooks/useTriggerElement.cjs"),f=require("./Menu.context.cjs"),p=require("./Menu.shared.cjs");let m=require("react");m=e.__toESM(m,1);let h=require("react/jsx-runtime");var oe={padding:8,crossAxis:!0};function se(e){return!!e&&e.nodeType===1}function g(e){let[t]=m.useState(u.createHoverIntentGroup),n=m.useRef(!1);return{hoverGroup:t,isHoverFocusing:m.useCallback(()=>n.current,[]),onPointerMove:a.useEventCallback(r=>{if(r.pointerType===`touch`||r.pointerType===`pen`||!l.isOwnEvent(r))return;let i=r.target.closest(p.MENU_ITEM_SELECTOR);if(!i||!r.currentTarget.contains(i)||i.getAttribute(`aria-disabled`)===`true`||i.ownerDocument.activeElement===i)return;let a=e;for(;a.parent;)a=a.parent;a.listContainsFocus()&&!t.isHeld(r.clientX,r.clientY)&&(n.current=!0,i.focus({preventScroll:!0}),queueMicrotask(()=>{n.current=!1}))})}}var _=({side:e,align:u=`start`,offset:_,target:v,children:ce,className:le,style:ue,onKeyDown:de,onKeyDownCapture:fe,onFocus:pe,onPointerEnter:me,onPointerLeave:he,onPointerMove:ge,onContextMenu:_e,ref:ve,...y})=>{let b=f.useMenuContext(`Menu.Popover`),{popup:ye,open:x,takeInitialFocus:S,registerSurface:C,menuId:be,labelledBy:xe,triggerRef:w,triggerElement:T,isSubmenu:E,requestClose:Se,closeChain:D,dismiss:Ce,hoverSurfaceHandlers:O,isHoverClose:we,openOnContext:k,contextSurfaceHandlers:Te,contextAnchor:A,fromContext:j,contextOpener:M}=b;p.useStaticMenuPartWarning(`Menu.Popover`,ye);let N=se(v)?v:null,[P,Ee]=m.useState(null),F=m.useRef(null),De=m.useCallback(e=>{F.current=e,Ee(e)},[]),{isMounted:I,ref:Oe,presenceProps:ke}=ne.usePresence(x),{setReference:L,setFloating:Ae,floatingProps:R,isPositioned:z}=ie.usePopupPosition({open:x,side:e??(E?`end`:`bottom`),align:u,offset:_??(E?0:4),fitViewport:!0,shift:E?oe:void 0}),{maxHeight:je,maxWidth:Me,...Ne}=R.style;m.useLayoutEffect(()=>{L(j?A??d.getTriggerFocusTarget(T)??T:v??T)},[L,A,j,v,T]);let B=a.useEventCallback(()=>{let e=k?M.current:null;return e&&s.isConnectedAndFocusable(e)?e:d.getTriggerFocusTarget(w.current)||(N&&s.isConnectedAndFocusable(N)?N:null)}),Pe=m.useMemo(()=>({get current(){return B()??w.current}}),[B,w]),V={current:N},{layerId:H}=re.useDismiss({open:x,onDismiss:Ce,refs:k?[F,V]:[F,w,V],anchorRef:Pe,kind:`menu`,focusOutside:!0,outsidePress:k?e=>!(e.ctrlKey&&e.target instanceof Node&&w.current?.contains(e.target)):!0}),U=d.useTriggerFocusRef(w),W=m.useRef(null),G=m.useRef(!1),Fe=a.useEventCallback(()=>{let e=F.current,t=(w.current??e)?.ownerDocument??document,n=n=>!!n&&n!==t.body&&n!==t.documentElement&&!e?.contains(n),r=k?null:U.current,i=t.activeElement;W.current=n(r)?r:n(i)?i:null});m.useInsertionEffect(()=>{let e=G.current;G.current=x,x&&!e&&Fe()});let Ie=a.useEventCallback(()=>{let e=F.current;return[k?M.current:null,W.current,B()].find(t=>!!t&&s.isConnectedAndFocusable(t)&&!e?.contains(t))??null});ae.useRestoreFocus({enabled:x,container:P,triggerRef:k?void 0:U,finalFocusRef:k?M:void 0,fallback:B,onlyIfFocusInside:!0,isHoverClose:we});let K=I&&(k||v!=null&&!T)&&y[`aria-label`]===void 0&&y[`aria-labelledby`]===void 0;m.useEffect(()=>{K&&n.warnOnce(`Menu.Popover:name`,"Menu.Popover: this menu has no trigger to name it (a context menu, or a menu placed at a `target` without Menu.Trigger): give Menu.Popover an aria-label or aria-labelledby.")},[K]);let{containerProps:{ref:Le},handleKeyDown:Re,handleKeyDownCapture:ze,handleFocus:Be,focusFirst:q,focusLast:J}=ee.useRovingTabIndex({orientation:`vertical`,loop:!0,typeahead:!0,manageTabIndex:!0,itemSelector:p.MENU_ITEM_SELECTOR}),Ve=te.useMergedRefs(ve,De,Le,Ae,Oe);m.useLayoutEffect(()=>{if(P&&x)return C({focusFirst:q,focusLast:J,surface:P,layerId:H,getReturnFocus:B}),()=>C(null)},[P,x,C,q,J,H,B]);let Y=m.useRef(!1);m.useLayoutEffect(()=>(Y.current=!1,()=>{Y.current=!0}),[]);let X=a.useEventCallback(()=>{let e=F.current,t=e?.ownerDocument.activeElement;!Y.current&&e&&t&&e.contains(t)&&Ie()?.focus({preventScroll:!0})});m.useLayoutEffect(()=>{if(x)return X},[x,X]),m.useLayoutEffect(()=>{if(!x||!P||P.contains(P.ownerDocument.activeElement))return;let e=S();e===`last`?J():e===`first`&&q()},[x,P,S,q,J]),m.useLayoutEffect(()=>{if(!z||!P)return;let e=P.ownerDocument.activeElement;e&&e!==P&&P.contains(e)&&e.scrollIntoView?.({block:`nearest`})},[z,P]);let Z=m.useContext(c.PortalDepthContext)+1,Q=f.useCheckableRegistry(),{hoverGroup:$,isHoverFocusing:He,onPointerMove:Ue}=g(b),We=m.useMemo(()=>({menu:b,isStatic:!1,portalDepth:Z,closeFromItem:D,registerCheckable:Q,hoverGroup:$,isHoverFocusing:He}),[b,Z,D,Q,$,He]),Ge=e=>{if(de?.(e),!e.defaultPrevented&&l.isOwnEvent(e)){if(e.key===`Tab`){D();return}if(E&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!l.isEditableTarget(e.target)&&o.getArrowIntent(e.key,{orientation:`horizontal`,dir:o.getDirection(e.currentTarget)})===`prev`){e.preventDefault(),B()?.focus({preventScroll:!0}),Se();return}Re(e)}};return I?(0,h.jsx)(c.Portal,{layerId:H,children:(0,h.jsx)(f.MenuListContext.Provider,{value:We,children:(0,h.jsx)(`div`,{role:`menu`,...y,"aria-labelledby":y[`aria-labelledby`]===void 0?T&&!k&&y[`aria-label`]===void 0?xe:void 0:y[`aria-labelledby`],...ke,ref:Ve,id:be,"data-state":x?`open`:`closed`,"data-side":R[`data-side`],"data-align":R[`data-align`],"data-roving-container":``,style:{...Ne,...ue},onKeyDown:Ge,onKeyDownCapture:p.withTypeaheadText(r.composeEventHandlers(fe,ze)),onFocus:r.composeEventHandlers(pe,Be,{checkDefaultPrevented:!1}),onPointerEnter:r.composeEventHandlers(me,O.onPointerEnter),onPointerLeave:r.composeEventHandlers(he,O.onPointerLeave),onPointerMove:r.composeEventHandlers(ge,Ue),onContextMenu:r.composeEventHandlers(_e,Te.onContextMenu),className:t.cn(i.menuPopoverClassNames.root,p.menuPopoverClasses,le),children:ce})})}):null};_.displayName=`MenuPopover`,exports.MenuPopover=_,exports.useMenuListPointer=g;
2
2
  //# sourceMappingURL=Menu.popover.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.popover.cjs","names":["React","createHoverIntentGroup","useEventCallback","isOwnEvent","MENU_ITEM_SELECTOR","useMenuContext","usePresence","usePopupPosition","getTriggerFocusTarget","isConnectedAndFocusable","useDismiss","useTriggerFocusRef","useRovingTabIndex","useMergedRefs","PortalDepthContext","useCheckableRegistry","isEditableTarget","getArrowIntent","getDirection","Portal","MenuListContext","withTypeaheadText","composeEventHandlers","cn","menuPopoverClasses","require_runtime","require_cn","require_dev","require_composeEventHandlers","require_useEventCallback","require_direction","require_focus","require_useRovingTabIndex","require_useMergedRefs","require_usePresence","require_useDismiss","require_Portal","require_usePopupPosition","require_useRestoreFocus","require_useTriggerElement","require_events","require_Menu_context","require_Menu_shared","require_useHoverIntent","react","react_jsx_runtime","SUBMENU_SHIFT","isElementTarget","target","useMenuListPointer","hoverGroup","hoverFocusingRef","event","item","root","menu","MenuPopover","rest","popup","targetElement","surface","setSurface","surfaceRef","setSurfaceElement","element","presenceRef","open","side","isSubmenu","offset","_maxHeight","_maxWidth","positionStyle","floatingProps","setReference","fromContext","contextAnchor","triggerElement","getReturnFocus","opener","openOnContext","contextOpener","triggerRef","returnFocusRef","targetRef","dismiss","triggerFocusRef","openerRef","wasOpenRef","captureOpener","container","doc","isCandidate","el","trigger","active","wasOpen","getCloseFocus","unnamed","isMounted","rovingRef","rovingKeyDown","rovingKeyDownCapture","rovingFocus","mergedRef","ref","setFloating","registerSurface","focusFirst","focusLast","layerId","unmountingRef","focusReturnTargetOnClose","surfaceElement","takeInitialFocus","isPositioned","portalDepth","registerCheckable","listPointerMove","listContext","closeChain","isHoverFocusing","handleKeyDown","onKeyDown","requestClose","labelledBy","presenceProps","menuId","style","onKeyDownCapture","onFocus","onPointerEnter","hoverSurfaceHandlers","onPointerLeave","onPointerMove","onContextMenu","contextSurfaceHandlers","className"],"sources":["../../../src/components/navigation/Menu.popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport type { PopupAlign, PopupSide, PopupTarget } from '../../lib/types';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport { warnOnce } from '../../lib/dev';\nimport { getArrowIntent, getDirection } from '../../lib/direction';\nimport { isEditableTarget, isOwnEvent } from '../../lib/events';\nimport { isConnectedAndFocusable } from '../../lib/focus';\nimport { useDismiss } from '../../hooks/useDismiss';\nimport { useEventCallback } from '../../hooks/useEventCallback';\nimport { createHoverIntentGroup, type HoverIntentGroup } from '../../hooks/useHoverIntent';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { usePopupPosition } from '../../hooks/usePopupPosition';\nimport { usePresence } from '../../hooks/usePresence';\nimport { useRestoreFocus } from '../../hooks/useRestoreFocus';\nimport { useRovingTabIndex } from '../../hooks/useRovingTabIndex';\nimport { getTriggerFocusTarget, useTriggerFocusRef } from '../../hooks/useTriggerElement';\nimport { Portal, PortalDepthContext } from '../portal/Portal';\nimport { MenuListContext, useCheckableRegistry, useMenuContext } from './Menu.context';\nimport type { MenuContextValue, MenuListContextValue } from './Menu.context';\nimport {\n MENU_ITEM_SELECTOR,\n menuPopoverClasses,\n useStaticMenuPartWarning,\n withTypeaheadText,\n} from './Menu.shared';\n\n/** Properties for the MenuPopover sub-component. */\nexport interface MenuPopoverProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'id'> {\n /**\n * Side of the trigger the menu opens on (`start`/`end` follow the writing direction).\n * @default 'bottom' ('end' in a submenu)\n */\n side?: PopupSide;\n /** Alignment along that side. @default 'start' */\n align?: PopupAlign;\n /** Distance from the trigger in px. @default 4 (0 in a submenu) */\n offset?: number;\n /**\n * Where to place the menu instead of next to `Menu.Trigger`: an element or a `VirtualElement`\n * (a rectangle, such as a point; an inline object is fine). With a controlled `open`, a menu\n * with a `target` needs no trigger; name it with `aria-label`, and give a toggle button you use\n * as the target `aria-haspopup=\"menu\"` and `aria-expanded` yourself (the menu's `id` is\n * generated, so the toggle cannot point `aria-controls` at it). A press on a target element\n * does not close the menu. Hold the element in state (a ref cannot be observed;\n * TeachingPopover's `target` also takes a ref). A menu opened by `openOnContext` is placed at\n * the gesture instead.\n */\n target?: PopupTarget;\n /** Menu items and dividers. */\n children: React.ReactNode;\n /**\n * Ref to the portaled `role=\"menu\"` surface. Its `id` is generated (the trigger's\n * `aria-controls` points to it), and it is labelled by the trigger unless `aria-label` or\n * `aria-labelledby` is given (one that holds `undefined` counts as not given).\n */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * A submenu with room on neither side of its trigger item is shifted across that side, over its\n * parent menu, to stay inside the viewport (as native and Fluent menus do).\n */\nconst SUBMENU_SHIFT = { padding: 8, crossAxis: true } as const;\n\n/** Whether a `target` is an element (duck typed, so an element of another realm counts). */\nfunction isElementTarget(target: PopupTarget | undefined): target is HTMLElement {\n return !!target && (target as Partial<Node>).nodeType === 1;\n}\n\n/**\n * Internal: the mouse behaviour of a menu list (the static root and every `Menu.Popover`\n * surface). While focus is inside a list of the menu tree (the chain's root list or any of its\n * submenus), a mouse `pointermove` over an enabled item of this list focuses it (`preventScroll`),\n * unless it already has focus or a submenu's safe zone of this list holds the point. Hover moves\n * no focus while focus is elsewhere, so a hover-opened menu or a static menu the user is not in\n * never takes focus from the page, and a Popover, Dialog or other portal opened from an item\n * keeps it. Also returns the list's hover group (the safe zones of its submenu trigger items) and\n * the flag the submenus of the list read while such a focus change runs.\n */\nexport function useMenuListPointer(menu: MenuContextValue): {\n hoverGroup: HoverIntentGroup;\n isHoverFocusing: () => boolean;\n onPointerMove: React.PointerEventHandler<HTMLElement>;\n} {\n const [hoverGroup] = React.useState(createHoverIntentGroup);\n const hoverFocusingRef = React.useRef(false);\n const isHoverFocusing = React.useCallback(() => hoverFocusingRef.current, []);\n const onPointerMove = useEventCallback((event: React.PointerEvent<HTMLElement>) => {\n if (event.pointerType === 'touch' || event.pointerType === 'pen' || !isOwnEvent(event)) return;\n const target = event.target as Element;\n const item = target.closest<HTMLElement>(MENU_ITEM_SELECTOR);\n if (!item || !event.currentTarget.contains(item)) return;\n if (item.getAttribute('aria-disabled') === 'true') return;\n if (item.ownerDocument.activeElement === item) return;\n let root = menu;\n while (root.parent) root = root.parent;\n if (!root.listContainsFocus() || hoverGroup.isHeld(event.clientX, event.clientY)) return;\n hoverFocusingRef.current = true;\n item.focus({ preventScroll: true });\n // A submenu that just lost focus is dismissed (focus outside) in a microtask the focus change\n // queued; the flag is cleared after it.\n queueMicrotask(() => {\n hoverFocusingRef.current = false;\n });\n });\n return { hoverGroup, isHoverFocusing, onPointerMove };\n}\n\n/**\n * The portaled `role=\"menu\"` surface of a popup menu, positioned next to `Menu.Trigger`. A menu\n * taller than the space available scrolls inside the viewport: the surface is limited to the space\n * next to the trigger (`max-height`/`max-width` classes, which a `max-h-*`/`max-w-*` class in\n * `className` or a `style` replaces) and scrolls, and an item that receives focus is scrolled into\n * view. Focus moves to the first (ArrowUp: last) enabled item when it opens; arrows, Home/End and\n * typeahead move between enabled items. Escape closes it and returns focus to the trigger. An\n * outside press closes it and leaves focus where the press put it (on the trigger only when focus\n * was still in the menu or lost to the page). Tab closes it and moves focus to the trigger without\n * preventing the default, so tabbing continues from the trigger (inside a Dialog, the focus trap\n * moves on from there). The trigger here is the element that takes its focus: for a wrapper span,\n * the element inside it that carries the state ARIA (the span itself when you made it the trigger\n * with a `role` such as `button` and `tabIndex={0}`, or when nothing inside it can take focus).\n * Keys from a portal opened inside the menu (a Popover of an item) are left to that portal: Tab\n * there moves on inside it and keeps the menu open.\n *\n * In a submenu it opens at the end side of its trigger item (`side=\"end\"`, `offset={0}`) and\n * flips to fit the viewport; with room on neither side, it overlaps its parent menu inside the\n * viewport. ArrowLeft (ArrowRight in RTL) and Escape close only the submenu and return focus to\n * its trigger item; item activation and Tab close every menu of the chain and put focus on the\n * root trigger.\n *\n * While focus is inside the menu (or one of its submenus), the item under the mouse pointer takes\n * focus, so Enter activates the item you point at. Focus in a Popover, Dialog or other portal\n * opened from an item stays there.\n *\n * A context menu (`openOnContext`) opens at the pointer or at the focused row and returns focus to\n * the element focused at the gesture; it is not labelled by its region, so give it `aria-label`\n * (development warning otherwise), as for a menu placed at a `target` without `Menu.Trigger`.\n *\n * The surface mounts through the presence core (`usePresence`): it carries\n * `data-presence=\"entering\" | \"entered\" | \"exiting\"` and, while it closes, `data-state=\"closed\"`\n * and `inert`, so exit motion classes on `data-presence` keep it on screen until they end. Focus,\n * the dismiss layer and positioning follow the open state, not the exit. Without motion it unmounts\n * as soon as it closes.\n *\n * Also exported as `MenuPopover` (import the flat name from React Server Components).\n */\nexport const MenuPopover = ({\n side,\n align = 'start',\n offset,\n target,\n children,\n className,\n style,\n onKeyDown,\n onKeyDownCapture,\n onFocus,\n onPointerEnter,\n onPointerLeave,\n onPointerMove,\n onContextMenu,\n ref,\n ...rest\n}: MenuPopoverProps) => {\n const menu = useMenuContext('Menu.Popover');\n const {\n popup,\n open,\n takeInitialFocus,\n registerSurface,\n menuId,\n labelledBy,\n triggerRef,\n triggerElement,\n isSubmenu,\n requestClose,\n closeChain,\n dismiss,\n hoverSurfaceHandlers,\n isHoverClose,\n openOnContext,\n contextSurfaceHandlers,\n contextAnchor,\n fromContext,\n contextOpener,\n } = menu;\n useStaticMenuPartWarning('Menu.Popover', popup);\n const targetElement = isElementTarget(target) ? target : null;\n\n const [surface, setSurface] = React.useState<HTMLDivElement | null>(null);\n const surfaceRef = React.useRef<HTMLDivElement | null>(null);\n const setSurfaceElement = React.useCallback((element: HTMLDivElement | null) => {\n surfaceRef.current = element;\n setSurface(element);\n }, []);\n\n // The surface mounts and unmounts through the presence core; everything else below keys on\n // `open`, so focus returns and the layer goes on close, not after an exit motion.\n const { isMounted, ref: presenceRef, presenceProps } = usePresence(open);\n\n const { setReference, setFloating, floatingProps, isPositioned } = usePopupPosition({\n open,\n side: side ?? (isSubmenu ? 'end' : 'bottom'),\n align,\n offset: offset ?? (isSubmenu ? 0 : 4),\n fitViewport: true,\n shift: isSubmenu ? SUBMENU_SHIFT : undefined,\n });\n // The size limits come from menuPopoverClasses, which a consumer class can replace; an inline\n // max-height/max-width would beat every class.\n const { maxHeight: _maxHeight, maxWidth: _maxWidth, ...positionStyle } = floatingProps.style;\n // The positioning reference: the anchor of a context gesture (the point, else the focused row,\n // else the trigger's focus target), else `target`, else the trigger. Kept while the surface\n // exits, so it does not jump; a new inline VirtualElement only recomputes the position.\n React.useLayoutEffect(() => {\n setReference(\n fromContext\n ? (contextAnchor ?? getTriggerFocusTarget(triggerElement) ?? triggerElement)\n : (target ?? triggerElement),\n );\n }, [setReference, contextAnchor, fromContext, target, triggerElement]);\n\n // Where focus returns when the menu closes (item activation, Tab, Escape): in a context menu,\n // the element focused at the gesture when it can take focus; else the element that takes focus\n // for the trigger (for a wrapper span, the element inside it that carries the state ARIA; for a\n // submenu, its trigger item); else a focusable `target` element.\n const getReturnFocus = useEventCallback((): HTMLElement | null => {\n const opener = openOnContext ? contextOpener.current : null;\n if (opener && isConnectedAndFocusable(opener)) return opener;\n const triggerTarget = getTriggerFocusTarget(triggerRef.current);\n if (triggerTarget) return triggerTarget;\n return targetElement && isConnectedAndFocusable(targetElement) ? targetElement : null;\n });\n\n // The layer's anchor (where a surface opened from an item that is gone by then restores focus):\n // the return target, else the trigger itself.\n const returnFocusRef = React.useMemo<React.RefObject<HTMLElement | null>>(\n () => ({\n get current() {\n return getReturnFocus() ?? triggerRef.current;\n },\n }),\n [getReturnFocus, triggerRef],\n );\n // A context region is not part of the layer (a press on another row closes the menu), and a\n // Ctrl+press there is a macOS context click, which moves the menu instead; a target element is.\n const targetRef = { current: targetElement };\n const { layerId } = useDismiss({\n open,\n onDismiss: dismiss,\n refs: openOnContext ? [surfaceRef, targetRef] : [surfaceRef, triggerRef, targetRef],\n anchorRef: returnFocusRef,\n kind: 'menu',\n focusOutside: true,\n outsidePress: openOnContext\n ? (event) =>\n !(\n event.ctrlKey &&\n event.target instanceof Node &&\n triggerRef.current?.contains(event.target)\n )\n : true,\n });\n\n const triggerFocusRef = useTriggerFocusRef(triggerRef);\n\n // The element focused when the menu opened, captured as useRestoreFocus captures its opener: in\n // the commit that opens the menu, before the initial focus moves into it; the trigger's focus\n // target first (not in a context menu, whose region is no opener), else the focused element.\n const openerRef = React.useRef<HTMLElement | null>(null);\n const wasOpenRef = React.useRef(false);\n const captureOpener = useEventCallback(() => {\n const container = surfaceRef.current;\n const doc = (triggerRef.current ?? container)?.ownerDocument ?? document;\n const isCandidate = (el: Element | null | undefined): el is HTMLElement =>\n !!el && el !== doc.body && el !== doc.documentElement && !container?.contains(el);\n const trigger = openOnContext ? null : triggerFocusRef.current;\n const active = doc.activeElement;\n openerRef.current = isCandidate(trigger) ? trigger : isCandidate(active) ? active : null;\n });\n React.useInsertionEffect(() => {\n const wasOpen = wasOpenRef.current;\n wasOpenRef.current = open;\n if (open && !wasOpen) captureOpener();\n });\n // Where focus goes when the menu closes with focus inside it (Escape, a close by the app): where\n // useRestoreFocus would put it, in its order: the context opener, the element focused when the\n // menu opened, then the return target (a menu with a `target` and no trigger returns focus to\n // its opener, not to a focusable target element).\n const getCloseFocus = useEventCallback((): HTMLElement | null => {\n const container = surfaceRef.current;\n const candidates = [\n openOnContext ? contextOpener.current : null,\n openerRef.current,\n getReturnFocus(),\n ];\n return (\n candidates.find(\n (el): el is HTMLElement => !!el && isConnectedAndFocusable(el) && !container?.contains(el),\n ) ?? null\n );\n });\n\n useRestoreFocus({\n enabled: open,\n container: surface,\n // A context menu returns focus to the opener (the focused row), not to the region.\n triggerRef: openOnContext ? undefined : triggerFocusRef,\n finalFocusRef: openOnContext ? contextOpener : undefined,\n fallback: getReturnFocus,\n onlyIfFocusInside: true,\n // A hover close moves no focus (a submenu closing with it is taken along by the hook).\n isHoverClose,\n });\n\n // C-DEV: a surface that no trigger labels needs its own name.\n const unnamed =\n isMounted &&\n (openOnContext || (target != null && !triggerElement)) &&\n rest['aria-label'] === undefined &&\n rest['aria-labelledby'] === undefined;\n React.useEffect(() => {\n if (!unnamed) return;\n warnOnce(\n 'Menu.Popover:name',\n 'Menu.Popover: this menu has no trigger to name it (a context menu, or a menu placed at a `target` without Menu.Trigger): give Menu.Popover an aria-label or aria-labelledby.',\n );\n }, [unnamed]);\n\n const {\n containerProps: { ref: rovingRef },\n handleKeyDown: rovingKeyDown,\n handleKeyDownCapture: rovingKeyDownCapture,\n handleFocus: rovingFocus,\n focusFirst,\n focusLast,\n } = useRovingTabIndex({\n orientation: 'vertical',\n loop: true,\n typeahead: true,\n manageTabIndex: true,\n itemSelector: MENU_ITEM_SELECTOR,\n });\n\n const mergedRef = useMergedRefs<HTMLDivElement>(\n ref,\n setSurfaceElement,\n rovingRef,\n setFloating,\n presenceRef,\n );\n\n // Lets the trigger move focus into an already open menu (ArrowDown/ArrowUp on the trigger) and\n // the root reach the surface. Only an open surface registers, and it unregisters in the commit\n // that closes the menu: a surface that stays mounted while it exits would otherwise make the next\n // opening focus its (inert) items instead of opening the menu.\n React.useLayoutEffect(() => {\n if (!surface || !open) return;\n registerSurface({ focusFirst, focusLast, surface, layerId, getReturnFocus });\n return () => registerSurface(null);\n }, [surface, open, registerSurface, focusFirst, focusLast, layerId, getReturnFocus]);\n\n // Focus before close, on every close: when the menu closes with focus inside it, focus moves to\n // where the restore would put it (`getCloseFocus`) in the closing commit's mutation phase (a\n // layout effect cleanup), before a surface opened in the same update (a Dialog rendered after\n // the menu, opened by the item that closed it) records the focused element as its opener. The\n // closing surface is still in the document then (it unmounts once its exit phase ends), so that\n // opener would be its item, gone by the time the Dialog closes. The surface is inert from this\n // commit on, so in a browser React cannot put focus back on the item after the commit, and\n // useRestoreFocus, which then finds focus outside, leaves it there: the two must agree on the\n // target. Unmounting is left to useRestoreFocus.\n const unmountingRef = React.useRef(false);\n React.useLayoutEffect(() => {\n unmountingRef.current = false;\n return () => {\n unmountingRef.current = true;\n };\n }, []);\n const focusReturnTargetOnClose = useEventCallback(() => {\n const surfaceElement = surfaceRef.current;\n const active = surfaceElement?.ownerDocument.activeElement;\n if (unmountingRef.current || !surfaceElement || !active || !surfaceElement.contains(active)) {\n return;\n }\n getCloseFocus()?.focus({ preventScroll: true });\n });\n React.useLayoutEffect(() => {\n if (!open) return undefined;\n return focusReturnTargetOnClose;\n }, [open, focusReturnTargetOnClose]);\n\n // Initial focus: the first (or last) enabled item, unless focus is already inside. A hover\n // opening moves no focus.\n React.useLayoutEffect(() => {\n if (!open || !surface) return;\n if (surface.contains(surface.ownerDocument.activeElement)) return;\n const target = takeInitialFocus();\n if (target === 'last') focusLast();\n else if (target === 'first') focusFirst();\n }, [open, surface, takeInitialFocus, focusFirst, focusLast]);\n\n // The initial focus lands before the surface is limited to the available height (floating-ui\n // measures after mount), so it scrolls nothing: once positioned, the focused item (the last one\n // after ArrowUp) is scrolled into view. Later focus moves scroll through the native focus().\n React.useLayoutEffect(() => {\n if (!isPositioned || !surface) return;\n const active = surface.ownerDocument.activeElement as HTMLElement | null;\n if (active && active !== surface && surface.contains(active)) {\n active.scrollIntoView?.({ block: 'nearest' });\n }\n }, [isPositioned, surface]);\n\n // The list the items render in. Its children sit inside the Portal, one portal level deeper.\n // Item activation closes the whole chain; the item under the mouse takes focus while focus is\n // inside the menu tree.\n const portalDepth = React.useContext(PortalDepthContext) + 1;\n const registerCheckable = useCheckableRegistry();\n const { hoverGroup, isHoverFocusing, onPointerMove: listPointerMove } = useMenuListPointer(menu);\n const listContext = React.useMemo<MenuListContextValue>(\n () => ({\n menu,\n isStatic: false,\n portalDepth,\n closeFromItem: closeChain,\n registerCheckable,\n hoverGroup,\n isHoverFocusing,\n }),\n [menu, portalDepth, closeChain, registerCheckable, hoverGroup, isHoverFocusing],\n );\n\n // C-COMPOSE: the consumer's onKeyDown runs first; preventDefault() skips the built-in keys. A key\n // from a portal opened inside the menu (a Popover of an item, a submenu) is that portal's: Tab\n // moves on inside it and never closes the menu.\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || !isOwnEvent(event)) return;\n if (event.key === 'Tab') {\n // Close every menu of the chain and put focus on the root trigger; the default Tab action\n // then continues from there.\n closeChain();\n return;\n }\n // \"Previous\" (ArrowLeft, ArrowRight in RTL) closes a submenu and returns to its trigger item.\n if (\n isSubmenu &&\n !event.altKey &&\n !event.ctrlKey &&\n !event.metaKey &&\n !isEditableTarget(event.target) &&\n getArrowIntent(event.key, {\n orientation: 'horizontal',\n dir: getDirection(event.currentTarget),\n }) === 'prev'\n ) {\n event.preventDefault();\n getReturnFocus()?.focus({ preventScroll: true });\n requestClose();\n return;\n }\n rovingKeyDown(event);\n };\n\n if (!isMounted) return null;\n\n return (\n <Portal layerId={layerId}>\n <MenuListContext.Provider value={listContext}>\n <div\n role=\"menu\"\n {...rest}\n // After the spread: a consumer name wins when it is defined, and a forwarded key that\n // holds `undefined` does not remove the trigger's. A context region's whole text is no\n // name: a context menu is named by aria-label.\n aria-labelledby={\n rest['aria-labelledby'] !== undefined\n ? rest['aria-labelledby']\n : triggerElement && !openOnContext && rest['aria-label'] === undefined\n ? labelledBy\n : undefined\n }\n {...presenceProps}\n ref={mergedRef}\n id={menuId}\n data-state={open ? 'open' : 'closed'}\n data-side={floatingProps['data-side']}\n data-align={floatingProps['data-align']}\n data-roving-container=\"\"\n style={{ ...positionStyle, ...style }}\n onKeyDown={handleKeyDown}\n onKeyDownCapture={withTypeaheadText(\n composeEventHandlers(onKeyDownCapture, rovingKeyDownCapture),\n )}\n onFocus={composeEventHandlers(onFocus, rovingFocus, { checkDefaultPrevented: false })}\n onPointerEnter={composeEventHandlers(onPointerEnter, hoverSurfaceHandlers.onPointerEnter)}\n onPointerLeave={composeEventHandlers(onPointerLeave, hoverSurfaceHandlers.onPointerLeave)}\n onPointerMove={composeEventHandlers(onPointerMove, listPointerMove)}\n onContextMenu={composeEventHandlers(onContextMenu, contextSurfaceHandlers.onContextMenu)}\n className={cn(menuPopoverClasses, className)}\n >\n {children}\n </div>\n </MenuListContext.Provider>\n </Portal>\n );\n};\nMenuPopover.displayName = 'MenuPopover';\n"],"mappings":"21BA+DA,IAAM8C,GAAgB,CAAE,QAAS,EAAG,UAAW,EAAK,EAGpD,SAASC,GAAgB,EAAwD,CAC/E,MAAO,CAAC,CAACC,GAAWA,EAAyB,WAAa,CAC5D,CAYA,SAAgBC,EAAmB,EAIjC,CACA,GAAM,CAACC,GAAclD,EAAM,SAASC,EAAAA,sBAAsB,EACpDkD,EAAmBnD,EAAM,OAAO,EAAK,EAoB3C,MAAO,CAAE,aAAY,gBAnBGA,EAAM,gBAAkBmD,EAAiB,QAAS,CAAC,CAmBtD,EAAiB,cAlBhBjD,EAAAA,iBAAkB,GAA2C,CACjF,GAAIkD,EAAM,cAAgB,SAAWA,EAAM,cAAgB,OAAS,CAACjD,EAAAA,WAAWiD,CAAK,EAAG,OAExF,IAAMC,EADSD,EAAM,OACD,QAAqBhD,EAAAA,kBAAkB,EAG3D,GAFI,CAACiD,GAAQ,CAACD,EAAM,cAAc,SAASC,CAAI,GAC3CA,EAAK,aAAa,eAAe,IAAM,QACvCA,EAAK,cAAc,gBAAkBA,EAAM,OAC/C,IAAIC,EAAOC,EACX,KAAOD,EAAK,QAAQ,EAAOA,EAAK,OAC3BA,EAAK,kBAAkB,GAAK,GAAW,OAAOF,EAAM,QAASA,EAAM,OAAO,IAC/E,EAAiB,QAAU,GAC3BC,EAAK,MAAM,CAAE,cAAe,EAAK,CAAC,EAGlC,mBAAqB,CACnB,EAAiB,QAAU,EAC7B,CAAC,EACH,CACsC,CAAc,CACtD,CAwCA,IAAaG,GAAe,CAC1B,O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":["React","createHoverIntentGroup","useEventCallback","isOwnEvent","MENU_ITEM_SELECTOR","useMenuContext","usePresence","usePopupPosition","getTriggerFocusTarget","isConnectedAndFocusable","useDismiss","useTriggerFocusRef","useRovingTabIndex","useMergedRefs","PortalDepthContext","useCheckableRegistry","isEditableTarget","getArrowIntent","getDirection","Portal","MenuListContext","withTypeaheadText","composeEventHandlers","cn","menuPopoverClassNames","menuPopoverClasses","require_runtime","require_cn","require_dev","require_composeEventHandlers","require_classNames","require_useEventCallback","require_direction","require_focus","require_useRovingTabIndex","require_useMergedRefs","require_usePresence","require_useDismiss","require_Portal","require_usePopupPosition","require_events","require_useRestoreFocus","require_useHoverIntent","require_useTriggerElement","require_Menu_context","require_Menu_shared","react","react_jsx_runtime","SUBMENU_SHIFT","isElementTarget","target","useMenuListPointer","hoverGroup","hoverFocusingRef","event","item","root","menu","MenuPopover","rest","popup","targetElement","surface","setSurface","surfaceRef","setSurfaceElement","element","presenceRef","open","side","isSubmenu","offset","_maxHeight","_maxWidth","positionStyle","floatingProps","setReference","fromContext","contextAnchor","triggerElement","getReturnFocus","opener","openOnContext","contextOpener","triggerRef","returnFocusRef","targetRef","dismiss","triggerFocusRef","openerRef","wasOpenRef","captureOpener","container","doc","isCandidate","el","trigger","active","wasOpen","getCloseFocus","unnamed","isMounted","rovingRef","rovingKeyDown","rovingKeyDownCapture","rovingFocus","mergedRef","ref","setFloating","registerSurface","focusFirst","focusLast","layerId","unmountingRef","focusReturnTargetOnClose","surfaceElement","takeInitialFocus","isPositioned","portalDepth","registerCheckable","listPointerMove","listContext","closeChain","isHoverFocusing","handleKeyDown","onKeyDown","requestClose","labelledBy","presenceProps","menuId","style","onKeyDownCapture","onFocus","onPointerEnter","hoverSurfaceHandlers","onPointerLeave","onPointerMove","onContextMenu","contextSurfaceHandlers","className"],"sources":["../../../src/components/navigation/Menu.popover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { menuPopoverClassNames } from '../../lib/classNames';\nimport type { PopupAlign, PopupSide, PopupTarget } from '../../lib/types';\nimport { composeEventHandlers } from '../../lib/composeEventHandlers';\nimport { warnOnce } from '../../lib/dev';\nimport { getArrowIntent, getDirection } from '../../lib/direction';\nimport { isEditableTarget, isOwnEvent } from '../../lib/events';\nimport { isConnectedAndFocusable } from '../../lib/focus';\nimport { useDismiss } from '../../hooks/useDismiss';\nimport { useEventCallback } from '../../hooks/useEventCallback';\nimport { createHoverIntentGroup, type HoverIntentGroup } from '../../hooks/useHoverIntent';\nimport { useMergedRefs } from '../../hooks/useMergedRefs';\nimport { usePopupPosition } from '../../hooks/usePopupPosition';\nimport { usePresence } from '../../hooks/usePresence';\nimport { useRestoreFocus } from '../../hooks/useRestoreFocus';\nimport { useRovingTabIndex } from '../../hooks/useRovingTabIndex';\nimport { getTriggerFocusTarget, useTriggerFocusRef } from '../../hooks/useTriggerElement';\nimport { Portal, PortalDepthContext } from '../portal/Portal';\nimport { MenuListContext, useCheckableRegistry, useMenuContext } from './Menu.context';\nimport type { MenuContextValue, MenuListContextValue } from './Menu.context';\nimport {\n MENU_ITEM_SELECTOR,\n menuPopoverClasses,\n useStaticMenuPartWarning,\n withTypeaheadText,\n} from './Menu.shared';\n\n/** Properties for the MenuPopover sub-component. */\nexport interface MenuPopoverProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'id'> {\n /**\n * Side of the trigger the menu opens on (`start`/`end` follow the writing direction).\n * @default 'bottom' ('end' in a submenu)\n */\n side?: PopupSide;\n /** Alignment along that side. @default 'start' */\n align?: PopupAlign;\n /** Distance from the trigger in px. @default 4 (0 in a submenu) */\n offset?: number;\n /**\n * Where to place the menu instead of next to `Menu.Trigger`: an element or a `VirtualElement`\n * (a rectangle, such as a point; an inline object is fine). With a controlled `open`, a menu\n * with a `target` needs no trigger; name it with `aria-label`, and give a toggle button you use\n * as the target `aria-haspopup=\"menu\"` and `aria-expanded` yourself (the menu's `id` is\n * generated, so the toggle cannot point `aria-controls` at it). A press on a target element\n * does not close the menu. Hold the element in state (a ref cannot be observed;\n * TeachingPopover's `target` also takes a ref). A menu opened by `openOnContext` is placed at\n * the gesture instead.\n */\n target?: PopupTarget;\n /** Menu items and dividers. */\n children: React.ReactNode;\n /**\n * Ref to the portaled `role=\"menu\"` surface. Its `id` is generated (the trigger's\n * `aria-controls` points to it), and it is labelled by the trigger unless `aria-label` or\n * `aria-labelledby` is given (one that holds `undefined` counts as not given).\n */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/**\n * A submenu with room on neither side of its trigger item is shifted across that side, over its\n * parent menu, to stay inside the viewport (as native and Fluent menus do).\n */\nconst SUBMENU_SHIFT = { padding: 8, crossAxis: true } as const;\n\n/** Whether a `target` is an element (duck typed, so an element of another realm counts). */\nfunction isElementTarget(target: PopupTarget | undefined): target is HTMLElement {\n return !!target && (target as Partial<Node>).nodeType === 1;\n}\n\n/**\n * Internal: the mouse behaviour of a menu list (the static root and every `Menu.Popover`\n * surface). While focus is inside a list of the menu tree (the chain's root list or any of its\n * submenus), a mouse `pointermove` over an enabled item of this list focuses it (`preventScroll`),\n * unless it already has focus or a submenu's safe zone of this list holds the point. Hover moves\n * no focus while focus is elsewhere, so a hover-opened menu or a static menu the user is not in\n * never takes focus from the page, and a Popover, Dialog or other portal opened from an item\n * keeps it. Also returns the list's hover group (the safe zones of its submenu trigger items) and\n * the flag the submenus of the list read while such a focus change runs.\n */\nexport function useMenuListPointer(menu: MenuContextValue): {\n hoverGroup: HoverIntentGroup;\n isHoverFocusing: () => boolean;\n onPointerMove: React.PointerEventHandler<HTMLElement>;\n} {\n const [hoverGroup] = React.useState(createHoverIntentGroup);\n const hoverFocusingRef = React.useRef(false);\n const isHoverFocusing = React.useCallback(() => hoverFocusingRef.current, []);\n const onPointerMove = useEventCallback((event: React.PointerEvent<HTMLElement>) => {\n if (event.pointerType === 'touch' || event.pointerType === 'pen' || !isOwnEvent(event)) return;\n const target = event.target as Element;\n const item = target.closest<HTMLElement>(MENU_ITEM_SELECTOR);\n if (!item || !event.currentTarget.contains(item)) return;\n if (item.getAttribute('aria-disabled') === 'true') return;\n if (item.ownerDocument.activeElement === item) return;\n let root = menu;\n while (root.parent) root = root.parent;\n if (!root.listContainsFocus() || hoverGroup.isHeld(event.clientX, event.clientY)) return;\n hoverFocusingRef.current = true;\n item.focus({ preventScroll: true });\n // A submenu that just lost focus is dismissed (focus outside) in a microtask the focus change\n // queued; the flag is cleared after it.\n queueMicrotask(() => {\n hoverFocusingRef.current = false;\n });\n });\n return { hoverGroup, isHoverFocusing, onPointerMove };\n}\n\n/**\n * The portaled `role=\"menu\"` surface of a popup menu, positioned next to `Menu.Trigger`. A menu\n * taller than the space available scrolls inside the viewport: the surface is limited to the space\n * next to the trigger (`max-height`/`max-width` classes, which a `max-h-*`/`max-w-*` class in\n * `className` or a `style` replaces) and scrolls, and an item that receives focus is scrolled into\n * view. Focus moves to the first (ArrowUp: last) enabled item when it opens; arrows, Home/End and\n * typeahead move between enabled items. Escape closes it and returns focus to the trigger. An\n * outside press closes it and leaves focus where the press put it (on the trigger only when focus\n * was still in the menu or lost to the page). Tab closes it and moves focus to the trigger without\n * preventing the default, so tabbing continues from the trigger (inside a Dialog, the focus trap\n * moves on from there). The trigger here is the element that takes its focus: for a wrapper span,\n * the element inside it that carries the state ARIA (the span itself when you made it the trigger\n * with a `role` such as `button` and `tabIndex={0}`, or when nothing inside it can take focus).\n * Keys from a portal opened inside the menu (a Popover of an item) are left to that portal: Tab\n * there moves on inside it and keeps the menu open.\n *\n * In a submenu it opens at the end side of its trigger item (`side=\"end\"`, `offset={0}`) and\n * flips to fit the viewport; with room on neither side, it overlaps its parent menu inside the\n * viewport. ArrowLeft (ArrowRight in RTL) and Escape close only the submenu and return focus to\n * its trigger item; item activation and Tab close every menu of the chain and put focus on the\n * root trigger.\n *\n * While focus is inside the menu (or one of its submenus), the item under the mouse pointer takes\n * focus, so Enter activates the item you point at. Focus in a Popover, Dialog or other portal\n * opened from an item stays there.\n *\n * A context menu (`openOnContext`) opens at the pointer or at the focused row and returns focus to\n * the element focused at the gesture; it is not labelled by its region, so give it `aria-label`\n * (development warning otherwise), as for a menu placed at a `target` without `Menu.Trigger`.\n *\n * The surface mounts through the presence core (`usePresence`): it carries\n * `data-presence=\"entering\" | \"entered\" | \"exiting\"` and, while it closes, `data-state=\"closed\"`\n * and `inert`, so exit motion classes on `data-presence` keep it on screen until they end. Focus,\n * the dismiss layer and positioning follow the open state, not the exit. Without motion it unmounts\n * as soon as it closes.\n *\n * Also exported as `MenuPopover` (import the flat name from React Server Components).\n */\nexport const MenuPopover = ({\n side,\n align = 'start',\n offset,\n target,\n children,\n className,\n style,\n onKeyDown,\n onKeyDownCapture,\n onFocus,\n onPointerEnter,\n onPointerLeave,\n onPointerMove,\n onContextMenu,\n ref,\n ...rest\n}: MenuPopoverProps) => {\n const menu = useMenuContext('Menu.Popover');\n const {\n popup,\n open,\n takeInitialFocus,\n registerSurface,\n menuId,\n labelledBy,\n triggerRef,\n triggerElement,\n isSubmenu,\n requestClose,\n closeChain,\n dismiss,\n hoverSurfaceHandlers,\n isHoverClose,\n openOnContext,\n contextSurfaceHandlers,\n contextAnchor,\n fromContext,\n contextOpener,\n } = menu;\n useStaticMenuPartWarning('Menu.Popover', popup);\n const targetElement = isElementTarget(target) ? target : null;\n\n const [surface, setSurface] = React.useState<HTMLDivElement | null>(null);\n const surfaceRef = React.useRef<HTMLDivElement | null>(null);\n const setSurfaceElement = React.useCallback((element: HTMLDivElement | null) => {\n surfaceRef.current = element;\n setSurface(element);\n }, []);\n\n // The surface mounts and unmounts through the presence core; everything else below keys on\n // `open`, so focus returns and the layer goes on close, not after an exit motion.\n const { isMounted, ref: presenceRef, presenceProps } = usePresence(open);\n\n const { setReference, setFloating, floatingProps, isPositioned } = usePopupPosition({\n open,\n side: side ?? (isSubmenu ? 'end' : 'bottom'),\n align,\n offset: offset ?? (isSubmenu ? 0 : 4),\n fitViewport: true,\n shift: isSubmenu ? SUBMENU_SHIFT : undefined,\n });\n // The size limits come from menuPopoverClasses, which a consumer class can replace; an inline\n // max-height/max-width would beat every class.\n const { maxHeight: _maxHeight, maxWidth: _maxWidth, ...positionStyle } = floatingProps.style;\n // The positioning reference: the anchor of a context gesture (the point, else the focused row,\n // else the trigger's focus target), else `target`, else the trigger. Kept while the surface\n // exits, so it does not jump; a new inline VirtualElement only recomputes the position.\n React.useLayoutEffect(() => {\n setReference(\n fromContext\n ? (contextAnchor ?? getTriggerFocusTarget(triggerElement) ?? triggerElement)\n : (target ?? triggerElement),\n );\n }, [setReference, contextAnchor, fromContext, target, triggerElement]);\n\n // Where focus returns when the menu closes (item activation, Tab, Escape): in a context menu,\n // the element focused at the gesture when it can take focus; else the element that takes focus\n // for the trigger (for a wrapper span, the element inside it that carries the state ARIA; for a\n // submenu, its trigger item); else a focusable `target` element.\n const getReturnFocus = useEventCallback((): HTMLElement | null => {\n const opener = openOnContext ? contextOpener.current : null;\n if (opener && isConnectedAndFocusable(opener)) return opener;\n const triggerTarget = getTriggerFocusTarget(triggerRef.current);\n if (triggerTarget) return triggerTarget;\n return targetElement && isConnectedAndFocusable(targetElement) ? targetElement : null;\n });\n\n // The layer's anchor (where a surface opened from an item that is gone by then restores focus):\n // the return target, else the trigger itself.\n const returnFocusRef = React.useMemo<React.RefObject<HTMLElement | null>>(\n () => ({\n get current() {\n return getReturnFocus() ?? triggerRef.current;\n },\n }),\n [getReturnFocus, triggerRef],\n );\n // A context region is not part of the layer (a press on another row closes the menu), and a\n // Ctrl+press there is a macOS context click, which moves the menu instead; a target element is.\n const targetRef = { current: targetElement };\n const { layerId } = useDismiss({\n open,\n onDismiss: dismiss,\n refs: openOnContext ? [surfaceRef, targetRef] : [surfaceRef, triggerRef, targetRef],\n anchorRef: returnFocusRef,\n kind: 'menu',\n focusOutside: true,\n outsidePress: openOnContext\n ? (event) =>\n !(\n event.ctrlKey &&\n event.target instanceof Node &&\n triggerRef.current?.contains(event.target)\n )\n : true,\n });\n\n const triggerFocusRef = useTriggerFocusRef(triggerRef);\n\n // The element focused when the menu opened, captured as useRestoreFocus captures its opener: in\n // the commit that opens the menu, before the initial focus moves into it; the trigger's focus\n // target first (not in a context menu, whose region is no opener), else the focused element.\n const openerRef = React.useRef<HTMLElement | null>(null);\n const wasOpenRef = React.useRef(false);\n const captureOpener = useEventCallback(() => {\n const container = surfaceRef.current;\n const doc = (triggerRef.current ?? container)?.ownerDocument ?? document;\n const isCandidate = (el: Element | null | undefined): el is HTMLElement =>\n !!el && el !== doc.body && el !== doc.documentElement && !container?.contains(el);\n const trigger = openOnContext ? null : triggerFocusRef.current;\n const active = doc.activeElement;\n openerRef.current = isCandidate(trigger) ? trigger : isCandidate(active) ? active : null;\n });\n React.useInsertionEffect(() => {\n const wasOpen = wasOpenRef.current;\n wasOpenRef.current = open;\n if (open && !wasOpen) captureOpener();\n });\n // Where focus goes when the menu closes with focus inside it (Escape, a close by the app): where\n // useRestoreFocus would put it, in its order: the context opener, the element focused when the\n // menu opened, then the return target (a menu with a `target` and no trigger returns focus to\n // its opener, not to a focusable target element).\n const getCloseFocus = useEventCallback((): HTMLElement | null => {\n const container = surfaceRef.current;\n const candidates = [\n openOnContext ? contextOpener.current : null,\n openerRef.current,\n getReturnFocus(),\n ];\n return (\n candidates.find(\n (el): el is HTMLElement => !!el && isConnectedAndFocusable(el) && !container?.contains(el),\n ) ?? null\n );\n });\n\n useRestoreFocus({\n enabled: open,\n container: surface,\n // A context menu returns focus to the opener (the focused row), not to the region.\n triggerRef: openOnContext ? undefined : triggerFocusRef,\n finalFocusRef: openOnContext ? contextOpener : undefined,\n fallback: getReturnFocus,\n onlyIfFocusInside: true,\n // A hover close moves no focus (a submenu closing with it is taken along by the hook).\n isHoverClose,\n });\n\n // C-DEV: a surface that no trigger labels needs its own name.\n const unnamed =\n isMounted &&\n (openOnContext || (target != null && !triggerElement)) &&\n rest['aria-label'] === undefined &&\n rest['aria-labelledby'] === undefined;\n React.useEffect(() => {\n if (!unnamed) return;\n warnOnce(\n 'Menu.Popover:name',\n 'Menu.Popover: this menu has no trigger to name it (a context menu, or a menu placed at a `target` without Menu.Trigger): give Menu.Popover an aria-label or aria-labelledby.',\n );\n }, [unnamed]);\n\n const {\n containerProps: { ref: rovingRef },\n handleKeyDown: rovingKeyDown,\n handleKeyDownCapture: rovingKeyDownCapture,\n handleFocus: rovingFocus,\n focusFirst,\n focusLast,\n } = useRovingTabIndex({\n orientation: 'vertical',\n loop: true,\n typeahead: true,\n manageTabIndex: true,\n itemSelector: MENU_ITEM_SELECTOR,\n });\n\n const mergedRef = useMergedRefs<HTMLDivElement>(\n ref,\n setSurfaceElement,\n rovingRef,\n setFloating,\n presenceRef,\n );\n\n // Lets the trigger move focus into an already open menu (ArrowDown/ArrowUp on the trigger) and\n // the root reach the surface. Only an open surface registers, and it unregisters in the commit\n // that closes the menu: a surface that stays mounted while it exits would otherwise make the next\n // opening focus its (inert) items instead of opening the menu.\n React.useLayoutEffect(() => {\n if (!surface || !open) return;\n registerSurface({ focusFirst, focusLast, surface, layerId, getReturnFocus });\n return () => registerSurface(null);\n }, [surface, open, registerSurface, focusFirst, focusLast, layerId, getReturnFocus]);\n\n // Focus before close, on every close: when the menu closes with focus inside it, focus moves to\n // where the restore would put it (`getCloseFocus`) in the closing commit's mutation phase (a\n // layout effect cleanup), before a surface opened in the same update (a Dialog rendered after\n // the menu, opened by the item that closed it) records the focused element as its opener. The\n // closing surface is still in the document then (it unmounts once its exit phase ends), so that\n // opener would be its item, gone by the time the Dialog closes. The surface is inert from this\n // commit on, so in a browser React cannot put focus back on the item after the commit, and\n // useRestoreFocus, which then finds focus outside, leaves it there: the two must agree on the\n // target. Unmounting is left to useRestoreFocus.\n const unmountingRef = React.useRef(false);\n React.useLayoutEffect(() => {\n unmountingRef.current = false;\n return () => {\n unmountingRef.current = true;\n };\n }, []);\n const focusReturnTargetOnClose = useEventCallback(() => {\n const surfaceElement = surfaceRef.current;\n const active = surfaceElement?.ownerDocument.activeElement;\n if (unmountingRef.current || !surfaceElement || !active || !surfaceElement.contains(active)) {\n return;\n }\n getCloseFocus()?.focus({ preventScroll: true });\n });\n React.useLayoutEffect(() => {\n if (!open) return undefined;\n return focusReturnTargetOnClose;\n }, [open, focusReturnTargetOnClose]);\n\n // Initial focus: the first (or last) enabled item, unless focus is already inside. A hover\n // opening moves no focus.\n React.useLayoutEffect(() => {\n if (!open || !surface) return;\n if (surface.contains(surface.ownerDocument.activeElement)) return;\n const target = takeInitialFocus();\n if (target === 'last') focusLast();\n else if (target === 'first') focusFirst();\n }, [open, surface, takeInitialFocus, focusFirst, focusLast]);\n\n // The initial focus lands before the surface is limited to the available height (floating-ui\n // measures after mount), so it scrolls nothing: once positioned, the focused item (the last one\n // after ArrowUp) is scrolled into view. Later focus moves scroll through the native focus().\n React.useLayoutEffect(() => {\n if (!isPositioned || !surface) return;\n const active = surface.ownerDocument.activeElement as HTMLElement | null;\n if (active && active !== surface && surface.contains(active)) {\n active.scrollIntoView?.({ block: 'nearest' });\n }\n }, [isPositioned, surface]);\n\n // The list the items render in. Its children sit inside the Portal, one portal level deeper.\n // Item activation closes the whole chain; the item under the mouse takes focus while focus is\n // inside the menu tree.\n const portalDepth = React.useContext(PortalDepthContext) + 1;\n const registerCheckable = useCheckableRegistry();\n const { hoverGroup, isHoverFocusing, onPointerMove: listPointerMove } = useMenuListPointer(menu);\n const listContext = React.useMemo<MenuListContextValue>(\n () => ({\n menu,\n isStatic: false,\n portalDepth,\n closeFromItem: closeChain,\n registerCheckable,\n hoverGroup,\n isHoverFocusing,\n }),\n [menu, portalDepth, closeChain, registerCheckable, hoverGroup, isHoverFocusing],\n );\n\n // C-COMPOSE: the consumer's onKeyDown runs first; preventDefault() skips the built-in keys. A key\n // from a portal opened inside the menu (a Popover of an item, a submenu) is that portal's: Tab\n // moves on inside it and never closes the menu.\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || !isOwnEvent(event)) return;\n if (event.key === 'Tab') {\n // Close every menu of the chain and put focus on the root trigger; the default Tab action\n // then continues from there.\n closeChain();\n return;\n }\n // \"Previous\" (ArrowLeft, ArrowRight in RTL) closes a submenu and returns to its trigger item.\n if (\n isSubmenu &&\n !event.altKey &&\n !event.ctrlKey &&\n !event.metaKey &&\n !isEditableTarget(event.target) &&\n getArrowIntent(event.key, {\n orientation: 'horizontal',\n dir: getDirection(event.currentTarget),\n }) === 'prev'\n ) {\n event.preventDefault();\n getReturnFocus()?.focus({ preventScroll: true });\n requestClose();\n return;\n }\n rovingKeyDown(event);\n };\n\n if (!isMounted) return null;\n\n return (\n <Portal layerId={layerId}>\n <MenuListContext.Provider value={listContext}>\n <div\n role=\"menu\"\n {...rest}\n // After the spread: a consumer name wins when it is defined, and a forwarded key that\n // holds `undefined` does not remove the trigger's. A context region's whole text is no\n // name: a context menu is named by aria-label.\n aria-labelledby={\n rest['aria-labelledby'] !== undefined\n ? rest['aria-labelledby']\n : triggerElement && !openOnContext && rest['aria-label'] === undefined\n ? labelledBy\n : undefined\n }\n {...presenceProps}\n ref={mergedRef}\n id={menuId}\n data-state={open ? 'open' : 'closed'}\n data-side={floatingProps['data-side']}\n data-align={floatingProps['data-align']}\n data-roving-container=\"\"\n style={{ ...positionStyle, ...style }}\n onKeyDown={handleKeyDown}\n onKeyDownCapture={withTypeaheadText(\n composeEventHandlers(onKeyDownCapture, rovingKeyDownCapture),\n )}\n onFocus={composeEventHandlers(onFocus, rovingFocus, { checkDefaultPrevented: false })}\n onPointerEnter={composeEventHandlers(onPointerEnter, hoverSurfaceHandlers.onPointerEnter)}\n onPointerLeave={composeEventHandlers(onPointerLeave, hoverSurfaceHandlers.onPointerLeave)}\n onPointerMove={composeEventHandlers(onPointerMove, listPointerMove)}\n onContextMenu={composeEventHandlers(onContextMenu, contextSurfaceHandlers.onContextMenu)}\n className={cn(menuPopoverClassNames.root, menuPopoverClasses, className)}\n >\n {children}\n </div>\n </MenuListContext.Provider>\n </Portal>\n );\n};\nMenuPopover.displayName = 'Menu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