@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,203 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: inline-block;
|
|
6
|
+
inline-size: 100%;
|
|
7
|
+
max-inline-size: 24rem;
|
|
8
|
+
}
|
|
9
|
+
:host(:disabled) {
|
|
10
|
+
cursor: not-allowed;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[part='form-control-label'] {
|
|
14
|
+
display: block;
|
|
15
|
+
margin-block-end: var(--lyra-space-xs);
|
|
16
|
+
font-size: 0.875rem;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
}
|
|
19
|
+
/* :empty never matches here -- the part always renders a literal label
|
|
20
|
+
element regardless of label content -- so real emptiness is tracked via
|
|
21
|
+
the label property length and reflected through the hidden attribute
|
|
22
|
+
instead (same fix as lyra-select's own form-control-label). */
|
|
23
|
+
[part='form-control-label'][hidden] {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[part='trigger'],
|
|
28
|
+
[part='combobox'] {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: var(--lyra-space-xs);
|
|
32
|
+
inline-size: 100%;
|
|
33
|
+
min-block-size: 2.5rem;
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
padding: var(--lyra-space-xs) var(--lyra-space-s);
|
|
36
|
+
border: 1px solid var(--lyra-color-border);
|
|
37
|
+
border-radius: var(--lyra-radius);
|
|
38
|
+
background: var(--lyra-color-surface);
|
|
39
|
+
color: inherit;
|
|
40
|
+
font: inherit;
|
|
41
|
+
}
|
|
42
|
+
[part='trigger'] {
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
text-align: start;
|
|
45
|
+
}
|
|
46
|
+
[part='combobox'] {
|
|
47
|
+
cursor: text;
|
|
48
|
+
}
|
|
49
|
+
[part='trigger']:focus-visible,
|
|
50
|
+
[part='combobox']:focus-within {
|
|
51
|
+
outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
|
|
52
|
+
outline-offset: var(--lyra-focus-ring-offset);
|
|
53
|
+
}
|
|
54
|
+
:host([open]) [part='trigger'] {
|
|
55
|
+
border-color: var(--lyra-color-brand);
|
|
56
|
+
}
|
|
57
|
+
:host(:disabled) [part='trigger'],
|
|
58
|
+
:host(:disabled) [part='combobox'] {
|
|
59
|
+
opacity: var(--lyra-opacity-disabled);
|
|
60
|
+
cursor: not-allowed;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[part='provider-badge'] {
|
|
64
|
+
flex: 0 0 auto;
|
|
65
|
+
padding-inline-end: var(--lyra-space-xs);
|
|
66
|
+
margin-inline-end: var(--lyra-space-xs);
|
|
67
|
+
border-inline-end: 1px solid var(--lyra-color-border);
|
|
68
|
+
font-size: 0.6875rem;
|
|
69
|
+
font-weight: 700;
|
|
70
|
+
text-transform: uppercase;
|
|
71
|
+
letter-spacing: 0.04em;
|
|
72
|
+
color: var(--lyra-color-text-quiet);
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.trigger-label {
|
|
77
|
+
flex: 1 1 auto;
|
|
78
|
+
min-inline-size: 0;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
text-overflow: ellipsis;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
}
|
|
83
|
+
.trigger-label[data-placeholder] {
|
|
84
|
+
color: var(--lyra-color-text-quiet);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[part='combobox-input'] {
|
|
88
|
+
flex: 1 1 auto;
|
|
89
|
+
min-inline-size: 0;
|
|
90
|
+
border: none;
|
|
91
|
+
outline: none;
|
|
92
|
+
background: transparent;
|
|
93
|
+
color: inherit;
|
|
94
|
+
font: inherit;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
[part='expand-icon'] {
|
|
98
|
+
flex: 0 0 auto;
|
|
99
|
+
display: inline-flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
color: var(--lyra-color-text-quiet);
|
|
103
|
+
min-inline-size: min(var(--lyra-icon-button-size), 1.75rem);
|
|
104
|
+
min-block-size: min(var(--lyra-icon-button-size), 1.75rem);
|
|
105
|
+
line-height: 1;
|
|
106
|
+
}
|
|
107
|
+
[part='expand-icon'] svg {
|
|
108
|
+
transform: rotate(90deg);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
[part='listbox'] {
|
|
112
|
+
position: fixed;
|
|
113
|
+
z-index: 900;
|
|
114
|
+
box-sizing: border-box;
|
|
115
|
+
max-block-size: 18rem;
|
|
116
|
+
overflow-y: auto;
|
|
117
|
+
inline-size: max-content;
|
|
118
|
+
min-inline-size: 12rem;
|
|
119
|
+
max-inline-size: min(92vw, 28rem);
|
|
120
|
+
padding: var(--lyra-space-xs);
|
|
121
|
+
background: var(--lyra-color-surface);
|
|
122
|
+
border: 1px solid var(--lyra-color-border);
|
|
123
|
+
border-radius: var(--lyra-radius);
|
|
124
|
+
box-shadow: var(--lyra-shadow);
|
|
125
|
+
/* Closed state: invisible + slightly raised. visibility (not
|
|
126
|
+
display:none) so opacity/transform can actually transition; hit-testing
|
|
127
|
+
and a11y exposure stay off since this part is already position:fixed. */
|
|
128
|
+
visibility: hidden;
|
|
129
|
+
opacity: 0;
|
|
130
|
+
transform: translateY(-0.25rem);
|
|
131
|
+
transition:
|
|
132
|
+
opacity var(--lyra-transition-fast),
|
|
133
|
+
transform var(--lyra-transition-fast),
|
|
134
|
+
visibility var(--lyra-transition-fast);
|
|
135
|
+
}
|
|
136
|
+
:host([open]) [part='listbox'] {
|
|
137
|
+
visibility: visible;
|
|
138
|
+
opacity: 1;
|
|
139
|
+
transform: translateY(0);
|
|
140
|
+
}
|
|
141
|
+
@media (prefers-reduced-motion: reduce) {
|
|
142
|
+
[part='listbox'] {
|
|
143
|
+
transition: none !important;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
[part='option'] {
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
gap: var(--lyra-space-xs);
|
|
151
|
+
inline-size: 100%;
|
|
152
|
+
box-sizing: border-box;
|
|
153
|
+
padding: var(--lyra-space-xs) var(--lyra-space-s);
|
|
154
|
+
border: 1px solid transparent;
|
|
155
|
+
border-radius: var(--lyra-radius);
|
|
156
|
+
background: none;
|
|
157
|
+
color: inherit;
|
|
158
|
+
font: inherit;
|
|
159
|
+
text-align: start;
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
}
|
|
162
|
+
[part='option']:hover,
|
|
163
|
+
[part='option'][data-active] {
|
|
164
|
+
background: var(--lyra-color-brand-quiet);
|
|
165
|
+
}
|
|
166
|
+
[part='option'][aria-selected='true'] {
|
|
167
|
+
border-color: var(--lyra-color-brand);
|
|
168
|
+
color: var(--lyra-color-brand);
|
|
169
|
+
font-weight: 600;
|
|
170
|
+
}
|
|
171
|
+
[part='option-label'] {
|
|
172
|
+
flex: 1 1 auto;
|
|
173
|
+
min-inline-size: 0;
|
|
174
|
+
overflow: hidden;
|
|
175
|
+
text-overflow: ellipsis;
|
|
176
|
+
white-space: nowrap;
|
|
177
|
+
}
|
|
178
|
+
/* Stale-value row: a previously-saved value that no longer appears in the
|
|
179
|
+
catalog. Marked with a dashed border + italic label (instead of the
|
|
180
|
+
solid border every real row uses) so it visually reads as "remembered,
|
|
181
|
+
not offered" rather than a normal selectable catalog entry. */
|
|
182
|
+
[part='option'][data-synthetic] {
|
|
183
|
+
border-style: dashed;
|
|
184
|
+
border-color: var(--lyra-color-border);
|
|
185
|
+
}
|
|
186
|
+
[part='option'][data-synthetic] [part='option-label'] {
|
|
187
|
+
font-style: italic;
|
|
188
|
+
}
|
|
189
|
+
[part='option-badge'] {
|
|
190
|
+
flex: 0 0 auto;
|
|
191
|
+
font-size: 0.6875rem;
|
|
192
|
+
font-style: normal;
|
|
193
|
+
font-weight: 400;
|
|
194
|
+
color: var(--lyra-color-text-quiet);
|
|
195
|
+
white-space: nowrap;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.empty {
|
|
199
|
+
padding: var(--lyra-space-m);
|
|
200
|
+
color: var(--lyra-color-text-quiet);
|
|
201
|
+
font-size: 0.875rem;
|
|
202
|
+
}
|
|
203
|
+
`;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
2
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
3
|
+
import type { LyraModelCatalog } from '../model-select/model-select.js';
|
|
4
|
+
import '../model-select/model-select.js';
|
|
5
|
+
import '../slider/slider.js';
|
|
6
|
+
export type ModelSettingsPanelLayout = 'vertical' | 'compact';
|
|
7
|
+
/** The full current settings shape, re-emitted on every `lyra-change`
|
|
8
|
+
* regardless of which child control actually triggered it. */
|
|
9
|
+
export interface ModelSettingsChangeDetail {
|
|
10
|
+
modelValue: string;
|
|
11
|
+
inCatalog: boolean;
|
|
12
|
+
temperature: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* `<lyra-model-settings-panel>` — a fixed composition of `<lyra-model-select>`
|
|
16
|
+
* and `<lyra-slider>` into one agent-configuration card: pick a provider's
|
|
17
|
+
* model, then tune its sampling temperature. Not a generic layout shell (no
|
|
18
|
+
* slots) — it exists so a consumer doesn't have to re-wire the same two
|
|
19
|
+
* child `lyra-change` events into one combined settings object by hand every
|
|
20
|
+
* time this pairing comes up.
|
|
21
|
+
*
|
|
22
|
+
* Every prop here is a plain pass-through to (or mirror of) the matching
|
|
23
|
+
* child control's own prop of the same/similar name; see the child
|
|
24
|
+
* components themselves for the exact semantics of `catalog`/`allowCustom`
|
|
25
|
+
* and `temperatureMin`/`temperatureMax`/`temperatureStep`.
|
|
26
|
+
*
|
|
27
|
+
* The panel's own `temperature` readout mirrors the slider's *live* value —
|
|
28
|
+
* updated on every `lyra-input` (drag/key-repeat), not just the committed
|
|
29
|
+
* `lyra-change` — and is re-clamped into `[temperatureMin, temperatureMax]`
|
|
30
|
+
* (snapped to `temperatureStep`) whenever those three properties change, so
|
|
31
|
+
* it can never drift from what the nested `lyra-slider` itself shows.
|
|
32
|
+
*
|
|
33
|
+
* @customElement lyra-model-settings-panel
|
|
34
|
+
* @event lyra-change - Either child control changed. `detail: { modelValue: string; inCatalog: boolean; temperature: number }` — always the full current settings, not just whatever changed.
|
|
35
|
+
* @csspart base - The outermost wrapping container.
|
|
36
|
+
* @csspart model-row - The row wrapping the internal `lyra-model-select`.
|
|
37
|
+
* @csspart temperature-row - The row wrapping the temperature label/slider/value.
|
|
38
|
+
* @csspart temperature-label - The visible "Temperature" caption.
|
|
39
|
+
* @csspart temperature-value - The visible current temperature readout.
|
|
40
|
+
*/
|
|
41
|
+
export declare class LyraModelSettingsPanel extends LyraElement {
|
|
42
|
+
static styles: import("lit").CSSResultGroup[];
|
|
43
|
+
/** Informational provider badge, passed straight through to the internal `lyra-model-select`. */
|
|
44
|
+
provider: string;
|
|
45
|
+
/** The model list, passed straight through to the internal `lyra-model-select`. */
|
|
46
|
+
catalog?: LyraModelCatalog;
|
|
47
|
+
/** The current model id. */
|
|
48
|
+
modelValue: string;
|
|
49
|
+
/** Let the model control accept a value outside `catalog`; passed straight through. */
|
|
50
|
+
allowCustom: boolean;
|
|
51
|
+
/** The current sampling temperature. */
|
|
52
|
+
temperature: number;
|
|
53
|
+
temperatureMin: number;
|
|
54
|
+
temperatureMax: number;
|
|
55
|
+
temperatureStep: number;
|
|
56
|
+
/** `vertical` stacks full-width rows with visible labels; `compact` runs
|
|
57
|
+
* the same two rows side by side with a smaller temperature caption, for
|
|
58
|
+
* toolbars/sidebars where the vertical layout's height doesn't fit. */
|
|
59
|
+
layout: ModelSettingsPanelLayout;
|
|
60
|
+
/** Disables the panel as a unit by forwarding to both the internal
|
|
61
|
+
* `lyra-model-select` and `lyra-slider` — a wrapping `<fieldset disabled>`
|
|
62
|
+
* alone would not reach either, since a form-associated control's own
|
|
63
|
+
* `disabled` IDL property/attribute is never mutated by fieldset cascading. */
|
|
64
|
+
disabled: boolean;
|
|
65
|
+
/** Whether `modelValue` is present in `catalog` — recomputed fresh from
|
|
66
|
+
* scratch (like `lyra-model-select`'s own `effectiveEntries`) rather than
|
|
67
|
+
* cached from the last child event, so it's still correct when
|
|
68
|
+
* `modelValue` was assigned directly instead of via the child's own
|
|
69
|
+
* `lyra-change`. */
|
|
70
|
+
private get inCatalog();
|
|
71
|
+
/** Clamps `raw` into `[temperatureMin, temperatureMax]`, snapped to
|
|
72
|
+
* `temperatureStep`'s grid anchored at the low end -- exactly mirroring
|
|
73
|
+
* `lyra-slider`'s own private `clampValue`/`domain` math -- so the
|
|
74
|
+
* mirrored `temperature` readout can never disagree with what the nested
|
|
75
|
+
* slider itself would clamp the same raw number to. */
|
|
76
|
+
private clampTemperature;
|
|
77
|
+
private emitChange;
|
|
78
|
+
private onModelChange;
|
|
79
|
+
private onTemperatureChange;
|
|
80
|
+
/** Mirrors the slider's *live* (uncommitted) value into the panel's own
|
|
81
|
+
* `temperature` readout -- display only, no `emitChange()` -- mirroring
|
|
82
|
+
* native `input` (continuous) vs. `change` (committed) semantics so the
|
|
83
|
+
* readout tracks an in-progress drag/key-repeat instead of only updating
|
|
84
|
+
* once the interaction commits. */
|
|
85
|
+
private onTemperatureInput;
|
|
86
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
87
|
+
render(): TemplateResult;
|
|
88
|
+
}
|
|
89
|
+
declare global {
|
|
90
|
+
interface HTMLElementTagNameMap {
|
|
91
|
+
'lyra-model-settings-panel': LyraModelSettingsPanel;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
10
|
+
import { defineElement } from '../../internal/prefix.js';
|
|
11
|
+
import { finiteNumber, finiteRange } from '../../internal/numbers.js';
|
|
12
|
+
import { styles } from './model-settings-panel.styles.js';
|
|
13
|
+
import '../model-select/model-select.js';
|
|
14
|
+
import '../slider/slider.js';
|
|
15
|
+
const DEFAULT_TEMPERATURE_MIN = 0;
|
|
16
|
+
const DEFAULT_TEMPERATURE_MAX = 2;
|
|
17
|
+
const DEFAULT_TEMPERATURE_STEP = 0.1;
|
|
18
|
+
// Midpoint of the default [0, 2] range -- a reasonable provider-agnostic
|
|
19
|
+
// starting point. Reassign `temperature` yourself if your provider's own
|
|
20
|
+
// default differs (OpenAI and Anthropic both default to 1, which this matches).
|
|
21
|
+
const DEFAULT_TEMPERATURE = 1;
|
|
22
|
+
/** Number of decimal digits in `n`'s shortest string representation, e.g.
|
|
23
|
+
* `0.1` -> 1, `5` -> 0. Mirrors lyra-slider's identical helper so the
|
|
24
|
+
* panel's own re-clamping of `temperature` lands on the exact same
|
|
25
|
+
* step-grid values the nested slider itself would compute. */
|
|
26
|
+
function decimalPlaces(n) {
|
|
27
|
+
const str = n.toString();
|
|
28
|
+
const dot = str.indexOf('.');
|
|
29
|
+
return dot === -1 ? 0 : str.length - dot - 1;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `<lyra-model-settings-panel>` — a fixed composition of `<lyra-model-select>`
|
|
33
|
+
* and `<lyra-slider>` into one agent-configuration card: pick a provider's
|
|
34
|
+
* model, then tune its sampling temperature. Not a generic layout shell (no
|
|
35
|
+
* slots) — it exists so a consumer doesn't have to re-wire the same two
|
|
36
|
+
* child `lyra-change` events into one combined settings object by hand every
|
|
37
|
+
* time this pairing comes up.
|
|
38
|
+
*
|
|
39
|
+
* Every prop here is a plain pass-through to (or mirror of) the matching
|
|
40
|
+
* child control's own prop of the same/similar name; see the child
|
|
41
|
+
* components themselves for the exact semantics of `catalog`/`allowCustom`
|
|
42
|
+
* and `temperatureMin`/`temperatureMax`/`temperatureStep`.
|
|
43
|
+
*
|
|
44
|
+
* The panel's own `temperature` readout mirrors the slider's *live* value —
|
|
45
|
+
* updated on every `lyra-input` (drag/key-repeat), not just the committed
|
|
46
|
+
* `lyra-change` — and is re-clamped into `[temperatureMin, temperatureMax]`
|
|
47
|
+
* (snapped to `temperatureStep`) whenever those three properties change, so
|
|
48
|
+
* it can never drift from what the nested `lyra-slider` itself shows.
|
|
49
|
+
*
|
|
50
|
+
* @customElement lyra-model-settings-panel
|
|
51
|
+
* @event lyra-change - Either child control changed. `detail: { modelValue: string; inCatalog: boolean; temperature: number }` — always the full current settings, not just whatever changed.
|
|
52
|
+
* @csspart base - The outermost wrapping container.
|
|
53
|
+
* @csspart model-row - The row wrapping the internal `lyra-model-select`.
|
|
54
|
+
* @csspart temperature-row - The row wrapping the temperature label/slider/value.
|
|
55
|
+
* @csspart temperature-label - The visible "Temperature" caption.
|
|
56
|
+
* @csspart temperature-value - The visible current temperature readout.
|
|
57
|
+
*/
|
|
58
|
+
export class LyraModelSettingsPanel extends LyraElement {
|
|
59
|
+
constructor() {
|
|
60
|
+
super(...arguments);
|
|
61
|
+
/** Informational provider badge, passed straight through to the internal `lyra-model-select`. */
|
|
62
|
+
this.provider = '';
|
|
63
|
+
/** The current model id. */
|
|
64
|
+
this.modelValue = '';
|
|
65
|
+
/** Let the model control accept a value outside `catalog`; passed straight through. */
|
|
66
|
+
this.allowCustom = false;
|
|
67
|
+
/** The current sampling temperature. */
|
|
68
|
+
this.temperature = DEFAULT_TEMPERATURE;
|
|
69
|
+
this.temperatureMin = DEFAULT_TEMPERATURE_MIN;
|
|
70
|
+
this.temperatureMax = DEFAULT_TEMPERATURE_MAX;
|
|
71
|
+
this.temperatureStep = DEFAULT_TEMPERATURE_STEP;
|
|
72
|
+
/** `vertical` stacks full-width rows with visible labels; `compact` runs
|
|
73
|
+
* the same two rows side by side with a smaller temperature caption, for
|
|
74
|
+
* toolbars/sidebars where the vertical layout's height doesn't fit. */
|
|
75
|
+
this.layout = 'vertical';
|
|
76
|
+
/** Disables the panel as a unit by forwarding to both the internal
|
|
77
|
+
* `lyra-model-select` and `lyra-slider` — a wrapping `<fieldset disabled>`
|
|
78
|
+
* alone would not reach either, since a form-associated control's own
|
|
79
|
+
* `disabled` IDL property/attribute is never mutated by fieldset cascading. */
|
|
80
|
+
this.disabled = false;
|
|
81
|
+
this.onModelChange = (e) => {
|
|
82
|
+
this.modelValue = e.detail.value;
|
|
83
|
+
this.emitChange();
|
|
84
|
+
};
|
|
85
|
+
this.onTemperatureChange = (e) => {
|
|
86
|
+
this.temperature = e.detail.value;
|
|
87
|
+
this.emitChange();
|
|
88
|
+
};
|
|
89
|
+
/** Mirrors the slider's *live* (uncommitted) value into the panel's own
|
|
90
|
+
* `temperature` readout -- display only, no `emitChange()` -- mirroring
|
|
91
|
+
* native `input` (continuous) vs. `change` (committed) semantics so the
|
|
92
|
+
* readout tracks an in-progress drag/key-repeat instead of only updating
|
|
93
|
+
* once the interaction commits. */
|
|
94
|
+
this.onTemperatureInput = (e) => {
|
|
95
|
+
this.temperature = e.detail.value;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
static { this.styles = [LyraElement.styles, styles]; }
|
|
99
|
+
/** Whether `modelValue` is present in `catalog` — recomputed fresh from
|
|
100
|
+
* scratch (like `lyra-model-select`'s own `effectiveEntries`) rather than
|
|
101
|
+
* cached from the last child event, so it's still correct when
|
|
102
|
+
* `modelValue` was assigned directly instead of via the child's own
|
|
103
|
+
* `lyra-change`. */
|
|
104
|
+
get inCatalog() {
|
|
105
|
+
const catalog = this.catalog;
|
|
106
|
+
if (!catalog || catalog.length === 0)
|
|
107
|
+
return false;
|
|
108
|
+
return catalog.some((entry) => (typeof entry === 'string' ? entry === this.modelValue : entry.id === this.modelValue));
|
|
109
|
+
}
|
|
110
|
+
/** Clamps `raw` into `[temperatureMin, temperatureMax]`, snapped to
|
|
111
|
+
* `temperatureStep`'s grid anchored at the low end -- exactly mirroring
|
|
112
|
+
* `lyra-slider`'s own private `clampValue`/`domain` math -- so the
|
|
113
|
+
* mirrored `temperature` readout can never disagree with what the nested
|
|
114
|
+
* slider itself would clamp the same raw number to. */
|
|
115
|
+
clampTemperature(raw) {
|
|
116
|
+
const rawMin = this.temperatureMin;
|
|
117
|
+
const rawMax = this.temperatureMax;
|
|
118
|
+
const min = finiteNumber(rawMin, DEFAULT_TEMPERATURE_MIN);
|
|
119
|
+
const max = finiteNumber(rawMax, DEFAULT_TEMPERATURE_MAX);
|
|
120
|
+
const lo = Math.min(min, max);
|
|
121
|
+
const hi = Math.max(min, max);
|
|
122
|
+
const step = finiteRange(this.temperatureStep, 0, 0);
|
|
123
|
+
const hasStep = step > 0;
|
|
124
|
+
let stepped = finiteNumber(raw, lo);
|
|
125
|
+
if (hasStep) {
|
|
126
|
+
const stepsFromLo = Math.round((raw - lo) / step);
|
|
127
|
+
const factor = 10 ** decimalPlaces(step);
|
|
128
|
+
stepped = Math.round((lo + stepsFromLo * step) * factor) / factor;
|
|
129
|
+
}
|
|
130
|
+
return Math.min(hi, Math.max(lo, stepped));
|
|
131
|
+
}
|
|
132
|
+
emitChange() {
|
|
133
|
+
this.emit('lyra-change', {
|
|
134
|
+
modelValue: this.modelValue,
|
|
135
|
+
inCatalog: this.inCatalog,
|
|
136
|
+
temperature: this.temperature,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
willUpdate(changed) {
|
|
140
|
+
if (changed.has('temperatureMin') || changed.has('temperatureMax') || changed.has('temperatureStep')) {
|
|
141
|
+
const clamped = this.clampTemperature(this.temperature);
|
|
142
|
+
if (clamped !== this.temperature)
|
|
143
|
+
this.temperature = clamped;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
render() {
|
|
147
|
+
return html `
|
|
148
|
+
<div part="base">
|
|
149
|
+
<div part="model-row">
|
|
150
|
+
<lyra-model-select
|
|
151
|
+
.provider=${this.provider}
|
|
152
|
+
.catalog=${this.catalog}
|
|
153
|
+
.value=${this.modelValue}
|
|
154
|
+
.allowCustom=${this.allowCustom}
|
|
155
|
+
.disabled=${this.disabled}
|
|
156
|
+
placeholder="Select a model…"
|
|
157
|
+
@lyra-change=${this.onModelChange}
|
|
158
|
+
></lyra-model-select>
|
|
159
|
+
</div>
|
|
160
|
+
<div part="temperature-row">
|
|
161
|
+
<span part="temperature-label">Temperature</span>
|
|
162
|
+
<lyra-slider
|
|
163
|
+
.label=${'Temperature'}
|
|
164
|
+
.min=${this.temperatureMin}
|
|
165
|
+
.max=${this.temperatureMax}
|
|
166
|
+
.step=${this.temperatureStep}
|
|
167
|
+
.valueAsNumber=${this.temperature}
|
|
168
|
+
.showValue=${false}
|
|
169
|
+
.disabled=${this.disabled}
|
|
170
|
+
@lyra-input=${this.onTemperatureInput}
|
|
171
|
+
@lyra-change=${this.onTemperatureChange}
|
|
172
|
+
></lyra-slider>
|
|
173
|
+
<span part="temperature-value" aria-hidden="true">${this.temperature}</span>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
`;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
__decorate([
|
|
180
|
+
property()
|
|
181
|
+
], LyraModelSettingsPanel.prototype, "provider", void 0);
|
|
182
|
+
__decorate([
|
|
183
|
+
property({ attribute: false })
|
|
184
|
+
], LyraModelSettingsPanel.prototype, "catalog", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
property({ attribute: 'model-value' })
|
|
187
|
+
], LyraModelSettingsPanel.prototype, "modelValue", void 0);
|
|
188
|
+
__decorate([
|
|
189
|
+
property({ type: Boolean, attribute: 'allow-custom' })
|
|
190
|
+
], LyraModelSettingsPanel.prototype, "allowCustom", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
property({ type: Number })
|
|
193
|
+
], LyraModelSettingsPanel.prototype, "temperature", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
property({ type: Number, attribute: 'temperature-min' })
|
|
196
|
+
], LyraModelSettingsPanel.prototype, "temperatureMin", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
property({ type: Number, attribute: 'temperature-max' })
|
|
199
|
+
], LyraModelSettingsPanel.prototype, "temperatureMax", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
property({ type: Number, attribute: 'temperature-step' })
|
|
202
|
+
], LyraModelSettingsPanel.prototype, "temperatureStep", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
property({ reflect: true })
|
|
205
|
+
], LyraModelSettingsPanel.prototype, "layout", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
property({ type: Boolean, reflect: true })
|
|
208
|
+
], LyraModelSettingsPanel.prototype, "disabled", void 0);
|
|
209
|
+
defineElement('model-settings-panel', LyraModelSettingsPanel);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
inline-size: 100%;
|
|
6
|
+
max-inline-size: 28rem;
|
|
7
|
+
}
|
|
8
|
+
[part='base'] {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: var(--lyra-space-l);
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
padding: var(--lyra-space-l);
|
|
14
|
+
border: 1px solid var(--lyra-color-border);
|
|
15
|
+
border-radius: var(--lyra-radius);
|
|
16
|
+
background: var(--lyra-color-surface);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[part='model-row'] {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: var(--lyra-space-xs);
|
|
23
|
+
min-inline-size: 0;
|
|
24
|
+
}
|
|
25
|
+
/* The nested control's own max-inline-size (24rem, sized for a standalone
|
|
26
|
+
dropdown) would otherwise clip a full-width row inside this card. */
|
|
27
|
+
[part='model-row'] lyra-model-select {
|
|
28
|
+
inline-size: 100%;
|
|
29
|
+
max-inline-size: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
[part='temperature-row'] {
|
|
33
|
+
display: grid;
|
|
34
|
+
grid-template-columns: auto 1fr auto;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: var(--lyra-space-s);
|
|
37
|
+
min-inline-size: 0;
|
|
38
|
+
}
|
|
39
|
+
[part='temperature-row'] lyra-slider {
|
|
40
|
+
min-inline-size: 0;
|
|
41
|
+
}
|
|
42
|
+
[part='temperature-label'] {
|
|
43
|
+
font-size: 0.8125rem;
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
color: var(--lyra-color-text);
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
}
|
|
48
|
+
[part='temperature-value'] {
|
|
49
|
+
font-size: 0.8125rem;
|
|
50
|
+
color: var(--lyra-color-text-quiet);
|
|
51
|
+
font-variant-numeric: tabular-nums;
|
|
52
|
+
min-inline-size: 2.5ch;
|
|
53
|
+
text-align: end;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Compact layout: the two rows sit side by side instead of stacked, and
|
|
57
|
+
the temperature caption shrinks to an uppercase micro-label -- a denser
|
|
58
|
+
treatment for toolbars/sidebars where the vertical layout's full-height
|
|
59
|
+
rows don't fit. */
|
|
60
|
+
:host([layout='compact']) {
|
|
61
|
+
max-inline-size: none;
|
|
62
|
+
}
|
|
63
|
+
:host([layout='compact']) [part='base'] {
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
flex-wrap: wrap;
|
|
66
|
+
align-items: flex-start;
|
|
67
|
+
gap: var(--lyra-space-m);
|
|
68
|
+
padding: var(--lyra-space-m);
|
|
69
|
+
}
|
|
70
|
+
:host([layout='compact']) [part='model-row'],
|
|
71
|
+
:host([layout='compact']) [part='temperature-row'] {
|
|
72
|
+
flex: 1 1 12rem;
|
|
73
|
+
min-inline-size: 10rem;
|
|
74
|
+
}
|
|
75
|
+
:host([layout='compact']) [part='temperature-label'] {
|
|
76
|
+
font-size: 0.6875rem;
|
|
77
|
+
font-weight: 700;
|
|
78
|
+
text-transform: uppercase;
|
|
79
|
+
letter-spacing: 0.04em;
|
|
80
|
+
color: var(--lyra-color-text-quiet);
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
@@ -9,14 +9,25 @@ import { LyraElement } from '../../internal/lyra-element.js';
|
|
|
9
9
|
* @event lyra-play - Fired when playback starts.
|
|
10
10
|
* @event lyra-pause - Fired when playback stops (including auto-pause).
|
|
11
11
|
* @event lyra-step - `detail: { index }`, fired on every tick and manual step.
|
|
12
|
-
* @csspart base
|
|
12
|
+
* @csspart base - The playback controls wrapper.
|
|
13
|
+
* @csspart play-button - The play/pause button.
|
|
14
|
+
* @csspart slider - The playback position slider.
|
|
13
15
|
*/
|
|
14
16
|
export declare class LyraPlayback extends LyraElement {
|
|
15
17
|
static styles: import("lit").CSSResultGroup[];
|
|
18
|
+
static properties: {
|
|
19
|
+
playing: {
|
|
20
|
+
type: BooleanConstructor;
|
|
21
|
+
reflect: boolean;
|
|
22
|
+
noAccessor: boolean;
|
|
23
|
+
};
|
|
24
|
+
loop: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
16
28
|
length: number;
|
|
17
29
|
index: number;
|
|
18
30
|
intervalMs: number;
|
|
19
|
-
playing: boolean;
|
|
20
31
|
loop: boolean;
|
|
21
32
|
/**
|
|
22
33
|
* Re-declared as a Lit reactive property (shadowing the inherited plain
|
|
@@ -27,7 +38,12 @@ export declare class LyraPlayback extends LyraElement {
|
|
|
27
38
|
*/
|
|
28
39
|
hidden: boolean;
|
|
29
40
|
private timer?;
|
|
30
|
-
|
|
41
|
+
private _playing;
|
|
42
|
+
get playing(): boolean;
|
|
43
|
+
set playing(next: boolean);
|
|
44
|
+
/** Largest index reachable at the current `length` (never negative, and
|
|
45
|
+
* never NaN — a non-finite `length` falls back to 0 rather than leaking a
|
|
46
|
+
* literal "NaN" into the rendered slider's `max` attribute). */
|
|
31
47
|
private get maxIndex();
|
|
32
48
|
disconnectedCallback(): void;
|
|
33
49
|
protected willUpdate(changed: PropertyValues): void;
|