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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (962) hide show
  1. package/README.md +22 -1
  2. package/dist/accordion/accordion-context.mjs.map +1 -1
  3. package/dist/accordion/accordion-item.d.mts +22 -4
  4. package/dist/accordion/accordion-item.d.mts.map +1 -1
  5. package/dist/accordion/accordion-item.mjs +32 -10
  6. package/dist/accordion/accordion-item.mjs.map +1 -1
  7. package/dist/accordion/accordion-panel.d.mts +19 -4
  8. package/dist/accordion/accordion-panel.d.mts.map +1 -1
  9. package/dist/accordion/accordion-panel.mjs +8 -6
  10. package/dist/accordion/accordion-panel.mjs.map +1 -1
  11. package/dist/accordion/accordion-root.d.mts +39 -5
  12. package/dist/accordion/accordion-root.d.mts.map +1 -1
  13. package/dist/accordion/accordion-root.mjs +75 -67
  14. package/dist/accordion/accordion-root.mjs.map +1 -1
  15. package/dist/accordion/accordion-trigger.d.mts +12 -4
  16. package/dist/accordion/accordion-trigger.d.mts.map +1 -1
  17. package/dist/accordion/accordion-trigger.mjs +14 -28
  18. package/dist/accordion/accordion-trigger.mjs.map +1 -1
  19. package/dist/accordion/index.d.mts +2 -0
  20. package/dist/accordion/index.d.mts.map +1 -1
  21. package/dist/accordion/index.mjs +2 -0
  22. package/dist/accordion/index.mjs.map +1 -1
  23. package/dist/alert-dialog/alert-dialog-action.d.mts +73 -0
  24. package/dist/alert-dialog/alert-dialog-action.d.mts.map +1 -0
  25. package/dist/alert-dialog/alert-dialog-action.mjs +23 -0
  26. package/dist/alert-dialog/alert-dialog-action.mjs.map +1 -0
  27. package/dist/alert-dialog/alert-dialog-cancel.d.mts +31 -0
  28. package/dist/alert-dialog/alert-dialog-cancel.d.mts.map +1 -0
  29. package/dist/alert-dialog/alert-dialog-cancel.mjs +50 -0
  30. package/dist/alert-dialog/alert-dialog-cancel.mjs.map +1 -0
  31. package/dist/alert-dialog/alert-dialog-context.mjs +24 -0
  32. package/dist/alert-dialog/alert-dialog-context.mjs.map +1 -0
  33. package/dist/alert-dialog/alert-dialog-description.d.mts +25 -0
  34. package/dist/alert-dialog/alert-dialog-description.d.mts.map +1 -0
  35. package/dist/alert-dialog/alert-dialog-description.mjs +20 -0
  36. package/dist/alert-dialog/alert-dialog-description.mjs.map +1 -0
  37. package/dist/alert-dialog/alert-dialog-form.d.mts +27 -0
  38. package/dist/alert-dialog/alert-dialog-form.d.mts.map +1 -0
  39. package/dist/alert-dialog/alert-dialog-form.mjs +22 -0
  40. package/dist/alert-dialog/alert-dialog-form.mjs.map +1 -0
  41. package/dist/alert-dialog/alert-dialog-popup.d.mts +42 -0
  42. package/dist/alert-dialog/alert-dialog-popup.d.mts.map +1 -0
  43. package/dist/alert-dialog/alert-dialog-popup.mjs +53 -0
  44. package/dist/alert-dialog/alert-dialog-popup.mjs.map +1 -0
  45. package/dist/alert-dialog/alert-dialog-root.d.mts +31 -0
  46. package/dist/alert-dialog/alert-dialog-root.d.mts.map +1 -0
  47. package/dist/alert-dialog/alert-dialog-root.mjs +22 -0
  48. package/dist/alert-dialog/alert-dialog-root.mjs.map +1 -0
  49. package/dist/alert-dialog/alert-dialog-title.d.mts +23 -0
  50. package/dist/alert-dialog/alert-dialog-title.d.mts.map +1 -0
  51. package/dist/alert-dialog/alert-dialog-title.mjs +18 -0
  52. package/dist/alert-dialog/alert-dialog-title.mjs.map +1 -0
  53. package/dist/alert-dialog/alert-dialog-trigger.d.mts +23 -0
  54. package/dist/alert-dialog/alert-dialog-trigger.d.mts.map +1 -0
  55. package/dist/alert-dialog/alert-dialog-trigger.mjs +18 -0
  56. package/dist/alert-dialog/alert-dialog-trigger.mjs.map +1 -0
  57. package/dist/alert-dialog/index.d.mts +33 -0
  58. package/dist/alert-dialog/index.d.mts.map +1 -0
  59. package/dist/alert-dialog/index.mjs +33 -0
  60. package/dist/alert-dialog/index.mjs.map +1 -0
  61. package/dist/bin/skill-installer.d.mts +1 -0
  62. package/dist/bin/skill-installer.mjs +12 -0
  63. package/dist/bin/skill-installer.mjs.map +1 -0
  64. package/dist/button/button.d.mts +118 -0
  65. package/dist/button/button.d.mts.map +1 -0
  66. package/dist/button/button.mjs +98 -0
  67. package/dist/button/button.mjs.map +1 -0
  68. package/dist/button/index.d.mts +3 -0
  69. package/dist/button/index.mjs +1 -0
  70. package/dist/checkbox/checkbox.d.mts +32 -9
  71. package/dist/checkbox/checkbox.d.mts.map +1 -1
  72. package/dist/checkbox/checkbox.mjs +25 -50
  73. package/dist/checkbox/checkbox.mjs.map +1 -1
  74. package/dist/checkbox-group/checkbox-group-context.mjs.map +1 -1
  75. package/dist/checkbox-group/checkbox-group-item.d.mts +20 -5
  76. package/dist/checkbox-group/checkbox-group-item.d.mts.map +1 -1
  77. package/dist/checkbox-group/checkbox-group-item.mjs +25 -27
  78. package/dist/checkbox-group/checkbox-group-item.mjs.map +1 -1
  79. package/dist/checkbox-group/checkbox-group-label.d.mts +10 -0
  80. package/dist/checkbox-group/checkbox-group-label.d.mts.map +1 -1
  81. package/dist/checkbox-group/checkbox-group-label.mjs +3 -6
  82. package/dist/checkbox-group/checkbox-group-label.mjs.map +1 -1
  83. package/dist/checkbox-group/checkbox-group-parent.d.mts +22 -5
  84. package/dist/checkbox-group/checkbox-group-parent.d.mts.map +1 -1
  85. package/dist/checkbox-group/checkbox-group-parent.mjs +17 -13
  86. package/dist/checkbox-group/checkbox-group-parent.mjs.map +1 -1
  87. package/dist/checkbox-group/checkbox-group-root.d.mts +37 -7
  88. package/dist/checkbox-group/checkbox-group-root.d.mts.map +1 -1
  89. package/dist/checkbox-group/checkbox-group-root.mjs +102 -102
  90. package/dist/checkbox-group/checkbox-group-root.mjs.map +1 -1
  91. package/dist/checkbox-group/index.d.mts +2 -0
  92. package/dist/checkbox-group/index.d.mts.map +1 -1
  93. package/dist/checkbox-group/index.mjs +2 -0
  94. package/dist/checkbox-group/index.mjs.map +1 -1
  95. package/dist/collapsible/collapsible-context.mjs +8 -0
  96. package/dist/collapsible/collapsible-context.mjs.map +1 -0
  97. package/dist/collapsible/collapsible-panel.d.mts +53 -0
  98. package/dist/collapsible/collapsible-panel.d.mts.map +1 -0
  99. package/dist/collapsible/collapsible-panel.mjs +41 -0
  100. package/dist/collapsible/collapsible-panel.mjs.map +1 -0
  101. package/dist/collapsible/collapsible-root.d.mts +108 -0
  102. package/dist/collapsible/collapsible-root.d.mts.map +1 -0
  103. package/dist/collapsible/collapsible-root.mjs +147 -0
  104. package/dist/collapsible/collapsible-root.mjs.map +1 -0
  105. package/dist/collapsible/collapsible-trigger.d.mts +45 -0
  106. package/dist/collapsible/collapsible-trigger.d.mts.map +1 -0
  107. package/dist/collapsible/collapsible-trigger.mjs +62 -0
  108. package/dist/collapsible/collapsible-trigger.mjs.map +1 -0
  109. package/dist/collapsible/index.d.mts +21 -0
  110. package/dist/collapsible/index.d.mts.map +1 -0
  111. package/dist/collapsible/index.mjs +21 -0
  112. package/dist/collapsible/index.mjs.map +1 -0
  113. package/dist/combobox/chip-text.mjs +24 -0
  114. package/dist/combobox/chip-text.mjs.map +1 -0
  115. package/dist/combobox/combobox-chips.d.mts +159 -0
  116. package/dist/combobox/combobox-chips.d.mts.map +1 -0
  117. package/dist/combobox/combobox-chips.mjs +198 -0
  118. package/dist/combobox/combobox-chips.mjs.map +1 -0
  119. package/dist/combobox/combobox-clear.d.mts +29 -5
  120. package/dist/combobox/combobox-clear.d.mts.map +1 -1
  121. package/dist/combobox/combobox-clear.mjs +17 -8
  122. package/dist/combobox/combobox-clear.mjs.map +1 -1
  123. package/dist/combobox/combobox-context.mjs +4 -5
  124. package/dist/combobox/combobox-context.mjs.map +1 -1
  125. package/dist/combobox/combobox-group.d.mts +49 -1
  126. package/dist/combobox/combobox-group.d.mts.map +1 -1
  127. package/dist/combobox/combobox-group.mjs +14 -3
  128. package/dist/combobox/combobox-group.mjs.map +1 -1
  129. package/dist/combobox/combobox-input.d.mts +27 -5
  130. package/dist/combobox/combobox-input.d.mts.map +1 -1
  131. package/dist/combobox/combobox-input.mjs +53 -13
  132. package/dist/combobox/combobox-input.mjs.map +1 -1
  133. package/dist/combobox/combobox-keyboard.mjs +127 -0
  134. package/dist/combobox/combobox-keyboard.mjs.map +1 -0
  135. package/dist/combobox/combobox-label.d.mts +18 -1
  136. package/dist/combobox/combobox-label.d.mts.map +1 -1
  137. package/dist/combobox/combobox-label.mjs +4 -1
  138. package/dist/combobox/combobox-label.mjs.map +1 -1
  139. package/dist/combobox/combobox-list.d.mts +15 -1
  140. package/dist/combobox/combobox-list.d.mts.map +1 -1
  141. package/dist/combobox/combobox-list.mjs +13 -13
  142. package/dist/combobox/combobox-list.mjs.map +1 -1
  143. package/dist/combobox/combobox-option.d.mts +30 -5
  144. package/dist/combobox/combobox-option.d.mts.map +1 -1
  145. package/dist/combobox/combobox-option.mjs +9 -5
  146. package/dist/combobox/combobox-option.mjs.map +1 -1
  147. package/dist/combobox/combobox-popup.d.mts +24 -3
  148. package/dist/combobox/combobox-popup.d.mts.map +1 -1
  149. package/dist/combobox/combobox-popup.mjs +24 -29
  150. package/dist/combobox/combobox-popup.mjs.map +1 -1
  151. package/dist/combobox/combobox-root.d.mts +183 -43
  152. package/dist/combobox/combobox-root.d.mts.map +1 -1
  153. package/dist/combobox/combobox-root.mjs +476 -270
  154. package/dist/combobox/combobox-root.mjs.map +1 -1
  155. package/dist/combobox/combobox-trigger.d.mts +36 -8
  156. package/dist/combobox/combobox-trigger.d.mts.map +1 -1
  157. package/dist/combobox/combobox-trigger.mjs +50 -41
  158. package/dist/combobox/combobox-trigger.mjs.map +1 -1
  159. package/dist/combobox/index.d.mts +13 -5
  160. package/dist/combobox/index.d.mts.map +1 -1
  161. package/dist/combobox/index.mjs +13 -5
  162. package/dist/combobox/index.mjs.map +1 -1
  163. package/dist/combobox/use-combobox-form.mjs +53 -0
  164. package/dist/combobox/use-combobox-form.mjs.map +1 -0
  165. package/dist/combobox/use-combobox-text.mjs +43 -0
  166. package/dist/combobox/use-combobox-text.mjs.map +1 -0
  167. package/dist/csp/csp-provider.d.mts +33 -0
  168. package/dist/csp/csp-provider.d.mts.map +1 -0
  169. package/dist/csp/csp-provider.mjs +26 -0
  170. package/dist/csp/csp-provider.mjs.map +1 -0
  171. package/dist/csp/index.d.mts +3 -0
  172. package/dist/csp/index.mjs +3 -0
  173. package/dist/csp/style-hashes.d.mts +21 -0
  174. package/dist/csp/style-hashes.d.mts.map +1 -0
  175. package/dist/csp/style-hashes.mjs +23 -0
  176. package/dist/csp/style-hashes.mjs.map +1 -0
  177. package/dist/dialog/dialog-close.d.mts +56 -12
  178. package/dist/dialog/dialog-close.d.mts.map +1 -1
  179. package/dist/dialog/dialog-close.mjs +52 -55
  180. package/dist/dialog/dialog-close.mjs.map +1 -1
  181. package/dist/dialog/dialog-context.d.mts +2 -0
  182. package/dist/dialog/dialog-context.mjs +14 -2
  183. package/dist/dialog/dialog-context.mjs.map +1 -1
  184. package/dist/dialog/dialog-description.d.mts +14 -1
  185. package/dist/dialog/dialog-description.d.mts.map +1 -1
  186. package/dist/dialog/dialog-description.mjs +10 -4
  187. package/dist/dialog/dialog-description.mjs.map +1 -1
  188. package/dist/dialog/dialog-dismiss.mjs +108 -0
  189. package/dist/dialog/dialog-dismiss.mjs.map +1 -0
  190. package/dist/dialog/dialog-form.d.mts +43 -11
  191. package/dist/dialog/dialog-form.d.mts.map +1 -1
  192. package/dist/dialog/dialog-form.mjs +64 -37
  193. package/dist/dialog/dialog-form.mjs.map +1 -1
  194. package/dist/dialog/dialog-popup.d.mts +47 -14
  195. package/dist/dialog/dialog-popup.d.mts.map +1 -1
  196. package/dist/dialog/dialog-popup.mjs +167 -242
  197. package/dist/dialog/dialog-popup.mjs.map +1 -1
  198. package/dist/dialog/dialog-root.d.mts +54 -19
  199. package/dist/dialog/dialog-root.d.mts.map +1 -1
  200. package/dist/dialog/dialog-root.mjs +74 -92
  201. package/dist/dialog/dialog-root.mjs.map +1 -1
  202. package/dist/dialog/dialog-title.d.mts +13 -1
  203. package/dist/dialog/dialog-title.d.mts.map +1 -1
  204. package/dist/dialog/dialog-title.mjs +10 -4
  205. package/dist/dialog/dialog-title.mjs.map +1 -1
  206. package/dist/dialog/dialog-trigger.d.mts +30 -6
  207. package/dist/dialog/dialog-trigger.d.mts.map +1 -1
  208. package/dist/dialog/dialog-trigger.mjs +50 -28
  209. package/dist/dialog/dialog-trigger.mjs.map +1 -1
  210. package/dist/dialog/index.d.mts +7 -3
  211. package/dist/dialog/index.d.mts.map +1 -1
  212. package/dist/dialog/index.mjs +7 -3
  213. package/dist/dialog/index.mjs.map +1 -1
  214. package/dist/docs/components/accordion.md +428 -0
  215. package/dist/docs/components/alert-dialog.md +546 -0
  216. package/dist/docs/components/button.md +511 -0
  217. package/dist/docs/components/checkbox-group.md +483 -0
  218. package/dist/docs/components/checkbox.md +373 -0
  219. package/dist/docs/components/collapsible.md +408 -0
  220. package/dist/docs/components/combobox.md +960 -0
  221. package/dist/docs/components/context-menu.md +524 -0
  222. package/dist/docs/components/dialog.md +694 -0
  223. package/dist/docs/components/field.md +765 -0
  224. package/dist/docs/components/hover-card.md +494 -0
  225. package/dist/docs/components/menu.md +670 -0
  226. package/dist/docs/components/meter.md +313 -0
  227. package/dist/docs/components/multi-select.md +622 -0
  228. package/dist/docs/components/number-field.md +528 -0
  229. package/dist/docs/components/popover.md +656 -0
  230. package/dist/docs/components/progress.md +450 -0
  231. package/dist/docs/components/radio-group.md +457 -0
  232. package/dist/docs/components/select.md +670 -0
  233. package/dist/docs/components/separator.md +182 -0
  234. package/dist/docs/components/slider.md +558 -0
  235. package/dist/docs/components/switch.md +311 -0
  236. package/dist/docs/components/tabs.md +473 -0
  237. package/dist/docs/components/toast.md +602 -0
  238. package/dist/docs/components/toggle-group.md +341 -0
  239. package/dist/docs/components/toggle.md +245 -0
  240. package/dist/docs/components/toolbar.md +390 -0
  241. package/dist/docs/components/tooltip.md +494 -0
  242. package/dist/docs/concepts/action-props.md +281 -0
  243. package/dist/docs/concepts/ai-agents.md +56 -0
  244. package/dist/docs/concepts/browser-owned-state.md +133 -0
  245. package/dist/docs/concepts/content-security-policy.md +69 -0
  246. package/dist/docs/concepts/experimental.md +36 -0
  247. package/dist/docs/concepts/pending-and-optimistic.md +263 -0
  248. package/dist/docs/concepts/render.md +23 -0
  249. package/dist/docs/concepts/server-components.md +132 -0
  250. package/dist/docs/concepts/suspense.md +129 -0
  251. package/dist/docs/concepts/transitions.md +112 -0
  252. package/dist/docs/getting-started.md +102 -0
  253. package/dist/docs/index.md +187 -0
  254. package/dist/docs/roadmap.md +144 -0
  255. package/dist/docs/why.md +104 -0
  256. package/dist/field/field-control.d.mts +65 -0
  257. package/dist/field/field-control.d.mts.map +1 -0
  258. package/dist/field/field-control.mjs +92 -0
  259. package/dist/field/field-control.mjs.map +1 -0
  260. package/dist/field/field-description.d.mts +35 -0
  261. package/dist/field/field-description.d.mts.map +1 -0
  262. package/dist/field/field-description.mjs +35 -0
  263. package/dist/field/field-description.mjs.map +1 -0
  264. package/dist/field/field-error.d.mts +42 -0
  265. package/dist/field/field-error.d.mts.map +1 -0
  266. package/dist/field/field-error.mjs +43 -0
  267. package/dist/field/field-error.mjs.map +1 -0
  268. package/dist/field/field-label.d.mts +39 -0
  269. package/dist/field/field-label.d.mts.map +1 -0
  270. package/dist/field/field-label.mjs +50 -0
  271. package/dist/field/field-label.mjs.map +1 -0
  272. package/dist/field/field-root.d.mts +72 -0
  273. package/dist/field/field-root.d.mts.map +1 -0
  274. package/dist/field/field-root.mjs +309 -0
  275. package/dist/field/field-root.mjs.map +1 -0
  276. package/dist/field/index.d.mts +27 -0
  277. package/dist/field/index.d.mts.map +1 -0
  278. package/dist/field/index.mjs +26 -0
  279. package/dist/field/index.mjs.map +1 -0
  280. package/dist/field/use-server-error-visibility.mjs +44 -0
  281. package/dist/field/use-server-error-visibility.mjs.map +1 -0
  282. package/dist/form/form-root.d.mts +74 -0
  283. package/dist/form/form-root.d.mts.map +1 -0
  284. package/dist/form/form-root.mjs +158 -0
  285. package/dist/form/form-root.mjs.map +1 -0
  286. package/dist/form/form-submit.d.mts +56 -0
  287. package/dist/form/form-submit.d.mts.map +1 -0
  288. package/dist/form/form-submit.mjs +53 -0
  289. package/dist/form/form-submit.mjs.map +1 -0
  290. package/dist/form/index.d.mts +18 -0
  291. package/dist/form/index.d.mts.map +1 -0
  292. package/dist/form/index.mjs +18 -0
  293. package/dist/form/index.mjs.map +1 -0
  294. package/dist/hover-card/hover-card-context.mjs +13 -0
  295. package/dist/hover-card/hover-card-context.mjs.map +1 -0
  296. package/dist/hover-card/hover-card-popup.d.mts +102 -0
  297. package/dist/hover-card/hover-card-popup.d.mts.map +1 -0
  298. package/dist/hover-card/hover-card-popup.mjs +80 -0
  299. package/dist/hover-card/hover-card-popup.mjs.map +1 -0
  300. package/dist/hover-card/hover-card-root.d.mts +94 -0
  301. package/dist/hover-card/hover-card-root.d.mts.map +1 -0
  302. package/dist/hover-card/hover-card-root.mjs +74 -0
  303. package/dist/hover-card/hover-card-root.mjs.map +1 -0
  304. package/dist/hover-card/hover-card-trigger.d.mts +65 -0
  305. package/dist/hover-card/hover-card-trigger.d.mts.map +1 -0
  306. package/dist/hover-card/hover-card-trigger.mjs +109 -0
  307. package/dist/hover-card/hover-card-trigger.mjs.map +1 -0
  308. package/dist/hover-card/index.d.mts +24 -0
  309. package/dist/hover-card/index.d.mts.map +1 -0
  310. package/dist/hover-card/index.mjs +24 -0
  311. package/dist/hover-card/index.mjs.map +1 -0
  312. package/dist/hover-card/use-hover-card-interest.mjs +242 -0
  313. package/dist/hover-card/use-hover-card-interest.mjs.map +1 -0
  314. package/dist/index.d.mts +100 -13
  315. package/dist/index.mjs +19 -1
  316. package/dist/internal/{action-details.mjs → action/action-details.mjs} +1 -1
  317. package/dist/internal/action/action-details.mjs.map +1 -0
  318. package/dist/internal/action/call-urgent-handler.mjs +32 -0
  319. package/dist/internal/action/call-urgent-handler.mjs.map +1 -0
  320. package/dist/internal/action/report-dropped.mjs +27 -0
  321. package/dist/internal/action/report-dropped.mjs.map +1 -0
  322. package/dist/internal/action/use-action-trigger.mjs +67 -0
  323. package/dist/internal/action/use-action-trigger.mjs.map +1 -0
  324. package/dist/internal/action/use-connected.mjs +24 -0
  325. package/dist/internal/action/use-connected.mjs.map +1 -0
  326. package/dist/internal/action/use-controllable-action.mjs +153 -0
  327. package/dist/internal/action/use-controllable-action.mjs.map +1 -0
  328. package/dist/internal/action/use-multiple-selection.mjs +83 -0
  329. package/dist/internal/action/use-multiple-selection.mjs.map +1 -0
  330. package/dist/internal/action/use-pure-trigger.mjs +34 -0
  331. package/dist/internal/action/use-pure-trigger.mjs.map +1 -0
  332. package/dist/internal/action/use-step-commit.mjs +147 -0
  333. package/dist/internal/action/use-step-commit.mjs.map +1 -0
  334. package/dist/internal/announce.mjs +20 -0
  335. package/dist/internal/announce.mjs.map +1 -0
  336. package/dist/internal/arrow-keys.mjs +21 -0
  337. package/dist/internal/arrow-keys.mjs.map +1 -0
  338. package/dist/internal/csp-context.mjs +8 -0
  339. package/dist/internal/csp-context.mjs.map +1 -0
  340. package/dist/internal/decimal.mjs +33 -0
  341. package/dist/internal/decimal.mjs.map +1 -0
  342. package/dist/internal/details-summary.mjs +56 -0
  343. package/dist/internal/details-summary.mjs.map +1 -0
  344. package/dist/internal/dev-warn.mjs +17 -0
  345. package/dist/internal/dev-warn.mjs.map +1 -0
  346. package/dist/internal/dom-order.mjs +17 -0
  347. package/dist/internal/dom-order.mjs.map +1 -0
  348. package/dist/internal/form/field-context.d.mts +19 -0
  349. package/dist/internal/form/field-context.d.mts.map +1 -0
  350. package/dist/internal/form/field-context.mjs +24 -0
  351. package/dist/internal/form/field-context.mjs.map +1 -0
  352. package/dist/internal/form/focus-first-invalid.mjs +67 -0
  353. package/dist/internal/form/focus-first-invalid.mjs.map +1 -0
  354. package/dist/internal/form/form-status-watcher.mjs +31 -0
  355. package/dist/internal/form/form-status-watcher.mjs.map +1 -0
  356. package/dist/internal/form/group-member.mjs +37 -0
  357. package/dist/internal/form/group-member.mjs.map +1 -0
  358. package/dist/internal/form/hidden-values.mjs +29 -0
  359. package/dist/internal/form/hidden-values.mjs.map +1 -0
  360. package/dist/internal/{sync-presence.mjs → form/sync-presence.mjs} +6 -2
  361. package/dist/internal/form/sync-presence.mjs.map +1 -0
  362. package/dist/internal/form/use-checkable-input.mjs +79 -0
  363. package/dist/internal/form/use-checkable-input.mjs.map +1 -0
  364. package/dist/internal/form/use-field-control.mjs +125 -0
  365. package/dist/internal/form/use-field-control.mjs.map +1 -0
  366. package/dist/internal/form/use-fieldset-group.mjs +46 -0
  367. package/dist/internal/form/use-fieldset-group.mjs.map +1 -0
  368. package/dist/internal/form/use-form-owner-event.mjs +44 -0
  369. package/dist/internal/form/use-form-owner-event.mjs.map +1 -0
  370. package/dist/internal/form/use-form-reset.mjs +39 -0
  371. package/dist/internal/form/use-form-reset.mjs.map +1 -0
  372. package/dist/internal/{use-native-checked.mjs → form/use-native-checked.mjs} +8 -9
  373. package/dist/internal/form/use-native-checked.mjs.map +1 -0
  374. package/dist/internal/{use-native-group-reconciliation.mjs → form/use-native-group-reconciliation.mjs} +15 -12
  375. package/dist/internal/form/use-native-group-reconciliation.mjs.map +1 -0
  376. package/dist/internal/{use-native-select-value.mjs → form/use-native-select-value.mjs} +8 -6
  377. package/dist/internal/form/use-native-select-value.mjs.map +1 -0
  378. package/dist/internal/form/validity.d.mts +35 -0
  379. package/dist/internal/form/validity.d.mts.map +1 -0
  380. package/dist/internal/form/validity.mjs +98 -0
  381. package/dist/internal/form/validity.mjs.map +1 -0
  382. package/dist/internal/overlay/anchor-position.d.mts +15 -0
  383. package/dist/internal/overlay/anchor-position.d.mts.map +1 -0
  384. package/dist/internal/overlay/anchor-position.mjs +132 -0
  385. package/dist/internal/overlay/anchor-position.mjs.map +1 -0
  386. package/dist/internal/overlay/content-focus-probe.mjs +42 -0
  387. package/dist/internal/overlay/content-focus-probe.mjs.map +1 -0
  388. package/dist/internal/overlay/css-transition-cut.mjs +66 -0
  389. package/dist/internal/overlay/css-transition-cut.mjs.map +1 -0
  390. package/dist/internal/overlay/focus-visible.mjs +26 -0
  391. package/dist/internal/overlay/focus-visible.mjs.map +1 -0
  392. package/dist/internal/overlay/invokers.mjs +63 -0
  393. package/dist/internal/overlay/invokers.mjs.map +1 -0
  394. package/dist/internal/overlay/modal-registry.mjs +39 -0
  395. package/dist/internal/overlay/modal-registry.mjs.map +1 -0
  396. package/dist/internal/overlay/overlay-popup.mjs +103 -0
  397. package/dist/internal/overlay/overlay-popup.mjs.map +1 -0
  398. package/dist/internal/overlay/overlay-show.mjs +73 -0
  399. package/dist/internal/overlay/overlay-show.mjs.map +1 -0
  400. package/dist/internal/overlay/popover-open.mjs +18 -0
  401. package/dist/internal/overlay/popover-open.mjs.map +1 -0
  402. package/dist/internal/overlay/trigger-ref.mjs +26 -0
  403. package/dist/internal/overlay/trigger-ref.mjs.map +1 -0
  404. package/dist/internal/overlay/use-apply-open-state.mjs +44 -0
  405. package/dist/internal/overlay/use-apply-open-state.mjs.map +1 -0
  406. package/dist/internal/{use-exit-animation.mjs → overlay/use-exit-animation.mjs} +28 -8
  407. package/dist/internal/overlay/use-exit-animation.mjs.map +1 -0
  408. package/dist/internal/overlay/use-interest-dismiss.mjs +85 -0
  409. package/dist/internal/overlay/use-interest-dismiss.mjs.map +1 -0
  410. package/dist/internal/overlay/use-modal-registration.mjs +47 -0
  411. package/dist/internal/overlay/use-modal-registration.mjs.map +1 -0
  412. package/dist/internal/overlay/use-overlay-close.mjs +72 -0
  413. package/dist/internal/overlay/use-overlay-close.mjs.map +1 -0
  414. package/dist/internal/overlay/use-overlay-root.d.mts +2 -0
  415. package/dist/internal/overlay/use-overlay-root.mjs +193 -0
  416. package/dist/internal/overlay/use-overlay-root.mjs.map +1 -0
  417. package/dist/internal/overlay/use-popover-popup.mjs +287 -0
  418. package/dist/internal/overlay/use-popover-popup.mjs.map +1 -0
  419. package/dist/internal/overlay/use-popover-trigger.d.mts +16 -0
  420. package/dist/internal/overlay/use-popover-trigger.d.mts.map +1 -0
  421. package/dist/internal/overlay/use-popover-trigger.mjs +142 -0
  422. package/dist/internal/overlay/use-popover-trigger.mjs.map +1 -0
  423. package/dist/internal/overlay/use-resolved-placement.mjs +162 -0
  424. package/dist/internal/overlay/use-resolved-placement.mjs.map +1 -0
  425. package/dist/internal/platform-attributes.d.mts +2 -1
  426. package/dist/internal/platform-attributes.d.mts.map +1 -1
  427. package/dist/internal/pointer-capture.mjs +20 -0
  428. package/dist/internal/pointer-capture.mjs.map +1 -0
  429. package/dist/internal/range-value.mjs +51 -0
  430. package/dist/internal/range-value.mjs.map +1 -0
  431. package/dist/internal/render-element.d.mts +2 -0
  432. package/dist/internal/render-element.mjs +123 -0
  433. package/dist/internal/render-element.mjs.map +1 -0
  434. package/dist/internal/shipped-styles.mjs +14 -0
  435. package/dist/internal/shipped-styles.mjs.map +1 -0
  436. package/dist/internal/toolbar-context.mjs +17 -0
  437. package/dist/internal/toolbar-context.mjs.map +1 -0
  438. package/dist/internal/transition-boundary.mjs +5 -9
  439. package/dist/internal/transition-boundary.mjs.map +1 -1
  440. package/dist/internal/typeahead.mjs +52 -0
  441. package/dist/internal/typeahead.mjs.map +1 -0
  442. package/dist/internal/types.d.mts +42 -9
  443. package/dist/internal/types.d.mts.map +1 -1
  444. package/dist/internal/use-active-option.mjs +51 -0
  445. package/dist/internal/use-active-option.mjs.map +1 -0
  446. package/dist/internal/use-deferred-leave.mjs +113 -0
  447. package/dist/internal/use-deferred-leave.mjs.map +1 -0
  448. package/dist/internal/use-dev-warning.mjs +8 -4
  449. package/dist/internal/use-dev-warning.mjs.map +1 -1
  450. package/dist/internal/use-element-check.mjs +39 -0
  451. package/dist/internal/use-element-check.mjs.map +1 -0
  452. package/dist/internal/use-item-order.mjs +42 -0
  453. package/dist/internal/use-item-order.mjs.map +1 -0
  454. package/dist/internal/use-latest.mjs +28 -0
  455. package/dist/internal/use-latest.mjs.map +1 -0
  456. package/dist/internal/use-merged-refs.mjs +19 -0
  457. package/dist/internal/use-merged-refs.mjs.map +1 -0
  458. package/dist/internal/use-mount-fixed.mjs +22 -0
  459. package/dist/internal/use-mount-fixed.mjs.map +1 -0
  460. package/dist/internal/use-name-warning.mjs +140 -0
  461. package/dist/internal/use-name-warning.mjs.map +1 -0
  462. package/dist/internal/use-native-focusgroup.mjs +19 -0
  463. package/dist/internal/use-native-focusgroup.mjs.map +1 -0
  464. package/dist/internal/use-option-registry.mjs +70 -0
  465. package/dist/internal/use-option-registry.mjs.map +1 -0
  466. package/dist/internal/use-register-count.mjs +27 -0
  467. package/dist/internal/use-register-count.mjs.map +1 -0
  468. package/dist/internal/use-render.d.mts +2 -0
  469. package/dist/internal/use-render.mjs +12 -35
  470. package/dist/internal/use-render.mjs.map +1 -1
  471. package/dist/internal/use-roving-focus.mjs +288 -0
  472. package/dist/internal/use-roving-focus.mjs.map +1 -0
  473. package/dist/internal/use-value-set.mjs +20 -0
  474. package/dist/internal/use-value-set.mjs.map +1 -0
  475. package/dist/internal/value-set.mjs +41 -0
  476. package/dist/internal/value-set.mjs.map +1 -0
  477. package/dist/menu/index.d.mts +8 -2
  478. package/dist/menu/index.d.mts.map +1 -1
  479. package/dist/menu/index.mjs +7 -1
  480. package/dist/menu/index.mjs.map +1 -1
  481. package/dist/menu/menu-checkbox-item.d.mts +27 -3
  482. package/dist/menu/menu-checkbox-item.d.mts.map +1 -1
  483. package/dist/menu/menu-checkbox-item.mjs +6 -3
  484. package/dist/menu/menu-checkbox-item.mjs.map +1 -1
  485. package/dist/menu/menu-context-trigger.d.mts +63 -0
  486. package/dist/menu/menu-context-trigger.d.mts.map +1 -0
  487. package/dist/menu/menu-context-trigger.mjs +231 -0
  488. package/dist/menu/menu-context-trigger.mjs.map +1 -0
  489. package/dist/menu/menu-context.d.mts +1 -1
  490. package/dist/menu/menu-context.mjs +44 -1
  491. package/dist/menu/menu-context.mjs.map +1 -1
  492. package/dist/menu/menu-dom.mjs +35 -4
  493. package/dist/menu/menu-dom.mjs.map +1 -1
  494. package/dist/menu/menu-gestures.mjs +166 -0
  495. package/dist/menu/menu-gestures.mjs.map +1 -0
  496. package/dist/menu/menu-group.d.mts +36 -1
  497. package/dist/menu/menu-group.d.mts.map +1 -1
  498. package/dist/menu/menu-group.mjs +15 -5
  499. package/dist/menu/menu-group.mjs.map +1 -1
  500. package/dist/menu/menu-hover.mjs +0 -1
  501. package/dist/menu/menu-hover.mjs.map +1 -1
  502. package/dist/menu/menu-item.d.mts +42 -5
  503. package/dist/menu/menu-item.d.mts.map +1 -1
  504. package/dist/menu/menu-item.mjs +18 -9
  505. package/dist/menu/menu-item.mjs.map +1 -1
  506. package/dist/menu/menu-outside.mjs +101 -0
  507. package/dist/menu/menu-outside.mjs.map +1 -0
  508. package/dist/menu/menu-point.mjs +85 -0
  509. package/dist/menu/menu-point.mjs.map +1 -0
  510. package/dist/menu/menu-popup.d.mts +68 -11
  511. package/dist/menu/menu-popup.d.mts.map +1 -1
  512. package/dist/menu/menu-popup.mjs +106 -116
  513. package/dist/menu/menu-popup.mjs.map +1 -1
  514. package/dist/menu/menu-radio-group.d.mts +20 -1
  515. package/dist/menu/menu-radio-group.d.mts.map +1 -1
  516. package/dist/menu/menu-radio-group.mjs +14 -7
  517. package/dist/menu/menu-radio-group.mjs.map +1 -1
  518. package/dist/menu/menu-radio-item.d.mts +18 -0
  519. package/dist/menu/menu-radio-item.d.mts.map +1 -1
  520. package/dist/menu/menu-radio-item.mjs +5 -1
  521. package/dist/menu/menu-radio-item.mjs.map +1 -1
  522. package/dist/menu/menu-root.d.mts +61 -12
  523. package/dist/menu/menu-root.d.mts.map +1 -1
  524. package/dist/menu/menu-root.mjs +72 -17
  525. package/dist/menu/menu-root.mjs.map +1 -1
  526. package/dist/menu/menu-submenu-trigger.d.mts +24 -9
  527. package/dist/menu/menu-submenu-trigger.d.mts.map +1 -1
  528. package/dist/menu/menu-submenu-trigger.mjs +48 -26
  529. package/dist/menu/menu-submenu-trigger.mjs.map +1 -1
  530. package/dist/menu/menu-trigger.d.mts +37 -16
  531. package/dist/menu/menu-trigger.d.mts.map +1 -1
  532. package/dist/menu/menu-trigger.mjs +39 -23
  533. package/dist/menu/menu-trigger.mjs.map +1 -1
  534. package/dist/menu/use-menu-item.mjs +14 -16
  535. package/dist/menu/use-menu-item.mjs.map +1 -1
  536. package/dist/menu/use-menu-keyboard.mjs +68 -0
  537. package/dist/menu/use-menu-keyboard.mjs.map +1 -0
  538. package/dist/meter/index.d.mts +26 -0
  539. package/dist/meter/index.d.mts.map +1 -0
  540. package/dist/meter/index.mjs +25 -0
  541. package/dist/meter/index.mjs.map +1 -0
  542. package/dist/meter/meter-context.mjs +13 -0
  543. package/dist/meter/meter-context.mjs.map +1 -0
  544. package/dist/meter/meter-indicator.d.mts +30 -0
  545. package/dist/meter/meter-indicator.d.mts.map +1 -0
  546. package/dist/meter/meter-indicator.mjs +27 -0
  547. package/dist/meter/meter-indicator.mjs.map +1 -0
  548. package/dist/meter/meter-label.d.mts +30 -0
  549. package/dist/meter/meter-label.d.mts.map +1 -0
  550. package/dist/meter/meter-label.mjs +30 -0
  551. package/dist/meter/meter-label.mjs.map +1 -0
  552. package/dist/meter/meter-region.d.mts +9 -0
  553. package/dist/meter/meter-region.d.mts.map +1 -0
  554. package/dist/meter/meter-region.mjs +39 -0
  555. package/dist/meter/meter-region.mjs.map +1 -0
  556. package/dist/meter/meter-root.d.mts +113 -0
  557. package/dist/meter/meter-root.d.mts.map +1 -0
  558. package/dist/meter/meter-root.mjs +85 -0
  559. package/dist/meter/meter-root.mjs.map +1 -0
  560. package/dist/meter/meter-track.d.mts +30 -0
  561. package/dist/meter/meter-track.d.mts.map +1 -0
  562. package/dist/meter/meter-track.mjs +27 -0
  563. package/dist/meter/meter-track.mjs.map +1 -0
  564. package/dist/meter/meter-value.d.mts +34 -0
  565. package/dist/meter/meter-value.d.mts.map +1 -0
  566. package/dist/meter/meter-value.mjs +31 -0
  567. package/dist/meter/meter-value.mjs.map +1 -0
  568. package/dist/multi-select/index.d.mts +37 -0
  569. package/dist/multi-select/index.d.mts.map +1 -0
  570. package/dist/multi-select/index.mjs +37 -0
  571. package/dist/multi-select/index.mjs.map +1 -0
  572. package/dist/multi-select/multi-select-context.mjs +19 -0
  573. package/dist/multi-select/multi-select-context.mjs.map +1 -0
  574. package/dist/multi-select/multi-select-group.d.mts +120 -0
  575. package/dist/multi-select/multi-select-group.d.mts.map +1 -0
  576. package/dist/multi-select/multi-select-group.mjs +111 -0
  577. package/dist/multi-select/multi-select-group.mjs.map +1 -0
  578. package/dist/multi-select/multi-select-keyboard.mjs +145 -0
  579. package/dist/multi-select/multi-select-keyboard.mjs.map +1 -0
  580. package/dist/multi-select/multi-select-label.d.mts +42 -0
  581. package/dist/multi-select/multi-select-label.d.mts.map +1 -0
  582. package/dist/multi-select/multi-select-label.mjs +41 -0
  583. package/dist/multi-select/multi-select-label.mjs.map +1 -0
  584. package/dist/multi-select/multi-select-list.d.mts +47 -0
  585. package/dist/multi-select/multi-select-list.d.mts.map +1 -0
  586. package/dist/multi-select/multi-select-list.mjs +65 -0
  587. package/dist/multi-select/multi-select-list.mjs.map +1 -0
  588. package/dist/multi-select/multi-select-option.d.mts +68 -0
  589. package/dist/multi-select/multi-select-option.d.mts.map +1 -0
  590. package/dist/multi-select/multi-select-option.mjs +93 -0
  591. package/dist/multi-select/multi-select-option.mjs.map +1 -0
  592. package/dist/multi-select/multi-select-popup.d.mts +58 -0
  593. package/dist/multi-select/multi-select-popup.d.mts.map +1 -0
  594. package/dist/multi-select/multi-select-popup.mjs +71 -0
  595. package/dist/multi-select/multi-select-popup.mjs.map +1 -0
  596. package/dist/multi-select/multi-select-root.d.mts +125 -0
  597. package/dist/multi-select/multi-select-root.d.mts.map +1 -0
  598. package/dist/multi-select/multi-select-root.mjs +257 -0
  599. package/dist/multi-select/multi-select-root.mjs.map +1 -0
  600. package/dist/multi-select/multi-select-trigger.d.mts +66 -0
  601. package/dist/multi-select/multi-select-trigger.d.mts.map +1 -0
  602. package/dist/multi-select/multi-select-trigger.mjs +169 -0
  603. package/dist/multi-select/multi-select-trigger.mjs.map +1 -0
  604. package/dist/multi-select/multi-select-value.d.mts +57 -0
  605. package/dist/multi-select/multi-select-value.d.mts.map +1 -0
  606. package/dist/multi-select/multi-select-value.mjs +41 -0
  607. package/dist/multi-select/multi-select-value.mjs.map +1 -0
  608. package/dist/number-field/index.d.mts +29 -0
  609. package/dist/number-field/index.d.mts.map +1 -0
  610. package/dist/number-field/index.mjs +28 -0
  611. package/dist/number-field/index.mjs.map +1 -0
  612. package/dist/number-field/number-field-arithmetic.mjs +97 -0
  613. package/dist/number-field/number-field-arithmetic.mjs.map +1 -0
  614. package/dist/number-field/number-field-context.d.mts +7 -0
  615. package/dist/number-field/number-field-context.d.mts.map +1 -0
  616. package/dist/number-field/number-field-context.mjs +13 -0
  617. package/dist/number-field/number-field-context.mjs.map +1 -0
  618. package/dist/number-field/number-field-decrement.d.mts +19 -0
  619. package/dist/number-field/number-field-decrement.d.mts.map +1 -0
  620. package/dist/number-field/number-field-decrement.mjs +22 -0
  621. package/dist/number-field/number-field-decrement.mjs.map +1 -0
  622. package/dist/number-field/number-field-format.mjs +279 -0
  623. package/dist/number-field/number-field-format.mjs.map +1 -0
  624. package/dist/number-field/number-field-increment.d.mts +19 -0
  625. package/dist/number-field/number-field-increment.d.mts.map +1 -0
  626. package/dist/number-field/number-field-increment.mjs +22 -0
  627. package/dist/number-field/number-field-increment.mjs.map +1 -0
  628. package/dist/number-field/number-field-input.d.mts +38 -0
  629. package/dist/number-field/number-field-input.d.mts.map +1 -0
  630. package/dist/number-field/number-field-input.mjs +161 -0
  631. package/dist/number-field/number-field-input.mjs.map +1 -0
  632. package/dist/number-field/number-field-label.d.mts +33 -0
  633. package/dist/number-field/number-field-label.d.mts.map +1 -0
  634. package/dist/number-field/number-field-label.mjs +43 -0
  635. package/dist/number-field/number-field-label.mjs.map +1 -0
  636. package/dist/number-field/number-field-root.d.mts +157 -0
  637. package/dist/number-field/number-field-root.d.mts.map +1 -0
  638. package/dist/number-field/number-field-root.mjs +445 -0
  639. package/dist/number-field/number-field-root.mjs.map +1 -0
  640. package/dist/number-field/use-number-field-dev-warnings.mjs +28 -0
  641. package/dist/number-field/use-number-field-dev-warnings.mjs.map +1 -0
  642. package/dist/number-field/use-step-button.d.mts +44 -0
  643. package/dist/number-field/use-step-button.d.mts.map +1 -0
  644. package/dist/number-field/use-step-button.mjs +175 -0
  645. package/dist/number-field/use-step-button.mjs.map +1 -0
  646. package/dist/popover/index.d.mts +6 -4
  647. package/dist/popover/index.d.mts.map +1 -1
  648. package/dist/popover/index.mjs +6 -4
  649. package/dist/popover/index.mjs.map +1 -1
  650. package/dist/popover/popover-close.d.mts +48 -8
  651. package/dist/popover/popover-close.d.mts.map +1 -1
  652. package/dist/popover/popover-close.mjs +41 -67
  653. package/dist/popover/popover-close.mjs.map +1 -1
  654. package/dist/popover/popover-context.mjs.map +1 -1
  655. package/dist/popover/popover-description.d.mts +12 -0
  656. package/dist/popover/popover-description.d.mts.map +1 -1
  657. package/dist/popover/popover-description.mjs +2 -0
  658. package/dist/popover/popover-description.mjs.map +1 -1
  659. package/dist/popover/popover-popup.d.mts +64 -18
  660. package/dist/popover/popover-popup.d.mts.map +1 -1
  661. package/dist/popover/popover-popup.mjs +31 -36
  662. package/dist/popover/popover-popup.mjs.map +1 -1
  663. package/dist/popover/popover-root.d.mts +40 -18
  664. package/dist/popover/popover-root.d.mts.map +1 -1
  665. package/dist/popover/popover-root.mjs +15 -10
  666. package/dist/popover/popover-root.mjs.map +1 -1
  667. package/dist/popover/popover-title.d.mts +11 -0
  668. package/dist/popover/popover-title.d.mts.map +1 -1
  669. package/dist/popover/popover-title.mjs +2 -0
  670. package/dist/popover/popover-title.mjs.map +1 -1
  671. package/dist/popover/popover-trigger.d.mts +38 -18
  672. package/dist/popover/popover-trigger.d.mts.map +1 -1
  673. package/dist/popover/popover-trigger.mjs +14 -9
  674. package/dist/popover/popover-trigger.mjs.map +1 -1
  675. package/dist/progress/index.d.mts +26 -0
  676. package/dist/progress/index.d.mts.map +1 -0
  677. package/dist/progress/index.mjs +26 -0
  678. package/dist/progress/index.mjs.map +1 -0
  679. package/dist/progress/progress-context.mjs +13 -0
  680. package/dist/progress/progress-context.mjs.map +1 -0
  681. package/dist/progress/progress-indicator.d.mts +30 -0
  682. package/dist/progress/progress-indicator.d.mts.map +1 -0
  683. package/dist/progress/progress-indicator.mjs +31 -0
  684. package/dist/progress/progress-indicator.mjs.map +1 -0
  685. package/dist/progress/progress-label.d.mts +30 -0
  686. package/dist/progress/progress-label.d.mts.map +1 -0
  687. package/dist/progress/progress-label.mjs +32 -0
  688. package/dist/progress/progress-label.mjs.map +1 -0
  689. package/dist/progress/progress-root.d.mts +96 -0
  690. package/dist/progress/progress-root.d.mts.map +1 -0
  691. package/dist/progress/progress-root.mjs +82 -0
  692. package/dist/progress/progress-root.mjs.map +1 -0
  693. package/dist/progress/progress-track.d.mts +30 -0
  694. package/dist/progress/progress-track.d.mts.map +1 -0
  695. package/dist/progress/progress-track.mjs +31 -0
  696. package/dist/progress/progress-track.mjs.map +1 -0
  697. package/dist/progress/progress-value.d.mts +34 -0
  698. package/dist/progress/progress-value.d.mts.map +1 -0
  699. package/dist/progress/progress-value.mjs +35 -0
  700. package/dist/progress/progress-value.mjs.map +1 -0
  701. package/dist/radio-group/index.d.mts +2 -0
  702. package/dist/radio-group/index.d.mts.map +1 -1
  703. package/dist/radio-group/index.mjs +2 -0
  704. package/dist/radio-group/index.mjs.map +1 -1
  705. package/dist/radio-group/radio-group-context.mjs.map +1 -1
  706. package/dist/radio-group/radio-group-item.d.mts +21 -5
  707. package/dist/radio-group/radio-group-item.d.mts.map +1 -1
  708. package/dist/radio-group/radio-group-item.mjs +22 -25
  709. package/dist/radio-group/radio-group-item.mjs.map +1 -1
  710. package/dist/radio-group/radio-group-label.d.mts +10 -0
  711. package/dist/radio-group/radio-group-label.d.mts.map +1 -1
  712. package/dist/radio-group/radio-group-label.mjs +3 -6
  713. package/dist/radio-group/radio-group-label.mjs.map +1 -1
  714. package/dist/radio-group/radio-group-root.d.mts +34 -8
  715. package/dist/radio-group/radio-group-root.d.mts.map +1 -1
  716. package/dist/radio-group/radio-group-root.mjs +48 -39
  717. package/dist/radio-group/radio-group-root.mjs.map +1 -1
  718. package/dist/select/index.d.mts +2 -0
  719. package/dist/select/index.d.mts.map +1 -1
  720. package/dist/select/index.mjs +2 -0
  721. package/dist/select/index.mjs.map +1 -1
  722. package/dist/select/select-dom.mjs +9 -18
  723. package/dist/select/select-dom.mjs.map +1 -1
  724. package/dist/select/select-group-label.d.mts +10 -0
  725. package/dist/select/select-group-label.d.mts.map +1 -1
  726. package/dist/select/select-group-label.mjs +5 -1
  727. package/dist/select/select-group-label.mjs.map +1 -1
  728. package/dist/select/select-group.d.mts +15 -1
  729. package/dist/select/select-group.d.mts.map +1 -1
  730. package/dist/select/select-group.mjs +8 -4
  731. package/dist/select/select-group.mjs.map +1 -1
  732. package/dist/select/select-option.d.mts +19 -1
  733. package/dist/select/select-option.d.mts.map +1 -1
  734. package/dist/select/select-option.mjs +4 -2
  735. package/dist/select/select-option.mjs.map +1 -1
  736. package/dist/select/select-root.d.mts +28 -3
  737. package/dist/select/select-root.d.mts.map +1 -1
  738. package/dist/select/select-root.mjs +39 -12
  739. package/dist/select/select-root.mjs.map +1 -1
  740. package/dist/select/select-separator.d.mts +9 -0
  741. package/dist/select/select-separator.d.mts.map +1 -1
  742. package/dist/select/select-separator.mjs +2 -0
  743. package/dist/select/select-separator.mjs.map +1 -1
  744. package/dist/select/select-trigger.d.mts +9 -0
  745. package/dist/select/select-trigger.d.mts.map +1 -1
  746. package/dist/select/select-trigger.mjs +5 -1
  747. package/dist/select/select-trigger.mjs.map +1 -1
  748. package/dist/select/select-value.d.mts +9 -0
  749. package/dist/select/select-value.d.mts.map +1 -1
  750. package/dist/select/select-value.mjs +5 -6
  751. package/dist/select/select-value.mjs.map +1 -1
  752. package/dist/separator/index.d.mts +3 -0
  753. package/dist/separator/index.mjs +1 -0
  754. package/dist/separator/separator.d.mts +58 -0
  755. package/dist/separator/separator.d.mts.map +1 -0
  756. package/dist/separator/separator.mjs +41 -0
  757. package/dist/separator/separator.mjs.map +1 -0
  758. package/dist/slider/index.d.mts +34 -0
  759. package/dist/slider/index.d.mts.map +1 -0
  760. package/dist/slider/index.mjs +29 -0
  761. package/dist/slider/index.mjs.map +1 -0
  762. package/dist/slider/slider-arithmetic.mjs +165 -0
  763. package/dist/slider/slider-arithmetic.mjs.map +1 -0
  764. package/dist/slider/slider-context.mjs +13 -0
  765. package/dist/slider/slider-context.mjs.map +1 -0
  766. package/dist/slider/slider-indicator.d.mts +34 -0
  767. package/dist/slider/slider-indicator.d.mts.map +1 -0
  768. package/dist/slider/slider-indicator.mjs +38 -0
  769. package/dist/slider/slider-indicator.mjs.map +1 -0
  770. package/dist/slider/slider-label.d.mts +33 -0
  771. package/dist/slider/slider-label.d.mts.map +1 -0
  772. package/dist/slider/slider-label.mjs +40 -0
  773. package/dist/slider/slider-label.mjs.map +1 -0
  774. package/dist/slider/slider-root.d.mts +155 -0
  775. package/dist/slider/slider-root.d.mts.map +1 -0
  776. package/dist/slider/slider-root.mjs +434 -0
  777. package/dist/slider/slider-root.mjs.map +1 -0
  778. package/dist/slider/slider-thumb.d.mts +87 -0
  779. package/dist/slider/slider-thumb.d.mts.map +1 -0
  780. package/dist/slider/slider-thumb.mjs +150 -0
  781. package/dist/slider/slider-thumb.mjs.map +1 -0
  782. package/dist/slider/slider-track.d.mts +46 -0
  783. package/dist/slider/slider-track.d.mts.map +1 -0
  784. package/dist/slider/slider-track.mjs +57 -0
  785. package/dist/slider/slider-track.mjs.map +1 -0
  786. package/dist/slider/slider-value.d.mts +45 -0
  787. package/dist/slider/slider-value.d.mts.map +1 -0
  788. package/dist/slider/slider-value.mjs +41 -0
  789. package/dist/slider/slider-value.mjs.map +1 -0
  790. package/dist/slider/use-slider-dev-warnings.mjs +29 -0
  791. package/dist/slider/use-slider-dev-warnings.mjs.map +1 -0
  792. package/dist/slider/use-thumb-registry.mjs +51 -0
  793. package/dist/slider/use-thumb-registry.mjs.map +1 -0
  794. package/dist/switch/switch.d.mts +30 -9
  795. package/dist/switch/switch.d.mts.map +1 -1
  796. package/dist/switch/switch.mjs +24 -46
  797. package/dist/switch/switch.mjs.map +1 -1
  798. package/dist/tabs/index.d.mts +2 -0
  799. package/dist/tabs/index.d.mts.map +1 -1
  800. package/dist/tabs/index.mjs +2 -0
  801. package/dist/tabs/index.mjs.map +1 -1
  802. package/dist/tabs/tabs-context.d.mts +7 -3
  803. package/dist/tabs/tabs-context.d.mts.map +1 -1
  804. package/dist/tabs/tabs-context.mjs.map +1 -1
  805. package/dist/tabs/tabs-indicator.d.mts +17 -0
  806. package/dist/tabs/tabs-indicator.d.mts.map +1 -1
  807. package/dist/tabs/tabs-indicator.mjs +4 -1
  808. package/dist/tabs/tabs-indicator.mjs.map +1 -1
  809. package/dist/tabs/tabs-list.d.mts +19 -1
  810. package/dist/tabs/tabs-list.d.mts.map +1 -1
  811. package/dist/tabs/tabs-list.mjs +12 -23
  812. package/dist/tabs/tabs-list.mjs.map +1 -1
  813. package/dist/tabs/tabs-panel.d.mts +22 -4
  814. package/dist/tabs/tabs-panel.d.mts.map +1 -1
  815. package/dist/tabs/tabs-panel.mjs +4 -2
  816. package/dist/tabs/tabs-panel.mjs.map +1 -1
  817. package/dist/tabs/tabs-root.d.mts +43 -8
  818. package/dist/tabs/tabs-root.d.mts.map +1 -1
  819. package/dist/tabs/tabs-root.mjs +23 -10
  820. package/dist/tabs/tabs-root.mjs.map +1 -1
  821. package/dist/tabs/tabs-tab.d.mts +25 -5
  822. package/dist/tabs/tabs-tab.d.mts.map +1 -1
  823. package/dist/tabs/tabs-tab.mjs +5 -2
  824. package/dist/tabs/tabs-tab.mjs.map +1 -1
  825. package/dist/{internal → tabs}/use-until-found.mjs +1 -1
  826. package/dist/tabs/use-until-found.mjs.map +1 -0
  827. package/dist/toast/index.d.mts +27 -0
  828. package/dist/toast/index.d.mts.map +1 -0
  829. package/dist/toast/index.mjs +28 -0
  830. package/dist/toast/index.mjs.map +1 -0
  831. package/dist/toast/toast-action.d.mts +86 -0
  832. package/dist/toast/toast-action.d.mts.map +1 -0
  833. package/dist/toast/toast-action.mjs +81 -0
  834. package/dist/toast/toast-action.mjs.map +1 -0
  835. package/dist/toast/toast-close.d.mts +52 -0
  836. package/dist/toast/toast-close.d.mts.map +1 -0
  837. package/dist/toast/toast-close.mjs +53 -0
  838. package/dist/toast/toast-close.mjs.map +1 -0
  839. package/dist/toast/toast-context.mjs +19 -0
  840. package/dist/toast/toast-context.mjs.map +1 -0
  841. package/dist/toast/toast-description.d.mts +39 -0
  842. package/dist/toast/toast-description.d.mts.map +1 -0
  843. package/dist/toast/toast-description.mjs +37 -0
  844. package/dist/toast/toast-description.mjs.map +1 -0
  845. package/dist/toast/toast-hotkey.mjs +27 -0
  846. package/dist/toast/toast-hotkey.mjs.map +1 -0
  847. package/dist/toast/toast-queue.mjs +137 -0
  848. package/dist/toast/toast-queue.mjs.map +1 -0
  849. package/dist/toast/toast-root.d.mts +63 -0
  850. package/dist/toast/toast-root.d.mts.map +1 -0
  851. package/dist/toast/toast-root.mjs +209 -0
  852. package/dist/toast/toast-root.mjs.map +1 -0
  853. package/dist/toast/toast-timers.mjs +65 -0
  854. package/dist/toast/toast-timers.mjs.map +1 -0
  855. package/dist/toast/toast-title.d.mts +38 -0
  856. package/dist/toast/toast-title.d.mts.map +1 -0
  857. package/dist/toast/toast-title.mjs +35 -0
  858. package/dist/toast/toast-title.mjs.map +1 -0
  859. package/dist/toast/toast-viewport.d.mts +81 -0
  860. package/dist/toast/toast-viewport.d.mts.map +1 -0
  861. package/dist/toast/toast-viewport.mjs +345 -0
  862. package/dist/toast/toast-viewport.mjs.map +1 -0
  863. package/dist/toast/toast.d.mts +162 -0
  864. package/dist/toast/toast.d.mts.map +1 -0
  865. package/dist/toast/toast.mjs +161 -0
  866. package/dist/toast/toast.mjs.map +1 -0
  867. package/dist/toast/use-modal-portal-host.mjs +52 -0
  868. package/dist/toast/use-modal-portal-host.mjs.map +1 -0
  869. package/dist/toast/use-toast-announcements.mjs +46 -0
  870. package/dist/toast/use-toast-announcements.mjs.map +1 -0
  871. package/dist/toast/use-toast-focus.mjs +75 -0
  872. package/dist/toast/use-toast-focus.mjs.map +1 -0
  873. package/dist/toast/use-toast-pauses.mjs +58 -0
  874. package/dist/toast/use-toast-pauses.mjs.map +1 -0
  875. package/dist/toggle/toggle.d.mts +26 -6
  876. package/dist/toggle/toggle.d.mts.map +1 -1
  877. package/dist/toggle/toggle.mjs +12 -6
  878. package/dist/toggle/toggle.mjs.map +1 -1
  879. package/dist/toggle-group/index.d.mts +18 -0
  880. package/dist/toggle-group/index.d.mts.map +1 -0
  881. package/dist/toggle-group/index.mjs +17 -0
  882. package/dist/toggle-group/index.mjs.map +1 -0
  883. package/dist/toggle-group/toggle-group-context.d.mts +6 -0
  884. package/dist/toggle-group/toggle-group-context.d.mts.map +1 -0
  885. package/dist/toggle-group/toggle-group-context.mjs +13 -0
  886. package/dist/toggle-group/toggle-group-context.mjs.map +1 -0
  887. package/dist/toggle-group/toggle-group-item.d.mts +71 -0
  888. package/dist/toggle-group/toggle-group-item.d.mts.map +1 -0
  889. package/dist/toggle-group/toggle-group-item.mjs +69 -0
  890. package/dist/toggle-group/toggle-group-item.mjs.map +1 -0
  891. package/dist/toggle-group/toggle-group-root.d.mts +156 -0
  892. package/dist/toggle-group/toggle-group-root.d.mts.map +1 -0
  893. package/dist/toggle-group/toggle-group-root.mjs +177 -0
  894. package/dist/toggle-group/toggle-group-root.mjs.map +1 -0
  895. package/dist/toolbar/index.d.mts +19 -0
  896. package/dist/toolbar/index.d.mts.map +1 -0
  897. package/dist/toolbar/index.mjs +19 -0
  898. package/dist/toolbar/index.mjs.map +1 -0
  899. package/dist/toolbar/toolbar-root.d.mts +65 -0
  900. package/dist/toolbar/toolbar-root.d.mts.map +1 -0
  901. package/dist/toolbar/toolbar-root.mjs +67 -0
  902. package/dist/toolbar/toolbar-root.mjs.map +1 -0
  903. package/dist/toolbar/toolbar-separator.d.mts +38 -0
  904. package/dist/toolbar/toolbar-separator.d.mts.map +1 -0
  905. package/dist/toolbar/toolbar-separator.mjs +33 -0
  906. package/dist/toolbar/toolbar-separator.mjs.map +1 -0
  907. package/dist/tooltip/index.d.mts +10 -5
  908. package/dist/tooltip/index.d.mts.map +1 -1
  909. package/dist/tooltip/index.mjs +8 -3
  910. package/dist/tooltip/index.mjs.map +1 -1
  911. package/dist/tooltip/tooltip-arrow.d.mts +46 -0
  912. package/dist/tooltip/tooltip-arrow.d.mts.map +1 -0
  913. package/dist/tooltip/tooltip-arrow.mjs +47 -0
  914. package/dist/tooltip/tooltip-arrow.mjs.map +1 -0
  915. package/dist/tooltip/tooltip-context.d.mts +11 -0
  916. package/dist/tooltip/tooltip-context.d.mts.map +1 -1
  917. package/dist/tooltip/tooltip-context.mjs +2 -1
  918. package/dist/tooltip/tooltip-context.mjs.map +1 -1
  919. package/dist/tooltip/tooltip-popup.d.mts +49 -7
  920. package/dist/tooltip/tooltip-popup.d.mts.map +1 -1
  921. package/dist/tooltip/tooltip-popup.mjs +37 -15
  922. package/dist/tooltip/tooltip-popup.mjs.map +1 -1
  923. package/dist/tooltip/tooltip-root.d.mts +24 -2
  924. package/dist/tooltip/tooltip-root.d.mts.map +1 -1
  925. package/dist/tooltip/tooltip-root.mjs +29 -6
  926. package/dist/tooltip/tooltip-root.mjs.map +1 -1
  927. package/dist/tooltip/tooltip-trigger.d.mts +28 -3
  928. package/dist/tooltip/tooltip-trigger.d.mts.map +1 -1
  929. package/dist/tooltip/tooltip-trigger.mjs +26 -6
  930. package/dist/tooltip/tooltip-trigger.mjs.map +1 -1
  931. package/dist/tooltip/tooltip-warm.mjs +29 -0
  932. package/dist/tooltip/tooltip-warm.mjs.map +1 -0
  933. package/dist/tooltip/use-tooltip-interaction.mjs +128 -77
  934. package/dist/tooltip/use-tooltip-interaction.mjs.map +1 -1
  935. package/package.json +27 -2
  936. package/skills/funstack-ui-knowledge/SKILL.md +80 -0
  937. package/dist/accordion/accordion-context.d.mts +0 -5
  938. package/dist/accordion/accordion-context.d.mts.map +0 -1
  939. package/dist/internal/action-details.mjs.map +0 -1
  940. package/dist/internal/anchor-position.d.mts +0 -7
  941. package/dist/internal/anchor-position.d.mts.map +0 -1
  942. package/dist/internal/anchor-position.mjs +0 -16
  943. package/dist/internal/anchor-position.mjs.map +0 -1
  944. package/dist/internal/sync-presence.mjs.map +0 -1
  945. package/dist/internal/use-action-trigger.mjs +0 -58
  946. package/dist/internal/use-action-trigger.mjs.map +0 -1
  947. package/dist/internal/use-controllable-action.mjs +0 -119
  948. package/dist/internal/use-controllable-action.mjs.map +0 -1
  949. package/dist/internal/use-exit-animation.mjs.map +0 -1
  950. package/dist/internal/use-form-reset.mjs +0 -54
  951. package/dist/internal/use-form-reset.mjs.map +0 -1
  952. package/dist/internal/use-native-checked.mjs.map +0 -1
  953. package/dist/internal/use-native-group-reconciliation.mjs.map +0 -1
  954. package/dist/internal/use-native-select-value.mjs.map +0 -1
  955. package/dist/internal/use-popover-popup.mjs +0 -274
  956. package/dist/internal/use-popover-popup.mjs.map +0 -1
  957. package/dist/internal/use-popover-root.d.mts +0 -2
  958. package/dist/internal/use-popover-root.mjs +0 -112
  959. package/dist/internal/use-popover-root.mjs.map +0 -1
  960. package/dist/internal/use-popover-trigger.mjs +0 -86
  961. package/dist/internal/use-popover-trigger.mjs.map +0 -1
  962. package/dist/internal/use-until-found.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.mjs","names":[],"sources":["../../src/checkbox/checkbox.tsx"],"sourcesContent":["\"use client\";\nimport type { ChangeEvent, ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { createActionDetails } from \"../internal/action-details.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { transitionTypes } from \"../internal/transition-types.js\";\nimport type {\n ActionDetails,\n ChangeAction,\n ChangeReason,\n RenderProp,\n StateValue,\n} from \"../internal/types.js\";\nimport { useControllableAction } from \"../internal/use-controllable-action.js\";\nimport { guardCheckableChange, useNativeChecked } from \"../internal/use-native-checked.js\";\nimport { useRender } from \"../internal/use-render.js\";\n\nexport interface CheckboxState {\n /** Optimistic checked state: what the user sees, including an in-flight change. */\n readonly checked: boolean;\n /**\n * The `indeterminate` prop, suspended while an action is in flight: `false` whenever `pending`\n * is true, so that the attribute, the DOM property and `:indeterminate` always agree.\n */\n readonly indeterminate: boolean;\n /** An action dispatched by this Checkbox is in flight (including the resulting render). */\n readonly pending: boolean;\n /** The `disabled` prop. */\n readonly disabled: boolean;\n}\n\n/** Details passed as the second argument of `checkedChangeAction`. */\nexport interface CheckboxCheckedChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user toggled the box (click, Space, label click); `event` is the native\n * `click` event. `\"platform\"`: the browser changed the value itself: a form reset (`event` is\n * the `reset` event) or a click before hydration / Firefox form-state restoration found on\n * mount (`event` is `undefined`).\n */\n readonly reason: ChangeReason;\n}\n\nexport interface CheckboxProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"checked\"\n | \"defaultChecked\"\n | \"onChange\"\n | \"aria-checked\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** Controlled checked state. `undefined` means uncontrolled. */\n checked?: boolean;\n /**\n * Initial checked state in uncontrolled mode (default `false`). Also the value a form reset\n * returns to: the latest prop value is mirrored into the input's `defaultChecked`.\n */\n defaultChecked?: boolean;\n /**\n * Controlled-only mixed state (APG tri-state checkbox), derived by the parent from other state;\n * there is no `defaultIndeterminate` and no action. Rendered as `el.indeterminate`,\n * `data-indeterminate` and `:indeterminate`, except while an action is pending. Clicking a\n * mixed box dispatches `checked: true` (for the usual unchecked + mixed representation). Does\n * not affect what the form submits.\n */\n indeterminate?: boolean;\n /**\n * Called with the next checked state on every change. Runs inside the Checkbox's transition;\n * may be sync or async (also a Server Function). Rejections reach the nearest Error Boundary.\n * Also called with `details.reason === \"platform\"` for a form reset or a pre-hydration click.\n *\n * A `setState` placed after your own `await` is not a Transition update; wrap it in\n * `startTransition` (React limitation). `details.event.preventDefault()` is not a veto and is\n * unsupported here; use controlled mode to veto a change.\n */\n checkedChangeAction?: ChangeAction<boolean, CheckboxCheckedChangeDetails>;\n /** Renders a natively disabled input; never dispatches. Default `false`. */\n disabled?: boolean;\n /** Submitted as the input's value when checked. Default `\"on\"` (platform). */\n value?: string;\n /**\n * Forwarded as `default` to the Checkbox's `<ViewTransition>`. Default: no boundary. Animates the\n * commit that ends an action, not the optimistic flip; animate the flip with CSS on `:checked`.\n *\n * Static: without `transition` the part renders no `<ViewTransition>`; changing it between\n * `undefined` and a value remounts the element. Any value, `\"none\"` included, makes a mount or\n * `<Activity>` reveal of this part inside a transition start a document view transition: the\n * page cross-fades for about 250 ms and the next transition commit waits for it (issue #35).\n */\n transition?: ViewTransitionClass;\n className?: StateValue<string | undefined, CheckboxState>;\n style?: StateValue<CSSProperties | undefined, CheckboxState>;\n /**\n * Replace the rendered element (element form) or take over rendering (function form). Must keep\n * an `<input type=\"checkbox\">`.\n */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, CheckboxState>;\n}\n\n/**\n * A checkbox (WAI-ARIA \"Checkbox\" pattern, dual- and mixed-state). Renders\n * `<input type=\"checkbox\">` whose DOM `checked` is the optimistic state; the input carries\n * `data-pending` while `checkedChangeAction` is in flight and takes part in forms natively.\n *\n * Owned keys (a `render` element's value is overridden): `type`, `checked`, `defaultChecked`,\n * `indeterminate` (stripped), `aria-checked` (always removed), `disabled`, `data-checked`,\n * `data-indeterminate`, `data-pending`, `data-disabled`. `role` passes through. Event handlers\n * are merged rather than owned: a `render` element's own `onChange` (or `onClick`) runs first,\n * then the library's; an `onClick` that calls `preventDefault()` cancels the change (nothing is\n * dispatched).\n */\nexport function Checkbox({\n checked,\n defaultChecked,\n indeterminate = false,\n checkedChangeAction,\n disabled = false,\n transition,\n className,\n style,\n render,\n ...rest\n}: CheckboxProps) {\n const { optimistic, pending, dispatch, latestInFlight } = useControllableAction<\n boolean,\n CheckboxCheckedChangeDetails\n >({\n controlled: checked,\n defaultValue: defaultChecked,\n initialValue: false,\n action: checkedChangeAction,\n transitionTypes: (next) => transitionTypes(\"checkbox\", next ? \"check\" : \"uncheck\"),\n warn: { component: \"Checkbox\", prop: \"checked\" },\n });\n\n // Suspended while pending (conventions 4.1): the browser clears the property on the click, and\n // the parent may not have recomputed yet. Restored on settle if the parent still says mixed.\n const shownIndeterminate = indeterminate && !pending;\n\n const inputRef = useNativeChecked({\n type: \"checkbox\",\n component: \"Checkbox\",\n checked: optimistic,\n // Uncontrolled: the latest prop is the reset target. Controlled: React's mount-time value.\n defaultChecked: checked === undefined ? (defaultChecked ?? false) : undefined,\n indeterminate: shownIndeterminate,\n latestInFlight,\n onPlatformChange: (next, event) =>\n dispatch(next, createActionDetails(event, { reason: \"platform\" })),\n });\n\n const state: CheckboxState = {\n checked: optimistic,\n indeterminate: shownIndeterminate,\n pending,\n disabled,\n };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, CheckboxState>({\n defaultElement: \"input\",\n render,\n state,\n className,\n style,\n children: undefined,\n ref: inputRef,\n // Pass-through layer: a `render` element's own props win over these (`role` included).\n props: rest,\n // Library-controlled layer (owned keys, conventions 1.2).\n libraryProps: {\n type: \"checkbox\",\n // The DOM state is the optimistic state (conventions 3.2).\n checked: optimistic,\n defaultChecked: undefined,\n // Not a DOM attribute; the hook sets the property. Owned so a `render` element's own\n // `indeterminate` prop (which react-dom would warn about) is stripped.\n ...({ indeterminate: undefined } as object),\n \"aria-checked\": undefined,\n // Owned so that native disabledness, `data-disabled` and the click guard always agree: a\n // `render` element cannot re-enable (`disabled={false}`) or disable the input on its own.\n disabled,\n \"data-checked\": dataAttr(optimistic),\n \"data-indeterminate\": dataAttr(shownIndeterminate),\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n onChange: (event: ChangeEvent<HTMLInputElement>) => {\n // A natively disabled input fires no click; this covers `render` elements that do not\n // honour `disabled`.\n if (disabled) return;\n const nativeEvent = event.nativeEvent;\n // `indeterminate` plays no part: the platform's rule is \"flip checked, clear mixed\".\n guardCheckableChange(\n nativeEvent,\n () => dispatch(!optimistic, createActionDetails(nativeEvent, { reason: \"activate\" })),\n \"Checkbox\",\n );\n },\n },\n });\n\n return useTransitionBoundary(\"Checkbox\", transition, element);\n}\n\nCheckbox.displayName = \"Checkbox\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiHA,SAAgB,SAAS,EACvB,SACA,gBACA,gBAAgB,OAChB,qBACA,WAAW,OACX,YACA,WACA,OACA,QACA,GAAG,QACa;CAChB,MAAM,EAAE,YAAY,SAAS,UAAU,mBAAmB,sBAGxD;EACA,YAAY;EACZ,cAAc;EACd,cAAc;EACd,QAAQ;EACR,kBAAkB,SAAS,gBAAgB,YAAY,OAAO,UAAU,SAAS;EACjF,MAAM;GAAE,WAAW;GAAY,MAAM;EAAU;CACjD,CAAC;CAID,MAAM,qBAAqB,iBAAiB,CAAC;CAE7C,MAAM,WAAW,iBAAiB;EAChC,MAAM;EACN,WAAW;EACX,SAAS;EAET,gBAAgB,YAAY,KAAA,IAAa,kBAAkB,QAAS,KAAA;EACpE,eAAe;EACf;EACA,mBAAmB,MAAM,UACvB,SAAS,MAAM,oBAAoB,OAAO,EAAE,QAAQ,WAAW,CAAC,CAAC;CACrE,CAAC;CASD,MAAM,UAAU,UAAyD;EACvE,gBAAgB;EAChB;EACA,OAAA;GATA,SAAS;GACT,eAAe;GACf;GACA;EAMI;EACJ;EACA;EACA,UAAU,KAAA;EACV,KAAK;EAEL,OAAO;EAEP,cAAc;GACZ,MAAM;GAEN,SAAS;GACT,gBAAgB,KAAA;GAGV,eAAe,KAAA;GACrB,gBAAgB,KAAA;GAGhB;GACA,gBAAgB,SAAS,UAAU;GACnC,sBAAsB,SAAS,kBAAkB;GACjD,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;GAClC,WAAW,UAAyC;IAGlD,IAAI,UAAU;IACd,MAAM,cAAc,MAAM;IAE1B,qBACE,mBACM,SAAS,CAAC,YAAY,oBAAoB,aAAa,EAAE,QAAQ,WAAW,CAAC,CAAC,GACpF,UACF;GACF;EACF;CACF,CAAC;CAED,OAAO,sBAAsB,YAAY,YAAY,OAAO;AAC9D;AAEA,SAAS,cAAc"}
