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

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 (1046) 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 +23 -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/avatar/avatar-context.mjs +24 -0
  62. package/dist/avatar/avatar-context.mjs.map +1 -0
  63. package/dist/avatar/avatar-fallback.d.mts +32 -0
  64. package/dist/avatar/avatar-fallback.d.mts.map +1 -0
  65. package/dist/avatar/avatar-fallback.mjs +31 -0
  66. package/dist/avatar/avatar-fallback.mjs.map +1 -0
  67. package/dist/avatar/avatar-image.d.mts +37 -0
  68. package/dist/avatar/avatar-image.d.mts.map +1 -0
  69. package/dist/avatar/avatar-image.mjs +91 -0
  70. package/dist/avatar/avatar-image.mjs.map +1 -0
  71. package/dist/avatar/avatar-root.d.mts +48 -0
  72. package/dist/avatar/avatar-root.d.mts.map +1 -0
  73. package/dist/avatar/avatar-root.mjs +81 -0
  74. package/dist/avatar/avatar-root.mjs.map +1 -0
  75. package/dist/avatar/index.d.mts +24 -0
  76. package/dist/avatar/index.d.mts.map +1 -0
  77. package/dist/avatar/index.mjs +24 -0
  78. package/dist/avatar/index.mjs.map +1 -0
  79. package/dist/bin/skill-installer.d.mts +1 -0
  80. package/dist/bin/skill-installer.mjs +12 -0
  81. package/dist/bin/skill-installer.mjs.map +1 -0
  82. package/dist/button/button.d.mts +118 -0
  83. package/dist/button/button.d.mts.map +1 -0
  84. package/dist/button/button.mjs +98 -0
  85. package/dist/button/button.mjs.map +1 -0
  86. package/dist/button/index.d.mts +3 -0
  87. package/dist/button/index.mjs +1 -0
  88. package/dist/checkbox/checkbox.d.mts +32 -9
  89. package/dist/checkbox/checkbox.d.mts.map +1 -1
  90. package/dist/checkbox/checkbox.mjs +25 -50
  91. package/dist/checkbox/checkbox.mjs.map +1 -1
  92. package/dist/checkbox-group/checkbox-group-context.mjs.map +1 -1
  93. package/dist/checkbox-group/checkbox-group-item.d.mts +20 -5
  94. package/dist/checkbox-group/checkbox-group-item.d.mts.map +1 -1
  95. package/dist/checkbox-group/checkbox-group-item.mjs +25 -27
  96. package/dist/checkbox-group/checkbox-group-item.mjs.map +1 -1
  97. package/dist/checkbox-group/checkbox-group-label.d.mts +10 -0
  98. package/dist/checkbox-group/checkbox-group-label.d.mts.map +1 -1
  99. package/dist/checkbox-group/checkbox-group-label.mjs +3 -6
  100. package/dist/checkbox-group/checkbox-group-label.mjs.map +1 -1
  101. package/dist/checkbox-group/checkbox-group-parent.d.mts +22 -5
  102. package/dist/checkbox-group/checkbox-group-parent.d.mts.map +1 -1
  103. package/dist/checkbox-group/checkbox-group-parent.mjs +17 -13
  104. package/dist/checkbox-group/checkbox-group-parent.mjs.map +1 -1
  105. package/dist/checkbox-group/checkbox-group-root.d.mts +37 -7
  106. package/dist/checkbox-group/checkbox-group-root.d.mts.map +1 -1
  107. package/dist/checkbox-group/checkbox-group-root.mjs +102 -102
  108. package/dist/checkbox-group/checkbox-group-root.mjs.map +1 -1
  109. package/dist/checkbox-group/index.d.mts +2 -0
  110. package/dist/checkbox-group/index.d.mts.map +1 -1
  111. package/dist/checkbox-group/index.mjs +2 -0
  112. package/dist/checkbox-group/index.mjs.map +1 -1
  113. package/dist/collapsible/collapsible-context.mjs +8 -0
  114. package/dist/collapsible/collapsible-context.mjs.map +1 -0
  115. package/dist/collapsible/collapsible-panel.d.mts +53 -0
  116. package/dist/collapsible/collapsible-panel.d.mts.map +1 -0
  117. package/dist/collapsible/collapsible-panel.mjs +41 -0
  118. package/dist/collapsible/collapsible-panel.mjs.map +1 -0
  119. package/dist/collapsible/collapsible-root.d.mts +108 -0
  120. package/dist/collapsible/collapsible-root.d.mts.map +1 -0
  121. package/dist/collapsible/collapsible-root.mjs +147 -0
  122. package/dist/collapsible/collapsible-root.mjs.map +1 -0
  123. package/dist/collapsible/collapsible-trigger.d.mts +45 -0
  124. package/dist/collapsible/collapsible-trigger.d.mts.map +1 -0
  125. package/dist/collapsible/collapsible-trigger.mjs +62 -0
  126. package/dist/collapsible/collapsible-trigger.mjs.map +1 -0
  127. package/dist/collapsible/index.d.mts +21 -0
  128. package/dist/collapsible/index.d.mts.map +1 -0
  129. package/dist/collapsible/index.mjs +21 -0
  130. package/dist/collapsible/index.mjs.map +1 -0
  131. package/dist/combobox/chip-text.mjs +24 -0
  132. package/dist/combobox/chip-text.mjs.map +1 -0
  133. package/dist/combobox/combobox-chips.d.mts +159 -0
  134. package/dist/combobox/combobox-chips.d.mts.map +1 -0
  135. package/dist/combobox/combobox-chips.mjs +198 -0
  136. package/dist/combobox/combobox-chips.mjs.map +1 -0
  137. package/dist/combobox/combobox-clear.d.mts +29 -5
  138. package/dist/combobox/combobox-clear.d.mts.map +1 -1
  139. package/dist/combobox/combobox-clear.mjs +17 -8
  140. package/dist/combobox/combobox-clear.mjs.map +1 -1
  141. package/dist/combobox/combobox-context.mjs +4 -5
  142. package/dist/combobox/combobox-context.mjs.map +1 -1
  143. package/dist/combobox/combobox-group.d.mts +49 -1
  144. package/dist/combobox/combobox-group.d.mts.map +1 -1
  145. package/dist/combobox/combobox-group.mjs +14 -3
  146. package/dist/combobox/combobox-group.mjs.map +1 -1
  147. package/dist/combobox/combobox-input.d.mts +27 -5
  148. package/dist/combobox/combobox-input.d.mts.map +1 -1
  149. package/dist/combobox/combobox-input.mjs +53 -13
  150. package/dist/combobox/combobox-input.mjs.map +1 -1
  151. package/dist/combobox/combobox-keyboard.mjs +127 -0
  152. package/dist/combobox/combobox-keyboard.mjs.map +1 -0
  153. package/dist/combobox/combobox-label.d.mts +18 -1
  154. package/dist/combobox/combobox-label.d.mts.map +1 -1
  155. package/dist/combobox/combobox-label.mjs +4 -1
  156. package/dist/combobox/combobox-label.mjs.map +1 -1
  157. package/dist/combobox/combobox-list.d.mts +15 -1
  158. package/dist/combobox/combobox-list.d.mts.map +1 -1
  159. package/dist/combobox/combobox-list.mjs +13 -13
  160. package/dist/combobox/combobox-list.mjs.map +1 -1
  161. package/dist/combobox/combobox-option.d.mts +30 -5
  162. package/dist/combobox/combobox-option.d.mts.map +1 -1
  163. package/dist/combobox/combobox-option.mjs +9 -5
  164. package/dist/combobox/combobox-option.mjs.map +1 -1
  165. package/dist/combobox/combobox-popup.d.mts +24 -3
  166. package/dist/combobox/combobox-popup.d.mts.map +1 -1
  167. package/dist/combobox/combobox-popup.mjs +24 -29
  168. package/dist/combobox/combobox-popup.mjs.map +1 -1
  169. package/dist/combobox/combobox-root.d.mts +183 -43
  170. package/dist/combobox/combobox-root.d.mts.map +1 -1
  171. package/dist/combobox/combobox-root.mjs +476 -270
  172. package/dist/combobox/combobox-root.mjs.map +1 -1
  173. package/dist/combobox/combobox-trigger.d.mts +36 -8
  174. package/dist/combobox/combobox-trigger.d.mts.map +1 -1
  175. package/dist/combobox/combobox-trigger.mjs +50 -41
  176. package/dist/combobox/combobox-trigger.mjs.map +1 -1
  177. package/dist/combobox/index.d.mts +13 -5
  178. package/dist/combobox/index.d.mts.map +1 -1
  179. package/dist/combobox/index.mjs +13 -5
  180. package/dist/combobox/index.mjs.map +1 -1
  181. package/dist/combobox/use-combobox-form.mjs +53 -0
  182. package/dist/combobox/use-combobox-form.mjs.map +1 -0
  183. package/dist/combobox/use-combobox-text.mjs +43 -0
  184. package/dist/combobox/use-combobox-text.mjs.map +1 -0
  185. package/dist/csp/csp-provider.d.mts +33 -0
  186. package/dist/csp/csp-provider.d.mts.map +1 -0
  187. package/dist/csp/csp-provider.mjs +26 -0
  188. package/dist/csp/csp-provider.mjs.map +1 -0
  189. package/dist/csp/index.d.mts +3 -0
  190. package/dist/csp/index.mjs +3 -0
  191. package/dist/csp/style-hashes.d.mts +21 -0
  192. package/dist/csp/style-hashes.d.mts.map +1 -0
  193. package/dist/csp/style-hashes.mjs +23 -0
  194. package/dist/csp/style-hashes.mjs.map +1 -0
  195. package/dist/dialog/dialog-close.d.mts +56 -12
  196. package/dist/dialog/dialog-close.d.mts.map +1 -1
  197. package/dist/dialog/dialog-close.mjs +63 -55
  198. package/dist/dialog/dialog-close.mjs.map +1 -1
  199. package/dist/dialog/dialog-context.d.mts +2 -0
  200. package/dist/dialog/dialog-context.mjs +20 -2
  201. package/dist/dialog/dialog-context.mjs.map +1 -1
  202. package/dist/dialog/dialog-description.d.mts +14 -1
  203. package/dist/dialog/dialog-description.d.mts.map +1 -1
  204. package/dist/dialog/dialog-description.mjs +10 -4
  205. package/dist/dialog/dialog-description.mjs.map +1 -1
  206. package/dist/dialog/dialog-dismiss.mjs +108 -0
  207. package/dist/dialog/dialog-dismiss.mjs.map +1 -0
  208. package/dist/dialog/dialog-form.d.mts +43 -11
  209. package/dist/dialog/dialog-form.d.mts.map +1 -1
  210. package/dist/dialog/dialog-form.mjs +64 -37
  211. package/dist/dialog/dialog-form.mjs.map +1 -1
  212. package/dist/dialog/dialog-popup.d.mts +48 -14
  213. package/dist/dialog/dialog-popup.d.mts.map +1 -1
  214. package/dist/dialog/dialog-popup.mjs +184 -241
  215. package/dist/dialog/dialog-popup.mjs.map +1 -1
  216. package/dist/dialog/dialog-root.d.mts +54 -19
  217. package/dist/dialog/dialog-root.d.mts.map +1 -1
  218. package/dist/dialog/dialog-root.mjs +76 -92
  219. package/dist/dialog/dialog-root.mjs.map +1 -1
  220. package/dist/dialog/dialog-title.d.mts +13 -1
  221. package/dist/dialog/dialog-title.d.mts.map +1 -1
  222. package/dist/dialog/dialog-title.mjs +10 -4
  223. package/dist/dialog/dialog-title.mjs.map +1 -1
  224. package/dist/dialog/dialog-trigger.d.mts +30 -6
  225. package/dist/dialog/dialog-trigger.d.mts.map +1 -1
  226. package/dist/dialog/dialog-trigger.mjs +50 -28
  227. package/dist/dialog/dialog-trigger.mjs.map +1 -1
  228. package/dist/dialog/index.d.mts +7 -3
  229. package/dist/dialog/index.d.mts.map +1 -1
  230. package/dist/dialog/index.mjs +7 -3
  231. package/dist/dialog/index.mjs.map +1 -1
  232. package/dist/docs/components/accordion.md +428 -0
  233. package/dist/docs/components/alert-dialog.md +546 -0
  234. package/dist/docs/components/avatar.md +354 -0
  235. package/dist/docs/components/button.md +511 -0
  236. package/dist/docs/components/checkbox-group.md +483 -0
  237. package/dist/docs/components/checkbox.md +373 -0
  238. package/dist/docs/components/collapsible.md +408 -0
  239. package/dist/docs/components/combobox.md +960 -0
  240. package/dist/docs/components/context-menu.md +524 -0
  241. package/dist/docs/components/dialog.md +694 -0
  242. package/dist/docs/components/drawer.md +622 -0
  243. package/dist/docs/components/field.md +765 -0
  244. package/dist/docs/components/hover-card.md +494 -0
  245. package/dist/docs/components/menu.md +670 -0
  246. package/dist/docs/components/meter.md +313 -0
  247. package/dist/docs/components/multi-select.md +622 -0
  248. package/dist/docs/components/number-field.md +528 -0
  249. package/dist/docs/components/otp-field.md +501 -0
  250. package/dist/docs/components/popover.md +656 -0
  251. package/dist/docs/components/progress.md +450 -0
  252. package/dist/docs/components/radio-group.md +457 -0
  253. package/dist/docs/components/scroll-area.md +294 -0
  254. package/dist/docs/components/select.md +670 -0
  255. package/dist/docs/components/separator.md +182 -0
  256. package/dist/docs/components/slider.md +558 -0
  257. package/dist/docs/components/switch.md +311 -0
  258. package/dist/docs/components/tabs.md +473 -0
  259. package/dist/docs/components/toast.md +602 -0
  260. package/dist/docs/components/toggle-group.md +341 -0
  261. package/dist/docs/components/toggle.md +245 -0
  262. package/dist/docs/components/toolbar.md +390 -0
  263. package/dist/docs/components/tooltip.md +494 -0
  264. package/dist/docs/concepts/action-props.md +281 -0
  265. package/dist/docs/concepts/ai-agents.md +56 -0
  266. package/dist/docs/concepts/browser-owned-state.md +133 -0
  267. package/dist/docs/concepts/content-security-policy.md +69 -0
  268. package/dist/docs/concepts/experimental.md +36 -0
  269. package/dist/docs/concepts/pending-and-optimistic.md +263 -0
  270. package/dist/docs/concepts/render.md +23 -0
  271. package/dist/docs/concepts/server-components.md +132 -0
  272. package/dist/docs/concepts/suspense.md +129 -0
  273. package/dist/docs/concepts/transitions.md +112 -0
  274. package/dist/docs/getting-started.md +102 -0
  275. package/dist/docs/index.md +191 -0
  276. package/dist/docs/roadmap.md +150 -0
  277. package/dist/docs/why.md +104 -0
  278. package/dist/drawer/drawer-close.d.mts +26 -0
  279. package/dist/drawer/drawer-close.d.mts.map +1 -0
  280. package/dist/drawer/drawer-close.mjs +19 -0
  281. package/dist/drawer/drawer-close.mjs.map +1 -0
  282. package/dist/drawer/drawer-description.d.mts +23 -0
  283. package/dist/drawer/drawer-description.d.mts.map +1 -0
  284. package/dist/drawer/drawer-description.mjs +18 -0
  285. package/dist/drawer/drawer-description.mjs.map +1 -0
  286. package/dist/drawer/drawer-form.d.mts +24 -0
  287. package/dist/drawer/drawer-form.d.mts.map +1 -0
  288. package/dist/drawer/drawer-form.mjs +19 -0
  289. package/dist/drawer/drawer-form.mjs.map +1 -0
  290. package/dist/drawer/drawer-popup.d.mts +77 -0
  291. package/dist/drawer/drawer-popup.d.mts.map +1 -0
  292. package/dist/drawer/drawer-popup.mjs +124 -0
  293. package/dist/drawer/drawer-popup.mjs.map +1 -0
  294. package/dist/drawer/drawer-root.d.mts +31 -0
  295. package/dist/drawer/drawer-root.d.mts.map +1 -0
  296. package/dist/drawer/drawer-root.mjs +23 -0
  297. package/dist/drawer/drawer-root.mjs.map +1 -0
  298. package/dist/drawer/drawer-swipe.d.mts +5 -0
  299. package/dist/drawer/drawer-swipe.d.mts.map +1 -0
  300. package/dist/drawer/drawer-swipe.mjs +193 -0
  301. package/dist/drawer/drawer-swipe.mjs.map +1 -0
  302. package/dist/drawer/drawer-title.d.mts +23 -0
  303. package/dist/drawer/drawer-title.d.mts.map +1 -0
  304. package/dist/drawer/drawer-title.mjs +18 -0
  305. package/dist/drawer/drawer-title.mjs.map +1 -0
  306. package/dist/drawer/drawer-trigger.d.mts +23 -0
  307. package/dist/drawer/drawer-trigger.d.mts.map +1 -0
  308. package/dist/drawer/drawer-trigger.mjs +18 -0
  309. package/dist/drawer/drawer-trigger.mjs.map +1 -0
  310. package/dist/drawer/index.d.mts +34 -0
  311. package/dist/drawer/index.d.mts.map +1 -0
  312. package/dist/drawer/index.mjs +33 -0
  313. package/dist/drawer/index.mjs.map +1 -0
  314. package/dist/field/field-control.d.mts +65 -0
  315. package/dist/field/field-control.d.mts.map +1 -0
  316. package/dist/field/field-control.mjs +92 -0
  317. package/dist/field/field-control.mjs.map +1 -0
  318. package/dist/field/field-description.d.mts +35 -0
  319. package/dist/field/field-description.d.mts.map +1 -0
  320. package/dist/field/field-description.mjs +35 -0
  321. package/dist/field/field-description.mjs.map +1 -0
  322. package/dist/field/field-error.d.mts +42 -0
  323. package/dist/field/field-error.d.mts.map +1 -0
  324. package/dist/field/field-error.mjs +43 -0
  325. package/dist/field/field-error.mjs.map +1 -0
  326. package/dist/field/field-label.d.mts +39 -0
  327. package/dist/field/field-label.d.mts.map +1 -0
  328. package/dist/field/field-label.mjs +50 -0
  329. package/dist/field/field-label.mjs.map +1 -0
  330. package/dist/field/field-root.d.mts +72 -0
  331. package/dist/field/field-root.d.mts.map +1 -0
  332. package/dist/field/field-root.mjs +309 -0
  333. package/dist/field/field-root.mjs.map +1 -0
  334. package/dist/field/index.d.mts +27 -0
  335. package/dist/field/index.d.mts.map +1 -0
  336. package/dist/field/index.mjs +26 -0
  337. package/dist/field/index.mjs.map +1 -0
  338. package/dist/field/use-server-error-visibility.mjs +44 -0
  339. package/dist/field/use-server-error-visibility.mjs.map +1 -0
  340. package/dist/form/form-root.d.mts +74 -0
  341. package/dist/form/form-root.d.mts.map +1 -0
  342. package/dist/form/form-root.mjs +158 -0
  343. package/dist/form/form-root.mjs.map +1 -0
  344. package/dist/form/form-submit.d.mts +56 -0
  345. package/dist/form/form-submit.d.mts.map +1 -0
  346. package/dist/form/form-submit.mjs +53 -0
  347. package/dist/form/form-submit.mjs.map +1 -0
  348. package/dist/form/index.d.mts +18 -0
  349. package/dist/form/index.d.mts.map +1 -0
  350. package/dist/form/index.mjs +18 -0
  351. package/dist/form/index.mjs.map +1 -0
  352. package/dist/hover-card/hover-card-context.mjs +13 -0
  353. package/dist/hover-card/hover-card-context.mjs.map +1 -0
  354. package/dist/hover-card/hover-card-popup.d.mts +102 -0
  355. package/dist/hover-card/hover-card-popup.d.mts.map +1 -0
  356. package/dist/hover-card/hover-card-popup.mjs +80 -0
  357. package/dist/hover-card/hover-card-popup.mjs.map +1 -0
  358. package/dist/hover-card/hover-card-root.d.mts +94 -0
  359. package/dist/hover-card/hover-card-root.d.mts.map +1 -0
  360. package/dist/hover-card/hover-card-root.mjs +74 -0
  361. package/dist/hover-card/hover-card-root.mjs.map +1 -0
  362. package/dist/hover-card/hover-card-trigger.d.mts +65 -0
  363. package/dist/hover-card/hover-card-trigger.d.mts.map +1 -0
  364. package/dist/hover-card/hover-card-trigger.mjs +109 -0
  365. package/dist/hover-card/hover-card-trigger.mjs.map +1 -0
  366. package/dist/hover-card/index.d.mts +24 -0
  367. package/dist/hover-card/index.d.mts.map +1 -0
  368. package/dist/hover-card/index.mjs +24 -0
  369. package/dist/hover-card/index.mjs.map +1 -0
  370. package/dist/hover-card/use-hover-card-interest.mjs +242 -0
  371. package/dist/hover-card/use-hover-card-interest.mjs.map +1 -0
  372. package/dist/index.d.mts +118 -13
  373. package/dist/index.mjs +22 -1
  374. package/dist/internal/{action-details.mjs → action/action-details.mjs} +1 -1
  375. package/dist/internal/action/action-details.mjs.map +1 -0
  376. package/dist/internal/action/call-urgent-handler.mjs +32 -0
  377. package/dist/internal/action/call-urgent-handler.mjs.map +1 -0
  378. package/dist/internal/action/report-dropped.mjs +27 -0
  379. package/dist/internal/action/report-dropped.mjs.map +1 -0
  380. package/dist/internal/action/use-action-trigger.mjs +67 -0
  381. package/dist/internal/action/use-action-trigger.mjs.map +1 -0
  382. package/dist/internal/action/use-connected.mjs +24 -0
  383. package/dist/internal/action/use-connected.mjs.map +1 -0
  384. package/dist/internal/action/use-controllable-action.mjs +153 -0
  385. package/dist/internal/action/use-controllable-action.mjs.map +1 -0
  386. package/dist/internal/action/use-multiple-selection.mjs +83 -0
  387. package/dist/internal/action/use-multiple-selection.mjs.map +1 -0
  388. package/dist/internal/action/use-pure-trigger.mjs +34 -0
  389. package/dist/internal/action/use-pure-trigger.mjs.map +1 -0
  390. package/dist/internal/action/use-step-commit.mjs +147 -0
  391. package/dist/internal/action/use-step-commit.mjs.map +1 -0
  392. package/dist/internal/announce.mjs +20 -0
  393. package/dist/internal/announce.mjs.map +1 -0
  394. package/dist/internal/arrow-keys.mjs +21 -0
  395. package/dist/internal/arrow-keys.mjs.map +1 -0
  396. package/dist/internal/csp-context.mjs +8 -0
  397. package/dist/internal/csp-context.mjs.map +1 -0
  398. package/dist/internal/decimal.mjs +33 -0
  399. package/dist/internal/decimal.mjs.map +1 -0
  400. package/dist/internal/details-summary.mjs +56 -0
  401. package/dist/internal/details-summary.mjs.map +1 -0
  402. package/dist/internal/dev-warn.mjs +17 -0
  403. package/dist/internal/dev-warn.mjs.map +1 -0
  404. package/dist/internal/dom-order.mjs +17 -0
  405. package/dist/internal/dom-order.mjs.map +1 -0
  406. package/dist/internal/form/field-context.d.mts +19 -0
  407. package/dist/internal/form/field-context.d.mts.map +1 -0
  408. package/dist/internal/form/field-context.mjs +24 -0
  409. package/dist/internal/form/field-context.mjs.map +1 -0
  410. package/dist/internal/form/focus-first-invalid.mjs +67 -0
  411. package/dist/internal/form/focus-first-invalid.mjs.map +1 -0
  412. package/dist/internal/form/form-status-watcher.mjs +31 -0
  413. package/dist/internal/form/form-status-watcher.mjs.map +1 -0
  414. package/dist/internal/form/group-member.mjs +37 -0
  415. package/dist/internal/form/group-member.mjs.map +1 -0
  416. package/dist/internal/form/hidden-values.mjs +29 -0
  417. package/dist/internal/form/hidden-values.mjs.map +1 -0
  418. package/dist/internal/{sync-presence.mjs → form/sync-presence.mjs} +6 -2
  419. package/dist/internal/form/sync-presence.mjs.map +1 -0
  420. package/dist/internal/form/use-checkable-input.mjs +79 -0
  421. package/dist/internal/form/use-checkable-input.mjs.map +1 -0
  422. package/dist/internal/form/use-field-control.mjs +125 -0
  423. package/dist/internal/form/use-field-control.mjs.map +1 -0
  424. package/dist/internal/form/use-fieldset-group.mjs +46 -0
  425. package/dist/internal/form/use-fieldset-group.mjs.map +1 -0
  426. package/dist/internal/form/use-form-owner-event.mjs +44 -0
  427. package/dist/internal/form/use-form-owner-event.mjs.map +1 -0
  428. package/dist/internal/form/use-form-reset.mjs +39 -0
  429. package/dist/internal/form/use-form-reset.mjs.map +1 -0
  430. package/dist/internal/{use-native-checked.mjs → form/use-native-checked.mjs} +8 -9
  431. package/dist/internal/form/use-native-checked.mjs.map +1 -0
  432. package/dist/internal/{use-native-group-reconciliation.mjs → form/use-native-group-reconciliation.mjs} +15 -12
  433. package/dist/internal/form/use-native-group-reconciliation.mjs.map +1 -0
  434. package/dist/internal/{use-native-select-value.mjs → form/use-native-select-value.mjs} +8 -6
  435. package/dist/internal/form/use-native-select-value.mjs.map +1 -0
  436. package/dist/internal/form/validity.d.mts +35 -0
  437. package/dist/internal/form/validity.d.mts.map +1 -0
  438. package/dist/internal/form/validity.mjs +98 -0
  439. package/dist/internal/form/validity.mjs.map +1 -0
  440. package/dist/internal/overlay/anchor-position.d.mts +15 -0
  441. package/dist/internal/overlay/anchor-position.d.mts.map +1 -0
  442. package/dist/internal/overlay/anchor-position.mjs +132 -0
  443. package/dist/internal/overlay/anchor-position.mjs.map +1 -0
  444. package/dist/internal/overlay/content-focus-probe.mjs +42 -0
  445. package/dist/internal/overlay/content-focus-probe.mjs.map +1 -0
  446. package/dist/internal/overlay/css-transition-cut.mjs +66 -0
  447. package/dist/internal/overlay/css-transition-cut.mjs.map +1 -0
  448. package/dist/internal/overlay/focus-visible.mjs +26 -0
  449. package/dist/internal/overlay/focus-visible.mjs.map +1 -0
  450. package/dist/internal/overlay/invokers.mjs +63 -0
  451. package/dist/internal/overlay/invokers.mjs.map +1 -0
  452. package/dist/internal/overlay/modal-registry.mjs +39 -0
  453. package/dist/internal/overlay/modal-registry.mjs.map +1 -0
  454. package/dist/internal/overlay/overlay-popup.mjs +103 -0
  455. package/dist/internal/overlay/overlay-popup.mjs.map +1 -0
  456. package/dist/internal/overlay/overlay-show.mjs +73 -0
  457. package/dist/internal/overlay/overlay-show.mjs.map +1 -0
  458. package/dist/internal/overlay/popover-open.mjs +18 -0
  459. package/dist/internal/overlay/popover-open.mjs.map +1 -0
  460. package/dist/internal/overlay/trigger-ref.mjs +26 -0
  461. package/dist/internal/overlay/trigger-ref.mjs.map +1 -0
  462. package/dist/internal/overlay/use-apply-open-state.mjs +44 -0
  463. package/dist/internal/overlay/use-apply-open-state.mjs.map +1 -0
  464. package/dist/internal/{use-exit-animation.mjs → overlay/use-exit-animation.mjs} +28 -8
  465. package/dist/internal/overlay/use-exit-animation.mjs.map +1 -0
  466. package/dist/internal/overlay/use-interest-dismiss.mjs +85 -0
  467. package/dist/internal/overlay/use-interest-dismiss.mjs.map +1 -0
  468. package/dist/internal/overlay/use-modal-registration.mjs +47 -0
  469. package/dist/internal/overlay/use-modal-registration.mjs.map +1 -0
  470. package/dist/internal/overlay/use-overlay-close.mjs +72 -0
  471. package/dist/internal/overlay/use-overlay-close.mjs.map +1 -0
  472. package/dist/internal/overlay/use-overlay-root.d.mts +2 -0
  473. package/dist/internal/overlay/use-overlay-root.mjs +193 -0
  474. package/dist/internal/overlay/use-overlay-root.mjs.map +1 -0
  475. package/dist/internal/overlay/use-popover-popup.mjs +287 -0
  476. package/dist/internal/overlay/use-popover-popup.mjs.map +1 -0
  477. package/dist/internal/overlay/use-popover-trigger.d.mts +16 -0
  478. package/dist/internal/overlay/use-popover-trigger.d.mts.map +1 -0
  479. package/dist/internal/overlay/use-popover-trigger.mjs +142 -0
  480. package/dist/internal/overlay/use-popover-trigger.mjs.map +1 -0
  481. package/dist/internal/overlay/use-resolved-placement.mjs +162 -0
  482. package/dist/internal/overlay/use-resolved-placement.mjs.map +1 -0
  483. package/dist/internal/platform-attributes.d.mts +2 -1
  484. package/dist/internal/platform-attributes.d.mts.map +1 -1
  485. package/dist/internal/pointer-capture.mjs +20 -0
  486. package/dist/internal/pointer-capture.mjs.map +1 -0
  487. package/dist/internal/range-value.mjs +51 -0
  488. package/dist/internal/range-value.mjs.map +1 -0
  489. package/dist/internal/render-element.d.mts +2 -0
  490. package/dist/internal/render-element.mjs +123 -0
  491. package/dist/internal/render-element.mjs.map +1 -0
  492. package/dist/internal/shipped-styles.mjs +14 -0
  493. package/dist/internal/shipped-styles.mjs.map +1 -0
  494. package/dist/internal/swipe-arithmetic.mjs +75 -0
  495. package/dist/internal/swipe-arithmetic.mjs.map +1 -0
  496. package/dist/internal/swipe.mjs +169 -0
  497. package/dist/internal/swipe.mjs.map +1 -0
  498. package/dist/internal/toolbar-context.mjs +17 -0
  499. package/dist/internal/toolbar-context.mjs.map +1 -0
  500. package/dist/internal/transition-boundary.mjs +5 -9
  501. package/dist/internal/transition-boundary.mjs.map +1 -1
  502. package/dist/internal/typeahead.mjs +52 -0
  503. package/dist/internal/typeahead.mjs.map +1 -0
  504. package/dist/internal/types.d.mts +42 -9
  505. package/dist/internal/types.d.mts.map +1 -1
  506. package/dist/internal/use-active-option.mjs +51 -0
  507. package/dist/internal/use-active-option.mjs.map +1 -0
  508. package/dist/internal/use-deferred-leave.mjs +113 -0
  509. package/dist/internal/use-deferred-leave.mjs.map +1 -0
  510. package/dist/internal/use-dev-warning.mjs +8 -4
  511. package/dist/internal/use-dev-warning.mjs.map +1 -1
  512. package/dist/internal/use-element-check.mjs +39 -0
  513. package/dist/internal/use-element-check.mjs.map +1 -0
  514. package/dist/internal/use-item-order.mjs +42 -0
  515. package/dist/internal/use-item-order.mjs.map +1 -0
  516. package/dist/internal/use-latest.mjs +28 -0
  517. package/dist/internal/use-latest.mjs.map +1 -0
  518. package/dist/internal/use-merged-refs.mjs +19 -0
  519. package/dist/internal/use-merged-refs.mjs.map +1 -0
  520. package/dist/internal/use-mount-fixed.mjs +22 -0
  521. package/dist/internal/use-mount-fixed.mjs.map +1 -0
  522. package/dist/internal/use-name-warning.mjs +140 -0
  523. package/dist/internal/use-name-warning.mjs.map +1 -0
  524. package/dist/internal/use-native-focusgroup.mjs +19 -0
  525. package/dist/internal/use-native-focusgroup.mjs.map +1 -0
  526. package/dist/internal/use-option-registry.mjs +70 -0
  527. package/dist/internal/use-option-registry.mjs.map +1 -0
  528. package/dist/internal/use-register-count.mjs +27 -0
  529. package/dist/internal/use-register-count.mjs.map +1 -0
  530. package/dist/internal/use-render.d.mts +2 -0
  531. package/dist/internal/use-render.mjs +12 -35
  532. package/dist/internal/use-render.mjs.map +1 -1
  533. package/dist/internal/use-roving-focus.mjs +288 -0
  534. package/dist/internal/use-roving-focus.mjs.map +1 -0
  535. package/dist/internal/use-value-set.mjs +20 -0
  536. package/dist/internal/use-value-set.mjs.map +1 -0
  537. package/dist/internal/value-set.mjs +41 -0
  538. package/dist/internal/value-set.mjs.map +1 -0
  539. package/dist/menu/index.d.mts +8 -2
  540. package/dist/menu/index.d.mts.map +1 -1
  541. package/dist/menu/index.mjs +7 -1
  542. package/dist/menu/index.mjs.map +1 -1
  543. package/dist/menu/menu-checkbox-item.d.mts +27 -3
  544. package/dist/menu/menu-checkbox-item.d.mts.map +1 -1
  545. package/dist/menu/menu-checkbox-item.mjs +6 -3
  546. package/dist/menu/menu-checkbox-item.mjs.map +1 -1
  547. package/dist/menu/menu-context-trigger.d.mts +63 -0
  548. package/dist/menu/menu-context-trigger.d.mts.map +1 -0
  549. package/dist/menu/menu-context-trigger.mjs +231 -0
  550. package/dist/menu/menu-context-trigger.mjs.map +1 -0
  551. package/dist/menu/menu-context.d.mts +1 -1
  552. package/dist/menu/menu-context.mjs +44 -1
  553. package/dist/menu/menu-context.mjs.map +1 -1
  554. package/dist/menu/menu-dom.mjs +35 -4
  555. package/dist/menu/menu-dom.mjs.map +1 -1
  556. package/dist/menu/menu-gestures.mjs +166 -0
  557. package/dist/menu/menu-gestures.mjs.map +1 -0
  558. package/dist/menu/menu-group.d.mts +36 -1
  559. package/dist/menu/menu-group.d.mts.map +1 -1
  560. package/dist/menu/menu-group.mjs +15 -5
  561. package/dist/menu/menu-group.mjs.map +1 -1
  562. package/dist/menu/menu-hover.mjs +0 -1
  563. package/dist/menu/menu-hover.mjs.map +1 -1
  564. package/dist/menu/menu-item.d.mts +42 -5
  565. package/dist/menu/menu-item.d.mts.map +1 -1
  566. package/dist/menu/menu-item.mjs +18 -9
  567. package/dist/menu/menu-item.mjs.map +1 -1
  568. package/dist/menu/menu-outside.mjs +101 -0
  569. package/dist/menu/menu-outside.mjs.map +1 -0
  570. package/dist/menu/menu-point.mjs +85 -0
  571. package/dist/menu/menu-point.mjs.map +1 -0
  572. package/dist/menu/menu-popup.d.mts +68 -11
  573. package/dist/menu/menu-popup.d.mts.map +1 -1
  574. package/dist/menu/menu-popup.mjs +106 -116
  575. package/dist/menu/menu-popup.mjs.map +1 -1
  576. package/dist/menu/menu-radio-group.d.mts +20 -1
  577. package/dist/menu/menu-radio-group.d.mts.map +1 -1
  578. package/dist/menu/menu-radio-group.mjs +14 -7
  579. package/dist/menu/menu-radio-group.mjs.map +1 -1
  580. package/dist/menu/menu-radio-item.d.mts +18 -0
  581. package/dist/menu/menu-radio-item.d.mts.map +1 -1
  582. package/dist/menu/menu-radio-item.mjs +5 -1
  583. package/dist/menu/menu-radio-item.mjs.map +1 -1
  584. package/dist/menu/menu-root.d.mts +61 -12
  585. package/dist/menu/menu-root.d.mts.map +1 -1
  586. package/dist/menu/menu-root.mjs +72 -17
  587. package/dist/menu/menu-root.mjs.map +1 -1
  588. package/dist/menu/menu-submenu-trigger.d.mts +24 -9
  589. package/dist/menu/menu-submenu-trigger.d.mts.map +1 -1
  590. package/dist/menu/menu-submenu-trigger.mjs +48 -26
  591. package/dist/menu/menu-submenu-trigger.mjs.map +1 -1
  592. package/dist/menu/menu-trigger.d.mts +37 -16
  593. package/dist/menu/menu-trigger.d.mts.map +1 -1
  594. package/dist/menu/menu-trigger.mjs +39 -23
  595. package/dist/menu/menu-trigger.mjs.map +1 -1
  596. package/dist/menu/use-menu-item.mjs +14 -16
  597. package/dist/menu/use-menu-item.mjs.map +1 -1
  598. package/dist/menu/use-menu-keyboard.mjs +68 -0
  599. package/dist/menu/use-menu-keyboard.mjs.map +1 -0
  600. package/dist/meter/index.d.mts +26 -0
  601. package/dist/meter/index.d.mts.map +1 -0
  602. package/dist/meter/index.mjs +25 -0
  603. package/dist/meter/index.mjs.map +1 -0
  604. package/dist/meter/meter-context.mjs +13 -0
  605. package/dist/meter/meter-context.mjs.map +1 -0
  606. package/dist/meter/meter-indicator.d.mts +30 -0
  607. package/dist/meter/meter-indicator.d.mts.map +1 -0
  608. package/dist/meter/meter-indicator.mjs +27 -0
  609. package/dist/meter/meter-indicator.mjs.map +1 -0
  610. package/dist/meter/meter-label.d.mts +30 -0
  611. package/dist/meter/meter-label.d.mts.map +1 -0
  612. package/dist/meter/meter-label.mjs +30 -0
  613. package/dist/meter/meter-label.mjs.map +1 -0
  614. package/dist/meter/meter-region.d.mts +9 -0
  615. package/dist/meter/meter-region.d.mts.map +1 -0
  616. package/dist/meter/meter-region.mjs +39 -0
  617. package/dist/meter/meter-region.mjs.map +1 -0
  618. package/dist/meter/meter-root.d.mts +113 -0
  619. package/dist/meter/meter-root.d.mts.map +1 -0
  620. package/dist/meter/meter-root.mjs +85 -0
  621. package/dist/meter/meter-root.mjs.map +1 -0
  622. package/dist/meter/meter-track.d.mts +30 -0
  623. package/dist/meter/meter-track.d.mts.map +1 -0
  624. package/dist/meter/meter-track.mjs +27 -0
  625. package/dist/meter/meter-track.mjs.map +1 -0
  626. package/dist/meter/meter-value.d.mts +34 -0
  627. package/dist/meter/meter-value.d.mts.map +1 -0
  628. package/dist/meter/meter-value.mjs +31 -0
  629. package/dist/meter/meter-value.mjs.map +1 -0
  630. package/dist/multi-select/index.d.mts +37 -0
  631. package/dist/multi-select/index.d.mts.map +1 -0
  632. package/dist/multi-select/index.mjs +37 -0
  633. package/dist/multi-select/index.mjs.map +1 -0
  634. package/dist/multi-select/multi-select-context.mjs +19 -0
  635. package/dist/multi-select/multi-select-context.mjs.map +1 -0
  636. package/dist/multi-select/multi-select-group.d.mts +120 -0
  637. package/dist/multi-select/multi-select-group.d.mts.map +1 -0
  638. package/dist/multi-select/multi-select-group.mjs +111 -0
  639. package/dist/multi-select/multi-select-group.mjs.map +1 -0
  640. package/dist/multi-select/multi-select-keyboard.mjs +145 -0
  641. package/dist/multi-select/multi-select-keyboard.mjs.map +1 -0
  642. package/dist/multi-select/multi-select-label.d.mts +42 -0
  643. package/dist/multi-select/multi-select-label.d.mts.map +1 -0
  644. package/dist/multi-select/multi-select-label.mjs +41 -0
  645. package/dist/multi-select/multi-select-label.mjs.map +1 -0
  646. package/dist/multi-select/multi-select-list.d.mts +47 -0
  647. package/dist/multi-select/multi-select-list.d.mts.map +1 -0
  648. package/dist/multi-select/multi-select-list.mjs +65 -0
  649. package/dist/multi-select/multi-select-list.mjs.map +1 -0
  650. package/dist/multi-select/multi-select-option.d.mts +68 -0
  651. package/dist/multi-select/multi-select-option.d.mts.map +1 -0
  652. package/dist/multi-select/multi-select-option.mjs +93 -0
  653. package/dist/multi-select/multi-select-option.mjs.map +1 -0
  654. package/dist/multi-select/multi-select-popup.d.mts +58 -0
  655. package/dist/multi-select/multi-select-popup.d.mts.map +1 -0
  656. package/dist/multi-select/multi-select-popup.mjs +71 -0
  657. package/dist/multi-select/multi-select-popup.mjs.map +1 -0
  658. package/dist/multi-select/multi-select-root.d.mts +125 -0
  659. package/dist/multi-select/multi-select-root.d.mts.map +1 -0
  660. package/dist/multi-select/multi-select-root.mjs +257 -0
  661. package/dist/multi-select/multi-select-root.mjs.map +1 -0
  662. package/dist/multi-select/multi-select-trigger.d.mts +66 -0
  663. package/dist/multi-select/multi-select-trigger.d.mts.map +1 -0
  664. package/dist/multi-select/multi-select-trigger.mjs +169 -0
  665. package/dist/multi-select/multi-select-trigger.mjs.map +1 -0
  666. package/dist/multi-select/multi-select-value.d.mts +57 -0
  667. package/dist/multi-select/multi-select-value.d.mts.map +1 -0
  668. package/dist/multi-select/multi-select-value.mjs +41 -0
  669. package/dist/multi-select/multi-select-value.mjs.map +1 -0
  670. package/dist/number-field/index.d.mts +29 -0
  671. package/dist/number-field/index.d.mts.map +1 -0
  672. package/dist/number-field/index.mjs +28 -0
  673. package/dist/number-field/index.mjs.map +1 -0
  674. package/dist/number-field/number-field-arithmetic.mjs +97 -0
  675. package/dist/number-field/number-field-arithmetic.mjs.map +1 -0
  676. package/dist/number-field/number-field-context.d.mts +7 -0
  677. package/dist/number-field/number-field-context.d.mts.map +1 -0
  678. package/dist/number-field/number-field-context.mjs +13 -0
  679. package/dist/number-field/number-field-context.mjs.map +1 -0
  680. package/dist/number-field/number-field-decrement.d.mts +19 -0
  681. package/dist/number-field/number-field-decrement.d.mts.map +1 -0
  682. package/dist/number-field/number-field-decrement.mjs +22 -0
  683. package/dist/number-field/number-field-decrement.mjs.map +1 -0
  684. package/dist/number-field/number-field-format.mjs +279 -0
  685. package/dist/number-field/number-field-format.mjs.map +1 -0
  686. package/dist/number-field/number-field-increment.d.mts +19 -0
  687. package/dist/number-field/number-field-increment.d.mts.map +1 -0
  688. package/dist/number-field/number-field-increment.mjs +22 -0
  689. package/dist/number-field/number-field-increment.mjs.map +1 -0
  690. package/dist/number-field/number-field-input.d.mts +38 -0
  691. package/dist/number-field/number-field-input.d.mts.map +1 -0
  692. package/dist/number-field/number-field-input.mjs +161 -0
  693. package/dist/number-field/number-field-input.mjs.map +1 -0
  694. package/dist/number-field/number-field-label.d.mts +33 -0
  695. package/dist/number-field/number-field-label.d.mts.map +1 -0
  696. package/dist/number-field/number-field-label.mjs +43 -0
  697. package/dist/number-field/number-field-label.mjs.map +1 -0
  698. package/dist/number-field/number-field-root.d.mts +157 -0
  699. package/dist/number-field/number-field-root.d.mts.map +1 -0
  700. package/dist/number-field/number-field-root.mjs +445 -0
  701. package/dist/number-field/number-field-root.mjs.map +1 -0
  702. package/dist/number-field/use-number-field-dev-warnings.mjs +28 -0
  703. package/dist/number-field/use-number-field-dev-warnings.mjs.map +1 -0
  704. package/dist/number-field/use-step-button.d.mts +44 -0
  705. package/dist/number-field/use-step-button.d.mts.map +1 -0
  706. package/dist/number-field/use-step-button.mjs +175 -0
  707. package/dist/number-field/use-step-button.mjs.map +1 -0
  708. package/dist/otp-field/index.d.mts +23 -0
  709. package/dist/otp-field/index.d.mts.map +1 -0
  710. package/dist/otp-field/index.mjs +23 -0
  711. package/dist/otp-field/index.mjs.map +1 -0
  712. package/dist/otp-field/otp-field-context.mjs +13 -0
  713. package/dist/otp-field/otp-field-context.mjs.map +1 -0
  714. package/dist/otp-field/otp-field-filter.d.mts +5 -0
  715. package/dist/otp-field/otp-field-filter.d.mts.map +1 -0
  716. package/dist/otp-field/otp-field-filter.mjs +135 -0
  717. package/dist/otp-field/otp-field-filter.mjs.map +1 -0
  718. package/dist/otp-field/otp-field-input.d.mts +41 -0
  719. package/dist/otp-field/otp-field-input.d.mts.map +1 -0
  720. package/dist/otp-field/otp-field-input.mjs +177 -0
  721. package/dist/otp-field/otp-field-input.mjs.map +1 -0
  722. package/dist/otp-field/otp-field-root.d.mts +143 -0
  723. package/dist/otp-field/otp-field-root.d.mts.map +1 -0
  724. package/dist/otp-field/otp-field-root.mjs +397 -0
  725. package/dist/otp-field/otp-field-root.mjs.map +1 -0
  726. package/dist/otp-field/otp-field-slot.d.mts +52 -0
  727. package/dist/otp-field/otp-field-slot.d.mts.map +1 -0
  728. package/dist/otp-field/otp-field-slot.mjs +67 -0
  729. package/dist/otp-field/otp-field-slot.mjs.map +1 -0
  730. package/dist/popover/index.d.mts +6 -4
  731. package/dist/popover/index.d.mts.map +1 -1
  732. package/dist/popover/index.mjs +6 -4
  733. package/dist/popover/index.mjs.map +1 -1
  734. package/dist/popover/popover-close.d.mts +48 -8
  735. package/dist/popover/popover-close.d.mts.map +1 -1
  736. package/dist/popover/popover-close.mjs +41 -67
  737. package/dist/popover/popover-close.mjs.map +1 -1
  738. package/dist/popover/popover-context.mjs.map +1 -1
  739. package/dist/popover/popover-description.d.mts +12 -0
  740. package/dist/popover/popover-description.d.mts.map +1 -1
  741. package/dist/popover/popover-description.mjs +2 -0
  742. package/dist/popover/popover-description.mjs.map +1 -1
  743. package/dist/popover/popover-popup.d.mts +64 -18
  744. package/dist/popover/popover-popup.d.mts.map +1 -1
  745. package/dist/popover/popover-popup.mjs +31 -36
  746. package/dist/popover/popover-popup.mjs.map +1 -1
  747. package/dist/popover/popover-root.d.mts +40 -18
  748. package/dist/popover/popover-root.d.mts.map +1 -1
  749. package/dist/popover/popover-root.mjs +15 -10
  750. package/dist/popover/popover-root.mjs.map +1 -1
  751. package/dist/popover/popover-title.d.mts +11 -0
  752. package/dist/popover/popover-title.d.mts.map +1 -1
  753. package/dist/popover/popover-title.mjs +2 -0
  754. package/dist/popover/popover-title.mjs.map +1 -1
  755. package/dist/popover/popover-trigger.d.mts +38 -18
  756. package/dist/popover/popover-trigger.d.mts.map +1 -1
  757. package/dist/popover/popover-trigger.mjs +14 -9
  758. package/dist/popover/popover-trigger.mjs.map +1 -1
  759. package/dist/progress/index.d.mts +26 -0
  760. package/dist/progress/index.d.mts.map +1 -0
  761. package/dist/progress/index.mjs +26 -0
  762. package/dist/progress/index.mjs.map +1 -0
  763. package/dist/progress/progress-context.mjs +13 -0
  764. package/dist/progress/progress-context.mjs.map +1 -0
  765. package/dist/progress/progress-indicator.d.mts +30 -0
  766. package/dist/progress/progress-indicator.d.mts.map +1 -0
  767. package/dist/progress/progress-indicator.mjs +31 -0
  768. package/dist/progress/progress-indicator.mjs.map +1 -0
  769. package/dist/progress/progress-label.d.mts +30 -0
  770. package/dist/progress/progress-label.d.mts.map +1 -0
  771. package/dist/progress/progress-label.mjs +32 -0
  772. package/dist/progress/progress-label.mjs.map +1 -0
  773. package/dist/progress/progress-root.d.mts +96 -0
  774. package/dist/progress/progress-root.d.mts.map +1 -0
  775. package/dist/progress/progress-root.mjs +82 -0
  776. package/dist/progress/progress-root.mjs.map +1 -0
  777. package/dist/progress/progress-track.d.mts +30 -0
  778. package/dist/progress/progress-track.d.mts.map +1 -0
  779. package/dist/progress/progress-track.mjs +31 -0
  780. package/dist/progress/progress-track.mjs.map +1 -0
  781. package/dist/progress/progress-value.d.mts +34 -0
  782. package/dist/progress/progress-value.d.mts.map +1 -0
  783. package/dist/progress/progress-value.mjs +35 -0
  784. package/dist/progress/progress-value.mjs.map +1 -0
  785. package/dist/radio-group/index.d.mts +2 -0
  786. package/dist/radio-group/index.d.mts.map +1 -1
  787. package/dist/radio-group/index.mjs +2 -0
  788. package/dist/radio-group/index.mjs.map +1 -1
  789. package/dist/radio-group/radio-group-context.mjs.map +1 -1
  790. package/dist/radio-group/radio-group-item.d.mts +21 -5
  791. package/dist/radio-group/radio-group-item.d.mts.map +1 -1
  792. package/dist/radio-group/radio-group-item.mjs +22 -25
  793. package/dist/radio-group/radio-group-item.mjs.map +1 -1
  794. package/dist/radio-group/radio-group-label.d.mts +10 -0
  795. package/dist/radio-group/radio-group-label.d.mts.map +1 -1
  796. package/dist/radio-group/radio-group-label.mjs +3 -6
  797. package/dist/radio-group/radio-group-label.mjs.map +1 -1
  798. package/dist/radio-group/radio-group-root.d.mts +34 -8
  799. package/dist/radio-group/radio-group-root.d.mts.map +1 -1
  800. package/dist/radio-group/radio-group-root.mjs +48 -39
  801. package/dist/radio-group/radio-group-root.mjs.map +1 -1
  802. package/dist/select/index.d.mts +2 -0
  803. package/dist/select/index.d.mts.map +1 -1
  804. package/dist/select/index.mjs +2 -0
  805. package/dist/select/index.mjs.map +1 -1
  806. package/dist/select/select-dom.mjs +9 -18
  807. package/dist/select/select-dom.mjs.map +1 -1
  808. package/dist/select/select-group-label.d.mts +10 -0
  809. package/dist/select/select-group-label.d.mts.map +1 -1
  810. package/dist/select/select-group-label.mjs +5 -1
  811. package/dist/select/select-group-label.mjs.map +1 -1
  812. package/dist/select/select-group.d.mts +15 -1
  813. package/dist/select/select-group.d.mts.map +1 -1
  814. package/dist/select/select-group.mjs +8 -4
  815. package/dist/select/select-group.mjs.map +1 -1
  816. package/dist/select/select-option.d.mts +19 -1
  817. package/dist/select/select-option.d.mts.map +1 -1
  818. package/dist/select/select-option.mjs +4 -2
  819. package/dist/select/select-option.mjs.map +1 -1
  820. package/dist/select/select-root.d.mts +28 -3
  821. package/dist/select/select-root.d.mts.map +1 -1
  822. package/dist/select/select-root.mjs +39 -12
  823. package/dist/select/select-root.mjs.map +1 -1
  824. package/dist/select/select-separator.d.mts +9 -0
  825. package/dist/select/select-separator.d.mts.map +1 -1
  826. package/dist/select/select-separator.mjs +2 -0
  827. package/dist/select/select-separator.mjs.map +1 -1
  828. package/dist/select/select-trigger.d.mts +9 -0
  829. package/dist/select/select-trigger.d.mts.map +1 -1
  830. package/dist/select/select-trigger.mjs +5 -1
  831. package/dist/select/select-trigger.mjs.map +1 -1
  832. package/dist/select/select-value.d.mts +9 -0
  833. package/dist/select/select-value.d.mts.map +1 -1
  834. package/dist/select/select-value.mjs +5 -6
  835. package/dist/select/select-value.mjs.map +1 -1
  836. package/dist/separator/index.d.mts +3 -0
  837. package/dist/separator/index.mjs +1 -0
  838. package/dist/separator/separator.d.mts +58 -0
  839. package/dist/separator/separator.d.mts.map +1 -0
  840. package/dist/separator/separator.mjs +41 -0
  841. package/dist/separator/separator.mjs.map +1 -0
  842. package/dist/slider/index.d.mts +34 -0
  843. package/dist/slider/index.d.mts.map +1 -0
  844. package/dist/slider/index.mjs +29 -0
  845. package/dist/slider/index.mjs.map +1 -0
  846. package/dist/slider/slider-arithmetic.mjs +165 -0
  847. package/dist/slider/slider-arithmetic.mjs.map +1 -0
  848. package/dist/slider/slider-context.mjs +13 -0
  849. package/dist/slider/slider-context.mjs.map +1 -0
  850. package/dist/slider/slider-indicator.d.mts +34 -0
  851. package/dist/slider/slider-indicator.d.mts.map +1 -0
  852. package/dist/slider/slider-indicator.mjs +38 -0
  853. package/dist/slider/slider-indicator.mjs.map +1 -0
  854. package/dist/slider/slider-label.d.mts +33 -0
  855. package/dist/slider/slider-label.d.mts.map +1 -0
  856. package/dist/slider/slider-label.mjs +40 -0
  857. package/dist/slider/slider-label.mjs.map +1 -0
  858. package/dist/slider/slider-root.d.mts +155 -0
  859. package/dist/slider/slider-root.d.mts.map +1 -0
  860. package/dist/slider/slider-root.mjs +434 -0
  861. package/dist/slider/slider-root.mjs.map +1 -0
  862. package/dist/slider/slider-thumb.d.mts +87 -0
  863. package/dist/slider/slider-thumb.d.mts.map +1 -0
  864. package/dist/slider/slider-thumb.mjs +150 -0
  865. package/dist/slider/slider-thumb.mjs.map +1 -0
  866. package/dist/slider/slider-track.d.mts +46 -0
  867. package/dist/slider/slider-track.d.mts.map +1 -0
  868. package/dist/slider/slider-track.mjs +57 -0
  869. package/dist/slider/slider-track.mjs.map +1 -0
  870. package/dist/slider/slider-value.d.mts +45 -0
  871. package/dist/slider/slider-value.d.mts.map +1 -0
  872. package/dist/slider/slider-value.mjs +41 -0
  873. package/dist/slider/slider-value.mjs.map +1 -0
  874. package/dist/slider/use-slider-dev-warnings.mjs +29 -0
  875. package/dist/slider/use-slider-dev-warnings.mjs.map +1 -0
  876. package/dist/slider/use-thumb-registry.mjs +51 -0
  877. package/dist/slider/use-thumb-registry.mjs.map +1 -0
  878. package/dist/switch/switch.d.mts +30 -9
  879. package/dist/switch/switch.d.mts.map +1 -1
  880. package/dist/switch/switch.mjs +24 -46
  881. package/dist/switch/switch.mjs.map +1 -1
  882. package/dist/tabs/index.d.mts +2 -0
  883. package/dist/tabs/index.d.mts.map +1 -1
  884. package/dist/tabs/index.mjs +2 -0
  885. package/dist/tabs/index.mjs.map +1 -1
  886. package/dist/tabs/tabs-context.d.mts +7 -3
  887. package/dist/tabs/tabs-context.d.mts.map +1 -1
  888. package/dist/tabs/tabs-context.mjs.map +1 -1
  889. package/dist/tabs/tabs-indicator.d.mts +17 -0
  890. package/dist/tabs/tabs-indicator.d.mts.map +1 -1
  891. package/dist/tabs/tabs-indicator.mjs +4 -1
  892. package/dist/tabs/tabs-indicator.mjs.map +1 -1
  893. package/dist/tabs/tabs-list.d.mts +19 -1
  894. package/dist/tabs/tabs-list.d.mts.map +1 -1
  895. package/dist/tabs/tabs-list.mjs +12 -23
  896. package/dist/tabs/tabs-list.mjs.map +1 -1
  897. package/dist/tabs/tabs-panel.d.mts +22 -4
  898. package/dist/tabs/tabs-panel.d.mts.map +1 -1
  899. package/dist/tabs/tabs-panel.mjs +4 -2
  900. package/dist/tabs/tabs-panel.mjs.map +1 -1
  901. package/dist/tabs/tabs-root.d.mts +43 -8
  902. package/dist/tabs/tabs-root.d.mts.map +1 -1
  903. package/dist/tabs/tabs-root.mjs +23 -10
  904. package/dist/tabs/tabs-root.mjs.map +1 -1
  905. package/dist/tabs/tabs-tab.d.mts +25 -5
  906. package/dist/tabs/tabs-tab.d.mts.map +1 -1
  907. package/dist/tabs/tabs-tab.mjs +5 -2
  908. package/dist/tabs/tabs-tab.mjs.map +1 -1
  909. package/dist/{internal → tabs}/use-until-found.mjs +1 -1
  910. package/dist/tabs/use-until-found.mjs.map +1 -0
  911. package/dist/toast/index.d.mts +27 -0
  912. package/dist/toast/index.d.mts.map +1 -0
  913. package/dist/toast/index.mjs +28 -0
  914. package/dist/toast/index.mjs.map +1 -0
  915. package/dist/toast/toast-action.d.mts +86 -0
  916. package/dist/toast/toast-action.d.mts.map +1 -0
  917. package/dist/toast/toast-action.mjs +81 -0
  918. package/dist/toast/toast-action.mjs.map +1 -0
  919. package/dist/toast/toast-close.d.mts +52 -0
  920. package/dist/toast/toast-close.d.mts.map +1 -0
  921. package/dist/toast/toast-close.mjs +53 -0
  922. package/dist/toast/toast-close.mjs.map +1 -0
  923. package/dist/toast/toast-context.mjs +19 -0
  924. package/dist/toast/toast-context.mjs.map +1 -0
  925. package/dist/toast/toast-description.d.mts +39 -0
  926. package/dist/toast/toast-description.d.mts.map +1 -0
  927. package/dist/toast/toast-description.mjs +37 -0
  928. package/dist/toast/toast-description.mjs.map +1 -0
  929. package/dist/toast/toast-hotkey.mjs +27 -0
  930. package/dist/toast/toast-hotkey.mjs.map +1 -0
  931. package/dist/toast/toast-queue.mjs +137 -0
  932. package/dist/toast/toast-queue.mjs.map +1 -0
  933. package/dist/toast/toast-root.d.mts +63 -0
  934. package/dist/toast/toast-root.d.mts.map +1 -0
  935. package/dist/toast/toast-root.mjs +209 -0
  936. package/dist/toast/toast-root.mjs.map +1 -0
  937. package/dist/toast/toast-timers.mjs +65 -0
  938. package/dist/toast/toast-timers.mjs.map +1 -0
  939. package/dist/toast/toast-title.d.mts +38 -0
  940. package/dist/toast/toast-title.d.mts.map +1 -0
  941. package/dist/toast/toast-title.mjs +35 -0
  942. package/dist/toast/toast-title.mjs.map +1 -0
  943. package/dist/toast/toast-viewport.d.mts +81 -0
  944. package/dist/toast/toast-viewport.d.mts.map +1 -0
  945. package/dist/toast/toast-viewport.mjs +345 -0
  946. package/dist/toast/toast-viewport.mjs.map +1 -0
  947. package/dist/toast/toast.d.mts +162 -0
  948. package/dist/toast/toast.d.mts.map +1 -0
  949. package/dist/toast/toast.mjs +161 -0
  950. package/dist/toast/toast.mjs.map +1 -0
  951. package/dist/toast/use-modal-portal-host.mjs +52 -0
  952. package/dist/toast/use-modal-portal-host.mjs.map +1 -0
  953. package/dist/toast/use-toast-announcements.mjs +46 -0
  954. package/dist/toast/use-toast-announcements.mjs.map +1 -0
  955. package/dist/toast/use-toast-focus.mjs +75 -0
  956. package/dist/toast/use-toast-focus.mjs.map +1 -0
  957. package/dist/toast/use-toast-pauses.mjs +58 -0
  958. package/dist/toast/use-toast-pauses.mjs.map +1 -0
  959. package/dist/toggle/toggle.d.mts +26 -6
  960. package/dist/toggle/toggle.d.mts.map +1 -1
  961. package/dist/toggle/toggle.mjs +12 -6
  962. package/dist/toggle/toggle.mjs.map +1 -1
  963. package/dist/toggle-group/index.d.mts +18 -0
  964. package/dist/toggle-group/index.d.mts.map +1 -0
  965. package/dist/toggle-group/index.mjs +17 -0
  966. package/dist/toggle-group/index.mjs.map +1 -0
  967. package/dist/toggle-group/toggle-group-context.d.mts +6 -0
  968. package/dist/toggle-group/toggle-group-context.d.mts.map +1 -0
  969. package/dist/toggle-group/toggle-group-context.mjs +13 -0
  970. package/dist/toggle-group/toggle-group-context.mjs.map +1 -0
  971. package/dist/toggle-group/toggle-group-item.d.mts +71 -0
  972. package/dist/toggle-group/toggle-group-item.d.mts.map +1 -0
  973. package/dist/toggle-group/toggle-group-item.mjs +69 -0
  974. package/dist/toggle-group/toggle-group-item.mjs.map +1 -0
  975. package/dist/toggle-group/toggle-group-root.d.mts +156 -0
  976. package/dist/toggle-group/toggle-group-root.d.mts.map +1 -0
  977. package/dist/toggle-group/toggle-group-root.mjs +177 -0
  978. package/dist/toggle-group/toggle-group-root.mjs.map +1 -0
  979. package/dist/toolbar/index.d.mts +19 -0
  980. package/dist/toolbar/index.d.mts.map +1 -0
  981. package/dist/toolbar/index.mjs +19 -0
  982. package/dist/toolbar/index.mjs.map +1 -0
  983. package/dist/toolbar/toolbar-root.d.mts +65 -0
  984. package/dist/toolbar/toolbar-root.d.mts.map +1 -0
  985. package/dist/toolbar/toolbar-root.mjs +67 -0
  986. package/dist/toolbar/toolbar-root.mjs.map +1 -0
  987. package/dist/toolbar/toolbar-separator.d.mts +38 -0
  988. package/dist/toolbar/toolbar-separator.d.mts.map +1 -0
  989. package/dist/toolbar/toolbar-separator.mjs +33 -0
  990. package/dist/toolbar/toolbar-separator.mjs.map +1 -0
  991. package/dist/tooltip/index.d.mts +10 -5
  992. package/dist/tooltip/index.d.mts.map +1 -1
  993. package/dist/tooltip/index.mjs +8 -3
  994. package/dist/tooltip/index.mjs.map +1 -1
  995. package/dist/tooltip/tooltip-arrow.d.mts +46 -0
  996. package/dist/tooltip/tooltip-arrow.d.mts.map +1 -0
  997. package/dist/tooltip/tooltip-arrow.mjs +47 -0
  998. package/dist/tooltip/tooltip-arrow.mjs.map +1 -0
  999. package/dist/tooltip/tooltip-context.d.mts +11 -0
  1000. package/dist/tooltip/tooltip-context.d.mts.map +1 -1
  1001. package/dist/tooltip/tooltip-context.mjs +2 -1
  1002. package/dist/tooltip/tooltip-context.mjs.map +1 -1
  1003. package/dist/tooltip/tooltip-popup.d.mts +49 -7
  1004. package/dist/tooltip/tooltip-popup.d.mts.map +1 -1
  1005. package/dist/tooltip/tooltip-popup.mjs +37 -15
  1006. package/dist/tooltip/tooltip-popup.mjs.map +1 -1
  1007. package/dist/tooltip/tooltip-root.d.mts +24 -2
  1008. package/dist/tooltip/tooltip-root.d.mts.map +1 -1
  1009. package/dist/tooltip/tooltip-root.mjs +29 -6
  1010. package/dist/tooltip/tooltip-root.mjs.map +1 -1
  1011. package/dist/tooltip/tooltip-trigger.d.mts +28 -3
  1012. package/dist/tooltip/tooltip-trigger.d.mts.map +1 -1
  1013. package/dist/tooltip/tooltip-trigger.mjs +26 -6
  1014. package/dist/tooltip/tooltip-trigger.mjs.map +1 -1
  1015. package/dist/tooltip/tooltip-warm.mjs +29 -0
  1016. package/dist/tooltip/tooltip-warm.mjs.map +1 -0
  1017. package/dist/tooltip/use-tooltip-interaction.mjs +128 -77
  1018. package/dist/tooltip/use-tooltip-interaction.mjs.map +1 -1
  1019. package/package.json +30 -2
  1020. package/skills/funstack-ui-knowledge/SKILL.md +84 -0
  1021. package/dist/accordion/accordion-context.d.mts +0 -5
  1022. package/dist/accordion/accordion-context.d.mts.map +0 -1
  1023. package/dist/internal/action-details.mjs.map +0 -1
  1024. package/dist/internal/anchor-position.d.mts +0 -7
  1025. package/dist/internal/anchor-position.d.mts.map +0 -1
  1026. package/dist/internal/anchor-position.mjs +0 -16
  1027. package/dist/internal/anchor-position.mjs.map +0 -1
  1028. package/dist/internal/sync-presence.mjs.map +0 -1
  1029. package/dist/internal/use-action-trigger.mjs +0 -58
  1030. package/dist/internal/use-action-trigger.mjs.map +0 -1
  1031. package/dist/internal/use-controllable-action.mjs +0 -119
  1032. package/dist/internal/use-controllable-action.mjs.map +0 -1
  1033. package/dist/internal/use-exit-animation.mjs.map +0 -1
  1034. package/dist/internal/use-form-reset.mjs +0 -54
  1035. package/dist/internal/use-form-reset.mjs.map +0 -1
  1036. package/dist/internal/use-native-checked.mjs.map +0 -1
  1037. package/dist/internal/use-native-group-reconciliation.mjs.map +0 -1
  1038. package/dist/internal/use-native-select-value.mjs.map +0 -1
  1039. package/dist/internal/use-popover-popup.mjs +0 -274
  1040. package/dist/internal/use-popover-popup.mjs.map +0 -1
  1041. package/dist/internal/use-popover-root.d.mts +0 -2
  1042. package/dist/internal/use-popover-root.mjs +0 -112
  1043. package/dist/internal/use-popover-root.mjs.map +0 -1
  1044. package/dist/internal/use-popover-trigger.mjs +0 -86
  1045. package/dist/internal/use-popover-trigger.mjs.map +0 -1
  1046. package/dist/internal/use-until-found.mjs.map +0 -1
