@adia-ai/web-modules 0.6.6 → 0.6.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.
Files changed (62) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +15 -1
  3. package/chat/chat-shell/chat-shell.js +1 -1
  4. package/generative/index.d.ts +11 -0
  5. package/generative/index.js +45 -0
  6. package/package.json +28 -1
  7. package/chat/chat-composer/chat-composer.examples.html +0 -28
  8. package/chat/chat-composer/chat-composer.html +0 -43
  9. package/chat/chat-empty/chat-empty.examples.html +0 -34
  10. package/chat/chat-empty/chat-empty.html +0 -42
  11. package/chat/chat-header/chat-header.examples.html +0 -30
  12. package/chat/chat-header/chat-header.html +0 -42
  13. package/chat/chat-shell/chat-shell.examples.html +0 -126
  14. package/chat/chat-shell/chat-shell.html +0 -42
  15. package/chat/chat-sidebar/chat-sidebar.examples.html +0 -36
  16. package/chat/chat-sidebar/chat-sidebar.html +0 -43
  17. package/chat/chat-status/chat-status.examples.html +0 -29
  18. package/chat/chat-status/chat-status.html +0 -42
  19. package/chat/chat-thread/chat-thread.examples.html +0 -36
  20. package/chat/chat-thread/chat-thread.html +0 -43
  21. package/editor/editor-canvas/editor-canvas.examples.html +0 -65
  22. package/editor/editor-canvas/editor-canvas.html +0 -43
  23. package/editor/editor-canvas-empty/editor-canvas-empty.examples.html +0 -65
  24. package/editor/editor-canvas-empty/editor-canvas-empty.html +0 -42
  25. package/editor/editor-canvas-toolbar/editor-canvas-toolbar.examples.html +0 -56
  26. package/editor/editor-canvas-toolbar/editor-canvas-toolbar.html +0 -42
  27. package/editor/editor-shell/editor-shell.examples.html +0 -71
  28. package/editor/editor-shell/editor-shell.html +0 -42
  29. package/editor/editor-sidebar/editor-sidebar.examples.html +0 -65
  30. package/editor/editor-sidebar/editor-sidebar.html +0 -43
  31. package/editor/editor-statusbar/editor-statusbar.examples.html +0 -65
  32. package/editor/editor-statusbar/editor-statusbar.html +0 -42
  33. package/editor/editor-toolbar/editor-toolbar.examples.html +0 -65
  34. package/editor/editor-toolbar/editor-toolbar.html +0 -43
  35. package/shell/admin-command/admin-command.examples.html +0 -83
  36. package/shell/admin-command/admin-command.html +0 -42
  37. package/shell/admin-content/admin-content.examples.html +0 -33
  38. package/shell/admin-content/admin-content.html +0 -42
  39. package/shell/admin-page/admin-page.examples.html +0 -37
  40. package/shell/admin-page/admin-page.html +0 -42
  41. package/shell/admin-page-body/admin-page-body.examples.html +0 -34
  42. package/shell/admin-page-body/admin-page-body.html +0 -42
  43. package/shell/admin-page-header/admin-page-header.examples.html +0 -34
  44. package/shell/admin-page-header/admin-page-header.html +0 -42
  45. package/shell/admin-scroll/admin-scroll.examples.html +0 -31
  46. package/shell/admin-scroll/admin-scroll.html +0 -42
  47. package/shell/admin-shell/admin-shell.examples.html +0 -181
  48. package/shell/admin-shell/admin-shell.html +0 -46
  49. package/shell/admin-sidebar/admin-sidebar.examples.html +0 -76
  50. package/shell/admin-sidebar/admin-sidebar.html +0 -47
  51. package/shell/admin-statusbar/admin-statusbar.examples.html +0 -29
  52. package/shell/admin-statusbar/admin-statusbar.html +0 -42
  53. package/shell/admin-topbar/admin-topbar.examples.html +0 -31
  54. package/shell/admin-topbar/admin-topbar.html +0 -42
  55. package/simple/simple-content/simple-content.examples.html +0 -13
  56. package/simple/simple-content/simple-content.html +0 -42
  57. package/simple/simple-hero/simple-hero.examples.html +0 -33
  58. package/simple/simple-hero/simple-hero.html +0 -42
  59. package/simple/simple-shell/simple-shell.examples.html +0 -42
  60. package/simple/simple-shell/simple-shell.html +0 -42
  61. package/theme/theme-panel/theme-panel.examples.html +0 -112
  62. package/theme/theme-panel/theme-panel.html +0 -75
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog — @adia-ai/web-modules
2
2
 
