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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (962) hide show
  1. package/README.md +22 -1
  2. package/dist/accordion/accordion-context.mjs.map +1 -1
  3. package/dist/accordion/accordion-item.d.mts +22 -4
  4. package/dist/accordion/accordion-item.d.mts.map +1 -1
  5. package/dist/accordion/accordion-item.mjs +32 -10
  6. package/dist/accordion/accordion-item.mjs.map +1 -1
  7. package/dist/accordion/accordion-panel.d.mts +19 -4
  8. package/dist/accordion/accordion-panel.d.mts.map +1 -1
  9. package/dist/accordion/accordion-panel.mjs +8 -6
  10. package/dist/accordion/accordion-panel.mjs.map +1 -1
  11. package/dist/accordion/accordion-root.d.mts +39 -5
  12. package/dist/accordion/accordion-root.d.mts.map +1 -1
  13. package/dist/accordion/accordion-root.mjs +75 -67
  14. package/dist/accordion/accordion-root.mjs.map +1 -1
  15. package/dist/accordion/accordion-trigger.d.mts +12 -4
  16. package/dist/accordion/accordion-trigger.d.mts.map +1 -1
  17. package/dist/accordion/accordion-trigger.mjs +14 -28
  18. package/dist/accordion/accordion-trigger.mjs.map +1 -1
  19. package/dist/accordion/index.d.mts +2 -0
  20. package/dist/accordion/index.d.mts.map +1 -1
  21. package/dist/accordion/index.mjs +2 -0
  22. package/dist/accordion/index.mjs.map +1 -1
  23. package/dist/alert-dialog/alert-dialog-action.d.mts +73 -0
  24. package/dist/alert-dialog/alert-dialog-action.d.mts.map +1 -0
  25. package/dist/alert-dialog/alert-dialog-action.mjs +23 -0
  26. package/dist/alert-dialog/alert-dialog-action.mjs.map +1 -0
  27. package/dist/alert-dialog/alert-dialog-cancel.d.mts +31 -0
  28. package/dist/alert-dialog/alert-dialog-cancel.d.mts.map +1 -0
  29. package/dist/alert-dialog/alert-dialog-cancel.mjs +50 -0
  30. package/dist/alert-dialog/alert-dialog-cancel.mjs.map +1 -0
  31. package/dist/alert-dialog/alert-dialog-context.mjs +24 -0
  32. package/dist/alert-dialog/alert-dialog-context.mjs.map +1 -0
  33. package/dist/alert-dialog/alert-dialog-description.d.mts +25 -0
  34. package/dist/alert-dialog/alert-dialog-description.d.mts.map +1 -0
  35. package/dist/alert-dialog/alert-dialog-description.mjs +20 -0
  36. package/dist/alert-dialog/alert-dialog-description.mjs.map +1 -0
  37. package/dist/alert-dialog/alert-dialog-form.d.mts +27 -0
  38. package/dist/alert-dialog/alert-dialog-form.d.mts.map +1 -0
  39. package/dist/alert-dialog/alert-dialog-form.mjs +22 -0
  40. package/dist/alert-dialog/alert-dialog-form.mjs.map +1 -0
  41. package/dist/alert-dialog/alert-dialog-popup.d.mts +42 -0
  42. package/dist/alert-dialog/alert-dialog-popup.d.mts.map +1 -0
  43. package/dist/alert-dialog/alert-dialog-popup.mjs +53 -0
  44. package/dist/alert-dialog/alert-dialog-popup.mjs.map +1 -0
  45. package/dist/alert-dialog/alert-dialog-root.d.mts +31 -0
  46. package/dist/alert-dialog/alert-dialog-root.d.mts.map +1 -0
  47. package/dist/alert-dialog/alert-dialog-root.mjs +22 -0
  48. package/dist/alert-dialog/alert-dialog-root.mjs.map +1 -0
  49. package/dist/alert-dialog/alert-dialog-title.d.mts +23 -0
  50. package/dist/alert-dialog/alert-dialog-title.d.mts.map +1 -0
  51. package/dist/alert-dialog/alert-dialog-title.mjs +18 -0
  52. package/dist/alert-dialog/alert-dialog-title.mjs.map +1 -0
  53. package/dist/alert-dialog/alert-dialog-trigger.d.mts +23 -0
  54. package/dist/alert-dialog/alert-dialog-trigger.d.mts.map +1 -0
  55. package/dist/alert-dialog/alert-dialog-trigger.mjs +18 -0
  56. package/dist/alert-dialog/alert-dialog-trigger.mjs.map +1 -0
  57. package/dist/alert-dialog/index.d.mts +33 -0
  58. package/dist/alert-dialog/index.d.mts.map +1 -0
  59. package/dist/alert-dialog/index.mjs +33 -0
  60. package/dist/alert-dialog/index.mjs.map +1 -0
  61. package/dist/bin/skill-installer.d.mts +1 -0
  62. package/dist/bin/skill-installer.mjs +12 -0
  63. package/dist/bin/skill-installer.mjs.map +1 -0
  64. package/dist/button/button.d.mts +118 -0
  65. package/dist/button/button.d.mts.map +1 -0
  66. package/dist/button/button.mjs +98 -0
  67. package/dist/button/button.mjs.map +1 -0
  68. package/dist/button/index.d.mts +3 -0
  69. package/dist/button/index.mjs +1 -0
  70. package/dist/checkbox/checkbox.d.mts +32 -9
  71. package/dist/checkbox/checkbox.d.mts.map +1 -1
  72. package/dist/checkbox/checkbox.mjs +25 -50
  73. package/dist/checkbox/checkbox.mjs.map +1 -1
  74. package/dist/checkbox-group/checkbox-group-context.mjs.map +1 -1
  75. package/dist/checkbox-group/checkbox-group-item.d.mts +20 -5
  76. package/dist/checkbox-group/checkbox-group-item.d.mts.map +1 -1
  77. package/dist/checkbox-group/checkbox-group-item.mjs +25 -27
  78. package/dist/checkbox-group/checkbox-group-item.mjs.map +1 -1
  79. package/dist/checkbox-group/checkbox-group-label.d.mts +10 -0
  80. package/dist/checkbox-group/checkbox-group-label.d.mts.map +1 -1
  81. package/dist/checkbox-group/checkbox-group-label.mjs +3 -6
  82. package/dist/checkbox-group/checkbox-group-label.mjs.map +1 -1
  83. package/dist/checkbox-group/checkbox-group-parent.d.mts +22 -5
  84. package/dist/checkbox-group/checkbox-group-parent.d.mts.map +1 -1
  85. package/dist/checkbox-group/checkbox-group-parent.mjs +17 -13
  86. package/dist/checkbox-group/checkbox-group-parent.mjs.map +1 -1
  87. package/dist/checkbox-group/checkbox-group-root.d.mts +37 -7
  88. package/dist/checkbox-group/checkbox-group-root.d.mts.map +1 -1
  89. package/dist/checkbox-group/checkbox-group-root.mjs +102 -102
  90. package/dist/checkbox-group/checkbox-group-root.mjs.map +1 -1
  91. package/dist/checkbox-group/index.d.mts +2 -0
  92. package/dist/checkbox-group/index.d.mts.map +1 -1
  93. package/dist/checkbox-group/index.mjs +2 -0
  94. package/dist/checkbox-group/index.mjs.map +1 -1
  95. package/dist/collapsible/collapsible-context.mjs +8 -0
  96. package/dist/collapsible/collapsible-context.mjs.map +1 -0
  97. package/dist/collapsible/collapsible-panel.d.mts +53 -0
  98. package/dist/collapsible/collapsible-panel.d.mts.map +1 -0
  99. package/dist/collapsible/collapsible-panel.mjs +41 -0
  100. package/dist/collapsible/collapsible-panel.mjs.map +1 -0
  101. package/dist/collapsible/collapsible-root.d.mts +108 -0
  102. package/dist/collapsible/collapsible-root.d.mts.map +1 -0
  103. package/dist/collapsible/collapsible-root.mjs +147 -0
  104. package/dist/collapsible/collapsible-root.mjs.map +1 -0
  105. package/dist/collapsible/collapsible-trigger.d.mts +45 -0
  106. package/dist/collapsible/collapsible-trigger.d.mts.map +1 -0
  107. package/dist/collapsible/collapsible-trigger.mjs +62 -0
  108. package/dist/collapsible/collapsible-trigger.mjs.map +1 -0
  109. package/dist/collapsible/index.d.mts +21 -0
  110. package/dist/collapsible/index.d.mts.map +1 -0
  111. package/dist/collapsible/index.mjs +21 -0
  112. package/dist/collapsible/index.mjs.map +1 -0
  113. package/dist/combobox/chip-text.mjs +24 -0
  114. package/dist/combobox/chip-text.mjs.map +1 -0
  115. package/dist/combobox/combobox-chips.d.mts +159 -0
  116. package/dist/combobox/combobox-chips.d.mts.map +1 -0
  117. package/dist/combobox/combobox-chips.mjs +198 -0
  118. package/dist/combobox/combobox-chips.mjs.map +1 -0
  119. package/dist/combobox/combobox-clear.d.mts +29 -5
  120. package/dist/combobox/combobox-clear.d.mts.map +1 -1
  121. package/dist/combobox/combobox-clear.mjs +17 -8
  122. package/dist/combobox/combobox-clear.mjs.map +1 -1
  123. package/dist/combobox/combobox-context.mjs +4 -5
  124. package/dist/combobox/combobox-context.mjs.map +1 -1
  125. package/dist/combobox/combobox-group.d.mts +49 -1
  126. package/dist/combobox/combobox-group.d.mts.map +1 -1
  127. package/dist/combobox/combobox-group.mjs +14 -3
  128. package/dist/combobox/combobox-group.mjs.map +1 -1
  129. package/dist/combobox/combobox-input.d.mts +27 -5
  130. package/dist/combobox/combobox-input.d.mts.map +1 -1
  131. package/dist/combobox/combobox-input.mjs +53 -13
  132. package/dist/combobox/combobox-input.mjs.map +1 -1
  133. package/dist/combobox/combobox-keyboard.mjs +127 -0
  134. package/dist/combobox/combobox-keyboard.mjs.map +1 -0
  135. package/dist/combobox/combobox-label.d.mts +18 -1
  136. package/dist/combobox/combobox-label.d.mts.map +1 -1
  137. package/dist/combobox/combobox-label.mjs +4 -1
  138. package/dist/combobox/combobox-label.mjs.map +1 -1
  139. package/dist/combobox/combobox-list.d.mts +15 -1
  140. package/dist/combobox/combobox-list.d.mts.map +1 -1
  141. package/dist/combobox/combobox-list.mjs +13 -13
  142. package/dist/combobox/combobox-list.mjs.map +1 -1
  143. package/dist/combobox/combobox-option.d.mts +30 -5
  144. package/dist/combobox/combobox-option.d.mts.map +1 -1
  145. package/dist/combobox/combobox-option.mjs +9 -5
  146. package/dist/combobox/combobox-option.mjs.map +1 -1
  147. package/dist/combobox/combobox-popup.d.mts +24 -3
  148. package/dist/combobox/combobox-popup.d.mts.map +1 -1
  149. package/dist/combobox/combobox-popup.mjs +24 -29
  150. package/dist/combobox/combobox-popup.mjs.map +1 -1
  151. package/dist/combobox/combobox-root.d.mts +183 -43
  152. package/dist/combobox/combobox-root.d.mts.map +1 -1
  153. package/dist/combobox/combobox-root.mjs +476 -270
  154. package/dist/combobox/combobox-root.mjs.map +1 -1
  155. package/dist/combobox/combobox-trigger.d.mts +36 -8
  156. package/dist/combobox/combobox-trigger.d.mts.map +1 -1
  157. package/dist/combobox/combobox-trigger.mjs +50 -41
  158. package/dist/combobox/combobox-trigger.mjs.map +1 -1
  159. package/dist/combobox/index.d.mts +13 -5
  160. package/dist/combobox/index.d.mts.map +1 -1
  161. package/dist/combobox/index.mjs +13 -5
  162. package/dist/combobox/index.mjs.map +1 -1
  163. package/dist/combobox/use-combobox-form.mjs +53 -0
  164. package/dist/combobox/use-combobox-form.mjs.map +1 -0
  165. package/dist/combobox/use-combobox-text.mjs +43 -0
  166. package/dist/combobox/use-combobox-text.mjs.map +1 -0
  167. package/dist/csp/csp-provider.d.mts +33 -0
  168. package/dist/csp/csp-provider.d.mts.map +1 -0
  169. package/dist/csp/csp-provider.mjs +26 -0
  170. package/dist/csp/csp-provider.mjs.map +1 -0
  171. package/dist/csp/index.d.mts +3 -0
  172. package/dist/csp/index.mjs +3 -0
  173. package/dist/csp/style-hashes.d.mts +21 -0
  174. package/dist/csp/style-hashes.d.mts.map +1 -0
  175. package/dist/csp/style-hashes.mjs +23 -0
  176. package/dist/csp/style-hashes.mjs.map +1 -0
  177. package/dist/dialog/dialog-close.d.mts +56 -12
  178. package/dist/dialog/dialog-close.d.mts.map +1 -1
  179. package/dist/dialog/dialog-close.mjs +52 -55
  180. package/dist/dialog/dialog-close.mjs.map +1 -1
  181. package/dist/dialog/dialog-context.d.mts +2 -0
  182. package/dist/dialog/dialog-context.mjs +14 -2
  183. package/dist/dialog/dialog-context.mjs.map +1 -1
  184. package/dist/dialog/dialog-description.d.mts +14 -1
  185. package/dist/dialog/dialog-description.d.mts.map +1 -1
  186. package/dist/dialog/dialog-description.mjs +10 -4
  187. package/dist/dialog/dialog-description.mjs.map +1 -1
  188. package/dist/dialog/dialog-dismiss.mjs +108 -0
  189. package/dist/dialog/dialog-dismiss.mjs.map +1 -0
  190. package/dist/dialog/dialog-form.d.mts +43 -11
  191. package/dist/dialog/dialog-form.d.mts.map +1 -1
  192. package/dist/dialog/dialog-form.mjs +64 -37
  193. package/dist/dialog/dialog-form.mjs.map +1 -1
  194. package/dist/dialog/dialog-popup.d.mts +47 -14
  195. package/dist/dialog/dialog-popup.d.mts.map +1 -1
  196. package/dist/dialog/dialog-popup.mjs +167 -242
  197. package/dist/dialog/dialog-popup.mjs.map +1 -1
  198. package/dist/dialog/dialog-root.d.mts +54 -19
  199. package/dist/dialog/dialog-root.d.mts.map +1 -1
  200. package/dist/dialog/dialog-root.mjs +74 -92
  201. package/dist/dialog/dialog-root.mjs.map +1 -1
  202. package/dist/dialog/dialog-title.d.mts +13 -1
  203. package/dist/dialog/dialog-title.d.mts.map +1 -1
  204. package/dist/dialog/dialog-title.mjs +10 -4
  205. package/dist/dialog/dialog-title.mjs.map +1 -1
  206. package/dist/dialog/dialog-trigger.d.mts +30 -6
  207. package/dist/dialog/dialog-trigger.d.mts.map +1 -1
  208. package/dist/dialog/dialog-trigger.mjs +50 -28
  209. package/dist/dialog/dialog-trigger.mjs.map +1 -1
  210. package/dist/dialog/index.d.mts +7 -3
  211. package/dist/dialog/index.d.mts.map +1 -1
  212. package/dist/dialog/index.mjs +7 -3
  213. package/dist/dialog/index.mjs.map +1 -1
  214. package/dist/docs/components/accordion.md +428 -0
  215. package/dist/docs/components/alert-dialog.md +546 -0
  216. package/dist/docs/components/button.md +511 -0
  217. package/dist/docs/components/checkbox-group.md +483 -0
  218. package/dist/docs/components/checkbox.md +373 -0
  219. package/dist/docs/components/collapsible.md +408 -0
  220. package/dist/docs/components/combobox.md +960 -0
  221. package/dist/docs/components/context-menu.md +524 -0
  222. package/dist/docs/components/dialog.md +694 -0
  223. package/dist/docs/components/field.md +765 -0
  224. package/dist/docs/components/hover-card.md +494 -0
  225. package/dist/docs/components/menu.md +670 -0
  226. package/dist/docs/components/meter.md +313 -0
  227. package/dist/docs/components/multi-select.md +622 -0
  228. package/dist/docs/components/number-field.md +528 -0
  229. package/dist/docs/components/popover.md +656 -0
  230. package/dist/docs/components/progress.md +450 -0
  231. package/dist/docs/components/radio-group.md +457 -0
  232. package/dist/docs/components/select.md +670 -0
  233. package/dist/docs/components/separator.md +182 -0
  234. package/dist/docs/components/slider.md +558 -0
  235. package/dist/docs/components/switch.md +311 -0
  236. package/dist/docs/components/tabs.md +473 -0
  237. package/dist/docs/components/toast.md +602 -0
  238. package/dist/docs/components/toggle-group.md +341 -0
  239. package/dist/docs/components/toggle.md +245 -0
  240. package/dist/docs/components/toolbar.md +390 -0
  241. package/dist/docs/components/tooltip.md +494 -0
  242. package/dist/docs/concepts/action-props.md +281 -0
  243. package/dist/docs/concepts/ai-agents.md +56 -0
  244. package/dist/docs/concepts/browser-owned-state.md +133 -0
  245. package/dist/docs/concepts/content-security-policy.md +69 -0
  246. package/dist/docs/concepts/experimental.md +36 -0
  247. package/dist/docs/concepts/pending-and-optimistic.md +263 -0
  248. package/dist/docs/concepts/render.md +23 -0
  249. package/dist/docs/concepts/server-components.md +132 -0
  250. package/dist/docs/concepts/suspense.md +129 -0
  251. package/dist/docs/concepts/transitions.md +112 -0
  252. package/dist/docs/getting-started.md +102 -0
  253. package/dist/docs/index.md +187 -0
  254. package/dist/docs/roadmap.md +144 -0
  255. package/dist/docs/why.md +104 -0
  256. package/dist/field/field-control.d.mts +65 -0
  257. package/dist/field/field-control.d.mts.map +1 -0
  258. package/dist/field/field-control.mjs +92 -0
  259. package/dist/field/field-control.mjs.map +1 -0
  260. package/dist/field/field-description.d.mts +35 -0
  261. package/dist/field/field-description.d.mts.map +1 -0
  262. package/dist/field/field-description.mjs +35 -0
  263. package/dist/field/field-description.mjs.map +1 -0
  264. package/dist/field/field-error.d.mts +42 -0
  265. package/dist/field/field-error.d.mts.map +1 -0
  266. package/dist/field/field-error.mjs +43 -0
  267. package/dist/field/field-error.mjs.map +1 -0
  268. package/dist/field/field-label.d.mts +39 -0
  269. package/dist/field/field-label.d.mts.map +1 -0
  270. package/dist/field/field-label.mjs +50 -0
  271. package/dist/field/field-label.mjs.map +1 -0
  272. package/dist/field/field-root.d.mts +72 -0
  273. package/dist/field/field-root.d.mts.map +1 -0
  274. package/dist/field/field-root.mjs +309 -0
  275. package/dist/field/field-root.mjs.map +1 -0
  276. package/dist/field/index.d.mts +27 -0
  277. package/dist/field/index.d.mts.map +1 -0
  278. package/dist/field/index.mjs +26 -0
  279. package/dist/field/index.mjs.map +1 -0
  280. package/dist/field/use-server-error-visibility.mjs +44 -0
  281. package/dist/field/use-server-error-visibility.mjs.map +1 -0
  282. package/dist/form/form-root.d.mts +74 -0
  283. package/dist/form/form-root.d.mts.map +1 -0
  284. package/dist/form/form-root.mjs +158 -0
  285. package/dist/form/form-root.mjs.map +1 -0
  286. package/dist/form/form-submit.d.mts +56 -0
  287. package/dist/form/form-submit.d.mts.map +1 -0
  288. package/dist/form/form-submit.mjs +53 -0
  289. package/dist/form/form-submit.mjs.map +1 -0
  290. package/dist/form/index.d.mts +18 -0
  291. package/dist/form/index.d.mts.map +1 -0
  292. package/dist/form/index.mjs +18 -0
  293. package/dist/form/index.mjs.map +1 -0
  294. package/dist/hover-card/hover-card-context.mjs +13 -0
  295. package/dist/hover-card/hover-card-context.mjs.map +1 -0
  296. package/dist/hover-card/hover-card-popup.d.mts +102 -0
  297. package/dist/hover-card/hover-card-popup.d.mts.map +1 -0
  298. package/dist/hover-card/hover-card-popup.mjs +80 -0
  299. package/dist/hover-card/hover-card-popup.mjs.map +1 -0
  300. package/dist/hover-card/hover-card-root.d.mts +94 -0
  301. package/dist/hover-card/hover-card-root.d.mts.map +1 -0
  302. package/dist/hover-card/hover-card-root.mjs +74 -0
  303. package/dist/hover-card/hover-card-root.mjs.map +1 -0
  304. package/dist/hover-card/hover-card-trigger.d.mts +65 -0
  305. package/dist/hover-card/hover-card-trigger.d.mts.map +1 -0
  306. package/dist/hover-card/hover-card-trigger.mjs +109 -0
  307. package/dist/hover-card/hover-card-trigger.mjs.map +1 -0
  308. package/dist/hover-card/index.d.mts +24 -0
  309. package/dist/hover-card/index.d.mts.map +1 -0
  310. package/dist/hover-card/index.mjs +24 -0
  311. package/dist/hover-card/index.mjs.map +1 -0
  312. package/dist/hover-card/use-hover-card-interest.mjs +242 -0
  313. package/dist/hover-card/use-hover-card-interest.mjs.map +1 -0
  314. package/dist/index.d.mts +100 -13
  315. package/dist/index.mjs +19 -1
  316. package/dist/internal/{action-details.mjs → action/action-details.mjs} +1 -1
  317. package/dist/internal/action/action-details.mjs.map +1 -0
  318. package/dist/internal/action/call-urgent-handler.mjs +32 -0
  319. package/dist/internal/action/call-urgent-handler.mjs.map +1 -0
  320. package/dist/internal/action/report-dropped.mjs +27 -0
  321. package/dist/internal/action/report-dropped.mjs.map +1 -0
  322. package/dist/internal/action/use-action-trigger.mjs +67 -0
  323. package/dist/internal/action/use-action-trigger.mjs.map +1 -0
  324. package/dist/internal/action/use-connected.mjs +24 -0
  325. package/dist/internal/action/use-connected.mjs.map +1 -0
  326. package/dist/internal/action/use-controllable-action.mjs +153 -0
  327. package/dist/internal/action/use-controllable-action.mjs.map +1 -0
  328. package/dist/internal/action/use-multiple-selection.mjs +83 -0
  329. package/dist/internal/action/use-multiple-selection.mjs.map +1 -0
  330. package/dist/internal/action/use-pure-trigger.mjs +34 -0
  331. package/dist/internal/action/use-pure-trigger.mjs.map +1 -0
  332. package/dist/internal/action/use-step-commit.mjs +147 -0
  333. package/dist/internal/action/use-step-commit.mjs.map +1 -0
  334. package/dist/internal/announce.mjs +20 -0
  335. package/dist/internal/announce.mjs.map +1 -0
  336. package/dist/internal/arrow-keys.mjs +21 -0
  337. package/dist/internal/arrow-keys.mjs.map +1 -0
  338. package/dist/internal/csp-context.mjs +8 -0
  339. package/dist/internal/csp-context.mjs.map +1 -0
  340. package/dist/internal/decimal.mjs +33 -0
  341. package/dist/internal/decimal.mjs.map +1 -0
  342. package/dist/internal/details-summary.mjs +56 -0
  343. package/dist/internal/details-summary.mjs.map +1 -0
  344. package/dist/internal/dev-warn.mjs +17 -0
  345. package/dist/internal/dev-warn.mjs.map +1 -0
  346. package/dist/internal/dom-order.mjs +17 -0
  347. package/dist/internal/dom-order.mjs.map +1 -0
  348. package/dist/internal/form/field-context.d.mts +19 -0
  349. package/dist/internal/form/field-context.d.mts.map +1 -0
  350. package/dist/internal/form/field-context.mjs +24 -0
  351. package/dist/internal/form/field-context.mjs.map +1 -0
  352. package/dist/internal/form/focus-first-invalid.mjs +67 -0
  353. package/dist/internal/form/focus-first-invalid.mjs.map +1 -0
  354. package/dist/internal/form/form-status-watcher.mjs +31 -0
  355. package/dist/internal/form/form-status-watcher.mjs.map +1 -0
  356. package/dist/internal/form/group-member.mjs +37 -0
  357. package/dist/internal/form/group-member.mjs.map +1 -0
  358. package/dist/internal/form/hidden-values.mjs +29 -0
  359. package/dist/internal/form/hidden-values.mjs.map +1 -0
  360. package/dist/internal/{sync-presence.mjs → form/sync-presence.mjs} +6 -2
  361. package/dist/internal/form/sync-presence.mjs.map +1 -0
  362. package/dist/internal/form/use-checkable-input.mjs +79 -0
  363. package/dist/internal/form/use-checkable-input.mjs.map +1 -0
  364. package/dist/internal/form/use-field-control.mjs +125 -0
  365. package/dist/internal/form/use-field-control.mjs.map +1 -0
  366. package/dist/internal/form/use-fieldset-group.mjs +46 -0
  367. package/dist/internal/form/use-fieldset-group.mjs.map +1 -0
  368. package/dist/internal/form/use-form-owner-event.mjs +44 -0
  369. package/dist/internal/form/use-form-owner-event.mjs.map +1 -0
  370. package/dist/internal/form/use-form-reset.mjs +39 -0
  371. package/dist/internal/form/use-form-reset.mjs.map +1 -0
  372. package/dist/internal/{use-native-checked.mjs → form/use-native-checked.mjs} +8 -9
  373. package/dist/internal/form/use-native-checked.mjs.map +1 -0
  374. package/dist/internal/{use-native-group-reconciliation.mjs → form/use-native-group-reconciliation.mjs} +15 -12
  375. package/dist/internal/form/use-native-group-reconciliation.mjs.map +1 -0
  376. package/dist/internal/{use-native-select-value.mjs → form/use-native-select-value.mjs} +8 -6
  377. package/dist/internal/form/use-native-select-value.mjs.map +1 -0
  378. package/dist/internal/form/validity.d.mts +35 -0
  379. package/dist/internal/form/validity.d.mts.map +1 -0
  380. package/dist/internal/form/validity.mjs +98 -0
  381. package/dist/internal/form/validity.mjs.map +1 -0
  382. package/dist/internal/overlay/anchor-position.d.mts +15 -0
  383. package/dist/internal/overlay/anchor-position.d.mts.map +1 -0
  384. package/dist/internal/overlay/anchor-position.mjs +132 -0
  385. package/dist/internal/overlay/anchor-position.mjs.map +1 -0
  386. package/dist/internal/overlay/content-focus-probe.mjs +42 -0
  387. package/dist/internal/overlay/content-focus-probe.mjs.map +1 -0
  388. package/dist/internal/overlay/css-transition-cut.mjs +66 -0
  389. package/dist/internal/overlay/css-transition-cut.mjs.map +1 -0
  390. package/dist/internal/overlay/focus-visible.mjs +26 -0
  391. package/dist/internal/overlay/focus-visible.mjs.map +1 -0
  392. package/dist/internal/overlay/invokers.mjs +63 -0
  393. package/dist/internal/overlay/invokers.mjs.map +1 -0
  394. package/dist/internal/overlay/modal-registry.mjs +39 -0
  395. package/dist/internal/overlay/modal-registry.mjs.map +1 -0
  396. package/dist/internal/overlay/overlay-popup.mjs +103 -0
  397. package/dist/internal/overlay/overlay-popup.mjs.map +1 -0
  398. package/dist/internal/overlay/overlay-show.mjs +73 -0
  399. package/dist/internal/overlay/overlay-show.mjs.map +1 -0
  400. package/dist/internal/overlay/popover-open.mjs +18 -0
  401. package/dist/internal/overlay/popover-open.mjs.map +1 -0
  402. package/dist/internal/overlay/trigger-ref.mjs +26 -0
  403. package/dist/internal/overlay/trigger-ref.mjs.map +1 -0
  404. package/dist/internal/overlay/use-apply-open-state.mjs +44 -0
  405. package/dist/internal/overlay/use-apply-open-state.mjs.map +1 -0
  406. package/dist/internal/{use-exit-animation.mjs → overlay/use-exit-animation.mjs} +28 -8
  407. package/dist/internal/overlay/use-exit-animation.mjs.map +1 -0
  408. package/dist/internal/overlay/use-interest-dismiss.mjs +85 -0
  409. package/dist/internal/overlay/use-interest-dismiss.mjs.map +1 -0
  410. package/dist/internal/overlay/use-modal-registration.mjs +47 -0
  411. package/dist/internal/overlay/use-modal-registration.mjs.map +1 -0
  412. package/dist/internal/overlay/use-overlay-close.mjs +72 -0
  413. package/dist/internal/overlay/use-overlay-close.mjs.map +1 -0
  414. package/dist/internal/overlay/use-overlay-root.d.mts +2 -0
  415. package/dist/internal/overlay/use-overlay-root.mjs +193 -0
  416. package/dist/internal/overlay/use-overlay-root.mjs.map +1 -0
  417. package/dist/internal/overlay/use-popover-popup.mjs +287 -0
  418. package/dist/internal/overlay/use-popover-popup.mjs.map +1 -0
  419. package/dist/internal/overlay/use-popover-trigger.d.mts +16 -0
  420. package/dist/internal/overlay/use-popover-trigger.d.mts.map +1 -0
  421. package/dist/internal/overlay/use-popover-trigger.mjs +142 -0
  422. package/dist/internal/overlay/use-popover-trigger.mjs.map +1 -0
  423. package/dist/internal/overlay/use-resolved-placement.mjs +162 -0
  424. package/dist/internal/overlay/use-resolved-placement.mjs.map +1 -0
  425. package/dist/internal/platform-attributes.d.mts +2 -1
  426. package/dist/internal/platform-attributes.d.mts.map +1 -1
  427. package/dist/internal/pointer-capture.mjs +20 -0
  428. package/dist/internal/pointer-capture.mjs.map +1 -0
  429. package/dist/internal/range-value.mjs +51 -0
  430. package/dist/internal/range-value.mjs.map +1 -0
  431. package/dist/internal/render-element.d.mts +2 -0
  432. package/dist/internal/render-element.mjs +123 -0
  433. package/dist/internal/render-element.mjs.map +1 -0
  434. package/dist/internal/shipped-styles.mjs +14 -0
  435. package/dist/internal/shipped-styles.mjs.map +1 -0
  436. package/dist/internal/toolbar-context.mjs +17 -0
  437. package/dist/internal/toolbar-context.mjs.map +1 -0
  438. package/dist/internal/transition-boundary.mjs +5 -9
  439. package/dist/internal/transition-boundary.mjs.map +1 -1
  440. package/dist/internal/typeahead.mjs +52 -0
  441. package/dist/internal/typeahead.mjs.map +1 -0
  442. package/dist/internal/types.d.mts +42 -9
  443. package/dist/internal/types.d.mts.map +1 -1
  444. package/dist/internal/use-active-option.mjs +51 -0
  445. package/dist/internal/use-active-option.mjs.map +1 -0
  446. package/dist/internal/use-deferred-leave.mjs +113 -0
  447. package/dist/internal/use-deferred-leave.mjs.map +1 -0
  448. package/dist/internal/use-dev-warning.mjs +8 -4
  449. package/dist/internal/use-dev-warning.mjs.map +1 -1
  450. package/dist/internal/use-element-check.mjs +39 -0
  451. package/dist/internal/use-element-check.mjs.map +1 -0
  452. package/dist/internal/use-item-order.mjs +42 -0
  453. package/dist/internal/use-item-order.mjs.map +1 -0
  454. package/dist/internal/use-latest.mjs +28 -0
  455. package/dist/internal/use-latest.mjs.map +1 -0
  456. package/dist/internal/use-merged-refs.mjs +19 -0
  457. package/dist/internal/use-merged-refs.mjs.map +1 -0
  458. package/dist/internal/use-mount-fixed.mjs +22 -0
  459. package/dist/internal/use-mount-fixed.mjs.map +1 -0
  460. package/dist/internal/use-name-warning.mjs +140 -0
  461. package/dist/internal/use-name-warning.mjs.map +1 -0
  462. package/dist/internal/use-native-focusgroup.mjs +19 -0
  463. package/dist/internal/use-native-focusgroup.mjs.map +1 -0
  464. package/dist/internal/use-option-registry.mjs +70 -0
  465. package/dist/internal/use-option-registry.mjs.map +1 -0
  466. package/dist/internal/use-register-count.mjs +27 -0
  467. package/dist/internal/use-register-count.mjs.map +1 -0
  468. package/dist/internal/use-render.d.mts +2 -0
  469. package/dist/internal/use-render.mjs +12 -35
  470. package/dist/internal/use-render.mjs.map +1 -1
  471. package/dist/internal/use-roving-focus.mjs +288 -0
  472. package/dist/internal/use-roving-focus.mjs.map +1 -0
  473. package/dist/internal/use-value-set.mjs +20 -0
  474. package/dist/internal/use-value-set.mjs.map +1 -0
  475. package/dist/internal/value-set.mjs +41 -0
  476. package/dist/internal/value-set.mjs.map +1 -0
  477. package/dist/menu/index.d.mts +8 -2
  478. package/dist/menu/index.d.mts.map +1 -1
  479. package/dist/menu/index.mjs +7 -1
  480. package/dist/menu/index.mjs.map +1 -1
  481. package/dist/menu/menu-checkbox-item.d.mts +27 -3
  482. package/dist/menu/menu-checkbox-item.d.mts.map +1 -1
  483. package/dist/menu/menu-checkbox-item.mjs +6 -3
  484. package/dist/menu/menu-checkbox-item.mjs.map +1 -1
  485. package/dist/menu/menu-context-trigger.d.mts +63 -0
  486. package/dist/menu/menu-context-trigger.d.mts.map +1 -0
  487. package/dist/menu/menu-context-trigger.mjs +231 -0
  488. package/dist/menu/menu-context-trigger.mjs.map +1 -0
  489. package/dist/menu/menu-context.d.mts +1 -1
  490. package/dist/menu/menu-context.mjs +44 -1
  491. package/dist/menu/menu-context.mjs.map +1 -1
  492. package/dist/menu/menu-dom.mjs +35 -4
  493. package/dist/menu/menu-dom.mjs.map +1 -1
  494. package/dist/menu/menu-gestures.mjs +166 -0
  495. package/dist/menu/menu-gestures.mjs.map +1 -0
  496. package/dist/menu/menu-group.d.mts +36 -1
  497. package/dist/menu/menu-group.d.mts.map +1 -1
  498. package/dist/menu/menu-group.mjs +15 -5
  499. package/dist/menu/menu-group.mjs.map +1 -1
  500. package/dist/menu/menu-hover.mjs +0 -1
  501. package/dist/menu/menu-hover.mjs.map +1 -1
  502. package/dist/menu/menu-item.d.mts +42 -5
  503. package/dist/menu/menu-item.d.mts.map +1 -1
  504. package/dist/menu/menu-item.mjs +18 -9
  505. package/dist/menu/menu-item.mjs.map +1 -1
  506. package/dist/menu/menu-outside.mjs +101 -0
  507. package/dist/menu/menu-outside.mjs.map +1 -0
  508. package/dist/menu/menu-point.mjs +85 -0
  509. package/dist/menu/menu-point.mjs.map +1 -0
  510. package/dist/menu/menu-popup.d.mts +68 -11
  511. package/dist/menu/menu-popup.d.mts.map +1 -1
  512. package/dist/menu/menu-popup.mjs +106 -116
  513. package/dist/menu/menu-popup.mjs.map +1 -1
  514. package/dist/menu/menu-radio-group.d.mts +20 -1
  515. package/dist/menu/menu-radio-group.d.mts.map +1 -1
  516. package/dist/menu/menu-radio-group.mjs +14 -7
  517. package/dist/menu/menu-radio-group.mjs.map +1 -1
  518. package/dist/menu/menu-radio-item.d.mts +18 -0
  519. package/dist/menu/menu-radio-item.d.mts.map +1 -1
  520. package/dist/menu/menu-radio-item.mjs +5 -1
  521. package/dist/menu/menu-radio-item.mjs.map +1 -1
  522. package/dist/menu/menu-root.d.mts +61 -12
  523. package/dist/menu/menu-root.d.mts.map +1 -1
  524. package/dist/menu/menu-root.mjs +72 -17
  525. package/dist/menu/menu-root.mjs.map +1 -1
  526. package/dist/menu/menu-submenu-trigger.d.mts +24 -9
  527. package/dist/menu/menu-submenu-trigger.d.mts.map +1 -1
  528. package/dist/menu/menu-submenu-trigger.mjs +48 -26
  529. package/dist/menu/menu-submenu-trigger.mjs.map +1 -1
  530. package/dist/menu/menu-trigger.d.mts +37 -16
  531. package/dist/menu/menu-trigger.d.mts.map +1 -1
  532. package/dist/menu/menu-trigger.mjs +39 -23
  533. package/dist/menu/menu-trigger.mjs.map +1 -1
  534. package/dist/menu/use-menu-item.mjs +14 -16
  535. package/dist/menu/use-menu-item.mjs.map +1 -1
  536. package/dist/menu/use-menu-keyboard.mjs +68 -0
  537. package/dist/menu/use-menu-keyboard.mjs.map +1 -0
  538. package/dist/meter/index.d.mts +26 -0
  539. package/dist/meter/index.d.mts.map +1 -0
  540. package/dist/meter/index.mjs +25 -0
  541. package/dist/meter/index.mjs.map +1 -0
  542. package/dist/meter/meter-context.mjs +13 -0
  543. package/dist/meter/meter-context.mjs.map +1 -0
  544. package/dist/meter/meter-indicator.d.mts +30 -0
  545. package/dist/meter/meter-indicator.d.mts.map +1 -0
  546. package/dist/meter/meter-indicator.mjs +27 -0
  547. package/dist/meter/meter-indicator.mjs.map +1 -0
  548. package/dist/meter/meter-label.d.mts +30 -0
  549. package/dist/meter/meter-label.d.mts.map +1 -0
  550. package/dist/meter/meter-label.mjs +30 -0
  551. package/dist/meter/meter-label.mjs.map +1 -0
  552. package/dist/meter/meter-region.d.mts +9 -0
  553. package/dist/meter/meter-region.d.mts.map +1 -0
  554. package/dist/meter/meter-region.mjs +39 -0
  555. package/dist/meter/meter-region.mjs.map +1 -0
  556. package/dist/meter/meter-root.d.mts +113 -0
  557. package/dist/meter/meter-root.d.mts.map +1 -0
  558. package/dist/meter/meter-root.mjs +85 -0
  559. package/dist/meter/meter-root.mjs.map +1 -0
  560. package/dist/meter/meter-track.d.mts +30 -0
  561. package/dist/meter/meter-track.d.mts.map +1 -0
  562. package/dist/meter/meter-track.mjs +27 -0
  563. package/dist/meter/meter-track.mjs.map +1 -0
  564. package/dist/meter/meter-value.d.mts +34 -0
  565. package/dist/meter/meter-value.d.mts.map +1 -0
  566. package/dist/meter/meter-value.mjs +31 -0
  567. package/dist/meter/meter-value.mjs.map +1 -0
  568. package/dist/multi-select/index.d.mts +37 -0
  569. package/dist/multi-select/index.d.mts.map +1 -0
  570. package/dist/multi-select/index.mjs +37 -0
  571. package/dist/multi-select/index.mjs.map +1 -0
  572. package/dist/multi-select/multi-select-context.mjs +19 -0
  573. package/dist/multi-select/multi-select-context.mjs.map +1 -0
  574. package/dist/multi-select/multi-select-group.d.mts +120 -0
  575. package/dist/multi-select/multi-select-group.d.mts.map +1 -0
  576. package/dist/multi-select/multi-select-group.mjs +111 -0
  577. package/dist/multi-select/multi-select-group.mjs.map +1 -0
  578. package/dist/multi-select/multi-select-keyboard.mjs +145 -0
  579. package/dist/multi-select/multi-select-keyboard.mjs.map +1 -0
  580. package/dist/multi-select/multi-select-label.d.mts +42 -0
  581. package/dist/multi-select/multi-select-label.d.mts.map +1 -0
  582. package/dist/multi-select/multi-select-label.mjs +41 -0
  583. package/dist/multi-select/multi-select-label.mjs.map +1 -0
  584. package/dist/multi-select/multi-select-list.d.mts +47 -0
  585. package/dist/multi-select/multi-select-list.d.mts.map +1 -0
  586. package/dist/multi-select/multi-select-list.mjs +65 -0
  587. package/dist/multi-select/multi-select-list.mjs.map +1 -0
  588. package/dist/multi-select/multi-select-option.d.mts +68 -0
  589. package/dist/multi-select/multi-select-option.d.mts.map +1 -0
  590. package/dist/multi-select/multi-select-option.mjs +93 -0
  591. package/dist/multi-select/multi-select-option.mjs.map +1 -0
  592. package/dist/multi-select/multi-select-popup.d.mts +58 -0
  593. package/dist/multi-select/multi-select-popup.d.mts.map +1 -0
  594. package/dist/multi-select/multi-select-popup.mjs +71 -0
  595. package/dist/multi-select/multi-select-popup.mjs.map +1 -0
  596. package/dist/multi-select/multi-select-root.d.mts +125 -0
  597. package/dist/multi-select/multi-select-root.d.mts.map +1 -0
  598. package/dist/multi-select/multi-select-root.mjs +257 -0
  599. package/dist/multi-select/multi-select-root.mjs.map +1 -0
  600. package/dist/multi-select/multi-select-trigger.d.mts +66 -0
  601. package/dist/multi-select/multi-select-trigger.d.mts.map +1 -0
  602. package/dist/multi-select/multi-select-trigger.mjs +169 -0
  603. package/dist/multi-select/multi-select-trigger.mjs.map +1 -0
  604. package/dist/multi-select/multi-select-value.d.mts +57 -0
  605. package/dist/multi-select/multi-select-value.d.mts.map +1 -0
  606. package/dist/multi-select/multi-select-value.mjs +41 -0
  607. package/dist/multi-select/multi-select-value.mjs.map +1 -0
  608. package/dist/number-field/index.d.mts +29 -0
  609. package/dist/number-field/index.d.mts.map +1 -0
  610. package/dist/number-field/index.mjs +28 -0
  611. package/dist/number-field/index.mjs.map +1 -0
  612. package/dist/number-field/number-field-arithmetic.mjs +97 -0
  613. package/dist/number-field/number-field-arithmetic.mjs.map +1 -0
  614. package/dist/number-field/number-field-context.d.mts +7 -0
  615. package/dist/number-field/number-field-context.d.mts.map +1 -0
  616. package/dist/number-field/number-field-context.mjs +13 -0
  617. package/dist/number-field/number-field-context.mjs.map +1 -0
  618. package/dist/number-field/number-field-decrement.d.mts +19 -0
  619. package/dist/number-field/number-field-decrement.d.mts.map +1 -0
  620. package/dist/number-field/number-field-decrement.mjs +22 -0
  621. package/dist/number-field/number-field-decrement.mjs.map +1 -0
  622. package/dist/number-field/number-field-format.mjs +279 -0
  623. package/dist/number-field/number-field-format.mjs.map +1 -0
  624. package/dist/number-field/number-field-increment.d.mts +19 -0
  625. package/dist/number-field/number-field-increment.d.mts.map +1 -0
  626. package/dist/number-field/number-field-increment.mjs +22 -0
  627. package/dist/number-field/number-field-increment.mjs.map +1 -0
  628. package/dist/number-field/number-field-input.d.mts +38 -0
  629. package/dist/number-field/number-field-input.d.mts.map +1 -0
  630. package/dist/number-field/number-field-input.mjs +161 -0
  631. package/dist/number-field/number-field-input.mjs.map +1 -0
  632. package/dist/number-field/number-field-label.d.mts +33 -0
  633. package/dist/number-field/number-field-label.d.mts.map +1 -0
  634. package/dist/number-field/number-field-label.mjs +43 -0
  635. package/dist/number-field/number-field-label.mjs.map +1 -0
  636. package/dist/number-field/number-field-root.d.mts +157 -0
  637. package/dist/number-field/number-field-root.d.mts.map +1 -0
  638. package/dist/number-field/number-field-root.mjs +445 -0
  639. package/dist/number-field/number-field-root.mjs.map +1 -0
  640. package/dist/number-field/use-number-field-dev-warnings.mjs +28 -0
  641. package/dist/number-field/use-number-field-dev-warnings.mjs.map +1 -0
  642. package/dist/number-field/use-step-button.d.mts +44 -0
  643. package/dist/number-field/use-step-button.d.mts.map +1 -0
  644. package/dist/number-field/use-step-button.mjs +175 -0
  645. package/dist/number-field/use-step-button.mjs.map +1 -0
  646. package/dist/popover/index.d.mts +6 -4
  647. package/dist/popover/index.d.mts.map +1 -1
  648. package/dist/popover/index.mjs +6 -4
  649. package/dist/popover/index.mjs.map +1 -1
  650. package/dist/popover/popover-close.d.mts +48 -8
  651. package/dist/popover/popover-close.d.mts.map +1 -1
  652. package/dist/popover/popover-close.mjs +41 -67
  653. package/dist/popover/popover-close.mjs.map +1 -1
  654. package/dist/popover/popover-context.mjs.map +1 -1
  655. package/dist/popover/popover-description.d.mts +12 -0
  656. package/dist/popover/popover-description.d.mts.map +1 -1
  657. package/dist/popover/popover-description.mjs +2 -0
  658. package/dist/popover/popover-description.mjs.map +1 -1
  659. package/dist/popover/popover-popup.d.mts +64 -18
  660. package/dist/popover/popover-popup.d.mts.map +1 -1
  661. package/dist/popover/popover-popup.mjs +31 -36
  662. package/dist/popover/popover-popup.mjs.map +1 -1
  663. package/dist/popover/popover-root.d.mts +40 -18
  664. package/dist/popover/popover-root.d.mts.map +1 -1
  665. package/dist/popover/popover-root.mjs +15 -10
  666. package/dist/popover/popover-root.mjs.map +1 -1
  667. package/dist/popover/popover-title.d.mts +11 -0
  668. package/dist/popover/popover-title.d.mts.map +1 -1
  669. package/dist/popover/popover-title.mjs +2 -0
  670. package/dist/popover/popover-title.mjs.map +1 -1
  671. package/dist/popover/popover-trigger.d.mts +38 -18
  672. package/dist/popover/popover-trigger.d.mts.map +1 -1
  673. package/dist/popover/popover-trigger.mjs +14 -9
  674. package/dist/popover/popover-trigger.mjs.map +1 -1
  675. package/dist/progress/index.d.mts +26 -0
  676. package/dist/progress/index.d.mts.map +1 -0
  677. package/dist/progress/index.mjs +26 -0
  678. package/dist/progress/index.mjs.map +1 -0
  679. package/dist/progress/progress-context.mjs +13 -0
  680. package/dist/progress/progress-context.mjs.map +1 -0
  681. package/dist/progress/progress-indicator.d.mts +30 -0
  682. package/dist/progress/progress-indicator.d.mts.map +1 -0
  683. package/dist/progress/progress-indicator.mjs +31 -0
  684. package/dist/progress/progress-indicator.mjs.map +1 -0
  685. package/dist/progress/progress-label.d.mts +30 -0
  686. package/dist/progress/progress-label.d.mts.map +1 -0
  687. package/dist/progress/progress-label.mjs +32 -0
  688. package/dist/progress/progress-label.mjs.map +1 -0
  689. package/dist/progress/progress-root.d.mts +96 -0
  690. package/dist/progress/progress-root.d.mts.map +1 -0
  691. package/dist/progress/progress-root.mjs +82 -0
  692. package/dist/progress/progress-root.mjs.map +1 -0
  693. package/dist/progress/progress-track.d.mts +30 -0
  694. package/dist/progress/progress-track.d.mts.map +1 -0
  695. package/dist/progress/progress-track.mjs +31 -0
  696. package/dist/progress/progress-track.mjs.map +1 -0
  697. package/dist/progress/progress-value.d.mts +34 -0
  698. package/dist/progress/progress-value.d.mts.map +1 -0
  699. package/dist/progress/progress-value.mjs +35 -0
  700. package/dist/progress/progress-value.mjs.map +1 -0
  701. package/dist/radio-group/index.d.mts +2 -0
  702. package/dist/radio-group/index.d.mts.map +1 -1
  703. package/dist/radio-group/index.mjs +2 -0
  704. package/dist/radio-group/index.mjs.map +1 -1
  705. package/dist/radio-group/radio-group-context.mjs.map +1 -1
  706. package/dist/radio-group/radio-group-item.d.mts +21 -5
  707. package/dist/radio-group/radio-group-item.d.mts.map +1 -1
  708. package/dist/radio-group/radio-group-item.mjs +22 -25
  709. package/dist/radio-group/radio-group-item.mjs.map +1 -1
  710. package/dist/radio-group/radio-group-label.d.mts +10 -0
  711. package/dist/radio-group/radio-group-label.d.mts.map +1 -1
  712. package/dist/radio-group/radio-group-label.mjs +3 -6
  713. package/dist/radio-group/radio-group-label.mjs.map +1 -1
  714. package/dist/radio-group/radio-group-root.d.mts +34 -8
  715. package/dist/radio-group/radio-group-root.d.mts.map +1 -1
  716. package/dist/radio-group/radio-group-root.mjs +48 -39
  717. package/dist/radio-group/radio-group-root.mjs.map +1 -1
  718. package/dist/select/index.d.mts +2 -0
  719. package/dist/select/index.d.mts.map +1 -1
  720. package/dist/select/index.mjs +2 -0
  721. package/dist/select/index.mjs.map +1 -1
  722. package/dist/select/select-dom.mjs +9 -18
  723. package/dist/select/select-dom.mjs.map +1 -1
  724. package/dist/select/select-group-label.d.mts +10 -0
  725. package/dist/select/select-group-label.d.mts.map +1 -1
  726. package/dist/select/select-group-label.mjs +5 -1
  727. package/dist/select/select-group-label.mjs.map +1 -1
  728. package/dist/select/select-group.d.mts +15 -1
  729. package/dist/select/select-group.d.mts.map +1 -1
  730. package/dist/select/select-group.mjs +8 -4
  731. package/dist/select/select-group.mjs.map +1 -1
  732. package/dist/select/select-option.d.mts +19 -1
  733. package/dist/select/select-option.d.mts.map +1 -1
  734. package/dist/select/select-option.mjs +4 -2
  735. package/dist/select/select-option.mjs.map +1 -1
  736. package/dist/select/select-root.d.mts +28 -3
  737. package/dist/select/select-root.d.mts.map +1 -1
  738. package/dist/select/select-root.mjs +39 -12
  739. package/dist/select/select-root.mjs.map +1 -1
  740. package/dist/select/select-separator.d.mts +9 -0
  741. package/dist/select/select-separator.d.mts.map +1 -1
  742. package/dist/select/select-separator.mjs +2 -0
  743. package/dist/select/select-separator.mjs.map +1 -1
  744. package/dist/select/select-trigger.d.mts +9 -0
  745. package/dist/select/select-trigger.d.mts.map +1 -1
  746. package/dist/select/select-trigger.mjs +5 -1
  747. package/dist/select/select-trigger.mjs.map +1 -1
  748. package/dist/select/select-value.d.mts +9 -0
  749. package/dist/select/select-value.d.mts.map +1 -1
  750. package/dist/select/select-value.mjs +5 -6
  751. package/dist/select/select-value.mjs.map +1 -1
  752. package/dist/separator/index.d.mts +3 -0
  753. package/dist/separator/index.mjs +1 -0
  754. package/dist/separator/separator.d.mts +58 -0
  755. package/dist/separator/separator.d.mts.map +1 -0
  756. package/dist/separator/separator.mjs +41 -0
  757. package/dist/separator/separator.mjs.map +1 -0
  758. package/dist/slider/index.d.mts +34 -0
  759. package/dist/slider/index.d.mts.map +1 -0
  760. package/dist/slider/index.mjs +29 -0
  761. package/dist/slider/index.mjs.map +1 -0
  762. package/dist/slider/slider-arithmetic.mjs +165 -0
  763. package/dist/slider/slider-arithmetic.mjs.map +1 -0
  764. package/dist/slider/slider-context.mjs +13 -0
  765. package/dist/slider/slider-context.mjs.map +1 -0
  766. package/dist/slider/slider-indicator.d.mts +34 -0
  767. package/dist/slider/slider-indicator.d.mts.map +1 -0
  768. package/dist/slider/slider-indicator.mjs +38 -0
  769. package/dist/slider/slider-indicator.mjs.map +1 -0
  770. package/dist/slider/slider-label.d.mts +33 -0
  771. package/dist/slider/slider-label.d.mts.map +1 -0
  772. package/dist/slider/slider-label.mjs +40 -0
  773. package/dist/slider/slider-label.mjs.map +1 -0
  774. package/dist/slider/slider-root.d.mts +155 -0
  775. package/dist/slider/slider-root.d.mts.map +1 -0
  776. package/dist/slider/slider-root.mjs +434 -0
  777. package/dist/slider/slider-root.mjs.map +1 -0
  778. package/dist/slider/slider-thumb.d.mts +87 -0
  779. package/dist/slider/slider-thumb.d.mts.map +1 -0
  780. package/dist/slider/slider-thumb.mjs +150 -0
  781. package/dist/slider/slider-thumb.mjs.map +1 -0
  782. package/dist/slider/slider-track.d.mts +46 -0
  783. package/dist/slider/slider-track.d.mts.map +1 -0
  784. package/dist/slider/slider-track.mjs +57 -0
  785. package/dist/slider/slider-track.mjs.map +1 -0
  786. package/dist/slider/slider-value.d.mts +45 -0
  787. package/dist/slider/slider-value.d.mts.map +1 -0
  788. package/dist/slider/slider-value.mjs +41 -0
  789. package/dist/slider/slider-value.mjs.map +1 -0
  790. package/dist/slider/use-slider-dev-warnings.mjs +29 -0
  791. package/dist/slider/use-slider-dev-warnings.mjs.map +1 -0
  792. package/dist/slider/use-thumb-registry.mjs +51 -0
  793. package/dist/slider/use-thumb-registry.mjs.map +1 -0
  794. package/dist/switch/switch.d.mts +30 -9
  795. package/dist/switch/switch.d.mts.map +1 -1
  796. package/dist/switch/switch.mjs +24 -46
  797. package/dist/switch/switch.mjs.map +1 -1
  798. package/dist/tabs/index.d.mts +2 -0
  799. package/dist/tabs/index.d.mts.map +1 -1
  800. package/dist/tabs/index.mjs +2 -0
  801. package/dist/tabs/index.mjs.map +1 -1
  802. package/dist/tabs/tabs-context.d.mts +7 -3
  803. package/dist/tabs/tabs-context.d.mts.map +1 -1
  804. package/dist/tabs/tabs-context.mjs.map +1 -1
  805. package/dist/tabs/tabs-indicator.d.mts +17 -0
  806. package/dist/tabs/tabs-indicator.d.mts.map +1 -1
  807. package/dist/tabs/tabs-indicator.mjs +4 -1
  808. package/dist/tabs/tabs-indicator.mjs.map +1 -1
  809. package/dist/tabs/tabs-list.d.mts +19 -1
  810. package/dist/tabs/tabs-list.d.mts.map +1 -1
  811. package/dist/tabs/tabs-list.mjs +12 -23
  812. package/dist/tabs/tabs-list.mjs.map +1 -1
  813. package/dist/tabs/tabs-panel.d.mts +22 -4
  814. package/dist/tabs/tabs-panel.d.mts.map +1 -1
  815. package/dist/tabs/tabs-panel.mjs +4 -2
  816. package/dist/tabs/tabs-panel.mjs.map +1 -1
  817. package/dist/tabs/tabs-root.d.mts +43 -8
  818. package/dist/tabs/tabs-root.d.mts.map +1 -1
  819. package/dist/tabs/tabs-root.mjs +23 -10
  820. package/dist/tabs/tabs-root.mjs.map +1 -1
  821. package/dist/tabs/tabs-tab.d.mts +25 -5
  822. package/dist/tabs/tabs-tab.d.mts.map +1 -1
  823. package/dist/tabs/tabs-tab.mjs +5 -2
  824. package/dist/tabs/tabs-tab.mjs.map +1 -1
  825. package/dist/{internal → tabs}/use-until-found.mjs +1 -1
  826. package/dist/tabs/use-until-found.mjs.map +1 -0
  827. package/dist/toast/index.d.mts +27 -0
  828. package/dist/toast/index.d.mts.map +1 -0
  829. package/dist/toast/index.mjs +28 -0
  830. package/dist/toast/index.mjs.map +1 -0
  831. package/dist/toast/toast-action.d.mts +86 -0
  832. package/dist/toast/toast-action.d.mts.map +1 -0
  833. package/dist/toast/toast-action.mjs +81 -0
  834. package/dist/toast/toast-action.mjs.map +1 -0
  835. package/dist/toast/toast-close.d.mts +52 -0
  836. package/dist/toast/toast-close.d.mts.map +1 -0
  837. package/dist/toast/toast-close.mjs +53 -0
  838. package/dist/toast/toast-close.mjs.map +1 -0
  839. package/dist/toast/toast-context.mjs +19 -0
  840. package/dist/toast/toast-context.mjs.map +1 -0
  841. package/dist/toast/toast-description.d.mts +39 -0
  842. package/dist/toast/toast-description.d.mts.map +1 -0
  843. package/dist/toast/toast-description.mjs +37 -0
  844. package/dist/toast/toast-description.mjs.map +1 -0
  845. package/dist/toast/toast-hotkey.mjs +27 -0
  846. package/dist/toast/toast-hotkey.mjs.map +1 -0
  847. package/dist/toast/toast-queue.mjs +137 -0
  848. package/dist/toast/toast-queue.mjs.map +1 -0
  849. package/dist/toast/toast-root.d.mts +63 -0
  850. package/dist/toast/toast-root.d.mts.map +1 -0
  851. package/dist/toast/toast-root.mjs +209 -0
  852. package/dist/toast/toast-root.mjs.map +1 -0
  853. package/dist/toast/toast-timers.mjs +65 -0
  854. package/dist/toast/toast-timers.mjs.map +1 -0
  855. package/dist/toast/toast-title.d.mts +38 -0
  856. package/dist/toast/toast-title.d.mts.map +1 -0
  857. package/dist/toast/toast-title.mjs +35 -0
  858. package/dist/toast/toast-title.mjs.map +1 -0
  859. package/dist/toast/toast-viewport.d.mts +81 -0
  860. package/dist/toast/toast-viewport.d.mts.map +1 -0
  861. package/dist/toast/toast-viewport.mjs +345 -0
  862. package/dist/toast/toast-viewport.mjs.map +1 -0
  863. package/dist/toast/toast.d.mts +162 -0
  864. package/dist/toast/toast.d.mts.map +1 -0
  865. package/dist/toast/toast.mjs +161 -0
  866. package/dist/toast/toast.mjs.map +1 -0
  867. package/dist/toast/use-modal-portal-host.mjs +52 -0
  868. package/dist/toast/use-modal-portal-host.mjs.map +1 -0
  869. package/dist/toast/use-toast-announcements.mjs +46 -0
  870. package/dist/toast/use-toast-announcements.mjs.map +1 -0
  871. package/dist/toast/use-toast-focus.mjs +75 -0
  872. package/dist/toast/use-toast-focus.mjs.map +1 -0
  873. package/dist/toast/use-toast-pauses.mjs +58 -0
  874. package/dist/toast/use-toast-pauses.mjs.map +1 -0
  875. package/dist/toggle/toggle.d.mts +26 -6
  876. package/dist/toggle/toggle.d.mts.map +1 -1
  877. package/dist/toggle/toggle.mjs +12 -6
  878. package/dist/toggle/toggle.mjs.map +1 -1
  879. package/dist/toggle-group/index.d.mts +18 -0
  880. package/dist/toggle-group/index.d.mts.map +1 -0
  881. package/dist/toggle-group/index.mjs +17 -0
  882. package/dist/toggle-group/index.mjs.map +1 -0
  883. package/dist/toggle-group/toggle-group-context.d.mts +6 -0
  884. package/dist/toggle-group/toggle-group-context.d.mts.map +1 -0
  885. package/dist/toggle-group/toggle-group-context.mjs +13 -0
  886. package/dist/toggle-group/toggle-group-context.mjs.map +1 -0
  887. package/dist/toggle-group/toggle-group-item.d.mts +71 -0
  888. package/dist/toggle-group/toggle-group-item.d.mts.map +1 -0
  889. package/dist/toggle-group/toggle-group-item.mjs +69 -0
  890. package/dist/toggle-group/toggle-group-item.mjs.map +1 -0
  891. package/dist/toggle-group/toggle-group-root.d.mts +156 -0
  892. package/dist/toggle-group/toggle-group-root.d.mts.map +1 -0
  893. package/dist/toggle-group/toggle-group-root.mjs +177 -0
  894. package/dist/toggle-group/toggle-group-root.mjs.map +1 -0
  895. package/dist/toolbar/index.d.mts +19 -0
  896. package/dist/toolbar/index.d.mts.map +1 -0
  897. package/dist/toolbar/index.mjs +19 -0
  898. package/dist/toolbar/index.mjs.map +1 -0
  899. package/dist/toolbar/toolbar-root.d.mts +65 -0
  900. package/dist/toolbar/toolbar-root.d.mts.map +1 -0
  901. package/dist/toolbar/toolbar-root.mjs +67 -0
  902. package/dist/toolbar/toolbar-root.mjs.map +1 -0
  903. package/dist/toolbar/toolbar-separator.d.mts +38 -0
  904. package/dist/toolbar/toolbar-separator.d.mts.map +1 -0
  905. package/dist/toolbar/toolbar-separator.mjs +33 -0
  906. package/dist/toolbar/toolbar-separator.mjs.map +1 -0
  907. package/dist/tooltip/index.d.mts +10 -5
  908. package/dist/tooltip/index.d.mts.map +1 -1
  909. package/dist/tooltip/index.mjs +8 -3
  910. package/dist/tooltip/index.mjs.map +1 -1
  911. package/dist/tooltip/tooltip-arrow.d.mts +46 -0
  912. package/dist/tooltip/tooltip-arrow.d.mts.map +1 -0
  913. package/dist/tooltip/tooltip-arrow.mjs +47 -0
  914. package/dist/tooltip/tooltip-arrow.mjs.map +1 -0
  915. package/dist/tooltip/tooltip-context.d.mts +11 -0
  916. package/dist/tooltip/tooltip-context.d.mts.map +1 -1
  917. package/dist/tooltip/tooltip-context.mjs +2 -1
  918. package/dist/tooltip/tooltip-context.mjs.map +1 -1
  919. package/dist/tooltip/tooltip-popup.d.mts +49 -7
  920. package/dist/tooltip/tooltip-popup.d.mts.map +1 -1
  921. package/dist/tooltip/tooltip-popup.mjs +37 -15
  922. package/dist/tooltip/tooltip-popup.mjs.map +1 -1
  923. package/dist/tooltip/tooltip-root.d.mts +24 -2
  924. package/dist/tooltip/tooltip-root.d.mts.map +1 -1
  925. package/dist/tooltip/tooltip-root.mjs +29 -6
  926. package/dist/tooltip/tooltip-root.mjs.map +1 -1
  927. package/dist/tooltip/tooltip-trigger.d.mts +28 -3
  928. package/dist/tooltip/tooltip-trigger.d.mts.map +1 -1
  929. package/dist/tooltip/tooltip-trigger.mjs +26 -6
  930. package/dist/tooltip/tooltip-trigger.mjs.map +1 -1
  931. package/dist/tooltip/tooltip-warm.mjs +29 -0
  932. package/dist/tooltip/tooltip-warm.mjs.map +1 -0
  933. package/dist/tooltip/use-tooltip-interaction.mjs +128 -77
  934. package/dist/tooltip/use-tooltip-interaction.mjs.map +1 -1
  935. package/package.json +27 -2
  936. package/skills/funstack-ui-knowledge/SKILL.md +80 -0
  937. package/dist/accordion/accordion-context.d.mts +0 -5
  938. package/dist/accordion/accordion-context.d.mts.map +0 -1
  939. package/dist/internal/action-details.mjs.map +0 -1
  940. package/dist/internal/anchor-position.d.mts +0 -7
  941. package/dist/internal/anchor-position.d.mts.map +0 -1
  942. package/dist/internal/anchor-position.mjs +0 -16
  943. package/dist/internal/anchor-position.mjs.map +0 -1
  944. package/dist/internal/sync-presence.mjs.map +0 -1
  945. package/dist/internal/use-action-trigger.mjs +0 -58
  946. package/dist/internal/use-action-trigger.mjs.map +0 -1
  947. package/dist/internal/use-controllable-action.mjs +0 -119
  948. package/dist/internal/use-controllable-action.mjs.map +0 -1
  949. package/dist/internal/use-exit-animation.mjs.map +0 -1
  950. package/dist/internal/use-form-reset.mjs +0 -54
  951. package/dist/internal/use-form-reset.mjs.map +0 -1
  952. package/dist/internal/use-native-checked.mjs.map +0 -1
  953. package/dist/internal/use-native-group-reconciliation.mjs.map +0 -1
  954. package/dist/internal/use-native-select-value.mjs.map +0 -1
  955. package/dist/internal/use-popover-popup.mjs +0 -274
  956. package/dist/internal/use-popover-popup.mjs.map +0 -1
  957. package/dist/internal/use-popover-root.d.mts +0 -2
  958. package/dist/internal/use-popover-root.mjs +0 -112
  959. package/dist/internal/use-popover-root.mjs.map +0 -1
  960. package/dist/internal/use-popover-trigger.mjs +0 -86
  961. package/dist/internal/use-popover-trigger.mjs.map +0 -1
  962. package/dist/internal/use-until-found.mjs.map +0 -1
