@adea-ai/ui 0.162.6 → 0.162.7

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 (364) hide show
  1. package/dist/components/composites/about-dialog/about-dialog.js +5 -5
  2. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  3. package/dist/components/composites/accent-picker/accent-picker.js +3 -3
  4. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
  5. package/dist/components/composites/accent-picker/custom-color-popover.js +2 -2
  6. package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
  7. package/dist/components/composites/account-menu/account-menu.js +22 -22
  8. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  9. package/dist/components/composites/action-button/action-button.js +2 -2
  10. package/dist/components/composites/action-button/action-button.js.map +1 -1
  11. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +3 -3
  12. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  13. package/dist/components/composites/appearance-editor/appearance-choices.js +10 -10
  14. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  15. package/dist/components/composites/appearance-editor/appearance-editor.js +13 -13
  16. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  17. package/dist/components/composites/appearance-editor/appearance-rows.js +12 -12
  18. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  19. package/dist/components/composites/appearance-editor/font-settings-group.js +13 -13
  20. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  21. package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
  22. package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
  23. package/dist/components/composites/catalog-browser/catalog-browser-group.js +9 -9
  24. package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
  25. package/dist/components/composites/catalog-browser/catalog-browser.js +10 -10
  26. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  27. package/dist/components/composites/catalog-browser/catalog-detail.js +1 -1
  28. package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
  29. package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -5
  30. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  31. package/dist/components/composites/chat/chat.js +7 -7
  32. package/dist/components/composites/chat/chat.js.map +1 -1
  33. package/dist/components/composites/checkpoint/checkpoint.js +5 -5
  34. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  35. package/dist/components/composites/confirmation/confirmation.js +13 -13
  36. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  37. package/dist/components/composites/context/context.js +7 -7
  38. package/dist/components/composites/context/context.js.map +1 -1
  39. package/dist/components/composites/file-tree/build-file-tree.js +1 -1
  40. package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
  41. package/dist/components/composites/file-tree/file-tree.js +9 -9
  42. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  43. package/dist/components/composites/help-center/help-center.js +5 -5
  44. package/dist/components/composites/help-center/help-center.js.map +1 -1
  45. package/dist/components/composites/icon-picker/icon-picker.js +10 -10
  46. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  47. package/dist/components/composites/icon-picker/image-data-url.js.map +1 -1
  48. package/dist/components/composites/icon-picker/shell-icons.js +117 -117
  49. package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
  50. package/dist/components/composites/inline-citation/inline-citation.js +7 -7
  51. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  52. package/dist/components/composites/list-row/list-row-control.js +1 -1
  53. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  54. package/dist/components/composites/list-row/list-row.js +2 -2
  55. package/dist/components/composites/list-row/list-row.js.map +1 -1
  56. package/dist/components/composites/message-scroller/message-scroller.js +7 -7
  57. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  58. package/dist/components/composites/message-scroller/scroll-anchor.js +1 -1
  59. package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
  60. package/dist/components/composites/model-selector/model-selector.js +12 -12
  61. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  62. package/dist/components/composites/plan/plan.js +5 -5
  63. package/dist/components/composites/plan/plan.js.map +1 -1
  64. package/dist/components/composites/prompt-input/prompt-input.js +3 -3
  65. package/dist/components/composites/prompt-input/prompt-input.js.map +1 -1
  66. package/dist/components/composites/queue/queue.js +13 -13
  67. package/dist/components/composites/queue/queue.js.map +1 -1
  68. package/dist/components/composites/reasoning/reasoning.js +5 -5
  69. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  70. package/dist/components/composites/scene-controls/scene-controls.js +16 -16
  71. package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
  72. package/dist/components/composites/settings/settings-layout.js +2 -2
  73. package/dist/components/composites/settings/settings-layout.js.map +1 -1
  74. package/dist/components/composites/settings/settings-navigation.js +2 -2
  75. package/dist/components/composites/settings/settings-navigation.js.map +1 -1
  76. package/dist/components/composites/settings/settings.js +5 -5
  77. package/dist/components/composites/settings/settings.js.map +1 -1
  78. package/dist/components/composites/sources/sources.js +5 -5
  79. package/dist/components/composites/sources/sources.js.map +1 -1
  80. package/dist/components/composites/stack-trace/parse-stack-trace.js +2 -2
  81. package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
  82. package/dist/components/composites/stack-trace/stack-trace.js +10 -10
  83. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  84. package/dist/components/composites/stat/stat.js +6 -6
  85. package/dist/components/composites/stat/stat.js.map +1 -1
  86. package/dist/components/composites/subagent/subagent.js +5 -5
  87. package/dist/components/composites/subagent/subagent.js.map +1 -1
  88. package/dist/components/composites/suggestion/suggestion.js +2 -2
  89. package/dist/components/composites/suggestion/suggestion.js.map +1 -1
  90. package/dist/components/composites/task/task.js +5 -5
  91. package/dist/components/composites/task/task.js.map +1 -1
  92. package/dist/components/composites/terminal/ansi.js +1 -1
  93. package/dist/components/composites/terminal/ansi.js.map +1 -1
  94. package/dist/components/composites/terminal/terminal.js +18 -18
  95. package/dist/components/composites/terminal/terminal.js.map +1 -1
  96. package/dist/components/composites/test-results/test-results.js +17 -17
  97. package/dist/components/composites/test-results/test-results.js.map +1 -1
  98. package/dist/components/composites/tool/tool.js +5 -5
  99. package/dist/components/composites/tool/tool.js.map +1 -1
  100. package/dist/components/composites/tree/tree.js +6 -6
  101. package/dist/components/composites/tree/tree.js.map +1 -1
  102. package/dist/components/composites/update-dialog/channel-control.js +1 -1
  103. package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
  104. package/dist/components/composites/update-dialog/update-dialog.js +23 -23
  105. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  106. package/dist/components/composites/workspace-mark/workspace-mark.js +2 -2
  107. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  108. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +6 -6
  109. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  110. package/dist/components/composites/workspace-switcher/workspace-switcher.js +11 -11
  111. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  112. package/dist/components/conversation/atomic/chat-composer.js +1 -1
  113. package/dist/components/conversation/busy-send-button.js +10 -10
  114. package/dist/components/conversation/busy-send-button.js.map +1 -1
  115. package/dist/components/conversation/chat-composer.js +1 -1
  116. package/dist/components/conversation/composer-core.js +1 -1
  117. package/dist/components/conversation/composer-menu.js +2 -2
  118. package/dist/components/conversation/composer-menu.js.map +1 -1
  119. package/dist/components/conversation/conversation-avatar.js +7 -7
  120. package/dist/components/conversation/conversation-avatar.js.map +1 -1
  121. package/dist/components/conversation/conversation-pane.js +1 -1
  122. package/dist/components/conversation/conversation-pane.js.map +1 -1
  123. package/dist/components/conversation/conversation-surface.js +5 -5
  124. package/dist/components/conversation/conversation-surface.js.map +1 -1
  125. package/dist/components/conversation/internal/chat-composer-shell.js +9 -9
  126. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  127. package/dist/components/conversation/message-composer.js +9 -9
  128. package/dist/components/conversation/message-composer.js.map +1 -1
  129. package/dist/components/conversation/message-row.js +13 -13
  130. package/dist/components/conversation/message-row.js.map +1 -1
  131. package/dist/components/conversation/paste-token-editor.js +1 -1
  132. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  133. package/dist/components/conversation/scroll-follow.js +1 -1
  134. package/dist/components/conversation/thread-panel.js +5 -5
  135. package/dist/components/conversation/thread-panel.js.map +1 -1
  136. package/dist/components/conversation/transcript-composition.js +5 -5
  137. package/dist/components/conversation/transcript-composition.js.map +1 -1
  138. package/dist/components/layout/app-shell/app-shell.js +1 -1
  139. package/dist/components/layout/app-shell/app-shell.js.map +1 -1
  140. package/dist/components/layout/app-shell/skip-link.js +1 -1
  141. package/dist/components/layout/app-shell/skip-link.js.map +1 -1
  142. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +2 -2
  143. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
  144. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
  145. package/dist/components/layout/floating-preview/floating-preview.js +7 -7
  146. package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
  147. package/dist/components/layout/orbit-layout/orbit-layout.js +1 -1
  148. package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
  149. package/dist/components/layout/page/page.js +2 -2
  150. package/dist/components/layout/page/page.js.map +1 -1
  151. package/dist/components/layout/panel/panel.js +1 -1
  152. package/dist/components/layout/panel/panel.js.map +1 -1
  153. package/dist/components/layout/pixel-pane/pixel-pane.js +1 -1
  154. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +5 -5
  155. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  156. package/dist/components/layout/shell-rail/shell-rail.js +5 -5
  157. package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
  158. package/dist/components/layout/shell-top-bar/shell-top-bar.js +2 -2
  159. package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
  160. package/dist/components/layout/side-rail/side-rail.js +2 -2
  161. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  162. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js +1 -1
  163. package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -5
  164. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  165. package/dist/components/layout/split-layout/pane-focus.js.map +1 -1
  166. package/dist/components/layout/split-layout/resize-controller-core-retry.js +1 -1
  167. package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
  168. package/dist/components/layout/split-layout/resize-controller-core.js +1 -1
  169. package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
  170. package/dist/components/layout/split-layout/split-layout.js +7 -7
  171. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  172. package/dist/components/layout/status-bar/status-bar.js +1 -1
  173. package/dist/components/layout/status-bar/status-bar.js.map +1 -1
  174. package/dist/components/layout/top-bar/top-bar.js +5 -5
  175. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  176. package/dist/components/layout/virtual-window/virtual-window.js +1 -1
  177. package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
  178. package/dist/components/motion/presence.js +1 -1
  179. package/dist/components/theme/appearance-panel.js +3 -3
  180. package/dist/components/theme/appearance-panel.js.map +1 -1
  181. package/dist/components/theme/lazy.js +3 -3
  182. package/dist/components/theme/lazy.js.map +1 -1
  183. package/dist/components/theme/script-projection.js +1 -1
  184. package/dist/components/theme/theme-catalogue-source.js +1 -1
  185. package/dist/components/theme/theme-document.js.map +1 -1
  186. package/dist/components/theme/theme-mode-toggle.js +7 -7
  187. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  188. package/dist/components/theme/theme-picker.js +2 -2
  189. package/dist/components/theme/theme-picker.js.map +1 -1
  190. package/dist/components/theme/theme-provider-value.js +1 -1
  191. package/dist/components/theme/theme-provider-value.js.map +1 -1
  192. package/dist/components/theme/theme-provider.js +1 -1
  193. package/dist/components/theme/theme-toggle.js +7 -7
  194. package/dist/components/theme/theme-toggle.js.map +1 -1
  195. package/dist/components/ui/accordion/accordion.js +13 -13
  196. package/dist/components/ui/accordion/accordion.js.map +1 -1
  197. package/dist/components/ui/alert/alert.js +12 -12
  198. package/dist/components/ui/alert/alert.js.map +1 -1
  199. package/dist/components/ui/alert-dialog/alert-dialog.js +14 -14
  200. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  201. package/dist/components/ui/annotation-surface/annotation-surface.js +2 -2
  202. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  203. package/dist/components/ui/aspect-ratio/aspect-ratio.js +1 -1
  204. package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
  205. package/dist/components/ui/attachment/attachment.js +16 -16
  206. package/dist/components/ui/attachment/attachment.js.map +1 -1
  207. package/dist/components/ui/avatar/avatar.js +1 -1
  208. package/dist/components/ui/avatar/avatar.js.map +1 -1
  209. package/dist/components/ui/badge/badge.js +2 -2
  210. package/dist/components/ui/badge/badge.js.map +1 -1
  211. package/dist/components/ui/board/board.js +2 -2
  212. package/dist/components/ui/board/board.js.map +1 -1
  213. package/dist/components/ui/breadcrumb/breadcrumb.js +7 -7
  214. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  215. package/dist/components/ui/bubble/bubble.js +2 -2
  216. package/dist/components/ui/bubble/bubble.js.map +1 -1
  217. package/dist/components/ui/button/button.js +2 -2
  218. package/dist/components/ui/button-group/button-group.js +2 -2
  219. package/dist/components/ui/button-group/button-group.js.map +1 -1
  220. package/dist/components/ui/calendar/calendar.js +8 -8
  221. package/dist/components/ui/calendar/calendar.js.map +1 -1
  222. package/dist/components/ui/callout/callout.js +2 -2
  223. package/dist/components/ui/callout/callout.js.map +1 -1
  224. package/dist/components/ui/card/card.js +2 -2
  225. package/dist/components/ui/card/card.js.map +1 -1
  226. package/dist/components/ui/carousel/carousel.js +8 -8
  227. package/dist/components/ui/carousel/carousel.js.map +1 -1
  228. package/dist/components/ui/chart/chart.js +2 -2
  229. package/dist/components/ui/chart/chart.js.map +1 -1
  230. package/dist/components/ui/checkbox/checkbox.js +6 -6
  231. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  232. package/dist/components/ui/code-block/code-block.js +6 -6
  233. package/dist/components/ui/code-block/code-block.js.map +1 -1
  234. package/dist/components/ui/collapsible/collapsible.js +7 -7
  235. package/dist/components/ui/collapsible/collapsible.js.map +1 -1
  236. package/dist/components/ui/combobox/combobox.js +21 -21
  237. package/dist/components/ui/combobox/combobox.js.map +1 -1
  238. package/dist/components/ui/combobox/value-combobox.js +1 -1
  239. package/dist/components/ui/command/command.js +23 -23
  240. package/dist/components/ui/command/command.js.map +1 -1
  241. package/dist/components/ui/context-menu/context-menu.js +2 -2
  242. package/dist/components/ui/detail-panel/detail-panel.js +5 -5
  243. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
  244. package/dist/components/ui/dialog/dialog-layer.js +2 -2
  245. package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
  246. package/dist/components/ui/dialog/dialog.js +21 -21
  247. package/dist/components/ui/dialog/dialog.js.map +1 -1
  248. package/dist/components/ui/diff-block/diff-block.js +2 -2
  249. package/dist/components/ui/diff-block/diff-block.js.map +1 -1
  250. package/dist/components/ui/drawer/drawer.js +14 -14
  251. package/dist/components/ui/drawer/drawer.js.map +1 -1
  252. package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
  253. package/dist/components/ui/dropdown-menu/menu-parts.js +10 -10
  254. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
  255. package/dist/components/ui/empty/empty-state.js +5 -5
  256. package/dist/components/ui/empty/empty-state.js.map +1 -1
  257. package/dist/components/ui/empty/empty.js +1 -1
  258. package/dist/components/ui/empty/empty.js.map +1 -1
  259. package/dist/components/ui/entity-icon/entity-icon.js +2 -2
  260. package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
  261. package/dist/components/ui/field/field.js +14 -14
  262. package/dist/components/ui/field/field.js.map +1 -1
  263. package/dist/components/ui/field/number-field.js +2 -2
  264. package/dist/components/ui/field/number-field.js.map +1 -1
  265. package/dist/components/ui/hover-card/hover-card.js +10 -10
  266. package/dist/components/ui/hover-card/hover-card.js.map +1 -1
  267. package/dist/components/ui/input/input-control.js +1 -1
  268. package/dist/components/ui/input/input-control.js.map +1 -1
  269. package/dist/components/ui/input/input.js +2 -2
  270. package/dist/components/ui/input/input.js.map +1 -1
  271. package/dist/components/ui/input-group/input-group.js +2 -2
  272. package/dist/components/ui/input-group/input-group.js.map +1 -1
  273. package/dist/components/ui/input-group/secret-input-group.js +2 -2
  274. package/dist/components/ui/input-otp/input-otp.js +2 -2
  275. package/dist/components/ui/input-otp/input-otp.js.map +1 -1
  276. package/dist/components/ui/item/item.js +2 -2
  277. package/dist/components/ui/item/item.js.map +1 -1
  278. package/dist/components/ui/kbd/kbd.js +2 -2
  279. package/dist/components/ui/kbd/kbd.js.map +1 -1
  280. package/dist/components/ui/label/label.js +1 -1
  281. package/dist/components/ui/label/label.js.map +1 -1
  282. package/dist/components/ui/marker/marker.js +2 -2
  283. package/dist/components/ui/marker/marker.js.map +1 -1
  284. package/dist/components/ui/menubar/menubar.js +7 -7
  285. package/dist/components/ui/menubar/menubar.js.map +1 -1
  286. package/dist/components/ui/message/message.js +3 -3
  287. package/dist/components/ui/message/message.js.map +1 -1
  288. package/dist/components/ui/modal-dialog/modal-dialog.js +2 -2
  289. package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
  290. package/dist/components/ui/native-select/native-select.js +5 -5
  291. package/dist/components/ui/native-select/native-select.js.map +1 -1
  292. package/dist/components/ui/navigation-menu/navigation-menu.js +18 -18
  293. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  294. package/dist/components/ui/pagination/pagination.js +28 -28
  295. package/dist/components/ui/pagination/pagination.js.map +1 -1
  296. package/dist/components/ui/popover/popover.js +15 -15
  297. package/dist/components/ui/popover/popover.js.map +1 -1
  298. package/dist/components/ui/progress/progress.js +5 -5
  299. package/dist/components/ui/progress/progress.js.map +1 -1
  300. package/dist/components/ui/questionnaire/questionnaire.js +10 -10
  301. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  302. package/dist/components/ui/radio-group/radio-group.js +9 -9
  303. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  304. package/dist/components/ui/resizable/resizable.js +11 -11
  305. package/dist/components/ui/resizable/resizable.js.map +1 -1
  306. package/dist/components/ui/scroll-area/scroll-area.js +1 -1
  307. package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
  308. package/dist/components/ui/select/select.js +21 -21
  309. package/dist/components/ui/select/select.js.map +1 -1
  310. package/dist/components/ui/separator/separator.js +5 -5
  311. package/dist/components/ui/separator/separator.js.map +1 -1
  312. package/dist/components/ui/sheet/sheet.js +6 -6
  313. package/dist/components/ui/sheet/sheet.js.map +1 -1
  314. package/dist/components/ui/skeleton/skeleton.js +1 -1
  315. package/dist/components/ui/skeleton/skeleton.js.map +1 -1
  316. package/dist/components/ui/slider/slider.js +5 -5
  317. package/dist/components/ui/slider/slider.js.map +1 -1
  318. package/dist/components/ui/spinner/spinner.js +5 -5
  319. package/dist/components/ui/spinner/spinner.js.map +1 -1
  320. package/dist/components/ui/status-chip/status-chip.js +2 -2
  321. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  322. package/dist/components/ui/switch/switch.js +4 -4
  323. package/dist/components/ui/switch/switch.js.map +1 -1
  324. package/dist/components/ui/table/table.js +1 -1
  325. package/dist/components/ui/table/table.js.map +1 -1
  326. package/dist/components/ui/tabs/tabs.js +7 -7
  327. package/dist/components/ui/tabs/tabs.js.map +1 -1
  328. package/dist/components/ui/text-link/text-link.js +1 -1
  329. package/dist/components/ui/text-link/text-link.js.map +1 -1
  330. package/dist/components/ui/textarea/textarea.js +2 -2
  331. package/dist/components/ui/textarea/textarea.js.map +1 -1
  332. package/dist/components/ui/toast/toast.js +7 -7
  333. package/dist/components/ui/toast/toast.js.map +1 -1
  334. package/dist/components/ui/toggle/toggle.js +6 -6
  335. package/dist/components/ui/toggle/toggle.js.map +1 -1
  336. package/dist/components/ui/toggle-group/toggle-group.js +7 -8
  337. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
  338. package/dist/components/ui/tooltip/deferred-tooltip.js +6 -6
  339. package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
  340. package/dist/components/ui/tooltip/lazy-tooltip.js +2 -2
  341. package/dist/components/ui/tooltip/tooltip.js +10 -10
  342. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  343. package/dist/components/ui/trace/trace.js +19 -19
  344. package/dist/components/ui/trace/trace.js.map +1 -1
  345. package/dist/components/ui/typography/typography.js +2 -2
  346. package/dist/lib/accent-presets.js +1 -1
  347. package/dist/lib/accent-roles.js +2 -2
  348. package/dist/lib/async-action.js +1 -1
  349. package/dist/lib/create-poll.js +1 -1
  350. package/dist/lib/create-poll.js.map +1 -1
  351. package/dist/lib/external-link.js +1 -1
  352. package/dist/lib/external-link.js.map +1 -1
  353. package/dist/lib/fast-icon.js +1 -1
  354. package/dist/lib/theme-css.js +1 -1
  355. package/dist/lib/theme-engine-light.js +1 -1
  356. package/dist/lib/theme-projection.js +2 -2
  357. package/dist/lib/theme-records.js +1 -1
  358. package/dist/lib/themes.js +1 -1
  359. package/dist/lib/themes.js.map +1 -1
  360. package/dist/lib/tooltip-focus-gate.js.map +1 -1
  361. package/dist/lib/utils.js +1 -1
  362. package/dist/vite/source-parser.js +1 -1
  363. package/dist/vite/tailwind-sources.js +1 -1
  364. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"deferred-tooltip.js","names":["applyRef"],"sources":["../../../../src/components/ui/tooltip/deferred-tooltip.tsx"],"sourcesContent":["import type { Accessor } from 'solid-js'\nimport type { JSX } from '@solidjs/web'\nimport { createSignal, flush, onCleanup, omit, untrack } from 'solid-js'\nimport { isServer, spread } from '@solidjs/web'\nimport { callHandler } from '#lib/events'\nimport { sourceOf } from '@ui-sdk/core'\nimport { acquireTooltipFocusGate, releaseTooltipFocusGate } from '#lib/tooltip-focus-gate'\n\ntype ElementRef = ((element: HTMLElement) => void) | ElementRef[] | undefined\n\ntype TriggerProps = {\n ref?: ElementRef\n [key: string]: unknown\n}\n\n/** ui-sdk hands a part's `ref` as an array (the caller's and its own); call each. */\nfunction applyRef(ref: unknown, element: HTMLElement) {\n if (typeof ref === 'function') ref(element)\n else if (Array.isArray(ref)) for (const each of ref) applyRef(each, element)\n}\n\n/**\n * Props the control keeps for itself: its type, its description, its content,\n * and its identity (`data-slot`, `class`, `style`). The trigger part names\n * itself `tooltip-trigger`, which would overwrite the control's own slot.\n */\nconst controlOwned = [\n 'ref',\n 'type',\n 'aria-describedby',\n 'children',\n 'as',\n 'data-slot',\n 'class',\n 'style',\n] as const\n\nexport type DeferredTooltip = {\n /** True once the control has been hovered or focused: render the tooltip then. */\n armed: Accessor<boolean>\n /** Pass as the control's `ref`. */\n ref: (element: HTMLElement) => void\n /** Pass as the control's `onPointerEnter`. */\n onPointerEnter: (event: PointerEvent) => void\n /** Pass as the control's `onFocus`. */\n onFocus: (event: FocusEvent) => void\n /**\n * Pass to `TooltipTrigger as={...}`. It renders nothing: it hands the trigger's\n * handlers, state attributes and ref to the control that is already on screen.\n */\n Target: (props: TriggerProps) => JSX.Element\n}\n\n/**\n * A tooltip that costs nothing until it is wanted.\n *\n * Every tooltip trigger builds a tooltip root, its positioning wiring and a\n * focus-gate registration when it mounts, and almost none of them are ever\n * shown: a list or toolbar of tooltip controls paid for all of them up front.\n * With this, the control renders plain and the tooltip mounts the first time a\n * pointer enters it or keyboard focus reaches it.\n *\n * The control is never replaced. The trigger adopts the element already on\n * screen (its handlers go on as native listeners next to the control's own;\n * spreading them would take Solid's delegated slot and replace the control's\n * `onClick`), so mounting late moves no focus and drops no hover. The event\n * that armed the tooltip is replayed to the new trigger, so the tip opens on\n * the same timing as an eagerly mounted one; the control's own handlers do not\n * see the replay.\n *\n * The trigger never sets `type`, `aria-describedby`, children, `data-slot`,\n * `class` or `style`: the control owns those, and points `aria-describedby` at\n * the content's id while the tip is open.\n *\n * The keyboard-focus gate is held for the control's lifetime, not from the\n * moment its tooltip mounts, so it sees the Tab that precedes a first focus.\n */\nexport function createDeferredTooltip(options: {\n enabled: Accessor<boolean>\n onPointerEnter?: Accessor<unknown>\n onFocus?: Accessor<unknown>\n}): DeferredTooltip {\n const [element, setElement] = createSignal<HTMLElement>()\n const [armed, setArmed] = createSignal(false)\n let replaying = false\n\n // Held only by a control that has a tooltip: a control without one needs no gate\n // and no effect. A tooltip added later takes the gate when it first arms.\n let holdsGate = false\n const holdGate = () => {\n if (holdsGate || isServer) return\n holdsGate = true\n acquireTooltipFocusGate()\n }\n if (untrack(options.enabled)) holdGate()\n // ui-sdk opens a tooltip on focus only when its input tracker saw the Tab\n // that moved focus, and it installs that tracker lazily, when its first\n // primitive asks. On a page where this control's tooltip is the first one, the\n // tracker would arrive with the tooltip, after the Tab, and the first\n // keyboard focus would show nothing. Asking how the user is working installs\n // it now, ahead of that Tab.\n if (!isServer) sourceOf()\n onCleanup(() => {\n if (holdsGate) releaseTooltipFocusGate()\n })\n\n const arm = (replay: () => void) => {\n if (armed() || !options.enabled()) return\n holdGate()\n setArmed(true)\n // Solid 2 batches the write: flush it so the tooltip (and its trigger's\n // listeners on the control) is in place before the event is replayed.\n flush()\n replaying = true\n try {\n replay()\n } finally {\n replaying = false\n }\n }\n\n const Target = (props: TriggerProps) => {\n const control = element()\n if (!control) return null\n const rest = omit(props, ...controlOwned)\n applyRef(props.ref, control)\n const attributes: Record<string, unknown> = {}\n for (const key of Object.keys(rest)) {\n const value = rest[key]\n if (/^on[A-Z]/.test(key) && typeof value === 'function') {\n const type = key.slice(2).toLowerCase()\n const listener = value as EventListener\n control.addEventListener(type, listener)\n onCleanup(() => control.removeEventListener(type, listener))\n } else {\n Object.defineProperty(attributes, key, { enumerable: true, get: () => rest[key] })\n }\n }\n // The third argument skips children: the control renders its own.\n spread(control, attributes, true)\n return null\n }\n\n return {\n armed,\n ref: setElement,\n onPointerEnter(event) {\n if (replaying) return\n callHandler(options.onPointerEnter?.() as never, event as never)\n if (event.pointerType === 'touch' || event.defaultPrevented) return\n const target = event.currentTarget as HTMLElement\n arm(() =>\n target.dispatchEvent(\n new PointerEvent('pointerenter', {\n pointerId: event.pointerId,\n pointerType: event.pointerType,\n clientX: event.clientX,\n clientY: event.clientY,\n })\n )\n )\n },\n onFocus(event) {\n if (replaying) return\n callHandler(options.onFocus?.() as never, event as never)\n if (event.defaultPrevented) return\n const target = event.currentTarget as HTMLElement\n // ui-sdk's trigger listens for `focusin`. The replay does not bubble, so\n // no focus tracker above the control sees the same focus twice.\n arm(() =>\n target.dispatchEvent(new FocusEvent('focusin', { relatedTarget: event.relatedTarget }))\n )\n },\n Target,\n }\n}\n"],"mappings":";;;;;;;AAgBA,SAASA,WAAS,KAAc,SAAsB;CACpD,IAAI,OAAO,QAAQ,YAAY,IAAI,OAAO;MACrC,IAAI,MAAM,QAAQ,GAAG,GAAG,KAAK,MAAM,QAAQ,KAAK,WAAS,MAAM,OAAO;AAC7E;;;;;;AAOA,IAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAgB,sBAAsB,SAIlB;CAClB,MAAM,CAAC,SAAS,cAAc,aAA0B;CACxD,MAAM,CAAC,OAAO,YAAY,aAAa,KAAK;CAC5C,IAAI,YAAY;CAIhB,IAAI,YAAY;CAChB,MAAM,iBAAiB;EACrB,IAAI,aAAa,UAAU;EAC3B,YAAY;EACZ,wBAAwB;CAC1B;CACA,IAAI,QAAQ,QAAQ,OAAO,GAAG,SAAS;CAOvC,IAAI,CAAC,UAAU,SAAS;CACxB,gBAAgB;EACd,IAAI,WAAW,wBAAwB;CACzC,CAAC;CAED,MAAM,OAAO,WAAuB;EAClC,IAAI,MAAM,KAAK,CAAC,QAAQ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CACxF;EACF;EACA;CACF;AACF"}
