@funstack/ui 0.1.0-alpha.14 → 0.1.0-alpha.16

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 (584) hide show
  1. package/README.md +22 -1
  2. package/dist/accordion/accordion-item.d.mts +19 -0
  3. package/dist/accordion/accordion-item.d.mts.map +1 -1
  4. package/dist/accordion/accordion-item.mjs +2 -0
  5. package/dist/accordion/accordion-item.mjs.map +1 -1
  6. package/dist/accordion/accordion-panel.d.mts +16 -0
  7. package/dist/accordion/accordion-panel.d.mts.map +1 -1
  8. package/dist/accordion/accordion-panel.mjs +2 -0
  9. package/dist/accordion/accordion-panel.mjs.map +1 -1
  10. package/dist/accordion/accordion-root.d.mts +36 -2
  11. package/dist/accordion/accordion-root.d.mts.map +1 -1
  12. package/dist/accordion/accordion-root.mjs +7 -4
  13. package/dist/accordion/accordion-root.mjs.map +1 -1
  14. package/dist/accordion/accordion-trigger.d.mts +9 -0
  15. package/dist/accordion/accordion-trigger.d.mts.map +1 -1
  16. package/dist/accordion/accordion-trigger.mjs +2 -0
  17. package/dist/accordion/accordion-trigger.mjs.map +1 -1
  18. package/dist/accordion/index.d.mts +2 -0
  19. package/dist/accordion/index.d.mts.map +1 -1
  20. package/dist/accordion/index.mjs +2 -0
  21. package/dist/accordion/index.mjs.map +1 -1
  22. package/dist/bin/skill-installer.d.mts +1 -0
  23. package/dist/bin/skill-installer.mjs +12 -0
  24. package/dist/bin/skill-installer.mjs.map +1 -0
  25. package/dist/button/button.d.mts +25 -7
  26. package/dist/button/button.d.mts.map +1 -1
  27. package/dist/button/button.mjs +2 -0
  28. package/dist/button/button.mjs.map +1 -1
  29. package/dist/checkbox/checkbox.d.mts +25 -3
  30. package/dist/checkbox/checkbox.d.mts.map +1 -1
  31. package/dist/checkbox/checkbox.mjs +2 -0
  32. package/dist/checkbox/checkbox.mjs.map +1 -1
  33. package/dist/checkbox-group/checkbox-group-item.d.mts +15 -0
  34. package/dist/checkbox-group/checkbox-group-item.d.mts.map +1 -1
  35. package/dist/checkbox-group/checkbox-group-item.mjs +2 -0
  36. package/dist/checkbox-group/checkbox-group-item.mjs.map +1 -1
  37. package/dist/checkbox-group/checkbox-group-label.d.mts +10 -0
  38. package/dist/checkbox-group/checkbox-group-label.d.mts.map +1 -1
  39. package/dist/checkbox-group/checkbox-group-label.mjs +2 -0
  40. package/dist/checkbox-group/checkbox-group-label.mjs.map +1 -1
  41. package/dist/checkbox-group/checkbox-group-parent.d.mts +19 -1
  42. package/dist/checkbox-group/checkbox-group-parent.d.mts.map +1 -1
  43. package/dist/checkbox-group/checkbox-group-parent.mjs +2 -0
  44. package/dist/checkbox-group/checkbox-group-parent.mjs.map +1 -1
  45. package/dist/checkbox-group/checkbox-group-root.d.mts +31 -4
  46. package/dist/checkbox-group/checkbox-group-root.d.mts.map +1 -1
  47. package/dist/checkbox-group/checkbox-group-root.mjs +6 -5
  48. package/dist/checkbox-group/checkbox-group-root.mjs.map +1 -1
  49. package/dist/checkbox-group/index.d.mts +2 -0
  50. package/dist/checkbox-group/index.d.mts.map +1 -1
  51. package/dist/checkbox-group/index.mjs +2 -0
  52. package/dist/checkbox-group/index.mjs.map +1 -1
  53. package/dist/combobox/combobox-clear.d.mts +18 -0
  54. package/dist/combobox/combobox-clear.d.mts.map +1 -1
  55. package/dist/combobox/combobox-clear.mjs +2 -0
  56. package/dist/combobox/combobox-clear.mjs.map +1 -1
  57. package/dist/combobox/combobox-context.mjs.map +1 -1
  58. package/dist/combobox/combobox-group.d.mts +49 -1
  59. package/dist/combobox/combobox-group.d.mts.map +1 -1
  60. package/dist/combobox/combobox-group.mjs +11 -1
  61. package/dist/combobox/combobox-group.mjs.map +1 -1
  62. package/dist/combobox/combobox-input.d.mts +18 -6
  63. package/dist/combobox/combobox-input.d.mts.map +1 -1
  64. package/dist/combobox/combobox-input.mjs +8 -5
  65. package/dist/combobox/combobox-input.mjs.map +1 -1
  66. package/dist/combobox/combobox-label.d.mts +18 -1
  67. package/dist/combobox/combobox-label.d.mts.map +1 -1
  68. package/dist/combobox/combobox-label.mjs +4 -1
  69. package/dist/combobox/combobox-label.mjs.map +1 -1
  70. package/dist/combobox/combobox-list.d.mts +14 -0
  71. package/dist/combobox/combobox-list.d.mts.map +1 -1
  72. package/dist/combobox/combobox-list.mjs +2 -0
  73. package/dist/combobox/combobox-list.mjs.map +1 -1
  74. package/dist/combobox/combobox-option.d.mts +25 -3
  75. package/dist/combobox/combobox-option.d.mts.map +1 -1
  76. package/dist/combobox/combobox-option.mjs +2 -0
  77. package/dist/combobox/combobox-option.mjs.map +1 -1
  78. package/dist/combobox/combobox-popup.d.mts +17 -1
  79. package/dist/combobox/combobox-popup.d.mts.map +1 -1
  80. package/dist/combobox/combobox-popup.mjs +5 -15
  81. package/dist/combobox/combobox-popup.mjs.map +1 -1
  82. package/dist/combobox/combobox-root.d.mts +49 -12
  83. package/dist/combobox/combobox-root.d.mts.map +1 -1
  84. package/dist/combobox/combobox-root.mjs +11 -80
  85. package/dist/combobox/combobox-root.mjs.map +1 -1
  86. package/dist/combobox/combobox-trigger.d.mts +26 -8
  87. package/dist/combobox/combobox-trigger.d.mts.map +1 -1
  88. package/dist/combobox/combobox-trigger.mjs +23 -17
  89. package/dist/combobox/combobox-trigger.mjs.map +1 -1
  90. package/dist/combobox/index.d.mts +4 -2
  91. package/dist/combobox/index.d.mts.map +1 -1
  92. package/dist/combobox/index.mjs +4 -2
  93. package/dist/combobox/index.mjs.map +1 -1
  94. package/dist/combobox/use-deferred-leave.mjs +105 -0
  95. package/dist/combobox/use-deferred-leave.mjs.map +1 -0
  96. package/dist/csp/csp-provider.d.mts +8 -0
  97. package/dist/csp/csp-provider.d.mts.map +1 -1
  98. package/dist/csp/csp-provider.mjs +2 -0
  99. package/dist/csp/csp-provider.mjs.map +1 -1
  100. package/dist/csp/style-hashes.d.mts +2 -0
  101. package/dist/csp/style-hashes.d.mts.map +1 -1
  102. package/dist/csp/style-hashes.mjs +2 -0
  103. package/dist/csp/style-hashes.mjs.map +1 -1
  104. package/dist/dialog/dialog-close.d.mts +18 -0
  105. package/dist/dialog/dialog-close.d.mts.map +1 -1
  106. package/dist/dialog/dialog-close.mjs +2 -0
  107. package/dist/dialog/dialog-close.mjs.map +1 -1
  108. package/dist/dialog/dialog-context.mjs.map +1 -1
  109. package/dist/dialog/dialog-description.d.mts +12 -0
  110. package/dist/dialog/dialog-description.d.mts.map +1 -1
  111. package/dist/dialog/dialog-description.mjs +2 -0
  112. package/dist/dialog/dialog-description.mjs.map +1 -1
  113. package/dist/dialog/dialog-form.d.mts +18 -1
  114. package/dist/dialog/dialog-form.d.mts.map +1 -1
  115. package/dist/dialog/dialog-form.mjs +2 -0
  116. package/dist/dialog/dialog-form.mjs.map +1 -1
  117. package/dist/dialog/dialog-popup.d.mts +25 -4
  118. package/dist/dialog/dialog-popup.d.mts.map +1 -1
  119. package/dist/dialog/dialog-popup.mjs +4 -2
  120. package/dist/dialog/dialog-popup.mjs.map +1 -1
  121. package/dist/dialog/dialog-root.d.mts +15 -1
  122. package/dist/dialog/dialog-root.d.mts.map +1 -1
  123. package/dist/dialog/dialog-root.mjs +2 -0
  124. package/dist/dialog/dialog-root.mjs.map +1 -1
  125. package/dist/dialog/dialog-title.d.mts +11 -0
  126. package/dist/dialog/dialog-title.d.mts.map +1 -1
  127. package/dist/dialog/dialog-title.mjs +2 -0
  128. package/dist/dialog/dialog-title.mjs.map +1 -1
  129. package/dist/dialog/dialog-trigger.d.mts +16 -0
  130. package/dist/dialog/dialog-trigger.d.mts.map +1 -1
  131. package/dist/dialog/dialog-trigger.mjs +2 -0
  132. package/dist/dialog/dialog-trigger.mjs.map +1 -1
  133. package/dist/dialog/index.d.mts +2 -0
  134. package/dist/dialog/index.d.mts.map +1 -1
  135. package/dist/dialog/index.mjs +2 -0
  136. package/dist/dialog/index.mjs.map +1 -1
  137. package/dist/docs/components/accordion.md +426 -0
  138. package/dist/docs/components/button.md +464 -0
  139. package/dist/docs/components/checkbox-group.md +474 -0
  140. package/dist/docs/components/checkbox.md +373 -0
  141. package/dist/docs/components/combobox.md +635 -0
  142. package/dist/docs/components/context-menu.md +524 -0
  143. package/dist/docs/components/dialog.md +686 -0
  144. package/dist/docs/components/field.md +587 -0
  145. package/dist/docs/components/menu.md +589 -0
  146. package/dist/docs/components/meter.md +313 -0
  147. package/dist/docs/components/number-field.md +528 -0
  148. package/dist/docs/components/popover.md +591 -0
  149. package/dist/docs/components/progress.md +450 -0
  150. package/dist/docs/components/radio-group.md +457 -0
  151. package/dist/docs/components/select.md +662 -0
  152. package/dist/docs/components/slider.md +558 -0
  153. package/dist/docs/components/switch.md +311 -0
  154. package/dist/docs/components/tabs.md +473 -0
  155. package/dist/docs/components/toast.md +576 -0
  156. package/dist/docs/components/toggle-group.md +341 -0
  157. package/dist/docs/components/toggle.md +245 -0
  158. package/dist/docs/components/toolbar.md +389 -0
  159. package/dist/docs/components/tooltip.md +494 -0
  160. package/dist/docs/concepts/action-props.md +251 -0
  161. package/dist/docs/concepts/ai-agents.md +56 -0
  162. package/dist/docs/concepts/browser-owned-state.md +118 -0
  163. package/dist/docs/concepts/content-security-policy.md +69 -0
  164. package/dist/docs/concepts/experimental.md +36 -0
  165. package/dist/docs/concepts/pending-and-optimistic.md +250 -0
  166. package/dist/docs/concepts/server-components.md +118 -0
  167. package/dist/docs/concepts/suspense.md +124 -0
  168. package/dist/docs/concepts/transitions.md +118 -0
  169. package/dist/docs/getting-started.md +115 -0
  170. package/dist/docs/index.md +181 -0
  171. package/dist/docs/roadmap.md +74 -0
  172. package/dist/docs/why.md +100 -0
  173. package/dist/field/field-control.d.mts +26 -3
  174. package/dist/field/field-control.d.mts.map +1 -1
  175. package/dist/field/field-control.mjs +2 -0
  176. package/dist/field/field-control.mjs.map +1 -1
  177. package/dist/field/field-description.d.mts +11 -0
  178. package/dist/field/field-description.d.mts.map +1 -1
  179. package/dist/field/field-description.mjs +2 -0
  180. package/dist/field/field-description.mjs.map +1 -1
  181. package/dist/field/field-error.d.mts +14 -2
  182. package/dist/field/field-error.d.mts.map +1 -1
  183. package/dist/field/field-error.mjs +2 -0
  184. package/dist/field/field-error.mjs.map +1 -1
  185. package/dist/field/field-label.d.mts +10 -0
  186. package/dist/field/field-label.d.mts.map +1 -1
  187. package/dist/field/field-label.mjs +2 -0
  188. package/dist/field/field-label.mjs.map +1 -1
  189. package/dist/field/field-root.d.mts +21 -2
  190. package/dist/field/field-root.d.mts.map +1 -1
  191. package/dist/field/field-root.mjs +2 -0
  192. package/dist/field/field-root.mjs.map +1 -1
  193. package/dist/field/index.d.mts +9 -0
  194. package/dist/field/index.d.mts.map +1 -1
  195. package/dist/field/index.mjs +9 -0
  196. package/dist/field/index.mjs.map +1 -1
  197. package/dist/form/form-root.d.mts +17 -1
  198. package/dist/form/form-root.d.mts.map +1 -1
  199. package/dist/form/form-root.mjs +3 -1
  200. package/dist/form/form-root.mjs.map +1 -1
  201. package/dist/form/form-submit.d.mts +18 -0
  202. package/dist/form/form-submit.d.mts.map +1 -1
  203. package/dist/form/form-submit.mjs +2 -0
  204. package/dist/form/form-submit.mjs.map +1 -1
  205. package/dist/form/index.d.mts +7 -0
  206. package/dist/form/index.d.mts.map +1 -1
  207. package/dist/form/index.mjs +7 -0
  208. package/dist/form/index.mjs.map +1 -1
  209. package/dist/index.d.mts +2 -1
  210. package/dist/internal/announce.mjs +12 -7
  211. package/dist/internal/announce.mjs.map +1 -1
  212. package/dist/internal/focus-first-invalid.mjs +2 -11
  213. package/dist/internal/focus-first-invalid.mjs.map +1 -1
  214. package/dist/internal/focus-visible.mjs +26 -0
  215. package/dist/internal/focus-visible.mjs.map +1 -0
  216. package/dist/internal/{invoker-press.mjs → invokers.mjs} +22 -5
  217. package/dist/internal/invokers.mjs.map +1 -0
  218. package/dist/internal/platform-attributes.d.mts +1 -1
  219. package/dist/internal/pointer-capture.mjs +1 -1
  220. package/dist/internal/pointer-capture.mjs.map +1 -1
  221. package/dist/internal/trigger-ref.mjs +1 -1
  222. package/dist/internal/trigger-ref.mjs.map +1 -1
  223. package/dist/internal/types.d.mts +3 -0
  224. package/dist/internal/types.d.mts.map +1 -1
  225. package/dist/internal/use-interest-dismiss.mjs +84 -0
  226. package/dist/internal/use-interest-dismiss.mjs.map +1 -0
  227. package/dist/internal/use-overlay-root.mjs.map +1 -1
  228. package/dist/internal/use-popover-popup.mjs +43 -108
  229. package/dist/internal/use-popover-popup.mjs.map +1 -1
  230. package/dist/internal/use-popover-trigger.d.mts +1 -0
  231. package/dist/internal/use-popover-trigger.d.mts.map +1 -1
  232. package/dist/internal/use-popover-trigger.mjs +29 -10
  233. package/dist/internal/use-popover-trigger.mjs.map +1 -1
  234. package/dist/internal/use-value-set.mjs +20 -0
  235. package/dist/internal/use-value-set.mjs.map +1 -0
  236. package/dist/internal/validity.d.mts +11 -0
  237. package/dist/internal/validity.d.mts.map +1 -1
  238. package/dist/internal/validity.mjs.map +1 -1
  239. package/dist/menu/index.d.mts +2 -0
  240. package/dist/menu/index.d.mts.map +1 -1
  241. package/dist/menu/index.mjs +2 -0
  242. package/dist/menu/index.mjs.map +1 -1
  243. package/dist/menu/menu-checkbox-item.d.mts +26 -2
  244. package/dist/menu/menu-checkbox-item.d.mts.map +1 -1
  245. package/dist/menu/menu-checkbox-item.mjs +2 -0
  246. package/dist/menu/menu-checkbox-item.mjs.map +1 -1
  247. package/dist/menu/menu-context-trigger.d.mts +24 -2
  248. package/dist/menu/menu-context-trigger.d.mts.map +1 -1
  249. package/dist/menu/menu-context-trigger.mjs +2 -0
  250. package/dist/menu/menu-context-trigger.mjs.map +1 -1
  251. package/dist/menu/menu-group.d.mts +36 -1
  252. package/dist/menu/menu-group.d.mts.map +1 -1
  253. package/dist/menu/menu-group.mjs +9 -1
  254. package/dist/menu/menu-group.mjs.map +1 -1
  255. package/dist/menu/menu-item.d.mts +23 -1
  256. package/dist/menu/menu-item.d.mts.map +1 -1
  257. package/dist/menu/menu-item.mjs +2 -0
  258. package/dist/menu/menu-item.mjs.map +1 -1
  259. package/dist/menu/menu-popup.d.mts +34 -9
  260. package/dist/menu/menu-popup.d.mts.map +1 -1
  261. package/dist/menu/menu-popup.mjs +15 -27
  262. package/dist/menu/menu-popup.mjs.map +1 -1
  263. package/dist/menu/menu-radio-group.d.mts +20 -1
  264. package/dist/menu/menu-radio-group.d.mts.map +1 -1
  265. package/dist/menu/menu-radio-group.mjs +2 -0
  266. package/dist/menu/menu-radio-group.mjs.map +1 -1
  267. package/dist/menu/menu-radio-item.d.mts +16 -0
  268. package/dist/menu/menu-radio-item.d.mts.map +1 -1
  269. package/dist/menu/menu-radio-item.mjs +2 -0
  270. package/dist/menu/menu-radio-item.mjs.map +1 -1
  271. package/dist/menu/menu-root.d.mts +22 -3
  272. package/dist/menu/menu-root.d.mts.map +1 -1
  273. package/dist/menu/menu-root.mjs +2 -0
  274. package/dist/menu/menu-root.mjs.map +1 -1
  275. package/dist/menu/menu-submenu-trigger.d.mts +21 -8
  276. package/dist/menu/menu-submenu-trigger.d.mts.map +1 -1
  277. package/dist/menu/menu-submenu-trigger.mjs +11 -10
  278. package/dist/menu/menu-submenu-trigger.mjs.map +1 -1
  279. package/dist/menu/menu-trigger.d.mts +23 -7
  280. package/dist/menu/menu-trigger.d.mts.map +1 -1
  281. package/dist/menu/menu-trigger.mjs +8 -12
  282. package/dist/menu/menu-trigger.mjs.map +1 -1
  283. package/dist/meter/index.d.mts +2 -0
  284. package/dist/meter/index.d.mts.map +1 -1
  285. package/dist/meter/index.mjs +2 -0
  286. package/dist/meter/index.mjs.map +1 -1
  287. package/dist/meter/meter-indicator.d.mts +11 -0
  288. package/dist/meter/meter-indicator.d.mts.map +1 -1
  289. package/dist/meter/meter-indicator.mjs +2 -0
  290. package/dist/meter/meter-indicator.mjs.map +1 -1
  291. package/dist/meter/meter-label.d.mts +11 -0
  292. package/dist/meter/meter-label.d.mts.map +1 -1
  293. package/dist/meter/meter-label.mjs +2 -0
  294. package/dist/meter/meter-label.mjs.map +1 -1
  295. package/dist/meter/meter-region.d.mts +5 -0
  296. package/dist/meter/meter-region.d.mts.map +1 -1
  297. package/dist/meter/meter-region.mjs.map +1 -1
  298. package/dist/meter/meter-root.d.mts +52 -10
  299. package/dist/meter/meter-root.d.mts.map +1 -1
  300. package/dist/meter/meter-root.mjs +2 -0
  301. package/dist/meter/meter-root.mjs.map +1 -1
  302. package/dist/meter/meter-track.d.mts +11 -0
  303. package/dist/meter/meter-track.d.mts.map +1 -1
  304. package/dist/meter/meter-track.mjs +2 -0
  305. package/dist/meter/meter-track.mjs.map +1 -1
  306. package/dist/meter/meter-value.d.mts +15 -1
  307. package/dist/meter/meter-value.d.mts.map +1 -1
  308. package/dist/meter/meter-value.mjs +2 -0
  309. package/dist/meter/meter-value.mjs.map +1 -1
  310. package/dist/number-field/index.d.mts +2 -0
  311. package/dist/number-field/index.d.mts.map +1 -1
  312. package/dist/number-field/index.mjs +2 -0
  313. package/dist/number-field/index.mjs.map +1 -1
  314. package/dist/number-field/number-field-decrement.d.mts +2 -0
  315. package/dist/number-field/number-field-decrement.d.mts.map +1 -1
  316. package/dist/number-field/number-field-decrement.mjs +2 -0
  317. package/dist/number-field/number-field-decrement.mjs.map +1 -1
  318. package/dist/number-field/number-field-increment.d.mts +2 -0
  319. package/dist/number-field/number-field-increment.d.mts.map +1 -1
  320. package/dist/number-field/number-field-increment.mjs +2 -0
  321. package/dist/number-field/number-field-increment.mjs.map +1 -1
  322. package/dist/number-field/number-field-input.d.mts +9 -0
  323. package/dist/number-field/number-field-input.d.mts.map +1 -1
  324. package/dist/number-field/number-field-input.mjs +2 -0
  325. package/dist/number-field/number-field-input.mjs.map +1 -1
  326. package/dist/number-field/number-field-label.d.mts +10 -0
  327. package/dist/number-field/number-field-label.d.mts.map +1 -1
  328. package/dist/number-field/number-field-label.mjs +2 -0
  329. package/dist/number-field/number-field-label.mjs.map +1 -1
  330. package/dist/number-field/number-field-root.d.mts +62 -14
  331. package/dist/number-field/number-field-root.d.mts.map +1 -1
  332. package/dist/number-field/number-field-root.mjs +3 -1
  333. package/dist/number-field/number-field-root.mjs.map +1 -1
  334. package/dist/number-field/use-step-button.d.mts +20 -0
  335. package/dist/number-field/use-step-button.d.mts.map +1 -1
  336. package/dist/number-field/use-step-button.mjs.map +1 -1
  337. package/dist/popover/index.d.mts +2 -0
  338. package/dist/popover/index.d.mts.map +1 -1
  339. package/dist/popover/index.mjs +2 -0
  340. package/dist/popover/index.mjs.map +1 -1
  341. package/dist/popover/popover-close.d.mts +21 -3
  342. package/dist/popover/popover-close.d.mts.map +1 -1
  343. package/dist/popover/popover-close.mjs +3 -1
  344. package/dist/popover/popover-close.mjs.map +1 -1
  345. package/dist/popover/popover-description.d.mts +12 -0
  346. package/dist/popover/popover-description.d.mts.map +1 -1
  347. package/dist/popover/popover-description.mjs +2 -0
  348. package/dist/popover/popover-description.mjs.map +1 -1
  349. package/dist/popover/popover-popup.d.mts +30 -4
  350. package/dist/popover/popover-popup.d.mts.map +1 -1
  351. package/dist/popover/popover-popup.mjs +2 -0
  352. package/dist/popover/popover-popup.mjs.map +1 -1
  353. package/dist/popover/popover-root.d.mts +9 -0
  354. package/dist/popover/popover-root.d.mts.map +1 -1
  355. package/dist/popover/popover-root.mjs +2 -0
  356. package/dist/popover/popover-root.mjs.map +1 -1
  357. package/dist/popover/popover-title.d.mts +11 -0
  358. package/dist/popover/popover-title.d.mts.map +1 -1
  359. package/dist/popover/popover-title.mjs +2 -0
  360. package/dist/popover/popover-title.mjs.map +1 -1
  361. package/dist/popover/popover-trigger.d.mts +24 -9
  362. package/dist/popover/popover-trigger.d.mts.map +1 -1
  363. package/dist/popover/popover-trigger.mjs +11 -9
  364. package/dist/popover/popover-trigger.mjs.map +1 -1
  365. package/dist/progress/index.d.mts +2 -0
  366. package/dist/progress/index.d.mts.map +1 -1
  367. package/dist/progress/index.mjs +2 -0
  368. package/dist/progress/index.mjs.map +1 -1
  369. package/dist/progress/progress-indicator.d.mts +11 -0
  370. package/dist/progress/progress-indicator.d.mts.map +1 -1
  371. package/dist/progress/progress-indicator.mjs +2 -0
  372. package/dist/progress/progress-indicator.mjs.map +1 -1
  373. package/dist/progress/progress-label.d.mts +11 -0
  374. package/dist/progress/progress-label.d.mts.map +1 -1
  375. package/dist/progress/progress-label.mjs +2 -0
  376. package/dist/progress/progress-label.mjs.map +1 -1
  377. package/dist/progress/progress-root.d.mts +36 -8
  378. package/dist/progress/progress-root.d.mts.map +1 -1
  379. package/dist/progress/progress-root.mjs +2 -0
  380. package/dist/progress/progress-root.mjs.map +1 -1
  381. package/dist/progress/progress-track.d.mts +11 -0
  382. package/dist/progress/progress-track.d.mts.map +1 -1
  383. package/dist/progress/progress-track.mjs +2 -0
  384. package/dist/progress/progress-track.mjs.map +1 -1
  385. package/dist/progress/progress-value.d.mts +15 -1
  386. package/dist/progress/progress-value.d.mts.map +1 -1
  387. package/dist/progress/progress-value.mjs +2 -0
  388. package/dist/progress/progress-value.mjs.map +1 -1
  389. package/dist/radio-group/index.d.mts +2 -0
  390. package/dist/radio-group/index.d.mts.map +1 -1
  391. package/dist/radio-group/index.mjs +2 -0
  392. package/dist/radio-group/index.mjs.map +1 -1
  393. package/dist/radio-group/radio-group-item.d.mts +18 -1
  394. package/dist/radio-group/radio-group-item.d.mts.map +1 -1
  395. package/dist/radio-group/radio-group-item.mjs +2 -0
  396. package/dist/radio-group/radio-group-item.mjs.map +1 -1
  397. package/dist/radio-group/radio-group-label.d.mts +10 -0
  398. package/dist/radio-group/radio-group-label.d.mts.map +1 -1
  399. package/dist/radio-group/radio-group-label.mjs +2 -0
  400. package/dist/radio-group/radio-group-label.mjs.map +1 -1
  401. package/dist/radio-group/radio-group-root.d.mts +29 -5
  402. package/dist/radio-group/radio-group-root.d.mts.map +1 -1
  403. package/dist/radio-group/radio-group-root.mjs +2 -0
  404. package/dist/radio-group/radio-group-root.mjs.map +1 -1
  405. package/dist/select/index.d.mts +2 -0
  406. package/dist/select/index.d.mts.map +1 -1
  407. package/dist/select/index.mjs +2 -0
  408. package/dist/select/index.mjs.map +1 -1
  409. package/dist/select/select-group-label.d.mts +10 -0
  410. package/dist/select/select-group-label.d.mts.map +1 -1
  411. package/dist/select/select-group-label.mjs +2 -0
  412. package/dist/select/select-group-label.mjs.map +1 -1
  413. package/dist/select/select-group.d.mts +15 -1
  414. package/dist/select/select-group.d.mts.map +1 -1
  415. package/dist/select/select-group.mjs +2 -0
  416. package/dist/select/select-group.mjs.map +1 -1
  417. package/dist/select/select-option.d.mts +19 -1
  418. package/dist/select/select-option.d.mts.map +1 -1
  419. package/dist/select/select-option.mjs +2 -0
  420. package/dist/select/select-option.mjs.map +1 -1
  421. package/dist/select/select-root.d.mts +24 -1
  422. package/dist/select/select-root.d.mts.map +1 -1
  423. package/dist/select/select-root.mjs +2 -0
  424. package/dist/select/select-root.mjs.map +1 -1
  425. package/dist/select/select-separator.d.mts +9 -0
  426. package/dist/select/select-separator.d.mts.map +1 -1
  427. package/dist/select/select-separator.mjs +2 -0
  428. package/dist/select/select-separator.mjs.map +1 -1
  429. package/dist/select/select-trigger.d.mts +9 -0
  430. package/dist/select/select-trigger.d.mts.map +1 -1
  431. package/dist/select/select-trigger.mjs +2 -0
  432. package/dist/select/select-trigger.mjs.map +1 -1
  433. package/dist/select/select-value.d.mts +9 -0
  434. package/dist/select/select-value.d.mts.map +1 -1
  435. package/dist/select/select-value.mjs +2 -0
  436. package/dist/select/select-value.mjs.map +1 -1
  437. package/dist/slider/index.d.mts +2 -0
  438. package/dist/slider/index.d.mts.map +1 -1
  439. package/dist/slider/index.mjs +2 -0
  440. package/dist/slider/index.mjs.map +1 -1
  441. package/dist/slider/slider-indicator.d.mts +12 -0
  442. package/dist/slider/slider-indicator.d.mts.map +1 -1
  443. package/dist/slider/slider-indicator.mjs +2 -0
  444. package/dist/slider/slider-indicator.mjs.map +1 -1
  445. package/dist/slider/slider-label.d.mts +11 -1
  446. package/dist/slider/slider-label.d.mts.map +1 -1
  447. package/dist/slider/slider-label.mjs +2 -0
  448. package/dist/slider/slider-label.mjs.map +1 -1
  449. package/dist/slider/slider-root.d.mts +53 -9
  450. package/dist/slider/slider-root.d.mts.map +1 -1
  451. package/dist/slider/slider-root.mjs +2 -0
  452. package/dist/slider/slider-root.mjs.map +1 -1
  453. package/dist/slider/slider-thumb.d.mts +32 -3
  454. package/dist/slider/slider-thumb.d.mts.map +1 -1
  455. package/dist/slider/slider-thumb.mjs +2 -0
  456. package/dist/slider/slider-thumb.mjs.map +1 -1
  457. package/dist/slider/slider-track.d.mts +17 -0
  458. package/dist/slider/slider-track.d.mts.map +1 -1
  459. package/dist/slider/slider-track.mjs +2 -0
  460. package/dist/slider/slider-track.mjs.map +1 -1
  461. package/dist/slider/slider-value.d.mts +11 -0
  462. package/dist/slider/slider-value.d.mts.map +1 -1
  463. package/dist/slider/slider-value.mjs +2 -0
  464. package/dist/slider/slider-value.mjs.map +1 -1
  465. package/dist/switch/switch.d.mts +23 -3
  466. package/dist/switch/switch.d.mts.map +1 -1
  467. package/dist/switch/switch.mjs +2 -0
  468. package/dist/switch/switch.mjs.map +1 -1
  469. package/dist/tabs/index.d.mts +2 -0
  470. package/dist/tabs/index.d.mts.map +1 -1
  471. package/dist/tabs/index.mjs +2 -0
  472. package/dist/tabs/index.mjs.map +1 -1
  473. package/dist/tabs/tabs-context.d.mts +5 -0
  474. package/dist/tabs/tabs-context.d.mts.map +1 -1
  475. package/dist/tabs/tabs-context.mjs.map +1 -1
  476. package/dist/tabs/tabs-indicator.d.mts +17 -0
  477. package/dist/tabs/tabs-indicator.d.mts.map +1 -1
  478. package/dist/tabs/tabs-indicator.mjs +2 -0
  479. package/dist/tabs/tabs-indicator.mjs.map +1 -1
  480. package/dist/tabs/tabs-list.d.mts +19 -1
  481. package/dist/tabs/tabs-list.d.mts.map +1 -1
  482. package/dist/tabs/tabs-list.mjs +2 -0
  483. package/dist/tabs/tabs-list.mjs.map +1 -1
  484. package/dist/tabs/tabs-panel.d.mts +19 -0
  485. package/dist/tabs/tabs-panel.d.mts.map +1 -1
  486. package/dist/tabs/tabs-panel.mjs +2 -0
  487. package/dist/tabs/tabs-panel.mjs.map +1 -1
  488. package/dist/tabs/tabs-root.d.mts +39 -5
  489. package/dist/tabs/tabs-root.d.mts.map +1 -1
  490. package/dist/tabs/tabs-root.mjs +2 -0
  491. package/dist/tabs/tabs-root.mjs.map +1 -1
  492. package/dist/tabs/tabs-tab.d.mts +22 -1
  493. package/dist/tabs/tabs-tab.d.mts.map +1 -1
  494. package/dist/tabs/tabs-tab.mjs +2 -0
  495. package/dist/tabs/tabs-tab.mjs.map +1 -1
  496. package/dist/toast/index.d.mts +2 -0
  497. package/dist/toast/index.d.mts.map +1 -1
  498. package/dist/toast/index.mjs +2 -0
  499. package/dist/toast/index.mjs.map +1 -1
  500. package/dist/toast/toast-action.d.mts +28 -3
  501. package/dist/toast/toast-action.d.mts.map +1 -1
  502. package/dist/toast/toast-action.mjs +2 -0
  503. package/dist/toast/toast-action.mjs.map +1 -1
  504. package/dist/toast/toast-close.d.mts +16 -0
  505. package/dist/toast/toast-close.d.mts.map +1 -1
  506. package/dist/toast/toast-close.mjs +2 -0
  507. package/dist/toast/toast-close.mjs.map +1 -1
  508. package/dist/toast/toast-description.d.mts +16 -1
  509. package/dist/toast/toast-description.d.mts.map +1 -1
  510. package/dist/toast/toast-description.mjs +2 -0
  511. package/dist/toast/toast-description.mjs.map +1 -1
  512. package/dist/toast/toast-root.d.mts +20 -0
  513. package/dist/toast/toast-root.d.mts.map +1 -1
  514. package/dist/toast/toast-root.mjs +2 -0
  515. package/dist/toast/toast-root.mjs.map +1 -1
  516. package/dist/toast/toast-title.d.mts +15 -1
  517. package/dist/toast/toast-title.d.mts.map +1 -1
  518. package/dist/toast/toast-title.mjs +2 -0
  519. package/dist/toast/toast-title.mjs.map +1 -1
  520. package/dist/toast/toast-viewport.d.mts +34 -5
  521. package/dist/toast/toast-viewport.d.mts.map +1 -1
  522. package/dist/toast/toast-viewport.mjs +6 -5
  523. package/dist/toast/toast-viewport.mjs.map +1 -1
  524. package/dist/toast/toast.d.mts +46 -6
  525. package/dist/toast/toast.d.mts.map +1 -1
  526. package/dist/toast/toast.mjs +4 -0
  527. package/dist/toast/toast.mjs.map +1 -1
  528. package/dist/toggle/toggle.d.mts +20 -2
  529. package/dist/toggle/toggle.d.mts.map +1 -1
  530. package/dist/toggle/toggle.mjs +2 -0
  531. package/dist/toggle/toggle.mjs.map +1 -1
  532. package/dist/toggle-group/index.d.mts +2 -0
  533. package/dist/toggle-group/index.d.mts.map +1 -1
  534. package/dist/toggle-group/index.mjs +2 -0
  535. package/dist/toggle-group/index.mjs.map +1 -1
  536. package/dist/toggle-group/toggle-group-context.d.mts +1 -0
  537. package/dist/toggle-group/toggle-group-context.d.mts.map +1 -1
  538. package/dist/toggle-group/toggle-group-context.mjs.map +1 -1
  539. package/dist/toggle-group/toggle-group-item.d.mts +16 -0
  540. package/dist/toggle-group/toggle-group-item.d.mts.map +1 -1
  541. package/dist/toggle-group/toggle-group-item.mjs +2 -0
  542. package/dist/toggle-group/toggle-group-item.mjs.map +1 -1
  543. package/dist/toggle-group/toggle-group-root.d.mts +73 -12
  544. package/dist/toggle-group/toggle-group-root.d.mts.map +1 -1
  545. package/dist/toggle-group/toggle-group-root.mjs +6 -5
  546. package/dist/toggle-group/toggle-group-root.mjs.map +1 -1
  547. package/dist/toolbar/index.d.mts +2 -0
  548. package/dist/toolbar/index.d.mts.map +1 -1
  549. package/dist/toolbar/index.mjs +2 -0
  550. package/dist/toolbar/index.mjs.map +1 -1
  551. package/dist/toolbar/toolbar-root.d.mts +30 -3
  552. package/dist/toolbar/toolbar-root.d.mts.map +1 -1
  553. package/dist/toolbar/toolbar-root.mjs +2 -0
  554. package/dist/toolbar/toolbar-root.mjs.map +1 -1
  555. package/dist/toolbar/toolbar-separator.d.mts +13 -0
  556. package/dist/toolbar/toolbar-separator.d.mts.map +1 -1
  557. package/dist/toolbar/toolbar-separator.mjs +2 -0
  558. package/dist/toolbar/toolbar-separator.mjs.map +1 -1
  559. package/dist/tooltip/index.d.mts +2 -0
  560. package/dist/tooltip/index.d.mts.map +1 -1
  561. package/dist/tooltip/index.mjs +2 -0
  562. package/dist/tooltip/index.mjs.map +1 -1
  563. package/dist/tooltip/tooltip-arrow.d.mts +16 -0
  564. package/dist/tooltip/tooltip-arrow.d.mts.map +1 -1
  565. package/dist/tooltip/tooltip-arrow.mjs +2 -0
  566. package/dist/tooltip/tooltip-arrow.mjs.map +1 -1
  567. package/dist/tooltip/tooltip-context.d.mts +4 -0
  568. package/dist/tooltip/tooltip-context.d.mts.map +1 -1
  569. package/dist/tooltip/tooltip-context.mjs.map +1 -1
  570. package/dist/tooltip/tooltip-popup.d.mts +24 -3
  571. package/dist/tooltip/tooltip-popup.d.mts.map +1 -1
  572. package/dist/tooltip/tooltip-popup.mjs +2 -0
  573. package/dist/tooltip/tooltip-popup.mjs.map +1 -1
  574. package/dist/tooltip/tooltip-root.d.mts +24 -2
  575. package/dist/tooltip/tooltip-root.d.mts.map +1 -1
  576. package/dist/tooltip/tooltip-root.mjs +2 -0
  577. package/dist/tooltip/tooltip-root.mjs.map +1 -1
  578. package/dist/tooltip/tooltip-trigger.d.mts +18 -1
  579. package/dist/tooltip/tooltip-trigger.d.mts.map +1 -1
  580. package/dist/tooltip/tooltip-trigger.mjs +2 -0
  581. package/dist/tooltip/tooltip-trigger.mjs.map +1 -1
  582. package/package.json +9 -1
  583. package/skills/funstack-ui-knowledge/SKILL.md +75 -0
  584. package/dist/internal/invoker-press.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/accordion/index.ts"],"sourcesContent":["// Ships the platform attribute typings with this subpath (conventions 7.4). Type-only: the\n// built JS has no import of it.\nimport \"../internal/platform-attributes.js\";\nimport { AccordionItem } from \"./accordion-item.js\";\nimport { AccordionPanel } from \"./accordion-panel.js\";\nimport { AccordionRoot } from \"./accordion-root.js\";\nimport { AccordionTrigger } from \"./accordion-trigger.js\";\n\n/**\n * Accordion built on `<details>`/`<summary>`: `Root` (div) > `Item` (details) > `Trigger`\n * (summary, first child) + `Panel` (div). JS-free when the Root has no value props; a transition\n * state owner with optimistic `data-open` and `data-pending` otherwise.\n */\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n Trigger: AccordionTrigger,\n Panel: AccordionPanel,\n} as const;\n\nexport type {\n AccordionRootProps,\n AccordionRootMultipleProps,\n AccordionRootExclusiveProps,\n AccordionRootState,\n AccordionValueChangeDetails,\n} from \"./accordion-root.js\";\nexport type { AccordionItemProps, AccordionItemState } from \"./accordion-item.js\";\nexport type { AccordionTriggerProps, AccordionTriggerState } from \"./accordion-trigger.js\";\nexport type { AccordionPanelProps, AccordionPanelState } from \"./accordion-panel.js\";\n"],"mappings":";;;;;;;;;;AAaA,MAAa,YAAY;CACvB,MAAM;CACN,MAAM;CACN,SAAS;CACT,OAAO;AACT"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/accordion/index.ts"],"sourcesContent":["// Ships the platform attribute typings with this subpath (conventions 7.4). Type-only: the\n// built JS has no import of it.\nimport \"../internal/platform-attributes.js\";\nimport { AccordionItem } from \"./accordion-item.js\";\nimport { AccordionPanel } from \"./accordion-panel.js\";\nimport { AccordionRoot } from \"./accordion-root.js\";\nimport { AccordionTrigger } from \"./accordion-trigger.js\";\n\n/**\n * Accordion built on `<details>`/`<summary>`: `Root` (div) > `Item` (details) > `Trigger`\n * (summary, first child) + `Panel` (div). JS-free when the Root has no value props; a transition\n * state owner with optimistic `data-open` and `data-pending` otherwise.\n *\n * @see https://ui.funstack.work/components/accordion\n */\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n Trigger: AccordionTrigger,\n Panel: AccordionPanel,\n} as const;\n\nexport type {\n AccordionRootProps,\n AccordionRootMultipleProps,\n AccordionRootExclusiveProps,\n AccordionRootState,\n AccordionValueChangeDetails,\n} from \"./accordion-root.js\";\nexport type { AccordionItemProps, AccordionItemState } from \"./accordion-item.js\";\nexport type { AccordionTriggerProps, AccordionTriggerState } from \"./accordion-trigger.js\";\nexport type { AccordionPanelProps, AccordionPanelState } from \"./accordion-panel.js\";\n"],"mappings":";;;;;;;;;;;;AAeA,MAAa,YAAY;CACvB,MAAM;CACN,MAAM;CACN,SAAS;CACT,OAAO;AACT"}
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import { install } from "@funstack/skill-installer";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ //#region src/bin/skill-installer.ts
6
+ const skillDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../skills/funstack-ui-knowledge");
7
+ console.log("Installing skill from:", skillDir);
8
+ await install(skillDir);
9
+ //#endregion
10
+ export {};
11
+
12
+ //# sourceMappingURL=skill-installer.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-installer.mjs","names":[],"sources":["../../src/bin/skill-installer.ts"],"sourcesContent":["#!/usr/bin/env node\n// `funstack-ui-skill-installer`: copies the funstack-ui-knowledge agent skill into the current\n// project, for the AI agent the user picks (`SKILL_INSTALL_PATH` skips the prompt).\nimport { install } from \"@funstack/skill-installer\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n// Resolved from this file (dist/bin/), so it works both from a local install and through\n// npx -p / pnpm dlx / yarn dlx.\nconst skillDir = path.resolve(\n path.dirname(fileURLToPath(import.meta.url)),\n \"../../skills/funstack-ui-knowledge\",\n);\n\nconsole.log(\"Installing skill from:\", skillDir);\n\nawait install(skillDir);\n"],"mappings":";;;;;AASA,MAAM,WAAW,KAAK,QACpB,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC,GAC3C,oCACF;AAEA,QAAQ,IAAI,0BAA0B,QAAQ;AAE9C,MAAM,QAAQ,QAAQ"}
@@ -3,6 +3,9 @@ import { CSSProperties, ComponentPropsWithRef, ReactNode, ViewTransitionClass }
3
3
  //#region src/button/button.d.ts
