@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,260 @@
|
|
|
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 } from 'lit/decorators.js';
|
|
9
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
10
|
+
import { defineElement } from '../../internal/prefix.js';
|
|
11
|
+
import { nextId } from '../../internal/a11y.js';
|
|
12
|
+
import { chevronIcon } from '../../internal/icons.js';
|
|
13
|
+
import { styles } from './thinking-panel.styles.js';
|
|
14
|
+
/** "Close enough to the body's own max scroll position to count as anchored
|
|
15
|
+
* there" -- comfortably larger than one line of streamed text, so a user
|
|
16
|
+
* who has barely nudged the scrollbar while reading the latest line isn't
|
|
17
|
+
* mistaken for having deliberately scrolled away to read earlier content. */
|
|
18
|
+
const NEAR_BOTTOM_PX = 48;
|
|
19
|
+
/** `820` -> `"820ms"`; `1500` -> `"1.5s"`; `2000` -> `"2s"`. Identical
|
|
20
|
+
* algorithm to lyra-tool-call-chip's and lyra-tool-result-dialog's own
|
|
21
|
+
* `formatDuration` -- duplicated rather than imported (three independent,
|
|
22
|
+
* separately-consumable components) but kept in lockstep so the same
|
|
23
|
+
* elapsed time reads identically everywhere it's shown in this library. */
|
|
24
|
+
function formatDuration(ms) {
|
|
25
|
+
if (!Number.isFinite(ms) || ms < 1000) {
|
|
26
|
+
return `${Math.round(Math.max(0, ms))}ms`;
|
|
27
|
+
}
|
|
28
|
+
const seconds = ms / 1000;
|
|
29
|
+
const rounded = Math.round(seconds * 10) / 10;
|
|
30
|
+
return `${Number.isInteger(rounded) ? rounded.toFixed(0) : rounded.toFixed(1)}s`;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* `<lyra-thinking-panel>` — a collapsible panel for an AI agent's
|
|
34
|
+
* intermediate reasoning/"thinking" transcript, kept visually and
|
|
35
|
+
* semantically distinct from its final response. Same collapsible
|
|
36
|
+
* header-button-plus-region shape as `<lyra-source-list>`; the default slot
|
|
37
|
+
* is entirely free-form (a consumer-composed `<lyra-streaming-text>`,
|
|
38
|
+
* `<lyra-markdown>`, or plain text) — this component has no dependency on
|
|
39
|
+
* either and imposes no structure on what's slotted.
|
|
40
|
+
*
|
|
41
|
+
* `mode` (`'live'` while reasoning is actively streaming in, `'post-hoc'`
|
|
42
|
+
* once it's complete and being reviewed after the fact) drives two concrete
|
|
43
|
+
* behavior differences, not just a styling hook:
|
|
44
|
+
* - **Header hint.** While `duration-ms` is unset, `'live'` shows a pulsing
|
|
45
|
+
* "Thinking…" placeholder in `[part="duration"]`; `'post-hoc'` shows
|
|
46
|
+
* nothing there instead (a finished review with no known duration has
|
|
47
|
+
* nothing useful to say in that slot). Once `duration-ms` is set, both
|
|
48
|
+
* modes show the same static `"Thought for …"` text — a `'post-hoc'`
|
|
49
|
+
* consumer that captured a duration is free to supply it too.
|
|
50
|
+
* - **Auto-scroll.** Only `'live'` mode auto-follows new content appended to
|
|
51
|
+
* the default slot while `expanded` (see below); `'post-hoc'` never
|
|
52
|
+
* scrolls on its own, since reviewing finished reasoning is expected to
|
|
53
|
+
* start from the top like reading any other completed document. This
|
|
54
|
+
* library otherwise defaults to *not* editorializing about a host's data
|
|
55
|
+
* (see `<lyra-empty>`'s plain-`description` stance), but scroll position
|
|
56
|
+
* is presentation, not data, so this one behavior difference earns its
|
|
57
|
+
* keep rather than being left as a bare visual/semantic hint the host
|
|
58
|
+
* would have to reimplement identically itself.
|
|
59
|
+
*
|
|
60
|
+
* Live-mode auto-scroll ("stick to bottom") is the classic chat-transcript
|
|
61
|
+
* convention: while `mode="live"` and `expanded`, new content keeps the
|
|
62
|
+
* panel scrolled to its latest line — *unless* the user has manually
|
|
63
|
+
* scrolled up to (re-)read earlier content, in which case their position is
|
|
64
|
+
* never yanked away from them. This is tracked continuously via a `scroll`
|
|
65
|
+
* listener on `[part="body"]` (not recomputed from the mutation itself,
|
|
66
|
+
* which necessarily observes the DOM only *after* it has already changed):
|
|
67
|
+
* every user-driven scroll records whether the body was left within
|
|
68
|
+
* `NEAR_BOTTOM_PX` of its own max scroll position, and only a mutation that
|
|
69
|
+
* arrives while that's still true triggers a follow-up scroll-to-bottom.
|
|
70
|
+
* Opening an already-`'live'` panel (or one that later becomes `'live'`)
|
|
71
|
+
* always resets this to "anchored" and jumps to the latest content, the same
|
|
72
|
+
* way a chat app's own transcript does when you re-open it.
|
|
73
|
+
*
|
|
74
|
+
* New content is detected via a `MutationObserver` on this element's own
|
|
75
|
+
* light DOM (`childList`+`subtree`+`characterData`) rather than the default
|
|
76
|
+
* slot's `slotchange` event, because `slotchange` only fires when the set of
|
|
77
|
+
* top-level assigned nodes changes — never for a text node mutating *inside*
|
|
78
|
+
* an already-slotted element, which is the more likely shape for streamed
|
|
79
|
+
* reasoning (a consumer appending chunks to an existing node's `textContent`
|
|
80
|
+
* rather than re-slotting a whole new element per token). The one thing this
|
|
81
|
+
* can't see is a mutation entirely inside a slotted custom element's own
|
|
82
|
+
* shadow root (e.g. a `<lyra-markdown>` re-rendering its shadow tree after a
|
|
83
|
+
* `content` property change) — Shadow DOM encapsulation blocks that by
|
|
84
|
+
* design, and there is no way for this component to reach across that
|
|
85
|
+
* boundary. A slotted element whose *own* internal updates should drive this
|
|
86
|
+
* panel's auto-scroll needs to append/mutate visible light-DOM text itself
|
|
87
|
+
* (as `<lyra-streaming-text>` is expected to), or the host can call this
|
|
88
|
+
* panel's own `scrollToBottom()` directly.
|
|
89
|
+
*
|
|
90
|
+
* `aria-controls` linking the header to the body region uses `nextId()`
|
|
91
|
+
* (`../../internal/a11y.js`) for a collision-safe id, the same convention
|
|
92
|
+
* `<lyra-source-list>` and `<lyra-widget>` already establish for every
|
|
93
|
+
* toggle-controls-region pairing in this library.
|
|
94
|
+
*
|
|
95
|
+
* @customElement lyra-thinking-panel
|
|
96
|
+
* @slot - The reasoning/thinking content.
|
|
97
|
+
* @event lyra-toggle - The header was activated, expanding or collapsing the
|
|
98
|
+
* panel. `detail: { expanded }` — same event name and shape as
|
|
99
|
+
* `<lyra-source-list>`'s own `lyra-toggle`.
|
|
100
|
+
* @csspart base - The outer container.
|
|
101
|
+
* @csspart header - The clickable header (`<button>`) toggling `expanded`.
|
|
102
|
+
* @csspart label - The `label` text.
|
|
103
|
+
* @csspart duration - The formatted duration / "Thinking…" placeholder, when shown.
|
|
104
|
+
* @csspart toggle - The chevron indicator inside the header.
|
|
105
|
+
* @csspart body - The wrapper around the default slot, `hidden` while
|
|
106
|
+
* collapsed. Independently keyboard-focusable (`tabindex="0"`, `role="group"`
|
|
107
|
+
* named from `label`) since it's its own capped-height scrollable region.
|
|
108
|
+
*/
|
|
109
|
+
export class LyraThinkingPanel extends LyraElement {
|
|
110
|
+
constructor() {
|
|
111
|
+
super(...arguments);
|
|
112
|
+
/** Header text. */
|
|
113
|
+
this.label = 'Thinking';
|
|
114
|
+
/** Whether the reasoning transcript is currently shown. Starts collapsed,
|
|
115
|
+
* matching `<lyra-source-list>`'s default -- a consumer running `'live'`
|
|
116
|
+
* reasoning sets this `true` itself to stream it in view as it arrives. */
|
|
117
|
+
this.expanded = false;
|
|
118
|
+
/** `'live'` while reasoning is actively streaming in right now; `'post-hoc'`
|
|
119
|
+
* once it's complete and being reviewed after the fact. See the class doc
|
|
120
|
+
* for the concrete behavior differences this drives. */
|
|
121
|
+
this.mode = 'live';
|
|
122
|
+
this.bodyId = nextId('thinking-panel-body');
|
|
123
|
+
// Whether the body was left within NEAR_BOTTOM_PX of its own max scroll
|
|
124
|
+
// position the last time a real (user-driven) scroll was recorded -- see
|
|
125
|
+
// onScroll(). Starts `true` so a panel that mounts already `expanded` and
|
|
126
|
+
// `mode="live"` follows its very first streamed content by default,
|
|
127
|
+
// before any scroll event has ever fired.
|
|
128
|
+
this.stickToBottom = true;
|
|
129
|
+
this.onScroll = (e) => {
|
|
130
|
+
const body = e.currentTarget;
|
|
131
|
+
this.stickToBottom = body.scrollHeight - body.scrollTop - body.clientHeight <= NEAR_BOTTOM_PX;
|
|
132
|
+
};
|
|
133
|
+
this.onContentMutated = () => {
|
|
134
|
+
if (this.mode !== 'live' || !this.expanded || !this.stickToBottom)
|
|
135
|
+
return;
|
|
136
|
+
// Coalesce to at most one scroll-to-bottom per animation frame -- a fast
|
|
137
|
+
// token stream can otherwise fire many mutation records in quick
|
|
138
|
+
// succession, each individually cheap to react to but wasteful (and
|
|
139
|
+
// visually janky) to lay out for separately.
|
|
140
|
+
if (this.scrollRafId !== undefined)
|
|
141
|
+
return;
|
|
142
|
+
this.scrollRafId = requestAnimationFrame(() => {
|
|
143
|
+
this.scrollRafId = undefined;
|
|
144
|
+
// Re-check the same guard here, not just in the caller: mode/expanded/
|
|
145
|
+
// stickToBottom can all change in the ~1-frame window between this
|
|
146
|
+
// mutation being observed and this callback actually firing (e.g. the
|
|
147
|
+
// reader scrolling away mid-frame), and this is the only place that
|
|
148
|
+
// reflects state as of the moment the scroll would actually happen.
|
|
149
|
+
if (this.mode === 'live' && this.expanded && this.stickToBottom)
|
|
150
|
+
this.scrollToBottom();
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
this.toggle = () => {
|
|
154
|
+
this.expanded = !this.expanded;
|
|
155
|
+
this.emit('lyra-toggle', { expanded: this.expanded });
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
static { this.styles = [LyraElement.styles, styles]; }
|
|
159
|
+
connectedCallback() {
|
|
160
|
+
super.connectedCallback();
|
|
161
|
+
// Watches this element's own light-DOM subtree, not the shadow-DOM
|
|
162
|
+
// [part="body"] wrapper -- the slotted reasoning content actually lives
|
|
163
|
+
// here, as this element's children. See the class doc for why this
|
|
164
|
+
// (rather than `slotchange`) is what detects streamed-in content.
|
|
165
|
+
this.contentObserver = new MutationObserver(this.onContentMutated);
|
|
166
|
+
this.contentObserver.observe(this, { childList: true, subtree: true, characterData: true });
|
|
167
|
+
}
|
|
168
|
+
disconnectedCallback() {
|
|
169
|
+
super.disconnectedCallback();
|
|
170
|
+
this.contentObserver?.disconnect();
|
|
171
|
+
this.contentObserver = undefined;
|
|
172
|
+
if (this.scrollRafId !== undefined) {
|
|
173
|
+
cancelAnimationFrame(this.scrollRafId);
|
|
174
|
+
this.scrollRafId = undefined;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
updated(changed) {
|
|
178
|
+
if ((changed.has('expanded') || changed.has('mode')) && this.expanded && this.mode === 'live') {
|
|
179
|
+
// Opening a live panel -- or a still-expanded panel later becoming
|
|
180
|
+
// `'live'` -- always jumps straight to the newest content and resets
|
|
181
|
+
// the sticky-bottom flag, so it starts following again regardless of
|
|
182
|
+
// wherever the body happened to be scrolled beforehand. `'post-hoc'`
|
|
183
|
+
// deliberately skips this -- see the class doc's Auto-scroll section.
|
|
184
|
+
this.stickToBottom = true;
|
|
185
|
+
this.scrollToBottom();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
/** Scrolls the body to its current bottom immediately (no smooth-scroll
|
|
189
|
+
* animation, deliberately -- see onContentMutated()'s rAF-coalescing
|
|
190
|
+
* comment for why an instant jump reads better than a stack of competing
|
|
191
|
+
* smooth scrolls under a fast token stream). Safe to call directly, e.g.
|
|
192
|
+
* from a host that wants to force a jump-to-latest action of its own. */
|
|
193
|
+
scrollToBottom() {
|
|
194
|
+
const body = this.renderRoot.querySelector('[part="body"]');
|
|
195
|
+
if (!body)
|
|
196
|
+
return;
|
|
197
|
+
body.scrollTop = body.scrollHeight;
|
|
198
|
+
}
|
|
199
|
+
get durationDisplay() {
|
|
200
|
+
if (this.durationMs != null && Number.isFinite(this.durationMs)) {
|
|
201
|
+
return { text: `Thought for ${formatDuration(this.durationMs)}`, pending: false };
|
|
202
|
+
}
|
|
203
|
+
return this.mode === 'live' ? { text: 'Thinking…', pending: true } : null;
|
|
204
|
+
}
|
|
205
|
+
// `[part="body"]` is `tabindex="0"` because it's a capped-height,
|
|
206
|
+
// independently-scrollable region -- with no other focusable content of
|
|
207
|
+
// its own (e.g. plain text, or a non-interactive `<lyra-streaming-text>`),
|
|
208
|
+
// it would otherwise be unreachable by keyboard, same reasoning
|
|
209
|
+
// code-block.ts's and virtual-list.ts's own identical `[part="body"]`/
|
|
210
|
+
// `[part="base"]` tabindex document. `role="group"` (rather than a page
|
|
211
|
+
// landmark role) plus `aria-label` gives it an accessible name without
|
|
212
|
+
// claiming navigation significance for what is, structurally, just one
|
|
213
|
+
// part of a larger message.
|
|
214
|
+
render() {
|
|
215
|
+
const duration = this.durationDisplay;
|
|
216
|
+
return html `
|
|
217
|
+
<div part="base">
|
|
218
|
+
<button
|
|
219
|
+
part="header"
|
|
220
|
+
type="button"
|
|
221
|
+
aria-expanded=${this.expanded ? 'true' : 'false'}
|
|
222
|
+
aria-controls=${this.bodyId}
|
|
223
|
+
@click=${this.toggle}
|
|
224
|
+
>
|
|
225
|
+
<span part="toggle" aria-hidden="true">${chevronIcon()}</span>
|
|
226
|
+
<span part="label">${this.label}</span>
|
|
227
|
+
${duration
|
|
228
|
+
? html `<span part="duration" ?data-pending=${duration.pending}
|
|
229
|
+
>${duration.pending ? html `<span class="pending-dot" aria-hidden="true"></span>` : nothing}${duration.text}</span
|
|
230
|
+
>`
|
|
231
|
+
: nothing}
|
|
232
|
+
</button>
|
|
233
|
+
<div
|
|
234
|
+
part="body"
|
|
235
|
+
id=${this.bodyId}
|
|
236
|
+
role="group"
|
|
237
|
+
aria-label=${this.label}
|
|
238
|
+
tabindex="0"
|
|
239
|
+
?hidden=${!this.expanded}
|
|
240
|
+
@scroll=${this.onScroll}
|
|
241
|
+
>
|
|
242
|
+
<slot></slot>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
`;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
__decorate([
|
|
249
|
+
property()
|
|
250
|
+
], LyraThinkingPanel.prototype, "label", void 0);
|
|
251
|
+
__decorate([
|
|
252
|
+
property({ type: Boolean, reflect: true })
|
|
253
|
+
], LyraThinkingPanel.prototype, "expanded", void 0);
|
|
254
|
+
__decorate([
|
|
255
|
+
property({ reflect: true })
|
|
256
|
+
], LyraThinkingPanel.prototype, "mode", void 0);
|
|
257
|
+
__decorate([
|
|
258
|
+
property({ type: Number, attribute: 'duration-ms' })
|
|
259
|
+
], LyraThinkingPanel.prototype, "durationMs", void 0);
|
|
260
|
+
defineElement('thinking-panel', LyraThinkingPanel);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
// Shares its collapsible-header shape (border/radius/hover/focus-ring, the
|
|
3
|
+
// rotating chevron) with lyra-source-list's styles almost verbatim -- the two
|
|
4
|
+
// are siblings in the same "collapsible region behind a header button"
|
|
5
|
+
// family and are meant to sit comfortably next to each other in a message.
|
|
6
|
+
export const styles = css `
|
|
7
|
+
:host {
|
|
8
|
+
display: block;
|
|
9
|
+
/* Consumer-overridable cap on how tall the reasoning transcript grows
|
|
10
|
+
before it scrolls internally, e.g. via ::part(body) or by overriding
|
|
11
|
+
this custom property directly -- not exposed as a component prop
|
|
12
|
+
since it's a pure layout knob, not something a template branches on. */
|
|
13
|
+
--lyra-thinking-panel-max-block-size: 16rem;
|
|
14
|
+
}
|
|
15
|
+
[part='base'] {
|
|
16
|
+
border: 1px solid var(--lyra-color-border);
|
|
17
|
+
border-radius: var(--lyra-radius);
|
|
18
|
+
background: var(--lyra-color-surface);
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
}
|
|
21
|
+
[part='header'] {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: var(--lyra-space-xs);
|
|
25
|
+
inline-size: 100%;
|
|
26
|
+
padding: var(--lyra-space-s) var(--lyra-space-m);
|
|
27
|
+
border: none;
|
|
28
|
+
background: none;
|
|
29
|
+
color: var(--lyra-color-text);
|
|
30
|
+
font: inherit;
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
font-size: 0.875rem;
|
|
33
|
+
text-align: start;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
}
|
|
36
|
+
[part='header']:hover {
|
|
37
|
+
background: var(--lyra-color-brand-quiet);
|
|
38
|
+
color: var(--lyra-color-brand);
|
|
39
|
+
}
|
|
40
|
+
[part='header']:focus-visible {
|
|
41
|
+
outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
|
|
42
|
+
outline-offset: calc(-1 * var(--lyra-focus-ring-offset));
|
|
43
|
+
}
|
|
44
|
+
[part='toggle'] {
|
|
45
|
+
display: inline-flex;
|
|
46
|
+
flex: 0 0 auto;
|
|
47
|
+
transition: transform var(--lyra-transition-fast);
|
|
48
|
+
}
|
|
49
|
+
:host([expanded]) [part='toggle'] {
|
|
50
|
+
transform: rotate(90deg);
|
|
51
|
+
}
|
|
52
|
+
[part='label'] {
|
|
53
|
+
flex: 1 1 auto;
|
|
54
|
+
min-inline-size: 0;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
}
|
|
59
|
+
[part='duration'] {
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 0.35em;
|
|
63
|
+
flex: 0 0 auto;
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
font-size: 0.8125rem;
|
|
66
|
+
color: var(--lyra-color-text-quiet);
|
|
67
|
+
}
|
|
68
|
+
/* Actively streaming with no duration yet -- a full-opacity brand-colored
|
|
69
|
+
label plus a separate decorative pulse dot, deliberately *not* animating
|
|
70
|
+
the text's own opacity the way lyra-typing-indicator's pulse variant
|
|
71
|
+
does: that dims it well below AA contrast for part of every cycle, fine
|
|
72
|
+
for a purely decorative shape but not for text carrying real content
|
|
73
|
+
("Thinking…"). */
|
|
74
|
+
[part='duration'][data-pending] {
|
|
75
|
+
color: var(--lyra-color-brand);
|
|
76
|
+
}
|
|
77
|
+
.pending-dot {
|
|
78
|
+
inline-size: 0.375rem;
|
|
79
|
+
block-size: 0.375rem;
|
|
80
|
+
border-radius: 50%;
|
|
81
|
+
background: currentColor;
|
|
82
|
+
animation: lyra-thinking-panel-pulse var(--lyra-transition-base) infinite;
|
|
83
|
+
}
|
|
84
|
+
@keyframes lyra-thinking-panel-pulse {
|
|
85
|
+
0%,
|
|
86
|
+
100% {
|
|
87
|
+
opacity: 0.4;
|
|
88
|
+
transform: scale(0.85);
|
|
89
|
+
}
|
|
90
|
+
50% {
|
|
91
|
+
opacity: 1;
|
|
92
|
+
transform: scale(1);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
[part='body'] {
|
|
96
|
+
max-block-size: var(--lyra-thinking-panel-max-block-size);
|
|
97
|
+
overflow-y: auto;
|
|
98
|
+
/* Reaching this region's own top/bottom edge stops there instead of
|
|
99
|
+
chaining the scroll into the host page -- this is precisely the
|
|
100
|
+
component that tracks and respects the reader scrolling within it, so
|
|
101
|
+
it shouldn't hand that scroll off to the page underneath it. Same
|
|
102
|
+
convention as virtual-list.styles.ts's own auto-scrolling region. */
|
|
103
|
+
overscroll-behavior: contain;
|
|
104
|
+
padding: var(--lyra-space-m);
|
|
105
|
+
border-block-start: 1px solid var(--lyra-color-border);
|
|
106
|
+
color: var(--lyra-color-text-quiet);
|
|
107
|
+
font-size: 0.875rem;
|
|
108
|
+
line-height: 1.5;
|
|
109
|
+
}
|
|
110
|
+
[part='body'][hidden] {
|
|
111
|
+
display: none;
|
|
112
|
+
}
|
|
113
|
+
@media (prefers-reduced-motion: reduce) {
|
|
114
|
+
[part='toggle'] {
|
|
115
|
+
transition: none !important;
|
|
116
|
+
}
|
|
117
|
+
.pending-dot {
|
|
118
|
+
animation: none !important;
|
|
119
|
+
opacity: 1;
|
|
120
|
+
transform: none;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
`;
|
|
@@ -16,26 +16,72 @@ export interface TimeRangePreset {
|
|
|
16
16
|
* shortcut that sets both handles at once, the continuous brush underneath
|
|
17
17
|
* is unaffected and both interaction modes coexist.
|
|
18
18
|
*
|
|
19
|
+
* Form-associated (via a directly-attached `ElementInternals`, mirroring
|
|
20
|
+
* `<lyra-combobox>`'s minimal pattern rather than the single-string-value
|
|
21
|
+
* `FormAssociated` mixin, which doesn't fit a two-handle range): an ancestor
|
|
22
|
+
* `<fieldset disabled>` disables both handles and every preset button
|
|
23
|
+
* through `effectiveDisabled`, the same way it would a native `<input>`,
|
|
24
|
+
* without touching the consumer-facing `disabled` property/attribute itself.
|
|
25
|
+
*
|
|
19
26
|
* @customElement lyra-time-range
|
|
20
27
|
* @event lyra-input - Fired continuously while dragging or on each arrow-key press. `detail: { start, end }`.
|
|
21
28
|
* @event lyra-change - Fired on release / keyup-commit, or when a preset button is clicked. `detail: { start, end }`.
|
|
22
|
-
* @csspart base
|
|
29
|
+
* @csspart base - The time-range wrapper.
|
|
30
|
+
* @csspart track - The complete range track.
|
|
31
|
+
* @csspart range - The selected range.
|
|
32
|
+
* @csspart handle-start - The start handle.
|
|
33
|
+
* @csspart handle-end - The end handle.
|
|
34
|
+
* @csspart presets - The preset controls wrapper.
|
|
35
|
+
* @csspart preset-button - A preset button.
|
|
23
36
|
*/
|
|
24
37
|
export declare class LyraTimeRange extends LyraElement {
|
|
38
|
+
static formAssociated: boolean;
|
|
25
39
|
static styles: import("lit").CSSResultGroup[];
|
|
40
|
+
static properties: {
|
|
41
|
+
disabled: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
reflect: boolean;
|
|
44
|
+
noAccessor: boolean;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
26
47
|
min: number;
|
|
27
48
|
max: number;
|
|
28
49
|
start: number;
|
|
29
50
|
end: number;
|
|
30
51
|
step: number;
|
|
31
|
-
|
|
52
|
+
/** Accessible name for the start handle, used as its `aria-label`.
|
|
53
|
+
* Overridable for i18n/custom copy; defaults to the same literal text
|
|
54
|
+
* this component always rendered before the property existed. */
|
|
55
|
+
startLabel: string;
|
|
56
|
+
/** Accessible name for the end handle, used as its `aria-label`.
|
|
57
|
+
* Overridable for i18n/custom copy; defaults to the same literal text
|
|
58
|
+
* this component always rendered before the property existed. */
|
|
59
|
+
endLabel: string;
|
|
32
60
|
/**
|
|
33
61
|
* Optional discrete presets rendered as a `[part="presets"]` button row
|
|
34
62
|
* above the track. Purely additive: leaving this empty (the default)
|
|
35
63
|
* renders nothing extra and leaves the continuous brush untouched.
|
|
36
64
|
*/
|
|
37
65
|
presets: TimeRangePreset[];
|
|
66
|
+
private internals;
|
|
67
|
+
private _disabled;
|
|
68
|
+
private _fieldsetDisabled;
|
|
38
69
|
private drags;
|
|
70
|
+
constructor();
|
|
71
|
+
get disabled(): boolean;
|
|
72
|
+
set disabled(next: boolean);
|
|
73
|
+
/** Effective disabled state: this element's own `disabled` OR an ancestor
|
|
74
|
+
* `<fieldset disabled>`'s inherited state -- mirrors native `<input>`,
|
|
75
|
+
* whose own `disabled` IDL property/attribute is never mutated by a
|
|
76
|
+
* fieldset. */
|
|
77
|
+
get effectiveDisabled(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Called by the browser when an ancestor `<fieldset disabled>` toggles.
|
|
80
|
+
* Tracked separately from the consumer's own `disabled` (see
|
|
81
|
+
* `effectiveDisabled`) so a consumer's explicit `disabled` survives the
|
|
82
|
+
* fieldset re-enabling instead of being permanently overwritten.
|
|
83
|
+
*/
|
|
84
|
+
formDisabledCallback(disabled: boolean): void;
|
|
39
85
|
disconnectedCallback(): void;
|
|
40
86
|
private domain;
|
|
41
87
|
private percentOf;
|
|
@@ -50,6 +96,17 @@ export declare class LyraTimeRange extends LyraElement {
|
|
|
50
96
|
/**
|
|
51
97
|
* Apply a discrete preset: sets both handles and emits the same
|
|
52
98
|
* lyra-input/lyra-change pair a committed drag or keyboard step would.
|
|
99
|
+
*
|
|
100
|
+
* Deliberately bypasses `setValue()`/`clamp()` — a preset is an explicit
|
|
101
|
+
* discrete jump to the caller's own exact numbers, not a stepped nudge, so
|
|
102
|
+
* routing it through `clamp()`'s step-grid rounding would silently round
|
|
103
|
+
* a preset's values away from what the caller specified (and desync the
|
|
104
|
+
* active-button match in render(), which compares against these exact
|
|
105
|
+
* numbers). Only the domain bounds and the start<=end invariant apply
|
|
106
|
+
* here, not `step`. Both handles are also assigned before either event
|
|
107
|
+
* fires — routing them through two sequential `setValue()` calls instead
|
|
108
|
+
* would emit an extra lyra-input whose detail still held the stale
|
|
109
|
+
* pre-preset value for whichever handle hadn't been assigned yet.
|
|
53
110
|
*/
|
|
54
111
|
private applyPreset;
|
|
55
112
|
private onKeyDown;
|