@ariakit/react-core 0.3.12 → 0.3.14

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 (484) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/cjs/__chunks/{7HJPL3H2.cjs → I2KHXDVL.cjs} +4 -4
  3. package/cjs/__chunks/{VCDQISP7.cjs → N3XK7EAH.cjs} +7 -7
  4. package/cjs/__chunks/{KDG57VZV.cjs → OUEE5HOS.cjs} +3 -3
  5. package/cjs/__chunks/{EKB76T2U.cjs → ZL5DC555.cjs} +5 -5
  6. package/cjs/button/button.d.cts +1 -1
  7. package/cjs/button/button.d.ts +1 -1
  8. package/cjs/checkbox/checkbox-check.d.cts +17 -9
  9. package/cjs/checkbox/checkbox-check.d.ts +17 -9
  10. package/cjs/checkbox/checkbox-provider.cjs +2 -2
  11. package/cjs/checkbox/checkbox-provider.d.cts +4 -2
  12. package/cjs/checkbox/checkbox-provider.d.ts +4 -2
  13. package/cjs/checkbox/checkbox-store.d.cts +5 -3
  14. package/cjs/checkbox/checkbox-store.d.ts +5 -3
  15. package/cjs/checkbox/checkbox.d.cts +14 -9
  16. package/cjs/checkbox/checkbox.d.ts +14 -9
  17. package/cjs/collection/collection-item.d.cts +23 -9
  18. package/cjs/collection/collection-item.d.ts +23 -9
  19. package/cjs/collection/collection-provider.d.cts +2 -1
  20. package/cjs/collection/collection-provider.d.ts +2 -1
  21. package/cjs/collection/collection-renderer.d.cts +1 -1
  22. package/cjs/collection/collection-renderer.d.ts +1 -1
  23. package/cjs/collection/collection-store.d.cts +6 -3
  24. package/cjs/collection/collection-store.d.ts +6 -3
  25. package/cjs/collection/collection.d.cts +4 -3
  26. package/cjs/collection/collection.d.ts +4 -3
  27. package/cjs/combobox/combobox-cancel.d.cts +3 -2
  28. package/cjs/combobox/combobox-cancel.d.ts +3 -2
  29. package/cjs/combobox/combobox-disclosure.d.cts +7 -2
  30. package/cjs/combobox/combobox-disclosure.d.ts +7 -2
  31. package/cjs/combobox/combobox-group-label.d.cts +4 -4
  32. package/cjs/combobox/combobox-group-label.d.ts +4 -4
  33. package/cjs/combobox/combobox-group.d.cts +7 -3
  34. package/cjs/combobox/combobox-group.d.ts +7 -3
  35. package/cjs/combobox/combobox-item-check.d.cts +9 -16
  36. package/cjs/combobox/combobox-item-check.d.ts +9 -16
  37. package/cjs/combobox/combobox-item-value.d.cts +13 -8
  38. package/cjs/combobox/combobox-item-value.d.ts +13 -8
  39. package/cjs/combobox/combobox-item.d.cts +11 -9
  40. package/cjs/combobox/combobox-item.d.ts +11 -9
  41. package/cjs/combobox/combobox-list.d.cts +1 -4
  42. package/cjs/combobox/combobox-list.d.ts +1 -4
  43. package/cjs/combobox/combobox-popover.cjs +7 -7
  44. package/cjs/combobox/combobox-popover.d.cts +2 -3
  45. package/cjs/combobox/combobox-popover.d.ts +2 -3
  46. package/cjs/combobox/combobox-provider.d.cts +2 -1
  47. package/cjs/combobox/combobox-provider.d.ts +2 -1
  48. package/cjs/combobox/combobox-row.d.cts +6 -3
  49. package/cjs/combobox/combobox-row.d.ts +6 -3
  50. package/cjs/combobox/combobox-separator.d.cts +4 -3
  51. package/cjs/combobox/combobox-separator.d.ts +4 -3
  52. package/cjs/combobox/combobox-store.d.cts +11 -7
  53. package/cjs/combobox/combobox-store.d.ts +11 -7
  54. package/cjs/combobox/combobox.d.cts +45 -33
  55. package/cjs/combobox/combobox.d.ts +45 -33
  56. package/cjs/command/command.d.cts +1 -1
  57. package/cjs/command/command.d.ts +1 -1
  58. package/cjs/composite/composite-container.d.cts +18 -11
  59. package/cjs/composite/composite-container.d.ts +18 -11
  60. package/cjs/composite/composite-group-label.d.cts +18 -13
  61. package/cjs/composite/composite-group-label.d.ts +18 -13
  62. package/cjs/composite/composite-group.d.cts +20 -12
  63. package/cjs/composite/composite-group.d.ts +20 -12
  64. package/cjs/composite/composite-hover.d.cts +17 -8
  65. package/cjs/composite/composite-hover.d.ts +17 -8
  66. package/cjs/composite/composite-input.d.cts +15 -9
  67. package/cjs/composite/composite-input.d.ts +15 -9
  68. package/cjs/composite/composite-item.d.cts +49 -9
  69. package/cjs/composite/composite-item.d.ts +49 -9
  70. package/cjs/composite/composite-overflow.cjs +6 -6
  71. package/cjs/composite/composite-provider.d.cts +2 -1
  72. package/cjs/composite/composite-provider.d.ts +2 -1
  73. package/cjs/composite/composite-renderer.d.cts +1 -1
  74. package/cjs/composite/composite-renderer.d.ts +1 -1
  75. package/cjs/composite/composite-row.d.cts +26 -19
  76. package/cjs/composite/composite-row.d.ts +26 -19
  77. package/cjs/composite/composite-separator.d.cts +23 -10
  78. package/cjs/composite/composite-separator.d.ts +23 -10
  79. package/cjs/composite/composite-store.d.cts +3 -1
  80. package/cjs/composite/composite-store.d.ts +3 -1
  81. package/cjs/composite/composite-typeahead.d.cts +20 -8
  82. package/cjs/composite/composite-typeahead.d.ts +20 -8
  83. package/cjs/composite/composite.d.cts +65 -10
  84. package/cjs/composite/composite.d.ts +65 -10
  85. package/cjs/dialog/dialog-disclosure.d.cts +2 -1
  86. package/cjs/dialog/dialog-disclosure.d.ts +2 -1
  87. package/cjs/dialog/dialog-dismiss.d.cts +2 -1
  88. package/cjs/dialog/dialog-dismiss.d.ts +2 -1
  89. package/cjs/dialog/dialog-provider.d.cts +2 -1
  90. package/cjs/dialog/dialog-provider.d.ts +2 -1
  91. package/cjs/dialog/dialog-store.d.cts +3 -1
  92. package/cjs/dialog/dialog-store.d.ts +3 -1
  93. package/cjs/dialog/dialog.cjs +5 -5
  94. package/cjs/dialog/dialog.d.cts +51 -20
  95. package/cjs/dialog/dialog.d.ts +51 -20
  96. package/cjs/dialog/utils/disable-tree.cjs +3 -3
  97. package/cjs/dialog/utils/use-hide-on-interact-outside.cjs +1 -1
  98. package/cjs/disclosure/disclosure-content.d.cts +6 -5
  99. package/cjs/disclosure/disclosure-content.d.ts +6 -5
  100. package/cjs/disclosure/disclosure-provider.d.cts +2 -1
  101. package/cjs/disclosure/disclosure-provider.d.ts +2 -1
  102. package/cjs/disclosure/disclosure-store.d.cts +6 -4
  103. package/cjs/disclosure/disclosure-store.d.ts +6 -4
  104. package/cjs/disclosure/disclosure.d.cts +3 -2
  105. package/cjs/disclosure/disclosure.d.ts +3 -2
  106. package/cjs/focus-trap/focus-trap-region.d.cts +4 -2
  107. package/cjs/focus-trap/focus-trap-region.d.ts +4 -2
  108. package/cjs/focusable/focusable-container.d.cts +7 -5
  109. package/cjs/focusable/focusable-container.d.ts +7 -5
  110. package/cjs/focusable/focusable.d.cts +5 -2
  111. package/cjs/focusable/focusable.d.ts +5 -2
  112. package/cjs/form/form-checkbox.cjs +5 -5
  113. package/cjs/form/form-checkbox.d.cts +6 -4
  114. package/cjs/form/form-checkbox.d.ts +6 -4
  115. package/cjs/form/form-control.cjs +16 -0
  116. package/cjs/form/form-control.d.cts +93 -0
  117. package/cjs/form/form-control.d.ts +93 -0
  118. package/cjs/form/form-description.d.cts +14 -3
  119. package/cjs/form/form-description.d.ts +14 -3
  120. package/cjs/form/form-error.d.cts +11 -4
  121. package/cjs/form/form-error.d.ts +11 -4
  122. package/cjs/form/form-field.cjs +19 -4
  123. package/cjs/form/form-field.d.cts +16 -30
  124. package/cjs/form/form-field.d.ts +16 -30
  125. package/cjs/form/form-group-label.d.cts +6 -4
  126. package/cjs/form/form-group-label.d.ts +6 -4
  127. package/cjs/form/form-group.d.cts +6 -2
  128. package/cjs/form/form-group.d.ts +6 -2
  129. package/cjs/form/form-input.cjs +2 -2
  130. package/cjs/form/form-input.d.cts +7 -6
  131. package/cjs/form/form-input.d.ts +7 -6
  132. package/cjs/form/form-label.d.cts +18 -7
  133. package/cjs/form/form-label.d.ts +18 -7
  134. package/cjs/form/form-provider.d.cts +2 -1
  135. package/cjs/form/form-provider.d.ts +2 -1
  136. package/cjs/form/form-push.d.cts +17 -3
  137. package/cjs/form/form-push.d.ts +17 -3
  138. package/cjs/form/form-radio-group.d.cts +7 -2
  139. package/cjs/form/form-radio-group.d.ts +7 -2
  140. package/cjs/form/form-radio.cjs +2 -2
  141. package/cjs/form/form-radio.d.cts +8 -4
  142. package/cjs/form/form-radio.d.ts +8 -4
  143. package/cjs/form/form-remove.d.cts +17 -2
  144. package/cjs/form/form-remove.d.ts +17 -2
  145. package/cjs/form/form-reset.d.cts +5 -2
  146. package/cjs/form/form-reset.d.ts +5 -2
  147. package/cjs/form/form-store.d.cts +31 -14
  148. package/cjs/form/form-store.d.ts +31 -14
  149. package/cjs/form/form-submit.d.cts +8 -2
  150. package/cjs/form/form-submit.d.ts +8 -2
  151. package/cjs/form/form.d.cts +37 -11
  152. package/cjs/form/form.d.ts +37 -11
  153. package/cjs/group/group-label.d.cts +3 -2
  154. package/cjs/group/group-label.d.ts +3 -2
  155. package/cjs/group/group.d.cts +3 -1
  156. package/cjs/group/group.d.ts +3 -1
  157. package/cjs/heading/heading-level.d.cts +4 -2
  158. package/cjs/heading/heading-level.d.ts +4 -2
  159. package/cjs/heading/heading.d.cts +4 -3
  160. package/cjs/heading/heading.d.ts +4 -3
  161. package/cjs/hovercard/hovercard-anchor.d.cts +5 -2
  162. package/cjs/hovercard/hovercard-anchor.d.ts +5 -2
  163. package/cjs/hovercard/hovercard-arrow.d.cts +4 -2
  164. package/cjs/hovercard/hovercard-arrow.d.ts +4 -2
  165. package/cjs/hovercard/hovercard-description.d.cts +2 -2
  166. package/cjs/hovercard/hovercard-description.d.ts +2 -2
  167. package/cjs/hovercard/hovercard-disclosure.d.cts +1 -1
  168. package/cjs/hovercard/hovercard-disclosure.d.ts +1 -1
  169. package/cjs/hovercard/hovercard-dismiss.d.cts +3 -2
  170. package/cjs/hovercard/hovercard-dismiss.d.ts +3 -2
  171. package/cjs/hovercard/hovercard-heading.d.cts +2 -2
  172. package/cjs/hovercard/hovercard-heading.d.ts +2 -2
  173. package/cjs/hovercard/hovercard-provider.d.cts +2 -1
  174. package/cjs/hovercard/hovercard-provider.d.ts +2 -1
  175. package/cjs/hovercard/hovercard-store.d.cts +2 -1
  176. package/cjs/hovercard/hovercard-store.d.ts +2 -1
  177. package/cjs/hovercard/hovercard.cjs +7 -7
  178. package/cjs/hovercard/hovercard.d.cts +20 -8
  179. package/cjs/hovercard/hovercard.d.ts +20 -8
  180. package/cjs/menu/menu-arrow.d.cts +4 -2
  181. package/cjs/menu/menu-arrow.d.ts +4 -2
  182. package/cjs/menu/menu-bar.d.cts +1 -2
  183. package/cjs/menu/menu-bar.d.ts +1 -2
  184. package/cjs/menu/menu-button-arrow.d.cts +9 -4
  185. package/cjs/menu/menu-button-arrow.d.ts +9 -4
  186. package/cjs/menu/menu-button.d.cts +8 -7
  187. package/cjs/menu/menu-button.d.ts +8 -7
  188. package/cjs/menu/menu-description.d.cts +2 -2
  189. package/cjs/menu/menu-description.d.ts +2 -2
  190. package/cjs/menu/menu-dismiss.d.cts +3 -2
  191. package/cjs/menu/menu-dismiss.d.ts +3 -2
  192. package/cjs/menu/menu-group-label.d.cts +4 -4
  193. package/cjs/menu/menu-group-label.d.ts +4 -4
  194. package/cjs/menu/menu-group.d.cts +5 -2
  195. package/cjs/menu/menu-group.d.ts +5 -2
  196. package/cjs/menu/menu-heading.d.cts +3 -2
  197. package/cjs/menu/menu-heading.d.ts +3 -2
  198. package/cjs/menu/menu-item-check.d.cts +10 -18
  199. package/cjs/menu/menu-item-check.d.ts +10 -18
  200. package/cjs/menu/menu-item-checkbox.cjs +3 -3
  201. package/cjs/menu/menu-item-checkbox.d.cts +38 -6
  202. package/cjs/menu/menu-item-checkbox.d.ts +38 -6
  203. package/cjs/menu/menu-item-radio.d.cts +21 -9
  204. package/cjs/menu/menu-item-radio.d.ts +21 -9
  205. package/cjs/menu/menu-item.d.cts +10 -11
  206. package/cjs/menu/menu-item.d.ts +10 -11
  207. package/cjs/menu/menu-list.d.cts +7 -2
  208. package/cjs/menu/menu-list.d.ts +7 -2
  209. package/cjs/menu/menu-provider.d.cts +2 -1
  210. package/cjs/menu/menu-provider.d.ts +2 -1
  211. package/cjs/menu/menu-separator.d.cts +5 -2
  212. package/cjs/menu/menu-separator.d.ts +5 -2
  213. package/cjs/menu/menu-store.d.cts +18 -7
  214. package/cjs/menu/menu-store.d.ts +18 -7
  215. package/cjs/menu/menu.cjs +8 -8
  216. package/cjs/menu/menu.d.cts +8 -2
  217. package/cjs/menu/menu.d.ts +8 -2
  218. package/cjs/menubar/menubar-provider.d.cts +2 -1
  219. package/cjs/menubar/menubar-provider.d.ts +2 -1
  220. package/cjs/menubar/menubar-store.d.cts +3 -1
  221. package/cjs/menubar/menubar-store.d.ts +3 -1
  222. package/cjs/menubar/menubar.d.cts +3 -2
  223. package/cjs/menubar/menubar.d.ts +3 -2
  224. package/cjs/popover/popover-anchor.d.cts +4 -3
  225. package/cjs/popover/popover-anchor.d.ts +4 -3
  226. package/cjs/popover/popover-arrow.d.cts +6 -2
  227. package/cjs/popover/popover-arrow.d.ts +6 -2
  228. package/cjs/popover/popover-description.d.cts +1 -1
  229. package/cjs/popover/popover-description.d.ts +1 -1
  230. package/cjs/popover/popover-disclosure-arrow.d.cts +6 -4
  231. package/cjs/popover/popover-disclosure-arrow.d.ts +6 -4
  232. package/cjs/popover/popover-disclosure.d.cts +3 -2
  233. package/cjs/popover/popover-disclosure.d.ts +3 -2
  234. package/cjs/popover/popover-dismiss.d.cts +1 -1
  235. package/cjs/popover/popover-dismiss.d.ts +1 -1
  236. package/cjs/popover/popover-heading.d.cts +1 -1
  237. package/cjs/popover/popover-heading.d.ts +1 -1
  238. package/cjs/popover/popover-provider.d.cts +2 -1
  239. package/cjs/popover/popover-provider.d.ts +2 -1
  240. package/cjs/popover/popover-store.d.cts +2 -1
  241. package/cjs/popover/popover-store.d.ts +2 -1
  242. package/cjs/popover/popover.cjs +6 -6
  243. package/cjs/popover/popover.d.cts +8 -3
  244. package/cjs/popover/popover.d.ts +8 -3
  245. package/cjs/portal/portal.d.cts +18 -1
  246. package/cjs/portal/portal.d.ts +18 -1
  247. package/cjs/radio/radio-group.d.cts +8 -6
  248. package/cjs/radio/radio-group.d.ts +8 -6
  249. package/cjs/radio/radio-provider.d.cts +2 -1
  250. package/cjs/radio/radio-provider.d.ts +2 -1
  251. package/cjs/radio/radio-store.d.cts +6 -2
  252. package/cjs/radio/radio-store.d.ts +6 -2
  253. package/cjs/radio/radio.d.cts +21 -13
  254. package/cjs/radio/radio.d.ts +21 -13
  255. package/cjs/role/role.d.cts +3 -3
  256. package/cjs/role/role.d.ts +3 -3
  257. package/cjs/select/select-group-label.d.cts +2 -2
  258. package/cjs/select/select-group-label.d.ts +2 -2
  259. package/cjs/select/select-group.d.cts +4 -1
  260. package/cjs/select/select-group.d.ts +4 -1
  261. package/cjs/select/select-item-check.d.cts +9 -15
  262. package/cjs/select/select-item-check.d.ts +9 -15
  263. package/cjs/select/select-item.d.cts +1 -5
  264. package/cjs/select/select-item.d.ts +1 -5
  265. package/cjs/select/select-list.d.cts +7 -4
  266. package/cjs/select/select-list.d.ts +7 -4
  267. package/cjs/select/select-popover.cjs +7 -7
  268. package/cjs/select/select-provider.d.cts +2 -1
  269. package/cjs/select/select-provider.d.ts +2 -1
  270. package/cjs/select/select-renderer.d.cts +1 -1
  271. package/cjs/select/select-renderer.d.ts +1 -1
  272. package/cjs/select/select-row.d.cts +4 -1
  273. package/cjs/select/select-row.d.ts +4 -1
  274. package/cjs/select/select-separator.d.cts +2 -1
  275. package/cjs/select/select-separator.d.ts +2 -1
  276. package/cjs/select/select-store.d.cts +17 -10
  277. package/cjs/select/select-store.d.ts +17 -10
  278. package/cjs/select/select.cjs +8 -6
  279. package/cjs/select/select.d.cts +25 -15
  280. package/cjs/select/select.d.ts +25 -15
  281. package/cjs/tab/tab-list.d.cts +2 -1
  282. package/cjs/tab/tab-list.d.ts +2 -1
  283. package/cjs/tab/tab-panel.d.cts +19 -3
  284. package/cjs/tab/tab-panel.d.ts +19 -3
  285. package/cjs/tab/tab-provider.d.cts +1 -1
  286. package/cjs/tab/tab-provider.d.ts +1 -1
  287. package/cjs/tab/tab-store.d.cts +3 -1
  288. package/cjs/tab/tab-store.d.ts +3 -1
  289. package/cjs/tab/tab.d.cts +2 -2
  290. package/cjs/tab/tab.d.ts +2 -2
  291. package/cjs/toolbar/toolbar-container.d.cts +1 -1
  292. package/cjs/toolbar/toolbar-container.d.ts +1 -1
  293. package/cjs/toolbar/toolbar-input.d.cts +2 -1
  294. package/cjs/toolbar/toolbar-input.d.ts +2 -1
  295. package/cjs/toolbar/toolbar-item.d.cts +2 -1
  296. package/cjs/toolbar/toolbar-item.d.ts +2 -1
  297. package/cjs/toolbar/toolbar-provider.d.cts +2 -1
  298. package/cjs/toolbar/toolbar-provider.d.ts +2 -1
  299. package/cjs/toolbar/toolbar-separator.d.cts +2 -1
  300. package/cjs/toolbar/toolbar-separator.d.ts +2 -1
  301. package/cjs/toolbar/toolbar-store.d.cts +3 -1
  302. package/cjs/toolbar/toolbar-store.d.ts +3 -1
  303. package/cjs/tooltip/tooltip-anchor.d.cts +3 -3
  304. package/cjs/tooltip/tooltip-anchor.d.ts +3 -3
  305. package/cjs/tooltip/tooltip-arrow.d.cts +1 -1
  306. package/cjs/tooltip/tooltip-arrow.d.ts +1 -1
  307. package/cjs/tooltip/tooltip-provider.d.cts +2 -1
  308. package/cjs/tooltip/tooltip-provider.d.ts +2 -1
  309. package/cjs/tooltip/tooltip-store.d.cts +3 -1
  310. package/cjs/tooltip/tooltip-store.d.ts +3 -1
  311. package/cjs/tooltip/tooltip.cjs +8 -8
  312. package/cjs/tooltip/tooltip.d.cts +3 -1
  313. package/cjs/tooltip/tooltip.d.ts +3 -1
  314. package/esm/__chunks/{FS2EVEJO.js → 4GO43MST.js} +8 -8
  315. package/esm/__chunks/{A6XC27R5.js → IRX7SFUJ.js} +1 -1
  316. package/esm/__chunks/{PGAEII2Q.js → NERBASET.js} +4 -4
  317. package/esm/__chunks/{EPBRINPG.js → QWSZGSIG.js} +2 -2
  318. package/esm/button/button.d.ts +1 -1
  319. package/esm/checkbox/checkbox-check.d.ts +17 -9
  320. package/esm/checkbox/checkbox-provider.d.ts +4 -2
  321. package/esm/checkbox/checkbox-provider.js +3 -3
  322. package/esm/checkbox/checkbox-store.d.ts +5 -3
  323. package/esm/checkbox/checkbox.d.ts +14 -9
  324. package/esm/collection/collection-item.d.ts +23 -9
  325. package/esm/collection/collection-provider.d.ts +2 -1
  326. package/esm/collection/collection-renderer.d.ts +1 -1
  327. package/esm/collection/collection-store.d.ts +6 -3
  328. package/esm/collection/collection.d.ts +4 -3
  329. package/esm/combobox/combobox-cancel.d.ts +3 -2
  330. package/esm/combobox/combobox-disclosure.d.ts +7 -2
  331. package/esm/combobox/combobox-group-label.d.ts +4 -4
  332. package/esm/combobox/combobox-group.d.ts +7 -3
  333. package/esm/combobox/combobox-item-check.d.ts +9 -16
  334. package/esm/combobox/combobox-item-value.d.ts +13 -8
  335. package/esm/combobox/combobox-item.d.ts +11 -9
  336. package/esm/combobox/combobox-list.d.ts +1 -4
  337. package/esm/combobox/combobox-popover.d.ts +2 -3
  338. package/esm/combobox/combobox-popover.js +5 -5
  339. package/esm/combobox/combobox-provider.d.ts +2 -1
  340. package/esm/combobox/combobox-row.d.ts +6 -3
  341. package/esm/combobox/combobox-separator.d.ts +4 -3
  342. package/esm/combobox/combobox-store.d.ts +11 -7
  343. package/esm/combobox/combobox.d.ts +45 -33
  344. package/esm/command/command.d.ts +1 -1
  345. package/esm/composite/composite-container.d.ts +18 -11
  346. package/esm/composite/composite-group-label.d.ts +18 -13
  347. package/esm/composite/composite-group.d.ts +20 -12
  348. package/esm/composite/composite-hover.d.ts +17 -8
  349. package/esm/composite/composite-input.d.ts +15 -9
  350. package/esm/composite/composite-item.d.ts +49 -9
  351. package/esm/composite/composite-overflow.js +5 -5
  352. package/esm/composite/composite-provider.d.ts +2 -1
  353. package/esm/composite/composite-renderer.d.ts +1 -1
  354. package/esm/composite/composite-row.d.ts +26 -19
  355. package/esm/composite/composite-separator.d.ts +23 -10
  356. package/esm/composite/composite-store.d.ts +3 -1
  357. package/esm/composite/composite-typeahead.d.ts +20 -8
  358. package/esm/composite/composite.d.ts +65 -10
  359. package/esm/dialog/dialog-disclosure.d.ts +2 -1
  360. package/esm/dialog/dialog-dismiss.d.ts +2 -1
  361. package/esm/dialog/dialog-provider.d.ts +2 -1
  362. package/esm/dialog/dialog-store.d.ts +3 -1
  363. package/esm/dialog/dialog.d.ts +51 -20
  364. package/esm/dialog/dialog.js +4 -4
  365. package/esm/dialog/utils/disable-tree.js +2 -2
  366. package/esm/dialog/utils/use-hide-on-interact-outside.js +1 -1
  367. package/esm/disclosure/disclosure-content.d.ts +6 -5
  368. package/esm/disclosure/disclosure-provider.d.ts +2 -1
  369. package/esm/disclosure/disclosure-store.d.ts +6 -4
  370. package/esm/disclosure/disclosure.d.ts +3 -2
  371. package/esm/focus-trap/focus-trap-region.d.ts +4 -2
  372. package/esm/focusable/focusable-container.d.ts +7 -5
  373. package/esm/focusable/focusable.d.ts +5 -2
  374. package/esm/form/form-checkbox.d.ts +6 -4
  375. package/esm/form/form-checkbox.js +6 -6
  376. package/esm/form/form-control.d.ts +93 -0
  377. package/esm/form/form-control.js +16 -0
  378. package/esm/form/form-description.d.ts +14 -3
  379. package/esm/form/form-error.d.ts +11 -4
  380. package/esm/form/form-field.d.ts +16 -30
  381. package/esm/form/form-field.js +19 -4
  382. package/esm/form/form-group-label.d.ts +6 -4
  383. package/esm/form/form-group.d.ts +6 -2
  384. package/esm/form/form-input.d.ts +7 -6
  385. package/esm/form/form-input.js +3 -3
  386. package/esm/form/form-label.d.ts +18 -7
  387. package/esm/form/form-provider.d.ts +2 -1
  388. package/esm/form/form-push.d.ts +17 -3
  389. package/esm/form/form-radio-group.d.ts +7 -2
  390. package/esm/form/form-radio.d.ts +8 -4
  391. package/esm/form/form-radio.js +3 -3
  392. package/esm/form/form-remove.d.ts +17 -2
  393. package/esm/form/form-reset.d.ts +5 -2
  394. package/esm/form/form-store.d.ts +31 -14
  395. package/esm/form/form-submit.d.ts +8 -2
  396. package/esm/form/form.d.ts +37 -11
  397. package/esm/group/group-label.d.ts +3 -2
  398. package/esm/group/group.d.ts +3 -1
  399. package/esm/heading/heading-level.d.ts +4 -2
  400. package/esm/heading/heading.d.ts +4 -3
  401. package/esm/hovercard/hovercard-anchor.d.ts +5 -2
  402. package/esm/hovercard/hovercard-arrow.d.ts +4 -2
  403. package/esm/hovercard/hovercard-description.d.ts +2 -2
  404. package/esm/hovercard/hovercard-disclosure.d.ts +1 -1
  405. package/esm/hovercard/hovercard-dismiss.d.ts +3 -2
  406. package/esm/hovercard/hovercard-heading.d.ts +2 -2
  407. package/esm/hovercard/hovercard-provider.d.ts +2 -1
  408. package/esm/hovercard/hovercard-store.d.ts +2 -1
  409. package/esm/hovercard/hovercard.d.ts +20 -8
  410. package/esm/hovercard/hovercard.js +6 -6
  411. package/esm/menu/menu-arrow.d.ts +4 -2
  412. package/esm/menu/menu-bar.d.ts +1 -2
  413. package/esm/menu/menu-button-arrow.d.ts +9 -4
  414. package/esm/menu/menu-button.d.ts +8 -7
  415. package/esm/menu/menu-description.d.ts +2 -2
  416. package/esm/menu/menu-dismiss.d.ts +3 -2
  417. package/esm/menu/menu-group-label.d.ts +4 -4
  418. package/esm/menu/menu-group.d.ts +5 -2
  419. package/esm/menu/menu-heading.d.ts +3 -2
  420. package/esm/menu/menu-item-check.d.ts +10 -18
  421. package/esm/menu/menu-item-checkbox.d.ts +38 -6
  422. package/esm/menu/menu-item-checkbox.js +3 -3
  423. package/esm/menu/menu-item-radio.d.ts +21 -9
  424. package/esm/menu/menu-item.d.ts +10 -11
  425. package/esm/menu/menu-list.d.ts +7 -2
  426. package/esm/menu/menu-provider.d.ts +2 -1
  427. package/esm/menu/menu-separator.d.ts +5 -2
  428. package/esm/menu/menu-store.d.ts +18 -7
  429. package/esm/menu/menu.d.ts +8 -2
  430. package/esm/menu/menu.js +6 -6
  431. package/esm/menubar/menubar-provider.d.ts +2 -1
  432. package/esm/menubar/menubar-store.d.ts +3 -1
  433. package/esm/menubar/menubar.d.ts +3 -2
  434. package/esm/popover/popover-anchor.d.ts +4 -3
  435. package/esm/popover/popover-arrow.d.ts +6 -2
  436. package/esm/popover/popover-description.d.ts +1 -1
  437. package/esm/popover/popover-disclosure-arrow.d.ts +6 -4
  438. package/esm/popover/popover-disclosure.d.ts +3 -2
  439. package/esm/popover/popover-dismiss.d.ts +1 -1
  440. package/esm/popover/popover-heading.d.ts +1 -1
  441. package/esm/popover/popover-provider.d.ts +2 -1
  442. package/esm/popover/popover-store.d.ts +2 -1
  443. package/esm/popover/popover.d.ts +8 -3
  444. package/esm/popover/popover.js +5 -5
  445. package/esm/portal/portal.d.ts +18 -1
  446. package/esm/radio/radio-group.d.ts +8 -6
  447. package/esm/radio/radio-provider.d.ts +2 -1
  448. package/esm/radio/radio-store.d.ts +6 -2
  449. package/esm/radio/radio.d.ts +21 -13
  450. package/esm/role/role.d.ts +3 -3
  451. package/esm/select/select-group-label.d.ts +2 -2
  452. package/esm/select/select-group.d.ts +4 -1
  453. package/esm/select/select-item-check.d.ts +9 -15
  454. package/esm/select/select-item.d.ts +1 -5
  455. package/esm/select/select-list.d.ts +7 -4
  456. package/esm/select/select-popover.js +5 -5
  457. package/esm/select/select-provider.d.ts +2 -1
  458. package/esm/select/select-renderer.d.ts +1 -1
  459. package/esm/select/select-row.d.ts +4 -1
  460. package/esm/select/select-separator.d.ts +2 -1
  461. package/esm/select/select-store.d.ts +17 -10
  462. package/esm/select/select.d.ts +25 -15
  463. package/esm/select/select.js +8 -6
  464. package/esm/tab/tab-list.d.ts +2 -1
  465. package/esm/tab/tab-panel.d.ts +19 -3
  466. package/esm/tab/tab-provider.d.ts +1 -1
  467. package/esm/tab/tab-store.d.ts +3 -1
  468. package/esm/tab/tab.d.ts +2 -2
  469. package/esm/toolbar/toolbar-container.d.ts +1 -1
  470. package/esm/toolbar/toolbar-input.d.ts +2 -1
  471. package/esm/toolbar/toolbar-item.d.ts +2 -1
  472. package/esm/toolbar/toolbar-provider.d.ts +2 -1
  473. package/esm/toolbar/toolbar-separator.d.ts +2 -1
  474. package/esm/toolbar/toolbar-store.d.ts +3 -1
  475. package/esm/tooltip/tooltip-anchor.d.ts +3 -3
  476. package/esm/tooltip/tooltip-arrow.d.ts +1 -1
  477. package/esm/tooltip/tooltip-provider.d.ts +2 -1
  478. package/esm/tooltip/tooltip-store.d.ts +3 -1
  479. package/esm/tooltip/tooltip.d.ts +3 -1
  480. package/esm/tooltip/tooltip.js +6 -6
  481. package/form/form-control/package.json +8 -0
  482. package/package.json +9 -2
  483. package/cjs/__chunks/{NKR65BKC.cjs → KSPMHEYZ.cjs} +3 -3
  484. package/esm/__chunks/{CLF4PQ7T.js → TQYOGOE2.js} +3 -3
