@ariakit/react-components 0.1.1 → 0.1.2

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 (500) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/button/button.d.ts +1 -1
  3. package/dist/{button-Cp853csH.d.ts → button-CVWcOgxs.d.ts} +3 -3
  4. package/dist/{button-Cp853csH.d.ts.map → button-CVWcOgxs.d.ts.map} +1 -1
  5. package/dist/checkbox/checkbox-check.d.ts +1 -1
  6. package/dist/checkbox/checkbox-check.d.ts.map +1 -1
  7. package/dist/checkbox/checkbox.d.ts +2 -2
  8. package/dist/checkbox/checkbox.d.ts.map +1 -1
  9. package/dist/collection/collection-item-offscreen.d.ts +1 -1
  10. package/dist/collection/collection-item-offscreen.js +1 -1
  11. package/dist/collection/collection-item-offscreen.js.map +1 -1
  12. package/dist/collection/collection-item.d.ts +1 -1
  13. package/dist/collection/collection-renderer.d.ts +1 -1
  14. package/dist/collection/collection-renderer.js +1 -1
  15. package/dist/collection/collection-renderer.js.map +1 -1
  16. package/dist/collection/collection.d.ts +1 -1
  17. package/dist/collection/collection.d.ts.map +1 -1
  18. package/dist/{collection-item-offscreen-DyXa-sqj.d.ts → collection-item-offscreen-B5E5vNFi.d.ts} +2 -2
  19. package/dist/{collection-item-offscreen-DyXa-sqj.d.ts.map → collection-item-offscreen-B5E5vNFi.d.ts.map} +1 -1
  20. package/dist/{collection-item-C-g2BwVF.d.ts → collection-item-pvEWNoNs.d.ts} +2 -2
  21. package/dist/{collection-item-C-g2BwVF.d.ts.map → collection-item-pvEWNoNs.d.ts.map} +1 -1
  22. package/dist/{collection-renderer-DsPD9ksD.d.ts → collection-renderer-BhzF21Du.d.ts} +29 -15
  23. package/dist/collection-renderer-BhzF21Du.d.ts.map +1 -0
  24. package/dist/combobox/combobox-cancel.d.ts +2 -2
  25. package/dist/combobox/combobox-cancel.d.ts.map +1 -1
  26. package/dist/combobox/combobox-cancel.js +1 -1
  27. package/dist/combobox/combobox-cancel.js.map +1 -1
  28. package/dist/combobox/combobox-disclosure.d.ts +2 -2
  29. package/dist/combobox/combobox-disclosure.d.ts.map +1 -1
  30. package/dist/combobox/combobox-disclosure.js +1 -1
  31. package/dist/combobox/combobox-disclosure.js.map +1 -1
  32. package/dist/combobox/combobox-group-label.d.ts +1 -1
  33. package/dist/combobox/combobox-group-label.d.ts.map +1 -1
  34. package/dist/combobox/combobox-group.d.ts +1 -1
  35. package/dist/combobox/combobox-group.d.ts.map +1 -1
  36. package/dist/combobox/combobox-group.js +1 -1
  37. package/dist/combobox/combobox-group.js.map +1 -1
  38. package/dist/combobox/combobox-item-check.d.ts +1 -1
  39. package/dist/combobox/combobox-item-check.d.ts.map +1 -1
  40. package/dist/combobox/combobox-item-value.d.ts +1 -1
  41. package/dist/combobox/combobox-item-value.d.ts.map +1 -1
  42. package/dist/combobox/combobox-item.d.ts +3 -3
  43. package/dist/combobox/combobox-item.d.ts.map +1 -1
  44. package/dist/combobox/combobox-item.js +1 -1
  45. package/dist/combobox/combobox-item.js.map +1 -1
  46. package/dist/combobox/combobox-label.d.ts +1 -1
  47. package/dist/combobox/combobox-label.d.ts.map +1 -1
  48. package/dist/combobox/combobox-label.js +1 -1
  49. package/dist/combobox/combobox-label.js.map +1 -1
  50. package/dist/combobox/combobox-list.d.ts +1 -1
  51. package/dist/combobox/combobox-list.d.ts.map +1 -1
  52. package/dist/combobox/combobox-list.js +1 -1
  53. package/dist/combobox/combobox-list.js.map +1 -1
  54. package/dist/combobox/combobox-popover.d.ts +1 -1
  55. package/dist/combobox/combobox-popover.js +1 -1
  56. package/dist/combobox/combobox-popover.js.map +1 -1
  57. package/dist/combobox/combobox-row.d.ts +1 -1
  58. package/dist/combobox/combobox-row.d.ts.map +1 -1
  59. package/dist/combobox/combobox-row.js +1 -1
  60. package/dist/combobox/combobox-row.js.map +1 -1
  61. package/dist/combobox/combobox-separator.d.ts +1 -1
  62. package/dist/combobox/combobox-separator.d.ts.map +1 -1
  63. package/dist/combobox/combobox-separator.js +1 -1
  64. package/dist/combobox/combobox-separator.js.map +1 -1
  65. package/dist/combobox/combobox-value.js +1 -1
  66. package/dist/combobox/combobox-value.js.map +1 -1
  67. package/dist/combobox/combobox.d.ts +3 -3
  68. package/dist/combobox/combobox.d.ts.map +1 -1
  69. package/dist/combobox/combobox.js +16 -2
  70. package/dist/combobox/combobox.js.map +1 -1
  71. package/dist/command/command.d.ts +1 -1
  72. package/dist/{command-DckndCUK.d.ts → command-B9C8p3_S.d.ts} +3 -3
  73. package/dist/{command-DckndCUK.d.ts.map → command-B9C8p3_S.d.ts.map} +1 -1
  74. package/dist/composite/composite-container.d.ts +1 -1
  75. package/dist/composite/composite-container.d.ts.map +1 -1
  76. package/dist/composite/composite-container.js +2 -2
  77. package/dist/composite/composite-container.js.map +1 -1
  78. package/dist/composite/composite-group-label.d.ts +2 -2
  79. package/dist/composite/composite-group-label.d.ts.map +1 -1
  80. package/dist/composite/composite-group.d.ts +2 -2
  81. package/dist/composite/composite-group.d.ts.map +1 -1
  82. package/dist/composite/composite-hover.d.ts +1 -1
  83. package/dist/composite/composite-hover.js +9 -13
  84. package/dist/composite/composite-hover.js.map +1 -1
  85. package/dist/composite/composite-input.d.ts +1 -1
  86. package/dist/composite/composite-input.d.ts.map +1 -1
  87. package/dist/composite/composite-input.js +1 -1
  88. package/dist/composite/composite-input.js.map +1 -1
  89. package/dist/composite/composite-item-offscreen.d.ts +2 -2
  90. package/dist/composite/composite-item-offscreen.js +2 -2
  91. package/dist/composite/composite-item-offscreen.js.map +1 -1
  92. package/dist/composite/composite-item.d.ts +1 -1
  93. package/dist/composite/composite-item.js +2 -2
  94. package/dist/composite/composite-item.js.map +1 -1
  95. package/dist/composite/composite-overflow-disclosure.d.ts +2 -2
  96. package/dist/composite/composite-overflow-disclosure.d.ts.map +1 -1
  97. package/dist/composite/composite-overflow.d.ts +2 -2
  98. package/dist/composite/composite-overflow.d.ts.map +1 -1
  99. package/dist/composite/composite-renderer.d.ts +28 -14
  100. package/dist/composite/composite-renderer.d.ts.map +1 -1
  101. package/dist/composite/composite-renderer.js +2 -2
  102. package/dist/composite/composite-renderer.js.map +1 -1
  103. package/dist/composite/composite-row.d.ts +1 -1
  104. package/dist/composite/composite-row.d.ts.map +1 -1
  105. package/dist/composite/composite-row.js +3 -3
  106. package/dist/composite/composite-row.js.map +1 -1
  107. package/dist/composite/composite-separator.d.ts +2 -2
  108. package/dist/composite/composite-separator.d.ts.map +1 -1
  109. package/dist/composite/composite-separator.js +3 -3
  110. package/dist/composite/composite-separator.js.map +1 -1
  111. package/dist/composite/composite-typeahead.d.ts +1 -1
  112. package/dist/composite/composite-typeahead.js +3 -3
  113. package/dist/composite/composite-typeahead.js.map +1 -1
  114. package/dist/composite/composite.d.ts +1 -1
  115. package/dist/composite/composite.js +3 -3
  116. package/dist/composite/composite.js.map +1 -1
  117. package/dist/{composite-DLvyFHMq.d.ts → composite-KBhCGLEy.d.ts} +3 -3
  118. package/dist/{composite-DLvyFHMq.d.ts.map → composite-KBhCGLEy.d.ts.map} +1 -1
  119. package/dist/{composite-hover-C7ul163w.d.ts → composite-hover-BpXq3T8J.d.ts} +2 -2
  120. package/dist/{composite-hover-C7ul163w.d.ts.map → composite-hover-BpXq3T8J.d.ts.map} +1 -1
  121. package/dist/{composite-item-B4WTelVz.d.ts → composite-item-d4UXaZ84.d.ts} +4 -4
  122. package/dist/{composite-item-B4WTelVz.d.ts.map → composite-item-d4UXaZ84.d.ts.map} +1 -1
  123. package/dist/{composite-typeahead-DDhpyKqm.d.ts → composite-typeahead-0euW43GU.d.ts} +2 -2
  124. package/dist/{composite-typeahead-DDhpyKqm.d.ts.map → composite-typeahead-0euW43GU.d.ts.map} +1 -1
  125. package/dist/dialog/dialog-backdrop.d.ts +1 -1
  126. package/dist/dialog/dialog-description.d.ts +1 -1
  127. package/dist/dialog/dialog-disclosure.d.ts +1 -1
  128. package/dist/dialog/dialog-disclosure.js +1 -1
  129. package/dist/dialog/dialog-disclosure.js.map +1 -1
  130. package/dist/dialog/dialog-dismiss.d.ts +1 -1
  131. package/dist/dialog/dialog-heading.d.ts +1 -1
  132. package/dist/dialog/dialog.d.ts +1 -1
  133. package/dist/dialog/dialog.js +18 -6
  134. package/dist/dialog/dialog.js.map +1 -1
  135. package/dist/dialog/utils/disable-accessibility-tree-outside.d.ts +1 -3
  136. package/dist/dialog/utils/disable-accessibility-tree-outside.d.ts.map +1 -1
  137. package/dist/dialog/utils/disable-accessibility-tree-outside.js +1 -15
  138. package/dist/dialog/utils/disable-accessibility-tree-outside.js.map +1 -1
  139. package/dist/dialog/utils/use-hide-on-interact-outside.d.ts +1 -1
  140. package/dist/dialog/utils/use-hide-on-interact-outside.js +2 -2
  141. package/dist/dialog/utils/use-hide-on-interact-outside.js.map +1 -1
  142. package/dist/dialog/utils/use-prevent-body-scroll.js +2 -1
  143. package/dist/dialog/utils/use-prevent-body-scroll.js.map +1 -1
  144. package/dist/dialog/utils/use-previous-mouse-down-ref.d.ts +1 -1
  145. package/dist/dialog/utils/use-previous-mouse-down-ref.d.ts.map +1 -1
  146. package/dist/{dialog-C__C-zX2.d.ts → dialog-D23r2ZWj.d.ts} +4 -4
  147. package/dist/{dialog-C__C-zX2.d.ts.map → dialog-D23r2ZWj.d.ts.map} +1 -1
  148. package/dist/{dialog-description-BCZJ1Kyd.d.ts → dialog-description-CJGxnEvk.d.ts} +2 -2
  149. package/dist/{dialog-description-BCZJ1Kyd.d.ts.map → dialog-description-CJGxnEvk.d.ts.map} +1 -1
  150. package/dist/{dialog-disclosure-DLD10zlb.d.ts → dialog-disclosure-DSESk5pv.d.ts} +3 -3
  151. package/dist/{dialog-disclosure-DLD10zlb.d.ts.map → dialog-disclosure-DSESk5pv.d.ts.map} +1 -1
  152. package/dist/{dialog-dismiss-CnwEbzc6.d.ts → dialog-dismiss-DW3XQYvp.d.ts} +3 -3
  153. package/dist/{dialog-dismiss-CnwEbzc6.d.ts.map → dialog-dismiss-DW3XQYvp.d.ts.map} +1 -1
  154. package/dist/{dialog-heading-DQvnOfZH.d.ts → dialog-heading-DGA5d8VH.d.ts} +3 -3
  155. package/dist/{dialog-heading-DQvnOfZH.d.ts.map → dialog-heading-DGA5d8VH.d.ts.map} +1 -1
  156. package/dist/disclosure/disclosure-content.js +1 -1
  157. package/dist/disclosure/disclosure-content.js.map +1 -1
  158. package/dist/disclosure/disclosure.d.ts +1 -1
  159. package/dist/disclosure/disclosure.js +1 -1
  160. package/dist/disclosure/disclosure.js.map +1 -1
  161. package/dist/{disclosure-CQ37hPVP.d.ts → disclosure-C4F4sCVZ.d.ts} +3 -3
  162. package/dist/{disclosure-CQ37hPVP.d.ts.map → disclosure-C4F4sCVZ.d.ts.map} +1 -1
  163. package/dist/focus-trap/focus-trap-region.d.ts +1 -1
  164. package/dist/focus-trap/focus-trap-region.d.ts.map +1 -1
  165. package/dist/focus-trap/focus-trap.d.ts +1 -1
  166. package/dist/focus-trap/focus-trap.d.ts.map +1 -1
  167. package/dist/focusable/focusable-container.d.ts +1 -1
  168. package/dist/focusable/focusable-container.d.ts.map +1 -1
  169. package/dist/focusable/focusable.d.ts +1 -1
  170. package/dist/focusable/focusable.js +49 -8
  171. package/dist/focusable/focusable.js.map +1 -1
  172. package/dist/{focusable-B00tOxtB.d.ts → focusable-dBZH13-T.d.ts} +2 -2
  173. package/dist/{focusable-B00tOxtB.d.ts.map → focusable-dBZH13-T.d.ts.map} +1 -1
  174. package/dist/form/form-checkbox.d.ts +1 -1
  175. package/dist/form/form-checkbox.d.ts.map +1 -1
  176. package/dist/form/form-checkbox.js +1 -1
  177. package/dist/form/form-checkbox.js.map +1 -1
  178. package/dist/form/form-control.d.ts +2 -2
  179. package/dist/form/form-control.d.ts.map +1 -1
  180. package/dist/form/form-control.js +1 -1
  181. package/dist/form/form-control.js.map +1 -1
  182. package/dist/form/form-description.d.ts +2 -2
  183. package/dist/form/form-description.d.ts.map +1 -1
  184. package/dist/form/form-description.js +1 -1
  185. package/dist/form/form-description.js.map +1 -1
  186. package/dist/form/form-error.d.ts +2 -2
  187. package/dist/form/form-error.d.ts.map +1 -1
  188. package/dist/form/form-error.js +1 -1
  189. package/dist/form/form-error.js.map +1 -1
  190. package/dist/form/form-field.d.ts +1 -1
  191. package/dist/form/form-field.d.ts.map +1 -1
  192. package/dist/form/form-group-label.d.ts +2 -2
  193. package/dist/form/form-group-label.d.ts.map +1 -1
  194. package/dist/form/form-group.d.ts +2 -2
  195. package/dist/form/form-group.d.ts.map +1 -1
  196. package/dist/form/form-input.d.ts +2 -2
  197. package/dist/form/form-input.d.ts.map +1 -1
  198. package/dist/form/form-input.js +1 -1
  199. package/dist/form/form-input.js.map +1 -1
  200. package/dist/form/form-label.d.ts +2 -2
  201. package/dist/form/form-label.d.ts.map +1 -1
  202. package/dist/form/form-label.js +1 -1
  203. package/dist/form/form-label.js.map +1 -1
  204. package/dist/form/form-push.d.ts +3 -3
  205. package/dist/form/form-push.d.ts.map +1 -1
  206. package/dist/form/form-push.js +1 -1
  207. package/dist/form/form-push.js.map +1 -1
  208. package/dist/form/form-radio-group.d.ts +1 -1
  209. package/dist/form/form-radio-group.d.ts.map +1 -1
  210. package/dist/form/form-radio.d.ts +1 -1
  211. package/dist/form/form-radio.d.ts.map +1 -1
  212. package/dist/form/form-radio.js +1 -1
  213. package/dist/form/form-radio.js.map +1 -1
  214. package/dist/form/form-remove.d.ts +16 -12
  215. package/dist/form/form-remove.d.ts.map +1 -1
  216. package/dist/form/form-remove.js +15 -11
  217. package/dist/form/form-remove.js.map +1 -1
  218. package/dist/form/form-reset.d.ts +2 -2
  219. package/dist/form/form-reset.d.ts.map +1 -1
  220. package/dist/form/form-reset.js +1 -1
  221. package/dist/form/form-reset.js.map +1 -1
  222. package/dist/form/form-submit.d.ts +2 -2
  223. package/dist/form/form-submit.d.ts.map +1 -1
  224. package/dist/form/form-submit.js +1 -1
  225. package/dist/form/form-submit.js.map +1 -1
  226. package/dist/form/form.d.ts +1 -1
  227. package/dist/form/form.d.ts.map +1 -1
  228. package/dist/form/form.js +1 -1
  229. package/dist/form/form.js.map +1 -1
  230. package/dist/group/group-label.d.ts +1 -1
  231. package/dist/group/group.d.ts +1 -1
  232. package/dist/{group-label-C16IDs1b.d.ts → group-label-BKYqD4Sj.d.ts} +2 -2
  233. package/dist/{group-label-C16IDs1b.d.ts.map → group-label-BKYqD4Sj.d.ts.map} +1 -1
  234. package/dist/{group-CamegDJA.d.ts → group-nGD9e6Dj.d.ts} +2 -2
  235. package/dist/{group-CamegDJA.d.ts.map → group-nGD9e6Dj.d.ts.map} +1 -1
  236. package/dist/heading/heading.d.ts +1 -1
  237. package/dist/heading/heading.js +2 -2
  238. package/dist/heading/heading.js.map +1 -1
  239. package/dist/{heading-zY9g_9K-.d.ts → heading-D_AmeqL5.d.ts} +2 -2
  240. package/dist/{heading-zY9g_9K-.d.ts.map → heading-D_AmeqL5.d.ts.map} +1 -1
  241. package/dist/hovercard/hovercard-anchor.d.ts +2 -2
  242. package/dist/hovercard/hovercard-anchor.d.ts.map +1 -1
  243. package/dist/hovercard/hovercard-anchor.js +1 -1
  244. package/dist/hovercard/hovercard-anchor.js.map +1 -1
  245. package/dist/hovercard/hovercard-arrow.d.ts +1 -1
  246. package/dist/hovercard/hovercard-arrow.d.ts.map +1 -1
  247. package/dist/hovercard/hovercard-description.d.ts +2 -2
  248. package/dist/hovercard/hovercard-description.d.ts.map +1 -1
  249. package/dist/hovercard/hovercard-disclosure.d.ts +2 -2
  250. package/dist/hovercard/hovercard-disclosure.d.ts.map +1 -1
  251. package/dist/hovercard/hovercard-disclosure.js +4 -4
  252. package/dist/hovercard/hovercard-disclosure.js.map +1 -1
  253. package/dist/hovercard/hovercard-dismiss.d.ts +2 -2
  254. package/dist/hovercard/hovercard-dismiss.d.ts.map +1 -1
  255. package/dist/hovercard/hovercard-heading.d.ts +2 -2
  256. package/dist/hovercard/hovercard-heading.d.ts.map +1 -1
  257. package/dist/hovercard/hovercard.d.ts +1 -1
  258. package/dist/hovercard/hovercard.js +2 -2
  259. package/dist/hovercard/hovercard.js.map +1 -1
  260. package/dist/menu/menu-arrow.d.ts +2 -2
  261. package/dist/menu/menu-arrow.d.ts.map +1 -1
  262. package/dist/menu/menu-bar-provider.js +1 -1
  263. package/dist/menu/menu-bar-provider.js.map +1 -1
  264. package/dist/menu/menu-bar-store.d.ts +3 -3
  265. package/dist/menu/menu-bar-store.js +3 -3
  266. package/dist/menu/menu-bar-store.js.map +1 -1
  267. package/dist/menu/menu-bar.d.ts +1 -1
  268. package/dist/menu/menu-bar.d.ts.map +1 -1
  269. package/dist/menu/menu-bar.js +1 -1
  270. package/dist/menu/menu-bar.js.map +1 -1
  271. package/dist/menu/menu-button-arrow.d.ts +2 -2
  272. package/dist/menu/menu-button-arrow.d.ts.map +1 -1
  273. package/dist/menu/menu-button.d.ts +3 -3
  274. package/dist/menu/menu-button.d.ts.map +1 -1
  275. package/dist/menu/menu-button.js +1 -1
  276. package/dist/menu/menu-button.js.map +1 -1
  277. package/dist/menu/menu-context.d.ts +10 -3
  278. package/dist/menu/menu-context.d.ts.map +1 -1
  279. package/dist/menu/menu-context.js +8 -1
  280. package/dist/menu/menu-context.js.map +1 -1
  281. package/dist/menu/menu-description.d.ts +2 -2
  282. package/dist/menu/menu-description.d.ts.map +1 -1
  283. package/dist/menu/menu-dismiss.d.ts +2 -2
  284. package/dist/menu/menu-dismiss.d.ts.map +1 -1
  285. package/dist/menu/menu-group-label.d.ts +2 -2
  286. package/dist/menu/menu-group-label.d.ts.map +1 -1
  287. package/dist/menu/menu-group.d.ts +2 -2
  288. package/dist/menu/menu-group.d.ts.map +1 -1
  289. package/dist/menu/menu-heading.d.ts +2 -2
  290. package/dist/menu/menu-heading.d.ts.map +1 -1
  291. package/dist/menu/menu-item-check.d.ts +2 -2
  292. package/dist/menu/menu-item-check.d.ts.map +1 -1
  293. package/dist/menu/menu-item-checkbox.d.ts +2 -2
  294. package/dist/menu/menu-item-checkbox.d.ts.map +1 -1
  295. package/dist/menu/menu-item-checkbox.js +1 -1
  296. package/dist/menu/menu-item-checkbox.js.map +1 -1
  297. package/dist/menu/menu-item-radio.d.ts +2 -2
  298. package/dist/menu/menu-item-radio.d.ts.map +1 -1
  299. package/dist/menu/menu-item-radio.js +1 -1
  300. package/dist/menu/menu-item-radio.js.map +1 -1
  301. package/dist/menu/menu-item.d.ts +5 -5
  302. package/dist/menu/menu-item.d.ts.map +1 -1
  303. package/dist/menu/menu-item.js +8 -4
  304. package/dist/menu/menu-item.js.map +1 -1
  305. package/dist/menu/menu-list.d.ts +4 -4
  306. package/dist/menu/menu-list.d.ts.map +1 -1
  307. package/dist/menu/menu-list.js +6 -2
  308. package/dist/menu/menu-list.js.map +1 -1
  309. package/dist/menu/menu-provider.d.ts +1 -1
  310. package/dist/menu/menu-separator.d.ts +2 -2
  311. package/dist/menu/menu-separator.d.ts.map +1 -1
  312. package/dist/menu/menu-store.d.ts +1 -1
  313. package/dist/menu/menu.js +1 -1
  314. package/dist/menu/menu.js.map +1 -1
  315. package/dist/{menu-store-0CKKmNek.d.ts → menu-store-BpTJdcL8.d.ts} +2 -2
  316. package/dist/{menu-store-0CKKmNek.d.ts.map → menu-store-BpTJdcL8.d.ts.map} +1 -1
  317. package/dist/menubar/menubar-context.d.ts +2 -3
  318. package/dist/menubar/menubar-context.d.ts.map +1 -1
  319. package/dist/menubar/menubar-context.js +1 -3
  320. package/dist/menubar/menubar-context.js.map +1 -1
  321. package/dist/menubar/menubar-provider.d.ts +1 -1
  322. package/dist/menubar/menubar-store.d.ts +1 -1
  323. package/dist/menubar/menubar-store.js +2 -2
  324. package/dist/menubar/menubar-store.js.map +1 -1
  325. package/dist/menubar/menubar.d.ts +3 -3
  326. package/dist/menubar/menubar.d.ts.map +1 -1
  327. package/dist/{menubar-store-3h0eNIbS.d.ts → menubar-store-C553OKBw.d.ts} +3 -3
  328. package/dist/{menubar-store-3h0eNIbS.d.ts.map → menubar-store-C553OKBw.d.ts.map} +1 -1
  329. package/dist/popover/popover-anchor.d.ts +1 -1
  330. package/dist/popover/popover-arrow.d.ts +1 -1
  331. package/dist/popover/popover-arrow.d.ts.map +1 -1
  332. package/dist/popover/popover-arrow.js +4 -4
  333. package/dist/popover/popover-arrow.js.map +1 -1
  334. package/dist/popover/popover-description.d.ts +1 -1
  335. package/dist/popover/popover-disclosure-arrow.d.ts +1 -1
  336. package/dist/popover/popover-disclosure-arrow.d.ts.map +1 -1
  337. package/dist/popover/popover-disclosure-arrow.js +1 -1
  338. package/dist/popover/popover-disclosure-arrow.js.map +1 -1
  339. package/dist/popover/popover-disclosure.d.ts +3 -3
  340. package/dist/popover/popover-disclosure.d.ts.map +1 -1
  341. package/dist/popover/popover-disclosure.js +1 -1
  342. package/dist/popover/popover-disclosure.js.map +1 -1
  343. package/dist/popover/popover-dismiss.d.ts +1 -1
  344. package/dist/popover/popover-heading.d.ts +1 -1
  345. package/dist/popover/popover.d.ts +1 -1
  346. package/dist/popover/popover.js +2 -2
  347. package/dist/popover/popover.js.map +1 -1
  348. package/dist/{popover-CCqiRKqg.d.ts → popover-B9PxE5iP.d.ts} +10 -2
  349. package/dist/popover-B9PxE5iP.d.ts.map +1 -0
  350. package/dist/{popover-anchor-PgfeXyzs.d.ts → popover-anchor-W18KUmuM.d.ts} +2 -2
  351. package/dist/{popover-anchor-PgfeXyzs.d.ts.map → popover-anchor-W18KUmuM.d.ts.map} +1 -1
  352. package/dist/{popover-description-DU753dah.d.ts → popover-description-DbW4mVBb.d.ts} +3 -3
  353. package/dist/{popover-description-DU753dah.d.ts.map → popover-description-DbW4mVBb.d.ts.map} +1 -1
  354. package/dist/{popover-dismiss-DPeI6Zse.d.ts → popover-dismiss-CQFvuLzJ.d.ts} +3 -3
  355. package/dist/{popover-dismiss-DPeI6Zse.d.ts.map → popover-dismiss-CQFvuLzJ.d.ts.map} +1 -1
  356. package/dist/{popover-heading-DGsr6D5W.d.ts → popover-heading-DC8rYnwo.d.ts} +3 -3
  357. package/dist/{popover-heading-DGsr6D5W.d.ts.map → popover-heading-DC8rYnwo.d.ts.map} +1 -1
  358. package/dist/portal/portal.d.ts +1 -1
  359. package/dist/{portal-CMBWiayp.d.ts → portal-CKFTfCWH.d.ts} +2 -2
  360. package/dist/{portal-CMBWiayp.d.ts.map → portal-CKFTfCWH.d.ts.map} +1 -1
  361. package/dist/radio/radio-group.d.ts +2 -2
  362. package/dist/radio/radio-group.d.ts.map +1 -1
  363. package/dist/radio/radio-group.js +1 -1
  364. package/dist/radio/radio-group.js.map +1 -1
  365. package/dist/radio/radio.d.ts +2 -2
  366. package/dist/radio/radio.d.ts.map +1 -1
  367. package/dist/select/select-arrow.d.ts +1 -1
  368. package/dist/select/select-arrow.d.ts.map +1 -1
  369. package/dist/select/select-dismiss.d.ts +2 -2
  370. package/dist/select/select-dismiss.d.ts.map +1 -1
  371. package/dist/select/select-group-label.d.ts +1 -1
  372. package/dist/select/select-group-label.d.ts.map +1 -1
  373. package/dist/select/select-group.d.ts +1 -1
  374. package/dist/select/select-group.d.ts.map +1 -1
  375. package/dist/select/select-heading.d.ts +2 -2
  376. package/dist/select/select-heading.d.ts.map +1 -1
  377. package/dist/select/select-item-check.d.ts +1 -1
  378. package/dist/select/select-item-check.d.ts.map +1 -1
  379. package/dist/select/select-item.d.ts +3 -3
  380. package/dist/select/select-item.d.ts.map +1 -1
  381. package/dist/select/select-item.js +1 -1
  382. package/dist/select/select-item.js.map +1 -1
  383. package/dist/select/select-label.d.ts +1 -1
  384. package/dist/select/select-label.d.ts.map +1 -1
  385. package/dist/select/select-label.js +1 -1
  386. package/dist/select/select-label.js.map +1 -1
  387. package/dist/select/select-list.d.ts +3 -3
  388. package/dist/select/select-list.d.ts.map +1 -1
  389. package/dist/select/select-list.js +1 -1
  390. package/dist/select/select-list.js.map +1 -1
  391. package/dist/select/select-popover.d.ts +1 -1
  392. package/dist/select/select-renderer.d.ts +2 -2
  393. package/dist/select/select-renderer.d.ts.map +1 -1
  394. package/dist/select/select-row.d.ts +1 -1
  395. package/dist/select/select-row.d.ts.map +1 -1
  396. package/dist/select/select-row.js +1 -1
  397. package/dist/select/select-row.js.map +1 -1
  398. package/dist/select/select-separator.d.ts +1 -1
  399. package/dist/select/select-separator.d.ts.map +1 -1
  400. package/dist/select/select.d.ts +2 -2
  401. package/dist/select/select.d.ts.map +1 -1
  402. package/dist/select/select.js +1 -1
  403. package/dist/select/select.js.map +1 -1
  404. package/dist/separator/separator.d.ts +1 -1
  405. package/dist/{separator--ozQfMcK.d.ts → separator-BnvSVwBa.d.ts} +2 -2
  406. package/dist/{separator--ozQfMcK.d.ts.map → separator-BnvSVwBa.d.ts.map} +1 -1
  407. package/dist/tab/tab-list.d.ts +2 -2
  408. package/dist/tab/tab-list.d.ts.map +1 -1
  409. package/dist/tab/tab-list.js +1 -1
  410. package/dist/tab/tab-list.js.map +1 -1
  411. package/dist/tab/tab-panel.d.ts +3 -3
  412. package/dist/tab/tab-panel.d.ts.map +1 -1
  413. package/dist/tab/tab-panel.js +2 -3
  414. package/dist/tab/tab-panel.js.map +1 -1
  415. package/dist/tab/tab.d.ts +2 -2
  416. package/dist/tab/tab.d.ts.map +1 -1
  417. package/dist/tab/tab.js +1 -1
  418. package/dist/tab/tab.js.map +1 -1
  419. package/dist/tag/tag-input.d.ts +2 -2
  420. package/dist/tag/tag-input.d.ts.map +1 -1
  421. package/dist/tag/tag-input.js +1 -2
  422. package/dist/tag/tag-input.js.map +1 -1
  423. package/dist/tag/tag-list-label.d.ts +2 -2
  424. package/dist/tag/tag-list-label.d.ts.map +1 -1
  425. package/dist/tag/tag-list-label.js +1 -1
  426. package/dist/tag/tag-list-label.js.map +1 -1
  427. package/dist/tag/tag-list.d.ts +2 -2
  428. package/dist/tag/tag-list.d.ts.map +1 -1
  429. package/dist/tag/tag-list.js +1 -1
  430. package/dist/tag/tag-list.js.map +1 -1
  431. package/dist/tag/tag-remove.d.ts +1 -1
  432. package/dist/tag/tag-remove.d.ts.map +1 -1
  433. package/dist/tag/tag-remove.js +1 -2
  434. package/dist/tag/tag-remove.js.map +1 -1
  435. package/dist/tag/tag-value.js +1 -1
  436. package/dist/tag/tag-value.js.map +1 -1
  437. package/dist/tag/tag-values.js +1 -1
  438. package/dist/tag/tag-values.js.map +1 -1
  439. package/dist/tag/tag.d.ts +2 -2
  440. package/dist/tag/tag.d.ts.map +1 -1
  441. package/dist/tag/tag.js +1 -1
  442. package/dist/tag/tag.js.map +1 -1
  443. package/dist/toolbar/toolbar-container.d.ts +1 -1
  444. package/dist/toolbar/toolbar-container.d.ts.map +1 -1
  445. package/dist/toolbar/toolbar-input.d.ts +1 -1
  446. package/dist/toolbar/toolbar-input.d.ts.map +1 -1
  447. package/dist/toolbar/toolbar-item.d.ts +2 -2
  448. package/dist/toolbar/toolbar-item.d.ts.map +1 -1
  449. package/dist/toolbar/toolbar-separator.d.ts +1 -1
  450. package/dist/toolbar/toolbar-separator.d.ts.map +1 -1
  451. package/dist/toolbar/toolbar.d.ts +2 -2
  452. package/dist/toolbar/toolbar.d.ts.map +1 -1
  453. package/dist/tooltip/tooltip-anchor.d.ts +1 -1
  454. package/dist/tooltip/tooltip-anchor.d.ts.map +1 -1
  455. package/dist/tooltip/tooltip-anchor.js +15 -4
  456. package/dist/tooltip/tooltip-anchor.js.map +1 -1
  457. package/dist/tooltip/tooltip-arrow.d.ts +1 -1
  458. package/dist/tooltip/tooltip-arrow.d.ts.map +1 -1
  459. package/dist/tooltip/tooltip-arrow.js +1 -1
  460. package/dist/tooltip/tooltip-arrow.js.map +1 -1
  461. package/dist/tooltip/tooltip.js +1 -1
  462. package/dist/tooltip/tooltip.js.map +1 -1
  463. package/dist/visually-hidden/visually-hidden.d.ts +1 -1
  464. package/dist/visually-hidden/visually-hidden.d.ts.map +1 -1
  465. package/package.json +8 -8
  466. package/src/collection/collection-item-offscreen.tsx +1 -1
  467. package/src/combobox/combobox.tsx +47 -1
  468. package/src/composite/composite-container.tsx +2 -2
  469. package/src/composite/composite-hover.tsx +8 -14
  470. package/src/composite/composite-item-offscreen.tsx +2 -2
  471. package/src/composite/composite-item.tsx +2 -2
  472. package/src/composite/composite-renderer.tsx +2 -2
  473. package/src/composite/composite-row.tsx +2 -2
  474. package/src/composite/composite-separator.tsx +2 -2
  475. package/src/composite/composite-typeahead.tsx +2 -2
  476. package/src/composite/composite.tsx +3 -3
  477. package/src/dialog/dialog.tsx +33 -10
  478. package/src/dialog/utils/disable-accessibility-tree-outside.ts +0 -25
  479. package/src/dialog/utils/use-hide-on-interact-outside.ts +3 -2
  480. package/src/focusable/focusable.tsx +53 -10
  481. package/src/form/form-remove.tsx +14 -10
  482. package/src/form/form.tsx +3 -1
  483. package/src/heading/heading.tsx +2 -5
  484. package/src/hovercard/hovercard-disclosure.tsx +18 -4
  485. package/src/hovercard/hovercard.tsx +1 -1
  486. package/src/menu/menu-bar-store.ts +2 -2
  487. package/src/menu/menu-context.tsx +8 -0
  488. package/src/menu/menu-item.tsx +18 -1
  489. package/src/menu/menu-list.tsx +15 -0
  490. package/src/menubar/menubar-context.tsx +0 -5
  491. package/src/menubar/menubar-store.ts +2 -2
  492. package/src/popover/popover-arrow.tsx +3 -3
  493. package/src/popover/popover.tsx +8 -0
  494. package/src/tab/tab-panel.tsx +1 -1
  495. package/src/tag/tag-input.tsx +0 -1
  496. package/src/tag/tag-remove.tsx +0 -1
  497. package/src/tooltip/tooltip-anchor.tsx +23 -8
  498. package/dist/collection-renderer-DsPD9ksD.d.ts.map +0 -1
  499. package/dist/popover-CCqiRKqg.d.ts.map +0 -1
  500. package/src/hovercard/utils/__tests__/polygon-test.ts +0 -66
