@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,77 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
}
|
|
6
|
+
[part='base'] {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: var(--lyra-space-s);
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
-webkit-tap-highlight-color: transparent;
|
|
12
|
+
}
|
|
13
|
+
[part='base']:focus-visible {
|
|
14
|
+
outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
|
|
15
|
+
outline-offset: var(--lyra-focus-ring-offset);
|
|
16
|
+
}
|
|
17
|
+
:host(:disabled) [part='base'] {
|
|
18
|
+
cursor: not-allowed;
|
|
19
|
+
opacity: var(--lyra-opacity-disabled);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[part='box'] {
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
flex: 0 0 auto;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
/* Matches the inline icon-affordance sizing convention used by
|
|
29
|
+
lyra-combobox's clear-button / lyra-select's toggle
|
|
30
|
+
(--lyra-icon-button-size capped at 1.75rem) — a real touch target
|
|
31
|
+
without ballooning to the full 2.5rem meant for standalone
|
|
32
|
+
icon-only buttons. */
|
|
33
|
+
min-inline-size: min(var(--lyra-icon-button-size), 1.75rem);
|
|
34
|
+
min-block-size: min(var(--lyra-icon-button-size), 1.75rem);
|
|
35
|
+
border: 1px solid var(--lyra-color-border);
|
|
36
|
+
border-radius: calc(var(--lyra-radius) * 0.6);
|
|
37
|
+
background: var(--lyra-color-surface);
|
|
38
|
+
color: var(--lyra-color-on-brand);
|
|
39
|
+
transition:
|
|
40
|
+
background-color var(--lyra-transition-fast),
|
|
41
|
+
border-color var(--lyra-transition-fast);
|
|
42
|
+
}
|
|
43
|
+
:host(:not(:disabled)) [part='base']:hover [part='box'] {
|
|
44
|
+
border-color: var(--lyra-color-brand);
|
|
45
|
+
}
|
|
46
|
+
:host([checked]) [part='box'],
|
|
47
|
+
:host([indeterminate]) [part='box'] {
|
|
48
|
+
background: var(--lyra-color-brand);
|
|
49
|
+
border-color: var(--lyra-color-brand);
|
|
50
|
+
}
|
|
51
|
+
/* Gives a required-but-unmet checkbox a persistent visible affordance --
|
|
52
|
+
matching lyra-combobox/lyra-select's data-invalid styling hook --
|
|
53
|
+
beyond the transient native validation-bubble popup, which only shows
|
|
54
|
+
momentarily around reportValidity()/form submission. */
|
|
55
|
+
:host([data-invalid]) [part='box'] {
|
|
56
|
+
border-color: var(--lyra-color-danger);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[part='checkmark'] {
|
|
60
|
+
display: block;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* No explicit "display" here (unlike e.g. lyra-combobox's
|
|
64
|
+
[part='form-control-label']), so the UA stylesheet's default
|
|
65
|
+
"[hidden] { display: none }" rule needs no author-side override to
|
|
66
|
+
take effect when hasLabelSlot is false. */
|
|
67
|
+
[part='label'] {
|
|
68
|
+
font-size: 0.875rem;
|
|
69
|
+
color: var(--lyra-color-text);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@media (prefers-reduced-motion: reduce) {
|
|
73
|
+
[part='box'] {
|
|
74
|
+
transition: none !important;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
3
|
+
export interface ChipGroupOverflowToggleDetail {
|
|
4
|
+
expanded: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* `<lyra-chip-group>` — a flex-wrap container for a set of `<lyra-chip>`
|
|
8
|
+
* children (plain light-DOM composition — direct children are the chips,
|
|
9
|
+
* the same shape `<lyra-split>`'s panels / `<lyra-source-list>`'s cards
|
|
10
|
+
* take — no `.items` array prop).
|
|
11
|
+
*
|
|
12
|
+
* `max-visible` is entirely optional. When unset, every child is always
|
|
13
|
+
* shown and this component does nothing beyond flex-wrap layout. When set
|
|
14
|
+
* and the group has more chip children than that, the excess children are
|
|
15
|
+
* hidden (via their own `hidden` property — CSS alone can't parameterize
|
|
16
|
+
* `:nth-child` on a runtime prop, so this reaches into the light DOM the
|
|
17
|
+
* same way `<lyra-split>` sets each panel's inline `flex`/`order`) and a
|
|
18
|
+
* "+N" overflow-indicator pill takes their place. Clicking it is a toggle:
|
|
19
|
+
* it reveals the rest (and relabels itself "Show less"); clicking again
|
|
20
|
+
* re-collapses back to `max-visible`. `lyra-overflow-toggle` fires only from
|
|
21
|
+
* that click — i.e. only when `max-visible` is actually causing an overflow
|
|
22
|
+
* state — never as a side effect of `max-visible`/children changing on
|
|
23
|
+
* their own.
|
|
24
|
+
*
|
|
25
|
+
* @customElement lyra-chip-group
|
|
26
|
+
* @slot - `<lyra-chip>` elements (or any content, though the chip pairing is
|
|
27
|
+
* the intended usage).
|
|
28
|
+
* @event lyra-overflow-toggle - The overflow indicator was activated,
|
|
29
|
+
* revealing or re-collapsing the excess children. `detail: { expanded }`.
|
|
30
|
+
* @csspart base - The flex-wrap container (holds both the slot and the overflow indicator).
|
|
31
|
+
* @csspart overflow-indicator - The "+N" / "Show less" toggle button. Only rendered while `max-visible` is actively causing an overflow.
|
|
32
|
+
*/
|
|
33
|
+
export declare class LyraChipGroup extends LyraElement {
|
|
34
|
+
static styles: import("lit").CSSResultGroup[];
|
|
35
|
+
/** Maximum number of direct children shown before the rest collapse behind
|
|
36
|
+
* a "+N" indicator. Unset (the default) means no limit — every child is
|
|
37
|
+
* always shown. */
|
|
38
|
+
maxVisible?: number;
|
|
39
|
+
private childCount;
|
|
40
|
+
/** Whether the excess (beyond `max-visible`) children are currently
|
|
41
|
+
* revealed. Meaningless (and never rendered) while there's no overflow. */
|
|
42
|
+
private expanded;
|
|
43
|
+
protected willUpdate(): void;
|
|
44
|
+
firstUpdated(): void;
|
|
45
|
+
protected updated(): void;
|
|
46
|
+
private get hasOverflow();
|
|
47
|
+
private syncChildVisibility;
|
|
48
|
+
private onSlotChange;
|
|
49
|
+
private onToggleOverflow;
|
|
50
|
+
render(): TemplateResult;
|
|
51
|
+
}
|
|
52
|
+
declare global {
|
|
53
|
+
interface HTMLElementTagNameMap {
|
|
54
|
+
'lyra-chip-group': LyraChipGroup;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, nothing } from 'lit';
|
|
8
|
+
import { property, state } from 'lit/decorators.js';
|
|
9
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
10
|
+
import { defineElement } from '../../internal/prefix.js';
|
|
11
|
+
import { styles } from './chip-group.styles.js';
|
|
12
|
+
/**
|
|
13
|
+
* `<lyra-chip-group>` — a flex-wrap container for a set of `<lyra-chip>`
|
|
14
|
+
* children (plain light-DOM composition — direct children are the chips,
|
|
15
|
+
* the same shape `<lyra-split>`'s panels / `<lyra-source-list>`'s cards
|
|
16
|
+
* take — no `.items` array prop).
|
|
17
|
+
*
|
|
18
|
+
* `max-visible` is entirely optional. When unset, every child is always
|
|
19
|
+
* shown and this component does nothing beyond flex-wrap layout. When set
|
|
20
|
+
* and the group has more chip children than that, the excess children are
|
|
21
|
+
* hidden (via their own `hidden` property — CSS alone can't parameterize
|
|
22
|
+
* `:nth-child` on a runtime prop, so this reaches into the light DOM the
|
|
23
|
+
* same way `<lyra-split>` sets each panel's inline `flex`/`order`) and a
|
|
24
|
+
* "+N" overflow-indicator pill takes their place. Clicking it is a toggle:
|
|
25
|
+
* it reveals the rest (and relabels itself "Show less"); clicking again
|
|
26
|
+
* re-collapses back to `max-visible`. `lyra-overflow-toggle` fires only from
|
|
27
|
+
* that click — i.e. only when `max-visible` is actually causing an overflow
|
|
28
|
+
* state — never as a side effect of `max-visible`/children changing on
|
|
29
|
+
* their own.
|
|
30
|
+
*
|
|
31
|
+
* @customElement lyra-chip-group
|
|
32
|
+
* @slot - `<lyra-chip>` elements (or any content, though the chip pairing is
|
|
33
|
+
* the intended usage).
|
|
34
|
+
* @event lyra-overflow-toggle - The overflow indicator was activated,
|
|
35
|
+
* revealing or re-collapsing the excess children. `detail: { expanded }`.
|
|
36
|
+
* @csspart base - The flex-wrap container (holds both the slot and the overflow indicator).
|
|
37
|
+
* @csspart overflow-indicator - The "+N" / "Show less" toggle button. Only rendered while `max-visible` is actively causing an overflow.
|
|
38
|
+
*/
|
|
39
|
+
export class LyraChipGroup extends LyraElement {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
// Tracks the default slot's assigned-element count, the same
|
|
43
|
+
// connectedCallback/willUpdate + slotchange convention `<lyra-split>`'s
|
|
44
|
+
// `panelCount`/`<lyra-source-list>`'s `slottedCount` already establish.
|
|
45
|
+
this.childCount = 0;
|
|
46
|
+
/** Whether the excess (beyond `max-visible`) children are currently
|
|
47
|
+
* revealed. Meaningless (and never rendered) while there's no overflow. */
|
|
48
|
+
this.expanded = false;
|
|
49
|
+
this.onSlotChange = (e) => {
|
|
50
|
+
this.childCount = e.target.assignedElements({ flatten: true }).length;
|
|
51
|
+
};
|
|
52
|
+
this.onToggleOverflow = () => {
|
|
53
|
+
this.expanded = !this.expanded;
|
|
54
|
+
this.emit('lyra-overflow-toggle', { expanded: this.expanded });
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
static { this.styles = [LyraElement.styles, styles]; }
|
|
58
|
+
willUpdate() {
|
|
59
|
+
if (!this.hasUpdated) {
|
|
60
|
+
this.childCount = this.children.length;
|
|
61
|
+
}
|
|
62
|
+
// max-visible/children can change out from under an already-expanded
|
|
63
|
+
// group (e.g. the consumer raises max-visible past the current count) —
|
|
64
|
+
// silently resync rather than leaving `expanded` stuck true with nothing
|
|
65
|
+
// left for it to mean. This never fires the event: only an actual click
|
|
66
|
+
// on the indicator does (see the class doc). Corrected here (not in
|
|
67
|
+
// `updated()`) so it folds into the update already in progress instead
|
|
68
|
+
// of scheduling a second one.
|
|
69
|
+
if (this.expanded && !this.hasOverflow)
|
|
70
|
+
this.expanded = false;
|
|
71
|
+
}
|
|
72
|
+
firstUpdated() {
|
|
73
|
+
// Fallback reconciliation for slot-forwarding / engines that don't fire
|
|
74
|
+
// `slotchange` for content present at parse time — same idiom as
|
|
75
|
+
// `<lyra-source-list>`'s identical `firstUpdated`. This can't move to
|
|
76
|
+
// `willUpdate` (the `<slot>` doesn't exist in the shadow DOM until after
|
|
77
|
+
// the first render), so when it actually corrects `childCount` (the
|
|
78
|
+
// slot-forwarding case, where `this.children.length` under-counts) it
|
|
79
|
+
// unavoidably schedules a second update pass — `updated()` (below) always
|
|
80
|
+
// runs right after this and already recomputes visibility from this same
|
|
81
|
+
// corrected count, so there's nothing left for an explicit call here to
|
|
82
|
+
// do.
|
|
83
|
+
const slot = this.shadowRoot.querySelector('slot');
|
|
84
|
+
this.childCount = slot.assignedElements({ flatten: true }).length;
|
|
85
|
+
}
|
|
86
|
+
updated() {
|
|
87
|
+
this.syncChildVisibility();
|
|
88
|
+
}
|
|
89
|
+
get hasOverflow() {
|
|
90
|
+
const max = this.maxVisible;
|
|
91
|
+
return max != null && Number.isFinite(max) && max >= 0 && this.childCount > max;
|
|
92
|
+
}
|
|
93
|
+
syncChildVisibility() {
|
|
94
|
+
const max = this.maxVisible;
|
|
95
|
+
const overflowing = this.hasOverflow;
|
|
96
|
+
Array.from(this.children).forEach((child, i) => {
|
|
97
|
+
child.hidden = overflowing && !this.expanded && i >= max;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
render() {
|
|
101
|
+
const overflowing = this.hasOverflow;
|
|
102
|
+
const hiddenCount = overflowing ? this.childCount - this.maxVisible : 0;
|
|
103
|
+
return html `
|
|
104
|
+
<div part="base">
|
|
105
|
+
<slot @slotchange=${this.onSlotChange}></slot>
|
|
106
|
+
${overflowing
|
|
107
|
+
? html `<button
|
|
108
|
+
part="overflow-indicator"
|
|
109
|
+
type="button"
|
|
110
|
+
aria-expanded=${this.expanded ? 'true' : 'false'}
|
|
111
|
+
aria-label=${this.expanded ? 'Show less' : `Show ${hiddenCount} more`}
|
|
112
|
+
@click=${this.onToggleOverflow}
|
|
113
|
+
>
|
|
114
|
+
${this.expanded ? 'Show less' : `+${hiddenCount}`}
|
|
115
|
+
</button>`
|
|
116
|
+
: nothing}
|
|
117
|
+
</div>
|
|
118
|
+
`;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
__decorate([
|
|
122
|
+
property({ type: Number, attribute: 'max-visible' })
|
|
123
|
+
], LyraChipGroup.prototype, "maxVisible", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
state()
|
|
126
|
+
], LyraChipGroup.prototype, "childCount", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
state()
|
|
129
|
+
], LyraChipGroup.prototype, "expanded", void 0);
|
|
130
|
+
defineElement('chip-group', LyraChipGroup);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
[part='base'] {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-wrap: wrap;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: var(--lyra-space-xs);
|
|
11
|
+
}
|
|
12
|
+
/* Deliberately its own local pill styling rather than instantiating a
|
|
13
|
+
real <lyra-chip> in the shadow DOM for this -- keeps the group's
|
|
14
|
+
rendering self-contained instead of depending on chip.ts's internal
|
|
15
|
+
shape, the same way this family's overlay-shaped components duplicate
|
|
16
|
+
rather than nest one another. */
|
|
17
|
+
[part='overflow-indicator'] {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
padding: 0.25rem var(--lyra-space-s);
|
|
22
|
+
border: 1px dashed var(--lyra-color-border);
|
|
23
|
+
border-radius: 999px;
|
|
24
|
+
background: var(--lyra-color-surface);
|
|
25
|
+
color: var(--lyra-color-text-quiet);
|
|
26
|
+
font: inherit;
|
|
27
|
+
font-size: 0.8125rem;
|
|
28
|
+
font-weight: 600;
|
|
29
|
+
line-height: 1.3;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
-webkit-tap-highlight-color: transparent;
|
|
32
|
+
transition:
|
|
33
|
+
background-color var(--lyra-transition-fast),
|
|
34
|
+
border-color var(--lyra-transition-fast),
|
|
35
|
+
color var(--lyra-transition-fast);
|
|
36
|
+
}
|
|
37
|
+
/* Dashed border marks it as a structural "more" affordance, distinct at a
|
|
38
|
+
glance from the solid-bordered real chips it sits alongside. */
|
|
39
|
+
[part='overflow-indicator']:hover {
|
|
40
|
+
border-color: var(--lyra-color-brand);
|
|
41
|
+
color: var(--lyra-color-text);
|
|
42
|
+
}
|
|
43
|
+
[part='overflow-indicator']:focus-visible {
|
|
44
|
+
outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
|
|
45
|
+
outline-offset: var(--lyra-focus-ring-offset);
|
|
46
|
+
}
|
|
47
|
+
[part='overflow-indicator'][aria-expanded='true'] {
|
|
48
|
+
border-style: solid;
|
|
49
|
+
color: var(--lyra-color-text);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media (prefers-reduced-motion: reduce) {
|
|
53
|
+
[part='overflow-indicator'] {
|
|
54
|
+
transition: none !important;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
3
|
+
export type ChipTone = 'neutral' | 'brand' | 'success' | 'warning' | 'danger';
|
|
4
|
+
export interface ChipRemoveDetail {
|
|
5
|
+
value?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* `<lyra-chip>` — a small, content-agnostic pill for a short label: a tag, an
|
|
9
|
+
* active-filter/scope indicator, etc. Distinct from `<lyra-attachment-chip>`
|
|
10
|
+
* (specifically file-shaped, with a thumbnail/size/upload-progress) — this
|
|
11
|
+
* one carries no domain assumptions at all, just a label and an optional
|
|
12
|
+
* leading icon/dot.
|
|
13
|
+
*
|
|
14
|
+
* `tone` tints the whole pill using the same loud-color-on-quiet-tint
|
|
15
|
+
* convention `<lyra-tool-call-chip>`/`<lyra-citation-badge>` already
|
|
16
|
+
* establish for status coloring: background is the tone's `-quiet` tint,
|
|
17
|
+
* text/icon is the tone's loud color. `neutral` (the default) has no
|
|
18
|
+
* dedicated token pair of its own, so it falls back to a plain
|
|
19
|
+
* bordered-surface look — the same "no signal" treatment
|
|
20
|
+
* `<lyra-citation-badge>`'s `default` status and `<lyra-tool-call-chip>`'s
|
|
21
|
+
* `pending` status already use.
|
|
22
|
+
*
|
|
23
|
+
* This is a controlled component: clicking the remove (×) button only fires
|
|
24
|
+
* `lyra-remove` — the chip never removes itself from the DOM on its own
|
|
25
|
+
* interaction, the same contract `<lyra-attachment-chip>`/
|
|
26
|
+
* `<lyra-conversation-item>` already follow. A consumer owns the underlying
|
|
27
|
+
* list and decides whether/how the click actually removes anything.
|
|
28
|
+
*
|
|
29
|
+
* @customElement lyra-chip
|
|
30
|
+
* @slot - The chip's label content.
|
|
31
|
+
* @slot icon - Optional leading icon or status dot. Nothing is reserved for
|
|
32
|
+
* it (no extra gap) when left empty.
|
|
33
|
+
* @event lyra-remove - The remove (×) button was activated (click, or
|
|
34
|
+
* Enter/Space while focused — native `<button>` behavior). `detail: { value }`
|
|
35
|
+
* — `value` is `undefined` when the `value` prop was never set. Only
|
|
36
|
+
* rendered while `removable`.
|
|
37
|
+
* @csspart base - The pill's root container.
|
|
38
|
+
* @csspart icon - Wrapper around the `icon` slot. Hidden entirely while empty.
|
|
39
|
+
* @csspart label - Wrapper around the default slot.
|
|
40
|
+
* @csspart remove-button - The remove (×) affordance, only rendered while `removable`.
|
|
41
|
+
*/
|
|
42
|
+
export declare class LyraChip extends LyraElement {
|
|
43
|
+
static styles: import("lit").CSSResultGroup[];
|
|
44
|
+
/** Status/emphasis color. `neutral` (the default) reads as plain/unstyled. */
|
|
45
|
+
tone: ChipTone;
|
|
46
|
+
/** Shows the remove (×) button. */
|
|
47
|
+
removable: boolean;
|
|
48
|
+
/** Opaque consumer bookkeeping value — never read, validated, or rendered
|
|
49
|
+
* by this component itself, only ever echoed back verbatim (including
|
|
50
|
+
* `undefined` if never set) in `lyra-remove`'s detail. */
|
|
51
|
+
value?: string;
|
|
52
|
+
private hasIconSlot;
|
|
53
|
+
protected willUpdate(): void;
|
|
54
|
+
private onIconSlotChange;
|
|
55
|
+
private get labelText();
|
|
56
|
+
private get accessibleRemoveLabel();
|
|
57
|
+
private onRemoveClick;
|
|
58
|
+
render(): TemplateResult;
|
|
59
|
+
}
|
|
60
|
+
declare global {
|
|
61
|
+
interface HTMLElementTagNameMap {
|
|
62
|
+
'lyra-chip': LyraChip;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, nothing } from 'lit';
|
|
8
|
+
import { property, state } from 'lit/decorators.js';
|
|
9
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
10
|
+
import { defineElement } from '../../internal/prefix.js';
|
|
11
|
+
import { closeIcon } from '../../internal/icons.js';
|
|
12
|
+
import { styles } from './chip.styles.js';
|
|
13
|
+
/**
|
|
14
|
+
* `<lyra-chip>` — a small, content-agnostic pill for a short label: a tag, an
|
|
15
|
+
* active-filter/scope indicator, etc. Distinct from `<lyra-attachment-chip>`
|
|
16
|
+
* (specifically file-shaped, with a thumbnail/size/upload-progress) — this
|
|
17
|
+
* one carries no domain assumptions at all, just a label and an optional
|
|
18
|
+
* leading icon/dot.
|
|
19
|
+
*
|
|
20
|
+
* `tone` tints the whole pill using the same loud-color-on-quiet-tint
|
|
21
|
+
* convention `<lyra-tool-call-chip>`/`<lyra-citation-badge>` already
|
|
22
|
+
* establish for status coloring: background is the tone's `-quiet` tint,
|
|
23
|
+
* text/icon is the tone's loud color. `neutral` (the default) has no
|
|
24
|
+
* dedicated token pair of its own, so it falls back to a plain
|
|
25
|
+
* bordered-surface look — the same "no signal" treatment
|
|
26
|
+
* `<lyra-citation-badge>`'s `default` status and `<lyra-tool-call-chip>`'s
|
|
27
|
+
* `pending` status already use.
|
|
28
|
+
*
|
|
29
|
+
* This is a controlled component: clicking the remove (×) button only fires
|
|
30
|
+
* `lyra-remove` — the chip never removes itself from the DOM on its own
|
|
31
|
+
* interaction, the same contract `<lyra-attachment-chip>`/
|
|
32
|
+
* `<lyra-conversation-item>` already follow. A consumer owns the underlying
|
|
33
|
+
* list and decides whether/how the click actually removes anything.
|
|
34
|
+
*
|
|
35
|
+
* @customElement lyra-chip
|
|
36
|
+
* @slot - The chip's label content.
|
|
37
|
+
* @slot icon - Optional leading icon or status dot. Nothing is reserved for
|
|
38
|
+
* it (no extra gap) when left empty.
|
|
39
|
+
* @event lyra-remove - The remove (×) button was activated (click, or
|
|
40
|
+
* Enter/Space while focused — native `<button>` behavior). `detail: { value }`
|
|
41
|
+
* — `value` is `undefined` when the `value` prop was never set. Only
|
|
42
|
+
* rendered while `removable`.
|
|
43
|
+
* @csspart base - The pill's root container.
|
|
44
|
+
* @csspart icon - Wrapper around the `icon` slot. Hidden entirely while empty.
|
|
45
|
+
* @csspart label - Wrapper around the default slot.
|
|
46
|
+
* @csspart remove-button - The remove (×) affordance, only rendered while `removable`.
|
|
47
|
+
*/
|
|
48
|
+
export class LyraChip extends LyraElement {
|
|
49
|
+
constructor() {
|
|
50
|
+
super(...arguments);
|
|
51
|
+
/** Status/emphasis color. `neutral` (the default) reads as plain/unstyled. */
|
|
52
|
+
this.tone = 'neutral';
|
|
53
|
+
/** Shows the remove (×) button. */
|
|
54
|
+
this.removable = false;
|
|
55
|
+
// A `[part]` always contains a literal `<slot>` child regardless of
|
|
56
|
+
// assigned content, so `:empty` never matches — real emptiness is tracked
|
|
57
|
+
// in JS instead, the same fix `<lyra-stat>`'s `hasIcon`/
|
|
58
|
+
// `<lyra-tool-call-chip>`'s `hasDetailSlot` etc. already establish.
|
|
59
|
+
this.hasIconSlot = false;
|
|
60
|
+
this.onIconSlotChange = (e) => {
|
|
61
|
+
this.hasIconSlot = e.target.assignedElements({ flatten: true }).length > 0;
|
|
62
|
+
};
|
|
63
|
+
this.onRemoveClick = () => {
|
|
64
|
+
this.emit('lyra-remove', { value: this.value });
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
static { this.styles = [LyraElement.styles, styles]; }
|
|
68
|
+
willUpdate() {
|
|
69
|
+
if (!this.hasUpdated) {
|
|
70
|
+
this.hasIconSlot = Array.from(this.children).some((el) => el.getAttribute('slot') === 'icon');
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Only the default slot's own content counts toward the remove button's
|
|
74
|
+
// accessible name — text incidentally living inside the (decorative)
|
|
75
|
+
// `icon` slot shouldn't leak into "Remove {text}". Restricting to Text and
|
|
76
|
+
// Element nodes also excludes Comment nodes: when a consumer interpolates
|
|
77
|
+
// the label via a lit-html expression (`html\`<lyra-chip>${label}</lyra-chip>\``,
|
|
78
|
+
// the ordinary way a data-driven label gets bound) rather than a static
|
|
79
|
+
// string, lit-html inserts a marker Comment node alongside the Text node in
|
|
80
|
+
// the light DOM. That comment's own (non-empty) data is internal
|
|
81
|
+
// bookkeeping, not label content, so it must never reach `textContent`.
|
|
82
|
+
get labelText() {
|
|
83
|
+
return Array.from(this.childNodes)
|
|
84
|
+
.filter((n) => (n.nodeType === Node.TEXT_NODE || n instanceof Element) &&
|
|
85
|
+
!(n instanceof Element && n.getAttribute('slot') === 'icon'))
|
|
86
|
+
.map((n) => n.textContent ?? '')
|
|
87
|
+
.join('')
|
|
88
|
+
.trim();
|
|
89
|
+
}
|
|
90
|
+
get accessibleRemoveLabel() {
|
|
91
|
+
const text = this.labelText;
|
|
92
|
+
return text ? `Remove ${text}` : 'Remove';
|
|
93
|
+
}
|
|
94
|
+
render() {
|
|
95
|
+
return html `
|
|
96
|
+
<span part="base">
|
|
97
|
+
<span part="icon" aria-hidden="true" ?hidden=${!this.hasIconSlot}>
|
|
98
|
+
<slot name="icon" @slotchange=${this.onIconSlotChange}></slot>
|
|
99
|
+
</span>
|
|
100
|
+
<span part="label"><slot></slot></span>
|
|
101
|
+
${this.removable
|
|
102
|
+
? html `<button part="remove-button" type="button" aria-label=${this.accessibleRemoveLabel} @click=${this.onRemoveClick}>
|
|
103
|
+
${closeIcon()}
|
|
104
|
+
</button>`
|
|
105
|
+
: nothing}
|
|
106
|
+
</span>
|
|
107
|
+
`;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
__decorate([
|
|
111
|
+
property({ reflect: true })
|
|
112
|
+
], LyraChip.prototype, "tone", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ type: Boolean, reflect: true })
|
|
115
|
+
], LyraChip.prototype, "removable", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property()
|
|
118
|
+
], LyraChip.prototype, "value", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
state()
|
|
121
|
+
], LyraChip.prototype, "hasIconSlot", void 0);
|
|
122
|
+
defineElement('chip', LyraChip);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
max-inline-size: 100%;
|
|
6
|
+
vertical-align: middle;
|
|
7
|
+
/* One custom-property trio swapped by the :host([tone]) rules below,
|
|
8
|
+
rather than repeating background/color/border per part per tone —
|
|
9
|
+
mirrors lyra-tool-call-chip's/lyra-attachment-chip's identical
|
|
10
|
+
-accent/-bg/-border trio so a chip's tone vocabulary reads the same
|
|
11
|
+
everywhere in the library. 'neutral' has no dedicated token pair (see
|
|
12
|
+
the class doc), so it falls back to plain surface/border/text instead
|
|
13
|
+
of inventing a sixth tint. */
|
|
14
|
+
--lyra-chip-accent: var(--lyra-color-text);
|
|
15
|
+
--lyra-chip-bg: var(--lyra-color-surface);
|
|
16
|
+
--lyra-chip-border: var(--lyra-color-border);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([tone='brand']) {
|
|
20
|
+
--lyra-chip-accent: var(--lyra-color-brand);
|
|
21
|
+
--lyra-chip-bg: var(--lyra-color-brand-quiet);
|
|
22
|
+
--lyra-chip-border: transparent;
|
|
23
|
+
}
|
|
24
|
+
:host([tone='success']) {
|
|
25
|
+
--lyra-chip-accent: var(--lyra-color-success);
|
|
26
|
+
--lyra-chip-bg: var(--lyra-color-success-quiet);
|
|
27
|
+
--lyra-chip-border: transparent;
|
|
28
|
+
}
|
|
29
|
+
:host([tone='warning']) {
|
|
30
|
+
--lyra-chip-accent: var(--lyra-color-warning);
|
|
31
|
+
--lyra-chip-bg: var(--lyra-color-warning-quiet);
|
|
32
|
+
--lyra-chip-border: transparent;
|
|
33
|
+
}
|
|
34
|
+
:host([tone='danger']) {
|
|
35
|
+
--lyra-chip-accent: var(--lyra-color-danger);
|
|
36
|
+
--lyra-chip-bg: var(--lyra-color-danger-quiet);
|
|
37
|
+
--lyra-chip-border: transparent;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[part='base'] {
|
|
41
|
+
display: inline-flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: var(--lyra-space-xs);
|
|
44
|
+
max-inline-size: 100%;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
padding: 0.25rem var(--lyra-space-s);
|
|
47
|
+
border: 1px solid var(--lyra-chip-border);
|
|
48
|
+
border-radius: 999px;
|
|
49
|
+
background: var(--lyra-chip-bg);
|
|
50
|
+
color: var(--lyra-chip-accent);
|
|
51
|
+
font: inherit;
|
|
52
|
+
font-size: 0.8125rem;
|
|
53
|
+
font-weight: 500;
|
|
54
|
+
line-height: 1.3;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
[part='icon'] {
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
flex: 0 0 auto;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
}
|
|
63
|
+
[part='icon'] ::slotted(*) {
|
|
64
|
+
display: block;
|
|
65
|
+
}
|
|
66
|
+
/* Defeats [part='icon']'s own 'display: inline-flex' above -- the native
|
|
67
|
+
[hidden] UA rule alone would lose to it at equal specificity. Same fix
|
|
68
|
+
lyra-stat's identical [part='icon'][hidden] override already applies. */
|
|
69
|
+
[part='icon'][hidden] {
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
[part='label'] {
|
|
74
|
+
flex: 1 1 auto;
|
|
75
|
+
min-inline-size: 0;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
text-overflow: ellipsis;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[part='remove-button'] {
|
|
82
|
+
flex: 0 0 auto;
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
min-inline-size: min(var(--lyra-icon-button-size), 1.25rem);
|
|
87
|
+
min-block-size: min(var(--lyra-icon-button-size), 1.25rem);
|
|
88
|
+
margin-inline-end: -0.15rem;
|
|
89
|
+
padding: 0;
|
|
90
|
+
border: none;
|
|
91
|
+
border-radius: 999px;
|
|
92
|
+
background: transparent;
|
|
93
|
+
color: inherit;
|
|
94
|
+
font-size: 0.75em;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
-webkit-tap-highlight-color: transparent;
|
|
97
|
+
transition: background-color var(--lyra-transition-fast);
|
|
98
|
+
}
|
|
99
|
+
[part='remove-button']:hover {
|
|
100
|
+
background: color-mix(in srgb, currentColor 16%, transparent);
|
|
101
|
+
}
|
|
102
|
+
[part='remove-button']:focus-visible {
|
|
103
|
+
outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
|
|
104
|
+
outline-offset: var(--lyra-focus-ring-offset);
|
|
105
|
+
}
|
|
106
|
+
[part='remove-button'] svg {
|
|
107
|
+
display: block;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@media (prefers-reduced-motion: reduce) {
|
|
111
|
+
[part='remove-button'] {
|
|
112
|
+
transition: none !important;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
`;
|