@funstack/ui 0.1.0-alpha.18 → 0.1.0-alpha.19

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 (345) hide show
  1. package/dist/accordion/accordion-item.mjs +1 -1
  2. package/dist/accordion/accordion-panel.mjs +1 -1
  3. package/dist/accordion/accordion-root.d.mts.map +1 -1
  4. package/dist/accordion/accordion-root.mjs +30 -35
  5. package/dist/accordion/accordion-root.mjs.map +1 -1
  6. package/dist/accordion/accordion-trigger.mjs +1 -1
  7. package/dist/button/button.d.mts +11 -6
  8. package/dist/button/button.d.mts.map +1 -1
  9. package/dist/button/button.mjs +25 -14
  10. package/dist/button/button.mjs.map +1 -1
  11. package/dist/checkbox/checkbox.mjs +1 -1
  12. package/dist/checkbox/checkbox.mjs.map +1 -1
  13. package/dist/checkbox-group/checkbox-group-item.mjs +3 -3
  14. package/dist/checkbox-group/checkbox-group-item.mjs.map +1 -1
  15. package/dist/checkbox-group/checkbox-group-parent.mjs +3 -3
  16. package/dist/checkbox-group/checkbox-group-parent.mjs.map +1 -1
  17. package/dist/checkbox-group/checkbox-group-root.d.mts.map +1 -1
  18. package/dist/checkbox-group/checkbox-group-root.mjs +5 -5
  19. package/dist/checkbox-group/checkbox-group-root.mjs.map +1 -1
  20. package/dist/combobox/combobox-context.mjs.map +1 -1
  21. package/dist/combobox/combobox-input.mjs +2 -2
  22. package/dist/combobox/combobox-input.mjs.map +1 -1
  23. package/dist/combobox/combobox-keyboard.mjs +81 -0
  24. package/dist/combobox/combobox-keyboard.mjs.map +1 -0
  25. package/dist/combobox/combobox-popup.mjs +3 -3
  26. package/dist/combobox/combobox-popup.mjs.map +1 -1
  27. package/dist/combobox/combobox-root.d.mts.map +1 -1
  28. package/dist/combobox/combobox-root.mjs +44 -129
  29. package/dist/combobox/combobox-root.mjs.map +1 -1
  30. package/dist/combobox/combobox-trigger.d.mts.map +1 -1
  31. package/dist/combobox/combobox-trigger.mjs +2 -9
  32. package/dist/combobox/combobox-trigger.mjs.map +1 -1
  33. package/dist/combobox/use-active-option.mjs +49 -0
  34. package/dist/combobox/use-active-option.mjs.map +1 -0
  35. package/dist/combobox/use-combobox-form.mjs +3 -5
  36. package/dist/combobox/use-combobox-form.mjs.map +1 -1
  37. package/dist/combobox/use-combobox-text.mjs +43 -0
  38. package/dist/combobox/use-combobox-text.mjs.map +1 -0
  39. package/dist/combobox/use-option-registry.mjs +7 -17
  40. package/dist/combobox/use-option-registry.mjs.map +1 -1
  41. package/dist/dialog/dialog-close.mjs +2 -2
  42. package/dist/dialog/dialog-close.mjs.map +1 -1
  43. package/dist/dialog/dialog-context.mjs.map +1 -1
  44. package/dist/dialog/dialog-dismiss.mjs +108 -0
  45. package/dist/dialog/dialog-dismiss.mjs.map +1 -0
  46. package/dist/dialog/dialog-form.mjs +4 -4
  47. package/dist/dialog/dialog-form.mjs.map +1 -1
  48. package/dist/dialog/dialog-popup.d.mts.map +1 -1
  49. package/dist/dialog/dialog-popup.mjs +73 -169
  50. package/dist/dialog/dialog-popup.mjs.map +1 -1
  51. package/dist/dialog/dialog-root.d.mts.map +1 -1
  52. package/dist/dialog/dialog-root.mjs +4 -3
  53. package/dist/dialog/dialog-root.mjs.map +1 -1
  54. package/dist/dialog/dialog-trigger.mjs +11 -8
  55. package/dist/dialog/dialog-trigger.mjs.map +1 -1
  56. package/dist/docs/components/button.md +3 -3
  57. package/dist/docs/components/dialog.md +3 -3
  58. package/dist/docs/components/field.md +4 -3
  59. package/dist/docs/components/popover.md +3 -3
  60. package/dist/docs/components/toast.md +8 -5
  61. package/dist/docs/roadmap.md +9 -1
  62. package/dist/field/field-control.d.mts +1 -1
  63. package/dist/field/field-control.mjs +2 -2
  64. package/dist/field/field-control.mjs.map +1 -1
  65. package/dist/field/field-description.d.mts +1 -1
  66. package/dist/field/field-description.mjs +1 -1
  67. package/dist/field/field-description.mjs.map +1 -1
  68. package/dist/field/field-error.d.mts +1 -1
  69. package/dist/field/field-error.mjs +1 -1
  70. package/dist/field/field-error.mjs.map +1 -1
  71. package/dist/field/field-label.d.mts +1 -1
  72. package/dist/field/field-label.mjs +1 -1
  73. package/dist/field/field-label.mjs.map +1 -1
  74. package/dist/field/field-root.d.mts +2 -2
  75. package/dist/field/field-root.d.mts.map +1 -1
  76. package/dist/field/field-root.mjs +4 -4
  77. package/dist/field/field-root.mjs.map +1 -1
  78. package/dist/field/index.d.mts +2 -2
  79. package/dist/form/form-root.d.mts +1 -1
  80. package/dist/form/form-root.d.mts.map +1 -1
  81. package/dist/form/form-root.mjs +14 -4
  82. package/dist/form/form-root.mjs.map +1 -1
  83. package/dist/form/form-submit.d.mts +7 -3
  84. package/dist/form/form-submit.d.mts.map +1 -1
  85. package/dist/form/form-submit.mjs +11 -7
  86. package/dist/form/form-submit.mjs.map +1 -1
  87. package/dist/form/index.d.mts +1 -1
  88. package/dist/index.d.mts +2 -2
  89. package/dist/internal/{action-details.mjs → action/action-details.mjs} +1 -1
  90. package/dist/internal/action/action-details.mjs.map +1 -0
  91. package/dist/internal/{call-urgent-handler.mjs → action/call-urgent-handler.mjs} +5 -10
  92. package/dist/internal/action/call-urgent-handler.mjs.map +1 -0
  93. package/dist/internal/{report-dropped.mjs → action/report-dropped.mjs} +3 -21
  94. package/dist/internal/action/report-dropped.mjs.map +1 -0
  95. package/dist/internal/{use-action-trigger.mjs → action/use-action-trigger.mjs} +3 -2
  96. package/dist/internal/action/use-action-trigger.mjs.map +1 -0
  97. package/dist/internal/action/use-connected.mjs +24 -0
  98. package/dist/internal/action/use-connected.mjs.map +1 -0
  99. package/dist/internal/{use-controllable-action.mjs → action/use-controllable-action.mjs} +13 -28
  100. package/dist/internal/action/use-controllable-action.mjs.map +1 -0
  101. package/dist/internal/action/use-pure-trigger.mjs +34 -0
  102. package/dist/internal/action/use-pure-trigger.mjs.map +1 -0
  103. package/dist/internal/action/use-step-commit.mjs +147 -0
  104. package/dist/internal/action/use-step-commit.mjs.map +1 -0
  105. package/dist/internal/{field-context.d.mts → form/field-context.d.mts} +1 -1
  106. package/dist/internal/form/field-context.d.mts.map +1 -0
  107. package/dist/internal/{field-context.mjs → form/field-context.mjs} +2 -2
  108. package/dist/internal/form/field-context.mjs.map +1 -0
  109. package/dist/internal/{focus-first-invalid.mjs → form/focus-first-invalid.mjs} +3 -3
  110. package/dist/internal/form/focus-first-invalid.mjs.map +1 -0
  111. package/dist/internal/{form-status-watcher.mjs → form/form-status-watcher.mjs} +1 -1
  112. package/dist/internal/form/form-status-watcher.mjs.map +1 -0
  113. package/dist/internal/{group-member.mjs → form/group-member.mjs} +2 -2
  114. package/dist/internal/form/group-member.mjs.map +1 -0
  115. package/dist/internal/{sync-presence.mjs → form/sync-presence.mjs} +1 -1
  116. package/dist/internal/form/sync-presence.mjs.map +1 -0
  117. package/dist/internal/{use-checkable-input.mjs → form/use-checkable-input.mjs} +5 -5
  118. package/dist/internal/form/use-checkable-input.mjs.map +1 -0
  119. package/dist/internal/{use-field-control.mjs → form/use-field-control.mjs} +3 -3
  120. package/dist/internal/form/use-field-control.mjs.map +1 -0
  121. package/dist/internal/{use-fieldset-group.mjs → form/use-fieldset-group.mjs} +3 -3
  122. package/dist/internal/form/use-fieldset-group.mjs.map +1 -0
  123. package/dist/internal/{use-form-owner-event.mjs → form/use-form-owner-event.mjs} +1 -1
  124. package/dist/internal/form/use-form-owner-event.mjs.map +1 -0
  125. package/dist/internal/{use-form-reset.mjs → form/use-form-reset.mjs} +15 -3
  126. package/dist/internal/form/use-form-reset.mjs.map +1 -0
  127. package/dist/internal/{use-native-checked.mjs → form/use-native-checked.mjs} +5 -4
  128. package/dist/internal/form/use-native-checked.mjs.map +1 -0
  129. package/dist/internal/{use-native-group-reconciliation.mjs → form/use-native-group-reconciliation.mjs} +2 -2
  130. package/dist/internal/form/use-native-group-reconciliation.mjs.map +1 -0
  131. package/dist/internal/{use-native-select-value.mjs → form/use-native-select-value.mjs} +2 -2
  132. package/dist/internal/form/use-native-select-value.mjs.map +1 -0
  133. package/dist/internal/{validity.d.mts → form/validity.d.mts} +1 -1
  134. package/dist/internal/form/validity.d.mts.map +1 -0
  135. package/dist/internal/{validity.mjs → form/validity.mjs} +1 -1
  136. package/dist/internal/form/validity.mjs.map +1 -0
  137. package/dist/internal/{anchor-position.d.mts → overlay/anchor-position.d.mts} +1 -1
  138. package/dist/internal/overlay/anchor-position.d.mts.map +1 -0
  139. package/dist/internal/{anchor-position.mjs → overlay/anchor-position.mjs} +1 -1
  140. package/dist/internal/overlay/anchor-position.mjs.map +1 -0
  141. package/dist/internal/{content-focus-probe.mjs → overlay/content-focus-probe.mjs} +1 -1
  142. package/dist/internal/overlay/content-focus-probe.mjs.map +1 -0
  143. package/dist/internal/{css-transition-cut.mjs → overlay/css-transition-cut.mjs} +1 -1
  144. package/dist/internal/overlay/css-transition-cut.mjs.map +1 -0
  145. package/dist/internal/{focus-visible.mjs → overlay/focus-visible.mjs} +1 -1
  146. package/dist/internal/overlay/focus-visible.mjs.map +1 -0
  147. package/dist/internal/{invokers.mjs → overlay/invokers.mjs} +1 -1
  148. package/dist/internal/overlay/invokers.mjs.map +1 -0
  149. package/dist/internal/{modal-registry.mjs → overlay/modal-registry.mjs} +1 -1
  150. package/dist/internal/overlay/modal-registry.mjs.map +1 -0
  151. package/dist/internal/{overlay-popup.mjs → overlay/overlay-popup.mjs} +3 -3
  152. package/dist/internal/overlay/overlay-popup.mjs.map +1 -0
  153. package/dist/internal/overlay/overlay-show.mjs +73 -0
  154. package/dist/internal/overlay/overlay-show.mjs.map +1 -0
  155. package/dist/internal/{popover-open.mjs → overlay/popover-open.mjs} +1 -1
  156. package/dist/internal/overlay/popover-open.mjs.map +1 -0
  157. package/dist/internal/{trigger-ref.mjs → overlay/trigger-ref.mjs} +1 -1
  158. package/dist/internal/overlay/trigger-ref.mjs.map +1 -0
  159. package/dist/internal/overlay/use-apply-open-state.mjs +44 -0
  160. package/dist/internal/overlay/use-apply-open-state.mjs.map +1 -0
  161. package/dist/internal/{use-exit-animation.mjs → overlay/use-exit-animation.mjs} +2 -2
  162. package/dist/internal/overlay/use-exit-animation.mjs.map +1 -0
  163. package/dist/internal/{use-interest-dismiss.mjs → overlay/use-interest-dismiss.mjs} +1 -1
  164. package/dist/internal/overlay/use-interest-dismiss.mjs.map +1 -0
  165. package/dist/internal/{use-modal-registration.mjs → overlay/use-modal-registration.mjs} +1 -1
  166. package/dist/internal/overlay/use-modal-registration.mjs.map +1 -0
  167. package/dist/internal/{use-overlay-close.mjs → overlay/use-overlay-close.mjs} +14 -13
  168. package/dist/internal/overlay/use-overlay-close.mjs.map +1 -0
  169. package/dist/internal/overlay/use-overlay-root.d.mts +2 -0
  170. package/dist/internal/{use-overlay-root.mjs → overlay/use-overlay-root.mjs} +44 -28
  171. package/dist/internal/overlay/use-overlay-root.mjs.map +1 -0
  172. package/dist/internal/{use-popover-popup.mjs → overlay/use-popover-popup.mjs} +74 -66
  173. package/dist/internal/overlay/use-popover-popup.mjs.map +1 -0
  174. package/dist/internal/{use-popover-trigger.d.mts → overlay/use-popover-trigger.d.mts} +3 -3
  175. package/dist/internal/overlay/use-popover-trigger.d.mts.map +1 -0
  176. package/dist/internal/{use-popover-trigger.mjs → overlay/use-popover-trigger.mjs} +47 -26
  177. package/dist/internal/overlay/use-popover-trigger.mjs.map +1 -0
  178. package/dist/internal/{use-resolved-placement.mjs → overlay/use-resolved-placement.mjs} +2 -2
  179. package/dist/internal/overlay/use-resolved-placement.mjs.map +1 -0
  180. package/dist/internal/render-element.mjs +47 -9
  181. package/dist/internal/render-element.mjs.map +1 -1
  182. package/dist/internal/transition-boundary.mjs +4 -8
  183. package/dist/internal/transition-boundary.mjs.map +1 -1
  184. package/dist/internal/use-mount-fixed.mjs +22 -0
  185. package/dist/internal/use-mount-fixed.mjs.map +1 -0
  186. package/dist/internal/use-register-count.mjs +4 -1
  187. package/dist/internal/use-register-count.mjs.map +1 -1
  188. package/dist/internal/use-render.mjs +2 -2
  189. package/dist/internal/use-render.mjs.map +1 -1
  190. package/dist/internal/use-roving-focus.mjs.map +1 -1
  191. package/dist/menu/menu-checkbox-item.mjs +2 -2
  192. package/dist/menu/menu-checkbox-item.mjs.map +1 -1
  193. package/dist/menu/menu-context.d.mts +1 -1
  194. package/dist/menu/menu-context.mjs.map +1 -1
  195. package/dist/menu/menu-gestures.mjs +1 -1
  196. package/dist/menu/menu-gestures.mjs.map +1 -1
  197. package/dist/menu/menu-item.d.mts.map +1 -1
  198. package/dist/menu/menu-item.mjs +9 -10
  199. package/dist/menu/menu-item.mjs.map +1 -1
  200. package/dist/menu/menu-outside.mjs +1 -1
  201. package/dist/menu/menu-outside.mjs.map +1 -1
  202. package/dist/menu/menu-popup.d.mts +1 -1
  203. package/dist/menu/menu-popup.d.mts.map +1 -1
  204. package/dist/menu/menu-popup.mjs +10 -6
  205. package/dist/menu/menu-popup.mjs.map +1 -1
  206. package/dist/menu/menu-radio-group.mjs +2 -2
  207. package/dist/menu/menu-radio-group.mjs.map +1 -1
  208. package/dist/menu/menu-root.mjs +2 -2
  209. package/dist/menu/menu-root.mjs.map +1 -1
  210. package/dist/menu/menu-submenu-trigger.mjs +3 -3
  211. package/dist/menu/menu-submenu-trigger.mjs.map +1 -1
  212. package/dist/menu/menu-trigger.d.mts +1 -1
  213. package/dist/menu/menu-trigger.mjs +3 -3
  214. package/dist/menu/menu-trigger.mjs.map +1 -1
  215. package/dist/number-field/number-field-input.mjs +1 -1
  216. package/dist/number-field/number-field-input.mjs.map +1 -1
  217. package/dist/number-field/number-field-root.d.mts.map +1 -1
  218. package/dist/number-field/number-field-root.mjs +43 -107
  219. package/dist/number-field/number-field-root.mjs.map +1 -1
  220. package/dist/popover/popover-close.mjs +3 -3
  221. package/dist/popover/popover-close.mjs.map +1 -1
  222. package/dist/popover/popover-context.mjs.map +1 -1
  223. package/dist/popover/popover-popup.d.mts +1 -1
  224. package/dist/popover/popover-popup.mjs +3 -3
  225. package/dist/popover/popover-popup.mjs.map +1 -1
  226. package/dist/popover/popover-root.mjs +2 -2
  227. package/dist/popover/popover-root.mjs.map +1 -1
  228. package/dist/popover/popover-trigger.d.mts +1 -1
  229. package/dist/popover/popover-trigger.mjs +1 -1
  230. package/dist/popover/popover-trigger.mjs.map +1 -1
  231. package/dist/radio-group/radio-group-item.mjs +3 -3
  232. package/dist/radio-group/radio-group-item.mjs.map +1 -1
  233. package/dist/radio-group/radio-group-root.d.mts.map +1 -1
  234. package/dist/radio-group/radio-group-root.mjs +5 -5
  235. package/dist/radio-group/radio-group-root.mjs.map +1 -1
  236. package/dist/select/select-group-label.d.mts.map +1 -1
  237. package/dist/select/select-group-label.mjs +3 -1
  238. package/dist/select/select-group-label.mjs.map +1 -1
  239. package/dist/select/select-option.mjs +1 -1
  240. package/dist/select/select-option.mjs.map +1 -1
  241. package/dist/select/select-root.d.mts.map +1 -1
  242. package/dist/select/select-root.mjs +7 -7
  243. package/dist/select/select-root.mjs.map +1 -1
  244. package/dist/select/select-trigger.d.mts.map +1 -1
  245. package/dist/select/select-trigger.mjs +3 -1
  246. package/dist/select/select-trigger.mjs.map +1 -1
  247. package/dist/select/select-value.mjs +3 -6
  248. package/dist/select/select-value.mjs.map +1 -1
  249. package/dist/slider/slider-root.d.mts.map +1 -1
  250. package/dist/slider/slider-root.mjs +38 -104
  251. package/dist/slider/slider-root.mjs.map +1 -1
  252. package/dist/slider/use-thumb-registry.mjs.map +1 -1
  253. package/dist/switch/switch.mjs +1 -1
  254. package/dist/switch/switch.mjs.map +1 -1
  255. package/dist/tabs/tabs-panel.mjs +1 -1
  256. package/dist/tabs/tabs-panel.mjs.map +1 -1
  257. package/dist/tabs/tabs-root.d.mts.map +1 -1
  258. package/dist/tabs/tabs-root.mjs +4 -4
  259. package/dist/tabs/tabs-root.mjs.map +1 -1
  260. package/dist/{internal → tabs}/use-until-found.mjs +1 -1
  261. package/dist/tabs/use-until-found.mjs.map +1 -0
  262. package/dist/toast/toast-action.d.mts +13 -3
  263. package/dist/toast/toast-action.d.mts.map +1 -1
  264. package/dist/toast/toast-action.mjs +23 -13
  265. package/dist/toast/toast-action.mjs.map +1 -1
  266. package/dist/toast/toast-close.d.mts +13 -2
  267. package/dist/toast/toast-close.d.mts.map +1 -1
  268. package/dist/toast/toast-close.mjs +16 -6
  269. package/dist/toast/toast-close.mjs.map +1 -1
  270. package/dist/toast/toast-root.mjs +1 -1
  271. package/dist/toast/toast-root.mjs.map +1 -1
  272. package/dist/toast/toast-viewport.d.mts.map +1 -1
  273. package/dist/toast/toast-viewport.mjs +48 -143
  274. package/dist/toast/toast-viewport.mjs.map +1 -1
  275. package/dist/toast/use-modal-portal-host.mjs +1 -1
  276. package/dist/toast/use-modal-portal-host.mjs.map +1 -1
  277. package/dist/toast/use-toast-announcements.mjs +46 -0
  278. package/dist/toast/use-toast-announcements.mjs.map +1 -0
  279. package/dist/toast/use-toast-focus.mjs +75 -0
  280. package/dist/toast/use-toast-focus.mjs.map +1 -0
  281. package/dist/toast/use-toast-pauses.mjs +58 -0
  282. package/dist/toast/use-toast-pauses.mjs.map +1 -0
  283. package/dist/toggle/toggle.mjs +2 -2
  284. package/dist/toggle/toggle.mjs.map +1 -1
  285. package/dist/toggle-group/toggle-group-root.d.mts.map +1 -1
  286. package/dist/toggle-group/toggle-group-root.mjs +5 -5
  287. package/dist/toggle-group/toggle-group-root.mjs.map +1 -1
  288. package/dist/tooltip/tooltip-context.d.mts +1 -1
  289. package/dist/tooltip/tooltip-context.mjs.map +1 -1
  290. package/dist/tooltip/tooltip-popup.mjs +1 -1
  291. package/dist/tooltip/tooltip-popup.mjs.map +1 -1
  292. package/dist/tooltip/tooltip-root.d.mts.map +1 -1
  293. package/dist/tooltip/tooltip-root.mjs +9 -4
  294. package/dist/tooltip/tooltip-root.mjs.map +1 -1
  295. package/dist/tooltip/tooltip-trigger.mjs +1 -1
  296. package/dist/tooltip/tooltip-trigger.mjs.map +1 -1
  297. package/dist/{internal → tooltip}/tooltip-warm.mjs +1 -1
  298. package/dist/tooltip/tooltip-warm.mjs.map +1 -0
  299. package/dist/tooltip/use-tooltip-interaction.mjs +2 -2
  300. package/dist/tooltip/use-tooltip-interaction.mjs.map +1 -1
  301. package/package.json +1 -1
  302. package/skills/funstack-ui-knowledge/SKILL.md +1 -1
  303. package/dist/internal/action-details.mjs.map +0 -1
  304. package/dist/internal/anchor-position.d.mts.map +0 -1
  305. package/dist/internal/anchor-position.mjs.map +0 -1
  306. package/dist/internal/call-urgent-handler.mjs.map +0 -1
  307. package/dist/internal/content-focus-probe.mjs.map +0 -1
  308. package/dist/internal/css-transition-cut.mjs.map +0 -1
  309. package/dist/internal/field-context.d.mts.map +0 -1
  310. package/dist/internal/field-context.mjs.map +0 -1
  311. package/dist/internal/focus-first-invalid.mjs.map +0 -1
  312. package/dist/internal/focus-visible.mjs.map +0 -1
  313. package/dist/internal/form-status-watcher.mjs.map +0 -1
  314. package/dist/internal/group-member.mjs.map +0 -1
  315. package/dist/internal/invokers.mjs.map +0 -1
  316. package/dist/internal/modal-registry.mjs.map +0 -1
  317. package/dist/internal/overlay-popup.mjs.map +0 -1
  318. package/dist/internal/popover-open.mjs.map +0 -1
  319. package/dist/internal/report-dropped.mjs.map +0 -1
  320. package/dist/internal/sync-presence.mjs.map +0 -1
  321. package/dist/internal/tooltip-warm.mjs.map +0 -1
  322. package/dist/internal/trigger-ref.mjs.map +0 -1
  323. package/dist/internal/use-action-trigger.mjs.map +0 -1
  324. package/dist/internal/use-checkable-input.mjs.map +0 -1
  325. package/dist/internal/use-controllable-action.mjs.map +0 -1
  326. package/dist/internal/use-exit-animation.mjs.map +0 -1
  327. package/dist/internal/use-field-control.mjs.map +0 -1
  328. package/dist/internal/use-fieldset-group.mjs.map +0 -1
  329. package/dist/internal/use-form-owner-event.mjs.map +0 -1
  330. package/dist/internal/use-form-reset.mjs.map +0 -1
  331. package/dist/internal/use-interest-dismiss.mjs.map +0 -1
  332. package/dist/internal/use-modal-registration.mjs.map +0 -1
  333. package/dist/internal/use-native-checked.mjs.map +0 -1
  334. package/dist/internal/use-native-group-reconciliation.mjs.map +0 -1
  335. package/dist/internal/use-native-select-value.mjs.map +0 -1
  336. package/dist/internal/use-overlay-close.mjs.map +0 -1
  337. package/dist/internal/use-overlay-root.d.mts +0 -2
  338. package/dist/internal/use-overlay-root.mjs.map +0 -1
  339. package/dist/internal/use-popover-popup.mjs.map +0 -1
  340. package/dist/internal/use-popover-trigger.d.mts.map +0 -1
  341. package/dist/internal/use-popover-trigger.mjs.map +0 -1
  342. package/dist/internal/use-resolved-placement.mjs.map +0 -1
  343. package/dist/internal/use-until-found.mjs.map +0 -1
  344. package/dist/internal/validity.d.mts.map +0 -1
  345. package/dist/internal/validity.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { RenderProp, StateValue } from "../internal/types.mjs";
