@tjakoen/grain 0.1.12

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 (181) hide show
  1. package/LICENSE +202 -0
  2. package/PLAN.md +27 -0
  3. package/README.md +243 -0
  4. package/ai/accepts.test.ts +69 -0
  5. package/ai/accepts.ts +57 -0
  6. package/ai/ai.css +127 -0
  7. package/ai/client-door.test.ts +70 -0
  8. package/ai/client-door.ts +56 -0
  9. package/ai/contract.test.ts +158 -0
  10. package/ai/contract.ts +285 -0
  11. package/ai/interaction-layer.test.ts +270 -0
  12. package/ai/interaction-layer.ts +138 -0
  13. package/ai/manifest-dom.test.ts +176 -0
  14. package/ai/manifest-dom.ts +187 -0
  15. package/ai/manifest.test.ts +71 -0
  16. package/ai/manifest.ts +57 -0
  17. package/ai/markdown.test.ts +68 -0
  18. package/ai/markdown.ts +74 -0
  19. package/ai/model-chat.test.ts +131 -0
  20. package/ai/model-chat.ts +151 -0
  21. package/ai/model-reasoner.test.ts +152 -0
  22. package/ai/model-reasoner.ts +146 -0
  23. package/ai/model.test.ts +148 -0
  24. package/ai/model.ts +200 -0
  25. package/ai/reasoner-kit.test.ts +142 -0
  26. package/ai/reasoner-kit.ts +159 -0
  27. package/ai/reasoner.test.ts +227 -0
  28. package/ai/reasoner.ts +446 -0
  29. package/ai/timeline-log.test.ts +55 -0
  30. package/ai/timeline-log.ts +50 -0
  31. package/ai/vocab-reference.test.ts +43 -0
  32. package/ai/vocab-reference.ts +107 -0
  33. package/ai/webllm.test.ts +79 -0
  34. package/ai/webllm.ts +125 -0
  35. package/assets/figure-sample.svg +14 -0
  36. package/assets/sprite.svg +22 -0
  37. package/catalog/catalog.test.ts +37 -0
  38. package/catalog/catalog.ts +424 -0
  39. package/components/atoms/action-badge/action-badge.css +17 -0
  40. package/components/atoms/action-badge/action-badge.html +6 -0
  41. package/components/atoms/action-badge/action-badge.md +23 -0
  42. package/components/atoms/b-badge/b-badge.css +15 -0
  43. package/components/atoms/b-badge/b-badge.html +2 -0
  44. package/components/atoms/b-badge/b-badge.md +16 -0
  45. package/components/atoms/b-button/b-button.ai.md +22 -0
  46. package/components/atoms/b-button/b-button.css +87 -0
  47. package/components/atoms/b-button/b-button.html +5 -0
  48. package/components/atoms/b-button/b-button.md +77 -0
  49. package/components/atoms/b-icon/b-icon.css +10 -0
  50. package/components/atoms/b-icon/b-icon.html +5 -0
  51. package/components/atoms/b-icon/b-icon.md +36 -0
  52. package/components/atoms/b-icon-button/b-icon-button.ai.md +11 -0
  53. package/components/atoms/b-icon-button/b-icon-button.css +43 -0
  54. package/components/atoms/b-icon-button/b-icon-button.html +8 -0
  55. package/components/atoms/b-icon-button/b-icon-button.md +33 -0
  56. package/components/atoms/b-input/b-input.css +36 -0
  57. package/components/atoms/b-input/b-input.html +8 -0
  58. package/components/atoms/b-input/b-input.md +59 -0
  59. package/components/atoms/b-kbd/b-kbd.css +11 -0
  60. package/components/atoms/b-kbd/b-kbd.html +3 -0
  61. package/components/atoms/b-kbd/b-kbd.md +13 -0
  62. package/components/atoms/b-list/b-list.css +21 -0
  63. package/components/atoms/b-list/b-list.html +6 -0
  64. package/components/atoms/b-list/b-list.md +24 -0
  65. package/components/atoms/b-meter/b-meter.css +39 -0
  66. package/components/atoms/b-meter/b-meter.md +44 -0
  67. package/components/atoms/b-select/b-select.css +35 -0
  68. package/components/atoms/b-select/b-select.md +75 -0
  69. package/components/atoms/b-switch/b-switch.css +61 -0
  70. package/components/atoms/b-switch/b-switch.html +6 -0
  71. package/components/atoms/b-switch/b-switch.md +40 -0
  72. package/components/atoms/b-text/b-text.ai.md +29 -0
  73. package/components/atoms/b-text/b-text.css +2 -0
  74. package/components/atoms/b-text/b-text.html +3 -0
  75. package/components/atoms/b-text/b-text.md +23 -0
  76. package/components/atoms/code-block/code-block.css +42 -0
  77. package/components/atoms/code-block/code-block.md +23 -0
  78. package/components/examples.test.ts +23 -0
  79. package/components/molecules/callout/callout.css +19 -0
  80. package/components/molecules/callout/callout.md +15 -0
  81. package/components/molecules/card/card.css +28 -0
  82. package/components/molecules/card/card.md +30 -0
  83. package/components/molecules/chat-message/chat-message.css +83 -0
  84. package/components/molecules/chat-message/chat-message.md +52 -0
  85. package/components/molecules/chip-group/chip-group.css +35 -0
  86. package/components/molecules/chip-group/chip-group.md +42 -0
  87. package/components/molecules/content-index/content-index.css +87 -0
  88. package/components/molecules/content-index/content-index.md +27 -0
  89. package/components/molecules/content-source/content-source.css +6 -0
  90. package/components/molecules/content-source/content-source.md +13 -0
  91. package/components/molecules/figure/figure.css +19 -0
  92. package/components/molecules/figure/figure.md +20 -0
  93. package/components/molecules/lede/lede.css +17 -0
  94. package/components/molecules/lede/lede.md +17 -0
  95. package/components/molecules/made-with/made-with.css +25 -0
  96. package/components/molecules/made-with/made-with.md +35 -0
  97. package/components/molecules/nav-item/nav-item.css +19 -0
  98. package/components/molecules/nav-item/nav-item.md +21 -0
  99. package/components/molecules/stat-tile/stat-tile.css +34 -0
  100. package/components/molecules/stat-tile/stat-tile.md +50 -0
  101. package/components/molecules/status-list/status-list.css +47 -0
  102. package/components/molecules/status-list/status-list.md +62 -0
  103. package/components/molecules/tab/tab.css +32 -0
  104. package/components/molecules/tab/tab.md +27 -0
  105. package/components/molecules/table/table.css +23 -0
  106. package/components/molecules/table/table.md +18 -0
  107. package/components/organisms/activity-bar/activity-bar.css +36 -0
  108. package/components/organisms/activity-bar/activity-bar.md +43 -0
  109. package/components/organisms/app-shell/app-shell.css +193 -0
  110. package/components/organisms/app-shell/app-shell.md +58 -0
  111. package/components/organisms/app-shell/app-shell.test.ts +74 -0
  112. package/components/organisms/app-window/app-window.css +111 -0
  113. package/components/organisms/app-window/app-window.md +53 -0
  114. package/components/organisms/chat-log/chat-log.css +5 -0
  115. package/components/organisms/chat-log/chat-log.md +14 -0
  116. package/components/organisms/code-editor/code-editor.ai.md +31 -0
  117. package/components/organisms/code-editor/code-editor.css +111 -0
  118. package/components/organisms/code-editor/code-editor.md +122 -0
  119. package/components/organisms/console/console.css +112 -0
  120. package/components/organisms/console/console.md +66 -0
  121. package/components/organisms/file-tree/file-tree.css +85 -0
  122. package/components/organisms/file-tree/file-tree.md +49 -0
  123. package/components/organisms/note/note.css +19 -0
  124. package/components/organisms/note/note.md +20 -0
  125. package/components/organisms/notepad/notepad.css +60 -0
  126. package/components/organisms/notepad/notepad.md +40 -0
  127. package/components/organisms/side-rail/side-rail.css +55 -0
  128. package/components/organisms/side-rail/side-rail.md +24 -0
  129. package/components/organisms/sidebar-panel/sidebar-panel.css +69 -0
  130. package/components/organisms/sidebar-panel/sidebar-panel.md +47 -0
  131. package/components/organisms/status-bar/status-bar.css +33 -0
  132. package/components/organisms/status-bar/status-bar.md +28 -0
  133. package/components/organisms/tab-bar/tab-bar.css +48 -0
  134. package/components/organisms/tab-bar/tab-bar.md +26 -0
  135. package/components/organisms/timeline/timeline.css +51 -0
  136. package/components/organisms/timeline/timeline.md +42 -0
  137. package/components/organisms/topbar/topbar.css +8 -0
  138. package/components/organisms/topbar/topbar.md +26 -0
  139. package/components/responsive-polish.test.ts +43 -0
  140. package/components/tokens.test.ts +39 -0
  141. package/fonts/redaction-35-400.woff2 +0 -0
  142. package/fonts/redaction-400.woff2 +0 -0
  143. package/fonts/redaction-50-400.woff2 +0 -0
  144. package/fonts/redaction-70-400.woff2 +0 -0
  145. package/package.json +46 -0
  146. package/scripts/ai-dispatch.js +583 -0
  147. package/scripts/ai-dispatch.test.ts +85 -0
  148. package/scripts/ai-spotlight.d.ts +23 -0
  149. package/scripts/ai-spotlight.js +139 -0
  150. package/scripts/ai-spotlight.test.ts +31 -0
  151. package/scripts/catalog-peek.js +156 -0
  152. package/scripts/catalog-peek.test.ts +31 -0
  153. package/scripts/cmdk.js +159 -0
  154. package/scripts/demo-box.js +53 -0
  155. package/scripts/handoff.js +64 -0
  156. package/scripts/handoff.test.ts +36 -0
  157. package/scripts/lightbox.js +144 -0
  158. package/scripts/lightbox.test.ts +23 -0
  159. package/scripts/made-with.d.ts +2 -0
  160. package/scripts/made-with.js +22 -0
  161. package/scripts/made-with.test.ts +25 -0
  162. package/scripts/notepad.js +100 -0
  163. package/scripts/shell.js +204 -0
  164. package/scripts/shell.test.ts +50 -0
  165. package/scripts/tabs.js +127 -0
  166. package/scripts/tabs.test.ts +40 -0
  167. package/scripts/terminal.js +271 -0
  168. package/scripts/terminal.test.ts +36 -0
  169. package/scripts/theme-boot.js +15 -0
  170. package/scripts/theme.js +87 -0
  171. package/scripts/type-effect.js +25 -0
  172. package/scripts/xray.js +79 -0
  173. package/scripts/xray.test.ts +43 -0
  174. package/styles/cmdk.css +65 -0
  175. package/styles/global.css +80 -0
  176. package/styles/grain.css +47 -0
  177. package/styles/lightbox.css +78 -0
  178. package/styles/themes/_template.css +48 -0
  179. package/styles/themes/baguette.css +30 -0
  180. package/styles/themes/brioche.css +30 -0
  181. package/styles/variables.css +217 -0
