@aceshooting/lyra-ui 1.2.0 → 2.0.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 (330) hide show
  1. package/README.md +11 -0
  2. package/custom-elements.json +23341 -11202
  3. package/dist/components/app-rail/app-rail.d.ts +171 -0
  4. package/dist/components/app-rail/app-rail.js +483 -0
  5. package/dist/components/app-rail/app-rail.styles.d.ts +1 -0
  6. package/dist/components/app-rail/app-rail.styles.js +125 -0
  7. package/dist/components/attachment-chip/attachment-chip.d.ts +114 -0
  8. package/dist/components/attachment-chip/attachment-chip.js +312 -0
  9. package/dist/components/attachment-chip/attachment-chip.styles.d.ts +1 -0
  10. package/dist/components/attachment-chip/attachment-chip.styles.js +184 -0
  11. package/dist/components/attachment-trigger/attachment-trigger.d.ts +83 -0
  12. package/dist/components/attachment-trigger/attachment-trigger.js +258 -0
  13. package/dist/components/attachment-trigger/attachment-trigger.styles.d.ts +1 -0
  14. package/dist/components/attachment-trigger/attachment-trigger.styles.js +68 -0
  15. package/dist/components/chart/box-plot.js +11 -1
  16. package/dist/components/chart/chart-loader.d.ts +44 -13
  17. package/dist/components/chart/chart-loader.js +65 -18
  18. package/dist/components/chart/chart.d.ts +1 -2
  19. package/dist/components/chart/chart.js +67 -12
  20. package/dist/components/chart/histogram-bin.d.ts +4 -1
  21. package/dist/components/chart/histogram-bin.js +24 -14
  22. package/dist/components/chart/lite-chart.d.ts +54 -0
  23. package/dist/components/chart/lite-chart.js +140 -22
  24. package/dist/components/chart/lite-chart.styles.js +9 -0
  25. package/dist/components/chat-composer/chat-composer.d.ts +92 -0
  26. package/dist/components/chat-composer/chat-composer.js +285 -0
  27. package/dist/components/chat-composer/chat-composer.styles.d.ts +1 -0
  28. package/dist/components/chat-composer/chat-composer.styles.js +135 -0
  29. package/dist/components/chat-message/chat-message.d.ts +113 -0
  30. package/dist/components/chat-message/chat-message.js +291 -0
  31. package/dist/components/chat-message/chat-message.styles.d.ts +1 -0
  32. package/dist/components/chat-message/chat-message.styles.js +203 -0
  33. package/dist/components/checkbox/checkbox.d.ts +59 -0
  34. package/dist/components/checkbox/checkbox.js +230 -0
  35. package/dist/components/checkbox/checkbox.styles.d.ts +1 -0
  36. package/dist/components/checkbox/checkbox.styles.js +70 -0
  37. package/dist/components/chip/chip-group.d.ts +56 -0
  38. package/dist/components/chip/chip-group.js +124 -0
  39. package/dist/components/chip/chip-group.styles.d.ts +1 -0
  40. package/dist/components/chip/chip-group.styles.js +57 -0
  41. package/dist/components/chip/chip.d.ts +64 -0
  42. package/dist/components/chip/chip.js +115 -0
  43. package/dist/components/chip/chip.styles.d.ts +1 -0
  44. package/dist/components/chip/chip.styles.js +115 -0
  45. package/dist/components/citation-badge/citation-badge.d.ts +113 -0
  46. package/dist/components/citation-badge/citation-badge.js +300 -0
  47. package/dist/components/citation-badge/citation-badge.styles.d.ts +1 -0
  48. package/dist/components/citation-badge/citation-badge.styles.js +96 -0
  49. package/dist/components/code-block/code-block.d.ts +89 -0
  50. package/dist/components/code-block/code-block.js +317 -0
  51. package/dist/components/code-block/code-block.styles.d.ts +1 -0
  52. package/dist/components/code-block/code-block.styles.js +187 -0
  53. package/dist/components/code-block/code-loader.d.ts +44 -0
  54. package/dist/components/code-block/code-loader.js +79 -0
  55. package/dist/components/combobox/combobox.d.ts +19 -1
  56. package/dist/components/combobox/combobox.js +84 -14
  57. package/dist/components/combobox/option.d.ts +5 -1
  58. package/dist/components/combobox/option.js +35 -0
  59. package/dist/components/context-meter/context-meter.d.ts +53 -0
  60. package/dist/components/context-meter/context-meter.js +150 -0
  61. package/dist/components/context-meter/context-meter.styles.d.ts +1 -0
  62. package/dist/components/context-meter/context-meter.styles.js +120 -0
  63. package/dist/components/conversation-item/conversation-item.d.ts +128 -0
  64. package/dist/components/conversation-item/conversation-item.js +322 -0
  65. package/dist/components/conversation-item/conversation-item.styles.d.ts +1 -0
  66. package/dist/components/conversation-item/conversation-item.styles.js +155 -0
  67. package/dist/components/date-picker/date-input.d.ts +24 -0
  68. package/dist/components/date-picker/date-input.js +134 -22
  69. package/dist/components/date-picker/date-picker.d.ts +7 -0
  70. package/dist/components/date-picker/date-picker.js +85 -16
  71. package/dist/components/dialog/confirm.d.ts +40 -0
  72. package/dist/components/dialog/confirm.js +79 -0
  73. package/dist/components/dialog/dialog.d.ts +85 -0
  74. package/dist/components/dialog/dialog.js +272 -0
  75. package/dist/components/dialog/dialog.styles.d.ts +1 -0
  76. package/dist/components/dialog/dialog.styles.js +52 -0
  77. package/dist/components/dock-panel/dock-panel.d.ts +134 -0
  78. package/dist/components/dock-panel/dock-panel.js +345 -0
  79. package/dist/components/dock-panel/dock-panel.styles.d.ts +1 -0
  80. package/dist/components/dock-panel/dock-panel.styles.js +145 -0
  81. package/dist/components/document-preview/document-preview.d.ts +135 -0
  82. package/dist/components/document-preview/document-preview.js +372 -0
  83. package/dist/components/document-preview/document-preview.styles.d.ts +1 -0
  84. package/dist/components/document-preview/document-preview.styles.js +191 -0
  85. package/dist/components/export-button/csv.js +1 -1
  86. package/dist/components/export-button/export-button.js +2 -0
  87. package/dist/components/flag/flag.d.ts +29 -13
  88. package/dist/components/flag/flag.js +39 -13
  89. package/dist/components/gauge/gauge.js +19 -10
  90. package/dist/components/generation-status/generation-status.d.ts +109 -0
  91. package/dist/components/generation-status/generation-status.js +273 -0
  92. package/dist/components/generation-status/generation-status.styles.d.ts +1 -0
  93. package/dist/components/generation-status/generation-status.styles.js +84 -0
  94. package/dist/components/heatmap/calendar-grid.d.ts +4 -1
  95. package/dist/components/heatmap/calendar-grid.js +25 -12
  96. package/dist/components/heatmap/heatmap-scale.d.ts +6 -0
  97. package/dist/components/heatmap/heatmap-scale.js +7 -1
  98. package/dist/components/heatmap/heatmap.d.ts +74 -0
  99. package/dist/components/heatmap/heatmap.js +135 -23
  100. package/dist/components/json-viewer/json-viewer.d.ts +53 -0
  101. package/dist/components/json-viewer/json-viewer.js +283 -0
  102. package/dist/components/json-viewer/json-viewer.styles.d.ts +1 -0
  103. package/dist/components/json-viewer/json-viewer.styles.js +176 -0
  104. package/dist/components/kbd/kbd.d.ts +77 -0
  105. package/dist/components/kbd/kbd.js +214 -0
  106. package/dist/components/kbd/kbd.styles.d.ts +1 -0
  107. package/dist/components/kbd/kbd.styles.js +52 -0
  108. package/dist/components/live-region/live-region.d.ts +81 -0
  109. package/dist/components/live-region/live-region.js +153 -0
  110. package/dist/components/live-region/live-region.styles.d.ts +1 -0
  111. package/dist/components/live-region/live-region.styles.js +10 -0
  112. package/dist/components/map/map.d.ts +8 -6
  113. package/dist/components/map/map.js +44 -8
  114. package/dist/components/markdown/markdown-loader.d.ts +34 -0
  115. package/dist/components/markdown/markdown-loader.js +43 -0
  116. package/dist/components/markdown/markdown.d.ts +81 -0
  117. package/dist/components/markdown/markdown.js +284 -0
  118. package/dist/components/markdown/markdown.styles.d.ts +1 -0
  119. package/dist/components/markdown/markdown.styles.js +82 -0
  120. package/dist/components/media-card/media-card.d.ts +122 -0
  121. package/dist/components/media-card/media-card.js +295 -0
  122. package/dist/components/media-card/media-card.styles.d.ts +1 -0
  123. package/dist/components/media-card/media-card.styles.js +132 -0
  124. package/dist/components/mention-popover/mention-popover.d.ts +200 -0
  125. package/dist/components/mention-popover/mention-popover.js +475 -0
  126. package/dist/components/mention-popover/mention-popover.styles.d.ts +1 -0
  127. package/dist/components/mention-popover/mention-popover.styles.js +101 -0
  128. package/dist/components/menu/menu-item.d.ts +62 -0
  129. package/dist/components/menu/menu-item.js +119 -0
  130. package/dist/components/menu/menu-item.styles.d.ts +1 -0
  131. package/dist/components/menu/menu-item.styles.js +67 -0
  132. package/dist/components/menu/menu.d.ts +143 -0
  133. package/dist/components/menu/menu.js +365 -0
  134. package/dist/components/menu/menu.styles.d.ts +1 -0
  135. package/dist/components/menu/menu.styles.js +66 -0
  136. package/dist/components/model-select/model-select.d.ts +125 -0
  137. package/dist/components/model-select/model-select.js +490 -0
  138. package/dist/components/model-select/model-select.styles.d.ts +1 -0
  139. package/dist/components/model-select/model-select.styles.js +189 -0
  140. package/dist/components/model-settings-panel/model-settings-panel.d.ts +69 -0
  141. package/dist/components/model-settings-panel/model-settings-panel.js +145 -0
  142. package/dist/components/model-settings-panel/model-settings-panel.styles.d.ts +1 -0
  143. package/dist/components/model-settings-panel/model-settings-panel.styles.js +82 -0
  144. package/dist/components/playback/playback.d.ts +13 -1
  145. package/dist/components/playback/playback.js +47 -14
  146. package/dist/components/responsive-panel/responsive-panel.d.ts +150 -0
  147. package/dist/components/responsive-panel/responsive-panel.js +365 -0
  148. package/dist/components/responsive-panel/responsive-panel.styles.d.ts +1 -0
  149. package/dist/components/responsive-panel/responsive-panel.styles.js +103 -0
  150. package/dist/components/result-card/result-card.d.ts +44 -0
  151. package/dist/components/result-card/result-card.js +83 -0
  152. package/dist/components/result-card/result-card.styles.d.ts +1 -0
  153. package/dist/components/result-card/result-card.styles.js +50 -0
  154. package/dist/components/result-card/result-field.d.ts +36 -0
  155. package/dist/components/result-card/result-field.js +87 -0
  156. package/dist/components/result-card/result-field.styles.d.ts +1 -0
  157. package/dist/components/result-card/result-field.styles.js +32 -0
  158. package/dist/components/select/select.d.ts +43 -2
  159. package/dist/components/select/select.js +150 -17
  160. package/dist/components/slider/slider.d.ts +89 -0
  161. package/dist/components/slider/slider.js +352 -0
  162. package/dist/components/slider/slider.styles.d.ts +1 -0
  163. package/dist/components/slider/slider.styles.js +87 -0
  164. package/dist/components/source-card/source-card.d.ts +92 -0
  165. package/dist/components/source-card/source-card.js +148 -0
  166. package/dist/components/source-card/source-card.styles.d.ts +1 -0
  167. package/dist/components/source-card/source-card.styles.js +69 -0
  168. package/dist/components/source-list/source-list.d.ts +63 -0
  169. package/dist/components/source-list/source-list.js +122 -0
  170. package/dist/components/source-list/source-list.styles.d.ts +1 -0
  171. package/dist/components/source-list/source-list.styles.js +59 -0
  172. package/dist/components/sparkline/sparkline.js +27 -13
  173. package/dist/components/split/split.d.ts +93 -1
  174. package/dist/components/split/split.js +284 -15
  175. package/dist/components/split/split.styles.js +30 -0
  176. package/dist/components/stat/stat.d.ts +6 -1
  177. package/dist/components/stat/stat.js +8 -2
  178. package/dist/components/stream-status/stream-status.d.ts +110 -0
  179. package/dist/components/stream-status/stream-status.js +210 -0
  180. package/dist/components/stream-status/stream-status.styles.d.ts +1 -0
  181. package/dist/components/stream-status/stream-status.styles.js +103 -0
  182. package/dist/components/streaming-text/streaming-text.d.ts +98 -0
  183. package/dist/components/streaming-text/streaming-text.js +209 -0
  184. package/dist/components/streaming-text/streaming-text.styles.d.ts +1 -0
  185. package/dist/components/streaming-text/streaming-text.styles.js +62 -0
  186. package/dist/components/switch/switch.d.ts +58 -0
  187. package/dist/components/switch/switch.js +179 -0
  188. package/dist/components/switch/switch.styles.d.ts +1 -0
  189. package/dist/components/switch/switch.styles.js +75 -0
  190. package/dist/components/table/table.d.ts +73 -4
  191. package/dist/components/table/table.js +169 -20
  192. package/dist/components/table/table.styles.js +6 -1
  193. package/dist/components/tabs/tabs.d.ts +51 -0
  194. package/dist/components/tabs/tabs.js +190 -0
  195. package/dist/components/tabs/tabs.styles.d.ts +1 -0
  196. package/dist/components/tabs/tabs.styles.js +63 -0
  197. package/dist/components/thinking-panel/thinking-panel.d.ts +121 -0
  198. package/dist/components/thinking-panel/thinking-panel.js +235 -0
  199. package/dist/components/thinking-panel/thinking-panel.styles.d.ts +1 -0
  200. package/dist/components/thinking-panel/thinking-panel.styles.js +117 -0
  201. package/dist/components/toast/toast-item.d.ts +1 -0
  202. package/dist/components/toast/toast-item.js +31 -6
  203. package/dist/components/tool-approval-dialog/tool-approval-dialog.d.ts +130 -0
  204. package/dist/components/tool-approval-dialog/tool-approval-dialog.js +403 -0
  205. package/dist/components/tool-approval-dialog/tool-approval-dialog.styles.d.ts +1 -0
  206. package/dist/components/tool-approval-dialog/tool-approval-dialog.styles.js +160 -0
  207. package/dist/components/tool-call-chip/tool-call-chip.d.ts +89 -0
  208. package/dist/components/tool-call-chip/tool-call-chip.js +288 -0
  209. package/dist/components/tool-call-chip/tool-call-chip.styles.d.ts +1 -0
  210. package/dist/components/tool-call-chip/tool-call-chip.styles.js +203 -0
  211. package/dist/components/tool-param-form/tool-param-form.d.ts +145 -0
  212. package/dist/components/tool-param-form/tool-param-form.js +366 -0
  213. package/dist/components/tool-param-form/tool-param-form.styles.d.ts +1 -0
  214. package/dist/components/tool-param-form/tool-param-form.styles.js +75 -0
  215. package/dist/components/tool-result-dialog/tool-result-dialog.d.ts +102 -0
  216. package/dist/components/tool-result-dialog/tool-result-dialog.js +393 -0
  217. package/dist/components/tool-result-dialog/tool-result-dialog.styles.d.ts +1 -0
  218. package/dist/components/tool-result-dialog/tool-result-dialog.styles.js +176 -0
  219. package/dist/components/tool-result-view/registry.d.ts +81 -0
  220. package/dist/components/tool-result-view/registry.js +84 -0
  221. package/dist/components/tool-result-view/tool-result-view.d.ts +55 -0
  222. package/dist/components/tool-result-view/tool-result-view.js +138 -0
  223. package/dist/components/tool-result-view/tool-result-view.styles.d.ts +1 -0
  224. package/dist/components/tool-result-view/tool-result-view.styles.js +13 -0
  225. package/dist/components/tool-select-dialog/tool-select-dialog.d.ts +151 -0
  226. package/dist/components/tool-select-dialog/tool-select-dialog.js +439 -0
  227. package/dist/components/tool-select-dialog/tool-select-dialog.styles.d.ts +1 -0
  228. package/dist/components/tool-select-dialog/tool-select-dialog.styles.js +182 -0
  229. package/dist/components/tree/tree-node.d.ts +11 -2
  230. package/dist/components/tree/tree-node.js +16 -6
  231. package/dist/components/tree/tree.d.ts +8 -2
  232. package/dist/components/tree/tree.js +18 -11
  233. package/dist/components/typing-indicator/typing-indicator.d.ts +60 -0
  234. package/dist/components/typing-indicator/typing-indicator.js +96 -0
  235. package/dist/components/typing-indicator/typing-indicator.styles.d.ts +1 -0
  236. package/dist/components/typing-indicator/typing-indicator.styles.js +132 -0
  237. package/dist/components/virtual-list/virtual-list.d.ts +173 -0
  238. package/dist/components/virtual-list/virtual-list.js +461 -0
  239. package/dist/components/virtual-list/virtual-list.styles.d.ts +1 -0
  240. package/dist/components/virtual-list/virtual-list.styles.js +44 -0
  241. package/dist/components/word-cloud/word-cloud-layout.js +14 -1
  242. package/dist/components/word-cloud/word-cloud.d.ts +6 -0
  243. package/dist/components/word-cloud/word-cloud.js +25 -14
  244. package/dist/components/word-cloud/word-cloud.styles.js +3 -2
  245. package/dist/internal/announcer.d.ts +57 -0
  246. package/dist/internal/announcer.js +71 -0
  247. package/dist/internal/form-associated.d.ts +1 -0
  248. package/dist/internal/form-associated.js +55 -11
  249. package/dist/internal/group-by-recency.d.ts +50 -0
  250. package/dist/internal/group-by-recency.js +80 -0
  251. package/dist/internal/rtl.d.ts +23 -0
  252. package/dist/internal/rtl.js +28 -0
  253. package/dist/internal/scroll-lock.d.ts +10 -5
  254. package/dist/internal/scroll-lock.js +30 -14
  255. package/dist/internal/tokens.styles.js +6 -0
  256. package/dist/lyra.d.ts +130 -31
  257. package/dist/lyra.js +94 -26
  258. package/llms-full.txt +3836 -17
  259. package/llms.txt +16 -1
  260. package/package.json +23 -5
  261. package/dist/components/chart/bar-chart.stories.d.ts +0 -5
  262. package/dist/components/chart/bar-chart.stories.js +0 -20
  263. package/dist/components/chart/box-plot.stories.d.ts +0 -5
  264. package/dist/components/chart/box-plot.stories.js +0 -29
  265. package/dist/components/chart/bubble-chart.stories.d.ts +0 -5
  266. package/dist/components/chart/bubble-chart.stories.js +0 -26
  267. package/dist/components/chart/chart.stories.d.ts +0 -32
  268. package/dist/components/chart/chart.stories.js +0 -141
  269. package/dist/components/chart/doughnut-chart.stories.d.ts +0 -5
  270. package/dist/components/chart/doughnut-chart.stories.js +0 -26
  271. package/dist/components/chart/histogram.stories.d.ts +0 -5
  272. package/dist/components/chart/histogram.stories.js +0 -17
  273. package/dist/components/chart/line-chart.stories.d.ts +0 -22
  274. package/dist/components/chart/line-chart.stories.js +0 -99
  275. package/dist/components/chart/lite-chart.stories.d.ts +0 -14
  276. package/dist/components/chart/lite-chart.stories.js +0 -114
  277. package/dist/components/chart/pie-chart.stories.d.ts +0 -5
  278. package/dist/components/chart/pie-chart.stories.js +0 -26
  279. package/dist/components/chart/polar-area-chart.stories.d.ts +0 -5
  280. package/dist/components/chart/polar-area-chart.stories.js +0 -20
  281. package/dist/components/chart/radar-chart.stories.d.ts +0 -5
  282. package/dist/components/chart/radar-chart.stories.js +0 -20
  283. package/dist/components/chart/scatter-chart.stories.d.ts +0 -5
  284. package/dist/components/chart/scatter-chart.stories.js +0 -31
  285. package/dist/components/combobox/combobox.stories.d.ts +0 -24
  286. package/dist/components/combobox/combobox.stories.js +0 -102
  287. package/dist/components/date-picker/date-input.stories.d.ts +0 -10
  288. package/dist/components/date-picker/date-input.stories.js +0 -48
  289. package/dist/components/date-picker/date-picker.stories.d.ts +0 -10
  290. package/dist/components/date-picker/date-picker.stories.js +0 -25
  291. package/dist/components/empty/empty.stories.d.ts +0 -7
  292. package/dist/components/empty/empty.stories.js +0 -34
  293. package/dist/components/export-button/export-button.stories.d.ts +0 -7
  294. package/dist/components/export-button/export-button.stories.js +0 -37
  295. package/dist/components/file-input/file-input.stories.d.ts +0 -7
  296. package/dist/components/file-input/file-input.stories.js +0 -19
  297. package/dist/components/flag/flag.stories.d.ts +0 -6
  298. package/dist/components/flag/flag.stories.js +0 -31
  299. package/dist/components/gauge/gauge.stories.d.ts +0 -8
  300. package/dist/components/gauge/gauge.stories.js +0 -19
  301. package/dist/components/graph/graph.stories.d.ts +0 -8
  302. package/dist/components/graph/graph.stories.js +0 -68
  303. package/dist/components/heatmap/heatmap.stories.d.ts +0 -27
  304. package/dist/components/heatmap/heatmap.stories.js +0 -179
  305. package/dist/components/map/map.stories.d.ts +0 -15
  306. package/dist/components/map/map.stories.js +0 -135
  307. package/dist/components/playback/playback.stories.d.ts +0 -7
  308. package/dist/components/playback/playback.stories.js +0 -16
  309. package/dist/components/select/select.stories.d.ts +0 -21
  310. package/dist/components/select/select.stories.js +0 -91
  311. package/dist/components/skeleton/skeleton.stories.d.ts +0 -5
  312. package/dist/components/skeleton/skeleton.stories.js +0 -16
  313. package/dist/components/sparkline/sparkline.stories.d.ts +0 -11
  314. package/dist/components/sparkline/sparkline.stories.js +0 -39
  315. package/dist/components/split/split.stories.d.ts +0 -7
  316. package/dist/components/split/split.stories.js +0 -36
  317. package/dist/components/stat/stat.stories.d.ts +0 -9
  318. package/dist/components/stat/stat.stories.js +0 -81
  319. package/dist/components/table/table.stories.d.ts +0 -12
  320. package/dist/components/table/table.stories.js +0 -67
  321. package/dist/components/time-range/time-range.stories.d.ts +0 -8
  322. package/dist/components/time-range/time-range.stories.js +0 -26
  323. package/dist/components/toast/toast.stories.d.ts +0 -8
  324. package/dist/components/toast/toast.stories.js +0 -72
  325. package/dist/components/tree/tree.stories.d.ts +0 -9
  326. package/dist/components/tree/tree.stories.js +0 -52
  327. package/dist/components/widget/widget.stories.d.ts +0 -9
  328. package/dist/components/widget/widget.stories.js +0 -74
  329. package/dist/components/word-cloud/word-cloud.stories.d.ts +0 -10
  330. package/dist/components/word-cloud/word-cloud.stories.js +0 -55