2
- import { PopoverTriggerHookState } from "../internal/use-popover-trigger.mjs";
2
+ import { PopoverTriggerHookState } from "../internal/overlay/use-popover-trigger.mjs";
3
3
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
4
4
  //#region src/popover/popover-trigger.d.ts
5
5
  /**
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { useRender } from "../internal/use-render.mjs";
3
3
  import { usePopoverContext } from "./popover-context.mjs";
4
- import { usePopoverTrigger } from "../internal/use-popover-trigger.mjs";
4
+ import { usePopoverTrigger } from "../internal/overlay/use-popover-trigger.mjs";
5
5
  //#region src/popover/popover-trigger.tsx
6
6
  /**
7
7
  * The toggle: `<button type="button" popovertarget>`, with no `aria-expanded`: the browser exposes
@@ -1 +1 @@
1
- {"version":3,"file":"popover-trigger.mjs","names":[],"sources":["../../src/popover/popover-trigger.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { usePopoverTrigger } from \"../internal/use-popover-trigger.js\";\nimport type { PopoverTriggerHookState } from \"../internal/use-popover-trigger.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { usePopoverContext } from \"./popover-context.js\";\n\n/**\n * State of `Popover.Trigger`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport type PopoverTriggerState = PopoverTriggerHookState;\n\n/**\n * Props of `Popover.Trigger`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport interface PopoverTriggerProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n | \"onClick\"\n | \"aria-expanded\"\n | \"commandfor\"\n | \"command\"\n | \"popoverTarget\"\n | \"popoverTargetAction\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * Never dispatches. Native `disabled` on a `<button>` (no longer an invoker); in library mode\n * with a link or component `render`, `aria-disabled=\"true\"` instead: the element stays\n * focusable.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, PopoverTriggerState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, PopoverTriggerState>;\n /** Rendered from optimistic state; must not suspend. */\n children?: StateValue<ReactNode, PopoverTriggerState>;\n /**\n * Should render a `<button>`; another element works only in library mode (click handler), and\n * a press on it while the popup is open is a light dismiss rather than the awaited close.\n */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, PopoverTriggerState>;\n}\n\n/**\n * The toggle: `<button type=\"button\" popovertarget>`, with no `aria-expanded`: the browser exposes\n * the popover's state on its invoker. In JS-free mode the browser toggles the popover and the\n * Popup keeps `data-open` current. In library mode the click is cancelled (so the toggle does not\n * run) and dispatched through the Root's transition: an open, or a library-owned close while open.\n * The button shows optimistic `data-open` and `data-pending` until the change has landed; a\n * non-button `render` renders `aria-expanded` from the shown popup (in the top layer).\n *\n * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `aria-disabled`\n * (library mode, link or component `render`), `popoverTarget`, `aria-expanded`, `onClick`\n * (library mode), `data-open`, `data-pending`, `data-disabled`; `commandfor`, `command` and\n * `popoverTargetAction` (never written; omitted from the props type). `aria-haspopup` and\n * `aria-controls` pass through.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport function PopoverTrigger({\n disabled = false,\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverTriggerProps) {\n const ctx = usePopoverContext(\"Popover.Trigger\");\n const { state, libraryProps, ref } = usePopoverTrigger(ctx, {\n part: \"Popover.Trigger\",\n disabled,\n render,\n });\n\n return useRender<ComponentPropsWithRef<\"button\">, PopoverTriggerState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps,\n ref,\n });\n}\n\nPopoverTrigger.displayName = \"PopoverTrigger\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoEA,SAAgB,eAAe,EAC7B,WAAW,OACX,WACA,OACA,UACA,QACA,GAAG,QACmB;CACtB,MAAM,MAAM,kBAAkB,iBAAiB;CAC/C,MAAM,EAAE,OAAO,cAAc,QAAQ,kBAAkB,KAAK;EAC1D,MAAM;EACN;EACA;CACF,CAAC;CAED,OAAO,UAAgE;EACrE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;EACA;CACF,CAAC;AACH;AAEA,eAAe,cAAc"}
1
+ {"version":3,"file":"popover-trigger.mjs","names":[],"sources":["../../src/popover/popover-trigger.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { usePopoverTrigger } from \"../internal/overlay/use-popover-trigger.js\";\nimport type { PopoverTriggerHookState } from \"../internal/overlay/use-popover-trigger.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { usePopoverContext } from \"./popover-context.js\";\n\n/**\n * State of `Popover.Trigger`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport type PopoverTriggerState = PopoverTriggerHookState;\n\n/**\n * Props of `Popover.Trigger`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport interface PopoverTriggerProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n | \"onClick\"\n | \"aria-expanded\"\n | \"commandfor\"\n | \"command\"\n | \"popoverTarget\"\n | \"popoverTargetAction\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * Never dispatches. Native `disabled` on a `<button>` (no longer an invoker); in library mode\n * with a link or component `render`, `aria-disabled=\"true\"` instead: the element stays\n * focusable.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, PopoverTriggerState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, PopoverTriggerState>;\n /** Rendered from optimistic state; must not suspend. */\n children?: StateValue<ReactNode, PopoverTriggerState>;\n /**\n * Should render a `<button>`; another element works only in library mode (click handler), and\n * a press on it while the popup is open is a light dismiss rather than the awaited close.\n */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, PopoverTriggerState>;\n}\n\n/**\n * The toggle: `<button type=\"button\" popovertarget>`, with no `aria-expanded`: the browser exposes\n * the popover's state on its invoker. In JS-free mode the browser toggles the popover and the\n * Popup keeps `data-open` current. In library mode the click is cancelled (so the toggle does not\n * run) and dispatched through the Root's transition: an open, or a library-owned close while open.\n * The button shows optimistic `data-open` and `data-pending` until the change has landed; a\n * non-button `render` renders `aria-expanded` from the shown popup (in the top layer).\n *\n * Owned keys (conventions 1.2): `type` (on a `<button>` only), `disabled`, `aria-disabled`\n * (library mode, link or component `render`), `popoverTarget`, `aria-expanded`, `onClick`\n * (library mode), `data-open`, `data-pending`, `data-disabled`; `commandfor`, `command` and\n * `popoverTargetAction` (never written; omitted from the props type). `aria-haspopup` and\n * `aria-controls` pass through.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport function PopoverTrigger({\n disabled = false,\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverTriggerProps) {\n const ctx = usePopoverContext(\"Popover.Trigger\");\n const { state, libraryProps, ref } = usePopoverTrigger(ctx, {\n part: \"Popover.Trigger\",\n disabled,\n render,\n });\n\n return useRender<ComponentPropsWithRef<\"button\">, PopoverTriggerState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps,\n ref,\n });\n}\n\nPopoverTrigger.displayName = \"PopoverTrigger\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoEA,SAAgB,eAAe,EAC7B,WAAW,OACX,WACA,OACA,UACA,QACA,GAAG,QACmB;CACtB,MAAM,MAAM,kBAAkB,iBAAiB;CAC/C,MAAM,EAAE,OAAO,cAAc,QAAQ,kBAAkB,KAAK;EAC1D,MAAM;EACN;EACA;CACF,CAAC;CAED,OAAO,UAAgE;EACrE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;EACA;CACF,CAAC;AACH;AAEA,eAAe,cAAc"}
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
3
3
  import { useRender } from "../internal/use-render.mjs";
4
- import { syncPresences } from "../internal/sync-presence.mjs";
5
- import { useNativeChecked } from "../internal/use-native-checked.mjs";
6
- import { groupMemberProps } from "../internal/group-member.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 { useRadioGroupContext } from "./radio-group-context.mjs";
8
8
  //#region src/radio-group/radio-group-item.tsx
9
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group-item.mjs","names":[],"sources":["../../src/radio-group/radio-group-item.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { groupMemberProps } from \"../internal/group-member.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { syncPresences } from \"../internal/sync-presence.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useNativeChecked } from \"../internal/use-native-checked.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useRadioGroupContext } from \"./radio-group-context.js\";\n\n/**\n * State of `RadioGroup.Item`, passed to the function forms of `className`, `style` and `render`.\n */\nexport interface RadioGroupItemState {\n /** The Item's `value` prop. */\n readonly value: string;\n /** Optimistic: true as soon as the user checks this radio, before the action settles. */\n readonly checked: boolean;\n /** The Root is pending and this radio is the optimistic target. */\n readonly pending: boolean;\n /** Disabled by its own prop or by `Root disabled`. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `RadioGroup.Item`.\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport interface RadioGroupItemProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"name\"\n | \"value\"\n | \"checked\"\n | \"defaultChecked\"\n | \"defaultValue\"\n | \"form\"\n | \"required\"\n | \"onChange\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** The value this radio checks. Must be unique within the Root. Submitted as the form value. */\n value: string;\n /**\n * Native `disabled`: unfocusable, skipped by arrow keys, never dispatches.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Forwarded to the Item's `<ViewTransition default>`. Default: no boundary. Fires only on the commit\n * that settles the action (or rolls it back), never on the optimistic check; animate the check\n * itself with CSS on `:checked`.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, RadioGroupItemState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, RadioGroupItemState>;\n /** Replace the rendered element. Must keep an `<input>`; the library sets `type=\"radio\"`. */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, RadioGroupItemState>;\n}\n\n/**\n * One `<input type=\"radio\">` of the group. Its DOM `checked` is the optimistic value\n * (`checked={optimistic === value}`): react-dom restores a controlled input to its props after\n * every event, and only the sync-lane optimistic value survives that restore.\n *\n * Owned keys (conventions 1.2; a `render` element's value is overridden): `type`, `name`,\n * `value`, `checked`, `defaultChecked` (never rendered), `disabled`, `form`, `required`,\n * `data-checked`, `data-pending`, `data-disabled`. `onChange` is merged: a `render` element's own\n * handler runs first, then the library's.\n *\n * Form reset in controlled mode: React sets an input's `defaultChecked` once, from its initial\n * `checked`. An Item added on the client while the Root's `value` equals its value gets\n * `defaultChecked` too, so two radios may carry it and a reset does not necessarily return to\n * the group's mount-time value (see `RadioGroup.Root` `value`).\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport function RadioGroupItem({\n value,\n disabled: disabledProp = false,\n transition,\n className,\n style,\n render,\n ...rest\n}: RadioGroupItemProps) {\n const ctx = useRadioGroupContext(\"RadioGroup.Item\");\n const checked = ctx.state.value === value;\n const pending = ctx.state.pending && checked;\n const disabled = ctx.state.disabled || disabledProp;\n\n // Group mode: element check and re-apply only; the Root reports the residual paths once. The\n // hook calls `onItemMounted` at mount so that an Item mounting after its Root (a Suspense\n // boundary that hydrates later) still gets the group reconciled.\n const inputRef = useNativeChecked({\n type: \"radio\",\n component: \"RadioGroup.Item\",\n checked,\n group: true,\n onItemMounted: (el) => {\n // Hydration keeps server attributes that differ from the client render (React only warns).\n // An Item hydrating after its Root (partial hydration, Root JSDoc) can render a different\n // `checked` than the server did, e.g. after a click on an already hydrated radio, and a\n // stale `data-checked` would then stay until the prop changes again.\n if (el !== null) {\n syncPresences(el, {\n \"data-checked\": checked,\n \"data-pending\": pending,\n \"data-disabled\": disabled,\n });\n }\n ctx.onItemMounted(el);\n },\n defaultChecked: ctx.defaultValue === undefined ? undefined : ctx.defaultValue === value,\n });\n\n const state: RadioGroupItemState = { value, checked, pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, RadioGroupItemState>({\n defaultElement: \"input\",\n render,\n state,\n className,\n style,\n children: undefined,\n ref: inputRef,\n // Pass-through layer: a `render` element's own props win over these.\n props: rest,\n libraryProps: groupMemberProps({\n type: \"radio\",\n component: \"RadioGroup.Item\",\n name: ctx.name,\n form: ctx.form,\n value,\n required: ctx.required,\n checked,\n pending,\n effectiveDisabled: disabled,\n ownDisabled: disabledProp,\n activate: (event) => ctx.select(value, event),\n }),\n });\n\n return useTransitionBoundary(\"RadioGroup.Item\", transition, element);\n}\n\nRadioGroupItem.displayName = \"RadioGroupItem\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,SAAgB,eAAe,EAC7B,OACA,UAAU,eAAe,OACzB,YACA,WACA,OACA,QACA,GAAG,QACmB;CACtB,MAAM,MAAM,qBAAqB,iBAAiB;CAClD,MAAM,UAAU,IAAI,MAAM,UAAU;CACpC,MAAM,UAAU,IAAI,MAAM,WAAW;CACrC,MAAM,WAAW,IAAI,MAAM,YAAY;CAKvC,MAAM,WAAW,iBAAiB;EAChC,MAAM;EACN,WAAW;EACX;EACA,OAAO;EACP,gBAAgB,OAAO;GAKrB,IAAI,OAAO,MACT,cAAc,IAAI;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;GACnB,CAAC;GAEH,IAAI,cAAc,EAAE;EACtB;EACA,gBAAgB,IAAI,iBAAiB,KAAA,IAAY,KAAA,IAAY,IAAI,iBAAiB;CACpF,CAAC;CAID,MAAM,UAAU,UAA+D;EAC7E,gBAAgB;EAChB;EACA,OAAA;GALmC;GAAO;GAAS;GAAS;EAKxD;EACJ;EACA;EACA,UAAU,KAAA;EACV,KAAK;EAEL,OAAO;EACP,cAAc,iBAAiB;GAC7B,MAAM;GACN,WAAW;GACX,MAAM,IAAI;GACV,MAAM,IAAI;GACV;GACA,UAAU,IAAI;GACd;GACA;GACA,mBAAmB;GACnB,aAAa;GACb,WAAW,UAAU,IAAI,OAAO,OAAO,KAAK;EAC9C,CAAC;CACH,CAAC;CAED,OAAO,sBAAsB,mBAAmB,YAAY,OAAO;AACrE;AAEA,eAAe,cAAc"}
1
+ {"version":3,"file":"radio-group-item.mjs","names":[],"sources":["../../src/radio-group/radio-group-item.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ViewTransitionClass } from \"react\";\nimport { groupMemberProps } from \"../internal/form/group-member.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport { syncPresences } from \"../internal/form/sync-presence.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 { useRadioGroupContext } from \"./radio-group-context.js\";\n\n/**\n * State of `RadioGroup.Item`, passed to the function forms of `className`, `style` and `render`.\n */\nexport interface RadioGroupItemState {\n /** The Item's `value` prop. */\n readonly value: string;\n /** Optimistic: true as soon as the user checks this radio, before the action settles. */\n readonly checked: boolean;\n /** The Root is pending and this radio is the optimistic target. */\n readonly pending: boolean;\n /** Disabled by its own prop or by `Root disabled`. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `RadioGroup.Item`.\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport interface RadioGroupItemProps extends Omit<\n ComponentPropsWithRef<\"input\">,\n | \"type\"\n | \"name\"\n | \"value\"\n | \"checked\"\n | \"defaultChecked\"\n | \"defaultValue\"\n | \"form\"\n | \"required\"\n | \"onChange\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** The value this radio checks. Must be unique within the Root. Submitted as the form value. */\n value: string;\n /**\n * Native `disabled`: unfocusable, skipped by arrow keys, never dispatches.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Forwarded to the Item's `<ViewTransition default>`. Default: no boundary. Fires only on the commit\n * that settles the action (or rolls it back), never on the optimistic check; animate the check\n * itself with CSS on `:checked`.\n *\n * Static: setting or unsetting it remounts the element. Any value, `\"none\"` included, makes a\n * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms\n * page cross-fade that the next transition waits for).\n */\n transition?: ViewTransitionClass;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, RadioGroupItemState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, RadioGroupItemState>;\n /** Replace the rendered element. Must keep an `<input>`; the library sets `type=\"radio\"`. */\n render?: RenderProp<ComponentPropsWithRef<\"input\">, RadioGroupItemState>;\n}\n\n/**\n * One `<input type=\"radio\">` of the group. Its DOM `checked` is the optimistic value\n * (`checked={optimistic === value}`): react-dom restores a controlled input to its props after\n * every event, and only the sync-lane optimistic value survives that restore.\n *\n * Owned keys (conventions 1.2; a `render` element's value is overridden): `type`, `name`,\n * `value`, `checked`, `defaultChecked` (never rendered), `disabled`, `form`, `required`,\n * `data-checked`, `data-pending`, `data-disabled`. `onChange` is merged: a `render` element's own\n * handler runs first, then the library's.\n *\n * Form reset in controlled mode: React sets an input's `defaultChecked` once, from its initial\n * `checked`. An Item added on the client while the Root's `value` equals its value gets\n * `defaultChecked` too, so two radios may carry it and a reset does not necessarily return to\n * the group's mount-time value (see `RadioGroup.Root` `value`).\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport function RadioGroupItem({\n value,\n disabled: disabledProp = false,\n transition,\n className,\n style,\n render,\n ...rest\n}: RadioGroupItemProps) {\n const ctx = useRadioGroupContext(\"RadioGroup.Item\");\n const checked = ctx.state.value === value;\n const pending = ctx.state.pending && checked;\n const disabled = ctx.state.disabled || disabledProp;\n\n // Group mode: element check and re-apply only; the Root reports the residual paths once. The\n // hook calls `onItemMounted` at mount so that an Item mounting after its Root (a Suspense\n // boundary that hydrates later) still gets the group reconciled.\n const inputRef = useNativeChecked({\n type: \"radio\",\n component: \"RadioGroup.Item\",\n checked,\n group: true,\n onItemMounted: (el) => {\n // Hydration keeps server attributes that differ from the client render (React only warns).\n // An Item hydrating after its Root (partial hydration, Root JSDoc) can render a different\n // `checked` than the server did, e.g. after a click on an already hydrated radio, and a\n // stale `data-checked` would then stay until the prop changes again.\n if (el !== null) {\n syncPresences(el, {\n \"data-checked\": checked,\n \"data-pending\": pending,\n \"data-disabled\": disabled,\n });\n }\n ctx.onItemMounted(el);\n },\n defaultChecked: ctx.defaultValue === undefined ? undefined : ctx.defaultValue === value,\n });\n\n const state: RadioGroupItemState = { value, checked, pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"input\">, RadioGroupItemState>({\n defaultElement: \"input\",\n render,\n state,\n className,\n style,\n children: undefined,\n ref: inputRef,\n // Pass-through layer: a `render` element's own props win over these.\n props: rest,\n libraryProps: groupMemberProps({\n type: \"radio\",\n component: \"RadioGroup.Item\",\n name: ctx.name,\n form: ctx.form,\n value,\n required: ctx.required,\n checked,\n pending,\n effectiveDisabled: disabled,\n ownDisabled: disabledProp,\n activate: (event) => ctx.select(value, event),\n }),\n });\n\n return useTransitionBoundary(\"RadioGroup.Item\", transition, element);\n}\n\nRadioGroupItem.displayName = \"RadioGroupItem\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuFA,SAAgB,eAAe,EAC7B,OACA,UAAU,eAAe,OACzB,YACA,WACA,OACA,QACA,GAAG,QACmB;CACtB,MAAM,MAAM,qBAAqB,iBAAiB;CAClD,MAAM,UAAU,IAAI,MAAM,UAAU;CACpC,MAAM,UAAU,IAAI,MAAM,WAAW;CACrC,MAAM,WAAW,IAAI,MAAM,YAAY;CAKvC,MAAM,WAAW,iBAAiB;EAChC,MAAM;EACN,WAAW;EACX;EACA,OAAO;EACP,gBAAgB,OAAO;GAKrB,IAAI,OAAO,MACT,cAAc,IAAI;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;GACnB,CAAC;GAEH,IAAI,cAAc,EAAE;EACtB;EACA,gBAAgB,IAAI,iBAAiB,KAAA,IAAY,KAAA,IAAY,IAAI,iBAAiB;CACpF,CAAC;CAID,MAAM,UAAU,UAA+D;EAC7E,gBAAgB;EAChB;EACA,OAAA;GALmC;GAAO;GAAS;GAAS;EAKxD;EACJ;EACA;EACA,UAAU,KAAA;EACV,KAAK;EAEL,OAAO;EACP,cAAc,iBAAiB;GAC7B,MAAM;GACN,WAAW;GACX,MAAM,IAAI;GACV,MAAM,IAAI;GACV;GACA,UAAU,IAAI;GACd;GACA;GACA,mBAAmB;GACnB,aAAa;GACb,WAAW,UAAU,IAAI,OAAO,OAAO,KAAK;EAC9C,CAAC;CACH,CAAC;CAED,OAAO,sBAAsB,mBAAmB,YAAY,OAAO;AACrE;AAEA,eAAe,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group-root.d.mts","names":[],"sources":["../../src/radio-group/radio-group-root.tsx"],"mappings":";;;;iBAwBiB,qCAAqC;;;;;;;WAO3C,QAAQ;;;;;;iBAOF;;WAEN;;WAEA;;WAEA;;;;;;;iBAQM,4BAA4B,KAC3C;;;;;;;;;;;EAoBA;;;;;;;EAOA;;;;;;;;;;;;EAYA,oBAAoB,4BAA4B;;;;;;;;EAQhD;;EAEA;;;;;;;;EAQA;;;;;;EAMA;;EAEA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,mCAAmC;;;;;;;;;;;;;;;;;;;;wBAsCzC,iBACd,OACA,cACA,mBACA,MAAM,UACN,MACA,UAAU,cACV,UAAU,cACV,WACA,OACA,UACA,WACG,QACF,sCAAmB,IAAA;yBAbN"}
1
+ {"version":3,"file":"radio-group-root.d.mts","names":[],"sources":["../../src/radio-group/radio-group-root.tsx"],"mappings":";;;;iBA2BiB,qCAAqC;;;;;;;WAO3C,QAAQ;;;;;;iBAOF;;WAEN;;WAEA;;WAEA;;;;;;;iBAQM,4BAA4B,KAC3C;;;;;;;;;;;EAoBA;;;;;;;EAOA;;;;;;;;;;;;EAYA,oBAAoB,4BAA4B;;;;;;;;EAQhD;;EAEA;;;;;;;;EAQA;;;;;;EAMA;;EAEA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,mCAAmC;;;;;;;;;;;;;;;;;;;;wBAsCzC,iBACd,OACA,cACA,mBACA,MAAM,UACN,MACA,UAAU,cACV,UAAU,cACV,WACA,OACA,UACA,WACG,QACF,sCAAmB,IAAA;yBAbN"}
@@ -1,13 +1,13 @@
1
1
  "use client";
