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

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 (558) hide show
  1. package/README.md +22 -1
  2. package/dist/accordion/accordion-item.d.mts +19 -0
  3. package/dist/accordion/accordion-item.d.mts.map +1 -1
  4. package/dist/accordion/accordion-item.mjs +2 -0
  5. package/dist/accordion/accordion-item.mjs.map +1 -1
  6. package/dist/accordion/accordion-panel.d.mts +16 -0
  7. package/dist/accordion/accordion-panel.d.mts.map +1 -1
  8. package/dist/accordion/accordion-panel.mjs +2 -0
  9. package/dist/accordion/accordion-panel.mjs.map +1 -1
  10. package/dist/accordion/accordion-root.d.mts +36 -2
  11. package/dist/accordion/accordion-root.d.mts.map +1 -1
  12. package/dist/accordion/accordion-root.mjs +2 -0
  13. package/dist/accordion/accordion-root.mjs.map +1 -1
  14. package/dist/accordion/accordion-trigger.d.mts +9 -0
  15. package/dist/accordion/accordion-trigger.d.mts.map +1 -1
  16. package/dist/accordion/accordion-trigger.mjs +2 -0
  17. package/dist/accordion/accordion-trigger.mjs.map +1 -1
  18. package/dist/accordion/index.d.mts +2 -0
  19. package/dist/accordion/index.d.mts.map +1 -1
  20. package/dist/accordion/index.mjs +2 -0
  21. package/dist/accordion/index.mjs.map +1 -1
  22. package/dist/bin/skill-installer.d.mts +1 -0
  23. package/dist/bin/skill-installer.mjs +12 -0
  24. package/dist/bin/skill-installer.mjs.map +1 -0
  25. package/dist/button/button.d.mts +25 -7
  26. package/dist/button/button.d.mts.map +1 -1
  27. package/dist/button/button.mjs +2 -0
  28. package/dist/button/button.mjs.map +1 -1
  29. package/dist/checkbox/checkbox.d.mts +25 -3
  30. package/dist/checkbox/checkbox.d.mts.map +1 -1
  31. package/dist/checkbox/checkbox.mjs +2 -0
  32. package/dist/checkbox/checkbox.mjs.map +1 -1
  33. package/dist/checkbox-group/checkbox-group-item.d.mts +15 -0
  34. package/dist/checkbox-group/checkbox-group-item.d.mts.map +1 -1
  35. package/dist/checkbox-group/checkbox-group-item.mjs +2 -0
  36. package/dist/checkbox-group/checkbox-group-item.mjs.map +1 -1
  37. package/dist/checkbox-group/checkbox-group-label.d.mts +10 -0
  38. package/dist/checkbox-group/checkbox-group-label.d.mts.map +1 -1
  39. package/dist/checkbox-group/checkbox-group-label.mjs +2 -0
  40. package/dist/checkbox-group/checkbox-group-label.mjs.map +1 -1
  41. package/dist/checkbox-group/checkbox-group-parent.d.mts +19 -1
  42. package/dist/checkbox-group/checkbox-group-parent.d.mts.map +1 -1
  43. package/dist/checkbox-group/checkbox-group-parent.mjs +2 -0
  44. package/dist/checkbox-group/checkbox-group-parent.mjs.map +1 -1
  45. package/dist/checkbox-group/checkbox-group-root.d.mts +31 -4
  46. package/dist/checkbox-group/checkbox-group-root.d.mts.map +1 -1
  47. package/dist/checkbox-group/checkbox-group-root.mjs +2 -0
  48. package/dist/checkbox-group/checkbox-group-root.mjs.map +1 -1
  49. package/dist/checkbox-group/index.d.mts +2 -0
  50. package/dist/checkbox-group/index.d.mts.map +1 -1
  51. package/dist/checkbox-group/index.mjs +2 -0
  52. package/dist/checkbox-group/index.mjs.map +1 -1
  53. package/dist/combobox/combobox-clear.d.mts +18 -0
  54. package/dist/combobox/combobox-clear.d.mts.map +1 -1
  55. package/dist/combobox/combobox-clear.mjs +2 -0
  56. package/dist/combobox/combobox-clear.mjs.map +1 -1
  57. package/dist/combobox/combobox-group.d.mts +49 -1
  58. package/dist/combobox/combobox-group.d.mts.map +1 -1
  59. package/dist/combobox/combobox-group.mjs +11 -1
  60. package/dist/combobox/combobox-group.mjs.map +1 -1
  61. package/dist/combobox/combobox-input.d.mts +11 -0
  62. package/dist/combobox/combobox-input.d.mts.map +1 -1
  63. package/dist/combobox/combobox-input.mjs +2 -0
  64. package/dist/combobox/combobox-input.mjs.map +1 -1
  65. package/dist/combobox/combobox-label.d.mts +16 -0
  66. package/dist/combobox/combobox-label.d.mts.map +1 -1
  67. package/dist/combobox/combobox-label.mjs +2 -0
  68. package/dist/combobox/combobox-label.mjs.map +1 -1
  69. package/dist/combobox/combobox-list.d.mts +14 -0
  70. package/dist/combobox/combobox-list.d.mts.map +1 -1
  71. package/dist/combobox/combobox-list.mjs +2 -0
  72. package/dist/combobox/combobox-list.mjs.map +1 -1
  73. package/dist/combobox/combobox-option.d.mts +25 -3
  74. package/dist/combobox/combobox-option.d.mts.map +1 -1
  75. package/dist/combobox/combobox-option.mjs +2 -0
  76. package/dist/combobox/combobox-option.mjs.map +1 -1
  77. package/dist/combobox/combobox-popup.d.mts +16 -0
  78. package/dist/combobox/combobox-popup.d.mts.map +1 -1
  79. package/dist/combobox/combobox-popup.mjs +2 -0
  80. package/dist/combobox/combobox-popup.mjs.map +1 -1
  81. package/dist/combobox/combobox-root.d.mts +49 -12
  82. package/dist/combobox/combobox-root.d.mts.map +1 -1
  83. package/dist/combobox/combobox-root.mjs +2 -0
  84. package/dist/combobox/combobox-root.mjs.map +1 -1
  85. package/dist/combobox/combobox-trigger.d.mts +16 -0
  86. package/dist/combobox/combobox-trigger.d.mts.map +1 -1
  87. package/dist/combobox/combobox-trigger.mjs +2 -0
  88. package/dist/combobox/combobox-trigger.mjs.map +1 -1
  89. package/dist/combobox/index.d.mts +2 -0
  90. package/dist/combobox/index.d.mts.map +1 -1
  91. package/dist/combobox/index.mjs +2 -0
  92. package/dist/combobox/index.mjs.map +1 -1
  93. package/dist/csp/csp-provider.d.mts +8 -0
  94. package/dist/csp/csp-provider.d.mts.map +1 -1
  95. package/dist/csp/csp-provider.mjs +2 -0
  96. package/dist/csp/csp-provider.mjs.map +1 -1
  97. package/dist/csp/style-hashes.d.mts +2 -0
  98. package/dist/csp/style-hashes.d.mts.map +1 -1
  99. package/dist/csp/style-hashes.mjs +2 -0
  100. package/dist/csp/style-hashes.mjs.map +1 -1
  101. package/dist/dialog/dialog-close.d.mts +18 -0
  102. package/dist/dialog/dialog-close.d.mts.map +1 -1
  103. package/dist/dialog/dialog-close.mjs +2 -0
  104. package/dist/dialog/dialog-close.mjs.map +1 -1
  105. package/dist/dialog/dialog-description.d.mts +12 -0
  106. package/dist/dialog/dialog-description.d.mts.map +1 -1
  107. package/dist/dialog/dialog-description.mjs +2 -0
  108. package/dist/dialog/dialog-description.mjs.map +1 -1
  109. package/dist/dialog/dialog-form.d.mts +18 -1
  110. package/dist/dialog/dialog-form.d.mts.map +1 -1
  111. package/dist/dialog/dialog-form.mjs +2 -0
  112. package/dist/dialog/dialog-form.mjs.map +1 -1
  113. package/dist/dialog/dialog-popup.d.mts +25 -4
  114. package/dist/dialog/dialog-popup.d.mts.map +1 -1
  115. package/dist/dialog/dialog-popup.mjs +2 -0
  116. package/dist/dialog/dialog-popup.mjs.map +1 -1
  117. package/dist/dialog/dialog-root.d.mts +15 -1
  118. package/dist/dialog/dialog-root.d.mts.map +1 -1
  119. package/dist/dialog/dialog-root.mjs +2 -0
  120. package/dist/dialog/dialog-root.mjs.map +1 -1
  121. package/dist/dialog/dialog-title.d.mts +11 -0
  122. package/dist/dialog/dialog-title.d.mts.map +1 -1
  123. package/dist/dialog/dialog-title.mjs +2 -0
  124. package/dist/dialog/dialog-title.mjs.map +1 -1
  125. package/dist/dialog/dialog-trigger.d.mts +16 -0
  126. package/dist/dialog/dialog-trigger.d.mts.map +1 -1
  127. package/dist/dialog/dialog-trigger.mjs +2 -0
  128. package/dist/dialog/dialog-trigger.mjs.map +1 -1
  129. package/dist/dialog/index.d.mts +2 -0
  130. package/dist/dialog/index.d.mts.map +1 -1
  131. package/dist/dialog/index.mjs +2 -0
  132. package/dist/dialog/index.mjs.map +1 -1
  133. package/dist/docs/components/accordion.md +426 -0
  134. package/dist/docs/components/button.md +464 -0
  135. package/dist/docs/components/checkbox-group.md +474 -0
  136. package/dist/docs/components/checkbox.md +373 -0
  137. package/dist/docs/components/combobox.md +635 -0
  138. package/dist/docs/components/context-menu.md +524 -0
  139. package/dist/docs/components/dialog.md +686 -0
  140. package/dist/docs/components/field.md +587 -0
  141. package/dist/docs/components/menu.md +589 -0
  142. package/dist/docs/components/meter.md +313 -0
  143. package/dist/docs/components/number-field.md +528 -0
  144. package/dist/docs/components/popover.md +591 -0
  145. package/dist/docs/components/progress.md +450 -0
  146. package/dist/docs/components/radio-group.md +457 -0
  147. package/dist/docs/components/select.md +662 -0
  148. package/dist/docs/components/slider.md +558 -0
  149. package/dist/docs/components/switch.md +311 -0
  150. package/dist/docs/components/tabs.md +473 -0
  151. package/dist/docs/components/toast.md +576 -0
  152. package/dist/docs/components/toggle-group.md +341 -0
  153. package/dist/docs/components/toggle.md +245 -0
  154. package/dist/docs/components/toolbar.md +389 -0
  155. package/dist/docs/components/tooltip.md +494 -0
  156. package/dist/docs/concepts/action-props.md +251 -0
  157. package/dist/docs/concepts/ai-agents.md +56 -0
  158. package/dist/docs/concepts/browser-owned-state.md +118 -0
  159. package/dist/docs/concepts/content-security-policy.md +69 -0
  160. package/dist/docs/concepts/experimental.md +36 -0
  161. package/dist/docs/concepts/pending-and-optimistic.md +250 -0
  162. package/dist/docs/concepts/server-components.md +118 -0
  163. package/dist/docs/concepts/suspense.md +124 -0
  164. package/dist/docs/concepts/transitions.md +118 -0
  165. package/dist/docs/getting-started.md +115 -0
  166. package/dist/docs/index.md +181 -0
  167. package/dist/docs/roadmap.md +74 -0
  168. package/dist/docs/why.md +100 -0
  169. package/dist/field/field-control.d.mts +26 -3
  170. package/dist/field/field-control.d.mts.map +1 -1
  171. package/dist/field/field-control.mjs +2 -0
  172. package/dist/field/field-control.mjs.map +1 -1
  173. package/dist/field/field-description.d.mts +11 -0
  174. package/dist/field/field-description.d.mts.map +1 -1
  175. package/dist/field/field-description.mjs +2 -0
  176. package/dist/field/field-description.mjs.map +1 -1
  177. package/dist/field/field-error.d.mts +14 -2
  178. package/dist/field/field-error.d.mts.map +1 -1
  179. package/dist/field/field-error.mjs +2 -0
  180. package/dist/field/field-error.mjs.map +1 -1
  181. package/dist/field/field-label.d.mts +10 -0
  182. package/dist/field/field-label.d.mts.map +1 -1
  183. package/dist/field/field-label.mjs +2 -0
  184. package/dist/field/field-label.mjs.map +1 -1
  185. package/dist/field/field-root.d.mts +21 -2
  186. package/dist/field/field-root.d.mts.map +1 -1
  187. package/dist/field/field-root.mjs +2 -0
  188. package/dist/field/field-root.mjs.map +1 -1
  189. package/dist/field/index.d.mts +9 -0
  190. package/dist/field/index.d.mts.map +1 -1
  191. package/dist/field/index.mjs +9 -0
  192. package/dist/field/index.mjs.map +1 -1
  193. package/dist/form/form-root.d.mts +17 -1
  194. package/dist/form/form-root.d.mts.map +1 -1
  195. package/dist/form/form-root.mjs +2 -0
  196. package/dist/form/form-root.mjs.map +1 -1
  197. package/dist/form/form-submit.d.mts +18 -0
  198. package/dist/form/form-submit.d.mts.map +1 -1
  199. package/dist/form/form-submit.mjs +2 -0
  200. package/dist/form/form-submit.mjs.map +1 -1
  201. package/dist/form/index.d.mts +7 -0
  202. package/dist/form/index.d.mts.map +1 -1
  203. package/dist/form/index.mjs +7 -0
  204. package/dist/form/index.mjs.map +1 -1
  205. package/dist/index.d.mts +2 -1
  206. package/dist/internal/types.d.mts +3 -0
  207. package/dist/internal/types.d.mts.map +1 -1
  208. package/dist/internal/use-popover-trigger.d.mts +1 -0
  209. package/dist/internal/use-popover-trigger.d.mts.map +1 -1
  210. package/dist/internal/use-popover-trigger.mjs.map +1 -1
  211. package/dist/internal/validity.d.mts +11 -0
  212. package/dist/internal/validity.d.mts.map +1 -1
  213. package/dist/internal/validity.mjs.map +1 -1
  214. package/dist/menu/index.d.mts +2 -0
  215. package/dist/menu/index.d.mts.map +1 -1
  216. package/dist/menu/index.mjs +2 -0
  217. package/dist/menu/index.mjs.map +1 -1
  218. package/dist/menu/menu-checkbox-item.d.mts +26 -2
  219. package/dist/menu/menu-checkbox-item.d.mts.map +1 -1
  220. package/dist/menu/menu-checkbox-item.mjs +2 -0
  221. package/dist/menu/menu-checkbox-item.mjs.map +1 -1
  222. package/dist/menu/menu-context-trigger.d.mts +24 -2
  223. package/dist/menu/menu-context-trigger.d.mts.map +1 -1
  224. package/dist/menu/menu-context-trigger.mjs +2 -0
  225. package/dist/menu/menu-context-trigger.mjs.map +1 -1
  226. package/dist/menu/menu-group.d.mts +36 -1
  227. package/dist/menu/menu-group.d.mts.map +1 -1
  228. package/dist/menu/menu-group.mjs +9 -1
  229. package/dist/menu/menu-group.mjs.map +1 -1
  230. package/dist/menu/menu-item.d.mts +23 -1
  231. package/dist/menu/menu-item.d.mts.map +1 -1
  232. package/dist/menu/menu-item.mjs +2 -0
  233. package/dist/menu/menu-item.mjs.map +1 -1
  234. package/dist/menu/menu-popup.d.mts +33 -8
  235. package/dist/menu/menu-popup.d.mts.map +1 -1
  236. package/dist/menu/menu-popup.mjs +2 -0
  237. package/dist/menu/menu-popup.mjs.map +1 -1
  238. package/dist/menu/menu-radio-group.d.mts +20 -1
  239. package/dist/menu/menu-radio-group.d.mts.map +1 -1
  240. package/dist/menu/menu-radio-group.mjs +2 -0
  241. package/dist/menu/menu-radio-group.mjs.map +1 -1
  242. package/dist/menu/menu-radio-item.d.mts +16 -0
  243. package/dist/menu/menu-radio-item.d.mts.map +1 -1
  244. package/dist/menu/menu-radio-item.mjs +2 -0
  245. package/dist/menu/menu-radio-item.mjs.map +1 -1
  246. package/dist/menu/menu-root.d.mts +22 -3
  247. package/dist/menu/menu-root.d.mts.map +1 -1
  248. package/dist/menu/menu-root.mjs +2 -0
  249. package/dist/menu/menu-root.mjs.map +1 -1
  250. package/dist/menu/menu-submenu-trigger.d.mts +13 -0
  251. package/dist/menu/menu-submenu-trigger.d.mts.map +1 -1
  252. package/dist/menu/menu-submenu-trigger.mjs +2 -0
  253. package/dist/menu/menu-submenu-trigger.mjs.map +1 -1
  254. package/dist/menu/menu-trigger.d.mts +15 -0
  255. package/dist/menu/menu-trigger.d.mts.map +1 -1
  256. package/dist/menu/menu-trigger.mjs +2 -0
  257. package/dist/menu/menu-trigger.mjs.map +1 -1
  258. package/dist/meter/index.d.mts +2 -0
  259. package/dist/meter/index.d.mts.map +1 -1
  260. package/dist/meter/index.mjs +2 -0
  261. package/dist/meter/index.mjs.map +1 -1
  262. package/dist/meter/meter-indicator.d.mts +11 -0
  263. package/dist/meter/meter-indicator.d.mts.map +1 -1
  264. package/dist/meter/meter-indicator.mjs +2 -0
  265. package/dist/meter/meter-indicator.mjs.map +1 -1
  266. package/dist/meter/meter-label.d.mts +11 -0
  267. package/dist/meter/meter-label.d.mts.map +1 -1
  268. package/dist/meter/meter-label.mjs +2 -0
  269. package/dist/meter/meter-label.mjs.map +1 -1
  270. package/dist/meter/meter-region.d.mts +5 -0
  271. package/dist/meter/meter-region.d.mts.map +1 -1
  272. package/dist/meter/meter-region.mjs.map +1 -1
  273. package/dist/meter/meter-root.d.mts +52 -10
  274. package/dist/meter/meter-root.d.mts.map +1 -1
  275. package/dist/meter/meter-root.mjs +2 -0
  276. package/dist/meter/meter-root.mjs.map +1 -1
  277. package/dist/meter/meter-track.d.mts +11 -0
  278. package/dist/meter/meter-track.d.mts.map +1 -1
  279. package/dist/meter/meter-track.mjs +2 -0
  280. package/dist/meter/meter-track.mjs.map +1 -1
  281. package/dist/meter/meter-value.d.mts +15 -1
  282. package/dist/meter/meter-value.d.mts.map +1 -1
  283. package/dist/meter/meter-value.mjs +2 -0
  284. package/dist/meter/meter-value.mjs.map +1 -1
  285. package/dist/number-field/index.d.mts +2 -0
  286. package/dist/number-field/index.d.mts.map +1 -1
  287. package/dist/number-field/index.mjs +2 -0
  288. package/dist/number-field/index.mjs.map +1 -1
  289. package/dist/number-field/number-field-decrement.d.mts +2 -0
  290. package/dist/number-field/number-field-decrement.d.mts.map +1 -1
  291. package/dist/number-field/number-field-decrement.mjs +2 -0
  292. package/dist/number-field/number-field-decrement.mjs.map +1 -1
  293. package/dist/number-field/number-field-increment.d.mts +2 -0
  294. package/dist/number-field/number-field-increment.d.mts.map +1 -1
  295. package/dist/number-field/number-field-increment.mjs +2 -0
  296. package/dist/number-field/number-field-increment.mjs.map +1 -1
  297. package/dist/number-field/number-field-input.d.mts +9 -0
  298. package/dist/number-field/number-field-input.d.mts.map +1 -1
  299. package/dist/number-field/number-field-input.mjs +2 -0
  300. package/dist/number-field/number-field-input.mjs.map +1 -1
  301. package/dist/number-field/number-field-label.d.mts +10 -0
  302. package/dist/number-field/number-field-label.d.mts.map +1 -1
  303. package/dist/number-field/number-field-label.mjs +2 -0
  304. package/dist/number-field/number-field-label.mjs.map +1 -1
  305. package/dist/number-field/number-field-root.d.mts +62 -14
  306. package/dist/number-field/number-field-root.d.mts.map +1 -1
  307. package/dist/number-field/number-field-root.mjs +2 -0
  308. package/dist/number-field/number-field-root.mjs.map +1 -1
  309. package/dist/number-field/use-step-button.d.mts +20 -0
  310. package/dist/number-field/use-step-button.d.mts.map +1 -1
  311. package/dist/number-field/use-step-button.mjs.map +1 -1
  312. package/dist/popover/index.d.mts +2 -0
  313. package/dist/popover/index.d.mts.map +1 -1
  314. package/dist/popover/index.mjs +2 -0
  315. package/dist/popover/index.mjs.map +1 -1
  316. package/dist/popover/popover-close.d.mts +18 -0
  317. package/dist/popover/popover-close.d.mts.map +1 -1
  318. package/dist/popover/popover-close.mjs +2 -0
  319. package/dist/popover/popover-close.mjs.map +1 -1
  320. package/dist/popover/popover-description.d.mts +12 -0
  321. package/dist/popover/popover-description.d.mts.map +1 -1
  322. package/dist/popover/popover-description.mjs +2 -0
  323. package/dist/popover/popover-description.mjs.map +1 -1
  324. package/dist/popover/popover-popup.d.mts +30 -4
  325. package/dist/popover/popover-popup.d.mts.map +1 -1
  326. package/dist/popover/popover-popup.mjs +2 -0
  327. package/dist/popover/popover-popup.mjs.map +1 -1
  328. package/dist/popover/popover-root.d.mts +9 -0
  329. package/dist/popover/popover-root.d.mts.map +1 -1
  330. package/dist/popover/popover-root.mjs +2 -0
  331. package/dist/popover/popover-root.mjs.map +1 -1
  332. package/dist/popover/popover-title.d.mts +11 -0
  333. package/dist/popover/popover-title.d.mts.map +1 -1
  334. package/dist/popover/popover-title.mjs +2 -0
  335. package/dist/popover/popover-title.mjs.map +1 -1
  336. package/dist/popover/popover-trigger.d.mts +15 -0
  337. package/dist/popover/popover-trigger.d.mts.map +1 -1
  338. package/dist/popover/popover-trigger.mjs +2 -0
  339. package/dist/popover/popover-trigger.mjs.map +1 -1
  340. package/dist/progress/index.d.mts +2 -0
  341. package/dist/progress/index.d.mts.map +1 -1
  342. package/dist/progress/index.mjs +2 -0
  343. package/dist/progress/index.mjs.map +1 -1
  344. package/dist/progress/progress-indicator.d.mts +11 -0
  345. package/dist/progress/progress-indicator.d.mts.map +1 -1
  346. package/dist/progress/progress-indicator.mjs +2 -0
  347. package/dist/progress/progress-indicator.mjs.map +1 -1
  348. package/dist/progress/progress-label.d.mts +11 -0
  349. package/dist/progress/progress-label.d.mts.map +1 -1
  350. package/dist/progress/progress-label.mjs +2 -0
  351. package/dist/progress/progress-label.mjs.map +1 -1
  352. package/dist/progress/progress-root.d.mts +36 -8
  353. package/dist/progress/progress-root.d.mts.map +1 -1
  354. package/dist/progress/progress-root.mjs +2 -0
  355. package/dist/progress/progress-root.mjs.map +1 -1
  356. package/dist/progress/progress-track.d.mts +11 -0
  357. package/dist/progress/progress-track.d.mts.map +1 -1
  358. package/dist/progress/progress-track.mjs +2 -0
  359. package/dist/progress/progress-track.mjs.map +1 -1
  360. package/dist/progress/progress-value.d.mts +15 -1
  361. package/dist/progress/progress-value.d.mts.map +1 -1
  362. package/dist/progress/progress-value.mjs +2 -0
  363. package/dist/progress/progress-value.mjs.map +1 -1
  364. package/dist/radio-group/index.d.mts +2 -0
  365. package/dist/radio-group/index.d.mts.map +1 -1
  366. package/dist/radio-group/index.mjs +2 -0
  367. package/dist/radio-group/index.mjs.map +1 -1
  368. package/dist/radio-group/radio-group-item.d.mts +18 -1
  369. package/dist/radio-group/radio-group-item.d.mts.map +1 -1
  370. package/dist/radio-group/radio-group-item.mjs +2 -0
  371. package/dist/radio-group/radio-group-item.mjs.map +1 -1
  372. package/dist/radio-group/radio-group-label.d.mts +10 -0
  373. package/dist/radio-group/radio-group-label.d.mts.map +1 -1
  374. package/dist/radio-group/radio-group-label.mjs +2 -0
  375. package/dist/radio-group/radio-group-label.mjs.map +1 -1
  376. package/dist/radio-group/radio-group-root.d.mts +29 -5
  377. package/dist/radio-group/radio-group-root.d.mts.map +1 -1
  378. package/dist/radio-group/radio-group-root.mjs +2 -0
  379. package/dist/radio-group/radio-group-root.mjs.map +1 -1
  380. package/dist/select/index.d.mts +2 -0
  381. package/dist/select/index.d.mts.map +1 -1
  382. package/dist/select/index.mjs +2 -0
  383. package/dist/select/index.mjs.map +1 -1
  384. package/dist/select/select-group-label.d.mts +10 -0
  385. package/dist/select/select-group-label.d.mts.map +1 -1
  386. package/dist/select/select-group-label.mjs +2 -0
  387. package/dist/select/select-group-label.mjs.map +1 -1
  388. package/dist/select/select-group.d.mts +15 -1
  389. package/dist/select/select-group.d.mts.map +1 -1
  390. package/dist/select/select-group.mjs +2 -0
  391. package/dist/select/select-group.mjs.map +1 -1
  392. package/dist/select/select-option.d.mts +19 -1
  393. package/dist/select/select-option.d.mts.map +1 -1
  394. package/dist/select/select-option.mjs +2 -0
  395. package/dist/select/select-option.mjs.map +1 -1
  396. package/dist/select/select-root.d.mts +24 -1
  397. package/dist/select/select-root.d.mts.map +1 -1
  398. package/dist/select/select-root.mjs +2 -0
  399. package/dist/select/select-root.mjs.map +1 -1
  400. package/dist/select/select-separator.d.mts +9 -0
  401. package/dist/select/select-separator.d.mts.map +1 -1
  402. package/dist/select/select-separator.mjs +2 -0
  403. package/dist/select/select-separator.mjs.map +1 -1
  404. package/dist/select/select-trigger.d.mts +9 -0
  405. package/dist/select/select-trigger.d.mts.map +1 -1
  406. package/dist/select/select-trigger.mjs +2 -0
  407. package/dist/select/select-trigger.mjs.map +1 -1
  408. package/dist/select/select-value.d.mts +9 -0
  409. package/dist/select/select-value.d.mts.map +1 -1
  410. package/dist/select/select-value.mjs +2 -0
  411. package/dist/select/select-value.mjs.map +1 -1
  412. package/dist/slider/index.d.mts +2 -0
  413. package/dist/slider/index.d.mts.map +1 -1
  414. package/dist/slider/index.mjs +2 -0
  415. package/dist/slider/index.mjs.map +1 -1
  416. package/dist/slider/slider-indicator.d.mts +12 -0
  417. package/dist/slider/slider-indicator.d.mts.map +1 -1
  418. package/dist/slider/slider-indicator.mjs +2 -0
  419. package/dist/slider/slider-indicator.mjs.map +1 -1
  420. package/dist/slider/slider-label.d.mts +11 -1
  421. package/dist/slider/slider-label.d.mts.map +1 -1
  422. package/dist/slider/slider-label.mjs +2 -0
  423. package/dist/slider/slider-label.mjs.map +1 -1
  424. package/dist/slider/slider-root.d.mts +53 -9
  425. package/dist/slider/slider-root.d.mts.map +1 -1
  426. package/dist/slider/slider-root.mjs +2 -0
  427. package/dist/slider/slider-root.mjs.map +1 -1
  428. package/dist/slider/slider-thumb.d.mts +32 -3
  429. package/dist/slider/slider-thumb.d.mts.map +1 -1
  430. package/dist/slider/slider-thumb.mjs +2 -0
  431. package/dist/slider/slider-thumb.mjs.map +1 -1
  432. package/dist/slider/slider-track.d.mts +17 -0
  433. package/dist/slider/slider-track.d.mts.map +1 -1
  434. package/dist/slider/slider-track.mjs +2 -0
  435. package/dist/slider/slider-track.mjs.map +1 -1
  436. package/dist/slider/slider-value.d.mts +11 -0
  437. package/dist/slider/slider-value.d.mts.map +1 -1
  438. package/dist/slider/slider-value.mjs +2 -0
  439. package/dist/slider/slider-value.mjs.map +1 -1
  440. package/dist/switch/switch.d.mts +23 -3
  441. package/dist/switch/switch.d.mts.map +1 -1
  442. package/dist/switch/switch.mjs +2 -0
  443. package/dist/switch/switch.mjs.map +1 -1
  444. package/dist/tabs/index.d.mts +2 -0
  445. package/dist/tabs/index.d.mts.map +1 -1
  446. package/dist/tabs/index.mjs +2 -0
  447. package/dist/tabs/index.mjs.map +1 -1
  448. package/dist/tabs/tabs-context.d.mts +5 -0
  449. package/dist/tabs/tabs-context.d.mts.map +1 -1
  450. package/dist/tabs/tabs-context.mjs.map +1 -1
  451. package/dist/tabs/tabs-indicator.d.mts +17 -0
  452. package/dist/tabs/tabs-indicator.d.mts.map +1 -1
  453. package/dist/tabs/tabs-indicator.mjs +2 -0
  454. package/dist/tabs/tabs-indicator.mjs.map +1 -1
  455. package/dist/tabs/tabs-list.d.mts +19 -1
  456. package/dist/tabs/tabs-list.d.mts.map +1 -1
  457. package/dist/tabs/tabs-list.mjs +2 -0
  458. package/dist/tabs/tabs-list.mjs.map +1 -1
  459. package/dist/tabs/tabs-panel.d.mts +19 -0
  460. package/dist/tabs/tabs-panel.d.mts.map +1 -1
  461. package/dist/tabs/tabs-panel.mjs +2 -0
  462. package/dist/tabs/tabs-panel.mjs.map +1 -1
  463. package/dist/tabs/tabs-root.d.mts +39 -5
  464. package/dist/tabs/tabs-root.d.mts.map +1 -1
  465. package/dist/tabs/tabs-root.mjs +2 -0
  466. package/dist/tabs/tabs-root.mjs.map +1 -1
  467. package/dist/tabs/tabs-tab.d.mts +22 -1
  468. package/dist/tabs/tabs-tab.d.mts.map +1 -1
  469. package/dist/tabs/tabs-tab.mjs +2 -0
  470. package/dist/tabs/tabs-tab.mjs.map +1 -1
  471. package/dist/toast/index.d.mts +2 -0
  472. package/dist/toast/index.d.mts.map +1 -1
  473. package/dist/toast/index.mjs +2 -0
  474. package/dist/toast/index.mjs.map +1 -1
  475. package/dist/toast/toast-action.d.mts +28 -3
  476. package/dist/toast/toast-action.d.mts.map +1 -1
  477. package/dist/toast/toast-action.mjs +2 -0
  478. package/dist/toast/toast-action.mjs.map +1 -1
  479. package/dist/toast/toast-close.d.mts +16 -0
  480. package/dist/toast/toast-close.d.mts.map +1 -1
  481. package/dist/toast/toast-close.mjs +2 -0
  482. package/dist/toast/toast-close.mjs.map +1 -1
  483. package/dist/toast/toast-description.d.mts +16 -1
  484. package/dist/toast/toast-description.d.mts.map +1 -1
  485. package/dist/toast/toast-description.mjs +2 -0
  486. package/dist/toast/toast-description.mjs.map +1 -1
  487. package/dist/toast/toast-root.d.mts +20 -0
  488. package/dist/toast/toast-root.d.mts.map +1 -1
  489. package/dist/toast/toast-root.mjs +2 -0
  490. package/dist/toast/toast-root.mjs.map +1 -1
  491. package/dist/toast/toast-title.d.mts +15 -1
  492. package/dist/toast/toast-title.d.mts.map +1 -1
  493. package/dist/toast/toast-title.mjs +2 -0
  494. package/dist/toast/toast-title.mjs.map +1 -1
  495. package/dist/toast/toast-viewport.d.mts +34 -5
  496. package/dist/toast/toast-viewport.d.mts.map +1 -1
  497. package/dist/toast/toast-viewport.mjs +2 -0
  498. package/dist/toast/toast-viewport.mjs.map +1 -1
  499. package/dist/toast/toast.d.mts +46 -6
  500. package/dist/toast/toast.d.mts.map +1 -1
  501. package/dist/toast/toast.mjs +4 -0
  502. package/dist/toast/toast.mjs.map +1 -1
  503. package/dist/toggle/toggle.d.mts +20 -2
  504. package/dist/toggle/toggle.d.mts.map +1 -1
  505. package/dist/toggle/toggle.mjs +2 -0
  506. package/dist/toggle/toggle.mjs.map +1 -1
  507. package/dist/toggle-group/index.d.mts +2 -0
  508. package/dist/toggle-group/index.d.mts.map +1 -1
  509. package/dist/toggle-group/index.mjs +2 -0
  510. package/dist/toggle-group/index.mjs.map +1 -1
  511. package/dist/toggle-group/toggle-group-context.d.mts +1 -0
  512. package/dist/toggle-group/toggle-group-context.d.mts.map +1 -1
  513. package/dist/toggle-group/toggle-group-context.mjs.map +1 -1
  514. package/dist/toggle-group/toggle-group-item.d.mts +16 -0
  515. package/dist/toggle-group/toggle-group-item.d.mts.map +1 -1
  516. package/dist/toggle-group/toggle-group-item.mjs +2 -0
  517. package/dist/toggle-group/toggle-group-item.mjs.map +1 -1
  518. package/dist/toggle-group/toggle-group-root.d.mts +73 -12
  519. package/dist/toggle-group/toggle-group-root.d.mts.map +1 -1
  520. package/dist/toggle-group/toggle-group-root.mjs +2 -0
  521. package/dist/toggle-group/toggle-group-root.mjs.map +1 -1
  522. package/dist/toolbar/index.d.mts +2 -0
  523. package/dist/toolbar/index.d.mts.map +1 -1
  524. package/dist/toolbar/index.mjs +2 -0
  525. package/dist/toolbar/index.mjs.map +1 -1
  526. package/dist/toolbar/toolbar-root.d.mts +30 -3
  527. package/dist/toolbar/toolbar-root.d.mts.map +1 -1
  528. package/dist/toolbar/toolbar-root.mjs +2 -0
  529. package/dist/toolbar/toolbar-root.mjs.map +1 -1
  530. package/dist/toolbar/toolbar-separator.d.mts +13 -0
  531. package/dist/toolbar/toolbar-separator.d.mts.map +1 -1
  532. package/dist/toolbar/toolbar-separator.mjs +2 -0
  533. package/dist/toolbar/toolbar-separator.mjs.map +1 -1
  534. package/dist/tooltip/index.d.mts +2 -0
  535. package/dist/tooltip/index.d.mts.map +1 -1
  536. package/dist/tooltip/index.mjs +2 -0
  537. package/dist/tooltip/index.mjs.map +1 -1
  538. package/dist/tooltip/tooltip-arrow.d.mts +16 -0
  539. package/dist/tooltip/tooltip-arrow.d.mts.map +1 -1
  540. package/dist/tooltip/tooltip-arrow.mjs +2 -0
  541. package/dist/tooltip/tooltip-arrow.mjs.map +1 -1
  542. package/dist/tooltip/tooltip-context.d.mts +4 -0
  543. package/dist/tooltip/tooltip-context.d.mts.map +1 -1
  544. package/dist/tooltip/tooltip-context.mjs.map +1 -1
  545. package/dist/tooltip/tooltip-popup.d.mts +24 -3
  546. package/dist/tooltip/tooltip-popup.d.mts.map +1 -1
  547. package/dist/tooltip/tooltip-popup.mjs +2 -0
  548. package/dist/tooltip/tooltip-popup.mjs.map +1 -1
  549. package/dist/tooltip/tooltip-root.d.mts +24 -2
  550. package/dist/tooltip/tooltip-root.d.mts.map +1 -1
  551. package/dist/tooltip/tooltip-root.mjs +2 -0
  552. package/dist/tooltip/tooltip-root.mjs.map +1 -1
  553. package/dist/tooltip/tooltip-trigger.d.mts +18 -1
  554. package/dist/tooltip/tooltip-trigger.d.mts.map +1 -1
  555. package/dist/tooltip/tooltip-trigger.mjs +2 -0
  556. package/dist/tooltip/tooltip-trigger.mjs.map +1 -1
  557. package/package.json +9 -1
  558. package/skills/funstack-ui-knowledge/SKILL.md +75 -0
