@ariakit/react-core 0.3.10 → 0.3.12

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 (292) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/cjs/__chunks/{SANV4XBF.cjs → 23HLSVKM.cjs} +2 -2
  3. package/cjs/__chunks/{GF6NWLKX.cjs → 3XQOWQTT.cjs} +12 -8
  4. package/cjs/__chunks/{Y22E2GCT.cjs → 4VMHQGZH.cjs} +6 -6
  5. package/cjs/__chunks/{T5G6DLC6.cjs → 6LVRCU4J.cjs} +2 -2
  6. package/cjs/__chunks/{FQZOOWMH.cjs → 6PUZ4NWR.cjs} +2 -2
  7. package/cjs/__chunks/{RV3PHHWM.cjs → 6ZZYUFPW.cjs} +1 -1
  8. package/cjs/__chunks/{2GETDAIQ.cjs → 7HJPL3H2.cjs} +5 -5
  9. package/cjs/__chunks/{KQUC6RXT.cjs → BBS4RP44.cjs} +2 -2
  10. package/cjs/__chunks/{DKOWT2IJ.cjs → CDNJPIEG.cjs} +3 -3
  11. package/cjs/__chunks/{47RLIVET.cjs → CFKRWKZR.cjs} +10 -10
  12. package/cjs/__chunks/{V6LYK7WK.cjs → CGIHR7QS.cjs} +7 -7
  13. package/cjs/__chunks/{LO3RECOD.cjs → D4TG5DM4.cjs} +2 -2
  14. package/cjs/__chunks/{36QK2QLE.cjs → EKB76T2U.cjs} +9 -9
  15. package/cjs/__chunks/{7KFYPSJO.cjs → EUHOCOY2.cjs} +4 -4
  16. package/cjs/__chunks/{PHZJAGWK.cjs → G2ZXRZ2R.cjs} +4 -4
  17. package/cjs/__chunks/{CZOBQEIO.cjs → H6OLBVHA.cjs} +33 -40
  18. package/cjs/__chunks/{TTMCZ7ZN.cjs → IO6J4PAN.cjs} +28 -13
  19. package/cjs/__chunks/{EGAIDKB5.cjs → JAQJG42R.cjs} +5 -5
  20. package/cjs/__chunks/{VQJ44BSY.cjs → JQS6X2I5.cjs} +4 -4
  21. package/cjs/__chunks/{NVHGMKAE.cjs → KDG57VZV.cjs} +3 -3
  22. package/cjs/__chunks/{IGTX5NFA.cjs → KIDFNQ4E.cjs} +4 -4
  23. package/cjs/__chunks/{N6CR2VNN.cjs → LUL2YWZ3.cjs} +12 -12
  24. package/cjs/__chunks/{NVRUQ5V7.cjs → LY6FB2NE.cjs} +7 -7
  25. package/cjs/__chunks/{DHSZ2ZFJ.cjs → NNINKJTT.cjs} +4 -4
  26. package/cjs/__chunks/{PSR537T6.cjs → NONPPWSF.cjs} +8 -8
  27. package/cjs/__chunks/{7BPAESN3.cjs → NRGWVSB5.cjs} +5 -5
  28. package/cjs/__chunks/{QLRXXIBY.cjs → ODJ76C5W.cjs} +7 -7
  29. package/cjs/__chunks/{B233QVZE.cjs → OLOZ5JT2.cjs} +0 -5
  30. package/cjs/__chunks/{XDTEICF5.cjs → OZ4FTKEH.cjs} +7 -7
  31. package/cjs/__chunks/{3KZQJDTV.cjs → RNGIWUQW.cjs} +4 -4
  32. package/cjs/__chunks/{VQHA56HB.cjs → T7WLYFYV.cjs} +2 -2
  33. package/cjs/__chunks/{EWKBICMP.cjs → VKHTDADA.cjs} +5 -5
  34. package/cjs/__chunks/{VSDH37LI.cjs → VPQQSYH7.cjs} +3 -3
  35. package/cjs/__chunks/{HRKRTCJC.cjs → W5LJEMLB.cjs} +4 -4
  36. package/cjs/__chunks/{RTT4XR27.cjs → WZ3DRKGP.cjs} +4 -4
  37. package/cjs/__chunks/{UUTXBBHD.cjs → XA62Y24Z.cjs} +6 -6
  38. package/cjs/__chunks/{FM5S6RAD.cjs → XW252ITL.cjs} +2 -2
  39. package/cjs/__chunks/{TD5MOASJ.cjs → YPVQYY4J.cjs} +2 -2
  40. package/cjs/__chunks/{UBME4GBY.cjs → ZWICHV7O.cjs} +10 -10
  41. package/cjs/checkbox/checkbox-check.d.cts +6 -3
  42. package/cjs/checkbox/checkbox-check.d.ts +6 -3
  43. package/cjs/checkbox/checkbox-provider.cjs +3 -3
  44. package/cjs/checkbox/checkbox-store.cjs +3 -3
  45. package/cjs/checkbox/checkbox.cjs +3 -3
  46. package/cjs/collection/collection-item.d.cts +9 -2
  47. package/cjs/collection/collection-item.d.ts +9 -2
  48. package/cjs/collection/collection-provider.cjs +3 -3
  49. package/cjs/collection/collection-renderer.cjs +3 -3
  50. package/cjs/collection/collection-store.cjs +3 -3
  51. package/cjs/combobox/combobox-disclosure.cjs +3 -4
  52. package/cjs/combobox/combobox-item.cjs +4 -4
  53. package/cjs/combobox/combobox-item.d.cts +13 -1
  54. package/cjs/combobox/combobox-item.d.ts +13 -1
  55. package/cjs/combobox/combobox-list.cjs +4 -4
  56. package/cjs/combobox/combobox-popover.cjs +45 -16
  57. package/cjs/combobox/combobox-popover.d.cts +1 -1
  58. package/cjs/combobox/combobox-popover.d.ts +1 -1
  59. package/cjs/combobox/combobox-provider.cjs +8 -8
  60. package/cjs/combobox/combobox-store.cjs +8 -8
  61. package/cjs/combobox/combobox.cjs +25 -11
  62. package/cjs/combobox/combobox.d.cts +29 -1
  63. package/cjs/combobox/combobox.d.ts +29 -1
  64. package/cjs/composite/composite-container.cjs +4 -4
  65. package/cjs/composite/composite-hover.d.cts +12 -1
  66. package/cjs/composite/composite-hover.d.ts +12 -1
  67. package/cjs/composite/composite-input.cjs +3 -3
  68. package/cjs/composite/composite-item.cjs +4 -4
  69. package/cjs/composite/composite-overflow-disclosure.cjs +4 -4
  70. package/cjs/composite/composite-overflow-store.cjs +6 -6
  71. package/cjs/composite/composite-overflow.cjs +8 -8
  72. package/cjs/composite/composite-provider.cjs +4 -4
  73. package/cjs/composite/composite-renderer.cjs +4 -4
  74. package/cjs/composite/composite-store.cjs +4 -4
  75. package/cjs/composite/composite-store.d.cts +6 -5
  76. package/cjs/composite/composite-store.d.ts +6 -5
  77. package/cjs/composite/composite-typeahead.cjs +3 -3
  78. package/cjs/composite/composite.cjs +3 -3
  79. package/cjs/composite/utils.cjs +2 -2
  80. package/cjs/dialog/dialog-backdrop.cjs +5 -5
  81. package/cjs/dialog/dialog-provider.cjs +4 -4
  82. package/cjs/dialog/dialog-store.cjs +4 -4
  83. package/cjs/dialog/dialog.cjs +7 -7
  84. package/cjs/dialog/dialog.d.cts +1 -0
  85. package/cjs/dialog/dialog.d.ts +1 -0
  86. package/cjs/disclosure/disclosure-content.cjs +3 -3
  87. package/cjs/disclosure/disclosure-provider.cjs +3 -3
  88. package/cjs/disclosure/disclosure-store.cjs +3 -3
  89. package/cjs/disclosure/disclosure-store.d.cts +3 -3
  90. package/cjs/disclosure/disclosure-store.d.ts +3 -3
  91. package/cjs/focusable/focusable.d.cts +7 -0
  92. package/cjs/focusable/focusable.d.ts +7 -0
  93. package/cjs/form/form-checkbox.cjs +5 -5
  94. package/cjs/form/form-provider.cjs +4 -4
  95. package/cjs/form/form-radio.cjs +5 -5
  96. package/cjs/form/form-store.cjs +4 -4
  97. package/cjs/hovercard/hovercard-provider.cjs +6 -6
  98. package/cjs/hovercard/hovercard-store.cjs +6 -6
  99. package/cjs/hovercard/hovercard.cjs +9 -9
  100. package/cjs/menu/menu-bar-provider.cjs +6 -6
  101. package/cjs/menu/menu-bar-store.cjs +6 -6
  102. package/cjs/menu/menu-bar.cjs +8 -8
  103. package/cjs/menu/menu-button.cjs +5 -5
  104. package/cjs/menu/menu-item-check.d.cts +14 -0
  105. package/cjs/menu/menu-item-check.d.ts +14 -0
  106. package/cjs/menu/menu-item-checkbox.cjs +9 -9
  107. package/cjs/menu/menu-item-radio.cjs +7 -7
  108. package/cjs/menu/menu-item.cjs +5 -5
  109. package/cjs/menu/menu-item.d.cts +8 -1
  110. package/cjs/menu/menu-item.d.ts +8 -1
  111. package/cjs/menu/menu-list.cjs +7 -7
  112. package/cjs/menu/menu-provider.cjs +9 -9
  113. package/cjs/menu/menu-store.cjs +9 -9
  114. package/cjs/menu/menu-store.d.cts +2 -0
  115. package/cjs/menu/menu-store.d.ts +2 -0
  116. package/cjs/menu/menu.cjs +17 -17
  117. package/cjs/menubar/menubar-provider.cjs +6 -6
  118. package/cjs/menubar/menubar-store.cjs +5 -5
  119. package/cjs/menubar/menubar.cjs +8 -8
  120. package/cjs/popover/popover-provider.cjs +5 -5
  121. package/cjs/popover/popover-store.cjs +5 -5
  122. package/cjs/popover/popover.cjs +8 -8
  123. package/cjs/popover/popover.d.cts +2 -0
  124. package/cjs/popover/popover.d.ts +2 -0
  125. package/cjs/radio/radio-group.cjs +3 -3
  126. package/cjs/radio/radio-provider.cjs +5 -5
  127. package/cjs/radio/radio-store.cjs +5 -5
  128. package/cjs/radio/radio.cjs +5 -5
  129. package/cjs/select/select-item.cjs +4 -4
  130. package/cjs/select/select-list.cjs +7 -7
  131. package/cjs/select/select-popover.cjs +14 -14
  132. package/cjs/select/select-provider.cjs +8 -8
  133. package/cjs/select/select-renderer.cjs +7 -7
  134. package/cjs/select/select-store.cjs +8 -8
  135. package/cjs/select/select.cjs +4 -4
  136. package/cjs/tab/tab-list.cjs +3 -3
  137. package/cjs/tab/tab-panel.cjs +5 -5
  138. package/cjs/tab/tab-panel.d.cts +3 -2
  139. package/cjs/tab/tab-panel.d.ts +3 -2
  140. package/cjs/tab/tab-provider.cjs +5 -5
  141. package/cjs/tab/tab-store.cjs +5 -5
  142. package/cjs/tab/tab-store.d.cts +6 -2
  143. package/cjs/tab/tab-store.d.ts +6 -2
  144. package/cjs/tab/tab.cjs +4 -4
  145. package/cjs/toolbar/toolbar-container.cjs +7 -7
  146. package/cjs/toolbar/toolbar-input.cjs +7 -7
  147. package/cjs/toolbar/toolbar-item.cjs +5 -5
  148. package/cjs/toolbar/toolbar-provider.cjs +5 -5
  149. package/cjs/toolbar/toolbar-store.cjs +5 -5
  150. package/cjs/toolbar/toolbar.cjs +8 -8
  151. package/cjs/tooltip/tooltip-provider.cjs +7 -7
  152. package/cjs/tooltip/tooltip-store.cjs +7 -7
  153. package/cjs/tooltip/tooltip.cjs +10 -10
  154. package/cjs/utils/store.cjs +2 -2
  155. package/esm/__chunks/{IXZMWLUE.js → 2QMN5E6B.js} +2 -2
  156. package/esm/__chunks/{HBGJOTTX.js → 346FK57L.js} +1 -1
  157. package/esm/__chunks/{6H3EJNCE.js → 3AHQ6JCP.js} +1 -1
  158. package/esm/__chunks/{6QXBPV75.js → 3IEDWLST.js} +1 -1
  159. package/esm/__chunks/{GD2VG2KJ.js → 4HD64GHO.js} +1 -1
  160. package/esm/__chunks/{A6ER4BO6.js → 7GBW5FLS.js} +2 -2
  161. package/esm/__chunks/{UJUY6GAA.js → 7NHUGSTF.js} +1 -1
  162. package/esm/__chunks/{FHDXHZLB.js → 7QTPYGNZ.js} +20 -27
  163. package/esm/__chunks/{SXPADS2D.js → A6XC27R5.js} +1 -1
  164. package/esm/__chunks/{QUPVK46L.js → BPNXFCFY.js} +2 -2
  165. package/esm/__chunks/{KOKHD3Z3.js → CLE7NTOY.js} +1 -1
  166. package/esm/__chunks/{K5VQ2XTM.js → CQMDBRG5.js} +8 -4
  167. package/esm/__chunks/{4OZYHFMH.js → EKQEJRUF.js} +0 -5
  168. package/esm/__chunks/{WEU2EOWJ.js → EPBRINPG.js} +3 -3
  169. package/esm/__chunks/{DYLO4TTE.js → FMVHAVXA.js} +3 -3
  170. package/esm/__chunks/{DHHIMTTV.js → HHNFDKU2.js} +4 -4
  171. package/esm/__chunks/{FWQLUQ4T.js → HVBNG5AF.js} +2 -2
  172. package/esm/__chunks/{UP4ONTQS.js → I4Q3C2VT.js} +1 -1
  173. package/esm/__chunks/{VZOR43YE.js → IMEG7JN4.js} +2 -2
  174. package/esm/__chunks/{IIVLUKKG.js → JIZ5C2JK.js} +1 -1
  175. package/esm/__chunks/{GJYUMUMT.js → JL6IRDFK.js} +2 -2
  176. package/esm/__chunks/{6L5IUFNE.js → KSKI4NLV.js} +2 -2
  177. package/esm/__chunks/{QCIQ4F64.js → LEIRFLRL.js} +2 -2
  178. package/esm/__chunks/{57VLL43X.js → LWHPHW7Q.js} +2 -2
  179. package/esm/__chunks/{EENTNM7A.js → MG4P3223.js} +2 -2
  180. package/esm/__chunks/{PDVJHECS.js → PGAEII2Q.js} +4 -4
  181. package/esm/__chunks/{P6VCQ6Q3.js → QZLXIDNP.js} +17 -2
  182. package/esm/__chunks/{XCRWZKAW.js → RIL2SEAH.js} +1 -1
  183. package/esm/__chunks/{SMM5JVLC.js → SFCBA2JZ.js} +1 -1
  184. package/esm/__chunks/{5L7XBKAC.js → SS66VZAQ.js} +2 -2
  185. package/esm/__chunks/{UV2O3GRQ.js → SU2GU5JB.js} +3 -3
  186. package/esm/__chunks/{TZJDOU75.js → UK7JL7PY.js} +2 -2
  187. package/esm/__chunks/{NYD53BDE.js → XJXP7ZSQ.js} +3 -3
  188. package/esm/__chunks/{QEPSYGAQ.js → Y6467XPW.js} +2 -2
  189. package/esm/__chunks/{HDMIVTNE.js → Y6GYTNQ2.js} +1 -1
  190. package/esm/__chunks/{DKALGMO6.js → ZEXNX5JH.js} +1 -1
  191. package/esm/__chunks/{EZTAZGGV.js → ZKJ2WLF7.js} +3 -3
  192. package/esm/__chunks/{6SB7F42L.js → ZSELSBRM.js} +2 -2
  193. package/esm/__chunks/{A3PM2ZVJ.js → ZU7LQC5V.js} +2 -2
  194. package/esm/checkbox/checkbox-check.d.ts +6 -3
  195. package/esm/checkbox/checkbox-provider.js +2 -2
  196. package/esm/checkbox/checkbox-store.js +2 -2
  197. package/esm/checkbox/checkbox.js +2 -2
  198. package/esm/collection/collection-item.d.ts +9 -2
  199. package/esm/collection/collection-provider.js +2 -2
  200. package/esm/collection/collection-renderer.js +2 -2
  201. package/esm/collection/collection-store.js +2 -2
  202. package/esm/combobox/combobox-disclosure.js +3 -4
  203. package/esm/combobox/combobox-item.d.ts +13 -1
  204. package/esm/combobox/combobox-item.js +3 -3
  205. package/esm/combobox/combobox-list.js +3 -3
  206. package/esm/combobox/combobox-popover.d.ts +1 -1
  207. package/esm/combobox/combobox-popover.js +43 -14
  208. package/esm/combobox/combobox-provider.js +7 -7
  209. package/esm/combobox/combobox-store.js +7 -7
  210. package/esm/combobox/combobox.d.ts +29 -1
  211. package/esm/combobox/combobox.js +24 -10
  212. package/esm/composite/composite-container.js +3 -3
  213. package/esm/composite/composite-hover.d.ts +12 -1
  214. package/esm/composite/composite-input.js +2 -2
  215. package/esm/composite/composite-item.js +3 -3
  216. package/esm/composite/composite-overflow-disclosure.js +3 -3
  217. package/esm/composite/composite-overflow-store.js +4 -4
  218. package/esm/composite/composite-overflow.js +7 -7
  219. package/esm/composite/composite-provider.js +3 -3
  220. package/esm/composite/composite-renderer.js +3 -3
  221. package/esm/composite/composite-store.d.ts +6 -5
  222. package/esm/composite/composite-store.js +3 -3
  223. package/esm/composite/composite-typeahead.js +2 -2
  224. package/esm/composite/composite.js +2 -2
  225. package/esm/composite/utils.js +1 -1
  226. package/esm/dialog/dialog-backdrop.js +4 -4
  227. package/esm/dialog/dialog-provider.js +3 -3
  228. package/esm/dialog/dialog-store.js +3 -3
  229. package/esm/dialog/dialog.d.ts +1 -0
  230. package/esm/dialog/dialog.js +6 -6
  231. package/esm/disclosure/disclosure-content.js +2 -2
  232. package/esm/disclosure/disclosure-provider.js +2 -2
  233. package/esm/disclosure/disclosure-store.d.ts +3 -3
  234. package/esm/disclosure/disclosure-store.js +2 -2
  235. package/esm/focusable/focusable.d.ts +7 -0
  236. package/esm/form/form-checkbox.js +3 -3
  237. package/esm/form/form-provider.js +3 -3
  238. package/esm/form/form-radio.js +4 -4
  239. package/esm/form/form-store.js +3 -3
  240. package/esm/hovercard/hovercard-provider.js +5 -5
  241. package/esm/hovercard/hovercard-store.js +5 -5
  242. package/esm/hovercard/hovercard.js +8 -8
  243. package/esm/menu/menu-bar-provider.js +5 -5
  244. package/esm/menu/menu-bar-store.js +4 -4
  245. package/esm/menu/menu-bar.js +7 -7
  246. package/esm/menu/menu-button.js +3 -3
  247. package/esm/menu/menu-item-check.d.ts +14 -0
  248. package/esm/menu/menu-item-checkbox.js +6 -6
  249. package/esm/menu/menu-item-radio.js +5 -5
  250. package/esm/menu/menu-item.d.ts +8 -1
  251. package/esm/menu/menu-item.js +4 -4
  252. package/esm/menu/menu-list.js +6 -6
  253. package/esm/menu/menu-provider.js +8 -8
  254. package/esm/menu/menu-store.d.ts +2 -0
  255. package/esm/menu/menu-store.js +8 -8
  256. package/esm/menu/menu.js +12 -12
  257. package/esm/menubar/menubar-provider.js +5 -5
  258. package/esm/menubar/menubar-store.js +4 -4
  259. package/esm/menubar/menubar.js +7 -7
  260. package/esm/popover/popover-provider.js +4 -4
  261. package/esm/popover/popover-store.js +4 -4
  262. package/esm/popover/popover.d.ts +2 -0
  263. package/esm/popover/popover.js +7 -7
  264. package/esm/radio/radio-group.js +2 -2
  265. package/esm/radio/radio-provider.js +4 -4
  266. package/esm/radio/radio-store.js +4 -4
  267. package/esm/radio/radio.js +4 -4
  268. package/esm/select/select-item.js +3 -3
  269. package/esm/select/select-list.js +6 -6
  270. package/esm/select/select-popover.js +11 -11
  271. package/esm/select/select-provider.js +7 -7
  272. package/esm/select/select-renderer.js +3 -3
  273. package/esm/select/select-store.js +7 -7
  274. package/esm/select/select.js +3 -3
  275. package/esm/tab/tab-list.js +2 -2
  276. package/esm/tab/tab-panel.d.ts +3 -2
  277. package/esm/tab/tab-panel.js +3 -3
  278. package/esm/tab/tab-provider.js +4 -4
  279. package/esm/tab/tab-store.d.ts +6 -2
  280. package/esm/tab/tab-store.js +4 -4
  281. package/esm/tab/tab.js +3 -3
  282. package/esm/toolbar/toolbar-container.js +5 -5
  283. package/esm/toolbar/toolbar-input.js +5 -5
  284. package/esm/toolbar/toolbar-item.js +4 -4
  285. package/esm/toolbar/toolbar-provider.js +4 -4
  286. package/esm/toolbar/toolbar-store.js +4 -4
  287. package/esm/toolbar/toolbar.js +6 -6
  288. package/esm/tooltip/tooltip-provider.js +6 -6
  289. package/esm/tooltip/tooltip-store.js +6 -6
  290. package/esm/tooltip/tooltip.js +8 -8
  291. package/esm/utils/store.js +1 -1
  292. package/package.json +2 -2
