@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,350 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, nothing } from 'lit';
|
|
8
|
+
import { property, state } from 'lit/decorators.js';
|
|
9
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
10
|
+
import { activateOverlay } from '../../internal/overlay-manager.js';
|
|
11
|
+
import { defineElement } from '../../internal/prefix.js';
|
|
12
|
+
import { lockScroll } from '../../internal/scroll-lock.js';
|
|
13
|
+
import { nextId, srOnly } from '../../internal/a11y.js';
|
|
14
|
+
import { styles } from './tool-select-dialog.styles.js';
|
|
15
|
+
import '../checkbox/checkbox.js';
|
|
16
|
+
import '../switch/switch.js';
|
|
17
|
+
const OTHER_CATEGORY = 'Other';
|
|
18
|
+
/** Default `filter`: case-insensitive substring match against the tool's name and description. */
|
|
19
|
+
function defaultFilter(tool, query) {
|
|
20
|
+
return tool.name.toLowerCase().includes(query) || (tool.description ?? '').toLowerCase().includes(query);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* `<lyra-tool-select-dialog>` — a category-grouped, filterable, searchable
|
|
24
|
+
* tool-enablement dialog for picking which agent tools are available in a
|
|
25
|
+
* conversation.
|
|
26
|
+
*
|
|
27
|
+
* This renders its own dialog panel rather than nesting a `<lyra-dialog>` in
|
|
28
|
+
* its shadow template. Shared overlay infrastructure coordinates stacking,
|
|
29
|
+
* focus trapping, Escape/backdrop dismissal, and focus return with every
|
|
30
|
+
* other overlay in the same document.
|
|
31
|
+
*
|
|
32
|
+
* `useDefaults` is a single top-level switch: while `true`, every per-tool
|
|
33
|
+
* checkbox below renders disabled (still reflecting whatever `selected`
|
|
34
|
+
* holds — a consumer should populate that with its own default tool set
|
|
35
|
+
* whenever `useDefaults` is true) and a hint explains that turning the
|
|
36
|
+
* switch off is how to customize. Turning it off is the "customize"
|
|
37
|
+
* affordance — it's the only thing that both flips `useDefaults` to `false`
|
|
38
|
+
* *and* unlocks the per-tool checkboxes for editing, so there's exactly one
|
|
39
|
+
* control for that transition rather than a separate button duplicating it.
|
|
40
|
+
*
|
|
41
|
+
* There is no built-in footer/close button — like `<lyra-dialog>`, dismissal
|
|
42
|
+
* happens via Escape, a backdrop click, or a consumer's own `footer`-slotted
|
|
43
|
+
* action calling `close()`. This also means the search input is the very
|
|
44
|
+
* first focusable element in the panel with no special-casing needed, so
|
|
45
|
+
* it's what receives focus on open (see `updated()`).
|
|
46
|
+
*
|
|
47
|
+
* @customElement lyra-tool-select-dialog
|
|
48
|
+
* @slot footer - Optional action buttons (e.g. a "Done" button), rendered in a bottom row.
|
|
49
|
+
* Changes already apply live via `lyra-change`, so this is optional.
|
|
50
|
+
* @event lyra-change - The enabled-tool selection or the `useDefaults` toggle changed.
|
|
51
|
+
* `detail: { selected: string[], useDefaults: boolean }`.
|
|
52
|
+
* @event lyra-close - `detail: ToolSelectDialogCloseReason`. Fired exactly once per dismissal,
|
|
53
|
+
* via Escape, a backdrop click, or a `close()` call.
|
|
54
|
+
* @csspart backdrop - The full-viewport scrim behind the panel.
|
|
55
|
+
* @csspart panel - The dialog panel itself (`role="dialog"` while open).
|
|
56
|
+
* @csspart header - The wrapper around the title/subtitle.
|
|
57
|
+
* @csspart title - The dialog's heading.
|
|
58
|
+
* @csspart subtitle - The "N of M tools enabled" summary line.
|
|
59
|
+
* @csspart search-row - The wrapper around the search input.
|
|
60
|
+
* @csspart search-input - The filter text input.
|
|
61
|
+
* @csspart defaults-row - The wrapper around the use-defaults switch and its hint.
|
|
62
|
+
* @csspart defaults-toggle - The built-in `<lyra-switch>` bound to `useDefaults`.
|
|
63
|
+
* @csspart defaults-hint - The "turn off to customize" hint, shown only while `useDefaults` is true.
|
|
64
|
+
* @csspart body - The scrollable wrapper around the grouped tool list.
|
|
65
|
+
* @csspart empty - The "no tools" / "no matches" message.
|
|
66
|
+
* @csspart category - A single category's wrapper (`role="group"`).
|
|
67
|
+
* @csspart category-heading - A category's heading.
|
|
68
|
+
* @csspart category-count - The terse, `aria-hidden` tool count next to a category heading
|
|
69
|
+
* (the heading's accessible name gets the full sentence from an sr-only sibling instead).
|
|
70
|
+
* @csspart category-list - The `<ul>` of tool rows within a category.
|
|
71
|
+
* @csspart tool-row - A single tool's `<li>` row.
|
|
72
|
+
* @csspart tool-checkbox - A row's `<lyra-checkbox>`.
|
|
73
|
+
* @csspart tool-name - A row's name text (plus its `icon`, if set).
|
|
74
|
+
* @csspart tool-icon - A row's leading icon glyph, when `icon` is set.
|
|
75
|
+
* @csspart tool-description - A row's optional description text.
|
|
76
|
+
* @csspart tool-disabled-reason - A disabled row's `disabledReason` text, slotted inside
|
|
77
|
+
* `tool-checkbox` (alongside `tool-name`/`tool-description`) so it contributes to the
|
|
78
|
+
* checkbox's accessible name/description instead of going unannounced.
|
|
79
|
+
* @csspart footer - The wrapper around the `footer` slot.
|
|
80
|
+
*/
|
|
81
|
+
export class LyraToolSelectDialog extends LyraElement {
|
|
82
|
+
constructor() {
|
|
83
|
+
super(...arguments);
|
|
84
|
+
/** Whether the dialog is open. Set this (or call `close()`) — there is no separate `show()`/`hide()` pair. */
|
|
85
|
+
this.open = false;
|
|
86
|
+
/** The full set of tools a consumer offers, across all categories. */
|
|
87
|
+
this.tools = [];
|
|
88
|
+
/** The currently-enabled tool ids. */
|
|
89
|
+
this.selected = [];
|
|
90
|
+
/** Whether the conversation is using the default tool set (`true`) or a custom selection (`false`) — see the class doc for the exact interaction with `selected`/per-tool editing. */
|
|
91
|
+
this.useDefaults = false;
|
|
92
|
+
/** The dialog's visible heading and accessible name. */
|
|
93
|
+
this.label = 'Select tools';
|
|
94
|
+
this.searchPlaceholder = 'Search tools…';
|
|
95
|
+
/** Overrides the built-in case-insensitive name/description substring match. */
|
|
96
|
+
this.filter = null;
|
|
97
|
+
this.query = '';
|
|
98
|
+
this.hasFooterSlot = false;
|
|
99
|
+
this.titleId = nextId('tool-select-dialog-title');
|
|
100
|
+
// Stable per-category heading ids, keyed by category name -- generated
|
|
101
|
+
// once (not regenerated every render/keystroke) so a category's
|
|
102
|
+
// aria-labelledby target keeps the same id across re-renders.
|
|
103
|
+
this.categoryIds = new Map();
|
|
104
|
+
this.onFooterSlotChange = (e) => {
|
|
105
|
+
this.hasFooterSlot = e.target.assignedElements({ flatten: true }).length > 0;
|
|
106
|
+
};
|
|
107
|
+
this.onBackdropClick = () => {
|
|
108
|
+
this.overlay?.dismissBackdrop();
|
|
109
|
+
};
|
|
110
|
+
this.onSearchInput = (e) => {
|
|
111
|
+
this.query = e.target.value;
|
|
112
|
+
};
|
|
113
|
+
this.onDefaultsToggle = (e) => {
|
|
114
|
+
this.useDefaults = e.detail.checked;
|
|
115
|
+
this.emitChange();
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
static { this.styles = [LyraElement.styles, styles, srOnly]; }
|
|
119
|
+
willUpdate(changed) {
|
|
120
|
+
if (!this.hasUpdated) {
|
|
121
|
+
this.hasFooterSlot = Array.from(this.children).some((el) => el.getAttribute('slot') === 'footer');
|
|
122
|
+
}
|
|
123
|
+
if (changed.has('open')) {
|
|
124
|
+
if (this.open) {
|
|
125
|
+
this.releaseScrollLock ??= lockScroll(this.ownerDocument);
|
|
126
|
+
this.activateOverlay();
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
this.releaseScrollLock?.();
|
|
130
|
+
this.releaseScrollLock = undefined;
|
|
131
|
+
this.overlay?.deactivate();
|
|
132
|
+
this.overlay = undefined;
|
|
133
|
+
// Otherwise a long-lived instance reopens still showing whatever
|
|
134
|
+
// search filter/collapsed-category state the previous session left
|
|
135
|
+
// behind, rather than the fresh, unfiltered list a reopen implies.
|
|
136
|
+
this.query = '';
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// Runs after render (not willUpdate) so [part="panel"] and its contents
|
|
141
|
+
// have already landed in the DOM before the focus call below can rely on
|
|
142
|
+
// them -- mirrors lyra-dialog's/lyra-tool-result-dialog's identical
|
|
143
|
+
// ordering rationale.
|
|
144
|
+
updated(changed) {
|
|
145
|
+
if (changed.has('open') && this.open) {
|
|
146
|
+
this.overlay?.focusInitial();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
connectedCallback() {
|
|
150
|
+
super.connectedCallback();
|
|
151
|
+
if (this.hasUpdated && this.open) {
|
|
152
|
+
this.releaseScrollLock ??= lockScroll(this.ownerDocument);
|
|
153
|
+
this.activateOverlay();
|
|
154
|
+
queueMicrotask(() => this.overlay?.focusInitial());
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
disconnectedCallback() {
|
|
158
|
+
super.disconnectedCallback();
|
|
159
|
+
this.releaseScrollLock?.();
|
|
160
|
+
this.releaseScrollLock = undefined;
|
|
161
|
+
this.overlay?.suspend();
|
|
162
|
+
}
|
|
163
|
+
activateOverlay() {
|
|
164
|
+
if (this.overlay?.isActive()) {
|
|
165
|
+
this.overlay.resume();
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
this.overlay = activateOverlay({
|
|
169
|
+
host: this,
|
|
170
|
+
panel: () => this.shadowRoot?.querySelector('[part="panel"]') ?? null,
|
|
171
|
+
onEscape: () => this.close('escape'),
|
|
172
|
+
onBackdrop: () => this.close('backdrop'),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Close the dialog and return focus to whatever had it before the dialog
|
|
177
|
+
* opened. `reason` is forwarded as the `lyra-close` detail — built-in
|
|
178
|
+
* triggers pass `'escape'`/`'backdrop'`; a consumer's own close affordance
|
|
179
|
+
* (e.g. a footer Done button) should call this directly with its own
|
|
180
|
+
* reason string, so every dismissal path funnels through the same event
|
|
181
|
+
* instead of the consumer having to also toggle `open` itself.
|
|
182
|
+
*/
|
|
183
|
+
close(reason = 'api') {
|
|
184
|
+
if (!this.open)
|
|
185
|
+
return;
|
|
186
|
+
this.open = false;
|
|
187
|
+
this.emit('lyra-close', reason);
|
|
188
|
+
}
|
|
189
|
+
emitChange() {
|
|
190
|
+
this.emit('lyra-change', {
|
|
191
|
+
selected: [...this.selected],
|
|
192
|
+
useDefaults: this.useDefaults,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
onToolToggle(tool, e) {
|
|
196
|
+
const set = new Set(this.selected);
|
|
197
|
+
e.detail.checked ? set.add(tool.id) : set.delete(tool.id);
|
|
198
|
+
this.selected = [...set];
|
|
199
|
+
this.emitChange();
|
|
200
|
+
}
|
|
201
|
+
categoryId(category) {
|
|
202
|
+
let id = this.categoryIds.get(category);
|
|
203
|
+
if (!id) {
|
|
204
|
+
id = nextId('tool-select-dialog-category');
|
|
205
|
+
this.categoryIds.set(category, id);
|
|
206
|
+
}
|
|
207
|
+
return id;
|
|
208
|
+
}
|
|
209
|
+
/** Tools grouped by `category` (first-seen order), with an uncategorized
|
|
210
|
+
* bucket always last, then filtered by the active search query -- a
|
|
211
|
+
* category left with zero matches is dropped entirely rather than
|
|
212
|
+
* rendered as an empty heading. */
|
|
213
|
+
get groups() {
|
|
214
|
+
const order = [];
|
|
215
|
+
const byCategory = new Map();
|
|
216
|
+
for (const tool of this.tools) {
|
|
217
|
+
const category = tool.category?.trim() || OTHER_CATEGORY;
|
|
218
|
+
let bucket = byCategory.get(category);
|
|
219
|
+
if (!bucket) {
|
|
220
|
+
bucket = [];
|
|
221
|
+
byCategory.set(category, bucket);
|
|
222
|
+
if (category !== OTHER_CATEGORY)
|
|
223
|
+
order.push(category);
|
|
224
|
+
}
|
|
225
|
+
bucket.push(tool);
|
|
226
|
+
}
|
|
227
|
+
if (byCategory.has(OTHER_CATEGORY))
|
|
228
|
+
order.push(OTHER_CATEGORY);
|
|
229
|
+
const q = this.query.trim().toLowerCase();
|
|
230
|
+
const matches = q ? (tool) => (this.filter ?? defaultFilter)(tool, q) : () => true;
|
|
231
|
+
return order
|
|
232
|
+
.map((category) => ({ category, tools: byCategory.get(category).filter(matches) }))
|
|
233
|
+
.filter((group) => group.tools.length > 0);
|
|
234
|
+
}
|
|
235
|
+
renderTool(tool) {
|
|
236
|
+
const rowDisabled = Boolean(tool.disabled) || this.useDefaults;
|
|
237
|
+
return html `
|
|
238
|
+
<li part="tool-row" ?data-disabled=${rowDisabled}>
|
|
239
|
+
<lyra-checkbox
|
|
240
|
+
part="tool-checkbox"
|
|
241
|
+
value=${tool.id}
|
|
242
|
+
?checked=${this.selected.includes(tool.id)}
|
|
243
|
+
?disabled=${rowDisabled}
|
|
244
|
+
@lyra-change=${(e) => this.onToolToggle(tool, e)}
|
|
245
|
+
>
|
|
246
|
+
<span part="tool-name">
|
|
247
|
+
${tool.icon ? html `<span part="tool-icon" aria-hidden="true">${tool.icon}</span>` : nothing}${tool.name}
|
|
248
|
+
</span>
|
|
249
|
+
${tool.description ? html `<span part="tool-description">${tool.description}</span>` : nothing}
|
|
250
|
+
${tool.disabled && tool.disabledReason
|
|
251
|
+
? html `<span part="tool-disabled-reason">${tool.disabledReason}</span>`
|
|
252
|
+
: nothing}
|
|
253
|
+
</lyra-checkbox>
|
|
254
|
+
</li>
|
|
255
|
+
`;
|
|
256
|
+
}
|
|
257
|
+
renderCategory(group) {
|
|
258
|
+
const headingId = this.categoryId(group.category);
|
|
259
|
+
return html `
|
|
260
|
+
<div part="category" role="group" aria-labelledby=${headingId}>
|
|
261
|
+
<h3 part="category-heading" id=${headingId}>
|
|
262
|
+
${group.category}<span part="category-count" aria-hidden="true">${group.tools.length}</span
|
|
263
|
+
><span class="sr-only">${group.tools.length} tool${group.tools.length === 1 ? '' : 's'}</span>
|
|
264
|
+
</h3>
|
|
265
|
+
<ul part="category-list">
|
|
266
|
+
${group.tools.map((tool) => this.renderTool(tool))}
|
|
267
|
+
</ul>
|
|
268
|
+
</div>
|
|
269
|
+
`;
|
|
270
|
+
}
|
|
271
|
+
render() {
|
|
272
|
+
const groups = this.groups;
|
|
273
|
+
const hasTools = this.tools.length > 0;
|
|
274
|
+
return html `
|
|
275
|
+
<div part="backdrop" @click=${this.onBackdropClick}></div>
|
|
276
|
+
<div
|
|
277
|
+
part="panel"
|
|
278
|
+
role=${this.open ? 'dialog' : nothing}
|
|
279
|
+
aria-modal=${this.open ? 'true' : nothing}
|
|
280
|
+
aria-labelledby=${this.titleId}
|
|
281
|
+
tabindex="-1"
|
|
282
|
+
>
|
|
283
|
+
<div part="header">
|
|
284
|
+
<h2 part="title" id=${this.titleId}>${this.label}</h2>
|
|
285
|
+
<p part="subtitle" ?hidden=${!hasTools}>${this.selected.length} of ${this.tools.length} tools enabled</p>
|
|
286
|
+
</div>
|
|
287
|
+
<div part="search-row">
|
|
288
|
+
<input
|
|
289
|
+
part="search-input"
|
|
290
|
+
type="search"
|
|
291
|
+
.value=${this.query}
|
|
292
|
+
placeholder=${this.searchPlaceholder}
|
|
293
|
+
aria-label=${this.searchPlaceholder}
|
|
294
|
+
@input=${this.onSearchInput}
|
|
295
|
+
/>
|
|
296
|
+
</div>
|
|
297
|
+
<div part="defaults-row">
|
|
298
|
+
<lyra-switch
|
|
299
|
+
part="defaults-toggle"
|
|
300
|
+
?checked=${this.useDefaults}
|
|
301
|
+
@lyra-change=${this.onDefaultsToggle}
|
|
302
|
+
>
|
|
303
|
+
Use default tools
|
|
304
|
+
</lyra-switch>
|
|
305
|
+
${this.useDefaults
|
|
306
|
+
? html `<p part="defaults-hint">Turn off to choose individual tools.</p>`
|
|
307
|
+
: nothing}
|
|
308
|
+
</div>
|
|
309
|
+
<div part="body">
|
|
310
|
+
${groups.length === 0
|
|
311
|
+
? html `<p part="empty">
|
|
312
|
+
${hasTools ? html `No tools match "${this.query}".` : 'No tools available.'}
|
|
313
|
+
</p>`
|
|
314
|
+
: groups.map((group) => this.renderCategory(group))}
|
|
315
|
+
</div>
|
|
316
|
+
<div part="footer" ?hidden=${!this.hasFooterSlot}>
|
|
317
|
+
<slot name="footer" @slotchange=${this.onFooterSlotChange}></slot>
|
|
318
|
+
</div>
|
|
319
|
+
</div>
|
|
320
|
+
`;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
__decorate([
|
|
324
|
+
property({ type: Boolean, reflect: true })
|
|
325
|
+
], LyraToolSelectDialog.prototype, "open", void 0);
|
|
326
|
+
__decorate([
|
|
327
|
+
property({ attribute: false })
|
|
328
|
+
], LyraToolSelectDialog.prototype, "tools", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
property({ attribute: false })
|
|
331
|
+
], LyraToolSelectDialog.prototype, "selected", void 0);
|
|
332
|
+
__decorate([
|
|
333
|
+
property({ type: Boolean, reflect: true, attribute: 'use-defaults' })
|
|
334
|
+
], LyraToolSelectDialog.prototype, "useDefaults", void 0);
|
|
335
|
+
__decorate([
|
|
336
|
+
property()
|
|
337
|
+
], LyraToolSelectDialog.prototype, "label", void 0);
|
|
338
|
+
__decorate([
|
|
339
|
+
property({ attribute: 'search-placeholder' })
|
|
340
|
+
], LyraToolSelectDialog.prototype, "searchPlaceholder", void 0);
|
|
341
|
+
__decorate([
|
|
342
|
+
property({ attribute: false })
|
|
343
|
+
], LyraToolSelectDialog.prototype, "filter", void 0);
|
|
344
|
+
__decorate([
|
|
345
|
+
state()
|
|
346
|
+
], LyraToolSelectDialog.prototype, "query", void 0);
|
|
347
|
+
__decorate([
|
|
348
|
+
state()
|
|
349
|
+
], LyraToolSelectDialog.prototype, "hasFooterSlot", void 0);
|
|
350
|
+
defineElement('tool-select-dialog', LyraToolSelectDialog);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
/* Backdrop scrim color -- component-specific so a host can retheme it
|
|
5
|
+
without a raw literal leaking into the public API (no shared
|
|
6
|
+
--wa-*-overlay token exists in the design system to resolve through,
|
|
7
|
+
same rationale as lyra-dialog's --lyra-dialog-overlay-color and
|
|
8
|
+
lyra-tool-result-dialog's --lyra-tool-result-dialog-overlay-color). */
|
|
9
|
+
--lyra-tool-select-dialog-overlay-color: rgb(0 0 0 / 0.5);
|
|
10
|
+
display: none;
|
|
11
|
+
position: fixed;
|
|
12
|
+
inset: 0;
|
|
13
|
+
z-index: var(--lyra-overlay-stack-index, 1000);
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
padding: var(--lyra-space-l);
|
|
17
|
+
}
|
|
18
|
+
:host([open]) {
|
|
19
|
+
display: flex;
|
|
20
|
+
}
|
|
21
|
+
[part='backdrop'] {
|
|
22
|
+
position: absolute;
|
|
23
|
+
inset: 0;
|
|
24
|
+
background: var(--lyra-tool-select-dialog-overlay-color);
|
|
25
|
+
}
|
|
26
|
+
[part='panel'] {
|
|
27
|
+
position: relative;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
inline-size: min(30rem, 100%);
|
|
31
|
+
block-size: min(38rem, 100%);
|
|
32
|
+
background: var(--lyra-color-surface);
|
|
33
|
+
border: 1px solid var(--lyra-color-border);
|
|
34
|
+
border-radius: var(--lyra-radius);
|
|
35
|
+
box-shadow: var(--lyra-shadow);
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
}
|
|
38
|
+
[part='header'] {
|
|
39
|
+
padding: var(--lyra-space-l) var(--lyra-space-l) 0;
|
|
40
|
+
}
|
|
41
|
+
[part='title'] {
|
|
42
|
+
margin: 0;
|
|
43
|
+
font-size: 1rem;
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
}
|
|
46
|
+
[part='subtitle'] {
|
|
47
|
+
margin: var(--lyra-space-xs) 0 0;
|
|
48
|
+
font-size: 0.8125rem;
|
|
49
|
+
color: var(--lyra-color-text-quiet);
|
|
50
|
+
}
|
|
51
|
+
[part='subtitle'][hidden] {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[part='search-row'] {
|
|
56
|
+
padding: var(--lyra-space-m) var(--lyra-space-l) 0;
|
|
57
|
+
}
|
|
58
|
+
[part='search-input'] {
|
|
59
|
+
inline-size: 100%;
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
padding: var(--lyra-space-s) var(--lyra-space-m);
|
|
62
|
+
border: 1px solid var(--lyra-color-border);
|
|
63
|
+
border-radius: var(--lyra-radius);
|
|
64
|
+
background: var(--lyra-color-surface);
|
|
65
|
+
color: inherit;
|
|
66
|
+
font: inherit;
|
|
67
|
+
}
|
|
68
|
+
[part='search-input']:focus-visible {
|
|
69
|
+
outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
|
|
70
|
+
outline-offset: var(--lyra-focus-ring-offset);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
[part='defaults-row'] {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
gap: var(--lyra-space-xs);
|
|
77
|
+
padding: var(--lyra-space-m) var(--lyra-space-l);
|
|
78
|
+
border-block-end: 1px solid var(--lyra-color-border);
|
|
79
|
+
}
|
|
80
|
+
[part='defaults-hint'] {
|
|
81
|
+
margin: 0;
|
|
82
|
+
/* Lines the hint up under the switch's label text, not its track --
|
|
83
|
+
lyra-switch's own [part="base"] uses a fixed 2.25rem track
|
|
84
|
+
inline-size plus a --lyra-space-s gap before its label (both defined
|
|
85
|
+
in switch.styles.ts, not exposed as tokens), so this indent is
|
|
86
|
+
coupled to that fixed geometry rather than derived from an unrelated
|
|
87
|
+
component's token. */
|
|
88
|
+
padding-inline-start: calc(2.25rem + var(--lyra-space-s));
|
|
89
|
+
font-size: 0.75rem;
|
|
90
|
+
color: var(--lyra-color-text-quiet);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[part='body'] {
|
|
94
|
+
flex: 1 1 auto;
|
|
95
|
+
min-block-size: 0;
|
|
96
|
+
overflow: auto;
|
|
97
|
+
padding: var(--lyra-space-m) var(--lyra-space-l) var(--lyra-space-l);
|
|
98
|
+
}
|
|
99
|
+
[part='empty'] {
|
|
100
|
+
margin: 0;
|
|
101
|
+
padding: var(--lyra-space-l) 0;
|
|
102
|
+
color: var(--lyra-color-text-quiet);
|
|
103
|
+
font-size: 0.875rem;
|
|
104
|
+
text-align: center;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
[part='category'] {
|
|
108
|
+
margin-block-end: var(--lyra-space-l);
|
|
109
|
+
}
|
|
110
|
+
[part='category']:last-child {
|
|
111
|
+
margin-block-end: 0;
|
|
112
|
+
}
|
|
113
|
+
[part='category-heading'] {
|
|
114
|
+
display: flex;
|
|
115
|
+
align-items: baseline;
|
|
116
|
+
gap: var(--lyra-space-xs);
|
|
117
|
+
margin: 0 0 var(--lyra-space-s);
|
|
118
|
+
font-size: 0.75rem;
|
|
119
|
+
font-weight: 700;
|
|
120
|
+
text-transform: uppercase;
|
|
121
|
+
letter-spacing: 0.04em;
|
|
122
|
+
color: var(--lyra-color-text-quiet);
|
|
123
|
+
}
|
|
124
|
+
[part='category-count'] {
|
|
125
|
+
font-weight: 400;
|
|
126
|
+
text-transform: none;
|
|
127
|
+
letter-spacing: normal;
|
|
128
|
+
}
|
|
129
|
+
[part='category-list'] {
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
gap: var(--lyra-space-s);
|
|
133
|
+
margin: 0;
|
|
134
|
+
padding: 0;
|
|
135
|
+
list-style: none;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
[part='tool-row'] {
|
|
139
|
+
display: flex;
|
|
140
|
+
flex-direction: column;
|
|
141
|
+
gap: var(--lyra-space-xs);
|
|
142
|
+
}
|
|
143
|
+
[part='tool-row'][data-disabled] [part='tool-checkbox'] {
|
|
144
|
+
opacity: var(--lyra-opacity-disabled);
|
|
145
|
+
}
|
|
146
|
+
[part='tool-checkbox'] {
|
|
147
|
+
align-items: flex-start;
|
|
148
|
+
}
|
|
149
|
+
[part='tool-checkbox']::part(label) {
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
gap: 0.125rem;
|
|
153
|
+
}
|
|
154
|
+
[part='tool-name'] {
|
|
155
|
+
display: inline-flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
gap: var(--lyra-space-xs);
|
|
158
|
+
font-size: 0.875rem;
|
|
159
|
+
font-weight: 600;
|
|
160
|
+
color: var(--lyra-color-text);
|
|
161
|
+
}
|
|
162
|
+
[part='tool-icon'] {
|
|
163
|
+
line-height: 1;
|
|
164
|
+
}
|
|
165
|
+
[part='tool-description'] {
|
|
166
|
+
display: block;
|
|
167
|
+
font-size: 0.8125rem;
|
|
168
|
+
color: var(--lyra-color-text-quiet);
|
|
169
|
+
}
|
|
170
|
+
[part='tool-disabled-reason'] {
|
|
171
|
+
/* Slotted into lyra-checkbox's default slot alongside tool-name/
|
|
172
|
+
tool-description (see tool-select-dialog.ts's renderTool()), so it
|
|
173
|
+
inherits its indent for free from ::part(label)'s column layout
|
|
174
|
+
above instead of needing its own guessed padding. */
|
|
175
|
+
display: block;
|
|
176
|
+
font-size: 0.75rem;
|
|
177
|
+
color: var(--lyra-color-warning);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
[part='footer'] {
|
|
181
|
+
display: flex;
|
|
182
|
+
align-items: center;
|
|
183
|
+
justify-content: flex-end;
|
|
184
|
+
gap: var(--lyra-space-s);
|
|
185
|
+
padding: var(--lyra-space-m) var(--lyra-space-l);
|
|
186
|
+
border-block-start: 1px solid var(--lyra-color-border);
|
|
187
|
+
}
|
|
188
|
+
[part='footer'][hidden] {
|
|
189
|
+
display: none;
|
|
190
|
+
}
|
|
191
|
+
`;
|
|
@@ -14,8 +14,11 @@ import type { TreeItem } from './tree.js';
|
|
|
14
14
|
*
|
|
15
15
|
* @customElement lyra-tree-node
|
|
16
16
|
* @event lyra-node-toggle - `detail: { id, expanded }`, fired when this node is expanded or collapsed (via `expand()`/`collapse()`, the toggle button, or ArrowRight/ArrowLeft).
|
|
17
|
-
* @event lyra-node-select - `detail: { id }`, fired when this node's primary action is activated (via `select()`, clicking its
|
|
18
|
-
* @csspart row
|
|
17
|
+
* @event lyra-node-select - `detail: { id }`, fired when this node's primary action is activated (via `select()`, clicking anywhere in its row, or Enter/Space).
|
|
18
|
+
* @csspart row - The tree row.
|
|
19
|
+
* @csspart toggle - The expand/collapse button.
|
|
20
|
+
* @csspart label - The node label.
|
|
21
|
+
* @csspart badge - The optional node badge.
|
|
19
22
|
*/
|
|
20
23
|
export declare class LyraTreeNode extends LyraElement {
|
|
21
24
|
static styles: import("lit").CSSResultGroup[];
|
|
@@ -32,7 +35,16 @@ export declare class LyraTreeNode extends LyraElement {
|
|
|
32
35
|
expand(): void;
|
|
33
36
|
/** Collapse this node (no-op if already collapsed or a leaf). */
|
|
34
37
|
collapse(): void;
|
|
35
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Fire this item's primary "select" action (Enter/Space, or clicking
|
|
40
|
+
* anywhere in the row). Emits *before* calling `.focus()`: `<lyra-tree>`'s
|
|
41
|
+
* `onNodeActivate` listener for `lyra-node-select` runs synchronously
|
|
42
|
+
* (native `dispatchEvent` is sync) and updates `activeId`, which pushes
|
|
43
|
+
* `tabIndex = 0` down onto this node via its own render -- calling
|
|
44
|
+
* `.focus()` after that emit, rather than before, means real DOM focus
|
|
45
|
+
* lands correctly the very first time a previously-inactive node is
|
|
46
|
+
* clicked, not one render late.
|
|
47
|
+
*/
|
|
36
48
|
select(): void;
|
|
37
49
|
/** See `cascadeUpdateComplete` and the matching override on `<lyra-tree>`. */
|
|
38
50
|
protected getUpdateComplete(): Promise<boolean>;
|
|
@@ -8,7 +8,7 @@ import { html, nothing } from 'lit';
|
|
|
8
8
|
import { property } from 'lit/decorators.js';
|
|
9
9
|
import { repeat } from 'lit/directives/repeat.js';
|
|
10
10
|
import { LyraElement } from '../../internal/lyra-element.js';
|
|
11
|
-
import { defineElement } from '../../internal/prefix.js';
|
|
11
|
+
import { defineElement, tag } from '../../internal/prefix.js';
|
|
12
12
|
import { chevronIcon } from '../../internal/icons.js';
|
|
13
13
|
import { css } from 'lit';
|
|
14
14
|
import { cascadeUpdateComplete } from './update-cascade.js';
|
|
@@ -89,8 +89,11 @@ const styles = css `
|
|
|
89
89
|
*
|
|
90
90
|
* @customElement lyra-tree-node
|
|
91
91
|
* @event lyra-node-toggle - `detail: { id, expanded }`, fired when this node is expanded or collapsed (via `expand()`/`collapse()`, the toggle button, or ArrowRight/ArrowLeft).
|
|
92
|
-
* @event lyra-node-select - `detail: { id }`, fired when this node's primary action is activated (via `select()`, clicking its
|
|
93
|
-
* @csspart row
|
|
92
|
+
* @event lyra-node-select - `detail: { id }`, fired when this node's primary action is activated (via `select()`, clicking anywhere in its row, or Enter/Space).
|
|
93
|
+
* @csspart row - The tree row.
|
|
94
|
+
* @csspart toggle - The expand/collapse button.
|
|
95
|
+
* @csspart label - The node label.
|
|
96
|
+
* @csspart badge - The optional node badge.
|
|
94
97
|
*/
|
|
95
98
|
export class LyraTreeNode extends LyraElement {
|
|
96
99
|
constructor() {
|
|
@@ -145,19 +148,29 @@ export class LyraTreeNode extends LyraElement {
|
|
|
145
148
|
this.expanded = false;
|
|
146
149
|
this.emit('lyra-node-toggle', { id: this.item.id, expanded: false });
|
|
147
150
|
}
|
|
148
|
-
/**
|
|
151
|
+
/**
|
|
152
|
+
* Fire this item's primary "select" action (Enter/Space, or clicking
|
|
153
|
+
* anywhere in the row). Emits *before* calling `.focus()`: `<lyra-tree>`'s
|
|
154
|
+
* `onNodeActivate` listener for `lyra-node-select` runs synchronously
|
|
155
|
+
* (native `dispatchEvent` is sync) and updates `activeId`, which pushes
|
|
156
|
+
* `tabIndex = 0` down onto this node via its own render -- calling
|
|
157
|
+
* `.focus()` after that emit, rather than before, means real DOM focus
|
|
158
|
+
* lands correctly the very first time a previously-inactive node is
|
|
159
|
+
* clicked, not one render late.
|
|
160
|
+
*/
|
|
149
161
|
select() {
|
|
150
162
|
this.emit('lyra-node-select', { id: this.item.id });
|
|
163
|
+
this.focus();
|
|
151
164
|
}
|
|
152
165
|
/** See `cascadeUpdateComplete` and the matching override on `<lyra-tree>`. */
|
|
153
166
|
async getUpdateComplete() {
|
|
154
167
|
const result = await super.getUpdateComplete();
|
|
155
|
-
await cascadeUpdateComplete(this.shadowRoot?.querySelectorAll('
|
|
168
|
+
await cascadeUpdateComplete([...(this.shadowRoot?.querySelectorAll(tag('tree-node')) ?? [])]);
|
|
156
169
|
return result;
|
|
157
170
|
}
|
|
158
171
|
render() {
|
|
159
172
|
return html `
|
|
160
|
-
<div part="row" style=${`--lyra-tree-depth:${this.depth}`}>
|
|
173
|
+
<div part="row" style=${`--lyra-tree-depth:${this.depth}`} @click=${() => this.select()}>
|
|
161
174
|
<button
|
|
162
175
|
part="toggle"
|
|
163
176
|
type="button"
|
|
@@ -172,7 +185,7 @@ export class LyraTreeNode extends LyraElement {
|
|
|
172
185
|
>
|
|
173
186
|
${this.hasChildren ? chevronIcon() : nothing}
|
|
174
187
|
</button>
|
|
175
|
-
<span part="label"
|
|
188
|
+
<span part="label">${this.item.label}</span>
|
|
176
189
|
${this.item.badge != null ? html `<span part="badge">${this.item.badge}</span>` : nothing}
|
|
177
190
|
</div>
|
|
178
191
|
${this.expanded && this.hasChildren
|