@@ -0,0 +1,424 @@
1
+ // grain/catalog/catalog.ts — GRAIN's self-documenting "component catalog" (Storybook-style).
2
+ // Each component is documented by `<name>.md` (the Human view); an optional
3
+ // `<name>.ai.md` adds the AI view. A per-component Human/AI toggle swaps which view
4
+ // renders (not just its styling) — that toggle IS grain's grade-as-signal vocabulary,
5
+ // which is why the catalog lives in grain, not the substrate. The sidebar groups
6
+ // components by atomic-design layer (the directory under components/) as collapsible
7
+ // dropdowns, with a live search filter. Dependency-free: a tiny line parser, no
8
+ // markdown library, no CDN. It reads the filesystem directly (like ai/accepts.ts) and
9
+ // imports nothing from batch — the composition root passes the page-nav routes in.
10
+ import { readdirSync, readFileSync } from "fs";
11
+ import { join } from "path";
12
+
13
+ interface Panel { label: string; code: string; }
14
+ interface Group { label: string; panels: Panel[]; }
15
+ interface Doc { name: string; slug: string; intro: string; groups: Group[]; }
16
+ interface Component { layer: string; slug: string; name: string; human: Doc; ai: Doc | null; }
17
+
18
+ const slugify = (s: string) => s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
19
+ // escapes quotes too: esc() is interpolated into ATTRIBUTE contexts (e.g. data-name="…"),
20
+ // not just text, so a component name / route containing " must not be able to break out.
21
+ const esc = (s: string) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
22
+ const cap = (s: string) => s.charAt(0).toUpperCase() + s.slice(1);
23
+
24
+ // minimal inline markdown for prose: `code`, **bold**, *italic*, [text](url).
25
+ // Escapes first, then injects safe tags — author-controlled docs only.
26
+ const inline = (s: string) => esc(s)
27
+ .replace(/`([^`]+)`/g, "<code>$1</code>")
28
+ .replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>")
29
+ .replace(/\*([^*\n]+)\*/g, "<em>$1</em>")
30
+ .replace(/\[([^\]]+)\]\((https?:\/\/[^)]+|\/[^)]*|#[^)]*)\)/g, '<a href="$2">$1</a>');
31
+
32
+ // atomic-design layers render in this order; unknown dirs fall to the end.
33
+ const LAYER_ORDER = ["atoms", "molecules", "organisms"];
34
+ const rank = (layer: string) => { const i = LAYER_ORDER.indexOf(layer); return i < 0 ? 99 : i; };
35
+
36
+ // minimal markdown: # title, ## group, ### panel, ```html fences, plain prose.
37
+ function parseDoc(md: string): Doc {
38
+ const lines = md.split("\n");
39
+ const doc: Doc = { name: "Untitled", slug: "untitled", intro: "", groups: [] };
40
+ let group: Group | null = null;
41
+ let pendingLabel = "";
42
+ const intro: string[] = [];
43
+ let i = 0;
44
+
45
+ while (i < lines.length) {
46
+ const line = lines[i];
47
+ if (line.startsWith("# ")) { doc.name = line.slice(2).trim(); doc.slug = slugify(doc.name); i++; continue; }
48
+ if (line.startsWith("## ")) { group = { label: line.slice(3).trim(), panels: [] }; doc.groups.push(group); pendingLabel = ""; i++; continue; }
49
+ if (line.startsWith("### ")) { pendingLabel = line.slice(4).trim(); i++; continue; }
50
+ if (line.startsWith("```html")) {
51
+ const body: string[] = [];
52
+ i++;
53
+ while (i < lines.length && !lines[i].startsWith("```")) { body.push(lines[i]); i++; }
54
+ i++; // skip closing fence
55
+ if (!group) { group = { label: "", panels: [] }; doc.groups.push(group); }
56
+ group.panels.push({ label: pendingLabel, code: body.join("\n").trim() });
57
+ continue;
58
+ }
59
+ if (!group && line.trim()) intro.push(line.trim());
60
+ i++;
61
+ }
62
+ doc.intro = intro.join(" ");
63
+ return doc;
64
+ }
65
+
66
+ // `inject` mirrors makePageServer's seams: the catalog builds its own page shell (it isn't a
67
+ // pages/ file), so the composition root passes the SAME global assets here — headEnd for
68
+ // render-blocking bootstraps (theme pre-set), bodyEnd for deferred islands (palette, theming
69
+ // controls). Without it the catalog drifts from every other page (e.g. ignores the saved theme).
70
+ export interface CatalogInject { headEnd?: string; bodyEnd?: string; }
71
+
72
+ // `pages` is a plain thunk returning the page-nav routes (the composition root wires it to its
73
+ // sitemap) — the catalog stays decoupled from the substrate's Sitemap type, importing nothing
74
+ // from batch. Called at html()-render time, re-read on refresh().
75
+ export function createCatalog(componentsDir: string | string[], pages?: () => string[], inject: CatalogInject = {}) {
76
+ let cache: string | null = null;
77
+ let comps: Component[] | null = null;
78
+
79
+ function findMd(dir: string, out: string[]) {
80
+ for (const e of readdirSync(dir, { withFileTypes: true })) {
81
+ const full = join(dir, e.name);
82
+ if (e.isDirectory()) findMd(full, out);
83
+ else if (e.name.endsWith(".md")) out.push(full);
84
+ }
85
+ }
86
+
87
+ // Discover components per layer, pairing <name>.md (human) with <name>.ai.md (ai).
88
+ async function discover(): Promise<Component[]> {
89
+ const comps: Component[] = [];
90
+ // one or many component roots (e.g. grain/components + project/components); each
91
+ // contributes its atomic layers, merged by layer below.
92
+ const layerDirs: Array<{ layer: string; dir: string }> = [];
93
+ for (const root of ([] as string[]).concat(componentsDir))
94
+ for (const e of readdirSync(root, { withFileTypes: true }))
95
+ if (e.isDirectory()) layerDirs.push({ layer: e.name, dir: join(root, e.name) });
96
+ for (const { layer, dir } of layerDirs) {
97
+ const mds: string[] = [];
98
+ findMd(dir, mds);
99
+ const byBase = new Map<string, { human?: string; ai?: string }>();
100
+ for (const p of mds) {
101
+ const file = p.split(/[\\/]/).pop() ?? "";
102
+ const isAi = file.endsWith(".ai.md");
103
+ const base = file.replace(/\.ai\.md$/, "").replace(/\.md$/, "");
104
+ const slot = byBase.get(base) ?? {};
105
+ if (isAi) slot.ai = p; else slot.human = p;
106
+ byBase.set(base, slot);
107
+ }
108
+ for (const slot of byBase.values()) {
109
+ if (!slot.human) continue; // a component must have a human doc as its base
110
+ const human = parseDoc(readFileSync(slot.human, "utf8"));
111
+ const ai = slot.ai ? parseDoc(readFileSync(slot.ai, "utf8")) : null;
112
+ comps.push({ layer, slug: human.slug, name: human.name, human, ai });
113
+ }
114
+ }
115
+ comps.sort((a, b) => (rank(a.layer) - rank(b.layer)) || a.name.localeCompare(b.name));
116
+ return comps;
117
+ }
118
+
119
+ const getComps = async (): Promise<Component[]> => (comps ??= await discover());
120
+
121
+ // A doc's example may show a document-level tag (<body class="app-window-backdrop">, e.g.
122
+ // app-window.md's parent contract) for the copy/paste snippet's sake. HTML has no way to
123
+ // sandbox a SECOND <body>/<html>/<head> — the parser merges its attributes onto the real
124
+ // document's, so injecting it raw into .panel__live would leak the class onto the whole
125
+ // catalog page. Swap those three tags to <div> for the LIVE render only; the escaped
126
+ // <pre><code> copy below stays byte-for-byte accurate.
127
+ function liveSafe(code: string): string {
128
+ return code.replace(/<(\/?)(body|html|head)(\s|>)/gi, "<$1div$3");
129
+ }
130
+
131
+ function renderPanel(p: Panel): string {
132
+ // live = author-controlled design-system markup (not user data) → inject raw
133
+ return `<figure class="panel">
134
+ ${p.label ? `<figcaption class="panel__label">${esc(p.label)}</figcaption>` : ""}
135
+ <div class="panel__live">${liveSafe(p.code)}</div>
136
+ <div class="panel__src">
137
+ <button class="panel__copy" type="button">Copy</button>
138
+ <pre><code>${esc(p.code)}</code></pre>
139
+ </div>
140
+ </figure>`;
141
+ }
142
+
143
+ const renderGroups = (groups: Group[]) => groups.map(g => `
144
+ ${g.label ? `<h3 class="cat-group">${esc(g.label)}</h3>` : ""}
145
+ <div class="panel-grid">${g.panels.map(renderPanel).join("")}</div>`).join("");
146
+
147
+ const renderView = (doc: Doc, view: "smooth" | "grain") => `<div class="cat-doc__view" data-view="${view}">
148
+ ${doc.intro ? `<p class="cat-intro">${inline(doc.intro)}</p>` : ""}
149
+ ${renderGroups(doc.groups)}
150
+ </div>`;
151
+
152
+ function renderDoc(c: Component): string {
153
+ const ai = c.ai ?? c.human; // no .ai.md → AI view re-uses the human panels, grain-flipped
154
+ return `<section class="cat-doc" id="${c.slug}" data-grade="smooth" data-layer="${c.layer}">
155
+ <header class="cat-doc__head">
156
+ <div class="cat-doc__title">
157
+ <p class="cat-doc__eyebrow">${esc(cap(c.layer))}</p>
158
+ <h2>${esc(c.name)}</h2>
159
+ </div>
160
+ <div class="grade-toggle" role="group" aria-label="Interaction mode for ${esc(c.name)}">
161
+ <button type="button" class="grade-toggle__btn is-on" data-grade-set="smooth">Human</button>
162
+ <button type="button" class="grade-toggle__btn" data-grade-set="grain">AI</button>
163
+ </div>
164
+ </header>
165
+ ${renderView(c.human, "smooth")}
166
+ ${renderView(ai, "grain")}
167
+ </section>`;
168
+ }
169
+
170
+ // a flat list of components for external indexes (e.g. global search)
171
+ async function entries(): Promise<Array<{ name: string; slug: string; layer: string }>> {
172
+ return (await getComps()).map((c) => ({ name: c.name, slug: c.slug, layer: c.layer }));
173
+ }
174
+
175
+ async function html(): Promise<string> {
176
+ if (cache != null) return cache;
177
+ const list = await getComps();
178
+
179
+ const byLayer = new Map<string, Component[]>();
180
+ for (const c of list) { if (!byLayer.has(c.layer)) byLayer.set(c.layer, []); byLayer.get(c.layer)!.push(c); }
181
+ const navGroups = [...byLayer.entries()].map(([layer, list]) => `
182
+ <details class="cat-nav__group" open>
183
+ <summary>${esc(cap(layer))}</summary>
184
+ ${list.map(c => `<a href="#${c.slug}" data-name="${esc(c.name.toLowerCase())}">${esc(c.name)}</a>`).join("")}
185
+ </details>`).join("");
186
+
187
+ const pageNav = (pages?.() ?? []).map(p => `<a href="${p}">${esc(p)}</a>`).join("");
188
+ const main = list.length ? list.map(renderDoc).join("") : `<p>No <code>.md</code> docs found under the components dir.</p>`;
189
+
190
+ cache = page(pageNav, navGroups, main, inject);
191
+ return cache;
192
+ }
193
+
194
+ function refresh() { cache = null; comps = null; }
195
+ return { html, entries, refresh };
196
+ }
197
+
198
+ // the catalog shell — links the real design-system CSS so examples render for real
199
+ function page(pageNav: string, navGroups: string, main: string, inject: CatalogInject = {}): string {
200
+ return `<!DOCTYPE html>
201
+ <html lang="en">
202
+ <head>
203
+ <meta charset="utf-8">
204
+ <meta name="viewport" content="width=device-width, initial-scale=1">
205
+ <title>Component Catalog</title>${inject.headEnd ?? ""}
206
+ <link rel="stylesheet" href="/styles/variables.css">
207
+ <link rel="stylesheet" href="/styles/global.css">
208
+ <link rel="stylesheet" href="/styles/grain.css">
209
+ <link rel="stylesheet" href="/components.css">
210
+ <style>
211
+ /* semantic tokens so the catalog follows BOTH theme axes (scheme + flavor) — the same
212
+ data-color-scheme/data-theme the render-blocking theme-boot inject applies from storage,
213
+ so an embedded catalog matches its host. */
214
+ body { margin: 0; background: var(--color-bg); color: var(--color-fg); }
215
+ .cat { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: var(--color-bg); }
216
+ .cat-nav { position: sticky; top: 0; align-self: start; height: 100vh; overflow: auto;
217
+ padding: var(--space-6) var(--space-4); border-right: 1px solid var(--color-line); }
218
+ .cat-back { display: inline-flex; align-items: center; margin-bottom: var(--space-4);
219
+ font-size: var(--text-sm); color: var(--color-muted); text-decoration: none; }
220
+ .cat-back:hover { color: var(--ink); text-decoration: underline; }
221
+ .cat-nav h1 { font-size: var(--text-lg); margin: 0 0 var(--space-3); }
222
+ .cat-nav__auto { font-size: var(--text-xs); color: var(--color-muted); margin: 0 0 var(--space-4); }
223
+ .cat-search { width: 100%; box-sizing: border-box; margin-bottom: var(--space-4);
224
+ padding: var(--space-1) var(--space-2); font-family: var(--font-smooth); font-size: var(--text-sm);
225
+ color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: var(--radius-sm); }
226
+ .cat-search::placeholder { color: var(--ink-faint); }
227
+ .cat-nav__heading { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em;
228
+ color: var(--color-muted); margin: var(--space-4) 0 var(--space-1); }
229
+ .cat-nav__group { margin-bottom: var(--space-2); }
230
+ .cat-nav__group > summary { cursor: pointer; list-style: none; padding: var(--space-1) 0;
231
+ font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); }
232
+ .cat-nav__group > summary::-webkit-details-marker { display: none; }
233
+ .cat-nav__group > summary::before { content: "▸ "; }
234
+ .cat-nav__group[open] > summary::before { content: "▾ "; }
235
+ .cat-nav a { display: block; color: var(--color-muted); text-decoration: none; padding: var(--space-1) 0; }
236
+ .cat-nav a:hover { color: var(--ink); text-decoration: underline; }
237
+ .cat-main { padding: var(--space-8); max-width: 900px; }
238
+ /* each component reads as a bounded CARD (hairline + generous padding), not bare text loose on
239
+ the page — a doc with no live panels (a CSS-only pattern component, prose-only) used to read
240
+ as an unstyled wall between two anonymous headings; the border gives every entry the same
241
+ footing regardless of how much it renders. No background of its own (stays page-toned) so
242
+ .panel's --color-surface stays the one lifted tone inside it — this system has no third tier. */
243
+ .cat-doc {
244
+ margin-bottom: var(--space-8); scroll-margin-top: var(--space-4);
245
+ padding: var(--space-6); border: 1px solid var(--color-line); border-radius: var(--radius-md);
246
+ }
247
+ .cat-doc h2 { font-size: var(--text-2xl); margin: 0; }
248
+ .cat-doc__eyebrow { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em;
249
+ color: var(--color-muted); margin: 0 0 var(--space-1); }
250
+ .cat-doc__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4);
251
+ flex-wrap: wrap; padding-bottom: var(--space-3); margin-bottom: var(--space-4);
252
+ border-bottom: 1px solid var(--color-line); } /* masthead rhythm: title block → hairline → body */
253
+ .grade-toggle { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--radius-sm); overflow: hidden; }
254
+ .grade-toggle__btn { font-family: var(--font-smooth); font-size: var(--text-xs); text-transform: uppercase;
255
+ letter-spacing: 0.08em; padding: var(--space-1) var(--space-3); cursor: pointer;
256
+ background: transparent; color: var(--ink); border: 0; }
257
+ .grade-toggle__btn.is-on { background: var(--ink); color: var(--paper); }
258
+ /* Human/AI: show exactly one view, chosen by the section's data-grade */
259
+ .cat-doc__view[data-view="grain"] { display: none; }
260
+ .cat-doc[data-grade="grain"] .cat-doc__view[data-view="smooth"] { display: none; }
261
+ .cat-doc[data-grade="grain"] .cat-doc__view[data-view="grain"] { display: block; }
262
+ /* the toggle re-grades only the rendered component PREVIEWS — never the catalog's
263
+ own chrome (titles, prose, labels, code). Neutralise the section-wide grain that
264
+ the global [data-grade] rule would cascade, then re-apply grain to .panel__live. */
265
+ .cat-doc[data-grade="grain"] { --type-font: var(--font-smooth); }
266
+ .cat-doc__view[data-view="grain"] .panel__live { --type-font: var(--font-grain); }
267
+ .cat-intro { color: var(--color-muted); margin: 0 0 var(--space-6); }
268
+ .cat-intro code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em;
269
+ background: var(--paper-2); padding: 0 0.3em; border-radius: 2px; color: var(--ink); }
270
+ .cat-intro strong { color: var(--ink); font-weight: var(--font-weight-semibold); }
271
+ .cat-intro a { color: var(--ink); }
272
+ .cat-group { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.05em;
273
+ color: var(--color-muted); margin: var(--space-6) 0 var(--space-3); }
274
+ .panel-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
275
+ .panel { margin: 0; border: 1px solid var(--color-line); border-radius: var(--radius-md);
276
+ overflow: hidden; background: var(--color-surface); }
277
+ .panel__label { font-size: var(--text-xs); font-weight: var(--font-weight-semibold);
278
+ text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted);
279
+ padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-line); }
280
+ .panel__live { padding: var(--space-6); display: flex; align-items: center; justify-content: center; background: var(--color-bg); }
281
+ .panel__src { position: relative; border-top: 1px solid var(--color-line); }
282
+ .panel__src pre { margin: 0; padding: var(--space-3); overflow-x: auto;
283
+ font-size: var(--text-xs); line-height: var(--leading-normal); background: var(--ink); color: var(--paper); }
284
+ .panel__copy { position: absolute; top: var(--space-2); right: var(--space-2);
285
+ font-size: var(--text-xs); padding: var(--space-1) var(--space-2); cursor: pointer;
286
+ border: 1px solid var(--color-line); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-fg); }
287
+ .panel__copy.copied { border-color: var(--ink); }
288
+
289
+ /* the nav toggle + close are wide-screen-hidden; the two-column layout needs neither */
290
+ .cat-navtoggle, .cat-nav__close { display: none; }
291
+
292
+ /* Narrow (e.g. embedded in a sidebar iframe, or a real phone): there's no room for a
293
+ persistent 240px menu, so the nav COLLAPSES by default and opens FULL-WIDTH over the
294
+ main — the small-screen drawer pattern. The narrow catalog-peek sidebar inherits this. */
295
+ @media (max-width: 640px) {
296
+ .cat { grid-template-columns: 1fr; }
297
+ .cat-navtoggle { display: inline-flex; align-items: center; position: sticky; top: 0; z-index: 30;
298
+ width: 100%; box-sizing: border-box; padding: var(--space-3) var(--space-4);
299
+ border: 0; border-bottom: 1px solid var(--color-line); background: var(--paper); color: var(--ink);
300
+ font-family: var(--font-smooth); font-size: var(--text-sm); text-transform: uppercase;
301
+ letter-spacing: 0.06em; cursor: pointer; }
302
+ .cat-nav { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100dvh;
303
+ background: var(--paper); /* opaque: a full-screen drawer OVER the main, not see-through */
304
+ transform: translateX(-100%); transition: transform 0.25s ease; overscroll-behavior: contain; }
305
+ .cat[data-nav="open"] .cat-nav { transform: none; } /* full-screen takeover */
306
+ .cat-nav__close { display: inline-flex; align-items: center; background: transparent; border: 0;
307
+ padding: 0 0 var(--space-3); font-family: var(--font-smooth); font-size: var(--text-sm);
308
+ text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); cursor: pointer; }
309
+ .cat-main { padding: var(--space-6); overscroll-behavior: contain; }
310
+ }
311
+ @media (prefers-reduced-motion: reduce) { .cat-nav { transition: none; } }
312
+
313
+ /* Peek "single" mode: a host that embeds the catalog as a one-at-a-time browser (e.g. the
314
+ /grain sidebar) sets data-peek-single on .cat and toggles .is-peek-active on ONE entry —
315
+ hovering a component elsewhere just swaps which entry shows. Only the active entry renders,
316
+ fading in; nothing scrolls across the long list (no far-scroll thrash). */
317
+ .cat[data-peek-single] .cat-doc { display: none; }
318
+ .cat[data-peek-single] .cat-doc.is-peek-active { display: block;
319
+ animation: cat-peek-fade 0.55s cubic-bezier(0.22, 1, 0.36, 1); } /* gentle: slow, eased, slight rise */
320
+ @keyframes cat-peek-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
321
+ /* single mode is host-driven (hover / Full page) — the host's own header names it, so hide the
322
+ catalog's redundant "☰ Catalog" toggle bar (no stacked double "Catalog"). */
323
+ .cat[data-peek-single] .cat-navtoggle { display: none; }
324
+ @media (prefers-reduced-motion: reduce) {
325
+ .cat[data-peek-single] .cat-doc.is-peek-active { animation: none; }
326
+ }
327
+ </style>
328
+ </head>
329
+ <body>
330
+ <div class="cat" data-nav="closed">
331
+ <button class="cat-navtoggle" type="button" aria-controls="cat-nav" aria-expanded="false">☰&nbsp;&nbsp;Catalog</button>
332
+ <aside class="cat-nav" id="cat-nav">
333
+ <!-- a clear way back (the component nav below isn't an obvious exit); hidden when embedded
334
+ in a peek sidebar iframe, where the host provides its own close/expand controls. -->
335
+ <a class="cat-back" href="/">←&nbsp;&nbsp;Back</a>
336
+ <button class="cat-nav__close" type="button" aria-label="Close menu">✕&nbsp;&nbsp;Close</button>
337
+ <h1>Catalog</h1>
338
+ <p class="cat-nav__auto">Auto-generated by GRAIN from each component's <code>.md</code> doc — not hand-authored.</p>
339
+ <input class="cat-search" type="search" placeholder="Search components…" aria-label="Search components">
340
+ <p class="cat-nav__heading">Pages</p>
341
+ ${pageNav}
342
+ <p class="cat-nav__heading">Components</p>
343
+ ${navGroups}
344
+ </aside>
345
+ <main class="cat-main">
346
+ ${main}
347
+ </main>
348
+ </div>
349
+ <script>
350
+ // copy a panel's source to the clipboard (no storage, no deps)
351
+ document.addEventListener("click", async (e) => {
352
+ const btn = e.target.closest(".panel__copy");
353
+ if (!btn) return;
354
+ const code = btn.parentElement.querySelector("code").textContent;
355
+ try { await navigator.clipboard.writeText(code); } catch {}
356
+ btn.textContent = "Copied"; btn.classList.add("copied");
357
+ setTimeout(() => { btn.textContent = "Copy"; btn.classList.remove("copied"); }, 1200);
358
+ });
359
+
360
+ // Human/AI toggle: set data-grade on the component's section → swaps the visible view.
361
+ document.addEventListener("click", (e) => {
362
+ const b = e.target.closest(".grade-toggle__btn");
363
+ if (!b) return;
364
+ const doc = b.closest(".cat-doc");
365
+ if (!doc) return;
366
+ doc.setAttribute("data-grade", b.dataset.gradeSet);
367
+ doc.querySelectorAll(".grade-toggle__btn").forEach((x) => x.classList.toggle("is-on", x === b));
368
+ });
369
+
370
+ // Back button: hidden when embedded in a peek sidebar (the host has its own controls).
371
+ // On the full page, prefer real history-back (→ wherever you came from), else fall to href="/".
372
+ const back = document.querySelector(".cat-back");
373
+ if (back) {
374
+ if (window.self !== window.top) back.style.display = "none";
375
+ else back.addEventListener("click", (e) => { if (history.length > 1) { e.preventDefault(); history.back(); } });
376
+ }
377
+
378
+ // narrow-mode nav drawer: the toggle opens the full-width menu; the close button and
379
+ // selecting a component (or a page link) collapse it again. No-op on wide screens
380
+ // (the toggle/close are display:none there, so these never fire).
381
+ const cat = document.querySelector(".cat");
382
+ const navToggle = document.querySelector(".cat-navtoggle");
383
+ const setNav = (open) => {
384
+ cat.setAttribute("data-nav", open ? "open" : "closed");
385
+ navToggle && navToggle.setAttribute("aria-expanded", open ? "true" : "false");
386
+ };
387
+ navToggle && navToggle.addEventListener("click", () => setNav(cat.getAttribute("data-nav") !== "open"));
388
+ document.querySelector(".cat-nav__close")?.addEventListener("click", () => setNav(false));
389
+ // set which entry is shown in peek "single" mode (host or nav both use .is-peek-active)
390
+ const setActive = (slug) => {
391
+ const el = slug && document.getElementById(slug);
392
+ if (!el) return;
393
+ document.querySelectorAll(".cat-doc.is-peek-active").forEach((d) => d.classList.remove("is-peek-active"));
394
+ el.classList.add("is-peek-active");
395
+ };
396
+ window.__catSetActive = setActive; // host (peek sidebar) drives this on hover
397
+ document.querySelectorAll(".cat-nav a").forEach((a) => a.addEventListener("click", () => {
398
+ setNav(false);
399
+ if (cat.getAttribute("data-peek-single") !== null) {
400
+ const href = a.getAttribute("href") || "";
401
+ if (href.startsWith("#")) setActive(href.slice(1)); // component links; page links navigate normally
402
+ }
403
+ }));
404
+
405
+ // sidebar search: filter component links; hide empty groups; open groups while searching.
406
+ const search = document.querySelector(".cat-search");
407
+ if (search) search.addEventListener("input", () => {
408
+ const q = search.value.trim().toLowerCase();
409
+ document.querySelectorAll(".cat-nav__group").forEach((group) => {
410
+ let any = false;
411
+ group.querySelectorAll("a").forEach((a) => {
412
+ const hit = !q || (a.dataset.name || "").includes(q);
413
+ a.style.display = hit ? "" : "none";
414
+ if (hit) any = true;
415
+ });
416
+ group.style.display = any ? "" : "none";
417
+ if (q) group.open = true;
418
+ });
419
+ });
420
+ </script>
421
+ ${inject.bodyEnd ?? ""}
422
+ </body>
423
+ </html>`;
424
+ }
@@ -0,0 +1,17 @@
1
+ /* atoms/action-badge — the AI's action verb as a badge. It's AI by nature, so it always
2
+ wears the non-text grain (dashed "terminal" edge + grain family), the same vocabulary as
3
+ b-button / b-badge in transit. `data-status` carries the step's state:
4
+ (default) done → dashed outline, muted ink
5
+ active → filled ink (the AI is doing THIS now) */
6
+ .action-badge {
7
+ display: inline-block;
8
+ font-family: var(--font-grain); /* always grain — the AI is always the actor */
9
+ font-size: var(--text-xs);
10
+ text-transform: uppercase; letter-spacing: 0.08em;
11
+ padding: 0 var(--space-2);
12
+ color: var(--ink-muted);
13
+ border: 1px dashed var(--ink); border-radius: var(--radius-pill);
14
+ }
15
+ .action-badge[data-status="active"] {
16
+ background: var(--ink); color: var(--paper); border-style: solid;
17
+ }
@@ -0,0 +1,6 @@
1
+ <!-- atoms/action-badge — ONE step of the AI's work, shown as its ACTION VERB. The label
2
+ is an ActionName-derived word (reads / types / clicks / revises / commits — see
3
+ grain/ai/contract.ts); it's the closed verb vocabulary, made visible. The AI is
4
+ always the actor, so it ALWAYS wears the grain "terminal" edge; `status="active"`
5
+ fills it (doing it now) vs the settled outline (done). -->
6
+ <span class="action-badge" prop-attr-data-status="status" prop-text="verb">acts</span>
@@ -0,0 +1,23 @@
1
+ # Action badge
2
+
3
+ One step of the AI's work, shown as its **action verb** — the closed verb vocabulary
4
+ (`grain/ai/contract.ts`) made visible. The AI narrates a run as a stream of these
5
+ (`reads → types → revises → clicks → commits`). It's AI by nature, so it always wears the
6
+ grain "terminal" edge; `status` carries the step's state.
7
+
8
+ `verb` sets the label; `status="active"` marks the step the AI is doing right now.
9
+
10
+ ## States
11
+
12
+ ### Doing it now (active)
13
+ ```html
14
+ <action-badge verb="clicks" status="active"></action-badge>
15
+ ```
16
+
17
+ ### Done (settled)
18
+ ```html
19
+ <action-badge verb="reads"></action-badge>
20
+ <action-badge verb="types"></action-badge>
21
+ <action-badge verb="revises"></action-badge>
22
+ <action-badge verb="commits"></action-badge>
23
+ ```
@@ -0,0 +1,15 @@
1
+ /* atoms/b-badge — one class; tone via attribute. Monochrome: a hairline tag, no
2
+ fill, no pill. State is carried by ink vs muted, not by hue (DESIGN-SYSTEM §2). */
3
+ .badge {
4
+ font-size: var(--text-xs); padding: 0 var(--space-2);
5
+ border: 1px solid var(--line-soft); border-radius: var(--radius-pill);
6
+ background: transparent;
7
+ }
8
+ .badge[data-status="active"] { color: var(--ink); border-color: var(--ink); }
9
+ .badge[data-status="archived"] { color: var(--ink-faint); }
10
+
11
+ /* ---- AI / in-transit: the non-text grain. A badge the AI is setting (live pending, or
12
+ any grain ancestor) wears the dashed "terminal" edge; the label already swaps to the
13
+ grain family via --type-font. Same vocabulary as the button + field. */
14
+ .badge[data-commit="pending"],
15
+ [data-grade="grain"] .badge { border-style: dashed; border-color: var(--ink); }
@@ -0,0 +1,2 @@
1
+ <!-- atoms/b-badge — ONE class (.badge); tone is an attribute, not a second class -->
2
+ <span class="badge" data-status="active" data-bind-data-status="tone" data-field="label">active</span>
@@ -0,0 +1,16 @@
1
+ # Badge
2
+
3
+ One class — `.badge`. Tone is an attribute (`data-status`), not a second class.
4
+ Monochrome: state reads as ink vs faint, not hue (DESIGN-SYSTEM §2).
5
+
6
+ ## Tones
7
+
8
+ ### Active
9
+ ```html
10
+ <span class="badge" data-status="active">Active</span>
11
+ ```
12
+
13
+ ### Archived
14
+ ```html
15
+ <span class="badge" data-status="archived">Archived</span>
16
+ ```
@@ -0,0 +1,22 @@
1
+ # Button
2
+
3
+ When the AI is acting through a button, it wears the **non-text grain**: a dashed
4
+ "terminal" edge + a blinking block caret, with the label in the Redaction grain family —
5
+ the same inherited grade state the text uses. It settles back to clean on commit.
6
+
7
+ ## In-transit
8
+
9
+ ### Working
10
+ ```html
11
+ <button class="btn" data-commit="pending">Working…</button>
12
+ ```
13
+
14
+ ### Archiving (small)
15
+ ```html
16
+ <button class="btn" data-size="sm" data-commit="pending">Archiving…</button>
17
+ ```
18
+
19
+ ### Full width
20
+ ```html
21
+ <button class="btn" style="width:100%" data-commit="pending">Rescheduling your week…</button>
22
+ ```
@@ -0,0 +1,87 @@
1
+ /* atoms/b-button — the button, ONE class: .btn. Variants are ATTRIBUTES, not
2
+ extra classes (vanilla CSS, no utility soup). The component owns its styling.
3
+ Accent is three CSS vars scoped to .btn; a status attribute repoints them, so
4
+ every variant inherits the new color for free.
5
+ Each pseudo-state has a parallel data-force value so the catalog can show it
6
+ statically (e.g. .btn:hover AND .btn[data-force~="hover"]). */
7
+
8
+ .btn {
9
+ /* accent token set — [data-status] overrides these */
10
+ --btn-accent: var(--color-primary);
11
+ --btn-accent-hover: var(--color-primary-hover);
12
+ --btn-accent-contrast: var(--color-primary-contrast);
13
+ --btn-accent-soft: var(--color-primary-soft);
14
+
15
+ display: inline-flex; align-items: center; justify-content: center;
16
+ gap: var(--space-2);
17
+ font-family: var(--type-font);
18
+ font-weight: var(--font-weight-medium);
19
+ font-size: var(--text-sm);
20
+ letter-spacing: 0.08em; text-transform: uppercase; /* DESIGN-SYSTEM §3 button label */
21
+ line-height: var(--leading-normal);
22
+ min-height: 2.75rem; /* ≥44px touch target (DESIGN-SYSTEM §7) */
23
+ padding: var(--space-2) var(--space-4);
24
+ border: var(--border); /* ink hairline — no fill, no shadow */
25
+ border-radius: var(--radius-sm);
26
+ cursor: pointer;
27
+ transition: background-color 0.15s, color 0.15s;
28
+
29
+ /* default = transparent fill, ink border + label (DESIGN-SYSTEM §5 Buttons) */
30
+ background: transparent;
31
+ color: var(--ink);
32
+ }
33
+
34
+ /* ---- sizes (attribute) ---- */
35
+ .btn[data-size="sm"] { min-height: 0; padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
36
+ .btn[data-size="lg"] { padding: var(--space-3) var(--space-5); font-size: var(--text-base); }
37
+ /* On a phone the small button's dense min-height:0 lands ~30px - below the touch
38
+ target floor (DESIGN-SYSTEM §7). Restore a comfortable tap size at the narrow
39
+ breakpoint without fattening the dense desktop rows. */
40
+ @media (max-width: 768px) { .btn[data-size="sm"] { min-height: 2.5rem; } }
41
+
42
+ /* ---- variants (attribute). Monochrome: the difference is fill, not hue ---- */
43
+ .btn[data-variant="soft"] { background: var(--paper-2); }
44
+ .btn[data-variant="outline"] { background: transparent; } /* already the default look */
45
+
46
+ /* ---- status (attribute): repoint the accent token set ---- */
47
+ .btn[data-status="success"] {
48
+ --btn-accent: var(--color-success); --btn-accent-hover: var(--color-success-hover);
49
+ --btn-accent-contrast: var(--color-success-contrast); --btn-accent-soft: var(--color-success-soft);
50
+ }
51
+ .btn[data-status="danger"] {
52
+ --btn-accent: var(--color-danger); --btn-accent-hover: var(--color-danger-hover);
53
+ --btn-accent-contrast: var(--color-danger-contrast); --btn-accent-soft: var(--color-danger-soft);
54
+ }
55
+
56
+ /* ---- pseudo-states. Hover = a quiet ink WASH (DESIGN-SYSTEM §5), never an invert and
57
+ never a new hue — the full ink-fill invert read as a loud accent block and revealed the
58
+ corner radius on otherwise-flat buttons (regression, 2026-07-04). ---- */
59
+ .btn:hover, .btn[data-force~="hover"] { background: color-mix(in srgb, var(--ink) 8%, transparent); }
60
+
61
+ .btn:focus-visible, .btn[data-force~="focus"] { outline: 2px solid var(--color-accent); outline-offset: 2px; }
62
+ .btn:active, .btn[data-force~="active"] { transform: translateY(1px); }
63
+
64
+ .btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
65
+
66
+ /* ---- AI / in-transit: the non-text grain (grade = commit state, AI-INTERFACE §5).
67
+ Same idea as the text grain, expressed for a button: the label already swaps to the
68
+ Redaction grain family via the inherited --type-font; here we add the "retro terminal"
69
+ edge — a dashed border + a blinking block caret — that says "machine-made, not settled".
70
+ Keyed off the button's own pending state OR any grain ancestor (e.g. the catalog toggle). */
71
+ .btn[data-commit="pending"],
72
+ .btn[data-grade="grain"],
73
+ [data-grade="grain"] .btn {
74
+ border-style: dashed; /* a control the AI is using — terminal edge + grain label */
75
+ pointer-events: none; /* one intent at a time while the writer works */
76
+ }
77
+ /* processing indicator: a blinking block caret after the label = "this control is
78
+ working". A flex item (the button is inline-flex) so it sits to the RIGHT of the
79
+ label, vertically centred — not absolutely positioned (that was the old top-left bug,
80
+ a collision with the spotlight pulse, which now lives on ::before). */
81
+ .btn[data-commit="pending"]::after {
82
+ content: ""; align-self: center;
83
+ width: 0.5ch; height: 1.05em; margin-left: 0.45ch;
84
+ background: currentColor;
85
+ animation: caret-blink 1s steps(1) infinite; /* keyframes in grain/styles/grain.css */
86
+ }
87
+ @media (prefers-reduced-motion: reduce) { .btn[data-commit="pending"]::after { animation: none; } }
@@ -0,0 +1,5 @@
1
+ <!-- atoms/b-button — ONE class (.btn). Polymorphic: `as="a"` for links, else <button>.
2
+ label → text (prop-text); variant/size/status/href/type → attributes (config props). -->
3
+ <slot-tag prop-as="button" class="btn" prop-text="label"
4
+ prop-attr-type="type" prop-attr-href="href"
5
+ prop-attr-data-variant="variant" prop-attr-data-size="size" prop-attr-data-status="status">Button</slot-tag>