@adia-ai/web-modules 0.4.7 → 0.4.9
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 +85 -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 +11 -0
- package/editor/editor-sidebar/editor-sidebar.d.ts +63 -0
- package/editor/editor-sidebar/editor-sidebar.js +13 -6
- package/editor/editor-sidebar/editor-sidebar.yaml +14 -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/editor/index.d.ts +5 -0
- package/editor/index.js +1 -0
- package/editor/utils.d.ts +8 -0
- package/editor/utils.js +47 -0
- package/package.json +9 -2
- 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
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { EditorShell } from './editor-shell/editor-shell.js';
|
|
2
|
+
export { EditorToolbar } from './editor-toolbar/editor-toolbar.js';
|
|
3
|
+
export { EditorCanvas } from './editor-canvas/editor-canvas.js';
|
|
4
|
+
export { EditorSidebar } from './editor-sidebar/editor-sidebar.js';
|
|
5
|
+
export { isFocusInInput } from './utils.js';
|
package/editor/index.js
CHANGED
|
@@ -2,3 +2,4 @@ export { EditorShell } from './editor-shell/editor-shell.js';
|
|
|
2
2
|
export { EditorToolbar } from './editor-toolbar/editor-toolbar.js';
|
|
3
3
|
export { EditorCanvas } from './editor-canvas/editor-canvas.js';
|
|
4
4
|
export { EditorSidebar } from './editor-sidebar/editor-sidebar.js';
|
|
5
|
+
export { isFocusInInput } from './utils.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when keyboard focus is currently inside a text-input surface
|
|
3
|
+
* (`<input>`, `<textarea>`, any `contenteditable` host, or an AdiaUI
|
|
4
|
+
* `<input-ui>` / `<textarea-ui>` / `<otp-input-ui>` / `<search-ui>`).
|
|
5
|
+
* Use this to guard global keyboard shortcuts so they don't fire while
|
|
6
|
+
* the user is typing.
|
|
7
|
+
*/
|
|
8
|
+
export function isFocusInInput(): boolean;
|
package/editor/utils.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Editor utilities — small helpers paired with the editor-shell cluster.
|
|
3
|
+
*
|
|
4
|
+
* Kept here (not in `@adia-ai/web-components/core`) because they're
|
|
5
|
+
* editor-cluster-shaped — they're useful when implementing the kind of
|
|
6
|
+
* keyboard model an editor app needs (panel-aware shortcuts that
|
|
7
|
+
* shouldn't fire while the user is typing). Core is for primitive
|
|
8
|
+
* authoring; this is for product-shell wiring.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* True when keyboard focus is currently inside a text-input surface
|
|
13
|
+
* (`<input>`, `<textarea>`, or any `contenteditable` host). Use this
|
|
14
|
+
* to guard global keyboard shortcuts so they don't fire while the user
|
|
15
|
+
* is typing.
|
|
16
|
+
*
|
|
17
|
+
* Works against the standard DOM `document.activeElement` + the
|
|
18
|
+
* `HTMLElement.isContentEditable` property, with the TypeScript cast
|
|
19
|
+
* boilerplate hidden:
|
|
20
|
+
*
|
|
21
|
+
* // Before
|
|
22
|
+
* const active = document.activeElement as HTMLElement | null;
|
|
23
|
+
* if (active?.tagName === 'INPUT' || active?.isContentEditable) return;
|
|
24
|
+
*
|
|
25
|
+
* // After
|
|
26
|
+
* if (isFocusInInput()) return;
|
|
27
|
+
*
|
|
28
|
+
* Also recognizes the AdiaUI text-input primitives (`<input-ui>`,
|
|
29
|
+
* `<textarea-ui>`, `<otp-input-ui>`, `<search-ui>`) — they extend
|
|
30
|
+
* `UIFormElement` and host a focused native `<input>`/`<textarea>` in
|
|
31
|
+
* their light-DOM subtree, but a stricter check on `tagName` would miss
|
|
32
|
+
* focus that lands on the host element directly.
|
|
33
|
+
*
|
|
34
|
+
* @returns {boolean}
|
|
35
|
+
*/
|
|
36
|
+
export function isFocusInInput() {
|
|
37
|
+
const active = /** @type {HTMLElement | null} */ (document.activeElement);
|
|
38
|
+
if (!active) return false;
|
|
39
|
+
const tag = active.tagName;
|
|
40
|
+
if (tag === 'INPUT' || tag === 'TEXTAREA') return true;
|
|
41
|
+
if (active.isContentEditable) return true;
|
|
42
|
+
// AdiaUI text-input primitives — focus may land on the host element
|
|
43
|
+
// when the inner native input isn't yet mounted, or on the inner
|
|
44
|
+
// native input itself (caught above).
|
|
45
|
+
if (tag === 'INPUT-UI' || tag === 'TEXTAREA-UI' || tag === 'OTP-INPUT-UI' || tag === 'SEARCH-UI') return true;
|
|
46
|
+
return false;
|
|
47
|
+
}
|
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.9",
|
|
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": {
|
|
@@ -11,7 +11,14 @@
|
|
|
11
11
|
"./chat": "./chat/index.js",
|
|
12
12
|
"./chat/*": "./chat/*/*.js",
|
|
13
13
|
"./chat/*.css": "./chat/*/*.css",
|
|
14
|
-
"./editor":
|
|
14
|
+
"./editor": {
|
|
15
|
+
"types": "./editor/index.d.ts",
|
|
16
|
+
"default": "./editor/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./editor/utils": {
|
|
19
|
+
"types": "./editor/utils.d.ts",
|
|
20
|
+
"default": "./editor/utils.js"
|
|
21
|
+
},
|
|
15
22
|
"./editor/*": "./editor/*/*.js",
|
|
16
23
|
"./editor/*.css": "./editor/*/*.css",
|
|
17
24
|
"./simple": "./simple/index.js",
|
|
@@ -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",
|