@funstack/ui 0.1.0-alpha.15 → 0.1.0-alpha.17

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 (588) 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 +3 -1
  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 +46 -15
  26. package/dist/button/button.d.mts.map +1 -1
  27. package/dist/button/button.mjs +10 -6
  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 +7 -1
  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-group.d.mts +49 -1
  58. package/dist/combobox/combobox-group.d.mts.map +1 -1
  59. package/dist/combobox/combobox-group.mjs +11 -1
  60. package/dist/combobox/combobox-group.mjs.map +1 -1
  61. package/dist/combobox/combobox-input.d.mts +11 -0
  62. package/dist/combobox/combobox-input.d.mts.map +1 -1
  63. package/dist/combobox/combobox-input.mjs +2 -0
  64. package/dist/combobox/combobox-input.mjs.map +1 -1
  65. package/dist/combobox/combobox-label.d.mts +16 -0
  66. package/dist/combobox/combobox-label.d.mts.map +1 -1
  67. package/dist/combobox/combobox-label.mjs +2 -0
  68. package/dist/combobox/combobox-label.mjs.map +1 -1
  69. package/dist/combobox/combobox-list.d.mts +14 -0
  70. package/dist/combobox/combobox-list.d.mts.map +1 -1
  71. package/dist/combobox/combobox-list.mjs +2 -0
  72. package/dist/combobox/combobox-list.mjs.map +1 -1
  73. package/dist/combobox/combobox-option.d.mts +25 -3
  74. package/dist/combobox/combobox-option.d.mts.map +1 -1
  75. package/dist/combobox/combobox-option.mjs +2 -0
  76. package/dist/combobox/combobox-option.mjs.map +1 -1
  77. package/dist/combobox/combobox-popup.d.mts +20 -1
  78. package/dist/combobox/combobox-popup.d.mts.map +1 -1
  79. package/dist/combobox/combobox-popup.mjs +2 -0
  80. package/dist/combobox/combobox-popup.mjs.map +1 -1
  81. package/dist/combobox/combobox-root.d.mts +64 -17
  82. package/dist/combobox/combobox-root.d.mts.map +1 -1
  83. package/dist/combobox/combobox-root.mjs +11 -11
  84. package/dist/combobox/combobox-root.mjs.map +1 -1
  85. package/dist/combobox/combobox-trigger.d.mts +16 -0
  86. package/dist/combobox/combobox-trigger.d.mts.map +1 -1
  87. package/dist/combobox/combobox-trigger.mjs +9 -2
  88. package/dist/combobox/combobox-trigger.mjs.map +1 -1
  89. package/dist/combobox/index.d.mts +2 -0
  90. package/dist/combobox/index.d.mts.map +1 -1
  91. package/dist/combobox/index.mjs +2 -0
  92. package/dist/combobox/index.mjs.map +1 -1
  93. package/dist/csp/csp-provider.d.mts +8 -0
  94. package/dist/csp/csp-provider.d.mts.map +1 -1
  95. package/dist/csp/csp-provider.mjs +2 -0
  96. package/dist/csp/csp-provider.mjs.map +1 -1
  97. package/dist/csp/style-hashes.d.mts +2 -0
  98. package/dist/csp/style-hashes.d.mts.map +1 -1
  99. package/dist/csp/style-hashes.mjs +2 -0
  100. package/dist/csp/style-hashes.mjs.map +1 -1
  101. package/dist/dialog/dialog-close.d.mts +31 -3
  102. package/dist/dialog/dialog-close.d.mts.map +1 -1
  103. package/dist/dialog/dialog-close.mjs +5 -2
  104. package/dist/dialog/dialog-close.mjs.map +1 -1
  105. package/dist/dialog/dialog-context.mjs.map +1 -1
  106. package/dist/dialog/dialog-description.d.mts +12 -0
  107. package/dist/dialog/dialog-description.d.mts.map +1 -1
  108. package/dist/dialog/dialog-description.mjs +2 -0
  109. package/dist/dialog/dialog-description.mjs.map +1 -1
  110. package/dist/dialog/dialog-form.d.mts +20 -2
  111. package/dist/dialog/dialog-form.d.mts.map +1 -1
  112. package/dist/dialog/dialog-form.mjs +2 -0
  113. package/dist/dialog/dialog-form.mjs.map +1 -1
  114. package/dist/dialog/dialog-popup.d.mts +34 -8
  115. package/dist/dialog/dialog-popup.d.mts.map +1 -1
  116. package/dist/dialog/dialog-popup.mjs +14 -20
  117. package/dist/dialog/dialog-popup.mjs.map +1 -1
  118. package/dist/dialog/dialog-root.d.mts +53 -25
  119. package/dist/dialog/dialog-root.d.mts.map +1 -1
  120. package/dist/dialog/dialog-root.mjs +12 -8
  121. package/dist/dialog/dialog-root.mjs.map +1 -1
  122. package/dist/dialog/dialog-title.d.mts +11 -0
  123. package/dist/dialog/dialog-title.d.mts.map +1 -1
  124. package/dist/dialog/dialog-title.mjs +2 -0
  125. package/dist/dialog/dialog-title.mjs.map +1 -1
  126. package/dist/dialog/dialog-trigger.d.mts +19 -3
  127. package/dist/dialog/dialog-trigger.d.mts.map +1 -1
  128. package/dist/dialog/dialog-trigger.mjs +2 -0
  129. package/dist/dialog/dialog-trigger.mjs.map +1 -1
  130. package/dist/dialog/index.d.mts +7 -5
  131. package/dist/dialog/index.d.mts.map +1 -1
  132. package/dist/dialog/index.mjs +7 -5
  133. package/dist/dialog/index.mjs.map +1 -1
  134. package/dist/docs/components/accordion.md +426 -0
  135. package/dist/docs/components/button.md +508 -0
  136. package/dist/docs/components/checkbox-group.md +483 -0
  137. package/dist/docs/components/checkbox.md +373 -0
  138. package/dist/docs/components/combobox.md +698 -0
  139. package/dist/docs/components/context-menu.md +524 -0
  140. package/dist/docs/components/dialog.md +692 -0
  141. package/dist/docs/components/field.md +587 -0
  142. package/dist/docs/components/menu.md +670 -0
  143. package/dist/docs/components/meter.md +313 -0
  144. package/dist/docs/components/number-field.md +528 -0
  145. package/dist/docs/components/popover.md +656 -0
  146. package/dist/docs/components/progress.md +450 -0
  147. package/dist/docs/components/radio-group.md +457 -0
  148. package/dist/docs/components/select.md +662 -0
  149. package/dist/docs/components/slider.md +558 -0
  150. package/dist/docs/components/switch.md +311 -0
  151. package/dist/docs/components/tabs.md +473 -0
  152. package/dist/docs/components/toast.md +599 -0
  153. package/dist/docs/components/toggle-group.md +341 -0
  154. package/dist/docs/components/toggle.md +245 -0
  155. package/dist/docs/components/toolbar.md +390 -0
  156. package/dist/docs/components/tooltip.md +494 -0
  157. package/dist/docs/concepts/action-props.md +281 -0
  158. package/dist/docs/concepts/ai-agents.md +56 -0
  159. package/dist/docs/concepts/browser-owned-state.md +133 -0
  160. package/dist/docs/concepts/content-security-policy.md +69 -0
  161. package/dist/docs/concepts/experimental.md +36 -0
  162. package/dist/docs/concepts/pending-and-optimistic.md +263 -0
  163. package/dist/docs/concepts/render.md +23 -0
  164. package/dist/docs/concepts/server-components.md +132 -0
  165. package/dist/docs/concepts/suspense.md +129 -0
  166. package/dist/docs/concepts/transitions.md +112 -0
  167. package/dist/docs/getting-started.md +102 -0
  168. package/dist/docs/index.md +182 -0
  169. package/dist/docs/roadmap.md +128 -0
  170. package/dist/docs/why.md +104 -0
  171. package/dist/field/field-control.d.mts +26 -3
  172. package/dist/field/field-control.d.mts.map +1 -1
  173. package/dist/field/field-control.mjs +2 -0
  174. package/dist/field/field-control.mjs.map +1 -1
  175. package/dist/field/field-description.d.mts +11 -0
  176. package/dist/field/field-description.d.mts.map +1 -1
  177. package/dist/field/field-description.mjs +2 -0
  178. package/dist/field/field-description.mjs.map +1 -1
  179. package/dist/field/field-error.d.mts +14 -2
  180. package/dist/field/field-error.d.mts.map +1 -1
  181. package/dist/field/field-error.mjs +2 -0
  182. package/dist/field/field-error.mjs.map +1 -1
  183. package/dist/field/field-label.d.mts +10 -0
  184. package/dist/field/field-label.d.mts.map +1 -1
  185. package/dist/field/field-label.mjs +2 -0
  186. package/dist/field/field-label.mjs.map +1 -1
  187. package/dist/field/field-root.d.mts +21 -2
  188. package/dist/field/field-root.d.mts.map +1 -1
  189. package/dist/field/field-root.mjs +2 -0
  190. package/dist/field/field-root.mjs.map +1 -1
  191. package/dist/field/index.d.mts +9 -0
  192. package/dist/field/index.d.mts.map +1 -1
  193. package/dist/field/index.mjs +9 -0
  194. package/dist/field/index.mjs.map +1 -1
  195. package/dist/form/form-root.d.mts +17 -1
  196. package/dist/form/form-root.d.mts.map +1 -1
  197. package/dist/form/form-root.mjs +2 -0
  198. package/dist/form/form-root.mjs.map +1 -1
  199. package/dist/form/form-submit.d.mts +18 -0
  200. package/dist/form/form-submit.d.mts.map +1 -1
  201. package/dist/form/form-submit.mjs +2 -0
  202. package/dist/form/form-submit.mjs.map +1 -1
  203. package/dist/form/index.d.mts +7 -0
  204. package/dist/form/index.d.mts.map +1 -1
  205. package/dist/form/index.mjs +7 -0
  206. package/dist/form/index.mjs.map +1 -1
  207. package/dist/index.d.mts +3 -2
  208. package/dist/internal/call-urgent-handler.mjs +37 -0
  209. package/dist/internal/call-urgent-handler.mjs.map +1 -0
  210. package/dist/internal/css-transition-cut.mjs +66 -0
  211. package/dist/internal/css-transition-cut.mjs.map +1 -0
  212. package/dist/internal/overlay-popup.mjs.map +1 -1
  213. package/dist/internal/report-dropped.mjs +45 -0
  214. package/dist/internal/report-dropped.mjs.map +1 -0
  215. package/dist/internal/types.d.mts +36 -7
  216. package/dist/internal/types.d.mts.map +1 -1
  217. package/dist/internal/use-action-trigger.mjs +32 -17
  218. package/dist/internal/use-action-trigger.mjs.map +1 -1
  219. package/dist/internal/use-controllable-action.mjs +52 -16
  220. package/dist/internal/use-controllable-action.mjs.map +1 -1
  221. package/dist/internal/use-exit-animation.mjs +1 -1
  222. package/dist/internal/use-exit-animation.mjs.map +1 -1
  223. package/dist/internal/use-native-group-reconciliation.mjs +4 -2
  224. package/dist/internal/use-native-group-reconciliation.mjs.map +1 -1
  225. package/dist/internal/use-overlay-close.mjs +10 -4
  226. package/dist/internal/use-overlay-close.mjs.map +1 -1
  227. package/dist/internal/use-overlay-root.mjs +40 -7
  228. package/dist/internal/use-overlay-root.mjs.map +1 -1
  229. package/dist/internal/use-popover-popup.mjs +22 -7
  230. package/dist/internal/use-popover-popup.mjs.map +1 -1
  231. package/dist/internal/use-popover-trigger.d.mts +2 -1
  232. package/dist/internal/use-popover-trigger.d.mts.map +1 -1
  233. package/dist/internal/use-popover-trigger.mjs +11 -3
  234. package/dist/internal/use-popover-trigger.mjs.map +1 -1
  235. package/dist/internal/validity.d.mts +11 -0
  236. package/dist/internal/validity.d.mts.map +1 -1
  237. package/dist/internal/validity.mjs.map +1 -1
  238. package/dist/menu/index.d.mts +2 -0
  239. package/dist/menu/index.d.mts.map +1 -1
  240. package/dist/menu/index.mjs +2 -0
  241. package/dist/menu/index.mjs.map +1 -1
  242. package/dist/menu/menu-checkbox-item.d.mts +27 -3
  243. package/dist/menu/menu-checkbox-item.d.mts.map +1 -1
  244. package/dist/menu/menu-checkbox-item.mjs +2 -0
  245. package/dist/menu/menu-checkbox-item.mjs.map +1 -1
  246. package/dist/menu/menu-context-trigger.d.mts +24 -2
  247. package/dist/menu/menu-context-trigger.d.mts.map +1 -1
  248. package/dist/menu/menu-context-trigger.mjs +2 -0
  249. package/dist/menu/menu-context-trigger.mjs.map +1 -1
  250. package/dist/menu/menu-group.d.mts +36 -1
  251. package/dist/menu/menu-group.d.mts.map +1 -1
  252. package/dist/menu/menu-group.mjs +9 -1
  253. package/dist/menu/menu-group.mjs.map +1 -1
  254. package/dist/menu/menu-item.d.mts +38 -5
  255. package/dist/menu/menu-item.d.mts.map +1 -1
  256. package/dist/menu/menu-item.mjs +12 -5
  257. package/dist/menu/menu-item.mjs.map +1 -1
  258. package/dist/menu/menu-outside.mjs +2 -2
  259. package/dist/menu/menu-outside.mjs.map +1 -1
  260. package/dist/menu/menu-popup.d.mts +36 -8
  261. package/dist/menu/menu-popup.d.mts.map +1 -1
  262. package/dist/menu/menu-popup.mjs +2 -0
  263. package/dist/menu/menu-popup.mjs.map +1 -1
  264. package/dist/menu/menu-radio-group.d.mts +20 -1
  265. package/dist/menu/menu-radio-group.d.mts.map +1 -1
  266. package/dist/menu/menu-radio-group.mjs +2 -0
  267. package/dist/menu/menu-radio-group.mjs.map +1 -1
  268. package/dist/menu/menu-radio-item.d.mts +16 -0
  269. package/dist/menu/menu-radio-item.d.mts.map +1 -1
  270. package/dist/menu/menu-radio-item.mjs +2 -0
  271. package/dist/menu/menu-radio-item.mjs.map +1 -1
  272. package/dist/menu/menu-root.d.mts +49 -15
  273. package/dist/menu/menu-root.d.mts.map +1 -1
  274. package/dist/menu/menu-root.mjs +7 -4
  275. package/dist/menu/menu-root.mjs.map +1 -1
  276. package/dist/menu/menu-submenu-trigger.d.mts +13 -0
  277. package/dist/menu/menu-submenu-trigger.d.mts.map +1 -1
  278. package/dist/menu/menu-submenu-trigger.mjs +2 -0
  279. package/dist/menu/menu-submenu-trigger.mjs.map +1 -1
  280. package/dist/menu/menu-trigger.d.mts +15 -0
  281. package/dist/menu/menu-trigger.d.mts.map +1 -1
  282. package/dist/menu/menu-trigger.mjs +2 -0
  283. package/dist/menu/menu-trigger.mjs.map +1 -1
  284. package/dist/meter/index.d.mts +2 -0
  285. package/dist/meter/index.d.mts.map +1 -1
  286. package/dist/meter/index.mjs +2 -0
  287. package/dist/meter/index.mjs.map +1 -1
  288. package/dist/meter/meter-indicator.d.mts +11 -0
  289. package/dist/meter/meter-indicator.d.mts.map +1 -1
  290. package/dist/meter/meter-indicator.mjs +2 -0
  291. package/dist/meter/meter-indicator.mjs.map +1 -1
  292. package/dist/meter/meter-label.d.mts +11 -0
  293. package/dist/meter/meter-label.d.mts.map +1 -1
  294. package/dist/meter/meter-label.mjs +2 -0
  295. package/dist/meter/meter-label.mjs.map +1 -1
  296. package/dist/meter/meter-region.d.mts +5 -0
  297. package/dist/meter/meter-region.d.mts.map +1 -1
  298. package/dist/meter/meter-region.mjs.map +1 -1
  299. package/dist/meter/meter-root.d.mts +52 -10
  300. package/dist/meter/meter-root.d.mts.map +1 -1
  301. package/dist/meter/meter-root.mjs +2 -0
  302. package/dist/meter/meter-root.mjs.map +1 -1
  303. package/dist/meter/meter-track.d.mts +11 -0
  304. package/dist/meter/meter-track.d.mts.map +1 -1
  305. package/dist/meter/meter-track.mjs +2 -0
  306. package/dist/meter/meter-track.mjs.map +1 -1
  307. package/dist/meter/meter-value.d.mts +15 -1
  308. package/dist/meter/meter-value.d.mts.map +1 -1
  309. package/dist/meter/meter-value.mjs +2 -0
  310. package/dist/meter/meter-value.mjs.map +1 -1
  311. package/dist/number-field/index.d.mts +2 -0
  312. package/dist/number-field/index.d.mts.map +1 -1
  313. package/dist/number-field/index.mjs +2 -0
  314. package/dist/number-field/index.mjs.map +1 -1
  315. package/dist/number-field/number-field-decrement.d.mts +2 -0
  316. package/dist/number-field/number-field-decrement.d.mts.map +1 -1
  317. package/dist/number-field/number-field-decrement.mjs +2 -0
  318. package/dist/number-field/number-field-decrement.mjs.map +1 -1
  319. package/dist/number-field/number-field-increment.d.mts +2 -0
  320. package/dist/number-field/number-field-increment.d.mts.map +1 -1
  321. package/dist/number-field/number-field-increment.mjs +2 -0
  322. package/dist/number-field/number-field-increment.mjs.map +1 -1
  323. package/dist/number-field/number-field-input.d.mts +9 -0
  324. package/dist/number-field/number-field-input.d.mts.map +1 -1
  325. package/dist/number-field/number-field-input.mjs +2 -0
  326. package/dist/number-field/number-field-input.mjs.map +1 -1
  327. package/dist/number-field/number-field-label.d.mts +10 -0
  328. package/dist/number-field/number-field-label.d.mts.map +1 -1
  329. package/dist/number-field/number-field-label.mjs +2 -0
  330. package/dist/number-field/number-field-label.mjs.map +1 -1
  331. package/dist/number-field/number-field-root.d.mts +62 -14
  332. package/dist/number-field/number-field-root.d.mts.map +1 -1
  333. package/dist/number-field/number-field-root.mjs +4 -8
  334. package/dist/number-field/number-field-root.mjs.map +1 -1
  335. package/dist/number-field/use-step-button.d.mts +20 -0
  336. package/dist/number-field/use-step-button.d.mts.map +1 -1
  337. package/dist/number-field/use-step-button.mjs.map +1 -1
  338. package/dist/popover/index.d.mts +5 -3
  339. package/dist/popover/index.d.mts.map +1 -1
  340. package/dist/popover/index.mjs +5 -3
  341. package/dist/popover/index.mjs.map +1 -1
  342. package/dist/popover/popover-close.d.mts +32 -3
  343. package/dist/popover/popover-close.d.mts.map +1 -1
  344. package/dist/popover/popover-close.mjs +6 -2
  345. package/dist/popover/popover-close.mjs.map +1 -1
  346. package/dist/popover/popover-description.d.mts +12 -0
  347. package/dist/popover/popover-description.d.mts.map +1 -1
  348. package/dist/popover/popover-description.mjs +2 -0
  349. package/dist/popover/popover-description.mjs.map +1 -1
  350. package/dist/popover/popover-popup.d.mts +36 -7
  351. package/dist/popover/popover-popup.d.mts.map +1 -1
  352. package/dist/popover/popover-popup.mjs +5 -2
  353. package/dist/popover/popover-popup.mjs.map +1 -1
  354. package/dist/popover/popover-root.d.mts +40 -18
  355. package/dist/popover/popover-root.d.mts.map +1 -1
  356. package/dist/popover/popover-root.mjs +11 -7
  357. package/dist/popover/popover-root.mjs.map +1 -1
  358. package/dist/popover/popover-title.d.mts +11 -0
  359. package/dist/popover/popover-title.d.mts.map +1 -1
  360. package/dist/popover/popover-title.mjs +2 -0
  361. package/dist/popover/popover-title.mjs.map +1 -1
  362. package/dist/popover/popover-trigger.d.mts +15 -0
  363. package/dist/popover/popover-trigger.d.mts.map +1 -1
  364. package/dist/popover/popover-trigger.mjs +2 -0
  365. package/dist/popover/popover-trigger.mjs.map +1 -1
  366. package/dist/progress/index.d.mts +2 -0
  367. package/dist/progress/index.d.mts.map +1 -1
  368. package/dist/progress/index.mjs +2 -0
  369. package/dist/progress/index.mjs.map +1 -1
  370. package/dist/progress/progress-indicator.d.mts +11 -0
  371. package/dist/progress/progress-indicator.d.mts.map +1 -1
  372. package/dist/progress/progress-indicator.mjs +2 -0
  373. package/dist/progress/progress-indicator.mjs.map +1 -1
  374. package/dist/progress/progress-label.d.mts +11 -0
  375. package/dist/progress/progress-label.d.mts.map +1 -1
  376. package/dist/progress/progress-label.mjs +2 -0
  377. package/dist/progress/progress-label.mjs.map +1 -1
  378. package/dist/progress/progress-root.d.mts +36 -8
  379. package/dist/progress/progress-root.d.mts.map +1 -1
  380. package/dist/progress/progress-root.mjs +2 -0
  381. package/dist/progress/progress-root.mjs.map +1 -1
  382. package/dist/progress/progress-track.d.mts +11 -0
  383. package/dist/progress/progress-track.d.mts.map +1 -1
  384. package/dist/progress/progress-track.mjs +2 -0
  385. package/dist/progress/progress-track.mjs.map +1 -1
  386. package/dist/progress/progress-value.d.mts +15 -1
  387. package/dist/progress/progress-value.d.mts.map +1 -1
  388. package/dist/progress/progress-value.mjs +2 -0
  389. package/dist/progress/progress-value.mjs.map +1 -1
  390. package/dist/radio-group/index.d.mts +2 -0
  391. package/dist/radio-group/index.d.mts.map +1 -1
  392. package/dist/radio-group/index.mjs +2 -0
  393. package/dist/radio-group/index.mjs.map +1 -1
  394. package/dist/radio-group/radio-group-item.d.mts +18 -1
  395. package/dist/radio-group/radio-group-item.d.mts.map +1 -1
  396. package/dist/radio-group/radio-group-item.mjs +2 -0
  397. package/dist/radio-group/radio-group-item.mjs.map +1 -1
  398. package/dist/radio-group/radio-group-label.d.mts +10 -0
  399. package/dist/radio-group/radio-group-label.d.mts.map +1 -1
  400. package/dist/radio-group/radio-group-label.mjs +2 -0
  401. package/dist/radio-group/radio-group-label.mjs.map +1 -1
  402. package/dist/radio-group/radio-group-root.d.mts +29 -5
  403. package/dist/radio-group/radio-group-root.d.mts.map +1 -1
  404. package/dist/radio-group/radio-group-root.mjs +2 -0
  405. package/dist/radio-group/radio-group-root.mjs.map +1 -1
  406. package/dist/select/index.d.mts +2 -0
  407. package/dist/select/index.d.mts.map +1 -1
  408. package/dist/select/index.mjs +2 -0
  409. package/dist/select/index.mjs.map +1 -1
  410. package/dist/select/select-group-label.d.mts +10 -0
  411. package/dist/select/select-group-label.d.mts.map +1 -1
  412. package/dist/select/select-group-label.mjs +2 -0
  413. package/dist/select/select-group-label.mjs.map +1 -1
  414. package/dist/select/select-group.d.mts +15 -1
  415. package/dist/select/select-group.d.mts.map +1 -1
  416. package/dist/select/select-group.mjs +2 -0
  417. package/dist/select/select-group.mjs.map +1 -1
  418. package/dist/select/select-option.d.mts +19 -1
  419. package/dist/select/select-option.d.mts.map +1 -1
  420. package/dist/select/select-option.mjs +2 -0
  421. package/dist/select/select-option.mjs.map +1 -1
  422. package/dist/select/select-root.d.mts +24 -1
  423. package/dist/select/select-root.d.mts.map +1 -1
  424. package/dist/select/select-root.mjs +2 -0
  425. package/dist/select/select-root.mjs.map +1 -1
  426. package/dist/select/select-separator.d.mts +9 -0
  427. package/dist/select/select-separator.d.mts.map +1 -1
  428. package/dist/select/select-separator.mjs +2 -0
  429. package/dist/select/select-separator.mjs.map +1 -1
  430. package/dist/select/select-trigger.d.mts +9 -0
  431. package/dist/select/select-trigger.d.mts.map +1 -1
  432. package/dist/select/select-trigger.mjs +2 -0
  433. package/dist/select/select-trigger.mjs.map +1 -1
  434. package/dist/select/select-value.d.mts +9 -0
  435. package/dist/select/select-value.d.mts.map +1 -1
  436. package/dist/select/select-value.mjs +2 -0
  437. package/dist/select/select-value.mjs.map +1 -1
  438. package/dist/slider/index.d.mts +2 -0
  439. package/dist/slider/index.d.mts.map +1 -1
  440. package/dist/slider/index.mjs +2 -0
  441. package/dist/slider/index.mjs.map +1 -1
  442. package/dist/slider/slider-indicator.d.mts +12 -0
  443. package/dist/slider/slider-indicator.d.mts.map +1 -1
  444. package/dist/slider/slider-indicator.mjs +2 -0
  445. package/dist/slider/slider-indicator.mjs.map +1 -1
  446. package/dist/slider/slider-label.d.mts +11 -1
  447. package/dist/slider/slider-label.d.mts.map +1 -1
  448. package/dist/slider/slider-label.mjs +2 -0
  449. package/dist/slider/slider-label.mjs.map +1 -1
  450. package/dist/slider/slider-root.d.mts +53 -9
  451. package/dist/slider/slider-root.d.mts.map +1 -1
  452. package/dist/slider/slider-root.mjs +4 -8
  453. package/dist/slider/slider-root.mjs.map +1 -1
  454. package/dist/slider/slider-thumb.d.mts +32 -3
  455. package/dist/slider/slider-thumb.d.mts.map +1 -1
  456. package/dist/slider/slider-thumb.mjs +2 -0
  457. package/dist/slider/slider-thumb.mjs.map +1 -1
  458. package/dist/slider/slider-track.d.mts +17 -0
  459. package/dist/slider/slider-track.d.mts.map +1 -1
  460. package/dist/slider/slider-track.mjs +2 -0
  461. package/dist/slider/slider-track.mjs.map +1 -1
  462. package/dist/slider/slider-value.d.mts +11 -0
  463. package/dist/slider/slider-value.d.mts.map +1 -1
  464. package/dist/slider/slider-value.mjs +2 -0
  465. package/dist/slider/slider-value.mjs.map +1 -1
  466. package/dist/switch/switch.d.mts +23 -3
  467. package/dist/switch/switch.d.mts.map +1 -1
  468. package/dist/switch/switch.mjs +2 -0
  469. package/dist/switch/switch.mjs.map +1 -1
  470. package/dist/tabs/index.d.mts +2 -0
  471. package/dist/tabs/index.d.mts.map +1 -1
  472. package/dist/tabs/index.mjs +2 -0
  473. package/dist/tabs/index.mjs.map +1 -1
  474. package/dist/tabs/tabs-context.d.mts +5 -0
  475. package/dist/tabs/tabs-context.d.mts.map +1 -1
  476. package/dist/tabs/tabs-context.mjs.map +1 -1
  477. package/dist/tabs/tabs-indicator.d.mts +17 -0
  478. package/dist/tabs/tabs-indicator.d.mts.map +1 -1
  479. package/dist/tabs/tabs-indicator.mjs +2 -0
  480. package/dist/tabs/tabs-indicator.mjs.map +1 -1
  481. package/dist/tabs/tabs-list.d.mts +19 -1
  482. package/dist/tabs/tabs-list.d.mts.map +1 -1
  483. package/dist/tabs/tabs-list.mjs +2 -0
  484. package/dist/tabs/tabs-list.mjs.map +1 -1
  485. package/dist/tabs/tabs-panel.d.mts +19 -0
  486. package/dist/tabs/tabs-panel.d.mts.map +1 -1
  487. package/dist/tabs/tabs-panel.mjs +2 -0
  488. package/dist/tabs/tabs-panel.mjs.map +1 -1
  489. package/dist/tabs/tabs-root.d.mts +39 -5
  490. package/dist/tabs/tabs-root.d.mts.map +1 -1
  491. package/dist/tabs/tabs-root.mjs +2 -0
  492. package/dist/tabs/tabs-root.mjs.map +1 -1
  493. package/dist/tabs/tabs-tab.d.mts +22 -1
  494. package/dist/tabs/tabs-tab.d.mts.map +1 -1
  495. package/dist/tabs/tabs-tab.mjs +2 -0
  496. package/dist/tabs/tabs-tab.mjs.map +1 -1
  497. package/dist/toast/index.d.mts +2 -0
  498. package/dist/toast/index.d.mts.map +1 -1
  499. package/dist/toast/index.mjs +2 -0
  500. package/dist/toast/index.mjs.map +1 -1
  501. package/dist/toast/toast-action.d.mts +42 -6
  502. package/dist/toast/toast-action.d.mts.map +1 -1
  503. package/dist/toast/toast-action.mjs +8 -4
  504. package/dist/toast/toast-action.mjs.map +1 -1
  505. package/dist/toast/toast-close.d.mts +16 -0
  506. package/dist/toast/toast-close.d.mts.map +1 -1
  507. package/dist/toast/toast-close.mjs +2 -0
  508. package/dist/toast/toast-close.mjs.map +1 -1
  509. package/dist/toast/toast-context.mjs.map +1 -1
  510. package/dist/toast/toast-description.d.mts +16 -1
  511. package/dist/toast/toast-description.d.mts.map +1 -1
  512. package/dist/toast/toast-description.mjs +2 -0
  513. package/dist/toast/toast-description.mjs.map +1 -1
  514. package/dist/toast/toast-queue.mjs.map +1 -1
  515. package/dist/toast/toast-root.d.mts +20 -0
  516. package/dist/toast/toast-root.d.mts.map +1 -1
  517. package/dist/toast/toast-root.mjs +2 -0
  518. package/dist/toast/toast-root.mjs.map +1 -1
  519. package/dist/toast/toast-title.d.mts +15 -1
  520. package/dist/toast/toast-title.d.mts.map +1 -1
  521. package/dist/toast/toast-title.mjs +2 -0
  522. package/dist/toast/toast-title.mjs.map +1 -1
  523. package/dist/toast/toast-viewport.d.mts +34 -5
  524. package/dist/toast/toast-viewport.d.mts.map +1 -1
  525. package/dist/toast/toast-viewport.mjs +17 -15
  526. package/dist/toast/toast-viewport.mjs.map +1 -1
  527. package/dist/toast/toast.d.mts +56 -13
  528. package/dist/toast/toast.d.mts.map +1 -1
  529. package/dist/toast/toast.mjs +4 -0
  530. package/dist/toast/toast.mjs.map +1 -1
  531. package/dist/toggle/toggle.d.mts +20 -2
  532. package/dist/toggle/toggle.d.mts.map +1 -1
  533. package/dist/toggle/toggle.mjs +2 -0
  534. package/dist/toggle/toggle.mjs.map +1 -1
  535. package/dist/toggle-group/index.d.mts +2 -0
  536. package/dist/toggle-group/index.d.mts.map +1 -1
  537. package/dist/toggle-group/index.mjs +2 -0
  538. package/dist/toggle-group/index.mjs.map +1 -1
  539. package/dist/toggle-group/toggle-group-context.d.mts +1 -0
  540. package/dist/toggle-group/toggle-group-context.d.mts.map +1 -1
  541. package/dist/toggle-group/toggle-group-context.mjs.map +1 -1
  542. package/dist/toggle-group/toggle-group-item.d.mts +16 -0
  543. package/dist/toggle-group/toggle-group-item.d.mts.map +1 -1
  544. package/dist/toggle-group/toggle-group-item.mjs +2 -0
  545. package/dist/toggle-group/toggle-group-item.mjs.map +1 -1
  546. package/dist/toggle-group/toggle-group-root.d.mts +73 -12
  547. package/dist/toggle-group/toggle-group-root.d.mts.map +1 -1
  548. package/dist/toggle-group/toggle-group-root.mjs +3 -1
  549. package/dist/toggle-group/toggle-group-root.mjs.map +1 -1
  550. package/dist/toolbar/index.d.mts +2 -0
  551. package/dist/toolbar/index.d.mts.map +1 -1
  552. package/dist/toolbar/index.mjs +2 -0
  553. package/dist/toolbar/index.mjs.map +1 -1
  554. package/dist/toolbar/toolbar-root.d.mts +30 -3
  555. package/dist/toolbar/toolbar-root.d.mts.map +1 -1
  556. package/dist/toolbar/toolbar-root.mjs +2 -0
  557. package/dist/toolbar/toolbar-root.mjs.map +1 -1
  558. package/dist/toolbar/toolbar-separator.d.mts +13 -0
  559. package/dist/toolbar/toolbar-separator.d.mts.map +1 -1
  560. package/dist/toolbar/toolbar-separator.mjs +2 -0
  561. package/dist/toolbar/toolbar-separator.mjs.map +1 -1
  562. package/dist/tooltip/index.d.mts +2 -0
  563. package/dist/tooltip/index.d.mts.map +1 -1
  564. package/dist/tooltip/index.mjs +2 -0
  565. package/dist/tooltip/index.mjs.map +1 -1
  566. package/dist/tooltip/tooltip-arrow.d.mts +16 -0
  567. package/dist/tooltip/tooltip-arrow.d.mts.map +1 -1
  568. package/dist/tooltip/tooltip-arrow.mjs +2 -0
  569. package/dist/tooltip/tooltip-arrow.mjs.map +1 -1
  570. package/dist/tooltip/tooltip-context.d.mts +4 -0
  571. package/dist/tooltip/tooltip-context.d.mts.map +1 -1
  572. package/dist/tooltip/tooltip-context.mjs.map +1 -1
  573. package/dist/tooltip/tooltip-popup.d.mts +24 -3
  574. package/dist/tooltip/tooltip-popup.d.mts.map +1 -1
  575. package/dist/tooltip/tooltip-popup.mjs +2 -0
  576. package/dist/tooltip/tooltip-popup.mjs.map +1 -1
  577. package/dist/tooltip/tooltip-root.d.mts +24 -2
  578. package/dist/tooltip/tooltip-root.d.mts.map +1 -1
  579. package/dist/tooltip/tooltip-root.mjs +2 -0
  580. package/dist/tooltip/tooltip-root.mjs.map +1 -1
  581. package/dist/tooltip/tooltip-trigger.d.mts +18 -1
  582. package/dist/tooltip/tooltip-trigger.d.mts.map +1 -1
  583. package/dist/tooltip/tooltip-trigger.mjs +2 -0
  584. package/dist/tooltip/tooltip-trigger.mjs.map +1 -1
  585. package/package.json +9 -1
  586. package/skills/funstack-ui-knowledge/SKILL.md +75 -0
  587. package/dist/internal/use-superseded-rejection.mjs +0 -47
  588. package/dist/internal/use-superseded-rejection.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"popover-trigger.mjs","names":[],"sources":["../../src/popover/popover-trigger.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { usePopoverTrigger } from \"../internal/use-popover-trigger.js\";\nimport type { PopoverTriggerHookState } from \"../internal/use-popover-trigger.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { usePopoverContext } from \"./popover-context.js\";\n\nexport type PopoverTriggerState = PopoverTriggerHookState;\n\nexport interface PopoverTriggerProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n | \"onClick\"\n | \"aria-expanded\"\n | \"commandfor\"\n | \"command\"\n | \"popoverTarget\"\n | \"popoverTargetAction\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * Never dispatches. Native `disabled` on a `<button>` (no longer an invoker); in library mode\n * with a link or component `render`, `aria-disabled=\"true\"` instead: the element stays\n * focusable.\n */\n disabled?: boolean;\n className?: StateValue<string | undefined, PopoverTriggerState>;\n style?: StateValue<CSSProperties | undefined, PopoverTriggerState>;\n /** Rendered from optimistic state; must not suspend. */\n children?: StateValue<ReactNode, PopoverTriggerState>;\n /**\n * Should render a `<button>`; another element works only in library mode (click handler), and\n * a press on it while the popup is open is a light dismiss rather than the awaited close.\n */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, PopoverTriggerState>;\n}\n\n/**\n * The toggle: `<button type=\"button\" popovertarget>`, with no `aria-expanded`: the browser exposes\n * the popover's state on its invoker. In JS-free mode the browser toggles the popover and the\n * Popup keeps `data-open` current. In library mode the click is cancelled (so the toggle does not\n * run) and dispatched through the Root's transition: an open, or a library-owned close while open.\n * The button shows optimistic `data-open` and `data-pending` until the change has landed; a\n * non-button `render` renders `aria-expanded` from the shown popup (in the top layer).\n *\n * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `aria-disabled`\n * (library mode, link or component `render`), `popoverTarget`, `aria-expanded`, `onClick`\n * (library mode), `data-open`, `data-pending`, `data-disabled`; `commandfor`, `command` and\n * `popoverTargetAction` (never written; omitted from the props type). `aria-haspopup` and\n * `aria-controls` pass through.\n */\nexport function PopoverTrigger({\n disabled = false,\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverTriggerProps) {\n const ctx = usePopoverContext(\"Popover.Trigger\");\n const { state, libraryProps, ref } = usePopoverTrigger(ctx, {\n part: \"Popover.Trigger\",\n disabled,\n render,\n });\n\n return useRender<ComponentPropsWithRef<\"button\">, PopoverTriggerState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps,\n ref,\n });\n}\n\nPopoverTrigger.displayName = \"PopoverTrigger\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqDA,SAAgB,eAAe,EAC7B,WAAW,OACX,WACA,OACA,UACA,QACA,GAAG,QACmB;CACtB,MAAM,MAAM,kBAAkB,iBAAiB;CAC/C,MAAM,EAAE,OAAO,cAAc,QAAQ,kBAAkB,KAAK;EAC1D,MAAM;EACN;EACA;CACF,CAAC;CAED,OAAO,UAAgE;EACrE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;EACA;CACF,CAAC;AACH;AAEA,eAAe,cAAc"}