@@ -0,0 +1,71 @@
1
+ const DEFAULT_THROTTLE_MS = 500;
2
+ /**
3
+ * Trailing-edge debounce/coalesce for screen-reader announcements.
4
+ *
5
+ * Streaming UIs (token-by-token chat responses, progress ticks, etc.)
6
+ * naturally produce far more candidate announcements than a screen-reader
7
+ * user can usefully absorb — reading every incremental chunk aloud is spam,
8
+ * not information. `Announcer` collapses a burst of `announce()` calls
9
+ * arriving within `throttleMs` of the *first* call in that burst down to a
10
+ * single flush of the latest text: superseded intermediate text is dropped
11
+ * outright, never queued or concatenated. Passing `{ force: true }` always
12
+ * flushes immediately regardless of any window in progress, so a final or
13
+ * terminal message (e.g. "response complete") is never swallowed mid-burst.
14
+ *
15
+ * This is pure timing/state logic with no DOM dependency — it knows nothing
16
+ * about ARIA, elements, or Lit. `<lyra-live-region>`
17
+ * (`../components/live-region/live-region.js`) is the DOM-facing wrapper
18
+ * that composes one of these with an actual live-region element. Other
19
+ * components that need throttled announcements (a stream-status indicator,
20
+ * a tool-call chip's status transitions, a chat message's streaming state)
21
+ * should reuse that wrapper rather than instantiating `Announcer` directly.
22
+ */
23
+ export class Announcer {
24
+ constructor(options) {
25
+ this.throttleMs = options.throttleMs ?? DEFAULT_THROTTLE_MS;
26
+ this.onFlush = options.onFlush;
27
+ }
28
+ /** The latest text awaiting flush, if a burst is currently in progress. */
29
+ get pendingText() {
30
+ return this.pending;
31
+ }
32
+ /** Whether a flush is currently scheduled (a burst is in progress). */
33
+ get isPending() {
34
+ return this.timer !== undefined;
35
+ }
36
+ /**
37
+ * Queue `text` for announcement. Within a single throttle window, only the
38
+ * latest text queued survives — this call always overwrites whatever an
39
+ * earlier call in the same burst queued.
40
+ */
41
+ announce(text, options = {}) {
42
+ this.pending = text;
43
+ if (options.force) {
44
+ this.flush();
45
+ return;
46
+ }
47
+ // Only the first call of a burst schedules the timer; later calls inside
48
+ // the same window just overwrite `pending` above, so the flush deadline
49
+ // stays anchored to the first call (trailing-edge debounce) instead of
50
+ // being pushed back on every subsequent call.
51
+ this.timer ??= setTimeout(() => this.flush(), this.throttleMs);
52
+ }
53
+ /** Cancel any pending (not yet flushed) announcement without flushing it. */
54
+ cancel() {
55
+ if (this.timer !== undefined) {
56
+ clearTimeout(this.timer);
57
+ this.timer = undefined;
58
+ }
59
+ this.pending = undefined;
60
+ }
61
+ flush() {
62
+ if (this.timer !== undefined) {
63
+ clearTimeout(this.timer);
64
+ this.timer = undefined;
65
+ }
66
+ const text = this.pending;
67
+ this.pending = undefined;
68
+ if (text !== undefined)
69
+ this.onFlush(text);
70
+ }
71
+ }
@@ -7,6 +7,7 @@ export interface FormAssociatedInterface {
7
7
  value: string;
8
8
  disabled: boolean;
9
9
  required: boolean;
10
+ readonly effectiveDisabled: boolean;
10
11
  setFormValue(next: string): void;
11
12
  checkValidity(): boolean;
12
13
  reportValidity(): boolean;
@@ -13,16 +13,22 @@ export function FormAssociated(Base) {
13
13
  class FormAssociatedElement extends Base {
14
14
  static { this.formAssociated = true; }
15
15
  static { this.properties = {
16
- name: {},
16
+ name: { reflect: true, noAccessor: true },
17
17
  value: { noAccessor: true },
18
18
  disabled: { type: Boolean, reflect: true },
19
- required: { type: Boolean, reflect: true },
19
+ required: { type: Boolean, reflect: true, noAccessor: true },
20
20
  }; }
21
21
  constructor(...args) {
22
22
  super(...args);
23
- this.name = '';
24
23
  this.disabled = false;
25
- this.required = false;
24
+ this._fieldsetDisabled = false;
25
+ // Hand-written accessor (mirrors `value`/`required` below): native form
26
+ // submission for a form-associated custom element keys its `FormData`
27
+ // entry off the `name` *content attribute*, read synchronously at
28
+ // submission time — an async (Lit-scheduled) reflection would leave a
29
+ // property-only assignment like `el.name = 'foo'` invisible to a
30
+ // same-tick `new FormData(form)`/submit.
31
+ this._name = '';
26
32
  this._value = '';
27
33
  // What native `defaultValue`/`form.reset()` restores to. Mirrors the
28
34
  // `value` *content attribute* only (see `attributeChangedCallback`
@@ -34,7 +40,26 @@ export function FormAssociated(Base) {
34
40
  // first" would wrongly let a user's first-ever edit become permanent
35
41
  // (a required field could never be reset back to blank again).
36
42
  this._defaultValue = '';
43
+ this._required = false;
37
44
  this.internals = this.attachInternals();
45
+ // Native <input> always has a submission value ("") from construction —
46
+ // without this, a control whose `value` is never touched is entirely
47
+ // absent from FormData instead of present as "".
48
+ this.internals.setFormValue('');
49
+ }
50
+ get name() {
51
+ return this._name;
52
+ }
53
+ set name(next) {
54
+ const old = this._name;
55
+ this._name = next ?? '';
56
+ if (this._name) {
57
+ this.setAttribute('name', this._name);
58
+ }
59
+ else {
60
+ this.removeAttribute('name');
61
+ }
62
+ this.requestUpdate('name', old);
38
63
  }
39
64
  get value() {
40
65
  return this._value;
@@ -46,6 +71,22 @@ export function FormAssociated(Base) {
46
71
  this.updateValidity();
47
72
  this.requestUpdate('value', old);
48
73
  }
74
+ get required() {
75
+ return this._required;
76
+ }
77
+ set required(next) {
78
+ const old = this._required;
79
+ this._required = next;
80
+ this.toggleAttribute('required', next);
81
+ this.updateValidity();
82
+ this.requestUpdate('required', old);
83
+ }
84
+ /** Effective disabled state: this element's own `disabled` OR an ancestor
85
+ * `<fieldset disabled>`'s inherited state — mirrors native `<input>`, whose
86
+ * own `disabled` IDL property/attribute is never mutated by a fieldset. */
87
+ get effectiveDisabled() {
88
+ return this.disabled || this._fieldsetDisabled;
89
+ }
49
90
  attributeChangedCallback(name, old, value) {
50
91
  super.attributeChangedCallback(name, old, value);
51
92
  if (name === 'value') {
@@ -83,8 +124,16 @@ export function FormAssociated(Base) {
83
124
  // semantics) — previously this unconditionally blanked the field.
84
125
  this.value = this._defaultValue;
85
126
  }
86
- formDisabledCallback(disabled) {
87
- this.disabled = disabled;
127
+ /**
128
+ * Called by the browser when an ancestor `<fieldset disabled>` toggles.
129
+ * Tracked separately from the consumer's own `disabled` (see
130
+ * `effectiveDisabled`) — a native `<input>`'s own `disabled` IDL
131
+ * property/attribute is never mutated by fieldset cascading, so a
132
+ * consumer's explicit `disabled` must survive the fieldset re-enabling.
133
+ */
134
+ formDisabledCallback(fieldsetDisabled) {
135
+ this._fieldsetDisabled = fieldsetDisabled;
136
+ this.requestUpdate();
88
137
  }
89
138
  connectedCallback() {
90
139
  super.connectedCallback();
@@ -93,11 +142,6 @@ export function FormAssociated(Base) {
93
142
  // `value` write.
94
143
  this.updateValidity();
95
144
  }
96
- updated(changed) {
97
- super.updated(changed);
98
- if (changed.has('required'))
99
- this.updateValidity();
100
- }
101
145
  }
102
146
  return FormAssociatedElement;
103
147
  }
@@ -0,0 +1,50 @@
1
+ /** Per-bucket English defaults, overridable the same "no i18n, but
2
+ * overridable via an options object" way `<lyra-date-picker>`/
3
+ * `<lyra-source-list>`'s `label-plural` already establish. */
4
+ export interface RecencyLabels {
5
+ today?: string;
6
+ yesterday?: string;
7
+ previousWeek?: string;
8
+ older?: string;
9
+ }
10
+ export interface GroupByRecencyOptions<T> {
11
+ /** Extracts the timestamp to bucket `item` by. Defaults to assuming `item`
12
+ * itself *is* a `Date` — the simplest possible default for the common
13
+ * case of grouping a plain array of dates. A returned `number` is treated
14
+ * as a standard JS epoch-milliseconds value (`Date.prototype.getTime()`'s
15
+ * own unit) — not GreyCat's micros `time` type; a caller bridging from
16
+ * GreyCat data converts in its own `getTimestamp` callback. */
17
+ getTimestamp?: (item: T) => Date | number | string;
18
+ /** The "current" instant bucket boundaries are computed relative to.
19
+ * Defaults to `new Date()`. Overridable for deterministic tests (and for
20
+ * a caller that wants to bucket relative to something other than the
21
+ * actual current instant, e.g. a fixed "as of" report time). */
22
+ now?: Date;
23
+ /** Overrides for one or more of the four bucket labels. Any label left
24
+ * unset keeps its English default. */
25
+ labels?: RecencyLabels;
26
+ }
27
+ export interface RecencyBucket<T> {
28
+ label: string;
29
+ items: T[];
30
+ }
31
+ /**
32
+ * Buckets `items` into Today / Yesterday / Previous 7 Days / Older, using
33
+ * calendar-day boundaries in the local timezone — "yesterday" means the
34
+ * previous calendar date, not "24-48 hours ago". Mirrors the bucketing a
35
+ * chat sidebar's conversation-history list commonly groups by (this
36
+ * library's own `<lyra-conversation-item>` is the intended consumer, though
37
+ * this function is deliberately DOM/component-free — plain data in, plain
38
+ * data out).
39
+ *
40
+ * Only buckets that end up with at least one item are included in the
41
+ * returned array, in Today/Yesterday/Previous-7-Days/Older order; each
42
+ * bucket's items keep their original relative order from `items` (never
43
+ * re-sorted). Two edge cases with no dedicated bucket of their own: a
44
+ * timestamp dated in the future relative to `now` lands in `Today` — the
45
+ * most-recent bucket available, since there's no "upcoming" bucket to put it
46
+ * in instead. A timestamp that fails to parse lands in `Older` instead — it
47
+ * carries no "this is recent" signal at all, so the oldest/catch-all bucket
48
+ * is the more honest home for it than the newest one.
49
+ */
50
+ export declare function groupByRecency<T>(items: T[], options?: GroupByRecencyOptions<T>): RecencyBucket<T>[];
@@ -0,0 +1,80 @@
1
+ const MS_PER_DAY = 24 * 60 * 60 * 1000;
2
+ const DEFAULT_LABELS = {
3
+ today: 'Today',
4
+ yesterday: 'Yesterday',
5
+ previousWeek: 'Previous 7 Days',
6
+ older: 'Older',
7
+ };
8
+ /** Midnight (start of the local calendar day) for `d`, as epoch millis —
9
+ * built from `d`'s own local-timezone Y/M/D fields, so this is a calendar-
10
+ * day boundary, not a rolling 24-hour offset from `d` itself. */
11
+ function startOfLocalDay(d) {
12
+ return new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
13
+ }
14
+ /**
15
+ * Buckets `items` into Today / Yesterday / Previous 7 Days / Older, using
16
+ * calendar-day boundaries in the local timezone — "yesterday" means the
17
+ * previous calendar date, not "24-48 hours ago". Mirrors the bucketing a
18
+ * chat sidebar's conversation-history list commonly groups by (this
19
+ * library's own `<lyra-conversation-item>` is the intended consumer, though
20
+ * this function is deliberately DOM/component-free — plain data in, plain
21
+ * data out).
22
+ *
23
+ * Only buckets that end up with at least one item are included in the
24
+ * returned array, in Today/Yesterday/Previous-7-Days/Older order; each
25
+ * bucket's items keep their original relative order from `items` (never
26
+ * re-sorted). Two edge cases with no dedicated bucket of their own: a
27
+ * timestamp dated in the future relative to `now` lands in `Today` — the
28
+ * most-recent bucket available, since there's no "upcoming" bucket to put it
29
+ * in instead. A timestamp that fails to parse lands in `Older` instead — it
30
+ * carries no "this is recent" signal at all, so the oldest/catch-all bucket
31
+ * is the more honest home for it than the newest one.
32
+ */
33
+ export function groupByRecency(items, options = {}) {
34
+ const getTimestamp = options.getTimestamp ?? ((item) => item);
35
+ const now = options.now ?? new Date();
36
+ const labels = { ...DEFAULT_LABELS, ...options.labels };
37
+ const todayStart = startOfLocalDay(now);
38
+ const today = [];
39
+ const yesterday = [];
40
+ const previousWeek = [];
41
+ const older = [];
42
+ for (const item of items) {
43
+ const raw = getTimestamp(item);
44
+ const date = raw instanceof Date ? raw : new Date(raw);
45
+ const time = date.getTime();
46
+ // No meaningful "how recent" signal at all -- the catch-all bucket
47
+ // surfaces it (so it's never silently dropped) without inventing a
48
+ // "day 0" that a genuinely-invalid timestamp doesn't deserve.
49
+ if (Number.isNaN(time)) {
50
+ older.push(item);
51
+ continue;
52
+ }
53
+ const dayDiff = Math.round((todayStart - startOfLocalDay(date)) / MS_PER_DAY);
54
+ if (dayDiff <= 0) {
55
+ // <= 0 (not === 0) also covers a timestamp dated in the future
56
+ // relative to `now` -- there's no "upcoming" bucket, so it reads as
57
+ // the most-recent bucket available rather than being dropped.
58
+ today.push(item);
59
+ }
60
+ else if (dayDiff === 1) {
61
+ yesterday.push(item);
62
+ }
63
+ else if (dayDiff <= 7) {
64
+ previousWeek.push(item);
65
+ }
66
+ else {
67
+ older.push(item);
68
+ }
69
+ }
70
+ const buckets = [];
71
+ if (today.length)
72
+ buckets.push({ label: labels.today, items: today });
73
+ if (yesterday.length)
74
+ buckets.push({ label: labels.yesterday, items: yesterday });
75
+ if (previousWeek.length)
76
+ buckets.push({ label: labels.previousWeek, items: previousWeek });
77
+ if (older.length)
78
+ buckets.push({ label: labels.older, items: older });
79
+ return buckets;
80
+ }
@@ -1,3 +1,4 @@
1
+ import type { Placement } from '@floating-ui/dom';
1
2
  /**
2
3
  * Whether `el` resolves to RTL text direction. Logical CSS properties
3
4
  * (`inset-inline-start`, etc.) already flip visual layout for free, but
@@ -5,3 +6,25 @@
5
6
  * arrow-key direction) has to consult this explicitly to match.
6
7
  */
7
8
  export declare function isRtl(el: Element): boolean;
9
+ /** A physical (not logical) horizontal side. */
10
+ export type PhysicalSide = 'left' | 'right';
11
+ /**
12
+ * Swaps `side` under RTL, passes it through unchanged under LTR -- for
13
+ * reasoning about a physical side (e.g. which edge an icon should point at,
14
+ * or which edge of a track a dock panel resizes from) that logical CSS
15
+ * properties alone can't express, since the caller needs the resolved
16
+ * physical value itself (to rotate a glyph, to pick a Floating UI
17
+ * `Placement`), not just a layout that flips for free.
18
+ */
19
+ export declare function rtlAwareSide(side: PhysicalSide, el: Element): PhysicalSide;
20
+ /**
21
+ * Swaps the `left`/`right` component of a Floating UI `Placement` under RTL
22
+ * (`'right-start'` <-> `'left-start'`, etc.) -- `'top'`/`'bottom'`-based
23
+ * placements are already direction-agnostic and pass through unchanged.
24
+ * Floating UI's own `computePosition()` has no built-in RTL awareness (it
25
+ * positions purely by the physical `left`/`right`/`top`/`bottom` it's given),
26
+ * so a popover that means "anchor to my trailing edge" must resolve that
27
+ * intent to a physical placement itself before calling `place()` from
28
+ * `positioner.ts` -- this is the resolution step.
29
+ */
30
+ export declare function rtlAwarePlacement(placement: Placement, el: Element): Placement;
@@ -7,3 +7,31 @@
7
7
  export function isRtl(el) {
8
8
  return getComputedStyle(el).direction === 'rtl';
9
9
  }
10
+ /**
11
+ * Swaps `side` under RTL, passes it through unchanged under LTR -- for
12
+ * reasoning about a physical side (e.g. which edge an icon should point at,
13
+ * or which edge of a track a dock panel resizes from) that logical CSS
14
+ * properties alone can't express, since the caller needs the resolved
15
+ * physical value itself (to rotate a glyph, to pick a Floating UI
16
+ * `Placement`), not just a layout that flips for free.
17
+ */
18
+ export function rtlAwareSide(side, el) {
19
+ if (!isRtl(el))
20
+ return side;
21
+ return side === 'left' ? 'right' : 'left';
22
+ }
23
+ /**
24
+ * Swaps the `left`/`right` component of a Floating UI `Placement` under RTL
25
+ * (`'right-start'` <-> `'left-start'`, etc.) -- `'top'`/`'bottom'`-based
26
+ * placements are already direction-agnostic and pass through unchanged.
27
+ * Floating UI's own `computePosition()` has no built-in RTL awareness (it
28
+ * positions purely by the physical `left`/`right`/`top`/`bottom` it's given),
29
+ * so a popover that means "anchor to my trailing edge" must resolve that
30
+ * intent to a physical placement itself before calling `place()` from
31
+ * `positioner.ts` -- this is the resolution step.
32
+ */
33
+ export function rtlAwarePlacement(placement, el) {
34
+ if (!isRtl(el))
35
+ return placement;
36
+ return placement.replace(/^(left|right)/, (side) => (side === 'left' ? 'right' : 'left'));
37
+ }
@@ -1,7 +1,12 @@
1
1
  /**
2
- * Ref-counted document scroll lock safe when a lock is acquired and
3
- * released more than once concurrently (e.g. a fast open/close/open
4
- * sequence). The original `overflow` value is restored only once the last
5
- * outstanding lock releases.
2
+ * Ref-counted scroll lock, scoped to a given `Document` (defaults to the
3
+ * caller's own top-level `document`) so it also works for content rendered
4
+ * inside an iframe or any other document the caller explicitly passes.
5
+ * Compensates for the removed scrollbar's width with inline-end padding on
6
+ * the root element, so locking scroll doesn't shift page content
7
+ * horizontally the instant the scrollbar disappears — restored to its prior
8
+ * value once the last outstanding lock releases. Safe when a lock is
9
+ * acquired and released more than once concurrently (e.g. a fast
10
+ * open/close/open sequence).
6
11
  */
7
- export declare function lockScroll(): () => void;
12
+ export declare function lockScroll(doc?: Document): () => void;
@@ -1,25 +1,41 @@
1
- let lockCount = 0;
2
- let previousOverflow = '';
1
+ const counts = new WeakMap();
2
+ const previousOverflow = new WeakMap();
3
+ const previousPadding = new WeakMap();
3
4
  /**
4
- * Ref-counted document scroll lock safe when a lock is acquired and
5
- * released more than once concurrently (e.g. a fast open/close/open
6
- * sequence). The original `overflow` value is restored only once the last
7
- * outstanding lock releases.
5
+ * Ref-counted scroll lock, scoped to a given `Document` (defaults to the
6
+ * caller's own top-level `document`) so it also works for content rendered
7
+ * inside an iframe or any other document the caller explicitly passes.
8
+ * Compensates for the removed scrollbar's width with inline-end padding on
9
+ * the root element, so locking scroll doesn't shift page content
10
+ * horizontally the instant the scrollbar disappears — restored to its prior
11
+ * value once the last outstanding lock releases. Safe when a lock is
12
+ * acquired and released more than once concurrently (e.g. a fast
13
+ * open/close/open sequence).
8
14
  */
9
- export function lockScroll() {
10
- if (lockCount === 0) {
11
- previousOverflow = document.documentElement.style.overflow;
12
- document.documentElement.style.overflow = 'hidden';
15
+ export function lockScroll(doc = document) {
16
+ const root = doc.documentElement;
17
+ const count = counts.get(doc) ?? 0;
18
+ if (count === 0) {
19
+ previousOverflow.set(doc, root.style.overflow);
20
+ previousPadding.set(doc, root.style.paddingInlineEnd);
21
+ const scrollbarWidth = (doc.defaultView?.innerWidth ?? 0) - root.clientWidth;
22
+ root.style.overflow = 'hidden';
23
+ if (scrollbarWidth > 0) {
24
+ const currentPadding = parseFloat(getComputedStyle(root).paddingInlineEnd) || 0;
25
+ root.style.paddingInlineEnd = `${currentPadding + scrollbarWidth}px`;
26
+ }
13
27
  }
14
- lockCount++;
28
+ counts.set(doc, count + 1);
15
29
  let released = false;
16
30
  return () => {
17
31
  if (released)
18
32
  return;
19
33
  released = true;
20
- lockCount--;
21
- if (lockCount === 0) {
22
- document.documentElement.style.overflow = previousOverflow;
34
+ const remaining = (counts.get(doc) ?? 1) - 1;
35
+ counts.set(doc, remaining);
36
+ if (remaining === 0) {
37
+ root.style.overflow = previousOverflow.get(doc) ?? '';
38
+ root.style.paddingInlineEnd = previousPadding.get(doc) ?? '';
23
39
  }
24
40
  };
25
41
  }
@@ -10,8 +10,11 @@ export const tokens = css `
10
10
  --lyra-color-brand: var(--wa-color-brand-fill-loud, #0969da);
11
11
  --lyra-color-brand-quiet: var(--wa-color-brand-fill-quiet, #ddf4ff);
12
12
  --lyra-color-success: var(--wa-color-success-fill-loud, #1a7f37);
13
+ --lyra-color-success-quiet: var(--wa-color-success-fill-quiet, #dafbe1);
13
14
  --lyra-color-warning: var(--wa-color-warning-fill-loud, #9a6700);
15
+ --lyra-color-warning-quiet: var(--wa-color-warning-fill-quiet, #fff8c5);
14
16
  --lyra-color-danger: var(--wa-color-danger-fill-loud, #cf222e);
17
+ --lyra-color-danger-quiet: var(--wa-color-danger-fill-quiet, #ffebe9);
15
18
  /* Text/icon color for content painted on top of a solid brand-fill
16
19
  background (selected calendar days, filled badges, etc.) -- almost
17
20
  always white on both the light and dark brand fills above, so it's
@@ -65,8 +68,11 @@ export const tokens = css `
65
68
  --lyra-color-brand: var(--wa-color-brand-fill-loud, #4d9fef);
66
69
  --lyra-color-brand-quiet: var(--wa-color-brand-fill-quiet, #163650);
67
70
  --lyra-color-success: var(--wa-color-success-fill-loud, #3fb950);
71
+ --lyra-color-success-quiet: var(--wa-color-success-fill-quiet, #1b4721);
68
72
  --lyra-color-warning: var(--wa-color-warning-fill-loud, #d29922);
73
+ --lyra-color-warning-quiet: var(--wa-color-warning-fill-quiet, #3b2900);
69
74
  --lyra-color-danger: var(--wa-color-danger-fill-loud, #f85149);
75
+ --lyra-color-danger-quiet: var(--wa-color-danger-fill-quiet, #4c1210);
70
76
  }
71
77
  }
72
78
  :host([hidden]) {