@@ -0,0 +1,345 @@
1
+ "use client";
2
+ import { createActionDetails } from "../internal/action/action-details.mjs";
3
+ import { dataAttr } from "../internal/data-attr.mjs";
4
+ import { useDevWarning } from "../internal/use-dev-warning.mjs";
5
+ import { useRender } from "../internal/use-render.mjs";
6
+ import { useLatest } from "../internal/use-latest.mjs";
7
+ import { isPopoverOpen } from "../internal/overlay/popover-open.mjs";
8
+ import { animationBaseline } from "../internal/overlay/use-exit-animation.mjs";
9
+ import { callUrgentHandler } from "../internal/action/call-urgent-handler.mjs";
10
+ import { DialogContext } from "../dialog/dialog-context.mjs";
11
+ import { ToastViewportContext } from "./toast-context.mjs";
12
+ import { toast, toastManagerInternals } from "./toast.mjs";
13
+ import { DEFAULT_HOTKEY, regionLabel } from "./toast-hotkey.mjs";
14
+ import { clearToastTimers, syncToastTimers } from "./toast-timers.mjs";
15
+ import { applyCommands, makeEntry, partition, withFlags } from "./toast-queue.mjs";
16
+ import { useModalPortalHost } from "./use-modal-portal-host.mjs";
17
+ import { useToastAnnouncements } from "./use-toast-announcements.mjs";
18
+ import { useToastFocus, useToastHotkey } from "./use-toast-focus.mjs";
19
+ import { useToastPauses } from "./use-toast-pauses.mjs";
20
+ import { use, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
21
+ import { createPortal } from "react-dom";
22
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
23
+ //#region src/toast/toast-viewport.tsx
24
+ const isDev = process.env.NODE_ENV !== "production";
25
+ /**
26
+ * The toast region: a `<section popover="manual">` named "Notifications (F8)", shown in the top
27
+ * layer while it has toasts. Owns the queue (urgent state fed by `toast()`), the timers and their
28
+ * pausing, the hotkey, focus return, announcements through `document.ariaNotify()`, and the move
29
+ * into the topmost open modal `Dialog` (a region outside it would be inert).
30
+ *
31
+ * Owned keys (conventions 1.2): `popover`, `aria-label` (the consumer's own `aria-label` wins
32
+ * verbatim), `data-paused`, `data-empty`, and the pointer / focus handlers.
33
+ *
34
+ * @see https://ui.funstack.work/components/toast
35
+ */
36
+ function ToastViewport({ manager = toast, limit = 3, duration = 5e3, hotkey = DEFAULT_HOTKEY, announce, children, className, style, render, ...rest }) {
37
+ const [entries, setEntries] = useState([]);
38
+ const entriesRef = useRef(entries);
39
+ const listener = useRef(null);
40
+ listener.current ??= {
41
+ restore: (toasts) => handlers.current.restore(toasts),
42
+ apply: (commands) => handlers.current.apply(commands),
43
+ retain: () => handlers.current.retain()
44
+ };
45
+ const [rejected, setRejected] = useState(() => toastManagerInternals(manager).isTaken(listener.current));
46
+ const [duplicate, setDuplicate] = useState(false);
47
+ const regionRef = useRef(null);
48
+ const roots = useRef(/* @__PURE__ */ new Map());
49
+ const suspended = useRef(/* @__PURE__ */ new Set());
50
+ const timers = useRef(/* @__PURE__ */ new Map());
51
+ const pauses = useToastPauses(() => syncTimers());
52
+ const { paused, setPause, watch } = pauses;
53
+ const focus = useToastFocus({
54
+ entriesRef,
55
+ roots,
56
+ regionRef
57
+ });
58
+ const { returnTargetRef, sortedRoots, moveFocusOut } = focus;
59
+ const { lastAnnouncedRef, queueAnnouncement, announceQueued } = useToastAnnouncements(regionRef);
60
+ /** Per closing toast: the animations already running before `data-ending` applied. */
61
+ const exitBaselines = useRef(/* @__PURE__ */ new Map());
62
+ const addedSinceEffect = useRef(false);
63
+ const mounted = useRef(false);
64
+ const latest = useLatest({
65
+ limit,
66
+ duration,
67
+ hotkey,
68
+ announce
69
+ });
70
+ const write = (next) => {
71
+ entriesRef.current = next;
72
+ setEntries(next);
73
+ };
74
+ const syncTimers = () => {
75
+ syncToastTimers(timers.current, partition(entriesRef.current, latest.current.limit).visible, {
76
+ halted: !mounted.current || pauses.anyHeld(),
77
+ suspended: suspended.current,
78
+ defaultDuration: latest.current.duration,
79
+ expire: (id) => close([id], "timeout", void 0)
80
+ });
81
+ };
82
+ /**
83
+ * Records the animations running in each closing toast before `data-ending` applies: the exit
84
+ * waits only for the ones the ending state started, not for a running progress bar.
85
+ */
86
+ const snapshotExitBaselines = (ids) => {
87
+ for (const id of ids) {
88
+ const element = roots.current.get(id);
89
+ if (element === void 0) continue;
90
+ exitBaselines.current.set(id, animationBaseline(element));
91
+ }
92
+ };
93
+ /**
94
+ * A toast's `onClose` (#148: a handler, not an action): called synchronously where the close is
95
+ * applied to the queue, after the entry is marked ending, outside any transition, and not
96
+ * awaited (`callUrgentHandler`: a throw or a returned promise's rejection goes to
97
+ * `reportError`, the queue write above stands).
98
+ */
99
+ const callCloseHandlers = (closed, reason, event) => {
100
+ for (const entry of closed) {
101
+ const onClose = entry.options.onClose;
102
+ if (onClose === void 0) continue;
103
+ callUrgentHandler(onClose, createActionDetails(event, {
104
+ id: entry.options.id,
105
+ reason
106
+ }));
107
+ }
108
+ };
109
+ const close = (ids, reason, event) => {
110
+ const wanted = new Set(ids);
111
+ const closing = entriesRef.current.filter((e) => !e.ending && wanted.has(e.options.id));
112
+ if (closing.length === 0) return;
113
+ const closingIds = new Set(closing.map((e) => e.options.id));
114
+ moveFocusOut(closingIds);
115
+ snapshotExitBaselines(closingIds);
116
+ write(entriesRef.current.map((e) => closingIds.has(e.options.id) ? withFlags(e, { ending: true }) : e));
117
+ syncTimers();
118
+ callCloseHandlers(closing, reason, event);
119
+ };
120
+ const drop = (id) => {
121
+ const next = entriesRef.current.filter((e) => !(e.ending && e.options.id === id));
122
+ if (next.length === entriesRef.current.length) return;
123
+ lastAnnouncedRef.current.delete(id);
124
+ exitBaselines.current.delete(id);
125
+ write(next);
126
+ };
127
+ const apply = (commands) => {
128
+ const result = applyCommands(entriesRef.current, commands, (id) => roots.current.has(id));
129
+ for (const id of result.replaced) clearToastTimers(timers.current, id);
130
+ for (const id of result.forgotten) {
131
+ lastAnnouncedRef.current.delete(id);
132
+ exitBaselines.current.delete(id);
133
+ }
134
+ if (result.added) addedSinceEffect.current = true;
135
+ if (isDev) for (const id of result.missing) console.error(`toast.update: no toast with id "${id}"; the update is ignored.`);
136
+ if (result.dismissed.length === 0) {
137
+ write(result.next);
138
+ return;
139
+ }
140
+ moveFocusOut(result.leaving);
141
+ snapshotExitBaselines(result.leaving);
142
+ write(result.next);
143
+ syncTimers();
144
+ callCloseHandlers(result.dismissed, "dismiss", void 0);
145
+ };
146
+ const setActionPending = (id, pending) => {
147
+ const index = entriesRef.current.findIndex((e) => e.options.id === id);
148
+ if (index === -1) return;
149
+ const entry = entriesRef.current[index];
150
+ if (entry.actionPending === pending) return;
151
+ const next = [...entriesRef.current];
152
+ next[index] = withFlags(entry, { actionPending: pending });
153
+ write(next);
154
+ };
155
+ const restore = (toasts) => {
156
+ if (entriesRef.current.length > 0) return;
157
+ for (const t of toasts) if (t.announced !== void 0) lastAnnouncedRef.current.set(t.options.id, t.announced);
158
+ write(toasts.map((t) => makeEntry(t.options, {
159
+ promisePending: t.pending,
160
+ actionPending: false,
161
+ ending: false
162
+ })));
163
+ addedSinceEffect.current = true;
164
+ };
165
+ const retain = () => {
166
+ const announced = lastAnnouncedRef.current;
167
+ return entriesRef.current.filter((e) => !e.ending).map((e) => ({
168
+ options: e.options,
169
+ pending: e.promisePending,
170
+ announced: announced.has(e.options.id) ? announced.get(e.options.id) : void 0
171
+ }));
172
+ };
173
+ /** Forgets the queue of the previous manager (its own copy is retained by that manager). */
174
+ const reset = () => {
175
+ moveFocusOut(new Set(entriesRef.current.filter((e) => !e.ending).map((e) => e.options.id)));
176
+ clearToastTimers(timers.current);
177
+ lastAnnouncedRef.current.clear();
178
+ exitBaselines.current.clear();
179
+ write([]);
180
+ };
181
+ const handlers = useLatest({
182
+ apply,
183
+ restore,
184
+ retain,
185
+ reset,
186
+ close,
187
+ drop,
188
+ setActionPending,
189
+ queueAnnouncement,
190
+ syncTimers
191
+ });
192
+ const context = useMemo(() => ({
193
+ close: (ids, reason, event) => handlers.current.close(ids, reason, event),
194
+ drop: (id) => handlers.current.drop(id),
195
+ setActionPending: (id, pending) => handlers.current.setActionPending(id, pending),
196
+ setSuspended: (id, value) => {
197
+ if (value) suspended.current.add(id);
198
+ else suspended.current.delete(id);
199
+ handlers.current.syncTimers();
200
+ },
201
+ registerRoot: (id, element) => {
202
+ if (element === null) roots.current.delete(id);
203
+ else roots.current.set(id, element);
204
+ },
205
+ focusSibling: (id, direction) => {
206
+ const all = sortedRoots();
207
+ const index = all.findIndex((r) => r.id === id);
208
+ if (index === -1) return;
209
+ all[index + direction]?.element.focus();
210
+ },
211
+ announce: (id, text, priority) => handlers.current.queueAnnouncement(id, text, priority),
212
+ exitBaseline: (id) => exitBaselines.current.get(id),
213
+ announcer: () => latest.current.announce
214
+ }), [handlers, latest]);
215
+ const subscribedManager = useRef(null);
216
+ useEffect(() => {
217
+ if (subscribedManager.current !== null && subscribedManager.current !== manager) handlers.current.reset();
218
+ subscribedManager.current = manager;
219
+ const unsubscribe = toastManagerInternals(manager).subscribe(listener.current);
220
+ if (unsubscribe === null) {
221
+ setRejected(true);
222
+ setDuplicate(true);
223
+ return;
224
+ }
225
+ setRejected(false);
226
+ setDuplicate(false);
227
+ return unsubscribe;
228
+ }, [manager, handlers]);
229
+ useEffect(() => {
230
+ if (rejected) return;
231
+ mounted.current = true;
232
+ const doc = regionRef.current?.ownerDocument ?? document;
233
+ const unwatch = watch(doc);
234
+ handlers.current.syncTimers();
235
+ const map = timers.current;
236
+ return () => {
237
+ mounted.current = false;
238
+ unwatch();
239
+ clearToastTimers(map);
240
+ };
241
+ }, [
242
+ handlers,
243
+ rejected,
244
+ watch
245
+ ]);
246
+ useToastHotkey({
247
+ hotkey,
248
+ rejected,
249
+ regionRef,
250
+ focus
251
+ });
252
+ const { portalled, host, anchorRef } = useModalPortalHost(() => setPause("hover", false));
253
+ useLayoutEffect(() => {
254
+ const region = regionRef.current;
255
+ const current = entriesRef.current;
256
+ if (pauses.holding("focus") && (region === null || !region.contains(region.ownerDocument.activeElement))) {
257
+ returnTargetRef.current = null;
258
+ setPause("focus", false);
259
+ }
260
+ if (region !== null && region.isConnected && region.hasAttribute("popover")) {
261
+ const open = isPopoverOpen(region);
262
+ try {
263
+ if (current.length > 0) {
264
+ if (!open) region.showPopover();
265
+ else if (addedSinceEffect.current) {
266
+ region.hidePopover();
267
+ region.showPopover();
268
+ }
269
+ } else if (open) region.hidePopover();
270
+ } catch {}
271
+ }
272
+ if (current.length === 0 && pauses.holding("hover")) setPause("hover", false);
273
+ addedSinceEffect.current = false;
274
+ const { visible, queued } = partition(current, latest.current.limit);
275
+ announceQueued(queued, latest.current.announce);
276
+ for (const entry of visible) if (entry.ending && !roots.current.has(entry.options.id)) drop(entry.options.id);
277
+ syncTimers();
278
+ });
279
+ useDevWarning(duplicate, isDev && "Toast.Viewport: another Toast.Viewport already renders this manager; this one renders nothing. Use one Viewport per manager, or `createToastManager()` for a second queue.");
280
+ const insideDialog = use(DialogContext) !== null;
281
+ useDevWarning(insideDialog, isDev && "Toast.Viewport: rendered inside a Dialog. The region would close with the dialog; render the Viewport once near the root of the app (it moves into open modal Dialogs by itself).");
282
+ const { visible, queued } = partition(entries, limit);
283
+ const state = {
284
+ toasts: visible.map((e) => e.item),
285
+ queued: queued.length,
286
+ paused
287
+ };
288
+ const regionCallbackRef = useCallback((element) => {
289
+ regionRef.current = element;
290
+ return () => {
291
+ if (regionRef.current === element) regionRef.current = null;
292
+ };
293
+ }, []);
294
+ const onPointerEnter = () => setPause("hover", true);
295
+ const onPointerLeave = () => setPause("hover", false);
296
+ const onFocus = (event) => {
297
+ const region = event.currentTarget;
298
+ const from = event.relatedTarget;
299
+ if (!(from instanceof Node) || !region.contains(from)) returnTargetRef.current ??= from instanceof HTMLElement ? from : null;
300
+ setPause("focus", true);
301
+ };
302
+ const onBlur = (event) => {
303
+ const to = event.relatedTarget;
304
+ if (to instanceof Node && event.currentTarget.contains(to)) return;
305
+ returnTargetRef.current = null;
306
+ setPause("focus", false);
307
+ };
308
+ const libraryProps = {
309
+ popover: "manual",
310
+ "aria-label": rest["aria-label"] ?? regionLabel(hotkey),
311
+ "data-paused": dataAttr(paused),
312
+ "data-empty": dataAttr(state.toasts.length === 0),
313
+ onPointerEnter,
314
+ onPointerLeave,
315
+ onFocus,
316
+ onBlur
317
+ };
318
+ const region = useRender({
319
+ defaultElement: "section",
320
+ render,
321
+ state,
322
+ className,
323
+ style,
324
+ children,
325
+ props: rest,
326
+ libraryProps,
327
+ ref: regionCallbackRef
328
+ });
329
+ if (rejected) return null;
330
+ const content = /* @__PURE__ */ jsx(ToastViewportContext, {
331
+ value: context,
332
+ children: region
333
+ });
334
+ if (!portalled || host === null) return content;
335
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
336
+ ref: anchorRef,
337
+ style: ANCHOR_STYLE
338
+ }), createPortal(content, host)] });
339
+ }
340
+ const ANCHOR_STYLE = { display: "contents" };
341
+ ToastViewport.displayName = "ToastViewport";
342
+ //#endregion
343
+ export { ToastViewport };
344
+
345
+ //# sourceMappingURL=toast-viewport.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast-viewport.mjs","names":["defaultManager"],"sources":["../../src/toast/toast-viewport.tsx"],"sourcesContent":["\"use client\";\nimport { use, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, FocusEvent, ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { DialogContext } from \"../dialog/dialog-context.js\";\nimport { createActionDetails } from \"../internal/action/action-details.js\";\nimport { callUrgentHandler } from \"../internal/action/call-urgent-handler.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { isPopoverOpen } from \"../internal/overlay/popover-open.js\";\nimport type { ChangeReason, RenderProp, StateValue } from \"../internal/types.js\";\nimport { useDevWarning } from \"../internal/use-dev-warning.js\";\nimport { animationBaseline } from \"../internal/overlay/use-exit-animation.js\";\nimport { useLatest } from \"../internal/use-latest.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { toast as defaultManager, toastManagerInternals } from \"./toast.js\";\nimport type {\n RetainedToast,\n ToastCommand,\n ToastItem,\n ToastListener,\n ToastManager,\n} from \"./toast.js\";\nimport { ToastViewportContext } from \"./toast-context.js\";\nimport type { ToastViewportContextValue } from \"./toast-context.js\";\nimport { DEFAULT_HOTKEY, regionLabel } from \"./toast-hotkey.js\";\nimport { clearToastTimers, syncToastTimers } from \"./toast-timers.js\";\nimport type { ToastTimer } from \"./toast-timers.js\";\nimport { applyCommands, makeEntry, partition, withFlags } from \"./toast-queue.js\";\nimport type { Entry } from \"./toast-queue.js\";\nimport { useModalPortalHost } from \"./use-modal-portal-host.js\";\nimport { useToastAnnouncements } from \"./use-toast-announcements.js\";\nimport { useToastFocus, useToastHotkey } from \"./use-toast-focus.js\";\nimport { useToastPauses } from \"./use-toast-pauses.js\";\n\n/**\n * State of `Toast.Viewport`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface ToastViewportState {\n /** Rendered toasts, chronological (oldest first), exiting ones included. */\n readonly toasts: readonly ToastItem[];\n /** Toasts waiting beyond `limit`. */\n readonly queued: number;\n /** A viewport-wide pause holds (pointer over the region, focus inside, hidden document, blurred window). */\n readonly paused: boolean;\n}\n\n/**\n * Props of `Toast.Viewport`.\n *\n * @see https://ui.funstack.work/components/toast\n */\nexport interface ToastViewportProps extends Omit<\n ComponentPropsWithRef<\"section\">,\n | \"popover\"\n | \"className\"\n | \"style\"\n | \"children\"\n | \"onPointerEnter\"\n | \"onPointerLeave\"\n | \"onFocus\"\n | \"onBlur\"\n | \"onKeyDown\"\n> {\n /**\n * The queue to render (from `createToastManager()`).\n *\n * @defaultValue the module-level `toast`\n */\n manager?: ToastManager;\n /**\n * Toasts rendered at once; further ones wait in order (never dropped).\n *\n * @defaultValue `3`\n */\n limit?: number;\n /**\n * Default `duration` of a toast in milliseconds; `null` for persistent.\n *\n * @defaultValue `5000`\n */\n duration?: number | null;\n /**\n * Keys that focus the newest toast: `event.code` values and modifier names (`\"altKey\"`,\n * `\"ctrlKey\"`, `\"metaKey\"`, `\"shiftKey\"`), all of which must match, with no other modifier\n * held. `null` installs no listener.\n *\n * @defaultValue `[\"F8\"]`\n */\n hotkey?: readonly string[] | null;\n /**\n * The text `document.ariaNotify()` speaks for a toast (localisation); `null` announces nothing.\n * A toast's own `announce` wins.\n *\n * @defaultValue the text of the toast's Title and Description\n */\n announce?: (toast: ToastItem) => string | null;\n /** Usually a function of the state mapping `state.toasts` to `Toast.Root`s. */\n children?: StateValue<ReactNode, ToastViewportState>;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, ToastViewportState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, ToastViewportState>;\n /** Must render an element that can carry `popover` (a `<section>` by default). */\n render?: RenderProp<ComponentPropsWithRef<\"section\">, ToastViewportState>;\n}\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\n/**\n * The toast region: a `<section popover=\"manual\">` named \"Notifications (F8)\", shown in the top\n * layer while it has toasts. Owns the queue (urgent state fed by `toast()`), the timers and their\n * pausing, the hotkey, focus return, announcements through `document.ariaNotify()`, and the move\n * into the topmost open modal `Dialog` (a region outside it would be inert).\n *\n * Owned keys (conventions 1.2): `popover`, `aria-label` (the consumer's own `aria-label` wins\n * verbatim), `data-paused`, `data-empty`, and the pointer / focus handlers.\n *\n * @see https://ui.funstack.work/components/toast\n */\nexport function ToastViewport({\n manager = defaultManager,\n limit = 3,\n duration = 5000,\n hotkey = DEFAULT_HOTKEY,\n announce,\n children,\n className,\n style,\n render,\n ...rest\n}: ToastViewportProps) {\n // --- The queue: urgent state, written only from handlers, microtasks and effects -----------\n const [entries, setEntries] = useState<readonly Entry[]>([]);\n // The latest queue, written together with every `setEntries`: the dispatchers read and write\n // it synchronously so a burst of commands composes (and side effects stay out of updaters).\n const entriesRef = useRef<readonly Entry[]>(entries);\n const listener = useRef<ToastListener | null>(null);\n listener.current ??= {\n restore: (toasts: readonly RetainedToast[]) => handlers.current.restore(toasts),\n apply: (commands: readonly ToastCommand[]) => handlers.current.apply(commands),\n retain: () => handlers.current.retain(),\n };\n // A second Viewport on a taken manager renders nothing from its first render on (the effect\n // below confirms or clears it once the subscription is attempted).\n const [rejected, setRejected] = useState(() =>\n toastManagerInternals(manager).isTaken(listener.current!),\n );\n // The subscription itself was refused: the manager has another Viewport. Not `rejected`, a\n // render-time guess that is also true for the replacement of a Viewport in one commit (a `key`\n // change, a move between parents), rendered while the old instance is still subscribed.\n const [duplicate, setDuplicate] = useState(false);\n\n const regionRef = useRef<HTMLElement | null>(null);\n const roots = useRef(new Map<string, HTMLElement>());\n const suspended = useRef(new Set<string>());\n const timers = useRef(new Map<string, ToastTimer>());\n\n // --- Pause sources, focus, announcements (design 5, 6, 7) ---------------------------------\n // `syncTimers` is declared below; the callback only runs from events and effects, after render.\n const pauses = useToastPauses(() => syncTimers());\n const { paused, setPause, watch } = pauses;\n const focus = useToastFocus({ entriesRef, roots, regionRef });\n const { returnTargetRef, sortedRoots, moveFocusOut } = focus;\n const { lastAnnouncedRef, queueAnnouncement, announceQueued } = useToastAnnouncements(regionRef);\n\n /** Per closing toast: the animations already running before `data-ending` applied. */\n const exitBaselines = useRef(new Map<string, ReadonlySet<Animation>>());\n const addedSinceEffect = useRef(false);\n const mounted = useRef(false);\n\n const latest = useLatest({ limit, duration, hotkey, announce });\n\n const write = (next: readonly Entry[]): void => {\n entriesRef.current = next;\n setEntries(next);\n };\n\n // --- Timers (design 6) ----------------------------------------------------------------------\n\n const syncTimers = (): void => {\n syncToastTimers(timers.current, partition(entriesRef.current, latest.current.limit).visible, {\n halted: !mounted.current || pauses.anyHeld(),\n suspended: suspended.current,\n defaultDuration: latest.current.duration,\n expire: (id) => close([id], \"timeout\", undefined),\n });\n };\n\n // --- Queue writes ---------------------------------------------------------------------------\n\n /**\n * Records the animations running in each closing toast before `data-ending` applies: the exit\n * waits only for the ones the ending state started, not for a running progress bar.\n */\n const snapshotExitBaselines = (ids: Iterable<string>): void => {\n for (const id of ids) {\n const element = roots.current.get(id);\n if (element === undefined) continue;\n exitBaselines.current.set(id, animationBaseline(element));\n }\n };\n\n /**\n * A toast's `onClose` (#148: a handler, not an action): called synchronously where the close is\n * applied to the queue, after the entry is marked ending, outside any transition, and not\n * awaited (`callUrgentHandler`: a throw or a returned promise's rejection goes to\n * `reportError`, the queue write above stands).\n */\n const callCloseHandlers = (\n closed: readonly Entry[],\n reason: ChangeReason,\n event: Event | undefined,\n ): void => {\n for (const entry of closed) {\n const onClose = entry.options.onClose;\n if (onClose === undefined) continue;\n callUrgentHandler(onClose, createActionDetails(event, { id: entry.options.id, reason }));\n }\n };\n\n const close = (ids: readonly string[], reason: ChangeReason, event: Event | undefined): void => {\n const wanted = new Set(ids);\n const closing = entriesRef.current.filter((e) => !e.ending && wanted.has(e.options.id));\n if (closing.length === 0) return;\n const closingIds = new Set(closing.map((e) => e.options.id));\n moveFocusOut(closingIds);\n snapshotExitBaselines(closingIds);\n write(\n entriesRef.current.map((e) =>\n closingIds.has(e.options.id) ? withFlags(e, { ending: true }) : e,\n ),\n );\n syncTimers();\n callCloseHandlers(closing, reason, event);\n };\n\n const drop = (id: string): void => {\n const next = entriesRef.current.filter((e) => !(e.ending && e.options.id === id));\n if (next.length === entriesRef.current.length) return;\n lastAnnouncedRef.current.delete(id);\n exitBaselines.current.delete(id);\n write(next);\n };\n\n const apply = (commands: readonly ToastCommand[]): void => {\n const result = applyCommands(entriesRef.current, commands, (id) => roots.current.has(id));\n for (const id of result.replaced) clearToastTimers(timers.current, id);\n for (const id of result.forgotten) {\n lastAnnouncedRef.current.delete(id);\n exitBaselines.current.delete(id);\n }\n if (result.added) addedSinceEffect.current = true;\n if (isDev) {\n for (const id of result.missing) {\n console.error(`toast.update: no toast with id \"${id}\"; the update is ignored.`);\n }\n }\n if (result.dismissed.length === 0) {\n write(result.next);\n return;\n }\n moveFocusOut(result.leaving);\n snapshotExitBaselines(result.leaving);\n write(result.next);\n syncTimers();\n callCloseHandlers(result.dismissed, \"dismiss\", undefined);\n };\n\n const setActionPending = (id: string, pending: boolean): void => {\n const index = entriesRef.current.findIndex((e) => e.options.id === id);\n if (index === -1) return;\n const entry = entriesRef.current[index]!;\n if (entry.actionPending === pending) return;\n const next = [...entriesRef.current];\n next[index] = withFlags(entry, { actionPending: pending });\n write(next);\n };\n\n // The callbacks below read only refs, so one context value serves the Viewport's whole life.\n const restore = (toasts: readonly RetainedToast[]): void => {\n if (entriesRef.current.length > 0) return;\n // Already announced by the previous Viewport: not again on every remount.\n for (const t of toasts) {\n if (t.announced !== undefined) lastAnnouncedRef.current.set(t.options.id, t.announced);\n }\n write(\n toasts.map((t) =>\n makeEntry(t.options, { promisePending: t.pending, actionPending: false, ending: false }),\n ),\n );\n addedSinceEffect.current = true;\n };\n\n const retain = (): readonly RetainedToast[] => {\n const announced = lastAnnouncedRef.current;\n return entriesRef.current\n .filter((e) => !e.ending)\n .map((e) => ({\n options: e.options,\n pending: e.promisePending,\n announced: announced.has(e.options.id) ? announced.get(e.options.id) : undefined,\n }));\n };\n\n /** Forgets the queue of the previous manager (its own copy is retained by that manager). */\n const reset = (): void => {\n moveFocusOut(new Set(entriesRef.current.filter((e) => !e.ending).map((e) => e.options.id)));\n clearToastTimers(timers.current);\n lastAnnouncedRef.current.clear();\n exitBaselines.current.clear();\n write([]);\n };\n\n const handlers = useLatest({\n apply,\n restore,\n retain,\n reset,\n close,\n drop,\n setActionPending,\n queueAnnouncement,\n syncTimers,\n });\n\n const context = useMemo<ToastViewportContextValue>(\n () => ({\n close: (ids, reason, event) => handlers.current.close(ids, reason, event),\n drop: (id) => handlers.current.drop(id),\n setActionPending: (id, pending) => handlers.current.setActionPending(id, pending),\n setSuspended: (id, value) => {\n if (value) suspended.current.add(id);\n else suspended.current.delete(id);\n handlers.current.syncTimers();\n },\n registerRoot: (id, element) => {\n if (element === null) roots.current.delete(id);\n else roots.current.set(id, element);\n },\n focusSibling: (id, direction) => {\n const all = sortedRoots();\n const index = all.findIndex((r) => r.id === id);\n if (index === -1) return;\n all[index + direction]?.element.focus();\n },\n announce: (id, text, priority) => handlers.current.queueAnnouncement(id, text, priority),\n exitBaseline: (id) => exitBaselines.current.get(id),\n announcer: () => latest.current.announce,\n }),\n // oxlint-disable-next-line react-hooks/exhaustive-deps -- refs only (`sortedRoots` reads refs)\n [handlers, latest],\n );\n\n // --- Subscription ---------------------------------------------------------------------------\n\n const subscribedManager = useRef<ToastManager | null>(null);\n useEffect(() => {\n // A new `manager`: the previous one kept its toasts on unsubscribe (the previous run's\n // cleanup); start empty so the new one's retained toasts are restored and no command of\n // one queue reaches the other's toasts. The same manager again (StrictMode, Activity) keeps\n // the entries.\n if (subscribedManager.current !== null && subscribedManager.current !== manager) {\n handlers.current.reset();\n }\n subscribedManager.current = manager;\n const unsubscribe = toastManagerInternals(manager).subscribe(listener.current!);\n if (unsubscribe === null) {\n setRejected(true);\n setDuplicate(true);\n return;\n }\n setRejected(false);\n setDuplicate(false);\n return unsubscribe;\n }, [manager, handlers]);\n\n // --- Lifecycle, pause sources, hotkey --------------------------------------------------------\n\n useEffect(() => {\n if (rejected) return;\n mounted.current = true;\n const doc = regionRef.current?.ownerDocument ?? document;\n const unwatch = watch(doc);\n handlers.current.syncTimers();\n const map = timers.current;\n return () => {\n mounted.current = false;\n unwatch();\n // Unmounting stops the timers; the queue itself is retained by the manager.\n clearToastTimers(map);\n };\n }, [handlers, rejected, watch]);\n\n useToastHotkey({ hotkey, rejected, regionRef, focus });\n\n // --- The portal host (design 4.3) ------------------------------------------------------------\n\n // Keep this call before the region layout effect below: the host's move hides the popover\n // (removal steps), which that effect shows again in the same commit. A moved region gets no\n // `pointerleave`: drop the hover pause; a pointer still over it enters it again on its next move.\n const { portalled, host, anchorRef } = useModalPortalHost(() => setPause(\"hover\", false));\n\n // --- After every commit: region, timers, queued announcements, orphan exits ----------------\n\n useLayoutEffect(() => {\n const region = regionRef.current;\n const current = entriesRef.current;\n // Focus that left with a remount (a move into or out of a dialog) fires no `focusout`.\n if (\n pauses.holding(\"focus\") &&\n (region === null || !region.contains(region.ownerDocument.activeElement))\n ) {\n returnTargetRef.current = null;\n setPause(\"focus\", false);\n }\n if (region !== null && region.isConnected && region.hasAttribute(\"popover\")) {\n const open = isPopoverOpen(region);\n try {\n if (current.length > 0) {\n if (!open) region.showPopover();\n else if (addedSinceEffect.current) {\n // Re-raise to the top of the top layer, above a menu or popover opened since\n // (design 4.2). No style flush in between, so nothing is re-created.\n region.hidePopover();\n region.showPopover();\n }\n } else if (open) {\n region.hidePopover();\n }\n } catch {\n // A render element without popover support; nothing to show.\n }\n }\n // An emptied region is hidden, often right under the pointer (its last toast's Close), and\n // a hidden element gets no `pointerleave`: the next toast must not start paused.\n if (current.length === 0 && pauses.holding(\"hover\")) setPause(\"hover\", false);\n addedSinceEffect.current = false;\n\n const { visible, queued } = partition(current, latest.current.limit);\n // Queued toasts are announced on add (design 5); visible ones announce from their Root\n // once their content committed.\n announceQueued(queued, latest.current.announce);\n // An ending toast without a Root (the consumer did not render one) has nothing to animate.\n for (const entry of visible) {\n if (entry.ending && !roots.current.has(entry.options.id)) drop(entry.options.id);\n }\n syncTimers();\n });\n\n // --- Development checks ---------------------------------------------------------------------\n\n // A second Viewport on a taken manager renders nothing (`duplicate`, set above).\n useDevWarning(\n duplicate,\n isDev &&\n \"Toast.Viewport: another Toast.Viewport already renders this manager; this one renders \" +\n \"nothing. Use one Viewport per manager, or `createToastManager()` for a second queue.\",\n );\n\n // A Viewport inside a library Dialog would close (and unmount) with it.\n const insideDialog = use(DialogContext) !== null;\n useDevWarning(\n insideDialog,\n isDev &&\n \"Toast.Viewport: rendered inside a Dialog. The region would close with the dialog; render \" +\n \"the Viewport once near the root of the app (it moves into open modal Dialogs by itself).\",\n );\n\n // --- Render ---------------------------------------------------------------------------------\n\n const { visible, queued } = partition(entries, limit);\n const state: ToastViewportState = {\n toasts: visible.map((e) => e.item),\n queued: queued.length,\n paused,\n };\n\n const regionCallbackRef = useCallback((element: HTMLElement) => {\n regionRef.current = element;\n return () => {\n if (regionRef.current === element) regionRef.current = null;\n };\n }, []);\n\n // Touch lifts the pointer at once (`pointerleave` follows `pointerup`), so a tap never sticks.\n const onPointerEnter = (): void => setPause(\"hover\", true);\n const onPointerLeave = (): void => setPause(\"hover\", false);\n const onFocus = (event: FocusEvent<HTMLElement>): void => {\n const region = event.currentTarget;\n const from = event.relatedTarget;\n if (!(from instanceof Node) || !region.contains(from)) {\n returnTargetRef.current ??= from instanceof HTMLElement ? from : null;\n }\n setPause(\"focus\", true);\n };\n const onBlur = (event: FocusEvent<HTMLElement>): void => {\n const to = event.relatedTarget;\n if (to instanceof Node && event.currentTarget.contains(to)) return;\n returnTargetRef.current = null;\n setPause(\"focus\", false);\n };\n\n const libraryProps: ComponentPropsWithRef<\"section\"> & DataAttributes = {\n popover: \"manual\",\n \"aria-label\": rest[\"aria-label\"] ?? regionLabel(hotkey),\n \"data-paused\": dataAttr(paused),\n \"data-empty\": dataAttr(state.toasts.length === 0),\n onPointerEnter,\n onPointerLeave,\n onFocus,\n onBlur,\n };\n\n const region = useRender<ComponentPropsWithRef<\"section\">, ToastViewportState>({\n defaultElement: \"section\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps,\n ref: regionCallbackRef,\n });\n\n if (rejected) return null;\n const content = <ToastViewportContext value={context}>{region}</ToastViewportContext>;\n if (!portalled || host === null) return content;\n return (\n <>\n <div ref={anchorRef} style={ANCHOR_STYLE} />\n {createPortal(content, host)}\n </>\n );\n}\n\nconst ANCHOR_STYLE: CSSProperties = { display: \"contents\" };\n\nToastViewport.displayName = \"ToastViewport\";\n"],"mappings":";;;;;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AAK;CAC1D,MAAM,WAAW,UAAyC;EACxD,MAAM,SAAS,MAAM;EACrB,MAAM,OAAO,MAAM;EACnB,IAAI,EAAE,gBAAgB,SAAS,CAAC,OAAO,SAAS,IAAI,GAClD,gBAAgB,YAAY,gBAAgB,cAAc,OAAO;EAEnE,SAAS,SAAS,IAAI;CACxB;CACA,MAAM,UAAU,UAAyC;EACvD,MAAM,KAAK,MAAM;EACjB,IAAI,cAAc,QAAQ,MAAM,cAAc,SAAS,EAAE,GAAG;EAC5D,gBAAgB,UAAU;EAC1B,SAAS,SAAS,KAAK;CACzB;CAEA,MAAM,eAAkE;EACtE,SAAS;EACT,cAAc,KAAK,iBAAiB,YAAY,MAAM;EACtD,eAAe,SAAS,MAAM;EAC9B,cAAc,SAAS,MAAM,OAAO,WAAW,CAAC;EAChD;EACA;EACA;EACA;CACF;CAEA,MAAM,SAAS,UAAgE;EAC7E,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;EACA,KAAK;CACP,CAAC;CAED,IAAI,UAAU,OAAO;CACrB,MAAM,UAAU,oBAAC,sBAAD;EAAsB,OAAO;EAAU,UAAA;CAA6B,CAAA;CACpF,IAAI,CAAC,aAAa,SAAS,MAAM,OAAO;CACxC,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,OAAD;EAAK,KAAK;EAAW,OAAO;CAAe,CAAA,GAC1C,aAAa,SAAS,IAAI,CAC3B,EAAA,CAAA;AAEN;AAEA,MAAM,eAA8B,EAAE,SAAS,WAAW;AAE1D,cAAc,cAAc"}
@@ -0,0 +1,162 @@
1
+ import { Action, ActionDetails, ChangeReason, UrgentHandler } from "../internal/types.mjs";
2
+ import { ReactNode } from "react";
3
+ //#region src/toast/toast.d.ts
4
+ /** Announcement priority and role of a toast. */
5
+ export type ToastPriority = "normal" | "high";
6
+ /** The `action` of a toast: what `Toast.Action` renders and runs by default. */
7
+ export interface ToastActionOptions {
8
+ /** The Action button's content. */
9
+ readonly label: ReactNode;
10
+ /**
11
+ * Runs in the Action part's own transition (`data-pending` on the Action and the Root, the
12
+ * timer paused). The toast closes with `reason: "activate"` when it resolves; a rejection
13
+ * keeps the toast and reaches the nearest Error Boundary above the Viewport. A caught error
14
+ * resolves the action and therefore closes the toast: rethrow after `toast.update` to keep it.
15
+ */
16
+ readonly action: Action<[details: ToastActionDetails]>;
17
+ }
18
+ /**
19
+ * What `toast(options)` shows: the content and behaviour of one toast. `toast.update(id, options)`
20
+ * takes a partial of it.
21
+ *
22
+ * @see https://ui.funstack.work/components/toast
23
+ */
24
+ export interface ToastOptions {
25
+ /**
26
+ * Explicit id: an existing one updates that toast.
27
+ *
28
+ * @defaultValue generated
29
+ */
30
+ readonly id?: string | undefined;
31
+ /** Rendered by `Toast.Title`, which names the Root (`aria-labelledby`). */
32
+ readonly title?: ReactNode;
33
+ /** Rendered by `Toast.Description`, which describes the Root (`aria-describedby`). */
34
+ readonly description?: ReactNode;
35
+ /** Free-form, rendered as `data-type` on the Root (`"success"`, `"error"`, ...). */
36
+ readonly type?: string | undefined;
37
+ /**
38
+ * Announcement priority and role: `"high"` announces with `ariaNotify` priority `"high"` and
39
+ * renders the Root as an `alertdialog`.
40
+ *
41
+ * @defaultValue `"normal"`
42
+ */
43
+ readonly priority?: ToastPriority | undefined;
44
+ /**
45
+ * Milliseconds before the toast closes with `reason: "timeout"`; `null` never. A timed action
46
+ * toast must keep its action reachable elsewhere too (WCAG 2.2.1).
47
+ *
48
+ * @defaultValue the Viewport's `duration`, or `null` (persistent) when the toast has an `action`
49
+ */
50
+ readonly duration?: number | null | undefined;
51
+ /**
52
+ * A button the toast offers (Undo, Retry), rendered and run by `Toast.Action`. A toast with an
53
+ * action is persistent unless `duration` is set.
54
+ */
55
+ readonly action?: ToastActionOptions | undefined;
56
+ /**
57
+ * A handler, not an action: called once when the toast leaves,
58
+ * with the reason: `"activate"` (the Action part settled), `"dismiss"` (Close, Escape,
59
+ * `toast.dismiss()`, a promise toast with no message for its outcome) or `"timeout"`. Called
60
+ * synchronously where the close happens, outside any Transition, and not awaited: a slow
61
+ * `deleteForReal` holds no other transition. May return a promise (a Server Function); a
62
+ * rejection or a throw goes to `reportError`, never to an Error Boundary. Not called when the
63
+ * Viewport unmounts.
64
+ */
65
+ readonly onClose?: UrgentHandler<ToastCloseDetails> | undefined;
66
+ /**
67
+ * The text `document.ariaNotify()` speaks for this toast; `null` announces nothing.
68
+ *
69
+ * @defaultValue the Viewport's `announce`, else the text of the toast's Title and Description
70
+ */
71
+ readonly announce?: ((toast: ToastItem) => string | null) | undefined;
72
+ /** Anything the Viewport's children want to render. */
73
+ readonly data?: unknown;
74
+ }
75
+ /** A toast in the queue, as the Viewport's `children(state)` receives it. */
76
+ export interface ToastItem extends ToastOptions {
77
+ readonly id: string;
78
+ /**
79
+ * The promise given to `toast.promise` is unsettled, or an action dispatched through this
80
+ * toast's Action part is in flight.
81
+ */
82
+ readonly pending: boolean;
83
+ /** Closed; kept mounted (and `inert`) for its exit animation. */
84
+ readonly ending: boolean;
85
+ }
86
+ /** Details passed to a toast's Action. */
87
+ export interface ToastActionDetails extends ActionDetails {
88
+ /** The toast's id, so an inline action can `toast.update` or `toast.dismiss` its own toast. */
89
+ readonly id: string;
90
+ }
91
+ /** Details passed to a toast's `onClose`. */
92
+ export interface ToastCloseDetails extends ActionDetails {
93
+ /** The id of the toast that closed. */
94
+ readonly id: string;
95
+ /** `"activate"`, `"dismiss"` or `"timeout"`. */
96
+ readonly reason: ChangeReason;
97
+ }
98
+ /**
99
+ * The second argument of `toast.promise(promise, options)`: the toast to show while `promise` is
100
+ * pending and the ones that replace it when it settles.
101
+ *
102
+ * @see https://ui.funstack.work/components/toast
103
+ */
104
+ export interface ToastPromiseOptions<T> {
105
+ /** Shown at once, with `data-pending`; no timer until the promise settles. */
106
+ readonly pending: ToastOptions;
107
+ /**
108
+ * Replaces the toast when the promise fulfils; omitted: the toast is dismissed. A function that
109
+ * throws dismisses the toast, and the returned promise rejects with what it threw.
110
+ */
111
+ readonly success?: ToastOptions | ((value: T) => ToastOptions) | undefined;
112
+ /**
113
+ * Replaces the toast when the promise rejects; the returned promise then resolves with
114
+ * `undefined` (the toast is the handler). Omitted: the toast is dismissed and the returned
115
+ * promise rejects with the same reason. A function that throws dismisses the toast, and the
116
+ * returned promise rejects with what it threw.
117
+ */
118
+ readonly error?: ToastOptions | ((reason: unknown) => ToastOptions) | undefined;
119
+ /**
120
+ * Explicit id of the toast; an existing one is updated.
121
+ *
122
+ * @defaultValue generated
123
+ */
124
+ readonly id?: string | undefined;
125
+ }
126
+ /** The queue's input: `toast(options)` and its methods. */
127
+ export interface ToastManager {
128
+ /** Adds a toast (or updates the one with `options.id`) and returns its id. */
129
+ (options: ToastOptions): string;
130
+ /**
131
+ * The same as calling the manager: adds a toast (or updates the one with `options.id`) and
132
+ * returns its id.
133
+ */
134
+ readonly add: (options: ToastOptions) => string;
135
+ /**
136
+ * Shows `options.pending` at once and swaps to `success` / `error` when `promise` settles.
137
+ * Returns a promise that settles with `promise`, except that a rejection resolves with
138
+ * `undefined` when `error` was given.
139
+ */
140
+ readonly promise: <T>(promise: PromiseLike<T>, options: ToastPromiseOptions<T>) => Promise<T | undefined>;
141
+ /** Changes a toast in place (same position, same element). Unknown or closed ids are ignored. */
142
+ readonly update: (id: string, options: Partial<ToastOptions>) => void;
143
+ /** Closes one toast, or every toast when `id` is omitted, with `reason: "dismiss"`. */
144
+ readonly dismiss: (id?: string) => void;
145
+ }
146
+ /**
147
+ * Creates an isolated queue: `<Toast.Viewport manager={m}>` renders it. For a second React root,
148
+ * a micro-frontend, or a test that wants a clean queue. `toast` is the default manager.
149
+ *
150
+ * @see https://ui.funstack.work/components/toast
151
+ */
152
+ export declare function createToastManager(): ToastManager;
153
+ /**
154
+ * The default toast manager: `toast({ title: "Saved" })` from anywhere on the client (action
155
+ * bodies, stores, effects). `<Toast.Viewport>` without `manager` renders it. On the server every
156
+ * call is a no-op.
157
+ *
158
+ * @see https://ui.funstack.work/components/toast
159
+ */
160
+ export declare const toast: ToastManager;
161
+ //#endregion
162
+ //# sourceMappingURL=toast.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast.d.mts","names":[],"sources":["../../src/toast/toast.ts"],"mappings":";;;;YAOY;;iBAGK;;WAEN,OAAO;;;;;;;WAOP,QAAQ,QAAQ,SAAS;;;;;;;;iBASnB;;;;;;WAMN;;WAEA,QAAQ;;WAER,cAAc;;WAEd;;;;;;;WAOA,WAAW;;;;;;;WAOX;;;;;WAKA,SAAS;;;;;;;;;;WAUT,UAAU,cAAc;;;;;;WAMxB,aAAa,OAAO;;WAEpB;;;iBAIM,kBAAkB;WACxB;;;;;WAKA;;WAEA;;;iBAIM,2BAA2B;;WAEjC;;;iBAIM,0BAA0B;;WAEhC;;WAEA,QAAQ;;;;;;;;iBASF,oBAAoB;;WAE1B,SAAS;;;;;WAKT,UAAU,iBAAiB,OAAO,MAAM;;;;;;;WAOxC,QAAQ,iBAAiB,oBAAoB;;;;;;WAM7C;;;iBAIM;;GAEd,SAAS;;;;;WAKD,MAAM,SAAS;;;;;;WAMf,UAAU,GACjB,SAAS,YAAY,IACrB,SAAS,oBAAoB,OAC1B,QAAQ;;WAEJ,SAAS,YAAY,SAAS,QAAQ;;WAEtC,UAAU;;;;;;;;wBA8GL,sBAAsB;;;;;;;;qBAsIzB,OAAO"}