@mortenbrudvik/waveui 0.4.0 → 0.7.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 (574) hide show
  1. package/README.md +1221 -173
  2. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  3. package/dist/components/button/Button.cjs +2 -0
  4. package/dist/components/button/Button.cjs.map +1 -0
  5. package/dist/components/button/Button.mjs +50 -0
  6. package/dist/components/button/Button.mjs.map +1 -0
  7. package/dist/components/button/Button.semantics.cjs +2 -0
  8. package/dist/components/button/Button.semantics.cjs.map +1 -0
  9. package/dist/components/button/Button.semantics.mjs +61 -0
  10. package/dist/components/button/Button.semantics.mjs.map +1 -0
  11. package/dist/components/button/Button.slots.cjs +2 -0
  12. package/dist/components/button/Button.slots.cjs.map +1 -0
  13. package/dist/components/button/Button.slots.mjs +47 -0
  14. package/dist/components/button/Button.slots.mjs.map +1 -0
  15. package/dist/components/button/CompoundButton.cjs +2 -0
  16. package/dist/components/button/CompoundButton.cjs.map +1 -0
  17. package/dist/components/button/CompoundButton.mjs +53 -0
  18. package/dist/components/button/CompoundButton.mjs.map +1 -0
  19. package/dist/components/button/Link.cjs +2 -0
  20. package/dist/components/button/Link.cjs.map +1 -0
  21. package/dist/components/button/Link.mjs +37 -0
  22. package/dist/components/button/Link.mjs.map +1 -0
  23. package/dist/components/button/MenuButton.cjs +2 -0
  24. package/dist/components/button/MenuButton.cjs.map +1 -0
  25. package/dist/components/button/MenuButton.mjs +45 -0
  26. package/dist/components/button/MenuButton.mjs.map +1 -0
  27. package/dist/components/button/SplitButton.cjs +2 -0
  28. package/dist/components/button/SplitButton.cjs.map +1 -0
  29. package/dist/components/button/SplitButton.mjs +66 -0
  30. package/dist/components/button/SplitButton.mjs.map +1 -0
  31. package/dist/components/button/ToggleButton.cjs +2 -0
  32. package/dist/components/button/ToggleButton.cjs.map +1 -0
  33. package/dist/components/button/ToggleButton.mjs +65 -0
  34. package/dist/components/button/ToggleButton.mjs.map +1 -0
  35. package/dist/components/button/Toolbar.cjs +2 -0
  36. package/dist/components/button/Toolbar.cjs.map +1 -0
  37. package/dist/components/button/Toolbar.context.cjs +2 -0
  38. package/dist/components/button/Toolbar.context.cjs.map +1 -0
  39. package/dist/components/button/Toolbar.context.mjs +31 -0
  40. package/dist/components/button/Toolbar.context.mjs.map +1 -0
  41. package/dist/components/button/Toolbar.mjs +63 -0
  42. package/dist/components/button/Toolbar.mjs.map +1 -0
  43. package/dist/components/button/Toolbar.parts.cjs +2 -0
  44. package/dist/components/button/Toolbar.parts.cjs.map +1 -0
  45. package/dist/components/button/Toolbar.parts.mjs +131 -0
  46. package/dist/components/button/Toolbar.parts.mjs.map +1 -0
  47. package/dist/components/button/buttonStyles.cjs +2 -0
  48. package/dist/components/button/buttonStyles.cjs.map +1 -0
  49. package/dist/components/button/buttonStyles.mjs +39 -0
  50. package/dist/components/button/buttonStyles.mjs.map +1 -0
  51. package/dist/components/data-display/Avatar.cjs +2 -0
  52. package/dist/components/data-display/Avatar.cjs.map +1 -0
  53. package/dist/components/data-display/Avatar.mjs +157 -0
  54. package/dist/components/data-display/Avatar.mjs.map +1 -0
  55. package/dist/components/data-display/AvatarGroup.cjs +2 -0
  56. package/dist/components/data-display/AvatarGroup.cjs.map +1 -0
  57. package/dist/components/data-display/AvatarGroup.mjs +134 -0
  58. package/dist/components/data-display/AvatarGroup.mjs.map +1 -0
  59. package/dist/components/data-display/Badge.cjs +2 -0
  60. package/dist/components/data-display/Badge.cjs.map +1 -0
  61. package/dist/components/data-display/Badge.colors.cjs +2 -0
  62. package/dist/components/data-display/Badge.colors.cjs.map +1 -0
  63. package/dist/components/data-display/Badge.colors.mjs +58 -0
  64. package/dist/components/data-display/Badge.colors.mjs.map +1 -0
  65. package/dist/components/data-display/Badge.mjs +32 -0
  66. package/dist/components/data-display/Badge.mjs.map +1 -0
  67. package/dist/components/data-display/CounterBadge.cjs +2 -0
  68. package/dist/components/data-display/CounterBadge.cjs.map +1 -0
  69. package/dist/components/data-display/CounterBadge.mjs +28 -0
  70. package/dist/components/data-display/CounterBadge.mjs.map +1 -0
  71. package/dist/components/data-display/Divider.cjs +2 -0
  72. package/dist/components/data-display/Divider.cjs.map +1 -0
  73. package/dist/components/data-display/Divider.mjs +52 -0
  74. package/dist/components/data-display/Divider.mjs.map +1 -0
  75. package/dist/components/data-display/Image.cjs +2 -0
  76. package/dist/components/data-display/Image.cjs.map +1 -0
  77. package/dist/components/data-display/Image.mjs +32 -0
  78. package/dist/components/data-display/Image.mjs.map +1 -0
  79. package/dist/components/data-display/InfoLabel.cjs +2 -0
  80. package/dist/components/data-display/InfoLabel.cjs.map +1 -0
  81. package/dist/components/data-display/InfoLabel.mjs +104 -0
  82. package/dist/components/data-display/InfoLabel.mjs.map +1 -0
  83. package/dist/components/data-display/List.cjs +2 -0
  84. package/dist/components/data-display/List.cjs.map +1 -0
  85. package/dist/components/data-display/List.mjs +381 -0
  86. package/dist/components/data-display/List.mjs.map +1 -0
  87. package/dist/components/data-display/List.registry.cjs +2 -0
  88. package/dist/components/data-display/List.registry.cjs.map +1 -0
  89. package/dist/components/data-display/List.registry.mjs +101 -0
  90. package/dist/components/data-display/List.registry.mjs.map +1 -0
  91. package/dist/components/data-display/Persona.cjs +2 -0
  92. package/dist/components/data-display/Persona.cjs.map +1 -0
  93. package/dist/components/data-display/Persona.mjs +48 -0
  94. package/dist/components/data-display/Persona.mjs.map +1 -0
  95. package/dist/components/data-display/PresenceBadge.cjs +2 -0
  96. package/dist/components/data-display/PresenceBadge.cjs.map +1 -0
  97. package/dist/components/data-display/PresenceBadge.mjs +71 -0
  98. package/dist/components/data-display/PresenceBadge.mjs.map +1 -0
  99. package/dist/components/data-display/Tag.cjs +2 -0
  100. package/dist/components/data-display/Tag.cjs.map +1 -0
  101. package/dist/components/data-display/Tag.mjs +147 -0
  102. package/dist/components/data-display/Tag.mjs.map +1 -0
  103. package/dist/components/feedback/MessageBar.cjs +2 -0
  104. package/dist/components/feedback/MessageBar.cjs.map +1 -0
  105. package/dist/components/feedback/MessageBar.mjs +144 -0
  106. package/dist/components/feedback/MessageBar.mjs.map +1 -0
  107. package/dist/components/feedback/MessageBar.status.cjs +2 -0
  108. package/dist/components/feedback/MessageBar.status.cjs.map +1 -0
  109. package/dist/components/feedback/MessageBar.status.mjs +45 -0
  110. package/dist/components/feedback/MessageBar.status.mjs.map +1 -0
  111. package/dist/components/feedback/ProgressBar.cjs +2 -0
  112. package/dist/components/feedback/ProgressBar.cjs.map +1 -0
  113. package/dist/components/feedback/ProgressBar.mjs +72 -0
  114. package/dist/components/feedback/ProgressBar.mjs.map +1 -0
  115. package/dist/components/feedback/Skeleton.cjs +2 -0
  116. package/dist/components/feedback/Skeleton.cjs.map +1 -0
  117. package/dist/components/feedback/Skeleton.mjs +47 -0
  118. package/dist/components/feedback/Skeleton.mjs.map +1 -0
  119. package/dist/components/feedback/Spinner.cjs +2 -0
  120. package/dist/components/feedback/Spinner.cjs.map +1 -0
  121. package/dist/components/feedback/Spinner.mjs +60 -0
  122. package/dist/components/feedback/Spinner.mjs.map +1 -0
  123. package/dist/components/feedback/Toast.cjs +2 -0
  124. package/dist/components/feedback/Toast.cjs.map +1 -0
  125. package/dist/components/feedback/Toast.mjs +347 -0
  126. package/dist/components/feedback/Toast.mjs.map +1 -0
  127. package/dist/components/input/Checkbox.cjs +2 -0
  128. package/dist/components/input/Checkbox.cjs.map +1 -0
  129. package/dist/components/input/Checkbox.mjs +96 -0
  130. package/dist/components/input/Checkbox.mjs.map +1 -0
  131. package/dist/components/input/ColorPicker.cjs +6 -0
  132. package/dist/components/input/ColorPicker.cjs.map +1 -0
  133. package/dist/components/input/ColorPicker.mjs +236 -0
  134. package/dist/components/input/ColorPicker.mjs.map +1 -0
  135. package/dist/components/input/Combobox.cjs +2 -0
  136. package/dist/components/input/Combobox.cjs.map +1 -0
  137. package/dist/components/input/Combobox.expand.cjs +2 -0
  138. package/dist/components/input/Combobox.expand.cjs.map +1 -0
  139. package/dist/components/input/Combobox.expand.mjs +38 -0
  140. package/dist/components/input/Combobox.expand.mjs.map +1 -0
  141. package/dist/components/input/Combobox.mjs +187 -0
  142. package/dist/components/input/Combobox.mjs.map +1 -0
  143. package/dist/components/input/DatePicker.cjs +2 -0
  144. package/dist/components/input/DatePicker.cjs.map +1 -0
  145. package/dist/components/input/DatePicker.mjs +340 -0
  146. package/dist/components/input/DatePicker.mjs.map +1 -0
  147. package/dist/components/input/Dropdown.cjs +2 -0
  148. package/dist/components/input/Dropdown.cjs.map +1 -0
  149. package/dist/components/input/Dropdown.mjs +128 -0
  150. package/dist/components/input/Dropdown.mjs.map +1 -0
  151. package/dist/components/input/Field.cjs +2 -0
  152. package/dist/components/input/Field.cjs.map +1 -0
  153. package/dist/components/input/Field.mjs +200 -0
  154. package/dist/components/input/Field.mjs.map +1 -0
  155. package/dist/components/input/Input.cjs +2 -0
  156. package/dist/components/input/Input.cjs.map +1 -0
  157. package/dist/components/input/Input.mjs +81 -0
  158. package/dist/components/input/Input.mjs.map +1 -0
  159. package/dist/components/input/Label.cjs +2 -0
  160. package/dist/components/input/Label.cjs.map +1 -0
  161. package/dist/components/input/Label.mjs +28 -0
  162. package/dist/components/input/Label.mjs.map +1 -0
  163. package/dist/components/input/Option.cjs +2 -0
  164. package/dist/components/input/Option.cjs.map +1 -0
  165. package/dist/components/input/Option.mjs +169 -0
  166. package/dist/components/input/Option.mjs.map +1 -0
  167. package/dist/components/input/RadioGroup.cjs +2 -0
  168. package/dist/components/input/RadioGroup.cjs.map +1 -0
  169. package/dist/components/input/RadioGroup.mjs +139 -0
  170. package/dist/components/input/RadioGroup.mjs.map +1 -0
  171. package/dist/components/input/Rating.cjs +2 -0
  172. package/dist/components/input/Rating.cjs.map +1 -0
  173. package/dist/components/input/Rating.mjs +196 -0
  174. package/dist/components/input/Rating.mjs.map +1 -0
  175. package/dist/components/input/SearchBox.cjs +2 -0
  176. package/dist/components/input/SearchBox.cjs.map +1 -0
  177. package/dist/components/input/SearchBox.mjs +205 -0
  178. package/dist/components/input/SearchBox.mjs.map +1 -0
  179. package/dist/components/input/Select.cjs +2 -0
  180. package/dist/components/input/Select.cjs.map +1 -0
  181. package/dist/components/input/Select.mjs +33 -0
  182. package/dist/components/input/Select.mjs.map +1 -0
  183. package/dist/components/input/Slider.cjs +2 -0
  184. package/dist/components/input/Slider.cjs.map +1 -0
  185. package/dist/components/input/Slider.mjs +79 -0
  186. package/dist/components/input/Slider.mjs.map +1 -0
  187. package/dist/components/input/SpinButton.cjs +2 -0
  188. package/dist/components/input/SpinButton.cjs.map +1 -0
  189. package/dist/components/input/SpinButton.mjs +157 -0
  190. package/dist/components/input/SpinButton.mjs.map +1 -0
  191. package/dist/components/input/SwatchPicker.cjs +2 -0
  192. package/dist/components/input/SwatchPicker.cjs.map +1 -0
  193. package/dist/components/input/SwatchPicker.mjs +113 -0
  194. package/dist/components/input/SwatchPicker.mjs.map +1 -0
  195. package/dist/components/input/Switch.cjs +2 -0
  196. package/dist/components/input/Switch.cjs.map +1 -0
  197. package/dist/components/input/Switch.mjs +92 -0
  198. package/dist/components/input/Switch.mjs.map +1 -0
  199. package/dist/components/input/TagPicker.cjs +2 -0
  200. package/dist/components/input/TagPicker.cjs.map +1 -0
  201. package/dist/components/input/TagPicker.mjs +249 -0
  202. package/dist/components/input/TagPicker.mjs.map +1 -0
  203. package/dist/components/input/Textarea.cjs +2 -0
  204. package/dist/components/input/Textarea.cjs.map +1 -0
  205. package/dist/components/input/Textarea.mjs +32 -0
  206. package/dist/components/input/Textarea.mjs.map +1 -0
  207. package/dist/components/input/TimePicker.cjs +2 -0
  208. package/dist/components/input/TimePicker.cjs.map +1 -0
  209. package/dist/components/input/TimePicker.mjs +292 -0
  210. package/dist/components/input/TimePicker.mjs.map +1 -0
  211. package/dist/components/input/colorUtils.cjs +2 -0
  212. package/dist/components/input/colorUtils.cjs.map +1 -0
  213. package/dist/components/input/colorUtils.mjs +96 -0
  214. package/dist/components/input/colorUtils.mjs.map +1 -0
  215. package/dist/components/input/dateUtils.cjs +2 -0
  216. package/dist/components/input/dateUtils.cjs.map +1 -0
  217. package/dist/components/input/dateUtils.mjs +250 -0
  218. package/dist/components/input/dateUtils.mjs.map +1 -0
  219. package/dist/components/input/pickerStyles.cjs +2 -0
  220. package/dist/components/input/pickerStyles.cjs.map +1 -0
  221. package/dist/components/input/pickerStyles.mjs +10 -0
  222. package/dist/components/input/pickerStyles.mjs.map +1 -0
  223. package/dist/components/internal/HiddenInput.cjs +2 -0
  224. package/dist/components/internal/HiddenInput.cjs.map +1 -0
  225. package/dist/components/internal/HiddenInput.mjs +88 -0
  226. package/dist/components/internal/HiddenInput.mjs.map +1 -0
  227. package/dist/components/layout/Accordion.cjs +2 -0
  228. package/dist/components/layout/Accordion.cjs.map +1 -0
  229. package/dist/components/layout/Accordion.mjs +236 -0
  230. package/dist/components/layout/Accordion.mjs.map +1 -0
  231. package/dist/components/layout/Card.cjs +2 -0
  232. package/dist/components/layout/Card.cjs.map +1 -0
  233. package/dist/components/layout/Card.mjs +121 -0
  234. package/dist/components/layout/Card.mjs.map +1 -0
  235. package/dist/components/layout/Carousel.cjs +2 -0
  236. package/dist/components/layout/Carousel.cjs.map +1 -0
  237. package/dist/components/layout/Carousel.mjs +205 -0
  238. package/dist/components/layout/Carousel.mjs.map +1 -0
  239. package/dist/components/layout/Flex.cjs +2 -0
  240. package/dist/components/layout/Flex.cjs.map +1 -0
  241. package/dist/components/layout/Flex.mjs +54 -0
  242. package/dist/components/layout/Flex.mjs.map +1 -0
  243. package/dist/components/layout/Grid.cjs +2 -0
  244. package/dist/components/layout/Grid.cjs.map +1 -0
  245. package/dist/components/layout/Grid.mjs +62 -0
  246. package/dist/components/layout/Grid.mjs.map +1 -0
  247. package/dist/components/layout/Overflow.cjs +2 -0
  248. package/dist/components/layout/Overflow.cjs.map +1 -0
  249. package/dist/components/layout/Overflow.mjs +269 -0
  250. package/dist/components/layout/Overflow.mjs.map +1 -0
  251. package/dist/components/layout/Stack.cjs +2 -0
  252. package/dist/components/layout/Stack.cjs.map +1 -0
  253. package/dist/components/layout/Stack.mjs +39 -0
  254. package/dist/components/layout/Stack.mjs.map +1 -0
  255. package/dist/components/layout/TabList.cjs +2 -0
  256. package/dist/components/layout/TabList.cjs.map +1 -0
  257. package/dist/components/layout/TabList.mjs +238 -0
  258. package/dist/components/layout/TabList.mjs.map +1 -0
  259. package/dist/components/layout/Tree.cjs +2 -0
  260. package/dist/components/layout/Tree.cjs.map +1 -0
  261. package/dist/components/layout/Tree.mjs +220 -0
  262. package/dist/components/layout/Tree.mjs.map +1 -0
  263. package/dist/components/layout/disclosureIds.cjs +2 -0
  264. package/dist/components/layout/disclosureIds.cjs.map +1 -0
  265. package/dist/components/layout/disclosureIds.mjs +12 -0
  266. package/dist/components/layout/disclosureIds.mjs.map +1 -0
  267. package/dist/components/motion/Presence.cjs +2 -0
  268. package/dist/components/motion/Presence.cjs.map +1 -0
  269. package/dist/components/motion/Presence.mjs +35 -0
  270. package/dist/components/motion/Presence.mjs.map +1 -0
  271. package/dist/components/navigation/Breadcrumb.cjs +2 -0
  272. package/dist/components/navigation/Breadcrumb.cjs.map +1 -0
  273. package/dist/components/navigation/Breadcrumb.mjs +144 -0
  274. package/dist/components/navigation/Breadcrumb.mjs.map +1 -0
  275. package/dist/components/navigation/Menu.cjs +2 -0
  276. package/dist/components/navigation/Menu.cjs.map +1 -0
  277. package/dist/components/navigation/Menu.context.cjs +2 -0
  278. package/dist/components/navigation/Menu.context.cjs.map +1 -0
  279. package/dist/components/navigation/Menu.context.mjs +82 -0
  280. package/dist/components/navigation/Menu.context.mjs.map +1 -0
  281. package/dist/components/navigation/Menu.group.cjs +2 -0
  282. package/dist/components/navigation/Menu.group.cjs.map +1 -0
  283. package/dist/components/navigation/Menu.group.mjs +58 -0
  284. package/dist/components/navigation/Menu.group.mjs.map +1 -0
  285. package/dist/components/navigation/Menu.items.cjs +2 -0
  286. package/dist/components/navigation/Menu.items.cjs.map +1 -0
  287. package/dist/components/navigation/Menu.items.mjs +127 -0
  288. package/dist/components/navigation/Menu.items.mjs.map +1 -0
  289. package/dist/components/navigation/Menu.link.cjs +2 -0
  290. package/dist/components/navigation/Menu.link.cjs.map +1 -0
  291. package/dist/components/navigation/Menu.link.mjs +41 -0
  292. package/dist/components/navigation/Menu.link.mjs.map +1 -0
  293. package/dist/components/navigation/Menu.mjs +27 -0
  294. package/dist/components/navigation/Menu.mjs.map +1 -0
  295. package/dist/components/navigation/Menu.popover.cjs +2 -0
  296. package/dist/components/navigation/Menu.popover.cjs.map +1 -0
  297. package/dist/components/navigation/Menu.popover.mjs +231 -0
  298. package/dist/components/navigation/Menu.popover.mjs.map +1 -0
  299. package/dist/components/navigation/Menu.root.cjs +2 -0
  300. package/dist/components/navigation/Menu.root.cjs.map +1 -0
  301. package/dist/components/navigation/Menu.root.mjs +308 -0
  302. package/dist/components/navigation/Menu.root.mjs.map +1 -0
  303. package/dist/components/navigation/Menu.selectable.cjs +2 -0
  304. package/dist/components/navigation/Menu.selectable.cjs.map +1 -0
  305. package/dist/components/navigation/Menu.selectable.mjs +89 -0
  306. package/dist/components/navigation/Menu.selectable.mjs.map +1 -0
  307. package/dist/components/navigation/Menu.shared.cjs +2 -0
  308. package/dist/components/navigation/Menu.shared.cjs.map +1 -0
  309. package/dist/components/navigation/Menu.shared.mjs +23 -0
  310. package/dist/components/navigation/Menu.shared.mjs.map +1 -0
  311. package/dist/components/navigation/Menu.splitGroup.cjs +2 -0
  312. package/dist/components/navigation/Menu.splitGroup.cjs.map +1 -0
  313. package/dist/components/navigation/Menu.splitGroup.mjs +51 -0
  314. package/dist/components/navigation/Menu.splitGroup.mjs.map +1 -0
  315. package/dist/components/navigation/Menu.trigger.cjs +2 -0
  316. package/dist/components/navigation/Menu.trigger.cjs.map +1 -0
  317. package/dist/components/navigation/Menu.trigger.mjs +79 -0
  318. package/dist/components/navigation/Menu.trigger.mjs.map +1 -0
  319. package/dist/components/navigation/Nav.cjs +2 -0
  320. package/dist/components/navigation/Nav.cjs.map +1 -0
  321. package/dist/components/navigation/Nav.mjs +276 -0
  322. package/dist/components/navigation/Nav.mjs.map +1 -0
  323. package/dist/components/navigation/Pagination.cjs +2 -0
  324. package/dist/components/navigation/Pagination.cjs.map +1 -0
  325. package/dist/components/navigation/Pagination.mjs +110 -0
  326. package/dist/components/navigation/Pagination.mjs.map +1 -0
  327. package/dist/components/navigation/Stepper.cjs +2 -0
  328. package/dist/components/navigation/Stepper.cjs.map +1 -0
  329. package/dist/components/navigation/Stepper.mjs +204 -0
  330. package/dist/components/navigation/Stepper.mjs.map +1 -0
  331. package/dist/components/overlays/Dialog.cjs +2 -0
  332. package/dist/components/overlays/Dialog.cjs.map +1 -0
  333. package/dist/components/overlays/Dialog.mjs +180 -0
  334. package/dist/components/overlays/Dialog.mjs.map +1 -0
  335. package/dist/components/overlays/Dialog.shared.cjs +2 -0
  336. package/dist/components/overlays/Dialog.shared.cjs.map +1 -0
  337. package/dist/components/overlays/Dialog.shared.mjs +227 -0
  338. package/dist/components/overlays/Dialog.shared.mjs.map +1 -0
  339. package/dist/components/overlays/Drawer.cjs +2 -0
  340. package/dist/components/overlays/Drawer.cjs.map +1 -0
  341. package/dist/components/overlays/Drawer.mjs +192 -0
  342. package/dist/components/overlays/Drawer.mjs.map +1 -0
  343. package/dist/components/overlays/Popover.cjs +2 -0
  344. package/dist/components/overlays/Popover.cjs.map +1 -0
  345. package/dist/components/overlays/Popover.mjs +365 -0
  346. package/dist/components/overlays/Popover.mjs.map +1 -0
  347. package/dist/components/overlays/Popover.shared.cjs +2 -0
  348. package/dist/components/overlays/Popover.shared.cjs.map +1 -0
  349. package/dist/components/overlays/Popover.shared.mjs +182 -0
  350. package/dist/components/overlays/Popover.shared.mjs.map +1 -0
  351. package/dist/components/overlays/TeachingPopover.cjs +2 -0
  352. package/dist/components/overlays/TeachingPopover.cjs.map +1 -0
  353. package/dist/components/overlays/TeachingPopover.mjs +181 -0
  354. package/dist/components/overlays/TeachingPopover.mjs.map +1 -0
  355. package/dist/components/overlays/Tooltip.cjs +2 -0
  356. package/dist/components/overlays/Tooltip.cjs.map +1 -0
  357. package/dist/components/overlays/Tooltip.mjs +160 -0
  358. package/dist/components/overlays/Tooltip.mjs.map +1 -0
  359. package/dist/components/portal/Portal.cjs +2 -0
  360. package/dist/components/portal/Portal.cjs.map +1 -0
  361. package/dist/components/portal/Portal.mjs +45 -0
  362. package/dist/components/portal/Portal.mjs.map +1 -0
  363. package/dist/components/provider/WaveProvider.cjs +2 -0
  364. package/dist/components/provider/WaveProvider.cjs.map +1 -0
  365. package/dist/components/provider/WaveProvider.mjs +51 -0
  366. package/dist/components/provider/WaveProvider.mjs.map +1 -0
  367. package/dist/components/table/DataGrid.cjs +2 -0
  368. package/dist/components/table/DataGrid.cjs.map +1 -0
  369. package/dist/components/table/DataGrid.mjs +489 -0
  370. package/dist/components/table/DataGrid.mjs.map +1 -0
  371. package/dist/components/table/Table.cjs +2 -0
  372. package/dist/components/table/Table.cjs.map +1 -0
  373. package/dist/components/table/Table.mjs +99 -0
  374. package/dist/components/table/Table.mjs.map +1 -0
  375. package/dist/components/table/useGridNavigation.cjs +2 -0
  376. package/dist/components/table/useGridNavigation.cjs.map +1 -0
  377. package/dist/components/table/useGridNavigation.mjs +336 -0
  378. package/dist/components/table/useGridNavigation.mjs.map +1 -0
  379. package/dist/components/typography/Text.cjs +2 -0
  380. package/dist/components/typography/Text.cjs.map +1 -0
  381. package/dist/components/typography/Text.mjs +38 -0
  382. package/dist/components/typography/Text.mjs.map +1 -0
  383. package/dist/hooks/useAnnounce.cjs +2 -0
  384. package/dist/hooks/useAnnounce.cjs.map +1 -0
  385. package/dist/hooks/useAnnounce.mjs +88 -0
  386. package/dist/hooks/useAnnounce.mjs.map +1 -0
  387. package/dist/hooks/useCheckedValues.cjs +2 -0
  388. package/dist/hooks/useCheckedValues.cjs.map +1 -0
  389. package/dist/hooks/useCheckedValues.mjs +102 -0
  390. package/dist/hooks/useCheckedValues.mjs.map +1 -0
  391. package/dist/hooks/useContextMenuAnchor.cjs +2 -0
  392. package/dist/hooks/useContextMenuAnchor.cjs.map +1 -0
  393. package/dist/hooks/useContextMenuAnchor.mjs +132 -0
  394. package/dist/hooks/useContextMenuAnchor.mjs.map +1 -0
  395. package/dist/hooks/useControllable.cjs +2 -0
  396. package/dist/hooks/useControllable.cjs.map +1 -0
  397. package/dist/hooks/useControllable.mjs +37 -0
  398. package/dist/hooks/useControllable.mjs.map +1 -0
  399. package/dist/hooks/useDirection.cjs +2 -0
  400. package/dist/hooks/useDirection.cjs.map +1 -0
  401. package/dist/hooks/useDirection.mjs +57 -0
  402. package/dist/hooks/useDirection.mjs.map +1 -0
  403. package/dist/hooks/useDismiss.cjs +2 -0
  404. package/dist/hooks/useDismiss.cjs.map +1 -0
  405. package/dist/hooks/useDismiss.mjs +57 -0
  406. package/dist/hooks/useDismiss.mjs.map +1 -0
  407. package/dist/hooks/useEventCallback.cjs +2 -0
  408. package/dist/hooks/useEventCallback.cjs.map +1 -0
  409. package/dist/hooks/useEventCallback.mjs +16 -0
  410. package/dist/hooks/useEventCallback.mjs.map +1 -0
  411. package/dist/hooks/useFieldControl.cjs +2 -0
  412. package/dist/hooks/useFieldControl.cjs.map +1 -0
  413. package/dist/hooks/useFieldControl.mjs +62 -0
  414. package/dist/hooks/useFieldControl.mjs.map +1 -0
  415. package/dist/hooks/useFocusTrap.cjs +2 -0
  416. package/dist/hooks/useFocusTrap.cjs.map +1 -0
  417. package/dist/hooks/useFocusTrap.mjs +266 -0
  418. package/dist/hooks/useFocusTrap.mjs.map +1 -0
  419. package/dist/hooks/useFormReset.cjs +2 -0
  420. package/dist/hooks/useFormReset.cjs.map +1 -0
  421. package/dist/hooks/useFormReset.mjs +33 -0
  422. package/dist/hooks/useFormReset.mjs.map +1 -0
  423. package/dist/hooks/useHoverIntent.cjs +2 -0
  424. package/dist/hooks/useHoverIntent.cjs.map +1 -0
  425. package/dist/hooks/useHoverIntent.mjs +201 -0
  426. package/dist/hooks/useHoverIntent.mjs.map +1 -0
  427. package/dist/hooks/useId.cjs +2 -0
  428. package/dist/hooks/useId.cjs.map +1 -0
  429. package/dist/hooks/useId.mjs +11 -0
  430. package/dist/hooks/useId.mjs.map +1 -0
  431. package/dist/hooks/useIsClient.cjs +2 -0
  432. package/dist/hooks/useIsClient.cjs.map +1 -0
  433. package/dist/hooks/useIsClient.mjs +19 -0
  434. package/dist/hooks/useIsClient.mjs.map +1 -0
  435. package/dist/hooks/useListbox.cjs +2 -0
  436. package/dist/hooks/useListbox.cjs.map +1 -0
  437. package/dist/hooks/useListbox.mjs +492 -0
  438. package/dist/hooks/useListbox.mjs.map +1 -0
  439. package/dist/hooks/useMergedRefs.cjs +2 -0
  440. package/dist/hooks/useMergedRefs.cjs.map +1 -0
  441. package/dist/hooks/useMergedRefs.mjs +57 -0
  442. package/dist/hooks/useMergedRefs.mjs.map +1 -0
  443. package/dist/hooks/useModalIsolation.cjs +2 -0
  444. package/dist/hooks/useModalIsolation.cjs.map +1 -0
  445. package/dist/hooks/useModalIsolation.mjs +87 -0
  446. package/dist/hooks/useModalIsolation.mjs.map +1 -0
  447. package/dist/hooks/useModalLayer.cjs +2 -0
  448. package/dist/hooks/useModalLayer.cjs.map +1 -0
  449. package/dist/hooks/useModalLayer.mjs +30 -0
  450. package/dist/hooks/useModalLayer.mjs.map +1 -0
  451. package/dist/hooks/usePopupPosition.cjs +2 -0
  452. package/dist/hooks/usePopupPosition.cjs.map +1 -0
  453. package/dist/hooks/usePopupPosition.mjs +117 -0
  454. package/dist/hooks/usePopupPosition.mjs.map +1 -0
  455. package/dist/hooks/usePrefersReducedMotion.cjs +2 -0
  456. package/dist/hooks/usePrefersReducedMotion.cjs.map +1 -0
  457. package/dist/hooks/usePrefersReducedMotion.mjs +24 -0
  458. package/dist/hooks/usePrefersReducedMotion.mjs.map +1 -0
  459. package/dist/hooks/usePresence.cjs +2 -0
  460. package/dist/hooks/usePresence.cjs.map +1 -0
  461. package/dist/hooks/usePresence.mjs +136 -0
  462. package/dist/hooks/usePresence.mjs.map +1 -0
  463. package/dist/hooks/usePreserveFocus.cjs +2 -0
  464. package/dist/hooks/usePreserveFocus.cjs.map +1 -0
  465. package/dist/hooks/usePreserveFocus.mjs +50 -0
  466. package/dist/hooks/usePreserveFocus.mjs.map +1 -0
  467. package/dist/hooks/useRestoreFocus.cjs +2 -0
  468. package/dist/hooks/useRestoreFocus.cjs.map +1 -0
  469. package/dist/hooks/useRestoreFocus.mjs +271 -0
  470. package/dist/hooks/useRestoreFocus.mjs.map +1 -0
  471. package/dist/hooks/useRovingTabIndex.cjs +2 -0
  472. package/dist/hooks/useRovingTabIndex.cjs.map +1 -0
  473. package/dist/hooks/useRovingTabIndex.mjs +389 -0
  474. package/dist/hooks/useRovingTabIndex.mjs.map +1 -0
  475. package/dist/hooks/useScrollLock.cjs +2 -0
  476. package/dist/hooks/useScrollLock.cjs.map +1 -0
  477. package/dist/hooks/useScrollLock.mjs +71 -0
  478. package/dist/hooks/useScrollLock.mjs.map +1 -0
  479. package/dist/hooks/useTriggerElement.cjs +2 -0
  480. package/dist/hooks/useTriggerElement.cjs.map +1 -0
  481. package/dist/hooks/useTriggerElement.mjs +126 -0
  482. package/dist/hooks/useTriggerElement.mjs.map +1 -0
  483. package/dist/hooks/useTypeahead.cjs +2 -0
  484. package/dist/hooks/useTypeahead.cjs.map +1 -0
  485. package/dist/hooks/useTypeahead.mjs +38 -0
  486. package/dist/hooks/useTypeahead.mjs.map +1 -0
  487. package/dist/index.cjs +1 -1
  488. package/dist/index.d.cts +9099 -0
  489. package/dist/index.d.ts +7688 -1027
  490. package/dist/index.mjs +91 -5695
  491. package/dist/lib/aria.cjs +2 -0
  492. package/dist/lib/aria.cjs.map +1 -0
  493. package/dist/lib/aria.mjs +29 -0
  494. package/dist/lib/aria.mjs.map +1 -0
  495. package/dist/lib/children.cjs +2 -0
  496. package/dist/lib/children.cjs.map +1 -0
  497. package/dist/lib/children.mjs +37 -0
  498. package/dist/lib/children.mjs.map +1 -0
  499. package/dist/lib/cn.cjs +2 -0
  500. package/dist/lib/cn.cjs.map +1 -0
  501. package/dist/lib/cn.mjs +64 -0
  502. package/dist/lib/cn.mjs.map +1 -0
  503. package/dist/lib/composeEventHandlers.cjs +2 -0
  504. package/dist/lib/composeEventHandlers.cjs.map +1 -0
  505. package/dist/lib/composeEventHandlers.mjs +11 -0
  506. package/dist/lib/composeEventHandlers.mjs.map +1 -0
  507. package/dist/lib/dev.cjs +2 -0
  508. package/dist/lib/dev.cjs.map +1 -0
  509. package/dist/lib/dev.mjs +42 -0
  510. package/dist/lib/dev.mjs.map +1 -0
  511. package/dist/lib/direction.cjs +2 -0
  512. package/dist/lib/direction.cjs.map +1 -0
  513. package/dist/lib/direction.mjs +35 -0
  514. package/dist/lib/direction.mjs.map +1 -0
  515. package/dist/lib/events.cjs +2 -0
  516. package/dist/lib/events.cjs.map +1 -0
  517. package/dist/lib/events.mjs +31 -0
  518. package/dist/lib/events.mjs.map +1 -0
  519. package/dist/lib/focus.cjs +2 -0
  520. package/dist/lib/focus.cjs.map +1 -0
  521. package/dist/lib/focus.mjs +119 -0
  522. package/dist/lib/focus.mjs.map +1 -0
  523. package/dist/lib/globalRegistry.cjs +2 -0
  524. package/dist/lib/globalRegistry.cjs.map +1 -0
  525. package/dist/lib/globalRegistry.mjs +13 -0
  526. package/dist/lib/globalRegistry.mjs.map +1 -0
  527. package/dist/lib/icons.cjs +2 -0
  528. package/dist/lib/icons.cjs.map +1 -0
  529. package/dist/lib/icons.mjs +254 -0
  530. package/dist/lib/icons.mjs.map +1 -0
  531. package/dist/lib/labelInName.cjs +2 -0
  532. package/dist/lib/labelInName.cjs.map +1 -0
  533. package/dist/lib/labelInName.mjs +54 -0
  534. package/dist/lib/labelInName.mjs.map +1 -0
  535. package/dist/lib/layers.cjs +2 -0
  536. package/dist/lib/layers.cjs.map +1 -0
  537. package/dist/lib/layers.mjs +224 -0
  538. package/dist/lib/layers.mjs.map +1 -0
  539. package/dist/lib/mergeProps.cjs +2 -0
  540. package/dist/lib/mergeProps.cjs.map +1 -0
  541. package/dist/lib/mergeProps.mjs +21 -0
  542. package/dist/lib/mergeProps.mjs.map +1 -0
  543. package/dist/lib/mergeRefs.cjs +2 -0
  544. package/dist/lib/mergeRefs.cjs.map +1 -0
  545. package/dist/lib/mergeRefs.mjs +29 -0
  546. package/dist/lib/mergeRefs.mjs.map +1 -0
  547. package/dist/lib/renderTrigger.cjs +2 -0
  548. package/dist/lib/renderTrigger.cjs.map +1 -0
  549. package/dist/lib/renderTrigger.mjs +29 -0
  550. package/dist/lib/renderTrigger.mjs.map +1 -0
  551. package/dist/lib/slot.cjs +2 -0
  552. package/dist/lib/slot.cjs.map +1 -0
  553. package/dist/lib/slot.mjs +122 -0
  554. package/dist/lib/slot.mjs.map +1 -0
  555. package/dist/lib/styles.cjs +2 -0
  556. package/dist/lib/styles.cjs.map +1 -0
  557. package/dist/lib/styles.mjs +16 -0
  558. package/dist/lib/styles.mjs.map +1 -0
  559. package/dist/lib/theme.cjs +2 -0
  560. package/dist/lib/theme.cjs.map +1 -0
  561. package/dist/lib/theme.mjs +16 -0
  562. package/dist/lib/theme.mjs.map +1 -0
  563. package/dist/preflight.css +2 -0
  564. package/dist/styles.css +2 -0
  565. package/package.json +149 -100
  566. package/src/styles/animations.css +7 -39
  567. package/src/styles/base.css +103 -0
  568. package/src/styles/globals.css +10 -22
  569. package/src/styles/legacy-tokens.css +184 -0
  570. package/src/styles/preflight.css +7 -0
  571. package/src/styles/styles.css +32 -0
  572. package/src/styles/tailwind.css +17 -0
  573. package/src/styles/tokens.css +561 -221
  574. package/src/styles/variants.css +29 -0
