@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,273 @@
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, nothing, svg } from 'lit';
8
+ import { property } from 'lit/decorators.js';
9
+ import { LyraElement } from '../../internal/lyra-element.js';
10
+ import { defineElement } from '../../internal/prefix.js';
11
+ import { expandIcon } from '../../internal/icons.js';
12
+ import { safeLinkHref as validateLinkHref, safeMediaSrc as validateMediaSrc, } from '../../internal/safe-url.js';
13
+ import { styles } from './media-card.styles.js';
14
+ /** Validates `url` for an `<img>`/`<video>` source. Kept as a public wrapper
15
+ * so existing imports and generated API metadata remain stable. */
16
+ export function safeMediaSrc(url) {
17
+ return validateMediaSrc(url);
18
+ }
19
+ /** Validates `url` for the library's download/open link sinks. Kept as a
20
+ * public wrapper so existing imports and generated API metadata remain stable. */
21
+ export function safeLinkHref(url) {
22
+ return validateLinkHref(url);
23
+ }
24
+ function detectKind(mimeType) {
25
+ const mt = mimeType.trim().toLowerCase();
26
+ if (mt.startsWith('image/'))
27
+ return 'image';
28
+ if (mt.startsWith('video/'))
29
+ return 'video';
30
+ return 'file';
31
+ }
32
+ // Mirrors the shared icon set's viewBox/stroke conventions
33
+ // (internal/icons.ts's chevronIcon()/closeIcon()/etc.), and is visually
34
+ // identical to `<lyra-attachment-chip>`'s and `<lyra-document-preview>`'s
35
+ // own local `fileGlyph()` -- duplicated rather than imported (these are
36
+ // three independently consumable components, and icons.ts is off limits
37
+ // here) but kept pixel-identical so a "generic file" affordance reads the
38
+ // same wherever it shows up in the library.
39
+ const ICON_VIEW_BOX = '0 0 24 24';
40
+ const ICON_STROKE_WIDTH = '1.75';
41
+ function fileGlyph() {
42
+ return svg `
43
+ <svg
44
+ width="1em"
45
+ height="1em"
46
+ viewBox=${ICON_VIEW_BOX}
47
+ fill="none"
48
+ stroke="currentColor"
49
+ stroke-width=${ICON_STROKE_WIDTH}
50
+ stroke-linecap="round"
51
+ stroke-linejoin="round"
52
+ aria-hidden="true"
53
+ focusable="false"
54
+ ><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Z"></path><polyline points="14 2 14 8 20 8"></polyline></svg>
55
+ `;
56
+ }
57
+ /**
58
+ * `<lyra-media-card>` — a lightweight inline preview for one already-sent,
59
+ * already-available attachment inside a rendered chat message body (e.g.
60
+ * plugged into `<lyra-chat-message>`'s `attachments` slot, or embedded
61
+ * directly by a markdown/message renderer). Distinct from two other,
62
+ * similarly-named components in this family: `<lyra-document-preview>` is a
63
+ * fuller viewer with header chrome and an async server-side-conversion
64
+ * state machine (`status="converting"`), and `<lyra-attachment-chip>` is a
65
+ * pre-send queued-file chip with upload progress. This component has
66
+ * neither concern — it only ever shows a `src` that's already final.
67
+ *
68
+ * **Format dispatch.** `kind` selects `'image'` (a plain `<img>`), `'video'`
69
+ * (a plain `<video controls>`), or `'file'` (an icon + filename chip with a
70
+ * download/open affordance). Leave `kind` unset to auto-detect from
71
+ * `mime-type` (`image/*` / `video/*` / anything else -> `'file'`);
72
+ * explicitly setting `kind` always wins over detection.
73
+ *
74
+ * **Safe-URL checking.** `src` is validated before it's ever assigned to an
75
+ * `<img>`/`<video>` `src` or an `<a href>` — only `http:`/`https:`/`blob:`
76
+ * (plus `data:` for a *media* `src` only) or a scheme-relative/relative URL
77
+ * with no scheme at all pass; anything else (`javascript:`, `vbscript:`,
78
+ * and similarly suspicious schemes) is rejected. `safeMediaSrc()` and
79
+ * `safeLinkHref()` share a platform-URL-based validator; their sink-specific
80
+ * allowlists explain why `data:` gets two different answers depending on
81
+ * where it is used. An `image`/`video` `kind` whose `src` fails the
82
+ * media-src check falls back to the generic file-chip rendering — this is
83
+ * the "plain preview unavailable state" a dangerous URL degrades to, rather
84
+ * than ever reaching a real media/anchor sink. That fallback also re-checks
85
+ * `src` against the stricter href allowlist for its own download affordance,
86
+ * but since the href allowlist is a strict subset of the media-src allowlist,
87
+ * that re-check can only ever change the outcome for a direct/auto-detected
88
+ * `kind="file"` `src` — an `image`/`video` `src` that already failed the
89
+ * wider media-src check necessarily fails the narrower href check too, so
90
+ * the fallback for those two kinds is always the plain, unclickable `span`.
91
+ *
92
+ * **The `video` case renders its open affordance separately from `base`.**
93
+ * `image`/`file` wrap their *entire* card in one native `<button>`/`<a>` —
94
+ * safe because an `<img>` and a plain icon+text chip have no interactive
95
+ * content of their own to conflict with. A `<video controls>` element is
96
+ * itself interactive content (its own play/seek/volume controls), and HTML
97
+ * forbids nesting interactive content inside a `<button>`/`<a>` — doing so
98
+ * anyway would also make every click on the video's own controls bubble up
99
+ * and spuriously fire `lyra-open`. So for `kind="video"`, `base` is a plain,
100
+ * non-interactive wrapper around `[part="media"]`, and a small separate
101
+ * `[part="open-button"]` (not one of this component's originally-scoped
102
+ * parts, added as the "explicit view/open affordance" the class is free to
103
+ * provide) is the thing that actually fires `lyra-open`.
104
+ *
105
+ * **Navigation.** This component never navigates on its own for `image`/
106
+ * `video` — activating the card only fires `lyra-open`; a host decides what
107
+ * "open" means (a lightbox, a new tab, whatever). The `file`-chip case is
108
+ * the one exception: when `src` passes the (stricter) href safety check, the
109
+ * chip is a real `<a href download>` so a bare drop-in still does something
110
+ * useful — but `lyra-open` fires first and is `cancelable`; a host that
111
+ * calls `preventDefault()` on it suppresses that default download/open so it
112
+ * can substitute its own handling instead.
113
+ *
114
+ * @customElement lyra-media-card
115
+ * @event lyra-open - The card (or, for `kind="video"`, its `open-button`)
116
+ * was activated. `detail: { src, filename }`. Cancelable — see the class
117
+ * doc's "Navigation" section for what calling `preventDefault()` on it does
118
+ * in the `file`-chip case.
119
+ * @csspart base - The root interactive/container element. A `<button>` for
120
+ * `kind="image"`, a plain wrapper `<div>` for `kind="video"`, and either an
121
+ * `<a>` (when `src` passes the href safety check) or a plain `<span>`
122
+ * (otherwise) for the `file`-chip fallback.
123
+ * @csspart media - The `<img>` or `<video>` element.
124
+ * @csspart file-icon - The generic file glyph, shown only in the file-chip fallback.
125
+ * @csspart filename - The filename text, shown only in the file-chip fallback.
126
+ * @csspart open-button - The explicit "open" affordance rendered next to
127
+ * `[part="media"]` for `kind="video"` only — see the class doc.
128
+ */
129
+ export class LyraMediaCard extends LyraElement {
130
+ constructor() {
131
+ super(...arguments);
132
+ /** The media URL. Always re-validated against a safe-scheme allowlist
133
+ * before use — see the class doc. */
134
+ this.src = '';
135
+ /** Drives auto-detection when `kind` is unset. */
136
+ this.mimeType = '';
137
+ /** Shown in the file-chip fallback, used as the download link's suggested
138
+ * filename, and folded into the accessible name of the whole card. */
139
+ this.filename = '';
140
+ /** Alt text for the image case (and reused as a video label fallback).
141
+ * Falls back to `filename`, then a generic per-kind description. */
142
+ this.alt = '';
143
+ /** A CSS length (e.g. `"16rem"`); once set, overrides the
144
+ * `--lyra-media-card-max-height` custom property for this instance only —
145
+ * same contract as `<lyra-document-preview>`'s identically-named prop. */
146
+ this.maxHeight = '';
147
+ this.onActivate = () => {
148
+ this.emitOpen();
149
+ };
150
+ // The file-chip's `<a>` provides a real default action (download/open the
151
+ // resource) so a bare drop-in works with no host wiring, but `lyra-open`
152
+ // fires first and is cancelable -- a host that preventDefault()s it is
153
+ // suppressing exactly that default, so the native click also needs
154
+ // stopping or the download/navigation would proceed anyway.
155
+ this.onLinkClick = (e) => {
156
+ if (this.emitOpen().defaultPrevented)
157
+ e.preventDefault();
158
+ };
159
+ }
160
+ static { this.styles = [LyraElement.styles, styles]; }
161
+ /** Effective kind used for rendering — `kind` if explicitly set,
162
+ * otherwise detected from `mime-type`. */
163
+ get resolvedKind() {
164
+ return this.kind ?? detectKind(this.mimeType);
165
+ }
166
+ get displayFilename() {
167
+ return this.filename || 'Untitled file';
168
+ }
169
+ /** Accessible name for the card's own actionable element (`base` or, for
170
+ * video, `open-button`) — always phrased as the action it performs. */
171
+ get accessibleLabel() {
172
+ const name = this.filename || this.alt;
173
+ return name ? `Open ${name}` : `Open ${this.resolvedKind} attachment`;
174
+ }
175
+ get imgAlt() {
176
+ return this.alt || this.filename || 'Image attachment';
177
+ }
178
+ get videoLabel() {
179
+ return this.alt || this.filename || 'Video attachment';
180
+ }
181
+ /** Per-instance override for `--lyra-media-card-max-height`, applied
182
+ * inline on `[part="base"]` -- the only mechanism that reliably wins
183
+ * over the `:host{}`-declared default from outside the shadow root. */
184
+ get baseStyle() {
185
+ return this.maxHeight ? `--lyra-media-card-max-height:${this.maxHeight}` : nothing;
186
+ }
187
+ emitOpen() {
188
+ // Matches whichever safe-URL sink actually rendered (see the class doc):
189
+ // falls back to a trimmed raw src so a whitespace-padded, otherwise-unsafe
190
+ // src still reports the same value the DOM would show if it were safe.
191
+ const src = safeMediaSrc(this.src) ?? safeLinkHref(this.src) ?? this.src.trim();
192
+ return this.emit('lyra-open', { src, filename: this.filename });
193
+ }
194
+ renderImage(src) {
195
+ return html `
196
+ <button part="base" type="button" style=${this.baseStyle} aria-label=${this.accessibleLabel} @click=${this.onActivate}>
197
+ <img part="media" src=${src} alt=${this.imgAlt} />
198
+ </button>
199
+ `;
200
+ }
201
+ renderVideo(src) {
202
+ return html `
203
+ <div part="base" style=${this.baseStyle}>
204
+ <video part="media" controls src=${src} aria-label=${this.videoLabel}></video>
205
+ <button part="open-button" type="button" aria-label=${this.accessibleLabel} @click=${this.onActivate}>
206
+ ${expandIcon()}
207
+ </button>
208
+ </div>
209
+ `;
210
+ }
211
+ renderFileFallback() {
212
+ const href = safeLinkHref(this.src);
213
+ const name = this.displayFilename;
214
+ const content = html `
215
+ <span part="file-icon" aria-hidden="true">${fileGlyph()}</span>
216
+ <span part="filename" title=${name}>${name}</span>
217
+ `;
218
+ if (href) {
219
+ return html `
220
+ <a
221
+ part="base"
222
+ href=${href}
223
+ style=${this.baseStyle}
224
+ download=${this.filename || ''}
225
+ aria-label=${this.accessibleLabel}
226
+ @click=${this.onLinkClick}
227
+ >
228
+ ${content}
229
+ </a>
230
+ `;
231
+ }
232
+ // No safe link target -- the "plain preview unavailable state" the class
233
+ // doc describes: the filename/icon still display, but nothing is
234
+ // clickable (there's nothing safe to point a download/open affordance
235
+ // at, and no built-in lightbox to fall back to for this kind).
236
+ return html `<span part="base" style=${this.baseStyle}>${content}</span>`;
237
+ }
238
+ render() {
239
+ const kind = this.resolvedKind;
240
+ if (kind === 'image') {
241
+ const src = safeMediaSrc(this.src);
242
+ if (src)
243
+ return this.renderImage(src);
244
+ return this.renderFileFallback();
245
+ }
246
+ if (kind === 'video') {
247
+ const src = safeMediaSrc(this.src);
248
+ if (src)
249
+ return this.renderVideo(src);
250
+ return this.renderFileFallback();
251
+ }
252
+ return this.renderFileFallback();
253
+ }
254
+ }
255
+ __decorate([
256
+ property()
257
+ ], LyraMediaCard.prototype, "src", void 0);
258
+ __decorate([
259
+ property({ reflect: true })
260
+ ], LyraMediaCard.prototype, "kind", void 0);
261
+ __decorate([
262
+ property({ attribute: 'mime-type' })
263
+ ], LyraMediaCard.prototype, "mimeType", void 0);
264
+ __decorate([
265
+ property()
266
+ ], LyraMediaCard.prototype, "filename", void 0);
267
+ __decorate([
268
+ property()
269
+ ], LyraMediaCard.prototype, "alt", void 0);
270
+ __decorate([
271
+ property({ attribute: 'max-height' })
272
+ ], LyraMediaCard.prototype, "maxHeight", void 0);
273
+ defineElement('media-card', LyraMediaCard);
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,132 @@
1
+ import { css } from 'lit';
2
+ export const styles = css `
3
+ :host {
4
+ display: inline-block;
5
+ max-inline-size: 100%;
6
+ /* Consumer-tunable cap so one oversized image/video can't blow out a
7
+ chat bubble -- same naming/contract as lyra-document-preview's
8
+ identical --lyra-document-preview-max-height. Width already caps at
9
+ 100% of whatever the host message body allows. */
10
+ --lyra-media-card-max-height: 20rem;
11
+ }
12
+
13
+ /* -- base: shared chrome for every kind's root element (button/div/a/span) */
14
+ [part='base'] {
15
+ display: block;
16
+ box-sizing: border-box;
17
+ max-inline-size: 100%;
18
+ border: 1px solid var(--lyra-color-border);
19
+ border-radius: var(--lyra-radius);
20
+ background: var(--lyra-color-surface);
21
+ overflow: hidden;
22
+ font: inherit;
23
+ color: var(--lyra-color-text);
24
+ text-decoration: none;
25
+ }
26
+ /* Reset native button/anchor chrome only where "base" is actually one of
27
+ those (image and file-with-a-safe-link cases) -- a plain div/span never
28
+ had any to begin with, so this is harmless there too. */
29
+ button[part='base'],
30
+ a[part='base'] {
31
+ cursor: pointer;
32
+ padding: 0;
33
+ -webkit-tap-highlight-color: transparent;
34
+ transition:
35
+ border-color var(--lyra-transition-fast),
36
+ background-color var(--lyra-transition-fast);
37
+ }
38
+ button[part='base']:hover,
39
+ a[part='base']:hover {
40
+ border-color: var(--lyra-color-brand);
41
+ }
42
+ [part='base']:focus-visible {
43
+ outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
44
+ outline-offset: var(--lyra-focus-ring-offset);
45
+ }
46
+
47
+ /* -- image / video media ------------------------------------------- */
48
+ img[part='media'] {
49
+ display: block;
50
+ max-inline-size: 100%;
51
+ max-block-size: var(--lyra-media-card-max-height);
52
+ object-fit: contain;
53
+ }
54
+ video[part='media'] {
55
+ display: block;
56
+ max-inline-size: 100%;
57
+ max-block-size: var(--lyra-media-card-max-height);
58
+ }
59
+
60
+ /* -- video: base is a plain non-interactive wrapper around the video
61
+ plus its own separate open-button -- see the class doc for why video
62
+ doesn't reuse the whole-card-button pattern image/file use. */
63
+ div[part='base'] {
64
+ position: relative;
65
+ display: inline-block;
66
+ }
67
+ [part='open-button'] {
68
+ position: absolute;
69
+ inset-block-start: var(--lyra-space-s);
70
+ inset-inline-end: var(--lyra-space-s);
71
+ display: inline-flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ min-inline-size: min(var(--lyra-icon-button-size), 2rem);
75
+ min-block-size: min(var(--lyra-icon-button-size), 2rem);
76
+ padding: 0;
77
+ border: none;
78
+ border-radius: var(--lyra-radius);
79
+ background: color-mix(in srgb, var(--lyra-color-surface) 78%, transparent);
80
+ color: var(--lyra-color-text);
81
+ cursor: pointer;
82
+ -webkit-tap-highlight-color: transparent;
83
+ transition: background-color var(--lyra-transition-fast);
84
+ }
85
+ [part='open-button']:hover {
86
+ background: var(--lyra-color-surface);
87
+ }
88
+ [part='open-button']:focus-visible {
89
+ outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
90
+ outline-offset: var(--lyra-focus-ring-offset);
91
+ }
92
+ [part='open-button'] svg {
93
+ display: block;
94
+ }
95
+
96
+ /* -- file-chip fallback (kind="file", or an image/video src that failed
97
+ the safe-URL check) ------------------------------------------------ */
98
+ span[part='base'],
99
+ a[part='base'] {
100
+ display: inline-flex;
101
+ align-items: center;
102
+ gap: var(--lyra-space-s);
103
+ padding: var(--lyra-space-xs) var(--lyra-space-s);
104
+ }
105
+ [part='file-icon'] {
106
+ display: inline-flex;
107
+ flex: 0 0 auto;
108
+ align-items: center;
109
+ justify-content: center;
110
+ font-size: 1.25rem;
111
+ color: var(--lyra-color-text-quiet);
112
+ }
113
+ [part='file-icon'] svg {
114
+ display: block;
115
+ }
116
+ [part='filename'] {
117
+ overflow: hidden;
118
+ text-overflow: ellipsis;
119
+ white-space: nowrap;
120
+ font-weight: 600;
121
+ font-size: 0.8125rem;
122
+ color: var(--lyra-color-text);
123
+ }
124
+
125
+ @media (prefers-reduced-motion: reduce) {
126
+ button[part='base'],
127
+ a[part='base'],
128
+ [part='open-button'] {
129
+ transition: none !important;
130
+ }
131
+ }
132
+ `;
@@ -0,0 +1,203 @@
1
+ import { type TemplateResult, type PropertyValues } from 'lit';
2
+ import { LyraElement } from '../../internal/lyra-element.js';
3
+ /** One candidate row — an `@`-mentionable person/entity, or a `/`-command. */
4
+ export interface MentionItem {
5
+ id: string;
6
+ label: string;
7
+ description?: string;
8
+ /** Literal icon hint (e.g. an emoji), rendered next to `label` -- same
9
+ * "opaque string, not a registry lookup" convention as
10
+ * `<lyra-tool-call-chip>`'s/`<lyra-tool-select-dialog>`'s own `icon`. */
11
+ icon?: string;
12
+ }
13
+ /** Predicate deciding whether `item` matches a (already-trimmed, already-lowercased) `query`.
14
+ * Mirrors `<lyra-combobox>`'s `OptionFilter` convention -- override `filter` to replace the
15
+ * built-in case-insensitive label/description substring match entirely. */
16
+ export type MentionFilter = (item: MentionItem, query: string) => boolean;
17
+ export interface MentionSelectDetail {
18
+ id: string;
19
+ label: string;
20
+ }
21
+ /**
22
+ * `<lyra-mention-popover>` — a caret-anchored, keyboard-navigable popover for
23
+ * `@`-mention and `/`-slash-command autocomplete inside a plain-text
24
+ * `<textarea>`/`<input>` the host owns (e.g. `<lyra-chat-composer>`'s own
25
+ * textarea, though this component has no dependency on that or any other
26
+ * specific input). It never takes DOM focus itself — the same "focus stays
27
+ * put, `aria-activedescendant` conveys the active row" pattern
28
+ * `<lyra-select>`/`<lyra-combobox>` use for their own listbox — so a host
29
+ * must apply `aria-activedescendant` to its *own* input element, pointing at
30
+ * whatever `activeDescendantId` currently returns.
31
+ *
32
+ * Integration contract (entirely the host's responsibility — this component
33
+ * never inspects the text control's value or listens to it directly):
34
+ * 1. Detect a mention/command trigger (e.g. `@`/`/` at the start of a word)
35
+ * in the host's own `input` handling.
36
+ * 2. Set `anchor` (the `<textarea>`/`<input>` itself, or any element for
37
+ * plain whole-element anchoring — see "Positioning" below), `items`, and
38
+ * `query` (the text typed since the trigger character), then flip
39
+ * `open = true`.
40
+ * 3. Forward every `keydown` the input receives, while `open`, through
41
+ * `handleKeyDown()` — it returns `true` when it consumed the key (so the
42
+ * host's own handler should stop, e.g. skip submitting the message on an
43
+ * Enter that actually picked a mention) and `false` otherwise.
44
+ * 4. Set `open = false` whenever the query stops looking like an active
45
+ * mention context (a space typed, the trigger character deleted, the
46
+ * input blurred, …) — `lyra-mention-close` fires automatically from that
47
+ * (see below), there is no separate "tell it to close" call needed.
48
+ * 5. Keep the host's own input's `aria-activedescendant` (and, optionally,
49
+ * `aria-controls`, via `listboxId`) in sync with `activeDescendantId` —
50
+ * this component has no DOM of the host's to attach that to itself.
51
+ *
52
+ * Positioning: when `anchor` is a plain `<textarea>` or single-line text
53
+ * `<input>`, this component measures exactly where the caret currently
54
+ * paints (`caretClientRect()`, the standard hidden-mirror-element technique
55
+ * — see that function's own doc) and positions against that single point
56
+ * with `internal/positioner.js`'s `place()`, so the popup tracks the caret
57
+ * rather than sitting under the whole textarea. Any other `anchor` element
58
+ * (or a text control this component fails to measure, e.g. one with
59
+ * `display: none`) falls back to `place(anchor, popup)` against the whole
60
+ * element — the same whole-element anchoring `<lyra-combobox>`/
61
+ * `<lyra-select>` use for their own popups. Re-measures on every `anchor`/
62
+ * `query` change while open (a keystroke moves the caret, so a fresh `query`
63
+ * is the proxy for "the caret may have moved"); a caret that moves for a
64
+ * reason other than typing (e.g. a mouse click elsewhere in the text while
65
+ * the popover happens to still be open) is not separately tracked — the
66
+ * host can force a re-measure by toggling `open` or reassigning `anchor`.
67
+ *
68
+ * Filtering happens internally against `items` (mirroring `<lyra-combobox>`'s
69
+ * filter-predicate convention via `filter`, rather than requiring the host to
70
+ * pre-filter): the default predicate is a case-insensitive substring match
71
+ * against `label`/`description`, overridable via `filter`.
72
+ *
73
+ * There is no persisted "selection" the way a real listbox has one — a
74
+ * mention is either committed (closing the popover) or the popover is
75
+ * dismissed with nothing chosen — so `aria-selected="true"` marks whichever
76
+ * row is currently *active* (what Enter/Tab would commit right now), per the
77
+ * WAI-ARIA combobox-with-list-autocomplete pattern, rather than tracking a
78
+ * separate persisted value the way `<lyra-combobox>`'s own `aria-selected`
79
+ * does.
80
+ *
81
+ * @example
82
+ * ```html
83
+ * <textarea id="composer"></textarea>
84
+ * <lyra-mention-popover id="mentions"></lyra-mention-popover>
85
+ * <script>
86
+ * const textarea = document.getElementById('composer');
87
+ * const popover = document.getElementById('mentions');
88
+ *
89
+ * textarea.addEventListener('keydown', (e) => {
90
+ * if (popover.open && popover.handleKeyDown(e)) return; // consumed
91
+ * // ...the host's own Enter-to-send handling, etc.
92
+ * });
93
+ * textarea.addEventListener('input', () => {
94
+ * // host's own '@'/'/' + query detection, then:
95
+ * popover.anchor = textarea;
96
+ * popover.items = candidates;
97
+ * popover.query = detectedQuery;
98
+ * popover.open = detectedQuery !== null;
99
+ * });
100
+ * textarea.addEventListener('blur', () => (popover.open = false));
101
+ *
102
+ * popover.addEventListener('lyra-mention-select', (e) => {
103
+ * // splice `${e.detail.label}` into the textarea at the trigger offset
104
+ * });
105
+ * popover.addEventListener('lyra-mention-close', () => {
106
+ * textarea.removeAttribute('aria-activedescendant');
107
+ * });
108
+ *
109
+ * // Whenever the popover re-renders its active row (e.g. after every
110
+ * // ArrowUp/ArrowDown handleKeyDown() call above), sync the host's own
111
+ * // input so assistive tech announces the current candidate:
112
+ * const syncActiveDescendant = () => {
113
+ * if (popover.open && popover.activeDescendantId) {
114
+ * textarea.setAttribute('aria-activedescendant', popover.activeDescendantId);
115
+ * } else {
116
+ * textarea.removeAttribute('aria-activedescendant');
117
+ * }
118
+ * };
119
+ * </script>
120
+ * ```
121
+ *
122
+ * @customElement lyra-mention-popover
123
+ * @event lyra-mention-select - An item was committed (Enter/Tab/click). `detail: { id, label }`.
124
+ * @event lyra-mention-close - The popover was dismissed with no selection — Escape, or `open`
125
+ * transitioning to `false` by any other means (a direct host assignment included). Never fires
126
+ * for a close that followed a `lyra-mention-select` commit.
127
+ * @csspart listbox - The popover's root element (`role="listbox"`).
128
+ * @csspart option - A candidate row (`role="option"`).
129
+ * @csspart option-icon - A row's leading icon glyph, when `icon` is set.
130
+ * @csspart option-label - Wrapper around a row's label/description.
131
+ * @csspart option-description - A row's optional secondary line, when `description` is set.
132
+ * @csspart empty - The "no matches" message, shown when `items`/`query` produce zero rows.
133
+ */
134
+ export declare class LyraMentionPopover extends LyraElement {
135
+ static styles: import("lit").CSSResultGroup[];
136
+ /** The element to position the popup relative to. When this is a plain
137
+ * `<textarea>`/single-line text `<input>`, positioning is caret-precise
138
+ * (see the class doc); any other element anchors the whole popup under
139
+ * that element's own box, the same as `<lyra-combobox>`'s trigger. */
140
+ anchor?: HTMLElement;
141
+ /** The full candidate set, pre-`query`-filtering. */
142
+ items: MentionItem[];
143
+ /** The text typed since the trigger character (`@`/`/`/…) — drives the
144
+ * built-in internal filtering (see `filter` to override it). */
145
+ query: string;
146
+ /** Whether the popover is shown. */
147
+ open: boolean;
148
+ /** Overrides the built-in case-insensitive label/description substring match. */
149
+ filter: MentionFilter | null;
150
+ /** Message shown when `items` (post-`query`-filtering) is empty. */
151
+ emptyText: string;
152
+ /** Accessible name for the `role="listbox"` popup. */
153
+ label: string;
154
+ private activeIndex;
155
+ private readonly _listboxId;
156
+ private cleanup?;
157
+ private virtualAnchor;
158
+ private _isFirstUpdate;
159
+ private _suppressCloseEvent;
160
+ protected willUpdate(changed: PropertyValues): void;
161
+ protected updated(changed: PropertyValues): void;
162
+ disconnectedCallback(): void;
163
+ /** The current candidate set: `items` filtered by `query` via `filter`
164
+ * (or the built-in default). Empty `query` returns `items` unfiltered. */
165
+ get filteredItems(): MentionItem[];
166
+ /** The `id` of the currently-highlighted row for the host to apply as its
167
+ * own input's `aria-activedescendant` — `null` while closed or when
168
+ * `filteredItems` is empty (nothing to point at). See the class doc's
169
+ * `@example` for the full wiring. */
170
+ get activeDescendantId(): string | null;
171
+ /** The `id` of the `role="listbox"` popup, for a host that also wants to
172
+ * wire `aria-controls` on its own input (screen-reader support for
173
+ * `aria-controls` is inconsistent, so `activeDescendantId` remains the
174
+ * load-bearing piece; this is a supplementary nicety). */
175
+ get listboxId(): string;
176
+ /**
177
+ * The host's own text-control keydown handler calls this while the
178
+ * popover is open. Returns `true` when the key was intercepted
179
+ * (`preventDefault()` already called) and the host should not also act on
180
+ * it; `false` when the host's normal handling should proceed untouched --
181
+ * including ArrowDown/ArrowUp/Enter/Tab when there are zero filtered rows
182
+ * to act on, so e.g. the host's own textarea still moves its caret a line
183
+ * normally rather than having the keystroke silently eaten.
184
+ */
185
+ handleKeyDown(e: KeyboardEvent): boolean;
186
+ private clampedIndex;
187
+ private rowId;
188
+ private commit;
189
+ private reposition;
190
+ /** Resolves what to actually hand `place()` -- a caret-precise virtual
191
+ * point for a measurable text control, `anchor` itself otherwise. See the
192
+ * class doc's "Positioning" section. */
193
+ private resolveAnchorElement;
194
+ private onListboxMouseDown;
195
+ private onListboxClick;
196
+ private renderRow;
197
+ render(): TemplateResult;
198
+ }
199
+ declare global {
200
+ interface HTMLElementTagNameMap {
201
+ 'lyra-mention-popover': LyraMentionPopover;
202
+ }
203
+ }