1
+ {"version":3,"file":"deferred-tooltip.js","names":[],"sources":["../../../../src/components/ui/tooltip/deferred-tooltip.tsx"],"sourcesContent":["import type { Accessor } from 'solid-js'\nimport type { JSX } from '@solidjs/web'\nimport { createSignal, flush, onCleanup, omit, untrack } from 'solid-js'\nimport { isServer, spread } from '@solidjs/web'\nimport { callHandler } from '#lib/events'\nimport { sourceOf } from '@ui-sdk/core'\nimport { acquireTooltipFocusGate, releaseTooltipFocusGate } from '#lib/tooltip-focus-gate'\n\ntype ElementRef = ((element: HTMLElement) => void) | ElementRef[] | undefined\n\ntype TriggerProps = {\n ref?: ElementRef\n [key: string]: unknown\n}\n\n/** ui-sdk hands a part's `ref` as an array (the caller's and its own); call each. */\nfunction applyRef(ref: unknown, element: HTMLElement) {\n if (typeof ref === 'function') ref(element)\n else if (Array.isArray(ref)) for (const each of ref) applyRef(each, element)\n}\n\n/**\n * Props the control keeps for itself: its type, its description, its content,\n * and its identity (`data-slot`, `class`, `style`). The trigger part names\n * itself `tooltip-trigger`, which would overwrite the control's own slot.\n */\nconst controlOwned = [\n 'ref',\n 'type',\n 'aria-describedby',\n 'children',\n 'as',\n 'data-slot',\n 'class',\n 'style',\n] as const\n\nexport type DeferredTooltip = {\n /** True once the control has been hovered or focused: render the tooltip then. */\n armed: Accessor<boolean>\n /** Pass as the control's `ref`. */\n ref: (element: HTMLElement) => void\n /** Pass as the control's `onPointerEnter`. */\n onPointerEnter: (event: PointerEvent) => void\n /** Pass as the control's `onFocus`. */\n onFocus: (event: FocusEvent) => void\n /**\n * Pass to `TooltipTrigger as={...}`. It renders nothing: it hands the trigger's\n * handlers, state attributes and ref to the control that is already on screen.\n */\n Target: (props: TriggerProps) => JSX.Element\n}\n\n/**\n * A tooltip that costs nothing until it is wanted.\n *\n * Every tooltip trigger builds a tooltip root, its positioning wiring and a\n * focus-gate registration when it mounts, and almost none of them are ever\n * shown: a list or toolbar of tooltip controls paid for all of them up front.\n * With this, the control renders plain and the tooltip mounts the first time a\n * pointer enters it or keyboard focus reaches it.\n *\n * The control is never replaced. The trigger adopts the element already on\n * screen (its handlers go on as native listeners next to the control's own;\n * spreading them would take Solid's delegated slot and replace the control's\n * `onClick`), so mounting late moves no focus and drops no hover. The event\n * that armed the tooltip is replayed to the new trigger, so the tip opens on\n * the same timing as an eagerly mounted one; the control's own handlers do not\n * see the replay.\n *\n * The trigger never sets `type`, `aria-describedby`, children, `data-slot`,\n * `class` or `style`: the control owns those, and points `aria-describedby` at\n * the content's id while the tip is open.\n *\n * The keyboard-focus gate is held for the control's lifetime, not from the\n * moment its tooltip mounts, so it sees the Tab that precedes a first focus.\n */\nexport function createDeferredTooltip(options: {\n enabled: Accessor<boolean>\n onPointerEnter?: Accessor<unknown>\n onFocus?: Accessor<unknown>\n}): DeferredTooltip {\n const [element, setElement] = createSignal<HTMLElement>()\n const [armed, setArmed] = createSignal(false)\n let replaying = false\n\n // Held only by a control that has a tooltip: a control without one needs no gate\n // and no effect. A tooltip added later takes the gate when it first arms.\n let holdsGate = false\n const holdGate = () => {\n if (holdsGate || isServer) return\n holdsGate = true\n acquireTooltipFocusGate()\n }\n if (untrack(options.enabled)) holdGate()\n // ui-sdk opens a tooltip on focus only when its input tracker saw the Tab\n // that moved focus, and it installs that tracker lazily, when its first\n // primitive asks. On a page where this control's tooltip is the first one, the\n // tracker would arrive with the tooltip, after the Tab, and the first\n // keyboard focus would show nothing. Asking how the user is working installs\n // it now, ahead of that Tab.\n if (!isServer) sourceOf()\n onCleanup(() => {\n if (holdsGate) releaseTooltipFocusGate()\n })\n\n const arm = (replay: () => void) => {\n if (armed() || !options.enabled()) return\n holdGate()\n setArmed(true)\n // Solid 2 batches the write: flush it so the tooltip (and its trigger's\n // listeners on the control) is in place before the event is replayed.\n flush()\n replaying = true\n try {\n replay()\n } finally {\n replaying = false\n }\n }\n\n const Target = (props: TriggerProps) => {\n const control = element()\n if (!control) return null\n const rest = omit(props, ...controlOwned)\n applyRef(props.ref, control)\n const attributes: Record<string, unknown> = {}\n for (const key of Object.keys(rest)) {\n const value = rest[key]\n if (/^on[A-Z]/.test(key) && typeof value === 'function') {\n const type = key.slice(2).toLowerCase()\n const listener = value as EventListener\n control.addEventListener(type, listener)\n onCleanup(() => control.removeEventListener(type, listener))\n } else {\n Object.defineProperty(attributes, key, { enumerable: true, get: () => rest[key] })\n }\n }\n // The third argument skips children: the control renders its own.\n spread(control, attributes, true)\n return null\n }\n\n return {\n armed,\n ref: setElement,\n onPointerEnter(event) {\n if (replaying) return\n callHandler(options.onPointerEnter?.() as never, event as never)\n if (event.pointerType === 'touch' || event.defaultPrevented) return\n const target = event.currentTarget as HTMLElement\n arm(() =>\n target.dispatchEvent(\n new PointerEvent('pointerenter', {\n pointerId: event.pointerId,\n pointerType: event.pointerType,\n clientX: event.clientX,\n clientY: event.clientY,\n })\n )\n )\n },\n onFocus(event) {\n if (replaying) return\n callHandler(options.onFocus?.() as never, event as never)\n if (event.defaultPrevented) return\n const target = event.currentTarget as HTMLElement\n // ui-sdk's trigger listens for `focusin`. The replay does not bubble, so\n // no focus tracker above the control sees the same focus twice.\n arm(() =>\n target.dispatchEvent(new FocusEvent('focusin', { relatedTarget: event.relatedTarget }))\n )\n },\n Target,\n }\n}\n"],"mappings":";;;;;;;AAgBA,SAAS,SAAS,KAAc,SAAsB;CACpD,IAAI,OAAO,QAAQ,YAAY,IAAI,OAAO;MACrC,IAAI,MAAM,QAAQ,GAAG,GAAG,KAAK,MAAM,QAAQ,KAAK,SAAS,MAAM,OAAO;AAC7E;;;;;;AAOA,IAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAgB,sBAAsB,SAIlB;CAClB,MAAM,CAAC,SAAS,cAAc,aAA0B;CACxD,MAAM,CAAC,OAAO,YAAY,aAAa,KAAK;CAC5C,IAAI,YAAY;CAIhB,IAAI,YAAY;CAChB,MAAM,iBAAiB;EACrB,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SAAS,MAAM;GACjB,CAAC,CACH,CACF;EACF;EACA,QAAQ,OAAO;GACb,IAAI,WAAW;GACf,YAAY,QAAQ,UAAU,GAAY,KAAc;GACxD,IAAI,MAAM,kBAAkB;GAC5B,MAAM,SAAS,MAAM;GAGrB,UACE,OAAO,cAAc,IAAI,WAAW,WAAW,EAAE,eAAe,MAAM,cAAc,CAAC,CAAC,CACxF;EACF;EACA;CACF;AACF"}
@@ -1,7 +1,7 @@
1
- import { createDeferredTooltip } from "./deferred-tooltip.js";
2
- import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
3
1
  import { createComponent, memo, mergeProps } from "@solidjs/web";
4
2
  import { createSignal, createUniqueId } from "solid-js";
3
+ import { createDeferredTooltip } from "./deferred-tooltip.js";
4
+ import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
5
5
  // src/components/ui/tooltip/lazy-tooltip.tsx
6
6
  /**
7
7
  * A tooltip around a control that mounts on the control's first hover or focus.
@@ -1,10 +1,10 @@
1
+ import { Dynamic, createComponent, insert, isServer, memo, mergeProps, spread, template } from "@solidjs/web";
2
+ import { Tooltip as Tooltip$1, TooltipContent as TooltipContent$1, TooltipTrigger as TooltipTrigger$1, createTooltipController } from "@ui-sdk/solid/tooltip";
3
+ import { Show, children, createContext, omit, onCleanup, onSettled, useContext } from "solid-js";
1
4
  import { SNAP_GUARD, tooltipMotion, tooltipTip } from "../../../lib/overlay.js";
2
5
  import { acquireTooltipFocusGate, releaseTooltipFocusGate } from "../../../lib/tooltip-focus-gate.js";
3
6
  import { cn } from "../../../lib/utils.js";
4
7
  import { forwardRef } from "../../../lib/refs.js";
5
- import { Dynamic, createComponent, insert, isServer, memo, mergeProps, spread, template } from "@solidjs/web";
6
- import { Show, children, createContext, omit, onCleanup, onSettled, useContext } from "solid-js";
7
- import { Tooltip, TooltipContent, TooltipTrigger, createTooltipController } from "@ui-sdk/solid/tooltip";
8
8
  // src/components/ui/tooltip/tooltip.tsx
9
9
  var _tmpl$ = /* @__PURE__ */ template(`<div>`);
10
10
  var _tmpl$2 = /* @__PURE__ */ template(`<span data-slot=tooltip-icon aria-hidden=true class="flex size-4 shrink-0 items-center justify-center [&amp;_svg]:size-4">`);
