@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,184 @@
1
+ import { css } from 'lit';
2
+ export const styles = css `
3
+ :host {
4
+ display: inline-flex;
5
+ max-inline-size: 100%;
6
+ /* Per-status accent -- one custom property swapped by the :host([status])
7
+ rules below rather than repeating background/border per part per
8
+ status. Mirrors lyra-tool-call-chip's identical
9
+ --lyra-tool-call-chip-accent/-bg/-border trio, so a chip's tone
10
+ vocabulary reads the same everywhere in the library. Defaults to the
11
+ 'pending' tone so an unset/unknown status still reads as neutral
12
+ instead of unstyled. */
13
+ --lyra-attachment-chip-accent: var(--lyra-color-text-quiet);
14
+ --lyra-attachment-chip-bg: var(--lyra-color-surface);
15
+ --lyra-attachment-chip-border: var(--lyra-color-border);
16
+ }
17
+
18
+ :host([status='uploading']) {
19
+ --lyra-attachment-chip-accent: var(--lyra-color-brand);
20
+ --lyra-attachment-chip-bg: var(--lyra-color-brand-quiet);
21
+ --lyra-attachment-chip-border: transparent;
22
+ }
23
+ :host([status='error']) {
24
+ --lyra-attachment-chip-accent: var(--lyra-color-danger);
25
+ --lyra-attachment-chip-bg: var(--lyra-color-danger-quiet);
26
+ --lyra-attachment-chip-border: transparent;
27
+ }
28
+ /* Optional neutral-positive tint for a finished upload -- subtler than
29
+ 'uploading'/'error' since there's nothing left for the user to act on. */
30
+ :host([status='done']) {
31
+ --lyra-attachment-chip-accent: var(--lyra-color-success);
32
+ --lyra-attachment-chip-bg: var(--lyra-color-success-quiet);
33
+ --lyra-attachment-chip-border: transparent;
34
+ }
35
+
36
+ [part='base'] {
37
+ display: flex;
38
+ align-items: center;
39
+ gap: var(--lyra-space-s);
40
+ max-inline-size: 100%;
41
+ box-sizing: border-box;
42
+ padding: var(--lyra-space-xs) var(--lyra-space-s);
43
+ border: 1px solid var(--lyra-attachment-chip-border);
44
+ border-radius: var(--lyra-radius);
45
+ background: var(--lyra-attachment-chip-bg);
46
+ color: var(--lyra-color-text);
47
+ font-size: 0.8125rem;
48
+ line-height: 1.3;
49
+ transition:
50
+ background-color var(--lyra-transition-fast),
51
+ border-color var(--lyra-transition-fast);
52
+ }
53
+
54
+ [part='thumbnail'] {
55
+ display: inline-flex;
56
+ flex: 0 0 auto;
57
+ align-items: center;
58
+ justify-content: center;
59
+ /* Reuses the shared icon-button box size as a ready-made "small square
60
+ glyph/image slot" token rather than inventing a new one-off dimension. */
61
+ inline-size: var(--lyra-icon-button-size);
62
+ block-size: var(--lyra-icon-button-size);
63
+ overflow: hidden;
64
+ border-radius: calc(var(--lyra-radius) * 0.6);
65
+ background: var(--lyra-color-surface);
66
+ color: var(--lyra-attachment-chip-accent);
67
+ }
68
+ [part='thumbnail'] img {
69
+ inline-size: 100%;
70
+ block-size: 100%;
71
+ object-fit: cover;
72
+ display: block;
73
+ }
74
+ [part='thumbnail'] svg {
75
+ display: block;
76
+ }
77
+
78
+ [part='meta'] {
79
+ display: flex;
80
+ flex-direction: column;
81
+ flex: 1 1 auto;
82
+ min-inline-size: 0;
83
+ gap: 0.125rem;
84
+ }
85
+ [part='name'] {
86
+ overflow: hidden;
87
+ text-overflow: ellipsis;
88
+ white-space: nowrap;
89
+ font-weight: 600;
90
+ color: var(--lyra-color-text);
91
+ }
92
+ [part='size'] {
93
+ /* Full-strength text, not --lyra-color-text-quiet -- this sits on top of
94
+ the per-status *-quiet tint backgrounds above (e.g. danger-quiet), and
95
+ text-quiet's gray fails WCAG AA contrast against several of those
96
+ tints even though it comfortably passes against the plain surface
97
+ background used by the resting state. Same fix, same rationale, as
98
+ lyra-tool-call-chip's identical [part='duration']/[part='category']. */
99
+ color: var(--lyra-color-text);
100
+ font-variant-numeric: tabular-nums;
101
+ }
102
+ [part='status-text'] {
103
+ color: var(--lyra-attachment-chip-accent);
104
+ font-weight: 600;
105
+ }
106
+
107
+ [part='progress'] {
108
+ flex: 0 0 auto;
109
+ inline-size: 3.5rem;
110
+ block-size: var(--lyra-space-xs);
111
+ border-radius: 999px;
112
+ background: var(--lyra-color-border);
113
+ overflow: hidden;
114
+ }
115
+ [part='progress-fill'] {
116
+ block-size: 100%;
117
+ border-radius: inherit;
118
+ background: var(--lyra-attachment-chip-accent);
119
+ transition: inline-size var(--lyra-transition-base);
120
+ }
121
+
122
+ [part='spinner'] {
123
+ flex: 0 0 auto;
124
+ display: inline-block;
125
+ inline-size: 1rem;
126
+ block-size: 1rem;
127
+ border-radius: 50%;
128
+ border: 2px solid var(--lyra-color-border);
129
+ border-block-start-color: var(--lyra-attachment-chip-accent);
130
+ animation: lyra-attachment-chip-spin 0.8s linear infinite;
131
+ }
132
+
133
+ [part='retry-button'],
134
+ [part='remove-button'] {
135
+ flex: 0 0 auto;
136
+ display: inline-flex;
137
+ align-items: center;
138
+ justify-content: center;
139
+ min-inline-size: min(var(--lyra-icon-button-size), 1.75rem);
140
+ min-block-size: min(var(--lyra-icon-button-size), 1.75rem);
141
+ padding: 0;
142
+ border: none;
143
+ border-radius: calc(var(--lyra-radius) * 0.6);
144
+ background: transparent;
145
+ color: var(--lyra-color-text-quiet);
146
+ font: inherit;
147
+ cursor: pointer;
148
+ -webkit-tap-highlight-color: transparent;
149
+ transition: background-color var(--lyra-transition-fast);
150
+ }
151
+ [part='retry-button'] {
152
+ color: var(--lyra-color-danger);
153
+ }
154
+ [part='retry-button']:hover,
155
+ [part='remove-button']:hover {
156
+ background: color-mix(in srgb, var(--lyra-color-text) 8%, transparent);
157
+ }
158
+ [part='retry-button']:focus-visible,
159
+ [part='remove-button']:focus-visible {
160
+ outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
161
+ outline-offset: var(--lyra-focus-ring-offset);
162
+ }
163
+ [part='retry-button'] svg,
164
+ [part='remove-button'] svg {
165
+ display: block;
166
+ }
167
+
168
+ @keyframes lyra-attachment-chip-spin {
169
+ to {
170
+ transform: rotate(360deg);
171
+ }
172
+ }
173
+ @media (prefers-reduced-motion: reduce) {
174
+ [part='base'] {
175
+ transition: none !important;
176
+ }
177
+ [part='progress-fill'] {
178
+ transition: none !important;
179
+ }
180
+ [part='spinner'] {
181
+ animation: none !important;
182
+ }
183
+ }
184
+ `;
@@ -0,0 +1,96 @@
1
+ import { type TemplateResult } from 'lit';
2
+ import { LyraElement } from '../../internal/lyra-element.js';
3
+ import '../menu/menu.js';
4
+ import '../menu/menu-item.js';
5
+ export type AttachmentCapability = 'files' | 'image' | 'camera';
6
+ /** The two capabilities that resolve to a real file selection (as opposed
7
+ * to `camera`, which never touches a file input -- see the class doc). */
8
+ export type FileBackedCapability = Exclude<AttachmentCapability, 'camera'>;
9
+ export interface AttachmentPickDetail {
10
+ capability: FileBackedCapability;
11
+ files: FileList;
12
+ }
13
+ /**
14
+ * `<lyra-attachment-trigger>` — a compact attach affordance designed for a
15
+ * chat composer's leading slot (see `<lyra-chat-composer>`'s own `leading`
16
+ * slot, which this drops straight into, though this component has no code
17
+ * dependency on it). Its shape adapts to how many attachment `capabilities`
18
+ * are configured:
19
+ * - Exactly one capability: a single plain icon button ([part='trigger']).
20
+ * Activating it performs that capability's action directly.
21
+ * - More than one: a small anchored menu ([part='menu'], composed from
22
+ * `<lyra-menu>`/`<lyra-menu-item>`) listing each capability as a row.
23
+ *
24
+ * Two of the three capabilities (`files`, `image`) are file-picker-backed:
25
+ * activating them opens a hidden native `<input type="file">` via a
26
+ * synthetic `.click()`, and the resulting selection is re-emitted as
27
+ * `lyra-pick`. `accept` is shared across both — `image` defaults it to
28
+ * `'image/*'` unless the `accept` prop overrides it, `files` always uses
29
+ * `accept` as-is (empty means "any file type", matching a bare native
30
+ * `<input type="file">` with no `accept` attribute).
31
+ *
32
+ * **`camera` is scope-limited by design.** This component does not
33
+ * implement any camera capture UI itself — no `getUserMedia`, no
34
+ * `<input capture>` — because that's entirely a host/browser concern with
35
+ * no single right answer (a desktop web app, a mobile PWA, and a native
36
+ * wrapper all want different things here). Activating the `camera`
37
+ * capability only fires `lyra-camera-request`; the host owns everything
38
+ * from that point on (opening its own capture UI, then presumably handing
39
+ * the resulting `File` back to something like `<lyra-attachment-chip>`).
40
+ *
41
+ * @customElement lyra-attachment-trigger
42
+ * @event lyra-pick - A file-backed capability's hidden file input produced a
43
+ * real selection. `detail: { capability: 'files' | 'image', files }` — a
44
+ * real `FileList` (not a plain array), matching the native input's own
45
+ * `.files` shape, but an independent snapshot rather than that same live
46
+ * object — see `onInputChange`'s own doc for why a live reference would be
47
+ * unsafe to hand out here.
48
+ * @event lyra-camera-request - The `camera` capability was activated. No
49
+ * detail payload — see the class doc's scope note; the host implements the
50
+ * actual capture flow.
51
+ * @csspart trigger - The single-capability icon button. Only rendered when `capabilities.length === 1`.
52
+ * @csspart menu - The `<lyra-menu>` wrapper. Only rendered when `capabilities.length > 1`.
53
+ * @csspart menu-trigger - The multi-capability button slotted into `<lyra-menu>`'s own `trigger` slot. Only rendered when `capabilities.length > 1`.
54
+ * @csspart expand-icon - The disclosure chevron inside the multi-capability trigger button. Only rendered when `capabilities.length > 1`.
55
+ *
56
+ * `triggerLabel` lets a host override the single-capability trigger button's
57
+ * `aria-label` (i18n) — see that property's own doc for exactly what it
58
+ * does and doesn't affect.
59
+ */
60
+ export declare class LyraAttachmentTrigger extends LyraElement {
61
+ static styles: import("lit").CSSResultGroup[];
62
+ /** Which attachment capabilities to offer, in display order. A single
63
+ * entry renders a plain button; more than one renders a menu. */
64
+ capabilities: AttachmentCapability[];
65
+ /** Native-file-input-style accept string (e.g. `'image/*'` or
66
+ * `'.pdf,.docx'`), forwarded to the hidden file input for the
67
+ * `files`/`image` capabilities — see the class doc for how each uses it. */
68
+ accept: string;
69
+ /** Overrides the single-capability trigger button's `aria-label`, which
70
+ * otherwise comes from `CAPABILITY_META[capability].triggerLabel` (e.g.
71
+ * `'Attach files'`). Set this to localize the accessible name; leave it
72
+ * unset to keep the built-in English default. Only affects the
73
+ * single-capability button ([part='trigger']) — the multi-capability
74
+ * menu's own trigger keeps its fixed `'Add attachment'` label regardless. */
75
+ triggerLabel?: string;
76
+ /** Forwarded to the hidden file input's own `multiple` attribute. */
77
+ multiple: boolean;
78
+ disabled: boolean;
79
+ private inputEl?;
80
+ private pendingCapability;
81
+ private get hasFileCapability();
82
+ private effectiveAccept;
83
+ private activateCapability;
84
+ private onTriggerClick;
85
+ private onMenuSelect;
86
+ private onInputChange;
87
+ private renderHiddenInput;
88
+ private renderSingleTrigger;
89
+ private renderMenu;
90
+ render(): TemplateResult;
91
+ }
92
+ declare global {
93
+ interface HTMLElementTagNameMap {
94
+ 'lyra-attachment-trigger': LyraAttachmentTrigger;
95
+ }
96
+ }
@@ -0,0 +1,270 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { html, nothing, svg } from 'lit';
8
+ import { property, query } from 'lit/decorators.js';
9
+ import { LyraElement } from '../../internal/lyra-element.js';
10
+ import { defineElement } from '../../internal/prefix.js';
11
+ import { chevronIcon } from '../../internal/icons.js';
12
+ import { styles } from './attachment-trigger.styles.js';
13
+ import '../menu/menu.js';
14
+ import '../menu/menu-item.js';
15
+ // Mirrors the shared icon set's viewBox/stroke conventions
16
+ // (internal/icons.ts's chevronIcon()/closeIcon()/etc.) without adding these
17
+ // one-off glyphs to that module -- it's off limits here -- so they still
18
+ // read as part of the same visual language as the rest of the library's
19
+ // inline icons. Same approach as lyra-attachment-chip's local fileGlyph()/
20
+ // retryIcon() and lyra-checkbox's local checkmarkGlyph().
21
+ const ICON_VIEW_BOX = '0 0 24 24';
22
+ const ICON_STROKE_WIDTH = '1.75';
23
+ function icon(paths) {
24
+ return svg `
25
+ <svg
26
+ width="1em"
27
+ height="1em"
28
+ viewBox=${ICON_VIEW_BOX}
29
+ fill="none"
30
+ stroke="currentColor"
31
+ stroke-width=${ICON_STROKE_WIDTH}
32
+ stroke-linecap="round"
33
+ stroke-linejoin="round"
34
+ aria-hidden="true"
35
+ focusable="false"
36
+ >${paths}</svg>
37
+ `;
38
+ }
39
+ /** A paperclip glyph -- the generic "attach" affordance, used for the
40
+ * `files` capability and as the multi-capability menu's own trigger icon
41
+ * (the one glyph a user recognizes regardless of which capabilities the
42
+ * menu underneath actually offers). */
43
+ function paperclipIcon() {
44
+ return icon(svg `
45
+ <path d="M21.44 11.05 12.25 20.24a5.5 5.5 0 0 1-7.78-7.78l9.19-9.19a3.5 3.5 0 0 1 4.95 4.95l-9.2 9.19a1.5 1.5 0 0 1-2.12-2.12l8.49-8.48"></path>
46
+ `);
47
+ }
48
+ /** A picture-frame glyph for the `image` capability. */
49
+ function imageIcon() {
50
+ return icon(svg `
51
+ <rect x="3" y="3" width="18" height="18" rx="2"></rect>
52
+ <circle cx="8.5" cy="8.5" r="1.5"></circle>
53
+ <polyline points="21 15 16 10 5 21"></polyline>
54
+ `);
55
+ }
56
+ /** A camera-body glyph for the `camera` capability. */
57
+ function cameraIcon() {
58
+ return icon(svg `
59
+ <path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2Z"></path>
60
+ <circle cx="12" cy="13" r="4"></circle>
61
+ `);
62
+ }
63
+ const CAPABILITY_META = {
64
+ files: { icon: paperclipIcon, triggerLabel: 'Attach files', menuLabel: 'Upload files' },
65
+ image: { icon: imageIcon, triggerLabel: 'Attach an image', menuLabel: 'Upload a photo' },
66
+ camera: { icon: cameraIcon, triggerLabel: 'Use camera', menuLabel: 'Take a photo' },
67
+ };
68
+ /**
69
+ * `<lyra-attachment-trigger>` — a compact attach affordance designed for a
70
+ * chat composer's leading slot (see `<lyra-chat-composer>`'s own `leading`
71
+ * slot, which this drops straight into, though this component has no code
72
+ * dependency on it). Its shape adapts to how many attachment `capabilities`
73
+ * are configured:
74
+ * - Exactly one capability: a single plain icon button ([part='trigger']).
75
+ * Activating it performs that capability's action directly.
76
+ * - More than one: a small anchored menu ([part='menu'], composed from
77
+ * `<lyra-menu>`/`<lyra-menu-item>`) listing each capability as a row.
78
+ *
79
+ * Two of the three capabilities (`files`, `image`) are file-picker-backed:
80
+ * activating them opens a hidden native `<input type="file">` via a
81
+ * synthetic `.click()`, and the resulting selection is re-emitted as
82
+ * `lyra-pick`. `accept` is shared across both — `image` defaults it to
83
+ * `'image/*'` unless the `accept` prop overrides it, `files` always uses
84
+ * `accept` as-is (empty means "any file type", matching a bare native
85
+ * `<input type="file">` with no `accept` attribute).
86
+ *
87
+ * **`camera` is scope-limited by design.** This component does not
88
+ * implement any camera capture UI itself — no `getUserMedia`, no
89
+ * `<input capture>` — because that's entirely a host/browser concern with
90
+ * no single right answer (a desktop web app, a mobile PWA, and a native
91
+ * wrapper all want different things here). Activating the `camera`
92
+ * capability only fires `lyra-camera-request`; the host owns everything
93
+ * from that point on (opening its own capture UI, then presumably handing
94
+ * the resulting `File` back to something like `<lyra-attachment-chip>`).
95
+ *
96
+ * @customElement lyra-attachment-trigger
97
+ * @event lyra-pick - A file-backed capability's hidden file input produced a
98
+ * real selection. `detail: { capability: 'files' | 'image', files }` — a
99
+ * real `FileList` (not a plain array), matching the native input's own
100
+ * `.files` shape, but an independent snapshot rather than that same live
101
+ * object — see `onInputChange`'s own doc for why a live reference would be
102
+ * unsafe to hand out here.
103
+ * @event lyra-camera-request - The `camera` capability was activated. No
104
+ * detail payload — see the class doc's scope note; the host implements the
105
+ * actual capture flow.
106
+ * @csspart trigger - The single-capability icon button. Only rendered when `capabilities.length === 1`.
107
+ * @csspart menu - The `<lyra-menu>` wrapper. Only rendered when `capabilities.length > 1`.
108
+ * @csspart menu-trigger - The multi-capability button slotted into `<lyra-menu>`'s own `trigger` slot. Only rendered when `capabilities.length > 1`.
109
+ * @csspart expand-icon - The disclosure chevron inside the multi-capability trigger button. Only rendered when `capabilities.length > 1`.
110
+ *
111
+ * `triggerLabel` lets a host override the single-capability trigger button's
112
+ * `aria-label` (i18n) — see that property's own doc for exactly what it
113
+ * does and doesn't affect.
114
+ */
115
+ export class LyraAttachmentTrigger extends LyraElement {
116
+ constructor() {
117
+ super(...arguments);
118
+ /** Which attachment capabilities to offer, in display order. A single
119
+ * entry renders a plain button; more than one renders a menu. */
120
+ this.capabilities = ['files'];
121
+ /** Native-file-input-style accept string (e.g. `'image/*'` or
122
+ * `'.pdf,.docx'`), forwarded to the hidden file input for the
123
+ * `files`/`image` capabilities — see the class doc for how each uses it. */
124
+ this.accept = '';
125
+ /** Forwarded to the hidden file input's own `multiple` attribute. */
126
+ this.multiple = true;
127
+ this.disabled = false;
128
+ // Which file-backed capability the hidden input's next 'change' event
129
+ // belongs to -- set synchronously right before the synthetic .click(), so
130
+ // one shared <input> can serve both 'files' and 'image' (each wanting a
131
+ // different `accept`) without needing two separate hidden inputs.
132
+ this.pendingCapability = 'files';
133
+ this.onTriggerClick = () => {
134
+ this.activateCapability(this.capabilities[0]);
135
+ };
136
+ this.onMenuSelect = (e) => {
137
+ this.activateCapability(e.detail.value);
138
+ };
139
+ this.onInputChange = (e) => {
140
+ const input = e.target;
141
+ const selected = input.files;
142
+ if (selected && selected.length > 0) {
143
+ // `input.files` is a *live* view of the input's own current
144
+ // selection, not a frozen snapshot -- clearing `.value` below (so
145
+ // re-picking the exact same file still fires another 'change' next
146
+ // time) mutates this very object back to empty in place. A listener
147
+ // that reads `detail.files` synchronously (a plain `addEventListener`
148
+ // callback) would never notice, but anything that reads it even one
149
+ // microtask later (an `async` handler, a queued upload) would see an
150
+ // empty list. Rehoming the selected files into a fresh `DataTransfer`
151
+ // produces an independent `FileList` — still the real `FileList` type
152
+ // the `lyra-pick` contract promises, just no longer tied to this
153
+ // input's own live state.
154
+ const snapshot = new DataTransfer();
155
+ for (const file of selected)
156
+ snapshot.items.add(file);
157
+ this.emit('lyra-pick', {
158
+ capability: this.pendingCapability,
159
+ files: snapshot.files,
160
+ });
161
+ }
162
+ // Clearing `.value` (not just leaving the stale selection in place)
163
+ // means re-picking the exact same file still fires another 'change'
164
+ // event next time, matching <lyra-file-input>'s identical reset.
165
+ input.value = '';
166
+ };
167
+ }
168
+ static { this.styles = [LyraElement.styles, styles]; }
169
+ get hasFileCapability() {
170
+ return this.capabilities.includes('files') || this.capabilities.includes('image');
171
+ }
172
+ effectiveAccept(capability) {
173
+ return capability === 'image' ? this.accept || 'image/*' : this.accept;
174
+ }
175
+ activateCapability(capability) {
176
+ if (this.disabled)
177
+ return;
178
+ if (capability === 'camera') {
179
+ this.emit('lyra-camera-request');
180
+ return;
181
+ }
182
+ this.pendingCapability = capability;
183
+ const input = this.inputEl;
184
+ if (!input)
185
+ return;
186
+ input.accept = this.effectiveAccept(capability);
187
+ input.click();
188
+ }
189
+ renderHiddenInput() {
190
+ return html `
191
+ <input
192
+ type="file"
193
+ tabindex="-1"
194
+ aria-hidden="true"
195
+ ?multiple=${this.multiple}
196
+ ?disabled=${this.disabled}
197
+ @change=${this.onInputChange}
198
+ />
199
+ `;
200
+ }
201
+ renderSingleTrigger(capability) {
202
+ const meta = CAPABILITY_META[capability];
203
+ return html `
204
+ <button
205
+ part="trigger"
206
+ class="trigger-button"
207
+ type="button"
208
+ aria-label=${this.triggerLabel ?? meta.triggerLabel}
209
+ ?disabled=${this.disabled}
210
+ @click=${this.onTriggerClick}
211
+ >
212
+ ${meta.icon()}
213
+ </button>
214
+ `;
215
+ }
216
+ renderMenu() {
217
+ return html `
218
+ <lyra-menu part="menu" label="Add attachment" @lyra-menu-select=${this.onMenuSelect}>
219
+ <button
220
+ slot="trigger"
221
+ part="menu-trigger"
222
+ class="trigger-button"
223
+ type="button"
224
+ aria-label="Add attachment"
225
+ ?disabled=${this.disabled}
226
+ >
227
+ ${paperclipIcon()}
228
+ <span part="expand-icon" aria-hidden="true">${chevronIcon()}</span>
229
+ </button>
230
+ ${this.capabilities.map((capability) => {
231
+ const meta = CAPABILITY_META[capability];
232
+ return html `
233
+ <lyra-menu-item value=${capability}>
234
+ <span slot="icon">${meta.icon()}</span>
235
+ ${meta.menuLabel}
236
+ </lyra-menu-item>
237
+ `;
238
+ })}
239
+ </lyra-menu>
240
+ `;
241
+ }
242
+ render() {
243
+ const single = this.capabilities.length === 1;
244
+ const multi = this.capabilities.length > 1;
245
+ return html `
246
+ ${single ? this.renderSingleTrigger(this.capabilities[0]) : nothing}
247
+ ${multi ? this.renderMenu() : nothing}
248
+ ${this.hasFileCapability ? this.renderHiddenInput() : nothing}
249
+ `;
250
+ }
251
+ }
252
+ __decorate([
253
+ property({ attribute: false })
254
+ ], LyraAttachmentTrigger.prototype, "capabilities", void 0);
255
+ __decorate([
256
+ property()
257
+ ], LyraAttachmentTrigger.prototype, "accept", void 0);
258
+ __decorate([
259
+ property({ attribute: 'trigger-label' })
260
+ ], LyraAttachmentTrigger.prototype, "triggerLabel", void 0);
261
+ __decorate([
262
+ property({ type: Boolean, reflect: true })
263
+ ], LyraAttachmentTrigger.prototype, "multiple", void 0);
264
+ __decorate([
265
+ property({ type: Boolean, reflect: true })
266
+ ], LyraAttachmentTrigger.prototype, "disabled", void 0);
267
+ __decorate([
268
+ query('input[type="file"]')
269
+ ], LyraAttachmentTrigger.prototype, "inputEl", void 0);
270
+ defineElement('attachment-trigger', LyraAttachmentTrigger);
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,90 @@
1
+ import { css } from 'lit';
2
+ export const styles = css `
3
+ /* Fully transparent to layout, matching lyra-menu's own :host — the
4
+ visible/clickable surface is entirely the rendered button (or, in the
5
+ multi-capability case, lyra-menu's own display:contents trigger wrapper
6
+ around that same button), so this host never contributes a stray box a
7
+ composer's leading slot would otherwise have to fight with margin/
8
+ inline-block quirks to line up against the textarea. */
9
+ :host {
10
+ display: contents;
11
+ }
12
+
13
+ /* Shared visual treatment for both the single-capability button
14
+ ([part='trigger']) and the multi-capability button ([part='menu-trigger'])
15
+ slotted into lyra-menu's own trigger slot -- the latter can't reuse
16
+ part='trigger' itself (that name is reserved for the single-capability
17
+ case, so a consumer's ::part(trigger) selector unambiguously targets
18
+ exactly one button), so both buttons share this plain class for the
19
+ declarations that genuinely are identical, on top of each one's own
20
+ distinct part name. */
21
+ .trigger-button {
22
+ display: inline-flex;
23
+ flex: 0 0 auto;
24
+ align-items: center;
25
+ justify-content: center;
26
+ box-sizing: border-box;
27
+ /* Compact per the class doc -- capped well below the library's general
28
+ --lyra-icon-button-size (meant for a standalone icon-only button) so
29
+ this sits comfortably inside a composer's leading slot alongside a
30
+ textarea, matching lyra-combobox's clear-button / lyra-select's
31
+ toggle sizing convention. */
32
+ min-inline-size: min(var(--lyra-icon-button-size), 1.75rem);
33
+ min-block-size: min(var(--lyra-icon-button-size), 1.75rem);
34
+ padding: 0;
35
+ border: none;
36
+ border-radius: calc(var(--lyra-radius) * 0.6);
37
+ background: transparent;
38
+ color: var(--lyra-color-text-quiet);
39
+ font: inherit;
40
+ font-size: 1.125rem;
41
+ line-height: 1;
42
+ cursor: pointer;
43
+ -webkit-tap-highlight-color: transparent;
44
+ transition:
45
+ background-color var(--lyra-transition-fast),
46
+ color var(--lyra-transition-fast);
47
+ }
48
+ .trigger-button:hover:not(:disabled) {
49
+ background: color-mix(in srgb, var(--lyra-color-text) 8%, transparent);
50
+ color: var(--lyra-color-text);
51
+ }
52
+ .trigger-button:focus-visible {
53
+ outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
54
+ outline-offset: var(--lyra-focus-ring-offset);
55
+ }
56
+ .trigger-button:disabled {
57
+ cursor: not-allowed;
58
+ opacity: var(--lyra-opacity-disabled);
59
+ }
60
+ .trigger-button svg {
61
+ display: block;
62
+ }
63
+
64
+ /* [part='menu-trigger'] carries a second glyph (the paperclip plus this
65
+ disclosure chevron) alongside the single-capability [part='trigger']'s
66
+ one, so it alone needs a gap between them. */
67
+ [part='menu-trigger'] {
68
+ gap: var(--lyra-space-xs);
69
+ }
70
+
71
+ /* Disclosure cue for the multi-capability trigger, matching
72
+ lyra-combobox/lyra-select's own [part='expand-icon'] convention (same
73
+ chevronIcon() rotated to point down) -- but sized down from their
74
+ dedicated-touch-target treatment since here it's a second glyph inside
75
+ one already-compact icon button, not its own separate control. */
76
+ [part='expand-icon'] {
77
+ display: inline-flex;
78
+ flex: 0 0 auto;
79
+ font-size: 0.75em;
80
+ }
81
+ [part='expand-icon'] svg {
82
+ transform: rotate(90deg);
83
+ }
84
+
85
+ @media (prefers-reduced-motion: reduce) {
86
+ .trigger-button {
87
+ transition: none !important;
88
+ }
89
+ }
90
+ `;
@@ -1,4 +1,4 @@
1
- import { LyraChart } from './chart.js';
1
+ import { LyraChart, lockChartType } from './chart.js';
2
2
  import { defineElement } from '../../internal/prefix.js';
3
3
  /**
4
4
  * `<lyra-bar-chart>` — `<lyra-chart>` with `type` locked to `"bar"`.
@@ -7,21 +7,5 @@ import { defineElement } from '../../internal/prefix.js';
7
7
  */
8
8
  export class LyraBarChart extends LyraChart {
9
9
  }
10
- // `type` is locked read-only rather than a settable class field with just a
11
- // default value — `LyraChart` declares it as a plain (decorator-managed)
12
- // class field, and TypeScript forbids a subclass from re-declaring a base
13
- // field as a getter/setter pair via ordinary class syntax (TS2611) — so the
14
- // accessor pair is installed directly on the prototype instead, which is
15
- // runtime-equivalent (same shadowing semantics as a class-syntax override)
16
- // without tripping that check.
17
- Object.defineProperty(LyraBarChart.prototype, 'type', {
18
- configurable: true,
19
- enumerable: true,
20
- get() {
21
- return 'bar';
22
- },
23
- set(_v) {
24
- /* locked to 'bar'; direct writes are ignored */
25
- },
26
- });
10
+ lockChartType(LyraBarChart, 'bar');
27
11
  defineElement('bar-chart', LyraBarChart);