@@ -1,22 +1,54 @@
1
1
  import { RenderProp, StateValue } from "../internal/types.mjs";
2
+ import { AnchorAlign, AnchorSide } from "../internal/overlay/anchor-position.mjs";
2
3
  import { CSSProperties, ComponentPropsWithRef, ReactNode, RefObject, ViewTransitionClass } from "react";
3
4
  //#region src/popover/popover-popup.d.ts
4
- export type PopoverSide = "top" | "bottom" | "left" | "right";
5
- export type PopoverAlign = "start" | "center" | "end";
5
+ /** `inline-start` / `inline-end` follow the popup's `direction` (conventions 13.1). */
6
+ export type PopoverSide = AnchorSide;
7
+ /**
8
+ * Alignment of the Popup along its side: inline-relative on a top / bottom side, the top / bottom
9
+ * edges on the others.
10
+ */
11
+ export type PopoverAlign = AnchorAlign;
12
+ /**
13
+ * State of `Popover.Popup`, passed to the function forms of `className`, `style`, `children` and
14
+ * `render`.
15
+ */
6
16
  export interface PopoverPopupState {
7
- /** Committed open state (library mode); `false` in JS-free mode. Read `:popover-open` for the DOM truth. */
17
+ /**
18
+ * Committed open state (library mode); `false` in JS-free mode. Read `:popover-open` for the
19
+ * DOM truth.
20
+ */
8
21
  readonly open: boolean;
22
+ /**
23
+ * While shown: the physical side the browser placed the popup on (after any fallback flip;
24
+ * conventions 13.2). Otherwise the `side` prop. `null` with `side={null}`.
25
+ */
9
26
  readonly side: PopoverSide | null;
27
+ /** While shown: the resolved alignment; otherwise the `align` prop. */
10
28
  readonly align: PopoverAlign;
11
29
  }
