@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,461 @@
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 } from 'lit';
8
+ import { property } from 'lit/decorators.js';
9
+ import { LyraElement } from '../../internal/lyra-element.js';
10
+ import { defineElement } from '../../internal/prefix.js';
11
+ import { place } from '../../internal/positioner.js';
12
+ import { rtlAwarePlacement } from '../../internal/rtl.js';
13
+ import { nextId } from '../../internal/a11y.js';
14
+ import { styles } from './menu.styles.js';
15
+ import { LyraMenuItem } from './menu-item.js';
16
+ import './menu-item.js';
17
+ /**
18
+ * `<lyra-menu>` — an anchored dropdown of `<lyra-menu-item>` actions, opened
19
+ * from a consumer-supplied trigger (typically an icon button). A close, drop-
20
+ * in-shaped replacement for reaching outside this library for a third-party
21
+ * dropdown to build a gear menu, an avatar menu, or a history row's overflow
22
+ * menu: click the trigger, a positioned menu appears, clicking an item both
23
+ * performs the action *and* closes the menu.
24
+ *
25
+ * **ARIA pattern — `role="menu"`/`role="menuitem"` with real roving DOM
26
+ * focus, not a listbox.** Two coherent, mutually-exclusive shapes were
27
+ * available here: (a) `role="listbox"`/`role="option"` with
28
+ * `aria-activedescendant`, the pattern `<lyra-select>`'s trigger-button +
29
+ * popup listbox uses, where DOM focus never leaves the trigger; or (b)
30
+ * `role="menu"`/`role="menuitem"` with real focus moving between actual
31
+ * focusable rows, the WAI-ARIA "menu button" pattern. This picks (b):
32
+ * `<lyra-menu-item>` rows are real, independently-focusable elements (see
33
+ * that class's own doc), which is the more natural fit for a menu
34
+ * specifically — unlike a listbox's rows, a menu's rows are conventionally
35
+ * button-/link-shaped, and every well-known native/OS menu (and this
36
+ * family's own `<lyra-tree>`/`<lyra-tree-node>` pair, which this component's
37
+ * roving-tabindex plumbing directly mirrors) already moves real focus rather
38
+ * than merely a virtual `aria-activedescendant` pointer. `role`/`tabIndex`
39
+ * are consistently the menu-button shape throughout — never mixed with
40
+ * listbox/option.
41
+ *
42
+ * Interaction contract (mirrors the WAI-ARIA APG "menu button" pattern):
43
+ * - Click the trigger (or Enter/Space on it, via the trigger's own native
44
+ * `click` activation) toggles the menu, moving focus to the first
45
+ * non-disabled item on open.
46
+ * - ArrowDown/ArrowUp on the trigger while closed also open it, focusing the
47
+ * first/last non-disabled item respectively.
48
+ * - Once open, ArrowDown/ArrowUp move the roving focus among non-disabled
49
+ * items (wrapping past either end — the recommended, and more common,
50
+ * menu-widget behavior, unlike `<lyra-select>`'s clamped listbox nav).
51
+ * Home/End jump to the first/last non-disabled item. Enter/Space activate
52
+ * the focused item. Escape closes and returns focus to the trigger. Tab
53
+ * closes the menu without trapping focus (the browser's own default Tab
54
+ * behavior proceeds untouched). A printable keypress runs type-ahead:
55
+ * roving focus jumps to the next non-disabled item whose text starts with
56
+ * the accumulated buffer, cycling from just after the active item (mirrors
57
+ * `<lyra-select>`'s identical listbox type-ahead).
58
+ * - A click outside both the trigger and the open popup closes it (mirrors
59
+ * `<lyra-select>`'s `onDocPointer` exactly) — this does *not* refocus the
60
+ * trigger, since the outside click itself already moved focus somewhere
61
+ * the user chose; Escape and a committed selection *do* refocus the
62
+ * trigger, since those are dismissals with nowhere else for focus to go.
63
+ *
64
+ * The trigger element itself is read from the `trigger` slot's assigned
65
+ * element (first one, if several are assigned) and enhanced imperatively
66
+ * with `aria-haspopup="menu"`/`aria-expanded`/`aria-controls` — the same
67
+ * "reach into a consumer-owned light-DOM element to complete its a11y
68
+ * wiring" approach `<lyra-dialog>` documents for its own heading detection,
69
+ * necessary here because those attributes belong on the actual interactive
70
+ * trigger, which lives outside this component's own shadow root.
71
+ *
72
+ * The popup is always rendered (never `display:none`) so `.focus()` calls on
73
+ * its content work synchronously the instant it opens — visually hidden via
74
+ * `visibility`/`opacity` instead (identical to `<lyra-select>`'s own
75
+ * `[part="listbox"]`). `visibility` is an inherited CSS property that
76
+ * pierces the `<slot>` projection boundary, so every closed-state
77
+ * `<lyra-menu-item>` is automatically excluded from sequential (Tab-key)
78
+ * navigation with no separate JS bookkeeping.
79
+ *
80
+ * @customElement lyra-menu
81
+ * @slot trigger - The consumer's own trigger element (typically an icon
82
+ * button). Clicking it toggles the menu; it's positioned against via
83
+ * `internal/positioner.js`'s `place()`.
84
+ * @slot - `<lyra-menu-item>` elements, plus optionally plain `<hr>` dividers
85
+ * between groups (native `<hr>` already carries an implicit `separator`
86
+ * role, matching what `role="menu"` expects between item groups).
87
+ * @event lyra-show - The menu opened. Not fired for markup that renders
88
+ * `open` true from the start (mirrors `<lyra-select>`'s identical guard).
89
+ * @event lyra-hide - The menu closed. Same first-render guard as `lyra-show`.
90
+ * @event lyra-menu-select - A `<lyra-menu-item>` was activated. `detail: {
91
+ * value }` — the consolidated re-fire of that item's own
92
+ * `lyra-menu-item-select` (see `<lyra-menu-item>`'s doc for why listening
93
+ * here, rather than on every item, is the recommended approach). Always
94
+ * followed by the menu closing and focus returning to the trigger.
95
+ * @csspart trigger - The wrapper around the `trigger` slot (the positioning anchor).
96
+ * @csspart popup - The positioned floating panel.
97
+ * @csspart list - The `role="menu"` container wrapping the default slot.
98
+ */
99
+ export class LyraMenu extends LyraElement {
100
+ constructor() {
101
+ super(...arguments);
102
+ /** Whether the menu is open. */
103
+ this.open = false;
104
+ /** Accessible name for the `role="menu"` popup — override with something
105
+ * specific (e.g. "Row actions") when a page has more than one menu. */
106
+ this.label = 'Menu';
107
+ // Plain instance fields, not @state() -- render()'s template never reads
108
+ // either (items render via the plain default <slot>; there is no
109
+ // activeIndex-driven markup), so reactively scheduling a re-render on
110
+ // every roving-focus move would only trigger Lit's "scheduled an update
111
+ // after an update completed" dev-mode warning for no visual benefit --
112
+ // both only drive imperative side effects (applyRovingTabIndex()/.focus()).
113
+ this.items = [];
114
+ this.activeIndex = -1;
115
+ this._isFirstUpdate = true;
116
+ this.pendingFocus = 'first';
117
+ this.listId = nextId('menu-list');
118
+ // Standard menu type-ahead, mirroring lyra-select's identical listbox
119
+ // trio: printable keystrokes accumulate into this buffer and reset ~500ms
120
+ // after the last one, so "d" then "e" narrows to "de" instead of
121
+ // restarting the search on every keystroke.
122
+ this.typeAheadBuffer = '';
123
+ this.onDocPointer = (e) => {
124
+ if (!e.composedPath().includes(this))
125
+ this.hide();
126
+ };
127
+ this.onTriggerClick = () => {
128
+ this.open ? this.hide() : this.show();
129
+ };
130
+ this.onTriggerKeyDown = (e) => {
131
+ // A safety net for a menu with zero navigable items: focus never leaves
132
+ // the trigger in that edge case (see focusRoving()), so onListKeyDown's
133
+ // own Escape handling would otherwise never run.
134
+ if (e.key === 'Escape' && this.open) {
135
+ e.preventDefault();
136
+ this.hide(true);
137
+ return;
138
+ }
139
+ if (this.open)
140
+ return;
141
+ switch (e.key) {
142
+ case 'ArrowDown':
143
+ e.preventDefault();
144
+ this.show('first');
145
+ break;
146
+ case 'ArrowUp':
147
+ e.preventDefault();
148
+ this.show('last');
149
+ break;
150
+ default:
151
+ return;
152
+ }
153
+ };
154
+ this.onTriggerSlotChange = (e) => {
155
+ const assigned = e.target.assignedElements({ flatten: true });
156
+ const next = assigned[0];
157
+ if (next === this.triggerEl)
158
+ return;
159
+ if (this.triggerEl) {
160
+ this.triggerEl.removeAttribute('aria-haspopup');
161
+ this.triggerEl.removeAttribute('aria-expanded');
162
+ this.triggerEl.removeAttribute('aria-controls');
163
+ }
164
+ this.triggerEl = next;
165
+ this.syncTriggerA11y();
166
+ // Covers the "open from the start" race documented on reposition()'s
167
+ // call in updated() -- a no-op resubscribe once already positioned.
168
+ if (this.open)
169
+ this.reposition();
170
+ };
171
+ this.onItemsSlotChange = (e) => {
172
+ this.itemStateObserver?.disconnect();
173
+ this.items = e.target
174
+ .assignedElements({ flatten: true })
175
+ .filter((el) => el instanceof LyraMenuItem);
176
+ if (typeof MutationObserver !== 'undefined') {
177
+ this.itemStateObserver = new MutationObserver(() => this.onItemStateChange());
178
+ for (const item of this.items) {
179
+ this.itemStateObserver.observe(item, {
180
+ attributes: true,
181
+ attributeFilter: ['disabled', 'hidden', 'aria-hidden'],
182
+ });
183
+ }
184
+ }
185
+ if (this.activeIndex >= this.items.length)
186
+ this.activeIndex = -1;
187
+ this.applyRovingTabIndex();
188
+ // Covers the same "open from the start" race as onTriggerSlotChange's
189
+ // reposition() call -- activeIndex === -1 means nothing has claimed the
190
+ // roving focus yet (never true once a user has actually navigated),
191
+ // so this only ever fires for that initial catch-up, not on every later
192
+ // items mutation while open.
193
+ if (this.open && this.activeIndex === -1)
194
+ this.focusRoving(this.pendingFocus);
195
+ };
196
+ /** Rehomes roving focus immediately when an active item becomes disabled or hidden. */
197
+ this.onItemStateChange = () => {
198
+ const navigable = this.items.filter((item) => this.isNavigable(item));
199
+ if (this.activeIndex >= 0 && !this.isNavigable(this.items[this.activeIndex])) {
200
+ const current = this.activeIndex;
201
+ const next = navigable.find((item) => this.items.indexOf(item) > current) ??
202
+ navigable.find((item) => this.items.indexOf(item) < current);
203
+ if (next) {
204
+ this.setActiveItem(next);
205
+ }
206
+ else {
207
+ this.activeIndex = -1;
208
+ this.applyRovingTabIndex();
209
+ }
210
+ return;
211
+ }
212
+ this.applyRovingTabIndex();
213
+ };
214
+ this.onItemSelect = (e) => {
215
+ const item = e.target;
216
+ if (!(item instanceof LyraMenuItem))
217
+ return;
218
+ this.emit('lyra-menu-select', { value: item.value });
219
+ this.hide(true);
220
+ };
221
+ /** Resyncs `activeIndex` (and the roving `tabindex`) to wherever real DOM
222
+ * focus actually lands, for any path that doesn't go through
223
+ * `setActiveItem()` -- e.g. a real mousedown on an item, which focuses it
224
+ * even while `disabled` (`tabIndex="-1"` remains mouse-focusable per
225
+ * spec). Without this, `activeIndex` goes stale the moment focus moves any
226
+ * other way, and subsequent Arrow-key navigation computes its next item
227
+ * from that stale position instead of from where focus actually is. A
228
+ * no-op for `setActiveItem()`'s own `.focus()` call, since `activeIndex`
229
+ * there is already set to match before focus moves. */
230
+ this.onListFocusIn = (e) => {
231
+ const target = e.target;
232
+ if (!(target instanceof LyraMenuItem))
233
+ return;
234
+ const index = this.items.indexOf(target);
235
+ if (index === -1 || index === this.activeIndex)
236
+ return;
237
+ this.activeIndex = index;
238
+ this.applyRovingTabIndex();
239
+ };
240
+ this.onListKeyDown = (e) => {
241
+ const navigable = this.items.filter((i) => this.isNavigable(i));
242
+ const current = this.activeIndex >= 0 ? this.items[this.activeIndex] : undefined;
243
+ const currentNavIndex = current ? navigable.indexOf(current) : -1;
244
+ switch (e.key) {
245
+ case 'ArrowDown':
246
+ e.preventDefault();
247
+ if (navigable.length) {
248
+ this.setActiveItem(navigable[(currentNavIndex + 1 + navigable.length) % navigable.length]);
249
+ }
250
+ break;
251
+ case 'ArrowUp':
252
+ e.preventDefault();
253
+ if (navigable.length) {
254
+ const prevIndex = currentNavIndex <= 0 ? navigable.length - 1 : currentNavIndex - 1;
255
+ this.setActiveItem(navigable[prevIndex]);
256
+ }
257
+ break;
258
+ case 'Home':
259
+ e.preventDefault();
260
+ if (navigable.length)
261
+ this.setActiveItem(navigable[0]);
262
+ break;
263
+ case 'End':
264
+ e.preventDefault();
265
+ if (navigable.length)
266
+ this.setActiveItem(navigable[navigable.length - 1]);
267
+ break;
268
+ case 'Enter':
269
+ case ' ':
270
+ // Mirrors lyra-tree calling current.select() from its own delegated
271
+ // keydown handler, rather than each row wiring its own keydown.
272
+ e.preventDefault();
273
+ current?.select();
274
+ break;
275
+ case 'Escape':
276
+ e.preventDefault();
277
+ this.hide(true);
278
+ break;
279
+ case 'Tab':
280
+ // No preventDefault -- the browser's own default Tab navigation is
281
+ // left to proceed untouched, only the (now-stale) open menu closes.
282
+ this.hide();
283
+ break;
284
+ default:
285
+ if (e.key.length === 1 && !e.altKey && !e.ctrlKey && !e.metaKey) {
286
+ this.typeAhead(e.key);
287
+ }
288
+ return;
289
+ }
290
+ };
291
+ }
292
+ static { this.styles = [LyraElement.styles, styles]; }
293
+ willUpdate() {
294
+ this._isFirstUpdate = !this.hasUpdated;
295
+ }
296
+ updated(changed) {
297
+ if (changed.has('open')) {
298
+ this.cleanup?.();
299
+ this.cleanup = undefined;
300
+ // All open-driven side effects (positioning, the click-outside
301
+ // listener, the lyra-show/lyra-hide events, and moving focus into the
302
+ // menu) live here rather than in show()/hide() so they fire however
303
+ // `open` became true -- via show()/hide()'s own user-interaction
304
+ // paths, or a consumer/test setting `el.open` directly, which bypasses
305
+ // both. Mirrors lyra-select's identical updated()-centralized approach.
306
+ if (this.open) {
307
+ document.addEventListener('pointerdown', this.onDocPointer);
308
+ if (!this._isFirstUpdate)
309
+ this.emit('lyra-show');
310
+ // Both reposition() and focusRoving() no-op gracefully if triggerEl/
311
+ // items aren't populated yet -- for markup that renders `open` true
312
+ // from the start, the trigger/default slots' *own* slotchange events
313
+ // (queued as microtasks) can still be pending at this point, ahead of
314
+ // Lit's synchronous first update. onTriggerSlotChange/
315
+ // onItemsSlotChange below re-run these same two calls once that
316
+ // catches up, so this always resolves correctly either way.
317
+ this.reposition();
318
+ this.focusRoving(this.pendingFocus);
319
+ }
320
+ else {
321
+ document.removeEventListener('pointerdown', this.onDocPointer);
322
+ if (!this._isFirstUpdate)
323
+ this.emit('lyra-hide');
324
+ }
325
+ this.syncTriggerA11y();
326
+ }
327
+ }
328
+ reposition() {
329
+ this.cleanup?.();
330
+ this.cleanup = undefined;
331
+ const popup = this.renderRoot.querySelector('[part="popup"]');
332
+ if (this.triggerEl && popup) {
333
+ const placement = this.placement && rtlAwarePlacement(this.placement, this);
334
+ this.cleanup = place(this.triggerEl, popup, placement ? { placement } : {});
335
+ }
336
+ }
337
+ disconnectedCallback() {
338
+ super.disconnectedCallback();
339
+ this.cleanup?.();
340
+ this.cleanup = undefined;
341
+ clearTimeout(this.typeAheadTimer);
342
+ this.itemStateObserver?.disconnect();
343
+ this.itemStateObserver = undefined;
344
+ document.removeEventListener('pointerdown', this.onDocPointer);
345
+ // Reset so a reconnect (e.g. a drag-drop reparent) re-triggers
346
+ // `updated()`'s `open`-driven branch -- without this, `open` stays
347
+ // `true` across the disconnect/reconnect and `changed.has('open')` never
348
+ // fires again, leaving the menu rendered open with no positioning and
349
+ // no outside-click listener.
350
+ this.open = false;
351
+ }
352
+ show(focus = 'first') {
353
+ if (this.open)
354
+ return;
355
+ this.pendingFocus = focus;
356
+ this.open = true;
357
+ }
358
+ /** `refocusTrigger` is only ever `true` for a dismissal with nowhere else
359
+ * for focus to land (Escape, a committed selection) -- see the class
360
+ * doc's interaction contract for why an outside click deliberately omits it. */
361
+ hide(refocusTrigger = false) {
362
+ if (!this.open)
363
+ return;
364
+ this.open = false;
365
+ this.activeIndex = -1;
366
+ this.applyRovingTabIndex();
367
+ if (refocusTrigger)
368
+ this.triggerEl?.focus();
369
+ }
370
+ /** `aria-haspopup`/`aria-expanded`/`aria-controls` belong on the actual
371
+ * interactive trigger, which is consumer-owned light-DOM content outside
372
+ * this component's own shadow root -- see the class doc. */
373
+ syncTriggerA11y() {
374
+ if (!this.triggerEl)
375
+ return;
376
+ this.triggerEl.setAttribute('aria-haspopup', 'menu');
377
+ this.triggerEl.setAttribute('aria-expanded', this.open ? 'true' : 'false');
378
+ this.triggerEl.setAttribute('aria-controls', this.listId);
379
+ }
380
+ isNavigable(item) {
381
+ return !item.disabled && !item.hidden && item.getAttribute('aria-hidden') !== 'true';
382
+ }
383
+ /** Flips exactly one non-disabled item's `tabIndex` to `0` (the roving
384
+ * target) and every other item's to `-1` -- see `<lyra-menu-item>`'s doc
385
+ * for why this is the sole authority over that property. */
386
+ applyRovingTabIndex() {
387
+ this.items.forEach((item, i) => {
388
+ item.tabIndex = i === this.activeIndex ? 0 : -1;
389
+ });
390
+ }
391
+ /** Moves the roving focus (and real DOM focus) to the first/last
392
+ * non-disabled item. A no-op when there are none -- focus then simply
393
+ * stays on the trigger (see onTriggerKeyDown's Escape safety net). */
394
+ focusRoving(which) {
395
+ const navigable = this.items.filter((i) => this.isNavigable(i));
396
+ if (!navigable.length)
397
+ return;
398
+ const item = which === 'first' ? navigable[0] : navigable[navigable.length - 1];
399
+ this.setActiveItem(item);
400
+ }
401
+ setActiveItem(item) {
402
+ this.activeIndex = this.items.indexOf(item);
403
+ this.applyRovingTabIndex();
404
+ item.focus();
405
+ }
406
+ /** Standard WAI-ARIA APG menu-button type-ahead: moves the roving focus to
407
+ * the next non-disabled item whose text content starts with the
408
+ * accumulated buffer, cycling from just after the currently active item
409
+ * -- mirrors `<lyra-select>`'s identical listbox type-ahead. */
410
+ typeAhead(char) {
411
+ clearTimeout(this.typeAheadTimer);
412
+ this.typeAheadBuffer += char.toLowerCase();
413
+ this.typeAheadTimer = setTimeout(() => {
414
+ this.typeAheadBuffer = '';
415
+ }, 500);
416
+ const navigable = this.items.filter((i) => !i.disabled);
417
+ if (!navigable.length)
418
+ return;
419
+ const current = this.activeIndex >= 0 ? this.items[this.activeIndex] : undefined;
420
+ const currentIndex = current ? navigable.indexOf(current) : -1;
421
+ const n = navigable.length;
422
+ for (let step = 1; step <= n; step++) {
423
+ const candidate = navigable[(currentIndex + step + n) % n];
424
+ if ((candidate.textContent ?? '').trim().toLowerCase().startsWith(this.typeAheadBuffer)) {
425
+ this.setActiveItem(candidate);
426
+ return;
427
+ }
428
+ }
429
+ }
430
+ render() {
431
+ return html `
432
+ <div part="trigger" @click=${this.onTriggerClick} @keydown=${this.onTriggerKeyDown}>
433
+ <slot name="trigger" @slotchange=${this.onTriggerSlotChange}></slot>
434
+ </div>
435
+ <div part="popup">
436
+ <div
437
+ part="list"
438
+ id=${this.listId}
439
+ role="menu"
440
+ aria-label=${this.label}
441
+ @keydown=${this.onListKeyDown}
442
+ @focusin=${this.onListFocusIn}
443
+ @lyra-menu-item-select=${this.onItemSelect}
444
+ @lyra-menu-item-state-change=${this.onItemStateChange}
445
+ >
446
+ <slot @slotchange=${this.onItemsSlotChange}></slot>
447
+ </div>
448
+ </div>
449
+ `;
450
+ }
451
+ }
452
+ __decorate([
453
+ property({ type: Boolean, reflect: true })
454
+ ], LyraMenu.prototype, "open", void 0);
455
+ __decorate([
456
+ property({ reflect: true })
457
+ ], LyraMenu.prototype, "placement", void 0);
458
+ __decorate([
459
+ property()
460
+ ], LyraMenu.prototype, "label", void 0);
461
+ defineElement('menu', LyraMenu);
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,67 @@
1
+ import { css } from 'lit';
2
+ export const styles = css `
3
+ /* Fully transparent to layout -- the visible/clickable surface is entirely
4
+ the consumer's own slotted trigger element (see [part='trigger'] below),
5
+ so the host contributes no box of its own for that trigger to sit inside
6
+ (no stray margin/inline-block quirks around, say, a plain icon button). */
7
+ :host {
8
+ display: contents;
9
+ }
10
+ [part='trigger'] {
11
+ /* Same reasoning as :host above -- event listeners still fire on a
12
+ display:contents element (only layout/hit-testing are affected), so
13
+ click/keydown delegation from the slotted trigger keeps working. */
14
+ display: contents;
15
+ }
16
+ [part='popup'] {
17
+ position: fixed;
18
+ z-index: 900;
19
+ box-sizing: border-box;
20
+ min-inline-size: 10rem;
21
+ max-inline-size: min(92vw, 20rem, var(--lyra-positioner-available-inline-size, 100vw));
22
+ max-block-size: min(20rem, var(--lyra-positioner-available-block-size, 20rem));
23
+ background: var(--lyra-color-surface);
24
+ border: 1px solid var(--lyra-color-border);
25
+ border-radius: var(--lyra-radius);
26
+ box-shadow: var(--lyra-shadow);
27
+ /* Closed state: invisible + slightly raised -- visibility (not
28
+ display:none) so opacity/transform can actually transition, and so a
29
+ light-DOM <lyra-menu-item>'s inherited visibility (see
30
+ menu.ts's class doc on tab-order safety) excludes it from sequential
31
+ focus navigation while closed with no separate tabindex bookkeeping
32
+ needed. Mirrors lyra-select's identical [part='listbox'] treatment. */
33
+ visibility: hidden;
34
+ opacity: 0;
35
+ transform: translateY(-0.25rem);
36
+ transition:
37
+ opacity var(--lyra-transition-fast),
38
+ transform var(--lyra-transition-fast),
39
+ visibility var(--lyra-transition-fast);
40
+ }
41
+ :host([open]) [part='popup'] {
42
+ visibility: visible;
43
+ opacity: 1;
44
+ transform: translateY(0);
45
+ }
46
+ @media (prefers-reduced-motion: reduce) {
47
+ [part='popup'] {
48
+ transition: none !important;
49
+ }
50
+ }
51
+ [part='list'] {
52
+ display: flex;
53
+ flex-direction: column;
54
+ max-block-size: min(20rem, var(--lyra-positioner-available-block-size, 20rem));
55
+ overflow-y: auto;
56
+ padding: var(--lyra-space-xs);
57
+ outline: none;
58
+ }
59
+ /* A plain <hr> divider between item groups -- native <hr> already carries
60
+ an implicit ARIA role of "separator", exactly what role="menu" expects
61
+ between groups of menuitem children, so no role attribute needs adding. */
62
+ ::slotted(hr) {
63
+ border: none;
64
+ border-block-start: 1px solid var(--lyra-color-border);
65
+ margin: var(--lyra-space-xs) var(--lyra-space-xs);
66
+ }
67
+ `;