1
+ {"version":3,"file":"popover-trigger.mjs","names":[],"sources":["../../src/popover/popover-trigger.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { usePopoverTrigger } from \"../internal/use-popover-trigger.js\";\nimport type { PopoverTriggerHookState } from \"../internal/use-popover-trigger.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { usePopoverContext } from \"./popover-context.js\";\n\n/**\n * State of `Popover.Trigger`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport type PopoverTriggerState = PopoverTriggerHookState;\n\n/**\n * Props of `Popover.Trigger`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport interface PopoverTriggerProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n | \"onClick\"\n | \"aria-expanded\"\n | \"commandfor\"\n | \"command\"\n | \"popoverTarget\"\n | \"popoverTargetAction\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * Never dispatches. Native `disabled` on a `<button>` (no longer an invoker); in library mode\n * with a link or component `render`, `aria-disabled=\"true\"` instead: the element stays\n * focusable.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, PopoverTriggerState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, PopoverTriggerState>;\n /** Rendered from optimistic state; must not suspend. */\n children?: StateValue<ReactNode, PopoverTriggerState>;\n /**\n * Should render a `<button>`; another element works only in library mode (click handler), and\n * a press on it while the popup is open is a light dismiss rather than the awaited close.\n */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, PopoverTriggerState>;\n}\n\n/**\n * The toggle: `<button type=\"button\" popovertarget>`, with no `aria-expanded`: the browser exposes\n * the popover's state on its invoker. In JS-free mode the browser toggles the popover and the\n * Popup keeps `data-open` current. In library mode the click is cancelled (so the toggle does not\n * run) and dispatched through the Root's transition: an open, or a library-owned close while open.\n * The button shows optimistic `data-open` and `data-pending` until the change has landed; a\n * non-button `render` renders `aria-expanded` from the shown popup (in the top layer).\n *\n * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `aria-disabled`\n * (library mode, link or component `render`), `popoverTarget`, `aria-expanded`, `onClick`\n * (library mode), `data-open`, `data-pending`, `data-disabled`; `commandfor`, `command` and\n * `popoverTargetAction` (never written; omitted from the props type). `aria-haspopup` and\n * `aria-controls` pass through.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport function PopoverTrigger({\n disabled = false,\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverTriggerProps) {\n const ctx = usePopoverContext(\"Popover.Trigger\");\n const { state, libraryProps, ref } = usePopoverTrigger(ctx, {\n part: \"Popover.Trigger\",\n disabled,\n render,\n });\n\n return useRender<ComponentPropsWithRef<\"button\">, PopoverTriggerState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps,\n ref,\n });\n}\n\nPopoverTrigger.displayName = \"PopoverTrigger\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoEA,SAAgB,eAAe,EAC7B,WAAW,OACX,WACA,OACA,UACA,QACA,GAAG,QACmB;CACtB,MAAM,MAAM,kBAAkB,iBAAiB;CAC/C,MAAM,EAAE,OAAO,cAAc,QAAQ,kBAAkB,KAAK;EAC1D,MAAM;EACN;EACA;CACF,CAAC;CAED,OAAO,UAAgE;EACrE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;EACA;CACF,CAAC;AACH;AAEA,eAAe,cAAc"}
@@ -11,6 +11,8 @@ import { ProgressValue, ProgressValueProps } from "./progress-value.mjs";
11
11
  * (the fill, sized by your CSS from `--progress-value`), `Label` and `Value`. Output-only: no
12
12
  * actions and no pending state; a `value` of `null` (the default) is indeterminate. Write a value
13
13
  * that reports on a pending action with a plain `setState`, never inside `startTransition`.
14
+ *
15
+ * @see https://ui.funstack.work/components/progress
14
16
  */
15
17
  export declare const Progress: {
16
18
  readonly Root: typeof ProgressRoot;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/progress/index.ts"],"mappings":";;;;;;;;;;;;;;qBAgBa;WACX,aAAI;WACJ,cAAK;WACL,kBAAS;WACT,cAAK;WACL,cAAK"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/progress/index.ts"],"mappings":";;;;;;;;;;;;;;;;qBAkBa;WACX,aAAI;WACJ,cAAK;WACL,kBAAS;WACT,cAAK;WACL,cAAK"}