30
+ /**
31
+ * Props of `Popover.Popup`.
32
+ *
33
+ * @see https://ui.funstack.work/components/popover
34
+ */
12
35
  export interface PopoverPopupProps extends Omit<ComponentPropsWithRef<"dialog">, "id" | "popover" | "open" | "aria-modal" | "onToggle" | "onBeforeToggle" | "className" | "style" | "children"> {
13
36
  /**
14
37
  * Placement relative to the Trigger through inline `position-area`, with
15
- * `position-try-fallbacks` flipping it when it does not fit. Default `"bottom"`. `null` emits
16
- * no inline positioning (and no `data-side` / `data-align`), so a stylesheet owns placement.
38
+ * `position-try-fallbacks` flipping it when it does not fit.
39
+ * `"inline-start"` / `"inline-end"` follow the popup's direction. `null` emits no inline
40
+ * positioning (and no `data-side` / `data-align`), so a stylesheet owns placement.
41
+ *
42
+ * @defaultValue `"bottom"`
17
43
  */
18
44
  side?: PopoverSide | null;
19
- /** Alignment along the side. Default `"center"`. Ignored when `side` is `null`. */
45
+ /**
46
+ * Alignment along the side. On a top / bottom side `start` / `end` are
47
+ * inline-relative (mirrored under `direction: rtl`); on the other sides the top / bottom
48
+ * edges. Ignored when `side` is `null`.
49
+ *
50
+ * @defaultValue `"center"`
51
+ */
20
52
  align?: PopoverAlign;
21
53
  /**
22
54
  * Library mode: what happens to the children while the popover is closed.
@@ -27,16 +59,20 @@ export interface PopoverPopupProps extends Omit<ComponentPropsWithRef<"dialog">,
27
59
  * stopped, pre-rendered at low priority. Not in the server HTML.
28
60
  *
29
61
  * Ignored in JS-free mode (always mounted).
62
+ *
63
+ * @defaultValue `false`
30
64
  */
31
65
  keepMounted?: boolean;
32
66
  /**
33
67
  * Element to focus when the popover opens: a ref, or a selector resolved inside the popup.
34
68
  * The library writes `autofocus` on it right before `showPopover()` and the platform focuses
35
- * it. Default: the platform's choice for a `<dialog>` (first focusable descendant; the popup
36
- * itself if none); for `render={<div />}` focus stays on the Trigger.
69
+ * it.
37
70
  *
38
71
  * In JS-free mode the browser opens the popover itself, so the attribute is written after
39
72
  * hydration and kept while mounted; before hydration only `autoFocus` in the markup works.
73
+ *
74
+ * @defaultValue the platform's choice for a `<dialog>` (first focusable descendant; the popup
75
+ * itself if none); for `render={<div />}` focus stays on the Trigger
40
76
  */
41
77
  initialFocus?: RefObject<HTMLElement | null> | string;
42
78
  /**
@@ -44,37 +80,47 @@ export interface PopoverPopupProps extends Omit<ComponentPropsWithRef<"dialog">,
44
80
  * itself. Animates the opening commit, content changes while open, and every library-driven
45
81
  * close (Trigger, Close, controlled `open={false}`), in all engines; dismissals (Escape,
46
82
  * click outside) are the browser's and animate with CSS only. Ignored (dev warning) in JS-free
47
- * mode.
83
+ * mode. While a view transition runs, the popup's CSS transitions are turned off for the moment
84
+ * of the library's own show or hide (an inline `transition: none !important`, restored right
85
+ * after), so that show or hide runs no CSS transition (a `@keyframes` animation is not cut).
48
86
  *
49
- * Static: without `transition` the part renders no `<ViewTransition>`; changing it between
50
- * `undefined` and a value remounts the element. A Root inserted by a transition with
51
- * `transition` set on its Popup pays the page cross-fade (issue #35); a plain open does not,
52
- * because the children mount under the already-mounted popover element.
87
+ * Static: setting or unsetting it remounts the element. Any value, `"none"` included, makes a
88
+ * mount or `<Activity>` reveal inside a transition start a document view transition (a ~250 ms
89
+ * page cross-fade that the next transition waits for).
90
+ * A plain open starts none: the children mount under the already-mounted popover element.
53
91
  */
54
92
  transition?: ViewTransitionClass;
93
+ /** Class name, or a function of the part's state that returns one. */
55
94
  className?: StateValue<string | undefined, PopoverPopupState>;
95
+ /** Inline style, or a function of the part's state that returns one. */
56
96
  style?: StateValue<CSSProperties | undefined, PopoverPopupState>;
97
+ /** Content, or a function of the part's state. */
57
98
  children?: StateValue<ReactNode, PopoverPopupState>;
58
99
  /** A `<dialog>` (default) or a `<div>` (focus stays on the Trigger). */
59
100
  render?: RenderProp<ComponentPropsWithRef<"dialog">, PopoverPopupState>;
60
101
  }
