@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,419 @@
|
|
|
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, svg } from 'lit';
|
|
8
|
+
import { property, state } from 'lit/decorators.js';
|
|
9
|
+
import { LyraElement } from '../../internal/lyra-element.js';
|
|
10
|
+
import { activateOverlay } from '../../internal/overlay-manager.js';
|
|
11
|
+
import { defineElement } from '../../internal/prefix.js';
|
|
12
|
+
import { lockScroll } from '../../internal/scroll-lock.js';
|
|
13
|
+
import { nextId } from '../../internal/a11y.js';
|
|
14
|
+
import { closeIcon } from '../../internal/icons.js';
|
|
15
|
+
import { styles } from './app-rail.styles.js';
|
|
16
|
+
import './app-rail-item.js';
|
|
17
|
+
// icons.ts has no hamburger/menu glyph and this component must not modify
|
|
18
|
+
// that shared module -- inlined here instead, matching its 24x24
|
|
19
|
+
// viewBox/stroke-width/currentColor convention so it reads as part of the
|
|
20
|
+
// same icon set.
|
|
21
|
+
function menuIcon() {
|
|
22
|
+
return svg `
|
|
23
|
+
<svg
|
|
24
|
+
width="1em"
|
|
25
|
+
height="1em"
|
|
26
|
+
viewBox="0 0 24 24"
|
|
27
|
+
fill="none"
|
|
28
|
+
stroke="currentColor"
|
|
29
|
+
stroke-width="1.75"
|
|
30
|
+
stroke-linecap="round"
|
|
31
|
+
stroke-linejoin="round"
|
|
32
|
+
aria-hidden="true"
|
|
33
|
+
focusable="false"
|
|
34
|
+
>
|
|
35
|
+
<line x1="4" y1="7" x2="20" y2="7"></line>
|
|
36
|
+
<line x1="4" y1="12" x2="20" y2="12"></line>
|
|
37
|
+
<line x1="4" y1="17" x2="20" y2="17"></line>
|
|
38
|
+
</svg>
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Pure breakpoint-to-mode resolver, kept separate from the `matchMedia`
|
|
43
|
+
* wiring below so it's directly unit-testable without resizing a real
|
|
44
|
+
* browser window. `mobileMatches` wins over `iconOnlyMatches` when both are
|
|
45
|
+
* true (the viewport is narrower than both breakpoints at once).
|
|
46
|
+
*/
|
|
47
|
+
export function computeAppRailMode(iconOnlyMatches, mobileMatches) {
|
|
48
|
+
if (mobileMatches)
|
|
49
|
+
return 'mobile';
|
|
50
|
+
if (iconOnlyMatches)
|
|
51
|
+
return 'icon-only';
|
|
52
|
+
return 'full';
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* `<lyra-app-rail>` — a responsive navigation rail that adapts across three
|
|
56
|
+
* presentations as the *viewport* narrows (not this element's own inline
|
|
57
|
+
* size — see the `mode` accessor doc for why): `'full'` (nav items show
|
|
58
|
+
* icon + label, inline), `'icon-only'` (a narrower inline rail, icons only),
|
|
59
|
+
* and `'mobile'` (hidden behind a toggle button; opening it shows a
|
|
60
|
+
* focus-trapped floating overlay over the page).
|
|
61
|
+
*
|
|
62
|
+
* Breakpoints are viewport-width `matchMedia()` queries against
|
|
63
|
+
* `icon-only-breakpoint`/`mobile-breakpoint`, not a `ResizeObserver` on this
|
|
64
|
+
* element — a nav rail's presentation should track the actual device/window
|
|
65
|
+
* width the way a native OS shell's navigation does, not however much
|
|
66
|
+
* horizontal space a particular layout happens to give it.
|
|
67
|
+
*
|
|
68
|
+
* The `'mobile'` state participates in the library's shared overlay stack,
|
|
69
|
+
* which supplies focus trapping, Escape/backdrop dismissal, inerting, and
|
|
70
|
+
* focus restoration without nesting a `<lyra-dialog>` in this component's
|
|
71
|
+
* shadow template. `[part="base"]` (the inline
|
|
72
|
+
* `'full'`/`'icon-only'` presentation) and `[part="panel"]` (the mobile
|
|
73
|
+
* overlay) are the *same* element promoted in place across modes (mirrors
|
|
74
|
+
* `<lyra-widget>`'s fullscreen mode) — never both at once, and never two
|
|
75
|
+
* separate copies of the slotted content, which slot projection can't
|
|
76
|
+
* produce anyway (a light-DOM node is only ever assigned to one `<slot>`).
|
|
77
|
+
* It's a plain `<div>` with an explicit `role="navigation"` rather than a
|
|
78
|
+
* literal `<nav>` tag: a `<nav>`'s implicit role can't be overridden to
|
|
79
|
+
* `role="dialog"` while the overlay is modal without an `aria-allowed-role`
|
|
80
|
+
* violation (verified against axe), whereas an explicit `role="navigation"`
|
|
81
|
+
* on a generic element can be swapped for `role="dialog"` freely.
|
|
82
|
+
*
|
|
83
|
+
* @customElement lyra-app-rail
|
|
84
|
+
* @slot - Nav items. Use `<lyra-app-rail-item>` for the explicit icon/label
|
|
85
|
+
* contract that automatically hides labels in `'icon-only'` mode. Generic
|
|
86
|
+
* links and buttons remain supported, but their compact presentation is the
|
|
87
|
+
* consumer's responsibility. While the mobile overlay is open, clicking
|
|
88
|
+
* anywhere inside this slot closes it.
|
|
89
|
+
* @slot header - Logo/brand content, shown above the nav items in every mode.
|
|
90
|
+
* @slot footer - A trailing user/settings trigger, shown below the nav items.
|
|
91
|
+
* @event lyra-mode-change - The effective mode changed, whether from a
|
|
92
|
+
* breakpoint crossing or an explicit `mode` assignment. Not fired for a
|
|
93
|
+
* redundant reassignment to the mode already in effect.
|
|
94
|
+
* `detail: AppRailModeChangeDetail`.
|
|
95
|
+
* @event lyra-toggle - The mobile overlay opened or closed — via the
|
|
96
|
+
* built-in toggle button, Escape, a backdrop click, a nav-item click while
|
|
97
|
+
* open, or a breakpoint/forced mode change leaving `'mobile'` while open.
|
|
98
|
+
* Not fired when a consumer sets `open` directly (mirrors `<lyra-dialog>`'s
|
|
99
|
+
* `open`/`close()` split). `detail: AppRailToggleDetail`.
|
|
100
|
+
* @csspart base - The rail root while inline (`'full'`/`'icon-only'` modes).
|
|
101
|
+
* @csspart header - The wrapper around the `header` slot.
|
|
102
|
+
* @csspart nav - The wrapper around the default (nav items) slot.
|
|
103
|
+
* @csspart footer - The wrapper around the `footer` slot.
|
|
104
|
+
* @csspart toggle - The mobile hamburger/close toggle button. Hidden via
|
|
105
|
+
* CSS outside `'mobile'` mode.
|
|
106
|
+
* @csspart backdrop - The mobile overlay's scrim. Only rendered while open.
|
|
107
|
+
* @csspart panel - The mobile overlay's floating panel — see the class doc
|
|
108
|
+
* for why it's the same element as `base`, never both at once.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* Use the item contract so the visible label collapses while its accessible
|
|
112
|
+
* name remains available:
|
|
113
|
+
* ```html
|
|
114
|
+
* <lyra-app-rail>
|
|
115
|
+
* <lyra-app-rail-item href="/inbox" aria-label="Inbox">
|
|
116
|
+
* <svg slot="icon" aria-hidden="true">...</svg>Inbox
|
|
117
|
+
* </lyra-app-rail-item>
|
|
118
|
+
* </lyra-app-rail>
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
export class LyraAppRail extends LyraElement {
|
|
122
|
+
constructor() {
|
|
123
|
+
super(...arguments);
|
|
124
|
+
/** Below this viewport width, the rail switches from `'full'` to
|
|
125
|
+
* `'icon-only'`. Any valid CSS length, used directly in a `max-width`
|
|
126
|
+
* media query. */
|
|
127
|
+
this.iconOnlyBreakpoint = '960px';
|
|
128
|
+
/** Below this viewport width, the rail switches from `'icon-only'` to
|
|
129
|
+
* `'mobile'`. Should be smaller than `iconOnlyBreakpoint` to produce all
|
|
130
|
+
* three states as the viewport narrows. */
|
|
131
|
+
this.mobileBreakpoint = '600px';
|
|
132
|
+
/** Whether the mobile floating overlay is shown. Only meaningful while
|
|
133
|
+
* `mode` is `'mobile'` — the value is preserved (not reset) while another
|
|
134
|
+
* mode is active, but no overlay chrome renders until `mode` is
|
|
135
|
+
* `'mobile'` again. Set this directly, or use the built-in toggle button
|
|
136
|
+
* — there is no separate `show()`/`hide()` pair. */
|
|
137
|
+
this.open = false;
|
|
138
|
+
/** Accessible name for the rail's navigation landmark, and for its dialog
|
|
139
|
+
* role while the mobile overlay is open. */
|
|
140
|
+
this.label = 'Navigation';
|
|
141
|
+
this.hasHeaderSlot = false;
|
|
142
|
+
this.hasFooterSlot = false;
|
|
143
|
+
this._mode = 'full';
|
|
144
|
+
// Whether matchMedia changes are currently ignored because a consumer
|
|
145
|
+
// forced a specific mode -- see the `mode` accessor doc.
|
|
146
|
+
this.forced = false;
|
|
147
|
+
this.iconOnlyMatches = false;
|
|
148
|
+
this.mobileMatches = false;
|
|
149
|
+
// Derived from mode === 'mobile' && open -- tracked as its own field
|
|
150
|
+
// (rather than recomputed inline everywhere) so willUpdate can detect the
|
|
151
|
+
// specific false->true/true->false transition regardless of which of the
|
|
152
|
+
// two source properties changed.
|
|
153
|
+
this.overlayActive = false;
|
|
154
|
+
this.justOpened = false;
|
|
155
|
+
this.navId = nextId('app-rail-nav');
|
|
156
|
+
// Split into two single-query listeners (rather than one shared handler
|
|
157
|
+
// reading both live MediaQueryLists) specifically so a test can invoke
|
|
158
|
+
// either directly with a fabricated { matches } event -- exercising the
|
|
159
|
+
// full breakpoint-response wiring without needing to actually resize the
|
|
160
|
+
// browser window a test runs in.
|
|
161
|
+
this.onIconOnlyChange = (e) => {
|
|
162
|
+
this.iconOnlyMatches = e.matches;
|
|
163
|
+
if (!this.forced)
|
|
164
|
+
this.applyComputedMode();
|
|
165
|
+
};
|
|
166
|
+
this.onMobileChange = (e) => {
|
|
167
|
+
this.mobileMatches = e.matches;
|
|
168
|
+
if (!this.forced)
|
|
169
|
+
this.applyComputedMode();
|
|
170
|
+
};
|
|
171
|
+
this.onToggleClick = (e) => {
|
|
172
|
+
if (!this.open)
|
|
173
|
+
this.explicitTrigger = e.currentTarget;
|
|
174
|
+
this.setOpen(!this.open);
|
|
175
|
+
};
|
|
176
|
+
this.onBackdropClick = () => {
|
|
177
|
+
this.overlayHandle?.dismissBackdrop();
|
|
178
|
+
};
|
|
179
|
+
// See the default-slot @slot doc -- any click inside the nav items while
|
|
180
|
+
// the overlay is open closes it, without trying to distinguish a real
|
|
181
|
+
// navigation trigger from incidental slotted content.
|
|
182
|
+
this.onNavItemClick = () => {
|
|
183
|
+
if (this.overlayActive)
|
|
184
|
+
this.setOpen(false);
|
|
185
|
+
};
|
|
186
|
+
this.onHeaderSlotChange = (e) => {
|
|
187
|
+
this.hasHeaderSlot = e.target.assignedElements({ flatten: true }).length > 0;
|
|
188
|
+
};
|
|
189
|
+
this.onFooterSlotChange = (e) => {
|
|
190
|
+
this.hasFooterSlot = e.target.assignedElements({ flatten: true }).length > 0;
|
|
191
|
+
};
|
|
192
|
+
this.onNavSlotChange = () => {
|
|
193
|
+
this.syncSlottedItems();
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
static { this.styles = [LyraElement.styles, styles]; }
|
|
197
|
+
// `mode` needs a custom accessor (force/auto semantics below) rather than
|
|
198
|
+
// the usual @property()-generated one -- registered here, alongside the
|
|
199
|
+
// decorator-declared properties below, the same way lyra-model-select's
|
|
200
|
+
// form-associated `value` accessor is. `reflect: true` still applies:
|
|
201
|
+
// LitElement's update loop reflects any `reflect`-flagged property to its
|
|
202
|
+
// attribute generically by reading `this[name]` after render, regardless
|
|
203
|
+
// of whether that property has a custom or auto-generated accessor.
|
|
204
|
+
static { this.properties = {
|
|
205
|
+
mode: { reflect: true, noAccessor: true },
|
|
206
|
+
}; }
|
|
207
|
+
syncSlottedItems() {
|
|
208
|
+
const slot = this.shadowRoot?.querySelector('[part="nav"] > slot');
|
|
209
|
+
for (const item of slot?.assignedElements({ flatten: true }) ?? []) {
|
|
210
|
+
if (item.localName === 'lyra-app-rail-item') {
|
|
211
|
+
item.toggleAttribute('icon-only', this._mode === 'icon-only');
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The rail's current effective presentation. Always one of the three real
|
|
217
|
+
* modes — never `'auto'` — reflecting either the live breakpoint match or,
|
|
218
|
+
* once forced, whatever was last assigned.
|
|
219
|
+
*
|
|
220
|
+
* Assigning `'full'`/`'icon-only'`/`'mobile'` forces that mode and stops
|
|
221
|
+
* this element from responding to `icon-only-breakpoint`/
|
|
222
|
+
* `mobile-breakpoint` matches. Assigning the sentinel `'auto'` releases
|
|
223
|
+
* the force and immediately re-syncs to the current viewport width,
|
|
224
|
+
* resuming automatic tracking. `'auto'` is a write-only instruction, not a
|
|
225
|
+
* value this getter ever returns — there is no way to observe "currently
|
|
226
|
+
* forced" from the property itself.
|
|
227
|
+
*/
|
|
228
|
+
get mode() {
|
|
229
|
+
return this._mode;
|
|
230
|
+
}
|
|
231
|
+
set mode(next) {
|
|
232
|
+
if (next === 'auto') {
|
|
233
|
+
if (!this.forced)
|
|
234
|
+
return;
|
|
235
|
+
this.forced = false;
|
|
236
|
+
this.applyComputedMode();
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (next !== 'full' && next !== 'icon-only' && next !== 'mobile')
|
|
240
|
+
return;
|
|
241
|
+
this.forced = true;
|
|
242
|
+
this.setEffectiveMode(next);
|
|
243
|
+
}
|
|
244
|
+
willUpdate(changed) {
|
|
245
|
+
if (!this.hasUpdated) {
|
|
246
|
+
this.hasHeaderSlot = Array.from(this.children).some((el) => el.getAttribute('slot') === 'header');
|
|
247
|
+
this.hasFooterSlot = Array.from(this.children).some((el) => el.getAttribute('slot') === 'footer');
|
|
248
|
+
}
|
|
249
|
+
if (this.hasUpdated && (changed.has('iconOnlyBreakpoint') || changed.has('mobileBreakpoint'))) {
|
|
250
|
+
this.teardownMediaQueries();
|
|
251
|
+
this.setupMediaQueries();
|
|
252
|
+
}
|
|
253
|
+
if (changed.has('open') || changed.has('mode')) {
|
|
254
|
+
const next = this._mode === 'mobile' && this.open;
|
|
255
|
+
if (next !== this.overlayActive) {
|
|
256
|
+
this.overlayActive = next;
|
|
257
|
+
if (next) {
|
|
258
|
+
this.justOpened = true;
|
|
259
|
+
this.activateMobileOverlay();
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
this.deactivateMobileOverlay();
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
// Runs after render (not willUpdate) so [part="panel"] and its slotted
|
|
268
|
+
// content have already landed in the DOM before the focus call below can
|
|
269
|
+
// rely on them -- mirrors lyra-dialog's/lyra-widget's identical ordering
|
|
270
|
+
// rationale.
|
|
271
|
+
updated() {
|
|
272
|
+
this.syncSlottedItems();
|
|
273
|
+
if (this.justOpened) {
|
|
274
|
+
this.justOpened = false;
|
|
275
|
+
this.overlayHandle?.focusInitial();
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
connectedCallback() {
|
|
279
|
+
super.connectedCallback();
|
|
280
|
+
this.setupMediaQueries();
|
|
281
|
+
// A reconnect (e.g. a drag-and-drop reparent keeping this same element
|
|
282
|
+
// instance) fires disconnectedCallback then connectedCallback
|
|
283
|
+
// synchronously with no update in between, so willUpdate never reruns to
|
|
284
|
+
// notice the overlay is still active -- restore its shared registration
|
|
285
|
+
// and scroll lock.
|
|
286
|
+
if (this.hasUpdated && this._mode === 'mobile' && this.open) {
|
|
287
|
+
if (this.overlayHandle?.isActive()) {
|
|
288
|
+
this.overlayHandle.resume();
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
this.activateMobileOverlay();
|
|
292
|
+
}
|
|
293
|
+
if (!this.releaseScrollLock)
|
|
294
|
+
this.releaseScrollLock = lockScroll(this.ownerDocument);
|
|
295
|
+
queueMicrotask(() => this.overlayHandle?.focusInitial());
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
disconnectedCallback() {
|
|
299
|
+
super.disconnectedCallback();
|
|
300
|
+
this.teardownMediaQueries();
|
|
301
|
+
this.releaseScrollLock?.();
|
|
302
|
+
this.releaseScrollLock = undefined;
|
|
303
|
+
this.overlayHandle?.suspend();
|
|
304
|
+
}
|
|
305
|
+
activateMobileOverlay() {
|
|
306
|
+
this.releaseScrollLock ??= lockScroll(this.ownerDocument);
|
|
307
|
+
this.overlayHandle = activateOverlay({
|
|
308
|
+
host: this,
|
|
309
|
+
panel: () => this.shadowRoot?.querySelector('[part="panel"]') ?? null,
|
|
310
|
+
onEscape: () => this.setOpen(false),
|
|
311
|
+
onBackdrop: () => this.setOpen(false),
|
|
312
|
+
restoreFocusTo: this.explicitTrigger,
|
|
313
|
+
});
|
|
314
|
+
this.explicitTrigger = undefined;
|
|
315
|
+
}
|
|
316
|
+
deactivateMobileOverlay() {
|
|
317
|
+
this.releaseScrollLock?.();
|
|
318
|
+
this.releaseScrollLock = undefined;
|
|
319
|
+
this.overlayHandle?.deactivate();
|
|
320
|
+
this.overlayHandle = undefined;
|
|
321
|
+
}
|
|
322
|
+
setupMediaQueries() {
|
|
323
|
+
const view = this.ownerDocument.defaultView;
|
|
324
|
+
if (!view?.matchMedia)
|
|
325
|
+
return;
|
|
326
|
+
this.mqIconOnly = view.matchMedia(`(max-width: ${this.iconOnlyBreakpoint})`);
|
|
327
|
+
this.mqMobile = view.matchMedia(`(max-width: ${this.mobileBreakpoint})`);
|
|
328
|
+
this.mqIconOnly.addEventListener('change', this.onIconOnlyChange);
|
|
329
|
+
this.mqMobile.addEventListener('change', this.onMobileChange);
|
|
330
|
+
this.iconOnlyMatches = this.mqIconOnly.matches;
|
|
331
|
+
this.mobileMatches = this.mqMobile.matches;
|
|
332
|
+
if (!this.forced)
|
|
333
|
+
this.applyComputedMode();
|
|
334
|
+
}
|
|
335
|
+
teardownMediaQueries() {
|
|
336
|
+
this.mqIconOnly?.removeEventListener('change', this.onIconOnlyChange);
|
|
337
|
+
this.mqMobile?.removeEventListener('change', this.onMobileChange);
|
|
338
|
+
this.mqIconOnly = undefined;
|
|
339
|
+
this.mqMobile = undefined;
|
|
340
|
+
}
|
|
341
|
+
applyComputedMode() {
|
|
342
|
+
this.setEffectiveMode(computeAppRailMode(this.iconOnlyMatches, this.mobileMatches));
|
|
343
|
+
}
|
|
344
|
+
setEffectiveMode(next) {
|
|
345
|
+
if (this._mode === next)
|
|
346
|
+
return;
|
|
347
|
+
const old = this._mode;
|
|
348
|
+
this._mode = next;
|
|
349
|
+
this.requestUpdate('mode', old);
|
|
350
|
+
this.emit('lyra-mode-change', { mode: next });
|
|
351
|
+
// 'open' is only meaningful in 'mobile' mode -- leaving it while open
|
|
352
|
+
// closes the overlay as a side effect (through setOpen, so it still
|
|
353
|
+
// emits lyra-toggle and releases the scroll lock/focus trap normally)
|
|
354
|
+
// rather than leaving a now-invisible overlay primed to reappear the
|
|
355
|
+
// next time mode returns to 'mobile'.
|
|
356
|
+
if (next !== 'mobile' && this.open)
|
|
357
|
+
this.setOpen(false);
|
|
358
|
+
}
|
|
359
|
+
setOpen(next) {
|
|
360
|
+
if (this.open === next)
|
|
361
|
+
return;
|
|
362
|
+
this.open = next;
|
|
363
|
+
this.emit('lyra-toggle', { open: next });
|
|
364
|
+
}
|
|
365
|
+
render() {
|
|
366
|
+
const mobile = this._mode === 'mobile';
|
|
367
|
+
return html `
|
|
368
|
+
<button
|
|
369
|
+
part="toggle"
|
|
370
|
+
type="button"
|
|
371
|
+
aria-expanded=${this.open ? 'true' : 'false'}
|
|
372
|
+
aria-controls=${this.navId}
|
|
373
|
+
aria-label=${this.open ? 'Close navigation' : 'Open navigation'}
|
|
374
|
+
@click=${this.onToggleClick}
|
|
375
|
+
>
|
|
376
|
+
${this.open ? closeIcon() : menuIcon()}
|
|
377
|
+
</button>
|
|
378
|
+
${mobile && this.open ? html `<div part="backdrop" @click=${this.onBackdropClick}></div>` : nothing}
|
|
379
|
+
<div
|
|
380
|
+
id=${this.navId}
|
|
381
|
+
part=${mobile ? 'panel' : 'base'}
|
|
382
|
+
aria-label=${this.label}
|
|
383
|
+
role=${this.overlayActive ? 'dialog' : 'navigation'}
|
|
384
|
+
aria-modal=${this.overlayActive ? 'true' : nothing}
|
|
385
|
+
tabindex=${this.overlayActive ? '-1' : nothing}
|
|
386
|
+
?inert=${mobile && !this.open}
|
|
387
|
+
>
|
|
388
|
+
<div part="header" ?hidden=${!this.hasHeaderSlot}>
|
|
389
|
+
<slot name="header" @slotchange=${this.onHeaderSlotChange}></slot>
|
|
390
|
+
</div>
|
|
391
|
+
<div part="nav">
|
|
392
|
+
<slot @slotchange=${this.onNavSlotChange} @click=${this.onNavItemClick}></slot>
|
|
393
|
+
</div>
|
|
394
|
+
<div part="footer" ?hidden=${!this.hasFooterSlot}>
|
|
395
|
+
<slot name="footer" @slotchange=${this.onFooterSlotChange}></slot>
|
|
396
|
+
</div>
|
|
397
|
+
</div>
|
|
398
|
+
`;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
__decorate([
|
|
402
|
+
property({ attribute: 'icon-only-breakpoint' })
|
|
403
|
+
], LyraAppRail.prototype, "iconOnlyBreakpoint", void 0);
|
|
404
|
+
__decorate([
|
|
405
|
+
property({ attribute: 'mobile-breakpoint' })
|
|
406
|
+
], LyraAppRail.prototype, "mobileBreakpoint", void 0);
|
|
407
|
+
__decorate([
|
|
408
|
+
property({ type: Boolean, reflect: true })
|
|
409
|
+
], LyraAppRail.prototype, "open", void 0);
|
|
410
|
+
__decorate([
|
|
411
|
+
property()
|
|
412
|
+
], LyraAppRail.prototype, "label", void 0);
|
|
413
|
+
__decorate([
|
|
414
|
+
state()
|
|
415
|
+
], LyraAppRail.prototype, "hasHeaderSlot", void 0);
|
|
416
|
+
__decorate([
|
|
417
|
+
state()
|
|
418
|
+
], LyraAppRail.prototype, "hasFooterSlot", void 0);
|
|
419
|
+
defineElement('app-rail', LyraAppRail);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
/* Component-specific sizing -- not shared design tokens, so a consumer
|
|
6
|
+
can retheme any of them without a raw literal leaking into the public
|
|
7
|
+
API (same rationale as lyra-dialog's --lyra-dialog-overlay-color and
|
|
8
|
+
lyra-widget's --lyra-widget-overlay-color). */
|
|
9
|
+
--lyra-app-rail-width: 15rem;
|
|
10
|
+
--lyra-app-rail-icon-width: 4rem;
|
|
11
|
+
--lyra-app-rail-mobile-width: 18rem;
|
|
12
|
+
--lyra-app-rail-overlay-color: rgb(0 0 0 / 0.5);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
[part='toggle'] {
|
|
16
|
+
display: none;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
min-inline-size: var(--lyra-icon-button-size);
|
|
20
|
+
min-block-size: var(--lyra-icon-button-size);
|
|
21
|
+
border: 1px solid var(--lyra-color-border);
|
|
22
|
+
border-radius: var(--lyra-radius);
|
|
23
|
+
background: var(--lyra-color-surface);
|
|
24
|
+
color: var(--lyra-color-text);
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
:host([mode='mobile']) [part='toggle'] {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
}
|
|
30
|
+
[part='toggle']:hover {
|
|
31
|
+
background: var(--lyra-color-brand-quiet);
|
|
32
|
+
color: var(--lyra-color-brand);
|
|
33
|
+
}
|
|
34
|
+
[part='toggle']:focus-visible {
|
|
35
|
+
outline: var(--lyra-focus-ring-width) solid var(--lyra-focus-ring-color);
|
|
36
|
+
outline-offset: var(--lyra-focus-ring-offset);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[part='backdrop'] {
|
|
40
|
+
position: fixed;
|
|
41
|
+
inset: 0;
|
|
42
|
+
z-index: var(--lyra-overlay-stack-index, 1000);
|
|
43
|
+
background: var(--lyra-app-rail-overlay-color);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* [part="base"]/[part="panel"] are the SAME element -- this
|
|
47
|
+
component promotes it in place for the mobile overlay (mirrors
|
|
48
|
+
lyra-widget's fullscreen mode) rather than duplicating the slotted nav
|
|
49
|
+
content into a second element, which slot projection can't do anyway
|
|
50
|
+
(a light-DOM node can only be assigned to one <slot> at a time). Its
|
|
51
|
+
part attribute switches between the two names per render, so the two
|
|
52
|
+
rulesets below are always mutually exclusive on it. */
|
|
53
|
+
[part='base'] {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
inline-size: var(--lyra-app-rail-width);
|
|
57
|
+
block-size: 100%;
|
|
58
|
+
border-inline-end: 1px solid var(--lyra-color-border);
|
|
59
|
+
background: var(--lyra-color-surface);
|
|
60
|
+
overflow-y: auto;
|
|
61
|
+
transition: inline-size var(--lyra-transition-base);
|
|
62
|
+
}
|
|
63
|
+
:host([mode='icon-only']) [part='base'] {
|
|
64
|
+
inline-size: var(--lyra-app-rail-icon-width);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[part='panel'] {
|
|
68
|
+
position: fixed;
|
|
69
|
+
inset-block: 0;
|
|
70
|
+
inset-inline-start: 0;
|
|
71
|
+
z-index: calc(var(--lyra-overlay-stack-index, 1000) + 1);
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
inline-size: min(var(--lyra-app-rail-mobile-width), 85vw);
|
|
75
|
+
background: var(--lyra-color-surface);
|
|
76
|
+
box-shadow: var(--lyra-shadow);
|
|
77
|
+
overflow-y: auto;
|
|
78
|
+
transform: translateX(-100%);
|
|
79
|
+
transition: transform var(--lyra-transition-base);
|
|
80
|
+
}
|
|
81
|
+
/* translateX is a physical transform -- CSS logical properties don't cover
|
|
82
|
+
it -- so the offscreen direction is flipped explicitly for RTL via
|
|
83
|
+
:dir() rather than needing internal/rtl.ts's JS helper (that helper is
|
|
84
|
+
for pointer/keyboard math that can't be expressed in CSS at all; this
|
|
85
|
+
can). */
|
|
86
|
+
:host(:dir(rtl)) [part='panel'] {
|
|
87
|
+
transform: translateX(100%);
|
|
88
|
+
}
|
|
89
|
+
:host([mode='mobile'][open]) [part='panel'] {
|
|
90
|
+
transform: translateX(0);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[part='header'] {
|
|
94
|
+
padding: var(--lyra-space-m);
|
|
95
|
+
border-block-end: 1px solid var(--lyra-color-border);
|
|
96
|
+
}
|
|
97
|
+
[part='header'][hidden] {
|
|
98
|
+
display: none;
|
|
99
|
+
}
|
|
100
|
+
[part='footer'] {
|
|
101
|
+
padding: var(--lyra-space-m);
|
|
102
|
+
border-block-start: 1px solid var(--lyra-color-border);
|
|
103
|
+
}
|
|
104
|
+
[part='footer'][hidden] {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
[part='nav'] {
|
|
108
|
+
flex: 1 1 auto;
|
|
109
|
+
overflow-y: auto;
|
|
110
|
+
padding: var(--lyra-space-s);
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
gap: var(--lyra-space-xs);
|
|
114
|
+
}
|
|
115
|
+
:host([mode='icon-only']) [part='nav'] {
|
|
116
|
+
align-items: center;
|
|
117
|
+
}
|
|
118
|
+
:host([mode='icon-only']) ::slotted(lyra-app-rail-item) {
|
|
119
|
+
max-inline-size: var(--lyra-app-rail-icon-width);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@media (prefers-reduced-motion: reduce) {
|
|
123
|
+
[part='base'],
|
|
124
|
+
[part='panel'] {
|
|
125
|
+
transition: none !important;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
`;
|