@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,493 @@
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 } 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 './mention-popover.styles.js';
14
+ function defaultFilter(item, query) {
15
+ return item.label.toLowerCase().includes(query) || (item.description ?? '').toLowerCase().includes(query);
16
+ }
17
+ function isTextControl(el) {
18
+ if (el instanceof HTMLTextAreaElement)
19
+ return true;
20
+ return el instanceof HTMLInputElement && (el.type === 'text' || el.type === 'search');
21
+ }
22
+ // Computed-style properties that affect text layout/measurement, copied
23
+ // verbatim from the real control onto the hidden mirror in caretClientRect()
24
+ // below so wrapped-line offsets inside the mirror land exactly where they do
25
+ // in the real control. Deliberately excludes paint-only properties (color,
26
+ // background, etc.) -- those never affect where text/lines break.
27
+ const MIRROR_CSS_PROPS = [
28
+ 'box-sizing',
29
+ 'width',
30
+ 'padding-top',
31
+ 'padding-right',
32
+ 'padding-bottom',
33
+ 'padding-left',
34
+ 'border-top-width',
35
+ 'border-right-width',
36
+ 'border-bottom-width',
37
+ 'border-left-width',
38
+ 'border-style',
39
+ 'font-family',
40
+ 'font-size',
41
+ 'font-style',
42
+ 'font-variant',
43
+ 'font-weight',
44
+ 'font-stretch',
45
+ 'letter-spacing',
46
+ 'word-spacing',
47
+ 'line-height',
48
+ 'text-align',
49
+ 'text-indent',
50
+ 'text-transform',
51
+ 'tab-size',
52
+ 'direction',
53
+ ];
54
+ /**
55
+ * Measures exactly where `el`'s caret (`selectionStart`) currently paints,
56
+ * in viewport coordinates, via the classic "hidden mirror div + marker span"
57
+ * technique: there is no native DOM API for this -- `getBoundingClientRect()`
58
+ * on a text control only reports the control's own box, never a cursor
59
+ * position inside it. A throwaway off-screen clone of `el` is built (font/
60
+ * box metrics copied via `MIRROR_CSS_PROPS` above), a marker `<span>` is
61
+ * inserted at the caret's text offset, its rect is measured relative to the
62
+ * mirror's own rect (so the absolute off-screen position of the mirror
63
+ * itself never matters), and that local offset is applied to `el`'s real
64
+ * `getBoundingClientRect()` minus its current scroll offset. Returns `null`
65
+ * for a zero-size (e.g. `display: none`) control.
66
+ */
67
+ function caretClientRect(el) {
68
+ const elRect = el.getBoundingClientRect();
69
+ if (elRect.width === 0 || elRect.height === 0)
70
+ return null;
71
+ const computed = window.getComputedStyle(el);
72
+ const mirror = document.createElement('div');
73
+ mirror.style.position = 'absolute';
74
+ mirror.style.visibility = 'hidden';
75
+ mirror.style.top = '0';
76
+ mirror.style.left = '-9999px';
77
+ // <textarea> soft-wraps; a single-line <input> never does -- mismatching
78
+ // this makes the mirror wrap where the real control wouldn't (or vice
79
+ // versa), throwing off every offset past the first line/character run.
80
+ mirror.style.whiteSpace = el instanceof HTMLTextAreaElement ? 'pre-wrap' : 'pre';
81
+ mirror.style.overflowWrap = 'break-word';
82
+ for (const prop of MIRROR_CSS_PROPS) {
83
+ mirror.style.setProperty(prop, computed.getPropertyValue(prop));
84
+ }
85
+ const index = el.selectionStart ?? el.value.length;
86
+ mirror.append(document.createTextNode(el.value.slice(0, index)));
87
+ const marker = document.createElement('span');
88
+ // A marker with no content at all collapses to zero width -- a hair of
89
+ // content keeps it reliably measurable even for a caret sitting at the
90
+ // very end of the value.
91
+ marker.textContent = el.value.slice(index) || '​';
92
+ mirror.appendChild(marker);
93
+ document.body.appendChild(mirror);
94
+ const mirrorRect = mirror.getBoundingClientRect();
95
+ const markerRect = marker.getBoundingClientRect();
96
+ mirror.remove();
97
+ const lineHeight = parseFloat(computed.lineHeight) || markerRect.height || 16;
98
+ return new DOMRect(elRect.left + (markerRect.left - mirrorRect.left) - el.scrollLeft, elRect.top + (markerRect.top - mirrorRect.top) - el.scrollTop, 1, lineHeight);
99
+ }
100
+ /**
101
+ * `<lyra-mention-popover>` — a caret-anchored, keyboard-navigable popover for
102
+ * `@`-mention and `/`-slash-command autocomplete inside a plain-text
103
+ * `<textarea>`/`<input>` the host owns (e.g. `<lyra-chat-composer>`'s own
104
+ * textarea, though this component has no dependency on that or any other
105
+ * specific input). It never takes DOM focus itself — the same "focus stays
106
+ * put, `aria-activedescendant` conveys the active row" pattern
107
+ * `<lyra-select>`/`<lyra-combobox>` use for their own listbox — so a host
108
+ * must apply `aria-activedescendant` to its *own* input element, pointing at
109
+ * whatever `activeDescendantId` currently returns.
110
+ *
111
+ * Integration contract (entirely the host's responsibility — this component
112
+ * never inspects the text control's value or listens to it directly):
113
+ * 1. Detect a mention/command trigger (e.g. `@`/`/` at the start of a word)
114
+ * in the host's own `input` handling.
115
+ * 2. Set `anchor` (the `<textarea>`/`<input>` itself, or any element for
116
+ * plain whole-element anchoring — see "Positioning" below), `items`, and
117
+ * `query` (the text typed since the trigger character), then flip
118
+ * `open = true`.
119
+ * 3. Forward every `keydown` the input receives, while `open`, through
120
+ * `handleKeyDown()` — it returns `true` when it consumed the key (so the
121
+ * host's own handler should stop, e.g. skip submitting the message on an
122
+ * Enter that actually picked a mention) and `false` otherwise.
123
+ * 4. Set `open = false` whenever the query stops looking like an active
124
+ * mention context (a space typed, the trigger character deleted, the
125
+ * input blurred, …) — `lyra-mention-close` fires automatically from that
126
+ * (see below), there is no separate "tell it to close" call needed.
127
+ * 5. Keep the host's own input's `aria-activedescendant` (and, optionally,
128
+ * `aria-controls`, via `listboxId`) in sync with `activeDescendantId` —
129
+ * this component has no DOM of the host's to attach that to itself.
130
+ *
131
+ * Positioning: when `anchor` is a plain `<textarea>` or single-line text
132
+ * `<input>`, this component measures exactly where the caret currently
133
+ * paints (`caretClientRect()`, the standard hidden-mirror-element technique
134
+ * — see that function's own doc) and positions against that single point
135
+ * with `internal/positioner.js`'s `place()`, so the popup tracks the caret
136
+ * rather than sitting under the whole textarea. Any other `anchor` element
137
+ * (or a text control this component fails to measure, e.g. one with
138
+ * `display: none`) falls back to `place(anchor, popup)` against the whole
139
+ * element — the same whole-element anchoring `<lyra-combobox>`/
140
+ * `<lyra-select>` use for their own popups. Re-measures on every `anchor`/
141
+ * `query` change while open (a keystroke moves the caret, so a fresh `query`
142
+ * is the proxy for "the caret may have moved"); a caret that moves for a
143
+ * reason other than typing (e.g. a mouse click elsewhere in the text while
144
+ * the popover happens to still be open) is not separately tracked — the
145
+ * host can force a re-measure by toggling `open` or reassigning `anchor`.
146
+ *
147
+ * Filtering happens internally against `items` (mirroring `<lyra-combobox>`'s
148
+ * filter-predicate convention via `filter`, rather than requiring the host to
149
+ * pre-filter): the default predicate is a case-insensitive substring match
150
+ * against `label`/`description`, overridable via `filter`.
151
+ *
152
+ * There is no persisted "selection" the way a real listbox has one — a
153
+ * mention is either committed (closing the popover) or the popover is
154
+ * dismissed with nothing chosen — so `aria-selected="true"` marks whichever
155
+ * row is currently *active* (what Enter/Tab would commit right now), per the
156
+ * WAI-ARIA combobox-with-list-autocomplete pattern, rather than tracking a
157
+ * separate persisted value the way `<lyra-combobox>`'s own `aria-selected`
158
+ * does.
159
+ *
160
+ * @example
161
+ * ```html
162
+ * <textarea id="composer"></textarea>
163
+ * <lyra-mention-popover id="mentions"></lyra-mention-popover>
164
+ * <script>
165
+ * const textarea = document.getElementById('composer');
166
+ * const popover = document.getElementById('mentions');
167
+ *
168
+ * textarea.addEventListener('keydown', (e) => {
169
+ * if (popover.open && popover.handleKeyDown(e)) return; // consumed
170
+ * // ...the host's own Enter-to-send handling, etc.
171
+ * });
172
+ * textarea.addEventListener('input', () => {
173
+ * // host's own '@'/'/' + query detection, then:
174
+ * popover.anchor = textarea;
175
+ * popover.items = candidates;
176
+ * popover.query = detectedQuery;
177
+ * popover.open = detectedQuery !== null;
178
+ * });
179
+ * textarea.addEventListener('blur', () => (popover.open = false));
180
+ *
181
+ * popover.addEventListener('lyra-mention-select', (e) => {
182
+ * // splice `${e.detail.label}` into the textarea at the trigger offset
183
+ * });
184
+ * popover.addEventListener('lyra-mention-close', () => {
185
+ * textarea.removeAttribute('aria-activedescendant');
186
+ * });
187
+ *
188
+ * // Whenever the popover re-renders its active row (e.g. after every
189
+ * // ArrowUp/ArrowDown handleKeyDown() call above), sync the host's own
190
+ * // input so assistive tech announces the current candidate:
191
+ * const syncActiveDescendant = () => {
192
+ * if (popover.open && popover.activeDescendantId) {
193
+ * textarea.setAttribute('aria-activedescendant', popover.activeDescendantId);
194
+ * } else {
195
+ * textarea.removeAttribute('aria-activedescendant');
196
+ * }
197
+ * };
198
+ * </script>
199
+ * ```
200
+ *
201
+ * @customElement lyra-mention-popover
202
+ * @event lyra-mention-select - An item was committed (Enter/Tab/click). `detail: { id, label }`.
203
+ * @event lyra-mention-close - The popover was dismissed with no selection — Escape, or `open`
204
+ * transitioning to `false` by any other means (a direct host assignment included). Never fires
205
+ * for a close that followed a `lyra-mention-select` commit.
206
+ * @csspart listbox - The popover's root element (`role="listbox"`).
207
+ * @csspart option - A candidate row (`role="option"`).
208
+ * @csspart option-icon - A row's leading icon glyph, when `icon` is set.
209
+ * @csspart option-label - Wrapper around a row's label/description.
210
+ * @csspart option-description - A row's optional secondary line, when `description` is set.
211
+ * @csspart empty - The "no matches" message, shown when `items`/`query` produce zero rows.
212
+ */
213
+ export class LyraMentionPopover extends LyraElement {
214
+ constructor() {
215
+ super(...arguments);
216
+ /** The full candidate set, pre-`query`-filtering. */
217
+ this.items = [];
218
+ /** The text typed since the trigger character (`@`/`/`/…) — drives the
219
+ * built-in internal filtering (see `filter` to override it). */
220
+ this.query = '';
221
+ /** Whether the popover is shown. */
222
+ this.open = false;
223
+ /** Overrides the built-in case-insensitive label/description substring match. */
224
+ this.filter = null;
225
+ /** Message shown when `items` (post-`query`-filtering) is empty. */
226
+ this.emptyText = 'No matches';
227
+ /** Accessible name for the `role="listbox"` popup. */
228
+ this.label = 'Suggestions';
229
+ // Highlighted row, opens pre-highlighted on the top match (index 0) so a
230
+ // bare Enter right after opening commits immediately -- the same "first
231
+ // result is pre-selected" UX every mainstream @-mention/slash-command
232
+ // picker (Slack, GitHub, Notion, …) uses, unlike lyra-combobox's own
233
+ // listbox which opens with nothing highlighted (-1) since a combobox's
234
+ // typed text can itself already equal a full, deliberately-typed value.
235
+ this.activeIndex = 0;
236
+ this._listboxId = nextId('mention-popover-listbox');
237
+ // A synthetic zero-size point element, positioned at the measured caret
238
+ // rect and handed to place() in caret-precision mode -- place()/Floating
239
+ // UI only understand a real HTMLElement anchor, so caret positioning goes
240
+ // through this rather than a bespoke non-place()-based positioning path.
241
+ this.virtualAnchor = null;
242
+ this._isFirstUpdate = true;
243
+ // Set by commit() immediately before it flips `open` false, so updated()'s
244
+ // open-transition handling below (which otherwise fires lyra-mention-close
245
+ // on every true->false transition, matching lyra-combobox's/lyra-select's
246
+ // identical lyra-hide handling) can tell a successful-selection close
247
+ // apart from every other close and skip the event for that one case.
248
+ this._suppressCloseEvent = false;
249
+ // Delegated onto [part="listbox"] rather than one closure pair allocated
250
+ // per row per render -- same pattern as lyra-combobox's/lyra-select's
251
+ // identical onListboxMouseDown/onListboxClick.
252
+ this.onListboxMouseDown = (e) => {
253
+ // Focus must never leave the host's own text control -- preventing the
254
+ // default here is what stops a plain (non-focusable) row click from
255
+ // blurring it.
256
+ if (e.target.closest('[part="option"]'))
257
+ e.preventDefault();
258
+ };
259
+ this.onListboxClick = (e) => {
260
+ const optionEl = e.target.closest('[part="option"]');
261
+ const id = optionEl?.dataset.id;
262
+ if (id === undefined)
263
+ return;
264
+ const item = this.filteredItems.find((i) => i.id === id);
265
+ if (item)
266
+ this.commit(item);
267
+ };
268
+ }
269
+ static { this.styles = [LyraElement.styles, styles]; }
270
+ willUpdate(changed) {
271
+ this._isFirstUpdate = !this.hasUpdated;
272
+ // A fresh query or candidate set re-highlights the top match, mirroring
273
+ // how a filtering text field's own suggestion list re-anchors to the
274
+ // first result on every keystroke rather than preserving a highlight
275
+ // that may no longer even be in the filtered set.
276
+ if (changed.has('query') || changed.has('items'))
277
+ this.activeIndex = 0;
278
+ }
279
+ updated(changed) {
280
+ if (changed.has('open')) {
281
+ if (this.open) {
282
+ this.reposition();
283
+ }
284
+ else {
285
+ this.cleanup?.();
286
+ this.cleanup = undefined;
287
+ this.virtualAnchor?.remove();
288
+ // Don't fire for markup that's simply rendering open="false" for the
289
+ // first time, and don't fire for the commit() path (see
290
+ // _suppressCloseEvent's own doc above) -- every other true->false
291
+ // transition (Escape, or a direct host assignment) does fire.
292
+ if (!this._isFirstUpdate && !this._suppressCloseEvent)
293
+ this.emit('lyra-mention-close');
294
+ this._suppressCloseEvent = false;
295
+ }
296
+ }
297
+ else if (this.open && (changed.has('anchor') || changed.has('query'))) {
298
+ this.reposition();
299
+ }
300
+ // Keyed separately from the open/anchor/query branch above: a plain
301
+ // ArrowDown/ArrowUp only ever changes activeIndex (see handleKeyDown), so
302
+ // this must fire on its own rather than piggyback on a reposition. The
303
+ // popup's own [part='listbox'] is height-capped and scrollable (see
304
+ // mention-popover.styles.ts) -- without this, arrowing past its visible
305
+ // rows would silently move the highlight off-screen. `block: 'nearest'`
306
+ // makes this a no-op whenever the active row is already fully visible.
307
+ if (changed.has('activeIndex')) {
308
+ this.renderRoot.querySelector('[part="option"][data-active]')?.scrollIntoView({ block: 'nearest' });
309
+ }
310
+ }
311
+ disconnectedCallback() {
312
+ super.disconnectedCallback();
313
+ this.cleanup?.();
314
+ this.cleanup = undefined;
315
+ this.virtualAnchor?.remove();
316
+ }
317
+ /** The current candidate set: `items` filtered by `query` via `filter`
318
+ * (or the built-in default). Empty `query` returns `items` unfiltered. */
319
+ get filteredItems() {
320
+ const q = this.query.trim().toLowerCase();
321
+ if (!q)
322
+ return this.items;
323
+ const fn = this.filter ?? defaultFilter;
324
+ return this.items.filter((item) => fn(item, q));
325
+ }
326
+ /** The `id` of the currently-highlighted row for the host to apply as its
327
+ * own input's `aria-activedescendant` — `null` while closed or when
328
+ * `filteredItems` is empty (nothing to point at). See the class doc's
329
+ * `@example` for the full wiring. */
330
+ get activeDescendantId() {
331
+ if (!this.open)
332
+ return null;
333
+ const idx = this.clampedIndex(this.filteredItems);
334
+ return idx >= 0 ? this.rowId(idx) : null;
335
+ }
336
+ /** The `id` of the `role="listbox"` popup, for a host that also wants to
337
+ * wire `aria-controls` on its own input (screen-reader support for
338
+ * `aria-controls` is inconsistent, so `activeDescendantId` remains the
339
+ * load-bearing piece; this is a supplementary nicety). */
340
+ get listboxId() {
341
+ return this._listboxId;
342
+ }
343
+ /**
344
+ * The host's own text-control keydown handler calls this while the
345
+ * popover is open. Returns `true` when the key was intercepted
346
+ * (`preventDefault()` already called) and the host should not also act on
347
+ * it; `false` when the host's normal handling should proceed untouched --
348
+ * including ArrowDown/ArrowUp/Enter/Tab when there are zero filtered rows
349
+ * to act on, so e.g. the host's own textarea still moves its caret a line
350
+ * normally rather than having the keystroke silently eaten.
351
+ */
352
+ handleKeyDown(e) {
353
+ if (!this.open)
354
+ return false;
355
+ const rows = this.filteredItems;
356
+ switch (e.key) {
357
+ case 'ArrowDown':
358
+ // Nothing to navigate -- let the key fall through to the host's own
359
+ // control (e.g. move the caret to the next line), matching Enter/Tab's
360
+ // identical "no active row" fallthrough right below.
361
+ if (!rows.length)
362
+ return false;
363
+ e.preventDefault();
364
+ this.activeIndex = Math.min(rows.length - 1, this.clampedIndex(rows) + 1);
365
+ return true;
366
+ case 'ArrowUp':
367
+ if (!rows.length)
368
+ return false;
369
+ e.preventDefault();
370
+ this.activeIndex = Math.max(0, this.clampedIndex(rows) - 1);
371
+ return true;
372
+ case 'Enter':
373
+ case 'Tab': {
374
+ const idx = this.clampedIndex(rows);
375
+ // Nothing to commit -- let Enter submit / Tab move focus normally,
376
+ // matching a native combobox with no highlighted suggestion.
377
+ if (idx < 0)
378
+ return false;
379
+ e.preventDefault();
380
+ this.commit(rows[idx]);
381
+ return true;
382
+ }
383
+ case 'Escape':
384
+ e.preventDefault();
385
+ this.open = false;
386
+ return true;
387
+ default:
388
+ return false;
389
+ }
390
+ }
391
+ clampedIndex(rows) {
392
+ if (!rows.length)
393
+ return -1;
394
+ return Math.min(Math.max(this.activeIndex, 0), rows.length - 1);
395
+ }
396
+ rowId(index) {
397
+ return `${this._listboxId}-opt-${index}`;
398
+ }
399
+ commit(item) {
400
+ this.emit('lyra-mention-select', { id: item.id, label: item.label });
401
+ this._suppressCloseEvent = true;
402
+ this.open = false;
403
+ }
404
+ reposition() {
405
+ this.cleanup?.();
406
+ this.cleanup = undefined;
407
+ const anchorEl = this.resolveAnchorElement();
408
+ const popup = this.renderRoot.querySelector('[part="listbox"]');
409
+ if (anchorEl && popup)
410
+ this.cleanup = place(anchorEl, popup, { placement: 'bottom-start' });
411
+ }
412
+ /** Resolves what to actually hand `place()` -- a caret-precise virtual
413
+ * point for a measurable text control, `anchor` itself otherwise. See the
414
+ * class doc's "Positioning" section. */
415
+ resolveAnchorElement() {
416
+ const anchor = this.anchor;
417
+ if (!anchor)
418
+ return null;
419
+ if (isTextControl(anchor)) {
420
+ const rect = caretClientRect(anchor);
421
+ if (rect) {
422
+ const virtual = this.virtualAnchor ?? (this.virtualAnchor = document.createElement('div'));
423
+ virtual.style.position = 'fixed';
424
+ virtual.style.left = `${rect.left}px`;
425
+ virtual.style.top = `${rect.top}px`;
426
+ virtual.style.width = '0';
427
+ virtual.style.height = `${rect.height}px`;
428
+ virtual.style.pointerEvents = 'none';
429
+ if (!virtual.isConnected)
430
+ document.body.appendChild(virtual);
431
+ return virtual;
432
+ }
433
+ }
434
+ return anchor;
435
+ }
436
+ renderRow(item, index, activeId) {
437
+ const id = this.rowId(index);
438
+ const active = id === activeId;
439
+ return html `
440
+ <div part="option" id=${id} role="option" data-id=${item.id} aria-selected=${active ? 'true' : 'false'} ?data-active=${active}>
441
+ ${item.icon ? html `<span part="option-icon" aria-hidden="true">${item.icon}</span>` : nothing}
442
+ <span part="option-label">
443
+ <span>${item.label}</span>
444
+ ${item.description ? html `<span part="option-description">${item.description}</span>` : nothing}
445
+ </span>
446
+ </div>
447
+ `;
448
+ }
449
+ render() {
450
+ const rows = this.filteredItems;
451
+ const idx = this.clampedIndex(rows);
452
+ const activeId = idx >= 0 ? this.rowId(idx) : '';
453
+ return html `
454
+ <div
455
+ part="listbox"
456
+ id=${this._listboxId}
457
+ role="listbox"
458
+ aria-label=${this.label}
459
+ @mousedown=${this.onListboxMouseDown}
460
+ @click=${this.onListboxClick}
461
+ >
462
+ ${rows.length === 0
463
+ ? html `<div part="empty" role="option" aria-selected="false" aria-disabled="true">${this.emptyText}</div>`
464
+ : rows.map((item, i) => this.renderRow(item, i, activeId))}
465
+ </div>
466
+ `;
467
+ }
468
+ }
469
+ __decorate([
470
+ property({ attribute: false })
471
+ ], LyraMentionPopover.prototype, "anchor", void 0);
472
+ __decorate([
473
+ property({ attribute: false })
474
+ ], LyraMentionPopover.prototype, "items", void 0);
475
+ __decorate([
476
+ property()
477
+ ], LyraMentionPopover.prototype, "query", void 0);
478
+ __decorate([
479
+ property({ type: Boolean, reflect: true })
480
+ ], LyraMentionPopover.prototype, "open", void 0);
481
+ __decorate([
482
+ property({ attribute: false })
483
+ ], LyraMentionPopover.prototype, "filter", void 0);
484
+ __decorate([
485
+ property({ attribute: 'empty-text' })
486
+ ], LyraMentionPopover.prototype, "emptyText", void 0);
487
+ __decorate([
488
+ property()
489
+ ], LyraMentionPopover.prototype, "label", void 0);
490
+ __decorate([
491
+ state()
492
+ ], LyraMentionPopover.prototype, "activeIndex", void 0);
493
+ defineElement('mention-popover', LyraMentionPopover);
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,101 @@
1
+ import { css } from 'lit';
2
+ export const styles = css `
3
+ :host {
4
+ display: contents;
5
+ }
6
+
7
+ /* Positioned by internal/positioner.js's place() -- same fixed/z-index
8
+ shape as lyra-combobox's/lyra-select's own [part='listbox']. Closed
9
+ state: invisible + slightly raised, transitioning in on :host([open]),
10
+ same as those two. */
11
+ [part='listbox'] {
12
+ position: fixed;
13
+ z-index: 900;
14
+ box-sizing: border-box;
15
+ max-block-size: 16rem;
16
+ overflow-y: auto;
17
+ inline-size: max-content;
18
+ min-inline-size: 14rem;
19
+ max-inline-size: min(92vw, 24rem);
20
+ padding: var(--lyra-space-xs);
21
+ background: var(--lyra-color-surface);
22
+ border: 1px solid var(--lyra-color-border);
23
+ border-radius: var(--lyra-radius);
24
+ box-shadow: var(--lyra-shadow);
25
+ visibility: hidden;
26
+ opacity: 0;
27
+ transform: translateY(-0.25rem);
28
+ transition:
29
+ opacity var(--lyra-transition-fast),
30
+ transform var(--lyra-transition-fast),
31
+ visibility var(--lyra-transition-fast);
32
+ }
33
+ :host([open]) [part='listbox'] {
34
+ visibility: visible;
35
+ opacity: 1;
36
+ transform: translateY(0);
37
+ }
38
+ @media (prefers-reduced-motion: reduce) {
39
+ [part='listbox'] {
40
+ transition: none !important;
41
+ }
42
+ }
43
+
44
+ [part='option'] {
45
+ display: flex;
46
+ align-items: flex-start;
47
+ gap: var(--lyra-space-xs);
48
+ inline-size: 100%;
49
+ padding: var(--lyra-space-xs) var(--lyra-space-s);
50
+ border-radius: var(--lyra-radius);
51
+ cursor: pointer;
52
+ }
53
+ [part='option'][data-active] {
54
+ background: var(--lyra-color-brand-quiet);
55
+ }
56
+ [part='option'][aria-selected='true'] {
57
+ color: var(--lyra-color-brand);
58
+ }
59
+
60
+ [part='option-icon'] {
61
+ flex: 0 0 auto;
62
+ line-height: 1.4;
63
+ }
64
+
65
+ [part='option-label'] {
66
+ display: flex;
67
+ flex-direction: column;
68
+ min-inline-size: 0;
69
+ line-height: 1.4;
70
+ }
71
+ [part='option-label'] span:first-child {
72
+ overflow: hidden;
73
+ text-overflow: ellipsis;
74
+ white-space: nowrap;
75
+ }
76
+
77
+ [part='option-description'] {
78
+ font-size: 0.75rem;
79
+ color: var(--lyra-color-text-quiet);
80
+ overflow: hidden;
81
+ text-overflow: ellipsis;
82
+ white-space: nowrap;
83
+ }
84
+ /* --lyra-color-text-quiet-on-brand-quiet fails WCAG AA (~4.24:1, needs
85
+ 4.5:1) -- unlike lyra-combobox's/lyra-select's identical-looking
86
+ [part='option'][data-active] background (which never has this problem
87
+ in practice, since those default their active index to -1/none until a
88
+ user actually arrows through the list), this component always opens
89
+ with row 0 pre-highlighted (see the activeIndex field's own doc), so the
90
+ active/quiet-text combination is the default state, not an edge case --
91
+ it must pass contrast on its own. */
92
+ [part='option'][data-active] [part='option-description'] {
93
+ color: var(--lyra-color-text);
94
+ }
95
+
96
+ [part='empty'] {
97
+ padding: var(--lyra-space-s) var(--lyra-space-m);
98
+ color: var(--lyra-color-text-quiet);
99
+ font-size: 0.875rem;
100
+ }
101
+ `;