4
4
  /** Details passed to `Button`'s `action`. Serialisable; `event` is virtual (conventions 2.2). */
5
5
  export interface ButtonActionDetails extends ActionDetails {}
6
+ /**
7
+ * State of `Button`, passed to the function forms of `className`, `style`, `children` and `render`.
8
+ */
6
9
  export interface ButtonState {
7
10
  /**
8
11
  * This Button's own `action` is in flight, or a submission it started through its own
@@ -12,6 +15,11 @@ export interface ButtonState {
12
15
  /** The `disabled` prop. Not set by pending. */
13
16
  readonly disabled: boolean;
14
17
  }
18
+ /**
19
+ * Props of `Button`.
20
+ *
21
+ * @see https://ui.funstack.work/components/button
22
+ */
15
23
  export interface ButtonProps extends Omit<ComponentPropsWithRef<"button">, "onClick" | "aria-disabled" | "className" | "style" | "children" | "type" | "formAction"> {
16
24
  /**
17
25
  * Runs inside this Button's own transition on click, Enter or Space (`data-pending`
@@ -29,10 +37,11 @@ export interface ButtonProps extends Omit<ComponentPropsWithRef<"button">, "onCl
29
37
  */
30
38
  formAction?: ComponentPropsWithRef<"button">["formAction"];
31
39
  /**
32
- * Default `"button"`, or `"submit"` when `formAction` is given. Owned on a `<button>` and on a
33
- * component `render` element (set it here, not on the element; a component should spread it);
34
- * omitted for a host element of another tag (`<a>`). `action` together with
35
- * `"submit"` / `"reset"` warns in development: one click would do two things.
40
+ * Owned on a `<button>` and on a component `render` element (set it here, not on the element; a
41
+ * component should spread it); omitted for a host element of another tag (`<a>`). `action`
42
+ * together with `"submit"` / `"reset"` warns in development: one click would do two things.
43
+ *
44
+ * @defaultValue `"button"`, or `"submit"` when `formAction` is given
36
45
  */
37
46
  type?: "button" | "submit" | "reset";
38
47
  /**
@@ -40,13 +49,16 @@ export interface ButtonProps extends Omit<ComponentPropsWithRef<"button">, "onCl
40
49
  * Never dispatches. With `focusableWhenDisabled`, inside a `Toolbar.Root`, or when the
41
50
  * rendered element is not a host `<button>` (`render={<a href />}`, a component), renders
42
51
  * `aria-disabled="true"` instead.
52
+ *
53
+ * @defaultValue `false`
43
54
  */
44
55
  disabled?: boolean;
45
56
  /**
46
57
  * Keep a disabled Button focusable: `aria-disabled="true"` instead of native `disabled`, so
47
- * keyboard and screen-reader users still find it and a Tooltip on it still opens. Default
48
- * `false`; implied `true` inside a `Toolbar.Root` (APG Toolbar) and for a `render` element that
49
- * is not a host `<button>`.
58
+ * keyboard and screen-reader users still find it and a Tooltip on it still opens.
59
+ *
60
+ * @defaultValue `false`; implied `true` inside a `Toolbar.Root` (APG Toolbar) and for a `render`
61
+ * element that is not a host `<button>`
50
62
  */
51
63
  focusableWhenDisabled?: boolean;
52
64
  /**
@@ -57,9 +69,13 @@ export interface ButtonProps extends Omit<ComponentPropsWithRef<"button">, "onCl
57
69
  * page cross-fade that the next transition waits for).
58
70
  */
59
71
  transition?: ViewTransitionClass;
72
+ /** Class name, or a function of the part's state that returns one. */
60
73
  className?: StateValue<string | undefined, ButtonState>;
74
+ /** Inline style, or a function of the part's state that returns one. */
61
75
  style?: StateValue<CSSProperties | undefined, ButtonState>;
76
+ /** Content, or a function of the part's state. */
62
77
  children?: StateValue<ReactNode, ButtonState>;
78
+ /** Replace the default `<button>` (element form) or take over rendering (function form). */
63
79
  render?: RenderProp<ComponentPropsWithRef<"button">, ButtonState>;
64
80
  }