@@ -2,13 +2,24 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { ToolbarOrientation } from "./toolbar-root.mjs";
3
3
  import { CSSProperties, ComponentPropsWithRef } from "react";
4
4
  //#region src/toolbar/toolbar-separator.d.ts
5
+ /**
6
+ * State of `Toolbar.Separator`, passed to the function forms of `className`, `style` and `render`.
7
+ */
5
8
  export interface ToolbarSeparatorState {
6
9
  /** The separator's own orientation: perpendicular to the Toolbar's. */
7
10
  readonly orientation: ToolbarOrientation;
8
11
  }
12
+ /**
13
+ * Props of `Toolbar.Separator`.
14
+ *
15
+ * @see https://ui.funstack.work/components/toolbar
16
+ */
9
17
  export interface ToolbarSeparatorProps extends Omit<ComponentPropsWithRef<"hr">, "aria-orientation" | "className" | "style" | "children"> {
18
+ /** Class name, or a function of the part's state that returns one. */
10
19
  className?: StateValue<string | undefined, ToolbarSeparatorState>;
20
+ /** Inline style, or a function of the part's state that returns one. */
11
21
  style?: StateValue<CSSProperties | undefined, ToolbarSeparatorState>;
22
+ /** Replace the default `<hr>` (element form) or take over rendering (function form). */
12
23
  render?: RenderProp<ComponentPropsWithRef<"hr">, ToolbarSeparatorState>;
13
24
  }
