@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
@@ -2,14 +2,25 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { ProgressState } from "./progress-root.mjs";
3
3
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
4
4
  //#region src/progress/progress-label.d.ts
5
+ /**
6
+ * Props of `Progress.Label`.
7
+ *
8
+ * @see https://ui.funstack.work/components/progress
9
+ */
5
10
  export interface ProgressLabelProps extends Omit<ComponentPropsWithRef<"span">, "id" | "className" | "style" | "children"> {
11
+ /** Class name, or a function of the part's state that returns one. */
6
12
  className?: StateValue<string | undefined, ProgressState>;
13
+ /** Inline style, or a function of the part's state that returns one. */
7
14
  style?: StateValue<CSSProperties | undefined, ProgressState>;
15
+ /** Content, or a function of the part's state. */
8
16
  children?: StateValue<ReactNode, ProgressState>;
17
+ /** Replace the default `<span>` (element form) or take over rendering (function form). */
9
18
  render?: RenderProp<ComponentPropsWithRef<"span">, ProgressState>;
10
19
  }
11
20
  /**
12
21
  * `Progress.Label`: a `span` whose id the Root always references through `aria-labelledby` (the Root is not a labelable element, so a `<label for>` would associate nothing). Owned keys: `id`, `data-indeterminate`, `data-complete`.
22
+ *
23
+ * @see https://ui.funstack.work/components/progress
13
24
  */
14
25
  export declare function ProgressLabel({ className, style, children, render, ...rest }: ProgressLabelProps): ReactNode;