1
+ {"version":3,"file":"checkbox.mjs","names":[],"sources":["../../src/checkbox/checkbox.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { transitionTypes } from \"../internal/transition-types.js\";\nimport type {\n ActionDetails,\n ChangeAction,\n ChangeReason,\n RenderProp,\n StateValue,\n} from \"../internal/types.js\";\nimport { useCheckableInput } from \"../internal/form/use-checkable-input.js\";\nimport { useRender } from \"../internal/use-render.js\";\n\n/** State of `Checkbox`, passed to the function forms of `className`, `style` and `render`. */\nexport interface CheckboxState {\n /** Optimistic checked state: what the user sees, including an in-flight change. */\n readonly checked: boolean;\n /**\n * The `indeterminate` prop, suspended while an action is in flight: `false` whenever `pending`\n * is true, so that the attribute, the DOM property and `:indeterminate` always agree.\n */\n readonly indeterminate: boolean;\n /** An action dispatched by this Checkbox is in flight (including the resulting render). */\n readonly pending: boolean;\n /** The `disabled` prop (or the enclosing `Field.Root`'s). */\n readonly disabled: boolean;\n}\n\n/** Details passed as the second argument of `checkedChangeAction`. */\nexport interface CheckboxCheckedChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user toggled the box (click, Space, label click); `event` is the native\n * `click` event. `\"platform\"`: the browser changed the value itself: a form reset (`event` is\n * the `reset` event) or a click before hydration / Firefox form-state restoration found on\n * mount (`event` is `undefined`).\n */\n readonly reason: ChangeReason;\n}\n\n/**\n * Props of `Checkbox`.\n *\n * @see https://ui.funstack.work/components/checkbox\n */\nexport interface CheckboxProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"checked\"\n | \"defaultChecked\"\n | \"onChange\"\n | \"aria-checked\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** Controlled checked state. `undefined` means uncontrolled. */\n checked?: boolean;\n /**\n * Initial checked state in uncontrolled mode. Also the value a form reset\n * returns to: the latest prop value is mirrored into the input's `defaultChecked`.\n *\n * @defaultValue `false`\n */\n defaultChecked?: boolean;\n /**\n * Controlled-only mixed state (APG tri-state checkbox), derived by the parent from other state;\n * there is no `defaultIndeterminate` and no action. Rendered as `el.indeterminate`,\n * `data-indeterminate` and `:indeterminate`, except while an action is pending. Clicking a\n * mixed box dispatches `checked: true` (for the usual unchecked + mixed representation). Does\n * not affect what the form submits.\n *\n * @defaultValue `false`\n */\n indeterminate?: boolean;\n /**\n * Called with the next checked state on every change. Runs inside the Checkbox's transition;\n * may be sync or async (also a Server Function). Rejections reach the nearest Error Boundary.\n * Also called with `details.reason === \"platform\"` for a form reset or a pre-hydration click.\n *\n * A `setState` placed after your own `await` is not a Transition update; wrap it in\n * `startTransition` (React limitation). `details.event.preventDefault()` is not a veto and is\n * unsupported here; use controlled mode to veto a change.\n */\n checkedChangeAction?: ChangeAction<boolean, CheckboxCheckedChangeDetails>;\n /**\n * Renders a natively disabled input; never dispatches.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Submitted as the input's value when checked.\n *\n * @defaultValue `\"on\"` (platform)\n */\n value?: string;\n /**\n * Forwarded as `default` to the Checkbox's `<ViewTransition>`. Default: no boundary. Animates the\n * commit that ends an action, not the optimistic flip; animate the flip with CSS on `:checked`.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, CheckboxState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, CheckboxState>;\n /**\n * Replace the rendered element (element form) or take over rendering (function form). Must keep\n * an `<input type=\"checkbox\">`.\n */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, CheckboxState>;\n}\n\n/**\n * A checkbox (WAI-ARIA \"Checkbox\" pattern, dual- and mixed-state). Renders\n * `<input type=\"checkbox\">` whose DOM `checked` is the optimistic state; the input carries\n * `data-pending` while `checkedChangeAction` is in flight and takes part in forms natively.\n *\n * Owned keys (a `render` element's value is overridden): `type`, `checked`, `defaultChecked`,\n * `indeterminate` (stripped), `aria-checked` (always removed), `disabled`, `data-checked`,\n * `data-indeterminate`, `data-pending`, `data-disabled`; inside a `Field.Root` also `id`,\n * `name`, `required`, `aria-invalid`, `aria-describedby` (token-merged) and `data-invalid`, and\n * `disabled` / `name` / `required` default from the Field. `role` passes through. Event handlers\n * are merged rather than owned: a `render` element's own `onChange` (or `onClick`) runs first,\n * then the library's; an `onClick` that calls `preventDefault()` cancels the change (nothing is\n * dispatched).\n *\n * @see https://ui.funstack.work/components/checkbox\n */\nexport function Checkbox({\n checked,\n defaultChecked,\n indeterminate = false,\n checkedChangeAction,\n disabled,\n transition,\n className,\n style,\n render,\n ...rest\n}: CheckboxProps) {\n const input = useCheckableInput({\n component: \"Checkbox\",\n checked,\n defaultChecked,\n checkedChangeAction,\n disabled,\n own: rest,\n transitionTypes: (next) => transitionTypes(\"checkbox\", next ? \"check\" : \"uncheck\"),\n indeterminate,\n });\n\n const state: CheckboxState = {\n checked: input.optimistic,\n indeterminate: input.shownIndeterminate,\n pending: input.pending,\n disabled: input.disabled,\n };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, CheckboxState>({\n defaultElement: \"input\",\n render,\n state,\n className,\n style,\n children: undefined,\n ref: input.ref,\n // Pass-through layer: a `render` element's own props win over these (`role` included).\n props: rest,\n libraryProps: input.libraryProps,\n });\n\n return useTransitionBoundary(\"Checkbox\", transition, element);\n}\n\nCheckbox.displayName = \"Checkbox\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqIA,SAAgB,SAAS,EACvB,SACA,gBACA,gBAAgB,OAChB,qBACA,UACA,YACA,WACA,OACA,QACA,GAAG,QACa;CAChB,MAAM,QAAQ,kBAAkB;EAC9B,WAAW;EACX;EACA;EACA;EACA;EACA,KAAK;EACL,kBAAkB,SAAS,gBAAgB,YAAY,OAAO,UAAU,SAAS;EACjF;CACF,CAAC;CAED,MAAM,QAAuB;EAC3B,SAAS,MAAM;EACf,eAAe,MAAM;EACrB,SAAS,MAAM;EACf,UAAU,MAAM;CAClB;CAEA,MAAM,UAAU,UAAyD;EACvE,gBAAgB;EAChB;EACA;EACA;EACA;EACA,UAAU,KAAA;EACV,KAAK,MAAM;EAEX,OAAO;EACP,cAAc,MAAM;CACtB,CAAC;CAED,OAAO,sBAAsB,YAAY,YAAY,OAAO;AAC9D;AAEA,SAAS,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group-context.mjs","names":[],"sources":["../../src/checkbox-group/checkbox-group-context.ts"],"sourcesContent":["\"use client\";\nimport { createContext, use } from \"react\";\n\n/** A change to the group's set of checked values (design/components/checkbox-group.md 5.2). */\nexport interface CheckboxGroupPatch {\n readonly added: readonly string[];\n readonly removed: readonly string[];\n}\n\nexport interface CheckboxGroupContextValue {\n /** The `name` shared by every Item of the group (prop or `useId()`). */\n readonly name: string;\n readonly form: string | undefined;\n /**\n * The Root's `required` while no value of an enabled Item is checked (design section 7):\n * rendered as native `required` on every Item. Before the Items have registered (server render,\n * hydration render) it is `required && optimistic.size === 0`, which is what the server can\n * compute.\n */\n readonly required: boolean;\n /** Optimistic checked values: Items and Parents render from it. */\n readonly optimistic: ReadonlySet<string>;\n /** Committed checked values. For per-part pending and the Parent's restore memory only. */\n readonly committed: ReadonlySet<string>;\n readonly pending: boolean;\n /** `Root disabled` (reaches the boxes natively through `<fieldset disabled>`). */\n readonly disabled: boolean;\n /**\n * Uncontrolled mode: the latest `defaultValue` as a set, mirrored by each Item into\n * `el.defaultChecked` (and by each Parent, derived) so that a form reset returns to it.\n * `undefined` in controlled mode, where React's mount-time value stays the reset target\n * (conventions 3.8 rule 6).\n */\n readonly defaultValue: ReadonlySet<string> | undefined;\n /**\n * Item click. No-op when `optimistic.has(value) === checked`. Checks neither `disabled` nor\n * `defaultPrevented` (the Item's `guardCheckableChange` does).\n */\n readonly toggle: (value: string, checked: boolean, event: Event) => void;\n /** Parent click: a whole patch. No-op when it changes nothing against the optimistic set. */\n readonly apply: (patch: CheckboxGroupPatch, event: Event) => void;\n /**\n * Values whose every mounted Item has its own `disabled` prop (`Root disabled` is not counted).\n * A Parent leaves them alone (design 6.2). Empty until the Items registered.\n */\n readonly disabledItems: ReadonlySet<string>;\n /**\n * Stable. Each Item calls it from a layout effect with its value and its own `disabled` prop;\n * returns the unregister function.\n */\n readonly registerItem: (value: string, disabled: boolean) => () => void;\n /** From `useNativeGroupReconciliation`; Items and Parents call it from their mount layout effect. */\n readonly onItemMounted: (element: HTMLInputElement | null) => void;\n /**\n * A Parent mounted with a DOM `checked` that differs from its derivation (a click before\n * hydration). Folded into the Root's next mount read as \"check all\" / \"uncheck all\" of\n * `values` (design 8.1). Call before `onItemMounted`.\n */\n readonly reportParent: (values: readonly string[], checked: boolean) => void;\n /**\n * The optimistic set as the Root state's `value`: an array in the Items' document order as of\n * the Root's last render (see `CheckboxGroupRootState.value`).\n */\n readonly value: readonly string[];\n /**\n * Sorts values by the current document order of the group's Items (a DOM read); values with no\n * Item keep their iteration order, after them. Call from handlers and effects only.\n */\n readonly sortByDocument: (values: Iterable<string>) => string[];\n}\n\n/**\n * The values a Parent over `values` acts on and derives from: those not in `disabledItems`\n * (values with no Item included). When that leaves nothing (every value has only disabled\n * Items), all of `values`: a Parent the consumer left enabled over disabled Items still shows and\n * changes their state (disable the Parent to make it inert).\n */\nexport function enabledValues(\n values: readonly string[],\n disabledItems: ReadonlySet<string>,\n): readonly string[] {\n if (disabledItems.size === 0) return values;\n const enabled = values.filter((v) => !disabledItems.has(v));\n return enabled.length > 0 ? enabled : values;\n}\n\nexport const CheckboxGroupContext = createContext<CheckboxGroupContextValue | null>(null);\n\nexport function useCheckboxGroupContext(part: string): CheckboxGroupContextValue {\n const context = use(CheckboxGroupContext);\n if (context === null) {\n throw new Error(`${part} must be rendered inside a CheckboxGroup.Root.`);\n }\n return context;\n}\n"],"mappings":";;;;;;;;;AA6EA,SAAgB,cACd,QACA,eACmB;CACnB,IAAI,cAAc,SAAS,GAAG,OAAO;CACrC,MAAM,UAAU,OAAO,QAAQ,MAAM,CAAC,cAAc,IAAI,CAAC,CAAC;CAC1D,OAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;AAEA,MAAa,uBAAuB,cAAgD,IAAI;AAExF,SAAgB,wBAAwB,MAAyC;CAC/E,MAAM,UAAU,IAAI,oBAAoB;CACxC,IAAI,YAAY,MACd,MAAM,IAAI,MAAM,GAAG,KAAK,+CAA+C;CAEzE,OAAO;AACT"}
1
+ {"version":3,"file":"checkbox-group-context.mjs","names":[],"sources":["../../src/checkbox-group/checkbox-group-context.ts"],"sourcesContent":["\"use client\";\nimport { createContext, use } from \"react\";\nimport type { SetPatch } from \"../internal/value-set.js\";\nimport type { CheckboxGroupRootState } from \"./checkbox-group-root.js\";\n\n/** A change to the group's set of checked values (design/components/checkbox-group.md 5.2). */\nexport type CheckboxGroupPatch = SetPatch;\n\nexport interface CheckboxGroupContextValue {\n /** The `name` shared by every Item of the group (prop or `useId()`). */\n readonly name: string;\n readonly form: string | undefined;\n /** Inside a `Field.Root`: the Field's `aria-invalid`, rendered on every Item. Else `undefined`. */\n readonly fieldInvalid: \"true\" | \"false\" | undefined;\n /**\n * The Root's `required` while no value of an enabled Item is checked (design section 7):\n * rendered as native `required` on every Item. Before the Items have registered (server render,\n * hydration render) it is `required && optimistic.size === 0`, which is what the server can\n * compute.\n */\n readonly required: boolean;\n /** Optimistic checked values: Items and Parents render from it. */\n readonly optimistic: ReadonlySet<string>;\n /** Committed checked values. For per-part pending and the Parent's restore memory only. */\n readonly committed: ReadonlySet<string>;\n /**\n * The Root's state. Its `disabled` is `Root disabled`, which reaches the boxes natively through\n * `<fieldset disabled>`.\n */\n readonly state: CheckboxGroupRootState;\n /**\n * Uncontrolled mode: the latest `defaultValue` as a set, mirrored by each Item into\n * `el.defaultChecked` (and by each Parent, derived) so that a form reset returns to it.\n * `undefined` in controlled mode, where React's mount-time value stays the reset target\n * (conventions 3.8 rule 6).\n */\n readonly defaultValue: ReadonlySet<string> | undefined;\n /**\n * Item click. No-op when `optimistic.has(value) === checked`. Checks neither `disabled` nor\n * `defaultPrevented` (the Item's `guardCheckableChange` does).\n */\n readonly toggle: (value: string, checked: boolean, event: Event) => void;\n /** Parent click: a whole patch. No-op when it changes nothing against the optimistic set. */\n readonly apply: (patch: CheckboxGroupPatch, event: Event) => void;\n /**\n * Values whose every mounted Item has its own `disabled` prop (`Root disabled` is not counted).\n * A Parent leaves them alone (design 6.2). Empty until the Items registered.\n */\n readonly disabledItems: ReadonlySet<string>;\n /**\n * Stable. Each Item calls it from a layout effect with its value and its own `disabled` prop;\n * returns the unregister function.\n */\n readonly registerItem: (value: string, disabled: boolean) => () => void;\n /** From `useNativeGroupReconciliation`; Items and Parents call it from their mount layout effect. */\n readonly onItemMounted: (element: HTMLInputElement | null) => void;\n /**\n * A Parent mounted with a DOM `checked` that differs from its derivation (a click before\n * hydration). Folded into the Root's next mount read as \"check all\" / \"uncheck all\" of\n * `values` (design 8.1). Call before `onItemMounted`.\n */\n readonly reportParent: (values: readonly string[], checked: boolean) => void;\n /**\n * Sorts values by the current document order of the group's Items (a DOM read); values with no\n * Item keep their iteration order, after them. Call from handlers and effects only.\n */\n readonly sortByDocument: (values: Iterable<string>) => string[];\n}\n\n/**\n * The values a Parent over `values` acts on and derives from: those not in `disabledItems`\n * (values with no Item included). When that leaves nothing (every value has only disabled\n * Items), all of `values`: a Parent the consumer left enabled over disabled Items still shows and\n * changes their state (disable the Parent to make it inert).\n */\nexport function enabledValues(\n values: readonly string[],\n disabledItems: ReadonlySet<string>,\n): readonly string[] {\n if (disabledItems.size === 0) return values;\n const enabled = values.filter((v) => !disabledItems.has(v));\n return enabled.length > 0 ? enabled : values;\n}\n\nexport const CheckboxGroupContext = createContext<CheckboxGroupContextValue | null>(null);\n\nexport function useCheckboxGroupContext(part: string): CheckboxGroupContextValue {\n const context = use(CheckboxGroupContext);\n if (context === null) {\n throw new Error(`${part} must be rendered inside a CheckboxGroup.Root.`);\n }\n return context;\n}\n"],"mappings":";;;;;;;;;AA2EA,SAAgB,cACd,QACA,eACmB;CACnB,IAAI,cAAc,SAAS,GAAG,OAAO;CACrC,MAAM,UAAU,OAAO,QAAQ,MAAM,CAAC,cAAc,IAAI,CAAC,CAAC;CAC1D,OAAO,QAAQ,SAAS,IAAI,UAAU;AACxC;AAEA,MAAa,uBAAuB,cAAgD,IAAI;AAExF,SAAgB,wBAAwB,MAAyC;CAC/E,MAAM,UAAU,IAAI,oBAAoB;CACxC,IAAI,YAAY,MACd,MAAM,IAAI,MAAM,GAAG,KAAK,+CAA+C;CAEzE,OAAO;AACT"}
@@ -1,7 +1,11 @@
1
1
  import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { CSSProperties, ComponentPropsWithRef, ViewTransitionClass } from "react";
3
3
  //#region src/checkbox-group/checkbox-group-item.d.ts
4
+ /**
5
+ * State of `CheckboxGroup.Item`, passed to the function forms of `className`, `style` and `render`.
6
+ */
4
7
  export interface CheckboxGroupItemState {
8
+ /** The Item's `value` prop. */
5
9
  readonly value: string;
6
10
  /** Optimistic: true as soon as the user checks this box, before the action settles. */
7
11
  readonly checked: boolean;
@@ -10,6 +14,11 @@ export interface CheckboxGroupItemState {
10
14
  /** Disabled by its own prop or by `Root disabled`. */
11
15
  readonly disabled: boolean;
12
16
  }
17
+ /**
18
+ * Props of `CheckboxGroup.Item`.
19
+ *
20
+ * @see https://ui.funstack.work/components/checkbox-group
21
+ */
13
22
  export interface CheckboxGroupItemProps extends Omit<ComponentPropsWithRef<"input">, "type" | "name" | "value" | "checked" | "defaultChecked" | "defaultValue" | "form" | "required" | "aria-checked" | "onChange" | "className" | "style" | "children"> {
14
23
  /** The value this box contributes when checked. Must be unique within the Root. */
15
24
  value: string;
@@ -17,6 +26,8 @@ export interface CheckboxGroupItemProps extends Omit<ComponentPropsWithRef<"inpu
17
26
  * Native `disabled`: unfocusable, never dispatches, barred from constraint validation. A
18
27
  * `Parent` leaves a disabled Item's value alone and derives its state without it; a checked
19
28
  * disabled Item does not satisfy the group's `required`.
29
+ *
30
+ * @defaultValue `false`
20
31
  */
21
32
  disabled?: boolean;
22
33
  /**
@@ -24,13 +35,14 @@ export interface CheckboxGroupItemProps extends Omit<ComponentPropsWithRef<"inpu
24
35
  * commit that settles the action (or rolls it back), never on the optimistic check; animate the
25
36
  * check itself with CSS on `:checked`.
26
37
  *
27
- * Static: without `transition` the part renders no `<ViewTransition>`; changing it between
28
- * `undefined` and a value remounts the element. Any value, `"none"` included, makes a mount or
29
- * `<Activity>` reveal of this part inside a transition start a document view transition: the
30
- * page cross-fades for about 250 ms and the next transition commit waits for it (issue #35).
38
+ * Static: setting or unsetting it remounts the element. Any value, `"none"` included, makes a
39
+ * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms
40
+ * page cross-fade that the next transition waits for).
31
41
  */
32
42
  transition?: ViewTransitionClass;
43
+ /** Class name, or a function of the part's state that returns one. */
33
44
  className?: StateValue<string | undefined, CheckboxGroupItemState>;
45
+ /** Inline style, or a function of the part's state that returns one. */
34
46
  style?: StateValue<CSSProperties | undefined, CheckboxGroupItemState>;
35
47
  /** Replace the rendered element. Must keep an `<input>`; the library sets `type="checkbox"`. */
36
48
  render?: RenderProp<ComponentPropsWithRef<"input">, CheckboxGroupItemState>;
@@ -44,8 +56,11 @@ export interface CheckboxGroupItemProps extends Omit<ComponentPropsWithRef<"inpu
44
56
  * Owned keys (conventions 1.2; a `render` element's value is overridden): `type`, `name`,
45
57
  * `value`, `checked`, `defaultChecked` (never rendered), `disabled`, `form`, `required`
46
58
  * (computed by the Root from its `required` prop), `aria-checked` (removed), `data-checked`,
47
- * `data-pending`, `data-disabled`. `onChange` is merged: a `render` element's own handler runs
59
+ * `data-pending`, `data-disabled`; inside a `Field.Root` also `aria-invalid` (the Field's).
60
+ * `onChange` is merged: a `render` element's own handler runs
48
61
  * first, then the library's. `role` passes through.
62
+ *
63
+ * @see https://ui.funstack.work/components/checkbox-group
49
64
  */
50
65
  export declare function CheckboxGroupItem({ value, disabled: disabledProp, transition, className, style, render, ...rest }: CheckboxGroupItemProps): import("react").ReactNode;
51
66
  export declare namespace CheckboxGroupItem {
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group-item.d.mts","names":[],"sources":["../../src/checkbox-group/checkbox-group-item.tsx"],"mappings":";;;iBAWiB;WACN;;WAEA;;WAEA;;WAEA;;iBAGM,+BAA+B,KAC9C;;EAgBA;;;;;;EAMA;;;;;;;;;;;EAWA,aAAa;EACb,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;EAE9C,SAAS,WAAW,gCAAgC;;;;;;;;;;;;;;wBAetC,oBACd,OACA,UAAU,cACV,YACA,WACA,OACA,WACG,QACF,yCAAsB;yBART"}
1
+ {"version":3,"file":"checkbox-group-item.d.mts","names":[],"sources":["../../src/checkbox-group/checkbox-group-item.tsx"],"mappings":";;;;;;iBAciB;;WAEN;;WAEA;;WAEA;;WAEA;;;;;;;iBAQM,+BAA+B,KAC9C;;EAgBA;;;;;;;;EAQA;;;;;;;;;;EAUA,aAAa;;EAEb,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,SAAS,WAAW,gCAAgC;;;;;;;;;;;;;;;;;wBAkBtC,oBACd,OACA,UAAU,cACV,YACA,WACA,OACA,WACG,QACF,yCAAsB;yBART"}
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
3
- import { dataAttr } from "../internal/data-attr.mjs";
4
3
  import { useRender } from "../internal/use-render.mjs";
5
- import { guardCheckableChange, useNativeChecked } from "../internal/use-native-checked.mjs";
6
- import { syncPresence } from "../internal/sync-presence.mjs";
4
+ import { syncPresences } from "../internal/form/sync-presence.mjs";
5
+ import { useNativeChecked } from "../internal/form/use-native-checked.mjs";
6
+ import { groupMemberProps } from "../internal/form/group-member.mjs";
7
7
  import { useCheckboxGroupContext } from "./checkbox-group-context.mjs";
8
8
  import { useLayoutEffect } from "react";
9
9
  //#region src/checkbox-group/checkbox-group-item.tsx
@@ -16,14 +16,17 @@ import { useLayoutEffect } from "react";
16
16
  * Owned keys (conventions 1.2; a `render` element's value is overridden): `type`, `name`,
17
17
  * `value`, `checked`, `defaultChecked` (never rendered), `disabled`, `form`, `required`
18
18
  * (computed by the Root from its `required` prop), `aria-checked` (removed), `data-checked`,
19
- * `data-pending`, `data-disabled`. `onChange` is merged: a `render` element's own handler runs
19
+ * `data-pending`, `data-disabled`; inside a `Field.Root` also `aria-invalid` (the Field's).
20
+ * `onChange` is merged: a `render` element's own handler runs
20
21
  * first, then the library's. `role` passes through.
22
+ *
23
+ * @see https://ui.funstack.work/components/checkbox-group
21
24
  */
22
25
  function CheckboxGroupItem({ value, disabled: disabledProp = false, transition, className, style, render, ...rest }) {
23
26
  const ctx = useCheckboxGroupContext("CheckboxGroup.Item");
24
27
  const checked = ctx.optimistic.has(value);
25
- const pending = ctx.pending && checked !== ctx.committed.has(value);
26
- const disabled = ctx.disabled || disabledProp;
28
+ const pending = ctx.state.pending && checked !== ctx.committed.has(value);
29
+ const disabled = ctx.state.disabled || disabledProp;
27
30
  const required = ctx.required;
28
31
  const { registerItem } = ctx;
29
32
  useLayoutEffect(() => registerItem(value, disabledProp), [
@@ -37,12 +40,12 @@ function CheckboxGroupItem({ value, disabled: disabledProp = false, transition,
37
40
  checked,
38
41
  group: true,
39
42
  onItemMounted: (el) => {
40
- if (el !== null) {
41
- syncPresence(el, "data-checked", checked);
42
- syncPresence(el, "data-pending", pending);
43
- syncPresence(el, "data-disabled", disabled);
44
- syncPresence(el, "required", required);
45
- }
43
+ if (el !== null) syncPresences(el, {
44
+ "data-checked": checked,
45
+ "data-pending": pending,
46
+ "data-disabled": disabled,
47
+ required
48
+ });
46
49
  ctx.onItemMounted(el);
47
50
  },
48
51
  defaultChecked: ctx.defaultValue === void 0 ? void 0 : ctx.defaultValue.has(value)
@@ -61,25 +64,20 @@ function CheckboxGroupItem({ value, disabled: disabledProp = false, transition,
61
64
  children: void 0,
62
65
  ref: inputRef,
63
66
  props: rest,
64
- libraryProps: {
67
+ libraryProps: groupMemberProps({
65
68
  type: "checkbox",
69
+ component: "CheckboxGroup.Item",
66
70
  name: ctx.name,
67
- value,
68
- checked,
69
- defaultChecked: void 0,
70
- "aria-checked": void 0,
71
- disabled: disabledProp,
72
71
  form: ctx.form,
72
+ value,
73
73
  required,
74
- "data-checked": dataAttr(checked),
75
- "data-pending": dataAttr(pending),
76
- "data-disabled": dataAttr(disabled),
77
- onChange: (event) => {
78
- if (disabled) return;
79
- const nativeEvent = event.nativeEvent;
80
- guardCheckableChange(nativeEvent, () => ctx.toggle(value, !checked, nativeEvent), "CheckboxGroup.Item");
81
- }
82
- }
74
+ checked,
75
+ pending,
76
+ effectiveDisabled: disabled,
77
+ ownDisabled: disabledProp,
78
+ invalid: ctx.fieldInvalid,
79
+ activate: (event) => ctx.toggle(value, !checked, event)
80
+ })
83
81
  });
84
82
  return useTransitionBoundary("CheckboxGroup.Item", transition, element);
85
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group-item.mjs","names":[],"sources":["../../src/checkbox-group/checkbox-group-item.tsx"],"sourcesContent":["\"use client\";\nimport { useLayoutEffect } from \"react\";\nimport type { ChangeEvent, ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { guardCheckableChange, useNativeChecked } from \"../internal/use-native-checked.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useCheckboxGroupContext } from \"./checkbox-group-context.js\";\nimport { syncPresence } from \"../internal/sync-presence.js\";\n\nexport interface CheckboxGroupItemState {\n readonly value: string;\n /** Optimistic: true as soon as the user checks this box, before the action settles. */\n readonly checked: boolean;\n /** The Root is pending and this box's optimistic state differs from its committed state. */\n readonly pending: boolean;\n /** Disabled by its own prop or by `Root disabled`. */\n readonly disabled: boolean;\n}\n\nexport interface CheckboxGroupItemProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"name\"\n | \"value\"\n | \"checked\"\n | \"defaultChecked\"\n | \"defaultValue\"\n | \"form\"\n | \"required\"\n | \"aria-checked\"\n | \"onChange\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** The value this box contributes when checked. Must be unique within the Root. */\n value: string;\n /**\n * Native `disabled`: unfocusable, never dispatches, barred from constraint validation. A\n * `Parent` leaves a disabled Item's value alone and derives its state without it; a checked\n * disabled Item does not satisfy the group's `required`.\n */\n disabled?: boolean;\n /**\n * Forwarded to the Item's `<ViewTransition default>`. Default: no boundary. Fires only on the\n * commit that settles the action (or rolls it back), never on the optimistic check; animate the\n * check itself with CSS on `:checked`.\n *\n * Static: without `transition` the part renders no `<ViewTransition>`; changing it between\n * `undefined` and a value remounts the element. Any value, `\"none\"` included, makes a mount or\n * `<Activity>` reveal of this part inside a transition start a document view transition: the\n * page cross-fades for about 250 ms and the next transition commit waits for it (issue #35).\n */\n transition?: ViewTransitionClass;\n className?: StateValue<string | undefined, CheckboxGroupItemState>;\n style?: StateValue<CSSProperties | undefined, CheckboxGroupItemState>;\n /** Replace the rendered element. Must keep an `<input>`; the library sets `type=\"checkbox\"`. */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, CheckboxGroupItemState>;\n}\n\n/**\n * One `<input type=\"checkbox\">` of the group, checked while its `value` is in the group's set.\n * Its DOM `checked` is the optimistic state (`checked={optimistic.has(value)}`): react-dom\n * restores a controlled input to its props after every event, and only the sync-lane optimistic\n * value survives that restore.\n *\n * Owned keys (conventions 1.2; a `render` element's value is overridden): `type`, `name`,\n * `value`, `checked`, `defaultChecked` (never rendered), `disabled`, `form`, `required`\n * (computed by the Root from its `required` prop), `aria-checked` (removed), `data-checked`,\n * `data-pending`, `data-disabled`. `onChange` is merged: a `render` element's own handler runs\n * first, then the library's. `role` passes through.\n */\nexport function CheckboxGroupItem({\n value,\n disabled: disabledProp = false,\n transition,\n className,\n style,\n render,\n ...rest\n}: CheckboxGroupItemProps) {\n const ctx = useCheckboxGroupContext(\"CheckboxGroup.Item\");\n const checked = ctx.optimistic.has(value);\n const pending = ctx.pending && checked !== ctx.committed.has(value);\n const disabled = ctx.disabled || disabledProp;\n const required = ctx.required;\n\n // The Root needs every Item's own `disabled` for the Parents and `required` (design 6.2, 7).\n const { registerItem } = ctx;\n useLayoutEffect(() => registerItem(value, disabledProp), [registerItem, value, disabledProp]);\n\n // Group mode: element check and re-apply only; the Root reports the residual paths once.\n const inputRef = useNativeChecked({\n type: \"checkbox\",\n component: \"CheckboxGroup.Item\",\n checked,\n group: true,\n onItemMounted: (el) => {\n // Hydration keeps server attributes that differ from the client render (React only warns).\n // An Item hydrating after its Root can render a different state than the server did (a\n // click on an already hydrated box), and stale attributes would stay until the next change.\n if (el !== null) {\n syncPresence(el, \"data-checked\", checked);\n syncPresence(el, \"data-pending\", pending);\n syncPresence(el, \"data-disabled\", disabled);\n syncPresence(el, \"required\", required);\n }\n ctx.onItemMounted(el);\n },\n defaultChecked: ctx.defaultValue === undefined ? undefined : ctx.defaultValue.has(value),\n });\n\n const state: CheckboxGroupItemState = { value, checked, pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, CheckboxGroupItemState>({\n defaultElement: \"input\",\n render,\n state,\n className,\n style,\n children: undefined,\n ref: inputRef,\n // Pass-through layer: a `render` element's own props win over these.\n props: rest,\n libraryProps: {\n type: \"checkbox\",\n name: ctx.name,\n value,\n checked,\n defaultChecked: undefined,\n \"aria-checked\": undefined,\n // Owned (Switch precedent) so that native disabledness, `data-disabled` and the click guard\n // agree. Only the Item's own prop: `Root disabled` reaches the box through the fieldset.\n disabled: disabledProp,\n form: ctx.form,\n required,\n \"data-checked\": dataAttr(checked),\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n onChange: (event: ChangeEvent<HTMLInputElement>) => {\n // A natively disabled box fires no click; this covers `render` elements that do not\n // honour `disabled`.\n if (disabled) return;\n const nativeEvent = event.nativeEvent;\n guardCheckableChange(\n nativeEvent,\n () => ctx.toggle(value, !checked, nativeEvent),\n \"CheckboxGroup.Item\",\n );\n },\n },\n });\n\n return useTransitionBoundary(\"CheckboxGroup.Item\", transition, element);\n}\n\nCheckboxGroupItem.displayName = \"CheckboxGroupItem\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0EA,SAAgB,kBAAkB,EAChC,OACA,UAAU,eAAe,OACzB,YACA,WACA,OACA,QACA,GAAG,QACsB;CACzB,MAAM,MAAM,wBAAwB,oBAAoB;CACxD,MAAM,UAAU,IAAI,WAAW,IAAI,KAAK;CACxC,MAAM,UAAU,IAAI,WAAW,YAAY,IAAI,UAAU,IAAI,KAAK;CAClE,MAAM,WAAW,IAAI,YAAY;CACjC,MAAM,WAAW,IAAI;CAGrB,MAAM,EAAE,iBAAiB;CACzB,sBAAsB,aAAa,OAAO,YAAY,GAAG;EAAC;EAAc;EAAO;CAAY,CAAC;CAG5F,MAAM,WAAW,iBAAiB;EAChC,MAAM;EACN,WAAW;EACX;EACA,OAAO;EACP,gBAAgB,OAAO;GAIrB,IAAI,OAAO,MAAM;IACf,aAAa,IAAI,gBAAgB,OAAO;IACxC,aAAa,IAAI,gBAAgB,OAAO;IACxC,aAAa,IAAI,iBAAiB,QAAQ;IAC1C,aAAa,IAAI,YAAY,QAAQ;GACvC;GACA,IAAI,cAAc,EAAE;EACtB;EACA,gBAAgB,IAAI,iBAAiB,KAAA,IAAY,KAAA,IAAY,IAAI,aAAa,IAAI,KAAK;CACzF,CAAC;CAID,MAAM,UAAU,UAAkE;EAChF,gBAAgB;EAChB;EACA,OAAA;GALsC;GAAO;GAAS;GAAS;EAK3D;EACJ;EACA;EACA,UAAU,KAAA;EACV,KAAK;EAEL,OAAO;EACP,cAAc;GACZ,MAAM;GACN,MAAM,IAAI;GACV;GACA;GACA,gBAAgB,KAAA;GAChB,gBAAgB,KAAA;GAGhB,UAAU;GACV,MAAM,IAAI;GACV;GACA,gBAAgB,SAAS,OAAO;GAChC,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;GAClC,WAAW,UAAyC;IAGlD,IAAI,UAAU;IACd,MAAM,cAAc,MAAM;IAC1B,qBACE,mBACM,IAAI,OAAO,OAAO,CAAC,SAAS,WAAW,GAC7C,oBACF;GACF;EACF;CACF,CAAC;CAED,OAAO,sBAAsB,sBAAsB,YAAY,OAAO;AACxE;AAEA,kBAAkB,cAAc"}
1
+ {"version":3,"file":"checkbox-group-item.mjs","names":[],"sources":["../../src/checkbox-group/checkbox-group-item.tsx"],"sourcesContent":["\"use client\";\nimport { useLayoutEffect } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { groupMemberProps } from \"../internal/form/group-member.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useNativeChecked } from \"../internal/form/use-native-checked.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useCheckboxGroupContext } from \"./checkbox-group-context.js\";\nimport { syncPresences } from \"../internal/form/sync-presence.js\";\n\n/**\n * State of `CheckboxGroup.Item`, passed to the function forms of `className`, `style` and `render`.\n */\nexport interface CheckboxGroupItemState {\n /** The Item's `value` prop. */\n readonly value: string;\n /** Optimistic: true as soon as the user checks this box, before the action settles. */\n readonly checked: boolean;\n /** The Root is pending and this box's optimistic state differs from its committed state. */\n readonly pending: boolean;\n /** Disabled by its own prop or by `Root disabled`. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `CheckboxGroup.Item`.\n *\n * @see https://ui.funstack.work/components/checkbox-group\n */\nexport interface CheckboxGroupItemProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"name\"\n | \"value\"\n | \"checked\"\n | \"defaultChecked\"\n | \"defaultValue\"\n | \"form\"\n | \"required\"\n | \"aria-checked\"\n | \"onChange\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** The value this box contributes when checked. Must be unique within the Root. */\n value: string;\n /**\n * Native `disabled`: unfocusable, never dispatches, barred from constraint validation. A\n * `Parent` leaves a disabled Item's value alone and derives its state without it; a checked\n * disabled Item does not satisfy the group's `required`.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Forwarded to the Item's `<ViewTransition default>`. Default: no boundary. Fires only on the\n * commit that settles the action (or rolls it back), never on the optimistic check; animate the\n * check itself with CSS on `:checked`.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, CheckboxGroupItemState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, CheckboxGroupItemState>;\n /** Replace the rendered element. Must keep an `<input>`; the library sets `type=\"checkbox\"`. */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, CheckboxGroupItemState>;\n}\n\n/**\n * One `<input type=\"checkbox\">` of the group, checked while its `value` is in the group's set.\n * Its DOM `checked` is the optimistic state (`checked={optimistic.has(value)}`): react-dom\n * restores a controlled input to its props after every event, and only the sync-lane optimistic\n * value survives that restore.\n *\n * Owned keys (conventions 1.2; a `render` element's value is overridden): `type`, `name`,\n * `value`, `checked`, `defaultChecked` (never rendered), `disabled`, `form`, `required`\n * (computed by the Root from its `required` prop), `aria-checked` (removed), `data-checked`,\n * `data-pending`, `data-disabled`; inside a `Field.Root` also `aria-invalid` (the Field's).\n * `onChange` is merged: a `render` element's own handler runs\n * first, then the library's. `role` passes through.\n *\n * @see https://ui.funstack.work/components/checkbox-group\n */\nexport function CheckboxGroupItem({\n value,\n disabled: disabledProp = false,\n transition,\n className,\n style,\n render,\n ...rest\n}: CheckboxGroupItemProps) {\n const ctx = useCheckboxGroupContext(\"CheckboxGroup.Item\");\n const checked = ctx.optimistic.has(value);\n const pending = ctx.state.pending && checked !== ctx.committed.has(value);\n const disabled = ctx.state.disabled || disabledProp;\n const required = ctx.required;\n\n // The Root needs every Item's own `disabled` for the Parents and `required` (design 6.2, 7).\n const { registerItem } = ctx;\n useLayoutEffect(() => registerItem(value, disabledProp), [registerItem, value, disabledProp]);\n\n // Group mode: element check and re-apply only; the Root reports the residual paths once.\n const inputRef = useNativeChecked({\n type: \"checkbox\",\n component: \"CheckboxGroup.Item\",\n checked,\n group: true,\n onItemMounted: (el) => {\n // Hydration keeps server attributes that differ from the client render (React only warns).\n // An Item hydrating after its Root can render a different state than the server did (a\n // click on an already hydrated box), and stale attributes would stay until the next change.\n if (el !== null) {\n syncPresences(el, {\n \"data-checked\": checked,\n \"data-pending\": pending,\n \"data-disabled\": disabled,\n required,\n });\n }\n ctx.onItemMounted(el);\n },\n defaultChecked: ctx.defaultValue === undefined ? undefined : ctx.defaultValue.has(value),\n });\n\n const state: CheckboxGroupItemState = { value, checked, pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, CheckboxGroupItemState>({\n defaultElement: \"input\",\n render,\n state,\n className,\n style,\n children: undefined,\n ref: inputRef,\n // Pass-through layer: a `render` element's own props win over these.\n props: rest,\n libraryProps: groupMemberProps({\n type: \"checkbox\",\n component: \"CheckboxGroup.Item\",\n name: ctx.name,\n form: ctx.form,\n value,\n required,\n checked,\n pending,\n effectiveDisabled: disabled,\n ownDisabled: disabledProp,\n // Inside a Field (owned there): the group's invalid state, since the fieldset cannot carry it.\n invalid: ctx.fieldInvalid,\n activate: (event) => ctx.toggle(value, !checked, event),\n }),\n });\n\n return useTransitionBoundary(\"CheckboxGroup.Item\", transition, element);\n}\n\nCheckboxGroupItem.displayName = \"CheckboxGroupItem\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyFA,SAAgB,kBAAkB,EAChC,OACA,UAAU,eAAe,OACzB,YACA,WACA,OACA,QACA,GAAG,QACsB;CACzB,MAAM,MAAM,wBAAwB,oBAAoB;CACxD,MAAM,UAAU,IAAI,WAAW,IAAI,KAAK;CACxC,MAAM,UAAU,IAAI,MAAM,WAAW,YAAY,IAAI,UAAU,IAAI,KAAK;CACxE,MAAM,WAAW,IAAI,MAAM,YAAY;CACvC,MAAM,WAAW,IAAI;CAGrB,MAAM,EAAE,iBAAiB;CACzB,sBAAsB,aAAa,OAAO,YAAY,GAAG;EAAC;EAAc;EAAO;CAAY,CAAC;CAG5F,MAAM,WAAW,iBAAiB;EAChC,MAAM;EACN,WAAW;EACX;EACA,OAAO;EACP,gBAAgB,OAAO;GAIrB,IAAI,OAAO,MACT,cAAc,IAAI;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB;GACF,CAAC;GAEH,IAAI,cAAc,EAAE;EACtB;EACA,gBAAgB,IAAI,iBAAiB,KAAA,IAAY,KAAA,IAAY,IAAI,aAAa,IAAI,KAAK;CACzF,CAAC;CAID,MAAM,UAAU,UAAkE;EAChF,gBAAgB;EAChB;EACA,OAAA;GALsC;GAAO;GAAS;GAAS;EAK3D;EACJ;EACA;EACA,UAAU,KAAA;EACV,KAAK;EAEL,OAAO;EACP,cAAc,iBAAiB;GAC7B,MAAM;GACN,WAAW;GACX,MAAM,IAAI;GACV,MAAM,IAAI;GACV;GACA;GACA;GACA;GACA,mBAAmB;GACnB,aAAa;GAEb,SAAS,IAAI;GACb,WAAW,UAAU,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK;EACxD,CAAC;CACH,CAAC;CAED,OAAO,sBAAsB,sBAAsB,YAAY,OAAO;AACxE;AAEA,kBAAkB,cAAc"}
@@ -2,16 +2,26 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { CheckboxGroupRootState } from "./checkbox-group-root.mjs";
3
3
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
4
4
  //#region src/checkbox-group/checkbox-group-label.d.ts
5
+ /**
6
+ * Props of `CheckboxGroup.Label`.
7
+ *
8
+ * @see https://ui.funstack.work/components/checkbox-group
9
+ */
5
10
  export interface CheckboxGroupLabelProps extends Omit<ComponentPropsWithRef<"legend">, "className" | "style" | "children"> {
11
+ /** Class name, or a function of the part's state that returns one. */
6
12
  className?: StateValue<string | undefined, CheckboxGroupRootState>;
13
+ /** Inline style, or a function of the part's state that returns one. */
7
14
  style?: StateValue<CSSProperties | undefined, CheckboxGroupRootState>;
8
15
  /** Receives the Root's state: a group-level pending indicator goes here. */
9
16
  children?: StateValue<ReactNode, CheckboxGroupRootState>;
17
+ /** Replace the default `<legend>` (element form) or take over rendering (function form). */
10
18
  render?: RenderProp<ComponentPropsWithRef<"legend">, CheckboxGroupRootState>;
11
19
  }
12
20
  /**
13
21
  * The group's `<legend>`, which names the fieldset natively. Optional; must be the **first child**
14
22
  * of `CheckboxGroup.Root` (HTML content model). Its state is the Root's state. Owns no keys.
23
+ *
24
+ * @see https://ui.funstack.work/components/checkbox-group
15
25
  */
16
26
  export declare function CheckboxGroupLabel({ className, style, children, render, ...rest }: CheckboxGroupLabelProps): ReactNode;
17
27
  export declare namespace CheckboxGroupLabel {
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group-label.d.mts","names":[],"sources":["../../src/checkbox-group/checkbox-group-label.tsx"],"mappings":";;;;iBAOiB,gCAAgC,KAC/C;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,iCAAiC;;;;;;wBAOvC,qBACd,WACA,OACA,UACA,WACG,QACF,0BAAuB;yBANV"}
1
+ {"version":3,"file":"checkbox-group-label.d.mts","names":[],"sources":["../../src/checkbox-group/checkbox-group-label.tsx"],"mappings":";;;;;;;;;iBAYiB,gCAAgC,KAC/C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;wBASvC,qBACd,WACA,OACA,UACA,WACG,QACF,0BAAuB;yBANV"}
@@ -5,14 +5,11 @@ import { useCheckboxGroupContext } from "./checkbox-group-context.mjs";
5
5
  /**
6
6
  * The group's `<legend>`, which names the fieldset natively. Optional; must be the **first child**
7
7
  * of `CheckboxGroup.Root` (HTML content model). Its state is the Root's state. Owns no keys.
8
+ *
9
+ * @see https://ui.funstack.work/components/checkbox-group
8
10
  */
9
11
  function CheckboxGroupLabel({ className, style, children, render, ...rest }) {
10
- const ctx = useCheckboxGroupContext("CheckboxGroup.Label");
11
- const state = {
12
- value: ctx.value,
13
- pending: ctx.pending,
14
- disabled: ctx.disabled
15
- };
12
+ const { state } = useCheckboxGroupContext("CheckboxGroup.Label");
16
13
  return useRender({
17
14
  defaultElement: "legend",
18
15
  render,
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group-label.mjs","names":[],"sources":["../../src/checkbox-group/checkbox-group-label.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useCheckboxGroupContext } from \"./checkbox-group-context.js\";\nimport type { CheckboxGroupRootState } from \"./checkbox-group-root.js\";\n\nexport interface CheckboxGroupLabelProps extends Omit<\n ComponentPropsWithRef<\"legend\">,\n \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, CheckboxGroupRootState>;\n style?: StateValue<CSSProperties | undefined, CheckboxGroupRootState>;\n /** Receives the Root's state: a group-level pending indicator goes here. */\n children?: StateValue<ReactNode, CheckboxGroupRootState>;\n render?: RenderProp<ComponentPropsWithRef<\"legend\">, CheckboxGroupRootState>;\n}\n\n/**\n * The group's `<legend>`, which names the fieldset natively. Optional; must be the **first child**\n * of `CheckboxGroup.Root` (HTML content model). Its state is the Root's state. Owns no keys.\n */\nexport function CheckboxGroupLabel({\n className,\n style,\n children,\n render,\n ...rest\n}: CheckboxGroupLabelProps) {\n const ctx = useCheckboxGroupContext(\"CheckboxGroup.Label\");\n const state: CheckboxGroupRootState = {\n value: ctx.value,\n pending: ctx.pending,\n disabled: ctx.disabled,\n };\n return useRender<ComponentPropsWithRef<\"legend\">, CheckboxGroupRootState>({\n defaultElement: \"legend\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n });\n}\n\nCheckboxGroupLabel.displayName = \"CheckboxGroupLabel\";\n"],"mappings":";;;;;;;;AAsBA,SAAgB,mBAAmB,EACjC,WACA,OACA,UACA,QACA,GAAG,QACuB;CAC1B,MAAM,MAAM,wBAAwB,qBAAqB;CACzD,MAAM,QAAgC;EACpC,OAAO,IAAI;EACX,SAAS,IAAI;EACb,UAAU,IAAI;CAChB;CACA,OAAO,UAAmE;EACxE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;CACT,CAAC;AACH;AAEA,mBAAmB,cAAc"}
1
+ {"version":3,"file":"checkbox-group-label.mjs","names":[],"sources":["../../src/checkbox-group/checkbox-group-label.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useCheckboxGroupContext } from \"./checkbox-group-context.js\";\nimport type { CheckboxGroupRootState } from \"./checkbox-group-root.js\";\n\n/**\n * Props of `CheckboxGroup.Label`.\n *\n * @see https://ui.funstack.work/components/checkbox-group\n */\nexport interface CheckboxGroupLabelProps extends Omit<\n ComponentPropsWithRef<\"legend\">,\n \"className\" | \"style\" | \"children\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, CheckboxGroupRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, CheckboxGroupRootState>;\n /** Receives the Root's state: a group-level pending indicator goes here. */\n children?: StateValue<ReactNode, CheckboxGroupRootState>;\n /** Replace the default `<legend>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"legend\">, CheckboxGroupRootState>;\n}\n\n/**\n * The group's `<legend>`, which names the fieldset natively. Optional; must be the **first child**\n * of `CheckboxGroup.Root` (HTML content model). Its state is the Root's state. Owns no keys.\n *\n * @see https://ui.funstack.work/components/checkbox-group\n */\nexport function CheckboxGroupLabel({\n className,\n style,\n children,\n render,\n ...rest\n}: CheckboxGroupLabelProps) {\n const { state } = useCheckboxGroupContext(\"CheckboxGroup.Label\");\n return useRender<ComponentPropsWithRef<\"legend\">, CheckboxGroupRootState>({\n defaultElement: \"legend\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n });\n}\n\nCheckboxGroupLabel.displayName = \"CheckboxGroupLabel\";\n"],"mappings":";;;;;;;;;;AAgCA,SAAgB,mBAAmB,EACjC,WACA,OACA,UACA,QACA,GAAG,QACuB;CAC1B,MAAM,EAAE,UAAU,wBAAwB,qBAAqB;CAC/D,OAAO,UAAmE;EACxE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;CACT,CAAC;AACH;AAEA,mBAAmB,cAAc"}
@@ -1,7 +1,12 @@
1
1
  import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { CSSProperties, ComponentPropsWithRef, ViewTransitionClass } from "react";
3
3
  //#region src/checkbox-group/checkbox-group-parent.d.ts
4
+ /**
5
+ * State of `CheckboxGroup.Parent`, passed to the function forms of `className`, `style` and
6
+ * `render`.
7
+ */
4
8
  export interface CheckboxGroupParentState {
9
+ /** The Parent's `values` prop: the Items it checks and unchecks. */
5
10
  readonly values: readonly string[];
6
11
  /** Every value in `values` is optimistically checked (`false` when `values` is empty). */
7
12
  readonly checked: boolean;
@@ -15,6 +20,11 @@ export interface CheckboxGroupParentState {
15
20
  /** Disabled by its own prop or by `Root disabled`. */
16
21
  readonly disabled: boolean;
17
22
  }
23
+ /**
24
+ * Props of `CheckboxGroup.Parent`.
25
+ *
26
+ * @see https://ui.funstack.work/components/checkbox-group
27
+ */
18
28
  export interface CheckboxGroupParentProps extends Omit<ComponentPropsWithRef<"input">, "type" | "name" | "value" | "checked" | "defaultChecked" | "defaultValue" | "form" | "required" | "autoComplete" | "aria-checked" | "onChange" | "className" | "style" | "children"> {
19
29
  /**
20
30
  * The Item values this Parent controls (usually every Item of the group). Its checked and
@@ -28,20 +38,25 @@ export interface CheckboxGroupParentProps extends Omit<ComponentPropsWithRef<"in
28
38
  * disabled Items too; it settles when the Items hydrate.
29
39
  */
30
40
  values: string[];
31
- /** Native `disabled`: unfocusable, never dispatches. */
41
+ /**
42
+ * Native `disabled`: unfocusable, never dispatches.
43
+ *
44
+ * @defaultValue `false`
45
+ */
32
46
  disabled?: boolean;
33
47
  /**
34
48
  * Forwarded to the Parent's `<ViewTransition default>`. Default: no boundary. Fires only on the
35
49
  * commit that settles the action (or rolls it back), never on the optimistic flip; animate the
36
50
  * flip itself with CSS on `:checked` / `:indeterminate`.
37
51
  *
38
- * Static: without `transition` the part renders no `<ViewTransition>`; changing it between
39
- * `undefined` and a value remounts the element. Any value, `"none"` included, makes a mount or
40
- * `<Activity>` reveal of this part inside a transition start a document view transition: the
41
- * page cross-fades for about 250 ms and the next transition commit waits for it (issue #35).
52
+ * Static: setting or unsetting it remounts the element. Any value, `"none"` included, makes a
53
+ * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms
54
+ * page cross-fade that the next transition waits for).
42
55
  */
43
56
  transition?: ViewTransitionClass;
57
+ /** Class name, or a function of the part's state that returns one. */
44
58
  className?: StateValue<string | undefined, CheckboxGroupParentState>;
59
+ /** Inline style, or a function of the part's state that returns one. */
45
60
  style?: StateValue<CSSProperties | undefined, CheckboxGroupParentState>;
46
61
  /** Replace the rendered element. Must keep an `<input>`; the library sets `type="checkbox"`. */
47
62
  render?: RenderProp<ComponentPropsWithRef<"input">, CheckboxGroupParentState>;
@@ -59,6 +74,8 @@ export interface CheckboxGroupParentProps extends Omit<ComponentPropsWithRef<"in
59
74
  * `defaultChecked`, `indeterminate` (stripped; the property is set), `required` (removed), `form`
60
75
  * (removed), `autoComplete` (`"off"`), `disabled`, `aria-checked` (removed), `data-checked`, `data-indeterminate`,
61
76
  * `data-pending`, `data-disabled`. `onChange` is merged.
77
+ *
78
+ * @see https://ui.funstack.work/components/checkbox-group
62
79
  */
63
80
  export declare function CheckboxGroupParent({ values, disabled: disabledProp, transition, className, style, render, ...rest }: CheckboxGroupParentProps): import("react").ReactNode;
64
81
  export declare namespace CheckboxGroupParent {
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group-parent.d.mts","names":[],"sources":["../../src/checkbox-group/checkbox-group-parent.tsx"],"mappings":";;;iBAaiB;WACN;;WAEA;;;;;WAKA;;WAEA;;WAEA;;iBAGM,iCAAiC,KAChD;;;;;;;;;;;;EA2BA;;EAEA;;;;;;;;;;;EAWA,aAAa;EACb,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;EAE9C,SAAS,WAAW,gCAAgC;;;;;;;;;;;;;;;;wBA2BtC,sBACd,QACA,UAAU,cACV,YACA,WACA,OACA,WACG,QACF,2CAAwB;yBARX"}
1
+ {"version":3,"file":"checkbox-group-parent.d.mts","names":[],"sources":["../../src/checkbox-group/checkbox-group-parent.tsx"],"mappings":";;;;;;;iBAkBiB;;WAEN;;WAEA;;;;;WAKA;;WAEA;;WAEA;;;;;;;iBAQM,iCAAiC,KAChD;;;;;;;;;;;;EA2BA;;;;;;EAMA;;;;;;;;;;EAUA,aAAa;;EAEb,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,SAAS,WAAW,gCAAgC;;;;;;;;;;;;;;;;;;wBA2BtC,sBACd,QACA,UAAU,cACV,YACA,WACA,OACA,WACG,QACF,2CAAwB;yBARX"}
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
3
2
  import { dataAttr } from "../internal/data-attr.mjs";
3
+ import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
4
4
  import { useRender } from "../internal/use-render.mjs";
5
- import { useFormReset } from "../internal/use-form-reset.mjs";
6
- import { guardCheckableChange, useNativeChecked } from "../internal/use-native-checked.mjs";
7
- import { syncPresence } from "../internal/sync-presence.mjs";
5
+ import { syncPresences } from "../internal/form/sync-presence.mjs";
6
+ import { useFormReset } from "../internal/form/use-form-reset.mjs";
7
+ import { guardCheckableChange, useNativeChecked } from "../internal/form/use-native-checked.mjs";
8
+ import { useHydratedMount } from "../internal/use-hydrated-mount.mjs";
8
9
  import { enabledValues, useCheckboxGroupContext } from "./checkbox-group-context.mjs";
9
- import { useCallback, useLayoutEffect, useMemo, useRef, useSyncExternalStore } from "react";
10
+ import { useCallback, useLayoutEffect, useMemo, useRef } from "react";
10
11
  //#region src/checkbox-group/checkbox-group-parent.tsx
11
- const subscribeNothing = () => () => {};
12
12
  /** `checked` / `indeterminate` of a Parent over `values` against `set` (design 6.1). */
13
13
  function derive(values, set) {
14
14
  let inSet = 0;
@@ -32,10 +32,12 @@ function derive(values, set) {
32
32
  * `defaultChecked`, `indeterminate` (stripped; the property is set), `required` (removed), `form`
33
33
  * (removed), `autoComplete` (`"off"`), `disabled`, `aria-checked` (removed), `data-checked`, `data-indeterminate`,
34
34
  * `data-pending`, `data-disabled`. `onChange` is merged.
35
+ *
36
+ * @see https://ui.funstack.work/components/checkbox-group
35
37
  */
36
38
  function CheckboxGroupParent({ values, disabled: disabledProp = false, transition, className, style, render, ...rest }) {
37
39
  const ctx = useCheckboxGroupContext("CheckboxGroup.Parent");
38
- const hydrating = useSyncExternalStore(subscribeNothing, () => false, () => true);
40
+ const hydrating = useHydratedMount();
39
41
  const { disabledItems } = ctx;
40
42
  const effective = useMemo(() => hydrating ? values : enabledValues(values, disabledItems), [
41
43
  hydrating,
@@ -43,8 +45,8 @@ function CheckboxGroupParent({ values, disabled: disabledProp = false, transitio
43
45
  disabledItems
44
46
  ]);
45
47
  const { checked, indeterminate } = derive(effective, ctx.optimistic);
46
- const pending = ctx.pending && values.some((v) => ctx.optimistic.has(v) !== ctx.committed.has(v));
47
- const disabled = ctx.disabled || disabledProp;
48
+ const pending = ctx.state.pending && values.some((v) => ctx.optimistic.has(v) !== ctx.committed.has(v));
49
+ const disabled = ctx.state.disabled || disabledProp;
48
50
  const memory = useRef(null);
49
51
  const { committed } = ctx;
50
52
  useLayoutEffect(() => {
@@ -60,10 +62,12 @@ function CheckboxGroupParent({ values, disabled: disabledProp = false, transitio
60
62
  onItemMounted: (el) => {
61
63
  if (el !== null) {
62
64
  if (el.checked !== checked) ctx.reportParent(values, el.checked);
63
- syncPresence(el, "data-checked", checked);
64
- syncPresence(el, "data-indeterminate", indeterminate);
65
- syncPresence(el, "data-pending", pending);
66
- syncPresence(el, "data-disabled", disabled);
65
+ syncPresences(el, {
66
+ "data-checked": checked,
67
+ "data-indeterminate": indeterminate,
68
+ "data-pending": pending,
69
+ "data-disabled": disabled
70
+ });
67
71
  }
68
72
  ctx.onItemMounted(el);
69
73
  },
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group-parent.mjs","names":[],"sources":["../../src/checkbox-group/checkbox-group-parent.tsx"],"sourcesContent":["\"use client\";\nimport { useCallback, useLayoutEffect, useMemo, useRef, useSyncExternalStore } from \"react\";\nimport type { ChangeEvent, ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { guardCheckableChange, useNativeChecked } from \"../internal/use-native-checked.js\";\nimport { useFormReset } from \"../internal/use-form-reset.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { enabledValues, useCheckboxGroupContext } from \"./checkbox-group-context.js\";\nimport type { CheckboxGroupPatch } from \"./checkbox-group-context.js\";\nimport { syncPresence } from \"../internal/sync-presence.js\";\n\nexport interface CheckboxGroupParentState {\n readonly values: readonly string[];\n /** Every value in `values` is optimistically checked (`false` when `values` is empty). */\n readonly checked: boolean;\n /**\n * Some but not all of `values` are optimistically checked. Never true together with\n * `checked`. Not suspended while pending (it is derived from optimistic state).\n */\n readonly indeterminate: boolean;\n /** The Root is pending and at least one of `values` differs between optimistic and committed. */\n readonly pending: boolean;\n /** Disabled by its own prop or by `Root disabled`. */\n readonly disabled: boolean;\n}\n\nexport interface CheckboxGroupParentProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"name\"\n | \"value\"\n | \"checked\"\n | \"defaultChecked\"\n | \"defaultValue\"\n | \"form\"\n | \"required\"\n | \"autoComplete\"\n | \"aria-checked\"\n | \"onChange\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * The Item values this Parent controls (usually every Item of the group). Its checked and\n * mixed states are derived from them; its click checks or unchecks all of them. Values with\n * no Item are still added to / removed from the group's value.\n *\n * Values whose Items are disabled (their own `disabled` prop) are left alone: the click does\n * not change them and the derivation ignores them, so the Parent shows checked when every\n * enabled Item is. When every value has only disabled Items, the Parent acts on all of them\n * (disable the Parent to make it inert). Before hydration the server-rendered state counts\n * disabled Items too; it settles when the Items hydrate.\n */\n values: string[];\n /** Native `disabled`: unfocusable, never dispatches. */\n disabled?: boolean;\n /**\n * Forwarded to the Parent's `<ViewTransition default>`. Default: no boundary. Fires only on the\n * commit that settles the action (or rolls it back), never on the optimistic flip; animate the\n * flip itself with CSS on `:checked` / `:indeterminate`.\n *\n * Static: without `transition` the part renders no `<ViewTransition>`; changing it between\n * `undefined` and a value remounts the element. Any value, `\"none\"` included, makes a mount or\n * `<Activity>` reveal of this part inside a transition start a document view transition: the\n * page cross-fades for about 250 ms and the next transition commit waits for it (issue #35).\n */\n transition?: ViewTransitionClass;\n className?: StateValue<string | undefined, CheckboxGroupParentState>;\n style?: StateValue<CSSProperties | undefined, CheckboxGroupParentState>;\n /** Replace the rendered element. Must keep an `<input>`; the library sets `type=\"checkbox\"`. */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, CheckboxGroupParentState>;\n}\n\nconst subscribeNothing = () => () => {};\n\n/** `checked` / `indeterminate` of a Parent over `values` against `set` (design 6.1). */\nfunction derive(values: readonly string[], set: ReadonlySet<string>) {\n let inSet = 0;\n for (const v of values) if (set.has(v)) inSet += 1;\n const checked = values.length > 0 && inSet === values.length;\n return { checked, indeterminate: inSet > 0 && !checked };\n}\n\n/**\n * The mixed-state \"select all\" checkbox of a group (WAI-ARIA APG \"Checkbox (Mixed-State)\"):\n * `<input type=\"checkbox\">` checked when every value in `values` is in the group's optimistic\n * set, mixed (`el.indeterminate`, `data-indeterminate`) when some are. A click checks every value\n * when mixed, unchecks every value when checked, and from unchecked restores the last partial\n * combination of its values the group committed (seeded at mount), else checks every value. Each\n * click is one dispatch through the Root's `valueChangeAction`. Never submitted (no `name`).\n * \"Its values\" are those whose Items are enabled: disabled Items are left alone (see `values`).\n *\n * Owned keys (conventions 1.2): `type`, `name` (removed), `value` (removed), `checked`,\n * `defaultChecked`, `indeterminate` (stripped; the property is set), `required` (removed), `form`\n * (removed), `autoComplete` (`\"off\"`), `disabled`, `aria-checked` (removed), `data-checked`, `data-indeterminate`,\n * `data-pending`, `data-disabled`. `onChange` is merged.\n */\nexport function CheckboxGroupParent({\n values,\n disabled: disabledProp = false,\n transition,\n className,\n style,\n render,\n ...rest\n}: CheckboxGroupParentProps) {\n const ctx = useCheckboxGroupContext(\"CheckboxGroup.Parent\");\n // The values the Parent acts on: `values` minus disabled Items (design 6.2). A hydration\n // render uses every value, as the server did (it cannot know which Items are disabled), so\n // that the DOM `checked` it hydrates can be compared with the derivation for the\n // pre-hydration report below, also when this Parent hydrates after the Items registered.\n const hydrating = useSyncExternalStore(\n subscribeNothing,\n () => false,\n () => true,\n );\n const { disabledItems } = ctx;\n const effective = useMemo(\n () => (hydrating ? values : enabledValues(values, disabledItems)),\n [hydrating, values, disabledItems],\n );\n const { checked, indeterminate } = derive(effective, ctx.optimistic);\n const pending = ctx.pending && values.some((v) => ctx.optimistic.has(v) !== ctx.committed.has(v));\n const disabled = ctx.disabled || disabledProp;\n\n // The APG restore memory: the last partial combination of `values` the group committed\n // (design 6.2). Committed, not optimistic, so a partial state that only ever rolled back is\n // never restored. The first run seeds it from the mount-time value.\n const memory = useRef<readonly string[] | null>(null);\n const { committed } = ctx;\n useLayoutEffect(() => {\n const inCommitted = effective.filter((v) => committed.has(v));\n if (inCommitted.length > 0 && inCommitted.length < effective.length) {\n memory.current = inCommitted;\n }\n }, [committed, effective]);\n\n const inputRef = useNativeChecked({\n type: \"checkbox\",\n component: \"CheckboxGroup.Parent\",\n checked,\n indeterminate,\n group: true,\n onItemMounted: (el) => {\n if (el !== null) {\n // A click before hydration flipped the box (design 8.1): report it as the Parent's\n // semantic before the Root reads the group (which leaves disabled Items alone). Firefox's\n // form-state restoration cannot cause this: the Parent renders `autocomplete=\"off\"`.\n if (el.checked !== checked) ctx.reportParent(values, el.checked);\n syncPresence(el, \"data-checked\", checked);\n syncPresence(el, \"data-indeterminate\", indeterminate);\n syncPresence(el, \"data-pending\", pending);\n syncPresence(el, \"data-disabled\", disabled);\n }\n ctx.onItemMounted(el);\n },\n defaultChecked:\n ctx.defaultValue === undefined ? undefined : derive(effective, ctx.defaultValue).checked,\n });\n\n // A form reset sets the Parent's DOM `checked` to its `defaultChecked`, which in controlled\n // mode is React's mount-time value and can be stale (its `values` changed, it mounted after the\n // Items with another value). The Parent re-renders only if the Root dispatches; otherwise put\n // the derivation back (the Root's own microtask, queued after this one, may still dispatch,\n // and the re-render re-applies `checked`).\n const node = useRef<HTMLInputElement | null>(null);\n const ref = useCallback(\n (el: HTMLInputElement) => {\n node.current = el;\n const cleanup = inputRef(el);\n return () => {\n node.current = null;\n if (typeof cleanup === \"function\") cleanup();\n };\n },\n [inputRef],\n );\n useFormReset(node, () => {\n const el = node.current;\n if (el !== null && el.checked !== checked) el.checked = checked;\n });\n\n /** The click cycle of design 6.2. */\n const cyclePatch = (): CheckboxGroupPatch => {\n if (checked) return { added: [], removed: [...effective] };\n if (indeterminate) {\n return { added: effective.filter((v) => !ctx.optimistic.has(v)), removed: [] };\n }\n const restore = memory.current?.filter((v) => effective.includes(v)) ?? [];\n return { added: restore.length > 0 ? restore : [...effective], removed: [] };\n };\n\n const state: CheckboxGroupParentState = { values, checked, indeterminate, pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, CheckboxGroupParentState>({\n defaultElement: \"input\",\n render,\n state,\n className,\n style,\n children: undefined,\n ref,\n props: rest,\n libraryProps: {\n type: \"checkbox\",\n // A Parent is not a value: it never posts and is never required.\n name: undefined,\n value: undefined,\n required: undefined,\n form: undefined,\n // Nothing to restore (it is not a value): without this, Firefox restores its `checked` on\n // reload and the mount read would take it for a click before hydration (design 8.1).\n autoComplete: \"off\",\n checked,\n defaultChecked: undefined,\n // Not a DOM attribute; the hook sets the property. Owned so that a `render` element's own\n // `indeterminate` prop (which react-dom would warn about) is stripped.\n ...({ indeterminate: undefined } as object),\n \"aria-checked\": undefined,\n disabled: disabledProp,\n \"data-checked\": dataAttr(checked),\n \"data-indeterminate\": dataAttr(indeterminate),\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n onChange: (event: ChangeEvent<HTMLInputElement>) => {\n if (disabled) return;\n const nativeEvent = event.nativeEvent;\n guardCheckableChange(\n nativeEvent,\n () => ctx.apply(cyclePatch(), nativeEvent),\n \"CheckboxGroup.Parent\",\n );\n },\n },\n });\n\n return useTransitionBoundary(\"CheckboxGroup.Parent\", transition, element);\n}\n\nCheckboxGroupParent.displayName = \"CheckboxGroupParent\";\n"],"mappings":";;;;;;;;;;AA4EA,MAAM,+BAA+B,CAAC;;AAGtC,SAAS,OAAO,QAA2B,KAA0B;CACnE,IAAI,QAAQ;CACZ,KAAK,MAAM,KAAK,QAAQ,IAAI,IAAI,IAAI,CAAC,GAAG,SAAS;CACjD,MAAM,UAAU,OAAO,SAAS,KAAK,UAAU,OAAO;CACtD,OAAO;EAAE;EAAS,eAAe,QAAQ,KAAK,CAAC;CAAQ;AACzD;;;;;;;;;;;;;;;AAgBA,SAAgB,oBAAoB,EAClC,QACA,UAAU,eAAe,OACzB,YACA,WACA,OACA,QACA,GAAG,QACwB;CAC3B,MAAM,MAAM,wBAAwB,sBAAsB;CAK1D,MAAM,YAAY,qBAChB,wBACM,aACA,IACR;CACA,MAAM,EAAE,kBAAkB;CAC1B,MAAM,YAAY,cACT,YAAY,SAAS,cAAc,QAAQ,aAAa,GAC/D;EAAC;EAAW;EAAQ;CAAa,CACnC;CACA,MAAM,EAAE,SAAS,kBAAkB,OAAO,WAAW,IAAI,UAAU;CACnE,MAAM,UAAU,IAAI,WAAW,OAAO,MAAM,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,IAAI,UAAU,IAAI,CAAC,CAAC;CAChG,MAAM,WAAW,IAAI,YAAY;CAKjC,MAAM,SAAS,OAAiC,IAAI;CACpD,MAAM,EAAE,cAAc;CACtB,sBAAsB;EACpB,MAAM,cAAc,UAAU,QAAQ,MAAM,UAAU,IAAI,CAAC,CAAC;EAC5D,IAAI,YAAY,SAAS,KAAK,YAAY,SAAS,UAAU,QAC3D,OAAO,UAAU;CAErB,GAAG,CAAC,WAAW,SAAS,CAAC;CAEzB,MAAM,WAAW,iBAAiB;EAChC,MAAM;EACN,WAAW;EACX;EACA;EACA,OAAO;EACP,gBAAgB,OAAO;GACrB,IAAI,OAAO,MAAM;IAIf,IAAI,GAAG,YAAY,SAAS,IAAI,aAAa,QAAQ,GAAG,OAAO;IAC/D,aAAa,IAAI,gBAAgB,OAAO;IACxC,aAAa,IAAI,sBAAsB,aAAa;IACpD,aAAa,IAAI,gBAAgB,OAAO;IACxC,aAAa,IAAI,iBAAiB,QAAQ;GAC5C;GACA,IAAI,cAAc,EAAE;EACtB;EACA,gBACE,IAAI,iBAAiB,KAAA,IAAY,KAAA,IAAY,OAAO,WAAW,IAAI,YAAY,CAAC,CAAC;CACrF,CAAC;CAOD,MAAM,OAAO,OAAgC,IAAI;CACjD,MAAM,MAAM,aACT,OAAyB;EACxB,KAAK,UAAU;EACf,MAAM,UAAU,SAAS,EAAE;EAC3B,aAAa;GACX,KAAK,UAAU;GACf,IAAI,OAAO,YAAY,YAAY,QAAQ;EAC7C;CACF,GACA,CAAC,QAAQ,CACX;CACA,aAAa,YAAY;EACvB,MAAM,KAAK,KAAK;EAChB,IAAI,OAAO,QAAQ,GAAG,YAAY,SAAS,GAAG,UAAU;CAC1D,CAAC;;CAGD,MAAM,mBAAuC;EAC3C,IAAI,SAAS,OAAO;GAAE,OAAO,CAAC;GAAG,SAAS,CAAC,GAAG,SAAS;EAAE;EACzD,IAAI,eACF,OAAO;GAAE,OAAO,UAAU,QAAQ,MAAM,CAAC,IAAI,WAAW,IAAI,CAAC,CAAC;GAAG,SAAS,CAAC;EAAE;EAE/E,MAAM,UAAU,OAAO,SAAS,QAAQ,MAAM,UAAU,SAAS,CAAC,CAAC,KAAK,CAAC;EACzE,OAAO;GAAE,OAAO,QAAQ,SAAS,IAAI,UAAU,CAAC,GAAG,SAAS;GAAG,SAAS,CAAC;EAAE;CAC7E;CAIA,MAAM,UAAU,UAAoE;EAClF,gBAAgB;EAChB;EACA,OAAA;GALwC;GAAQ;GAAS;GAAe;GAAS;EAK7E;EACJ;EACA;EACA,UAAU,KAAA;EACV;EACA,OAAO;EACP,cAAc;GACZ,MAAM;GAEN,MAAM,KAAA;GACN,OAAO,KAAA;GACP,UAAU,KAAA;GACV,MAAM,KAAA;GAGN,cAAc;GACd;GACA,gBAAgB,KAAA;GAGV,eAAe,KAAA;GACrB,gBAAgB,KAAA;GAChB,UAAU;GACV,gBAAgB,SAAS,OAAO;GAChC,sBAAsB,SAAS,aAAa;GAC5C,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;GAClC,WAAW,UAAyC;IAClD,IAAI,UAAU;IACd,MAAM,cAAc,MAAM;IAC1B,qBACE,mBACM,IAAI,MAAM,WAAW,GAAG,WAAW,GACzC,sBACF;GACF;EACF;CACF,CAAC;CAED,OAAO,sBAAsB,wBAAwB,YAAY,OAAO;AAC1E;AAEA,oBAAoB,cAAc"}
1
+ {"version":3,"file":"checkbox-group-parent.mjs","names":[],"sources":["../../src/checkbox-group/checkbox-group-parent.tsx"],"sourcesContent":["\"use client\";\nimport { useCallback, useLayoutEffect, useMemo, useRef } from \"react\";\nimport type { ChangeEvent, ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useHydratedMount } from \"../internal/use-hydrated-mount.js\";\nimport { guardCheckableChange, useNativeChecked } from \"../internal/form/use-native-checked.js\";\nimport { useFormReset } from \"../internal/form/use-form-reset.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { enabledValues, useCheckboxGroupContext } from \"./checkbox-group-context.js\";\nimport type { CheckboxGroupPatch } from \"./checkbox-group-context.js\";\nimport { syncPresences } from \"../internal/form/sync-presence.js\";\n\n/**\n * State of `CheckboxGroup.Parent`, passed to the function forms of `className`, `style` and\n * `render`.\n */\nexport interface CheckboxGroupParentState {\n /** The Parent's `values` prop: the Items it checks and unchecks. */\n readonly values: readonly string[];\n /** Every value in `values` is optimistically checked (`false` when `values` is empty). */\n readonly checked: boolean;\n /**\n * Some but not all of `values` are optimistically checked. Never true together with\n * `checked`. Not suspended while pending (it is derived from optimistic state).\n */\n readonly indeterminate: boolean;\n /** The Root is pending and at least one of `values` differs between optimistic and committed. */\n readonly pending: boolean;\n /** Disabled by its own prop or by `Root disabled`. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `CheckboxGroup.Parent`.\n *\n * @see https://ui.funstack.work/components/checkbox-group\n */\nexport interface CheckboxGroupParentProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"name\"\n | \"value\"\n | \"checked\"\n | \"defaultChecked\"\n | \"defaultValue\"\n | \"form\"\n | \"required\"\n | \"autoComplete\"\n | \"aria-checked\"\n | \"onChange\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * The Item values this Parent controls (usually every Item of the group). Its checked and\n * mixed states are derived from them; its click checks or unchecks all of them. Values with\n * no Item are still added to / removed from the group's value.\n *\n * Values whose Items are disabled (their own `disabled` prop) are left alone: the click does\n * not change them and the derivation ignores them, so the Parent shows checked when every\n * enabled Item is. When every value has only disabled Items, the Parent acts on all of them\n * (disable the Parent to make it inert). Before hydration the server-rendered state counts\n * disabled Items too; it settles when the Items hydrate.\n */\n values: string[];\n /**\n * Native `disabled`: unfocusable, never dispatches.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Forwarded to the Parent's `<ViewTransition default>`. Default: no boundary. Fires only on the\n * commit that settles the action (or rolls it back), never on the optimistic flip; animate the\n * flip itself with CSS on `:checked` / `:indeterminate`.\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, CheckboxGroupParentState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, CheckboxGroupParentState>;\n /** Replace the rendered element. Must keep an `<input>`; the library sets `type=\"checkbox\"`. */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, CheckboxGroupParentState>;\n}\n\n/** `checked` / `indeterminate` of a Parent over `values` against `set` (design 6.1). */\nfunction derive(values: readonly string[], set: ReadonlySet<string>) {\n let inSet = 0;\n for (const v of values) if (set.has(v)) inSet += 1;\n const checked = values.length > 0 && inSet === values.length;\n return { checked, indeterminate: inSet > 0 && !checked };\n}\n\n/**\n * The mixed-state \"select all\" checkbox of a group (WAI-ARIA APG \"Checkbox (Mixed-State)\"):\n * `<input type=\"checkbox\">` checked when every value in `values` is in the group's optimistic\n * set, mixed (`el.indeterminate`, `data-indeterminate`) when some are. A click checks every value\n * when mixed, unchecks every value when checked, and from unchecked restores the last partial\n * combination of its values the group committed (seeded at mount), else checks every value. Each\n * click is one dispatch through the Root's `valueChangeAction`. Never submitted (no `name`).\n * \"Its values\" are those whose Items are enabled: disabled Items are left alone (see `values`).\n *\n * Owned keys (conventions 1.2): `type`, `name` (removed), `value` (removed), `checked`,\n * `defaultChecked`, `indeterminate` (stripped; the property is set), `required` (removed), `form`\n * (removed), `autoComplete` (`\"off\"`), `disabled`, `aria-checked` (removed), `data-checked`, `data-indeterminate`,\n * `data-pending`, `data-disabled`. `onChange` is merged.\n *\n * @see https://ui.funstack.work/components/checkbox-group\n */\nexport function CheckboxGroupParent({\n values,\n disabled: disabledProp = false,\n transition,\n className,\n style,\n render,\n ...rest\n}: CheckboxGroupParentProps) {\n const ctx = useCheckboxGroupContext(\"CheckboxGroup.Parent\");\n // The values the Parent acts on: `values` minus disabled Items (design 6.2). A hydration\n // render uses every value, as the server did (it cannot know which Items are disabled), so\n // that the DOM `checked` it hydrates can be compared with the derivation for the\n // pre-hydration report below, also when this Parent hydrates after the Items registered.\n const hydrating = useHydratedMount();\n const { disabledItems } = ctx;\n const effective = useMemo(\n () => (hydrating ? values : enabledValues(values, disabledItems)),\n [hydrating, values, disabledItems],\n );\n const { checked, indeterminate } = derive(effective, ctx.optimistic);\n const pending =\n ctx.state.pending && values.some((v) => ctx.optimistic.has(v) !== ctx.committed.has(v));\n const disabled = ctx.state.disabled || disabledProp;\n\n // The APG restore memory: the last partial combination of `values` the group committed\n // (design 6.2). Committed, not optimistic, so a partial state that only ever rolled back is\n // never restored. The first run seeds it from the mount-time value.\n const memory = useRef<readonly string[] | null>(null);\n const { committed } = ctx;\n useLayoutEffect(() => {\n const inCommitted = effective.filter((v) => committed.has(v));\n if (inCommitted.length > 0 && inCommitted.length < effective.length) {\n memory.current = inCommitted;\n }\n }, [committed, effective]);\n\n const inputRef = useNativeChecked({\n type: \"checkbox\",\n component: \"CheckboxGroup.Parent\",\n checked,\n indeterminate,\n group: true,\n onItemMounted: (el) => {\n if (el !== null) {\n // A click before hydration flipped the box (design 8.1): report it as the Parent's\n // semantic before the Root reads the group (which leaves disabled Items alone). Firefox's\n // form-state restoration cannot cause this: the Parent renders `autocomplete=\"off\"`.\n if (el.checked !== checked) ctx.reportParent(values, el.checked);\n syncPresences(el, {\n \"data-checked\": checked,\n \"data-indeterminate\": indeterminate,\n \"data-pending\": pending,\n \"data-disabled\": disabled,\n });\n }\n ctx.onItemMounted(el);\n },\n defaultChecked:\n ctx.defaultValue === undefined ? undefined : derive(effective, ctx.defaultValue).checked,\n });\n\n // A form reset sets the Parent's DOM `checked` to its `defaultChecked`, which in controlled\n // mode is React's mount-time value and can be stale (its `values` changed, it mounted after the\n // Items with another value). The Parent re-renders only if the Root dispatches; otherwise put\n // the derivation back (the Root's own microtask, queued after this one, may still dispatch,\n // and the re-render re-applies `checked`).\n const node = useRef<HTMLInputElement | null>(null);\n const ref = useCallback(\n (el: HTMLInputElement) => {\n node.current = el;\n const cleanup = inputRef(el);\n return () => {\n node.current = null;\n if (typeof cleanup === \"function\") cleanup();\n };\n },\n [inputRef],\n );\n useFormReset(node, () => {\n const el = node.current;\n if (el !== null && el.checked !== checked) el.checked = checked;\n });\n\n /** The click cycle of design 6.2. */\n const cyclePatch = (): CheckboxGroupPatch => {\n if (checked) return { added: [], removed: [...effective] };\n if (indeterminate) {\n return { added: effective.filter((v) => !ctx.optimistic.has(v)), removed: [] };\n }\n const restore = memory.current?.filter((v) => effective.includes(v)) ?? [];\n return { added: restore.length > 0 ? restore : [...effective], removed: [] };\n };\n\n const state: CheckboxGroupParentState = { values, checked, indeterminate, pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, CheckboxGroupParentState>({\n defaultElement: \"input\",\n render,\n state,\n className,\n style,\n children: undefined,\n ref,\n props: rest,\n libraryProps: {\n type: \"checkbox\",\n // A Parent is not a value: it never posts and is never required.\n name: undefined,\n value: undefined,\n required: undefined,\n form: undefined,\n // Nothing to restore (it is not a value): without this, Firefox restores its `checked` on\n // reload and the mount read would take it for a click before hydration (design 8.1).\n autoComplete: \"off\",\n checked,\n defaultChecked: undefined,\n // Not a DOM attribute; the hook sets the property. Owned so that a `render` element's own\n // `indeterminate` prop (which react-dom would warn about) is stripped.\n ...{ indeterminate: undefined },\n \"aria-checked\": undefined,\n disabled: disabledProp,\n \"data-checked\": dataAttr(checked),\n \"data-indeterminate\": dataAttr(indeterminate),\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n onChange: (event: ChangeEvent<HTMLInputElement>) => {\n if (disabled) return;\n const nativeEvent = event.nativeEvent;\n guardCheckableChange(\n nativeEvent,\n () => ctx.apply(cyclePatch(), nativeEvent),\n \"CheckboxGroup.Parent\",\n );\n },\n },\n });\n\n return useTransitionBoundary(\"CheckboxGroup.Parent\", transition, element);\n}\n\nCheckboxGroupParent.displayName = \"CheckboxGroupParent\";\n"],"mappings":";;;;;;;;;;;;AA6FA,SAAS,OAAO,QAA2B,KAA0B;CACnE,IAAI,QAAQ;CACZ,KAAK,MAAM,KAAK,QAAQ,IAAI,IAAI,IAAI,CAAC,GAAG,SAAS;CACjD,MAAM,UAAU,OAAO,SAAS,KAAK,UAAU,OAAO;CACtD,OAAO;EAAE;EAAS,eAAe,QAAQ,KAAK,CAAC;CAAQ;AACzD;;;;;;;;;;;;;;;;;AAkBA,SAAgB,oBAAoB,EAClC,QACA,UAAU,eAAe,OACzB,YACA,WACA,OACA,QACA,GAAG,QACwB;CAC3B,MAAM,MAAM,wBAAwB,sBAAsB;CAK1D,MAAM,YAAY,iBAAiB;CACnC,MAAM,EAAE,kBAAkB;CAC1B,MAAM,YAAY,cACT,YAAY,SAAS,cAAc,QAAQ,aAAa,GAC/D;EAAC;EAAW;EAAQ;CAAa,CACnC;CACA,MAAM,EAAE,SAAS,kBAAkB,OAAO,WAAW,IAAI,UAAU;CACnE,MAAM,UACJ,IAAI,MAAM,WAAW,OAAO,MAAM,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,IAAI,UAAU,IAAI,CAAC,CAAC;CACxF,MAAM,WAAW,IAAI,MAAM,YAAY;CAKvC,MAAM,SAAS,OAAiC,IAAI;CACpD,MAAM,EAAE,cAAc;CACtB,sBAAsB;EACpB,MAAM,cAAc,UAAU,QAAQ,MAAM,UAAU,IAAI,CAAC,CAAC;EAC5D,IAAI,YAAY,SAAS,KAAK,YAAY,SAAS,UAAU,QAC3D,OAAO,UAAU;CAErB,GAAG,CAAC,WAAW,SAAS,CAAC;CAEzB,MAAM,WAAW,iBAAiB;EAChC,MAAM;EACN,WAAW;EACX;EACA;EACA,OAAO;EACP,gBAAgB,OAAO;GACrB,IAAI,OAAO,MAAM;IAIf,IAAI,GAAG,YAAY,SAAS,IAAI,aAAa,QAAQ,GAAG,OAAO;IAC/D,cAAc,IAAI;KAChB,gBAAgB;KAChB,sBAAsB;KACtB,gBAAgB;KAChB,iBAAiB;IACnB,CAAC;GACH;GACA,IAAI,cAAc,EAAE;EACtB;EACA,gBACE,IAAI,iBAAiB,KAAA,IAAY,KAAA,IAAY,OAAO,WAAW,IAAI,YAAY,CAAC,CAAC;CACrF,CAAC;CAOD,MAAM,OAAO,OAAgC,IAAI;CACjD,MAAM,MAAM,aACT,OAAyB;EACxB,KAAK,UAAU;EACf,MAAM,UAAU,SAAS,EAAE;EAC3B,aAAa;GACX,KAAK,UAAU;GACf,IAAI,OAAO,YAAY,YAAY,QAAQ;EAC7C;CACF,GACA,CAAC,QAAQ,CACX;CACA,aAAa,YAAY;EACvB,MAAM,KAAK,KAAK;EAChB,IAAI,OAAO,QAAQ,GAAG,YAAY,SAAS,GAAG,UAAU;CAC1D,CAAC;;CAGD,MAAM,mBAAuC;EAC3C,IAAI,SAAS,OAAO;GAAE,OAAO,CAAC;GAAG,SAAS,CAAC,GAAG,SAAS;EAAE;EACzD,IAAI,eACF,OAAO;GAAE,OAAO,UAAU,QAAQ,MAAM,CAAC,IAAI,WAAW,IAAI,CAAC,CAAC;GAAG,SAAS,CAAC;EAAE;EAE/E,MAAM,UAAU,OAAO,SAAS,QAAQ,MAAM,UAAU,SAAS,CAAC,CAAC,KAAK,CAAC;EACzE,OAAO;GAAE,OAAO,QAAQ,SAAS,IAAI,UAAU,CAAC,GAAG,SAAS;GAAG,SAAS,CAAC;EAAE;CAC7E;CAIA,MAAM,UAAU,UAAoE;EAClF,gBAAgB;EAChB;EACA,OAAA;GALwC;GAAQ;GAAS;GAAe;GAAS;EAK7E;EACJ;EACA;EACA,UAAU,KAAA;EACV;EACA,OAAO;EACP,cAAc;GACZ,MAAM;GAEN,MAAM,KAAA;GACN,OAAO,KAAA;GACP,UAAU,KAAA;GACV,MAAM,KAAA;GAGN,cAAc;GACd;GACA,gBAAgB,KAAA;GAGX,eAAe,KAAA;GACpB,gBAAgB,KAAA;GAChB,UAAU;GACV,gBAAgB,SAAS,OAAO;GAChC,sBAAsB,SAAS,aAAa;GAC5C,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;GAClC,WAAW,UAAyC;IAClD,IAAI,UAAU;IACd,MAAM,cAAc,MAAM;IAC1B,qBACE,mBACM,IAAI,MAAM,WAAW,GAAG,WAAW,GACzC,sBACF;GACF;EACF;CACF,CAAC;CAED,OAAO,sBAAsB,wBAAwB,YAAY,OAAO;AAC1E;AAEA,oBAAoB,cAAc"}