@reqvire-org/ads 0.3.42 → 0.3.44

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 (131) hide show
  1. package/README.md +11 -5
  2. package/dist/assets.mjs +48 -2
  3. package/dist/bootstrap-ds/ADS.md +2 -1
  4. package/dist/bootstrap-ds/README.md +25 -14
  5. package/dist/bootstrap-ds/design-system/assets/brand/README.md +26 -19
  6. package/dist/bootstrap-ds/design-system/assets/brand/app-icon.svg +4 -0
  7. package/dist/bootstrap-ds/design-system/assets/brand/logo.dark.svg +6 -0
  8. package/dist/bootstrap-ds/design-system/assets/brand/logo.svg +6 -0
  9. package/dist/bootstrap-ds/design-system/components/Actions/Button/Button.ads.fixture.ts +1 -0
  10. package/dist/bootstrap-ds/design-system/components/Actions/Button/Button.ads.scenario.tsx +13 -0
  11. package/dist/bootstrap-ds/design-system/components/Actions/Button/Button.tsx +49 -0
  12. package/dist/bootstrap-ds/design-system/components/Actions/Button/README.md +12 -0
  13. package/dist/bootstrap-ds/design-system/components/Content/Logo/Logo.ads.fixture.ts +1 -0
  14. package/dist/bootstrap-ds/design-system/components/Content/Logo/Logo.ads.scenario.tsx +12 -0
  15. package/dist/bootstrap-ds/design-system/components/Content/Logo/Logo.tsx +41 -0
  16. package/dist/bootstrap-ds/design-system/components/Content/Logo/README.md +10 -0
  17. package/dist/bootstrap-ds/design-system/components/Forms/TextField/README.md +14 -0
  18. package/dist/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.fixture.ts +6 -0
  19. package/dist/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +13 -0
  20. package/dist/bootstrap-ds/design-system/components/Forms/TextField/TextField.tsx +57 -0
  21. package/dist/bootstrap-ds/design-system/composition/Search/SearchPage/README.md +4 -0
  22. package/dist/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +7 -0
  23. package/dist/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +16 -0
  24. package/dist/bootstrap-ds/design-system/index.ts +5 -1
  25. package/dist/bootstrap-ds/design-system/patterns/Search/SearchBar/README.md +12 -0
  26. package/dist/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +1 -0
  27. package/dist/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +11 -0
  28. package/dist/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.tsx +41 -0
  29. package/dist/bootstrap-ds/design-system/review/brand-preview/BrandPreview.tsx +115 -0
  30. package/dist/bootstrap-ds/design-system/review/demo-frame/DemoFrame.tsx +29 -0
  31. package/dist/bootstrap-ds/design-system/review/index.ts +3 -0
  32. package/dist/bootstrap-ds/design-system/review/screen-frame/ScreenFrame.tsx +34 -0
  33. package/dist/bootstrap-ds/design-system/review/token-preview/TokenPreview.tsx +107 -19
  34. package/dist/bootstrap-ds/design-system/tokens/Brand.ads.fixture.ts +12 -0
  35. package/dist/bootstrap-ds/design-system/tokens/Brand.ads.scenario.tsx +4 -0
  36. package/dist/bootstrap-ds/design-system/tokens/Color.ads.fixture.ts +18 -0
  37. package/dist/bootstrap-ds/design-system/tokens/{Foundation.ads.scenario.tsx → Color.ads.scenario.tsx} +1 -1
  38. package/dist/{skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.ads.fixture.ts → bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.fixture.ts} +1 -13
  39. package/dist/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.scenario.tsx +4 -0
  40. package/dist/bootstrap-ds/ds.config.json +2 -1
  41. package/dist/bootstrap-ds-preact/design-system/review/demo-frame/DemoFrame.tsx +29 -0
  42. package/dist/bootstrap-ds-preact/design-system/review/screen-frame/ScreenFrame.tsx +34 -0
  43. package/dist/bootstrap-ds-preact/design-system/review/token-preview/TokenPreview.tsx +119 -0
  44. package/dist/bootstrap-ds-preact/design-system/showcase/mcp/main.tsx +6 -0
  45. package/dist/bootstrap-ds-preact/ds.config.json +20 -0
  46. package/dist/bootstrap-ds-preact/package.json +38 -0
  47. package/dist/bootstrap-ds-preact/src/vite-env.d.ts +7 -0
  48. package/dist/bootstrap-ds-preact/tsconfig.json +36 -0
  49. package/dist/bootstrap-ds-preact/vite.config.ts +23 -0
  50. package/dist/brand-assets.mjs +136 -3
  51. package/dist/check.mjs +4 -2
  52. package/dist/config.mjs +49 -1
  53. package/dist/init.mjs +16 -7
  54. package/dist/mcp/preview-widget.bundle.js +1 -1
  55. package/dist/mcp/project-widget.bundle.js +1 -1
  56. package/dist/mcp/server.mjs +5 -2
  57. package/dist/mcp/showcase-host.mjs +5 -1
  58. package/dist/preview-builder.mjs +8 -2
  59. package/dist/preview-bun.mjs +4 -2
  60. package/dist/preview-resources.mjs +1 -1
  61. package/dist/scenarios.mjs +11 -4
  62. package/dist/skills/ads-break-ui/SKILL.md +2 -2
  63. package/dist/skills/ads-designer/SKILL.md +42 -19
  64. package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +2 -1
  65. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +25 -14
  66. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/README.md +26 -19
  67. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/app-icon.svg +4 -0
  68. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/logo.dark.svg +6 -0
  69. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/logo.svg +6 -0
  70. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.ads.fixture.ts +1 -0
  71. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.ads.scenario.tsx +13 -0
  72. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.tsx +49 -0
  73. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/README.md +12 -0
  74. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Content/Logo/Logo.ads.fixture.ts +1 -0
  75. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Content/Logo/Logo.ads.scenario.tsx +12 -0
  76. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Content/Logo/Logo.tsx +41 -0
  77. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Content/Logo/README.md +10 -0
  78. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/README.md +14 -0
  79. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.fixture.ts +6 -0
  80. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +13 -0
  81. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.tsx +57 -0
  82. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/README.md +4 -0
  83. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +7 -0
  84. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +16 -0
  85. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/index.ts +5 -1
  86. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/README.md +12 -0
  87. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +1 -0
  88. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +11 -0
  89. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.tsx +41 -0
  90. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/brand-preview/BrandPreview.tsx +115 -0
  91. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/demo-frame/DemoFrame.tsx +29 -0
  92. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/index.ts +3 -0
  93. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/screen-frame/ScreenFrame.tsx +34 -0
  94. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/token-preview/TokenPreview.tsx +107 -19
  95. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Brand.ads.fixture.ts +12 -0
  96. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Brand.ads.scenario.tsx +4 -0
  97. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Color.ads.fixture.ts +18 -0
  98. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/{Foundation.ads.scenario.tsx → Color.ads.scenario.tsx} +1 -1
  99. package/dist/{bootstrap-ds/design-system/tokens/Foundation.ads.fixture.ts → skills/ads-designer/assets/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.fixture.ts} +1 -13
  100. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.scenario.tsx +4 -0
  101. package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +2 -1
  102. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/demo-frame/DemoFrame.tsx +29 -0
  103. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/screen-frame/ScreenFrame.tsx +34 -0
  104. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/token-preview/TokenPreview.tsx +119 -0
  105. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/showcase/mcp/main.tsx +6 -0
  106. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/ds.config.json +20 -0
  107. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/package.json +38 -0
  108. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/src/vite-env.d.ts +7 -0
  109. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/tsconfig.json +36 -0
  110. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/vite.config.ts +23 -0
  111. package/dist/skills/ads-designer/references/branding.md +89 -0
  112. package/dist/skills/ads-designer/references/cli.md +1 -1
  113. package/dist/skills/ads-designer/references/design-craft.md +1 -1
  114. package/dist/skills/ads-import/SKILL.md +2 -2
  115. package/dist/skills/ads-import/references/branding.md +10 -3
  116. package/dist/skills/ads-import/references/cli.md +1 -1
  117. package/dist/skills/ads-motion/SKILL.md +2 -2
  118. package/dist/skills/ads-port/SKILL.md +3 -3
  119. package/dist/skills/ads-port/references/cli.md +1 -1
  120. package/dist/token-fixtures.mjs +2 -2
  121. package/docs/ADS.md +12 -9
  122. package/docs/ARCHITECTURE.md +3 -2
  123. package/docs/CHANGELOG.md +56 -12
  124. package/docs/GUIDE.md +57 -15
  125. package/package.json +1 -1
  126. package/dist/bootstrap-ds/design-system/components/.gitkeep +0 -0
  127. package/dist/bootstrap-ds/design-system/composition/.gitkeep +0 -0
  128. package/dist/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
  129. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/.gitkeep +0 -0
  130. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/.gitkeep +0 -0
  131. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
