@ariakit/react-components 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1155) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/button/button.d.ts +2 -0
  3. package/dist/button/button.js +53 -0
  4. package/dist/button/button.js.map +1 -0
  5. package/dist/button-Cp853csH.d.ts +34 -0
  6. package/dist/button-Cp853csH.d.ts.map +1 -0
  7. package/dist/checkbox/checkbox-check.d.ts +56 -0
  8. package/dist/checkbox/checkbox-check.d.ts.map +1 -0
  9. package/dist/checkbox/checkbox-check.js +77 -0
  10. package/dist/checkbox/checkbox-check.js.map +1 -0
  11. package/dist/checkbox/checkbox-checked-context.d.ts +5 -0
  12. package/dist/checkbox/checkbox-checked-context.d.ts.map +1 -0
  13. package/dist/checkbox/checkbox-checked-context.js +8 -0
  14. package/dist/checkbox/checkbox-checked-context.js.map +1 -0
  15. package/dist/checkbox/checkbox-context.d.ts +24 -0
  16. package/dist/checkbox/checkbox-context.d.ts.map +1 -0
  17. package/dist/checkbox/checkbox-context.js +26 -0
  18. package/dist/checkbox/checkbox-context.js.map +1 -0
  19. package/dist/checkbox/checkbox-provider.d.ts +35 -0
  20. package/dist/checkbox/checkbox-provider.d.ts.map +1 -0
  21. package/dist/checkbox/checkbox-provider.js +15 -0
  22. package/dist/checkbox/checkbox-provider.js.map +1 -0
  23. package/dist/checkbox/checkbox-store.d.ts +2 -0
  24. package/dist/checkbox/checkbox-store.js +18 -0
  25. package/dist/checkbox/checkbox-store.js.map +1 -0
  26. package/dist/checkbox/checkbox.d.ts +91 -0
  27. package/dist/checkbox/checkbox.d.ts.map +1 -0
  28. package/dist/checkbox/checkbox.js +148 -0
  29. package/dist/checkbox/checkbox.js.map +1 -0
  30. package/dist/checkbox-store-CYZPR4N4.d.ts +38 -0
  31. package/dist/checkbox-store-CYZPR4N4.d.ts.map +1 -0
  32. package/dist/collection/collection-context.d.ts +24 -0
  33. package/dist/collection/collection-context.d.ts.map +1 -0
  34. package/dist/collection/collection-context.js +26 -0
  35. package/dist/collection/collection-context.js.map +1 -0
  36. package/dist/collection/collection-item-offscreen.d.ts +2 -0
  37. package/dist/collection/collection-item-offscreen.js +88 -0
  38. package/dist/collection/collection-item-offscreen.js.map +1 -0
  39. package/dist/collection/collection-item.d.ts +2 -0
  40. package/dist/collection/collection-item.js +69 -0
  41. package/dist/collection/collection-item.js.map +1 -0
  42. package/dist/collection/collection-provider.d.ts +26 -0
  43. package/dist/collection/collection-provider.d.ts.map +1 -0
  44. package/dist/collection/collection-provider.js +15 -0
  45. package/dist/collection/collection-provider.js.map +1 -0
  46. package/dist/collection/collection-renderer.d.ts +2 -0
  47. package/dist/collection/collection-renderer.js +580 -0
  48. package/dist/collection/collection-renderer.js.map +1 -0
  49. package/dist/collection/collection-store.d.ts +2 -0
  50. package/dist/collection/collection-store.js +18 -0
  51. package/dist/collection/collection-store.js.map +1 -0
  52. package/dist/collection/collection.d.ts +55 -0
  53. package/dist/collection/collection.d.ts.map +1 -0
  54. package/dist/collection/collection.js +55 -0
  55. package/dist/collection/collection.js.map +1 -0
  56. package/dist/collection-item-C-g2BwVF.d.ts +84 -0
  57. package/dist/collection-item-C-g2BwVF.d.ts.map +1 -0
  58. package/dist/collection-item-offscreen-DyXa-sqj.d.ts +30 -0
  59. package/dist/collection-item-offscreen-DyXa-sqj.d.ts.map +1 -0
  60. package/dist/collection-renderer-DsPD9ksD.d.ts +469 -0
  61. package/dist/collection-renderer-DsPD9ksD.d.ts.map +1 -0
  62. package/dist/collection-store-CbwzYsWf.d.ts +42 -0
  63. package/dist/collection-store-CbwzYsWf.d.ts.map +1 -0
  64. package/dist/combobox/combobox-cancel.d.ts +62 -0
  65. package/dist/combobox/combobox-cancel.d.ts.map +1 -0
  66. package/dist/combobox/combobox-cancel.js +98 -0
  67. package/dist/combobox/combobox-cancel.js.map +1 -0
  68. package/dist/combobox/combobox-context.d.ts +27 -0
  69. package/dist/combobox/combobox-context.d.ts.map +1 -0
  70. package/dist/combobox/combobox-context.js +32 -0
  71. package/dist/combobox/combobox-context.js.map +1 -0
  72. package/dist/combobox/combobox-disclosure.d.ts +63 -0
  73. package/dist/combobox/combobox-disclosure.d.ts.map +1 -0
  74. package/dist/combobox/combobox-disclosure.js +108 -0
  75. package/dist/combobox/combobox-disclosure.js.map +1 -0
  76. package/dist/combobox/combobox-group-label.d.ts +56 -0
  77. package/dist/combobox/combobox-group-label.d.ts.map +1 -0
  78. package/dist/combobox/combobox-group-label.js +47 -0
  79. package/dist/combobox/combobox-group-label.js.map +1 -0
  80. package/dist/combobox/combobox-group.d.ts +63 -0
  81. package/dist/combobox/combobox-group.d.ts.map +1 -0
  82. package/dist/combobox/combobox-group.js +67 -0
  83. package/dist/combobox/combobox-group.js.map +1 -0
  84. package/dist/combobox/combobox-item-check.d.ts +61 -0
  85. package/dist/combobox/combobox-item-check.d.ts.map +1 -0
  86. package/dist/combobox/combobox-item-check.js +62 -0
  87. package/dist/combobox/combobox-item-check.js.map +1 -0
  88. package/dist/combobox/combobox-item-offscreen.d.ts +34 -0
  89. package/dist/combobox/combobox-item-offscreen.d.ts.map +1 -0
  90. package/dist/combobox/combobox-item-offscreen.js +53 -0
  91. package/dist/combobox/combobox-item-offscreen.js.map +1 -0
  92. package/dist/combobox/combobox-item-value.d.ts +103 -0
  93. package/dist/combobox/combobox-item-value.d.ts.map +1 -0
  94. package/dist/combobox/combobox-item-value.js +143 -0
  95. package/dist/combobox/combobox-item-value.js.map +1 -0
  96. package/dist/combobox/combobox-item.d.ts +146 -0
  97. package/dist/combobox/combobox-item.d.ts.map +1 -0
  98. package/dist/combobox/combobox-item.js +157 -0
  99. package/dist/combobox/combobox-item.js.map +1 -0
  100. package/dist/combobox/combobox-label.d.ts +50 -0
  101. package/dist/combobox/combobox-label.d.ts.map +1 -0
  102. package/dist/combobox/combobox-label.js +51 -0
  103. package/dist/combobox/combobox-label.js.map +1 -0
  104. package/dist/combobox/combobox-list.d.ts +55 -0
  105. package/dist/combobox/combobox-list.d.ts.map +1 -0
  106. package/dist/combobox/combobox-list.js +106 -0
  107. package/dist/combobox/combobox-list.js.map +1 -0
  108. package/dist/combobox/combobox-popover.d.ts +46 -0
  109. package/dist/combobox/combobox-popover.d.ts.map +1 -0
  110. package/dist/combobox/combobox-popover.js +115 -0
  111. package/dist/combobox/combobox-popover.js.map +1 -0
  112. package/dist/combobox/combobox-provider.d.ts +30 -0
  113. package/dist/combobox/combobox-provider.d.ts.map +1 -0
  114. package/dist/combobox/combobox-provider.js +15 -0
  115. package/dist/combobox/combobox-provider.js.map +1 -0
  116. package/dist/combobox/combobox-row.d.ts +66 -0
  117. package/dist/combobox/combobox-row.d.ts.map +1 -0
  118. package/dist/combobox/combobox-row.js +70 -0
  119. package/dist/combobox/combobox-row.js.map +1 -0
  120. package/dist/combobox/combobox-separator.d.ts +61 -0
  121. package/dist/combobox/combobox-separator.d.ts.map +1 -0
  122. package/dist/combobox/combobox-separator.js +60 -0
  123. package/dist/combobox/combobox-separator.js.map +1 -0
  124. package/dist/combobox/combobox-store.d.ts +2 -0
  125. package/dist/combobox/combobox-store.js +33 -0
  126. package/dist/combobox/combobox-store.js.map +1 -0
  127. package/dist/combobox/combobox-value.d.ts +49 -0
  128. package/dist/combobox/combobox-value.d.ts.map +1 -0
  129. package/dist/combobox/combobox-value.js +40 -0
  130. package/dist/combobox/combobox-value.js.map +1 -0
  131. package/dist/combobox/combobox.d.ts +268 -0
  132. package/dist/combobox/combobox.d.ts.map +1 -0
  133. package/dist/combobox/combobox.js +399 -0
  134. package/dist/combobox/combobox.js.map +1 -0
  135. package/dist/combobox-store-DEVQ45mZ.d.ts +80 -0
  136. package/dist/combobox-store-DEVQ45mZ.d.ts.map +1 -0
  137. package/dist/command/command.d.ts +2 -0
  138. package/dist/command/command.js +130 -0
  139. package/dist/command/command.js.map +1 -0
  140. package/dist/command-DckndCUK.d.ts +59 -0
  141. package/dist/command-DckndCUK.d.ts.map +1 -0
  142. package/dist/composite/composite-container.d.ts +59 -0
  143. package/dist/composite/composite-container.d.ts.map +1 -0
  144. package/dist/composite/composite-container.js +164 -0
  145. package/dist/composite/composite-container.js.map +1 -0
  146. package/dist/composite/composite-context.d.ts +34 -0
  147. package/dist/composite/composite-context.d.ts.map +1 -0
  148. package/dist/composite/composite-context.js +30 -0
  149. package/dist/composite/composite-context.js.map +1 -0
  150. package/dist/composite/composite-group-label.d.ts +55 -0
  151. package/dist/composite/composite-group-label.d.ts.map +1 -0
  152. package/dist/composite/composite-group-label.js +46 -0
  153. package/dist/composite/composite-group-label.js.map +1 -0
  154. package/dist/composite/composite-group.d.ts +60 -0
  155. package/dist/composite/composite-group.d.ts.map +1 -0
  156. package/dist/composite/composite-group.js +51 -0
  157. package/dist/composite/composite-group.js.map +1 -0
  158. package/dist/composite/composite-hover.d.ts +2 -0
  159. package/dist/composite/composite-hover.js +114 -0
  160. package/dist/composite/composite-hover.js.map +1 -0
  161. package/dist/composite/composite-input.d.ts +55 -0
  162. package/dist/composite/composite-input.d.ts.map +1 -0
  163. package/dist/composite/composite-input.js +91 -0
  164. package/dist/composite/composite-input.js.map +1 -0
  165. package/dist/composite/composite-item-offscreen.d.ts +39 -0
  166. package/dist/composite/composite-item-offscreen.d.ts.map +1 -0
  167. package/dist/composite/composite-item-offscreen.js +72 -0
  168. package/dist/composite/composite-item-offscreen.js.map +1 -0
  169. package/dist/composite/composite-item.d.ts +2 -0
  170. package/dist/composite/composite-item.js +290 -0
  171. package/dist/composite/composite-item.js.map +1 -0
  172. package/dist/composite/composite-overflow-disclosure.d.ts +53 -0
  173. package/dist/composite/composite-overflow-disclosure.d.ts.map +1 -0
  174. package/dist/composite/composite-overflow-disclosure.js +84 -0
  175. package/dist/composite/composite-overflow-disclosure.js.map +1 -0
  176. package/dist/composite/composite-overflow-store.d.ts +38 -0
  177. package/dist/composite/composite-overflow-store.d.ts.map +1 -0
  178. package/dist/composite/composite-overflow-store.js +36 -0
  179. package/dist/composite/composite-overflow-store.js.map +1 -0
  180. package/dist/composite/composite-overflow.d.ts +54 -0
  181. package/dist/composite/composite-overflow.d.ts.map +1 -0
  182. package/dist/composite/composite-overflow.js +82 -0
  183. package/dist/composite/composite-overflow.js.map +1 -0
  184. package/dist/composite/composite-provider.d.ts +28 -0
  185. package/dist/composite/composite-provider.d.ts.map +1 -0
  186. package/dist/composite/composite-provider.js +15 -0
  187. package/dist/composite/composite-provider.js.map +1 -0
  188. package/dist/composite/composite-renderer.d.ts +329 -0
  189. package/dist/composite/composite-renderer.d.ts.map +1 -0
  190. package/dist/composite/composite-renderer.js +121 -0
  191. package/dist/composite/composite-renderer.js.map +1 -0
  192. package/dist/composite/composite-row.d.ts +67 -0
  193. package/dist/composite/composite-row.d.ts.map +1 -0
  194. package/dist/composite/composite-row.js +86 -0
  195. package/dist/composite/composite-row.js.map +1 -0
  196. package/dist/composite/composite-separator.d.ts +61 -0
  197. package/dist/composite/composite-separator.d.ts.map +1 -0
  198. package/dist/composite/composite-separator.js +55 -0
  199. package/dist/composite/composite-separator.js.map +1 -0
  200. package/dist/composite/composite-store.d.ts +2 -0
  201. package/dist/composite/composite-store.js +33 -0
  202. package/dist/composite/composite-store.js.map +1 -0
  203. package/dist/composite/composite-typeahead.d.ts +2 -0
  204. package/dist/composite/composite-typeahead.js +126 -0
  205. package/dist/composite/composite-typeahead.js.map +1 -0
  206. package/dist/composite/composite.d.ts +2 -0
  207. package/dist/composite/composite.js +273 -0
  208. package/dist/composite/composite.js.map +1 -0
  209. package/dist/composite/utils.d.ts +52 -0
  210. package/dist/composite/utils.d.ts.map +1 -0
  211. package/dist/composite/utils.js +93 -0
  212. package/dist/composite/utils.js.map +1 -0
  213. package/dist/composite-DLvyFHMq.d.ts +124 -0
  214. package/dist/composite-DLvyFHMq.d.ts.map +1 -0
  215. package/dist/composite-hover-C7ul163w.d.ts +103 -0
  216. package/dist/composite-hover-C7ul163w.d.ts.map +1 -0
  217. package/dist/composite-item-B4WTelVz.d.ts +141 -0
  218. package/dist/composite-item-B4WTelVz.d.ts.map +1 -0
  219. package/dist/composite-store-DyJc-XRA.d.ts +43 -0
  220. package/dist/composite-store-DyJc-XRA.d.ts.map +1 -0
  221. package/dist/composite-typeahead-DDhpyKqm.d.ts +63 -0
  222. package/dist/composite-typeahead-DDhpyKqm.d.ts.map +1 -0
  223. package/dist/dialog/dialog-backdrop.d.ts +16 -0
  224. package/dist/dialog/dialog-backdrop.d.ts.map +1 -0
  225. package/dist/dialog/dialog-backdrop.js +58 -0
  226. package/dist/dialog/dialog-backdrop.js.map +1 -0
  227. package/dist/dialog/dialog-context.d.ts +27 -0
  228. package/dist/dialog/dialog-context.d.ts.map +1 -0
  229. package/dist/dialog/dialog-context.js +30 -0
  230. package/dist/dialog/dialog-context.js.map +1 -0
  231. package/dist/dialog/dialog-description.d.ts +2 -0
  232. package/dist/dialog/dialog-description.js +53 -0
  233. package/dist/dialog/dialog-description.js.map +1 -0
  234. package/dist/dialog/dialog-disclosure.d.ts +2 -0
  235. package/dist/dialog/dialog-disclosure.js +52 -0
  236. package/dist/dialog/dialog-disclosure.js.map +1 -0
  237. package/dist/dialog/dialog-dismiss.d.ts +2 -0
  238. package/dist/dialog/dialog-dismiss.js +80 -0
  239. package/dist/dialog/dialog-dismiss.js.map +1 -0
  240. package/dist/dialog/dialog-heading.d.ts +2 -0
  241. package/dist/dialog/dialog-heading.js +54 -0
  242. package/dist/dialog/dialog-heading.js.map +1 -0
  243. package/dist/dialog/dialog-provider.d.ts +22 -0
  244. package/dist/dialog/dialog-provider.d.ts.map +1 -0
  245. package/dist/dialog/dialog-provider.js +26 -0
  246. package/dist/dialog/dialog-provider.js.map +1 -0
  247. package/dist/dialog/dialog-store.d.ts +2 -0
  248. package/dist/dialog/dialog-store.js +28 -0
  249. package/dist/dialog/dialog-store.js.map +1 -0
  250. package/dist/dialog/dialog.d.ts +2 -0
  251. package/dist/dialog/dialog.js +429 -0
  252. package/dist/dialog/dialog.js.map +1 -0
  253. package/dist/dialog/utils/disable-accessibility-tree-outside.d.ts +7 -0
  254. package/dist/dialog/utils/disable-accessibility-tree-outside.d.ts.map +1 -0
  255. package/dist/dialog/utils/disable-accessibility-tree-outside.js +24 -0
  256. package/dist/dialog/utils/disable-accessibility-tree-outside.js.map +1 -0
  257. package/dist/dialog/utils/disable-tree.d.ts +9 -0
  258. package/dist/dialog/utils/disable-tree.d.ts.map +1 -0
  259. package/dist/dialog/utils/disable-tree.js +48 -0
  260. package/dist/dialog/utils/disable-tree.js.map +1 -0
  261. package/dist/dialog/utils/is-backdrop.d.ts +5 -0
  262. package/dist/dialog/utils/is-backdrop.d.ts.map +1 -0
  263. package/dist/dialog/utils/is-backdrop.js +15 -0
  264. package/dist/dialog/utils/is-backdrop.js.map +1 -0
  265. package/dist/dialog/utils/is-focus-trap.d.ts +5 -0
  266. package/dist/dialog/utils/is-focus-trap.d.ts.map +1 -0
  267. package/dist/dialog/utils/is-focus-trap.js +14 -0
  268. package/dist/dialog/utils/is-focus-trap.js.map +1 -0
  269. package/dist/dialog/utils/mark-tree-outside.d.ts +9 -0
  270. package/dist/dialog/utils/mark-tree-outside.d.ts.map +1 -0
  271. package/dist/dialog/utils/mark-tree-outside.js +44 -0
  272. package/dist/dialog/utils/mark-tree-outside.js.map +1 -0
  273. package/dist/dialog/utils/orchestrate.d.ts +9 -0
  274. package/dist/dialog/utils/orchestrate.d.ts.map +1 -0
  275. package/dist/dialog/utils/orchestrate.js +77 -0
  276. package/dist/dialog/utils/orchestrate.js.map +1 -0
  277. package/dist/dialog/utils/prepend-hidden-dismiss.d.ts +5 -0
  278. package/dist/dialog/utils/prepend-hidden-dismiss.d.ts.map +1 -0
  279. package/dist/dialog/utils/prepend-hidden-dismiss.js +31 -0
  280. package/dist/dialog/utils/prepend-hidden-dismiss.js.map +1 -0
  281. package/dist/dialog/utils/supports-inert.d.ts +5 -0
  282. package/dist/dialog/utils/supports-inert.d.ts.map +1 -0
  283. package/dist/dialog/utils/supports-inert.js +9 -0
  284. package/dist/dialog/utils/supports-inert.js.map +1 -0
  285. package/dist/dialog/utils/use-hide-on-interact-outside.d.ts +9 -0
  286. package/dist/dialog/utils/use-hide-on-interact-outside.d.ts.map +1 -0
  287. package/dist/dialog/utils/use-hide-on-interact-outside.js +123 -0
  288. package/dist/dialog/utils/use-hide-on-interact-outside.js.map +1 -0
  289. package/dist/dialog/utils/use-nested-dialogs.d.ts +11 -0
  290. package/dist/dialog/utils/use-nested-dialogs.d.ts.map +1 -0
  291. package/dist/dialog/utils/use-nested-dialogs.js +40 -0
  292. package/dist/dialog/utils/use-nested-dialogs.js.map +1 -0
  293. package/dist/dialog/utils/use-prevent-body-scroll.d.ts +5 -0
  294. package/dist/dialog/utils/use-prevent-body-scroll.d.ts.map +1 -0
  295. package/dist/dialog/utils/use-prevent-body-scroll.js +60 -0
  296. package/dist/dialog/utils/use-prevent-body-scroll.js.map +1 -0
  297. package/dist/dialog/utils/use-previous-mouse-down-ref.d.ts +5 -0
  298. package/dist/dialog/utils/use-previous-mouse-down-ref.d.ts.map +1 -0
  299. package/dist/dialog/utils/use-previous-mouse-down-ref.js +22 -0
  300. package/dist/dialog/utils/use-previous-mouse-down-ref.js.map +1 -0
  301. package/dist/dialog/utils/use-root-dialog.d.ts +16 -0
  302. package/dist/dialog/utils/use-root-dialog.d.ts.map +1 -0
  303. package/dist/dialog/utils/use-root-dialog.js +47 -0
  304. package/dist/dialog/utils/use-root-dialog.js.map +1 -0
  305. package/dist/dialog/utils/walk-tree-outside.d.ts +8 -0
  306. package/dist/dialog/utils/walk-tree-outside.d.ts.map +1 -0
  307. package/dist/dialog/utils/walk-tree-outside.js +58 -0
  308. package/dist/dialog/utils/walk-tree-outside.js.map +1 -0
  309. package/dist/dialog-C__C-zX2.d.ts +267 -0
  310. package/dist/dialog-C__C-zX2.d.ts.map +1 -0
  311. package/dist/dialog-description-BCZJ1Kyd.d.ts +48 -0
  312. package/dist/dialog-description-BCZJ1Kyd.d.ts.map +1 -0
  313. package/dist/dialog-disclosure-DLD10zlb.d.ts +47 -0
  314. package/dist/dialog-disclosure-DLD10zlb.d.ts.map +1 -0
  315. package/dist/dialog-dismiss-CnwEbzc6.d.ts +48 -0
  316. package/dist/dialog-dismiss-CnwEbzc6.d.ts.map +1 -0
  317. package/dist/dialog-heading-DQvnOfZH.d.ts +49 -0
  318. package/dist/dialog-heading-DQvnOfZH.d.ts.map +1 -0
  319. package/dist/dialog-store-Cjt12T_Y.d.ts +29 -0
  320. package/dist/dialog-store-Cjt12T_Y.d.ts.map +1 -0
  321. package/dist/disclosure/disclosure-content.d.ts +2 -0
  322. package/dist/disclosure/disclosure-content.js +171 -0
  323. package/dist/disclosure/disclosure-content.js.map +1 -0
  324. package/dist/disclosure/disclosure-context.d.ts +24 -0
  325. package/dist/disclosure/disclosure-context.d.ts.map +1 -0
  326. package/dist/disclosure/disclosure-context.js +26 -0
  327. package/dist/disclosure/disclosure-context.js.map +1 -0
  328. package/dist/disclosure/disclosure-provider.d.ts +23 -0
  329. package/dist/disclosure/disclosure-provider.d.ts.map +1 -0
  330. package/dist/disclosure/disclosure-provider.js +27 -0
  331. package/dist/disclosure/disclosure-provider.js.map +1 -0
  332. package/dist/disclosure/disclosure-store.d.ts +2 -0
  333. package/dist/disclosure/disclosure-store.js +32 -0
  334. package/dist/disclosure/disclosure-store.js.map +1 -0
  335. package/dist/disclosure/disclosure.d.ts +2 -0
  336. package/dist/disclosure/disclosure.js +83 -0
  337. package/dist/disclosure/disclosure.js.map +1 -0
  338. package/dist/disclosure-CQ37hPVP.d.ts +60 -0
  339. package/dist/disclosure-CQ37hPVP.d.ts.map +1 -0
  340. package/dist/disclosure-content-BbPkZgAc.d.ts +88 -0
  341. package/dist/disclosure-content-BbPkZgAc.d.ts.map +1 -0
  342. package/dist/disclosure-store-BsaBaRKv.d.ts +58 -0
  343. package/dist/disclosure-store-BsaBaRKv.d.ts.map +1 -0
  344. package/dist/focus-trap/focus-trap-region.d.ts +42 -0
  345. package/dist/focus-trap/focus-trap-region.d.ts.map +1 -0
  346. package/dist/focus-trap/focus-trap-region.js +69 -0
  347. package/dist/focus-trap/focus-trap-region.js.map +1 -0
  348. package/dist/focus-trap/focus-trap.d.ts +31 -0
  349. package/dist/focus-trap/focus-trap.d.ts.map +1 -0
  350. package/dist/focus-trap/focus-trap.js +45 -0
  351. package/dist/focus-trap/focus-trap.js.map +1 -0
  352. package/dist/focusable/focusable-container.d.ts +43 -0
  353. package/dist/focusable/focusable-container.d.ts.map +1 -0
  354. package/dist/focusable/focusable-container.js +41 -0
  355. package/dist/focusable/focusable-container.js.map +1 -0
  356. package/dist/focusable/focusable-context.d.ts +5 -0
  357. package/dist/focusable/focusable-context.d.ts.map +1 -0
  358. package/dist/focusable/focusable-context.js +8 -0
  359. package/dist/focusable/focusable-context.js.map +1 -0
  360. package/dist/focusable/focusable.d.ts +2 -0
  361. package/dist/focusable/focusable.js +273 -0
  362. package/dist/focusable/focusable.js.map +1 -0
  363. package/dist/focusable-B00tOxtB.d.ts +142 -0
  364. package/dist/focusable-B00tOxtB.d.ts.map +1 -0
  365. package/dist/form/form-checkbox.d.ts +50 -0
  366. package/dist/form/form-checkbox.d.ts.map +1 -0
  367. package/dist/form/form-checkbox.js +73 -0
  368. package/dist/form/form-checkbox.js.map +1 -0
  369. package/dist/form/form-context.d.ts +24 -0
  370. package/dist/form/form-context.d.ts.map +1 -0
  371. package/dist/form/form-context.js +27 -0
  372. package/dist/form/form-context.js.map +1 -0
  373. package/dist/form/form-control.d.ts +100 -0
  374. package/dist/form/form-control.d.ts.map +1 -0
  375. package/dist/form/form-control.js +139 -0
  376. package/dist/form/form-control.js.map +1 -0
  377. package/dist/form/form-description.d.ts +73 -0
  378. package/dist/form/form-description.d.ts.map +1 -0
  379. package/dist/form/form-description.js +83 -0
  380. package/dist/form/form-description.js.map +1 -0
  381. package/dist/form/form-error.d.ts +82 -0
  382. package/dist/form/form-error.d.ts.map +1 -0
  383. package/dist/form/form-error.js +102 -0
  384. package/dist/form/form-error.js.map +1 -0
  385. package/dist/form/form-field.d.ts +73 -0
  386. package/dist/form/form-field.d.ts.map +1 -0
  387. package/dist/form/form-field.js +74 -0
  388. package/dist/form/form-field.js.map +1 -0
  389. package/dist/form/form-group-label.d.ts +62 -0
  390. package/dist/form/form-group-label.d.ts.map +1 -0
  391. package/dist/form/form-group-label.js +54 -0
  392. package/dist/form/form-group-label.js.map +1 -0
  393. package/dist/form/form-group.d.ts +64 -0
  394. package/dist/form/form-group.d.ts.map +1 -0
  395. package/dist/form/form-group.js +56 -0
  396. package/dist/form/form-group.js.map +1 -0
  397. package/dist/form/form-input.d.ts +50 -0
  398. package/dist/form/form-input.d.ts.map +1 -0
  399. package/dist/form/form-input.js +74 -0
  400. package/dist/form/form-input.js.map +1 -0
  401. package/dist/form/form-label.d.ts +77 -0
  402. package/dist/form/form-label.d.ts.map +1 -0
  403. package/dist/form/form-label.js +120 -0
  404. package/dist/form/form-label.js.map +1 -0
  405. package/dist/form/form-provider.d.ts +28 -0
  406. package/dist/form/form-provider.d.ts.map +1 -0
  407. package/dist/form/form-provider.js +15 -0
  408. package/dist/form/form-provider.js.map +1 -0
  409. package/dist/form/form-push.d.ts +102 -0
  410. package/dist/form/form-push.d.ts.map +1 -0
  411. package/dist/form/form-push.js +134 -0
  412. package/dist/form/form-push.js.map +1 -0
  413. package/dist/form/form-radio-group.d.ts +56 -0
  414. package/dist/form/form-radio-group.d.ts.map +1 -0
  415. package/dist/form/form-radio-group.js +68 -0
  416. package/dist/form/form-radio-group.js.map +1 -0
  417. package/dist/form/form-radio.d.ts +58 -0
  418. package/dist/form/form-radio.d.ts.map +1 -0
  419. package/dist/form/form-radio.js +90 -0
  420. package/dist/form/form-radio.js.map +1 -0
  421. package/dist/form/form-remove.d.ts +102 -0
  422. package/dist/form/form-remove.d.ts.map +1 -0
  423. package/dist/form/form-remove.js +116 -0
  424. package/dist/form/form-remove.js.map +1 -0
  425. package/dist/form/form-reset.d.ts +51 -0
  426. package/dist/form/form-reset.d.ts.map +1 -0
  427. package/dist/form/form-reset.js +54 -0
  428. package/dist/form/form-reset.js.map +1 -0
  429. package/dist/form/form-store.d.ts +2 -0
  430. package/dist/form/form-store.js +41 -0
  431. package/dist/form/form-store.js.map +1 -0
  432. package/dist/form/form-submit.d.ts +57 -0
  433. package/dist/form/form-submit.d.ts.map +1 -0
  434. package/dist/form/form-submit.js +59 -0
  435. package/dist/form/form-submit.js.map +1 -0
  436. package/dist/form/form.d.ts +101 -0
  437. package/dist/form/form.d.ts.map +1 -0
  438. package/dist/form/form.js +146 -0
  439. package/dist/form/form.js.map +1 -0
  440. package/dist/form-store-C4Kf5QHm.d.ts +120 -0
  441. package/dist/form-store-C4Kf5QHm.d.ts.map +1 -0
  442. package/dist/group/group-label-context.d.ts +7 -0
  443. package/dist/group/group-label-context.d.ts.map +1 -0
  444. package/dist/group/group-label-context.js +8 -0
  445. package/dist/group/group-label-context.js.map +1 -0
  446. package/dist/group/group-label.d.ts +2 -0
  447. package/dist/group/group-label.js +52 -0
  448. package/dist/group/group-label.js.map +1 -0
  449. package/dist/group/group.d.ts +2 -0
  450. package/dist/group/group.js +47 -0
  451. package/dist/group/group.js.map +1 -0
  452. package/dist/group-CamegDJA.d.ts +32 -0
  453. package/dist/group-CamegDJA.d.ts.map +1 -0
  454. package/dist/group-label-C16IDs1b.d.ts +37 -0
  455. package/dist/group-label-C16IDs1b.d.ts.map +1 -0
  456. package/dist/heading/heading-context.d.ts +7 -0
  457. package/dist/heading/heading-context.d.ts.map +1 -0
  458. package/dist/heading/heading-context.js +8 -0
  459. package/dist/heading/heading-context.js.map +1 -0
  460. package/dist/heading/heading-level.d.ts +35 -0
  461. package/dist/heading/heading-level.d.ts.map +1 -0
  462. package/dist/heading/heading-level.js +33 -0
  463. package/dist/heading/heading-level.js.map +1 -0
  464. package/dist/heading/heading.d.ts +2 -0
  465. package/dist/heading/heading.js +56 -0
  466. package/dist/heading/heading.js.map +1 -0
  467. package/dist/heading/utils.d.ts +2 -0
  468. package/dist/heading/utils.js +1 -0
  469. package/dist/heading-zY9g_9K-.d.ts +42 -0
  470. package/dist/heading-zY9g_9K-.d.ts.map +1 -0
  471. package/dist/hovercard/hovercard-anchor.d.ts +59 -0
  472. package/dist/hovercard/hovercard-anchor.d.ts.map +1 -0
  473. package/dist/hovercard/hovercard-anchor.js +106 -0
  474. package/dist/hovercard/hovercard-anchor.js.map +1 -0
  475. package/dist/hovercard/hovercard-arrow.d.ts +54 -0
  476. package/dist/hovercard/hovercard-arrow.d.ts.map +1 -0
  477. package/dist/hovercard/hovercard-arrow.js +51 -0
  478. package/dist/hovercard/hovercard-arrow.js.map +1 -0
  479. package/dist/hovercard/hovercard-context.d.ts +24 -0
  480. package/dist/hovercard/hovercard-context.d.ts.map +1 -0
  481. package/dist/hovercard/hovercard-context.js +27 -0
  482. package/dist/hovercard/hovercard-context.js.map +1 -0
  483. package/dist/hovercard/hovercard-description.d.ts +51 -0
  484. package/dist/hovercard/hovercard-description.d.ts.map +1 -0
  485. package/dist/hovercard/hovercard-description.js +42 -0
  486. package/dist/hovercard/hovercard-description.js.map +1 -0
  487. package/dist/hovercard/hovercard-disclosure.d.ts +51 -0
  488. package/dist/hovercard/hovercard-disclosure.d.ts.map +1 -0
  489. package/dist/hovercard/hovercard-disclosure.js +122 -0
  490. package/dist/hovercard/hovercard-disclosure.js.map +1 -0
  491. package/dist/hovercard/hovercard-dismiss.d.ts +50 -0
  492. package/dist/hovercard/hovercard-dismiss.d.ts.map +1 -0
  493. package/dist/hovercard/hovercard-dismiss.js +47 -0
  494. package/dist/hovercard/hovercard-dismiss.js.map +1 -0
  495. package/dist/hovercard/hovercard-heading.d.ts +51 -0
  496. package/dist/hovercard/hovercard-heading.d.ts.map +1 -0
  497. package/dist/hovercard/hovercard-heading.js +42 -0
  498. package/dist/hovercard/hovercard-heading.js.map +1 -0
  499. package/dist/hovercard/hovercard-provider.d.ts +23 -0
  500. package/dist/hovercard/hovercard-provider.d.ts.map +1 -0
  501. package/dist/hovercard/hovercard-provider.js +27 -0
  502. package/dist/hovercard/hovercard-provider.js.map +1 -0
  503. package/dist/hovercard/hovercard-store.d.ts +2 -0
  504. package/dist/hovercard/hovercard-store.js +31 -0
  505. package/dist/hovercard/hovercard-store.js.map +1 -0
  506. package/dist/hovercard/hovercard.d.ts +80 -0
  507. package/dist/hovercard/hovercard.d.ts.map +1 -0
  508. package/dist/hovercard/hovercard.js +240 -0
  509. package/dist/hovercard/hovercard.js.map +1 -0
  510. package/dist/hovercard/utils/debug-polygon.d.ts +7 -0
  511. package/dist/hovercard/utils/debug-polygon.d.ts.map +1 -0
  512. package/dist/hovercard/utils/debug-polygon.js +33 -0
  513. package/dist/hovercard/utils/debug-polygon.js.map +1 -0
  514. package/dist/hovercard/utils/polygon.d.ts +9 -0
  515. package/dist/hovercard/utils/polygon.d.ts.map +1 -0
  516. package/dist/hovercard/utils/polygon.js +70 -0
  517. package/dist/hovercard/utils/polygon.js.map +1 -0
  518. package/dist/hovercard-store-gIeoQEn_.d.ts +30 -0
  519. package/dist/hovercard-store-gIeoQEn_.d.ts.map +1 -0
  520. package/dist/index.d.ts +5 -0
  521. package/dist/index.d.ts.map +1 -0
  522. package/dist/index.js +7 -0
  523. package/dist/index.js.map +1 -0
  524. package/dist/menu/menu-arrow.d.ts +52 -0
  525. package/dist/menu/menu-arrow.d.ts.map +1 -0
  526. package/dist/menu/menu-arrow.js +49 -0
  527. package/dist/menu/menu-arrow.js.map +1 -0
  528. package/dist/menu/menu-bar-provider.d.ts +35 -0
  529. package/dist/menu/menu-bar-provider.d.ts.map +1 -0
  530. package/dist/menu/menu-bar-provider.js +42 -0
  531. package/dist/menu/menu-bar-provider.js.map +1 -0
  532. package/dist/menu/menu-bar-store.d.ts +25 -0
  533. package/dist/menu/menu-bar-store.d.ts.map +1 -0
  534. package/dist/menu/menu-bar-store.js +28 -0
  535. package/dist/menu/menu-bar-store.js.map +1 -0
  536. package/dist/menu/menu-bar.d.ts +61 -0
  537. package/dist/menu/menu-bar.d.ts.map +1 -0
  538. package/dist/menu/menu-bar.js +66 -0
  539. package/dist/menu/menu-bar.js.map +1 -0
  540. package/dist/menu/menu-button-arrow.d.ts +65 -0
  541. package/dist/menu/menu-button-arrow.d.ts.map +1 -0
  542. package/dist/menu/menu-button-arrow.js +62 -0
  543. package/dist/menu/menu-button-arrow.js.map +1 -0
  544. package/dist/menu/menu-button.d.ts +67 -0
  545. package/dist/menu/menu-button.d.ts.map +1 -0
  546. package/dist/menu/menu-button.js +183 -0
  547. package/dist/menu/menu-button.js.map +1 -0
  548. package/dist/menu/menu-context.d.ts +47 -0
  549. package/dist/menu/menu-context.d.ts.map +1 -0
  550. package/dist/menu/menu-context.js +52 -0
  551. package/dist/menu/menu-context.js.map +1 -0
  552. package/dist/menu/menu-description.d.ts +50 -0
  553. package/dist/menu/menu-description.d.ts.map +1 -0
  554. package/dist/menu/menu-description.js +42 -0
  555. package/dist/menu/menu-description.js.map +1 -0
  556. package/dist/menu/menu-dismiss.d.ts +49 -0
  557. package/dist/menu/menu-dismiss.d.ts.map +1 -0
  558. package/dist/menu/menu-dismiss.js +47 -0
  559. package/dist/menu/menu-dismiss.js.map +1 -0
  560. package/dist/menu/menu-group-label.d.ts +55 -0
  561. package/dist/menu/menu-group-label.d.ts.map +1 -0
  562. package/dist/menu/menu-group-label.js +47 -0
  563. package/dist/menu/menu-group-label.js.map +1 -0
  564. package/dist/menu/menu-group.d.ts +61 -0
  565. package/dist/menu/menu-group.d.ts.map +1 -0
  566. package/dist/menu/menu-group.js +53 -0
  567. package/dist/menu/menu-group.js.map +1 -0
  568. package/dist/menu/menu-heading.d.ts +50 -0
  569. package/dist/menu/menu-heading.d.ts.map +1 -0
  570. package/dist/menu/menu-heading.js +42 -0
  571. package/dist/menu/menu-heading.js.map +1 -0
  572. package/dist/menu/menu-item-check.d.ts +58 -0
  573. package/dist/menu/menu-item-check.d.ts.map +1 -0
  574. package/dist/menu/menu-item-check.js +60 -0
  575. package/dist/menu/menu-item-check.js.map +1 -0
  576. package/dist/menu/menu-item-checkbox.d.ts +104 -0
  577. package/dist/menu/menu-item-checkbox.d.ts.map +1 -0
  578. package/dist/menu/menu-item-checkbox.js +151 -0
  579. package/dist/menu/menu-item-checkbox.js.map +1 -0
  580. package/dist/menu/menu-item-radio.d.ts +91 -0
  581. package/dist/menu/menu-item-radio.d.ts.map +1 -0
  582. package/dist/menu/menu-item-radio.js +121 -0
  583. package/dist/menu/menu-item-radio.js.map +1 -0
  584. package/dist/menu/menu-item.d.ts +75 -0
  585. package/dist/menu/menu-item.d.ts.map +1 -0
  586. package/dist/menu/menu-item.js +122 -0
  587. package/dist/menu/menu-item.js.map +1 -0
  588. package/dist/menu/menu-list.d.ts +59 -0
  589. package/dist/menu/menu-list.d.ts.map +1 -0
  590. package/dist/menu/menu-list.js +168 -0
  591. package/dist/menu/menu-list.js.map +1 -0
  592. package/dist/menu/menu-provider.d.ts +29 -0
  593. package/dist/menu/menu-provider.d.ts.map +1 -0
  594. package/dist/menu/menu-provider.js +15 -0
  595. package/dist/menu/menu-provider.js.map +1 -0
  596. package/dist/menu/menu-separator.d.ts +59 -0
  597. package/dist/menu/menu-separator.d.ts.map +1 -0
  598. package/dist/menu/menu-separator.js +57 -0
  599. package/dist/menu/menu-separator.js.map +1 -0
  600. package/dist/menu/menu-store.d.ts +2 -0
  601. package/dist/menu/menu-store.js +40 -0
  602. package/dist/menu/menu-store.js.map +1 -0
  603. package/dist/menu/menu.d.ts +49 -0
  604. package/dist/menu/menu.d.ts.map +1 -0
  605. package/dist/menu/menu.js +169 -0
  606. package/dist/menu/menu.js.map +1 -0
  607. package/dist/menu-store-0CKKmNek.d.ts +83 -0
  608. package/dist/menu-store-0CKKmNek.d.ts.map +1 -0
  609. package/dist/menubar/menubar-context.d.ts +25 -0
  610. package/dist/menubar/menubar-context.d.ts.map +1 -0
  611. package/dist/menubar/menubar-context.js +29 -0
  612. package/dist/menubar/menubar-context.js.map +1 -0
  613. package/dist/menubar/menubar-provider.d.ts +37 -0
  614. package/dist/menubar/menubar-provider.d.ts.map +1 -0
  615. package/dist/menubar/menubar-provider.js +41 -0
  616. package/dist/menubar/menubar-provider.js.map +1 -0
  617. package/dist/menubar/menubar-store.d.ts +2 -0
  618. package/dist/menubar/menubar-store.js +27 -0
  619. package/dist/menubar/menubar-store.js.map +1 -0
  620. package/dist/menubar/menubar.d.ts +71 -0
  621. package/dist/menubar/menubar.d.ts.map +1 -0
  622. package/dist/menubar/menubar.js +88 -0
  623. package/dist/menubar/menubar.js.map +1 -0
  624. package/dist/menubar-store-3h0eNIbS.d.ts +26 -0
  625. package/dist/menubar-store-3h0eNIbS.d.ts.map +1 -0
  626. package/dist/popover/popover-anchor.d.ts +2 -0
  627. package/dist/popover/popover-anchor.js +45 -0
  628. package/dist/popover/popover-anchor.js.map +1 -0
  629. package/dist/popover/popover-arrow-path.d.ts +5 -0
  630. package/dist/popover/popover-arrow-path.d.ts.map +1 -0
  631. package/dist/popover/popover-arrow-path.js +7 -0
  632. package/dist/popover/popover-arrow-path.js.map +1 -0
  633. package/dist/popover/popover-arrow.d.ts +65 -0
  634. package/dist/popover/popover-arrow.d.ts.map +1 -0
  635. package/dist/popover/popover-arrow.js +160 -0
  636. package/dist/popover/popover-arrow.js.map +1 -0
  637. package/dist/popover/popover-context.d.ts +24 -0
  638. package/dist/popover/popover-context.d.ts.map +1 -0
  639. package/dist/popover/popover-context.js +27 -0
  640. package/dist/popover/popover-context.js.map +1 -0
  641. package/dist/popover/popover-description.d.ts +2 -0
  642. package/dist/popover/popover-description.js +42 -0
  643. package/dist/popover/popover-description.js.map +1 -0
  644. package/dist/popover/popover-disclosure-arrow.d.ts +62 -0
  645. package/dist/popover/popover-disclosure-arrow.d.ts.map +1 -0
  646. package/dist/popover/popover-disclosure-arrow.js +81 -0
  647. package/dist/popover/popover-disclosure-arrow.js.map +1 -0
  648. package/dist/popover/popover-disclosure.d.ts +38 -0
  649. package/dist/popover/popover-disclosure.d.ts.map +1 -0
  650. package/dist/popover/popover-disclosure.js +66 -0
  651. package/dist/popover/popover-disclosure.js.map +1 -0
  652. package/dist/popover/popover-dismiss.d.ts +2 -0
  653. package/dist/popover/popover-dismiss.js +47 -0
  654. package/dist/popover/popover-dismiss.js.map +1 -0
  655. package/dist/popover/popover-heading.d.ts +2 -0
  656. package/dist/popover/popover-heading.js +42 -0
  657. package/dist/popover/popover-heading.js.map +1 -0
  658. package/dist/popover/popover-provider.d.ts +23 -0
  659. package/dist/popover/popover-provider.d.ts.map +1 -0
  660. package/dist/popover/popover-provider.js +27 -0
  661. package/dist/popover/popover-provider.js.map +1 -0
  662. package/dist/popover/popover-store.d.ts +2 -0
  663. package/dist/popover/popover-store.js +30 -0
  664. package/dist/popover/popover-store.js.map +1 -0
  665. package/dist/popover/popover.d.ts +2 -0
  666. package/dist/popover/popover.js +312 -0
  667. package/dist/popover/popover.js.map +1 -0
  668. package/dist/popover-CCqiRKqg.d.ts +181 -0
  669. package/dist/popover-CCqiRKqg.d.ts.map +1 -0
  670. package/dist/popover-anchor-PgfeXyzs.d.ts +47 -0
  671. package/dist/popover-anchor-PgfeXyzs.d.ts.map +1 -0
  672. package/dist/popover-description-DU753dah.d.ts +51 -0
  673. package/dist/popover-description-DU753dah.d.ts.map +1 -0
  674. package/dist/popover-dismiss-DPeI6Zse.d.ts +50 -0
  675. package/dist/popover-dismiss-DPeI6Zse.d.ts.map +1 -0
  676. package/dist/popover-heading-DGsr6D5W.d.ts +51 -0
  677. package/dist/popover-heading-DGsr6D5W.d.ts.map +1 -0
  678. package/dist/popover-store-Bc-l5VVO.d.ts +29 -0
  679. package/dist/popover-store-Bc-l5VVO.d.ts.map +1 -0
  680. package/dist/portal/portal-context.d.ts +21 -0
  681. package/dist/portal/portal-context.d.ts.map +1 -0
  682. package/dist/portal/portal-context.js +24 -0
  683. package/dist/portal/portal-context.js.map +1 -0
  684. package/dist/portal/portal.d.ts +2 -0
  685. package/dist/portal/portal.js +242 -0
  686. package/dist/portal/portal.js.map +1 -0
  687. package/dist/portal-CMBWiayp.d.ts +149 -0
  688. package/dist/portal-CMBWiayp.d.ts.map +1 -0
  689. package/dist/radio/radio-context.d.ts +24 -0
  690. package/dist/radio/radio-context.d.ts.map +1 -0
  691. package/dist/radio/radio-context.js +27 -0
  692. package/dist/radio/radio-context.js.map +1 -0
  693. package/dist/radio/radio-group.d.ts +51 -0
  694. package/dist/radio/radio-group.d.ts.map +1 -0
  695. package/dist/radio/radio-group.js +60 -0
  696. package/dist/radio/radio-group.js.map +1 -0
  697. package/dist/radio/radio-provider.d.ts +25 -0
  698. package/dist/radio/radio-provider.d.ts.map +1 -0
  699. package/dist/radio/radio-provider.js +29 -0
  700. package/dist/radio/radio-provider.js.map +1 -0
  701. package/dist/radio/radio-store.d.ts +2 -0
  702. package/dist/radio/radio-store.js +33 -0
  703. package/dist/radio/radio-store.js.map +1 -0
  704. package/dist/radio/radio.d.ts +76 -0
  705. package/dist/radio/radio.d.ts.map +1 -0
  706. package/dist/radio/radio.js +143 -0
  707. package/dist/radio/radio.js.map +1 -0
  708. package/dist/radio-store-DOZ_1RSk.d.ts +36 -0
  709. package/dist/radio-store-DOZ_1RSk.d.ts.map +1 -0
  710. package/dist/role/role.d.ts +34 -0
  711. package/dist/role/role.d.ts.map +1 -0
  712. package/dist/role/role.js +68 -0
  713. package/dist/role/role.js.map +1 -0
  714. package/dist/select/select-arrow.d.ts +60 -0
  715. package/dist/select/select-arrow.d.ts.map +1 -0
  716. package/dist/select/select-arrow.js +58 -0
  717. package/dist/select/select-arrow.js.map +1 -0
  718. package/dist/select/select-context.d.ts +27 -0
  719. package/dist/select/select-context.d.ts.map +1 -0
  720. package/dist/select/select-context.js +31 -0
  721. package/dist/select/select-context.js.map +1 -0
  722. package/dist/select/select-dismiss.d.ts +59 -0
  723. package/dist/select/select-dismiss.d.ts.map +1 -0
  724. package/dist/select/select-dismiss.js +56 -0
  725. package/dist/select/select-dismiss.js.map +1 -0
  726. package/dist/select/select-group-label.d.ts +61 -0
  727. package/dist/select/select-group-label.d.ts.map +1 -0
  728. package/dist/select/select-group-label.js +52 -0
  729. package/dist/select/select-group-label.js.map +1 -0
  730. package/dist/select/select-group.d.ts +62 -0
  731. package/dist/select/select-group.d.ts.map +1 -0
  732. package/dist/select/select-group.js +53 -0
  733. package/dist/select/select-group.js.map +1 -0
  734. package/dist/select/select-heading.d.ts +59 -0
  735. package/dist/select/select-heading.d.ts.map +1 -0
  736. package/dist/select/select-heading.js +62 -0
  737. package/dist/select/select-heading.js.map +1 -0
  738. package/dist/select/select-item-check.d.ts +59 -0
  739. package/dist/select/select-item-check.d.ts.map +1 -0
  740. package/dist/select/select-item-check.js +61 -0
  741. package/dist/select/select-item-check.js.map +1 -0
  742. package/dist/select/select-item-offscreen.d.ts +37 -0
  743. package/dist/select/select-item-offscreen.d.ts.map +1 -0
  744. package/dist/select/select-item-offscreen.js +38 -0
  745. package/dist/select/select-item-offscreen.js.map +1 -0
  746. package/dist/select/select-item.d.ts +108 -0
  747. package/dist/select/select-item.d.ts.map +1 -0
  748. package/dist/select/select-item.js +143 -0
  749. package/dist/select/select-item.js.map +1 -0
  750. package/dist/select/select-label.d.ts +55 -0
  751. package/dist/select/select-label.d.ts.map +1 -0
  752. package/dist/select/select-label.js +70 -0
  753. package/dist/select/select-label.js.map +1 -0
  754. package/dist/select/select-list.d.ts +80 -0
  755. package/dist/select/select-list.d.ts.map +1 -0
  756. package/dist/select/select-list.js +143 -0
  757. package/dist/select/select-list.js.map +1 -0
  758. package/dist/select/select-popover.d.ts +44 -0
  759. package/dist/select/select-popover.d.ts.map +1 -0
  760. package/dist/select/select-popover.js +59 -0
  761. package/dist/select/select-popover.js.map +1 -0
  762. package/dist/select/select-provider.d.ts +30 -0
  763. package/dist/select/select-provider.d.ts.map +1 -0
  764. package/dist/select/select-provider.js +15 -0
  765. package/dist/select/select-provider.js.map +1 -0
  766. package/dist/select/select-renderer.d.ts +44 -0
  767. package/dist/select/select-renderer.d.ts.map +1 -0
  768. package/dist/select/select-renderer.js +61 -0
  769. package/dist/select/select-renderer.js.map +1 -0
  770. package/dist/select/select-row.d.ts +63 -0
  771. package/dist/select/select-row.d.ts.map +1 -0
  772. package/dist/select/select-row.js +67 -0
  773. package/dist/select/select-row.js.map +1 -0
  774. package/dist/select/select-separator.d.ts +60 -0
  775. package/dist/select/select-separator.d.ts.map +1 -0
  776. package/dist/select/select-separator.js +57 -0
  777. package/dist/select/select-separator.js.map +1 -0
  778. package/dist/select/select-store.d.ts +2 -0
  779. package/dist/select/select-store.js +31 -0
  780. package/dist/select/select-store.js.map +1 -0
  781. package/dist/select/select-value.d.ts +84 -0
  782. package/dist/select/select-value.d.ts.map +1 -0
  783. package/dist/select/select-value.js +18 -0
  784. package/dist/select/select-value.js.map +1 -0
  785. package/dist/select/select.d.ts +89 -0
  786. package/dist/select/select.d.ts.map +1 -0
  787. package/dist/select/select.js +211 -0
  788. package/dist/select/select.js.map +1 -0
  789. package/dist/select-store-BsLTAyKh.d.ts +68 -0
  790. package/dist/select-store-BsLTAyKh.d.ts.map +1 -0
  791. package/dist/separator/separator.d.ts +2 -0
  792. package/dist/separator/separator.js +36 -0
  793. package/dist/separator/separator.js.map +1 -0
  794. package/dist/separator--ozQfMcK.d.ts +36 -0
  795. package/dist/separator--ozQfMcK.d.ts.map +1 -0
  796. package/dist/store.d.ts +1 -0
  797. package/dist/store.js +2 -0
  798. package/dist/tab/tab-context.d.ts +24 -0
  799. package/dist/tab/tab-context.d.ts.map +1 -0
  800. package/dist/tab/tab-context.js +27 -0
  801. package/dist/tab/tab-context.js.map +1 -0
  802. package/dist/tab/tab-list.d.ts +55 -0
  803. package/dist/tab/tab-list.d.ts.map +1 -0
  804. package/dist/tab/tab-list.js +71 -0
  805. package/dist/tab/tab-list.js.map +1 -0
  806. package/dist/tab/tab-panel.d.ts +122 -0
  807. package/dist/tab/tab-panel.d.ts.map +1 -0
  808. package/dist/tab/tab-panel.js +169 -0
  809. package/dist/tab/tab-panel.js.map +1 -0
  810. package/dist/tab/tab-provider.d.ts +26 -0
  811. package/dist/tab/tab-provider.d.ts.map +1 -0
  812. package/dist/tab/tab-provider.js +30 -0
  813. package/dist/tab/tab-provider.js.map +1 -0
  814. package/dist/tab/tab-store.d.ts +77 -0
  815. package/dist/tab/tab-store.d.ts.map +1 -0
  816. package/dist/tab/tab-store.js +55 -0
  817. package/dist/tab/tab-store.js.map +1 -0
  818. package/dist/tab/tab.d.ts +56 -0
  819. package/dist/tab/tab.d.ts.map +1 -0
  820. package/dist/tab/tab.js +115 -0
  821. package/dist/tab/tab.js.map +1 -0
  822. package/dist/tag/tag-context.d.ts +26 -0
  823. package/dist/tag/tag-context.d.ts.map +1 -0
  824. package/dist/tag/tag-context.js +30 -0
  825. package/dist/tag/tag-context.js.map +1 -0
  826. package/dist/tag/tag-input.d.ts +126 -0
  827. package/dist/tag/tag-input.d.ts.map +1 -0
  828. package/dist/tag/tag-input.js +162 -0
  829. package/dist/tag/tag-input.js.map +1 -0
  830. package/dist/tag/tag-list-label.d.ts +59 -0
  831. package/dist/tag/tag-list-label.d.ts.map +1 -0
  832. package/dist/tag/tag-list-label.js +62 -0
  833. package/dist/tag/tag-list-label.js.map +1 -0
  834. package/dist/tag/tag-list.d.ts +62 -0
  835. package/dist/tag/tag-list.d.ts.map +1 -0
  836. package/dist/tag/tag-list.js +127 -0
  837. package/dist/tag/tag-list.js.map +1 -0
  838. package/dist/tag/tag-provider.d.ts +34 -0
  839. package/dist/tag/tag-provider.d.ts.map +1 -0
  840. package/dist/tag/tag-provider.js +38 -0
  841. package/dist/tag/tag-provider.js.map +1 -0
  842. package/dist/tag/tag-remove.d.ts +71 -0
  843. package/dist/tag/tag-remove.d.ts.map +1 -0
  844. package/dist/tag/tag-remove.js +102 -0
  845. package/dist/tag/tag-remove.js.map +1 -0
  846. package/dist/tag/tag-store.d.ts +2 -0
  847. package/dist/tag/tag-store.js +38 -0
  848. package/dist/tag/tag-store.js.map +1 -0
  849. package/dist/tag/tag-value.d.ts +49 -0
  850. package/dist/tag/tag-value.d.ts.map +1 -0
  851. package/dist/tag/tag-value.js +40 -0
  852. package/dist/tag/tag-value.js.map +1 -0
  853. package/dist/tag/tag-values.d.ts +60 -0
  854. package/dist/tag/tag-values.d.ts.map +1 -0
  855. package/dist/tag/tag-values.js +50 -0
  856. package/dist/tag/tag-values.js.map +1 -0
  857. package/dist/tag/tag.d.ts +78 -0
  858. package/dist/tag/tag.d.ts.map +1 -0
  859. package/dist/tag/tag.js +114 -0
  860. package/dist/tag/tag.js.map +1 -0
  861. package/dist/tag/utils.d.ts +5 -0
  862. package/dist/tag/utils.d.ts.map +1 -0
  863. package/dist/tag/utils.js +15 -0
  864. package/dist/tag/utils.js.map +1 -0
  865. package/dist/tag-store-xANOvuGo.d.ts +49 -0
  866. package/dist/tag-store-xANOvuGo.d.ts.map +1 -0
  867. package/dist/toolbar/toolbar-container.d.ts +41 -0
  868. package/dist/toolbar/toolbar-container.d.ts.map +1 -0
  869. package/dist/toolbar/toolbar-container.js +53 -0
  870. package/dist/toolbar/toolbar-container.js.map +1 -0
  871. package/dist/toolbar/toolbar-context.d.ts +24 -0
  872. package/dist/toolbar/toolbar-context.d.ts.map +1 -0
  873. package/dist/toolbar/toolbar-context.js +27 -0
  874. package/dist/toolbar/toolbar-context.js.map +1 -0
  875. package/dist/toolbar/toolbar-input.d.ts +39 -0
  876. package/dist/toolbar/toolbar-input.d.ts.map +1 -0
  877. package/dist/toolbar/toolbar-input.js +47 -0
  878. package/dist/toolbar/toolbar-input.js.map +1 -0
  879. package/dist/toolbar/toolbar-item.d.ts +47 -0
  880. package/dist/toolbar/toolbar-item.d.ts.map +1 -0
  881. package/dist/toolbar/toolbar-item.js +45 -0
  882. package/dist/toolbar/toolbar-item.js.map +1 -0
  883. package/dist/toolbar/toolbar-provider.d.ts +26 -0
  884. package/dist/toolbar/toolbar-provider.d.ts.map +1 -0
  885. package/dist/toolbar/toolbar-provider.js +30 -0
  886. package/dist/toolbar/toolbar-provider.js.map +1 -0
  887. package/dist/toolbar/toolbar-separator.d.ts +51 -0
  888. package/dist/toolbar/toolbar-separator.d.ts.map +1 -0
  889. package/dist/toolbar/toolbar-separator.js +49 -0
  890. package/dist/toolbar/toolbar-separator.js.map +1 -0
  891. package/dist/toolbar/toolbar-store.d.ts +2 -0
  892. package/dist/toolbar/toolbar-store.js +31 -0
  893. package/dist/toolbar/toolbar-store.js.map +1 -0
  894. package/dist/toolbar/toolbar.d.ts +50 -0
  895. package/dist/toolbar/toolbar.d.ts.map +1 -0
  896. package/dist/toolbar/toolbar.js +66 -0
  897. package/dist/toolbar/toolbar.js.map +1 -0
  898. package/dist/toolbar-store-Cs-9cGHx.d.ts +30 -0
  899. package/dist/toolbar-store-Cs-9cGHx.d.ts.map +1 -0
  900. package/dist/tooltip/tooltip-anchor.d.ts +53 -0
  901. package/dist/tooltip/tooltip-anchor.d.ts.map +1 -0
  902. package/dist/tooltip/tooltip-anchor.js +121 -0
  903. package/dist/tooltip/tooltip-anchor.js.map +1 -0
  904. package/dist/tooltip/tooltip-arrow.d.ts +54 -0
  905. package/dist/tooltip/tooltip-arrow.d.ts.map +1 -0
  906. package/dist/tooltip/tooltip-arrow.js +54 -0
  907. package/dist/tooltip/tooltip-arrow.js.map +1 -0
  908. package/dist/tooltip/tooltip-context.d.ts +24 -0
  909. package/dist/tooltip/tooltip-context.d.ts.map +1 -0
  910. package/dist/tooltip/tooltip-context.js +27 -0
  911. package/dist/tooltip/tooltip-context.js.map +1 -0
  912. package/dist/tooltip/tooltip-provider.d.ts +23 -0
  913. package/dist/tooltip/tooltip-provider.d.ts.map +1 -0
  914. package/dist/tooltip/tooltip-provider.js +27 -0
  915. package/dist/tooltip/tooltip-provider.js.map +1 -0
  916. package/dist/tooltip/tooltip-store.d.ts +30 -0
  917. package/dist/tooltip/tooltip-store.d.ts.map +1 -0
  918. package/dist/tooltip/tooltip-store.js +30 -0
  919. package/dist/tooltip/tooltip-store.js.map +1 -0
  920. package/dist/tooltip/tooltip.d.ts +61 -0
  921. package/dist/tooltip/tooltip.d.ts.map +1 -0
  922. package/dist/tooltip/tooltip.js +81 -0
  923. package/dist/tooltip/tooltip.js.map +1 -0
  924. package/dist/utils-DUF1aMov.d.ts +5 -0
  925. package/dist/utils-DUF1aMov.d.ts.map +1 -0
  926. package/dist/visually-hidden/visually-hidden.d.ts +37 -0
  927. package/dist/visually-hidden/visually-hidden.d.ts.map +1 -0
  928. package/dist/visually-hidden/visually-hidden.js +53 -0
  929. package/dist/visually-hidden/visually-hidden.js.map +1 -0
  930. package/license +21 -0
  931. package/package.json +936 -0
  932. package/readme.md +19 -0
  933. package/src/button/button.tsx +76 -0
  934. package/src/checkbox/checkbox-check.tsx +116 -0
  935. package/src/checkbox/checkbox-checked-context.tsx +3 -0
  936. package/src/checkbox/checkbox-context.tsx +27 -0
  937. package/src/checkbox/checkbox-provider.tsx +53 -0
  938. package/src/checkbox/checkbox-store.ts +76 -0
  939. package/src/checkbox/checkbox.tsx +271 -0
  940. package/src/collection/collection-context.tsx +27 -0
  941. package/src/collection/collection-item-offscreen.tsx +157 -0
  942. package/src/collection/collection-item.tsx +136 -0
  943. package/src/collection/collection-provider.tsx +47 -0
  944. package/src/collection/collection-renderer.tsx +994 -0
  945. package/src/collection/collection-store.ts +84 -0
  946. package/src/collection/collection.tsx +93 -0
  947. package/src/combobox/combobox-cancel.tsx +153 -0
  948. package/src/combobox/combobox-context.tsx +49 -0
  949. package/src/combobox/combobox-disclosure.tsx +162 -0
  950. package/src/combobox/combobox-group-label.tsx +74 -0
  951. package/src/combobox/combobox-group.tsx +100 -0
  952. package/src/combobox/combobox-item-check.tsx +83 -0
  953. package/src/combobox/combobox-item-offscreen.tsx +87 -0
  954. package/src/combobox/combobox-item-value.tsx +231 -0
  955. package/src/combobox/combobox-item.tsx +363 -0
  956. package/src/combobox/combobox-label.tsx +89 -0
  957. package/src/combobox/combobox-list.tsx +176 -0
  958. package/src/combobox/combobox-popover.tsx +179 -0
  959. package/src/combobox/combobox-provider.tsx +50 -0
  960. package/src/combobox/combobox-row.tsx +102 -0
  961. package/src/combobox/combobox-separator.tsx +90 -0
  962. package/src/combobox/combobox-store.ts +168 -0
  963. package/src/combobox/combobox-value.tsx +63 -0
  964. package/src/combobox/combobox.tsx +900 -0
  965. package/src/command/command.tsx +215 -0
  966. package/src/composite/composite-container.tsx +278 -0
  967. package/src/composite/composite-context.tsx +53 -0
  968. package/src/composite/composite-group-label.tsx +73 -0
  969. package/src/composite/composite-group.tsx +77 -0
  970. package/src/composite/composite-hover.tsx +230 -0
  971. package/src/composite/composite-input.tsx +147 -0
  972. package/src/composite/composite-item-offscreen.tsx +112 -0
  973. package/src/composite/composite-item.tsx +567 -0
  974. package/src/composite/composite-overflow-disclosure.ts +117 -0
  975. package/src/composite/composite-overflow-store.ts +61 -0
  976. package/src/composite/composite-overflow.tsx +123 -0
  977. package/src/composite/composite-provider.tsx +47 -0
  978. package/src/composite/composite-renderer.tsx +231 -0
  979. package/src/composite/composite-row.tsx +133 -0
  980. package/src/composite/composite-separator.tsx +96 -0
  981. package/src/composite/composite-store.ts +101 -0
  982. package/src/composite/composite-typeahead.tsx +246 -0
  983. package/src/composite/composite.tsx +592 -0
  984. package/src/composite/utils.ts +121 -0
  985. package/src/dialog/dialog-backdrop.tsx +71 -0
  986. package/src/dialog/dialog-context.tsx +43 -0
  987. package/src/dialog/dialog-description.tsx +86 -0
  988. package/src/dialog/dialog-disclosure.tsx +84 -0
  989. package/src/dialog/dialog-dismiss.tsx +113 -0
  990. package/src/dialog/dialog-heading.tsx +88 -0
  991. package/src/dialog/dialog-provider.tsx +28 -0
  992. package/src/dialog/dialog-store.ts +51 -0
  993. package/src/dialog/dialog.tsx +866 -0
  994. package/src/dialog/utils/disable-accessibility-tree-outside.ts +30 -0
  995. package/src/dialog/utils/disable-tree.ts +81 -0
  996. package/src/dialog/utils/is-backdrop.ts +12 -0
  997. package/src/dialog/utils/is-focus-trap.ts +11 -0
  998. package/src/dialog/utils/mark-tree-outside.ts +67 -0
  999. package/src/dialog/utils/orchestrate.ts +123 -0
  1000. package/src/dialog/utils/prepend-hidden-dismiss.ts +35 -0
  1001. package/src/dialog/utils/supports-inert.ts +5 -0
  1002. package/src/dialog/utils/use-hide-on-interact-outside.ts +181 -0
  1003. package/src/dialog/utils/use-nested-dialogs.tsx +55 -0
  1004. package/src/dialog/utils/use-prevent-body-scroll.ts +86 -0
  1005. package/src/dialog/utils/use-previous-mouse-down-ref.ts +19 -0
  1006. package/src/dialog/utils/use-root-dialog.ts +49 -0
  1007. package/src/dialog/utils/walk-tree-outside.ts +85 -0
  1008. package/src/disclosure/disclosure-content.tsx +344 -0
  1009. package/src/disclosure/disclosure-context.tsx +27 -0
  1010. package/src/disclosure/disclosure-provider.tsx +29 -0
  1011. package/src/disclosure/disclosure-store.ts +85 -0
  1012. package/src/disclosure/disclosure.tsx +144 -0
  1013. package/src/focus-trap/focus-trap-region.tsx +112 -0
  1014. package/src/focus-trap/focus-trap.tsx +60 -0
  1015. package/src/focusable/focusable-container.tsx +75 -0
  1016. package/src/focusable/focusable-context.tsx +3 -0
  1017. package/src/focusable/focusable.tsx +559 -0
  1018. package/src/form/form-checkbox.tsx +106 -0
  1019. package/src/form/form-context.tsx +34 -0
  1020. package/src/form/form-control.tsx +227 -0
  1021. package/src/form/form-description.tsx +142 -0
  1022. package/src/form/form-error.tsx +156 -0
  1023. package/src/form/form-field.tsx +94 -0
  1024. package/src/form/form-group-label.tsx +79 -0
  1025. package/src/form/form-group.tsx +79 -0
  1026. package/src/form/form-input.tsx +104 -0
  1027. package/src/form/form-label.tsx +192 -0
  1028. package/src/form/form-provider.tsx +49 -0
  1029. package/src/form/form-push.tsx +200 -0
  1030. package/src/form/form-radio-group.tsx +93 -0
  1031. package/src/form/form-radio.tsx +122 -0
  1032. package/src/form/form-remove.tsx +198 -0
  1033. package/src/form/form-reset.tsx +85 -0
  1034. package/src/form/form-store.ts +195 -0
  1035. package/src/form/form-submit.tsx +93 -0
  1036. package/src/form/form.tsx +249 -0
  1037. package/src/group/group-label-context.tsx +6 -0
  1038. package/src/group/group-label.tsx +75 -0
  1039. package/src/group/group.tsx +69 -0
  1040. package/src/heading/heading-context.tsx +4 -0
  1041. package/src/heading/heading-level.tsx +42 -0
  1042. package/src/heading/heading.tsx +81 -0
  1043. package/src/heading/utils.ts +1 -0
  1044. package/src/hovercard/hovercard-anchor.tsx +195 -0
  1045. package/src/hovercard/hovercard-arrow.tsx +74 -0
  1046. package/src/hovercard/hovercard-context.tsx +34 -0
  1047. package/src/hovercard/hovercard-description.tsx +69 -0
  1048. package/src/hovercard/hovercard-disclosure.tsx +196 -0
  1049. package/src/hovercard/hovercard-dismiss.tsx +70 -0
  1050. package/src/hovercard/hovercard-heading.tsx +68 -0
  1051. package/src/hovercard/hovercard-provider.tsx +29 -0
  1052. package/src/hovercard/hovercard-store.ts +58 -0
  1053. package/src/hovercard/hovercard.tsx +445 -0
  1054. package/src/hovercard/utils/__tests__/polygon-test.ts +66 -0
  1055. package/src/hovercard/utils/debug-polygon.ts +37 -0
  1056. package/src/hovercard/utils/polygon.ts +96 -0
  1057. package/src/index.ts +1 -0
  1058. package/src/menu/menu-arrow.tsx +69 -0
  1059. package/src/menu/menu-bar-provider.tsx +44 -0
  1060. package/src/menu/menu-bar-store.ts +54 -0
  1061. package/src/menu/menu-bar.tsx +84 -0
  1062. package/src/menu/menu-button-arrow.tsx +85 -0
  1063. package/src/menu/menu-button.tsx +338 -0
  1064. package/src/menu/menu-context.tsx +76 -0
  1065. package/src/menu/menu-description.tsx +67 -0
  1066. package/src/menu/menu-dismiss.tsx +69 -0
  1067. package/src/menu/menu-group-label.tsx +72 -0
  1068. package/src/menu/menu-group.tsx +76 -0
  1069. package/src/menu/menu-heading.tsx +67 -0
  1070. package/src/menu/menu-item-check.tsx +79 -0
  1071. package/src/menu/menu-item-checkbox.tsx +227 -0
  1072. package/src/menu/menu-item-radio.tsx +198 -0
  1073. package/src/menu/menu-item.tsx +223 -0
  1074. package/src/menu/menu-list.tsx +230 -0
  1075. package/src/menu/menu-provider.tsx +42 -0
  1076. package/src/menu/menu-separator.tsx +79 -0
  1077. package/src/menu/menu-store.ts +155 -0
  1078. package/src/menu/menu.tsx +274 -0
  1079. package/src/menubar/menubar-context.tsx +39 -0
  1080. package/src/menubar/menubar-provider.tsx +43 -0
  1081. package/src/menubar/menubar-store.ts +48 -0
  1082. package/src/menubar/menubar.tsx +145 -0
  1083. package/src/popover/popover-anchor.tsx +74 -0
  1084. package/src/popover/popover-arrow-path.ts +21 -0
  1085. package/src/popover/popover-arrow.tsx +228 -0
  1086. package/src/popover/popover-context.tsx +34 -0
  1087. package/src/popover/popover-description.tsx +69 -0
  1088. package/src/popover/popover-disclosure-arrow.tsx +135 -0
  1089. package/src/popover/popover-disclosure.tsx +101 -0
  1090. package/src/popover/popover-dismiss.tsx +70 -0
  1091. package/src/popover/popover-heading.tsx +68 -0
  1092. package/src/popover/popover-provider.tsx +29 -0
  1093. package/src/popover/popover-store.ts +53 -0
  1094. package/src/popover/popover.tsx +649 -0
  1095. package/src/portal/portal-context.tsx +19 -0
  1096. package/src/portal/portal.tsx +493 -0
  1097. package/src/radio/radio-context.tsx +34 -0
  1098. package/src/radio/radio-group.tsx +103 -0
  1099. package/src/radio/radio-provider.tsx +29 -0
  1100. package/src/radio/radio-store.ts +64 -0
  1101. package/src/radio/radio.tsx +242 -0
  1102. package/src/role/role.tsx +88 -0
  1103. package/src/select/select-arrow.tsx +80 -0
  1104. package/src/select/select-context.tsx +46 -0
  1105. package/src/select/select-dismiss.tsx +79 -0
  1106. package/src/select/select-group-label.tsx +78 -0
  1107. package/src/select/select-group.tsx +79 -0
  1108. package/src/select/select-heading.tsx +98 -0
  1109. package/src/select/select-item-check.tsx +80 -0
  1110. package/src/select/select-item-offscreen.tsx +59 -0
  1111. package/src/select/select-item.tsx +294 -0
  1112. package/src/select/select-label.tsx +117 -0
  1113. package/src/select/select-list.tsx +251 -0
  1114. package/src/select/select-popover.tsx +67 -0
  1115. package/src/select/select-provider.tsx +45 -0
  1116. package/src/select/select-renderer.tsx +160 -0
  1117. package/src/select/select-row.tsx +97 -0
  1118. package/src/select/select-separator.tsx +80 -0
  1119. package/src/select/select-store.ts +139 -0
  1120. package/src/select/select-value.tsx +108 -0
  1121. package/src/select/select.tsx +371 -0
  1122. package/src/separator/separator.tsx +54 -0
  1123. package/src/store.ts +1 -0
  1124. package/src/tab/tab-context.tsx +34 -0
  1125. package/src/tab/tab-list.tsx +120 -0
  1126. package/src/tab/tab-panel.tsx +314 -0
  1127. package/src/tab/tab-provider.tsx +30 -0
  1128. package/src/tab/tab-store.ts +124 -0
  1129. package/src/tab/tab.tsx +208 -0
  1130. package/src/tag/tag-context.tsx +40 -0
  1131. package/src/tag/tag-input.tsx +321 -0
  1132. package/src/tag/tag-list-label.tsx +102 -0
  1133. package/src/tag/tag-list.tsx +210 -0
  1134. package/src/tag/tag-provider.tsx +38 -0
  1135. package/src/tag/tag-remove.tsx +174 -0
  1136. package/src/tag/tag-store.ts +72 -0
  1137. package/src/tag/tag-value.tsx +63 -0
  1138. package/src/tag/tag-values.tsx +74 -0
  1139. package/src/tag/tag.tsx +199 -0
  1140. package/src/tag/utils.ts +12 -0
  1141. package/src/toolbar/toolbar-container.tsx +67 -0
  1142. package/src/toolbar/toolbar-context.tsx +34 -0
  1143. package/src/toolbar/toolbar-input.tsx +64 -0
  1144. package/src/toolbar/toolbar-item.tsx +72 -0
  1145. package/src/toolbar/toolbar-provider.tsx +32 -0
  1146. package/src/toolbar/toolbar-separator.tsx +71 -0
  1147. package/src/toolbar/toolbar-store.ts +52 -0
  1148. package/src/toolbar/toolbar.tsx +119 -0
  1149. package/src/tooltip/tooltip-anchor.tsx +210 -0
  1150. package/src/tooltip/tooltip-arrow.tsx +84 -0
  1151. package/src/tooltip/tooltip-context.tsx +34 -0
  1152. package/src/tooltip/tooltip-provider.tsx +29 -0
  1153. package/src/tooltip/tooltip-store.ts +53 -0
  1154. package/src/tooltip/tooltip.tsx +153 -0
  1155. package/src/visually-hidden/visually-hidden.tsx +67 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-radio-group.js","names":[],"sources":["../../src/form/form-radio-group.tsx"],"sourcesContent":["import {\n useWrapElement,\n createElement,\n createHook,\n forwardRef,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport type { ElementType } from \"react\";\nimport { CompositeScopedContextProvider } from \"../composite/composite-context.tsx\";\nimport type { FormGroupOptions } from \"./form-group.tsx\";\nimport { useFormGroup } from \"./form-group.tsx\";\n\nconst TagName = \"div\" satisfies ElementType;\ntype TagName = typeof TagName;\n\n/**\n * Returns props to create a `FormRadioGroup` component.\n * @see https://ariakit.com/components/form\n * @example\n * ```jsx\n * const store = useFormStore({ defaultValues: { color: \"red\" } });\n * const props = useFormRadioGroup({ store });\n * <Form store={store}>\n * <Role {...props}>\n * <FormGroupLabel>Favorite color</FormGroupLabel>\n * <FormRadio name={store.names.color} value=\"red\" />\n * <FormRadio name={store.names.color} value=\"blue\" />\n * <FormRadio name={store.names.color} value=\"green\" />\n * </Role>\n * </Form>\n * ```\n */\nexport const useFormRadioGroup = createHook<TagName, FormRadioGroupOptions>(\n function useFormRadioGroup({ store, ...props }) {\n // Reset the composite context so FormRadio items inside this group\n // don't register to an unrelated ancestor composite store (e.g.,\n // TabStore). Form controls explicitly pass their store to\n // useCollectionItem, so they're not affected by this reset.\n props = useWrapElement(\n props,\n (element) => (\n <CompositeScopedContextProvider value={undefined}>\n {element}\n </CompositeScopedContextProvider>\n ),\n [],\n );\n\n props = { role: \"radiogroup\", ...props };\n props = useFormGroup(props);\n return props;\n },\n);\n\n/**\n * Renders a group element for\n * [`FormRadio`](https://ariakit.com/reference/form-radio) elements. The\n * [`FormGroupLabel`](https://ariakit.com/reference/form-group-label) component\n * can be used inside this component so the `aria-labelledby` prop is properly\n * set on the group element.\n * @see https://ariakit.com/components/form\n * @example\n * ```jsx {8-13}\n * const form = useFormStore({\n * defaultValues: {\n * color: \"red\",\n * },\n * });\n *\n * <Form store={form}>\n * <FormRadioGroup>\n * <FormGroupLabel>Favorite color</FormGroupLabel>\n * <FormRadio name={form.names.color} value=\"red\" />\n * <FormRadio name={form.names.color} value=\"blue\" />\n * <FormRadio name={form.names.color} value=\"green\" />\n * </FormRadioGroup>\n * </Form>\n * ```\n */\nexport const FormRadioGroup = forwardRef(function FormRadioGroup(\n props: FormRadioGroupProps,\n) {\n const htmlProps = useFormRadioGroup(props);\n return createElement(TagName, htmlProps);\n});\n\nexport type FormRadioGroupOptions<T extends ElementType = TagName> =\n FormGroupOptions<T>;\n\nexport type FormRadioGroupProps<T extends ElementType = TagName> = Props<\n T,\n FormRadioGroupOptions<T>\n>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MAsCI,oBACE,WACC,SACC,kBAAC,EAAA,OAAA,GAAA,SAAA;SAAsC,eAAA,QAAA,YAAA,oBAAA,gCAAA;cACpC;EAC6B,UAGpC;CAEA,CAAA,GAAA,CAAA,CAAA;SAAgB;EAAc,MAAG;EAAM,GAAA;CACvC;CACA,QAAO,aAAA,KAAA;CAEX,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BE,iBAAqB,WADH,SAAA,eACqB,OAAA;CACxC,OAAA,cAAA,SAAA,kBAAA,KAAA,CAAA"}
