@funstack/ui 0.1.0-alpha.2 → 0.1.0-alpha.20

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 (962) hide show
  1. package/README.md +22 -1
  2. package/dist/accordion/accordion-context.mjs.map +1 -1
  3. package/dist/accordion/accordion-item.d.mts +22 -4
  4. package/dist/accordion/accordion-item.d.mts.map +1 -1
  5. package/dist/accordion/accordion-item.mjs +32 -10
  6. package/dist/accordion/accordion-item.mjs.map +1 -1
  7. package/dist/accordion/accordion-panel.d.mts +19 -4
  8. package/dist/accordion/accordion-panel.d.mts.map +1 -1
  9. package/dist/accordion/accordion-panel.mjs +8 -6
  10. package/dist/accordion/accordion-panel.mjs.map +1 -1
  11. package/dist/accordion/accordion-root.d.mts +39 -5
  12. package/dist/accordion/accordion-root.d.mts.map +1 -1
  13. package/dist/accordion/accordion-root.mjs +75 -67
  14. package/dist/accordion/accordion-root.mjs.map +1 -1
  15. package/dist/accordion/accordion-trigger.d.mts +12 -4
  16. package/dist/accordion/accordion-trigger.d.mts.map +1 -1
  17. package/dist/accordion/accordion-trigger.mjs +14 -28
  18. package/dist/accordion/accordion-trigger.mjs.map +1 -1
  19. package/dist/accordion/index.d.mts +2 -0
  20. package/dist/accordion/index.d.mts.map +1 -1
  21. package/dist/accordion/index.mjs +2 -0
  22. package/dist/accordion/index.mjs.map +1 -1
  23. package/dist/alert-dialog/alert-dialog-action.d.mts +73 -0
  24. package/dist/alert-dialog/alert-dialog-action.d.mts.map +1 -0
  25. package/dist/alert-dialog/alert-dialog-action.mjs +23 -0
  26. package/dist/alert-dialog/alert-dialog-action.mjs.map +1 -0
  27. package/dist/alert-dialog/alert-dialog-cancel.d.mts +31 -0
  28. package/dist/alert-dialog/alert-dialog-cancel.d.mts.map +1 -0
  29. package/dist/alert-dialog/alert-dialog-cancel.mjs +50 -0
  30. package/dist/alert-dialog/alert-dialog-cancel.mjs.map +1 -0
  31. package/dist/alert-dialog/alert-dialog-context.mjs +24 -0
  32. package/dist/alert-dialog/alert-dialog-context.mjs.map +1 -0
  33. package/dist/alert-dialog/alert-dialog-description.d.mts +25 -0
  34. package/dist/alert-dialog/alert-dialog-description.d.mts.map +1 -0
  35. package/dist/alert-dialog/alert-dialog-description.mjs +20 -0
  36. package/dist/alert-dialog/alert-dialog-description.mjs.map +1 -0
  37. package/dist/alert-dialog/alert-dialog-form.d.mts +27 -0
  38. package/dist/alert-dialog/alert-dialog-form.d.mts.map +1 -0
  39. package/dist/alert-dialog/alert-dialog-form.mjs +22 -0
  40. package/dist/alert-dialog/alert-dialog-form.mjs.map +1 -0
  41. package/dist/alert-dialog/alert-dialog-popup.d.mts +42 -0
  42. package/dist/alert-dialog/alert-dialog-popup.d.mts.map +1 -0
  43. package/dist/alert-dialog/alert-dialog-popup.mjs +53 -0
  44. package/dist/alert-dialog/alert-dialog-popup.mjs.map +1 -0
  45. package/dist/alert-dialog/alert-dialog-root.d.mts +31 -0
  46. package/dist/alert-dialog/alert-dialog-root.d.mts.map +1 -0
  47. package/dist/alert-dialog/alert-dialog-root.mjs +22 -0
  48. package/dist/alert-dialog/alert-dialog-root.mjs.map +1 -0
  49. package/dist/alert-dialog/alert-dialog-title.d.mts +23 -0
  50. package/dist/alert-dialog/alert-dialog-title.d.mts.map +1 -0
  51. package/dist/alert-dialog/alert-dialog-title.mjs +18 -0
  52. package/dist/alert-dialog/alert-dialog-title.mjs.map +1 -0
  53. package/dist/alert-dialog/alert-dialog-trigger.d.mts +23 -0
  54. package/dist/alert-dialog/alert-dialog-trigger.d.mts.map +1 -0
  55. package/dist/alert-dialog/alert-dialog-trigger.mjs +18 -0
  56. package/dist/alert-dialog/alert-dialog-trigger.mjs.map +1 -0
  57. package/dist/alert-dialog/index.d.mts +33 -0
  58. package/dist/alert-dialog/index.d.mts.map +1 -0
  59. package/dist/alert-dialog/index.mjs +33 -0
  60. package/dist/alert-dialog/index.mjs.map +1 -0
  61. package/dist/bin/skill-installer.d.mts +1 -0
  62. package/dist/bin/skill-installer.mjs +12 -0
  63. package/dist/bin/skill-installer.mjs.map +1 -0
  64. package/dist/button/button.d.mts +118 -0
  65. package/dist/button/button.d.mts.map +1 -0
  66. package/dist/button/button.mjs +98 -0
  67. package/dist/button/button.mjs.map +1 -0
  68. package/dist/button/index.d.mts +3 -0
  69. package/dist/button/index.mjs +1 -0
  70. package/dist/checkbox/checkbox.d.mts +32 -9
  71. package/dist/checkbox/checkbox.d.mts.map +1 -1
  72. package/dist/checkbox/checkbox.mjs +25 -50
  73. package/dist/checkbox/checkbox.mjs.map +1 -1
  74. package/dist/checkbox-group/checkbox-group-context.mjs.map +1 -1
  75. package/dist/checkbox-group/checkbox-group-item.d.mts +20 -5
  76. package/dist/checkbox-group/checkbox-group-item.d.mts.map +1 -1
  77. package/dist/checkbox-group/checkbox-group-item.mjs +25 -27
  78. package/dist/checkbox-group/checkbox-group-item.mjs.map +1 -1
  79. package/dist/checkbox-group/checkbox-group-label.d.mts +10 -0
  80. package/dist/checkbox-group/checkbox-group-label.d.mts.map +1 -1
  81. package/dist/checkbox-group/checkbox-group-label.mjs +3 -6
  82. package/dist/checkbox-group/checkbox-group-label.mjs.map +1 -1
  83. package/dist/checkbox-group/checkbox-group-parent.d.mts +22 -5
  84. package/dist/checkbox-group/checkbox-group-parent.d.mts.map +1 -1
  85. package/dist/checkbox-group/checkbox-group-parent.mjs +17 -13
  86. package/dist/checkbox-group/checkbox-group-parent.mjs.map +1 -1
  87. package/dist/checkbox-group/checkbox-group-root.d.mts +37 -7
  88. package/dist/checkbox-group/checkbox-group-root.d.mts.map +1 -1
  89. package/dist/checkbox-group/checkbox-group-root.mjs +102 -102
  90. package/dist/checkbox-group/checkbox-group-root.mjs.map +1 -1
  91. package/dist/checkbox-group/index.d.mts +2 -0
  92. package/dist/checkbox-group/index.d.mts.map +1 -1
  93. package/dist/checkbox-group/index.mjs +2 -0
  94. package/dist/checkbox-group/index.mjs.map +1 -1
  95. package/dist/collapsible/collapsible-context.mjs +8 -0
  96. package/dist/collapsible/collapsible-context.mjs.map +1 -0
  97. package/dist/collapsible/collapsible-panel.d.mts +53 -0
  98. package/dist/collapsible/collapsible-panel.d.mts.map +1 -0
  99. package/dist/collapsible/collapsible-panel.mjs +41 -0
  100. package/dist/collapsible/collapsible-panel.mjs.map +1 -0
  101. package/dist/collapsible/collapsible-root.d.mts +108 -0
  102. package/dist/collapsible/collapsible-root.d.mts.map +1 -0
  103. package/dist/collapsible/collapsible-root.mjs +147 -0
  104. package/dist/collapsible/collapsible-root.mjs.map +1 -0
  105. package/dist/collapsible/collapsible-trigger.d.mts +45 -0
  106. package/dist/collapsible/collapsible-trigger.d.mts.map +1 -0
  107. package/dist/collapsible/collapsible-trigger.mjs +62 -0
  108. package/dist/collapsible/collapsible-trigger.mjs.map +1 -0
  109. package/dist/collapsible/index.d.mts +21 -0
  110. package/dist/collapsible/index.d.mts.map +1 -0
  111. package/dist/collapsible/index.mjs +21 -0
  112. package/dist/collapsible/index.mjs.map +1 -0
  113. package/dist/combobox/chip-text.mjs +24 -0
  114. package/dist/combobox/chip-text.mjs.map +1 -0
  115. package/dist/combobox/combobox-chips.d.mts +159 -0
  116. package/dist/combobox/combobox-chips.d.mts.map +1 -0
  117. package/dist/combobox/combobox-chips.mjs +198 -0
  118. package/dist/combobox/combobox-chips.mjs.map +1 -0
  119. package/dist/combobox/combobox-clear.d.mts +29 -5
  120. package/dist/combobox/combobox-clear.d.mts.map +1 -1
  121. package/dist/combobox/combobox-clear.mjs +17 -8
  122. package/dist/combobox/combobox-clear.mjs.map +1 -1
  123. package/dist/combobox/combobox-context.mjs +4 -5
  124. package/dist/combobox/combobox-context.mjs.map +1 -1
  125. package/dist/combobox/combobox-group.d.mts +49 -1
  126. package/dist/combobox/combobox-group.d.mts.map +1 -1
  127. package/dist/combobox/combobox-group.mjs +14 -3
  128. package/dist/combobox/combobox-group.mjs.map +1 -1
  129. package/dist/combobox/combobox-input.d.mts +27 -5
  130. package/dist/combobox/combobox-input.d.mts.map +1 -1
  131. package/dist/combobox/combobox-input.mjs +53 -13
  132. package/dist/combobox/combobox-input.mjs.map +1 -1
  133. package/dist/combobox/combobox-keyboard.mjs +127 -0
  134. package/dist/combobox/combobox-keyboard.mjs.map +1 -0
  135. package/dist/combobox/combobox-label.d.mts +18 -1
  136. package/dist/combobox/combobox-label.d.mts.map +1 -1
  137. package/dist/combobox/combobox-label.mjs +4 -1
  138. package/dist/combobox/combobox-label.mjs.map +1 -1
  139. package/dist/combobox/combobox-list.d.mts +15 -1
  140. package/dist/combobox/combobox-list.d.mts.map +1 -1
  141. package/dist/combobox/combobox-list.mjs +13 -13
  142. package/dist/combobox/combobox-list.mjs.map +1 -1
  143. package/dist/combobox/combobox-option.d.mts +30 -5
  144. package/dist/combobox/combobox-option.d.mts.map +1 -1
  145. package/dist/combobox/combobox-option.mjs +9 -5
  146. package/dist/combobox/combobox-option.mjs.map +1 -1
  147. package/dist/combobox/combobox-popup.d.mts +24 -3
  148. package/dist/combobox/combobox-popup.d.mts.map +1 -1
  149. package/dist/combobox/combobox-popup.mjs +24 -29
  150. package/dist/combobox/combobox-popup.mjs.map +1 -1
  151. package/dist/combobox/combobox-root.d.mts +183 -43
  152. package/dist/combobox/combobox-root.d.mts.map +1 -1
  153. package/dist/combobox/combobox-root.mjs +476 -270
  154. package/dist/combobox/combobox-root.mjs.map +1 -1
  155. package/dist/combobox/combobox-trigger.d.mts +36 -8
  156. package/dist/combobox/combobox-trigger.d.mts.map +1 -1
  157. package/dist/combobox/combobox-trigger.mjs +50 -41
  158. package/dist/combobox/combobox-trigger.mjs.map +1 -1
  159. package/dist/combobox/index.d.mts +13 -5
  160. package/dist/combobox/index.d.mts.map +1 -1
  161. package/dist/combobox/index.mjs +13 -5
  162. package/dist/combobox/index.mjs.map +1 -1
  163. package/dist/combobox/use-combobox-form.mjs +53 -0
  164. package/dist/combobox/use-combobox-form.mjs.map +1 -0
  165. package/dist/combobox/use-combobox-text.mjs +43 -0
  166. package/dist/combobox/use-combobox-text.mjs.map +1 -0
  167. package/dist/csp/csp-provider.d.mts +33 -0
  168. package/dist/csp/csp-provider.d.mts.map +1 -0
  169. package/dist/csp/csp-provider.mjs +26 -0
  170. package/dist/csp/csp-provider.mjs.map +1 -0
  171. package/dist/csp/index.d.mts +3 -0
  172. package/dist/csp/index.mjs +3 -0
  173. package/dist/csp/style-hashes.d.mts +21 -0
  174. package/dist/csp/style-hashes.d.mts.map +1 -0
  175. package/dist/csp/style-hashes.mjs +23 -0
  176. package/dist/csp/style-hashes.mjs.map +1 -0
  177. package/dist/dialog/dialog-close.d.mts +56 -12
  178. package/dist/dialog/dialog-close.d.mts.map +1 -1
  179. package/dist/dialog/dialog-close.mjs +52 -55
  180. package/dist/dialog/dialog-close.mjs.map +1 -1
  181. package/dist/dialog/dialog-context.d.mts +2 -0
  182. package/dist/dialog/dialog-context.mjs +14 -2
  183. package/dist/dialog/dialog-context.mjs.map +1 -1
  184. package/dist/dialog/dialog-description.d.mts +14 -1
  185. package/dist/dialog/dialog-description.d.mts.map +1 -1
  186. package/dist/dialog/dialog-description.mjs +10 -4
  187. package/dist/dialog/dialog-description.mjs.map +1 -1
  188. package/dist/dialog/dialog-dismiss.mjs +108 -0
  189. package/dist/dialog/dialog-dismiss.mjs.map +1 -0
  190. package/dist/dialog/dialog-form.d.mts +43 -11
  191. package/dist/dialog/dialog-form.d.mts.map +1 -1
  192. package/dist/dialog/dialog-form.mjs +64 -37
  193. package/dist/dialog/dialog-form.mjs.map +1 -1
  194. package/dist/dialog/dialog-popup.d.mts +47 -14
  195. package/dist/dialog/dialog-popup.d.mts.map +1 -1
  196. package/dist/dialog/dialog-popup.mjs +167 -242
  197. package/dist/dialog/dialog-popup.mjs.map +1 -1
  198. package/dist/dialog/dialog-root.d.mts +54 -19
  199. package/dist/dialog/dialog-root.d.mts.map +1 -1
  200. package/dist/dialog/dialog-root.mjs +74 -92
  201. package/dist/dialog/dialog-root.mjs.map +1 -1
  202. package/dist/dialog/dialog-title.d.mts +13 -1
  203. package/dist/dialog/dialog-title.d.mts.map +1 -1
  204. package/dist/dialog/dialog-title.mjs +10 -4
  205. package/dist/dialog/dialog-title.mjs.map +1 -1
  206. package/dist/dialog/dialog-trigger.d.mts +30 -6
  207. package/dist/dialog/dialog-trigger.d.mts.map +1 -1
  208. package/dist/dialog/dialog-trigger.mjs +50 -28
  209. package/dist/dialog/dialog-trigger.mjs.map +1 -1
  210. package/dist/dialog/index.d.mts +7 -3
  211. package/dist/dialog/index.d.mts.map +1 -1
  212. package/dist/dialog/index.mjs +7 -3
  213. package/dist/dialog/index.mjs.map +1 -1
  214. package/dist/docs/components/accordion.md +428 -0
  215. package/dist/docs/components/alert-dialog.md +546 -0
  216. package/dist/docs/components/button.md +511 -0
  217. package/dist/docs/components/checkbox-group.md +483 -0
  218. package/dist/docs/components/checkbox.md +373 -0
  219. package/dist/docs/components/collapsible.md +408 -0
  220. package/dist/docs/components/combobox.md +960 -0
  221. package/dist/docs/components/context-menu.md +524 -0
  222. package/dist/docs/components/dialog.md +694 -0
  223. package/dist/docs/components/field.md +765 -0
  224. package/dist/docs/components/hover-card.md +494 -0
  225. package/dist/docs/components/menu.md +670 -0
  226. package/dist/docs/components/meter.md +313 -0
  227. package/dist/docs/components/multi-select.md +622 -0
  228. package/dist/docs/components/number-field.md +528 -0
  229. package/dist/docs/components/popover.md +656 -0
  230. package/dist/docs/components/progress.md +450 -0
  231. package/dist/docs/components/radio-group.md +457 -0
  232. package/dist/docs/components/select.md +670 -0
  233. package/dist/docs/components/separator.md +182 -0
  234. package/dist/docs/components/slider.md +558 -0
  235. package/dist/docs/components/switch.md +311 -0
  236. package/dist/docs/components/tabs.md +473 -0
  237. package/dist/docs/components/toast.md +602 -0
  238. package/dist/docs/components/toggle-group.md +341 -0
  239. package/dist/docs/components/toggle.md +245 -0
  240. package/dist/docs/components/toolbar.md +390 -0
  241. package/dist/docs/components/tooltip.md +494 -0
  242. package/dist/docs/concepts/action-props.md +281 -0
  243. package/dist/docs/concepts/ai-agents.md +56 -0
  244. package/dist/docs/concepts/browser-owned-state.md +133 -0
  245. package/dist/docs/concepts/content-security-policy.md +69 -0
  246. package/dist/docs/concepts/experimental.md +36 -0
  247. package/dist/docs/concepts/pending-and-optimistic.md +263 -0
  248. package/dist/docs/concepts/render.md +23 -0
  249. package/dist/docs/concepts/server-components.md +132 -0
  250. package/dist/docs/concepts/suspense.md +129 -0
  251. package/dist/docs/concepts/transitions.md +112 -0
  252. package/dist/docs/getting-started.md +102 -0
  253. package/dist/docs/index.md +187 -0
  254. package/dist/docs/roadmap.md +144 -0
  255. package/dist/docs/why.md +104 -0
  256. package/dist/field/field-control.d.mts +65 -0
  257. package/dist/field/field-control.d.mts.map +1 -0
  258. package/dist/field/field-control.mjs +92 -0
  259. package/dist/field/field-control.mjs.map +1 -0
  260. package/dist/field/field-description.d.mts +35 -0
  261. package/dist/field/field-description.d.mts.map +1 -0
  262. package/dist/field/field-description.mjs +35 -0
  263. package/dist/field/field-description.mjs.map +1 -0
  264. package/dist/field/field-error.d.mts +42 -0
  265. package/dist/field/field-error.d.mts.map +1 -0
  266. package/dist/field/field-error.mjs +43 -0
  267. package/dist/field/field-error.mjs.map +1 -0
  268. package/dist/field/field-label.d.mts +39 -0
  269. package/dist/field/field-label.d.mts.map +1 -0
  270. package/dist/field/field-label.mjs +50 -0
  271. package/dist/field/field-label.mjs.map +1 -0
  272. package/dist/field/field-root.d.mts +72 -0
  273. package/dist/field/field-root.d.mts.map +1 -0
  274. package/dist/field/field-root.mjs +309 -0
  275. package/dist/field/field-root.mjs.map +1 -0
  276. package/dist/field/index.d.mts +27 -0
  277. package/dist/field/index.d.mts.map +1 -0
  278. package/dist/field/index.mjs +26 -0
  279. package/dist/field/index.mjs.map +1 -0
  280. package/dist/field/use-server-error-visibility.mjs +44 -0
  281. package/dist/field/use-server-error-visibility.mjs.map +1 -0
  282. package/dist/form/form-root.d.mts +74 -0
  283. package/dist/form/form-root.d.mts.map +1 -0
  284. package/dist/form/form-root.mjs +158 -0
  285. package/dist/form/form-root.mjs.map +1 -0
  286. package/dist/form/form-submit.d.mts +56 -0
  287. package/dist/form/form-submit.d.mts.map +1 -0
  288. package/dist/form/form-submit.mjs +53 -0
  289. package/dist/form/form-submit.mjs.map +1 -0
  290. package/dist/form/index.d.mts +18 -0
  291. package/dist/form/index.d.mts.map +1 -0
  292. package/dist/form/index.mjs +18 -0
  293. package/dist/form/index.mjs.map +1 -0
  294. package/dist/hover-card/hover-card-context.mjs +13 -0
  295. package/dist/hover-card/hover-card-context.mjs.map +1 -0
  296. package/dist/hover-card/hover-card-popup.d.mts +102 -0
  297. package/dist/hover-card/hover-card-popup.d.mts.map +1 -0
  298. package/dist/hover-card/hover-card-popup.mjs +80 -0
  299. package/dist/hover-card/hover-card-popup.mjs.map +1 -0
  300. package/dist/hover-card/hover-card-root.d.mts +94 -0
  301. package/dist/hover-card/hover-card-root.d.mts.map +1 -0
  302. package/dist/hover-card/hover-card-root.mjs +74 -0
  303. package/dist/hover-card/hover-card-root.mjs.map +1 -0
  304. package/dist/hover-card/hover-card-trigger.d.mts +65 -0
  305. package/dist/hover-card/hover-card-trigger.d.mts.map +1 -0
  306. package/dist/hover-card/hover-card-trigger.mjs +109 -0
  307. package/dist/hover-card/hover-card-trigger.mjs.map +1 -0
  308. package/dist/hover-card/index.d.mts +24 -0
  309. package/dist/hover-card/index.d.mts.map +1 -0
  310. package/dist/hover-card/index.mjs +24 -0
  311. package/dist/hover-card/index.mjs.map +1 -0
  312. package/dist/hover-card/use-hover-card-interest.mjs +242 -0
  313. package/dist/hover-card/use-hover-card-interest.mjs.map +1 -0
  314. package/dist/index.d.mts +100 -13
  315. package/dist/index.mjs +19 -1
  316. package/dist/internal/{action-details.mjs → action/action-details.mjs} +1 -1
  317. package/dist/internal/action/action-details.mjs.map +1 -0
  318. package/dist/internal/action/call-urgent-handler.mjs +32 -0
  319. package/dist/internal/action/call-urgent-handler.mjs.map +1 -0
  320. package/dist/internal/action/report-dropped.mjs +27 -0
  321. package/dist/internal/action/report-dropped.mjs.map +1 -0
  322. package/dist/internal/action/use-action-trigger.mjs +67 -0
  323. package/dist/internal/action/use-action-trigger.mjs.map +1 -0
  324. package/dist/internal/action/use-connected.mjs +24 -0
  325. package/dist/internal/action/use-connected.mjs.map +1 -0
  326. package/dist/internal/action/use-controllable-action.mjs +153 -0
  327. package/dist/internal/action/use-controllable-action.mjs.map +1 -0
  328. package/dist/internal/action/use-multiple-selection.mjs +83 -0
  329. package/dist/internal/action/use-multiple-selection.mjs.map +1 -0
  330. package/dist/internal/action/use-pure-trigger.mjs +34 -0
  331. package/dist/internal/action/use-pure-trigger.mjs.map +1 -0
  332. package/dist/internal/action/use-step-commit.mjs +147 -0
  333. package/dist/internal/action/use-step-commit.mjs.map +1 -0
  334. package/dist/internal/announce.mjs +20 -0
  335. package/dist/internal/announce.mjs.map +1 -0
  336. package/dist/internal/arrow-keys.mjs +21 -0
  337. package/dist/internal/arrow-keys.mjs.map +1 -0
  338. package/dist/internal/csp-context.mjs +8 -0
  339. package/dist/internal/csp-context.mjs.map +1 -0
  340. package/dist/internal/decimal.mjs +33 -0
  341. package/dist/internal/decimal.mjs.map +1 -0
  342. package/dist/internal/details-summary.mjs +56 -0
  343. package/dist/internal/details-summary.mjs.map +1 -0
  344. package/dist/internal/dev-warn.mjs +17 -0
  345. package/dist/internal/dev-warn.mjs.map +1 -0
  346. package/dist/internal/dom-order.mjs +17 -0
  347. package/dist/internal/dom-order.mjs.map +1 -0
  348. package/dist/internal/form/field-context.d.mts +19 -0
  349. package/dist/internal/form/field-context.d.mts.map +1 -0
  350. package/dist/internal/form/field-context.mjs +24 -0
  351. package/dist/internal/form/field-context.mjs.map +1 -0
  352. package/dist/internal/form/focus-first-invalid.mjs +67 -0
  353. package/dist/internal/form/focus-first-invalid.mjs.map +1 -0
  354. package/dist/internal/form/form-status-watcher.mjs +31 -0
  355. package/dist/internal/form/form-status-watcher.mjs.map +1 -0
  356. package/dist/internal/form/group-member.mjs +37 -0
  357. package/dist/internal/form/group-member.mjs.map +1 -0
  358. package/dist/internal/form/hidden-values.mjs +29 -0
  359. package/dist/internal/form/hidden-values.mjs.map +1 -0
  360. package/dist/internal/{sync-presence.mjs → form/sync-presence.mjs} +6 -2
  361. package/dist/internal/form/sync-presence.mjs.map +1 -0
  362. package/dist/internal/form/use-checkable-input.mjs +79 -0
  363. package/dist/internal/form/use-checkable-input.mjs.map +1 -0
  364. package/dist/internal/form/use-field-control.mjs +125 -0
  365. package/dist/internal/form/use-field-control.mjs.map +1 -0
  366. package/dist/internal/form/use-fieldset-group.mjs +46 -0
  367. package/dist/internal/form/use-fieldset-group.mjs.map +1 -0
  368. package/dist/internal/form/use-form-owner-event.mjs +44 -0
  369. package/dist/internal/form/use-form-owner-event.mjs.map +1 -0
  370. package/dist/internal/form/use-form-reset.mjs +39 -0
  371. package/dist/internal/form/use-form-reset.mjs.map +1 -0
  372. package/dist/internal/{use-native-checked.mjs → form/use-native-checked.mjs} +8 -9
  373. package/dist/internal/form/use-native-checked.mjs.map +1 -0
  374. package/dist/internal/{use-native-group-reconciliation.mjs → form/use-native-group-reconciliation.mjs} +15 -12
  375. package/dist/internal/form/use-native-group-reconciliation.mjs.map +1 -0
  376. package/dist/internal/{use-native-select-value.mjs → form/use-native-select-value.mjs} +8 -6
  377. package/dist/internal/form/use-native-select-value.mjs.map +1 -0
  378. package/dist/internal/form/validity.d.mts +35 -0
  379. package/dist/internal/form/validity.d.mts.map +1 -0
  380. package/dist/internal/form/validity.mjs +98 -0
  381. package/dist/internal/form/validity.mjs.map +1 -0
  382. package/dist/internal/overlay/anchor-position.d.mts +15 -0
  383. package/dist/internal/overlay/anchor-position.d.mts.map +1 -0
  384. package/dist/internal/overlay/anchor-position.mjs +132 -0
  385. package/dist/internal/overlay/anchor-position.mjs.map +1 -0
  386. package/dist/internal/overlay/content-focus-probe.mjs +42 -0
  387. package/dist/internal/overlay/content-focus-probe.mjs.map +1 -0
  388. package/dist/internal/overlay/css-transition-cut.mjs +66 -0
  389. package/dist/internal/overlay/css-transition-cut.mjs.map +1 -0
  390. package/dist/internal/overlay/focus-visible.mjs +26 -0
  391. package/dist/internal/overlay/focus-visible.mjs.map +1 -0
  392. package/dist/internal/overlay/invokers.mjs +63 -0
  393. package/dist/internal/overlay/invokers.mjs.map +1 -0
  394. package/dist/internal/overlay/modal-registry.mjs +39 -0
  395. package/dist/internal/overlay/modal-registry.mjs.map +1 -0
  396. package/dist/internal/overlay/overlay-popup.mjs +103 -0
  397. package/dist/internal/overlay/overlay-popup.mjs.map +1 -0
  398. package/dist/internal/overlay/overlay-show.mjs +73 -0
  399. package/dist/internal/overlay/overlay-show.mjs.map +1 -0
  400. package/dist/internal/overlay/popover-open.mjs +18 -0
  401. package/dist/internal/overlay/popover-open.mjs.map +1 -0
  402. package/dist/internal/overlay/trigger-ref.mjs +26 -0
  403. package/dist/internal/overlay/trigger-ref.mjs.map +1 -0
  404. package/dist/internal/overlay/use-apply-open-state.mjs +44 -0
  405. package/dist/internal/overlay/use-apply-open-state.mjs.map +1 -0
  406. package/dist/internal/{use-exit-animation.mjs → overlay/use-exit-animation.mjs} +28 -8
  407. package/dist/internal/overlay/use-exit-animation.mjs.map +1 -0
  408. package/dist/internal/overlay/use-interest-dismiss.mjs +85 -0
  409. package/dist/internal/overlay/use-interest-dismiss.mjs.map +1 -0
  410. package/dist/internal/overlay/use-modal-registration.mjs +47 -0
  411. package/dist/internal/overlay/use-modal-registration.mjs.map +1 -0
  412. package/dist/internal/overlay/use-overlay-close.mjs +72 -0
  413. package/dist/internal/overlay/use-overlay-close.mjs.map +1 -0
  414. package/dist/internal/overlay/use-overlay-root.d.mts +2 -0
  415. package/dist/internal/overlay/use-overlay-root.mjs +193 -0
  416. package/dist/internal/overlay/use-overlay-root.mjs.map +1 -0
  417. package/dist/internal/overlay/use-popover-popup.mjs +287 -0
  418. package/dist/internal/overlay/use-popover-popup.mjs.map +1 -0
  419. package/dist/internal/overlay/use-popover-trigger.d.mts +16 -0
  420. package/dist/internal/overlay/use-popover-trigger.d.mts.map +1 -0
  421. package/dist/internal/overlay/use-popover-trigger.mjs +142 -0
  422. package/dist/internal/overlay/use-popover-trigger.mjs.map +1 -0
  423. package/dist/internal/overlay/use-resolved-placement.mjs +162 -0
  424. package/dist/internal/overlay/use-resolved-placement.mjs.map +1 -0
  425. package/dist/internal/platform-attributes.d.mts +2 -1
  426. package/dist/internal/platform-attributes.d.mts.map +1 -1
  427. package/dist/internal/pointer-capture.mjs +20 -0
  428. package/dist/internal/pointer-capture.mjs.map +1 -0
  429. package/dist/internal/range-value.mjs +51 -0
  430. package/dist/internal/range-value.mjs.map +1 -0
  431. package/dist/internal/render-element.d.mts +2 -0
  432. package/dist/internal/render-element.mjs +123 -0
  433. package/dist/internal/render-element.mjs.map +1 -0
  434. package/dist/internal/shipped-styles.mjs +14 -0
  435. package/dist/internal/shipped-styles.mjs.map +1 -0
  436. package/dist/internal/toolbar-context.mjs +17 -0
  437. package/dist/internal/toolbar-context.mjs.map +1 -0
  438. package/dist/internal/transition-boundary.mjs +5 -9
  439. package/dist/internal/transition-boundary.mjs.map +1 -1
  440. package/dist/internal/typeahead.mjs +52 -0
  441. package/dist/internal/typeahead.mjs.map +1 -0
  442. package/dist/internal/types.d.mts +42 -9
  443. package/dist/internal/types.d.mts.map +1 -1
  444. package/dist/internal/use-active-option.mjs +51 -0
  445. package/dist/internal/use-active-option.mjs.map +1 -0
  446. package/dist/internal/use-deferred-leave.mjs +113 -0
  447. package/dist/internal/use-deferred-leave.mjs.map +1 -0
  448. package/dist/internal/use-dev-warning.mjs +8 -4
  449. package/dist/internal/use-dev-warning.mjs.map +1 -1
  450. package/dist/internal/use-element-check.mjs +39 -0
  451. package/dist/internal/use-element-check.mjs.map +1 -0
  452. package/dist/internal/use-item-order.mjs +42 -0
  453. package/dist/internal/use-item-order.mjs.map +1 -0
  454. package/dist/internal/use-latest.mjs +28 -0
  455. package/dist/internal/use-latest.mjs.map +1 -0
  456. package/dist/internal/use-merged-refs.mjs +19 -0
  457. package/dist/internal/use-merged-refs.mjs.map +1 -0
  458. package/dist/internal/use-mount-fixed.mjs +22 -0
  459. package/dist/internal/use-mount-fixed.mjs.map +1 -0
  460. package/dist/internal/use-name-warning.mjs +140 -0
  461. package/dist/internal/use-name-warning.mjs.map +1 -0
  462. package/dist/internal/use-native-focusgroup.mjs +19 -0
  463. package/dist/internal/use-native-focusgroup.mjs.map +1 -0
  464. package/dist/internal/use-option-registry.mjs +70 -0
  465. package/dist/internal/use-option-registry.mjs.map +1 -0
  466. package/dist/internal/use-register-count.mjs +27 -0
  467. package/dist/internal/use-register-count.mjs.map +1 -0
  468. package/dist/internal/use-render.d.mts +2 -0
  469. package/dist/internal/use-render.mjs +12 -35
  470. package/dist/internal/use-render.mjs.map +1 -1
  471. package/dist/internal/use-roving-focus.mjs +288 -0
  472. package/dist/internal/use-roving-focus.mjs.map +1 -0
  473. package/dist/internal/use-value-set.mjs +20 -0
  474. package/dist/internal/use-value-set.mjs.map +1 -0
  475. package/dist/internal/value-set.mjs +41 -0
  476. package/dist/internal/value-set.mjs.map +1 -0
  477. package/dist/menu/index.d.mts +8 -2
  478. package/dist/menu/index.d.mts.map +1 -1
  479. package/dist/menu/index.mjs +7 -1
  480. package/dist/menu/index.mjs.map +1 -1
  481. package/dist/menu/menu-checkbox-item.d.mts +27 -3
  482. package/dist/menu/menu-checkbox-item.d.mts.map +1 -1
  483. package/dist/menu/menu-checkbox-item.mjs +6 -3
  484. package/dist/menu/menu-checkbox-item.mjs.map +1 -1
  485. package/dist/menu/menu-context-trigger.d.mts +63 -0
  486. package/dist/menu/menu-context-trigger.d.mts.map +1 -0
  487. package/dist/menu/menu-context-trigger.mjs +231 -0
  488. package/dist/menu/menu-context-trigger.mjs.map +1 -0
  489. package/dist/menu/menu-context.d.mts +1 -1
  490. package/dist/menu/menu-context.mjs +44 -1
  491. package/dist/menu/menu-context.mjs.map +1 -1
  492. package/dist/menu/menu-dom.mjs +35 -4
  493. package/dist/menu/menu-dom.mjs.map +1 -1
  494. package/dist/menu/menu-gestures.mjs +166 -0
  495. package/dist/menu/menu-gestures.mjs.map +1 -0
  496. package/dist/menu/menu-group.d.mts +36 -1
  497. package/dist/menu/menu-group.d.mts.map +1 -1
  498. package/dist/menu/menu-group.mjs +15 -5
  499. package/dist/menu/menu-group.mjs.map +1 -1
  500. package/dist/menu/menu-hover.mjs +0 -1
  501. package/dist/menu/menu-hover.mjs.map +1 -1
  502. package/dist/menu/menu-item.d.mts +42 -5
  503. package/dist/menu/menu-item.d.mts.map +1 -1
  504. package/dist/menu/menu-item.mjs +18 -9
  505. package/dist/menu/menu-item.mjs.map +1 -1
  506. package/dist/menu/menu-outside.mjs +101 -0
  507. package/dist/menu/menu-outside.mjs.map +1 -0
  508. package/dist/menu/menu-point.mjs +85 -0
  509. package/dist/menu/menu-point.mjs.map +1 -0
  510. package/dist/menu/menu-popup.d.mts +68 -11
  511. package/dist/menu/menu-popup.d.mts.map +1 -1
  512. package/dist/menu/menu-popup.mjs +106 -116
  513. package/dist/menu/menu-popup.mjs.map +1 -1
  514. package/dist/menu/menu-radio-group.d.mts +20 -1
  515. package/dist/menu/menu-radio-group.d.mts.map +1 -1
  516. package/dist/menu/menu-radio-group.mjs +14 -7
  517. package/dist/menu/menu-radio-group.mjs.map +1 -1
  518. package/dist/menu/menu-radio-item.d.mts +18 -0
  519. package/dist/menu/menu-radio-item.d.mts.map +1 -1
  520. package/dist/menu/menu-radio-item.mjs +5 -1
  521. package/dist/menu/menu-radio-item.mjs.map +1 -1
  522. package/dist/menu/menu-root.d.mts +61 -12
  523. package/dist/menu/menu-root.d.mts.map +1 -1
  524. package/dist/menu/menu-root.mjs +72 -17
  525. package/dist/menu/menu-root.mjs.map +1 -1
  526. package/dist/menu/menu-submenu-trigger.d.mts +24 -9
  527. package/dist/menu/menu-submenu-trigger.d.mts.map +1 -1
  528. package/dist/menu/menu-submenu-trigger.mjs +48 -26
  529. package/dist/menu/menu-submenu-trigger.mjs.map +1 -1
  530. package/dist/menu/menu-trigger.d.mts +37 -16
  531. package/dist/menu/menu-trigger.d.mts.map +1 -1
  532. package/dist/menu/menu-trigger.mjs +39 -23
  533. package/dist/menu/menu-trigger.mjs.map +1 -1
  534. package/dist/menu/use-menu-item.mjs +14 -16
  535. package/dist/menu/use-menu-item.mjs.map +1 -1
  536. package/dist/menu/use-menu-keyboard.mjs +68 -0
  537. package/dist/menu/use-menu-keyboard.mjs.map +1 -0
  538. package/dist/meter/index.d.mts +26 -0
  539. package/dist/meter/index.d.mts.map +1 -0
  540. package/dist/meter/index.mjs +25 -0
  541. package/dist/meter/index.mjs.map +1 -0
  542. package/dist/meter/meter-context.mjs +13 -0
  543. package/dist/meter/meter-context.mjs.map +1 -0
  544. package/dist/meter/meter-indicator.d.mts +30 -0
  545. package/dist/meter/meter-indicator.d.mts.map +1 -0
  546. package/dist/meter/meter-indicator.mjs +27 -0
  547. package/dist/meter/meter-indicator.mjs.map +1 -0
  548. package/dist/meter/meter-label.d.mts +30 -0
  549. package/dist/meter/meter-label.d.mts.map +1 -0
  550. package/dist/meter/meter-label.mjs +30 -0
  551. package/dist/meter/meter-label.mjs.map +1 -0
  552. package/dist/meter/meter-region.d.mts +9 -0
  553. package/dist/meter/meter-region.d.mts.map +1 -0
  554. package/dist/meter/meter-region.mjs +39 -0
  555. package/dist/meter/meter-region.mjs.map +1 -0
  556. package/dist/meter/meter-root.d.mts +113 -0
  557. package/dist/meter/meter-root.d.mts.map +1 -0
  558. package/dist/meter/meter-root.mjs +85 -0
  559. package/dist/meter/meter-root.mjs.map +1 -0
  560. package/dist/meter/meter-track.d.mts +30 -0
  561. package/dist/meter/meter-track.d.mts.map +1 -0
  562. package/dist/meter/meter-track.mjs +27 -0
  563. package/dist/meter/meter-track.mjs.map +1 -0
  564. package/dist/meter/meter-value.d.mts +34 -0
  565. package/dist/meter/meter-value.d.mts.map +1 -0
  566. package/dist/meter/meter-value.mjs +31 -0
  567. package/dist/meter/meter-value.mjs.map +1 -0
  568. package/dist/multi-select/index.d.mts +37 -0
  569. package/dist/multi-select/index.d.mts.map +1 -0
  570. package/dist/multi-select/index.mjs +37 -0
  571. package/dist/multi-select/index.mjs.map +1 -0
  572. package/dist/multi-select/multi-select-context.mjs +19 -0
  573. package/dist/multi-select/multi-select-context.mjs.map +1 -0
  574. package/dist/multi-select/multi-select-group.d.mts +120 -0
  575. package/dist/multi-select/multi-select-group.d.mts.map +1 -0
  576. package/dist/multi-select/multi-select-group.mjs +111 -0
  577. package/dist/multi-select/multi-select-group.mjs.map +1 -0
  578. package/dist/multi-select/multi-select-keyboard.mjs +145 -0
  579. package/dist/multi-select/multi-select-keyboard.mjs.map +1 -0
  580. package/dist/multi-select/multi-select-label.d.mts +42 -0
  581. package/dist/multi-select/multi-select-label.d.mts.map +1 -0
  582. package/dist/multi-select/multi-select-label.mjs +41 -0
  583. package/dist/multi-select/multi-select-label.mjs.map +1 -0
  584. package/dist/multi-select/multi-select-list.d.mts +47 -0
  585. package/dist/multi-select/multi-select-list.d.mts.map +1 -0
  586. package/dist/multi-select/multi-select-list.mjs +65 -0
  587. package/dist/multi-select/multi-select-list.mjs.map +1 -0
  588. package/dist/multi-select/multi-select-option.d.mts +68 -0
  589. package/dist/multi-select/multi-select-option.d.mts.map +1 -0
  590. package/dist/multi-select/multi-select-option.mjs +93 -0
  591. package/dist/multi-select/multi-select-option.mjs.map +1 -0
  592. package/dist/multi-select/multi-select-popup.d.mts +58 -0
  593. package/dist/multi-select/multi-select-popup.d.mts.map +1 -0
  594. package/dist/multi-select/multi-select-popup.mjs +71 -0
  595. package/dist/multi-select/multi-select-popup.mjs.map +1 -0
  596. package/dist/multi-select/multi-select-root.d.mts +125 -0
  597. package/dist/multi-select/multi-select-root.d.mts.map +1 -0
  598. package/dist/multi-select/multi-select-root.mjs +257 -0
  599. package/dist/multi-select/multi-select-root.mjs.map +1 -0
  600. package/dist/multi-select/multi-select-trigger.d.mts +66 -0
  601. package/dist/multi-select/multi-select-trigger.d.mts.map +1 -0
  602. package/dist/multi-select/multi-select-trigger.mjs +169 -0
  603. package/dist/multi-select/multi-select-trigger.mjs.map +1 -0
  604. package/dist/multi-select/multi-select-value.d.mts +57 -0
  605. package/dist/multi-select/multi-select-value.d.mts.map +1 -0
  606. package/dist/multi-select/multi-select-value.mjs +41 -0
  607. package/dist/multi-select/multi-select-value.mjs.map +1 -0
  608. package/dist/number-field/index.d.mts +29 -0
  609. package/dist/number-field/index.d.mts.map +1 -0
  610. package/dist/number-field/index.mjs +28 -0
  611. package/dist/number-field/index.mjs.map +1 -0
  612. package/dist/number-field/number-field-arithmetic.mjs +97 -0
  613. package/dist/number-field/number-field-arithmetic.mjs.map +1 -0
  614. package/dist/number-field/number-field-context.d.mts +7 -0
  615. package/dist/number-field/number-field-context.d.mts.map +1 -0
  616. package/dist/number-field/number-field-context.mjs +13 -0
  617. package/dist/number-field/number-field-context.mjs.map +1 -0
  618. package/dist/number-field/number-field-decrement.d.mts +19 -0
  619. package/dist/number-field/number-field-decrement.d.mts.map +1 -0
  620. package/dist/number-field/number-field-decrement.mjs +22 -0
  621. package/dist/number-field/number-field-decrement.mjs.map +1 -0
  622. package/dist/number-field/number-field-format.mjs +279 -0
  623. package/dist/number-field/number-field-format.mjs.map +1 -0
  624. package/dist/number-field/number-field-increment.d.mts +19 -0
  625. package/dist/number-field/number-field-increment.d.mts.map +1 -0
  626. package/dist/number-field/number-field-increment.mjs +22 -0
  627. package/dist/number-field/number-field-increment.mjs.map +1 -0
  628. package/dist/number-field/number-field-input.d.mts +38 -0
  629. package/dist/number-field/number-field-input.d.mts.map +1 -0
  630. package/dist/number-field/number-field-input.mjs +161 -0
  631. package/dist/number-field/number-field-input.mjs.map +1 -0
  632. package/dist/number-field/number-field-label.d.mts +33 -0
  633. package/dist/number-field/number-field-label.d.mts.map +1 -0
  634. package/dist/number-field/number-field-label.mjs +43 -0
  635. package/dist/number-field/number-field-label.mjs.map +1 -0
  636. package/dist/number-field/number-field-root.d.mts +157 -0
  637. package/dist/number-field/number-field-root.d.mts.map +1 -0
  638. package/dist/number-field/number-field-root.mjs +445 -0
  639. package/dist/number-field/number-field-root.mjs.map +1 -0
  640. package/dist/number-field/use-number-field-dev-warnings.mjs +28 -0
  641. package/dist/number-field/use-number-field-dev-warnings.mjs.map +1 -0
  642. package/dist/number-field/use-step-button.d.mts +44 -0
  643. package/dist/number-field/use-step-button.d.mts.map +1 -0
  644. package/dist/number-field/use-step-button.mjs +175 -0
  645. package/dist/number-field/use-step-button.mjs.map +1 -0
  646. package/dist/popover/index.d.mts +6 -4
  647. package/dist/popover/index.d.mts.map +1 -1
  648. package/dist/popover/index.mjs +6 -4
  649. package/dist/popover/index.mjs.map +1 -1
  650. package/dist/popover/popover-close.d.mts +48 -8
  651. package/dist/popover/popover-close.d.mts.map +1 -1
  652. package/dist/popover/popover-close.mjs +41 -67
  653. package/dist/popover/popover-close.mjs.map +1 -1
  654. package/dist/popover/popover-context.mjs.map +1 -1
  655. package/dist/popover/popover-description.d.mts +12 -0
  656. package/dist/popover/popover-description.d.mts.map +1 -1
  657. package/dist/popover/popover-description.mjs +2 -0
  658. package/dist/popover/popover-description.mjs.map +1 -1
  659. package/dist/popover/popover-popup.d.mts +64 -18
  660. package/dist/popover/popover-popup.d.mts.map +1 -1
  661. package/dist/popover/popover-popup.mjs +31 -36
  662. package/dist/popover/popover-popup.mjs.map +1 -1
  663. package/dist/popover/popover-root.d.mts +40 -18
  664. package/dist/popover/popover-root.d.mts.map +1 -1
  665. package/dist/popover/popover-root.mjs +15 -10
  666. package/dist/popover/popover-root.mjs.map +1 -1
  667. package/dist/popover/popover-title.d.mts +11 -0
  668. package/dist/popover/popover-title.d.mts.map +1 -1
  669. package/dist/popover/popover-title.mjs +2 -0
  670. package/dist/popover/popover-title.mjs.map +1 -1
  671. package/dist/popover/popover-trigger.d.mts +38 -18
  672. package/dist/popover/popover-trigger.d.mts.map +1 -1
  673. package/dist/popover/popover-trigger.mjs +14 -9
  674. package/dist/popover/popover-trigger.mjs.map +1 -1
  675. package/dist/progress/index.d.mts +26 -0
  676. package/dist/progress/index.d.mts.map +1 -0
  677. package/dist/progress/index.mjs +26 -0
  678. package/dist/progress/index.mjs.map +1 -0
  679. package/dist/progress/progress-context.mjs +13 -0
  680. package/dist/progress/progress-context.mjs.map +1 -0
  681. package/dist/progress/progress-indicator.d.mts +30 -0
  682. package/dist/progress/progress-indicator.d.mts.map +1 -0
  683. package/dist/progress/progress-indicator.mjs +31 -0
  684. package/dist/progress/progress-indicator.mjs.map +1 -0
  685. package/dist/progress/progress-label.d.mts +30 -0
  686. package/dist/progress/progress-label.d.mts.map +1 -0
  687. package/dist/progress/progress-label.mjs +32 -0
  688. package/dist/progress/progress-label.mjs.map +1 -0
  689. package/dist/progress/progress-root.d.mts +96 -0
  690. package/dist/progress/progress-root.d.mts.map +1 -0
  691. package/dist/progress/progress-root.mjs +82 -0
  692. package/dist/progress/progress-root.mjs.map +1 -0
  693. package/dist/progress/progress-track.d.mts +30 -0
  694. package/dist/progress/progress-track.d.mts.map +1 -0
  695. package/dist/progress/progress-track.mjs +31 -0
  696. package/dist/progress/progress-track.mjs.map +1 -0
  697. package/dist/progress/progress-value.d.mts +34 -0
  698. package/dist/progress/progress-value.d.mts.map +1 -0
  699. package/dist/progress/progress-value.mjs +35 -0
  700. package/dist/progress/progress-value.mjs.map +1 -0
  701. package/dist/radio-group/index.d.mts +2 -0
  702. package/dist/radio-group/index.d.mts.map +1 -1
  703. package/dist/radio-group/index.mjs +2 -0
  704. package/dist/radio-group/index.mjs.map +1 -1
  705. package/dist/radio-group/radio-group-context.mjs.map +1 -1
  706. package/dist/radio-group/radio-group-item.d.mts +21 -5
  707. package/dist/radio-group/radio-group-item.d.mts.map +1 -1
  708. package/dist/radio-group/radio-group-item.mjs +22 -25
  709. package/dist/radio-group/radio-group-item.mjs.map +1 -1
  710. package/dist/radio-group/radio-group-label.d.mts +10 -0
  711. package/dist/radio-group/radio-group-label.d.mts.map +1 -1
  712. package/dist/radio-group/radio-group-label.mjs +3 -6
  713. package/dist/radio-group/radio-group-label.mjs.map +1 -1
  714. package/dist/radio-group/radio-group-root.d.mts +34 -8
  715. package/dist/radio-group/radio-group-root.d.mts.map +1 -1
  716. package/dist/radio-group/radio-group-root.mjs +48 -39
  717. package/dist/radio-group/radio-group-root.mjs.map +1 -1
  718. package/dist/select/index.d.mts +2 -0
  719. package/dist/select/index.d.mts.map +1 -1
  720. package/dist/select/index.mjs +2 -0
  721. package/dist/select/index.mjs.map +1 -1
  722. package/dist/select/select-dom.mjs +9 -18
  723. package/dist/select/select-dom.mjs.map +1 -1
  724. package/dist/select/select-group-label.d.mts +10 -0
  725. package/dist/select/select-group-label.d.mts.map +1 -1
  726. package/dist/select/select-group-label.mjs +5 -1
  727. package/dist/select/select-group-label.mjs.map +1 -1
  728. package/dist/select/select-group.d.mts +15 -1
  729. package/dist/select/select-group.d.mts.map +1 -1
  730. package/dist/select/select-group.mjs +8 -4
  731. package/dist/select/select-group.mjs.map +1 -1
  732. package/dist/select/select-option.d.mts +19 -1
  733. package/dist/select/select-option.d.mts.map +1 -1
  734. package/dist/select/select-option.mjs +4 -2
  735. package/dist/select/select-option.mjs.map +1 -1
  736. package/dist/select/select-root.d.mts +28 -3
  737. package/dist/select/select-root.d.mts.map +1 -1
  738. package/dist/select/select-root.mjs +39 -12
  739. package/dist/select/select-root.mjs.map +1 -1
  740. package/dist/select/select-separator.d.mts +9 -0
  741. package/dist/select/select-separator.d.mts.map +1 -1
  742. package/dist/select/select-separator.mjs +2 -0
  743. package/dist/select/select-separator.mjs.map +1 -1
  744. package/dist/select/select-trigger.d.mts +9 -0
  745. package/dist/select/select-trigger.d.mts.map +1 -1
  746. package/dist/select/select-trigger.mjs +5 -1
  747. package/dist/select/select-trigger.mjs.map +1 -1
  748. package/dist/select/select-value.d.mts +9 -0
  749. package/dist/select/select-value.d.mts.map +1 -1
  750. package/dist/select/select-value.mjs +5 -6
  751. package/dist/select/select-value.mjs.map +1 -1
  752. package/dist/separator/index.d.mts +3 -0
  753. package/dist/separator/index.mjs +1 -0
  754. package/dist/separator/separator.d.mts +58 -0
  755. package/dist/separator/separator.d.mts.map +1 -0
  756. package/dist/separator/separator.mjs +41 -0
  757. package/dist/separator/separator.mjs.map +1 -0
  758. package/dist/slider/index.d.mts +34 -0
  759. package/dist/slider/index.d.mts.map +1 -0
  760. package/dist/slider/index.mjs +29 -0
  761. package/dist/slider/index.mjs.map +1 -0
  762. package/dist/slider/slider-arithmetic.mjs +165 -0
  763. package/dist/slider/slider-arithmetic.mjs.map +1 -0
  764. package/dist/slider/slider-context.mjs +13 -0
  765. package/dist/slider/slider-context.mjs.map +1 -0
  766. package/dist/slider/slider-indicator.d.mts +34 -0
  767. package/dist/slider/slider-indicator.d.mts.map +1 -0
  768. package/dist/slider/slider-indicator.mjs +38 -0
  769. package/dist/slider/slider-indicator.mjs.map +1 -0
  770. package/dist/slider/slider-label.d.mts +33 -0
  771. package/dist/slider/slider-label.d.mts.map +1 -0
  772. package/dist/slider/slider-label.mjs +40 -0
  773. package/dist/slider/slider-label.mjs.map +1 -0
  774. package/dist/slider/slider-root.d.mts +155 -0
  775. package/dist/slider/slider-root.d.mts.map +1 -0
  776. package/dist/slider/slider-root.mjs +434 -0
  777. package/dist/slider/slider-root.mjs.map +1 -0
  778. package/dist/slider/slider-thumb.d.mts +87 -0
  779. package/dist/slider/slider-thumb.d.mts.map +1 -0
  780. package/dist/slider/slider-thumb.mjs +150 -0
  781. package/dist/slider/slider-thumb.mjs.map +1 -0
  782. package/dist/slider/slider-track.d.mts +46 -0
  783. package/dist/slider/slider-track.d.mts.map +1 -0
  784. package/dist/slider/slider-track.mjs +57 -0
  785. package/dist/slider/slider-track.mjs.map +1 -0
  786. package/dist/slider/slider-value.d.mts +45 -0
  787. package/dist/slider/slider-value.d.mts.map +1 -0
  788. package/dist/slider/slider-value.mjs +41 -0
  789. package/dist/slider/slider-value.mjs.map +1 -0
  790. package/dist/slider/use-slider-dev-warnings.mjs +29 -0
  791. package/dist/slider/use-slider-dev-warnings.mjs.map +1 -0
  792. package/dist/slider/use-thumb-registry.mjs +51 -0
  793. package/dist/slider/use-thumb-registry.mjs.map +1 -0
  794. package/dist/switch/switch.d.mts +30 -9
  795. package/dist/switch/switch.d.mts.map +1 -1
  796. package/dist/switch/switch.mjs +24 -46
  797. package/dist/switch/switch.mjs.map +1 -1
  798. package/dist/tabs/index.d.mts +2 -0
  799. package/dist/tabs/index.d.mts.map +1 -1
  800. package/dist/tabs/index.mjs +2 -0
  801. package/dist/tabs/index.mjs.map +1 -1
  802. package/dist/tabs/tabs-context.d.mts +7 -3
  803. package/dist/tabs/tabs-context.d.mts.map +1 -1
  804. package/dist/tabs/tabs-context.mjs.map +1 -1
  805. package/dist/tabs/tabs-indicator.d.mts +17 -0
  806. package/dist/tabs/tabs-indicator.d.mts.map +1 -1
  807. package/dist/tabs/tabs-indicator.mjs +4 -1
  808. package/dist/tabs/tabs-indicator.mjs.map +1 -1
  809. package/dist/tabs/tabs-list.d.mts +19 -1
  810. package/dist/tabs/tabs-list.d.mts.map +1 -1
  811. package/dist/tabs/tabs-list.mjs +12 -23
  812. package/dist/tabs/tabs-list.mjs.map +1 -1
  813. package/dist/tabs/tabs-panel.d.mts +22 -4
  814. package/dist/tabs/tabs-panel.d.mts.map +1 -1
  815. package/dist/tabs/tabs-panel.mjs +4 -2
  816. package/dist/tabs/tabs-panel.mjs.map +1 -1
  817. package/dist/tabs/tabs-root.d.mts +43 -8
  818. package/dist/tabs/tabs-root.d.mts.map +1 -1
  819. package/dist/tabs/tabs-root.mjs +23 -10
  820. package/dist/tabs/tabs-root.mjs.map +1 -1
  821. package/dist/tabs/tabs-tab.d.mts +25 -5
  822. package/dist/tabs/tabs-tab.d.mts.map +1 -1
  823. package/dist/tabs/tabs-tab.mjs +5 -2
  824. package/dist/tabs/tabs-tab.mjs.map +1 -1
  825. package/dist/{internal → tabs}/use-until-found.mjs +1 -1
  826. package/dist/tabs/use-until-found.mjs.map +1 -0
  827. package/dist/toast/index.d.mts +27 -0
  828. package/dist/toast/index.d.mts.map +1 -0
  829. package/dist/toast/index.mjs +28 -0
  830. package/dist/toast/index.mjs.map +1 -0
  831. package/dist/toast/toast-action.d.mts +86 -0
  832. package/dist/toast/toast-action.d.mts.map +1 -0
  833. package/dist/toast/toast-action.mjs +81 -0
  834. package/dist/toast/toast-action.mjs.map +1 -0
  835. package/dist/toast/toast-close.d.mts +52 -0
  836. package/dist/toast/toast-close.d.mts.map +1 -0
  837. package/dist/toast/toast-close.mjs +53 -0
  838. package/dist/toast/toast-close.mjs.map +1 -0
  839. package/dist/toast/toast-context.mjs +19 -0
  840. package/dist/toast/toast-context.mjs.map +1 -0
  841. package/dist/toast/toast-description.d.mts +39 -0
  842. package/dist/toast/toast-description.d.mts.map +1 -0
  843. package/dist/toast/toast-description.mjs +37 -0
  844. package/dist/toast/toast-description.mjs.map +1 -0
  845. package/dist/toast/toast-hotkey.mjs +27 -0
  846. package/dist/toast/toast-hotkey.mjs.map +1 -0
  847. package/dist/toast/toast-queue.mjs +137 -0
  848. package/dist/toast/toast-queue.mjs.map +1 -0
  849. package/dist/toast/toast-root.d.mts +63 -0
  850. package/dist/toast/toast-root.d.mts.map +1 -0
  851. package/dist/toast/toast-root.mjs +209 -0
  852. package/dist/toast/toast-root.mjs.map +1 -0
  853. package/dist/toast/toast-timers.mjs +65 -0
  854. package/dist/toast/toast-timers.mjs.map +1 -0
  855. package/dist/toast/toast-title.d.mts +38 -0
  856. package/dist/toast/toast-title.d.mts.map +1 -0
  857. package/dist/toast/toast-title.mjs +35 -0
  858. package/dist/toast/toast-title.mjs.map +1 -0
  859. package/dist/toast/toast-viewport.d.mts +81 -0
  860. package/dist/toast/toast-viewport.d.mts.map +1 -0
  861. package/dist/toast/toast-viewport.mjs +345 -0
  862. package/dist/toast/toast-viewport.mjs.map +1 -0
  863. package/dist/toast/toast.d.mts +162 -0
  864. package/dist/toast/toast.d.mts.map +1 -0
  865. package/dist/toast/toast.mjs +161 -0
  866. package/dist/toast/toast.mjs.map +1 -0
  867. package/dist/toast/use-modal-portal-host.mjs +52 -0
  868. package/dist/toast/use-modal-portal-host.mjs.map +1 -0
  869. package/dist/toast/use-toast-announcements.mjs +46 -0
  870. package/dist/toast/use-toast-announcements.mjs.map +1 -0
  871. package/dist/toast/use-toast-focus.mjs +75 -0
  872. package/dist/toast/use-toast-focus.mjs.map +1 -0
  873. package/dist/toast/use-toast-pauses.mjs +58 -0
  874. package/dist/toast/use-toast-pauses.mjs.map +1 -0
  875. package/dist/toggle/toggle.d.mts +26 -6
  876. package/dist/toggle/toggle.d.mts.map +1 -1
  877. package/dist/toggle/toggle.mjs +12 -6
  878. package/dist/toggle/toggle.mjs.map +1 -1
  879. package/dist/toggle-group/index.d.mts +18 -0
  880. package/dist/toggle-group/index.d.mts.map +1 -0
  881. package/dist/toggle-group/index.mjs +17 -0
  882. package/dist/toggle-group/index.mjs.map +1 -0
  883. package/dist/toggle-group/toggle-group-context.d.mts +6 -0
  884. package/dist/toggle-group/toggle-group-context.d.mts.map +1 -0
  885. package/dist/toggle-group/toggle-group-context.mjs +13 -0
  886. package/dist/toggle-group/toggle-group-context.mjs.map +1 -0
  887. package/dist/toggle-group/toggle-group-item.d.mts +71 -0
  888. package/dist/toggle-group/toggle-group-item.d.mts.map +1 -0
  889. package/dist/toggle-group/toggle-group-item.mjs +69 -0
  890. package/dist/toggle-group/toggle-group-item.mjs.map +1 -0
  891. package/dist/toggle-group/toggle-group-root.d.mts +156 -0
  892. package/dist/toggle-group/toggle-group-root.d.mts.map +1 -0
  893. package/dist/toggle-group/toggle-group-root.mjs +177 -0
  894. package/dist/toggle-group/toggle-group-root.mjs.map +1 -0
  895. package/dist/toolbar/index.d.mts +19 -0
  896. package/dist/toolbar/index.d.mts.map +1 -0
  897. package/dist/toolbar/index.mjs +19 -0
  898. package/dist/toolbar/index.mjs.map +1 -0
  899. package/dist/toolbar/toolbar-root.d.mts +65 -0
  900. package/dist/toolbar/toolbar-root.d.mts.map +1 -0
  901. package/dist/toolbar/toolbar-root.mjs +67 -0
  902. package/dist/toolbar/toolbar-root.mjs.map +1 -0
  903. package/dist/toolbar/toolbar-separator.d.mts +38 -0
  904. package/dist/toolbar/toolbar-separator.d.mts.map +1 -0
  905. package/dist/toolbar/toolbar-separator.mjs +33 -0
  906. package/dist/toolbar/toolbar-separator.mjs.map +1 -0
  907. package/dist/tooltip/index.d.mts +10 -5
  908. package/dist/tooltip/index.d.mts.map +1 -1
  909. package/dist/tooltip/index.mjs +8 -3
  910. package/dist/tooltip/index.mjs.map +1 -1
  911. package/dist/tooltip/tooltip-arrow.d.mts +46 -0
  912. package/dist/tooltip/tooltip-arrow.d.mts.map +1 -0
  913. package/dist/tooltip/tooltip-arrow.mjs +47 -0
  914. package/dist/tooltip/tooltip-arrow.mjs.map +1 -0
  915. package/dist/tooltip/tooltip-context.d.mts +11 -0
  916. package/dist/tooltip/tooltip-context.d.mts.map +1 -1
  917. package/dist/tooltip/tooltip-context.mjs +2 -1
  918. package/dist/tooltip/tooltip-context.mjs.map +1 -1
  919. package/dist/tooltip/tooltip-popup.d.mts +49 -7
  920. package/dist/tooltip/tooltip-popup.d.mts.map +1 -1
  921. package/dist/tooltip/tooltip-popup.mjs +37 -15
  922. package/dist/tooltip/tooltip-popup.mjs.map +1 -1
  923. package/dist/tooltip/tooltip-root.d.mts +24 -2
  924. package/dist/tooltip/tooltip-root.d.mts.map +1 -1
  925. package/dist/tooltip/tooltip-root.mjs +29 -6
  926. package/dist/tooltip/tooltip-root.mjs.map +1 -1
  927. package/dist/tooltip/tooltip-trigger.d.mts +28 -3
  928. package/dist/tooltip/tooltip-trigger.d.mts.map +1 -1
  929. package/dist/tooltip/tooltip-trigger.mjs +26 -6
  930. package/dist/tooltip/tooltip-trigger.mjs.map +1 -1
  931. package/dist/tooltip/tooltip-warm.mjs +29 -0
  932. package/dist/tooltip/tooltip-warm.mjs.map +1 -0
  933. package/dist/tooltip/use-tooltip-interaction.mjs +128 -77
  934. package/dist/tooltip/use-tooltip-interaction.mjs.map +1 -1
  935. package/package.json +27 -2
  936. package/skills/funstack-ui-knowledge/SKILL.md +80 -0
  937. package/dist/accordion/accordion-context.d.mts +0 -5
  938. package/dist/accordion/accordion-context.d.mts.map +0 -1
  939. package/dist/internal/action-details.mjs.map +0 -1
  940. package/dist/internal/anchor-position.d.mts +0 -7
  941. package/dist/internal/anchor-position.d.mts.map +0 -1
  942. package/dist/internal/anchor-position.mjs +0 -16
  943. package/dist/internal/anchor-position.mjs.map +0 -1
  944. package/dist/internal/sync-presence.mjs.map +0 -1
  945. package/dist/internal/use-action-trigger.mjs +0 -58
  946. package/dist/internal/use-action-trigger.mjs.map +0 -1
  947. package/dist/internal/use-controllable-action.mjs +0 -119
  948. package/dist/internal/use-controllable-action.mjs.map +0 -1
  949. package/dist/internal/use-exit-animation.mjs.map +0 -1
  950. package/dist/internal/use-form-reset.mjs +0 -54
  951. package/dist/internal/use-form-reset.mjs.map +0 -1
  952. package/dist/internal/use-native-checked.mjs.map +0 -1
  953. package/dist/internal/use-native-group-reconciliation.mjs.map +0 -1
  954. package/dist/internal/use-native-select-value.mjs.map +0 -1
  955. package/dist/internal/use-popover-popup.mjs +0 -274
  956. package/dist/internal/use-popover-popup.mjs.map +0 -1
  957. package/dist/internal/use-popover-root.d.mts +0 -2
  958. package/dist/internal/use-popover-root.mjs +0 -112
  959. package/dist/internal/use-popover-root.mjs.map +0 -1
  960. package/dist/internal/use-popover-trigger.mjs +0 -86
  961. package/dist/internal/use-popover-trigger.mjs.map +0 -1
  962. package/dist/internal/use-until-found.mjs.map +0 -1