@@ -9,10 +9,10 @@ var _IPYAEPOTcjs = require('../__chunks/IPYAEPOT.cjs');
9
9
  var _3WCBE6SUcjs = require('../__chunks/3WCBE6SU.cjs');
10
10
 
11
11
 
12
- var _TTMCZ7ZNcjs = require('../__chunks/TTMCZ7ZN.cjs');
12
+ var _IO6J4PANcjs = require('../__chunks/IO6J4PAN.cjs');
13
13
  require('../__chunks/DAJUUBUI.cjs');
14
14
  require('../__chunks/R5A2WTWB.cjs');
15
- require('../__chunks/RV3PHHWM.cjs');
15
+ require('../__chunks/6ZZYUFPW.cjs');
16
16
  require('../__chunks/UZNYSPKP.cjs');
17
17
  require('../__chunks/BZTDJIVT.cjs');
18
18
  require('../__chunks/UVBBMANL.cjs');
@@ -25,7 +25,7 @@ require('../__chunks/75KXQZJX.cjs');
25
25
 
26
26
 
27
27
  var _RNZNGEL4cjs = require('../__chunks/RNZNGEL4.cjs');
28
- require('../__chunks/B233QVZE.cjs');
28
+ require('../__chunks/OLOZ5JT2.cjs');
29
29
 