2
- import { createActionDetails } from "../internal/action-details.mjs";
2
+ import { createActionDetails } from "../internal/action/action-details.mjs";
3
3
  import { dataAttr } from "../internal/data-attr.mjs";
4
4
  import { useRender } from "../internal/use-render.mjs";
5
5
  import { transitionTypes } from "../internal/transition-types.mjs";
6
- import { intendedValue, useControllableAction } from "../internal/use-controllable-action.mjs";
7
- import { useFieldValueChange } from "../internal/use-field-control.mjs";
6
+ import { intendedValue, useControllableAction } from "../internal/action/use-controllable-action.mjs";
7
+ import { useFieldValueChange } from "../internal/form/use-field-control.mjs";
8
8
  import { RadioGroupContext } from "./radio-group-context.mjs";
9
- import { useFieldsetGroup } from "../internal/use-fieldset-group.mjs";
10
- import { useNativeGroupReconciliation } from "../internal/use-native-group-reconciliation.mjs";
9
+ import { useFieldsetGroup } from "../internal/form/use-fieldset-group.mjs";
10
+ import { useNativeGroupReconciliation } from "../internal/form/use-native-group-reconciliation.mjs";
11
11
  import { useCallback, useLayoutEffect, useMemo, useRef } from "react";
12
12
  import { jsx } from "react/jsx-runtime";
13
13
  //#region src/radio-group/radio-group-root.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group-root.mjs","names":[],"sources":["../../src/radio-group/radio-group-root.tsx"],"sourcesContent":["\"use client\";\nimport { useCallback, useLayoutEffect, useMemo, useRef } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\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 { intendedValue, useControllableAction } from \"../internal/use-controllable-action.js\";\nimport { useFieldValueChange } from \"../internal/use-field-control.js\";\nimport { useFieldsetGroup } from \"../internal/use-fieldset-group.js\";\nimport { useNativeGroupReconciliation } from \"../internal/use-native-group-reconciliation.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { RadioGroupContext } from \"./radio-group-context.js\";\nimport type { RadioGroupContextValue } from \"./radio-group-context.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/** Details passed as the second argument of `valueChangeAction`. */\nexport interface RadioGroupValueChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user checked a radio (click, Space, label click, or an arrow key, all of\n * which arrive as a native `click`). `\"platform\"`: the browser changed the checked radio\n * itself: a form reset (`details.event` is the `reset` event), or a click before hydration /\n * Firefox form-state restoration found at mount (`details.event` is `undefined`).\n */\n readonly reason: ChangeReason;\n}\n\n/**\n * State of `RadioGroup.Root`, `RadioGroup.Label`, passed to the function forms of `className`,\n * `style`, `children` and `render`.\n */\nexport interface RadioGroupRootState {\n /** Optimistic checked value, or `null`. Content rendered from it must not suspend. */\n readonly value: string | null;\n /** An action dispatched through this group is in flight. */\n readonly pending: boolean;\n /** The `disabled` prop (or the enclosing `Field.Root`'s). */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `RadioGroup.Root`.\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport interface RadioGroupRootProps extends Omit<\n ComponentPropsWithRef<\"fieldset\">,\n | \"className\"\n | \"style\"\n | \"children\"\n | \"defaultValue\"\n | \"defaultChecked\"\n | \"name\"\n | \"disabled\"\n | \"form\"\n> {\n /**\n * Controlled checked value. `null` checks nothing; `undefined` means uncontrolled.\n *\n * A form reset returns each radio to the `checked` it had when *that radio* mounted (React sets\n * `defaultChecked` once, from the initial `checked`). An Item added on the client while `value`\n * equals its value therefore also gets `defaultChecked`, so two radios may carry it and the\n * reset target is not necessarily the group's mount-time value. The reset is offered to\n * `valueChangeAction` as usual; for a stable target remount the group with a `key` or use\n * `defaultValue`, whose latest value every Item mirrors.\n */\n value?: string | null;\n /**\n * Initial value in uncontrolled mode. Also the value a\n * form reset returns to: the latest prop value is mirrored into the radios' `defaultChecked`.\n *\n * @defaultValue `null` (nothing checked)\n */\n defaultValue?: string | null;\n /**\n * Runs inside the Root's transition whenever the checked radio changes. May be sync or async\n * (also a Server Function); rejections reach the nearest Error Boundary and roll the selection\n * back.\n *\n * `next` is a string for every user interaction. It is `null` only with\n * `details.reason === \"platform\"`, when a form reset returned the group to \"nothing checked\".\n * Every arrow key press dispatches; the latest dispatch wins. A `setState` placed after your\n * own `await` is not a Transition update; wrap it in `startTransition` (React limitation).\n * `details.event.preventDefault()` is not a veto; use controlled mode to veto a change.\n */\n valueChangeAction?: ChangeAction<string | null, RadioGroupValueChangeDetails>;\n /**\n * The `name` shared by every radio in the group (form data key). Pass a real name when the group\n * is inside a `<form>` you submit. Must be unique within the form: react-dom throws if a\n * non-React radio shares it.\n *\n * @defaultValue a `useId()` value\n */\n name?: string;\n /** The `form` attribute, applied to the fieldset and to every radio. */\n form?: string;\n /**\n * Marks every radio `required`, which makes the group required (one checked radio satisfies it),\n * and renders `aria-required=\"true\"` on the fieldset so the radiogroup itself is exposed as\n * required.\n *\n * @defaultValue `false`\n */\n required?: boolean;\n /**\n * Renders `<fieldset disabled>`: every radio is disabled, unfocusable and skipped by arrows.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, RadioGroupRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, RadioGroupRootState>;\n /** The Label and Items. The function form receives the optimistic value; must not suspend. */\n children?: StateValue<ReactNode, RadioGroupRootState>;\n /** Replace the rendered element. Must keep a `<fieldset>`. */\n render?: RenderProp<ComponentPropsWithRef<\"fieldset\">, RadioGroupRootState>;\n}\n\n/**\n * Value of the group's checked radio as the DOM shows it (`prop: \"checked\"`) or as a form reset\n * leaves it (`prop: \"defaultChecked\"`), or `null`. Only radios of this group's `name` count, so a\n * nested group is ignored.\n */\nfunction readGroup(\n fieldset: HTMLFieldSetElement | null,\n name: string,\n prop: \"checked\" | \"defaultChecked\",\n): string | null {\n if (fieldset === null) return null;\n for (const radio of fieldset.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')) {\n if (radio.name === name && radio[prop]) return radio.value;\n }\n return null;\n}\n\n/**\n * `<fieldset role=\"radiogroup\">` that owns the group's state, the transition, the shared `name`,\n * the form-reset listener and the mount reconciliation (design/components/radio-group.md 13.3).\n * Carries `data-pending` while `valueChangeAction` is in flight.\n *\n * Owned keys (conventions 1.2): `role`, `aria-required`, `disabled`, `form`, `data-pending`,\n * `data-disabled`; inside a `Field.Root` also `aria-labelledby` (→ `Field.Label`, token-merged),\n * `aria-describedby` (token-merged), `aria-invalid` and `data-invalid`, and `name` / `required` /\n * `disabled` default from the Field.\n *\n * Keep every Item in the same Suspense boundary as its Root when server rendering. Partial\n * hydration of a group (a boundary between Root and Items that stays dehydrated while the user\n * interacts) is not supported by React: clicking a hydrated radio while same-`name` siblings are\n * still dehydrated makes react-dom throw \"Mixing React and non-React radio inputs with the same\n * `name` is not supported\". Development warns when Items hydrate after their Root.\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport function RadioGroupRoot({\n value,\n defaultValue,\n valueChangeAction,\n name: nameProp,\n form,\n required: requiredProp,\n disabled: disabledProp,\n className,\n style,\n children,\n render,\n ...rest\n}: RadioGroupRootProps) {\n const { field, name, required, disabled, fieldsetRef, rootRef } = useFieldsetGroup({\n component: \"RadioGroup.Root\",\n name: nameProp,\n disabled: disabledProp,\n required: requiredProp,\n });\n\n const { optimistic, pending, dispatch, latestInFlight } = useControllableAction<\n string | null,\n RadioGroupValueChangeDetails\n >({\n controlled: value,\n defaultValue,\n initialValue: null,\n action: valueChangeAction,\n transitionTypes: () => transitionTypes(\"radio-group\"),\n warn: { component: \"RadioGroup.Root\", prop: \"value\" },\n });\n // Inside a Field: a value React writes with no event (a rejected action rolling back, a\n // controlled change) re-reads validity and `validate` after the commit.\n useFieldValueChange(optimistic);\n // Deliberately no warning when neither `value` nor `defaultValue` is given: an unchecked group\n // is the HTML default (design decision 2).\n\n const base = (): string | null => intendedValue(latestInFlight, optimistic);\n\n // The residual browser paths (design section 5): one dispatch per group, from here. Items that\n // mount after the Root report through `onItemMounted` so the group is reconciled again.\n const { onItemMounted } = useNativeGroupReconciliation<string | null>({\n element: fieldsetRef,\n readCurrent: () => readGroup(fieldsetRef.current, name, \"checked\"),\n readDefault: () => readGroup(fieldsetRef.current, name, \"defaultChecked\"),\n base,\n onPlatformChange: (next, event) =>\n dispatch(next, createActionDetails(event, { reason: \"platform\" })),\n });\n\n // Dev-only partial-hydration detection. The radios present in the fieldset when the Root\n // mounts are either mounted in the Root's commit or still dehydrated server HTML. An Item that\n // mounts later on one of those elements hydrated after the Root (an Item created on the client\n // gets a new element). Items of the Root's own commit run their mount effect before this one,\n // while the snapshot is still `null`; StrictMode's re-run finds it reset by the cleanup.\n const serverRadios = useRef<ReadonlySet<Element> | null>(null);\n const warnedPartialHydration = useRef(false);\n useLayoutEffect(() => {\n if (!isDev) return;\n const el = fieldsetRef.current;\n serverRadios.current = new Set(el === null ? [] : el.querySelectorAll('input[type=\"radio\"]'));\n return () => {\n serverRadios.current = null;\n };\n }, [fieldsetRef]);\n const onItemMountedWithCheck = useCallback(\n (element?: Element | null) => {\n if (\n isDev &&\n !warnedPartialHydration.current &&\n element != null &&\n serverRadios.current?.has(element) === true\n ) {\n warnedPartialHydration.current = true;\n console.error(\n `RadioGroup.Item: an Item hydrated after its RadioGroup.Root (a Suspense boundary ` +\n `between them). Partial hydration of a radio group is not supported by React: ` +\n `clicking a hydrated radio while same-name radios are still dehydrated makes ` +\n `react-dom throw \"Mixing React and non-React radio inputs with the same name is not ` +\n `supported\". Keep every Item in the same Suspense boundary as its Root.`,\n );\n }\n onItemMounted(element);\n },\n [onItemMounted],\n );\n\n // Memoised: `dispatch` and `onItemMountedWithCheck` are stable, so this changes only with\n // the state and the props below.\n const contextDefault = value === undefined ? (defaultValue ?? null) : undefined;\n const state = useMemo<RadioGroupRootState>(\n () => ({ value: optimistic, pending, disabled }),\n [optimistic, pending, disabled],\n );\n const context = useMemo<RadioGroupContextValue>(\n () => ({\n name,\n form,\n required,\n state,\n defaultValue: contextDefault,\n onItemMounted: onItemMountedWithCheck,\n select: (next, event) => {\n // No-op rule against the optimistic value (conventions 2.3 item 7, design 4.2).\n if (next === optimistic) return;\n dispatch(next, createActionDetails(event, { reason: \"activate\" }));\n },\n }),\n [name, form, required, state, optimistic, contextDefault, onItemMountedWithCheck, dispatch],\n );\n\n const element = useRender<ComponentPropsWithRef<\"fieldset\">, RadioGroupRootState>({\n defaultElement: \"fieldset\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n ...field.attributes,\n role: \"radiogroup\",\n \"aria-required\": required ? \"true\" : undefined,\n disabled,\n form,\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n },\n ref: rootRef,\n });\n\n return <RadioGroupContext value={context}>{element}</RadioGroupContext>;\n}\n\nRadioGroupRoot.displayName = \"RadioGroupRoot\";\n"],"mappings":";;;;;;;;;;;;;AAqBA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;;;;;AA+GvC,SAAS,UACP,UACA,MACA,MACe;CACf,IAAI,aAAa,MAAM,OAAO;CAC9B,KAAK,MAAM,SAAS,SAAS,iBAAmC,uBAAqB,GACnF,IAAI,MAAM,SAAS,QAAQ,MAAM,OAAO,OAAO,MAAM;CAEvD,OAAO;AACT;;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,eAAe,EAC7B,OACA,cACA,mBACA,MAAM,UACN,MACA,UAAU,cACV,UAAU,cACV,WACA,OACA,UACA,QACA,GAAG,QACmB;CACtB,MAAM,EAAE,OAAO,MAAM,UAAU,UAAU,aAAa,YAAY,iBAAiB;EACjF,WAAW;EACX,MAAM;EACN,UAAU;EACV,UAAU;CACZ,CAAC;CAED,MAAM,EAAE,YAAY,SAAS,UAAU,mBAAmB,sBAGxD;EACA,YAAY;EACZ;EACA,cAAc;EACd,QAAQ;EACR,uBAAuB,gBAAgB,aAAa;EACpD,MAAM;GAAE,WAAW;GAAmB,MAAM;EAAQ;CACtD,CAAC;CAGD,oBAAoB,UAAU;CAI9B,MAAM,aAA4B,cAAc,gBAAgB,UAAU;CAI1E,MAAM,EAAE,kBAAkB,6BAA4C;EACpE,SAAS;EACT,mBAAmB,UAAU,YAAY,SAAS,MAAM,SAAS;EACjE,mBAAmB,UAAU,YAAY,SAAS,MAAM,gBAAgB;EACxE;EACA,mBAAmB,MAAM,UACvB,SAAS,MAAM,oBAAoB,OAAO,EAAE,QAAQ,WAAW,CAAC,CAAC;CACrE,CAAC;CAOD,MAAM,eAAe,OAAoC,IAAI;CAC7D,MAAM,yBAAyB,OAAO,KAAK;CAC3C,sBAAsB;EACpB,IAAI,CAAC,OAAO;EACZ,MAAM,KAAK,YAAY;EACvB,aAAa,UAAU,IAAI,IAAI,OAAO,OAAO,CAAC,IAAI,GAAG,iBAAiB,uBAAqB,CAAC;EAC5F,aAAa;GACX,aAAa,UAAU;EACzB;CACF,GAAG,CAAC,WAAW,CAAC;CAChB,MAAM,yBAAyB,aAC5B,YAA6B;EAC5B,IACE,SACA,CAAC,uBAAuB,WACxB,WAAW,QACX,aAAa,SAAS,IAAI,OAAO,MAAM,MACvC;GACA,uBAAuB,UAAU;GACjC,QAAQ,MACN,uYAKF;EACF;EACA,cAAc,OAAO;CACvB,GACA,CAAC,aAAa,CAChB;CAIA,MAAM,iBAAiB,UAAU,KAAA,IAAa,gBAAgB,OAAQ,KAAA;CACtE,MAAM,QAAQ,eACL;EAAE,OAAO;EAAY;EAAS;CAAS,IAC9C;EAAC;EAAY;EAAS;CAAQ,CAChC;CACA,MAAM,UAAU,eACP;EACL;EACA;EACA;EACA;EACA,cAAc;EACd,eAAe;EACf,SAAS,MAAM,UAAU;GAEvB,IAAI,SAAS,YAAY;GACzB,SAAS,MAAM,oBAAoB,OAAO,EAAE,QAAQ,WAAW,CAAC,CAAC;EACnE;CACF,IACA;EAAC;EAAM;EAAM;EAAU;EAAO;EAAY;EAAgB;EAAwB;CAAQ,CAC5F;CAEA,MAAM,UAAU,UAAkE;EAChF,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc;GACZ,GAAG,MAAM;GACT,MAAM;GACN,iBAAiB,WAAW,SAAS,KAAA;GACrC;GACA;GACA,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;EACpC;EACA,KAAK;CACP,CAAC;CAED,OAAO,oBAAC,mBAAD;EAAmB,OAAO;EAAU,UAAA;CAA2B,CAAA;AACxE;AAEA,eAAe,cAAc"}
