@adia-ai/web-modules 0.6.4 → 0.6.7

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 (60) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/generative/index.d.ts +11 -0
  3. package/generative/index.js +45 -0
  4. package/package.json +28 -1
  5. package/chat/chat-composer/chat-composer.examples.html +0 -28
  6. package/chat/chat-composer/chat-composer.html +0 -43
  7. package/chat/chat-empty/chat-empty.examples.html +0 -34
  8. package/chat/chat-empty/chat-empty.html +0 -42
  9. package/chat/chat-header/chat-header.examples.html +0 -30
  10. package/chat/chat-header/chat-header.html +0 -42
  11. package/chat/chat-shell/chat-shell.examples.html +0 -126
  12. package/chat/chat-shell/chat-shell.html +0 -42
  13. package/chat/chat-sidebar/chat-sidebar.examples.html +0 -36
  14. package/chat/chat-sidebar/chat-sidebar.html +0 -43
  15. package/chat/chat-status/chat-status.examples.html +0 -29
  16. package/chat/chat-status/chat-status.html +0 -42
  17. package/chat/chat-thread/chat-thread.examples.html +0 -36
  18. package/chat/chat-thread/chat-thread.html +0 -43
  19. package/editor/editor-canvas/editor-canvas.examples.html +0 -65
  20. package/editor/editor-canvas/editor-canvas.html +0 -43
  21. package/editor/editor-canvas-empty/editor-canvas-empty.examples.html +0 -65
  22. package/editor/editor-canvas-empty/editor-canvas-empty.html +0 -42
  23. package/editor/editor-canvas-toolbar/editor-canvas-toolbar.examples.html +0 -56
  24. package/editor/editor-canvas-toolbar/editor-canvas-toolbar.html +0 -42
  25. package/editor/editor-shell/editor-shell.examples.html +0 -71
  26. package/editor/editor-shell/editor-shell.html +0 -42
  27. package/editor/editor-sidebar/editor-sidebar.examples.html +0 -65
  28. package/editor/editor-sidebar/editor-sidebar.html +0 -43
  29. package/editor/editor-statusbar/editor-statusbar.examples.html +0 -65
  30. package/editor/editor-statusbar/editor-statusbar.html +0 -42
  31. package/editor/editor-toolbar/editor-toolbar.examples.html +0 -65
  32. package/editor/editor-toolbar/editor-toolbar.html +0 -43
  33. package/shell/admin-command/admin-command.examples.html +0 -83
  34. package/shell/admin-command/admin-command.html +0 -42
  35. package/shell/admin-content/admin-content.examples.html +0 -33
  36. package/shell/admin-content/admin-content.html +0 -42
  37. package/shell/admin-page/admin-page.examples.html +0 -37
  38. package/shell/admin-page/admin-page.html +0 -42
  39. package/shell/admin-page-body/admin-page-body.examples.html +0 -34
  40. package/shell/admin-page-body/admin-page-body.html +0 -42
  41. package/shell/admin-page-header/admin-page-header.examples.html +0 -34
  42. package/shell/admin-page-header/admin-page-header.html +0 -42
  43. package/shell/admin-scroll/admin-scroll.examples.html +0 -31
  44. package/shell/admin-scroll/admin-scroll.html +0 -42
  45. package/shell/admin-shell/admin-shell.examples.html +0 -181
  46. package/shell/admin-shell/admin-shell.html +0 -46
  47. package/shell/admin-sidebar/admin-sidebar.examples.html +0 -76
  48. package/shell/admin-sidebar/admin-sidebar.html +0 -47
  49. package/shell/admin-statusbar/admin-statusbar.examples.html +0 -29
  50. package/shell/admin-statusbar/admin-statusbar.html +0 -42
  51. package/shell/admin-topbar/admin-topbar.examples.html +0 -31
  52. package/shell/admin-topbar/admin-topbar.html +0 -42
  53. package/simple/simple-content/simple-content.examples.html +0 -13
  54. package/simple/simple-content/simple-content.html +0 -42
  55. package/simple/simple-hero/simple-hero.examples.html +0 -33
  56. package/simple/simple-hero/simple-hero.html +0 -42
  57. package/simple/simple-shell/simple-shell.examples.html +0 -42
  58. package/simple/simple-shell/simple-shell.html +0 -42
  59. package/theme/theme-panel/theme-panel.examples.html +0 -112
  60. package/theme/theme-panel/theme-panel.html +0 -75
