@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,363 @@
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 { activateOverlay, deepActiveElement } from '../../internal/overlay-manager.js';
11
+ import { defineElement } from '../../internal/prefix.js';
12
+ import { lockScroll } from '../../internal/scroll-lock.js';
13
+ import { styles } from './responsive-panel.styles.js';
14
+ const HEADING_SELECTOR = 'h1, h2, h3, h4, h5, h6, [role="heading"]';
15
+ /**
16
+ * Pure resolution of the `mode` prop + current viewport into the actual
17
+ * presentation. Kept separate from the `matchMedia` listener wiring below so
18
+ * it's independently unit-testable, and so the live-viewport-response logic
19
+ * can be exercised in tests by calling it (or the instance method that wraps
20
+ * it) directly instead of needing control over the real browser window,
21
+ * which `@web/test-runner` doesn't give.
22
+ */
23
+ export function resolveEffectiveMode(mode, belowBreakpoint) {
24
+ if (mode === 'inline' || mode === 'overlay')
25
+ return mode;
26
+ return belowBreakpoint ? 'overlay' : 'inline';
27
+ }
28
+ /**
29
+ * `<lyra-responsive-panel>` — the same slotted content either docked inline
30
+ * in the page's normal layout flow (desktop) or presented as a full-screen/
31
+ * bottom-sheet overlay (mobile), depending on viewport width. Typical uses:
32
+ * a settings panel or a conversation-history sidebar that's a permanent
33
+ * docked pane on a wide screen but a modal on a phone.
34
+ *
35
+ * Breakpoint detection uses `matchMedia('(max-width: ' + mobileBreakpoint +
36
+ * ')')`, re-evaluated live while connected -- resizing/rotating a device
37
+ * that crosses the breakpoint while `mode="auto"` (the default) updates the
38
+ * effective presentation without unmounting or re-creating the slotted
39
+ * content: inline and overlay presentation share the exact same shadow DOM
40
+ * structure (only a css class, and the overlay-only `role`/`aria-modal`
41
+ * attributes and backdrop element, differ), so lit-html's diffing keeps
42
+ * `[part="body"]` and its `<slot>` as the same DOM node across the
43
+ * transition -- scroll position and focus inside the slotted content survive
44
+ * it for free. When an open inline panel becomes modal, focus already inside
45
+ * is preserved and outside focus moves to the first available target. Closing
46
+ * still returns to the opener captured by the original inline open.
47
+ *
48
+ * The overlay presentation uses the library's shared overlay coordinator for
49
+ * focus trapping, Escape/backdrop dismissal, inerting, and stack ordering,
50
+ * while retaining this component's own responsive rendering and close event.
51
+ *
52
+ * Accessible name (overlay presentation only -- the inline presentation has
53
+ * no dialog semantics to name): `label`, when set, is used verbatim. When
54
+ * `label` is empty, this falls back to the `header` slot's content -- a
55
+ * heading element (`h1`–`h6` or `[role="heading"]`) among the slotted header
56
+ * content wins if present, otherwise the header slot's full text content is
57
+ * used, mirroring lyra-dialog's `detectHeading()`/`headingText` fallback (see
58
+ * dialog.ts's module doc for why this uses `aria-label`, a copied string,
59
+ * rather than `aria-labelledby`: the header content is light DOM while
60
+ * `[part="panel"]` lives in this element's shadow tree, and an ID-reference
61
+ * attribute can't resolve across that boundary). A panel opened without
62
+ * either `label` or header content still renders `role="dialog"` with no
63
+ * accessible name -- set one of the two to avoid that.
64
+ *
65
+ * @customElement lyra-responsive-panel
66
+ * @slot - The panel body.
67
+ * @slot header - Optional header content, rendered above the body.
68
+ * @slot footer - Optional footer content (e.g. action buttons), rendered below the body.
69
+ * @event lyra-close - `detail: ResponsivePanelCloseReason`. Fired by the overlay presentation's
70
+ * built-in dismiss triggers (Escape, backdrop click) and by any `close()` call, in either
71
+ * presentation -- a plain `open = false` property write does not fire it (matching
72
+ * lyra-dialog's own precedent: only going through `close()` counts as a dismissal), and this
73
+ * is deliberately the same event/semantics in both presentations, rather than only being
74
+ * meaningful for the overlay case, so a consumer only has to wire up one listener regardless
75
+ * of which presentation is currently active.
76
+ * @event lyra-mode-change - `detail: ResponsivePanelModeChangeDetail`. Fired whenever the
77
+ * *effective* mode (not the `mode` prop's literal value, which may be `'auto'`) changes between
78
+ * `'inline'` and `'overlay'` -- crossing the breakpoint while `mode="auto"`, or the host
79
+ * reassigning `mode` to a value that changes the effective presentation. Never fired for the
80
+ * initial render, only for a live change thereafter.
81
+ * @csspart base - The root wrapper; `display: none` while closed, positioned `fixed` while open
82
+ * and in the overlay presentation.
83
+ * @csspart backdrop - The full-viewport scrim behind the panel -- only rendered in the overlay
84
+ * presentation.
85
+ * @csspart panel - The panel surface itself (`role="dialog"` while open and in the overlay
86
+ * presentation).
87
+ * @csspart header - The wrapper around the `header` slot.
88
+ * @csspart body - The wrapper around the default slot.
89
+ * @csspart footer - The wrapper around the `footer` slot.
90
+ */
91
+ export class LyraResponsivePanel extends LyraElement {
92
+ constructor() {
93
+ super(...arguments);
94
+ /** Whether the panel is open. In the inline presentation this just means visible/mounted; in
95
+ * the overlay presentation this is the actual modal open/closed state. */
96
+ this.open = false;
97
+ /** `'auto'` (default) tracks `mobile-breakpoint` live; `'inline'`/`'overlay'` force that
98
+ * presentation regardless of viewport width. */
99
+ this.mode = 'auto';
100
+ /** Only affects the overlay presentation's visual treatment -- `'fullscreen'` (default) covers
101
+ * the whole viewport; `'bottom-sheet'` slides up from the bottom and doesn't cover the full
102
+ * height. */
103
+ this.variant = 'fullscreen';
104
+ /** Accessible name for the overlay presentation's `role="dialog"`. Unused in the inline
105
+ * presentation, which has no dialog semantics to name. When empty, falls back to the `header`
106
+ * slot's content -- see the class doc for the full fallback order. */
107
+ this.label = '';
108
+ /** CSS length passed to `matchMedia` as `(max-width: <this>)` to decide, in `mode="auto"`,
109
+ * whether the effective presentation is `'overlay'` (below/at this width) or `'inline'`
110
+ * (above it). */
111
+ this.mobileBreakpoint = '768px';
112
+ this.belowBreakpoint = false;
113
+ this.effectiveMode = 'inline';
114
+ this.hasHeaderSlot = false;
115
+ this.hasFooterSlot = false;
116
+ /** Whether the overlay-only mechanics (scroll-lock and shared overlay registration) are currently
117
+ * engaged -- derived from `effectiveMode === 'overlay' && open`, tracked separately from those
118
+ * two properties so willUpdate can diff "was engaged" vs "should be engaged now" regardless of
119
+ * which of the two changed. */
120
+ this.overlayChromeActive = false;
121
+ this.focusOverlayAfterUpdate = false;
122
+ this.isFirstUpdate = true;
123
+ this.onMediaChange = (e) => {
124
+ this.handleBreakpointChange(e.matches);
125
+ };
126
+ this.onHeaderSlotChange = (e) => {
127
+ this.hasHeaderSlot = e.target.assignedElements({ flatten: true }).length > 0;
128
+ this.headingText = this.detectHeadingText();
129
+ };
130
+ this.onFooterSlotChange = (e) => {
131
+ this.hasFooterSlot = e.target.assignedElements({ flatten: true }).length > 0;
132
+ };
133
+ this.onBackdropClick = () => {
134
+ this.overlayHandle?.dismissBackdrop();
135
+ };
136
+ }
137
+ static { this.styles = [LyraElement.styles, styles]; }
138
+ willUpdate(changed) {
139
+ this.isFirstUpdate = !this.hasUpdated;
140
+ if (this.isFirstUpdate) {
141
+ this.hasHeaderSlot = Array.from(this.children).some((el) => el.getAttribute('slot') === 'header');
142
+ this.hasFooterSlot = Array.from(this.children).some((el) => el.getAttribute('slot') === 'footer');
143
+ this.headingText = this.detectHeadingText();
144
+ }
145
+ // Must run before the effectiveMode computation below reads
146
+ // belowBreakpoint: setupMediaQuery() -> handleBreakpointChange() mutates
147
+ // belowBreakpoint synchronously, and a runtime mobileBreakpoint change is
148
+ // otherwise the only kind of change in this method that doesn't itself
149
+ // touch mode/belowBreakpoint, so computing effectiveMode first would read
150
+ // the not-yet-updated belowBreakpoint and never get another chance to
151
+ // react -- a property write from inside willUpdate doesn't schedule a
152
+ // fresh update, it only folds into the one already in progress.
153
+ // mobileBreakpoint is present on the very first willUpdate too (Lit's
154
+ // changed-properties map includes every class-field default from
155
+ // construction), but connectedCallback() already called setupMediaQuery()
156
+ // once before this first update runs, so repeating it here would be
157
+ // redundant -- only a live post-mount change should re-run it.
158
+ if (!this.isFirstUpdate && changed.has('mobileBreakpoint') && this.isConnected) {
159
+ this.setupMediaQuery();
160
+ }
161
+ if (this.isFirstUpdate || changed.has('mode') || changed.has('belowBreakpoint')) {
162
+ this.effectiveMode = resolveEffectiveMode(this.mode, this.belowBreakpoint);
163
+ }
164
+ // Captured on a genuine open transition only, independent of
165
+ // effectiveMode at that moment -- so it reflects whatever triggered the
166
+ // open even if a later breakpoint crossing (while still open) switches
167
+ // the presentation to overlay before close() runs. Deliberately not
168
+ // folded into the overlayOpen-engage branch below: that branch also
169
+ // fires when only effectiveMode (not open) changes, which would
170
+ // re-capture whatever currently has focus (e.g. something inside the
171
+ // panel) instead of the original external trigger.
172
+ if (changed.has('open') && this.open) {
173
+ const active = deepActiveElement(this.ownerDocument);
174
+ this.lastTrigger = active && typeof active.focus === 'function' ? active : undefined;
175
+ }
176
+ const overlayOpen = this.effectiveMode === 'overlay' && this.open;
177
+ if (overlayOpen !== this.overlayChromeActive) {
178
+ this.overlayChromeActive = overlayOpen;
179
+ if (overlayOpen) {
180
+ this.activateOverlayChrome();
181
+ // Once the presentation becomes modal, focus cannot remain behind
182
+ // it. The manager preserves focus that is already inside the panel
183
+ // and otherwise moves it to the first composed focus target.
184
+ this.focusOverlayAfterUpdate = true;
185
+ }
186
+ else {
187
+ // Removing modal chrome while the still-open panel becomes inline
188
+ // must preserve focus in that same panel. Only a real open -> closed
189
+ // transition restores the opener.
190
+ this.deactivateOverlayChrome(changed.has('open') && !this.open);
191
+ }
192
+ }
193
+ if (changed.has('open') && !this.open)
194
+ this.lastTrigger = undefined;
195
+ }
196
+ // Runs after render (not willUpdate) so [part="panel"] has already landed
197
+ // in the DOM before the fallback .focus() call below can rely on it --
198
+ // mirrors lyra-dialog's identical ordering rationale.
199
+ updated(changed) {
200
+ if (!this.isFirstUpdate && changed.has('effectiveMode')) {
201
+ this.emit('lyra-mode-change', { mode: this.effectiveMode });
202
+ }
203
+ if (this.focusOverlayAfterUpdate) {
204
+ this.focusOverlayAfterUpdate = false;
205
+ this.overlayHandle?.focusInitial();
206
+ }
207
+ }
208
+ connectedCallback() {
209
+ super.connectedCallback();
210
+ this.setupMediaQuery();
211
+ // A reconnect (e.g. a drag-and-drop reparent keeping this same element
212
+ // instance) fires disconnectedCallback then connectedCallback
213
+ // synchronously with no update in between, so willUpdate never reruns to
214
+ // notice overlay chrome is still supposed to be active -- restore it.
215
+ const overlayOpen = resolveEffectiveMode(this.mode, this.belowBreakpoint) === 'overlay' && this.open;
216
+ if (this.hasUpdated && overlayOpen) {
217
+ if (this.overlayHandle?.isActive()) {
218
+ this.overlayHandle.resume();
219
+ }
220
+ else {
221
+ this.activateOverlayChrome();
222
+ }
223
+ if (!this.releaseScrollLock)
224
+ this.releaseScrollLock = lockScroll(this.ownerDocument);
225
+ queueMicrotask(() => this.overlayHandle?.focusInitial());
226
+ }
227
+ }
228
+ disconnectedCallback() {
229
+ super.disconnectedCallback();
230
+ this.mediaQuery?.removeEventListener('change', this.onMediaChange);
231
+ this.mediaQuery = undefined;
232
+ this.releaseScrollLock?.();
233
+ this.releaseScrollLock = undefined;
234
+ this.overlayHandle?.suspend();
235
+ }
236
+ activateOverlayChrome() {
237
+ this.releaseScrollLock ??= lockScroll(this.ownerDocument);
238
+ this.overlayHandle = activateOverlay({
239
+ host: this,
240
+ panel: () => this.shadowRoot?.querySelector('[part="panel"]') ?? null,
241
+ onEscape: () => this.close('escape'),
242
+ onBackdrop: () => this.close('backdrop'),
243
+ restoreFocusTo: this.lastTrigger ?? null,
244
+ });
245
+ }
246
+ deactivateOverlayChrome(restoreFocus = true) {
247
+ this.releaseScrollLock?.();
248
+ this.releaseScrollLock = undefined;
249
+ this.overlayHandle?.deactivate({ restoreFocus });
250
+ this.overlayHandle = undefined;
251
+ }
252
+ setupMediaQuery() {
253
+ this.mediaQuery?.removeEventListener('change', this.onMediaChange);
254
+ const view = this.ownerDocument.defaultView;
255
+ if (!view?.matchMedia) {
256
+ this.mediaQuery = undefined;
257
+ return;
258
+ }
259
+ this.mediaQuery = view.matchMedia(`(max-width: ${this.mobileBreakpoint})`);
260
+ this.mediaQuery.addEventListener('change', this.onMediaChange);
261
+ this.handleBreakpointChange(this.mediaQuery.matches);
262
+ }
263
+ /** The breakpoint-response logic itself, kept callable independently of the
264
+ * `matchMedia` listener that normally drives it -- tests invoke this
265
+ * directly to simulate crossing the breakpoint. */
266
+ handleBreakpointChange(matches) {
267
+ this.belowBreakpoint = matches;
268
+ }
269
+ // Only direct children slotted into `header` are scanned -- same depth
270
+ // limit lyra-dialog's own detectHeading() applies to its direct children.
271
+ // A heading tag among them wins (its own text only, so a header slot mixing
272
+ // a heading with e.g. a trailing icon button doesn't pull the button's
273
+ // label into the accessible name); otherwise the header slot's combined
274
+ // text stands in for it, since this component (unlike lyra-dialog) has a
275
+ // dedicated header slot that's already the conventional place a heading
276
+ // would go. Recomputed only on slot assignment changes, not on every
277
+ // render -- same rationale as lyra-dialog's detectHeading().
278
+ detectHeadingText() {
279
+ const headerChildren = Array.from(this.children).filter((el) => el.getAttribute('slot') === 'header');
280
+ if (headerChildren.length === 0)
281
+ return undefined;
282
+ const heading = headerChildren.find((el) => el.matches(HEADING_SELECTOR));
283
+ if (heading)
284
+ return heading.textContent?.trim() || undefined;
285
+ return (headerChildren
286
+ .map((el) => el.textContent?.trim())
287
+ .filter(Boolean)
288
+ .join(' ') || undefined);
289
+ }
290
+ /**
291
+ * Close the panel. `reason` is forwarded as the `lyra-close` detail --
292
+ * built-in overlay triggers pass `'escape'`/`'backdrop'`; a consumer's own
293
+ * close affordance (e.g. a footer button, or a docked panel's own toggle)
294
+ * should call this directly with its own reason string. Fires in both
295
+ * presentations (see the class doc's `lyra-close` note) but only returns
296
+ * focus to the trigger that opened it when the overlay presentation is
297
+ * active, since the inline presentation never took focus away from
298
+ * anything to begin with.
299
+ */
300
+ close(reason = 'api') {
301
+ if (!this.open)
302
+ return;
303
+ this.open = false;
304
+ this.emit('lyra-close', reason);
305
+ }
306
+ render() {
307
+ const overlay = this.effectiveMode === 'overlay';
308
+ const accessibleName = this.label || this.headingText;
309
+ return html `
310
+ <div part="base" class=${overlay ? 'overlay' : 'inline'}>
311
+ ${overlay ? html `<div part="backdrop" @click=${this.onBackdropClick}></div>` : nothing}
312
+ <div
313
+ part="panel"
314
+ role=${overlay ? 'dialog' : nothing}
315
+ aria-modal=${overlay ? 'true' : nothing}
316
+ aria-label=${overlay && accessibleName ? accessibleName : nothing}
317
+ tabindex=${overlay ? '-1' : nothing}
318
+ >
319
+ <div part="header" ?hidden=${!this.hasHeaderSlot}>
320
+ <slot name="header" @slotchange=${this.onHeaderSlotChange}></slot>
321
+ </div>
322
+ <div part="body">
323
+ <slot></slot>
324
+ </div>
325
+ <div part="footer" ?hidden=${!this.hasFooterSlot}>
326
+ <slot name="footer" @slotchange=${this.onFooterSlotChange}></slot>
327
+ </div>
328
+ </div>
329
+ </div>
330
+ `;
331
+ }
332
+ }
333
+ __decorate([
334
+ property({ type: Boolean, reflect: true })
335
+ ], LyraResponsivePanel.prototype, "open", void 0);
336
+ __decorate([
337
+ property({ reflect: true })
338
+ ], LyraResponsivePanel.prototype, "mode", void 0);
339
+ __decorate([
340
+ property({ reflect: true })
341
+ ], LyraResponsivePanel.prototype, "variant", void 0);
342
+ __decorate([
343
+ property()
344
+ ], LyraResponsivePanel.prototype, "label", void 0);
345
+ __decorate([
346
+ property({ attribute: 'mobile-breakpoint' })
347
+ ], LyraResponsivePanel.prototype, "mobileBreakpoint", void 0);
348
+ __decorate([
349
+ state()
350
+ ], LyraResponsivePanel.prototype, "belowBreakpoint", void 0);
351
+ __decorate([
352
+ state()
353
+ ], LyraResponsivePanel.prototype, "effectiveMode", void 0);
354
+ __decorate([
355
+ state()
356
+ ], LyraResponsivePanel.prototype, "hasHeaderSlot", void 0);
357
+ __decorate([
358
+ state()
359
+ ], LyraResponsivePanel.prototype, "hasFooterSlot", void 0);
360
+ __decorate([
361
+ state()
362
+ ], LyraResponsivePanel.prototype, "headingText", void 0);
363
+ defineElement('responsive-panel', LyraResponsivePanel);
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,103 @@
1
+ import { css } from 'lit';
2
+ export const styles = css `
3
+ :host {
4
+ /* Overlay scrim color -- component-specific so a host can retheme it
5
+ without a raw literal leaking into the public API (no shared
6
+ --wa-*-overlay token exists in the design system to resolve through,
7
+ same rationale as lyra-dialog's own --lyra-dialog-overlay-color and
8
+ lyra-widget's --lyra-widget-overlay-color). */
9
+ --lyra-responsive-panel-overlay-color: rgb(0 0 0 / 0.5);
10
+ display: block;
11
+ }
12
+
13
+ /* [part="base"] is display:none whenever the panel isn't open, in both
14
+ presentations -- a docked (inline) panel can be toggled closed just like
15
+ an overlay one, it just doesn't need backdrop/focus-trap/scroll-lock
16
+ mechanics to do it. */
17
+ [part='base'] {
18
+ display: none;
19
+ }
20
+ :host([open]) [part='base'] {
21
+ display: block;
22
+ }
23
+ :host([open]) [part='base'].overlay {
24
+ display: flex;
25
+ position: fixed;
26
+ inset: 0;
27
+ z-index: var(--lyra-overlay-stack-index, 1000);
28
+ }
29
+ /* Bottom-sheet anchors its panel to the block-end edge instead of
30
+ stretching it full-height like fullscreen does. */
31
+ :host([variant='bottom-sheet'][open]) [part='base'].overlay {
32
+ align-items: flex-end;
33
+ }
34
+
35
+ [part='backdrop'] {
36
+ position: absolute;
37
+ inset: 0;
38
+ background: var(--lyra-responsive-panel-overlay-color);
39
+ }
40
+
41
+ [part='panel'] {
42
+ position: relative;
43
+ display: flex;
44
+ flex-direction: column;
45
+ min-block-size: 0;
46
+ background: var(--lyra-color-surface);
47
+ }
48
+
49
+ /* Inline (docked) presentation: a normal panel in the page's layout flow,
50
+ bordered like a card so it reads as a distinct region. */
51
+ [part='base']:not(.overlay) [part='panel'] {
52
+ border: 1px solid var(--lyra-color-border);
53
+ border-radius: var(--lyra-radius);
54
+ overflow: auto;
55
+ }
56
+
57
+ /* Overlay/fullscreen (default variant): the panel fills the entire
58
+ viewport edge-to-edge -- no backdrop is visible around it, but the
59
+ backdrop element still renders/still matters for the shared
60
+ Escape/backdrop-click dismissal wiring described on the class. */
61
+ [part='base'].overlay [part='panel'] {
62
+ inline-size: 100%;
63
+ block-size: 100%;
64
+ box-shadow: var(--lyra-shadow);
65
+ overflow: auto;
66
+ }
67
+
68
+ /* Overlay/bottom-sheet: a partial-height sheet, rounded only on the top
69
+ edge, that leaves the backdrop (and whatever page content sits behind
70
+ it) visible above it. */
71
+ :host([variant='bottom-sheet']) [part='base'].overlay [part='panel'] {
72
+ block-size: auto;
73
+ max-block-size: 85vh;
74
+ border-start-start-radius: var(--lyra-radius);
75
+ border-start-end-radius: var(--lyra-radius);
76
+ }
77
+
78
+ [part='header'] {
79
+ padding: var(--lyra-space-m) var(--lyra-space-l);
80
+ border-block-end: 1px solid var(--lyra-color-border);
81
+ }
82
+ [part='header'][hidden] {
83
+ display: none;
84
+ }
85
+
86
+ [part='body'] {
87
+ flex: 1;
88
+ padding: var(--lyra-space-l);
89
+ overflow: auto;
90
+ }
91
+
92
+ [part='footer'] {
93
+ display: flex;
94
+ align-items: center;
95
+ justify-content: flex-end;
96
+ gap: var(--lyra-space-s);
97
+ padding: var(--lyra-space-m) var(--lyra-space-l);
98
+ border-block-start: 1px solid var(--lyra-color-border);
99
+ }
100
+ [part='footer'][hidden] {
101
+ display: none;
102
+ }
103
+ `;
@@ -0,0 +1,50 @@
1
+ import { type TemplateResult } from 'lit';
2
+ import { LyraElement } from '../../internal/lyra-element.js';
3
+ /**
4
+ * `<lyra-result-card>` — a small bordered card shell for a custom tool-result
5
+ * renderer's body (see `<lyra-tool-result-view>`'s `registerToolRenderer()`
6
+ * in `../tool-result-view/registry.js`). Purely visual, with no state of its
7
+ * own beyond slot-presence tracking: it gives every custom renderer the same
8
+ * "small card" language (border, radius, optional title + header actions)
9
+ * without each one hand-rolling its own box.
10
+ *
11
+ * Pairs with `<lyra-result-field>` for the label/value rows that typically
12
+ * make up the body, though the default slot accepts any content — nothing
13
+ * here requires a `<lyra-result-field>` specifically.
14
+ *
15
+ * @customElement lyra-result-card
16
+ * @slot - The card body — typically one or more `<lyra-result-field>` rows.
17
+ * @slot actions - Small header controls (e.g. a copy button), rendered
18
+ * alongside the title.
19
+ * @csspart base - The outer bordered container.
20
+ * @csspart header - The header row wrapping the title and the `actions`
21
+ * slot. Present in the DOM at all times (so a later `slotchange` on
22
+ * `actions` is still observed) but `hidden` whenever there is no `title`
23
+ * and no `actions` content — an untitled, action-less card has no visible
24
+ * header bar at all.
25
+ * @csspart title - The title text. Truncates with an ellipsis when it
26
+ * overflows; carries its own native `title` attribute (the full string) so
27
+ * hovering the truncated text reveals it via the browser's default tooltip,
28
+ * scoped to just this element rather than the whole card.
29
+ * @csspart actions - The wrapper around the `actions` slot. `hidden`
30
+ * whenever the slot has no assigned content.
31
+ * @csspart body - The wrapper around the default slot.
32
+ */
33
+ export declare class LyraResultCard extends LyraElement {
34
+ static styles: import("lit").CSSResultGroup[];
35
+ /** Small heading for the card. Leave unset for an untitled card (e.g. a
36
+ * bare block of `<lyra-result-field>` rows with no natural heading).
37
+ * Rendered into the truncating `[part="title"]` span, which also carries
38
+ * this value as its own `title` attribute so the disclosure tooltip is
39
+ * scoped to that element rather than the whole host. */
40
+ title: string;
41
+ private hasActionsSlot;
42
+ protected willUpdate(): void;
43
+ private onActionsSlotChange;
44
+ render(): TemplateResult;
45
+ }
46
+ declare global {
47
+ interface HTMLElementTagNameMap {
48
+ 'lyra-result-card': LyraResultCard;
49
+ }
50
+ }
@@ -0,0 +1,89 @@
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 { styles } from './result-card.styles.js';
12
+ /**
13
+ * `<lyra-result-card>` — a small bordered card shell for a custom tool-result
14
+ * renderer's body (see `<lyra-tool-result-view>`'s `registerToolRenderer()`
15
+ * in `../tool-result-view/registry.js`). Purely visual, with no state of its
16
+ * own beyond slot-presence tracking: it gives every custom renderer the same
17
+ * "small card" language (border, radius, optional title + header actions)
18
+ * without each one hand-rolling its own box.
19
+ *
20
+ * Pairs with `<lyra-result-field>` for the label/value rows that typically
21
+ * make up the body, though the default slot accepts any content — nothing
22
+ * here requires a `<lyra-result-field>` specifically.
23
+ *
24
+ * @customElement lyra-result-card
25
+ * @slot - The card body — typically one or more `<lyra-result-field>` rows.
26
+ * @slot actions - Small header controls (e.g. a copy button), rendered
27
+ * alongside the title.
28
+ * @csspart base - The outer bordered container.
29
+ * @csspart header - The header row wrapping the title and the `actions`
30
+ * slot. Present in the DOM at all times (so a later `slotchange` on
31
+ * `actions` is still observed) but `hidden` whenever there is no `title`
32
+ * and no `actions` content — an untitled, action-less card has no visible
33
+ * header bar at all.
34
+ * @csspart title - The title text. Truncates with an ellipsis when it
35
+ * overflows; carries its own native `title` attribute (the full string) so
36
+ * hovering the truncated text reveals it via the browser's default tooltip,
37
+ * scoped to just this element rather than the whole card.
38
+ * @csspart actions - The wrapper around the `actions` slot. `hidden`
39
+ * whenever the slot has no assigned content.
40
+ * @csspart body - The wrapper around the default slot.
41
+ */
42
+ export class LyraResultCard extends LyraElement {
43
+ constructor() {
44
+ super(...arguments);
45
+ /** Small heading for the card. Leave unset for an untitled card (e.g. a
46
+ * bare block of `<lyra-result-field>` rows with no natural heading).
47
+ * Rendered into the truncating `[part="title"]` span, which also carries
48
+ * this value as its own `title` attribute so the disclosure tooltip is
49
+ * scoped to that element rather than the whole host. */
50
+ this.title = '';
51
+ // See `<lyra-widget>`'s identical `hasActionsSlot` -- a `[part]` wrapper
52
+ // always contains a literal `<slot>` child regardless of assigned
53
+ // content, so CSS `:empty` never matches; real emptiness is tracked here
54
+ // in JS instead and used to both hide the actions wrapper and decide
55
+ // whether the header row itself has anything to show.
56
+ this.hasActionsSlot = false;
57
+ this.onActionsSlotChange = (e) => {
58
+ this.hasActionsSlot = e.target.assignedElements({ flatten: true }).length > 0;
59
+ };
60
+ }
61
+ static { this.styles = [LyraElement.styles, styles]; }
62
+ willUpdate() {
63
+ if (!this.hasUpdated) {
64
+ this.hasActionsSlot = Array.from(this.children).some((el) => el.getAttribute('slot') === 'actions');
65
+ }
66
+ }
67
+ render() {
68
+ const hasTitle = this.title.length > 0;
69
+ const hasHeader = hasTitle || this.hasActionsSlot;
70
+ return html `
71
+ <div part="base">
72
+ <div part="header" ?hidden=${!hasHeader}>
73
+ ${hasTitle ? html `<span part="title" title=${this.title}>${this.title}</span>` : nothing}
74
+ <div part="actions" ?hidden=${!this.hasActionsSlot}>
75
+ <slot name="actions" @slotchange=${this.onActionsSlotChange}></slot>
76
+ </div>
77
+ </div>
78
+ <div part="body"><slot></slot></div>
79
+ </div>
80
+ `;
81
+ }
82
+ }
83
+ __decorate([
84
+ property()
85
+ ], LyraResultCard.prototype, "title", void 0);
86
+ __decorate([
87
+ state()
88
+ ], LyraResultCard.prototype, "hasActionsSlot", void 0);
89
+ defineElement('result-card', LyraResultCard);
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,49 @@
1
+ import { css } from 'lit';
2
+ export const styles = css `
3
+ :host {
4
+ display: block;
5
+ }
6
+ [part='base'] {
7
+ display: flex;
8
+ flex-direction: column;
9
+ border: 1px solid var(--lyra-color-border);
10
+ border-radius: var(--lyra-radius);
11
+ background: var(--lyra-color-surface);
12
+ overflow: hidden;
13
+ font-size: 0.8125rem;
14
+ }
15
+ [part='header'] {
16
+ display: flex;
17
+ align-items: center;
18
+ gap: var(--lyra-space-s);
19
+ padding: var(--lyra-space-xs) var(--lyra-space-s);
20
+ border-block-end: 1px solid var(--lyra-color-border);
21
+ }
22
+ [part='header'][hidden] {
23
+ display: none;
24
+ }
25
+ [part='title'] {
26
+ flex: 1 1 auto;
27
+ min-inline-size: 0;
28
+ color: var(--lyra-color-text);
29
+ font-weight: 600;
30
+ overflow: hidden;
31
+ text-overflow: ellipsis;
32
+ white-space: nowrap;
33
+ }
34
+ [part='actions'] {
35
+ display: flex;
36
+ align-items: center;
37
+ gap: var(--lyra-space-xs);
38
+ flex: 0 0 auto;
39
+ }
40
+ [part='actions'][hidden] {
41
+ display: none;
42
+ }
43
+ [part='body'] {
44
+ display: flex;
45
+ flex-direction: column;
46
+ gap: var(--lyra-space-xs);
47
+ padding: var(--lyra-space-s);
48
+ }
49
+ `;