@adia-ai/web-components 0.8.40 → 0.8.42
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 +71 -3
- package/MIGRATION.md +1229 -16
- package/README.md +25 -30
- package/USAGE.md +30 -4
- package/bin/audit-template-children.mjs +556 -0
- package/components/accordion/accordion-item.a2ui.json +4 -0
- package/components/accordion/accordion-item.yaml +2 -0
- package/components/accordion/accordion.a2ui.json +4 -0
- package/components/accordion/accordion.yaml +2 -0
- package/components/action-list/action-item.a2ui.json +29 -2
- package/components/action-list/action-item.yaml +46 -3
- package/components/action-list/action-list.a2ui.json +6 -1
- package/components/action-list/action-list.class.js +114 -11
- package/components/action-list/action-list.css +43 -3
- package/components/action-list/action-list.d.ts +6 -2
- package/components/action-list/action-list.yaml +5 -0
- package/components/adia-mark/adia-mark.a2ui.json +1 -0
- package/components/adia-wordmark/adia-wordmark.a2ui.json +1 -0
- package/components/agent-artifact/agent-artifact.a2ui.json +1 -0
- package/components/agent-feedback-bar/agent-feedback-bar.a2ui.json +6 -5
- package/components/agent-feedback-bar/agent-feedback-bar.yaml +6 -2
- package/components/agent-questions/agent-questions.a2ui.json +1 -0
- package/components/agent-reasoning/agent-reasoning.a2ui.json +6 -5
- package/components/agent-reasoning/agent-reasoning.yaml +6 -2
- package/components/agent-suggestions/agent-suggestions.a2ui.json +11 -2
- package/components/agent-suggestions/agent-suggestions.class.js +2 -1
- package/components/agent-suggestions/agent-suggestions.d.ts +4 -4
- package/components/agent-suggestions/agent-suggestions.yaml +4 -2
- package/components/agent-trace/agent-trace.a2ui.json +6 -5
- package/components/agent-trace/agent-trace.yaml +6 -2
- package/components/alert/alert.a2ui.json +1 -0
- package/components/alert/alert.css +1 -1
- package/components/anchor-bar/anchor-bar.a2ui.json +1 -0
- package/components/aside/aside.a2ui.json +1 -0
- package/components/avatar/avatar-group.a2ui.json +7 -1
- package/components/avatar/avatar-group.yaml +1 -0
- package/components/avatar/avatar.a2ui.json +12 -11
- package/components/avatar/avatar.d.ts +1 -1
- package/components/avatar/avatar.yaml +4 -4
- package/components/badge/badge.a2ui.json +1 -0
- package/components/block/block.a2ui.json +1 -0
- package/components/blockquote/blockquote.a2ui.json +1 -0
- package/components/breadcrumb/breadcrumb.a2ui.json +1 -0
- package/components/button/button.a2ui.json +1 -3
- package/components/button/button.yaml +1 -3
- package/components/calendar-grid/calendar-grid.a2ui.json +1 -0
- package/components/calendar-grid/calendar-grid.class.js +2 -1
- package/components/calendar-picker/calendar-picker.a2ui.json +143 -24
- package/components/calendar-picker/calendar-picker.class.js +490 -197
- package/components/calendar-picker/calendar-picker.css +120 -171
- package/components/calendar-picker/calendar-picker.yaml +225 -47
- package/components/canvas/canvas.a2ui.json +6 -5
- package/components/canvas/canvas.d.ts +37 -0
- package/components/canvas/canvas.js +72 -3
- package/components/canvas/canvas.yaml +6 -2
- package/components/card/card.a2ui.json +25 -2
- package/components/card/card.class.js +3 -0
- package/components/card/card.css +31 -1
- package/components/card/card.d.ts +2 -2
- package/components/card/card.examples.md +3 -3
- package/components/card/card.yaml +28 -4
- package/components/chart/chart.a2ui.json +27 -7
- package/components/chart/chart.class.js +64 -22
- package/components/chart/chart.css +6 -4
- package/components/chart/chart.d.ts +10 -4
- package/components/chart/chart.yaml +40 -6
- package/components/chart-legend/chart-legend.a2ui.json +7 -1
- package/components/chart-legend/chart-legend.class.js +59 -6
- package/components/chart-legend/chart-legend.css +5 -2
- package/components/chart-legend/chart-legend.d.ts +3 -1
- package/components/chart-legend/chart-legend.yaml +15 -1
- package/components/chat-thread/chat-input.a2ui.json +1 -0
- package/components/chat-thread/chat-thread.a2ui.json +10 -9
- package/components/chat-thread/chat-thread.yaml +13 -20
- package/components/check/check.a2ui.json +10 -9
- package/components/check/check.yaml +4 -4
- package/components/code/code.a2ui.json +1 -0
- package/components/col/col.a2ui.json +1 -0
- package/components/color-area/color-area.a2ui.json +148 -0
- package/components/color-area/color-area.class.js +657 -0
- package/components/color-area/color-area.css +188 -0
- package/components/color-area/color-area.d.ts +66 -0
- package/components/color-area/color-area.examples.md +19 -0
- package/components/color-area/color-area.js +17 -0
- package/components/color-area/color-area.yaml +183 -0
- package/components/color-input/color-input.a2ui.json +6 -5
- package/components/color-input/color-input.class.js +9 -6
- package/components/color-input/color-input.css +1 -1
- package/components/color-input/color-input.js +2 -2
- package/components/color-input/color-input.yaml +14 -12
- package/components/color-picker/color-picker.a2ui.json +16 -12
- package/components/color-picker/color-picker.class.js +24 -633
- package/components/color-picker/color-picker.css +14 -182
- package/components/color-picker/color-picker.yaml +41 -41
- package/components/combobox/combobox.a2ui.json +3 -2
- package/components/combobox/combobox.yaml +2 -2
- package/components/command/command.a2ui.json +12 -10
- package/components/command/command.class.js +3 -2
- package/components/command/command.yaml +17 -4
- package/components/context-menu/context-menu.a2ui.json +1 -0
- package/components/date-range-picker/date-range-picker.a2ui.json +2 -1
- package/components/date-range-picker/date-range-picker.yaml +1 -1
- package/components/datetime-picker/datetime-picker.a2ui.json +15 -108
- package/components/datetime-picker/datetime-picker.class.js +37 -690
- package/components/datetime-picker/datetime-picker.css +11 -183
- package/components/datetime-picker/datetime-picker.d.ts +4 -5
- package/components/datetime-picker/datetime-picker.yaml +44 -135
- package/components/demo-toggle/demo-toggle.a2ui.json +1 -0
- package/components/demo-toggle/demo-toggle.css +1 -1
- package/components/description-list/description-list.a2ui.json +2 -1
- package/components/description-list/description-list.css +1 -1
- package/components/description-list/description-list.d.ts +1 -1
- package/components/description-list/description-list.yaml +1 -1
- package/components/display-field/display-field.a2ui.json +1 -0
- package/components/divider/divider.a2ui.json +1 -0
- package/components/drawer/drawer.a2ui.json +1 -3
- package/components/drawer/drawer.css +1 -1
- package/components/drawer/drawer.yaml +0 -2
- package/components/drilldown/drilldown.a2ui.json +22 -20
- package/components/drilldown/drilldown.class.js +4 -3
- package/components/drilldown/drilldown.css +6 -6
- package/components/drilldown/drilldown.yaml +40 -9
- package/components/embed/embed.a2ui.json +6 -5
- package/components/embed/embed.yaml +2 -2
- package/components/empty-state/empty-state.a2ui.json +1 -0
- package/components/feed/feed-item.a2ui.json +25 -5
- package/components/feed/feed-item.yaml +28 -7
- package/components/feed/feed.a2ui.json +9 -2
- package/components/feed/feed.class.js +19 -12
- package/components/feed/feed.css +8 -8
- package/components/feed/feed.yaml +14 -1
- package/components/field/field.a2ui.json +2 -1
- package/components/field/field.class.js +4 -1
- package/components/field/field.examples.md +1 -1
- package/components/field/field.yaml +1 -1
- package/components/fields/fields.a2ui.json +1 -0
- package/components/fields/fields.examples.md +1 -1
- package/components/footer/footer.a2ui.json +1 -0
- package/components/frame/frame.a2ui.json +1 -0
- package/components/grid/grid.a2ui.json +1 -0
- package/components/header/header.a2ui.json +3 -2
- package/components/header/header.yaml +3 -3
- package/components/heatmap/heatmap.a2ui.json +2 -1
- package/components/heatmap/heatmap.class.js +1 -1
- package/components/heatmap/heatmap.css +4 -4
- package/components/heatmap/heatmap.yaml +1 -1
- package/components/icon/icon.a2ui.json +1 -0
- package/components/image/image.a2ui.json +28 -14
- package/components/image/image.class.js +38 -23
- package/components/image/image.css +18 -8
- package/components/image/image.d.ts +2 -2
- package/components/image/image.examples.md +3 -3
- package/components/image/image.yaml +23 -7
- package/components/index.js +1 -0
- package/components/inline-edit/inline-edit.a2ui.json +1 -0
- package/components/inline-message/inline-message.a2ui.json +3 -1
- package/components/inline-message/inline-message.class.js +3 -1
- package/components/inline-message/inline-message.d.ts +2 -2
- package/components/inline-message/inline-message.yaml +2 -1
- package/components/input/input.a2ui.json +66 -16
- package/components/input/input.class.js +64 -7
- package/components/input/input.css +14 -14
- package/components/input/input.d.ts +9 -4
- package/components/input/input.yaml +83 -10
- package/components/inspector/inspector.a2ui.json +1 -0
- package/components/integration-card/integration-card.a2ui.json +1 -0
- package/components/integration-card/integration-card.examples.md +2 -1
- package/components/kbd/kbd.a2ui.json +1 -0
- package/components/link/link.a2ui.json +2 -1
- package/components/link/link.yaml +1 -1
- package/components/list/list-item.a2ui.json +9 -0
- package/components/list/list-item.yaml +12 -0
- package/components/list/list.a2ui.json +9 -3
- package/components/list/list.class.js +14 -1
- package/components/list/list.css +12 -1
- package/components/list/list.d.ts +7 -5
- package/components/list/list.yaml +16 -6
- package/components/list-window/list-window.a2ui.json +1 -0
- package/components/list-window/list-window.class.js +2 -1
- package/components/loading-overlay/loading-overlay.a2ui.json +1 -0
- package/components/mark/mark.a2ui.json +2 -1
- package/components/mark/mark.yaml +1 -1
- package/components/menu/menu-divider.a2ui.json +1 -0
- package/components/menu/menu-item.a2ui.json +11 -4
- package/components/menu/menu-item.yaml +30 -3
- package/components/menu/menu-label.a2ui.json +1 -0
- package/components/menu/menu.a2ui.json +3 -2
- package/components/menu/menu.class.js +36 -8
- package/components/menu/menu.d.ts +5 -3
- package/components/menu/menu.yaml +3 -3
- package/components/modal/modal.a2ui.json +1 -0
- package/components/nav/nav.a2ui.json +1 -0
- package/components/nav/nav.class.js +14 -3
- package/components/nav-group/nav-group.a2ui.json +1 -0
- package/components/nav-group/nav-group.class.js +3 -1
- package/components/nav-item/nav-item.a2ui.json +1 -0
- package/components/noodles/noodles.a2ui.json +1 -0
- package/components/noodles/noodles.class.js +5 -1
- package/components/number-format/number-format.a2ui.json +1 -0
- package/components/option-card/option-card.a2ui.json +1 -0
- package/components/otp-input/otp-input.a2ui.json +3 -2
- package/components/otp-input/otp-input.yaml +9 -2
- package/components/page/page.a2ui.json +13 -0
- package/components/page/page.d.ts +1 -1
- package/components/page/page.yaml +1 -0
- package/components/pagination/pagination.a2ui.json +1 -0
- package/components/pagination/pagination.class.js +3 -2
- package/components/pane/pane.a2ui.json +17 -1
- package/components/pane/pane.class.js +35 -6
- package/components/pane/pane.css +17 -12
- package/components/pane/pane.d.ts +10 -7
- package/components/pane/pane.yaml +18 -1
- package/components/password-strength/password-strength.a2ui.json +1 -0
- package/components/pipeline-status/pipeline-status.a2ui.json +1 -0
- package/components/popover/popover.a2ui.json +7 -6
- package/components/popover/popover.class.js +2 -2
- package/components/popover/popover.d.ts +2 -2
- package/components/popover/popover.yaml +4 -4
- package/components/preview/preview.a2ui.json +1 -0
- package/components/preview/preview.class.js +5 -1
- package/components/progress/progress.a2ui.json +47 -24
- package/components/progress/progress.class.js +66 -11
- package/components/progress/progress.css +44 -26
- package/components/progress/progress.d.ts +7 -5
- package/components/progress/progress.examples.md +2 -2
- package/components/progress/progress.yaml +235 -53
- package/components/progress-row/progress-row.a2ui.json +16 -12
- package/components/progress-row/progress-row.d.ts +2 -2
- package/components/progress-row/progress-row.examples.md +2 -14
- package/components/progress-row/progress-row.yaml +28 -36
- package/components/qr-code/qr-code.a2ui.json +3 -2
- package/components/qr-code/qr-code.class.js +4 -4
- package/components/qr-code/qr-code.css +1 -1
- package/components/qr-code/qr-code.yaml +5 -3
- package/components/radio/radio.a2ui.json +8 -7
- package/components/radio/radio.class.js +8 -0
- package/components/radio/radio.yaml +3 -3
- package/components/radio-group/radio-group.a2ui.json +5 -3
- package/components/radio-group/radio-group.class.js +11 -0
- package/components/radio-group/radio-group.yaml +7 -1
- package/components/range/range.a2ui.json +6 -0
- package/components/range/range.class.js +2 -2
- package/components/range/range.css +2 -2
- package/components/range/range.yaml +3 -0
- package/components/rating/rating.a2ui.json +1 -0
- package/components/relative-time/relative-time.a2ui.json +1 -0
- package/components/richtext/richtext.a2ui.json +2 -1
- package/components/richtext/richtext.yaml +1 -1
- package/components/row/row.a2ui.json +1 -0
- package/components/search/search.a2ui.json +1 -0
- package/components/search/search.class.js +4 -1
- package/components/section/section.a2ui.json +1 -0
- package/components/segment/segment.a2ui.json +21 -10
- package/components/segment/segment.css +15 -0
- package/components/segment/segment.d.ts +2 -1
- package/components/segment/segment.yaml +20 -13
- package/components/segmented/segmented.a2ui.json +36 -7
- package/components/segmented/segmented.class.js +113 -22
- package/components/segmented/segmented.css +3 -0
- package/components/segmented/segmented.d.ts +3 -1
- package/components/segmented/segmented.yaml +80 -8
- package/components/select/select.a2ui.json +18 -13
- package/components/select/select.class.js +61 -37
- package/components/select/select.css +15 -13
- package/components/select/select.yaml +18 -7
- package/components/skeleton/skeleton.a2ui.json +8 -7
- package/components/skeleton/skeleton.class.js +8 -7
- package/components/skeleton/skeleton.css +21 -6
- package/components/skeleton/skeleton.d.ts +2 -2
- package/components/skeleton/skeleton.examples.md +2 -2
- package/components/skeleton/skeleton.yaml +3 -2
- package/components/skip-nav/skip-nav.a2ui.json +1 -0
- package/components/slider/slider.a2ui.json +6 -0
- package/components/slider/slider.class.js +20 -3
- package/components/slider/slider.css +2 -2
- package/components/slider/slider.yaml +3 -0
- package/components/spinner/spinner.a2ui.json +1 -0
- package/components/stack/stack.a2ui.json +1 -0
- package/components/stat/stat.a2ui.json +1 -0
- package/components/stat/stat.js +2 -2
- package/components/step-progress/step-progress.a2ui.json +1 -0
- package/components/step-progress/step-progress.yaml +1 -1
- package/components/stepper/stepper-item.a2ui.json +7 -3
- package/components/stepper/stepper-item.yaml +15 -5
- package/components/stepper/stepper.a2ui.json +5 -1
- package/components/stepper/stepper.class.js +31 -16
- package/components/stepper/stepper.d.ts +1 -1
- package/components/stepper/stepper.yaml +4 -2
- package/components/stream/stream.a2ui.json +1 -0
- package/components/swatch/swatch.a2ui.json +1 -0
- package/components/swatch/swatch.yaml +1 -1
- package/components/swiper/swiper.a2ui.json +1 -0
- package/components/swiper/swiper.class.js +5 -1
- package/components/switch/switch.a2ui.json +12 -11
- package/components/switch/switch.css +1 -1
- package/components/switch/switch.yaml +6 -6
- package/components/table/table.a2ui.json +1 -0
- package/components/table/table.class.js +14 -12
- package/components/table/table.css +11 -9
- package/components/table-toolbar/table-toolbar.a2ui.json +1 -0
- package/components/table-toolbar/table-toolbar.class.js +53 -22
- package/components/table-toolbar/table-toolbar.css +1 -1
- package/components/tabs/tab.a2ui.json +9 -0
- package/components/tabs/tab.js +4 -0
- package/components/tabs/tab.yaml +15 -0
- package/components/tabs/tabs.a2ui.json +9 -4
- package/components/tabs/tabs.class.js +13 -1
- package/components/tabs/tabs.css +8 -0
- package/components/tabs/tabs.d.ts +2 -0
- package/components/tabs/tabs.yaml +9 -2
- package/components/tag/tag.a2ui.json +1 -0
- package/components/tags-input/tags-input.a2ui.json +22 -17
- package/components/tags-input/tags-input.class.js +13 -11
- package/components/tags-input/tags-input.css +10 -6
- package/components/tags-input/tags-input.d.ts +16 -7
- package/components/tags-input/tags-input.examples.md +2 -2
- package/components/tags-input/tags-input.yaml +25 -8
- package/components/text/text.a2ui.json +6 -5
- package/components/text/text.css +10 -5
- package/components/text/text.d.ts +2 -2
- package/components/text/text.yaml +9 -4
- package/components/textarea/textarea.a2ui.json +2 -1
- package/components/textarea/textarea.yaml +1 -1
- package/components/theme-provider/theme-provider.a2ui.json +2 -1
- package/components/theme-provider/theme-provider.d.ts +5 -3
- package/components/theme-provider/theme-provider.yaml +5 -3
- package/components/time-picker/time-picker.a2ui.json +1 -0
- package/components/time-picker/time-picker.class.js +4 -2
- package/components/timeline/timeline-item.a2ui.json +26 -3
- package/components/timeline/timeline-item.yaml +22 -7
- package/components/timeline/timeline.a2ui.json +4 -0
- package/components/timeline/timeline.class.js +29 -18
- package/components/timeline/timeline.d.ts +3 -3
- package/components/timeline/timeline.yaml +2 -0
- package/components/toast/toast.a2ui.json +10 -3
- package/components/toast/toast.yaml +20 -13
- package/components/toc/toc.a2ui.json +1 -0
- package/components/toggle-group/toggle-group.a2ui.json +7 -3
- package/components/toggle-group/toggle-group.class.js +40 -1
- package/components/toggle-group/toggle-group.css +6 -1
- package/components/toggle-group/toggle-group.d.ts +2 -2
- package/components/toggle-group/toggle-group.yaml +21 -12
- package/components/toggle-group/toggle-option.a2ui.json +7 -3
- package/components/toggle-group/toggle-option.yaml +13 -7
- package/components/toggle-scheme/toggle-scheme.a2ui.json +2 -1
- package/components/toggle-scheme/toggle-scheme.yaml +1 -1
- package/components/toolbar/toolbar-group.a2ui.json +1 -0
- package/components/toolbar/toolbar.a2ui.json +1 -0
- package/components/toolbar/toolbar.class.js +3 -0
- package/components/tooltip/tooltip.a2ui.json +1 -0
- package/components/tour/tour-step.a2ui.json +4 -0
- package/components/tour/tour-step.yaml +2 -0
- package/components/tour/tour.a2ui.json +4 -0
- package/components/tour/tour.yaml +2 -0
- package/components/tree/tree-item.a2ui.json +5 -0
- package/components/tree/tree-item.yaml +3 -0
- package/components/tree/tree.a2ui.json +4 -0
- package/components/tree/tree.class.js +2 -1
- package/components/tree/tree.yaml +2 -0
- package/components/upload/upload.a2ui.json +8 -1
- package/components/upload/upload.class.js +35 -5
- package/components/upload/upload.css +28 -0
- package/components/upload/upload.d.ts +16 -0
- package/components/upload/upload.yaml +27 -7
- package/components/visually-hidden/visually-hidden.a2ui.json +1 -0
- package/core/dom.d.ts +11 -0
- package/core/dom.js +34 -0
- package/core/form.js +7 -0
- package/core/icons.js +5 -0
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/responsive.js +16 -4
- package/core/template.js +2 -1
- package/custom-elements.json +710 -587
- package/dist/host.min.css +1 -1
- package/dist/host.sheet.js +1 -1
- package/dist/theme-provider.min.js +5 -5
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +92 -105
- package/dist/web-components.sheet.js +1 -1
- package/index.d.ts +12 -1
- package/package.json +4 -2
- package/patterns/admin-shell/admin-shell.examples.html +2 -2
- package/patterns/conversion-funnel/conversion-funnel.examples.html +15 -15
- package/patterns/form-system/form-system.examples.html +1 -1
- package/patterns/inline-dialog/inline-dialog.examples.html +2 -2
- package/patterns/inline-dialog/inline-dialog.html +4 -0
- package/patterns/timezone-selector/timezone-selector.examples.html +1 -1
- package/patterns/timezone-selector/timezone-selector.html +2 -2
- package/styles/api/text.css +7 -0
- package/styles/components.css +1 -0
- package/traits/_catalog.json +129 -41
- package/traits/anchor-positioning/anchor-positioning.js +1 -0
- package/traits/announcer/announcer.js +1 -0
- package/traits/arrow-grid-nav/arrow-grid-nav.js +1 -0
- package/traits/attention-pulse/attention-pulse.js +1 -0
- package/traits/count-up/count-up.js +1 -0
- package/traits/define.js +78 -0
- package/traits/focus-restore/focus-restore.js +2 -1
- package/traits/haptic-feedback/haptic-feedback.js +1 -0
- package/traits/input-mask/input-mask.js +1 -0
- package/traits/intersection-observer/intersection-observer.js +1 -0
- package/traits/layout-animation/layout-animation.js +1 -0
- package/traits/noise-texture/noise-texture.js +1 -0
- package/traits/resize-observer/resize-observer.js +1 -0
- package/traits/scroll-progress/scroll-progress.js +1 -0
- package/traits/snap-to-grid/snap-to-grid.js +1 -0
- package/traits/sound-feedback/sound-feedback.js +1 -0
- package/traits/spring-animate/spring-animate.js +1 -0
- package/traits/validation/validation.js +1 -0
|
@@ -12,11 +12,35 @@ description: Bordered container with header, body, and footer sections. The nest
|
|
|
12
12
|
a [slot="description"] + [slot="action"] space-between pattern; multiple <section> siblings stack as the body.
|
|
13
13
|
props:
|
|
14
14
|
padding:
|
|
15
|
-
description: Interior padding scale
|
|
16
|
-
|
|
15
|
+
description: Interior padding scale — overrides --card-inset (the header/section/footer inset token) for the whole
|
|
16
|
+
card. Accepts the named scale (none/xs/sm/md/lg/xl — the parametric --a-padding-* tokens, same vocabulary as
|
|
17
|
+
block-ui's [padding]) or a literal space rung ("0"/"1"…"10"/"12"/"16", mapped to --a-space-N). Empty (default)
|
|
18
|
+
defers to the ambient --card-inset (context/[size]-driven) — unchanged behavior for the many existing cards
|
|
19
|
+
that never set this attribute.
|
|
17
20
|
type: string
|
|
18
|
-
default:
|
|
19
|
-
|
|
21
|
+
default: ''
|
|
22
|
+
enum:
|
|
23
|
+
- ''
|
|
24
|
+
- none
|
|
25
|
+
- xs
|
|
26
|
+
- sm
|
|
27
|
+
- md
|
|
28
|
+
- lg
|
|
29
|
+
- xl
|
|
30
|
+
- '0'
|
|
31
|
+
- '1'
|
|
32
|
+
- '2'
|
|
33
|
+
- '3'
|
|
34
|
+
- '4'
|
|
35
|
+
- '5'
|
|
36
|
+
- '6'
|
|
37
|
+
- '7'
|
|
38
|
+
- '8'
|
|
39
|
+
- '9'
|
|
40
|
+
- '10'
|
|
41
|
+
- '12'
|
|
42
|
+
- '16'
|
|
43
|
+
reflect: true
|
|
20
44
|
draggable:
|
|
21
45
|
description: Enables drag handle + cursor:grab. Wires the draggable trait; dispatches drag-end.
|
|
22
46
|
type: boolean
|
|
@@ -55,7 +55,10 @@
|
|
|
55
55
|
},
|
|
56
56
|
"cornerRadius": {
|
|
57
57
|
"description": "Bar corner radius in px (null = let CSS tokens decide)",
|
|
58
|
-
"type":
|
|
58
|
+
"type": [
|
|
59
|
+
"number",
|
|
60
|
+
"null"
|
|
61
|
+
],
|
|
59
62
|
"default": null
|
|
60
63
|
},
|
|
61
64
|
"data": {
|
|
@@ -85,17 +88,17 @@
|
|
|
85
88
|
"default": "abbr"
|
|
86
89
|
},
|
|
87
90
|
"hideAverage": {
|
|
88
|
-
"description": "
|
|
91
|
+
"description": "DEPRECATED (ADR-0063, gh#1563) — use `noAverage` instead. Same meaning, same default; kept working as a dual-read compat shim (one- time console.warn when it's the name that resolves). Removed in 0.9.0.",
|
|
89
92
|
"type": "boolean",
|
|
90
93
|
"default": false
|
|
91
94
|
},
|
|
92
95
|
"hideGrid": {
|
|
93
|
-
"description": "
|
|
96
|
+
"description": "DEPRECATED (ADR-0063, gh#1563) — use `noGrid` instead. Same meaning, same default; kept working as a dual-read compat shim (one-time console.warn when it's the name that resolves). Removed in 0.9.0.",
|
|
94
97
|
"type": "boolean",
|
|
95
98
|
"default": false
|
|
96
99
|
},
|
|
97
100
|
"hideValues": {
|
|
98
|
-
"description": "
|
|
101
|
+
"description": "DEPRECATED (ADR-0063, gh#1563) — use `noValues` instead. Same meaning, same default; kept working as a dual-read compat shim (one- time console.warn when it's the name that resolves). Removed in 0.9.0.",
|
|
99
102
|
"type": "boolean",
|
|
100
103
|
"default": false
|
|
101
104
|
},
|
|
@@ -104,6 +107,21 @@
|
|
|
104
107
|
"type": "boolean",
|
|
105
108
|
"default": false
|
|
106
109
|
},
|
|
110
|
+
"noAverage": {
|
|
111
|
+
"description": "When true, suppress the overlaid average line. Canonical spelling (ADR-0063, gh#1563) replacing `hideAverage`.",
|
|
112
|
+
"type": "boolean",
|
|
113
|
+
"default": false
|
|
114
|
+
},
|
|
115
|
+
"noGrid": {
|
|
116
|
+
"description": "Hide gridlines. Canonical spelling (ADR-0063, gh#1563) replacing `hideGrid`.",
|
|
117
|
+
"type": "boolean",
|
|
118
|
+
"default": false
|
|
119
|
+
},
|
|
120
|
+
"noValues": {
|
|
121
|
+
"description": "Hide value labels. Canonical spelling (ADR-0063, gh#1563) replacing `hideValues`.",
|
|
122
|
+
"type": "boolean",
|
|
123
|
+
"default": false
|
|
124
|
+
},
|
|
107
125
|
"seriesEmphasis": {
|
|
108
126
|
"description": "Multi-line only. Names one series key (matching a `y` key) to render at full strength — area fill + full-opacity line. Every other series drops its area fill and renders line-only at --chart-deemphasized-opacity. Empty (default) applies full treatment to every series, unchanged from pre-gh#561 behavior.",
|
|
109
127
|
"type": "string",
|
|
@@ -191,6 +209,7 @@
|
|
|
191
209
|
"poll"
|
|
192
210
|
],
|
|
193
211
|
"name": "UIChart",
|
|
212
|
+
"parts": {},
|
|
194
213
|
"related": [
|
|
195
214
|
"button",
|
|
196
215
|
"grid",
|
|
@@ -204,7 +223,7 @@
|
|
|
204
223
|
"description": "Chart rendering area"
|
|
205
224
|
},
|
|
206
225
|
"empty": {
|
|
207
|
-
"description": "Shown in place of the SVG when `.data` is empty or missing. Typically an `<empty-state-ui>` with icon + heading + description + optional action. Visibility is CSS-toggled via `[
|
|
226
|
+
"description": "Shown in place of the SVG when `.data` is empty or missing. Typically an `<empty-state-ui>` with icon + heading + description + optional action. Visibility is CSS-toggled via `[has-data]` on the host — authors don't need to manage it imperatively."
|
|
208
227
|
}
|
|
209
228
|
},
|
|
210
229
|
"states": [
|
|
@@ -213,8 +232,9 @@
|
|
|
213
232
|
"name": "idle"
|
|
214
233
|
},
|
|
215
234
|
{
|
|
216
|
-
"description": "No data — the empty slot (if provided) is rendered; otherwise the chart area renders nothing. Host carries [
|
|
217
|
-
"name": "empty"
|
|
235
|
+
"description": "No data — the empty slot (if provided) is rendered; otherwise the chart area renders nothing. Host carries [has-data] only when data is present (gh#1332 Category A — converged off the private [data-has-data] mirror).",
|
|
236
|
+
"name": "empty",
|
|
237
|
+
"selector": ":not([has-data])"
|
|
218
238
|
}
|
|
219
239
|
],
|
|
220
240
|
"status": "stable",
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
* type — chart type (default: 'bar')
|
|
22
22
|
* x — key for X-axis data
|
|
23
23
|
* y — key(s) for Y-axis, comma-separated for multi-series
|
|
24
|
-
*
|
|
24
|
+
* no-average — suppress the overlaid average line on bar/line (default: false — line shown).
|
|
25
|
+
* `hide-average` is a deprecated dual-read alias (ADR-0063, gh#1563).
|
|
25
26
|
* color — accent/success/warning/danger/info
|
|
26
|
-
*
|
|
27
|
-
*
|
|
27
|
+
* no-grid — hide gridlines. `hide-grid` is a deprecated dual-read alias (ADR-0063, gh#1563).
|
|
28
|
+
* no-values — hide value labels. `hide-values` is a deprecated dual-read alias (ADR-0063, gh#1563).
|
|
28
29
|
* corner-radius — bar corner radius in px (default: null, falls back to --a-radius)
|
|
29
30
|
* dots — line/multi-line marker visibility: all|none|hover|last (default: all)
|
|
30
31
|
* series-emphasis — multi-line: series key that keeps full area+line treatment; others render line-only, dimmed
|
|
@@ -215,10 +216,19 @@ export class UIChart extends UIElement {
|
|
|
215
216
|
type: { type: String, default: 'bar', reflect: true },
|
|
216
217
|
x: { type: String, default: '', reflect: true },
|
|
217
218
|
y: { type: String, default: '', reflect: true },
|
|
219
|
+
// ADR-0063 (gh#1563) — `no-*` is the ratified negation prefix; `hide-*`
|
|
220
|
+
// retires. `hideAverage`/`hideGrid`/`hideValues` stay declared (dual-
|
|
221
|
+
// read compat, 0.8.42) so old markup keeps reflecting; `#resolveNoAttr()`
|
|
222
|
+
// (called from connected()) mirrors an old-only value onto the new prop
|
|
223
|
+
// + warns once per attribute. Every internal render usage reads the
|
|
224
|
+
// canonical `noAverage`/`noGrid`/`noValues` below.
|
|
218
225
|
hideAverage: { type: Boolean, default: false, reflect: true, attribute: 'hide-average' },
|
|
226
|
+
noAverage: { type: Boolean, default: false, reflect: true, attribute: 'no-average' },
|
|
219
227
|
color: { type: String, default: '', reflect: true },
|
|
220
228
|
hideGrid: { type: Boolean, default: false, reflect: true, attribute: 'hide-grid' },
|
|
229
|
+
noGrid: { type: Boolean, default: false, reflect: true, attribute: 'no-grid' },
|
|
221
230
|
hideValues: { type: Boolean, default: false, reflect: true, attribute: 'hide-values' },
|
|
231
|
+
noValues: { type: Boolean, default: false, reflect: true, attribute: 'no-values' },
|
|
222
232
|
cornerRadius: { type: Number, default: null, reflect: true, attribute: 'corner-radius' },
|
|
223
233
|
smooth: { type: Number, default: 0.4, reflect: true },
|
|
224
234
|
size: { type: String, default: '', reflect: true },
|
|
@@ -241,6 +251,32 @@ export class UIChart extends UIElement {
|
|
|
241
251
|
|
|
242
252
|
static template = () => null;
|
|
243
253
|
|
|
254
|
+
// ADR-0063 (gh#1563) compat-shim warn-once flags — one per renamed
|
|
255
|
+
// attribute (not collapsed into one flag; each fires independently the
|
|
256
|
+
// first time its own old attribute resolves). Per-class, matching
|
|
257
|
+
// toggle-group.class.js's #deprecationWarned idiom.
|
|
258
|
+
static #warned = { hideAverage: false, hideGrid: false, hideValues: false };
|
|
259
|
+
|
|
260
|
+
/** Dual-read resolution for one `hide-*` → `no-*` rename (ADR-0063).
|
|
261
|
+
* New-name precedence: if `newAttr` is present, the old attribute is
|
|
262
|
+
* ignored outright (no mirror, no warn) — the new prop already reflects
|
|
263
|
+
* its own attribute normally. Otherwise, when only the old attribute is
|
|
264
|
+
* present, mirror its (always-true, boolean-presence) value onto the
|
|
265
|
+
* new prop and warn once per class. */
|
|
266
|
+
#resolveNoAttr(oldAttr, newAttr, newProp, warnKey) {
|
|
267
|
+
if (this.hasAttribute(newAttr)) return;
|
|
268
|
+
if (!this.hasAttribute(oldAttr)) return;
|
|
269
|
+
this[newProp] = true;
|
|
270
|
+
if (!UIChart.#warned[warnKey]) {
|
|
271
|
+
UIChart.#warned[warnKey] = true;
|
|
272
|
+
// eslint-disable-next-line no-console
|
|
273
|
+
console.warn(
|
|
274
|
+
`[AdiaUI] <chart-ui [${oldAttr}]> is deprecated — use [${newAttr}] ` +
|
|
275
|
+
`instead (ADR-0063, gh#1563). Kept working as-is; no behavior change.`,
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
244
280
|
#data = [];
|
|
245
281
|
#shapeWarned = false; // FEEDBACK-24: one-shot wrong-.data-shape warning
|
|
246
282
|
#resizeObs = null;
|
|
@@ -317,6 +353,12 @@ export class UIChart extends UIElement {
|
|
|
317
353
|
}
|
|
318
354
|
|
|
319
355
|
connected() {
|
|
356
|
+
// ADR-0063 (gh#1563) compat shims — resolve BEFORE the first render so
|
|
357
|
+
// there's no wrong-then-right flash; see #resolveNoAttr() above.
|
|
358
|
+
this.#resolveNoAttr('hide-average', 'no-average', 'noAverage', 'hideAverage');
|
|
359
|
+
this.#resolveNoAttr('hide-grid', 'no-grid', 'noGrid', 'hideGrid');
|
|
360
|
+
this.#resolveNoAttr('hide-values', 'no-values', 'noValues', 'hideValues');
|
|
361
|
+
|
|
320
362
|
if (!this.hasAttribute('role')) this.setAttribute('role', 'img');
|
|
321
363
|
if (!this.hasAttribute('aria-label')) this.setAttribute('aria-label', `${this.type} chart`);
|
|
322
364
|
|
|
@@ -439,13 +481,13 @@ export class UIChart extends UIElement {
|
|
|
439
481
|
// When the grid is hidden (in-card sparkline-like use) we can zero
|
|
440
482
|
// out the Y-axis label gutter entirely — otherwise the plot area
|
|
441
483
|
// collapses at small sizes.
|
|
442
|
-
const
|
|
443
|
-
const yLabelW =
|
|
484
|
+
const noGrid = this.noGrid;
|
|
485
|
+
const yLabelW = noGrid ? 0 : fontSize * 3.2;
|
|
444
486
|
const hasXLabels = !!this.x;
|
|
445
487
|
const pad = {
|
|
446
|
-
top:
|
|
447
|
-
right:
|
|
448
|
-
bottom: !hasXLabels ||
|
|
488
|
+
top: noGrid ? 2 : fontSize * 1.6,
|
|
489
|
+
right: noGrid ? 2 : fontSize * 1.2,
|
|
490
|
+
bottom: !hasXLabels || noGrid ? 2 : fontSize * 2.2,
|
|
449
491
|
left: yLabelW,
|
|
450
492
|
};
|
|
451
493
|
|
|
@@ -467,7 +509,7 @@ export class UIChart extends UIElement {
|
|
|
467
509
|
author-provided <* slot="empty"> into a template; subsequent renders
|
|
468
510
|
restore it so data-empty → data-present → data-empty transitions
|
|
469
511
|
don't lose the slotted empty-state-ui. Visibility is CSS-toggled via
|
|
470
|
-
[
|
|
512
|
+
[has-data] on the host. */
|
|
471
513
|
const existingEmpty = this.querySelector(':scope > [slot="empty"]');
|
|
472
514
|
if (existingEmpty && !this.#emptySlotTemplate) {
|
|
473
515
|
this.#emptySlotTemplate = existingEmpty.cloneNode(true);
|
|
@@ -477,10 +519,10 @@ export class UIChart extends UIElement {
|
|
|
477
519
|
if (this.#emptySlotTemplate) this.appendChild(this.#emptySlotTemplate.cloneNode(true));
|
|
478
520
|
|
|
479
521
|
if (!this.#data.length) {
|
|
480
|
-
this.removeAttribute('
|
|
522
|
+
this.removeAttribute('has-data');
|
|
481
523
|
return;
|
|
482
524
|
}
|
|
483
|
-
this.setAttribute('
|
|
525
|
+
this.setAttribute('has-data', '');
|
|
484
526
|
|
|
485
527
|
/* gh#561 — the DOM this pointed at is about to be wiped; drop the
|
|
486
528
|
reference so a stale node isn't held onto (its data-dot-active
|
|
@@ -1035,16 +1077,16 @@ export class UIChart extends UIElement {
|
|
|
1035
1077
|
displayTicks = ticks.filter((_, i) => i % 2 === 0 || i === ticks.length - 1);
|
|
1036
1078
|
}
|
|
1037
1079
|
|
|
1038
|
-
//
|
|
1039
|
-
// want labels without gridlines can omit
|
|
1080
|
+
// noGrid suppresses both gridlines AND axis labels — callers who
|
|
1081
|
+
// want labels without gridlines can omit no-grid and rely on token
|
|
1040
1082
|
// overrides to make gridlines transparent. This keeps compact in-card
|
|
1041
1083
|
// charts visually clean.
|
|
1042
|
-
if (!this.
|
|
1084
|
+
if (!this.noGrid) {
|
|
1043
1085
|
const tickRange = ticks[ticks.length - 1] - ticks[0];
|
|
1044
1086
|
const safeRange = tickRange || 1; // Prevent division by zero
|
|
1045
1087
|
for (const t of displayTicks) {
|
|
1046
1088
|
const gy = p.top + (height - p.top - p.bottom) * (1 - (t - ticks[0]) / safeRange);
|
|
1047
|
-
s += `<line data-grid x1="${p.left}" y1="${gy}" x2="${width - p.right}" y2="${gy}"/>`;
|
|
1089
|
+
s += `<line data-chart-grid x1="${p.left}" y1="${gy}" x2="${width - p.right}" y2="${gy}"/>`;
|
|
1048
1090
|
}
|
|
1049
1091
|
|
|
1050
1092
|
/* Y-axis labels */
|
|
@@ -1094,8 +1136,8 @@ export class UIChart extends UIElement {
|
|
|
1094
1136
|
let svg = this.#gridAndAxes(width, height, ticks, labels, pad, dims);
|
|
1095
1137
|
|
|
1096
1138
|
// At sm auto-hide value labels (they overlap at narrow widths).
|
|
1097
|
-
const showValues = !this.
|
|
1098
|
-
const showAverage = !this.
|
|
1139
|
+
const showValues = !this.noValues && dims.sizeClass !== 'sm';
|
|
1140
|
+
const showAverage = !this.noAverage && vals.length > 1 && dims.sizeClass !== 'sm' && !this.noGrid;
|
|
1099
1141
|
|
|
1100
1142
|
for (let i = 0; i < data.length; i++) {
|
|
1101
1143
|
const v = vals[i];
|
|
@@ -1155,8 +1197,8 @@ export class UIChart extends UIElement {
|
|
|
1155
1197
|
const isSm = dims.sizeClass === 'sm';
|
|
1156
1198
|
const dotR = isSm ? 1.5 : 3;
|
|
1157
1199
|
const hitR = Math.max(dotR, 10); // invisible hit-target for tooltip
|
|
1158
|
-
const showValues = !this.
|
|
1159
|
-
const showAverage = !this.
|
|
1200
|
+
const showValues = !this.noValues && !isSm;
|
|
1201
|
+
const showAverage = !this.noAverage && vals.length > 1 && !isSm && !this.noGrid;
|
|
1160
1202
|
|
|
1161
1203
|
points.forEach((p, i) => {
|
|
1162
1204
|
if (this.#shouldRenderDot(i, points.length)) {
|
|
@@ -1315,7 +1357,7 @@ export class UIChart extends UIElement {
|
|
|
1315
1357
|
ring += (i === 0 ? 'M' : 'L') + ` ${px} ${py}`;
|
|
1316
1358
|
}
|
|
1317
1359
|
ring += ' Z';
|
|
1318
|
-
svg += `<path data-grid d="${ring}"/>`;
|
|
1360
|
+
svg += `<path data-chart-grid d="${ring}"/>`;
|
|
1319
1361
|
}
|
|
1320
1362
|
|
|
1321
1363
|
/* Axis lines */
|
|
@@ -1323,7 +1365,7 @@ export class UIChart extends UIElement {
|
|
|
1323
1365
|
const a = -Math.PI / 2 + angleStep * i;
|
|
1324
1366
|
const px = cx + r * Math.cos(a);
|
|
1325
1367
|
const py = cy + r * Math.sin(a);
|
|
1326
|
-
svg += `<line data-grid x1="${cx}" y1="${cy}" x2="${px}" y2="${py}"/>`;
|
|
1368
|
+
svg += `<line data-chart-grid x1="${cx}" y1="${cy}" x2="${px}" y2="${py}"/>`;
|
|
1327
1369
|
}
|
|
1328
1370
|
|
|
1329
1371
|
/* Data polygon + per-vertex hit targets */
|
|
@@ -2108,7 +2150,7 @@ export class UIChart extends UIElement {
|
|
|
2108
2150
|
const by = pad.top + plotH - barH;
|
|
2109
2151
|
svg += `<path${this.#seriesFill(k % 10, keys[k])}${tip({ label: labels[i], value: v, series: keys[k] })} d="${topRoundedBarPath(bx, by, subBarW, barH, this.#resolveRadius())}"/>`;
|
|
2110
2152
|
|
|
2111
|
-
if (!this.
|
|
2153
|
+
if (!this.noValues) {
|
|
2112
2154
|
svg += `<text data-value x="${bx + subBarW / 2}" y="${by - 4}" text-anchor="middle" font-size="${dims.valueSize}">${this.#fmtValue(v)}</text>`;
|
|
2113
2155
|
}
|
|
2114
2156
|
}
|
|
@@ -108,10 +108,12 @@
|
|
|
108
108
|
[data-legend] { flex: 0 0 auto; }
|
|
109
109
|
|
|
110
110
|
/* Empty-state slot — author places <empty-state-ui slot="empty"> inside
|
|
111
|
-
chart-ui. CSS toggles visibility on [
|
|
112
|
-
when .data is non-empty
|
|
111
|
+
chart-ui. CSS toggles visibility on [has-data] (set by chart.class.js
|
|
112
|
+
when .data is non-empty; gh#1332 Category A — converged off the
|
|
113
|
+
private [data-has-data] mirror). No data ⇒ empty-state visible;
|
|
114
|
+
data ⇒ hidden. */
|
|
113
115
|
& > [slot="empty"] { display: none; }
|
|
114
|
-
:scope:not([
|
|
116
|
+
:scope:not([has-data]) > [slot="empty"] {
|
|
115
117
|
display: flex;
|
|
116
118
|
flex: 1 1 auto;
|
|
117
119
|
align-items: center;
|
|
@@ -150,7 +152,7 @@
|
|
|
150
152
|
|
|
151
153
|
/* ── Grid lines ── */
|
|
152
154
|
|
|
153
|
-
[data-grid] {
|
|
155
|
+
[data-chart-grid] {
|
|
154
156
|
stroke: var(--chart-grid);
|
|
155
157
|
stroke-width: 1;
|
|
156
158
|
fill: none;
|
|
@@ -23,21 +23,27 @@ export class UIChart extends UIElement {
|
|
|
23
23
|
/** Color scheme */
|
|
24
24
|
color: 'accent' | 'success' | 'warning' | 'danger' | 'info';
|
|
25
25
|
/** Bar corner radius in px (null = let CSS tokens decide) */
|
|
26
|
-
cornerRadius: number;
|
|
26
|
+
cornerRadius: number | null;
|
|
27
27
|
/** JS property (set programmatically — `el.data = [...]`). An array of plain objects; each object's keys are named by the `x` and `y` attributes — e.g. `<chart-ui x="month" y="revenue">` consumes `[{month:'Jan', revenue:3200}, {month:'Feb', revenue:4100}]`. The Chart.js `{labels, datasets}` envelope is NOT chart-ui's API — passing it (or any non-array value) renders an empty chart. May also be supplied declaratively as a JSON-array `data="[…]"` attribute, hydrated once at connect. Custom accessor on the element class, not a reflected attribute. */
|
|
28
28
|
data: string;
|
|
29
29
|
/** Marker (dot) visibility for line and multi-line series. `all` draws a circle[data-dot] on every datum (default — matches pre-gh#561 behavior). `none` hides all dots so a dense series reads as a clean line. `hover` shows only the currently-hovered datum's dot. `last` shows only the terminal point per series (sparkline convention). Tooltip hit targets ([data-hit]) are a separate always-rendered layer — every mode keeps hover/click working along the whole line. */
|
|
30
30
|
dots: 'all' | 'none' | 'hover' | 'last';
|
|
31
31
|
/** Number-format mode applied to axis labels + value overlays + donut total + gauge value + treemap value + funnel value + internal tooltip. `abbr` is the legacy 1.2K / 3M format; `decimal` fixes 2 decimals; `currency` prefixes via `--chart-currency-prefix` token (default "$"); `percent` multiplies × 100 and adds a % suffix. */
|
|
32
32
|
format: 'abbr' | 'decimal' | 'currency' | 'percent';
|
|
33
|
-
/**
|
|
33
|
+
/** DEPRECATED (ADR-0063, gh#1563) — use `noAverage` instead. Same meaning, same default; kept working as a dual-read compat shim (one- time console.warn when it's the name that resolves). Removed in 0.9.0. */
|
|
34
34
|
hideAverage: boolean;
|
|
35
|
-
/**
|
|
35
|
+
/** DEPRECATED (ADR-0063, gh#1563) — use `noGrid` instead. Same meaning, same default; kept working as a dual-read compat shim (one-time console.warn when it's the name that resolves). Removed in 0.9.0. */
|
|
36
36
|
hideGrid: boolean;
|
|
37
|
-
/**
|
|
37
|
+
/** DEPRECATED (ADR-0063, gh#1563) — use `noValues` instead. Same meaning, same default; kept working as a dual-read compat shim (one- time console.warn when it's the name that resolves). Removed in 0.9.0. */
|
|
38
38
|
hideValues: boolean;
|
|
39
39
|
/** Show a skeleton placeholder instead of the chart body. Set to true while data is being fetched; clear once data arrives. Preserves the element's aspect-ratio dimensions so the skeleton occupies the same space the chart will fill. Parity with stat-ui[loading] and table-ui[loading] (§FB-12, v0.6.27). */
|
|
40
40
|
loading: boolean;
|
|
41
|
+
/** When true, suppress the overlaid average line. Canonical spelling (ADR-0063, gh#1563) replacing `hideAverage`. */
|
|
42
|
+
noAverage: boolean;
|
|
43
|
+
/** Hide gridlines. Canonical spelling (ADR-0063, gh#1563) replacing `hideGrid`. */
|
|
44
|
+
noGrid: boolean;
|
|
45
|
+
/** Hide value labels. Canonical spelling (ADR-0063, gh#1563) replacing `hideValues`. */
|
|
46
|
+
noValues: boolean;
|
|
41
47
|
/** Multi-line only. Names one series key (matching a `y` key) to render at full strength — area fill + full-opacity line. Every other series drops its area fill and renders line-only at --chart-deemphasized-opacity. Empty (default) applies full treatment to every series, unchanged from pre-gh#561 behavior. */
|
|
42
48
|
seriesEmphasis: string;
|
|
43
49
|
/** Chart size */
|
|
@@ -62,20 +62,52 @@ props:
|
|
|
62
62
|
- danger
|
|
63
63
|
- info
|
|
64
64
|
hideAverage:
|
|
65
|
-
description:
|
|
65
|
+
description: >-
|
|
66
|
+
DEPRECATED (ADR-0063, gh#1563) — use `noAverage` instead. Same
|
|
67
|
+
meaning, same default; kept working as a dual-read compat shim (one-
|
|
68
|
+
time console.warn when it's the name that resolves). Removed in
|
|
69
|
+
0.9.0.
|
|
66
70
|
type: boolean
|
|
67
71
|
default: false
|
|
68
72
|
attribute: hide-average
|
|
73
|
+
noAverage:
|
|
74
|
+
description: >-
|
|
75
|
+
When true, suppress the overlaid average line. Canonical spelling
|
|
76
|
+
(ADR-0063, gh#1563) replacing `hideAverage`.
|
|
77
|
+
type: boolean
|
|
78
|
+
default: false
|
|
79
|
+
attribute: no-average
|
|
69
80
|
hideGrid:
|
|
70
|
-
description:
|
|
81
|
+
description: >-
|
|
82
|
+
DEPRECATED (ADR-0063, gh#1563) — use `noGrid` instead. Same meaning,
|
|
83
|
+
same default; kept working as a dual-read compat shim (one-time
|
|
84
|
+
console.warn when it's the name that resolves). Removed in 0.9.0.
|
|
71
85
|
type: boolean
|
|
72
86
|
default: false
|
|
73
87
|
attribute: hide-grid
|
|
88
|
+
noGrid:
|
|
89
|
+
description: >-
|
|
90
|
+
Hide gridlines. Canonical spelling (ADR-0063, gh#1563) replacing
|
|
91
|
+
`hideGrid`.
|
|
92
|
+
type: boolean
|
|
93
|
+
default: false
|
|
94
|
+
attribute: no-grid
|
|
74
95
|
hideValues:
|
|
75
|
-
description:
|
|
96
|
+
description: >-
|
|
97
|
+
DEPRECATED (ADR-0063, gh#1563) — use `noValues` instead. Same
|
|
98
|
+
meaning, same default; kept working as a dual-read compat shim (one-
|
|
99
|
+
time console.warn when it's the name that resolves). Removed in
|
|
100
|
+
0.9.0.
|
|
76
101
|
type: boolean
|
|
77
102
|
default: false
|
|
78
103
|
attribute: hide-values
|
|
104
|
+
noValues:
|
|
105
|
+
description: >-
|
|
106
|
+
Hide value labels. Canonical spelling (ADR-0063, gh#1563) replacing
|
|
107
|
+
`hideValues`.
|
|
108
|
+
type: boolean
|
|
109
|
+
default: false
|
|
110
|
+
attribute: no-values
|
|
79
111
|
cornerRadius:
|
|
80
112
|
description: Bar corner radius in px (null = let CSS tokens decide)
|
|
81
113
|
type: number
|
|
@@ -179,7 +211,7 @@ slots:
|
|
|
179
211
|
description: >-
|
|
180
212
|
Shown in place of the SVG when `.data` is empty or missing. Typically an
|
|
181
213
|
`<empty-state-ui>` with icon + heading + description + optional action.
|
|
182
|
-
Visibility is CSS-toggled via `[
|
|
214
|
+
Visibility is CSS-toggled via `[has-data]` on the host — authors
|
|
183
215
|
don't need to manage it imperatively.
|
|
184
216
|
states:
|
|
185
217
|
- name: idle
|
|
@@ -187,8 +219,10 @@ states:
|
|
|
187
219
|
- name: empty
|
|
188
220
|
description: >-
|
|
189
221
|
No data — the empty slot (if provided) is rendered; otherwise the chart
|
|
190
|
-
area renders nothing. Host carries [
|
|
191
|
-
is present
|
|
222
|
+
area renders nothing. Host carries [has-data] only when data
|
|
223
|
+
is present (gh#1332 Category A — converged off the private
|
|
224
|
+
[data-has-data] mirror).
|
|
225
|
+
selector: ":not([has-data])"
|
|
192
226
|
traits: []
|
|
193
227
|
tokens: {}
|
|
194
228
|
a2ui:
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"type": "string",
|
|
27
27
|
"default": ""
|
|
28
28
|
},
|
|
29
|
+
"interactive": {
|
|
30
|
+
"description": "Canonical opt-in spelling (ADR-0063, gh#1563) replacing `static`'s opt-out polarity. Rows are interactive <button>-role badges by default — this default stays `true` in 0.8.42 (deliberately NOT flipped yet; the 0.9.0 cut inverts it to `false` after a full consumer scan of every `<chart-legend-ui>` tag per the ADR).",
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"default": true
|
|
33
|
+
},
|
|
29
34
|
"onToggle": {
|
|
30
35
|
"description": "Series-toggle mode emitted via the `toggle` event. `hide` removes the series from the render; `opacity` fades it. Wired via [for] on chart-ui.",
|
|
31
36
|
"type": "string",
|
|
@@ -58,7 +63,7 @@
|
|
|
58
63
|
"default": "dot"
|
|
59
64
|
},
|
|
60
65
|
"static": {
|
|
61
|
-
"description": "When set, rows are non-interactive <span>s (no click, no toggle).",
|
|
66
|
+
"description": "DEPRECATED (ADR-0063, gh#1563) — use `interactive` instead. When set (and `interactive` is absent), rows are non-interactive <span>s (no click, no toggle). Kept working as a dual-read compat shim (one-time console.warn when it's the name that resolves). Removed in 0.9.0.",
|
|
62
67
|
"type": "boolean",
|
|
63
68
|
"default": false
|
|
64
69
|
}
|
|
@@ -116,6 +121,7 @@
|
|
|
116
121
|
"visualization"
|
|
117
122
|
],
|
|
118
123
|
"name": "UIChartLegend",
|
|
124
|
+
"parts": {},
|
|
119
125
|
"related": [
|
|
120
126
|
"chart",
|
|
121
127
|
"badge",
|
|
@@ -35,9 +35,12 @@
|
|
|
35
35
|
* position — top | bottom | left | right. Layout hint; actual placement
|
|
36
36
|
* is where the element is placed in the DOM. Drives
|
|
37
37
|
* flex-direction.
|
|
38
|
-
*
|
|
39
|
-
* role
|
|
40
|
-
*
|
|
38
|
+
* interactive — canonical opt-in spelling (ADR-0063, gh#1563). Rows
|
|
39
|
+
* default interactive (`role="button"` badges that toggle
|
|
40
|
+
* on click + Enter/Space) until the 0.9.0 default-inversion
|
|
41
|
+
* cut. `static` is a deprecated opt-out alias — when set
|
|
42
|
+
* (and [interactive] is absent), rows render as
|
|
43
|
+
* non-interactive badges (no role/tabindex/handlers).
|
|
41
44
|
* on-toggle — hide | opacity. Default hide. Escape hatch per OD-CHART-09.
|
|
42
45
|
* Reported via the `toggle` event detail; chart-ui reads it
|
|
43
46
|
* when wired via [for].
|
|
@@ -58,17 +61,67 @@ export class UIChartLegend extends UIElement {
|
|
|
58
61
|
items: { type: String, default: '', reflect: false },
|
|
59
62
|
shape: { type: String, default: 'dot', reflect: true },
|
|
60
63
|
position: { type: String, default: 'bottom', reflect: true },
|
|
64
|
+
// ADR-0063 (gh#1563) — `static` (opt-out) is DEPRECATED; `interactive`
|
|
65
|
+
// (opt-in) is the canonical positively-named boolean. `static` stays
|
|
66
|
+
// declared (dual-read compat, 0.8.42). Deliberately does NOT flip the
|
|
67
|
+
// default here: `interactive` defaults `true` so a consumer naming
|
|
68
|
+
// NEITHER attribute keeps today's behavior (rows interactive)
|
|
69
|
+
// unchanged — the real default-inversion (interactive defaulting to
|
|
70
|
+
// `false`) is scheduled for 0.9.0 per the ADR's own consumer-scan
|
|
71
|
+
// requirement (every `<chart-legend-ui>` tag needs review first).
|
|
61
72
|
static: { type: Boolean, default: false, reflect: true },
|
|
73
|
+
interactive: { type: Boolean, default: true, reflect: true },
|
|
62
74
|
onToggle: { type: String, default: 'hide', reflect: true, attribute: 'on-toggle' },
|
|
63
75
|
};
|
|
64
76
|
|
|
65
77
|
static template = () => null;
|
|
66
78
|
|
|
79
|
+
// ADR-0063 (gh#1563) one-shot-per-class deprecation warn for [static].
|
|
80
|
+
static #warnedStatic = false;
|
|
81
|
+
|
|
67
82
|
#target = null;
|
|
68
83
|
#targetListener = null;
|
|
69
84
|
#hiddenKeys = new Set();
|
|
70
85
|
|
|
86
|
+
// ADR-0063 (gh#1563) — captured by overriding `connectedCallback()` to run
|
|
87
|
+
// BEFORE calling `super.connectedCallback()`. `interactive` defaults
|
|
88
|
+
// `true` (a reflected Boolean), and UIElement's own connectedCallback
|
|
89
|
+
// pre-sync loop stamps the attribute for any reflected Boolean prop whose
|
|
90
|
+
// value is already `true` and whose attribute is absent (gh#961) — that
|
|
91
|
+
// stamp happens INSIDE `super.connectedCallback()`, so a check made from
|
|
92
|
+
// `connected()` (which UIElement invokes AFTER its pre-sync loop) would
|
|
93
|
+
// see `[interactive]` present even when the author never wrote it.
|
|
94
|
+
// Capturing here, before the super call, reads only the AUTHORED markup —
|
|
95
|
+
// the constructor is too early (elements are constructed attribute-less
|
|
96
|
+
// then have each attribute set individually as the parser processes them;
|
|
97
|
+
// by connectedCallback time every authored attribute has already landed).
|
|
98
|
+
#authoredInteractive = false;
|
|
99
|
+
#authoredStatic = false;
|
|
100
|
+
|
|
101
|
+
connectedCallback() {
|
|
102
|
+
this.#authoredInteractive = this.hasAttribute('interactive');
|
|
103
|
+
this.#authoredStatic = this.hasAttribute('static');
|
|
104
|
+
super.connectedCallback();
|
|
105
|
+
}
|
|
106
|
+
|
|
71
107
|
connected() {
|
|
108
|
+
// ADR-0063 (gh#1563) compat shim — resolve BEFORE the first render/paint
|
|
109
|
+
// so there's no wrong-then-right flash. New-name precedence: [interactive]
|
|
110
|
+
// wins outright when present, regardless of [static]; only fall back to
|
|
111
|
+
// (and mirror) [static] when [interactive] is absent from markup.
|
|
112
|
+
if (!this.#authoredInteractive && this.#authoredStatic) {
|
|
113
|
+
this.interactive = false;
|
|
114
|
+
if (!UIChartLegend.#warnedStatic) {
|
|
115
|
+
UIChartLegend.#warnedStatic = true;
|
|
116
|
+
// eslint-disable-next-line no-console
|
|
117
|
+
console.warn(
|
|
118
|
+
'[AdiaUI] <chart-legend-ui [static]> is deprecated — use ' +
|
|
119
|
+
'[interactive] instead (ADR-0063, gh#1563). Note: [interactive] ' +
|
|
120
|
+
'still defaults to true until the 0.9.0 default-inversion cut. ' +
|
|
121
|
+
'Kept working as-is; no behavior change.',
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
72
125
|
this.setAttribute('role', 'list');
|
|
73
126
|
this.#resolveTarget();
|
|
74
127
|
this.#paint();
|
|
@@ -152,11 +205,11 @@ export class UIChartLegend extends UIElement {
|
|
|
152
205
|
keyboard-operable without a wrapping <button>. */
|
|
153
206
|
const row = document.createElement('badge-ui');
|
|
154
207
|
row.setAttribute('data-row', '');
|
|
155
|
-
row.setAttribute('role', this.
|
|
208
|
+
row.setAttribute('role', this.interactive ? 'button' : 'listitem');
|
|
156
209
|
row.setAttribute('text', label);
|
|
157
210
|
if (key) row.setAttribute('data-key', key);
|
|
158
211
|
if (active) row.setAttribute('data-active', '');
|
|
159
|
-
if (
|
|
212
|
+
if (this.interactive) {
|
|
160
213
|
row.setAttribute('tabindex', '0');
|
|
161
214
|
row.setAttribute('aria-pressed', active ? 'true' : 'false');
|
|
162
215
|
}
|
|
@@ -181,7 +234,7 @@ export class UIChartLegend extends UIElement {
|
|
|
181
234
|
swatch.style.setProperty('--swatch-color', swatchColor);
|
|
182
235
|
row.appendChild(swatch);
|
|
183
236
|
|
|
184
|
-
if (
|
|
237
|
+
if (this.interactive) {
|
|
185
238
|
row.addEventListener('click', (e) => this.#onRowToggle(e, key));
|
|
186
239
|
row.addEventListener('keydown', (e) => {
|
|
187
240
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
@@ -66,8 +66,11 @@
|
|
|
66
66
|
color var(--a-duration-fast) var(--a-easing);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
/*
|
|
70
|
-
|
|
69
|
+
/* Non-interactive rows. ADR-0063 (gh#1563): `:not([interactive])` covers
|
|
70
|
+
both today's opt-out spelling (`[static]` mirrors onto `[interactive]`
|
|
71
|
+
being removed, in chart-legend.class.js's connected()) and the eventual
|
|
72
|
+
0.9.0 default-inversion, in one selector. */
|
|
73
|
+
:scope:not([interactive]) badge-ui[data-row] {
|
|
71
74
|
cursor: default;
|
|
72
75
|
}
|
|
73
76
|
|
|
@@ -28,13 +28,15 @@ export class UIChartLegend extends UIElement {
|
|
|
28
28
|
items: string;
|
|
29
29
|
/** id-ref of a chart-ui / heatmap-ui to mirror series from. */
|
|
30
30
|
for: string;
|
|
31
|
+
/** Canonical opt-in spelling (ADR-0063, gh#1563) replacing `static`'s opt-out polarity. Rows are interactive <button>-role badges by default — this default stays `true` in 0.8.42 (deliberately NOT flipped yet; the 0.9.0 cut inverts it to `false` after a full consumer scan of every `<chart-legend-ui>` tag per the ADR). */
|
|
32
|
+
interactive: boolean;
|
|
31
33
|
/** Series-toggle mode emitted via the `toggle` event. `hide` removes the series from the render; `opacity` fades it. Wired via [for] on chart-ui. */
|
|
32
34
|
onToggle: 'hide' | 'opacity';
|
|
33
35
|
/** Layout hint — drives flex-direction. Actual placement follows DOM order. */
|
|
34
36
|
position: 'top' | 'bottom' | 'left' | 'right';
|
|
35
37
|
/** Swatch shape. Maps to badge-ui's icon for dot/square variants. */
|
|
36
38
|
shape: 'dot' | 'square' | 'line' | 'dashed';
|
|
37
|
-
/** When set, rows are non-interactive <span>s (no click, no toggle). */
|
|
39
|
+
/** DEPRECATED (ADR-0063, gh#1563) — use `interactive` instead. When set (and `interactive` is absent), rows are non-interactive <span>s (no click, no toggle). Kept working as a dual-read compat shim (one-time console.warn when it's the name that resolves). Removed in 0.9.0. */
|
|
38
40
|
static: boolean;
|
|
39
41
|
|
|
40
42
|
addEventListener(type: 'toggle', listener: (ev: ChartLegendToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|