@aceshooting/lyra-ui 9.1.0 → 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 +843 -0
- package/README.md +7 -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 +2 -2
- 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 +9 -7
- 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.class.js +1 -1
- 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.class.js +1 -1
- package/dist/components/agent-tools/browser-frame/browser-frame.styles.js +3 -5
- package/dist/components/agent-tools/commit-card/commit-card.class.js +1 -1
- 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.class.js +2 -2
- package/dist/components/agent-tools/confirm-bar/confirm-bar.styles.js +0 -46
- package/dist/components/agent-tools/context-inspector/context-inspector.class.js +1 -1
- package/dist/components/agent-tools/eval-dataset/eval-dataset.styles.js +0 -7
- package/dist/components/agent-tools/eval-result/eval-result.class.js +1 -1
- package/dist/components/agent-tools/evaluation-run/evaluation-run.class.js +2 -2
- package/dist/components/agent-tools/policy-summary/policy-summary.class.js +1 -1
- 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 +2 -5
- package/dist/components/agent-tools/span-waterfall/span-waterfall.class.js +1 -1
- 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 +1 -4
- package/dist/components/agent-tools/task-list/task-list.class.js +2 -2
- 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.class.js +1 -1
- 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.class.js +2 -2
- 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.class.js +2 -2
- 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.class.js +2 -2
- package/dist/components/agent-tools/trace-tree/trace-tree.styles.js +7 -31
- package/dist/components/charts/chart/bar-chart.class.js +1 -1
- package/dist/components/charts/chart/box-plot.styles.js +0 -20
- package/dist/components/charts/chart/bubble-chart.class.js +1 -1
- 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/doughnut-chart.class.js +1 -1
- package/dist/components/charts/chart/histogram.class.js +1 -1
- package/dist/components/charts/chart/line-chart.class.js +1 -1
- 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/charts/chart/pie-chart.class.js +1 -1
- package/dist/components/charts/chart/polar-area-chart.class.js +1 -1
- package/dist/components/charts/chart/radar-chart.class.js +1 -1
- package/dist/components/charts/chart/scatter-chart.class.js +1 -1
- 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.class.js +2 -2
- package/dist/components/conversation/chat-message/chat-message.styles.js +13 -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/realtime-session/realtime-session.styles.js +1 -1
- 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 +5 -19
- 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.class.js +1 -1
- 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/file-tree/file-tree.class.js +1 -1
- 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 +85 -2
- 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.class.js +1 -1
- 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 +1 -106
- 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 +3 -38
- 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 +5 -13
- 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.class.js +1 -1
- 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.class.js +1 -1
- package/dist/components/layout/multi-split/multi-split.styles.js +8 -51
- 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 +2 -2
- package/dist/components/media/attachment-chip/attachment-chip.styles.js +0 -31
- package/dist/components/media/attachment-trigger/attachment-trigger.class.d.ts +1 -1
- package/dist/components/media/attachment-trigger/attachment-trigger.class.js +4 -4
- 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.class.js +1 -1
- 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 +2 -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 +2 -13
- 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.class.js +1 -1
- 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 +2 -2
- package/dist/components/overlays/popup/popup.class.d.ts +1 -0
- package/dist/components/overlays/popup/popup.class.js +2 -2
- 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 +2 -5
- 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.class.js +1 -1
- 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/entity-dossier/entity-dossier.class.js +1 -1
- 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/grounding-summary/grounding-summary.class.js +2 -2
- 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 +6 -11
- package/dist/components/retrieval/memory-panel/memory-panel.class.js +1 -1
- 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.class.js +1 -1
- 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.class.js +1 -1
- 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.class.js +1 -1
- 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/contact-viewer/contact-viewer.class.js +1 -1
- 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.class.js +1 -1
- 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.class.js +1 -1
- 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 +30 -0
- package/dist/internal/dev-mode-attribute-warning.js +1 -0
- 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 +9 -6
- 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 +29 -1
- 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/index.md +1 -1
- package/llms/peers.md +13 -3
- package/llms/shared.md +83 -2
- package/llms-full.txt +1159 -288
- package/package.json +19 -7
- package/vscode-css-data.json +37 -2
- package/vscode-html-data.json +402 -45
- package/web-types.json +300 -56
|
@@ -3,66 +3,30 @@ import{css}from"lit";const styles=css`
|
|
|
3
3
|
display: inline-block;
|
|
4
4
|
min-inline-size: 0;
|
|
5
5
|
max-inline-size: 100%;
|
|
6
|
-
/* A host width is meaningful for the public component, so the native
|
|
7
|
-
button follows it. The variable keeps the contract opt-out-able for
|
|
8
|
-
compact inline compositions. */
|
|
9
6
|
--_lr-button-width: 100%;
|
|
10
|
-
/* The whole size scale now comes from the shared form-control ladder (internal/sizes.styles.ts,
|
|
11
|
-
pulled in ahead of this sheet by button.class.ts), so a button and an lr-input/lr-select/
|
|
12
|
-
lr-combobox/lr-date-input of the same tier are the same height BY CONSTRUCTION rather than by
|
|
13
|
-
two hand-maintained lists agreeing -- which is exactly how they drifted apart before 8.0.0.
|
|
14
|
-
These per-tier names survive as the button's own override points; only their values moved. */
|
|
15
7
|
--_lr-button-size-2xs: var(--lr-form-control-height-2xs);
|
|
16
8
|
--_lr-button-size-xs: var(--lr-form-control-height-xs);
|
|
17
9
|
--_lr-button-size-s: var(--lr-form-control-height-s);
|
|
18
10
|
--_lr-button-size-m: var(--lr-form-control-height-m);
|
|
19
11
|
--_lr-button-size-l: var(--lr-form-control-height-l);
|
|
20
12
|
--_lr-button-size-xl: var(--lr-form-control-height-xl);
|
|
21
|
-
/* Geometry knobs, each pointed at the ladder's active-tier value. No per-tier rule declares a
|
|
22
|
-
CSS property on [part~='base'], so a consumer can still retune a tier (e.g. pin a size="s"
|
|
23
|
-
button into a compact toolbar row) without a ::part(base) rule. The ladder matches BOTH
|
|
24
|
-
spellings of every tier in one selector list, so size="small" is size="s" for free. */
|
|
25
13
|
--_lr-button-padding-block: var(--lr-form-control-padding-block);
|
|
26
14
|
--_lr-button-padding-inline: var(--lr-form-control-padding-inline);
|
|
27
15
|
--_lr-button-font-size: var(--lr-form-control-font-size);
|
|
28
16
|
--_lr-button-min-height: var(--lr-button-size-m, var(--_lr-button-size-m));
|
|
29
17
|
--_lr-button-gap: var(--lr-form-control-gap);
|
|
30
18
|
--_lr-button-radius: var(--lr-form-control-radius);
|
|
31
|
-
/* Relative to the button's own font-size, so the with-caret chevron tracks every size tier
|
|
32
|
-
without a per-tier rule -- same sizing stance as lr-attachment-trigger's expand-icon. */
|
|
33
19
|
--_lr-button-caret-size: var(--lr-size-0-75em);
|
|
34
|
-
/* The nine generic colour slots below are re-pointed at the active variant's row of the
|
|
35
|
-
semantic grid by internal/variants.styles.ts, so this component needs no :host([variant='…'])
|
|
36
|
-
block of its own -- it carried five near-identical ones before 8.0.0.
|
|
37
|
-
"filled" reads the QUIET tier and "accent" the LOUD one: they used to share the same loud
|
|
38
|
-
token for every chromatic variant (rendering identically) while neutral's "filled" was the
|
|
39
|
-
page surface, i.e. no fill at all. */
|
|
40
20
|
--_lr-button-accent: var(--lr-color-fill-loud);
|
|
41
21
|
--_lr-button-fill: var(--lr-color-fill-quiet);
|
|
42
22
|
--_lr-button-on-fill: var(--lr-color-on-quiet);
|
|
43
23
|
--_lr-button-border: var(--lr-color-border-normal);
|
|
44
24
|
--_lr-button-outlined-border: var(--lr-color-border-strong);
|
|
45
|
-
/* Transparent by default (byte-identical to the previous hardcoded "background: transparent").
|
|
46
|
-
Set it to tint an outlined button -- e.g. a faint surface wash behind the outline -- without
|
|
47
|
-
reaching for a ::part(base) rule. Like --lr-button-quiet-*, it is deliberately NOT swapped
|
|
48
|
-
per "variant": an outlined button's fill is a surface decision, not a semantic tone. */
|
|
49
25
|
--_lr-button-outlined-fill: transparent;
|
|
50
26
|
--_lr-button-quiet-border: var(--lr-color-border);
|
|
51
27
|
--_lr-button-quiet-text: var(--lr-color-text-quiet);
|
|
52
28
|
--_lr-button-accent-fill: var(--lr-color-fill-loud);
|
|
53
29
|
--_lr-button-accent-on-fill: var(--lr-color-on-loud);
|
|
54
|
-
/* Hover and press feedback, as a colour MIX rather than the filter: brightness() multiplier
|
|
55
|
-
this carried before 8.0.0. A filter multiplies every channel, so it lightened a dark button
|
|
56
|
-
and darkened a light one only by luck, did nothing whatsoever to a pure white or pure black
|
|
57
|
-
fill, and -- because filter applies to the whole subtree -- dimmed the label and the icons
|
|
58
|
-
along with the box. Mixing toward --lr-color-mix-partner (which follows the text colour)
|
|
59
|
-
always moves, and always in the direction the surface needs.
|
|
60
|
-
--lr-button-hover-base is the colour the two mixes move AWAY from: the fill the active
|
|
61
|
-
appearance actually paints. The chrome-less tiers (outlined, plain, quiet, link) paint no
|
|
62
|
-
fill of their own, so they mix from the page surface they sit on -- quiet's hover used to BE
|
|
63
|
-
var(--lr-color-surface), i.e. the page background itself, so hovering a quiet button on a
|
|
64
|
-
default page changed nothing at all. A consumer who tints --lr-button-outlined-fill should
|
|
65
|
-
point this at the same colour so the pair keeps moving together. */
|
|
66
30
|
--_lr-button-hover-base: var(--lr-color-surface);
|
|
67
31
|
--_lr-button-hover-background: color-mix(
|
|
68
32
|
in oklab,
|
|
@@ -75,8 +39,6 @@ import{css}from"lit";const styles=css`
|
|
|
75
39
|
var(--lr-color-mix-partner) var(--lr-color-mix-active)
|
|
76
40
|
);
|
|
77
41
|
}
|
|
78
|
-
/* Each painted tier names its own fill as the mix base, so retuning --lr-button-fill or
|
|
79
|
-
--lr-button-accent-fill retunes that tier's hover and press with it. */
|
|
80
42
|
:host([appearance="filled"]),
|
|
81
43
|
:host([appearance="filled-outlined"]) {
|
|
82
44
|
--_lr-button-hover-base: var(--lr-button-fill, var(--_lr-button-fill));
|
|
@@ -87,26 +49,13 @@ import{css}from"lit";const styles=css`
|
|
|
87
49
|
var(--_lr-button-accent-fill)
|
|
88
50
|
);
|
|
89
51
|
}
|
|
90
|
-
/* Shoelace's boolean outline surface is an additive alias. It never rewrites appearance, so
|
|
91
|
-
removing it restores the exact Lyra treatment the author selected. */
|
|
92
52
|
:host([outline]) {
|
|
93
53
|
--_lr-button-hover-base: var(--lr-color-surface);
|
|
94
54
|
}
|
|
95
|
-
/* The one place a variant still needs naming. The four chromatic variants use their loud fill as
|
|
96
|
-
the chrome-less foreground -- brand text on the page surface IS the brand colour. Neutral's
|
|
97
|
-
loud fill is a mid grey chosen to carry LIGHT text, so reusing it as dark-on-surface text would
|
|
98
|
-
wash out every plain, outlined and link button and collapse the deliberate gap between
|
|
99
|
-
appearance="plain" and appearance="quiet". Neutral keeps the body text colour instead. The
|
|
100
|
-
:not([variant]) arm covers a host whose reflected attribute was removed by hand. */
|
|
101
55
|
:host(:not([variant])),
|
|
102
56
|
:host([variant="neutral"]) {
|
|
103
57
|
--_lr-button-accent: var(--lr-color-text);
|
|
104
58
|
}
|
|
105
|
-
/* Fully rounded ends. Changing the private radius default rather than declaring border-radius
|
|
106
|
-
on [part~='base'] keeps one corner-radius declaration in the sheet, lets an inherited or
|
|
107
|
-
direct public radius win, and leaves
|
|
108
|
-
appearance="link"'s own literal "border-radius: 0" winning (a pill inline link would be a
|
|
109
|
-
button-shaped box, which is exactly what that appearance exists to avoid). */
|
|
110
59
|
:host([pill]) {
|
|
111
60
|
--_lr-button-radius: var(--lr-radius-pill);
|
|
112
61
|
}
|
|
@@ -120,13 +69,6 @@ import{css}from"lit";const styles=css`
|
|
|
120
69
|
inline-size: var(--lr-button-width, var(--_lr-button-width));
|
|
121
70
|
min-inline-size: 0;
|
|
122
71
|
max-inline-size: 100%;
|
|
123
|
-
/* --lr-button-height is deliberately left UNDECLARED on :host, so both var()s below take their
|
|
124
|
-
fallback arm: a floor at the active tier's --lr-button-min-height and an auto height --
|
|
125
|
-
byte-identical to the behaviour before this property existed. Setting it (e.g. to pin the
|
|
126
|
-
button to a fixed toolbar row height) both floors and caps the button. Declaring it as
|
|
127
|
-
"auto" on :host would break exactly this: a declared "auto" is a *defined* value, so the
|
|
128
|
-
fallback arm would never fire and every tier's floor would become dead code (lr-select
|
|
129
|
-
documents its own instance of that trap in select.styles.ts). */
|
|
130
72
|
min-block-size: var(
|
|
131
73
|
--lr-button-height,
|
|
132
74
|
var(--lr-button-min-height, var(--_lr-button-min-height))
|
|
@@ -148,11 +90,8 @@ import{css}from"lit";const styles=css`
|
|
|
148
90
|
var(--lr-button-border, var(--_lr-button-border));
|
|
149
91
|
font: inherit;
|
|
150
92
|
font-weight: var(--lr-font-weight-semibold);
|
|
151
|
-
/* After the "font" shorthand, which would otherwise reset font-size back to the inherited one. */
|
|
152
93
|
font-size: var(--lr-button-font-size, var(--_lr-button-font-size));
|
|
153
94
|
cursor: pointer;
|
|
154
|
-
/* Undeclared by default (byte-identical to today's absent box-shadow); set it to add a
|
|
155
|
-
drop shadow (e.g. an elevated/floating action button) without a ::part(base) rule. */
|
|
156
95
|
box-shadow: var(--lr-button-shadow, none);
|
|
157
96
|
}
|
|
158
97
|
:host([appearance="filled"]) [part~="base"] {
|
|
@@ -180,10 +119,6 @@ import{css}from"lit";const styles=css`
|
|
|
180
119
|
var(--_lr-button-outlined-border)
|
|
181
120
|
);
|
|
182
121
|
}
|
|
183
|
-
/* The filled fill and foreground, but carrying the outlined tier's own border color instead of
|
|
184
|
-
the variant-tinted --lr-button-border -- a filled button whose edge still reads against a
|
|
185
|
-
same-toned surface. Both halves stay on their existing knobs, so retuning either tier retunes
|
|
186
|
-
this one with it. */
|
|
187
122
|
:host([appearance="filled-outlined"]) [part~="base"] {
|
|
188
123
|
background: var(--lr-button-fill, var(--_lr-button-fill));
|
|
189
124
|
color: var(--lr-button-on-fill, var(--_lr-button-on-fill));
|
|
@@ -202,14 +137,6 @@ import{css}from"lit";const styles=css`
|
|
|
202
137
|
color: var(--lr-button-quiet-text, var(--_lr-button-quiet-text));
|
|
203
138
|
border-color: var(--lr-button-quiet-border, var(--_lr-button-quiet-border));
|
|
204
139
|
}
|
|
205
|
-
/* Two selectors for one state, because the two render paths carry it differently. The native
|
|
206
|
-
<button> path matches :disabled (from its own disabled attribute OR a fieldset cascade). The
|
|
207
|
-
anchor path never can -- an <a> is not a form control, so :disabled cannot match it whatever
|
|
208
|
-
aria-disabled says -- and the disabled-link path renders an href-less,
|
|
209
|
-
tabindex="-1", aria-disabled="true" anchor. Keying the second arm off the attribute the anchor
|
|
210
|
-
DOES carry is what keeps the two modes looking the same; without it a disabled link rendered
|
|
211
|
-
fully opaque with a pointer cursor, i.e. exactly like a working link that silently does
|
|
212
|
-
nothing. Every :not(:disabled) below excludes the same attribute for the same reason. */
|
|
213
140
|
[part~="base"]:disabled,
|
|
214
141
|
[part~="base"][aria-disabled="true"] {
|
|
215
142
|
opacity: var(--lr-opacity-disabled);
|
|
@@ -219,9 +146,6 @@ import{css}from"lit";const styles=css`
|
|
|
219
146
|
transition: background-color var(--lr-transition-fast),
|
|
220
147
|
color var(--lr-transition-fast), transform var(--lr-transition-fast);
|
|
221
148
|
}
|
|
222
|
-
/* One hover and one press rule for every appearance -- what moves per tier is the mix BASE
|
|
223
|
-
declared above, not the rule. Both out-specify each :host([appearance='…']) [part~='base']
|
|
224
|
-
block, so no tier silently loses its pointer feedback. */
|
|
225
149
|
[part~="base"]:not(:disabled, [aria-disabled="true"]):hover {
|
|
226
150
|
background: var(
|
|
227
151
|
--lr-button-hover-background,
|
|
@@ -247,7 +171,7 @@ import{css}from"lit";const styles=css`
|
|
|
247
171
|
[part~="start"],
|
|
248
172
|
[part~="end"] {
|
|
249
173
|
display: inline-flex;
|
|
250
|
-
flex: 0
|
|
174
|
+
flex: 0 0 auto;
|
|
251
175
|
min-inline-size: 0;
|
|
252
176
|
max-inline-size: 40%;
|
|
253
177
|
align-items: center;
|
|
@@ -262,18 +186,10 @@ import{css}from"lit";const styles=css`
|
|
|
262
186
|
text-overflow: ellipsis;
|
|
263
187
|
white-space: nowrap;
|
|
264
188
|
}
|
|
265
|
-
/* When the matching slot has no assigned content, button.class.ts stamps the hidden attribute
|
|
266
|
-
on the wrapper (a bare slot is an element child, so the old :empty rule could never match).
|
|
267
|
-
This higher-specificity selector wins over the display: inline-flex above so the empty
|
|
268
|
-
wrapper collapses and stops contributing a dead --lr-button-gap of inline space -- mirrors
|
|
269
|
-
input.styles.ts's identical [part='start'][hidden]/[part='end'][hidden] rule. */
|
|
270
189
|
[part~="start"][hidden],
|
|
271
190
|
[part~="end"][hidden] {
|
|
272
191
|
display: none;
|
|
273
192
|
}
|
|
274
|
-
/* A declared circle and an automatically detected icon-only label both use a square control.
|
|
275
|
-
circle additionally takes the pill radius above; an icon-only WA button keeps its selected
|
|
276
|
-
appearance's ordinary radius. */
|
|
277
193
|
:host([circle]) [part~="base"],
|
|
278
194
|
[part~="base"][data-icon-button] {
|
|
279
195
|
inline-size: var(
|
|
@@ -288,9 +204,6 @@ import{css}from"lit";const styles=css`
|
|
|
288
204
|
var(--_lr-button-padding-block)
|
|
289
205
|
);
|
|
290
206
|
}
|
|
291
|
-
/* Decorative dropdown chevron. The shared chevronIcon() points right, so the glyph -- not the
|
|
292
|
-
wrapping part -- is rotated to point down, matching lr-select's expand-icon; a down caret is
|
|
293
|
-
direction-neutral, so nothing here mirrors under RTL. */
|
|
294
207
|
[part="caret"] {
|
|
295
208
|
display: inline-flex;
|
|
296
209
|
flex: 0 0 auto;
|
|
@@ -300,13 +213,6 @@ import{css}from"lit";const styles=css`
|
|
|
300
213
|
[part="caret"] svg {
|
|
301
214
|
transform: rotate(90deg);
|
|
302
215
|
}
|
|
303
|
-
/* Padding and font-size per tier come straight from the ladder (see the :host block above), so
|
|
304
|
-
nothing here restates a scale. These five rules exist only so the button's own per-tier
|
|
305
|
-
--lr-button-size-* names stay LIVE override points rather than becoming decorative aliases:
|
|
306
|
-
deleting them would leave a documented custom property that silently does nothing, which is
|
|
307
|
-
worse than removing it outright. Both spellings of each aliased tier are matched, exactly as
|
|
308
|
-
the ladder does, so size="small" can never take the s tier's padding with the m tier's floor.
|
|
309
|
-
The "m"/"medium" tier needs no rule -- :host already carries that private default. */
|
|
310
216
|
:host([size="2xs"]) {
|
|
311
217
|
--_lr-button-min-height: var(
|
|
312
218
|
--lr-button-size-2xs,
|
|
@@ -333,13 +239,6 @@ import{css}from"lit";const styles=css`
|
|
|
333
239
|
var(--_lr-button-size-xl)
|
|
334
240
|
);
|
|
335
241
|
}
|
|
336
|
-
/* A true inline-link appearance: zero chrome (no padding, border, radius, or min-height floor),
|
|
337
|
-
underlined, colored from the same accent token "plain" uses, and inheriting the ambient font
|
|
338
|
-
so it flows within surrounding text. Kept after the size rules -- and it must stay there: it
|
|
339
|
-
resets padding/font with literals rather than the --lr-button-padding-* and
|
|
340
|
-
--lr-button-font-size knobs, so it wins over any tier's (and any consumer's) geometry, and it
|
|
341
|
-
zeroes both min-block-size and block-size so a pinned --lr-button-height cannot give an inline
|
|
342
|
-
link a button-shaped box either. */
|
|
343
242
|
:host([appearance="link"]) [part~="base"] {
|
|
344
243
|
inline-size: auto;
|
|
345
244
|
padding: 0;
|
|
@@ -353,10 +252,6 @@ import{css}from"lit";const styles=css`
|
|
|
353
252
|
text-decoration: underline;
|
|
354
253
|
text-underline-offset: var(--lr-size-0-15rem);
|
|
355
254
|
}
|
|
356
|
-
/* The one appearance whose pointer feedback is NOT a fill. A link has zero chrome and zero
|
|
357
|
-
padding, so the shared hover/press background would paint a tight rectangle around bare
|
|
358
|
-
inline text in the middle of a paragraph -- exactly the button-shaped box this appearance
|
|
359
|
-
exists to avoid. It moves its text by the same two mix tokens instead. */
|
|
360
255
|
:host([appearance="link"])
|
|
361
256
|
[part~="base"]:not(:disabled, [aria-disabled="true"]):hover {
|
|
362
257
|
background: transparent;
|
|
@@ -79,6 +79,9 @@ export interface LyraCheckboxEventMap {
|
|
|
79
79
|
* @cssstate disabled - Matches while disabled directly or by an ancestor fieldset.
|
|
80
80
|
* @cssstate indeterminate - Matches while the visual mixed state is true.
|
|
81
81
|
* @csspart form-control - The outer wrapper around the checkbox, error, and hint.
|
|
82
|
+
* @csspart row - The row wrapping the checkbox owner and the label as siblings. This is the node
|
|
83
|
+
* to size or align when laying out a column of checkboxes; `base`/`checkbox` is only the control
|
|
84
|
+
* box inside it, so its inline size tracks the box, not the row.
|
|
82
85
|
* @csspart base - Compatibility name for the interactive control; use `checkbox`.
|
|
83
86
|
* @csspart checkbox - The interactive `role="checkbox"` owner around the box. It is the same node
|
|
84
87
|
* as `base`, retains the shared `--lr-icon-button-size` minimum target at every size tier, and
|
|
@@ -28,7 +28,7 @@ var __decorate=function(decorators,target,key,desc){var c=arguments.length,r=c<3
|
|
|
28
28
|
><line x1="5" y1="12" x2="19" y2="12"></line></svg>
|
|
29
29
|
`}class LyraCheckbox extends LyraElement{static{this.defaultStrings={...super.defaultStrings,checkboxRequired:LYRA_DEFAULT_checkboxRequired,fieldRequired:LYRA_DEFAULT_fieldRequired}}static get validators(){return[currentValidityValidator("required","disabled","checked")]}static{this.styles=[LyraElement.styles,sizes,styles]}static{this.formAssociated=!0}static{this.properties={customError:{attribute:"custom-error",reflect:!0,noAccessor:!0},checked:{attribute:!1,noAccessor:!0},defaultChecked:{attribute:"checked",type:Boolean,reflect:!0,useDefault:!0,noAccessor:!0},indeterminate:{type:Boolean,reflect:!0,noAccessor:!0},disabled:{type:Boolean,reflect:!0,noAccessor:!0},name:{reflect:!0,noAccessor:!0,converter:omittedEmptyStringConverter},required:{type:Boolean,reflect:!0,noAccessor:!0},size:{reflect:!0},value:{reflect:!0,noAccessor:!0}}}get effectiveDisabled(){return this.disabled||this._fieldsetDisabled||this._groupDisabled}get checked(){return this._checked}set checked(next){const old=this._checked;this.settingDefaultChecked||(this._checkedDirty=!0),this._checked=!!next,this.syncFormState(),this.notifyOwningGroup(),this.requestUpdate("checked",old)}get defaultChecked(){return this._defaultChecked}set defaultChecked(next){if(this.reflectingDefaultChecked)return;const old=this._defaultChecked;this._defaultChecked=!!next,this.reflectingDefaultChecked=!0;try{this.toggleAttribute("checked",this._defaultChecked)}finally{this.reflectingDefaultChecked=!1}this._checkedDirty||this.restoreCheckedFromDefault(),this.requestUpdate("defaultChecked",old)}get indeterminate(){return this._indeterminate}set indeterminate(next){const old=this._indeterminate;this._indeterminate=!!next,this.syncFormState(),this.notifyOwningGroup(),this.requestUpdate("indeterminate",old)}notifyOwningGroup(){this.closest?.("lr-checkbox-group")?.notifyCheckboxStateChange?.(this)}get disabled(){return this._disabled}set disabled(next){const old=this._disabled;this._disabled=!!next,this.toggleAttribute("disabled",this._disabled),this.updateValidity(),this.requestUpdate("disabled",old)}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",this._name?this.setAttribute("name",this._name):this.removeAttribute("name"),this.requestUpdate("name",old)}get required(){return this._required}set required(next){const old=this._required;this._required=!!next,this.toggleAttribute("required",this._required),this.updateValidity(),this.requestUpdate("required",old)}get value(){return this._value}set value(next){const old=this._value;this._value=next??"on",next==null?this.hasAttribute("value")&&this.removeAttribute("value"):this.getAttribute("value")!==this._value&&this.setAttribute("value",this._value),this.syncFormState(),this.notifyOwningGroup(),this.requestUpdate("value",old,{reflect:!1})}constructor(){super(),this.size="m",this.hint="",this.helpText="",this.errorText="",this.hasLabelSlot=!1,this.hasHintSlot=!1,this.hasHelpTextSlot=!1,this.hasErrorSlot=!1,this.touched=!1,this.hasInteracted=!1,this.hasSyncedDescribedByElements=!1,this._defaultChecked=!1,this._checkedDirty=!1,this.settingDefaultChecked=!1,this.reflectingDefaultChecked=!1,this._fieldsetDisabled=!1,this._groupDisabled=!1,this._name="",this._checked=!1,this._indeterminate=!1,this._disabled=!1,this._required=!1,this._value="on",this.onClick=event=>{const owner=this[VALIDITY_ANCHOR]();for(const target of event.composedPath()){if(target===event.currentTarget)break;if(target&&typeof target=="object"&&target.nodeType===1&&target!==owner&&isActionableElement(target))return}this.toggle()},this.onKeyDown=e=>{this.effectiveDisabled||e.repeat||(e.key===" "||e.key==="Spacebar")&&(e.preventDefault(),this.toggle())},this.onSlotChange=event=>this.handleLabelSlotChange(event),this.onHintSlotChange=event=>{this.hasHintSlot=event.target.assignedElements({flatten:!0}).length>0},this.onHelpTextSlotChange=event=>{this.hasHelpTextSlot=event.target.assignedElements({flatten:!0}).length>0},this.onErrorSlotChange=event=>{this.hasErrorSlot=event.target.assignedElements({flatten:!0}).length>0},this.onLabelSlotChange=event=>this.handleLabelSlotChange(event),this.onBlur=event=>{!this.effectiveDisabled&&!this.matches(":disabled")&&(this.touched=!0,this.hasInteracted=!0,this.reflectInvalid()),relayNativeEvent(this,event)},this.onFocus=event=>{relayNativeEvent(this,event)},installInvalidEventAlias(this,init=>this.emit("lr-invalid",null,init)),this.internals=attachInternalsSafely(this),this.validityController=new AnchoredValidityController(this,this.internals,()=>this[VALIDITY_ANCHOR]()),installCustomErrorProperty(this,()=>this.validityController.customValidityMessage),this.syncFormState()}get form(){return getFormOwner(this.internals)}set form(owner){setFormOwner(this,owner)}getForm(){return getFormOwner(this.internals)}get labels(){return this.internals.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}[VALIDITY_ANCHOR](){return this.renderRoot?.querySelector(".checkbox-owner")??null}connectedCallback(){super.connectedCallback(),this.updateValidity();const MutationObserverCtor=this.ownerDocument.defaultView?.MutationObserver;this.labelObserver=MutationObserverCtor?new MutationObserverCtor(()=>{this.bindLabelObserverTargets(),this.recomputeHasLabelSlot()}):void 0,this.addEventListener("slotchange",this.onLabelSlotChange),this.bindLabelObserverTargets(),this.hasUpdated?(this.recomputeHasLabelSlot(),this.refreshNamedSlotState()):this.seedFirstRenderState(()=>{this.recomputeHasLabelSlot(),this.refreshNamedSlotState()})}refreshNamedSlotState(){const children=this.children;if(!children)return;const elements=Array.from(children);this.hasHintSlot=elements.some(element=>element.getAttribute("slot")==="hint"),this.hasHelpTextSlot=elements.some(element=>element.getAttribute("slot")==="help-text"),this.hasErrorSlot=elements.some(element=>element.getAttribute("slot")==="error")}disconnectedCallback(){this.removeEventListener("slotchange",this.onLabelSlotChange),this.labelObserver?.disconnect(),this.labelObserver=void 0,super.disconnectedCallback()}willUpdate(changed){super.willUpdate(changed)}updated(changed){super.updated(changed);const describedBy=this.getAttribute("aria-describedby"),hint=this.renderRoot.querySelector("#checkbox-hint"),error=this.renderRoot.querySelector("#checkbox-error");if(!describedBy&&!this.hasSyncedDescribedByElements&&(!hint||hint.hidden)&&(!error||error.hidden))return;const control=this.renderRoot.querySelector('[part~="base"]')??void 0;if(this.hasSyncedDescribedByElements=syncAriaDescribedByElements(this,control,describedBy),control&&"ariaDescribedByElements"in control){const reflected=control,current=reflected.ariaDescribedByElements??[],internal=[error,hint].filter(element=>!!(element&&!element.hidden));reflected.ariaDescribedByElements=[...current.filter(element=>element!==hint&&element!==error),...internal]}}get barredFromValidation(){return isBarredFromValidation(this,this.internals)}updateValidity(){this.barredFromValidation?this.validityController.setValidity({}):this.required&&!this.checked?this.validityController.setValidity({valueMissing:!0},this.localize("checkboxRequired")):this.validityController.setValidity({}),this.reflectInvalid()}reflectInvalid(){const barred=this.barredFromValidation;this.toggleAttribute("data-invalid",!barred&&this.touched&&!this.internals.validity.valid),syncValidityStates(this.internals,{required:this.required,hasInteracted:this.hasInteracted,barred}),setCustomState(this.internals,"checked",this.checked),setCustomState(this.internals,"indeterminate",this.indeterminate),setCustomState(this.internals,"disabled",this.effectiveDisabled)}syncFormState(){const state2=`${this.checked?"checked":"unchecked"}${this.indeterminate?"/indeterminate":""}`;this.internals.setFormValue(this.checked?this.value:null,state2),this.updateValidity()}formResetCallback(){this.restoreCheckedFromDefault(),this.touched=!1,this.hasInteracted=!1,this.reflectInvalid()}formStateRestoreCallback(state2,reason){const oldChecked=this._checked,oldIndeterminate=this._indeterminate;this._checked=state2==="checked"||state2==="checked/indeterminate",this._checkedDirty=!0,this._indeterminate=state2==="checked/indeterminate"||state2==="unchecked/indeterminate",this.syncFormState(),this.requestUpdate("checked",oldChecked),this.requestUpdate("indeterminate",oldIndeterminate)}resetFromGroup(){this.restoreCheckedFromDefault()}restoreCheckedFromDefault(){this.settingDefaultChecked=!0;try{this.checked=this._defaultChecked}finally{this.settingDefaultChecked=!1}this._checkedDirty=!1}formDisabledCallback(disabled){this._fieldsetDisabled=disabled,this.updateValidity(),this.requestUpdate()}setGroupDisabled(value){this._groupDisabled!==value&&(this._groupDisabled=value,this.updateValidity(),this.requestUpdate())}checkValidity(){return this.updateValidity(),this.internals.checkValidity()}reportValidity(){return this.updateValidity(),this.hasInteracted=!0,this.reflectInvalid(),this.internals.reportValidity()}setCustomValidity(message){this.validityController.setCustomValidity(message??""),this.reflectInvalid(),this.requestUpdate()}resetValidity(){this.setCustomValidity("")}click(){this.effectiveDisabled||this[VALIDITY_ANCHOR]()?.click()}focus(options){this.effectiveDisabled||this[VALIDITY_ANCHOR]()?.focus(options)}blur(){this[VALIDITY_ANCHOR]()?.blur()}toggle(){this.effectiveDisabled||(this.hasInteracted=!0,this.checked=!this.checked,this.indeterminate=!1,dispatchNativeEvent(this,"input"),this.emit("lr-input",{checked:this.checked}),dispatchNativeEvent(this,"change"),this.emit("lr-change",{checked:this.checked}))}isDefaultLabelNode(node){if(node.nodeType!==1)return!0;const slotName=node.getAttribute("slot");return slotName===null||slotName===""}labelForwardingSlots(){return Array.from(this.querySelectorAll("slot")).filter(slot=>{let top=slot;for(;top.parentNode&&top.parentNode!==this;)top=top.parentNode;return top.parentNode===this&&this.isDefaultLabelNode(top)})}observeLabelNode(node){if(this.labelObserver){if(node.nodeType===3){this.labelObserver.observe(node,{characterData:!0});return}node.nodeType===1&&this.labelObserver.observe(node,{attributes:!0,attributeFilter:["aria-hidden","aria-label","class","hidden","inert","slot","style"],childList:!0,characterData:!0,subtree:!0})}}bindLabelObserverTargets(){if(this.labelObserver){this.labelObserver.disconnect(),this.observeLabelNode(this);for(const slot of this.labelForwardingSlots())if(slot.assignedNodes().length!==0)for(const assigned of slot.assignedNodes({flatten:!0}))this.observeLabelNode(assigned)}}handleLabelSlotChange(event){const target=event.target;target?.nodeType!==1||target.localName!=="slot"||target.getRootNode()!==this.renderRoot&&!this.labelForwardingSlots().includes(target)||(this.bindLabelObserverTargets(),this.recomputeHasLabelSlot())}recomputeHasLabelSlot(){const renderRoot=this.renderRoot,childNodes=this.childNodes;if(!renderRoot||!childNodes)return;const slot=renderRoot.querySelector("slot:not([name])"),nodes=slot?slot.assignedNodes({flatten:!0}):Array.from(childNodes).filter(node=>this.isDefaultLabelNode(node)).flatMap(node=>{if(node.nodeType!==1||node.localName!=="slot")return[node];const forwardingSlot=node;return forwardingSlot.assignedNodes().length>0?forwardingSlot.assignedNodes({flatten:!0}):Array.from(forwardingSlot.childNodes)});this.hasLabelSlot=hasRealContent(nodes)}render(){const mixed=this.indeterminate,hasHint=this.hasHintSlot||this.hasHelpTextSlot||!!(this.hint||this.helpText),hasError=this.hasErrorSlot||this.errorText.length>0,controlParts=["box","control",this.checked?"checked control--checked":"",mixed?"indeterminate control--indeterminate":""].filter(Boolean).join(" "),describedBy=[this.getAttribute("aria-describedby")??"",hasError?"checkbox-error":"",hasHint?"checkbox-hint":""].filter(Boolean).join(" "),invalid=hasError||this.touched&&!this.internals.validity.valid;return html`
|
|
30
30
|
<div part="form-control">
|
|
31
|
-
<span class="checkbox-layout" @click=${this.onClick}>
|
|
31
|
+
<span class="checkbox-layout" part="row" @click=${this.onClick}>
|
|
32
32
|
<span
|
|
33
33
|
class="checkbox-owner"
|
|
34
34
|
part="base checkbox"
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
import{css}from"lit";const styles=css`
|
|
2
2
|
:host {
|
|
3
|
-
/* The box tracks the shared size ladder (internal/sizes.styles.ts): 70% of the tier's control
|
|
4
|
-
height, so the checkbox lines up with an lr-input/lr-select/lr-button of the same size
|
|
5
|
-
instead of carrying a scale of its own. At the default "m" tier this resolves to exactly the
|
|
6
|
-
1.75rem the control shipped with before it had a size at all, and the
|
|
7
|
-
--lr-icon-button-size cap is kept so a consumer compacting that theme token still compacts
|
|
8
|
-
this control with it. */
|
|
9
3
|
--_lr-checkbox-box-size: min(
|
|
10
4
|
var(--lr-icon-button-size),
|
|
11
5
|
calc(var(--lr-form-control-height) * 0.7)
|
|
12
6
|
);
|
|
13
7
|
display: inline-block;
|
|
14
|
-
/* Private default for the public label-indent hook. It uses the same two terms as the layout
|
|
15
|
-
below: the box's floor plus the label gap. A consumer can override the public hook on an
|
|
16
|
-
ancestor or directly on the checkbox. It does not reach a sibling node in the consumer's
|
|
17
|
-
tree, because custom properties inherit down, not sideways; a sibling <p> can compute the
|
|
18
|
-
same formula from --lr-theme-icon-button-size and --lr-theme-space-s. */
|
|
19
8
|
--_lr-checkbox-label-indent: calc(
|
|
20
9
|
var(--lr-checkbox-box-size, var(--_lr-checkbox-box-size)) +
|
|
21
10
|
var(--lr-space-s)
|
|
@@ -24,9 +13,6 @@ import{css}from"lit";const styles=css`
|
|
|
24
13
|
.checkbox-layout {
|
|
25
14
|
display: inline-flex;
|
|
26
15
|
align-items: center;
|
|
27
|
-
/* Derived from the published indent rather than repeating --lr-space-s, so the advertised
|
|
28
|
-
value and the rendered label offset cannot drift: the label always starts exactly
|
|
29
|
-
--lr-checkbox-label-indent from the base's inline start. Resolves to --lr-space-s by default. */
|
|
30
16
|
gap: 0;
|
|
31
17
|
cursor: pointer;
|
|
32
18
|
-webkit-tap-highlight-color: transparent;
|
|
@@ -53,16 +39,8 @@ import{css}from"lit";const styles=css`
|
|
|
53
39
|
justify-content: center;
|
|
54
40
|
flex: 0 0 auto;
|
|
55
41
|
box-sizing: border-box;
|
|
56
|
-
/* Matches the inline icon-affordance sizing convention used by
|
|
57
|
-
lr-combobox's clear-button / lr-select's toggle
|
|
58
|
-
(--lr-icon-button-size capped at the tier's own share of the control
|
|
59
|
-
height) — a real touch target without ballooning to the full 2.5rem
|
|
60
|
-
meant for standalone icon-only buttons. */
|
|
61
42
|
min-inline-size: var(--lr-checkbox-box-size, var(--_lr-checkbox-box-size));
|
|
62
43
|
min-block-size: var(--lr-checkbox-box-size, var(--_lr-checkbox-box-size));
|
|
63
|
-
/* The glyph is drawn at 1em, so the box owns the font size that scales it. Pinning it to the
|
|
64
|
-
ladder rather than letting it inherit keeps the checkmark proportional to the box at every
|
|
65
|
-
tier; at "m" it resolves to the same 1rem the surrounding text carries by default. */
|
|
66
44
|
font-size: var(--lr-form-control-font-size);
|
|
67
45
|
border: var(--lr-border-width-thin) solid var(--lr-color-border);
|
|
68
46
|
border-radius: calc(var(--lr-form-control-radius) * 0.6);
|
|
@@ -74,11 +52,6 @@ import{css}from"lit";const styles=css`
|
|
|
74
52
|
:host(:not(:disabled)) .checkbox-layout:hover [part~="box"] {
|
|
75
53
|
border-color: var(--lr-checkbox-hover-border, var(--lr-color-brand));
|
|
76
54
|
}
|
|
77
|
-
/* Pressed. Expressed as a ring around the box rather than as a fill, because the box's own fill
|
|
78
|
-
is the state readout: it is the page surface while unchecked and the brand while checked, and
|
|
79
|
-
tinting it under the thumb would either wash out the checkmark or read as a half-toggled box.
|
|
80
|
-
A ring is unambiguous in both states, and is visibly more than the hover's border-colour step
|
|
81
|
-
-- same soft-ring pressed vocabulary <lr-slider>'s thumb uses. */
|
|
82
55
|
:host(:not(:disabled)) .checkbox-layout:active [part~="box"] {
|
|
83
56
|
border-color: var(--lr-checkbox-active-border, var(--lr-color-brand));
|
|
84
57
|
box-shadow: 0 0 0 var(--lr-border-width-medium)
|
|
@@ -86,17 +59,9 @@ import{css}from"lit";const styles=css`
|
|
|
86
59
|
}
|
|
87
60
|
[part~="checked"],
|
|
88
61
|
[part~="indeterminate"] {
|
|
89
|
-
/* Component-scoped indirection (mirrors lr-source-picker's identical
|
|
90
|
-
--lr-source-picker-checked-bg/-border pair) so a consumer can retint just this control's
|
|
91
|
-
checked/indeterminate fill without hijacking the shared --lr-color-brand token used across
|
|
92
|
-
the rest of the library. */
|
|
93
62
|
background: var(--lr-checkbox-checked-bg, var(--lr-color-brand));
|
|
94
63
|
border-color: var(--lr-checkbox-checked-border, var(--lr-color-brand));
|
|
95
64
|
}
|
|
96
|
-
/* Gives a required-but-unmet checkbox a persistent visible affordance --
|
|
97
|
-
matching lr-combobox/lr-select's data-invalid styling hook --
|
|
98
|
-
beyond the transient native validation-bubble popup, which only shows
|
|
99
|
-
momentarily around reportValidity()/form submission. */
|
|
100
65
|
:host([data-invalid]) [part~="box"] {
|
|
101
66
|
border-color: var(--lr-checkbox-invalid-border, var(--lr-color-danger));
|
|
102
67
|
}
|
|
@@ -107,10 +72,6 @@ import{css}from"lit";const styles=css`
|
|
|
107
72
|
transform: scale(var(--checked-icon-scale, 1));
|
|
108
73
|
}
|
|
109
74
|
|
|
110
|
-
/* No explicit "display" here (unlike e.g. lr-combobox's
|
|
111
|
-
[part='form-control-label']), so the UA stylesheet's default
|
|
112
|
-
"[hidden] { display: none }" rule needs no author-side override to
|
|
113
|
-
take effect when hasLabelSlot is false. */
|
|
114
75
|
[part="label"] {
|
|
115
76
|
margin-inline-start: calc(
|
|
116
77
|
var(--lr-checkbox-label-indent, var(--_lr-checkbox-label-indent)) -
|
|
@@ -153,6 +153,8 @@ export declare class LyraCheckboxGroup extends LyraElement<LyraCheckboxGroupEven
|
|
|
153
153
|
private _value;
|
|
154
154
|
private _warnedDuplicateValues;
|
|
155
155
|
private pendingRestoreValues?;
|
|
156
|
+
/** A `value` assignment made before any checkbox child existed; applied on the next slotchange. */
|
|
157
|
+
private pendingValues?;
|
|
156
158
|
private childObserver?;
|
|
157
159
|
private childObserverDocument?;
|
|
158
160
|
private childObserverGeneration;
|
|
@@ -163,9 +165,21 @@ export declare class LyraCheckboxGroup extends LyraElement<LyraCheckboxGroupEven
|
|
|
163
165
|
* rebuilds that `FormData` in the same tick -- mirrors `<lr-token-input>`'s identical `name` setter. */
|
|
164
166
|
get name(): string;
|
|
165
167
|
set name(next: string);
|
|
166
|
-
/**
|
|
167
|
-
*
|
|
168
|
+
/** Checked child values, in DOM order. Reading returns a frozen defensive snapshot, so mutating
|
|
169
|
+
* the returned array never changes the group -- assign a new array instead.
|
|
170
|
+
*
|
|
171
|
+
* Assigning mirrors the array onto the owned checkboxes: a child whose `value` (defaulting to
|
|
172
|
+
* `'on'`) appears in the array becomes checked, every other child becomes unchecked, and
|
|
173
|
+
* duplicate entries check that many same-valued children. Assignment is controlled input, so it
|
|
174
|
+
* emits no `lr-change`; only user interaction does. Values naming no child are ignored.
|
|
175
|
+
*
|
|
176
|
+
* This used to be a getter with no setter. Reading it was fine, but `.value=${...}` -- the
|
|
177
|
+
* binding every other form control in this library accepts -- compiles to a plain property
|
|
178
|
+
* assignment that `readonly` cannot catch at the binding site, so it threw
|
|
179
|
+
* "Cannot set property value ... which has only a getter" from inside lit-html during a *later*
|
|
180
|
+
* render, pointing at framework internals rather than the offending line. */
|
|
168
181
|
get value(): readonly string[];
|
|
182
|
+
set value(next: readonly string[] | null | undefined);
|
|
169
183
|
get required(): boolean;
|
|
170
184
|
set required(next: boolean);
|
|
171
185
|
get disabled(): boolean;
|
|
@@ -194,8 +208,13 @@ export declare class LyraCheckboxGroup extends LyraElement<LyraCheckboxGroupEven
|
|
|
194
208
|
private onChildMutations;
|
|
195
209
|
private hasDirectSupportSlot;
|
|
196
210
|
private onSlotChange;
|
|
211
|
+
/** Checks exactly the children named by `values`, matching duplicates one-for-one, then re-syncs
|
|
212
|
+
* the owned value/validity. Shared by the `value` setter and by form restore. */
|
|
213
|
+
private applyValues;
|
|
197
214
|
/** Applies a restore only once real option children exist; FACE callbacks may run before them. */
|
|
198
215
|
private applyPendingRestore;
|
|
216
|
+
/** Applies a `value` assignment that arrived before any checkbox child existed. */
|
|
217
|
+
private applyPendingValues;
|
|
199
218
|
connectedCallback(): void;
|
|
200
219
|
private armChildObserver;
|
|
201
220
|
disconnectedCallback(): void;
|
|
@@ -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{AnchoredValidityController,resolveValidityAnchor,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{syncValidityStates}from"../../../internal/custom-states.js";import{nextId,srOnly}from"../../../internal/a11y.js";import{acquireAriaDescription}from"../../../internal/aria-controls.js";import{sizes}from"../../../internal/sizes.styles.js";import{styles}from"./checkbox-group.styles.js";import{attachInternalsSafely,createStringArrayFormDataState,getFormOwner,installCustomErrorProperty,isBarredFromValidation,readStringArrayFormDataState,setFormOwner}from"../../../internal/form-associated.js";import{installInvalidEventAlias}from"../../../internal/invalid-event-alias.js";import{LYRA_DEFAULT_checkboxGroupRequired,LYRA_DEFAULT_fieldRequired}from"../../../internal/default-strings.generated.js";function warnDuplicateValue(group,value){console.warn(`<lr-checkbox-group> has more than one <lr-checkbox> child with value="${value}"${group.name?` (name="${group.name}")`:""}; every checked one contributes an identical FormData entry, so the submitted data cannot say which was checked. Give each child a distinct \`value\`.`)}class LyraCheckboxGroup extends LyraElement{static{this.defaultStrings={...super.defaultStrings,checkboxGroupRequired:LYRA_DEFAULT_checkboxGroupRequired,fieldRequired:LYRA_DEFAULT_fieldRequired}}static{this.formAssociated=!0}static{this.styles=[LyraElement.styles,sizes,srOnly,styles]}static{this.properties={customError:{attribute:"custom-error",reflect:!0,noAccessor:!0},name:{reflect:!0,noAccessor:!0},required:{type:Boolean,reflect:!0,noAccessor:!0},disabled:{type:Boolean,reflect:!0,noAccessor:!0},size:{reflect:!0},orientation:{reflect:!0},value:{attribute:!1,noAccessor:!0}}}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",this._name?this.setAttribute("name",this._name):this.removeAttribute("name"),this.sync(),this.requestUpdate("name",old)}get value(){return Object.freeze([...this._value])}get required(){return this._required}set required(next){const old=this._required;this._required=!!next,this.toggleAttribute("required",this._required),this.sync(),this.requestUpdate("required",old)}get disabled(){return this._disabled}set disabled(next){const old=this._disabled;this._disabled=!!next,this.toggleAttribute("disabled",this._disabled),this.propagateDisabled(),this.sync(),this.requestUpdate("disabled",old)}constructor(){super(),this.orientation="vertical",this.label="",this.hint="",this.withLabel=!1,this.withHint=!1,this.errorText="",this.accessibleLabel="",this.touched=!1,this.hasInteracted=!1,this.hasLabelSlot=!1,this.hasHintSlot=!1,this.hasErrorSlot=!1,this.labelId=nextId("checkbox-group-label"),this.hintId=nextId("checkbox-group-hint"),this.errorId=nextId("checkbox-group-error"),this.requiredDescriptionId=nextId("checkbox-group-required"),this._fieldsetDisabled=!1,this._name="",this._required=!1,this._disabled=!1,this._value=[],this._warnedDuplicateValues=new Set,this.childObserverGeneration=0,this.childControllers=new Map,this.authoredChildSizes=new Map,this.onChildEvent=event=>{if(!this.isOwnedCheckbox(event.target)||(event.stopImmediatePropagation(),event.type!=="change"||this.effectiveDisabled))return;this.hasInteracted=!0,this.sync();const detail=()=>Object.freeze({value:this.value});this.emit("input",detail()),this.emit("change",detail()),this.emit("lr-change",detail())},this.onChildMutations=records=>{if(records.some(record=>record.type==="childList"||record.attributeName==="slot")){this.onSlotChange();return}for(const record of records){if(record.attributeName!=="size"||!this.isOwnedCheckbox(record.target))continue;const box=record.target;this.size!==void 0&&box.size!==this.size&&this.authoredChildSizes.set(box,box.size)}records.some(record=>record.attributeName==="size"&&this.isOwnedCheckbox(record.target))&&this.propagateSize(),records.some(record=>this.isOwnedCheckbox(record.target))&&this.sync()},this.onSlotChange=()=>{this.hasLabelSlot=this.hasDirectSupportSlot("label"),this.hasHintSlot=this.hasDirectSupportSlot("hint"),this.hasErrorSlot=this.hasDirectSupportSlot("error"),this.reconcileChildControllers(),this.applyPendingRestore()||this.sync(),this.propagateDisabled(),this.propagateSize()},this.internals=attachInternalsSafely(this),this.validityController=new AnchoredValidityController(this,this.internals,()=>this[VALIDITY_ANCHOR]()),installCustomErrorProperty(this,()=>this.validityController.customValidityMessage),installInvalidEventAlias(this,init=>this.emit("lr-invalid",null,init))}checkboxGroupOwner(element){const group=element.closest("lr-checkbox-group");if(!group)return null;let topLevelChild=element;for(;topLevelChild.parentElement&&topLevelChild.parentElement!==group;)topLevelChild=topLevelChild.parentElement;if(topLevelChild.parentElement!==group)return null;const slot=topLevelChild.getAttribute("slot");return slot==="label"||slot==="hint"||slot==="error"?null:group}ownsCheckbox(element){return element.localName==="lr-checkbox"&&this.checkboxGroupOwner(element)===this}get boxes(){const querySelectorAll=this.querySelectorAll;return typeof querySelectorAll!="function"?[]:Array.from(querySelectorAll.call(this,"lr-checkbox")).filter(box=>this.ownsCheckbox(box))}get effectiveDisabled(){return this.disabled||this._fieldsetDisabled}propagateDisabled(){const effective=this.effectiveDisabled;this.boxes.forEach(box=>box.setGroupDisabled?.(effective))}propagateSize(){for(const box of this.boxes)if(this.authoredChildSizes.has(box)||this.authoredChildSizes.set(box,box.size),this.size===void 0||this.size===null){const authored=this.authoredChildSizes.get(box);authored!==void 0&&box.size!==authored&&(box.size=authored),this.authoredChildSizes.delete(box)}else box.size!==this.size&&(box.size=this.size)}readValue(){return this.boxes.filter(box=>box.checked).map(box=>box.value??"on")}warnOnDuplicateValues(){const seen=new Set;for(const box of this.boxes){const value=box.value??box.getAttribute("value")??"on";if(!seen.has(value)){seen.add(value);continue}this._warnedDuplicateValues.has(value)||(this._warnedDuplicateValues.add(value),warnDuplicateValue(this,value))}}sync(){const next=this.readValue();this.warnOnDuplicateValues();const old=this._value;this._value=next,this.requestUpdate("value",old);const data=new FormData;this.name&&next.forEach(value=>data.append(this.name,value)),this.internals.setFormValue(this.name?data:null,createStringArrayFormDataState(this.name,next)),!this.barredFromValidation&&this.required&&next.length===0?this.validityController.setValidity({valueMissing:!0},this.localize("checkboxGroupRequired")):this.validityController.setValidity({}),this.reflectValidityStates()}notifyCheckboxStateChange(checkbox){this.isConnected&&this.ownsCheckbox(checkbox)&&this.sync()}get barredFromValidation(){return isBarredFromValidation(this,this.internals)}reflectValidityStates(){const barred=this.barredFromValidation;this.toggleAttribute("data-invalid",!barred&&this.touched&&!this.internals.validity.valid),syncValidityStates(this.internals,{required:this.required,hasInteracted:this.hasInteracted,barred})}isOwnedCheckbox(target){return target?.nodeType===1&&this.ownsCheckbox(target)}reconcileChildControllers(){const current=new Set(this.boxes);for(const[box,controller]of this.childControllers){if(current.has(box))continue;box.removeController(controller),this.childControllers.delete(box);const authoredSize=this.authoredChildSizes.get(box);authoredSize!==void 0&&box.size!==authoredSize&&(box.size=authoredSize),this.authoredChildSizes.delete(box);const nextOwner=this.checkboxGroupOwner(box);(!nextOwner||nextOwner===this)&&box.setGroupDisabled?.(!1)}for(const box of current){if(this.childControllers.has(box)||typeof box.addController!="function")continue;const controller={hostUpdated:()=>{this.isConnected&&this.ownsCheckbox(box)&&this.sync()}};box.addController(controller),this.childControllers.set(box,controller)}}hasDirectSupportSlot(name){return Array.from(this.children??[]).some(child=>child.getAttribute("slot")===name)}applyPendingRestore(){if(this.pendingRestoreValues===void 0||this.boxes.length===0)return!1;const remaining=[...this.pendingRestoreValues];this.pendingRestoreValues=void 0;for(const box of this.boxes){const value=box.value??"on",index=remaining.indexOf(value);box.checked=index>=0,index>=0&&remaining.splice(index,1)}return this.touched=!1,this.hasInteracted=!1,this.sync(),!0}connectedCallback(){super.connectedCallback(),this.addEventListener("input",this.onChildEvent),this.addEventListener("change",this.onChildEvent),this.addEventListener("lr-change",this.onChildEvent),this.onSlotChange(),this.armChildObserver(),this.hasUpdated&&this.syncRequiredDescription()}armChildObserver(){const ownerDocument=this.ownerDocument;if(!this.isConnected||this.childObserver&&this.childObserverDocument===ownerDocument)return;this.resetChildObserver();const MutationObserverCtor=ownerDocument.defaultView?.MutationObserver;if(!MutationObserverCtor)return;const generation=this.childObserverGeneration,observer=new MutationObserverCtor(records=>{this.childObserver!==observer||this.childObserverDocument!==ownerDocument||this.childObserverGeneration!==generation||!this.isConnected||this.ownerDocument!==ownerDocument||this.onChildMutations(records)});this.childObserver=observer,this.childObserverDocument=ownerDocument,observer.observe(this,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["checked","value","disabled","size","slot"]})}disconnectedCallback(){this.releaseRequiredDescription(),this.removeEventListener("input",this.onChildEvent),this.removeEventListener("change",this.onChildEvent),this.removeEventListener("lr-change",this.onChildEvent),this.resetChildObserver();for(const[box,controller]of this.childControllers){box.removeController(controller),box.setGroupDisabled?.(!1);const authoredSize=this.authoredChildSizes.get(box);authoredSize!==void 0&&box.size!==authoredSize&&(box.size=authoredSize)}this.childControllers.clear(),this.authoredChildSizes.clear(),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.resetChildObserver()}resetChildObserver(){this.childObserverGeneration+=1,this.childObserver?.disconnect(),this.childObserver=void 0,this.childObserverDocument=void 0}firstUpdated(changed){super.firstUpdated(changed),this.addEventListener("blur",event=>{const blurredControl=event.target;(typeof blurredControl?.matches=="function"?blurredControl.matches(":disabled"):this.effectiveDisabled)||(this.touched=!0,this.hasInteracted=!0),this.sync()},!0)}updated(changed){super.updated(changed),changed.has("size")&&this.propagateSize(),this.syncRequiredDescription()}syncRequiredDescription(){const target=this.renderRoot.querySelector("fieldset"),description=this.renderRoot.querySelector(`#${this.requiredDescriptionId}`);if(!this.required||!target||!description){this.releaseRequiredDescription();return}if(this.requiredDescriptionTarget!==target){this.releaseRequiredDescription(),this.requiredDescriptionTarget=target,this.requiredDescriptionLease=acquireAriaDescription(target,[description]);return}this.requiredDescriptionLease?.update([description])}releaseRequiredDescription(){this.requiredDescriptionLease?.release(),this.requiredDescriptionLease=void 0,this.requiredDescriptionTarget=void 0}[VALIDITY_ANCHOR](){const first=this.firstEnabledBox();return resolveValidityAnchor(first)??first??null}get form(){return getFormOwner(this.internals)}set form(owner){setFormOwner(this,owner)}getForm(){return getFormOwner(this.internals)}get labels(){return this.internals.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.hasInteracted=!0,this.reflectValidityStates(),this.internals.reportValidity()}setCustomValidity(message){this.validityController.setCustomValidity(message??""),this.reflectValidityStates(),this.requestUpdate()}get liveDisabled(){return this.effectiveDisabled||this.matches(":disabled")}firstEnabledBox(){return this.boxes.find(box=>!box.effectiveDisabled&&!box.matches(":disabled"))}focus(options){this.liveDisabled||this.firstEnabledBox()?.focus(options)}blur(){this.boxes.find(box=>box.matches(":focus-within"))?.blur()}click(){this.liveDisabled||this.firstEnabledBox()?.click()}formResetCallback(){this.boxes.forEach(box=>box.resetFromGroup()),this.touched=!1,this.hasInteracted=!1,this.sync()}formStateRestoreCallback(state2,_mode){this.pendingRestoreValues=readStringArrayFormDataState(state2),this.applyPendingRestore()}formDisabledCallback(disabled){this._fieldsetDisabled=disabled,this.propagateDisabled(),this.sync(),this.requestUpdate()}render(){const hasLabel=this.hasLabelSlot||!!this.label||this.withLabel,hasHint=this.hasHintSlot||!!this.hint||this.withHint,hasError=this.hasErrorSlot||!!this.errorText,described=[hasHint?this.hintId:"",hasError?this.errorId:""].filter(Boolean).join(" ")||nothing,invalid=hasError||this.touched&&!this.internals.validity.valid;return html`<fieldset
|
|
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{AnchoredValidityController,resolveValidityAnchor,VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{syncValidityStates}from"../../../internal/custom-states.js";import{nextId,srOnly}from"../../../internal/a11y.js";import{acquireAriaDescription}from"../../../internal/aria-controls.js";import{sizes}from"../../../internal/sizes.styles.js";import{styles}from"./checkbox-group.styles.js";import{attachInternalsSafely,createStringArrayFormDataState,getFormOwner,installCustomErrorProperty,isBarredFromValidation,readStringArrayFormDataState,setFormOwner}from"../../../internal/form-associated.js";import{installInvalidEventAlias}from"../../../internal/invalid-event-alias.js";import{LYRA_DEFAULT_checkboxGroupRequired,LYRA_DEFAULT_fieldRequired}from"../../../internal/default-strings.generated.js";function warnDuplicateValue(group,value){console.warn(`<lr-checkbox-group> has more than one <lr-checkbox> child with value="${value}"${group.name?` (name="${group.name}")`:""}; every checked one contributes an identical FormData entry, so the submitted data cannot say which was checked. Give each child a distinct \`value\`.`)}class LyraCheckboxGroup extends LyraElement{static{this.defaultStrings={...super.defaultStrings,checkboxGroupRequired:LYRA_DEFAULT_checkboxGroupRequired,fieldRequired:LYRA_DEFAULT_fieldRequired}}static{this.formAssociated=!0}static{this.styles=[LyraElement.styles,sizes,srOnly,styles]}static{this.properties={customError:{attribute:"custom-error",reflect:!0,noAccessor:!0},name:{reflect:!0,noAccessor:!0},required:{type:Boolean,reflect:!0,noAccessor:!0},disabled:{type:Boolean,reflect:!0,noAccessor:!0},size:{reflect:!0},orientation:{reflect:!0},value:{attribute:!1,noAccessor:!0}}}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",this._name?this.setAttribute("name",this._name):this.removeAttribute("name"),this.sync(),this.requestUpdate("name",old)}get value(){return Object.freeze([...this._value])}set value(next){const requested=Array.isArray(next)?next.filter(entry=>typeof entry=="string"):[];if(this.boxes.length===0){this.pendingValues=requested;return}this.pendingValues=void 0,this.applyValues(requested)}get required(){return this._required}set required(next){const old=this._required;this._required=!!next,this.toggleAttribute("required",this._required),this.sync(),this.requestUpdate("required",old)}get disabled(){return this._disabled}set disabled(next){const old=this._disabled;this._disabled=!!next,this.toggleAttribute("disabled",this._disabled),this.propagateDisabled(),this.sync(),this.requestUpdate("disabled",old)}constructor(){super(),this.orientation="vertical",this.label="",this.hint="",this.withLabel=!1,this.withHint=!1,this.errorText="",this.accessibleLabel="",this.touched=!1,this.hasInteracted=!1,this.hasLabelSlot=!1,this.hasHintSlot=!1,this.hasErrorSlot=!1,this.labelId=nextId("checkbox-group-label"),this.hintId=nextId("checkbox-group-hint"),this.errorId=nextId("checkbox-group-error"),this.requiredDescriptionId=nextId("checkbox-group-required"),this._fieldsetDisabled=!1,this._name="",this._required=!1,this._disabled=!1,this._value=[],this._warnedDuplicateValues=new Set,this.childObserverGeneration=0,this.childControllers=new Map,this.authoredChildSizes=new Map,this.onChildEvent=event=>{if(!this.isOwnedCheckbox(event.target)||(event.stopImmediatePropagation(),event.type!=="change"||this.effectiveDisabled))return;this.hasInteracted=!0,this.sync();const detail=()=>Object.freeze({value:this.value});this.emit("input",detail()),this.emit("change",detail()),this.emit("lr-change",detail())},this.onChildMutations=records=>{if(records.some(record=>record.type==="childList"||record.attributeName==="slot")){this.onSlotChange();return}for(const record of records){if(record.attributeName!=="size"||!this.isOwnedCheckbox(record.target))continue;const box=record.target;this.size!==void 0&&box.size!==this.size&&this.authoredChildSizes.set(box,box.size)}records.some(record=>record.attributeName==="size"&&this.isOwnedCheckbox(record.target))&&this.propagateSize(),records.some(record=>this.isOwnedCheckbox(record.target))&&this.sync()},this.onSlotChange=()=>{this.hasLabelSlot=this.hasDirectSupportSlot("label"),this.hasHintSlot=this.hasDirectSupportSlot("hint"),this.hasErrorSlot=this.hasDirectSupportSlot("error"),this.reconcileChildControllers(),!this.applyPendingRestore()&&!this.applyPendingValues()&&this.sync(),this.propagateDisabled(),this.propagateSize()},this.internals=attachInternalsSafely(this),this.validityController=new AnchoredValidityController(this,this.internals,()=>this[VALIDITY_ANCHOR]()),installCustomErrorProperty(this,()=>this.validityController.customValidityMessage),installInvalidEventAlias(this,init=>this.emit("lr-invalid",null,init))}checkboxGroupOwner(element){const group=element.closest("lr-checkbox-group");if(!group)return null;let topLevelChild=element;for(;topLevelChild.parentElement&&topLevelChild.parentElement!==group;)topLevelChild=topLevelChild.parentElement;if(topLevelChild.parentElement!==group)return null;const slot=topLevelChild.getAttribute("slot");return slot==="label"||slot==="hint"||slot==="error"?null:group}ownsCheckbox(element){return element.localName==="lr-checkbox"&&this.checkboxGroupOwner(element)===this}get boxes(){const querySelectorAll=this.querySelectorAll;return typeof querySelectorAll!="function"?[]:Array.from(querySelectorAll.call(this,"lr-checkbox")).filter(box=>this.ownsCheckbox(box))}get effectiveDisabled(){return this.disabled||this._fieldsetDisabled}propagateDisabled(){const effective=this.effectiveDisabled;this.boxes.forEach(box=>box.setGroupDisabled?.(effective))}propagateSize(){for(const box of this.boxes)if(this.authoredChildSizes.has(box)||this.authoredChildSizes.set(box,box.size),this.size===void 0||this.size===null){const authored=this.authoredChildSizes.get(box);authored!==void 0&&box.size!==authored&&(box.size=authored),this.authoredChildSizes.delete(box)}else box.size!==this.size&&(box.size=this.size)}readValue(){return this.boxes.filter(box=>box.checked).map(box=>box.value??"on")}warnOnDuplicateValues(){const seen=new Set;for(const box of this.boxes){const value=box.value??box.getAttribute("value")??"on";if(!seen.has(value)){seen.add(value);continue}this._warnedDuplicateValues.has(value)||(this._warnedDuplicateValues.add(value),warnDuplicateValue(this,value))}}sync(){const next=this.readValue();this.warnOnDuplicateValues();const old=this._value;this._value=next,this.requestUpdate("value",old);const data=new FormData;this.name&&next.forEach(value=>data.append(this.name,value)),this.internals.setFormValue(this.name?data:null,createStringArrayFormDataState(this.name,next)),!this.barredFromValidation&&this.required&&next.length===0?this.validityController.setValidity({valueMissing:!0},this.localize("checkboxGroupRequired")):this.validityController.setValidity({}),this.reflectValidityStates()}notifyCheckboxStateChange(checkbox){this.isConnected&&this.ownsCheckbox(checkbox)&&this.sync()}get barredFromValidation(){return isBarredFromValidation(this,this.internals)}reflectValidityStates(){const barred=this.barredFromValidation;this.toggleAttribute("data-invalid",!barred&&this.touched&&!this.internals.validity.valid),syncValidityStates(this.internals,{required:this.required,hasInteracted:this.hasInteracted,barred})}isOwnedCheckbox(target){return target?.nodeType===1&&this.ownsCheckbox(target)}reconcileChildControllers(){const current=new Set(this.boxes);for(const[box,controller]of this.childControllers){if(current.has(box))continue;box.removeController(controller),this.childControllers.delete(box);const authoredSize=this.authoredChildSizes.get(box);authoredSize!==void 0&&box.size!==authoredSize&&(box.size=authoredSize),this.authoredChildSizes.delete(box);const nextOwner=this.checkboxGroupOwner(box);(!nextOwner||nextOwner===this)&&box.setGroupDisabled?.(!1)}for(const box of current){if(this.childControllers.has(box)||typeof box.addController!="function")continue;const controller={hostUpdated:()=>{this.isConnected&&this.ownsCheckbox(box)&&this.sync()}};box.addController(controller),this.childControllers.set(box,controller)}}hasDirectSupportSlot(name){return Array.from(this.children??[]).some(child=>child.getAttribute("slot")===name)}applyValues(values){const remaining=[...values];for(const box of this.boxes){const value=box.value??"on",index=remaining.indexOf(value);box.checked=index>=0,index>=0&&remaining.splice(index,1)}this.sync()}applyPendingRestore(){if(this.pendingRestoreValues===void 0||this.boxes.length===0)return!1;const values=this.pendingRestoreValues;return this.pendingRestoreValues=void 0,this.touched=!1,this.hasInteracted=!1,this.applyValues(values),!0}applyPendingValues(){if(this.pendingValues===void 0||this.boxes.length===0)return!1;const values=this.pendingValues;return this.pendingValues=void 0,this.applyValues(values),!0}connectedCallback(){super.connectedCallback(),this.addEventListener("input",this.onChildEvent,{capture:!0}),this.addEventListener("change",this.onChildEvent,{capture:!0}),this.addEventListener("lr-change",this.onChildEvent,{capture:!0}),this.onSlotChange(),this.armChildObserver(),this.hasUpdated&&this.syncRequiredDescription()}armChildObserver(){const ownerDocument=this.ownerDocument;if(!this.isConnected||this.childObserver&&this.childObserverDocument===ownerDocument)return;this.resetChildObserver();const MutationObserverCtor=ownerDocument.defaultView?.MutationObserver;if(!MutationObserverCtor)return;const generation=this.childObserverGeneration,observer=new MutationObserverCtor(records=>{this.childObserver!==observer||this.childObserverDocument!==ownerDocument||this.childObserverGeneration!==generation||!this.isConnected||this.ownerDocument!==ownerDocument||this.onChildMutations(records)});this.childObserver=observer,this.childObserverDocument=ownerDocument,observer.observe(this,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["checked","value","disabled","size","slot"]})}disconnectedCallback(){this.releaseRequiredDescription(),this.removeEventListener("input",this.onChildEvent,{capture:!0}),this.removeEventListener("change",this.onChildEvent,{capture:!0}),this.removeEventListener("lr-change",this.onChildEvent,{capture:!0}),this.resetChildObserver();for(const[box,controller]of this.childControllers){box.removeController(controller),box.setGroupDisabled?.(!1);const authoredSize=this.authoredChildSizes.get(box);authoredSize!==void 0&&box.size!==authoredSize&&(box.size=authoredSize)}this.childControllers.clear(),this.authoredChildSizes.clear(),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.resetChildObserver()}resetChildObserver(){this.childObserverGeneration+=1,this.childObserver?.disconnect(),this.childObserver=void 0,this.childObserverDocument=void 0}firstUpdated(changed){super.firstUpdated(changed),this.addEventListener("blur",event=>{const blurredControl=event.target;(typeof blurredControl?.matches=="function"?blurredControl.matches(":disabled"):this.effectiveDisabled)||(this.touched=!0,this.hasInteracted=!0),this.sync()},!0)}updated(changed){super.updated(changed),changed.has("size")&&this.propagateSize(),this.syncRequiredDescription()}syncRequiredDescription(){const target=this.renderRoot.querySelector("fieldset"),description=this.renderRoot.querySelector(`#${this.requiredDescriptionId}`);if(!this.required||!target||!description){this.releaseRequiredDescription();return}if(this.requiredDescriptionTarget!==target){this.releaseRequiredDescription(),this.requiredDescriptionTarget=target,this.requiredDescriptionLease=acquireAriaDescription(target,[description]);return}this.requiredDescriptionLease?.update([description])}releaseRequiredDescription(){this.requiredDescriptionLease?.release(),this.requiredDescriptionLease=void 0,this.requiredDescriptionTarget=void 0}[VALIDITY_ANCHOR](){const first=this.firstEnabledBox();return resolveValidityAnchor(first)??first??null}get form(){return getFormOwner(this.internals)}set form(owner){setFormOwner(this,owner)}getForm(){return getFormOwner(this.internals)}get labels(){return this.internals.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.hasInteracted=!0,this.reflectValidityStates(),this.internals.reportValidity()}setCustomValidity(message){this.validityController.setCustomValidity(message??""),this.reflectValidityStates(),this.requestUpdate()}get liveDisabled(){return this.effectiveDisabled||this.matches(":disabled")}firstEnabledBox(){return this.boxes.find(box=>!box.effectiveDisabled&&!box.matches(":disabled"))}focus(options){this.liveDisabled||this.firstEnabledBox()?.focus(options)}blur(){this.boxes.find(box=>box.matches(":focus-within"))?.blur()}click(){this.liveDisabled||this.firstEnabledBox()?.click()}formResetCallback(){this.boxes.forEach(box=>box.resetFromGroup()),this.touched=!1,this.hasInteracted=!1,this.sync()}formStateRestoreCallback(state2,_mode){this.pendingRestoreValues=readStringArrayFormDataState(state2),this.applyPendingRestore()}formDisabledCallback(disabled){this._fieldsetDisabled=disabled,this.propagateDisabled(),this.sync(),this.requestUpdate()}render(){const hasLabel=this.hasLabelSlot||!!this.label||this.withLabel,hasHint=this.hasHintSlot||!!this.hint||this.withHint,hasError=this.hasErrorSlot||!!this.errorText,described=[hasHint?this.hintId:"",hasError?this.errorId:""].filter(Boolean).join(" ")||nothing,invalid=hasError||this.touched&&!this.internals.validity.valid;return html`<fieldset
|
|
2
2
|
part="form-control"
|
|
3
3
|
?disabled=${this.effectiveDisabled}
|
|
4
4
|
aria-label=${this.accessibleLabel||nothing}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/form-control.styles.js";const styles=css`
|
|
2
2
|
:host {
|
|
3
|
-
/* The group's own chrome rides the shared size ladder (internal/sizes.styles.ts). Both gaps are
|
|
4
|
-
fractions of the tier's control height rather than fixed space tokens, so they stay in
|
|
5
|
-
proportion to the options beside them; at the default "m" tier they resolve to exactly the
|
|
6
|
-
--lr-space-xs / --lr-space-s the group shipped with before it had a size at all. */
|
|
7
3
|
--_lr-checkbox-group-row-gap: calc(var(--lr-form-control-height) * 0.1);
|
|
8
4
|
--_lr-checkbox-group-option-gap: calc(var(--lr-form-control-height) * 0.2);
|
|
9
5
|
display: block;
|
|
@@ -21,18 +17,11 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
21
17
|
display: grid;
|
|
22
18
|
gap: var(--lr-checkbox-group-row-gap, var(--_lr-checkbox-group-row-gap));
|
|
23
19
|
}
|
|
24
|
-
/* The rendered legend's real part is "form-control-label" (see checkbox-group.class.ts's
|
|
25
|
-
render()), not "label" -- this must match it exactly or the rule is dead code. */
|
|
26
20
|
[part~="form-control-label"] {
|
|
27
21
|
font-weight: var(--lr-font-weight-semibold);
|
|
28
22
|
color: var(--lr-color-text);
|
|
29
23
|
font-size: var(--lr-form-control-font-size);
|
|
30
24
|
}
|
|
31
|
-
/* The required marker comes from the one shared sheet (internal/form-control.styles.ts) like
|
|
32
|
-
every other labelled control's, so its glyph, colour and spacing are consumer-settable. The
|
|
33
|
-
rule below suppresses this component's older hand-rolled glyph -- a literal <span> the legend
|
|
34
|
-
template still renders -- so the two never double up; it is dead the moment that span is
|
|
35
|
-
dropped from checkbox-group.class.ts's render(). */
|
|
36
25
|
:host([required]) [part~="form-control-label"] > span[aria-hidden="true"] {
|
|
37
26
|
display: none;
|
|
38
27
|
}
|
|
@@ -72,13 +61,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
72
61
|
max-inline-size: 100%;
|
|
73
62
|
overflow-wrap: anywhere;
|
|
74
63
|
}
|
|
75
|
-
/* :host(:disabled), never :host([disabled]) -- this is a form-associated custom element, so the
|
|
76
|
-
UA computes the FACE :disabled state from the group's own disabled attribute OR an ancestor
|
|
77
|
-
fieldset's cascade, which is exactly what effectiveDisabled already gates the options on. The
|
|
78
|
-
attribute selector would only ever have matched the first of the two.
|
|
79
|
-
Dimming lands on the three chrome parts the GROUP renders itself, not on the host: every owned
|
|
80
|
-
<lr-checkbox> already dims itself, and a host-level opacity would multiply with that and push
|
|
81
|
-
the options to a quarter of full contrast. */
|
|
82
64
|
:host(:disabled) [part~="form-control-label"],
|
|
83
65
|
:host(:disabled) [part="hint"],
|
|
84
66
|
:host(:disabled) [part="error"] {
|
|
@@ -7,12 +7,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
7
7
|
--_lr-code-editor-line-height: 1.5;
|
|
8
8
|
--_lr-code-editor-tab-size: 2;
|
|
9
9
|
}
|
|
10
|
-
/* Size ladder for the \`size\` property, mirroring lr-textarea's own six-step ladder (see its
|
|
11
|
-
"leaves the committed padding/font-size untouched at the default tier" test). The default tier
|
|
12
|
-
is "m"; the :host block above IS that tier, so a :host([size='m']) rule below would only restate
|
|
13
|
-
it -- these three tokens are the only ones that vary. min-block-size uses the existing
|
|
14
|
-
--lr-size-* geometry scale rather than the space scale, since it is a block-axis floor, not a
|
|
15
|
-
padding value. */
|
|
16
10
|
:host([size="2xs"]) {
|
|
17
11
|
--_lr-code-editor-min-block-size: var(--lr-size-4rem);
|
|
18
12
|
--_lr-code-editor-padding: var(--lr-space-2xs);
|
|
@@ -53,14 +47,7 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
53
47
|
color: var(--lr-color-text);
|
|
54
48
|
font-weight: var(--lr-font-weight-semibold);
|
|
55
49
|
}
|
|
56
|
-
/* The one required-marker rule the library shares, replacing the literal
|
|
57
|
-
<span aria-hidden="true">*</span> this template used to render: a marker that lives in the
|
|
58
|
-
stylesheet is suppressible and retunable by a consumer, and generated content can never leak
|
|
59
|
-
into the label's accessible name the way a real element can. */
|
|
60
50
|
${formControlRequiredMarker}
|
|
61
|
-
/* Keep the editor frame as the single scroll viewport. The textarea must not create a second
|
|
62
|
-
native horizontal scrollbar when wrap="off"; its max-content track lets the frame own both
|
|
63
|
-
axes instead. */
|
|
64
51
|
[part='editor'] {
|
|
65
52
|
display: grid;
|
|
66
53
|
grid-template-columns: auto max-content;
|
|
@@ -108,10 +95,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
108
95
|
position: absolute;
|
|
109
96
|
inset-inline: 0;
|
|
110
97
|
}
|
|
111
|
-
/* --lr-code-editor-tab-size is the single channel for the tab width: the class writes that token
|
|
112
|
-
inline on this part only when tabSize was explicitly assigned, so an untouched tabSize leaves a
|
|
113
|
-
host-level override of the token in charge instead of losing to an inline tab-size
|
|
114
|
-
declaration. */
|
|
115
98
|
[part="textarea"] {
|
|
116
99
|
display: block;
|
|
117
100
|
box-sizing: border-box;
|
|
@@ -146,12 +129,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
146
129
|
[part="textarea"]::placeholder {
|
|
147
130
|
color: var(--lr-color-text-quiet);
|
|
148
131
|
}
|
|
149
|
-
/* Mirrors lr-checkbox's [part='base']:hover [part='box'] -- the focus-visible outline above gives
|
|
150
|
-
keyboard users a cue that this is the interactive surface; :hover gives mouse users the same
|
|
151
|
-
cue via the editor frame's border, guarded off while disabled so it never implies the frame is
|
|
152
|
-
still interactive. */
|
|
153
|
-
/* no-pressed-state: the editor frame is a text surface, not a push target -- pointer-down
|
|
154
|
-
places a caret, and the border cue belongs to hover and :focus-visible. */
|
|
155
132
|
:host(:not(:disabled)) [part="editor"]:hover {
|
|
156
133
|
border-color: var(--lr-code-editor-hover-border, var(--lr-color-brand));
|
|
157
134
|
}
|
|
@@ -166,13 +143,6 @@ import{css}from"lit";import{formControlRequiredMarker}from"../../../internal/for
|
|
|
166
143
|
:host([data-invalid]) [part="editor"] {
|
|
167
144
|
border-color: var(--lr-code-editor-invalid-border, var(--lr-color-danger));
|
|
168
145
|
}
|
|
169
|
-
/* :host(:disabled), not :host([disabled]) -- this is a form-associated custom element
|
|
170
|
-
(FormAssociated mixin -> static formAssociated = true), so the UA computes its disabled state
|
|
171
|
-
(and therefore :disabled matching) the same way it does for a native form control: from its own
|
|
172
|
-
disabled content attribute *or* an ancestor <fieldset disabled>'s cascade. Keying this off the
|
|
173
|
-
attribute selector only ever matched the first case -- a textarea disabled purely via an
|
|
174
|
-
ancestor fieldset had effectiveDisabled correctly gating the internal <textarea>, but the host
|
|
175
|
-
still rendered at full opacity with a normal cursor (same fix as lr-chat-composer). */
|
|
176
146
|
:host(:disabled) {
|
|
177
147
|
opacity: var(--lr-opacity-disabled);
|
|
178
148
|
cursor: not-allowed;
|