@adia-ai/web-components 0.0.28 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -8
- package/a2ui/index.js +1 -1
- package/components/accordion/accordion.a2ui.json +1 -1
- package/components/accordion/accordion.js +6 -6
- package/components/accordion/accordion.yaml +1 -1
- package/components/action-list/action-list.a2ui.json +1 -1
- package/components/action-list/action-list.js +6 -6
- package/components/action-list/action-list.yaml +1 -1
- package/components/agent-artifact/agent-artifact.a2ui.json +1 -1
- package/components/agent-artifact/agent-artifact.js +4 -4
- package/components/agent-artifact/agent-artifact.yaml +1 -1
- package/components/agent-feedback-bar/agent-feedback-bar.a2ui.json +1 -1
- package/components/agent-feedback-bar/agent-feedback-bar.js +4 -4
- package/components/agent-feedback-bar/agent-feedback-bar.yaml +1 -1
- package/components/agent-questions/agent-questions.a2ui.json +1 -1
- package/components/agent-questions/agent-questions.js +4 -4
- package/components/agent-questions/agent-questions.yaml +1 -1
- package/components/agent-reasoning/agent-reasoning.a2ui.json +3 -3
- package/components/agent-reasoning/agent-reasoning.js +4 -4
- package/components/agent-reasoning/agent-reasoning.yaml +3 -3
- package/components/agent-suggestions/agent-suggestions.a2ui.json +1 -1
- package/components/agent-suggestions/agent-suggestions.js +4 -4
- package/components/agent-suggestions/agent-suggestions.yaml +1 -1
- package/components/agent-trace/agent-trace.a2ui.json +1 -1
- package/components/agent-trace/agent-trace.js +4 -4
- package/components/agent-trace/agent-trace.yaml +1 -1
- package/components/alert/alert.a2ui.json +1 -1
- package/components/alert/alert.js +4 -4
- package/components/alert/alert.yaml +1 -1
- package/components/aside/aside.a2ui.json +1 -1
- package/components/aside/aside.yaml +1 -1
- package/components/avatar/avatar.a2ui.json +1 -1
- package/components/avatar/avatar.js +8 -8
- package/components/avatar/avatar.yaml +1 -1
- package/components/badge/badge.a2ui.json +1 -1
- package/components/badge/badge.js +4 -4
- package/components/badge/badge.yaml +1 -1
- package/components/block/block.a2ui.json +1 -1
- package/components/block/block.js +4 -4
- package/components/block/block.yaml +1 -1
- package/components/breadcrumb/breadcrumb.a2ui.json +1 -1
- package/components/breadcrumb/breadcrumb.js +4 -4
- package/components/breadcrumb/breadcrumb.yaml +1 -1
- package/components/button/button.a2ui.json +1 -1
- package/components/button/button.js +4 -4
- package/components/button/button.yaml +1 -1
- package/components/calendar-picker/calendar-picker.a2ui.json +1 -1
- package/components/calendar-picker/calendar-picker.js +6 -6
- package/components/calendar-picker/calendar-picker.yaml +1 -1
- package/components/canvas/canvas.a2ui.json +1 -1
- package/components/canvas/canvas.js +5 -5
- package/components/canvas/canvas.yaml +1 -1
- package/components/card/card.a2ui.json +1 -1
- package/components/card/card.js +4 -4
- package/components/card/card.yaml +1 -1
- package/components/chart/chart.a2ui.json +1 -1
- package/components/chart/chart.js +5 -5
- package/components/chart/chart.yaml +1 -1
- package/components/chart-legend/chart-legend.a2ui.json +1 -1
- package/components/chart-legend/chart-legend.js +7 -7
- package/components/chart-legend/chart-legend.yaml +1 -1
- package/components/{chat → chat-thread}/chat-input.js +5 -5
- package/components/{chat/chat.a2ui.json → chat-thread/chat-thread.a2ui.json} +6 -6
- package/components/{chat/chat.css → chat-thread/chat-thread.css} +2 -2
- package/components/{chat/chat.js → chat-thread/chat-thread.js} +7 -7
- package/components/{chat/chat.yaml → chat-thread/chat-thread.yaml} +4 -4
- package/components/check/check.a2ui.json +1 -1
- package/components/check/check.js +5 -5
- package/components/check/check.yaml +1 -1
- package/components/code/code.a2ui.json +1 -1
- package/components/code/code.js +4 -4
- package/components/code/code.yaml +1 -1
- package/components/col/col.a2ui.json +1 -1
- package/components/col/col.js +4 -4
- package/components/col/col.yaml +1 -1
- package/components/color-picker/color-picker.a2ui.json +1 -1
- package/components/color-picker/color-picker.js +6 -6
- package/components/color-picker/color-picker.yaml +1 -1
- package/components/command/command.a2ui.json +1 -1
- package/components/command/command.js +5 -5
- package/components/command/command.yaml +1 -1
- package/components/description-list/description-list.a2ui.json +1 -1
- package/components/description-list/description-list.js +4 -4
- package/components/description-list/description-list.yaml +1 -1
- package/components/divider/divider.a2ui.json +1 -1
- package/components/divider/divider.js +4 -4
- package/components/divider/divider.yaml +1 -1
- package/components/drawer/drawer.a2ui.json +1 -1
- package/components/drawer/drawer.js +4 -4
- package/components/drawer/drawer.yaml +1 -1
- package/components/embed/embed.a2ui.json +1 -1
- package/components/embed/embed.js +4 -4
- package/components/embed/embed.yaml +1 -1
- package/components/empty-state/empty-state.a2ui.json +1 -1
- package/components/empty-state/empty-state.js +4 -4
- package/components/empty-state/empty-state.yaml +1 -1
- package/components/feed/feed-item.yaml +2 -2
- package/components/feed/feed.a2ui.json +2 -2
- package/components/feed/feed.css +21 -3
- package/components/feed/feed.js +140 -31
- package/components/feed/feed.yaml +2 -2
- package/components/field/field.a2ui.json +1 -1
- package/components/field/field.js +10 -10
- package/components/field/field.yaml +2 -2
- package/components/footer/footer.a2ui.json +1 -1
- package/components/footer/footer.yaml +1 -1
- package/components/grid/grid.a2ui.json +1 -1
- package/components/grid/grid.js +4 -4
- package/components/grid/grid.yaml +1 -1
- package/components/header/header.a2ui.json +1 -1
- package/components/header/header.yaml +1 -1
- package/components/heatmap/heatmap.a2ui.json +1 -1
- package/components/heatmap/heatmap.js +4 -4
- package/components/heatmap/heatmap.yaml +1 -1
- package/components/icon/icon.a2ui.json +1 -1
- package/components/icon/icon.js +4 -4
- package/components/icon/icon.yaml +1 -1
- package/components/image/image.a2ui.json +1 -1
- package/components/image/image.js +4 -4
- package/components/image/image.yaml +1 -1
- package/components/index.js +88 -85
- package/components/input/input.a2ui.json +1 -1
- package/components/input/input.js +7 -7
- package/components/input/input.yaml +1 -1
- package/components/inspector/inspector.a2ui.json +1 -1
- package/components/inspector/inspector.js +4 -4
- package/components/inspector/inspector.yaml +1 -1
- package/components/kbd/kbd.a2ui.json +1 -1
- package/components/kbd/kbd.js +4 -4
- package/components/kbd/kbd.yaml +1 -1
- package/components/list/list.a2ui.json +1 -1
- package/components/list/list.js +6 -6
- package/components/list/list.yaml +1 -1
- package/components/menu/menu.a2ui.json +1 -1
- package/components/menu/menu.js +8 -8
- package/components/menu/menu.yaml +1 -1
- package/components/modal/modal.a2ui.json +1 -1
- package/components/modal/modal.js +4 -4
- package/components/modal/modal.yaml +1 -1
- package/components/nav/nav.a2ui.json +98 -0
- package/components/nav/nav.css +133 -0
- package/components/nav/nav.js +140 -0
- package/components/nav/nav.test.js +428 -0
- package/components/nav/nav.yaml +114 -0
- package/components/nav-group/nav-group.a2ui.json +100 -0
- package/{patterns/app-nav-group/app-nav-group.css → components/nav-group/nav-group.css} +71 -18
- package/{patterns/app-nav-group/app-nav-group.js → components/nav-group/nav-group.js} +51 -25
- package/components/nav-group/nav-group.yaml +69 -0
- package/components/nav-item/nav-item.a2ui.json +106 -0
- package/{patterns/app-nav-item/app-nav-item.css → components/nav-item/nav-item.css} +42 -10
- package/components/nav-item/nav-item.js +76 -0
- package/components/nav-item/nav-item.yaml +73 -0
- package/components/noodles/noodles.a2ui.json +1 -1
- package/components/noodles/noodles.js +4 -4
- package/components/noodles/noodles.yaml +1 -1
- package/components/option-card/option-card.a2ui.json +1 -1
- package/components/option-card/option-card.js +6 -6
- package/components/option-card/option-card.yaml +1 -1
- package/components/otp-input/otp-input.a2ui.json +1 -1
- package/components/otp-input/otp-input.js +5 -5
- package/components/otp-input/otp-input.yaml +1 -1
- package/components/page/page.a2ui.json +3 -3
- package/components/page/page.js +4 -4
- package/components/page/page.yaml +3 -3
- package/components/pagination/pagination.a2ui.json +1 -1
- package/components/pagination/pagination.js +4 -4
- package/components/pagination/pagination.yaml +1 -1
- package/components/pane/pane.a2ui.json +1 -1
- package/components/pane/pane.js +4 -4
- package/components/pane/pane.yaml +1 -1
- package/components/pipeline-status/pipeline-status.a2ui.json +1 -1
- package/components/pipeline-status/pipeline-status.js +4 -4
- package/components/pipeline-status/pipeline-status.yaml +1 -1
- package/components/popover/popover.a2ui.json +1 -1
- package/components/popover/popover.js +4 -4
- package/components/popover/popover.yaml +1 -1
- package/components/progress/progress.a2ui.json +1 -1
- package/components/progress/progress.js +4 -4
- package/components/progress/progress.yaml +1 -1
- package/components/progress-row/progress-row.a2ui.json +1 -1
- package/components/progress-row/progress-row.js +4 -4
- package/components/progress-row/progress-row.yaml +1 -1
- package/components/radio/radio.a2ui.json +1 -1
- package/components/radio/radio.js +5 -5
- package/components/radio/radio.yaml +1 -1
- package/components/range/range.a2ui.json +1 -1
- package/components/range/range.js +7 -7
- package/components/range/range.yaml +1 -1
- package/components/rating/rating.a2ui.json +1 -1
- package/components/rating/rating.js +6 -6
- package/components/rating/rating.yaml +1 -1
- package/components/richtext/richtext.a2ui.json +1 -1
- package/components/richtext/richtext.js +4 -4
- package/components/richtext/richtext.yaml +1 -1
- package/components/row/row.a2ui.json +1 -1
- package/components/row/row.js +4 -4
- package/components/row/row.yaml +1 -1
- package/components/search/search.a2ui.json +1 -1
- package/components/search/search.js +5 -5
- package/components/search/search.yaml +1 -1
- package/components/section/section.a2ui.json +1 -1
- package/components/section/section.yaml +1 -1
- package/components/segment/segment.a2ui.json +1 -1
- package/components/segment/segment.js +4 -4
- package/components/segment/segment.yaml +1 -1
- package/components/segmented/segmented.a2ui.json +1 -1
- package/components/segmented/segmented.css +6 -0
- package/components/segmented/segmented.js +7 -7
- package/components/segmented/segmented.yaml +1 -1
- package/components/select/select.a2ui.json +1 -1
- package/components/select/select.js +5 -5
- package/components/select/select.yaml +1 -1
- package/components/skeleton/skeleton.a2ui.json +1 -1
- package/components/skeleton/skeleton.js +4 -4
- package/components/skeleton/skeleton.yaml +1 -1
- package/components/slider/slider.a2ui.json +1 -1
- package/components/slider/slider.js +7 -7
- package/components/slider/slider.yaml +1 -1
- package/components/stack/stack.a2ui.json +1 -1
- package/components/stack/stack.js +4 -4
- package/components/stack/stack.yaml +1 -1
- package/components/stat/stat.a2ui.json +1 -1
- package/components/stat/stat.js +4 -4
- package/components/stat/stat.yaml +1 -1
- package/components/stepper/stepper.a2ui.json +1 -1
- package/components/stepper/stepper.js +6 -6
- package/components/stepper/stepper.yaml +1 -1
- package/components/stream/stream.a2ui.json +1 -1
- package/components/stream/stream.js +4 -4
- package/components/stream/stream.yaml +1 -1
- package/components/swatch/swatch.a2ui.json +1 -1
- package/components/swatch/swatch.js +4 -4
- package/components/swatch/swatch.yaml +1 -1
- package/components/swiper/swiper.a2ui.json +1 -1
- package/components/swiper/swiper.js +4 -4
- package/components/swiper/swiper.yaml +1 -1
- package/components/switch/switch.a2ui.json +1 -1
- package/components/switch/switch.js +5 -5
- package/components/switch/switch.yaml +1 -1
- package/components/table/table.a2ui.json +1 -1
- package/components/table/table.js +4 -4
- package/components/table/table.yaml +1 -1
- package/components/table-toolbar/table-toolbar.a2ui.json +1 -1
- package/components/table-toolbar/table-toolbar.js +4 -4
- package/components/table-toolbar/table-toolbar.yaml +1 -1
- package/components/tabs/tab.js +4 -4
- package/components/tabs/tabs.a2ui.json +1 -1
- package/components/tabs/tabs.js +5 -5
- package/components/tabs/tabs.yaml +1 -1
- package/components/tag/tag.a2ui.json +1 -1
- package/components/tag/tag.js +4 -4
- package/components/tag/tag.yaml +1 -1
- package/components/text/text.a2ui.json +1 -1
- package/components/text/text.js +4 -4
- package/components/text/text.yaml +1 -1
- package/components/textarea/textarea.a2ui.json +1 -1
- package/components/textarea/textarea.js +5 -5
- package/components/textarea/textarea.yaml +1 -1
- package/components/timeline/timeline.a2ui.json +1 -1
- package/components/timeline/timeline.js +6 -6
- package/components/timeline/timeline.yaml +1 -1
- package/components/toast/toast.a2ui.json +1 -1
- package/components/toast/toast.js +54 -184
- package/components/toast/toast.yaml +1 -1
- package/components/toggle-group/toggle-group.a2ui.json +1 -1
- package/components/toggle-group/toggle-group.js +6 -6
- package/components/toggle-group/toggle-group.yaml +1 -1
- package/components/toolbar/toolbar.a2ui.json +1 -1
- package/components/toolbar/toolbar.js +6 -6
- package/components/toolbar/toolbar.yaml +1 -1
- package/components/tooltip/tooltip.a2ui.json +1 -1
- package/components/tooltip/tooltip.js +7 -7
- package/components/tooltip/tooltip.yaml +1 -1
- package/components/tree/tree.a2ui.json +1 -1
- package/components/tree/tree.js +6 -6
- package/components/tree/tree.yaml +1 -1
- package/components/upload/upload.a2ui.json +1 -1
- package/components/upload/upload.js +6 -6
- package/components/upload/upload.yaml +1 -1
- package/core/element.js +4 -4
- package/core/element.test.js +18 -18
- package/core/form.js +9 -9
- package/core/index.js +2 -2
- package/core/provider.js +7 -7
- package/core/template.js +1 -1
- package/index.css +3 -2
- package/index.js +17 -7
- package/package.json +1 -5
- package/styles/components.css +10 -6
- package/styles/resets.css +1 -1
- package/traits/define.js +2 -2
- package/patterns/a2ui-root/a2ui-root.a2ui.json +0 -125
- package/patterns/a2ui-root/a2ui-root.js +0 -191
- package/patterns/a2ui-root/a2ui-root.yaml +0 -87
- package/patterns/adia-chat/adia-chat.a2ui.json +0 -149
- package/patterns/adia-chat/adia-chat.css +0 -10
- package/patterns/adia-chat/adia-chat.js +0 -297
- package/patterns/adia-chat/adia-chat.yaml +0 -118
- package/patterns/adia-chat/css/adia-chat.empty.css +0 -12
- package/patterns/adia-chat/css/adia-chat.layout.css +0 -60
- package/patterns/adia-chat/css/adia-chat.markdown.css +0 -74
- package/patterns/adia-chat/css/adia-chat.messages.css +0 -87
- package/patterns/adia-chat/css/adia-chat.streaming.css +0 -30
- package/patterns/adia-chat/css/adia-chat.tokens.css +0 -95
- package/patterns/adia-editor/adia-editor.a2ui.json +0 -73
- package/patterns/adia-editor/adia-editor.css +0 -6
- package/patterns/adia-editor/adia-editor.js +0 -56
- package/patterns/adia-editor/adia-editor.yaml +0 -59
- package/patterns/adia-editor/css/adia-editor.layout.css +0 -171
- package/patterns/adia-editor/css/adia-editor.tokens.css +0 -28
- package/patterns/app-nav/app-nav.a2ui.json +0 -89
- package/patterns/app-nav/app-nav.css +0 -92
- package/patterns/app-nav/app-nav.js +0 -112
- package/patterns/app-nav/app-nav.yaml +0 -54
- package/patterns/app-nav-group/app-nav-group.a2ui.json +0 -82
- package/patterns/app-nav-group/app-nav-group.yaml +0 -59
- package/patterns/app-nav-item/app-nav-item.a2ui.json +0 -83
- package/patterns/app-nav-item/app-nav-item.js +0 -42
- package/patterns/app-nav-item/app-nav-item.yaml +0 -62
- package/patterns/app-shell/app-shell.a2ui.json +0 -129
- package/patterns/app-shell/app-shell.css +0 -14
- package/patterns/app-shell/app-shell.js +0 -251
- package/patterns/app-shell/app-shell.yaml +0 -89
- package/patterns/app-shell/css/app-shell.collapsed.css +0 -86
- package/patterns/app-shell/css/app-shell.helpers.css +0 -42
- package/patterns/app-shell/css/app-shell.main.css +0 -172
- package/patterns/app-shell/css/app-shell.shell.css +0 -44
- package/patterns/app-shell/css/app-shell.sidebar.css +0 -161
- package/patterns/app-shell/css/app-shell.templates.css +0 -214
- package/patterns/app-shell/css/app-shell.tokens.css +0 -119
- package/patterns/gen-ui/gen-ui.a2ui.json +0 -72
- package/patterns/gen-ui/gen-ui.css +0 -83
- package/patterns/gen-ui/gen-ui.js +0 -136
- package/patterns/gen-ui/gen-ui.yaml +0 -43
- package/patterns/index.js +0 -11
- package/patterns/section-nav/section-nav.a2ui.json +0 -91
- package/patterns/section-nav/section-nav.css +0 -60
- package/patterns/section-nav/section-nav.js +0 -42
- package/patterns/section-nav/section-nav.yaml +0 -58
- package/patterns/section-nav-group/section-nav-group.a2ui.json +0 -95
- package/patterns/section-nav-group/section-nav-group.css +0 -74
- package/patterns/section-nav-group/section-nav-group.js +0 -84
- package/patterns/section-nav-group/section-nav-group.yaml +0 -66
- package/patterns/section-nav-item/section-nav-item.a2ui.json +0 -97
- package/patterns/section-nav-item/section-nav-item.css +0 -106
- package/patterns/section-nav-item/section-nav-item.js +0 -66
- package/patterns/section-nav-item/section-nav-item.yaml +0 -70
- package/styles/layouts/admin.css +0 -7
- /package/components/{chat → chat-thread}/chat-input.css +0 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
2
|
+
name: UINav
|
|
3
|
+
tag: nav-ui
|
|
4
|
+
component: Nav
|
|
5
|
+
category: layout
|
|
6
|
+
version: 1
|
|
7
|
+
description: |
|
|
8
|
+
Navigation rail. Consolidates the prior `app-nav-ui` + `section-nav-ui`
|
|
9
|
+
pair per ADR-0015 § Nav consolidation. [variant] drives visual
|
|
10
|
+
treatment; behavior is unified.
|
|
11
|
+
|
|
12
|
+
Default variant ("primary") is the app-sidebar nav: ResizeObserver
|
|
13
|
+
collapses to icon-only below 96px, groups open a popover when
|
|
14
|
+
collapsed. [variant="section"] is a subnav rail with quieter chrome
|
|
15
|
+
and a [heading] kicker rendered via CSS.
|
|
16
|
+
|
|
17
|
+
props:
|
|
18
|
+
variant:
|
|
19
|
+
type: string
|
|
20
|
+
default: primary
|
|
21
|
+
enum: [primary, section]
|
|
22
|
+
description: "Visual treatment. primary = app sidebar; section = subnav rail."
|
|
23
|
+
collapsed:
|
|
24
|
+
type: boolean
|
|
25
|
+
default: false
|
|
26
|
+
description: "Primary-variant only. Force icon-only collapse regardless of viewport width."
|
|
27
|
+
divider:
|
|
28
|
+
type: boolean
|
|
29
|
+
default: false
|
|
30
|
+
description: "Auto-place dividers between adjacent groups + items."
|
|
31
|
+
heading:
|
|
32
|
+
type: string
|
|
33
|
+
default: ''
|
|
34
|
+
description: "Optional kicker label. Section variant renders it via ::before; primary uses it as aria-label only."
|
|
35
|
+
|
|
36
|
+
events:
|
|
37
|
+
nav-select:
|
|
38
|
+
description: "Bubbles from <nav-item-ui> children when one is selected. Detail: { item, text, value }."
|
|
39
|
+
|
|
40
|
+
slots:
|
|
41
|
+
default:
|
|
42
|
+
description: "Primary slot — accepts <nav-group-ui> + <nav-item-ui> children, plus <hr data-nav-divider> for hand-placed dividers."
|
|
43
|
+
|
|
44
|
+
states:
|
|
45
|
+
- name: idle
|
|
46
|
+
description: Default, not collapsed.
|
|
47
|
+
- name: collapsed
|
|
48
|
+
description: Primary variant when [collapsed] or container width <= 96px.
|
|
49
|
+
|
|
50
|
+
traits: []
|
|
51
|
+
tokens: {}
|
|
52
|
+
a2ui:
|
|
53
|
+
rules: []
|
|
54
|
+
anti_patterns: []
|
|
55
|
+
|
|
56
|
+
examples:
|
|
57
|
+
- name: primary
|
|
58
|
+
description: App sidebar nav with groups + items.
|
|
59
|
+
a2ui: >-
|
|
60
|
+
[
|
|
61
|
+
{
|
|
62
|
+
"id": "root",
|
|
63
|
+
"component": "Nav",
|
|
64
|
+
"children": ["g1", "i1"]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "g1",
|
|
68
|
+
"component": "NavGroup",
|
|
69
|
+
"text": "Settings",
|
|
70
|
+
"icon": "gear",
|
|
71
|
+
"children": ["g1i1"]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "g1i1",
|
|
75
|
+
"component": "NavItem",
|
|
76
|
+
"text": "General",
|
|
77
|
+
"value": "/settings/general"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "i1",
|
|
81
|
+
"component": "NavItem",
|
|
82
|
+
"text": "Profile",
|
|
83
|
+
"icon": "user",
|
|
84
|
+
"value": "/profile"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
- name: section
|
|
88
|
+
description: Subnav rail with heading.
|
|
89
|
+
a2ui: >-
|
|
90
|
+
[
|
|
91
|
+
{
|
|
92
|
+
"id": "root",
|
|
93
|
+
"component": "Nav",
|
|
94
|
+
"variant": "section",
|
|
95
|
+
"heading": "On this page",
|
|
96
|
+
"children": ["i1", "i2"]
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"id": "i1",
|
|
100
|
+
"component": "NavItem",
|
|
101
|
+
"text": "Overview",
|
|
102
|
+
"value": "#overview"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "i2",
|
|
106
|
+
"component": "NavItem",
|
|
107
|
+
"text": "API",
|
|
108
|
+
"value": "#api"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
|
|
112
|
+
keywords: [nav, navigation, sidebar, menu, links]
|
|
113
|
+
synonyms: {}
|
|
114
|
+
related: []
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/NavGroup.json",
|
|
4
|
+
"title": "NavGroup",
|
|
5
|
+
"description": "Collapsible labeled group of <nav-item-ui> children inside <nav-ui>.\nConsolidates the prior `app-nav-group-ui` + `section-nav-group-ui`\nper ADR-0015 § Nav consolidation.\n\nWhen the parent <nav-ui> is collapsed (primary variant), clicking the\ngroup opens a popover with its children instead of toggling inline\nexpansion. Inline click + keyboard (Enter/Space) toggle is supported\nwhen [collapsible] (default true).\n",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"badge": {
|
|
17
|
+
"description": "Optional trailing badge (count, label).",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"default": ""
|
|
20
|
+
},
|
|
21
|
+
"collapsible": {
|
|
22
|
+
"description": "When true, the header row toggles the open state on click/keyboard.",
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"default": true
|
|
25
|
+
},
|
|
26
|
+
"component": {
|
|
27
|
+
"const": "NavGroup"
|
|
28
|
+
},
|
|
29
|
+
"icon": {
|
|
30
|
+
"description": "Optional leading icon name (resolved via <icon-ui>).",
|
|
31
|
+
"type": "string",
|
|
32
|
+
"default": ""
|
|
33
|
+
},
|
|
34
|
+
"open": {
|
|
35
|
+
"description": "Inline-expanded state. Toggled by header click when [collapsible].",
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"default": false
|
|
38
|
+
},
|
|
39
|
+
"text": {
|
|
40
|
+
"description": "Visible group label.",
|
|
41
|
+
"type": "string",
|
|
42
|
+
"default": ""
|
|
43
|
+
},
|
|
44
|
+
"variant": {
|
|
45
|
+
"description": "Visual treatment. Default ('') renders as a primary-rail group (icon row, caret, collapsible). 'section' renders the header as a static kicker label with always-visible children — matches the prior <section-nav-group-ui>. When the parent <nav-ui> carries variant=\"section\", this group inherits it via CSS cascade unless an explicit variant is set on the group.",
|
|
46
|
+
"type": "string",
|
|
47
|
+
"enum": [
|
|
48
|
+
"",
|
|
49
|
+
"section"
|
|
50
|
+
],
|
|
51
|
+
"default": ""
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"required": [
|
|
55
|
+
"component"
|
|
56
|
+
],
|
|
57
|
+
"unevaluatedProperties": false,
|
|
58
|
+
"x-adiaui": {
|
|
59
|
+
"anti_patterns": [],
|
|
60
|
+
"category": "layout",
|
|
61
|
+
"events": {
|
|
62
|
+
"group-toggle": {
|
|
63
|
+
"description": "Fired when the header toggles via click/keyboard. Detail: { text, open }."
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"examples": [],
|
|
67
|
+
"keywords": [
|
|
68
|
+
"nav",
|
|
69
|
+
"navigation",
|
|
70
|
+
"group",
|
|
71
|
+
"sidebar",
|
|
72
|
+
"menu"
|
|
73
|
+
],
|
|
74
|
+
"name": "UINavGroup",
|
|
75
|
+
"related": [],
|
|
76
|
+
"slots": {
|
|
77
|
+
"default": {
|
|
78
|
+
"description": "Children — typically <nav-item-ui> rows."
|
|
79
|
+
},
|
|
80
|
+
"header": {
|
|
81
|
+
"description": "Optional custom header. Auto-generated when missing."
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"states": [
|
|
85
|
+
{
|
|
86
|
+
"description": "Default. Children hidden.",
|
|
87
|
+
"name": "closed"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"description": "Children visible inline.",
|
|
91
|
+
"name": "open"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"synonyms": {},
|
|
95
|
+
"tag": "nav-group-ui",
|
|
96
|
+
"tokens": {},
|
|
97
|
+
"traits": [],
|
|
98
|
+
"version": 1
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@scope (
|
|
1
|
+
@scope (nav-group-ui) {
|
|
2
2
|
:where(:scope) {
|
|
3
3
|
--nav-group-row-height: var(--a-size);
|
|
4
4
|
--nav-group-row-height-sm: var(--a-size-sm);
|
|
@@ -133,33 +133,33 @@
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
/* Children — hidden when collapsed */
|
|
136
|
-
:scope:not([open]) >
|
|
136
|
+
:scope:not([open]) > nav-item-ui {
|
|
137
137
|
display: none;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
/* Child items default to sm for visual hierarchy */
|
|
141
|
-
:scope >
|
|
141
|
+
:scope > nav-item-ui:not([size]) {
|
|
142
142
|
height: var(--nav-item-child-height);
|
|
143
143
|
font-size: var(--nav-item-child-font);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
/* ── Collapsed nav: hide text, badge, caret ── */
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
nav-ui[collapsed] & [slot="text"],
|
|
148
|
+
nav-ui[collapsed] & [slot="badge"],
|
|
149
|
+
nav-ui[collapsed] & [slot="caret"] {
|
|
150
150
|
display: none;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
nav-ui[collapsed] & [slot="header"] {
|
|
154
154
|
justify-content: center;
|
|
155
155
|
padding: 0;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
nav-ui[collapsed] & {
|
|
159
159
|
align-self: stretch;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
nav-ui[collapsed] &::after {
|
|
163
163
|
display: none;
|
|
164
164
|
}
|
|
165
165
|
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
[slot="text"], [slot="badge"], [slot="caret"] {
|
|
168
168
|
display: none !important;
|
|
169
169
|
}
|
|
170
|
-
|
|
170
|
+
nav-item-ui {
|
|
171
171
|
display: none !important;
|
|
172
172
|
}
|
|
173
173
|
[slot="header"] {
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
Popovers are promoted to the top layer and cannot inherit
|
|
205
205
|
pattern-level custom properties, so raw --a-* tokens are
|
|
206
206
|
used intentionally here. */
|
|
207
|
-
|
|
207
|
+
nav-group-ui [slot="popover"] {
|
|
208
208
|
margin: 0;
|
|
209
209
|
padding: var(--a-space-1);
|
|
210
210
|
border: 1px solid var(--a-border-subtle);
|
|
@@ -217,7 +217,7 @@ app-nav-group-ui [slot="popover"] {
|
|
|
217
217
|
font-size: var(--a-ui-size);
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
|
|
220
|
+
nav-group-ui [slot="popover-label"] {
|
|
221
221
|
padding: var(--a-space-1) var(--a-space-2);
|
|
222
222
|
font-weight: var(--a-weight-medium);
|
|
223
223
|
color: var(--a-fg-muted);
|
|
@@ -226,7 +226,7 @@ app-nav-group-ui [slot="popover-label"] {
|
|
|
226
226
|
letter-spacing: 0.06em;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
nav-group-ui [slot="popover"] [role="option"] {
|
|
230
230
|
padding: var(--a-space-1) var(--a-space-2);
|
|
231
231
|
border-radius: var(--a-radius);
|
|
232
232
|
color: var(--a-fg-subtle);
|
|
@@ -237,23 +237,23 @@ app-nav-group-ui [slot="popover"] [role="option"] {
|
|
|
237
237
|
color var(--a-duration-fast) var(--a-easing);
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
|
|
240
|
+
nav-group-ui [slot="popover"] [role="option"]:hover {
|
|
241
241
|
background: var(--a-bg-hover);
|
|
242
242
|
color: var(--a-fg-strong);
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
/* Selected / current option — mirrors the main rail's nav-item selection:
|
|
246
246
|
muted fill + leading 2px accent bar. */
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
nav-group-ui [slot="popover"] [role="option"][aria-current="page"],
|
|
248
|
+
nav-group-ui [slot="popover"] [role="option"][aria-selected="true"] {
|
|
249
249
|
position: relative;
|
|
250
250
|
background: var(--a-bg-hover);
|
|
251
251
|
color: var(--a-fg-strong);
|
|
252
252
|
font-weight: var(--a-weight-medium);
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
nav-group-ui [slot="popover"] [role="option"][aria-current="page"]::before,
|
|
256
|
+
nav-group-ui [slot="popover"] [role="option"][aria-selected="true"]::before {
|
|
257
257
|
content: '';
|
|
258
258
|
position: absolute;
|
|
259
259
|
inset-inline-start: calc(var(--a-space-2) * -0.5);
|
|
@@ -262,3 +262,56 @@ app-nav-group-ui [slot="popover"] [role="option"][aria-selected="true"]::before
|
|
|
262
262
|
border-radius: 1px;
|
|
263
263
|
background: var(--a-accent);
|
|
264
264
|
}
|
|
265
|
+
|
|
266
|
+
/* ── Section variant — groups render as kicker labels ──
|
|
267
|
+
The prior <section-nav-group-ui> defaulted to collapsible:false
|
|
268
|
+
(header was a label, children always visible). The consolidated
|
|
269
|
+
nav-group-ui defaults collapsible:true (the primary-variant default).
|
|
270
|
+
Section variant restores the old kicker rendering so subnav rails
|
|
271
|
+
show all children without an explicit [open] toggle.
|
|
272
|
+
|
|
273
|
+
Two ways to enable: either
|
|
274
|
+
(a) `<nav-group-ui variant="section">` directly, or
|
|
275
|
+
(b) `<nav-ui variant="section"> > nav-group-ui` (cascade from parent).
|
|
276
|
+
Both selectors apply the same kicker styles. */
|
|
277
|
+
|
|
278
|
+
nav-group-ui[variant="section"] > [slot="header"],
|
|
279
|
+
nav-ui[variant="section"] > nav-group-ui:not([variant]) > [slot="header"] {
|
|
280
|
+
height: auto;
|
|
281
|
+
padding: var(--a-space-3) var(--a-space-2) var(--a-space-1);
|
|
282
|
+
font-size: var(--a-kicker-sm, var(--a-ui-tiny));
|
|
283
|
+
font-weight: var(--a-weight-medium);
|
|
284
|
+
color: var(--a-fg-muted);
|
|
285
|
+
text-transform: uppercase;
|
|
286
|
+
letter-spacing: 0.06em;
|
|
287
|
+
cursor: default;
|
|
288
|
+
border-radius: 0;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
nav-group-ui[variant="section"] > [slot="header"]:hover,
|
|
292
|
+
nav-group-ui[variant="section"] > [slot="header"]:focus-visible,
|
|
293
|
+
nav-ui[variant="section"] > nav-group-ui:not([variant]) > [slot="header"]:hover,
|
|
294
|
+
nav-ui[variant="section"] > nav-group-ui:not([variant]) > [slot="header"]:focus-visible {
|
|
295
|
+
background: transparent;
|
|
296
|
+
color: var(--a-fg-muted);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
nav-group-ui[variant="section"] > [slot="header"] [slot="caret"],
|
|
300
|
+
nav-group-ui[variant="section"] > [slot="header"] [slot="icon"]:empty,
|
|
301
|
+
nav-ui[variant="section"] > nav-group-ui:not([variant]) > [slot="header"] [slot="caret"],
|
|
302
|
+
nav-ui[variant="section"] > nav-group-ui:not([variant]) > [slot="header"] [slot="icon"]:empty {
|
|
303
|
+
display: none;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/* Children always visible in section variant (override the
|
|
307
|
+
:scope:not([open]) > nav-item-ui hide rule from inside @scope). */
|
|
308
|
+
nav-group-ui[variant="section"]:not([open]) > nav-item-ui,
|
|
309
|
+
nav-ui[variant="section"] > nav-group-ui:not([variant]):not([open]) > nav-item-ui {
|
|
310
|
+
display: flex;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/* No indent rail in section variant — kicker layout doesn't carry it. */
|
|
314
|
+
nav-group-ui[variant="section"]::after,
|
|
315
|
+
nav-ui[variant="section"] > nav-group-ui:not([variant])::after {
|
|
316
|
+
display: none;
|
|
317
|
+
}
|
|
@@ -1,42 +1,67 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* <
|
|
2
|
+
* <nav-group-ui> — Collapsible labeled group of nav items inside <nav-ui>.
|
|
3
|
+
*
|
|
4
|
+
* Consolidates the prior `app-nav-group-ui` + `section-nav-group-ui`
|
|
5
|
+
* per ADR-0015 § Nav consolidation. Behavior is unified; the parent
|
|
6
|
+
* <nav-ui>'s [variant] drives the visual treatment.
|
|
3
7
|
*
|
|
4
8
|
* Has icon, label, optional badge, and a caret indicating open/closed.
|
|
5
|
-
* When the parent
|
|
6
|
-
* popover with its children instead of toggling inline
|
|
9
|
+
* When the parent <nav-ui> is collapsed (primary variant), clicking the
|
|
10
|
+
* group opens a popover with its children instead of toggling inline
|
|
11
|
+
* expansion. When [collapsible] (or always for primary variant), inline
|
|
12
|
+
* click + keyboard toggle is supported.
|
|
7
13
|
*/
|
|
8
14
|
|
|
9
|
-
import {
|
|
15
|
+
import { UIElement } from '../../core/element.js';
|
|
10
16
|
import { anchorPopover } from '../../core/anchor.js';
|
|
11
17
|
|
|
12
|
-
class
|
|
18
|
+
class UINavGroup extends UIElement {
|
|
13
19
|
static properties = {
|
|
14
|
-
text:
|
|
15
|
-
icon:
|
|
16
|
-
badge:
|
|
17
|
-
open:
|
|
20
|
+
text: { type: String, default: '', reflect: true },
|
|
21
|
+
icon: { type: String, default: '', reflect: true },
|
|
22
|
+
badge: { type: String, default: '', reflect: true },
|
|
23
|
+
open: { type: Boolean, default: false, reflect: true },
|
|
24
|
+
collapsible: { type: Boolean, default: true, reflect: true },
|
|
25
|
+
variant: { type: String, default: '', reflect: true },
|
|
18
26
|
};
|
|
19
27
|
|
|
20
28
|
static template = () => null;
|
|
21
29
|
|
|
22
30
|
#popover = null;
|
|
23
31
|
#anchorCleanup = null;
|
|
32
|
+
#headerEl = null;
|
|
33
|
+
|
|
34
|
+
#onHeaderKey = (e) => {
|
|
35
|
+
if (!this.collapsible) return;
|
|
36
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
this.open = !this.open;
|
|
39
|
+
this.dispatchEvent(new CustomEvent('group-toggle', {
|
|
40
|
+
bubbles: true,
|
|
41
|
+
detail: { text: this.text, open: this.open },
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
24
45
|
|
|
25
46
|
connected() {
|
|
26
47
|
this.setAttribute('role', 'group');
|
|
27
48
|
|
|
28
49
|
if (!this.querySelector(':scope > [slot="header"]')) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
50
|
+
this.#headerEl = document.createElement('div');
|
|
51
|
+
this.#headerEl.setAttribute('slot', 'header');
|
|
52
|
+
this.#headerEl.setAttribute('tabindex', '0');
|
|
53
|
+
this.#headerEl.innerHTML = `
|
|
33
54
|
<span slot="icon">${this.icon ? `<icon-ui name="${this.icon}"></icon-ui>` : ''}</span>
|
|
34
55
|
<span slot="text">${this.text}</span>
|
|
35
56
|
${this.badge ? `<span slot="badge">${this.badge}</span>` : ''}
|
|
36
57
|
<icon-ui slot="caret" name="caret-right"></icon-ui>
|
|
37
58
|
`;
|
|
38
|
-
this.prepend(
|
|
59
|
+
this.prepend(this.#headerEl);
|
|
60
|
+
} else {
|
|
61
|
+
this.#headerEl = this.querySelector(':scope > [slot="header"]');
|
|
39
62
|
}
|
|
63
|
+
|
|
64
|
+
this.#headerEl?.addEventListener('keydown', this.#onHeaderKey);
|
|
40
65
|
}
|
|
41
66
|
|
|
42
67
|
render() {
|
|
@@ -60,17 +85,17 @@ class AdiaAppNavGroup extends AdiaElement {
|
|
|
60
85
|
label.textContent = this.text;
|
|
61
86
|
this.#popover.appendChild(label);
|
|
62
87
|
|
|
63
|
-
for (const child of this.querySelectorAll(':scope >
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const nav = this.closest('
|
|
88
|
+
for (const child of this.querySelectorAll(':scope > nav-item-ui')) {
|
|
89
|
+
const opt = document.createElement('div');
|
|
90
|
+
opt.setAttribute('role', 'option');
|
|
91
|
+
opt.dataset.sourceValue = child.getAttribute('value') || '';
|
|
92
|
+
opt.textContent = child.text;
|
|
93
|
+
opt.addEventListener('click', () => {
|
|
94
|
+
const nav = this.closest('nav-ui');
|
|
70
95
|
if (nav) nav.select(child);
|
|
71
96
|
this.#popover.hidePopover();
|
|
72
97
|
});
|
|
73
|
-
this.#popover.appendChild(
|
|
98
|
+
this.#popover.appendChild(opt);
|
|
74
99
|
}
|
|
75
100
|
|
|
76
101
|
this.appendChild(this.#popover);
|
|
@@ -86,7 +111,7 @@ class AdiaAppNavGroup extends AdiaElement {
|
|
|
86
111
|
for (const opt of this.#popover.querySelectorAll('[role="option"]')) {
|
|
87
112
|
const srcValue = opt.dataset.sourceValue;
|
|
88
113
|
const src = srcValue
|
|
89
|
-
? this.querySelector(`:scope >
|
|
114
|
+
? this.querySelector(`:scope > nav-item-ui[value="${srcValue}"]`)
|
|
90
115
|
: null;
|
|
91
116
|
if (src?.hasAttribute('selected')) {
|
|
92
117
|
opt.setAttribute('aria-current', 'page');
|
|
@@ -106,11 +131,12 @@ class AdiaAppNavGroup extends AdiaElement {
|
|
|
106
131
|
}
|
|
107
132
|
|
|
108
133
|
disconnected() {
|
|
134
|
+
this.#headerEl?.removeEventListener('keydown', this.#onHeaderKey);
|
|
109
135
|
this.#anchorCleanup?.();
|
|
110
136
|
this.#anchorCleanup = null;
|
|
111
137
|
this.#popover?.hidePopover?.();
|
|
112
138
|
}
|
|
113
139
|
}
|
|
114
|
-
customElements.define('app-nav-group-ui', AdiaAppNavGroup);
|
|
115
140
|
|
|
116
|
-
|
|
141
|
+
customElements.define('nav-group-ui', UINavGroup);
|
|
142
|
+
export { UINavGroup };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
2
|
+
name: UINavGroup
|
|
3
|
+
tag: nav-group-ui
|
|
4
|
+
component: NavGroup
|
|
5
|
+
category: layout
|
|
6
|
+
version: 1
|
|
7
|
+
description: |
|
|
8
|
+
Collapsible labeled group of <nav-item-ui> children inside <nav-ui>.
|
|
9
|
+
Consolidates the prior `app-nav-group-ui` + `section-nav-group-ui`
|
|
10
|
+
per ADR-0015 § Nav consolidation.
|
|
11
|
+
|
|
12
|
+
When the parent <nav-ui> is collapsed (primary variant), clicking the
|
|
13
|
+
group opens a popover with its children instead of toggling inline
|
|
14
|
+
expansion. Inline click + keyboard (Enter/Space) toggle is supported
|
|
15
|
+
when [collapsible] (default true).
|
|
16
|
+
|
|
17
|
+
props:
|
|
18
|
+
text:
|
|
19
|
+
type: string
|
|
20
|
+
default: ''
|
|
21
|
+
description: "Visible group label."
|
|
22
|
+
icon:
|
|
23
|
+
type: string
|
|
24
|
+
default: ''
|
|
25
|
+
description: "Optional leading icon name (resolved via <icon-ui>)."
|
|
26
|
+
badge:
|
|
27
|
+
type: string
|
|
28
|
+
default: ''
|
|
29
|
+
description: "Optional trailing badge (count, label)."
|
|
30
|
+
open:
|
|
31
|
+
type: boolean
|
|
32
|
+
default: false
|
|
33
|
+
description: "Inline-expanded state. Toggled by header click when [collapsible]."
|
|
34
|
+
collapsible:
|
|
35
|
+
type: boolean
|
|
36
|
+
default: true
|
|
37
|
+
description: "When true, the header row toggles the open state on click/keyboard."
|
|
38
|
+
variant:
|
|
39
|
+
type: string
|
|
40
|
+
default: ''
|
|
41
|
+
enum: ['', section]
|
|
42
|
+
description: "Visual treatment. Default ('') renders as a primary-rail group (icon row, caret, collapsible). 'section' renders the header as a static kicker label with always-visible children — matches the prior <section-nav-group-ui>. When the parent <nav-ui> carries variant=\"section\", this group inherits it via CSS cascade unless an explicit variant is set on the group."
|
|
43
|
+
|
|
44
|
+
events:
|
|
45
|
+
group-toggle:
|
|
46
|
+
description: "Fired when the header toggles via click/keyboard. Detail: { text, open }."
|
|
47
|
+
|
|
48
|
+
slots:
|
|
49
|
+
default:
|
|
50
|
+
description: "Children — typically <nav-item-ui> rows."
|
|
51
|
+
header:
|
|
52
|
+
description: "Optional custom header. Auto-generated when missing."
|
|
53
|
+
|
|
54
|
+
states:
|
|
55
|
+
- name: closed
|
|
56
|
+
description: Default. Children hidden.
|
|
57
|
+
- name: open
|
|
58
|
+
description: Children visible inline.
|
|
59
|
+
|
|
60
|
+
traits: []
|
|
61
|
+
tokens: {}
|
|
62
|
+
a2ui:
|
|
63
|
+
rules: []
|
|
64
|
+
anti_patterns: []
|
|
65
|
+
examples: []
|
|
66
|
+
|
|
67
|
+
keywords: [nav, navigation, group, sidebar, menu]
|
|
68
|
+
synonyms: {}
|
|
69
|
+
related: []
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/NavItem.json",
|
|
4
|
+
"title": "NavItem",
|
|
5
|
+
"description": "Single navigation link inside <nav-ui> (optionally nested under\n<nav-group-ui>). Consolidates the prior `app-nav-item-ui` +\n`section-nav-item-ui` per ADR-0015 § Nav consolidation.\n\nSupports icon, label, optional badge, selected/disabled state, and\nkeyboard activation (Enter/Space). Selection is managed by the parent\n<nav-ui>; clicking or activating an item calls nav.select(this) and\nbubbles a `nav-select` event.\n",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"badge": {
|
|
17
|
+
"description": "Optional trailing badge.",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"default": ""
|
|
20
|
+
},
|
|
21
|
+
"component": {
|
|
22
|
+
"const": "NavItem"
|
|
23
|
+
},
|
|
24
|
+
"disabled": {
|
|
25
|
+
"description": "Suppresses click/keyboard activation; greyed visually.",
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"default": false
|
|
28
|
+
},
|
|
29
|
+
"icon": {
|
|
30
|
+
"description": "Optional leading icon name.",
|
|
31
|
+
"type": "string",
|
|
32
|
+
"default": ""
|
|
33
|
+
},
|
|
34
|
+
"selected": {
|
|
35
|
+
"description": "Set by the parent <nav-ui>'s select() method.",
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"default": false
|
|
38
|
+
},
|
|
39
|
+
"text": {
|
|
40
|
+
"description": "Visible item label.",
|
|
41
|
+
"type": "string",
|
|
42
|
+
"default": ""
|
|
43
|
+
},
|
|
44
|
+
"value": {
|
|
45
|
+
"description": "Identifier — typically a route or anchor.",
|
|
46
|
+
"type": "string",
|
|
47
|
+
"default": ""
|
|
48
|
+
},
|
|
49
|
+
"variant": {
|
|
50
|
+
"description": "Visual treatment. Default ('') renders as a primary-rail item (reserved icon space, in-icon selected accent). 'section' renders flat — no icon space when absent, left-edge accent bar for selected — matching the prior <section-nav-item-ui>. When the parent <nav-ui> carries variant=\"section\", this item inherits it via CSS cascade unless an explicit variant is set.",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"enum": [
|
|
53
|
+
"",
|
|
54
|
+
"section"
|
|
55
|
+
],
|
|
56
|
+
"default": ""
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"required": [
|
|
60
|
+
"component"
|
|
61
|
+
],
|
|
62
|
+
"unevaluatedProperties": false,
|
|
63
|
+
"x-adiaui": {
|
|
64
|
+
"anti_patterns": [],
|
|
65
|
+
"category": "layout",
|
|
66
|
+
"events": {
|
|
67
|
+
"nav-select": {
|
|
68
|
+
"description": "Bubbles when the item is activated. Detail: { item, text, value }."
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"examples": [],
|
|
72
|
+
"keywords": [
|
|
73
|
+
"nav",
|
|
74
|
+
"navigation",
|
|
75
|
+
"item",
|
|
76
|
+
"link",
|
|
77
|
+
"sidebar"
|
|
78
|
+
],
|
|
79
|
+
"name": "UINavItem",
|
|
80
|
+
"related": [],
|
|
81
|
+
"slots": {
|
|
82
|
+
"default": {
|
|
83
|
+
"description": "Optional override of the default icon + text + badge stamping."
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"states": [
|
|
87
|
+
{
|
|
88
|
+
"description": "Default.",
|
|
89
|
+
"name": "idle"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"description": "aria-current=page.",
|
|
93
|
+
"name": "selected"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"description": "Suppressed activation.",
|
|
97
|
+
"name": "disabled"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"synonyms": {},
|
|
101
|
+
"tag": "nav-item-ui",
|
|
102
|
+
"tokens": {},
|
|
103
|
+
"traits": [],
|
|
104
|
+
"version": 1
|
|
105
|
+
}
|
|
106
|
+
}
|