@aceshooting/lyra-ui 9.1.1 → 10.0.1
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/CHANGELOG.md +597 -0
- package/custom-elements.json +1 -1
- package/dist/cli/migrate-wa.mjs +52 -0
- package/dist/cli/migration-contract.json +1 -1
- package/dist/components/agent-tools/activity-feed/activity-feed.class.js +1 -1
- package/dist/components/agent-tools/activity-feed/activity-feed.styles.js +0 -16
- package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.class.js +1 -1
- package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.styles.js +7 -5
- package/dist/components/agent-tools/agent-run/agent-run.class.js +2 -2
- package/dist/components/agent-tools/agent-run/agent-run.styles.js +0 -13
- package/dist/components/agent-tools/agent-trace/agent-trace.styles.js +7 -4
- package/dist/components/agent-tools/approval-queue/approval-queue.styles.js +7 -5
- package/dist/components/agent-tools/artifact-panel/artifact-panel.styles.js +0 -3
- package/dist/components/agent-tools/browser-frame/browser-frame.styles.js +3 -5
- package/dist/components/agent-tools/commit-card/commit-card.styles.js +0 -10
- package/dist/components/agent-tools/compare-panel/compare-panel.styles.js +11 -6
- package/dist/components/agent-tools/confirm-bar/confirm-bar.styles.js +0 -46
- package/dist/components/agent-tools/eval-dataset/eval-dataset.styles.js +0 -7
- package/dist/components/agent-tools/evaluation-run/evaluation-run.class.js +2 -2
- package/dist/components/agent-tools/prompt-studio/prompt-studio.styles.js +0 -15
- package/dist/components/agent-tools/result-card/result-card.styles.js +0 -7
- package/dist/components/agent-tools/result-card/result-field.styles.js +0 -5
- package/dist/components/agent-tools/schema-viewer/schema-viewer.styles.js +0 -3
- package/dist/components/agent-tools/span-waterfall/span-waterfall.styles.js +0 -15
- package/dist/components/agent-tools/stack-trace/stack-trace.styles.js +0 -20
- package/dist/components/agent-tools/subagent-panel/subagent-panel.class.js +2 -2
- package/dist/components/agent-tools/subagent-panel/subagent-panel.styles.js +0 -3
- package/dist/components/agent-tools/task-list/task-list.styles.js +0 -15
- package/dist/components/agent-tools/terminal/terminal.class.d.ts +11 -6
- package/dist/components/agent-tools/terminal/terminal.class.js +4 -4
- package/dist/components/agent-tools/terminal/terminal.styles.js +0 -46
- package/dist/components/agent-tools/test-results/test-results.class.js +2 -2
- package/dist/components/agent-tools/test-results/test-results.styles.js +0 -5
- package/dist/components/agent-tools/thinking-panel/thinking-panel.styles.js +0 -41
- package/dist/components/agent-tools/tool-approval-dialog/tool-approval-dialog.styles.js +0 -41
- package/dist/components/agent-tools/tool-call-chip/tool-call-chip.styles.js +0 -30
- package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +6 -6
- package/dist/components/agent-tools/tool-param-form/tool-param-form.styles.js +0 -5
- package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.styles.js +0 -20
- package/dist/components/agent-tools/tool-result-view/tool-result-view.styles.js +0 -4
- package/dist/components/agent-tools/tool-select-dialog/tool-select-dialog.styles.js +0 -21
- package/dist/components/agent-tools/trace-tree/trace-tree.styles.js +7 -31
- package/dist/components/charts/chart/box-plot.styles.js +0 -20
- package/dist/components/charts/chart/chart-colors.d.ts +1 -1
- package/dist/components/charts/chart/chart-colors.js +1 -1
- package/dist/components/charts/chart/chart-core-loader.d.ts +1 -0
- package/dist/components/charts/chart/chart-core-loader.js +1 -1
- package/dist/components/charts/chart/chart-feature-loader.d.ts +35 -0
- package/dist/components/charts/chart/chart-feature-loader.js +1 -1
- package/dist/components/charts/chart/chart.class.d.ts +93 -0
- package/dist/components/charts/chart/chart.class.js +3 -3
- package/dist/components/charts/chart/chart.styles.js +0 -27
- package/dist/components/charts/chart/lite-chart.class.d.ts +20 -1
- package/dist/components/charts/chart/lite-chart.class.js +4 -4
- package/dist/components/charts/chart/lite-chart.styles.js +0 -27
- package/dist/components/conversation/agent-workspace/agent-workspace.class.d.ts +20 -0
- package/dist/components/conversation/agent-workspace/agent-workspace.class.js +3 -1
- package/dist/components/conversation/agent-workspace/agent-workspace.styles.js +3 -0
- package/dist/components/conversation/audio-visualizer/audio-visualizer.styles.js +0 -7
- package/dist/components/conversation/branch-picker/branch-picker.styles.js +0 -3
- package/dist/components/conversation/chat-composer/chat-composer.styles.js +0 -51
- package/dist/components/conversation/chat-message/chat-message.styles.js +7 -35
- package/dist/components/conversation/chat-viewport/chat-viewport.class.js +1 -1
- package/dist/components/conversation/chat-viewport/chat-viewport.styles.js +0 -33
- package/dist/components/conversation/checkpoint/checkpoint.class.js +1 -1
- package/dist/components/conversation/checkpoint/checkpoint.styles.js +0 -3
- package/dist/components/conversation/code-block/code-block-shared.d.ts +5 -2
- package/dist/components/conversation/code-block/code-block.class.js +1 -1
- package/dist/components/conversation/code-block/code-block.styles.js +4 -95
- package/dist/components/conversation/code-block/code-loader.d.ts +11 -0
- package/dist/components/conversation/code-block/code-loader.js +1 -1
- package/dist/components/conversation/code-block/shiki-types.d.ts +12 -0
- package/dist/components/conversation/code-block/shiki-types.js +1 -1
- package/dist/components/conversation/conversation-item/conversation-item.styles.js +8 -54
- package/dist/components/conversation/generation-metrics/generation-metrics.class.js +2 -2
- package/dist/components/conversation/generation-metrics/generation-metrics.styles.js +0 -17
- package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
- package/dist/components/conversation/markdown/markdown.styles.js +0 -41
- package/dist/components/conversation/message-actions/message-actions.styles.js +0 -3
- package/dist/components/conversation/message-feedback/message-feedback.styles.js +0 -35
- package/dist/components/conversation/message-parts/message-parts.class.d.ts +1 -1
- package/dist/components/conversation/message-parts/message-parts.styles.js +0 -5
- package/dist/components/conversation/model-select/model-select.class.js +3 -3
- package/dist/components/conversation/model-select/model-select.styles.js +12 -47
- package/dist/components/conversation/model-settings-panel/model-settings-panel.styles.js +0 -6
- package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +3 -0
- package/dist/components/conversation/prompt-input/prompt-input.styles.js +0 -10
- package/dist/components/conversation/push-to-talk/push-to-talk.styles.js +0 -8
- package/dist/components/conversation/selection-toolbar/selection-toolbar.styles.js +1 -11
- package/dist/components/conversation/stream-status/stream-status.styles.js +0 -16
- package/dist/components/conversation/streaming-text/streaming-text.styles.js +0 -15
- package/dist/components/conversation/suggestion-chips/suggestion-chips.styles.js +0 -5
- package/dist/components/conversation/thread-list/thread-list.styles.js +0 -23
- package/dist/components/conversation/transcript-feed/transcript-feed.class.d.ts +16 -4
- package/dist/components/conversation/transcript-feed/transcript-feed.class.js +1 -1
- package/dist/components/conversation/transcript-feed/transcript-feed.styles.js +0 -1
- package/dist/components/conversation/typing-indicator/typing-indicator.styles.js +0 -23
- package/dist/components/conversation/usage-badge/usage-badge.styles.js +0 -3
- package/dist/components/conversation/voice-picker/voice-picker.class.js +3 -3
- package/dist/components/conversation/voice-picker/voice-picker.styles.js +9 -29
- package/dist/components/conversation/widget-renderer/resolve.d.ts +2 -0
- package/dist/components/conversation/widget-renderer/resolve.js +1 -1
- package/dist/components/data/calendar/calendar.class.d.ts +15 -2
- package/dist/components/data/calendar/calendar.class.js +2 -2
- package/dist/components/data/calendar/calendar.styles.js +2 -28
- package/dist/components/data/condition-builder/condition-builder.class.d.ts +10 -6
- package/dist/components/data/condition-builder/condition-builder.class.js +2 -2
- package/dist/components/data/condition-builder/condition-builder.styles.js +0 -6
- package/dist/components/data/context-meter/context-meter.styles.js +0 -24
- package/dist/components/data/data-grid/data-grid.class.js +3 -3
- package/dist/components/data/data-grid/data-grid.styles.js +0 -22
- package/dist/components/data/document-library/document-library.class.js +2 -2
- package/dist/components/data/document-library/document-library.styles.js +0 -4
- package/dist/components/data/env-list/env-list.class.js +1 -1
- package/dist/components/data/env-list/env-list.styles.js +7 -4
- package/dist/components/data/file-tree/file-tree.class.d.ts +12 -0
- package/dist/components/data/flow-canvas/flow-canvas.styles.js +12 -19
- package/dist/components/data/flow-controls/flow-controls.class.js +2 -2
- package/dist/components/data/flow-controls/flow-controls.styles.js +3 -36
- package/dist/components/data/flow-minimap/flow-minimap.class.js +1 -1
- package/dist/components/data/flow-minimap/flow-minimap.styles.js +0 -9
- package/dist/components/data/flow-node/flow-node.styles.js +0 -23
- package/dist/components/data/flow-run-status/flow-run-status.class.js +1 -1
- package/dist/components/data/flow-run-status/flow-run-status.styles.js +0 -7
- package/dist/components/data/graph-query-builder/graph-query-builder.class.d.ts +0 -7
- package/dist/components/data/graph-query-builder/graph-query-builder.class.js +1 -1
- package/dist/components/data/graph-query-builder/graph-query-builder.styles.js +0 -10
- package/dist/components/data/heatmap/heatmap-scale.d.ts +20 -0
- package/dist/components/data/heatmap/heatmap-scale.js +1 -1
- package/dist/components/data/heatmap/heatmap.class.d.ts +84 -1
- package/dist/components/data/heatmap/heatmap.class.js +2 -2
- package/dist/components/data/heatmap/heatmap.styles.js +0 -54
- package/dist/components/data/pagination/pagination.styles.js +23 -46
- package/dist/components/data/sequence-strip/sequence-strip.class.d.ts +34 -1
- package/dist/components/data/sequence-strip/sequence-strip.class.js +5 -2
- package/dist/components/data/sequence-strip/sequence-strip.styles.js +14 -20
- package/dist/components/data/sparkline/sparkline.class.js +1 -1
- package/dist/components/data/stat/stat.styles.js +0 -67
- package/dist/components/data/table/table.class.d.ts +42 -3
- package/dist/components/data/table/table.class.js +4 -4
- package/dist/components/data/table/table.styles.js +20 -91
- package/dist/components/data/timeline/timeline-item.styles.js +0 -30
- package/dist/components/data/timeline/timeline.class.d.ts +89 -1
- package/dist/components/data/timeline/timeline.class.js +2 -2
- package/dist/components/data/timeline/timeline.styles.js +111 -31
- package/dist/components/data/tree/tree-item.styles.js +1 -28
- package/dist/components/data/tree/tree.class.js +2 -2
- package/dist/components/data/tree/tree.styles.js +0 -6
- package/dist/components/data/word-cloud/word-cloud.styles.js +0 -5
- package/dist/components/forms/button/button.class.js +1 -1
- package/dist/components/forms/button/button.styles.js +0 -105
- package/dist/components/forms/checkbox/checkbox.class.d.ts +3 -0
- package/dist/components/forms/checkbox/checkbox.class.js +1 -1
- package/dist/components/forms/checkbox/checkbox.styles.js +0 -39
- package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +21 -2
- package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
- package/dist/components/forms/checkbox-group/checkbox-group.styles.js +0 -18
- package/dist/components/forms/code-editor/code-editor.styles.js +0 -30
- package/dist/components/forms/color-picker/color-picker.class.js +2 -2
- package/dist/components/forms/color-picker/color-picker.styles.js +0 -69
- package/dist/components/forms/combobox/combobox.class.js +2 -2
- package/dist/components/forms/combobox/combobox.styles.js +22 -111
- package/dist/components/forms/combobox/option.styles.js +7 -1
- package/dist/components/forms/date-picker/date-input.class.js +1 -1
- package/dist/components/forms/date-picker/date-input.styles.js +12 -67
- package/dist/components/forms/date-picker/date-picker.class.d.ts +1 -0
- package/dist/components/forms/date-picker/date-picker.class.js +22 -20
- package/dist/components/forms/date-picker/date-picker.styles.js +36 -29
- package/dist/components/forms/emoji-picker/emoji-data-loader.d.ts +6 -3
- package/dist/components/forms/emoji-picker/emoji-data-loader.js +1 -1
- package/dist/components/forms/emoji-picker/emoji-picker.class.d.ts +8 -1
- package/dist/components/forms/emoji-picker/emoji-picker.class.js +1 -1
- package/dist/components/forms/emoji-picker/emoji-picker.styles.js +3 -41
- package/dist/components/forms/icon-button/icon-button.class.js +1 -1
- package/dist/components/forms/icon-button/icon-button.styles.js +0 -16
- package/dist/components/forms/input/input.styles.js +0 -54
- package/dist/components/forms/input/number-input.styles.d.ts +4 -5
- package/dist/components/forms/input/number-input.styles.js +0 -11
- package/dist/components/forms/input/time-input-shared.d.ts +11 -0
- package/dist/components/forms/input/time-input-shared.js +1 -1
- package/dist/components/forms/input/time-input.class.d.ts +11 -2
- package/dist/components/forms/input/time-input.class.js +1 -1
- package/dist/components/forms/input/time-input.styles.js +0 -6
- package/dist/components/forms/locale-picker/locale-picker.class.js +2 -2
- package/dist/components/forms/locale-picker/locale-picker.styles.js +1 -26
- package/dist/components/forms/otp-input/otp-input.class.js +3 -3
- package/dist/components/forms/otp-input/otp-input.styles.js +0 -16
- package/dist/components/forms/phone-input/phone-input.class.d.ts +9 -1
- package/dist/components/forms/phone-input/phone-input.class.js +2 -2
- package/dist/components/forms/phone-input/phone-input.styles.js +0 -37
- package/dist/components/forms/radio/radio-button.styles.js +1 -30
- package/dist/components/forms/radio/radio-group.styles.js +0 -4
- package/dist/components/forms/radio/radio.styles.js +0 -44
- package/dist/components/forms/rubric-form/rubric-form.styles.js +0 -5
- package/dist/components/forms/select/select.class.js +1 -1
- package/dist/components/forms/select/select.styles.js +14 -114
- package/dist/components/forms/slider/slider.styles.js +0 -55
- package/dist/components/forms/swatch-picker/swatch-picker.class.d.ts +0 -11
- package/dist/components/forms/swatch-picker/swatch-picker.class.js +2 -2
- package/dist/components/forms/swatch-picker/swatch-picker.styles.js +0 -77
- package/dist/components/forms/switch/switch.class.d.ts +3 -0
- package/dist/components/forms/switch/switch.class.js +1 -1
- package/dist/components/forms/switch/switch.styles.js +0 -37
- package/dist/components/forms/textarea/textarea.styles.js +0 -28
- package/dist/components/forms/time-range/time-range.styles.js +12 -84
- package/dist/components/forms/token-input/token-input.class.d.ts +23 -9
- package/dist/components/forms/token-input/token-input.class.js +1 -1
- package/dist/components/forms/token-input/token-input.styles.js +1 -54
- package/dist/components/layout/app-rail/app-rail-item.class.js +2 -2
- package/dist/components/layout/app-rail/app-rail-item.styles.js +0 -13
- package/dist/components/layout/app-rail/app-rail.class.d.ts +5 -0
- package/dist/components/layout/app-rail/app-rail.class.js +1 -1
- package/dist/components/layout/app-rail/app-rail.styles.js +0 -46
- package/dist/components/layout/button-group/button-group.styles.js +0 -6
- package/dist/components/layout/card/card.class.d.ts +12 -0
- package/dist/components/layout/card/card.styles.js +3 -11
- package/dist/components/layout/carousel/carousel.styles.js +0 -1
- package/dist/components/layout/command-palette/command-palette.class.d.ts +8 -0
- package/dist/components/layout/command-palette/command-palette.class.js +3 -1
- package/dist/components/layout/command-palette/command-palette.styles.js +1 -13
- package/dist/components/layout/control-group/control-group.styles.js +0 -7
- package/dist/components/layout/dashboard-grid/dashboard-grid.styles.js +6 -25
- package/dist/components/layout/details/accordion.class.d.ts +13 -0
- package/dist/components/layout/details/accordion.class.js +1 -1
- package/dist/components/layout/details/details.class.js +1 -1
- package/dist/components/layout/details/details.styles.js +0 -12
- package/dist/components/layout/dock-panel/dock-panel.styles.js +0 -45
- package/dist/components/layout/drilldown-panel/drilldown-panel.class.d.ts +2 -0
- package/dist/components/layout/drilldown-panel/drilldown-panel.class.js +2 -2
- package/dist/components/layout/drilldown-panel/drilldown-panel.styles.js +0 -4
- package/dist/components/layout/filter-bar/filter-bar.class.js +1 -1
- package/dist/components/layout/filter-bar/filter-bar.styles.js +0 -9
- package/dist/components/layout/menu/menu-item.class.d.ts +5 -0
- package/dist/components/layout/menu/menu-item.class.js +1 -1
- package/dist/components/layout/menu/menu-item.styles.js +0 -49
- package/dist/components/layout/menu/menu-label.styles.js +0 -2
- package/dist/components/layout/menu/menu.styles.js +0 -18
- package/dist/components/layout/multi-split/multi-split.styles.js +0 -63
- package/dist/components/layout/page/page.class.d.ts +4 -0
- package/dist/components/layout/page/page.class.js +1 -1
- package/dist/components/layout/reorder-list/reorder-item.styles.js +0 -4
- package/dist/components/layout/responsive-panel/responsive-panel.styles.js +0 -27
- package/dist/components/layout/scroller/scroller.styles.js +0 -20
- package/dist/components/layout/segmented/segmented.class.d.ts +7 -1
- package/dist/components/layout/segmented/segmented.class.js +1 -1
- package/dist/components/layout/segmented/segmented.styles.js +69 -37
- package/dist/components/layout/split-panel/split-panel.styles.js +1 -7
- package/dist/components/layout/stepper/stepper.class.d.ts +8 -1
- package/dist/components/layout/stepper/stepper.class.js +1 -1
- package/dist/components/layout/stepper/stepper.styles.js +140 -41
- package/dist/components/layout/tab-group/tab-group.class.d.ts +4 -1
- package/dist/components/layout/tab-group/tab-group.styles.js +9 -75
- package/dist/components/layout/tab-group/tab.styles.js +0 -2
- package/dist/components/layout/virtual-list/virtual-list.class.d.ts +4 -4
- package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
- package/dist/components/layout/virtual-list/virtual-list.styles.js +0 -68
- package/dist/components/layout/widget/widget.class.d.ts +5 -1
- package/dist/components/layout/widget/widget.class.js +1 -1
- package/dist/components/layout/widget/widget.styles.js +97 -40
- package/dist/components/media/animated-image/animated-image.class.d.ts +3 -0
- package/dist/components/media/animated-image/animated-image.class.js +1 -1
- package/dist/components/media/animated-image/animated-image.styles.js +0 -28
- package/dist/components/media/attachment-chip/attachment-chip.class.d.ts +1 -1
- package/dist/components/media/attachment-chip/attachment-chip.class.js +1 -1
- package/dist/components/media/attachment-chip/attachment-chip.styles.js +0 -31
- package/dist/components/media/attachment-trigger/attachment-trigger.class.js +3 -3
- package/dist/components/media/attachment-trigger/attachment-trigger.styles.js +0 -40
- package/dist/components/media/av-player/av-player.class.d.ts +5 -6
- package/dist/components/media/av-player/av-player.class.js +1 -1
- package/dist/components/media/av-player/av-player.styles.js +0 -45
- package/dist/components/media/avatar/avatar.styles.js +3 -16
- package/dist/components/media/file-icon/file-icon.class.d.ts +1 -2
- package/dist/components/media/file-icon/file-icon.class.js +1 -1
- package/dist/components/media/file-input/file-input.class.d.ts +12 -0
- package/dist/components/media/file-input/file-input.styles.js +3 -24
- package/dist/components/media/flag/flag.class.d.ts +20 -0
- package/dist/components/media/flag/flag.class.js +4 -2
- package/dist/components/media/flag/flag.styles.js +7 -1
- package/dist/components/media/flag/language-map.d.ts +10 -0
- package/dist/components/media/flag/language-map.js +1 -1
- package/dist/components/media/image-comparer/image-comparer.styles.js +4 -33
- package/dist/components/media/image-viewer/image-viewer.class.js +0 -2
- package/dist/components/media/image-viewer/image-viewer.styles.js +7 -27
- package/dist/components/media/lightbox/lightbox.class.js +0 -2
- package/dist/components/media/lightbox/lightbox.styles.js +0 -21
- package/dist/components/media/map/map-loader.d.ts +19 -1
- package/dist/components/media/map/map-loader.js +1 -1
- package/dist/components/media/map/map.class.d.ts +141 -1
- package/dist/components/media/map/map.class.js +15 -3
- package/dist/components/media/map/map.styles.js +20 -17
- package/dist/components/media/media-card/media-card.class.d.ts +14 -3
- package/dist/components/media/media-card/media-card.class.js +1 -1
- package/dist/components/media/media-card/media-card.styles.js +2 -28
- package/dist/components/media/pan-zoom/pan-zoom.styles.js +0 -3
- package/dist/components/media/qr-code/qr-code.class.d.ts +3 -2
- package/dist/components/media/qr-code/qr-code.class.js +2 -2
- package/dist/components/media/qr-code/qr-code.styles.js +0 -3
- package/dist/components/media/sequence-playback/sequence-playback.class.d.ts +2 -0
- package/dist/components/media/sequence-playback/sequence-playback.class.js +2 -1
- package/dist/components/media/sequence-playback/sequence-playback.styles.js +0 -19
- package/dist/components/media/video/video.class.d.ts +23 -2
- package/dist/components/media/video/video.class.js +3 -3
- package/dist/components/media/video/video.styles.js +4 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.class.d.ts +3 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.class.js +2 -2
- package/dist/components/media/zoomable-frame/zoomable-frame.styles.js +0 -5
- package/dist/components/overlays/alert/alert.styles.js +4 -2
- package/dist/components/overlays/badge/badge.styles.js +4 -48
- package/dist/components/overlays/badge/tag.styles.js +0 -14
- package/dist/components/overlays/callout/callout.styles.js +0 -11
- package/dist/components/overlays/chip/chip-group.styles.js +0 -18
- package/dist/components/overlays/chip/chip.styles.js +6 -69
- package/dist/components/overlays/dialog/confirm.d.ts +1 -4
- package/dist/components/overlays/dialog/confirm.js +1 -1
- package/dist/components/overlays/dialog/dialog.class.d.ts +12 -9
- package/dist/components/overlays/dialog/dialog.class.js +1 -1
- package/dist/components/overlays/dialog/dialog.styles.js +0 -43
- package/dist/components/overlays/drawer/drawer.class.d.ts +2 -2
- package/dist/components/overlays/drawer/drawer.styles.js +0 -9
- package/dist/components/overlays/empty/empty.styles.js +0 -12
- package/dist/components/overlays/kbd/kbd.styles.js +0 -8
- package/dist/components/overlays/overlay/dropdown.class.d.ts +1 -6
- package/dist/components/overlays/overlay/dropdown.class.js +2 -2
- package/dist/components/overlays/overlay/overlay.styles.js +0 -28
- package/dist/components/overlays/overlay/popover.class.d.ts +9 -1
- package/dist/components/overlays/overlay/popover.class.js +2 -2
- package/dist/components/overlays/overlay/tooltip.class.d.ts +10 -0
- package/dist/components/overlays/overlay/tooltip.class.js +1 -1
- package/dist/components/overlays/popup/popup.class.d.ts +1 -0
- package/dist/components/overlays/popup/popup.class.js +1 -1
- package/dist/components/overlays/popup/popup.styles.js +0 -15
- package/dist/components/overlays/progress/progress-ring.class.d.ts +9 -1
- package/dist/components/overlays/progress/progress-ring.class.js +3 -3
- package/dist/components/overlays/progress/progress.styles.js +0 -21
- package/dist/components/overlays/rating/rating.styles.js +0 -25
- package/dist/components/overlays/skeleton/skeleton.styles.js +0 -4
- package/dist/components/overlays/spinner/spinner.styles.js +0 -3
- package/dist/components/overlays/toast/toast-item.styles.js +3 -45
- package/dist/components/retrieval/chunk-inspector/chunk-inspector.styles.js +0 -35
- package/dist/components/retrieval/citation-badge/citation-badge.class.d.ts +2 -2
- package/dist/components/retrieval/citation-badge/citation-badge.class.js +3 -3
- package/dist/components/retrieval/citation-badge/citation-badge.styles.js +0 -20
- package/dist/components/retrieval/claim-evidence/claim-evidence.styles.js +0 -8
- package/dist/components/retrieval/community-card/community-card.class.d.ts +1 -0
- package/dist/components/retrieval/community-card/community-card.styles.js +0 -6
- package/dist/components/retrieval/embedding-explorer/embedding-explorer.styles.js +8 -12
- package/dist/components/retrieval/entity-card/entity-card.class.d.ts +4 -3
- package/dist/components/retrieval/entity-card/entity-card.class.js +1 -1
- package/dist/components/retrieval/entity-card/entity-card.styles.js +0 -12
- package/dist/components/retrieval/entity-chip/entity-chip.class.d.ts +10 -4
- package/dist/components/retrieval/entity-chip/entity-chip.class.js +3 -3
- package/dist/components/retrieval/entity-chip/entity-chip.styles.js +6 -9
- package/dist/components/retrieval/entity-dossier/entity-dossier.class.d.ts +19 -5
- package/dist/components/retrieval/graph/graph.class.d.ts +5 -0
- package/dist/components/retrieval/graph/graph.class.js +1 -1
- package/dist/components/retrieval/graph/graph.styles.js +0 -30
- package/dist/components/retrieval/graph-legend/graph-legend.styles.js +0 -3
- package/dist/components/retrieval/ingestion-queue/ingestion-queue.styles.js +0 -25
- package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.d.ts +2 -0
- package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.styles.js +0 -7
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +20 -6
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +2 -2
- package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.styles.js +0 -16
- package/dist/components/retrieval/mind-map/mind-map.class.d.ts +5 -3
- package/dist/components/retrieval/mind-map/mind-map.class.js +1 -1
- package/dist/components/retrieval/mind-map/mind-map.styles.js +0 -2
- package/dist/components/retrieval/neighbor-list/neighbor-list.class.d.ts +3 -2
- package/dist/components/retrieval/neighbor-list/neighbor-list.class.js +1 -1
- package/dist/components/retrieval/neighbor-list/neighbor-list.styles.js +0 -30
- package/dist/components/retrieval/node-palette/node-palette.styles.js +0 -11
- package/dist/components/retrieval/path-strip/path-strip.styles.js +0 -10
- package/dist/components/retrieval/provenance-panel/provenance-panel.class.d.ts +12 -3
- package/dist/components/retrieval/provenance-panel/provenance-panel.styles.js +0 -2
- package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.d.ts +3 -2
- package/dist/components/retrieval/rag-eval-dashboard/rag-eval-dashboard.class.js +2 -2
- package/dist/components/retrieval/retrieval-results/retrieval-results.styles.js +0 -28
- package/dist/components/retrieval/retrieval-search/retrieval-search.styles.js +0 -4
- package/dist/components/retrieval/retrieval-trace/retrieval-trace.styles.js +0 -2
- package/dist/components/retrieval/source-card/source-card.styles.js +0 -13
- package/dist/components/retrieval/source-list/source-list.styles.js +0 -7
- package/dist/components/retrieval/source-picker/source-picker.styles.js +0 -7
- package/dist/components/utility/copy-button/copy-button.styles.js +0 -10
- package/dist/components/utility/diff-view/diff-view.styles.js +0 -14
- package/dist/components/utility/export-button/export-button.styles.js +0 -22
- package/dist/components/utility/icon/icon.styles.js +0 -6
- package/dist/components/utility/json-viewer/json-viewer.styles.js +2 -48
- package/dist/components/utility/known-date/known-date.class.d.ts +7 -3
- package/dist/components/utility/known-date/known-date.styles.js +10 -51
- package/dist/components/utility/live-region/live-region.styles.js +0 -4
- package/dist/components/utility/mention-popover/mention-popover.styles.js +0 -25
- package/dist/components/utility/poll-status/poll-status.styles.js +0 -4
- package/dist/components/utility/random-content/random-content.class.d.ts +22 -0
- package/dist/components/utility/random-content/random-content.class.js +3 -2
- package/dist/components/utility/random-content/random-content.styles.js +6 -13
- package/dist/components/utility/tour/tour.class.d.ts +4 -2
- package/dist/components/utility/tour/tour.class.js +3 -3
- package/dist/components/utility/tour/tour.styles.js +0 -13
- package/dist/components/utility/visually-hidden/visually-hidden.styles.js +0 -5
- package/dist/components/viewers/archive-viewer/archive-viewer.class.js +1 -1
- package/dist/components/viewers/archive-viewer/archive-viewer.styles.d.ts +2 -2
- package/dist/components/viewers/archive-viewer/archive-viewer.styles.js +0 -10
- package/dist/components/viewers/csv-viewer/csv-viewer.class.js +1 -1
- package/dist/components/viewers/csv-viewer/csv-viewer.styles.js +0 -19
- package/dist/components/viewers/dataset-viewer/dataset-viewer.class.js +1 -1
- package/dist/components/viewers/dataset-viewer/dataset-viewer.styles.js +0 -15
- package/dist/components/viewers/document-compare/document-compare.styles.js +0 -3
- package/dist/components/viewers/document-preview/document-preview.styles.js +0 -25
- package/dist/components/viewers/document-viewer/document-viewer.class.d.ts +2 -1
- package/dist/components/viewers/document-viewer/document-viewer.class.js +1 -1
- package/dist/components/viewers/document-viewer/document-viewer.styles.js +0 -5
- package/dist/components/viewers/docx-viewer/docx-viewer.styles.js +0 -17
- package/dist/components/viewers/ebook-viewer/ebook-viewer.styles.js +0 -4
- package/dist/components/viewers/email-viewer/email-viewer.styles.js +0 -7
- package/dist/components/viewers/geojson-view/geojson-view.styles.js +0 -5
- package/dist/components/viewers/highlight-layer/highlight-layer.styles.js +0 -3
- package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +1 -1
- package/dist/components/viewers/notebook-viewer/notebook-viewer.styles.js +0 -38
- package/dist/components/viewers/page-rail/page-rail.class.js +1 -1
- package/dist/components/viewers/page-rail/page-rail.styles.js +0 -13
- package/dist/components/viewers/pdf-viewer/pdf-loader.d.ts +13 -2
- package/dist/components/viewers/pdf-viewer/pdf-loader.js +1 -1
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +32 -2
- package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +4 -4
- package/dist/components/viewers/pdf-viewer/pdf-viewer.styles.js +1 -27
- package/dist/components/viewers/pptx-viewer/pptx-viewer.styles.js +0 -3
- package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.js +1 -1
- package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.styles.js +0 -14
- package/dist/components/viewers/svg-viewer/svg-viewer.styles.js +0 -7
- package/dist/components/viewers/xml-viewer/xml-viewer.styles.js +2 -24
- package/dist/custom-elements-jsx.d.ts +56 -37
- package/dist/events.d.ts +43 -33
- package/dist/internal/agent-status-variants.d.ts +18 -0
- package/dist/internal/agent-status-variants.js +1 -0
- package/dist/internal/announcer.d.ts +8 -3
- package/dist/internal/announcer.js +1 -1
- package/dist/internal/autoloader-manifest.js +1 -1
- package/dist/internal/canvas-color.d.ts +16 -0
- package/dist/internal/canvas-color.js +1 -1
- package/dist/internal/catalog-picker.d.ts +0 -1
- package/dist/internal/catalog-picker.js +1 -1
- package/dist/internal/default-strings.generated.d.ts +1 -0
- package/dist/internal/default-strings.generated.js +1 -1
- package/dist/internal/dev-mode-attribute-warning.d.ts +27 -4
- package/dist/internal/dev-mode-attribute-warning.js +1 -1
- package/dist/internal/localization-runtime.js +1 -1
- package/dist/internal/localization-types.d.ts +1 -1
- package/dist/internal/localization.js +1 -1
- package/dist/internal/lyra-element.d.ts +13 -0
- package/dist/internal/lyra-element.js +1 -1
- package/dist/internal/media-controller.js +1 -1
- package/dist/internal/package-metadata.d.ts +1 -1
- package/dist/internal/package-metadata.js +1 -1
- package/dist/internal/scroll-overflow.d.ts +35 -13
- package/dist/internal/scroll-overflow.js +1 -1
- package/dist/internal/sizes.styles.js +0 -2
- package/dist/internal/specialist-tokens.styles.js +6 -11
- package/dist/internal/text-highlights.d.ts +4 -1
- package/dist/internal/text-highlights.js +1 -1
- package/dist/internal/tokens/palette.styles.js +0 -15
- package/dist/internal/tokens.styles.js +19 -113
- package/dist/lyra.d.ts +8 -5
- package/dist/styles/reservations.css +82 -0
- package/dist/svelte.d.ts +56 -37
- package/dist/translations/ar.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/pt-BR.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/zh-CN.js +1 -1
- package/dist/vue.d.ts +56 -37
- package/llms/components/lr-accordion-item.md +12 -3
- package/llms/components/lr-accordion.md +11 -2
- package/llms/components/lr-agent-eval-dashboard.md +1 -1
- package/llms/components/lr-agent-trace.md +3 -1
- package/llms/components/lr-agent-workspace.md +20 -0
- package/llms/components/lr-artifact-panel.md +10 -4
- package/llms/components/lr-attachment-chip.md +7 -4
- package/llms/components/lr-attachment-trigger.md +7 -4
- package/llms/components/lr-av-player.md +3 -1
- package/llms/components/lr-avatar.md +6 -6
- package/llms/components/lr-bar-chart.md +4 -3
- package/llms/components/lr-box-plot.md +1 -1
- package/llms/components/lr-browser-frame.md +7 -3
- package/llms/components/lr-bubble-chart.md +4 -3
- package/llms/components/lr-calendar.md +9 -2
- package/llms/components/lr-card.md +24 -0
- package/llms/components/lr-chart.md +32 -8
- package/llms/components/lr-chat-viewport.md +7 -2
- package/llms/components/lr-checkbox-group.md +13 -5
- package/llms/components/lr-checkbox.md +5 -2
- package/llms/components/lr-checkpoint.md +6 -2
- package/llms/components/lr-combobox.md +5 -2
- package/llms/components/lr-command-palette.md +4 -1
- package/llms/components/lr-confirm-bar.md +7 -3
- package/llms/components/lr-context-meter.md +12 -11
- package/llms/components/lr-conversation-item.md +7 -4
- package/llms/components/lr-details.md +11 -2
- package/llms/components/lr-dialog.md +15 -10
- package/llms/components/lr-dock-panel.md +7 -10
- package/llms/components/lr-document-preview.md +6 -1
- package/llms/components/lr-document-viewer.md +3 -2
- package/llms/components/lr-doughnut-chart.md +4 -3
- package/llms/components/lr-drawer.md +3 -3
- package/llms/components/lr-entity-card.md +3 -3
- package/llms/components/lr-entity-chip.md +1 -1
- package/llms/components/lr-entity-dossier.md +4 -1
- package/llms/components/lr-file-input.md +2 -2
- package/llms/components/lr-flag.md +20 -5
- package/llms/components/lr-heatmap.md +28 -0
- package/llms/components/lr-histogram.md +3 -1
- package/llms/components/lr-icon.md +1 -1
- package/llms/components/lr-json-schema-viewer.md +2 -1
- package/llms/components/lr-knowledge-graph-explorer.md +8 -3
- package/llms/components/lr-known-date.md +4 -2
- package/llms/components/lr-line-chart.md +4 -3
- package/llms/components/lr-lite-chart.md +16 -6
- package/llms/components/lr-map.md +72 -8
- package/llms/components/lr-markdown-core.md +3 -2
- package/llms/components/lr-media-card.md +28 -12
- package/llms/components/lr-message-parts.md +2 -1
- package/llms/components/lr-model-select.md +9 -10
- package/llms/components/lr-model-settings-panel.md +9 -9
- package/llms/components/lr-neighbor-list.md +1 -1
- package/llms/components/lr-notebook-viewer.md +6 -3
- package/llms/components/lr-option.md +5 -2
- package/llms/components/lr-pdf-viewer.md +62 -2
- package/llms/components/lr-pie-chart.md +4 -3
- package/llms/components/lr-polar-area-chart.md +4 -3
- package/llms/components/lr-popover.md +5 -0
- package/llms/components/lr-progress-ring.md +8 -1
- package/llms/components/lr-prompt-studio.md +1 -1
- package/llms/components/lr-provenance-panel.md +4 -2
- package/llms/components/lr-qr-code.md +1 -1
- package/llms/components/lr-radar-chart.md +4 -3
- package/llms/components/lr-rag-eval-dashboard.md +2 -2
- package/llms/components/lr-random-content.md +13 -0
- package/llms/components/lr-reorder-item.md +6 -1
- package/llms/components/lr-reorder-list.md +6 -1
- package/llms/components/lr-responsive-panel.md +11 -7
- package/llms/components/lr-scatter-chart.md +4 -3
- package/llms/components/lr-sequence-strip.md +16 -2
- package/llms/components/lr-slider.md +12 -5
- package/llms/components/lr-sparkline.md +1 -1
- package/llms/components/lr-suggestion-chips.md +7 -2
- package/llms/components/lr-swatch-picker.md +5 -5
- package/llms/components/lr-switch.md +5 -2
- package/llms/components/lr-table.md +30 -4
- package/llms/components/lr-terminal.md +3 -1
- package/llms/components/lr-thread-list.md +8 -8
- package/llms/components/lr-time-input.md +6 -1
- package/llms/components/lr-timeline-item.md +24 -0
- package/llms/components/lr-timeline.md +25 -1
- package/llms/components/lr-token-input.md +7 -2
- package/llms/components/lr-tool-approval-dialog.md +7 -8
- package/llms/components/lr-tool-call-chip.md +5 -1
- package/llms/components/lr-tool-param-form.md +14 -12
- package/llms/components/lr-tool-result-dialog.md +11 -9
- package/llms/components/lr-tool-result-view.md +7 -6
- package/llms/components/lr-tool-select-dialog.md +18 -16
- package/llms/components/lr-trace-tree.md +3 -1
- package/llms/components/lr-usage-badge.md +4 -1
- package/llms/components/lr-video-playlist.md +1 -1
- package/llms/components/lr-virtual-list.md +22 -14
- package/llms/components/lr-voice-picker.md +8 -5
- package/llms/components/lr-widget-renderer.md +3 -3
- package/llms/components/lr-widget.md +1 -1
- package/llms/components/lr-word-cloud.md +6 -2
- package/llms/peers.md +12 -2
- package/llms/shared.md +70 -2
- package/llms-full.txt +1143 -285
- package/package.json +17 -5
- package/vscode-css-data.json +37 -2
- package/vscode-html-data.json +401 -44
- package/web-types.json +299 -55
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{isAccessibilitySubtreeExcluded,isAccessibilityVisibilityHidden,nextId,resolveAccessibleTrigger}from"../../../internal/a11y.js";import{acquireAriaOwnership}from"../../../internal/aria-ownership.js";import{isActionableElement}from"../../../internal/focus-navigation.js";import{place,virtualAnchorFromRect}from"../../../internal/positioner.js";import{rtlAwarePlacement}from"../../../internal/rtl.js";import{finiteDuration,finiteNumber}from"../../../internal/numbers.js";import{omittedEmptyStringConverter,trueDefaultBooleanConverter}from"../../../internal/converters.js";import{activateOverlay,composedContains}from"../../../internal/overlay-manager.js";import{animateRegistered}from"../../../internal/registered-animation.js";import{composedAccessibilityTextResult}from"../../../internal/accessibility-visibility.js";import{applyOverlayArrow}from"./overlay-arrow.js";import{normalizeVirtualRect,observeOverlayAnchorIdentity,OverlayTransitionGate,resolveOverlayAnchor}from"./overlay-shared.js";import{tooltipStyles}from"./overlay.styles.js";import{LYRA_DEFAULT_popover}from"../../../internal/default-strings.generated.js";const DEFAULT_SHOW_DELAY=150,DEFAULT_HIDE_DELAY=0,DEFAULT_DISTANCE=8,MAX_SHADOW_CONTENT_SCAN_FRAMES=4;class LyraTooltip extends LyraElement{constructor(){super(...arguments),this._open=!1,this.trigger="hover focus",this.manual=!1,this.showDelay=150,this.hideDelay=0,this.placement="top",this.distance=8,this.skidding=0,this._for="",this.anchor=null,this.disabled=!1,this.hoist=!1,this.arrow=!0,this.withoutArrow=!1,this.arrowPlacement="anchor",this.arrowPadding=0,this.content="",this.accessibleLabel="",this.namedTriggerMode=!0,this.interactiveContent=!1,this.resolvedSide="top",this.anchorPositioned=!1,this.observedDirectAnchorWasConnected=!1,this.restoreFocusOnClose=!1,this.suppressTriggerFocusOpen=!1,this.tooltipId=nextId("tooltip"),this.descriptionId=nextId("tooltip-description"),this.contentSlotListeners=new Set,this.shadowContentScanAttempts=0,this.transitionToken=0,this.transitionGate=new OverlayTransitionGate,this.onTriggerSlotChange=event=>{this.syncNamedTriggerMode();const slot=event.target;this.slottedTriggerElement=slot.assignedElements({flatten:!0})[0],this.syncInteractionTrigger()},this.onEnter=event=>{if(!this.disabled){if(this.syncTriggerA11y(),event.type==="focusin"){if(this.suppressTriggerFocusOpen||!this.opensOn("focus"))return}else if(!this.opensOn("hover"))return;this.requestTransition(!0)}},this.onLeave=event=>{if(event.type==="focusout"?!this.opensOn("focus"):!this.opensOn("hover"))return;const next=event.relatedTarget;next!==null&&next.nodeType===1&&this.triggerElement&&composedContains(this.triggerElement,next)||this.interactiveContent&&this.isPopupTarget(next)||this.requestTransition(!1)},this.onTriggerClick=()=>{this.disabled||this.opensOn("click")&&(this.syncTriggerA11y(),this._open?this.hide():this.show())},this.onPopupEnter=()=>{!this.interactiveContent||this.isManual||(this.cancelPendingTransition(),this.show())},this.onPopupLeave=event=>{if(!this.interactiveContent||this.isManual)return;const next=event.relatedTarget;next!==null&&next.nodeType===1&&(this.triggerElement&&composedContains(this.triggerElement,next)||this.isPopupTarget(next))||this.requestTransition(!1)},this.onContentSlotChange=event=>{event.target?.localName==="slot"&&this.updateInteractiveContent()},this.onTriggerKeyDown=event=>{this.isManual||!this.open||event.key!=="Escape"||!this.overlayHandle?.isTopmost()||(event.preventDefault(),this.hide())}}static{this.defaultStrings={...super.defaultStrings,popover:LYRA_DEFAULT_popover}}static{this.styles=[LyraElement.styles,tooltipStyles]}get open(){return this._open}set open(next){const normalized=!!next;if(normalized||this.cancelPendingTransition(),normalized!==this._open){if(!this.hasUpdated){this.applyOpenState(normalized);return}normalized?this.show():this.hide()}}get for(){return this._for}set for(next){this._for=next??""}get rendersArrow(){return this.arrow&&!this.withoutArrow}get activeContentSlot(){const selector=this.namedTriggerMode?'[part~="body"] slot:not([name])':'[part~="body"] slot[name="content"]';return(this.renderRoot??this.shadowRoot)?.querySelector(selector)??null}syncNamedTriggerMode(schedule=!0){const children=Array.from(this.children),hasNamedTrigger=children.some(child=>child.getAttribute("slot")==="trigger"),hasShoelaceContent=this.content.length>0||children.some(child=>child.getAttribute("slot")==="content"),next=hasNamedTrigger||!hasShoelaceContent;if(next===this.namedTriggerMode)return;const old=this.namedTriggerMode;this.namedTriggerMode=next,schedule&&this.hasUpdated&&this.requestUpdate("namedTriggerMode",old)}get triggerKeywords(){return new Set(String(this.trigger??"").trim().split(/\s+/).filter(Boolean))}get isManual(){const keywords=this.triggerKeywords;return this.manual||keywords.size===0||keywords.has("manual")}opensOn(keyword){return!this.isManual&&this.triggerKeywords.has(keyword)}willUpdate(changed){super.willUpdate(changed),this.syncNamedTriggerMode(!1),(changed.has("manual")||changed.has("trigger"))&&this.isManual&&this.cancelPendingTransition(),changed.has("disabled")&&this.disabled&&(this.cancelPendingTransition(),this._open&&(this.hasUpdated?this.hide():this.applyOpenState(!1))),changed.has("anchor")&&changed.get("anchor")===this.observedDirectAnchor&&this.observedDirectAnchorWasConnected&&this.anchor?.isConnected!==!0&&this.open&&!this.resolveAnchor()&&this.forceClose(),changed.has("showDelay")&&this.pendingDirection==="show"&&this.requestTransition(!0),changed.has("hideDelay")&&this.pendingDirection==="hide"&&this.requestTransition(!1),changed.has("for")&&this.syncInteractionTrigger()}updated(changed){if(super.updated(changed),(changed.has("for")||changed.has("anchor")||changed.has("open"))&&this.syncAnchorIdentityObservation(),changed.has("open")||changed.has("placement")||changed.has("distance")||changed.has("skidding")||changed.has("for")||changed.has("anchor")||changed.has("hoist")||changed.has("arrow")||changed.has("withoutArrow")||changed.has("arrowPlacement")||changed.has("arrowPadding")||changed.has("interactiveContent")){if(this.cleanup?.(),this.cleanup=void 0,this.open&&this.isConnected&&this.position(),changed.has("open"))if(this.open)this.updateInteractiveContent(),this.isConnected&&this.requiresOverlayManager&&this.activateTooltipOverlay();else{this.positionedAnchor=void 0,this.anchorPositioned=!1;const restoreFocus=this.restoreFocusOnClose;this.suppressTriggerFocusOpen=restoreFocus;try{this.overlayHandle?.deactivate({restoreFocus})}finally{this.suppressTriggerFocusOpen=!1}this.overlayHandle=void 0,this.restoreFocusOnClose=!1,this.virtualAnchor=void 0,this.returnFocusTo=void 0,this.syncInteractionTrigger()}else changed.has("interactiveContent")&&this.open&&this.isConnected&&(this.requiresOverlayManager?this.activateTooltipOverlay():(this.overlayHandle?.deactivate({restoreFocus:!1}),this.overlayHandle=void 0));this.syncTriggerA11y()}(changed.has("content")||changed.has("accessibleLabel"))&&this.updateDescriptionProxy()}connectedCallback(){super.connectedCallback(),this.syncAnchorIdentityObservation(),this.ensureDescriptionProxy(),this.contentObserver?.disconnect();const MutationObserverCtor=this.ownerDocument.defaultView?.MutationObserver;this.contentObserver=MutationObserverCtor?new MutationObserverCtor(()=>{this.syncNamedTriggerMode(),this.updateInteractiveContent()}):void 0,this.updateInteractiveContent(),this.syncInteractionTrigger(),this.hasUpdated&&this.open&&(this.position(),this.requiresOverlayManager&&(this.overlayHandle?.isActive()?this.overlayHandle.resume():this.activateTooltipOverlay()))}disconnectedCallback(){this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0,this.cancelPendingTransition(),this.cleanup?.(),this.cleanup=void 0,this.overlayHandle?.suspend(),this.triggerElement&&this.unbindTrigger(this.triggerElement),this.releaseTriggerA11y(),this.triggerElement=void 0,this.contentObserver?.disconnect(),this.contentObserver=void 0,this.stopLabelReferenceIdentityObservation?.(),this.stopLabelReferenceIdentityObservation=void 0,this.clearContentSlotListeners(),this.cancelShadowContentScan(),this.transitionToken++,this.cancelTransitionAnimation(),this.removeAttribute("data-closing"),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0,this.cancelPendingTransition(),this.cancelShadowContentScan(),this.contentObserver?.disconnect(),this.contentObserver=void 0,this.stopLabelReferenceIdentityObservation?.(),this.stopLabelReferenceIdentityObservation=void 0,this.clearContentSlotListeners(),this.releaseTriggerA11y()}syncAnchorIdentityObservation(){this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0;const directAnchor=this.open?this.anchor??void 0:void 0;if(this.observedDirectAnchor=directAnchor,this.observedDirectAnchorWasConnected=directAnchor?.isConnected===!0,!this.isConnected||!this.for&&!directAnchor)return;const onIdentityChange=()=>{const directAnchorRemoved=this.anchor===this.observedDirectAnchor&&this.observedDirectAnchorWasConnected&&this.observedDirectAnchor?.isConnected===!1;if(this.observedDirectAnchorWasConnected=this.observedDirectAnchor?.isConnected===!0,this.syncInteractionTrigger(),!this.open)return;const nextAnchor=this.resolveAnchor();if(directAnchorRemoved&&!nextAnchor){this.forceClose();return}nextAnchor!==this.positionedAnchor&&this.position()},observedRoots=new Set([this]);directAnchor&&directAnchor.getRootNode()!==this.getRootNode()&&observedRoots.add(directAnchor.isConnected?directAnchor:directAnchor.ownerDocument);const cleanups=[...observedRoots].map(root=>observeOverlayAnchorIdentity(root,onIdentityChange));this.stopAnchorIdentityObservation=()=>{for(const cleanup of cleanups)cleanup()}}resolveForTrigger(){if(!this.for)return;const target=this.getRootNode().getElementById?.(this.for)??null,HTMLElementCtor=target?.ownerDocument.defaultView?.HTMLElement;return target&&HTMLElementCtor&&target instanceof HTMLElementCtor?target:void 0}syncInteractionTrigger(){const next=this.virtualAnchor?void 0:this.slottedTriggerElement??this.resolveForTrigger();this.adoptTrigger(next)}activateTooltipOverlay(){if(!this.isConnected)return;const restoreFocusTarget=this.virtualAnchor?this.returnFocusTo??null:this.accessibleTrigger;if(this.overlayHandle?.isActive()){this.overlayHandle.updateRestoreFocusTo(restoreFocusTarget);return}this.overlayHandle=activateOverlay({host:this,panel:()=>this.renderRoot.querySelector('[part~="popup"]'),onEscape:()=>this.hide({restoreFocus:this.shouldRestoreFocusAfterEscape()}),restoreFocusTo:restoreFocusTarget,modal:!1,trapFocus:!1}),this.overlayHandle.focusAutofocus()}shouldRestoreFocusAfterEscape(){if(this.virtualAnchor)return this.returnFocusTo!==void 0;const active=this.ownerDocument.activeElement;return active!==null&&composedContains(this,active)}get requiresOverlayManager(){return this.open}showAt(rect,options){const normalizedRect=normalizeVirtualRect(rect);if(!normalizedRect)return;const previousAnchor=this.virtualAnchor,previousReturnFocusTo=this.returnFocusTo;if(this.virtualAnchor=virtualAnchorFromRect(normalizedRect),this.returnFocusTo=options?.returnFocusTo,this.syncInteractionTrigger(),this.open){this.activateTooltipOverlay(),this.position();return}this.show(),!this.open&&(this.virtualAnchor=previousAnchor,this.returnFocusTo=previousReturnFocusTo,this.syncInteractionTrigger())}show(){return this.cancelPendingTransition(),this.disabled||this._open?Promise.resolve():this.transitionGate.request(!0,()=>{if(this.emit("lr-show",null,{cancelable:!0}).defaultPrevented){this.syncOpenAttribute();return}return this.cancelTransitionAnimation(),this.removeAttribute("data-closing"),this.applyOpenState(!0),this.settleTransition("lr-after-show")})}hide(options){return this.cancelPendingTransition(),this._open?this.transitionGate.request(!1,()=>{if(this.emit("lr-hide",null,{cancelable:!0}).defaultPrevented){this.syncOpenAttribute();return}return options?.restoreFocus&&(this.restoreFocusOnClose=!0),this.cancelTransitionAnimation(),this.isConnected&&this.setAttribute("data-closing",""),this.applyOpenState(!1),this.settleTransition("lr-after-hide")}):Promise.resolve()}forceClose(){return this.cancelPendingTransition(),this._open?(this.cancelTransitionAnimation(),this.isConnected&&this.setAttribute("data-closing",""),this.applyOpenState(!1),this.settleTransition("lr-after-hide")):Promise.resolve()}applyOpenState(next){const old=this._open;this._open=next,next||this.cancelShadowContentScan(),this.requestUpdate("open",old)}syncOpenAttribute(){this.toggleAttribute("open",this._open)}cancelTransitionAnimation(){this.transitionAnimation?.cancel(),this.transitionAnimation=void 0}async settleTransition(event){const token=++this.transitionToken;if(await this.updateComplete,this.transitionToken===token){if(this.isConnected){const popup=this.renderRoot.querySelector('[part~="popup"]'),showing=event==="lr-after-show",animation=popup?animateRegistered(this,popup,`tooltip.${showing?"show":"hide"}`,this.effectiveDirection,{keyframes:showing?[{opacity:0},{opacity:1}]:[{opacity:1},{opacity:0}],durationProperties:["--lr-transition-fast","--lr-duration-fast"],easingProperties:["--lr-easing-standard"]}):void 0;if(this.transitionAnimation=animation,await animation?.finished.catch(()=>{}),this.transitionToken!==token)return;this.cancelTransitionAnimation()}event==="lr-after-hide"&&this.removeAttribute("data-closing"),this.emit(event)}}resolveAnchor(){return resolveOverlayAnchor(this,{virtualAnchor:this.virtualAnchor,anchor:this.anchor,for:this.for,trigger:this.triggerElement})}position(){this.cleanup?.(),this.cleanup=void 0;const popup=this.renderRoot.querySelector('[part~="popup"]'),arrowElement=this.renderRoot.querySelector('[part~="arrow"]'),anchor=this.resolveAnchor();if(!this.open||!anchor||!popup){this.positionedAnchor=void 0,this.anchorPositioned=!1;return}if(anchor!==this.positionedAnchor&&(this.anchorPositioned=!1),this.open&&anchor&&popup){const arrowPadding=Math.max(0,finiteNumber(this.arrowPadding,0));this.cleanup=place(anchor,popup,{placement:rtlAwarePlacement(this.placement,this),strategy:this.hoist?"fixed":"absolute",offset:finiteNumber(this.distance,DEFAULT_DISTANCE),skidding:finiteNumber(this.skidding,0),arrow:this.rendersArrow&&arrowElement?arrowElement:void 0,arrowPadding,onPlaced:({placement,arrow})=>{this.positionedAnchor=anchor,this.anchorPositioned=!0;const side=applyOverlayArrow(arrowElement,{placement,coords:arrow,enabled:this.rendersArrow,arrowPlacement:this.arrowPlacement,arrowPadding,rtl:this.effectiveDirection==="rtl",sizeProperty:"--arrow-size",fallbackSizeProperty:"--lr-tooltip-arrow-size"});side!==this.resolvedSide&&(this.resolvedSide=side)}})}}syncTriggerA11y(){const trigger=this.triggerElement??null,proxy=this.open?this.descriptionProxy:void 0,contribution={descriptions:proxy?[proxy]:[]};this.triggerAria?this.triggerAria.update(trigger,contribution):this.triggerAria=acquireAriaOwnership(trigger,contribution);const accessibleTrigger=this.accessibleTrigger,distinctAccessibleTrigger=accessibleTrigger!==trigger?accessibleTrigger:null;this.accessibleTriggerAria?this.accessibleTriggerAria.update(distinctAccessibleTrigger,contribution):this.accessibleTriggerAria=acquireAriaOwnership(distinctAccessibleTrigger,contribution),this.overlayHandle?.isActive()&&!this.virtualAnchor&&this.overlayHandle.updateRestoreFocusTo(accessibleTrigger)}get accessibleTrigger(){return this.triggerElement?resolveAccessibleTrigger(this.triggerElement):null}releaseTriggerA11y(){this.accessibleTriggerAria?.release(),this.accessibleTriggerAria=void 0,this.triggerAria?.release(),this.triggerAria=void 0}requestTransition(next){if(this.cancelPendingTransition(),this.disabled)return;const delay=this.interactionDelay(next);if(delay<=0){next?this.show():this.hide();return}this.pendingDirection=next?"show":"hide";const view=this.ownerDocument.defaultView;if(!view){this.pendingDirection=void 0;return}this.timerView=view;const timer=view.setTimeout(()=>{this.timerView!==view||this.timer!==timer||(this.timer=void 0,this.timerView=void 0,this.pendingDirection=void 0,next?this.show():this.hide())},delay);this.timer=timer}interactionDelay(showing){const value=showing?this.showDelay:this.hideDelay,fallback=showing?DEFAULT_SHOW_DELAY:DEFAULT_HIDE_DELAY,attribute=showing?"show-delay":"hide-delay";if(this.hasAttribute(attribute)||value!==fallback)return finiteDuration(value,fallback);const property2=showing?"--show-delay":"--hide-delay",match=(this.ownerDocument.defaultView?.getComputedStyle(this).getPropertyValue(property2).trim()??"").match(/^(-?(?:\d+\.?\d*|\.\d+))(ms|s)$/i);if(!match)return fallback;const amount=Number(match[1]),milliseconds=match[2]?.toLowerCase()==="s"?amount*1e3:amount;return finiteDuration(milliseconds,fallback)}cancelPendingTransition(){this.timer!==void 0&&this.timerView?.clearTimeout(this.timer),this.timer=void 0,this.timerView=void 0,this.pendingDirection=void 0}bindTrigger(trigger){trigger.addEventListener("mouseenter",this.onEnter),trigger.addEventListener("mouseleave",this.onLeave),trigger.addEventListener("focusin",this.onEnter),trigger.addEventListener("focusout",this.onLeave),trigger.addEventListener("click",this.onTriggerClick),trigger.addEventListener("keydown",this.onTriggerKeyDown)}unbindTrigger(trigger){trigger.removeEventListener("mouseenter",this.onEnter),trigger.removeEventListener("mouseleave",this.onLeave),trigger.removeEventListener("focusin",this.onEnter),trigger.removeEventListener("focusout",this.onLeave),trigger.removeEventListener("click",this.onTriggerClick),trigger.removeEventListener("keydown",this.onTriggerKeyDown)}adoptTrigger(next){if(next===this.triggerElement){this.syncTriggerA11y();return}const hadTrigger=this.triggerElement!==void 0;if(this.cancelPendingTransition(),this.triggerElement&&this.unbindTrigger(this.triggerElement),this.triggerElement=next,!this.triggerElement){this.syncTriggerA11y(),hadTrigger&&this.open&&!this.resolveAnchor()&&this.forceClose();return}this.bindTrigger(this.triggerElement),this.syncTriggerA11y(),this.open&&this.position(),this.open&&this.interactiveContent&&this.activateTooltipOverlay()}isPopupTarget(target){if(target===null||target.nodeType!==1)return!1;const element=target,slot=this.activeContentSlot;return this.renderRoot.querySelector('[part~="popup"]')?.contains(element)===!0||slot?.assignedElements({flatten:!0}).some(root=>composedContains(root,element))===!0}clearContentSlotListeners(){for(const slot of this.contentSlotListeners)slot.removeEventListener("slotchange",this.onContentSlotChange);this.contentSlotListeners.clear()}syncContentSlotListeners(slots){const activeSlot=this.activeContentSlot;for(const slot of this.contentSlotListeners)slots.has(slot)&&slot!==activeSlot||(slot.removeEventListener("slotchange",this.onContentSlotChange),this.contentSlotListeners.delete(slot));for(const slot of slots)slot===activeSlot||this.contentSlotListeners.has(slot)||(slot.addEventListener("slotchange",this.onContentSlotChange),this.contentSlotListeners.add(slot))}inspectContent(){const snapshot={actionable:!1,assigned:!1,awaitingShadowRoot:!1,labelReferenceRoots:new Set,text:"",externalRoots:new Set,shadowRoots:new Set,forwardingSlots:new Set,composedAncestors:new Set},activeSlot=this.activeContentSlot;if(!activeSlot)return snapshot;snapshot.assigned=activeSlot.assignedNodes().length>0;const popup=this.renderRoot.querySelector('[part~="popup"]'),bypassClosedVisibility=popup?.hasAttribute("data-hidden")===!0,previousVisibility=popup?.style.getPropertyValue("visibility")??"",previousVisibilityPriority=popup?.style.getPropertyPriority("visibility")??"";if(popup&&bypassClosedVisibility){const hostVisibility=this.ownerDocument.defaultView?.getComputedStyle(this).visibility??"visible";popup.style.setProperty("visibility",hostVisibility)}try{const visitedContentElements=new Set,accessibilityText=composedAccessibilityTextResult(activeSlot,{shouldPruneNode:node=>{if(node.getRootNode()!==this.renderRoot&&!this.contains(node)&&snapshot.externalRoots.add(node),node.nodeType!==1)return!1;const element=node;return visitedContentElements.add(element),!isAccessibilitySubtreeExcluded(element)&&!isAccessibilityVisibilityHidden(element)&&isActionableElement(element)&&(snapshot.actionable=!0),element.localName==="slot"&&snapshot.forwardingSlots.add(element),element.shadowRoot?snapshot.shadowRoots.add(element.shadowRoot):element.localName.includes("-")&&(snapshot.awaitingShadowRoot=!0),!1},isSubtreeExcluded:element=>(!visitedContentElements.has(element)&&element!==this&&snapshot.composedAncestors.add(element),isAccessibilitySubtreeExcluded(element))});snapshot.text=accessibilityText.text.replace(/\s+/g," ").trim();for(const root of accessibilityText.labelReferenceRoots)snapshot.labelReferenceRoots.add(root);for(const reference of accessibilityText.referencedElements)snapshot.externalRoots.add(reference)}finally{popup&&bypassClosedVisibility&&(previousVisibility?popup.style.setProperty("visibility",previousVisibility,previousVisibilityPriority):popup.style.removeProperty("visibility"))}return snapshot}observeContentNode(node){if(this.contentObserver){if(node.nodeType===3){this.contentObserver.observe(node,{characterData:!0});return}node.nodeType!==1&&node.nodeType!==11||this.contentObserver.observe(node,{attributes:!0,attributeFilter:["aria-hidden","aria-label","aria-labelledby","alt","class","contenteditable","hidden","href","inert","open","role","slot","style","tabindex"],childList:!0,characterData:!0,subtree:!0})}}bindContentObservation(snapshot){if(this.stopLabelReferenceIdentityObservation?.(),this.stopLabelReferenceIdentityObservation=void 0,this.isConnected&&snapshot.labelReferenceRoots.size>0){const cleanups=[...snapshot.labelReferenceRoots].map(root=>observeOverlayAnchorIdentity(root,()=>this.updateInteractiveContent()));this.stopLabelReferenceIdentityObservation=()=>{for(const cleanup of cleanups)cleanup()}}if(this.contentObserver){this.contentObserver.disconnect();for(const ancestor of snapshot.composedAncestors)ancestor===this||ancestor.getRootNode()===this.renderRoot||snapshot.externalRoots.has(ancestor)||this.contentObserver.observe(ancestor,{attributes:!0,attributeFilter:["aria-hidden","class","hidden","inert","style"]});this.observeContentNode(this);for(const root of snapshot.externalRoots)this.observeContentNode(root);for(const root of snapshot.shadowRoots)this.observeContentNode(root)}}updateInteractiveContent(fromShadowContentScan=!1){fromShadowContentScan||(this.shadowContentScanAttempts=0);const snapshot=this.inspectContent();this.interactiveContent=snapshot.actionable,this.syncContentSlotListeners(snapshot.forwardingSlots),this.bindContentObservation(snapshot),this.scheduleShadowContentScan(snapshot.awaitingShadowRoot),this.updateDescriptionProxy(snapshot.text,snapshot.assigned)}scheduleShadowContentScan(awaitingShadowRoot){if(this.cancelShadowContentScan(!1),!awaitingShadowRoot||!this.open||!this.isConnected||this.shadowContentScanAttempts>=MAX_SHADOW_CONTENT_SCAN_FRAMES)return;const view=this.ownerDocument.defaultView;view&&(this.shadowContentScanView=view,this.shadowContentScanFrame=view.requestAnimationFrame(()=>{this.shadowContentScanFrame=void 0,this.shadowContentScanView=void 0,this.shadowContentScanAttempts++,this.updateInteractiveContent(!0)}))}cancelShadowContentScan(resetAttempts=!0){this.shadowContentScanFrame!==void 0&&this.shadowContentScanView?.cancelAnimationFrame(this.shadowContentScanFrame),this.shadowContentScanFrame=void 0,this.shadowContentScanView=void 0,resetAttempts&&(this.shadowContentScanAttempts=0)}ensureDescriptionProxy(){this.descriptionProxy||(this.descriptionProxy=this.ownerDocument.createElement("span"),this.descriptionProxy.id=this.descriptionId,this.descriptionProxy.slot="__lr-tooltip-description",this.descriptionProxy.hidden=!0,this.descriptionProxy.dataset.lyraTooltipDescription=""),this.descriptionProxy.parentElement!==this&&this.append(this.descriptionProxy),this.updateDescriptionProxy()}updateDescriptionProxy(contentText,assigned){if(!this.descriptionProxy)return;const hostLabel=this.getAttribute("aria-label"),snapshot=contentText===void 0||assigned===void 0?this.inspectContent():void 0,visibleContent=contentText??snapshot?.text??"",hasAssignment=assigned??snapshot?.assigned??!1,description=hostLabel!==null?hostLabel.trim():(this.accessibleLabel||visibleContent||(hasAssignment?"":this.content)).trim();this.descriptionProxy.textContent!==description&&(this.descriptionProxy.textContent=description)}render(){const hostLabel=this.getAttribute("aria-label"),propertyLabel=this.accessibleLabel??"",hasExplicitLabel=hostLabel!==null||propertyLabel.length>0,label=hostLabel!==null?hostLabel:propertyLabel,popupLabel=this.interactiveContent?hasExplicitLabel?label:this.localize("popover"):hasExplicitLabel?label:nothing;return html`
|
|
1
|
+
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{isAccessibilitySubtreeExcluded,isAccessibilityVisibilityHidden,nextId,resolveAccessibleTrigger}from"../../../internal/a11y.js";import{acquireAriaOwnership}from"../../../internal/aria-ownership.js";import{isActionableElement}from"../../../internal/focus-navigation.js";import{place,virtualAnchorFromRect}from"../../../internal/positioner.js";import{rtlAwarePlacement}from"../../../internal/rtl.js";import{finiteDuration,finiteNumber}from"../../../internal/numbers.js";import{omittedEmptyStringConverter,trueDefaultBooleanConverter}from"../../../internal/converters.js";import{activateOverlay,composedContains}from"../../../internal/overlay-manager.js";import{animateRegistered}from"../../../internal/registered-animation.js";import{composedAccessibilityTextResult}from"../../../internal/accessibility-visibility.js";import{applyOverlayArrow}from"./overlay-arrow.js";import{normalizeVirtualRect,observeOverlayAnchorIdentity,OverlayTransitionGate,resolveOverlayAnchor}from"./overlay-shared.js";import{tooltipStyles}from"./overlay.styles.js";import{LYRA_DEFAULT_popover}from"../../../internal/default-strings.generated.js";const DEFAULT_SHOW_DELAY=150,DEFAULT_HIDE_DELAY=0,DEFAULT_DISTANCE=8,MAX_SHADOW_CONTENT_SCAN_FRAMES=4;class LyraTooltip extends LyraElement{constructor(){super(...arguments),this._open=!1,this.trigger="hover focus",this.manual=!1,this.showDelay=150,this.hideDelay=0,this.placement="top",this.distance=8,this.skidding=0,this._for="",this.anchor=null,this.disabled=!1,this.hoist=!1,this.arrow=!0,this.withoutArrow=!1,this.arrowPlacement="anchor",this.arrowPadding=0,this.content="",this.accessibleLabel="",this.namedTriggerMode=!0,this.interactiveContent=!1,this.resolvedSide="top",this.anchorPositioned=!1,this.observedDirectAnchorWasConnected=!1,this.restoreFocusOnClose=!1,this.suppressTriggerFocusOpen=!1,this.openedByPointer=!1,this.tooltipId=nextId("tooltip"),this.descriptionId=nextId("tooltip-description"),this.contentSlotListeners=new Set,this.shadowContentScanAttempts=0,this.transitionToken=0,this.transitionGate=new OverlayTransitionGate,this.onTriggerSlotChange=event=>{this.syncNamedTriggerMode();const slot=event.target;this.slottedTriggerElement=slot.assignedElements({flatten:!0})[0],this.syncInteractionTrigger()},this.onEnter=event=>{if(!this.disabled){if(this.syncTriggerA11y(),event.type==="focusin"){if(this.suppressTriggerFocusOpen||!this.opensOn("focus"))return}else if(!this.opensOn("hover"))return;event.type!=="focusin"&&(this.openedByPointer=!0),this.requestTransition(!0)}},this.onLeave=event=>{if(event.type==="focusout"?!this.opensOn("focus"):!this.opensOn("hover"))return;const next=event.relatedTarget;next!==null&&next.nodeType===1&&this.triggerElement&&composedContains(this.triggerElement,next)||this.interactiveContent&&this.isPopupTarget(next)||this.requestTransition(!1)},this.onTriggerClick=()=>{this.disabled||this.opensOn("click")&&(this.syncTriggerA11y(),this._open?this.hide():this.show())},this.onPopupEnter=()=>{!this.interactiveContent||this.isManual||(this.cancelPendingTransition(),this.show())},this.onPopupLeave=event=>{if(!this.interactiveContent||this.isManual)return;const next=event.relatedTarget;next!==null&&next.nodeType===1&&(this.triggerElement&&composedContains(this.triggerElement,next)||this.isPopupTarget(next))||this.requestTransition(!1)},this.onContentSlotChange=event=>{event.target?.localName==="slot"&&this.updateInteractiveContent()},this.onTriggerKeyDown=event=>{this.isManual||!this.open||event.key!=="Escape"||!this.overlayHandle?.isTopmost()||(event.preventDefault(),this.hide())}}static{this.defaultStrings={...super.defaultStrings,popover:LYRA_DEFAULT_popover}}static{this.styles=[LyraElement.styles,tooltipStyles]}get open(){return this._open}set open(next){const normalized=!!next;if(normalized||this.cancelPendingTransition(),normalized!==this._open){if(!this.hasUpdated){this.applyOpenState(normalized);return}normalized?this.show():this.hide()}}get for(){return this._for}set for(next){this._for=next??""}get rendersArrow(){return this.arrow&&!this.withoutArrow}get activeContentSlot(){const selector=this.namedTriggerMode?'[part~="body"] slot:not([name])':'[part~="body"] slot[name="content"]';return(this.renderRoot??this.shadowRoot)?.querySelector(selector)??null}syncNamedTriggerMode(schedule=!0){const children=Array.from(this.children),hasNamedTrigger=children.some(child=>child.getAttribute("slot")==="trigger"),hasShoelaceContent=this.content.length>0||children.some(child=>child.getAttribute("slot")==="content"),next=hasNamedTrigger||!hasShoelaceContent;if(next===this.namedTriggerMode)return;const old=this.namedTriggerMode;this.namedTriggerMode=next,schedule&&this.hasUpdated&&this.requestUpdate("namedTriggerMode",old)}get triggerKeywords(){return new Set(String(this.trigger??"").trim().split(/\s+/).filter(Boolean))}get isManual(){const keywords=this.triggerKeywords;return this.manual||keywords.size===0||keywords.has("manual")}opensOn(keyword){return!this.isManual&&this.triggerKeywords.has(keyword)}willUpdate(changed){super.willUpdate(changed),this.syncNamedTriggerMode(!1),(changed.has("manual")||changed.has("trigger"))&&this.isManual&&this.cancelPendingTransition(),changed.has("disabled")&&this.disabled&&(this.cancelPendingTransition(),this._open&&(this.hasUpdated?this.hide():this.applyOpenState(!1))),changed.has("anchor")&&changed.get("anchor")===this.observedDirectAnchor&&this.observedDirectAnchorWasConnected&&this.anchor?.isConnected!==!0&&this.open&&!this.resolveAnchor()&&this.forceClose(),changed.has("showDelay")&&this.pendingDirection==="show"&&this.requestTransition(!0),changed.has("hideDelay")&&this.pendingDirection==="hide"&&this.requestTransition(!1),changed.has("for")&&this.syncInteractionTrigger(),changed.has("open")&&!this.open&&(this.anchorPositioned=!1),(changed.has("anchor")||changed.has("for"))&&(this.anchorPositioned=!1)}updated(changed){if(super.updated(changed),(changed.has("for")||changed.has("anchor")||changed.has("open"))&&this.syncAnchorIdentityObservation(),changed.has("open")||changed.has("placement")||changed.has("distance")||changed.has("skidding")||changed.has("for")||changed.has("anchor")||changed.has("hoist")||changed.has("arrow")||changed.has("withoutArrow")||changed.has("arrowPlacement")||changed.has("arrowPadding")||changed.has("interactiveContent")){if(this.cleanup?.(),this.cleanup=void 0,this.open&&this.isConnected&&this.position(),changed.has("open"))if(this.open)this.updateInteractiveContent(),this.isConnected&&this.requiresOverlayManager&&this.activateTooltipOverlay();else{this.positionedAnchor=void 0;const restoreFocus=this.restoreFocusOnClose;this.suppressTriggerFocusOpen=restoreFocus;try{this.overlayHandle?.deactivate({restoreFocus})}finally{this.suppressTriggerFocusOpen=!1}this.overlayHandle=void 0,this.restoreFocusOnClose=!1,this.virtualAnchor=void 0,this.returnFocusTo=void 0,this.syncInteractionTrigger()}else changed.has("interactiveContent")&&this.open&&this.isConnected&&(this.requiresOverlayManager?this.activateTooltipOverlay():(this.overlayHandle?.deactivate({restoreFocus:!1}),this.overlayHandle=void 0));this.syncTriggerA11y()}(changed.has("content")||changed.has("accessibleLabel"))&&this.updateDescriptionProxy()}connectedCallback(){super.connectedCallback(),this.syncAnchorIdentityObservation(),this.ensureDescriptionProxy(),this.contentObserver?.disconnect();const MutationObserverCtor=this.ownerDocument.defaultView?.MutationObserver;this.contentObserver=MutationObserverCtor?new MutationObserverCtor(()=>{this.syncNamedTriggerMode(),this.updateInteractiveContent()}):void 0,this.updateInteractiveContent(),this.syncInteractionTrigger(),this.hasUpdated&&this.open&&(this.position(),this.requiresOverlayManager&&(this.overlayHandle?.isActive()?this.overlayHandle.resume():this.activateTooltipOverlay()))}disconnectedCallback(){this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0,this.cancelPendingTransition(),this.cleanup?.(),this.cleanup=void 0,this.overlayHandle?.suspend(),this.triggerElement&&this.unbindTrigger(this.triggerElement),this.releaseTriggerA11y(),this.triggerElement=void 0,this.contentObserver?.disconnect(),this.contentObserver=void 0,this.stopLabelReferenceIdentityObservation?.(),this.stopLabelReferenceIdentityObservation=void 0,this.clearContentSlotListeners(),this.cancelShadowContentScan(),this.transitionToken++,this.cancelTransitionAnimation(),this.removeAttribute("data-closing"),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0,this.cancelPendingTransition(),this.cancelShadowContentScan(),this.contentObserver?.disconnect(),this.contentObserver=void 0,this.stopLabelReferenceIdentityObservation?.(),this.stopLabelReferenceIdentityObservation=void 0,this.clearContentSlotListeners(),this.releaseTriggerA11y()}syncAnchorIdentityObservation(){this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0;const directAnchor=this.open?this.anchor??void 0:void 0;if(this.observedDirectAnchor=directAnchor,this.observedDirectAnchorWasConnected=directAnchor?.isConnected===!0,!this.isConnected||!this.for&&!directAnchor)return;const onIdentityChange=()=>{const directAnchorRemoved=this.anchor===this.observedDirectAnchor&&this.observedDirectAnchorWasConnected&&this.observedDirectAnchor?.isConnected===!1;if(this.observedDirectAnchorWasConnected=this.observedDirectAnchor?.isConnected===!0,this.syncInteractionTrigger(),!this.open)return;const nextAnchor=this.resolveAnchor();if(directAnchorRemoved&&!nextAnchor){this.forceClose();return}nextAnchor!==this.positionedAnchor&&this.position()},observedRoots=new Set([this]);directAnchor&&directAnchor.getRootNode()!==this.getRootNode()&&observedRoots.add(directAnchor.isConnected?directAnchor:directAnchor.ownerDocument);const cleanups=[...observedRoots].map(root=>observeOverlayAnchorIdentity(root,onIdentityChange));this.stopAnchorIdentityObservation=()=>{for(const cleanup of cleanups)cleanup()}}resolveForTrigger(){if(!this.for)return;const target=this.getRootNode().getElementById?.(this.for)??null,HTMLElementCtor=target?.ownerDocument.defaultView?.HTMLElement;return target&&HTMLElementCtor&&target instanceof HTMLElementCtor?target:void 0}syncInteractionTrigger(){const next=this.virtualAnchor?void 0:this.slottedTriggerElement??this.resolveForTrigger();this.adoptTrigger(next)}activateTooltipOverlay(){if(!this.isConnected)return;const restoreFocusTarget=this.virtualAnchor?this.returnFocusTo??null:this.accessibleTrigger;if(this.overlayHandle?.isActive()){this.overlayHandle.updateRestoreFocusTo(restoreFocusTarget);return}this.overlayHandle=activateOverlay({host:this,panel:()=>this.renderRoot.querySelector('[part~="popup"]'),onEscape:()=>this.hide({restoreFocus:this.shouldRestoreFocusAfterEscape()}),restoreFocusTo:restoreFocusTarget,modal:!1,trapFocus:!1}),this.overlayHandle.focusAutofocus()}shouldRestoreFocusAfterEscape(){if(this.virtualAnchor)return this.returnFocusTo!==void 0;const active=this.ownerDocument.activeElement;return active!==null&&composedContains(this,active)}get requiresOverlayManager(){return this.open}showAt(rect,options){const normalizedRect=normalizeVirtualRect(rect);if(!normalizedRect)return;const previousAnchor=this.virtualAnchor,previousReturnFocusTo=this.returnFocusTo;if(this.virtualAnchor=virtualAnchorFromRect(normalizedRect),this.returnFocusTo=options?.returnFocusTo,this.syncInteractionTrigger(),this.open){this.activateTooltipOverlay(),this.position();return}this.show(),!this.open&&(this.virtualAnchor=previousAnchor,this.returnFocusTo=previousReturnFocusTo,this.syncInteractionTrigger())}show(){return this.cancelPendingTransition(),this.disabled||this._open?Promise.resolve():this.transitionGate.request(!0,()=>{if(this.emit("lr-show",null,{cancelable:!0}).defaultPrevented){this.syncOpenAttribute();return}return this.cancelTransitionAnimation(),this.removeAttribute("data-closing"),this.applyOpenState(!0),this.settleTransition("lr-after-show")})}hide(options){return this.cancelPendingTransition(),this._open?this.transitionGate.request(!1,()=>{if(this.emit("lr-hide",null,{cancelable:!0}).defaultPrevented){this.syncOpenAttribute();return}return options?.restoreFocus&&(this.restoreFocusOnClose=!0),this.cancelTransitionAnimation(),this.isConnected&&this.setAttribute("data-closing",""),this.applyOpenState(!1),this.settleTransition("lr-after-hide")}):Promise.resolve()}forceClose(){return this.cancelPendingTransition(),this._open?(this.cancelTransitionAnimation(),this.isConnected&&this.setAttribute("data-closing",""),this.applyOpenState(!1),this.settleTransition("lr-after-hide")):Promise.resolve()}applyOpenState(next){const old=this._open;this._open=next,next||this.cancelShadowContentScan(),next||(this.openedByPointer=!1),this.requestUpdate("open",old)}syncOpenAttribute(){this.toggleAttribute("open",this._open)}cancelTransitionAnimation(){this.transitionAnimation?.cancel(),this.transitionAnimation=void 0}async settleTransition(event){const token=++this.transitionToken;if(await this.updateComplete,this.transitionToken===token){if(this.isConnected){const popup=this.renderRoot.querySelector('[part~="popup"]'),showing=event==="lr-after-show",animation=popup?animateRegistered(this,popup,`tooltip.${showing?"show":"hide"}`,this.effectiveDirection,{keyframes:showing?[{opacity:0},{opacity:1}]:[{opacity:1},{opacity:0}],durationProperties:["--lr-transition-fast","--lr-duration-fast"],easingProperties:["--lr-easing-standard"]}):void 0;if(this.transitionAnimation=animation,await animation?.finished.catch(()=>{}),this.transitionToken!==token)return;this.cancelTransitionAnimation()}event==="lr-after-hide"&&this.removeAttribute("data-closing"),this.emit(event)}}resolveAnchor(){return resolveOverlayAnchor(this,{virtualAnchor:this.virtualAnchor,anchor:this.anchor,for:this.for,trigger:this.triggerElement})}position(){this.cleanup?.(),this.cleanup=void 0;const popup=this.renderRoot.querySelector('[part~="popup"]'),arrowElement=this.renderRoot.querySelector('[part~="arrow"]'),anchor=this.resolveAnchor();if(!this.open||!anchor||!popup){this.positionedAnchor=void 0,this.anchorPositioned=!1;return}if(anchor!==this.positionedAnchor&&(this.anchorPositioned=!1),this.open&&anchor&&popup){const arrowPadding=Math.max(0,finiteNumber(this.arrowPadding,0));this.cleanup=place(anchor,popup,{placement:rtlAwarePlacement(this.placement,this),strategy:this.hoist?"fixed":"absolute",offset:finiteNumber(this.distance,DEFAULT_DISTANCE),skidding:finiteNumber(this.skidding,0),arrow:this.rendersArrow&&arrowElement?arrowElement:void 0,arrowPadding,onPlaced:({placement,arrow})=>{this.positionedAnchor=anchor,this.anchorPositioned=!0;const side=applyOverlayArrow(arrowElement,{placement,coords:arrow,enabled:this.rendersArrow,arrowPlacement:this.arrowPlacement,arrowPadding,rtl:this.effectiveDirection==="rtl",sizeProperty:"--arrow-size",fallbackSizeProperty:"--lr-tooltip-arrow-size"});side!==this.resolvedSide&&(this.resolvedSide=side)}})}}syncTriggerA11y(){const trigger=this.triggerElement??null,proxy=this.open?this.descriptionProxy:void 0,contribution={descriptions:proxy?[proxy]:[]};this.triggerAria?this.triggerAria.update(trigger,contribution):this.triggerAria=acquireAriaOwnership(trigger,contribution);const accessibleTrigger=this.accessibleTrigger,distinctAccessibleTrigger=accessibleTrigger!==trigger?accessibleTrigger:null;this.accessibleTriggerAria?this.accessibleTriggerAria.update(distinctAccessibleTrigger,contribution):this.accessibleTriggerAria=acquireAriaOwnership(distinctAccessibleTrigger,contribution),this.overlayHandle?.isActive()&&!this.virtualAnchor&&this.overlayHandle.updateRestoreFocusTo(accessibleTrigger)}get accessibleTrigger(){return this.triggerElement?resolveAccessibleTrigger(this.triggerElement):null}releaseTriggerA11y(){this.accessibleTriggerAria?.release(),this.accessibleTriggerAria=void 0,this.triggerAria?.release(),this.triggerAria=void 0}requestTransition(next){if(this.cancelPendingTransition(),this.disabled)return;const delay=this.interactionDelay(next);if(delay<=0){next?this.show():this.hide();return}this.pendingDirection=next?"show":"hide";const view=this.ownerDocument.defaultView;if(!view){this.pendingDirection=void 0;return}this.timerView=view;const timer=view.setTimeout(()=>{this.timerView!==view||this.timer!==timer||(this.timer=void 0,this.timerView=void 0,this.pendingDirection=void 0,next?this.show():this.hide())},delay);this.timer=timer}interactionDelay(showing){const value=showing?this.showDelay:this.hideDelay,fallback=showing?DEFAULT_SHOW_DELAY:DEFAULT_HIDE_DELAY,attribute=showing?"show-delay":"hide-delay";if(this.hasAttribute(attribute)||value!==fallback)return finiteDuration(value,fallback);const property2=showing?"--show-delay":"--hide-delay",match=(this.ownerDocument.defaultView?.getComputedStyle(this).getPropertyValue(property2).trim()??"").match(/^(-?(?:\d+\.?\d*|\.\d+))(ms|s)$/i);if(!match)return fallback;const amount=Number(match[1]),milliseconds=match[2]?.toLowerCase()==="s"?amount*1e3:amount;return finiteDuration(milliseconds,fallback)}cancelPendingTransition(){this.timer!==void 0&&this.timerView?.clearTimeout(this.timer),this.timer=void 0,this.timerView=void 0,this.pendingDirection=void 0}bindTrigger(trigger){trigger.addEventListener("mouseenter",this.onEnter),trigger.addEventListener("mouseleave",this.onLeave),trigger.addEventListener("focusin",this.onEnter),trigger.addEventListener("focusout",this.onLeave),trigger.addEventListener("click",this.onTriggerClick),trigger.addEventListener("keydown",this.onTriggerKeyDown)}unbindTrigger(trigger){trigger.removeEventListener("mouseenter",this.onEnter),trigger.removeEventListener("mouseleave",this.onLeave),trigger.removeEventListener("focusin",this.onEnter),trigger.removeEventListener("focusout",this.onLeave),trigger.removeEventListener("click",this.onTriggerClick),trigger.removeEventListener("keydown",this.onTriggerKeyDown)}isTriggerHeld(trigger){try{if(trigger.matches(":hover"))return!0}catch{}const active=trigger.ownerDocument.activeElement;return active!==null&&composedContains(trigger,active)}adoptTrigger(next){if(next===this.triggerElement){this.syncTriggerA11y();return}const hadTrigger=this.triggerElement!==void 0;if(this.cancelPendingTransition(),this.triggerElement&&this.unbindTrigger(this.triggerElement),this.triggerElement=next,!this.triggerElement){this.syncTriggerA11y(),hadTrigger&&this.open&&!this.resolveAnchor()&&this.forceClose();return}this.bindTrigger(this.triggerElement),this.syncTriggerA11y(),hadTrigger&&this._open&&this.openedByPointer&&!this.isTriggerHeld(this.triggerElement)&&this.forceClose(),this.open&&this.position(),this.open&&this.interactiveContent&&this.activateTooltipOverlay()}isPopupTarget(target){if(target===null||target.nodeType!==1)return!1;const element=target,slot=this.activeContentSlot;return this.renderRoot.querySelector('[part~="popup"]')?.contains(element)===!0||slot?.assignedElements({flatten:!0}).some(root=>composedContains(root,element))===!0}clearContentSlotListeners(){for(const slot of this.contentSlotListeners)slot.removeEventListener("slotchange",this.onContentSlotChange);this.contentSlotListeners.clear()}syncContentSlotListeners(slots){const activeSlot=this.activeContentSlot;for(const slot of this.contentSlotListeners)slots.has(slot)&&slot!==activeSlot||(slot.removeEventListener("slotchange",this.onContentSlotChange),this.contentSlotListeners.delete(slot));for(const slot of slots)slot===activeSlot||this.contentSlotListeners.has(slot)||(slot.addEventListener("slotchange",this.onContentSlotChange),this.contentSlotListeners.add(slot))}inspectContent(){const snapshot={actionable:!1,assigned:!1,awaitingShadowRoot:!1,labelReferenceRoots:new Set,text:"",externalRoots:new Set,shadowRoots:new Set,forwardingSlots:new Set,composedAncestors:new Set},activeSlot=this.activeContentSlot;if(!activeSlot)return snapshot;snapshot.assigned=activeSlot.assignedNodes().length>0;const popup=this.renderRoot.querySelector('[part~="popup"]'),bypassClosedVisibility=popup?.hasAttribute("data-hidden")===!0,previousVisibility=popup?.style.getPropertyValue("visibility")??"",previousVisibilityPriority=popup?.style.getPropertyPriority("visibility")??"";if(popup&&bypassClosedVisibility){const hostVisibility=this.ownerDocument.defaultView?.getComputedStyle(this).visibility??"visible";popup.style.setProperty("visibility",hostVisibility)}try{const visitedContentElements=new Set,accessibilityText=composedAccessibilityTextResult(activeSlot,{shouldPruneNode:node=>{if(node.getRootNode()!==this.renderRoot&&!this.contains(node)&&snapshot.externalRoots.add(node),node.nodeType!==1)return!1;const element=node;return visitedContentElements.add(element),!isAccessibilitySubtreeExcluded(element)&&!isAccessibilityVisibilityHidden(element)&&isActionableElement(element)&&(snapshot.actionable=!0),element.localName==="slot"&&snapshot.forwardingSlots.add(element),element.shadowRoot?snapshot.shadowRoots.add(element.shadowRoot):element.localName.includes("-")&&(snapshot.awaitingShadowRoot=!0),!1},isSubtreeExcluded:element=>(!visitedContentElements.has(element)&&element!==this&&snapshot.composedAncestors.add(element),isAccessibilitySubtreeExcluded(element))});snapshot.text=accessibilityText.text.replace(/\s+/g," ").trim();for(const root of accessibilityText.labelReferenceRoots)snapshot.labelReferenceRoots.add(root);for(const reference of accessibilityText.referencedElements)snapshot.externalRoots.add(reference)}finally{popup&&bypassClosedVisibility&&(previousVisibility?popup.style.setProperty("visibility",previousVisibility,previousVisibilityPriority):popup.style.removeProperty("visibility"))}return snapshot}observeContentNode(node){if(this.contentObserver){if(node.nodeType===3){this.contentObserver.observe(node,{characterData:!0});return}node.nodeType!==1&&node.nodeType!==11||this.contentObserver.observe(node,{attributes:!0,attributeFilter:["aria-hidden","aria-label","aria-labelledby","alt","class","contenteditable","hidden","href","inert","open","role","slot","style","tabindex"],childList:!0,characterData:!0,subtree:!0})}}bindContentObservation(snapshot){if(this.stopLabelReferenceIdentityObservation?.(),this.stopLabelReferenceIdentityObservation=void 0,this.isConnected&&snapshot.labelReferenceRoots.size>0){const cleanups=[...snapshot.labelReferenceRoots].map(root=>observeOverlayAnchorIdentity(root,()=>this.updateInteractiveContent()));this.stopLabelReferenceIdentityObservation=()=>{for(const cleanup of cleanups)cleanup()}}if(this.contentObserver){this.contentObserver.disconnect();for(const ancestor of snapshot.composedAncestors)ancestor===this||ancestor.getRootNode()===this.renderRoot||snapshot.externalRoots.has(ancestor)||this.contentObserver.observe(ancestor,{attributes:!0,attributeFilter:["aria-hidden","class","hidden","inert","style"]});this.observeContentNode(this);for(const root of snapshot.externalRoots)this.observeContentNode(root);for(const root of snapshot.shadowRoots)this.observeContentNode(root)}}updateInteractiveContent(fromShadowContentScan=!1){fromShadowContentScan||(this.shadowContentScanAttempts=0);const snapshot=this.inspectContent();this.interactiveContent=snapshot.actionable,this.syncContentSlotListeners(snapshot.forwardingSlots),this.bindContentObservation(snapshot),this.scheduleShadowContentScan(snapshot.awaitingShadowRoot),this.updateDescriptionProxy(snapshot.text,snapshot.assigned)}scheduleShadowContentScan(awaitingShadowRoot){if(this.cancelShadowContentScan(!1),!awaitingShadowRoot||!this.open||!this.isConnected||this.shadowContentScanAttempts>=MAX_SHADOW_CONTENT_SCAN_FRAMES)return;const view=this.ownerDocument.defaultView;view&&(this.shadowContentScanView=view,this.shadowContentScanFrame=view.requestAnimationFrame(()=>{this.shadowContentScanFrame=void 0,this.shadowContentScanView=void 0,this.shadowContentScanAttempts++,this.updateInteractiveContent(!0)}))}cancelShadowContentScan(resetAttempts=!0){this.shadowContentScanFrame!==void 0&&this.shadowContentScanView?.cancelAnimationFrame(this.shadowContentScanFrame),this.shadowContentScanFrame=void 0,this.shadowContentScanView=void 0,resetAttempts&&(this.shadowContentScanAttempts=0)}ensureDescriptionProxy(){this.descriptionProxy||(this.descriptionProxy=this.ownerDocument.createElement("span"),this.descriptionProxy.id=this.descriptionId,this.descriptionProxy.slot="__lr-tooltip-description",this.descriptionProxy.hidden=!0,this.descriptionProxy.dataset.lyraTooltipDescription=""),this.descriptionProxy.parentElement!==this&&this.append(this.descriptionProxy),this.updateDescriptionProxy()}updateDescriptionProxy(contentText,assigned){if(!this.descriptionProxy)return;const hostLabel=this.getAttribute("aria-label"),snapshot=contentText===void 0||assigned===void 0?this.inspectContent():void 0,visibleContent=contentText??snapshot?.text??"",hasAssignment=assigned??snapshot?.assigned??!1,description=hostLabel!==null?hostLabel.trim():(this.accessibleLabel||visibleContent||(hasAssignment?"":this.content)).trim();this.descriptionProxy.textContent!==description&&(this.descriptionProxy.textContent=description)}render(){const hostLabel=this.getAttribute("aria-label"),propertyLabel=this.accessibleLabel??"",hasExplicitLabel=hostLabel!==null||propertyLabel.length>0,label=hostLabel!==null?hostLabel:propertyLabel,popupLabel=this.interactiveContent?hasExplicitLabel?label:this.localize("popover"):hasExplicitLabel?label:nothing;return html`
|
|
2
2
|
<span part="trigger">
|
|
3
3
|
${this.namedTriggerMode?html`<slot name="trigger" @slotchange=${this.onTriggerSlotChange}></slot>`:html`<slot @slotchange=${this.onTriggerSlotChange}></slot>`}
|
|
4
4
|
</span>
|
|
@@ -167,6 +167,7 @@ export declare class LyraPopup extends LyraElement<LyraPopupEventMap> {
|
|
|
167
167
|
private resolvedPlacement;
|
|
168
168
|
connectedCallback(): void;
|
|
169
169
|
disconnectedCallback(): void;
|
|
170
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
170
171
|
protected updated(changed: PropertyValues): void;
|
|
171
172
|
/** Recomputes the position now. Rarely needed — the popup already tracks scroll, resize and
|
|
172
173
|
* layout change — but a consumer that moved a virtual anchor imperatively can force a pass. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{place,virtualAnchorFromRect}from"../../../internal/positioner.js";import{rtlAwarePlacement}from"../../../internal/rtl.js";import{finiteNumber}from"../../../internal/numbers.js";import{applyOverlayArrow}from"../overlay/overlay-arrow.js";import{observeOverlayAnchorIdentity}from"../overlay/overlay-shared.js";import{styles}from"./popup.styles.js";const PLACEMENTS=new Set(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),AUTO_SIZE_AXES=new Set(["horizontal","vertical","both"]),SYNC_AXES=new Set(["width","height","both"]);class LyraPopup extends LyraElement{constructor(){super(...arguments),this.active=!1,this.for="",this.anchor=null,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.boundary="viewport",this.flipBoundary=null,this.flipPadding=0,this.shift=!1,this.shiftBoundary=null,this.shiftPadding=0,this.padding=0,this.autoSize=null,this.autoSizeBoundary=null,this.autoSizePadding=0,this.sync=null,this.hoverBridge=!1,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.virtualAnchor=null,this.anchorPositioned=!1,this.resolvedPlacement="top",this.onAnchorSlotChange=()=>{if(!this.active)return;const nextIdentity=this.resolveAnchor()?.identity,currentIdentity=this.placingAnchorIdentity??this.positionedAnchorIdentity;nextIdentity!==currentIdentity&&this.reposition()},this.onForwardedAnchorSlotChange=event=>{event.target?.localName==="slot"&&this.onAnchorSlotChange()}}static{this.styles=[LyraElement.styles,styles]}get popup(){return this.renderRoot?.querySelector('[part~="popup"]')}set popup(_next){}connectedCallback(){super.connectedCallback(),this.addEventListener("slotchange",this.onForwardedAnchorSlotChange),this.syncAnchorIdentityObservation(),this.hasUpdated&&this.active&&this.reposition()}disconnectedCallback(){this.removeEventListener("slotchange",this.onForwardedAnchorSlotChange),this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0,this.teardown(),this.positionedAnchorIdentity=void 0,this.setPositioned(!1),super.disconnectedCallback()}updated(changed){super.updated(changed),this.reposition()}reposition(){this.syncAnchorIdentityObservation();const anchor=this.isConnected&&this.active?this.resolveAnchor():null,previousIdentity=this.placingAnchorIdentity??this.positionedAnchorIdentity;if(this.teardown(),!this.isConnected||!this.active||!this.popup||!anchor){this.positionedAnchorIdentity=void 0,this.setPositioned(!1);return}anchor.identity!==previousIdentity&&(this.positionedAnchorIdentity=void 0,this.setPositioned(!1)),this.placingAnchorIdentity=anchor.identity;const arrowPadding=Math.max(0,finiteNumber(this.arrowPadding,0));this.stopPlacing=place(anchor.target,this.popup,{placement:rtlAwarePlacement(this.placement,this),strategy:this.strategy==="absolute"?"absolute":"fixed",offset:finiteNumber(this.distance,0),skidding:finiteNumber(this.skidding,0),boundary:this.boundary==="scroll"?void 0:[],flip:this.flip,flipFallbackPlacements:this.parsedFlipFallbackPlacements,flipFallbackStrategy:this.flipFallbackStrategy==="initial"||this.flipFallbackStrategy==="initial-placement"?"initial-placement":"best-fit",flipBoundary:this.flipBoundary??void 0,flipPadding:Math.max(0,finiteNumber(this.flipPadding,0)),shift:this.shift,shiftBoundary:this.shiftBoundary??void 0,shiftPadding:Math.max(0,finiteNumber(this.shiftPadding,0)),padding:Math.max(0,finiteNumber(this.padding,0)),autoSize:AUTO_SIZE_AXES.has(this.autoSize)?this.autoSize:void 0,autoSizeBoundary:this.autoSizeBoundary??void 0,autoSizePadding:Math.max(0,finiteNumber(this.autoSizePadding,0)),sync:SYNC_AXES.has(this.sync)?this.sync:void 0,arrow:this.arrow?this.arrowElement:void 0,arrowPadding,hoverBridge:this.hoverBridge?this.hoverBridgeElement:void 0,onPlaced:({placement,arrow})=>{const currentAnchor=this.resolveAnchor();if(!this.isConnected||!this.active||currentAnchor?.identity!==anchor.identity){this.setPositioned(!1);return}this.placingAnchorIdentity=void 0,this.positionedAnchorIdentity=anchor.identity,this.setPositioned(!0),this.popup.style.setProperty("--auto-size-available-width",this.popup.style.getPropertyValue("--lr-positioner-available-inline-size")),this.popup.style.setProperty("--auto-size-available-height",this.popup.style.getPropertyValue("--lr-positioner-available-block-size"));const side=applyOverlayArrow(this.arrowElement??null,{placement,coords:arrow,enabled:this.arrow,arrowPlacement:this.arrowPlacement,arrowPadding,rtl:this.effectiveDirection==="rtl",sizeProperty:"--arrow-size",fallbackSizeProperty:"--lr-popup-arrow-size"});this.applyArrowSidePart(side),placement!==this.resolvedPlacement&&(this.resolvedPlacement=placement,this.applySidePart(placement)),this.emit("lr-reposition",{placement})}})}get parsedFlipFallbackPlacements(){const raw=(this.flipFallbackPlacements??"").trim();if(!raw)return;const parsed=raw.split(/[\s,]+/).filter(token=>PLACEMENTS.has(token));return parsed.length?parsed:void 0}teardown(){this.stopPlacing?.(),this.stopPlacing=void 0,this.placingAnchorIdentity=void 0}resolveAnchor(){if(this.virtualAnchor){const candidate=this.virtualAnchor;if(typeof candidate.getBoundingClientRect=="function")return{target:candidate,identity:candidate};const rect=this.virtualAnchor,width=rect.width??0,height=rect.height??0;return[rect.x,rect.y,width,height].every(Number.isFinite)?{target:virtualAnchorFromRect({x:rect.x,y:rect.y,width:Math.max(0,width),height:Math.max(0,height)}),identity:rect}:null}if(this.anchor){if(typeof this.anchor=="string"){const target2=this.getRootNode().getElementById?.(this.anchor)??null;if(target2)return{target:target2,identity:target2}}else if(typeof this.anchor.getBoundingClientRect=="function"&&(!this.isElementAnchor(this.anchor)||this.anchor.isConnected))return{target:this.anchor,identity:this.anchor}}if(this.for){const target2=this.getRootNode().getElementById?.(this.for)??null;if(target2)return{target:target2,identity:target2}}const target=this.anchorSlotWrapper?.querySelector("slot")?.assignedElements({flatten:!0})[0]??null;return target?.isConnected?{target,identity:target}:null}isElementAnchor(anchor){const candidate=anchor,ElementCtor=candidate.ownerDocument?.defaultView?.Element;return ElementCtor?candidate instanceof ElementCtor:candidate.nodeType===1}syncAnchorIdentityObservation(){if(this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0,!this.isConnected||!this.active||this.virtualAnchor)return;const directAnchor=this.anchor&&typeof this.anchor!="string"&&this.isElementAnchor(this.anchor)?this.anchor:void 0;if(!(typeof this.anchor=="string"||!!this.for||!!directAnchor))return;const onIdentityChange=()=>{const nextIdentity=this.resolveAnchor()?.identity,currentIdentity=this.placingAnchorIdentity??this.positionedAnchorIdentity;nextIdentity!==currentIdentity&&this.reposition()},observedRoots=new Set([this]);directAnchor&&directAnchor.getRootNode()!==this.getRootNode()&&observedRoots.add(directAnchor.isConnected?directAnchor:directAnchor.ownerDocument);const cleanups=[...observedRoots].map(root=>observeOverlayAnchorIdentity(root,onIdentityChange));this.stopAnchorIdentityObservation=()=>{for(const cleanup of cleanups)cleanup()}}setPositioned(positioned){this.anchorPositioned=positioned}applySidePart(placement){const side=placement.split("-")[0]??"bottom";this.popup?.setAttribute("part",`popup ${side}`)}applyArrowSidePart(side){this.arrowElement?.setAttribute("part",`arrow arrow-${side}`)}render(){const side=this.resolvedPlacement.split("-")[0],paints=this.active&&this.anchorPositioned,awaitsPosition=this.active&&!this.anchorPositioned;return html`
|
|
1
|
+
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{place,virtualAnchorFromRect}from"../../../internal/positioner.js";import{rtlAwarePlacement}from"../../../internal/rtl.js";import{finiteNumber}from"../../../internal/numbers.js";import{applyOverlayArrow}from"../overlay/overlay-arrow.js";import{observeOverlayAnchorIdentity}from"../overlay/overlay-shared.js";import{styles}from"./popup.styles.js";const PLACEMENTS=new Set(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]),AUTO_SIZE_AXES=new Set(["horizontal","vertical","both"]),SYNC_AXES=new Set(["width","height","both"]);class LyraPopup extends LyraElement{constructor(){super(...arguments),this.active=!1,this.for="",this.anchor=null,this.placement="top",this.strategy="absolute",this.distance=0,this.skidding=0,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.boundary="viewport",this.flipBoundary=null,this.flipPadding=0,this.shift=!1,this.shiftBoundary=null,this.shiftPadding=0,this.padding=0,this.autoSize=null,this.autoSizeBoundary=null,this.autoSizePadding=0,this.sync=null,this.hoverBridge=!1,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.virtualAnchor=null,this.anchorPositioned=!1,this.resolvedPlacement="top",this.onAnchorSlotChange=()=>{if(!this.active)return;const nextIdentity=this.resolveAnchor()?.identity,currentIdentity=this.placingAnchorIdentity??this.positionedAnchorIdentity;nextIdentity!==currentIdentity&&this.reposition()},this.onForwardedAnchorSlotChange=event=>{event.target?.localName==="slot"&&this.onAnchorSlotChange()}}static{this.styles=[LyraElement.styles,styles]}get popup(){return this.renderRoot?.querySelector('[part~="popup"]')}set popup(_next){}connectedCallback(){super.connectedCallback(),this.addEventListener("slotchange",this.onForwardedAnchorSlotChange),this.syncAnchorIdentityObservation(),this.hasUpdated&&this.active&&this.reposition()}disconnectedCallback(){this.removeEventListener("slotchange",this.onForwardedAnchorSlotChange),this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0,this.teardown(),this.positionedAnchorIdentity=void 0,this.setPositioned(!1),super.disconnectedCallback()}willUpdate(changed){super.willUpdate(changed),changed.has("active")&&!this.active&&this.setPositioned(!1),(changed.has("anchor")||changed.has("for")||changed.has("virtualAnchor"))&&this.setPositioned(!1)}updated(changed){super.updated(changed),this.reposition()}reposition(){this.syncAnchorIdentityObservation();const anchor=this.isConnected&&this.active?this.resolveAnchor():null,previousIdentity=this.placingAnchorIdentity??this.positionedAnchorIdentity;if(this.teardown(),!this.isConnected||!this.active||!this.popup||!anchor){this.positionedAnchorIdentity=void 0,this.setPositioned(!1);return}anchor.identity!==previousIdentity&&(this.positionedAnchorIdentity=void 0,this.setPositioned(!1)),this.placingAnchorIdentity=anchor.identity;const arrowPadding=Math.max(0,finiteNumber(this.arrowPadding,0));this.stopPlacing=place(anchor.target,this.popup,{placement:rtlAwarePlacement(this.placement,this),strategy:this.strategy==="absolute"?"absolute":"fixed",offset:finiteNumber(this.distance,0),skidding:finiteNumber(this.skidding,0),boundary:this.boundary==="scroll"?void 0:[],flip:this.flip,flipFallbackPlacements:this.parsedFlipFallbackPlacements,flipFallbackStrategy:this.flipFallbackStrategy==="initial"||this.flipFallbackStrategy==="initial-placement"?"initial-placement":"best-fit",flipBoundary:this.flipBoundary??void 0,flipPadding:Math.max(0,finiteNumber(this.flipPadding,0)),shift:this.shift,shiftBoundary:this.shiftBoundary??void 0,shiftPadding:Math.max(0,finiteNumber(this.shiftPadding,0)),padding:Math.max(0,finiteNumber(this.padding,0)),autoSize:AUTO_SIZE_AXES.has(this.autoSize)?this.autoSize:void 0,autoSizeBoundary:this.autoSizeBoundary??void 0,autoSizePadding:Math.max(0,finiteNumber(this.autoSizePadding,0)),sync:SYNC_AXES.has(this.sync)?this.sync:void 0,arrow:this.arrow?this.arrowElement:void 0,arrowPadding,hoverBridge:this.hoverBridge?this.hoverBridgeElement:void 0,onPlaced:({placement,arrow})=>{const currentAnchor=this.resolveAnchor();if(!this.isConnected||!this.active||currentAnchor?.identity!==anchor.identity){this.setPositioned(!1);return}this.placingAnchorIdentity=void 0,this.positionedAnchorIdentity=anchor.identity,this.setPositioned(!0),this.popup.style.setProperty("--auto-size-available-width",this.popup.style.getPropertyValue("--lr-positioner-available-inline-size")),this.popup.style.setProperty("--auto-size-available-height",this.popup.style.getPropertyValue("--lr-positioner-available-block-size"));const side=applyOverlayArrow(this.arrowElement??null,{placement,coords:arrow,enabled:this.arrow,arrowPlacement:this.arrowPlacement,arrowPadding,rtl:this.effectiveDirection==="rtl",sizeProperty:"--arrow-size",fallbackSizeProperty:"--lr-popup-arrow-size"});this.applyArrowSidePart(side),placement!==this.resolvedPlacement&&(this.resolvedPlacement=placement,this.applySidePart(placement)),this.emit("lr-reposition",{placement})}})}get parsedFlipFallbackPlacements(){const raw=(this.flipFallbackPlacements??"").trim();if(!raw)return;const parsed=raw.split(/[\s,]+/).filter(token=>PLACEMENTS.has(token));return parsed.length?parsed:void 0}teardown(){this.stopPlacing?.(),this.stopPlacing=void 0,this.placingAnchorIdentity=void 0}resolveAnchor(){if(this.virtualAnchor){const candidate=this.virtualAnchor;if(typeof candidate.getBoundingClientRect=="function")return{target:candidate,identity:candidate};const rect=this.virtualAnchor,width=rect.width??0,height=rect.height??0;return[rect.x,rect.y,width,height].every(Number.isFinite)?{target:virtualAnchorFromRect({x:rect.x,y:rect.y,width:Math.max(0,width),height:Math.max(0,height)}),identity:rect}:null}if(this.anchor){if(typeof this.anchor=="string"){const target2=this.getRootNode().getElementById?.(this.anchor)??null;if(target2)return{target:target2,identity:target2}}else if(typeof this.anchor.getBoundingClientRect=="function"&&(!this.isElementAnchor(this.anchor)||this.anchor.isConnected))return{target:this.anchor,identity:this.anchor}}if(this.for){const target2=this.getRootNode().getElementById?.(this.for)??null;if(target2)return{target:target2,identity:target2}}const target=this.anchorSlotWrapper?.querySelector("slot")?.assignedElements({flatten:!0})[0]??null;return target?.isConnected?{target,identity:target}:null}isElementAnchor(anchor){const candidate=anchor,ElementCtor=candidate.ownerDocument?.defaultView?.Element;return ElementCtor?candidate instanceof ElementCtor:candidate.nodeType===1}syncAnchorIdentityObservation(){if(this.stopAnchorIdentityObservation?.(),this.stopAnchorIdentityObservation=void 0,!this.isConnected||!this.active||this.virtualAnchor)return;const directAnchor=this.anchor&&typeof this.anchor!="string"&&this.isElementAnchor(this.anchor)?this.anchor:void 0;if(!(typeof this.anchor=="string"||!!this.for||!!directAnchor))return;const onIdentityChange=()=>{const nextIdentity=this.resolveAnchor()?.identity,currentIdentity=this.placingAnchorIdentity??this.positionedAnchorIdentity;nextIdentity!==currentIdentity&&this.reposition()},observedRoots=new Set([this]);directAnchor&&directAnchor.getRootNode()!==this.getRootNode()&&observedRoots.add(directAnchor.isConnected?directAnchor:directAnchor.ownerDocument);const cleanups=[...observedRoots].map(root=>observeOverlayAnchorIdentity(root,onIdentityChange));this.stopAnchorIdentityObservation=()=>{for(const cleanup of cleanups)cleanup()}}setPositioned(positioned){this.anchorPositioned=positioned}applySidePart(placement){const side=placement.split("-")[0]??"bottom";this.popup?.setAttribute("part",`popup ${side}`)}applyArrowSidePart(side){this.arrowElement?.setAttribute("part",`arrow arrow-${side}`)}render(){const side=this.resolvedPlacement.split("-")[0],paints=this.active&&this.anchorPositioned,awaitsPosition=this.active&&!this.anchorPositioned;return html`
|
|
2
2
|
${this.hoverBridge?html`<span part="hover-bridge" ?data-active=${paints}></span>`:nothing}
|
|
3
3
|
<span part="anchor"><slot name="anchor" @slotchange=${this.onAnchorSlotChange}></slot></span>
|
|
4
4
|
<div part="popup ${side}" ?data-active=${paints} ?data-awaits-position=${awaitsPosition}>
|
|
@@ -6,15 +6,8 @@ import{css}from"lit";const styles=css`
|
|
|
6
6
|
display: contents;
|
|
7
7
|
}
|
|
8
8
|
[part~='popup'] {
|
|
9
|
-
/* Positioned by internal/positioner.ts, which writes physical position/left/top itself. The
|
|
10
|
-
baseline must use those same physical properties: inset-inline-start becomes right under
|
|
11
|
-
RTL and would remain active beside the JS-written left, stretching or pinning the popup.
|
|
12
|
-
The element must still be laid out (not display:none) while inactive is expressed by hiding
|
|
13
|
-
it, or the first measurement would read a zero rect. */
|
|
14
9
|
position: absolute;
|
|
15
10
|
top: 0;
|
|
16
|
-
/* policy-allow(physical-css): positioner.ts overwrites this exact physical property; a
|
|
17
|
-
logical right baseline under RTL would over-constrain the positioned box. */
|
|
18
11
|
left: 0;
|
|
19
12
|
z-index: var(--lr-overlay-stack-index, var(--lr-layer-popover));
|
|
20
13
|
max-inline-size: var(--lr-positioner-available-inline-size, none);
|
|
@@ -32,16 +25,10 @@ import{css}from"lit";const styles=css`
|
|
|
32
25
|
transition-duration: var(--hide-duration, var(--lr-duration-fast));
|
|
33
26
|
}
|
|
34
27
|
[part~='popup'][data-awaits-position] {
|
|
35
|
-
/* An active request without a live, placed anchor is not a hide transition: letting the old
|
|
36
|
-
surface fade at stale coordinates would paint unattached chrome for another frame. */
|
|
37
28
|
transition: none;
|
|
38
29
|
}
|
|
39
30
|
|
|
40
31
|
[part~='hover-bridge'] {
|
|
41
|
-
/* A viewport-sized transparent box clipped down to the quad internal/positioner.ts writes
|
|
42
|
-
between the anchor and the popup, so a pointer crossing the distance gap never leaves
|
|
43
|
-
both at once. The coordinates are physical viewport pixels — a polygon spanning two
|
|
44
|
-
different boxes has no logical-property spelling — and land here as custom properties. */
|
|
45
32
|
position: fixed;
|
|
46
33
|
inset: 0;
|
|
47
34
|
z-index: calc(var(--lr-overlay-stack-index, var(--lr-layer-popover)) - 1);
|
|
@@ -63,8 +50,6 @@ import{css}from"lit";const styles=css`
|
|
|
63
50
|
rotate: 45deg;
|
|
64
51
|
background: var(--arrow-color, var(--lr-color-surface-raised));
|
|
65
52
|
border: var(--popup-border-width, var(--lr-border-width-thin)) solid var(--lr-color-border);
|
|
66
|
-
/* Only the two outward-facing edges of the rotated square should read as the popup's border;
|
|
67
|
-
the other two sit under the panel. */
|
|
68
53
|
clip-path: polygon(100% 0, 100% 100%, 0 100%);
|
|
69
54
|
}
|
|
70
55
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -9,7 +9,9 @@ import type { LyraProgressVariant } from './progress-bar.class.js';
|
|
|
9
9
|
* @customElement lr-progress-ring
|
|
10
10
|
* @slot - Optional center label whose visible accessible text names the progressbar unless an
|
|
11
11
|
* explicit accessible label overrides it; live mutations stay synchronized through forwarding
|
|
12
|
-
* slots.
|
|
12
|
+
* slots. When nothing is slotted, the fallback content is the formatted percentage while
|
|
13
|
+
* determinate and `show-value` is set (`''` otherwise, and always `''` while `indeterminate`) --
|
|
14
|
+
* the same value contract as `<lr-progress-bar>`'s `showValue`.
|
|
13
15
|
* @csspart base - Compatibility name for the progress wrapper; use `progress-ring`.
|
|
14
16
|
* @csspart progress-ring - The progress wrapper. It is the same node as `base`.
|
|
15
17
|
* @csspart track - The SVG track.
|
|
@@ -44,6 +46,12 @@ export declare class LyraProgressRing extends LyraElement {
|
|
|
44
46
|
/** Selects the indicator's semantic palette from the shared semantic grid, matching sibling
|
|
45
47
|
* `<lr-progress-bar>`'s `variant`. */
|
|
46
48
|
variant: LyraProgressVariant;
|
|
49
|
+
/** Shows the formatted percentage as the default slot's fallback content while determinate.
|
|
50
|
+
* `false` by default, matching sibling `<lr-progress-bar>`'s `showValue`/`show-value` exactly --
|
|
51
|
+
* a determinate ring with no `show-value` renders no percentage text. Only the fallback is
|
|
52
|
+
* gated: a consumer who slots their own content always sees that content instead, with or
|
|
53
|
+
* without `show-value` (native `<slot>` projection semantics, unaffected by this property). */
|
|
54
|
+
showValue: boolean;
|
|
47
55
|
/** Mapped accessible-label property. */
|
|
48
56
|
label: string;
|
|
49
57
|
/** Explicit accessible name, on the library-wide `accessibleLabel`/`accessible-label` convention
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{bindAccessibleTextObserver}from"../../../internal/accessibility-visibility.js";import{LyraElement}from"../../../internal/lyra-element.js";import{variants}from"../../../internal/variants.styles.js";import{formatProgressPercent,joinAccessibleVisibleText,progressPercent,progressSafeMax,progressSafeValue,resolveProgressLabel}from"./progress-shared.js";import{ringStyles}from"./progress.styles.js";import{LYRA_DEFAULT_progress}from"../../../internal/default-strings.generated.js";class LyraProgressRing extends LyraElement{constructor(){super(...arguments),this.value=0,this.max=100,this.indeterminate=!1,this.variant="brand",this.label="",this.accessibleLabel="",this.cachedVisibleLabelText="",this.onLabelSlotChange=event=>{const target=event.target;target?.nodeType!==1||target.localName!=="slot"||(this.bindLabelObserverTargets(),this.recomputeVisibleLabelText())}}static{this.defaultStrings={...super.defaultStrings,progress:LYRA_DEFAULT_progress}}static{this.styles=[LyraElement.styles,variants,ringStyles]}connectedCallback(){super.connectedCallback(),this.addEventListener("slotchange",this.onLabelSlotChange),this.rebuildLabelObserver(),this.hasUpdated?this.recomputeVisibleLabelText():this.seedFirstRenderState(()=>this.recomputeVisibleLabelText())}adoptedCallback(){super.adoptedCallback(),this.rebuildLabelObserver()}rebuildLabelObserver(){this.labelObserver?.disconnect();const MutationObserverCtor=this.ownerDocument?.defaultView?.MutationObserver;this.labelObserver=MutationObserverCtor?new MutationObserverCtor(()=>{this.bindLabelObserverTargets(),this.recomputeVisibleLabelText()}):void 0,this.bindLabelObserverTargets()}bindLabelObserverTargets(){bindAccessibleTextObserver(this.labelObserver,this)}disconnectedCallback(){this.removeEventListener("slotchange",this.onLabelSlotChange),this.labelObserver?.disconnect(),this.labelObserver=void 0,super.disconnectedCallback()}computeVisibleLabelText(){const slot=this.renderRoot?.querySelector("slot:not([name])"),lightDomNodes=this.childNodes,nodes=slot?slot.assignedNodes().length>0?slot.assignedNodes({flatten:!0}):[]:Array.from(lightDomNodes??[]).filter(node=>node.nodeType!==1||(node.getAttribute("slot")??"")==="");return joinAccessibleVisibleText(nodes)}recomputeVisibleLabelText(){const next=this.computeVisibleLabelText();next!==this.cachedVisibleLabelText&&(this.cachedVisibleLabelText=next,this.requestUpdate())}get safeMax(){return progressSafeMax(this.max)}get safeValue(){return progressSafeValue(this.value,this.safeMax)}get percent(){return progressPercent(this.safeValue,this.safeMax)}get formattedPercent(){return formatProgressPercent(this.effectiveLocale,this.percent)}get indicator(){return this.renderRoot.querySelector('[part="indicator"]')}get indicatorOffset(){const circumference=2*Math.PI*42;return this.indeterminate?circumference*.65:circumference*(1-this.percent/100)}render(){const circumference=2*Math.PI*42,offset=this.indicatorOffset,label=resolveProgressLabel(this,{label:this.label,accessibleLabel:this.accessibleLabel,visibleText:this.cachedVisibleLabelText,localizedFallback:this.localize("progress")});return html`<div part="base progress-ring" role="progressbar" aria-label=${label}
|
|
1
|
+
var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r};import{html,nothing}from"lit";import{property}from"lit/decorators.js";import{bindAccessibleTextObserver}from"../../../internal/accessibility-visibility.js";import{LyraElement}from"../../../internal/lyra-element.js";import{variants}from"../../../internal/variants.styles.js";import{formatProgressPercent,joinAccessibleVisibleText,progressPercent,progressSafeMax,progressSafeValue,resolveProgressLabel}from"./progress-shared.js";import{ringStyles}from"./progress.styles.js";import{LYRA_DEFAULT_progress}from"../../../internal/default-strings.generated.js";class LyraProgressRing extends LyraElement{constructor(){super(...arguments),this.value=0,this.max=100,this.indeterminate=!1,this.variant="brand",this.showValue=!1,this.label="",this.accessibleLabel="",this.cachedVisibleLabelText="",this.onLabelSlotChange=event=>{const target=event.target;target?.nodeType!==1||target.localName!=="slot"||(this.bindLabelObserverTargets(),this.recomputeVisibleLabelText())}}static{this.defaultStrings={...super.defaultStrings,progress:LYRA_DEFAULT_progress}}static{this.styles=[LyraElement.styles,variants,ringStyles]}connectedCallback(){super.connectedCallback(),this.addEventListener("slotchange",this.onLabelSlotChange),this.rebuildLabelObserver(),this.hasUpdated?this.recomputeVisibleLabelText():this.seedFirstRenderState(()=>this.recomputeVisibleLabelText())}adoptedCallback(){super.adoptedCallback(),this.rebuildLabelObserver()}rebuildLabelObserver(){this.labelObserver?.disconnect();const MutationObserverCtor=this.ownerDocument?.defaultView?.MutationObserver;this.labelObserver=MutationObserverCtor?new MutationObserverCtor(()=>{this.bindLabelObserverTargets(),this.recomputeVisibleLabelText()}):void 0,this.bindLabelObserverTargets()}bindLabelObserverTargets(){bindAccessibleTextObserver(this.labelObserver,this)}disconnectedCallback(){this.removeEventListener("slotchange",this.onLabelSlotChange),this.labelObserver?.disconnect(),this.labelObserver=void 0,super.disconnectedCallback()}computeVisibleLabelText(){const slot=this.renderRoot?.querySelector("slot:not([name])"),lightDomNodes=this.childNodes,nodes=slot?slot.assignedNodes().length>0?slot.assignedNodes({flatten:!0}):[]:Array.from(lightDomNodes??[]).filter(node=>node.nodeType!==1||(node.getAttribute("slot")??"")==="");return joinAccessibleVisibleText(nodes)}recomputeVisibleLabelText(){const next=this.computeVisibleLabelText();next!==this.cachedVisibleLabelText&&(this.cachedVisibleLabelText=next,this.requestUpdate())}get safeMax(){return progressSafeMax(this.max)}get safeValue(){return progressSafeValue(this.value,this.safeMax)}get percent(){return progressPercent(this.safeValue,this.safeMax)}get formattedPercent(){return formatProgressPercent(this.effectiveLocale,this.percent)}get indicator(){return this.renderRoot.querySelector('[part="indicator"]')}get indicatorOffset(){const circumference=2*Math.PI*42;return this.indeterminate?circumference*.65:circumference*(1-this.percent/100)}render(){const circumference=2*Math.PI*42,offset=this.indicatorOffset,label=resolveProgressLabel(this,{label:this.label,accessibleLabel:this.accessibleLabel,visibleText:this.cachedVisibleLabelText,localizedFallback:this.localize("progress")});return html`<div part="base progress-ring" role="progressbar" aria-label=${label}
|
|
2
2
|
aria-valuemin="0" aria-valuemax=${this.safeMax} aria-valuenow=${this.indeterminate?nothing:this.safeValue}
|
|
3
3
|
aria-valuetext=${this.indeterminate?nothing:this.formattedPercent}>
|
|
4
4
|
<svg viewBox="0 0 100 100" aria-hidden="true">
|
|
@@ -6,5 +6,5 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
|
|
|
6
6
|
<circle part="indicator" cx="50" cy="50" r=${42} stroke-width="10"
|
|
7
7
|
stroke-dasharray=${circumference} stroke-dashoffset=${offset}></circle>
|
|
8
8
|
</svg>
|
|
9
|
-
<span part="label"><slot @slotchange=${this.onLabelSlotChange}>${this.indeterminate?"":this.formattedPercent}</slot></span>
|
|
10
|
-
</div>`}}__decorate([property({type:Number,reflect:!0})],LyraProgressRing.prototype,"value",void 0),__decorate([property({type:Number})],LyraProgressRing.prototype,"max",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraProgressRing.prototype,"indeterminate",void 0),__decorate([property({reflect:!0})],LyraProgressRing.prototype,"variant",void 0),__decorate([property()],LyraProgressRing.prototype,"label",void 0),__decorate([property({attribute:"accessible-label"})],LyraProgressRing.prototype,"accessibleLabel",void 0);export{LyraProgressRing};
|
|
9
|
+
<span part="label"><slot @slotchange=${this.onLabelSlotChange}>${this.indeterminate||!this.showValue?"":this.formattedPercent}</slot></span>
|
|
10
|
+
</div>`}}__decorate([property({type:Number,reflect:!0})],LyraProgressRing.prototype,"value",void 0),__decorate([property({type:Number})],LyraProgressRing.prototype,"max",void 0),__decorate([property({type:Boolean,reflect:!0})],LyraProgressRing.prototype,"indeterminate",void 0),__decorate([property({reflect:!0})],LyraProgressRing.prototype,"variant",void 0),__decorate([property({type:Boolean,attribute:"show-value"})],LyraProgressRing.prototype,"showValue",void 0),__decorate([property()],LyraProgressRing.prototype,"label",void 0),__decorate([property({attribute:"accessible-label"})],LyraProgressRing.prototype,"accessibleLabel",void 0);export{LyraProgressRing};
|
|
@@ -2,16 +2,8 @@ import{css}from"lit";const styles=css`
|
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
color: var(--lr-color-brand);
|
|
5
|
-
/* Palette slot: which color the active 'variant' contributes to the indicator, read from the
|
|
6
|
-
shared semantic grid's loud fill (imported alongside this sheet as 'variants' in the class
|
|
7
|
-
file's static styles). It sits *inside* the two consumer-facing override names below in the
|
|
8
|
-
fallback chain -- an explicit --lr-progress-indicator-color or the upstream --indicator-color
|
|
9
|
-
alias still wins outright, exactly as before this token existed. The standalone default here
|
|
10
|
-
(brand) matches the value this indicator always rendered before variant support existed. */
|
|
11
5
|
--_lr-progress-indicator-variant-color: var(--lr-color-brand);
|
|
12
6
|
}
|
|
13
|
-
/* [variant] is always present -- 'variant' reflects its 'brand' property default on first
|
|
14
|
-
render -- but the bare :host default above still guards a not-yet-updated element. */
|
|
15
7
|
:host([variant]) {
|
|
16
8
|
--_lr-progress-indicator-variant-color: var(--lr-color-fill-loud);
|
|
17
9
|
}
|
|
@@ -79,10 +71,6 @@ import{css}from"lit";const styles=css`
|
|
|
79
71
|
transform: translateX(250%);
|
|
80
72
|
}
|
|
81
73
|
}
|
|
82
|
-
/* The determinate fill mirrors for free (a block box anchors to the inline-start edge, the
|
|
83
|
-
physical right under RTL), but translateX is physical, so the indeterminate sweep needs
|
|
84
|
-
mirrored keyframes to travel end-to-start under RTL: the indicator's static position is
|
|
85
|
-
right-anchored there, so just-off-screen is +100% (right) through -250% (left). */
|
|
86
74
|
:host([indeterminate]:dir(rtl)) [part="indicator"] {
|
|
87
75
|
animation-name: lr-progress-slide-rtl;
|
|
88
76
|
}
|
|
@@ -104,17 +92,8 @@ import{css}from"lit";const styles=css`
|
|
|
104
92
|
:host {
|
|
105
93
|
display: inline-block;
|
|
106
94
|
color: var(--lr-color-brand);
|
|
107
|
-
/* Palette slot: which color the active 'variant' contributes to the indicator, read from the
|
|
108
|
-
shared semantic grid's loud fill (imported alongside this sheet as 'variants' in the class
|
|
109
|
-
file's static styles). It sits *inside* the two consumer-facing override names below in the
|
|
110
|
-
fallback chain -- an explicit --lr-progress-ring-indicator-color or the upstream
|
|
111
|
-
--indicator-color alias still wins outright, exactly as before this token existed. The
|
|
112
|
-
standalone default here (brand) matches the value this indicator always rendered before
|
|
113
|
-
variant support existed. */
|
|
114
95
|
--_lr-progress-ring-indicator-variant-color: var(--lr-color-brand);
|
|
115
96
|
}
|
|
116
|
-
/* [variant] is always present -- 'variant' reflects its 'brand' property default on first
|
|
117
|
-
render -- but the bare :host default above still guards a not-yet-updated element. */
|
|
118
97
|
:host([variant]) {
|
|
119
98
|
--_lr-progress-ring-indicator-variant-color: var(--lr-color-fill-loud);
|
|
120
99
|
}
|
|
@@ -2,12 +2,6 @@ import{css}from"lit";const styles=css`
|
|
|
2
2
|
:host {
|
|
3
3
|
display: inline-block;
|
|
4
4
|
color: var(--lr-color-warning);
|
|
5
|
-
/* The 'm' step reproduces exactly the fixed symbol size this component had before the size
|
|
6
|
-
property existed; every other step of the library's shared six-step ladder changes this
|
|
7
|
-
private default below. An unset size and size="m" therefore resolve identically, while an
|
|
8
|
-
inherited or direct public size remains authoritative. The steps are a type ramp rather than the shared
|
|
9
|
-
--lr-form-control-* ladder: a rating has no control box to fit text inside, only glyphs
|
|
10
|
-
whose size IS the control. */
|
|
11
5
|
--_lr-rating-size: var(--symbol-size, var(--lr-font-size-xl));
|
|
12
6
|
}
|
|
13
7
|
:host([data-effective-size="2xs"]) {
|
|
@@ -28,10 +22,6 @@ import{css}from"lit";const styles=css`
|
|
|
28
22
|
:host([data-effective-size="xl"]) {
|
|
29
23
|
--_lr-rating-size: var(--symbol-size, var(--lr-font-size-3xl));
|
|
30
24
|
}
|
|
31
|
-
/* justify-content pairs with the min-inline-size hit-area floor below: a low-max rating (a
|
|
32
|
-
single star, say) is narrower than that floor, and the default justify-content
|
|
33
|
-
(normal => flex-start) would push the stars against the leading edge of an otherwise
|
|
34
|
-
centred control. A no-op once the stars already fill the floor. */
|
|
35
25
|
[part~="base"] {
|
|
36
26
|
display: inline-flex;
|
|
37
27
|
justify-content: center;
|
|
@@ -41,11 +31,6 @@ import{css}from"lit";const styles=css`
|
|
|
41
31
|
max-inline-size: 100%;
|
|
42
32
|
min-block-size: var(--lr-icon-button-size);
|
|
43
33
|
}
|
|
44
|
-
/* Pointer cursor only while the rating is actually settable -- a readonly or disabled rating is
|
|
45
|
-
not editable via click/drag, so an unconditional cursor: pointer here would misleadingly cue
|
|
46
|
-
an interaction that setValue() (rating.class.ts) refuses to apply. :disabled rather than
|
|
47
|
-
[disabled] because only the former also tracks an ancestor <fieldset disabled>, which
|
|
48
|
-
formDisabledCallback() honours but never writes to the host's own attribute. */
|
|
49
34
|
:host(:not(:disabled):not([readonly])) [part~="base"] {
|
|
50
35
|
cursor: pointer;
|
|
51
36
|
}
|
|
@@ -53,20 +38,12 @@ import{css}from"lit";const styles=css`
|
|
|
53
38
|
outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);
|
|
54
39
|
outline-offset: var(--lr-focus-ring-offset);
|
|
55
40
|
}
|
|
56
|
-
/* Gives mouse users the same 'this is interactive' cue the :focus-visible outline above already
|
|
57
|
-
gives keyboard users -- mirrors lr-checkbox's/lr-radio's [part~='base']:hover pattern, gated via
|
|
58
|
-
:host(:not(:disabled):not([readonly])) (matching the pointer-cursor rule above -- a readonly
|
|
59
|
-
rating is still focusable, see rating.class.ts's tabindex, but neither settable nor "hoverable"
|
|
60
|
-
as an affordance) rather than a same-selector [part='star']:hover:not(:disabled) (which would
|
|
61
|
-
exceed a consumer's ::part(star):hover specificity). */
|
|
62
41
|
:host(:not(:disabled):not([readonly])) [part~="base"]:hover [part="star"] {
|
|
63
42
|
color: var(
|
|
64
43
|
--lr-rating-empty-color,
|
|
65
44
|
var(--symbol-color, var(--lr-color-border-strong))
|
|
66
45
|
);
|
|
67
46
|
}
|
|
68
|
-
/* Pressing commits a value, so the pressed cue is on the star the pointer is over rather than
|
|
69
|
-
the whole row -- the row-wide hover cue says "settable", this says "this one". */
|
|
70
47
|
:host(:not(:disabled):not([readonly])) [part~="base"]:active [part="star"] {
|
|
71
48
|
color: var(
|
|
72
49
|
--lr-rating-active-color,
|
|
@@ -107,8 +84,6 @@ import{css}from"lit";const styles=css`
|
|
|
107
84
|
[part="star"] [aria-hidden="true"] > * {
|
|
108
85
|
max-inline-size: 100%;
|
|
109
86
|
}
|
|
110
|
-
/* white-space keeps a consumer getSymbol() glyph at its natural width inside the percentage-wide
|
|
111
|
-
overlay, so overflow: hidden clips it mid-symbol (the partial fill) instead of reflowing it. */
|
|
112
87
|
[part="star-fill"] {
|
|
113
88
|
position: absolute;
|
|
114
89
|
inset-block-start: 0;
|
|
@@ -27,10 +27,6 @@ import{css}from"lit";const styles=css`
|
|
|
27
27
|
background-size: 200% 100%;
|
|
28
28
|
animation: lr-skeleton-sheen var(--lr-transition-ambient) infinite;
|
|
29
29
|
}
|
|
30
|
-
/* background-position percentages are physical, so the sheen highlight always travels
|
|
31
|
-
left-to-right; play the same keyframes backwards under RTL so it sweeps in the reading
|
|
32
|
-
direction. animation-direction (not a second animation-name) leaves the reduced-motion
|
|
33
|
-
'animation: none !important' below fully in charge of disabling it. */
|
|
34
30
|
:host(:dir(rtl)) [part~='indicator'][data-effect='sheen'] {
|
|
35
31
|
animation-direction: reverse;
|
|
36
32
|
}
|
|
@@ -10,9 +10,6 @@ import{css}from"lit";const styles=css`
|
|
|
10
10
|
border-radius: var(--lr-radius-pill);
|
|
11
11
|
animation: lr-spin var(--lr-spinner-duration, var(--speed, var(--lr-transition-ambient))) infinite;
|
|
12
12
|
}
|
|
13
|
-
/* 'after' renders the slotted label in flow next to the spinner; 'none' keeps it sr-only
|
|
14
|
-
(still hit by the [hidden] attribute set in spinner.class.ts, but scoping the clip here too
|
|
15
|
-
keeps this rule self-consistent if that attribute is ever dropped). */
|
|
16
13
|
:host([label-placement='after']) [part='label'] { display: inline-flex; flex: 1 1 auto; align-items: center; min-inline-size: 0; max-inline-size: 100%; overflow: hidden; overflow-wrap: break-word; margin-inline-start: var(--lr-space-2xs); color: var(--lr-color-text); font-size: var(--lr-font-size-sm); }
|
|
17
14
|
:host([label-placement='after']) [part='label'] ::slotted(*) { min-inline-size: 0; max-inline-size: 100%; overflow-wrap: break-word; }
|
|
18
15
|
:host([label-placement='none']) [part='label'] { position: absolute; inline-size: var(--lr-size-1px); block-size: var(--lr-size-1px); overflow: hidden; clip-path: inset(50%); }
|
|
@@ -14,13 +14,6 @@ import{css}from"lit";const styles=css`
|
|
|
14
14
|
--_lr-toast-font-size: var(--lr-font-size-m);
|
|
15
15
|
--_lr-toast-accent-color: var(--lr-color-border);
|
|
16
16
|
}
|
|
17
|
-
/* One rule for all four non-neutral variants, in place of the four one-declaration blocks that
|
|
18
|
-
stood here: the shared variants sheet has already re-pointed --lr-color-fill-* at the active
|
|
19
|
-
variant's row of the semantic grid, so the toast reads a generic slot and never names a
|
|
20
|
-
variant. Neutral is excluded rather than mapped, so its private default keeps the plain
|
|
21
|
-
--lr-color-border accent -- an ordinary informational toast must not read as a grey
|
|
22
|
-
status bar. Matching [variant] as well as :not([variant='neutral']) keeps a host that has not
|
|
23
|
-
yet reflected its default attribute on that same neutral value. */
|
|
24
17
|
:host([variant]:not([variant="neutral"])) {
|
|
25
18
|
--_lr-toast-accent-color: var(--lr-color-fill-loud);
|
|
26
19
|
}
|
|
@@ -61,15 +54,10 @@ import{css}from"lit";const styles=css`
|
|
|
61
54
|
var(--lr-toast-accent-width, var(--_lr-toast-accent-width))
|
|
62
55
|
);
|
|
63
56
|
font-size: var(--lr-toast-font-size, var(--_lr-toast-font-size));
|
|
64
|
-
/* Modal-layer surface: a toast floats over arbitrary page content at the toast layer, so it
|
|
65
|
-
must not share the page surface token -- in dark mode both resolve to the same near-black
|
|
66
|
-
and the toast loses its edges against whatever it covers. */
|
|
67
57
|
background: var(--lr-color-surface-overlay);
|
|
68
58
|
color: var(--lr-color-text);
|
|
69
59
|
border: var(--lr-border-width-thin) solid var(--lr-color-border);
|
|
70
60
|
border-radius: var(--lr-toast-item-radius, var(--lr-radius));
|
|
71
|
-
/* Modal layer, but a small unscrimmed float rather than a page-blocking panel -- the lower of
|
|
72
|
-
the two modal steps. */
|
|
73
61
|
box-shadow: var(--lr-shadow-l);
|
|
74
62
|
opacity: 0;
|
|
75
63
|
transform: translateY(var(--lr-size-neg-8px));
|
|
@@ -119,33 +107,10 @@ import{css}from"lit";const styles=css`
|
|
|
119
107
|
flex: 1 1 auto;
|
|
120
108
|
min-inline-size: 0;
|
|
121
109
|
overflow-wrap: anywhere;
|
|
122
|
-
/* Resolve each slotted message from its own first strong character. dir="auto" on the
|
|
123
|
-
shadow wrapper cannot inspect assigned light-DOM text in every browser, while plaintext
|
|
124
|
-
participates in the flattened text run and keeps an English message/action ordered inside
|
|
125
|
-
an RTL page (and vice versa for Arabic content in LTR). */
|
|
126
110
|
unicode-bidi: plaintext;
|
|
127
111
|
}
|
|
128
|
-
/* toaster.ts's action option (and the WithIcon/Triggers stories) append a
|
|
129
|
-
plain light-DOM button as a sibling of the message text -- without
|
|
130
|
-
this, it renders with the browser's unstyled default button chrome,
|
|
131
|
-
clashing with the rest of the token-driven design. Styled as an inline
|
|
132
|
-
text action (matching the toast's own accent color) rather than a
|
|
133
|
-
boxed button, since it sits directly after the message inside the
|
|
134
|
-
content part rather than in its own layout slot. */
|
|
135
112
|
::slotted(button) {
|
|
136
113
|
display: inline-block;
|
|
137
|
-
/* Symmetric logical spacing remains on the correct side when plaintext bidi resolution makes
|
|
138
|
-
the slotted content's reading direction differ from the page direction.
|
|
139
|
-
!important is deliberate and load-bearing here, not stylistic: this button is a plain
|
|
140
|
-
light-DOM node toaster.ts appends as a sibling of the message text (see the comment below),
|
|
141
|
-
so a consumer's own page-level CSS -- not just this component's shadow root -- can also
|
|
142
|
-
select it directly. A ::slotted() rule from this shadow root loses the cascade to an
|
|
143
|
-
unrelated global reset placed in a CSS layer (e.g. Tailwind Preflight's own
|
|
144
|
-
margin-zeroing universal selector inside its base layer), even though that reset never
|
|
145
|
-
named this button and the rule here is unlayered -- confirmed against Storybook's own
|
|
146
|
-
tailwind.css bundle, which collapses this exact gap to 0 and renders "Item deletedUndo"
|
|
147
|
-
with no visible separator. Without !important, any consumer whose global stylesheet resets
|
|
148
|
-
margins inside a layer silently loses this spacing. */
|
|
149
114
|
margin-inline: var(--lr-space-s) !important;
|
|
150
115
|
padding: 0;
|
|
151
116
|
border: none;
|
|
@@ -163,6 +128,9 @@ import{css}from"lit";const styles=css`
|
|
|
163
128
|
outline: var(--lr-focus-ring-width) solid var(--lr-focus-ring-color);
|
|
164
129
|
outline-offset: var(--lr-focus-ring-offset);
|
|
165
130
|
}
|
|
131
|
+
::slotted([hidden]:not([hidden="until-found" i])) {
|
|
132
|
+
display: none;
|
|
133
|
+
}
|
|
166
134
|
[part="close-button"] {
|
|
167
135
|
position: relative;
|
|
168
136
|
display: inline-grid;
|
|
@@ -216,8 +184,6 @@ import{css}from"lit";const styles=css`
|
|
|
216
184
|
:host([data-visible]) [part="progress-ring__indicator"] {
|
|
217
185
|
animation-name: lr-toast-progress;
|
|
218
186
|
}
|
|
219
|
-
/* no-pressed-state: :hover and :focus-within only mirror the timer's paused state on its
|
|
220
|
-
decorative progress indicator; the close button owns the actual press treatment below. */
|
|
221
187
|
:host(:hover) [part="progress-ring__indicator"],
|
|
222
188
|
:host(:focus-within) [part="progress-ring__indicator"] {
|
|
223
189
|
animation-play-state: paused;
|
|
@@ -231,18 +197,10 @@ import{css}from"lit";const styles=css`
|
|
|
231
197
|
[part="close-icon__svg"] {
|
|
232
198
|
display: block;
|
|
233
199
|
}
|
|
234
|
-
/* Keep each pointer-state value as an inline fallback: inherited hooks then retheme only the
|
|
235
|
-
close control without changing the toast surface or the region's stack spacing. */
|
|
236
200
|
[part="close-button"]:where(:hover):where(:not([aria-disabled="true"])) {
|
|
237
201
|
background: var(--lr-toast-close-button-hover-bg, transparent);
|
|
238
202
|
color: var(--lr-toast-close-button-hover-color, var(--lr-color-text));
|
|
239
203
|
}
|
|
240
|
-
/* Pressed adds the fill the hover deliberately withholds: the resting button is background:none,
|
|
241
|
-
so mixing that transparent base toward --lr-color-mix-partner lands the partner colour at the
|
|
242
|
-
active share -- a scrim that darkens on a light toast and lightens on a dark one, following
|
|
243
|
-
the text colour either way. The ink change is restated because keyboard activation raises
|
|
244
|
-
:active with no :hover, and the disabled guard is carried over so a dismiss-blocked toast
|
|
245
|
-
stays visibly inert under a click. */
|
|
246
204
|
[part="close-button"]:where(:active):where(:not([aria-disabled="true"])) {
|
|
247
205
|
color: var(--lr-toast-close-button-active-color, var(--lr-color-text));
|
|
248
206
|
background: var(
|
|
@@ -2,21 +2,6 @@ import{css}from"lit";const styles=css`
|
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
}
|
|
5
|
-
/* Two rendering paths, one presentation. Below \`virtualize-at\` a chunk row is committed into
|
|
6
|
-
this component's own shadow root, where a plain [part~='x'] selector matches it. Above it the
|
|
7
|
-
identical row template becomes <lr-virtual-list>'s .renderItem, and Lit commits that content
|
|
8
|
-
inside *that* component's shadow root -- a different tree, which no selector scoped to this one
|
|
9
|
-
can ever reach. lr-virtual-list::part(x) crosses exactly that one boundary, so both selectors
|
|
10
|
-
are required for every row-level part; the pairing is the same one <lr-ingestion-queue> uses
|
|
11
|
-
for its own dual-path rows.
|
|
12
|
-
|
|
13
|
-
Row state is carried by an extra part *token* (chunk-current, score-fill-danger, ...) rather
|
|
14
|
-
than by the row's own attribute, because Shadow Parts forbids an attribute selector after
|
|
15
|
-
::part(): ::part(chunk)[aria-current='true'] is invalid CSS, so the whole rule would be
|
|
16
|
-
dropped. ::part() matches against the part-name list, so a second token costs nothing and is
|
|
17
|
-
reachable from a consumer stylesheet too. The mirrored attributes (aria-current, data-tone,
|
|
18
|
-
data-clamped) stay on the elements -- they carry the semantics, and a bare [part~=] selector
|
|
19
|
-
inside this tree can still use them. */
|
|
20
5
|
[part~='chunk'],
|
|
21
6
|
lr-virtual-list::part(chunk) {
|
|
22
7
|
display: flex;
|
|
@@ -38,14 +23,6 @@ import{css}from"lit";const styles=css`
|
|
|
38
23
|
color: var(--lr-color-text-quiet);
|
|
39
24
|
font-variant-numeric: tabular-nums;
|
|
40
25
|
}
|
|
41
|
-
/* text-quiet's contrast ratio against brand-quiet lands at ~4.24:1 -- just under the WCAG AA
|
|
42
|
-
4.5:1 floor for normal-size text -- even though it comfortably passes against the plain
|
|
43
|
-
(non-current) background used the rest of the time. Same class of bug already hit and fixed in
|
|
44
|
-
lr-attachment-chip's [part='size'], lr-chat-message's [part='footer'] and lr-conversation-item's
|
|
45
|
-
[part='excerpt']/[part='timestamp']; same fix, full-strength text color once current. Paired
|
|
46
|
-
with --lr-chunk-inspector-current-bg: a consumer that restyles one has to keep the ratio, so
|
|
47
|
-
both arms of the pair are overridable. Ordered after the base score rule above, which it has to
|
|
48
|
-
win on source order (both are single-token selectors of equal specificity). */
|
|
49
26
|
[part~='score-current'],
|
|
50
27
|
lr-virtual-list::part(score-current) {
|
|
51
28
|
color: var(--lr-chunk-inspector-current-color, var(--lr-color-text));
|
|
@@ -98,9 +75,6 @@ import{css}from"lit";const styles=css`
|
|
|
98
75
|
color: var(--lr-color-brand);
|
|
99
76
|
text-decoration: underline;
|
|
100
77
|
}
|
|
101
|
-
/* The pressed state adds the surface the hover underline has no room for: this button is
|
|
102
|
-
transparent-backed link chrome, so a wash mixed from that transparent base is the only thing
|
|
103
|
-
that can read as "held down" without repainting the brand-colored label. */
|
|
104
78
|
[part~='open-button']:active,
|
|
105
79
|
lr-virtual-list::part(open-button):active {
|
|
106
80
|
color: var(--lr-color-brand);
|
|
@@ -116,15 +90,6 @@ import{css}from"lit";const styles=css`
|
|
|
116
90
|
lr-virtual-list::part(title) {
|
|
117
91
|
font: inherit;
|
|
118
92
|
}
|
|
119
|
-
/* chunk.text is arbitrary consumer-supplied content -- it may genuinely be RTL prose (e.g. a
|
|
120
|
-
real Arabic/Hebrew search snippet). isolate (not plaintext, and never a forced dir="ltr")
|
|
121
|
-
keeps the paragraph's own edge punctuation from being reordered by the surrounding host
|
|
122
|
-
direction while still letting the browser's per-paragraph bidi detection run correctly for
|
|
123
|
-
genuinely RTL content. Without it, under dir="rtl" a trailing period (e.g. "...Curie in
|
|
124
|
-
1898.") visually jumps to the front of the line. Chromium and Firefox already default block
|
|
125
|
-
boxes to unicode-bidi: isolate (see the HTML "bidi rendering" UA-stylesheet rules), which
|
|
126
|
-
masks this on those two engines; WebKit does not, so the bug and this rule are only visible
|
|
127
|
-
cross-engine -- see this component's own dir="rtl" test. */
|
|
128
93
|
[part~='text'],
|
|
129
94
|
lr-virtual-list::part(text) {
|
|
130
95
|
margin: 0;
|
|
@@ -105,20 +105,20 @@ export declare class LyraCitationBadge extends LyraElement<LyraCitationBadgeEven
|
|
|
105
105
|
/** Adds source context to the accessible name while retaining the visible citation index
|
|
106
106
|
* (`"Citation {index}, {label}"`). */
|
|
107
107
|
label: string;
|
|
108
|
-
private hasPreviewSlot;
|
|
109
108
|
private popoverOpen;
|
|
110
109
|
private buttonEl?;
|
|
111
110
|
private popoverEl?;
|
|
112
111
|
private readonly popoverId;
|
|
112
|
+
private readonly slotPresence;
|
|
113
113
|
private cleanupPositioner?;
|
|
114
114
|
private hideTimer?;
|
|
115
115
|
private hovering;
|
|
116
116
|
private focused;
|
|
117
|
+
private get hasPreviewSlot();
|
|
117
118
|
protected willUpdate(changed: PropertyValues): void;
|
|
118
119
|
protected updated(changed: PropertyValues): void;
|
|
119
120
|
disconnectedCallback(): void;
|
|
120
121
|
private get accessibleLabel();
|
|
121
|
-
private onSlotChange;
|
|
122
122
|
private showPreview;
|
|
123
123
|
private scheduleHidePreview;
|
|
124
124
|
private hidePreviewNow;
|