@adia-ai/web-modules 0.4.6 → 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 +32 -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 +7 -0
- package/chat/chat-thread/chat-thread.d.ts +38 -0
- package/chat/chat-thread/chat-thread.yaml +58 -49
- 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
|
@@ -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
|
+
}
|