14
25
  /**
@@ -16,6 +27,8 @@ export interface ToolbarSeparatorProps extends Omit<ComponentPropsWithRef<"hr">,
16
27
  * a vertical one. Not focusable, not an item.
17
28
  *
18
29
  * Owned keys (conventions 1.2): `aria-orientation`, `data-orientation`.
30
+ *
31
+ * @see https://ui.funstack.work/components/toolbar
19
32
  */
20
33
  export declare function ToolbarSeparator({ className, style, render, ...rest }: ToolbarSeparatorProps): import("react").ReactNode;
21
34
  export declare namespace ToolbarSeparator {
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar-separator.d.mts","names":[],"sources":["../../src/toolbar/toolbar-separator.tsx"],"mappings":";;;;iBAOiB;;WAEN,aAAa;;iBAGP,8BAA8B,KAC7C;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;EAC9C,SAAS,WAAW,6BAA6B;;;;;;;;wBASnC,mBAAmB,WAAW,OAAO,WAAW,QAAQ,wCAAqB;yBAA7E"}
1
+ {"version":3,"file":"toolbar-separator.d.mts","names":[],"sources":["../../src/toolbar/toolbar-separator.tsx"],"mappings":";;;;;;;iBAUiB;;WAEN,aAAa;;;;;;;iBAQP,8BAA8B,KAC7C;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,SAAS,WAAW,6BAA6B;;;;;;;;;;wBAWnC,mBAAmB,WAAW,OAAO,WAAW,QAAQ,wCAAqB;yBAA7E"}
@@ -7,6 +7,8 @@ import { useRender } from "../internal/use-render.mjs";
7
7
  * a vertical one. Not focusable, not an item.
8
8
  *
9
9
  * Owned keys (conventions 1.2): `aria-orientation`, `data-orientation`.
10
+ *
11
+ * @see https://ui.funstack.work/components/toolbar
10
12
  */
11
13
  function ToolbarSeparator({ className, style, render, ...rest }) {
12
14
  const orientation = useToolbarContext()?.orientation === "vertical" ? "horizontal" : "vertical";
@@ -1 +1 @@
1
- {"version":3,"file":"toolbar-separator.mjs","names":[],"sources":["../../src/toolbar/toolbar-separator.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties } from \"react\";\nimport { useToolbarContext } from \"../internal/toolbar-context.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport type { ToolbarOrientation } from \"./toolbar-root.js\";\n\nexport interface ToolbarSeparatorState {\n /** The separator's own orientation: perpendicular to the Toolbar's. */\n readonly orientation: ToolbarOrientation;\n}\n\nexport interface ToolbarSeparatorProps extends Omit<\n ComponentPropsWithRef<\"hr\">,\n \"aria-orientation\" | \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, ToolbarSeparatorState>;\n style?: StateValue<CSSProperties | undefined, ToolbarSeparatorState>;\n render?: RenderProp<ComponentPropsWithRef<\"hr\">, ToolbarSeparatorState>;\n}\n\n/**\n * `<hr aria-orientation>` between toolbar items: vertical in a horizontal Toolbar, horizontal in\n * a vertical one. Not focusable, not an item.\n *\n * Owned keys (conventions 1.2): `aria-orientation`, `data-orientation`.\n */\nexport function ToolbarSeparator({ className, style, render, ...rest }: ToolbarSeparatorProps) {\n const toolbar = useToolbarContext();\n const orientation: ToolbarOrientation =\n toolbar?.orientation === \"vertical\" ? \"horizontal\" : \"vertical\";\n const state: ToolbarSeparatorState = { orientation };\n\n return useRender<ComponentPropsWithRef<\"hr\">, ToolbarSeparatorState>({\n defaultElement: \"hr\",\n render,\n state,\n className,\n style,\n children: undefined,\n props: rest,\n libraryProps: {\n \"aria-orientation\": orientation,\n \"data-orientation\": orientation,\n },\n });\n}\n\nToolbarSeparator.displayName = \"ToolbarSeparator\";\n"],"mappings":";;;;;;;;;;AA2BA,SAAgB,iBAAiB,EAAE,WAAW,OAAO,QAAQ,GAAG,QAA+B;CAE7F,MAAM,cADU,kBAER,CAAC,EAAE,gBAAgB,aAAa,eAAe;CAGvD,OAAO,UAA8D;EACnE,gBAAgB;EAChB;EACA,OAAA,EALqC,YAKjC;EACJ;EACA;EACA,UAAU,KAAA;EACV,OAAO;EACP,cAAc;GACZ,oBAAoB;GACpB,oBAAoB;EACtB;CACF,CAAC;AACH;AAEA,iBAAiB,cAAc"}
1
+ {"version":3,"file":"toolbar-separator.mjs","names":[],"sources":["../../src/toolbar/toolbar-separator.tsx"],"sourcesContent":["\"use client\";\nimport type { ComponentPropsWithRef, CSSProperties } from \"react\";\nimport { useToolbarContext } from \"../internal/toolbar-context.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport type { ToolbarOrientation } from \"./toolbar-root.js\";\n\n/**\n * State of `Toolbar.Separator`, passed to the function forms of `className`, `style` and `render`.\n */\nexport interface ToolbarSeparatorState {\n /** The separator's own orientation: perpendicular to the Toolbar's. */\n readonly orientation: ToolbarOrientation;\n}\n\n/**\n * Props of `Toolbar.Separator`.\n *\n * @see https://ui.funstack.work/components/toolbar\n */\nexport interface ToolbarSeparatorProps extends Omit<\n ComponentPropsWithRef<\"hr\">,\n \"aria-orientation\" | \"className\" | \"style\" | \"children\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, ToolbarSeparatorState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, ToolbarSeparatorState>;\n /** Replace the default `<hr>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"hr\">, ToolbarSeparatorState>;\n}\n\n/**\n * `<hr aria-orientation>` between toolbar items: vertical in a horizontal Toolbar, horizontal in\n * a vertical one. Not focusable, not an item.\n *\n * Owned keys (conventions 1.2): `aria-orientation`, `data-orientation`.\n *\n * @see https://ui.funstack.work/components/toolbar\n */\nexport function ToolbarSeparator({ className, style, render, ...rest }: ToolbarSeparatorProps) {\n const toolbar = useToolbarContext();\n const orientation: ToolbarOrientation =\n toolbar?.orientation === \"vertical\" ? \"horizontal\" : \"vertical\";\n const state: ToolbarSeparatorState = { orientation };\n\n return useRender<ComponentPropsWithRef<\"hr\">, ToolbarSeparatorState>({\n defaultElement: \"hr\",\n render,\n state,\n className,\n style,\n children: undefined,\n props: rest,\n libraryProps: {\n \"aria-orientation\": orientation,\n \"data-orientation\": orientation,\n },\n });\n}\n\nToolbarSeparator.displayName = \"ToolbarSeparator\";\n"],"mappings":";;;;;;;;;;;;AAwCA,SAAgB,iBAAiB,EAAE,WAAW,OAAO,QAAQ,GAAG,QAA+B;CAE7F,MAAM,cADU,kBAER,CAAC,EAAE,gBAAgB,aAAa,eAAe;CAGvD,OAAO,UAA8D;EACnE,gBAAgB;EAChB;EACA,OAAA,EALqC,YAKjC;EACJ;EACA;EACA,UAAU,KAAA;EACV,OAAO;EACP,cAAc;GACZ,oBAAoB;GACpB,oBAAoB;EACtB;CACF,CAAC;AACH;AAEA,iBAAiB,cAAc"}
@@ -11,6 +11,8 @@ import { TooltipTrigger, TooltipTriggerProps, TooltipTriggerState } from "./tool
11
11
  * top layer and is placed with CSS Anchor Positioning, `Arrow` (decorative `span`) echoes the
12
12
  * Popup's resolved side. Open state is browser-owned: no `open` prop, no action, style with
13
13
  * `:popover-open`. Render the Popup immediately after the Trigger.
14
+ *
15
+ * @see https://ui.funstack.work/components/tooltip
14
16
  */
15
17
  export declare const Tooltip: {
16
18
  readonly Root: typeof TooltipRoot;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/tooltip/index.ts"],"mappings":";;;;;;;;;;;;;;qBAea;WACX,aAAI;WACJ,gBAAO;WACP,cAAK;WACL,cAAK"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/tooltip/index.ts"],"mappings":";;;;;;;;;;;;;;;;qBAiBa;WACX,aAAI;WACJ,gBAAO;WACP,cAAK;WACL,cAAK"}
@@ -9,6 +9,8 @@ import { TooltipTrigger } from "./tooltip-trigger.mjs";
9
9
  * top layer and is placed with CSS Anchor Positioning, `Arrow` (decorative `span`) echoes the
10
10
  * Popup's resolved side. Open state is browser-owned: no `open` prop, no action, style with
11
11
  * `:popover-open`. Render the Popup immediately after the Trigger.
12
+ *
13
+ * @see https://ui.funstack.work/components/tooltip
12
14
  */
13
15
  const Tooltip = {
14
16
  Root: TooltipRoot,
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/tooltip/index.ts"],"sourcesContent":["// Ships the platform attribute typings with this subpath (conventions 7.4). Type-only: the\n// built JS has no import of it.\nimport \"../internal/platform-attributes.js\";\nimport { TooltipArrow } from \"./tooltip-arrow.js\";\nimport { TooltipPopup } from \"./tooltip-popup.js\";\nimport { TooltipRoot } from \"./tooltip-root.js\";\nimport { TooltipTrigger } from \"./tooltip-trigger.js\";\n\n/**\n * Tooltip (WAI-ARIA APG Tooltip pattern): `Root` (no DOM) owns the id and the interaction,\n * `Trigger` (button) is hovered or focused, `Popup` (`div[popover] role=\"tooltip\"`) lives in the\n * top layer and is placed with CSS Anchor Positioning, `Arrow` (decorative `span`) echoes the\n * Popup's resolved side. Open state is browser-owned: no `open` prop, no action, style with\n * `:popover-open`. Render the Popup immediately after the Trigger.\n */\nexport const Tooltip = {\n Root: TooltipRoot,\n Trigger: TooltipTrigger,\n Popup: TooltipPopup,\n Arrow: TooltipArrow,\n} as const;\n\nexport type { TooltipRootProps, TooltipRootState, TooltipProvides } from \"./tooltip-root.js\";\nexport type { TooltipTriggerProps, TooltipTriggerState } from \"./tooltip-trigger.js\";\nexport type {\n TooltipPopupProps,\n TooltipPopupState,\n TooltipSide,\n TooltipAlign,\n} from \"./tooltip-popup.js\";\nexport type { TooltipArrowProps, TooltipArrowState } from \"./tooltip-arrow.js\";\n"],"mappings":";;;;;;;;;;;;AAeA,MAAa,UAAU;CACrB,MAAM;CACN,SAAS;CACT,OAAO;CACP,OAAO;AACT"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/tooltip/index.ts"],"sourcesContent":["// Ships the platform attribute typings with this subpath (conventions 7.4). Type-only: the\n// built JS has no import of it.\nimport \"../internal/platform-attributes.js\";\nimport { TooltipArrow } from \"./tooltip-arrow.js\";\nimport { TooltipPopup } from \"./tooltip-popup.js\";\nimport { TooltipRoot } from \"./tooltip-root.js\";\nimport { TooltipTrigger } from \"./tooltip-trigger.js\";\n\n/**\n * Tooltip (WAI-ARIA APG Tooltip pattern): `Root` (no DOM) owns the id and the interaction,\n * `Trigger` (button) is hovered or focused, `Popup` (`div[popover] role=\"tooltip\"`) lives in the\n * top layer and is placed with CSS Anchor Positioning, `Arrow` (decorative `span`) echoes the\n * Popup's resolved side. Open state is browser-owned: no `open` prop, no action, style with\n * `:popover-open`. Render the Popup immediately after the Trigger.\n *\n * @see https://ui.funstack.work/components/tooltip\n */\nexport const Tooltip = {\n Root: TooltipRoot,\n Trigger: TooltipTrigger,\n Popup: TooltipPopup,\n Arrow: TooltipArrow,\n} as const;\n\nexport type { TooltipRootProps, TooltipRootState, TooltipProvides } from \"./tooltip-root.js\";\nexport type { TooltipTriggerProps, TooltipTriggerState } from \"./tooltip-trigger.js\";\nexport type {\n TooltipPopupProps,\n TooltipPopupState,\n TooltipSide,\n TooltipAlign,\n} from \"./tooltip-popup.js\";\nexport type { TooltipArrowProps, TooltipArrowState } from \"./tooltip-arrow.js\";\n"],"mappings":";;;;;;;;;;;;;;AAiBA,MAAa,UAAU;CACrB,MAAM;CACN,SAAS;CACT,OAAO;CACP,OAAO;AACT"}
@@ -2,15 +2,29 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { TooltipAlign, TooltipSide } from "./tooltip-context.mjs";
3
3
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
4
4
  //#region src/tooltip/tooltip-arrow.d.ts
5
+ /**
6
+ * State of `Tooltip.Arrow`, passed to the function forms of `className`, `style`, `children` and
7
+ * `render`.
8
+ */
5
9
  export interface TooltipArrowState {
6
10
  /** The Popup's side: resolved while shown (after any flip), requested otherwise. */
7
11
  readonly side: TooltipSide | null;
12
+ /** The Popup's alignment: resolved while shown, requested otherwise. */
8
13
  readonly align: TooltipAlign;
9
14
  }
15
+ /**
16
+ * Props of `Tooltip.Arrow`.
17
+ *
18
+ * @see https://ui.funstack.work/components/tooltip
19
+ */
10
20
  export interface TooltipArrowProps extends Omit<ComponentPropsWithRef<"span">, "aria-hidden" | "className" | "style" | "children"> {
21
+ /** Class name, or a function of the part's state that returns one. */
11
22
  className?: StateValue<string | undefined, TooltipArrowState>;
23
+ /** Inline style, or a function of the part's state that returns one. */
12
24
  style?: StateValue<CSSProperties | undefined, TooltipArrowState>;
25
+ /** Content, or a function of the part's state. */
13
26
  children?: StateValue<ReactNode, TooltipArrowState>;
27
+ /** Replace the default `<span>` (element form) or take over rendering (function form). */
14
28
  render?: RenderProp<ComponentPropsWithRef<"span">, TooltipArrowState>;
15
29
  }
16
30
  /**
@@ -21,6 +35,8 @@ export interface TooltipArrowProps extends Omit<ComponentPropsWithRef<"span">, "
21
35
  *
22
36
  * Owned keys (conventions 1.2): `aria-hidden`, and `data-side` / `data-align` unless the Popup's
23
37
  * `side` is `null`.
38
+ *
39
+ * @see https://ui.funstack.work/components/tooltip
24
40
  */
25
41
  export declare function TooltipArrow({ className, style, children, render, ...rest }: TooltipArrowProps): ReactNode;
26
42
  export declare namespace TooltipArrow {
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-arrow.d.mts","names":[],"sources":["../../src/tooltip/tooltip-arrow.tsx"],"mappings":";;;;iBASiB;;WAEN,MAAM;WACN,OAAO;;iBAGD,0BAA0B,KACzC;EAGA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;EAC9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,+BAA+B;;;;;;;;;;;wBAYrC,eAAe,WAAW,OAAO,UAAU,WAAW,QAAQ,oBAAiB;yBAA/E"}
1
+ {"version":3,"file":"tooltip-arrow.d.mts","names":[],"sources":["../../src/tooltip/tooltip-arrow.tsx"],"mappings":";;;;;;;;iBAaiB;;WAEN,MAAM;;WAEN,OAAO;;;;;;;iBAQD,0BAA0B,KACzC;;EAIA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,+BAA+B;;;;;;;;;;;;;wBAcrC,eAAe,WAAW,OAAO,UAAU,WAAW,QAAQ,oBAAiB;yBAA/E"}
@@ -11,6 +11,8 @@ import { use } from "react";
11
11
  *
12
12
  * Owned keys (conventions 1.2): `aria-hidden`, and `data-side` / `data-align` unless the Popup's
13
13
  * `side` is `null`.
14
+ *
15
+ * @see https://ui.funstack.work/components/tooltip
14
16
  */
15
17
  function TooltipArrow({ className, style, children, render, ...rest }) {
16
18
  const placement = use(TooltipPopupContext);
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-arrow.mjs","names":[],"sources":["../../src/tooltip/tooltip-arrow.tsx"],"sourcesContent":["\"use client\";\nimport { use } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { TooltipPopupContext } from \"./tooltip-context.js\";\nimport type { TooltipAlign, TooltipSide } from \"./tooltip-context.js\";\n\nexport interface TooltipArrowState {\n /** The Popup's side: resolved while shown (after any flip), requested otherwise. */\n readonly side: TooltipSide | null;\n readonly align: TooltipAlign;\n}\n\nexport interface TooltipArrowProps extends Omit<\n ComponentPropsWithRef<\"span\">,\n \"aria-hidden\" | \"className\" | \"style\" | \"children\"\n> {\n className?: StateValue<string | undefined, TooltipArrowState>;\n style?: StateValue<CSSProperties | undefined, TooltipArrowState>;\n children?: StateValue<ReactNode, TooltipArrowState>;\n render?: RenderProp<ComponentPropsWithRef<\"span\">, TooltipArrowState>;\n}\n\n/**\n * A decorative `<span aria-hidden=\"true\">` inside `Tooltip.Popup` that draws nothing itself: it\n * echoes the Popup's `data-side` / `data-align`, which are the **resolved** placement while the\n * tooltip is shown (design 7.4), so CSS keyed on `[data-side]` puts it on the edge that faces the\n * trigger, after a `position-try-fallbacks` flip as well.\n *\n * Owned keys (conventions 1.2): `aria-hidden`, and `data-side` / `data-align` unless the Popup's\n * `side` is `null`.\n */\nexport function TooltipArrow({ className, style, children, render, ...rest }: TooltipArrowProps) {\n const placement = use(TooltipPopupContext);\n if (placement === null) {\n throw new Error(\"Tooltip.Arrow must be rendered inside a Tooltip.Popup.\");\n }\n const { side, align } = placement;\n const state: TooltipArrowState = { side, align };\n\n const libraryProps: ComponentPropsWithRef<\"span\"> & DataAttributes = {\n \"aria-hidden\": true,\n ...(side !== null && { \"data-side\": side, \"data-align\": align }),\n };\n\n return useRender<ComponentPropsWithRef<\"span\">, TooltipArrowState>({\n defaultElement: \"span\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps,\n });\n}\n\nTooltipArrow.displayName = \"TooltipArrow\";\n"],"mappings":";;;;;;;;;;;;;;AAkCA,SAAgB,aAAa,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA2B;CAC/F,MAAM,YAAY,IAAI,mBAAmB;CACzC,IAAI,cAAc,MAChB,MAAM,IAAI,MAAM,wDAAwD;CAE1E,MAAM,EAAE,MAAM,UAAU;CACxB,MAAM,QAA2B;EAAE;EAAM;CAAM;CAE/C,MAAM,eAA+D;EACnE,eAAe;EACf,GAAI,SAAS,QAAQ;GAAE,aAAa;GAAM,cAAc;EAAM;CAChE;CAEA,OAAO,UAA4D;EACjE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;CACF,CAAC;AACH;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"tooltip-arrow.mjs","names":[],"sources":["../../src/tooltip/tooltip-arrow.tsx"],"sourcesContent":["\"use client\";\nimport { use } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { TooltipPopupContext } from \"./tooltip-context.js\";\nimport type { TooltipAlign, TooltipSide } from \"./tooltip-context.js\";\n\n/**\n * State of `Tooltip.Arrow`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface TooltipArrowState {\n /** The Popup's side: resolved while shown (after any flip), requested otherwise. */\n readonly side: TooltipSide | null;\n /** The Popup's alignment: resolved while shown, requested otherwise. */\n readonly align: TooltipAlign;\n}\n\n/**\n * Props of `Tooltip.Arrow`.\n *\n * @see https://ui.funstack.work/components/tooltip\n */\nexport interface TooltipArrowProps extends Omit<\n ComponentPropsWithRef<\"span\">,\n \"aria-hidden\" | \"className\" | \"style\" | \"children\"\n> {\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, TooltipArrowState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, TooltipArrowState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, TooltipArrowState>;\n /** Replace the default `<span>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"span\">, TooltipArrowState>;\n}\n\n/**\n * A decorative `<span aria-hidden=\"true\">` inside `Tooltip.Popup` that draws nothing itself: it\n * echoes the Popup's `data-side` / `data-align`, which are the **resolved** placement while the\n * tooltip is shown (design 7.4), so CSS keyed on `[data-side]` puts it on the edge that faces the\n * trigger, after a `position-try-fallbacks` flip as well.\n *\n * Owned keys (conventions 1.2): `aria-hidden`, and `data-side` / `data-align` unless the Popup's\n * `side` is `null`.\n *\n * @see https://ui.funstack.work/components/tooltip\n */\nexport function TooltipArrow({ className, style, children, render, ...rest }: TooltipArrowProps) {\n const placement = use(TooltipPopupContext);\n if (placement === null) {\n throw new Error(\"Tooltip.Arrow must be rendered inside a Tooltip.Popup.\");\n }\n const { side, align } = placement;\n const state: TooltipArrowState = { side, align };\n\n const libraryProps: ComponentPropsWithRef<\"span\"> & DataAttributes = {\n \"aria-hidden\": true,\n ...(side !== null && { \"data-side\": side, \"data-align\": align }),\n };\n\n return useRender<ComponentPropsWithRef<\"span\">, TooltipArrowState>({\n defaultElement: \"span\",\n render,\n state,\n className,\n style,\n children,\n props: rest,\n libraryProps,\n });\n}\n\nTooltipArrow.displayName = \"TooltipArrow\";\n"],"mappings":";;;;;;;;;;;;;;;;AAkDA,SAAgB,aAAa,EAAE,WAAW,OAAO,UAAU,QAAQ,GAAG,QAA2B;CAC/F,MAAM,YAAY,IAAI,mBAAmB;CACzC,IAAI,cAAc,MAChB,MAAM,IAAI,MAAM,wDAAwD;CAE1E,MAAM,EAAE,MAAM,UAAU;CACxB,MAAM,QAA2B;EAAE;EAAM;CAAM;CAE/C,MAAM,eAA+D;EACnE,eAAe;EACf,GAAI,SAAS,QAAQ;GAAE,aAAa;GAAM,cAAc;EAAM;CAChE;CAEA,OAAO,UAA4D;EACjE,gBAAgB;EAChB;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;CACF,CAAC;AACH;AAEA,aAAa,cAAc"}
@@ -5,6 +5,10 @@ import { AnchorAlign, AnchorSide } from "../internal/anchor-position.mjs";
5
5
  * shown, the state carries the resolved physical side.
6
6
  */
7
7
  export type TooltipSide = AnchorSide;
8
+ /**
9
+ * Alignment of the Popup along its side: inline-relative on a top / bottom side, the top / bottom
10
+ * edges on the others.
11
+ */
8
12
  export type TooltipAlign = AnchorAlign;
9
13
  /** Which accessibility relation the tooltip provides for its trigger (design section 5.1). */
10
14
  export type TooltipProvides = "description" | "name";
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-context.d.mts","names":[],"sources":["../../src/tooltip/tooltip-context.ts"],"mappings":";;;;;;YAQY,cAAc;YACd,eAAe;;YAGf"}
1
+ {"version":3,"file":"tooltip-context.d.mts","names":[],"sources":["../../src/tooltip/tooltip-context.ts"],"mappings":";;;;;;YAQY,cAAc;;;;;YAKd,eAAe;;YAGf"}
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-context.mjs","names":[],"sources":["../../src/tooltip/tooltip-context.ts"],"sourcesContent":["\"use client\";\nimport { createContext, use } from \"react\";\nimport type { AnchorAlign, AnchorSide } from \"../internal/anchor-position.js\";\n\n/**\n * `inline-start` / `inline-end` follow the popup's `direction` (conventions 13.1). While\n * shown, the state carries the resolved physical side.\n */\nexport type TooltipSide = AnchorSide;\nexport type TooltipAlign = AnchorAlign;\n\n/** Which accessibility relation the tooltip provides for its trigger (design section 5.1). */\nexport type TooltipProvides = \"description\" | \"name\";\n\nexport interface TooltipContextValue {\n /** Id of the Popup; the Trigger references it through `aria-describedby` / `aria-labelledby`. */\n readonly popupId: string;\n readonly disabled: boolean;\n /** Written onto the Trigger as `interest-delay-start` / `-end` on the native path. */\n readonly delay: number;\n readonly closeDelay: number;\n readonly provides: TooltipProvides;\n /** Trigger and Popup register their elements through callback refs (design 12.2). */\n readonly setTriggerElement: (element: HTMLElement | null) => void;\n readonly setPopupElement: (element: HTMLElement | null) => void;\n /**\n * The Trigger reports whether it renders `interestfor`, so the Root's interaction effect re-runs\n * (and re-detects the native path) when `experimental_interestFor` changes after mount.\n */\n readonly setInterestForRequested: (requested: boolean) => void;\n}\n\nexport const TooltipContext = createContext<TooltipContextValue | null>(null);\n\n/** What `Tooltip.Popup` tells its `Tooltip.Arrow`: the placement it renders (design 12.2). */\nexport interface TooltipPopupContextValue {\n /** The resolved side while shown, else the requested one; `null` with `side={null}`. */\n readonly side: TooltipSide | null;\n readonly align: TooltipAlign;\n}\n\nexport const TooltipPopupContext = createContext<TooltipPopupContextValue | null>(null);\n\nexport function useTooltipContext(part: string): TooltipContextValue {\n const context = use(TooltipContext);\n if (context === null) {\n throw new Error(`${part} must be rendered inside a Tooltip.Root.`);\n }\n return context;\n}\n"],"mappings":";;;AAgCA,MAAa,iBAAiB,cAA0C,IAAI;AAS5E,MAAa,sBAAsB,cAA+C,IAAI;AAEtF,SAAgB,kBAAkB,MAAmC;CACnE,MAAM,UAAU,IAAI,cAAc;CAClC,IAAI,YAAY,MACd,MAAM,IAAI,MAAM,GAAG,KAAK,yCAAyC;CAEnE,OAAO;AACT"}
1
+ {"version":3,"file":"tooltip-context.mjs","names":[],"sources":["../../src/tooltip/tooltip-context.ts"],"sourcesContent":["\"use client\";\nimport { createContext, use } from \"react\";\nimport type { AnchorAlign, AnchorSide } from \"../internal/anchor-position.js\";\n\n/**\n * `inline-start` / `inline-end` follow the popup's `direction` (conventions 13.1). While\n * shown, the state carries the resolved physical side.\n */\nexport type TooltipSide = AnchorSide;\n/**\n * Alignment of the Popup along its side: inline-relative on a top / bottom side, the top / bottom\n * edges on the others.\n */\nexport type TooltipAlign = AnchorAlign;\n\n/** Which accessibility relation the tooltip provides for its trigger (design section 5.1). */\nexport type TooltipProvides = \"description\" | \"name\";\n\nexport interface TooltipContextValue {\n /** Id of the Popup; the Trigger references it through `aria-describedby` / `aria-labelledby`. */\n readonly popupId: string;\n readonly disabled: boolean;\n /** Written onto the Trigger as `interest-delay-start` / `-end` on the native path. */\n readonly delay: number;\n readonly closeDelay: number;\n readonly provides: TooltipProvides;\n /** Trigger and Popup register their elements through callback refs (design 12.2). */\n readonly setTriggerElement: (element: HTMLElement | null) => void;\n readonly setPopupElement: (element: HTMLElement | null) => void;\n /**\n * The Trigger reports whether it renders `interestfor`, so the Root's interaction effect re-runs\n * (and re-detects the native path) when `experimental_interestFor` changes after mount.\n */\n readonly setInterestForRequested: (requested: boolean) => void;\n}\n\nexport const TooltipContext = createContext<TooltipContextValue | null>(null);\n\n/** What `Tooltip.Popup` tells its `Tooltip.Arrow`: the placement it renders (design 12.2). */\nexport interface TooltipPopupContextValue {\n /** The resolved side while shown, else the requested one; `null` with `side={null}`. */\n readonly side: TooltipSide | null;\n readonly align: TooltipAlign;\n}\n\nexport const TooltipPopupContext = createContext<TooltipPopupContextValue | null>(null);\n\nexport function useTooltipContext(part: string): TooltipContextValue {\n const context = use(TooltipContext);\n if (context === null) {\n throw new Error(`${part} must be rendered inside a Tooltip.Root.`);\n }\n return context;\n}\n"],"mappings":";;;AAoCA,MAAa,iBAAiB,cAA0C,IAAI;AAS5E,MAAa,sBAAsB,cAA+C,IAAI;AAEtF,SAAgB,kBAAkB,MAAmC;CACnE,MAAM,UAAU,IAAI,cAAc;CAClC,IAAI,YAAY,MACd,MAAM,IAAI,MAAM,GAAG,KAAK,yCAAyC;CAEnE,OAAO;AACT"}
@@ -2,7 +2,12 @@ import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { TooltipAlign, TooltipSide } from "./tooltip-context.mjs";
3
3
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
4
4
  //#region src/tooltip/tooltip-popup.d.ts