@@ -10,6 +10,8 @@ import { ProgressValue } from "./progress-value.mjs";
10
10
  * (the fill, sized by your CSS from `--progress-value`), `Label` and `Value`. Output-only: no
11
11
  * actions and no pending state; a `value` of `null` (the default) is indeterminate. Write a value
12
12
  * that reports on a pending action with a plain `setState`, never inside `startTransition`.
13
+ *
14
+ * @see https://ui.funstack.work/components/progress
13
15
  */
14
16
  const Progress = {
15
17
  Root: ProgressRoot,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/progress/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 { ProgressIndicator } from \"./progress-indicator.js\";\nimport { ProgressLabel } from \"./progress-label.js\";\nimport { ProgressRoot } from \"./progress-root.js\";\nimport { ProgressTrack } from \"./progress-track.js\";\nimport { ProgressValue } from \"./progress-value.js\";\n\n/**\n * Progress (WAI-ARIA `progressbar`): `Root` (`div[role=progressbar]`, directive-free, so a\n * Server Component may render it and it runs on the server), `Track` (the rail), `Indicator`\n * (the fill, sized by your CSS from `--progress-value`), `Label` and `Value`. Output-only: no\n * actions and no pending state; a `value` of `null` (the default) is indeterminate. Write a value\n * that reports on a pending action with a plain `setState`, never inside `startTransition`.\n */\nexport const Progress = {\n Root: ProgressRoot,\n Track: ProgressTrack,\n Indicator: ProgressIndicator,\n Label: ProgressLabel,\n Value: ProgressValue,\n} as const;\n\nexport type { ProgressRootProps, ProgressState } from \"./progress-root.js\";\nexport type { ProgressTrackProps } from \"./progress-track.js\";\nexport type { ProgressIndicatorProps } from \"./progress-indicator.js\";\nexport type { ProgressLabelProps } from \"./progress-label.js\";\nexport type { ProgressValueProps } from \"./progress-value.js\";\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAa,WAAW;CACtB,MAAM;CACN,OAAO;CACP,WAAW;CACX,OAAO;CACP,OAAO;AACT"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/progress/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 { ProgressIndicator } from \"./progress-indicator.js\";\nimport { ProgressLabel } from \"./progress-label.js\";\nimport { ProgressRoot } from \"./progress-root.js\";\nimport { ProgressTrack } from \"./progress-track.js\";\nimport { ProgressValue } from \"./progress-value.js\";\n\n/**\n * Progress (WAI-ARIA `progressbar`): `Root` (`div[role=progressbar]`, directive-free, so a\n * Server Component may render it and it runs on the server), `Track` (the rail), `Indicator`\n * (the fill, sized by your CSS from `--progress-value`), `Label` and `Value`. Output-only: no\n * actions and no pending state; a `value` of `null` (the default) is indeterminate. Write a value\n * that reports on a pending action with a plain `setState`, never inside `startTransition`.\n *\n * @see https://ui.funstack.work/components/progress\n */\nexport const Progress = {\n Root: ProgressRoot,\n Track: ProgressTrack,\n Indicator: ProgressIndicator,\n Label: ProgressLabel,\n Value: ProgressValue,\n} as const;\n\nexport type { ProgressRootProps, ProgressState } from \"./progress-root.js\";\nexport type { ProgressTrackProps } from \"./progress-track.js\";\nexport type { ProgressIndicatorProps } from \"./progress-indicator.js\";\nexport type { ProgressLabelProps } from \"./progress-label.js\";\nexport type { ProgressValueProps } from \"./progress-value.js\";\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAa,WAAW;CACtB,MAAM;CACN,OAAO;CACP,WAAW;CACX,OAAO;CACP,OAAO;AACT"}