61
102
  /**
62
103
  * The popover itself: a `<dialog popover="auto" aria-modal="false" role="dialog">` with the id
63
- * the Trigger's `commandfor` names, placed against the Trigger with CSS Anchor Positioning and
104
+ * the Trigger's `popovertarget` names, placed against the Trigger with CSS Anchor Positioning and
64
105
  * wired to Title and Description through `aria-labelledby` / `aria-describedby`. Style it with
65
- * `:popover-open`; it emits `data-side` / `data-align` but no `data-open`.
106
+ * `:popover-open`; it emits `data-side` / `data-align` but no `data-open`. While shown, those are
107
+ * where the browser placed it (the applied `position-try-fallbacks` option; conventions 13.2),
108
+ * in both modes; otherwise the requested values.
66
109
  *
67
110
  * In library mode the children render from committed state, so content that suspends keeps the
68
111
  * popover closed (and the Trigger pending) until it is ready; `showPopover({ source: trigger })`
69
112
  * runs in the layout effect of the commit that mounted them, and a library-driven close runs
70
- * `hidePopover()` in the commit that ends it. Dismissals are the browser's: the native `toggle`
71
- * event becomes `openChangeAction(false, { reason: "dismiss" })`.
113
+ * `hidePopover()` in the commit that ends it. Dismissals are the browser's facts: the native
114
+ * `toggle` event makes committed state `false` urgently and calls `onOpenChange(false, { reason:
115
+ * "dismiss" })`; no view transition runs for them.
72
116
  *
73
117
  * Owned keys (conventions 1.2): `id`, `popover`, `open`, `aria-modal`, `aria-labelledby` and
74
118
  * `aria-describedby` (token-merged), and `data-side` / `data-align` unless `side` is `null`.
75
119
  * `role` is a default (`"dialog"`) the consumer may override.
120
+ *
121
+ * @see https://ui.funstack.work/components/popover
76
122
  */