30
30
 
31
31
 
@@ -169,7 +169,7 @@ var useComboboxItem = _RNZNGEL4cjs.createHook.call(void 0,
169
169
  onKeyDown
170
170
  });
171
171
  const moveOnKeyPressProp = _EO6LS72Hcjs.useBooleanEvent.call(void 0, moveOnKeyPress);
172
- props = _TTMCZ7ZNcjs.useCompositeItem.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
172
+ props = _IO6J4PANcjs.useCompositeItem.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
173
173
  store
174
174
  }, props), {
175
175
  getItem,
@@ -56,6 +56,11 @@ export interface ComboboxItemOptions<T extends As = "div"> extends CompositeItem
56
56
  * [`setValueOnClick`](https://ariakit.org/reference/combobox-item#setvalueonclick)
57
57
  * is set to `true`, this will be the value of the combobox input when the
58
58
  * user clicks on this item.
59
+ * - If
60
+ * [`selectValueOnClick`](https://ariakit.org/reference/combobox-item#selectvalueonclick)
61
+ * is set to `true`, this will be the value of the
62
+ * [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
63
+ * state.
59
64
  * - If the
60
65
  * [`autoComplete`](https://ariakit.org/reference/combobox#autocomplete)
61
66
  * prop on the [`Combobox`](https://ariakit.org/reference/combobox)
@@ -88,7 +93,12 @@ export interface ComboboxItemOptions<T extends As = "div"> extends CompositeItem
88
93
  * [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
89
94
  * state using this item's
90
95
  * [`value`](https://ariakit.org/reference/combobox-item#value) when the item
91
- * is clicked.
96
+ * is clicked. If a callback is provided, it will only be invoked if the item
97
+ * has a value.
98
+ *
99
+ * Live examples:
100
+ * - [Submenu with
101
+ * Combobox](https://ariakit.org/examples/menu-nested-combobox)
92
102
  * @default true
93
103
  */
94
104
  selectValueOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
@@ -102,6 +112,8 @@ export interface ComboboxItemOptions<T extends As = "div"> extends CompositeItem
102
112
  *
103
113
  * Live examples:
104
114
  * - [Menu with Combobox](https://ariakit.org/examples/menu-combobox)
115
+ * - [Submenu with
116
+ * Combobox](https://ariakit.org/examples/menu-nested-combobox)
105
117
  */
106
118
  setValueOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
107
119
  /**
@@ -56,6 +56,11 @@ export interface ComboboxItemOptions<T extends As = "div"> extends CompositeItem
56
56
  * [`setValueOnClick`](https://ariakit.org/reference/combobox-item#setvalueonclick)
57
57
  * is set to `true`, this will be the value of the combobox input when the
58
58
  * user clicks on this item.
59
+ * - If
60
+ * [`selectValueOnClick`](https://ariakit.org/reference/combobox-item#selectvalueonclick)
61
+ * is set to `true`, this will be the value of the
62
+ * [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
63
+ * state.
59
64
  * - If the
60
65
  * [`autoComplete`](https://ariakit.org/reference/combobox#autocomplete)
61
66
  * prop on the [`Combobox`](https://ariakit.org/reference/combobox)
@@ -88,7 +93,12 @@ export interface ComboboxItemOptions<T extends As = "div"> extends CompositeItem
88
93
  * [`selectedValue`](https://ariakit.org/reference/combobox-provider#selectedvalue)
89
94
  * state using this item's
90
95
  * [`value`](https://ariakit.org/reference/combobox-item#value) when the item
91
- * is clicked.
96
+ * is clicked. If a callback is provided, it will only be invoked if the item
97
+ * has a value.
98
+ *
99
+ * Live examples:
100
+ * - [Submenu with
101
+ * Combobox](https://ariakit.org/examples/menu-nested-combobox)
92
102
  * @default true
93
103
  */
94
104
  selectValueOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
@@ -102,6 +112,8 @@ export interface ComboboxItemOptions<T extends As = "div"> extends CompositeItem
102
112
  *
103
113
  * Live examples:
104
114
  * - [Menu with Combobox](https://ariakit.org/examples/menu-combobox)
115
+ * - [Submenu with
116
+ * Combobox](https://ariakit.org/examples/menu-nested-combobox)
105
117
  */
106
118
  setValueOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
107
119
  /**
@@ -2,22 +2,22 @@
2
2
 
3
3
 
4
4
 
5
- var _LO3RECODcjs = require('../__chunks/LO3RECOD.cjs');
5
+ var _D4TG5DM4cjs = require('../__chunks/D4TG5DM4.cjs');
6
6
  require('../__chunks/3WCBE6SU.cjs');
7
7
  require('../__chunks/UZNYSPKP.cjs');
8
8
  require('../__chunks/BZTDJIVT.cjs');
9
- require('../__chunks/TD5MOASJ.cjs');
9
+ require('../__chunks/YPVQYY4J.cjs');
10
10
  require('../__chunks/UVBBMANL.cjs');
11
11
  require('../__chunks/F2A2ZQDB.cjs');
12
12
  require('../__chunks/S6UU7NA4.cjs');
13
13
  require('../__chunks/Z3GCTNW4.cjs');
14
14
  require('../__chunks/75KXQZJX.cjs');
15
15
  require('../__chunks/RNZNGEL4.cjs');
16
- require('../__chunks/B233QVZE.cjs');
16
+ require('../__chunks/OLOZ5JT2.cjs');
17
17
  require('../__chunks/EO6LS72H.cjs');
18
18
  require('../__chunks/CJDHQUBR.cjs');
19
19
  require('../__chunks/AV6KTKLE.cjs');
20
20
 
21
21
 
22
22
 
23
- exports.ComboboxList = _LO3RECODcjs.ComboboxList; exports.useComboboxList = _LO3RECODcjs.useComboboxList;
23
+ exports.ComboboxList = _D4TG5DM4cjs.ComboboxList; exports.useComboboxList = _D4TG5DM4cjs.useComboboxList;
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _LO3RECODcjs = require('../__chunks/LO3RECOD.cjs');
4
+ var _D4TG5DM4cjs = require('../__chunks/D4TG5DM4.cjs');
5
5
 
6
6
 
7
7
  var _3WCBE6SUcjs = require('../__chunks/3WCBE6SU.cjs');
@@ -9,11 +9,11 @@ require('../__chunks/UZNYSPKP.cjs');
9
9
  require('../__chunks/BZTDJIVT.cjs');
10
10
 
11
11
 
12
- var _NVHGMKAEcjs = require('../__chunks/NVHGMKAE.cjs');
12
+ var _KDG57VZVcjs = require('../__chunks/KDG57VZV.cjs');
13
13
 
14
14
 
15
- var _36QK2QLEcjs = require('../__chunks/36QK2QLE.cjs');
16
- require('../__chunks/RTT4XR27.cjs');
15
+ var _EKB76T2Ucjs = require('../__chunks/EKB76T2U.cjs');
16
+ require('../__chunks/WZ3DRKGP.cjs');
17
17
  require('../__chunks/NKR65BKC.cjs');
18
18
  require('../__chunks/PZL34OVO.cjs');
19
19
  require('../__chunks/344F3DYO.cjs');
@@ -34,7 +34,7 @@ require('../__chunks/XB3G2EO2.cjs');
34
34
  require('../__chunks/CVD2AZE2.cjs');
35
35
  require('../__chunks/2BIO7R5N.cjs');
36
36
  require('../__chunks/LAUATD5O.cjs');
37
- require('../__chunks/TD5MOASJ.cjs');
37
+ require('../__chunks/YPVQYY4J.cjs');
38
38
  require('../__chunks/UVBBMANL.cjs');
39
39
  require('../__chunks/F2A2ZQDB.cjs');
40
40
  require('../__chunks/S6UU7NA4.cjs');
@@ -46,9 +46,9 @@ require('../__chunks/R66IWXK6.cjs');
46
46
 
47
47
 
48
48
  var _RNZNGEL4cjs = require('../__chunks/RNZNGEL4.cjs');
49
- require('../__chunks/HRKRTCJC.cjs');
50
- require('../__chunks/EGAIDKB5.cjs');
51
- require('../__chunks/B233QVZE.cjs');
49
+ require('../__chunks/W5LJEMLB.cjs');
50
+ require('../__chunks/JAQJG42R.cjs');
51
+ require('../__chunks/OLOZ5JT2.cjs');
52
52
  require('../__chunks/EO6LS72H.cjs');
53
53
  require('../__chunks/CJDHQUBR.cjs');
54
54
 
@@ -64,7 +64,7 @@ function isController(target, ...ids) {
64
64
  if (!target)
65
65
  return false;
66
66
  if ("id" in target) {
67
- const selector = ids.filter(Boolean).map((id) => `[aria-controls="${id}"]`).join(", ");
67
+ const selector = ids.filter(Boolean).map((id) => `[aria-controls~="${id}"]`).join(", ");
68
68
  if (!selector)
69
69
  return false;
70
70
  return _dom.matches.call(void 0, target, selector);
@@ -75,11 +75,13 @@ var useComboboxPopover = _RNZNGEL4cjs.createHook.call(void 0,
75
75
  (_a) => {
76
76
  var _b = _a, {
77
77
  store,
78
+ modal,
78
79
  tabIndex,
79
80
  alwaysVisible,
80
81
  hideOnInteractOutside = true
81
82
  } = _b, props = _AV6KTKLEcjs.__objRest.call(void 0, _b, [
82
83
  "store",
84
+ "modal",
83
85
  "tabIndex",
84
86
  "alwaysVisible",
85
87
  "hideOnInteractOutside"
@@ -91,23 +93,50 @@ var useComboboxPopover = _RNZNGEL4cjs.createHook.call(void 0,
91
93
  process.env.NODE_ENV !== "production" && "ComboboxPopover must receive a `store` prop or be wrapped in a ComboboxProvider component."
92
94
  );
93
95
  const baseElement = store.useState("baseElement");
94
- props = _LO3RECODcjs.useComboboxList.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store, alwaysVisible }, props));
95
- props = _NVHGMKAEcjs.usePopover.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
96
+ props = _D4TG5DM4cjs.useComboboxList.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, { store, alwaysVisible }, props));
97
+ props = _KDG57VZVcjs.usePopover.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
96
98
  store,
99
+ modal,
97
100
  alwaysVisible,
101
+ backdrop: false,
98
102
  autoFocusOnShow: false,
99
103
  autoFocusOnHide: false,
100
104
  finalFocus: baseElement,
101
105
  preserveTabOrderAnchor: null
102
106
  }, props), {
103
- // Combobox popovers can't be modal because the focus may be (and is by
104
- // default) outside of it on the combobox input element.
105
- modal: false,
107
+ // When the combobox popover is modal, we make sure to include the
108
+ // combobox input and all the combobox controls (cancel, disclosure) in
109
+ // the list of persistent elements so they make part of the modal context,
110
+ // allowing users to tab through them.
111
+ getPersistentElements() {
112
+ var _a2;
113
+ const elements = ((_a2 = props.getPersistentElements) == null ? void 0 : _a2.call(props)) || [];
114
+ if (!modal)
115
+ return elements;
116
+ if (!store)
117
+ return elements;
118
+ const { contentElement, baseElement: baseElement2 } = store.getState();
119
+ if (!baseElement2)
120
+ return elements;
121
+ const doc = _dom.getDocument.call(void 0, baseElement2);
122
+ const selectors = [];
123
+ if (contentElement == null ? void 0 : contentElement.id) {
124
+ selectors.push(`[aria-controls~="${contentElement.id}"]`);
125
+ }
126
+ if (baseElement2 == null ? void 0 : baseElement2.id) {
127
+ selectors.push(`[aria-controls~="${baseElement2.id}"]`);
128
+ }
129
+ if (!selectors.length)
130
+ return [...elements, baseElement2];
131
+ const selector = selectors.join(",");
132
+ const controlElements = doc.querySelectorAll(selector);
133
+ return [...elements, ...controlElements];
134
+ },
106
135
  // Make sure we don't hide the popover when the user interacts with the
107
136
  // combobox cancel or the combobox disclosure buttons. They will have the
108
137
  // aria-controls attribute pointing to either the combobox input or the
109
138
  // combobox popover elements.
110
- hideOnInteractOutside: (event) => {
139
+ hideOnInteractOutside(event) {
111
140
  var _a2, _b2;
112
141
  const state = store == null ? void 0 : store.getState();
113
142
  const contentId = (_a2 = state == null ? void 0 : state.contentElement) == null ? void 0 : _a2.id;
@@ -121,7 +150,7 @@ var useComboboxPopover = _RNZNGEL4cjs.createHook.call(void 0,
121
150
  return props;
122
151
  }
123
152
  );
124
- var ComboboxPopover = _36QK2QLEcjs.createDialogComponent.call(void 0,
153
+ var ComboboxPopover = _EKB76T2Ucjs.createDialogComponent.call(void 0,
125
154
  _RNZNGEL4cjs.createComponent.call(void 0, (props) => {
126
155
  const htmlProps = useComboboxPopover(props);
127
156
  return _RNZNGEL4cjs.createElement.call(void 0, "div", htmlProps);
@@ -35,6 +35,6 @@ export declare const useComboboxPopover: import("../utils/types.js").Hook<Combob
35
35
  * ```
36
36
  */
37
37
  export declare const ComboboxPopover: import("../utils/types.js").Component<ComboboxPopoverOptions<"div">>;
38
- export interface ComboboxPopoverOptions<T extends As = "div"> extends ComboboxListOptions<T>, Omit<PopoverOptions<T>, "store" | "modal"> {
38
+ export interface ComboboxPopoverOptions<T extends As = "div"> extends ComboboxListOptions<T>, Omit<PopoverOptions<T>, "store"> {
39
39
  }
40
40
  export type ComboboxPopoverProps<T extends As = "div"> = Props<ComboboxPopoverOptions<T>>;
@@ -35,6 +35,6 @@ export declare const useComboboxPopover: import("../utils/types.js").Hook<Combob
35
35
  * ```
36
36
  */
37
37
  export declare const ComboboxPopover: import("../utils/types.js").Component<ComboboxPopoverOptions<"div">>;
38
- export interface ComboboxPopoverOptions<T extends As = "div"> extends ComboboxListOptions<T>, Omit<PopoverOptions<T>, "store" | "modal"> {
38
+ export interface ComboboxPopoverOptions<T extends As = "div"> extends ComboboxListOptions<T>, Omit<PopoverOptions<T>, "store"> {
39
39
  }
40
40
  export type ComboboxPopoverProps<T extends As = "div"> = Props<ComboboxPopoverOptions<T>>;
@@ -1,22 +1,22 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _47RLIVETcjs = require('../__chunks/47RLIVET.cjs');
4
+ var _CFKRWKZRcjs = require('../__chunks/CFKRWKZR.cjs');
5
5
 
6
6
 
7
7
  var _3WCBE6SUcjs = require('../__chunks/3WCBE6SU.cjs');
8
- require('../__chunks/N6CR2VNN.cjs');
9
- require('../__chunks/DKOWT2IJ.cjs');
8
+ require('../__chunks/LUL2YWZ3.cjs');
9
+ require('../__chunks/CDNJPIEG.cjs');
10
10
  require('../__chunks/UZNYSPKP.cjs');
11
11
  require('../__chunks/BZTDJIVT.cjs');
12
12
  require('../__chunks/UVBBMANL.cjs');
13
13
  require('../__chunks/F2A2ZQDB.cjs');
14
14
  require('../__chunks/S6UU7NA4.cjs');
15
15
  require('../__chunks/RNZNGEL4.cjs');
16
- require('../__chunks/7BPAESN3.cjs');
17
- require('../__chunks/HRKRTCJC.cjs');
18
- require('../__chunks/EGAIDKB5.cjs');
19
- require('../__chunks/B233QVZE.cjs');
16
+ require('../__chunks/NRGWVSB5.cjs');
17
+ require('../__chunks/W5LJEMLB.cjs');
18
+ require('../__chunks/JAQJG42R.cjs');
19
+ require('../__chunks/OLOZ5JT2.cjs');
20
20
  require('../__chunks/EO6LS72H.cjs');
21
21
  require('../__chunks/CJDHQUBR.cjs');
22
22
  require('../__chunks/AV6KTKLE.cjs');
@@ -24,7 +24,7 @@ require('../__chunks/AV6KTKLE.cjs');
24
24
  // src/combobox/combobox-provider.tsx
25
25
  var _jsxruntime = require('react/jsx-runtime');
26
26
  function ComboboxProvider(props = {}) {
27
- const store = _47RLIVETcjs.useComboboxStore.call(void 0, props);
27
+ const store = _CFKRWKZRcjs.useComboboxStore.call(void 0, props);
28
28
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _3WCBE6SUcjs.ComboboxContextProvider, { value: store, children: props.children });
29
29
  }
30
30
 
@@ -2,17 +2,17 @@
2
2
 
3
3
 
4
4
 
5
- var _47RLIVETcjs = require('../__chunks/47RLIVET.cjs');
6
- require('../__chunks/N6CR2VNN.cjs');
7
- require('../__chunks/DKOWT2IJ.cjs');
8
- require('../__chunks/7BPAESN3.cjs');
9
- require('../__chunks/HRKRTCJC.cjs');
10
- require('../__chunks/EGAIDKB5.cjs');
11
- require('../__chunks/B233QVZE.cjs');
5
+ var _CFKRWKZRcjs = require('../__chunks/CFKRWKZR.cjs');
6
+ require('../__chunks/LUL2YWZ3.cjs');
7
+ require('../__chunks/CDNJPIEG.cjs');
8
+ require('../__chunks/NRGWVSB5.cjs');
9
+ require('../__chunks/W5LJEMLB.cjs');
10
+ require('../__chunks/JAQJG42R.cjs');
11
+ require('../__chunks/OLOZ5JT2.cjs');
12
12
  require('../__chunks/EO6LS72H.cjs');
13
13
  require('../__chunks/CJDHQUBR.cjs');
14
14
  require('../__chunks/AV6KTKLE.cjs');
15
15
 
16
16
 
17
17
 
18
- exports.useComboboxStore = _47RLIVETcjs.useComboboxStore; exports.useComboboxStoreProps = _47RLIVETcjs.useComboboxStoreProps;
18
+ exports.useComboboxStore = _CFKRWKZRcjs.useComboboxStore; exports.useComboboxStoreProps = _CFKRWKZRcjs.useComboboxStoreProps;
@@ -7,8 +7,8 @@ var _3QW6ELTGcjs = require('../__chunks/3QW6ELTG.cjs');
7
7
  var _3WCBE6SUcjs = require('../__chunks/3WCBE6SU.cjs');
8
8
 
9
9
 
10
- var _CZOBQEIOcjs = require('../__chunks/CZOBQEIO.cjs');
11
- require('../__chunks/RV3PHHWM.cjs');
10
+ var _H6OLBVHAcjs = require('../__chunks/H6OLBVHA.cjs');
11
+ require('../__chunks/6ZZYUFPW.cjs');
12
12
  require('../__chunks/UZNYSPKP.cjs');
13
13
  require('../__chunks/BZTDJIVT.cjs');
14
14
  require('../__chunks/UVBBMANL.cjs');
@@ -82,6 +82,7 @@ var useCombobox = _RNZNGEL4cjs.createHook.call(void 0,
82
82
  store,
83
83
  focusable = true,
84
84
  autoSelect: autoSelectProp = false,
85
+ getAutoSelectId,
85
86
  showOnChange = true,
86
87
  setValueOnChange = true,
87
88
  showOnMouseDown = true,
@@ -93,6 +94,7 @@ var useCombobox = _RNZNGEL4cjs.createHook.call(void 0,
93
94
  "store",
94
95
  "focusable",
95
96
  "autoSelect",
97
+ "getAutoSelectId",
96
98
  "showOnChange",
97
99
  "setValueOnChange",
98
100
  "showOnMouseDown",
@@ -189,6 +191,8 @@ var useCombobox = _RNZNGEL4cjs.createHook.call(void 0,
189
191
  storeValue
190
192
  ]);
191
193
  const scrollingElementRef = _react.useRef.call(void 0, null);
194
+ const getAutoSelectIdProp = _EO6LS72Hcjs.useEvent.call(void 0, getAutoSelectId);
195
+ const autoSelectIdRef = _react.useRef.call(void 0, null);
192
196
  _react.useEffect.call(void 0, () => {
193
197
  if (!open)
194
198
  return;
@@ -204,10 +208,12 @@ var useCombobox = _RNZNGEL4cjs.createHook.call(void 0,
204
208
  const onScroll = () => {
205
209
  if (!store)
206
210
  return;
211
+ if (!canAutoSelectRef.current)
212
+ return;
207
213
  const { activeId } = store.getState();
208
214
  if (activeId === null)
209
215
  return;
210
- if (activeId === store.first())
216
+ if (activeId === autoSelectIdRef.current)
211
217
  return;
212
218
  canAutoSelectRef.current = false;
213
219
  };
@@ -233,12 +239,11 @@ var useCombobox = _RNZNGEL4cjs.createHook.call(void 0,
233
239
  }, [open]);
234
240
  const resetValueOnSelect = store.useState("resetValueOnSelect");
235
241
  _EO6LS72Hcjs.useUpdateEffect.call(void 0, () => {
236
- var _a2, _b2;
242
+ var _a2;
243
+ const canAutoSelect = canAutoSelectRef.current;
237
244
  if (!store)
238
245
  return;
239
- if (!autoSelect && !resetValueOnSelect)
240
- return;
241
- if (!canAutoSelectRef.current)
246
+ if ((!autoSelect || !canAutoSelect) && !resetValueOnSelect)
242
247
  return;
243
248
  const { baseElement, contentElement: contentElement2, activeId } = store.getState();
244
249
  if (baseElement && !_focus.hasFocus.call(void 0, baseElement))
@@ -248,10 +253,13 @@ var useCombobox = _RNZNGEL4cjs.createHook.call(void 0,
248
253
  observer.observe(contentElement2, { attributeFilter: ["data-placing"] });
249
254
  return () => observer.disconnect();
250
255
  }
251
- if (autoSelect) {
252
- store.move((_a2 = store.first()) != null ? _a2 : null);
256
+ if (autoSelect && canAutoSelect) {
257
+ const userAutoSelectId = getAutoSelectIdProp(items);
258
+ const autoSelectId = userAutoSelectId !== void 0 ? userAutoSelectId : store.first();
259
+ autoSelectIdRef.current = autoSelectId;
260
+ store.move(autoSelectId != null ? autoSelectId : null);
253
261
  } else {
254
- const element = (_b2 = store.item(activeId)) == null ? void 0 : _b2.element;
262
+ const element = (_a2 = store.item(activeId)) == null ? void 0 : _a2.element;
255
263
  if (element && "scrollIntoView" in element) {
256
264
  element.scrollIntoView({ block: "nearest", inline: "nearest" });
257
265
  }
@@ -263,6 +271,7 @@ var useCombobox = _RNZNGEL4cjs.createHook.call(void 0,
263
271
  storeValue,
264
272
  autoSelect,
265
273
  resetValueOnSelect,
274
+ getAutoSelectIdProp,
266
275
  items
267
276
  ]);
268
277
  _react.useEffect.call(void 0, () => {
@@ -361,6 +370,9 @@ var useCombobox = _RNZNGEL4cjs.createHook.call(void 0,
361
370
  const onKeyDown = _EO6LS72Hcjs.useEvent.call(void 0,
362
371
  (event) => {
363
372
  onKeyDownProp == null ? void 0 : onKeyDownProp(event);
373
+ if (!event.repeat) {
374
+ canAutoSelectRef.current = false;
375
+ }
364
376
  if (event.defaultPrevented)
365
377
  return;
366
378
  if (event.ctrlKey)
@@ -395,6 +407,7 @@ var useCombobox = _RNZNGEL4cjs.createHook.call(void 0,
395
407
  });
396
408
  const id = _EO6LS72Hcjs.useId.call(void 0, props.id);
397
409
  const ariaAutoComplete = isAriaAutoCompleteValue(autoComplete) ? autoComplete : void 0;
410
+ const isActiveItem = store.useState((state) => state.activeId === null);
398
411
  props = _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
399
412
  id,
400
413
  role: "combobox",
@@ -402,6 +415,7 @@ var useCombobox = _RNZNGEL4cjs.createHook.call(void 0,
402
415
  "aria-haspopup": _dom.getPopupRole.call(void 0, contentElement, "listbox"),
403
416
  "aria-expanded": open,
404
417
  "aria-controls": contentElement == null ? void 0 : contentElement.id,
418
+ "data-active-item": isActiveItem || void 0,
405
419
  value
406
420
  }, props), {
407
421
  ref: _EO6LS72Hcjs.useMergeRefs.call(void 0, ref, props.ref),
@@ -411,7 +425,7 @@ var useCombobox = _RNZNGEL4cjs.createHook.call(void 0,
411
425
  onKeyDown,
412
426
  onBlur
413
427
  });
414
- props = _CZOBQEIOcjs.useComposite.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
428
+ props = _H6OLBVHAcjs.useComposite.call(void 0, _AV6KTKLEcjs.__spreadProps.call(void 0, _AV6KTKLEcjs.__spreadValues.call(void 0, {
415
429
  store,
416
430
  focusable
417
431
  }, props), {
@@ -3,7 +3,7 @@ import type { BooleanOrCallback, StringWithValue } from "@ariakit/core/utils/typ
3
3
  import type { CompositeOptions } from "../composite/composite.js";
4
4
  import type { PopoverAnchorOptions } from "../popover/popover-anchor.js";
5
5
  import type { As, Props } from "../utils/types.js";
6
- import type { ComboboxStore } from "./combobox-store.js";
6
+ import type { ComboboxStore, ComboboxStoreState } from "./combobox-store.js";
7
7
  /**
8
8
  * Returns props to create a `Combobox` component.
9
9
  * @see https://ariakit.org/components/combobox
@@ -70,6 +70,34 @@ export interface ComboboxOptions<T extends As = "input"> extends CompositeOption
70
70
  * @default false
71
71
  */
72
72
  autoSelect?: boolean;
73
+ /**
74
+ * Function that takes the currently rendered items and returns the id of the
75
+ * item to be auto selected when the
76
+ * [`autoSelect`](https://ariakit.org/reference/combobox#autoselect) prop is
77
+ * `true`.
78
+ *
79
+ * By default, the first enabled item is auto selected. This function is handy
80
+ * if you prefer a different item to be auto selected.
81
+ *
82
+ * Live examples:
83
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
84
+ * @example
85
+ * ```jsx
86
+ * <Combobox
87
+ * autoSelect
88
+ * getAutoSelectId={(items) => {
89
+ * // Auto select the first enabled item with a value
90
+ * const item = items.find((item) => {
91
+ * if (item.disabled) return false;
92
+ * if (!item.value) return false;
93
+ * return true;
94
+ * });
95
+ * return item?.id;
96
+ * }}
97
+ * />
98
+ * ```
99
+ */
100
+ getAutoSelectId?: (renderedItems: ComboboxStoreState["renderedItems"]) => string | null | undefined;
73
101
  /**
74
102
  * Whether the items will be filtered based on
75
103
  * [`value`](https://ariakit.org/reference/combobox-provider#value) and
@@ -3,7 +3,7 @@ import type { BooleanOrCallback, StringWithValue } from "@ariakit/core/utils/typ
3
3
  import type { CompositeOptions } from "../composite/composite.js";
4
4
  import type { PopoverAnchorOptions } from "../popover/popover-anchor.js";
5
5
  import type { As, Props } from "../utils/types.js";
6
- import type { ComboboxStore } from "./combobox-store.js";
6
+ import type { ComboboxStore, ComboboxStoreState } from "./combobox-store.js";
7
7
  /**
8
8
  * Returns props to create a `Combobox` component.
9
9
  * @see https://ariakit.org/components/combobox
@@ -70,6 +70,34 @@ export interface ComboboxOptions<T extends As = "input"> extends CompositeOption
70
70
  * @default false
71
71
  */
72
72
  autoSelect?: boolean;
73
+ /**
74
+ * Function that takes the currently rendered items and returns the id of the
75
+ * item to be auto selected when the
76
+ * [`autoSelect`](https://ariakit.org/reference/combobox#autoselect) prop is
77
+ * `true`.
78
+ *
79
+ * By default, the first enabled item is auto selected. This function is handy
80
+ * if you prefer a different item to be auto selected.
81
+ *
82
+ * Live examples:
83
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
84
+ * @example
85
+ * ```jsx
86
+ * <Combobox
87
+ * autoSelect
88
+ * getAutoSelectId={(items) => {
89
+ * // Auto select the first enabled item with a value
90
+ * const item = items.find((item) => {
91
+ * if (item.disabled) return false;
92
+ * if (!item.value) return false;
93
+ * return true;
94
+ * });
95
+ * return item?.id;
96
+ * }}
97
+ * />
98
+ * ```
99
+ */
100
+ getAutoSelectId?: (renderedItems: ComboboxStoreState["renderedItems"]) => string | null | undefined;
73
101
  /**
74
102
  * Whether the items will be filtered based on
75
103
  * [`value`](https://ariakit.org/reference/combobox-provider#value) and
@@ -2,16 +2,16 @@
2
2
 
3
3
 
4
4
 
5
- var _VQJ44BSYcjs = require('../__chunks/VQJ44BSY.cjs');
6
- require('../__chunks/RV3PHHWM.cjs');
5
+ var _JQS6X2I5cjs = require('../__chunks/JQS6X2I5.cjs');
6
+ require('../__chunks/6ZZYUFPW.cjs');
7
7
  require('../__chunks/UZNYSPKP.cjs');
8
8
  require('../__chunks/BZTDJIVT.cjs');
9
9
  require('../__chunks/RNZNGEL4.cjs');
10
- require('../__chunks/B233QVZE.cjs');
10
+ require('../__chunks/OLOZ5JT2.cjs');
11
11
  require('../__chunks/EO6LS72H.cjs');
12
12
  require('../__chunks/CJDHQUBR.cjs');
13
13
  require('../__chunks/AV6KTKLE.cjs');
14
14
 
15
15
 
16
16
 
17
- exports.CompositeContainer = _VQJ44BSYcjs.CompositeContainer; exports.useCompositeContainer = _VQJ44BSYcjs.useCompositeContainer;
17
+ exports.CompositeContainer = _JQS6X2I5cjs.CompositeContainer; exports.useCompositeContainer = _JQS6X2I5cjs.useCompositeContainer;
@@ -43,7 +43,12 @@ export interface CompositeHoverOptions<T extends As = "div"> extends Options<T>
43
43
  */
44
44
  store?: CompositeStore;
45
45
  /**
46
- * Determines if the composite item should be focused on hover.
46
+ * Determines if the composite item should be _focused_ when hovered over.
47
+ *
48
+ * Note that the actual DOM focus will stay on the composite element. This
49
+ * item will get the
50
+ * [`data-active-item`](https://ariakit.org/guide/styling#data-active-item)
51
+ * attribute so it can be styled as if it's focused.
47
52
  *
48
53
  * Live examples:
49
54
  * - [Multi-selectable
@@ -53,6 +58,9 @@ export interface CompositeHoverOptions<T extends As = "div"> extends Options<T>
53
58
  * - [Textarea with inline
54
59
  * Combobox](https://ariakit.org/examples/combobox-textarea)
55
60
  * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
61
+ * - [Submenu with
62
+ * Combobox](https://ariakit.org/examples/menu-nested-combobox)
63
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
56
64
  * @default true
57
65
  */
58
66
  focusOnHover?: BooleanOrCallback<ReactMouseEvent<HTMLElement>>;
@@ -66,6 +74,9 @@ export interface CompositeHoverOptions<T extends As = "div"> extends Options<T>
66
74
  * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
67
75
  * - [Combobox with integrated
68
76
  * filter](https://ariakit.org/examples/combobox-filtering-integrated)
77
+ * - [Submenu with
78
+ * Combobox](https://ariakit.org/examples/menu-nested-combobox)
79
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
69
80
  */
70
81
  blurOnHoverEnd?: BooleanOrCallback<ReactMouseEvent<HTMLElement>>;
71
82
  }
@@ -43,7 +43,12 @@ export interface CompositeHoverOptions<T extends As = "div"> extends Options<T>
43
43
  */
44
44
  store?: CompositeStore;
45
45
  /**
46
- * Determines if the composite item should be focused on hover.
46
+ * Determines if the composite item should be _focused_ when hovered over.
47
+ *
48
+ * Note that the actual DOM focus will stay on the composite element. This
49
+ * item will get the
50
+ * [`data-active-item`](https://ariakit.org/guide/styling#data-active-item)
51
+ * attribute so it can be styled as if it's focused.
47
52
  *
48
53
  * Live examples:
49
54
  * - [Multi-selectable
@@ -53,6 +58,9 @@ export interface CompositeHoverOptions<T extends As = "div"> extends Options<T>
53
58
  * - [Textarea with inline
54
59
  * Combobox](https://ariakit.org/examples/combobox-textarea)
55
60
  * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
61
+ * - [Submenu with
62
+ * Combobox](https://ariakit.org/examples/menu-nested-combobox)
63
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
56
64
  * @default true
57
65
  */
58
66
  focusOnHover?: BooleanOrCallback<ReactMouseEvent<HTMLElement>>;
@@ -66,6 +74,9 @@ export interface CompositeHoverOptions<T extends As = "div"> extends Options<T>
66
74
  * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
67
75
  * - [Combobox with integrated
68
76
  * filter](https://ariakit.org/examples/combobox-filtering-integrated)
77
+ * - [Submenu with
78
+ * Combobox](https://ariakit.org/examples/menu-nested-combobox)
79
+ * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
69
80
  */
70
81
  blurOnHoverEnd?: BooleanOrCallback<ReactMouseEvent<HTMLElement>>;
71
82
  }