15
26
  export declare namespace ProgressLabel {
@@ -1 +1 @@
1
- {"version":3,"file":"progress-label.d.mts","names":[],"sources":["../../src/progress/progress-label.tsx"],"mappings":";;;;iBAQiB,2BAA2B,KAC1C;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;EAC9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,+BAA+B;;;;;wBAMrC,gBAAgB,WAAW,OAAO,UAAU,WAAW,QAAQ,qBAAkB;yBAAjF"}
1
+ {"version":3,"file":"progress-label.d.mts","names":[],"sources":["../../src/progress/progress-label.tsx"],"mappings":";;;;;;;;;iBAaiB,2BAA2B,KAC1C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,+BAA+B;;;;;;;wBAQrC,gBAAgB,WAAW,OAAO,UAAU,WAAW,QAAQ,qBAAkB;yBAAjF"}
@@ -5,6 +5,8 @@ import { useProgressContext } from "./progress-context.mjs";
5
5
  //#region src/progress/progress-label.tsx
6
6
  /**
7
7
  * `Progress.Label`: a `span` whose id the Root always references through `aria-labelledby` (the Root is not a labelable element, so a `<label for>` would associate nothing). Owned keys: `id`, `data-indeterminate`, `data-complete`.
8
+ *
9
+ * @see https://ui.funstack.work/components/progress
8
10
  */
9
11
  function ProgressLabel({ className, style, children, render, ...rest }) {
10
12
  const { id, state } = useProgressContext("Progress.Label");
@@ -1 +1 @@
1
- {"version":3,"file":"progress-label.mjs","names":[],"sources":["../../src/progress/progress-label.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useProgressContext } from \"./progress-context.js\";\nimport type { ProgressState } from \"./progress-root.js\";\n\nexport interface ProgressLabelProps extends Omit<\n ComponentPropsWithRef<\"span\">,\n \"id\" | \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, ProgressState>;\n style?: StateValue<CSSProperties | undefined, ProgressState>;\n children?: StateValue<ReactNode, ProgressState>;\n render?: RenderProp<ComponentPropsWithRef<\"span\">, ProgressState>;\n}\n\n/**\n * `Progress.Label`: a `span` whose id the Root always references through `aria-labelledby` (the Root is not a labelable element, so a `<label for>` would associate nothing). Owned keys: `id`, `data-indeterminate`, `data-complete`.\n */\nexport function ProgressLabel({ className, style, children, render, ...rest }: ProgressLabelProps) {\n const { id, state } = useProgressContext(\"Progress.Label\");\n return useRender<ComponentPropsWithRef<\"span\">, ProgressState>({\n defaultElement: \"span\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n id: `${id}-label`,\n \"data-indeterminate\": dataAttr(state.indeterminate),\n \"data-complete\": dataAttr(state.complete),\n },\n });\n}\n\nProgressLabel.displayName = \"ProgressLabel\";\n"],"mappings":";;;;;;;;AAqBA,SAAgB,cAAc,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA4B;CACjG,MAAM,EAAE,IAAI,UAAU,mBAAmB,gBAAgB;CACzD,OAAO,UAAwD;EAC7D,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc;GACZ,IAAI,GAAG,GAAG;GACV,sBAAsB,SAAS,MAAM,aAAa;GAClD,iBAAiB,SAAS,MAAM,QAAQ;EAC1C;CACF,CAAC;AACH;AAEA,cAAc,cAAc"}
1
+ {"version":3,"file":"progress-label.mjs","names":[],"sources":["../../src/progress/progress-label.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useProgressContext } from \"./progress-context.js\";\nimport type { ProgressState } from \"./progress-root.js\";\n\n/**\n * Props of `Progress.Label`.\n *\n * @see https://ui.funstack.work/components/progress\n */\nexport interface ProgressLabelProps extends Omit<\n ComponentPropsWithRef<\"span\">,\n \"id\" | \"className\" | \"style\" | \"children\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, ProgressState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, ProgressState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, ProgressState>;\n /** Replace the default `<span>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"span\">, ProgressState>;\n}\n\n/**\n * `Progress.Label`: a `span` whose id the Root always references through `aria-labelledby` (the Root is not a labelable element, so a `<label for>` would associate nothing). Owned keys: `id`, `data-indeterminate`, `data-complete`.\n *\n * @see https://ui.funstack.work/components/progress\n */\nexport function ProgressLabel({ className, style, children, render, ...rest }: ProgressLabelProps) {\n const { id, state } = useProgressContext(\"Progress.Label\");\n return useRender<ComponentPropsWithRef<\"span\">, ProgressState>({\n defaultElement: \"span\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n id: `${id}-label`,\n \"data-indeterminate\": dataAttr(state.indeterminate),\n \"data-complete\": dataAttr(state.complete),\n },\n });\n}\n\nProgressLabel.displayName = \"ProgressLabel\";\n"],"mappings":";;;;;;;;;;AAgCA,SAAgB,cAAc,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA4B;CACjG,MAAM,EAAE,IAAI,UAAU,mBAAmB,gBAAgB;CACzD,OAAO,UAAwD;EAC7D,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc;GACZ,IAAI,GAAG,GAAG;GACV,sBAAsB,SAAS,MAAM,aAAa;GAClD,iBAAiB,SAAS,MAAM,QAAQ;EAC1C;CACF,CAAC;AACH;AAEA,cAAc,cAAc"}
@@ -5,7 +5,9 @@ import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
5
5
  export interface ProgressState {
6
6
  /** The value clamped to `[min, max]`, or `null` while indeterminate. */
7
7
  readonly value: number | null;
8
+ /** The `min` prop. */
8
9
  readonly min: number;
10
+ /** The `max` prop. */
9
11
  readonly max: number;
10
12
  /** `(value - min) / (max - min) * 100`, a number 0–100; `null` while indeterminate. */
11
13
  readonly percentage: number | null;
@@ -21,22 +23,42 @@ export interface ProgressState {
21
23
  /** The clamped value has reached `max`. */
22
24
  readonly complete: boolean;
23
25
  }
26
+ /**
27
+ * Props of `Progress.Root`.
28
+ *
29
+ * @see https://ui.funstack.work/components/progress
30
+ */
24
31
  export interface ProgressRootProps extends Omit<ComponentPropsWithRef<"div">, "role" | "aria-valuemin" | "aria-valuemax" | "aria-valuenow" | "aria-valuetext" | "defaultValue" | "defaultChecked" | "className" | "style" | "children"> {
25
- /** The current value. Absent or `null`: indeterminate. Clamped to `[min, max]`. */
32
+ /**
33
+ * The current value. Absent or `null`: indeterminate. Clamped to `[min, max]`.
34
+ *
35
+ * @defaultValue `null`
36
+ */
26
37
  value?: number | null;
27
- /** @default 0 */
38
+ /**
39
+ * Lower bound of the range.
40
+ *
41
+ * @defaultValue `0`
42
+ */
28
43
  min?: number;
29
- /** @default 100 */
44
+ /**
45
+ * Upper bound of the range.
46
+ *
47
+ * @defaultValue `100`
48
+ */
30
49
  max?: number;
31
50
  /**
32
- * `Intl.NumberFormat` options for `aria-valuetext` and `Progress.Value`. Default
33
- * `{ style: "percent" }`. A `percent` style formats the fraction of the range; any other style
34
- * formats the value. Serialisable: a Server Component may pass it.
51
+ * `Intl.NumberFormat` options for `aria-valuetext` and `Progress.Value`. A `percent` style
52
+ * formats the fraction of the range; any other style formats the value. Serialisable: a Server
53
+ * Component may pass it.
54
+ *
55
+ * @defaultValue `{ style: "percent" }`
35
56
  */
36
57
  format?: Intl.NumberFormatOptions;
37
58
  /**
38
- * BCP 47 tag for `Intl.NumberFormat`; default: the runtime's locale. Pass it when a client
39
- * tree is server-rendered.
59
+ * BCP 47 tag for `Intl.NumberFormat`. Pass it when a client tree is server-rendered.
60
+ *
61
+ * @defaultValue the runtime's locale
40
62
  */
41
63
  locale?: string;
42
64
  /**
@@ -47,9 +69,13 @@ export interface ProgressRootProps extends Omit<ComponentPropsWithRef<"div">, "r
47
69
  * rendered by a client component.
48
70
  */
49
71
  getAriaValueText?: (value: number | null, state: ProgressState) => string | null | undefined;
72
+ /** Class name, or a function of the part's state that returns one. */
50
73
  className?: StateValue<string | undefined, ProgressState>;
74
+ /** Inline style, or a function of the part's state that returns one. */
51
75
  style?: StateValue<CSSProperties | undefined, ProgressState>;
76
+ /** Content, or a function of the part's state. */
52
77
  children?: StateValue<ReactNode, ProgressState>;
78
+ /** Replace the default `<div>` (element form) or take over rendering (function form). */
53
79
  render?: RenderProp<ComponentPropsWithRef<"div">, ProgressState>;
54
80
  }
55
81
  /**
@@ -59,6 +85,8 @@ export interface ProgressRootProps extends Omit<ComponentPropsWithRef<"div">, "r
59
85
  * keys: `role`, `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, `aria-valuetext`,
60
86
  * `aria-labelledby` (token-merged: the consumer's tokens, then `Progress.Label`'s id, always),
61
87
  * `data-indeterminate`, `data-complete`.
88
+ *
89
+ * @see https://ui.funstack.work/components/progress
62
90
  */
63
91
  export declare function ProgressRoot({ value, min, max, format, locale, getAriaValueText, className, style, children, render, ref, ...rest }: ProgressRootProps): import("react").JSX.Element;
64
92
  export declare namespace ProgressRoot {
@@ -1 +1 @@
1
- {"version":3,"file":"progress-root.d.mts","names":[],"sources":["../../src/progress/progress-root.tsx"],"mappings":";;;;iBAeiB;;WAEN;WACA;WACA;;WAEA;;;;;WAKA;;WAEA;;WAEA;;WAEA;;iBAGM,0BAA0B,KACzC;;EAaA;;EAEA;;EAEA;;;;;;EAMA,SAAS,KAAK;;;;;EAKd;;;;;;;;EAQA,oBAAoB,sBAAsB,OAAO;EACjD,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;EAC9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,8BAA8B;;;;;;;;;;wBAWpC,eACd,OACA,KACA,KACA,QACA,QACA,kBACA,WACA,OACA,UACA,QACA,QACG,QACF,oCAAiB,IAAA;yBAbJ"}
1
+ {"version":3,"file":"progress-root.d.mts","names":[],"sources":["../../src/progress/progress-root.tsx"],"mappings":";;;;iBAeiB;;WAEN;;WAEA;;WAEA;;WAEA;;;;;WAKA;;WAEA;;WAEA;;WAEA;;;;;;;iBAQM,0BAA0B,KACzC;;;;;;EAiBA;;;;;;EAMA;;;;;;EAMA;;;;;;;;EAQA,SAAS,KAAK;;;;;;EAMd;;;;;;;;EAQA,oBAAoB,sBAAsB,OAAO;;EAEjD,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,8BAA8B;;;;;;;;;;;;wBAapC,eACd,OACA,KACA,KACA,QACA,QACA,kBACA,WACA,OACA,UACA,QACA,QACG,QACF,oCAAiB,IAAA;yBAbJ"}
@@ -13,6 +13,8 @@ import { jsx } from "react/jsx-runtime";
13
13
  * keys: `role`, `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, `aria-valuetext`,
14
14
  * `aria-labelledby` (token-merged: the consumer's tokens, then `Progress.Label`'s id, always),
15
15
  * `data-indeterminate`, `data-complete`.
16
+ *
17
+ * @see https://ui.funstack.work/components/progress
16
18
  */
17
19
  function ProgressRoot({ value = null, min = 0, max = 100, format, locale, getAriaValueText, className, style, children, render, ref, ...rest }) {
18
20
  const id = useId();
@@ -1 +1 @@
1
- {"version":3,"file":"progress-root.mjs","names":[],"sources":["../../src/progress/progress-root.tsx"],"sourcesContent":["// No \"use client\": `Progress.Root` uses only `useId`, arithmetic and `Intl`, and renders the\n// client context's provider (conventions 7.1's second exception). Rendered by a Server Component\n// it runs once, on the server (design/components/progress.md 8.1). It must not import from any\n// \"use client\" module except its context (checked by src/__tests__/directives.test.ts).\nimport { useId } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { warnOnce } from \"../internal/dev-warn.js\";\nimport { clamp, formatRangeValue, isDegenerate, percentage } from \"../internal/range-value.js\";\nimport { mergeRenderRef, renderElement, resolveStateValue } from \"../internal/render-element.js\";\nimport type { DataAttributes } from \"../internal/render-element.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { ProgressContext } from \"./progress-context.js\";\n\n/** The state every Progress part receives. */\nexport interface ProgressState {\n /** The value clamped to `[min, max]`, or `null` while indeterminate. */\n readonly value: number | null;\n readonly min: number;\n readonly max: number;\n /** `(value - min) / (max - min) * 100`, a number 0–100; `null` while indeterminate. */\n readonly percentage: number | null;\n /**\n * The `Intl.NumberFormat` text of the value (or of the fraction, for the percent style): what\n * `Progress.Value` shows. `null` while indeterminate.\n */\n readonly formattedValue: string | null;\n /** What `aria-valuetext` carries: `getAriaValueText`'s result, else `formattedValue`. */\n readonly valueText: string | null;\n /** `value` is `null`. */\n readonly indeterminate: boolean;\n /** The clamped value has reached `max`. */\n readonly complete: boolean;\n}\n\nexport interface ProgressRootProps extends Omit<\n ComponentPropsWithRef<\"div\">,\n | \"role\"\n | \"aria-valuemin\"\n | \"aria-valuemax\"\n | \"aria-valuenow\"\n | \"aria-valuetext\"\n | \"defaultValue\"\n | \"defaultChecked\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** The current value. Absent or `null`: indeterminate. Clamped to `[min, max]`. */\n value?: number | null;\n /** @default 0 */\n min?: number;\n /** @default 100 */\n max?: number;\n /**\n * `Intl.NumberFormat` options for `aria-valuetext` and `Progress.Value`. Default\n * `{ style: \"percent\" }`. A `percent` style formats the fraction of the range; any other style\n * formats the value. Serialisable: a Server Component may pass it.\n */\n format?: Intl.NumberFormatOptions;\n /**\n * BCP 47 tag for `Intl.NumberFormat`; default: the runtime's locale. Pass it when a client\n * tree is server-rendered.\n */\n locale?: string;\n /**\n * The `aria-valuetext` to render instead of `formattedValue`. Called with the clamped value\n * (`null` while indeterminate) and the state as it would be without this prop. Return `null`\n * to render no `aria-valuetext`. A function: from a Server Component it works when this Root\n * is rendered by that Server Component (the Root runs on the server), not when the Root is\n * rendered by a client component.\n */\n getAriaValueText?: (value: number | null, state: ProgressState) => string | null | undefined;\n className?: StateValue<string | undefined, ProgressState>;\n style?: StateValue<CSSProperties | undefined, ProgressState>;\n children?: StateValue<ReactNode, ProgressState>;\n render?: RenderProp<ComponentPropsWithRef<\"div\">, ProgressState>;\n}\n\n/**\n * `Progress.Root`: a `div[role=progressbar]` with the ARIA values, `aria-valuetext` from\n * `Intl.NumberFormat`, `data-indeterminate` / `data-complete`, and `--progress-value` (the\n * percentage, absent while indeterminate) in `style`, where the consumer's entries win. Owned\n * keys: `role`, `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, `aria-valuetext`,\n * `aria-labelledby` (token-merged: the consumer's tokens, then `Progress.Label`'s id, always),\n * `data-indeterminate`, `data-complete`.\n */\nexport function ProgressRoot({\n value = null,\n min = 0,\n max = 100,\n format,\n locale,\n getAriaValueText,\n className,\n style,\n children,\n render,\n ref,\n ...rest\n}: ProgressRootProps) {\n const id = useId();\n\n let given = value;\n if (given !== null && !Number.isFinite(given)) {\n warnOnce(\n `Progress.Root:non-finite:${given}`,\n `Progress.Root: \\`value\\` is ${given}, which is not a finite number; the bar is rendered ` +\n \"as indeterminate. Pass `null` for an unknown value.\",\n );\n given = null;\n }\n const degenerate = isDegenerate(min, max);\n if (degenerate) {\n warnOnce(\n `Progress.Root:degenerate:${min}:${max}`,\n `Progress.Root: \\`max\\` (${max}) must be greater than \\`min\\` (${min}); the percentage is ` +\n \"rendered as 0. Pass `value={null}` while the total is unknown or empty.\",\n );\n }\n\n const clamped = given === null ? null : clamp(given, min, max);\n const formattedValue =\n clamped === null ? null : formatRangeValue(clamped, min, max, format, locale);\n const base: ProgressState = {\n value: clamped,\n min,\n max,\n percentage: clamped === null ? null : percentage(clamped, min, max),\n formattedValue,\n valueText: formattedValue,\n indeterminate: clamped === null,\n complete: clamped !== null && !degenerate && clamped >= max,\n };\n const valueText =\n getAriaValueText === undefined ? formattedValue : (getAriaValueText(clamped, base) ?? null);\n const state: ProgressState = valueText === base.valueText ? base : { ...base, valueText };\n\n const variables = state.percentage === null ? {} : { \"--progress-value\": `${state.percentage}%` };\n\n const libraryProps: Partial<ComponentPropsWithRef<\"div\">> & DataAttributes = {\n role: \"progressbar\",\n \"aria-valuemin\": min,\n \"aria-valuemax\": max,\n \"aria-valuenow\": clamped ?? undefined,\n \"aria-valuetext\": valueText ?? undefined,\n \"aria-labelledby\": `${id}-label`,\n \"data-indeterminate\": dataAttr(state.indeterminate),\n \"data-complete\": dataAttr(state.complete),\n };\n\n const element = renderElement<ComponentPropsWithRef<\"div\">, ProgressState>({\n defaultElement: \"div\",\n render,\n state,\n className,\n // The custom property loses to the consumer's own entry (design 3.1).\n style: (s) => ({ ...(variables as CSSProperties), ...resolveStateValue(style, s) }),\n children,\n props: rest,\n libraryProps,\n // Passed through to the element, never read during render.\n // oxlint-disable-next-line react/refs\n ref: mergeRenderRef(ref, render),\n });\n\n return <ProgressContext value={{ id, state }}>{element}</ProgressContext>;\n}\n\nProgressRoot.displayName = \"ProgressRoot\";\n"],"mappings":";;;;;;;;;;;;;;;;AAuFA,SAAgB,aAAa,EAC3B,QAAQ,MACR,MAAM,GACN,MAAM,KACN,QACA,QACA,kBACA,WACA,OACA,UACA,QACA,KACA,GAAG,QACiB;CACpB,MAAM,KAAK,MAAM;CAEjB,IAAI,QAAQ;CACZ,IAAI,UAAU,QAAQ,CAAC,OAAO,SAAS,KAAK,GAAG;EAC7C,SACE,4BAA4B,SAC5B,+BAA+B,MAAM,0GAEvC;EACA,QAAQ;CACV;CACA,MAAM,aAAa,aAAa,KAAK,GAAG;CACxC,IAAI,YACF,SACE,4BAA4B,IAAI,GAAG,OACnC,2BAA2B,IAAI,kCAAkC,IAAI,+FAEvE;CAGF,MAAM,UAAU,UAAU,OAAO,OAAO,MAAM,OAAO,KAAK,GAAG;CAC7D,MAAM,iBACJ,YAAY,OAAO,OAAO,iBAAiB,SAAS,KAAK,KAAK,QAAQ,MAAM;CAC9E,MAAM,OAAsB;EAC1B,OAAO;EACP;EACA;EACA,YAAY,YAAY,OAAO,OAAO,WAAW,SAAS,KAAK,GAAG;EAClE;EACA,WAAW;EACX,eAAe,YAAY;EAC3B,UAAU,YAAY,QAAQ,CAAC,cAAc,WAAW;CAC1D;CACA,MAAM,YACJ,qBAAqB,KAAA,IAAY,iBAAkB,iBAAiB,SAAS,IAAI,KAAK;CACxF,MAAM,QAAuB,cAAc,KAAK,YAAY,OAAO;EAAE,GAAG;EAAM;CAAU;CAExF,MAAM,YAAY,MAAM,eAAe,OAAO,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,WAAW,GAAG;CAEhG,MAAM,eAAuE;EAC3E,MAAM;EACN,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB,WAAW,KAAA;EAC5B,kBAAkB,aAAa,KAAA;EAC/B,mBAAmB,GAAG,GAAG;EACzB,sBAAsB,SAAS,MAAM,aAAa;EAClD,iBAAiB,SAAS,MAAM,QAAQ;CAC1C;CAEA,MAAM,UAAU,cAA2D;EACzE,gBAAgB;EAChB;EACA;EACA;EAEA,QAAQ,OAAO;GAAE,GAAI;GAA6B,GAAG,kBAAkB,OAAO,CAAC;EAAE;EACjF;EACA,OAAO;EACP;EAGA,KAAK,eAAe,KAAK,MAAM;CACjC,CAAC;CAED,OAAO,oBAAC,iBAAD;EAAiB,OAAO;GAAE;GAAI;EAAM;EAAI,UAAA;CAAyB,CAAA;AAC1E;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"progress-root.mjs","names":[],"sources":["../../src/progress/progress-root.tsx"],"sourcesContent":["// No \"use client\": `Progress.Root` uses only `useId`, arithmetic and `Intl`, and renders the\n// client context's provider (conventions 7.1's second exception). Rendered by a Server Component\n// it runs once, on the server (design/components/progress.md 8.1). It must not import from any\n// \"use client\" module except its context (checked by src/__tests__/directives.test.ts).\nimport { useId } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { warnOnce } from \"../internal/dev-warn.js\";\nimport { clamp, formatRangeValue, isDegenerate, percentage } from \"../internal/range-value.js\";\nimport { mergeRenderRef, renderElement, resolveStateValue } from \"../internal/render-element.js\";\nimport type { DataAttributes } from \"../internal/render-element.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { ProgressContext } from \"./progress-context.js\";\n\n/** The state every Progress part receives. */\nexport interface ProgressState {\n /** The value clamped to `[min, max]`, or `null` while indeterminate. */\n readonly value: number | null;\n /** The `min` prop. */\n readonly min: number;\n /** The `max` prop. */\n readonly max: number;\n /** `(value - min) / (max - min) * 100`, a number 0–100; `null` while indeterminate. */\n readonly percentage: number | null;\n /**\n * The `Intl.NumberFormat` text of the value (or of the fraction, for the percent style): what\n * `Progress.Value` shows. `null` while indeterminate.\n */\n readonly formattedValue: string | null;\n /** What `aria-valuetext` carries: `getAriaValueText`'s result, else `formattedValue`. */\n readonly valueText: string | null;\n /** `value` is `null`. */\n readonly indeterminate: boolean;\n /** The clamped value has reached `max`. */\n readonly complete: boolean;\n}\n\n/**\n * Props of `Progress.Root`.\n *\n * @see https://ui.funstack.work/components/progress\n */\nexport interface ProgressRootProps extends Omit<\n ComponentPropsWithRef<\"div\">,\n | \"role\"\n | \"aria-valuemin\"\n | \"aria-valuemax\"\n | \"aria-valuenow\"\n | \"aria-valuetext\"\n | \"defaultValue\"\n | \"defaultChecked\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * The current value. Absent or `null`: indeterminate. Clamped to `[min, max]`.\n *\n * @defaultValue `null`\n */\n value?: number | null;\n /**\n * Lower bound of the range.\n *\n * @defaultValue `0`\n */\n min?: number;\n /**\n * Upper bound of the range.\n *\n * @defaultValue `100`\n */\n max?: number;\n /**\n * `Intl.NumberFormat` options for `aria-valuetext` and `Progress.Value`. A `percent` style\n * formats the fraction of the range; any other style formats the value. Serialisable: a Server\n * Component may pass it.\n *\n * @defaultValue `{ style: \"percent\" }`\n */\n format?: Intl.NumberFormatOptions;\n /**\n * BCP 47 tag for `Intl.NumberFormat`. Pass it when a client tree is server-rendered.\n *\n * @defaultValue the runtime's locale\n */\n locale?: string;\n /**\n * The `aria-valuetext` to render instead of `formattedValue`. Called with the clamped value\n * (`null` while indeterminate) and the state as it would be without this prop. Return `null`\n * to render no `aria-valuetext`. A function: from a Server Component it works when this Root\n * is rendered by that Server Component (the Root runs on the server), not when the Root is\n * rendered by a client component.\n */\n getAriaValueText?: (value: number | null, state: ProgressState) => string | null | undefined;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, ProgressState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, ProgressState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, ProgressState>;\n /** Replace the default `<div>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"div\">, ProgressState>;\n}\n\n/**\n * `Progress.Root`: a `div[role=progressbar]` with the ARIA values, `aria-valuetext` from\n * `Intl.NumberFormat`, `data-indeterminate` / `data-complete`, and `--progress-value` (the\n * percentage, absent while indeterminate) in `style`, where the consumer's entries win. Owned\n * keys: `role`, `aria-valuemin`, `aria-valuemax`, `aria-valuenow`, `aria-valuetext`,\n * `aria-labelledby` (token-merged: the consumer's tokens, then `Progress.Label`'s id, always),\n * `data-indeterminate`, `data-complete`.\n *\n * @see https://ui.funstack.work/components/progress\n */\nexport function ProgressRoot({\n value = null,\n min = 0,\n max = 100,\n format,\n locale,\n getAriaValueText,\n className,\n style,\n children,\n render,\n ref,\n ...rest\n}: ProgressRootProps) {\n const id = useId();\n\n let given = value;\n if (given !== null && !Number.isFinite(given)) {\n warnOnce(\n `Progress.Root:non-finite:${given}`,\n `Progress.Root: \\`value\\` is ${given}, which is not a finite number; the bar is rendered ` +\n \"as indeterminate. Pass `null` for an unknown value.\",\n );\n given = null;\n }\n const degenerate = isDegenerate(min, max);\n if (degenerate) {\n warnOnce(\n `Progress.Root:degenerate:${min}:${max}`,\n `Progress.Root: \\`max\\` (${max}) must be greater than \\`min\\` (${min}); the percentage is ` +\n \"rendered as 0. Pass `value={null}` while the total is unknown or empty.\",\n );\n }\n\n const clamped = given === null ? null : clamp(given, min, max);\n const formattedValue =\n clamped === null ? null : formatRangeValue(clamped, min, max, format, locale);\n const base: ProgressState = {\n value: clamped,\n min,\n max,\n percentage: clamped === null ? null : percentage(clamped, min, max),\n formattedValue,\n valueText: formattedValue,\n indeterminate: clamped === null,\n complete: clamped !== null && !degenerate && clamped >= max,\n };\n const valueText =\n getAriaValueText === undefined ? formattedValue : (getAriaValueText(clamped, base) ?? null);\n const state: ProgressState = valueText === base.valueText ? base : { ...base, valueText };\n\n const variables = state.percentage === null ? {} : { \"--progress-value\": `${state.percentage}%` };\n\n const libraryProps: Partial<ComponentPropsWithRef<\"div\">> & DataAttributes = {\n role: \"progressbar\",\n \"aria-valuemin\": min,\n \"aria-valuemax\": max,\n \"aria-valuenow\": clamped ?? undefined,\n \"aria-valuetext\": valueText ?? undefined,\n \"aria-labelledby\": `${id}-label`,\n \"data-indeterminate\": dataAttr(state.indeterminate),\n \"data-complete\": dataAttr(state.complete),\n };\n\n const element = renderElement<ComponentPropsWithRef<\"div\">, ProgressState>({\n defaultElement: \"div\",\n render,\n state,\n className,\n // The custom property loses to the consumer's own entry (design 3.1).\n style: (s) => ({ ...(variables as CSSProperties), ...resolveStateValue(style, s) }),\n children,\n props: rest,\n libraryProps,\n // Passed through to the element, never read during render.\n // oxlint-disable-next-line react/refs\n ref: mergeRenderRef(ref, render),\n });\n\n return <ProgressContext value={{ id, state }}>{element}</ProgressContext>;\n}\n\nProgressRoot.displayName = \"ProgressRoot\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmHA,SAAgB,aAAa,EAC3B,QAAQ,MACR,MAAM,GACN,MAAM,KACN,QACA,QACA,kBACA,WACA,OACA,UACA,QACA,KACA,GAAG,QACiB;CACpB,MAAM,KAAK,MAAM;CAEjB,IAAI,QAAQ;CACZ,IAAI,UAAU,QAAQ,CAAC,OAAO,SAAS,KAAK,GAAG;EAC7C,SACE,4BAA4B,SAC5B,+BAA+B,MAAM,0GAEvC;EACA,QAAQ;CACV;CACA,MAAM,aAAa,aAAa,KAAK,GAAG;CACxC,IAAI,YACF,SACE,4BAA4B,IAAI,GAAG,OACnC,2BAA2B,IAAI,kCAAkC,IAAI,+FAEvE;CAGF,MAAM,UAAU,UAAU,OAAO,OAAO,MAAM,OAAO,KAAK,GAAG;CAC7D,MAAM,iBACJ,YAAY,OAAO,OAAO,iBAAiB,SAAS,KAAK,KAAK,QAAQ,MAAM;CAC9E,MAAM,OAAsB;EAC1B,OAAO;EACP;EACA;EACA,YAAY,YAAY,OAAO,OAAO,WAAW,SAAS,KAAK,GAAG;EAClE;EACA,WAAW;EACX,eAAe,YAAY;EAC3B,UAAU,YAAY,QAAQ,CAAC,cAAc,WAAW;CAC1D;CACA,MAAM,YACJ,qBAAqB,KAAA,IAAY,iBAAkB,iBAAiB,SAAS,IAAI,KAAK;CACxF,MAAM,QAAuB,cAAc,KAAK,YAAY,OAAO;EAAE,GAAG;EAAM;CAAU;CAExF,MAAM,YAAY,MAAM,eAAe,OAAO,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,WAAW,GAAG;CAEhG,MAAM,eAAuE;EAC3E,MAAM;EACN,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB,WAAW,KAAA;EAC5B,kBAAkB,aAAa,KAAA;EAC/B,mBAAmB,GAAG,GAAG;EACzB,sBAAsB,SAAS,MAAM,aAAa;EAClD,iBAAiB,SAAS,MAAM,QAAQ;CAC1C;CAEA,MAAM,UAAU,cAA2D;EACzE,gBAAgB;EAChB;EACA;EACA;EAEA,QAAQ,OAAO;GAAE,GAAI;GAA6B,GAAG,kBAAkB,OAAO,CAAC;EAAE;EACjF;EACA,OAAO;EACP;EAGA,KAAK,eAAe,KAAK,MAAM;CACjC,CAAC;CAED,OAAO,oBAAC,iBAAD;EAAiB,OAAO;GAAE;GAAI;EAAM;EAAI,UAAA;CAAyB,CAAA;AAC1E;AAEA,aAAa,cAAc"}
@@ -2,14 +2,25 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { ProgressState } from "./progress-root.mjs";
3
3
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
4
4
  //#region src/progress/progress-track.d.ts
5
+ /**
6
+ * Props of `Progress.Track`.
7
+ *
8
+ * @see https://ui.funstack.work/components/progress
9
+ */
5
10
  export interface ProgressTrackProps extends Omit<ComponentPropsWithRef<"div">, "className" | "style" | "children"> {
11
+ /** Class name, or a function of the part's state that returns one. */
6
12
  className?: StateValue<string | undefined, ProgressState>;
13
+ /** Inline style, or a function of the part's state that returns one. */
7
14
  style?: StateValue<CSSProperties | undefined, ProgressState>;
15
+ /** Content, or a function of the part's state. */
8
16
  children?: StateValue<ReactNode, ProgressState>;
17
+ /** Replace the default `<div>` (element form) or take over rendering (function form). */
9
18
  render?: RenderProp<ComponentPropsWithRef<"div">, ProgressState>;
10
19
  }
11
20
  /**
12
21
  * `Progress.Track`: the rail. It renders nothing but the state's data attributes. Owned keys: `data-indeterminate`, `data-complete`.
22
+ *
23
+ * @see https://ui.funstack.work/components/progress
13
24
  */
14
25
  export declare function ProgressTrack({ className, style, children, render, ...rest }: ProgressTrackProps): ReactNode;
15
26
  export declare namespace ProgressTrack {
@@ -1 +1 @@
1
- {"version":3,"file":"progress-track.d.mts","names":[],"sources":["../../src/progress/progress-track.tsx"],"mappings":";;;;iBAQiB,2BAA2B,KAC1C;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;EAC9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,8BAA8B;;;;;wBAMpC,gBAAgB,WAAW,OAAO,UAAU,WAAW,QAAQ,qBAAkB;yBAAjF"}
1
+ {"version":3,"file":"progress-track.d.mts","names":[],"sources":["../../src/progress/progress-track.tsx"],"mappings":";;;;;;;;;iBAaiB,2BAA2B,KAC1C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,8BAA8B;;;;;;;wBAQpC,gBAAgB,WAAW,OAAO,UAAU,WAAW,QAAQ,qBAAkB;yBAAjF"}
@@ -5,6 +5,8 @@ import { useProgressContext } from "./progress-context.mjs";
5
5
  //#region src/progress/progress-track.tsx
6
6
  /**
7
7
  * `Progress.Track`: the rail. It renders nothing but the state's data attributes. Owned keys: `data-indeterminate`, `data-complete`.
8
+ *
9
+ * @see https://ui.funstack.work/components/progress
8
10
  */
9
11
  function ProgressTrack({ className, style, children, render, ...rest }) {
10
12
  const { state } = useProgressContext("Progress.Track");
@@ -1 +1 @@
1
- {"version":3,"file":"progress-track.mjs","names":[],"sources":["../../src/progress/progress-track.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useProgressContext } from \"./progress-context.js\";\nimport type { ProgressState } from \"./progress-root.js\";\n\nexport interface ProgressTrackProps extends Omit<\n ComponentPropsWithRef<\"div\">,\n \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, ProgressState>;\n style?: StateValue<CSSProperties | undefined, ProgressState>;\n children?: StateValue<ReactNode, ProgressState>;\n render?: RenderProp<ComponentPropsWithRef<\"div\">, ProgressState>;\n}\n\n/**\n * `Progress.Track`: the rail. It renders nothing but the state's data attributes. Owned keys: `data-indeterminate`, `data-complete`.\n */\nexport function ProgressTrack({ className, style, children, render, ...rest }: ProgressTrackProps) {\n const { state } = useProgressContext(\"Progress.Track\");\n return useRender<ComponentPropsWithRef<\"div\">, ProgressState>({\n defaultElement: \"div\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n \"data-indeterminate\": dataAttr(state.indeterminate),\n \"data-complete\": dataAttr(state.complete),\n },\n });\n}\n\nProgressTrack.displayName = \"ProgressTrack\";\n"],"mappings":";;;;;;;;AAqBA,SAAgB,cAAc,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA4B;CACjG,MAAM,EAAE,UAAU,mBAAmB,gBAAgB;CACrD,OAAO,UAAuD;EAC5D,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc;GACZ,sBAAsB,SAAS,MAAM,aAAa;GAClD,iBAAiB,SAAS,MAAM,QAAQ;EAC1C;CACF,CAAC;AACH;AAEA,cAAc,cAAc"}
1
+ {"version":3,"file":"progress-track.mjs","names":[],"sources":["../../src/progress/progress-track.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useProgressContext } from \"./progress-context.js\";\nimport type { ProgressState } from \"./progress-root.js\";\n\n/**\n * Props of `Progress.Track`.\n *\n * @see https://ui.funstack.work/components/progress\n */\nexport interface ProgressTrackProps extends Omit<\n ComponentPropsWithRef<\"div\">,\n \"className\" | \"style\" | \"children\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, ProgressState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, ProgressState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, ProgressState>;\n /** Replace the default `<div>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"div\">, ProgressState>;\n}\n\n/**\n * `Progress.Track`: the rail. It renders nothing but the state's data attributes. Owned keys: `data-indeterminate`, `data-complete`.\n *\n * @see https://ui.funstack.work/components/progress\n */\nexport function ProgressTrack({ className, style, children, render, ...rest }: ProgressTrackProps) {\n const { state } = useProgressContext(\"Progress.Track\");\n return useRender<ComponentPropsWithRef<\"div\">, ProgressState>({\n defaultElement: \"div\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n \"data-indeterminate\": dataAttr(state.indeterminate),\n \"data-complete\": dataAttr(state.complete),\n },\n });\n}\n\nProgressTrack.displayName = \"ProgressTrack\";\n"],"mappings":";;;;;;;;;;AAgCA,SAAgB,cAAc,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA4B;CACjG,MAAM,EAAE,UAAU,mBAAmB,gBAAgB;CACrD,OAAO,UAAuD;EAC5D,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc;GACZ,sBAAsB,SAAS,MAAM,aAAa;GAClD,iBAAiB,SAAS,MAAM,QAAQ;EAC1C;CACF,CAAC;AACH;AAEA,cAAc,cAAc"}
@@ -2,15 +2,29 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { ProgressState } from "./progress-root.mjs";
3
3
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
4
4
  //#region src/progress/progress-value.d.ts
5
+ /**
6
+ * Props of `Progress.Value`.
7
+ *
8
+ * @see https://ui.funstack.work/components/progress
9
+ */
5
10
  export interface ProgressValueProps extends Omit<ComponentPropsWithRef<"span">, "className" | "style" | "children"> {
11
+ /** Class name, or a function of the part's state that returns one. */
6
12
  className?: StateValue<string | undefined, ProgressState>;
13
+ /** Inline style, or a function of the part's state that returns one. */
7
14
  style?: StateValue<CSSProperties | undefined, ProgressState>;
8
- /** Default: `state.formattedValue` (nothing while indeterminate). */
15
+ /**
16
+ * The text shown, or a function of the part's state.
17
+ *
18
+ * @defaultValue `state.formattedValue` (nothing while indeterminate)
19
+ */
9
20
  children?: StateValue<ReactNode, ProgressState>;
21
+ /** Replace the default `<span>` (element form) or take over rendering (function form). */
10
22
  render?: RenderProp<ComponentPropsWithRef<"span">, ProgressState>;
11
23
  }
12
24
  /**
13
25
  * `Progress.Value`: shows `state.formattedValue` or `children(state)`. `aria-hidden="true"` is a default the consumer may override, not an owned key: the same text is in the Root's `aria-valuetext`. Owned keys: `data-indeterminate`, `data-complete`.
26
+ *
27
+ * @see https://ui.funstack.work/components/progress
14
28
  */
15
29
  export declare function ProgressValue({ className, style, children, render, ...rest }: ProgressValueProps): ReactNode;
16
30
  export declare namespace ProgressValue {
@@ -1 +1 @@
1
- {"version":3,"file":"progress-value.d.mts","names":[],"sources":["../../src/progress/progress-value.tsx"],"mappings":";;;;iBAQiB,2BAA2B,KAC1C;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,+BAA+B;;;;;wBAMrC,gBAAgB,WAAW,OAAO,UAAU,WAAW,QAAQ,qBAAkB;yBAAjF"}
1
+ {"version":3,"file":"progress-value.d.mts","names":[],"sources":["../../src/progress/progress-value.tsx"],"mappings":";;;;;;;;;iBAaiB,2BAA2B,KAC1C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;;;;;EAM9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,+BAA+B;;;;;;;wBAQrC,gBAAgB,WAAW,OAAO,UAAU,WAAW,QAAQ,qBAAkB;yBAAjF"}
@@ -5,6 +5,8 @@ import { useProgressContext } from "./progress-context.mjs";
5
5
  //#region src/progress/progress-value.tsx
6
6
  /**
7
7
  * `Progress.Value`: shows `state.formattedValue` or `children(state)`. `aria-hidden="true"` is a default the consumer may override, not an owned key: the same text is in the Root's `aria-valuetext`. Owned keys: `data-indeterminate`, `data-complete`.
8
+ *
9
+ * @see https://ui.funstack.work/components/progress
8
10
  */
9
11
  function ProgressValue({ className, style, children, render, ...rest }) {
10
12
  const { state } = useProgressContext("Progress.Value");
@@ -1 +1 @@
1
- {"version":3,"file":"progress-value.mjs","names":[],"sources":["../../src/progress/progress-value.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useProgressContext } from \"./progress-context.js\";\nimport type { ProgressState } from \"./progress-root.js\";\n\nexport interface ProgressValueProps extends Omit<\n ComponentPropsWithRef<\"span\">,\n \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, ProgressState>;\n style?: StateValue<CSSProperties | undefined, ProgressState>;\n /** Default: `state.formattedValue` (nothing while indeterminate). */\n children?: StateValue<ReactNode, ProgressState>;\n render?: RenderProp<ComponentPropsWithRef<\"span\">, ProgressState>;\n}\n\n/**\n * `Progress.Value`: shows `state.formattedValue` or `children(state)`. `aria-hidden=\"true\"` is a default the consumer may override, not an owned key: the same text is in the Root's `aria-valuetext`. Owned keys: `data-indeterminate`, `data-complete`.\n */\nexport function ProgressValue({ className, style, children, render, ...rest }: ProgressValueProps) {\n const { state } = useProgressContext(\"Progress.Value\");\n const props = { ...rest, \"aria-hidden\": rest[\"aria-hidden\"] ?? true };\n return useRender<ComponentPropsWithRef<\"span\">, ProgressState>({\n defaultElement: \"span\",\n render,\n state,\n className,\n style,\n children: children ?? state.formattedValue,\n props,\n libraryProps: {\n \"data-indeterminate\": dataAttr(state.indeterminate),\n \"data-complete\": dataAttr(state.complete),\n },\n });\n}\n\nProgressValue.displayName = \"ProgressValue\";\n"],"mappings":";;;;;;;;AAsBA,SAAgB,cAAc,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA4B;CACjG,MAAM,EAAE,UAAU,mBAAmB,gBAAgB;CACrD,MAAM,QAAQ;EAAE,GAAG;EAAM,eAAe,KAAK,kBAAkB;CAAK;CACpE,OAAO,UAAwD;EAC7D,gBAAgB;EAChB;EACA;EACA;EACA;EACA,UAAU,YAAY,MAAM;EAC5B;EACA,cAAc;GACZ,sBAAsB,SAAS,MAAM,aAAa;GAClD,iBAAiB,SAAS,MAAM,QAAQ;EAC1C;CACF,CAAC;AACH;AAEA,cAAc,cAAc"}
1
+ {"version":3,"file":"progress-value.mjs","names":[],"sources":["../../src/progress/progress-value.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useProgressContext } from \"./progress-context.js\";\nimport type { ProgressState } from \"./progress-root.js\";\n\n/**\n * Props of `Progress.Value`.\n *\n * @see https://ui.funstack.work/components/progress\n */\nexport interface ProgressValueProps extends Omit<\n ComponentPropsWithRef<\"span\">,\n \"className\" | \"style\" | \"children\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, ProgressState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, ProgressState>;\n /**\n * The text shown, or a function of the part's state.\n *\n * @defaultValue `state.formattedValue` (nothing while indeterminate)\n */\n children?: StateValue<ReactNode, ProgressState>;\n /** Replace the default `<span>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"span\">, ProgressState>;\n}\n\n/**\n * `Progress.Value`: shows `state.formattedValue` or `children(state)`. `aria-hidden=\"true\"` is a default the consumer may override, not an owned key: the same text is in the Root's `aria-valuetext`. Owned keys: `data-indeterminate`, `data-complete`.\n *\n * @see https://ui.funstack.work/components/progress\n */\nexport function ProgressValue({ className, style, children, render, ...rest }: ProgressValueProps) {\n const { state } = useProgressContext(\"Progress.Value\");\n const props = { ...rest, \"aria-hidden\": rest[\"aria-hidden\"] ?? true };\n return useRender<ComponentPropsWithRef<\"span\">, ProgressState>({\n defaultElement: \"span\",\n render,\n state,\n className,\n style,\n children: children ?? state.formattedValue,\n props,\n libraryProps: {\n \"data-indeterminate\": dataAttr(state.indeterminate),\n \"data-complete\": dataAttr(state.complete),\n },\n });\n}\n\nProgressValue.displayName = \"ProgressValue\";\n"],"mappings":";;;;;;;;;;AAoCA,SAAgB,cAAc,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA4B;CACjG,MAAM,EAAE,UAAU,mBAAmB,gBAAgB;CACrD,MAAM,QAAQ;EAAE,GAAG;EAAM,eAAe,KAAK,kBAAkB;CAAK;CACpE,OAAO,UAAwD;EAC7D,gBAAgB;EAChB;EACA;EACA;EACA;EACA,UAAU,YAAY,MAAM;EAC5B;EACA,cAAc;GACZ,sBAAsB,SAAS,MAAM,aAAa;GAClD,iBAAiB,SAAS,MAAM,QAAQ;EAC1C;CACF,CAAC;AACH;AAEA,cAAc,cAAc"}
@@ -9,6 +9,8 @@ import { RadioGroupLabel, RadioGroupLabelProps } from "./radio-group-label.mjs";
9
9
  * (`input[type=radio]`) per option. The keyboard is entirely native. Each Item's DOM `checked` is
10
10
  * the optimistic value; the Root and the checked Item carry `data-pending` while
11
11
  * `valueChangeAction` is in flight.
12
+ *
13
+ * @see https://ui.funstack.work/components/radio-group
12
14
  */
13
15
  export declare const RadioGroup: {
14
16
  readonly Root: typeof RadioGroupRoot;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/radio-group/index.ts"],"mappings":";;;;;;;;;;;;qBAca;WACX,aAAI;WACJ,cAAK;WACL,aAAI"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/radio-group/index.ts"],"mappings":";;;;;;;;;;;;;;qBAgBa;WACX,aAAI;WACJ,cAAK;WACL,aAAI"}
@@ -8,6 +8,8 @@ import { RadioGroupRoot } from "./radio-group-root.mjs";
8
8
  * (`input[type=radio]`) per option. The keyboard is entirely native. Each Item's DOM `checked` is
9
9
  * the optimistic value; the Root and the checked Item carry `data-pending` while
10
10
  * `valueChangeAction` is in flight.
11
+ *
12
+ * @see https://ui.funstack.work/components/radio-group
11
13
  */
12
14
  const RadioGroup = {
13
15
  Root: RadioGroupRoot,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/radio-group/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 { RadioGroupItem } from \"./radio-group-item.js\";\nimport { RadioGroupLabel } from \"./radio-group-label.js\";\nimport { RadioGroupRoot } from \"./radio-group-root.js\";\n\n/**\n * RadioGroup (WAI-ARIA APG Radio Group pattern, native HTML radio variant): `Root`\n * (`fieldset[role=radiogroup]`), an optional `Label` (`legend`, first child) and one `Item`\n * (`input[type=radio]`) per option. The keyboard is entirely native. Each Item's DOM `checked` is\n * the optimistic value; the Root and the checked Item carry `data-pending` while\n * `valueChangeAction` is in flight.\n */\nexport const RadioGroup = {\n Root: RadioGroupRoot,\n Label: RadioGroupLabel,\n Item: RadioGroupItem,\n} as const;\n\nexport type {\n RadioGroupRootProps,\n RadioGroupRootState,\n RadioGroupValueChangeDetails,\n} from \"./radio-group-root.js\";\nexport type { RadioGroupLabelProps } from \"./radio-group-label.js\";\nexport type { RadioGroupItemProps, RadioGroupItemState } from \"./radio-group-item.js\";\n"],"mappings":";;;;;;;;;;;AAcA,MAAa,aAAa;CACxB,MAAM;CACN,OAAO;CACP,MAAM;AACR"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/radio-group/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 { RadioGroupItem } from \"./radio-group-item.js\";\nimport { RadioGroupLabel } from \"./radio-group-label.js\";\nimport { RadioGroupRoot } from \"./radio-group-root.js\";\n\n/**\n * RadioGroup (WAI-ARIA APG Radio Group pattern, native HTML radio variant): `Root`\n * (`fieldset[role=radiogroup]`), an optional `Label` (`legend`, first child) and one `Item`\n * (`input[type=radio]`) per option. The keyboard is entirely native. Each Item's DOM `checked` is\n * the optimistic value; the Root and the checked Item carry `data-pending` while\n * `valueChangeAction` is in flight.\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport const RadioGroup = {\n Root: RadioGroupRoot,\n Label: RadioGroupLabel,\n Item: RadioGroupItem,\n} as const;\n\nexport type {\n RadioGroupRootProps,\n RadioGroupRootState,\n RadioGroupValueChangeDetails,\n} from \"./radio-group-root.js\";\nexport type { RadioGroupLabelProps } from \"./radio-group-label.js\";\nexport type { RadioGroupItemProps, RadioGroupItemState } from \"./radio-group-item.js\";\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAa,aAAa;CACxB,MAAM;CACN,OAAO;CACP,MAAM;AACR"}
@@ -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/radio-group/radio-group-item.d.ts
4
+ /**
5
+ * State of `RadioGroup.Item`, passed to the function forms of `className`, `style` and `render`.
6
+ */
4
7
  export interface RadioGroupItemState {
8
+ /** The Item's `value` prop. */
5
9
  readonly value: string;
6
10
  /** Optimistic: true as soon as the user checks this radio, before the action settles. */
7
11
  readonly checked: boolean;
@@ -10,10 +14,19 @@ export interface RadioGroupItemState {
10
14
  /** Disabled by its own prop or by `Root disabled`. */
11
15
  readonly disabled: boolean;
12
16
  }
17
+ /**
18
+ * Props of `RadioGroup.Item`.
19
+ *
20
+ * @see https://ui.funstack.work/components/radio-group
21
+ */
13
22
  export interface RadioGroupItemProps extends Omit<ComponentPropsWithRef<"input">, "type" | "name" | "value" | "checked" | "defaultChecked" | "defaultValue" | "form" | "required" | "onChange" | "className" | "style" | "children"> {
14
23
  /** The value this radio checks. Must be unique within the Root. Submitted as the form value. */
15
24
  value: string;
16
- /** Native `disabled`: unfocusable, skipped by arrow keys, never dispatches. */
25
+ /**
26
+ * Native `disabled`: unfocusable, skipped by arrow keys, never dispatches.
27
+ *
28
+ * @defaultValue `false`
29
+ */
17
30
  disabled?: boolean;
18
31
  /**
19
32
  * Forwarded to the Item's `<ViewTransition default>`. Default: no boundary. Fires only on the commit
@@ -25,7 +38,9 @@ export interface RadioGroupItemProps extends Omit<ComponentPropsWithRef<"input">
25
38
  * page cross-fade that the next transition waits for).
26
39
  */
27
40
  transition?: ViewTransitionClass;
41
+ /** Class name, or a function of the part's state that returns one. */
28
42
  className?: StateValue<string | undefined, RadioGroupItemState>;
43
+ /** Inline style, or a function of the part's state that returns one. */
29
44
  style?: StateValue<CSSProperties | undefined, RadioGroupItemState>;
30
45
  /** Replace the rendered element. Must keep an `<input>`; the library sets `type="radio"`. */
31
46
  render?: RenderProp<ComponentPropsWithRef<"input">, RadioGroupItemState>;
@@ -44,6 +59,8 @@ export interface RadioGroupItemProps extends Omit<ComponentPropsWithRef<"input">
44
59
  * `checked`. An Item added on the client while the Root's `value` equals its value gets
45
60
  * `defaultChecked` too, so two radios may carry it and a reset does not necessarily return to
46
61
  * the group's mount-time value (see `RadioGroup.Root` `value`).
62
+ *
63
+ * @see https://ui.funstack.work/components/radio-group
47
64
  */
48
65
  export declare function RadioGroupItem({ value, disabled: disabledProp, transition, className, style, render, ...rest }: RadioGroupItemProps): import("react").ReactNode;
49
66
  export declare namespace RadioGroupItem {
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group-item.d.mts","names":[],"sources":["../../src/radio-group/radio-group-item.tsx"],"mappings":";;;iBAUiB;WACN;;WAEA;;WAEA;;WAEA;;iBAGM,4BAA4B,KAC3C;;EAeA;;EAEA;;;;;;;;;;EAUA,aAAa;EACb,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;EAE9C,SAAS,WAAW,gCAAgC;;;;;;;;;;;;;;;;;wBAkBtC,iBACd,OACA,UAAU,cACV,YACA,WACA,OACA,WACG,QACF,sCAAmB;yBARN"}
1
+ {"version":3,"file":"radio-group-item.d.mts","names":[],"sources":["../../src/radio-group/radio-group-item.tsx"],"mappings":";;;;;;iBAaiB;;WAEN;;WAEA;;WAEA;;WAEA;;;;;;;iBAQM,4BAA4B,KAC3C;;EAeA;;;;;;EAMA;;;;;;;;;;EAUA,aAAa;;EAEb,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,SAAS,WAAW,gCAAgC;;;;;;;;;;;;;;;;;;;wBAoBtC,iBACd,OACA,UAAU,cACV,YACA,WACA,OACA,WACG,QACF,sCAAmB;yBARN"}
@@ -20,6 +20,8 @@ import { useRadioGroupContext } from "./radio-group-context.mjs";
20
20
  * `checked`. An Item added on the client while the Root's `value` equals its value gets
21
21
  * `defaultChecked` too, so two radios may carry it and a reset does not necessarily return to
22
22
  * the group's mount-time value (see `RadioGroup.Root` `value`).
23
+ *
24
+ * @see https://ui.funstack.work/components/radio-group
23
25
  */
24
26
  function RadioGroupItem({ value, disabled: disabledProp = false, transition, className, style, render, ...rest }) {
25
27
  const ctx = useRadioGroupContext("RadioGroup.Item");
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group-item.mjs","names":[],"sources":["../../src/radio-group/radio-group-item.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { groupMemberProps } from \"../internal/group-member.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { syncPresences } from \"../internal/sync-presence.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 { useRadioGroupContext } from \"./radio-group-context.js\";\n\nexport interface RadioGroupItemState {\n readonly value: string;\n /** Optimistic: true as soon as the user checks this radio, before the action settles. */\n readonly checked: boolean;\n /** The Root is pending and this radio is the optimistic target. */\n readonly pending: boolean;\n /** Disabled by its own prop or by `Root disabled`. */\n readonly disabled: boolean;\n}\n\nexport interface RadioGroupItemProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"name\"\n | \"value\"\n | \"checked\"\n | \"defaultChecked\"\n | \"defaultValue\"\n | \"form\"\n | \"required\"\n | \"onChange\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** The value this radio checks. Must be unique within the Root. Submitted as the form value. */\n value: string;\n /** Native `disabled`: unfocusable, skipped by arrow keys, never dispatches. */\n disabled?: boolean;\n /**\n * Forwarded to the Item's `<ViewTransition default>`. Default: no boundary. Fires only on the commit\n * that settles the action (or rolls it back), never on the optimistic check; animate the check\n * 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, RadioGroupItemState>;\n style?: StateValue<CSSProperties | undefined, RadioGroupItemState>;\n /** Replace the rendered element. Must keep an `<input>`; the library sets `type=\"radio\"`. */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, RadioGroupItemState>;\n}\n\n/**\n * One `<input type=\"radio\">` of the group. Its DOM `checked` is the optimistic value\n * (`checked={optimistic === value}`): react-dom restores a controlled input to its props after\n * every event, and only the sync-lane optimistic 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 * `data-checked`, `data-pending`, `data-disabled`. `onChange` is merged: a `render` element's own\n * handler runs first, then the library's.\n *\n * Form reset in controlled mode: React sets an input's `defaultChecked` once, from its initial\n * `checked`. An Item added on the client while the Root's `value` equals its value gets\n * `defaultChecked` too, so two radios may carry it and a reset does not necessarily return to\n * the group's mount-time value (see `RadioGroup.Root` `value`).\n */\nexport function RadioGroupItem({\n value,\n disabled: disabledProp = false,\n transition,\n className,\n style,\n render,\n ...rest\n}: RadioGroupItemProps) {\n const ctx = useRadioGroupContext(\"RadioGroup.Item\");\n const checked = ctx.state.value === value;\n const pending = ctx.state.pending && checked;\n const disabled = ctx.state.disabled || disabledProp;\n\n // Group mode: element check and re-apply only; the Root reports the residual paths once. The\n // hook calls `onItemMounted` at mount so that an Item mounting after its Root (a Suspense\n // boundary that hydrates later) still gets the group reconciled.\n const inputRef = useNativeChecked({\n type: \"radio\",\n component: \"RadioGroup.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 (partial hydration, Root JSDoc) can render a different\n // `checked` than the server did, e.g. after a click on an already hydrated radio, and a\n // stale `data-checked` would then stay until the prop changes again.\n if (el !== null) {\n syncPresences(el, {\n \"data-checked\": checked,\n \"data-pending\": pending,\n \"data-disabled\": disabled,\n });\n }\n ctx.onItemMounted(el);\n },\n defaultChecked: ctx.defaultValue === undefined ? undefined : ctx.defaultValue === value,\n });\n\n const state: RadioGroupItemState = { value, checked, pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, RadioGroupItemState>({\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: \"radio\",\n component: \"RadioGroup.Item\",\n name: ctx.name,\n form: ctx.form,\n value,\n required: ctx.required,\n checked,\n pending,\n effectiveDisabled: disabled,\n ownDisabled: disabledProp,\n activate: (event) => ctx.select(value, event),\n }),\n });\n\n return useTransitionBoundary(\"RadioGroup.Item\", transition, element);\n}\n\nRadioGroupItem.displayName = \"RadioGroupItem\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsEA,SAAgB,eAAe,EAC7B,OACA,UAAU,eAAe,OACzB,YACA,WACA,OACA,QACA,GAAG,QACmB;CACtB,MAAM,MAAM,qBAAqB,iBAAiB;CAClD,MAAM,UAAU,IAAI,MAAM,UAAU;CACpC,MAAM,UAAU,IAAI,MAAM,WAAW;CACrC,MAAM,WAAW,IAAI,MAAM,YAAY;CAKvC,MAAM,WAAW,iBAAiB;EAChC,MAAM;EACN,WAAW;EACX;EACA,OAAO;EACP,gBAAgB,OAAO;GAKrB,IAAI,OAAO,MACT,cAAc,IAAI;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;GACnB,CAAC;GAEH,IAAI,cAAc,EAAE;EACtB;EACA,gBAAgB,IAAI,iBAAiB,KAAA,IAAY,KAAA,IAAY,IAAI,iBAAiB;CACpF,CAAC;CAID,MAAM,UAAU,UAA+D;EAC7E,gBAAgB;EAChB;EACA,OAAA;GALmC;GAAO;GAAS;GAAS;EAKxD;EACJ;EACA;EACA,UAAU,KAAA;EACV,KAAK;EAEL,OAAO;EACP,cAAc,iBAAiB;GAC7B,MAAM;GACN,WAAW;GACX,MAAM,IAAI;GACV,MAAM,IAAI;GACV;GACA,UAAU,IAAI;GACd;GACA;GACA,mBAAmB;GACnB,aAAa;GACb,WAAW,UAAU,IAAI,OAAO,OAAO,KAAK;EAC9C,CAAC;CACH,CAAC;CAED,OAAO,sBAAsB,mBAAmB,YAAY,OAAO;AACrE;AAEA,eAAe,cAAc"}
1
+ {"version":3,"file":"radio-group-item.mjs","names":[],"sources":["../../src/radio-group/radio-group-item.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { groupMemberProps } from \"../internal/group-member.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { syncPresences } from \"../internal/sync-presence.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 { useRadioGroupContext } from \"./radio-group-context.js\";\n\n/**\n * State of `RadioGroup.Item`, passed to the function forms of `className`, `style` and `render`.\n */\nexport interface RadioGroupItemState {\n /** The Item's `value` prop. */\n readonly value: string;\n /** Optimistic: true as soon as the user checks this radio, before the action settles. */\n readonly checked: boolean;\n /** The Root is pending and this radio is the optimistic target. */\n readonly pending: boolean;\n /** Disabled by its own prop or by `Root disabled`. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `RadioGroup.Item`.\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport interface RadioGroupItemProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"name\"\n | \"value\"\n | \"checked\"\n | \"defaultChecked\"\n | \"defaultValue\"\n | \"form\"\n | \"required\"\n | \"onChange\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** The value this radio checks. Must be unique within the Root. Submitted as the form value. */\n value: string;\n /**\n * Native `disabled`: unfocusable, skipped by arrow keys, never dispatches.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Forwarded to the Item's `<ViewTransition default>`. Default: no boundary. Fires only on the commit\n * that settles the action (or rolls it back), never on the optimistic check; animate the check\n * 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, RadioGroupItemState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, RadioGroupItemState>;\n /** Replace the rendered element. Must keep an `<input>`; the library sets `type=\"radio\"`. */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, RadioGroupItemState>;\n}\n\n/**\n * One `<input type=\"radio\">` of the group. Its DOM `checked` is the optimistic value\n * (`checked={optimistic === value}`): react-dom restores a controlled input to its props after\n * every event, and only the sync-lane optimistic 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 * `data-checked`, `data-pending`, `data-disabled`. `onChange` is merged: a `render` element's own\n * handler runs first, then the library's.\n *\n * Form reset in controlled mode: React sets an input's `defaultChecked` once, from its initial\n * `checked`. An Item added on the client while the Root's `value` equals its value gets\n * `defaultChecked` too, so two radios may carry it and a reset does not necessarily return to\n * the group's mount-time value (see `RadioGroup.Root` `value`).\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport function RadioGroupItem({\n value,\n disabled: disabledProp = false,\n transition,\n className,\n style,\n render,\n ...rest\n}: RadioGroupItemProps) {\n const ctx = useRadioGroupContext(\"RadioGroup.Item\");\n const checked = ctx.state.value === value;\n const pending = ctx.state.pending && checked;\n const disabled = ctx.state.disabled || disabledProp;\n\n // Group mode: element check and re-apply only; the Root reports the residual paths once. The\n // hook calls `onItemMounted` at mount so that an Item mounting after its Root (a Suspense\n // boundary that hydrates later) still gets the group reconciled.\n const inputRef = useNativeChecked({\n type: \"radio\",\n component: \"RadioGroup.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 (partial hydration, Root JSDoc) can render a different\n // `checked` than the server did, e.g. after a click on an already hydrated radio, and a\n // stale `data-checked` would then stay until the prop changes again.\n if (el !== null) {\n syncPresences(el, {\n \"data-checked\": checked,\n \"data-pending\": pending,\n \"data-disabled\": disabled,\n });\n }\n ctx.onItemMounted(el);\n },\n defaultChecked: ctx.defaultValue === undefined ? undefined : ctx.defaultValue === value,\n });\n\n const state: RadioGroupItemState = { value, checked, pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, RadioGroupItemState>({\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: \"radio\",\n component: \"RadioGroup.Item\",\n name: ctx.name,\n form: ctx.form,\n value,\n required: ctx.required,\n checked,\n pending,\n effectiveDisabled: disabled,\n ownDisabled: disabledProp,\n activate: (event) => ctx.select(value, event),\n }),\n });\n\n return useTransitionBoundary(\"RadioGroup.Item\", transition, element);\n}\n\nRadioGroupItem.displayName = \"RadioGroupItem\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,SAAgB,eAAe,EAC7B,OACA,UAAU,eAAe,OACzB,YACA,WACA,OACA,QACA,GAAG,QACmB;CACtB,MAAM,MAAM,qBAAqB,iBAAiB;CAClD,MAAM,UAAU,IAAI,MAAM,UAAU;CACpC,MAAM,UAAU,IAAI,MAAM,WAAW;CACrC,MAAM,WAAW,IAAI,MAAM,YAAY;CAKvC,MAAM,WAAW,iBAAiB;EAChC,MAAM;EACN,WAAW;EACX;EACA,OAAO;EACP,gBAAgB,OAAO;GAKrB,IAAI,OAAO,MACT,cAAc,IAAI;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;GACnB,CAAC;GAEH,IAAI,cAAc,EAAE;EACtB;EACA,gBAAgB,IAAI,iBAAiB,KAAA,IAAY,KAAA,IAAY,IAAI,iBAAiB;CACpF,CAAC;CAID,MAAM,UAAU,UAA+D;EAC7E,gBAAgB;EAChB;EACA,OAAA;GALmC;GAAO;GAAS;GAAS;EAKxD;EACJ;EACA;EACA,UAAU,KAAA;EACV,KAAK;EAEL,OAAO;EACP,cAAc,iBAAiB;GAC7B,MAAM;GACN,WAAW;GACX,MAAM,IAAI;GACV,MAAM,IAAI;GACV;GACA,UAAU,IAAI;GACd;GACA;GACA,mBAAmB;GACnB,aAAa;GACb,WAAW,UAAU,IAAI,OAAO,OAAO,KAAK;EAC9C,CAAC;CACH,CAAC;CAED,OAAO,sBAAsB,mBAAmB,YAAY,OAAO;AACrE;AAEA,eAAe,cAAc"}
@@ -2,16 +2,26 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { RadioGroupRootState } from "./radio-group-root.mjs";
3
3
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
4
4
  //#region src/radio-group/radio-group-label.d.ts
5
+ /**
6
+ * Props of `RadioGroup.Label`.
7
+ *
8
+ * @see https://ui.funstack.work/components/radio-group
9
+ */
5
10
  export interface RadioGroupLabelProps 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, RadioGroupRootState>;
13
+ /** Inline style, or a function of the part's state that returns one. */
7
14
  style?: StateValue<CSSProperties | undefined, RadioGroupRootState>;
8
15
  /** Receives the Root's state: a group-level pending indicator goes here. */
9
16
  children?: StateValue<ReactNode, RadioGroupRootState>;
17
+ /** Replace the default `<legend>` (element form) or take over rendering (function form). */
10
18
  render?: RenderProp<ComponentPropsWithRef<"legend">, RadioGroupRootState>;
11
19
  }
12
20
  /**
13
21
  * The group's `<legend>`, which names the fieldset natively. Optional; must be the **first child**
14
22
  * of `RadioGroup.Root` (HTML content model). Its state is the Root's state. Owns no keys.
23
+ *
24
+ * @see https://ui.funstack.work/components/radio-group
15
25
  */
16
26
  export declare function RadioGroupLabel({ className, style, children, render, ...rest }: RadioGroupLabelProps): ReactNode;
17
27
  export declare namespace RadioGroupLabel {
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group-label.d.mts","names":[],"sources":["../../src/radio-group/radio-group-label.tsx"],"mappings":";;;;iBAOiB,6BAA6B,KAC5C;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,iCAAiC;;;;;;wBAOvC,kBACd,WACA,OACA,UACA,WACG,QACF,uBAAoB;yBANP"}
1
+ {"version":3,"file":"radio-group-label.d.mts","names":[],"sources":["../../src/radio-group/radio-group-label.tsx"],"mappings":";;;;;;;;;iBAYiB,6BAA6B,KAC5C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;wBASvC,kBACd,WACA,OACA,UACA,WACG,QACF,uBAAoB;yBANP"}
@@ -5,6 +5,8 @@ import { useRadioGroupContext } from "./radio-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 `RadioGroup.Root` (HTML content model). Its state is the Root's state. Owns no keys.
8
+ *
9
+ * @see https://ui.funstack.work/components/radio-group
8
10
  */
9
11
  function RadioGroupLabel({ className, style, children, render, ...rest }) {
10
12
  const { state } = useRadioGroupContext("RadioGroup.Label");
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group-label.mjs","names":[],"sources":["../../src/radio-group/radio-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 { useRadioGroupContext } from \"./radio-group-context.js\";\nimport type { RadioGroupRootState } from \"./radio-group-root.js\";\n\nexport interface RadioGroupLabelProps extends Omit<\n ComponentPropsWithRef<\"legend\">,\n \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, RadioGroupRootState>;\n style?: StateValue<CSSProperties | undefined, RadioGroupRootState>;\n /** Receives the Root's state: a group-level pending indicator goes here. */\n children?: StateValue<ReactNode, RadioGroupRootState>;\n render?: RenderProp<ComponentPropsWithRef<\"legend\">, RadioGroupRootState>;\n}\n\n/**\n * The group's `<legend>`, which names the fieldset natively. Optional; must be the **first child**\n * of `RadioGroup.Root` (HTML content model). Its state is the Root's state. Owns no keys.\n */\nexport function RadioGroupLabel({\n className,\n style,\n children,\n render,\n ...rest\n}: RadioGroupLabelProps) {\n const { state } = useRadioGroupContext(\"RadioGroup.Label\");\n return useRender<ComponentPropsWithRef<\"legend\">, RadioGroupRootState>({\n defaultElement: \"legend\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n });\n}\n\nRadioGroupLabel.displayName = \"RadioGroupLabel\";\n"],"mappings":";;;;;;;;AAsBA,SAAgB,gBAAgB,EAC9B,WACA,OACA,UACA,QACA,GAAG,QACoB;CACvB,MAAM,EAAE,UAAU,qBAAqB,kBAAkB;CACzD,OAAO,UAAgE;EACrE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;CACT,CAAC;AACH;AAEA,gBAAgB,cAAc"}
1
+ {"version":3,"file":"radio-group-label.mjs","names":[],"sources":["../../src/radio-group/radio-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 { useRadioGroupContext } from \"./radio-group-context.js\";\nimport type { RadioGroupRootState } from \"./radio-group-root.js\";\n\n/**\n * Props of `RadioGroup.Label`.\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport interface RadioGroupLabelProps 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, RadioGroupRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, RadioGroupRootState>;\n /** Receives the Root's state: a group-level pending indicator goes here. */\n children?: StateValue<ReactNode, RadioGroupRootState>;\n /** Replace the default `<legend>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"legend\">, RadioGroupRootState>;\n}\n\n/**\n * The group's `<legend>`, which names the fieldset natively. Optional; must be the **first child**\n * of `RadioGroup.Root` (HTML content model). Its state is the Root's state. Owns no keys.\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport function RadioGroupLabel({\n className,\n style,\n children,\n render,\n ...rest\n}: RadioGroupLabelProps) {\n const { state } = useRadioGroupContext(\"RadioGroup.Label\");\n return useRender<ComponentPropsWithRef<\"legend\">, RadioGroupRootState>({\n defaultElement: \"legend\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n });\n}\n\nRadioGroupLabel.displayName = \"RadioGroupLabel\";\n"],"mappings":";;;;;;;;;;AAgCA,SAAgB,gBAAgB,EAC9B,WACA,OACA,UACA,QACA,GAAG,QACoB;CACvB,MAAM,EAAE,UAAU,qBAAqB,kBAAkB;CACzD,OAAO,UAAgE;EACrE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;CACT,CAAC;AACH;AAEA,gBAAgB,cAAc"}
@@ -11,6 +11,10 @@ export interface RadioGroupValueChangeDetails extends ActionDetails {
11
11
  */
12
12
  readonly reason: ChangeReason;
13
13
  }
14
+ /**
15
+ * State of `RadioGroup.Root`, `RadioGroup.Label`, passed to the function forms of `className`,
16
+ * `style`, `children` and `render`.
17
+ */
14
18
  export interface RadioGroupRootState {
15
19
  /** Optimistic checked value, or `null`. Content rendered from it must not suspend. */
16
20
  readonly value: string | null;
@@ -19,6 +23,11 @@ export interface RadioGroupRootState {
19
23
  /** The `disabled` prop (or the enclosing `Field.Root`'s). */
20
24
  readonly disabled: boolean;
21
25
  }
26
+ /**
27
+ * Props of `RadioGroup.Root`.
28
+ *
29
+ * @see https://ui.funstack.work/components/radio-group
30
+ */
22
31
  export interface RadioGroupRootProps extends Omit<ComponentPropsWithRef<"fieldset">, "className" | "style" | "children" | "defaultValue" | "defaultChecked" | "name" | "disabled" | "form"> {
23
32
  /**
24
33
  * Controlled checked value. `null` checks nothing; `undefined` means uncontrolled.
@@ -32,8 +41,10 @@ export interface RadioGroupRootProps extends Omit<ComponentPropsWithRef<"fieldse
32
41
  */
33
42
  value?: string | null;
34
43
  /**
35
- * Initial value in uncontrolled mode. Defaults to `null` (nothing checked). Also the value a
44
+ * Initial value in uncontrolled mode. Also the value a
36
45
  * form reset returns to: the latest prop value is mirrored into the radios' `defaultChecked`.
46
+ *
47
+ * @defaultValue `null` (nothing checked)
37
48
  */
38
49
  defaultValue?: string | null;
39
50
  /**
@@ -49,9 +60,11 @@ export interface RadioGroupRootProps extends Omit<ComponentPropsWithRef<"fieldse
49
60
  */
50
61
  valueChangeAction?: ChangeAction<string | null, RadioGroupValueChangeDetails>;
51
62
  /**
52
- * The `name` shared by every radio in the group (form data key). Defaults to a `useId()` value;
53
- * pass a real name when the group is inside a `<form>` you submit. Must be unique within the
54
- * form: react-dom throws if a non-React radio shares it.
63
+ * The `name` shared by every radio in the group (form data key). Pass a real name when the group
64
+ * is inside a `<form>` you submit. Must be unique within the form: react-dom throws if a
65
+ * non-React radio shares it.
66
+ *
67
+ * @defaultValue a `useId()` value
55
68
  */
56
69
  name?: string;
57
70
  /** The `form` attribute, applied to the fieldset and to every radio. */
@@ -60,12 +73,21 @@ export interface RadioGroupRootProps extends Omit<ComponentPropsWithRef<"fieldse
60
73
  * Marks every radio `required`, which makes the group required (one checked radio satisfies it),
61
74
  * and renders `aria-required="true"` on the fieldset so the radiogroup itself is exposed as
62
75
  * required.
76
+ *
77
+ * @defaultValue `false`
63
78
  */
64
79
  required?: boolean;
65
- /** Renders `<fieldset disabled>`: every radio is disabled, unfocusable and skipped by arrows. */
80
+ /**
81
+ * Renders `<fieldset disabled>`: every radio is disabled, unfocusable and skipped by arrows.
82
+ *
83
+ * @defaultValue `false`
84
+ */
66
85
  disabled?: boolean;
86
+ /** Class name, or a function of the part's state that returns one. */
67
87
  className?: StateValue<string | undefined, RadioGroupRootState>;
88
+ /** Inline style, or a function of the part's state that returns one. */
68
89
  style?: StateValue<CSSProperties | undefined, RadioGroupRootState>;
90
+ /** The Label and Items. The function form receives the optimistic value; must not suspend. */
69
91
  children?: StateValue<ReactNode, RadioGroupRootState>;
70
92
  /** Replace the rendered element. Must keep a `<fieldset>`. */
71
93
  render?: RenderProp<ComponentPropsWithRef<"fieldset">, RadioGroupRootState>;
@@ -85,6 +107,8 @@ export interface RadioGroupRootProps extends Omit<ComponentPropsWithRef<"fieldse
85
107
  * interacts) is not supported by React: clicking a hydrated radio while same-`name` siblings are
86
108
  * still dehydrated makes react-dom throw "Mixing React and non-React radio inputs with the same
87
109
  * `name` is not supported". Development warns when Items hydrate after their Root.
110
+ *
111
+ * @see https://ui.funstack.work/components/radio-group
88
112
  */
89
113
  export declare function RadioGroupRoot({ value, defaultValue, valueChangeAction, name: nameProp, form, required: requiredProp, disabled: disabledProp, className, style, children, render, ...rest }: RadioGroupRootProps): import("react").JSX.Element;
90
114
  export declare namespace RadioGroupRoot {