@adia-ai/web-components 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -22
- package/a2ui/index.js +1 -1
- package/components/chat/chat.css +1 -2
- package/components/code/code.css +2 -0
- package/components/pane/pane.css +2 -2
- package/package.json +2 -2
- package/patterns/adia-chat/css/adia-chat.tokens.css +1 -1
- package/patterns/adia-editor/adia-editor.a2ui.json +12 -0
- package/patterns/adia-editor/adia-editor.yaml +17 -0
- package/patterns/adia-editor/css/adia-editor.layout.css +70 -3
- package/patterns/adia-editor/css/adia-editor.tokens.css +1 -1
- package/patterns/app-shell/css/app-shell.tokens.css +1 -1
- package/styles/tokens.css +12 -0
- package/patterns/adia-chat/index.html +0 -93
- package/patterns/adia-editor/index.html +0 -179
- package/patterns/app-shell/index.html +0 -112
package/README.md
CHANGED
|
@@ -44,40 +44,45 @@ web-components/
|
|
|
44
44
|
│ ├── markdown.js lightweight markdown renderer
|
|
45
45
|
│ └── transport.js SSE / streaming helpers for LLM adapters
|
|
46
46
|
│
|
|
47
|
-
├── components/ — 80 *-
|
|
47
|
+
├── components/ — 80 *-ui custom elements
|
|
48
48
|
│ └── <tag>/
|
|
49
49
|
│ ├── <tag>.js class definition (extends AdiaElement)
|
|
50
50
|
│ ├── <tag>.css @scope(tag-ui) two-block: tokens + styles
|
|
51
51
|
│ ├── <tag>.yaml authoring contract (props, slots, events, examples)
|
|
52
52
|
│ └── <tag>.a2ui.json generated — do NOT edit
|
|
53
53
|
│
|
|
54
|
-
├── patterns/ — Higher-level compositions
|
|
55
|
-
│ ├── app-shell, app-nav
|
|
56
|
-
│ ├── adia-chat, adia-editor, gen-ui
|
|
57
|
-
│
|
|
54
|
+
├── patterns/ — Higher-level compositions
|
|
55
|
+
│ ├── app-shell, app-nav*, section-nav* — admin layout scaffolding
|
|
56
|
+
│ ├── adia-chat, adia-editor, gen-ui — LLM + editor + gen-UI patterns
|
|
57
|
+
│ ├── a2ui-root — A2UI declarative host (moved
|
|
58
|
+
│ │ from a2ui/ in 0.0.4; pairs
|
|
59
|
+
│ │ with @adia-ai/a2ui-utils)
|
|
60
|
+
│ └── index.js — registers all patterns
|
|
58
61
|
│
|
|
59
62
|
├── traits/ — 40 composable behaviors via defineTrait()
|
|
60
63
|
│ (pressable, focusTrap, confetti, resizable, …)
|
|
61
64
|
│
|
|
62
|
-
├── a2ui/ —
|
|
63
|
-
│
|
|
64
|
-
│
|
|
65
|
-
│
|
|
66
|
-
│
|
|
67
|
-
│
|
|
68
|
-
│
|
|
69
|
-
│ └── manifest-runtime.js surface manifest loader
|
|
65
|
+
├── a2ui/ — deprecation shim for one release
|
|
66
|
+
│ └── index.js Re-exports @adia-ai/a2ui-utils with a
|
|
67
|
+
│ one-time console.warn. Removed in 0.1.0.
|
|
68
|
+
│ All actual A2UI runtime code (renderer,
|
|
69
|
+
│ registry, streams, surface manifest,
|
|
70
|
+
│ wiring, dockables, controllers) lives in
|
|
71
|
+
│ `@adia-ai/a2ui-utils` at packages/a2ui/utils/.
|
|
70
72
|
│
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
│
|
|
77
|
-
└── scripts/ — Build + dev utilities
|
|
78
|
-
└── build-components.mjs YAML → .a2ui.json per-component
|
|
73
|
+
└── styles/ — Global tokens and CSS layering
|
|
74
|
+
├── tokens.css all --a-* design tokens
|
|
75
|
+
├── colors/ primitives / semantics / scrims
|
|
76
|
+
├── typography.css, space.css, radius.css, shadow.css
|
|
77
|
+
└── themes/*.css 8 themes (ocean, forest, sunset, …)
|
|
79
78
|
```
|
|
80
79
|
|
|
80
|
+
Build + dev utilities (including `build-a2ui-data.mjs`, `qa-training.mjs`,
|
|
81
|
+
`a2ui-to-html.cjs`, `mcp-call.cjs`, `mcp-pipeline.cjs`, `screenshot.cjs`)
|
|
82
|
+
live at the repo-root `scripts/` directory rather than inside this
|
|
83
|
+
package — they span the monorepo (MCP server, gen-ui-training data,
|
|
84
|
+
component catalog) and aren't scoped to web-components alone.
|
|
85
|
+
|
|
81
86
|
## Component contract
|
|
82
87
|
|
|
83
88
|
Every component is a single-file class extending `AdiaElement` (or
|
|
@@ -133,7 +138,9 @@ examples.
|
|
|
133
138
|
## A2UI runtime
|
|
134
139
|
|
|
135
140
|
```javascript
|
|
136
|
-
import { A2UIRenderer } from '@adia-ai/
|
|
141
|
+
import { A2UIRenderer } from '@adia-ai/a2ui-utils';
|
|
142
|
+
// (The old `@adia-ai/web-components/a2ui` subpath still resolves in 0.0.4
|
|
143
|
+
// via a deprecation shim that prints a console.warn; removed in 0.1.0.)
|
|
137
144
|
|
|
138
145
|
const renderer = new A2UIRenderer({ target: document.getElementById('canvas') });
|
|
139
146
|
renderer.apply({
|
package/a2ui/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* DEPRECATED — the `@adia-ai/web-components/a2ui` subpath.
|
|
3
3
|
*
|
|
4
4
|
* The A2UI runtime was extracted into its own package `@adia-ai/a2ui-utils`
|
|
5
|
-
* in 0.0.
|
|
5
|
+
* in 0.0.4. This file is a temporary re-export shim for one release so
|
|
6
6
|
* existing consumers don't break on upgrade. It will be removed in 0.1.0.
|
|
7
7
|
*
|
|
8
8
|
* Migrate:
|
package/components/chat/chat.css
CHANGED
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
--chat-messages-padding: var(--a-space-4);
|
|
11
11
|
--chat-messages-gap: var(--a-space-3);
|
|
12
12
|
--chat-footer-padding: var(--a-space-3);
|
|
13
|
-
|
|
14
|
-
--chat-footer-min-height: 36px;
|
|
13
|
+
--chat-footer-min-height: var(--a-chrome-pane-footer-height);
|
|
15
14
|
|
|
16
15
|
/* ── Motion ── */
|
|
17
16
|
--chat-cursor-duration: 0.8s;
|
package/components/code/code.css
CHANGED
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
flex-direction: row;
|
|
46
46
|
align-items: center;
|
|
47
47
|
justify-content: space-between;
|
|
48
|
+
min-height: var(--a-chrome-pane-header-height);
|
|
48
49
|
padding: var(--code-py) var(--code-px);
|
|
49
50
|
background: var(--code-header-bg);
|
|
50
51
|
border-bottom: 1px solid var(--code-border);
|
|
@@ -112,6 +113,7 @@
|
|
|
112
113
|
flex-direction: row;
|
|
113
114
|
align-items: center;
|
|
114
115
|
justify-content: space-between;
|
|
116
|
+
min-height: var(--a-chrome-pane-footer-height);
|
|
115
117
|
padding: var(--code-py) var(--code-px);
|
|
116
118
|
background: var(--code-header-bg);
|
|
117
119
|
border-top: 1px solid var(--code-border);
|
package/components/pane/pane.css
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
--pane-border: var(--a-border-subtle);
|
|
6
6
|
--pane-radius: var(--a-radius-lg);
|
|
7
7
|
/* Component-intrinsic measurement; no --a-space-* equivalent */
|
|
8
|
-
--pane-bar-height:
|
|
8
|
+
--pane-bar-height: var(--a-chrome-pane-header-height);
|
|
9
9
|
--pane-header-px: var(--a-space-3);
|
|
10
10
|
--pane-header-py: var(--a-space-2);
|
|
11
11
|
--pane-header-fg: var(--a-fg);
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
|
|
77
77
|
/* Collapse indicator — stamped by JS as icon-ui */
|
|
78
78
|
> header > [slot="chevron"] {
|
|
79
|
-
--a-icon-size:
|
|
79
|
+
--a-icon-size: var(--a-caret-size);
|
|
80
80
|
flex-shrink: 0;
|
|
81
81
|
margin-inline-start: auto;
|
|
82
82
|
color: var(--pane-chevron-fg);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/web-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "AdiaUI web components — vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-utils.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"./core/provider.js"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@adia-ai/a2ui-utils": "^0.0.
|
|
31
|
+
"@adia-ai/a2ui-utils": "^0.0.2"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
--chat-radius: unset;
|
|
10
10
|
|
|
11
11
|
/* Header */
|
|
12
|
-
--chat-header-height:
|
|
12
|
+
--chat-header-height: var(--a-chrome-app-header-height);
|
|
13
13
|
--chat-header-px: var(--a-space-4);
|
|
14
14
|
--chat-header-gap: var(--a-space-2);
|
|
15
15
|
--chat-header-border: 1px solid var(--a-border-subtle);
|
|
@@ -39,8 +39,20 @@
|
|
|
39
39
|
"Toolbar"
|
|
40
40
|
],
|
|
41
41
|
"slots": {
|
|
42
|
+
"description": {
|
|
43
|
+
"description": "Secondary metadata inside <header> or <footer> — document name, artboard size, zoom level, etc. Muted color, --a-ui-sm size."
|
|
44
|
+
},
|
|
42
45
|
"default": {
|
|
43
46
|
"description": "Author provides header, [data-editor-body] wrapping pane-ui[data-left], [data-canvas], pane-ui[data-right], and an optional footer."
|
|
47
|
+
},
|
|
48
|
+
"action": {
|
|
49
|
+
"description": "Trailing control cluster inside <header> or <footer>. The first [slot=\"action\"] child pushes itself (and siblings) to the end of the bar; subsequent [slot=\"action\"] siblings flow with gap."
|
|
50
|
+
},
|
|
51
|
+
"heading": {
|
|
52
|
+
"description": "Primary label inside <header> or <footer>. Rendered with --editor-title-weight + the strong foreground token."
|
|
53
|
+
},
|
|
54
|
+
"icon": {
|
|
55
|
+
"description": "Leading glyph inside <header> or <footer> — status dot, app icon, zoom badge, etc. Muted color, size-aware."
|
|
44
56
|
}
|
|
45
57
|
},
|
|
46
58
|
"states": [
|
|
@@ -20,6 +20,23 @@ slots:
|
|
|
20
20
|
description: >-
|
|
21
21
|
Author provides header, [data-editor-body] wrapping pane-ui[data-left],
|
|
22
22
|
[data-canvas], pane-ui[data-right], and an optional footer.
|
|
23
|
+
icon:
|
|
24
|
+
description: >-
|
|
25
|
+
Leading glyph inside <header> or <footer> — status dot, app icon,
|
|
26
|
+
zoom badge, etc. Muted color, size-aware.
|
|
27
|
+
heading:
|
|
28
|
+
description: >-
|
|
29
|
+
Primary label inside <header> or <footer>. Rendered with
|
|
30
|
+
--editor-title-weight + the strong foreground token.
|
|
31
|
+
description:
|
|
32
|
+
description: >-
|
|
33
|
+
Secondary metadata inside <header> or <footer> — document name,
|
|
34
|
+
artboard size, zoom level, etc. Muted color, --a-ui-sm size.
|
|
35
|
+
action:
|
|
36
|
+
description: >-
|
|
37
|
+
Trailing control cluster inside <header> or <footer>. The first
|
|
38
|
+
[slot="action"] child pushes itself (and siblings) to the end of
|
|
39
|
+
the bar; subsequent [slot="action"] siblings flow with gap.
|
|
23
40
|
|
|
24
41
|
states:
|
|
25
42
|
- name: idle
|
|
@@ -20,7 +20,16 @@ adia-editor-ui {
|
|
|
20
20
|
background: var(--editor-bg);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/* ── Top bar ──
|
|
23
|
+
/* ── Top bar ──
|
|
24
|
+
Slot contract (shared with > footer below):
|
|
25
|
+
[slot="icon"] leading glyph (status dot, app icon, etc.)
|
|
26
|
+
[slot="heading"] primary label; strong-weight token
|
|
27
|
+
[slot="description"] secondary metadata; muted
|
|
28
|
+
[slot="action"] trailing control cluster; first pushes to end
|
|
29
|
+
Authors may also place raw inline content (spans, buttons) directly
|
|
30
|
+
— those flow in source order. `[data-title]` / `<span data-spacer>`
|
|
31
|
+
are kept working for one release as deprecated hooks; migrate to
|
|
32
|
+
slots. */
|
|
24
33
|
adia-editor-ui > header {
|
|
25
34
|
display: flex;
|
|
26
35
|
align-items: center;
|
|
@@ -33,11 +42,36 @@ adia-editor-ui > header {
|
|
|
33
42
|
flex-shrink: 0;
|
|
34
43
|
}
|
|
35
44
|
|
|
36
|
-
adia-editor-ui > header [data-title]
|
|
45
|
+
adia-editor-ui > header [data-title],
|
|
46
|
+
adia-editor-ui > header > [slot="heading"] {
|
|
37
47
|
font-weight: var(--editor-title-weight);
|
|
38
48
|
color: var(--editor-bar-fg-strong);
|
|
39
49
|
}
|
|
40
50
|
|
|
51
|
+
adia-editor-ui > header > [slot="icon"] {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
color: var(--editor-bar-fg);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
adia-editor-ui > header > [slot="description"] {
|
|
59
|
+
color: var(--editor-bar-fg);
|
|
60
|
+
font-size: var(--a-ui-sm);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
adia-editor-ui > header > [slot="action"] {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: var(--editor-bar-gap);
|
|
67
|
+
flex-shrink: 0;
|
|
68
|
+
margin-inline-start: auto;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
adia-editor-ui > header > [slot="action"] ~ [slot="action"] {
|
|
72
|
+
margin-inline-start: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
41
75
|
/* ── Body: pane | canvas | pane ── */
|
|
42
76
|
adia-editor-ui > [data-editor-body] {
|
|
43
77
|
display: flex;
|
|
@@ -72,7 +106,11 @@ adia-editor-ui pane-ui[data-right] {
|
|
|
72
106
|
width: var(--editor-pane-width-right);
|
|
73
107
|
}
|
|
74
108
|
|
|
75
|
-
/* ── Bottom bar ──
|
|
109
|
+
/* ── Bottom bar ──
|
|
110
|
+
Same slot contract as > header above (icon / heading / description
|
|
111
|
+
/ action). Statusbar is structurally identical to the topbar —
|
|
112
|
+
both are 36px-min chrome bands with left-aligned label content and
|
|
113
|
+
a trailing action cluster. */
|
|
76
114
|
adia-editor-ui > footer {
|
|
77
115
|
display: flex;
|
|
78
116
|
align-items: center;
|
|
@@ -84,3 +122,32 @@ adia-editor-ui > footer {
|
|
|
84
122
|
color: var(--editor-bar-fg);
|
|
85
123
|
flex-shrink: 0;
|
|
86
124
|
}
|
|
125
|
+
|
|
126
|
+
adia-editor-ui > footer > [slot="heading"] {
|
|
127
|
+
font-weight: var(--editor-title-weight);
|
|
128
|
+
color: var(--editor-bar-fg-strong);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
adia-editor-ui > footer > [slot="icon"] {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
flex-shrink: 0;
|
|
135
|
+
color: var(--editor-bar-fg);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
adia-editor-ui > footer > [slot="description"] {
|
|
139
|
+
color: var(--editor-bar-fg);
|
|
140
|
+
font-size: var(--a-ui-sm);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
adia-editor-ui > footer > [slot="action"] {
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
gap: var(--editor-bar-gap);
|
|
147
|
+
flex-shrink: 0;
|
|
148
|
+
margin-inline-start: auto;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
adia-editor-ui > footer > [slot="action"] ~ [slot="action"] {
|
|
152
|
+
margin-inline-start: 0;
|
|
153
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
--editor-border: 1px solid var(--a-border-subtle);
|
|
9
9
|
|
|
10
10
|
/* Top/bottom bars */
|
|
11
|
-
--editor-bar-height:
|
|
11
|
+
--editor-bar-height: var(--a-chrome-pane-header-height);
|
|
12
12
|
--editor-bar-px: var(--a-space-3);
|
|
13
13
|
--editor-bar-gap: var(--a-space-2);
|
|
14
14
|
--editor-bar-font: var(--a-ui-size);
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
--page-main-border: var(--page-border); /* main inline borders (separate so modes can override) */
|
|
20
20
|
|
|
21
21
|
/* Header / footer bars — shared by topbar + bottombar */
|
|
22
|
-
--page-header-height:
|
|
22
|
+
--page-header-height: var(--a-chrome-app-header-height);
|
|
23
23
|
--page-header-px: var(--a-space-3);
|
|
24
24
|
--page-header-gap: var(--a-space-3);
|
|
25
25
|
--page-header-font: var(--a-ui-size);
|
package/styles/tokens.css
CHANGED
|
@@ -102,6 +102,18 @@
|
|
|
102
102
|
--a-size-lg: calc(var(--a-density) * 2.25rem); /* 36px at d=1 */
|
|
103
103
|
--a-size: var(--a-size-md);
|
|
104
104
|
|
|
105
|
+
/* ── Chrome heights — global app/feature UI ──
|
|
106
|
+
App-level chrome (top-level headers, footers, toolbars) is 48px;
|
|
107
|
+
pane-level chrome (pane headers, footers, toolbars) is 36px.
|
|
108
|
+
Fixed values — these are structural measurements, not typographic,
|
|
109
|
+
so they don't scale with --a-density. */
|
|
110
|
+
--a-chrome-app-header-height: 48px;
|
|
111
|
+
--a-chrome-app-footer-height: 48px;
|
|
112
|
+
--a-chrome-app-toolbar-height: 48px;
|
|
113
|
+
--a-chrome-pane-header-height: 36px;
|
|
114
|
+
--a-chrome-pane-footer-height: 36px;
|
|
115
|
+
--a-chrome-pane-toolbar-height: 36px;
|
|
116
|
+
|
|
105
117
|
/* ── Toggle-control size (check, radio, switch) ──
|
|
106
118
|
Tighter additive scale than --a-size: 16 / 20 / 24 px at d=1. */
|
|
107
119
|
--a-toggle-size: calc(var(--a-size-sm) - var(--a-space-1)); /* 20px at d=1 — md default */
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>AdiaUI — Chat</title>
|
|
7
|
-
<link rel="stylesheet" href="../../styles/tokens.css" />
|
|
8
|
-
<link rel="stylesheet" href="../../styles/styles.css" />
|
|
9
|
-
<link rel="stylesheet" href="adia-chat.css" />
|
|
10
|
-
<style>
|
|
11
|
-
body {
|
|
12
|
-
font-family: var(--a-font-family);
|
|
13
|
-
margin: 0;
|
|
14
|
-
height: 100dvh;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
19
|
-
</head>
|
|
20
|
-
<body>
|
|
21
|
-
|
|
22
|
-
<adia-chat-ui id="chat" proxy-url="/api/chat" model="claude-haiku-4-5-20251001"
|
|
23
|
-
style="flex:1; border:none; border-radius:0;">
|
|
24
|
-
<header>
|
|
25
|
-
<span data-chat-name>Factory Chat</span>
|
|
26
|
-
<span data-chat-status></span>
|
|
27
|
-
</header>
|
|
28
|
-
<section data-chat-messages>
|
|
29
|
-
<empty-state-ui data-chat-empty icon="chat-circle"
|
|
30
|
-
heading="AdiaUI Chat"
|
|
31
|
-
description="Type a message to start a conversation. Connects to LLM model via proxy if available.">
|
|
32
|
-
</empty-state-ui>
|
|
33
|
-
</section>
|
|
34
|
-
<footer>
|
|
35
|
-
<chat-input-ui data-chat-input placeholder="Message Claude..."></chat-input-ui>
|
|
36
|
-
</footer>
|
|
37
|
-
</adia-chat-ui>
|
|
38
|
-
|
|
39
|
-
<script type="module">
|
|
40
|
-
import '../../components/index.js';
|
|
41
|
-
import '../../patterns/index.js';
|
|
42
|
-
|
|
43
|
-
const chat = document.getElementById('chat');
|
|
44
|
-
|
|
45
|
-
// Wire the model picker inside chat-input-ui. Same list as
|
|
46
|
-
// /site/playground/gen-ui — extract to a shared constant when a third
|
|
47
|
-
// consumer appears.
|
|
48
|
-
customElements.whenDefined('chat-input-ui').then(() => {
|
|
49
|
-
const chatInput = chat.querySelector('[data-chat-input]');
|
|
50
|
-
if (!chatInput) return;
|
|
51
|
-
chatInput.models = [
|
|
52
|
-
{ label: 'Anthropic', options: [
|
|
53
|
-
{ value: 'claude-haiku-4-5-20251001', label: 'Haiku 4.5' },
|
|
54
|
-
{ value: 'claude-sonnet-4-6', label: 'Sonnet 4.6' },
|
|
55
|
-
]},
|
|
56
|
-
{ label: 'OpenAI', options: [
|
|
57
|
-
{ value: 'gpt-4o-mini', label: 'GPT-4o Mini' },
|
|
58
|
-
]},
|
|
59
|
-
{ label: 'Google', options: [
|
|
60
|
-
{ value: 'gemini-2.5-flash', label: 'Gemini 2.5 Flash' },
|
|
61
|
-
]},
|
|
62
|
-
];
|
|
63
|
-
chatInput.model = 'claude-haiku-4-5-20251001';
|
|
64
|
-
// Keep <adia-chat-ui>'s `model` attribute in lockstep with the chat-input
|
|
65
|
-
// picker so every send uses the user's current selection.
|
|
66
|
-
chatInput.addEventListener('change', () => {
|
|
67
|
-
if (chatInput.model) chat.setAttribute('model', chatInput.model);
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// Test proxy availability — fallback to simulated if not running
|
|
72
|
-
fetch('/api/chat', { method: 'OPTIONS' }).catch(() => {
|
|
73
|
-
chat.removeAttribute('proxy-url');
|
|
74
|
-
const empty = chat.querySelector('[data-chat-empty]');
|
|
75
|
-
if (empty) empty.setAttribute('description', 'No API proxy detected. Run `node server.js` with API keys. Responses are simulated.');
|
|
76
|
-
|
|
77
|
-
chat.addEventListener('submit', async (e) => {
|
|
78
|
-
const { text } = e.detail;
|
|
79
|
-
chat.appendMessage({ role: 'user', content: text });
|
|
80
|
-
chat.appendMessage({ role: 'assistant', content: '' });
|
|
81
|
-
chat.startStreaming();
|
|
82
|
-
|
|
83
|
-
const response = `You said: "${text}"\n\nThis is a **simulated** response.\n\n\`\`\`js\nconsole.log("Hello from AdiaUI!");\n\`\`\`\n\nStart the proxy with \`node server.js\` for real LLM responses.`;
|
|
84
|
-
for (const char of response) {
|
|
85
|
-
await new Promise(r => setTimeout(r, 12));
|
|
86
|
-
chat.appendChunk(char);
|
|
87
|
-
}
|
|
88
|
-
chat.stopStreaming();
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
</script>
|
|
92
|
-
</body>
|
|
93
|
-
</html>
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>AdiaUI — Editor</title>
|
|
7
|
-
<link rel="stylesheet" href="../../styles/tokens.css" />
|
|
8
|
-
<link rel="stylesheet" href="../../styles/styles.css" />
|
|
9
|
-
<link rel="stylesheet" href="adia-editor.css" />
|
|
10
|
-
<style>
|
|
11
|
-
body {
|
|
12
|
-
font-family: var(--a-font-family);
|
|
13
|
-
margin: 0;
|
|
14
|
-
height: 100dvh;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
19
|
-
</head>
|
|
20
|
-
<body>
|
|
21
|
-
|
|
22
|
-
<adia-editor-ui style="flex:1;">
|
|
23
|
-
<header>
|
|
24
|
-
<span data-title>AdiaUI</span>
|
|
25
|
-
<span data-spacer></span>
|
|
26
|
-
<button-ui icon="moon" variant="ghost" size="sm"></button-ui>
|
|
27
|
-
<button-ui icon="gear" variant="ghost" size="sm"></button-ui>
|
|
28
|
-
</header>
|
|
29
|
-
|
|
30
|
-
<div data-editor-body>
|
|
31
|
-
|
|
32
|
-
<!-- ═══ LEFT PANE — Navigator ═══ -->
|
|
33
|
-
<pane-ui data-left resizable>
|
|
34
|
-
<header>Navigator</header>
|
|
35
|
-
<section>
|
|
36
|
-
<header>Layers</header>
|
|
37
|
-
<tree-ui>
|
|
38
|
-
<tree-item-ui text="Page" icon="folder">
|
|
39
|
-
<tree-item-ui text="Header" icon="folder">
|
|
40
|
-
<tree-item-ui text="Logo" icon="folder"></tree-item-ui>
|
|
41
|
-
<tree-item-ui text="Nav" icon="folder">
|
|
42
|
-
<tree-item-ui text="Home" icon="folder"></tree-item-ui>
|
|
43
|
-
<tree-item-ui text="About" icon="folder"></tree-item-ui>
|
|
44
|
-
<tree-item-ui text="Contact" icon="folder"></tree-item-ui>
|
|
45
|
-
</tree-item-ui>
|
|
46
|
-
</tree-item-ui>
|
|
47
|
-
<tree-item-ui text="Hero" icon="folder">
|
|
48
|
-
<tree-item-ui text="Heading" icon="folder"></tree-item-ui>
|
|
49
|
-
<tree-item-ui text="Subheading" icon="folder"></tree-item-ui>
|
|
50
|
-
<tree-item-ui text="CTA Button" icon="folder"></tree-item-ui>
|
|
51
|
-
</tree-item-ui>
|
|
52
|
-
<tree-item-ui text="Card Grid" icon="folder">
|
|
53
|
-
<tree-item-ui text="Card 1" icon="folder"></tree-item-ui>
|
|
54
|
-
<tree-item-ui text="Card 2" icon="folder"></tree-item-ui>
|
|
55
|
-
<tree-item-ui text="Card 3" icon="folder"></tree-item-ui>
|
|
56
|
-
</tree-item-ui>
|
|
57
|
-
<tree-item-ui text="Footer" icon="folder">
|
|
58
|
-
<tree-item-ui text="Links" icon="folder"></tree-item-ui>
|
|
59
|
-
<tree-item-ui text="Copyright" icon="folder"></tree-item-ui>
|
|
60
|
-
</tree-item-ui>
|
|
61
|
-
</tree-item-ui>
|
|
62
|
-
</tree-ui>
|
|
63
|
-
</section>
|
|
64
|
-
</pane-ui>
|
|
65
|
-
|
|
66
|
-
<!-- ═══ CANVAS ═══ -->
|
|
67
|
-
<div data-canvas>Canvas</div>
|
|
68
|
-
|
|
69
|
-
<!-- ═══ RIGHT PANE — Inspector ═══ -->
|
|
70
|
-
<pane-ui data-right resizable>
|
|
71
|
-
<header>Inspector</header>
|
|
72
|
-
|
|
73
|
-
<section>
|
|
74
|
-
<header>Layout</header>
|
|
75
|
-
<div data-col style="padding:var(--a-space-2);">
|
|
76
|
-
<div style="display:grid; grid-template-columns:1fr 1fr; gap:var(--a-space-2);">
|
|
77
|
-
<input-ui prefix="X" placeholder="0" suffix="px"></input-ui>
|
|
78
|
-
<input-ui prefix="Y" placeholder="0" suffix="px"></input-ui>
|
|
79
|
-
<input-ui prefix="W" placeholder="auto" suffix="px"></input-ui>
|
|
80
|
-
<input-ui prefix="H" placeholder="auto" suffix="px"></input-ui>
|
|
81
|
-
</div>
|
|
82
|
-
<select-ui id="display-select" label="Display" placeholder="block"></select-ui>
|
|
83
|
-
<select-ui id="position-select" label="Position" placeholder="relative"></select-ui>
|
|
84
|
-
</div>
|
|
85
|
-
</section>
|
|
86
|
-
|
|
87
|
-
<section>
|
|
88
|
-
<header>Spacing</header>
|
|
89
|
-
<div data-col style="padding:var(--a-space-2);">
|
|
90
|
-
<div style="display:grid; grid-template-columns:1fr 1fr; gap:var(--a-space-2);">
|
|
91
|
-
<range-ui label="Padding" value="16" min="0" max="64" step="1" suffix="px"></range-ui>
|
|
92
|
-
<range-ui label="Margin" value="0" min="0" max="64" step="1" suffix="px"></range-ui>
|
|
93
|
-
<range-ui label="Gap" value="8" min="0" max="48" step="1" suffix="px"></range-ui>
|
|
94
|
-
<range-ui label="Radius" value="6" min="0" max="32" step="1" suffix="px"></range-ui>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
</section>
|
|
98
|
-
|
|
99
|
-
<section>
|
|
100
|
-
<header>Typography</header>
|
|
101
|
-
<div data-col style="padding:var(--a-space-2);">
|
|
102
|
-
<select-ui id="font-select" label="Family" placeholder="GT Standard"></select-ui>
|
|
103
|
-
<div style="display:grid; grid-template-columns:1fr 1fr; gap:var(--a-space-2);">
|
|
104
|
-
<range-ui label="Size" value="14" min="8" max="72" step="1" suffix="px"></range-ui>
|
|
105
|
-
<range-ui label="Weight" value="400" min="100" max="900" step="100"></range-ui>
|
|
106
|
-
<range-ui label="Leading" value="1.5" min="0.8" max="2.5" step="0.05"></range-ui>
|
|
107
|
-
<range-ui label="Tracking" value="0" min="-0.05" max="0.1" step="0.005" suffix="em"></range-ui>
|
|
108
|
-
</div>
|
|
109
|
-
<segmented-ui value="left">
|
|
110
|
-
<segment-ui value="left" text="Left"></segment-ui>
|
|
111
|
-
<segment-ui value="center" text="Center"></segment-ui>
|
|
112
|
-
<segment-ui value="right" text="Right"></segment-ui>
|
|
113
|
-
</segmented-ui>
|
|
114
|
-
</div>
|
|
115
|
-
</section>
|
|
116
|
-
|
|
117
|
-
<section>
|
|
118
|
-
<header>Appearance</header>
|
|
119
|
-
<div data-col style="padding:var(--a-space-2);">
|
|
120
|
-
<input-ui label="Background" placeholder="#000000" prefix="#"></input-ui>
|
|
121
|
-
<input-ui label="Border" placeholder="none"></input-ui>
|
|
122
|
-
<range-ui label="Opacity" value="1" min="0" max="1" step="0.01"></range-ui>
|
|
123
|
-
<select-ui id="overflow-select" label="Overflow" placeholder="visible"></select-ui>
|
|
124
|
-
</div>
|
|
125
|
-
</section>
|
|
126
|
-
|
|
127
|
-
<footer>
|
|
128
|
-
<button-ui text="Apply" variant="primary" stretch></button-ui>
|
|
129
|
-
</footer>
|
|
130
|
-
</pane-ui>
|
|
131
|
-
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
<footer>
|
|
135
|
-
<span>Ready</span>
|
|
136
|
-
<span data-spacer></span>
|
|
137
|
-
<span>1280 × 800</span>
|
|
138
|
-
<span>100%</span>
|
|
139
|
-
</footer>
|
|
140
|
-
</adia-editor-ui>
|
|
141
|
-
|
|
142
|
-
<script type="module">
|
|
143
|
-
import '../../components/index.js';
|
|
144
|
-
import '../../patterns/index.js';
|
|
145
|
-
|
|
146
|
-
customElements.whenDefined('select-ui').then(() => {
|
|
147
|
-
document.getElementById('display-select').options = [
|
|
148
|
-
{ value: 'block', label: 'Block' },
|
|
149
|
-
{ value: 'flex', label: 'Flex' },
|
|
150
|
-
{ value: 'grid', label: 'Grid' },
|
|
151
|
-
{ value: 'inline', label: 'Inline' },
|
|
152
|
-
{ value: 'none', label: 'None' },
|
|
153
|
-
];
|
|
154
|
-
document.getElementById('position-select').options = [
|
|
155
|
-
{ value: 'relative', label: 'Relative' },
|
|
156
|
-
{ value: 'absolute', label: 'Absolute' },
|
|
157
|
-
{ value: 'fixed', label: 'Fixed' },
|
|
158
|
-
{ value: 'sticky', label: 'Sticky' },
|
|
159
|
-
];
|
|
160
|
-
document.getElementById('font-select').options = [
|
|
161
|
-
{ label: 'Sans', options: [
|
|
162
|
-
{ value: 'gt-standard', label: 'GT Standard' },
|
|
163
|
-
{ value: 'supply-sans', label: 'Supply Sans' },
|
|
164
|
-
]},
|
|
165
|
-
{ label: 'Mono', options: [
|
|
166
|
-
{ value: 'gt-standard-mono', label: 'GT Standard Mono' },
|
|
167
|
-
{ value: 'supply-mono', label: 'Supply Mono' },
|
|
168
|
-
]},
|
|
169
|
-
];
|
|
170
|
-
document.getElementById('overflow-select').options = [
|
|
171
|
-
{ value: 'visible', label: 'Visible' },
|
|
172
|
-
{ value: 'hidden', label: 'Hidden' },
|
|
173
|
-
{ value: 'auto', label: 'Auto' },
|
|
174
|
-
{ value: 'scroll', label: 'Scroll' },
|
|
175
|
-
];
|
|
176
|
-
});
|
|
177
|
-
</script>
|
|
178
|
-
</body>
|
|
179
|
-
</html>
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>AdiaUI — App Shell</title>
|
|
7
|
-
<link rel="stylesheet" href="../../styles/tokens.css" />
|
|
8
|
-
<link rel="stylesheet" href="../../styles/styles.css" />
|
|
9
|
-
<link rel="stylesheet" href="app-shell.css" />
|
|
10
|
-
<link rel="stylesheet" href="app-nav.css" />
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
<app-shell-ui mode="rounded borderless">
|
|
14
|
-
|
|
15
|
-
<!-- ═══════════════ LEFT SIDEBAR ═══════════════ -->
|
|
16
|
-
<aside data-sidebar="leading">
|
|
17
|
-
<header>
|
|
18
|
-
<select-ui id="workspace-select" avatar="" value="adia-ui" variant="ghost" style="flex:1"></select-ui>
|
|
19
|
-
</header>
|
|
20
|
-
|
|
21
|
-
<section>
|
|
22
|
-
<app-nav-ui id="nav">
|
|
23
|
-
<app-nav-item-ui icon="magnifying-glass" text="Search" value="search">
|
|
24
|
-
<span slot="icon"><icon-ui name="magnifying-glass"></icon-ui></span>
|
|
25
|
-
<span slot="text">Search</span>
|
|
26
|
-
</app-nav-item-ui>
|
|
27
|
-
<hr data-nav-divider />
|
|
28
|
-
<app-nav-group-ui icon="house" text="Home">
|
|
29
|
-
<app-nav-item-ui text="Dashboard" value="dashboard" selected></app-nav-item-ui>
|
|
30
|
-
<app-nav-item-ui text="Analytics" value="analytics"></app-nav-item-ui>
|
|
31
|
-
<app-nav-item-ui text="Reports" value="reports"></app-nav-item-ui>
|
|
32
|
-
</app-nav-group-ui>
|
|
33
|
-
<app-nav-group-ui icon="gear" text="Settings">
|
|
34
|
-
<app-nav-item-ui text="General" value="general"></app-nav-item-ui>
|
|
35
|
-
<app-nav-item-ui text="Team" value="team"></app-nav-item-ui>
|
|
36
|
-
<app-nav-item-ui text="Billing" value="billing"></app-nav-item-ui>
|
|
37
|
-
</app-nav-group-ui>
|
|
38
|
-
</app-nav-ui>
|
|
39
|
-
</section>
|
|
40
|
-
|
|
41
|
-
<footer>
|
|
42
|
-
<select-ui id="user-select" avatar="https://i.pravatar.cc/32?u=demo" value="demo" variant="ghost" style="flex:1"></select-ui>
|
|
43
|
-
</footer>
|
|
44
|
-
<div data-resize></div>
|
|
45
|
-
</aside>
|
|
46
|
-
|
|
47
|
-
<!-- ═══════════════ MAIN ═══════════════ -->
|
|
48
|
-
<main>
|
|
49
|
-
<header>
|
|
50
|
-
<button-ui data-sidebar-toggle="leading" icon="sidebar" variant="ghost" size="sm"></button-ui>
|
|
51
|
-
<breadcrumb-ui>
|
|
52
|
-
<a href="#">Home</a>
|
|
53
|
-
<span>Dashboard</span>
|
|
54
|
-
</breadcrumb-ui>
|
|
55
|
-
<span data-spacer></span>
|
|
56
|
-
<div data-actions>
|
|
57
|
-
<button-ui icon="moon" variant="ghost" size="sm"></button-ui>
|
|
58
|
-
</div>
|
|
59
|
-
</header>
|
|
60
|
-
|
|
61
|
-
<section>
|
|
62
|
-
<article data-content-root>
|
|
63
|
-
<div data-content-header>
|
|
64
|
-
<header>
|
|
65
|
-
<div>
|
|
66
|
-
<h1>Dashboard</h1>
|
|
67
|
-
<div data-actions>
|
|
68
|
-
<button-ui text="Export" variant="outline" size="sm"></button-ui>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
<p>Welcome back. Here's what's happening.</p>
|
|
72
|
-
</header>
|
|
73
|
-
</div>
|
|
74
|
-
<div data-content-body>
|
|
75
|
-
<section data-tab-content>
|
|
76
|
-
<p style="color:var(--a-fg-muted); text-align:center;">
|
|
77
|
-
App Shell pattern demo. Resize the sidebar, toggle collapse, and explore the navigation.
|
|
78
|
-
</p>
|
|
79
|
-
</section>
|
|
80
|
-
</div>
|
|
81
|
-
</article>
|
|
82
|
-
</section>
|
|
83
|
-
|
|
84
|
-
<footer>
|
|
85
|
-
<span>AdiaUI App Shell</span>
|
|
86
|
-
<span data-spacer></span>
|
|
87
|
-
<span>v0.1.0</span>
|
|
88
|
-
</footer>
|
|
89
|
-
</main>
|
|
90
|
-
|
|
91
|
-
</app-shell-ui>
|
|
92
|
-
|
|
93
|
-
<script type="module">
|
|
94
|
-
import '../../components/index.js';
|
|
95
|
-
import '../../patterns/index.js';
|
|
96
|
-
|
|
97
|
-
customElements.whenDefined('select-ui').then(() => {
|
|
98
|
-
document.getElementById('workspace-select').options = [
|
|
99
|
-
{ label: 'Workspaces', options: [
|
|
100
|
-
{ value: 'adia-ui', icon: 'stack', label: 'AdiaUI' },
|
|
101
|
-
{ value: 'acme', icon: 'chart-bar', label: 'Acme App' },
|
|
102
|
-
]},
|
|
103
|
-
];
|
|
104
|
-
document.getElementById('user-select').options = [
|
|
105
|
-
{ header: true, avatar: 'https://i.pravatar.cc/32?u=demo', label: 'Demo User', description: 'demo@example.com' },
|
|
106
|
-
{ separator: true },
|
|
107
|
-
{ action: 'logout', icon: 'sign-out', label: 'Log out' },
|
|
108
|
-
];
|
|
109
|
-
});
|
|
110
|
-
</script>
|
|
111
|
-
</body>
|
|
112
|
-
</html>
|