@adia-ai/web-components 0.0.27 → 0.0.29
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/agent-questions/agent-questions.css +20 -1
- package/components/agent-trace/agent-trace.css +17 -12
- package/components/badge/badge.js +9 -1
- package/components/breadcrumb/breadcrumb.a2ui.json +16 -1
- package/components/breadcrumb/breadcrumb.css +27 -0
- package/components/breadcrumb/breadcrumb.js +95 -17
- package/components/breadcrumb/breadcrumb.yaml +15 -1
- package/components/canvas/canvas.js +1 -1
- package/components/chart/chart.css +20 -13
- package/components/chart/chart.js +49 -17
- package/components/chart-legend/chart-legend.css +30 -54
- package/components/chart-legend/chart-legend.js +48 -30
- package/components/command/command.js +52 -1
- package/components/feed/feed-item.yaml +50 -0
- package/components/feed/feed.a2ui.json +59 -0
- package/components/feed/feed.css +150 -0
- package/components/feed/feed.js +385 -0
- package/components/feed/feed.yaml +33 -0
- package/components/index.js +2 -0
- package/components/swatch/swatch.a2ui.json +116 -0
- package/components/swatch/swatch.css +141 -0
- package/components/swatch/swatch.js +121 -0
- package/components/swatch/swatch.yaml +101 -0
- package/components/timeline/timeline.css +5 -1
- package/components/toast/toast.js +48 -178
- package/components/tooltip/tooltip.css +3 -3
- package/core/provider.js +1 -0
- package/index.css +3 -2
- package/index.js +15 -7
- package/package.json +1 -5
- package/styles/components.css +1 -0
- 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.css +0 -264
- package/patterns/app-nav-group/app-nav-group.js +0 -116
- 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.css +0 -162
- 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
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { AdiaElement } from '../../core/element.js';
|
|
2
|
-
import '../../components/chat/chat.js';
|
|
3
|
-
import '../../components/canvas/canvas.js';
|
|
4
|
-
import '../../components/inspector/inspector.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* <gen-ui-ui> — Composition shell for chat + canvas generative UI.
|
|
8
|
-
*
|
|
9
|
-
* Modes:
|
|
10
|
-
* chat — thread only, full width
|
|
11
|
-
* split — thread left + canvas right (50/50)
|
|
12
|
-
* canvas — canvas only, thread hidden
|
|
13
|
-
*
|
|
14
|
-
* Consumer-owns-LLM: forwards all events from children, never calls fetch.
|
|
15
|
-
*
|
|
16
|
-
* Events (forwarded):
|
|
17
|
-
* submit — from thread (chat input)
|
|
18
|
-
* suggestion-select — from thread
|
|
19
|
-
* canvas-interaction — from canvas
|
|
20
|
-
*/
|
|
21
|
-
export class AdiaGenUI extends AdiaElement {
|
|
22
|
-
static properties = {
|
|
23
|
-
mode: { type: String, default: 'chat', reflect: true },
|
|
24
|
-
inspector: { type: Boolean, default: false, reflect: true },
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
static template = () => null;
|
|
28
|
-
|
|
29
|
-
#bound = false;
|
|
30
|
-
#threadEl = null;
|
|
31
|
-
#canvasEl = null;
|
|
32
|
-
#inspectorEl = null;
|
|
33
|
-
|
|
34
|
-
connected() {
|
|
35
|
-
// Forward events from children — they bubble, so just re-dispatch isn't needed.
|
|
36
|
-
// Events already bubble from thread/canvas through this host.
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
render() {
|
|
40
|
-
if (this.#bound) return;
|
|
41
|
-
this.#bound = true;
|
|
42
|
-
|
|
43
|
-
this.#threadEl = document.createElement('chat-ui');
|
|
44
|
-
this.#canvasEl = document.createElement('canvas-ui');
|
|
45
|
-
|
|
46
|
-
this.appendChild(this.#threadEl);
|
|
47
|
-
this.appendChild(this.#canvasEl);
|
|
48
|
-
|
|
49
|
-
if (this.inspector) {
|
|
50
|
-
this.#inspectorEl = document.createElement('inspector-ui');
|
|
51
|
-
this.appendChild(this.#inspectorEl);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// ── Public API ──
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Append a chat message. Delegates to thread.
|
|
59
|
-
* @param {{ role: string, content: string, avatar?: string }} msg
|
|
60
|
-
*/
|
|
61
|
-
appendMessage(msg) {
|
|
62
|
-
this.#threadEl?.appendMessage(msg);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Append chain-of-thought. Delegates to thread.
|
|
67
|
-
* @param {{ text: string }} msg
|
|
68
|
-
*/
|
|
69
|
-
appendCoT(msg) {
|
|
70
|
-
this.#threadEl?.appendCoT(msg);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Push an artifact to the canvas. Auto-switches to split mode if in chat mode.
|
|
75
|
-
* @param {object[]} messages — A2UI messages
|
|
76
|
-
*/
|
|
77
|
-
pushArtifact(messages) {
|
|
78
|
-
if (this.mode === 'chat') {
|
|
79
|
-
this.mode = 'split';
|
|
80
|
-
}
|
|
81
|
-
this.#canvasEl?.processAll(messages);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Set suggestion buttons. Delegates to thread.
|
|
86
|
-
* @param {{ label: string, prompt: string }[]} items
|
|
87
|
-
*/
|
|
88
|
-
setSuggestions(items) {
|
|
89
|
-
this.#threadEl?.setSuggestions(items);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** Append a result message with action buttons. Delegates to thread. */
|
|
93
|
-
appendResultMessage(opts) { this.#threadEl?.appendResultMessage(opts); }
|
|
94
|
-
|
|
95
|
-
/** Show save-pattern bar. Delegates to thread. */
|
|
96
|
-
showSavePatternBar(opts) { this.#threadEl?.showSavePatternBar(opts); }
|
|
97
|
-
|
|
98
|
-
/** Show feedback widget. Delegates to thread. */
|
|
99
|
-
showFeedbackWidget(opts) { this.#threadEl?.showFeedbackWidget(opts); }
|
|
100
|
-
|
|
101
|
-
/** Show typing indicator. Delegates to thread. */
|
|
102
|
-
showTyping() { this.#threadEl?.showTyping(); }
|
|
103
|
-
|
|
104
|
-
/** Hide typing indicator. Delegates to thread. */
|
|
105
|
-
hideTyping() { this.#threadEl?.hideTyping(); }
|
|
106
|
-
|
|
107
|
-
/** Append an error message. Delegates to thread. */
|
|
108
|
-
appendError(content) { this.#threadEl?.appendError(content); }
|
|
109
|
-
|
|
110
|
-
/** Start a pipeline status indicator. Delegates to thread. */
|
|
111
|
-
startPipelineStatus() { return this.#threadEl?.startPipelineStatus(); }
|
|
112
|
-
|
|
113
|
-
/** Update the active pipeline status. Delegates to thread. */
|
|
114
|
-
updatePipelineStatus(opts) { this.#threadEl?.updatePipelineStatus(opts); }
|
|
115
|
-
|
|
116
|
-
/** Mark the active pipeline status as complete. Delegates to thread. */
|
|
117
|
-
completePipelineStatus() { this.#threadEl?.completePipelineStatus(); }
|
|
118
|
-
|
|
119
|
-
/** Reset both thread and canvas. */
|
|
120
|
-
reset() {
|
|
121
|
-
this.#threadEl?.clear();
|
|
122
|
-
this.#canvasEl?.reset();
|
|
123
|
-
this.mode = 'chat';
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/** Access the thread element. */
|
|
127
|
-
get thread() { return this.#threadEl; }
|
|
128
|
-
|
|
129
|
-
/** Access the canvas element. */
|
|
130
|
-
get canvas() { return this.#canvasEl; }
|
|
131
|
-
|
|
132
|
-
/** Access the inspector element (null if inspector not enabled). */
|
|
133
|
-
get inspect() { return this.#inspectorEl; }
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
customElements.define('gen-ui-ui', AdiaGenUI);
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
2
|
-
name: AdiaGenUI
|
|
3
|
-
tag: gen-ui-ui
|
|
4
|
-
component: GenUI
|
|
5
|
-
category: layout
|
|
6
|
-
version: 1
|
|
7
|
-
description: |
|
|
8
|
-
Composition shell for chat + canvas generative UI. Manages layout modes
|
|
9
|
-
(chat-only / split / canvas-only) and delegates a unified API across
|
|
10
|
-
child chat-ui, canvas-ui, and inspector-ui elements.
|
|
11
|
-
|
|
12
|
-
props:
|
|
13
|
-
mode:
|
|
14
|
-
type: string
|
|
15
|
-
default: chat
|
|
16
|
-
enum: [chat, split, canvas]
|
|
17
|
-
reflect: true
|
|
18
|
-
description: Layout mode — chat-only, 50/50 split, or canvas-only.
|
|
19
|
-
|
|
20
|
-
inspector:
|
|
21
|
-
type: boolean
|
|
22
|
-
default: false
|
|
23
|
-
reflect: true
|
|
24
|
-
description: Show the inspector pane (for debugging generated A2UI).
|
|
25
|
-
|
|
26
|
-
events: {}
|
|
27
|
-
|
|
28
|
-
slots:
|
|
29
|
-
default:
|
|
30
|
-
description: Author supplies chat-ui, canvas-ui, and optional inspector-ui children.
|
|
31
|
-
|
|
32
|
-
states:
|
|
33
|
-
- name: idle
|
|
34
|
-
description: Default mode=chat.
|
|
35
|
-
|
|
36
|
-
traits: []
|
|
37
|
-
|
|
38
|
-
a2ui:
|
|
39
|
-
rules:
|
|
40
|
-
- gen-ui-ui is an integration shell. Prefer app-shell-ui for admin UIs; use gen-ui-ui only for chat+canvas tooling.
|
|
41
|
-
|
|
42
|
-
keywords: [gen-ui, generative-ui, chat-canvas, agent-shell]
|
|
43
|
-
related: [AppShell, Chat]
|
package/patterns/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { AdiaAppShell } from './app-shell/app-shell.js';
|
|
2
|
-
export { AdiaAppNav } from './app-nav/app-nav.js';
|
|
3
|
-
export { AdiaAppNavGroup } from './app-nav-group/app-nav-group.js';
|
|
4
|
-
export { AdiaAppNavItem } from './app-nav-item/app-nav-item.js';
|
|
5
|
-
export { AdiaSectionNav } from './section-nav/section-nav.js';
|
|
6
|
-
export { AdiaSectionNavGroup } from './section-nav-group/section-nav-group.js';
|
|
7
|
-
export { AdiaSectionNavItem } from './section-nav-item/section-nav-item.js';
|
|
8
|
-
export { AdiaGenUI } from './gen-ui/gen-ui.js';
|
|
9
|
-
export { AdiaChatElement } from './adia-chat/adia-chat.js';
|
|
10
|
-
export { AdiaEditorElement } from './adia-editor/adia-editor.js';
|
|
11
|
-
export { AdiaA2UIRoot } from './a2ui-root/a2ui-root.js';
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://adiaui.dev/a2ui/v0_9/components/SectionNav.json",
|
|
4
|
-
"title": "SectionNav",
|
|
5
|
-
"description": "Sub-navigation rail container. Sits beside an article when a page lives\ninside an app-shell section that has its own child pages. Can optionally\nrender a heading label above the rail.\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
|
-
"component": {
|
|
17
|
-
"const": "SectionNav"
|
|
18
|
-
},
|
|
19
|
-
"divider": {
|
|
20
|
-
"description": "Render auto-dividers between groups.",
|
|
21
|
-
"type": "boolean",
|
|
22
|
-
"default": false
|
|
23
|
-
},
|
|
24
|
-
"heading": {
|
|
25
|
-
"description": "Optional section label (also sets aria-label).",
|
|
26
|
-
"type": "string",
|
|
27
|
-
"default": ""
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"required": [
|
|
31
|
-
"component"
|
|
32
|
-
],
|
|
33
|
-
"unevaluatedProperties": false,
|
|
34
|
-
"x-adiaui": {
|
|
35
|
-
"anti_patterns": [],
|
|
36
|
-
"category": "nav",
|
|
37
|
-
"events": {
|
|
38
|
-
"group-toggle": {
|
|
39
|
-
"description": "Bubbles from a child section-nav-group-ui[collapsible] on header click.",
|
|
40
|
-
"detail": {
|
|
41
|
-
"open": "boolean",
|
|
42
|
-
"text": "string"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"nav-select": {
|
|
46
|
-
"description": "Bubbles from a child section-nav-item-ui on selection.",
|
|
47
|
-
"detail": {
|
|
48
|
-
"item": "HTMLElement",
|
|
49
|
-
"text": "string",
|
|
50
|
-
"value": "string"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
"examples": [],
|
|
55
|
-
"keywords": [
|
|
56
|
-
"section-nav",
|
|
57
|
-
"sub-nav",
|
|
58
|
-
"rail",
|
|
59
|
-
"side-nav",
|
|
60
|
-
"docs-nav"
|
|
61
|
-
],
|
|
62
|
-
"name": "AdiaSectionNav",
|
|
63
|
-
"related": [
|
|
64
|
-
"AppShell",
|
|
65
|
-
"SectionNavGroup",
|
|
66
|
-
"SectionNavItem"
|
|
67
|
-
],
|
|
68
|
-
"slots": {
|
|
69
|
-
"default": {
|
|
70
|
-
"description": "section-nav-group-ui and section-nav-item-ui children."
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"states": [
|
|
74
|
-
{
|
|
75
|
-
"description": "Default.",
|
|
76
|
-
"name": "idle"
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
"synonyms": {
|
|
80
|
-
"rail": [
|
|
81
|
-
"section-nav",
|
|
82
|
-
"sub-nav",
|
|
83
|
-
"side-nav"
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
"tag": "section-nav-ui",
|
|
87
|
-
"tokens": {},
|
|
88
|
-
"traits": [],
|
|
89
|
-
"version": 1
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/* ═══════════════════════════════════════════
|
|
2
|
-
SECTION-NAV — container
|
|
3
|
-
Mirrors app-nav's rhythm: tight gaps, ui-size font,
|
|
4
|
-
--a-size row heights, --a-ui-px horizontal padding.
|
|
5
|
-
═══════════════════════════════════════════ */
|
|
6
|
-
|
|
7
|
-
@scope (section-nav-ui) {
|
|
8
|
-
:where(:scope) {
|
|
9
|
-
--section-nav-gap: var(--a-space-1);
|
|
10
|
-
--section-nav-px: 0;
|
|
11
|
-
--section-nav-py: 0;
|
|
12
|
-
--section-nav-font-size: var(--a-ui-size);
|
|
13
|
-
|
|
14
|
-
--section-nav-heading-fg: var(--a-fg-muted);
|
|
15
|
-
--section-nav-heading-size: var(--a-kicker-sm);
|
|
16
|
-
--section-nav-heading-weight: var(--a-weight-medium);
|
|
17
|
-
--section-nav-heading-pad-x: var(--a-space-2);
|
|
18
|
-
--section-nav-heading-pad-y: var(--a-space-3) var(--a-space-1);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
:scope {
|
|
22
|
-
box-sizing: border-box;
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
gap: var(--section-nav-gap);
|
|
26
|
-
padding: var(--section-nav-py) var(--section-nav-px);
|
|
27
|
-
font-size: var(--section-nav-font-size);
|
|
28
|
-
min-width: 0;
|
|
29
|
-
overflow-y: auto;
|
|
30
|
-
overflow-x: hidden;
|
|
31
|
-
scrollbar-width: none;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:scope::-webkit-scrollbar { display: none; }
|
|
35
|
-
|
|
36
|
-
/* Auto-dividers between groups when <section-nav-ui divider>. */
|
|
37
|
-
:scope[divider] > section-nav-group-ui + section-nav-group-ui,
|
|
38
|
-
:scope[divider] > section-nav-item-ui + section-nav-group-ui,
|
|
39
|
-
:scope[divider] > section-nav-group-ui + section-nav-item-ui {
|
|
40
|
-
border-top: 1px solid var(--a-border-subtle);
|
|
41
|
-
margin-top: var(--a-space-1);
|
|
42
|
-
padding-top: var(--a-space-1);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/* Heading rendered from [heading] attribute.
|
|
46
|
-
No block margin — the flex container's gap handles separation. */
|
|
47
|
-
:scope[heading]:not([heading=""])::before {
|
|
48
|
-
content: attr(heading);
|
|
49
|
-
display: block;
|
|
50
|
-
padding-inline: var(--section-nav-heading-pad-x);
|
|
51
|
-
padding-block: var(--section-nav-heading-pad-y);
|
|
52
|
-
font-size: var(--section-nav-heading-size);
|
|
53
|
-
font-weight: var(--section-nav-heading-weight);
|
|
54
|
-
color: var(--section-nav-heading-fg);
|
|
55
|
-
text-transform: uppercase;
|
|
56
|
-
letter-spacing: 0.06em;
|
|
57
|
-
white-space: nowrap;
|
|
58
|
-
overflow: hidden;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* <section-nav-ui> — Container for a section's sub-navigation rail.
|
|
3
|
-
* Used beside the main article when a page lives inside an app-shell
|
|
4
|
-
* section that has its own child pages.
|
|
5
|
-
*
|
|
6
|
-
* Children: section-nav-group-ui and section-nav-item-ui.
|
|
7
|
-
* Event: nav-select (bubbles from items). detail: { item, text, value }
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { AdiaElement } from '../../core/element.js';
|
|
11
|
-
|
|
12
|
-
class AdiaSectionNav extends AdiaElement {
|
|
13
|
-
static properties = {
|
|
14
|
-
heading: { type: String, default: '', reflect: true },
|
|
15
|
-
divider: { type: Boolean, default: false, reflect: true },
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
static template = () => null;
|
|
19
|
-
|
|
20
|
-
connected() {
|
|
21
|
-
this.setAttribute('role', 'navigation');
|
|
22
|
-
if (this.heading) this.setAttribute('aria-label', this.heading);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
render() {
|
|
26
|
-
if (this.heading) this.setAttribute('aria-label', this.heading);
|
|
27
|
-
else this.removeAttribute('aria-label');
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
get selectedItem() {
|
|
31
|
-
return this.querySelector('section-nav-item-ui[selected]');
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
select(item) {
|
|
35
|
-
const prev = this.selectedItem;
|
|
36
|
-
if (prev && prev !== item) prev.removeAttribute('selected');
|
|
37
|
-
if (item) item.setAttribute('selected', '');
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
customElements.define('section-nav-ui', AdiaSectionNav);
|
|
41
|
-
|
|
42
|
-
export { AdiaSectionNav };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
2
|
-
name: AdiaSectionNav
|
|
3
|
-
tag: section-nav-ui
|
|
4
|
-
component: SectionNav
|
|
5
|
-
category: nav
|
|
6
|
-
version: 1
|
|
7
|
-
description: |
|
|
8
|
-
Sub-navigation rail container. Sits beside an article when a page lives
|
|
9
|
-
inside an app-shell section that has its own child pages. Can optionally
|
|
10
|
-
render a heading label above the rail.
|
|
11
|
-
|
|
12
|
-
props:
|
|
13
|
-
heading:
|
|
14
|
-
type: string
|
|
15
|
-
default: ""
|
|
16
|
-
reflect: true
|
|
17
|
-
description: Optional section label (also sets aria-label).
|
|
18
|
-
|
|
19
|
-
divider:
|
|
20
|
-
type: boolean
|
|
21
|
-
default: false
|
|
22
|
-
reflect: true
|
|
23
|
-
description: Render auto-dividers between groups.
|
|
24
|
-
|
|
25
|
-
events:
|
|
26
|
-
nav-select:
|
|
27
|
-
description: Bubbles from a child section-nav-item-ui on selection.
|
|
28
|
-
detail:
|
|
29
|
-
item: HTMLElement
|
|
30
|
-
text: string
|
|
31
|
-
value: string
|
|
32
|
-
|
|
33
|
-
group-toggle:
|
|
34
|
-
description: Bubbles from a child section-nav-group-ui[collapsible] on header click.
|
|
35
|
-
detail:
|
|
36
|
-
text: string
|
|
37
|
-
open: boolean
|
|
38
|
-
|
|
39
|
-
slots:
|
|
40
|
-
default:
|
|
41
|
-
description: section-nav-group-ui and section-nav-item-ui children.
|
|
42
|
-
|
|
43
|
-
states:
|
|
44
|
-
- name: idle
|
|
45
|
-
description: Default.
|
|
46
|
-
|
|
47
|
-
traits: []
|
|
48
|
-
|
|
49
|
-
a2ui:
|
|
50
|
-
rules:
|
|
51
|
-
- section-nav-ui is the only valid parent of section-nav-group-ui.
|
|
52
|
-
- section-nav-item-ui may be a direct child of section-nav-ui OR nested inside section-nav-group-ui.
|
|
53
|
-
- Use section-nav-ui beside an article inside an app-shell section; don't nest app-nav inside it.
|
|
54
|
-
|
|
55
|
-
keywords: [section-nav, sub-nav, rail, side-nav, docs-nav]
|
|
56
|
-
synonyms:
|
|
57
|
-
rail: [section-nav, sub-nav, side-nav]
|
|
58
|
-
related: [AppShell, SectionNavGroup, SectionNavItem]
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://adiaui.dev/a2ui/v0_9/components/SectionNavGroup.json",
|
|
4
|
-
"title": "SectionNavGroup",
|
|
5
|
-
"description": "Optional labeled group inside section-nav-ui. Auto-generates a header row\nwith label and optional leading icon. When [collapsible], the header row\nis a keyboard-activatable toggle that emits `group-toggle`.\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
|
-
"collapsible": {
|
|
17
|
-
"description": "When true, the header becomes a click/keyboard toggle that expands and collapses the group.",
|
|
18
|
-
"type": "boolean",
|
|
19
|
-
"default": false
|
|
20
|
-
},
|
|
21
|
-
"component": {
|
|
22
|
-
"const": "SectionNavGroup"
|
|
23
|
-
},
|
|
24
|
-
"icon": {
|
|
25
|
-
"description": "Optional Phosphor icon name (leading).",
|
|
26
|
-
"type": "string",
|
|
27
|
-
"default": ""
|
|
28
|
-
},
|
|
29
|
-
"open": {
|
|
30
|
-
"description": "Expanded state. Only meaningful when collapsible=true.",
|
|
31
|
-
"type": "boolean",
|
|
32
|
-
"default": false
|
|
33
|
-
},
|
|
34
|
-
"text": {
|
|
35
|
-
"description": "Group label rendered in the header row.",
|
|
36
|
-
"type": "string",
|
|
37
|
-
"default": ""
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"required": [
|
|
41
|
-
"component"
|
|
42
|
-
],
|
|
43
|
-
"unevaluatedProperties": false,
|
|
44
|
-
"x-adiaui": {
|
|
45
|
-
"anti_patterns": [],
|
|
46
|
-
"category": "nav",
|
|
47
|
-
"events": {
|
|
48
|
-
"group-toggle": {
|
|
49
|
-
"description": "Fired when the group is toggled via header click or keyboard (Enter/Space).",
|
|
50
|
-
"detail": {
|
|
51
|
-
"open": "boolean",
|
|
52
|
-
"text": "string"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"examples": [],
|
|
57
|
-
"keywords": [
|
|
58
|
-
"section-nav-group",
|
|
59
|
-
"sub-nav-group",
|
|
60
|
-
"nav-section",
|
|
61
|
-
"rail-group"
|
|
62
|
-
],
|
|
63
|
-
"name": "AdiaSectionNavGroup",
|
|
64
|
-
"related": [
|
|
65
|
-
"SectionNav",
|
|
66
|
-
"SectionNavItem"
|
|
67
|
-
],
|
|
68
|
-
"slots": {
|
|
69
|
-
"default": {
|
|
70
|
-
"description": "section-nav-item-ui children rendered under the header."
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"states": [
|
|
74
|
-
{
|
|
75
|
-
"description": "Default.",
|
|
76
|
-
"name": "idle"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"description": "Header is interactive.",
|
|
80
|
-
"attribute": "collapsible",
|
|
81
|
-
"name": "collapsible"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"description": "Children visible.",
|
|
85
|
-
"attribute": "open",
|
|
86
|
-
"name": "open"
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
"synonyms": {},
|
|
90
|
-
"tag": "section-nav-group-ui",
|
|
91
|
-
"tokens": {},
|
|
92
|
-
"traits": [],
|
|
93
|
-
"version": 1
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
@scope (section-nav-group-ui) {
|
|
2
|
-
:where(:scope) {
|
|
3
|
-
--section-nav-group-gap: var(--a-space-0-5);
|
|
4
|
-
--section-nav-group-row-height: var(--a-size);
|
|
5
|
-
--section-nav-group-row-px: var(--a-ui-px);
|
|
6
|
-
--section-nav-group-row-gap: var(--a-space-1);
|
|
7
|
-
--section-nav-group-row-radius: var(--a-radius-md);
|
|
8
|
-
|
|
9
|
-
--section-nav-group-label-fg: var(--a-fg-muted);
|
|
10
|
-
--section-nav-group-label-size: var(--a-ui-tiny);
|
|
11
|
-
--section-nav-group-label-weight: var(--a-weight-medium);
|
|
12
|
-
--section-nav-group-bg-hover: var(--a-bg-muted);
|
|
13
|
-
--section-nav-group-duration: var(--a-duration-fast);
|
|
14
|
-
--section-nav-group-easing: var(--a-easing);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:scope {
|
|
18
|
-
box-sizing: border-box;
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
gap: var(--section-nav-group-gap);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
:scope > [data-section-nav-group-header] {
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
gap: var(--section-nav-group-row-gap);
|
|
28
|
-
padding: 0 var(--section-nav-group-row-px);
|
|
29
|
-
height: var(--section-nav-group-row-height);
|
|
30
|
-
border-radius: var(--section-nav-group-row-radius);
|
|
31
|
-
color: var(--section-nav-group-label-fg);
|
|
32
|
-
font-size: var(--section-nav-group-label-size);
|
|
33
|
-
font-weight: var(--section-nav-group-label-weight);
|
|
34
|
-
text-transform: uppercase;
|
|
35
|
-
letter-spacing: 0.06em;
|
|
36
|
-
white-space: nowrap;
|
|
37
|
-
overflow: hidden;
|
|
38
|
-
user-select: none;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
:scope > [data-section-nav-group-header] > [data-section-nav-group-label] {
|
|
42
|
-
flex: 1;
|
|
43
|
-
min-width: 0;
|
|
44
|
-
overflow: hidden;
|
|
45
|
-
text-overflow: ellipsis;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* Collapsible */
|
|
49
|
-
:scope[collapsible] > [data-section-nav-group-header] {
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
transition:
|
|
52
|
-
background var(--section-nav-group-duration) var(--section-nav-group-easing),
|
|
53
|
-
color var(--section-nav-group-duration) var(--section-nav-group-easing);
|
|
54
|
-
}
|
|
55
|
-
:scope[collapsible] > [data-section-nav-group-header]:hover,
|
|
56
|
-
:scope[collapsible] > [data-section-nav-group-header]:focus-visible {
|
|
57
|
-
background: var(--section-nav-group-bg-hover);
|
|
58
|
-
outline: none;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
:scope[collapsible] > [data-section-nav-group-header] [data-section-nav-group-caret] {
|
|
62
|
-
--a-icon-size: 0.5rem;
|
|
63
|
-
transition: transform var(--section-nav-group-duration) var(--section-nav-group-easing);
|
|
64
|
-
flex-shrink: 0;
|
|
65
|
-
}
|
|
66
|
-
:scope[collapsible][open] > [data-section-nav-group-header] [data-section-nav-group-caret] {
|
|
67
|
-
transform: rotate(90deg);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/* Collapsed state hides all children except the header */
|
|
71
|
-
:scope[collapsible]:not([open]) > :not([data-section-nav-group-header]) {
|
|
72
|
-
display: none;
|
|
73
|
-
}
|
|
74
|
-
}
|