@@ -0,0 +1,765 @@
1
+ # Field and Form
2
+
3
+ `Field` wires a label, a description and an error message to a form control; `Form` runs the form's action. There is no validation engine: the browser's own constraint validation (`required`, `type`, `pattern`, `minLength`, …) is the truth, the platform's `:user-invalid` heuristic decides when an error is shown, and the browser's localised message is the default text. What the library adds is the wiring the platform does not do (ids, `aria-describedby`, an explicit `aria-invalid`), a styleable error element instead of the native bubble, the first-invalid focus, and the asynchronous half: the submission runs in a transition with `data-pending`, server errors land on their fields and go away on the next edit, and the form is reset only when the action reported no errors.
4
+
5
+ ```tsx title="FieldSignUp.tsx"
6
+ "use client";
7
+ import { useActionState } from "react";
8
+ import { Field } from "@funstack/ui/field";
9
+ import { Form } from "@funstack/ui/form";
10
+ import type { FormErrors } from "@funstack/ui/form";
11
+ import { sleep } from "./fake-api.js";
12
+
13
+ interface SignUpState {
14
+ readonly errors?: FormErrors;
15
+ readonly created?: string;
16
+ }
17
+
18
+ // A pretend Server Function. It validates on the server and returns field errors keyed by
19
+ // name; it never throws for bad input, which is what `useActionState` is for.
20
+ async function signUp(_prev: SignUpState, formData: FormData): Promise<SignUpState> {
21
+ await sleep(900);
22
+ const email = String(formData.get("email"));
23
+ const handle = String(formData.get("handle"));
24
+ const errors: Record<string, string> = {};
25
+ if (email.toLowerCase() === "taken@example.com") {
26
+ errors["email"] = "This email is already registered.";
27
+ }
28
+ if (handle.toLowerCase().includes("admin")) errors["handle"] = "That handle is reserved.";
29
+ if (Object.keys(errors).length > 0) return { errors };
30
+ return { created: handle };
31
+ }
32
+
33
+ // Try: submit empty (the browser's messages, the first field focused); a short password; a
34
+ // mismatched confirmation (re-checked when either field changes); "taken@example.com" or a
35
+ // handle containing "admin" (server errors, focused, gone on the next keystroke). A successful
36
+ // sign-up resets the form; a failed one keeps every value.
37
+ export function FieldSignUp() {
38
+ const [state, formAction] = useActionState(signUp, {});
39
+ return (
40
+ <Form.Root action={formAction} errors={state.errors} className="demo-form">
41
+ <Field.Root name="email" required className="demo-fieldset">
42
+ <Field.Label className="demo-label">Email</Field.Label>
43
+ <Field.Control type="email" autoComplete="off" className="demo-input" />
44
+ <Field.Description className="demo-description">We never share it.</Field.Description>
45
+ <Field.Error className="demo-field-error" />
46
+ </Field.Root>
47
+ <Field.Root name="handle" required className="demo-fieldset">
48
+ <Field.Label className="demo-label">Handle</Field.Label>
49
+ <Field.Control
50
+ pattern="[a-z0-9_]+"
51
+ autoComplete="off"
52
+ className="demo-input"
53
+ aria-describedby="handle-hint"
54
+ />
55
+ <p id="handle-hint" className="demo-description">
56
+ Lowercase letters, digits and underscores.
57
+ </p>
58
+ <Field.Error className="demo-field-error">
59
+ {({ validity, messages }) =>
60
+ validity.patternMismatch
61
+ ? "Use lowercase letters, digits and underscores."
62
+ : messages.join(" ")
63
+ }
64
+ </Field.Error>
65
+ </Field.Root>
66
+ <Field.Root name="password" required className="demo-fieldset">
67
+ <Field.Label className="demo-label">Password</Field.Label>
68
+ <Field.Control
69
+ type="password"
70
+ minLength={8}
71
+ autoComplete="new-password"
72
+ className="demo-input"
73
+ />
74
+ <Field.Error className="demo-field-error">
75
+ {({ validity, messages }) =>
76
+ validity.tooShort ? "Use at least 8 characters." : messages.join(" ")
77
+ }
78
+ </Field.Error>
79
+ </Field.Root>
80
+ <Field.Root
81
+ name="confirm"
82
+ required
83
+ className="demo-fieldset"
84
+ validate={(value, formData) =>
85
+ value === formData.get("password") ? null : "Passwords do not match."
86
+ }
87
+ >
88
+ <Field.Label className="demo-label">Confirm password</Field.Label>
89
+ <Field.Control type="password" autoComplete="new-password" className="demo-input" />
90
+ <Field.Error className="demo-field-error" />
91
+ </Field.Root>
92
+ <div className="demo-row">
93
+ <Form.Submit className="demo-button demo-primary demo-submit">
94
+ {({ pending }) => (
95
+ <>
96
+ {pending && <span className="demo-spinner" aria-hidden />}
97
+ {pending ? "Creating…" : "Create account"}
98
+ </>
99
+ )}
100
+ </Form.Submit>
101
+ <button type="reset" className="demo-button">
102
+ Reset
103
+ </button>
104
+ </div>
105
+ {state.created !== undefined && (
106
+ <output className="demo-readout">
107
+ Created <code>@{state.created}</code> (the form was reset).
108
+ </output>
109
+ )}
110
+ </Form.Root>
111
+ );
112
+ }
113
+ ```
114
+
115
+ ```css title="field.css"
116
+ /* Field and Form. Every Field part carries data-invalid / data-required / data-disabled /
117
+ data-pending; the control also matches the platform's :user-invalid and :user-valid, which
118
+ work before hydration too. */
119
+ .demo-form {
120
+ display: grid;
121
+ gap: 1rem;
122
+ max-inline-size: 26rem;
123
+ }
124
+
125
+ .demo-fieldset {
126
+ display: grid;
127
+ gap: 0.3rem;
128
+ }
129
+
130
+ /* A checkbox or switch first, then its label. */
131
+ .demo-fieldset-inline {
132
+ grid-template-columns: auto 1fr;
133
+ align-items: center;
134
+ column-gap: 0.6em;
135
+ }
136
+ .demo-fieldset-inline .demo-field-error {
137
+ grid-column: 1 / -1;
138
+ }
139
+
140
+ .demo-label {
141
+ font-weight: 600;
142
+ color: var(--color-text);
143
+ }
144
+ .demo-fieldset[data-required] > .demo-label::after {
145
+ content: " *";
146
+ color: #dc2626;
147
+ }
148
+
149
+ .demo-input {
150
+ padding: 0.4em 0.6em;
151
+ border: 1px solid var(--color-border);
152
+ border-radius: 6px;
153
+ background: var(--color-bg);
154
+ color: var(--color-text);
155
+ font: inherit;
156
+ }
157
+ .demo-input:user-valid {
158
+ border-color: #16a34a;
159
+ }
160
+ .demo-input[data-invalid] {
161
+ border-color: #dc2626;
162
+ }
163
+
164
+ /* No JS auto-resize: the textarea grows with its content. */
165
+ .demo-grow {
166
+ field-sizing: content;
167
+ min-block-size: 2lh;
168
+ max-block-size: 8lh;
169
+ resize: none;
170
+ }
171
+
172
+ .demo-description {
173
+ margin: 0;
174
+ font-size: 0.85rem;
175
+ color: var(--color-text-secondary);
176
+ }
177
+
178
+ /* Rendered only while an error is shown: enter with @starting-style, leave instantly. */
179
+ .demo-field-error {
180
+ font-size: 0.85rem;
181
+ color: #dc2626;
182
+ opacity: 1;
183
+ transition: opacity 150ms;
184
+ @starting-style {
185
+ opacity: 0;
186
+ }
187
+ }
188
+
189
+ .demo-radio-row {
190
+ display: flex;
191
+ gap: 1.2em;
192
+ margin: 0;
193
+ padding: 0;
194
+ border: 0;
195
+ }
196
+
197
+ /* A native fieldset around several Fields (no Fieldset part). Its `disabled` is inherited by
198
+ every control, which `data-disabled` does not see: select the platform's `:disabled`. */
199
+ .demo-address {
200
+ display: grid;
201
+ gap: 1rem;
202
+ margin: 0;
203
+ padding: 0.75rem 1rem 1rem;
204
+ border: 1px solid var(--color-border);
205
+ border-radius: 8px;
206
+ min-inline-size: 0;
207
+ }
208
+ .demo-address > legend {
209
+ padding: 0 0.3em;
210
+ }
211
+ .demo-address .demo-fieldset:has(:disabled) {
212
+ opacity: 0.5;
213
+ }
214
+
215
+ /* The form's submission: the whole form dims, the button blocks repeat clicks with CSS. */
216
+ .demo-form[data-pending] .demo-fieldset {
217
+ opacity: 0.7;
218
+ }
219
+ .demo-submit[data-pending] {
220
+ pointer-events: none;
221
+ }
222
+
223
+ @media (prefers-reduced-motion: reduce) {
224
+ .demo-field-error {
225
+ transition: none;
226
+ }
227
+ }
228
+ ```
229
+
230
+ ## Anatomy
231
+
232
+ ```tsx
233
+ import { Field } from "@funstack/ui/field";
234
+ import { Form } from "@funstack/ui/form";
235
+
236
+ <Form.Root action={formAction} errors={state.errors}> {/* form */}
237
+ <Field.Root name="email" required> {/* div */}
238
+ <Field.Label>Email</Field.Label> {/* label[for] */}
239
+ <Field.Control type="email" autoComplete="email" /> {/* input */}
240
+ <Field.Description>We never share it.</Field.Description> {/* p[id] */}
241
+ <Field.Error /> {/* div[id], only while invalid */}
242
+ </Field.Root>
243
+ <Field.Root name="newsletter">
244
+ <Field.Label>Newsletter</Field.Label>
245
+ <Checkbox /> {/* any FUNSTACK form control */}
246
+ </Field.Root>
247
+ <Form.Submit>Create account</Form.Submit> {/* button[type=submit] */}
248
+ </Form.Root>
249
+ ```
250
+
251
+ - **`Field.Root` is a `div`** that owns the ids and the field's state. `name`, `required` and `disabled` go to the control unless it sets its own.
252
+ - **`Field.Control` is a native `<input>`**, or a `<textarea>` / `<select>` through `render`. Every other input prop passes through (`type`, `defaultValue`, a controlled `value` / `onChange`, `pattern`, …). Outside a `Field.Root` it is the plain control ([on its own](#field-control-alone)). There is no Input, Textarea or Fieldset part: the native elements, with the [textarea](#textarea) and [fieldset](#fieldset) recipes below.
253
+ - **Any FUNSTACK form control is a Field's control** without a wrapper: Checkbox, Switch, RadioGroup, CheckboxGroup, Select, Combobox, MultiSelect, Slider and NumberField (see [Slider inside a Field](slider.md#inside-a-field) and [NumberField inside a Field](number-field.md#inside-a-field)). A group (RadioGroup, CheckboxGroup, a Slider with several thumbs) is named by `Field.Label` through `aria-labelledby` instead of `for`. A RadioGroup carries `aria-invalid` on its `radiogroup`; a CheckboxGroup and a Slider on every item, because ARIA 1.2 does not support it on a `group`.
254
+ - **`Field.Error` is rendered only while an error is shown**. Write it once, unconditionally; its text is the browser's message, a server error, or what your function `children` return. An error that appears on blur can shift the layout, so a click right after typing (the click's press is the blur) may miss a button that moved; reserve the error's space if that matters.
255
+ - `Field.Description` is always referenced by the control, rendered or not.
256
+
257
+ ## How it works
258
+
259
+ ### When an error is shown
260
+
261
+ A field shows an error when its control matches `:user-invalid` or the Form has a server error for it:
262
+
263
+ - **Not while the user is still typing for the first time.** `:user-invalid` starts matching after the user changed the value and left the field, or after a submission attempt; it then updates live on every keystroke and stops after a form reset. There is no `validationMode`: this is the heuristic every native form already uses.
264
+ - **A submission attempt** with an invalid field: the Field cancels the browser's validation bubble (only when a `Field.Error` is mounted), renders the message, and the first invalid control in document order is focused. Its description, error included, is read at focus. When focus is already there (Enter pressed in that field), the message is announced with `ariaNotify()` instead, where the browser has it. A field without `Field.Error` keeps the browser's bubble; so does every field before hydration.
265
+ - `form.checkValidity()` shows nothing and `reportValidity()` shows the browser's bubble, as without the library.
266
+ - The display state is updated synchronously from the DOM event, not in a transition: the error must be in the DOM when focus reaches the field. So no Field part takes a `transition` prop, `Field.Error` animates its entry with CSS `@starting-style`, and content rendered inside it must not suspend.
267
+
268
+ ### Custom rules: validate
269
+
270
+ ```tsx
271
+ <Field.Root
272
+ name="confirm"
273
+ required
274
+ validate={(value, formData) => (value === formData.get("password") ? null : "Passwords do not match.")}
275
+ >
276
+ ```
277
+
278
+ `validate` is synchronous and receives the field's value (`formData.get(name)` as a string) and the whole form's `FormData`. Its message is written into the control with `setCustomValidity`, so it blocks submission, matches `:invalid` / `:user-invalid` and is shown like a native constraint. It runs at mount, on every `input` / `change` anywhere in the form and on a FUNSTACK control's value change (cross-field rules stay current), on blur, after a reset, on a submission attempt, and whenever the prop changes, so a rule that reads outside state (a list that loads, a value in React state) updates on render. An inline function is a new prop on every render and so re-runs each time; wrap it in `useCallback` to re-run it only when its inputs change. A field with `validate` is rendered from a client component (a function is not serialisable).
279
+
280
+ ### Submission and server errors
281
+
282
+ With a function `action` (a Server Function, a `useActionState` dispatch, or a client function), `Form.Root` renders it on the `<form>` unwrapped, so before hydration the form posts to the Server Function. After hydration it runs the action itself, inside its own transition:
283
+
284
+ - `data-pending` is on the form, on `Form.Submit` and on every `Field.Root` (and its parts) while the submission is in flight, including the Suspense wait of what the result re-renders. `useFormStatus()` works as usual in your own components, also through a portal.
285
+ - `errors` (keyed by field `name`, usually `state.errors` from `useActionState`) reach each field. A server error is shown at once, written into the control's custom validity (a resubmission of the same value is blocked, with the usual focus), and dismissed by the user's next edit. The next settled submission shows its errors again, even identical strings.
286
+ - After a submission with errors, the first field with an error is focused (its message is announced with `ariaNotify()` when focus is already on it). Errors present at mount (a progressive-enhancement post-back, a Server Component prop) are shown without moving focus.
287
+ - An error about a value the user changed while the submission was in flight is not shown: it is about a value they already replaced.
288
+ - **Reset only on success.** React resets a form after every successful action, including one that returned field errors, which wipes what the user typed. The Form resets (`form.reset()`) only when the submission settles with no error in `errors`; pass `autoReset={false}` to keep the values (a settings form).
289
+ - An action that throws reaches the nearest Error Boundary above `Form.Root`; nothing is reset. Return errors from the action to keep the form. The rejection of a submission a later one superseded, or of one that settles after the form unmounted or was hidden, goes to `reportError` instead, like every other action (see [Action props](../concepts/action-props.md)).
290
+ - A second submit while one is pending is not dropped: a `useActionState` dispatch queues it. Block repeat clicks with CSS on `Form.Submit[data-pending]` if you need to; the button is never disabled.
291
+
292
+ #### <a id="dialog-form"></a>In a Dialog: `Dialog.Form` rendered as `Form.Root`
293
+
294
+ ```tsx
295
+ const [state, dispatch] = useActionState(saveProfile, {});
296
+
297
+ <Dialog.Popup>
298
+ <Dialog.Title>Edit profile</Dialog.Title>
299
+ <Dialog.Form action={dispatch} render={<Form.Root errors={state.errors} />}>
300
+ <Field.Root name="email">
301
+ <Field.Label>Email</Field.Label>
302
+ <Field.Control type="email" required />
303
+ <Field.Error />
304
+ </Field.Root>
305
+ <Dialog.Close value="cancel">Cancel</Dialog.Close>
306
+ <Form.Submit value="save">Save</Form.Submit>
307
+ </Dialog.Form>
308
+ </Dialog.Popup>
309
+ ```
310
+
311
+ `Dialog.Form` renders a plain React form, which takes React's path: the form is reset after every successful action, also one that returned field errors. Rendered as `Form.Root` (`render={<Form.Root errors={state.errors} />}`), `Form.Root` receives the `action` and runs it, so its policy applies: server errors are routed to the fields and focused, and the form is reset only when the result has no error (`autoReset`, which you can pass on the `Form.Root` element). `Dialog.Form`'s `closeOnSettle` follows the same rule: a result with a field error keeps the dialog open (the typed values stay and the first errored field is focused), a result with no error resets the form and closes the dialog with the `Form.Submit`'s `value` as `returnValue`. An action that throws keeps the dialog open and reaches the nearest Error Boundary. An error hidden because the user changed that value while the action ran still counts: the dialog stays open and the user submits the new value.
312
+
313
+ - The reset runs before the close, so an exit animation shows the fields at their defaults. With the default content (unmounted on close) the next open starts fresh anyway: pass `autoReset={false}` on the `Form.Root` element if your exit is visible. With `keepMounted` keep the default, since the reset is what makes the next open clean.
314
+ - The composition needs a function `action`. Without one, `Form.Root` owns `method` and the form would navigate instead of closing the dialog (a development warning says so); render a plain `Dialog.Form` for a `method="dialog"` form.
315
+
316
+ > **A submitter with its own formAction**
317
+ >
318
+ > A `Form.Submit formAction={fn}` (or any button with a `formAction`) takes that submission out of the Form's hands: React runs it and resets the form afterwards, as it always does. A string `action` is a plain navigating form.
319
+
320
+ ## Props
321
+
322
+ ### `Field.Root`
323
+
324
+ | Prop | Type | Default | Description |
325
+ | - | - | - | - |
326
+ | `name` | `string` | – | The control's default `name`, the key in `Form.Root errors`, and the entry `validate` reads. |
327
+ | `required` | `boolean` | `false` | Makes the control natively `required` and marks every part `data-required`. |
328
+ | `disabled` | `boolean` | `false` | Natively disables the control and marks every part `data-disabled`. |
329
+ | `validate` | `(value: string, formData: FormData) => FieldErrorValue` | – | A synchronous custom rule, written with `setCustomValidity`. Return a message (or several) for an error, `null` / `undefined` / `""` for none. |
330
+ | `className` | `string \| ((state: FieldState) => string \| undefined)` | – | A class name, or a function of the part's state. |
331
+ | `style` | `CSSProperties \| ((state: FieldState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
332
+ | `children` | `ReactNode \| ((state: FieldState) => ReactNode)` | – | Content, or a function of the part's state. |
333
+ | `render` | `ReactElement \| ((props, state: FieldState) => ReactNode)` | – | Replace the default \<div> (element form) or take over rendering (function form). |
334
+
335
+ - **State**: `FieldState`, shared by every Field part, is `{ invalid, messages, validity, disabled, required, pending }`; `invalid`: an error is shown; `messages`: the shown messages (the browser's `validationMessage`, `validate`'s strings, or the server's), `[]` while valid; `validity`: a `FieldValidity` snapshot of the control's `ValidityState` (`valueMissing`, `typeMismatch`, `tooShort`, …, `customError`, `valid`); `disabled` / `required`: the Field's or the control's own; `pending`: the enclosing form's submission is in flight.
336
+ - **Owned**: `data-invalid`, `data-disabled`, `data-required`, `data-pending`.
337
+
338
+ ### `Field.Label`, `Field.Description`
339
+
340
+ | Prop | Type | Default | Description |
341
+ | - | - | - | - |
342
+ | `className` | `string \| ((state: FieldState) => string \| undefined)` | – | A class name, or a function of the part's state. |
343
+ | `style` | `CSSProperties \| ((state: FieldState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
344
+ | `children` | `ReactNode \| ((state: FieldState) => ReactNode)` | – | Content, or a function of the part's state. |
345
+ | `render` | `ReactElement \| ((props, state: FieldState) => ReactNode)` | – | Replace the default \<label> (must stay a \<label>) or \<p>. |
346
+
347
+ - **State**: the Field's.
348
+ - **Owned**: Label: `id`, `htmlFor` (absent for a group control); Description: `id`; both also the Field's four `data-*` attributes.
349
+
350
+ ### `Field.Control`
351
+
352
+ | Prop | Type | Default | Description |
353
+ | - | - | - | - |
354
+ | `id` | `string` | – | Native `id`, outside a `Field.Root` only. Inside one the Field owns the id (so `Field.Label` can point at it) and this prop is ignored with a development warning. |
355
+ | `name` | `string` | `the Field's` | Native `name`. |
356
+ | `required, disabled` | `boolean` | `the Field's` | Native; the Field's value also applies (either one is enough). |
357
+ | `className` | `string \| ((state: FieldState) => string \| undefined)` | – | A class name, or a function of the part's state. |
358
+ | `style` | `CSSProperties \| ((state: FieldState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
359
+ | `render` | `ReactElement \| ((props, state: FieldState) => ReactNode)` | – | Must render an \<input>, \<textarea> or \<select>: `render={<textarea rows={3} />}`. |
360
+ | `…` | `native` | – | Every other `<input>` prop passes through; the Field's listeners are native, so your `onInput` / `onBlur` run independently. |
361
+
362
+ - **State**: the Field's.
363
+ - **Owned**: Inside a Field: `id`, `name`, `required`, `disabled`, `aria-invalid` (always `"true"` or `"false"`: it stops Chromium announcing a `typeMismatch` before it is shown, and exposes `valueMissing`, which it otherwise never does), `aria-describedby` (your tokens first, then the description, then the error while shown), and the Field's four `data-*` attributes.
364
+
365
+ Outside a `Field.Root` it is the plain native control: every prop passes through (`id` included), the library adds no attribute, and the function props receive a `FieldState` with the control's own `disabled` / `required` and a constant valid, not-pending rest. The other Field parts still throw outside a Field. See [Field.Control on its own](#field-control-alone).
366
+
367
+ ### `Field.Error`
368
+
369
+ | Prop | Type | Default | Description |
370
+ | - | - | - | - |
371
+ | `children` | `ReactNode \| ((state: FieldState) => ReactNode)` | `messages.join(" ")` | Rendered only while `invalid`. A function for per-constraint wording: `({ validity, messages }) => validity.valueMissing ? "Enter your email" : messages.join(" ")`. Must not suspend. |
372
+ | `className` | `string \| ((state: FieldState) => string \| undefined)` | – | A class name, or a function of the part's state. |
373
+ | `style` | `CSSProperties \| ((state: FieldState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
374
+ | `render` | `ReactElement \| ((props, state: FieldState) => ReactNode)` | – | Replace the default \<div> (element form) or take over rendering (function form). |
375
+
376
+ - **State**: the Field's.
377
+ - **Owned**: `id` and the Field's four `data-*` attributes.
378
+
379
+ No `role` and no live region: after a submission focus moves to the field and reads the error with the description (a live region would read it twice). Add `aria-live="polite"` yourself if you want blur-time errors announced. One per Field.
380
+
381
+ ### `Form.Root`
382
+
383
+ | Prop | Type | Default | Description |
384
+ | - | - | - | - |
385
+ | `action` | `string \| ((formData: FormData) => unknown)` | – | A Server Function, a `useActionState` dispatch or a client function, rendered unwrapped (progressive enhancement) and run by the Form in its own transition after hydration. A string is a navigating form. |
386
+ | `errors` | `FormErrors` | – | `Record<string, string \| readonly string[] \| null \| undefined>` keyed by field name. Shown on the matching Field, dismissed by its next edit, re-armed by the next settled submission. |
387
+ | `autoReset` | `boolean` | `true` | Reset the form when a submission the Form ran settles with no non-empty entry in `errors`. `false`: never. |
388
+ | `method` | `string` | – | Only with a string `action`. |
389
+ | `className` | `string \| ((state: FormRootState) => string \| undefined)` | – | A class name, or a function of the part's state. |
390
+ | `style` | `CSSProperties \| ((state: FormRootState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
391
+ | `children` | `ReactNode \| ((state: FormRootState) => ReactNode)` | – | Content, or a function of the part's state. |
392
+ | `render` | `ReactElement \| ((props, state: FormRootState) => ReactNode)` | – | Replace the default \<form> (element form) or take over rendering (function form). |
393
+
394
+ - **State**: `FormRootState` is `{ pending }`.
395
+ - **Owned**: `action`, `method` (except with a string `action`), `onSubmit`, `data-pending`.
396
+
397
+ `noValidate` and `onReset` pass through. A `render` element's own `onSubmit` runs first; calling `preventDefault()` in it cancels the submission.
398
+
399
+ ### `Form.Submit`
400
+
401
+ | Prop | Type | Default | Description |
402
+ | - | - | - | - |
403
+ | `disabled` | `boolean` | `false` | Native `disabled`; owned, so a `render` element cannot re-enable it. Never set by the library while pending. Native also with a component `render` (assumed to render a submit button: only native `disabled` stops a submitter before hydration). With a host element of another tag (`render={<a />}`), `aria-disabled="true"` instead and the click is cancelled. |
404
+ | `className` | `string \| ((state: FormSubmitState) => string \| undefined)` | – | A class name, or a function of the part's state. |
405
+ | `style` | `CSSProperties \| ((state: FormSubmitState) => CSSProperties \| undefined)` | – | Inline style, or a function of the part's state. |
406
+ | `children` | `ReactNode \| ((state: FormSubmitState) => ReactNode)` | – | Content, or a function of the part's state. |
407
+ | `render` | `ReactElement \| ((props, state: FormSubmitState) => ReactNode)` | – | Replace the default \<button> (element form) or take over rendering (function form). |
408
+
409
+ - **State**: `FormSubmitState` is `{ pending, disabled }`; `pending` is `useFormStatus().pending` of the enclosing form, so it works in any React form (`Dialog.Form`, a plain `<form action>`).
410
+ - **Owned**: `type` (`"submit"`, on a `<button>`), `disabled`, `aria-disabled` (a host element other than `<button>` / `<input>`), `onClick` (while disabled), `data-pending`, `data-disabled`.
411
+
412
+ `name`, `value` and `formAction` pass through.
413
+
414
+ ## Data attributes
415
+
416
+ | Hook | On | Meaning |
417
+ | - | - | - |
418
+ | `data-invalid` | every Field part | An error is shown (`FieldState.invalid`). |
419
+ | `data-required` | every Field part | `Field.Root required` or the control's own `required`. |
420
+ | `data-disabled` | every Field part, Form.Submit | Disabled by prop. |
421
+ | `aria-disabled` | Form.Submit | `disabled` with a `render` element that cannot be natively disabled (`<a>`). |
422
+ | `data-pending` | every Field part, Form.Root, Form.Submit | The form's submission is in flight. A FUNSTACK control inside keeps its own `data-pending` for its own action. |
423
+ | `:user-invalid`, `:user-valid` | the control | The platform's; work before hydration. `data-invalid` adds server errors and the parts that are not the control. |
424
+
425
+ ## Keyboard and ARIA
426
+
427
+ Nothing beyond the platform: Tab order is the DOM's, Enter in a text field submits, a click on the label focuses or activates the control. After a failed attempt, assistive technology hears the control, "invalid entry", the description and the error, in that order. `aria-errormessage` is not used: VoiceOver does not announce it, and `aria-describedby` works in every screen reader.
428
+
429
+ ## Transition types
430
+
431
+ Concept: [Transitions & ViewTransition](../concepts/transitions.md#transition-types)
432
+
433
+ None: no part adds transition types or takes a `transition` prop.
434
+
435
+ ## Optimistic and pending
436
+
437
+ Concept: [Pending & optimistic state](../concepts/pending-and-optimistic.md)
438
+
439
+ A Form with a function `action` runs it in its own transition: `data-pending` is on the form, on `Form.Submit` and on every Field part while the submission is in flight. A Field's display state (whether its error shows) is updated synchronously from the DOM event, not in a transition.
440
+
441
+ ## Suspense
442
+
443
+ Concept: [Suspense](../concepts/suspense.md)
444
+
445
+ The submission's pending state includes the Suspense wait of what the result re-renders. Content inside `Field.Error` must not suspend.
446
+
447
+ ## Browser-owned state
448
+
449
+ Concept: [Browser-owned state](../concepts/browser-owned-state.md)
450
+
451
+ Validity is the browser's: native constraint validation, `:user-invalid` and the browser's validation message; `data-invalid` adds server errors.
452
+
453
+ ## Before hydration
454
+
455
+ Concept: [Server Components](../concepts/server-components.md#before-hydration)
456
+
457
+ The browser validates and shows its bubble, and the form posts to the Server Function (React's progressive enhancement). A group control's label carries `for` until hydration.
458
+
459
+ ### From a Server Component
460
+
461
+ ```tsx
462
+ // app/subscribe.tsx: a Server Component, no client code of yours.
463
+ import { Field } from "@funstack/ui/field";
464
+ import { Form } from "@funstack/ui/form";
465
+ import { subscribe } from "./actions"; // "use server"
466
+
467
+ export function Subscribe() {
468
+ return (
469
+ <Form.Root action={subscribe}>
470
+ <Field.Root name="email" required>
471
+ <Field.Label>Email</Field.Label>
472
+ <Field.Control type="email" autoComplete="email" />
473
+ <Field.Error />
474
+ </Field.Root>
475
+ <Field.Root name="body" required>
476
+ <Field.Label>Comment</Field.Label>
477
+ <Field.Control render={<textarea rows={2} maxLength={2000} />} className="comment" />
478
+ <Field.Error />
479
+ </Field.Root>
480
+ <Form.Submit>Subscribe</Form.Submit>
481
+ </Form.Root>
482
+ );
483
+ }
484
+ ```
485
+
486
+ Every part may be rendered from a Server Component with serialisable props. Before hydration the browser validates and shows its bubble, and the form posts to the Server Function; the ids, `aria-describedby` and `aria-invalid="false"` are in the server HTML. A group control's label carries `for` until hydration replaces it with the group's `aria-labelledby`.
487
+
488
+ ## Styling
489
+
490
+ ```css
491
+ .field[data-invalid] .control { border-color: var(--danger); }
492
+ .field:has(.control:user-valid) .control { border-color: var(--ok); } /* no JS needed */
493
+ .field[data-disabled] { opacity: .5; }
494
+ .field[data-required] .label::after { content: " *"; }
495
+ .error { color: var(--danger); opacity: 1; transition: opacity 150ms; @starting-style { opacity: 0; } }
496
+
497
+ /* The control grows with its content: no auto-resize hook. */
498
+ textarea.control { field-sizing: content; min-height: 3lh; max-height: 12lh; }
499
+ select.control { field-sizing: content; }
500
+
501
+ form[data-pending] { cursor: progress; }
502
+ .submit[data-pending] { pointer-events: none; } /* your "no double submit" */
503
+ ```
504
+
505
+ `field-sizing: content` (Chrome 123, Safari 26.2, Firefox 152) makes a textarea or a text input size to its content. Tailwind: `data-invalid:border-red-500 data-pending:opacity-70 field-sizing-content`.
506
+
507
+ ## Recipes
508
+
509
+ ### FUNSTACK controls in a Field
510
+
511
+ ```tsx title="FieldControls.tsx"
512
+ "use client";
513
+ import { startTransition, useState } from "react";
514
+ import { Checkbox } from "@funstack/ui/checkbox";
515
+ import { Field } from "@funstack/ui/field";
516
+ import { Form } from "@funstack/ui/form";
517
+ import type { FormErrors } from "@funstack/ui/form";
518
+ import { RadioGroup } from "@funstack/ui/radio-group";
519
+ import { Switch } from "@funstack/ui/switch";
520
+ import { fakeSave } from "./fake-api.js";
521
+
522
+ // FUNSTACK controls are a Field's control as they are: the Field labels and describes them,
523
+ // gives them its `name` / `required` / `disabled`, and shows their native validation. The Switch
524
+ // saves on its own (its own `data-pending`); the form's submission is the Field's `data-pending`.
525
+ // `autoReset={false}`: a settings form keeps its values after a successful save.
526
+ export function FieldControls() {
527
+ const [errors, setErrors] = useState<FormErrors>({});
528
+ const [saved, setSaved] = useState<string | null>(null);
529
+ return (
530
+ <Form.Root
531
+ className="demo-form"
532
+ autoReset={false}
533
+ errors={errors}
534
+ action={async (formData) => {
535
+ await fakeSave("the profile");
536
+ const bio = String(formData.get("bio"));
537
+ startTransition(() => {
538
+ setErrors(bio.includes("http") ? { bio: "Links are not allowed in the bio." } : {});
539
+ setSaved(bio.includes("http") ? null : `plan=${String(formData.get("plan"))}`);
540
+ });
541
+ }}
542
+ >
543
+ <Field.Root name="plan" required className="demo-fieldset">
544
+ <Field.Label className="demo-label">Plan</Field.Label>
545
+ <RadioGroup.Root className="demo-radio-row">
546
+ <label className="demo-field">
547
+ <RadioGroup.Item value="free" className="demo-radio" /> Free
548
+ </label>
549
+ <label className="demo-field">
550
+ <RadioGroup.Item value="pro" className="demo-radio" /> Pro
551
+ </label>
552
+ </RadioGroup.Root>
553
+ <Field.Description className="demo-description">You can change it later.</Field.Description>
554
+ <Field.Error className="demo-field-error" />
555
+ </Field.Root>
556
+ <Field.Root name="bio" className="demo-fieldset">
557
+ <Field.Label className="demo-label">Bio</Field.Label>
558
+ <Field.Control
559
+ render={<textarea rows={1} maxLength={280} />}
560
+ className="demo-input demo-grow"
561
+ />
562
+ <Field.Description className="demo-description">
563
+ Grows as you type (<code>field-sizing: content</code>). Links are rejected by the server.
564
+ </Field.Description>
565
+ <Field.Error className="demo-field-error" />
566
+ </Field.Root>
567
+ <Field.Root name="news" className="demo-fieldset demo-fieldset-inline">
568
+ <Checkbox className="demo-checkbox" />
569
+ <Field.Label className="demo-label">Email me product news</Field.Label>
570
+ </Field.Root>
571
+ <Field.Root name="terms" required className="demo-fieldset demo-fieldset-inline">
572
+ <Checkbox className="demo-checkbox" />
573
+ <Field.Label className="demo-label">I accept the terms</Field.Label>
574
+ <Field.Error className="demo-field-error" />
575
+ </Field.Root>
576
+ <Field.Root name="beta" className="demo-fieldset demo-fieldset-inline">
577
+ <Switch
578
+ className="demo-switch"
579
+ checkedChangeAction={() => fakeSave("the beta setting", { ms: 1200 })}
580
+ />
581
+ <Field.Label className="demo-label">Beta features (saves on its own)</Field.Label>
582
+ </Field.Root>
583
+ <div className="demo-row">
584
+ <Form.Submit className="demo-button demo-primary demo-submit">
585
+ {({ pending }) => (
586
+ <>
587
+ {pending && <span className="demo-spinner" aria-hidden />}
588
+ Save
589
+ </>
590
+ )}
591
+ </Form.Submit>
592
+ </div>
593
+ {saved !== null && (
594
+ <output className="demo-readout">
595
+ Saved <code>{saved}</code>; the values stay (<code>autoReset=&#123;false&#125;</code>).
596
+ </output>
597
+ )}
598
+ </Form.Root>
599
+ );
600
+ }
601
+ ```
602
+
603
+ `field.css`: the same file as above.
604
+
605
+ - Inside a `Field.Root` the control's `id` belongs to the Field (so `Field.Label` can point at it); `name`, `required` and `disabled` default from the Field.
606
+ - The [two channels](../concepts/action-props.md#form-channel) stay separate: a control's own action (the Switch above saves on its own) gives _it_ `data-pending`; the form's submission gives the Field `data-pending`, never the control.
607
+ - Combobox: the `Combobox.Input` is the control, the hidden input takes the Field's `name`, and the listbox is named by `Field.Label` when no `Combobox.Label` is rendered. `validate` reads the selection (the hidden input), and picking an option counts as an edit: it re-runs `validate` and dismisses a server error, like typing.
608
+ - MultiSelect: the Trigger (a `<button>`) is the control; `Field.Label` focuses it instead of clicking it, as a label does for a `<select>`. Its validity is a hidden `<select>`'s, which shows no browser bubble, so `Field.Error` is where a `required` message appears ([MultiSelect forms](multi-select.md#forms)).
609
+ - NumberField: the visible text input is the control (labelled, described, focused), while its validity is the hidden `<input type="number">`'s, so `Field.Error`'s function `children` can branch on `validity.stepMismatch`, `rangeUnderflow` or `rangeOverflow`: `{({ validity, messages }) => validity.stepMismatch ? "Enter a multiple of six." : messages.join(" ")}`. `validate` reads the committed number, never a half-typed draft.
610
+ - "Submit on change": `checkedChangeAction={() => formRef.current?.requestSubmit()}` goes through the Form like a click. Never call `form.submit()`, which skips validation and the Form.
611
+
612
+ ### <a id="fieldset"></a>Fields in a fieldset
613
+
614
+ There is no Fieldset part: a set of Fields with a common caption is the native `<fieldset>`, which already names the group (`<legend>`), describes it (`aria-describedby`) and disables every native control inside it. Every FUNSTACK form control has a native element, so `<fieldset disabled>` reaches them all: they leave the `FormData`, skip validation and the Tab order, and the pointer surfaces (a Slider's Track, NumberField's buttons) ignore presses too.
615
+
616
+ ```tsx title="FieldAddress.tsx"
617
+ "use client";
618
+ import { useRef, useState } from "react";
619
+ import { Field } from "@funstack/ui/field";
620
+ import { Form } from "@funstack/ui/form";
621
+ import { NumberField } from "@funstack/ui/number-field";
622
+ import { fakeSave } from "./fake-api.js";
623
+
624
+ // A native <fieldset> captions a set of Fields and disables all of them: every FUNSTACK control
625
+ // has a native element, so `disabled` on the fieldset reaches each one (and the NumberField's
626
+ // buttons ignore the pointer too). The library's `data-disabled` does not see an inherited
627
+ // `disabled`, so the CSS selects `:disabled` instead. The fieldset is never disabled because a
628
+ // submission is pending: that would drop focus; after a save, focus moves to the checkbox before
629
+ // the fieldset is disabled, for the same reason. The notes are a textarea that grows with its
630
+ // content (`field-sizing: content`).
631
+ export function FieldAddress() {
632
+ const [editing, setEditing] = useState(false);
633
+ const [saved, setSaved] = useState<string | null>(null);
634
+ const editRef = useRef<HTMLInputElement>(null);
635
+ return (
636
+ <Form.Root
637
+ className="demo-form"
638
+ autoReset={false}
639
+ action={async (formData) => {
640
+ await fakeSave("the address");
641
+ setSaved(`${String(formData.get("street"))}, ${String(formData.get("city"))}`);
642
+ // Disabling the fieldset would drop focus from the Save button inside it: move focus to
643
+ // the checkbox (outside the fieldset) first.
644
+ editRef.current?.focus();
645
+ setEditing(false);
646
+ }}
647
+ >
648
+ <label className="demo-field">
649
+ <input
650
+ ref={editRef}
651
+ type="checkbox"
652
+ checked={editing}
653
+ onChange={(e) => setEditing(e.target.checked)}
654
+ />{" "}
655
+ Edit the address
656
+ </label>
657
+ <fieldset className="demo-address" disabled={!editing} aria-describedby="address-hint">
658
+ <legend className="demo-label">Shipping address</legend>
659
+ <p id="address-hint" className="demo-description">
660
+ Used for this order only.
661
+ </p>
662
+ <Field.Root name="street" required className="demo-fieldset">
663
+ <Field.Label className="demo-label">Street</Field.Label>
664
+ <Field.Control
665
+ className="demo-input"
666
+ autoComplete="address-line1"
667
+ defaultValue="1 Main St"
668
+ />
669
+ <Field.Error className="demo-field-error" />
670
+ </Field.Root>
671
+ <Field.Root name="city" required className="demo-fieldset">
672
+ <Field.Label className="demo-label">City</Field.Label>
673
+ <Field.Control
674
+ className="demo-input"
675
+ autoComplete="address-level2"
676
+ defaultValue="Springfield"
677
+ />
678
+ <Field.Error className="demo-field-error" />
679
+ </Field.Root>
680
+ <Field.Root name="floor" className="demo-fieldset">
681
+ <Field.Label className="demo-label">Floor</Field.Label>
682
+ <NumberField.Root
683
+ defaultValue={1}
684
+ min={0}
685
+ max={99}
686
+ locale="en-US"
687
+ className="demo-number-field"
688
+ >
689
+ <div className="demo-number-group">
690
+ <NumberField.Decrement className="demo-number-step">−</NumberField.Decrement>
691
+ <NumberField.Input className="demo-number-input" />
692
+ <NumberField.Increment className="demo-number-step">+</NumberField.Increment>
693
+ </div>
694
+ </NumberField.Root>
695
+ </Field.Root>
696
+ <Field.Root name="notes" className="demo-fieldset">
697
+ <Field.Label className="demo-label">Delivery notes</Field.Label>
698
+ <Field.Control
699
+ render={<textarea rows={1} maxLength={500} />}
700
+ className="demo-input demo-grow"
701
+ />
702
+ <Field.Description className="demo-description">
703
+ Grows as you type (<code>field-sizing: content</code>).
704
+ </Field.Description>
705
+ </Field.Root>
706
+ <div className="demo-row">
707
+ <Form.Submit className="demo-button demo-primary demo-submit">Save address</Form.Submit>
708
+ </div>
709
+ </fieldset>
710
+ {saved !== null && <output className="demo-readout">Saved {saved}.</output>}
711
+ </Form.Root>
712
+ );
713
+ }
714
+ ```
715
+
716
+ `field.css`: the same file as above.
717
+
718
+ ```tsx
719
+ <fieldset disabled={!canEdit} aria-describedby="address-hint">
720
+ <legend>Shipping address</legend>
721
+ <p id="address-hint">Used for this order only.</p>
722
+ <Field.Root name="street"><Field.Label>Street</Field.Label><Field.Control required /><Field.Error /></Field.Root>
723
+ <Field.Root name="city"><Field.Label>City</Field.Label><Field.Control required /><Field.Error /></Field.Root>
724
+ </fieldset>
725
+ ```
726
+
727
+ - An inherited `disabled` is the platform's: `data-disabled` and `state.disabled` stay the props'. Style it with the platform's selector, which covers both sources: `.field:has(.control:disabled) { opacity: .5; }`.
728
+ - Errors stay per Field. A rule over several controls is one Field's `validate` (it receives the whole `FormData`); a message that belongs to no control is your own element, referenced from the fieldset's `aria-describedby`.
729
+ - [RadioGroup](radio-group.md) and [CheckboxGroup](checkbox-group.md) are fieldsets themselves (their `Label` is the `<legend>`): do not wrap one in another fieldset to caption it.
730
+ - Do not disable a fieldset while a submission is pending: `<fieldset disabled={pending}>` drops focus from the control the user is on. Mark pending with `form[data-pending]`.
731
+
732
+ ### <a id="textarea"></a>A textarea that grows
733
+
734
+ A textarea is `Field.Control render={<textarea />}`; textarea-only props (`rows`, `wrap`) go on the render element. It grows with its content through CSS, so there is no `autoSize` prop (the notes in the example above):
735
+
736
+ ```tsx
737
+ <Field.Root name="notes">
738
+ <Field.Label>Delivery notes</Field.Label>
739
+ <Field.Control render={<textarea rows={1} maxLength={500} />} className="control grow" />
740
+ </Field.Root>
741
+ ```
742
+
743
+ ```css
744
+ .grow { field-sizing: content; min-block-size: 2lh; max-block-size: 8lh; resize: none; }
745
+ ```
746
+
747
+ ### <a id="field-control-alone"></a>Field.Control on its own
748
+
749
+ Outside a `Field.Root`, `Field.Control` renders the plain native control: `id`, `name`, `disabled` and `required` pass through, and nothing is added. For a direct call site write the native element (`<input type="search" aria-label="Search">`); the standalone form is for your own styled input built on `Field.Control`, which then works in a form field and in a search box or a table cell alike:
750
+
751
+ ```tsx
752
+ function TextInput(props: FieldControlProps) {
753
+ return <Field.Control {...props} className={(s) => (s.invalid ? "input invalid" : "input")} />;
754
+ }
755
+
756
+ <Field.Root name="email" required>
757
+ <Field.Label>Email</Field.Label>
758
+ <TextInput type="email" /> {/* wired to the Field */}
759
+ </Field.Root>
760
+
761
+ <label htmlFor="q">Search</label>
762
+ <TextInput id="q" type="search" /> {/* the plain <input>, state never invalid */}
763
+ ```
764
+
765
+ Outside a Field the function props receive a `FieldState` whose `disabled` and `required` are the control's own props (as inside a Field), so `className={(s) => s.disabled ? …}` works in both places; `invalid`, `validity` and `pending` are constant (valid, not pending: there is no validation without a Field), and no `data-*` attribute is rendered. Select a plain control's validity with `:user-invalid`. A search box has no Field to wire; let the query leave the urgent lane with `useDeferredValue`, or use a [Combobox](combobox.md) when the result is a list of options. The text of an input is a fact, not a request, so there is no `valueChangeAction` on a text control.