@@ -0,0 +1,144 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/cn.mjs";
3
+ import { flattenChildren as t, isElementOfType as n } from "../../lib/children.mjs";
4
+ import { warnOnce as r } from "../../lib/dev.mjs";
5
+ import { renderSlot as i, slotRendersContent as a } from "../../lib/slot.mjs";
6
+ import { preventIfDisabled as o } from "../../lib/aria.mjs";
7
+ import { disabledStyles as s, focusRing as c } from "../../lib/styles.mjs";
8
+ import { ChevronRightIcon as l } from "../../lib/icons.mjs";
9
+ import { useTriggerElement as u } from "../../hooks/useTriggerElement.mjs";
10
+ import * as d from "react";
11
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
12
+ //#region src/components/navigation/Breadcrumb.tsx
13
+ var h = e("inline-flex cursor-pointer items-center text-primary no-underline not-disabled:not-aria-disabled:hover:underline", c, s), g = "inline-flex items-center font-semibold text-foreground", _ = e(g, c, s), v = "inline-flex items-center text-foreground", y = /* @__PURE__ */ new Set(["rel", ...Object.keys({
14
+ disabled: !0,
15
+ type: !0,
16
+ form: !0,
17
+ formAction: !0,
18
+ formEncType: !0,
19
+ formMethod: !0,
20
+ formNoValidate: !0,
21
+ formTarget: !0,
22
+ name: !0,
23
+ value: !0,
24
+ target: !0,
25
+ download: !0,
26
+ hrefLang: !0,
27
+ ping: !0,
28
+ media: !0,
29
+ referrerPolicy: !0
30
+ })]);
31
+ function b(e) {
32
+ let t = {};
33
+ for (let n of Object.keys(e)) y.has(n) || (t[n] = e[n]);
34
+ return t;
35
+ }
36
+ var x = ({ children: e, className: n, ref: r, ...i }) => {
37
+ let a = t(e);
38
+ return /* @__PURE__ */ p("nav", {
39
+ ref: r,
40
+ "aria-label": "Breadcrumb",
41
+ ...i,
42
+ className: n,
43
+ children: /* @__PURE__ */ p("ol", {
44
+ className: "m-0 flex list-none items-center gap-1 p-0 text-body-1",
45
+ children: a.map(({ key: e, node: t }, n) => /* @__PURE__ */ m("li", {
46
+ className: "flex items-center gap-1",
47
+ children: [n > 0 && /* @__PURE__ */ p(l, {
48
+ "data-wave-breadcrumb-separator": "",
49
+ className: "shrink-0 text-muted-foreground wave-rtl:-scale-x-100"
50
+ }), t]
51
+ }, e))
52
+ })
53
+ });
54
+ };
55
+ x.displayName = "Breadcrumb";
56
+ function S(e) {
57
+ let t = n(e, "a") ? {
58
+ href: void 0,
59
+ role: "link",
60
+ disabled: void 0
61
+ } : void 0;
62
+ return d.cloneElement(e, {
63
+ ...t,
64
+ "aria-disabled": !0,
65
+ tabIndex: -1,
66
+ onClick: void 0
67
+ });
68
+ }
69
+ function C({ child: e, icon: t, ...n }) {
70
+ let r = t ? d.cloneElement(e, void 0, t, e.props.children) : e, i = u(r, n, { componentName: "Breadcrumb.Item" });
71
+ return /* @__PURE__ */ p(f, { children: i });
72
+ }
73
+ function w(t) {
74
+ let { href: n, current: s = !1, icon: c, asChild: l = !1, children: u, className: f, onClick: y, ref: x, ...w } = t, T = c && a(c) ? i(c, "span", "me-1 inline-flex shrink-0", { "aria-hidden": !0 }) : null, E = l && d.isValidElement(u) ? u : null, D = E ? "child" : s ? "current" : n === void 0 ? y ? "button" : "text" : "link", O = l && E === null, k = w.disabled === !0 && (D === "text" || D === "current"), A = w["aria-disabled"], j = E?.props ?? {}, M = [
75
+ w.disabled,
76
+ A,
77
+ j.disabled,
78
+ j["aria-disabled"]
79
+ ].some((e) => e === !0 || e === "true");
80
+ if (d.useEffect(() => {
81
+ O && r("Breadcrumb.Item:asChild", "Breadcrumb.Item: `asChild` expects a single element child (e.g. a router link); the item was rendered normally instead."), D === "text" && r("Breadcrumb.Item:no-href", "Breadcrumb.Item: a non-current item without `href` or `onClick` renders as plain text, not a link. Pass `href` (or `onClick`, which renders a button) to make it navigable."), k && r("Breadcrumb.Item:disabled", "Breadcrumb.Item: `disabled` applies to link, button and asChild items; it is ignored on a text or current item.");
82
+ }, [
83
+ O,
84
+ D,
85
+ k
86
+ ]), E) {
87
+ let { disabled: t, ...r } = w, i = n !== void 0 && !M ? { href: n } : void 0;
88
+ return /* @__PURE__ */ p(C, {
89
+ ...r,
90
+ ...i,
91
+ ref: x,
92
+ onClick: o(M, y),
93
+ "aria-current": s ? "page" : void 0,
94
+ className: e(s ? _ : h, f),
95
+ icon: T,
96
+ child: M ? S(E) : E
97
+ });
98
+ }
99
+ if (D === "current") return /* @__PURE__ */ m("span", {
100
+ ...b(w),
101
+ ref: x,
102
+ "aria-current": "page",
103
+ onClick: y,
104
+ className: e(g, f),
105
+ children: [T, u]
106
+ });
107
+ if (D === "link") {
108
+ let { disabled: t, ...r } = w;
109
+ return /* @__PURE__ */ m("a", {
110
+ ...r,
111
+ ref: x,
112
+ href: M ? void 0 : n,
113
+ role: M ? "link" : r.role,
114
+ "aria-disabled": M ? !0 : A,
115
+ tabIndex: M ? -1 : r.tabIndex,
116
+ onClick: o(M, y),
117
+ className: e(h, f),
118
+ children: [T, u]
119
+ });
120
+ }
121
+ if (D === "button") {
122
+ let { rel: t, ...n } = w;
123
+ return /* @__PURE__ */ m("button", {
124
+ type: "button",
125
+ ...n,
126
+ ref: x,
127
+ onClick: y,
128
+ className: e(h, f),
129
+ children: [T, u]
130
+ });
131
+ }
132
+ return /* @__PURE__ */ m("span", {
133
+ ...b(w),
134
+ ref: x,
135
+ className: e(v, f),
136
+ children: [T, u]
137
+ });
138
+ }
139
+ w.displayName = "BreadcrumbItem";
140
+ var T = /* @__PURE__ */ Object.assign(x, { Item: w });
141
+ //#endregion
142
+ export { T as Breadcrumb, w as BreadcrumbItem };
143
+
144
+ //# sourceMappingURL=Breadcrumb.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Breadcrumb.mjs","names":["_Fragment","React","linkClasses","cn","focusRing","disabledStyles","currentClasses","currentChildClasses","textClasses","controlOnlyAttributes","spanAttributes","attributes","key","rest","BreadcrumbRoot","items","flattenChildren","children","child","index","ChevronRightIcon","disableLinkChild","anchor","isElementOfType","BreadcrumbItemChild","itemProps","target","icon","node","useTriggerElement","Fragment","BreadcrumbItem","props","renderedIcon","slotRendersContent","renderSlot","asChild","kind","current","href","onClick","invalidAsChild","ignoredDisabled","ariaDisabled","childProps","linkDisabled","value","warnOnce","_disabled","childRest","childHref","preventIfDisabled","className","anchorRest","buttonRest","Breadcrumb"],"sources":["../../../src/components/navigation/Breadcrumb.tsx"],"sourcesContent":["import * as React from 'react';\nimport { preventIfDisabled } from '../../lib/aria';\nimport { flattenChildren, isElementOfType } from '../../lib/children';\nimport { cn } from '../../lib/cn';\nimport type { Slot } from '../../lib/types';\nimport { renderSlot, slotRendersContent } from '../../lib/slot';\nimport { warnOnce } from '../../lib/dev';\nimport { ChevronRightIcon } from '../../lib/icons';\nimport { disabledStyles, focusRing } from '../../lib/styles';\nimport { useTriggerElement } from '../../hooks/useTriggerElement';\n\n/** Properties for the Breadcrumb component. */\nexport interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {\n /**\n * Breadcrumb items to render; each one is placed in its own list item. Fragments are opened, so\n * the items of a conditional group (`{isAdmin && <>…</>}`) each get their own list item too.\n */\n children: React.ReactNode;\n /** Ref to the `<nav>` element. */\n ref?: React.Ref<HTMLElement>;\n}\n\n/**\n * The props of Breadcrumb.Item that every branch shares ({@link BreadcrumbItemAnchorProps},\n * {@link BreadcrumbItemButtonProps}, {@link BreadcrumbItemDynamicProps}).\n */\nexport interface BreadcrumbItemOwnProps {\n /**\n * Whether this item represents the current page (`aria-current=\"page\"`, rendered as text).\n * @default false\n */\n current?: boolean;\n /**\n * Slot for an icon displayed before the item text. Rendered with `aria-hidden=\"true\"`. A falsy\n * icon (`''`, `0`) or a list of nothing renders no icon span.\n */\n icon?: Slot<'span'>;\n /**\n * Merge the item's props (classes, `aria-current`, handlers, ref) onto its single child element\n * instead of rendering an element — for router links:\n * `<Breadcrumb.Item asChild><RouterLink to=\"/docs\">Docs</RouterLink></Breadcrumb.Item>`.\n * The icon is rendered inside the child. The item's `href` is passed on as a default (the\n * element's own `href` wins); with a router link, give the link its destination (`to`) instead.\n * `disabled` or `aria-disabled=\"true\"`, on the item or on the element, makes it an unavailable\n * link: `aria-disabled`, out of the tab order, its own `onClick` dropped and the click cancelled\n * (a router link does not navigate); an `<a>` also loses its `href`.\n * @default false\n */\n asChild?: boolean;\n /** Label content of the breadcrumb item (with `asChild`: the link element). */\n children: React.ReactNode;\n}\n\n/**\n * The attributes only a link has (`target`, `download`, `hrefLang`, `ping`, …). Items without\n * `href` declare them as `undefined`, so they are a type error instead of landing on a `<button>`\n * or `<span>`. `rel` cannot be listed (React types it on every element, RDFa); every non-link item\n * drops it at run time instead.\n */\ntype NoAnchorOnlyAttributes = {\n [\n K in Exclude<\n keyof React.AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof React.ButtonHTMLAttributes<HTMLButtonElement>\n >\n ]?: undefined;\n};\n\n/** Breadcrumb.Item rendered as a link (`href` given): anchor attributes. */\nexport interface BreadcrumbItemAnchorProps\n extends\n BreadcrumbItemOwnProps,\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof BreadcrumbItemOwnProps> {\n /**\n * URL the breadcrumb item links to; renders an `<a>` (unless `current`). With `asChild` it is a\n * default for the element, whose own `href` wins. Required in this branch, so `href`\n * discriminates the union and handlers without `href` are typed as button handlers.\n */\n href: string;\n /**\n * Makes the link unavailable, as Link's `disabled` does: no `href`, `role=\"link\"`,\n * `aria-disabled=\"true\"`, out of the tab order, and the click is cancelled (`onClick` is not\n * called). `aria-disabled=\"true\"` does the same.\n * @default false\n */\n disabled?: boolean;\n /** Ref to the rendered element (`<a>`, or `<span>` for the current item). */\n ref?: React.Ref<HTMLAnchorElement | HTMLSpanElement>;\n}\n\n/**\n * Breadcrumb.Item without `href`: a `<button type=\"button\">` when `onClick` is given (button\n * attributes; `disabled` gives it the disabled look), plain text otherwise. A `rel` is not\n * rendered on either.\n */\nexport interface BreadcrumbItemButtonProps\n extends\n BreadcrumbItemOwnProps,\n NoAnchorOnlyAttributes,\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof BreadcrumbItemOwnProps> {\n /** Items without a link have no `href`. */\n href?: undefined;\n /** Ref to the rendered element (`<button>`, or `<span>` for text and the current item). */\n ref?: React.Ref<HTMLButtonElement | HTMLSpanElement>;\n}\n\n/**\n * Properties for the BreadcrumbItem sub-component: link props with `href`, button props without.\n *\n * A union type (0.4 had an interface): an interface cannot extend it, so extend one branch\n * (`interface X extends BreadcrumbItemAnchorProps`) or intersect\n * (`type X = BreadcrumbItemProps & { … }`). `React.ComponentProps<typeof Breadcrumb.Item>`\n * resolves to the last overload, {@link BreadcrumbItemDynamicProps}.\n */\nexport type BreadcrumbItemProps = BreadcrumbItemAnchorProps | BreadcrumbItemButtonProps;\n\n/**\n * Breadcrumb.Item with an `href` known only at run time (`string | undefined`): a link when it is\n * a string, otherwise a button (with `onClick`) or text. Handlers receive `HTMLElement` events and\n * only the attributes all kinds share are accepted (the 0.4 prop shape). Resolved after the button\n * and link signatures.\n */\nexport interface BreadcrumbItemDynamicProps\n extends\n BreadcrumbItemOwnProps,\n Omit<React.HTMLAttributes<HTMLElement>, keyof BreadcrumbItemOwnProps> {\n /** URL the breadcrumb item links to when defined. */\n href?: string;\n /**\n * Makes a link or button item unavailable (see {@link BreadcrumbItemAnchorProps} and\n * {@link BreadcrumbItemButtonProps}); ignored, with a development warning, on a text or current\n * item.\n * @default false\n */\n disabled?: boolean;\n /** Ref to the rendered element. */\n ref?: React.Ref<HTMLElement>;\n}\n\n/** The props every item kind shares at runtime (the union narrowed by `href`). */\ntype BreadcrumbEntryProps = BreadcrumbItemOwnProps &\n Omit<React.AllHTMLAttributes<HTMLElement>, keyof BreadcrumbItemOwnProps | 'ref'> & {\n ref?: React.Ref<HTMLElement>;\n };\n\n/**\n * Links, buttons and `asChild` elements. The hover underline is gated (C-TOKENS), and the\n * disabled look covers a `disabled` button and an `aria-disabled` link.\n */\nconst linkClasses = cn(\n 'inline-flex cursor-pointer items-center text-primary no-underline not-disabled:not-aria-disabled:hover:underline',\n focusRing,\n disabledStyles,\n);\nconst currentClasses = 'inline-flex items-center font-semibold text-foreground';\n/** A current `asChild` element is the consumer's link: it takes focus and can be disabled. */\nconst currentChildClasses = cn(currentClasses, focusRing, disabledStyles);\nconst textClasses = 'inline-flex items-center text-foreground';\n\n/**\n * The attributes only a `<button>` or an `<a>` has (`disabled`, `type`, `form*`, `name`, `value`;\n * `target`, `download`, `hrefLang`, `ping`, `media`, `referrerPolicy`). The button props allow\n * `disabled` without `onClick`, and a current item keeps its link attributes, so the `<span>` of\n * the text and current items drops them instead of rendering invalid markup\n * (`<span disabled>`, `<span target=\"_blank\">`). Typed as a record so a key React adds to either\n * element's attributes is a compile error until it is listed here. `rel` is dropped as well: React\n * types it on every element (RDFa), but on a breadcrumb it comes with a link.\n */\ntype ControlOnlyAttribute =\n | Exclude<\n keyof React.ButtonHTMLAttributes<HTMLButtonElement>,\n keyof React.HTMLAttributes<HTMLElement>\n >\n | Exclude<\n keyof React.AnchorHTMLAttributes<HTMLAnchorElement>,\n keyof React.HTMLAttributes<HTMLElement> | 'href'\n >;\n\nconst controlOnlyAttributes: ReadonlySet<string> = /* @__PURE__ */ new Set([\n 'rel',\n ...Object.keys({\n disabled: true,\n type: true,\n form: true,\n formAction: true,\n formEncType: true,\n formMethod: true,\n formNoValidate: true,\n formTarget: true,\n name: true,\n value: true,\n target: true,\n download: true,\n hrefLang: true,\n ping: true,\n media: true,\n referrerPolicy: true,\n } satisfies Record<ControlOnlyAttribute, true>),\n]);\n\n/** The props that are valid on the `<span>` of a text or current item. */\nfunction spanAttributes(rest: Record<string, unknown>): React.HTMLAttributes<HTMLSpanElement> {\n const attributes: Record<string, unknown> = {};\n for (const key of Object.keys(rest)) {\n if (!controlOnlyAttributes.has(key)) attributes[key] = rest[key];\n }\n return attributes as React.HTMLAttributes<HTMLSpanElement>;\n}\n\nconst BreadcrumbRoot = ({ children, className, ref, ...rest }: BreadcrumbProps) => {\n // Fragments are opened (`{isAdmin && <>…</>}`), so every crumb gets its own list item and separator.\n const items = flattenChildren(children);\n\n return (\n <nav ref={ref} aria-label=\"Breadcrumb\" {...rest} className={className}>\n <ol className=\"m-0 flex list-none items-center gap-1 p-0 text-body-1\">\n {items.map(({ key, node: child }, index) => (\n <li key={key} className=\"flex items-center gap-1\">\n {index > 0 && (\n <ChevronRightIcon\n data-wave-breadcrumb-separator=\"\"\n className=\"shrink-0 text-muted-foreground wave-rtl:-scale-x-100\"\n />\n )}\n {child}\n </li>\n ))}\n </ol>\n </nav>\n );\n};\nBreadcrumbRoot.displayName = 'Breadcrumb';\n\ninterface BreadcrumbItemChildProps extends React.HTMLAttributes<HTMLElement> {\n /** The item's `href`, a default for the element (the element's own `href` wins). */\n href?: string;\n child: React.ReactElement<{ children?: React.ReactNode }>;\n icon: React.ReactNode;\n ref?: React.Ref<HTMLElement>;\n}\n\n/**\n * Link's disabled contract for an `asChild` element: an `<a>` drops its `href` (it is still\n * announced as a link); any element gets `aria-disabled`, leaves the tab order and loses its own\n * `onClick`. The item's click handler cancels the click, so a router link does not navigate.\n */\nfunction disableLinkChild(\n child: React.ReactElement<{ children?: React.ReactNode }>,\n): React.ReactElement<{ children?: React.ReactNode }> {\n const anchor = isElementOfType(child, 'a')\n ? { href: undefined, role: 'link', disabled: undefined }\n : undefined;\n return React.cloneElement(child as React.ReactElement<Record<string, unknown>>, {\n ...anchor,\n 'aria-disabled': true,\n tabIndex: -1,\n onClick: undefined,\n }) as React.ReactElement<{ children?: React.ReactNode }>;\n}\n\n/**\n * `asChild` rendering: the item's props are merged onto the consumer's element with\n * `useTriggerElement` (the element's own handlers run first and its classes win conflicts; its\n * ref and the item's ref are both attached). The icon is placed inside the element.\n */\nfunction BreadcrumbItemChild({ child, icon, ...itemProps }: BreadcrumbItemChildProps) {\n const target = icon ? React.cloneElement(child, undefined, icon, child.props.children) : child;\n const node = useTriggerElement(target, itemProps, { componentName: 'Breadcrumb.Item' });\n return <>{node}</>;\n}\n\n/**\n * One step of a breadcrumb trail:\n * - `href` → a link (`<a>`, anchor attributes);\n * - `current` → the current page as text (`<span aria-current=\"page\">`);\n * - no `href` with `onClick` → a `<button type=\"button\">` styled as a link;\n * - no `href` and no `onClick` → plain text (`<span>`; development warning for a non-current item);\n * - `asChild` → the props are merged onto the single child element (router links).\n *\n * Typed by overloads, resolved in order: without `href` (button props, button events), with a\n * string `href` (anchor props, anchor events), then an `href` that may be `undefined` at run time\n * ({@link BreadcrumbItemDynamicProps}: `HTMLElement` events).\n *\n * Also exported as `BreadcrumbItem` (import the flat name from React Server Components).\n */\nfunction BreadcrumbItem(props: BreadcrumbItemButtonProps): React.ReactElement;\nfunction BreadcrumbItem(props: BreadcrumbItemAnchorProps): React.ReactElement;\nfunction BreadcrumbItem(props: BreadcrumbItemDynamicProps): React.ReactElement;\nfunction BreadcrumbItem(\n props: BreadcrumbItemProps | BreadcrumbItemDynamicProps,\n): React.ReactElement {\n const {\n href,\n current = false,\n icon,\n asChild = false,\n children,\n className,\n onClick,\n ref,\n ...rest\n } = props as BreadcrumbEntryProps;\n\n // A falsy icon (`icon={name && <Icon />}` with `name` '' or a count of 0) is no icon, as in Nav,\n // Tree and Avatar, and so is a collection whose items render nothing: no empty span and no stray\n // `me-1` margin. The check does not consume a generator: renderSlot still renders its items.\n const renderedIcon =\n icon && slotRendersContent(icon)\n ? renderSlot(icon, 'span', 'me-1 inline-flex shrink-0', { 'aria-hidden': true })\n : null;\n const child =\n asChild && React.isValidElement<{ children?: React.ReactNode }>(children) ? children : null;\n const kind = child\n ? 'child'\n : current\n ? 'current'\n : href !== undefined\n ? 'link'\n : onClick\n ? 'button'\n : 'text';\n\n const invalidAsChild = asChild && child === null;\n const ignoredDisabled = rest.disabled === true && (kind === 'text' || kind === 'current');\n // Link and asChild items follow Link's disabled contract. `<a disabled>` does not block\n // navigation, and an `aria-disabled` link only looks disabled unless the click is cancelled.\n // With asChild the element is the link, so its own `disabled`/`aria-disabled` count too.\n const ariaDisabled = rest['aria-disabled'];\n const childProps = (child?.props ?? {}) as Record<string, unknown>;\n const linkDisabled = [\n rest.disabled,\n ariaDisabled,\n childProps.disabled,\n childProps['aria-disabled'],\n ].some((value) => value === true || value === 'true');\n React.useEffect(() => {\n if (invalidAsChild) {\n warnOnce(\n 'Breadcrumb.Item:asChild',\n 'Breadcrumb.Item: `asChild` expects a single element child (e.g. a router link); the item was rendered normally instead.',\n );\n }\n if (kind === 'text') {\n warnOnce(\n 'Breadcrumb.Item:no-href',\n 'Breadcrumb.Item: a non-current item without `href` or `onClick` renders as plain text, not a link. Pass `href` (or `onClick`, which renders a button) to make it navigable.',\n );\n }\n if (ignoredDisabled) {\n warnOnce(\n 'Breadcrumb.Item:disabled',\n 'Breadcrumb.Item: `disabled` applies to link, button and asChild items; it is ignored on a text or current item.',\n );\n }\n }, [invalidAsChild, kind, ignoredDisabled]);\n\n if (child) {\n const { disabled: _disabled, ...childRest } = rest;\n // Like the other item props, `href` is a default for the element (its own `href` wins). A\n // disabled link has no destination, so it is not passed then.\n const childHref = href !== undefined && !linkDisabled ? { href } : undefined;\n return (\n <BreadcrumbItemChild\n {...(childRest as React.HTMLAttributes<HTMLElement>)}\n {...childHref}\n ref={ref}\n onClick={preventIfDisabled(linkDisabled, onClick)}\n aria-current={current ? 'page' : undefined}\n className={cn(current ? currentChildClasses : linkClasses, className)}\n icon={renderedIcon}\n child={linkDisabled ? disableLinkChild(child) : child}\n />\n );\n }\n\n if (kind === 'current') {\n return (\n <span\n {...spanAttributes(rest)}\n ref={ref as React.Ref<HTMLSpanElement>}\n aria-current=\"page\"\n onClick={onClick}\n className={cn(currentClasses, className)}\n >\n {renderedIcon}\n {children}\n </span>\n );\n }\n\n if (kind === 'link') {\n const { disabled: _disabled, ...anchorRest } = rest;\n return (\n <a\n {...(anchorRest as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n ref={ref as React.Ref<HTMLAnchorElement>}\n href={linkDisabled ? undefined : href}\n role={linkDisabled ? 'link' : anchorRest.role}\n aria-disabled={linkDisabled ? true : ariaDisabled}\n tabIndex={linkDisabled ? -1 : anchorRest.tabIndex}\n onClick={preventIfDisabled(linkDisabled, onClick)}\n className={cn(linkClasses, className)}\n >\n {renderedIcon}\n {children}\n </a>\n );\n }\n\n if (kind === 'button') {\n // `rel` only belongs on a link: a button item drops it, like the text and current items.\n const { rel, ...buttonRest } = rest;\n return (\n <button\n type=\"button\"\n {...(buttonRest as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n ref={ref as React.Ref<HTMLButtonElement>}\n onClick={onClick}\n className={cn(linkClasses, className)}\n >\n {renderedIcon}\n {children}\n </button>\n );\n }\n\n return (\n <span\n {...spanAttributes(rest)}\n ref={ref as React.Ref<HTMLSpanElement>}\n className={cn(textClasses, className)}\n >\n {renderedIcon}\n {children}\n </span>\n );\n}\nBreadcrumbItem.displayName = 'BreadcrumbItem';\n\n/**\n * A breadcrumb trail: a `<nav aria-label=\"Breadcrumb\">` landmark with an ordered list. Each child\n * is placed in its own list item (Fragments are opened, so each of their items gets one too); from\n * the second one on, the item begins with a decorative separator chevron that is mirrored in\n * right-to-left layouts.\n *\n * `Breadcrumb.Item` is also exported as `BreadcrumbItem`: React Server Components import the flat\n * name, because dotted access needs a client file.\n *\n * @example\n * <Breadcrumb>\n * <Breadcrumb.Item href=\"/\">Home</Breadcrumb.Item>\n * <Breadcrumb.Item current>Settings</Breadcrumb.Item>\n * </Breadcrumb>\n */\nexport const Breadcrumb = /* @__PURE__ */ Object.assign(BreadcrumbRoot, {\n Item: BreadcrumbItem,\n});\n\nexport { BreadcrumbItem };\n"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("./Menu.items.cjs"),t=require("./Menu.group.cjs"),n=require("./Menu.link.cjs"),r=require("./Menu.popover.cjs"),i=require("./Menu.trigger.cjs"),a=require("./Menu.root.cjs"),o=require("./Menu.selectable.cjs"),s=require("./Menu.splitGroup.cjs");var c=Object.assign(a.MenuRoot,{Item:e.MenuItem,Divider:e.MenuDivider,Trigger:i.MenuTrigger,Popover:r.MenuPopover,ItemCheckbox:o.MenuItemCheckbox,ItemRadio:o.MenuItemRadio,ItemSwitch:o.MenuItemSwitch,ItemLink:n.MenuItemLink,Group:t.MenuGroup,GroupHeader:t.MenuGroupHeader,SplitGroup:s.MenuSplitGroup});exports.Menu=c,exports.MenuDivider=e.MenuDivider,exports.MenuGroup=t.MenuGroup,exports.MenuGroupHeader=t.MenuGroupHeader,exports.MenuItem=e.MenuItem,exports.MenuItemCheckbox=o.MenuItemCheckbox,exports.MenuItemLink=n.MenuItemLink,exports.MenuItemRadio=o.MenuItemRadio,exports.MenuItemSwitch=o.MenuItemSwitch,exports.MenuPopover=r.MenuPopover,exports.MenuSplitGroup=s.MenuSplitGroup,exports.MenuTrigger=i.MenuTrigger;
2
+ //# sourceMappingURL=Menu.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.cjs","names":["MenuRoot","MenuItem","MenuDivider","MenuTrigger","MenuPopover","MenuItemCheckbox","MenuItemRadio","MenuItemSwitch","MenuItemLink","MenuGroup","MenuGroupHeader","MenuSplitGroup","require_Menu_items","require_Menu_group","require_Menu_link","require_Menu_popover","require_Menu_trigger","require_Menu_root","require_Menu_selectable","require_Menu_splitGroup","Menu"],"sources":["../../../src/components/navigation/Menu.tsx"],"sourcesContent":["import { MenuGroup, MenuGroupHeader } from './Menu.group';\nimport { MenuDivider, MenuItem } from './Menu.items';\nimport { MenuItemLink } from './Menu.link';\nimport { MenuPopover } from './Menu.popover';\nimport { MenuRoot } from './Menu.root';\nimport { MenuItemCheckbox, MenuItemRadio, MenuItemSwitch } from './Menu.selectable';\nimport { MenuSplitGroup } from './Menu.splitGroup';\nimport { MenuTrigger } from './Menu.trigger';\n\nexport type { MenuProps } from './Menu.root';\nexport type { MenuItemProps, MenuDividerProps } from './Menu.items';\nexport type { MenuTriggerProps, MenuTriggerComponentProps } from './Menu.trigger';\nexport type { MenuPopoverProps } from './Menu.popover';\nexport type {\n MenuItemSelectableProps,\n MenuItemCheckboxProps,\n MenuItemRadioProps,\n MenuItemSwitchProps,\n} from './Menu.selectable';\nexport type { MenuItemLinkProps, MenuItemLinkOwnProps } from './Menu.link';\nexport type { MenuGroupProps, MenuGroupHeaderProps } from './Menu.group';\nexport type { MenuSplitGroupProps } from './Menu.splitGroup';\n\n/**\n * A menu of actions (`role=\"menu\"`), in one of two forms:\n *\n * - **Static menu** — `Menu.Item`/`Menu.Divider` children render inline inside the `role=\"menu\"`\n * element. The menu itself is not a tab stop: one item is (the last focused enabled item, else\n * the first enabled one). When every item is disabled, the menu element holds the tab stop\n * instead, so keyboard and screen-reader users still reach it. Arrow keys, Home/End and\n * typeahead move between enabled items; Enter and Space activate the focused item (a Space typed\n * within 500 ms of a typeahead character continues the search instead).\n * - **Popup menu** — with `Menu.Trigger` and `Menu.Popover` children, or whenever `open`,\n * `defaultOpen` or `onOpenChange` is passed (even `false`), the root renders no element of its\n * own: the trigger opens the portaled `Menu.Popover`, item activation returns focus to the\n * trigger and closes it (focus is on the trigger before the menu goes, so a Dialog the item\n * opens returns focus there when it closes), unless `persistOnItemClick` (or the item's own\n * `persistOnClick`) keeps it open. Open state is `open`/`defaultOpen`/`onOpenChange`. With\n * `openOnHover` a mouse pointer resting on the trigger opens it without moving focus; with\n * `openOnContext` the trigger is a context-menu region (a right click, Shift+F10 or the\n * ContextMenu key opens the menu there).\n * - **Submenus** — a `<Menu>` rendered in a menu list (inside `Menu.Popover`, or among the items\n * of a static menu) is a submenu. Its `Menu.Trigger` wraps a `Menu.Item`, which becomes the\n * submenu's trigger item (`aria-haspopup=\"menu\"`, a chevron that mirrors in RTL):\n * ```tsx\n * <Menu.Popover>\n * <Menu>\n * <Menu.Trigger><Menu.Item>Open recent</Menu.Item></Menu.Trigger>\n * <Menu.Popover><Menu.Item>report.docx</Menu.Item></Menu.Popover>\n * </Menu>\n * </Menu.Popover>\n * ```\n * ArrowRight (ArrowLeft in RTL), Enter, Space, a click, or the mouse resting on the item opens\n * the submenu (the keys and the click move focus to its first item); ArrowLeft (ArrowRight in\n * RTL) and Escape close only that submenu and return focus to its item; item activation and Tab\n * close every level and put focus on the root trigger (under a static menu, on the submenu's\n * trigger item). One submenu of a menu is open at a time. It works in static menus too. A Menu\n * inside a Popover or Dialog opened from an item is a root menu of its own, not a submenu.\n * `Menu.SplitGroup` puts an action and the button of its submenu in one row.\n *\n * **Checked values**: `Menu.ItemCheckbox`, `Menu.ItemRadio` and `Menu.ItemSwitch` are bound by\n * `name` and `value` to the Menu's `checkedValues` (`defaultCheckedValues`,\n * `onCheckedValuesChange`), in static and popup menus alike: unlike `open`, they do not make a\n * Menu a popup menu. Space changes a checkable item and keeps the menu open; Enter and a click\n * change it and close a popup menu. A submenu shares its parent's checked values unless it sets\n * `checkedValues` or `defaultCheckedValues` of its own. `Menu.Group` and `Menu.GroupHeader` label\n * a set of items; `Menu.ItemLink` navigates. The item labels line up: once an item of a menu shows\n * a check or an icon, every item keeps that column.\n *\n * **Popup detection**: Menu looks for `Menu.Trigger`/`Menu.Popover` (also under their flat names\n * from a Server Component) among its direct children and inside Fragments only. When they are\n * wrapped in another element or component, pass `open`, `defaultOpen` or `onOpenChange` to force\n * popup mode; otherwise the static `role=\"menu\"` element is rendered around them (development\n * warning). A popup menu renders no root element, so `className`, `ref` and other DOM props on\n * `Menu` are ignored (development warning): put them on `Menu.Popover`. Items rendered in a popup\n * menu outside `Menu.Popover` have no `role=\"menu\"` parent (development warning).\n *\n * Sub-components are also exported under flat names (`MenuItem`, `MenuDivider`, `MenuTrigger`,\n * `MenuPopover`, `MenuItemCheckbox`, `MenuItemRadio`, `MenuItemSwitch`, `MenuItemLink`,\n * `MenuGroup`, `MenuGroupHeader`, `MenuSplitGroup`): React Server Components import those, because\n * dotted access (`Menu.Item`) needs a client file.\n */\nexport const Menu = /* @__PURE__ */ Object.assign(MenuRoot, {\n Item: MenuItem,\n Divider: MenuDivider,\n Trigger: MenuTrigger,\n Popover: MenuPopover,\n ItemCheckbox: MenuItemCheckbox,\n ItemRadio: MenuItemRadio,\n ItemSwitch: MenuItemSwitch,\n ItemLink: MenuItemLink,\n Group: MenuGroup,\n GroupHeader: MenuGroupHeader,\n SplitGroup: MenuSplitGroup,\n});\n\nexport {\n MenuItem,\n MenuDivider,\n MenuTrigger,\n MenuPopover,\n MenuItemCheckbox,\n MenuItemRadio,\n MenuItemSwitch,\n MenuItemLink,\n MenuGroup,\n MenuGroupHeader,\n MenuSplitGroup,\n};\n"],"mappings":"+QAkFA,IAAaoB,EAAuB,OAAO,OAAOpB,EAAAA,SAAU,CAC1D,KAAMC,EAAAA,SACN,QAASC,EAAAA,YACT,QAASC,EAAAA,YACT,QAASC,EAAAA,YACT,aAAcC,EAAAA,iBACd,UAAWC,EAAAA,cACX,WAAYC,EAAAA,eACZ,SAAUC,EAAAA,aACV,MAAOC,EAAAA,UACP,YAAaC,EAAAA,gBACb,WAAYC,EAAAA,cACd,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/dev.cjs"),n=require("../../hooks/useCheckedValues.cjs");let r=require("react");r=e.__toESM(r,1);var i=r.createContext(null);i.displayName=`MenuContext`;var a=r.createContext(null);a.displayName=`MenuListContext`;var o=r.createContext(!1);o.displayName=`MenuSubmenuTriggerContext`;var s=()=>{},c={popup:!0,open:!1,setOpen:s,openWithFocus:s,takeInitialFocus:()=>`first`,registerSurface:s,triggerId:`wave-menu-inert-trigger`,labelledBy:`wave-menu-inert-trigger`,onTriggerId:s,menuId:`wave-menu-inert`,triggerRef:{current:null},triggerElement:null,setTriggerElement:s,parent:null,checked:{values:Object.freeze({}),isChecked:()=>!1,toggle:s,select:s},persistOnItemClick:!1,isSubmenu:!1,requestClose:s,closeChain:s,registerOpenSubmenu:()=>s,listContainsFocus:()=>!1,openDelay:250,closeDelay:250,dismiss:s,isHoverFocusing:()=>!1,isHoverOpen:()=>!1,isHoverClose:()=>!1,hoverTriggerHandlers:{onPointerEnter:s,onPointerMove:s,onPointerLeave:s},hoverSurfaceHandlers:{onPointerEnter:s,onPointerLeave:s},openOnContext:!1,contextTriggerHandlers:{onContextMenu:s,onKeyDown:s},contextSurfaceHandlers:{onContextMenu:s},contextAnchor:null,fromContext:!1,contextOpener:{current:null}};function l(e){return r.useContext(i)||(t.reportMissingContext(e,`Menu`),c)}function u(){return r.useContext(i)}function d(){return r.useContext(a)}function f(e,t){return`Menu: two checkable items of one menu list have the name "${e}" and the value "${t}", so both show as checked. Give every item of a group its own value.`}function p(){return n.useDuplicatePairRegistry(`Menu:duplicate-value`,f)}exports.INERT_MENU_CONTEXT=c,exports.MenuContext=i,exports.MenuListContext=a,exports.MenuSubmenuTriggerContext=o,exports.useCheckableRegistry=p,exports.useMenuContext=l,exports.useMenuListContext=d,exports.useOptionalMenuContext=u;
2
+ //# sourceMappingURL=Menu.context.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.context.cjs","names":["React","useDuplicatePairRegistry","require_runtime","require_dev","require_useCheckedValues","react","MenuContext","MenuListContext","MenuSubmenuTriggerContext","noop","INERT_MENU_CONTEXT","useMenuContext","componentName","useOptionalMenuContext","useMenuListContext","duplicateValueMessage","name","value","useCheckableRegistry"],"sources":["../../../src/components/navigation/Menu.context.ts"],"sourcesContent":["import * as React from 'react';\nimport { useDuplicatePairRegistry, type CheckedValuesApi } from '../../hooks/useCheckedValues';\nimport type { ContextMenuAnchor } from '../../hooks/useContextMenuAnchor';\nimport type { HoverIntent, HoverIntentGroup } from '../../hooks/useHoverIntent';\nimport { reportMissingContext } from '../../lib/dev';\nimport type { DismissReason } from '../../lib/layers';\nimport type { VirtualElement } from '../../lib/types';\n\n/*\n * The contexts of Menu and its parts: the menu (`MenuContext`, one per `<Menu>`), the menu list\n * the items render in (`MenuListContext`: the static root's `role=\"menu\"` element or a\n * `Menu.Popover` surface) and the submenu-trigger marker. Internal; imports no component.\n */\n\n/** Which item an opening focuses (`'none'`: a hover opening, which leaves focus where it is). */\nexport type InitialFocus = 'first' | 'last' | 'none';\n\n/** What an open `Menu.Popover` surface registers with its menu. */\nexport interface MenuSurfaceApi {\n /** Focuses the first enabled item. */\n focusFirst(): void;\n /** Focuses the last enabled item. */\n focusLast(): void;\n /** The surface element. */\n surface: HTMLElement;\n /** The surface's dismiss layer. */\n layerId: string;\n /**\n * Where focus returns when the menu closes from an item, Tab or its chain: the trigger's focus\n * target (a submenu: its trigger item), else a focusable `target` element; `null` when none can\n * take focus.\n */\n getReturnFocus(): HTMLElement | null;\n}\n\n/** What an open submenu registers with the menu it is nested in. */\nexport interface OpenSubmenu {\n /** Closes the submenu: its own open submenu first, then itself. */\n close(): void;\n /** Whether focus is inside the submenu's list or anything opened from it. */\n containsFocus(): boolean;\n /** Whether focus is inside the submenu's list or the list of one of its open submenus. */\n listContainsFocus(): boolean;\n}\n\n/** The state and callbacks of one `<Menu>`, shared by its parts. */\nexport interface MenuContextValue {\n /** Whether the root is in popup mode (renders no element); `false` for the static menu. */\n popup: boolean;\n /** Whether the popup menu is open (always `false` for a static menu). */\n open: boolean;\n /** Opens or closes the popup menu. */\n setOpen: (open: boolean) => void;\n /** Opens the menu and focuses its first or last enabled item (or focuses it when already open). */\n openWithFocus: (target: InitialFocus) => void;\n /** Returns (and resets) the item the next opening should focus. */\n takeInitialFocus: () => InitialFocus;\n /** Registers the open surface (`null` unregisters it). */\n registerSurface: (api: MenuSurfaceApi | null) => void;\n /** The trigger's generated id. */\n triggerId: string;\n /** The trigger element's id (the child's own id wins over `triggerId`). */\n labelledBy: string;\n /** Reports the id the trigger element renders. */\n onTriggerId: (id: string) => void;\n /** The popup surface's id. */\n menuId: string;\n /** The trigger element, for focus and positioning. */\n triggerRef: React.RefObject<HTMLElement | null>;\n /** The trigger element, held in state. */\n triggerElement: HTMLElement | null;\n /** Sets the trigger element (a ref callback). */\n setTriggerElement: (element: HTMLElement | null) => void;\n /** The menu this one is nested in (a submenu), else `null`. */\n parent: MenuContextValue | null;\n /** The checked-values state the items of this menu read and change (own or the parent's). */\n checked: CheckedValuesApi;\n /** Whether activating an item keeps its popup open when the item sets no `persistOnClick`. */\n persistOnItemClick: boolean;\n /**\n * Whether this menu is a submenu: a Menu rendered in a menu list with no portal between the list\n * and the Menu (its `PortalDepthContext` equals the list's `portalDepth`).\n */\n isSubmenu: boolean;\n /**\n * The menu's own close (Escape, an outside press, Tab, item activation, the trigger toggle): it\n * closes its open submenu first (innermost first), then itself. The hover close does the same,\n * marked as one (`isHoverClose`).\n */\n requestClose: () => void;\n /**\n * Closes the whole chain from an item or Tab: focus goes to the return target of the top menu\n * (the root trigger; under a static root, the top submenu's trigger item) when focus is inside\n * the chain or lost, then the top menu closes (its submenus first). A static root does nothing.\n */\n closeChain: () => void;\n /**\n * An open submenu registers here (from a layout effect keyed on its open state); a second one\n * closes the first. Returns the unregister function.\n */\n registerOpenSubmenu: (submenu: OpenSubmenu) => () => void;\n /**\n * Whether focus is inside a list of the menu's chain: its own list (the surface, or the static\n * menu's element) or, recursively, its open submenu's. A portal opened from an item (a Popover,\n * a Dialog, a root Menu inside them) does not count here, although focus there keeps a hover\n * close waiting: the item under the mouse pointer takes focus only while focus is in one of the\n * chain's lists.\n */\n listContainsFocus: () => boolean;\n /** Milliseconds before a hover opening (a submenu inherits its parent's). */\n openDelay: number;\n /** Milliseconds before a hover close (a submenu inherits its parent's). */\n closeDelay: number;\n /**\n * The surface's dismiss-layer close. Focus leaving a submenu for an item of an enclosing list\n * that the mouse pointer is focusing does not close it at once: it becomes a hover-opened\n * submenu and closes after `closeDelay` unless the pointer returns to it or its trigger item.\n * Every other reason closes it through `requestClose`.\n */\n dismiss: (reason: DismissReason, event: Event) => void;\n /**\n * Whether a hovered item of this menu's parent list, or of a list further up the chain, is\n * taking focus right now (focus follows the mouse inside a focused menu tree).\n */\n isHoverFocusing: () => boolean;\n /** Whether the open menu was opened by hover and not pinned since (click, keys, context). */\n isHoverOpen: () => boolean;\n /**\n * Whether the close in flight was asked for by the hover intent (the menu's own hover close);\n * set by that close request, cleared by every other one and by the next opening. A hover close\n * moves no focus (the surface's focus restore reads it).\n */\n isHoverClose: () => boolean;\n /** Hover opening: composed onto the trigger (inert while hover is off). */\n hoverTriggerHandlers: HoverIntent['triggerHandlers'];\n /** Hover opening: composed onto the surface (inert while hover is off). */\n hoverSurfaceHandlers: HoverIntent['surfaceHandlers'];\n /** Whether this is a context menu: `openOnContext` on a root popup menu. */\n openOnContext: boolean;\n /** Context gestures: composed onto the trigger in context mode. */\n contextTriggerHandlers: ContextMenuAnchor['triggerHandlers'];\n /** Composed onto the surface: a context menu keeps the browser's context menu away from it. */\n contextSurfaceHandlers: ContextMenuAnchor['surfaceHandlers'];\n /** The anchor of the last context gesture: a point, or the row focused at a key press. */\n contextAnchor: HTMLElement | VirtualElement | null;\n /** Whether the open (or exiting) menu was opened by a context gesture. */\n fromContext: boolean;\n /** The element focused at the last context gesture: where focus returns first. */\n contextOpener: React.RefObject<HTMLElement | null>;\n}\n\n/** Provided by every menu list: the static root's `role=\"menu\"` and every `Menu.Popover` surface. */\nexport interface MenuListContextValue {\n /** The menu that renders the list. */\n menu: MenuContextValue;\n /** `true` for a static root, `false` for a popover surface. */\n isStatic: boolean;\n /**\n * The `PortalDepthContext` value the list's children see (the static root: the value around\n * it; `Menu.Popover`: its own value + 1, inside its Portal). A Menu is a submenu only when its\n * own depth equals this: a Menu inside a Popover or Dialog opened from the list is not.\n */\n portalDepth: number;\n /**\n * Called by an item that was activated and should close its menu. A popover surface closes the\n * whole chain (`closeChain`: focus goes to the root trigger first, then every menu closes); a\n * static list does nothing.\n */\n closeFromItem: () => void;\n /**\n * Development only (a no-op in production): a checkable item registers its `name`/`value` from\n * an effect and unregisters on cleanup; a second registration of the same pair in one list warns\n * once (`Menu:duplicate-value`), since both items would show as checked.\n */\n registerCheckable: (name: string, value: string) => () => void;\n /** Coordinates the safe zones of the list's submenu trigger items (one group per list). */\n hoverGroup: HoverIntentGroup;\n /**\n * `true` while the list moves focus to the item under the mouse pointer (and until the\n * focus-outside checks that change queued have run).\n */\n isHoverFocusing: () => boolean;\n}\n\nexport const MenuContext = React.createContext<MenuContextValue | null>(null);\nMenuContext.displayName = 'MenuContext';\n\nexport const MenuListContext = React.createContext<MenuListContextValue | null>(null);\nMenuListContext.displayName = 'MenuListContext';\n\n/** `true` inside the element a submenu's `Menu.Trigger` renders (its `Menu.Item`). */\nexport const MenuSubmenuTriggerContext = React.createContext(false);\nMenuSubmenuTriggerContext.displayName = 'MenuSubmenuTriggerContext';\n\nconst noop = () => {};\n\nconst INERT_CHECKED: CheckedValuesApi = {\n values: Object.freeze({}),\n isChecked: () => false,\n toggle: noop,\n select: noop,\n};\n\n/**\n * The inert Menu context: what a misplaced part renders with in production (C-CONTEXT), and the\n * base of the item test harness. A member added to `MenuContextValue` gets its inert value here.\n */\nexport const INERT_MENU_CONTEXT: MenuContextValue = {\n popup: true,\n open: false,\n setOpen: noop,\n openWithFocus: noop,\n takeInitialFocus: () => 'first',\n registerSurface: noop,\n triggerId: 'wave-menu-inert-trigger',\n labelledBy: 'wave-menu-inert-trigger',\n onTriggerId: noop,\n menuId: 'wave-menu-inert',\n triggerRef: { current: null },\n triggerElement: null,\n setTriggerElement: noop,\n parent: null,\n checked: INERT_CHECKED,\n persistOnItemClick: false,\n isSubmenu: false,\n requestClose: noop,\n closeChain: noop,\n registerOpenSubmenu: () => noop,\n listContainsFocus: () => false,\n openDelay: 250,\n closeDelay: 250,\n dismiss: noop,\n isHoverFocusing: () => false,\n isHoverOpen: () => false,\n isHoverClose: () => false,\n hoverTriggerHandlers: { onPointerEnter: noop, onPointerMove: noop, onPointerLeave: noop },\n hoverSurfaceHandlers: { onPointerEnter: noop, onPointerLeave: noop },\n openOnContext: false,\n contextTriggerHandlers: { onContextMenu: noop, onKeyDown: noop },\n contextSurfaceHandlers: { onContextMenu: noop },\n contextAnchor: null,\n fromContext: false,\n contextOpener: { current: null },\n};\n\n/**\n * An inert menu list of the inert menu: closes nothing and registers nothing. The base of the item\n * test harness; a member added to `MenuListContextValue` gets its inert value here.\n */\nexport const INERT_MENU_LIST_CONTEXT: MenuListContextValue = {\n menu: INERT_MENU_CONTEXT,\n isStatic: true,\n portalDepth: 0,\n closeFromItem: noop,\n registerCheckable: () => noop,\n hoverGroup: { isHeld: () => false },\n isHoverFocusing: () => false,\n};\n\n/** C-CONTEXT: throws in development, logs once and returns an inert value in production. */\nexport function useMenuContext(componentName: string): MenuContextValue {\n const context = React.useContext(MenuContext);\n if (context) return context;\n reportMissingContext(componentName, 'Menu');\n return INERT_MENU_CONTEXT;\n}\n\n/** The nearest Menu's context, or `null` outside any Menu (no diagnostics). */\nexport function useOptionalMenuContext(): MenuContextValue | null {\n return React.useContext(MenuContext);\n}\n\n/** The menu list the caller renders in, or `null` outside any list. */\nexport function useMenuListContext(): MenuListContextValue | null {\n return React.useContext(MenuListContext);\n}\n\n/** The warning for two checkable items of one menu list with the same `name`/`value` pair. */\nfunction duplicateValueMessage(name: string, value: string): string {\n return `Menu: two checkable items of one menu list have the name \"${name}\" and the value \"${value}\", so both show as checked. Give every item of a group its own value.`;\n}\n\n/**\n * The `registerCheckable` of one menu list: a count per `name`/`value` pair, kept for the list's\n * lifetime. A second registration of a pair warns once (development only).\n */\nexport function useCheckableRegistry(): MenuListContextValue['registerCheckable'] {\n return useDuplicatePairRegistry('Menu:duplicate-value', duplicateValueMessage);\n}\n"],"mappings":"0LAwLA,IAAaM,EAAcN,EAAM,cAAuC,IAAI,EAC5E,EAAY,YAAc,cAE1B,IAAaO,EAAkBP,EAAM,cAA2C,IAAI,EACpF,EAAgB,YAAc,kBAG9B,IAAaQ,EAA4BR,EAAM,cAAc,EAAK,EAClE,EAA0B,YAAc,4BAExC,IAAMS,MAAa,CAAC,EAaPC,EAAuC,CAClD,MAAO,GACP,KAAM,GACN,QAASD,EACT,cAAeA,EACf,qBAAwB,QACxB,gBAAiBA,EACjB,UAAW,0BACX,WAAY,0BACZ,YAAaA,EACb,OAAQ,kBACR,WAAY,CAAE,QAAS,IAAK,EAC5B,eAAgB,KAChB,kBAAmBA,EACnB,OAAQ,KACR,QAAS,CAzBT,OAAQ,OAAO,OAAO,CAAC,CAAC,EACxB,cAAiB,GACjB,OAAQA,EACR,OAAQA,CAsBC,EACT,mBAAoB,GACpB,UAAW,GACX,aAAcA,EACd,WAAYA,EACZ,wBAA2BA,EAC3B,sBAAyB,GACzB,UAAW,IACX,WAAY,IACZ,QAASA,EACT,oBAAuB,GACvB,gBAAmB,GACnB,iBAAoB,GACpB,qBAAsB,CAAE,eAAgBA,EAAM,cAAeA,EAAM,eAAgBA,CAAK,EACxF,qBAAsB,CAAE,eAAgBA,EAAM,eAAgBA,CAAK,EACnE,cAAe,GACf,uBAAwB,CAAE,cAAeA,EAAM,UAAWA,CAAK,EAC/D,uBAAwB,CAAE,cAAeA,CAAK,EAC9C,cAAe,KACf,YAAa,GACb,cAAe,CAAE,QAAS,IAAK,CACjC,EAiBA,SAAgBE,EAAe,EAAyC,CAItE,OAHgBX,EAAM,WAAWM,CAC7B,IACJH,EAAA,qBAAqBS,EAAe,MAAM,EACnCF,EACT,CAGA,SAAgBG,GAAkD,CAChE,OAAOb,EAAM,WAAWM,CAAW,CACrC,CAGA,SAAgBQ,GAAkD,CAChE,OAAOd,EAAM,WAAWO,CAAe,CACzC,CAGA,SAASQ,EAAsB,EAAc,EAAuB,CAClE,MAAO,6DAA6DC,EAAK,mBAAmBC,EAAM,sEACpG,CAMA,SAAgBC,GAAkE,CAChF,OAAOjB,EAAAA,yBAAyB,uBAAwBc,CAAqB,CAC/E"}
@@ -0,0 +1,82 @@
1
+ "use client";
2
+ import { reportMissingContext as e } from "../../lib/dev.mjs";
3
+ import { useDuplicatePairRegistry as t } from "../../hooks/useCheckedValues.mjs";
4
+ import * as n from "react";
5
+ //#region src/components/navigation/Menu.context.ts
6
+ var r = n.createContext(null);
7
+ r.displayName = "MenuContext";
8
+ var i = n.createContext(null);
9
+ i.displayName = "MenuListContext";
10
+ var a = n.createContext(!1);
11
+ a.displayName = "MenuSubmenuTriggerContext";
12
+ var o = () => {}, s = {
13
+ popup: !0,
14
+ open: !1,
15
+ setOpen: o,
16
+ openWithFocus: o,
17
+ takeInitialFocus: () => "first",
18
+ registerSurface: o,
19
+ triggerId: "wave-menu-inert-trigger",
20
+ labelledBy: "wave-menu-inert-trigger",
21
+ onTriggerId: o,
22
+ menuId: "wave-menu-inert",
23
+ triggerRef: { current: null },
24
+ triggerElement: null,
25
+ setTriggerElement: o,
26
+ parent: null,
27
+ checked: {
28
+ values: Object.freeze({}),
29
+ isChecked: () => !1,
30
+ toggle: o,
31
+ select: o
32
+ },
33
+ persistOnItemClick: !1,
34
+ isSubmenu: !1,
35
+ requestClose: o,
36
+ closeChain: o,
37
+ registerOpenSubmenu: () => o,
38
+ listContainsFocus: () => !1,
39
+ openDelay: 250,
40
+ closeDelay: 250,
41
+ dismiss: o,
42
+ isHoverFocusing: () => !1,
43
+ isHoverOpen: () => !1,
44
+ isHoverClose: () => !1,
45
+ hoverTriggerHandlers: {
46
+ onPointerEnter: o,
47
+ onPointerMove: o,
48
+ onPointerLeave: o
49
+ },
50
+ hoverSurfaceHandlers: {
51
+ onPointerEnter: o,
52
+ onPointerLeave: o
53
+ },
54
+ openOnContext: !1,
55
+ contextTriggerHandlers: {
56
+ onContextMenu: o,
57
+ onKeyDown: o
58
+ },
59
+ contextSurfaceHandlers: { onContextMenu: o },
60
+ contextAnchor: null,
61
+ fromContext: !1,
62
+ contextOpener: { current: null }
63
+ };
64
+ function c(t) {
65
+ return n.useContext(r) || (e(t, "Menu"), s);
66
+ }
67
+ function l() {
68
+ return n.useContext(r);
69
+ }
70
+ function u() {
71
+ return n.useContext(i);
72
+ }
73
+ function d(e, t) {
74
+ return `Menu: two checkable items of one menu list have the name "${e}" and the value "${t}", so both show as checked. Give every item of a group its own value.`;
75
+ }
76
+ function f() {
77
+ return t("Menu:duplicate-value", d);
78
+ }
79
+ //#endregion
80
+ export { s as INERT_MENU_CONTEXT, r as MenuContext, i as MenuListContext, a as MenuSubmenuTriggerContext, f as useCheckableRegistry, c as useMenuContext, u as useMenuListContext, l as useOptionalMenuContext };
81
+
82
+ //# sourceMappingURL=Menu.context.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.context.mjs","names":["React","MenuContext","MenuListContext","MenuSubmenuTriggerContext","noop","INERT_MENU_CONTEXT","useMenuContext","reportMissingContext","componentName","useOptionalMenuContext","useMenuListContext","duplicateValueMessage","name","value","useCheckableRegistry","useDuplicatePairRegistry"],"sources":["../../../src/components/navigation/Menu.context.ts"],"sourcesContent":["import * as React from 'react';\nimport { useDuplicatePairRegistry, type CheckedValuesApi } from '../../hooks/useCheckedValues';\nimport type { ContextMenuAnchor } from '../../hooks/useContextMenuAnchor';\nimport type { HoverIntent, HoverIntentGroup } from '../../hooks/useHoverIntent';\nimport { reportMissingContext } from '../../lib/dev';\nimport type { DismissReason } from '../../lib/layers';\nimport type { VirtualElement } from '../../lib/types';\n\n/*\n * The contexts of Menu and its parts: the menu (`MenuContext`, one per `<Menu>`), the menu list\n * the items render in (`MenuListContext`: the static root's `role=\"menu\"` element or a\n * `Menu.Popover` surface) and the submenu-trigger marker. Internal; imports no component.\n */\n\n/** Which item an opening focuses (`'none'`: a hover opening, which leaves focus where it is). */\nexport type InitialFocus = 'first' | 'last' | 'none';\n\n/** What an open `Menu.Popover` surface registers with its menu. */\nexport interface MenuSurfaceApi {\n /** Focuses the first enabled item. */\n focusFirst(): void;\n /** Focuses the last enabled item. */\n focusLast(): void;\n /** The surface element. */\n surface: HTMLElement;\n /** The surface's dismiss layer. */\n layerId: string;\n /**\n * Where focus returns when the menu closes from an item, Tab or its chain: the trigger's focus\n * target (a submenu: its trigger item), else a focusable `target` element; `null` when none can\n * take focus.\n */\n getReturnFocus(): HTMLElement | null;\n}\n\n/** What an open submenu registers with the menu it is nested in. */\nexport interface OpenSubmenu {\n /** Closes the submenu: its own open submenu first, then itself. */\n close(): void;\n /** Whether focus is inside the submenu's list or anything opened from it. */\n containsFocus(): boolean;\n /** Whether focus is inside the submenu's list or the list of one of its open submenus. */\n listContainsFocus(): boolean;\n}\n\n/** The state and callbacks of one `<Menu>`, shared by its parts. */\nexport interface MenuContextValue {\n /** Whether the root is in popup mode (renders no element); `false` for the static menu. */\n popup: boolean;\n /** Whether the popup menu is open (always `false` for a static menu). */\n open: boolean;\n /** Opens or closes the popup menu. */\n setOpen: (open: boolean) => void;\n /** Opens the menu and focuses its first or last enabled item (or focuses it when already open). */\n openWithFocus: (target: InitialFocus) => void;\n /** Returns (and resets) the item the next opening should focus. */\n takeInitialFocus: () => InitialFocus;\n /** Registers the open surface (`null` unregisters it). */\n registerSurface: (api: MenuSurfaceApi | null) => void;\n /** The trigger's generated id. */\n triggerId: string;\n /** The trigger element's id (the child's own id wins over `triggerId`). */\n labelledBy: string;\n /** Reports the id the trigger element renders. */\n onTriggerId: (id: string) => void;\n /** The popup surface's id. */\n menuId: string;\n /** The trigger element, for focus and positioning. */\n triggerRef: React.RefObject<HTMLElement | null>;\n /** The trigger element, held in state. */\n triggerElement: HTMLElement | null;\n /** Sets the trigger element (a ref callback). */\n setTriggerElement: (element: HTMLElement | null) => void;\n /** The menu this one is nested in (a submenu), else `null`. */\n parent: MenuContextValue | null;\n /** The checked-values state the items of this menu read and change (own or the parent's). */\n checked: CheckedValuesApi;\n /** Whether activating an item keeps its popup open when the item sets no `persistOnClick`. */\n persistOnItemClick: boolean;\n /**\n * Whether this menu is a submenu: a Menu rendered in a menu list with no portal between the list\n * and the Menu (its `PortalDepthContext` equals the list's `portalDepth`).\n */\n isSubmenu: boolean;\n /**\n * The menu's own close (Escape, an outside press, Tab, item activation, the trigger toggle): it\n * closes its open submenu first (innermost first), then itself. The hover close does the same,\n * marked as one (`isHoverClose`).\n */\n requestClose: () => void;\n /**\n * Closes the whole chain from an item or Tab: focus goes to the return target of the top menu\n * (the root trigger; under a static root, the top submenu's trigger item) when focus is inside\n * the chain or lost, then the top menu closes (its submenus first). A static root does nothing.\n */\n closeChain: () => void;\n /**\n * An open submenu registers here (from a layout effect keyed on its open state); a second one\n * closes the first. Returns the unregister function.\n */\n registerOpenSubmenu: (submenu: OpenSubmenu) => () => void;\n /**\n * Whether focus is inside a list of the menu's chain: its own list (the surface, or the static\n * menu's element) or, recursively, its open submenu's. A portal opened from an item (a Popover,\n * a Dialog, a root Menu inside them) does not count here, although focus there keeps a hover\n * close waiting: the item under the mouse pointer takes focus only while focus is in one of the\n * chain's lists.\n */\n listContainsFocus: () => boolean;\n /** Milliseconds before a hover opening (a submenu inherits its parent's). */\n openDelay: number;\n /** Milliseconds before a hover close (a submenu inherits its parent's). */\n closeDelay: number;\n /**\n * The surface's dismiss-layer close. Focus leaving a submenu for an item of an enclosing list\n * that the mouse pointer is focusing does not close it at once: it becomes a hover-opened\n * submenu and closes after `closeDelay` unless the pointer returns to it or its trigger item.\n * Every other reason closes it through `requestClose`.\n */\n dismiss: (reason: DismissReason, event: Event) => void;\n /**\n * Whether a hovered item of this menu's parent list, or of a list further up the chain, is\n * taking focus right now (focus follows the mouse inside a focused menu tree).\n */\n isHoverFocusing: () => boolean;\n /** Whether the open menu was opened by hover and not pinned since (click, keys, context). */\n isHoverOpen: () => boolean;\n /**\n * Whether the close in flight was asked for by the hover intent (the menu's own hover close);\n * set by that close request, cleared by every other one and by the next opening. A hover close\n * moves no focus (the surface's focus restore reads it).\n */\n isHoverClose: () => boolean;\n /** Hover opening: composed onto the trigger (inert while hover is off). */\n hoverTriggerHandlers: HoverIntent['triggerHandlers'];\n /** Hover opening: composed onto the surface (inert while hover is off). */\n hoverSurfaceHandlers: HoverIntent['surfaceHandlers'];\n /** Whether this is a context menu: `openOnContext` on a root popup menu. */\n openOnContext: boolean;\n /** Context gestures: composed onto the trigger in context mode. */\n contextTriggerHandlers: ContextMenuAnchor['triggerHandlers'];\n /** Composed onto the surface: a context menu keeps the browser's context menu away from it. */\n contextSurfaceHandlers: ContextMenuAnchor['surfaceHandlers'];\n /** The anchor of the last context gesture: a point, or the row focused at a key press. */\n contextAnchor: HTMLElement | VirtualElement | null;\n /** Whether the open (or exiting) menu was opened by a context gesture. */\n fromContext: boolean;\n /** The element focused at the last context gesture: where focus returns first. */\n contextOpener: React.RefObject<HTMLElement | null>;\n}\n\n/** Provided by every menu list: the static root's `role=\"menu\"` and every `Menu.Popover` surface. */\nexport interface MenuListContextValue {\n /** The menu that renders the list. */\n menu: MenuContextValue;\n /** `true` for a static root, `false` for a popover surface. */\n isStatic: boolean;\n /**\n * The `PortalDepthContext` value the list's children see (the static root: the value around\n * it; `Menu.Popover`: its own value + 1, inside its Portal). A Menu is a submenu only when its\n * own depth equals this: a Menu inside a Popover or Dialog opened from the list is not.\n */\n portalDepth: number;\n /**\n * Called by an item that was activated and should close its menu. A popover surface closes the\n * whole chain (`closeChain`: focus goes to the root trigger first, then every menu closes); a\n * static list does nothing.\n */\n closeFromItem: () => void;\n /**\n * Development only (a no-op in production): a checkable item registers its `name`/`value` from\n * an effect and unregisters on cleanup; a second registration of the same pair in one list warns\n * once (`Menu:duplicate-value`), since both items would show as checked.\n */\n registerCheckable: (name: string, value: string) => () => void;\n /** Coordinates the safe zones of the list's submenu trigger items (one group per list). */\n hoverGroup: HoverIntentGroup;\n /**\n * `true` while the list moves focus to the item under the mouse pointer (and until the\n * focus-outside checks that change queued have run).\n */\n isHoverFocusing: () => boolean;\n}\n\nexport const MenuContext = React.createContext<MenuContextValue | null>(null);\nMenuContext.displayName = 'MenuContext';\n\nexport const MenuListContext = React.createContext<MenuListContextValue | null>(null);\nMenuListContext.displayName = 'MenuListContext';\n\n/** `true` inside the element a submenu's `Menu.Trigger` renders (its `Menu.Item`). */\nexport const MenuSubmenuTriggerContext = React.createContext(false);\nMenuSubmenuTriggerContext.displayName = 'MenuSubmenuTriggerContext';\n\nconst noop = () => {};\n\nconst INERT_CHECKED: CheckedValuesApi = {\n values: Object.freeze({}),\n isChecked: () => false,\n toggle: noop,\n select: noop,\n};\n\n/**\n * The inert Menu context: what a misplaced part renders with in production (C-CONTEXT), and the\n * base of the item test harness. A member added to `MenuContextValue` gets its inert value here.\n */\nexport const INERT_MENU_CONTEXT: MenuContextValue = {\n popup: true,\n open: false,\n setOpen: noop,\n openWithFocus: noop,\n takeInitialFocus: () => 'first',\n registerSurface: noop,\n triggerId: 'wave-menu-inert-trigger',\n labelledBy: 'wave-menu-inert-trigger',\n onTriggerId: noop,\n menuId: 'wave-menu-inert',\n triggerRef: { current: null },\n triggerElement: null,\n setTriggerElement: noop,\n parent: null,\n checked: INERT_CHECKED,\n persistOnItemClick: false,\n isSubmenu: false,\n requestClose: noop,\n closeChain: noop,\n registerOpenSubmenu: () => noop,\n listContainsFocus: () => false,\n openDelay: 250,\n closeDelay: 250,\n dismiss: noop,\n isHoverFocusing: () => false,\n isHoverOpen: () => false,\n isHoverClose: () => false,\n hoverTriggerHandlers: { onPointerEnter: noop, onPointerMove: noop, onPointerLeave: noop },\n hoverSurfaceHandlers: { onPointerEnter: noop, onPointerLeave: noop },\n openOnContext: false,\n contextTriggerHandlers: { onContextMenu: noop, onKeyDown: noop },\n contextSurfaceHandlers: { onContextMenu: noop },\n contextAnchor: null,\n fromContext: false,\n contextOpener: { current: null },\n};\n\n/**\n * An inert menu list of the inert menu: closes nothing and registers nothing. The base of the item\n * test harness; a member added to `MenuListContextValue` gets its inert value here.\n */\nexport const INERT_MENU_LIST_CONTEXT: MenuListContextValue = {\n menu: INERT_MENU_CONTEXT,\n isStatic: true,\n portalDepth: 0,\n closeFromItem: noop,\n registerCheckable: () => noop,\n hoverGroup: { isHeld: () => false },\n isHoverFocusing: () => false,\n};\n\n/** C-CONTEXT: throws in development, logs once and returns an inert value in production. */\nexport function useMenuContext(componentName: string): MenuContextValue {\n const context = React.useContext(MenuContext);\n if (context) return context;\n reportMissingContext(componentName, 'Menu');\n return INERT_MENU_CONTEXT;\n}\n\n/** The nearest Menu's context, or `null` outside any Menu (no diagnostics). */\nexport function useOptionalMenuContext(): MenuContextValue | null {\n return React.useContext(MenuContext);\n}\n\n/** The menu list the caller renders in, or `null` outside any list. */\nexport function useMenuListContext(): MenuListContextValue | null {\n return React.useContext(MenuListContext);\n}\n\n/** The warning for two checkable items of one menu list with the same `name`/`value` pair. */\nfunction duplicateValueMessage(name: string, value: string): string {\n return `Menu: two checkable items of one menu list have the name \"${name}\" and the value \"${value}\", so both show as checked. Give every item of a group its own value.`;\n}\n\n/**\n * The `registerCheckable` of one menu list: a count per `name`/`value` pair, kept for the list's\n * lifetime. A second registration of a pair warns once (development only).\n */\nexport function useCheckableRegistry(): MenuListContextValue['registerCheckable'] {\n return useDuplicatePairRegistry('Menu:duplicate-value', duplicateValueMessage);\n}\n"],"mappings":";;;;;AAwLA,IAAaC,IAAcD,EAAM,cAAuC,IAAI;AAC5E,EAAY,cAAc;AAE1B,IAAaE,IAAkBF,EAAM,cAA2C,IAAI;AACpF,EAAgB,cAAc;AAG9B,IAAaG,IAA4BH,EAAM,cAAc,EAAK;AAClE,EAA0B,cAAc;AAExC,IAAMI,UAAa,CAAC,GAaPC,IAAuC;CAClD,OAAO;CACP,MAAM;CACN,SAASD;CACT,eAAeA;CACf,wBAAwB;CACxB,iBAAiBA;CACjB,WAAW;CACX,YAAY;CACZ,aAAaA;CACb,QAAQ;CACR,YAAY,EAAE,SAAS,KAAK;CAC5B,gBAAgB;CAChB,mBAAmBA;CACnB,QAAQ;CACR,SAAS;EAzBT,QAAQ,OAAO,OAAO,CAAC,CAAC;EACxB,iBAAiB;EACjB,QAAQA;EACR,QAAQA;CAsBC;CACT,oBAAoB;CACpB,WAAW;CACX,cAAcA;CACd,YAAYA;CACZ,2BAA2BA;CAC3B,yBAAyB;CACzB,WAAW;CACX,YAAY;CACZ,SAASA;CACT,uBAAuB;CACvB,mBAAmB;CACnB,oBAAoB;CACpB,sBAAsB;EAAE,gBAAgBA;EAAM,eAAeA;EAAM,gBAAgBA;CAAK;CACxF,sBAAsB;EAAE,gBAAgBA;EAAM,gBAAgBA;CAAK;CACnE,eAAe;CACf,wBAAwB;EAAE,eAAeA;EAAM,WAAWA;CAAK;CAC/D,wBAAwB,EAAE,eAAeA,EAAK;CAC9C,eAAe;CACf,aAAa;CACb,eAAe,EAAE,SAAS,KAAK;AACjC;AAiBA,SAAgBE,EAAe,GAAyC;CAItE,OAHgBN,EAAM,WAAWC,CAC7B,MACJM,EAAqBC,GAAe,MAAM,GACnCH;AACT;AAGA,SAAgBI,IAAkD;CAChE,OAAOT,EAAM,WAAWC,CAAW;AACrC;AAGA,SAAgBS,IAAkD;CAChE,OAAOV,EAAM,WAAWE,CAAe;AACzC;AAGA,SAASS,EAAsB,GAAc,GAAuB;CAClE,OAAO,6DAA6DC,EAAK,mBAAmBC,EAAM;AACpG;AAMA,SAAgBC,IAAkE;CAChF,OAAOC,EAAyB,wBAAwBJ,CAAqB;AAC/E"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/children.cjs"),r=require("../../lib/dev.cjs"),i=require("../../hooks/useId.cjs"),a=require("./Menu.items.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=o.createContext(null);c.displayName=`MenuGroupContext`;var l={headerId:``,headerProps:void 0,labelled:!0};function u(e){return o.useContext(c)||(r.reportMissingContext(e,`Menu.Group`),l)}var d=({children:e,ref:t,...r})=>{let a=i.useId(`menu-group-header`),l=n.flattenChildren(e).find(({node:e})=>n.isElementOfType(e,f))?.node,u=l?.props,d=u?.id||a,p=r[`aria-label`]!==void 0||r[`aria-labelledby`]!==void 0,m=l!==void 0||p,h=p?r[`aria-labelledby`]:l===void 0?void 0:d,g=o.useMemo(()=>({headerId:d,headerProps:u,labelled:m}),[d,u,m]);return(0,s.jsx)(c.Provider,{value:g,children:(0,s.jsx)(`div`,{role:`group`,...r,ref:t,"aria-labelledby":h,children:e})})};d.displayName=`MenuGroup`;var f=e=>{let{id:n,className:i,children:c,ref:l,...d}=e,f=u(`Menu.GroupHeader`),p=f.headerProps===e,m=null;return!p&&f.headerProps!==void 0?m=`extra-header`:!p&&!f.labelled&&(m=`unlabelled`),o.useEffect(()=>{m===`unlabelled`?r.warnOnce(`Menu.GroupHeader:unlabelled`,`Menu.GroupHeader: this header is not a direct child of Menu.Group (or of a Fragment in it), so it does not label the group. Make it a direct child, or pass aria-label to Menu.Group.`):m===`extra-header`&&r.warnOnce(`Menu.GroupHeader:extra-header`,`Menu.GroupHeader: this Menu.Group already has a header (its first direct child header), so this one does not label the group. Give a group one header, or put this one in a Menu.Group of its own.`)},[m]),(0,s.jsxs)(`div`,{...d,ref:l,id:(p?f.headerId:n)||void 0,className:t.cn(`flex items-center gap-2 px-3 pb-1 pt-2 text-caption-1 font-semibold text-muted-foreground`,i),children:[(0,s.jsx)(a.MenuColumnSpacers,{}),c]})};f.displayName=`MenuGroupHeader`,exports.MenuGroup=d,exports.MenuGroupHeader=f;
2
+ //# sourceMappingURL=Menu.group.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.group.cjs","names":["React","useId","flattenChildren","isElementOfType","cn","MenuColumnSpacers","require_runtime","require_cn","require_children","require_dev","require_useId","require_Menu_items","react","react_jsx_runtime","MenuGroupContext","INERT_GROUP_CONTEXT","useMenuGroupContext","componentName","MenuGroup","rest","generatedId","header","children","node","MenuGroupHeader","headerProps","headerId","ownName","labelled","labelledBy","context","props","group","scanned","problem","id","className"],"sources":["../../../src/components/navigation/Menu.group.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { flattenChildren, isElementOfType } from '../../lib/children';\nimport { reportMissingContext, warnOnce } from '../../lib/dev';\nimport { useId } from '../../hooks/useId';\nimport { MenuColumnSpacers } from './Menu.items';\n\n/** Properties for the MenuGroup sub-component. */\nexport interface MenuGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Ref to the `role=\"group\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/** Properties for the MenuGroupHeader sub-component. */\nexport interface MenuGroupHeaderProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Ref to the header element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\ninterface MenuGroupContextValue {\n /** The id the group's header renders (its own `id`, else a generated one). */\n headerId: string;\n /**\n * The props object of the header the group's scan found (the first one among its direct\n * children or Fragments), or `undefined`. React renders an element with that same object, so\n * the header whose props are these is the scanned one: only it renders `headerId`.\n */\n headerProps: MenuGroupHeaderProps | undefined;\n /**\n * Whether the group has a name: a header among its direct children (or Fragments), or the\n * consumer's `aria-label`/`aria-labelledby`. A header the scan did not find, in a group whose\n * scan found none, warns only without.\n */\n labelled: boolean;\n}\n\nconst MenuGroupContext = React.createContext<MenuGroupContextValue | null>(null);\nMenuGroupContext.displayName = 'MenuGroupContext';\n\n/** What a misplaced header renders with in production (C-CONTEXT): its own id only, no warning. */\nconst INERT_GROUP_CONTEXT: MenuGroupContextValue = {\n headerId: '',\n headerProps: undefined,\n labelled: true,\n};\n\n/** C-CONTEXT: throws in development, logs once and returns an inert value in production. */\nfunction useMenuGroupContext(componentName: string): MenuGroupContextValue {\n const context = React.useContext(MenuGroupContext);\n if (context) return context;\n reportMissingContext(componentName, 'Menu.Group');\n return INERT_GROUP_CONTEXT;\n}\n\n/**\n * A labelled group of menu items (`role=\"group\"`), for example the radio items of one choice.\n * Labelled by its `Menu.GroupHeader` when the header is a direct child (or inside a Fragment; a\n * header written in a Server Component counts too); a header nested deeper does not label it\n * (development warning). Pass `aria-label` for a group without a visible header; a consumer\n * `aria-label` or `aria-labelledby` wins over the header (one that holds `undefined` does not).\n * Give a group one header: only the first header among its direct children labels it, and any\n * other header renders only its own `id` (development warning). The group changes nothing about\n * the keyboard: its items stay items of the menu. Separate groups with `Menu.Divider`.\n *\n * Also exported as `MenuGroup` (import the flat name from React Server Components).\n */\nexport const MenuGroup = ({ children, ref, ...rest }: MenuGroupProps) => {\n const generatedId = useId('menu-group-header');\n // A static scan, so the reference is in the server HTML and never points at a missing id.\n const header = flattenChildren(children).find(({ node }) =>\n isElementOfType<MenuGroupHeaderProps>(node, MenuGroupHeader),\n )?.node as React.ReactElement<MenuGroupHeaderProps> | undefined;\n const headerProps = header?.props;\n const headerId = headerProps?.id || generatedId;\n // A prop that holds `undefined` (a wrapper forwarding it) is no name of the consumer's.\n const ownName = rest['aria-label'] !== undefined || rest['aria-labelledby'] !== undefined;\n const labelled = header !== undefined || ownName;\n // Written after the spread, so a forwarded `aria-labelledby={undefined}` cannot remove it.\n const labelledBy = ownName\n ? rest['aria-labelledby']\n : header !== undefined\n ? headerId\n : undefined;\n\n const context = React.useMemo<MenuGroupContextValue>(\n () => ({ headerId, headerProps, labelled }),\n [headerId, headerProps, labelled],\n );\n\n return (\n <MenuGroupContext.Provider value={context}>\n <div role=\"group\" {...rest} ref={ref} aria-labelledby={labelledBy}>\n {children}\n </div>\n </MenuGroupContext.Provider>\n );\n};\nMenuGroup.displayName = 'MenuGroup';\n\n/**\n * The visible heading of a `Menu.Group`. It is not a menu item: arrow keys and typeahead skip it.\n * Its text lines up with the item labels (it keeps the menu's check and icon columns). It labels\n * the group when it is the group's first header among its direct children (or inside a Fragment\n * there); any other header labels nothing and renders only its own `id` (development warning).\n * Must be used inside `Menu.Group`.\n *\n * Also exported as `MenuGroupHeader` (import the flat name from React Server Components).\n */\nexport const MenuGroupHeader = (props: MenuGroupHeaderProps) => {\n const { id, className, children, ref, ...rest } = props;\n const group = useMenuGroupContext('Menu.GroupHeader');\n\n // The header the group's scan found is the one rendered with the scanned element's props object.\n // Only it renders the id the group points at: any other header (inside a custom component or an\n // element, or a second one) keeps only its own id, so no two headers share one. This relies on\n // React passing an element's own props object to its component (the client, Fizz, a lazy client\n // reference and `Children.toArray` clones all do in React 19, though React does not document it).\n // If a React upgrade breaks it, the scanned header loses its id: Menu.group.test.tsx's \"the header\n // its scan found keeps labelling the group in StrictMode, after a re-render and as a Server\n // Component reference\" and the server-HTML dangling-reference test fail.\n const scanned = group.headerProps === props;\n // C-DEV: any other header labels nothing and warns, except in a group that has no header its\n // scan found and is named by the consumer's label (that label is the unlabelled warning's remedy).\n let problem: 'unlabelled' | 'extra-header' | null = null;\n if (!scanned && group.headerProps !== undefined) problem = 'extra-header';\n else if (!scanned && !group.labelled) problem = 'unlabelled';\n React.useEffect(() => {\n if (problem === 'unlabelled') {\n warnOnce(\n 'Menu.GroupHeader:unlabelled',\n 'Menu.GroupHeader: this header is not a direct child of Menu.Group (or of a Fragment in it), so it does not label the group. Make it a direct child, or pass aria-label to Menu.Group.',\n );\n } else if (problem === 'extra-header') {\n warnOnce(\n 'Menu.GroupHeader:extra-header',\n 'Menu.GroupHeader: this Menu.Group already has a header (its first direct child header), so this one does not label the group. Give a group one header, or put this one in a Menu.Group of its own.',\n );\n }\n }, [problem]);\n\n return (\n <div\n {...rest}\n ref={ref}\n id={(scanned ? group.headerId : id) || undefined}\n className={cn(\n 'flex items-center gap-2 px-3 pb-1 pt-2 text-caption-1 font-semibold text-muted-foreground',\n className,\n )}\n >\n <MenuColumnSpacers />\n {children}\n </div>\n );\n};\nMenuGroupHeader.displayName = 'MenuGroupHeader';\n"],"mappings":"kTAoCA,IAAMc,EAAmBd,EAAM,cAA4C,IAAI,EAC/E,EAAiB,YAAc,mBAG/B,IAAMe,EAA6C,CACjD,SAAU,GACV,YAAa,IAAA,GACb,SAAU,EACZ,EAGA,SAASC,EAAoB,EAA8C,CAIzE,OAHgBhB,EAAM,WAAWc,CAC7B,IACJL,EAAA,qBAAqBQ,EAAe,YAAY,EACzCF,EACT,CAcA,IAAaG,GAAa,CAAE,WAAU,MAAK,GAAGC,KAA2B,CACvE,IAAMC,EAAcnB,EAAAA,MAAM,mBAAmB,EAEvCoB,EAASnB,EAAAA,gBAAgBoB,CAAQ,CAAC,CAAC,MAAM,CAAE,UAC/CnB,EAAAA,gBAAsCoB,EAAMC,CAAe,CAC7D,CAAC,EAAE,KACGC,EAAcJ,GAAQ,MACtBK,EAAWD,GAAa,IAAML,EAE9BO,EAAUR,EAAK,gBAAkB,IAAA,IAAaA,EAAK,qBAAuB,IAAA,GAC1ES,EAAWP,IAAW,IAAA,IAAaM,EAEnCE,EAAaF,EACfR,EAAK,mBACLE,IAAW,IAAA,GAET,IAAA,GADAK,EAGAI,EAAU9B,EAAM,aACb,CAAE,WAAU,cAAa,UAAS,GACzC,CAAC0B,EAAUD,EAAaG,CAAQ,CAClC,EAEA,OACE,EAAAf,EAAA,IAAA,CAACC,EAAiB,SAAlB,CAA2B,MAAOgB,EAChC,UAAA,EAAAjB,EAAA,IAAA,CAAC,MAAD,CAAK,KAAK,QAAQ,GAAIM,EAAW,MAAK,kBAAiBU,EACpD,UACE,CAAA,CACoB,CAAA,CAE/B,EACA,EAAU,YAAc,YAWxB,IAAaL,EAAmB,GAAgC,CAC9D,GAAM,CAAE,KAAI,YAAW,WAAU,MAAK,GAAGL,GAASY,EAC5CC,EAAQhB,EAAoB,kBAAkB,EAU9CiB,EAAUD,EAAM,cAAgBD,EAGlCG,EAAgD,KAiBpD,MAhBI,CAACD,GAAWD,EAAM,cAAgB,IAAA,GAAW,EAAU,eAClD,CAACC,GAAW,CAACD,EAAM,WAAU,EAAU,cAChDpB,EAAM,cAAgB,CAChBsB,IAAY,aACdzB,EAAA,SACE,8BACA,uLACF,EACSyB,IAAY,gBACrBzB,EAAA,SACE,gCACA,oMACF,CAEJ,EAAG,CAACyB,CAAO,CAAC,GAGV,EAAArB,EAAA,KAAA,CAAC,MAAD,CACE,GAAIM,EACC,MACL,IAAKc,EAAUD,EAAM,SAAWG,IAAO,IAAA,GACvC,UAAW/B,EAAAA,GACT,4FACAgC,CACF,EAPF,SAAA,EASE,EAAAvB,EAAA,IAAA,CAACR,EAAAA,kBAAD,CAAoB,CAAA,EACnBiB,CACE,GAET,EACA,EAAgB,YAAc"}
@@ -0,0 +1,58 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/cn.mjs";
3
+ import { flattenChildren as t, isElementOfType as n } from "../../lib/children.mjs";
4
+ import { reportMissingContext as r, warnOnce as i } from "../../lib/dev.mjs";
5
+ import { useId as a } from "../../hooks/useId.mjs";
6
+ import { MenuColumnSpacers as o } from "./Menu.items.mjs";
7
+ import * as s from "react";
8
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ //#region src/components/navigation/Menu.group.tsx
10
+ var u = s.createContext(null);
11
+ u.displayName = "MenuGroupContext";
12
+ var d = {
13
+ headerId: "",
14
+ headerProps: void 0,
15
+ labelled: !0
16
+ };
17
+ function f(e) {
18
+ return s.useContext(u) || (r(e, "Menu.Group"), d);
19
+ }
20
+ var p = ({ children: e, ref: r, ...i }) => {
21
+ let o = a("menu-group-header"), l = t(e).find(({ node: e }) => n(e, m))?.node, d = l?.props, f = d?.id || o, p = i["aria-label"] !== void 0 || i["aria-labelledby"] !== void 0, h = l !== void 0 || p, g = p ? i["aria-labelledby"] : l === void 0 ? void 0 : f, _ = s.useMemo(() => ({
22
+ headerId: f,
23
+ headerProps: d,
24
+ labelled: h
25
+ }), [
26
+ f,
27
+ d,
28
+ h
29
+ ]);
30
+ return /* @__PURE__ */ c(u.Provider, {
31
+ value: _,
32
+ children: /* @__PURE__ */ c("div", {
33
+ role: "group",
34
+ ...i,
35
+ ref: r,
36
+ "aria-labelledby": g,
37
+ children: e
38
+ })
39
+ });
40
+ };
41
+ p.displayName = "MenuGroup";
42
+ var m = (t) => {
43
+ let { id: n, className: r, children: a, ref: u, ...d } = t, p = f("Menu.GroupHeader"), m = p.headerProps === t, h = null;
44
+ return !m && p.headerProps !== void 0 ? h = "extra-header" : !m && !p.labelled && (h = "unlabelled"), s.useEffect(() => {
45
+ h === "unlabelled" ? i("Menu.GroupHeader:unlabelled", "Menu.GroupHeader: this header is not a direct child of Menu.Group (or of a Fragment in it), so it does not label the group. Make it a direct child, or pass aria-label to Menu.Group.") : h === "extra-header" && i("Menu.GroupHeader:extra-header", "Menu.GroupHeader: this Menu.Group already has a header (its first direct child header), so this one does not label the group. Give a group one header, or put this one in a Menu.Group of its own.");
46
+ }, [h]), /* @__PURE__ */ l("div", {
47
+ ...d,
48
+ ref: u,
49
+ id: (m ? p.headerId : n) || void 0,
50
+ className: e("flex items-center gap-2 px-3 pb-1 pt-2 text-caption-1 font-semibold text-muted-foreground", r),
51
+ children: [/* @__PURE__ */ c(o, {}), a]
52
+ });
53
+ };
54
+ m.displayName = "MenuGroupHeader";
55
+ //#endregion
56
+ export { p as MenuGroup, m as MenuGroupHeader };
57
+
58
+ //# sourceMappingURL=Menu.group.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.group.mjs","names":["useId","useId$1","React","MenuGroupContext","INERT_GROUP_CONTEXT","useMenuGroupContext","reportMissingContext","componentName","MenuGroup","rest","generatedId","header","flattenChildren","children","isElementOfType","node","MenuGroupHeader","headerProps","headerId","ownName","labelled","labelledBy","context","props","group","scanned","problem","warnOnce","id","cn","className","MenuColumnSpacers"],"sources":["../../../src/components/navigation/Menu.group.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { flattenChildren, isElementOfType } from '../../lib/children';\nimport { reportMissingContext, warnOnce } from '../../lib/dev';\nimport { useId } from '../../hooks/useId';\nimport { MenuColumnSpacers } from './Menu.items';\n\n/** Properties for the MenuGroup sub-component. */\nexport interface MenuGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Ref to the `role=\"group\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/** Properties for the MenuGroupHeader sub-component. */\nexport interface MenuGroupHeaderProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Ref to the header element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\ninterface MenuGroupContextValue {\n /** The id the group's header renders (its own `id`, else a generated one). */\n headerId: string;\n /**\n * The props object of the header the group's scan found (the first one among its direct\n * children or Fragments), or `undefined`. React renders an element with that same object, so\n * the header whose props are these is the scanned one: only it renders `headerId`.\n */\n headerProps: MenuGroupHeaderProps | undefined;\n /**\n * Whether the group has a name: a header among its direct children (or Fragments), or the\n * consumer's `aria-label`/`aria-labelledby`. A header the scan did not find, in a group whose\n * scan found none, warns only without.\n */\n labelled: boolean;\n}\n\nconst MenuGroupContext = React.createContext<MenuGroupContextValue | null>(null);\nMenuGroupContext.displayName = 'MenuGroupContext';\n\n/** What a misplaced header renders with in production (C-CONTEXT): its own id only, no warning. */\nconst INERT_GROUP_CONTEXT: MenuGroupContextValue = {\n headerId: '',\n headerProps: undefined,\n labelled: true,\n};\n\n/** C-CONTEXT: throws in development, logs once and returns an inert value in production. */\nfunction useMenuGroupContext(componentName: string): MenuGroupContextValue {\n const context = React.useContext(MenuGroupContext);\n if (context) return context;\n reportMissingContext(componentName, 'Menu.Group');\n return INERT_GROUP_CONTEXT;\n}\n\n/**\n * A labelled group of menu items (`role=\"group\"`), for example the radio items of one choice.\n * Labelled by its `Menu.GroupHeader` when the header is a direct child (or inside a Fragment; a\n * header written in a Server Component counts too); a header nested deeper does not label it\n * (development warning). Pass `aria-label` for a group without a visible header; a consumer\n * `aria-label` or `aria-labelledby` wins over the header (one that holds `undefined` does not).\n * Give a group one header: only the first header among its direct children labels it, and any\n * other header renders only its own `id` (development warning). The group changes nothing about\n * the keyboard: its items stay items of the menu. Separate groups with `Menu.Divider`.\n *\n * Also exported as `MenuGroup` (import the flat name from React Server Components).\n */\nexport const MenuGroup = ({ children, ref, ...rest }: MenuGroupProps) => {\n const generatedId = useId('menu-group-header');\n // A static scan, so the reference is in the server HTML and never points at a missing id.\n const header = flattenChildren(children).find(({ node }) =>\n isElementOfType<MenuGroupHeaderProps>(node, MenuGroupHeader),\n )?.node as React.ReactElement<MenuGroupHeaderProps> | undefined;\n const headerProps = header?.props;\n const headerId = headerProps?.id || generatedId;\n // A prop that holds `undefined` (a wrapper forwarding it) is no name of the consumer's.\n const ownName = rest['aria-label'] !== undefined || rest['aria-labelledby'] !== undefined;\n const labelled = header !== undefined || ownName;\n // Written after the spread, so a forwarded `aria-labelledby={undefined}` cannot remove it.\n const labelledBy = ownName\n ? rest['aria-labelledby']\n : header !== undefined\n ? headerId\n : undefined;\n\n const context = React.useMemo<MenuGroupContextValue>(\n () => ({ headerId, headerProps, labelled }),\n [headerId, headerProps, labelled],\n );\n\n return (\n <MenuGroupContext.Provider value={context}>\n <div role=\"group\" {...rest} ref={ref} aria-labelledby={labelledBy}>\n {children}\n </div>\n </MenuGroupContext.Provider>\n );\n};\nMenuGroup.displayName = 'MenuGroup';\n\n/**\n * The visible heading of a `Menu.Group`. It is not a menu item: arrow keys and typeahead skip it.\n * Its text lines up with the item labels (it keeps the menu's check and icon columns). It labels\n * the group when it is the group's first header among its direct children (or inside a Fragment\n * there); any other header labels nothing and renders only its own `id` (development warning).\n * Must be used inside `Menu.Group`.\n *\n * Also exported as `MenuGroupHeader` (import the flat name from React Server Components).\n */\nexport const MenuGroupHeader = (props: MenuGroupHeaderProps) => {\n const { id, className, children, ref, ...rest } = props;\n const group = useMenuGroupContext('Menu.GroupHeader');\n\n // The header the group's scan found is the one rendered with the scanned element's props object.\n // Only it renders the id the group points at: any other header (inside a custom component or an\n // element, or a second one) keeps only its own id, so no two headers share one. This relies on\n // React passing an element's own props object to its component (the client, Fizz, a lazy client\n // reference and `Children.toArray` clones all do in React 19, though React does not document it).\n // If a React upgrade breaks it, the scanned header loses its id: Menu.group.test.tsx's \"the header\n // its scan found keeps labelling the group in StrictMode, after a re-render and as a Server\n // Component reference\" and the server-HTML dangling-reference test fail.\n const scanned = group.headerProps === props;\n // C-DEV: any other header labels nothing and warns, except in a group that has no header its\n // scan found and is named by the consumer's label (that label is the unlabelled warning's remedy).\n let problem: 'unlabelled' | 'extra-header' | null = null;\n if (!scanned && group.headerProps !== undefined) problem = 'extra-header';\n else if (!scanned && !group.labelled) problem = 'unlabelled';\n React.useEffect(() => {\n if (problem === 'unlabelled') {\n warnOnce(\n 'Menu.GroupHeader:unlabelled',\n 'Menu.GroupHeader: this header is not a direct child of Menu.Group (or of a Fragment in it), so it does not label the group. Make it a direct child, or pass aria-label to Menu.Group.',\n );\n } else if (problem === 'extra-header') {\n warnOnce(\n 'Menu.GroupHeader:extra-header',\n 'Menu.GroupHeader: this Menu.Group already has a header (its first direct child header), so this one does not label the group. Give a group one header, or put this one in a Menu.Group of its own.',\n );\n }\n }, [problem]);\n\n return (\n <div\n {...rest}\n ref={ref}\n id={(scanned ? group.headerId : id) || undefined}\n className={cn(\n 'flex items-center gap-2 px-3 pb-1 pt-2 text-caption-1 font-semibold text-muted-foreground',\n className,\n )}\n >\n <MenuColumnSpacers />\n {children}\n </div>\n );\n};\nMenuGroupHeader.displayName = 'MenuGroupHeader';\n"],"mappings":";;;;;;;;;AAoCA,IAAMG,IAAmBD,EAAM,cAA4C,IAAI;AAC/E,EAAiB,cAAc;AAG/B,IAAME,IAA6C;CACjD,UAAU;CACV,aAAa,KAAA;CACb,UAAU;AACZ;AAGA,SAASC,EAAoB,GAA8C;CAIzE,OAHgBH,EAAM,WAAWC,CAC7B,MACJG,EAAqBC,GAAe,YAAY,GACzCH;AACT;AAcA,IAAaI,KAAa,EAAE,aAAU,QAAK,GAAGC,QAA2B;CACvE,IAAMC,IAAcV,EAAM,mBAAmB,GAEvCW,IAASC,EAAgBC,CAAQ,CAAC,CAAC,MAAM,EAAE,cAC/CC,EAAsCC,GAAMC,CAAe,CAC7D,CAAC,EAAE,MACGC,IAAcN,GAAQ,OACtBO,IAAWD,GAAa,MAAMP,GAE9BS,IAAUV,EAAK,kBAAkB,KAAA,KAAaA,EAAK,uBAAuB,KAAA,GAC1EW,IAAWT,MAAW,KAAA,KAAaQ,GAEnCE,IAAaF,IACfV,EAAK,qBACLE,MAAW,KAAA,IAET,KAAA,IADAO,GAGAI,IAAUpB,EAAM,eACb;EAAE;EAAU;EAAa;CAAS,IACzC;EAACgB;EAAUD;EAAaG;CAAQ,CAClC;CAEA,OACE,kBAACjB,EAAiB,UAAlB;EAA2B,OAAOmB;EAChC,UAAA,kBAAC,OAAD;GAAK,MAAK;GAAQ,GAAIb;GAAW;GAAK,mBAAiBY;GACpD;EACE,CAAA;CACoB,CAAA;AAE/B;AACA,EAAU,cAAc;AAWxB,IAAaL,KAAmB,MAAgC;CAC9D,IAAM,EAAE,OAAI,cAAW,aAAU,QAAK,GAAGP,MAASc,GAC5CC,IAAQnB,EAAoB,kBAAkB,GAU9CoB,IAAUD,EAAM,gBAAgBD,GAGlCG,IAAgD;CAiBpD,OAhBI,CAACD,KAAWD,EAAM,gBAAgB,KAAA,IAAW,IAAU,iBAClD,CAACC,KAAW,CAACD,EAAM,aAAU,IAAU,eAChDtB,EAAM,gBAAgB;EACpB,AAAIwB,MAAY,eACdC,EACE,+BACA,uLACF,IACSD,MAAY,kBACrBC,EACE,iCACA,oMACF;CAEJ,GAAG,CAACD,CAAO,CAAC,GAGV,kBAAC,OAAD;EACE,GAAIjB;EACC;EACL,KAAKgB,IAAUD,EAAM,WAAWI,MAAO,KAAA;EACvC,WAAWC,EACT,6FACAC,CACF;EAPF,UAAA,CASE,kBAACC,GAAD,CAAoB,CAAA,GACnBlB,CACE;;AAET;AACA,EAAgB,cAAc"}
@@ -0,0 +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/slot.cjs"),i=require("../../lib/icons.cjs"),a=require("../../lib/events.cjs"),o=require("./Menu.context.cjs"),s=require("./Menu.shared.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("react/jsx-runtime");function u(e){return e===`checkmark`?(0,l.jsx)(`span`,{"aria-hidden":`true`,"data-menu-column-space":`checkmark`,className:`hidden w-4 shrink-0 group-has-[[data-menu-checkmark]]/menu:inline-flex`}):(0,l.jsx)(`span`,{"aria-hidden":`true`,"data-menu-column-space":`icon`,className:`hidden h-5 w-5 shrink-0 group-has-[[data-menu-icon]]/menu:inline-flex`})}function d({checkmark:e,icon:t,label:n,shortcut:i,end:a,markLabel:o=!0}){let s=r.slotRendersContent(n),c=t&&r.slotRendersContent(t)?r.renderSlot(t,`span`,`flex h-5 w-5 shrink-0 items-center justify-center`,{"aria-hidden":!0,"data-menu-icon":``}):null;return(0,l.jsxs)(l.Fragment,{children:[e===void 0?s&&u(`checkmark`):(0,l.jsx)(`span`,{"aria-hidden":`true`,"data-menu-checkmark":``,className:`inline-flex w-4 shrink-0 items-center justify-center`,children:e}),c??(s&&u(`icon`)),(0,l.jsx)(`span`,{className:`flex-1`,"data-menu-label":o&&s&&typeof n!=`string`?``:void 0,children:r.materialiseSlotContent(n)}),i&&(0,l.jsx)(`span`,{dir:`auto`,className:`ms-4 text-caption-1 text-muted-foreground`,children:i}),a]})}d.displayName=`MenuItemRow`;function f(){return(0,l.jsxs)(l.Fragment,{children:[u(`checkmark`),u(`icon`)]})}f.displayName=`MenuColumnSpacers`;function p({disabled:e,persistOnClick:t,onClick:n,onKeyDown:r,onActivate:i,keepOpenOnSpace:s=!1,nativeEnter:l=!1,hasSubmenu:u=!1}){let d=o.useMenuListContext(),f=c.useRef(!1);return{onClick:r=>{let o=a.isOwnEvent(r);if(e){o&&r.preventDefault();return}n?.(r),o&&!r.defaultPrevented&&(i?.(r),!(r.defaultPrevented||u)&&(s&&f.current||(t??d?.menu.persistOnItemClick??!1)||d?.closeFromItem()))},onKeyDown:t=>{if(r?.(t),!t.defaultPrevented&&a.isOwnEvent(t)&&(t.key===`Enter`||t.key===` `)&&!(t.key===`Enter`&&l)&&!(t.ctrlKey||t.altKey||t.metaKey)&&(t.preventDefault(),!e)){f.current=t.key===` `;try{t.currentTarget.click()}finally{f.current=!1}}}}}function m(e){let t=o.useMenuListContext(),r=o.useOptionalMenuContext(),i=r!==null&&r.popup&&t===null;c.useEffect(()=>{i&&n.warnOnce(`Menu:item-outside-popover`,`${e}: rendered in a popup menu outside Menu.Popover, so it has no \`role="menu"\` parent. A Menu with \`open\`, \`defaultOpen\` or \`onOpenChange\` is a popup menu that renders no element of its own: put the items in Menu.Popover, or leave these props out for a static menu.`)},[i,e])}var h=({icon:e,shortcut:n,disabled:r=!1,persistOnClick:a,onClick:u,onKeyDown:f,children:h,className:g,ref:_,...v})=>{let y=c.useContext(o.MenuSubmenuTriggerContext);m(`Menu.Item`);let b=typeof h==`string`?h:void 0,x=v[`data-roving-text`]!==void 0,S=p({disabled:r,persistOnClick:a,onClick:u,onKeyDown:f,hasSubmenu:y});return(0,l.jsx)(`div`,{role:`menuitem`,"data-roving-text":b,...v,ref:_,"aria-disabled":r?!0:v[`aria-disabled`],"data-disabled":r?``:void 0,"data-has-submenu":y?``:void 0,onClick:S.onClick,onKeyDown:S.onKeyDown,className:t.cn(s.menuItemClasses,g),children:(0,l.jsx)(d,{icon:e,label:h,shortcut:n,markLabel:!x,end:y?(0,l.jsx)(i.ChevronRightIcon,{size:16,className:`ms-auto shrink-0 wave-rtl:-scale-x-100`}):void 0})})};h.displayName=`MenuItem`;var g=({className:e,ref:n,...r})=>(0,l.jsx)(`div`,{role:`separator`,...r,ref:n,className:t.cn(`my-1 border-t border-border`,e)});g.displayName=`MenuDivider`,exports.MenuColumnSpacers=f,exports.MenuDivider=g,exports.MenuItem=h,exports.MenuItemRow=d,exports.useMenuItemActivation=p,exports.useMenuItemPlacementWarning=m;
2
+ //# sourceMappingURL=Menu.items.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.items.cjs","names":["slotRendersContent","renderSlot","_Fragment","materialiseSlotContent","useMenuListContext","React","isOwnEvent","useOptionalMenuContext","MenuSubmenuTriggerContext","cn","menuItemClasses","ChevronRightIcon","require_runtime","require_cn","require_dev","require_slot","require_icons","require_events","require_Menu_context","require_Menu_shared","react","react_jsx_runtime","renderColumnSpace","column","MenuItemRow","hasLabel","label","iconNode","icon","checkmark","markLabel","shortcut","end","MenuColumnSpacers","useMenuItemActivation","list","clickFromSpaceRef","own","event","disabled","onClick","onActivate","hasSubmenu","keepOpenOnSpace","persistOnClick","onKeyDown","nativeEnter","useMenuItemPlacementWarning","menu","outsidePopover","componentName","MenuItem","rest","isSubmenuTrigger","stringLabel","children","ownRovingText","activation","className","MenuDivider"],"sources":["../../../src/components/navigation/Menu.items.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport type { Slot } from '../../lib/types';\nimport { materialiseSlotContent, renderSlot, slotRendersContent } from '../../lib/slot';\nimport { warnOnce } from '../../lib/dev';\nimport { isOwnEvent } from '../../lib/events';\nimport { ChevronRightIcon } from '../../lib/icons';\nimport {\n MenuSubmenuTriggerContext,\n useMenuListContext,\n useOptionalMenuContext,\n} from './Menu.context';\nimport { menuItemClasses } from './Menu.shared';\n\n/** Properties for the MenuItem sub-component. */\nexport interface MenuItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Slot for an icon displayed before the item text. Rendered with `aria-hidden=\"true\"`. A falsy\n * icon (`''`, `0`) or a list of nothing renders no icon box.\n */\n icon?: Slot<'span'>;\n /**\n * Keyboard shortcut text displayed at the end of the item. Its direction comes from its own text\n * (`dir=\"auto\"`), so \"Ctrl+,\" keeps its order in an RTL menu.\n */\n shortcut?: string;\n /** Whether the menu item is disabled (`aria-disabled`; skipped by keyboard navigation). */\n disabled?: boolean;\n /**\n * Keep a popup menu open after this item is activated. `true` or `false` here wins over the\n * Menu's `persistOnItemClick`.\n * @default the Menu's `persistOnItemClick` (`false`)\n */\n persistOnClick?: boolean;\n /**\n * Label content of the menu item. Leave it out only for the submenu half of a\n * `Menu.SplitGroup`, which then needs `aria-label`.\n */\n children?: React.ReactNode;\n /**\n * Ref to the item element (`role=\"menuitem\"`; `menuitemcheckbox` or `menuitemradio` for the\n * checkable items).\n */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n/** Properties for the MenuDivider sub-component. */\nexport interface MenuDividerProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Ref to the `role=\"separator\"` element. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\n// ---------------------------------------------------------------------------\n// The item row and the column alignment\n// ---------------------------------------------------------------------------\n\n/** Internal: the content of one menu item row, rendered inside the item element. */\nexport interface MenuItemRowProps {\n /**\n * Checkable items: the checkmark column's content (the glyph, or `null` while unchecked); the\n * column renders in both states, marked `data-menu-checkmark`. `undefined` for other items,\n * which render a hidden placeholder instead.\n */\n checkmark?: React.ReactNode | null;\n /** The icon slot (a falsy icon or a list of nothing is no icon). */\n icon?: Slot<'span'>;\n /** The label (typeahead reads a non-string label through its `data-menu-label` element). */\n label: React.ReactNode;\n /** The shortcut text (rendered with `dir=\"auto\"`). */\n shortcut?: string;\n /** Content at the row's end: the submenu chevron or a switch. */\n end?: React.ReactNode;\n /**\n * Whether a non-string label is marked `data-menu-label` for typeahead. Pass `false` when the\n * item carries its own `data-roving-text`, which the label's text must not replace.\n * @default true\n */\n markLabel?: boolean;\n}\n\n/**\n * The placeholder of the checkmark or the icon column: hidden, and shown as soon as any item of\n * the same menu list (the `group/menu` element) renders that column, so every label starts at the\n * same place. Decorative (`aria-hidden`).\n */\nfunction renderColumnSpace(column: 'checkmark' | 'icon'): React.ReactElement {\n return column === 'checkmark' ? (\n <span\n aria-hidden=\"true\"\n data-menu-column-space=\"checkmark\"\n className=\"hidden w-4 shrink-0 group-has-[[data-menu-checkmark]]/menu:inline-flex\"\n />\n ) : (\n <span\n aria-hidden=\"true\"\n data-menu-column-space=\"icon\"\n className=\"hidden h-5 w-5 shrink-0 group-has-[[data-menu-icon]]/menu:inline-flex\"\n />\n );\n}\n\n/**\n * Internal: one menu item row, in DOM order (RTL mirrors it): the checkmark column, the icon\n * column, the label, the shortcut and the end content. A row without a checkmark or an icon\n * renders the column's placeholder instead; a row whose label renders nothing (the icon-only\n * submenu half of a split group) renders no placeholders.\n */\nexport function MenuItemRow({\n checkmark,\n icon,\n label,\n shortcut,\n end,\n markLabel = true,\n}: MenuItemRowProps): React.ReactElement {\n // The check does not consume a one-shot iterable label: it is rendered materialised.\n const hasLabel = slotRendersContent(label);\n // A falsy icon (`icon={name && <Icon />}` with `name` '' or a count of 0) is no icon, as in Nav,\n // Tree and Avatar, and so is a collection whose items render nothing: no empty 20px box before\n // the label. The check does not consume a generator: renderSlot still renders its items.\n const iconNode =\n icon && slotRendersContent(icon)\n ? renderSlot(icon, 'span', 'flex h-5 w-5 shrink-0 items-center justify-center', {\n 'aria-hidden': true,\n 'data-menu-icon': '',\n })\n : null;\n\n return (\n <>\n {checkmark !== undefined ? (\n <span\n aria-hidden=\"true\"\n data-menu-checkmark=\"\"\n className=\"inline-flex w-4 shrink-0 items-center justify-center\"\n >\n {checkmark}\n </span>\n ) : (\n hasLabel && renderColumnSpace('checkmark')\n )}\n {iconNode ?? (hasLabel && renderColumnSpace('icon'))}\n <span\n className=\"flex-1\"\n data-menu-label={markLabel && hasLabel && typeof label !== 'string' ? '' : undefined}\n >\n {materialiseSlotContent(label)}\n </span>\n {/* The shortcut takes its direction from its own text (`dir=\"auto\"` also isolates it): in an\n RTL menu, \"Ctrl+,\" would otherwise be reordered to \",+Ctrl\". */}\n {shortcut && (\n <span dir=\"auto\" className=\"ms-4 text-caption-1 text-muted-foreground\">\n {shortcut}\n </span>\n )}\n {end}\n </>\n );\n}\nMenuItemRow.displayName = 'MenuItemRow';\n\n/** Internal: the two column placeholders alone, for a row that is not an item (a group header). */\nexport function MenuColumnSpacers(): React.ReactElement {\n return (\n <>\n {renderColumnSpace('checkmark')}\n {renderColumnSpace('icon')}\n </>\n );\n}\nMenuColumnSpacers.displayName = 'MenuColumnSpacers';\n\n// ---------------------------------------------------------------------------\n// Item activation\n// ---------------------------------------------------------------------------\n\n/** Internal: the activation of every menu item kind. */\nexport interface MenuItemActivationOptions {\n disabled: boolean;\n /**\n * The item's own `persistOnClick`; `undefined` falls back to the Menu's `persistOnItemClick`.\n * A link item passes `false` (a link always closes).\n */\n persistOnClick: boolean | undefined;\n /** The consumer's handlers, composed consumer first (C-COMPOSE). */\n onClick?: React.MouseEventHandler<HTMLElement>;\n onKeyDown?: React.KeyboardEventHandler<HTMLElement>;\n /**\n * Runs on an own, enabled click after the consumer's `onClick`, unless it prevented the default.\n * Its own `preventDefault()` keeps the menu open.\n */\n onActivate?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Space activates and keeps the menu open (checkbox, radio and switch items). */\n keepOpenOnSpace?: boolean;\n /** Enter is left to the element's native activation (links); Space still clicks. */\n nativeEnter?: boolean;\n /** The item opens a submenu: activation never closes its menu. */\n hasSubmenu?: boolean;\n}\n\n/**\n * Internal: the click and key handlers of a menu item.\n *\n * - Events from a portal opened inside the item (a Popover, a Dialog) reach the consumer's\n * handlers, as React bubbles them, but never activate the item or close the menu.\n * - A disabled item calls no `onClick` and prevents its own click; its Enter and Space are still\n * consumed.\n * - Enter and Space are consumed (no page scroll) and click the item; with Ctrl, Alt or Meta they\n * are left to the page. A Space that continues a typeahead search is skipped (the roving\n * capture handler prevented it). With `nativeEnter`, Enter is left to the element.\n * - After the consumer's `onClick` and `onActivate`, the item closes its menu through the list's\n * `closeFromItem`, unless the click was not its own, its default was prevented, `hasSubmenu` is\n * set, `keepOpenOnSpace` is set and Space caused the click, or\n * `persistOnClick ?? menu.persistOnItemClick` is `true`.\n */\nexport function useMenuItemActivation({\n disabled,\n persistOnClick,\n onClick,\n onKeyDown,\n onActivate,\n keepOpenOnSpace = false,\n nativeEnter = false,\n hasSubmenu = false,\n}: MenuItemActivationOptions): {\n onClick: React.MouseEventHandler<HTMLElement>;\n onKeyDown: React.KeyboardEventHandler<HTMLElement>;\n} {\n const list = useMenuListContext();\n // Set while the key handler's click runs, so the click knows that Space caused it.\n const clickFromSpaceRef = React.useRef(false);\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n // A click inside a portal opened from the item reaches the consumer's onClick (React bubbles\n // it), but is not a click on the item: it never activates the item or closes the menu. A\n // disabled item calls no onClick, as a disabled button; a portal's click keeps its default.\n const own = isOwnEvent(event);\n if (disabled) {\n if (own) event.preventDefault();\n return;\n }\n onClick?.(event);\n if (!own || event.defaultPrevented) return;\n onActivate?.(event);\n if (event.defaultPrevented || hasSubmenu) return;\n if (keepOpenOnSpace && clickFromSpaceRef.current) return;\n if (persistOnClick ?? list?.menu.persistOnItemClick ?? false) return;\n list?.closeFromItem();\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n // C-COMPOSE: the consumer's onKeyDown runs first; preventDefault() skips the built-in keys.\n onKeyDown?.(event);\n if (event.defaultPrevented) return;\n // Enter and Space typed in a portal opened from the item belong to that portal.\n if (!isOwnEvent(event)) return;\n if (event.key !== 'Enter' && event.key !== ' ') return;\n // A link follows itself on Enter (Shift, Ctrl and Meta keep opening a new window or tab).\n if (event.key === 'Enter' && nativeEnter) return;\n // With Ctrl, Alt or Meta (Ctrl+Alt+Space included) the key is a shortcut, left to the page.\n if (event.ctrlKey || event.altKey || event.metaKey) return;\n // Menu items consume Enter/Space (no page scroll), whether or not they can be activated.\n event.preventDefault();\n if (disabled) return;\n clickFromSpaceRef.current = event.key === ' ';\n try {\n event.currentTarget.click();\n } finally {\n clickFromSpaceRef.current = false;\n }\n };\n\n return { onClick: handleClick, onKeyDown: handleKeyDown };\n}\n\n/**\n * Internal (C-DEV): warns once, from an effect, when an item of any kind renders in a popup menu\n * outside `Menu.Popover`. A Menu with `open`, `defaultOpen` or `onOpenChange` is a popup menu that\n * renders no element of its own, so such an item has no `role=\"menu\"` parent.\n *\n * @param componentName The item's name in the message, e.g. `'Menu.ItemCheckbox'`.\n */\nexport function useMenuItemPlacementWarning(componentName: string): void {\n const list = useMenuListContext();\n const menu = useOptionalMenuContext();\n const outsidePopover = menu !== null && menu.popup && list === null;\n React.useEffect(() => {\n if (!outsidePopover) return;\n warnOnce(\n 'Menu:item-outside-popover',\n `${componentName}: rendered in a popup menu outside Menu.Popover, so it has no \\`role=\"menu\"\\` parent. A Menu with \\`open\\`, \\`defaultOpen\\` or \\`onOpenChange\\` is a popup menu that renders no element of its own: put the items in Menu.Popover, or leave these props out for a static menu.`,\n );\n }, [outsidePopover, componentName]);\n}\n\n// ---------------------------------------------------------------------------\n// Menu.Item / Menu.Divider\n// ---------------------------------------------------------------------------\n\n/**\n * An action in a menu (`role=\"menuitem\"`). Enter and Space activate it (a Space typed within 500 ms\n * of a typeahead character continues the search instead; with Ctrl, Alt or Meta they are left to\n * the page); in a popup menu, activation closes the menu and returns focus to the trigger unless\n * `persistOnClick` (or the Menu's `persistOnItemClick`) keeps it open or the consumer's `onClick`\n * calls `preventDefault()`. Disabled items are `aria-disabled`, skipped by keyboard navigation and\n * never activated: their `onClick` is not called. A consumer `aria-disabled` without `disabled`\n * only changes the look and keyboard navigation: activation still runs `onClick` (guard it\n * yourself), as on Button. The item's tab index is managed by the menu. Typeahead matches the\n * label (`children`), not the icon or the shortcut; a `data-roving-text` you pass replaces the\n * label's text. Clicks and keys from a portal opened inside the item (a Popover, a Dialog) still\n * reach your `onClick` (on an enabled item) and `onKeyDown`, as React bubbles them, but never\n * activate the item or close the menu.\n *\n * The labels of a menu line up: when any item of the menu shows an icon (or a check), every item\n * keeps an empty column of that width before its label.\n *\n * As the child of a submenu's `Menu.Trigger` (a `Menu` nested in a menu list), the item is the\n * submenu's trigger: it shows a chevron at its end (mirrored in RTL) and `data-has-submenu`, and\n * activating it never closes its own menu. ArrowRight (ArrowLeft in RTL), Enter, Space and a click\n * open the submenu and move focus to its first item; resting the mouse on the item opens it\n * without moving focus.\n *\n * Also exported as `MenuItem` (import the flat name from React Server Components).\n */\nexport const MenuItem = ({\n icon,\n shortcut,\n disabled = false,\n persistOnClick,\n onClick,\n onKeyDown,\n children,\n className,\n ref,\n ...rest\n}: MenuItemProps) => {\n const isSubmenuTrigger = React.useContext(MenuSubmenuTriggerContext);\n useMenuItemPlacementWarning('Menu.Item');\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\n // A submenu trigger item opens its submenu (the trigger's composed onClick): activating it never\n // closes its own menu.\n const activation = useMenuItemActivation({\n disabled,\n persistOnClick,\n onClick,\n onKeyDown,\n hasSubmenu: isSubmenuTrigger,\n });\n\n return (\n <div\n role=\"menuitem\"\n data-roving-text={stringLabel}\n {...rest}\n ref={ref}\n aria-disabled={disabled ? true : rest['aria-disabled']}\n data-disabled={disabled ? '' : undefined}\n data-has-submenu={isSubmenuTrigger ? '' : undefined}\n onClick={activation.onClick}\n onKeyDown={activation.onKeyDown}\n className={cn(menuItemClasses, className)}\n >\n <MenuItemRow\n icon={icon}\n label={children}\n shortcut={shortcut}\n markLabel={!ownRovingText}\n end={\n isSubmenuTrigger ? (\n <ChevronRightIcon size={16} className=\"ms-auto shrink-0 wave-rtl:-scale-x-100\" />\n ) : undefined\n }\n />\n </div>\n );\n};\nMenuItem.displayName = 'MenuItem';\n\n/**\n * A separator between groups of menu items (`role=\"separator\"`).\n *\n * Also exported as `MenuDivider` (import the flat name from React Server Components).\n */\nexport const MenuDivider = ({ className, ref, ...rest }: MenuDividerProps) => {\n return (\n <div\n role=\"separator\"\n {...rest}\n ref={ref}\n className={cn('my-1 border-t border-border', className)}\n />\n );\n};\nMenuDivider.displayName = 'MenuDivider';\n"],"mappings":"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"}