@@ -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>Admin Page Body — 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="../admin-shell/admin-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="../admin-shell/admin-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('./admin-page-body.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 admin-page-body.examples.html — ${err.message}</p>`;
37
- console.error('[admin-page-body.html]', err);
38
- }
39
- </script>
40
-
41
- </body>
42
- </html>
@@ -1,34 +0,0 @@
1
- <header>
2
- <div>
3
- <h1>Admin Page Header</h1>
4
- <div data-actions>
5
- <tag-ui size="sm">admin-page-header</tag-ui>
6
- <tag-ui size="sm" variant="ghost">CSS-only</tag-ui>
7
- </div>
8
- </div>
9
- <p>Module-tier page-header band. Sticky top band inside <admin-page>.</p>
10
- </header>
11
-
12
- <section data-section>
13
- <h2 variant="section">Role</h2>
14
- <p>This is a CSS-only structural stub — no JavaScript, no behavior. The shell host (<code>&lt;admin-shell&gt;</code>) styles it via tag-presence. Authors compose it with sibling bespoke children to express semantic shell-tier structure.</p>
15
- </section>
16
-
17
- <section data-section>
18
- <h2 variant="section">Composition</h2>
19
- <p>Typical placement inside <code>&lt;admin-shell&gt;</code>:</p>
20
- <code-ui language="html">&lt;admin-page&gt;
21
- &lt;admin-page-header&gt;
22
- &lt;header-ui&gt;
23
- &lt;span slot="heading"&gt;Page Title&lt;/span&gt;
24
- &lt;tab-list-ui slot="action"&gt;…tabs…&lt;/tab-list-ui&gt;
25
- &lt;/header-ui&gt;
26
- &lt;/admin-page-header&gt;
27
- &lt;admin-page-body&gt;…&lt;/admin-page-body&gt;
28
- &lt;/admin-page&gt;</code-ui>
29
- </section>
30
-
31
- <section data-section>
32
- <h2 variant="section">Slot vocabulary</h2>
33
- <p>See the <a href="../admin-shell/admin-shell.html"><code>admin-shell</code></a> demo for the full composition pattern. CSS-only stubs declare slot intent; the parent shell handles layout.</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>Admin Page 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="../admin-shell/admin-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="../admin-shell/admin-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('./admin-page-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 admin-page-header.examples.html — ${err.message}</p>`;
37
- console.error('[admin-page-header.html]', err);
38
- }
39
- </script>
40
-
41
- </body>
42
- </html>
@@ -1,31 +0,0 @@
1
- <header>
2
- <div>
3
- <h1>Admin Scroll</h1>
4
- <div data-actions>
5
- <tag-ui size="sm">admin-scroll</tag-ui>
6
- <tag-ui size="sm" variant="ghost">CSS-only</tag-ui>
7
- </div>
8
- </div>
9
- <p>Module-tier shell scroll surface. Single-axis vertical scroll, contained.</p>
10
- </header>
11
-
12
- <section data-section>
13
- <h2 variant="section">Role</h2>
14
- <p>This is a CSS-only structural stub — no JavaScript, no behavior. The shell host (<code>&lt;admin-shell&gt;</code>) styles it via tag-presence. Authors compose it with sibling bespoke children to express semantic shell-tier structure.</p>
15
- </section>
16
-
17
- <section data-section>
18
- <h2 variant="section">Composition</h2>
19
- <p>Typical placement inside <code>&lt;admin-shell&gt;</code>:</p>
20
- <code-ui language="html">&lt;admin-content&gt;
21
- &lt;admin-topbar slot="header"&gt;…&lt;/admin-topbar&gt;
22
- &lt;admin-scroll&gt;
23
- &lt;admin-page&gt;…&lt;/admin-page&gt;
24
- &lt;/admin-scroll&gt;
25
- &lt;/admin-content&gt;</code-ui>
26
- </section>
27
-
28
- <section data-section>
29
- <h2 variant="section">Slot vocabulary</h2>
30
- <p>See the <a href="../admin-shell/admin-shell.html"><code>admin-shell</code></a> demo for the full composition pattern. CSS-only stubs declare slot intent; the parent shell handles layout.</p>
31
- </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>Admin Scroll — 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="../admin-shell/admin-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="../admin-shell/admin-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('./admin-scroll.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 admin-scroll.examples.html — ${err.message}</p>`;
37
- console.error('[admin-scroll.html]', err);
38
- }
39
- </script>
40
-
41
- </body>
42
- </html>
@@ -1,181 +0,0 @@
1
- <header>
2
- <div>
3
- <h1>Admin Shell</h1>
4
- <div data-actions>
5
- <tag-ui size="sm">admin-shell</tag-ui>
6
- </div>
7
- </div>
8
- <p>Behavior-only application shell. Wires sidebar toggles, resize handles, a Cmd+K command palette, and a ResizeObserver that drives responsive sidebar collapse. The shell binds interactions; the consumer supplies the DOM. The docs site you're reading runs inside one.</p>
9
- </header>
10
-
11
- <section data-section>
12
- <h2 variant="section">Basic shape (legacy)</h2>
13
- <p data-note>Author supplies the DOM (sidebars + main column + optional command dialog); the shell binds the interactions. This is the original raw-HTML authoring shape — still fully supported.</p>
14
- <code-ui language="html">&lt;admin-shell mode="rounded"&gt;
15
- &lt;aside data-sidebar="leading"&gt;
16
- &lt;header&gt;…&lt;/header&gt;
17
- &lt;section&gt;
18
- &lt;nav-ui&gt;…&lt;/nav-ui&gt;
19
- &lt;/section&gt;
20
- &lt;footer&gt;…&lt;/footer&gt;
21
- &lt;div data-resize&gt;&lt;/div&gt;
22
- &lt;/aside&gt;
23
-
24
- &lt;main&gt;
25
- &lt;header&gt;
26
- &lt;button-ui data-sidebar-toggle="leading" icon="sidebar" variant="ghost" size="sm"&gt;&lt;/button-ui&gt;
27
- &lt;breadcrumb-ui&gt;…&lt;/breadcrumb-ui&gt;
28
- &lt;/header&gt;
29
- &lt;section&gt;
30
- &lt;router-ui&gt;&lt;/router-ui&gt;
31
- &lt;/section&gt;
32
- &lt;footer&gt;
33
- &lt;span&gt;Footer&lt;/span&gt;
34
- &lt;/footer&gt;
35
- &lt;/main&gt;
36
-
37
- &lt;dialog data-command&gt;
38
- &lt;command-ui placeholder="Search..."&gt;&lt;/command-ui&gt;
39
- &lt;/dialog&gt;
40
- &lt;/admin-shell&gt;</code-ui>
41
- </section>
42
-
43
- <section data-section>
44
- <h2 variant="section">Basic shape (bespoke — recommended)</h2>
45
- <p data-note>The bespoke shape uses module-namespaced custom elements (<code>&lt;admin-sidebar&gt;</code>, <code>&lt;admin-content&gt;</code>, etc.) 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(admin-sidebar[collapsed])</code>.</p>
46
- <code-ui language="html">&lt;admin-shell mode="rounded"&gt;
47
- &lt;admin-sidebar slot="leading" resizable collapsible&gt;
48
- &lt;admin-topbar slot="header"&gt;
49
- &lt;span slot="heading"&gt;Workspace&lt;/span&gt;
50
- &lt;/admin-topbar&gt;
51
- &lt;nav-ui&gt;…&lt;/nav-ui&gt;
52
- &lt;admin-statusbar slot="footer"&gt;
53
- &lt;span&gt;User&lt;/span&gt;
54
- &lt;/admin-statusbar&gt;
55
- &lt;div data-resize&gt;&lt;/div&gt;
56
- &lt;/admin-sidebar&gt;
57
-
58
- &lt;admin-content&gt;
59
- &lt;admin-topbar slot="header"&gt;
60
- &lt;button-ui data-sidebar-toggle="leading" icon="sidebar" variant="ghost" size="sm"&gt;&lt;/button-ui&gt;
61
- &lt;breadcrumb-ui slot="heading"&gt;…&lt;/breadcrumb-ui&gt;
62
- &lt;/admin-topbar&gt;
63
- &lt;admin-scroll&gt;
64
- &lt;admin-page&gt;
65
- &lt;admin-page-header&gt;
66
- &lt;header-ui&gt;&lt;span slot="heading"&gt;Page Title&lt;/span&gt;&lt;/header-ui&gt;
67
- &lt;/admin-page-header&gt;
68
- &lt;admin-page-body&gt;
69
- &lt;section-ui&gt;…content…&lt;/section-ui&gt;
70
- &lt;/admin-page-body&gt;
71
- &lt;/admin-page&gt;
72
- &lt;/admin-scroll&gt;
73
- &lt;admin-statusbar slot="footer"&gt;
74
- &lt;span&gt;Status&lt;/span&gt;
75
- &lt;/admin-statusbar&gt;
76
- &lt;/admin-content&gt;
77
-
78
- &lt;admin-command&gt;
79
- &lt;command-ui placeholder="Search..."&gt;&lt;/command-ui&gt;
80
- &lt;/admin-command&gt;
81
- &lt;/admin-shell&gt;</code-ui>
82
- </section>
83
-
84
- <section data-section>
85
- <h2 variant="section">State as attribute</h2>
86
- <p>Every queryable state is reflected on the relevant child element. Style cross-cuts via <code>:has()</code>:</p>
87
- <code-ui language="css">/* Theme tweak when leading sidebar is collapsed */
88
- admin-shell:has(admin-sidebar[slot="leading"][collapsed]) admin-content {
89
- /* … */
90
- }
91
-
92
- /* Show focus indicator while command palette is open */
93
- admin-shell:has(admin-command[open]) {
94
- /* … */
95
- }</code-ui>
96
- <p data-note>JS reads the same attribute: <code>shell.querySelector('admin-sidebar[slot="leading"]').hasAttribute('collapsed')</code>. No threshold math, no <code>getBoundingClientRect</code>.</p>
97
- </section>
98
-
99
- <section data-section>
100
- <h2 variant="section">Properties</h2>
101
- <table>
102
- <thead><tr><th>Prop</th><th>Type</th><th>Default</th><th>Description</th></tr></thead>
103
- <tbody>
104
- <tr><td><code>mode</code></td><td>string</td><td>—</td><td>Layout variant: <code>rounded</code> (softens edges), <code>borderless</code> (removes outer chrome). Empty is the default bordered surface. Multiple values allowed (e.g. <code>"rounded borderless"</code>).</td></tr>
105
- </tbody>
106
- </table>
107
- </section>
108
-
109
- <section data-section>
110
- <h2 variant="section">Behavior wiring</h2>
111
- <table>
112
- <thead><tr><th>Affordance</th><th>Author markup</th><th>What the shell does</th></tr></thead>
113
- <tbody>
114
- <tr><td>Sidebar toggle</td><td><code>[data-sidebar-toggle="leading"]</code> / <code>[data-sidebar-toggle="trailing"]</code></td><td>Click flips <code>[collapsed]</code> on the corresponding sidebar. Persists in <code>localStorage</code>.</td></tr>
115
- <tr><td>Sidebar resize</td><td><code>&lt;div data-resize&gt;&lt;/div&gt;</code> inside the sidebar</td><td>Pointer-drag resizes the aside; bounded by <code>--page-sidebar-min-width</code> / <code>--page-sidebar-max-width</code> CSS custom properties. Snaps below threshold to collapsed.</td></tr>
116
- <tr><td>Command palette</td><td><code>&lt;dialog data-command&gt;</code> as a child of the shell</td><td><code>Cmd+K</code> / <code>Ctrl+K</code> calls <code>showModal()</code> on the inner dialog. Forwards <code>command-select</code> events from the inner <code>&lt;command-ui&gt;</code>.</td></tr>
117
- <tr><td>Responsive collapse</td><td>(automatic)</td><td>ResizeObserver collapses sidebars when viewport drops below the breakpoint; restores on widen.</td></tr>
118
- </tbody>
119
- </table>
120
- </section>
121
-
122
- <section data-section>
123
- <h2 variant="section">Events</h2>
124
- <table>
125
- <thead><tr><th>Event</th><th>Detail</th><th>Fires when</th></tr></thead>
126
- <tbody>
127
- <tr><td><code>sidebar-toggle</code></td><td><code>{ sidebar, expanded }</code></td><td>A sidebar is collapsed or expanded (toggle button, snap, or programmatic).</td></tr>
128
- <tr><td><code>sidebar-resize</code></td><td><code>{ sidebar, width }</code></td><td>As a sidebar is dragged. Debounced on the trailing edge.</td></tr>
129
- <tr><td><code>command-select</code></td><td><code>{ value }</code></td><td>Forwarded from the inner command palette when an option is chosen.</td></tr>
130
- </tbody>
131
- </table>
132
- </section>
133
-
134
- <section data-section>
135
- <h2 variant="section">JS API</h2>
136
- <code-ui language="js">const shell = document.querySelector('admin-shell');
137
-
138
- shell.toggleLeading(); // collapse / expand the leading sidebar
139
- shell.toggleTrailing(); // collapse / expand the trailing sidebar
140
- shell.openCommand(); // open the Cmd+K dialog
141
- shell.closeCommand(); // close it</code-ui>
142
- </section>
143
-
144
- <section data-section>
145
- <h2 variant="section">Slot vocabulary inside the shell</h2>
146
- <p>
147
- Both authoring shapes are valid simultaneously. The legacy
148
- raw-HTML form (<code>aside[data-sidebar]</code>,
149
- <code>main &gt; header</code>, etc.) keeps working unchanged;
150
- consumers can also use the
151
- <a href="/site/components/aside">aside-ui</a> /
152
- <a href="/site/components/header">header-ui</a> /
153
- <a href="/site/components/section">section-ui</a> /
154
- <a href="/site/components/footer">footer-ui</a> slot vocabulary.
155
- Both render identically — the shell's CSS lifts each structural
156
- selector into <code>:is(legacy, slot-ui)</code> form, and the JS-
157
- side wiring (<code>#sidebarName</code>) reads from either
158
- <code>data-sidebar</code> or <code>slot</code>. See
159
- <a href="/site/reference/decisions">ADR-0011</a> for the migration
160
- rationale.
161
- </p>
162
- <code-ui language="html">&lt;!-- Slot-vocabulary equivalent of the structure shown above --&gt;
163
- &lt;admin-shell mode="rounded"&gt;
164
- &lt;aside-ui slot="leading"&gt;
165
- &lt;header-ui&gt;…&lt;/header-ui&gt;
166
- &lt;section-ui&gt;
167
- &lt;nav-ui&gt;…&lt;/nav-ui&gt;
168
- &lt;/section-ui&gt;
169
- &lt;footer-ui&gt;…&lt;/footer-ui&gt;
170
- &lt;div data-resize&gt;&lt;/div&gt;
171
- &lt;/aside-ui&gt;
172
-
173
- &lt;main&gt;
174
- &lt;header-ui&gt;…&lt;/header-ui&gt;
175
- &lt;section-ui&gt;
176
- &lt;router-ui&gt;&lt;/router-ui&gt;
177
- &lt;/section-ui&gt;
178
- &lt;footer-ui&gt;…&lt;/footer-ui&gt;
179
- &lt;/main&gt;
180
- &lt;/admin-shell&gt;</code-ui>
181
- </section>
@@ -1,46 +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>Admin Shell — AdiaUI</title>
7
-
8
- <!-- Token base -->
9
- <link rel="stylesheet" href="../../../web-components/styles/resets.css">
10
- <link rel="stylesheet" href="../../../web-components/styles/tokens.css">
11
-
12
- <!-- Component CSS -->
13
- <link rel="stylesheet" href="./admin-shell.css">
14
- <link rel="stylesheet" href="../../../web-components/components/code/code.css">
15
- <link rel="stylesheet" href="../../../web-components/components/tag/tag.css">
16
-
17
- <!-- Component JS -->
18
- <script type="module" src="./admin-shell.js"></script>
19
- <script type="module" src="../../../web-components/components/code/code.js"></script>
20
- <script type="module" src="../../../web-components/components/tag/tag.js"></script>
21
-
22
- <style>
23
- :where(html, body) { margin: 0; min-height: 100vh; background: var(--a-bg); color: var(--a-fg); font-family: var(--a-font); }
24
- main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
25
- </style>
26
- </head>
27
- <body>
28
-
29
- <main id="demo-root">
30
- <p>Loading examples…</p>
31
- </main>
32
-
33
- <script type="module">
34
- const root = document.getElementById('demo-root');
35
- try {
36
- const res = await fetch('./admin-shell.examples.html');
37
- if (!res.ok) throw new Error(`fetch failed (${res.status})`);
38
- root.innerHTML = await res.text();
39
- } catch (err) {
40
- root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load admin-shell.examples.html — ${err.message}</p>`;
41
- console.error('[admin-shell.html]', err);
42
- }
43
- </script>
44
-
45
- </body>
46
- </html>
@@ -1,76 +0,0 @@
1
- <header>
2
- <div>
3
- <h1>Admin Sidebar</h1>
4
- <div data-actions>
5
- <tag-ui size="sm">admin-sidebar</tag-ui>
6
- </div>
7
- </div>
8
- <p>Module-tier shell sidebar — owns resize, snap-to-collapsed, persistence, and the <code>[collapsed]</code> reflected attribute. Sits inside <code>&lt;admin-shell&gt;</code> as <code>slot="leading"</code> or <code>slot="trailing"</code>. Authors compose chrome bars + content inside via slot vocabulary.</p>
9
- </header>
10
-
11
- <section data-section>
12
- <h2 variant="section">Basic shape</h2>
13
- <p data-note>Drop into <code>&lt;admin-shell&gt;</code> as a slotted child. Add <code>resizable</code> to wire the drag handle, <code>collapsible</code> to wire programmatic collapse.</p>
14
- <code-ui language="html">&lt;admin-sidebar slot="leading" resizable collapsible&gt;
15
- &lt;admin-topbar slot="header"&gt;…&lt;/admin-topbar&gt;
16
- &lt;nav-ui&gt;…&lt;/nav-ui&gt;
17
- &lt;admin-statusbar slot="footer"&gt;…&lt;/admin-statusbar&gt;
18
- &lt;div data-resize&gt;&lt;/div&gt;
19
- &lt;/admin-sidebar&gt;</code-ui>
20
- </section>
21
-
22
- <section data-section>
23
- <h2 variant="section">State as attribute</h2>
24
- <p>The sidebar reflects its state on the element itself — no <code>data-*</code> proxy attributes, no threshold math from the outside.</p>
25
- <table>
26
- <thead><tr><th>Attribute</th><th>When set</th><th>Use for</th></tr></thead>
27
- <tbody>
28
- <tr><td><code>collapsed</code></td><td>Width is at or below 96px (snap floor)</td><td>CSS <code>:has(admin-sidebar[collapsed])</code> selectors; JS <code>.hasAttribute('collapsed')</code></td></tr>
29
- <tr><td><code>resizing</code></td><td>Active pointer-drag</td><td>Suppress transitions during drag</td></tr>
30
- </tbody>
31
- </table>
32
- <p data-note>The reflection is round-tripped — set <code>collapsed</code> programmatically and the sidebar will width-snap; release the attribute and it expands to the previously-saved width.</p>
33
- </section>
34
-
35
- <section data-section>
36
- <h2 variant="section">Public methods</h2>
37
- <table>
38
- <thead><tr><th>Method</th><th>Effect</th></tr></thead>
39
- <tbody>
40
- <tr><td><code>.toggle()</code></td><td>Flip collapsed state. Returns the new <code>collapsed</code> value.</td></tr>
41
- <tr><td><code>.collapse()</code></td><td>Force collapsed (idempotent if already collapsed).</td></tr>
42
- <tr><td><code>.expand()</code></td><td>Restore the previous expanded width.</td></tr>
43
- </tbody>
44
- </table>
45
- </section>
46
-
47
- <section data-section>
48
- <h2 variant="section">Events</h2>
49
- <table>
50
- <thead><tr><th>Event</th><th>Detail</th></tr></thead>
51
- <tbody>
52
- <tr><td><code>sidebar-toggle</code></td><td><code>{ name, expanded }</code> — bubbles when collapsed/expanded</td></tr>
53
- <tr><td><code>sidebar-resize</code></td><td><code>{ name, width }</code> — bubbles after a pointer-drag releases</td></tr>
54
- </tbody>
55
- </table>
56
- </section>
57
-
58
- <section data-section>
59
- <h2 variant="section">Properties</h2>
60
- <table>
61
- <thead><tr><th>Prop</th><th>Type</th><th>Default</th><th>Description</th></tr></thead>
62
- <tbody>
63
- <tr><td><code>resizable</code></td><td>boolean</td><td><code>false</code></td><td>Opts in to drag-to-resize. Author supplies a child <code>[data-resize]</code> element.</td></tr>
64
- <tr><td><code>collapsible</code></td><td>boolean</td><td><code>false</code></td><td>Opts in to <code>.toggle()</code>/<code>.collapse()</code>/<code>.expand()</code>.</td></tr>
65
- <tr><td><code>name</code></td><td>string</td><td>(slot value)</td><td>localStorage namespace override.</td></tr>
66
- <tr><td><code>min-width</code></td><td>string</td><td>(CSS min-width)</td><td>Override for the snap-floor width.</td></tr>
67
- <tr><td><code>collapsed</code></td><td>boolean</td><td>—</td><td>Reflected — set when width ≤ 96px.</td></tr>
68
- <tr><td><code>resizing</code></td><td>boolean</td><td>—</td><td>Reflected — set during active drag.</td></tr>
69
- </tbody>
70
- </table>
71
- </section>
72
-
73
- <section data-section>
74
- <h2 variant="section">Persistence</h2>
75
- <p>Width is saved to <code>localStorage</code> on every drag release + every toggle, under the key <code>adia-sidebar-{name}</code> (where <code>name</code> defaults to the slot value). On reconnect, the saved width is restored — the &ldquo;previous expanded width&rdquo; tracker preserves the user's preferred expanded size across collapse cycles.</p>
76
- </section>
@@ -1,47 +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>Admin Sidebar — AdiaUI</title>
7
-
8
- <!-- Token base -->
9
- <link rel="stylesheet" href="../../../web-components/styles/resets.css">
10
- <link rel="stylesheet" href="../../../web-components/styles/tokens.css">
11
-
12
- <!-- Component CSS — admin-sidebar inherits from admin-shell tokens
13
- when nested inside one; standalone styling below for the demo. -->
14
- <link rel="stylesheet" href="../admin-shell/admin-shell.css">
15
- <link rel="stylesheet" href="../../../web-components/components/code/code.css">
16
- <link rel="stylesheet" href="../../../web-components/components/tag/tag.css">
17
-
18
- <!-- Component JS -->
19
- <script type="module" src="./admin-sidebar.js"></script>
20
- <script type="module" src="../../../web-components/components/code/code.js"></script>
21
- <script type="module" src="../../../web-components/components/tag/tag.js"></script>
22
-
23
- <style>
24
- :where(html, body) { margin: 0; min-height: 100vh; background: var(--a-bg); color: var(--a-fg); font-family: var(--a-font); }
25
- main { max-width: 960px; margin-inline: auto; padding: var(--a-space-6) var(--a-space-5); }
26
- </style>
27
- </head>
28
- <body>
29
-
30
- <main id="demo-root">
31
- <p>Loading examples…</p>
32
- </main>
33
-
34
- <script type="module">
35
- const root = document.getElementById('demo-root');
36
- try {
37
- const res = await fetch('./admin-sidebar.examples.html');
38
- if (!res.ok) throw new Error(`fetch failed (${res.status})`);
39
- root.innerHTML = await res.text();
40
- } catch (err) {
41
- root.innerHTML = `<p style="color:var(--a-danger-strong);">Failed to load admin-sidebar.examples.html — ${err.message}</p>`;
42
- console.error('[admin-sidebar.html]', err);
43
- }
44
- </script>
45
-
46
- </body>
47
- </html>
@@ -1,29 +0,0 @@
1
- <header>
2
- <div>
3
- <h1>Admin Statusbar</h1>
4
- <div data-actions>
5
- <tag-ui size="sm">admin-statusbar</tag-ui>
6
- <tag-ui size="sm" variant="ghost">CSS-only</tag-ui>
7
- </div>
8
- </div>
9
- <p>Module-tier shell bottom chrome bar. Same shape as admin-topbar; conventionally read-only status.</p>
10
- </header>
11
-
12
- <section data-section>
13
- <h2 variant="section">Role</h2>
14
- <p>This is a CSS-only structural stub — no JavaScript, no behavior. The shell host (<code>&lt;admin-shell&gt;</code>) styles it via tag-presence. Authors compose it with sibling bespoke children to express semantic shell-tier structure.</p>
15
- </section>
16
-
17
- <section data-section>
18
- <h2 variant="section">Composition</h2>
19
- <p>Typical placement inside <code>&lt;admin-shell&gt;</code>:</p>
20
- <code-ui language="html">&lt;admin-statusbar&gt;
21
- &lt;icon-ui slot="icon" name="check-circle"&gt;&lt;/icon-ui&gt;
22
- &lt;span&gt;Synced just now · 12 changes&lt;/span&gt;
23
- &lt;/admin-statusbar&gt;</code-ui>
24
- </section>
25
-
26
- <section data-section>
27
- <h2 variant="section">Slot vocabulary</h2>
28
- <p>See the <a href="../admin-shell/admin-shell.html"><code>admin-shell</code></a> demo for the full composition pattern. CSS-only stubs declare slot intent; the parent shell handles layout.</p>
29
- </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>Admin Statusbar — 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="../admin-shell/admin-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="../admin-shell/admin-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('./admin-statusbar.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 admin-statusbar.examples.html — ${err.message}</p>`;
37
- console.error('[admin-statusbar.html]', err);
38
- }
39
- </script>
40
-
41
- </body>
42
- </html>