65
81
  /**
@@ -71,6 +87,8 @@ export interface ButtonProps extends Omit<ComponentPropsWithRef<"button">, "onCl
71
87
  *
72
88
  * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `aria-disabled`,
73
89
  * `data-pending`, `data-disabled`, `onClick`.
90
+ *
91
+ * @see https://ui.funstack.work/components/button
74
92
  */
75
93
  export declare function Button({ action, formAction, type, disabled, focusableWhenDisabled, transition, className, style, children, render, ...rest }: ButtonProps): ReactNode;
76
94
  export declare namespace Button {
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.mts","names":[],"sources":["../../src/button/button.tsx"],"mappings":";;;;iBAsBiB,4BAA4B;iBAE5B;;;;;WAKN;;WAEA;;iBAGM,oBAAoB,KACnC;;;;;;;EASA,SAAS,QAAQ,SAAS;;;;;;;;EAQ1B,aAAa;;;;;;;EAOb;;;;;;;EAOA;;;;;;;EAOA;;;;;;;;EAQA,aAAa;EACb,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;EAC9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;wBAavC,SACd,QACA,YACA,MACA,UACA,uBACA,YACA,WACA,OACA,UACA,WACG,QACF,cAAW;yBAZE"}
1
+ {"version":3,"file":"button.d.mts","names":[],"sources":["../../src/button/button.tsx"],"mappings":";;;;iBAsBiB,4BAA4B;;;;iBAK5B;;;;;WAKN;;WAEA;;;;;;;iBAQM,oBAAoB,KACnC;;;;;;;EASA,SAAS,QAAQ,SAAS;;;;;;;;EAQ1B,aAAa;;;;;;;;EAQb;;;;;;;;;EASA;;;;;;;;EAQA;;;;;;;;EAQA,aAAa;;EAEb,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;wBAevC,SACd,QACA,YACA,MACA,UACA,uBACA,YACA,WACA,OACA,UACA,WACG,QACF,cAAW;yBAZE"}
@@ -20,6 +20,8 @@ const isDev = process.env.NODE_ENV !== "production";
20
20
  *
21
21
  * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `aria-disabled`,
22
22
  * `data-pending`, `data-disabled`, `onClick`.
23
+ *
24
+ * @see https://ui.funstack.work/components/button
23
25
  */
24
26
  function Button({ action, formAction, type, disabled = false, focusableWhenDisabled = false, transition, className, style, children, render, ...rest }) {
25
27
  const toolbar = useToolbarContext();
@@ -1 +1 @@
1
- {"version":3,"file":"button.mjs","names":[],"sources":["../../src/button/button.tsx"],"sourcesContent":["\"use client\";\nimport { useRef } from \"react\";\nimport type {\n ComponentPropsWithRef,\n CSSProperties,\n MouseEvent,\n ReactNode,\n ViewTransitionClass,\n} from \"react\";\nimport { useFormStatus } from \"react-dom\";\nimport { createActionDetails } from \"../internal/action-details.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { useToolbarContext } from \"../internal/toolbar-context.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport type { Action, ActionDetails, RenderProp, StateValue } from \"../internal/types.js\";\nimport { useActionTrigger } from \"../internal/use-action-trigger.js\";\nimport { useDevWarning } from \"../internal/use-dev-warning.js\";\nimport { isHostButton, rendersButton, useRender } from \"../internal/use-render.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/** Details passed to `Button`'s `action`. Serialisable; `event` is virtual (conventions 2.2). */\nexport interface ButtonActionDetails extends ActionDetails {}\n\nexport interface ButtonState {\n /**\n * This Button's own `action` is in flight, or a submission it started through its own\n * function `formAction` is pending.\n */\n readonly pending: boolean;\n /** The `disabled` prop. Not set by pending. */\n readonly disabled: boolean;\n}\n\nexport interface ButtonProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n \"onClick\" | \"aria-disabled\" | \"className\" | \"style\" | \"children\" | \"type\" | \"formAction\"\n> {\n /**\n * Runs inside this Button's own transition on click, Enter or Space (`data-pending`\n * meanwhile). Sync or async; may be a Server Function. A rejection reaches the nearest Error\n * Boundary above the Button. While it is pending the Button ignores further activation and\n * renders `aria-disabled=\"true\"`. Not combinable with `formAction` (development error).\n */\n action?: Action<[details: ButtonActionDetails]>;\n /**\n * React's `formAction`: a function (a Server Function, a `useActionState` dispatch, a client\n * function) or a URL, run by React instead of the form's `action` when this Button submits the\n * form. With a function, the Button is `pending` while its own submission runs (not while\n * another submitter's does), ignores further activation meanwhile, and defaults to\n * `type=\"submit\"`.\n */\n formAction?: ComponentPropsWithRef<\"button\">[\"formAction\"];\n /**\n * Default `\"button\"`, or `\"submit\"` when `formAction` is given. Owned on a `<button>` and on a\n * component `render` element (set it here, not on the element; a component should spread it);\n * omitted for a host element of another tag (`<a>`). `action` together with\n * `\"submit\"` / `\"reset\"` warns in development: one click would do two things.\n */\n type?: \"button\" | \"submit\" | \"reset\";\n /**\n * Native `disabled` (owned; a `render` element cannot re-enable it) and `data-disabled`.\n * Never dispatches. With `focusableWhenDisabled`, inside a `Toolbar.Root`, or when the\n * rendered element is not a host `<button>` (`render={<a href />}`, a component), renders\n * `aria-disabled=\"true\"` instead.\n */\n disabled?: boolean;\n /**\n * Keep a disabled Button focusable: `aria-disabled=\"true\"` instead of native `disabled`, so\n * keyboard and screen-reader users still find it and a Tooltip on it still opens. Default\n * `false`; implied `true` inside a `Toolbar.Root` (APG Toolbar) and for a `render` element that\n * is not a host `<button>`.\n */\n focusableWhenDisabled?: boolean;\n /**\n * Forwarded as `default` to the Button's `<ViewTransition>`: animates the commit that ends the\n * action (content keyed on `pending`), not a click.\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n className?: StateValue<string | undefined, ButtonState>;\n style?: StateValue<CSSProperties | undefined, ButtonState>;\n children?: StateValue<ReactNode, ButtonState>;\n render?: RenderProp<ComponentPropsWithRef<\"button\">, ButtonState>;\n}\n\n/**\n * A button whose click is a transition (design/components/button.md): `<button type=\"button\">`\n * that runs `action` in its own transition, with `data-pending` and `aria-disabled=\"true\"` while\n * it runs, and ignores further activation meanwhile (conventions 2.5). With a function\n * `formAction` it is a form submitter with its own per-submitter pending. Inside a\n * `Toolbar.Root` a disabled Button stays focusable (`aria-disabled`).\n *\n * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `aria-disabled`,\n * `data-pending`, `data-disabled`, `onClick`.\n */\nexport function Button({\n action,\n formAction,\n type,\n disabled = false,\n focusableWhenDisabled = false,\n transition,\n className,\n style,\n children,\n render,\n ...rest\n}: ButtonProps) {\n const toolbar = useToolbarContext();\n // Not a host <button> (a link, a component): native `disabled` would mean nothing to the\n // browser and hide the state from AT, so the focusable-disabled branch.\n const focusable = focusableWhenDisabled || toolbar !== null || !isHostButton(render);\n const { pending: ownPending, run } = useActionTrigger();\n\n // Per-submitter pending (design 6.2): React reports the submitter's function as\n // `status.action`. `submittedWith` keeps the function this Button last submitted with, so an\n // inline `formAction` whose identity changes during the submission still matches.\n const status = useFormStatus();\n const submittedWith = useRef<unknown>(undefined);\n const formPending =\n status.pending &&\n typeof formAction === \"function\" &&\n // Written only by the click handler, before the submission whose status this render shows,\n // so the render that reads it is never stale for that submission.\n // oxlint-disable-next-line react/refs\n (status.action === formAction || status.action === submittedWith.current);\n const pending = ownPending || formPending;\n\n useDevWarning(\n action !== undefined && formAction !== undefined,\n isDev &&\n \"Button: `action` and `formAction` were both given. One click would run two actions; the \" +\n \"Button runs `action` and leaves `formAction` to the form submission. Pass one of them.\",\n );\n useDevWarning(\n action !== undefined && (type === \"submit\" || type === \"reset\"),\n isDev &&\n `Button: \\`action\\` together with type=\"${type}\". One click would run \\`action\\` in a ` +\n `transition and ${type === \"reset\" ? \"reset\" : \"submit\"} the form. Use \\`formAction\\` ` +\n `for a submitter, or drop \\`type\\`.`,\n );\n\n const state: ButtonState = { pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"button\">, ButtonState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n style,\n children,\n props: formAction === undefined ? rest : { ...rest, formAction },\n libraryProps: {\n ...(rendersButton(render) && {\n type: type ?? (formAction !== undefined ? \"submit\" : \"button\"),\n }),\n // `undefined` (not `false`) in the focusable case, so the owned key removes a render\n // element's `disabled` too.\n disabled: disabled && !focusable ? true : undefined,\n \"aria-disabled\": pending || (disabled && focusable) ? true : undefined,\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n onClick: (event: MouseEvent<HTMLButtonElement>) => {\n // `event.defaultPrevented` is never read: an outer part (`Dialog.Trigger`) cancels the\n // click as part of its own mechanism and the Button must still run (design 5.1).\n if (disabled) {\n // A disabled link must not navigate either.\n event.preventDefault();\n return;\n }\n if (action === undefined) {\n // A native button (a `formAction` submitter, a command, a link): only the guard.\n if (formPending) {\n event.preventDefault();\n return;\n }\n submittedWith.current = formAction;\n return;\n }\n const details: ButtonActionDetails = createActionDetails(event.nativeEvent, {});\n // Ignored while pending: do not navigate, submit or run a command either.\n if (!run(() => action(details))) event.preventDefault();\n },\n },\n });\n\n return useTransitionBoundary(\"Button\", transition, element);\n}\n\nButton.displayName = \"Button\";\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;;;;;;;;;;AA+EvC,SAAgB,OAAO,EACrB,QACA,YACA,MACA,WAAW,OACX,wBAAwB,OACxB,YACA,WACA,OACA,UACA,QACA,GAAG,QACW;CACd,MAAM,UAAU,kBAAkB;CAGlC,MAAM,YAAY,yBAAyB,YAAY,QAAQ,CAAC,aAAa,MAAM;CACnF,MAAM,EAAE,SAAS,YAAY,QAAQ,iBAAiB;CAKtD,MAAM,SAAS,cAAc;CAC7B,MAAM,gBAAgB,OAAgB,KAAA,CAAS;CAC/C,MAAM,cACJ,OAAO,WACP,OAAO,eAAe,eAIrB,OAAO,WAAW,cAAc,OAAO,WAAW,cAAc;CACnE,MAAM,UAAU,cAAc;CAE9B,cACE,WAAW,KAAA,KAAa,eAAe,KAAA,GACvC,SACE,gLAEJ;CACA,cACE,WAAW,KAAA,MAAc,SAAS,YAAY,SAAS,UACvD,SACE,0CAA0C,KAAK,wDAC3B,SAAS,UAAU,UAAU,SAAS,iEAE9D;CAIA,MAAM,UAAU,UAAwD;EACtE,gBAAgB;EAChB;EACA,OAAA;GAL2B;GAAS;EAKhC;EACJ;EACA;EACA;EACA,OAAO,eAAe,KAAA,IAAY,OAAO;GAAE,GAAG;GAAM;EAAW;EAC/D,cAAc;GACZ,GAAI,cAAc,MAAM,KAAK,EAC3B,MAAM,SAAS,eAAe,KAAA,IAAY,WAAW,UACvD;GAGA,UAAU,YAAY,CAAC,YAAY,OAAO,KAAA;GAC1C,iBAAiB,WAAY,YAAY,YAAa,OAAO,KAAA;GAC7D,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;GAClC,UAAU,UAAyC;IAGjD,IAAI,UAAU;KAEZ,MAAM,eAAe;KACrB;IACF;IACA,IAAI,WAAW,KAAA,GAAW;KAExB,IAAI,aAAa;MACf,MAAM,eAAe;MACrB;KACF;KACA,cAAc,UAAU;KACxB;IACF;IACA,MAAM,UAA+B,oBAAoB,MAAM,aAAa,CAAC,CAAC;IAE9E,IAAI,CAAC,UAAU,OAAO,OAAO,CAAC,GAAG,MAAM,eAAe;GACxD;EACF;CACF,CAAC;CAED,OAAO,sBAAsB,UAAU,YAAY,OAAO;AAC5D;AAEA,OAAO,cAAc"}
1
+ {"version":3,"file":"button.mjs","names":[],"sources":["../../src/button/button.tsx"],"sourcesContent":["\"use client\";\nimport { useRef } from \"react\";\nimport type {\n ComponentPropsWithRef,\n CSSProperties,\n MouseEvent,\n ReactNode,\n ViewTransitionClass,\n} from \"react\";\nimport { useFormStatus } from \"react-dom\";\nimport { createActionDetails } from \"../internal/action-details.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { useToolbarContext } from \"../internal/toolbar-context.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport type { Action, ActionDetails, RenderProp, StateValue } from \"../internal/types.js\";\nimport { useActionTrigger } from \"../internal/use-action-trigger.js\";\nimport { useDevWarning } from \"../internal/use-dev-warning.js\";\nimport { isHostButton, rendersButton, useRender } from \"../internal/use-render.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/** Details passed to `Button`'s `action`. Serialisable; `event` is virtual (conventions 2.2). */\nexport interface ButtonActionDetails extends ActionDetails {}\n\n/**\n * State of `Button`, passed to the function forms of `className`, `style`, `children` and `render`.\n */\nexport interface ButtonState {\n /**\n * This Button's own `action` is in flight, or a submission it started through its own\n * function `formAction` is pending.\n */\n readonly pending: boolean;\n /** The `disabled` prop. Not set by pending. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `Button`.\n *\n * @see https://ui.funstack.work/components/button\n */\nexport interface ButtonProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n \"onClick\" | \"aria-disabled\" | \"className\" | \"style\" | \"children\" | \"type\" | \"formAction\"\n> {\n /**\n * Runs inside this Button's own transition on click, Enter or Space (`data-pending`\n * meanwhile). Sync or async; may be a Server Function. A rejection reaches the nearest Error\n * Boundary above the Button. While it is pending the Button ignores further activation and\n * renders `aria-disabled=\"true\"`. Not combinable with `formAction` (development error).\n */\n action?: Action<[details: ButtonActionDetails]>;\n /**\n * React's `formAction`: a function (a Server Function, a `useActionState` dispatch, a client\n * function) or a URL, run by React instead of the form's `action` when this Button submits the\n * form. With a function, the Button is `pending` while its own submission runs (not while\n * another submitter's does), ignores further activation meanwhile, and defaults to\n * `type=\"submit\"`.\n */\n formAction?: ComponentPropsWithRef<\"button\">[\"formAction\"];\n /**\n * Owned on a `<button>` and on a component `render` element (set it here, not on the element; a\n * component should spread it); omitted for a host element of another tag (`<a>`). `action`\n * together with `\"submit\"` / `\"reset\"` warns in development: one click would do two things.\n *\n * @defaultValue `\"button\"`, or `\"submit\"` when `formAction` is given\n */\n type?: \"button\" | \"submit\" | \"reset\";\n /**\n * Native `disabled` (owned; a `render` element cannot re-enable it) and `data-disabled`.\n * Never dispatches. With `focusableWhenDisabled`, inside a `Toolbar.Root`, or when the\n * rendered element is not a host `<button>` (`render={<a href />}`, a component), renders\n * `aria-disabled=\"true\"` instead.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Keep a disabled Button focusable: `aria-disabled=\"true\"` instead of native `disabled`, so\n * keyboard and screen-reader users still find it and a Tooltip on it still opens.\n *\n * @defaultValue `false`; implied `true` inside a `Toolbar.Root` (APG Toolbar) and for a `render`\n * element that is not a host `<button>`\n */\n focusableWhenDisabled?: boolean;\n /**\n * Forwarded as `default` to the Button's `<ViewTransition>`: animates the commit that ends the\n * action (content keyed on `pending`), not a click.\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, ButtonState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, ButtonState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, ButtonState>;\n /** Replace the default `<button>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, ButtonState>;\n}\n\n/**\n * A button whose click is a transition (design/components/button.md): `<button type=\"button\">`\n * that runs `action` in its own transition, with `data-pending` and `aria-disabled=\"true\"` while\n * it runs, and ignores further activation meanwhile (conventions 2.5). With a function\n * `formAction` it is a form submitter with its own per-submitter pending. Inside a\n * `Toolbar.Root` a disabled Button stays focusable (`aria-disabled`).\n *\n * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `aria-disabled`,\n * `data-pending`, `data-disabled`, `onClick`.\n *\n * @see https://ui.funstack.work/components/button\n */\nexport function Button({\n action,\n formAction,\n type,\n disabled = false,\n focusableWhenDisabled = false,\n transition,\n className,\n style,\n children,\n render,\n ...rest\n}: ButtonProps) {\n const toolbar = useToolbarContext();\n // Not a host <button> (a link, a component): native `disabled` would mean nothing to the\n // browser and hide the state from AT, so the focusable-disabled branch.\n const focusable = focusableWhenDisabled || toolbar !== null || !isHostButton(render);\n const { pending: ownPending, run } = useActionTrigger();\n\n // Per-submitter pending (design 6.2): React reports the submitter's function as\n // `status.action`. `submittedWith` keeps the function this Button last submitted with, so an\n // inline `formAction` whose identity changes during the submission still matches.\n const status = useFormStatus();\n const submittedWith = useRef<unknown>(undefined);\n const formPending =\n status.pending &&\n typeof formAction === \"function\" &&\n // Written only by the click handler, before the submission whose status this render shows,\n // so the render that reads it is never stale for that submission.\n // oxlint-disable-next-line react/refs\n (status.action === formAction || status.action === submittedWith.current);\n const pending = ownPending || formPending;\n\n useDevWarning(\n action !== undefined && formAction !== undefined,\n isDev &&\n \"Button: `action` and `formAction` were both given. One click would run two actions; the \" +\n \"Button runs `action` and leaves `formAction` to the form submission. Pass one of them.\",\n );\n useDevWarning(\n action !== undefined && (type === \"submit\" || type === \"reset\"),\n isDev &&\n `Button: \\`action\\` together with type=\"${type}\". One click would run \\`action\\` in a ` +\n `transition and ${type === \"reset\" ? \"reset\" : \"submit\"} the form. Use \\`formAction\\` ` +\n `for a submitter, or drop \\`type\\`.`,\n );\n\n const state: ButtonState = { pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"button\">, ButtonState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n style,\n children,\n props: formAction === undefined ? rest : { ...rest, formAction },\n libraryProps: {\n ...(rendersButton(render) && {\n type: type ?? (formAction !== undefined ? \"submit\" : \"button\"),\n }),\n // `undefined` (not `false`) in the focusable case, so the owned key removes a render\n // element's `disabled` too.\n disabled: disabled && !focusable ? true : undefined,\n \"aria-disabled\": pending || (disabled && focusable) ? true : undefined,\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n onClick: (event: MouseEvent<HTMLButtonElement>) => {\n // `event.defaultPrevented` is never read: an outer part (`Dialog.Trigger`) cancels the\n // click as part of its own mechanism and the Button must still run (design 5.1).\n if (disabled) {\n // A disabled link must not navigate either.\n event.preventDefault();\n return;\n }\n if (action === undefined) {\n // A native button (a `formAction` submitter, a command, a link): only the guard.\n if (formPending) {\n event.preventDefault();\n return;\n }\n submittedWith.current = formAction;\n return;\n }\n const details: ButtonActionDetails = createActionDetails(event.nativeEvent, {});\n // Ignored while pending: do not navigate, submit or run a command either.\n if (!run(() => action(details))) event.preventDefault();\n },\n },\n });\n\n return useTransitionBoundary(\"Button\", transition, element);\n}\n\nButton.displayName = \"Button\";\n"],"mappings":";;;;;;;;;;;;AAmBA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;;;;;;;;;;;;AAiGvC,SAAgB,OAAO,EACrB,QACA,YACA,MACA,WAAW,OACX,wBAAwB,OACxB,YACA,WACA,OACA,UACA,QACA,GAAG,QACW;CACd,MAAM,UAAU,kBAAkB;CAGlC,MAAM,YAAY,yBAAyB,YAAY,QAAQ,CAAC,aAAa,MAAM;CACnF,MAAM,EAAE,SAAS,YAAY,QAAQ,iBAAiB;CAKtD,MAAM,SAAS,cAAc;CAC7B,MAAM,gBAAgB,OAAgB,KAAA,CAAS;CAC/C,MAAM,cACJ,OAAO,WACP,OAAO,eAAe,eAIrB,OAAO,WAAW,cAAc,OAAO,WAAW,cAAc;CACnE,MAAM,UAAU,cAAc;CAE9B,cACE,WAAW,KAAA,KAAa,eAAe,KAAA,GACvC,SACE,gLAEJ;CACA,cACE,WAAW,KAAA,MAAc,SAAS,YAAY,SAAS,UACvD,SACE,0CAA0C,KAAK,wDAC3B,SAAS,UAAU,UAAU,SAAS,iEAE9D;CAIA,MAAM,UAAU,UAAwD;EACtE,gBAAgB;EAChB;EACA,OAAA;GAL2B;GAAS;EAKhC;EACJ;EACA;EACA;EACA,OAAO,eAAe,KAAA,IAAY,OAAO;GAAE,GAAG;GAAM;EAAW;EAC/D,cAAc;GACZ,GAAI,cAAc,MAAM,KAAK,EAC3B,MAAM,SAAS,eAAe,KAAA,IAAY,WAAW,UACvD;GAGA,UAAU,YAAY,CAAC,YAAY,OAAO,KAAA;GAC1C,iBAAiB,WAAY,YAAY,YAAa,OAAO,KAAA;GAC7D,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;GAClC,UAAU,UAAyC;IAGjD,IAAI,UAAU;KAEZ,MAAM,eAAe;KACrB;IACF;IACA,IAAI,WAAW,KAAA,GAAW;KAExB,IAAI,aAAa;MACf,MAAM,eAAe;MACrB;KACF;KACA,cAAc,UAAU;KACxB;IACF;IACA,MAAM,UAA+B,oBAAoB,MAAM,aAAa,CAAC,CAAC;IAE9E,IAAI,CAAC,UAAU,OAAO,OAAO,CAAC,GAAG,MAAM,eAAe;GACxD;EACF;CACF,CAAC;CAED,OAAO,sBAAsB,UAAU,YAAY,OAAO;AAC5D;AAEA,OAAO,cAAc"}
@@ -1,6 +1,7 @@
1
1
  import { ActionDetails, ChangeAction, ChangeReason, RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { CSSProperties, ComponentPropsWithRef, ViewTransitionClass } from "react";
3
3
  //#region src/checkbox/checkbox.d.ts
4
+ /** State of `Checkbox`, passed to the function forms of `className`, `style` and `render`. */
4
5
  export interface CheckboxState {
5
6
  /** Optimistic checked state: what the user sees, including an in-flight change. */
6
7
  readonly checked: boolean;
@@ -24,12 +25,19 @@ export interface CheckboxCheckedChangeDetails extends ActionDetails {
24
25
  */
25
26
  readonly reason: ChangeReason;
26
27
  }
28
+ /**
29
+ * Props of `Checkbox`.
30
+ *
31
+ * @see https://ui.funstack.work/components/checkbox
32
+ */
27
33
  export interface CheckboxProps extends Omit<ComponentPropsWithRef<"input">, "type" | "checked" | "defaultChecked" | "onChange" | "aria-checked" | "className" | "style" | "children"> {
28
34
  /** Controlled checked state. `undefined` means uncontrolled. */
29
35
  checked?: boolean;
30
36
  /**
31
- * Initial checked state in uncontrolled mode (default `false`). Also the value a form reset
37
+ * Initial checked state in uncontrolled mode. Also the value a form reset
32
38
  * returns to: the latest prop value is mirrored into the input's `defaultChecked`.
39
+ *
40
+ * @defaultValue `false`
33
41
  */
34
42
  defaultChecked?: boolean;
35
43
  /**
@@ -38,6 +46,8 @@ export interface CheckboxProps extends Omit<ComponentPropsWithRef<"input">, "typ
38
46
  * `data-indeterminate` and `:indeterminate`, except while an action is pending. Clicking a
39
47
  * mixed box dispatches `checked: true` (for the usual unchecked + mixed representation). Does
40
48
  * not affect what the form submits.
49
+ *
50
+ * @defaultValue `false`
41
51
  */
42
52
  indeterminate?: boolean;
43
53
  /**
@@ -50,9 +60,17 @@ export interface CheckboxProps extends Omit<ComponentPropsWithRef<"input">, "typ
50
60
  * unsupported here; use controlled mode to veto a change.
51
61
  */
52
62
  checkedChangeAction?: ChangeAction<boolean, CheckboxCheckedChangeDetails>;
53
- /** Renders a natively disabled input; never dispatches. Default `false`. */
63
+ /**
64
+ * Renders a natively disabled input; never dispatches.
65
+ *
66
+ * @defaultValue `false`
67
+ */
54
68
  disabled?: boolean;
55
- /** Submitted as the input's value when checked. Default `"on"` (platform). */
69
+ /**
70
+ * Submitted as the input's value when checked.
71
+ *
72
+ * @defaultValue `"on"` (platform)
73
+ */
56
74
  value?: string;
57
75
  /**
58
76
  * Forwarded as `default` to the Checkbox's `<ViewTransition>`. Default: no boundary. Animates the
@@ -63,7 +81,9 @@ export interface CheckboxProps extends Omit<ComponentPropsWithRef<"input">, "typ
63
81
  * page cross-fade that the next transition waits for).
64
82
  */
65
83
  transition?: ViewTransitionClass;
84
+ /** Class name, or a function of the part's state that returns one. */
66
85
  className?: StateValue<string | undefined, CheckboxState>;
86
+ /** Inline style, or a function of the part's state that returns one. */
67
87
  style?: StateValue<CSSProperties | undefined, CheckboxState>;
68
88
  /**
69
89
  * Replace the rendered element (element form) or take over rendering (function form). Must keep
@@ -84,6 +104,8 @@ export interface CheckboxProps extends Omit<ComponentPropsWithRef<"input">, "typ
84
104
  * are merged rather than owned: a `render` element's own `onChange` (or `onClick`) runs first,
85
105
  * then the library's; an `onClick` that calls `preventDefault()` cancels the change (nothing is
86
106
  * dispatched).
107
+ *
108
+ * @see https://ui.funstack.work/components/checkbox
87
109
  */
88
110
  export declare function Checkbox({ checked, defaultChecked, indeterminate, checkedChangeAction, disabled, transition, className, style, render, ...rest }: CheckboxProps): import("react").ReactNode;
89
111
  export declare namespace Checkbox {
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.d.mts","names":[],"sources":["../../src/checkbox/checkbox.tsx"],"mappings":";;;iBAciB;;WAEN;;;;;WAKA;;WAEA;;WAEA;;;iBAIM,qCAAqC;;;;;;;WAO3C,QAAQ;;iBAGF,sBAAsB,KACrC;;EAWA;;;;;EAKA;;;;;;;;EAQA;;;;;;;;;;EAUA,sBAAsB,sBAAsB;;EAE5C;;EAEA;;;;;;;;;EASA,aAAa;EACb,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;;;;EAK9C,SAAS,WAAW,gCAAgC;;;;;;;;;;;;;;;;wBAiBtC,WACd,SACA,gBACA,eACA,qBACA,UACA,YACA,WACA,OACA,WACG,QACF,gCAAa;yBAXA"}
1
+ {"version":3,"file":"checkbox.d.mts","names":[],"sources":["../../src/checkbox/checkbox.tsx"],"mappings":";;;;iBAeiB;;WAEN;;;;;WAKA;;WAEA;;WAEA;;;iBAIM,qCAAqC;;;;;;;WAO3C,QAAQ;;;;;;;iBAQF,sBAAsB,KACrC;;EAWA;;;;;;;EAOA;;;;;;;;;;EAUA;;;;;;;;;;EAUA,sBAAsB,sBAAsB;;;;;;EAM5C;;;;;;EAMA;;;;;;;;;EASA,aAAa;;EAEb,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;;;;EAK9C,SAAS,WAAW,gCAAgC;;;;;;;;;;;;;;;;;;wBAmBtC,WACd,SACA,gBACA,eACA,qBACA,UACA,YACA,WACA,OACA,WACG,QACF,gCAAa;yBAXA"}
@@ -17,6 +17,8 @@ import { useCheckableInput } from "../internal/use-checkable-input.mjs";
17
17
  * are merged rather than owned: a `render` element's own `onChange` (or `onClick`) runs first,
18
18
  * then the library's; an `onClick` that calls `preventDefault()` cancels the change (nothing is
19
19
  * dispatched).
20
+ *
21
+ * @see https://ui.funstack.work/components/checkbox
20
22
  */
21
23
  function Checkbox({ checked, defaultChecked, indeterminate = false, checkedChangeAction, disabled, transition, className, style, render, ...rest }) {
22
24
  const input = useCheckableInput({
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.mjs","names":[],"sources":["../../src/checkbox/checkbox.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { transitionTypes } from \"../internal/transition-types.js\";\nimport type {\n ActionDetails,\n ChangeAction,\n ChangeReason,\n RenderProp,\n StateValue,\n} from \"../internal/types.js\";\nimport { useCheckableInput } from \"../internal/use-checkable-input.js\";\nimport { useRender } from \"../internal/use-render.js\";\n\nexport interface CheckboxState {\n /** Optimistic checked state: what the user sees, including an in-flight change. */\n readonly checked: boolean;\n /**\n * The `indeterminate` prop, suspended while an action is in flight: `false` whenever `pending`\n * is true, so that the attribute, the DOM property and `:indeterminate` always agree.\n */\n readonly indeterminate: boolean;\n /** An action dispatched by this Checkbox is in flight (including the resulting render). */\n readonly pending: boolean;\n /** The `disabled` prop (or the enclosing `Field.Root`'s). */\n readonly disabled: boolean;\n}\n\n/** Details passed as the second argument of `checkedChangeAction`. */\nexport interface CheckboxCheckedChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user toggled the box (click, Space, label click); `event` is the native\n * `click` event. `\"platform\"`: the browser changed the value itself: a form reset (`event` is\n * the `reset` event) or a click before hydration / Firefox form-state restoration found on\n * mount (`event` is `undefined`).\n */\n readonly reason: ChangeReason;\n}\n\nexport interface CheckboxProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"checked\"\n | \"defaultChecked\"\n | \"onChange\"\n | \"aria-checked\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** Controlled checked state. `undefined` means uncontrolled. */\n checked?: boolean;\n /**\n * Initial checked state in uncontrolled mode (default `false`). Also the value a form reset\n * returns to: the latest prop value is mirrored into the input's `defaultChecked`.\n */\n defaultChecked?: boolean;\n /**\n * Controlled-only mixed state (APG tri-state checkbox), derived by the parent from other state;\n * there is no `defaultIndeterminate` and no action. Rendered as `el.indeterminate`,\n * `data-indeterminate` and `:indeterminate`, except while an action is pending. Clicking a\n * mixed box dispatches `checked: true` (for the usual unchecked + mixed representation). Does\n * not affect what the form submits.\n */\n indeterminate?: boolean;\n /**\n * Called with the next checked state on every change. Runs inside the Checkbox's transition;\n * may be sync or async (also a Server Function). Rejections reach the nearest Error Boundary.\n * Also called with `details.reason === \"platform\"` for a form reset or a pre-hydration click.\n *\n * A `setState` placed after your own `await` is not a Transition update; wrap it in\n * `startTransition` (React limitation). `details.event.preventDefault()` is not a veto and is\n * unsupported here; use controlled mode to veto a change.\n */\n checkedChangeAction?: ChangeAction<boolean, CheckboxCheckedChangeDetails>;\n /** Renders a natively disabled input; never dispatches. Default `false`. */\n disabled?: boolean;\n /** Submitted as the input's value when checked. Default `\"on\"` (platform). */\n value?: string;\n /**\n * Forwarded as `default` to the Checkbox's `<ViewTransition>`. Default: no boundary. Animates the\n * commit that ends an action, not the optimistic flip; animate the flip with CSS on `:checked`.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n className?: StateValue<string | undefined, CheckboxState>;\n style?: StateValue<CSSProperties | undefined, CheckboxState>;\n /**\n * Replace the rendered element (element form) or take over rendering (function form). Must keep\n * an `<input type=\"checkbox\">`.\n */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, CheckboxState>;\n}\n\n/**\n * A checkbox (WAI-ARIA \"Checkbox\" pattern, dual- and mixed-state). Renders\n * `<input type=\"checkbox\">` whose DOM `checked` is the optimistic state; the input carries\n * `data-pending` while `checkedChangeAction` is in flight and takes part in forms natively.\n *\n * Owned keys (a `render` element's value is overridden): `type`, `checked`, `defaultChecked`,\n * `indeterminate` (stripped), `aria-checked` (always removed), `disabled`, `data-checked`,\n * `data-indeterminate`, `data-pending`, `data-disabled`; inside a `Field.Root` also `id`,\n * `name`, `required`, `aria-invalid`, `aria-describedby` (token-merged) and `data-invalid`, and\n * `disabled` / `name` / `required` default from the Field. `role` passes through. Event handlers\n * are merged rather than owned: a `render` element's own `onChange` (or `onClick`) runs first,\n * then the library's; an `onClick` that calls `preventDefault()` cancels the change (nothing is\n * dispatched).\n */\nexport function Checkbox({\n checked,\n defaultChecked,\n indeterminate = false,\n checkedChangeAction,\n disabled,\n transition,\n className,\n style,\n render,\n ...rest\n}: CheckboxProps) {\n const input = useCheckableInput({\n component: \"Checkbox\",\n checked,\n defaultChecked,\n checkedChangeAction,\n disabled,\n own: rest,\n transitionTypes: (next) => transitionTypes(\"checkbox\", next ? \"check\" : \"uncheck\"),\n indeterminate,\n });\n\n const state: CheckboxState = {\n checked: input.optimistic,\n indeterminate: input.shownIndeterminate,\n pending: input.pending,\n disabled: input.disabled,\n };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, CheckboxState>({\n defaultElement: \"input\",\n render,\n state,\n className,\n style,\n children: undefined,\n ref: input.ref,\n // Pass-through layer: a `render` element's own props win over these (`role` included).\n props: rest,\n libraryProps: input.libraryProps,\n });\n\n return useTransitionBoundary(\"Checkbox\", transition, element);\n}\n\nCheckbox.displayName = \"Checkbox\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+GA,SAAgB,SAAS,EACvB,SACA,gBACA,gBAAgB,OAChB,qBACA,UACA,YACA,WACA,OACA,QACA,GAAG,QACa;CAChB,MAAM,QAAQ,kBAAkB;EAC9B,WAAW;EACX;EACA;EACA;EACA;EACA,KAAK;EACL,kBAAkB,SAAS,gBAAgB,YAAY,OAAO,UAAU,SAAS;EACjF;CACF,CAAC;CAED,MAAM,QAAuB;EAC3B,SAAS,MAAM;EACf,eAAe,MAAM;EACrB,SAAS,MAAM;EACf,UAAU,MAAM;CAClB;CAEA,MAAM,UAAU,UAAyD;EACvE,gBAAgB;EAChB;EACA;EACA;EACA;EACA,UAAU,KAAA;EACV,KAAK,MAAM;EAEX,OAAO;EACP,cAAc,MAAM;CACtB,CAAC;CAED,OAAO,sBAAsB,YAAY,YAAY,OAAO;AAC9D;AAEA,SAAS,cAAc"}
1
+ {"version":3,"file":"checkbox.mjs","names":[],"sources":["../../src/checkbox/checkbox.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { transitionTypes } from \"../internal/transition-types.js\";\nimport type {\n ActionDetails,\n ChangeAction,\n ChangeReason,\n RenderProp,\n StateValue,\n} from \"../internal/types.js\";\nimport { useCheckableInput } from \"../internal/use-checkable-input.js\";\nimport { useRender } from \"../internal/use-render.js\";\n\n/** State of `Checkbox`, passed to the function forms of `className`, `style` and `render`. */\nexport interface CheckboxState {\n /** Optimistic checked state: what the user sees, including an in-flight change. */\n readonly checked: boolean;\n /**\n * The `indeterminate` prop, suspended while an action is in flight: `false` whenever `pending`\n * is true, so that the attribute, the DOM property and `:indeterminate` always agree.\n */\n readonly indeterminate: boolean;\n /** An action dispatched by this Checkbox is in flight (including the resulting render). */\n readonly pending: boolean;\n /** The `disabled` prop (or the enclosing `Field.Root`'s). */\n readonly disabled: boolean;\n}\n\n/** Details passed as the second argument of `checkedChangeAction`. */\nexport interface CheckboxCheckedChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user toggled the box (click, Space, label click); `event` is the native\n * `click` event. `\"platform\"`: the browser changed the value itself: a form reset (`event` is\n * the `reset` event) or a click before hydration / Firefox form-state restoration found on\n * mount (`event` is `undefined`).\n */\n readonly reason: ChangeReason;\n}\n\n/**\n * Props of `Checkbox`.\n *\n * @see https://ui.funstack.work/components/checkbox\n */\nexport interface CheckboxProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"checked\"\n | \"defaultChecked\"\n | \"onChange\"\n | \"aria-checked\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** Controlled checked state. `undefined` means uncontrolled. */\n checked?: boolean;\n /**\n * Initial checked state in uncontrolled mode. Also the value a form reset\n * returns to: the latest prop value is mirrored into the input's `defaultChecked`.\n *\n * @defaultValue `false`\n */\n defaultChecked?: boolean;\n /**\n * Controlled-only mixed state (APG tri-state checkbox), derived by the parent from other state;\n * there is no `defaultIndeterminate` and no action. Rendered as `el.indeterminate`,\n * `data-indeterminate` and `:indeterminate`, except while an action is pending. Clicking a\n * mixed box dispatches `checked: true` (for the usual unchecked + mixed representation). Does\n * not affect what the form submits.\n *\n * @defaultValue `false`\n */\n indeterminate?: boolean;\n /**\n * Called with the next checked state on every change. Runs inside the Checkbox's transition;\n * may be sync or async (also a Server Function). Rejections reach the nearest Error Boundary.\n * Also called with `details.reason === \"platform\"` for a form reset or a pre-hydration click.\n *\n * A `setState` placed after your own `await` is not a Transition update; wrap it in\n * `startTransition` (React limitation). `details.event.preventDefault()` is not a veto and is\n * unsupported here; use controlled mode to veto a change.\n */\n checkedChangeAction?: ChangeAction<boolean, CheckboxCheckedChangeDetails>;\n /**\n * Renders a natively disabled input; never dispatches.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Submitted as the input's value when checked.\n *\n * @defaultValue `\"on\"` (platform)\n */\n value?: string;\n /**\n * Forwarded as `default` to the Checkbox's `<ViewTransition>`. Default: no boundary. Animates the\n * commit that ends an action, not the optimistic flip; animate the flip with CSS on `:checked`.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, CheckboxState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, CheckboxState>;\n /**\n * Replace the rendered element (element form) or take over rendering (function form). Must keep\n * an `<input type=\"checkbox\">`.\n */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, CheckboxState>;\n}\n\n/**\n * A checkbox (WAI-ARIA \"Checkbox\" pattern, dual- and mixed-state). Renders\n * `<input type=\"checkbox\">` whose DOM `checked` is the optimistic state; the input carries\n * `data-pending` while `checkedChangeAction` is in flight and takes part in forms natively.\n *\n * Owned keys (a `render` element's value is overridden): `type`, `checked`, `defaultChecked`,\n * `indeterminate` (stripped), `aria-checked` (always removed), `disabled`, `data-checked`,\n * `data-indeterminate`, `data-pending`, `data-disabled`; inside a `Field.Root` also `id`,\n * `name`, `required`, `aria-invalid`, `aria-describedby` (token-merged) and `data-invalid`, and\n * `disabled` / `name` / `required` default from the Field. `role` passes through. Event handlers\n * are merged rather than owned: a `render` element's own `onChange` (or `onClick`) runs first,\n * then the library's; an `onClick` that calls `preventDefault()` cancels the change (nothing is\n * dispatched).\n *\n * @see https://ui.funstack.work/components/checkbox\n */\nexport function Checkbox({\n checked,\n defaultChecked,\n indeterminate = false,\n checkedChangeAction,\n disabled,\n transition,\n className,\n style,\n render,\n ...rest\n}: CheckboxProps) {\n const input = useCheckableInput({\n component: \"Checkbox\",\n checked,\n defaultChecked,\n checkedChangeAction,\n disabled,\n own: rest,\n transitionTypes: (next) => transitionTypes(\"checkbox\", next ? \"check\" : \"uncheck\"),\n indeterminate,\n });\n\n const state: CheckboxState = {\n checked: input.optimistic,\n indeterminate: input.shownIndeterminate,\n pending: input.pending,\n disabled: input.disabled,\n };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, CheckboxState>({\n defaultElement: \"input\",\n render,\n state,\n className,\n style,\n children: undefined,\n ref: input.ref,\n // Pass-through layer: a `render` element's own props win over these (`role` included).\n props: rest,\n libraryProps: input.libraryProps,\n });\n\n return useTransitionBoundary(\"Checkbox\", transition, element);\n}\n\nCheckbox.displayName = \"Checkbox\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqIA,SAAgB,SAAS,EACvB,SACA,gBACA,gBAAgB,OAChB,qBACA,UACA,YACA,WACA,OACA,QACA,GAAG,QACa;CAChB,MAAM,QAAQ,kBAAkB;EAC9B,WAAW;EACX;EACA;EACA;EACA;EACA,KAAK;EACL,kBAAkB,SAAS,gBAAgB,YAAY,OAAO,UAAU,SAAS;EACjF;CACF,CAAC;CAED,MAAM,QAAuB;EAC3B,SAAS,MAAM;EACf,eAAe,MAAM;EACrB,SAAS,MAAM;EACf,UAAU,MAAM;CAClB;CAEA,MAAM,UAAU,UAAyD;EACvE,gBAAgB;EAChB;EACA;EACA;EACA;EACA,UAAU,KAAA;EACV,KAAK,MAAM;EAEX,OAAO;EACP,cAAc,MAAM;CACtB,CAAC;CAED,OAAO,sBAAsB,YAAY,YAAY,OAAO;AAC9D;AAEA,SAAS,cAAc"}
@@ -1,7 +1,11 @@
1
1
  import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { CSSProperties, ComponentPropsWithRef, ViewTransitionClass } from "react";
3
3
  //#region src/checkbox-group/checkbox-group-item.d.ts
4
+ /**
5
+ * State of `CheckboxGroup.Item`, passed to the function forms of `className`, `style` and `render`.
6
+ */
4
7
  export interface CheckboxGroupItemState {
8
+ /** The Item's `value` prop. */
5
9
  readonly value: string;
6
10
  /** Optimistic: true as soon as the user checks this box, before the action settles. */
7
11
  readonly checked: boolean;
@@ -10,6 +14,11 @@ export interface CheckboxGroupItemState {
10
14
  /** Disabled by its own prop or by `Root disabled`. */
11
15
  readonly disabled: boolean;
12
16
  }
17
+ /**
18
+ * Props of `CheckboxGroup.Item`.
19
+ *
20
+ * @see https://ui.funstack.work/components/checkbox-group
21
+ */
13
22
  export interface CheckboxGroupItemProps extends Omit<ComponentPropsWithRef<"input">, "type" | "name" | "value" | "checked" | "defaultChecked" | "defaultValue" | "form" | "required" | "aria-checked" | "onChange" | "className" | "style" | "children"> {
14
23
  /** The value this box contributes when checked. Must be unique within the Root. */
15
24
  value: string;
@@ -17,6 +26,8 @@ export interface CheckboxGroupItemProps extends Omit<ComponentPropsWithRef<"inpu
17
26
  * Native `disabled`: unfocusable, never dispatches, barred from constraint validation. A
18
27
  * `Parent` leaves a disabled Item's value alone and derives its state without it; a checked
19
28
  * disabled Item does not satisfy the group's `required`.
29
+ *
30
+ * @defaultValue `false`
20
31
  */
21
32
  disabled?: boolean;
22
33
  /**
@@ -29,7 +40,9 @@ export interface CheckboxGroupItemProps extends Omit<ComponentPropsWithRef<"inpu
29
40
  * page cross-fade that the next transition waits for).
30
41
  */
31
42
  transition?: ViewTransitionClass;
43
+ /** Class name, or a function of the part's state that returns one. */
32
44
  className?: StateValue<string | undefined, CheckboxGroupItemState>;
45
+ /** Inline style, or a function of the part's state that returns one. */
33
46
  style?: StateValue<CSSProperties | undefined, CheckboxGroupItemState>;
34
47
  /** Replace the rendered element. Must keep an `<input>`; the library sets `type="checkbox"`. */
35
48
  render?: RenderProp<ComponentPropsWithRef<"input">, CheckboxGroupItemState>;
@@ -46,6 +59,8 @@ export interface CheckboxGroupItemProps extends Omit<ComponentPropsWithRef<"inpu
46
59
  * `data-pending`, `data-disabled`; inside a `Field.Root` also `aria-invalid` (the Field's).
47
60
  * `onChange` is merged: a `render` element's own handler runs
48
61
  * first, then the library's. `role` passes through.
62
+ *
63
+ * @see https://ui.funstack.work/components/checkbox-group
49
64
  */
50
65
  export declare function CheckboxGroupItem({ value, disabled: disabledProp, transition, className, style, render, ...rest }: CheckboxGroupItemProps): import("react").ReactNode;
51
66
  export declare namespace CheckboxGroupItem {
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group-item.d.mts","names":[],"sources":["../../src/checkbox-group/checkbox-group-item.tsx"],"mappings":";;;iBAWiB;WACN;;WAEA;;WAEA;;WAEA;;iBAGM,+BAA+B,KAC9C;;EAgBA;;;;;;EAMA;;;;;;;;;;EAUA,aAAa;EACb,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;EAE9C,SAAS,WAAW,gCAAgC;;;;;;;;;;;;;;;wBAgBtC,oBACd,OACA,UAAU,cACV,YACA,WACA,OACA,WACG,QACF,yCAAsB;yBART"}
1
+ {"version":3,"file":"checkbox-group-item.d.mts","names":[],"sources":["../../src/checkbox-group/checkbox-group-item.tsx"],"mappings":";;;;;;iBAciB;;WAEN;;WAEA;;WAEA;;WAEA;;;;;;;iBAQM,+BAA+B,KAC9C;;EAgBA;;;;;;;;EAQA;;;;;;;;;;EAUA,aAAa;;EAEb,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,SAAS,WAAW,gCAAgC;;;;;;;;;;;;;;;;;wBAkBtC,oBACd,OACA,UAAU,cACV,YACA,WACA,OACA,WACG,QACF,yCAAsB;yBART"}
@@ -19,6 +19,8 @@ import { useLayoutEffect } from "react";
19
19
  * `data-pending`, `data-disabled`; inside a `Field.Root` also `aria-invalid` (the Field's).
20
20
  * `onChange` is merged: a `render` element's own handler runs
21
21
  * first, then the library's. `role` passes through.
22
+ *
23
+ * @see https://ui.funstack.work/components/checkbox-group
22
24
  */
23
25
  function CheckboxGroupItem({ value, disabled: disabledProp = false, transition, className, style, render, ...rest }) {
24
26
  const ctx = useCheckboxGroupContext("CheckboxGroup.Item");
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group-item.mjs","names":[],"sources":["../../src/checkbox-group/checkbox-group-item.tsx"],"sourcesContent":["\"use client\";\nimport { useLayoutEffect } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { groupMemberProps } from \"../internal/group-member.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useNativeChecked } from \"../internal/use-native-checked.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useCheckboxGroupContext } from \"./checkbox-group-context.js\";\nimport { syncPresences } from \"../internal/sync-presence.js\";\n\nexport interface CheckboxGroupItemState {\n readonly value: string;\n /** Optimistic: true as soon as the user checks this box, before the action settles. */\n readonly checked: boolean;\n /** The Root is pending and this box's optimistic state differs from its committed state. */\n readonly pending: boolean;\n /** Disabled by its own prop or by `Root disabled`. */\n readonly disabled: boolean;\n}\n\nexport interface CheckboxGroupItemProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"name\"\n | \"value\"\n | \"checked\"\n | \"defaultChecked\"\n | \"defaultValue\"\n | \"form\"\n | \"required\"\n | \"aria-checked\"\n | \"onChange\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** The value this box contributes when checked. Must be unique within the Root. */\n value: string;\n /**\n * Native `disabled`: unfocusable, never dispatches, barred from constraint validation. A\n * `Parent` leaves a disabled Item's value alone and derives its state without it; a checked\n * disabled Item does not satisfy the group's `required`.\n */\n disabled?: boolean;\n /**\n * Forwarded to the Item's `<ViewTransition default>`. Default: no boundary. Fires only on the\n * commit that settles the action (or rolls it back), never on the optimistic check; animate the\n * check itself with CSS on `:checked`.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n className?: StateValue<string | undefined, CheckboxGroupItemState>;\n style?: StateValue<CSSProperties | undefined, CheckboxGroupItemState>;\n /** Replace the rendered element. Must keep an `<input>`; the library sets `type=\"checkbox\"`. */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, CheckboxGroupItemState>;\n}\n\n/**\n * One `<input type=\"checkbox\">` of the group, checked while its `value` is in the group's set.\n * Its DOM `checked` is the optimistic state (`checked={optimistic.has(value)}`): react-dom\n * restores a controlled input to its props after every event, and only the sync-lane optimistic\n * value survives that restore.\n *\n * Owned keys (conventions 1.2; a `render` element's value is overridden): `type`, `name`,\n * `value`, `checked`, `defaultChecked` (never rendered), `disabled`, `form`, `required`\n * (computed by the Root from its `required` prop), `aria-checked` (removed), `data-checked`,\n * `data-pending`, `data-disabled`; inside a `Field.Root` also `aria-invalid` (the Field's).\n * `onChange` is merged: a `render` element's own handler runs\n * first, then the library's. `role` passes through.\n */\nexport function CheckboxGroupItem({\n value,\n disabled: disabledProp = false,\n transition,\n className,\n style,\n render,\n ...rest\n}: CheckboxGroupItemProps) {\n const ctx = useCheckboxGroupContext(\"CheckboxGroup.Item\");\n const checked = ctx.optimistic.has(value);\n const pending = ctx.state.pending && checked !== ctx.committed.has(value);\n const disabled = ctx.state.disabled || disabledProp;\n const required = ctx.required;\n\n // The Root needs every Item's own `disabled` for the Parents and `required` (design 6.2, 7).\n const { registerItem } = ctx;\n useLayoutEffect(() => registerItem(value, disabledProp), [registerItem, value, disabledProp]);\n\n // Group mode: element check and re-apply only; the Root reports the residual paths once.\n const inputRef = useNativeChecked({\n type: \"checkbox\",\n component: \"CheckboxGroup.Item\",\n checked,\n group: true,\n onItemMounted: (el) => {\n // Hydration keeps server attributes that differ from the client render (React only warns).\n // An Item hydrating after its Root can render a different state than the server did (a\n // click on an already hydrated box), and stale attributes would stay until the next change.\n if (el !== null) {\n syncPresences(el, {\n \"data-checked\": checked,\n \"data-pending\": pending,\n \"data-disabled\": disabled,\n required,\n });\n }\n ctx.onItemMounted(el);\n },\n defaultChecked: ctx.defaultValue === undefined ? undefined : ctx.defaultValue.has(value),\n });\n\n const state: CheckboxGroupItemState = { value, checked, pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, CheckboxGroupItemState>({\n defaultElement: \"input\",\n render,\n state,\n className,\n style,\n children: undefined,\n ref: inputRef,\n // Pass-through layer: a `render` element's own props win over these.\n props: rest,\n libraryProps: groupMemberProps({\n type: \"checkbox\",\n component: \"CheckboxGroup.Item\",\n name: ctx.name,\n form: ctx.form,\n value,\n required,\n checked,\n pending,\n effectiveDisabled: disabled,\n ownDisabled: disabledProp,\n // Inside a Field (owned there): the group's invalid state, since the fieldset cannot carry it.\n invalid: ctx.fieldInvalid,\n activate: (event) => ctx.toggle(value, !checked, event),\n }),\n });\n\n return useTransitionBoundary(\"CheckboxGroup.Item\", transition, element);\n}\n\nCheckboxGroupItem.displayName = \"CheckboxGroupItem\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0EA,SAAgB,kBAAkB,EAChC,OACA,UAAU,eAAe,OACzB,YACA,WACA,OACA,QACA,GAAG,QACsB;CACzB,MAAM,MAAM,wBAAwB,oBAAoB;CACxD,MAAM,UAAU,IAAI,WAAW,IAAI,KAAK;CACxC,MAAM,UAAU,IAAI,MAAM,WAAW,YAAY,IAAI,UAAU,IAAI,KAAK;CACxE,MAAM,WAAW,IAAI,MAAM,YAAY;CACvC,MAAM,WAAW,IAAI;CAGrB,MAAM,EAAE,iBAAiB;CACzB,sBAAsB,aAAa,OAAO,YAAY,GAAG;EAAC;EAAc;EAAO;CAAY,CAAC;CAG5F,MAAM,WAAW,iBAAiB;EAChC,MAAM;EACN,WAAW;EACX;EACA,OAAO;EACP,gBAAgB,OAAO;GAIrB,IAAI,OAAO,MACT,cAAc,IAAI;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB;GACF,CAAC;GAEH,IAAI,cAAc,EAAE;EACtB;EACA,gBAAgB,IAAI,iBAAiB,KAAA,IAAY,KAAA,IAAY,IAAI,aAAa,IAAI,KAAK;CACzF,CAAC;CAID,MAAM,UAAU,UAAkE;EAChF,gBAAgB;EAChB;EACA,OAAA;GALsC;GAAO;GAAS;GAAS;EAK3D;EACJ;EACA;EACA,UAAU,KAAA;EACV,KAAK;EAEL,OAAO;EACP,cAAc,iBAAiB;GAC7B,MAAM;GACN,WAAW;GACX,MAAM,IAAI;GACV,MAAM,IAAI;GACV;GACA;GACA;GACA;GACA,mBAAmB;GACnB,aAAa;GAEb,SAAS,IAAI;GACb,WAAW,UAAU,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK;EACxD,CAAC;CACH,CAAC;CAED,OAAO,sBAAsB,sBAAsB,YAAY,OAAO;AACxE;AAEA,kBAAkB,cAAc"}
1
+ {"version":3,"file":"checkbox-group-item.mjs","names":[],"sources":["../../src/checkbox-group/checkbox-group-item.tsx"],"sourcesContent":["\"use client\";\nimport { useLayoutEffect } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { groupMemberProps } from \"../internal/group-member.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useNativeChecked } from \"../internal/use-native-checked.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useCheckboxGroupContext } from \"./checkbox-group-context.js\";\nimport { syncPresences } from \"../internal/sync-presence.js\";\n\n/**\n * State of `CheckboxGroup.Item`, passed to the function forms of `className`, `style` and `render`.\n */\nexport interface CheckboxGroupItemState {\n /** The Item's `value` prop. */\n readonly value: string;\n /** Optimistic: true as soon as the user checks this box, before the action settles. */\n readonly checked: boolean;\n /** The Root is pending and this box's optimistic state differs from its committed state. */\n readonly pending: boolean;\n /** Disabled by its own prop or by `Root disabled`. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `CheckboxGroup.Item`.\n *\n * @see https://ui.funstack.work/components/checkbox-group\n */\nexport interface CheckboxGroupItemProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"name\"\n | \"value\"\n | \"checked\"\n | \"defaultChecked\"\n | \"defaultValue\"\n | \"form\"\n | \"required\"\n | \"aria-checked\"\n | \"onChange\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** The value this box contributes when checked. Must be unique within the Root. */\n value: string;\n /**\n * Native `disabled`: unfocusable, never dispatches, barred from constraint validation. A\n * `Parent` leaves a disabled Item's value alone and derives its state without it; a checked\n * disabled Item does not satisfy the group's `required`.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Forwarded to the Item's `<ViewTransition default>`. Default: no boundary. Fires only on the\n * commit that settles the action (or rolls it back), never on the optimistic check; animate the\n * check itself with CSS on `:checked`.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, CheckboxGroupItemState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, CheckboxGroupItemState>;\n /** Replace the rendered element. Must keep an `<input>`; the library sets `type=\"checkbox\"`. */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, CheckboxGroupItemState>;\n}\n\n/**\n * One `<input type=\"checkbox\">` of the group, checked while its `value` is in the group's set.\n * Its DOM `checked` is the optimistic state (`checked={optimistic.has(value)}`): react-dom\n * restores a controlled input to its props after every event, and only the sync-lane optimistic\n * value survives that restore.\n *\n * Owned keys (conventions 1.2; a `render` element's value is overridden): `type`, `name`,\n * `value`, `checked`, `defaultChecked` (never rendered), `disabled`, `form`, `required`\n * (computed by the Root from its `required` prop), `aria-checked` (removed), `data-checked`,\n * `data-pending`, `data-disabled`; inside a `Field.Root` also `aria-invalid` (the Field's).\n * `onChange` is merged: a `render` element's own handler runs\n * first, then the library's. `role` passes through.\n *\n * @see https://ui.funstack.work/components/checkbox-group\n */\nexport function CheckboxGroupItem({\n value,\n disabled: disabledProp = false,\n transition,\n className,\n style,\n render,\n ...rest\n}: CheckboxGroupItemProps) {\n const ctx = useCheckboxGroupContext(\"CheckboxGroup.Item\");\n const checked = ctx.optimistic.has(value);\n const pending = ctx.state.pending && checked !== ctx.committed.has(value);\n const disabled = ctx.state.disabled || disabledProp;\n const required = ctx.required;\n\n // The Root needs every Item's own `disabled` for the Parents and `required` (design 6.2, 7).\n const { registerItem } = ctx;\n useLayoutEffect(() => registerItem(value, disabledProp), [registerItem, value, disabledProp]);\n\n // Group mode: element check and re-apply only; the Root reports the residual paths once.\n const inputRef = useNativeChecked({\n type: \"checkbox\",\n component: \"CheckboxGroup.Item\",\n checked,\n group: true,\n onItemMounted: (el) => {\n // Hydration keeps server attributes that differ from the client render (React only warns).\n // An Item hydrating after its Root can render a different state than the server did (a\n // click on an already hydrated box), and stale attributes would stay until the next change.\n if (el !== null) {\n syncPresences(el, {\n \"data-checked\": checked,\n \"data-pending\": pending,\n \"data-disabled\": disabled,\n required,\n });\n }\n ctx.onItemMounted(el);\n },\n defaultChecked: ctx.defaultValue === undefined ? undefined : ctx.defaultValue.has(value),\n });\n\n const state: CheckboxGroupItemState = { value, checked, pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, CheckboxGroupItemState>({\n defaultElement: \"input\",\n render,\n state,\n className,\n style,\n children: undefined,\n ref: inputRef,\n // Pass-through layer: a `render` element's own props win over these.\n props: rest,\n libraryProps: groupMemberProps({\n type: \"checkbox\",\n component: \"CheckboxGroup.Item\",\n name: ctx.name,\n form: ctx.form,\n value,\n required,\n checked,\n pending,\n effectiveDisabled: disabled,\n ownDisabled: disabledProp,\n // Inside a Field (owned there): the group's invalid state, since the fieldset cannot carry it.\n invalid: ctx.fieldInvalid,\n activate: (event) => ctx.toggle(value, !checked, event),\n }),\n });\n\n return useTransitionBoundary(\"CheckboxGroup.Item\", transition, element);\n}\n\nCheckboxGroupItem.displayName = \"CheckboxGroupItem\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyFA,SAAgB,kBAAkB,EAChC,OACA,UAAU,eAAe,OACzB,YACA,WACA,OACA,QACA,GAAG,QACsB;CACzB,MAAM,MAAM,wBAAwB,oBAAoB;CACxD,MAAM,UAAU,IAAI,WAAW,IAAI,KAAK;CACxC,MAAM,UAAU,IAAI,MAAM,WAAW,YAAY,IAAI,UAAU,IAAI,KAAK;CACxE,MAAM,WAAW,IAAI,MAAM,YAAY;CACvC,MAAM,WAAW,IAAI;CAGrB,MAAM,EAAE,iBAAiB;CACzB,sBAAsB,aAAa,OAAO,YAAY,GAAG;EAAC;EAAc;EAAO;CAAY,CAAC;CAG5F,MAAM,WAAW,iBAAiB;EAChC,MAAM;EACN,WAAW;EACX;EACA,OAAO;EACP,gBAAgB,OAAO;GAIrB,IAAI,OAAO,MACT,cAAc,IAAI;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB;GACF,CAAC;GAEH,IAAI,cAAc,EAAE;EACtB;EACA,gBAAgB,IAAI,iBAAiB,KAAA,IAAY,KAAA,IAAY,IAAI,aAAa,IAAI,KAAK;CACzF,CAAC;CAID,MAAM,UAAU,UAAkE;EAChF,gBAAgB;EAChB;EACA,OAAA;GALsC;GAAO;GAAS;GAAS;EAK3D;EACJ;EACA;EACA,UAAU,KAAA;EACV,KAAK;EAEL,OAAO;EACP,cAAc,iBAAiB;GAC7B,MAAM;GACN,WAAW;GACX,MAAM,IAAI;GACV,MAAM,IAAI;GACV;GACA;GACA;GACA;GACA,mBAAmB;GACnB,aAAa;GAEb,SAAS,IAAI;GACb,WAAW,UAAU,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK;EACxD,CAAC;CACH,CAAC;CAED,OAAO,sBAAsB,sBAAsB,YAAY,OAAO;AACxE;AAEA,kBAAkB,cAAc"}
@@ -2,16 +2,26 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { CheckboxGroupRootState } from "./checkbox-group-root.mjs";
3
3
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
4
4
  //#region src/checkbox-group/checkbox-group-label.d.ts
5
+ /**
6
+ * Props of `CheckboxGroup.Label`.
7
+ *
8
+ * @see https://ui.funstack.work/components/checkbox-group
9
+ */
5
10
  export interface CheckboxGroupLabelProps extends Omit<ComponentPropsWithRef<"legend">, "className" | "style" | "children"> {
11
+ /** Class name, or a function of the part's state that returns one. */
6
12
  className?: StateValue<string | undefined, CheckboxGroupRootState>;
13
+ /** Inline style, or a function of the part's state that returns one. */
7
14
  style?: StateValue<CSSProperties | undefined, CheckboxGroupRootState>;
8
15
  /** Receives the Root's state: a group-level pending indicator goes here. */
9
16
  children?: StateValue<ReactNode, CheckboxGroupRootState>;
17
+ /** Replace the default `<legend>` (element form) or take over rendering (function form). */
10
18
  render?: RenderProp<ComponentPropsWithRef<"legend">, CheckboxGroupRootState>;
11
19
  }
12
20
  /**
13
21
  * The group's `<legend>`, which names the fieldset natively. Optional; must be the **first child**
14
22
  * of `CheckboxGroup.Root` (HTML content model). Its state is the Root's state. Owns no keys.
23
+ *
24
+ * @see https://ui.funstack.work/components/checkbox-group
15
25
  */
16
26
  export declare function CheckboxGroupLabel({ className, style, children, render, ...rest }: CheckboxGroupLabelProps): ReactNode;
17
27
  export declare namespace CheckboxGroupLabel {
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group-label.d.mts","names":[],"sources":["../../src/checkbox-group/checkbox-group-label.tsx"],"mappings":";;;;iBAOiB,gCAAgC,KAC/C;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,iCAAiC;;;;;;wBAOvC,qBACd,WACA,OACA,UACA,WACG,QACF,0BAAuB;yBANV"}
1
+ {"version":3,"file":"checkbox-group-label.d.mts","names":[],"sources":["../../src/checkbox-group/checkbox-group-label.tsx"],"mappings":";;;;;;;;;iBAYiB,gCAAgC,KAC/C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;wBASvC,qBACd,WACA,OACA,UACA,WACG,QACF,0BAAuB;yBANV"}
@@ -5,6 +5,8 @@ import { useCheckboxGroupContext } from "./checkbox-group-context.mjs";
5
5
  /**
6
6
  * The group's `<legend>`, which names the fieldset natively. Optional; must be the **first child**
7
7
  * of `CheckboxGroup.Root` (HTML content model). Its state is the Root's state. Owns no keys.
8
+ *
9
+ * @see https://ui.funstack.work/components/checkbox-group
8
10
  */
9
11
  function CheckboxGroupLabel({ className, style, children, render, ...rest }) {
10
12
  const { state } = useCheckboxGroupContext("CheckboxGroup.Label");
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group-label.mjs","names":[],"sources":["../../src/checkbox-group/checkbox-group-label.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useCheckboxGroupContext } from \"./checkbox-group-context.js\";\nimport type { CheckboxGroupRootState } from \"./checkbox-group-root.js\";\n\nexport interface CheckboxGroupLabelProps extends Omit<\n ComponentPropsWithRef<\"legend\">,\n \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, CheckboxGroupRootState>;\n style?: StateValue<CSSProperties | undefined, CheckboxGroupRootState>;\n /** Receives the Root's state: a group-level pending indicator goes here. */\n children?: StateValue<ReactNode, CheckboxGroupRootState>;\n render?: RenderProp<ComponentPropsWithRef<\"legend\">, CheckboxGroupRootState>;\n}\n\n/**\n * The group's `<legend>`, which names the fieldset natively. Optional; must be the **first child**\n * of `CheckboxGroup.Root` (HTML content model). Its state is the Root's state. Owns no keys.\n */\nexport function CheckboxGroupLabel({\n className,\n style,\n children,\n render,\n ...rest\n}: CheckboxGroupLabelProps) {\n const { state } = useCheckboxGroupContext(\"CheckboxGroup.Label\");\n return useRender<ComponentPropsWithRef<\"legend\">, CheckboxGroupRootState>({\n defaultElement: \"legend\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n });\n}\n\nCheckboxGroupLabel.displayName = \"CheckboxGroupLabel\";\n"],"mappings":";;;;;;;;AAsBA,SAAgB,mBAAmB,EACjC,WACA,OACA,UACA,QACA,GAAG,QACuB;CAC1B,MAAM,EAAE,UAAU,wBAAwB,qBAAqB;CAC/D,OAAO,UAAmE;EACxE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;CACT,CAAC;AACH;AAEA,mBAAmB,cAAc"}
1
+ {"version":3,"file":"checkbox-group-label.mjs","names":[],"sources":["../../src/checkbox-group/checkbox-group-label.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useCheckboxGroupContext } from \"./checkbox-group-context.js\";\nimport type { CheckboxGroupRootState } from \"./checkbox-group-root.js\";\n\n/**\n * Props of `CheckboxGroup.Label`.\n *\n * @see https://ui.funstack.work/components/checkbox-group\n */\nexport interface CheckboxGroupLabelProps extends Omit<\n ComponentPropsWithRef<\"legend\">,\n \"className\" | \"style\" | \"children\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, CheckboxGroupRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, CheckboxGroupRootState>;\n /** Receives the Root's state: a group-level pending indicator goes here. */\n children?: StateValue<ReactNode, CheckboxGroupRootState>;\n /** Replace the default `<legend>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"legend\">, CheckboxGroupRootState>;\n}\n\n/**\n * The group's `<legend>`, which names the fieldset natively. Optional; must be the **first child**\n * of `CheckboxGroup.Root` (HTML content model). Its state is the Root's state. Owns no keys.\n *\n * @see https://ui.funstack.work/components/checkbox-group\n */\nexport function CheckboxGroupLabel({\n className,\n style,\n children,\n render,\n ...rest\n}: CheckboxGroupLabelProps) {\n const { state } = useCheckboxGroupContext(\"CheckboxGroup.Label\");\n return useRender<ComponentPropsWithRef<\"legend\">, CheckboxGroupRootState>({\n defaultElement: \"legend\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n });\n}\n\nCheckboxGroupLabel.displayName = \"CheckboxGroupLabel\";\n"],"mappings":";;;;;;;;;;AAgCA,SAAgB,mBAAmB,EACjC,WACA,OACA,UACA,QACA,GAAG,QACuB;CAC1B,MAAM,EAAE,UAAU,wBAAwB,qBAAqB;CAC/D,OAAO,UAAmE;EACxE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;CACT,CAAC;AACH;AAEA,mBAAmB,cAAc"}
@@ -1,7 +1,12 @@
1
1
  import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { CSSProperties, ComponentPropsWithRef, ViewTransitionClass } from "react";
3
3
  //#region src/checkbox-group/checkbox-group-parent.d.ts
4
+ /**
5
+ * State of `CheckboxGroup.Parent`, passed to the function forms of `className`, `style` and
6
+ * `render`.
7
+ */
4
8
  export interface CheckboxGroupParentState {
9
+ /** The Parent's `values` prop: the Items it checks and unchecks. */
5
10
  readonly values: readonly string[];
6
11
  /** Every value in `values` is optimistically checked (`false` when `values` is empty). */
7
12
  readonly checked: boolean;
@@ -15,6 +20,11 @@ export interface CheckboxGroupParentState {
15
20
  /** Disabled by its own prop or by `Root disabled`. */
16
21
  readonly disabled: boolean;
17
22
  }
23
+ /**
24
+ * Props of `CheckboxGroup.Parent`.
25
+ *
26
+ * @see https://ui.funstack.work/components/checkbox-group
27
+ */
18
28
  export interface CheckboxGroupParentProps extends Omit<ComponentPropsWithRef<"input">, "type" | "name" | "value" | "checked" | "defaultChecked" | "defaultValue" | "form" | "required" | "autoComplete" | "aria-checked" | "onChange" | "className" | "style" | "children"> {
19
29
  /**
20
30
  * The Item values this Parent controls (usually every Item of the group). Its checked and
@@ -28,7 +38,11 @@ export interface CheckboxGroupParentProps extends Omit<ComponentPropsWithRef<"in
28
38
  * disabled Items too; it settles when the Items hydrate.
29
39
  */
30
40
  values: string[];
31
- /** Native `disabled`: unfocusable, never dispatches. */
41
+ /**
42
+ * Native `disabled`: unfocusable, never dispatches.
43
+ *
44
+ * @defaultValue `false`
45
+ */
32
46
  disabled?: boolean;
33
47
  /**
34
48
  * Forwarded to the Parent's `<ViewTransition default>`. Default: no boundary. Fires only on the
@@ -40,7 +54,9 @@ export interface CheckboxGroupParentProps extends Omit<ComponentPropsWithRef<"in
40
54
  * page cross-fade that the next transition waits for).
41
55
  */
42
56
  transition?: ViewTransitionClass;
57
+ /** Class name, or a function of the part's state that returns one. */
43
58
  className?: StateValue<string | undefined, CheckboxGroupParentState>;
59
+ /** Inline style, or a function of the part's state that returns one. */
44
60
  style?: StateValue<CSSProperties | undefined, CheckboxGroupParentState>;
45
61
  /** Replace the rendered element. Must keep an `<input>`; the library sets `type="checkbox"`. */
46
62
  render?: RenderProp<ComponentPropsWithRef<"input">, CheckboxGroupParentState>;
@@ -58,6 +74,8 @@ export interface CheckboxGroupParentProps extends Omit<ComponentPropsWithRef<"in
58
74
  * `defaultChecked`, `indeterminate` (stripped; the property is set), `required` (removed), `form`
59
75
  * (removed), `autoComplete` (`"off"`), `disabled`, `aria-checked` (removed), `data-checked`, `data-indeterminate`,
60
76
  * `data-pending`, `data-disabled`. `onChange` is merged.
77
+ *
78
+ * @see https://ui.funstack.work/components/checkbox-group
61
79
  */
62
80
  export declare function CheckboxGroupParent({ values, disabled: disabledProp, transition, className, style, render, ...rest }: CheckboxGroupParentProps): import("react").ReactNode;
63
81
  export declare namespace CheckboxGroupParent {
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group-parent.d.mts","names":[],"sources":["../../src/checkbox-group/checkbox-group-parent.tsx"],"mappings":";;;iBAciB;WACN;;WAEA;;;;;WAKA;;WAEA;;WAEA;;iBAGM,iCAAiC,KAChD;;;;;;;;;;;;EA2BA;;EAEA;;;;;;;;;;EAUA,aAAa;EACb,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;EAE9C,SAAS,WAAW,gCAAgC;;;;;;;;;;;;;;;;wBAyBtC,sBACd,QACA,UAAU,cACV,YACA,WACA,OACA,WACG,QACF,2CAAwB;yBARX"}
1
+ {"version":3,"file":"checkbox-group-parent.d.mts","names":[],"sources":["../../src/checkbox-group/checkbox-group-parent.tsx"],"mappings":";;;;;;;iBAkBiB;;WAEN;;WAEA;;;;;WAKA;;WAEA;;WAEA;;;;;;;iBAQM,iCAAiC,KAChD;;;;;;;;;;;;EA2BA;;;;;;EAMA;;;;;;;;;;EAUA,aAAa;;EAEb,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,SAAS,WAAW,gCAAgC;;;;;;;;;;;;;;;;;;wBA2BtC,sBACd,QACA,UAAU,cACV,YACA,WACA,OACA,WACG,QACF,2CAAwB;yBARX"}
@@ -32,6 +32,8 @@ function derive(values, set) {
32
32
  * `defaultChecked`, `indeterminate` (stripped; the property is set), `required` (removed), `form`
33
33
  * (removed), `autoComplete` (`"off"`), `disabled`, `aria-checked` (removed), `data-checked`, `data-indeterminate`,
34
34
  * `data-pending`, `data-disabled`. `onChange` is merged.
35
+ *
36
+ * @see https://ui.funstack.work/components/checkbox-group
35
37
  */
36
38
  function CheckboxGroupParent({ values, disabled: disabledProp = false, transition, className, style, render, ...rest }) {
37
39
  const ctx = useCheckboxGroupContext("CheckboxGroup.Parent");