77
- export declare function PopoverPopup({ side, align, keepMounted, initialFocus, transition, className, style, children, render, ...rest }: PopoverPopupProps): ReactNode;
123
+ export declare function PopoverPopup({ side: sideProp, align: alignProp, keepMounted, initialFocus, transition, className, style, children, render, ...rest }: PopoverPopupProps): ReactNode;
78
124
  export declare namespace PopoverPopup {
79
125
  var displayName: string;
80
126
  }
@@ -1 +1 @@
1
- {"version":3,"file":"popover-popup.d.mts","names":[],"sources":["../../src/popover/popover-popup.tsx"],"mappings":";;;YAkBY;YACA;iBAEK;;WAEN;WACA,MAAM;WACN,OAAO;;iBAGD,0BAA0B,KACzC;;;;;;EAgBA,OAAO;;EAEP,QAAQ;;;;;;;;;;;EAWR;;;;;;;;;;EAUA,eAAe,UAAU;;;;;;;;;;;;;EAazB,aAAa;EACb,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;EAC9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;;;;;wBAmBvC,eACd,MACA,OACA,aACA,cACA,YACA,WACA,OACA,UACA,WACG,QACF,oBAAiB;yBAXJ"}
1
+ {"version":3,"file":"popover-popup.d.mts","names":[],"sources":["../../src/popover/popover-popup.tsx"],"mappings":";;;;;YAoBY,cAAc;;;;;YAKd,eAAe;;;;;iBAMV;;;;;WAKN;;;;;WAKA,MAAM;;WAEN,OAAO;;;;;;;iBAQD,0BAA0B,KACzC;;;;;;;;;EAmBA,OAAO;;;;;;;;EAQP,QAAQ;;;;;;;;;;;;;EAaR;;;;;;;;;;;;EAYA,eAAe,UAAU;;;;;;;;;;;;;;;EAezB,aAAa;;EAEb,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;wBAwBvC,eACd,MAAM,UACN,OAAO,WACP,aACA,cACA,YACA,WACA,OACA,UACA,WACG,QACF,oBAAiB;yBAXJ"}
@@ -1,59 +1,61 @@
1
1
  "use client";
2
2
  import { useTransitionBoundary } from "../internal/transition-boundary.mjs";
3
- import { resolveStateValue, useRender } from "../internal/use-render.mjs";
4
- import { useDevWarning } from "../internal/use-dev-warning.mjs";
5
- import { POSITION_TRY_FALLBACKS, positionArea } from "../internal/anchor-position.mjs";
3
+ import { resolveStateValue } from "../internal/render-element.mjs";
4
+ import { useRender } from "../internal/use-render.mjs";
5
+ import { useMergedRefs } from "../internal/use-merged-refs.mjs";
6
+ import { useAnchoredPlacement } from "../internal/overlay/use-resolved-placement.mjs";
7
+ import { useJsFreePropWarnings } from "../internal/overlay/overlay-popup.mjs";
8
+ import { usePopoverPopup } from "../internal/overlay/use-popover-popup.mjs";
6
9
  import { PopoverPopupContext, usePopoverContext } from "./popover-context.mjs";
7
- import { usePopoverPopup } from "../internal/use-popover-popup.mjs";
8
- import { Activity } from "react";
9
10
  import { jsx } from "react/jsx-runtime";
10
11
  //#region src/popover/popover-popup.tsx
11
12
  /**
12
13
  * The popover itself: a `<dialog popover="auto" aria-modal="false" role="dialog">` with the id
13
- * the Trigger's `commandfor` names, placed against the Trigger with CSS Anchor Positioning and
14
+ * the Trigger's `popovertarget` names, placed against the Trigger with CSS Anchor Positioning and
14
15
  * wired to Title and Description through `aria-labelledby` / `aria-describedby`. Style it with
15
- * `:popover-open`; it emits `data-side` / `data-align` but no `data-open`.
16
+ * `:popover-open`; it emits `data-side` / `data-align` but no `data-open`. While shown, those are
17
+ * where the browser placed it (the applied `position-try-fallbacks` option; conventions 13.2),
18
+ * in both modes; otherwise the requested values.
16
19
  *
17
20
  * In library mode the children render from committed state, so content that suspends keeps the
18
21
  * popover closed (and the Trigger pending) until it is ready; `showPopover({ source: trigger })`
19
22
  * runs in the layout effect of the commit that mounted them, and a library-driven close runs
20
- * `hidePopover()` in the commit that ends it. Dismissals are the browser's: the native `toggle`
21
- * event becomes `openChangeAction(false, { reason: "dismiss" })`.
23
+ * `hidePopover()` in the commit that ends it. Dismissals are the browser's facts: the native
24
+ * `toggle` event makes committed state `false` urgently and calls `onOpenChange(false, { reason:
25
+ * "dismiss" })`; no view transition runs for them.
22
26
  *
23
27
  * Owned keys (conventions 1.2): `id`, `popover`, `open`, `aria-modal`, `aria-labelledby` and
24
28
  * `aria-describedby` (token-merged), and `data-side` / `data-align` unless `side` is `null`.
25
29
  * `role` is a default (`"dialog"`) the consumer may override.
30
+ *
31
+ * @see https://ui.funstack.work/components/popover
26
32
  */
