@adia-ai/web-modules 0.4.0 → 0.4.2
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 +30 -0
- package/README.md +29 -15
- package/editor/editor-shell/css/editor-shell.bespoke.css +7 -0
- package/editor/editor-shell/css/editor-shell.layout.css +15 -4
- package/editor/editor-sidebar/editor-sidebar.js +14 -2
- package/index.js +2 -0
- package/package.json +10 -3
- package/shell/admin-shell/css/admin-shell.main.css +35 -0
- package/simple/index.js +2 -0
- package/simple/simple-content/simple-content.a2ui.json +67 -0
- package/simple/simple-content/simple-content.css +29 -0
- package/simple/simple-content/simple-content.examples.html +13 -0
- package/simple/simple-content/simple-content.html +42 -0
- package/simple/simple-content/simple-content.yaml +54 -0
- package/simple/simple-hero/simple-hero.a2ui.json +76 -0
- package/simple/simple-hero/simple-hero.css +45 -0
- package/simple/simple-hero/simple-hero.examples.html +33 -0
- package/simple/simple-hero/simple-hero.html +42 -0
- package/simple/simple-hero/simple-hero.yaml +57 -0
- package/simple/simple-shell/simple-shell.a2ui.json +87 -0
- package/simple/simple-shell/simple-shell.css +40 -0
- package/simple/simple-shell/simple-shell.examples.html +42 -0
- package/simple/simple-shell/simple-shell.html +42 -0
- package/simple/simple-shell/simple-shell.js +47 -0
- package/simple/simple-shell/simple-shell.test.js +83 -0
- package/simple/simple-shell/simple-shell.yaml +78 -0
- package/theme/index.js +1 -0
- package/theme/theme-panel/theme-panel.a2ui.json +173 -0
- package/theme/theme-panel/theme-panel.css +50 -0
- package/theme/theme-panel/theme-panel.examples.html +104 -0
- package/theme/theme-panel/theme-panel.html +73 -0
- package/theme/theme-panel/theme-panel.js +533 -0
- package/theme/theme-panel/theme-panel.test.js +274 -0
- package/theme/theme-panel/theme-panel.yaml +213 -0
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,36 @@ Built from `@adia-ai/web-components` primitives.
|
|
|
11
11
|
|
|
12
12
|
_No pending changes._
|
|
13
13
|
|
|
14
|
+
## [0.4.2] - 2026-05-11
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **`<theme-panel>` module — new `theme/` cluster.** Module-tier appearance-preferences control surface. Owns the three knobs of the AdiaUI theming contract: `[data-theme]` named themes (8 built-in slugs + tolerant for custom), `--a-density` / `--a-radius-k` parametric overrides, and `color-scheme` light/dark switching, plus optional `localStorage` persistence behind a small attribute API ([`packages/web-modules/theme/theme-panel/`](./theme/theme-panel/)). Reflected state — `[active-theme]`, `[active-scheme]`, `[active-density]`, `[active-radius]` — lets external CSS / JS react via `:has(theme-panel[active-scheme="dark"])` patterns without listening to events. One `theme-change` event per user-visible change (source ∈ `theme | slider | preset | scheme | reset | programmatic`). Attribute API: `[themes="slug1 slug2…"]` (override default 8), `[parametric]` (renders density + radius sliders), `[presets]` (renders compact / reset / spacious preset row), `[scheme-toggle]` (renders inline light/dark toggle — absorbs the legacy standalone `#theme-toggle` button per OD-002=A). 23 unit tests. Promoted from the ~30-line inline `#theme-panel` block + ~90 LOC of controller wiring previously duplicated in `site/index.html` and `playgrounds/admin-shell/`. Spec: [`docs/specs/theme-panel-module.md`](../../docs/specs/theme-panel-module.md). Plan: [`docs/plans/theme-panel-module-2026-05-11.md`](../../docs/plans/theme-panel-module-2026-05-11.md). Commits `63d9deb4` (module Phase 1) + `a35d3131` (site consumer migration Phase 2; site.js −90 LOC + index.html −27 inline lines) + `c844aef4` (admin-shell playground consumer migration Phase 3; contents.html −25 lines + contents.js −48 LOC).
|
|
19
|
+
- **New subpath export `@adia-ai/web-modules/theme`** — consumers wanting just this cluster can `import '@adia-ai/web-modules/theme'` instead of the full barrel. `package.json` `exports` / `files` / `sideEffects` updated.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- **`<editor-sidebar>` wrapping a `<pane-ui>` no longer collapses to ~1px in CSS grid `auto`-tracked editor shells.** The wrapper's `ResizeObserver` (already observing the inner pane for `[collapsed]` reflection) now also mirrors `pane.offsetWidth` onto `this.style.width`. Without this mirror, the CSS-grid algorithm's intrinsic-size lookup on the bespoke wrapper does NOT propagate through to the inner `<pane-ui>`'s explicit width — the wrapper's `max-content` is reported as ~1px (the border), the grid `auto` track collapses, and the pane overflows visually into the canvas. Affects every `editor-shell:has(> editor-canvas)` host with bespoke sidebar children (a2ui-editor + construct-canvas; the `smoke:consumers` Playwright probe now verifies both have 240/280 px sidebars and the canvas claims the remainder). The [editor cluster `bespoke.css`](./editor/editor-shell/css/editor-shell.bespoke.css) is unchanged — the bug was always on the JS side of the width contract, not the layout CSS.
|
|
24
|
+
|
|
25
|
+
### Lockstep
|
|
26
|
+
|
|
27
|
+
9-package coordinated PATCH cut to v0.4.2 (per [`docs/specs/package-architecture.md` § 15](../../docs/specs/package-architecture.md#15-versioning-policy)). Internal `@adia-ai/*` dep ranges stay at `^0.4.0` (patch-cut asymmetry — `^0.4.0` covers `0.4.x` under semver). Source change scoped to one file (`editor/editor-sidebar/editor-sidebar.js`); rides alongside the `@adia-ai/web-components` v0.4.2 `<input-ui type="number">` rewrite. See root [CHANGELOG.md `## [0.4.2]`](../../CHANGELOG.md) for the cut narrative.
|
|
28
|
+
|
|
29
|
+
## [0.4.1] - 2026-05-10
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- **simple cluster — 4th bespoke shell family** per ADR-0023. Minimal shell for marketing / landing / error pages:
|
|
34
|
+
- `<simple-shell>` (host) — behavior-only orchestrator. 2 reflected attributes: `[centered]` (vertical center), `[full-bleed]` (drops max-width).
|
|
35
|
+
- `<simple-content>` (CSS-only) — article body container with token-correct vertical rhythm.
|
|
36
|
+
- `<simple-hero>` (CSS-only) — optional top strip with 3 named slots (`heading`, `lede`, `actions`).
|
|
37
|
+
- Subpath export: `@adia-ai/web-modules/simple`.
|
|
38
|
+
- 10 unit tests for `<simple-shell>`.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- Catalog count: 118 → 121 yamls (+3 from simple cluster children).
|
|
43
|
+
|
|
14
44
|
## [0.4.0] - 2026-05-10
|
|
15
45
|
|
|
16
46
|
**⚠️ BREAKING** — first non-patch release in the 0.x line. Closes the ADR-0023 arc per [ADR-0024](../../.brain/adrs/0024-legacy-shell-shapes-retired.md). All 6 in-repo consumers migrated in v0.3.6; this release retires the legacy authoring shapes from the shell hosts.
|
package/README.md
CHANGED
|
@@ -5,6 +5,10 @@ Composite custom elements built from
|
|
|
5
5
|
into clusters by use case; each cluster ships as a subpath export so
|
|
6
6
|
consumers install only what they need.
|
|
7
7
|
|
|
8
|
+
Each cluster carries a **shell host** (behavior-only orchestrator) plus
|
|
9
|
+
a **family of bespoke shell-tier children** (cluster-namespaced custom
|
|
10
|
+
elements with state-as-attribute semantics) per [ADR-0023](../../.brain/adrs/0023-bespoke-shell-tier-children.md). The bespoke vocabulary is the only recognized authoring shape since v0.4.0 ([ADR-0024](../../.brain/adrs/0024-legacy-shell-shapes-retired.md)).
|
|
11
|
+
|
|
8
12
|
> The patterns directory lived inside `@adia-ai/web-components` as
|
|
9
13
|
> `patterns/` until this package was extracted (see
|
|
10
14
|
> [ADR-0012](../../.brain/adrs/0012-three-tier-architecture-modules.md)).
|
|
@@ -13,16 +17,17 @@ consumers install only what they need.
|
|
|
13
17
|
|
|
14
18
|
## Clusters
|
|
15
19
|
|
|
16
|
-
| Cluster |
|
|
17
|
-
|
|
18
|
-
| `shell` | `<admin-shell>` (
|
|
19
|
-
| `chat` | `<chat-shell>` | Conversational surface — messages,
|
|
20
|
-
| `editor` | `<editor-shell>` |
|
|
21
|
-
| `runtime` | `<gen-root>`, `<a2ui-root>` | Render roots that turn JSON or gen-UI intents into live DOM. |
|
|
20
|
+
| Cluster | Host | Bespoke children | What's inside |
|
|
21
|
+
|---|---|---|---|
|
|
22
|
+
| `shell` | `<admin-shell>` | `<admin-sidebar>`, `<admin-command>` (JS-bearing); `<admin-content>`, `<admin-topbar>`, `<admin-statusbar>`, `<admin-scroll>`, `<admin-page>`, `<admin-page-header>`, `<admin-page-body>` (CSS-only); 9 children total | Admin-shell composition: sidebars, command palette, page chrome. Resize/collapse/persistence on `<admin-sidebar>`; Cmd+K palette on `<admin-command>`. |
|
|
23
|
+
| `chat` | `<chat-shell>` | `<chat-thread>`, `<chat-composer>`, `<chat-sidebar>` (JS-bearing); `<chat-empty>`, `<chat-header>`, `<chat-status>` (CSS-only); 6 children total | Conversational surface — streaming messages, composer with `[disabled]` propagation, scroll-to-bottom thread, `[streaming]` reflected. |
|
|
24
|
+
| `editor` | `<editor-shell>` | `<editor-toolbar>`, `<editor-canvas>`, `<editor-sidebar>` (JS-bearing); `<editor-statusbar>`, `<editor-canvas-empty>` (CSS-only); 5 children total | Design-tool surface — toolbar with `[full-screen]`, central canvas with `[focused]`/`[empty]`, sidebar wraps `<pane-ui resizable>` for delegation. |
|
|
25
|
+
| `runtime` | `<gen-root>`, `<a2ui-root>` | — | Render roots that turn JSON or gen-UI intents into live DOM. |
|
|
22
26
|
|
|
23
27
|
Future clusters on the strategic horizon: `data` (kanban, filters,
|
|
24
|
-
table-toolbar), `agent` (agent-trace, reasoning panels)
|
|
25
|
-
|
|
28
|
+
table-toolbar), `agent` (agent-trace, reasoning panels).
|
|
29
|
+
|
|
30
|
+
See [`bespoke-shell-children` skill](../../.agents/skills/bespoke-shell-children/SKILL.md) for the canonical decomposition recipe used by all three families.
|
|
26
31
|
|
|
27
32
|
## Quick start
|
|
28
33
|
|
|
@@ -35,17 +40,26 @@ table-toolbar), `agent` (agent-trace, reasoning panels), `admin`
|
|
|
35
40
|
|
|
36
41
|
<script type="module">
|
|
37
42
|
import '@adia-ai/web-components'; // primitives + nav family
|
|
38
|
-
import '@adia-ai/web-modules/shell'; // admin-shell
|
|
39
|
-
import '@adia-ai/web-modules/chat'; //
|
|
40
|
-
import '@adia-ai/web-modules/
|
|
43
|
+
import '@adia-ai/web-modules/shell'; // admin-shell + bespoke children
|
|
44
|
+
import '@adia-ai/web-modules/chat'; // chat-shell + bespoke children
|
|
45
|
+
import '@adia-ai/web-modules/editor'; // editor-shell + bespoke children
|
|
46
|
+
import '@adia-ai/web-modules/runtime'; // gen-root, a2ui-root
|
|
41
47
|
</script>
|
|
42
48
|
|
|
49
|
+
<!-- Bespoke shape (canonical since v0.4.0): -->
|
|
43
50
|
<admin-shell mode="rounded">
|
|
44
|
-
<
|
|
45
|
-
<header-ui
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
<admin-sidebar slot="leading" resizable collapsible>
|
|
52
|
+
<header-ui>
|
|
53
|
+
<span slot="heading">App</span>
|
|
54
|
+
</header-ui>
|
|
55
|
+
<section-ui>
|
|
56
|
+
<nav-ui>…</nav-ui>
|
|
57
|
+
</section-ui>
|
|
58
|
+
</admin-sidebar>
|
|
48
59
|
<main>…</main>
|
|
60
|
+
<admin-command>
|
|
61
|
+
<command-ui placeholder="Search..."></command-ui>
|
|
62
|
+
</admin-command>
|
|
49
63
|
</admin-shell>
|
|
50
64
|
```
|
|
51
65
|
|
|
@@ -71,6 +71,13 @@ editor-shell > editor-canvas {
|
|
|
71
71
|
min-width: 0;
|
|
72
72
|
display: flex;
|
|
73
73
|
flex-direction: column;
|
|
74
|
+
/* Stretch children to full width (layout.css's editor-shell editor-canvas
|
|
75
|
+
rule sets align-items: center for an empty-state placeholder, which
|
|
76
|
+
would otherwise leave #canvas-host at its min-width: 320px centered
|
|
77
|
+
inside the canvas region — leaving large empty space on either side.
|
|
78
|
+
The empty-state child handles its own centering separately. */
|
|
79
|
+
align-items: stretch;
|
|
80
|
+
justify-content: flex-start;
|
|
74
81
|
position: relative;
|
|
75
82
|
overflow: auto;
|
|
76
83
|
background: var(--editor-canvas-bg, var(--a-bg-subtle));
|
|
@@ -81,8 +81,13 @@ editor-shell > header > [slot="action-leading"] {
|
|
|
81
81
|
margin-inline-end: auto;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
/* ── Body: pane | canvas | pane ──
|
|
85
|
-
editor-shell
|
|
84
|
+
/* ── Body: pane | canvas | pane ──
|
|
85
|
+
Legacy raw-children body wrapper (pre-bespoke, when editor-shell was a
|
|
86
|
+
single flex column with a [data-body] wrapper around the pane/canvas
|
|
87
|
+
row). With <editor-canvas> + <editor-sidebar> bespoke children, the
|
|
88
|
+
grid layout in bespoke.css owns the body shape. This rule is kept
|
|
89
|
+
for any non-bespoke consumer still passing raw inner content. */
|
|
90
|
+
editor-shell > [data-body] {
|
|
86
91
|
display: flex;
|
|
87
92
|
flex: 1;
|
|
88
93
|
min-width: 0;
|
|
@@ -94,8 +99,14 @@ editor-shell editor-canvas {
|
|
|
94
99
|
flex: 1;
|
|
95
100
|
min-width: 0;
|
|
96
101
|
display: flex;
|
|
97
|
-
|
|
98
|
-
|
|
102
|
+
/* Children stretch to fill; the empty-state placeholder
|
|
103
|
+
(editor-canvas-empty) does its own centering via bespoke.css.
|
|
104
|
+
align-items: center here would shrink-wrap children to their
|
|
105
|
+
intrinsic width and center them — which leaves a 320px-min
|
|
106
|
+
#canvas-host centered inside a wide canvas region with empty
|
|
107
|
+
bands on both sides. */
|
|
108
|
+
align-items: stretch;
|
|
109
|
+
justify-content: flex-start;
|
|
99
110
|
background: var(--editor-canvas-bg);
|
|
100
111
|
color: var(--editor-canvas-fg);
|
|
101
112
|
}
|
|
@@ -77,8 +77,20 @@ class EditorSidebar extends UIElement {
|
|
|
77
77
|
// Restore persisted width
|
|
78
78
|
this.#restoreWidth();
|
|
79
79
|
|
|
80
|
-
// Observe inner pane width to maintain [collapsed] reflected
|
|
81
|
-
this
|
|
80
|
+
// Observe inner pane width to (a) maintain [collapsed] reflected and
|
|
81
|
+
// (b) mirror the width onto this wrapper so the parent's grid track
|
|
82
|
+
// sizes correctly. Without the mirror, an `auto`/`max-content` grid
|
|
83
|
+
// track on the wrapping editor-sidebar collapses to ~1px because the
|
|
84
|
+
// intrinsic-size lookup doesn't propagate through to <pane-ui>'s
|
|
85
|
+
// explicit width — the pane then overflows out of the sidebar and
|
|
86
|
+
// visually overlaps the canvas.
|
|
87
|
+
this.#ro = new ResizeObserver((entries) => {
|
|
88
|
+
this.#syncCollapsed();
|
|
89
|
+
// Use offsetWidth so the sidebar wraps the full pane border-box
|
|
90
|
+
// (contentRect would be 1px short on side="leading|trailing").
|
|
91
|
+
const w = this.#pane.offsetWidth;
|
|
92
|
+
if (w > 0) this.style.width = `${w}px`;
|
|
93
|
+
});
|
|
82
94
|
this.#ro.observe(this.#pane);
|
|
83
95
|
|
|
84
96
|
// Track resize via pointerdown on resize-handle children of the pane
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/web-modules",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "AdiaUI composite custom elements
|
|
3
|
+
"version": "0.4.2",
|
|
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": {
|
|
7
7
|
".": "./index.js",
|
|
@@ -11,15 +11,21 @@
|
|
|
11
11
|
"./chat/*": "./chat/*/*.js",
|
|
12
12
|
"./editor": "./editor/index.js",
|
|
13
13
|
"./editor/*": "./editor/*/*.js",
|
|
14
|
+
"./simple": "./simple/index.js",
|
|
15
|
+
"./simple/*": "./simple/*/*.js",
|
|
14
16
|
"./runtime": "./runtime/index.js",
|
|
15
17
|
"./runtime/*": "./runtime/*/*.js",
|
|
18
|
+
"./theme": "./theme/index.js",
|
|
19
|
+
"./theme/*": "./theme/*/*.js",
|
|
16
20
|
"./package.json": "./package.json"
|
|
17
21
|
},
|
|
18
22
|
"files": [
|
|
19
23
|
"shell/",
|
|
20
24
|
"chat/",
|
|
21
25
|
"editor/",
|
|
26
|
+
"simple/",
|
|
22
27
|
"runtime/",
|
|
28
|
+
"theme/",
|
|
23
29
|
"index.js",
|
|
24
30
|
"README.md",
|
|
25
31
|
"CHANGELOG.md"
|
|
@@ -30,7 +36,8 @@
|
|
|
30
36
|
"./shell/**/*.js",
|
|
31
37
|
"./chat/**/*.js",
|
|
32
38
|
"./editor/**/*.js",
|
|
33
|
-
"./runtime/**/*.js"
|
|
39
|
+
"./runtime/**/*.js",
|
|
40
|
+
"./theme/**/*.js"
|
|
34
41
|
],
|
|
35
42
|
"peerDependencies": {
|
|
36
43
|
"@adia-ai/web-components": "^0.4.0",
|
|
@@ -122,6 +122,41 @@ admin-shell > main > :is(section, section-ui) {
|
|
|
122
122
|
|
|
123
123
|
admin-shell > main > :is(section, section-ui)::-webkit-scrollbar { display: none; }
|
|
124
124
|
|
|
125
|
+
/* ── Subnav rail layout ──
|
|
126
|
+
When the main section contains an `[data-subnav]` aside (the
|
|
127
|
+
left-rail nav pattern — `<aside data-subnav>` followed by the
|
|
128
|
+
`[data-content-root]` article), grid-layout the section so the
|
|
129
|
+
rail sits on the inline-start side and the content fills the
|
|
130
|
+
rest. Mirrors the docs-site convention (site.css `:has(#subnav-rail)`)
|
|
131
|
+
so consumer apps using admin-shell + the subnav-rail authoring
|
|
132
|
+
shape get the canonical layout for free. */
|
|
133
|
+
admin-shell > main > :is(section, section-ui):has(> [data-subnav]:not([hidden])) {
|
|
134
|
+
display: grid;
|
|
135
|
+
grid-template-columns: var(--subnav-width, 14rem) 1fr;
|
|
136
|
+
grid-template-rows: minmax(0, 1fr);
|
|
137
|
+
gap: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
admin-shell > main > :is(section, section-ui) > [data-subnav] {
|
|
141
|
+
min-height: 0;
|
|
142
|
+
overflow-y: auto;
|
|
143
|
+
overscroll-behavior: contain;
|
|
144
|
+
border-inline-end: 1px solid var(--a-border-subtle);
|
|
145
|
+
padding-block: var(--a-space-2);
|
|
146
|
+
padding-inline: var(--a-space-2);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/* Mobile: collapse to single column; subnav stacks above content. */
|
|
150
|
+
@container (max-width: 40rem) {
|
|
151
|
+
admin-shell > main > :is(section, section-ui):has(> [data-subnav]:not([hidden])) {
|
|
152
|
+
grid-template-columns: 1fr;
|
|
153
|
+
}
|
|
154
|
+
admin-shell > main > :is(section, section-ui) > [data-subnav] {
|
|
155
|
+
border-inline-end: none;
|
|
156
|
+
border-block-end: 1px solid var(--a-border-subtle);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
125
160
|
/* ── Main > footer (status bar) ──
|
|
126
161
|
Legacy pattern: last-child auto-pushed to trailing edge via
|
|
127
162
|
margin-inline-start: auto (works when authors use a simple
|
package/simple/index.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/SimpleContent.json",
|
|
4
|
+
"title": "SimpleContent",
|
|
5
|
+
"description": "Module-tier article-body container. CSS-only — no JS, no state.\nSits inside <simple-shell> as the main content surface with\ntoken-correct vertical rhythm and prose-friendly max-width.\n\nCompanion to <simple-hero> (optional top strip) per ADR-0023\nbespoke shell-tier children.\n",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"component": {
|
|
17
|
+
"const": "SimpleContent"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"required": [
|
|
21
|
+
"component"
|
|
22
|
+
],
|
|
23
|
+
"unevaluatedProperties": false,
|
|
24
|
+
"x-adiaui": {
|
|
25
|
+
"anti_patterns": [],
|
|
26
|
+
"category": "shells",
|
|
27
|
+
"events": {},
|
|
28
|
+
"examples": [],
|
|
29
|
+
"keywords": [
|
|
30
|
+
"simple-content",
|
|
31
|
+
"article",
|
|
32
|
+
"body",
|
|
33
|
+
"prose",
|
|
34
|
+
"main-content",
|
|
35
|
+
"landing-body",
|
|
36
|
+
"marketing-body"
|
|
37
|
+
],
|
|
38
|
+
"name": "SimpleContent",
|
|
39
|
+
"related": [
|
|
40
|
+
"SimpleShell",
|
|
41
|
+
"SimpleHero"
|
|
42
|
+
],
|
|
43
|
+
"slots": {
|
|
44
|
+
"default": {
|
|
45
|
+
"description": "Article body content — prose, code blocks, illustrations. Authors compose freely; <simple-content> provides only the container with sensible defaults (vertical rhythm, max-width, typography token application)."
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"states": [
|
|
49
|
+
{
|
|
50
|
+
"description": "Default, visible.",
|
|
51
|
+
"name": "idle"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"synonyms": {
|
|
55
|
+
"simple-content": [
|
|
56
|
+
"page-content",
|
|
57
|
+
"article-body",
|
|
58
|
+
"prose-container",
|
|
59
|
+
"main-body"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"tag": "simple-content",
|
|
63
|
+
"tokens": {},
|
|
64
|
+
"traits": [],
|
|
65
|
+
"version": 1
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
simple-content — Article body container
|
|
3
|
+
|
|
4
|
+
CSS-only structural child of <simple-shell>. Provides token-correct
|
|
5
|
+
vertical rhythm + prose-friendly max-width for article body content.
|
|
6
|
+
═══════════════════════════════════════════════════════════════ */
|
|
7
|
+
|
|
8
|
+
@scope (simple-content) {
|
|
9
|
+
:scope {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: var(--a-density-4, 1.5rem);
|
|
13
|
+
width: 100%;
|
|
14
|
+
color: var(--a-text);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Typographic rhythm for prose children */
|
|
18
|
+
:scope > h1,
|
|
19
|
+
:scope > h2,
|
|
20
|
+
:scope > h3 {
|
|
21
|
+
margin: 0;
|
|
22
|
+
color: var(--a-text-heading, var(--a-text));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:scope > p {
|
|
26
|
+
margin: 0;
|
|
27
|
+
line-height: var(--a-line-height-prose, 1.6);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<h1>simple-content — article body container</h1>
|
|
2
|
+
|
|
3
|
+
<p>CSS-only structural child of <code><simple-shell></code>. Provides vertical rhythm and prose-friendly max-width.</p>
|
|
4
|
+
|
|
5
|
+
<simple-shell style="border: 1px solid var(--a-border); border-radius: var(--a-radius-3); min-height: 50dvh;">
|
|
6
|
+
<simple-content>
|
|
7
|
+
<h1>Article body</h1>
|
|
8
|
+
<p>simple-content is the main article surface. It applies token-correct vertical rhythm (the gap between children uses <code>--a-density-4</code>) and uses prose typography for paragraphs and headings.</p>
|
|
9
|
+
<h2>Section heading</h2>
|
|
10
|
+
<p>Headings cascade naturally. h1 / h2 / h3 receive heading colors via <code>--a-text-heading</code>.</p>
|
|
11
|
+
<p>Body paragraphs use a prose line-height (<code>--a-line-height-prose</code>) for comfortable reading.</p>
|
|
12
|
+
</simple-content>
|
|
13
|
+
</simple-shell>
|
|
@@ -0,0 +1,42 @@
|
|
|
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>Simple Content — 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="../simple-shell/simple-shell.css">
|
|
11
|
+
<link rel="stylesheet" href="../simple-content/simple-content.css">
|
|
12
|
+
<link rel="stylesheet" href="../simple-hero/simple-hero.css">
|
|
13
|
+
<link rel="stylesheet" href="../../../web-components/components/button/button.css">
|
|
14
|
+
|
|
15
|
+
<script type="module" src="../simple-shell/simple-shell.js"></script>
|
|
16
|
+
<script type="module" src="../../../web-components/components/button/button.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('./simple-content.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 simple-content.examples.html — ${err.message}</p>`;
|
|
37
|
+
console.error('[simple-content.html]', err);
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
</body>
|
|
42
|
+
</html>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
2
|
+
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
3
|
+
name: SimpleContent
|
|
4
|
+
tag: simple-content
|
|
5
|
+
component: SimpleContent
|
|
6
|
+
category: shells
|
|
7
|
+
version: 1
|
|
8
|
+
description: |
|
|
9
|
+
Module-tier article-body container. CSS-only — no JS, no state.
|
|
10
|
+
Sits inside <simple-shell> as the main content surface with
|
|
11
|
+
token-correct vertical rhythm and prose-friendly max-width.
|
|
12
|
+
|
|
13
|
+
Companion to <simple-hero> (optional top strip) per ADR-0023
|
|
14
|
+
bespoke shell-tier children.
|
|
15
|
+
|
|
16
|
+
props: {}
|
|
17
|
+
|
|
18
|
+
events: {}
|
|
19
|
+
|
|
20
|
+
slots:
|
|
21
|
+
default:
|
|
22
|
+
description: >-
|
|
23
|
+
Article body content — prose, code blocks, illustrations.
|
|
24
|
+
Authors compose freely; <simple-content> provides only the
|
|
25
|
+
container with sensible defaults (vertical rhythm, max-width,
|
|
26
|
+
typography token application).
|
|
27
|
+
|
|
28
|
+
states:
|
|
29
|
+
- name: idle
|
|
30
|
+
description: Default, visible.
|
|
31
|
+
|
|
32
|
+
traits: []
|
|
33
|
+
|
|
34
|
+
a2ui:
|
|
35
|
+
rules:
|
|
36
|
+
- >-
|
|
37
|
+
simple-content is the article surface inside simple-shell. Use
|
|
38
|
+
for primary page body. Sibling to <simple-hero> (optional).
|
|
39
|
+
|
|
40
|
+
keywords:
|
|
41
|
+
- simple-content
|
|
42
|
+
- article
|
|
43
|
+
- body
|
|
44
|
+
- prose
|
|
45
|
+
- main-content
|
|
46
|
+
- landing-body
|
|
47
|
+
- marketing-body
|
|
48
|
+
|
|
49
|
+
synonyms:
|
|
50
|
+
simple-content: [page-content, article-body, prose-container, main-body]
|
|
51
|
+
|
|
52
|
+
related:
|
|
53
|
+
- SimpleShell
|
|
54
|
+
- SimpleHero
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/SimpleHero.json",
|
|
4
|
+
"title": "SimpleHero",
|
|
5
|
+
"description": "Module-tier hero strip for the top of marketing / landing / error\npages. CSS-only — no JS, no state. Three named slots (heading, lede,\nactions) carry the canonical hero composition.\n\nSits inside <simple-shell> above <simple-content>. Companion to\n<simple-content> per ADR-0023 bespoke shell-tier children.\n",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"component": {
|
|
17
|
+
"const": "SimpleHero"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"required": [
|
|
21
|
+
"component"
|
|
22
|
+
],
|
|
23
|
+
"unevaluatedProperties": false,
|
|
24
|
+
"x-adiaui": {
|
|
25
|
+
"anti_patterns": [],
|
|
26
|
+
"category": "shells",
|
|
27
|
+
"events": {},
|
|
28
|
+
"examples": [],
|
|
29
|
+
"keywords": [
|
|
30
|
+
"simple-hero",
|
|
31
|
+
"hero",
|
|
32
|
+
"splash",
|
|
33
|
+
"landing-hero",
|
|
34
|
+
"marketing-hero",
|
|
35
|
+
"intro",
|
|
36
|
+
"page-title"
|
|
37
|
+
],
|
|
38
|
+
"name": "SimpleHero",
|
|
39
|
+
"related": [
|
|
40
|
+
"SimpleShell",
|
|
41
|
+
"SimpleContent"
|
|
42
|
+
],
|
|
43
|
+
"slots": {
|
|
44
|
+
"default": {
|
|
45
|
+
"description": "Optional inline content if the named slots are insufficient."
|
|
46
|
+
},
|
|
47
|
+
"actions": {
|
|
48
|
+
"description": "Action row (button-ui, link-ui) for primary CTAs."
|
|
49
|
+
},
|
|
50
|
+
"heading": {
|
|
51
|
+
"description": "Large display heading (h1) — the page title."
|
|
52
|
+
},
|
|
53
|
+
"lede": {
|
|
54
|
+
"description": "Lead paragraph below heading — short summary or CTA tagline."
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"states": [
|
|
58
|
+
{
|
|
59
|
+
"description": "Default, visible.",
|
|
60
|
+
"name": "idle"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"synonyms": {
|
|
64
|
+
"simple-hero": [
|
|
65
|
+
"page-hero",
|
|
66
|
+
"splash-hero",
|
|
67
|
+
"landing-hero",
|
|
68
|
+
"intro-strip"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"tag": "simple-hero",
|
|
72
|
+
"tokens": {},
|
|
73
|
+
"traits": [],
|
|
74
|
+
"version": 1
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
+
simple-hero — Optional top strip for landing / error / splash pages
|
|
3
|
+
|
|
4
|
+
CSS-only. Three named slots (heading, lede, actions) compose the
|
|
5
|
+
canonical hero layout. Authors can omit any slot.
|
|
6
|
+
═══════════════════════════════════════════════════════════════ */
|
|
7
|
+
|
|
8
|
+
@scope (simple-hero) {
|
|
9
|
+
:scope {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: center;
|
|
13
|
+
text-align: center;
|
|
14
|
+
gap: var(--a-density-3, 1rem);
|
|
15
|
+
width: 100%;
|
|
16
|
+
padding-block: var(--a-density-6, 3rem);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Heading slot — large display size */
|
|
20
|
+
:scope [slot="heading"] {
|
|
21
|
+
margin: 0;
|
|
22
|
+
font-size: var(--a-font-size-display, 2.5rem);
|
|
23
|
+
line-height: var(--a-line-height-tight, 1.2);
|
|
24
|
+
color: var(--a-text-heading, var(--a-text));
|
|
25
|
+
font-weight: var(--a-font-weight-bold, 600);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Lede slot — muted, larger than body */
|
|
29
|
+
:scope [slot="lede"] {
|
|
30
|
+
margin: 0;
|
|
31
|
+
font-size: var(--a-font-size-lede, 1.25rem);
|
|
32
|
+
line-height: var(--a-line-height-prose, 1.5);
|
|
33
|
+
color: var(--a-text-muted);
|
|
34
|
+
max-width: 42rem;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Actions slot — flex row */
|
|
38
|
+
:scope [slot="actions"] {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-wrap: wrap;
|
|
41
|
+
gap: var(--a-density-2, 0.75rem);
|
|
42
|
+
justify-content: center;
|
|
43
|
+
margin-top: var(--a-density-2, 0.75rem);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<h1>simple-hero — hero strip for landing / error / splash pages</h1>
|
|
2
|
+
|
|
3
|
+
<p>CSS-only. Three named slots: heading, lede, actions. Authors can omit any slot.</p>
|
|
4
|
+
|
|
5
|
+
<h2>All three slots</h2>
|
|
6
|
+
|
|
7
|
+
<simple-shell style="border: 1px solid var(--a-border); border-radius: var(--a-radius-3); min-height: 50dvh;">
|
|
8
|
+
<simple-hero>
|
|
9
|
+
<h1 slot="heading">Build with AdiaUI</h1>
|
|
10
|
+
<p slot="lede">Zero dependencies. Production-ready primitives. LLM-native generative UI.</p>
|
|
11
|
+
<div slot="actions">
|
|
12
|
+
<button-ui variant="solid" color="accent">Get started</button-ui>
|
|
13
|
+
<button-ui variant="outline">Read the docs</button-ui>
|
|
14
|
+
</div>
|
|
15
|
+
</simple-hero>
|
|
16
|
+
</simple-shell>
|
|
17
|
+
|
|
18
|
+
<h2>Heading + lede only</h2>
|
|
19
|
+
|
|
20
|
+
<simple-shell style="border: 1px solid var(--a-border); border-radius: var(--a-radius-3); min-height: 40dvh;">
|
|
21
|
+
<simple-hero>
|
|
22
|
+
<h1 slot="heading">Thank you</h1>
|
|
23
|
+
<p slot="lede">Your message has been received. We'll get back to you within 24 hours.</p>
|
|
24
|
+
</simple-hero>
|
|
25
|
+
</simple-shell>
|
|
26
|
+
|
|
27
|
+
<h2>Heading only — minimal error page</h2>
|
|
28
|
+
|
|
29
|
+
<simple-shell centered style="border: 1px solid var(--a-border); border-radius: var(--a-radius-3); min-height: 30dvh;">
|
|
30
|
+
<simple-hero>
|
|
31
|
+
<h1 slot="heading">Maintenance in progress</h1>
|
|
32
|
+
</simple-hero>
|
|
33
|
+
</simple-shell>
|