@@ -1 +1 @@
1
- {"version":3,"file":"menu-context.js","names":[],"sources":["../../src/menu/menu-context.tsx"],"sourcesContent":["import { createStoreContext } from \"@ariakit/react-utils\";\nimport { createContext } from \"react\";\nimport {\n CompositeContextProvider,\n CompositeScopedContextProvider,\n} from \"../composite/composite-context.tsx\";\nimport {\n HovercardContextProvider,\n HovercardScopedContextProvider,\n} from \"../hovercard/hovercard-context.tsx\";\nimport {\n MenubarContextProvider,\n MenubarScopedContextProvider,\n useMenubarContext,\n useMenubarProviderContext,\n useMenubarScopedContext,\n} from \"../menubar/menubar-context.tsx\";\nimport type { MenuStore } from \"./menu-store.ts\";\n\nconst menu = createStoreContext<MenuStore>(\n [CompositeContextProvider, HovercardContextProvider],\n [CompositeScopedContextProvider, HovercardScopedContextProvider],\n);\n\n/**\n * Returns the menu store from the nearest menu container.\n * @example\n * function Menu() {\n * const store = useMenuContext();\n *\n * if (!store) {\n * throw new Error(\"Menu must be wrapped in MenuProvider\");\n * }\n *\n * // Use the store...\n * }\n */\nexport const useMenuContext = menu.useContext;\n\nexport const useMenuScopedContext = menu.useScopedContext;\n\nexport const useMenuProviderContext = menu.useProviderContext;\n\nexport const MenuContextProvider = menu.ContextProvider;\n\nexport const MenuScopedContextProvider = menu.ScopedContextProvider;\n\n/**\n * Returns the menuBar store from the nearest menuBar container.\n * @deprecated\n * Use [`useMenubarContext`](https://ariakit.com/reference/use-menubar-context)\n * instead.\n * @example\n * function MenuBar() {\n * const store = useMenuBarContext();\n *\n * if (!store) {\n * throw new Error(\"MenuBar must be wrapped in MenuBarProvider\");\n * }\n *\n * // Use the store...\n * }\n */\nexport const useMenuBarContext = useMenubarContext;\n\nexport const useMenuBarScopedContext = useMenubarScopedContext;\n\nexport const useMenuBarProviderContext = useMenubarProviderContext;\n\nexport const MenuBarContextProvider = MenubarContextProvider;\n\nexport const MenuBarScopedContextProvider = MenubarScopedContextProvider;\n\nexport const MenuItemCheckedContext = createContext<boolean | undefined>(\n undefined,\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuCA,MAAa,iBAAA,KAAA;AAEb,MAAa,uBAAA,KAAyB;AAEtC,MAAa,yBAAsB,KAAK;AAExC,MAAa,sBAAA,KAAA;;;;;;;;;;;;;;;;;;AAoBb,MAAa,oBAAA;AAEb,MAAa,0BAAA;AAEb,MAAa,4BAAyB;AAEtC,MAAa,yBAAA;AAEb,MAAa,+BAAyB"}
1
+ {"version":3,"file":"menu-context.js","names":[],"sources":["../../src/menu/menu-context.tsx"],"sourcesContent":["import { createStoreContext } from \"@ariakit/react-utils\";\nimport { createContext } from \"react\";\nimport {\n CompositeContextProvider,\n CompositeScopedContextProvider,\n} from \"../composite/composite-context.tsx\";\nimport {\n HovercardContextProvider,\n HovercardScopedContextProvider,\n} from \"../hovercard/hovercard-context.tsx\";\nimport {\n MenubarContextProvider,\n MenubarScopedContextProvider,\n useMenubarContext,\n useMenubarProviderContext,\n useMenubarScopedContext,\n} from \"../menubar/menubar-context.tsx\";\nimport type { MenuStore } from \"./menu-store.ts\";\n\nconst menu = createStoreContext<MenuStore>(\n [CompositeContextProvider, HovercardContextProvider],\n [CompositeScopedContextProvider, HovercardScopedContextProvider],\n);\n\n/**\n * Returns the menu store from the nearest menu container.\n * @example\n * function Menu() {\n * const store = useMenuContext();\n *\n * if (!store) {\n * throw new Error(\"Menu must be wrapped in MenuProvider\");\n * }\n *\n * // Use the store...\n * }\n */\nexport const useMenuContext = menu.useContext;\n\nexport const useMenuScopedContext = menu.useScopedContext;\n\nexport const useMenuProviderContext = menu.useProviderContext;\n\nexport const MenuContextProvider = menu.ContextProvider;\n\nexport const MenuScopedContextProvider = menu.ScopedContextProvider;\n\n/**\n * Returns the menuBar store from the nearest menuBar container.\n * @deprecated\n * Use [`useMenubarContext`](https://ariakit.com/reference/use-menubar-context)\n * instead.\n * @example\n * function MenuBar() {\n * const store = useMenuBarContext();\n *\n * if (!store) {\n * throw new Error(\"MenuBar must be wrapped in MenuBarProvider\");\n * }\n *\n * // Use the store...\n * }\n */\nexport const useMenuBarContext = useMenubarContext;\n\nexport const useMenuBarScopedContext = useMenubarScopedContext;\n\nexport const useMenuBarProviderContext = useMenubarProviderContext;\n\nexport const MenuBarContextProvider = MenubarContextProvider;\n\nexport const MenuBarScopedContextProvider = MenubarScopedContextProvider;\n\nexport const MenuItemCheckedContext = createContext<boolean | undefined>(\n undefined,\n);\n\n/**\n * Whether the enclosing menu list is currently hidden (e.g. a closed menu\n * rendered without `unmountOnHide`). `MenuItem` uses it to skip registering\n * items that aren't shown yet. Defaults to `false` so items without a menu list\n * ancestor (such as menubar items) keep registering.\n */\nexport const MenuListHiddenContext = createContext(false);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuCA,MAAa,iBAAA,KAAA;AAEb,MAAa,uBAAA,KAAyB;AAEtC,MAAa,yBAAsB,KAAK;AAExC,MAAa,sBAAA,KAAA;;;;;;;;;;;;;;;;;;AAoBb,MAAa,oBAAA;AAEb,MAAa,0BAAA;AAEb,MAAa,4BAAyB;AAEtC,MAAa,yBAAA;AAEb,MAAa,+BAAyB"}
@@ -1,5 +1,5 @@
1
1
  import { HovercardDescriptionOptions } from "../hovercard/hovercard-description.js";
2
- import { t as MenuStore } from "../menu-store-0CKKmNek.js";
2
+ import { t as MenuStore } from "../menu-store-BpTJdcL8.js";
3
3
  import { Props } from "@ariakit/react-utils";
4
4
  import { ElementType } from "react";
5
5
 
@@ -33,7 +33,7 @@ declare const useMenuDescription: import("@ariakit/react-utils").Hook<"p", MenuD
33
33
  * </MenuProvider>
34
34
  * ```
35
35
  */
36
- declare const MenuDescription: (props: MenuDescriptionProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
36
+ declare const MenuDescription: (props: MenuDescriptionProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
37
37
  interface MenuDescriptionOptions<T extends ElementType = TagName> extends HovercardDescriptionOptions<T> {
38
38
  /**
39
39
  * Object returned by the
@@ -1 +1 @@
1
- {"version":3,"file":"menu-description.d.ts","names":["Props","ElementType","HovercardDescriptionOptions","MenuStore","TagName","useMenuDescription","MenuDescriptionOptions","Hook","MenuDescription","MenuDescriptionProps","props","ReactElement","JSXElementConstructor","T","store"],"sources":["../../src/menu/menu-description.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAa7B;;AAfiD,cAe5BC,kBAAAA,iCAAmDE,IAAAA,MAAUD,sBAAsB;;AAAA;AAexG;;;;;;;;;AAAuJ;AACvJ;;cADqBE,eAAAA,GAAkBE,KAAAA,EAAOD,oBAAoB,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UACjHN,sBAAAA,WAAiCL,WAAAA,GAAcG,OAAAA,UAAiBF,2BAAAA,CAA4BW,CAAAA;EAA7CT;;;;;;;EAQ5DU,KAAAA,GAAQX,SAAAA;AAAAA;AAAAA,KAEAM,oBAAAA,WAA+BR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,sBAAAA,CAAuBO,CAAAA"}
1
+ {"version":3,"file":"menu-description.d.ts","names":["Props","ElementType","HovercardDescriptionOptions","MenuStore","TagName","useMenuDescription","MenuDescriptionOptions","Hook","MenuDescription","MenuDescriptionProps","props","ReactElement","JSXElementConstructor","T","store"],"sources":["../../src/menu/menu-description.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAa7B;;AAfiD,cAe5BC,kBAAAA,iCAAmDE,IAAAA,MAAUD,sBAAsB;;AAAA;AAexG;;;;;;;;;AAA2J;AAC3J;;cADqBE,eAAAA,GAAkBE,KAAAA,EAAOD,oBAAoB,qBAAqBE,YAAAA,mCAA+CC,qBAAAA;AAAAA,UACrHN,sBAAAA,WAAiCL,WAAAA,GAAcG,OAAAA,UAAiBF,2BAAAA,CAA4BW,CAAAA;EAA7CT;;;;;;;EAQ5DU,KAAAA,GAAQX,SAAAA;AAAAA;AAAAA,KAEAM,oBAAAA,WAA+BR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,sBAAAA,CAAuBO,CAAAA"}
@@ -1,5 +1,5 @@
1
1
  import { HovercardDismissOptions } from "../hovercard/hovercard-dismiss.js";
2
- import { t as MenuStore } from "../menu-store-0CKKmNek.js";
2
+ import { t as MenuStore } from "../menu-store-BpTJdcL8.js";
3
3
  import { Props } from "@ariakit/react-utils";
4
4
  import { ElementType } from "react";
5
5
 
@@ -32,7 +32,7 @@ declare const useMenuDismiss: import("@ariakit/react-utils").Hook<"button", Menu
32
32
  * </MenuProvider>
33
33
  * ```
34
34
  */
35
- declare const MenuDismiss: (props: MenuDismissProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
35
+ declare const MenuDismiss: (props: MenuDismissProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
36
36
  interface MenuDismissOptions<T extends ElementType = TagName> extends HovercardDismissOptions<T> {
37
37
  /**
38
38
  * Object returned by the
@@ -1 +1 @@
1
- {"version":3,"file":"menu-dismiss.d.ts","names":["Props","ElementType","HovercardDismissOptions","MenuStore","TagName","useMenuDismiss","MenuDismissOptions","Hook","MenuDismiss","MenuDismissProps","props","ReactElement","JSXElementConstructor","T","store"],"sources":["../../src/menu/menu-dismiss.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAa7B;;AAfiD,cAe5BC,cAAAA,iCAA+CE,IAAAA,WAAeD,kBAAkB;;AAAA;AAcrG;;;;;;;;;AAA+I;AAC/I;cADqBE,WAAAA,GAAcE,KAAAA,EAAOD,gBAAgB,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UACzGN,kBAAAA,WAA6BL,WAAAA,GAAcG,OAAAA,UAAiBF,uBAAAA,CAAwBW,CAAAA;EAAvDZ;;;;;;;EAQ1Ca,KAAAA,GAAQX,SAAAA;AAAAA;AAAAA,KAEAM,gBAAAA,WAA2BR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,kBAAAA,CAAmBO,CAAAA"}
1
+ {"version":3,"file":"menu-dismiss.d.ts","names":["Props","ElementType","HovercardDismissOptions","MenuStore","TagName","useMenuDismiss","MenuDismissOptions","Hook","MenuDismiss","MenuDismissProps","props","ReactElement","JSXElementConstructor","T","store"],"sources":["../../src/menu/menu-dismiss.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAa7B;;AAfiD,cAe5BC,cAAAA,iCAA+CE,IAAAA,WAAeD,kBAAkB;;AAAA;AAcrG;;;;;;;;;AAAmJ;AACnJ;cADqBE,WAAAA,GAAcE,KAAAA,EAAOD,gBAAgB,qBAAqBE,YAAAA,mCAA+CC,qBAAAA;AAAAA,UAC7GN,kBAAAA,WAA6BL,WAAAA,GAAcG,OAAAA,UAAiBF,uBAAAA,CAAwBW,CAAAA;EAAvDZ;;;;;;;EAQ1Ca,KAAAA,GAAQX,SAAAA;AAAAA;AAAAA,KAEAM,gBAAAA,WAA2BR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,kBAAAA,CAAmBO,CAAAA"}
@@ -1,5 +1,5 @@
1
1
  import { CompositeGroupLabelOptions } from "../composite/composite-group-label.js";
2
- import { t as MenuStore } from "../menu-store-0CKKmNek.js";
2
+ import { t as MenuStore } from "../menu-store-BpTJdcL8.js";
3
3
  import { Props } from "@ariakit/react-utils";
4
4
  import { ElementType } from "react";
5
5
 
@@ -38,7 +38,7 @@ declare const useMenuGroupLabel: import("@ariakit/react-utils").Hook<"div", Menu
38
38
  * </MenuProvider>
39
39
  * ```
40
40
  */
41
- declare const MenuGroupLabel: (props: MenuGroupLabelProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
41
+ declare const MenuGroupLabel: (props: MenuGroupLabelProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
42
42
  interface MenuGroupLabelOptions<T extends ElementType = TagName> extends CompositeGroupLabelOptions<T> {
43
43
  /**
44
44
  * Object returned by the
@@ -1 +1 @@
1
- {"version":3,"file":"menu-group-label.d.ts","names":["Props","ElementType","CompositeGroupLabelOptions","MenuStore","TagName","useMenuGroupLabel","MenuGroupLabelOptions","Hook","MenuGroupLabel","MenuGroupLabelProps","props","ReactElement","JSXElementConstructor","T","store"],"sources":["../../src/menu/menu-group-label.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAa7B;;AAfiD,cAe5BC,iBAAAA,iCAAkDE,IAAAA,QAAYD,qBAAqB;;AAAA;AAoBxG;;;;;;;;;AAAqJ;AACrJ;;;;;;;cADqBE,cAAAA,GAAiBE,KAAAA,EAAOD,mBAAmB,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UAC/GN,qBAAAA,WAAgCL,WAAAA,GAAcG,OAAAA,UAAiBF,0BAAAA,CAA2BW,CAAAA;EAAD;;;;;;;EAQtGC,KAAAA,GAAQX,SAAAA;AAAAA;AAAAA,KAEAM,mBAAAA,WAA8BR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,qBAAAA,CAAsBO,CAAAA"}
1
+ {"version":3,"file":"menu-group-label.d.ts","names":["Props","ElementType","CompositeGroupLabelOptions","MenuStore","TagName","useMenuGroupLabel","MenuGroupLabelOptions","Hook","MenuGroupLabel","MenuGroupLabelProps","props","ReactElement","JSXElementConstructor","T","store"],"sources":["../../src/menu/menu-group-label.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAa7B;;AAfiD,cAe5BC,iBAAAA,iCAAkDE,IAAAA,QAAYD,qBAAqB;;AAAA;AAoBxG;;;;;;;;;AAAyJ;AACzJ;;;;;;;cADqBE,cAAAA,GAAiBE,KAAAA,EAAOD,mBAAmB,qBAAqBE,YAAAA,mCAA+CC,qBAAAA;AAAAA,UACnHN,qBAAAA,WAAgCL,WAAAA,GAAcG,OAAAA,UAAiBF,0BAAAA,CAA2BW,CAAAA;EAAD;;;;;;;EAQtGC,KAAAA,GAAQX,SAAAA;AAAAA;AAAAA,KAEAM,mBAAAA,WAA8BR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,qBAAAA,CAAsBO,CAAAA"}
@@ -1,5 +1,5 @@
1
1
  import { CompositeGroupOptions } from "../composite/composite-group.js";
2
- import { t as MenuStore } from "../menu-store-0CKKmNek.js";
2
+ import { t as MenuStore } from "../menu-store-BpTJdcL8.js";
3
3
  import { Props } from "@ariakit/react-utils";
4
4
  import { ElementType } from "react";
5
5
 
@@ -44,7 +44,7 @@ declare const useMenuGroup: import("@ariakit/react-utils").Hook<"div", MenuGroup
44
44
  * </MenuProvider>
45
45
  * ```
46
46
  */
47
- declare const MenuGroup: (props: MenuGroupProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
47
+ declare const MenuGroup: (props: MenuGroupProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
48
48
  interface MenuGroupOptions<T extends ElementType = TagName> extends CompositeGroupOptions<T> {
49
49
  /**
50
50
  * Object returned by the
@@ -1 +1 @@
1
- {"version":3,"file":"menu-group.d.ts","names":["Props","ElementType","CompositeGroupOptions","MenuStore","TagName","useMenuGroup","MenuGroupOptions","Hook","MenuGroup","MenuGroupProps","props","ReactElement","JSXElementConstructor","T","store"],"sources":["../../src/menu/menu-group.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAkB7B;;;;AAA8F;AAqB9F;;AAzCiD,cAoB5BC,YAAAA,iCAA6CE,IAAAA,QAAYD,gBAAgB;;;;;;;AAqB6C;AAC3I;;;;;;;;;;;;;cADqBE,SAAAA,GAAYE,KAAAA,EAAOD,cAAc,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UACrGN,gBAAAA,WAA2BL,WAAAA,GAAcG,OAAAA,UAAiBF,qBAAAA,CAAsBW,CAAAA;EAQ7FC;;;AAAiB;AAErB;;;EAFIA,KAAAA,GAAQX,SAAAA;AAAAA;AAAAA,KAEAM,cAAAA,WAAyBR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,gBAAAA,CAAiBO,CAAAA"}
1
+ {"version":3,"file":"menu-group.d.ts","names":["Props","ElementType","CompositeGroupOptions","MenuStore","TagName","useMenuGroup","MenuGroupOptions","Hook","MenuGroup","MenuGroupProps","props","ReactElement","JSXElementConstructor","T","store"],"sources":["../../src/menu/menu-group.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAkB7B;;;;AAA8F;AAqB9F;;AAzCiD,cAoB5BC,YAAAA,iCAA6CE,IAAAA,QAAYD,gBAAgB;;;;;;;AAqBiD;AAC/I;;;;;;;;;;;;;cADqBE,SAAAA,GAAYE,KAAAA,EAAOD,cAAc,qBAAqBE,YAAAA,mCAA+CC,qBAAAA;AAAAA,UACzGN,gBAAAA,WAA2BL,WAAAA,GAAcG,OAAAA,UAAiBF,qBAAAA,CAAsBW,CAAAA;EAQ7FC;;;AAAiB;AAErB;;;EAFIA,KAAAA,GAAQX,SAAAA;AAAAA;AAAAA,KAEAM,cAAAA,WAAyBR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,gBAAAA,CAAiBO,CAAAA"}
@@ -1,5 +1,5 @@
1
1
  import { HovercardHeadingOptions } from "../hovercard/hovercard-heading.js";
2
- import { t as MenuStore } from "../menu-store-0CKKmNek.js";
2
+ import { t as MenuStore } from "../menu-store-BpTJdcL8.js";
3
3
  import { Props } from "@ariakit/react-utils";
4
4
  import { ElementType } from "react";
5
5
 
@@ -33,7 +33,7 @@ declare const useMenuHeading: import("@ariakit/react-utils").Hook<"h1", MenuHead
33
33
  * </MenuProvider>
34
34
  * ```
35
35
  */
36
- declare const MenuHeading: (props: MenuHeadingProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
36
+ declare const MenuHeading: (props: MenuHeadingProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
37
37
  interface MenuHeadingOptions<T extends ElementType = TagName> extends HovercardHeadingOptions<T> {
38
38
  /**
39
39
  * Object returned by the
@@ -1 +1 @@
1
- {"version":3,"file":"menu-heading.d.ts","names":["Props","ElementType","HovercardHeadingOptions","MenuStore","TagName","useMenuHeading","MenuHeadingOptions","Hook","MenuHeading","MenuHeadingProps","props","ReactElement","JSXElementConstructor","T","store"],"sources":["../../src/menu/menu-heading.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAa7B;;AAfiD,cAe5BC,cAAAA,iCAA+CE,IAAAA,OAAWD,kBAAkB;;AAAA;AAejG;;;;;;;;;AAA+I;AAC/I;;cADqBE,WAAAA,GAAcE,KAAAA,EAAOD,gBAAgB,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UACzGN,kBAAAA,WAA6BL,WAAAA,GAAcG,OAAAA,UAAiBF,uBAAAA,CAAwBW,CAAAA;EAAzCT;;;;;;;EAQxDU,KAAAA,GAAQX,SAAAA;AAAAA;AAAAA,KAEAM,gBAAAA,WAA2BR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,kBAAAA,CAAmBO,CAAAA"}
1
+ {"version":3,"file":"menu-heading.d.ts","names":["Props","ElementType","HovercardHeadingOptions","MenuStore","TagName","useMenuHeading","MenuHeadingOptions","Hook","MenuHeading","MenuHeadingProps","props","ReactElement","JSXElementConstructor","T","store"],"sources":["../../src/menu/menu-heading.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAa7B;;AAfiD,cAe5BC,cAAAA,iCAA+CE,IAAAA,OAAWD,kBAAkB;;AAAA;AAejG;;;;;;;;;AAAmJ;AACnJ;;cADqBE,WAAAA,GAAcE,KAAAA,EAAOD,gBAAgB,qBAAqBE,YAAAA,mCAA+CC,qBAAAA;AAAAA,UAC7GN,kBAAAA,WAA6BL,WAAAA,GAAcG,OAAAA,UAAiBF,uBAAAA,CAAwBW,CAAAA;EAAzCT;;;;;;;EAQxDU,KAAAA,GAAQX,SAAAA;AAAAA;AAAAA,KAEAM,gBAAAA,WAA2BR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,kBAAAA,CAAmBO,CAAAA"}
@@ -1,5 +1,5 @@
1
1
  import { CheckboxCheckOptions } from "../checkbox/checkbox-check.js";
2
- import { t as MenuStore } from "../menu-store-0CKKmNek.js";
2
+ import { t as MenuStore } from "../menu-store-BpTJdcL8.js";
3
3
  import { Props } from "@ariakit/react-utils";
4
4
  import { ElementType } from "react";
5
5
 
@@ -44,7 +44,7 @@ declare const useMenuItemCheck: import("@ariakit/react-utils").Hook<"span", Menu
44
44
  * </MenuProvider>
45
45
  * ```
46
46
  */
47
- declare const MenuItemCheck: (props: MenuItemCheckProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
47
+ declare const MenuItemCheck: (props: MenuItemCheckProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
48
48
  interface MenuItemCheckOptions<T extends ElementType = TagName> extends Omit<CheckboxCheckOptions<T>, "store"> {
49
49
  /**
50
50
  * Object returned by the
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item-check.d.ts","names":["Props","ElementType","CheckboxCheckOptions","MenuStore","TagName","useMenuItemCheck","MenuItemCheckOptions","Hook","MenuItemCheck","MenuItemCheckProps","props","ReactElement","JSXElementConstructor","T","Omit","store"],"sources":["../../src/menu/menu-item-check.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AAD4B,cAY5BC,gBAAAA,iCAAiDE,IAAAA,SAAaD,oBAAoB;AAAvG;;;;AAAuG;AA6BvG;;;;;;;;;AAAmJ;AACnJ;;;;;;;;;;;;;AA9BA,cA6BqBE,aAAAA,GAAgBE,KAAAA,EAAOD,kBAAkB,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UAC7GN,oBAAAA,WAA+BL,WAAAA,GAAcG,OAAAA,UAAiBU,IAAAA,CAAKZ,oBAAAA,CAAqBW,CAAAA;EAArBX;;;;EAKhFa,KAAAA,GAAQZ,SAAAA;AAAAA;AAAAA,KAEAM,kBAAAA,WAA6BR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,oBAAAA,CAAqBO,CAAAA"}
1
+ {"version":3,"file":"menu-item-check.d.ts","names":["Props","ElementType","CheckboxCheckOptions","MenuStore","TagName","useMenuItemCheck","MenuItemCheckOptions","Hook","MenuItemCheck","MenuItemCheckProps","props","ReactElement","JSXElementConstructor","T","Omit","store"],"sources":["../../src/menu/menu-item-check.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AAD4B,cAY5BC,gBAAAA,iCAAiDE,IAAAA,SAAaD,oBAAoB;AAAvG;;;;AAAuG;AA6BvG;;;;;;;;;AAAuJ;AACvJ;;;;;;;;;;;;;AA9BA,cA6BqBE,aAAAA,GAAgBE,KAAAA,EAAOD,kBAAkB,qBAAqBE,YAAAA,mCAA+CC,qBAAAA;AAAAA,UACjHN,oBAAAA,WAA+BL,WAAAA,GAAcG,OAAAA,UAAiBU,IAAAA,CAAKZ,oBAAAA,CAAqBW,CAAAA;EAArBX;;;;EAKhFa,KAAAA,GAAQZ,SAAAA;AAAAA;AAAAA,KAEAM,kBAAAA,WAA6BR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,oBAAAA,CAAqBO,CAAAA"}
@@ -1,5 +1,5 @@
1
1
  import { CheckboxOptions } from "../checkbox/checkbox.js";
2
- import { t as MenuStore } from "../menu-store-0CKKmNek.js";
2
+ import { t as MenuStore } from "../menu-store-BpTJdcL8.js";
3
3
  import { MenuItemOptions } from "./menu-item.js";
4
4
  import { Props } from "@ariakit/react-utils";
5
5
  import { ElementType } from "react";
@@ -63,7 +63,7 @@ declare const useMenuItemCheckbox: import("@ariakit/react-utils").Hook<"div", Me
63
63
  * </MenuProvider>
64
64
  * ```
65
65
  */
66
- declare const MenuItemCheckbox: (props: MenuItemCheckboxProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
66
+ declare const MenuItemCheckbox: (props: MenuItemCheckboxProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
67
67
  interface MenuItemCheckboxOptions<T extends ElementType = TagName> extends MenuItemOptions<T>, Omit<CheckboxOptions<T>, "store"> {
68
68
  /**
69
69
  * Object returned by the
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item-checkbox.d.ts","names":["Props","ElementType","CheckboxOptions","MenuItemOptions","MenuStore","TagName","useMenuItemCheckbox","MenuItemCheckboxOptions","Hook","MenuItemCheckbox","MenuItemCheckboxProps","props","ReactElement","JSXElementConstructor","T","Omit","store","name","checked","defaultChecked","hideOnClick"],"sources":["../../src/menu/menu-item-checkbox.d.ts"],"mappings":";;;;;;;cAKcK,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAc7B;;;AAhBiD,cAgB5BC,mBAAAA,iCAAoDE,IAAAA,QAAYD,uBAAuB;AAAA;AA2C5G;;;;;;;;;AAAyJ;AACzJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5C4G,cA2CvFE,gBAAAA,GAAmBE,KAAAA,EAAOD,qBAAqB,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UACnHN,uBAAAA,WAAkCN,WAAAA,GAAcI,OAAAA,UAAiBF,eAAAA,CAAgBW,CAAAA,GAAIC,IAAAA,CAAKb,eAAAA,CAAgBY,CAAAA;EAkC/GJ;;;;;;;EA1BRM,KAAAA,GAAQZ,SAAAA;EA0ByDJ;;;;;;;EAlBjEiB,IAAAA;EAkB0EV;;;AAAyB;;EAZnGW,OAAAA;;;;;;EAMAC,cAAAA;;;;EAIAC,WAAAA,GAAcjB,eAAAA,CAAgBW,CAAAA;AAAAA;AAAAA,KAEtBJ,qBAAAA,WAAgCT,WAAAA,GAAcI,OAAAA,IAAWL,KAAAA,CAAMc,CAAAA,EAAGP,uBAAAA,CAAwBO,CAAAA"}
1
+ {"version":3,"file":"menu-item-checkbox.d.ts","names":["Props","ElementType","CheckboxOptions","MenuItemOptions","MenuStore","TagName","useMenuItemCheckbox","MenuItemCheckboxOptions","Hook","MenuItemCheckbox","MenuItemCheckboxProps","props","ReactElement","JSXElementConstructor","T","Omit","store","name","checked","defaultChecked","hideOnClick"],"sources":["../../src/menu/menu-item-checkbox.d.ts"],"mappings":";;;;;;;cAKcK,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAc7B;;;AAhBiD,cAgB5BC,mBAAAA,iCAAoDE,IAAAA,QAAYD,uBAAuB;AAAA;AA2C5G;;;;;;;;;AAA6J;AAC7J;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5C4G,cA2CvFE,gBAAAA,GAAmBE,KAAAA,EAAOD,qBAAqB,qBAAqBE,YAAAA,mCAA+CC,qBAAAA;AAAAA,UACvHN,uBAAAA,WAAkCN,WAAAA,GAAcI,OAAAA,UAAiBF,eAAAA,CAAgBW,CAAAA,GAAIC,IAAAA,CAAKb,eAAAA,CAAgBY,CAAAA;EAkC/GJ;;;;;;;EA1BRM,KAAAA,GAAQZ,SAAAA;EA0ByDJ;;;;;;;EAlBjEiB,IAAAA;EAkB0EV;;;AAAyB;;EAZnGW,OAAAA;;;;;;EAMAC,cAAAA;;;;EAIAC,WAAAA,GAAcjB,eAAAA,CAAgBW,CAAAA;AAAAA;AAAAA,KAEtBJ,qBAAAA,WAAgCT,WAAAA,GAAcI,OAAAA,IAAWL,KAAAA,CAAMc,CAAAA,EAAGP,uBAAAA,CAAwBO,CAAAA"}
@@ -45,7 +45,7 @@ function getValue(storeValue, value, checked) {
45
45
  const useMenuItemCheckbox = createHook(function useMenuItemCheckbox({ store, name, value, checked, defaultChecked: defaultCheckedProp, hideOnClick = false, ...props }) {
46
46
  const context = useMenuScopedContext();
47
47
  store = store || context;
48
- invariant(store, "MenuItemCheckbox must be wrapped in a MenuList or Menu component");
48
+ invariant(store, process.env.NODE_ENV !== "production" && "MenuItemCheckbox must be wrapped in a MenuList or Menu component");
49
49
  const defaultChecked = useInitialValue(defaultCheckedProp);
50
50
  useEffect(() => {
51
51
  store?.setValue(name, (prevValue = []) => {
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item-checkbox.js","names":[],"sources":["../../src/menu/menu-item-checkbox.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport {\n useInitialValue,\n createElement,\n createHook,\n forwardRef,\n memo,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport { invariant, shallowEqual } from \"@ariakit/utils\";\nimport type { ElementType } from \"react\";\nimport { useEffect } from \"react\";\nimport { useCheckboxStore } from \"../checkbox/checkbox-store.ts\";\nimport type { CheckboxOptions } from \"../checkbox/checkbox.tsx\";\nimport { useCheckbox } from \"../checkbox/checkbox.tsx\";\nimport { useMenuScopedContext } from \"./menu-context.tsx\";\nimport type { MenuItemOptions } from \"./menu-item.tsx\";\nimport { useMenuItem } from \"./menu-item.tsx\";\nimport type { MenuStore, MenuStoreValues } from \"./menu-store.ts\";\n\nconst TagName = \"div\" satisfies ElementType;\ntype TagName = typeof TagName;\ntype ValueState = MenuStoreValues[string];\n\nfunction getPrimitiveValue<T>(value: T) {\n if (Array.isArray(value)) {\n return value.toString();\n }\n return value as Exclude<T, readonly any[]>;\n}\n\nfunction getValue(\n storeValue: ValueState,\n value?: MenuItemCheckboxOptions[\"value\"],\n checked?: MenuItemCheckboxOptions[\"checked\"],\n) {\n if (value === undefined) {\n if (Array.isArray(storeValue)) return storeValue;\n return !!checked;\n }\n const primitiveValue = getPrimitiveValue(value);\n if (!Array.isArray(storeValue)) {\n if (checked) {\n return primitiveValue;\n }\n return storeValue === primitiveValue ? false : storeValue;\n }\n if (checked) {\n if (storeValue.includes(primitiveValue)) {\n return storeValue;\n }\n return [...storeValue, primitiveValue];\n }\n return storeValue.filter((v) => v !== primitiveValue);\n}\n\n/**\n * Returns props to create a `MenuItemCheckbox` component.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx\n * const store = useMenuStore({ defaultValues: { apple: false } });\n * const props = useMenuItemCheckbox({ store, name: \"apple\" });\n * <MenuButton store={store}>Fruits</MenuButton>\n * <Menu store={store}>\n * <Role {...props}>Apple</Role>\n * </Menu>\n * ```\n */\nexport const useMenuItemCheckbox = createHook<TagName, MenuItemCheckboxOptions>(\n function useMenuItemCheckbox({\n store,\n name,\n value,\n checked,\n defaultChecked: defaultCheckedProp,\n hideOnClick = false,\n ...props\n }) {\n const context = useMenuScopedContext();\n store = store || context;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"MenuItemCheckbox must be wrapped in a MenuList or Menu component\",\n );\n\n const defaultChecked = useInitialValue(defaultCheckedProp);\n\n // Sets defaultChecked in store\n useEffect(() => {\n store?.setValue(name, (prevValue = []) => {\n if (!defaultChecked) return prevValue;\n return getValue(prevValue, value, true);\n });\n }, [store, name, value, defaultChecked]);\n\n // Sets checked in store\n useEffect(() => {\n if (checked === undefined) return;\n store?.setValue(name, (prevValue) => {\n return getValue(prevValue, value, checked);\n });\n }, [store, name, value, checked]);\n\n const checkboxStore = useCheckboxStore({\n value: useStoreState(store, (state) => state.values[name]),\n setValue(internalValue) {\n store?.setValue(name, () => {\n if (checked === undefined) return internalValue;\n const nextValue = getValue(internalValue, value, checked);\n if (!Array.isArray(nextValue)) return nextValue;\n if (!Array.isArray(internalValue)) return nextValue;\n if (shallowEqual(internalValue, nextValue)) return internalValue;\n return nextValue;\n });\n },\n });\n\n props = {\n role: \"menuitemcheckbox\",\n ...props,\n };\n\n props = useCheckbox<TagName>({\n store: checkboxStore,\n name,\n value,\n checked,\n ...props,\n });\n props = useMenuItem({ store, hideOnClick, ...props });\n\n return props;\n },\n);\n\n/**\n * Renders a [`menuitemcheckbox`](https://w3c.github.io/aria/#menuitemcheckbox)\n * element within a [`Menu`](https://ariakit.com/reference/menu) component. The\n * [`name`](https://ariakit.com/reference/menu-item-checkbox#name) prop must be\n * provided to identify the field in the\n * [`values`](https://ariakit.com/reference/menu-provider#values) state.\n *\n * A [`MenuItemCheck`](https://ariakit.com/reference/menu-item-check) can be\n * used to render a checkmark inside this component.\n * @see https://ariakit.com/components/menu\n * @example\n * The [`name`](https://ariakit.com/reference/menu-item-checkbox#name) prop can\n * refer to a single value in the state:\n * ```jsx {4-7}\n * <MenuProvider defaultValues={{ warnBeforeQuitting: true }}>\n * <MenuButton>Chrome</MenuButton>\n * <Menu>\n * <MenuItemCheckbox name=\"warnBeforeQuitting\">\n * <MenuItemCheck />\n * Warn Before Quitting\n * </MenuItemCheckbox>\n * </Menu>\n * </MenuProvider>\n * ```\n * @example\n * Or it can refer to an array of values, in which case the\n * [`value`](https://ariakit.com/reference/menu-item-checkbox#value) prop must\n * be provided:\n * ```jsx {4-9}\n * <MenuProvider defaultValues={{ watching: [\"issues\"] }}>\n * <MenuButton>Watch</MenuButton>\n * <Menu>\n * <MenuItemCheckbox name=\"watching\" value=\"issues\">\n * Issues\n * </MenuItemCheckbox>\n * <MenuItemCheckbox name=\"watching\" value=\"pull-requests\">\n * Pull Requests\n * </MenuItemCheckbox>\n * </Menu>\n * </MenuProvider>\n * ```\n */\nexport const MenuItemCheckbox = memo(\n forwardRef(function MenuItemCheckbox(props: MenuItemCheckboxProps) {\n const htmlProps = useMenuItemCheckbox(props);\n return createElement(TagName, htmlProps);\n }),\n);\n\nexport interface MenuItemCheckboxOptions<T extends ElementType = TagName>\n extends MenuItemOptions<T>, Omit<CheckboxOptions<T>, \"store\"> {\n /**\n * Object returned by the\n * [`useMenuStore`](https://ariakit.com/reference/use-menu-store) hook. If not\n * provided, the closest [`Menu`](https://ariakit.com/reference/menu) or\n * [`MenuProvider`](https://ariakit.com/reference/menu-provider) components'\n * context will be used.\n */\n store?: MenuStore;\n /**\n * The name of the field in the\n * [`values`](https://ariakit.com/reference/menu-provider#values) state.\n *\n * Live examples:\n * - [MenuItemCheckbox](https://ariakit.com/examples/menu-item-checkbox)\n */\n name: string;\n /**\n * The controlled checked state of the element. It will set the menu\n * [`values`](https://ariakit.com/reference/menu-provider#values) state if\n * provided.\n */\n checked?: boolean;\n /**\n * The default checked state of the element. It will set the default value in\n * the menu [`values`](https://ariakit.com/reference/menu-provider#values)\n * state if provided.\n */\n defaultChecked?: boolean;\n /**\n * @default false\n */\n hideOnClick?: MenuItemOptions<T>[\"hideOnClick\"];\n}\n\nexport type MenuItemCheckboxProps<T extends ElementType = TagName> = Props<\n T,\n MenuItemCheckboxOptions<T>\n>;\n"],"mappings":";;;;;;;;;;AAwBA,MAAA,UAAS;SACH,kBACF,OAAO;CAET,IAAA,MAAO,QAAA,KAAA,GAAA,OAAA,MAAA,SAAA;CACT,OAAA;AAEA;SAKM,SAAU,YAAW,OAAA,SAAA;KACvB,UAAU,KAAQ,GAAA;EAClB,IAAA,MAAS,QAAA,UAAA,GAAA,OAAA;EACX,OAAA,CAAA,CAAA;CACA;CACA,MAAK,iBAAc,kBAAa,KAAA;KAC9B,CAAI,MAAA,QACF,UAAO,GAAA;EAET,IAAA,SAAO,OAAA;EACT,OAAA,eAAA,iBAAA,QAAA;CACA;KACE,SAAI;EAGJ,IAAA,WAAW,SAAY,cAAc,GAAA,OAAA;EACvC,OAAA,CAAA,GAAA,YAAA,cAAA;CACA;CACF,OAAA,WAAA,QAAA,MAAA,MAAA,cAAA;;;;;;;;;;;;;;;MAyBI,sBAAgB,WAAqB,SAAA,oBAAA,EAAA,OAAA,MAAA,OAAA,SAAA,gBAAA,oBAAA,cAAA,OAAA,GAAA,SAAA;CACrC,MAAA,UAAQ,qBAAS;CAEjB,QAAA,SAGI;CAGJ,UAAM,OAAA,kEAAmD;CAGzD,MAAA,iBAAgB,gBAAA,kBAAA;iBACP;SACA,SAAA,OAAgB,YAAO,CAAA,MAAA;GAC5B,IAAA,CAAA,gBAAgB,OAAW;GAC5B,OAAA,SAAA,WAAA,OAAA,IAAA;EACH,CAAA;IAAI;EAAO;EAAM;EAAO;EAAe;CAGvC,CAAA;iBACM;EACJ,IAAA,YAAgB,KAAA,GAAO;SACrB,SAAO,OAAS,cAAkB;GACnC,OAAA,SAAA,WAAA,OAAA,OAAA;EACH,CAAA;IAAI;EAAO;EAAM;EAAO;EAAQ;CAEhC,CAAA;OACE,gBAAqB,iBAAQ;EAC7B,OAAA,cAAS,QAAe,UAAA,MAAA,OAAA,KAAA;WACf,eAAS;UACV,SAAA,YAAuB;IAC3B,IAAA,YAAM,KAAY,GAAA,OAAS;IAC3B,MAAK,YAAM,SAAQ,eAAmB,OAAA,OAAA;IACtC,IAAI,CAAC,MAAM,QAAQ,SAAA,GAAA,OAAgB;IACnC,IAAI,CAAA,MAAA,QAAa,aAAe,GAAA,OAAS;IACzC,IAAA,aAAO,eAAA,SAAA,GAAA,OAAA;IACR,OAAA;GACH,CAAA;EACD;CAED,CAAA;SACQ;EACN,MAAG;EACL,GAAA;CAEA;SACS,YAAA;EACP,OAAA;EACA;EACA;EACA;EACD,GAAA;CACD,CAAA;SAAsB,YAAA;EAAO;EAAa;EAAU,GAAA;CAEpD,CAAA;CAEJ,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+CI,mBAAqB,KAAA,WADH,SAAA,iBACqB,OAAA;CACxC,OACH,cAAA,SAAA,oBAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"menu-item-checkbox.js","names":[],"sources":["../../src/menu/menu-item-checkbox.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport {\n useInitialValue,\n createElement,\n createHook,\n forwardRef,\n memo,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport { invariant, shallowEqual } from \"@ariakit/utils\";\nimport type { ElementType } from \"react\";\nimport { useEffect } from \"react\";\nimport { useCheckboxStore } from \"../checkbox/checkbox-store.ts\";\nimport type { CheckboxOptions } from \"../checkbox/checkbox.tsx\";\nimport { useCheckbox } from \"../checkbox/checkbox.tsx\";\nimport { useMenuScopedContext } from \"./menu-context.tsx\";\nimport type { MenuItemOptions } from \"./menu-item.tsx\";\nimport { useMenuItem } from \"./menu-item.tsx\";\nimport type { MenuStore, MenuStoreValues } from \"./menu-store.ts\";\n\nconst TagName = \"div\" satisfies ElementType;\ntype TagName = typeof TagName;\ntype ValueState = MenuStoreValues[string];\n\nfunction getPrimitiveValue<T>(value: T) {\n if (Array.isArray(value)) {\n return value.toString();\n }\n return value as Exclude<T, readonly any[]>;\n}\n\nfunction getValue(\n storeValue: ValueState,\n value?: MenuItemCheckboxOptions[\"value\"],\n checked?: MenuItemCheckboxOptions[\"checked\"],\n) {\n if (value === undefined) {\n if (Array.isArray(storeValue)) return storeValue;\n return !!checked;\n }\n const primitiveValue = getPrimitiveValue(value);\n if (!Array.isArray(storeValue)) {\n if (checked) {\n return primitiveValue;\n }\n return storeValue === primitiveValue ? false : storeValue;\n }\n if (checked) {\n if (storeValue.includes(primitiveValue)) {\n return storeValue;\n }\n return [...storeValue, primitiveValue];\n }\n return storeValue.filter((v) => v !== primitiveValue);\n}\n\n/**\n * Returns props to create a `MenuItemCheckbox` component.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx\n * const store = useMenuStore({ defaultValues: { apple: false } });\n * const props = useMenuItemCheckbox({ store, name: \"apple\" });\n * <MenuButton store={store}>Fruits</MenuButton>\n * <Menu store={store}>\n * <Role {...props}>Apple</Role>\n * </Menu>\n * ```\n */\nexport const useMenuItemCheckbox = createHook<TagName, MenuItemCheckboxOptions>(\n function useMenuItemCheckbox({\n store,\n name,\n value,\n checked,\n defaultChecked: defaultCheckedProp,\n hideOnClick = false,\n ...props\n }) {\n const context = useMenuScopedContext();\n store = store || context;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"MenuItemCheckbox must be wrapped in a MenuList or Menu component\",\n );\n\n const defaultChecked = useInitialValue(defaultCheckedProp);\n\n // Sets defaultChecked in store\n useEffect(() => {\n store?.setValue(name, (prevValue = []) => {\n if (!defaultChecked) return prevValue;\n return getValue(prevValue, value, true);\n });\n }, [store, name, value, defaultChecked]);\n\n // Sets checked in store\n useEffect(() => {\n if (checked === undefined) return;\n store?.setValue(name, (prevValue) => {\n return getValue(prevValue, value, checked);\n });\n }, [store, name, value, checked]);\n\n const checkboxStore = useCheckboxStore({\n value: useStoreState(store, (state) => state.values[name]),\n setValue(internalValue) {\n store?.setValue(name, () => {\n if (checked === undefined) return internalValue;\n const nextValue = getValue(internalValue, value, checked);\n if (!Array.isArray(nextValue)) return nextValue;\n if (!Array.isArray(internalValue)) return nextValue;\n if (shallowEqual(internalValue, nextValue)) return internalValue;\n return nextValue;\n });\n },\n });\n\n props = {\n role: \"menuitemcheckbox\",\n ...props,\n };\n\n props = useCheckbox<TagName>({\n store: checkboxStore,\n name,\n value,\n checked,\n ...props,\n });\n props = useMenuItem({ store, hideOnClick, ...props });\n\n return props;\n },\n);\n\n/**\n * Renders a [`menuitemcheckbox`](https://w3c.github.io/aria/#menuitemcheckbox)\n * element within a [`Menu`](https://ariakit.com/reference/menu) component. The\n * [`name`](https://ariakit.com/reference/menu-item-checkbox#name) prop must be\n * provided to identify the field in the\n * [`values`](https://ariakit.com/reference/menu-provider#values) state.\n *\n * A [`MenuItemCheck`](https://ariakit.com/reference/menu-item-check) can be\n * used to render a checkmark inside this component.\n * @see https://ariakit.com/components/menu\n * @example\n * The [`name`](https://ariakit.com/reference/menu-item-checkbox#name) prop can\n * refer to a single value in the state:\n * ```jsx {4-7}\n * <MenuProvider defaultValues={{ warnBeforeQuitting: true }}>\n * <MenuButton>Chrome</MenuButton>\n * <Menu>\n * <MenuItemCheckbox name=\"warnBeforeQuitting\">\n * <MenuItemCheck />\n * Warn Before Quitting\n * </MenuItemCheckbox>\n * </Menu>\n * </MenuProvider>\n * ```\n * @example\n * Or it can refer to an array of values, in which case the\n * [`value`](https://ariakit.com/reference/menu-item-checkbox#value) prop must\n * be provided:\n * ```jsx {4-9}\n * <MenuProvider defaultValues={{ watching: [\"issues\"] }}>\n * <MenuButton>Watch</MenuButton>\n * <Menu>\n * <MenuItemCheckbox name=\"watching\" value=\"issues\">\n * Issues\n * </MenuItemCheckbox>\n * <MenuItemCheckbox name=\"watching\" value=\"pull-requests\">\n * Pull Requests\n * </MenuItemCheckbox>\n * </Menu>\n * </MenuProvider>\n * ```\n */\nexport const MenuItemCheckbox = memo(\n forwardRef(function MenuItemCheckbox(props: MenuItemCheckboxProps) {\n const htmlProps = useMenuItemCheckbox(props);\n return createElement(TagName, htmlProps);\n }),\n);\n\nexport interface MenuItemCheckboxOptions<T extends ElementType = TagName>\n extends MenuItemOptions<T>, Omit<CheckboxOptions<T>, \"store\"> {\n /**\n * Object returned by the\n * [`useMenuStore`](https://ariakit.com/reference/use-menu-store) hook. If not\n * provided, the closest [`Menu`](https://ariakit.com/reference/menu) or\n * [`MenuProvider`](https://ariakit.com/reference/menu-provider) components'\n * context will be used.\n */\n store?: MenuStore;\n /**\n * The name of the field in the\n * [`values`](https://ariakit.com/reference/menu-provider#values) state.\n *\n * Live examples:\n * - [MenuItemCheckbox](https://ariakit.com/examples/menu-item-checkbox)\n */\n name: string;\n /**\n * The controlled checked state of the element. It will set the menu\n * [`values`](https://ariakit.com/reference/menu-provider#values) state if\n * provided.\n */\n checked?: boolean;\n /**\n * The default checked state of the element. It will set the default value in\n * the menu [`values`](https://ariakit.com/reference/menu-provider#values)\n * state if provided.\n */\n defaultChecked?: boolean;\n /**\n * @default false\n */\n hideOnClick?: MenuItemOptions<T>[\"hideOnClick\"];\n}\n\nexport type MenuItemCheckboxProps<T extends ElementType = TagName> = Props<\n T,\n MenuItemCheckboxOptions<T>\n>;\n"],"mappings":";;;;;;;;;;AAwBA,MAAA,UAAS;SACH,kBACF,OAAO;CAET,IAAA,MAAO,QAAA,KAAA,GAAA,OAAA,MAAA,SAAA;CACT,OAAA;AAEA;SAKM,SAAU,YAAW,OAAA,SAAA;KACvB,UAAU,KAAQ,GAAA;EAClB,IAAA,MAAS,QAAA,UAAA,GAAA,OAAA;EACX,OAAA,CAAA,CAAA;CACA;CACA,MAAK,iBAAc,kBAAa,KAAA;KAC9B,CAAI,MAAA,QACF,UAAO,GAAA;EAET,IAAA,SAAO,OAAA;EACT,OAAA,eAAA,iBAAA,QAAA;CACA;KACE,SAAI;EAGJ,IAAA,WAAW,SAAY,cAAc,GAAA,OAAA;EACvC,OAAA,CAAA,GAAA,YAAA,cAAA;CACA;CACF,OAAA,WAAA,QAAA,MAAA,MAAA,cAAA;;;;;;;;;;;;;;;MAyBI,sBAAgB,WAAqB,SAAA,oBAAA,EAAA,OAAA,MAAA,OAAA,SAAA,gBAAA,oBAAA,cAAA,OAAA,GAAA,SAAA;CACrC,MAAA,UAAQ,qBAAS;CAEjB,QAAA,SAEE;CAIF,UAAM,OAAA,QAAiB,IAAA,aAAgB,gBAAkB,kEAAA;CAGzD,MAAA,iBAAgB,gBAAA,kBAAA;iBACP;SACA,SAAA,OAAgB,YAAO,CAAA,MAAA;GAC5B,IAAA,CAAA,gBAAgB,OAAW;GAC5B,OAAA,SAAA,WAAA,OAAA,IAAA;EACH,CAAA;IAAI;EAAO;EAAM;EAAO;EAAe;CAGvC,CAAA;iBACM;EACJ,IAAA,YAAgB,KAAA,GAAO;SACrB,SAAO,OAAS,cAAkB;GACnC,OAAA,SAAA,WAAA,OAAA,OAAA;EACH,CAAA;IAAI;EAAO;EAAM;EAAO;EAAQ;CAEhC,CAAA;OACE,gBAAqB,iBAAQ;EAC7B,OAAA,cAAS,QAAe,UAAA,MAAA,OAAA,KAAA;WACf,eAAS;UACV,SAAA,YAAuB;IAC3B,IAAA,YAAM,KAAY,GAAA,OAAS;IAC3B,MAAK,YAAM,SAAQ,eAAmB,OAAA,OAAA;IACtC,IAAI,CAAC,MAAM,QAAQ,SAAA,GAAA,OAAgB;IACnC,IAAI,CAAA,MAAA,QAAa,aAAe,GAAA,OAAS;IACzC,IAAA,aAAO,eAAA,SAAA,GAAA,OAAA;IACR,OAAA;GACH,CAAA;EACD;CAED,CAAA;SACQ;EACN,MAAG;EACL,GAAA;CAEA;SACS,YAAA;EACP,OAAA;EACA;EACA;EACA;EACD,GAAA;CACD,CAAA;SAAsB,YAAA;EAAO;EAAa;EAAU,GAAA;CAEpD,CAAA;CAEJ,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+CI,mBAAqB,KAAA,WADH,SAAA,iBACqB,OAAA;CACxC,OACH,cAAA,SAAA,oBAAA,KAAA,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { RadioOptions } from "../radio/radio.js";
2
- import { t as MenuStore } from "../menu-store-0CKKmNek.js";
2
+ import { t as MenuStore } from "../menu-store-BpTJdcL8.js";
3
3
  import { MenuItemOptions } from "./menu-item.js";
4
4
  import { Props } from "@ariakit/react-utils";
5
5
  import { ElementType } from "react";
@@ -50,7 +50,7 @@ declare const useMenuItemRadio: import("@ariakit/react-utils").Hook<"div", MenuI
50
50
  * </MenuProvider>
51
51
  * ```
52
52
  */
53
- declare const MenuItemRadio: (props: MenuItemRadioProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
53
+ declare const MenuItemRadio: (props: MenuItemRadioProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
54
54
  interface MenuItemRadioOptions<T extends ElementType = TagName> extends MenuItemOptions<T>, Omit<RadioOptions<T>, "store"> {
55
55
  /**
56
56
  * Object returned by the
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item-radio.d.ts","names":["Props","ElementType","RadioOptions","MenuItemOptions","MenuStore","TagName","useMenuItemRadio","MenuItemRadioOptions","Hook","MenuItemRadio","MenuItemRadioProps","props","ReactElement","JSXElementConstructor","T","Omit","store","name","checked","defaultChecked","hideOnClick"],"sources":["../../src/menu/menu-item-radio.d.ts"],"mappings":";;;;;;;cAKcK,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAgB7B;;;;AAAsG;AAlBrD,cAkB5BC,gBAAAA,iCAAiDE,IAAAA,QAAYD,oBAAoB;;;;;;;;;AA4B6C;AACnJ;;;;;;;;;;;;;;;;;;cADqBE,aAAAA,GAAgBE,KAAAA,EAAOD,kBAAkB,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UAC7GN,oBAAAA,WAA+BN,WAAAA,GAAcI,OAAAA,UAAiBF,eAAAA,CAAgBW,CAAAA,GAAIC,IAAAA,CAAKb,YAAAA,CAAaY,CAAAA;EAAlBC;;;;;;;EAQ/FC,KAAAA,GAAQZ,SAAAA;EAwBRgB;;;;AAA+B;AAEnC;;EAlBIH,IAAAA;EAkBqChB;;;;;EAZrCiB,OAAAA;EAYmE;;;;;EANnEC,cAAAA;EAMoEL;;;EAFpEM,WAAAA,GAAcjB,eAAAA,CAAgBW,CAAAA;AAAAA;AAAAA,KAEtBJ,kBAAAA,WAA6BT,WAAAA,GAAcI,OAAAA,IAAWL,KAAAA,CAAMc,CAAAA,EAAGP,oBAAAA,CAAqBO,CAAAA"}
1
+ {"version":3,"file":"menu-item-radio.d.ts","names":["Props","ElementType","RadioOptions","MenuItemOptions","MenuStore","TagName","useMenuItemRadio","MenuItemRadioOptions","Hook","MenuItemRadio","MenuItemRadioProps","props","ReactElement","JSXElementConstructor","T","Omit","store","name","checked","defaultChecked","hideOnClick"],"sources":["../../src/menu/menu-item-radio.d.ts"],"mappings":";;;;;;;cAKcK,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAgB7B;;;;AAAsG;AAlBrD,cAkB5BC,gBAAAA,iCAAiDE,IAAAA,QAAYD,oBAAoB;;;;;;;;;AA4BiD;AACvJ;;;;;;;;;;;;;;;;;;cADqBE,aAAAA,GAAgBE,KAAAA,EAAOD,kBAAkB,qBAAqBE,YAAAA,mCAA+CC,qBAAAA;AAAAA,UACjHN,oBAAAA,WAA+BN,WAAAA,GAAcI,OAAAA,UAAiBF,eAAAA,CAAgBW,CAAAA,GAAIC,IAAAA,CAAKb,YAAAA,CAAaY,CAAAA;EAAlBC;;;;;;;EAQ/FC,KAAAA,GAAQZ,SAAAA;EAwBRgB;;;;AAA+B;AAEnC;;EAlBIH,IAAAA;EAkBqChB;;;;;EAZrCiB,OAAAA;EAYmE;;;;;EANnEC,cAAAA;EAMoEL;;;EAFpEM,WAAAA,GAAcjB,eAAAA,CAAgBW,CAAAA;AAAAA;AAAAA,KAEtBJ,kBAAAA,WAA6BT,WAAAA,GAAcI,OAAAA,IAAWL,KAAAA,CAAMc,CAAAA,EAAGP,oBAAAA,CAAqBO,CAAAA"}
@@ -32,7 +32,7 @@ function getValue(prevValue, value, checked) {
32
32
  const useMenuItemRadio = createHook(function useMenuItemRadio({ store, name, value, checked, onChange: onChangeProp, hideOnClick = false, ...props }) {
33
33
  const context = useMenuScopedContext();
34
34
  store = store || context;
35
- invariant(store, "MenuItemRadio must be wrapped in a MenuList or Menu component");
35
+ invariant(store, process.env.NODE_ENV !== "production" && "MenuItemRadio must be wrapped in a MenuList or Menu component");
36
36
  const defaultChecked = useInitialValue(props.defaultChecked);
37
37
  useEffect(() => {
38
38
  store?.setValue(name, (prevValue = false) => {
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item-radio.js","names":[],"sources":["../../src/menu/menu-item-radio.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport {\n useInitialValue,\n useWrapElement,\n createElement,\n createHook,\n forwardRef,\n memo,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport { invariant } from \"@ariakit/utils\";\nimport type { ElementType } from \"react\";\nimport { useEffect } from \"react\";\nimport type { RadioOptions } from \"../radio/radio.tsx\";\nimport { useRadio } from \"../radio/radio.tsx\";\nimport {\n MenuItemCheckedContext,\n useMenuScopedContext,\n} from \"./menu-context.tsx\";\nimport type { MenuItemOptions } from \"./menu-item.tsx\";\nimport { useMenuItem } from \"./menu-item.tsx\";\nimport type { MenuStore } from \"./menu-store.ts\";\n\nconst TagName = \"div\" satisfies ElementType;\ntype TagName = typeof TagName;\n\nfunction getValue<T>(prevValue: T, value: T, checked?: boolean): T | false {\n if (checked === undefined) return prevValue;\n if (checked) return value;\n return prevValue === value ? false : prevValue;\n}\n\n/**\n * Returns props to create a `MenuItemRadio` component.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx\n * const store = useMenuStore({ defaultValues: { fruit: \"apple\" } });\n * const apple = useMenuItemRadio({ store, name: \"fruit\", value: \"apple\" });\n * const orange = useMenuItemRadio({ store, name: \"fruit\", value: \"orange\" });\n * <MenuButton store={store}>Fruit</MenuButton>\n * <Menu store={store}>\n * <Role {...apple}>Apple</Role>\n * <Role {...orange}>Orange</Role>\n * </Menu>\n * ```\n */\nexport const useMenuItemRadio = createHook<TagName, MenuItemRadioOptions>(\n function useMenuItemRadio({\n store,\n name,\n value,\n checked,\n onChange: onChangeProp,\n hideOnClick = false,\n ...props\n }) {\n const context = useMenuScopedContext();\n store = store || context;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"MenuItemRadio must be wrapped in a MenuList or Menu component\",\n );\n\n const defaultChecked = useInitialValue(props.defaultChecked);\n\n // Sets defaultChecked in store\n useEffect(() => {\n store?.setValue(name, (prevValue = false) => {\n return getValue(prevValue, value, defaultChecked);\n });\n }, [store, name, value, defaultChecked]);\n\n // Sets checked in store\n useEffect(() => {\n if (checked === undefined) return;\n store?.setValue(name, (prevValue) => {\n return getValue(prevValue, value, checked);\n });\n }, [store, name, value, checked]);\n\n const isChecked = useStoreState(\n store,\n (state) => state.values[name] === value,\n );\n\n props = useWrapElement(\n props,\n (element) => (\n <MenuItemCheckedContext.Provider value={isChecked}>\n {element}\n </MenuItemCheckedContext.Provider>\n ),\n [isChecked],\n );\n\n props = {\n role: \"menuitemradio\",\n ...props,\n };\n\n props = useRadio<TagName>({\n name,\n value,\n checked: isChecked,\n onChange(event) {\n onChangeProp?.(event);\n if (event.defaultPrevented) return;\n const element = event.currentTarget;\n store?.setValue(name, (prevValue) => {\n return getValue(prevValue, value, checked ?? element.checked);\n });\n },\n ...props,\n });\n\n props = useMenuItem({ store, hideOnClick, ...props });\n\n return props;\n },\n);\n\n/**\n * Renders a [`menuitemradio`](https://w3c.github.io/aria/#menuitemradio)\n * element within a [`Menu`](https://ariakit.com/reference/menu) component. The\n * [`name`](https://ariakit.com/reference/menu-item-radio#name) prop must be\n * provided to identify the field in the\n * [`values`](https://ariakit.com/reference/menu-provider#values) state.\n *\n * A [`MenuItemCheck`](https://ariakit.com/reference/menu-item-check) can be\n * used to render a checkmark inside this component.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx {4-11}\n * <MenuProvider defaultValues={{ profile: \"john\" }}>\n * <MenuButton>Profiles</MenuButton>\n * <Menu>\n * <MenuItemRadio name=\"profile\" value=\"john\">\n * <MenuItemCheck />\n * John Doe\n * </MenuItemRadio>\n * <MenuItemRadio name=\"profile\" value=\"jane\">\n * <MenuItemCheck />\n * Jane Doe\n * </MenuItemRadio>\n * </Menu>\n * </MenuProvider>\n * ```\n */\nexport const MenuItemRadio = memo(\n forwardRef(function MenuItemRadio(props: MenuItemRadioProps) {\n const htmlProps = useMenuItemRadio(props);\n return createElement(TagName, htmlProps);\n }),\n);\n\nexport interface MenuItemRadioOptions<T extends ElementType = TagName>\n extends MenuItemOptions<T>, Omit<RadioOptions<T>, \"store\"> {\n /**\n * Object returned by the\n * [`useMenuStore`](https://ariakit.com/reference/use-menu-store) hook. If not\n * provided, the closest [`Menu`](https://ariakit.com/reference/menu) or\n * [`MenuProvider`](https://ariakit.com/reference/menu-provider) components'\n * context will be used.\n */\n store?: MenuStore;\n /**\n * The name of the field in the\n * [`values`](https://ariakit.com/reference/menu-provider#values) state.\n *\n * Live examples:\n * - [MenuItemRadio](https://ariakit.com/examples/menu-item-radio)\n */\n name: string;\n /**\n * The controlled checked state of the element. It will set the menu\n * [`values`](https://ariakit.com/reference/menu-provider#values) state if\n * provided.\n */\n checked?: boolean;\n /**\n * The default checked state of the element. It will set the default value in\n * the menu [`values`](https://ariakit.com/reference/menu-provider#values)\n * state if provided.\n */\n defaultChecked?: boolean;\n /**\n * @default false\n */\n hideOnClick?: MenuItemOptions<T>[\"hideOnClick\"];\n}\n\nexport type MenuItemRadioProps<T extends ElementType = TagName> = Props<\n T,\n MenuItemRadioOptions<T>\n>;\n"],"mappings":";;;;;;;;;;AA0BA,MAAA,UAAS;SACH,SAAY,WAAW,OAAO,SAAA;CAClC,IAAI,YAAS,KAAO,GAAA,OAAA;CACpB,IAAA,SAAO,OAAA;CACT,OAAA,cAAA,QAAA,QAAA;;;;;;;;;;;;;;;;;MA2BI,mBAAgB,WAAA,SAAqB,iBAAA,EAAA,OAAA,MAAA,OAAA,SAAA,UAAA,cAAA,cAAA,OAAA,GAAA,SAAA;CACrC,MAAA,UAAQ,qBAAS;CAEjB,QAAA,SAGI;CAGJ,UAAM,OAAA,+DAAqD;CAG3D,MAAA,iBAAgB,gBAAA,MAAA,cAAA;iBACP;SACL,SAAO,OAAS,YAAkB,UAAA;GACnC,OAAA,SAAA,WAAA,OAAA,cAAA;EACH,CAAA;IAAI;EAAO;EAAM;EAAO;EAAe;CAGvC,CAAA;iBACM;EACJ,IAAA,YAAgB,KAAA,GAAO;SACrB,SAAO,OAAS,cAAkB;GACnC,OAAA,SAAA,WAAA,OAAA,OAAA;EACH,CAAA;IAAI;EAAO;EAAM;EAAO;EAAQ;CAEhC,CAAA;CAKA,MAAA,YAAQ,cAEL,QAAA,UACC,MAAA,OAAC,UAAA,KAAA;SAAuC,eAAA,QAAA,YAAA,oBAAA,uBAAA,UAAA;;EAEP,UAElC;CAGH,CAAA,GAAA,CAAA,SAAQ,CAAA;SACA;EACN,MAAG;EACL,GAAA;CAEA;SACE,SAAA;EACA;EACA;EACA,SAAS;WACP,OAAe;GACf,eAAU,KAAA;GACV,IAAA,MAAM,kBAAgB;GACtB,MAAA,UAAgB,MAAA;UACd,SAAO,OAAS,cAAkB;IACnC,OAAA,SAAA,WAAA,OAAA,WAAA,QAAA,OAAA;GACH,CAAA;EACA;EACD,GAAA;CAED,CAAA;SAAsB,YAAA;EAAO;EAAa;EAAU,GAAA;CAEpD,CAAA;CAEJ,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCI,gBAAqB,KAAA,WADH,SAAA,cACqB,OAAA;CACxC,OACH,cAAA,SAAA,iBAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"menu-item-radio.js","names":[],"sources":["../../src/menu/menu-item-radio.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport {\n useInitialValue,\n useWrapElement,\n createElement,\n createHook,\n forwardRef,\n memo,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport { invariant } from \"@ariakit/utils\";\nimport type { ElementType } from \"react\";\nimport { useEffect } from \"react\";\nimport type { RadioOptions } from \"../radio/radio.tsx\";\nimport { useRadio } from \"../radio/radio.tsx\";\nimport {\n MenuItemCheckedContext,\n useMenuScopedContext,\n} from \"./menu-context.tsx\";\nimport type { MenuItemOptions } from \"./menu-item.tsx\";\nimport { useMenuItem } from \"./menu-item.tsx\";\nimport type { MenuStore } from \"./menu-store.ts\";\n\nconst TagName = \"div\" satisfies ElementType;\ntype TagName = typeof TagName;\n\nfunction getValue<T>(prevValue: T, value: T, checked?: boolean): T | false {\n if (checked === undefined) return prevValue;\n if (checked) return value;\n return prevValue === value ? false : prevValue;\n}\n\n/**\n * Returns props to create a `MenuItemRadio` component.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx\n * const store = useMenuStore({ defaultValues: { fruit: \"apple\" } });\n * const apple = useMenuItemRadio({ store, name: \"fruit\", value: \"apple\" });\n * const orange = useMenuItemRadio({ store, name: \"fruit\", value: \"orange\" });\n * <MenuButton store={store}>Fruit</MenuButton>\n * <Menu store={store}>\n * <Role {...apple}>Apple</Role>\n * <Role {...orange}>Orange</Role>\n * </Menu>\n * ```\n */\nexport const useMenuItemRadio = createHook<TagName, MenuItemRadioOptions>(\n function useMenuItemRadio({\n store,\n name,\n value,\n checked,\n onChange: onChangeProp,\n hideOnClick = false,\n ...props\n }) {\n const context = useMenuScopedContext();\n store = store || context;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"MenuItemRadio must be wrapped in a MenuList or Menu component\",\n );\n\n const defaultChecked = useInitialValue(props.defaultChecked);\n\n // Sets defaultChecked in store\n useEffect(() => {\n store?.setValue(name, (prevValue = false) => {\n return getValue(prevValue, value, defaultChecked);\n });\n }, [store, name, value, defaultChecked]);\n\n // Sets checked in store\n useEffect(() => {\n if (checked === undefined) return;\n store?.setValue(name, (prevValue) => {\n return getValue(prevValue, value, checked);\n });\n }, [store, name, value, checked]);\n\n const isChecked = useStoreState(\n store,\n (state) => state.values[name] === value,\n );\n\n props = useWrapElement(\n props,\n (element) => (\n <MenuItemCheckedContext.Provider value={isChecked}>\n {element}\n </MenuItemCheckedContext.Provider>\n ),\n [isChecked],\n );\n\n props = {\n role: \"menuitemradio\",\n ...props,\n };\n\n props = useRadio<TagName>({\n name,\n value,\n checked: isChecked,\n onChange(event) {\n onChangeProp?.(event);\n if (event.defaultPrevented) return;\n const element = event.currentTarget;\n store?.setValue(name, (prevValue) => {\n return getValue(prevValue, value, checked ?? element.checked);\n });\n },\n ...props,\n });\n\n props = useMenuItem({ store, hideOnClick, ...props });\n\n return props;\n },\n);\n\n/**\n * Renders a [`menuitemradio`](https://w3c.github.io/aria/#menuitemradio)\n * element within a [`Menu`](https://ariakit.com/reference/menu) component. The\n * [`name`](https://ariakit.com/reference/menu-item-radio#name) prop must be\n * provided to identify the field in the\n * [`values`](https://ariakit.com/reference/menu-provider#values) state.\n *\n * A [`MenuItemCheck`](https://ariakit.com/reference/menu-item-check) can be\n * used to render a checkmark inside this component.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx {4-11}\n * <MenuProvider defaultValues={{ profile: \"john\" }}>\n * <MenuButton>Profiles</MenuButton>\n * <Menu>\n * <MenuItemRadio name=\"profile\" value=\"john\">\n * <MenuItemCheck />\n * John Doe\n * </MenuItemRadio>\n * <MenuItemRadio name=\"profile\" value=\"jane\">\n * <MenuItemCheck />\n * Jane Doe\n * </MenuItemRadio>\n * </Menu>\n * </MenuProvider>\n * ```\n */\nexport const MenuItemRadio = memo(\n forwardRef(function MenuItemRadio(props: MenuItemRadioProps) {\n const htmlProps = useMenuItemRadio(props);\n return createElement(TagName, htmlProps);\n }),\n);\n\nexport interface MenuItemRadioOptions<T extends ElementType = TagName>\n extends MenuItemOptions<T>, Omit<RadioOptions<T>, \"store\"> {\n /**\n * Object returned by the\n * [`useMenuStore`](https://ariakit.com/reference/use-menu-store) hook. If not\n * provided, the closest [`Menu`](https://ariakit.com/reference/menu) or\n * [`MenuProvider`](https://ariakit.com/reference/menu-provider) components'\n * context will be used.\n */\n store?: MenuStore;\n /**\n * The name of the field in the\n * [`values`](https://ariakit.com/reference/menu-provider#values) state.\n *\n * Live examples:\n * - [MenuItemRadio](https://ariakit.com/examples/menu-item-radio)\n */\n name: string;\n /**\n * The controlled checked state of the element. It will set the menu\n * [`values`](https://ariakit.com/reference/menu-provider#values) state if\n * provided.\n */\n checked?: boolean;\n /**\n * The default checked state of the element. It will set the default value in\n * the menu [`values`](https://ariakit.com/reference/menu-provider#values)\n * state if provided.\n */\n defaultChecked?: boolean;\n /**\n * @default false\n */\n hideOnClick?: MenuItemOptions<T>[\"hideOnClick\"];\n}\n\nexport type MenuItemRadioProps<T extends ElementType = TagName> = Props<\n T,\n MenuItemRadioOptions<T>\n>;\n"],"mappings":";;;;;;;;;;AA0BA,MAAA,UAAS;SACH,SAAY,WAAW,OAAO,SAAA;CAClC,IAAI,YAAS,KAAO,GAAA,OAAA;CACpB,IAAA,SAAO,OAAA;CACT,OAAA,cAAA,QAAA,QAAA;;;;;;;;;;;;;;;;;MA2BI,mBAAgB,WAAA,SAAqB,iBAAA,EAAA,OAAA,MAAA,OAAA,SAAA,UAAA,cAAA,cAAA,OAAA,GAAA,SAAA;CACrC,MAAA,UAAQ,qBAAS;CAEjB,QAAA,SAEE;CAIF,UAAM,OAAA,QAAiB,IAAA,aAAgB,gBAAM,+DAAc;CAG3D,MAAA,iBAAgB,gBAAA,MAAA,cAAA;iBACP;SACL,SAAO,OAAS,YAAkB,UAAA;GACnC,OAAA,SAAA,WAAA,OAAA,cAAA;EACH,CAAA;IAAI;EAAO;EAAM;EAAO;EAAe;CAGvC,CAAA;iBACM;EACJ,IAAA,YAAgB,KAAA,GAAO;SACrB,SAAO,OAAS,cAAkB;GACnC,OAAA,SAAA,WAAA,OAAA,OAAA;EACH,CAAA;IAAI;EAAO;EAAM;EAAO;EAAQ;CAEhC,CAAA;CAKA,MAAA,YAAQ,cAEL,QAAA,UACC,MAAA,OAAC,UAAA,KAAA;SAAuC,eAAA,QAAA,YAAA,oBAAA,uBAAA,UAAA;;EAEP,UAElC;CAGH,CAAA,GAAA,CAAA,SAAQ,CAAA;SACA;EACN,MAAG;EACL,GAAA;CAEA;SACE,SAAA;EACA;EACA;EACA,SAAS;WACP,OAAe;GACf,eAAU,KAAA;GACV,IAAA,MAAM,kBAAgB;GACtB,MAAA,UAAgB,MAAA;UACd,SAAO,OAAS,cAAkB;IACnC,OAAA,SAAA,WAAA,OAAA,WAAA,QAAA,OAAA;GACH,CAAA;EACA;EACD,GAAA;CAED,CAAA;SAAsB,YAAA;EAAO;EAAa;EAAU,GAAA;CAEpD,CAAA;CAEJ,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCI,gBAAqB,KAAA,WADH,SAAA,cACqB,OAAA;CACxC,OACH,cAAA,SAAA,iBAAA,KAAA,CAAA"}
@@ -1,7 +1,7 @@
1
- import { n as CompositeItemOptions } from "../composite-item-B4WTelVz.js";
2
- import { n as CompositeHoverOptions } from "../composite-hover-C7ul163w.js";
3
- import { t as MenubarStore } from "../menubar-store-3h0eNIbS.js";
4
- import { t as MenuStore } from "../menu-store-0CKKmNek.js";
1
+ import { n as CompositeItemOptions } from "../composite-item-d4UXaZ84.js";
2
+ import { n as CompositeHoverOptions } from "../composite-hover-BpXq3T8J.js";
3
+ import { t as MenubarStore } from "../menubar-store-C553OKBw.js";
4
+ import { t as MenuStore } from "../menu-store-BpTJdcL8.js";
5
5
  import { Props } from "@ariakit/react-utils";
6
6
  import { ElementType, MouseEvent } from "react";
7
7
  import { BooleanOrCallback } from "@ariakit/utils";
@@ -42,7 +42,7 @@ declare const useMenuItem: import("@ariakit/react-utils").Hook<"div", MenuItemOp
42
42
  * </MenuProvider>
43
43
  * ```
44
44
  */
45
- declare const MenuItem: (props: MenuItemProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
45
+ declare const MenuItem: (props: MenuItemProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
46
46
  interface MenuItemOptions<T extends ElementType = TagName> extends CompositeItemOptions<T>, CompositeHoverOptions<T> {
47
47
  /**
48
48
  * Object returned by the
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item.d.ts","names":["Props","BooleanOrCallback","ElementType","MouseEvent","CompositeHoverOptions","CompositeItemOptions","MenubarStore","MenuStore","TagName","useMenuItem","MenuItemOptions","Hook","MenuItem","MenuItemProps","props","ReactElement","JSXElementConstructor","T","HTMLElement","store","hideOnClick"],"sources":["../../src/menu/menu-item.d.ts"],"mappings":";;;;;;;;;cAOcQ,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAgB7B;;;;AAA4F;AAlB3C,cAkB5BC,WAAAA,iCAA4CE,IAAAA,QAAYD,eAAe;;;;;;;;;AAkB6C;AACzI;;;;;;;;cADqBE,QAAAA,GAAWE,KAAAA,EAAOD,aAAa,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UACnGN,eAAAA,WAA0BR,WAAAA,GAAcM,OAAAA,UAAiBH,oBAAAA,CAAqBY,CAAAA,GAAIb,qBAAAA,CAAsBa,CAAAA;EAwBrFd;;;;;;;;;;;EAZhCgB,KAAAA,GAAQb,YAAAA,GAAeC,SAAAA;EAZ8FU;;;;;;;;;AAwB/D;AAE1D;EAFIG,WAAAA,GAAcnB,iBAAAA,CAAkBE,UAAAA,CAAWe,WAAAA;AAAAA;AAAAA,KAEnCL,aAAAA,WAAwBX,WAAAA,GAAcM,OAAAA,IAAWR,KAAAA,CAAMiB,CAAAA,EAAGP,eAAAA,CAAgBO,CAAAA"}
1
+ {"version":3,"file":"menu-item.d.ts","names":["Props","BooleanOrCallback","ElementType","MouseEvent","CompositeHoverOptions","CompositeItemOptions","MenubarStore","MenuStore","TagName","useMenuItem","MenuItemOptions","Hook","MenuItem","MenuItemProps","props","ReactElement","JSXElementConstructor","T","HTMLElement","store","hideOnClick"],"sources":["../../src/menu/menu-item.d.ts"],"mappings":";;;;;;;;;cAOcQ,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAgB7B;;;;AAA4F;AAlB3C,cAkB5BC,WAAAA,iCAA4CE,IAAAA,QAAYD,eAAe;;;;;;;;;AAkBiD;AAC7I;;;;;;;;cADqBE,QAAAA,GAAWE,KAAAA,EAAOD,aAAa,qBAAqBE,YAAAA,mCAA+CC,qBAAAA;AAAAA,UACvGN,eAAAA,WAA0BR,WAAAA,GAAcM,OAAAA,UAAiBH,oBAAAA,CAAqBY,CAAAA,GAAIb,qBAAAA,CAAsBa,CAAAA;EAwBrFd;;;;;;;;;;;EAZhCgB,KAAAA,GAAQb,YAAAA,GAAeC,SAAAA;EAZ8FU;;;;;;;;;AAwB/D;AAE1D;EAFIG,WAAAA,GAAcnB,iBAAAA,CAAkBE,UAAAA,CAAWe,WAAAA;AAAAA;AAAAA,KAEnCL,aAAAA,WAAwBX,WAAAA,GAAcM,OAAAA,IAAWR,KAAAA,CAAMiB,CAAAA,EAAGP,eAAAA,CAAgBO,CAAAA"}
@@ -2,9 +2,10 @@
2
2
  import { useCompositeItem } from "../composite/composite-item.js";
3
3
  import { useCompositeHover } from "../composite/composite-hover.js";
4
4
  import { useMenubarScopedContext } from "../menubar/menubar-context.js";
5
- import { useMenuScopedContext } from "./menu-context.js";
5
+ import { MenuListHiddenContext, useMenuScopedContext } from "./menu-context.js";
6
6
  import { createElement, createHook, forwardRef, memo, useBooleanEvent, useEvent } from "@ariakit/react-utils";
7
7
  import { getDocument, getPopupItemRole, hasFocusWithin, invariant, isDownloading, isOpeningInNewTab } from "@ariakit/utils";
8
+ import { useContext } from "react";
8
9
  import { useStoreState } from "@ariakit/react-store";
9
10
  //#region src/menu/menu-item.tsx
10
11
  const TagName = "div";
@@ -40,7 +41,7 @@ const useMenuItem = createHook(function useMenuItem({ store, hideOnClick = true,
40
41
  const menuContext = useMenuScopedContext(true);
41
42
  const menubarContext = useMenubarScopedContext();
42
43
  store = store || menuContext || menubarContext;
43
- invariant(store, "MenuItem must be wrapped in a MenuList, Menu or Menubar component");
44
+ invariant(store, process.env.NODE_ENV !== "production" && "MenuItem must be wrapped in a MenuList, Menu or Menubar component");
44
45
  const onClickProp = props.onClick;
45
46
  const hideOnClickProp = useBooleanEvent(hideOnClick);
46
47
  const hideMenu = "hideAll" in store ? store.hideAll : void 0;
@@ -56,15 +57,18 @@ const useMenuItem = createHook(function useMenuItem({ store, hideOnClick = true,
56
57
  if (!hideOnClickProp(event)) return;
57
58
  hideMenu();
58
59
  });
60
+ const contentElement = useStoreState(store, (state) => "contentElement" in state ? state.contentElement : null);
61
+ const menuListHidden = useContext(MenuListHiddenContext);
59
62
  props = {
60
- role: getPopupItemRole(useStoreState(store, (state) => "contentElement" in state ? state.contentElement : null), "menuitem"),
63
+ role: getPopupItemRole(contentElement, "menuitem"),
61
64
  ...props,
62
65
  onClick
63
66
  };
64
67
  props = useCompositeItem({
65
68
  store,
66
69
  preventScrollOnKeyDown,
67
- ...props
70
+ ...props,
71
+ shouldRegisterItem: menuListHidden ? false : props.shouldRegisterItem
68
72
  });
69
73
  props = useCompositeHover({
70
74
  store,
@@ -1 +1 @@
1
- {"version":3,"file":"menu-item.js","names":[],"sources":["../../src/menu/menu-item.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport {\n useBooleanEvent,\n useEvent,\n createElement,\n createHook,\n forwardRef,\n memo,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport {\n getDocument,\n getPopupItemRole,\n isDownloading,\n isOpeningInNewTab,\n hasFocusWithin,\n invariant,\n} from \"@ariakit/utils\";\nimport type { BooleanOrCallback } from \"@ariakit/utils\";\nimport type { ElementType, MouseEvent } from \"react\";\nimport type { CompositeHoverOptions } from \"../composite/composite-hover.tsx\";\nimport { useCompositeHover } from \"../composite/composite-hover.tsx\";\nimport type { CompositeItemOptions } from \"../composite/composite-item.tsx\";\nimport { useCompositeItem } from \"../composite/composite-item.tsx\";\nimport { useMenubarScopedContext } from \"../menubar/menubar-context.tsx\";\nimport type { MenubarStore } from \"../menubar/menubar-store.ts\";\nimport { useMenuScopedContext } from \"./menu-context.tsx\";\nimport type { MenuStore, MenuStoreState } from \"./menu-store.ts\";\n\nconst TagName = \"div\" satisfies ElementType;\ntype TagName = typeof TagName;\ntype HTMLType = HTMLElementTagNameMap[TagName];\n\nfunction menuHasFocus(\n baseElement?: MenuStoreState[\"baseElement\"],\n items?: MenuStoreState[\"items\"],\n currentTarget?: Element,\n) {\n if (!baseElement) return false;\n if (hasFocusWithin(baseElement)) return true;\n const expandedItem = items?.find((item) => {\n if (item.element === currentTarget) return false;\n return item.element?.getAttribute(\"aria-expanded\") === \"true\";\n });\n const expandedMenuId = expandedItem?.element?.getAttribute(\"aria-controls\");\n if (!expandedMenuId) return false;\n const doc = getDocument(baseElement);\n const expandedMenu = doc.getElementById(expandedMenuId);\n if (!expandedMenu) return false;\n if (hasFocusWithin(expandedMenu)) return true;\n return !!expandedMenu.querySelector(\"[role=menuitem][aria-expanded=true]\");\n}\n\n/**\n * Returns props to create a `MenuItem` component.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx\n * const store = useMenuStore();\n * const undo = useMenuItem({ store });\n * const redo = useMenuItem({ store });\n * <MenuButton store={store}>Edit</MenuButton>\n * <Menu store={store}>\n * <Role {...undo}>Undo</Role>\n * <Role {...redo}>Redo</Role>\n * </Menu>\n * ```\n */\nexport const useMenuItem = createHook<TagName, MenuItemOptions>(\n function useMenuItem({\n store,\n hideOnClick = true,\n preventScrollOnKeyDown = true,\n focusOnHover,\n blurOnHoverEnd,\n ...props\n }) {\n const menuContext = useMenuScopedContext(true);\n const menubarContext = useMenubarScopedContext();\n store = store || menuContext || (menubarContext as any);\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"MenuItem must be wrapped in a MenuList, Menu or Menubar component\",\n );\n\n const onClickProp = props.onClick;\n const hideOnClickProp = useBooleanEvent(hideOnClick);\n const hideMenu = \"hideAll\" in store ? store.hideAll : undefined;\n const isWithinMenu = !!hideMenu;\n\n const onClick = useEvent((event: MouseEvent<HTMLType>) => {\n onClickProp?.(event);\n if (event.defaultPrevented) return;\n if (isDownloading(event)) return;\n if (isOpeningInNewTab(event)) return;\n if (!hideMenu) return;\n // If this item is also a submenu button or any other disclosure, we\n // don't want to hide the menu.\n const popupType = event.currentTarget.getAttribute(\"aria-haspopup\");\n if (popupType && popupType !== \"false\") return;\n if (!hideOnClickProp(event)) return;\n hideMenu();\n });\n\n const contentElement = useStoreState(store, (state) =>\n \"contentElement\" in state ? state.contentElement : null,\n );\n\n const role = getPopupItemRole(contentElement, \"menuitem\");\n\n props = {\n role,\n ...props,\n onClick,\n };\n\n props = useCompositeItem<TagName>({\n store,\n preventScrollOnKeyDown,\n ...props,\n });\n\n props = useCompositeHover({\n store,\n ...props,\n focusOnHover(event) {\n const getFocusOnHover = () => {\n if (typeof focusOnHover === \"function\") return focusOnHover(event);\n if (focusOnHover != null) return focusOnHover;\n return true;\n };\n if (!store) return false;\n if (!getFocusOnHover()) return false;\n const { baseElement, items } = store.getState();\n // If the menu item is also a submenu button, we should move actual DOM\n // focus to it so that the submenu will not close when the user moves\n // the cursor back to the menu button.\n if (isWithinMenu) {\n if (event.currentTarget.hasAttribute(\"aria-expanded\")) {\n event.currentTarget.focus();\n }\n return true;\n }\n // If the menu item is inside a menu bar, we should move DOM focus to\n // the menu item if focus is somewhere on the widget. Without this, the\n // open menus in the menu bar wouldn't close.\n if (menuHasFocus(baseElement, items, event.currentTarget)) {\n event.currentTarget.focus();\n return true;\n }\n return false;\n },\n blurOnHoverEnd(event) {\n if (typeof blurOnHoverEnd === \"function\") return blurOnHoverEnd(event);\n if (blurOnHoverEnd != null) return blurOnHoverEnd;\n // The menu container should be focused on mouseleave only if the menu\n // item is inside a menu, not a menu bar.\n return isWithinMenu;\n },\n });\n\n return props;\n },\n);\n\n/**\n * Renders a menu item inside\n * [`MenuList`](https://ariakit.com/reference/menu-list) or\n * [`Menu`](https://ariakit.com/reference/menu)\n * components.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx {4-5}\n * <MenuProvider>\n * <MenuButton>Edit</MenuButton>\n * <Menu>\n * <MenuItem>Undo</MenuItem>\n * <MenuItem>Redo</MenuItem>\n * </Menu>\n * </MenuProvider>\n * ```\n */\nexport const MenuItem = memo(\n forwardRef(function MenuItem(props: MenuItemProps) {\n const htmlProps = useMenuItem(props);\n return createElement(TagName, htmlProps);\n }),\n);\n\nexport interface MenuItemOptions<T extends ElementType = TagName>\n extends CompositeItemOptions<T>, CompositeHoverOptions<T> {\n /**\n * Object returned by the\n * [`useMenuStore`](https://ariakit.com/reference/use-menu-store) or\n * [`useMenubarStore`](https://ariakit.com/reference/use-menubar-store)\n * hooks. If not provided, the closest\n * [`Menu`](https://ariakit.com/reference/menu),\n * [`MenuProvider`](https://ariakit.com/reference/menu-provider),\n * [`Menubar`](https://ariakit.com/reference/menubar), or\n * [`MenubarProvider`](https://ariakit.com/reference/menubar-provider)\n * components' context will be used.\n */\n store?: MenubarStore | MenuStore;\n /**\n * Determines if the menu should hide when this item is clicked.\n *\n * **Note**: This behavior isn't triggered if this menu item is rendered as a\n * link and modifier keys are used to either open the link in a new tab or\n * download it.\n *\n * Live examples:\n * - [Sliding Menu](https://ariakit.com/examples/menu-slide)\n * @default true\n */\n hideOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;\n}\n\nexport type MenuItemProps<T extends ElementType = TagName> = Props<\n T,\n MenuItemOptions<T>\n>;\n"],"mappings":";;;;;;;;;AAiCA,MAAA,UAAS;SAKF,aAAa,aAAO,OAAA,eAAA;CACzB,IAAI,CAAA,aAAA,OAAe;CAKnB,IAAA,eAAM,WAJe,GAAO,OAAM;OAC5B,kBAAiB,OAAA,MAAe,SAAO;EAC3C,IAAA,KAAO,YAAc,eAAa,OAAA;EACnC,OACoC,KAAA,SAAS,aAAa,eAAe,MAAA;CAC1E,CAAA,IAAK,SAAA,aAAgB,eAAO;CAE5B,IAAA,CAAA,gBADY,OAAA;CAEZ,MAAK,eAAc,YAAO,WAAA,EAAA,eAAA,cAAA;CAC1B,IAAI,CAAA,cAAe,OAAA;CACnB,IAAA,eAAS,YAAa,GAAA,OAAc;CACtC,OAAA,CAAA,CAAA,aAAA,cAAA,qCAAA;;;;;;;;;;;;;;;;;MA0BI,cAAM,WAAc,SAAA,YAAyB,EAAA,OAAA,cAAA,MAAA,yBAAA,MAAA,cAAA,gBAAA,GAAA,SAAA;CAC7C,MAAM,cAAA,qBAAiB,IAAA;CACvB,MAAA,iBAAiB,wBAAgB;CAEjC,QAAA,SAGI,eAAA;CAGJ,UAAM,OAAA,mEAAoB;CAC1B,MAAM,cAAA,MAAkB;CACxB,MAAM,kBAAW,gBAAqB,WAAM;CAC5C,MAAM,WAAA,aAAiB,QAAA,MAAA,UAAA,KAAA;CAEvB,MAAM,eAAU,CAAA,CAAA;OACd,UAAc,UAAK,UAAA;EACnB,cAAU,KAAA;EACV,IAAI,MAAA,kBAAsB;EAC1B,IAAI,cAAA,KAAkB,GAAA;EACtB,IAAI,kBAAW,KAAA,GAAA;EAGf,IAAA,CAAA,UAAM;EACN,MAAI,YAAa,MAAA,cAAc,aAAS,eAAA;EACxC,IAAI,aAAC,cAAwB,SAAA;EAC7B,IAAA,CAAA,gBAAS,KAAA,GAAA;EACV,SAAA;CAQD,CAAA;SAFa;EAIX,MAAG,iBAAA,cAAA,QAAA,UAAA,oBAAA,QAAA,MAAA,iBAAA,IAAA,GAAA,UAAA;EACH,GAAA;EACF;CAEA;SACE,iBAAA;EACA;EACA;EACD,GAAA;CAED,CAAA;SACE,kBAAA;EACA;EACA,GAAA;eACQ,OAAA;SACA,wBAAwB;IAC5B,IAAI,OAAA,iBAAsB,YAAO,OAAA,aAAA,KAAA;IACjC,IAAA,gBAAO,MAAA,OAAA;IACT,OAAA;GACA;GACA,IAAI,CAAC,OAAA,OAAA;GACL,IAAA,CAAA,gBAAqB,GAAA,OAAU;GAI/B,MAAI,EAAA,aAAc,UAAA,MAAA,SAAA;OAChB,cAAU;IAGV,IAAA,MAAO,cAAA,aAAA,eAAA,GAAA,MAAA,cAAA,MAAA;IACT,OAAA;GAIA;OACE,aAAM,aAAoB,OAAA,MAAA,aAAA,GAAA;IAC1B,MAAA,cAAO,MAAA;IACT,OAAA;GACA;GACF,OAAA;EACA;iBACa,OAAA;GACX,IAAI,OAAA,mBAAwB,YAAO,OAAA,eAAA,KAAA;GAGnC,IAAA,kBAAO,MAAA,OAAA;GACT,OAAA;EACD;CAED,CAAA;CAEJ,OAAA;;;;;;;;;;;;;;;;;;;MAsBI,WAAO,KAAc,WADH,SAAA,SACqB,OAAA;CACxC,OACH,cAAA,SAAA,YAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"menu-item.js","names":[],"sources":["../../src/menu/menu-item.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport {\n useBooleanEvent,\n useEvent,\n createElement,\n createHook,\n forwardRef,\n memo,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport {\n getDocument,\n getPopupItemRole,\n isDownloading,\n isOpeningInNewTab,\n hasFocusWithin,\n invariant,\n} from \"@ariakit/utils\";\nimport type { BooleanOrCallback } from \"@ariakit/utils\";\nimport { useContext } from \"react\";\nimport type { ElementType, MouseEvent } from \"react\";\nimport type { CompositeHoverOptions } from \"../composite/composite-hover.tsx\";\nimport { useCompositeHover } from \"../composite/composite-hover.tsx\";\nimport type { CompositeItemOptions } from \"../composite/composite-item.tsx\";\nimport { useCompositeItem } from \"../composite/composite-item.tsx\";\nimport { useMenubarScopedContext } from \"../menubar/menubar-context.tsx\";\nimport type { MenubarStore } from \"../menubar/menubar-store.ts\";\nimport {\n MenuListHiddenContext,\n useMenuScopedContext,\n} from \"./menu-context.tsx\";\nimport type { MenuStore, MenuStoreState } from \"./menu-store.ts\";\n\nconst TagName = \"div\" satisfies ElementType;\ntype TagName = typeof TagName;\ntype HTMLType = HTMLElementTagNameMap[TagName];\n\nfunction menuHasFocus(\n baseElement?: MenuStoreState[\"baseElement\"],\n items?: MenuStoreState[\"items\"],\n currentTarget?: Element,\n) {\n if (!baseElement) return false;\n if (hasFocusWithin(baseElement)) return true;\n const expandedItem = items?.find((item) => {\n if (item.element === currentTarget) return false;\n return item.element?.getAttribute(\"aria-expanded\") === \"true\";\n });\n const expandedMenuId = expandedItem?.element?.getAttribute(\"aria-controls\");\n if (!expandedMenuId) return false;\n const doc = getDocument(baseElement);\n const expandedMenu = doc.getElementById(expandedMenuId);\n if (!expandedMenu) return false;\n if (hasFocusWithin(expandedMenu)) return true;\n return !!expandedMenu.querySelector(\"[role=menuitem][aria-expanded=true]\");\n}\n\n/**\n * Returns props to create a `MenuItem` component.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx\n * const store = useMenuStore();\n * const undo = useMenuItem({ store });\n * const redo = useMenuItem({ store });\n * <MenuButton store={store}>Edit</MenuButton>\n * <Menu store={store}>\n * <Role {...undo}>Undo</Role>\n * <Role {...redo}>Redo</Role>\n * </Menu>\n * ```\n */\nexport const useMenuItem = createHook<TagName, MenuItemOptions>(\n function useMenuItem({\n store,\n hideOnClick = true,\n preventScrollOnKeyDown = true,\n focusOnHover,\n blurOnHoverEnd,\n ...props\n }) {\n const menuContext = useMenuScopedContext(true);\n const menubarContext = useMenubarScopedContext();\n store = store || menuContext || (menubarContext as any);\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"MenuItem must be wrapped in a MenuList, Menu or Menubar component\",\n );\n\n const onClickProp = props.onClick;\n const hideOnClickProp = useBooleanEvent(hideOnClick);\n const hideMenu = \"hideAll\" in store ? store.hideAll : undefined;\n const isWithinMenu = !!hideMenu;\n\n const onClick = useEvent((event: MouseEvent<HTMLType>) => {\n onClickProp?.(event);\n if (event.defaultPrevented) return;\n if (isDownloading(event)) return;\n if (isOpeningInNewTab(event)) return;\n if (!hideMenu) return;\n // If this item is also a submenu button or any other disclosure, we\n // don't want to hide the menu.\n const popupType = event.currentTarget.getAttribute(\"aria-haspopup\");\n if (popupType && popupType !== \"false\") return;\n if (!hideOnClickProp(event)) return;\n hideMenu();\n });\n\n const contentElement = useStoreState(store, (state) =>\n \"contentElement\" in state ? state.contentElement : null,\n );\n\n // Whether the enclosing menu list is currently hidden (provided by\n // `MenuList`; see `MenuListHiddenContext`).\n const menuListHidden = useContext(MenuListHiddenContext);\n\n const role = getPopupItemRole(contentElement, \"menuitem\");\n\n props = {\n role,\n ...props,\n onClick,\n };\n\n props = useCompositeItem<TagName>({\n store,\n preventScrollOnKeyDown,\n ...props,\n // Skip registering items while the menu list is hidden. Unlike a Select,\n // a Menu doesn't interact with its items while hidden, so registering\n // them isn't useful. Registering many hidden menus' items at once on\n // mount can also cascade into React's \"Maximum update depth exceeded\"\n // error. Using the list's actual hidden state (rather than the store's\n // `mounted` state) keeps items registered in `alwaysVisible` or\n // `hidden={false}` menus, where the list is shown even while closed.\n // See https://github.com/ariakit/ariakit/issues/3214.\n shouldRegisterItem: menuListHidden ? false : props.shouldRegisterItem,\n });\n\n props = useCompositeHover({\n store,\n ...props,\n focusOnHover(event) {\n const getFocusOnHover = () => {\n if (typeof focusOnHover === \"function\") return focusOnHover(event);\n if (focusOnHover != null) return focusOnHover;\n return true;\n };\n if (!store) return false;\n if (!getFocusOnHover()) return false;\n const { baseElement, items } = store.getState();\n // If the menu item is also a submenu button, we should move actual DOM\n // focus to it so that the submenu will not close when the user moves\n // the cursor back to the menu button.\n if (isWithinMenu) {\n if (event.currentTarget.hasAttribute(\"aria-expanded\")) {\n event.currentTarget.focus();\n }\n return true;\n }\n // If the menu item is inside a menu bar, we should move DOM focus to\n // the menu item if focus is somewhere on the widget. Without this, the\n // open menus in the menu bar wouldn't close.\n if (menuHasFocus(baseElement, items, event.currentTarget)) {\n event.currentTarget.focus();\n return true;\n }\n return false;\n },\n blurOnHoverEnd(event) {\n if (typeof blurOnHoverEnd === \"function\") return blurOnHoverEnd(event);\n if (blurOnHoverEnd != null) return blurOnHoverEnd;\n // The menu container should be focused on mouseleave only if the menu\n // item is inside a menu, not a menu bar.\n return isWithinMenu;\n },\n });\n\n return props;\n },\n);\n\n/**\n * Renders a menu item inside\n * [`MenuList`](https://ariakit.com/reference/menu-list) or\n * [`Menu`](https://ariakit.com/reference/menu)\n * components.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx {4-5}\n * <MenuProvider>\n * <MenuButton>Edit</MenuButton>\n * <Menu>\n * <MenuItem>Undo</MenuItem>\n * <MenuItem>Redo</MenuItem>\n * </Menu>\n * </MenuProvider>\n * ```\n */\nexport const MenuItem = memo(\n forwardRef(function MenuItem(props: MenuItemProps) {\n const htmlProps = useMenuItem(props);\n return createElement(TagName, htmlProps);\n }),\n);\n\nexport interface MenuItemOptions<T extends ElementType = TagName>\n extends CompositeItemOptions<T>, CompositeHoverOptions<T> {\n /**\n * Object returned by the\n * [`useMenuStore`](https://ariakit.com/reference/use-menu-store) or\n * [`useMenubarStore`](https://ariakit.com/reference/use-menubar-store)\n * hooks. If not provided, the closest\n * [`Menu`](https://ariakit.com/reference/menu),\n * [`MenuProvider`](https://ariakit.com/reference/menu-provider),\n * [`Menubar`](https://ariakit.com/reference/menubar), or\n * [`MenubarProvider`](https://ariakit.com/reference/menubar-provider)\n * components' context will be used.\n */\n store?: MenubarStore | MenuStore;\n /**\n * Determines if the menu should hide when this item is clicked.\n *\n * **Note**: This behavior isn't triggered if this menu item is rendered as a\n * link and modifier keys are used to either open the link in a new tab or\n * download it.\n *\n * Live examples:\n * - [Sliding Menu](https://ariakit.com/examples/menu-slide)\n * @default true\n */\n hideOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;\n}\n\nexport type MenuItemProps<T extends ElementType = TagName> = Props<\n T,\n MenuItemOptions<T>\n>;\n"],"mappings":";;;;;;;;;;AAqCA,MAAA,UAAS;SAKF,aAAa,aAAO,OAAA,eAAA;CACzB,IAAI,CAAA,aAAA,OAAe;CAKnB,IAAA,eAAM,WAJe,GAAO,OAAM;OAC5B,kBAAiB,OAAA,MAAe,SAAO;EAC3C,IAAA,KAAO,YAAc,eAAa,OAAA;EACnC,OACoC,KAAA,SAAS,aAAa,eAAe,MAAA;CAC1E,CAAA,IAAK,SAAA,aAAgB,eAAO;CAE5B,IAAA,CAAA,gBADY,OAAA;CAEZ,MAAK,eAAc,YAAO,WAAA,EAAA,eAAA,cAAA;CAC1B,IAAI,CAAA,cAAe,OAAA;CACnB,IAAA,eAAS,YAAa,GAAA,OAAc;CACtC,OAAA,CAAA,CAAA,aAAA,cAAA,qCAAA;;;;;;;;;;;;;;;;;MA0BI,cAAM,WAAc,SAAA,YAAyB,EAAA,OAAA,cAAA,MAAA,yBAAA,MAAA,cAAA,gBAAA,GAAA,SAAA;CAC7C,MAAM,cAAA,qBAAiB,IAAA;CACvB,MAAA,iBAAiB,wBAAgB;CAEjC,QAAA,SAEE,eAAY;CAId,UAAM,OAAA,QAAc,IAAM,aAAA,gBAAA,mEAAA;CAC1B,MAAM,cAAA,MAAkB;CACxB,MAAM,kBAAW,gBAAqB,WAAM;CAC5C,MAAM,WAAA,aAAiB,QAAA,MAAA,UAAA,KAAA;CAEvB,MAAM,eAAU,CAAA,CAAA;OACd,UAAc,UAAK,UAAA;EACnB,cAAU,KAAA;EACV,IAAI,MAAA,kBAAsB;EAC1B,IAAI,cAAA,KAAkB,GAAA;EACtB,IAAI,kBAAW,KAAA,GAAA;EAGf,IAAA,CAAA,UAAM;EACN,MAAI,YAAa,MAAA,cAAc,aAAS,eAAA;EACxC,IAAI,aAAC,cAAwB,SAAA;EAC7B,IAAA,CAAA,gBAAS,KAAA,GAAA;EACV,SAAA;CAED,CAAA;CAMA,MAAM,iBAAiB,cAAW,QAAA,UAAqB,oBAAA,QAAA,MAAA,iBAAA,IAAA;CAIvD,MAAA,iBAAQ,WAAA,qBAAA;SAFK;EAIX,MAAG,iBAAA,gBAAA,UAAA;EACH,GAAA;EACF;CAEA;SACE,iBAAA;EACA;EACA;EASA,GAAA;EACD,oBAAA,iBAAA,QAAA,MAAA;CAED,CAAA;SACE,kBAAA;EACA;EACA,GAAA;eACQ,OAAA;SACA,wBAAwB;IAC5B,IAAI,OAAA,iBAAsB,YAAO,OAAA,aAAA,KAAA;IACjC,IAAA,gBAAO,MAAA,OAAA;IACT,OAAA;GACA;GACA,IAAI,CAAC,OAAA,OAAA;GACL,IAAA,CAAA,gBAAqB,GAAA,OAAU;GAI/B,MAAI,EAAA,aAAc,UAAA,MAAA,SAAA;OAChB,cAAU;IAGV,IAAA,MAAO,cAAA,aAAA,eAAA,GAAA,MAAA,cAAA,MAAA;IACT,OAAA;GAIA;OACE,aAAM,aAAoB,OAAA,MAAA,aAAA,GAAA;IAC1B,MAAA,cAAO,MAAA;IACT,OAAA;GACA;GACF,OAAA;EACA;iBACa,OAAA;GACX,IAAI,OAAA,mBAAwB,YAAO,OAAA,eAAA,KAAA;GAGnC,IAAA,kBAAO,MAAA,OAAA;GACT,OAAA;EACD;CAED,CAAA;CAEJ,OAAA;;;;;;;;;;;;;;;;;;;MAsBI,WAAO,KAAc,WADH,SAAA,SACqB,OAAA;CACxC,OACH,cAAA,SAAA,YAAA,KAAA,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { n as DisclosureContentOptions } from "../disclosure-content-BbPkZgAc.js";
2
- import { n as CompositeOptions } from "../composite-DLvyFHMq.js";
3
- import { n as CompositeTypeaheadOptions } from "../composite-typeahead-DDhpyKqm.js";
4
- import { t as MenuStore } from "../menu-store-0CKKmNek.js";
2
+ import { n as CompositeOptions } from "../composite-KBhCGLEy.js";
3
+ import { n as CompositeTypeaheadOptions } from "../composite-typeahead-0euW43GU.js";
4
+ import { t as MenuStore } from "../menu-store-BpTJdcL8.js";
5
5
  import { Props } from "@ariakit/react-utils";
6
6
  import { ElementType } from "react";
7
7
 
@@ -42,7 +42,7 @@ declare const useMenuList: import("@ariakit/react-utils").Hook<"div", MenuListOp
42
42
  * </MenuProvider>
43
43
  * ```
44
44
  */
45
- declare const MenuList: (props: MenuListProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
45
+ declare const MenuList: (props: MenuListProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
46
46
  interface MenuListOptions<T extends ElementType = TagName> extends CompositeOptions<T>, CompositeTypeaheadOptions<T>, Pick<DisclosureContentOptions, "alwaysVisible"> {
47
47
  /**
48
48
  * Object returned by the
@@ -1 +1 @@
1
- {"version":3,"file":"menu-list.d.ts","names":["Props","ElementType","CompositeTypeaheadOptions","CompositeOptions","DisclosureContentOptions","MenuStore","TagName","useMenuList","MenuListOptions","Hook","MenuList","MenuListProps","props","ReactElement","JSXElementConstructor","T","Pick","store"],"sources":["../../src/menu/menu-list.d.ts"],"mappings":";;;;;;;;cAMcM,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAe7B;;;;AAjBiD,cAiB5BC,WAAAA,iCAA4CE,IAAAA,QAAYD,eAAe;AAoB5F;;;;;;;;;AAAyI;AACzI;;;;;;;;;AADA,cAAqBE,QAAAA,GAAWE,KAAAA,EAAOD,aAAa,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UACnGN,eAAAA,WAA0BP,WAAAA,GAAcK,OAAAA,UAAiBH,gBAAAA,CAAiBY,CAAAA,GAAIb,yBAAAA,CAA0Ba,CAAAA,GAAIC,IAAAA,CAAKZ,wBAAAA;EAALY;;;;;;;EAQzHC,KAAAA,GAAQZ,SAAAA;AAAAA;AAAAA,KAEAM,aAAAA,WAAwBV,WAAAA,GAAcK,OAAAA,IAAWN,KAAAA,CAAMe,CAAAA,EAAGP,eAAAA,CAAgBO,CAAAA"}
1
+ {"version":3,"file":"menu-list.d.ts","names":["Props","ElementType","CompositeTypeaheadOptions","CompositeOptions","DisclosureContentOptions","MenuStore","TagName","useMenuList","MenuListOptions","Hook","MenuList","MenuListProps","props","ReactElement","JSXElementConstructor","T","Pick","store"],"sources":["../../src/menu/menu-list.d.ts"],"mappings":";;;;;;;;cAMcM,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAe7B;;;;AAjBiD,cAiB5BC,WAAAA,iCAA4CE,IAAAA,QAAYD,eAAe;AAoB5F;;;;;;;;;AAA6I;AAC7I;;;;;;;;;AADA,cAAqBE,QAAAA,GAAWE,KAAAA,EAAOD,aAAa,qBAAqBE,YAAAA,mCAA+CC,qBAAAA;AAAAA,UACvGN,eAAAA,WAA0BP,WAAAA,GAAcK,OAAAA,UAAiBH,gBAAAA,CAAiBY,CAAAA,GAAIb,yBAAAA,CAA0Ba,CAAAA,GAAIC,IAAAA,CAAKZ,wBAAAA;EAALY;;;;;;;EAQzHC,KAAAA,GAAQZ,SAAAA;AAAAA;AAAAA,KAEAM,aAAAA,WAAwBV,WAAAA,GAAcK,OAAAA,IAAWN,KAAAA,CAAMe,CAAAA,EAAGP,eAAAA,CAAgBO,CAAAA"}
@@ -2,7 +2,7 @@
2
2
  import { isHidden } from "../disclosure/disclosure-content.js";
3
3
  import { useComposite } from "../composite/composite.js";
4
4
  import { useCompositeTypeahead } from "../composite/composite-typeahead.js";
5
- import { MenuScopedContextProvider, useMenuProviderContext } from "./menu-context.js";
5
+ import { MenuListHiddenContext, MenuScopedContextProvider, useMenuProviderContext } from "./menu-context.js";
6
6
  import { createElement, createHook, forwardRef, useEvent, useId, useMergeRefs, useWrapElement } from "@ariakit/react-utils";
7
7
  import { invariant } from "@ariakit/utils";
8
8
  import { useEffect, useState } from "react";
@@ -46,7 +46,7 @@ function useAriaLabelledBy({ store, ...props }) {
46
46
  const useMenuList = createHook(function useMenuList({ store, alwaysVisible, composite, ...props }) {
47
47
  const context = useMenuProviderContext();
48
48
  store = store || context;
49
- invariant(store, "MenuList must receive a `store` prop or be wrapped in a MenuProvider component.");
49
+ invariant(store, process.env.NODE_ENV !== "production" && "MenuList must receive a `store` prop or be wrapped in a MenuProvider component.");
50
50
  const parentMenu = store.parent;
51
51
  const parentMenubar = store.menubar;
52
52
  const hasParentMenu = !!parentMenu;
@@ -112,6 +112,10 @@ const useMenuList = createHook(function useMenuList({ store, alwaysVisible, comp
112
112
  ...props.style,
113
113
  display: "none"
114
114
  } : props.style;
115
+ props = useWrapElement(props, (element) => /* @__PURE__ */ jsx(MenuListHiddenContext.Provider, {
116
+ value: hidden,
117
+ children: element
118
+ }), [hidden]);
115
119
  props = {
116
120
  "aria-labelledby": ariaLabelledBy,
117
121
  hidden,
@@ -1 +1 @@
1
- {"version":3,"file":"menu-list.js","names":[],"sources":["../../src/menu/menu-list.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport {\n useEvent,\n useId,\n useMergeRefs,\n useWrapElement,\n createElement,\n createHook,\n forwardRef,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport { invariant } from \"@ariakit/utils\";\nimport type { ElementType, KeyboardEvent } from \"react\";\nimport { useEffect, useState } from \"react\";\nimport type { CompositeTypeaheadOptions } from \"../composite/composite-typeahead.tsx\";\nimport { useCompositeTypeahead } from \"../composite/composite-typeahead.tsx\";\nimport type { CompositeOptions } from \"../composite/composite.tsx\";\nimport { useComposite } from \"../composite/composite.tsx\";\nimport type { DisclosureContentOptions } from \"../disclosure/disclosure-content.tsx\";\nimport { isHidden } from \"../disclosure/disclosure-content.tsx\";\nimport {\n MenuScopedContextProvider,\n useMenuProviderContext,\n} from \"./menu-context.tsx\";\nimport type { MenuStore } from \"./menu-store.ts\";\n\nconst TagName = \"div\" satisfies ElementType;\ntype TagName = typeof TagName;\ntype HTMLType = HTMLElementTagNameMap[TagName];\ntype BasePlacement = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nfunction useAriaLabelledBy({ store, ...props }: MenuListProps) {\n const [id, setId] = useState<string | undefined>(undefined);\n const label = props[\"aria-label\"];\n\n const disclosureElement = useStoreState(store, \"disclosureElement\");\n const contentElement = useStoreState(store, \"contentElement\");\n\n useEffect(() => {\n const disclosure = disclosureElement;\n if (!disclosure) return;\n const menu = contentElement;\n if (!menu) return;\n const menuLabel = label || menu.hasAttribute(\"aria-label\");\n if (menuLabel) {\n setId(undefined);\n } else if (disclosure.id) {\n setId(disclosure.id);\n }\n }, [label, disclosureElement, contentElement]);\n\n return id;\n}\n\n/**\n * Returns props to create a `MenuList` component.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx\n * const store = useMenuStore();\n * const props = useMenuList({ store });\n * <MenuButton store={store}>Edit</MenuButton>\n * <Role {...props}>\n * <MenuItem>Undo</MenuItem>\n * <MenuItem>Redo</MenuItem>\n * </Role>\n * ```\n */\nexport const useMenuList = createHook<TagName, MenuListOptions>(\n function useMenuList({ store, alwaysVisible, composite, ...props }) {\n const context = useMenuProviderContext();\n store = store || context;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"MenuList must receive a `store` prop or be wrapped in a MenuProvider component.\",\n );\n\n const parentMenu = store.parent;\n const parentMenubar = store.menubar;\n const hasParentMenu = !!parentMenu;\n const id = useId(props.id);\n\n const onKeyDownProp = props.onKeyDown;\n const dir = useStoreState(\n store,\n (state) => state.placement.split(\"-\")[0] as BasePlacement,\n );\n const orientation = useStoreState(store, (state) =>\n state.orientation === \"both\" ? undefined : state.orientation,\n );\n const isHorizontal = orientation !== \"vertical\";\n const isMenubarHorizontal = useStoreState(\n parentMenubar,\n (state) => !!state && state.orientation !== \"vertical\",\n );\n\n const onKeyDown = useEvent((event: KeyboardEvent<HTMLType>) => {\n onKeyDownProp?.(event);\n if (event.defaultPrevented) return;\n if (hasParentMenu || (parentMenubar && !isHorizontal)) {\n const hideMap = {\n ArrowRight: () => dir === \"left\" && !isHorizontal,\n ArrowLeft: () => dir === \"right\" && !isHorizontal,\n ArrowUp: () => dir === \"bottom\" && isHorizontal,\n ArrowDown: () => dir === \"top\" && isHorizontal,\n };\n const action = hideMap[event.key as keyof typeof hideMap];\n if (action?.()) {\n event.stopPropagation();\n event.preventDefault();\n return store?.hide();\n }\n }\n if (parentMenubar) {\n const keyMap = {\n ArrowRight: () => {\n if (!isMenubarHorizontal) return;\n return parentMenubar.next();\n },\n ArrowLeft: () => {\n if (!isMenubarHorizontal) return;\n return parentMenubar.previous();\n },\n ArrowDown: () => {\n if (isMenubarHorizontal) return;\n return parentMenubar.next();\n },\n ArrowUp: () => {\n if (isMenubarHorizontal) return;\n return parentMenubar.previous();\n },\n };\n const action = keyMap[event.key as keyof typeof keyMap];\n const id = action?.();\n if (id !== undefined) {\n event.stopPropagation();\n event.preventDefault();\n parentMenubar.move(id);\n }\n }\n });\n\n props = useWrapElement(\n props,\n (element) => (\n <MenuScopedContextProvider value={store}>\n {element}\n </MenuScopedContextProvider>\n ),\n [store],\n );\n\n const ariaLabelledBy = useAriaLabelledBy({ store, ...props });\n const mounted = useStoreState(store, \"mounted\");\n const hidden = isHidden(mounted, props.hidden, alwaysVisible);\n const style = hidden ? { ...props.style, display: \"none\" } : props.style;\n\n props = {\n \"aria-labelledby\": ariaLabelledBy,\n hidden,\n ...props,\n id,\n ref: useMergeRefs(id ? store.setContentElement : null, props.ref),\n style,\n onKeyDown,\n };\n\n const hasCombobox = !!store.combobox;\n composite = composite ?? !hasCombobox;\n\n if (composite) {\n props = {\n role: \"menu\",\n \"aria-orientation\": orientation,\n ...props,\n };\n }\n\n props = useComposite({ store, composite, ...props });\n props = useCompositeTypeahead({ store, typeahead: !hasCombobox, ...props });\n\n return props;\n },\n);\n\n/**\n * Renders a menu list element. This is the primitive component used by the\n * [`Menu`](https://ariakit.com/reference/menu) component.\n *\n * Unlike [`Menu`](https://ariakit.com/reference/menu), this component doesn't\n * render a popover and therefore doesn't automatically focus on items when\n * opened.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx {3-6}\n * <MenuProvider>\n * <MenuButton>Edit</MenuButton>\n * <MenuList>\n * <MenuItem>Undo</MenuItem>\n * <MenuItem>Redo</MenuItem>\n * </MenuList>\n * </MenuProvider>\n * ```\n */\nexport const MenuList = forwardRef(function MenuList(props: MenuListProps) {\n const htmlProps = useMenuList(props);\n return createElement(TagName, htmlProps);\n});\n\nexport interface MenuListOptions<T extends ElementType = TagName>\n extends\n CompositeOptions<T>,\n CompositeTypeaheadOptions<T>,\n Pick<DisclosureContentOptions, \"alwaysVisible\"> {\n /**\n * Object returned by the\n * [`useMenuStore`](https://ariakit.com/reference/use-menu-store) hook. If not\n * provided, the closest\n * [`MenuProvider`](https://ariakit.com/reference/menu-provider) component's\n * context will be used.\n */\n store?: MenuStore;\n}\n\nexport type MenuListProps<T extends ElementType = TagName> = Props<\n T,\n MenuListOptions<T>\n>;\n"],"mappings":";;;;;;;;;;;AA+BA,MAAA,UAAS;SACA,kBAAa,EAAA,OAAsC,GAAA,SAAA;CAC1D,MAAM,CAAA,IAAA,SAAc,SAAA,KAAA,CAAA;CAEpB,MAAM,QAAA,MAAA;CACN,MAAM,oBAAiB,cAAc,OAAO,mBAAgB;CAE5D,MAAA,iBAAgB,cAAA,OAAA,gBAAA;iBACR;EACN,MAAK,aAAY;EACjB,IAAA,CAAA,YAAa;EACb,MAAK,OAAM;EAEX,IADkB,CAAA,MAAA;eAGP,KAAA,aACH,YAAa,GAAA,MAAA,KAAA,CAAA;OAEpB,IAAA,WAAA,IAAA,MAAA,WAAA,EAAA;IAAC;EAAO;EAAmB;EAAe;CAE7C,CAAA;CACF,OAAA;;;;;;;;;;;;;;;;MAkBI,cAAgB,WAAA,SAAuB,YAAA,EAAA,OAAA,eAAA,WAAA,GAAA,SAAA;CACvC,MAAA,UAAQ,uBAAS;CAEjB,QAAA,SAGI;CAGJ,UAAM,OAAA,iFAAmB;CACzB,MAAM,aAAA,MAAgB;CACtB,MAAM,gBAAgB,MAAE;CACxB,MAAM,gBAAW,CAAM,CAAA;CAEvB,MAAM,KAAA,MAAA,MAAgB,EAAA;CACtB,MAAM,gBAAM,MACV;CAGF,MAAM,MAAA,cAAc,QAAc,UAAQ,MAAA,UAClC,MAAA,GAAA,EAAA,EAAA;CAER,MAAM,cAAA,cAAe,QAAgB,UAAA,MAAA,gBAAA,SAAA,KAAA,IAAA,MAAA,WAAA;CACrC,MAAM,eAAA,gBAAsB;CAK5B,MAAM,sBAAsB,cAAmC,gBAAA,UAAA,CAAA,CAAA,SAAA,MAAA,gBAAA,UAAA;OAC7D,YAAgB,UAAK,UAAA;EACrB,gBAAU,KAAA;EACV,IAAI,MAAA,kBAAkB;MAOpB,iBAAe,iBAAA,CAAA,cAAA;SALb,SAAA;IACA,kBAAiB,QAAQ,UAAW,CAAC;IACrC,iBAAe,QAAQ,WAAY,CAAA;IACnC,eAAA,QAAiB,YAAiB;IAEf,iBAAQ,QAAA,SAAA;GAC7B,EAAA,MAAI;OACF,SAAM,GAAA;IACN,MAAM,gBAAe;IACrB,MAAA,eAAmB;IACrB,OAAA,OAAA,KAAA;GACF;EACA;MAmBE,eAAe;SAjBb,SAAA;sBACO;KACL,IAAA,CAAA,qBAA0B;KAC5B,OAAA,cAAA,KAAA;IACA;qBACO;KACL,IAAA,CAAA,qBAAqB;KACvB,OAAA,cAAA,SAAA;IACA;qBACM;KACJ,IAAA,qBAAqB;KACvB,OAAA,cAAA,KAAA;IACA;mBACM;KACJ,IAAA,qBAAqB;KACvB,OAAA,cAAA,SAAA;IAEkB;GACpB,EAAA,MAAM;GACN,MAAI,KAAO,SAAW;OACpB,OAAM,KAAA,GAAA;IACN,MAAM,gBAAe;IACrB,MAAA,eAAqB;IACvB,cAAA,KAAA,EAAA;GACF;EACD;CAED,CAAA;SAGsC,eAAA,QAAA,YAAA,oBAAA,2BAAA;;EAEP,UAG/B;CAEA,CAAA,GAAA,CAAA,KAAM,CAAA;OAAqC,iBAAA,kBAAA;EAAO;EAAU,GAAA;CAE5D,CAAA;CACA,MAAM,SAAQ,SAAS,cAAA,OAAA,SAAA,GAAA,MAAA,QAAA,aAAA;OAAK,QAAM,SAAA;EAAO,GAAA,MAAS;EAAO,SAAU;CAEnE,IAAA,MAAQ;SACN;EACA,mBAAA;EACA;EACA,GAAA;EACA;EACA,KAAA,aAAA,KAAA,MAAA,oBAAA,MAAA,MAAA,GAAA;EACA;EACF;CAEA;CACA,MAAA,cAAY,CAAA,CAAA,MAAc;CAE1B,YAAI,aACM,CAAA;KACN,WAAM,QAAA;EACN,MAAA;EACA,oBAAG;EACL,GAAA;CAGF;SAAuB,aAAA;EAAO;EAAW;EAAU,GAAA;CACnD,CAAA;SAAgC,sBAAA;EAAO;EAAyB,WAAG,CAAA;EAAO,GAAA;CAE1E,CAAA;CAEJ,OAAA;;;;;;;;;;;;;;;;;;;;;MAuBE,WAAO,WAAc,SADH,SAAY,OACS;CACxC,OAAA,cAAA,SAAA,YAAA,KAAA,CAAA"}
1
+ {"version":3,"file":"menu-list.js","names":[],"sources":["../../src/menu/menu-list.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport {\n useEvent,\n useId,\n useMergeRefs,\n useWrapElement,\n createElement,\n createHook,\n forwardRef,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport { invariant } from \"@ariakit/utils\";\nimport type { ElementType, KeyboardEvent } from \"react\";\nimport { useEffect, useState } from \"react\";\nimport type { CompositeTypeaheadOptions } from \"../composite/composite-typeahead.tsx\";\nimport { useCompositeTypeahead } from \"../composite/composite-typeahead.tsx\";\nimport type { CompositeOptions } from \"../composite/composite.tsx\";\nimport { useComposite } from \"../composite/composite.tsx\";\nimport type { DisclosureContentOptions } from \"../disclosure/disclosure-content.tsx\";\nimport { isHidden } from \"../disclosure/disclosure-content.tsx\";\nimport {\n MenuListHiddenContext,\n MenuScopedContextProvider,\n useMenuProviderContext,\n} from \"./menu-context.tsx\";\nimport type { MenuStore } from \"./menu-store.ts\";\n\nconst TagName = \"div\" satisfies ElementType;\ntype TagName = typeof TagName;\ntype HTMLType = HTMLElementTagNameMap[TagName];\ntype BasePlacement = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nfunction useAriaLabelledBy({ store, ...props }: MenuListProps) {\n const [id, setId] = useState<string | undefined>(undefined);\n const label = props[\"aria-label\"];\n\n const disclosureElement = useStoreState(store, \"disclosureElement\");\n const contentElement = useStoreState(store, \"contentElement\");\n\n useEffect(() => {\n const disclosure = disclosureElement;\n if (!disclosure) return;\n const menu = contentElement;\n if (!menu) return;\n const menuLabel = label || menu.hasAttribute(\"aria-label\");\n if (menuLabel) {\n setId(undefined);\n } else if (disclosure.id) {\n setId(disclosure.id);\n }\n }, [label, disclosureElement, contentElement]);\n\n return id;\n}\n\n/**\n * Returns props to create a `MenuList` component.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx\n * const store = useMenuStore();\n * const props = useMenuList({ store });\n * <MenuButton store={store}>Edit</MenuButton>\n * <Role {...props}>\n * <MenuItem>Undo</MenuItem>\n * <MenuItem>Redo</MenuItem>\n * </Role>\n * ```\n */\nexport const useMenuList = createHook<TagName, MenuListOptions>(\n function useMenuList({ store, alwaysVisible, composite, ...props }) {\n const context = useMenuProviderContext();\n store = store || context;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"MenuList must receive a `store` prop or be wrapped in a MenuProvider component.\",\n );\n\n const parentMenu = store.parent;\n const parentMenubar = store.menubar;\n const hasParentMenu = !!parentMenu;\n const id = useId(props.id);\n\n const onKeyDownProp = props.onKeyDown;\n const dir = useStoreState(\n store,\n (state) => state.placement.split(\"-\")[0] as BasePlacement,\n );\n const orientation = useStoreState(store, (state) =>\n state.orientation === \"both\" ? undefined : state.orientation,\n );\n const isHorizontal = orientation !== \"vertical\";\n const isMenubarHorizontal = useStoreState(\n parentMenubar,\n (state) => !!state && state.orientation !== \"vertical\",\n );\n\n const onKeyDown = useEvent((event: KeyboardEvent<HTMLType>) => {\n onKeyDownProp?.(event);\n if (event.defaultPrevented) return;\n if (hasParentMenu || (parentMenubar && !isHorizontal)) {\n const hideMap = {\n ArrowRight: () => dir === \"left\" && !isHorizontal,\n ArrowLeft: () => dir === \"right\" && !isHorizontal,\n ArrowUp: () => dir === \"bottom\" && isHorizontal,\n ArrowDown: () => dir === \"top\" && isHorizontal,\n };\n const action = hideMap[event.key as keyof typeof hideMap];\n if (action?.()) {\n event.stopPropagation();\n event.preventDefault();\n return store?.hide();\n }\n }\n if (parentMenubar) {\n const keyMap = {\n ArrowRight: () => {\n if (!isMenubarHorizontal) return;\n return parentMenubar.next();\n },\n ArrowLeft: () => {\n if (!isMenubarHorizontal) return;\n return parentMenubar.previous();\n },\n ArrowDown: () => {\n if (isMenubarHorizontal) return;\n return parentMenubar.next();\n },\n ArrowUp: () => {\n if (isMenubarHorizontal) return;\n return parentMenubar.previous();\n },\n };\n const action = keyMap[event.key as keyof typeof keyMap];\n const id = action?.();\n if (id !== undefined) {\n event.stopPropagation();\n event.preventDefault();\n parentMenubar.move(id);\n }\n }\n });\n\n props = useWrapElement(\n props,\n (element) => (\n <MenuScopedContextProvider value={store}>\n {element}\n </MenuScopedContextProvider>\n ),\n [store],\n );\n\n const ariaLabelledBy = useAriaLabelledBy({ store, ...props });\n const mounted = useStoreState(store, \"mounted\");\n const hidden = isHidden(mounted, props.hidden, alwaysVisible);\n const style = hidden ? { ...props.style, display: \"none\" } : props.style;\n\n // Expose the list's actual hidden state so MenuItem can avoid registering\n // items while they're not shown. This accounts for `alwaysVisible` and\n // `hidden={false}`, where the list is visible even though the store is\n // closed. See https://github.com/ariakit/ariakit/issues/3214.\n props = useWrapElement(\n props,\n (element) => (\n <MenuListHiddenContext.Provider value={hidden}>\n {element}\n </MenuListHiddenContext.Provider>\n ),\n [hidden],\n );\n\n props = {\n \"aria-labelledby\": ariaLabelledBy,\n hidden,\n ...props,\n id,\n ref: useMergeRefs(id ? store.setContentElement : null, props.ref),\n style,\n onKeyDown,\n };\n\n const hasCombobox = !!store.combobox;\n composite = composite ?? !hasCombobox;\n\n if (composite) {\n props = {\n role: \"menu\",\n \"aria-orientation\": orientation,\n ...props,\n };\n }\n\n props = useComposite({ store, composite, ...props });\n props = useCompositeTypeahead({ store, typeahead: !hasCombobox, ...props });\n\n return props;\n },\n);\n\n/**\n * Renders a menu list element. This is the primitive component used by the\n * [`Menu`](https://ariakit.com/reference/menu) component.\n *\n * Unlike [`Menu`](https://ariakit.com/reference/menu), this component doesn't\n * render a popover and therefore doesn't automatically focus on items when\n * opened.\n * @see https://ariakit.com/components/menu\n * @example\n * ```jsx {3-6}\n * <MenuProvider>\n * <MenuButton>Edit</MenuButton>\n * <MenuList>\n * <MenuItem>Undo</MenuItem>\n * <MenuItem>Redo</MenuItem>\n * </MenuList>\n * </MenuProvider>\n * ```\n */\nexport const MenuList = forwardRef(function MenuList(props: MenuListProps) {\n const htmlProps = useMenuList(props);\n return createElement(TagName, htmlProps);\n});\n\nexport interface MenuListOptions<T extends ElementType = TagName>\n extends\n CompositeOptions<T>,\n CompositeTypeaheadOptions<T>,\n Pick<DisclosureContentOptions, \"alwaysVisible\"> {\n /**\n * Object returned by the\n * [`useMenuStore`](https://ariakit.com/reference/use-menu-store) hook. If not\n * provided, the closest\n * [`MenuProvider`](https://ariakit.com/reference/menu-provider) component's\n * context will be used.\n */\n store?: MenuStore;\n}\n\nexport type MenuListProps<T extends ElementType = TagName> = Props<\n T,\n MenuListOptions<T>\n>;\n"],"mappings":";;;;;;;;;;;AAgCA,MAAA,UAAS;SACA,kBAAa,EAAA,OAAsC,GAAA,SAAA;CAC1D,MAAM,CAAA,IAAA,SAAc,SAAA,KAAA,CAAA;CAEpB,MAAM,QAAA,MAAA;CACN,MAAM,oBAAiB,cAAc,OAAO,mBAAgB;CAE5D,MAAA,iBAAgB,cAAA,OAAA,gBAAA;iBACR;EACN,MAAK,aAAY;EACjB,IAAA,CAAA,YAAa;EACb,MAAK,OAAM;EAEX,IADkB,CAAA,MAAA;eAGP,KAAA,aACH,YAAa,GAAA,MAAA,KAAA,CAAA;OAEpB,IAAA,WAAA,IAAA,MAAA,WAAA,EAAA;IAAC;EAAO;EAAmB;EAAe;CAE7C,CAAA;CACF,OAAA;;;;;;;;;;;;;;;;MAkBI,cAAgB,WAAA,SAAuB,YAAA,EAAA,OAAA,eAAA,WAAA,GAAA,SAAA;CACvC,MAAA,UAAQ,uBAAS;CAEjB,QAAA,SAEE;CAIF,UAAM,OAAA,QAAmB,IAAA,aAAA,gBAAA,iFAAA;CACzB,MAAM,aAAA,MAAgB;CACtB,MAAM,gBAAgB,MAAE;CACxB,MAAM,gBAAW,CAAM,CAAA;CAEvB,MAAM,KAAA,MAAA,MAAgB,EAAA;CACtB,MAAM,gBAAM,MACV;CAGF,MAAM,MAAA,cAAc,QAAc,UAAQ,MAAA,UAClC,MAAA,GAAA,EAAA,EAAA;CAER,MAAM,cAAA,cAAe,QAAgB,UAAA,MAAA,gBAAA,SAAA,KAAA,IAAA,MAAA,WAAA;CACrC,MAAM,eAAA,gBAAsB;CAK5B,MAAM,sBAAsB,cAAmC,gBAAA,UAAA,CAAA,CAAA,SAAA,MAAA,gBAAA,UAAA;OAC7D,YAAgB,UAAK,UAAA;EACrB,gBAAU,KAAA;EACV,IAAI,MAAA,kBAAkB;MAOpB,iBAAe,iBAAA,CAAA,cAAA;SALb,SAAA;IACA,kBAAiB,QAAQ,UAAW,CAAC;IACrC,iBAAe,QAAQ,WAAY,CAAA;IACnC,eAAA,QAAiB,YAAiB;IAEf,iBAAQ,QAAA,SAAA;GAC7B,EAAA,MAAI;OACF,SAAM,GAAA;IACN,MAAM,gBAAe;IACrB,MAAA,eAAmB;IACrB,OAAA,OAAA,KAAA;GACF;EACA;MAmBE,eAAe;SAjBb,SAAA;sBACO;KACL,IAAA,CAAA,qBAA0B;KAC5B,OAAA,cAAA,KAAA;IACA;qBACO;KACL,IAAA,CAAA,qBAAqB;KACvB,OAAA,cAAA,SAAA;IACA;qBACM;KACJ,IAAA,qBAAqB;KACvB,OAAA,cAAA,KAAA;IACA;mBACM;KACJ,IAAA,qBAAqB;KACvB,OAAA,cAAA,SAAA;IAEkB;GACpB,EAAA,MAAM;GACN,MAAI,KAAO,SAAW;OACpB,OAAM,KAAA,GAAA;IACN,MAAM,gBAAe;IACrB,MAAA,eAAqB;IACvB,cAAA,KAAA,EAAA;GACF;EACD;CAED,CAAA;SAGsC,eAAA,QAAA,YAAA,oBAAA,2BAAA;;EAEP,UAG/B;CAEA,CAAA,GAAA,CAAA,KAAM,CAAA;OAAqC,iBAAA,kBAAA;EAAO;EAAU,GAAA;CAE5D,CAAA;CACA,MAAM,SAAQ,SAAS,cAAA,OAAA,SAAA,GAAA,MAAA,QAAA,aAAA;OAAK,QAAM,SAAA;EAAO,GAAA,MAAS;EAAO,SAAU;CAMnE,IAAA,MAAQ;SAGmC,eAAA,QAAA,YAAA,oBAAA,sBAAA,UAAA;;EAEP,UAE3B;CAGT,CAAA,GAAA,CAAA,MAAQ,CAAA;SACN;EACA,mBAAA;EACA;EACA,GAAA;EACA;EACA,KAAA,aAAA,KAAA,MAAA,oBAAA,MAAA,MAAA,GAAA;EACA;EACF;CAEA;CACA,MAAA,cAAY,CAAA,CAAA,MAAc;CAE1B,YAAI,aACM,CAAA;KACN,WAAM,QAAA;EACN,MAAA;EACA,oBAAG;EACL,GAAA;CAGF;SAAuB,aAAA;EAAO;EAAW;EAAU,GAAA;CACnD,CAAA;SAAgC,sBAAA;EAAO;EAAyB,WAAG,CAAA;EAAO,GAAA;CAE1E,CAAA;CAEJ,OAAA;;;;;;;;;;;;;;;;;;;;;MAuBE,WAAO,WAAc,SADH,SAAY,OACS;CACxC,OAAA,cAAA,SAAA,YAAA,KAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import { i as MenuStoreProps, o as MenuStoreValues } from "../menu-store-0CKKmNek.js";
1
+ import { i as MenuStoreProps, o as MenuStoreValues } from "../menu-store-BpTJdcL8.js";
2
2
  import { ReactElement, ReactNode } from "react";
3
3
  import { PickRequired } from "@ariakit/utils";
4
4