@adia-ai/web-modules 0.4.7 → 0.4.8
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 +26 -0
- package/chat/chat-composer/chat-composer.a2ui.json +1 -0
- package/chat/chat-composer/chat-composer.d.ts +47 -0
- package/chat/chat-empty/chat-empty.a2ui.json +1 -0
- package/chat/chat-header/chat-header.a2ui.json +1 -0
- package/chat/chat-shell/chat-shell.a2ui.json +3 -0
- package/chat/chat-shell/chat-shell.d.ts +86 -0
- package/chat/chat-shell/chat-shell.yaml +4 -0
- package/chat/chat-sidebar/chat-sidebar.a2ui.json +1 -0
- package/chat/chat-sidebar/chat-sidebar.d.ts +70 -0
- package/chat/chat-status/chat-status.a2ui.json +1 -0
- package/chat/chat-thread/chat-thread.a2ui.json +1 -0
- package/chat/chat-thread/chat-thread.d.ts +38 -0
- package/editor/editor-canvas/editor-canvas.a2ui.json +1 -0
- package/editor/editor-canvas/editor-canvas.d.ts +40 -0
- package/editor/editor-canvas-empty/editor-canvas-empty.a2ui.json +1 -0
- package/editor/editor-shell/editor-shell.a2ui.json +1 -0
- package/editor/editor-shell/editor-shell.d.ts +21 -0
- package/editor/editor-sidebar/editor-sidebar.a2ui.json +1 -0
- package/editor/editor-sidebar/editor-sidebar.d.ts +53 -0
- package/editor/editor-statusbar/editor-statusbar.a2ui.json +1 -0
- package/editor/editor-toolbar/editor-toolbar.a2ui.json +1 -0
- package/editor/editor-toolbar/editor-toolbar.d.ts +39 -0
- package/package.json +1 -1
- package/runtime/a2ui-root/a2ui-root.a2ui.json +1 -0
- package/runtime/a2ui-root/a2ui-root.d.ts +47 -0
- package/runtime/gen-root/gen-root.a2ui.json +5 -0
- package/runtime/gen-root/gen-root.d.ts +23 -0
- package/runtime/gen-root/gen-root.yaml +6 -0
- package/shell/admin-command/admin-command.a2ui.json +1 -0
- package/shell/admin-command/admin-command.d.ts +50 -0
- package/shell/admin-content/admin-content.a2ui.json +1 -0
- package/shell/admin-page/admin-page.a2ui.json +1 -0
- package/shell/admin-page-body/admin-page-body.a2ui.json +1 -0
- package/shell/admin-page-header/admin-page-header.a2ui.json +1 -0
- package/shell/admin-scroll/admin-scroll.a2ui.json +1 -0
- package/shell/admin-shell/admin-shell.a2ui.json +1 -0
- package/shell/admin-shell/admin-shell.d.ts +49 -0
- package/shell/admin-sidebar/admin-sidebar.a2ui.json +1 -0
- package/shell/admin-sidebar/admin-sidebar.d.ts +68 -0
- package/shell/admin-statusbar/admin-statusbar.a2ui.json +1 -0
- package/shell/admin-topbar/admin-topbar.a2ui.json +1 -0
- package/simple/simple-content/simple-content.a2ui.json +1 -0
- package/simple/simple-hero/simple-hero.a2ui.json +1 -0
- package/simple/simple-shell/simple-shell.a2ui.json +1 -0
- package/simple/simple-shell/simple-shell.d.ts +29 -0
- package/theme/theme-panel/theme-panel.a2ui.json +9 -0
- package/theme/theme-panel/theme-panel.d.ts +77 -0
- package/theme/theme-panel/theme-panel.html +2 -0
- package/theme/theme-panel/theme-panel.yaml +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,32 @@ Built from `@adia-ai/web-components` primitives.
|
|
|
11
11
|
|
|
12
12
|
_No pending changes._
|
|
13
13
|
|
|
14
|
+
## [0.4.8] - 2026-05-12
|
|
15
|
+
|
|
16
|
+
### Added — TypeScript declarations for all web-modules (FEEDBACK-02 #1, v0.4.8)
|
|
17
|
+
|
|
18
|
+
Closes consumer-friction item #1 from FEEDBACK-adia-packages-02. Hand-codegen'd `.d.ts` declarations now ship for every web-module across all clusters:
|
|
19
|
+
|
|
20
|
+
- **chat** (6): `chat-composer`, `chat-shell`, `chat-sidebar`, `chat-thread` + supporting types.
|
|
21
|
+
- **editor** (5): `editor-canvas`, `editor-shell`, `editor-sidebar`, `editor-toolbar` + supporting types.
|
|
22
|
+
- **runtime** (2): `a2ui-root`, `gen-root`.
|
|
23
|
+
- **admin shell** (10): admin-command, admin-content, admin-page, admin-page-{body,header}, admin-scroll, admin-shell, admin-sidebar, admin-statusbar, admin-topbar.
|
|
24
|
+
- **simple** + **theme** clusters: companion `.d.ts` files for the remaining modules.
|
|
25
|
+
|
|
26
|
+
TypeScript consumers now get typed `document.querySelector('admin-shell')` returns `AdminShell`, typed reflected properties, typed methods (`.toggle()`, `.collapse()`, etc.), and typed custom events. `HTMLElementTagNameMap` augmentation in the package barrel makes the tag-name lookups type-aware. Mirrors the `@adia-ai/web-components@0.4.7` §74 codegen pattern.
|
|
27
|
+
|
|
28
|
+
### Added — `composes:` field on YAMLs + `.a2ui.json` regen (ADR-0027 wiring, v0.4.8)
|
|
29
|
+
|
|
30
|
+
Each web-module YAML now declares a `composes:` field listing the `@adia-ai/web-components` primitives it instantiates internally. ADR-0027 (cross-primitive composition imports are consumer's responsibility) becomes mechanically auditable — the `composes:` linter ships in this release and runs as part of `npm run components`. `.a2ui.json` sidecars regenerated to surface the `composes:` data through the v0.9 catalog.
|
|
31
|
+
|
|
32
|
+
`chat-shell.yaml` + `gen-root.yaml` documented the LLM-pipeline wiring expectations alongside the composes declarations.
|
|
33
|
+
|
|
34
|
+
### Documentation — lexical-scope authoring guide
|
|
35
|
+
|
|
36
|
+
`README.md` § Module authoring updated with the `composes:` field semantics + lexical-scope rationale (why composes-declared imports must live at the consumer page, not transitively pulled by the module). Aligns with §66's `adaptV09Component()` catalog reader work.
|
|
37
|
+
|
|
38
|
+
See root [CHANGELOG.md `[Unreleased]`](../../CHANGELOG.md) for the cross-cutting arc narrative.
|
|
39
|
+
|
|
14
40
|
## [0.4.7] - 2026-05-12
|
|
15
41
|
|
|
16
42
|
### Changed — `chat/chat-thread.yaml` populates `synonyms.tags` (§72)
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"x-adiaui": {
|
|
30
30
|
"anti_patterns": [],
|
|
31
31
|
"category": "input",
|
|
32
|
+
"composes": [],
|
|
32
33
|
"events": {
|
|
33
34
|
"composer-submit": {
|
|
34
35
|
"description": "Bubbles when the inner input fires its 'submit' event. Detail mirrors the inner event's detail (typically text + model).",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<chat-composer-ui>` — Module-tier chat composer wrapper — replaces legacy <chat-input-ui
|
|
3
|
+
data-chat-input> direct child of <chat-shell> per ADR-0023.
|
|
4
|
+
Forwards submit events as 'composer-submit', propagates [disabled]
|
|
5
|
+
to the inner input, provides slot vocabulary for future composer
|
|
6
|
+
surfaces (file attach, autocomplete, model picker).
|
|
7
|
+
|
|
8
|
+
Sits inside <chat-shell> as the input region (typically inside or
|
|
9
|
+
alongside the footer). Authors place an inner <chat-input-ui>
|
|
10
|
+
(or input-ui / textarea-ui) as the primary input.
|
|
11
|
+
|
|
12
|
+
Backwards compat — <chat-shell> still recognizes the legacy
|
|
13
|
+
<chat-input-ui data-chat-input> shape via :is() selector. New
|
|
14
|
+
code should prefer <chat-composer>.
|
|
15
|
+
|
|
16
|
+
*
|
|
17
|
+
* @see https://ui-kit.exe.xyz/site/components/chat-composer
|
|
18
|
+
*
|
|
19
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
20
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
21
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
22
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
23
|
+
* needed beyond what the yaml `events:` block can express.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
27
|
+
|
|
28
|
+
export interface ChatComposerComposerSubmitEventDetail {
|
|
29
|
+
model: string;
|
|
30
|
+
text: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type ChatComposerComposerSubmitEvent = CustomEvent<ChatComposerComposerSubmitEventDetail>;
|
|
34
|
+
|
|
35
|
+
export class UIChatComposer extends UIElement {
|
|
36
|
+
/** Reflected — set by the host while streaming, or by application
|
|
37
|
+
code. Propagated to the inner input element automatically.
|
|
38
|
+
*/
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
|
|
41
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
42
|
+
type: K,
|
|
43
|
+
listener: (this: UIChatComposer, ev: HTMLElementEventMap[K]) => unknown,
|
|
44
|
+
options?: boolean | AddEventListenerOptions,
|
|
45
|
+
): void;
|
|
46
|
+
addEventListener(type: 'composer-submit', listener: (ev: ChatComposerComposerSubmitEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
47
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<chat-shell-ui>` — Behavior-only chat orchestrator (LLM-streaming module). Author supplies the
|
|
3
|
+
DOM structure via [data-chat-messages], [data-chat-input], [data-chat-empty],
|
|
4
|
+
[data-chat-status] elements; chat-shell wires message streaming, markdown
|
|
5
|
+
rendering, code-block upgrades, and an LLM integration path via proxy-url
|
|
6
|
+
(or via external submit).
|
|
7
|
+
|
|
8
|
+
*
|
|
9
|
+
* @see https://ui-kit.exe.xyz/site/components/chat-shell
|
|
10
|
+
*
|
|
11
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
12
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
13
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
14
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
15
|
+
* needed beyond what the yaml `events:` block can express.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
19
|
+
|
|
20
|
+
export type ChatShellAbortEvent = CustomEvent<unknown>;
|
|
21
|
+
export interface ChatShellChunkEventDetail {
|
|
22
|
+
snapshot: string;
|
|
23
|
+
text: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type ChatShellChunkEvent = CustomEvent<ChatShellChunkEventDetail>;
|
|
27
|
+
export type ChatShellClearEvent = CustomEvent<unknown>;
|
|
28
|
+
export interface ChatShellDoneEventDetail {
|
|
29
|
+
stopReason: string;
|
|
30
|
+
text: string;
|
|
31
|
+
usage: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type ChatShellDoneEvent = CustomEvent<ChatShellDoneEventDetail>;
|
|
35
|
+
export interface ChatShellErrorEventDetail {
|
|
36
|
+
error: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type ChatShellErrorEvent = CustomEvent<ChatShellErrorEventDetail>;
|
|
40
|
+
export interface ChatShellMessageEventDetail {
|
|
41
|
+
content: string;
|
|
42
|
+
id: string;
|
|
43
|
+
role: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type ChatShellMessageEvent = CustomEvent<ChatShellMessageEventDetail>;
|
|
47
|
+
export interface ChatShellSubmitEventDetail {
|
|
48
|
+
model: string;
|
|
49
|
+
text: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type ChatShellSubmitEvent = CustomEvent<ChatShellSubmitEventDetail>;
|
|
53
|
+
export interface ChatShellThinkingEventDetail {
|
|
54
|
+
text: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type ChatShellThinkingEvent = CustomEvent<ChatShellThinkingEventDetail>;
|
|
58
|
+
|
|
59
|
+
export class UIChatShell extends UIElement {
|
|
60
|
+
/** Model identifier. */
|
|
61
|
+
model: string;
|
|
62
|
+
/** LLM provider name (anthropic | openai | google | stub). */
|
|
63
|
+
provider: string;
|
|
64
|
+
/** API proxy endpoint for LLM calls; enables self-contained chat without external wiring. */
|
|
65
|
+
proxyUrl: string;
|
|
66
|
+
/** Active streaming indicator; toggled while a response is being received. */
|
|
67
|
+
streaming: boolean;
|
|
68
|
+
/** System prompt prepended to conversations. */
|
|
69
|
+
system: string;
|
|
70
|
+
/** Enable Anthropic extended-thinking mode. */
|
|
71
|
+
thinking: boolean;
|
|
72
|
+
|
|
73
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
74
|
+
type: K,
|
|
75
|
+
listener: (this: UIChatShell, ev: HTMLElementEventMap[K]) => unknown,
|
|
76
|
+
options?: boolean | AddEventListenerOptions,
|
|
77
|
+
): void;
|
|
78
|
+
addEventListener(type: 'abort', listener: (ev: ChatShellAbortEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
79
|
+
addEventListener(type: 'chunk', listener: (ev: ChatShellChunkEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
80
|
+
addEventListener(type: 'clear', listener: (ev: ChatShellClearEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
81
|
+
addEventListener(type: 'done', listener: (ev: ChatShellDoneEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
82
|
+
addEventListener(type: 'error', listener: (ev: ChatShellErrorEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
83
|
+
addEventListener(type: 'message', listener: (ev: ChatShellMessageEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
84
|
+
addEventListener(type: 'submit', listener: (ev: ChatShellSubmitEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
85
|
+
addEventListener(type: 'thinking', listener: (ev: ChatShellThinkingEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
86
|
+
}
|
|
@@ -11,6 +11,10 @@ description: |
|
|
|
11
11
|
rendering, code-block upgrades, and an LLM integration path via proxy-url
|
|
12
12
|
(or via external submit).
|
|
13
13
|
|
|
14
|
+
# Per ADR-0027 — primitives that programmatically create other primitives
|
|
15
|
+
# do NOT auto-import them. Consumer (or demo shell) must explicitly import.
|
|
16
|
+
composes:
|
|
17
|
+
- code-ui
|
|
14
18
|
props:
|
|
15
19
|
streaming:
|
|
16
20
|
type: boolean
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<chat-sidebar-ui>` — Module-tier chat-cluster sidebar — owns resize, snap-to-collapsed,
|
|
3
|
+
persistence, and the [collapsed] reflected attribute. Sits inside
|
|
4
|
+
<chat-shell> as slot="leading" (conversation history rail) or
|
|
5
|
+
slot="trailing" (artifacts/citations panel). Mirrors the admin-sidebar
|
|
6
|
+
shape — same 4 concerns, cluster-namespaced for the chat family.
|
|
7
|
+
|
|
8
|
+
This is the chat-cluster equivalent of <admin-sidebar> per ADR-0023.
|
|
9
|
+
<chat-shell> doesn't currently have a legacy sidebar shape (chat is
|
|
10
|
+
typically a single-pane experience), so <chat-sidebar> is purely
|
|
11
|
+
forward-looking — for chat apps that want conversation-history or
|
|
12
|
+
inspector rails.
|
|
13
|
+
|
|
14
|
+
*
|
|
15
|
+
* @see https://ui-kit.exe.xyz/site/components/chat-sidebar
|
|
16
|
+
*
|
|
17
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
18
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
19
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
20
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
21
|
+
* needed beyond what the yaml `events:` block can express.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
25
|
+
|
|
26
|
+
export interface ChatSidebarSidebarResizeEventDetail {
|
|
27
|
+
name: string;
|
|
28
|
+
width: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type ChatSidebarSidebarResizeEvent = CustomEvent<ChatSidebarSidebarResizeEventDetail>;
|
|
32
|
+
export interface ChatSidebarSidebarToggleEventDetail {
|
|
33
|
+
expanded: string;
|
|
34
|
+
name: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type ChatSidebarSidebarToggleEvent = CustomEvent<ChatSidebarSidebarToggleEventDetail>;
|
|
38
|
+
|
|
39
|
+
export class UIChatSidebar extends UIElement {
|
|
40
|
+
/** Reflected — set when the sidebar's measured width is at or below
|
|
41
|
+
96px. Consumers query this to style "collapsed mode" without
|
|
42
|
+
duplicating threshold math.
|
|
43
|
+
*/
|
|
44
|
+
collapsed: boolean;
|
|
45
|
+
/** Opts in to programmatic collapse — toggle button wiring + the
|
|
46
|
+
.toggle() / .collapse() / .expand() public methods.
|
|
47
|
+
*/
|
|
48
|
+
collapsible: boolean;
|
|
49
|
+
/** Identifier for localStorage namespacing. Defaults to slot value
|
|
50
|
+
("leading" or "trailing"). Override when running multiple sidebars
|
|
51
|
+
with the same slot.
|
|
52
|
+
*/
|
|
53
|
+
name: string;
|
|
54
|
+
/** Opts in to drag-to-resize behavior. Author supplies a child
|
|
55
|
+
[data-resize] element as the drag handle.
|
|
56
|
+
*/
|
|
57
|
+
resizable: boolean;
|
|
58
|
+
/** Reflected — set during an active pointer-drag on the resize handle.
|
|
59
|
+
Useful for suppressing transitions while dragging.
|
|
60
|
+
*/
|
|
61
|
+
resizing: boolean;
|
|
62
|
+
|
|
63
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
64
|
+
type: K,
|
|
65
|
+
listener: (this: UIChatSidebar, ev: HTMLElementEventMap[K]) => unknown,
|
|
66
|
+
options?: boolean | AddEventListenerOptions,
|
|
67
|
+
): void;
|
|
68
|
+
addEventListener(type: 'sidebar-resize', listener: (ev: ChatSidebarSidebarResizeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
69
|
+
addEventListener(type: 'sidebar-toggle', listener: (ev: ChatSidebarSidebarToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
70
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<chat-thread-ui>` — Module-tier chat message thread container — replaces legacy
|
|
3
|
+
<section data-chat-messages> per ADR-0023. Owns scroll-to-bottom
|
|
4
|
+
on new message (with user-scroll-up suspension), [streaming] and
|
|
5
|
+
[empty] reflected attributes, and a stable target for the host's
|
|
6
|
+
message rendering pipeline.
|
|
7
|
+
|
|
8
|
+
Sits inside <chat-shell> as the central scroll surface. Authors
|
|
9
|
+
compose <chat-empty> as an optional first child for the empty
|
|
10
|
+
state; message children are appended dynamically by the host.
|
|
11
|
+
|
|
12
|
+
Backwards compat — <chat-shell> still recognizes the legacy
|
|
13
|
+
<section data-chat-messages> shape via :is() selector. New code
|
|
14
|
+
should prefer <chat-thread>.
|
|
15
|
+
|
|
16
|
+
*
|
|
17
|
+
* @see https://ui-kit.exe.xyz/site/components/chat-thread
|
|
18
|
+
*
|
|
19
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
20
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
21
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
22
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
23
|
+
* needed beyond what the yaml `events:` block can express.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
27
|
+
|
|
28
|
+
export class UIChatThread extends UIElement {
|
|
29
|
+
/** Reflected — set when zero message children. Drives the
|
|
30
|
+
<chat-empty> visibility via CSS — no JS toggling needed.
|
|
31
|
+
*/
|
|
32
|
+
empty: boolean;
|
|
33
|
+
/** Reflected — set by the host while an LLM response is streaming.
|
|
34
|
+
Consumers can style streaming-mode (e.g. cursor blink) via
|
|
35
|
+
:has(chat-thread[streaming]) or attribute selectors.
|
|
36
|
+
*/
|
|
37
|
+
streaming: boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<editor-canvas-ui>` — Module-tier editor canvas surface — replaces legacy <div data-canvas>
|
|
3
|
+
inside <editor-shell> per ADR-0023. Owns scroll/zoom container
|
|
4
|
+
semantics, [empty] and [focused] reflected attributes, and a stable
|
|
5
|
+
target for the host's content rendering pipeline.
|
|
6
|
+
|
|
7
|
+
Sits as the central content region inside <editor-shell>, between
|
|
8
|
+
the optional <editor-sidebar slot="leading"> and <editor-sidebar
|
|
9
|
+
slot="trailing">. Authors compose <editor-canvas-empty> as an
|
|
10
|
+
optional first child for the empty state; canvas content children
|
|
11
|
+
(artboards, document body, etc.) are appended either statically or
|
|
12
|
+
dynamically by the host.
|
|
13
|
+
|
|
14
|
+
Backwards compat — <editor-shell> still recognizes the legacy
|
|
15
|
+
<div data-canvas> shape via :is() selector. New code should prefer
|
|
16
|
+
<editor-canvas>.
|
|
17
|
+
|
|
18
|
+
*
|
|
19
|
+
* @see https://ui-kit.exe.xyz/site/components/editor-canvas
|
|
20
|
+
*
|
|
21
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
22
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
23
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
24
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
25
|
+
* needed beyond what the yaml `events:` block can express.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
29
|
+
|
|
30
|
+
export class UIEditorCanvas extends UIElement {
|
|
31
|
+
/** Reflected — set when zero non-<editor-canvas-empty> children.
|
|
32
|
+
Drives the <editor-canvas-empty> visibility via parent CSS —
|
|
33
|
+
no JS toggling needed.
|
|
34
|
+
*/
|
|
35
|
+
empty: boolean;
|
|
36
|
+
/** Reflected — set when canvas claims focus ownership (programmatic
|
|
37
|
+
.focus() call or toolbar full-screen toggle).
|
|
38
|
+
*/
|
|
39
|
+
focused: boolean;
|
|
40
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<editor-shell-ui>` — Behavior-only editor shell module for design-tool layouts. Author
|
|
3
|
+
provides the structural DOM — header (topbar), [data-editor-body] with
|
|
4
|
+
pane-ui children ([data-left], [data-right]), [data-canvas] for the
|
|
5
|
+
central surface, and a footer (statusbar). editor-shell wires
|
|
6
|
+
select-ui[data-options] for JSON-parsed option lists.
|
|
7
|
+
|
|
8
|
+
*
|
|
9
|
+
* @see https://ui-kit.exe.xyz/site/components/editor-shell
|
|
10
|
+
*
|
|
11
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
12
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
13
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
14
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
15
|
+
* needed beyond what the yaml `events:` block can express.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
19
|
+
|
|
20
|
+
export class UIEditorShell extends UIElement {
|
|
21
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<editor-sidebar-ui>` — Module-tier editor-cluster sidebar — wraps <pane-ui resizable>
|
|
3
|
+
(the primitive that owns drag) and adds [collapsed] reflected
|
|
4
|
+
state, localStorage persistence (adia-editor-sidebar-{name}),
|
|
5
|
+
and .toggle() / .collapse() / .expand() public API.
|
|
6
|
+
|
|
7
|
+
Sits inside <editor-shell> as slot="leading" (navigator pane) or
|
|
8
|
+
slot="trailing" (inspector pane). Mirrors the cluster-namespace
|
|
9
|
+
shape from <admin-sidebar> and <chat-sidebar>, but DELEGATES to
|
|
10
|
+
<pane-ui> for resize rather than reimplementing it (per
|
|
11
|
+
bespoke-shell-children skill §When NOT to promote — pane primitive
|
|
12
|
+
already owns this concern).
|
|
13
|
+
|
|
14
|
+
This is the FIRST bespoke shell child that delegates rather than
|
|
15
|
+
duplicates a primitive's behavior. Pattern is: cluster-namespace +
|
|
16
|
+
state-as-attribute + persistence at the bespoke tier; physical
|
|
17
|
+
drag at the primitive tier.
|
|
18
|
+
|
|
19
|
+
*
|
|
20
|
+
* @see https://ui-kit.exe.xyz/site/components/editor-sidebar
|
|
21
|
+
*
|
|
22
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
23
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
24
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
25
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
26
|
+
* needed beyond what the yaml `events:` block can express.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
30
|
+
|
|
31
|
+
export interface EditorSidebarSidebarToggleEventDetail {
|
|
32
|
+
expanded: string;
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type EditorSidebarSidebarToggleEvent = CustomEvent<EditorSidebarSidebarToggleEventDetail>;
|
|
37
|
+
|
|
38
|
+
export class UIEditorSidebar extends UIElement {
|
|
39
|
+
/** Reflected — set when inner <pane-ui> width is at or below 96px snap threshold. */
|
|
40
|
+
collapsed: boolean;
|
|
41
|
+
/** Reflected — set during an active pointer-drag of the pane's
|
|
42
|
+
resize handle. Used to disable transitions and visual treatments
|
|
43
|
+
that would feel laggy during drag.
|
|
44
|
+
*/
|
|
45
|
+
resizing: boolean;
|
|
46
|
+
|
|
47
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
48
|
+
type: K,
|
|
49
|
+
listener: (this: UIEditorSidebar, ev: HTMLElementEventMap[K]) => unknown,
|
|
50
|
+
options?: boolean | AddEventListenerOptions,
|
|
51
|
+
): void;
|
|
52
|
+
addEventListener(type: 'sidebar-toggle', listener: (ev: EditorSidebarSidebarToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
53
|
+
}
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"x-adiaui": {
|
|
30
30
|
"anti_patterns": [],
|
|
31
31
|
"category": "layout",
|
|
32
|
+
"composes": [],
|
|
32
33
|
"events": {
|
|
33
34
|
"toolbar-action": {
|
|
34
35
|
"description": "Bubbles when a child element with [data-toolbar-action] is clicked. Detail carries the action name from the clicked element's attribute.",
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<editor-toolbar-ui>` — Module-tier editor toolbar — replaces legacy <header> chrome bar
|
|
3
|
+
inside <editor-shell> per ADR-0023. Owns the [full-screen] reflected
|
|
4
|
+
attribute (set when host enters focus mode), click-bubble for
|
|
5
|
+
[data-toolbar-action] buttons, and slot vocabulary routing.
|
|
6
|
+
|
|
7
|
+
Sits at the top of <editor-shell>. Authors compose actions + status
|
|
8
|
+
via slot vocabulary. The host (<editor-shell>) reads either
|
|
9
|
+
<editor-toolbar> or <header> via :is() selector for backwards compat.
|
|
10
|
+
|
|
11
|
+
*
|
|
12
|
+
* @see https://ui-kit.exe.xyz/site/components/editor-toolbar
|
|
13
|
+
*
|
|
14
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
15
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
16
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
17
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
18
|
+
* needed beyond what the yaml `events:` block can express.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
22
|
+
|
|
23
|
+
export interface EditorToolbarToolbarActionEventDetail {
|
|
24
|
+
name: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type EditorToolbarToolbarActionEvent = CustomEvent<EditorToolbarToolbarActionEventDetail>;
|
|
28
|
+
|
|
29
|
+
export class UIEditorToolbar extends UIElement {
|
|
30
|
+
/** Reflected — set when editor is in distraction-free / focus mode. */
|
|
31
|
+
fullScreen: boolean;
|
|
32
|
+
|
|
33
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
34
|
+
type: K,
|
|
35
|
+
listener: (this: UIEditorToolbar, ev: HTMLElementEventMap[K]) => unknown,
|
|
36
|
+
options?: boolean | AddEventListenerOptions,
|
|
37
|
+
): void;
|
|
38
|
+
addEventListener(type: 'toolbar-action', listener: (ev: EditorToolbarToolbarActionEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/web-modules",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "AdiaUI composite custom elements — shell, chat, editor, runtime clusters built from @adia-ai/web-components primitives. Subpath exports per cluster.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<a2ui-root-ui>` — A2UI protocol surface. Connects to a stream source (SSE, WebSocket, JSONL, MCP) and renders A2UI messages as AdiaUI components via the `@adia-ai/a2ui-utils` renderer.
|
|
3
|
+
*
|
|
4
|
+
* @see https://ui-kit.exe.xyz/site/components/a2ui-root
|
|
5
|
+
*
|
|
6
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
7
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
8
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
9
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
10
|
+
* needed beyond what the yaml `events:` block can express.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
14
|
+
|
|
15
|
+
export type A2UIRootA2uiActionEvent = CustomEvent<unknown>;
|
|
16
|
+
export type A2UIRootA2uiClosedEvent = CustomEvent<unknown>;
|
|
17
|
+
export type A2UIRootA2uiConnectedEvent = CustomEvent<unknown>;
|
|
18
|
+
export type A2UIRootA2uiErrorEvent = CustomEvent<unknown>;
|
|
19
|
+
export type A2UIRootA2uiMessageEvent = CustomEvent<unknown>;
|
|
20
|
+
export type A2UIRootDocReplacedEvent = CustomEvent<unknown>;
|
|
21
|
+
|
|
22
|
+
export class UIA2UIRoot extends UIElement {
|
|
23
|
+
/** True while the stream is connected and receiving messages. */
|
|
24
|
+
active: boolean;
|
|
25
|
+
/** Batch renderer updates via requestAnimationFrame for large fan-in. */
|
|
26
|
+
batch: boolean;
|
|
27
|
+
/** Author-driven mode — set to an array of A2UI messages and the renderer resets + replays them. No network/transport involvement. Setting to a new array triggers a full re-render. Use this for editors, previews, tests, and any static-doc authoring loop. When both `src` and `doc` are set, `doc` wins (the stream is not opened). Pass as a JS property; not reflected to an attribute. */
|
|
28
|
+
doc: unknown[];
|
|
29
|
+
/** True while the stream is connecting. */
|
|
30
|
+
loading: boolean;
|
|
31
|
+
/** Stream source URL (endpoint for SSE/WebSocket, file path for JSONL, tool-call target for MCP). */
|
|
32
|
+
src: string;
|
|
33
|
+
/** Stream transport to use. */
|
|
34
|
+
transport: 'sse' | 'ws' | 'websocket' | 'jsonl' | 'mcp';
|
|
35
|
+
|
|
36
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
37
|
+
type: K,
|
|
38
|
+
listener: (this: UIA2UIRoot, ev: HTMLElementEventMap[K]) => unknown,
|
|
39
|
+
options?: boolean | AddEventListenerOptions,
|
|
40
|
+
): void;
|
|
41
|
+
addEventListener(type: 'a2ui-action', listener: (ev: A2UIRootA2uiActionEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
42
|
+
addEventListener(type: 'a2ui-closed', listener: (ev: A2UIRootA2uiClosedEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
43
|
+
addEventListener(type: 'a2ui-connected', listener: (ev: A2UIRootA2uiConnectedEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
44
|
+
addEventListener(type: 'a2ui-error', listener: (ev: A2UIRootA2uiErrorEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
45
|
+
addEventListener(type: 'a2ui-message', listener: (ev: A2UIRootA2uiMessageEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
46
|
+
addEventListener(type: 'doc-replaced', listener: (ev: A2UIRootDocReplacedEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
47
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<gen-root-ui>` — Composition shell for chat + canvas generative UI. Manages layout modes
|
|
3
|
+
(chat-only / split / canvas-only) and delegates a unified API across
|
|
4
|
+
child chat-ui, canvas-ui, and inspector-ui elements.
|
|
5
|
+
|
|
6
|
+
*
|
|
7
|
+
* @see https://ui-kit.exe.xyz/site/components/gen-root
|
|
8
|
+
*
|
|
9
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
10
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
11
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
12
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
13
|
+
* needed beyond what the yaml `events:` block can express.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
17
|
+
|
|
18
|
+
export class UIGenRoot extends UIElement {
|
|
19
|
+
/** Show the inspector pane (for debugging generated A2UI). */
|
|
20
|
+
inspector: boolean;
|
|
21
|
+
/** Layout mode — chat-only, 50/50 split, or canvas-only. */
|
|
22
|
+
mode: 'chat' | 'split' | 'canvas';
|
|
23
|
+
}
|
|
@@ -9,6 +9,12 @@ description: |
|
|
|
9
9
|
(chat-only / split / canvas-only) and delegates a unified API across
|
|
10
10
|
child chat-ui, canvas-ui, and inspector-ui elements.
|
|
11
11
|
|
|
12
|
+
# Per ADR-0027 — primitives that programmatically create other primitives
|
|
13
|
+
# do NOT auto-import them. Consumer (or demo shell) must explicitly import.
|
|
14
|
+
composes:
|
|
15
|
+
- chat-thread-ui
|
|
16
|
+
- canvas-ui
|
|
17
|
+
- inspector-ui
|
|
12
18
|
props:
|
|
13
19
|
mode:
|
|
14
20
|
type: string
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<admin-command-ui>` — Module-tier command palette wrapper — wraps a native <dialog> and the
|
|
3
|
+
inner <command-ui>. Owns the keyboard shortcut listener, focus
|
|
4
|
+
management, and dismiss handlers. Reflects [open].
|
|
5
|
+
|
|
6
|
+
Sits inside <admin-shell> as a direct child. The host wires
|
|
7
|
+
[data-command-trigger] elements to <admin-command>.show() via lookup.
|
|
8
|
+
|
|
9
|
+
This is the bespoke web-component replacement for the legacy
|
|
10
|
+
<dialog data-command> shape. <admin-shell> still recognizes the
|
|
11
|
+
legacy shape via :is() selector. New code should prefer <admin-command>.
|
|
12
|
+
|
|
13
|
+
*
|
|
14
|
+
* @see https://ui-kit.exe.xyz/site/components/admin-command
|
|
15
|
+
*
|
|
16
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
17
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
18
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
19
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
20
|
+
* needed beyond what the yaml `events:` block can express.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
24
|
+
|
|
25
|
+
export interface AdminCommandCommandSelectEventDetail {
|
|
26
|
+
value: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type AdminCommandCommandSelectEvent = CustomEvent<AdminCommandCommandSelectEventDetail>;
|
|
30
|
+
|
|
31
|
+
export class UIAdminCommand extends UIElement {
|
|
32
|
+
/** Reflected — set while the dialog is showing. Synced with both
|
|
33
|
+
programmatic .show()/.hide() and native dialog close events
|
|
34
|
+
(esc key, backdrop click).
|
|
35
|
+
*/
|
|
36
|
+
open: boolean;
|
|
37
|
+
/** Keyboard shortcut binding. "cmd+k" responds only on Mac
|
|
38
|
+
(metaKey); "ctrl+k" responds only when ctrlKey; "both" (default)
|
|
39
|
+
responds to either, which is the canonical AdiaUI behavior for
|
|
40
|
+
cross-platform Cmd+K affordance.
|
|
41
|
+
*/
|
|
42
|
+
shortcut: 'both' | 'cmd+k' | 'ctrl+k';
|
|
43
|
+
|
|
44
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
45
|
+
type: K,
|
|
46
|
+
listener: (this: UIAdminCommand, ev: HTMLElementEventMap[K]) => unknown,
|
|
47
|
+
options?: boolean | AddEventListenerOptions,
|
|
48
|
+
): void;
|
|
49
|
+
addEventListener(type: 'command-select', listener: (ev: AdminCommandCommandSelectEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<admin-shell-ui>` — Behavior-only application shell. Wires sidebar toggles, resize handles,
|
|
3
|
+
a Cmd+K command palette, and a ResizeObserver that drives responsive
|
|
4
|
+
sidebar collapse. Author supplies the DOM (aside[data-sidebar], main,
|
|
5
|
+
dialog[data-command]); admin-shell binds the interactions.
|
|
6
|
+
|
|
7
|
+
*
|
|
8
|
+
* @see https://ui-kit.exe.xyz/site/components/admin-shell
|
|
9
|
+
*
|
|
10
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
11
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
12
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
13
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
14
|
+
* needed beyond what the yaml `events:` block can express.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
18
|
+
|
|
19
|
+
export interface AppShellCommandSelectEventDetail {
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type AppShellCommandSelectEvent = CustomEvent<AppShellCommandSelectEventDetail>;
|
|
24
|
+
export interface AppShellSidebarResizeEventDetail {
|
|
25
|
+
sidebar: string;
|
|
26
|
+
width: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type AppShellSidebarResizeEvent = CustomEvent<AppShellSidebarResizeEventDetail>;
|
|
30
|
+
export interface AppShellSidebarToggleEventDetail {
|
|
31
|
+
expanded: string;
|
|
32
|
+
sidebar: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type AppShellSidebarToggleEvent = CustomEvent<AppShellSidebarToggleEventDetail>;
|
|
36
|
+
|
|
37
|
+
export class UIAppShell extends UIElement {
|
|
38
|
+
/** Layout variant — default is bordered surface; rounded softens edges; borderless removes the outer chrome. */
|
|
39
|
+
mode: '' | 'rounded' | 'borderless';
|
|
40
|
+
|
|
41
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
42
|
+
type: K,
|
|
43
|
+
listener: (this: UIAppShell, ev: HTMLElementEventMap[K]) => unknown,
|
|
44
|
+
options?: boolean | AddEventListenerOptions,
|
|
45
|
+
): void;
|
|
46
|
+
addEventListener(type: 'command-select', listener: (ev: AppShellCommandSelectEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
47
|
+
addEventListener(type: 'sidebar-resize', listener: (ev: AppShellSidebarResizeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
48
|
+
addEventListener(type: 'sidebar-toggle', listener: (ev: AppShellSidebarToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<admin-sidebar-ui>` — Module-tier shell sidebar — owns resize, snap-to-collapsed, persistence,
|
|
3
|
+
and the [collapsed] reflected attribute. Sits inside <admin-shell> as
|
|
4
|
+
slot="leading" or slot="trailing". Authors compose chrome bars + content
|
|
5
|
+
inside via slot vocabulary.
|
|
6
|
+
|
|
7
|
+
This is the bespoke web-component replacement for the legacy
|
|
8
|
+
<aside data-sidebar> shape. <admin-shell> still recognizes the legacy
|
|
9
|
+
shape via :is() selector for backwards compat. New code should prefer
|
|
10
|
+
<admin-sidebar>.
|
|
11
|
+
|
|
12
|
+
*
|
|
13
|
+
* @see https://ui-kit.exe.xyz/site/components/admin-sidebar
|
|
14
|
+
*
|
|
15
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
16
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
17
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
18
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
19
|
+
* needed beyond what the yaml `events:` block can express.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
23
|
+
|
|
24
|
+
export interface AdminSidebarSidebarResizeEventDetail {
|
|
25
|
+
name: string;
|
|
26
|
+
width: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type AdminSidebarSidebarResizeEvent = CustomEvent<AdminSidebarSidebarResizeEventDetail>;
|
|
30
|
+
export interface AdminSidebarSidebarToggleEventDetail {
|
|
31
|
+
expanded: string;
|
|
32
|
+
name: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type AdminSidebarSidebarToggleEvent = CustomEvent<AdminSidebarSidebarToggleEventDetail>;
|
|
36
|
+
|
|
37
|
+
export class UIAdminSidebar extends UIElement {
|
|
38
|
+
/** Reflected — set when the sidebar's measured width is at or below
|
|
39
|
+
96px. Consumers query this to style "collapsed mode" without
|
|
40
|
+
duplicating threshold math.
|
|
41
|
+
*/
|
|
42
|
+
collapsed: boolean;
|
|
43
|
+
/** Opts in to programmatic collapse — toggle button wiring + the
|
|
44
|
+
.toggle() / .collapse() / .expand() public methods.
|
|
45
|
+
*/
|
|
46
|
+
collapsible: boolean;
|
|
47
|
+
/** Identifier for localStorage namespacing. Defaults to slot value
|
|
48
|
+
("leading" or "trailing"). Override when running multiple sidebars
|
|
49
|
+
with the same slot.
|
|
50
|
+
*/
|
|
51
|
+
name: string;
|
|
52
|
+
/** Opts in to drag-to-resize behavior. Author supplies a child
|
|
53
|
+
[data-resize] element as the drag handle.
|
|
54
|
+
*/
|
|
55
|
+
resizable: boolean;
|
|
56
|
+
/** Reflected — set during an active pointer-drag on the resize handle.
|
|
57
|
+
Useful for suppressing transitions while dragging.
|
|
58
|
+
*/
|
|
59
|
+
resizing: boolean;
|
|
60
|
+
|
|
61
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
62
|
+
type: K,
|
|
63
|
+
listener: (this: UIAdminSidebar, ev: HTMLElementEventMap[K]) => unknown,
|
|
64
|
+
options?: boolean | AddEventListenerOptions,
|
|
65
|
+
): void;
|
|
66
|
+
addEventListener(type: 'sidebar-resize', listener: (ev: AdminSidebarSidebarResizeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
67
|
+
addEventListener(type: 'sidebar-toggle', listener: (ev: AdminSidebarSidebarToggleEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
68
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<simple-shell-ui>` — Module-tier minimal shell for marketing / landing / error pages.
|
|
3
|
+
Behavior-only orchestrator with two reflected attributes — [centered]
|
|
4
|
+
for vertical centering, [full-bleed] for dropping the max-width
|
|
5
|
+
constraint.
|
|
6
|
+
|
|
7
|
+
The 4th cluster in the bespoke shell family per ADR-0023, designed
|
|
8
|
+
deliberately small (1 host + 2 CSS-only children) to demonstrate
|
|
9
|
+
the pattern works without ceremony for thin clusters.
|
|
10
|
+
|
|
11
|
+
Use cases: marketing splashes, error pages (404 / 500 / maintenance),
|
|
12
|
+
thank-you pages, single-card flows (sign-in, password reset).
|
|
13
|
+
|
|
14
|
+
*
|
|
15
|
+
* @see https://ui-kit.exe.xyz/site/components/simple-shell
|
|
16
|
+
*
|
|
17
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
18
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
19
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
20
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
21
|
+
* needed beyond what the yaml `events:` block can express.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
25
|
+
|
|
26
|
+
export class UISimpleShell extends UIElement {
|
|
27
|
+
/** Reflected — vertically centers content in viewport. */
|
|
28
|
+
centered: boolean;
|
|
29
|
+
}
|
|
@@ -89,6 +89,15 @@
|
|
|
89
89
|
"x-adiaui": {
|
|
90
90
|
"anti_patterns": [],
|
|
91
91
|
"category": "layout",
|
|
92
|
+
"composes": [
|
|
93
|
+
"segmented-ui",
|
|
94
|
+
"segment-ui",
|
|
95
|
+
"text-ui",
|
|
96
|
+
"button-ui",
|
|
97
|
+
"divider-ui",
|
|
98
|
+
"field-ui",
|
|
99
|
+
"slider-ui"
|
|
100
|
+
],
|
|
92
101
|
"events": {
|
|
93
102
|
"theme-change": {
|
|
94
103
|
"description": "Bubbles when any user-visible state changes (theme click, slider\ninput, preset click, scheme flip, reset). One event per change.\nNo event on auto-rehydrate-from-storage at boot.\n",
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<theme-panel-ui>` — Module-tier appearance-preferences control surface. Owns the three knobs
|
|
3
|
+
of the AdiaUI theming contract: [data-theme=<slug>] named themes,
|
|
4
|
+
--a-density / --a-radius-k parametric overrides, and color-scheme
|
|
5
|
+
light/dark switching, plus optional localStorage persistence behind a
|
|
6
|
+
small attribute API.
|
|
7
|
+
|
|
8
|
+
Drops into any consumer's <popover-ui slot="content"> (the canonical
|
|
9
|
+
composition) or directly into a sidebar section. Eight named themes
|
|
10
|
+
ship by default; section visibility flips on/off via boolean attributes
|
|
11
|
+
([parametric], [presets], [scheme-toggle]).
|
|
12
|
+
|
|
13
|
+
Promoted from the duplicated <div id="theme-panel"> block in site/ and
|
|
14
|
+
playgrounds/admin-shell/ — see docs/specs/theme-panel-module.md.
|
|
15
|
+
|
|
16
|
+
*
|
|
17
|
+
* @see https://ui-kit.exe.xyz/site/components/theme-panel
|
|
18
|
+
*
|
|
19
|
+
* Type declarations generated by scripts/build/dts-codegen.mjs from
|
|
20
|
+
* the component's `.a2ui.json` sidecar. Edit the source `.yaml`,
|
|
21
|
+
* run `npm run build:components`, then `npm run codegen:dts` to
|
|
22
|
+
* regenerate; or hand-author this file fully if rich event types are
|
|
23
|
+
* needed beyond what the yaml `events:` block can express.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { UIElement } from '../../../web-components/core/element.js';
|
|
27
|
+
|
|
28
|
+
export interface ThemePanelThemeChangeEventDetail {
|
|
29
|
+
theme: string;
|
|
30
|
+
density: string;
|
|
31
|
+
radius: string;
|
|
32
|
+
scheme: string;
|
|
33
|
+
source: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type ThemePanelThemeChangeEvent = CustomEvent<ThemePanelThemeChangeEventDetail>;
|
|
37
|
+
|
|
38
|
+
export class UIThemePanel extends UIElement {
|
|
39
|
+
/** Renders the density + radius slider block. Sliders bind to
|
|
40
|
+
--a-density and --a-radius-k on the target element.
|
|
41
|
+
*/
|
|
42
|
+
parametric: boolean;
|
|
43
|
+
/** Persists selections to localStorage. Defaults to ephemeral so
|
|
44
|
+
playgrounds and embedded demos do not silently mutate a user's
|
|
45
|
+
docs-shell preferences.
|
|
46
|
+
*/
|
|
47
|
+
persist: boolean;
|
|
48
|
+
/** Renders the compact / reset / spacious preset row. Each preset
|
|
49
|
+
applies a (density, radius) pair; "default" also clears the
|
|
50
|
+
[data-theme] attribute.
|
|
51
|
+
*/
|
|
52
|
+
presets: boolean;
|
|
53
|
+
/** Initial color-scheme. "auto" follows prefers-color-scheme via a
|
|
54
|
+
matchMedia listener; user clicks on the scheme toggle promote to
|
|
55
|
+
an explicit light or dark choice.
|
|
56
|
+
*/
|
|
57
|
+
scheme: 'light' | 'dark' | 'auto';
|
|
58
|
+
/** CSS selector for the element that receives [data-theme] and
|
|
59
|
+
--a-density / --a-radius-k writes. Defaults to :root (the
|
|
60
|
+
<html> element). Scoped targets are useful for preview-pane
|
|
61
|
+
demos.
|
|
62
|
+
*/
|
|
63
|
+
target: string;
|
|
64
|
+
/** Space-separated list of theme slugs to render as buttons. Author
|
|
65
|
+
may restrict ([themes="default ocean"]) or extend. Tolerant —
|
|
66
|
+
unknown slugs render a button; clicking applies [data-theme=slug]
|
|
67
|
+
regardless of whether themes.css has a matching block.
|
|
68
|
+
*/
|
|
69
|
+
themes: string;
|
|
70
|
+
|
|
71
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
72
|
+
type: K,
|
|
73
|
+
listener: (this: UIThemePanel, ev: HTMLElementEventMap[K]) => unknown,
|
|
74
|
+
options?: boolean | AddEventListenerOptions,
|
|
75
|
+
): void;
|
|
76
|
+
addEventListener(type: 'theme-change', listener: (ev: ThemePanelThemeChangeEvent) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
77
|
+
}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
<link rel="stylesheet" href="../../../web-components/components/code/code.css">
|
|
24
24
|
<link rel="stylesheet" href="../../../web-components/components/tag/tag.css">
|
|
25
25
|
|
|
26
|
+
<link rel="stylesheet" href="../segment/segment.css">
|
|
26
27
|
<!-- Module CSS -->
|
|
27
28
|
<link rel="stylesheet" href="./theme-panel.css">
|
|
28
29
|
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
<script type="module" src="../../../web-components/components/code/code.js"></script>
|
|
39
40
|
<script type="module" src="../../../web-components/components/tag/tag.js"></script>
|
|
40
41
|
|
|
42
|
+
<script type="module" src="../segment/segment.js"></script>
|
|
41
43
|
<!-- Module JS -->
|
|
42
44
|
<script type="module" src="./theme-panel.js"></script>
|
|
43
45
|
|
|
@@ -20,6 +20,16 @@ description: |
|
|
|
20
20
|
Promoted from the duplicated <div id="theme-panel"> block in site/ and
|
|
21
21
|
playgrounds/admin-shell/ — see docs/specs/theme-panel-module.md.
|
|
22
22
|
|
|
23
|
+
# Per ADR-0027 — primitives that programmatically create other primitives
|
|
24
|
+
# do NOT auto-import them. Consumer (or demo shell) must explicitly import.
|
|
25
|
+
composes:
|
|
26
|
+
- segmented-ui
|
|
27
|
+
- segment-ui
|
|
28
|
+
- text-ui
|
|
29
|
+
- button-ui
|
|
30
|
+
- divider-ui
|
|
31
|
+
- field-ui
|
|
32
|
+
- slider-ui
|
|
23
33
|
props:
|
|
24
34
|
themes:
|
|
25
35
|
description: |
|