5
+ /**
6
+ * State of `Tooltip.Popup`, passed to the function forms of `className`, `style`, `children` and
7
+ * `render`.
8
+ */
5
9
  export interface TooltipPopupState {
10
+ /** The Root's `disabled`. */
6
11
  readonly disabled: boolean;
7
12
  /**
8
13
  * While shown: the physical side the browser placed the popup on (`"top"` / `"bottom"` /
@@ -13,34 +18,48 @@ export interface TooltipPopupState {
13
18
  /** While shown: the resolved alignment; otherwise the `align` prop. */
14
19
  readonly align: TooltipAlign;
15
20
  }
21
+ /**
22
+ * Props of `Tooltip.Popup`.
23
+ *
24
+ * @see https://ui.funstack.work/components/tooltip
25
+ */
16
26
  export interface TooltipPopupProps extends Omit<ComponentPropsWithRef<"div">, "id" | "popover" | "role" | "className" | "style" | "children"> {
17
27
  /**
18
28
  * Placement relative to the trigger through inline `position-area`, with
19
- * `position-try-fallbacks` flipping it when it does not fit. Default `"top"`. `"inline-start"` /
29
+ * `position-try-fallbacks` flipping it when it does not fit. `"inline-start"` /
20
30
  * `"inline-end"` follow the popup's direction. `null` emits no inline positioning (and no
21
31
  * `data-side` / `data-align`), so a stylesheet owns placement.
32
+ *
33
+ * @defaultValue `"top"`
22
34
  */
23
35
  side?: TooltipSide | null;
24
36
  /**
25
- * Alignment along the side. Default `"center"`. On a top / bottom side `start` / `end` are
37
+ * Alignment along the side. On a top / bottom side `start` / `end` are
26
38
  * inline-relative (mirrored under `direction: rtl`); on the other sides they are the top /
27
39
  * bottom edges. Ignored when `side` is `null`.
40
+ *
41
+ * @defaultValue `"center"`
28
42
  */
29
43
  align?: TooltipAlign;
30
44
  /**
31
45
  * Experimental (Chrome 151+, Firefox 153+; Safari 27.0 treats it as `"manual"`). Renders
32
46
  * `popover="hint"` instead of `popover="manual"`: native light dismiss, and the tooltip can
33
47
  * open over an `auto` popover (a menu) without closing it. The JS Escape / pointerdown handling
34
- * stays in place for engines that do not know `hint`. Default `false`.
48
+ * stays in place for engines that do not know `hint`.
49
+ *
50
+ * @defaultValue `false`
35
51
  */
36
52
  experimental_hint?: boolean;
53
+ /** Class name, or a function of the part's state that returns one. */
37
54
  className?: StateValue<string | undefined, TooltipPopupState>;
55
+ /** Inline style, or a function of the part's state that returns one. */
38
56
  style?: StateValue<CSSProperties | undefined, TooltipPopupState>;
39
57
  /**
40
58
  * Rendered at mount (hidden by the popover's `display: none`), not at open time. Tooltip
41
59
  * content should be static; if it must suspend, put the `<Suspense>` boundary inside the Popup.
42
60
  */
43
61
  children?: StateValue<ReactNode, TooltipPopupState>;
62
+ /** Replace the default `<div>` (element form) or take over rendering (function form). */
44
63
  render?: RenderProp<ComponentPropsWithRef<"div">, TooltipPopupState>;
45
64
  }