3
+ ## [0.6.8] — 2026-05-20
4
+
5
+ ### Fixed
6
+ - **`chat/chat-shell/chat-shell.js` — monorepo-absolute import broke the full barrel (claims-ui F-001, P0).** A single line at `chat-shell.js:4` imported `'/packages/web-components/components/code/code.js'`. The leading-`/` form resolves inside the AdiaUI monorepo (Vite roots at workspace) but breaks the full `@adia-ai/web-modules` barrel for every npm consumer with `Module not found`. Every sibling file in `web-modules/` (10 hits across chat/editor/theme/shell) used the correct `../../../web-components/...` relative form; this one line was the outlier and shipped across multiple releases. Fix: 1-char rewrite to the sibling pattern. Consumers using only the per-cluster subpaths (`@adia-ai/web-modules/shell`, `/chat`, `/editor`) were not affected; this fix restores the full-barrel `import '@adia-ai/web-modules'` entry point.
7
+
8
+ ### Docs
9
+ - **README.md — ⚠️ Required CSS callouts (claims-ui F-006).** Added prominent warnings above the §Import: CSS and §Quick start sections naming the four shell tags (`admin-shell`, `chat-shell`, `editor-shell`, `simple-shell`) and describing the unstyled-stacked-divs failure mode that follows from forgetting the per-cluster CSS import. The CSS imports were already listed in both sections, but at the same volume as the JS imports — these callouts shift signal weight, not content. Paired with the new skill §CSSPolicy section (skill v2.4.2) which codifies the normative explicit-CSS-import policy uniformly across primitives + shells.
10
+
11
+ ## [0.6.7] — 2026-05-19
12
+
13
+ ### Added
14
+ - **`@adia-ai/web-modules/generative` subpath barrel** — single import
15
+ registers `<canvas-ui>` + `<a2ui-root>` for generative UI surfaces.
16
+ Closes the cold-start footgun where the barrel didn't include these
17
+ primitives (per ADR-0027 they compose cross-package so they're not in
18
+ the default barrel).
19
+
20
+ ### Fixed
21
+ - **Exclude authoring artifacts from npm tarball** — 28 `.examples.html`
22
+ files were leaking into the published package; now filtered via the
23
+ `files` field exclusion patterns (matches web-components convention).
24
+
3
25
  ## [0.6.6] — 2026-05-18
4
26
 
5
27
  ### Changed
package/README.md CHANGED
@@ -35,6 +35,16 @@ import '@adia-ai/web-modules/runtime'; // gen-root + a2ui-root
35
35
 
36
36
  ## Import: CSS (since v0.4.5)
37
37
 
38
+ > ⚠️ **Required — shell layouts depend on this CSS.** Shell JS modules
39
+ > (`admin-shell`, `chat-shell`, `editor-shell`, `simple-shell`) do **not**
40
+ > self-import their layout CSS. Omitting the matching `*.css` import for
41
+ > any shell you use renders that shell as **unstyled stacked `<div>`
42
+ > elements** with no console error — sidebars stack above content,
43
+ > topbar/statusbar fall off the viewport grid, nothing throws. This is
44
+ > the #1 cold-start silent-failure mode reported by external consumers.
45
+ > If your shell looks like a vertical list of blocks, you missed a line
46
+ > below.
47
+
38
48
  CSS imports use the package specifier — the package's `exports` map resolves `.css` requests to the per-element stylesheet on disk:
39
49
 
40
50
  ```js
@@ -77,6 +87,10 @@ See [`bespoke-shell-children` skill](../../.agents/skills/bespoke-shell-children
77
87
 
78
88
  ESM-only — bundlers (Vite, esbuild, webpack 5+, Rollup) resolve `import` statements for both `.js` and `.css`; in plain HTML, use `<script type="module">` for JS and `<link>` for CSS.
79
89
 
90
+ > ⚠️ **Both JS AND CSS imports are required per cluster.** Importing only
91
+ > the JS gives you registered tags but no layout. See [Import: CSS](#import-css-since-v045)
92
+ > above for the failure mode.
93
+
80
94
  ```js
81
95
  // JS — register every primitive + the clusters you compose with
82
96
  import '@adia-ai/web-components'; // primitives + nav family
@@ -86,7 +100,7 @@ import '@adia-ai/web-modules/editor'; // editor-shell + bespoke children
86
100
  import '@adia-ai/web-modules/runtime'; // gen-root, a2ui-root (needs @adia-ai/a2ui-runtime)
87
101
  import '@adia-ai/web-modules/theme'; // theme-panel (appearance prefs)
88
102
 
89
- // CSS — one stylesheet per cluster you use
103
+ // CSS — one stylesheet per cluster you use (REQUIRED — see callout above)
90
104
  import '@adia-ai/web-components/css'; // every primitive's CSS
91
105
  import '@adia-ai/web-modules/shell/admin-shell.css';
92
106
  import '@adia-ai/web-modules/chat/chat-shell.css';
@@ -1,7 +1,7 @@
1
1
  import { UIElement } from '../../../web-components/core/element.js';