@@ -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-indicator.d.ts
5
+ /**
6
+ * Props of `Progress.Indicator`.
7
+ *
8
+ * @see https://ui.funstack.work/components/progress
9
+ */
5
10
  export interface ProgressIndicatorProps 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>;
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.Indicator`: the fill. It renders no inline size: the consumer's CSS sizes it from the Root's inherited custom property. Owned keys: `data-indeterminate`, `data-complete`.
22
+ *
23
+ * @see https://ui.funstack.work/components/progress
13
24
  */
14
25
  export declare function ProgressIndicator({ className, style, children, render, ...rest }: ProgressIndicatorProps): ReactNode;
15
26
  export declare namespace ProgressIndicator {
@@ -1 +1 @@
1
- {"version":3,"file":"progress-indicator.d.mts","names":[],"sources":["../../src/progress/progress-indicator.tsx"],"mappings":";;;;iBAQiB,+BAA+B,KAC9C;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;EAC9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,+BAA+B;;;;;wBAMrC,oBACd,WACA,OACA,UACA,WACG,QACF,yBAAsB;yBANT"}
1
+ {"version":3,"file":"progress-indicator.d.mts","names":[],"sources":["../../src/progress/progress-indicator.tsx"],"mappings":";;;;;;;;;iBAaiB,+BAA+B,KAC9C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,+BAA+B;;;;;;;wBAQrC,oBACd,WACA,OACA,UACA,WACG,QACF,yBAAsB;yBANT"}
@@ -5,6 +5,8 @@ import { useProgressContext } from "./progress-context.mjs";
5
5
  //#region src/progress/progress-indicator.tsx
6
6
  /**
7
7
  * `Progress.Indicator`: the fill. It renders no inline size: the consumer's CSS sizes it from the Root's inherited custom property. Owned keys: `data-indeterminate`, `data-complete`.
8
+ *
9
+ * @see https://ui.funstack.work/components/progress
8
10
  */
9
11
  function ProgressIndicator({ className, style, children, render, ...rest }) {
10
12
  const { state } = useProgressContext("Progress.Indicator");
@@ -1 +1 @@
1
- {"version":3,"file":"progress-indicator.mjs","names":[],"sources":["../../src/progress/progress-indicator.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 ProgressIndicatorProps extends Omit<\n ComponentPropsWithRef<\"span\">,\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<\"span\">, ProgressState>;\n}\n\n/**\n * `Progress.Indicator`: the fill. It renders no inline size: the consumer's CSS sizes it from the Root's inherited custom property. Owned keys: `data-indeterminate`, `data-complete`.\n */\nexport function ProgressIndicator({\n className,\n style,\n children,\n render,\n ...rest\n}: ProgressIndicatorProps) {\n const { state } = useProgressContext(\"Progress.Indicator\");\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 \"data-indeterminate\": dataAttr(state.indeterminate),\n \"data-complete\": dataAttr(state.complete),\n },\n });\n}\n\nProgressIndicator.displayName = \"ProgressIndicator\";\n"],"mappings":";;;;;;;;AAqBA,SAAgB,kBAAkB,EAChC,WACA,OACA,UACA,QACA,GAAG,QACsB;CACzB,MAAM,EAAE,UAAU,mBAAmB,oBAAoB;CACzD,OAAO,UAAwD;EAC7D,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,kBAAkB,cAAc"}
1
+ {"version":3,"file":"progress-indicator.mjs","names":[],"sources":["../../src/progress/progress-indicator.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.Indicator`.\n *\n * @see https://ui.funstack.work/components/progress\n */\nexport interface ProgressIndicatorProps 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 /** 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.Indicator`: the fill. It renders no inline size: the consumer's CSS sizes it from the Root's inherited custom property. Owned keys: `data-indeterminate`, `data-complete`.\n *\n * @see https://ui.funstack.work/components/progress\n */\nexport function ProgressIndicator({\n className,\n style,\n children,\n render,\n ...rest\n}: ProgressIndicatorProps) {\n const { state } = useProgressContext(\"Progress.Indicator\");\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 \"data-indeterminate\": dataAttr(state.indeterminate),\n \"data-complete\": dataAttr(state.complete),\n },\n });\n}\n\nProgressIndicator.displayName = \"ProgressIndicator\";\n"],"mappings":";;;;;;;;;;AAgCA,SAAgB,kBAAkB,EAChC,WACA,OACA,UACA,QACA,GAAG,QACsB;CACzB,MAAM,EAAE,UAAU,mBAAmB,oBAAoB;CACzD,OAAO,UAAwD;EAC7D,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,kBAAkB,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-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"}