46
65
  /**
@@ -60,6 +79,8 @@ export interface TooltipPopupProps extends Omit<ComponentPropsWithRef<"div">, "i
60
79
  *
61
80
  * Owned keys (conventions 1.2): `id`, `popover`, `role`, `data-disabled`, and `data-side` /
62
81
  * `data-align` unless `side` is `null`.
82
+ *
83
+ * @see https://ui.funstack.work/components/tooltip
63
84
  */
64
85
  export declare function TooltipPopup({ side: sideProp, align: alignProp, experimental_hint, className, style, children, render, ...rest }: TooltipPopupProps): import("react").JSX.Element;
65
86
  export declare namespace TooltipPopup {
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-popup.d.mts","names":[],"sources":["../../src/tooltip/tooltip-popup.tsx"],"mappings":";;;;iBAciB;WACN;;;;;;WAMA,MAAM;;WAEN,OAAO;;iBAGD,0BAA0B,KACzC;;;;;;;EASA,OAAO;;;;;;EAMP,QAAQ;;;;;;;EAOR;EACA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;;;;;EAK9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,8BAA8B;;;;;;;;;;;;;;;;;;;;wBAqBpC,eACd,MAAM,UACN,OAAO,WACP,mBACA,WACA,OACA,UACA,WACG,QACF,oCAAiB,IAAA;yBATJ"}
1
+ {"version":3,"file":"tooltip-popup.d.mts","names":[],"sources":["../../src/tooltip/tooltip-popup.tsx"],"mappings":";;;;;;;;iBAkBiB;;WAEN;;;;;;WAMA,MAAM;;WAEN,OAAO;;;;;;;iBAQD,0BAA0B,KACzC;;;;;;;;;EAWA,OAAO;;;;;;;;EAQP,QAAQ;;;;;;;;;EASR;;EAEA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;;;;EAK9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,8BAA8B;;;;;;;;;;;;;;;;;;;;;;wBAuBpC,eACd,MAAM,UACN,OAAO,WACP,mBACA,WACA,OACA,UACA,WACG,QACF,oCAAiB,IAAA;yBATJ"}
@@ -24,6 +24,8 @@ import { jsx } from "react/jsx-runtime";
24
24
  *
25
25
  * Owned keys (conventions 1.2): `id`, `popover`, `role`, `data-disabled`, and `data-side` /
26
26
  * `data-align` unless `side` is `null`.
27
+ *
28
+ * @see https://ui.funstack.work/components/tooltip
27
29
  */
28
30
  function TooltipPopup({ side: sideProp = "top", align: alignProp = "center", experimental_hint = false, className, style, children, render, ...rest }) {
29
31
  const ctx = useTooltipContext("Tooltip.Popup");
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-popup.mjs","names":[],"sources":["../../src/tooltip/tooltip-popup.tsx"],"sourcesContent":["\"use client\";\nimport { useMemo } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useMergedRefs } from \"../internal/use-merged-refs.js\";\nimport { useAnchoredPlacement } from \"../internal/use-resolved-placement.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { TooltipPopupContext, useTooltipContext } from \"./tooltip-context.js\";\nimport type { TooltipAlign, TooltipPopupContextValue, TooltipSide } from \"./tooltip-context.js\";\n\nexport type { TooltipAlign, TooltipSide } from \"./tooltip-context.js\";\n\nexport interface TooltipPopupState {\n readonly disabled: boolean;\n /**\n * While shown: the physical side the browser placed the popup on (`\"top\"` / `\"bottom\"` /\n * `\"left\"` / `\"right\"`, after any fallback flip). Otherwise the `side` prop. `null` with\n * `side={null}`.\n */\n readonly side: TooltipSide | null;\n /** While shown: the resolved alignment; otherwise the `align` prop. */\n readonly align: TooltipAlign;\n}\n\nexport interface TooltipPopupProps extends Omit<\n ComponentPropsWithRef<\"div\">,\n \"id\" | \"popover\" | \"role\" | \"className\" | \"style\" | \"children\"\n> {\n /**\n * Placement relative to the trigger through inline `position-area`, with\n * `position-try-fallbacks` flipping it when it does not fit. Default `\"top\"`. `\"inline-start\"` /\n * `\"inline-end\"` follow the popup's direction. `null` emits no inline positioning (and no\n * `data-side` / `data-align`), so a stylesheet owns placement.\n */\n side?: TooltipSide | null;\n /**\n * Alignment along the side. Default `\"center\"`. On a top / bottom side `start` / `end` are\n * inline-relative (mirrored under `direction: rtl`); on the other sides they are the top /\n * bottom edges. Ignored when `side` is `null`.\n */\n align?: TooltipAlign;\n /**\n * Experimental (Chrome 151+, Firefox 153+; Safari 27.0 treats it as `\"manual\"`). Renders\n * `popover=\"hint\"` instead of `popover=\"manual\"`: native light dismiss, and the tooltip can\n * open over an `auto` popover (a menu) without closing it. The JS Escape / pointerdown handling\n * stays in place for engines that do not know `hint`. Default `false`.\n */\n experimental_hint?: boolean;\n className?: StateValue<string | undefined, TooltipPopupState>;\n style?: StateValue<CSSProperties | undefined, TooltipPopupState>;\n /**\n * Rendered at mount (hidden by the popover's `display: none`), not at open time. Tooltip\n * content should be static; if it must suspend, put the `<Suspense>` boundary inside the Popup.\n */\n children?: StateValue<ReactNode, TooltipPopupState>;\n render?: RenderProp<ComponentPropsWithRef<\"div\">, TooltipPopupState>;\n}\n\n/**\n * The tooltip content: a `div` with `popover` and `role=\"tooltip\"`, shown in the top layer and\n * anchored to the trigger implicitly (`interestfor` or `showPopover({ source })`). Open state is\n * browser-owned: style it with `:popover-open` and animate it with `@starting-style` in CSS.\n *\n * `data-side` / `data-align` are where the browser placed the popup while it is shown (the\n * `position-try-fallbacks` option it applied, read from the computed `position-area`;\n * conventions 13.2) and the requested values otherwise; `Tooltip.Arrow` echoes them.\n *\n * `data-instant` is present while the tooltip is shown by an open that began while another\n * `[role=\"tooltip\"]:popover-open` existed (a warm open, skip-delay), so\n * `[data-instant] { transition: none }` skips its entry animation. Not rendered by this part: the\n * Root's effect writes it on the element from the popup's `beforetoggle` (on both paths), before\n * the open's first style recalc, and removes it at the close's. No `state` counterpart.\n *\n * Owned keys (conventions 1.2): `id`, `popover`, `role`, `data-disabled`, and `data-side` /\n * `data-align` unless `side` is `null`.\n */\nexport function TooltipPopup({\n side: sideProp = \"top\",\n align: alignProp = \"center\",\n experimental_hint = false,\n className,\n style,\n children,\n render,\n ...rest\n}: TooltipPopupProps) {\n const ctx = useTooltipContext(\"Tooltip.Popup\");\n const placement = useAnchoredPlacement({ side: sideProp, align: alignProp });\n const { side, align } = placement;\n const state: TooltipPopupState = { disabled: ctx.disabled, side, align };\n const arrow = useMemo<TooltipPopupContextValue>(() => ({ side, align }), [side, align]);\n const ref = useMergedRefs(ctx.setPopupElement, placement.ref);\n\n const libraryProps: ComponentPropsWithRef<\"div\"> & DataAttributes = {\n id: ctx.popupId,\n popover: experimental_hint ? \"hint\" : \"manual\",\n role: \"tooltip\",\n \"data-disabled\": dataAttr(ctx.disabled),\n // Not owned with `side={null}`: the stylesheet (or a render element) may set them.\n ...placement.dataAttributes,\n };\n\n const element = useRender<ComponentPropsWithRef<\"div\">, TooltipPopupState>({\n defaultElement: \"div\",\n render,\n state,\n className,\n // The consumer's style wins over the inline placement (design 3).\n style: placement.style(style),\n children,\n props: rest,\n libraryProps,\n ref,\n });\n\n return <TooltipPopupContext value={arrow}>{element}</TooltipPopupContext>;\n}\n\nTooltipPopup.displayName = \"TooltipPopup\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,SAAgB,aAAa,EAC3B,MAAM,WAAW,OACjB,OAAO,YAAY,UACnB,oBAAoB,OACpB,WACA,OACA,UACA,QACA,GAAG,QACiB;CACpB,MAAM,MAAM,kBAAkB,eAAe;CAC7C,MAAM,YAAY,qBAAqB;EAAE,MAAM;EAAU,OAAO;CAAU,CAAC;CAC3E,MAAM,EAAE,MAAM,UAAU;CACxB,MAAM,QAA2B;EAAE,UAAU,IAAI;EAAU;EAAM;CAAM;CACvE,MAAM,QAAQ,eAAyC;EAAE;EAAM;CAAM,IAAI,CAAC,MAAM,KAAK,CAAC;CACtF,MAAM,MAAM,cAAc,IAAI,iBAAiB,UAAU,GAAG;CAE5D,MAAM,eAA8D;EAClE,IAAI,IAAI;EACR,SAAS,oBAAoB,SAAS;EACtC,MAAM;EACN,iBAAiB,SAAS,IAAI,QAAQ;EAEtC,GAAG,UAAU;CACf;CAEA,MAAM,UAAU,UAA2D;EACzE,gBAAgB;EAChB;EACA;EACA;EAEA,OAAO,UAAU,MAAM,KAAK;EAC5B;EACA,OAAO;EACP;EACA;CACF,CAAC;CAED,OAAO,oBAAC,qBAAD;EAAqB,OAAO;EAAQ,UAAA;CAA6B,CAAA;AAC1E;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"tooltip-popup.mjs","names":[],"sources":["../../src/tooltip/tooltip-popup.tsx"],"sourcesContent":["\"use client\";\nimport { useMemo } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { useMergedRefs } from \"../internal/use-merged-refs.js\";\nimport { useAnchoredPlacement } from \"../internal/use-resolved-placement.js\";\nimport { useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { TooltipPopupContext, useTooltipContext } from \"./tooltip-context.js\";\nimport type { TooltipAlign, TooltipPopupContextValue, TooltipSide } from \"./tooltip-context.js\";\n\nexport type { TooltipAlign, TooltipSide } from \"./tooltip-context.js\";\n\n/**\n * State of `Tooltip.Popup`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface TooltipPopupState {\n /** The Root's `disabled`. */\n readonly disabled: boolean;\n /**\n * While shown: the physical side the browser placed the popup on (`\"top\"` / `\"bottom\"` /\n * `\"left\"` / `\"right\"`, after any fallback flip). Otherwise the `side` prop. `null` with\n * `side={null}`.\n */\n readonly side: TooltipSide | null;\n /** While shown: the resolved alignment; otherwise the `align` prop. */\n readonly align: TooltipAlign;\n}\n\n/**\n * Props of `Tooltip.Popup`.\n *\n * @see https://ui.funstack.work/components/tooltip\n */\nexport interface TooltipPopupProps extends Omit<\n ComponentPropsWithRef<\"div\">,\n \"id\" | \"popover\" | \"role\" | \"className\" | \"style\" | \"children\"\n> {\n /**\n * Placement relative to the trigger through inline `position-area`, with\n * `position-try-fallbacks` flipping it when it does not fit. `\"inline-start\"` /\n * `\"inline-end\"` follow the popup's direction. `null` emits no inline positioning (and no\n * `data-side` / `data-align`), so a stylesheet owns placement.\n *\n * @defaultValue `\"top\"`\n */\n side?: TooltipSide | null;\n /**\n * Alignment along the side. On a top / bottom side `start` / `end` are\n * inline-relative (mirrored under `direction: rtl`); on the other sides they are the top /\n * bottom edges. Ignored when `side` is `null`.\n *\n * @defaultValue `\"center\"`\n */\n align?: TooltipAlign;\n /**\n * Experimental (Chrome 151+, Firefox 153+; Safari 27.0 treats it as `\"manual\"`). Renders\n * `popover=\"hint\"` instead of `popover=\"manual\"`: native light dismiss, and the tooltip can\n * open over an `auto` popover (a menu) without closing it. The JS Escape / pointerdown handling\n * stays in place for engines that do not know `hint`.\n *\n * @defaultValue `false`\n */\n experimental_hint?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, TooltipPopupState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, TooltipPopupState>;\n /**\n * Rendered at mount (hidden by the popover's `display: none`), not at open time. Tooltip\n * content should be static; if it must suspend, put the `<Suspense>` boundary inside the Popup.\n */\n children?: StateValue<ReactNode, TooltipPopupState>;\n /** Replace the default `<div>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"div\">, TooltipPopupState>;\n}\n\n/**\n * The tooltip content: a `div` with `popover` and `role=\"tooltip\"`, shown in the top layer and\n * anchored to the trigger implicitly (`interestfor` or `showPopover({ source })`). Open state is\n * browser-owned: style it with `:popover-open` and animate it with `@starting-style` in CSS.\n *\n * `data-side` / `data-align` are where the browser placed the popup while it is shown (the\n * `position-try-fallbacks` option it applied, read from the computed `position-area`;\n * conventions 13.2) and the requested values otherwise; `Tooltip.Arrow` echoes them.\n *\n * `data-instant` is present while the tooltip is shown by an open that began while another\n * `[role=\"tooltip\"]:popover-open` existed (a warm open, skip-delay), so\n * `[data-instant] { transition: none }` skips its entry animation. Not rendered by this part: the\n * Root's effect writes it on the element from the popup's `beforetoggle` (on both paths), before\n * the open's first style recalc, and removes it at the close's. No `state` counterpart.\n *\n * Owned keys (conventions 1.2): `id`, `popover`, `role`, `data-disabled`, and `data-side` /\n * `data-align` unless `side` is `null`.\n *\n * @see https://ui.funstack.work/components/tooltip\n */\nexport function TooltipPopup({\n side: sideProp = \"top\",\n align: alignProp = \"center\",\n experimental_hint = false,\n className,\n style,\n children,\n render,\n ...rest\n}: TooltipPopupProps) {\n const ctx = useTooltipContext(\"Tooltip.Popup\");\n const placement = useAnchoredPlacement({ side: sideProp, align: alignProp });\n const { side, align } = placement;\n const state: TooltipPopupState = { disabled: ctx.disabled, side, align };\n const arrow = useMemo<TooltipPopupContextValue>(() => ({ side, align }), [side, align]);\n const ref = useMergedRefs(ctx.setPopupElement, placement.ref);\n\n const libraryProps: ComponentPropsWithRef<\"div\"> & DataAttributes = {\n id: ctx.popupId,\n popover: experimental_hint ? \"hint\" : \"manual\",\n role: \"tooltip\",\n \"data-disabled\": dataAttr(ctx.disabled),\n // Not owned with `side={null}`: the stylesheet (or a render element) may set them.\n ...placement.dataAttributes,\n };\n\n const element = useRender<ComponentPropsWithRef<\"div\">, TooltipPopupState>({\n defaultElement: \"div\",\n render,\n state,\n className,\n // The consumer's style wins over the inline placement (design 3).\n style: placement.style(style),\n children,\n props: rest,\n libraryProps,\n ref,\n });\n\n return <TooltipPopupContext value={arrow}>{element}</TooltipPopupContext>;\n}\n\nTooltipPopup.displayName = \"TooltipPopup\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGA,SAAgB,aAAa,EAC3B,MAAM,WAAW,OACjB,OAAO,YAAY,UACnB,oBAAoB,OACpB,WACA,OACA,UACA,QACA,GAAG,QACiB;CACpB,MAAM,MAAM,kBAAkB,eAAe;CAC7C,MAAM,YAAY,qBAAqB;EAAE,MAAM;EAAU,OAAO;CAAU,CAAC;CAC3E,MAAM,EAAE,MAAM,UAAU;CACxB,MAAM,QAA2B;EAAE,UAAU,IAAI;EAAU;EAAM;CAAM;CACvE,MAAM,QAAQ,eAAyC;EAAE;EAAM;CAAM,IAAI,CAAC,MAAM,KAAK,CAAC;CACtF,MAAM,MAAM,cAAc,IAAI,iBAAiB,UAAU,GAAG;CAE5D,MAAM,eAA8D;EAClE,IAAI,IAAI;EACR,SAAS,oBAAoB,SAAS;EACtC,MAAM;EACN,iBAAiB,SAAS,IAAI,QAAQ;EAEtC,GAAG,UAAU;CACf;CAEA,MAAM,UAAU,UAA2D;EACzE,gBAAgB;EAChB;EACA;EACA;EAEA,OAAO,UAAU,MAAM,KAAK;EAC5B;EACA,OAAO;EACP;EACA;CACF,CAAC;CAED,OAAO,oBAAC,qBAAD;EAAqB,OAAO;EAAQ,UAAA;CAA6B,CAAA;AAC1E;AAEA,aAAa,cAAc"}
@@ -2,25 +2,45 @@ import { StateValue } from "../internal/types.mjs";
2
2
  import { TooltipProvides } from "./tooltip-context.mjs";
3
3
  import { ReactNode } from "react";
4
4
  //#region src/tooltip/tooltip-root.d.ts
5
+ /** State of `Tooltip.Root`, passed to the function forms of `children`. */
5
6
  export interface TooltipRootState {
7
+ /** The `disabled` prop. */
6
8
  readonly disabled: boolean;
7
9
  }
10
+ /**
11
+ * Props of `Tooltip.Root`.
12
+ *
13
+ * @see https://ui.funstack.work/components/tooltip
14
+ */
8
15
  export interface TooltipRootProps {
9
16
  /**
10
17
  * Milliseconds from hover or keyboard focus to open. Default 250 (Chromium's
11
18
  * `interest-delay-start`). The same delay applies to hover and focus.
19
+ *
20
+ * @defaultValue `250`
12
21
  */
13
22
  delay?: number;
14
- /** Milliseconds from de-hover or blur to close. Default 150 (Chromium's `interest-delay-end`). */
23
+ /**
24
+ * Milliseconds from de-hover or blur to close.
25
+ *
26
+ * @defaultValue `150` (Chromium's `interest-delay-end`)
27
+ */
15
28
  closeDelay?: number;
16
- /** When true the tooltip never opens. The ARIA relation stays in place. */
29
+ /**
30
+ * When true the tooltip never opens. The ARIA relation stays in place.
31
+ *
32
+ * @defaultValue `false`
33
+ */
17
34
  disabled?: boolean;
18
35
  /**
19
36
  * Which accessibility relation the tooltip provides for the trigger.
20
37
  * `"description"` (default): `aria-describedby`, for triggers that have their own name.
21
38
  * `"name"`: `aria-labelledby`, for icon-only triggers; do not also set `aria-label`.
39
+ *
40
+ * @defaultValue `"description"`
22
41
  */
23
42
  provides?: TooltipProvides;
43
+ /** The Trigger and the Popup. May be a function of the part's state. */
24
44
  children?: StateValue<ReactNode, TooltipRootState>;
25
45
  }
26
46
  /**
@@ -31,6 +51,8 @@ export interface TooltipRootProps {
31
51
  * Render `Tooltip.Popup` immediately after `Tooltip.Trigger` in DOM order: the HTML spec
32
52
  * recommends that reading order for popovers, and some screen readers attach an adjacent tooltip
33
53
  * to the wrong control otherwise. This is documented, not enforced.
54
+ *
55
+ * @see https://ui.funstack.work/components/tooltip
34
56
  */
35
57
  export declare function TooltipRoot({ delay, closeDelay, disabled, provides, children }: TooltipRootProps): import("react").JSX.Element;
36
58
  export declare namespace TooltipRoot {
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-root.d.mts","names":[],"sources":["../../src/tooltip/tooltip-root.tsx"],"mappings":";;;;iBAWiB;WACN;;iBAGM;;;;;EAKf;;EAEA;;EAEA;;;;;;EAMA,WAAW;EACX,WAAW,WAAW,WAAW;;;;;;;;;;;wBAiBnB,cACd,OACA,YACA,UACA,UACA,YACC,mCAAgB,IAAA;yBANH"}
1
+ {"version":3,"file":"tooltip-root.d.mts","names":[],"sources":["../../src/tooltip/tooltip-root.tsx"],"mappings":";;;;;iBAYiB;;WAEN;;;;;;;iBAQM;;;;;;;EAOf;;;;;;EAMA;;;;;;EAMA;;;;;;;;EAQA,WAAW;;EAEX,WAAW,WAAW,WAAW;;;;;;;;;;;;;wBAmBnB,cACd,OACA,YACA,UACA,UACA,YACC,mCAAgB,IAAA;yBANH"}
@@ -15,6 +15,8 @@ const FOCUSABLE = "a[href],area[href],button,input,select,textarea,iframe,[tabin
15
15
  * Render `Tooltip.Popup` immediately after `Tooltip.Trigger` in DOM order: the HTML spec
16
16
  * recommends that reading order for popovers, and some screen readers attach an adjacent tooltip
17
17
  * to the wrong control otherwise. This is documented, not enforced.
18
+ *
19
+ * @see https://ui.funstack.work/components/tooltip
18
20
  */
19
21
  function TooltipRoot({ delay = 250, closeDelay = 150, disabled = false, provides = "description", children }) {
20
22
  const popupId = useId();
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-root.mjs","names":[],"sources":["../../src/tooltip/tooltip-root.tsx"],"sourcesContent":["\"use client\";\nimport { useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport type { StateValue } from \"../internal/types.js\";\nimport { resolveStateValue } from \"../internal/use-render.js\";\nimport { TooltipContext } from \"./tooltip-context.js\";\nimport type { TooltipContextValue, TooltipProvides } from \"./tooltip-context.js\";\nimport { useTooltipInteraction } from \"./use-tooltip-interaction.js\";\n\nexport type { TooltipProvides } from \"./tooltip-context.js\";\n\nexport interface TooltipRootState {\n readonly disabled: boolean;\n}\n\nexport interface TooltipRootProps {\n /**\n * Milliseconds from hover or keyboard focus to open. Default 250 (Chromium's\n * `interest-delay-start`). The same delay applies to hover and focus.\n */\n delay?: number;\n /** Milliseconds from de-hover or blur to close. Default 150 (Chromium's `interest-delay-end`). */\n closeDelay?: number;\n /** When true the tooltip never opens. The ARIA relation stays in place. */\n disabled?: boolean;\n /**\n * Which accessibility relation the tooltip provides for the trigger.\n * `\"description\"` (default): `aria-describedby`, for triggers that have their own name.\n * `\"name\"`: `aria-labelledby`, for icon-only triggers; do not also set `aria-label`.\n */\n provides?: TooltipProvides;\n children?: StateValue<ReactNode, TooltipRootState>;\n}\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\nconst FOCUSABLE =\n \"a[href],area[href],button,input,select,textarea,iframe,[tabindex],[contenteditable]\";\n\n/**\n * Owns the popup id, the options and the one interaction effect. Renders no DOM, so it has no\n * `ref`, `className` or `style`. The open state is browser-owned (the popover's top-layer state):\n * there is no `open` prop, no action, and no `data-open`; style with `:popover-open`.\n *\n * Render `Tooltip.Popup` immediately after `Tooltip.Trigger` in DOM order: the HTML spec\n * recommends that reading order for popovers, and some screen readers attach an adjacent tooltip\n * to the wrong control otherwise. This is documented, not enforced.\n */\nexport function TooltipRoot({\n delay = 250,\n closeDelay = 150,\n disabled = false,\n provides = \"description\",\n children,\n}: TooltipRootProps) {\n const popupId = useId();\n const [trigger, setTriggerElement] = useState<HTMLElement | null>(null);\n const [popup, setPopupElement] = useState<HTMLElement | null>(null);\n const [interestForRequested, setInterestForRequested] = useState(false);\n\n useTooltipInteraction(trigger, popup, { delay, closeDelay, disabled, interestForRequested });\n useTooltipDevWarnings(trigger, popup, provides);\n\n const context = useMemo<TooltipContextValue>(\n () => ({\n popupId,\n disabled,\n delay,\n closeDelay,\n provides,\n setTriggerElement,\n setPopupElement,\n setInterestForRequested,\n }),\n [popupId, disabled, delay, closeDelay, provides],\n );\n\n const state: TooltipRootState = { disabled };\n return <TooltipContext value={context}>{resolveStateValue(children, state)}</TooltipContext>;\n}\n\nTooltipRoot.displayName = \"TooltipRoot\";\n\n/**\n * The containers that move focus among their items with the arrow keys (roving tabindex, or a\n * native `focusgroup`): Menu, Tabs, Toolbar, a radio group, and the other APG composites, plus\n * `role=\"group\"`, which a standalone `ToggleGroup.Root` renders while its roving engine writes\n * the Items' `tabindex` (design/components/toggle-group.md 18).\n */\nconst COMPOSITE =\n '[role=\"menu\"],[role=\"menubar\"],[role=\"tablist\"],[role=\"toolbar\"],[role=\"group\"],[role=\"radiogroup\"],[role=\"listbox\"],[role=\"grid\"],[role=\"treegrid\"],[role=\"tree\"],[focusgroup]';\n\n/**\n * Whether keyboard users can focus the trigger: it is in the tab order, or it is a\n * roving-tabindex item (`tabindex=\"-1\"` set explicitly, so script can focus it) inside a\n * composite widget that moves focus to it.\n */\nfunction isKeyboardReachable(trigger: HTMLElement): boolean {\n if (trigger.tabIndex >= 0) return true;\n return trigger.hasAttribute(\"tabindex\") && trigger.parentElement?.closest(COMPOSITE) != null;\n}\n\n/** Development-only checks that need the mounted elements (design 12.5). Each fires once. */\nfunction useTooltipDevWarnings(\n trigger: HTMLElement | null,\n popup: HTMLElement | null,\n provides: TooltipProvides,\n): void {\n const warned = useRef({ label: false, focusable: false, interactive: false });\n useEffect(() => {\n if (!isDev) return;\n const w = warned.current;\n if (trigger !== null) {\n if (provides === \"name\" && trigger.hasAttribute(\"aria-label\") && !w.label) {\n w.label = true;\n console.error(\n '[Tooltip] provides=\"name\" together with aria-label on the trigger announces the name twice. Remove aria-label.',\n );\n }\n if (!isKeyboardReachable(trigger) && !w.focusable) {\n w.focusable = true;\n console.error(\n \"[Tooltip] The trigger is not focusable; keyboard users cannot open the tooltip. Render a <button> or a link, or set tabIndex={0}.\",\n );\n }\n }\n if (popup !== null && popup.querySelector(FOCUSABLE) !== null && !w.interactive) {\n w.interactive = true;\n console.error(\n \"[Tooltip] Tooltips must not contain interactive content. Use a non-modal dialog or a popover instead.\",\n );\n }\n }, [trigger, popup, provides]);\n}\n"],"mappings":";;;;;;;AAkCA,MAAM,QAAQ,QAAQ,IAAI,aAAa;AAEvC,MAAM,YACJ;;;;;;;;;;AAWF,SAAgB,YAAY,EAC1B,QAAQ,KACR,aAAa,KACb,WAAW,OACX,WAAW,eACX,YACmB;CACnB,MAAM,UAAU,MAAM;CACtB,MAAM,CAAC,SAAS,qBAAqB,SAA6B,IAAI;CACtE,MAAM,CAAC,OAAO,mBAAmB,SAA6B,IAAI;CAClE,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,KAAK;CAEtE,sBAAsB,SAAS,OAAO;EAAE;EAAO;EAAY;EAAU;CAAqB,CAAC;CAC3F,sBAAsB,SAAS,OAAO,QAAQ;CAE9C,MAAM,UAAU,eACP;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAS;EAAU;EAAO;EAAY;CAAQ,CACjD;CAGA,OAAO,oBAAC,gBAAD;EAAgB,OAAO;EAAU,UAAA,kBAAkB,UAAU,EADlC,SACsC,CAAC;CAAkB,CAAA;AAC7F;AAEA,YAAY,cAAc;;;;;;;AAQ1B,MAAM,YACJ;;;;;;AAOF,SAAS,oBAAoB,SAA+B;CAC1D,IAAI,QAAQ,YAAY,GAAG,OAAO;CAClC,OAAO,QAAQ,aAAa,UAAU,KAAK,QAAQ,eAAe,QAAQ,SAAS,KAAK;AAC1F;;AAGA,SAAS,sBACP,SACA,OACA,UACM;CACN,MAAM,SAAS,OAAO;EAAE,OAAO;EAAO,WAAW;EAAO,aAAa;CAAM,CAAC;CAC5E,gBAAgB;EACd,IAAI,CAAC,OAAO;EACZ,MAAM,IAAI,OAAO;EACjB,IAAI,YAAY,MAAM;GACpB,IAAI,aAAa,UAAU,QAAQ,aAAa,YAAY,KAAK,CAAC,EAAE,OAAO;IACzE,EAAE,QAAQ;IACV,QAAQ,MACN,kHACF;GACF;GACA,IAAI,CAAC,oBAAoB,OAAO,KAAK,CAAC,EAAE,WAAW;IACjD,EAAE,YAAY;IACd,QAAQ,MACN,mIACF;GACF;EACF;EACA,IAAI,UAAU,QAAQ,MAAM,cAAc,SAAS,MAAM,QAAQ,CAAC,EAAE,aAAa;GAC/E,EAAE,cAAc;GAChB,QAAQ,MACN,uGACF;EACF;CACF,GAAG;EAAC;EAAS;EAAO;CAAQ,CAAC;AAC/B"}
1
+ {"version":3,"file":"tooltip-root.mjs","names":[],"sources":["../../src/tooltip/tooltip-root.tsx"],"sourcesContent":["\"use client\";\nimport { useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport type { StateValue } from \"../internal/types.js\";\nimport { resolveStateValue } from \"../internal/use-render.js\";\nimport { TooltipContext } from \"./tooltip-context.js\";\nimport type { TooltipContextValue, TooltipProvides } from \"./tooltip-context.js\";\nimport { useTooltipInteraction } from \"./use-tooltip-interaction.js\";\n\nexport type { TooltipProvides } from \"./tooltip-context.js\";\n\n/** State of `Tooltip.Root`, passed to the function forms of `children`. */\nexport interface TooltipRootState {\n /** The `disabled` prop. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `Tooltip.Root`.\n *\n * @see https://ui.funstack.work/components/tooltip\n */\nexport interface TooltipRootProps {\n /**\n * Milliseconds from hover or keyboard focus to open. Default 250 (Chromium's\n * `interest-delay-start`). The same delay applies to hover and focus.\n *\n * @defaultValue `250`\n */\n delay?: number;\n /**\n * Milliseconds from de-hover or blur to close.\n *\n * @defaultValue `150` (Chromium's `interest-delay-end`)\n */\n closeDelay?: number;\n /**\n * When true the tooltip never opens. The ARIA relation stays in place.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n /**\n * Which accessibility relation the tooltip provides for the trigger.\n * `\"description\"` (default): `aria-describedby`, for triggers that have their own name.\n * `\"name\"`: `aria-labelledby`, for icon-only triggers; do not also set `aria-label`.\n *\n * @defaultValue `\"description\"`\n */\n provides?: TooltipProvides;\n /** The Trigger and the Popup. May be a function of the part's state. */\n children?: StateValue<ReactNode, TooltipRootState>;\n}\n\nconst isDev = process.env.NODE_ENV !== \"production\";\n\nconst FOCUSABLE =\n \"a[href],area[href],button,input,select,textarea,iframe,[tabindex],[contenteditable]\";\n\n/**\n * Owns the popup id, the options and the one interaction effect. Renders no DOM, so it has no\n * `ref`, `className` or `style`. The open state is browser-owned (the popover's top-layer state):\n * there is no `open` prop, no action, and no `data-open`; style with `:popover-open`.\n *\n * Render `Tooltip.Popup` immediately after `Tooltip.Trigger` in DOM order: the HTML spec\n * recommends that reading order for popovers, and some screen readers attach an adjacent tooltip\n * to the wrong control otherwise. This is documented, not enforced.\n *\n * @see https://ui.funstack.work/components/tooltip\n */\nexport function TooltipRoot({\n delay = 250,\n closeDelay = 150,\n disabled = false,\n provides = \"description\",\n children,\n}: TooltipRootProps) {\n const popupId = useId();\n const [trigger, setTriggerElement] = useState<HTMLElement | null>(null);\n const [popup, setPopupElement] = useState<HTMLElement | null>(null);\n const [interestForRequested, setInterestForRequested] = useState(false);\n\n useTooltipInteraction(trigger, popup, { delay, closeDelay, disabled, interestForRequested });\n useTooltipDevWarnings(trigger, popup, provides);\n\n const context = useMemo<TooltipContextValue>(\n () => ({\n popupId,\n disabled,\n delay,\n closeDelay,\n provides,\n setTriggerElement,\n setPopupElement,\n setInterestForRequested,\n }),\n [popupId, disabled, delay, closeDelay, provides],\n );\n\n const state: TooltipRootState = { disabled };\n return <TooltipContext value={context}>{resolveStateValue(children, state)}</TooltipContext>;\n}\n\nTooltipRoot.displayName = \"TooltipRoot\";\n\n/**\n * The containers that move focus among their items with the arrow keys (roving tabindex, or a\n * native `focusgroup`): Menu, Tabs, Toolbar, a radio group, and the other APG composites, plus\n * `role=\"group\"`, which a standalone `ToggleGroup.Root` renders while its roving engine writes\n * the Items' `tabindex` (design/components/toggle-group.md 18).\n */\nconst COMPOSITE =\n '[role=\"menu\"],[role=\"menubar\"],[role=\"tablist\"],[role=\"toolbar\"],[role=\"group\"],[role=\"radiogroup\"],[role=\"listbox\"],[role=\"grid\"],[role=\"treegrid\"],[role=\"tree\"],[focusgroup]';\n\n/**\n * Whether keyboard users can focus the trigger: it is in the tab order, or it is a\n * roving-tabindex item (`tabindex=\"-1\"` set explicitly, so script can focus it) inside a\n * composite widget that moves focus to it.\n */\nfunction isKeyboardReachable(trigger: HTMLElement): boolean {\n if (trigger.tabIndex >= 0) return true;\n return trigger.hasAttribute(\"tabindex\") && trigger.parentElement?.closest(COMPOSITE) != null;\n}\n\n/** Development-only checks that need the mounted elements (design 12.5). Each fires once. */\nfunction useTooltipDevWarnings(\n trigger: HTMLElement | null,\n popup: HTMLElement | null,\n provides: TooltipProvides,\n): void {\n const warned = useRef({ label: false, focusable: false, interactive: false });\n useEffect(() => {\n if (!isDev) return;\n const w = warned.current;\n if (trigger !== null) {\n if (provides === \"name\" && trigger.hasAttribute(\"aria-label\") && !w.label) {\n w.label = true;\n console.error(\n '[Tooltip] provides=\"name\" together with aria-label on the trigger announces the name twice. Remove aria-label.',\n );\n }\n if (!isKeyboardReachable(trigger) && !w.focusable) {\n w.focusable = true;\n console.error(\n \"[Tooltip] The trigger is not focusable; keyboard users cannot open the tooltip. Render a <button> or a link, or set tabIndex={0}.\",\n );\n }\n }\n if (popup !== null && popup.querySelector(FOCUSABLE) !== null && !w.interactive) {\n w.interactive = true;\n console.error(\n \"[Tooltip] Tooltips must not contain interactive content. Use a non-modal dialog or a popover instead.\",\n );\n }\n }, [trigger, popup, provides]);\n}\n"],"mappings":";;;;;;;AAsDA,MAAM,QAAQ,QAAQ,IAAI,aAAa;AAEvC,MAAM,YACJ;;;;;;;;;;;;AAaF,SAAgB,YAAY,EAC1B,QAAQ,KACR,aAAa,KACb,WAAW,OACX,WAAW,eACX,YACmB;CACnB,MAAM,UAAU,MAAM;CACtB,MAAM,CAAC,SAAS,qBAAqB,SAA6B,IAAI;CACtE,MAAM,CAAC,OAAO,mBAAmB,SAA6B,IAAI;CAClE,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,KAAK;CAEtE,sBAAsB,SAAS,OAAO;EAAE;EAAO;EAAY;EAAU;CAAqB,CAAC;CAC3F,sBAAsB,SAAS,OAAO,QAAQ;CAE9C,MAAM,UAAU,eACP;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAS;EAAU;EAAO;EAAY;CAAQ,CACjD;CAGA,OAAO,oBAAC,gBAAD;EAAgB,OAAO;EAAU,UAAA,kBAAkB,UAAU,EADlC,SACsC,CAAC;CAAkB,CAAA;AAC7F;AAEA,YAAY,cAAc;;;;;;;AAQ1B,MAAM,YACJ;;;;;;AAOF,SAAS,oBAAoB,SAA+B;CAC1D,IAAI,QAAQ,YAAY,GAAG,OAAO;CAClC,OAAO,QAAQ,aAAa,UAAU,KAAK,QAAQ,eAAe,QAAQ,SAAS,KAAK;AAC1F;;AAGA,SAAS,sBACP,SACA,OACA,UACM;CACN,MAAM,SAAS,OAAO;EAAE,OAAO;EAAO,WAAW;EAAO,aAAa;CAAM,CAAC;CAC5E,gBAAgB;EACd,IAAI,CAAC,OAAO;EACZ,MAAM,IAAI,OAAO;EACjB,IAAI,YAAY,MAAM;GACpB,IAAI,aAAa,UAAU,QAAQ,aAAa,YAAY,KAAK,CAAC,EAAE,OAAO;IACzE,EAAE,QAAQ;IACV,QAAQ,MACN,kHACF;GACF;GACA,IAAI,CAAC,oBAAoB,OAAO,KAAK,CAAC,EAAE,WAAW;IACjD,EAAE,YAAY;IACd,QAAQ,MACN,mIACF;GACF;EACF;EACA,IAAI,UAAU,QAAQ,MAAM,cAAc,SAAS,MAAM,QAAQ,CAAC,EAAE,aAAa;GAC/E,EAAE,cAAc;GAChB,QAAQ,MACN,uGACF;EACF;CACF,GAAG;EAAC;EAAS;EAAO;CAAQ,CAAC;AAC/B"}
@@ -1,9 +1,19 @@
1
1
  import { RenderProp, StateValue } from "../internal/types.mjs";
2
2
  import { CSSProperties, ComponentPropsWithRef, ReactNode } from "react";
3
3
  //#region src/tooltip/tooltip-trigger.d.ts
4
+ /**
5
+ * State of `Tooltip.Trigger`, passed to the function forms of `className`, `style`, `children` and
6
+ * `render`.
7
+ */
4
8
  export interface TooltipTriggerState {
9
+ /** The Root's `disabled`. */
5
10
  readonly disabled: boolean;
6
11
  }
12
+ /**
13
+ * Props of `Tooltip.Trigger`.
14
+ *
15
+ * @see https://ui.funstack.work/components/tooltip
16
+ */
7
17
  export interface TooltipTriggerProps extends Omit<ComponentPropsWithRef<"button">, "className" | "style" | "children"> {
8
18
  /**
9
19
  * Experimental (Chromium 142+). Renders `interestfor` and `interest-delay-start/end` so the
@@ -16,12 +26,17 @@ export interface TooltipTriggerProps extends Omit<ComponentPropsWithRef<"button"
16
26
  * `<style href="@funstack/ui/tooltip-warm">` (nonce from `<CSPProvider>`), rendered beside the
17
27
  * element so a `render` element with its own children keeps it. When that stylesheet is
18
28
  * missing (a CSP blocks it), the tooltip opens after its `delay` and only skip-delay is lost.
19
- * Default `false`.
29
+ *
30
+ * @defaultValue `false`
20
31
  */
21
32
  experimental_interestFor?: boolean;
33
+ /** Class name, or a function of the part's state that returns one. */
22
34
  className?: StateValue<string | undefined, TooltipTriggerState>;
35
+ /** Inline style, or a function of the part's state that returns one. */
23
36
  style?: StateValue<CSSProperties | undefined, TooltipTriggerState>;
37
+ /** Content, or a function of the part's state. */
24
38
  children?: StateValue<ReactNode, TooltipTriggerState>;
39
+ /** Replace the default `<button>` (element form) or take over rendering (function form). */
25
40
  render?: RenderProp<ComponentPropsWithRef<"button">, TooltipTriggerState>;
26
41
  }
27
42
  /**
@@ -37,6 +52,8 @@ export interface TooltipTriggerProps extends Omit<ComponentPropsWithRef<"button"
37
52
  * `data-disabled`; and `interestfor` and `data-fsui-tooltip-trigger` when
38
53
  * `experimental_interestFor` is on. `type="button"` is a default the consumer may override (the
39
54
  * part installs no click handler), unlike the overlay Triggers, which own it.
55
+ *
56
+ * @see https://ui.funstack.work/components/tooltip
40
57
  */
41
58
  export declare function TooltipTrigger({ experimental_interestFor, className, style, children, render, ...rest }: TooltipTriggerProps): import("react").JSX.Element;
42
59
  export declare namespace TooltipTrigger {
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-trigger.d.mts","names":[],"sources":["../../src/tooltip/tooltip-trigger.tsx"],"mappings":";;;iBAiBiB;WACN;;iBAGM,4BAA4B,KAC3C;;;;;;;;;;;;;;EAgBA;EACA,YAAY,+BAA+B;EAC3C,QAAQ,WAAW,2BAA2B;EAC9C,WAAW,WAAW,WAAW;EACjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;;;wBAiBvC,iBACd,0BACA,WACA,OACA,UACA,WACG,QACF,sCAAmB,IAAA;yBAPN"}
1
+ {"version":3,"file":"tooltip-trigger.d.mts","names":[],"sources":["../../src/tooltip/tooltip-trigger.tsx"],"mappings":";;;;;;;iBAqBiB;;WAEN;;;;;;;iBAQM,4BAA4B,KAC3C;;;;;;;;;;;;;;;EAiBA;;EAEA,YAAY,+BAA+B;;EAE3C,QAAQ,WAAW,2BAA2B;;EAE9C,WAAW,WAAW,WAAW;;EAEjC,SAAS,WAAW,iCAAiC;;;;;;;;;;;;;;;;;;wBAmBvC,iBACd,0BACA,WACA,OACA,UACA,WACG,QACF,sCAAmB,IAAA;yBAPN"}
@@ -22,6 +22,8 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
22
22
  * `data-disabled`; and `interestfor` and `data-fsui-tooltip-trigger` when
23
23
  * `experimental_interestFor` is on. `type="button"` is a default the consumer may override (the
24
24
  * part installs no click handler), unlike the overlay Triggers, which own it.
25
+ *
26
+ * @see https://ui.funstack.work/components/tooltip
25
27
  */
26
28
  function TooltipTrigger({ experimental_interestFor = false, className, style, children, render, ...rest }) {
27
29
  const ctx = useTooltipContext("Tooltip.Trigger");
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip-trigger.mjs","names":[],"sources":["../../src/tooltip/tooltip-trigger.tsx"],"sourcesContent":["\"use client\";\nimport { use, useLayoutEffect } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { CSPContext } from \"../internal/csp-context.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { FSUI_PRECEDENCE } from \"../internal/shipped-styles.js\";\nimport {\n TOOLTIP_TRIGGER_MARKER,\n TOOLTIP_WARM_HREF,\n TOOLTIP_WARM_RULES,\n warmDelay,\n} from \"../internal/tooltip-warm.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { rendersButton, resolveStateValue, useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { useTooltipContext } from \"./tooltip-context.js\";\n\nexport interface TooltipTriggerState {\n readonly disabled: boolean;\n}\n\nexport interface TooltipTriggerProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n \"className\" | \"style\" | \"children\"\n> {\n /**\n * Experimental (Chromium 142+). Renders `interestfor` and `interest-delay-start/end` so the\n * browser owns hover, focus, Escape and long-press; the library's JS trigger path is skipped\n * where the rendered element implements `interestForElement`. No effect in other engines (the\n * attribute is ignored and the JS path runs). Pair with `Tooltip.Popup experimental_hint`.\n * Skip-delay on this path comes from a shipped rule: the Trigger renders the\n * `data-fsui-tooltip-trigger` marker, an `interest-delay-start` of\n * `calc(<delay>ms * (1 - var(--fsui-tooltip-warm, 0)))` and a hoisted\n * `<style href=\"@funstack/ui/tooltip-warm\">` (nonce from `<CSPProvider>`), rendered beside the\n * element so a `render` element with its own children keeps it. When that stylesheet is\n * missing (a CSP blocks it), the tooltip opens after its `delay` and only skip-delay is lost.\n * Default `false`.\n */\n experimental_interestFor?: boolean;\n className?: StateValue<string | undefined, TooltipTriggerState>;\n style?: StateValue<CSSProperties | undefined, TooltipTriggerState>;\n children?: StateValue<ReactNode, TooltipTriggerState>;\n render?: RenderProp<ComponentPropsWithRef<\"button\">, TooltipTriggerState>;\n}\n\n/**\n * The element the user hovers or focuses: a `<button type=\"button\">` by default. `render` may\n * substitute a link or a custom button; the element must be focusable (a dev warning fires when\n * it is not). A natively `disabled` button never opens a tooltip; use `aria-disabled` instead.\n *\n * The library attaches its hover / focus listeners with `addEventListener` from `Tooltip.Root`,\n * so every `on*` prop passes through untouched.\n *\n * Owned keys (conventions 1.2): `aria-describedby` (with `provides=\"description\"`) or\n * `aria-labelledby` (with `provides=\"name\"`), both token-merged with the consumer's ids;\n * `data-disabled`; and `interestfor` and `data-fsui-tooltip-trigger` when\n * `experimental_interestFor` is on. `type=\"button\"` is a default the consumer may override (the\n * part installs no click handler), unlike the overlay Triggers, which own it.\n */\nexport function TooltipTrigger({\n experimental_interestFor = false,\n className,\n style,\n children,\n render,\n ...rest\n}: TooltipTriggerProps) {\n const ctx = useTooltipContext(\"Tooltip.Trigger\");\n const { disabled, popupId, provides, setInterestForRequested } = ctx;\n const native = experimental_interestFor && !disabled;\n const csp = use(CSPContext);\n\n useLayoutEffect(() => {\n setInterestForRequested(native);\n }, [native, setInterestForRequested]);\n\n const state: TooltipTriggerState = { disabled };\n\n const libraryProps: ComponentPropsWithRef<\"button\"> & DataAttributes = {\n // Only the relation in use is owned; the other one passes through untouched.\n ...(provides === \"name\" ? { \"aria-labelledby\": popupId } : { \"aria-describedby\": popupId }),\n \"data-disabled\": dataAttr(disabled),\n // Owned while the flag is on: a disabled tooltip removes the attribute, so the browser\n // cannot open it either. Unflagged, the key is omitted (conventions 1.2).\n ...(experimental_interestFor && {\n interestfor: native ? popupId : undefined,\n // What the shipped skip-delay rule matches (design 6); nothing else carries it.\n [TOOLTIP_TRIGGER_MARKER]: native ? \"\" : undefined,\n }),\n };\n\n // Skip-delay on the native path (design 6, conventions 12): the browser reads the delay from\n // the computed style when the hover starts, and only a rule can see that another tooltip is\n // showing. Hoisted into <head> by React (during SSR too) and deduplicated; nothing lands in\n // place. Rendered beside the element, not in its children: a `render` element with its own\n // children (`render={<a href>Text</a>}`) wins over `children` and would drop it.\n const warmRules = native ? (\n <style href={TOOLTIP_WARM_HREF} precedence={FSUI_PRECEDENCE} nonce={csp?.nonce}>\n {TOOLTIP_WARM_RULES}\n </style>\n ) : null;\n\n const element = useRender<ComponentPropsWithRef<\"button\">, TooltipTriggerState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n // The native delays sit under the consumer's style: the consumer wins. The open delay is 0\n // while another tooltip is showing (`--fsui-tooltip-warm`, design 6).\n style: native\n ? (s) => ({\n interestDelayStart: warmDelay(ctx.delay),\n interestDelayEnd: `${ctx.closeDelay}ms`,\n ...resolveStateValue(style, s),\n })\n : style,\n children,\n // `type=\"button\"` only on a real button (the consumer may override it); a link or a\n // component element does not get it.\n props: rendersButton(render) ? { type: \"button\", ...rest } : rest,\n libraryProps,\n ref: ctx.setTriggerElement,\n });\n return (\n <>\n {warmRules}\n {element}\n </>\n );\n}\n\nTooltipTrigger.displayName = \"TooltipTrigger\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,SAAgB,eAAe,EAC7B,2BAA2B,OAC3B,WACA,OACA,UACA,QACA,GAAG,QACmB;CACtB,MAAM,MAAM,kBAAkB,iBAAiB;CAC/C,MAAM,EAAE,UAAU,SAAS,UAAU,4BAA4B;CACjE,MAAM,SAAS,4BAA4B,CAAC;CAC5C,MAAM,MAAM,IAAI,UAAU;CAE1B,sBAAsB;EACpB,wBAAwB,MAAM;CAChC,GAAG,CAAC,QAAQ,uBAAuB,CAAC;CAEpC,MAAM,QAA6B,EAAE,SAAS;CAE9C,MAAM,eAAiE;EAErE,GAAI,aAAa,SAAS,EAAE,mBAAmB,QAAQ,IAAI,EAAE,oBAAoB,QAAQ;EACzF,iBAAiB,SAAS,QAAQ;EAGlC,GAAI,4BAA4B;GAC9B,aAAa,SAAS,UAAU,KAAA;IAEN,8BAAA,SAAS,KAAK,KAAA;EAC1C;CACF;CAOA,MAAM,YAAY,SAChB,oBAAC,SAAD;EAAO,MAAM;EAAmB,YAAY;EAAiB,OAAO,KAAK;EACtE,UAAA;CACI,CAAA,IACL;CAEJ,MAAM,UAAU,UAAgE;EAC9E,gBAAgB;EAChB;EACA;EACA;EAGA,OAAO,UACF,OAAO;GACN,oBAAoB,UAAU,IAAI,KAAK;GACvC,kBAAkB,GAAG,IAAI,WAAW;GACpC,GAAG,kBAAkB,OAAO,CAAC;EAC/B,KACA;EACJ;EAGA,OAAO,cAAc,MAAM,IAAI;GAAE,MAAM;GAAU,GAAG;EAAK,IAAI;EAC7D;EACA,KAAK,IAAI;CACX,CAAC;CACD,OACE,qBAAA,UAAA,EAAA,UAAA,CACG,WACA,OACD,EAAA,CAAA;AAEN;AAEA,eAAe,cAAc"}
1
+ {"version":3,"file":"tooltip-trigger.mjs","names":[],"sources":["../../src/tooltip/tooltip-trigger.tsx"],"sourcesContent":["\"use client\";\nimport { use, useLayoutEffect } from \"react\";\nimport type { ComponentPropsWithRef, CSSProperties, ReactNode } from \"react\";\nimport { CSPContext } from \"../internal/csp-context.js\";\nimport { dataAttr } from \"../internal/data-attr.js\";\nimport { FSUI_PRECEDENCE } from \"../internal/shipped-styles.js\";\nimport {\n TOOLTIP_TRIGGER_MARKER,\n TOOLTIP_WARM_HREF,\n TOOLTIP_WARM_RULES,\n warmDelay,\n} from \"../internal/tooltip-warm.js\";\nimport type { RenderProp, StateValue } from \"../internal/types.js\";\nimport { rendersButton, resolveStateValue, useRender } from \"../internal/use-render.js\";\nimport type { DataAttributes } from \"../internal/use-render.js\";\nimport { useTooltipContext } from \"./tooltip-context.js\";\n\n/**\n * State of `Tooltip.Trigger`, passed to the function forms of `className`, `style`, `children` and\n * `render`.\n */\nexport interface TooltipTriggerState {\n /** The Root's `disabled`. */\n readonly disabled: boolean;\n}\n\n/**\n * Props of `Tooltip.Trigger`.\n *\n * @see https://ui.funstack.work/components/tooltip\n */\nexport interface TooltipTriggerProps extends Omit<\n ComponentPropsWithRef<\"button\">,\n \"className\" | \"style\" | \"children\"\n> {\n /**\n * Experimental (Chromium 142+). Renders `interestfor` and `interest-delay-start/end` so the\n * browser owns hover, focus, Escape and long-press; the library's JS trigger path is skipped\n * where the rendered element implements `interestForElement`. No effect in other engines (the\n * attribute is ignored and the JS path runs). Pair with `Tooltip.Popup experimental_hint`.\n * Skip-delay on this path comes from a shipped rule: the Trigger renders the\n * `data-fsui-tooltip-trigger` marker, an `interest-delay-start` of\n * `calc(<delay>ms * (1 - var(--fsui-tooltip-warm, 0)))` and a hoisted\n * `<style href=\"@funstack/ui/tooltip-warm\">` (nonce from `<CSPProvider>`), rendered beside the\n * element so a `render` element with its own children keeps it. When that stylesheet is\n * missing (a CSP blocks it), the tooltip opens after its `delay` and only skip-delay is lost.\n *\n * @defaultValue `false`\n */\n experimental_interestFor?: boolean;\n /** Class name, or a function of the part's state that returns one. */\n className?: StateValue<string | undefined, TooltipTriggerState>;\n /** Inline style, or a function of the part's state that returns one. */\n style?: StateValue<CSSProperties | undefined, TooltipTriggerState>;\n /** Content, or a function of the part's state. */\n children?: StateValue<ReactNode, TooltipTriggerState>;\n /** Replace the default `<button>` (element form) or take over rendering (function form). */\n render?: RenderProp<ComponentPropsWithRef<\"button\">, TooltipTriggerState>;\n}\n\n/**\n * The element the user hovers or focuses: a `<button type=\"button\">` by default. `render` may\n * substitute a link or a custom button; the element must be focusable (a dev warning fires when\n * it is not). A natively `disabled` button never opens a tooltip; use `aria-disabled` instead.\n *\n * The library attaches its hover / focus listeners with `addEventListener` from `Tooltip.Root`,\n * so every `on*` prop passes through untouched.\n *\n * Owned keys (conventions 1.2): `aria-describedby` (with `provides=\"description\"`) or\n * `aria-labelledby` (with `provides=\"name\"`), both token-merged with the consumer's ids;\n * `data-disabled`; and `interestfor` and `data-fsui-tooltip-trigger` when\n * `experimental_interestFor` is on. `type=\"button\"` is a default the consumer may override (the\n * part installs no click handler), unlike the overlay Triggers, which own it.\n *\n * @see https://ui.funstack.work/components/tooltip\n */\nexport function TooltipTrigger({\n experimental_interestFor = false,\n className,\n style,\n children,\n render,\n ...rest\n}: TooltipTriggerProps) {\n const ctx = useTooltipContext(\"Tooltip.Trigger\");\n const { disabled, popupId, provides, setInterestForRequested } = ctx;\n const native = experimental_interestFor && !disabled;\n const csp = use(CSPContext);\n\n useLayoutEffect(() => {\n setInterestForRequested(native);\n }, [native, setInterestForRequested]);\n\n const state: TooltipTriggerState = { disabled };\n\n const libraryProps: ComponentPropsWithRef<\"button\"> & DataAttributes = {\n // Only the relation in use is owned; the other one passes through untouched.\n ...(provides === \"name\" ? { \"aria-labelledby\": popupId } : { \"aria-describedby\": popupId }),\n \"data-disabled\": dataAttr(disabled),\n // Owned while the flag is on: a disabled tooltip removes the attribute, so the browser\n // cannot open it either. Unflagged, the key is omitted (conventions 1.2).\n ...(experimental_interestFor && {\n interestfor: native ? popupId : undefined,\n // What the shipped skip-delay rule matches (design 6); nothing else carries it.\n [TOOLTIP_TRIGGER_MARKER]: native ? \"\" : undefined,\n }),\n };\n\n // Skip-delay on the native path (design 6, conventions 12): the browser reads the delay from\n // the computed style when the hover starts, and only a rule can see that another tooltip is\n // showing. Hoisted into <head> by React (during SSR too) and deduplicated; nothing lands in\n // place. Rendered beside the element, not in its children: a `render` element with its own\n // children (`render={<a href>Text</a>}`) wins over `children` and would drop it.\n const warmRules = native ? (\n <style href={TOOLTIP_WARM_HREF} precedence={FSUI_PRECEDENCE} nonce={csp?.nonce}>\n {TOOLTIP_WARM_RULES}\n </style>\n ) : null;\n\n const element = useRender<ComponentPropsWithRef<\"button\">, TooltipTriggerState>({\n defaultElement: \"button\",\n render,\n state,\n className,\n // The native delays sit under the consumer's style: the consumer wins. The open delay is 0\n // while another tooltip is showing (`--fsui-tooltip-warm`, design 6).\n style: native\n ? (s) => ({\n interestDelayStart: warmDelay(ctx.delay),\n interestDelayEnd: `${ctx.closeDelay}ms`,\n ...resolveStateValue(style, s),\n })\n : style,\n children,\n // `type=\"button\"` only on a real button (the consumer may override it); a link or a\n // component element does not get it.\n props: rendersButton(render) ? { type: \"button\", ...rest } : rest,\n libraryProps,\n ref: ctx.setTriggerElement,\n });\n return (\n <>\n {warmRules}\n {element}\n </>\n );\n}\n\nTooltipTrigger.displayName = \"TooltipTrigger\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,SAAgB,eAAe,EAC7B,2BAA2B,OAC3B,WACA,OACA,UACA,QACA,GAAG,QACmB;CACtB,MAAM,MAAM,kBAAkB,iBAAiB;CAC/C,MAAM,EAAE,UAAU,SAAS,UAAU,4BAA4B;CACjE,MAAM,SAAS,4BAA4B,CAAC;CAC5C,MAAM,MAAM,IAAI,UAAU;CAE1B,sBAAsB;EACpB,wBAAwB,MAAM;CAChC,GAAG,CAAC,QAAQ,uBAAuB,CAAC;CAEpC,MAAM,QAA6B,EAAE,SAAS;CAE9C,MAAM,eAAiE;EAErE,GAAI,aAAa,SAAS,EAAE,mBAAmB,QAAQ,IAAI,EAAE,oBAAoB,QAAQ;EACzF,iBAAiB,SAAS,QAAQ;EAGlC,GAAI,4BAA4B;GAC9B,aAAa,SAAS,UAAU,KAAA;IAEN,8BAAA,SAAS,KAAK,KAAA;EAC1C;CACF;CAOA,MAAM,YAAY,SAChB,oBAAC,SAAD;EAAO,MAAM;EAAmB,YAAY;EAAiB,OAAO,KAAK;EACtE,UAAA;CACI,CAAA,IACL;CAEJ,MAAM,UAAU,UAAgE;EAC9E,gBAAgB;EAChB;EACA;EACA;EAGA,OAAO,UACF,OAAO;GACN,oBAAoB,UAAU,IAAI,KAAK;GACvC,kBAAkB,GAAG,IAAI,WAAW;GACpC,GAAG,kBAAkB,OAAO,CAAC;EAC/B,KACA;EACJ;EAGA,OAAO,cAAc,MAAM,IAAI;GAAE,MAAM;GAAU,GAAG;EAAK,IAAI;EAC7D;EACA,KAAK,IAAI;CACX,CAAC;CACD,OACE,qBAAA,UAAA,EAAA,UAAA,CACG,WACA,OACD,EAAA,CAAA;AAEN;AAEA,eAAe,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funstack/ui",
3
- "version": "0.1.0-alpha.15",
3
+ "version": "0.1.0-alpha.16",
4
4
  "description": "Headless UI library for React — the first Async React-native UI library",
5
5
  "keywords": [
6
6
  "components",
@@ -21,8 +21,12 @@
21
21
  "url": "git+https://github.com/uhyo/funstack-ui.git",
22
22
  "directory": "packages/ui"
23
23
  },
24
+ "bin": {
25
+ "funstack-ui-skill-installer": "./dist/bin/skill-installer.mjs"
26
+ },
24
27
  "files": [
25
28
  "dist",
29
+ "skills",
26
30
  "README.md"
27
31
  ],
28
32
  "type": "module",
@@ -55,6 +59,9 @@
55
59
  "./tooltip": "./dist/tooltip/index.mjs",
56
60
  "./package.json": "./package.json"
57
61
  },
62
+ "dependencies": {
63
+ "@funstack/skill-installer": "^1.1.0"
64
+ },
58
65
  "devDependencies": {
59
66
  "@testing-library/dom": "^10.4.2",
60
67
  "@testing-library/jest-dom": "^7.0.1",
@@ -80,6 +87,7 @@
80
87
  "scripts": {
81
88
  "build": "tsdown",
82
89
  "dev": "tsdown --watch",
90
+ "pack:check": "node scripts/check-pack.mjs",
83
91
  "test": "vitest",
84
92
  "test:run": "vitest run",
85
93
  "test:jsdom": "vitest run --project jsdom --project jsdom-isolated",