2
2
  import { renderMarkdown } from '../../../web-components/core/markdown.js';
3
3
  import { streamChat } from '../../../llm/index.js';
4
- import '/packages/web-components/components/code/code.js';
4
+ import '../../../web-components/components/code/code.js';
5
5
 
6
6
  function escapeHTML(s) {
7
7
  return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @adia-ai/web-modules/generative
3
+ *
4
+ * Convenience barrel for generative UI surfaces. See `index.js` for docs.
5
+ */
6
+
7
+ export { A2UIRoot } from '@adia-ai/web-modules/runtime';
8
+ export { UICanvas as Canvas } from '@adia-ai/web-components/components/canvas';
9
+ export {
10
+ registerResolver,
11
+ } from '@adia-ai/a2ui-runtime';
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @adia-ai/web-modules/generative
3
+ *
4
+ * Convenience barrel for generative UI surfaces. Imports + registers
5
+ * the two non-barrel primitives needed to render generated A2UI output:
6
+ *
7
+ * <a2ui-root> — A2UI protocol surface (stream + render)
8
+ * <canvas-ui> — High-level wrapper with history (back/forward/version)
9
+ *
10
+ * Why a separate barrel: per ADR-0027, primitives that compose
11
+ * cross-package primitives do NOT auto-register. canvas-ui composes
12
+ * a2ui-root + theme-ui across package boundaries, so neither is in
13
+ * the default barrels. This subpath bundles them for the common
14
+ * "I want to render generated UI in my app" use case.
15
+ *
16
+ * Usage:
17
+ *
18
+ * // Single import registers <canvas-ui> + <a2ui-root> + dependencies.
19
+ * import '@adia-ai/web-modules/generative';
20
+ *
21
+ * // Or import classes for programmatic construction:
22
+ * import { Canvas, A2UIRoot, registerResolver }
23
+ * from '@adia-ai/web-modules/generative';
24
+ *
25
+ * Pairs with the @adia-ai/a2ui-runtime registry (registerResolver, etc.)
26
+ * for wiring data sources to api:// + resource:// URIs.
27
+ */
28
+
29
+ // Side-effect: register <a2ui-root> custom element
30
+ import '@adia-ai/web-modules/runtime';
31
+
32
+ // Side-effect: register <canvas-ui> custom element
33
+ // (The "./components/*" subpath maps name -> components/name/name.js,
34
+ // so "components/canvas" resolves to "components/canvas/canvas.js".)
35
+ import '@adia-ai/web-components/components/canvas';
36
+
37
+ // Re-exports for programmatic use
38
+ export { A2UIRoot } from '@adia-ai/web-modules/runtime';
39
+ export { UICanvas as Canvas } from '@adia-ai/web-components/components/canvas';
40
+
41
+ // Re-export resolver registration so consumers can wire data sources
42
+ // without a second import.
43
+ export {
44
+ registerResolver,
45
+ } from '@adia-ai/a2ui-runtime';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adia-ai/web-modules",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "description": "AdiaUI composite custom elements \u2014 shell, chat, editor, runtime clusters built from @adia-ai/web-components primitives. Subpath exports per cluster.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -92,15 +92,42 @@
92
92
  "./theme/*.css": "./theme/*/*.css",
93
93
  "./theme/*/*.css": "./theme/*/*.css",
94
94
  "./theme/*/css/*.css": "./theme/*/css/*.css",
95
+ "./generative": {
96
+ "types": "./generative/index.d.ts",
97
+ "import": "./generative/index.js",
98
+ "default": "./generative/index.js"
99
+ },
95
100
  "./package.json": "./package.json"
96
101
  },
