@aceshooting/lyra-ui 1.2.0 → 2.1.0

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 (384) hide show
  1. package/README.md +98 -14
  2. package/custom-elements.json +30279 -12124
  3. package/dist/components/app-rail/app-rail-item.d.ts +30 -0
  4. package/dist/components/app-rail/app-rail-item.js +68 -0
  5. package/dist/components/app-rail/app-rail-item.styles.d.ts +1 -0
  6. package/dist/components/app-rail/app-rail-item.styles.js +65 -0
  7. package/dist/components/app-rail/app-rail.d.ts +168 -0
  8. package/dist/components/app-rail/app-rail.js +419 -0
  9. package/dist/components/app-rail/app-rail.styles.d.ts +1 -0
  10. package/dist/components/app-rail/app-rail.styles.js +128 -0
  11. package/dist/components/attachment-chip/attachment-chip.d.ts +141 -0
  12. package/dist/components/attachment-chip/attachment-chip.js +356 -0
  13. package/dist/components/attachment-chip/attachment-chip.styles.d.ts +1 -0
  14. package/dist/components/attachment-chip/attachment-chip.styles.js +184 -0
  15. package/dist/components/attachment-trigger/attachment-trigger.d.ts +96 -0
  16. package/dist/components/attachment-trigger/attachment-trigger.js +270 -0
  17. package/dist/components/attachment-trigger/attachment-trigger.styles.d.ts +1 -0
  18. package/dist/components/attachment-trigger/attachment-trigger.styles.js +90 -0
  19. package/dist/components/chart/bar-chart.js +2 -18
  20. package/dist/components/chart/box-plot.d.ts +25 -1
  21. package/dist/components/chart/box-plot.js +147 -7
  22. package/dist/components/chart/box-plot.styles.js +13 -0
  23. package/dist/components/chart/bubble-chart.js +2 -18
  24. package/dist/components/chart/chart-loader.d.ts +44 -13
  25. package/dist/components/chart/chart-loader.js +65 -18
  26. package/dist/components/chart/chart.d.ts +55 -12
  27. package/dist/components/chart/chart.js +247 -49
  28. package/dist/components/chart/doughnut-chart.js +2 -18
  29. package/dist/components/chart/histogram-bin.d.ts +7 -1
  30. package/dist/components/chart/histogram-bin.js +32 -14
  31. package/dist/components/chart/histogram.js +8 -16
  32. package/dist/components/chart/line-chart.js +2 -18
  33. package/dist/components/chart/lite-chart.d.ts +134 -3
  34. package/dist/components/chart/lite-chart.js +382 -67
  35. package/dist/components/chart/lite-chart.styles.js +9 -0
  36. package/dist/components/chart/pie-chart.js +2 -18
  37. package/dist/components/chart/polar-area-chart.js +2 -18
  38. package/dist/components/chart/radar-chart.js +2 -18
  39. package/dist/components/chart/scatter-chart.js +2 -18
  40. package/dist/components/chat-composer/chat-composer.d.ts +133 -0
  41. package/dist/components/chat-composer/chat-composer.js +366 -0
  42. package/dist/components/chat-composer/chat-composer.styles.d.ts +1 -0
  43. package/dist/components/chat-composer/chat-composer.styles.js +145 -0
  44. package/dist/components/chat-message/chat-message.d.ts +141 -0
  45. package/dist/components/chat-message/chat-message.js +331 -0
  46. package/dist/components/chat-message/chat-message.styles.d.ts +1 -0
  47. package/dist/components/chat-message/chat-message.styles.js +203 -0
  48. package/dist/components/checkbox/checkbox.d.ts +117 -0
  49. package/dist/components/checkbox/checkbox.js +353 -0
  50. package/dist/components/checkbox/checkbox.styles.d.ts +1 -0
  51. package/dist/components/checkbox/checkbox.styles.js +77 -0
  52. package/dist/components/chip/chip-group.d.ts +56 -0
  53. package/dist/components/chip/chip-group.js +130 -0
  54. package/dist/components/chip/chip-group.styles.d.ts +1 -0
  55. package/dist/components/chip/chip-group.styles.js +57 -0
  56. package/dist/components/chip/chip.d.ts +64 -0
  57. package/dist/components/chip/chip.js +122 -0
  58. package/dist/components/chip/chip.styles.d.ts +1 -0
  59. package/dist/components/chip/chip.styles.js +115 -0
  60. package/dist/components/citation-badge/citation-badge.d.ts +113 -0
  61. package/dist/components/citation-badge/citation-badge.js +318 -0
  62. package/dist/components/citation-badge/citation-badge.styles.d.ts +1 -0
  63. package/dist/components/citation-badge/citation-badge.styles.js +96 -0
  64. package/dist/components/code-block/code-block.d.ts +127 -0
  65. package/dist/components/code-block/code-block.js +382 -0
  66. package/dist/components/code-block/code-block.styles.d.ts +1 -0
  67. package/dist/components/code-block/code-block.styles.js +187 -0
  68. package/dist/components/code-block/code-loader.d.ts +87 -0
  69. package/dist/components/code-block/code-loader.js +142 -0
  70. package/dist/components/combobox/combobox.d.ts +65 -6
  71. package/dist/components/combobox/combobox.js +258 -48
  72. package/dist/components/combobox/combobox.styles.js +3 -3
  73. package/dist/components/combobox/option.d.ts +5 -1
  74. package/dist/components/combobox/option.js +35 -0
  75. package/dist/components/context-meter/context-meter.d.ts +53 -0
  76. package/dist/components/context-meter/context-meter.js +159 -0
  77. package/dist/components/context-meter/context-meter.styles.d.ts +1 -0
  78. package/dist/components/context-meter/context-meter.styles.js +114 -0
  79. package/dist/components/conversation-item/conversation-item.d.ts +125 -0
  80. package/dist/components/conversation-item/conversation-item.js +331 -0
  81. package/dist/components/conversation-item/conversation-item.styles.d.ts +1 -0
  82. package/dist/components/conversation-item/conversation-item.styles.js +155 -0
  83. package/dist/components/date-picker/calendar-core.d.ts +24 -0
  84. package/dist/components/date-picker/calendar-core.js +51 -4
  85. package/dist/components/date-picker/date-input.d.ts +100 -9
  86. package/dist/components/date-picker/date-input.js +383 -66
  87. package/dist/components/date-picker/date-picker.d.ts +35 -4
  88. package/dist/components/date-picker/date-picker.js +171 -44
  89. package/dist/components/dialog/confirm.d.ts +40 -0
  90. package/dist/components/dialog/confirm.js +76 -0
  91. package/dist/components/dialog/dialog.d.ts +129 -0
  92. package/dist/components/dialog/dialog.js +288 -0
  93. package/dist/components/dialog/dialog.styles.d.ts +1 -0
  94. package/dist/components/dialog/dialog.styles.js +96 -0
  95. package/dist/components/dock-panel/dock-panel.d.ts +142 -0
  96. package/dist/components/dock-panel/dock-panel.js +359 -0
  97. package/dist/components/dock-panel/dock-panel.styles.d.ts +1 -0
  98. package/dist/components/dock-panel/dock-panel.styles.js +159 -0
  99. package/dist/components/document-preview/document-preview.d.ts +143 -0
  100. package/dist/components/document-preview/document-preview.js +388 -0
  101. package/dist/components/document-preview/document-preview.styles.d.ts +1 -0
  102. package/dist/components/document-preview/document-preview.styles.js +191 -0
  103. package/dist/components/empty/empty.d.ts +1 -2
  104. package/dist/components/empty/empty.js +18 -12
  105. package/dist/components/empty/empty.styles.js +0 -3
  106. package/dist/components/export-button/csv.js +1 -1
  107. package/dist/components/export-button/export-button.d.ts +12 -0
  108. package/dist/components/export-button/export-button.js +35 -5
  109. package/dist/components/export-button/export-button.styles.js +5 -1
  110. package/dist/components/file-input/accept.js +2 -0
  111. package/dist/components/file-input/file-input.d.ts +10 -1
  112. package/dist/components/file-input/file-input.js +36 -5
  113. package/dist/components/flag/flag.d.ts +29 -13
  114. package/dist/components/flag/flag.js +54 -14
  115. package/dist/components/flag/flag.styles.js +1 -1
  116. package/dist/components/flag/language-map.d.ts +4 -1
  117. package/dist/components/flag/language-map.js +6 -3
  118. package/dist/components/gauge/gauge.d.ts +10 -1
  119. package/dist/components/gauge/gauge.js +41 -13
  120. package/dist/components/generation-status/generation-status.d.ts +117 -0
  121. package/dist/components/generation-status/generation-status.js +327 -0
  122. package/dist/components/generation-status/generation-status.styles.d.ts +1 -0
  123. package/dist/components/generation-status/generation-status.styles.js +84 -0
  124. package/dist/components/graph/graph.d.ts +37 -3
  125. package/dist/components/graph/graph.js +132 -20
  126. package/dist/components/heatmap/calendar-grid.d.ts +19 -7
  127. package/dist/components/heatmap/calendar-grid.js +42 -18
  128. package/dist/components/heatmap/heatmap-scale.d.ts +11 -1
  129. package/dist/components/heatmap/heatmap-scale.js +14 -2
  130. package/dist/components/heatmap/heatmap.d.ts +227 -12
  131. package/dist/components/heatmap/heatmap.js +488 -93
  132. package/dist/components/json-viewer/json-viewer.d.ts +70 -0
  133. package/dist/components/json-viewer/json-viewer.js +361 -0
  134. package/dist/components/json-viewer/json-viewer.styles.d.ts +1 -0
  135. package/dist/components/json-viewer/json-viewer.styles.js +177 -0
  136. package/dist/components/kbd/kbd.d.ts +77 -0
  137. package/dist/components/kbd/kbd.js +231 -0
  138. package/dist/components/kbd/kbd.styles.d.ts +1 -0
  139. package/dist/components/kbd/kbd.styles.js +52 -0
  140. package/dist/components/live-region/live-region.d.ts +90 -0
  141. package/dist/components/live-region/live-region.js +189 -0
  142. package/dist/components/live-region/live-region.styles.d.ts +1 -0
  143. package/dist/components/live-region/live-region.styles.js +10 -0
  144. package/dist/components/map/map.d.ts +32 -7
  145. package/dist/components/map/map.js +133 -32
  146. package/dist/components/markdown/markdown-loader.d.ts +58 -0
  147. package/dist/components/markdown/markdown-loader.js +77 -0
  148. package/dist/components/markdown/markdown.d.ts +119 -0
  149. package/dist/components/markdown/markdown.js +389 -0
  150. package/dist/components/markdown/markdown.styles.d.ts +1 -0
  151. package/dist/components/markdown/markdown.styles.js +88 -0
  152. package/dist/components/media-card/media-card.d.ts +130 -0
  153. package/dist/components/media-card/media-card.js +273 -0
  154. package/dist/components/media-card/media-card.styles.d.ts +1 -0
  155. package/dist/components/media-card/media-card.styles.js +132 -0
  156. package/dist/components/mention-popover/mention-popover.d.ts +203 -0
  157. package/dist/components/mention-popover/mention-popover.js +493 -0
  158. package/dist/components/mention-popover/mention-popover.styles.d.ts +1 -0
  159. package/dist/components/mention-popover/mention-popover.styles.js +101 -0
  160. package/dist/components/menu/menu-item.d.ts +91 -0
  161. package/dist/components/menu/menu-item.js +206 -0
  162. package/dist/components/menu/menu-item.styles.d.ts +1 -0
  163. package/dist/components/menu/menu-item.styles.js +75 -0
  164. package/dist/components/menu/menu.d.ts +167 -0
  165. package/dist/components/menu/menu.js +461 -0
  166. package/dist/components/menu/menu.styles.d.ts +1 -0
  167. package/dist/components/menu/menu.styles.js +67 -0
  168. package/dist/components/model-select/model-select.d.ts +170 -0
  169. package/dist/components/model-select/model-select.js +588 -0
  170. package/dist/components/model-select/model-select.styles.d.ts +1 -0
  171. package/dist/components/model-select/model-select.styles.js +203 -0
  172. package/dist/components/model-settings-panel/model-settings-panel.d.ts +93 -0
  173. package/dist/components/model-settings-panel/model-settings-panel.js +209 -0
  174. package/dist/components/model-settings-panel/model-settings-panel.styles.d.ts +1 -0
  175. package/dist/components/model-settings-panel/model-settings-panel.styles.js +82 -0
  176. package/dist/components/playback/playback.d.ts +19 -3
  177. package/dist/components/playback/playback.js +109 -33
  178. package/dist/components/playback/playback.styles.js +6 -1
  179. package/dist/components/responsive-panel/responsive-panel.d.ts +163 -0
  180. package/dist/components/responsive-panel/responsive-panel.js +363 -0
  181. package/dist/components/responsive-panel/responsive-panel.styles.d.ts +1 -0
  182. package/dist/components/responsive-panel/responsive-panel.styles.js +103 -0
  183. package/dist/components/result-card/result-card.d.ts +50 -0
  184. package/dist/components/result-card/result-card.js +89 -0
  185. package/dist/components/result-card/result-card.styles.d.ts +1 -0
  186. package/dist/components/result-card/result-card.styles.js +49 -0
  187. package/dist/components/result-card/result-field.d.ts +36 -0
  188. package/dist/components/result-card/result-field.js +87 -0
  189. package/dist/components/result-card/result-field.styles.d.ts +1 -0
  190. package/dist/components/result-card/result-field.styles.js +32 -0
  191. package/dist/components/select/select.d.ts +84 -4
  192. package/dist/components/select/select.js +251 -36
  193. package/dist/components/skeleton/skeleton.d.ts +3 -0
  194. package/dist/components/skeleton/skeleton.js +7 -1
  195. package/dist/components/skeleton/skeleton.styles.js +5 -4
  196. package/dist/components/slider/slider.d.ts +141 -0
  197. package/dist/components/slider/slider.js +467 -0
  198. package/dist/components/slider/slider.styles.d.ts +1 -0
  199. package/dist/components/slider/slider.styles.js +87 -0
  200. package/dist/components/source-card/source-card.d.ts +104 -0
  201. package/dist/components/source-card/source-card.js +195 -0
  202. package/dist/components/source-card/source-card.styles.d.ts +1 -0
  203. package/dist/components/source-card/source-card.styles.js +69 -0
  204. package/dist/components/source-list/source-list.d.ts +63 -0
  205. package/dist/components/source-list/source-list.js +130 -0
  206. package/dist/components/source-list/source-list.styles.d.ts +1 -0
  207. package/dist/components/source-list/source-list.styles.js +59 -0
  208. package/dist/components/sparkline/sparkline.js +58 -20
  209. package/dist/components/split/split.d.ts +224 -5
  210. package/dist/components/split/split.js +617 -43
  211. package/dist/components/split/split.styles.js +47 -0
  212. package/dist/components/stat/stat.d.ts +15 -4
  213. package/dist/components/stat/stat.js +53 -12
  214. package/dist/components/stream-status/stream-status.d.ts +126 -0
  215. package/dist/components/stream-status/stream-status.js +292 -0
  216. package/dist/components/stream-status/stream-status.styles.d.ts +1 -0
  217. package/dist/components/stream-status/stream-status.styles.js +103 -0
  218. package/dist/components/streaming-text/streaming-text.d.ts +104 -0
  219. package/dist/components/streaming-text/streaming-text.js +224 -0
  220. package/dist/components/streaming-text/streaming-text.styles.d.ts +1 -0
  221. package/dist/components/streaming-text/streaming-text.styles.js +63 -0
  222. package/dist/components/switch/switch.d.ts +103 -0
  223. package/dist/components/switch/switch.js +250 -0
  224. package/dist/components/switch/switch.styles.d.ts +1 -0
  225. package/dist/components/switch/switch.styles.js +75 -0
  226. package/dist/components/table/table.d.ts +89 -5
  227. package/dist/components/table/table.js +243 -26
  228. package/dist/components/table/table.styles.js +6 -1
  229. package/dist/components/tabs/tabs.d.ts +74 -0
  230. package/dist/components/tabs/tabs.js +254 -0
  231. package/dist/components/tabs/tabs.styles.d.ts +1 -0
  232. package/dist/components/tabs/tabs.styles.js +74 -0
  233. package/dist/components/thinking-panel/thinking-panel.d.ts +123 -0
  234. package/dist/components/thinking-panel/thinking-panel.js +260 -0
  235. package/dist/components/thinking-panel/thinking-panel.styles.d.ts +1 -0
  236. package/dist/components/thinking-panel/thinking-panel.styles.js +123 -0
  237. package/dist/components/time-range/time-range.d.ts +59 -2
  238. package/dist/components/time-range/time-range.js +163 -67
  239. package/dist/components/toast/toast-item.d.ts +12 -2
  240. package/dist/components/toast/toast-item.js +106 -44
  241. package/dist/components/toast/toast-item.styles.js +59 -28
  242. package/dist/components/toast/toast.js +17 -5
  243. package/dist/components/toast/toaster.js +10 -1
  244. package/dist/components/tool-approval-dialog/tool-approval-dialog.d.ts +131 -0
  245. package/dist/components/tool-approval-dialog/tool-approval-dialog.js +329 -0
  246. package/dist/components/tool-approval-dialog/tool-approval-dialog.styles.d.ts +1 -0
  247. package/dist/components/tool-approval-dialog/tool-approval-dialog.styles.js +160 -0
  248. package/dist/components/tool-call-chip/tool-call-chip.d.ts +105 -0
  249. package/dist/components/tool-call-chip/tool-call-chip.js +349 -0
  250. package/dist/components/tool-call-chip/tool-call-chip.styles.d.ts +1 -0
  251. package/dist/components/tool-call-chip/tool-call-chip.styles.js +203 -0
  252. package/dist/components/tool-param-form/tool-param-form.d.ts +206 -0
  253. package/dist/components/tool-param-form/tool-param-form.js +610 -0
  254. package/dist/components/tool-param-form/tool-param-form.styles.d.ts +1 -0
  255. package/dist/components/tool-param-form/tool-param-form.styles.js +75 -0
  256. package/dist/components/tool-result-dialog/tool-result-dialog.d.ts +122 -0
  257. package/dist/components/tool-result-dialog/tool-result-dialog.js +358 -0
  258. package/dist/components/tool-result-dialog/tool-result-dialog.styles.d.ts +1 -0
  259. package/dist/components/tool-result-dialog/tool-result-dialog.styles.js +176 -0
  260. package/dist/components/tool-result-view/registry.d.ts +73 -0
  261. package/dist/components/tool-result-view/registry.js +89 -0
  262. package/dist/components/tool-result-view/tool-result-view.d.ts +58 -0
  263. package/dist/components/tool-result-view/tool-result-view.js +152 -0
  264. package/dist/components/tool-result-view/tool-result-view.styles.d.ts +1 -0
  265. package/dist/components/tool-result-view/tool-result-view.styles.js +13 -0
  266. package/dist/components/tool-select-dialog/tool-select-dialog.d.ts +151 -0
  267. package/dist/components/tool-select-dialog/tool-select-dialog.js +350 -0
  268. package/dist/components/tool-select-dialog/tool-select-dialog.styles.d.ts +1 -0
  269. package/dist/components/tool-select-dialog/tool-select-dialog.styles.js +191 -0
  270. package/dist/components/tree/tree-node.d.ts +15 -3
  271. package/dist/components/tree/tree-node.js +20 -7
  272. package/dist/components/tree/tree.d.ts +25 -10
  273. package/dist/components/tree/tree.js +39 -31
  274. package/dist/components/typing-indicator/typing-indicator.d.ts +70 -0
  275. package/dist/components/typing-indicator/typing-indicator.js +108 -0
  276. package/dist/components/typing-indicator/typing-indicator.styles.d.ts +1 -0
  277. package/dist/components/typing-indicator/typing-indicator.styles.js +132 -0
  278. package/dist/components/virtual-list/virtual-list.d.ts +210 -0
  279. package/dist/components/virtual-list/virtual-list.js +607 -0
  280. package/dist/components/virtual-list/virtual-list.styles.d.ts +1 -0
  281. package/dist/components/virtual-list/virtual-list.styles.js +56 -0
  282. package/dist/components/widget/widget.d.ts +5 -4
  283. package/dist/components/widget/widget.js +54 -120
  284. package/dist/components/widget/widget.styles.js +8 -2
  285. package/dist/components/word-cloud/word-cloud-layout.d.ts +7 -0
  286. package/dist/components/word-cloud/word-cloud-layout.js +29 -2
  287. package/dist/components/word-cloud/word-cloud.d.ts +28 -2
  288. package/dist/components/word-cloud/word-cloud.js +69 -19
  289. package/dist/components/word-cloud/word-cloud.styles.js +16 -3
  290. package/dist/internal/anchored-validity.d.ts +1 -0
  291. package/dist/internal/anchored-validity.js +86 -0
  292. package/dist/internal/announcer.d.ts +57 -0
  293. package/dist/internal/announcer.js +71 -0
  294. package/dist/internal/form-associated.d.ts +8 -0
  295. package/dist/internal/form-associated.js +98 -15
  296. package/dist/internal/group-by-recency.d.ts +50 -0
  297. package/dist/internal/group-by-recency.js +80 -0
  298. package/dist/internal/numbers.d.ts +12 -0
  299. package/dist/internal/numbers.js +26 -0
  300. package/dist/internal/overlay-manager.d.ts +51 -0
  301. package/dist/internal/overlay-manager.js +523 -0
  302. package/dist/internal/positioner.js +27 -3
  303. package/dist/internal/rtl.d.ts +23 -0
  304. package/dist/internal/rtl.js +28 -0
  305. package/dist/internal/safe-url.d.ts +12 -0
  306. package/dist/internal/safe-url.js +41 -0
  307. package/dist/internal/scroll-lock.d.ts +10 -5
  308. package/dist/internal/scroll-lock.js +30 -14
  309. package/dist/internal/tokens.styles.js +22 -10
  310. package/dist/lyra.d.ts +133 -31
  311. package/dist/lyra.js +96 -26
  312. package/llms-full.txt +4546 -183
  313. package/llms.txt +21 -5
  314. package/package.json +41 -6
  315. package/dist/components/chart/bar-chart.stories.d.ts +0 -5
  316. package/dist/components/chart/bar-chart.stories.js +0 -20
  317. package/dist/components/chart/box-plot.stories.d.ts +0 -5
  318. package/dist/components/chart/box-plot.stories.js +0 -29
  319. package/dist/components/chart/bubble-chart.stories.d.ts +0 -5
  320. package/dist/components/chart/bubble-chart.stories.js +0 -26
  321. package/dist/components/chart/chart.stories.d.ts +0 -32
  322. package/dist/components/chart/chart.stories.js +0 -141
  323. package/dist/components/chart/doughnut-chart.stories.d.ts +0 -5
  324. package/dist/components/chart/doughnut-chart.stories.js +0 -26
  325. package/dist/components/chart/histogram.stories.d.ts +0 -5
  326. package/dist/components/chart/histogram.stories.js +0 -17
  327. package/dist/components/chart/line-chart.stories.d.ts +0 -22
  328. package/dist/components/chart/line-chart.stories.js +0 -99
  329. package/dist/components/chart/lite-chart.stories.d.ts +0 -14
  330. package/dist/components/chart/lite-chart.stories.js +0 -114
  331. package/dist/components/chart/pie-chart.stories.d.ts +0 -5
  332. package/dist/components/chart/pie-chart.stories.js +0 -26
  333. package/dist/components/chart/polar-area-chart.stories.d.ts +0 -5
  334. package/dist/components/chart/polar-area-chart.stories.js +0 -20
  335. package/dist/components/chart/radar-chart.stories.d.ts +0 -5
  336. package/dist/components/chart/radar-chart.stories.js +0 -20
  337. package/dist/components/chart/scatter-chart.stories.d.ts +0 -5
  338. package/dist/components/chart/scatter-chart.stories.js +0 -31
  339. package/dist/components/combobox/combobox.stories.d.ts +0 -24
  340. package/dist/components/combobox/combobox.stories.js +0 -102
  341. package/dist/components/date-picker/date-input.stories.d.ts +0 -10
  342. package/dist/components/date-picker/date-input.stories.js +0 -48
  343. package/dist/components/date-picker/date-picker.stories.d.ts +0 -10
  344. package/dist/components/date-picker/date-picker.stories.js +0 -25
  345. package/dist/components/empty/empty.stories.d.ts +0 -7
  346. package/dist/components/empty/empty.stories.js +0 -34
  347. package/dist/components/export-button/export-button.stories.d.ts +0 -7
  348. package/dist/components/export-button/export-button.stories.js +0 -37
  349. package/dist/components/file-input/file-input.stories.d.ts +0 -7
  350. package/dist/components/file-input/file-input.stories.js +0 -19
  351. package/dist/components/flag/flag.stories.d.ts +0 -6
  352. package/dist/components/flag/flag.stories.js +0 -31
  353. package/dist/components/gauge/gauge.stories.d.ts +0 -8
  354. package/dist/components/gauge/gauge.stories.js +0 -19
  355. package/dist/components/graph/graph.stories.d.ts +0 -8
  356. package/dist/components/graph/graph.stories.js +0 -68
  357. package/dist/components/heatmap/heatmap.stories.d.ts +0 -27
  358. package/dist/components/heatmap/heatmap.stories.js +0 -179
  359. package/dist/components/map/map.stories.d.ts +0 -15
  360. package/dist/components/map/map.stories.js +0 -135
  361. package/dist/components/playback/playback.stories.d.ts +0 -7
  362. package/dist/components/playback/playback.stories.js +0 -16
  363. package/dist/components/select/select.stories.d.ts +0 -21
  364. package/dist/components/select/select.stories.js +0 -91
  365. package/dist/components/skeleton/skeleton.stories.d.ts +0 -5
  366. package/dist/components/skeleton/skeleton.stories.js +0 -16
  367. package/dist/components/sparkline/sparkline.stories.d.ts +0 -11
  368. package/dist/components/sparkline/sparkline.stories.js +0 -39
  369. package/dist/components/split/split.stories.d.ts +0 -7
  370. package/dist/components/split/split.stories.js +0 -36
  371. package/dist/components/stat/stat.stories.d.ts +0 -9
  372. package/dist/components/stat/stat.stories.js +0 -81
  373. package/dist/components/table/table.stories.d.ts +0 -12
  374. package/dist/components/table/table.stories.js +0 -67
  375. package/dist/components/time-range/time-range.stories.d.ts +0 -8
  376. package/dist/components/time-range/time-range.stories.js +0 -26
  377. package/dist/components/toast/toast.stories.d.ts +0 -8
  378. package/dist/components/toast/toast.stories.js +0 -72
  379. package/dist/components/tree/tree.stories.d.ts +0 -9
  380. package/dist/components/tree/tree.stories.js +0 -52
  381. package/dist/components/widget/widget.stories.d.ts +0 -9
  382. package/dist/components/widget/widget.stories.js +0 -74
  383. package/dist/components/word-cloud/word-cloud.stories.d.ts +0 -10
  384. package/dist/components/word-cloud/word-cloud.stories.js +0 -55
