@adia-ai/web-components 0.8.39 → 0.8.41
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 +59 -0
- package/MIGRATION.md +1269 -3
- package/README.md +25 -30
- package/USAGE.md +26 -0
- 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 +24 -2
- package/components/action-list/action-item.yaml +28 -3
- package/components/action-list/action-list.a2ui.json +6 -1
- package/components/action-list/action-list.class.js +52 -11
- package/components/action-list/action-list.css +43 -3
- package/components/action-list/action-list.d.ts +4 -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-artifact/agent-artifact.css +1 -1
- 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.css +2 -2
- 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.css +3 -3
- package/components/agent-trace/agent-trace.yaml +6 -2
- package/components/alert/alert.a2ui.json +1 -0
- package/components/alert/alert.css +2 -2
- 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.css +1 -1
- 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/badge/badge.css +1 -1
- 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.css +6 -5
- 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 +121 -172
- 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 +34 -4
- 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 +13 -8
- package/components/chart/chart.class.js +10 -10
- package/components/chart/chart.css +12 -10
- package/components/chart/chart.d.ts +2 -2
- package/components/chart/chart.yaml +8 -5
- package/components/chart-legend/chart-legend.a2ui.json +1 -0
- 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.css +1 -1
- 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/code/code.css +6 -6
- package/components/col/col.a2ui.json +1 -0
- package/components/color-input/color-input.a2ui.json +1 -0
- package/components/color-picker/color-picker.a2ui.json +1 -0
- package/components/combobox/combobox.a2ui.json +3 -2
- package/components/combobox/combobox.css +2 -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.css +3 -3
- 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.css +1 -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 +1 -0
- package/components/description-list/description-list.css +2 -2
- package/components/display-field/display-field.a2ui.json +1 -0
- package/components/display-field/display-field.css +3 -3
- package/components/divider/divider.a2ui.json +1 -0
- package/components/divider/divider.css +1 -1
- package/components/drawer/drawer.a2ui.json +1 -3
- package/components/drawer/drawer.css +3 -3
- 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 +8 -8
- 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/empty-state/empty-state.css +2 -2
- 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 +1 -0
- package/components/field/field.css +1 -1
- package/components/field/field.examples.md +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 +6 -6
- 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/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.css +1 -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 +19 -18
- 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.css +4 -4
- package/components/kbd/kbd.a2ui.json +1 -0
- package/components/kbd/kbd.css +1 -1
- 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 +14 -3
- 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 +3 -1
- package/components/menu/menu-item.yaml +6 -0
- package/components/menu/menu-label.a2ui.json +1 -0
- package/components/menu/menu.a2ui.json +3 -2
- package/components/menu/menu.class.js +2 -2
- package/components/menu/menu.d.ts +2 -2
- 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/nav.css +2 -2
- package/components/nav-group/nav-group.a2ui.json +1 -0
- package/components/nav-group/nav-group.class.js +3 -1
- package/components/nav-group/nav-group.css +3 -3
- package/components/nav-item/nav-item.a2ui.json +1 -0
- package/components/nav-item/nav-item.css +2 -2
- 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/option-card/option-card.css +1 -1
- package/components/otp-input/otp-input.a2ui.json +3 -2
- package/components/otp-input/otp-input.css +1 -1
- package/components/otp-input/otp-input.yaml +9 -2
- package/components/page/page.a2ui.json +13 -0
- package/components/page/page.css +2 -2
- 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/pagination/pagination.css +1 -1
- package/components/pane/pane.a2ui.json +6 -0
- package/components/pane/pane.class.js +3 -3
- package/components/pane/pane.css +3 -3
- package/components/pane/pane.yaml +3 -0
- 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.css +2 -2
- 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 +13 -12
- package/components/qr-code/qr-code.class.js +7 -7
- package/components/qr-code/qr-code.css +1 -1
- package/components/qr-code/qr-code.d.ts +10 -7
- package/components/qr-code/qr-code.yaml +18 -12
- 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 +3 -3
- package/components/range/range.yaml +3 -0
- package/components/rating/rating.a2ui.json +1 -0
- package/components/rating/rating.css +1 -1
- package/components/relative-time/relative-time.a2ui.json +1 -0
- package/components/richtext/richtext.a2ui.json +2 -1
- package/components/richtext/richtext.css +3 -3
- 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 +20 -4
- 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 +18 -16
- 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/spinner/spinner.css +1 -1
- package/components/stack/stack.a2ui.json +1 -0
- package/components/stat/stat.a2ui.json +1 -0
- package/components/stat/stat.css +3 -3
- package/components/stat/stat.js +2 -2
- package/components/step-progress/step-progress.a2ui.json +1 -0
- package/components/step-progress/step-progress.css +1 -1
- 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.css +2 -2
- 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.css +2 -2
- 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 -10
- package/components/table/table.class.js +18 -16
- package/components/table/table.css +17 -18
- package/components/table/table.d.ts +0 -2
- package/components/table/table.yaml +0 -9
- package/components/table-toolbar/table-toolbar.a2ui.json +1 -0
- package/components/table-toolbar/table-toolbar.class.js +38 -19
- package/components/table-toolbar/table-toolbar.css +2 -2
- 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 +9 -1
- 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/tag/tag.css +2 -2
- 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 +11 -7
- 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.css +1 -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/time-picker/time-picker.css +1 -1
- 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.css +4 -4
- 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/toc/toc.css +1 -1
- package/components/toggle-group/toggle-group.a2ui.json +7 -3
- package/components/toggle-group/toggle-group.class.js +43 -12
- package/components/toggle-group/toggle-group.css +7 -4
- package/components/toggle-group/toggle-group.d.ts +3 -4
- package/components/toggle-group/toggle-group.yaml +22 -16
- package/components/toggle-group/toggle-option.a2ui.json +8 -4
- package/components/toggle-group/toggle-option.yaml +15 -13
- 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/tooltip/tooltip.css +1 -1
- 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.css +2 -2
- 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.css +1 -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/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 +442 -502
- 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 +91 -104
- package/dist/web-components.sheet.js +1 -1
- package/package.json +4 -2
- package/patterns/conversion-funnel/conversion-funnel.examples.html +15 -15
- 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/type/scale.css +6 -7
- 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
|
@@ -21,8 +21,11 @@
|
|
|
21
21
|
* sortable — enable column sorting on header click
|
|
22
22
|
* selectable — enable row selection via checkboxes
|
|
23
23
|
* striped — alternate row background
|
|
24
|
-
* density — 'compact' | 'standard' | 'comfortable'
|
|
25
24
|
* valign — 'center' (default) | 'top' — body-cell vertical alignment (gh#505)
|
|
25
|
+
*
|
|
26
|
+
* table-ui has no local `density` prop (ADR-0054) — it converges onto the
|
|
27
|
+
* ambient global [density="compact"|"spacious"] attribute; --table-py/-px
|
|
28
|
+
* already derive from --a-space-* steps, which --a-density scales.
|
|
26
29
|
* paginate — rows per page (0 = no pagination)
|
|
27
30
|
* loading — show loading overlay
|
|
28
31
|
* search — global search filter string
|
|
@@ -53,6 +56,7 @@
|
|
|
53
56
|
|
|
54
57
|
import { UIElement } from '../../core/element.js';
|
|
55
58
|
import { cellTypes, sortFns } from './cell-types.js';
|
|
59
|
+
import { isNode } from '../../core/dom.js';
|
|
56
60
|
|
|
57
61
|
// ── Helpers ──────────────────────────────────────────────────────────────────
|
|
58
62
|
|
|
@@ -118,7 +122,6 @@ export class UITable extends UIElement {
|
|
|
118
122
|
frameless: { type: Boolean, default: false, reflect: true },
|
|
119
123
|
wrap: { type: Boolean, default: false, reflect: true },
|
|
120
124
|
raw: { type: Boolean, default: false, reflect: true },
|
|
121
|
-
density: { type: String, default: 'standard', reflect: true },
|
|
122
125
|
paginate: { type: Number, default: 0, reflect: true },
|
|
123
126
|
loading: { type: Boolean, default: false, reflect: true },
|
|
124
127
|
search: { type: String, default: '', reflect: true },
|
|
@@ -294,7 +297,6 @@ export class UITable extends UIElement {
|
|
|
294
297
|
columnWidths: Object.fromEntries(this.#columnWidths),
|
|
295
298
|
hiddenColumns: this.#columns.filter(c => c.hidden).map(c => c.key),
|
|
296
299
|
page: this.#page,
|
|
297
|
-
density: this.density,
|
|
298
300
|
};
|
|
299
301
|
}
|
|
300
302
|
|
|
@@ -319,7 +321,6 @@ export class UITable extends UIElement {
|
|
|
319
321
|
}
|
|
320
322
|
}
|
|
321
323
|
if (state.page != null) this.#page = state.page;
|
|
322
|
-
if (state.density) this.density = state.density;
|
|
323
324
|
this.#requestRender();
|
|
324
325
|
}
|
|
325
326
|
|
|
@@ -683,7 +684,7 @@ export class UITable extends UIElement {
|
|
|
683
684
|
detail.dataset.for = idx;
|
|
684
685
|
if (this.expandRenderer) {
|
|
685
686
|
const content = this.expandRenderer(this.#data[idx], idx);
|
|
686
|
-
if (content
|
|
687
|
+
if (isNode(content)) detail.appendChild(content);
|
|
687
688
|
else detail.textContent = String(content);
|
|
688
689
|
}
|
|
689
690
|
}
|
|
@@ -784,7 +785,7 @@ export class UITable extends UIElement {
|
|
|
784
785
|
// Resize handle
|
|
785
786
|
if (col.resizable !== false) {
|
|
786
787
|
const handle = document.createElement('div');
|
|
787
|
-
handle.setAttribute('data-resize-handle', '');
|
|
788
|
+
handle.setAttribute('data-column-resize-handle', '');
|
|
788
789
|
handle.dataset.resizeKey = col.key;
|
|
789
790
|
cell.appendChild(handle);
|
|
790
791
|
}
|
|
@@ -835,10 +836,8 @@ export class UITable extends UIElement {
|
|
|
835
836
|
row.dataset.index = dataIndex;
|
|
836
837
|
|
|
837
838
|
if (isSelected) {
|
|
838
|
-
row.setAttribute('data-selected', '');
|
|
839
839
|
row.setAttribute('aria-selected', 'true');
|
|
840
840
|
} else {
|
|
841
|
-
row.removeAttribute('data-selected');
|
|
842
841
|
row.removeAttribute('aria-selected');
|
|
843
842
|
}
|
|
844
843
|
|
|
@@ -887,7 +886,7 @@ export class UITable extends UIElement {
|
|
|
887
886
|
// Render priority: column.render > column.format > cellType.render > text
|
|
888
887
|
if (typeof col.render === 'function') {
|
|
889
888
|
const result = col.render(value, data, cell, dataIndex);
|
|
890
|
-
if (result
|
|
889
|
+
if (isNode(result)) {
|
|
891
890
|
cell.replaceChildren(result);
|
|
892
891
|
} else if (typeof result === 'string') {
|
|
893
892
|
cell.innerHTML = result;
|
|
@@ -982,7 +981,7 @@ export class UITable extends UIElement {
|
|
|
982
981
|
const widths = ['60%', '80%', '70%', '50%', '90%'];
|
|
983
982
|
sk.setAttribute('width', widths[c % widths.length]);
|
|
984
983
|
sk.setAttribute('height', '1em');
|
|
985
|
-
sk.setAttribute('radius', 'sm');
|
|
984
|
+
sk.setAttribute('corner-radius', 'sm');
|
|
986
985
|
cell.appendChild(sk);
|
|
987
986
|
row.appendChild(cell);
|
|
988
987
|
}
|
|
@@ -1270,7 +1269,7 @@ export class UITable extends UIElement {
|
|
|
1270
1269
|
* pointer events cover mouse + touch + pen in one handler. */
|
|
1271
1270
|
#onPointerdown = (e) => {
|
|
1272
1271
|
if (e.button !== undefined && e.button !== 0) return; // primary button only
|
|
1273
|
-
const handle = e.target.closest('[data-resize-handle]');
|
|
1272
|
+
const handle = e.target.closest('[data-column-resize-handle]');
|
|
1274
1273
|
if (handle && this.contains(handle)) {
|
|
1275
1274
|
e.preventDefault();
|
|
1276
1275
|
this.#startResize(e, handle);
|
|
@@ -1308,7 +1307,7 @@ export class UITable extends UIElement {
|
|
|
1308
1307
|
}
|
|
1309
1308
|
|
|
1310
1309
|
// ── Resize handle mousedown is handled separately ──
|
|
1311
|
-
const resizeHandle = target.closest('[data-resize-handle]');
|
|
1310
|
+
const resizeHandle = target.closest('[data-column-resize-handle]');
|
|
1312
1311
|
if (resizeHandle && this.contains(resizeHandle)) {
|
|
1313
1312
|
this.#startResize(e, resizeHandle);
|
|
1314
1313
|
return;
|
|
@@ -1450,9 +1449,12 @@ export class UITable extends UIElement {
|
|
|
1450
1449
|
const startWidth = headerCell ? headerCell.getBoundingClientRect().width : 100;
|
|
1451
1450
|
const startX = e.clientX;
|
|
1452
1451
|
|
|
1453
|
-
|
|
1452
|
+
// Stamped on the HANDLE itself, not the table host — table.css's
|
|
1453
|
+
// `[data-column-resize-handle][data-resizing]` rule requires both
|
|
1454
|
+
// attributes on the same element (matching :hover's per-handle scope).
|
|
1455
|
+
handle.setAttribute('data-resizing', '');
|
|
1454
1456
|
|
|
1455
|
-
this.#resizeState = { key, col, startX, startWidth };
|
|
1457
|
+
this.#resizeState = { key, col, startX, startWidth, handle };
|
|
1456
1458
|
|
|
1457
1459
|
document.addEventListener('pointermove', this.#onResizeMove);
|
|
1458
1460
|
document.addEventListener('pointerup', this.#onResizeEnd);
|
|
@@ -1475,12 +1477,12 @@ export class UITable extends UIElement {
|
|
|
1475
1477
|
|
|
1476
1478
|
#onResizeEnd = (e) => {
|
|
1477
1479
|
if (!this.#resizeState) return;
|
|
1478
|
-
const { key } = this.#resizeState;
|
|
1480
|
+
const { key, handle } = this.#resizeState;
|
|
1479
1481
|
|
|
1480
1482
|
document.removeEventListener('pointermove', this.#onResizeMove);
|
|
1481
1483
|
document.removeEventListener('pointerup', this.#onResizeEnd);
|
|
1482
1484
|
|
|
1483
|
-
|
|
1485
|
+
handle.removeAttribute('data-resizing');
|
|
1484
1486
|
|
|
1485
1487
|
const width = this.#columnWidths.get(key);
|
|
1486
1488
|
this.#resizeState = null;
|
|
@@ -419,10 +419,12 @@
|
|
|
419
419
|
|
|
420
420
|
/* Selected row — must out-specify the base row rule `[data-body] >
|
|
421
421
|
[role="row"]` (0,2,0) and the hover rule (0,2,1), or the highlight never
|
|
422
|
-
paints. Scoping to `[data-body] > [role="row"][
|
|
423
|
-
(0,4,0). (The striped-even override below handles selected+striped,
|
|
424
|
-
is higher still.)
|
|
425
|
-
|
|
422
|
+
paints. Scoping to `[data-body] > [role="row"][aria-selected="true"]` lifts
|
|
423
|
+
it to (0,4,0). (The striped-even override below handles selected+striped,
|
|
424
|
+
which is higher still.) Keys off `aria-selected` directly — no private
|
|
425
|
+
`[data-selected]` mirror (gh#1332 Category A; matches admin-roster's
|
|
426
|
+
`[aria-checked="true"]` precedent from PR #1438). */
|
|
427
|
+
[data-body] > [role="row"][aria-selected="true"] {
|
|
426
428
|
background: var(--table-row-bg-selected);
|
|
427
429
|
}
|
|
428
430
|
|
|
@@ -446,7 +448,7 @@
|
|
|
446
448
|
/* Selected wins over the stripe — same (0,5,0) specificity as the striped-
|
|
447
449
|
even rule above, placed AFTER it so source order resolves the tie in
|
|
448
450
|
favor of selection (a selected row reads as selected regardless of stripe). */
|
|
449
|
-
:scope[striped] [data-body] > [role="row"][
|
|
451
|
+
:scope[striped] [data-body] > [role="row"][aria-selected="true"] {
|
|
450
452
|
background: var(--table-row-bg-selected);
|
|
451
453
|
}
|
|
452
454
|
|
|
@@ -463,14 +465,11 @@
|
|
|
463
465
|
|
|
464
466
|
/* ═══════ Density ═══════ */
|
|
465
467
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
:scope[density="comfortable"] {
|
|
472
|
-
--table-py: var(--a-space-4);
|
|
473
|
-
}
|
|
468
|
+
/* No local override (ADR-0054 convergence) — --table-py/-px above already
|
|
469
|
+
derive from --a-space-* steps, which the ambient global
|
|
470
|
+
[density="compact"|"spacious"] attribute already scales via
|
|
471
|
+
--a-density. Do not reintroduce a component-local :scope[density=…]
|
|
472
|
+
block; that would re-shadow the global grammar (ADR-0053). */
|
|
474
473
|
|
|
475
474
|
/* ═══════ Pinned cells ═══════ */
|
|
476
475
|
|
|
@@ -494,7 +493,7 @@
|
|
|
494
493
|
|
|
495
494
|
/* ═══════ Resize handle ═══════ */
|
|
496
495
|
|
|
497
|
-
[data-resize-handle] {
|
|
496
|
+
[data-column-resize-handle] {
|
|
498
497
|
position: absolute;
|
|
499
498
|
right: calc(-1 * var(--table-resize-width) / 2);
|
|
500
499
|
top: 0;
|
|
@@ -511,13 +510,13 @@
|
|
|
511
510
|
table's right edge (handle centered on the column boundary; the last
|
|
512
511
|
column has no neighbor to resize against) and triggered a 2 px scrollbar
|
|
513
512
|
overhang on every table even with nothing to scroll. */
|
|
514
|
-
[role="row"] > [role="columnheader"]:last-child [data-resize-handle] {
|
|
513
|
+
[role="row"] > [role="columnheader"]:last-child [data-column-resize-handle] {
|
|
515
514
|
display: none;
|
|
516
515
|
z-index: 1;
|
|
517
516
|
}
|
|
518
517
|
|
|
519
|
-
[data-resize-handle]:hover,
|
|
520
|
-
[data-resize-handle][data-resizing] {
|
|
518
|
+
[data-column-resize-handle]:hover,
|
|
519
|
+
[data-column-resize-handle][data-resizing] {
|
|
521
520
|
background: var(--table-accent);
|
|
522
521
|
}
|
|
523
522
|
|
|
@@ -744,7 +743,7 @@
|
|
|
744
743
|
grid-template-columns: subgrid;
|
|
745
744
|
grid-column: 1 / -1;
|
|
746
745
|
border-top: 2px solid var(--table-agg-border);
|
|
747
|
-
font-weight:
|
|
746
|
+
font-weight: var(--a-weight-semibold);
|
|
748
747
|
font-size: var(--table-agg-size);
|
|
749
748
|
color: var(--table-fg-secondary);
|
|
750
749
|
}
|
|
@@ -90,8 +90,6 @@ export class UITable extends UIElement {
|
|
|
90
90
|
columns: string;
|
|
91
91
|
/** JS property (set programmatically — `el.data = [...]`) — row records, an array of plain objects keyed to columns[].key. May also be supplied declaratively as a JSON-array `data="[…]"` attribute, hydrated once at connect (gh#288) — the same pattern chart-ui's `data` attribute uses. Custom accessor on the element class, not a reflected attribute. */
|
|
92
92
|
data: string;
|
|
93
|
-
/** Controls cell padding and row height. 'compact' for dense data, 'standard' for default spacing, 'comfortable' for spacious rows. */
|
|
94
|
-
density: 'compact' | 'standard' | 'comfortable';
|
|
95
93
|
/** Enable row expansion */
|
|
96
94
|
expandable: boolean;
|
|
97
95
|
/** Drop the table's outer 1px perimeter and nothing else (gh#511) — row dividers are untouched (the perimeter is split onto its own --table-perimeter token, defaulting to --table-border). For card-composed tables: the card owns the frame, so the table's square perimeter otherwise renders a doubled edge (flush bleed) or a stray inner box (with content above). Standalone tables keep their chrome by default. Theming path without the attribute: set --table-perimeter to transparent per instance. Note: `<card-ui><section bleed>` already drops a direct-child table-ui's chrome automatically (card.css, gh#796) — `frameless`/`raw` on the instance still applies and is honored, but is no longer required just to avoid the doubled-edge look in that composition. */
|
|
@@ -36,15 +36,6 @@ props:
|
|
|
36
36
|
type: object
|
|
37
37
|
default: []
|
|
38
38
|
dynamic: true # JS-set collection prop with a custom setter — deliberately not in static properties
|
|
39
|
-
density:
|
|
40
|
-
description: Controls cell padding and row height. 'compact' for dense data, 'standard' for default
|
|
41
|
-
spacing, 'comfortable' for spacious rows.
|
|
42
|
-
type: string
|
|
43
|
-
default: standard
|
|
44
|
-
enum:
|
|
45
|
-
- compact
|
|
46
|
-
- standard
|
|
47
|
-
- comfortable
|
|
48
39
|
expandable:
|
|
49
40
|
description: Enable row expansion
|
|
50
41
|
type: boolean
|
|
@@ -270,7 +270,7 @@ export class UITableToolbar extends UIElement {
|
|
|
270
270
|
title.appendChild(heading);
|
|
271
271
|
|
|
272
272
|
const badge = document.createElement('badge-ui');
|
|
273
|
-
badge.setAttribute('data-count-badge', '');
|
|
273
|
+
badge.setAttribute('data-toolbar-count-badge', '');
|
|
274
274
|
badge.setAttribute('size', 'sm');
|
|
275
275
|
badge.setAttribute('tone', 'muted');
|
|
276
276
|
badge.hidden = true;
|
|
@@ -343,26 +343,45 @@ export class UITableToolbar extends UIElement {
|
|
|
343
343
|
|
|
344
344
|
#updateTitle() {
|
|
345
345
|
const heading = this.querySelector(':scope [data-heading]');
|
|
346
|
-
if (
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
346
|
+
if (heading) {
|
|
347
|
+
if (this.text) {
|
|
348
|
+
heading.textContent = this.text;
|
|
349
|
+
heading.hidden = false;
|
|
350
|
+
} else if (heading.textContent.trim()) {
|
|
351
|
+
heading.hidden = false;
|
|
352
|
+
} else {
|
|
353
|
+
heading.hidden = true;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
const badge = this.querySelector(':scope [data-toolbar-count-badge]');
|
|
358
|
+
if (badge) {
|
|
359
|
+
const explicit = this.count?.toString().trim();
|
|
360
|
+
const fallback = this.#target?.data?.length;
|
|
361
|
+
const value = explicit || (Number.isFinite(fallback) ? String(fallback) : '');
|
|
362
|
+
if (value) {
|
|
363
|
+
badge.setAttribute('text', value);
|
|
364
|
+
badge.hidden = false;
|
|
365
|
+
} else {
|
|
366
|
+
badge.hidden = true;
|
|
367
|
+
}
|
|
354
368
|
}
|
|
355
369
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
370
|
+
// The CLUSTER hides with its children, not just them (ADIA2-8897):
|
|
371
|
+
// `[data-title]` is `flex: 0 0 auto` in the toolbar row, so an
|
|
372
|
+
// empty-but-present cluster still consumes one `--table-toolbar-gap`
|
|
373
|
+
// (`--a-space-3`, 12px at d=1) and pushes `[data-controls]` off the leading
|
|
374
|
+
// edge of the table it labels — the whole visible toolbar on the
|
|
375
|
+
// columns-only shape. Derived from the children's own hidden state so a
|
|
376
|
+
// third child of the cluster stays covered; matched down the stamped path
|
|
377
|
+
// because `#stamp` MOVES `[slot="actions"]` children into the same subtree
|
|
378
|
+
// and a consumer's own `data-title` must not be mistaken for the cluster.
|
|
379
|
+
// Both branches above are guarded, not early-returning, so a missing part
|
|
380
|
+
// can't strand the wrapper mid-state. `children` is array-LIKE (not
|
|
381
|
+
// guaranteed iterable) under the SSR shims, hence `Array.from`.
|
|
382
|
+
const title = this.querySelector(':scope > [data-toolbar] > [data-title]');
|
|
383
|
+
if (title) {
|
|
384
|
+
title.hidden = Array.from(title.children).every((child) => child.hidden);
|
|
366
385
|
}
|
|
367
386
|
}
|
|
368
387
|
|
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
font-size: var(--table-toolbar-title-size);
|
|
83
83
|
font-weight: var(--table-toolbar-title-weight);
|
|
84
84
|
color: var(--table-toolbar-title-fg);
|
|
85
|
-
line-height:
|
|
85
|
+
line-height: var(--a-font-leading-snug);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
[data-count-badge][hidden] { display: none; }
|
|
88
|
+
[data-toolbar-count-badge][hidden] { display: none; }
|
|
89
89
|
|
|
90
90
|
/* ═══════ Controls cluster ═══════ */
|
|
91
91
|
|
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
"description": "Optional leading icon name (Phosphor) for the tab button.",
|
|
26
26
|
"type": "string"
|
|
27
27
|
},
|
|
28
|
+
"selected": {
|
|
29
|
+
"description": "Whether this tab's panel is the active one. Managed by the parent <tabs-ui> container — don't set directly; the parent's [value] is the single source of truth (ADR-0056).",
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"default": false
|
|
32
|
+
},
|
|
28
33
|
"text": {
|
|
29
34
|
"description": "Tab button label (rendered by parent <tabs-ui>).",
|
|
30
35
|
"type": "string"
|
|
@@ -39,6 +44,9 @@
|
|
|
39
44
|
],
|
|
40
45
|
"unevaluatedProperties": false,
|
|
41
46
|
"x-adiaui": {
|
|
47
|
+
"allowedParents": [
|
|
48
|
+
"Tabs"
|
|
49
|
+
],
|
|
42
50
|
"anti_patterns": [],
|
|
43
51
|
"category": "navigation",
|
|
44
52
|
"composes": [],
|
|
@@ -51,6 +59,7 @@
|
|
|
51
59
|
"tabs-child"
|
|
52
60
|
],
|
|
53
61
|
"name": "UITab",
|
|
62
|
+
"parts": {},
|
|
54
63
|
"related": [
|
|
55
64
|
"Tabs",
|
|
56
65
|
"Nav",
|
package/components/tabs/tab.js
CHANGED
|
@@ -16,6 +16,10 @@ class UITab extends UIElement {
|
|
|
16
16
|
value: { type: String, default: '', reflect: true },
|
|
17
17
|
icon: { type: String, default: '', reflect: true },
|
|
18
18
|
disabled: { type: Boolean, default: false, reflect: true },
|
|
19
|
+
// ADR-0056 (gh#1303, #1363 B7): declared reflected selection-item state,
|
|
20
|
+
// parent-managed — <tabs-ui> stamps this instead of a private data-*
|
|
21
|
+
// hook. Mirrors <segment-ui>'s [selected].
|
|
22
|
+
selected: { type: Boolean, default: false, reflect: true },
|
|
19
23
|
};
|
|
20
24
|
|
|
21
25
|
static template = () => null;
|
package/components/tabs/tab.yaml
CHANGED
|
@@ -32,8 +32,18 @@ props:
|
|
|
32
32
|
description: Whether the tab is selectable.
|
|
33
33
|
type: boolean
|
|
34
34
|
default: false
|
|
35
|
+
selected:
|
|
36
|
+
description: >-
|
|
37
|
+
Whether this tab's panel is the active one. Managed by the parent
|
|
38
|
+
<tabs-ui> container — don't set directly; the parent's [value] is
|
|
39
|
+
the single source of truth (ADR-0056).
|
|
40
|
+
type: boolean
|
|
41
|
+
default: false
|
|
42
|
+
reflect: true
|
|
35
43
|
|
|
36
44
|
a2ui:
|
|
45
|
+
allowedParents:
|
|
46
|
+
- Tabs
|
|
37
47
|
rules:
|
|
38
48
|
- >-
|
|
39
49
|
<tab-ui> only renders inside <tabs-ui>. Never use it standalone.
|
|
@@ -57,6 +67,11 @@ a2ui:
|
|
|
57
67
|
non-selectable. Do not pair <tab-ui> with <button-ui> wrappers —
|
|
58
68
|
the strip button is parent-rendered. Do not nest <tab-ui> inside
|
|
59
69
|
another <tab-ui>.
|
|
70
|
+
- >-
|
|
71
|
+
[selected] reflects whether this tab's panel is active — it is
|
|
72
|
+
parent-managed (ADR-0056's selection-item convention, mirroring
|
|
73
|
+
<segment-ui>); author markup drives the parent's [value], never
|
|
74
|
+
[selected] directly.
|
|
60
75
|
|
|
61
76
|
keywords:
|
|
62
77
|
- tab
|
|
@@ -42,8 +42,11 @@
|
|
|
42
42
|
],
|
|
43
43
|
"unevaluatedProperties": false,
|
|
44
44
|
"x-adiaui": {
|
|
45
|
+
"allowedChildren": [
|
|
46
|
+
"Tab"
|
|
47
|
+
],
|
|
45
48
|
"anti_patterns": [],
|
|
46
|
-
"category": "
|
|
49
|
+
"category": "navigation",
|
|
47
50
|
"composes": [
|
|
48
51
|
"icon-ui"
|
|
49
52
|
],
|
|
@@ -73,15 +76,17 @@
|
|
|
73
76
|
"tab"
|
|
74
77
|
],
|
|
75
78
|
"name": "UITabs",
|
|
79
|
+
"parts": {
|
|
80
|
+
"indicator": {
|
|
81
|
+
"description": "Auto-created sliding indicator element (line variant only) — template-owned anatomy part, not a light-DOM insertion point (gh#1454). Lazily created once via an internal-field guard (`!this.#indicator`), never adopted from a consumer-authored element."
|
|
82
|
+
}
|
|
83
|
+
},
|
|
76
84
|
"related": [
|
|
77
85
|
"tab"
|
|
78
86
|
],
|
|
79
87
|
"slots": {
|
|
80
88
|
"default": {
|
|
81
89
|
"description": "Child tab-ui elements that form the tab strip"
|
|
82
|
-
},
|
|
83
|
-
"indicator": {
|
|
84
|
-
"description": "Auto-created sliding indicator element (line variant only)"
|
|
85
90
|
}
|
|
86
91
|
},
|
|
87
92
|
"states": [
|
|
@@ -25,6 +25,12 @@
|
|
|
25
25
|
*
|
|
26
26
|
* Keyboard:
|
|
27
27
|
* ArrowLeft / ArrowRight to navigate tabs
|
|
28
|
+
*
|
|
29
|
+
* Selection state: the active <tab-ui>'s [selected] is a declared,
|
|
30
|
+
* reflected prop stamped by this parent — never a private data-* hook
|
|
31
|
+
* (ADR-0056, #1363 B7). The synthesized [slot="tab-button"] strip button
|
|
32
|
+
* (an internal render detail, not a declared primitive) keeps its own
|
|
33
|
+
* [data-active] + aria-selected — ARIA/internal wiring is unchanged.
|
|
28
34
|
*/
|
|
29
35
|
|
|
30
36
|
import { UIElement, html } from '../../core/element.js';
|
|
@@ -143,14 +149,20 @@ export class UITabs extends UIElement {
|
|
|
143
149
|
// Update sliding indicator
|
|
144
150
|
this.#updateIndicator();
|
|
145
151
|
|
|
146
|
-
// Sync tab content visibility
|
|
152
|
+
// Sync tab content visibility. [selected] is the declared, reflected
|
|
153
|
+
// API surface (ADR-0056, #1363 B7) — parent-managed, mirrors
|
|
154
|
+
// <segment-ui>. [hidden] stays the actual visibility driver (native
|
|
155
|
+
// a11y semantics independent of CSS) and is kept in lockstep with
|
|
156
|
+
// [selected] rather than replaced by it.
|
|
147
157
|
for (const tab of tabs) {
|
|
148
158
|
const tabVal = tab.value || tab.getAttribute('value') || '';
|
|
149
159
|
const isActive = tabVal === this.value;
|
|
150
160
|
if (isActive) {
|
|
161
|
+
tab.setAttribute('selected', '');
|
|
151
162
|
tab.removeAttribute('hidden');
|
|
152
163
|
tab.setAttribute('role', 'tabpanel');
|
|
153
164
|
} else {
|
|
165
|
+
tab.removeAttribute('selected');
|
|
154
166
|
tab.setAttribute('hidden', '');
|
|
155
167
|
}
|
|
156
168
|
}
|
package/components/tabs/tabs.css
CHANGED
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
/* font-family floor — see segment.css rationale. */
|
|
139
139
|
font-family: var(--tabs-font-family);
|
|
140
140
|
font-size: var(--tabs-font-size);
|
|
141
|
-
line-height:
|
|
141
|
+
line-height: var(--a-font-leading-none);
|
|
142
142
|
cursor: pointer;
|
|
143
143
|
user-select: none;
|
|
144
144
|
white-space: nowrap;
|
|
@@ -172,8 +172,16 @@
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
/* ── Tab panels ── */
|
|
175
|
+
/* [selected] (ADR-0056, #1363 B7) is the declared state hook driving
|
|
176
|
+
visibility; [hidden] stays set in lockstep as the native a11y/no-CSS
|
|
177
|
+
fallback (tabs.class.js) — both selectors key off the same state, so
|
|
178
|
+
they never disagree. */
|
|
175
179
|
tab-ui {
|
|
176
180
|
box-sizing: border-box;
|
|
181
|
+
display: none;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
tab-ui[selected] {
|
|
177
185
|
display: block;
|
|
178
186
|
}
|
|
179
187
|
|
|
@@ -40,6 +40,8 @@ export class UITab extends UIElement {
|
|
|
40
40
|
disabled: boolean;
|
|
41
41
|
/** Optional leading icon name (Phosphor) for the tab button. */
|
|
42
42
|
icon: string;
|
|
43
|
+
/** Whether this tab's panel is the active one. Managed by the parent <tabs-ui> container — don't set directly; the parent's [value] is the single source of truth (ADR-0056). */
|
|
44
|
+
selected: boolean;
|
|
43
45
|
/** Tab button label (rendered by parent <tabs-ui>). */
|
|
44
46
|
text: string;
|
|
45
47
|
/** Stable id for the tab. Parent uses this to coordinate active state. */
|
|
@@ -5,7 +5,7 @@ name: UITabs
|
|
|
5
5
|
tag: tabs-ui
|
|
6
6
|
status: stable
|
|
7
7
|
component: Tabs
|
|
8
|
-
category:
|
|
8
|
+
category: navigation
|
|
9
9
|
version: 1
|
|
10
10
|
description: >-
|
|
11
11
|
Tabbed panel switcher. Renders a button strip from child <tab-ui>
|
|
@@ -43,8 +43,13 @@ events:
|
|
|
43
43
|
slots:
|
|
44
44
|
default:
|
|
45
45
|
description: Child tab-ui elements that form the tab strip
|
|
46
|
+
parts:
|
|
46
47
|
indicator:
|
|
47
|
-
description:
|
|
48
|
+
description: >-
|
|
49
|
+
Auto-created sliding indicator element (line variant only) —
|
|
50
|
+
template-owned anatomy part, not a light-DOM insertion point
|
|
51
|
+
(gh#1454). Lazily created once via an internal-field guard
|
|
52
|
+
(`!this.#indicator`), never adopted from a consumer-authored element.
|
|
48
53
|
states:
|
|
49
54
|
- name: idle
|
|
50
55
|
description: Default, ready for interaction.
|
|
@@ -83,6 +88,8 @@ tokens:
|
|
|
83
88
|
--tabs-radius:
|
|
84
89
|
description: Override base border radius
|
|
85
90
|
a2ui:
|
|
91
|
+
allowedChildren:
|
|
92
|
+
- Tab
|
|
86
93
|
rules:
|
|
87
94
|
- >-
|
|
88
95
|
Decision rule: use <tabs-ui> when switching VIEWS within the same
|
package/components/tag/tag.css
CHANGED
|
@@ -154,8 +154,8 @@ tag-ui[removable]:not([disabled]):hover {
|
|
|
154
154
|
/* font-family floor — see segment.css rationale. */
|
|
155
155
|
font-family: var(--tag-font-family);
|
|
156
156
|
font-size: var(--tag-font);
|
|
157
|
-
font-weight:
|
|
158
|
-
line-height:
|
|
157
|
+
font-weight: var(--a-weight-medium);
|
|
158
|
+
line-height: var(--a-font-leading-none);
|
|
159
159
|
color: var(--tag-fg);
|
|
160
160
|
background: var(--tag-bg);
|
|
161
161
|
white-space: nowrap;
|