@@ -160,7 +160,7 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
160
160
  return { ...registry, revision: previewSourceRevision(current) };
161
161
  }
162
162
  function captureIndex() { const inventory = captureInventory(); return captures.store.list(inventory.scenarios, inventory.revision, { prune: !inventory.diagnostics.length }); }
163
- const scenarioApps = (quick = false) => (quick ? quickRegistry() : getRegistry()).scenarios.map(item => ({ id: item.id, title: item.title, kind: item.kind, ...(item.samples ? { samples: item.samples } : {}), file: item.artifact }));
163
+ const scenarioApps = (quick = false) => (quick ? quickRegistry() : getRegistry()).scenarios.map(item => ({ id: item.id, title: item.title, kind: item.kind, ...(item.samples ? { samples: item.samples } : {}), ...(item.brand ? { brand: true } : {}), file: item.artifact }));
164
164
  const tokenScenarios = () => {
165
165
  const references=drafts.list({unit:"tokens",limit:100000}).drafts.map(({id,title,revision,state,preview})=>({id,title,revision,state,preview}));
166
166
  return getRegistry().scenarios.filter(item => item.kind === "tokens").map(item => ({ id:item.id,title:item.title,count:item.tokens.length,drafts:references }));
@@ -278,6 +278,7 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
278
278
  ...skills.skills.map(({ uri, frontmatter }) => ({ uri, name: frontmatter.name, description: frontmatter.description, mimeType: "text/markdown" })),
279
279
  ...documents.filter(document => promoted.has(document.uri)).sort((a, b) => Number(b.uri === context.publicEntryUri) - Number(a.uri === context.publicEntryUri)).map(({ file: _file, ...document }) => document),
280
280
  { uri: "ads://guides/tokens", name: "Shared Data and component variable boundaries", mimeType: "text/markdown" },
281
+ { uri: "ads://guides/branding", name: "Brand artwork, icons, committed targets and glyph sets", mimeType: "text/markdown" },
281
282
  { uri: "ads://guides/reporting", name: "Report suspected ADS bugs and feature requests", mimeType: "text/markdown" },
282
283
  { uri: TOKENS_APP_URI, name: "Experimental token widget", mimeType: APP_MIME },
283
284
  { uri: SCENARIO_APP_URI, name: "Experimental scenario widget", mimeType: APP_MIME },
@@ -325,6 +326,7 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
325
326
  if (uri === "ads://guides/validation") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/validation.md", import.meta.url), "utf8") }] };
326
327
  if (uri === "ads://guides/runtimes") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/runtimes.md", import.meta.url), "utf8") }] };
327
328
  if (uri === "ads://guides/evidence") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/evidence.md", import.meta.url), "utf8") }] };
329
+ if (uri === "ads://guides/branding") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/branding.md", import.meta.url), "utf8") }] };
328
330
  if (uri === "ads://guides/tokens") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/design-data.md", import.meta.url), "utf8") }] };
329
331
  if (uri === "ads://guides/reporting") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/reporting.md", import.meta.url), "utf8") }] };
330
332
  if (uri === "ads://guides/atomic-styles") return { contents: [{ uri, mimeType: "text/markdown", text: readFileSync(new URL("../skills/ads-designer/references/atomic-styles.md", import.meta.url), "utf8") }] };
@@ -498,7 +500,8 @@ export function createAdsMcp(directory, { era = "legacy", skillDirectory, pollIn
498
500
  } },
499
501
  { name: "ads_show_tokens", title: "Token previews", description: "Render a discovered token scenario with project-owned templates and fixtures. Pass its id as category, or omit for the first token scenario. Default waitFor: verified requires current checks. Interactive browsers may use waitFor: compiled for explicitly unverified feedback or a retained view. Older compilers provide a generic definition inspector.", schema: z.object({ category: z.string().max(256).optional(), waitFor: z.enum(["verified", "compiled"]).default("verified") }).strict(), _meta: { ui: { resourceUri: options.config.mcp.previewManifest ? PREVIEW_APP_URI : TOKENS_APP_URI } }, call: async ({ category, waitFor }, signal) => {
500
502
  const registry = await previewRegistry(waitFor);
501
- if (!category && options.config.mcp.previewManifest) category = registry.scenarios.find(item => item.kind === "tokens")?.id;
503
+ // A token group first; a brand scenario only when it is the token folder's only preview.
504
+ if (!category && options.config.mcp.previewManifest) category = (registry.scenarios.find(item => item.kind === "tokens" && !item.brand) ?? registry.scenarios.find(item => item.kind === "tokens"))?.id;
502
505
  if (!category && options.config.mcp.previewManifest) throw new Error("No token scenario is registered. Colocate a token scenario and fixture before opening the preview; ads_tokens still inspects definitions.");
503
506
  if (category) {
504
507
  const entry = registry.scenarios.find(item => item.kind === "tokens" && item.id === category);
@@ -49,7 +49,11 @@ export async function startShowcaseHost(factory, { port = 0, observe } = {}) {
49
49
  }
50
50
  });
51
51
  try {
52
- await new Promise((resolve, reject) => { web.once("error", reject); web.listen(port, "127.0.0.1", resolve); });
52
+ await new Promise((resolve, reject) => { web.once("error", reject); web.listen(port, "127.0.0.1", resolve); }).catch(error => {
53
+ // Commonly the project's ADS MCP (\`ads mcp --port\`), which serves its own showcase there.
54
+ if (error?.code === "EADDRINUSE" || /in use/i.test(error?.message ?? "")) throw Object.assign(new Error(`Port ${port} is already in use, often by another ADS showcase or the project's ADS MCP (it serves the showcase on its own --port). Open that showcase, or give this one another --port.`), { code: "EADDRINUSE" });
55
+ throw error;
56
+ });
53
57
  sandbox = await startSandboxHost(`http://127.0.0.1:${web.address().port}`);
54
58
  }
55
59
  catch (error) { web.close(); await observer?.close(); await handler.close(); throw error; }
@@ -1,5 +1,5 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import { mkdirSync, rmSync, writeFileSync } from "node:fs";
2
+ import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
3
3
  import path from "node:path";
4
4
  import { previewSourceRevision } from "./preview-inputs.mjs";
5
5
  import { createPreviewResources } from "./preview-resources.mjs";
@@ -56,7 +56,13 @@ export function createVitePreviewBuilder({ build, configure }) {
56
56
  // Rollup's watch task owns its input cache and replaces rollupOptions.cache.
57
57
  // Seed the first options hook; later builds use the watcher's own cache.
58
58
  let seed = moduleCache;
59
- const seedCache = {name:"ads-preview-seed-cache",options(input){if(!seed)return;const cache=seed;seed=undefined;return{...input,cache};}};
59
+ // A seeded module's transform ran in the previous graph's plugins. Styles a transform
60
+ // generates (Linaria's virtual `.wyw-in-js.css`) exist only in that plugin instance, so
61
+ // a cached module importing one is transformed again in this graph.
62
+ const virtualStyle = (id, code) => [...code.matchAll(/["']([^"'\n]+\.css)["']/g)].some(([, specifier]) =>
63
+ (specifier.startsWith(".") || path.isAbsolute(specifier)) && !existsSync(path.resolve(path.dirname(id), specifier)));
64
+ const seedCache = {name:"ads-preview-seed-cache",options(input){if(!seed)return;const cache=seed;seed=undefined;return{...input,cache};},
65
+ shouldTransformCachedModule({ id, code }) { return path.isAbsolute(id) && virtualStyle(id, code) || null; }};
60
66
  let started;
61
67
  let candidate;
62
68
  const capture = { name: "ads-incremental-preview", enforce: "post",
@@ -165,13 +165,15 @@ export function createBunPreviewBuilder() {
165
165
  return{name:"ads-bun-preview",setup(build){
166
166
  build.onResolve({filter:/./},args=>{
167
167
  if(/[?&]worker(?:[&=]|$)/.test(args.path)){const specifier=args.path.split("?")[0];return{path:resolve(specifier,args.importer),namespace:args.path.includes("url")?"ads-worker-url":"ads-worker"};}
168
- if(/[?&](?:url|raw|ads-asset)(?:[&=]|$)/.test(args.path))return{path:resolve(args.path.split("?")[0],args.importer),namespace:args.path.includes("raw")?"ads-raw":"ads-file"};
168
+ // Bun shares one module per path across namespaces: a raw import keeps its own path, so
169
+ // the same file can be both a URL (a brand preview) and text (a component's geometry).
170
+ if(/[?&](?:url|raw|ads-asset)(?:[&=]|$)/.test(args.path)){const raw=/[?&]raw(?:[&=]|$)/.test(args.path),file=resolve(args.path.split("?")[0],args.importer);return{path:raw?`${file}?raw`:file,namespace:raw?"ads-raw":"ads-file"};}
169
171
  const mapped=alias(args.path);if(mapped!==args.path)return{path:resolve(mapped,args.importer)};
170
172
  if(args.path.endsWith(".css")&&resolve(args.path,args.importer||foundation)===foundation)return{path:foundation,namespace:"ads-foundation"};
171
173
  });
172
174
  build.onLoad({filter:/./,namespace:"ads-foundation"},()=>({contents:"export {};",loader:"js"}));
173
175
  build.onLoad({filter:/./,namespace:"ads-file"},args=>{inputs.add(args.path);return{contents:readFileSync(args.path),loader:"file"};});
174
- build.onLoad({filter:/./,namespace:"ads-raw"},args=>{inputs.add(args.path);return{contents:readFileSync(args.path,"utf8"),loader:"text"};});
176
+ build.onLoad({filter:/./,namespace:"ads-raw"},args=>{const file=args.path.replace(/\?raw$/,"");inputs.add(file);return{contents:readFileSync(file,"utf8"),loader:"text"};});
175
177
  for(const namespace of ["ads-worker","ads-worker-url"])build.onLoad({filter:/./,namespace},async args=>{
176
178
  await args.defer();
177
179
  const name=await worker(args.path,ancestors),url=JSON.stringify("./"+name);
@@ -178,7 +178,7 @@ export function createPreviewResources(output, options, entries, {retain, prune
178
178
  const scenarios = entries.map((entry, index) => {
179
179
  const chunk = bundle.find(item => item.type === "chunk" && item.facadeModuleId === `\0ads-preview-entry:${index}`);
180
180
  if (!chunk) throw new Error(`Missing compiled scenario entry: ${entry.id}`);
181
- return retain?.manifest.scenarios.find(previous=>previous.id===entry.id) ?? { id: entry.id, title: entry.title, kind: entry.kind, ...(entry.samples ? { samples: entry.samples } : {}), ...(entry.paintBindings?.length ? {paintBindings:entry.paintBindings} : {}), ...(entry.paintAudit?{paintAudit:true}:{}), module: uris.get(chunk.fileName) };
181
+ return retain?.manifest.scenarios.find(previous=>previous.id===entry.id) ?? { id: entry.id, title: entry.title, kind: entry.kind, ...(entry.samples ? { samples: entry.samples } : {}), ...(entry.brand ? { brand: true } : {}), ...(entry.paintBindings?.length ? {paintBindings:entry.paintBindings} : {}), ...(entry.paintAudit?{paintAudit:true}:{}), module: uris.get(chunk.fileName) };
182
182
  });
183
183
  // Rechunking a growing warm graph must not replace already compiled views.
184
184
  // Retain their exact closures for identical source/compiler modes, then prune
@@ -22,6 +22,8 @@ function literal(node, checker, seen = new Set()) {
22
22
  if (!node || seen.has(node)) return undefined;
23
23
  seen = new Set([...seen, node]);
24
24
  if (node && ts.isStringLiteralLike(node)) return node.text;
25
+ if (node?.kind === ts.SyntaxKind.TrueKeyword) return true;
26
+ if (node?.kind === ts.SyntaxKind.FalseKeyword) return false;
25
27
  if (node && ts.isArrayLiteralExpression(node)) return node.elements.map(item => literal(item, checker, seen));
26
28
  if (node && ts.isObjectLiteralExpression(node)) return Object.fromEntries(node.properties.map((item) => ts.isPropertyAssignment(item) && item.name && (ts.isIdentifier(item.name) || ts.isStringLiteralLike(item.name)) ? [item.name.text, literal(item.initializer, checker, seen)] : ["invalid", undefined]));
27
29
  if (checker && (ts.isIdentifier(node) || ts.isPropertyAccessExpression(node))) {
@@ -123,7 +125,7 @@ export function inspectScenarios(options, suppliedProgram) {
123
125
  report(file, "Scenario metadata is not statically readable. Render coverage is not established until this prerequisite is repaired.", metadataExpression, {coverage:"not-established",owner:units.owner(relative)});
124
126
  continue;
125
127
  }
126
- for(const field of Object.keys(metadata))if(!["id","title","kind","covers","exercises","tokens","samples","captureTargets"].includes(field))report(file,`Unknown scenario field ${field}.`,entryNode(field),{entry:field});
128
+ for(const field of Object.keys(metadata))if(!["id","title","kind","covers","exercises","tokens","samples","captureTargets","brand"].includes(field))report(file,`Unknown scenario field ${field}.`,entryNode(field),{entry:field});
127
129
  const group = scenarioGroup(file, units.owner(relative));
128
130
  if(typeof metadata.title!=="string"||!metadata.title.trim()) {
129
131
  report(file,"Scenario title must be a nonempty static string; independent render evidence is retained.",entryNode("title"),{entry:"title"});
@@ -136,7 +138,12 @@ export function inspectScenarios(options, suppliedProgram) {
136
138
  if(Object.hasOwn(metadata,"tokens")&&(!Array.isArray(metadata.tokens)||metadata.tokens.some(name=>typeof name!=="string"||!name.startsWith("--")))) {
137
139
  report(file,"Scenario tokens must be a static list of real token names.",entryNode("tokens"),{entry:"tokens"});metadata.tokens=[];
138
140
  }
139
- if(kind==="tokens"&&Object.hasOwn(metadata,"tokens")||kind==="tokens"&&!validTokenSamples(metadata.samples)||Object.hasOwn(metadata,"samples")&&!validTokenSamples(metadata.samples)) {
141
+ // A brand scenario in the token folder previews artwork, not token bindings.
142
+ if(Object.hasOwn(metadata,"brand")&&(metadata.brand!==true||kind!=="tokens"||Object.hasOwn(metadata,"samples"))) {
143
+ report(file,"brand: true marks a token-folder scenario that previews assets/brand artwork; it has no token samples.",entryNode("brand"),{entry:"brand"});delete metadata.brand;
144
+ }
145
+ const brand=metadata.brand===true;
146
+ if(kind==="tokens"&&Object.hasOwn(metadata,"tokens")||kind==="tokens"&&!brand&&!validTokenSamples(metadata.samples)||Object.hasOwn(metadata,"samples")&&!validTokenSamples(metadata.samples)) {
140
147
  report(file,"Token scenarios need samples: fixture.samples, a literal list of { token, property, probe } real CSS bindings. Printing values or covers: [] is incomplete.",entryNode("samples"),{entry:"samples"});delete metadata.samples;
141
148
  }
142
149
  const covers = [];
@@ -176,7 +183,7 @@ export function inspectScenarios(options, suppliedProgram) {
176
183
  if(bindingTrace) findBindings(source);
177
184
  const paintBindings = inspectRuntimeContracts(options,program).bindings.filter(binding=>reachable.has(binding.scope.apiName)).map(binding=>({owner:binding.unit,name:binding.name,scope:binding.scope.selector,prefix:binding.prefix,suffix:binding.suffix,tokens:tokenInventory.tokens.filter(token=>!token.owner||token.owner==="tokens"||token.owner===binding.unit).map(token=>token.name)}));
178
185
  const paintAudit=contractDeclarations.some(contract=>contract.paintInputs?.some(input=>reachable.has(input.apiName)));
179
- scenarios.push({ id, kind, title: metadata.title, ...(group ? { group } : {}), ...(fixture ? { fixture: path.relative(root, fixture).replaceAll("\\", "/") } : {}), covers: [...new Set(metadata.covers)], ...(captureTargets ? { captureTargets } : {}), ...(Object.hasOwn(metadata, "exercises") ? { exercises: [...new Set(exercises)] } : {}), tokens, ...(metadata.samples ? { samples: metadata.samples } : {}), ...(paintBindings.length?{paintBindings}:{}), ...(paintAudit?{paintAudit:true}:{}), file: path.relative(root, file).replaceAll("\\", "/"), artifact: path.relative(root, scenarioArtifact(root, id)).replaceAll("\\", "/") });
186
+ scenarios.push({ id, kind, title: metadata.title, ...(group ? { group } : {}), ...(fixture ? { fixture: path.relative(root, fixture).replaceAll("\\", "/") } : {}), covers: [...new Set(metadata.covers)], ...(captureTargets ? { captureTargets } : {}), ...(Object.hasOwn(metadata, "exercises") ? { exercises: [...new Set(exercises)] } : {}), tokens, ...(metadata.samples ? { samples: metadata.samples } : {}), ...(metadata.brand ? { brand: true } : {}), ...(paintBindings.length?{paintBindings}:{}), ...(paintAudit?{paintAudit:true}:{}), file: path.relative(root, file).replaceAll("\\", "/"), artifact: path.relative(root, scenarioArtifact(root, id)).replaceAll("\\", "/") });
180
187
  }
181
188
  return { scenarios: scenarios.sort((a, b) => a.id.localeCompare(b.id)), diagnostics };
182
189
  }
@@ -297,7 +304,7 @@ export function inspectScenarioCoverage(options, program, report, advise = () =>
297
304
  else if (!exercised.has(name)) advise(source.fileName, "scenario-exercise-review", `${name} is referenced dynamically. Verify its invocation in the registered browser/behavior checks; a reference alone does not prove execution.`);
298
305
  }
299
306
  for (const name of referencedTokens) if (!declaredTokens.has(name)) report(source.fileName, "token-scenario-reference", `Reachable scenario input references undeclared token ${name}.`);
300
- if (scenario.kind === "tokens" && !samplesPassed) report(source.fileName, "token-scenario-render", "Pass the declared fixture.samples into a rendered review renderer's samples prop. Printing token names or reading unused fixtures is not sample coverage.");
307
+ if (scenario.kind === "tokens" && !scenario.brand && !samplesPassed) report(source.fileName, "token-scenario-render", "Pass the declared fixture.samples into a rendered review renderer's samples prop. Printing token names or reading unused fixtures is not sample coverage.");
301
308
  for (const name of scenario.tokens) {
302
309
  if (!referencedTokens.has(name)) report(source.fileName, "token-scenario-render", `${name} is declared in tokens but has no reachable reference from the default scenario entry. Consume the real token fixture; metadata alone does not count.`);
303
310
  else if (scenario.kind === "tokens" && samplesPassed && declaredTokens.has(name)) coveredTokens.add(name);
@@ -157,8 +157,8 @@ production and scenario builds; never alias React to Preact just to shrink a
157
157
  preview. Native Preact uses its own JSX transform, hooks and DOM events (live
158
158
  text updates use `onInput`). Native SVG uses DOM names such as `stroke-width`,
159
159
  not React presentation aliases. Keep Linaria extraction and the same public APIs.
160
- The shipped empty starter uses React; the tool repository's working example
161
- uses Preact. Neither is a component dependency of the receiving project.
160
+ The starter comes for React and for Preact; the tool repository's working
161
+ example uses Preact. Neither is a component dependency of the receiving project.
162
162
 
163
163
  ## Choose the work
164
164
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ads-designer
3
- description: Bootstrap an empty local React design system from bundled scaffolding, or build UI using a project's existing design system. Covers shared token contracts, local ownership, public APIs, external source integration, showcase inspection, and validation.
3
+ description: Bootstrap an empty local React or Preact design system from bundled scaffolding, or build UI using a project's existing design system. Covers shared token contracts, local ownership, public APIs, external source integration, showcase inspection, and validation.
4
4
  ---
5
5
 
6
6
  ## Choose the editing workflow
@@ -36,14 +36,14 @@ and memory limits in project configuration; verify real workloads under them.
36
36
  Inspect the target before editing. Read its `README.md`, `docs/ARCHITECTURE.md`
37
37
  and `docs/ADS.md` when present (or existing project guides), public exports, and relevant
38
38
  component guides. Preserve its
39
- framework and contracts. Starting from zero works from the bundled empty
40
- scaffold without an example repository.
39
+ framework and contracts. Starting from zero works from the bundled starter
40
+ without an example repository.
41
41
 
42
42
  Linaria is required for ADS component and pattern styling. Preserve the target's
43
43
  UI framework and integrate compatible Linaria extraction with both application
44
- and preview builds. The bundled React/TypeScript starter already configures it;
45
- `ads init` does not install or configure Linaria. Use the starter when its
46
- framework is appropriate. Current core
44
+ and preview builds. The bundled React and Preact starters already configure it;
45
+ `ads init` does not install or configure Linaria. Use the starter for the
46
+ project's framework. Current core
47
47
  guards inspect JS/TS/JSX, CSS, and imported Linaria templates, not Vue/Svelte
48
48
  single-file components or general HTML component templates. Entry HTML mount
49
49
  CSS is checked; that is not component-template coverage. Preserve the target stack and matching
@@ -54,12 +54,13 @@ production and scenario builds; never alias React to Preact just to shrink a
54
54
  preview. Native Preact uses its own JSX transform, hooks and DOM events (live
55
55
  text updates use `onInput`). Native SVG uses DOM names such as `stroke-width`,
56
56
  not React presentation aliases. Keep Linaria extraction and the same public APIs.
57
- The shipped empty starter uses React; the tool repository's working example
58
- uses Preact. Neither is a component dependency of the receiving project.
57
+ The starter comes for React (`bootstrap-ds/`) and Preact (the same files
58
+ with `bootstrap-ds-preact/` copied over them); the tool repository's working
59
+ example uses Preact. Neither is a component dependency of the receiving project.
59
60
 
60
61
  When initializing a project without a saved framework, pass `--framework react`
61
62
  or `--framework preact` for its actual runtime. Init saves the choice and later
62
- runs reuse it. The bundled starter already declares React. Resolve any explicit
63
+ runs reuse it. Each starter already declares its framework. Resolve any explicit
63
64
  JSX/configuration conflict deliberately; do not change frameworks to make init
64
65
  pass. Init does not install the runtime or configure the application's compiler.
65
66
 
@@ -200,21 +201,32 @@ checks; do not fetch the unpublished package.
200
201
 
201
202
  Read [assets/bootstrap-ds/README.md](assets/bootstrap-ds/README.md) and its
202
203
  [contract](assets/bootstrap-ds/ADS.md). The scaffold contains semantic token
203
- defaults, React/TypeScript/Linaria configuration, general lint, a public
204
- barrel, empty product component directories, a project-owned token review renderer, and a project preview compiler adapter. The browser shell is supplied by ADS tooling.
205
- It contains no components, shell patterns, vendored fonts, or example screens.
204
+ defaults, React or Preact TypeScript/Linaria configuration, general lint, a public
205
+ barrel, project-owned review renderers (token tiles, demo and screen frames), and a project preview compiler adapter. The browser shell is supplied by ADS tooling.
206
+ It has one example of each layer to build on: two token groups (Color; Space, type &
207
+ motion), two components in two groups (`components/Actions/Button`,
208
+ `components/Forms/TextField`), one pattern (`patterns/Search/SearchBar`) and one
209
+ composition (`composition/Search/SearchPage`). Treat them as the project's own: adapt or replace them
210
+ for the requested product. It has no vendored fonts or icons.
206
211
 
207
212
  Resolve assets relative to this skill's `SKILL.md`, including after installation
208
213
  by `npx skills`. In the tool checkout, root `bootstrap-ds/` is canonical.
209
- For a new empty project, copy its **contents**, including dotfiles:
214
+ For a new empty project, copy its **contents**, including dotfiles. For
215
+ Preact, copy `bootstrap-ds-preact/` over them and drop the React lockfile; never
216
+ port the React files by hand:
210
217
 
211
218
  ```sh
212
- starter_dir="/absolute/path/to/ads-designer/assets/bootstrap-ds"
219
+ assets_dir="/absolute/path/to/ads-designer/assets"
213
220
  target_dir="/absolute/path/to/new-project"
221
+ framework="react" # or "preact"
214
222
  mkdir -p "$target_dir"
215
- cp -a "$starter_dir/." "$target_dir/"
223
+ cp -a "$assets_dir/bootstrap-ds/." "$target_dir/"
224
+ if [ "$framework" = preact ]; then
225
+ cp -a "$assets_dir/bootstrap-ds-preact/." "$target_dir/"
226
+ rm "$target_dir/package-lock.json"
227
+ fi
216
228
  cd "$target_dir"
217
- # Run ads init here when an actual tool distribution is available.
229
+ # Run ads init --framework "$framework" here when an actual tool distribution is available.
218
230
  npm install
219
231
  npm run build
220
232
  ```
@@ -226,6 +238,8 @@ The bundled application defaults to npm. For a new Bun application,
226
238
  translate nested npm script calls to `bun run` and omit the starter npm lockfile;
227
239
  preserve an existing app's package manager and lockfile when merging.
228
240
  Initialize/install ADS before running `npm run dev:showcase` for visual inspection.
241
+ `dev:showcase` and the project's ADS MCP (`.mcp.json`) each serve a showcase:
242
+ give them different ports, or open the MCP's showcase instead of starting one.
229
243
  Use an existing MCP runtime URL when connected; do not leave an unrequested
230
244
  server running.
231
245
 
@@ -313,6 +327,15 @@ consumer paths, dimensions, and transparent/background variants. With no icon
313
327
  source, generation is a no-op. Component imports retain destination branding;
314
328
  artwork replacement and token-value adoption are explicit selections.
315
329
 
330
+ Committed native and export icons are `assets.targets` (SVG copy, PNG, ICO, ICNS),
331
+ and UI icon sets are `assets.glyphs`; `ads assets` keeps them and the committed
332
+ `assets/generated.json` current, and `ads check` fails when they are stale. Describe
333
+ and license each artwork in `assets/brand/README.md`, pair dark-theme variants as
334
+ `<name>.dark.svg`, show them through a component, and preview them in a
335
+ `brand: true` token-folder scenario. Read
336
+ [branding.md](references/branding.md) (`ads://guides/branding`) before changing
337
+ brand artwork, icon outputs or glyphs.
338
+
316
339
  ## Design craft and mobile behavior
317
340
 
318
341
  For design direction, content/layout decisions, interface wording, component
@@ -534,7 +557,7 @@ adding an approval step solely because a showcase exists.
534
557
 
535
558
  ## Notifications when a local Toast exists
536
559
 
537
- Read the local notification guide before using its API; the empty scaffold has
560
+ Read the local notification guide before using its API; the starter has
538
561
  no Toast. Follow its host/provider mounting, routing, scope, duration, and focus
539
562
  contracts instead of assuming Sonner compatibility or a particular native API.
540
563
 
@@ -546,12 +569,12 @@ information in the relevant form, inline alert, or dialog.
546
569
 
547
570
  Customize through shared tokens, component mappings and documented variants. Stacking, gestures,
548
571
  measured geometry, and animation belong to the component. Register applicable
549
- component-local usage rules in project tooling; do not assume the empty scaffold
572
+ component-local usage rules in project tooling; do not assume the starter
550
573
  includes them or that core tooling bundles this component.
551
574
 
552
575
  ## Validate
553
576
 
554
- Use the target's actual lint/typecheck/build commands. The empty scaffold provides:
577
+ Use the target's actual lint/typecheck/build commands. The starter provides:
555
578
 
556
579
  ```sh
557
580
  npm run typecheck
@@ -24,7 +24,8 @@ The starter declares React in `ds.config.json`. Keep that choice, JSX, runtime
24
24
  dependencies and the preview mount adapter consistent. Init records a choice for
25
25
  an unconfigured project; it does not convert copied React source to Preact.
26
26
 
27
- The starter has no components or patterns yet. Add only what the product needs.
27
+ The starter has one example of each layer (Button, Logo, TextField, SearchBar,
28
+ SearchPage) and placeholder brand artwork. Rename, restyle or replace them; add only what the product needs.
28
29
  Keep the ADS in root `design-system/`, beside application `src/`.
29
30
  Keep public exports in `design-system/index.ts`; consumers use its `@ds` alias.
30
31
  `styles.css` is the foundation CSS entry and contains token imports only.
@@ -1,9 +1,15 @@
1
- # Empty native design system
1
+ # Starter native design system
2
2
 
3
- This private React/TypeScript workspace contains semantic CSS tokens, a project-owned
3
+ This private React or Preact TypeScript workspace contains semantic CSS tokens, a project-owned
4
4
  token review renderer, a public barrel, Linaria extraction and a preview compiler
5
- adapter. It has no product components, icons, fonts or example screens. The minimal showcase
6
- shell and MCP client come from ADS tooling.
5
+ adapter, plus one example of each layer to build on: two token groups (Color; Space, type &
6
+ motion) and a Brand preview, components in three groups (`components/Actions/Button`,
7
+ `components/Content/Logo`, `components/Forms/TextField`), one pattern
8
+ (`patterns/Search/SearchBar`) and one composition (`composition/Search/SearchPage`),
9
+ plus placeholder brand artwork in `assets/brand/` (a logo with its dark-theme
10
+ variant, and the app icon that `assets.iconSource` names). Rename, restyle or
11
+ replace them as the product's own; it has no fonts. The minimal showcase shell and MCP client
12
+ come from ADS tooling.
7
13
 
8
14
  Read the local [contract](ADS.md) and the
9
15
  [architecture](https://github.com/reqvire-org/ads/blob/main/docs/ARCHITECTURE.md).
@@ -11,12 +17,15 @@ Read the local [contract](ADS.md) and the
11
17
  ## Start
12
18
 
13
19
  Copy the contents of `bootstrap-ds/`, including dotfiles, into a new project.
14
- The installed `ads-designer` skill contains the same files in
15
- `assets/bootstrap-ds/`. Set the project name in `package.json`. Install Bun 1.4.1+ for ADS tooling and previews. The application can keep its
20
+ It is the React starter. For Preact, then copy `bootstrap-ds-preact/` over it
21
+ (its package, compiler settings, scenario mount, token preview and scenario
22
+ types) and delete the React `package-lock.json`. The installed `ads-designer`
23
+ skill contains the same files in `assets/bootstrap-ds/` and
24
+ `assets/bootstrap-ds-preact/`. Set the project name in `package.json`. Install Bun 1.4.1+ for ADS tooling and previews. The application can keep its
16
25
  Node/npm build pipeline. Use a current ADS release.
17
26
 
18
27
  ```sh
19
- npx @reqvire-org/ads init --framework react
28
+ npx @reqvire-org/ads init --framework react # or preact
20
29
  npm install
21
30
  npm run build
22
31
  npm run dev:showcase
@@ -40,10 +49,10 @@ Bun projects and preserves their scripts/lockfiles. Use `bun install` and
40
49
 
41
50
  For an existing application, merge only the ADS source and required extraction,
42
51
  aliases and preview adapter. Preserve its framework, entry points and build.
43
- The starter declares `"framework": "react"` in `ds.config.json`. For an existing
44
- native Preact app without a saved ADS framework, use `ads init --framework preact`.
45
- Init records that choice and generates native hook imports without migrating the
46
- app or rewriting its compiler. Subsequent init runs reuse the saved choice.
52
+ Each starter declares its framework in `ds.config.json`. For an existing app
53
+ without a saved ADS framework, use `ads init --framework react` or
54
+ `--framework preact`. Init records that choice and adds that framework's token
55
+ preview and scenario mount without migrating the app or rewriting its compiler. Subsequent init runs reuse the saved choice.
47
56
  Init adds missing foundation files and connects architectural checks; it does
48
57
  not configure Linaria or generate product component source. Generated `.ds/` files are
49
58
  ignored; original artwork and provenance belong in `assets/brand/`.
@@ -51,14 +60,16 @@ ignored; original artwork and provenance belong in `assets/brand/`.
51
60
  ## Inspect and add UI
52
61
 
53
62
  When an agent already runs `ads mcp`, open its `ads_status.showcaseUrl`. MCP starts
54
- the website automatically. Otherwise `npm run dev:showcase` runs `ads showcase`.
63
+ the website automatically. Otherwise `npm run dev:showcase` runs `ads showcase`; give it a port the ADS MCP
64
+ does not use, since both serve a showcase.
55
65
  Its shell is minimal: tabs, collapsible left menu, theme switch and App slot.
56
66
  Its MCP client discovers entries, invokes preview tools and follows notifications.
57
67
  There are no required TokensPage/ComponentsPage/PatternsPage/CompositionPage
58
68
  files, and no separate project browser app to implement or rebuild.
59
69
 
60
- The existing `tokens/Foundation.ads.scenario.tsx` and colocated fixture visually demonstrate all
61
- starter token values. The fixture owns `{ token, property, probe }` bindings;
70
+ The `tokens/Color.ads.scenario.tsx` and `tokens/SpaceTypeMotion.ads.scenario.tsx`
71
+ groups and their colocated fixtures visually demonstrate all starter token values,
72
+ one tile per token with its current value. The fixture owns `{ token, property, probe }` bindings;
62
73
  the development-only `TokenPreview` renderer, exported through `@ds/review`, owns their presentation and applies the real CSS
63
74
  variables. Add/remove samples alongside token definitions. `ads check` rejects
64
75
  missing coverage and invented names; the App verifies the declared CSS bindings
@@ -1,29 +1,36 @@
1
1
  # Project branding
2
2
 
3
- Keep original logos, app icons, and artwork variants here. This starter contains
4
- no artwork. Record each asset's purpose, suitable backgrounds, usage, source
5
- credits, and applicable licenses when adding it.
3
+ The starter's placeholder artwork. Replace each file with the product's own and keep this
4
+ table current: `ads check` warns about artwork that is undescribed, unlicensed, unused or
5
+ missing from the brand scenario (`tokens/Brand.ads.scenario.tsx`).
6
+
7
+ | File | Use | Backgrounds |
8
+ |---|---|---|
9
+ | `logo.svg` | Logo in the UI (`components/Content/Logo`), light theme | Light surfaces |
10
+ | `logo.dark.svg` | The same logo for the dark theme | Dark surfaces |
11
+ | `app-icon.svg` | Master for web icons (`assets.iconSource`) and any `assets.targets` | Any; it has its own fill and padding |
12
+
13
+ License: placeholder artwork made for the ADS starter, free to use, change or remove
14
+ (MIT, like ADS). Record the real artwork's credits and license here when it replaces this.
15
+
16
+ ## How branding works
6
17
 
7
18
  UI branding uses the project-owned shared roles in `tokens/`: change values such as
8
19
  `--accent`, `--font-sans`, and `--radius-md`. Components own `--ds-*` variables;
9
20
  patterns and development review helpers own `--ux-*`; the showcase owns
10
- `--showcase-*`. Do not introduce a
11
- brand-prefixed token vocabulary or override component state variables.
21
+ `--showcase-*`. Do not introduce a brand-prefixed token vocabulary or override
22
+ component state variables.
23
+
24
+ Name a dark-theme variant `<name>.dark.svg`; the component showing the artwork renders
25
+ both and the theme picks one. Fixed colors belong inside the artwork only.
12
26
 
13
27
  Put licensed font files in `assets/fonts/` and their declarations in
14
28
  `tokens/fonts.css`. Keep that optional import first in `styles.css`.
15
29
 
16
- To generate web icons, set `assets.iconSource` in the project's `ds.config.json`
17
- to the SVG path relative to the ADS folder, for example:
18
-
19
- ```json
20
- { "assets": { "iconSource": "assets/brand/app-icon.svg" } }
21
- ```
22
-
23
- After `ads init`, the normal npm or Bun build generates `favicon.svg`,
24
- `favicon.ico` (16/32/48), `apple-touch-icon.png` (180), `icon-192.png`, and
25
- `icon-512.png` in ignored `.ds/assets/`. Run `ads assets` to regenerate manually.
26
- Outputs retain the artwork's colors and transparent background; provide an
27
- appropriate source background if a platform needs one. Mount this directory
28
- through the application's existing bundler and keep app manifest metadata in
29
- the application. Edit the original SVG, never generated variants.
30
+ `assets.iconSource` (here `assets/brand/app-icon.svg`) makes every build generate
31
+ `favicon.svg`, `favicon.ico` (16/32/48), `apple-touch-icon.png` (180), `icon-192.png` and
32
+ `icon-512.png` in ignored `.ds/assets/`; mount that folder through the application's
33
+ bundler and keep the manifest in the application. Native launchers, tray icons and
34
+ upload exports are committed `assets.targets` (PNG, ICO, ICNS or SVG copies), kept
35
+ fresh by `ads assets` and checked by `ads check`. Edit the masters here, never
36
+ generated files. See the [branding guide](https://github.com/reqvire-org/ads/blob/main/skills/ads-designer/references/branding.md).
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-label="Starter app icon">
2
+ <rect x="32" y="32" width="448" height="448" rx="112" fill="#c62648"/>
3
+ <circle cx="256" cy="256" r="104" fill="#ffffff"/>
4
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 40" role="img" aria-label="Starter">
2
+ <rect x="2" y="4" width="32" height="32" rx="8" fill="#fb7185"/>
3
+ <circle cx="18" cy="20" r="7" fill="#17191e"/>
4
+ <rect x="46" y="12" width="68" height="7" rx="3.5" fill="#f8fafc"/>
5
+ <rect x="46" y="24" width="44" height="5" rx="2.5" fill="#94a3b8"/>
6
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 40" role="img" aria-label="Starter">
2
+ <rect x="2" y="4" width="32" height="32" rx="8" fill="#c62648"/>
3
+ <circle cx="18" cy="20" r="7" fill="#ffffff"/>
4
+ <rect x="46" y="12" width="68" height="7" rx="3.5" fill="#1e293b"/>
5
+ <rect x="46" y="24" width="44" height="5" rx="2.5" fill="#64748b"/>
6
+ </svg>
@@ -0,0 +1 @@
1
+ export const fixture = { title: "Button", primary: "Save", secondary: "Cancel", disabled: "Unavailable" } as const;
@@ -0,0 +1,13 @@
1
+ import { Button } from "@ds";
2
+ import { DemoFrame } from "@ds/review";
3
+ import { fixture } from "./Button.ads.fixture";
4
+ export const scenario = { title: fixture.title, covers: ["Button"] };
5
+ export default function Scenario() {
6
+ return (
7
+ <DemoFrame>
8
+ <Button label={fixture.primary} variant="primary" />
9
+ <Button label={fixture.secondary} />
10
+ <Button label={fixture.disabled} disabled />
11
+ </DemoFrame>
12
+ );
13
+ }
@@ -0,0 +1,49 @@
1
+ import { css, cx } from "@linaria/atomic";
2
+
3
+ export interface ButtonProps {
4
+ label: string;
5
+ /** `primary` for the main action of a view; `secondary` for the others. */
6
+ variant?: "primary" | "secondary";
7
+ type?: "button" | "submit";
8
+ disabled?: boolean;
9
+ onClick?: () => void;
10
+ }
11
+
12
+ const base = css`
13
+ display: inline-flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ padding-block: var(--space-4);
17
+ padding-inline: var(--space-8);
18
+ border-width: var(--border-w);
19
+ border-style: solid;
20
+ border-color: transparent;
21
+ border-radius: var(--radius-md);
22
+ font-size: var(--text-base);
23
+ font-weight: var(--weight-semibold);
24
+ line-height: var(--leading-normal);
25
+ cursor: pointer;
26
+ &:disabled { cursor: default; opacity: 0.5; }
27
+ `;
28
+ const variants = {
29
+ primary: css`
30
+ background: var(--accent);
31
+ color: var(--accent-fg);
32
+ &:hover:not(:disabled) { background: var(--accent-hover); }
33
+ `,
34
+ secondary: css`
35
+ background: var(--bg-surface);
36
+ border-color: var(--border-default);
37
+ color: var(--text-body);
38
+ &:hover:not(:disabled) { border-color: var(--accent); }
39
+ `,
40
+ };
41
+
42
+ /** A labelled action. */
43
+ export function Button({ label, variant = "secondary", type = "button", disabled, onClick }: ButtonProps) {
44
+ return (
45
+ <button type={type} className={cx("ds-button", base, variants[variant])} disabled={disabled} onClick={onClick}>
46
+ {label}
47
+ </button>
48
+ );
49
+ }
@@ -0,0 +1,12 @@
1
+ # Button
2
+
3
+ A labelled action. `variant="primary"` marks the main action of a view; other actions use the
4
+ default `secondary`. `type="submit"` submits its form.
5
+
6
+ | Prop | Type | Default |
7
+ |---|---|---|
8
+ | `label` | `string` | — |
9
+ | `variant` | `"primary" \| "secondary"` | `"secondary"` |
10
+ | `type` | `"button" \| "submit"` | `"button"` |
11
+ | `disabled` | `boolean` | `false` |
12
+ | `onClick` | `() => void` | — |
@@ -0,0 +1 @@
1
+ export const fixture = { title: "Logo", label: "Starter" } as const;
@@ -0,0 +1,12 @@
1
+ import { Logo } from "@ds";
2
+ import { DemoFrame } from "@ds/review";
3
+ import { fixture } from "./Logo.ads.fixture";
4
+ export const scenario = { title: fixture.title, covers: ["Logo"] };
5
+ export default function Scenario() {
6
+ return (
7
+ <DemoFrame>
8
+ <Logo label={fixture.label} />
9
+ <Logo label={fixture.label} size="large" />
10
+ </DemoFrame>
11
+ );
12
+ }
@@ -0,0 +1,41 @@
1
+ import { css, cx } from "@linaria/atomic";
2
+ import logo from "../../../assets/brand/logo.svg?url";
3
+ import logoDark from "../../../assets/brand/logo.dark.svg?url";
4
+
5
+ export interface LogoProps {
6
+ /** The product name, read by assistive technology. */
7
+ label: string;
8
+ size?: "small" | "large";
9
+ }
10
+
11
+ const base = css`
12
+ display: inline-flex;
13
+ align-items: center;
14
+ `;
15
+ const sizes = {
16
+ small: css`height: var(--space-12);`,
17
+ large: css`height: calc(var(--space-16) * 2);`,
18
+ };
19
+ const image = css`
20
+ display: block;
21
+ height: 100%;
22
+ width: auto;
23
+ `;
24
+ // Both variants are in the page; the theme shows one, so switching needs no script.
25
+ const light = css`
26
+ :root[data-theme="dark"] & { display: none; }
27
+ `;
28
+ const dark = css`
29
+ display: none;
30
+ :root[data-theme="dark"] & { display: block; }
31
+ `;
32
+
33
+ /** The product logo, in its light- or dark-theme artwork. */
34
+ export function Logo({ label, size = "small" }: LogoProps) {
35
+ return (
36
+ <span className={cx("ds-logo", base, sizes[size])} role="img" aria-label={label}>
37
+ <img className={cx(image, light)} src={logo} alt="" />
38
+ <img className={cx(image, dark)} src={logoDark} alt="" />
39
+ </span>
40
+ );
41
+ }