@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.
- package/README.md +98 -14
- package/custom-elements.json +30279 -12124
- package/dist/components/app-rail/app-rail-item.d.ts +30 -0
- package/dist/components/app-rail/app-rail-item.js +68 -0
- package/dist/components/app-rail/app-rail-item.styles.d.ts +1 -0
- package/dist/components/app-rail/app-rail-item.styles.js +65 -0
- package/dist/components/app-rail/app-rail.d.ts +168 -0
- package/dist/components/app-rail/app-rail.js +419 -0
- package/dist/components/app-rail/app-rail.styles.d.ts +1 -0
- package/dist/components/app-rail/app-rail.styles.js +128 -0
- package/dist/components/attachment-chip/attachment-chip.d.ts +141 -0
- package/dist/components/attachment-chip/attachment-chip.js +356 -0
- package/dist/components/attachment-chip/attachment-chip.styles.d.ts +1 -0
- package/dist/components/attachment-chip/attachment-chip.styles.js +184 -0
- package/dist/components/attachment-trigger/attachment-trigger.d.ts +96 -0
- package/dist/components/attachment-trigger/attachment-trigger.js +270 -0
- package/dist/components/attachment-trigger/attachment-trigger.styles.d.ts +1 -0
- package/dist/components/attachment-trigger/attachment-trigger.styles.js +90 -0
- package/dist/components/chart/bar-chart.js +2 -18
- package/dist/components/chart/box-plot.d.ts +25 -1
- package/dist/components/chart/box-plot.js +147 -7
- package/dist/components/chart/box-plot.styles.js +13 -0
- package/dist/components/chart/bubble-chart.js +2 -18
- package/dist/components/chart/chart-loader.d.ts +44 -13
- package/dist/components/chart/chart-loader.js +65 -18
- package/dist/components/chart/chart.d.ts +55 -12
- package/dist/components/chart/chart.js +247 -49
- package/dist/components/chart/doughnut-chart.js +2 -18
- package/dist/components/chart/histogram-bin.d.ts +7 -1
- package/dist/components/chart/histogram-bin.js +32 -14
- package/dist/components/chart/histogram.js +8 -16
- package/dist/components/chart/line-chart.js +2 -18
- package/dist/components/chart/lite-chart.d.ts +134 -3
- package/dist/components/chart/lite-chart.js +382 -67
- package/dist/components/chart/lite-chart.styles.js +9 -0
- package/dist/components/chart/pie-chart.js +2 -18
- package/dist/components/chart/polar-area-chart.js +2 -18
- package/dist/components/chart/radar-chart.js +2 -18
- package/dist/components/chart/scatter-chart.js +2 -18
- package/dist/components/chat-composer/chat-composer.d.ts +133 -0
- package/dist/components/chat-composer/chat-composer.js +366 -0
- package/dist/components/chat-composer/chat-composer.styles.d.ts +1 -0
- package/dist/components/chat-composer/chat-composer.styles.js +145 -0
- package/dist/components/chat-message/chat-message.d.ts +141 -0
- package/dist/components/chat-message/chat-message.js +331 -0
- package/dist/components/chat-message/chat-message.styles.d.ts +1 -0
- package/dist/components/chat-message/chat-message.styles.js +203 -0
- package/dist/components/checkbox/checkbox.d.ts +117 -0
- package/dist/components/checkbox/checkbox.js +353 -0
- package/dist/components/checkbox/checkbox.styles.d.ts +1 -0
- package/dist/components/checkbox/checkbox.styles.js +77 -0
- package/dist/components/chip/chip-group.d.ts +56 -0
- package/dist/components/chip/chip-group.js +130 -0
- package/dist/components/chip/chip-group.styles.d.ts +1 -0
- package/dist/components/chip/chip-group.styles.js +57 -0
- package/dist/components/chip/chip.d.ts +64 -0
- package/dist/components/chip/chip.js +122 -0
- package/dist/components/chip/chip.styles.d.ts +1 -0
- package/dist/components/chip/chip.styles.js +115 -0
- package/dist/components/citation-badge/citation-badge.d.ts +113 -0
- package/dist/components/citation-badge/citation-badge.js +318 -0
- package/dist/components/citation-badge/citation-badge.styles.d.ts +1 -0
- package/dist/components/citation-badge/citation-badge.styles.js +96 -0
- package/dist/components/code-block/code-block.d.ts +127 -0
- package/dist/components/code-block/code-block.js +382 -0
- package/dist/components/code-block/code-block.styles.d.ts +1 -0
- package/dist/components/code-block/code-block.styles.js +187 -0
- package/dist/components/code-block/code-loader.d.ts +87 -0
- package/dist/components/code-block/code-loader.js +142 -0
- package/dist/components/combobox/combobox.d.ts +65 -6
- package/dist/components/combobox/combobox.js +258 -48
- package/dist/components/combobox/combobox.styles.js +3 -3
- package/dist/components/combobox/option.d.ts +5 -1
- package/dist/components/combobox/option.js +35 -0
- package/dist/components/context-meter/context-meter.d.ts +53 -0
- package/dist/components/context-meter/context-meter.js +159 -0
- package/dist/components/context-meter/context-meter.styles.d.ts +1 -0
- package/dist/components/context-meter/context-meter.styles.js +114 -0
- package/dist/components/conversation-item/conversation-item.d.ts +125 -0
- package/dist/components/conversation-item/conversation-item.js +331 -0
- package/dist/components/conversation-item/conversation-item.styles.d.ts +1 -0
- package/dist/components/conversation-item/conversation-item.styles.js +155 -0
- package/dist/components/date-picker/calendar-core.d.ts +24 -0
- package/dist/components/date-picker/calendar-core.js +51 -4
- package/dist/components/date-picker/date-input.d.ts +100 -9
- package/dist/components/date-picker/date-input.js +383 -66
- package/dist/components/date-picker/date-picker.d.ts +35 -4
- package/dist/components/date-picker/date-picker.js +171 -44
- package/dist/components/dialog/confirm.d.ts +40 -0
- package/dist/components/dialog/confirm.js +76 -0
- package/dist/components/dialog/dialog.d.ts +129 -0
- package/dist/components/dialog/dialog.js +288 -0
- package/dist/components/dialog/dialog.styles.d.ts +1 -0
- package/dist/components/dialog/dialog.styles.js +96 -0
- package/dist/components/dock-panel/dock-panel.d.ts +142 -0
- package/dist/components/dock-panel/dock-panel.js +359 -0
- package/dist/components/dock-panel/dock-panel.styles.d.ts +1 -0
- package/dist/components/dock-panel/dock-panel.styles.js +159 -0
- package/dist/components/document-preview/document-preview.d.ts +143 -0
- package/dist/components/document-preview/document-preview.js +388 -0
- package/dist/components/document-preview/document-preview.styles.d.ts +1 -0
- package/dist/components/document-preview/document-preview.styles.js +191 -0
- package/dist/components/empty/empty.d.ts +1 -2
- package/dist/components/empty/empty.js +18 -12
- package/dist/components/empty/empty.styles.js +0 -3
- package/dist/components/export-button/csv.js +1 -1
- package/dist/components/export-button/export-button.d.ts +12 -0
- package/dist/components/export-button/export-button.js +35 -5
- package/dist/components/export-button/export-button.styles.js +5 -1
- package/dist/components/file-input/accept.js +2 -0
- package/dist/components/file-input/file-input.d.ts +10 -1
- package/dist/components/file-input/file-input.js +36 -5
- package/dist/components/flag/flag.d.ts +29 -13
- package/dist/components/flag/flag.js +54 -14
- package/dist/components/flag/flag.styles.js +1 -1
- package/dist/components/flag/language-map.d.ts +4 -1
- package/dist/components/flag/language-map.js +6 -3
- package/dist/components/gauge/gauge.d.ts +10 -1
- package/dist/components/gauge/gauge.js +41 -13
- package/dist/components/generation-status/generation-status.d.ts +117 -0
- package/dist/components/generation-status/generation-status.js +327 -0
- package/dist/components/generation-status/generation-status.styles.d.ts +1 -0
- package/dist/components/generation-status/generation-status.styles.js +84 -0
- package/dist/components/graph/graph.d.ts +37 -3
- package/dist/components/graph/graph.js +132 -20
- package/dist/components/heatmap/calendar-grid.d.ts +19 -7
- package/dist/components/heatmap/calendar-grid.js +42 -18
- package/dist/components/heatmap/heatmap-scale.d.ts +11 -1
- package/dist/components/heatmap/heatmap-scale.js +14 -2
- package/dist/components/heatmap/heatmap.d.ts +227 -12
- package/dist/components/heatmap/heatmap.js +488 -93
- package/dist/components/json-viewer/json-viewer.d.ts +70 -0
- package/dist/components/json-viewer/json-viewer.js +361 -0
- package/dist/components/json-viewer/json-viewer.styles.d.ts +1 -0
- package/dist/components/json-viewer/json-viewer.styles.js +177 -0
- package/dist/components/kbd/kbd.d.ts +77 -0
- package/dist/components/kbd/kbd.js +231 -0
- package/dist/components/kbd/kbd.styles.d.ts +1 -0
- package/dist/components/kbd/kbd.styles.js +52 -0
- package/dist/components/live-region/live-region.d.ts +90 -0
- package/dist/components/live-region/live-region.js +189 -0
- package/dist/components/live-region/live-region.styles.d.ts +1 -0
- package/dist/components/live-region/live-region.styles.js +10 -0
- package/dist/components/map/map.d.ts +32 -7
- package/dist/components/map/map.js +133 -32
- package/dist/components/markdown/markdown-loader.d.ts +58 -0
- package/dist/components/markdown/markdown-loader.js +77 -0
- package/dist/components/markdown/markdown.d.ts +119 -0
- package/dist/components/markdown/markdown.js +389 -0
- package/dist/components/markdown/markdown.styles.d.ts +1 -0
- package/dist/components/markdown/markdown.styles.js +88 -0
- package/dist/components/media-card/media-card.d.ts +130 -0
- package/dist/components/media-card/media-card.js +273 -0
- package/dist/components/media-card/media-card.styles.d.ts +1 -0
- package/dist/components/media-card/media-card.styles.js +132 -0
- package/dist/components/mention-popover/mention-popover.d.ts +203 -0
- package/dist/components/mention-popover/mention-popover.js +493 -0
- package/dist/components/mention-popover/mention-popover.styles.d.ts +1 -0
- package/dist/components/mention-popover/mention-popover.styles.js +101 -0
- package/dist/components/menu/menu-item.d.ts +91 -0
- package/dist/components/menu/menu-item.js +206 -0
- package/dist/components/menu/menu-item.styles.d.ts +1 -0
- package/dist/components/menu/menu-item.styles.js +75 -0
- package/dist/components/menu/menu.d.ts +167 -0
- package/dist/components/menu/menu.js +461 -0
- package/dist/components/menu/menu.styles.d.ts +1 -0
- package/dist/components/menu/menu.styles.js +67 -0
- package/dist/components/model-select/model-select.d.ts +170 -0
- package/dist/components/model-select/model-select.js +588 -0
- package/dist/components/model-select/model-select.styles.d.ts +1 -0
- package/dist/components/model-select/model-select.styles.js +203 -0
- package/dist/components/model-settings-panel/model-settings-panel.d.ts +93 -0
- package/dist/components/model-settings-panel/model-settings-panel.js +209 -0
- package/dist/components/model-settings-panel/model-settings-panel.styles.d.ts +1 -0
- package/dist/components/model-settings-panel/model-settings-panel.styles.js +82 -0
- package/dist/components/playback/playback.d.ts +19 -3
- package/dist/components/playback/playback.js +109 -33
- package/dist/components/playback/playback.styles.js +6 -1
- package/dist/components/responsive-panel/responsive-panel.d.ts +163 -0
- package/dist/components/responsive-panel/responsive-panel.js +363 -0
- package/dist/components/responsive-panel/responsive-panel.styles.d.ts +1 -0
- package/dist/components/responsive-panel/responsive-panel.styles.js +103 -0
- package/dist/components/result-card/result-card.d.ts +50 -0
- package/dist/components/result-card/result-card.js +89 -0
- package/dist/components/result-card/result-card.styles.d.ts +1 -0
- package/dist/components/result-card/result-card.styles.js +49 -0
- package/dist/components/result-card/result-field.d.ts +36 -0
- package/dist/components/result-card/result-field.js +87 -0
- package/dist/components/result-card/result-field.styles.d.ts +1 -0
- package/dist/components/result-card/result-field.styles.js +32 -0
- package/dist/components/select/select.d.ts +84 -4
- package/dist/components/select/select.js +251 -36
- package/dist/components/skeleton/skeleton.d.ts +3 -0
- package/dist/components/skeleton/skeleton.js +7 -1
- package/dist/components/skeleton/skeleton.styles.js +5 -4
- package/dist/components/slider/slider.d.ts +141 -0
- package/dist/components/slider/slider.js +467 -0
- package/dist/components/slider/slider.styles.d.ts +1 -0
- package/dist/components/slider/slider.styles.js +87 -0
- package/dist/components/source-card/source-card.d.ts +104 -0
- package/dist/components/source-card/source-card.js +195 -0
- package/dist/components/source-card/source-card.styles.d.ts +1 -0
- package/dist/components/source-card/source-card.styles.js +69 -0
- package/dist/components/source-list/source-list.d.ts +63 -0
- package/dist/components/source-list/source-list.js +130 -0
- package/dist/components/source-list/source-list.styles.d.ts +1 -0
- package/dist/components/source-list/source-list.styles.js +59 -0
- package/dist/components/sparkline/sparkline.js +58 -20
- package/dist/components/split/split.d.ts +224 -5
- package/dist/components/split/split.js +617 -43
- package/dist/components/split/split.styles.js +47 -0
- package/dist/components/stat/stat.d.ts +15 -4
- package/dist/components/stat/stat.js +53 -12
- package/dist/components/stream-status/stream-status.d.ts +126 -0
- package/dist/components/stream-status/stream-status.js +292 -0
- package/dist/components/stream-status/stream-status.styles.d.ts +1 -0
- package/dist/components/stream-status/stream-status.styles.js +103 -0
- package/dist/components/streaming-text/streaming-text.d.ts +104 -0
- package/dist/components/streaming-text/streaming-text.js +224 -0
- package/dist/components/streaming-text/streaming-text.styles.d.ts +1 -0
- package/dist/components/streaming-text/streaming-text.styles.js +63 -0
- package/dist/components/switch/switch.d.ts +103 -0
- package/dist/components/switch/switch.js +250 -0
- package/dist/components/switch/switch.styles.d.ts +1 -0
- package/dist/components/switch/switch.styles.js +75 -0
- package/dist/components/table/table.d.ts +89 -5
- package/dist/components/table/table.js +243 -26
- package/dist/components/table/table.styles.js +6 -1
- package/dist/components/tabs/tabs.d.ts +74 -0
- package/dist/components/tabs/tabs.js +254 -0
- package/dist/components/tabs/tabs.styles.d.ts +1 -0
- package/dist/components/tabs/tabs.styles.js +74 -0
- package/dist/components/thinking-panel/thinking-panel.d.ts +123 -0
- package/dist/components/thinking-panel/thinking-panel.js +260 -0
- package/dist/components/thinking-panel/thinking-panel.styles.d.ts +1 -0
- package/dist/components/thinking-panel/thinking-panel.styles.js +123 -0
- package/dist/components/time-range/time-range.d.ts +59 -2
- package/dist/components/time-range/time-range.js +163 -67
- package/dist/components/toast/toast-item.d.ts +12 -2
- package/dist/components/toast/toast-item.js +106 -44
- package/dist/components/toast/toast-item.styles.js +59 -28
- package/dist/components/toast/toast.js +17 -5
- package/dist/components/toast/toaster.js +10 -1
- package/dist/components/tool-approval-dialog/tool-approval-dialog.d.ts +131 -0
- package/dist/components/tool-approval-dialog/tool-approval-dialog.js +329 -0
- package/dist/components/tool-approval-dialog/tool-approval-dialog.styles.d.ts +1 -0
- package/dist/components/tool-approval-dialog/tool-approval-dialog.styles.js +160 -0
- package/dist/components/tool-call-chip/tool-call-chip.d.ts +105 -0
- package/dist/components/tool-call-chip/tool-call-chip.js +349 -0
- package/dist/components/tool-call-chip/tool-call-chip.styles.d.ts +1 -0
- package/dist/components/tool-call-chip/tool-call-chip.styles.js +203 -0
- package/dist/components/tool-param-form/tool-param-form.d.ts +206 -0
- package/dist/components/tool-param-form/tool-param-form.js +610 -0
- package/dist/components/tool-param-form/tool-param-form.styles.d.ts +1 -0
- package/dist/components/tool-param-form/tool-param-form.styles.js +75 -0
- package/dist/components/tool-result-dialog/tool-result-dialog.d.ts +122 -0
- package/dist/components/tool-result-dialog/tool-result-dialog.js +358 -0
- package/dist/components/tool-result-dialog/tool-result-dialog.styles.d.ts +1 -0
- package/dist/components/tool-result-dialog/tool-result-dialog.styles.js +176 -0
- package/dist/components/tool-result-view/registry.d.ts +73 -0
- package/dist/components/tool-result-view/registry.js +89 -0
- package/dist/components/tool-result-view/tool-result-view.d.ts +58 -0
- package/dist/components/tool-result-view/tool-result-view.js +152 -0
- package/dist/components/tool-result-view/tool-result-view.styles.d.ts +1 -0
- package/dist/components/tool-result-view/tool-result-view.styles.js +13 -0
- package/dist/components/tool-select-dialog/tool-select-dialog.d.ts +151 -0
- package/dist/components/tool-select-dialog/tool-select-dialog.js +350 -0
- package/dist/components/tool-select-dialog/tool-select-dialog.styles.d.ts +1 -0
- package/dist/components/tool-select-dialog/tool-select-dialog.styles.js +191 -0
- package/dist/components/tree/tree-node.d.ts +15 -3
- package/dist/components/tree/tree-node.js +20 -7
- package/dist/components/tree/tree.d.ts +25 -10
- package/dist/components/tree/tree.js +39 -31
- package/dist/components/typing-indicator/typing-indicator.d.ts +70 -0
- package/dist/components/typing-indicator/typing-indicator.js +108 -0
- package/dist/components/typing-indicator/typing-indicator.styles.d.ts +1 -0
- package/dist/components/typing-indicator/typing-indicator.styles.js +132 -0
- package/dist/components/virtual-list/virtual-list.d.ts +210 -0
- package/dist/components/virtual-list/virtual-list.js +607 -0
- package/dist/components/virtual-list/virtual-list.styles.d.ts +1 -0
- package/dist/components/virtual-list/virtual-list.styles.js +56 -0
- package/dist/components/widget/widget.d.ts +5 -4
- package/dist/components/widget/widget.js +54 -120
- package/dist/components/widget/widget.styles.js +8 -2
- package/dist/components/word-cloud/word-cloud-layout.d.ts +7 -0
- package/dist/components/word-cloud/word-cloud-layout.js +29 -2
- package/dist/components/word-cloud/word-cloud.d.ts +28 -2
- package/dist/components/word-cloud/word-cloud.js +69 -19
- package/dist/components/word-cloud/word-cloud.styles.js +16 -3
- package/dist/internal/anchored-validity.d.ts +1 -0
- package/dist/internal/anchored-validity.js +86 -0
- package/dist/internal/announcer.d.ts +57 -0
- package/dist/internal/announcer.js +71 -0
- package/dist/internal/form-associated.d.ts +8 -0
- package/dist/internal/form-associated.js +98 -15
- package/dist/internal/group-by-recency.d.ts +50 -0
- package/dist/internal/group-by-recency.js +80 -0
- package/dist/internal/numbers.d.ts +12 -0
- package/dist/internal/numbers.js +26 -0
- package/dist/internal/overlay-manager.d.ts +51 -0
- package/dist/internal/overlay-manager.js +523 -0
- package/dist/internal/positioner.js +27 -3
- package/dist/internal/rtl.d.ts +23 -0
- package/dist/internal/rtl.js +28 -0
- package/dist/internal/safe-url.d.ts +12 -0
- package/dist/internal/safe-url.js +41 -0
- package/dist/internal/scroll-lock.d.ts +10 -5
- package/dist/internal/scroll-lock.js +30 -14
- package/dist/internal/tokens.styles.js +22 -10
- package/dist/lyra.d.ts +133 -31
- package/dist/lyra.js +96 -26
- package/llms-full.txt +4546 -183
- package/llms.txt +21 -5
- package/package.json +41 -6
- package/dist/components/chart/bar-chart.stories.d.ts +0 -5
- package/dist/components/chart/bar-chart.stories.js +0 -20
- package/dist/components/chart/box-plot.stories.d.ts +0 -5
- package/dist/components/chart/box-plot.stories.js +0 -29
- package/dist/components/chart/bubble-chart.stories.d.ts +0 -5
- package/dist/components/chart/bubble-chart.stories.js +0 -26
- package/dist/components/chart/chart.stories.d.ts +0 -32
- package/dist/components/chart/chart.stories.js +0 -141
- package/dist/components/chart/doughnut-chart.stories.d.ts +0 -5
- package/dist/components/chart/doughnut-chart.stories.js +0 -26
- package/dist/components/chart/histogram.stories.d.ts +0 -5
- package/dist/components/chart/histogram.stories.js +0 -17
- package/dist/components/chart/line-chart.stories.d.ts +0 -22
- package/dist/components/chart/line-chart.stories.js +0 -99
- package/dist/components/chart/lite-chart.stories.d.ts +0 -14
- package/dist/components/chart/lite-chart.stories.js +0 -114
- package/dist/components/chart/pie-chart.stories.d.ts +0 -5
- package/dist/components/chart/pie-chart.stories.js +0 -26
- package/dist/components/chart/polar-area-chart.stories.d.ts +0 -5
- package/dist/components/chart/polar-area-chart.stories.js +0 -20
- package/dist/components/chart/radar-chart.stories.d.ts +0 -5
- package/dist/components/chart/radar-chart.stories.js +0 -20
- package/dist/components/chart/scatter-chart.stories.d.ts +0 -5
- package/dist/components/chart/scatter-chart.stories.js +0 -31
- package/dist/components/combobox/combobox.stories.d.ts +0 -24
- package/dist/components/combobox/combobox.stories.js +0 -102
- package/dist/components/date-picker/date-input.stories.d.ts +0 -10
- package/dist/components/date-picker/date-input.stories.js +0 -48
- package/dist/components/date-picker/date-picker.stories.d.ts +0 -10
- package/dist/components/date-picker/date-picker.stories.js +0 -25
- package/dist/components/empty/empty.stories.d.ts +0 -7
- package/dist/components/empty/empty.stories.js +0 -34
- package/dist/components/export-button/export-button.stories.d.ts +0 -7
- package/dist/components/export-button/export-button.stories.js +0 -37
- package/dist/components/file-input/file-input.stories.d.ts +0 -7
- package/dist/components/file-input/file-input.stories.js +0 -19
- package/dist/components/flag/flag.stories.d.ts +0 -6
- package/dist/components/flag/flag.stories.js +0 -31
- package/dist/components/gauge/gauge.stories.d.ts +0 -8
- package/dist/components/gauge/gauge.stories.js +0 -19
- package/dist/components/graph/graph.stories.d.ts +0 -8
- package/dist/components/graph/graph.stories.js +0 -68
- package/dist/components/heatmap/heatmap.stories.d.ts +0 -27
- package/dist/components/heatmap/heatmap.stories.js +0 -179
- package/dist/components/map/map.stories.d.ts +0 -15
- package/dist/components/map/map.stories.js +0 -135
- package/dist/components/playback/playback.stories.d.ts +0 -7
- package/dist/components/playback/playback.stories.js +0 -16
- package/dist/components/select/select.stories.d.ts +0 -21
- package/dist/components/select/select.stories.js +0 -91
- package/dist/components/skeleton/skeleton.stories.d.ts +0 -5
- package/dist/components/skeleton/skeleton.stories.js +0 -16
- package/dist/components/sparkline/sparkline.stories.d.ts +0 -11
- package/dist/components/sparkline/sparkline.stories.js +0 -39
- package/dist/components/split/split.stories.d.ts +0 -7
- package/dist/components/split/split.stories.js +0 -36
- package/dist/components/stat/stat.stories.d.ts +0 -9
- package/dist/components/stat/stat.stories.js +0 -81
- package/dist/components/table/table.stories.d.ts +0 -12
- package/dist/components/table/table.stories.js +0 -67
- package/dist/components/time-range/time-range.stories.d.ts +0 -8
- package/dist/components/time-range/time-range.stories.js +0 -26
- package/dist/components/toast/toast.stories.d.ts +0 -8
- package/dist/components/toast/toast.stories.js +0 -72
- package/dist/components/tree/tree.stories.d.ts +0 -9
- package/dist/components/tree/tree.stories.js +0 -52
- package/dist/components/widget/widget.stories.d.ts +0 -9
- package/dist/components/widget/widget.stories.js +0 -74
- package/dist/components/word-cloud/word-cloud.stories.d.ts +0 -10
- package/dist/components/word-cloud/word-cloud.stories.js +0 -55
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: var(--lyra-space-s);
|
|
7
|
+
inline-size: 100%;
|
|
8
|
+
}
|
|
9
|
+
[part='base'] {
|
|
10
|
+
position: relative;
|
|
11
|
+
flex: 1 1 auto;
|
|
12
|
+
block-size: 1.5rem;
|
|
13
|
+
}
|
|
14
|
+
[part='track'] {
|
|
15
|
+
position: absolute;
|
|
16
|
+
inset-inline: 0;
|
|
17
|
+
inset-block-start: 50%;
|
|
18
|
+
block-size: 4px;
|
|
19
|
+
transform: translateY(-50%);
|
|
20
|
+
border-radius: 2px;
|
|
21
|
+
background: var(--lyra-color-border);
|
|
22
|
+
}
|
|
23
|
+
[part='fill'] {
|
|
24
|
+
position: absolute;
|
|
25
|
+
inset-inline-start: 0;
|
|
26
|
+
inset-block-start: 50%;
|
|
27
|
+
block-size: 4px;
|
|
28
|
+
transform: translateY(-50%);
|
|
29
|
+
border-radius: 2px;
|
|
30
|
+
background: var(--lyra-color-brand);
|
|
31
|
+
}
|
|
32
|
+
[part='thumb'] {
|
|
33
|
+
position: absolute;
|
|
34
|
+
inset-block-start: 50%;
|
|
35
|
+
inline-size: 16px;
|
|
36
|
+
block-size: 16px;
|
|
37
|
+
border-radius: 50%;
|
|
38
|
+
background: var(--lyra-color-brand);
|
|
39
|
+
border: 2px solid var(--lyra-color-surface);
|
|
40
|
+
box-shadow: var(--lyra-shadow);
|
|
41
|
+
transform: translate(-50%, -50%);
|
|
42
|
+
cursor: grab;
|
|
43
|
+
touch-action: none;
|
|
44
|
+
}
|
|
45
|
+
/* The visible dot is 16px, under the ~24px touch-target minimum. Widen the
|
|
46
|
+
hit/drag area with a transparent ::before instead of growing the thumb
|
|
47
|
+
itself — onPointerMove never reads the thumb's own
|
|
48
|
+
getBoundingClientRect() (only [part="track"]'s rect and e.clientX), and a
|
|
49
|
+
pointerdown inside the ::before still reports e.target as the thumb
|
|
50
|
+
element (pseudo-elements have no separate DOM node/event target), so
|
|
51
|
+
this is purely additive and cannot change the drag math. Mirrors
|
|
52
|
+
lyra-time-range's identical handle::before. */
|
|
53
|
+
[part='thumb']::before {
|
|
54
|
+
content: '';
|
|
55
|
+
position: absolute;
|
|
56
|
+
inset-block-start: 50%;
|
|
57
|
+
inset-inline-start: 50%;
|
|
58
|
+
inline-size: 28px;
|
|
59
|
+
block-size: 28px;
|
|
60
|
+
transform: translate(-50%, -50%);
|
|
61
|
+
border-radius: 50%;
|
|
62
|
+
}
|
|
63
|
+
[part='thumb']:focus-visible {
|
|
64
|
+
outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
|
|
65
|
+
outline-offset: var(--lyra-focus-ring-offset);
|
|
66
|
+
}
|
|
67
|
+
[part='thumb']:active {
|
|
68
|
+
cursor: grabbing;
|
|
69
|
+
}
|
|
70
|
+
[part='value'] {
|
|
71
|
+
flex: 0 0 auto;
|
|
72
|
+
font-size: 0.8125rem;
|
|
73
|
+
color: var(--lyra-color-text-quiet);
|
|
74
|
+
/* Numeric readout ticks as the thumb moves; tabular-nums keeps its own
|
|
75
|
+
inline-size stable instead of jittering the layout next to it. */
|
|
76
|
+
font-variant-numeric: tabular-nums;
|
|
77
|
+
min-inline-size: 2.5ch;
|
|
78
|
+
text-align: end;
|
|
79
|
+
}
|
|
80
|
+
:host([disabled]) {
|
|
81
|
+
opacity: var(--lyra-opacity-disabled);
|
|
82
|
+
cursor: not-allowed;
|
|
83
|
+
}
|
|
84
|
+
:host([disabled]) [part='thumb'] {
|
|
85
|
+
cursor: not-allowed;
|
|
86
|
+
}
|
|
87
|
+
`;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
2
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
3
|
+
export interface SourceCardExpandDetail {
|
|
4
|
+
sourceId: string;
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SourceCardOpenDetail {
|
|
8
|
+
sourceId: string;
|
|
9
|
+
href?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* `<lyra-source-card>` — one citation/source entry, meant to be a direct
|
|
13
|
+
* light-DOM child of `<lyra-source-list>` (though it renders and functions
|
|
14
|
+
* fine standalone). Shows a title/page heading, an always-visible `excerpt`
|
|
15
|
+
* slot, and an optional `full` slot revealed behind its own independent
|
|
16
|
+
* "Show more" toggle — unrelated to the parent `<lyra-source-list>`'s own
|
|
17
|
+
* expand/collapse, which only ever hides/shows the *set* of cards, never a
|
|
18
|
+
* single card's own content.
|
|
19
|
+
*
|
|
20
|
+
* `source-id` is this card's stable identity, meant to match a
|
|
21
|
+
* `<lyra-citation-badge>` (a sibling component) elsewhere on the page. This
|
|
22
|
+
* component doesn't implement any scroll-to/highlight behavior itself — that
|
|
23
|
+
* lives at the app level, wiring a citation badge's activation event to this
|
|
24
|
+
* card's `id`/`source-id`. See the `@example` below.
|
|
25
|
+
*
|
|
26
|
+
* @customElement lyra-source-card
|
|
27
|
+
* @slot excerpt - A short preview. When left empty, the `excerpt` part
|
|
28
|
+
* collapses away entirely rather than leaving an empty gap in the card.
|
|
29
|
+
* @slot full - The complete source text/chunk, hidden behind the "Show
|
|
30
|
+
* more"/"Show less" toggle. When left empty, no toggle renders at all — a
|
|
31
|
+
* card with no `full` content simply has no expand affordance. Removing all
|
|
32
|
+
* `full`-slotted content while expanded automatically collapses it back.
|
|
33
|
+
* @event lyra-expand - The per-card "Show more"/"Show less" toggle was
|
|
34
|
+
* activated. `detail: { sourceId, expanded }`.
|
|
35
|
+
* @event lyra-open - The title was activated. `detail: { sourceId, href }` —
|
|
36
|
+
* `href` may be `undefined`. This component never navigates on its own
|
|
37
|
+
* (staying a controlled component, the same convention
|
|
38
|
+
* `<lyra-tool-call-chip>`'s `lyra-tool-chip-select` follows); a listener
|
|
39
|
+
* decides what "open" means (open `href` in a new tab, open an in-app
|
|
40
|
+
* viewer, etc).
|
|
41
|
+
* @csspart base - The outer container.
|
|
42
|
+
* @csspart title - The clickable title/page heading (`<button>`).
|
|
43
|
+
* @csspart excerpt - The wrapper around the `excerpt` slot, `hidden` when the slot has no assigned content.
|
|
44
|
+
* @csspart full - The wrapper around the `full` slot, `hidden` while collapsed.
|
|
45
|
+
* @csspart toggle - The "Show more"/"Show less" button. Only rendered when the `full` slot has content.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```html
|
|
49
|
+
* <lyra-source-list label-plural="2 sources">
|
|
50
|
+
* <lyra-source-card source-id="doc-1" title="annual_report.pdf" page="12">
|
|
51
|
+
* <span slot="excerpt">Revenue grew 12% year over year...</span>
|
|
52
|
+
* <span slot="full">Revenue grew 12% year over year, driven primarily by...</span>
|
|
53
|
+
* </lyra-source-card>
|
|
54
|
+
* </lyra-source-list>
|
|
55
|
+
* ```
|
|
56
|
+
* ```js
|
|
57
|
+
* // Elsewhere, a <lyra-citation-badge>'s activation handler can scroll to
|
|
58
|
+
* // and highlight the matching card -- this component needs no extra API
|
|
59
|
+
* // surface for that, only its existing source-id to be targeted by:
|
|
60
|
+
* document.addEventListener('lyra-citation-activate', (e) => {
|
|
61
|
+
* const card = document.querySelector(`lyra-source-card[source-id="${e.detail.sourceId}"]`);
|
|
62
|
+
* card?.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
63
|
+
* card?.classList.add('is-highlighted'); // consumer-defined CSS, e.g. a brief background flash
|
|
64
|
+
* setTimeout(() => card?.classList.remove('is-highlighted'), 2000);
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare class LyraSourceCard extends LyraElement {
|
|
69
|
+
static styles: import("lit").CSSResultGroup[];
|
|
70
|
+
/** Stable identifier matching a `<lyra-citation-badge>` elsewhere on the page. */
|
|
71
|
+
sourceId: string;
|
|
72
|
+
/** The source's display title, e.g. a filename. Rendered only as the
|
|
73
|
+
* title button's own text -- a bare host-level `title` attribute (the
|
|
74
|
+
* browser's global tooltip attribute) is actively stripped once Lit has
|
|
75
|
+
* synced it into this property, so the card never grows an unsolicited
|
|
76
|
+
* native tooltip repeating the same text. See `attributeChangedCallback`
|
|
77
|
+
* and `updated` below. */
|
|
78
|
+
title: string;
|
|
79
|
+
/** Optional page reference, e.g. `12` or `"iv"` — rendered as-is (never
|
|
80
|
+
* parsed/validated as a number), so a non-numeric page label works too. */
|
|
81
|
+
page?: string | number;
|
|
82
|
+
/** Optional URL, echoed back (unopened) in `lyra-open`'s detail. */
|
|
83
|
+
href?: string;
|
|
84
|
+
private hasFullSlot;
|
|
85
|
+
private hasExcerptSlot;
|
|
86
|
+
private fullExpanded;
|
|
87
|
+
private readonly fullId;
|
|
88
|
+
private stripHostTitleAttr;
|
|
89
|
+
protected willUpdate(): void;
|
|
90
|
+
firstUpdated(): void;
|
|
91
|
+
attributeChangedCallback(name: string, old: string | null, value: string | null): void;
|
|
92
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
93
|
+
private onFullSlotChange;
|
|
94
|
+
private onExcerptSlotChange;
|
|
95
|
+
private get titleText();
|
|
96
|
+
private onTitleClick;
|
|
97
|
+
private toggleFull;
|
|
98
|
+
render(): TemplateResult;
|
|
99
|
+
}
|
|
100
|
+
declare global {
|
|
101
|
+
interface HTMLElementTagNameMap {
|
|
102
|
+
'lyra-source-card': LyraSourceCard;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, nothing } from 'lit';
|
|
8
|
+
import { property, state } from 'lit/decorators.js';
|
|
9
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
10
|
+
import { defineElement } from '../../internal/prefix.js';
|
|
11
|
+
import { nextId } from '../../internal/a11y.js';
|
|
12
|
+
import { styles } from './source-card.styles.js';
|
|
13
|
+
/**
|
|
14
|
+
* `<lyra-source-card>` — one citation/source entry, meant to be a direct
|
|
15
|
+
* light-DOM child of `<lyra-source-list>` (though it renders and functions
|
|
16
|
+
* fine standalone). Shows a title/page heading, an always-visible `excerpt`
|
|
17
|
+
* slot, and an optional `full` slot revealed behind its own independent
|
|
18
|
+
* "Show more" toggle — unrelated to the parent `<lyra-source-list>`'s own
|
|
19
|
+
* expand/collapse, which only ever hides/shows the *set* of cards, never a
|
|
20
|
+
* single card's own content.
|
|
21
|
+
*
|
|
22
|
+
* `source-id` is this card's stable identity, meant to match a
|
|
23
|
+
* `<lyra-citation-badge>` (a sibling component) elsewhere on the page. This
|
|
24
|
+
* component doesn't implement any scroll-to/highlight behavior itself — that
|
|
25
|
+
* lives at the app level, wiring a citation badge's activation event to this
|
|
26
|
+
* card's `id`/`source-id`. See the `@example` below.
|
|
27
|
+
*
|
|
28
|
+
* @customElement lyra-source-card
|
|
29
|
+
* @slot excerpt - A short preview. When left empty, the `excerpt` part
|
|
30
|
+
* collapses away entirely rather than leaving an empty gap in the card.
|
|
31
|
+
* @slot full - The complete source text/chunk, hidden behind the "Show
|
|
32
|
+
* more"/"Show less" toggle. When left empty, no toggle renders at all — a
|
|
33
|
+
* card with no `full` content simply has no expand affordance. Removing all
|
|
34
|
+
* `full`-slotted content while expanded automatically collapses it back.
|
|
35
|
+
* @event lyra-expand - The per-card "Show more"/"Show less" toggle was
|
|
36
|
+
* activated. `detail: { sourceId, expanded }`.
|
|
37
|
+
* @event lyra-open - The title was activated. `detail: { sourceId, href }` —
|
|
38
|
+
* `href` may be `undefined`. This component never navigates on its own
|
|
39
|
+
* (staying a controlled component, the same convention
|
|
40
|
+
* `<lyra-tool-call-chip>`'s `lyra-tool-chip-select` follows); a listener
|
|
41
|
+
* decides what "open" means (open `href` in a new tab, open an in-app
|
|
42
|
+
* viewer, etc).
|
|
43
|
+
* @csspart base - The outer container.
|
|
44
|
+
* @csspart title - The clickable title/page heading (`<button>`).
|
|
45
|
+
* @csspart excerpt - The wrapper around the `excerpt` slot, `hidden` when the slot has no assigned content.
|
|
46
|
+
* @csspart full - The wrapper around the `full` slot, `hidden` while collapsed.
|
|
47
|
+
* @csspart toggle - The "Show more"/"Show less" button. Only rendered when the `full` slot has content.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```html
|
|
51
|
+
* <lyra-source-list label-plural="2 sources">
|
|
52
|
+
* <lyra-source-card source-id="doc-1" title="annual_report.pdf" page="12">
|
|
53
|
+
* <span slot="excerpt">Revenue grew 12% year over year...</span>
|
|
54
|
+
* <span slot="full">Revenue grew 12% year over year, driven primarily by...</span>
|
|
55
|
+
* </lyra-source-card>
|
|
56
|
+
* </lyra-source-list>
|
|
57
|
+
* ```
|
|
58
|
+
* ```js
|
|
59
|
+
* // Elsewhere, a <lyra-citation-badge>'s activation handler can scroll to
|
|
60
|
+
* // and highlight the matching card -- this component needs no extra API
|
|
61
|
+
* // surface for that, only its existing source-id to be targeted by:
|
|
62
|
+
* document.addEventListener('lyra-citation-activate', (e) => {
|
|
63
|
+
* const card = document.querySelector(`lyra-source-card[source-id="${e.detail.sourceId}"]`);
|
|
64
|
+
* card?.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
65
|
+
* card?.classList.add('is-highlighted'); // consumer-defined CSS, e.g. a brief background flash
|
|
66
|
+
* setTimeout(() => card?.classList.remove('is-highlighted'), 2000);
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export class LyraSourceCard extends LyraElement {
|
|
71
|
+
constructor() {
|
|
72
|
+
super(...arguments);
|
|
73
|
+
/** Stable identifier matching a `<lyra-citation-badge>` elsewhere on the page. */
|
|
74
|
+
this.sourceId = '';
|
|
75
|
+
/** The source's display title, e.g. a filename. Rendered only as the
|
|
76
|
+
* title button's own text -- a bare host-level `title` attribute (the
|
|
77
|
+
* browser's global tooltip attribute) is actively stripped once Lit has
|
|
78
|
+
* synced it into this property, so the card never grows an unsolicited
|
|
79
|
+
* native tooltip repeating the same text. See `attributeChangedCallback`
|
|
80
|
+
* and `updated` below. */
|
|
81
|
+
this.title = '';
|
|
82
|
+
// See `<lyra-widget>`'s `hasActionsSlot` for the identical
|
|
83
|
+
// presence-tracking convention -- a `[part]` always contains a literal
|
|
84
|
+
// `<slot>` child regardless of assigned content, so CSS `:empty` never
|
|
85
|
+
// matches; real emptiness is tracked in JS instead.
|
|
86
|
+
this.hasFullSlot = false;
|
|
87
|
+
this.hasExcerptSlot = false;
|
|
88
|
+
this.fullExpanded = false;
|
|
89
|
+
this.fullId = nextId('source-card-full');
|
|
90
|
+
// Guards the `removeAttribute('title')` call in `updated()` below: removing
|
|
91
|
+
// an observed attribute fires `attributeChangedCallback` synchronously just
|
|
92
|
+
// like setting one does, and without this flag Lit would treat the removal
|
|
93
|
+
// as a fresh (empty) attribute value and reset the `title` property right
|
|
94
|
+
// back to `null`, losing the value it just finished syncing in.
|
|
95
|
+
this.stripHostTitleAttr = false;
|
|
96
|
+
this.onFullSlotChange = (e) => {
|
|
97
|
+
const count = e.target.assignedElements({ flatten: true }).length;
|
|
98
|
+
this.hasFullSlot = count > 0;
|
|
99
|
+
if (count === 0)
|
|
100
|
+
this.fullExpanded = false;
|
|
101
|
+
};
|
|
102
|
+
this.onExcerptSlotChange = (e) => {
|
|
103
|
+
this.hasExcerptSlot = e.target.assignedElements({ flatten: true }).length > 0;
|
|
104
|
+
};
|
|
105
|
+
this.onTitleClick = () => {
|
|
106
|
+
this.emit('lyra-open', { sourceId: this.sourceId, href: this.href });
|
|
107
|
+
};
|
|
108
|
+
this.toggleFull = () => {
|
|
109
|
+
this.fullExpanded = !this.fullExpanded;
|
|
110
|
+
this.emit('lyra-expand', { sourceId: this.sourceId, expanded: this.fullExpanded });
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
static { this.styles = [LyraElement.styles, styles]; }
|
|
114
|
+
willUpdate() {
|
|
115
|
+
if (!this.hasUpdated) {
|
|
116
|
+
this.hasFullSlot = Array.from(this.children).some((el) => el.getAttribute('slot') === 'full');
|
|
117
|
+
this.hasExcerptSlot = Array.from(this.children).some((el) => el.getAttribute('slot') === 'excerpt');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
firstUpdated() {
|
|
121
|
+
const fullSlot = this.shadowRoot.querySelector('slot[name="full"]');
|
|
122
|
+
const fullCount = fullSlot.assignedElements({ flatten: true }).length;
|
|
123
|
+
this.hasFullSlot = fullCount > 0;
|
|
124
|
+
if (fullCount === 0)
|
|
125
|
+
this.fullExpanded = false;
|
|
126
|
+
const excerptSlot = this.shadowRoot.querySelector('slot[name="excerpt"]');
|
|
127
|
+
this.hasExcerptSlot = excerptSlot.assignedElements({ flatten: true }).length > 0;
|
|
128
|
+
}
|
|
129
|
+
attributeChangedCallback(name, old, value) {
|
|
130
|
+
if (name === 'title' && this.stripHostTitleAttr)
|
|
131
|
+
return;
|
|
132
|
+
super.attributeChangedCallback(name, old, value);
|
|
133
|
+
}
|
|
134
|
+
updated(changed) {
|
|
135
|
+
if (changed.has('title') && this.hasAttribute('title')) {
|
|
136
|
+
// The attribute has already been converted into the `title` property
|
|
137
|
+
// by this point (that's how it got here), so the DOM attribute itself
|
|
138
|
+
// is now redundant -- and, left in place, would make the whole card
|
|
139
|
+
// show a native tooltip repeating the title text on hover.
|
|
140
|
+
this.stripHostTitleAttr = true;
|
|
141
|
+
this.removeAttribute('title');
|
|
142
|
+
this.stripHostTitleAttr = false;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
get titleText() {
|
|
146
|
+
const base = this.title || 'Untitled source';
|
|
147
|
+
return this.page == null || this.page === '' ? base : `${base} — p. ${this.page}`;
|
|
148
|
+
}
|
|
149
|
+
render() {
|
|
150
|
+
return html `
|
|
151
|
+
<div part="base">
|
|
152
|
+
<button part="title" type="button" @click=${this.onTitleClick}>${this.titleText}</button>
|
|
153
|
+
<div part="excerpt" ?hidden=${!this.hasExcerptSlot}>
|
|
154
|
+
<slot name="excerpt" @slotchange=${this.onExcerptSlotChange}></slot>
|
|
155
|
+
</div>
|
|
156
|
+
${this.hasFullSlot
|
|
157
|
+
? html `<button
|
|
158
|
+
part="toggle"
|
|
159
|
+
type="button"
|
|
160
|
+
aria-expanded=${this.fullExpanded ? 'true' : 'false'}
|
|
161
|
+
aria-controls=${this.fullId}
|
|
162
|
+
@click=${this.toggleFull}
|
|
163
|
+
>
|
|
164
|
+
${this.fullExpanded ? 'Show less' : 'Show more'}
|
|
165
|
+
</button>`
|
|
166
|
+
: nothing}
|
|
167
|
+
<div part="full" id=${this.fullId} ?hidden=${!this.fullExpanded}>
|
|
168
|
+
<slot name="full" @slotchange=${this.onFullSlotChange}></slot>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
`;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
__decorate([
|
|
175
|
+
property({ attribute: 'source-id' })
|
|
176
|
+
], LyraSourceCard.prototype, "sourceId", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
property()
|
|
179
|
+
], LyraSourceCard.prototype, "title", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
property()
|
|
182
|
+
], LyraSourceCard.prototype, "page", void 0);
|
|
183
|
+
__decorate([
|
|
184
|
+
property()
|
|
185
|
+
], LyraSourceCard.prototype, "href", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
state()
|
|
188
|
+
], LyraSourceCard.prototype, "hasFullSlot", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
state()
|
|
191
|
+
], LyraSourceCard.prototype, "hasExcerptSlot", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
state()
|
|
194
|
+
], LyraSourceCard.prototype, "fullExpanded", void 0);
|
|
195
|
+
defineElement('source-card', LyraSourceCard);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
[part='base'] {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: var(--lyra-space-xs);
|
|
10
|
+
padding: var(--lyra-space-s);
|
|
11
|
+
border: 1px solid var(--lyra-color-border);
|
|
12
|
+
border-radius: var(--lyra-radius);
|
|
13
|
+
background: var(--lyra-color-surface);
|
|
14
|
+
}
|
|
15
|
+
[part='title'] {
|
|
16
|
+
align-self: flex-start;
|
|
17
|
+
border: none;
|
|
18
|
+
background: none;
|
|
19
|
+
padding: 0;
|
|
20
|
+
margin: 0;
|
|
21
|
+
color: var(--lyra-color-brand);
|
|
22
|
+
font: inherit;
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
font-size: 0.875rem;
|
|
25
|
+
text-align: start;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
[part='title']:hover {
|
|
29
|
+
text-decoration: underline;
|
|
30
|
+
}
|
|
31
|
+
[part='title']:focus-visible,
|
|
32
|
+
[part='toggle']:focus-visible {
|
|
33
|
+
outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
|
|
34
|
+
outline-offset: var(--lyra-focus-ring-offset);
|
|
35
|
+
}
|
|
36
|
+
[part='excerpt'] {
|
|
37
|
+
color: var(--lyra-color-text-quiet);
|
|
38
|
+
font-size: 0.8125rem;
|
|
39
|
+
line-height: 1.4;
|
|
40
|
+
}
|
|
41
|
+
[part='excerpt'][hidden] {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
[part='toggle'] {
|
|
45
|
+
align-self: flex-start;
|
|
46
|
+
border: none;
|
|
47
|
+
background: none;
|
|
48
|
+
padding: 0;
|
|
49
|
+
margin: 0;
|
|
50
|
+
color: var(--lyra-color-brand);
|
|
51
|
+
font: inherit;
|
|
52
|
+
font-size: 0.75rem;
|
|
53
|
+
font-weight: 600;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
}
|
|
56
|
+
[part='toggle']:hover {
|
|
57
|
+
text-decoration: underline;
|
|
58
|
+
}
|
|
59
|
+
[part='full'] {
|
|
60
|
+
padding-block-start: var(--lyra-space-xs);
|
|
61
|
+
border-block-start: 1px solid var(--lyra-color-border);
|
|
62
|
+
color: var(--lyra-color-text);
|
|
63
|
+
font-size: 0.8125rem;
|
|
64
|
+
line-height: 1.4;
|
|
65
|
+
}
|
|
66
|
+
[part='full'][hidden] {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
3
|
+
export interface SourceListToggleDetail {
|
|
4
|
+
expanded: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* `<lyra-source-list>` — a collapsible "Sources" panel for one chat message,
|
|
8
|
+
* grouping a set of `<lyra-source-card>` children (its default-slot light-DOM
|
|
9
|
+
* children, plain composition — no `.items` array prop, the same shape
|
|
10
|
+
* `<lyra-split>`'s panels take) behind a single clickable header.
|
|
11
|
+
*
|
|
12
|
+
* This library has no built-in i18n/pluralization (see `<lyra-empty>`'s plain
|
|
13
|
+
* `description` prop for the same stance), so the header text is entirely
|
|
14
|
+
* consumer-supplied: `label-plural` (e.g. `"3 sources"`) wins when set,
|
|
15
|
+
* falling back to `label`, falling back to the literal word `"Sources"` — see
|
|
16
|
+
* each property's own doc. `sourceCount` (a read-only, live-updated count of
|
|
17
|
+
* the currently-slotted children) is exposed for a consumer who wants to
|
|
18
|
+
* build that string reactively instead of hand-counting DOM children.
|
|
19
|
+
*
|
|
20
|
+
* The card list is removed from the accessibility tree (not just visually
|
|
21
|
+
* hidden) while collapsed, via the native `hidden` attribute on
|
|
22
|
+
* `[part="list"]` — a screen reader user tabbing past the header never lands
|
|
23
|
+
* on off-screen source cards they can't currently see.
|
|
24
|
+
*
|
|
25
|
+
* @customElement lyra-source-list
|
|
26
|
+
* @slot - `<lyra-source-card>` elements (or any content, though the card
|
|
27
|
+
* pairing is the intended usage).
|
|
28
|
+
* @event lyra-toggle - The header was activated, expanding or collapsing the
|
|
29
|
+
* list. `detail: { expanded }`.
|
|
30
|
+
* @csspart base - The outer container.
|
|
31
|
+
* @csspart header - The clickable header (`<button>`) toggling `expanded`.
|
|
32
|
+
* @csspart toggle - The chevron indicator inside the header.
|
|
33
|
+
* @csspart list - The wrapper around the default slot, `hidden` while collapsed.
|
|
34
|
+
*/
|
|
35
|
+
export declare class LyraSourceList extends LyraElement {
|
|
36
|
+
static styles: import("lit").CSSResultGroup[];
|
|
37
|
+
/** Whether the card list is currently shown. Starts collapsed by default
|
|
38
|
+
* so a message's sources don't eat vertical space until asked for. */
|
|
39
|
+
expanded: boolean;
|
|
40
|
+
/** Header text used when `label-plural` isn't set, e.g. `"Sources"`. */
|
|
41
|
+
label: string;
|
|
42
|
+
/** Fully consumer-built, already-pluralized header summary, e.g. `"3 sources"`
|
|
43
|
+
* or `"1 source"` — this component never counts or pluralizes on its own
|
|
44
|
+
* (see the class doc). Takes precedence over `label` when both are set. */
|
|
45
|
+
labelPlural: string;
|
|
46
|
+
private slottedCount;
|
|
47
|
+
private readonly listId;
|
|
48
|
+
protected willUpdate(): void;
|
|
49
|
+
firstUpdated(): void;
|
|
50
|
+
/** Read-only, live-updated count of the currently-slotted children —
|
|
51
|
+
* handy for building a `label-plural` string that stays in sync with
|
|
52
|
+
* what's actually slotted without hand-counting DOM children, e.g.
|
|
53
|
+
* `list.labelPlural = \`${list.sourceCount} sources\`;`. */
|
|
54
|
+
get sourceCount(): number;
|
|
55
|
+
private onSlotChange;
|
|
56
|
+
private toggle;
|
|
57
|
+
render(): TemplateResult;
|
|
58
|
+
}
|
|
59
|
+
declare global {
|
|
60
|
+
interface HTMLElementTagNameMap {
|
|
61
|
+
'lyra-source-list': LyraSourceList;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
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, state } from 'lit/decorators.js';
|
|
9
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
10
|
+
import { defineElement } from '../../internal/prefix.js';
|
|
11
|
+
import { nextId } from '../../internal/a11y.js';
|
|
12
|
+
import { chevronIcon } from '../../internal/icons.js';
|
|
13
|
+
import { styles } from './source-list.styles.js';
|
|
14
|
+
/**
|
|
15
|
+
* `<lyra-source-list>` — a collapsible "Sources" panel for one chat message,
|
|
16
|
+
* grouping a set of `<lyra-source-card>` children (its default-slot light-DOM
|
|
17
|
+
* children, plain composition — no `.items` array prop, the same shape
|
|
18
|
+
* `<lyra-split>`'s panels take) behind a single clickable header.
|
|
19
|
+
*
|
|
20
|
+
* This library has no built-in i18n/pluralization (see `<lyra-empty>`'s plain
|
|
21
|
+
* `description` prop for the same stance), so the header text is entirely
|
|
22
|
+
* consumer-supplied: `label-plural` (e.g. `"3 sources"`) wins when set,
|
|
23
|
+
* falling back to `label`, falling back to the literal word `"Sources"` — see
|
|
24
|
+
* each property's own doc. `sourceCount` (a read-only, live-updated count of
|
|
25
|
+
* the currently-slotted children) is exposed for a consumer who wants to
|
|
26
|
+
* build that string reactively instead of hand-counting DOM children.
|
|
27
|
+
*
|
|
28
|
+
* The card list is removed from the accessibility tree (not just visually
|
|
29
|
+
* hidden) while collapsed, via the native `hidden` attribute on
|
|
30
|
+
* `[part="list"]` — a screen reader user tabbing past the header never lands
|
|
31
|
+
* on off-screen source cards they can't currently see.
|
|
32
|
+
*
|
|
33
|
+
* @customElement lyra-source-list
|
|
34
|
+
* @slot - `<lyra-source-card>` elements (or any content, though the card
|
|
35
|
+
* pairing is the intended usage).
|
|
36
|
+
* @event lyra-toggle - The header was activated, expanding or collapsing the
|
|
37
|
+
* list. `detail: { expanded }`.
|
|
38
|
+
* @csspart base - The outer container.
|
|
39
|
+
* @csspart header - The clickable header (`<button>`) toggling `expanded`.
|
|
40
|
+
* @csspart toggle - The chevron indicator inside the header.
|
|
41
|
+
* @csspart list - The wrapper around the default slot, `hidden` while collapsed.
|
|
42
|
+
*/
|
|
43
|
+
export class LyraSourceList extends LyraElement {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
46
|
+
/** Whether the card list is currently shown. Starts collapsed by default
|
|
47
|
+
* so a message's sources don't eat vertical space until asked for. */
|
|
48
|
+
this.expanded = false;
|
|
49
|
+
/** Header text used when `label-plural` isn't set, e.g. `"Sources"`. */
|
|
50
|
+
this.label = '';
|
|
51
|
+
/** Fully consumer-built, already-pluralized header summary, e.g. `"3 sources"`
|
|
52
|
+
* or `"1 source"` — this component never counts or pluralizes on its own
|
|
53
|
+
* (see the class doc). Takes precedence over `label` when both are set. */
|
|
54
|
+
this.labelPlural = '';
|
|
55
|
+
// Tracks the default slot's assigned-element count purely for the
|
|
56
|
+
// `sourceCount` convenience getter below -- unlike `<lyra-split>`'s
|
|
57
|
+
// `panelCount` this never drives layout math, so it's plain @state rather
|
|
58
|
+
// than something read back out of `updated()`.
|
|
59
|
+
this.slottedCount = 0;
|
|
60
|
+
this.listId = nextId('source-list-region');
|
|
61
|
+
this.onSlotChange = (e) => {
|
|
62
|
+
this.slottedCount = e.target.assignedElements({ flatten: true }).length;
|
|
63
|
+
};
|
|
64
|
+
this.toggle = () => {
|
|
65
|
+
this.expanded = !this.expanded;
|
|
66
|
+
this.emit('lyra-toggle', { expanded: this.expanded });
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
static { this.styles = [LyraElement.styles, styles]; }
|
|
70
|
+
willUpdate() {
|
|
71
|
+
if (!this.hasUpdated) {
|
|
72
|
+
// Must count only children assigned to the *default* slot -- same rule
|
|
73
|
+
// `firstUpdated`/`onSlotChange` apply via `assignedElements()` below --
|
|
74
|
+
// otherwise a direct child carrying a foreign `slot` attribute makes
|
|
75
|
+
// this pre-count disagree with the authoritative one, which schedules
|
|
76
|
+
// a wasted second update (and Lit's dev-mode change-in-update warning).
|
|
77
|
+
// An explicit `slot=""` still assigns to the default slot per the HTML
|
|
78
|
+
// slot algorithm, so check the attribute's value rather than its mere
|
|
79
|
+
// presence.
|
|
80
|
+
this.slottedCount = Array.from(this.children).filter((el) => !el.getAttribute('slot')).length;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
firstUpdated() {
|
|
84
|
+
// Fallback reconciliation for slot-forwarding / engines that don't fire
|
|
85
|
+
// `slotchange` for content present at parse time -- same idiom as
|
|
86
|
+
// `<lyra-empty>`'s `firstUpdated`.
|
|
87
|
+
const slot = this.shadowRoot.querySelector('slot');
|
|
88
|
+
this.slottedCount = slot.assignedElements({ flatten: true }).length;
|
|
89
|
+
}
|
|
90
|
+
/** Read-only, live-updated count of the currently-slotted children —
|
|
91
|
+
* handy for building a `label-plural` string that stays in sync with
|
|
92
|
+
* what's actually slotted without hand-counting DOM children, e.g.
|
|
93
|
+
* `list.labelPlural = \`${list.sourceCount} sources\`;`. */
|
|
94
|
+
get sourceCount() {
|
|
95
|
+
return this.slottedCount;
|
|
96
|
+
}
|
|
97
|
+
render() {
|
|
98
|
+
const headerText = this.labelPlural || this.label || 'Sources';
|
|
99
|
+
return html `
|
|
100
|
+
<div part="base">
|
|
101
|
+
<button
|
|
102
|
+
part="header"
|
|
103
|
+
type="button"
|
|
104
|
+
aria-expanded=${this.expanded ? 'true' : 'false'}
|
|
105
|
+
aria-controls=${this.listId}
|
|
106
|
+
@click=${this.toggle}
|
|
107
|
+
>
|
|
108
|
+
<span part="toggle" aria-hidden="true">${chevronIcon()}</span>
|
|
109
|
+
<span>${headerText}</span>
|
|
110
|
+
</button>
|
|
111
|
+
<div part="list" id=${this.listId} ?hidden=${!this.expanded}>
|
|
112
|
+
<slot @slotchange=${this.onSlotChange}></slot>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
__decorate([
|
|
119
|
+
property({ type: Boolean, reflect: true })
|
|
120
|
+
], LyraSourceList.prototype, "expanded", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
property()
|
|
123
|
+
], LyraSourceList.prototype, "label", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
property({ attribute: 'label-plural' })
|
|
126
|
+
], LyraSourceList.prototype, "labelPlural", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
state()
|
|
129
|
+
], LyraSourceList.prototype, "slottedCount", void 0);
|
|
130
|
+
defineElement('source-list', LyraSourceList);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|