@@ -0,0 +1,58 @@
1
+ import { FormControlOptions } from "./form-control.js";
2
+ import { RadioOptions } from "../radio/radio.js";
3
+ import { Props } from "@ariakit/react-utils";
4
+ import { ElementType } from "react";
5
+
6
+ //#region src/form/form-radio.d.ts
7
+ declare const TagName = "input";
8
+ type TagName = typeof TagName;
9
+ /**
10
+ * Returns props to create a `FormRadio` component.
11
+ * @see https://ariakit.com/components/form
12
+ * @example
13
+ * ```jsx
14
+ * const store = useFormStore({ defaultValues: { char: "a" } });
15
+ * const a = useFormRadio({ store, name: store.names.char, value: "a" });
16
+ * const b = useFormRadio({ store, name: store.names.char, value: "b" });
17
+ * const c = useFormRadio({ store, name: store.names.char, value: "c" });
18
+ * <Form store={store}>
19
+ * <FormRadioGroup>
20
+ * <FormGroupLabel>Favorite character</FormGroupLabel>
21
+ * <Role {...a} />
22
+ * <Role {...b} />
23
+ * <Role {...c} />
24
+ * </FormRadioGroup>
25
+ * </Form>
26
+ * ```
27
+ */
28
+ declare const useFormRadio: import("@ariakit/react-utils").Hook<"input", FormRadioOptions<"input">>;
29
+ /**
30
+ * Renders a radio button as a form control. This component must be wrapped in a
31
+ * [`FormRadioGroup`](https://ariakit.com/reference/form-radio-group) along with
32
+ * other radio buttons sharing the same
33
+ * [`name`](https://ariakit.com/reference/form-radio#name).
34
+ * @see https://ariakit.com/components/form
35
+ * @example
36
+ * ```jsx {10-12}
37
+ * const form = useFormStore({
38
+ * defaultValues: {
39
+ * char: "a",
40
+ * },
41
+ * });
42
+ *
43
+ * <Form store={form}>
44
+ * <FormRadioGroup>
45
+ * <FormGroupLabel>Favorite character</FormGroupLabel>
46
+ * <FormRadio name={form.names.char} value="a" />
47
+ * <FormRadio name={form.names.char} value="b" />
48
+ * <FormRadio name={form.names.char} value="c" />
49
+ * </FormRadioGroup>
50
+ * </Form>
51
+ * ```
52
+ */
53
+ declare const FormRadio: (props: FormRadioProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
54
+ interface FormRadioOptions<T extends ElementType = TagName> extends FormControlOptions<T>, Omit<RadioOptions<T>, "store" | "name"> {}
55
+ type FormRadioProps<T extends ElementType = TagName> = Props<T, FormRadioOptions<T>>;
56
+ //#endregion
57
+ export { FormRadio, FormRadioOptions, FormRadioProps, useFormRadio };
58
+ //# sourceMappingURL=form-radio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-radio.d.ts","names":["Props","ElementType","RadioOptions","FormControlOptions","TagName","useFormRadio","FormRadioOptions","Hook","FormRadio","FormRadioProps","props","ReactElement","JSXElementConstructor","T","Omit"],"sources":["../../src/form/form-radio.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFgC;;;;AACxC;AAAA;;;;AACQ;AAoB7B;;;;AAAgG;AAyBhG;;;;AA/C6D,cAsBxCC,YAAAA,iCAA6CE,IAAAA,UAAcD,gBAAgB;;;;;AAyB2C;AAC3I;;;;;;;;;;;;;;;;;;;cADqBE,SAAAA,GAAYE,KAAAA,EAAOD,cAAc,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UACrGN,gBAAAA,WAA2BL,WAAAA,GAAcG,OAAAA,UAAiBD,kBAAAA,CAAmBU,CAAAA,GAAIC,IAAAA,CAAKZ,YAAAA,CAAaW,CAAAA;AAAAA,KAExGJ,cAAAA,WAAyBR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,gBAAAA,CAAiBO,CAAAA"}
@@ -0,0 +1,90 @@
1
+ "use client";
2
+ import { useFormContext } from "./form-context.js";
3
+ import { useFormControl } from "./form-control.js";
4
+ import { useRadio } from "../radio/radio.js";
5
+ import { createElement, createHook, forwardRef, memo, useEvent } from "@ariakit/react-utils";
6
+ import { invariant } from "@ariakit/utils";
7
+ import { useStoreState } from "@ariakit/react-store";
8
+ //#region src/form/form-radio.tsx
9
+ const TagName = "input";
10
+ /**
11
+ * Returns props to create a `FormRadio` component.
12
+ * @see https://ariakit.com/components/form
13
+ * @example
14
+ * ```jsx
15
+ * const store = useFormStore({ defaultValues: { char: "a" } });
16
+ * const a = useFormRadio({ store, name: store.names.char, value: "a" });
17
+ * const b = useFormRadio({ store, name: store.names.char, value: "b" });
18
+ * const c = useFormRadio({ store, name: store.names.char, value: "c" });
19
+ * <Form store={store}>
20
+ * <FormRadioGroup>
21
+ * <FormGroupLabel>Favorite character</FormGroupLabel>
22
+ * <Role {...a} />
23
+ * <Role {...b} />
24
+ * <Role {...c} />
25
+ * </FormRadioGroup>
26
+ * </Form>
27
+ * ```
28
+ */
29
+ const useFormRadio = createHook(function useFormRadio({ store, name: nameProp, value, ...props }) {
30
+ const context = useFormContext();
31
+ store = store || context;
32
+ invariant(store, "FormRadio must be wrapped in a Form component.");
33
+ const name = String(nameProp);
34
+ const onChangeProp = props.onChange;
35
+ const onChange = useEvent((event) => {
36
+ onChangeProp?.(event);
37
+ if (event.defaultPrevented) return;
38
+ store?.setValue(name, value);
39
+ });
40
+ const checkedProp = props.checked;
41
+ const checked = useStoreState(store, () => checkedProp ?? store?.getValue(name) === value);
42
+ props = {
43
+ ...props,
44
+ checked,
45
+ onChange
46
+ };
47
+ props = useRadio({
48
+ name,
49
+ value,
50
+ ...props
51
+ });
52
+ props = useFormControl({
53
+ store,
54
+ name,
55
+ "aria-labelledby": void 0,
56
+ ...props
57
+ });
58
+ return props;
59
+ });
60
+ /**
61
+ * Renders a radio button as a form control. This component must be wrapped in a
62
+ * [`FormRadioGroup`](https://ariakit.com/reference/form-radio-group) along with
63
+ * other radio buttons sharing the same
64
+ * [`name`](https://ariakit.com/reference/form-radio#name).
65
+ * @see https://ariakit.com/components/form
66
+ * @example
67
+ * ```jsx {10-12}
68
+ * const form = useFormStore({
69
+ * defaultValues: {
70
+ * char: "a",
71
+ * },
72
+ * });
73
+ *
74
+ * <Form store={form}>
75
+ * <FormRadioGroup>
76
+ * <FormGroupLabel>Favorite character</FormGroupLabel>
77
+ * <FormRadio name={form.names.char} value="a" />
78
+ * <FormRadio name={form.names.char} value="b" />
79
+ * <FormRadio name={form.names.char} value="c" />
80
+ * </FormRadioGroup>
81
+ * </Form>
82
+ * ```
83
+ */
84
+ const FormRadio = memo(forwardRef(function FormRadio(props) {
85
+ return createElement(TagName, useFormRadio(props));
86
+ }));
87
+ //#endregion
88
+ export { FormRadio, useFormRadio };
89
+
90
+ //# sourceMappingURL=form-radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-radio.js","names":[],"sources":["../../src/form/form-radio.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport {\n useEvent,\n createElement,\n createHook,\n forwardRef,\n memo,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport { invariant } from \"@ariakit/utils\";\nimport type { ChangeEvent, ElementType } from \"react\";\nimport type { RadioOptions } from \"../radio/radio.tsx\";\nimport { useRadio } from \"../radio/radio.tsx\";\nimport { useFormContext } from \"./form-context.tsx\";\nimport type { FormControlOptions } from \"./form-control.tsx\";\nimport { useFormControl } from \"./form-control.tsx\";\n\nconst TagName = \"input\" satisfies ElementType;\ntype TagName = typeof TagName;\n\n/**\n * Returns props to create a `FormRadio` component.\n * @see https://ariakit.com/components/form\n * @example\n * ```jsx\n * const store = useFormStore({ defaultValues: { char: \"a\" } });\n * const a = useFormRadio({ store, name: store.names.char, value: \"a\" });\n * const b = useFormRadio({ store, name: store.names.char, value: \"b\" });\n * const c = useFormRadio({ store, name: store.names.char, value: \"c\" });\n * <Form store={store}>\n * <FormRadioGroup>\n * <FormGroupLabel>Favorite character</FormGroupLabel>\n * <Role {...a} />\n * <Role {...b} />\n * <Role {...c} />\n * </FormRadioGroup>\n * </Form>\n * ```\n */\nexport const useFormRadio = createHook<TagName, FormRadioOptions>(\n function useFormRadio({ store, name: nameProp, value, ...props }) {\n const context = useFormContext();\n store = store || context;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"FormRadio must be wrapped in a Form component.\",\n );\n\n const name = String(nameProp);\n const onChangeProp = props.onChange;\n\n const onChange = useEvent((event: ChangeEvent<HTMLInputElement>) => {\n onChangeProp?.(event);\n if (event.defaultPrevented) return;\n store?.setValue(name, value);\n });\n\n const checkedProp = props.checked;\n const checked = useStoreState(\n store,\n () => checkedProp ?? store?.getValue(name) === value,\n );\n\n props = {\n ...props,\n checked,\n onChange,\n };\n\n props = useRadio({ name, value, ...props });\n\n props = useFormControl({\n store,\n name,\n \"aria-labelledby\": undefined,\n ...props,\n });\n\n return props;\n },\n);\n\n/**\n * Renders a radio button as a form control. This component must be wrapped in a\n * [`FormRadioGroup`](https://ariakit.com/reference/form-radio-group) along with\n * other radio buttons sharing the same\n * [`name`](https://ariakit.com/reference/form-radio#name).\n * @see https://ariakit.com/components/form\n * @example\n * ```jsx {10-12}\n * const form = useFormStore({\n * defaultValues: {\n * char: \"a\",\n * },\n * });\n *\n * <Form store={form}>\n * <FormRadioGroup>\n * <FormGroupLabel>Favorite character</FormGroupLabel>\n * <FormRadio name={form.names.char} value=\"a\" />\n * <FormRadio name={form.names.char} value=\"b\" />\n * <FormRadio name={form.names.char} value=\"c\" />\n * </FormRadioGroup>\n * </Form>\n * ```\n */\nexport const FormRadio = memo(\n forwardRef(function FormRadio(props: FormRadioProps) {\n const htmlProps = useFormRadio(props);\n return createElement(TagName, htmlProps);\n }),\n);\n\nexport interface FormRadioOptions<T extends ElementType = TagName>\n extends FormControlOptions<T>, Omit<RadioOptions<T>, \"store\" | \"name\"> {}\n\nexport type FormRadioProps<T extends ElementType = TagName> = Props<\n T,\n FormRadioOptions<T>\n>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;MAyCI,eAAgB,WAAe,SAAA,aAAA,EAAA,OAAA,MAAA,UAAA,OAAA,GAAA,SAAA;CAC/B,MAAA,UAAQ,eAAS;CAEjB,QAAA,SAGI;CAGJ,UAAM,OAAO,gDAAe;CAC5B,MAAM,OAAA,OAAA,QAAqB;CAE3B,MAAM,eAAW,MAAU;OACzB,WAAe,UAAK,UAAA;EACpB,eAAU,KAAA;EACV,IAAA,MAAO,kBAAoB;EAC5B,OAAA,SAAA,MAAA,KAAA;CAED,CAAA;CACA,MAAM,cAAU,MAAA;CAKhB,MAAA,UAAQ,cAAA,aAAA,eAAA,OAAA,SAAA,IAAA,MAAA,KAAA;SACH;EACH,GAAA;EACA;EACF;CAEA;SAAmB,SAAA;EAAM;EAAO;EAAU,GAAA;CAE1C,CAAA;SACE,eAAA;EACA;EACA;EACA,mBAAG,KAAA;EACJ,GAAA;CAED,CAAA;CAEJ,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;MA6BI,YAAO,KAAc,WADH,SAAA,UACqB,OAAA;CACxC,OACH,cAAA,SAAA,aAAA,KAAA,CAAA"}
@@ -0,0 +1,102 @@
1
+ import { n as ButtonOptions } from "../button-Cp853csH.js";
2
+ import { t as FormStore } from "../form-store-C4Kf5QHm.js";
3
+ import { Props } from "@ariakit/react-utils";
4
+ import { ElementType } from "react";
5
+ import { StringLike } from "@ariakit/components/form/types";
6
+
7
+ //#region src/form/form-remove.d.ts
8
+ declare const TagName = "button";
9
+ type TagName = typeof TagName;
10
+ /**
11
+ * Returns props to create a `FormRemove` component.
12
+ * @see https://ariakit.com/components/form
13
+ * @example
14
+ * ```jsx
15
+ * const store = useFormStore({
16
+ * defaultValues: {
17
+ * languages: ["JavaScript", "PHP"],
18
+ * },
19
+ * });
20
+ * const props = useFormRemove({
21
+ * store,
22
+ * name: store.names.languages,
23
+ * index: 0,
24
+ * });
25
+ * const values = useStoreState(store, "values");
26
+ *
27
+ * <Form store={store}>
28
+ * {values.languages.map((_, i) => (
29
+ * <FormInput key={i} name={store.names.languages[i]} />
30
+ * ))}
31
+ * <Role {...props}>Remove first language</Role>
32
+ * </Form>
33
+ * ```
34
+ */
35
+ declare const useFormRemove: import("@ariakit/react-utils").Hook<"button", FormRemoveOptions<"button">>;
36
+ /**
37
+ * Renders a button that will remove an item from an array field in the form
38
+ * when clicked.
39
+ *
40
+ * The [`name`](https://ariakit.com/reference/form-remove#name) prop must be
41
+ * provided to identify the array field. Similarly, the
42
+ * [`index`](https://ariakit.com/reference/form-remove#index) prop is required
43
+ * to pinpoint the item to remove.
44
+ *
45
+ * By default, the button will automatically move focus to the next field in the
46
+ * form when clicked, or to the previous field if there isn't a next field. This
47
+ * behavior can be disabled by setting the
48
+ * [`autoFocusOnClick`](https://ariakit.com/reference/form-remove#autofocusonclick)
49
+ * prop to `false`.
50
+ * @see https://ariakit.com/components/form
51
+ * @example
52
+ * ```jsx {13}
53
+ * const form = useFormStore({
54
+ * defaultValues: {
55
+ * languages: ["JavaScript", "PHP"],
56
+ * },
57
+ * });
58
+ *
59
+ * const values = useStoreState(form, "values");
60
+ *
61
+ * <Form store={form}>
62
+ * {values.languages.map((_, i) => (
63
+ * <div key={i}>
64
+ * <FormInput name={form.names.languages[i]} />
65
+ * <FormRemove name={form.names.languages} index={i} />
66
+ * </div>
67
+ * ))}
68
+ * </Form>
69
+ * ```
70
+ */
71
+ declare const FormRemove: (props: FormRemoveProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
72
+ interface FormRemoveOptions<T extends ElementType = TagName> extends ButtonOptions<T> {
73
+ /**
74
+ * Object returned by the
75
+ * [`useFormStore`](https://ariakit.com/reference/use-form-store) hook. If not
76
+ * provided, the closest [`Form`](https://ariakit.com/reference/form) or
77
+ * [`FormProvider`](https://ariakit.com/reference/form-provider) components'
78
+ * context will be used.
79
+ */
80
+ store?: FormStore;
81
+ /**
82
+ * Name of the array field. This can either be a string or a reference to a
83
+ * field name from the
84
+ * [`names`](https://ariakit.com/reference/use-form-store#names) object in the
85
+ * store, for type safety.
86
+ */
87
+ name: StringLike;
88
+ /**
89
+ * Index of the item to remove.
90
+ */
91
+ index: number;
92
+ /**
93
+ * Whether the focus should be moved to the next or previous field when the
94
+ * button is clicked.
95
+ * @default true
96
+ */
97
+ autoFocusOnClick?: boolean;
98
+ }
99
+ type FormRemoveProps<T extends ElementType = TagName> = Props<T, FormRemoveOptions<T>>;
100
+ //#endregion
101
+ export { FormRemove, FormRemoveOptions, FormRemoveProps, useFormRemove };
102
+ //# sourceMappingURL=form-remove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-remove.d.ts","names":["StringLike","Props","ElementType","ButtonOptions","FormStore","TagName","useFormRemove","FormRemoveOptions","Hook","FormRemove","FormRemoveProps","props","ReactElement","JSXElementConstructor","T","store","name","index","autoFocusOnClick"],"sources":["../../src/form/form-remove.d.ts"],"mappings":";;;;;;;cAKcK,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AA0B7B;;;;AAAmG;AAoCnG;;;;;;;;;AAA6I;AAhE5F,cA4B5BC,aAAAA,iCAA8CE,IAAAA,WAAeD,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;AA8D/E;AAEpB;;;;;;;;;;;;cA5BqBE,UAAAA,GAAaE,KAAAA,EAAOD,eAAe,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UACvGN,iBAAAA,WAA4BL,WAAAA,GAAcG,OAAAA,UAAiBF,aAAAA,CAAcW,CAAAA;EA2B3Bb;;;;;AAA4B;;EAnBvFc,KAAAA,GAAQX,SAAAA;;;;;;;EAORY,IAAAA,EAAMhB,UAAAA;;;;EAINiB,KAAAA;;;;;;EAMAC,gBAAAA;AAAAA;AAAAA,KAEQR,eAAAA,WAA0BR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,iBAAAA,CAAkBO,CAAAA"}
@@ -0,0 +1,116 @@
1
+ "use client";
2
+ import { useButton } from "../button/button.js";
3
+ import { useFormContext } from "./form-context.js";
4
+ import { createElement, createHook, forwardRef, useEvent } from "@ariakit/react-utils";
5
+ import { invariant, isTextField } from "@ariakit/utils";
6
+ //#region src/form/form-remove.tsx
7
+ const TagName = "button";
8
+ function findNextOrPreviousField(items, name, index) {
9
+ const fields = items?.filter((item) => item.type === "field" && item.name.startsWith(name));
10
+ const regex = new RegExp(`^${name}\\.(\\d+)`);
11
+ const nextField = fields?.find((field) => {
12
+ const fieldIndex = field.name.replace(regex, "$1");
13
+ return Number.parseInt(fieldIndex, 10) > index;
14
+ });
15
+ if (nextField) return nextField;
16
+ return fields?.reverse().find((field) => {
17
+ const fieldIndex = field.name.replace(regex, "$1");
18
+ return Number.parseInt(fieldIndex, 10) < index;
19
+ });
20
+ }
21
+ function findPushButton(items, name) {
22
+ return items?.find((item) => item.type === "button" && item.name === name);
23
+ }
24
+ /**
25
+ * Returns props to create a `FormRemove` component.
26
+ * @see https://ariakit.com/components/form
27
+ * @example
28
+ * ```jsx
29
+ * const store = useFormStore({
30
+ * defaultValues: {
31
+ * languages: ["JavaScript", "PHP"],
32
+ * },
33
+ * });
34
+ * const props = useFormRemove({
35
+ * store,
36
+ * name: store.names.languages,
37
+ * index: 0,
38
+ * });
39
+ * const values = useStoreState(store, "values");
40
+ *
41
+ * <Form store={store}>
42
+ * {values.languages.map((_, i) => (
43
+ * <FormInput key={i} name={store.names.languages[i]} />
44
+ * ))}
45
+ * <Role {...props}>Remove first language</Role>
46
+ * </Form>
47
+ * ```
48
+ */
49
+ const useFormRemove = createHook(function useFormRemove({ store, name: nameProp, index, autoFocusOnClick = true, ...props }) {
50
+ const context = useFormContext();
51
+ store = store || context;
52
+ invariant(store, "FormRemove must be wrapped in a Form component.");
53
+ const name = String(nameProp);
54
+ const onClickProp = props.onClick;
55
+ const onClick = useEvent((event) => {
56
+ onClickProp?.(event);
57
+ if (event.defaultPrevented) return;
58
+ if (!store) return;
59
+ store.removeValue(name, index);
60
+ if (!autoFocusOnClick) return;
61
+ const { items } = store.getState();
62
+ const element = findNextOrPreviousField(items, name, index)?.element;
63
+ if (element) {
64
+ element.focus();
65
+ if (isTextField(element)) element.select();
66
+ } else findPushButton(items, name)?.element?.focus();
67
+ });
68
+ props = {
69
+ ...props,
70
+ onClick
71
+ };
72
+ props = useButton(props);
73
+ return props;
74
+ });
75
+ /**
76
+ * Renders a button that will remove an item from an array field in the form
77
+ * when clicked.
78
+ *
79
+ * The [`name`](https://ariakit.com/reference/form-remove#name) prop must be
80
+ * provided to identify the array field. Similarly, the
81
+ * [`index`](https://ariakit.com/reference/form-remove#index) prop is required
82
+ * to pinpoint the item to remove.
83
+ *
84
+ * By default, the button will automatically move focus to the next field in the
85
+ * form when clicked, or to the previous field if there isn't a next field. This
86
+ * behavior can be disabled by setting the
87
+ * [`autoFocusOnClick`](https://ariakit.com/reference/form-remove#autofocusonclick)
88
+ * prop to `false`.
89
+ * @see https://ariakit.com/components/form
90
+ * @example
91
+ * ```jsx {13}
92
+ * const form = useFormStore({
93
+ * defaultValues: {
94
+ * languages: ["JavaScript", "PHP"],
95
+ * },
96
+ * });
97
+ *
98
+ * const values = useStoreState(form, "values");
99
+ *
100
+ * <Form store={form}>
101
+ * {values.languages.map((_, i) => (
102
+ * <div key={i}>
103
+ * <FormInput name={form.names.languages[i]} />
104
+ * <FormRemove name={form.names.languages} index={i} />
105
+ * </div>
106
+ * ))}
107
+ * </Form>
108
+ * ```
109
+ */
110
+ const FormRemove = forwardRef(function FormRemove(props) {
111
+ return createElement(TagName, useFormRemove(props));
112
+ });
113
+ //#endregion
114
+ export { FormRemove, useFormRemove };
115
+
116
+ //# sourceMappingURL=form-remove.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-remove.js","names":[],"sources":["../../src/form/form-remove.tsx"],"sourcesContent":["import type { StringLike } from \"@ariakit/components/form/types\";\nimport {\n useEvent,\n createElement,\n createHook,\n forwardRef,\n} from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport { isTextField, invariant } from \"@ariakit/utils\";\nimport type { ElementType, MouseEvent } from \"react\";\nimport type { ButtonOptions } from \"../button/button.tsx\";\nimport { useButton } from \"../button/button.tsx\";\nimport { useFormContext } from \"./form-context.tsx\";\nimport type { FormStore, FormStoreState } from \"./form-store.ts\";\n\nconst TagName = \"button\" satisfies ElementType;\ntype TagName = typeof TagName;\ntype HTMLType = HTMLElementTagNameMap[TagName];\n\nfunction findNextOrPreviousField(\n items: FormStoreState[\"items\"] | undefined,\n name: string,\n index: number,\n) {\n const fields = items?.filter(\n (item) => item.type === \"field\" && item.name.startsWith(name),\n );\n const regex = new RegExp(`^${name}\\\\.(\\\\d+)`);\n const nextField = fields?.find((field) => {\n const fieldIndex = field.name.replace(regex, \"$1\");\n return Number.parseInt(fieldIndex, 10) > index;\n });\n if (nextField) return nextField;\n return fields?.reverse().find((field) => {\n const fieldIndex = field.name.replace(regex, \"$1\");\n return Number.parseInt(fieldIndex, 10) < index;\n });\n}\n\nfunction findPushButton(\n items: FormStoreState[\"items\"] | undefined,\n name: string,\n) {\n return items?.find((item) => item.type === \"button\" && item.name === name);\n}\n\n/**\n * Returns props to create a `FormRemove` component.\n * @see https://ariakit.com/components/form\n * @example\n * ```jsx\n * const store = useFormStore({\n * defaultValues: {\n * languages: [\"JavaScript\", \"PHP\"],\n * },\n * });\n * const props = useFormRemove({\n * store,\n * name: store.names.languages,\n * index: 0,\n * });\n * const values = useStoreState(store, \"values\");\n *\n * <Form store={store}>\n * {values.languages.map((_, i) => (\n * <FormInput key={i} name={store.names.languages[i]} />\n * ))}\n * <Role {...props}>Remove first language</Role>\n * </Form>\n * ```\n */\nexport const useFormRemove = createHook<TagName, FormRemoveOptions>(\n function useFormRemove({\n store,\n name: nameProp,\n index,\n autoFocusOnClick = true,\n ...props\n }) {\n const context = useFormContext();\n store = store || context;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"FormRemove must be wrapped in a Form component.\",\n );\n\n const name = String(nameProp);\n const onClickProp = props.onClick;\n\n const onClick = useEvent((event: MouseEvent<HTMLType>) => {\n onClickProp?.(event);\n if (event.defaultPrevented) return;\n if (!store) return;\n store.removeValue(name, index);\n if (!autoFocusOnClick) return;\n const { items } = store.getState();\n const item = findNextOrPreviousField(items, name, index);\n const element = item?.element;\n if (element) {\n element.focus();\n if (isTextField(element)) {\n element.select();\n }\n } else {\n const pushButton = findPushButton(items, name);\n pushButton?.element?.focus();\n }\n });\n\n props = {\n ...props,\n onClick,\n };\n\n props = useButton(props);\n\n return props;\n },\n);\n\n/**\n * Renders a button that will remove an item from an array field in the form\n * when clicked.\n *\n * The [`name`](https://ariakit.com/reference/form-remove#name) prop must be\n * provided to identify the array field. Similarly, the\n * [`index`](https://ariakit.com/reference/form-remove#index) prop is required\n * to pinpoint the item to remove.\n *\n * By default, the button will automatically move focus to the next field in the\n * form when clicked, or to the previous field if there isn't a next field. This\n * behavior can be disabled by setting the\n * [`autoFocusOnClick`](https://ariakit.com/reference/form-remove#autofocusonclick)\n * prop to `false`.\n * @see https://ariakit.com/components/form\n * @example\n * ```jsx {13}\n * const form = useFormStore({\n * defaultValues: {\n * languages: [\"JavaScript\", \"PHP\"],\n * },\n * });\n *\n * const values = useStoreState(form, \"values\");\n *\n * <Form store={form}>\n * {values.languages.map((_, i) => (\n * <div key={i}>\n * <FormInput name={form.names.languages[i]} />\n * <FormRemove name={form.names.languages} index={i} />\n * </div>\n * ))}\n * </Form>\n * ```\n */\nexport const FormRemove = forwardRef(function FormRemove(\n props: FormRemoveProps,\n) {\n const htmlProps = useFormRemove(props);\n return createElement(TagName, htmlProps);\n});\n\nexport interface FormRemoveOptions<\n T extends ElementType = TagName,\n> extends ButtonOptions<T> {\n /**\n * Object returned by the\n * [`useFormStore`](https://ariakit.com/reference/use-form-store) hook. If not\n * provided, the closest [`Form`](https://ariakit.com/reference/form) or\n * [`FormProvider`](https://ariakit.com/reference/form-provider) components'\n * context will be used.\n */\n store?: FormStore;\n /**\n * Name of the array field. This can either be a string or a reference to a\n * field name from the\n * [`names`](https://ariakit.com/reference/use-form-store#names) object in the\n * store, for type safety.\n */\n name: StringLike;\n /**\n * Index of the item to remove.\n */\n index: number;\n /**\n * Whether the focus should be moved to the next or previous field when the\n * button is clicked.\n * @default true\n */\n autoFocusOnClick?: boolean;\n}\n\nexport type FormRemoveProps<T extends ElementType = TagName> = Props<\n T,\n FormRemoveOptions<T>\n>;\n"],"mappings":";;;;;;AAmBA,MAAA,UAAS;SAKD,wBACH,OAAS,MAAK,OAAA;CAEjB,MAAM,SAAQ,OAAI,QAAW,SAAK,KAAU,SAAA,WAAA,KAAA,KAAA,WAAA,IAAA,CAAA;CAC5C,MAAM,QAAA,IAAY,OAAA,IAAQ,KAAM,UAAU;OACxC,YAAM,QAAmB,MAAK,UAAQ;EACtC,MAAA,aAAc,MAAS,KAAA,QAAc,OAAI,IAAA;EAC1C,OAAA,OAAA,SAAA,YAAA,EAAA,IAAA;CACD,CAAA;CACA,IAAA,WAAe,OAAA;QACP,QAAA,QAAa,EAAA,MAAW,UAAQ;EACtC,MAAA,aAAc,MAAS,KAAA,QAAc,OAAI,IAAA;EAC1C,OAAA,OAAA,SAAA,YAAA,EAAA,IAAA;CACH,CAAA;AAEA;SAIS,eAAa,OAAS,MAAK;CACpC,OAAA,OAAA,MAAA,SAAA,KAAA,SAAA,YAAA,KAAA,SAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmCI,gBAAgB,WAAe,SAAA,cAAA,EAAA,OAAA,MAAA,UAAA,OAAA,mBAAA,MAAA,GAAA,SAAA;CAC/B,MAAA,UAAQ,eAAS;CAEjB,QAAA,SAGI;CAGJ,UAAM,OAAO,iDAAe;CAC5B,MAAM,OAAA,OAAc,QAAM;CAE1B,MAAM,cAAU,MAAU;OACxB,UAAc,UAAK,UAAA;EACnB,cAAU,KAAA;EACV,IAAI,MAAC,kBAAO;EACZ,IAAA,CAAA,OAAM;EACN,MAAK,YAAA,MAAkB,KAAA;EACvB,IAAA,CAAA,kBAAkB;EAElB,MAAM,EAAA,UADO,MAAA,SAAA;EAEb,MAAI,UAAS,wBAAA,OAAA,MAAA,KAAA,GAAA;MACX,SAAQ;GACR,QAAI,MAAA;GAGN,IAAA,YACqB,OAAe,GAAA,QACzB,OAAG;EAEf,OAAA,eAAA,OAAA,IAAA,GAAA,SAAA,MAAA;CAED,CAAA;SACK;EACH,GAAA;EACF;CAEA;CAEA,QAAO,UAAA,KAAA;CAEX,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAyCE,aAAO,WAAc,SADH,WACoB,OAAC;CACxC,OAAA,cAAA,SAAA,cAAA,KAAA,CAAA"}
@@ -0,0 +1,51 @@
1
+ import { n as ButtonOptions } from "../button-Cp853csH.js";
2
+ import { t as FormStore } from "../form-store-C4Kf5QHm.js";
3
+ import { Props } from "@ariakit/react-utils";
4
+ import { ElementType } from "react";
5
+
6
+ //#region src/form/form-reset.d.ts
7
+ declare const TagName = "button";
8
+ type TagName = typeof TagName;
9
+ /**
10
+ * Returns props to create a `FormReset` component.
11
+ * @see https://ariakit.com/components/form
12
+ * @example
13
+ * ```jsx
14
+ * const store = useFormStore();
15
+ * const props = useFormReset({ store });
16
+ * <Form store={store}>
17
+ * <Role {...props}>Reset</Role>
18
+ * </Form>
19
+ * ```
20
+ */
21
+ declare const useFormReset: import("@ariakit/react-utils").Hook<"button", FormResetOptions<"button">>;
22
+ /**
23
+ * Renders a button that resets the form to its initial values, as defined by
24
+ * the
25
+ * [`defaultValues`](https://ariakit.com/reference/use-form-store#defaultvalues)
26
+ * prop given to the form store.
27
+ * @see https://ariakit.com/components/form
28
+ * @example
29
+ * ```jsx {4}
30
+ * const form = useFormStore();
31
+ *
32
+ * <Form store={form}>
33
+ * <FormReset>Reset</FormReset>
34
+ * </Form>
35
+ * ```
36
+ */
37
+ declare const FormReset: (props: FormResetProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
38
+ interface FormResetOptions<T extends ElementType = TagName> extends ButtonOptions<T> {
39
+ /**
40
+ * Object returned by the
41
+ * [`useFormStore`](https://ariakit.com/reference/use-form-store) hook. If not
42
+ * provided, the closest [`Form`](https://ariakit.com/reference/form) or
43
+ * [`FormProvider`](https://ariakit.com/reference/form-provider) components'
44
+ * context will be used.
45
+ */
46
+ store?: FormStore;
47
+ }
48
+ type FormResetProps<T extends ElementType = TagName> = Props<T, FormResetOptions<T>>;
49
+ //#endregion
50
+ export { FormReset, FormResetOptions, FormResetProps, useFormReset };
51
+ //# sourceMappingURL=form-reset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-reset.d.ts","names":["Props","ElementType","ButtonOptions","FormStore","TagName","useFormReset","FormResetOptions","Hook","FormReset","FormResetProps","props","ReactElement","JSXElementConstructor","T","store"],"sources":["../../src/form/form-reset.d.ts"],"mappings":";;;;;;cAIcI,OAAAA;AAAAA,KACTA,OAAAA,UAAiBA,OAAO;AAFoB;;;;AAC5B;AAAA;;;;AACQ;AAa7B;;AAfiD,cAe5BC,YAAAA,iCAA6CE,IAAAA,WAAeD,gBAAgB;;AAAA;AAgBjG;;;;;;;;;AAA2I;AAC3I;;;cADqBE,SAAAA,GAAYE,KAAAA,EAAOD,cAAc,qBAAqBE,YAAAA,+BAA2CC,qBAAAA;AAAAA,UACrGN,gBAAAA,WAA2BL,WAAAA,GAAcG,OAAAA,UAAiBF,aAAAA,CAAcW,CAAAA;EAAAA;;;;;;;EAQrFC,KAAAA,GAAQX,SAAAA;AAAAA;AAAAA,KAEAM,cAAAA,WAAyBR,WAAAA,GAAcG,OAAAA,IAAWJ,KAAAA,CAAMa,CAAAA,EAAGP,gBAAAA,CAAiBO,CAAAA"}
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ import { useButton } from "../button/button.js";
3
+ import { useFormContext } from "./form-context.js";
4
+ import { createElement, createHook, forwardRef } from "@ariakit/react-utils";
5
+ import { invariant } from "@ariakit/utils";
6
+ import { useStoreState } from "@ariakit/react-store";
7
+ //#region src/form/form-reset.tsx
8
+ const TagName = "button";
9
+ /**
10
+ * Returns props to create a `FormReset` component.
11
+ * @see https://ariakit.com/components/form
12
+ * @example
13
+ * ```jsx
14
+ * const store = useFormStore();
15
+ * const props = useFormReset({ store });
16
+ * <Form store={store}>
17
+ * <Role {...props}>Reset</Role>
18
+ * </Form>
19
+ * ```
20
+ */
21
+ const useFormReset = createHook(function useFormReset({ store, ...props }) {
22
+ const context = useFormContext();
23
+ store = store || context;
24
+ invariant(store, "FormReset must be wrapped in a Form component.");
25
+ props = {
26
+ type: "reset",
27
+ disabled: useStoreState(store, "submitting"),
28
+ ...props
29
+ };
30
+ props = useButton(props);
31
+ return props;
32
+ });
33
+ /**
34
+ * Renders a button that resets the form to its initial values, as defined by
35
+ * the
36
+ * [`defaultValues`](https://ariakit.com/reference/use-form-store#defaultvalues)
37
+ * prop given to the form store.
38
+ * @see https://ariakit.com/components/form
39
+ * @example
40
+ * ```jsx {4}
41
+ * const form = useFormStore();
42
+ *
43
+ * <Form store={form}>
44
+ * <FormReset>Reset</FormReset>
45
+ * </Form>
46
+ * ```
47
+ */
48
+ const FormReset = forwardRef(function FormReset(props) {
49
+ return createElement(TagName, useFormReset(props));
50
+ });
51
+ //#endregion
52
+ export { FormReset, useFormReset };
53
+
54
+ //# sourceMappingURL=form-reset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-reset.js","names":[],"sources":["../../src/form/form-reset.tsx"],"sourcesContent":["import { useStoreState } from \"@ariakit/react-store\";\nimport { createElement, createHook, forwardRef } from \"@ariakit/react-utils\";\nimport type { Props } from \"@ariakit/react-utils\";\nimport { invariant } from \"@ariakit/utils\";\nimport type { ElementType } from \"react\";\nimport type { ButtonOptions } from \"../button/button.tsx\";\nimport { useButton } from \"../button/button.tsx\";\nimport { useFormContext } from \"./form-context.tsx\";\nimport type { FormStore } from \"./form-store.ts\";\n\nconst TagName = \"button\" satisfies ElementType;\ntype TagName = typeof TagName;\n\n/**\n * Returns props to create a `FormReset` component.\n * @see https://ariakit.com/components/form\n * @example\n * ```jsx\n * const store = useFormStore();\n * const props = useFormReset({ store });\n * <Form store={store}>\n * <Role {...props}>Reset</Role>\n * </Form>\n * ```\n */\nexport const useFormReset = createHook<TagName, FormResetOptions>(\n function useFormReset({ store, ...props }) {\n const context = useFormContext();\n store = store || context;\n\n invariant(\n store,\n process.env.NODE_ENV !== \"production\" &&\n \"FormReset must be wrapped in a Form component.\",\n );\n\n props = {\n type: \"reset\",\n disabled: useStoreState(store, \"submitting\"),\n ...props,\n };\n\n props = useButton(props);\n\n return props;\n },\n);\n\n/**\n * Renders a button that resets the form to its initial values, as defined by\n * the\n * [`defaultValues`](https://ariakit.com/reference/use-form-store#defaultvalues)\n * prop given to the form store.\n * @see https://ariakit.com/components/form\n * @example\n * ```jsx {4}\n * const form = useFormStore();\n *\n * <Form store={form}>\n * <FormReset>Reset</FormReset>\n * </Form>\n * ```\n */\nexport const FormReset = forwardRef(function FormReset(props: FormResetProps) {\n const htmlProps = useFormReset(props);\n return createElement(TagName, htmlProps);\n});\n\nexport interface FormResetOptions<\n T extends ElementType = TagName,\n> extends ButtonOptions<T> {\n /**\n * Object returned by the\n * [`useFormStore`](https://ariakit.com/reference/use-form-store) hook. If not\n * provided, the closest [`Form`](https://ariakit.com/reference/form) or\n * [`FormProvider`](https://ariakit.com/reference/form-provider) components'\n * context will be used.\n */\n store?: FormStore;\n}\n\nexport type FormResetProps<T extends ElementType = TagName> = Props<\n T,\n FormResetOptions<T>\n>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;MA2BI,eAAgB,WAAe,SAAA,aAAA,EAAA,OAAA,GAAA,SAAA;CAC/B,MAAA,UAAQ,eAAS;CAEjB,QAAA,SAGI;CAGJ,UAAQ,OAAA,gDAAA;SACA;EACN,MAAA;EACA,UAAG,cAAA,OAAA,YAAA;EACL,GAAA;CAEA;CAEA,QAAO,UAAA,KAAA;CAEX,OAAA;;;;;;;;;;;;;;;;;MAmBE,YAAO,WAAc,SADH,UAAa,OACQ;CACxC,OAAA,cAAA,SAAA,aAAA,KAAA,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { a as FormStoreProps, c as useFormStore, i as FormStoreOptions, l as useFormStoreProps, n as FormStoreFunctions, o as FormStoreState, r as FormStoreItem, s as FormStoreValues, t as FormStore } from "../form-store-C4Kf5QHm.js";
2
+ export { FormStore, FormStoreFunctions, FormStoreItem, FormStoreOptions, FormStoreProps, FormStoreState, FormStoreValues, useFormStore, useFormStoreProps };
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { useCollectionStoreProps } from "../collection/collection-store.js";
3
+ import { useEvent } from "@ariakit/react-utils";
4
+ import { useCallback, useEffect, useMemo } from "react";
5
+ import { useStore, useStoreProps, useStoreState } from "@ariakit/react-store";
6
+ import * as Core from "@ariakit/components/form/form-store";
7
+ //#region src/form/form-store.ts
8
+ function useFormStoreProps(store, update, props) {
9
+ store = useCollectionStoreProps(store, update, props);
10
+ useStoreProps(store, props, "values", "setValues");
11
+ useStoreProps(store, props, "errors", "setErrors");
12
+ useStoreProps(store, props, "touched", "setTouched");
13
+ const useValue = useCallback((name) => useStoreState(store, () => store.getValue(name)), [store]);
14
+ const useValidate = useCallback((callback) => {
15
+ callback = useEvent(callback);
16
+ useEffect(() => store.onValidate(callback), [useStoreState(store, "items"), callback]);
17
+ }, [store]);
18
+ const useSubmit = useCallback((callback) => {
19
+ callback = useEvent(callback);
20
+ useEffect(() => store.onSubmit(callback), [useStoreState(store, "items"), callback]);
21
+ }, [store]);
22
+ return useMemo(() => ({
23
+ ...store,
24
+ useValue,
25
+ useValidate,
26
+ useSubmit
27
+ }), [
28
+ store,
29
+ useValue,
30
+ useValidate,
31
+ useSubmit
32
+ ]);
33
+ }
34
+ function useFormStore(props = {}) {
35
+ const [store, update] = useStore(Core.createFormStore, props);
36
+ return useFormStoreProps(store, update, props);
37
+ }
38
+ //#endregion
39
+ export { useFormStore, useFormStoreProps };
40
+
41
+ //# sourceMappingURL=form-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-store.js","names":[],"sources":["../../src/form/form-store.ts"],"sourcesContent":["import * as Core from \"@ariakit/components/form/form-store\";\nimport type { StringLike } from \"@ariakit/components/form/types\";\nimport { useStore, useStoreProps, useStoreState } from \"@ariakit/react-store\";\nimport type { Store } from \"@ariakit/react-store\";\nimport { useEvent } from \"@ariakit/react-utils\";\nimport type { PickRequired } from \"@ariakit/utils\";\nimport { useCallback, useEffect, useMemo } from \"react\";\nimport type {\n CollectionStoreFunctions,\n CollectionStoreOptions,\n CollectionStoreState,\n} from \"../collection/collection-store.ts\";\nimport { useCollectionStoreProps } from \"../collection/collection-store.ts\";\n\nexport function useFormStoreProps<\n T extends Omit<FormStore, \"useValue\" | \"useValidate\" | \"useSubmit\">,\n>(store: T, update: () => void, props: FormStoreProps) {\n store = useCollectionStoreProps(store, update, props);\n\n useStoreProps(store, props, \"values\", \"setValues\");\n useStoreProps(store, props, \"errors\", \"setErrors\");\n useStoreProps(store, props, \"touched\", \"setTouched\");\n\n const useValue = useCallback<FormStore[\"useValue\"]>(\n (name) => useStoreState(store, () => store.getValue(name)),\n [store],\n );\n\n const useValidate = useCallback<FormStore[\"useValidate\"]>(\n (callback) => {\n callback = useEvent(callback);\n // Whenever the items change (for example, when form fields are lazily\n // rendered), we need to reset the callbacks so they always run in a\n // consistent order.\n const items = useStoreState(store, \"items\");\n useEffect(() => store.onValidate(callback), [items, callback]);\n },\n [store],\n );\n\n const useSubmit = useCallback<FormStore[\"useSubmit\"]>(\n (callback) => {\n callback = useEvent(callback);\n // Same logic as useValidate.\n const items = useStoreState(store, \"items\");\n useEffect(() => store.onSubmit(callback), [items, callback]);\n },\n [store],\n );\n\n return useMemo(\n () => ({\n ...store,\n useValue,\n useValidate,\n useSubmit,\n }),\n [store, useValue, useValidate, useSubmit],\n );\n}\n\n/**\n * Creates a form store to control the state of\n * [Form](https://ariakit.com/components/form) components.\n * @example\n * ```jsx\n * const form = useFormStore({\n * defaultValues: {\n * email: \"\",\n * },\n * });\n *\n * <Form store={form}>\n * <FormLabel name={form.names.email}>Email</FormLabel>\n * <FormInput name={form.names.email} />\n * <FormError name={form.names.email} />\n * <FormSubmit>Submit</FormSubmit>\n * </Form>\n * ```\n */\nexport function useFormStore<T extends FormStoreValues = FormStoreValues>(\n props: PickRequired<\n FormStoreProps<T>,\n | \"values\"\n | \"defaultValues\"\n | \"errors\"\n | \"defaultErrors\"\n | \"touched\"\n | \"defaultTouched\"\n >,\n): FormStore<T>;\n\nexport function useFormStore(props: FormStoreProps): FormStore;\n\nexport function useFormStore(props: FormStoreProps = {}): FormStore {\n const [store, update] = useStore(Core.createFormStore, props);\n return useFormStoreProps(store, update, props);\n}\n\nexport interface FormStoreValues extends Core.FormStoreValues {}\n\nexport interface FormStoreItem extends Core.FormStoreItem {}\n\nexport interface FormStoreState<T extends FormStoreValues = FormStoreValues>\n extends Core.FormStoreState<T>, CollectionStoreState<FormStoreItem> {}\n\nexport interface FormStoreFunctions<T extends FormStoreValues = FormStoreValues>\n extends Core.FormStoreFunctions<T>, CollectionStoreFunctions<FormStoreItem> {\n /**\n * A custom hook that rerenders the component when the value of the given\n * field changes. It accepts a string or a reference to a field name from the\n * [`names`](https://ariakit.com/reference/use-form-store#names) object in the\n * store, for type safety. It returns the value of the field.\n *\n * Live examples:\n * - [Form with Select](https://ariakit.com/examples/form-select)\n * @example\n * const nameValue = store.useValue(\"name\");\n * // Can also use store.names for type safety.\n * const emailValue = store.useValue(store.names.email);\n */\n // oxlint-disable-next-line no-unnecessary-type-parameters\n useValue: <T = any>(name: StringLike) => T;\n /**\n * Custom hook that accepts a callback that will be used to validate the form\n * when [`validate`](https://ariakit.com/reference/use-form-store#validate) is\n * called, typically when a form field is touched or when the form is\n * submitted.\n *\n * Live examples:\n * - [FormRadio](https://ariakit.com/examples/form-radio)\n * @example\n * store.useValidate(async (state) => {\n * const errors = await api.validate(state.values);\n * if (errors) {\n * store.setErrors(errors);\n * }\n * });\n */\n useValidate: (callback: Core.FormStoreCallback<FormStoreState<T>>) => void;\n /**\n * Custom hook that accepts a callback that will be used to submit the form\n * when [`submit`](https://ariakit.com/reference/use-form-store#submit) is\n * called.\n *\n * Live examples:\n * - [FormRadio](https://ariakit.com/examples/form-radio)\n * - [Form with Select](https://ariakit.com/examples/form-select)\n * @example\n * store.useSubmit(async (state) => {\n * try {\n * await api.submit(state.values);\n * } catch (errors) {\n * store.setErrors(errors);\n * }\n * });\n */\n useSubmit: (callback: Core.FormStoreCallback<FormStoreState<T>>) => void;\n}\n\nexport interface FormStoreOptions<T extends FormStoreValues = FormStoreValues>\n extends Core.FormStoreOptions<T>, CollectionStoreOptions<FormStoreItem> {\n /**\n * Function that will be called when\n * [`values`](https://ariakit.com/reference/use-form-store#values) state\n * changes.\n * @example\n * function MyForm({ values, onChange }) {\n * const form = useFormStore({ values, setValues: onChange });\n * }\n */\n setValues?: (values: FormStoreState<T>[\"values\"]) => void;\n /**\n * Function that will be called when the\n * [`errors`](https://ariakit.com/reference/use-form-store#errors) state\n * changes.\n * @example\n * useFormStore({ setErrors: (errors) => console.log(errors) });\n */\n setErrors?: (errors: FormStoreState<T>[\"errors\"]) => void;\n /**\n * Function that will be called when the\n * [`touched`](https://ariakit.com/reference/use-form-store#touched) state\n * changes.\n * @example\n * useFormStore({ setTouched: (touched) => console.log(touched) });\n */\n setTouched?: (touched: FormStoreState<T>[\"touched\"]) => void;\n}\n\nexport interface FormStoreProps<T extends FormStoreValues = FormStoreValues>\n extends FormStoreOptions<T>, Core.FormStoreProps<T> {}\n\nexport interface FormStore<T extends FormStoreValues = FormStoreValues>\n extends FormStoreFunctions<T>, Store<Core.FormStore<T>> {}\n"],"mappings":";;;;;;;SAiBU,kBAAA,OAAwB,QAAO,OAAQ;CAE/C,QAAA,wBAA4B,OAAU,QAAA,KAAW;CACjD,cAAc,OAAO,OAAO,UAAU,WAAW;CACjD,cAAc,OAAO,OAAO,UAAA,WAAW;CAEvC,cAAM,OAAW,OAAA,WACL,YAAA;CAIZ,MAAM,WAAA,aAAc,SACjB,cAAa,aAAA,MAAA,SAAA,IAAA,CAAA,GAAA,CAAA,KAAA,CAAA;OACZ,cAAW,aAAiB,aAAA;EAK5B,WAAA,SAAgB,QAAM;EACxB,gBAEF,MAAA,WAAA,QAAA,GAAA,CAAA,cAAA,OAAA,OAAA,GAAA,QAAA,CAAA;CAEA,GAAA,CAAA,KAAM,CAAA;OAEF,YAAW,aAAiB,aAAA;EAG5B,WAAA,SAAgB,QAAM;EACxB,gBAEF,MAAA,SAAA,QAAA,GAAA,CAAA,cAAA,OAAA,OAAA,GAAA,QAAA,CAAA;CAEA,GAAA,CAAA,KAAO,CAAA;QAEA,eAAA;EACH,GAAA;EACA;EACA;EACF;KACC;EAAO;EAAU;EAAa;EACjC;CACF,CAAA;AAmCA;SACS,aAAO,QAAU,CAAA,GAAS;CACjC,MAAA,CAAO,OAAA,UAAA,SAAyB,KAAA,iBAAa,KAAA;CAC/C,OAAA,kBAAA,OAAA,QAAA,KAAA"}