97
102
  "files": [
98
103
  "shell/",
104
+ "!shell/**/*.examples.html",
105
+ "!shell/**/*.examples.js",
106
+ "!shell/**/*.html",
99
107
  "chat/",
108
+ "!chat/**/*.examples.html",
109
+ "!chat/**/*.examples.js",
110
+ "!chat/**/*.html",
100
111
  "editor/",
112
+ "!editor/**/*.examples.html",
113
+ "!editor/**/*.examples.js",
114
+ "!editor/**/*.html",
101
115
  "simple/",
116
+ "!simple/**/*.examples.html",
117
+ "!simple/**/*.examples.js",
118
+ "!simple/**/*.html",
102
119
  "runtime/",
120
+ "!runtime/**/*.examples.html",
121
+ "!runtime/**/*.examples.js",
122
+ "!runtime/**/*.html",
103
123
  "theme/",
124
+ "!theme/**/*.examples.html",
125
+ "!theme/**/*.examples.js",
126
+ "!theme/**/*.html",
127
+ "generative/",
128
+ "!generative/**/*.examples.html",
129
+ "!generative/**/*.examples.js",
130
+ "!generative/**/*.html",
104
131
  "index.js",
105
132
  "README.md",
106
133
  "CHANGELOG.md"
@@ -1,28 +0,0 @@
1
- <header>
2
- <div>
3
- <h1>Chat Composer</h1>
4
- <div data-actions>
5
- <tag-ui size="sm">chat-composer</tag-ui>
6
- <tag-ui size="sm" variant="ghost">JS-bearing</tag-ui>
7
- </div>
8
- </div>
9
- <p>Module-tier chat composer wrapper — forwards submit events, propagates [disabled], slot vocabulary for future composer surfaces.</p>
10
- </header>
11
-
12
- <section data-section>
13
- <h2 variant="section">Role</h2>
14
- <p>Forwards inner submit events as <code>composer-submit</code>, propagates <code>[disabled]</code> to the inner input, slot vocabulary for future composer surfaces (file attach, autocomplete trigger, model picker). JS-bearing.</p>
15
- </section>
16
-
17
- <section data-section>
18
- <h2 variant="section">Composition</h2>
19
- <p>Typical placement inside <code>&lt;chat-shell&gt;</code>:</p>
20
- <code-ui language="html">&lt;chat-composer&gt;
21
- &lt;chat-input-ui placeholder="Message…" submit-on-enter&gt;&lt;/chat-input-ui&gt;
22
- &lt;/chat-composer&gt;</code-ui>
23
- </section>
24
-
25
- <section data-section>
26
- <h2 variant="section">Family</h2>
27
- <p>Per <a href="../../../../.brain/adrs/0023-bespoke-shell-tier-children.md">ADR-0023</a>, the chat cluster's bespoke family — <code>&lt;chat-shell&gt;</code> (host), <code>&lt;chat-thread&gt;</code>, <code>&lt;chat-composer&gt;</code>, <code>&lt;chat-sidebar&gt;</code> (JS-bearing) + <code>&lt;chat-header&gt;</code>, <code>&lt;chat-status&gt;</code>, <code>&lt;chat-empty&gt;</code> (CSS-only). Mirrors the admin cluster's pattern.</p>
28
- </section>
@@ -1,43 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en" data-theme="auto">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>Chat Composer — AdiaUI</title>
7
-
8
- <link rel="stylesheet" href="../../../web-components/styles/resets.css">
9
- <link rel="stylesheet" href="../../../web-components/styles/tokens.css">
10
- <link rel="stylesheet" href="../chat-shell/chat-shell.css">
11
- <link rel="stylesheet" href="../../../web-components/components/code/code.css">
12
- <link rel="stylesheet" href="../../../web-components/components/tag/tag.css">
13
-
14
- <script type="module" src="../chat-shell/chat-shell.js"></script>
15
- <script type="module" src="./chat-composer.js"></script>
16
- <script type="module" src="../../../web-components/components/code/code.js"></script>
17
- <script type="module" src="../../../web-components/components/tag/tag.js"></script>
18
-
19
- <style>
20
- :where(html, body) { margin: 0; min-height: 100vh; background: var(--a-bg); color: var(--a-fg); font-family: var(--a-font); }
21
- main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
22
- </style>
23
- </head>
24
- <body>
25
-
26
- <main id="demo-root">
27
- <p>Loading examples…</p>
28
- </main>
29
-
30
- <script type="module">
31
- const root = document.getElementById('demo-root');
32
- try {
33
- const res = await fetch('./chat-composer.examples.html');
34
- if (!res.ok) throw new Error(`fetch failed (${res.status})`);
35
- root.innerHTML = await res.text();
36
- } catch (err) {
37
- root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load chat-composer.examples.html — ${err.message}</p>`;
38
- console.error('[chat-composer.html]', err);
39
- }
40
- </script>
41
-
42
- </body>
43
- </html>
@@ -1,34 +0,0 @@
1
- <header>
2
- <div>
3
- <h1>Chat Empty</h1>
4
- <div data-actions>
5
- <tag-ui size="sm">chat-empty</tag-ui>
6
- <tag-ui size="sm" variant="ghost">CSS-only</tag-ui>
7
- </div>
8
- </div>
9
- <p>Module-tier chat empty state. CSS-only. Visibility driven by parent <chat-thread>'s [empty] reflected attribute.</p>
10
- </header>
11
-
12
- <section data-section>
13
- <h2 variant="section">Role</h2>
14
- <p>Empty state placeholder. CSS-only. Visibility driven automatically by parent <code>&lt;chat-thread&gt;</code>'s <code>[empty]</code> reflected attribute — no JS toggling needed.</p>
15
- </section>
16
-
17
- <section data-section>
18
- <h2 variant="section">Composition</h2>
19
- <p>Typical placement inside <code>&lt;chat-shell&gt;</code>:</p>
20
- <code-ui language="html">&lt;chat-thread&gt;
21
- &lt;chat-empty&gt;
22
- &lt;empty-state-ui
23
- icon="chat-circle"
24
- heading="Hello!"
25
- description="Ask me anything."&gt;&lt;/empty-state-ui&gt;
26
- &lt;/chat-empty&gt;
27
- &lt;!-- Messages get appended here; chat-empty auto-hides --&gt;
28
- &lt;/chat-thread&gt;</code-ui>
29
- </section>
30
-
31
- <section data-section>
32
- <h2 variant="section">Family</h2>
33
- <p>Per <a href="../../../../.brain/adrs/0023-bespoke-shell-tier-children.md">ADR-0023</a>, the chat cluster's bespoke family — <code>&lt;chat-shell&gt;</code> (host), <code>&lt;chat-thread&gt;</code>, <code>&lt;chat-composer&gt;</code>, <code>&lt;chat-sidebar&gt;</code> (JS-bearing) + <code>&lt;chat-header&gt;</code>, <code>&lt;chat-status&gt;</code>, <code>&lt;chat-empty&gt;</code> (CSS-only). Mirrors the admin cluster's pattern.</p>
34
- </section>
@@ -1,42 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en" data-theme="auto">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>Chat Empty — AdiaUI</title>
7
-
8
- <link rel="stylesheet" href="../../../web-components/styles/resets.css">
9
- <link rel="stylesheet" href="../../../web-components/styles/tokens.css">
10
- <link rel="stylesheet" href="../chat-shell/chat-shell.css">
11
- <link rel="stylesheet" href="../../../web-components/components/code/code.css">
12
- <link rel="stylesheet" href="../../../web-components/components/tag/tag.css">
13
-
14
- <script type="module" src="../chat-shell/chat-shell.js"></script>
15
- <script type="module" src="../../../web-components/components/code/code.js"></script>
16
- <script type="module" src="../../../web-components/components/tag/tag.js"></script>
17
-
18
- <style>
19
- :where(html, body) { margin: 0; min-height: 100vh; background: var(--a-bg); color: var(--a-fg); font-family: var(--a-font); }
20
- main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
21
- </style>
22
- </head>
23
- <body>
24
-
25
- <main id="demo-root">
26
- <p>Loading examples…</p>
27
- </main>
28
-
29
- <script type="module">
30
- const root = document.getElementById('demo-root');
31
- try {
32
- const res = await fetch('./chat-empty.examples.html');
33
- if (!res.ok) throw new Error(`fetch failed (${res.status})`);
34
- root.innerHTML = await res.text();
35
- } catch (err) {
36
- root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load chat-empty.examples.html — ${err.message}</p>`;
37
- console.error('[chat-empty.html]', err);
38
- }
39
- </script>
40
-
41
- </body>
42
- </html>
@@ -1,30 +0,0 @@
1
- <header>
2
- <div>
3
- <h1>Chat Header</h1>
4
- <div data-actions>
5
- <tag-ui size="sm">chat-header</tag-ui>
6
- <tag-ui size="sm" variant="ghost">CSS-only</tag-ui>
7
- </div>
8
- </div>
9
- <p>Module-tier chat top chrome bar. CSS-only. Holds chat name, status, and action clusters.</p>
10
- </header>
11
-
12
- <section data-section>
13
- <h2 variant="section">Role</h2>
14
- <p>Top chrome bar with slot vocabulary — name, status, action, action-leading clusters. Pure CSS-only stub styled by parent shell via tag-presence.</p>
15
- </section>
16
-
17
- <section data-section>
18
- <h2 variant="section">Composition</h2>
19
- <p>Typical placement inside <code>&lt;chat-shell&gt;</code>:</p>
20
- <code-ui language="html">&lt;chat-header&gt;
21
- &lt;span slot="name"&gt;Claude&lt;/span&gt;
22
- &lt;chat-status slot="status"&gt;Connected&lt;/chat-status&gt;
23
- &lt;button-ui slot="action" icon="gear" variant="ghost"&gt;&lt;/button-ui&gt;
24
- &lt;/chat-header&gt;
25
- </section>
26
-
27
- <section data-section>
28
- <h2 variant="section">Family</h2>
29
- <p>Per <a href="../../../../.brain/adrs/0023-bespoke-shell-tier-children.md">ADR-0023</a>, the chat cluster's bespoke family — <code>&lt;chat-shell&gt;</code> (host), <code>&lt;chat-thread&gt;</code>, <code>&lt;chat-composer&gt;</code>, <code>&lt;chat-sidebar&gt;</code> (JS-bearing) + <code>&lt;chat-header&gt;</code>, <code>&lt;chat-status&gt;</code>, <code>&lt;chat-empty&gt;</code> (CSS-only). Mirrors the admin cluster's pattern.</p>
30
- </section>
@@ -1,42 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en" data-theme="auto">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>Chat Header — AdiaUI</title>
7
-
8
- <link rel="stylesheet" href="../../../web-components/styles/resets.css">
9
- <link rel="stylesheet" href="../../../web-components/styles/tokens.css">
10
- <link rel="stylesheet" href="../chat-shell/chat-shell.css">
11
- <link rel="stylesheet" href="../../../web-components/components/code/code.css">
12
- <link rel="stylesheet" href="../../../web-components/components/tag/tag.css">
13
-
14
- <script type="module" src="../chat-shell/chat-shell.js"></script>
15
- <script type="module" src="../../../web-components/components/code/code.js"></script>
16
- <script type="module" src="../../../web-components/components/tag/tag.js"></script>
17
-
18
- <style>
19
- :where(html, body) { margin: 0; min-height: 100vh; background: var(--a-bg); color: var(--a-fg); font-family: var(--a-font); }
20
- main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
21
- </style>
22
- </head>
23
- <body>
24
-
25
- <main id="demo-root">
26
- <p>Loading examples…</p>
27
- </main>
28
-
29
- <script type="module">
30
- const root = document.getElementById('demo-root');
31
- try {
32
- const res = await fetch('./chat-header.examples.html');
33
- if (!res.ok) throw new Error(`fetch failed (${res.status})`);
34
- root.innerHTML = await res.text();
35
- } catch (err) {
36
- root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load chat-header.examples.html — ${err.message}</p>`;
37
- console.error('[chat-header.html]', err);
38
- }
39
- </script>
40
-
41
- </body>
42
- </html>
@@ -1,126 +0,0 @@
1
- <header>
2
- <div>
3
- <h1>Chat Shell</h1>
4
- <div data-actions>
5
- <tag-ui size="sm">chat-shell</tag-ui>
6
- <tag-ui size="sm" variant="ghost">module-tier</tag-ui>
7
- </div>
8
- </div>
9
- <p>Behavior-only chat orchestrator (LLM-streaming module). Author supplies the DOM structure via <code>[data-chat-messages]</code>, <code>[data-chat-input]</code>, <code>[data-chat-empty]</code>, <code>[data-chat-status]</code> elements; chat-shell wires message streaming, markdown rendering, code-block upgrades, and an LLM integration path via <code>proxy-url</code> (or via external submit).</p>
10
- </header>
11
-
12
- <section data-section>
13
- <h2 variant="section">Basic shape (legacy)</h2>
14
- <p data-note>Author provides the structural DOM; the shell binds the LLM streaming behavior and renders chunks into the messages container. This is the original raw-HTML authoring shape — still fully supported.</p>
15
- <code-ui language="html">&lt;chat-shell provider="anthropic" model="claude-sonnet-4-7" proxy-url="/api/llm"&gt;
16
- &lt;header&gt;
17
- &lt;span slot="heading"&gt;Chat&lt;/span&gt;
18
- &lt;span slot="description"&gt;claude-sonnet-4-7&lt;/span&gt;
19
- &lt;/header&gt;
20
-
21
- &lt;div data-chat-messages&gt;&lt;/div&gt;
22
- &lt;div data-chat-empty&gt;
23
- &lt;p&gt;Send a message to start.&lt;/p&gt;
24
- &lt;/div&gt;
25
-
26
- &lt;div data-chat-input&gt;
27
- &lt;input-ui placeholder="Ask anything..." submit-on-enter&gt;&lt;/input-ui&gt;
28
- &lt;/div&gt;
29
-
30
- &lt;div data-chat-status&gt;&lt;/div&gt;
31
- &lt;/chat-shell&gt;</code-ui>
32
- </section>
33
-
34
- <section data-section>
35
- <h2 variant="section">Basic shape (bespoke — recommended)</h2>
36
- <p data-note>The bespoke shape uses module-namespaced custom elements per <a href="../../../../.brain/adrs/0023-bespoke-shell-tier-children.md">ADR-0023</a>. Each child owns its own behavior + state attributes; queryable from outside via <code>:has(chat-thread[streaming])</code>.</p>
37
- <code-ui language="html">&lt;chat-shell provider="anthropic" model="claude-sonnet-4-7" proxy-url="/api/llm"&gt;
38
- &lt;chat-header&gt;
39
- &lt;span slot="name"&gt;Claude&lt;/span&gt;
40
- &lt;chat-status slot="status"&gt;Connected&lt;/chat-status&gt;
41
- &lt;/chat-header&gt;
42
-
43
- &lt;chat-thread&gt;
44
- &lt;chat-empty&gt;
45
- &lt;empty-state-ui icon="chat-circle" heading="Hello!" description="Ask me anything."&gt;&lt;/empty-state-ui&gt;
46
- &lt;/chat-empty&gt;
47
- &lt;/chat-thread&gt;
48
-
49
- &lt;chat-composer&gt;
50
- &lt;chat-input-ui placeholder="Message…" submit-on-enter&gt;&lt;/chat-input-ui&gt;
51
- &lt;/chat-composer&gt;
52
- &lt;/chat-shell&gt;</code-ui>
53
- </section>
54
-
55
- <section data-section>
56
- <h2 variant="section">State as attribute</h2>
57
- <p>Every queryable state is reflected on the relevant child element. Style cross-cuts via <code>:has()</code>:</p>
58
- <code-ui language="css">/* Subtle indicator while LLM is streaming */
59
- chat-shell:has(chat-thread[streaming]) chat-header {
60
- /* … */
61
- }
62
-
63
- /* Disable composer style during streaming */
64
- chat-shell:has(chat-composer[disabled]) {
65
- /* … */
66
- }
67
-
68
- /* Empty-state visibility — driven automatically */
69
- chat-thread:not([empty]) > chat-empty {
70
- display: none;
71
- }</code-ui>
72
- <p data-note>JS reads the same attributes — <code>shell.querySelector('chat-thread').streaming</code>. The host (<code>&lt;chat-shell&gt;</code>) propagates <code>[streaming]</code> to the bespoke <code>&lt;chat-thread&gt;</code> child automatically when an LLM response is in flight.</p>
73
- </section>
74
-
75
- <section data-section>
76
- <h2 variant="section">Properties</h2>
77
- <table>
78
- <thead><tr><th>Prop</th><th>Type</th><th>Default</th><th>Description</th></tr></thead>
79
- <tbody>
80
- <tr><td><code>provider</code></td><td>string</td><td>—</td><td>LLM provider name: <code>anthropic | openai | google | stub</code>.</td></tr>
81
- <tr><td><code>model</code></td><td>string</td><td>—</td><td>Model identifier (e.g. <code>claude-sonnet-4-7</code>, <code>gpt-4o</code>, <code>gemini-1.5-pro</code>).</td></tr>
82
- <tr><td><code>system</code></td><td>string</td><td>—</td><td>System prompt prepended to conversations.</td></tr>
83
- <tr><td><code>proxy-url</code></td><td>string</td><td>—</td><td>API proxy endpoint for LLM calls; enables self-contained chat without external submit handler.</td></tr>
84
- <tr><td><code>thinking</code></td><td>boolean</td><td><code>false</code></td><td>Enable Anthropic extended-thinking mode.</td></tr>
85
- <tr><td><code>streaming</code></td><td>boolean</td><td>—</td><td>Reflected — set while a response is streaming.</td></tr>
86
- </tbody>
87
- </table>
88
- </section>
89
-
90
- <section data-section>
91
- <h2 variant="section">Events</h2>
92
- <table>
93
- <thead><tr><th>Event</th><th>Detail</th></tr></thead>
94
- <tbody>
95
- <tr><td><code>submit</code></td><td><code>{ text, model }</code> — fired on user message submit before LLM call begins.</td></tr>
96
- <tr><td><code>chunk</code></td><td><code>{ text, role }</code> — fired for each streaming chunk.</td></tr>
97
- <tr><td><code>complete</code></td><td><code>{ text }</code> — fired when streaming finishes.</td></tr>
98
- <tr><td><code>error</code></td><td><code>{ error }</code> — fired on LLM call failures.</td></tr>
99
- </tbody>
100
- </table>
101
- </section>
102
-
103
- <section data-section>
104
- <h2 variant="section">Behavior wiring</h2>
105
- <table>
106
- <thead><tr><th>Affordance</th><th>Author markup</th><th>What the shell does</th></tr></thead>
107
- <tbody>
108
- <tr><td>Message stream</td><td><code>[data-chat-messages]</code></td><td>Each LLM chunk appended; markdown rendered; <code>code-ui</code> upgraded for code blocks.</td></tr>
109
- <tr><td>Input submit</td><td><code>[data-chat-input]</code> containing an <code>&lt;input-ui&gt;</code></td><td>Listens for input's submit event; calls LLM via <code>proxy-url</code> or fires <code>submit</code> for external handler.</td></tr>
110
- <tr><td>Empty state</td><td><code>[data-chat-empty]</code></td><td>Hidden when messages are present; shown when empty.</td></tr>
111
- <tr><td>Status indicator</td><td><code>[data-chat-status]</code></td><td>Updated with streaming/idle text.</td></tr>
112
- </tbody>
113
- </table>
114
- </section>
115
-
116
- <section data-section>
117
- <h2 variant="section">Family pattern (forward-looking)</h2>
118
- <p>Per <a href="../../../../.brain/adrs/0023-bespoke-shell-tier-children.md">ADR-0023</a>, future releases extend the bespoke-children family to the chat cluster. Planned children:</p>
119
- <ul data-features>
120
- <li><code>&lt;chat-thread&gt;</code> — replaces <code>[data-chat-messages]</code>; owns scroll-to-bottom, virtualization, message render</li>
121
- <li><code>&lt;chat-composer&gt;</code> — replaces <code>[data-chat-input]</code>; owns file attach, autocomplete, submit-on-enter</li>
122
- <li><code>&lt;chat-message&gt;</code> + <code>&lt;chat-message-list&gt;</code> — message-tier semantic markup</li>
123
- <li><code>&lt;chat-sidebar&gt;</code> — conversation history rail (mirrors <code>&lt;admin-sidebar&gt;</code>)</li>
124
- </ul>
125
- <p data-note>Today's <code>data-*</code> shape is fully supported and will continue to work alongside the bespoke vocabulary when it lands.</p>
126
- </section>
@@ -1,42 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en" data-theme="auto">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>Chat Shell — AdiaUI</title>
7
-
8
- <link rel="stylesheet" href="../../../web-components/styles/resets.css">
9
- <link rel="stylesheet" href="../../../web-components/styles/tokens.css">
10
- <link rel="stylesheet" href="./chat-shell.css">
11
- <link rel="stylesheet" href="../../../web-components/components/code/code.css">
12
- <link rel="stylesheet" href="../../../web-components/components/tag/tag.css">
13
-
14
- <script type="module" src="./chat-shell.js"></script>
15
- <script type="module" src="../../../web-components/components/code/code.js"></script>
16
- <script type="module" src="../../../web-components/components/tag/tag.js"></script>
17
-
18
- <style>
19
- :where(html, body) { margin: 0; min-height: 100vh; background: var(--a-bg); color: var(--a-fg); font-family: var(--a-font); }
20
- main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
21
- </style>
22
- </head>
23
- <body>
24
-
25
- <main id="demo-root">
26
- <p>Loading examples…</p>
27
- </main>
28
-
29
- <script type="module">
30
- const root = document.getElementById('demo-root');
31
- try {
32
- const res = await fetch('./chat-shell.examples.html');
33
- if (!res.ok) throw new Error(`fetch failed (${res.status})`);
34
- root.innerHTML = await res.text();
35
- } catch (err) {
36
- root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load chat-shell.examples.html — ${err.message}</p>`;
37
- console.error('[chat-shell.html]', err);
38
- }
39
- </script>
40
-
41
- </body>
42
- </html>
@@ -1,36 +0,0 @@
1
- <header>
2
- <div>
3
- <h1>Chat Sidebar</h1>
4
- <div data-actions>
5
- <tag-ui size="sm">chat-sidebar</tag-ui>
6
- <tag-ui size="sm" variant="ghost">JS-bearing</tag-ui>
7
- </div>
8
- </div>
9
- <p>Module-tier chat-cluster sidebar — mirrors admin-sidebar (resize + collapse + persist), cluster-namespaced for the chat family.</p>
10
- </header>
11
-
12
- <section data-section>
13
- <h2 variant="section">Role</h2>
14
- <p>Mirrors <code>&lt;admin-sidebar&gt;</code> — resize drag, snap-to-collapsed, localStorage persistence, ResizeObserver. Cluster-namespaced for the chat family. JS-bearing.</p>
15
- </section>
16
-
17
- <section data-section>
18
- <h2 variant="section">Composition</h2>
19
- <p>Typical placement inside <code>&lt;chat-shell&gt;</code>:</p>
20
- <code-ui language="html">&lt;chat-shell&gt;
21
- &lt;chat-sidebar slot="leading" resizable collapsible&gt;
22
- &lt;chat-header slot="header"&gt;
23
- &lt;span slot="name"&gt;Conversations&lt;/span&gt;
24
- &lt;/chat-header&gt;
25
- &lt;list-ui&gt;…conversation history…&lt;/list-ui&gt;
26
- &lt;div data-resize&gt;&lt;/div&gt;
27
- &lt;/chat-sidebar&gt;
28
- &lt;chat-thread&gt;…&lt;/chat-thread&gt;
29
- &lt;chat-composer&gt;…&lt;/chat-composer&gt;
30
- &lt;/chat-shell&gt;</code-ui>
31
- </section>
32
-
33
- <section data-section>
34
- <h2 variant="section">Family</h2>
35
- <p>Per <a href="../../../../.brain/adrs/0023-bespoke-shell-tier-children.md">ADR-0023</a>, the chat cluster's bespoke family — <code>&lt;chat-shell&gt;</code> (host), <code>&lt;chat-thread&gt;</code>, <code>&lt;chat-composer&gt;</code>, <code>&lt;chat-sidebar&gt;</code> (JS-bearing) + <code>&lt;chat-header&gt;</code>, <code>&lt;chat-status&gt;</code>, <code>&lt;chat-empty&gt;</code> (CSS-only). Mirrors the admin cluster's pattern.</p>
36
- </section>