@@ -10,8 +10,10 @@ import type { As, Options, Props } from "../utils/types.js";
10
10
  */
11
11
  export declare const useFocusTrapRegion: import("../utils/types.js").Hook<FocusTrapRegionOptions<"div">>;
12
12
  /**
13
- * Renders a focus trap region element.
14
- * @see https://ariakit.org/components/focus-trap-region
13
+ * Renders a wrapper element that traps the focus inside it when the
14
+ * [`enabled`](https://ariakit.org/reference/focus-trap-region#enabled) prop is
15
+ * `true`.
16
+ * @see https://ariakit.org/components/focus-trap
15
17
  * @example
16
18
  * ```jsx
17
19
  * <FocusTrapRegion>
@@ -10,8 +10,9 @@ import type { As, Options, Props } from "../utils/types.js";
10
10
  */
11
11
  export declare const useFocusableContainer: import("../utils/types.js").Hook<FocusableContainerOptions<"div">>;
12
12
  /**
13
- * Renders a div that wraps `Focusable` components and controls whether they
14
- * can be auto focused.
13
+ * Renders a div that wraps
14
+ * [`Focusable`](https://ariakit.org/reference/focusable) components and
15
+ * controls whether they can be auto-focused.
15
16
  * @see https://ariakit.org/components/focusable
16
17
  * @example
17
18
  * ```jsx
@@ -23,9 +24,10 @@ export declare const useFocusableContainer: import("../utils/types.js").Hook<Foc
23
24
  export declare const FocusableContainer: import("../utils/types.js").Component<FocusableContainerOptions<"div">>;
24
25
  export type FocusableContainerOptions<T extends As = "div"> = Options<T> & {
25
26
  /**
26
- * Determines whether focusable elements inside the container should be
27
- * automatically focused when the container is shown and they have the
28
- * `autoFocus` prop.
27
+ * Determines whether [`Focusable`](https://ariakit.org/reference/focusable)
28
+ * elements inside the container should be automatically focused when the
29
+ * container is shown and they have the
30
+ * [`autoFocus`](https://ariakit.org/reference/focusable#autofocus) prop.
29
31
  * @default true
30
32
  */
