@uibot/design-md 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/content/README.md CHANGED
@@ -10,6 +10,33 @@ Each `*.design.md` file is a self-contained design system written in the
10
10
  DESIGN.md and treats its tokens, rules, and constraints as the source of truth
11
11
  for the look-and-feel of generated components and pages.
12
12
 
13
+ ## Standard (2026-10-24)
14
+
15
+ UIBot follows the **Google Labs DESIGN.md format** (alpha, Apache-2.0,
16
+ <https://github.com/google-labs-code/design.md>): machine-readable tokens in YAML
17
+ frontmatter (and fenced ```yaml blocks), rationale in Markdown `##` sections in this order —
18
+ Overview, Colors, Typography, Layout, Elevation & Depth, Shapes, Components, Do's and Don'ts.
19
+
20
+ - **Tokens** (`parseDesignMdTokens`): `colors`, `typography` (`fontFamily` / `fontSize` /
21
+ `fontWeight` / `lineHeight` / `letterSpacing` / `fontFeature` / `fontVariation`), `rounded`,
22
+ `spacing`, `components`, with `{group.name}` references. Two UIBot extensions: `themes`
23
+ (color sets switched by `html[data-theme]`, first is default) and `forbidden` (`colors`, `fonts`).
24
+ - **Deviation:** a fenced yaml block counts as tokens only when it declares a token group; guides
25
+ also use yaml fences for Spec examples.
26
+ - **Section aliases:** the earlier formats still in use lint as their spec section — the
27
+ Stitch-derived 7-section project contract (`Visual Theme & Atmosphere`, `Color Palette & Roles`,
28
+ `Typographic Architecture`, `Component Behaviors`, `Layout Principles`, `Anti-Patterns`; `Motion
29
+ Philosophy` is an extra section) and the VoltAgent 9-section seeds below.
30
+ - **Tooling:** `lintDesignMd` (duplicate sections or keys are errors; order, colors, dimensions,
31
+ component properties and references are warnings); `designMdGuideText` puts a file's token
32
+ contract ahead of its body in generation prompts; `checkHtmlAgainstDesign` checks generated HTML
33
+ for forbidden colors, a forbidden font as the only family, and unused color variables.
34
+ - **Registry fields:** spec files carry `name` (and often `slug`) but no `id`/`category`; the
35
+ loader derives `id` from `slug` or `name` and defaults `category` to `general`.
36
+
37
+ `ink` and `paper` (`category: app`, from InfoOS App Build) are written in the spec format and
38
+ declare tokens; the brand seeds keep the 9-section body with tokens in tables.
39
+
13
40
  ## Attribution
14
41
 
15
42
  The 9-section DESIGN.md format adopted here originates with the
@@ -0,0 +1,57 @@
1
+ ---
2
+ id: ink
3
+ name: Ink
4
+ description: Dark ink app surface with a light Qing data-theme; tokens only, no one-off accents.
5
+ category: app
6
+ tags: [app, dark-first, themes, tokens, 应用, 深色, 墨]
7
+ layer: auto
8
+ origin: infoos
9
+ colors:
10
+ background: "oklch(0.17 0.02 230)"
11
+ foreground: "oklch(0.94 0.014 210)"
12
+ primary: "oklch(0.78 0.12 188)"
13
+ sidebar: "oklch(0.14 0.022 230)"
14
+ themes:
15
+ ink:
16
+ background: "oklch(0.17 0.02 230)"
17
+ foreground: "oklch(0.94 0.014 210)"
18
+ primary: "oklch(0.78 0.12 188)"
19
+ sidebar: "oklch(0.14 0.022 230)"
20
+ qing:
21
+ background: "oklch(0.962 0.02 208)"
22
+ foreground: "oklch(0.21 0.03 220)"
23
+ primary: "oklch(0.52 0.115 196)"
24
+ sidebar: "oklch(0.22 0.038 216)"
25
+ typography:
26
+ body-md:
27
+ fontFamily: "Geist, Noto Sans SC, sans-serif"
28
+ forbidden:
29
+ colors: ["#6366f1", "#7c3aed", "#8b5cf6"]
30
+ fonts: [Inter]
31
+ ---
32
+
33
+ ## Overview
34
+
35
+ Ink is a dark, calm application surface for generated apps: an ink-blue ground, near-white text
36
+ and one teal primary. Qing is the light companion theme for the same app. Both are switched with
37
+ `html[data-theme]`, so an app ships one stylesheet and never repaints components by hand.
38
+
39
+ ## Colors
40
+
41
+ Four roles, each a CSS variable: `--background` is the page ground, `--foreground` the text,
42
+ `--primary` the single accent for the main action and the current selection, `--sidebar` the
43
+ navigation shell. Derive borders and hover surfaces from these with `color-mix()` instead of adding
44
+ new hues. Status colors come from text and icons, not from new fills.
45
+
46
+ ## Typography
47
+
48
+ Geist with Noto Sans SC for Chinese, falling back to the system sans. Keep a small ladder (page
49
+ title, section title, body, helper) and let weight and spacing carry hierarchy.
50
+
51
+ ## Do's and Don'ts
52
+
53
+ - Do use `var(--background)`, `var(--foreground)`, `var(--primary)` and `var(--sidebar)`.
54
+ - Do switch themes with `html[data-theme="ink"]` and `html[data-theme="qing"]`.
55
+ - Don't hardcode indigo or violet (`#6366f1`, `#7c3aed`, `#8b5cf6`).
56
+ - Don't set `font-family` to Inter alone.
57
+ - Don't ship a purple-on-white three-card landing page as the default look.
@@ -0,0 +1,51 @@
1
+ ---
2
+ id: paper
3
+ name: Paper
4
+ description: Warm paper app surface. Light warm-gray ground, ink text, one brown accent, no purple.
5
+ category: app
6
+ tags: [app, light, warm, reading, tokens, 应用, 浅色, 纸]
7
+ layer: auto
8
+ origin: infoos
9
+ colors:
10
+ background: "oklch(0.97 0.012 85)"
11
+ foreground: "oklch(0.22 0.02 55)"
12
+ primary: "oklch(0.48 0.09 45)"
13
+ sidebar: "oklch(0.94 0.014 80)"
14
+ themes:
15
+ paper:
16
+ background: "oklch(0.97 0.012 85)"
17
+ foreground: "oklch(0.22 0.02 55)"
18
+ primary: "oklch(0.48 0.09 45)"
19
+ sidebar: "oklch(0.94 0.014 80)"
20
+ typography:
21
+ body-md:
22
+ fontFamily: "Geist, Noto Sans SC, sans-serif"
23
+ forbidden:
24
+ colors: ["#6366f1", "#7c3aed", "#8b5cf6"]
25
+ fonts: [Inter]
26
+ ---
27
+
28
+ ## Overview
29
+
30
+ Paper is a warm, light reading surface for generated apps: a soft paper ground, ink-brown text and
31
+ one restrained brown accent. Prefer it for documents, forms and content-heavy tools where a cool or
32
+ dark chrome would compete with the content.
33
+
34
+ ## Colors
35
+
36
+ Four roles, each a CSS variable: `--background` is the paper ground, `--foreground` the ink text,
37
+ `--primary` the single accent for the main action and the current selection, `--sidebar` the slightly
38
+ darker navigation shell. Borders and hover states mix these with `color-mix()`; do not add new hues.
39
+
40
+ ## Typography
41
+
42
+ Geist with Noto Sans SC for Chinese, falling back to the system sans. Generous line height for
43
+ reading; hierarchy comes from size and weight, not from color.
44
+
45
+ ## Do's and Don'ts
46
+
47
+ - Do use `var(--background)`, `var(--foreground)`, `var(--primary)` and `var(--sidebar)`.
48
+ - Do switch themes with `html[data-theme="paper"]`.
49
+ - Don't hardcode indigo or violet (`#6366f1`, `#7c3aed`, `#8b5cf6`).
50
+ - Don't set `font-family` to Inter alone.
51
+ - Don't ship a purple-on-white three-card landing page as the default look.
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export { DESIGN_MD_CONTENT_DIR, loadBundledDesignMdContent, seedDesignMdRegistry
9
9
  export { DesignMdRegistry } from "./registry.js";
10
10
  export { DesignMdSelectorImpl } from "./selector.js";
11
11
  export { extractTokensFromBody } from "./tokens.js";
12
+ export { canonicalDesignMdSection, checkHtmlAgainstDesign, DESIGN_MD_SECTIONS, type DesignContractViolation, type DesignMdLintIssue, type DesignMdSection, designMdGuideText, designTokensInstruction, lintDesignMd, parseDesignMdTokens, } from "./spec.js";
12
13
  export type { DesignMdFrontmatter } from "./schema.js";
13
14
  export { syncDesignMdFromRemote, resolveRemoteSource, injectAttribution, isDesignMdName, MAX_DESIGN_MD_BYTES, } from "./remote-source.js";
14
15
  export { serializeDesignMdFile, exportDesignMdRegistry, assertSerializeRoundTrip, } from "./export.js";