@@ -0,0 +1,160 @@
1
+ import { css } from 'lit';
2
+ export const styles = css `
3
+ :host {
4
+ /* Backdrop scrim color -- component-specific so a host can retheme it
5
+ without a raw literal leaking into the public API (no shared
6
+ --wa-*-overlay token exists in the design system to resolve through,
7
+ same rationale as lyra-dialog's --lyra-dialog-overlay-color and
8
+ lyra-tool-select-dialog's --lyra-tool-select-dialog-overlay-color). */
9
+ --lyra-tool-approval-dialog-overlay-color: rgb(0 0 0 / 0.5);
10
+ /* Contained here (rather than a bare font-family literal on the
11
+ textarea) so a host page can retheme it -- same rationale as
12
+ lyra-json-viewer's --lyra-json-viewer-font; raw args are code, not
13
+ prose, so the editor gets the same monospace treatment as that
14
+ viewer's own tree rendering. */
15
+ --lyra-tool-approval-dialog-mono-font: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
16
+ display: none;
17
+ position: fixed;
18
+ inset: 0;
19
+ z-index: var(--lyra-overlay-stack-index, 1000);
20
+ align-items: center;
21
+ justify-content: center;
22
+ padding: var(--lyra-space-l);
23
+ }
24
+ :host([open]) {
25
+ display: flex;
26
+ }
27
+ [part='backdrop'] {
28
+ position: absolute;
29
+ inset: 0;
30
+ background: var(--lyra-tool-approval-dialog-overlay-color);
31
+ }
32
+ [part='panel'] {
33
+ position: relative;
34
+ display: flex;
35
+ flex-direction: column;
36
+ inline-size: min(32rem, 100%);
37
+ max-block-size: min(36rem, 100%);
38
+ background: var(--lyra-color-surface);
39
+ border: 1px solid var(--lyra-color-border);
40
+ border-radius: var(--lyra-radius);
41
+ box-shadow: var(--lyra-shadow);
42
+ overflow: hidden;
43
+ }
44
+ [part='header'] {
45
+ padding: var(--lyra-space-l) var(--lyra-space-l) 0;
46
+ }
47
+ [part='header'] h2 {
48
+ margin: 0;
49
+ font-size: 1.0625rem;
50
+ font-weight: 600;
51
+ }
52
+ [part='tool-name'] {
53
+ font-family: var(--lyra-tool-approval-dialog-mono-font);
54
+ font-weight: 700;
55
+ color: var(--lyra-color-brand);
56
+ word-break: break-word;
57
+ }
58
+
59
+ [part='body'] {
60
+ flex: 1 1 auto;
61
+ min-block-size: 0;
62
+ display: flex;
63
+ flex-direction: column;
64
+ gap: var(--lyra-space-xs);
65
+ padding: var(--lyra-space-m) var(--lyra-space-l) var(--lyra-space-l);
66
+ overflow: auto;
67
+ }
68
+ [part='args-view'] {
69
+ /* lyra-json-viewer grows with its content by default (its own
70
+ max-height is 'none'); this component's [part='body'] is what caps
71
+ and scrolls it instead, so it stays consistent with the plain
72
+ [part='args-editor'] textarea below, which has no scroll cap of its
73
+ own either. */
74
+ flex: 1 1 auto;
75
+ min-block-size: 0;
76
+ }
77
+ [part='args-editor'] {
78
+ flex: 1 1 auto;
79
+ min-block-size: 10rem;
80
+ box-sizing: border-box;
81
+ resize: vertical;
82
+ padding: var(--lyra-space-s) var(--lyra-space-m);
83
+ border: 1px solid var(--lyra-color-border);
84
+ border-radius: var(--lyra-radius);
85
+ background: var(--lyra-color-surface);
86
+ color: inherit;
87
+ font-family: var(--lyra-tool-approval-dialog-mono-font);
88
+ font-size: 0.8125rem;
89
+ line-height: 1.5;
90
+ }
91
+ [part='args-editor']:focus-visible {
92
+ outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
93
+ outline-offset: var(--lyra-focus-ring-offset);
94
+ }
95
+ [part='args-editor'][aria-invalid='true'] {
96
+ border-color: var(--lyra-color-danger);
97
+ }
98
+ [part='error'] {
99
+ margin: 0;
100
+ font-size: 0.8125rem;
101
+ color: var(--lyra-color-danger);
102
+ }
103
+ [part='error'][hidden] {
104
+ display: none;
105
+ }
106
+
107
+ [part='footer'] {
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: flex-end;
111
+ gap: var(--lyra-space-s);
112
+ padding: var(--lyra-space-m) var(--lyra-space-l);
113
+ border-block-start: 1px solid var(--lyra-color-border);
114
+ }
115
+ [part='footer'] ::slotted(*) {
116
+ /* Any consumer-supplied footer content sits ahead of the built-in
117
+ buttons and soaks up the row's remaining space, so it reads as
118
+ start-aligned while Deny/Edit/Approve stay pinned to the end (the
119
+ row itself is justify-content: flex-end for the empty-slot case). */
120
+ margin-inline-end: auto;
121
+ }
122
+
123
+ [part='deny-button'],
124
+ [part='edit-button'],
125
+ [part='approve-button'] {
126
+ font: inherit;
127
+ font-size: 0.875rem;
128
+ padding: var(--lyra-space-xs) var(--lyra-space-m);
129
+ border-radius: var(--lyra-radius);
130
+ cursor: pointer;
131
+ border: 1px solid var(--lyra-color-border);
132
+ }
133
+ [part='deny-button'],
134
+ [part='edit-button'] {
135
+ background: var(--lyra-color-surface);
136
+ color: var(--lyra-color-text);
137
+ }
138
+ [part='deny-button']:hover,
139
+ [part='edit-button']:hover {
140
+ background: var(--lyra-color-brand-quiet);
141
+ }
142
+ [part='approve-button'] {
143
+ background: var(--lyra-color-brand);
144
+ color: var(--lyra-color-on-brand);
145
+ border-color: var(--lyra-color-brand);
146
+ }
147
+ [part='approve-button']:hover:not(:disabled) {
148
+ filter: brightness(1.1);
149
+ }
150
+ [part='approve-button']:disabled {
151
+ cursor: not-allowed;
152
+ opacity: var(--lyra-opacity-disabled);
153
+ }
154
+ [part='deny-button']:focus-visible,
155
+ [part='edit-button']:focus-visible,
156
+ [part='approve-button']:focus-visible {
157
+ outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
158
+ outline-offset: var(--lyra-focus-ring-offset);
159
+ }
160
+ `;
@@ -0,0 +1,105 @@
1
+ import { type TemplateResult, type PropertyValues } from 'lit';
2
+ import { LyraElement } from '../../internal/lyra-element.js';
3
+ /** Same status vocabulary as `<lyra-tool-result-dialog>`, so a call's chip
4
+ * and its detail dialog always agree on icon/label/tone. */
5
+ export type ToolCallStatus = 'pending' | 'running' | 'success' | 'error' | 'denied';
6
+ export interface ToolChipSelectDetail {
7
+ name: string;
8
+ callId: string;
9
+ }
10
+ /**
11
+ * `<lyra-tool-call-chip>` — a compact inline pill representing one tool/
12
+ * function call an agent made mid-conversation, e.g.
13
+ * `web_search: Searching web…` with a `running` spinner. It owns no detail
14
+ * surface of its own: clicking (or Enter/Space-activating) it only fires
15
+ * `lyra-tool-chip-select` — a consumer wires that to opening a
16
+ * `<lyra-tool-result-dialog>` (or anything else) at the call site. Keeping
17
+ * the two decoupled means a chip can be reused wherever a compact call
18
+ * summary is useful, with or without a detail surface behind it.
19
+ *
20
+ * The default slot is *not* the chip's visible content — the chip's own
21
+ * label is always built from `name`/`summary`/`status`/`duration-ms`. It's
22
+ * reserved for optional rich detail content (e.g. the tool's raw arguments,
23
+ * a short preview) shown in a floating tooltip on hover/focus, positioned
24
+ * with `internal/positioner.js`'s `place()` the same way `<lyra-combobox>`
25
+ * positions its listbox. No tooltip is shown at all when the slot carries no
26
+ * content — hovering an empty chip does nothing. Hover and keyboard focus are
27
+ * tracked as independent reasons to keep the tooltip open (mirrors
28
+ * `<lyra-citation-badge>`'s popover), so releasing one modality while the
29
+ * other is still active doesn't close it, and the trigger button's
30
+ * `aria-describedby` points at the tooltip's id whenever it's open and has
31
+ * content, so the association reaches assistive tech too.
32
+ *
33
+ * The `icon` slot overrides the built-in per-status glyph entirely via the
34
+ * platform's own slot-fallback-content mechanism (`<slot
35
+ * name="icon">${fallback}</slot>` — the same pattern `<lyra-stat>`'s
36
+ * `caption` slot and `<lyra-file-input>`'s default slot already use):
37
+ * whatever is assigned to `slot="icon"` wins; otherwise the `icon` prop is
38
+ * rendered as a literal hint (e.g. an emoji); otherwise the built-in glyph
39
+ * for the current `status` is used.
40
+ *
41
+ * @customElement lyra-tool-call-chip
42
+ * @slot - Rich tooltip/detail content, shown on hover/focus. Nothing renders
43
+ * (no hover affordance at all) when this slot is empty.
44
+ * @slot icon - Overrides the built-in status glyph entirely.
45
+ * @event lyra-tool-chip-select - The chip was activated (click or Enter/Space
46
+ * while focused). `detail: { name, callId }`.
47
+ * @csspart base - The clickable pill (`<button>`).
48
+ * @csspart icon - Wrapper around the status glyph / `icon` slot.
49
+ * @csspart label - Wrapper around `category`, `name` and `summary`.
50
+ * @csspart category - The optional grouping label.
51
+ * @csspart name - The tool/function name.
52
+ * @csspart summary - The short status text.
53
+ * @csspart meta - Wrapper around `status-text` and `duration`.
54
+ * @csspart status-text - The visible text twin of the status glyph/color — carries the state in text, not just color.
55
+ * @csspart duration - The formatted `duration-ms`, when set.
56
+ * @csspart tooltip - The floating detail popup (only meaningful while open).
57
+ */
58
+ export declare class LyraToolCallChip extends LyraElement {
59
+ static styles: import("lit").CSSResultGroup[];
60
+ /** The tool/function name, e.g. `web_search`. */
61
+ name: string;
62
+ /** Optional grouping label, e.g. `research`. */
63
+ category: string;
64
+ /**
65
+ * The call's current lifecycle state — drives the glyph, color, and
66
+ * `status-text`. Invalid runtime values use the pending presentation.
67
+ */
68
+ status: ToolCallStatus;
69
+ /** Short human-readable status text, e.g. `Searching web…`. */
70
+ summary: string;
71
+ /** How long the call took, in milliseconds. Omitted from the chip entirely when unset. */
72
+ durationMs?: number;
73
+ /** Literal icon hint (e.g. an emoji) used when the `icon` slot is empty — see the class doc's
74
+ * icon-precedence note. Ignored once anything is assigned to `slot="icon"`. */
75
+ icon: string;
76
+ /** Unique identifier for this specific invocation — echoed back in `lyra-tool-chip-select`'s
77
+ * detail so a listener can correlate the click with the call it fired for. */
78
+ callId: string;
79
+ private hasDetailSlot;
80
+ private tooltipOpen;
81
+ private readonly tooltipId;
82
+ private cleanupPositioner?;
83
+ private hovering;
84
+ private focused;
85
+ protected willUpdate(): void;
86
+ protected updated(changed: PropertyValues): void;
87
+ disconnectedCallback(): void;
88
+ private onDetailSlotChange;
89
+ private showTooltip;
90
+ private hideTooltip;
91
+ private onMouseEnter;
92
+ private onMouseLeave;
93
+ private onFocus;
94
+ private onBlur;
95
+ private onKeyDown;
96
+ private onClick;
97
+ private get effectiveStatus();
98
+ private get accessibleLabel();
99
+ render(): TemplateResult;
100
+ }
101
+ declare global {
102
+ interface HTMLElementTagNameMap {
103
+ 'lyra-tool-call-chip': LyraToolCallChip;
104
+ }
105
+ }
@@ -0,0 +1,349 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { html, svg, nothing, } from 'lit';
8
+ import { property, state } from 'lit/decorators.js';
9
+ import { LyraElement } from '../../internal/lyra-element.js';
10
+ import { defineElement } from '../../internal/prefix.js';
11
+ import { place } from '../../internal/positioner.js';
12
+ import { nextId } from '../../internal/a11y.js';
13
+ import { styles } from './tool-call-chip.styles.js';
14
+ // Mirrors the shared icon set's viewBox/stroke conventions
15
+ // (internal/icons.ts's chevronIcon()/closeIcon()/etc.) without adding
16
+ // tool-call-specific glyphs to that module -- it's off limits here -- so
17
+ // these still read as part of the same visual language as the rest of the
18
+ // library's inline icons. Same approach lyra-checkbox's/lyra-chat-message's
19
+ // own local glyphs take for the identical reason, and deliberately the same
20
+ // shapes lyra-tool-result-dialog's own local glyphs use, so a call reads
21
+ // identically whether it's shown as this inline chip or in that dialog.
22
+ const ICON_VIEW_BOX = '0 0 24 24';
23
+ const ICON_STROKE_WIDTH = '1.75';
24
+ function icon(paths) {
25
+ return svg `
26
+ <svg
27
+ width="1em"
28
+ height="1em"
29
+ viewBox=${ICON_VIEW_BOX}
30
+ fill="none"
31
+ stroke="currentColor"
32
+ stroke-width=${ICON_STROKE_WIDTH}
33
+ stroke-linecap="round"
34
+ stroke-linejoin="round"
35
+ aria-hidden="true"
36
+ focusable="false"
37
+ >${paths}</svg>
38
+ `;
39
+ }
40
+ function pendingIcon() {
41
+ return icon(svg `<circle cx="12" cy="12" r="9"></circle><polyline points="12 7 12 12 15 14"></polyline>`);
42
+ }
43
+ /** A three-quarter arc, spun by the `:host([status="running"]) [part="icon"] svg`
44
+ * CSS animation -- a full circle wouldn't visibly convey rotation. */
45
+ function runningIcon() {
46
+ return icon(svg `<path d="M21 12a9 9 0 1 1-9-9"></path>`);
47
+ }
48
+ function successIcon() {
49
+ return icon(svg `<circle cx="12" cy="12" r="9"></circle><polyline points="8 12.5 11 15.5 16 9.5"></polyline>`);
50
+ }
51
+ function errorIcon() {
52
+ return icon(svg `
53
+ <circle cx="12" cy="12" r="9"></circle>
54
+ <line x1="9" y1="9" x2="15" y2="15"></line>
55
+ <line x1="15" y1="9" x2="9" y2="15"></line>
56
+ `);
57
+ }
58
+ /** A "blocked" glyph (circle + diagonal slash) -- distinct from `errorIcon()`
59
+ * since a denial is a policy rejection, not a runtime failure. */
60
+ function deniedIcon() {
61
+ return icon(svg `<circle cx="12" cy="12" r="9"></circle><line x1="6" y1="18" x2="18" y2="6"></line>`);
62
+ }
63
+ const STATUS_ICON = {
64
+ pending: pendingIcon,
65
+ running: runningIcon,
66
+ success: successIcon,
67
+ error: errorIcon,
68
+ denied: deniedIcon,
69
+ };
70
+ /** Visible (not just color-coded) text for every status. */
71
+ const STATUS_LABEL = {
72
+ pending: 'Pending',
73
+ running: 'Running',
74
+ success: 'Success',
75
+ error: 'Error',
76
+ denied: 'Denied',
77
+ };
78
+ const STATUS_VALUES = new Set(Object.keys(STATUS_LABEL));
79
+ const statusConverter = {
80
+ fromAttribute(value) {
81
+ return value !== null && STATUS_VALUES.has(value) ? value : 'pending';
82
+ },
83
+ toAttribute(value) {
84
+ return value;
85
+ },
86
+ };
87
+ /** `820` -> `"820ms"`; `1500` -> `"1.5s"`; `2000` -> `"2s"`. Sub-second
88
+ * durations are the common case for a single tool call, so they get the
89
+ * more precise unit; once a call runs a full second or longer, trimming to
90
+ * (at most) one decimal place of seconds reads better than a 4-5 digit
91
+ * millisecond count. Identical algorithm to lyra-tool-result-dialog's own
92
+ * `formatDuration` -- duplicated rather than imported (these are two
93
+ * independent, separately-consumable components; see this file's header
94
+ * comment on the icon glyphs for the same rationale) but kept in lockstep
95
+ * so the same call reports the same duration text in both places. */
96
+ function formatDuration(ms) {
97
+ if (!Number.isFinite(ms) || ms < 1000) {
98
+ return `${Math.round(Math.max(0, ms))}ms`;
99
+ }
100
+ const seconds = ms / 1000;
101
+ const rounded = Math.round(seconds * 10) / 10;
102
+ return `${Number.isInteger(rounded) ? rounded.toFixed(0) : rounded.toFixed(1)}s`;
103
+ }
104
+ /**
105
+ * `<lyra-tool-call-chip>` — a compact inline pill representing one tool/
106
+ * function call an agent made mid-conversation, e.g.
107
+ * `web_search: Searching web…` with a `running` spinner. It owns no detail
108
+ * surface of its own: clicking (or Enter/Space-activating) it only fires
109
+ * `lyra-tool-chip-select` — a consumer wires that to opening a
110
+ * `<lyra-tool-result-dialog>` (or anything else) at the call site. Keeping
111
+ * the two decoupled means a chip can be reused wherever a compact call
112
+ * summary is useful, with or without a detail surface behind it.
113
+ *
114
+ * The default slot is *not* the chip's visible content — the chip's own
115
+ * label is always built from `name`/`summary`/`status`/`duration-ms`. It's
116
+ * reserved for optional rich detail content (e.g. the tool's raw arguments,
117
+ * a short preview) shown in a floating tooltip on hover/focus, positioned
118
+ * with `internal/positioner.js`'s `place()` the same way `<lyra-combobox>`
119
+ * positions its listbox. No tooltip is shown at all when the slot carries no
120
+ * content — hovering an empty chip does nothing. Hover and keyboard focus are
121
+ * tracked as independent reasons to keep the tooltip open (mirrors
122
+ * `<lyra-citation-badge>`'s popover), so releasing one modality while the
123
+ * other is still active doesn't close it, and the trigger button's
124
+ * `aria-describedby` points at the tooltip's id whenever it's open and has
125
+ * content, so the association reaches assistive tech too.
126
+ *
127
+ * The `icon` slot overrides the built-in per-status glyph entirely via the
128
+ * platform's own slot-fallback-content mechanism (`<slot
129
+ * name="icon">${fallback}</slot>` — the same pattern `<lyra-stat>`'s
130
+ * `caption` slot and `<lyra-file-input>`'s default slot already use):
131
+ * whatever is assigned to `slot="icon"` wins; otherwise the `icon` prop is
132
+ * rendered as a literal hint (e.g. an emoji); otherwise the built-in glyph
133
+ * for the current `status` is used.
134
+ *
135
+ * @customElement lyra-tool-call-chip
136
+ * @slot - Rich tooltip/detail content, shown on hover/focus. Nothing renders
137
+ * (no hover affordance at all) when this slot is empty.
138
+ * @slot icon - Overrides the built-in status glyph entirely.
139
+ * @event lyra-tool-chip-select - The chip was activated (click or Enter/Space
140
+ * while focused). `detail: { name, callId }`.
141
+ * @csspart base - The clickable pill (`<button>`).
142
+ * @csspart icon - Wrapper around the status glyph / `icon` slot.
143
+ * @csspart label - Wrapper around `category`, `name` and `summary`.
144
+ * @csspart category - The optional grouping label.
145
+ * @csspart name - The tool/function name.
146
+ * @csspart summary - The short status text.
147
+ * @csspart meta - Wrapper around `status-text` and `duration`.
148
+ * @csspart status-text - The visible text twin of the status glyph/color — carries the state in text, not just color.
149
+ * @csspart duration - The formatted `duration-ms`, when set.
150
+ * @csspart tooltip - The floating detail popup (only meaningful while open).
151
+ */
152
+ export class LyraToolCallChip extends LyraElement {
153
+ constructor() {
154
+ super(...arguments);
155
+ /** The tool/function name, e.g. `web_search`. */
156
+ this.name = '';
157
+ /** Optional grouping label, e.g. `research`. */
158
+ this.category = '';
159
+ /**
160
+ * The call's current lifecycle state — drives the glyph, color, and
161
+ * `status-text`. Invalid runtime values use the pending presentation.
162
+ */
163
+ this.status = 'pending';
164
+ /** Short human-readable status text, e.g. `Searching web…`. */
165
+ this.summary = '';
166
+ /** Literal icon hint (e.g. an emoji) used when the `icon` slot is empty — see the class doc's
167
+ * icon-precedence note. Ignored once anything is assigned to `slot="icon"`. */
168
+ this.icon = '';
169
+ /** Unique identifier for this specific invocation — echoed back in `lyra-tool-chip-select`'s
170
+ * detail so a listener can correlate the click with the call it fired for. */
171
+ this.callId = '';
172
+ // Same fix lyra-stat's hasIcon/lyra-combobox's hasHintSlot etc. already
173
+ // establish: a `[part]` always contains a literal `<slot>` child regardless
174
+ // of assigned content, so `:empty` never matches -- real emptiness is
175
+ // tracked in JS instead. Only element children count (mirrors lyra-stat's
176
+ // identical default-slot check) since the tooltip's rich content is
177
+ // expected to be markup, not a bare text node.
178
+ this.hasDetailSlot = false;
179
+ this.tooltipOpen = false;
180
+ this.tooltipId = nextId('tool-call-chip-tooltip');
181
+ // Hover and focus are tracked as independent "keep it open" reasons --
182
+ // mirrors lyra-citation-badge's identical hovering/focused pair for the
183
+ // same hover/focus preview-popover pattern -- so releasing one (e.g. the
184
+ // pointer leaving while the chip still has keyboard focus) doesn't close a
185
+ // tooltip the other modality is still holding open.
186
+ this.hovering = false;
187
+ this.focused = false;
188
+ this.onDetailSlotChange = (e) => {
189
+ this.hasDetailSlot = e.target.assignedElements({ flatten: true }).length > 0;
190
+ // The slot can be emptied out from under an already-open tooltip (e.g. a
191
+ // consumer clearing streamed/async preview content) -- nothing left to
192
+ // show, so don't leave an empty tooltip floating open regardless of
193
+ // whether hover/focus is still active.
194
+ if (!this.hasDetailSlot)
195
+ this.hideTooltip();
196
+ };
197
+ this.onMouseEnter = () => {
198
+ this.hovering = true;
199
+ this.showTooltip();
200
+ };
201
+ this.onMouseLeave = () => {
202
+ this.hovering = false;
203
+ if (this.focused)
204
+ return;
205
+ this.hideTooltip();
206
+ };
207
+ this.onFocus = () => {
208
+ this.focused = true;
209
+ this.showTooltip();
210
+ };
211
+ this.onBlur = () => {
212
+ this.focused = false;
213
+ if (this.hovering)
214
+ return;
215
+ this.hideTooltip();
216
+ };
217
+ this.onKeyDown = (e) => {
218
+ // The native <button> already handles Enter/Space activation on its
219
+ // own -- this only needs to cover dismissing the (non-native) tooltip,
220
+ // the same Escape-to-close convention every other popup in this library
221
+ // follows (see lyra-combobox's onKeyDown). Unconditional close (not
222
+ // gated on hovering/focused) since Escape is a deliberate dismissal, not
223
+ // transient pointer/focus travel.
224
+ if (e.key === 'Escape' && this.tooltipOpen) {
225
+ e.stopPropagation();
226
+ this.hideTooltip();
227
+ }
228
+ };
229
+ this.onClick = () => {
230
+ this.emit('lyra-tool-chip-select', { name: this.name, callId: this.callId });
231
+ };
232
+ }
233
+ static { this.styles = [LyraElement.styles, styles]; }
234
+ willUpdate() {
235
+ if (!this.hasUpdated) {
236
+ this.hasDetailSlot = Array.from(this.children).some((el) => !el.hasAttribute('slot'));
237
+ }
238
+ }
239
+ updated(changed) {
240
+ if (changed.has('tooltipOpen')) {
241
+ this.cleanupPositioner?.();
242
+ this.cleanupPositioner = undefined;
243
+ if (this.tooltipOpen) {
244
+ const anchor = this.renderRoot.querySelector('[part="base"]');
245
+ const tooltip = this.renderRoot.querySelector('[part="tooltip"]');
246
+ if (anchor && tooltip)
247
+ this.cleanupPositioner = place(anchor, tooltip, { placement: 'top-start' });
248
+ }
249
+ }
250
+ }
251
+ disconnectedCallback() {
252
+ super.disconnectedCallback();
253
+ this.cleanupPositioner?.();
254
+ }
255
+ showTooltip() {
256
+ if (!this.hasDetailSlot || this.tooltipOpen)
257
+ return;
258
+ this.tooltipOpen = true;
259
+ }
260
+ // Called both as the actual (unconditional) close -- from onDetailSlotChange
261
+ // and the Escape handler below, where the tooltip must close regardless of
262
+ // hover/focus state -- and from onMouseLeave/onBlur once each has already
263
+ // confirmed the *other* modality isn't still holding the tooltip open. The
264
+ // default slot is documented as read-only preview content (raw args, a
265
+ // short snippet), not an interactive surface meant to retain focus/hover of
266
+ // its own, so there's no "did the pointer move into the tooltip itself"
267
+ // check needed beyond the hovering/focused pair.
268
+ hideTooltip() {
269
+ if (!this.tooltipOpen)
270
+ return;
271
+ this.tooltipOpen = false;
272
+ }
273
+ get effectiveStatus() {
274
+ return STATUS_VALUES.has(this.status) ? this.status : 'pending';
275
+ }
276
+ get accessibleLabel() {
277
+ const parts = [this.name || 'Tool call'];
278
+ if (this.summary)
279
+ parts.push(this.summary);
280
+ parts.push(STATUS_LABEL[this.effectiveStatus]);
281
+ if (this.durationMs != null && Number.isFinite(this.durationMs))
282
+ parts.push(formatDuration(this.durationMs));
283
+ return parts.join(' — ');
284
+ }
285
+ render() {
286
+ const hasCategory = this.category.length > 0;
287
+ const hasSummary = this.summary.length > 0;
288
+ const hasDuration = this.durationMs != null && Number.isFinite(this.durationMs);
289
+ const status = this.effectiveStatus;
290
+ return html `
291
+ <button
292
+ part="base"
293
+ type="button"
294
+ aria-label=${this.getAttribute('aria-label') || this.accessibleLabel}
295
+ aria-describedby=${this.hasDetailSlot && this.tooltipOpen ? this.tooltipId : nothing}
296
+ @click=${this.onClick}
297
+ @mouseenter=${this.onMouseEnter}
298
+ @mouseleave=${this.onMouseLeave}
299
+ @focus=${this.onFocus}
300
+ @blur=${this.onBlur}
301
+ @keydown=${this.onKeyDown}
302
+ >
303
+ <span part="icon" aria-hidden="true">
304
+ <slot name="icon">${this.icon ? this.icon : STATUS_ICON[status]()}</slot>
305
+ </span>
306
+ <span part="label">
307
+ <span part="category" ?hidden=${!hasCategory}>${this.category}</span>
308
+ <span part="name">${this.name || 'Tool call'}</span>
309
+ <span part="summary" ?hidden=${!hasSummary}>${this.summary}</span>
310
+ </span>
311
+ <span part="meta">
312
+ <span part="status-text">${STATUS_LABEL[status]}</span>
313
+ <span part="duration" ?hidden=${!hasDuration}>${hasDuration ? formatDuration(this.durationMs) : nothing}</span>
314
+ </span>
315
+ </button>
316
+ <div part="tooltip" id=${this.tooltipId} role="tooltip" ?hidden=${!this.tooltipOpen}>
317
+ <slot @slotchange=${this.onDetailSlotChange}></slot>
318
+ </div>
319
+ `;
320
+ }
321
+ }
322
+ __decorate([
323
+ property()
324
+ ], LyraToolCallChip.prototype, "name", void 0);
325
+ __decorate([
326
+ property()
327
+ ], LyraToolCallChip.prototype, "category", void 0);
328
+ __decorate([
329
+ property({ reflect: true, converter: statusConverter })
330
+ ], LyraToolCallChip.prototype, "status", void 0);
331
+ __decorate([
332
+ property()
333
+ ], LyraToolCallChip.prototype, "summary", void 0);
334
+ __decorate([
335
+ property({ type: Number, attribute: 'duration-ms' })
336
+ ], LyraToolCallChip.prototype, "durationMs", void 0);
337
+ __decorate([
338
+ property()
339
+ ], LyraToolCallChip.prototype, "icon", void 0);
340
+ __decorate([
341
+ property({ attribute: 'call-id' })
342
+ ], LyraToolCallChip.prototype, "callId", void 0);
343
+ __decorate([
344
+ state()
345
+ ], LyraToolCallChip.prototype, "hasDetailSlot", void 0);
346
+ __decorate([
347
+ state()
348
+ ], LyraToolCallChip.prototype, "tooltipOpen", void 0);
349
+ defineElement('tool-call-chip', LyraToolCallChip);
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;