27
- function PopoverPopup({ side = "bottom", align = "center", keepMounted, initialFocus, transition, className, style, children, render, ...rest }) {
33
+ function PopoverPopup({ side: sideProp = "bottom", align: alignProp = "center", keepMounted, initialFocus, transition, className, style, children, render, ...rest }) {
28
34
  const ctx = usePopoverContext("Popover.Popup");
29
35
  const isLibrary = ctx.mode === "library";
30
36
  const { ids } = ctx;
31
- useDevWarning(!isLibrary && transition !== void 0, "Popover.Popup: `transition` has no effect in JS-free mode; the browser opens and closes the popover outside any React transition. Animate it with CSS (`@starting-style`).");
32
- useDevWarning(!isLibrary && keepMounted === false, "Popover.Popup: `keepMounted={false}` cannot be honoured in JS-free mode; the content is always mounted so that the server HTML is complete.");
33
- const { setElement, visible, wrapContent } = usePopoverPopup(ctx, {
37
+ useJsFreePropWarnings("Popover.Popup", "popover", isLibrary, transition, keepMounted);
38
+ const { setElement, renderContent } = usePopoverPopup(ctx, {
34
39
  part: "Popover.Popup",
35
40
  initialFocus,
36
41
  keepMounted,
37
42
  transition: isLibrary ? transition : void 0
38
43
  });
44
+ const placement = useAnchoredPlacement({
45
+ side: sideProp,
46
+ align: alignProp
47
+ });
48
+ const { side, align } = placement;
49
+ const ref = useMergedRefs(setElement, placement.ref);
39
50
  const state = {
40
51
  open: ctx.committed,
41
52
  side,
42
53
  align
43
54
  };
44
- const content = (s) => {
45
- let node;
46
- if (!isLibrary) node = resolveStateValue(children, s);
47
- else if (keepMounted === true) node = /* @__PURE__ */ jsx(Activity, {
48
- mode: visible ? "visible" : "hidden",
49
- children: wrapContent(resolveStateValue(children, s))
50
- });
51
- else node = visible ? wrapContent(resolveStateValue(children, s)) : null;
52
- return /* @__PURE__ */ jsx(PopoverPopupContext, {
53
- value: s,
54
- children: node
55
- });
56
- };
55
+ const content = (s) => /* @__PURE__ */ jsx(PopoverPopupContext, {
56
+ value: s,
57
+ children: renderContent(() => resolveStateValue(children, s))
58
+ });
57
59
  const libraryProps = {
58
60
  id: ids.popup,
59
61
  popover: "auto",
@@ -61,28 +63,21 @@ function PopoverPopup({ side = "bottom", align = "center", keepMounted, initialF
61
63
  "aria-modal": "false",
62
64
  "aria-labelledby": ids.title,
63
65
  "aria-describedby": ids.description,
64
- ...side !== null && {
65
- "data-side": side,
66
- "data-align": align
67
- }
66
+ ...placement.dataAttributes
68
67
  };
69
68
  const element = useRender({
70
69
  defaultElement: "dialog",
71
70
  render,
72
71
  state,
73
72
  className,
74
- style: side === null ? style : (s) => ({
75
- positionArea: positionArea(side, align),
76
- positionTryFallbacks: POSITION_TRY_FALLBACKS,
77
- ...resolveStateValue(style, s)
78
- }),
73
+ style: placement.style(style),
79
74
  children: content,
80
75
  props: {
81
76
  role: "dialog",
82
77
  ...rest
83
78
  },
84
79
  libraryProps,
85
- ref: setElement
80
+ ref
86
81
  });
87
82
  return useTransitionBoundary("Popover.Popup", isLibrary ? transition : void 0, element);
88
83
  }
@@ -1 +1 @@
1
- {"version":3,"file":"popover-popup.mjs","names":[],"sources":["../../src/popover/popover-popup.tsx"],"sourcesContent":["\"use client\";\nimport { Activity } from \"react\";\nimport type {\n ComponentPropsWithRef,\n CSSProperties,\n ReactNode,\n RefObject,\n ViewTransitionClass,\n} from \"react\";\nimport { POSITION_TRY_FALLBACKS, positionArea } from \"../internal/anchor-position.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useDevWarning } from \"../internal/use-dev-warning.js\";\nimport { usePopoverPopup } from \"../internal/use-popover-popup.js\";\nimport { resolveStateValue, useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { PopoverPopupContext, usePopoverContext } from \"./popover-context.js\";\n\nexport type PopoverSide = \"top\" | \"bottom\" | \"left\" | \"right\";\nexport type PopoverAlign = \"start\" | \"center\" | \"end\";\n\nexport interface PopoverPopupState {\n /** Committed open state (library mode); `false` in JS-free mode. Read `:popover-open` for the DOM truth. */\n readonly open: boolean;\n readonly side: PopoverSide | null;\n readonly align: PopoverAlign;\n}\n\nexport interface PopoverPopupProps extends Omit<\n ComponentPropsWithRef<\"dialog\">,\n | \"id\"\n | \"popover\"\n | \"open\"\n | \"aria-modal\"\n | \"onToggle\"\n | \"onBeforeToggle\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * Placement relative to the Trigger through inline `position-area`, with\n * `position-try-fallbacks` flipping it when it does not fit. Default `\"bottom\"`. `null` emits\n * no inline positioning (and no `data-side` / `data-align`), so a stylesheet owns placement.\n */\n side?: PopoverSide | null;\n /** Alignment along the side. Default `\"center\"`. Ignored when `side` is `null`. */\n align?: PopoverAlign;\n /**\n * Library mode: what happens to the children while the popover is closed.\n * - `false` (default): not rendered. Mounting them is part of the opening transition, so\n * content that suspends holds the open until it is ready. Unmount waits for the popover's\n * exit animation (CSS), or happens in the close commit when `transition` is set.\n * - `true`: rendered inside `<Activity mode=\"hidden\">`: DOM and state preserved, effects\n * stopped, pre-rendered at low priority. Not in the server HTML.\n *\n * Ignored in JS-free mode (always mounted).\n */\n keepMounted?: boolean;\n /**\n * Element to focus when the popover opens: a ref, or a selector resolved inside the popup.\n * The library writes `autofocus` on it right before `showPopover()` and the platform focuses\n * it. Default: the platform's choice for a `<dialog>` (first focusable descendant; the popup\n * itself if none); for `render={<div />}` focus stays on the Trigger.\n *\n * In JS-free mode the browser opens the popover itself, so the attribute is written after\n * hydration and kept while mounted; before hydration only `autoFocus` in the markup works.\n */\n initialFocus?: RefObject<HTMLElement | null> | string;\n /**\n * Library mode only. Forwarded to the `<ViewTransition default>` around the popover element\n * itself. Animates the opening commit, content changes while open, and every library-driven\n * close (Trigger, Close, controlled `open={false}`), in all engines; dismissals (Escape,\n * click outside) are the browser's and animate with CSS only. Ignored (dev warning) in JS-free\n * mode.\n *\n * Static: without `transition` the part renders no `<ViewTransition>`; changing it between\n * `undefined` and a value remounts the element. A Root inserted by a transition with\n * `transition` set on its Popup pays the page cross-fade (issue #35); a plain open does not,\n * because the children mount under the already-mounted popover element.\n */\n transition?: ViewTransitionClass;\n className?: StateValue<string | undefined, PopoverPopupState>;\n style?: StateValue<CSSProperties | undefined, PopoverPopupState>;\n children?: StateValue<ReactNode, PopoverPopupState>;\n /** A `<dialog>` (default) or a `<div>` (focus stays on the Trigger). */\n render?: RenderProp<ComponentPropsWithRef<\"dialog\">, PopoverPopupState>;\n}\n\n/**\n * The popover itself: a `<dialog popover=\"auto\" aria-modal=\"false\" role=\"dialog\">` with the id\n * the Trigger's `commandfor` names, placed against the Trigger with CSS Anchor Positioning and\n * wired to Title and Description through `aria-labelledby` / `aria-describedby`. Style it with\n * `:popover-open`; it emits `data-side` / `data-align` but no `data-open`.\n *\n * In library mode the children render from committed state, so content that suspends keeps the\n * popover closed (and the Trigger pending) until it is ready; `showPopover({ source: trigger })`\n * runs in the layout effect of the commit that mounted them, and a library-driven close runs\n * `hidePopover()` in the commit that ends it. Dismissals are the browser's: the native `toggle`\n * event becomes `openChangeAction(false, { reason: \"dismiss\" })`.\n *\n * Owned keys (conventions 1.2): `id`, `popover`, `open`, `aria-modal`, `aria-labelledby` and\n * `aria-describedby` (token-merged), and `data-side` / `data-align` unless `side` is `null`.\n * `role` is a default (`\"dialog\"`) the consumer may override.\n */\nexport function PopoverPopup({\n side = \"bottom\",\n align = \"center\",\n keepMounted,\n initialFocus,\n transition,\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverPopupProps) {\n const ctx = usePopoverContext(\"Popover.Popup\");\n const isLibrary = ctx.mode === \"library\";\n const { ids } = ctx;\n\n useDevWarning(\n !isLibrary && transition !== undefined,\n \"Popover.Popup: `transition` has no effect in JS-free mode; the browser opens and closes the \" +\n \"popover outside any React transition. Animate it with CSS (`@starting-style`).\",\n );\n useDevWarning(\n !isLibrary && keepMounted === false,\n \"Popover.Popup: `keepMounted={false}` cannot be honoured in JS-free mode; the content is \" +\n \"always mounted so that the server HTML is complete.\",\n );\n\n const { setElement, visible, wrapContent } = usePopoverPopup(ctx, {\n part: \"Popover.Popup\",\n initialFocus,\n keepMounted,\n transition: isLibrary ? transition : undefined,\n });\n\n const state: PopoverPopupState = { open: ctx.committed, side, align };\n\n const content = (s: PopoverPopupState): ReactNode => {\n let node: ReactNode;\n if (!isLibrary) {\n node = resolveStateValue(children, s);\n } else if (keepMounted === true) {\n // The mode changes with committed state, inside the Root's transition (conventions 5.5);\n // it stays visible while an exit animation runs.\n node = (\n <Activity mode={visible ? \"visible\" : \"hidden\"}>\n {wrapContent(resolveStateValue(children, s))}\n </Activity>\n );\n } else {\n node = visible ? wrapContent(resolveStateValue(children, s)) : null;\n }\n return <PopoverPopupContext value={s}>{node}</PopoverPopupContext>;\n };\n\n const libraryProps: ComponentPropsWithRef<\"dialog\"> & DataAttributes = {\n id: ids.popup,\n popover: \"auto\",\n // Never rendered: `showPopover()` does not set it, and an `open` attribute would show the\n // <dialog> outside the top layer. Owned so a `render` element cannot add it.\n open: undefined,\n // Chromium exposes a <dialog popover> as modal without it (research; issue #44).\n \"aria-modal\": \"false\",\n \"aria-labelledby\": ids.title,\n \"aria-describedby\": ids.description,\n // Not owned with `side={null}`: the stylesheet (or a render element) may set them.\n ...(side !== null && { \"data-side\": side, \"data-align\": align }),\n };\n\n const element = useRender<ComponentPropsWithRef<\"dialog\">, PopoverPopupState>({\n defaultElement: \"dialog\",\n render,\n state,\n className,\n // The inline placement sits under the consumer's style: the consumer wins (design 8).\n style:\n side === null\n ? style\n : (s) => ({\n positionArea: positionArea(side, align),\n positionTryFallbacks: POSITION_TRY_FALLBACKS,\n ...resolveStateValue(style, s),\n }),\n children: content,\n // `role` is a default the consumer's `rest` overrides (design 3.3): WebKit implements no\n // minimum role for `[popover]`, and a `<div>` popup needs it.\n props: { role: \"dialog\", ...rest },\n libraryProps,\n ref: setElement,\n });\n\n return useTransitionBoundary(\"Popover.Popup\", isLibrary ? transition : undefined, element);\n}\n\nPopoverPopup.displayName = \"PopoverPopup\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyGA,SAAgB,aAAa,EAC3B,OAAO,UACP,QAAQ,UACR,aACA,cACA,YACA,WACA,OACA,UACA,QACA,GAAG,QACiB;CACpB,MAAM,MAAM,kBAAkB,eAAe;CAC7C,MAAM,YAAY,IAAI,SAAS;CAC/B,MAAM,EAAE,QAAQ;CAEhB,cACE,CAAC,aAAa,eAAe,KAAA,GAC7B,4KAEF;CACA,cACE,CAAC,aAAa,gBAAgB,OAC9B,6IAEF;CAEA,MAAM,EAAE,YAAY,SAAS,gBAAgB,gBAAgB,KAAK;EAChE,MAAM;EACN;EACA;EACA,YAAY,YAAY,aAAa,KAAA;CACvC,CAAC;CAED,MAAM,QAA2B;EAAE,MAAM,IAAI;EAAW;EAAM;CAAM;CAEpE,MAAM,WAAW,MAAoC;EACnD,IAAI;EACJ,IAAI,CAAC,WACH,OAAO,kBAAkB,UAAU,CAAC;OAC/B,IAAI,gBAAgB,MAGzB,OACE,oBAAC,UAAD;GAAU,MAAM,UAAU,YAAY;GACnC,UAAA,YAAY,kBAAkB,UAAU,CAAC,CAAC;EACnC,CAAA;OAGZ,OAAO,UAAU,YAAY,kBAAkB,UAAU,CAAC,CAAC,IAAI;EAEjE,OAAO,oBAAC,qBAAD;GAAqB,OAAO;GAAI,UAAA;EAA0B,CAAA;CACnE;CAEA,MAAM,eAAiE;EACrE,IAAI,IAAI;EACR,SAAS;EAGT,MAAM,KAAA;EAEN,cAAc;EACd,mBAAmB,IAAI;EACvB,oBAAoB,IAAI;EAExB,GAAI,SAAS,QAAQ;GAAE,aAAa;GAAM,cAAc;EAAM;CAChE;CAEA,MAAM,UAAU,UAA8D;EAC5E,gBAAgB;EAChB;EACA;EACA;EAEA,OACE,SAAS,OACL,SACC,OAAO;GACN,cAAc,aAAa,MAAM,KAAK;GACtC,sBAAsB;GACtB,GAAG,kBAAkB,OAAO,CAAC;EAC/B;EACN,UAAU;EAGV,OAAO;GAAE,MAAM;GAAU,GAAG;EAAK;EACjC;EACA,KAAK;CACP,CAAC;CAED,OAAO,sBAAsB,iBAAiB,YAAY,aAAa,KAAA,GAAW,OAAO;AAC3F;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"popover-popup.mjs","names":[],"sources":["../../src/popover/popover-popup.tsx"],"sourcesContent":["\"use client\";\nimport type {\n ComponentPropsWithRef,\n CSSProperties,\n ReactNode,\n RefObject,\n ViewTransitionClass,\n} from \"react\";\nimport type { AnchorAlign, AnchorSide } from \"../internal/overlay/anchor-position.js\";\nimport { useTransitionBoundary } from \"../internal/transition-boundary.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useJsFreePropWarnings } from \"../internal/overlay/overlay-popup.js\";\nimport { useMergedRefs } from \"../internal/use-merged-refs.js\";\nimport { usePopoverPopup } from \"../internal/overlay/use-popover-popup.js\";\nimport { useAnchoredPlacement } from \"../internal/overlay/use-resolved-placement.js\";\nimport { resolveStateValue, useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { PopoverPopupContext, usePopoverContext } from \"./popover-context.js\";\n\n/** `inline-start` / `inline-end` follow the popup's `direction` (conventions 13.1). */\nexport type PopoverSide = AnchorSide;\n/**\n * Alignment of the Popup along its side: inline-relative on a top / bottom side, the top / bottom\n * edges on the others.\n */\nexport type PopoverAlign = AnchorAlign;\n\n/**\n * State of `Popover.Popup`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface PopoverPopupState {\n /**\n * Committed open state (library mode); `false` in JS-free mode. Read `:popover-open` for the\n * DOM truth.\n */\n readonly open: boolean;\n /**\n * While shown: the physical side the browser placed the popup on (after any fallback flip;\n * conventions 13.2). Otherwise the `side` prop. `null` with `side={null}`.\n */\n readonly side: PopoverSide | null;\n /** While shown: the resolved alignment; otherwise the `align` prop. */\n readonly align: PopoverAlign;\n}\n\n/**\n * Props of `Popover.Popup`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport interface PopoverPopupProps extends Omit<\n ComponentPropsWithRef<\"dialog\">,\n | \"id\"\n | \"popover\"\n | \"open\"\n | \"aria-modal\"\n | \"onToggle\"\n | \"onBeforeToggle\"\n | \"className\"\n | \"style\"\n | \"children\"\n> {\n /**\n * Placement relative to the Trigger through inline `position-area`, with\n * `position-try-fallbacks` flipping it when it does not fit.\n * `\"inline-start\"` / `\"inline-end\"` follow the popup's direction. `null` emits no inline\n * positioning (and no `data-side` / `data-align`), so a stylesheet owns placement.\n *\n * @defaultValue `\"bottom\"`\n */\n side?: PopoverSide | null;\n /**\n * Alignment along the side. On a top / bottom side `start` / `end` are\n * inline-relative (mirrored under `direction: rtl`); on the other sides the top / bottom\n * edges. Ignored when `side` is `null`.\n *\n * @defaultValue `\"center\"`\n */\n align?: PopoverAlign;\n /**\n * Library mode: what happens to the children while the popover is closed.\n * - `false` (default): not rendered. Mounting them is part of the opening transition, so\n * content that suspends holds the open until it is ready. Unmount waits for the popover's\n * exit animation (CSS), or happens in the close commit when `transition` is set.\n * - `true`: rendered inside `<Activity mode=\"hidden\">`: DOM and state preserved, effects\n * stopped, pre-rendered at low priority. Not in the server HTML.\n *\n * Ignored in JS-free mode (always mounted).\n *\n * @defaultValue `false`\n */\n keepMounted?: boolean;\n /**\n * Element to focus when the popover opens: a ref, or a selector resolved inside the popup.\n * The library writes `autofocus` on it right before `showPopover()` and the platform focuses\n * it.\n *\n * In JS-free mode the browser opens the popover itself, so the attribute is written after\n * hydration and kept while mounted; before hydration only `autoFocus` in the markup works.\n *\n * @defaultValue the platform's choice for a `<dialog>` (first focusable descendant; the popup\n * itself if none); for `render={<div />}` focus stays on the Trigger\n */\n initialFocus?: RefObject<HTMLElement | null> | string;\n /**\n * Library mode only. Forwarded to the `<ViewTransition default>` around the popover element\n * itself. Animates the opening commit, content changes while open, and every library-driven\n * close (Trigger, Close, controlled `open={false}`), in all engines; dismissals (Escape,\n * click outside) are the browser's and animate with CSS only. Ignored (dev warning) in JS-free\n * mode. While a view transition runs, the popup's CSS transitions are turned off for the moment\n * of the library's own show or hide (an inline `transition: none !important`, restored right\n * after), so that show or hide runs no CSS transition (a `@keyframes` animation is not cut).\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 * A plain open starts none: the children mount under the already-mounted popover element.\n */\n transition?: ViewTransitionClass;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, PopoverPopupState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, PopoverPopupState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, PopoverPopupState>;\n /** A `<dialog>` (default) or a `<div>` (focus stays on the Trigger). */\n render?: RenderProp<ComponentPropsWithRef<\"dialog\">, PopoverPopupState>;\n}\n\n/**\n * The popover itself: a `<dialog popover=\"auto\" aria-modal=\"false\" role=\"dialog\">` with the id\n * the Trigger's `popovertarget` names, placed against the Trigger with CSS Anchor Positioning and\n * wired to Title and Description through `aria-labelledby` / `aria-describedby`. Style it with\n * `:popover-open`; it emits `data-side` / `data-align` but no `data-open`. While shown, those are\n * where the browser placed it (the applied `position-try-fallbacks` option; conventions 13.2),\n * in both modes; otherwise the requested values.\n *\n * In library mode the children render from committed state, so content that suspends keeps the\n * popover closed (and the Trigger pending) until it is ready; `showPopover({ source: trigger })`\n * runs in the layout effect of the commit that mounted them, and a library-driven close runs\n * `hidePopover()` in the commit that ends it. Dismissals are the browser's facts: the native\n * `toggle` event makes committed state `false` urgently and calls `onOpenChange(false, { reason:\n * \"dismiss\" })`; no view transition runs for them.\n *\n * Owned keys (conventions 1.2): `id`, `popover`, `open`, `aria-modal`, `aria-labelledby` and\n * `aria-describedby` (token-merged), and `data-side` / `data-align` unless `side` is `null`.\n * `role` is a default (`\"dialog\"`) the consumer may override.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport function PopoverPopup({\n side: sideProp = \"bottom\",\n align: alignProp = \"center\",\n keepMounted,\n initialFocus,\n transition,\n className,\n style,\n children,\n render,\n ...rest\n}: PopoverPopupProps) {\n const ctx = usePopoverContext(\"Popover.Popup\");\n const isLibrary = ctx.mode === \"library\";\n const { ids } = ctx;\n\n useJsFreePropWarnings(\"Popover.Popup\", \"popover\", isLibrary, transition, keepMounted);\n\n const { setElement, renderContent } = usePopoverPopup(ctx, {\n part: \"Popover.Popup\",\n initialFocus,\n keepMounted,\n transition: isLibrary ? transition : undefined,\n });\n\n // Resolved while shown, in library and JS-free mode alike (it hangs off the element's ref and\n // the platform's `toggle`, not off library state).\n const placement = useAnchoredPlacement({ side: sideProp, align: alignProp });\n const { side, align } = placement;\n const ref = useMergedRefs(setElement, placement.ref);\n\n const state: PopoverPopupState = { open: ctx.committed, side, align };\n\n const content = (s: PopoverPopupState): ReactNode => (\n <PopoverPopupContext value={s}>\n {renderContent(() => resolveStateValue(children, s))}\n </PopoverPopupContext>\n );\n\n const libraryProps: ComponentPropsWithRef<\"dialog\"> & DataAttributes = {\n id: ids.popup,\n popover: \"auto\",\n // Never rendered: `showPopover()` does not set it, and an `open` attribute would show the\n // <dialog> outside the top layer. Owned so a `render` element cannot add it.\n open: undefined,\n // Chromium exposes a <dialog popover> as modal without it (design, Decisions 4).\n \"aria-modal\": \"false\",\n \"aria-labelledby\": ids.title,\n \"aria-describedby\": ids.description,\n // Not owned with `side={null}`: the stylesheet (or a render element) may set them.\n ...placement.dataAttributes,\n };\n\n const element = useRender<ComponentPropsWithRef<\"dialog\">, PopoverPopupState>({\n defaultElement: \"dialog\",\n render,\n state,\n className,\n // The consumer's style wins over the inline placement (design 8).\n style: placement.style(style),\n children: content,\n // `role` is a default the consumer's `rest` overrides (design 3.3): WebKit implements no\n // minimum role for `[popover]`, and a `<div>` popup needs it.\n props: { role: \"dialog\", ...rest },\n libraryProps,\n ref,\n });\n\n return useTransitionBoundary(\"Popover.Popup\", isLibrary ? transition : undefined, element);\n}\n\nPopoverPopup.displayName = \"PopoverPopup\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuJA,SAAgB,aAAa,EAC3B,MAAM,WAAW,UACjB,OAAO,YAAY,UACnB,aACA,cACA,YACA,WACA,OACA,UACA,QACA,GAAG,QACiB;CACpB,MAAM,MAAM,kBAAkB,eAAe;CAC7C,MAAM,YAAY,IAAI,SAAS;CAC/B,MAAM,EAAE,QAAQ;CAEhB,sBAAsB,iBAAiB,WAAW,WAAW,YAAY,WAAW;CAEpF,MAAM,EAAE,YAAY,kBAAkB,gBAAgB,KAAK;EACzD,MAAM;EACN;EACA;EACA,YAAY,YAAY,aAAa,KAAA;CACvC,CAAC;CAID,MAAM,YAAY,qBAAqB;EAAE,MAAM;EAAU,OAAO;CAAU,CAAC;CAC3E,MAAM,EAAE,MAAM,UAAU;CACxB,MAAM,MAAM,cAAc,YAAY,UAAU,GAAG;CAEnD,MAAM,QAA2B;EAAE,MAAM,IAAI;EAAW;EAAM;CAAM;CAEpE,MAAM,WAAW,MACf,oBAAC,qBAAD;EAAqB,OAAO;EACzB,UAAA,oBAAoB,kBAAkB,UAAU,CAAC,CAAC;CAChC,CAAA;CAGvB,MAAM,eAAiE;EACrE,IAAI,IAAI;EACR,SAAS;EAGT,MAAM,KAAA;EAEN,cAAc;EACd,mBAAmB,IAAI;EACvB,oBAAoB,IAAI;EAExB,GAAG,UAAU;CACf;CAEA,MAAM,UAAU,UAA8D;EAC5E,gBAAgB;EAChB;EACA;EACA;EAEA,OAAO,UAAU,MAAM,KAAK;EAC5B,UAAU;EAGV,OAAO;GAAE,MAAM;GAAU,GAAG;EAAK;EACjC;EACA;CACF,CAAC;CAED,OAAO,sBAAsB,iBAAiB,YAAY,aAAa,KAAA,GAAW,OAAO;AAC3F;AAEA,aAAa,cAAc"}
@@ -1,7 +1,7 @@
1
- import { ActionDetails, ChangeAction, ChangeReason, StateValue } from "../internal/types.mjs";
1
+ import { ActionDetails, ChangeAction, ChangeReason, StateValue, UrgentChangeHandler } from "../internal/types.mjs";
2
2
  import { ReactNode } from "react";
3
3
  //#region src/popover/popover-root.d.ts
4
- /** Details passed as the second argument of `openChangeAction`. */
4
+ /** Details passed as the second argument of `openChangeAction` and `onOpenChange`. */
5
5
  export interface PopoverOpenChangeDetails extends ActionDetails {
6
6
  /**
7
7
  * `"activate"`: the user acted on a part: Trigger (open or close), Close, or a foreign invoker
@@ -13,16 +13,23 @@ export interface PopoverOpenChangeDetails extends ActionDetails {
13
13
  */
14
14
  readonly reason: ChangeReason;
15
15
  }
16
+ /** State of `Popover.Root`, passed to the function forms of `children`. */
16
17
  export interface PopoverRootState {
17
18
  /** Optimistic open state (`false` in JS-free mode). Content rendered from it must not suspend. */
18
19
  readonly open: boolean;
19
20
  /** An `openChangeAction` dispatched through this Popover is in flight (library mode only). */
20
21
  readonly pending: boolean;
21
22
  }
23
+ /**
24
+ * Props of `Popover.Root`.
25
+ *
26
+ * @see https://ui.funstack.work/components/popover
27
+ */
22
28
  export interface PopoverRootProps {
23
29
  /**
24
- * Controlled open state. `undefined` means uncontrolled (and, with `defaultOpen` and
25
- * `openChangeAction` also absent, JS-free mode).
30
+ * Controlled open state. `undefined` means uncontrolled (and, with `defaultOpen`,
31
+ * `openChangeAction` and `onOpenChange` also absent, JS-free mode). A controlled Root needs
32
+ * `onOpenChange` too: the browser closes the popover without asking (development warns).
26
33
  */
27
34
  open?: boolean;
28
35
  /**
@@ -31,32 +38,47 @@ export interface PopoverRootProps {
31
38
  */
32
39
  defaultOpen?: boolean;
33
40
  /**
34
- * Awaited for `true` (the popover opens when it resolves and the content has rendered) and for
35
- * a `false` the user asked a part for (Trigger, Close: the popover hides when it resolves, with
36
- * a view transition if `transition` is set; a controlled parent that keeps `open` vetoes it).
37
- * A notification for a dismissal (Escape, click outside: the popover is already hidden; the
38
- * action runs inside the Root's transition, and a controlled parent that keeps `open` gets it
39
- * re-opened, which is not a veto). May be a Server Function. Rejections reach the nearest
40
- * Error Boundary above Root.
41
+ * Requests only. Awaited for `true` (the popover opens when it resolves and the content has
42
+ * rendered) and for a `false` the user asked a part for (Trigger, Close: the popover hides
43
+ * when it resolves, with a view transition if `transition` is set; a controlled parent that
44
+ * keeps `open` vetoes it). Never called for a dismissal: that goes to `onOpenChange`. May be a
45
+ * Server Function. Rejections reach the nearest Error Boundary above Root.
41
46
  *
42
47
  * A `setState` placed after your own `await` is not a Transition update; wrap it in
43
48
  * `startTransition` (React limitation).
44
49
  */
45
50
  openChangeAction?: ChangeAction<boolean, PopoverOpenChangeDetails>;
51
+ /**
52
+ * Facts only: the popover was closed without the library closing it (Escape, a click outside,
53
+ * Android back, another top-layer element, script `hidePopover()`, a foreign invoker button,
54
+ * lost interest). Always `false`. Called synchronously in the platform's `toggle` event,
55
+ * outside any Transition, and not awaited: nothing is pending and no view transition runs; the
56
+ * popover is already hidden and its committed state is already `false` (uncontrolled).
57
+ *
58
+ * Controlled: set your state **directly** here (`onOpenChange={setOpen}`), not in
59
+ * `startTransition` and not after an `await`; a parent that keeps `open={true}` gets the
60
+ * popover re-opened at once. May return a promise (a Server Function); a rejection or a throw
61
+ * goes to `reportError`.
62
+ */
63
+ onOpenChange?: UrgentChangeHandler<boolean, PopoverOpenChangeDetails>;
64
+ /** The parts. The function form receives the optimistic state and must not suspend. */
46
65
  children?: StateValue<ReactNode, PopoverRootState>;
47
66
  }
48
67
  /**
49
68
  * Owns the ids, the mode, the open state and the context. Renders no DOM, so it has no `ref`,
50
69
  * `className` or `style`; `pending` is exposed through `children(state)` and the Trigger.
51
70
  *
52
- * Without `open`, `defaultOpen` and `openChangeAction` the Popover runs in **JS-free mode**: the
53
- * Trigger is a native `command="toggle-popover"` invoker and the browser owns everything. With any
54
- * of them it runs in **library mode**: opening and the closes the user asks a part for are
55
- * transitions (the Trigger shows `data-pending`, content renders from committed state,
56
- * `showPopover()` / `hidePopover()` run when the change has committed); dismissals are the
57
- * browser's and `openChangeAction(false)` is a notification.
71
+ * Without `open`, `defaultOpen`, `openChangeAction` and `onOpenChange` the Popover runs in
72
+ * **JS-free mode**: the Trigger is a native `popovertarget` invoker and the browser owns
73
+ * everything. With any of them it runs in **library mode**: opening and the closes the user asks
74
+ * a part for are requests, transitions through `openChangeAction` (the Trigger shows
75
+ * `data-pending`, content renders from committed state, `showPopover()` / `hidePopover()` run
76
+ * when the change has committed); dismissals are the browser's facts, reported to
77
+ * `onOpenChange`.
78
+ *
79
+ * @see https://ui.funstack.work/components/popover
58
80
  */
59
- export declare function PopoverRoot({ open, defaultOpen, openChangeAction, children }: PopoverRootProps): import("react").JSX.Element;
81
+ export declare function PopoverRoot({ open, defaultOpen, openChangeAction, onOpenChange, children }: PopoverRootProps): import("react").JSX.Element;
60
82
  export declare namespace PopoverRoot {
61
83
  var displayName: string;
62
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"popover-root.d.mts","names":[],"sources":["../../src/popover/popover-root.tsx"],"mappings":";;;;iBAQiB,iCAAiC;;;;;;;;;WASvC,QAAQ;;iBAGF;;WAEN;;WAEA;;iBAGM;;;;;EAKf;;;;;EAKA;;;;;;;;;;;;;EAaA,mBAAmB,sBAAsB;EACzC,WAAW,WAAW,WAAW;;;;;;;;;;;;;wBAcnB,cAAc,MAAM,aAAa,kBAAkB,YAAY,mCAAgB,IAAA;yBAA/E"}
1
+ {"version":3,"file":"popover-root.d.mts","names":[],"sources":["../../src/popover/popover-root.tsx"],"mappings":";;;;iBAciB,iCAAiC;;;;;;;;;WASvC,QAAQ;;;iBAIF;;WAEN;;WAEA;;;;;;;iBAQM;;;;;;EAMf;;;;;EAKA;;;;;;;;;;;EAWA,mBAAmB,sBAAsB;;;;;;;;;;;;;EAazC,eAAe,6BAA6B;;EAE5C,WAAW,WAAW,WAAW;;;;;;;;;;;;;;;;wBAiBnB,cACd,MACA,aACA,kBACA,cACA,YACC,mCAAgB,IAAA;yBANH"}
@@ -1,27 +1,32 @@
1
1
  "use client";
2
- import { resolveStateValue } from "../internal/use-render.mjs";
2
+ import { resolveStateValue } from "../internal/render-element.mjs";
3
+ import { popoverDetails, usePopoverRoot } from "../internal/overlay/use-overlay-root.mjs";
3
4
  import { PopoverContext } from "./popover-context.mjs";
4
- import { usePopoverRoot } from "../internal/use-popover-root.mjs";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region src/popover/popover-root.tsx
7
7
  /**
8
8
  * Owns the ids, the mode, the open state and the context. Renders no DOM, so it has no `ref`,
9
9
  * `className` or `style`; `pending` is exposed through `children(state)` and the Trigger.
10
10
  *
11
- * Without `open`, `defaultOpen` and `openChangeAction` the Popover runs in **JS-free mode**: the
12
- * Trigger is a native `command="toggle-popover"` invoker and the browser owns everything. With any
13
- * of them it runs in **library mode**: opening and the closes the user asks a part for are
14
- * transitions (the Trigger shows `data-pending`, content renders from committed state,
15
- * `showPopover()` / `hidePopover()` run when the change has committed); dismissals are the
16
- * browser's and `openChangeAction(false)` is a notification.
11
+ * Without `open`, `defaultOpen`, `openChangeAction` and `onOpenChange` the Popover runs in
12
+ * **JS-free mode**: the Trigger is a native `popovertarget` invoker and the browser owns
13
+ * everything. With any of them it runs in **library mode**: opening and the closes the user asks
14
+ * a part for are requests, transitions through `openChangeAction` (the Trigger shows
15
+ * `data-pending`, content renders from committed state, `showPopover()` / `hidePopover()` run
16
+ * when the change has committed); dismissals are the browser's facts, reported to
17
+ * `onOpenChange`.
18
+ *
19
+ * @see https://ui.funstack.work/components/popover
17
20
  */
18
- function PopoverRoot({ open, defaultOpen, openChangeAction, children }) {
21
+ function PopoverRoot({ open, defaultOpen, openChangeAction, onOpenChange, children }) {
19
22
  const context = usePopoverRoot({
20
23
  component: "popover",
21
24
  part: "Popover.Root",
22
25
  open,
23
26
  defaultOpen,
24
- openChangeAction
27
+ openChangeAction,
28
+ onOpenChange,
29
+ details: popoverDetails
25
30
  });
26
31
  const state = {
27
32
  open: context.optimistic,
@@ -1 +1 @@
1
- {"version":3,"file":"popover-root.mjs","names":[],"sources":["../../src/popover/popover-root.tsx"],"sourcesContent":["\"use client\";\nimport type { ReactNode } from \"react\";\nimport type { ActionDetails, ChangeAction, ChangeReason, StateValue } from \"../internal/types.js\";\nimport { usePopoverRoot } from \"../internal/use-popover-root.js\";\nimport { resolveStateValue } from \"../internal/use-render.js\";\nimport { PopoverContext } from \"./popover-context.js\";\n\n/** Details passed as the second argument of `openChangeAction`. */\nexport interface PopoverOpenChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user acted on a part: Trigger (open or close), Close, or a foreign invoker\n * (`details.event` is a `CommandEvent` / `ToggleEvent` then).\n * `\"dismiss\"`: the user closed the popover without a part: Escape, Android back, an assistive-\n * technology dismiss gesture, a click outside; or script / another top-layer element hid it.\n * `\"platform\"`: the popover was found open on mount (opened before hydration); `event` is\n * `undefined`.\n */\n readonly reason: ChangeReason;\n}\n\nexport interface PopoverRootState {\n /** Optimistic open state (`false` in JS-free mode). Content rendered from it must not suspend. */\n readonly open: boolean;\n /** An `openChangeAction` dispatched through this Popover is in flight (library mode only). */\n readonly pending: boolean;\n}\n\nexport interface PopoverRootProps {\n /**\n * Controlled open state. `undefined` means uncontrolled (and, with `defaultOpen` and\n * `openChangeAction` also absent, JS-free mode).\n */\n open?: boolean;\n /**\n * Initial open state in uncontrolled library mode. Opens after hydration, never in the server\n * HTML.\n */\n defaultOpen?: boolean;\n /**\n * Awaited for `true` (the popover opens when it resolves and the content has rendered) and for\n * a `false` the user asked a part for (Trigger, Close: the popover hides when it resolves, with\n * a view transition if `transition` is set; a controlled parent that keeps `open` vetoes it).\n * A notification for a dismissal (Escape, click outside: the popover is already hidden; the\n * action runs inside the Root's transition, and a controlled parent that keeps `open` gets it\n * re-opened, which is not a veto). May be a Server Function. Rejections reach the nearest\n * Error Boundary above Root.\n *\n * A `setState` placed after your own `await` is not a Transition update; wrap it in\n * `startTransition` (React limitation).\n */\n openChangeAction?: ChangeAction<boolean, PopoverOpenChangeDetails>;\n children?: StateValue<ReactNode, PopoverRootState>;\n}\n\n/**\n * Owns the ids, the mode, the open state and the context. Renders no DOM, so it has no `ref`,\n * `className` or `style`; `pending` is exposed through `children(state)` and the Trigger.\n *\n * Without `open`, `defaultOpen` and `openChangeAction` the Popover runs in **JS-free mode**: the\n * Trigger is a native `command=\"toggle-popover\"` invoker and the browser owns everything. With any\n * of them it runs in **library mode**: opening and the closes the user asks a part for are\n * transitions (the Trigger shows `data-pending`, content renders from committed state,\n * `showPopover()` / `hidePopover()` run when the change has committed); dismissals are the\n * browser's and `openChangeAction(false)` is a notification.\n */\nexport function PopoverRoot({ open, defaultOpen, openChangeAction, children }: PopoverRootProps) {\n const context = usePopoverRoot<PopoverOpenChangeDetails>({\n component: \"popover\",\n part: \"Popover.Root\",\n open,\n defaultOpen,\n openChangeAction,\n });\n\n const state: PopoverRootState = { open: context.optimistic, pending: context.pending };\n\n return <PopoverContext value={context}>{resolveStateValue(children, state)}</PopoverContext>;\n}\n\nPopoverRoot.displayName = \"PopoverRoot\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAiEA,SAAgB,YAAY,EAAE,MAAM,aAAa,kBAAkB,YAA8B;CAC/F,MAAM,UAAU,eAAyC;EACvD,WAAW;EACX,MAAM;EACN;EACA;EACA;CACF,CAAC;CAED,MAAM,QAA0B;EAAE,MAAM,QAAQ;EAAY,SAAS,QAAQ;CAAQ;CAErF,OAAO,oBAAC,gBAAD;EAAgB,OAAO;EAAU,UAAA,kBAAkB,UAAU,KAAK;CAAkB,CAAA;AAC7F;AAEA,YAAY,cAAc"}
1
+ {"version":3,"file":"popover-root.mjs","names":[],"sources":["../../src/popover/popover-root.tsx"],"sourcesContent":["\"use client\";\nimport type { ReactNode } from \"react\";\nimport type {\n ActionDetails,\n ChangeAction,\n ChangeReason,\n StateValue,\n UrgentChangeHandler,\n} from \"../internal/types.js\";\nimport { popoverDetails, usePopoverRoot } from \"../internal/overlay/use-overlay-root.js\";\nimport { resolveStateValue } from \"../internal/use-render.js\";\nimport { PopoverContext } from \"./popover-context.js\";\n\n/** Details passed as the second argument of `openChangeAction` and `onOpenChange`. */\nexport interface PopoverOpenChangeDetails extends ActionDetails {\n /**\n * `\"activate\"`: the user acted on a part: Trigger (open or close), Close, or a foreign invoker\n * (`details.event` is a `CommandEvent` / `ToggleEvent` then).\n * `\"dismiss\"`: the user closed the popover without a part: Escape, Android back, an assistive-\n * technology dismiss gesture, a click outside; or script / another top-layer element hid it.\n * `\"platform\"`: the popover was found open on mount (opened before hydration); `event` is\n * `undefined`.\n */\n readonly reason: ChangeReason;\n}\n\n/** State of `Popover.Root`, passed to the function forms of `children`. */\nexport interface PopoverRootState {\n /** Optimistic open state (`false` in JS-free mode). Content rendered from it must not suspend. */\n readonly open: boolean;\n /** An `openChangeAction` dispatched through this Popover is in flight (library mode only). */\n readonly pending: boolean;\n}\n\n/**\n * Props of `Popover.Root`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport interface PopoverRootProps {\n /**\n * Controlled open state. `undefined` means uncontrolled (and, with `defaultOpen`,\n * `openChangeAction` and `onOpenChange` also absent, JS-free mode). A controlled Root needs\n * `onOpenChange` too: the browser closes the popover without asking (development warns).\n */\n open?: boolean;\n /**\n * Initial open state in uncontrolled library mode. Opens after hydration, never in the server\n * HTML.\n */\n defaultOpen?: boolean;\n /**\n * Requests only. Awaited for `true` (the popover opens when it resolves and the content has\n * rendered) and for a `false` the user asked a part for (Trigger, Close: the popover hides\n * when it resolves, with a view transition if `transition` is set; a controlled parent that\n * keeps `open` vetoes it). Never called for a dismissal: that goes to `onOpenChange`. May be a\n * Server Function. Rejections reach the nearest Error Boundary above Root.\n *\n * A `setState` placed after your own `await` is not a Transition update; wrap it in\n * `startTransition` (React limitation).\n */\n openChangeAction?: ChangeAction<boolean, PopoverOpenChangeDetails>;\n /**\n * Facts only: the popover was closed without the library closing it (Escape, a click outside,\n * Android back, another top-layer element, script `hidePopover()`, a foreign invoker button,\n * lost interest). Always `false`. Called synchronously in the platform's `toggle` event,\n * outside any Transition, and not awaited: nothing is pending and no view transition runs; the\n * popover is already hidden and its committed state is already `false` (uncontrolled).\n *\n * Controlled: set your state **directly** here (`onOpenChange={setOpen}`), not in\n * `startTransition` and not after an `await`; a parent that keeps `open={true}` gets the\n * popover re-opened at once. May return a promise (a Server Function); a rejection or a throw\n * goes to `reportError`.\n */\n onOpenChange?: UrgentChangeHandler<boolean, PopoverOpenChangeDetails>;\n /** The parts. The function form receives the optimistic state and must not suspend. */\n children?: StateValue<ReactNode, PopoverRootState>;\n}\n\n/**\n * Owns the ids, the mode, the open state and the context. Renders no DOM, so it has no `ref`,\n * `className` or `style`; `pending` is exposed through `children(state)` and the Trigger.\n *\n * Without `open`, `defaultOpen`, `openChangeAction` and `onOpenChange` the Popover runs in\n * **JS-free mode**: the Trigger is a native `popovertarget` invoker and the browser owns\n * everything. With any of them it runs in **library mode**: opening and the closes the user asks\n * a part for are requests, transitions through `openChangeAction` (the Trigger shows\n * `data-pending`, content renders from committed state, `showPopover()` / `hidePopover()` run\n * when the change has committed); dismissals are the browser's facts, reported to\n * `onOpenChange`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport function PopoverRoot({\n open,\n defaultOpen,\n openChangeAction,\n onOpenChange,\n children,\n}: PopoverRootProps) {\n const context = usePopoverRoot<PopoverOpenChangeDetails>({\n component: \"popover\",\n part: \"Popover.Root\",\n open,\n defaultOpen,\n openChangeAction,\n onOpenChange,\n details: popoverDetails,\n });\n\n const state: PopoverRootState = { open: context.optimistic, pending: context.pending };\n\n return <PopoverContext value={context}>{resolveStateValue(children, state)}</PopoverContext>;\n}\n\nPopoverRoot.displayName = \"PopoverRoot\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6FA,SAAgB,YAAY,EAC1B,MACA,aACA,kBACA,cACA,YACmB;CACnB,MAAM,UAAU,eAAyC;EACvD,WAAW;EACX,MAAM;EACN;EACA;EACA;EACA;EACA,SAAS;CACX,CAAC;CAED,MAAM,QAA0B;EAAE,MAAM,QAAQ;EAAY,SAAS,QAAQ;CAAQ;CAErF,OAAO,oBAAC,gBAAD;EAAgB,OAAO;EAAU,UAAA,kBAAkB,UAAU,KAAK;CAAkB,CAAA;AAC7F;AAEA,YAAY,cAAc"}
@@ -2,10 +2,19 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { PopoverPopupState } from "./popover-popup.mjs";
3
3
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
4
4
  //#region src/popover/popover-title.d.ts
5
+ /** State of `Popover.Title`: the Popup's state. */
5
6
  export type PopoverTitleState = PopoverPopupState;
7
+ /**
8
+ * Props of `Popover.Title`.
9
+ *
10
+ * @see https://ui.funstack.work/components/popover
11
+ */
6
12
  export interface PopoverTitleProps extends Omit<ComponentPropsWithRef<"h2">, "id" | "className" | "style" | "children"> {
13
+ /** Class name, or a function of the part's state that returns one. */
7
14
  className?: StateValue<string | undefined, PopoverTitleState>;
15
+ /** Inline style, or a function of the part's state that returns one. */
8
16
  style?: StateValue<CSSProperties | undefined, PopoverTitleState>;
17
+ /** Content, or a function of the part's state. */
9
18
  children?: StateValue<ReactNode, PopoverTitleState>;
10
19
  /** `render={<h3 />}` changes the heading level. */
11
20
  render?: RenderProp<ComponentPropsWithRef<"h2">, PopoverTitleState>;
@@ -14,6 +23,8 @@ export interface PopoverTitleProps extends Omit<ComponentPropsWithRef<"h2">, "id
14
23
  * The popover's name: an `<h2>` whose id the Popup references with `aria-labelledby`.
15
24
  *
16
25
  * Owned key (conventions 1.2): `id`.
26
+ *
27
+ * @see https://ui.funstack.work/components/popover
17
28
  */
18
29
  export declare function PopoverTitle({ className, style, children, render, ...rest }: PopoverTitleProps): ReactNode;
19
30
  export declare namespace PopoverTitle {
@@ -1 +1 @@
1
- {"version":3,"file":"popover-title.d.mts","names":[],"sources":["../../src/popover/popover-title.tsx"],"mappings":";;;;YAOY,oBAAoB;iBAEf,0BAA0B,KACzC;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;EAC9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,6BAA6B;;;;;;;wBAQnC,eAAe,WAAW,OAAO,UAAU,WAAW,QAAQ,oBAAiB;yBAA/E"}
1
+ {"version":3,"file":"popover-title.d.mts","names":[],"sources":["../../src/popover/popover-title.tsx"],"mappings":";;;;;YAQY,oBAAoB;;;;;;iBAOf,0BAA0B,KACzC;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,6BAA6B;;;;;;;;;wBAUnC,eAAe,WAAW,OAAO,UAAU,WAAW,QAAQ,oBAAiB;yBAA/E"}
@@ -6,6 +6,8 @@ import { usePopoverContext, usePopoverPopupState } from "./popover-context.mjs";
6
6
  * The popover's name: an `<h2>` whose id the Popup references with `aria-labelledby`.
7
7
  *
8
8
  * Owned key (conventions 1.2): `id`.
9
+ *
10
+ * @see https://ui.funstack.work/components/popover
9
11
  */
10
12
  function PopoverTitle({ className, style, children, render, ...rest }) {
11
13
  const ctx = usePopoverContext("Popover.Title");
@@ -1 +1 @@
1
- {"version":3,"file":"popover-title.mjs","names":[],"sources":["../../src/popover/popover-title.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 { usePopoverContext, usePopoverPopupState } from \"./popover-context.js\";\nimport type { PopoverPopupState } from \"./popover-popup.js\";\n\nexport type PopoverTitleState = PopoverPopupState;\n\nexport interface PopoverTitleProps extends Omit<\n ComponentPropsWithRef<\"h2\">,\n \"id\" | \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, PopoverTitleState>;\n style?: StateValue<CSSProperties | undefined, PopoverTitleState>;\n children?: StateValue<ReactNode, PopoverTitleState>;\n /** `render={<h3 />}` changes the heading level. */\n render?: RenderProp<ComponentPropsWithRef<\"h2\">, PopoverTitleState>;\n}\n\n/**\n * The popover's name: an `<h2>` whose id the Popup references with `aria-labelledby`.\n *\n * Owned key (conventions 1.2): `id`.\n */\nexport function PopoverTitle({ className, style, children, render, ...rest }: PopoverTitleProps) {\n const ctx = usePopoverContext(\"Popover.Title\");\n const state = usePopoverPopupState(ctx);\n return useRender<ComponentPropsWithRef<\"h2\">, PopoverTitleState>({\n defaultElement: \"h2\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: { id: ctx.ids.title },\n });\n}\n\nPopoverTitle.displayName = \"PopoverTitle\";\n"],"mappings":";;;;;;;;;AAyBA,SAAgB,aAAa,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA2B;CAC/F,MAAM,MAAM,kBAAkB,eAAe;CAC7C,MAAM,QAAQ,qBAAqB,GAAG;CACtC,OAAO,UAA0D;EAC/D,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc,EAAE,IAAI,IAAI,IAAI,MAAM;CACpC,CAAC;AACH;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"popover-title.mjs","names":[],"sources":["../../src/popover/popover-title.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 { usePopoverContext, usePopoverPopupState } from \"./popover-context.js\";\nimport type { PopoverPopupState } from \"./popover-popup.js\";\n\n/** State of `Popover.Title`: the Popup's state. */\nexport type PopoverTitleState = PopoverPopupState;\n\n/**\n * Props of `Popover.Title`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport interface PopoverTitleProps extends Omit<\n ComponentPropsWithRef<\"h2\">,\n \"id\" | \"className\" | \"style\" | \"children\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, PopoverTitleState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, PopoverTitleState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, PopoverTitleState>;\n /** `render={<h3 />}` changes the heading level. */\n render?: RenderProp<ComponentPropsWithRef<\"h2\">, PopoverTitleState>;\n}\n\n/**\n * The popover's name: an `<h2>` whose id the Popup references with `aria-labelledby`.\n *\n * Owned key (conventions 1.2): `id`.\n *\n * @see https://ui.funstack.work/components/popover\n */\nexport function PopoverTitle({ className, style, children, render, ...rest }: PopoverTitleProps) {\n const ctx = usePopoverContext(\"Popover.Title\");\n const state = usePopoverPopupState(ctx);\n return useRender<ComponentPropsWithRef<\"h2\">, PopoverTitleState>({\n defaultElement: \"h2\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps: { id: ctx.ids.title },\n });\n}\n\nPopoverTitle.displayName = \"PopoverTitle\";\n"],"mappings":";;;;;;;;;;;AAoCA,SAAgB,aAAa,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA2B;CAC/F,MAAM,MAAM,kBAAkB,eAAe;CAC7C,MAAM,QAAQ,qBAAqB,GAAG;CACtC,OAAO,UAA0D;EAC/D,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP,cAAc,EAAE,IAAI,IAAI,IAAI,MAAM;CACpC,CAAC;AACH;AAEA,aAAa,cAAc"}