1
+ {"version":3,"file":"radio-group-root.mjs","names":[],"sources":["../../src/radio-group/radio-group-root.tsx"],"sourcesContent":["\"use client\";\nimport { useCallback, useLayoutEffect, useMemo, useRef } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { createActionDetails } from \"../internal/action/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 {\n intendedValue,\n useControllableAction,\n} from \"../internal/action/use-controllable-action.js\";\nimport { useFieldValueChange } from \"../internal/form/use-field-control.js\";\nimport { useFieldsetGroup } from \"../internal/form/use-fieldset-group.js\";\nimport { useNativeGroupReconciliation } from \"../internal/form/use-native-group-reconciliation.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { RadioGroupContext } from \"./radio-group-context.js\";\nimport type { RadioGroupContextValue } from \"./radio-group-context.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/** Details passed as the second argument of `valueChangeAction`. */\nexport interface RadioGroupValueChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user checked a radio (click, Space, label click, or an arrow key, all of\n * which arrive as a native `click`). `\"platform\"`: the browser changed the checked radio\n * itself: a form reset (`details.event` is the `reset` event), or a click before hydration /\n * Firefox form-state restoration found at mount (`details.event` is `undefined`).\n */\n readonly reason: ChangeReason;\n}\n\n/**\n * State of `RadioGroup.Root`, `RadioGroup.Label`, passed to the function forms of `className`,\n * `style`, `children` and `render`.\n */\nexport interface RadioGroupRootState {\n /** Optimistic checked value, or `null`. Content rendered from it must not suspend. */\n readonly value: string | null;\n /** An action dispatched through this group is in flight. */\n readonly pending: boolean;\n /** The `disabled` prop (or the enclosing `Field.Root`'s). */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `RadioGroup.Root`.\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport interface RadioGroupRootProps extends Omit<\n ComponentPropsWithRef<\"fieldset\">,\n | \"className\"\n | \"style\"\n | \"children\"\n | \"defaultValue\"\n | \"defaultChecked\"\n | \"name\"\n | \"disabled\"\n | \"form\"\n> {\n /**\n * Controlled checked value. `null` checks nothing; `undefined` means uncontrolled.\n *\n * A form reset returns each radio to the `checked` it had when *that radio* mounted (React sets\n * `defaultChecked` once, from the initial `checked`). An Item added on the client while `value`\n * equals its value therefore also gets `defaultChecked`, so two radios may carry it and the\n * reset target is not necessarily the group's mount-time value. The reset is offered to\n * `valueChangeAction` as usual; for a stable target remount the group with a `key` or use\n * `defaultValue`, whose latest value every Item mirrors.\n */\n value?: string | null;\n /**\n * Initial value in uncontrolled mode. Also the value a\n * form reset returns to: the latest prop value is mirrored into the radios' `defaultChecked`.\n *\n * @defaultValue `null` (nothing checked)\n */\n defaultValue?: string | null;\n /**\n * Runs inside the Root's transition whenever the checked radio changes. May be sync or async\n * (also a Server Function); rejections reach the nearest Error Boundary and roll the selection\n * back.\n *\n * `next` is a string for every user interaction. It is `null` only with\n * `details.reason === \"platform\"`, when a form reset returned the group to \"nothing checked\".\n * Every arrow key press dispatches; the latest dispatch wins. A `setState` placed after your\n * own `await` is not a Transition update; wrap it in `startTransition` (React limitation).\n * `details.event.preventDefault()` is not a veto; use controlled mode to veto a change.\n */\n valueChangeAction?: ChangeAction<string | null, RadioGroupValueChangeDetails>;\n /**\n * The `name` shared by every radio in the group (form data key). Pass a real name when the group\n * is inside a `<form>` you submit. Must be unique within the form: react-dom throws if a\n * non-React radio shares it.\n *\n * @defaultValue a `useId()` value\n */\n name?: string;\n /** The `form` attribute, applied to the fieldset and to every radio. */\n form?: string;\n /**\n * Marks every radio `required`, which makes the group required (one checked radio satisfies it),\n * and renders `aria-required=\"true\"` on the fieldset so the radiogroup itself is exposed as\n * required.\n *\n * @defaultValue `false`\n */\n required?: boolean;\n /**\n * Renders `<fieldset disabled>`: every radio is disabled, unfocusable and skipped by arrows.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, RadioGroupRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, RadioGroupRootState>;\n /** The Label and Items. The function form receives the optimistic value; must not suspend. */\n children?: StateValue<ReactNode, RadioGroupRootState>;\n /** Replace the rendered element. Must keep a `<fieldset>`. */\n render?: RenderProp<ComponentPropsWithRef<\"fieldset\">, RadioGroupRootState>;\n}\n\n/**\n * Value of the group's checked radio as the DOM shows it (`prop: \"checked\"`) or as a form reset\n * leaves it (`prop: \"defaultChecked\"`), or `null`. Only radios of this group's `name` count, so a\n * nested group is ignored.\n */\nfunction readGroup(\n fieldset: HTMLFieldSetElement | null,\n name: string,\n prop: \"checked\" | \"defaultChecked\",\n): string | null {\n if (fieldset === null) return null;\n for (const radio of fieldset.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]')) {\n if (radio.name === name && radio[prop]) return radio.value;\n }\n return null;\n}\n\n/**\n * `<fieldset role=\"radiogroup\">` that owns the group's state, the transition, the shared `name`,\n * the form-reset listener and the mount reconciliation (design/components/radio-group.md 13.3).\n * Carries `data-pending` while `valueChangeAction` is in flight.\n *\n * Owned keys (conventions 1.2): `role`, `aria-required`, `disabled`, `form`, `data-pending`,\n * `data-disabled`; inside a `Field.Root` also `aria-labelledby` (→ `Field.Label`, token-merged),\n * `aria-describedby` (token-merged), `aria-invalid` and `data-invalid`, and `name` / `required` /\n * `disabled` default from the Field.\n *\n * Keep every Item in the same Suspense boundary as its Root when server rendering. Partial\n * hydration of a group (a boundary between Root and Items that stays dehydrated while the user\n * interacts) is not supported by React: clicking a hydrated radio while same-`name` siblings are\n * still dehydrated makes react-dom throw \"Mixing React and non-React radio inputs with the same\n * `name` is not supported\". Development warns when Items hydrate after their Root.\n *\n * @see https://ui.funstack.work/components/radio-group\n */\nexport function RadioGroupRoot({\n value,\n defaultValue,\n valueChangeAction,\n name: nameProp,\n form,\n required: requiredProp,\n disabled: disabledProp,\n className,\n style,\n children,\n render,\n ...rest\n}: RadioGroupRootProps) {\n const { field, name, required, disabled, fieldsetRef, rootRef } = useFieldsetGroup({\n component: \"RadioGroup.Root\",\n name: nameProp,\n disabled: disabledProp,\n required: requiredProp,\n });\n\n const { optimistic, pending, dispatch, latestInFlight } = useControllableAction<\n string | null,\n RadioGroupValueChangeDetails\n >({\n controlled: value,\n defaultValue,\n initialValue: null,\n action: valueChangeAction,\n transitionTypes: () => transitionTypes(\"radio-group\"),\n warn: { component: \"RadioGroup.Root\", prop: \"value\" },\n });\n // Inside a Field: a value React writes with no event (a rejected action rolling back, a\n // controlled change) re-reads validity and `validate` after the commit.\n useFieldValueChange(optimistic);\n // Deliberately no warning when neither `value` nor `defaultValue` is given: an unchecked group\n // is the HTML default (design decision 2).\n\n const base = (): string | null => intendedValue(latestInFlight, optimistic);\n\n // The residual browser paths (design section 5): one dispatch per group, from here. Items that\n // mount after the Root report through `onItemMounted` so the group is reconciled again.\n const { onItemMounted } = useNativeGroupReconciliation<string | null>({\n element: fieldsetRef,\n readCurrent: () => readGroup(fieldsetRef.current, name, \"checked\"),\n readDefault: () => readGroup(fieldsetRef.current, name, \"defaultChecked\"),\n base,\n onPlatformChange: (next, event) =>\n dispatch(next, createActionDetails(event, { reason: \"platform\" })),\n });\n\n // Dev-only partial-hydration detection. The radios present in the fieldset when the Root\n // mounts are either mounted in the Root's commit or still dehydrated server HTML. An Item that\n // mounts later on one of those elements hydrated after the Root (an Item created on the client\n // gets a new element). Items of the Root's own commit run their mount effect before this one,\n // while the snapshot is still `null`; StrictMode's re-run finds it reset by the cleanup.\n const serverRadios = useRef<ReadonlySet<Element> | null>(null);\n const warnedPartialHydration = useRef(false);\n useLayoutEffect(() => {\n if (!isDev) return;\n const el = fieldsetRef.current;\n serverRadios.current = new Set(el === null ? [] : el.querySelectorAll('input[type=\"radio\"]'));\n return () => {\n serverRadios.current = null;\n };\n }, [fieldsetRef]);\n const onItemMountedWithCheck = useCallback(\n (element?: Element | null) => {\n if (\n isDev &&\n !warnedPartialHydration.current &&\n element != null &&\n serverRadios.current?.has(element) === true\n ) {\n warnedPartialHydration.current = true;\n console.error(\n `RadioGroup.Item: an Item hydrated after its RadioGroup.Root (a Suspense boundary ` +\n `between them). Partial hydration of a radio group is not supported by React: ` +\n `clicking a hydrated radio while same-name radios are still dehydrated makes ` +\n `react-dom throw \"Mixing React and non-React radio inputs with the same name is not ` +\n `supported\". Keep every Item in the same Suspense boundary as its Root.`,\n );\n }\n onItemMounted(element);\n },\n [onItemMounted],\n );\n\n // Memoised: `dispatch` and `onItemMountedWithCheck` are stable, so this changes only with\n // the state and the props below.\n const contextDefault = value === undefined ? (defaultValue ?? null) : undefined;\n const state = useMemo<RadioGroupRootState>(\n () => ({ value: optimistic, pending, disabled }),\n [optimistic, pending, disabled],\n );\n const context = useMemo<RadioGroupContextValue>(\n () => ({\n name,\n form,\n required,\n state,\n defaultValue: contextDefault,\n onItemMounted: onItemMountedWithCheck,\n select: (next, event) => {\n // No-op rule against the optimistic value (conventions 2.3 item 7, design 4.2).\n if (next === optimistic) return;\n dispatch(next, createActionDetails(event, { reason: \"activate\" }));\n },\n }),\n [name, form, required, state, optimistic, contextDefault, onItemMountedWithCheck, dispatch],\n );\n\n const element = useRender<ComponentPropsWithRef<\"fieldset\">, RadioGroupRootState>({\n defaultElement: \"fieldset\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n ...field.attributes,\n role: \"radiogroup\",\n \"aria-required\": required ? \"true\" : undefined,\n disabled,\n form,\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n },\n ref: rootRef,\n });\n\n return <RadioGroupContext value={context}>{element}</RadioGroupContext>;\n}\n\nRadioGroupRoot.displayName = \"RadioGroupRoot\";\n"],"mappings":";;;;;;;;;;;;;AAwBA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;;;;;AA+GvC,SAAS,UACP,UACA,MACA,MACe;CACf,IAAI,aAAa,MAAM,OAAO;CAC9B,KAAK,MAAM,SAAS,SAAS,iBAAmC,uBAAqB,GACnF,IAAI,MAAM,SAAS,QAAQ,MAAM,OAAO,OAAO,MAAM;CAEvD,OAAO;AACT;;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,eAAe,EAC7B,OACA,cACA,mBACA,MAAM,UACN,MACA,UAAU,cACV,UAAU,cACV,WACA,OACA,UACA,QACA,GAAG,QACmB;CACtB,MAAM,EAAE,OAAO,MAAM,UAAU,UAAU,aAAa,YAAY,iBAAiB;EACjF,WAAW;EACX,MAAM;EACN,UAAU;EACV,UAAU;CACZ,CAAC;CAED,MAAM,EAAE,YAAY,SAAS,UAAU,mBAAmB,sBAGxD;EACA,YAAY;EACZ;EACA,cAAc;EACd,QAAQ;EACR,uBAAuB,gBAAgB,aAAa;EACpD,MAAM;GAAE,WAAW;GAAmB,MAAM;EAAQ;CACtD,CAAC;CAGD,oBAAoB,UAAU;CAI9B,MAAM,aAA4B,cAAc,gBAAgB,UAAU;CAI1E,MAAM,EAAE,kBAAkB,6BAA4C;EACpE,SAAS;EACT,mBAAmB,UAAU,YAAY,SAAS,MAAM,SAAS;EACjE,mBAAmB,UAAU,YAAY,SAAS,MAAM,gBAAgB;EACxE;EACA,mBAAmB,MAAM,UACvB,SAAS,MAAM,oBAAoB,OAAO,EAAE,QAAQ,WAAW,CAAC,CAAC;CACrE,CAAC;CAOD,MAAM,eAAe,OAAoC,IAAI;CAC7D,MAAM,yBAAyB,OAAO,KAAK;CAC3C,sBAAsB;EACpB,IAAI,CAAC,OAAO;EACZ,MAAM,KAAK,YAAY;EACvB,aAAa,UAAU,IAAI,IAAI,OAAO,OAAO,CAAC,IAAI,GAAG,iBAAiB,uBAAqB,CAAC;EAC5F,aAAa;GACX,aAAa,UAAU;EACzB;CACF,GAAG,CAAC,WAAW,CAAC;CAChB,MAAM,yBAAyB,aAC5B,YAA6B;EAC5B,IACE,SACA,CAAC,uBAAuB,WACxB,WAAW,QACX,aAAa,SAAS,IAAI,OAAO,MAAM,MACvC;GACA,uBAAuB,UAAU;GACjC,QAAQ,MACN,uYAKF;EACF;EACA,cAAc,OAAO;CACvB,GACA,CAAC,aAAa,CAChB;CAIA,MAAM,iBAAiB,UAAU,KAAA,IAAa,gBAAgB,OAAQ,KAAA;CACtE,MAAM,QAAQ,eACL;EAAE,OAAO;EAAY;EAAS;CAAS,IAC9C;EAAC;EAAY;EAAS;CAAQ,CAChC;CACA,MAAM,UAAU,eACP;EACL;EACA;EACA;EACA;EACA,cAAc;EACd,eAAe;EACf,SAAS,MAAM,UAAU;GAEvB,IAAI,SAAS,YAAY;GACzB,SAAS,MAAM,oBAAoB,OAAO,EAAE,QAAQ,WAAW,CAAC,CAAC;EACnE;CACF,IACA;EAAC;EAAM;EAAM;EAAU;EAAO;EAAY;EAAgB;EAAwB;CAAQ,CAC5F;CAEA,MAAM,UAAU,UAAkE;EAChF,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc;GACZ,GAAG,MAAM;GACT,MAAM;GACN,iBAAiB,WAAW,SAAS,KAAA;GACrC;GACA;GACA,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;EACpC;EACA,KAAK;CACP,CAAC;CAED,OAAO,oBAAC,mBAAD;EAAmB,OAAO;EAAU,UAAA;CAA2B,CAAA;AACxE;AAEA,eAAe,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"select-group-label.d.mts","names":[],"sources":["../../src/select/select-group-label.tsx"],"mappings":";;;;;;;;;iBAaiB,8BAA8B,KAC7C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;wBAgBvC,mBACd,WACA,OACA,UACA,WACG,QACF,wBAAqB;yBANR"}
1
+ {"version":3,"file":"select-group-label.d.mts","names":[],"sources":["../../src/select/select-group-label.tsx"],"mappings":";;;;;;;;;iBAaiB,8BAA8B,KAC7C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;wBAmBvC,mBACd,WACA,OACA,UACA,WACG,QACF,wBAAqB;yBANR"}
@@ -3,6 +3,8 @@ import { useRender } from "../internal/use-render.mjs";
3
3
  import { useSelectContext } from "./select-context.mjs";
4
4
  import { useSelectPartRef } from "./select-dom.mjs";
5
5
  //#region src/select/select-group-label.tsx
6
+ const isDev = process.env.NODE_ENV !== "production";
7
+ /** Development only: passed behind `isDev`, so the text folds away in production (#161). */
6
8
  function firstChildOfGroup(el) {
7
9
  const parent = el.parentElement;
8
10
  if (parent?.tagName === "OPTGROUP" && parent.firstElementChild === el) return null;
@@ -22,7 +24,7 @@ function SelectGroupLabel({ className, style, children, render, ...rest }) {
22
24
  pending: ctx.pending,
23
25
  disabled: ctx.disabled
24
26
  };
25
- const { ref } = useSelectPartRef("Select.GroupLabel", "legend", firstChildOfGroup);
27
+ const { ref } = useSelectPartRef("Select.GroupLabel", "legend", isDev ? firstChildOfGroup : void 0);
26
28
  return useRender({
27
29
  defaultElement: "legend",
28
30
  render,
@@ -1 +1 @@
1
- {"version":3,"file":"select-group-label.mjs","names":[],"sources":["../../src/select/select-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 { useSelectContext } from \"./select-context.js\";\nimport { useSelectPartRef } from \"./select-dom.js\";\nimport type { SelectRootState } from \"./select-root.js\";\n\n/**\n * Props of `Select.GroupLabel`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport interface SelectGroupLabelProps 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, SelectRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, SelectRootState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, SelectRootState>;\n /** Replace the rendered element. Must keep a `<legend>`. */\n render?: RenderProp<ComponentPropsWithRef<\"legend\">, SelectRootState>;\n}\n\nfunction firstChildOfGroup(el: HTMLLegendElement): string | null {\n const parent = el.parentElement;\n if (parent?.tagName === \"OPTGROUP\" && parent.firstElementChild === el) return null;\n return \"must be the first child of a Select.Group's <optgroup> (HTML content model).\";\n}\n\n/**\n * The rich label of a `Select.Group`: a `<legend>`, rendered by engines with customizable select.\n * Optional; must be the **first child** of its Group. Keep its text equal to the Group's `label`,\n * which native pickers and assistive technology use. Owns no keys.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport function SelectGroupLabel({\n className,\n style,\n children,\n render,\n ...rest\n}: SelectGroupLabelProps) {\n const ctx = useSelectContext(\"Select.GroupLabel\");\n const state: SelectRootState = {\n value: ctx.optimistic,\n pending: ctx.pending,\n disabled: ctx.disabled,\n };\n const { ref } = useSelectPartRef<HTMLLegendElement>(\n \"Select.GroupLabel\",\n \"legend\",\n firstChildOfGroup,\n );\n return useRender<ComponentPropsWithRef<\"legend\">, SelectRootState>({\n defaultElement: \"legend\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n ref,\n });\n}\n\nSelectGroupLabel.displayName = \"SelectGroupLabel\";\n"],"mappings":";;;;;AA2BA,SAAS,kBAAkB,IAAsC;CAC/D,MAAM,SAAS,GAAG;CAClB,IAAI,QAAQ,YAAY,cAAc,OAAO,sBAAsB,IAAI,OAAO;CAC9E,OAAO;AACT;;;;;;;;AASA,SAAgB,iBAAiB,EAC/B,WACA,OACA,UACA,QACA,GAAG,QACqB;CACxB,MAAM,MAAM,iBAAiB,mBAAmB;CAChD,MAAM,QAAyB;EAC7B,OAAO,IAAI;EACX,SAAS,IAAI;EACb,UAAU,IAAI;CAChB;CACA,MAAM,EAAE,QAAQ,iBACd,qBACA,UACA,iBACF;CACA,OAAO,UAA4D;EACjE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;CACF,CAAC;AACH;AAEA,iBAAiB,cAAc"}
1
+ {"version":3,"file":"select-group-label.mjs","names":[],"sources":["../../src/select/select-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 { useSelectContext } from \"./select-context.js\";\nimport { useSelectPartRef } from \"./select-dom.js\";\nimport type { SelectRootState } from \"./select-root.js\";\n\n/**\n * Props of `Select.GroupLabel`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport interface SelectGroupLabelProps 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, SelectRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, SelectRootState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, SelectRootState>;\n /** Replace the rendered element. Must keep a `<legend>`. */\n render?: RenderProp<ComponentPropsWithRef<\"legend\">, SelectRootState>;\n}\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/** Development only: passed behind `isDev`, so the text folds away in production (#161). */\nfunction firstChildOfGroup(el: HTMLLegendElement): string | null {\n const parent = el.parentElement;\n if (parent?.tagName === \"OPTGROUP\" && parent.firstElementChild === el) return null;\n return \"must be the first child of a Select.Group's <optgroup> (HTML content model).\";\n}\n\n/**\n * The rich label of a `Select.Group`: a `<legend>`, rendered by engines with customizable select.\n * Optional; must be the **first child** of its Group. Keep its text equal to the Group's `label`,\n * which native pickers and assistive technology use. Owns no keys.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport function SelectGroupLabel({\n className,\n style,\n children,\n render,\n ...rest\n}: SelectGroupLabelProps) {\n const ctx = useSelectContext(\"Select.GroupLabel\");\n const state: SelectRootState = {\n value: ctx.optimistic,\n pending: ctx.pending,\n disabled: ctx.disabled,\n };\n const { ref } = useSelectPartRef<HTMLLegendElement>(\n \"Select.GroupLabel\",\n \"legend\",\n isDev ? firstChildOfGroup : undefined,\n );\n return useRender<ComponentPropsWithRef<\"legend\">, SelectRootState>({\n defaultElement: \"legend\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n ref,\n });\n}\n\nSelectGroupLabel.displayName = \"SelectGroupLabel\";\n"],"mappings":";;;;;AA2BA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;AAGvC,SAAS,kBAAkB,IAAsC;CAC/D,MAAM,SAAS,GAAG;CAClB,IAAI,QAAQ,YAAY,cAAc,OAAO,sBAAsB,IAAI,OAAO;CAC9E,OAAO;AACT;;;;;;;;AASA,SAAgB,iBAAiB,EAC/B,WACA,OACA,UACA,QACA,GAAG,QACqB;CACxB,MAAM,MAAM,iBAAiB,mBAAmB;CAChD,MAAM,QAAyB;EAC7B,OAAO,IAAI;EACX,SAAS,IAAI;EACb,UAAU,IAAI;CAChB;CACA,MAAM,EAAE,QAAQ,iBACd,qBACA,UACA,QAAQ,oBAAoB,KAAA,CAC9B;CACA,OAAO,UAA4D;EACjE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;CACF,CAAC;AACH;AAEA,iBAAiB,cAAc"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { dataAttr } from "../internal/data-attr.mjs";
3
3
  import { useRender } from "../internal/use-render.mjs";
4
- import { syncPresence } from "../internal/sync-presence.mjs";
4
+ import { syncPresence } from "../internal/form/sync-presence.mjs";
5
5
  import { useHydratedMount } from "../internal/use-hydrated-mount.mjs";
6
6
  import { useSelectContext } from "./select-context.mjs";
7
7
  import { useSelectPartRef } from "./select-dom.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"select-option.mjs","names":[],"sources":["../../src/select/select-option.tsx"],"sourcesContent":["\"use client\";\nimport { useEffectEvent, useLayoutEffect } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { syncPresence } from \"../internal/sync-presence.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useHydratedMount } from \"../internal/use-hydrated-mount.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useSelectContext } from \"./select-context.js\";\nimport { useSelectPartRef } from \"./select-dom.js\";\n\n/**\n * State of `Select.Option`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface SelectOptionState {\n /** The Option's `value` prop. */\n readonly value: string;\n /** Optimistic: true as soon as the user picks this option, before the action settles. */\n readonly selected: boolean;\n /** The Root is pending and this option is the optimistic target. */\n readonly pending: boolean;\n /** Disabled by its own prop, a disabled `Select.Group`, or `Root disabled` (as `:disabled`). */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `Select.Option`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport interface SelectOptionProps extends Omit<\n ComponentPropsWithRef<\"option\">,\n \"value\" | \"selected\" | \"className\" | \"style\" | \"children\"\n> {\n /** The option's value. Required: React cannot infer a value from rich children. */\n value: string;\n /**\n * Native `disabled`: not pickable, skipped by keyboard navigation.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, SelectOptionState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, SelectOptionState>;\n /**\n * The option's content. Keep it readable as plain text: engines without customizable select\n * (Firefox today) show only the text. Give icons `aria-hidden` and no text. Avoid the `label`\n * attribute (Chromium names the option from it but shows the content).\n */\n children?: StateValue<ReactNode, SelectOptionState>;\n /** Replace the rendered element. Must keep an `<option>`. */\n render?: RenderProp<ComponentPropsWithRef<\"option\">, SelectOptionState>;\n}\n\n/**\n * One `<option>`. It never renders `selected`: the selection is the Root's `value={optimistic}`\n * plus the Root's re-apply for options that mount after the select's own commit (a Suspense\n * boundary or `use()` inside the select), which the Option reports from its mount layout effect.\n *\n * Owned keys: `value`, `selected` (never rendered), `disabled`, `data-selected`, `data-pending`,\n * `data-disabled`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport function SelectOption({\n value,\n disabled: disabledProp = false,\n className,\n style,\n children,\n render,\n ...rest\n}: SelectOptionProps) {\n const ctx = useSelectContext(\"Select.Option\");\n const selected = ctx.optimistic === value;\n const pending = ctx.pending && selected;\n const disabled = ctx.disabled || ctx.groupDisabled || disabledProp;\n const hydrated = useHydratedMount();\n const { ref, node } = useSelectPartRef<HTMLOptionElement>(\"Select.Option\", \"option\");\n\n // Reads the mount render's values: for a hydrated option that is the hydration render, which\n // used the server snapshot (`hydrated === true`).\n const reportMount = useEffectEvent(() => {\n const el = node.current;\n if (el !== null) {\n // Hydration keeps server attributes that differ from the client render (React only warns);\n // an option hydrating after its Root can render a different state than the server did.\n syncPresence(el, \"data-selected\", selected);\n syncPresence(el, \"data-pending\", pending);\n syncPresence(el, \"data-disabled\", disabled);\n }\n ctx.optionMounted(el, hydrated);\n });\n useLayoutEffect(() => {\n reportMount();\n }, []);\n\n const state: SelectOptionState = { value, selected, pending, disabled };\n\n return useRender<ComponentPropsWithRef<\"option\">, SelectOptionState>({\n defaultElement: \"option\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n value,\n selected: undefined,\n // Only the Option's own prop: `Root disabled` and the Group disable natively themselves.\n disabled: disabledProp,\n \"data-selected\": dataAttr(selected),\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n },\n ref,\n });\n}\n\nSelectOption.displayName = \"SelectOption\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmEA,SAAgB,aAAa,EAC3B,OACA,UAAU,eAAe,OACzB,WACA,OACA,UACA,QACA,GAAG,QACiB;CACpB,MAAM,MAAM,iBAAiB,eAAe;CAC5C,MAAM,WAAW,IAAI,eAAe;CACpC,MAAM,UAAU,IAAI,WAAW;CAC/B,MAAM,WAAW,IAAI,YAAY,IAAI,iBAAiB;CACtD,MAAM,WAAW,iBAAiB;CAClC,MAAM,EAAE,KAAK,SAAS,iBAAoC,iBAAiB,QAAQ;CAInF,MAAM,cAAc,qBAAqB;EACvC,MAAM,KAAK,KAAK;EAChB,IAAI,OAAO,MAAM;GAGf,aAAa,IAAI,iBAAiB,QAAQ;GAC1C,aAAa,IAAI,gBAAgB,OAAO;GACxC,aAAa,IAAI,iBAAiB,QAAQ;EAC5C;EACA,IAAI,cAAc,IAAI,QAAQ;CAChC,CAAC;CACD,sBAAsB;EACpB,YAAY;CACd,GAAG,CAAC,CAAC;CAIL,OAAO,UAA8D;EACnE,gBAAgB;EAChB;EACA,OAAA;GALiC;GAAO;GAAU;GAAS;EAKvD;EACJ;EACA;EACA;EACA,OAAO;EACP,cAAc;GACZ;GACA,UAAU,KAAA;GAEV,UAAU;GACV,iBAAiB,SAAS,QAAQ;GAClC,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;EACpC;EACA;CACF,CAAC;AACH;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"select-option.mjs","names":[],"sources":["../../src/select/select-option.tsx"],"sourcesContent":["\"use client\";\nimport { useEffectEvent, useLayoutEffect } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { syncPresence } from \"../internal/form/sync-presence.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useHydratedMount } from \"../internal/use-hydrated-mount.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useSelectContext } from \"./select-context.js\";\nimport { useSelectPartRef } from \"./select-dom.js\";\n\n/**\n * State of `Select.Option`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface SelectOptionState {\n /** The Option's `value` prop. */\n readonly value: string;\n /** Optimistic: true as soon as the user picks this option, before the action settles. */\n readonly selected: boolean;\n /** The Root is pending and this option is the optimistic target. */\n readonly pending: boolean;\n /** Disabled by its own prop, a disabled `Select.Group`, or `Root disabled` (as `:disabled`). */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `Select.Option`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport interface SelectOptionProps extends Omit<\n ComponentPropsWithRef<\"option\">,\n \"value\" | \"selected\" | \"className\" | \"style\" | \"children\"\n> {\n /** The option's value. Required: React cannot infer a value from rich children. */\n value: string;\n /**\n * Native `disabled`: not pickable, skipped by keyboard navigation.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, SelectOptionState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, SelectOptionState>;\n /**\n * The option's content. Keep it readable as plain text: engines without customizable select\n * (Firefox today) show only the text. Give icons `aria-hidden` and no text. Avoid the `label`\n * attribute (Chromium names the option from it but shows the content).\n */\n children?: StateValue<ReactNode, SelectOptionState>;\n /** Replace the rendered element. Must keep an `<option>`. */\n render?: RenderProp<ComponentPropsWithRef<\"option\">, SelectOptionState>;\n}\n\n/**\n * One `<option>`. It never renders `selected`: the selection is the Root's `value={optimistic}`\n * plus the Root's re-apply for options that mount after the select's own commit (a Suspense\n * boundary or `use()` inside the select), which the Option reports from its mount layout effect.\n *\n * Owned keys: `value`, `selected` (never rendered), `disabled`, `data-selected`, `data-pending`,\n * `data-disabled`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport function SelectOption({\n value,\n disabled: disabledProp = false,\n className,\n style,\n children,\n render,\n ...rest\n}: SelectOptionProps) {\n const ctx = useSelectContext(\"Select.Option\");\n const selected = ctx.optimistic === value;\n const pending = ctx.pending && selected;\n const disabled = ctx.disabled || ctx.groupDisabled || disabledProp;\n const hydrated = useHydratedMount();\n const { ref, node } = useSelectPartRef<HTMLOptionElement>(\"Select.Option\", \"option\");\n\n // Reads the mount render's values: for a hydrated option that is the hydration render, which\n // used the server snapshot (`hydrated === true`).\n const reportMount = useEffectEvent(() => {\n const el = node.current;\n if (el !== null) {\n // Hydration keeps server attributes that differ from the client render (React only warns);\n // an option hydrating after its Root can render a different state than the server did.\n syncPresence(el, \"data-selected\", selected);\n syncPresence(el, \"data-pending\", pending);\n syncPresence(el, \"data-disabled\", disabled);\n }\n ctx.optionMounted(el, hydrated);\n });\n useLayoutEffect(() => {\n reportMount();\n }, []);\n\n const state: SelectOptionState = { value, selected, pending, disabled };\n\n return useRender<ComponentPropsWithRef<\"option\">, SelectOptionState>({\n defaultElement: \"option\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n value,\n selected: undefined,\n // Only the Option's own prop: `Root disabled` and the Group disable natively themselves.\n disabled: disabledProp,\n \"data-selected\": dataAttr(selected),\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n },\n ref,\n });\n}\n\nSelectOption.displayName = \"SelectOption\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmEA,SAAgB,aAAa,EAC3B,OACA,UAAU,eAAe,OACzB,WACA,OACA,UACA,QACA,GAAG,QACiB;CACpB,MAAM,MAAM,iBAAiB,eAAe;CAC5C,MAAM,WAAW,IAAI,eAAe;CACpC,MAAM,UAAU,IAAI,WAAW;CAC/B,MAAM,WAAW,IAAI,YAAY,IAAI,iBAAiB;CACtD,MAAM,WAAW,iBAAiB;CAClC,MAAM,EAAE,KAAK,SAAS,iBAAoC,iBAAiB,QAAQ;CAInF,MAAM,cAAc,qBAAqB;EACvC,MAAM,KAAK,KAAK;EAChB,IAAI,OAAO,MAAM;GAGf,aAAa,IAAI,iBAAiB,QAAQ;GAC1C,aAAa,IAAI,gBAAgB,OAAO;GACxC,aAAa,IAAI,iBAAiB,QAAQ;EAC5C;EACA,IAAI,cAAc,IAAI,QAAQ;CAChC,CAAC;CACD,sBAAsB;EACpB,YAAY;CACd,GAAG,CAAC,CAAC;CAIL,OAAO,UAA8D;EACnE,gBAAgB;EAChB;EACA,OAAA;GALiC;GAAO;GAAU;GAAS;EAKvD;EACJ;EACA;EACA;EACA,OAAO;EACP,cAAc;GACZ;GACA,UAAU,KAAA;GAEV,UAAU;GACV,iBAAiB,SAAS,QAAQ;GAClC,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;EACpC;EACA;CACF,CAAC;AACH;AAEA,aAAa,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"select-root.d.mts","names":[],"sources":["../../src/select/select-root.tsx"],"mappings":";;;;iBA2BiB,iCAAiC;;;;;;;;WAQvC,QAAQ;;;;;;;iBAQF;;WAEN;;WAEA;;WAEA;;;;;;;iBAQM,wBAAwB,KACvC;;EAYA;;;;;;;;;;EAUA;;;;;;;;;;;EAWA,oBAAoB,qBAAqB;;;;;;EAMzC;;EAEA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;;;EAI9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;wBAevC,aACd,OACA,cACA,mBACA,UAAU,cACV,WACA,OACA,UACA,WACG,QACF,kCAAe,IAAA;yBAVF"}
1
+ {"version":3,"file":"select-root.d.mts","names":[],"sources":["../../src/select/select-root.tsx"],"mappings":";;;;iBA4BiB,iCAAiC;;;;;;;;WAQvC,QAAQ;;;;;;;iBAQF;;WAEN;;WAEA;;WAEA;;;;;;;iBAQM,wBAAwB,KACvC;;EAYA;;;;;;;;;;EAUA;;;;;;;;;;;EAWA,oBAAoB,qBAAqB;;;;;;EAMzC;;EAEA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;;;EAI9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;wBAevC,aACd,OACA,cACA,mBACA,UAAU,cACV,WACA,OACA,UACA,WACG,QACF,kCAAe,IAAA;yBAVF"}
@@ -1,15 +1,16 @@
1
1
  "use client";
2
- import { createActionDetails } from "../internal/action-details.mjs";
2
+ import { createActionDetails } from "../internal/action/action-details.mjs";
3
3
  import { dataAttr } from "../internal/data-attr.mjs";
4
4
  import { useRender } from "../internal/use-render.mjs";
5
5
  import { transitionTypes } from "../internal/transition-types.mjs";
6
- import { useControllableAction } from "../internal/use-controllable-action.mjs";
6
+ import { useControllableAction } from "../internal/action/use-controllable-action.mjs";
7
7
  import { useMergedRefs } from "../internal/use-merged-refs.mjs";
8
- import { fieldInputProps, useFieldControl, useFieldValueChange } from "../internal/use-field-control.mjs";
8
+ import { fieldInputProps, useFieldControl, useFieldValueChange } from "../internal/form/use-field-control.mjs";
9
+ import { useResetTarget } from "../internal/form/use-form-reset.mjs";
9
10
  import { SelectContext } from "./select-context.mjs";
10
11
  import { useSelectPartRef } from "./select-dom.mjs";
11
- import { useNativeSelectValue } from "../internal/use-native-select-value.mjs";
12
- import { useMemo, useRef, useState } from "react";
12
+ import { useNativeSelectValue } from "../internal/form/use-native-select-value.mjs";
13
+ import { useMemo, useRef } from "react";
13
14
  import { jsx } from "react/jsx-runtime";
14
15
  //#region src/select/select-root.tsx
15
16
  /**
@@ -48,8 +49,7 @@ function SelectRoot({ value, defaultValue, valueChangeAction, disabled: disabled
48
49
  }
49
50
  });
50
51
  useFieldValueChange(optimistic);
51
- const [mountValue] = useState(value);
52
- const resetTarget = value === void 0 ? defaultValue : mountValue ?? value;
52
+ const resetTarget = useResetTarget(value, defaultValue) ?? value;
53
53
  const established = useRef(false);
54
54
  const dispatchChange = (next, details) => {
55
55
  established.current = true;
@@ -1 +1 @@
1
- {"version":3,"file":"select-root.mjs","names":[],"sources":["../../src/select/select-root.tsx"],"sourcesContent":["\"use client\";\nimport { useMemo, useRef, useState } from \"react\";\nimport type { ChangeEvent, ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\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 {\n fieldInputProps,\n useFieldControl,\n useFieldValueChange,\n} from \"../internal/use-field-control.js\";\nimport { useMergedRefs } from \"../internal/use-merged-refs.js\";\nimport { useNativeSelectValue } from \"../internal/use-native-select-value.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { SelectContext } from \"./select-context.js\";\nimport type { SelectContextValue } from \"./select-context.js\";\nimport { useSelectPartRef } from \"./select-dom.js\";\n\n/** Details passed as the second argument of `valueChangeAction`. */\nexport interface SelectValueChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user picked an option (pointer, keyboard, typeahead, or browser autofill,\n * which the library cannot tell from a pick); `details.event` is the native `change` event.\n * `\"platform\"`: the browser changed the value without a pick the library saw: a form reset\n * (`details.event` is the `reset` event), or a pick before hydration / Firefox form-state\n * restoration reconciled at mount (`details.event` is `undefined`).\n */\n readonly reason: ChangeReason;\n}\n\n/**\n * State of `Select.Root`, `Select.Trigger`, `Select.Value`, `Select.Group`, `Select.GroupLabel`,\n * `Select.Separator`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface SelectRootState {\n /** Optimistic value. Content rendered from it must not suspend. */\n readonly value: string;\n /** An action dispatched through this Select is in flight. */\n readonly pending: boolean;\n /** The `disabled` prop. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `Select.Root`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport interface SelectRootProps extends Omit<\n ComponentPropsWithRef<\"select\">,\n | \"value\"\n | \"defaultValue\"\n | \"onChange\"\n | \"multiple\"\n | \"size\"\n | \"disabled\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** Controlled value. `undefined` means uncontrolled. Use `\"\"` for the placeholder option. */\n value?: string;\n /**\n * Initial value in uncontrolled mode, and the value a form reset returns to (the latest prop is\n * mirrored into the options' `defaultSelected`). When omitted, the browser's choice (an option\n * whose value is `\"\"`, else the first enabled option) is adopted at mount, without a dispatch,\n * and is what a form reset returns to. Until a pick (or a platform change) sets the value,\n * options that mount later without the adopted one (a Suspense fallback) adopt again.\n *\n * @defaultValue the browser's choice\n */\n defaultValue?: string;\n /**\n * Runs inside the Root's transition whenever the selected option changes. May be sync or async\n * (also a Server Function); rejections reach the nearest Error Boundary and roll the selection\n * back.\n *\n * In engines whose closed select changes the value on every arrow press (Firefox, Safari with\n * native appearance), every press dispatches; the latest dispatch wins. A `setState` placed\n * after your own `await` is not a Transition update; wrap it in `startTransition` (React\n * limitation). Controlled mode is the way to veto a change.\n */\n valueChangeAction?: ChangeAction<string, SelectValueChangeDetails>;\n /**\n * Native `disabled`. Never set by the library while pending.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, SelectRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, SelectRootState>;\n /**\n * The options and the Trigger. The function form receives the optimistic value; must not suspend.\n */\n children?: StateValue<ReactNode, SelectRootState>;\n /** Replace the rendered element. Must keep a `<select>`. */\n render?: RenderProp<ComponentPropsWithRef<\"select\">, SelectRootState>;\n}\n\n/**\n * The `<select>` itself: owns the value, the transition, the form-reset listener, the mount\n * reconciliation and the re-apply of late options (design/components/select.md 15.2). Renders\n * `value={optimistic}`: react-dom restores a controlled select to its props after every event,\n * and only the sync-lane optimistic value survives that restore.\n *\n * Owned keys (conventions 1.2): `value`, `disabled`, `data-pending`, `data-disabled`, `onChange`;\n * inside a `Field.Root` also `id`, `name`, `required`, `aria-invalid`, `aria-describedby`\n * (token-merged) and `data-invalid`, and `disabled` / `name` / `required` default from the Field.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport function SelectRoot({\n value,\n defaultValue,\n valueChangeAction,\n disabled: disabledProp,\n className,\n style,\n children,\n render,\n ...rest\n}: SelectRootProps) {\n const { ref: libraryRef, node: selectRef } = useSelectPartRef<HTMLSelectElement>(\n \"Select.Root\",\n \"select\",\n );\n // Inside a Field.Root (design/components/field-form.md 7.2) the Field owns the id and the ARIA\n // wiring, and `name` / `required` / `disabled` default from it.\n const field = useFieldControl({\n labelable: true,\n name: rest.name,\n disabled: disabledProp,\n required: rest.required,\n id: rest.id,\n component: \"Select.Root\",\n });\n const disabled = field.disabled;\n const rootRef = useMergedRefs<HTMLSelectElement>(libraryRef, field.ref);\n\n const { optimistic, pending, dispatch, latestInFlight, adopt } = useControllableAction<\n string,\n SelectValueChangeDetails\n >({\n controlled: value,\n defaultValue,\n initialValue: \"\",\n action: valueChangeAction,\n transitionTypes: () => transitionTypes(\"select\"),\n warn: { component: \"Select.Root\", prop: \"value\" },\n });\n // Inside a Field: a value React writes with no event (a rejected action rolling back, a\n // controlled change) re-reads validity and `validate` after the commit.\n useFieldValueChange(optimistic);\n // Deliberately no warning when neither `value` nor `defaultValue` is given: the browser's\n // first-option default is adopted (design decisions 3 and 4).\n\n // Controlled: the mount-time value is the reset target (conventions 3.8 rule 6). Neither\n // `value` nor `defaultValue`: the value adopted at mount, chosen inside the hook.\n const [mountValue] = useState(value);\n const resetTarget = value === undefined ? defaultValue : (mountValue ?? value);\n\n // Any dispatch, a pick or a platform change, ends the adoption of the browser's default.\n const established = useRef(false);\n const dispatchChange = (next: string, details: SelectValueChangeDetails) => {\n established.current = true;\n dispatch(next, details);\n };\n\n const { optionMounted } = useNativeSelectValue({\n ref: selectRef,\n optimistic,\n latestInFlight,\n resetTarget,\n adoptDefault:\n value === undefined && defaultValue === undefined\n ? { adopt, established: () => established.current }\n : undefined,\n onPlatformChange: (next, event) =>\n dispatchChange(next, createActionDetails(event, { reason: \"platform\" })),\n });\n\n // Memoised: every member is a state value, a prop or a stable callback.\n const context = useMemo<SelectContextValue>(\n () => ({ optimistic, pending, disabled, groupDisabled: false, optionMounted }),\n [optimistic, pending, disabled, optionMounted],\n );\n const state: SelectRootState = { value: optimistic, pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"select\">, SelectRootState>({\n defaultElement: \"select\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n ...fieldInputProps(field),\n value: optimistic,\n disabled,\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n onChange: (event: ChangeEvent<HTMLSelectElement>) => {\n // A natively disabled select fires no change; this covers `render` elements.\n if (disabled) return;\n const next = event.currentTarget.value;\n // No-op rule against the optimistic value (conventions 2.3, design 4.2).\n if (next === optimistic) return;\n dispatchChange(next, createActionDetails(event.nativeEvent, { reason: \"activate\" }));\n },\n },\n ref: rootRef,\n });\n\n return <SelectContext value={context}>{element}</SelectContext>;\n}\n\nSelectRoot.displayName = \"SelectRoot\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0HA,SAAgB,WAAW,EACzB,OACA,cACA,mBACA,UAAU,cACV,WACA,OACA,UACA,QACA,GAAG,QACe;CAClB,MAAM,EAAE,KAAK,YAAY,MAAM,cAAc,iBAC3C,eACA,QACF;CAGA,MAAM,QAAQ,gBAAgB;EAC5B,WAAW;EACX,MAAM,KAAK;EACX,UAAU;EACV,UAAU,KAAK;EACf,IAAI,KAAK;EACT,WAAW;CACb,CAAC;CACD,MAAM,WAAW,MAAM;CACvB,MAAM,UAAU,cAAiC,YAAY,MAAM,GAAG;CAEtE,MAAM,EAAE,YAAY,SAAS,UAAU,gBAAgB,UAAU,sBAG/D;EACA,YAAY;EACZ;EACA,cAAc;EACd,QAAQ;EACR,uBAAuB,gBAAgB,QAAQ;EAC/C,MAAM;GAAE,WAAW;GAAe,MAAM;EAAQ;CAClD,CAAC;CAGD,oBAAoB,UAAU;CAM9B,MAAM,CAAC,cAAc,SAAS,KAAK;CACnC,MAAM,cAAc,UAAU,KAAA,IAAY,eAAgB,cAAc;CAGxE,MAAM,cAAc,OAAO,KAAK;CAChC,MAAM,kBAAkB,MAAc,YAAsC;EAC1E,YAAY,UAAU;EACtB,SAAS,MAAM,OAAO;CACxB;CAEA,MAAM,EAAE,kBAAkB,qBAAqB;EAC7C,KAAK;EACL;EACA;EACA;EACA,cACE,UAAU,KAAA,KAAa,iBAAiB,KAAA,IACpC;GAAE;GAAO,mBAAmB,YAAY;EAAQ,IAChD,KAAA;EACN,mBAAmB,MAAM,UACvB,eAAe,MAAM,oBAAoB,OAAO,EAAE,QAAQ,WAAW,CAAC,CAAC;CAC3E,CAAC;CAGD,MAAM,UAAU,eACP;EAAE;EAAY;EAAS;EAAU,eAAe;EAAO;CAAc,IAC5E;EAAC;EAAY;EAAS;EAAU;CAAa,CAC/C;CAGA,MAAM,UAAU,UAA4D;EAC1E,gBAAgB;EAChB;EACA,OAAA;GAL+B,OAAO;GAAY;GAAS;EAKvD;EACJ;EACA;EACA;EACA,OAAO;EACP,cAAc;GACZ,GAAG,gBAAgB,KAAK;GACxB,OAAO;GACP;GACA,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;GAClC,WAAW,UAA0C;IAEnD,IAAI,UAAU;IACd,MAAM,OAAO,MAAM,cAAc;IAEjC,IAAI,SAAS,YAAY;IACzB,eAAe,MAAM,oBAAoB,MAAM,aAAa,EAAE,QAAQ,WAAW,CAAC,CAAC;GACrF;EACF;EACA,KAAK;CACP,CAAC;CAED,OAAO,oBAAC,eAAD;EAAe,OAAO;EAAU,UAAA;CAAuB,CAAA;AAChE;AAEA,WAAW,cAAc"}
1
+ {"version":3,"file":"select-root.mjs","names":[],"sources":["../../src/select/select-root.tsx"],"sourcesContent":["\"use client\";\nimport { useMemo, useRef } from \"react\";\nimport type { ChangeEvent, ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { createActionDetails } from \"../internal/action/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/action/use-controllable-action.js\";\nimport {\n fieldInputProps,\n useFieldControl,\n useFieldValueChange,\n} from \"../internal/form/use-field-control.js\";\nimport { useResetTarget } from \"../internal/form/use-form-reset.js\";\nimport { useMergedRefs } from \"../internal/use-merged-refs.js\";\nimport { useNativeSelectValue } from \"../internal/form/use-native-select-value.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { SelectContext } from \"./select-context.js\";\nimport type { SelectContextValue } from \"./select-context.js\";\nimport { useSelectPartRef } from \"./select-dom.js\";\n\n/** Details passed as the second argument of `valueChangeAction`. */\nexport interface SelectValueChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user picked an option (pointer, keyboard, typeahead, or browser autofill,\n * which the library cannot tell from a pick); `details.event` is the native `change` event.\n * `\"platform\"`: the browser changed the value without a pick the library saw: a form reset\n * (`details.event` is the `reset` event), or a pick before hydration / Firefox form-state\n * restoration reconciled at mount (`details.event` is `undefined`).\n */\n readonly reason: ChangeReason;\n}\n\n/**\n * State of `Select.Root`, `Select.Trigger`, `Select.Value`, `Select.Group`, `Select.GroupLabel`,\n * `Select.Separator`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface SelectRootState {\n /** Optimistic value. Content rendered from it must not suspend. */\n readonly value: string;\n /** An action dispatched through this Select is in flight. */\n readonly pending: boolean;\n /** The `disabled` prop. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `Select.Root`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport interface SelectRootProps extends Omit<\n ComponentPropsWithRef<\"select\">,\n | \"value\"\n | \"defaultValue\"\n | \"onChange\"\n | \"multiple\"\n | \"size\"\n | \"disabled\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /** Controlled value. `undefined` means uncontrolled. Use `\"\"` for the placeholder option. */\n value?: string;\n /**\n * Initial value in uncontrolled mode, and the value a form reset returns to (the latest prop is\n * mirrored into the options' `defaultSelected`). When omitted, the browser's choice (an option\n * whose value is `\"\"`, else the first enabled option) is adopted at mount, without a dispatch,\n * and is what a form reset returns to. Until a pick (or a platform change) sets the value,\n * options that mount later without the adopted one (a Suspense fallback) adopt again.\n *\n * @defaultValue the browser's choice\n */\n defaultValue?: string;\n /**\n * Runs inside the Root's transition whenever the selected option changes. May be sync or async\n * (also a Server Function); rejections reach the nearest Error Boundary and roll the selection\n * back.\n *\n * In engines whose closed select changes the value on every arrow press (Firefox, Safari with\n * native appearance), every press dispatches; the latest dispatch wins. A `setState` placed\n * after your own `await` is not a Transition update; wrap it in `startTransition` (React\n * limitation). Controlled mode is the way to veto a change.\n */\n valueChangeAction?: ChangeAction<string, SelectValueChangeDetails>;\n /**\n * Native `disabled`. Never set by the library while pending.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, SelectRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, SelectRootState>;\n /**\n * The options and the Trigger. The function form receives the optimistic value; must not suspend.\n */\n children?: StateValue<ReactNode, SelectRootState>;\n /** Replace the rendered element. Must keep a `<select>`. */\n render?: RenderProp<ComponentPropsWithRef<\"select\">, SelectRootState>;\n}\n\n/**\n * The `<select>` itself: owns the value, the transition, the form-reset listener, the mount\n * reconciliation and the re-apply of late options (design/components/select.md 15.2). Renders\n * `value={optimistic}`: react-dom restores a controlled select to its props after every event,\n * and only the sync-lane optimistic value survives that restore.\n *\n * Owned keys (conventions 1.2): `value`, `disabled`, `data-pending`, `data-disabled`, `onChange`;\n * inside a `Field.Root` also `id`, `name`, `required`, `aria-invalid`, `aria-describedby`\n * (token-merged) and `data-invalid`, and `disabled` / `name` / `required` default from the Field.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport function SelectRoot({\n value,\n defaultValue,\n valueChangeAction,\n disabled: disabledProp,\n className,\n style,\n children,\n render,\n ...rest\n}: SelectRootProps) {\n const { ref: libraryRef, node: selectRef } = useSelectPartRef<HTMLSelectElement>(\n \"Select.Root\",\n \"select\",\n );\n // Inside a Field.Root (design/components/field-form.md 7.2) the Field owns the id and the ARIA\n // wiring, and `name` / `required` / `disabled` default from it.\n const field = useFieldControl({\n labelable: true,\n name: rest.name,\n disabled: disabledProp,\n required: rest.required,\n id: rest.id,\n component: \"Select.Root\",\n });\n const disabled = field.disabled;\n const rootRef = useMergedRefs<HTMLSelectElement>(libraryRef, field.ref);\n\n const { optimistic, pending, dispatch, latestInFlight, adopt } = useControllableAction<\n string,\n SelectValueChangeDetails\n >({\n controlled: value,\n defaultValue,\n initialValue: \"\",\n action: valueChangeAction,\n transitionTypes: () => transitionTypes(\"select\"),\n warn: { component: \"Select.Root\", prop: \"value\" },\n });\n // Inside a Field: a value React writes with no event (a rejected action rolling back, a\n // controlled change) re-reads validity and `validate` after the commit.\n useFieldValueChange(optimistic);\n // Deliberately no warning when neither `value` nor `defaultValue` is given: the browser's\n // first-option default is adopted (design decisions 3 and 4).\n\n // Controlled: the mount-time value is the reset target (conventions 3.8 rule 6). Neither\n // `value` nor `defaultValue`: the value adopted at mount, chosen inside the hook.\n const resetTarget = useResetTarget(value, defaultValue) ?? value;\n\n // Any dispatch, a pick or a platform change, ends the adoption of the browser's default.\n const established = useRef(false);\n const dispatchChange = (next: string, details: SelectValueChangeDetails) => {\n established.current = true;\n dispatch(next, details);\n };\n\n const { optionMounted } = useNativeSelectValue({\n ref: selectRef,\n optimistic,\n latestInFlight,\n resetTarget,\n adoptDefault:\n value === undefined && defaultValue === undefined\n ? { adopt, established: () => established.current }\n : undefined,\n onPlatformChange: (next, event) =>\n dispatchChange(next, createActionDetails(event, { reason: \"platform\" })),\n });\n\n // Memoised: every member is a state value, a prop or a stable callback.\n const context = useMemo<SelectContextValue>(\n () => ({ optimistic, pending, disabled, groupDisabled: false, optionMounted }),\n [optimistic, pending, disabled, optionMounted],\n );\n const state: SelectRootState = { value: optimistic, pending, disabled };\n\n const element = useRender<ComponentPropsWithRef<\"select\">, SelectRootState>({\n defaultElement: \"select\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n ...fieldInputProps(field),\n value: optimistic,\n disabled,\n \"data-pending\": dataAttr(pending),\n \"data-disabled\": dataAttr(disabled),\n onChange: (event: ChangeEvent<HTMLSelectElement>) => {\n // A natively disabled select fires no change; this covers `render` elements.\n if (disabled) return;\n const next = event.currentTarget.value;\n // No-op rule against the optimistic value (conventions 2.3, design 4.2).\n if (next === optimistic) return;\n dispatchChange(next, createActionDetails(event.nativeEvent, { reason: \"activate\" }));\n },\n },\n ref: rootRef,\n });\n\n return <SelectContext value={context}>{element}</SelectContext>;\n}\n\nSelectRoot.displayName = \"SelectRoot\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2HA,SAAgB,WAAW,EACzB,OACA,cACA,mBACA,UAAU,cACV,WACA,OACA,UACA,QACA,GAAG,QACe;CAClB,MAAM,EAAE,KAAK,YAAY,MAAM,cAAc,iBAC3C,eACA,QACF;CAGA,MAAM,QAAQ,gBAAgB;EAC5B,WAAW;EACX,MAAM,KAAK;EACX,UAAU;EACV,UAAU,KAAK;EACf,IAAI,KAAK;EACT,WAAW;CACb,CAAC;CACD,MAAM,WAAW,MAAM;CACvB,MAAM,UAAU,cAAiC,YAAY,MAAM,GAAG;CAEtE,MAAM,EAAE,YAAY,SAAS,UAAU,gBAAgB,UAAU,sBAG/D;EACA,YAAY;EACZ;EACA,cAAc;EACd,QAAQ;EACR,uBAAuB,gBAAgB,QAAQ;EAC/C,MAAM;GAAE,WAAW;GAAe,MAAM;EAAQ;CAClD,CAAC;CAGD,oBAAoB,UAAU;CAM9B,MAAM,cAAc,eAAe,OAAO,YAAY,KAAK;CAG3D,MAAM,cAAc,OAAO,KAAK;CAChC,MAAM,kBAAkB,MAAc,YAAsC;EAC1E,YAAY,UAAU;EACtB,SAAS,MAAM,OAAO;CACxB;CAEA,MAAM,EAAE,kBAAkB,qBAAqB;EAC7C,KAAK;EACL;EACA;EACA;EACA,cACE,UAAU,KAAA,KAAa,iBAAiB,KAAA,IACpC;GAAE;GAAO,mBAAmB,YAAY;EAAQ,IAChD,KAAA;EACN,mBAAmB,MAAM,UACvB,eAAe,MAAM,oBAAoB,OAAO,EAAE,QAAQ,WAAW,CAAC,CAAC;CAC3E,CAAC;CAGD,MAAM,UAAU,eACP;EAAE;EAAY;EAAS;EAAU,eAAe;EAAO;CAAc,IAC5E;EAAC;EAAY;EAAS;EAAU;CAAa,CAC/C;CAGA,MAAM,UAAU,UAA4D;EAC1E,gBAAgB;EAChB;EACA,OAAA;GAL+B,OAAO;GAAY;GAAS;EAKvD;EACJ;EACA;EACA;EACA,OAAO;EACP,cAAc;GACZ,GAAG,gBAAgB,KAAK;GACxB,OAAO;GACP;GACA,gBAAgB,SAAS,OAAO;GAChC,iBAAiB,SAAS,QAAQ;GAClC,WAAW,UAA0C;IAEnD,IAAI,UAAU;IACd,MAAM,OAAO,MAAM,cAAc;IAEjC,IAAI,SAAS,YAAY;IACzB,eAAe,MAAM,oBAAoB,MAAM,aAAa,EAAE,QAAQ,WAAW,CAAC,CAAC;GACrF;EACF;EACA,KAAK;CACP,CAAC;CAED,OAAO,oBAAC,eAAD;EAAe,OAAO;EAAU,UAAA;CAAuB,CAAA;AAChE;AAEA,WAAW,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"select-trigger.d.mts","names":[],"sources":["../../src/select/select-trigger.tsx"],"mappings":";;;;;;;;;iBAciB,2BAA2B,KAC1C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;;;;EAK9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;wBAsBvC,gBAAgB,WAAW,OAAO,UAAU,WAAW,QAAQ,qBAAkB;yBAAjF"}
1
+ {"version":3,"file":"select-trigger.d.mts","names":[],"sources":["../../src/select/select-trigger.tsx"],"mappings":";;;;;;;;;iBAciB,2BAA2B,KAC1C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;;;;EAK9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;wBAyBvC,gBAAgB,WAAW,OAAO,UAAU,WAAW,QAAQ,qBAAkB;yBAAjF"}
@@ -4,6 +4,8 @@ import { useRender } from "../internal/use-render.mjs";
4
4
  import { useSelectContext } from "./select-context.mjs";
5
5
  import { useSelectPartRef } from "./select-dom.mjs";
6
6
  //#region src/select/select-trigger.tsx
7
+ const isDev = process.env.NODE_ENV !== "production";
8
+ /** Development only: passed behind `isDev`, so the text folds away in production (#161). */
7
9
  function firstChildOfSelect(el) {
8
10
  const parent = el.parentElement;
9
11
  if (parent?.tagName === "SELECT" && parent.firstElementChild === el) return null;
@@ -26,7 +28,7 @@ function SelectTrigger({ className, style, children, render, ...rest }) {
26
28
  pending: ctx.pending,
27
29
  disabled: ctx.disabled
28
30
  };
29
- const { ref } = useSelectPartRef("Select.Trigger", "button", firstChildOfSelect);
31
+ const { ref } = useSelectPartRef("Select.Trigger", "button", isDev ? firstChildOfSelect : void 0);
30
32
  return useRender({
31
33
  defaultElement: "button",
32
34
  render,
@@ -1 +1 @@
1
- {"version":3,"file":"select-trigger.mjs","names":[],"sources":["../../src/select/select-trigger.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useSelectContext } from \"./select-context.js\";\nimport { useSelectPartRef } from \"./select-dom.js\";\nimport type { SelectRootState } from \"./select-root.js\";\n\n/**\n * Props of `Select.Trigger`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport interface SelectTriggerProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n \"type\" | \"className\" | \"style\" | \"children\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, SelectRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, SelectRootState>;\n /**\n * Non-interactive content only (HTML content model of a select's button), usually\n * `<Select.Value />`. Not rendered by engines without customizable select (Firefox today).\n */\n children?: StateValue<ReactNode, SelectRootState>;\n /** Replace the rendered element. Must keep a `<button>`. */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, SelectRootState>;\n}\n\nfunction firstChildOfSelect(el: HTMLButtonElement): string | null {\n const parent = el.parentElement;\n if (parent?.tagName === \"SELECT\" && parent.firstElementChild === el) return null;\n return (\n \"must be the first child of Select.Root's <select> (HTML content model); elsewhere the \" +\n \"browser does not use it as the select's button.\"\n );\n}\n\n/**\n * The select's own `<button>` (customizable select): replaces the UA button in engines with\n * `appearance: base-select`. Optional; **must be the first child** of `Select.Root`. Its state is\n * the Root's state, so a pending indicator next to `<Select.Value />` goes in its function\n * `children`.\n *\n * Owned keys: `type` (always `\"button\"`), `data-pending`, `data-disabled`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport function SelectTrigger({ className, style, children, render, ...rest }: SelectTriggerProps) {\n const ctx = useSelectContext(\"Select.Trigger\");\n const state: SelectRootState = {\n value: ctx.optimistic,\n pending: ctx.pending,\n disabled: ctx.disabled,\n };\n const { ref } = useSelectPartRef<HTMLButtonElement>(\n \"Select.Trigger\",\n \"button\",\n firstChildOfSelect,\n );\n return useRender<ComponentPropsWithRef<\"button\">, SelectRootState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n // Explicit: Chromium 156 reports `.type === \"submit\"` for a select's button.\n type: \"button\",\n \"data-pending\": dataAttr(ctx.pending),\n \"data-disabled\": dataAttr(ctx.disabled),\n },\n ref,\n });\n}\n\nSelectTrigger.displayName = \"SelectTrigger\";\n"],"mappings":";;;;;;AA+BA,SAAS,mBAAmB,IAAsC;CAChE,MAAM,SAAS,GAAG;CAClB,IAAI,QAAQ,YAAY,YAAY,OAAO,sBAAsB,IAAI,OAAO;CAC5E,OACE;AAGJ;;;;;;;;;;;AAYA,SAAgB,cAAc,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA4B;CACjG,MAAM,MAAM,iBAAiB,gBAAgB;CAC7C,MAAM,QAAyB;EAC7B,OAAO,IAAI;EACX,SAAS,IAAI;EACb,UAAU,IAAI;CAChB;CACA,MAAM,EAAE,QAAQ,iBACd,kBACA,UACA,kBACF;CACA,OAAO,UAA4D;EACjE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc;GAEZ,MAAM;GACN,gBAAgB,SAAS,IAAI,OAAO;GACpC,iBAAiB,SAAS,IAAI,QAAQ;EACxC;EACA;CACF,CAAC;AACH;AAEA,cAAc,cAAc"}
1
+ {"version":3,"file":"select-trigger.mjs","names":[],"sources":["../../src/select/select-trigger.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useSelectContext } from \"./select-context.js\";\nimport { useSelectPartRef } from \"./select-dom.js\";\nimport type { SelectRootState } from \"./select-root.js\";\n\n/**\n * Props of `Select.Trigger`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport interface SelectTriggerProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n \"type\" | \"className\" | \"style\" | \"children\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, SelectRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, SelectRootState>;\n /**\n * Non-interactive content only (HTML content model of a select's button), usually\n * `<Select.Value />`. Not rendered by engines without customizable select (Firefox today).\n */\n children?: StateValue<ReactNode, SelectRootState>;\n /** Replace the rendered element. Must keep a `<button>`. */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, SelectRootState>;\n}\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/** Development only: passed behind `isDev`, so the text folds away in production (#161). */\nfunction firstChildOfSelect(el: HTMLButtonElement): string | null {\n const parent = el.parentElement;\n if (parent?.tagName === \"SELECT\" && parent.firstElementChild === el) return null;\n return (\n \"must be the first child of Select.Root's <select> (HTML content model); elsewhere the \" +\n \"browser does not use it as the select's button.\"\n );\n}\n\n/**\n * The select's own `<button>` (customizable select): replaces the UA button in engines with\n * `appearance: base-select`. Optional; **must be the first child** of `Select.Root`. Its state is\n * the Root's state, so a pending indicator next to `<Select.Value />` goes in its function\n * `children`.\n *\n * Owned keys: `type` (always `\"button\"`), `data-pending`, `data-disabled`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport function SelectTrigger({ className, style, children, render, ...rest }: SelectTriggerProps) {\n const ctx = useSelectContext(\"Select.Trigger\");\n const state: SelectRootState = {\n value: ctx.optimistic,\n pending: ctx.pending,\n disabled: ctx.disabled,\n };\n const { ref } = useSelectPartRef<HTMLButtonElement>(\n \"Select.Trigger\",\n \"button\",\n isDev ? firstChildOfSelect : undefined,\n );\n return useRender<ComponentPropsWithRef<\"button\">, SelectRootState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: {\n // Explicit: Chromium 156 reports `.type === \"submit\"` for a select's button.\n type: \"button\",\n \"data-pending\": dataAttr(ctx.pending),\n \"data-disabled\": dataAttr(ctx.disabled),\n },\n ref,\n });\n}\n\nSelectTrigger.displayName = \"SelectTrigger\";\n"],"mappings":";;;;;;AA+BA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;AAGvC,SAAS,mBAAmB,IAAsC;CAChE,MAAM,SAAS,GAAG;CAClB,IAAI,QAAQ,YAAY,YAAY,OAAO,sBAAsB,IAAI,OAAO;CAC5E,OACE;AAGJ;;;;;;;;;;;AAYA,SAAgB,cAAc,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA4B;CACjG,MAAM,MAAM,iBAAiB,gBAAgB;CAC7C,MAAM,QAAyB;EAC7B,OAAO,IAAI;EACX,SAAS,IAAI;EACb,UAAU,IAAI;CAChB;CACA,MAAM,EAAE,QAAQ,iBACd,kBACA,UACA,QAAQ,qBAAqB,KAAA,CAC/B;CACA,OAAO,UAA4D;EACjE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc;GAEZ,MAAM;GACN,gBAAgB,SAAS,IAAI,OAAO;GACpC,iBAAiB,SAAS,IAAI,QAAQ;EACxC;EACA;CACF,CAAC;AACH;AAEA,cAAc,cAAc"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { useRender } from "../internal/use-render.mjs";
3
- import { useFormReset } from "../internal/use-form-reset.mjs";
3
+ import { useFormReset } from "../internal/form/use-form-reset.mjs";
4
4
  import { useSelectContext } from "./select-context.mjs";
5
5
  import { useSelectPartRef } from "./select-dom.mjs";
6
6
  import { useLayoutEffect, useMemo } from "react";
@@ -44,15 +44,12 @@ function refresh(select) {
44
44
  */
45
45
  function SelectValue({ className, style, render, ...rest }) {
46
46
  const ctx = useSelectContext("Select.Value");
47
- const { ref, node } = useSelectPartRef("Select.Value", "selectedcontent");
47
+ const { ref, node } = useSelectPartRef("Select.Value", "selectedcontent", isDev ? (el) => el.closest("select") === null ? "rendered outside the Select.Root's <select>; put it inside Select.Trigger, the select's first child." : null : void 0);
48
48
  useLayoutEffect(() => {
49
49
  const el = node.current;
50
50
  if (el === null) return;
51
51
  const select = el.closest("select");
52
- if (select === null) {
53
- if (isDev) console.error("Select.Value: rendered outside the Select.Root's <select>; put it inside Select.Trigger, the select's first child.");
54
- return;
55
- }
52
+ if (select === null) return;
56
53
  if (!supportsSelectedContent()) return;
57
54
  const observer = new MutationObserver((records) => {
58
55
  const selected = select.options[select.selectedIndex];
@@ -1 +1 @@
1
- {"version":3,"file":"select-value.mjs","names":[],"sources":["../../src/select/select-value.tsx"],"sourcesContent":["\"use client\";\nimport { useLayoutEffect, useMemo } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useFormReset } from \"../internal/use-form-reset.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useSelectContext } from \"./select-context.js\";\nimport { useSelectPartRef } from \"./select-dom.js\";\nimport type { SelectRootState } from \"./select-root.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/**\n * Props of `Select.Value`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport interface SelectValueProps extends Omit<\n ComponentPropsWithRef<\"selectedcontent\">,\n \"children\" | \"dangerouslySetInnerHTML\" | \"className\" | \"style\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, SelectRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, SelectRootState>;\n /** Replace the rendered element. Must keep a `<selectedcontent>`. */\n render?: RenderProp<ComponentPropsWithRef<\"selectedcontent\">, SelectRootState>;\n}\n\n/** Where the browser clones options into `<selectedcontent>` (Chromium 135+, Safari 27). */\nfunction supportsSelectedContent(): boolean {\n return typeof globalThis !== \"undefined\" && \"HTMLSelectedContentElement\" in globalThis;\n}\n\n/**\n * Whether a mutation record changes what `<selectedcontent>` shows: a record inside the selected\n * option. Attribute records on the option element itself are ignored (option attributes are not\n * cloned, and the library writes `data-*` there); records inside `<selectedcontent>` are never\n * inside an option, so the refresh's own clone does not loop.\n */\nfunction touchesSelected(record: MutationRecord, selected: HTMLOptionElement): boolean {\n if (record.type === \"attributes\" && record.target === selected) return false;\n return selected.contains(record.target);\n}\n\n/** Re-clones the selected option into `<selectedcontent>`. */\nfunction refresh(select: HTMLSelectElement): void {\n // Nothing selected: assigning the value would select the placeholder (probe case 7).\n if (select.selectedIndex === -1) return;\n // The assignment is the re-clone trigger; it fires no event and keeps the selection.\n const current = select.value;\n select.value = current;\n}\n\n/**\n * `<selectedcontent>`: the browser clones the selected option's content into it (inside\n * `Select.Trigger`). It has no `children`. Rendered with `suppressHydrationWarning` and an empty\n * `dangerouslySetInnerHTML` so that hydration accepts the content the parser cloned before React\n * ran (design/components/select.md 3.3).\n *\n * Also keeps it fresh: the platform re-clones only on selection changes, so when React changes\n * the selected option's content (a label, a state function, a Suspense boundary resolving inside\n * it), a `MutationObserver` re-assigns `select.value = select.value`, which re-clones without\n * events and without touching the selection or an open picker (6.3). The same refresh follows a\n * form reset, which Chromium does not re-clone for. Not installed where\n * `HTMLSelectedContentElement` is undefined (Firefox today, jsdom): nothing is cloned there.\n *\n * Owned keys: `dangerouslySetInnerHTML`, `suppressHydrationWarning`, `children`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport function SelectValue({ className, style, render, ...rest }: SelectValueProps) {\n const ctx = useSelectContext(\"Select.Value\");\n const { ref, node } = useSelectPartRef<HTMLElement>(\"Select.Value\", \"selectedcontent\");\n\n useLayoutEffect(() => {\n const el = node.current;\n if (el === null) return;\n const select = el.closest(\"select\");\n if (select === null) {\n if (isDev) {\n console.error(\n \"Select.Value: rendered outside the Select.Root's <select>; put it inside \" +\n \"Select.Trigger, the select's first child.\",\n );\n }\n return;\n }\n if (!supportsSelectedContent()) return;\n const observer = new MutationObserver((records) => {\n const selected = select.options[select.selectedIndex];\n if (selected === undefined) return;\n if (records.some((record) => touchesSelected(record, selected))) refresh(select);\n });\n observer.observe(select, {\n childList: true,\n characterData: true,\n attributes: true,\n subtree: true,\n });\n return () => {\n observer.disconnect();\n };\n }, [node]);\n\n // A form reset changes the selection without re-cloning (Chromium 156: `form.reset()` leaves\n // the old option's content in <selectedcontent>; memo/developer/select.md). `useFormReset`\n // listens on the select's form owner itself (so neither `stopPropagation()` on the form nor a\n // shadow root hides the event), follows a changed owner or `form` attribute, and calls back in\n // a microtask after an uncancelled reset. React's own reset after a form action is a\n // `form.reset()` too.\n const selectRef = useMemo(\n () => ({\n get current(): HTMLSelectElement | null {\n return node.current?.closest(\"select\") ?? null;\n },\n }),\n [node],\n );\n useFormReset(selectRef, () => {\n const select = selectRef.current;\n if (select !== null && supportsSelectedContent()) refresh(select);\n });\n\n const state: SelectRootState = {\n value: ctx.optimistic,\n pending: ctx.pending,\n disabled: ctx.disabled,\n };\n return useRender<ComponentPropsWithRef<\"selectedcontent\">, SelectRootState>({\n defaultElement: \"selectedcontent\",\n render,\n state,\n className,\n style,\n children: undefined,\n props: rest,\n libraryProps: {\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: { __html: \"\" },\n },\n ref,\n });\n}\n\nSelectValue.displayName = \"SelectValue\";\n"],"mappings":";;;;;;;AAUA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;AAoBvC,SAAS,0BAAmC;CAC1C,OAAO,OAAO,eAAe,eAAe,gCAAgC;AAC9E;;;;;;;AAQA,SAAS,gBAAgB,QAAwB,UAAsC;CACrF,IAAI,OAAO,SAAS,gBAAgB,OAAO,WAAW,UAAU,OAAO;CACvE,OAAO,SAAS,SAAS,OAAO,MAAM;AACxC;;AAGA,SAAS,QAAQ,QAAiC;CAEhD,IAAI,OAAO,kBAAkB,IAAI;CAGjC,OAAO,QADS,OAAO;AAEzB;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,YAAY,EAAE,WAAW,OAAO,QAAQ,GAAG,QAA0B;CACnF,MAAM,MAAM,iBAAiB,cAAc;CAC3C,MAAM,EAAE,KAAK,SAAS,iBAA8B,gBAAgB,iBAAiB;CAErF,sBAAsB;EACpB,MAAM,KAAK,KAAK;EAChB,IAAI,OAAO,MAAM;EACjB,MAAM,SAAS,GAAG,QAAQ,QAAQ;EAClC,IAAI,WAAW,MAAM;GACnB,IAAI,OACF,QAAQ,MACN,oHAEF;GAEF;EACF;EACA,IAAI,CAAC,wBAAwB,GAAG;EAChC,MAAM,WAAW,IAAI,kBAAkB,YAAY;GACjD,MAAM,WAAW,OAAO,QAAQ,OAAO;GACvC,IAAI,aAAa,KAAA,GAAW;GAC5B,IAAI,QAAQ,MAAM,WAAW,gBAAgB,QAAQ,QAAQ,CAAC,GAAG,QAAQ,MAAM;EACjF,CAAC;EACD,SAAS,QAAQ,QAAQ;GACvB,WAAW;GACX,eAAe;GACf,YAAY;GACZ,SAAS;EACX,CAAC;EACD,aAAa;GACX,SAAS,WAAW;EACtB;CACF,GAAG,CAAC,IAAI,CAAC;CAQT,MAAM,YAAY,eACT,EACL,IAAI,UAAoC;EACtC,OAAO,KAAK,SAAS,QAAQ,QAAQ,KAAK;CAC5C,EACF,IACA,CAAC,IAAI,CACP;CACA,aAAa,iBAAiB;EAC5B,MAAM,SAAS,UAAU;EACzB,IAAI,WAAW,QAAQ,wBAAwB,GAAG,QAAQ,MAAM;CAClE,CAAC;CAED,MAAM,QAAyB;EAC7B,OAAO,IAAI;EACX,SAAS,IAAI;EACb,UAAU,IAAI;CAChB;CACA,OAAO,UAAqE;EAC1E,gBAAgB;EAChB;EACA;EACA;EACA;EACA,UAAU,KAAA;EACV,OAAO;EACP,cAAc;GACZ,0BAA0B;GAC1B,yBAAyB,EAAE,QAAQ,GAAG;EACxC;EACA;CACF,CAAC;AACH;AAEA,YAAY,cAAc"}
1
+ {"version":3,"file":"select-value.mjs","names":[],"sources":["../../src/select/select-value.tsx"],"sourcesContent":["\"use client\";\nimport { useLayoutEffect, useMemo } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useFormReset } from \"../internal/form/use-form-reset.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport { useSelectContext } from \"./select-context.js\";\nimport { useSelectPartRef } from \"./select-dom.js\";\nimport type { SelectRootState } from \"./select-root.js\";\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/**\n * Props of `Select.Value`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport interface SelectValueProps extends Omit<\n ComponentPropsWithRef<\"selectedcontent\">,\n \"children\" | \"dangerouslySetInnerHTML\" | \"className\" | \"style\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, SelectRootState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, SelectRootState>;\n /** Replace the rendered element. Must keep a `<selectedcontent>`. */\n render?: RenderProp<ComponentPropsWithRef<\"selectedcontent\">, SelectRootState>;\n}\n\n/** Where the browser clones options into `<selectedcontent>` (Chromium 135+, Safari 27). */\nfunction supportsSelectedContent(): boolean {\n return typeof globalThis !== \"undefined\" && \"HTMLSelectedContentElement\" in globalThis;\n}\n\n/**\n * Whether a mutation record changes what `<selectedcontent>` shows: a record inside the selected\n * option. Attribute records on the option element itself are ignored (option attributes are not\n * cloned, and the library writes `data-*` there); records inside `<selectedcontent>` are never\n * inside an option, so the refresh's own clone does not loop.\n */\nfunction touchesSelected(record: MutationRecord, selected: HTMLOptionElement): boolean {\n if (record.type === \"attributes\" && record.target === selected) return false;\n return selected.contains(record.target);\n}\n\n/** Re-clones the selected option into `<selectedcontent>`. */\nfunction refresh(select: HTMLSelectElement): void {\n // Nothing selected: assigning the value would select the placeholder (probe case 7).\n if (select.selectedIndex === -1) return;\n // The assignment is the re-clone trigger; it fires no event and keeps the selection.\n const current = select.value;\n select.value = current;\n}\n\n/**\n * `<selectedcontent>`: the browser clones the selected option's content into it (inside\n * `Select.Trigger`). It has no `children`. Rendered with `suppressHydrationWarning` and an empty\n * `dangerouslySetInnerHTML` so that hydration accepts the content the parser cloned before React\n * ran (design/components/select.md 3.3).\n *\n * Also keeps it fresh: the platform re-clones only on selection changes, so when React changes\n * the selected option's content (a label, a state function, a Suspense boundary resolving inside\n * it), a `MutationObserver` re-assigns `select.value = select.value`, which re-clones without\n * events and without touching the selection or an open picker (6.3). The same refresh follows a\n * form reset, which Chromium does not re-clone for. Not installed where\n * `HTMLSelectedContentElement` is undefined (Firefox today, jsdom): nothing is cloned there.\n *\n * Owned keys: `dangerouslySetInnerHTML`, `suppressHydrationWarning`, `children`.\n *\n * @see https://ui.funstack.work/components/select\n */\nexport function SelectValue({ className, style, render, ...rest }: SelectValueProps) {\n const ctx = useSelectContext(\"Select.Value\");\n const { ref, node } = useSelectPartRef<HTMLElement>(\n \"Select.Value\",\n \"selectedcontent\",\n isDev\n ? (el) =>\n el.closest(\"select\") === null\n ? \"rendered outside the Select.Root's <select>; put it inside Select.Trigger, the \" +\n \"select's first child.\"\n : null\n : undefined,\n );\n\n useLayoutEffect(() => {\n const el = node.current;\n if (el === null) return;\n const select = el.closest(\"select\");\n // Outside a <select> (the ref's position check warns in development): nothing to refresh.\n if (select === null) return;\n if (!supportsSelectedContent()) return;\n const observer = new MutationObserver((records) => {\n const selected = select.options[select.selectedIndex];\n if (selected === undefined) return;\n if (records.some((record) => touchesSelected(record, selected))) refresh(select);\n });\n observer.observe(select, {\n childList: true,\n characterData: true,\n attributes: true,\n subtree: true,\n });\n return () => {\n observer.disconnect();\n };\n }, [node]);\n\n // A form reset changes the selection without re-cloning (Chromium 156: `form.reset()` leaves\n // the old option's content in <selectedcontent>; memo/developer/select.md). `useFormReset`\n // listens on the select's form owner itself (so neither `stopPropagation()` on the form nor a\n // shadow root hides the event), follows a changed owner or `form` attribute, and calls back in\n // a microtask after an uncancelled reset. React's own reset after a form action is a\n // `form.reset()` too.\n const selectRef = useMemo(\n () => ({\n get current(): HTMLSelectElement | null {\n return node.current?.closest(\"select\") ?? null;\n },\n }),\n [node],\n );\n useFormReset(selectRef, () => {\n const select = selectRef.current;\n if (select !== null && supportsSelectedContent()) refresh(select);\n });\n\n const state: SelectRootState = {\n value: ctx.optimistic,\n pending: ctx.pending,\n disabled: ctx.disabled,\n };\n return useRender<ComponentPropsWithRef<\"selectedcontent\">, SelectRootState>({\n defaultElement: \"selectedcontent\",\n render,\n state,\n className,\n style,\n children: undefined,\n props: rest,\n libraryProps: {\n suppressHydrationWarning: true,\n dangerouslySetInnerHTML: { __html: \"\" },\n },\n ref,\n });\n}\n\nSelectValue.displayName = \"SelectValue\";\n"],"mappings":";;;;;;;AAUA,MAAM,QAAQ,QAAQ,IAAI,aAAa;;AAoBvC,SAAS,0BAAmC;CAC1C,OAAO,OAAO,eAAe,eAAe,gCAAgC;AAC9E;;;;;;;AAQA,SAAS,gBAAgB,QAAwB,UAAsC;CACrF,IAAI,OAAO,SAAS,gBAAgB,OAAO,WAAW,UAAU,OAAO;CACvE,OAAO,SAAS,SAAS,OAAO,MAAM;AACxC;;AAGA,SAAS,QAAQ,QAAiC;CAEhD,IAAI,OAAO,kBAAkB,IAAI;CAGjC,OAAO,QADS,OAAO;AAEzB;;;;;;;;;;;;;;;;;;AAmBA,SAAgB,YAAY,EAAE,WAAW,OAAO,QAAQ,GAAG,QAA0B;CACnF,MAAM,MAAM,iBAAiB,cAAc;CAC3C,MAAM,EAAE,KAAK,SAAS,iBACpB,gBACA,mBACA,SACK,OACC,GAAG,QAAQ,QAAQ,MAAM,OACrB,yGAEA,OACN,KAAA,CACN;CAEA,sBAAsB;EACpB,MAAM,KAAK,KAAK;EAChB,IAAI,OAAO,MAAM;EACjB,MAAM,SAAS,GAAG,QAAQ,QAAQ;EAElC,IAAI,WAAW,MAAM;EACrB,IAAI,CAAC,wBAAwB,GAAG;EAChC,MAAM,WAAW,IAAI,kBAAkB,YAAY;GACjD,MAAM,WAAW,OAAO,QAAQ,OAAO;GACvC,IAAI,aAAa,KAAA,GAAW;GAC5B,IAAI,QAAQ,MAAM,WAAW,gBAAgB,QAAQ,QAAQ,CAAC,GAAG,QAAQ,MAAM;EACjF,CAAC;EACD,SAAS,QAAQ,QAAQ;GACvB,WAAW;GACX,eAAe;GACf,YAAY;GACZ,SAAS;EACX,CAAC;EACD,aAAa;GACX,SAAS,WAAW;EACtB;CACF,GAAG,CAAC,IAAI,CAAC;CAQT,MAAM,YAAY,eACT,EACL,IAAI,UAAoC;EACtC,OAAO,KAAK,SAAS,QAAQ,QAAQ,KAAK;CAC5C,EACF,IACA,CAAC,IAAI,CACP;CACA,aAAa,iBAAiB;EAC5B,MAAM,SAAS,UAAU;EACzB,IAAI,WAAW,QAAQ,wBAAwB,GAAG,QAAQ,MAAM;CAClE,CAAC;CAED,MAAM,QAAyB;EAC7B,OAAO,IAAI;EACX,SAAS,IAAI;EACb,UAAU,IAAI;CAChB;CACA,OAAO,UAAqE;EAC1E,gBAAgB;EAChB;EACA;EACA;EACA;EACA,UAAU,KAAA;EACV,OAAO;EACP,cAAc;GACZ,0BAA0B;GAC1B,yBAAyB,EAAE,QAAQ,GAAG;EACxC;EACA;CACF,CAAC;AACH;AAEA,YAAY,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"slider-root.d.mts","names":[],"sources":["../../src/slider/slider-root.tsx"],"mappings":";;;;YA2CY;;YAGA,oBAAoB;;iBAGf,iCAAiC;;;;;;;;;;WAUvC,QAAQ;;WAER;;;iBAIM,iCAAiC;;;;;;;WAOvC,QAAQ;;WAER;;;;;;iBAOM,gBAAgB,UAAU;;;;;;WAMhC,OAAO;;WAEP;;WAEA;;WAEA;;WAEA,aAAa;;WAEb;;WAEA;;WAEA;;WAEA;;;;;;;;iBASM,gBAAgB,UAAU,8BAA8B,KACvE;;EAcA,QAAQ;;;;;;EAMR,eAAe;;;;;;;;;;EAUf,oBAAoB,aAAa,GAAG;;;;;;;EAOpC,oBAAoB,aAAa,GAAG;;;;;;EAMpC;;;;;;;EAOA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA,cAAc;;;;;EAKd,oBAAoB,eAAe;;;;;EAKnC;;EAEA;;;;;;;EAOA;;EAEA,YAAY,+BAA+B,gBAAgB;;EAE3D,QAAQ,WAAW,2BAA2B,gBAAgB;;EAE9D,WAAW,WAAW,WAAW,gBAAgB;;EAEjD,SAAS,WAAW,8BAA8B,gBAAgB"}
1
+ {"version":3,"file":"slider-root.d.mts","names":[],"sources":["../../src/slider/slider-root.tsx"],"mappings":";;;;YA0CY;;YAGA,oBAAoB;;iBAGf,iCAAiC;;;;;;;;;;WAUvC,QAAQ;;WAER;;;iBAIM,iCAAiC;;;;;;;WAOvC,QAAQ;;WAER;;;;;;iBAOM,gBAAgB,UAAU;;;;;;WAMhC,OAAO;;WAEP;;WAEA;;WAEA;;WAEA,aAAa;;WAEb;;WAEA;;WAEA;;WAEA;;;;;;;;iBASM,gBAAgB,UAAU,8BAA8B,KACvE;;EAcA,QAAQ;;;;;;EAMR,eAAe;;;;;;;;;;EAUf,oBAAoB,aAAa,GAAG;;;;;;;EAOpC,oBAAoB,aAAa,GAAG;;;;;;EAMpC;;;;;;;EAOA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA,cAAc;;;;;EAKd,oBAAoB,eAAe;;;;;EAKnC;;EAEA;;;;;;;EAOA;;EAEA,YAAY,+BAA+B,gBAAgB;;EAE3D,QAAQ,WAAW,2BAA2B,gBAAgB;;EAE9D,WAAW,WAAW,WAAW,gBAAgB;;EAEjD,SAAS,WAAW,8BAA8B,gBAAgB"}