@@ -150,7 +150,7 @@ function TooltipProvider(props) {
150
150
  }
151
151
  });
152
152
  }
153
- function Tooltip$1(props) {
153
+ function Tooltip(props) {
154
154
  if (!isServer) {
155
155
  acquireTooltipFocusGate();
156
156
  onCleanup(releaseTooltipFocusGate);
@@ -211,7 +211,7 @@ function Tooltip$1(props) {
211
211
  setContent: (element) => content = element
212
212
  },
213
213
  get children() {
214
- return createComponent(Tooltip, mergeProps(rest, {
214
+ return createComponent(Tooltip$1, mergeProps(rest, {
215
215
  type: "description",
216
216
  controller,
217
217
  get delay() {
@@ -230,10 +230,10 @@ function Tooltip$1(props) {
230
230
  }
231
231
  });
232
232
  }
233
- function TooltipTrigger$1(props) {
233
+ function TooltipTrigger(props) {
234
234
  const parts = useContext(TooltipPartsContext);
235
235
  const rest = omit(props, "as", "ref");
236
- return createComponent(TooltipTrigger, mergeProps(rest, {
236
+ return createComponent(TooltipTrigger$1, mergeProps(rest, {
237
237
  get render() {
238
238
  return asRender(props.as, () => props["data-slot"]);
239
239
  },
@@ -243,7 +243,7 @@ function TooltipTrigger$1(props) {
243
243
  }
244
244
  }));
245
245
  }
246
- function TooltipContent$1(props) {
246
+ function TooltipContent(props) {
247
247
  const rootPlacement = useContext(TooltipPlacementContext);
248
248
  const parts = useContext(TooltipPartsContext);
249
249
  const rest = omit(props, "class", "children", "icon", "placement", "gutter", "shift", "ref");
@@ -256,7 +256,7 @@ function TooltipContent$1(props) {
256
256
  gutter: 0
257
257
  });
258
258
  const icon = children(() => props.icon);
259
- return createComponent(TooltipContent, mergeProps({
259
+ return createComponent(TooltipContent$1, mergeProps({
260
260
  get container() {
261
261
  return overlayContainer();
262
262
  },
@@ -309,6 +309,6 @@ var arrowPlacement = "pointer-events-none size-7.5 data-[side=bottom]:bottom-ful
309
309
  function ArrowGlyph() {
310
310
  return _tmpl$3();
311
311
  }
312
- export { ArrowGlyph, Tooltip$1 as Tooltip, TooltipContent$1 as TooltipContent, TooltipEscapeTargetContext, TooltipProvider, TooltipTrigger$1 as TooltipTrigger, arrowPlacement, asRender, expandedDiv, overlayContainer, placementProps, triggerRender };
312
+ export { ArrowGlyph, Tooltip, TooltipContent, TooltipEscapeTargetContext, TooltipProvider, TooltipTrigger, arrowPlacement, asRender, expandedDiv, overlayContainer, placementProps, triggerRender };
313
313
 
314
314
  //# sourceMappingURL=tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","names":["<Dynamic component={as} {...props} data-slot={own as string} />","component={as}","<Dynamic component={as} {...props} />","<Dynamic component={as} {...omit(props, 'data-slot')} />","<Dynamic\n component={component}\n {...part}\n {...named}\n data-expanded={state.open ? '' : undefined}\n />","<div {...props} data-expanded={state.open ? '' : undefined} />","<div\n {...props}\n data-expanded={state.open ? '' : undefined}\n aria-hidden={state.open ? (props['aria-hidden'] as 'true' | 'false' | undefined) : 'true'}\n />","<TooltipTimingContext\n value={{\n get openDelay() {\n return props.openDelay ?? tooltipDefaults.openDelay\n },\n get closeDelay() {\n return props.closeDelay ?? tooltipDefaults.closeDelay\n },\n get skipDelayDuration() {\n return props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration\n },\n }}\n >\n {props.children}\n </TooltipTimingContext>","value={{\n get openDelay() {\n return props.openDelay ?? tooltipDefaults.openDelay\n },\n get closeDelay() {\n return props.closeDelay ?? tooltipDefaults.closeDelay\n },\n get skipDelayDuration() {\n return props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration\n },\n }}","<TooltipPlacementContext\n value={() => ({ placement: props.placement, gutter: props.gutter, shift: props.shift })}\n >\n <TooltipPartsContext\n value={{\n setTrigger: (element) => (trigger = element),\n setContent: (element) => (content = element),\n }}\n >\n <UiTooltip\n {...rest}\n // Kobalte always described the trigger with the tip; ui-sdk would\n // name an icon-only trigger with it instead. Every trigger here\n // carries its own name, so the tip stays a description.\n type=\"description\"\n controller={controller}\n delay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n onOpenChange={onOpenChange}\n >\n {props.children}\n </UiTooltip>\n </TooltipPartsContext>\n </TooltipPlacementContext>","value={() => ({ placement: props.placement, gutter: props.gutter, shift: props.shift })}","<TooltipPartsContext\n value={{\n setTrigger: (element) => (trigger = element),\n setContent: (element) => (content = element),\n }}\n >\n <UiTooltip\n {...rest}\n // Kobalte always described the trigger with the tip; ui-sdk would\n // name an icon-only trigger with it instead. Every trigger here\n // carries its own name, so the tip stays a description.\n type=\"description\"\n controller={controller}\n delay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n onOpenChange={onOpenChange}\n >\n {props.children}\n </UiTooltip>\n </TooltipPartsContext>","value={{\n setTrigger: (element) => (trigger = element),\n setContent: (element) => (content = element),\n }}","<UiTooltip\n {...rest}\n // Kobalte always described the trigger with the tip; ui-sdk would\n // name an icon-only trigger with it instead. Every trigger here\n // carries its own name, so the tip stays a description.\n type=\"description\"\n controller={controller}\n delay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n onOpenChange={onOpenChange}\n >\n {props.children}\n </UiTooltip>","type=\"description\"","<UiTooltipTrigger\n {...(rest as PartProps<'button'>)}\n render={asRender(props.as, () => props['data-slot'])}\n ref={(element: HTMLElement) => {\n parts?.setTrigger(element)\n forwardRef(() => props.ref, element)\n }}\n />","ref={(element: HTMLElement) => {\n parts?.setTrigger(element)\n forwardRef(() => props.ref, element)\n }}","<UiTooltipContent\n container={overlayContainer()}\n side={placement().side}\n align={placement().align}\n sideOffset={placement().sideOffset}\n alignOffset={placement().alignOffset}\n class={cn(\n tooltipTip,\n // The max width is a token, not a fixed measure: it has to fall\n // behind the viewport at large root font sizes or the tip — which the\n // placement can shift but never shrink — forces a horizontal scroll.\n 'z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-3 py-1.5',\n 'origin-(--transform-origin) text-balance',\n tooltipMotion,\n // An icon+label tip is one row that reads as a unit, so the label\n // never wraps under the glyph.\n { 'flex items-center gap-2 whitespace-nowrap': !!icon() },\n props.class\n )}\n // A tooltip is never interactive: the content is plain text, and the\n // placement draws the tip below its action — where a hit-testing tip\n // would hold the next control hostage, open or departing. The pointer\n // belongs to the control underneath.\n style={{ 'pointer-events': 'none' }}\n render={tooltipDiv}\n {...rest}\n ref={(element: HTMLDivElement) => {\n parts?.setContent(element)\n forwardRef(() => props.ref, element)\n }}\n >\n <Show when={icon()}>\n {(iconSlot) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\"\n >\n {iconSlot()}\n </span>\n )}\n </Show>\n {props.children}\n </UiTooltipContent>","style={{ 'pointer-events': 'none' }}","render={tooltipDiv}","ref={(element: HTMLDivElement) => {\n parts?.setContent(element)\n forwardRef(() => props.ref, element)\n }}","<Show when={icon()}>\n {(iconSlot) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\"\n >\n {iconSlot()}\n </span>\n )}\n </Show>","props.children","<svg\n display=\"block\"\n viewBox=\"0 0 30 30\"\n aria-hidden=\"true\"\n style={{ transform: 'scale(1.02)', 'stroke-width': '2' }}\n >\n <g transform=\"translate(0 2)\">\n <path fill=\"none\" d={ARROW_PATH} />\n <path stroke=\"none\" d={ARROW_PATH} />\n </g>\n </svg>","Tooltip","TooltipTrigger","TooltipContent","resolveChildren"],"sources":["../../../../src/components/ui/tooltip/tooltip.tsx"],"sourcesContent":["import {\n Tooltip as UiTooltip,\n TooltipContent as UiTooltipContent,\n TooltipTrigger as UiTooltipTrigger,\n createTooltipController,\n type TooltipContentState,\n type TooltipOpenChangeReason,\n} from '@ui-sdk/solid/tooltip'\nimport type { PartProps, RenderProp } from '@ui-sdk/solid/primitive'\nimport type { Accessor } from 'solid-js'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport {\n children as resolveChildren,\n createContext,\n onCleanup,\n onSettled,\n Show,\n omit,\n useContext,\n} from 'solid-js'\nimport { Dynamic, isServer } from '@solidjs/web'\nimport { SNAP_GUARD, tooltipMotion, tooltipTip } from '#lib/overlay'\nimport { acquireTooltipFocusGate, releaseTooltipFocusGate } from '#lib/tooltip-focus-gate'\nimport { cn } from '#lib/utils'\nimport { forwardRef } from '#lib/refs'\n\n/*\n * The overlay kit's shared plumbing. It lives in this file because every\n * overlay folder may import `../tooltip/tooltip` directly (see .oxlintrc.json),\n * and the tooltip itself needs all of it.\n */\n\n/**\n * Where a floating layer sits, in the placement vocabulary the kit's public\n * API has always spoken (`top`, `bottom-start`, `right-end`, ...). ui-sdk\n * places on the content with `side` and `align`; `placementProps` converts.\n */\nexport type OverlayPlacement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n\nexport type OverlayPlacementOptions = {\n placement?: OverlayPlacement\n /** The gap between the anchor and the layer, in pixels. */\n gutter?: number\n /** The shift along the anchor, in pixels. */\n shift?: number\n}\n\n/** ui-sdk's `side`/`align`/offsets for a placement, with the layer's own defaults. */\nexport function placementProps(\n options: OverlayPlacementOptions,\n defaults: { placement: OverlayPlacement; gutter: number }\n) {\n const [side, align] = (options.placement ?? defaults.placement).split('-') as [\n 'top' | 'bottom' | 'left' | 'right',\n 'start' | 'end' | undefined,\n ]\n return {\n side,\n align: align ?? ('center' as const),\n sideOffset: (options.gutter ?? defaults.gutter) + SNAP_GUARD,\n alignOffset: options.shift,\n }\n}\n\n/**\n * The element popups render into. Every overlay used to portal to `<body>`,\n * so its content inherited nothing from the place it was written (a tip\n * declared inside an uppercase label, a dialog inside a form) and took no part\n * in its parent's `:last-child`, `space-*` or `divide-*` rules. ui-sdk renders\n * in place by default; passing `<body>` keeps the old inheritance while the\n * content still shows in the browser's top layer.\n */\nexport const overlayContainer = (): Element | undefined => (isServer ? undefined : document.body)\n\n/**\n * A part's props plus the kit's `as`: the extra props an `as` component takes\n * (a Button's `variant`) pass through to it.\n */\nexport type WithAs<Props> = Props & {\n /** Render the part as this component, which must forward props and ref to its element. */\n as?: ValidComponent\n class?: string\n [key: string]: unknown\n}\n\n/**\n * The kit's `as` prop on top of ui-sdk's `render` prop: the part's props and\n * behaviour land on the caller's component (`as={Button}`), which must forward\n * them to its element as Kobalte's polymorphic parts required.\n *\n * ui-sdk writes the part's own `data-slot` (`popover-trigger`) over the\n * caller's. Kobalte set none, so a wrapped component kept its own: a Button\n * trigger stayed `data-slot=\"button\"`, and styles and tests key on that. So\n * the part's slot is dropped when `as` is a component, which then writes its\n * own; a `data-slot` the caller passed (`slot`) wins over both. A plain tag\n * (`as=\"a\"`) has no slot of its own and keeps the part's.\n */\nexport function asRender<State>(\n as: ValidComponent | undefined,\n slot?: () => unknown\n): RenderProp<State> | undefined {\n if (as === undefined) return undefined\n return (props) => {\n const own = slot?.()\n if (own !== undefined) return <Dynamic component={as} {...props} data-slot={own as string} />\n if (typeof as === 'string') return <Dynamic component={as} {...props} />\n return <Dynamic component={as} {...omit(props, 'data-slot')} />\n }\n}\n\n/**\n * `asRender` for a popup's trigger, which also carries `data-expanded` while its\n * popup is open, as Kobalte's triggers did. ui-sdk marks it `data-open`; hosts,\n * tests and the toolbar Button key on the Kobalte name, so the trigger keeps it.\n */\nexport function triggerRender<State extends { open: boolean }>(\n as: ValidComponent | undefined,\n tag: string,\n slot?: () => unknown\n): RenderProp<State> {\n return (props, state) => {\n const own = slot?.()\n const component = as ?? tag\n const part =\n own === undefined && typeof component !== 'string' ? omit(props, 'data-slot') : props\n // Set `data-slot` only when the caller named one: an explicit undefined\n // would also erase the slot a component such as Button sets for itself.\n const named = own === undefined ? {} : { 'data-slot': own as string }\n return (\n <Dynamic\n component={component}\n {...part}\n {...named}\n data-expanded={state.open ? '' : undefined}\n />\n )\n }\n}\n\n/**\n * Renders a popup part's `div` with `data-expanded` while it is open.\n *\n * The shared overlay motion in `#lib/overlay` keys its entrance on\n * `data-expanded`, the attribute Kobalte set; ui-sdk sets `data-open` and\n * `data-closed` instead. Mirroring the one attribute keeps every class string\n * (and so every pixel and animation) as it was. Exits still key on\n * `data-closed`, which ui-sdk holds through the exit animation and waits for.\n */\nexport function expandedDiv(props: Record<string, unknown>, state: { open: boolean }) {\n return <div {...props} data-expanded={state.open ? '' : undefined} />\n}\n\n/**\n * `expandedDiv` for the tip itself, which also leaves the accessibility tree\n * the moment it starts to close, as it did over Kobalte. ui-sdk marks the\n * departing tip `inert`, but it stays in the page through its exit animation\n * (and, retained, after it), and `inert` alone does not take it out of every\n * role query or every assistive technology. A caller's own `aria-hidden` holds\n * only while the tip is open.\n */\nfunction tooltipDiv(props: Record<string, unknown>, state: { open: boolean }) {\n return (\n <div\n {...props}\n data-expanded={state.open ? '' : undefined}\n aria-hidden={state.open ? (props['aria-hidden'] as 'true' | 'false' | undefined) : 'true'}\n />\n )\n}\n\n/**\n * The timing defaults for every tooltip below the provider.\n *\n * Timing is the part of a tooltip that has to agree across an app: one that\n * opens in 200ms in a toolbar and 700ms in a sidebar reads as a bug. The\n * provider is where that agreement lives. It is optional — a tooltip outside a\n * provider falls back to the same defaults — so a consumer can drop it in\n * without restructuring anything.\n */\ntype TooltipTiming = {\n openDelay: number\n closeDelay: number\n skipDelayDuration: number\n}\n\nconst tooltipDefaults: TooltipTiming = {\n /** Long enough that a pointer crossing a toolbar does not strobe tooltips. */\n openDelay: 400,\n /** Short, because the pointer has already left the control. */\n closeDelay: 80,\n /**\n * Kept for the provider's API. ui-sdk groups tooltips on its own: once one\n * is open, or was a moment ago, the next opens at once, which is what this\n * window used to configure.\n */\n skipDelayDuration: 500,\n}\n\nconst TooltipTimingContext = createContext<TooltipTiming>(tooltipDefaults)\n\n/**\n * The layer a tooltip sits in, when that layer closes on Escape.\n *\n * ui-sdk gives an open tooltip the first Escape and stops it there, so a tip\n * shown on a focused control inside a dialog would take the key the dialog\n * needed. A tip is never a stop for Escape here: when it closes on the key it\n * passes the key on to this layer, provided focus is still inside that layer\n * and in no menu, listbox or popover stacked between them. The layer's own\n * Escape handler runs first and can still keep it open. Dialog-shaped\n * overlays provide it; nothing else needs to.\n */\nexport const TooltipEscapeTargetContext = createContext<{\n element: Accessor<HTMLElement | undefined>\n dismiss: (event: KeyboardEvent) => void\n} | null>(null)\n\n/** The layers that take Escape before the dialog-shaped one around them. */\nconst ESCAPE_LAYER_SELECTOR = '[role$=dialog],[role=menu],[role=listbox]'\n\ntype TooltipPlacementContextValue = Accessor<OverlayPlacementOptions>\nconst TooltipPlacementContext = createContext<TooltipPlacementContextValue>(() => ({}))\n\n/** Hands the root its trigger and content elements, to tell what state the tip is in. */\nconst TooltipPartsContext = createContext<{\n setTrigger: (element: HTMLElement) => void\n setContent: (element: HTMLElement) => void\n} | null>(null)\n\nexport type TooltipProviderProps = {\n children?: ComponentProps<'div'>['children']\n openDelay?: number\n closeDelay?: number\n skipDelayDuration?: number\n}\n\nexport function TooltipProvider(props: TooltipProviderProps) {\n return (\n <TooltipTimingContext\n value={{\n get openDelay() {\n return props.openDelay ?? tooltipDefaults.openDelay\n },\n get closeDelay() {\n return props.closeDelay ?? tooltipDefaults.closeDelay\n },\n get skipDelayDuration() {\n return props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration\n },\n }}\n >\n {props.children}\n </TooltipTimingContext>\n )\n}\n\nexport type TooltipOpenChangeDetails = {\n reason: TooltipOpenChangeReason\n event?: Event\n cancel: () => void\n}\n\nexport type TooltipRootProps = OverlayPlacementOptions & {\n children?: JSX.Element\n open?: boolean\n defaultOpen?: boolean\n /** The tooltip wants to open or close. The second argument is ui-sdk's change details. */\n onOpenChange?: (open: boolean, details: TooltipOpenChangeDetails) => void\n /** Stops the tooltip from opening; the trigger keeps working. */\n disabled?: boolean\n /** Milliseconds the pointer rests on the trigger before the tip opens. */\n openDelay?: number\n /** Milliseconds before the tip closes once the pointer has left. */\n closeDelay?: number\n /** See `TooltipProvider`: kept for the API, ui-sdk groups tooltips itself. */\n skipDelayDuration?: number\n /** Whether pressing the trigger closes the tip. Defaults to true. */\n closeOnPress?: boolean\n /**\n * Kept for the API Kobalte had; ignored. ui-sdk's tooltip content has no\n * kept-mounted mode: it stays in the page through its exit animation and\n * leaves the accessibility tree as that starts, then unmounts.\n */\n forceMount?: boolean\n}\n\nexport function Tooltip(props: TooltipRootProps) {\n // One document-level focus gate for every tooltip in the document: the first\n // tooltip acquires it, the last to unmount releases it. ui-sdk already keeps\n // a pointer-focused trigger and a returning overlay's focus from opening a\n // tip; the gate still covers the autofocus a dialog gives its first control\n // and the focus composites move by script. See #lib/tooltip-focus-gate.\n if (!isServer) {\n acquireTooltipFocusGate()\n onCleanup(releaseTooltipFocusGate)\n }\n const timing = useContext(TooltipTimingContext)\n const escapeTarget = useContext(TooltipEscapeTargetContext)\n const rest = omit(\n props,\n 'children',\n 'onOpenChange',\n 'forceMount',\n 'openDelay',\n 'closeDelay',\n 'skipDelayDuration',\n 'placement',\n 'gutter',\n 'shift'\n )\n let trigger: HTMLElement | undefined\n let content: HTMLElement | undefined\n let openedByFocus = false\n // A scroll that moves the trigger closes its tip, as Kobalte's tooltip did:\n // the tip would otherwise float away from a control the user scrolled off.\n // ui-sdk keeps a tooltip open through scrolling, so the root closes it\n // through its own controller.\n const controller = createTooltipController()\n const onScroll = (event: Event) => {\n if (!trigger || !content?.hasAttribute('data-open')) return\n const scrolled = event.target\n if (scrolled instanceof Node && !(scrolled instanceof Document) && !scrolled.contains(trigger))\n return\n controller.close()\n }\n onSettled(() => {\n if (isServer) return\n const view = window\n view.addEventListener('scroll', onScroll, { capture: true, passive: true })\n return () => view.removeEventListener('scroll', onScroll, { capture: true })\n })\n\n const onOpenChange = (open: boolean, details: TooltipOpenChangeDetails) => {\n if (open) {\n openedByFocus = details.reason === 'trigger-focus'\n } else if (\n details.reason === 'trigger-hover' &&\n openedByFocus &&\n trigger !== undefined &&\n trigger === trigger.ownerDocument.activeElement\n ) {\n // A tip opened by keyboard focus belongs to the focus, not the pointer:\n // the pointer leaving the control must not take it away from a keyboard\n // user. Blur, a press, Escape, scrolling and another tip still close it.\n details.cancel()\n return\n }\n // Only a tip on screen took the key; a closed one hears Escape too.\n const shown = content?.hasAttribute('data-open') ?? false\n props.onOpenChange?.(open, details)\n if (!open && shown && details.reason === 'escape-key' && escapeTarget)\n passEscapeOn(details.event)\n }\n\n const passEscapeOn = (event: Event | undefined) => {\n const layer = escapeTarget?.element()\n const active = layer?.ownerDocument.activeElement\n if (!layer || active?.closest(ESCAPE_LAYER_SELECTOR) !== layer) return\n // ui-sdk has handled (and prevented) the tooltip's Escape; the layer's own\n // handler gets a fresh event it can prevent to stay open.\n if (event instanceof KeyboardEvent && event.isComposing) return\n escapeTarget?.dismiss(\n new KeyboardEvent('keydown', { key: 'Escape', bubbles: true, cancelable: true })\n )\n }\n\n return (\n <TooltipPlacementContext\n value={() => ({ placement: props.placement, gutter: props.gutter, shift: props.shift })}\n >\n <TooltipPartsContext\n value={{\n setTrigger: (element) => (trigger = element),\n setContent: (element) => (content = element),\n }}\n >\n <UiTooltip\n {...rest}\n // Kobalte always described the trigger with the tip; ui-sdk would\n // name an icon-only trigger with it instead. Every trigger here\n // carries its own name, so the tip stays a description.\n type=\"description\"\n controller={controller}\n delay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n onOpenChange={onOpenChange}\n >\n {props.children}\n </UiTooltip>\n </TooltipPartsContext>\n </TooltipPlacementContext>\n )\n}\n\nexport type TooltipTriggerProps = Omit<PartProps<'button'>, 'ref'> & {\n /** Render the trigger as this component, which must forward props and ref to its element. */\n as?: ValidComponent\n ref?: ((element: HTMLElement) => void) | HTMLElement\n payload?: unknown\n [key: string]: unknown\n}\n\nexport function TooltipTrigger(props: TooltipTriggerProps) {\n const parts = useContext(TooltipPartsContext)\n const rest = omit(props, 'as', 'ref')\n return (\n <UiTooltipTrigger\n {...(rest as PartProps<'button'>)}\n render={asRender(props.as, () => props['data-slot'])}\n ref={(element: HTMLElement) => {\n parts?.setTrigger(element)\n forwardRef(() => props.ref, element)\n }}\n />\n )\n}\n\nexport type TooltipContentProps = Omit<\n PartProps<'div', TooltipContentState>,\n 'class' | 'children'\n> &\n OverlayPlacementOptions & {\n class?: string\n children?: JSX.Element\n /**\n * A leading icon, repeating the trigger's glyph inside the tip — the side\n * rail's icon+label treatment, offered so a toolbar or rail tooltip does\n * not have to hand-roll it. Decorative by contract: the tip is hidden\n * while closed and never the accessible name, so the icon must not be the\n * only carrier of meaning. Size it by leaving the svg bare; the slot fixes\n * it to the system's control size.\n */\n icon?: JSX.Element\n }\n\nexport function TooltipContent(props: TooltipContentProps) {\n const rootPlacement = useContext(TooltipPlacementContext)\n const parts = useContext(TooltipPartsContext)\n const rest = omit(props, 'class', 'children', 'icon', 'placement', 'gutter', 'shift', 'ref')\n const placement = () =>\n placementProps(\n {\n placement: props.placement ?? rootPlacement().placement,\n gutter: props.gutter ?? rootPlacement().gutter,\n shift: props.shift ?? rootPlacement().shift,\n },\n // Kobalte's defaults, which every tip was drawn against: below, flush.\n { placement: 'bottom', gutter: 0 }\n )\n\n const icon = resolveChildren(() => props.icon)\n return (\n <UiTooltipContent\n container={overlayContainer()}\n side={placement().side}\n align={placement().align}\n sideOffset={placement().sideOffset}\n alignOffset={placement().alignOffset}\n class={cn(\n tooltipTip,\n // The max width is a token, not a fixed measure: it has to fall\n // behind the viewport at large root font sizes or the tip — which the\n // placement can shift but never shrink — forces a horizontal scroll.\n 'z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-3 py-1.5',\n 'origin-(--transform-origin) text-balance',\n tooltipMotion,\n // An icon+label tip is one row that reads as a unit, so the label\n // never wraps under the glyph.\n { 'flex items-center gap-2 whitespace-nowrap': !!icon() },\n props.class\n )}\n // A tooltip is never interactive: the content is plain text, and the\n // placement draws the tip below its action — where a hit-testing tip\n // would hold the next control hostage, open or departing. The pointer\n // belongs to the control underneath.\n style={{ 'pointer-events': 'none' }}\n render={tooltipDiv}\n {...rest}\n ref={(element: HTMLDivElement) => {\n parts?.setContent(element)\n forwardRef(() => props.ref, element)\n }}\n >\n <Show when={icon()}>\n {(iconSlot) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\"\n >\n {iconSlot()}\n </span>\n )}\n </Show>\n {props.children}\n </UiTooltipContent>\n )\n}\n\n/** The caret's outline, from the 30-unit box Kobalte's popper drew it in. */\nconst ARROW_PATH =\n 'M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z'\n\n/**\n * Kobalte offset an arrowed popper by half the arrow's box on top of its\n * gutter, so the caret sits in the gap; ui-sdk's `sideOffset` is the whole gap.\n */\nexport const ARROW_OFFSET = 15\n\n/**\n * The caret a popover or hover card points at its trigger with: Kobalte's\n * popper arrow, redrawn inside ui-sdk's arrow part. ui-sdk places the part\n * along the edge (`left` or `top`) and reports `data-side`; these classes put\n * it outside that edge and turn it to face the trigger. The 30px box is\n * Kobalte's default size; only its last third is drawn.\n */\nexport const arrowPlacement =\n 'pointer-events-none size-7.5 ' +\n 'data-[side=bottom]:bottom-full data-[side=top]:top-full data-[side=top]:rotate-180 ' +\n 'data-[side=left]:left-full data-[side=left]:rotate-90 ' +\n 'data-[side=right]:right-full data-[side=right]:-rotate-90'\n\nexport function ArrowGlyph() {\n // Kobalte's arrow drawing: scaled 2% past its box, set 2px into the\n // surface so its base overlaps the border, and outlined with a 2px stroke\n // (half of it inside the fill) that joins the surface's border.\n return (\n <svg\n display=\"block\"\n viewBox=\"0 0 30 30\"\n aria-hidden=\"true\"\n style={{ transform: 'scale(1.02)', 'stroke-width':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,UAAU,CAAC,CAAC;EAAI;EACtB,IAAA,QAAA;GAAO,OAAA,UAAU,CAAC,CAAC;EAAK;EACxB,IAAA,aAAA;GAAY,OAAA,UAAU,CAAC,CAAC;EAAU;EAClC,IAAA,cAAA;GAAa,OAAA,UAAU,CAAC,CAAC;EAAW;EACpC,IAAA,UAAA;GAAO,OAAA,GACL,YAIA,iEACA,4CACA,eAGA,EAAE,6CAA6C,CAAC,CAAC,KAAK,EAAE,GACxD,MAAM,KACR;EAAC;EAKDC,OAAO,EAAE,kBAAkB,OAAO;EAClCC,QAAQ;CAmBQ,GAlBZ,MAzBN;EA0BEC,MAAM,YAA4B;GAChC,OAAO,WAAW,OAAO;GACzB,iBAAiB,MAAM,KAAK,OAAO;EACrC;EA7BF,IAAA,WAAA;GA8BC,OAAA,CACCC,gBAAAA,MAAAA;IAAM,IAAA,OAAA;KAAM,OAAA,KAAK;IAAC;IAAlBA,WACI,oBACA;KAMM,IAAA,QAAA,QAAA;KANN,OAAA,OAKG,QACG;KANN,OAAA;IAMM,EAAA,CAAA;GAEJ,CAAA,GACLC,WAAAA;IAAM,OAAA,MAAA;GAAO,CAAA,CAXf;EAYiB;;AAEtB;;;;;;;;AAmBA,IAAa,iBACX;AAKF,SAAgB,aAAa;CAI3B,OACEC,QAUK;AAET"}
1
+ {"version":3,"file":"tooltip.js","names":["<Dynamic component={as} {...props} data-slot={own as string} />","component={as}","<Dynamic component={as} {...props} />","<Dynamic component={as} {...omit(props, 'data-slot')} />","<Dynamic\n component={component}\n {...part}\n {...named}\n data-expanded={state.open ? '' : undefined}\n />","<div {...props} data-expanded={state.open ? '' : undefined} />","<div\n {...props}\n data-expanded={state.open ? '' : undefined}\n aria-hidden={state.open ? (props['aria-hidden'] as 'true' | 'false' | undefined) : 'true'}\n />","<TooltipTimingContext\n value={{\n get openDelay() {\n return props.openDelay ?? tooltipDefaults.openDelay\n },\n get closeDelay() {\n return props.closeDelay ?? tooltipDefaults.closeDelay\n },\n get skipDelayDuration() {\n return props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration\n },\n }}\n >\n {props.children}\n </TooltipTimingContext>","value={{\n get openDelay() {\n return props.openDelay ?? tooltipDefaults.openDelay\n },\n get closeDelay() {\n return props.closeDelay ?? tooltipDefaults.closeDelay\n },\n get skipDelayDuration() {\n return props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration\n },\n }}","<TooltipPlacementContext\n value={() => ({ placement: props.placement, gutter: props.gutter, shift: props.shift })}\n >\n <TooltipPartsContext\n value={{\n setTrigger: (element) => (trigger = element),\n setContent: (element) => (content = element),\n }}\n >\n <UiTooltip\n {...rest}\n // Kobalte always described the trigger with the tip; ui-sdk would\n // name an icon-only trigger with it instead. Every trigger here\n // carries its own name, so the tip stays a description.\n type=\"description\"\n controller={controller}\n delay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n onOpenChange={onOpenChange}\n >\n {props.children}\n </UiTooltip>\n </TooltipPartsContext>\n </TooltipPlacementContext>","value={() => ({ placement: props.placement, gutter: props.gutter, shift: props.shift })}","<TooltipPartsContext\n value={{\n setTrigger: (element) => (trigger = element),\n setContent: (element) => (content = element),\n }}\n >\n <UiTooltip\n {...rest}\n // Kobalte always described the trigger with the tip; ui-sdk would\n // name an icon-only trigger with it instead. Every trigger here\n // carries its own name, so the tip stays a description.\n type=\"description\"\n controller={controller}\n delay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n onOpenChange={onOpenChange}\n >\n {props.children}\n </UiTooltip>\n </TooltipPartsContext>","value={{\n setTrigger: (element) => (trigger = element),\n setContent: (element) => (content = element),\n }}","<UiTooltip\n {...rest}\n // Kobalte always described the trigger with the tip; ui-sdk would\n // name an icon-only trigger with it instead. Every trigger here\n // carries its own name, so the tip stays a description.\n type=\"description\"\n controller={controller}\n delay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n onOpenChange={onOpenChange}\n >\n {props.children}\n </UiTooltip>","type=\"description\"","<UiTooltipTrigger\n {...(rest as PartProps<'button'>)}\n render={asRender(props.as, () => props['data-slot'])}\n ref={(element: HTMLElement) => {\n parts?.setTrigger(element)\n forwardRef(() => props.ref, element)\n }}\n />","ref={(element: HTMLElement) => {\n parts?.setTrigger(element)\n forwardRef(() => props.ref, element)\n }}","<UiTooltipContent\n container={overlayContainer()}\n side={placement().side}\n align={placement().align}\n sideOffset={placement().sideOffset}\n alignOffset={placement().alignOffset}\n class={cn(\n tooltipTip,\n // The max width is a token, not a fixed measure: it has to fall\n // behind the viewport at large root font sizes or the tip — which the\n // placement can shift but never shrink — forces a horizontal scroll.\n 'z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-3 py-1.5',\n 'origin-(--transform-origin) text-balance',\n tooltipMotion,\n // An icon+label tip is one row that reads as a unit, so the label\n // never wraps under the glyph.\n { 'flex items-center gap-2 whitespace-nowrap': !!icon() },\n props.class\n )}\n // A tooltip is never interactive: the content is plain text, and the\n // placement draws the tip below its action — where a hit-testing tip\n // would hold the next control hostage, open or departing. The pointer\n // belongs to the control underneath.\n style={{ 'pointer-events': 'none' }}\n render={tooltipDiv}\n {...rest}\n ref={(element: HTMLDivElement) => {\n parts?.setContent(element)\n forwardRef(() => props.ref, element)\n }}\n >\n <Show when={icon()}>\n {(iconSlot) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\"\n >\n {iconSlot()}\n </span>\n )}\n </Show>\n {props.children}\n </UiTooltipContent>","style={{ 'pointer-events': 'none' }}","render={tooltipDiv}","ref={(element: HTMLDivElement) => {\n parts?.setContent(element)\n forwardRef(() => props.ref, element)\n }}","<Show when={icon()}>\n {(iconSlot) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\"\n >\n {iconSlot()}\n </span>\n )}\n </Show>","props.children","<svg\n display=\"block\"\n viewBox=\"0 0 30 30\"\n aria-hidden=\"true\"\n style={{ transform: 'scale(1.02)', 'stroke-width': '2' }}\n >\n <g transform=\"translate(0 2)\">\n <path fill=\"none\" d={ARROW_PATH} />\n <path stroke=\"none\" d={ARROW_PATH} />\n </g>\n </svg>","_$spread","resolveChildren","_$insert"],"sources":["../../../../src/components/ui/tooltip/tooltip.tsx"],"sourcesContent":["import {\n Tooltip as UiTooltip,\n TooltipContent as UiTooltipContent,\n TooltipTrigger as UiTooltipTrigger,\n createTooltipController,\n type TooltipContentState,\n type TooltipOpenChangeReason,\n} from '@ui-sdk/solid/tooltip'\nimport type { PartProps, RenderProp } from '@ui-sdk/solid/primitive'\nimport type { Accessor } from 'solid-js'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport {\n children as resolveChildren,\n createContext,\n onCleanup,\n onSettled,\n Show,\n omit,\n useContext,\n} from 'solid-js'\nimport { Dynamic, isServer } from '@solidjs/web'\nimport { SNAP_GUARD, tooltipMotion, tooltipTip } from '#lib/overlay'\nimport { acquireTooltipFocusGate, releaseTooltipFocusGate } from '#lib/tooltip-focus-gate'\nimport { cn } from '#lib/utils'\nimport { forwardRef } from '#lib/refs'\n\n/*\n * The overlay kit's shared plumbing. It lives in this file because every\n * overlay folder may import `../tooltip/tooltip` directly (see .oxlintrc.json),\n * and the tooltip itself needs all of it.\n */\n\n/**\n * Where a floating layer sits, in the placement vocabulary the kit's public\n * API has always spoken (`top`, `bottom-start`, `right-end`, ...). ui-sdk\n * places on the content with `side` and `align`; `placementProps` converts.\n */\nexport type OverlayPlacement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n\nexport type OverlayPlacementOptions = {\n placement?: OverlayPlacement\n /** The gap between the anchor and the layer, in pixels. */\n gutter?: number\n /** The shift along the anchor, in pixels. */\n shift?: number\n}\n\n/** ui-sdk's `side`/`align`/offsets for a placement, with the layer's own defaults. */\nexport function placementProps(\n options: OverlayPlacementOptions,\n defaults: { placement: OverlayPlacement; gutter: number }\n) {\n const [side, align] = (options.placement ?? defaults.placement).split('-') as [\n 'top' | 'bottom' | 'left' | 'right',\n 'start' | 'end' | undefined,\n ]\n return {\n side,\n align: align ?? ('center' as const),\n sideOffset: (options.gutter ?? defaults.gutter) + SNAP_GUARD,\n alignOffset: options.shift,\n }\n}\n\n/**\n * The element popups render into. Every overlay used to portal to `<body>`,\n * so its content inherited nothing from the place it was written (a tip\n * declared inside an uppercase label, a dialog inside a form) and took no part\n * in its parent's `:last-child`, `space-*` or `divide-*` rules. ui-sdk renders\n * in place by default; passing `<body>` keeps the old inheritance while the\n * content still shows in the browser's top layer.\n */\nexport const overlayContainer = (): Element | undefined => (isServer ? undefined : document.body)\n\n/**\n * A part's props plus the kit's `as`: the extra props an `as` component takes\n * (a Button's `variant`) pass through to it.\n */\nexport type WithAs<Props> = Props & {\n /** Render the part as this component, which must forward props and ref to its element. */\n as?: ValidComponent\n class?: string\n [key: string]: unknown\n}\n\n/**\n * The kit's `as` prop on top of ui-sdk's `render` prop: the part's props and\n * behaviour land on the caller's component (`as={Button}`), which must forward\n * them to its element as Kobalte's polymorphic parts required.\n *\n * ui-sdk writes the part's own `data-slot` (`popover-trigger`) over the\n * caller's. Kobalte set none, so a wrapped component kept its own: a Button\n * trigger stayed `data-slot=\"button\"`, and styles and tests key on that. So\n * the part's slot is dropped when `as` is a component, which then writes its\n * own; a `data-slot` the caller passed (`slot`) wins over both. A plain tag\n * (`as=\"a\"`) has no slot of its own and keeps the part's.\n */\nexport function asRender<State>(\n as: ValidComponent | undefined,\n slot?: () => unknown\n): RenderProp<State> | undefined {\n if (as === undefined) return undefined\n return (props) => {\n const own = slot?.()\n if (own !== undefined) return <Dynamic component={as} {...props} data-slot={own as string} />\n if (typeof as === 'string') return <Dynamic component={as} {...props} />\n return <Dynamic component={as} {...omit(props, 'data-slot')} />\n }\n}\n\n/**\n * `asRender` for a popup's trigger, which also carries `data-expanded` while its\n * popup is open, as Kobalte's triggers did. ui-sdk marks it `data-open`; hosts,\n * tests and the toolbar Button key on the Kobalte name, so the trigger keeps it.\n */\nexport function triggerRender<State extends { open: boolean }>(\n as: ValidComponent | undefined,\n tag: string,\n slot?: () => unknown\n): RenderProp<State> {\n return (props, state) => {\n const own = slot?.()\n const component = as ?? tag\n const part =\n own === undefined && typeof component !== 'string' ? omit(props, 'data-slot') : props\n // Set `data-slot` only when the caller named one: an explicit undefined\n // would also erase the slot a component such as Button sets for itself.\n const named = own === undefined ? {} : { 'data-slot': own as string }\n return (\n <Dynamic\n component={component}\n {...part}\n {...named}\n data-expanded={state.open ? '' : undefined}\n />\n )\n }\n}\n\n/**\n * Renders a popup part's `div` with `data-expanded` while it is open.\n *\n * The shared overlay motion in `#lib/overlay` keys its entrance on\n * `data-expanded`, the attribute Kobalte set; ui-sdk sets `data-open` and\n * `data-closed` instead. Mirroring the one attribute keeps every class string\n * (and so every pixel and animation) as it was. Exits still key on\n * `data-closed`, which ui-sdk holds through the exit animation and waits for.\n */\nexport function expandedDiv(props: Record<string, unknown>, state: { open: boolean }) {\n return <div {...props} data-expanded={state.open ? '' : undefined} />\n}\n\n/**\n * `expandedDiv` for the tip itself, which also leaves the accessibility tree\n * the moment it starts to close, as it did over Kobalte. ui-sdk marks the\n * departing tip `inert`, but it stays in the page through its exit animation\n * (and, retained, after it), and `inert` alone does not take it out of every\n * role query or every assistive technology. A caller's own `aria-hidden` holds\n * only while the tip is open.\n */\nfunction tooltipDiv(props: Record<string, unknown>, state: { open: boolean }) {\n return (\n <div\n {...props}\n data-expanded={state.open ? '' : undefined}\n aria-hidden={state.open ? (props['aria-hidden'] as 'true' | 'false' | undefined) : 'true'}\n />\n )\n}\n\n/**\n * The timing defaults for every tooltip below the provider.\n *\n * Timing is the part of a tooltip that has to agree across an app: one that\n * opens in 200ms in a toolbar and 700ms in a sidebar reads as a bug. The\n * provider is where that agreement lives. It is optional — a tooltip outside a\n * provider falls back to the same defaults — so a consumer can drop it in\n * without restructuring anything.\n */\ntype TooltipTiming = {\n openDelay: number\n closeDelay: number\n skipDelayDuration: number\n}\n\nconst tooltipDefaults: TooltipTiming = {\n /** Long enough that a pointer crossing a toolbar does not strobe tooltips. */\n openDelay: 400,\n /** Short, because the pointer has already left the control. */\n closeDelay: 80,\n /**\n * Kept for the provider's API. ui-sdk groups tooltips on its own: once one\n * is open, or was a moment ago, the next opens at once, which is what this\n * window used to configure.\n */\n skipDelayDuration: 500,\n}\n\nconst TooltipTimingContext = createContext<TooltipTiming>(tooltipDefaults)\n\n/**\n * The layer a tooltip sits in, when that layer closes on Escape.\n *\n * ui-sdk gives an open tooltip the first Escape and stops it there, so a tip\n * shown on a focused control inside a dialog would take the key the dialog\n * needed. A tip is never a stop for Escape here: when it closes on the key it\n * passes the key on to this layer, provided focus is still inside that layer\n * and in no menu, listbox or popover stacked between them. The layer's own\n * Escape handler runs first and can still keep it open. Dialog-shaped\n * overlays provide it; nothing else needs to.\n */\nexport const TooltipEscapeTargetContext = createContext<{\n element: Accessor<HTMLElement | undefined>\n dismiss: (event: KeyboardEvent) => void\n} | null>(null)\n\n/** The layers that take Escape before the dialog-shaped one around them. */\nconst ESCAPE_LAYER_SELECTOR = '[role$=dialog],[role=menu],[role=listbox]'\n\ntype TooltipPlacementContextValue = Accessor<OverlayPlacementOptions>\nconst TooltipPlacementContext = createContext<TooltipPlacementContextValue>(() => ({}))\n\n/** Hands the root its trigger and content elements, to tell what state the tip is in. */\nconst TooltipPartsContext = createContext<{\n setTrigger: (element: HTMLElement) => void\n setContent: (element: HTMLElement) => void\n} | null>(null)\n\nexport type TooltipProviderProps = {\n children?: ComponentProps<'div'>['children']\n openDelay?: number\n closeDelay?: number\n skipDelayDuration?: number\n}\n\nexport function TooltipProvider(props: TooltipProviderProps) {\n return (\n <TooltipTimingContext\n value={{\n get openDelay() {\n return props.openDelay ?? tooltipDefaults.openDelay\n },\n get closeDelay() {\n return props.closeDelay ?? tooltipDefaults.closeDelay\n },\n get skipDelayDuration() {\n return props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration\n },\n }}\n >\n {props.children}\n </TooltipTimingContext>\n )\n}\n\nexport type TooltipOpenChangeDetails = {\n reason: TooltipOpenChangeReason\n event?: Event\n cancel: () => void\n}\n\nexport type TooltipRootProps = OverlayPlacementOptions & {\n children?: JSX.Element\n open?: boolean\n defaultOpen?: boolean\n /** The tooltip wants to open or close. The second argument is ui-sdk's change details. */\n onOpenChange?: (open: boolean, details: TooltipOpenChangeDetails) => void\n /** Stops the tooltip from opening; the trigger keeps working. */\n disabled?: boolean\n /** Milliseconds the pointer rests on the trigger before the tip opens. */\n openDelay?: number\n /** Milliseconds before the tip closes once the pointer has left. */\n closeDelay?: number\n /** See `TooltipProvider`: kept for the API, ui-sdk groups tooltips itself. */\n skipDelayDuration?: number\n /** Whether pressing the trigger closes the tip. Defaults to true. */\n closeOnPress?: boolean\n /**\n * Kept for the API Kobalte had; ignored. ui-sdk's tooltip content has no\n * kept-mounted mode: it stays in the page through its exit animation and\n * leaves the accessibility tree as that starts, then unmounts.\n */\n forceMount?: boolean\n}\n\nexport function Tooltip(props: TooltipRootProps) {\n // One document-level focus gate for every tooltip in the document: the first\n // tooltip acquires it, the last to unmount releases it. ui-sdk already keeps\n // a pointer-focused trigger and a returning overlay's focus from opening a\n // tip; the gate still covers the autofocus a dialog gives its first control\n // and the focus composites move by script. See #lib/tooltip-focus-gate.\n if (!isServer) {\n acquireTooltipFocusGate()\n onCleanup(releaseTooltipFocusGate)\n }\n const timing = useContext(TooltipTimingContext)\n const escapeTarget = useContext(TooltipEscapeTargetContext)\n const rest = omit(\n props,\n 'children',\n 'onOpenChange',\n 'forceMount',\n 'openDelay',\n 'closeDelay',\n 'skipDelayDuration',\n 'placement',\n 'gutter',\n 'shift'\n )\n let trigger: HTMLElement | undefined\n let content: HTMLElement | undefined\n let openedByFocus = false\n // A scroll that moves the trigger closes its tip, as Kobalte's tooltip did:\n // the tip would otherwise float away from a control the user scrolled off.\n // ui-sdk keeps a tooltip open through scrolling, so the root closes it\n // through its own controller.\n const controller = createTooltipController()\n const onScroll = (event: Event) => {\n if (!trigger || !content?.hasAttribute('data-open')) return\n const scrolled = event.target\n if (scrolled instanceof Node && !(scrolled instanceof Document) && !scrolled.contains(trigger))\n return\n controller.close()\n }\n onSettled(() => {\n if (isServer) return\n const view = window\n view.addEventListener('scroll', onScroll, { capture: true, passive: true })\n return () => view.removeEventListener('scroll', onScroll, { capture: true })\n })\n\n const onOpenChange = (open: boolean, details: TooltipOpenChangeDetails) => {\n if (open) {\n openedByFocus = details.reason === 'trigger-focus'\n } else if (\n details.reason === 'trigger-hover' &&\n openedByFocus &&\n trigger !== undefined &&\n trigger === trigger.ownerDocument.activeElement\n ) {\n // A tip opened by keyboard focus belongs to the focus, not the pointer:\n // the pointer leaving the control must not take it away from a keyboard\n // user. Blur, a press, Escape, scrolling and another tip still close it.\n details.cancel()\n return\n }\n // Only a tip on screen took the key; a closed one hears Escape too.\n const shown = content?.hasAttribute('data-open') ?? false\n props.onOpenChange?.(open, details)\n if (!open && shown && details.reason === 'escape-key' && escapeTarget)\n passEscapeOn(details.event)\n }\n\n const passEscapeOn = (event: Event | undefined) => {\n const layer = escapeTarget?.element()\n const active = layer?.ownerDocument.activeElement\n if (!layer || active?.closest(ESCAPE_LAYER_SELECTOR) !== layer) return\n // ui-sdk has handled (and prevented) the tooltip's Escape; the layer's own\n // handler gets a fresh event it can prevent to stay open.\n if (event instanceof KeyboardEvent && event.isComposing) return\n escapeTarget?.dismiss(\n new KeyboardEvent('keydown', { key: 'Escape', bubbles: true, cancelable: true })\n )\n }\n\n return (\n <TooltipPlacementContext\n value={() => ({ placement: props.placement, gutter: props.gutter, shift: props.shift })}\n >\n <TooltipPartsContext\n value={{\n setTrigger: (element) => (trigger = element),\n setContent: (element) => (content = element),\n }}\n >\n <UiTooltip\n {...rest}\n // Kobalte always described the trigger with the tip; ui-sdk would\n // name an icon-only trigger with it instead. Every trigger here\n // carries its own name, so the tip stays a description.\n type=\"description\"\n controller={controller}\n delay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n onOpenChange={onOpenChange}\n >\n {props.children}\n </UiTooltip>\n </TooltipPartsContext>\n </TooltipPlacementContext>\n )\n}\n\nexport type TooltipTriggerProps = Omit<PartProps<'button'>, 'ref'> & {\n /** Render the trigger as this component, which must forward props and ref to its element. */\n as?: ValidComponent\n ref?: ((element: HTMLElement) => void) | HTMLElement\n payload?: unknown\n [key: string]: unknown\n}\n\nexport function TooltipTrigger(props: TooltipTriggerProps) {\n const parts = useContext(TooltipPartsContext)\n const rest = omit(props, 'as', 'ref')\n return (\n <UiTooltipTrigger\n {...(rest as PartProps<'button'>)}\n render={asRender(props.as, () => props['data-slot'])}\n ref={(element: HTMLElement) => {\n parts?.setTrigger(element)\n forwardRef(() => props.ref, element)\n }}\n />\n )\n}\n\nexport type TooltipContentProps = Omit<\n PartProps<'div', TooltipContentState>,\n 'class' | 'children'\n> &\n OverlayPlacementOptions & {\n class?: string\n children?: JSX.Element\n /**\n * A leading icon, repeating the trigger's glyph inside the tip — the side\n * rail's icon+label treatment, offered so a toolbar or rail tooltip does\n * not have to hand-roll it. Decorative by contract: the tip is hidden\n * while closed and never the accessible name, so the icon must not be the\n * only carrier of meaning. Size it by leaving the svg bare; the slot fixes\n * it to the system's control size.\n */\n icon?: JSX.Element\n }\n\nexport function TooltipContent(props: TooltipContentProps) {\n const rootPlacement = useContext(TooltipPlacementContext)\n const parts = useContext(TooltipPartsContext)\n const rest = omit(props, 'class', 'children', 'icon', 'placement', 'gutter', 'shift', 'ref')\n const placement = () =>\n placementProps(\n {\n placement: props.placement ?? rootPlacement().placement,\n gutter: props.gutter ?? rootPlacement().gutter,\n shift: props.shift ?? rootPlacement().shift,\n },\n // Kobalte's defaults, which every tip was drawn against: below, flush.\n { placement: 'bottom', gutter: 0 }\n )\n\n const icon = resolveChildren(() => props.icon)\n return (\n <UiTooltipContent\n container={overlayContainer()}\n side={placement().side}\n align={placement().align}\n sideOffset={placement().sideOffset}\n alignOffset={placement().alignOffset}\n class={cn(\n tooltipTip,\n // The max width is a token, not a fixed measure: it has to fall\n // behind the viewport at large root font sizes or the tip — which the\n // placement can shift but never shrink — forces a horizontal scroll.\n 'z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-3 py-1.5',\n 'origin-(--transform-origin) text-balance',\n tooltipMotion,\n // An icon+label tip is one row that reads as a unit, so the label\n // never wraps under the glyph.\n { 'flex items-center gap-2 whitespace-nowrap': !!icon() },\n props.class\n )}\n // A tooltip is never interactive: the content is plain text, and the\n // placement draws the tip below its action — where a hit-testing tip\n // would hold the next control hostage, open or departing. The pointer\n // belongs to the control underneath.\n style={{ 'pointer-events': 'none' }}\n render={tooltipDiv}\n {...rest}\n ref={(element: HTMLDivElement) => {\n parts?.setContent(element)\n forwardRef(() => props.ref, element)\n }}\n >\n <Show when={icon()}>\n {(iconSlot) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\"\n >\n {iconSlot()}\n </span>\n )}\n </Show>\n {props.children}\n </UiTooltipContent>\n )\n}\n\n/** The caret's outline, from the 30-unit box Kobalte's popper drew it in. */\nconst ARROW_PATH =\n 'M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z'\n\n/**\n * Kobalte offset an arrowed popper by half the arrow's box on top of its\n * gutter, so the caret sits in the gap; ui-sdk's `sideOffset` is the whole gap.\n */\nexport const ARROW_OFFSET = 15\n\n/**\n * The caret a popover or hover card points at its trigger with: Kobalte's\n * popper arrow, redrawn inside ui-sdk's arrow part. ui-sdk places the part\n * along the edge (`left` or `top`) and reports `data-side`; these classes put\n * it outside that edge and turn it to face the trigger. The 30px box is\n * Kobalte's default size; only its last third is drawn.\n */\nexport const arrowPlacement =\n 'pointer-events-none size-7.5 ' +\n 'data-[side=bottom]:bottom-full data-[side=top]:top-full data-[side=top]:rotate-180 ' +\n 'data-[side=left]:left-full data-[side=left]:rotate-90 ' +\n 'data-[side=right]:right-full data-[side=right]:-rotate-90'\n\nexport function ArrowGlyph() {\n // Kobalte's arrow drawing: scaled 2% past its box, set 2px into the\n // surface so its base overlaps the border, and outlined with a 2px stroke\n // (half of it inside the fill) that joins the surface's border.\n return (\n <svg\n display=\"block\"\n viewBox=\"0 0 30 30\"\n aria-hidden=\"true\"\n style={{ transform: 'scale(1.02)', 'stroke-width': '2' }}\n >\n <g transform=\"translate(0 2)\">\n <path fill=\"none\" d={ARROW_PATH} />\n <path stroke=\"none\" d={ARROW_PATH} />\n </g>\n </svg>\n )\n}\n"],"mappings":";;;;;;;;;;;;AA4DA,SAAgB,eACd,SACA,UACA;CACA,MAAM,CAAC,MAAM,UAAU,QAAQ,aAAa,SAAS,UAAA,CAAW,MAAM,GAAG;CAIzE,OAAO;EACL;EACA,OAAO,SAAU;EACjB,aAAa,QAAQ,UAAU,SAAS,UAAU;EAClD,aAAa,QAAQ;CACvB;AACF;;;;;;;;;AAUA,IAAa,yBAA+C,WAAW,KAAA,IAAY,SAAS;;;;;;;;;;;;;AAyB5F,SAAgB,SACd,IACA,MAC+B;CAC/B,IAAI,OAAO,KAAA,GAAW,OAAO,KAAA;CAC7B,QAAQ,UAAU;EAChB,MAAM,MAAM,OAAO;EACnB,IAAI,QAAQ,KAAA,GAAW,OAAOA,gBAAAA,SAAAA,WAAAA,EAASC,WAAW,GAA0C,GAAlC,OAA5B,EAAmC,aAAW,IAAgB,CAAA,CAAA;EAC5F,IAAI,OAAO,OAAO,UAAU,OAAOC,gBAAAA,SAAAA,WAAAA,EAASD,WAAW,GAAgB,GAAR,KAAQ,CAAA;EACvE,OAAOE,gBAAAA,SAAAA,WAAAA,EAASF,WAAW,GA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@@ -1,9 +1,9 @@
1
+ import { claimElement, className, createComponent, delegateEvents, effect, getOwner, insert, memo, readShallow, setAttribute, spread, template } from "@solidjs/web";
2
+ import { Check as Check$1, ChevronRight as ChevronRight$1, CircleAlert as CircleAlert$1, CircleDashed as CircleDashed$1, CircleSlash as CircleSlash$1, Dot as Dot$1, ExternalLink as ExternalLink$1, LoaderCircle as LoaderCircle$1 } from "@lucide/solid";
3
+ import { Show, createMemo, createSignal, createUniqueId, omit } from "solid-js";
1
4
  import { cn } from "../../../lib/utils.js";
2
5
  import { CodeBlock } from "../code-block/code-block.js";
3
6
  import { fastIcon } from "../../../lib/fast-icon.js";
4
- import { claimElement, className, createComponent, delegateEvents, effect, getOwner, insert, memo, readShallow, setAttribute, spread, template } from "@solidjs/web";
5
- import { Check, ChevronRight, CircleAlert, CircleDashed, CircleSlash, Dot, ExternalLink, LoaderCircle } from "@lucide/solid";
6
- import { Show, createMemo, createSignal, createUniqueId, omit } from "solid-js";
7
7
  // src/components/ui/trace/trace.tsx
8
8
  var _tmpl$ = /* @__PURE__ */ template(`<ul>`);
9
9
  var _tmpl$2 = /* @__PURE__ */ template(`<span aria-hidden=true>`);
@@ -19,14 +19,14 @@ var _tmpl$11 = /* @__PURE__ */ template(`<div class="flex min-h-control-xs w-ful
19
19
  var _tmpl$12 = /* @__PURE__ */ template(`<div data-slot=trace-content data-expanded class="overflow-hidden animate-in fade-in-0"><div class="ms-[0.6875rem] mt-0.5 mb-1 flex min-w-0 flex-col gap-1 border-s border-border ps-3">`);
20
20
  var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
21
21
  var _tmpl$14 = /* @__PURE__ */ template(`<div class="flex min-w-0 flex-col gap-1"><!><!>`);
22
- var Check$1 = fastIcon(Check);
23
- var ChevronRight$1 = fastIcon(ChevronRight);
24
- var CircleAlert$1 = fastIcon(CircleAlert);
25
- var CircleDashed$1 = fastIcon(CircleDashed);
26
- var CircleSlash$1 = fastIcon(CircleSlash);
27
- var Dot$1 = fastIcon(Dot);
28
- var ExternalLink$1 = fastIcon(ExternalLink);
29
- var LoaderCircle$1 = fastIcon(LoaderCircle);
22
+ var Check = fastIcon(Check$1);
23
+ var ChevronRight = fastIcon(ChevronRight$1);
24
+ var CircleAlert = fastIcon(CircleAlert$1);
25
+ var CircleDashed = fastIcon(CircleDashed$1);
26
+ var CircleSlash = fastIcon(CircleSlash$1);
27
+ var Dot = fastIcon(Dot$1);
28
+ var ExternalLink = fastIcon(ExternalLink$1);
29
+ var LoaderCircle = fastIcon(LoaderCircle$1);
30
30
  /** The words spoken for each status. Override per line for another language. */
31
31
  var TRACE_STATUS_LABELS = {
32
32
  pending: "Pending",
@@ -93,7 +93,7 @@ function TraceMark(props) {
93
93
  return props.status === "running";
94
94
  });
95
95
  return () => {
96
- return _c$() ? createComponent(LoaderCircle$1, { class: "motion-safe:animate-spin" }) : createComponent(Show, {
96
+ return _c$() ? createComponent(LoaderCircle, { class: "motion-safe:animate-spin" }) : createComponent(Show, {
97
97
  get when() {
98
98
  return props.status === "error";
99
99
  },
@@ -108,20 +108,20 @@ function TraceMark(props) {
108
108
  return props.status === "pending";
109
109
  },
110
110
  get fallback() {
111
- return props.icon ?? (props.completed ? createComponent(Check$1, {}) : createComponent(Dot$1, {}));
111
+ return props.icon ?? (props.completed ? createComponent(Check, {}) : createComponent(Dot, {}));
112
112
  },
113
113
  get children() {
114
- return createComponent(CircleDashed$1, {});
114
+ return createComponent(CircleDashed, {});
115
115
  }
116
116
  });
117
117
  },
118
118
  get children() {
119
- return createComponent(CircleSlash$1, {});
119
+ return createComponent(CircleSlash, {});
120
120
  }
121
121
  });
122
122
  },
123
123
  get children() {
124
- return createComponent(CircleAlert$1, {});
124
+ return createComponent(CircleAlert, {});
125
125
  }
126
126
  });
127
127
  };
@@ -279,7 +279,7 @@ function TraceLine(props) {
279
279
  var _el$12 = _el$11.firstChild;
280
280
  _el$12._$$click = () => setOpen(!isOpen());
281
281
  insert(_el$12, () => {
282
- return head(createComponent(ChevronRight$1, {
282
+ return head(createComponent(ChevronRight, {
283
283
  "aria-hidden": "true",
284
284
  class: "size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90"
285
285
  }));
@@ -321,7 +321,7 @@ function TraceLine(props) {
321
321
  var _el$10 = _tmpl$9();
322
322
  _el$10._$$click = () => local.onSelect?.();
323
323
  insert(_el$10, () => {
324
- return head(createComponent(ChevronRight$1, {
324
+ return head(createComponent(ChevronRight, {
325
325
  "aria-hidden": "true",
326
326
  class: "size-3.5 shrink-0 text-muted-foreground"
327
327
  }));
@@ -341,7 +341,7 @@ function TraceLine(props) {
341
341
  var _el$9 = _tmpl$8();
342
342
  var _o$ = getOwner();
343
343
  insert(_el$9, () => {
344
- return head(createComponent(ExternalLink$1, {
344
+ return head(createComponent(ExternalLink, {
345
345
  "aria-hidden": "true",
346
346
  class: "size-3 shrink-0 text-muted-foreground"
347
347
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"trace.js","names":["role=\"list\"","<ul\n role=\"list\"\n data-slot=\"trace\"\n data-size={local.size ?? 'default'}\n class={cn('m-0 flex min-w-0 list-none flex-col gap-px p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>","<LoaderCircle class=\"motion-safe:animate-spin\" />","class=\"motion-safe:animate-spin\"","<Show\n when={props.status === 'error'}\n fallback={\n <Show\n when={props.status === 'cancelled'}\n fallback={\n <Show\n when={props.status === 'pending'}\n fallback={props.icon ?? (props.completed ? <Check /> : <Dot />)}\n >\n <CircleDashed />\n </Show>\n }\n >\n <CircleSlash />\n </Show>\n }\n >\n <CircleAlert />\n </Show>","<Show\n when={props.status === 'cancelled'}\n fallback={\n <Show\n when={props.status === 'pending'}\n fallback={props.icon ?? (props.completed ? <Check /> : <Dot />)}\n >\n <CircleDashed />\n </Show>\n }\n >\n <CircleSlash />\n </Show>","<Show\n when={props.status === 'pending'}\n fallback={props.icon ?? (props.completed ? <Check /> : <Dot />)}\n >\n <CircleDashed />\n </Show>","<Check />","<Dot />","<CircleDashed />","<CircleSlash />","<CircleAlert />","class={cn('grid size-4 shrink-0 place-items-center [&_svg]:size-3.5', props.class, {\n 'text-muted-foreground': props.status !== 'error' && props.status !== 'running',\n 'text-destructive': props.status === 'error',\n 'text-info': props.status === 'running',\n })}","<span\n data-slot={props.slot ?? 'trace-mark'}\n aria-hidden=\"true\"\n class={cn('grid size-4 shrink-0 place-items-center [&_svg]:size-3.5', props.class, {\n 'text-muted-foreground': props.status !== 'error' && props.status !== 'running',\n 'text-destructive': props.status === 'error',\n 'text-info': props.status === 'running',\n })}\n >\n <Show\n when={props.status === 'running'}\n fallback={\n <Show\n when={props.status === 'error'}\n fallback={\n <Show\n when={props.status === 'cancelled'}\n fallback={\n <Show\n when={props.status === 'pending'}\n fallback={props.icon ?? (props.completed ? <Check /> : <Dot />)}\n >\n <CircleDashed />\n </Show>\n }\n >\n <CircleSlash />\n </Show>\n }\n >\n <CircleAlert />\n </Show>\n }\n >\n <LoaderCircle class=\"motion-safe:animate-spin\" />\n </Show>\n </span>","<TraceMark\n status={statusOwnsMark(props.status) ? props.status : undefined}\n icon={props.icon}\n completed={props.status === 'success'}\n />","statusOwnsMark(props.status) ? props.status : undefined","<Show when={props.description}>\n {(descriptionSlot) => (\n <span\n data-slot=\"trace-description\"\n class=\"min-w-0 truncate text-xs text-muted-foreground\"\n >\n {descriptionSlot()}\n </span>\n )}\n </Show>","<Show when={props.status}>\n {(status) => (\n <span class=\"sr-only\">{props.statusLabel ?? TRACE_STATUS_LABELS[status()]}</span>\n )}\n </Show>","<Show when={props.meta}>\n {(metaSlot) => (\n <span data-slot=\"trace-meta\" class=\"shrink-0 text-xs text-muted-foreground tabular-nums\">\n {metaSlot()}\n </span>\n )}\n </Show>","{props.trailing}","<LineHead\n title={local.title}\n description={local.description}\n icon={local.icon}\n status={local.status}\n statusLabel={local.statusLabel}\n meta={local.meta}\n trailing={trailing}\n />","<Show\n when={local.onSelect === undefined}\n fallback={\n <button\n type=\"button\"\n aria-haspopup={local.selectHaspopup ?? 'dialog'}\n class={cn(lineClass, interactiveClass)}\n onClick={() => local.onSelect?.()}\n >\n {head(\n <ChevronRight aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />\n )}\n </button>\n }\n >\n <Show when={content()} fallback={<div class={lineClass}>{head()}</div>}>\n <div class=\"group/trace\" data-expanded={isOpen() ? '' : undefined}>\n <button\n type=\"button\"\n aria-expanded={isOpen() ? 'true' : 'false'}\n aria-controls={isOpen() ? contentId : undefined}\n class={cn(lineClass, interactiveClass)}\n onClick={() => setOpen(!isOpen())}\n >\n {head(\n <ChevronRight\n aria-hidden=\"true\"\n class=\"size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90\"\n />\n )}\n </button>\n <Show when={isOpen()}>\n <div\n id={contentId}\n data-slot=\"trace-content\"\n data-expanded=\"\"\n class=\"overflow-hidden animate-in fade-in-0\"\n >\n {/* The rail is drawn from the mark's centre, so a nested line reads as\n belonging to the one above it without an indent that eats the width. */}\n <div class=\"ms-[0.6875rem] mt-0.5 mb-1 flex min-w-0 flex-col gap-1 border-s border-border ps-3\">\n {content()}\n </div>\n </div>\n </Show>\n </div>\n </Show>\n </Show>","<Show when={content()} fallback={<div class={lineClass}>{head()}</div>}>\n <div class=\"group/trace\" data-expanded={isOpen() ? '' : undefined}>\n <button\n type=\"button\"\n aria-expanded={isOpen() ? 'true' : 'false'}\n aria-controls={isOpen() ? contentId : undefined}\n class={cn(lineClass, interactiveClass)}\n onClick={() => setOpen(!isOpen())}\n >\n {head(\n <ChevronRight\n aria-hidden=\"true\"\n class=\"size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90\"\n />\n )}\n </button>\n <Show when={isOpen()}>\n <div\n id={contentId}\n data-slot=\"trace-content\"\n data-expanded=\"\"\n class=\"overflow-hidden animate-in fade-in-0\"\n >\n {/* The rail is drawn from the mark's centre, so a nested line reads as\n belonging to the one above it without an indent that eats the width. */}\n <div class=\"ms-[0.6875rem] mt-0.5 mb-1 flex min-w-0 flex-col gap-1 border-s border-border ps-3\">\n {content()}\n </div>\n </div>\n </Show>\n </div>\n </Show>","<ChevronRight\n aria-hidden=\"true\"\n class=\"size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90\"\n />","class=\"size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90\"","aria-expanded={isOpen() ? 'true' : 'false'}","aria-controls={isOpen() ? contentId : undefined}","class={cn(lineClass, interactiveClass)}","<ChevronRight aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />","class=\"size-3.5 shrink-0 text-muted-foreground\"","<ExternalLink aria-hidden=\"true\" class=\"size-3 shrink-0 text-muted-foreground\" />","class=\"size-3 shrink-0 text-muted-foreground\"","<li\n data-slot=\"trace-line\"\n data-status={local.status}\n aria-busy={local.status === 'running' ? 'true' : undefined}\n class={cn('min-w-0', local.class)}\n {...rest}\n >\n <Show\n when={local.href === undefined}\n fallback={\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class={cn(lineClass, interactiveClass)}\n >\n {head(\n <ExternalLink aria-hidden=\"true\" class=\"size-3 shrink-0 text-muted-foreground\" />\n )}\n </a>\n }\n >\n <Show\n when={local.onSelect === undefined}\n fallback={\n <button\n type=\"button\"\n aria-haspopup={local.selectHaspopup ?? 'dialog'}\n class={cn(lineClass, interactiveClass)}\n onClick={() => local.onSelect?.()}\n >\n {head(\n <ChevronRight aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />\n )}\n </button>\n }\n >\n <Show when={content()} fallback={<div class={lineClass}>{head()}</div>}>\n <div class=\"group/trace\" data-expanded={isOpen() ? '' : undefined}>\n <button\n type=\"button\"\n aria-expanded={isOpen() ? 'true' : 'false'}\n aria-controls={isOpen() ? contentId : undefined}\n class={cn(lineClass, interactiveClass)}\n onClick={() => setOpen(!isOpen())}\n >\n {head(\n <ChevronRight\n aria-hidden=\"true\"\n class=\"size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90\"\n />\n )}\n </button>\n <Show when={isOpen()}>\n <div\n id={contentId}\n data-slot=\"trace-content\"\n data-expanded=\"\"\n class=\"overflow-hidden animate-in fade-in-0\"\n >\n {/* The rail is drawn from the mark's centre, so a nested line reads as\n belonging to the one above it without an indent that eats the width. */}\n <div class=\"ms-[0.6875rem] mt-0.5 mb-1 flex min-w-0 flex-col gap-1 border-s border-border ps-3\">\n {content()}\n </div>\n </div>\n </Show>\n </div>\n </Show>\n </Show>\n </Show>\n </li>","<div\n data-slot=\"trace-detail\"\n class={cn('min-w-0 text-xs leading-5 text-muted-foreground', local.class)}\n {...rest}\n >\n {local.children}\n </div>","<CodeBlock\n size=\"sm\"\n title=\"Error\"\n language=\"error\"\n code={props.text}\n lineMarks={marks()}\n complete\n maxHeight={ERROR_MAX_HEIGHT}\n wrap\n />","size=\"sm\"","title=\"Error\"","language=\"error\"","maxHeight={ERROR_MAX_HEIGHT}","<div class=\"flex min-w-0 flex-col gap-1\">\n <CodeBlock\n size=\"sm\"\n title=\"Error\"\n language=\"error\"\n code={props.text}\n lineMarks={marks()}\n complete\n maxHeight={ERROR_MAX_HEIGHT}\n wrap\n />\n {props.children}\n </div>","Check","LucideCheck","ChevronRight","LucideChevronRight","CircleAlert","LucideCircleAlert","CircleDashed","LucideCircleDashed","CircleSlash","LucideCircleSlash","Dot","LucideDot","ExternalLink","LucideExternalLink","LoaderCircle","LucideLoaderCircle","_$readShallow","_$setAttribute"],"sources":["../../../../src/components/ui/trace/trace.tsx"],"sourcesContent":["import {\n Check as LucideCheck,\n ChevronRight as LucideChevronRight,\n CircleAlert as LucideCircleAlert,\n CircleDashed as LucideCircleDashed,\n CircleSlash as LucideCircleSlash,\n Dot as LucideDot,\n ExternalLink as LucideExternalLink,\n LoaderCircle as LucideLoaderCircle,\n} from '@lucide/solid'\nimport { createMemo, createSignal, createUniqueId, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cn } from '#lib/utils'\nimport { CodeBlock, type CodeLineMark } from '../code-block'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst ChevronRight = fastIcon(LucideChevronRight)\nconst CircleAlert = fastIcon(LucideCircleAlert)\nconst CircleDashed = fastIcon(LucideCircleDashed)\nconst CircleSlash = fastIcon(LucideCircleSlash)\nconst Dot = fastIcon(LucideDot)\nconst ExternalLink = fastIcon(LucideExternalLink)\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\n\n/**\n * Trace.\n *\n * A list of lines, one per thing an agent did. Reasoning, a tool call, a source\n * it read, a plan step and a whole subagent run all share one shape — *something\n * the agent did, and what happened* — so they share one row: a leading mark, a\n * title, an optional description, a status and, when there is more to say, a\n * disclosure. A transcript built from this reads as one quiet column of activity\n * under the answer instead of a stack of competing cards.\n *\n * ## One row, three behaviours\n *\n * - **Children** make the line expandable. The trigger is a real button with\n * `aria-expanded`, so keyboard and screen-reader users get the disclosure for\n * free. Children can themselves be a `Trace`, which is how a summary expands\n * into steps and a step into its output. A `TraceLineBody` function is a lazy\n * body: it makes the line expandable without running, and runs once, when the\n * content first mounts, so a folded line builds none of its detail.\n * - **`href`** makes the line a link — a source, a file, a run page.\n * - **`onSelect`** makes the line a button that opens something *else* (a dialog,\n * sheet, drawer or popover owned by the caller). The line says so with\n * `aria-haspopup`; the surface itself is not this component's business.\n * - None of the three: a static line. It is not focusable, because a control that\n * does nothing is a tab stop with no purpose.\n *\n * ## Status is a claim, so it is optional\n *\n * `status` is rendered only when the caller has it. A line without one makes no\n * statement about success, which matters for runtime events whose lifecycle the\n * producer has not told us: showing a tick on an event that merely *arrived* is\n * a small lie that accumulates. `running` shimmers the title and spins the mark,\n * both of which stop under reduced motion; `error` and `cancelled` change the\n * mark's shape as well as its colour; every status is also spoken (`sr-only`),\n * because a coloured dot alone fails anyone who cannot see it.\n */\nexport type TraceStatus = 'pending' | 'running' | 'success' | 'error' | 'cancelled'\n\n/** The words spoken for each status. Override per line for another language. */\nexport const TRACE_STATUS_LABELS: Readonly<Record<TraceStatus, string>> = {\n pending: 'Pending',\n running: 'Running',\n success: 'Completed',\n error: 'Failed',\n cancelled: 'Cancelled',\n}\n\n/**\n * The status of a piece of work an agent set itself — a task item, a plan step,\n * a queued todo, a chain-of-thought step — as opposed to a call that ran. Each\n * maps onto a `TraceStatus`, so a work item draws the same mark as a line.\n */\nexport type WorkStatus = 'complete' | 'active' | 'pending' | 'failed' | 'skipped'\n\n/** The words spoken for each work status. */\nexport const WORK_STATUS_LABELS: Readonly<Record<WorkStatus, string>> = {\n complete: 'Completed',\n active: 'In progress',\n pending: 'Pending',\n failed: 'Failed',\n skipped: 'Skipped',\n}\n\n/** The line status each work status is drawn as. */\nexport const WORK_TRACE_STATUS: Readonly<Record<WorkStatus, TraceStatus>> = {\n complete: 'success',\n active: 'running',\n pending: 'pending',\n failed: 'error',\n skipped: 'cancelled',\n}\n\n/** `4` → `4s`, `65` → `1m 5s`. Nothing for a value that is not a finite duration. */\nexport function formatDuration(seconds: number | undefined): string | undefined {\n if (seconds === undefined || !Number.isFinite(seconds) || seconds < 0) return undefined\n const total = Math.round(seconds)\n if (total === 0) return '<1s'\n if (total < 60) return `${total}s`\n const hours = Math.floor(total / 3600)\n const minutes = Math.floor((total % 3600) / 60)\n const rest = total % 60\n if (hours > 0) return minutes > 0 ? `${hours}h ${minutes}m` : `${hours}h`\n return rest > 0 ? `${minutes}m ${rest}s` : `${minutes}m`\n}\n\nexport type TraceProps = ComponentProps<'ul'> & {\n /** Tighter rows, for output nested inside another line. */\n size?: 'default' | 'sm'\n}\n\nexport function Trace(props: TraceProps) {\n const local = props\n const rest = omit(props, 'class', 'size', 'children')\n return (\n // `role=\"list\"` restores list semantics that `list-none` strips in WebKit.\n <ul\n role=\"list\"\n data-slot=\"trace\"\n data-size={local.size ?? 'default'}\n class={cn('m-0 flex min-w-0 list-none flex-col gap-px p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>\n )\n}\n\n/**\n * A line's details: elements, or a function that builds them. The function is\n * not called to decide whether the line can expand, only when the content\n * mounts, and then once.\n */\nexport type TraceLineBody = JSX.Element | (() => JSX.Element)\n\nexport type TraceLineProps = Omit<ComponentProps<'li'>, 'title' | 'onSelect' | 'children'> & {\n title: JSX.Element\n description?: JSX.Element\n /** The line's own glyph. A `running`, `error`, `pending` or `cancelled` status replaces it. */\n icon?: JSX.Element\n status?: TraceStatus\n /** Spoken in place of the default status word. */\n statusLabel?: string\n /** Trailing text: a duration, a count, a file size. */\n meta?: JSX.Element\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** Make the line a link. Mutually exclusive with children and `onSelect`. */\n href?: string\n /** Make the line open a surface the caller owns. */\n onSelect?: () => void\n /** Which kind of surface `onSelect` opens, for assistive technology. */\n selectHaspopup?: 'dialog' | 'menu' | 'true'\n /** Details. Their presence makes the line expandable. */\n children?: TraceLineBody\n}\n\n/**\n * The mark at the start of a line. A `TaskItemRow` uses it too, so a work item\n * and a line draw a status the same way.\n */\nexport function TraceMark(props: {\n status?: TraceStatus\n icon?: JSX.Element\n completed?: boolean\n class?: string\n slot?: string\n}) {\n return (\n <span\n data-slot={props.slot ?? 'trace-mark'}\n aria-hidden=\"true\"\n class={cn('grid size-4 shrink-0 place-items-center [&_svg]:size-3.5', props.class, {\n 'text-muted-foreground': props.status !== 'error' && props.status !== 'running',\n 'text-destructive': props.status === 'error',\n 'text-info': props.status === 'running',\n })}\n >\n <Show\n when={props.status === 'running'}\n fallback={\n <Show\n when={props.status === 'error'}\n fallback={\n <Show\n when={props.status === 'cancelled'}\n fallback={\n <Show\n when={props.status === 'pending'}\n fallback={props.icon ?? (props.completed ? <Check /> : <Dot />)}\n >\n <CircleDashed />\n </Show>\n }\n >\n <CircleSlash />\n </Show>\n }\n >\n <CircleAlert />\n </Show>\n }\n >\n <LoaderCircle class=\"motion-safe:animate-spin\" />\n </Show>\n </span>\n )\n}\n\n/**\n * Whether the status takes over the mark. A completed line keeps its own glyph\n * (the tool, the file) because \"done\" is the default expectation and a column of\n * identical ticks says nothing; the states that need noticing replace it.\n */\nfunction statusOwnsMark(status: TraceStatus | undefined): boolean {\n return (\n status === 'running' || status === 'error' || status === 'pending' || status === 'cancelled'\n )\n}\n\nfunction LineHead(props: {\n title: JSX.Element\n description?: JSX.Element\n icon?: JSX.Element\n status?: TraceStatus\n statusLabel?: string\n meta?: JSX.Element\n trailing?: JSX.Element\n}) {\n return (\n <>\n <TraceMark\n status={statusOwnsMark(props.status) ? props.status : undefined}\n icon={props.icon}\n completed={props.status === 'success'}\n />\n <span class=\"flex min-w-0 flex-1 items-baseline gap-2\">\n <span\n data-slot=\"trace-title\"\n class={cn('truncate text-sm', {\n 'text-shimmer': props.status === 'running',\n 'text-destructive': props.status === 'error',\n 'text-muted-foreground': props.status !== 'running' && props.status !== 'error',\n })}\n >\n {props.title}\n </span>\n <Show when={props.description}>\n {(descriptionSlot) => (\n <span\n data-slot=\"trace-description\"\n class=\"min-w-0 truncate text-xs text-muted-foreground\"\n >\n {descriptionSlot()}\n </span>\n )}\n </Show>\n </span>\n <Show when={props.status}>\n {(status) => (\n <span class=\"sr-only\">{props.statusLabel ?? TRACE_STATUS_LABELS[status()]}</span>\n )}\n </Show>\n <Show when={props.meta}>\n {(metaSlot) => (\n <span data-slot=\"trace-meta\" class=\"shrink-0 text-xs text-muted-foreground tabular-nums\">\n {metaSlot()}\n </span>\n )}\n </Show>\n {props.trailing}\n </>\n )\n}\n\nconst lineClass =\n 'flex min-h-control-xs w-full min-w-0 items-center gap-2 rounded-md px-1.5 py-0.5 text-start outline-none'\nconst interactiveClass =\n 'cursor-pointer transition-colors ease-out hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-primary-subtle focus-visible:border-ring'\n\nexport function TraceLine(props: TraceLineProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'title',\n 'description',\n 'icon',\n 'status',\n 'statusLabel',\n 'meta',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'href',\n 'onSelect',\n 'selectHaspopup',\n 'children'\n )\n // Read once. `local.children` is a getter that builds the subtree each time it\n // is read, so testing it in `when` and then placing it built every nested line\n // twice, and a chain of lines nested n deep built 2^n of them. It is not resolved\n // (`children()`), so a body that renders nothing yet, such as a `Show` that is\n // closed, still makes the line a disclosure, and a lazy body is not run until\n // `insert` places it.\n const content = createMemo(() => local.children as JSX.Element)\n // A plain disclosure: a button with aria-expanded and a region mounted while open.\n // A Collapsible primitive (Kobalte's, when this was written) cost a polymorphic\n // button, a presence tracker and three contexts per line, more than the rest of the line put together.\n const [ownOpen, setOwnOpen] = createSignal(() => local.defaultOpen ?? false)\n const isOpen = () => local.open ?? ownOpen()\n const setOpen = (next: boolean) => {\n if (local.open === undefined) setOwnOpen(next)\n local.onOpenChange?.(next)\n }\n const contentId = createUniqueId()\n const head = (trailing?: JSX.Element) => (\n <LineHead\n title={local.title}\n description={local.description}\n icon={local.icon}\n status={local.status}\n statusLabel={local.statusLabel}\n meta={local.meta}\n trailing={trailing}\n />\n )\n\n return (\n <li\n data-slot=\"trace-line\"\n data-status={local.status}\n aria-busy={local.status === 'running' ? 'true' : undefined}\n class={cn('min-w-0', local.class)}\n {...rest}\n >\n <Show\n when={local.href === undefined}\n fallback={\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class={cn(lineClass, interactiveClass)}\n >\n {head(\n <ExternalLink aria-hidden=\"true\" class=\"size-3 shrink-0 text-muted-foreground\" />\n )}\n </a>\n }\n >\n <Show\n when={local.onSelect === undefined}\n fallback={\n <button\n type=\"button\"\n aria-haspopup={local.selectHaspopup ?? 'dialog'}\n class={cn(lineClass, interactiveClass)}\n onClick={() => local.onSelect?.()}\n >\n {head(\n <ChevronRight aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />\n )}\n </button>\n }\n >\n <Show when={content()} fallback={<div class={lineClass}>{head()}</div>}>\n <div class=\"group/trace\" data-expanded={isOpen() ? '' : undefined}>\n <button\n type=\"button\"\n aria-expanded={isOpen() ? 'true' : 'false'}\n aria-controls={isOpen() ? contentId : undefined}\n class={cn(lineClass, interactiveClass)}\n onClick={() => setOpen(!isOpen())}\n >\n {head(\n <ChevronRight\n aria-hidden=\"true\"\n class=\"size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90\"\n />\n )}\n </button>\n <Show when={isOpen()}>\n <div\n id={contentId}\n data-slot=\"trace-content\"\n data-expanded=\"\"\n class=\"overflow-hidden animate-in fade-in-0\"\n >\n {/* The rail is drawn from the mark's centre, so a nested line reads as\n belonging to the one above it without an indent that eats the width. */}\n <div class=\"ms-[0.6875rem] mt-0.5 mb-1 flex min-w-0 flex-col gap-1 border-s border-border ps-3\">\n {content()}\n </div>\n </div>\n </Show>\n </div>\n </Show>\n </Show>\n </Show>\n </li>\n )\n}\n\n/**\n * Free-form detail inside an expanded line: an input, an output, a paragraph. It\n * is a plain block with the type scale already set, so a caller does not restyle\n * a line's children to make a paragraph fit.\n */\nexport function TraceDetail(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <div\n data-slot=\"trace-detail\"\n class={cn('min-w-0 text-xs leading-5 text-muted-foreground', local.class)}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\n/** Height an error section scrolls within. */\nconst ERROR_MAX_HEIGHT = '16rem'\n\n/**\n * A failure inside an expanded line, as text. Every line is marked as an error\n * rather than recolouring the block, which keeps the mark in the gutter (a glyph,\n * not colour alone) and the copy exact. `children` go below it, e.g. a note that\n * the text was cut.\n */\nexport function TraceError(props: { text: string; children?: JSX.Element }) {\n const marks = createMemo((): Readonly<Record<number, CodeLineMark>> =>\n Object.fromEntries(\n Array.from({ length: props.text.split('\\n').length }, (_, index) => [index + 1, 'error'])\n )\n )\n return (\n <div class=\"flex min-w-0 flex-col gap-1\">\n <CodeBlock\n size=\"sm\"\n title=\"Error\"\n language=\"error\"\n code={props.text}\n lineMarks={marks()}\n complete\n maxHeight={ERROR_MAX_HEIGHT}\n wrap\n />\n {props.children}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA,IAAMwC,UAAQ,SAASC,KAAW;AAClC,IAAMC,iBAAe,SAASC,YAAkB;AAChD,IAAMC,gBAAc,SAASC,WAAiB;AAC9C,IAAMC,iBAAe,SAASC,YAAkB;AAChD,IAAMC,gBAAc,SAASC,WAAiB;AAC9C,IAAMC,QAAM,SAASC,GAAS;AAC9B,IAAMC,iBAAe,SAASC,YAAkB;AAChD,IAAMC,iBAAe,SAASC,YAAkB;;AAwChD,IAAa,sBAA6D;CACxE,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;CACP,WAAW;AACb;;AAUA,IAAa,qBAA2D;CACtE,UAAU;CACV,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;AACX;;AAGA,IAAa,oBAA+D;CAC1E,UAAU;CACV,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;AACX;;AAGA,SAAgB,eAAe,SAAiD;CAC9E,IAAI,YAAY,KAAA,KAAa,CAAC,OAAO,SAAS,OAAO,KAAK,UAAU,GAAG,OAAO,KAAA;CAC9E,MAAM,QAAQ,KAAK,MAAM,OAAO;CAChC,IAAI,UAAU,GAAG,OAAO;CACxB,IAAI,QAAQ,IAAI,OAAO,GAAG,MAAM;CAChC,MAAM,QAAQ,KAAK,MAAM,QAAQ,IAAI;CACrC,MAAM,UAAU,KAAK,MAAO,QAAQ,OAAQ,EAAE;CAC9C,MAAM,OAAO,QAAQ;CACrB,IAAI,QAAQ,GAAG,OAAO,UAAU,IAAI,GAAG,MAAM,IAAI,QAAQ,KAAK,GAAG,MAAM;CACvE,OAAO,OAAO,IAAI,GAAG,QAAQ,IAAI,KAAK,KAAK,GAAG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N,OACEzB;AAyEJ;;;;;;AAOA,SAAgB,YAAY,OAA8B;CACxD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAE1C,IAAA,SAAA,SAMK;CAHH,OAAA,QAAA,CAAA;EAFA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,mDAAmD,MAAM,KAAK;EAAC;CACjE,GAAJ,IAAA,GAAA,IAAA;CAHN,OAAA,cAKE;EAAC,OAAA,MAAM;CAAQ,CACZ;CAPP,OACEC;AAQJ;;AAGA,IAAM,mBAAmB;;;;;;;AAQzB,SAAgB,WAAW,OAAiD;CAC1E,MAAM,QAAQ,iBACZ,OAAO,YACL,MAAM,KAAK,EAAE,QAAQ,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC,OAAO,IAAI,GAAG,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,CAC1F,CACF;CAEE,IAAA,SAAA,SAYK;CAZL,IAAA,SAAA,OAAA;;CACEC,OAAAA,QAAAA,gBAAAA,WAAAA;EACEC,MAAK;EACLC,OAAM;EACNC,UAAS;EACT,IAAA,OAAA;GAAM,OAAA,MAAM;EAAI;EAChB,IAAA,YAAA;GAAW,OAAA,MAAM;EAAC;EAClB,UAAA;EACAC,WAAW;EACX,MAAA;CACD,CAAA,GAVHC,MAYK;CAZL,OAAA,cAWE;EAAC,OAAA,MAAM;CAAQ,GAXjBA,MAYK;CAbP,OACEA;AAcJ"}
1
+ {"version":3,"file":"trace.js","names":["role=\"list\"","<ul\n role=\"list\"\n data-slot=\"trace\"\n data-size={local.size ?? 'default'}\n class={cn('m-0 flex min-w-0 list-none flex-col gap-px p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>","<LoaderCircle class=\"motion-safe:animate-spin\" />","class=\"motion-safe:animate-spin\"","<Show\n when={props.status === 'error'}\n fallback={\n <Show\n when={props.status === 'cancelled'}\n fallback={\n <Show\n when={props.status === 'pending'}\n fallback={props.icon ?? (props.completed ? <Check /> : <Dot />)}\n >\n <CircleDashed />\n </Show>\n }\n >\n <CircleSlash />\n </Show>\n }\n >\n <CircleAlert />\n </Show>","<Show\n when={props.status === 'cancelled'}\n fallback={\n <Show\n when={props.status === 'pending'}\n fallback={props.icon ?? (props.completed ? <Check /> : <Dot />)}\n >\n <CircleDashed />\n </Show>\n }\n >\n <CircleSlash />\n </Show>","<Show\n when={props.status === 'pending'}\n fallback={props.icon ?? (props.completed ? <Check /> : <Dot />)}\n >\n <CircleDashed />\n </Show>","<Check />","<Dot />","<CircleDashed />","<CircleSlash />","<CircleAlert />","class={cn('grid size-4 shrink-0 place-items-center [&_svg]:size-3.5', props.class, {\n 'text-muted-foreground': props.status !== 'error' && props.status !== 'running',\n 'text-destructive': props.status === 'error',\n 'text-info': props.status === 'running',\n })}","<span\n data-slot={props.slot ?? 'trace-mark'}\n aria-hidden=\"true\"\n class={cn('grid size-4 shrink-0 place-items-center [&_svg]:size-3.5', props.class, {\n 'text-muted-foreground': props.status !== 'error' && props.status !== 'running',\n 'text-destructive': props.status === 'error',\n 'text-info': props.status === 'running',\n })}\n >\n <Show\n when={props.status === 'running'}\n fallback={\n <Show\n when={props.status === 'error'}\n fallback={\n <Show\n when={props.status === 'cancelled'}\n fallback={\n <Show\n when={props.status === 'pending'}\n fallback={props.icon ?? (props.completed ? <Check /> : <Dot />)}\n >\n <CircleDashed />\n </Show>\n }\n >\n <CircleSlash />\n </Show>\n }\n >\n <CircleAlert />\n </Show>\n }\n >\n <LoaderCircle class=\"motion-safe:animate-spin\" />\n </Show>\n </span>","<TraceMark\n status={statusOwnsMark(props.status) ? props.status : undefined}\n icon={props.icon}\n completed={props.status === 'success'}\n />","statusOwnsMark(props.status) ? props.status : undefined","<Show when={props.description}>\n {(descriptionSlot) => (\n <span\n data-slot=\"trace-description\"\n class=\"min-w-0 truncate text-xs text-muted-foreground\"\n >\n {descriptionSlot()}\n </span>\n )}\n </Show>","<Show when={props.status}>\n {(status) => (\n <span class=\"sr-only\">{props.statusLabel ?? TRACE_STATUS_LABELS[status()]}</span>\n )}\n </Show>","<Show when={props.meta}>\n {(metaSlot) => (\n <span data-slot=\"trace-meta\" class=\"shrink-0 text-xs text-muted-foreground tabular-nums\">\n {metaSlot()}\n </span>\n )}\n </Show>","{props.trailing}","<LineHead\n title={local.title}\n description={local.description}\n icon={local.icon}\n status={local.status}\n statusLabel={local.statusLabel}\n meta={local.meta}\n trailing={trailing}\n />","<Show\n when={local.onSelect === undefined}\n fallback={\n <button\n type=\"button\"\n aria-haspopup={local.selectHaspopup ?? 'dialog'}\n class={cn(lineClass, interactiveClass)}\n onClick={() => local.onSelect?.()}\n >\n {head(\n <ChevronRight aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />\n )}\n </button>\n }\n >\n <Show when={content()} fallback={<div class={lineClass}>{head()}</div>}>\n <div class=\"group/trace\" data-expanded={isOpen() ? '' : undefined}>\n <button\n type=\"button\"\n aria-expanded={isOpen() ? 'true' : 'false'}\n aria-controls={isOpen() ? contentId : undefined}\n class={cn(lineClass, interactiveClass)}\n onClick={() => setOpen(!isOpen())}\n >\n {head(\n <ChevronRight\n aria-hidden=\"true\"\n class=\"size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90\"\n />\n )}\n </button>\n <Show when={isOpen()}>\n <div\n id={contentId}\n data-slot=\"trace-content\"\n data-expanded=\"\"\n class=\"overflow-hidden animate-in fade-in-0\"\n >\n {/* The rail is drawn from the mark's centre, so a nested line reads as\n belonging to the one above it without an indent that eats the width. */}\n <div class=\"ms-[0.6875rem] mt-0.5 mb-1 flex min-w-0 flex-col gap-1 border-s border-border ps-3\">\n {content()}\n </div>\n </div>\n </Show>\n </div>\n </Show>\n </Show>","<Show when={content()} fallback={<div class={lineClass}>{head()}</div>}>\n <div class=\"group/trace\" data-expanded={isOpen() ? '' : undefined}>\n <button\n type=\"button\"\n aria-expanded={isOpen() ? 'true' : 'false'}\n aria-controls={isOpen() ? contentId : undefined}\n class={cn(lineClass, interactiveClass)}\n onClick={() => setOpen(!isOpen())}\n >\n {head(\n <ChevronRight\n aria-hidden=\"true\"\n class=\"size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90\"\n />\n )}\n </button>\n <Show when={isOpen()}>\n <div\n id={contentId}\n data-slot=\"trace-content\"\n data-expanded=\"\"\n class=\"overflow-hidden animate-in fade-in-0\"\n >\n {/* The rail is drawn from the mark's centre, so a nested line reads as\n belonging to the one above it without an indent that eats the width. */}\n <div class=\"ms-[0.6875rem] mt-0.5 mb-1 flex min-w-0 flex-col gap-1 border-s border-border ps-3\">\n {content()}\n </div>\n </div>\n </Show>\n </div>\n </Show>","<ChevronRight\n aria-hidden=\"true\"\n class=\"size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90\"\n />","class=\"size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90\"","aria-expanded={isOpen() ? 'true' : 'false'}","aria-controls={isOpen() ? contentId : undefined}","class={cn(lineClass, interactiveClass)}","<ChevronRight aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />","class=\"size-3.5 shrink-0 text-muted-foreground\"","<ExternalLink aria-hidden=\"true\" class=\"size-3 shrink-0 text-muted-foreground\" />","class=\"size-3 shrink-0 text-muted-foreground\"","<li\n data-slot=\"trace-line\"\n data-status={local.status}\n aria-busy={local.status === 'running' ? 'true' : undefined}\n class={cn('min-w-0', local.class)}\n {...rest}\n >\n <Show\n when={local.href === undefined}\n fallback={\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class={cn(lineClass, interactiveClass)}\n >\n {head(\n <ExternalLink aria-hidden=\"true\" class=\"size-3 shrink-0 text-muted-foreground\" />\n )}\n </a>\n }\n >\n <Show\n when={local.onSelect === undefined}\n fallback={\n <button\n type=\"button\"\n aria-haspopup={local.selectHaspopup ?? 'dialog'}\n class={cn(lineClass, interactiveClass)}\n onClick={() => local.onSelect?.()}\n >\n {head(\n <ChevronRight aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />\n )}\n </button>\n }\n >\n <Show when={content()} fallback={<div class={lineClass}>{head()}</div>}>\n <div class=\"group/trace\" data-expanded={isOpen() ? '' : undefined}>\n <button\n type=\"button\"\n aria-expanded={isOpen() ? 'true' : 'false'}\n aria-controls={isOpen() ? contentId : undefined}\n class={cn(lineClass, interactiveClass)}\n onClick={() => setOpen(!isOpen())}\n >\n {head(\n <ChevronRight\n aria-hidden=\"true\"\n class=\"size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90\"\n />\n )}\n </button>\n <Show when={isOpen()}>\n <div\n id={contentId}\n data-slot=\"trace-content\"\n data-expanded=\"\"\n class=\"overflow-hidden animate-in fade-in-0\"\n >\n {/* The rail is drawn from the mark's centre, so a nested line reads as\n belonging to the one above it without an indent that eats the width. */}\n <div class=\"ms-[0.6875rem] mt-0.5 mb-1 flex min-w-0 flex-col gap-1 border-s border-border ps-3\">\n {content()}\n </div>\n </div>\n </Show>\n </div>\n </Show>\n </Show>\n </Show>\n </li>","<div\n data-slot=\"trace-detail\"\n class={cn('min-w-0 text-xs leading-5 text-muted-foreground', local.class)}\n {...rest}\n >\n {local.children}\n </div>","<CodeBlock\n size=\"sm\"\n title=\"Error\"\n language=\"error\"\n code={props.text}\n lineMarks={marks()}\n complete\n maxHeight={ERROR_MAX_HEIGHT}\n wrap\n />","size=\"sm\"","title=\"Error\"","language=\"error\"","maxHeight={ERROR_MAX_HEIGHT}","<div class=\"flex min-w-0 flex-col gap-1\">\n <CodeBlock\n size=\"sm\"\n title=\"Error\"\n language=\"error\"\n code={props.text}\n lineMarks={marks()}\n complete\n maxHeight={ERROR_MAX_HEIGHT}\n wrap\n />\n {props.children}\n </div>","LucideCheck","LucideChevronRight","LucideCircleAlert","LucideCircleDashed","LucideCircleSlash","LucideDot","LucideExternalLink","LucideLoaderCircle","_$spread","_$insert","_$effect","_$readShallow","_$setAttribute","_$className"],"sources":["../../../../src/components/ui/trace/trace.tsx"],"sourcesContent":["import {\n Check as LucideCheck,\n ChevronRight as LucideChevronRight,\n CircleAlert as LucideCircleAlert,\n CircleDashed as LucideCircleDashed,\n CircleSlash as LucideCircleSlash,\n Dot as LucideDot,\n ExternalLink as LucideExternalLink,\n LoaderCircle as LucideLoaderCircle,\n} from '@lucide/solid'\nimport { createMemo, createSignal, createUniqueId, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cn } from '#lib/utils'\nimport { CodeBlock, type CodeLineMark } from '../code-block'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst ChevronRight = fastIcon(LucideChevronRight)\nconst CircleAlert = fastIcon(LucideCircleAlert)\nconst CircleDashed = fastIcon(LucideCircleDashed)\nconst CircleSlash = fastIcon(LucideCircleSlash)\nconst Dot = fastIcon(LucideDot)\nconst ExternalLink = fastIcon(LucideExternalLink)\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\n\n/**\n * Trace.\n *\n * A list of lines, one per thing an agent did. Reasoning, a tool call, a source\n * it read, a plan step and a whole subagent run all share one shape — *something\n * the agent did, and what happened* — so they share one row: a leading mark, a\n * title, an optional description, a status and, when there is more to say, a\n * disclosure. A transcript built from this reads as one quiet column of activity\n * under the answer instead of a stack of competing cards.\n *\n * ## One row, three behaviours\n *\n * - **Children** make the line expandable. The trigger is a real button with\n * `aria-expanded`, so keyboard and screen-reader users get the disclosure for\n * free. Children can themselves be a `Trace`, which is how a summary expands\n * into steps and a step into its output. A `TraceLineBody` function is a lazy\n * body: it makes the line expandable without running, and runs once, when the\n * content first mounts, so a folded line builds none of its detail.\n * - **`href`** makes the line a link — a source, a file, a run page.\n * - **`onSelect`** makes the line a button that opens something *else* (a dialog,\n * sheet, drawer or popover owned by the caller). The line says so with\n * `aria-haspopup`; the surface itself is not this component's business.\n * - None of the three: a static line. It is not focusable, because a control that\n * does nothing is a tab stop with no purpose.\n *\n * ## Status is a claim, so it is optional\n *\n * `status` is rendered only when the caller has it. A line without one makes no\n * statement about success, which matters for runtime events whose lifecycle the\n * producer has not told us: showing a tick on an event that merely *arrived* is\n * a small lie that accumulates. `running` shimmers the title and spins the mark,\n * both of which stop under reduced motion; `error` and `cancelled` change the\n * mark's shape as well as its colour; every status is also spoken (`sr-only`),\n * because a coloured dot alone fails anyone who cannot see it.\n */\nexport type TraceStatus = 'pending' | 'running' | 'success' | 'error' | 'cancelled'\n\n/** The words spoken for each status. Override per line for another language. */\nexport const TRACE_STATUS_LABELS: Readonly<Record<TraceStatus, string>> = {\n pending: 'Pending',\n running: 'Running',\n success: 'Completed',\n error: 'Failed',\n cancelled: 'Cancelled',\n}\n\n/**\n * The status of a piece of work an agent set itself — a task item, a plan step,\n * a queued todo, a chain-of-thought step — as opposed to a call that ran. Each\n * maps onto a `TraceStatus`, so a work item draws the same mark as a line.\n */\nexport type WorkStatus = 'complete' | 'active' | 'pending' | 'failed' | 'skipped'\n\n/** The words spoken for each work status. */\nexport const WORK_STATUS_LABELS: Readonly<Record<WorkStatus, string>> = {\n complete: 'Completed',\n active: 'In progress',\n pending: 'Pending',\n failed: 'Failed',\n skipped: 'Skipped',\n}\n\n/** The line status each work status is drawn as. */\nexport const WORK_TRACE_STATUS: Readonly<Record<WorkStatus, TraceStatus>> = {\n complete: 'success',\n active: 'running',\n pending: 'pending',\n failed: 'error',\n skipped: 'cancelled',\n}\n\n/** `4` → `4s`, `65` → `1m 5s`. Nothing for a value that is not a finite duration. */\nexport function formatDuration(seconds: number | undefined): string | undefined {\n if (seconds === undefined || !Number.isFinite(seconds) || seconds < 0) return undefined\n const total = Math.round(seconds)\n if (total === 0) return '<1s'\n if (total < 60) return `${total}s`\n const hours = Math.floor(total / 3600)\n const minutes = Math.floor((total % 3600) / 60)\n const rest = total % 60\n if (hours > 0) return minutes > 0 ? `${hours}h ${minutes}m` : `${hours}h`\n return rest > 0 ? `${minutes}m ${rest}s` : `${minutes}m`\n}\n\nexport type TraceProps = ComponentProps<'ul'> & {\n /** Tighter rows, for output nested inside another line. */\n size?: 'default' | 'sm'\n}\n\nexport function Trace(props: TraceProps) {\n const local = props\n const rest = omit(props, 'class', 'size', 'children')\n return (\n // `role=\"list\"` restores list semantics that `list-none` strips in WebKit.\n <ul\n role=\"list\"\n data-slot=\"trace\"\n data-size={local.size ?? 'default'}\n class={cn('m-0 flex min-w-0 list-none flex-col gap-px p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>\n )\n}\n\n/**\n * A line's details: elements, or a function that builds them. The function is\n * not called to decide whether the line can expand, only when the content\n * mounts, and then once.\n */\nexport type TraceLineBody = JSX.Element | (() => JSX.Element)\n\nexport type TraceLineProps = Omit<ComponentProps<'li'>, 'title' | 'onSelect' | 'children'> & {\n title: JSX.Element\n description?: JSX.Element\n /** The line's own glyph. A `running`, `error`, `pending` or `cancelled` status replaces it. */\n icon?: JSX.Element\n status?: TraceStatus\n /** Spoken in place of the default status word. */\n statusLabel?: string\n /** Trailing text: a duration, a count, a file size. */\n meta?: JSX.Element\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** Make the line a link. Mutually exclusive with children and `onSelect`. */\n href?: string\n /** Make the line open a surface the caller owns. */\n onSelect?: () => void\n /** Which kind of surface `onSelect` opens, for assistive technology. */\n selectHaspopup?: 'dialog' | 'menu' | 'true'\n /** Details. Their presence makes the line expandable. */\n children?: TraceLineBody\n}\n\n/**\n * The mark at the start of a line. A `TaskItemRow` uses it too, so a work item\n * and a line draw a status the same way.\n */\nexport function TraceMark(props: {\n status?: TraceStatus\n icon?: JSX.Element\n completed?: boolean\n class?: string\n slot?: string\n}) {\n return (\n <span\n data-slot={props.slot ?? 'trace-mark'}\n aria-hidden=\"true\"\n class={cn('grid size-4 shrink-0 place-items-center [&_svg]:size-3.5', props.class, {\n 'text-muted-foreground': props.status !== 'error' && props.status !== 'running',\n 'text-destructive': props.status === 'error',\n 'text-info': props.status === 'running',\n })}\n >\n <Show\n when={props.status === 'running'}\n fallback={\n <Show\n when={props.status === 'error'}\n fallback={\n <Show\n when={props.status === 'cancelled'}\n fallback={\n <Show\n when={props.status === 'pending'}\n fallback={props.icon ?? (props.completed ? <Check /> : <Dot />)}\n >\n <CircleDashed />\n </Show>\n }\n >\n <CircleSlash />\n </Show>\n }\n >\n <CircleAlert />\n </Show>\n }\n >\n <LoaderCircle class=\"motion-safe:animate-spin\" />\n </Show>\n </span>\n )\n}\n\n/**\n * Whether the status takes over the mark. A completed line keeps its own glyph\n * (the tool, the file) because \"done\" is the default expectation and a column of\n * identical ticks says nothing; the states that need noticing replace it.\n */\nfunction statusOwnsMark(status: TraceStatus | undefined): boolean {\n return (\n status === 'running' || status === 'error' || status === 'pending' || status === 'cancelled'\n )\n}\n\nfunction LineHead(props: {\n title: JSX.Element\n description?: JSX.Element\n icon?: JSX.Element\n status?: TraceStatus\n statusLabel?: string\n meta?: JSX.Element\n trailing?: JSX.Element\n}) {\n return (\n <>\n <TraceMark\n status={statusOwnsMark(props.status) ? props.status : undefined}\n icon={props.icon}\n completed={props.status === 'success'}\n />\n <span class=\"flex min-w-0 flex-1 items-baseline gap-2\">\n <span\n data-slot=\"trace-title\"\n class={cn('truncate text-sm', {\n 'text-shimmer': props.status === 'running',\n 'text-destructive': props.status === 'error',\n 'text-muted-foreground': props.status !== 'running' && props.status !== 'error',\n })}\n >\n {props.title}\n </span>\n <Show when={props.description}>\n {(descriptionSlot) => (\n <span\n data-slot=\"trace-description\"\n class=\"min-w-0 truncate text-xs text-muted-foreground\"\n >\n {descriptionSlot()}\n </span>\n )}\n </Show>\n </span>\n <Show when={props.status}>\n {(status) => (\n <span class=\"sr-only\">{props.statusLabel ?? TRACE_STATUS_LABELS[status()]}</span>\n )}\n </Show>\n <Show when={props.meta}>\n {(metaSlot) => (\n <span data-slot=\"trace-meta\" class=\"shrink-0 text-xs text-muted-foreground tabular-nums\">\n {metaSlot()}\n </span>\n )}\n </Show>\n {props.trailing}\n </>\n )\n}\n\nconst lineClass =\n 'flex min-h-control-xs w-full min-w-0 items-center gap-2 rounded-md px-1.5 py-0.5 text-start outline-none'\nconst interactiveClass =\n 'cursor-pointer transition-colors ease-out hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-primary-subtle focus-visible:border-ring'\n\nexport function TraceLine(props: TraceLineProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'title',\n 'description',\n 'icon',\n 'status',\n 'statusLabel',\n 'meta',\n 'open',\n 'defaultOpen',\n 'onOpenChange',\n 'href',\n 'onSelect',\n 'selectHaspopup',\n 'children'\n )\n // Read once. `local.children` is a getter that builds the subtree each time it\n // is read, so testing it in `when` and then placing it built every nested line\n // twice, and a chain of lines nested n deep built 2^n of them. It is not resolved\n // (`children()`), so a body that renders nothing yet, such as a `Show` that is\n // closed, still makes the line a disclosure, and a lazy body is not run until\n // `insert` places it.\n const content = createMemo(() => local.children as JSX.Element)\n // A plain disclosure: a button with aria-expanded and a region mounted while open.\n // A Collapsible primitive (Kobalte's, when this was written) cost a polymorphic\n // button, a presence tracker and three contexts per line, more than the rest of the line put together.\n const [ownOpen, setOwnOpen] = createSignal(() => local.defaultOpen ?? false)\n const isOpen = () => local.open ?? ownOpen()\n const setOpen = (next: boolean) => {\n if (local.open === undefined) setOwnOpen(next)\n local.onOpenChange?.(next)\n }\n const contentId = createUniqueId()\n const head = (trailing?: JSX.Element) => (\n <LineHead\n title={local.title}\n description={local.description}\n icon={local.icon}\n status={local.status}\n statusLabel={local.statusLabel}\n meta={local.meta}\n trailing={trailing}\n />\n )\n\n return (\n <li\n data-slot=\"trace-line\"\n data-status={local.status}\n aria-busy={local.status === 'running' ? 'true' : undefined}\n class={cn('min-w-0', local.class)}\n {...rest}\n >\n <Show\n when={local.href === undefined}\n fallback={\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class={cn(lineClass, interactiveClass)}\n >\n {head(\n <ExternalLink aria-hidden=\"true\" class=\"size-3 shrink-0 text-muted-foreground\" />\n )}\n </a>\n }\n >\n <Show\n when={local.onSelect === undefined}\n fallback={\n <button\n type=\"button\"\n aria-haspopup={local.selectHaspopup ?? 'dialog'}\n class={cn(lineClass, interactiveClass)}\n onClick={() => local.onSelect?.()}\n >\n {head(\n <ChevronRight aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />\n )}\n </button>\n }\n >\n <Show when={content()} fallback={<div class={lineClass}>{head()}</div>}>\n <div class=\"group/trace\" data-expanded={isOpen() ? '' : undefined}>\n <button\n type=\"button\"\n aria-expanded={isOpen() ? 'true' : 'false'}\n aria-controls={isOpen() ? contentId : undefined}\n class={cn(lineClass, interactiveClass)}\n onClick={() => setOpen(!isOpen())}\n >\n {head(\n <ChevronRight\n aria-hidden=\"true\"\n class=\"size-3.5 shrink-0 text-muted-foreground transition-transform ease-out group-data-[expanded]/trace:rotate-90\"\n />\n )}\n </button>\n <Show when={isOpen()}>\n <div\n id={contentId}\n data-slot=\"trace-content\"\n data-expanded=\"\"\n class=\"overflow-hidden animate-in fade-in-0\"\n >\n {/* The rail is drawn from the mark's centre, so a nested line reads as\n belonging to the one above it without an indent that eats the width. */}\n <div class=\"ms-[0.6875rem] mt-0.5 mb-1 flex min-w-0 flex-col gap-1 border-s border-border ps-3\">\n {content()}\n </div>\n </div>\n </Show>\n </div>\n </Show>\n </Show>\n </Show>\n </li>\n )\n}\n\n/**\n * Free-form detail inside an expanded line: an input, an output, a paragraph. It\n * is a plain block with the type scale already set, so a caller does not restyle\n * a line's children to make a paragraph fit.\n */\nexport function TraceDetail(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <div\n data-slot=\"trace-detail\"\n class={cn('min-w-0 text-xs leading-5 text-muted-foreground', local.class)}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\n/** Height an error section scrolls within. */\nconst ERROR_MAX_HEIGHT = '16rem'\n\n/**\n * A failure inside an expanded line, as text. Every line is marked as an error\n * rather than recolouring the block, which keeps the mark in the gutter (a glyph,\n * not colour alone) and the copy exact. `children` go below it, e.g. a note that\n * the text was cut.\n */\nexport function TraceError(props: { text: string; children?: JSX.Element }) {\n const marks = createMemo((): Readonly<Record<number, CodeLineMark>> =>\n Object.fromEntries(\n Array.from({ length: props.text.split('\\n').length }, (_, index) => [index + 1, 'error'])\n )\n )\n return (\n <div class=\"flex min-w-0 flex-col gap-1\">\n <CodeBlock\n size=\"sm\"\n title=\"Error\"\n language=\"error\"\n code={props.text}\n lineMarks={marks()}\n complete\n maxHeight={ERROR_MAX_HEIGHT}\n wrap\n />\n {props.children}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA,IAAM,QAAQ,SAASwC,OAAW;AAClC,IAAM,eAAe,SAASC,cAAkB;AAChD,IAAM,cAAc,SAASC,aAAiB;AAC9C,IAAM,eAAe,SAASC,cAAkB;AAChD,IAAM,cAAc,SAASC,aAAiB;AAC9C,IAAM,MAAM,SAASC,KAAS;AAC9B,IAAM,eAAe,SAASC,cAAkB;AAChD,IAAM,eAAe,SAASC,cAAkB;;AAwChD,IAAa,sBAA6D;CACxE,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;CACP,WAAW;AACb;;AAUA,IAAa,qBAA2D;CACtE,UAAU;CACV,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;AACX;;AAGA,IAAa,oBAA+D;CAC1E,UAAU;CACV,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;AACX;;AAGA,SAAgB,eAAe,SAAiD;CAC9E,IAAI,YAAY,KAAA,KAAa,CAAC,OAAO,SAAS,OAAO,KAAK,UAAU,GAAG,OAAO,KAAA;CAC9E,MAAM,QAAQ,KAAK,MAAM,OAAO;CAChC,IAAI,UAAU,GAAG,OAAO;CACxB,IAAI,QAAQ,IAAI,OAAO,GAAG,MAAM;CAChC,M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7 @@
1
- import { cva } from "../../../lib/variants.js";
2
- import { cn } from "../../../lib/utils.js";
3
1
  import { Dynamic, createComponent, mergeProps } from "@solidjs/web";
4
2
  import { omit } from "solid-js";
3
+ import { cva } from "../../../lib/variants.js";
4
+ import { cn } from "../../../lib/utils.js";
5
5
  // src/components/ui/typography/typography.tsx
6
6
  /**
7
7
  * Typography.
@@ -1,5 +1,5 @@
1
- import { THEME_DEFAULT_ID } from "./theme-defaults.js";
2
1
  import { ACCENTS, getAccent } from "@adea-ai/themes";
2
+ import { THEME_DEFAULT_ID } from "./theme-defaults.js";
3
3
  // src/lib/accent-presets.ts
4
4
  /** Whether an id names one of the six presets (not `theme`, not a theme-carried accent). */
5
5
  function isPresetAccentId(id) {