31
33
  autoFocusOnShow?: boolean;
@@ -46,6 +46,7 @@ export interface FocusableOptions<T extends As = "div"> extends Options<T> {
46
46
  * Live examples:
47
47
  * - [Submenu](https://ariakit.org/examples/menu-nested)
48
48
  * - [Combobox with tabs](https://ariakit.org/examples/combobox-tabs)
49
+ * - [Context Menu](https://ariakit.org/examples/menu-context-menu)
49
50
  * @default false
50
51
  */
51
52
  disabled?: boolean;
@@ -109,8 +110,10 @@ export interface FocusableOptions<T extends As = "div"> extends Options<T> {
109
110
  accessibleWhenDisabled?: boolean;
110
111
  /**
111
112
  * Custom event handler invoked when the element gains focus through keyboard
112
- * interaction or a key press occurs while the element is in focus. This is a
113
- * programmatic equivalent of the `data-focus-visible` attribute.
113
+ * interaction or a key press occurs while the element is in focus. This is
114
+ * the programmatic equivalent of the
115
+ * [`data-focus-visible`](https://ariakit.org/guide/styling#data-focus-visible)
116
+ * attribute.
114
117
  *
115
118
  * Live examples:
116
119
  * - [Navigation Menubar](https://ariakit.org/examples/menubar-navigation)
@@ -1,6 +1,6 @@
1
1
  import type { CheckboxOptions } from "../checkbox/checkbox.js";
2
2
  import type { As, Props } from "../utils/types.js";
3
- import type { FormFieldOptions } from "./form-field.js";
3
+ import type { FormControlOptions } from "./form-control.js";
4
4
  /**
5
5
  * Returns props to create a `FormCheckbox` component.
6
6
  * @see https://ariakit.org/components/form
@@ -18,15 +18,17 @@ import type { FormFieldOptions } from "./form-field.js";
18
18
  */
19
19
  export declare const useFormCheckbox: import("../utils/types.js").Hook<FormCheckboxOptions<"input">>;
20
20
  /**
21
- * Renders a checkbox as a form field.
21
+ * Renders a checkbox input as a form control, representing a boolean, string,
22
+ * number, or array value.
22
23
  * @see https://ariakit.org/components/form
23
24
  * @example
24
- * ```jsx
25
+ * ```jsx {9}
25
26
  * const form = useFormStore({
26
27
  * defaultValues: {
27
28
  * acceptTerms: false,
28
29
  * },
29
30
  * });
31
+ *
30
32
  * <Form store={form}>
31
33
  * <label>
32
34
  * <FormCheckbox name={form.names.acceptTerms} />
@@ -36,6 +38,6 @@ export declare const useFormCheckbox: import("../utils/types.js").Hook<FormCheck
36
38
  * ```
37
39
  */
38
40
  export declare const FormCheckbox: import("../utils/types.js").Component<FormCheckboxOptions<"input">>;
39
- export interface FormCheckboxOptions<T extends As = "input"> extends FormFieldOptions<T>, Omit<CheckboxOptions<T>, "store" | "name"> {
41
+ export interface FormCheckboxOptions<T extends As = "input"> extends FormControlOptions<T>, Omit<CheckboxOptions<T>, "store" | "name"> {
40
42
  }
41
43
  export type FormCheckboxProps<T extends As = "input"> = Props<FormCheckboxOptions<T>>;
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import {
3
- useFormField
4
- } from "../__chunks/FS2EVEJO.js";
3
+ useFormControl
4
+ } from "../__chunks/4GO43MST.js";
5
5
  import {
6
6
  useFormContext
7
7
  } from "../__chunks/V4ZFXDFK.js";
8
+ import {
9
+ useCheckboxStore
10
+ } from "../__chunks/JIZ5C2JK.js";
8
11
  import {
9
12
  useCheckbox
10
13
  } from "../__chunks/3AHQ6JCP.js";
11
14
  import "../__chunks/VPR2WHQV.js";
12
- import {
13
- useCheckboxStore
14
- } from "../__chunks/JIZ5C2JK.js";
15
15
  import "../__chunks/6XBVQI3K.js";
16
16
  import "../__chunks/NWCBQ4CV.js";
17
17
  import "../__chunks/UH3I23HL.js";
@@ -48,7 +48,7 @@ var useFormCheckbox = createHook(
48
48
  setValue: (value2) => store == null ? void 0 : store.setValue(name, value2)
49
49
  });
50
50
  props = useCheckbox(__spreadValues({ store: checkboxStore, value, checked }, props));
51
- props = useFormField(__spreadValues({
51
+ props = useFormControl(__spreadValues({
52
52
  store,
53
53
  name,
54
54
  "aria-labelledby": void 0
@@ -0,0 +1,93 @@
1
+ import type { FocusEvent } from "react";
2
+ import type { StringLike } from "@ariakit/core/form/types";
3
+ import type { BooleanOrCallback } from "@ariakit/core/utils/types";
4
+ import type { CollectionItemOptions } from "../collection/collection-item.js";
5
+ import type { As, Props } from "../utils/types.js";
6
+ import type { FormStore } from "./form-store.js";
7
+ /**
8
+ * Returns props to create a `FormControl` component. Unlike `useFormInput`,
9
+ * this hook doesn't automatically returns the `value` and `onChange` props.
10
+ * This is so we can use it not only for native form elements but also for
11
+ * custom components whose value is not controlled by the native `value` and
12
+ * `onChange` props.
13
+ * @see https://ariakit.org/components/form
14
+ * @example
15
+ * ```jsx
16
+ * const store = useFormStore({ defaultValues: { content: "" } });
17
+ * const props = useFormControl({ store, name: store.names.content });
18
+ * const value = store.useValue(store.names.content);
19
+ *
20
+ * <Form store={store}>
21
+ * <FormLabel name={store.names.content}>Content</FormLabel>
22
+ * <Role
23
+ * {...props}
24
+ * value={value}
25
+ * onChange={(value) => store.setValue(store.names.content, value)}
26
+ * render={<Editor />}
27
+ * />
28
+ * </Form>
29
+ * ```
30
+ */
31
+ export declare const useFormControl: import("../utils/types.js").Hook<FormControlOptions<"input">>;
32
+ /**
33
+ * Abstract component that renders a form control. Unlike
34
+ * [`FormInput`](https://ariakit.org/reference/form-input), this component
35
+ * doesn't automatically pass the `value` and `onChange` props down to the
36
+ * underlying element. This is so we can use it not only for native form
37
+ * elements but also for custom components whose value is not controlled by the
38
+ * native `value` and `onChange` props.
39
+ * @see https://ariakit.org/components/form
40
+ * @example
41
+ * ```jsx {11-19}
42
+ * const form = useFormStore({
43
+ * defaultValues: {
44
+ * content: "",
45
+ * },
46
+ * });
47
+ *
48
+ * const value = form.useValue(form.names.content);
49
+ *
50
+ * <Form store={form}>
51
+ * <FormLabel name={form.names.content}>Content</FormLabel>
52
+ * <FormControl
53
+ * name={form.names.content}
54
+ * render={
55
+ * <Editor
56
+ * value={value}
57
+ * onChange={(value) => form.setValue(form.names.content, value)}
58
+ * />
59
+ * }
60
+ * />
61
+ * </Form>
62
+ * ```
63
+ */
64
+ export declare const FormControl: import("../utils/types.js").Component<FormControlOptions<"input">>;
65
+ export interface FormControlOptions<T extends As = "input"> extends CollectionItemOptions<T> {
66
+ /**
67
+ * Object returned by the
68
+ * [`useFormStore`](https://ariakit.org/reference/use-form-store) hook. If not
69
+ * provided, the closest [`Form`](https://ariakit.org/reference/form) or
70
+ * [`FormProvider`](https://ariakit.org/reference/form-provider) components'
71
+ * context will be used.
72
+ */
73
+ store?: FormStore;
74
+ /**
75
+ * Field name. This can either be a string corresponding to an existing
76
+ * property name in the
77
+ * [`values`](https://ariakit.org/reference/use-form-store#values) state of
78
+ * the store, or a reference to a field name from the
79
+ * [`names`](https://ariakit.org/reference/use-form-store#names) object in the
80
+ * store, ensuring type safety.
81
+ *
82
+ * Live examples:
83
+ * - [FormRadio](https://ariakit.org/examples/form-radio)
84
+ * - [Form with Select](https://ariakit.org/examples/form-select)
85
+ */
86
+ name: StringLike;
87
+ /**
88
+ * Whether the field should be marked touched on blur.
89
+ * @default true
90
+ */
91
+ touchOnBlur?: BooleanOrCallback<FocusEvent>;
92
+ }
93
+ export type FormControlProps<T extends As = "input"> = Props<FormControlOptions<T>>;
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import {
3
+ FormControl,
4
+ useFormControl
5
+ } from "../__chunks/4GO43MST.js";
6
+ import "../__chunks/V4ZFXDFK.js";
7
+ import "../__chunks/UH3I23HL.js";
8
+ import "../__chunks/4UUKJZ4V.js";
9
+ import "../__chunks/3ORBWXWF.js";
10
+ import "../__chunks/6O5OEQGF.js";
11
+ import "../__chunks/XM66DUTO.js";
12
+ import "../__chunks/4R3V3JGP.js";
13
+ export {
14
+ FormControl,
15
+ useFormControl
16
+ };
@@ -18,15 +18,17 @@ import type { FormStore } from "./form-store.js";
18
18
  */
19
19
  export declare const useFormDescription: import("../utils/types.js").Hook<FormDescriptionOptions<"div">>;
20
20
  /**
21
- * Renders a description element for a form field.
21
+ * Renders a description element for a form field, which will automatically
22
+ * receive an `aria-describedby` attribute pointing to this element.
22
23
  * @see https://ariakit.org/components/form
23
24
  * @example
24
- * ```jsx
25
+ * ```jsx {10-12}
25
26
  * const form = useFormStore({
26
27
  * defaultValues: {
27
28
  * password: "",
28
29
  * },
29
30
  * });
31
+ *
30
32
  * <Form store={form}>
31
33
  * <FormLabel name={form.names.password}>Password</FormLabel>
32
34
  * <FormInput name={form.names.password} type="password" />
@@ -47,7 +49,16 @@ export interface FormDescriptionOptions<T extends As = "div"> extends Collection
47
49
  */
48
50
  store?: FormStore;
49
51
  /**
50
- * Name of the field.
52
+ * Name of the field described by this element. This can either be a string or
53
+ * a reference to a field name from the
54
+ * [`names`](https://ariakit.org/reference/use-form-store#names) object in the
55
+ * store, for type safety.
56
+ * @example
57
+ * ```jsx
58
+ * <FormDescription name="password">
59
+ * Password with at least 8 characters.
60
+ * </FormDescription>
61
+ * ```
51
62
  */
52
63
  name: StringLike;
53
64
  }
@@ -25,11 +25,11 @@ import type { FormStore } from "./form-store.js";
25
25
  */
26
26
  export declare const useFormError: import("../utils/types.js").Hook<FormErrorOptions<"div">>;
27
27
  /**
28
- * Renders an element that displays an error message. The `children` will be
29
- * automatically set to the error message set on the store.
28
+ * Renders an element that shows an error message. The `children` will
29
+ * automatically display the error message defined in the store.
30
30
  * @see https://ariakit.org/components/form
31
31
  * @example
32
- * ```jsx
32
+ * ```jsx {16}
33
33
  * const form = useFormStore({
34
34
  * defaultValues: {
35
35
  * email: "",
@@ -60,7 +60,14 @@ export interface FormErrorOptions<T extends As = "div"> extends CollectionItemOp
60
60
  */
61
61
  store?: FormStore;
62
62
  /**
63
- * Name of the field.
63
+ * Name of the field associated with this error. This can either be a string
64
+ * or a reference to a field name from the
65
+ * [`names`](https://ariakit.org/reference/use-form-store#names) object in the
66
+ * store, for type safety.
67
+ * @example
68
+ * ```jsx
69
+ * <FormError name="password" />
70
+ * ```
64
71
  */
65
72
  name: StringLike;
66
73
  }
@@ -1,16 +1,12 @@
1
- import type { FocusEvent } from "react";
2
- import type { StringLike } from "@ariakit/core/form/types";
3
- import type { BooleanOrCallback } from "@ariakit/core/utils/types";
4
- import type { CollectionItemOptions } from "../collection/collection-item.js";
5
1
  import type { As, Props } from "../utils/types.js";
6
- import type { FormStore } from "./form-store.js";
2
+ import type { FormControlOptions } from "./form-control.js";
7
3
  /**
8
4
  * Returns props to create a `FormField` component. Unlike `useFormInput`, this
9
5
  * hook doesn't automatically returns the `value` and `onChange` props. This is
10
6
  * so we can use it not only for native form elements but also for custom
11
7
  * components whose value is not controlled by the native `value` and `onChange`
12
8
  * props.
13
- * @see https://ariakit.org/components/form
9
+ * @deprecated Use `useFormControl` instead.
14
10
  * @example
15
11
  * ```jsx
16
12
  * const store = useFormStore({ defaultValues: { content: "" } });
@@ -30,15 +26,18 @@ import type { FormStore } from "./form-store.js";
30
26
  */
31
27
  export declare const useFormField: import("../utils/types.js").Hook<FormFieldOptions<"input">>;
32
28
  /**
33
- * Renders a form field. Unlike
29
+ * Abstract component that renders a form field. Unlike
34
30
  * [`FormInput`](https://ariakit.org/reference/form-input), this component
35
31
  * doesn't automatically pass the `value` and `onChange` props down to the
36
32
  * underlying element. This is so we can use it not only for native form
37
33
  * elements but also for custom components whose value is not controlled by the
38
34
  * native `value` and `onChange` props.
39
- * @see https://ariakit.org/components/form
35
+ * @deprecated
36
+ * This component has been renamed to
37
+ * [`FormControl`](https://ariakit.org/reference/form-control). The API remains
38
+ * the same.
40
39
  * @example
41
- * ```jsx
40
+ * ```jsx {11-19}
42
41
  * const form = useFormStore({
43
42
  * defaultValues: {
44
43
  * content: "",
@@ -50,31 +49,18 @@ export declare const useFormField: import("../utils/types.js").Hook<FormFieldOpt
50
49
  * <Form store={form}>
51
50
  * <FormLabel name={form.names.content}>Content</FormLabel>
52
51
  * <FormField
53
- * value={value}
54
- * onChange={(value) => form.setValue(form.names.content, value)}
55
- * render={<Editor />}
52
+ * name={form.names.content}
53
+ * render={
54
+ * <Editor
55
+ * value={value}
56
+ * onChange={(value) => form.setValue(form.names.content, value)}
57
+ * />
58
+ * }
56
59
  * />
57
60
  * </Form>
58
61
  * ```
59
62
  */
60
63
  export declare const FormField: import("../utils/types.js").Component<FormFieldOptions<"input">>;
61
- export interface FormFieldOptions<T extends As = "input"> extends CollectionItemOptions<T> {
62
- /**
63
- * Object returned by the
64
- * [`useFormStore`](https://ariakit.org/reference/use-form-store) hook. If not
65
- * provided, the closest [`Form`](https://ariakit.org/reference/form) or
66
- * [`FormProvider`](https://ariakit.org/reference/form-provider) components'
67
- * context will be used.
68
- */
69
- store?: FormStore;
70
- /**
71
- * Name of the field.
72
- */
73
- name: StringLike;
74
- /**
75
- * Whether the field should be marked touched on blur.
76
- * @default true
77
- */
78
- touchOnBlur?: BooleanOrCallback<FocusEvent>;
64
+ export interface FormFieldOptions<T extends As = "input"> extends FormControlOptions<T> {
79
65
  }
80
66
  export type FormFieldProps<T extends As = "input"> = Props<FormFieldOptions<T>>;
@@ -1,15 +1,30 @@
1
1
  "use client";
2
2
  import {
3
- FormField,
4
- useFormField
5
- } from "../__chunks/FS2EVEJO.js";
3
+ useFormControl
4
+ } from "../__chunks/4GO43MST.js";
6
5
  import "../__chunks/V4ZFXDFK.js";
7
6
  import "../__chunks/UH3I23HL.js";
8
7
  import "../__chunks/4UUKJZ4V.js";
9
- import "../__chunks/3ORBWXWF.js";
8
+ import {
9
+ createElement,
10
+ createHook,
11
+ createMemoComponent
12
+ } from "../__chunks/3ORBWXWF.js";
10
13
  import "../__chunks/6O5OEQGF.js";
11
14
  import "../__chunks/XM66DUTO.js";
12
15
  import "../__chunks/4R3V3JGP.js";
16
+
17
+ // src/form/form-field.ts
18
+ var useFormField = createHook((props) => {
19
+ return useFormControl(props);
20
+ });
21
+ var FormField = createMemoComponent((props) => {
22
+ const htmlProps = useFormField(props);
23
+ return createElement("input", htmlProps);
24
+ });
25
+ if (process.env.NODE_ENV !== "production") {
26
+ FormField.displayName = "FormField";
27
+ }
13
28
  export {
14
29
  FormField,
15
30
  useFormField
@@ -15,18 +15,20 @@ import type { FormStore } from "./form-store.js";
15
15
  */
16
16
  export declare const useFormGroupLabel: import("../utils/types.js").Hook<FormGroupLabelOptions<"div">>;
17
17
  /**
18
- * Renders a label in a form group. This component must be wrapped with
19
- * [`FormGroup`](https://ariakit.org/reference/form-group) so the
20
- * `aria-labelledby` prop is properly set on the form group element.
18
+ * Renders a label in a form group. This component must be wrapped with the
19
+ * [`FormGroup`](https://ariakit.org/reference/form-group) or
20
+ * [`FormRadioGroup`](https://ariakit.org/reference/form-radio-group) components
21
+ * so the `aria-labelledby` prop is properly set on the form group element.
21
22
  * @see https://ariakit.org/components/form
22
23
  * @example
23
- * ```jsx
24
+ * ```jsx {10}
24
25
  * const form = useFormStore({
25
26
  * defaultValues: {
26
27
  * username: "",
27
28
  * email: "",
28
29
  * },
29
30
  * });
31
+ *
30
32
  * <Form store={form}>
31
33
  * <FormGroup>
32
34
  * <FormGroupLabel>Account</FormGroupLabel>
@@ -17,16 +17,20 @@ import type { FormStore } from "./form-store.js";
17
17
  */
18
18
  export declare const useFormGroup: import("../utils/types.js").Hook<FormGroupOptions<"div">>;
19
19
  /**
20
- * Renders a form group.
20
+ * Renders a group element for form controls. The
21
+ * [`FormGroupLabel`](https://ariakit.org/reference/form-group-label) component
22
+ * can be used inside this component so the `aria-labelledby` prop is properly
23
+ * set on the group element.
21
24
  * @see https://ariakit.org/components/form
22
25
  * @example
23
- * ```jsx
26
+ * ```jsx {9-15}
24
27
  * const form = useFormStore({
25
28
  * defaultValues: {
26
29
  * username: "",
27
30
  * email: "",
28
31
  * },
29
32
  * });
33
+ *
30
34
  * <Form store={form}>
31
35
  * <FormGroup>
32
36
  * <FormGroupLabel>Account</FormGroupLabel>
@@ -1,8 +1,8 @@
1
1
  import type { FocusableOptions } from "../focusable/focusable.js";
2
2
  import type { As, Props } from "../utils/types.js";
3
- import type { FormFieldOptions } from "./form-field.js";
3
+ import type { FormControlOptions } from "./form-control.js";
4
4
  /**
5
- * Returns props to create a `FormInput` component. Unlike `useFormField`, this
5
+ * Returns props to create a `FormInput` component. Unlike `useFormControl`, this
6
6
  * hook returns the `value` and `onChange` props that can be passed to a native
7
7
  * input, select or textarea elements.
8
8
  * @see https://ariakit.org/components/form
@@ -19,17 +19,18 @@ import type { FormFieldOptions } from "./form-field.js";
19
19
  export declare const useFormInput: import("../utils/types.js").Hook<FormInputOptions<"input">>;
20
20
  /**
21
21
  * Renders a form input. Unlike
22
- * [`FormField`](https://ariakit.org/reference/form-field), this component
22
+ * [`FormControl`](https://ariakit.org/reference/form-control), this component
23
23
  * passes the `value` and `onChange` props down to the underlying element that
24
- * can be a native input, select or textarea elements.
24
+ * can be native input, select or textarea elements.
25
25
  * @see https://ariakit.org/components/form
26
26
  * @example
27
- * ```jsx
27
+ * ```jsx {9}
28
28
  * const form = useFormStore({
29
29
  * defaultValues: {
30
30
  * email: "",
31
31
  * },
32
32
  * });
33
+ *
33
34
  * <Form store={form}>
34
35
  * <FormLabel name={form.names.email}>Email</FormLabel>
35
36
  * <FormInput name={form.names.email} />
@@ -37,6 +38,6 @@ export declare const useFormInput: import("../utils/types.js").Hook<FormInputOpt
37
38
  * ```
38
39
  */
39
40
  export declare const FormInput: import("../utils/types.js").Component<FormInputOptions<"input">>;
40
- export interface FormInputOptions<T extends As = "input"> extends FormFieldOptions<T>, FocusableOptions<T> {
41
+ export interface FormInputOptions<T extends As = "input"> extends FormControlOptions<T>, FocusableOptions<T> {
41
42
  }
42
43
  export type FormInputProps<T extends As = "input"> = Props<FormInputOptions<T>>;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
- useFormField
4
- } from "../__chunks/FS2EVEJO.js";
3
+ useFormControl
4
+ } from "../__chunks/4GO43MST.js";
5
5
  import {
6
6
  useFormContext
7
7
  } from "../__chunks/V4ZFXDFK.js";
@@ -52,7 +52,7 @@ var useFormInput = createHook(
52
52
  onChange
53
53
  });
54
54
  props = useFocusable(props);
55
- props = useFormField(__spreadValues({ store, name }, props));
55
+ props = useFormControl(__spreadValues({ store, name }, props));
56
56
  return props;
57
57
  }
58
58
  );
@@ -21,19 +21,23 @@ import type { FormStore } from "./form-store.js";
21
21
  */
22
22
  export declare const useFormLabel: import("../utils/types.js").Hook<FormLabelOptions<"label">>;
23
23
  /**
24
- * Renders a label for a form field. If the field is not a native input, select
25
- * or textarea element, the component will render a `span` element. Instead of
26
- * relying on the `htmlFor` prop, it'll rely on the `aria-labelledby` attribute
27
- * on the form field. Clicking on the label will move focus to the field even if
28
- * it's not a native input.
24
+ * Renders a label associated with a form field, even if the field is not a
25
+ * native input.
26
+ *
27
+ * If the field is a native input, select or textarea element, this component
28
+ * will render a native `label` element and rely on its `htmlFor` prop.
29
+ * Otherwise, it'll render a `span` element and rely on the `aria-labelledby`
30
+ * attribute on the form field instead. Clicking on the label will move focus to
31
+ * the field even if it's not a native input.
29
32
  * @see https://ariakit.org/components/form
30
33
  * @example
31
- * ```jsx
34
+ * ```jsx {8}
32
35
  * const form = useFormStore({
33
36
  * defaultValues: {
34
37
  * email: "",
35
38
  * },
36
39
  * });
40
+ *
37
41
  * <Form store={form}>
38
42
  * <FormLabel name={form.names.email}>Email</Role>
39
43
  * <FormInput name={form.names.email} />
@@ -51,7 +55,14 @@ export interface FormLabelOptions<T extends As = "label"> extends CollectionItem
51
55
  */
52
56
  store?: FormStore;
53
57
  /**
54
- * Name of the field.
58
+ * Name of the field labeled by this element. This can either be a string or a
59
+ * reference to a field name from the
60
+ * [`names`](https://ariakit.org/reference/use-form-store#names) object in the
61
+ * store, for type safety.
62
+ * @example
63
+ * ```jsx
64
+ * <FormLabel name="email">Email</FormLabel>
65
+ * ```
55
66
  */
56
67
  name: StringLike;
57
68
  }
@@ -4,7 +4,8 @@ import type { PickRequired } from "@ariakit/core/utils/types";
4
4
  import type { FormStoreProps } from "./form-store.js";
5
5
  type Values = FormStoreValues;
6
6
  /**
7
- * Provides a form store to Form components.
7
+ * Provides a form store to [Form](https://ariakit.org/components/form)
8
+ * components.
8
9
  * @see https://ariakit.org/components/form
9
10
  * @example
10
11
  * ```jsx
@@ -32,14 +32,25 @@ export declare const useFormPush: import("../utils/types.js").Hook<FormPushOptio
32
32
  /**
33
33
  * Renders a button that will push items to an array value in the form store
34
34
  * when clicked.
35
+ *
36
+ * The [`name`](https://ariakit.org/reference/form-push#name) prop needs to be
37
+ * provided to identify the array field. The
38
+ * [`value`](https://ariakit.org/reference/form-push#value) prop is required to
39
+ * define the value that will be added to the array.
40
+ *
41
+ * By default, the newly added input will be automatically focused when the
42
+ * button is clicked unless the
43
+ * [`autoFocusOnClick`](https://ariakit.org/reference/form-push#autofocusonclick)
44
+ * prop is set to `false`.
35
45
  * @see https://ariakit.org/components/form
36
46
  * @example
37
- * ```jsx
47
+ * ```jsx {13-15}
38
48
  * const form = useFormStore({
39
49
  * defaultValues: {
40
50
  * languages: ["JavaScript", "PHP"],
41
51
  * },
42
52
  * });
53
+ *
43
54
  * const values = form.useState("values");
44
55
  *
45
56
  * <Form store={form}>
@@ -63,11 +74,14 @@ export interface FormPushOptions<T extends As = "button"> extends ButtonOptions<
63
74
  */
64
75
  store?: FormStore;
65
76
  /**
66
- * Name of the array field.
77
+ * Name of the array field. This can either be a string or a reference to a
78
+ * field name from the
79
+ * [`names`](https://ariakit.org/reference/use-form-store#names) object in the
80
+ * store, for type safety.
67
81
  */
68
82
  name: StringLike;
69
83
  /**
70
- * Value that will be initially set to the item when it is pushed.
84
+ * Value that will initially be assigned to the array item when it's pushed.
71
85
  */
72
86
  value: unknown;
73
87
  /**