@aceshooting/lyra-ui 1.1.0 → 2.0.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 +12 -1
- package/custom-elements.json +21460 -8489
- package/dist/components/app-rail/app-rail.d.ts +171 -0
- package/dist/components/app-rail/app-rail.js +483 -0
- package/dist/components/app-rail/app-rail.styles.d.ts +1 -0
- package/dist/components/app-rail/app-rail.styles.js +125 -0
- package/dist/components/attachment-chip/attachment-chip.d.ts +114 -0
- package/dist/components/attachment-chip/attachment-chip.js +312 -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 +83 -0
- package/dist/components/attachment-trigger/attachment-trigger.js +258 -0
- package/dist/components/attachment-trigger/attachment-trigger.styles.d.ts +1 -0
- package/dist/components/attachment-trigger/attachment-trigger.styles.js +68 -0
- package/dist/components/chart/box-plot.js +11 -1
- 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 +12 -2
- package/dist/components/chart/chart.js +121 -14
- package/dist/components/chart/histogram-bin.d.ts +4 -1
- package/dist/components/chart/histogram-bin.js +24 -14
- package/dist/components/chart/lite-chart.d.ts +63 -0
- package/dist/components/chart/lite-chart.js +181 -23
- package/dist/components/chart/lite-chart.styles.js +9 -0
- package/dist/components/chat-composer/chat-composer.d.ts +92 -0
- package/dist/components/chat-composer/chat-composer.js +285 -0
- package/dist/components/chat-composer/chat-composer.styles.d.ts +1 -0
- package/dist/components/chat-composer/chat-composer.styles.js +135 -0
- package/dist/components/chat-message/chat-message.d.ts +113 -0
- package/dist/components/chat-message/chat-message.js +291 -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 +59 -0
- package/dist/components/checkbox/checkbox.js +230 -0
- package/dist/components/checkbox/checkbox.styles.d.ts +1 -0
- package/dist/components/checkbox/checkbox.styles.js +70 -0
- package/dist/components/chip/chip-group.d.ts +56 -0
- package/dist/components/chip/chip-group.js +124 -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 +115 -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 +300 -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 +89 -0
- package/dist/components/code-block/code-block.js +317 -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 +44 -0
- package/dist/components/code-block/code-loader.js +79 -0
- package/dist/components/combobox/combobox.d.ts +19 -1
- package/dist/components/combobox/combobox.js +84 -14
- 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 +150 -0
- package/dist/components/context-meter/context-meter.styles.d.ts +1 -0
- package/dist/components/context-meter/context-meter.styles.js +120 -0
- package/dist/components/conversation-item/conversation-item.d.ts +128 -0
- package/dist/components/conversation-item/conversation-item.js +322 -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/date-input.d.ts +24 -0
- package/dist/components/date-picker/date-input.js +134 -22
- package/dist/components/date-picker/date-picker.d.ts +7 -0
- package/dist/components/date-picker/date-picker.js +85 -16
- package/dist/components/dialog/confirm.d.ts +40 -0
- package/dist/components/dialog/confirm.js +79 -0
- package/dist/components/dialog/dialog.d.ts +85 -0
- package/dist/components/dialog/dialog.js +272 -0
- package/dist/components/dialog/dialog.styles.d.ts +1 -0
- package/dist/components/dialog/dialog.styles.js +52 -0
- package/dist/components/dock-panel/dock-panel.d.ts +134 -0
- package/dist/components/dock-panel/dock-panel.js +345 -0
- package/dist/components/dock-panel/dock-panel.styles.d.ts +1 -0
- package/dist/components/dock-panel/dock-panel.styles.js +145 -0
- package/dist/components/document-preview/document-preview.d.ts +135 -0
- package/dist/components/document-preview/document-preview.js +372 -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/export-button/csv.js +1 -1
- package/dist/components/export-button/export-button.js +2 -0
- package/dist/components/flag/flag.d.ts +42 -5
- package/dist/components/flag/flag.js +70 -3
- package/dist/components/gauge/gauge.js +19 -10
- package/dist/components/generation-status/generation-status.d.ts +109 -0
- package/dist/components/generation-status/generation-status.js +273 -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/heatmap/calendar-grid.d.ts +4 -1
- package/dist/components/heatmap/calendar-grid.js +25 -12
- package/dist/components/heatmap/heatmap-scale.d.ts +6 -0
- package/dist/components/heatmap/heatmap-scale.js +7 -1
- package/dist/components/heatmap/heatmap.d.ts +89 -3
- package/dist/components/heatmap/heatmap.js +158 -29
- package/dist/components/json-viewer/json-viewer.d.ts +53 -0
- package/dist/components/json-viewer/json-viewer.js +283 -0
- package/dist/components/json-viewer/json-viewer.styles.d.ts +1 -0
- package/dist/components/json-viewer/json-viewer.styles.js +176 -0
- package/dist/components/kbd/kbd.d.ts +77 -0
- package/dist/components/kbd/kbd.js +214 -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 +81 -0
- package/dist/components/live-region/live-region.js +153 -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 +8 -6
- package/dist/components/map/map.js +44 -8
- package/dist/components/markdown/markdown-loader.d.ts +34 -0
- package/dist/components/markdown/markdown-loader.js +43 -0
- package/dist/components/markdown/markdown.d.ts +81 -0
- package/dist/components/markdown/markdown.js +284 -0
- package/dist/components/markdown/markdown.styles.d.ts +1 -0
- package/dist/components/markdown/markdown.styles.js +82 -0
- package/dist/components/media-card/media-card.d.ts +122 -0
- package/dist/components/media-card/media-card.js +295 -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 +200 -0
- package/dist/components/mention-popover/mention-popover.js +475 -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 +62 -0
- package/dist/components/menu/menu-item.js +119 -0
- package/dist/components/menu/menu-item.styles.d.ts +1 -0
- package/dist/components/menu/menu-item.styles.js +67 -0
- package/dist/components/menu/menu.d.ts +143 -0
- package/dist/components/menu/menu.js +365 -0
- package/dist/components/menu/menu.styles.d.ts +1 -0
- package/dist/components/menu/menu.styles.js +66 -0
- package/dist/components/model-select/model-select.d.ts +125 -0
- package/dist/components/model-select/model-select.js +490 -0
- package/dist/components/model-select/model-select.styles.d.ts +1 -0
- package/dist/components/model-select/model-select.styles.js +189 -0
- package/dist/components/model-settings-panel/model-settings-panel.d.ts +69 -0
- package/dist/components/model-settings-panel/model-settings-panel.js +145 -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 +13 -1
- package/dist/components/playback/playback.js +47 -14
- package/dist/components/responsive-panel/responsive-panel.d.ts +150 -0
- package/dist/components/responsive-panel/responsive-panel.js +365 -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 +44 -0
- package/dist/components/result-card/result-card.js +83 -0
- package/dist/components/result-card/result-card.styles.d.ts +1 -0
- package/dist/components/result-card/result-card.styles.js +50 -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 +45 -1
- package/dist/components/select/select.js +114 -17
- package/dist/components/select/select.styles.js +26 -2
- package/dist/components/slider/slider.d.ts +89 -0
- package/dist/components/slider/slider.js +352 -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 +92 -0
- package/dist/components/source-card/source-card.js +148 -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 +122 -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 +27 -13
- package/dist/components/split/split.d.ts +93 -1
- package/dist/components/split/split.js +284 -15
- package/dist/components/split/split.styles.js +30 -0
- package/dist/components/stat/stat.d.ts +22 -1
- package/dist/components/stat/stat.js +49 -3
- package/dist/components/stat/stat.styles.js +20 -0
- package/dist/components/stream-status/stream-status.d.ts +110 -0
- package/dist/components/stream-status/stream-status.js +210 -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 +98 -0
- package/dist/components/streaming-text/streaming-text.js +209 -0
- package/dist/components/streaming-text/streaming-text.styles.d.ts +1 -0
- package/dist/components/streaming-text/streaming-text.styles.js +62 -0
- package/dist/components/switch/switch.d.ts +58 -0
- package/dist/components/switch/switch.js +179 -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 +73 -4
- package/dist/components/table/table.js +169 -20
- package/dist/components/table/table.styles.js +6 -1
- package/dist/components/tabs/tabs.d.ts +51 -0
- package/dist/components/tabs/tabs.js +190 -0
- package/dist/components/tabs/tabs.styles.d.ts +1 -0
- package/dist/components/tabs/tabs.styles.js +63 -0
- package/dist/components/thinking-panel/thinking-panel.d.ts +121 -0
- package/dist/components/thinking-panel/thinking-panel.js +235 -0
- package/dist/components/thinking-panel/thinking-panel.styles.d.ts +1 -0
- package/dist/components/thinking-panel/thinking-panel.styles.js +117 -0
- package/dist/components/toast/toast-item.d.ts +1 -0
- package/dist/components/toast/toast-item.js +31 -6
- package/dist/components/tool-approval-dialog/tool-approval-dialog.d.ts +130 -0
- package/dist/components/tool-approval-dialog/tool-approval-dialog.js +403 -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 +89 -0
- package/dist/components/tool-call-chip/tool-call-chip.js +288 -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 +145 -0
- package/dist/components/tool-param-form/tool-param-form.js +366 -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 +102 -0
- package/dist/components/tool-result-dialog/tool-result-dialog.js +393 -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 +81 -0
- package/dist/components/tool-result-view/registry.js +84 -0
- package/dist/components/tool-result-view/tool-result-view.d.ts +55 -0
- package/dist/components/tool-result-view/tool-result-view.js +138 -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 +439 -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 +182 -0
- package/dist/components/tree/tree-node.d.ts +11 -2
- package/dist/components/tree/tree-node.js +16 -6
- package/dist/components/tree/tree.d.ts +8 -2
- package/dist/components/tree/tree.js +18 -11
- package/dist/components/typing-indicator/typing-indicator.d.ts +60 -0
- package/dist/components/typing-indicator/typing-indicator.js +96 -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 +173 -0
- package/dist/components/virtual-list/virtual-list.js +461 -0
- package/dist/components/virtual-list/virtual-list.styles.d.ts +1 -0
- package/dist/components/virtual-list/virtual-list.styles.js +44 -0
- package/dist/components/widget/widget.d.ts +10 -0
- package/dist/components/widget/widget.js +24 -1
- package/dist/components/widget/widget.styles.js +9 -2
- package/dist/components/word-cloud/word-cloud-layout.js +14 -1
- package/dist/components/word-cloud/word-cloud.d.ts +6 -0
- package/dist/components/word-cloud/word-cloud.js +25 -14
- package/dist/components/word-cloud/word-cloud.styles.js +4 -2
- package/dist/internal/announcer.d.ts +57 -0
- package/dist/internal/announcer.js +71 -0
- package/dist/internal/form-associated.d.ts +1 -0
- package/dist/internal/form-associated.js +55 -11
- package/dist/internal/group-by-recency.d.ts +50 -0
- package/dist/internal/group-by-recency.js +80 -0
- package/dist/internal/rtl.d.ts +23 -0
- package/dist/internal/rtl.js +28 -0
- package/dist/internal/scroll-lock.d.ts +10 -5
- package/dist/internal/scroll-lock.js +30 -14
- package/dist/internal/tokens.styles.js +6 -0
- package/dist/lyra.d.ts +130 -31
- package/dist/lyra.js +94 -26
- package/llms-full.txt +3921 -32
- package/llms.txt +16 -1
- package/package.json +23 -5
- 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 -12
- package/dist/components/chart/lite-chart.stories.js +0 -98
- 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 -5
- package/dist/components/flag/flag.stories.js +0 -17
- 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 -22
- package/dist/components/heatmap/heatmap.stories.js +0 -154
- 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 -19
- package/dist/components/select/select.stories.js +0 -75
- 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 -8
- package/dist/components/stat/stat.stories.js +0 -64
- 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 -7
- package/dist/components/widget/widget.stories.js +0 -41
- package/dist/components/word-cloud/word-cloud.stories.d.ts +0 -10
- package/dist/components/word-cloud/word-cloud.stories.js +0 -55
package/llms.txt
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
## Component tiers
|
|
23
23
|
|
|
24
|
-
The library shipped in
|
|
24
|
+
The library shipped in six incremental batches; `llms-full.txt` is ordered the same way:
|
|
25
25
|
|
|
26
26
|
- **v1 core** — form controls, toasts, sparkline, and flags: `lyra-combobox`/`lyra-option`,
|
|
27
27
|
`lyra-select` (a closed-list, button-trigger single-select sharing `lyra-option` with
|
|
@@ -44,6 +44,21 @@ The library shipped in five incremental batches; `llms-full.txt` is ordered the
|
|
|
44
44
|
- **Map & file-input** — `lyra-map` (`maplibre-gl` wrapper with legend + choropleth layer + point
|
|
45
45
|
markers, needs the optional peer `maplibre-gl`), `lyra-file-input` (drag-drop + click-to-browse
|
|
46
46
|
dropzone, emits raw `File[]`).
|
|
47
|
+
- **Conversation & Agent UI** — chat/tool-call/agent-config building blocks for streaming AI
|
|
48
|
+
interfaces: `lyra-dialog`/`confirm()`, `lyra-tabs`, `lyra-checkbox`, `lyra-switch`,
|
|
49
|
+
`lyra-json-viewer`, `lyra-live-region` (+ `internal/announcer.ts`'s throttled `Announcer`),
|
|
50
|
+
`lyra-markdown` (needs the optional peers `marked`/`dompurify`), `lyra-chat-message`,
|
|
51
|
+
`lyra-typing-indicator`, `lyra-tool-call-chip`, `lyra-tool-result-view` (+ its
|
|
52
|
+
`registerToolRenderer()` renderer registry), `lyra-tool-result-dialog`, `lyra-chat-composer`
|
|
53
|
+
(form-associated), `lyra-attachment-chip`, `lyra-stream-status`, `lyra-virtual-list`,
|
|
54
|
+
`lyra-conversation-item`, `lyra-model-select`, `lyra-slider` (form-associated),
|
|
55
|
+
`lyra-tool-select-dialog`, `lyra-citation-badge`, `lyra-source-list`/`lyra-source-card`,
|
|
56
|
+
`lyra-app-rail`, `lyra-responsive-panel`, `lyra-mention-popover`, `lyra-streaming-text`,
|
|
57
|
+
`lyra-thinking-panel`, `lyra-generation-status`, `lyra-code-block` (needs the optional peer
|
|
58
|
+
`shiki`), `lyra-tool-approval-dialog`, `lyra-tool-param-form`, `lyra-menu`/`lyra-menu-item`,
|
|
59
|
+
`lyra-chip`/`lyra-chip-group`, `lyra-model-settings-panel`, `lyra-context-meter`,
|
|
60
|
+
`lyra-dock-panel`, `lyra-document-preview`, `lyra-media-card`, `lyra-attachment-trigger`,
|
|
61
|
+
`lyra-kbd`, `lyra-result-card`/`lyra-result-field`.
|
|
47
62
|
|
|
48
63
|
## Also useful
|
|
49
64
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aceshooting/lyra-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Free, clean-room Lit web components — a companion to Web Awesome.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -42,10 +42,11 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@floating-ui/dom": "^1.7.6",
|
|
45
|
+
"@types/geojson": "^7946.0.16",
|
|
45
46
|
"lit": "^3.3.3"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
48
|
-
"@aceshooting/lyra-flags": "^1.
|
|
49
|
+
"@aceshooting/lyra-flags": "^1.3.0",
|
|
49
50
|
"@sgratzl/chartjs-chart-boxplot": "^4.4.0",
|
|
50
51
|
"chart.js": "^4.5.0",
|
|
51
52
|
"chartjs-plugin-zoom": "^2.2.0",
|
|
@@ -53,7 +54,10 @@
|
|
|
53
54
|
"d3-force": "^3.0.0",
|
|
54
55
|
"d3-selection": "^3.0.0",
|
|
55
56
|
"d3-zoom": "^3.0.0",
|
|
56
|
-
"
|
|
57
|
+
"dompurify": "^3.4.12",
|
|
58
|
+
"maplibre-gl": "^5.24.0",
|
|
59
|
+
"marked": "^18.0.6",
|
|
60
|
+
"shiki": "^4.3.1"
|
|
57
61
|
},
|
|
58
62
|
"peerDependenciesMeta": {
|
|
59
63
|
"@aceshooting/lyra-flags": {
|
|
@@ -80,20 +84,31 @@
|
|
|
80
84
|
"chartjs-plugin-zoom": {
|
|
81
85
|
"optional": true
|
|
82
86
|
},
|
|
87
|
+
"dompurify": {
|
|
88
|
+
"optional": true
|
|
89
|
+
},
|
|
83
90
|
"maplibre-gl": {
|
|
84
91
|
"optional": true
|
|
92
|
+
},
|
|
93
|
+
"marked": {
|
|
94
|
+
"optional": true
|
|
95
|
+
},
|
|
96
|
+
"shiki": {
|
|
97
|
+
"optional": true
|
|
85
98
|
}
|
|
86
99
|
},
|
|
87
100
|
"devDependencies": {
|
|
88
|
-
"@aceshooting/lyra-flags": "^1.
|
|
101
|
+
"@aceshooting/lyra-flags": "^1.3.0",
|
|
89
102
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
90
103
|
"@open-wc/testing": "^4.0.0",
|
|
91
104
|
"@sgratzl/chartjs-chart-boxplot": "^4.4.5",
|
|
105
|
+
"@sinonjs/fake-timers": "^11.3.1",
|
|
92
106
|
"@types/d3-drag": "^3.0.7",
|
|
93
107
|
"@types/d3-force": "^3.0.10",
|
|
94
108
|
"@types/d3-selection": "^3.0.11",
|
|
95
109
|
"@types/d3-zoom": "^3.0.8",
|
|
96
110
|
"@types/geojson": "^7946.0.16",
|
|
111
|
+
"@types/sinonjs__fake-timers": "^15.0.1",
|
|
97
112
|
"@web/dev-server-esbuild": "^2.0.0",
|
|
98
113
|
"@web/test-runner": "^1.0.0",
|
|
99
114
|
"@web/test-runner-playwright": "^1.0.0",
|
|
@@ -103,13 +118,16 @@
|
|
|
103
118
|
"d3-force": "^3.0.0",
|
|
104
119
|
"d3-selection": "^3.0.0",
|
|
105
120
|
"d3-zoom": "^3.0.0",
|
|
121
|
+
"dompurify": "^3.4.12",
|
|
106
122
|
"maplibre-gl": "^5.24.0",
|
|
123
|
+
"marked": "^18.0.6",
|
|
107
124
|
"playwright": "^1.61.1",
|
|
125
|
+
"shiki": "^4.3.1",
|
|
108
126
|
"typescript": "^7.0.2"
|
|
109
127
|
},
|
|
110
128
|
"customElements": "custom-elements.json",
|
|
111
129
|
"scripts": {
|
|
112
|
-
"build": "tsc -p tsconfig.json",
|
|
130
|
+
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
113
131
|
"test": "wtr",
|
|
114
132
|
"test:watch": "wtr --watch",
|
|
115
133
|
"manifest": "cem analyze --litelement --outdir .",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
const meta = {
|
|
3
|
-
title: 'Charts/Bar',
|
|
4
|
-
component: 'lyra-bar-chart',
|
|
5
|
-
tags: ['autodocs'],
|
|
6
|
-
};
|
|
7
|
-
export default meta;
|
|
8
|
-
export const Default = {
|
|
9
|
-
render: () => {
|
|
10
|
-
const series = [{ label: 'Revenue', data: [12, 19, 14, 22] }];
|
|
11
|
-
return html `
|
|
12
|
-
<lyra-bar-chart
|
|
13
|
-
height="16rem"
|
|
14
|
-
style="width: 22rem"
|
|
15
|
-
.labels=${['Q1', 'Q2', 'Q3', 'Q4']}
|
|
16
|
-
.datasets=${series}
|
|
17
|
-
></lyra-bar-chart>
|
|
18
|
-
`;
|
|
19
|
-
},
|
|
20
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
const meta = {
|
|
3
|
-
title: 'Charts/BoxPlot',
|
|
4
|
-
component: 'lyra-box-plot',
|
|
5
|
-
tags: ['autodocs'],
|
|
6
|
-
};
|
|
7
|
-
export default meta;
|
|
8
|
-
export const Default = {
|
|
9
|
-
render: () => {
|
|
10
|
-
const boxes = [
|
|
11
|
-
{
|
|
12
|
-
label: 'Loss',
|
|
13
|
-
data: [
|
|
14
|
-
{ min: 1, q1: 2, median: 3, q3: 4, max: 5 },
|
|
15
|
-
{ min: 2, q1: 3, median: 4, q3: 5, max: 6 },
|
|
16
|
-
{ min: 1.5, q1: 2.5, median: 3.5, q3: 4.5, max: 6.5 },
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
return html `
|
|
21
|
-
<lyra-box-plot
|
|
22
|
-
height="16rem"
|
|
23
|
-
style="width: 22rem"
|
|
24
|
-
.labels=${['K=2', 'K=3', 'K=4']}
|
|
25
|
-
.boxes=${boxes}
|
|
26
|
-
></lyra-box-plot>
|
|
27
|
-
`;
|
|
28
|
-
},
|
|
29
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
const meta = {
|
|
3
|
-
title: 'Charts/Bubble',
|
|
4
|
-
component: 'lyra-bubble-chart',
|
|
5
|
-
tags: ['autodocs'],
|
|
6
|
-
};
|
|
7
|
-
export default meta;
|
|
8
|
-
export const Default = {
|
|
9
|
-
render: () => {
|
|
10
|
-
const bubblePoints = [
|
|
11
|
-
{ x: 10, y: 20, r: 8 },
|
|
12
|
-
{ x: 15, y: 10, r: 12 },
|
|
13
|
-
{ x: 20, y: 30, r: 6 },
|
|
14
|
-
];
|
|
15
|
-
const series = [
|
|
16
|
-
{ label: 'Clusters', points: bubblePoints },
|
|
17
|
-
];
|
|
18
|
-
return html `
|
|
19
|
-
<lyra-bubble-chart
|
|
20
|
-
height="16rem"
|
|
21
|
-
style="width: 22rem"
|
|
22
|
-
.datasets=${series}
|
|
23
|
-
></lyra-bubble-chart>
|
|
24
|
-
`;
|
|
25
|
-
},
|
|
26
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
-
declare const meta: Meta;
|
|
3
|
-
export default meta;
|
|
4
|
-
type Story = StoryObj;
|
|
5
|
-
export declare const Default: Story;
|
|
6
|
-
/**
|
|
7
|
-
* The `config` property is the raw Chart.js passthrough escape hatch — it is
|
|
8
|
-
* deep-merged over the `Series`-generated config, so a nested key like
|
|
9
|
-
* `options.plugins.title` can be set without discarding the rest of the
|
|
10
|
-
* generated config the `type`/`labels`/`datasets` attributes produce.
|
|
11
|
-
*/
|
|
12
|
-
export declare const ConfigPassthrough: Story;
|
|
13
|
-
/** `horizontal` sets Chart.js's `indexAxis: 'y'`, flipping bars onto a horizontal axis. */
|
|
14
|
-
export declare const Horizontal: Story;
|
|
15
|
-
/** `stacked` stacks every dataset sharing an axis on top of each other instead of side by side. */
|
|
16
|
-
export declare const Stacked: Story;
|
|
17
|
-
/**
|
|
18
|
-
* The `--lyra-chart-grid-color`/`-tick-color`/`-legend-color`/`-tooltip-bg`/
|
|
19
|
-
* `-tooltip-text` custom properties retheme Chart.js's canvas-drawn chrome
|
|
20
|
-
* (grid lines, axis ticks/titles, legend labels, tooltip). Chart.js can't
|
|
21
|
-
* consume `var()` directly, so these are resolved via `getComputedStyle`
|
|
22
|
-
* once per draw — see `themeColors()` in `chart.ts`.
|
|
23
|
-
*/
|
|
24
|
-
export declare const ThemedTokens: Story;
|
|
25
|
-
/**
|
|
26
|
-
* `lyra-point-click` fires whenever a click lands on (or nearest,
|
|
27
|
-
* intersect-only) a data point/segment — covers any `type`, not just bars.
|
|
28
|
-
* `refreshTheme()` forces a redraw so an out-of-band theme change (e.g. a
|
|
29
|
-
* host-level dark-mode toggle that doesn't touch any `lyra-chart` property)
|
|
30
|
-
* is picked up immediately, rather than waiting for the next reactive update.
|
|
31
|
-
*/
|
|
32
|
-
export declare const PointClickAndRefreshTheme: Story;
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
const meta = {
|
|
3
|
-
title: 'Charts/Chart',
|
|
4
|
-
component: 'lyra-chart',
|
|
5
|
-
tags: ['autodocs'],
|
|
6
|
-
};
|
|
7
|
-
export default meta;
|
|
8
|
-
export const Default = {
|
|
9
|
-
render: () => {
|
|
10
|
-
const series = [{ label: 'Revenue', data: [12, 19, 14, 22] }];
|
|
11
|
-
return html `
|
|
12
|
-
<lyra-chart
|
|
13
|
-
type="bar"
|
|
14
|
-
height="16rem"
|
|
15
|
-
style="width: 22rem"
|
|
16
|
-
legend
|
|
17
|
-
.labels=${['Q1', 'Q2', 'Q3', 'Q4']}
|
|
18
|
-
.datasets=${series}
|
|
19
|
-
></lyra-chart>
|
|
20
|
-
`;
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* The `config` property is the raw Chart.js passthrough escape hatch — it is
|
|
25
|
-
* deep-merged over the `Series`-generated config, so a nested key like
|
|
26
|
-
* `options.plugins.title` can be set without discarding the rest of the
|
|
27
|
-
* generated config the `type`/`labels`/`datasets` attributes produce.
|
|
28
|
-
*/
|
|
29
|
-
export const ConfigPassthrough = {
|
|
30
|
-
render: () => {
|
|
31
|
-
const series = [{ label: 'Revenue', data: [12, 19, 14, 22] }];
|
|
32
|
-
return html `
|
|
33
|
-
<lyra-chart
|
|
34
|
-
type="bar"
|
|
35
|
-
height="16rem"
|
|
36
|
-
style="width: 22rem"
|
|
37
|
-
.labels=${['Q1', 'Q2', 'Q3', 'Q4']}
|
|
38
|
-
.datasets=${series}
|
|
39
|
-
.config=${{
|
|
40
|
-
options: { plugins: { title: { display: true, text: 'Quarterly revenue' } } },
|
|
41
|
-
}}
|
|
42
|
-
></lyra-chart>
|
|
43
|
-
`;
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
/** `horizontal` sets Chart.js's `indexAxis: 'y'`, flipping bars onto a horizontal axis. */
|
|
47
|
-
export const Horizontal = {
|
|
48
|
-
render: () => {
|
|
49
|
-
const series = [{ label: 'Revenue', data: [12, 19, 14, 22] }];
|
|
50
|
-
return html `
|
|
51
|
-
<lyra-chart
|
|
52
|
-
type="bar"
|
|
53
|
-
horizontal
|
|
54
|
-
height="16rem"
|
|
55
|
-
style="width: 22rem"
|
|
56
|
-
.labels=${['Q1', 'Q2', 'Q3', 'Q4']}
|
|
57
|
-
.datasets=${series}
|
|
58
|
-
></lyra-chart>
|
|
59
|
-
`;
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
/** `stacked` stacks every dataset sharing an axis on top of each other instead of side by side. */
|
|
63
|
-
export const Stacked = {
|
|
64
|
-
render: () => {
|
|
65
|
-
const series = [
|
|
66
|
-
{ label: 'Product A', data: [12, 19, 14, 22] },
|
|
67
|
-
{ label: 'Product B', data: [8, 11, 9, 15] },
|
|
68
|
-
];
|
|
69
|
-
return html `
|
|
70
|
-
<lyra-chart
|
|
71
|
-
type="bar"
|
|
72
|
-
stacked
|
|
73
|
-
legend
|
|
74
|
-
height="16rem"
|
|
75
|
-
style="width: 22rem"
|
|
76
|
-
.labels=${['Q1', 'Q2', 'Q3', 'Q4']}
|
|
77
|
-
.datasets=${series}
|
|
78
|
-
></lyra-chart>
|
|
79
|
-
`;
|
|
80
|
-
},
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* The `--lyra-chart-grid-color`/`-tick-color`/`-legend-color`/`-tooltip-bg`/
|
|
84
|
-
* `-tooltip-text` custom properties retheme Chart.js's canvas-drawn chrome
|
|
85
|
-
* (grid lines, axis ticks/titles, legend labels, tooltip). Chart.js can't
|
|
86
|
-
* consume `var()` directly, so these are resolved via `getComputedStyle`
|
|
87
|
-
* once per draw — see `themeColors()` in `chart.ts`.
|
|
88
|
-
*/
|
|
89
|
-
export const ThemedTokens = {
|
|
90
|
-
render: () => {
|
|
91
|
-
const series = [{ label: 'Revenue', data: [12, 19, 14, 22] }];
|
|
92
|
-
return html `
|
|
93
|
-
<lyra-chart
|
|
94
|
-
type="bar"
|
|
95
|
-
legend
|
|
96
|
-
height="16rem"
|
|
97
|
-
style="
|
|
98
|
-
width: 22rem;
|
|
99
|
-
--lyra-chart-grid-color: #e5484d;
|
|
100
|
-
--lyra-chart-tick-color: #e5484d;
|
|
101
|
-
--lyra-chart-legend-color: #e5484d;
|
|
102
|
-
--lyra-chart-tooltip-bg: #1a1a1a;
|
|
103
|
-
--lyra-chart-tooltip-text: #fff;
|
|
104
|
-
"
|
|
105
|
-
.labels=${['Q1', 'Q2', 'Q3', 'Q4']}
|
|
106
|
-
.datasets=${series}
|
|
107
|
-
></lyra-chart>
|
|
108
|
-
`;
|
|
109
|
-
},
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* `lyra-point-click` fires whenever a click lands on (or nearest,
|
|
113
|
-
* intersect-only) a data point/segment — covers any `type`, not just bars.
|
|
114
|
-
* `refreshTheme()` forces a redraw so an out-of-band theme change (e.g. a
|
|
115
|
-
* host-level dark-mode toggle that doesn't touch any `lyra-chart` property)
|
|
116
|
-
* is picked up immediately, rather than waiting for the next reactive update.
|
|
117
|
-
*/
|
|
118
|
-
export const PointClickAndRefreshTheme = {
|
|
119
|
-
render: () => {
|
|
120
|
-
const series = [{ label: 'Revenue', data: [12, 19, 14, 22] }];
|
|
121
|
-
return html `
|
|
122
|
-
<lyra-chart
|
|
123
|
-
type="bar"
|
|
124
|
-
height="16rem"
|
|
125
|
-
style="width: 22rem"
|
|
126
|
-
.labels=${['Q1', 'Q2', 'Q3', 'Q4']}
|
|
127
|
-
.datasets=${series}
|
|
128
|
-
@lyra-point-click=${(e) => console.log('lyra-point-click', e.detail)}
|
|
129
|
-
></lyra-chart>
|
|
130
|
-
<button
|
|
131
|
-
type="button"
|
|
132
|
-
@click=${(e) => {
|
|
133
|
-
const chart = e.target.previousElementSibling;
|
|
134
|
-
chart.refreshTheme();
|
|
135
|
-
}}
|
|
136
|
-
>
|
|
137
|
-
refreshTheme()
|
|
138
|
-
</button>
|
|
139
|
-
`;
|
|
140
|
-
},
|
|
141
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
const meta = {
|
|
3
|
-
title: 'Charts/Doughnut',
|
|
4
|
-
component: 'lyra-doughnut-chart',
|
|
5
|
-
tags: ['autodocs'],
|
|
6
|
-
};
|
|
7
|
-
export default meta;
|
|
8
|
-
export const Default = {
|
|
9
|
-
render: () => {
|
|
10
|
-
const series = [
|
|
11
|
-
{
|
|
12
|
-
label: 'Browsers',
|
|
13
|
-
data: [58, 18, 15, 9],
|
|
14
|
-
color: ['#5b8def', '#f7b955', '#59c19a', '#b6b8c3'],
|
|
15
|
-
},
|
|
16
|
-
];
|
|
17
|
-
return html `
|
|
18
|
-
<lyra-doughnut-chart
|
|
19
|
-
height="16rem"
|
|
20
|
-
style="width: 16rem"
|
|
21
|
-
.labels=${['Chrome', 'Firefox', 'Safari', 'Other']}
|
|
22
|
-
.datasets=${series}
|
|
23
|
-
></lyra-doughnut-chart>
|
|
24
|
-
`;
|
|
25
|
-
},
|
|
26
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
const meta = {
|
|
3
|
-
title: 'Charts/Histogram',
|
|
4
|
-
component: 'lyra-histogram',
|
|
5
|
-
tags: ['autodocs'],
|
|
6
|
-
};
|
|
7
|
-
export default meta;
|
|
8
|
-
export const Default = {
|
|
9
|
-
render: () => html `
|
|
10
|
-
<lyra-histogram
|
|
11
|
-
bins="6"
|
|
12
|
-
height="16rem"
|
|
13
|
-
style="width: 22rem"
|
|
14
|
-
.values=${[2, 4, 4, 5, 6, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 15]}
|
|
15
|
-
></lyra-histogram>
|
|
16
|
-
`,
|
|
17
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
-
declare const meta: Meta;
|
|
3
|
-
export default meta;
|
|
4
|
-
type Story = StoryObj;
|
|
5
|
-
export declare const Default: Story;
|
|
6
|
-
/**
|
|
7
|
-
* `area` fills every series lacking its own per-series `fill` (unlike
|
|
8
|
-
* `Default`'s "Sessions" series, which opts into a fill via its own
|
|
9
|
-
* `fill: true` instead of the chart-wide default).
|
|
10
|
-
*/
|
|
11
|
-
export declare const AreaFill: Story;
|
|
12
|
-
/** `zoom` enables wheel/drag/pinch zoom; a reset-zoom button appears once zoomed. */
|
|
13
|
-
export declare const WithZoom: Story;
|
|
14
|
-
/** A second series on `axis: "y2"` plots against its own right-side scale, labelled by `y2-label`. */
|
|
15
|
-
export declare const DualAxis: Story;
|
|
16
|
-
/**
|
|
17
|
-
* `beginAtZero` lets the y axis start near the data's own minimum instead of
|
|
18
|
-
* 0 — set via the `.beginAtZero` property, since the `begin-at-zero`
|
|
19
|
-
* *attribute*'s presence (not its string value) is what Lit's boolean
|
|
20
|
-
* converter reads, so `begin-at-zero="false"` would not turn it off.
|
|
21
|
-
*/
|
|
22
|
-
export declare const WithoutBeginAtZero: Story;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
const meta = {
|
|
3
|
-
title: 'Charts/Line',
|
|
4
|
-
component: 'lyra-line-chart',
|
|
5
|
-
tags: ['autodocs'],
|
|
6
|
-
};
|
|
7
|
-
export default meta;
|
|
8
|
-
export const Default = {
|
|
9
|
-
render: () => {
|
|
10
|
-
const series = [
|
|
11
|
-
{ label: 'Sessions', data: [4, 7, 6, 9, 12], fill: true },
|
|
12
|
-
{ label: 'Errors', data: [1, 2, 1, 0, 3], color: '#e5484d' },
|
|
13
|
-
];
|
|
14
|
-
return html `
|
|
15
|
-
<lyra-line-chart
|
|
16
|
-
height="16rem"
|
|
17
|
-
style="width: 22rem"
|
|
18
|
-
legend
|
|
19
|
-
.labels=${['Jan', 'Feb', 'Mar', 'Apr', 'May']}
|
|
20
|
-
.datasets=${series}
|
|
21
|
-
></lyra-line-chart>
|
|
22
|
-
`;
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* `area` fills every series lacking its own per-series `fill` (unlike
|
|
27
|
-
* `Default`'s "Sessions" series, which opts into a fill via its own
|
|
28
|
-
* `fill: true` instead of the chart-wide default).
|
|
29
|
-
*/
|
|
30
|
-
export const AreaFill = {
|
|
31
|
-
render: () => {
|
|
32
|
-
const series = [{ label: 'Sessions', data: [4, 7, 6, 9, 12] }];
|
|
33
|
-
return html `
|
|
34
|
-
<lyra-line-chart
|
|
35
|
-
area
|
|
36
|
-
height="16rem"
|
|
37
|
-
style="width: 22rem"
|
|
38
|
-
.labels=${['Jan', 'Feb', 'Mar', 'Apr', 'May']}
|
|
39
|
-
.datasets=${series}
|
|
40
|
-
></lyra-line-chart>
|
|
41
|
-
`;
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
/** `zoom` enables wheel/drag/pinch zoom; a reset-zoom button appears once zoomed. */
|
|
45
|
-
export const WithZoom = {
|
|
46
|
-
render: () => {
|
|
47
|
-
const series = [{ label: 'Sessions', data: [4, 7, 6, 9, 12, 8, 15, 10, 6, 9] }];
|
|
48
|
-
return html `
|
|
49
|
-
<lyra-line-chart
|
|
50
|
-
zoom
|
|
51
|
-
height="16rem"
|
|
52
|
-
style="width: 22rem"
|
|
53
|
-
.labels=${['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O']}
|
|
54
|
-
.datasets=${series}
|
|
55
|
-
@lyra-zoom=${(e) => console.log('lyra-zoom', e.detail)}
|
|
56
|
-
></lyra-line-chart>
|
|
57
|
-
`;
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
/** A second series on `axis: "y2"` plots against its own right-side scale, labelled by `y2-label`. */
|
|
61
|
-
export const DualAxis = {
|
|
62
|
-
render: () => {
|
|
63
|
-
const series = [
|
|
64
|
-
{ label: 'Sessions', data: [40, 70, 60, 90, 120] },
|
|
65
|
-
{ label: 'Conversion rate', data: [0.02, 0.03, 0.025, 0.04, 0.05], axis: 'y2' },
|
|
66
|
-
];
|
|
67
|
-
return html `
|
|
68
|
-
<lyra-line-chart
|
|
69
|
-
legend
|
|
70
|
-
height="16rem"
|
|
71
|
-
style="width: 22rem"
|
|
72
|
-
y-label="Sessions"
|
|
73
|
-
y2-label="Conversion rate"
|
|
74
|
-
.labels=${['Jan', 'Feb', 'Mar', 'Apr', 'May']}
|
|
75
|
-
.datasets=${series}
|
|
76
|
-
></lyra-line-chart>
|
|
77
|
-
`;
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* `beginAtZero` lets the y axis start near the data's own minimum instead of
|
|
82
|
-
* 0 — set via the `.beginAtZero` property, since the `begin-at-zero`
|
|
83
|
-
* *attribute*'s presence (not its string value) is what Lit's boolean
|
|
84
|
-
* converter reads, so `begin-at-zero="false"` would not turn it off.
|
|
85
|
-
*/
|
|
86
|
-
export const WithoutBeginAtZero = {
|
|
87
|
-
render: () => {
|
|
88
|
-
const series = [{ label: 'Temperature (°C)', data: [18, 19, 21, 20, 22] }];
|
|
89
|
-
return html `
|
|
90
|
-
<lyra-line-chart
|
|
91
|
-
height="16rem"
|
|
92
|
-
style="width: 22rem"
|
|
93
|
-
.beginAtZero=${false}
|
|
94
|
-
.labels=${['Jan', 'Feb', 'Mar', 'Apr', 'May']}
|
|
95
|
-
.datasets=${series}
|
|
96
|
-
></lyra-line-chart>
|
|
97
|
-
`;
|
|
98
|
-
},
|
|
99
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
-
declare const meta: Meta;
|
|
3
|
-
export default meta;
|
|
4
|
-
type Story = StoryObj;
|
|
5
|
-
/** Zero-dependency alternative to `lyra-chart` — plain SVG/DOM, no `chart.js` peer dep. */
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const GroupedBars: Story;
|
|
8
|
-
/** `stacked` sums each category's bars into one segmented bar instead of grouping them side by side. */
|
|
9
|
-
export declare const StackedBars: Story;
|
|
10
|
-
export declare const Line: Story;
|
|
11
|
-
/** Clicking (or Enter/Space on a focused) bar/point fires `lyra-point-click`, same detail shape as `lyra-chart`'s. */
|
|
12
|
-
export declare const ClickToFilter: Story;
|