@nadicodeai/design-system 0.10.2 → 0.11.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/AGENTS.md +30 -101
- package/CONTEXT.md +75 -0
- package/DESIGN.md +180 -345
- package/README.md +27 -54
- package/dist/assets/logo-mark.svg +6 -0
- package/dist/assets/logo-wordmark.svg +4 -0
- package/dist/assets/nadia-canonical-face.png +0 -0
- package/dist/css/chat-autoplay.js +18 -27
- package/dist/css/index.css +2540 -56
- package/dist/favicon/apple-touch-icon.png +0 -0
- package/dist/favicon/favicon.ico +0 -0
- package/dist/favicon/favicon.svg +6 -16
- package/dist/favicon/icon-192.png +0 -0
- package/dist/favicon/icon-512.png +0 -0
- package/dist/favicon/site.webmanifest +2 -2
- package/dist/tailwind/nadicode.tailwind.json +98 -143
- package/dist/tokens/nadicode.dtcg.json +413 -908
- package/package.json +19 -11
- package/src/assets/logo-geometry.d.ts +27 -0
- package/src/assets/logo-geometry.js +204 -0
- package/src/assets/nadia-canonical-face.d.ts +2 -0
- package/dist/css/components/.gitkeep +0 -0
- package/dist/css/components/agent-avatar.css +0 -52
- package/dist/css/components/approval-gate.css +0 -145
- package/dist/css/components/artifact-preview.css +0 -81
- package/dist/css/components/chat-bubble-agent.css +0 -63
- package/dist/css/components/chat-bubble-user.css +0 -28
- package/dist/css/components/chat-thread.css +0 -159
- package/dist/css/components/handoff-banner.css +0 -37
- package/dist/css/components/image.css +0 -87
- package/dist/css/components/memory-item.css +0 -36
- package/dist/css/components/run-timeline.css +0 -160
- package/dist/css/components/state-row.css +0 -64
- package/dist/css/components/state-tag.css +0 -67
- package/dist/css/components/status-tag.css +0 -101
- package/dist/css/components/tool-call-trace.css +0 -36
- package/dist/css/components/typing-dots.css +0 -54
- package/dist/css/components/usage-meter.css +0 -63
- package/dist/css/foundation.css +0 -177
- package/dist/css/layout.css +0 -657
- package/dist/css/motion.css +0 -225
- package/dist/css/primitives.css +0 -333
- package/dist/css/reset.css +0 -22
- package/dist/css/tokens.generated.css +0 -349
- package/dist/css/tokens.local.css +0 -11
- package/dist/tailwind/nadicode.theme.css +0 -596
- package/src/assets/favicon.svg +0 -17
- package/src/assets/logo-mark.svg +0 -15
- package/src/assets/logo-wordmark.svg +0 -26
- package/src/assets/nadia.d.ts +0 -9
- package/src/assets/nadia.png +0 -0
package/AGENTS.md
CHANGED
|
@@ -1,114 +1,43 @@
|
|
|
1
1
|
# @nadicodeai/design-system
|
|
2
2
|
|
|
3
|
-
The `@nadicodeai/design-system` npm workspace. `DESIGN.md` is the normative
|
|
4
|
-
|
|
5
|
-
**Path convention:** every path in this file is relative to `design-system/` (this directory). Repo-root paths are written with a leading `../`. Commands run from inside `design-system/`; from the repo root, use `npm run <script> -w design-system` (the root scripts delegate the same way).
|
|
6
|
-
|
|
7
|
-
## Boundaries
|
|
8
|
-
|
|
9
|
-
Plain imperatives are the default. The few hard prohibitions below use `never`/`do not`; treat those as load-bearing.
|
|
10
|
-
|
|
11
|
-
- Treat `DESIGN.md` as the only reusable implementation contract for colors, tokens, typography, layout doctrine (the `## Layout` page grammar), component behavior, and package exports.
|
|
12
|
-
- Keep `DESIGN.md` contract-only and `@google/design.md` spec-shaped: edit only reusable brand tokens, design rationale, layout doctrine, component semantics, and do/don't guardrails; do not add implementation notes, showcase content, page-specific details, examples, or non-essential narrative.
|
|
13
|
-
- Read `DESIGN.md` before stating colors, tokens, typography, layout doctrine, or component behavior.
|
|
14
|
-
- Preserve approved `DESIGN.md` token and component families unless the user explicitly approves a palette/component migration. Website/kernel CSS is implementation evidence, not the complete palette authority; never delete tokens because current prototypes do not use them or because `@google/design.md lint` reports them as unused.
|
|
15
|
-
- Name implemented grids, components, modules, and page elements as NadicodeAI-owned primitives; source brands such as Vercel or Attio may appear only in reference notes, never in component names, CSS comments, `data-module` values, or public-facing contracts.
|
|
16
|
-
- Calculate page grids, module spans, seams, borders, and element placement from explicit grid math; never hand-place visual structure by eye.
|
|
17
|
-
- Author CSS-bundle work as a reusable design-system component architecture first, not as showcase/page-specific code. The design-system CSS lives in `src/css/` (`tokens.generated` [built from `DESIGN.md`] + `tokens.local` [hand-authored] / `reset`/`foundation`/`motion`/`layout`/`primitives` + `components/*`, mirrored to `dist/css/` and exported as `@nadicodeai/design-system/css`). Since the Tailwind+shadcn migration (ADR 0007) the bundle ships only framework-agnostic brand/display CSS components: the cascade is `@layer tokens, reset, foundation, motion, layout, primitives, components;` (no `sections` layer), and `components/*` holds the agent-chat CSS component family, the run-state `state-tag` family, the entity-status `status-tag` family, and `image` — the generic marketing/SaaS component CSS and the whole `sections/*` layer retired to React shadcn components in `@nadicodeai/ui`. The delivery tiers map to real authoring homes: tokens → `tokens.generated`/`tokens.local`; page grammar → `layout.css`; CSS primitives/components → `primitives.css` + `components/*`; specimens → `examples/`. Contracted CSS components are paired with `DESIGN.md components:` entries; the three named CSS-internal components are deliberate no-token exceptions. Pages, site-specific page assemblies, and the standard/interactive/section UI belong to consuming surfaces (`../website/`, `../portal/`, sibling Nadia apps) and to the React package (`@nadicodeai/ui`), not this package. Study current source HTML/CSS for approved external references before implementing similar NadicodeAI primitives, then adapt the structure into NadicodeAI-owned tokens, primitives, and components. Specimen HTML demonstrates only already-defined primitives/components; it never invents component geometry, seams, borders, fillers, heights, or responsive behavior inline. The generated token layer (`tokens.generated.css`) and the Tailwind adapter (`nadicode.theme.css`) are emitted by Style Dictionary (`scripts/sd/`, driven from `scripts/build.ts`) as a complete projection of the `@google/design.md` export — never an allowlist or subset; responsive `@media` switching and composed/`calc` vars live in `layout.css`/`tokens.local.css` and reference emitted `--nc-*` tokens only, while the `.nc-type-*` utility classes live in `foundation.css`. Emitted-but-unreferenced tokens are intentional (the contract drives emission, not consumption), and the generated Tailwind adapter owns standard shadcn role maps for both `:root` and `.dark` using generated `--color-*`/`--radius-*` references, plus a set of `--nc-*` remaps in the `:root.dark` block (the surface palette — `canvas*`, `ink`, `body`, `muted`, `line`, `warning-soft`/`-deep` — and the `state-*`, `selection-*`, `cross`, and chart families → their `--nc-dark-*` counterparts) so design-system CSS components that read those raw brand tokens directly flip on the dark console; `@nadicodeai/ui/globals.css` keeps the Tailwind role bridge plus UI-local product aliases. Correctness is enforced by export-derived structural parity (`tests/guards/token-structural-parity.test.ts` for the `--nc-*` layer; the per-token `@theme` value loops and light/dark role-integrity checks in `tests/guards/tailwind-v4-theme.test.ts` for the adapter), the narrowed two-way parity between `DESIGN.md` component YAML/prose and the retained CSS component surface (`tests/guards/components-yaml-matches-css.test.ts`, ADR 0007 D4), plus consumer discipline (`tests/guards/consumer-css-discipline.test.ts`), not a byte snapshot (ADR 0006 supersedes ADR 0005 D1–D3/D5; ADR 0008 supersedes ADR 0005 D4).
|
|
18
|
-
- Follow a source-first reference workflow for external visual references: inspect live/source DOM, stylesheet/CSSOM rules, inline styles, custom properties, computed styles, grid tracks, spans, seam ownership, colors, heights, and breakpoints before writing NadicodeAI code. Screenshots are verification evidence only after implementation; never use them as the source for authoring structure, geometry, or CSS.
|
|
19
|
-
- Never derive reusable kernel geometry from screenshots, eyeballing, one-off browser coordinates, or local patch experiments. Browser measurements may verify an implementation after the source CSS/DOM model is understood, but they do not replace reading the source rules that create the behavior.
|
|
20
|
-
- Map every imported visual behavior to either `DESIGN.md`, an existing kernel token/primitive, or an explicit user-approved change before implementation. If the reference leaves a required decision open, or if `DESIGN.md` does not decide it, ask before coding the missing decision, including height/row span, surface color, visual payload, content slots, crosshair placement, and responsive behavior.
|
|
21
|
-
- Never import reference mood, illustration, decorative geometry, dark/light polarity, animation, logo-like shapes, or atmosphere unless the user explicitly asked for that exact trait and it is compatible with `DESIGN.md`. External references provide structure and math first; NadicodeAI tokens and brand rules decide the visual language.
|
|
22
|
-
- Stop and re-read source CSS/DOM before a second visual/CSS patch to the same component. Repeated corrections mean the primitive model is not understood; do not keep stacking patches on top of a guessed model.
|
|
23
|
-
- Enforce single-owner seam geometry in `src/css/` components (the CSS bundle): each visible border, seam, guide, connector, crosshair, and filler edge is drawn by exactly one primitive/component layer at a given coordinate. Keep decorative rules and connector SVGs dimension-bounded to their owning strip/cell so they never overlap cell seams. When a line looks thicker than expected, investigate overlapping ownership with rendered DOM/CSS geometry before changing token color, opacity, or line weight.
|
|
24
|
-
- Treat the design-system kit (`src/css/components/` + the structural-geometry layers) as the consumable CSS surface that consumers compose with their React UI; `examples/` holds static specimens that demonstrate already-defined primitives and CSS components and never invent geometry, seams, heights, or responsive behavior inline. Kit tests and validators assert the current positive surface only — the kit files exist, the `examples/` specimens load, and the `./css` export is wired; they never name or police removed draft routes, page names, copy frames, mock sites, retired sections, or rejected concepts unless the user explicitly asks for a migration window.
|
|
25
|
-
- Do not add `examples/` process docs, composition contracts, proof documents, or planning layers before a working visual draft unless explicitly requested.
|
|
26
|
-
|
|
27
|
-
Generated-artifact and runtime-JS prohibitions live in the Forbidden Patterns table; per-domain process conventions (CSS/kernel authoring, reference-import workflow) are dispatched by the Task Routing table.
|
|
28
|
-
|
|
29
|
-
## Package Surface
|
|
30
|
-
|
|
31
|
-
- Keep package exports aligned with `package.json`.
|
|
32
|
-
- Treat `dist/tokens/nadicode.dtcg.json` and `dist/tailwind/nadicode.tailwind.json` as generated, tracked consumer artifacts.
|
|
33
|
-
- Treat `src/assets/` as the source for exported brand SVG assets.
|
|
34
|
-
- Treat `dist/icons/` as a generated icon set baked from the pinned `lucide-static` dependency by `npm run generate:icons` (also run inside `npm run build`) and exported via `./icons/*`; regenerate by bumping `lucide-static`, never hand-edit.
|
|
35
|
-
- The `design-canvas/` prototypes that `src/css/motion.css`, `src/js/chat-autoplay.js`, and `tests/guards/chat-showcase.test.ts` re-express are deleted from the tree; git history retains them under docs/experiments/design-canvas/. The kernel CSS and its tests are the living expression — never reconstruct the prototypes as a build, runtime component surface, or normative brand contract.
|
|
36
|
-
- Any change to package-consumed output (`DESIGN.md`, generated tokens, CSS bundle, Tailwind theme output, package exports, assets, package docs, or agent instructions) must end with an explicit npm release decision before handoff — enforced by the pre-push release gate: bump the version (merge then auto-publishes; see `../docs/agents/npm-publishing.md`) or mark a commit `[no-publish]`. If the change should reach external consumers, bump `@nadicodeai/design-system` and run `npm pack --dry-run -w @nadicodeai/design-system`. When `@nadicodeai/ui` consumes the changed output, publish `@nadicodeai/design-system` first, then bump/update/publish `@nadicodeai/ui`. Never claim the package is shipped to npm until `npm view @nadicodeai/design-system version` reports the intended version.
|
|
37
|
-
|
|
38
|
-
## Task Routing
|
|
39
|
-
|
|
40
|
-
| Task | Read first | Then read | Verify |
|
|
41
|
-
| --- | --- | --- | --- |
|
|
42
|
-
| Design token, contract, or token-pipeline change | `DESIGN.md`, `scripts/sd/config.ts`, `scripts/sd/transforms.ts`, `scripts/sd/format-token-layer.ts`, `scripts/sd/format-tailwind-v4-theme.ts` | `npm exec --package=@google/design.md -- design.md spec`, `scripts/build.ts`, `tests/guards/token-structural-parity.test.ts`, `tests/guards/consumer-css-discipline.test.ts`, `tests/guards/tailwind-v4-theme.test.ts` | `npm run lint:design && npm run build && npm run test` |
|
|
43
|
-
| Kernel geometry or component work | `DESIGN.md` Layout and Components | `src/css/index.css`, `src/css/layout.css`, `src/css/primitives.css`, `src/css/components/*.css`, `src/css/motion.css`, `tests/guards/kernel-css-architecture.test.ts`, `tests/guards/kernel-rendered-geometry.test.ts` | from design-system/: `npx vitest run tests/guards/kernel-css-architecture.test.ts tests/guards/kernel-rendered-geometry.test.ts` |
|
|
44
|
-
| CSS component or `examples/` specimen work | `DESIGN.md` Layout and Components | `src/css/components/`, `examples/`, `../skills/nadicodeai-brand-copy/SKILL.md`, `../skills/nadicodeai-brand-copy/references/writing-craft.md`, `../skills/nadicodeai-brand-copy/references/brand-voice-profile.md`, `../skills/nadicodeai-brand-copy/references/voice-examples.md` | `npm run test -- tests/guards/examples-package-coherence.test.ts` |
|
|
45
|
-
| Package consumption or export surface | `README.md` | `package.json`, `scripts/build.ts`, `dist/tailwind/`, `dist/tokens/` | `npm run build && npm run test -- tests/guards/build-produces-exports.test.ts tests/guards/tailwind-v4-theme.test.ts` |
|
|
46
|
-
|
|
47
|
-
## DESIGN.md Authoring
|
|
48
|
-
|
|
49
|
-
- Check `npm exec --package=@google/design.md -- design.md spec` before adding or changing YAML front matter fields.
|
|
50
|
-
- Put exact reusable values in YAML when they should export through `npm run build`: colors, typography, rounded, spacing, and component fields listed by the current spec.
|
|
51
|
-
- Put application guidance in prose when it describes how to use values: borders, gradients, grid placement, motion, state behavior, responsive composition, markup shape, and accessibility.
|
|
52
|
-
- Keep component identity paired inside `## Components`: every named YAML `components:` entry needs a matching Markdown `**\`component-name\`**` entry in the Components section, and every Markdown component entry in that section needs a matching YAML `components:` entry. YAML carries machine-readable component style hooks; Markdown carries usage, variants, constraints, and judgment.
|
|
53
|
-
- Keep page grammar and composition-pattern semantics in `## Layout`, not in YAML `components:`. The `## Layout` section is the home for the structural page-grammar names; the section-level compositions that arrange them ship as React shadcn components from `@nadicodeai/ui` (ADR 0007), not as a pure-CSS section layer here. Layout and composition names may use exact values from `colors`, `spacing`, `rounded`, and `typography`, but never encode them as component tokens unless the user explicitly approves a spec/export migration.
|
|
54
|
-
- Add a non-spec YAML field only when repo code, a test, or an explicit downstream consumer reads that field.
|
|
55
|
-
- Treat `@google/design.md` warnings as portability signals. Understand whether a warning is a real mistake or a knowingly non-portable contract field before changing the contract.
|
|
56
|
-
|
|
57
|
-
| WRONG | CORRECT | Why |
|
|
58
|
-
| --- | --- | --- |
|
|
59
|
-
| Add `components.form-input.borderColor` just to say the input has a border | State in prose: `form-input` uses a 1 px solid `{colors.line}` border | `borderColor` is outside the current spec fields, warns, and is not exported as a native component token |
|
|
60
|
-
| Add a semantic color token for a one-off use | Reuse the existing color token in prose unless the new token must vary independently | Avoid orphaned aliases that do not add a real contract boundary |
|
|
61
|
-
|
|
62
|
-
## Forbidden Patterns
|
|
63
|
-
|
|
64
|
-
| WRONG | CORRECT | Why |
|
|
65
|
-
| --- | --- | --- |
|
|
66
|
-
| Editing `dist/**` or `src/css/tokens.generated.css` directly | Edit `DESIGN.md`, then run `npm run build`; hand-authored token CSS goes in `src/css/tokens.local.css` | Both are generated from `DESIGN.md`; hand edits are overwritten on the next build |
|
|
67
|
-
| Hand-listing which tokens reach the CSS layer (an allowlist, "runtime subset", rename, or any `@media`/`calc` in `tokens.generated.css`) | Style Dictionary (`scripts/sd/`) emits a complete projection of the `@google/design.md` export: every token `--nc-<exact-name>: <exact-value>`, each name once. Responsive switching and composed/`calc` vars are hand-authored in `layout.css`/`tokens.local.css` and reference emitted `--nc-*` only | The export is the contract; a differing subset is drift. `token-structural-parity.test.ts` (export-derived) fails on any dropped/renamed/added/modified/duplicated var, a name collision, a non-px line-height, or any `@media`/`calc` in the generated layer (ADR 0006) |
|
|
68
|
-
| Hardcoding a color/radius/dimension in `src/css`, `examples/`, or the Tailwind adapter that duplicates or extends a token — including a `var(--token, <hex==its value>)` fallback | Reference the emitted token: `var(--nc-<name>)` / `var(--color-<name>)`. A new value goes to `DESIGN.md` first. There is no exception island: the system ships zero out-of-contract values, and the generated Tailwind adapter may ship light/dark role remaps only when every role value references generated `--color-*`/`--radius-*` tokens. Export-anchored generated aliases such as `--color-nadicode-muted` may duplicate the exported value only when a `var()` reference would collide with a downstream semantic bridge; these aliases must be generated from `DESIGN.md` through `scripts/sd/` and covered by tests. UI package `.dark` aliases must reference generated tokens or semantic roles | No second hand-authored value source may exist; the no-raw-literal and no-second-value-source guards in `consumer-css-discipline.test.ts` forbid duplicate values, fallback-encoded or not, outside the generated export-anchored aliases described here (ADR 0006; light/dark role maps per ADR 0008) |
|
|
69
|
-
| "Cleaning up" emitted-but-unreferenced tokens or the responsive alias block | Leave them. Emitted-unreferenced tokens (orphans) are the intended steady state — the contract drives emission, not consumption. Never add an orphan-detection test or delete a token/alias because no prototype uses it | The contract is the palette authority; consumption is not. Deleting unused tokens is the exact silent-removal the boundary rules forbid (ADR 0006) |
|
|
70
|
-
| Adding `render:showcase`, e2e, examples, registry, AI-Elements, or a second runtime JS file | Keep the package to `DESIGN.md`, assets, token/CSS exports, and the single vanilla `src/js/chat-autoplay.js` enhancer (exported via `./css/*`) | Those surfaces were intentionally removed; only the one dependency-free chat auto-play enhancer is carved out |
|
|
71
|
-
| Inventing token or component behavior | Read `DESIGN.md` | The brand contract is single-source |
|
|
72
|
-
| Changing package exports from memory | Read and update `package.json` | Consumers depend on the declared package surface |
|
|
3
|
+
The `@nadicodeai/design-system` npm workspace. `DESIGN.md` is the normative contract for reusable design tokens and package output; the package ships tokens, the CSS kit (structural geometry plus framework-agnostic brand display components), and assets. Repo-only `examples/` specimens prove that public surface. Standard, interactive, and section UI ships as React components from `@nadicodeai/ui`, not from here. Paths here are relative to `design-system/`; run commands from this directory, or with `-w design-system` from the repo root.
|
|
73
4
|
|
|
74
5
|
## Commands
|
|
75
6
|
|
|
76
7
|
| Command | When |
|
|
77
8
|
| --- | --- |
|
|
78
9
|
| `npm run lint:design` | After any `DESIGN.md` edit |
|
|
79
|
-
| `npm run
|
|
80
|
-
| `npm run
|
|
81
|
-
| `npm run
|
|
82
|
-
| `npm run test` |
|
|
83
|
-
| `npm run test:visual` | OPERATOR-ONLY, run in the foreground. The opt-in browser/`agent-browser` suite (`tests/**/*.visual.ts`) |
|
|
10
|
+
| `npm run build` | After any `DESIGN.md` edit; regenerates every `dist/` artifact (tokens, Tailwind data, icons, complete CSS bundle) |
|
|
11
|
+
| `npm run generate:icons` | After bumping `lucide-static`; rebakes `dist/icons/` (also runs inside `build`) |
|
|
12
|
+
| `npm run lint` / `npm run test` | After TS/JS changes / before handoff (browser-free) |
|
|
13
|
+
| `npm run test:visual` | Rendered CSS checks (`playwright.visual.config.ts`, `tests/visual/`) |
|
|
84
14
|
|
|
85
|
-
|
|
15
|
+
Handoff gate: `npm run lint:design && npm run lint && npm run build && npm run test`.
|
|
86
16
|
|
|
87
|
-
|
|
17
|
+
## Routing
|
|
88
18
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
19
|
+
| Task | Go to |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| Shared design-language terms | `CONTEXT.md` |
|
|
22
|
+
| Colors, tokens, typography, layout doctrine, seam ownership, component semantics | `DESIGN.md` (read it before stating any of these) |
|
|
23
|
+
| CSS layers, token pipeline, dark remaps, generated outputs, their guards | `DESIGN.md` "CSS Architecture & Token Pipeline"; decision history in `../docs/adr/` |
|
|
24
|
+
| Package exports | `package.json` (guard: `tests/guards/build-produces-exports.test.ts`) |
|
|
25
|
+
| Static or non-React consumption | `README.md` |
|
|
26
|
+
| React consumption | `../@nadicodeai/ui/docs/consuming-cross-repo.md` |
|
|
27
|
+
| Logo semantics and geometry; other assets and icons | `DESIGN.md` "Brand media authority"; implementation routes through `src/assets/`; `dist/` is generated, never hand-edited |
|
|
28
|
+
| `examples/` specimen work | `examples/` plus `../skills/nadicodeai-brand-copy/SKILL.md` for specimen copy (guard: `tests/guards/examples-package-coherence.test.ts`) |
|
|
29
|
+
| Releasing a change to package-consumed output | `../docs/internal/npm-publishing.md` |
|
|
30
|
+
| Visual test implementation | `playwright.visual.config.ts` and `tests/visual/` |
|
|
96
31
|
|
|
97
|
-
##
|
|
32
|
+
## Boundaries
|
|
98
33
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
| `agent-browser.json` | Project-level timeout defaults for workspace-local `agent-browser` visual checks |
|
|
110
|
-
| `src/assets/` | Package logo SVG exports |
|
|
111
|
-
| `dist/` | Generated token exports tracked for package consumers |
|
|
112
|
-
| `dist/icons/` | Generated Lucide-derived icon set, exported via `./icons/*` |
|
|
113
|
-
| `../docs/adr/` | Decision records (ADR 0005/0006 govern the token pipeline) |
|
|
114
|
-
| `src/css/motion.css` | The brand motion contract: register, the four moves, craft rules, banned moves — read before any animation work |
|
|
34
|
+
- Never edit `dist/**` or `src/css/tokens.generated.css` by hand; both regenerate from `DESIGN.md` via `npm run build` (enforced by `tests/guards/token-structural-parity.test.ts` and the DTCG drift check in `tests/guards/consumer-css-discipline.test.ts`).
|
|
35
|
+
- Token-only CSS: no raw color/radius/dimension literal in `src/css/`, `examples/`, or the Tailwind adapter, fallback-encoded or not; a new value enters `DESIGN.md` first (enforced by `tests/guards/consumer-css-discipline.test.ts`).
|
|
36
|
+
- Emitted-but-unreferenced contract tokens are intentional. Runtime aliases and compatibility variables are different: each must have a live caller or be removed (`DESIGN.md` "CSS Architecture & Token Pipeline").
|
|
37
|
+
- `DESIGN.md` `## Components` is the semantic component catalog; CSS is its implementation, and `tests/guards/component-contract-matches-css.test.ts` derives the two-way fence without a copied inventory.
|
|
38
|
+
- `DESIGN.md` stays contract-only and spec-shaped: check `npm exec --package=@google/design.md -- design.md spec` before changing YAML fields; exact reusable values go in YAML, application guidance in prose; add a non-spec YAML field only when repo code or a test reads it (spec-shape don'ts: `DESIGN.md` "Do's and Don'ts").
|
|
39
|
+
- Seams and grids are computed, single-owner, never eyeballed (doctrine home: `DESIGN.md` "## Layout" and "Seam Ownership").
|
|
40
|
+
- External references are source-first: read live DOM/CSSOM rules before authoring; screenshots verify, they never author. Map every imported behavior to `DESIGN.md` or an explicit user approval, ask when the contract leaves a decision open, and never import reference mood, polarity, decoration, or animation uninvited. Stop and re-read source before a second visual patch to the same component.
|
|
41
|
+
- Name everything as NadicodeAI-owned primitives; source brands (Vercel, Attio) appear only in reference notes, never in names, comments, or contracts.
|
|
42
|
+
- Any change to package-consumed output ends with an explicit release decision, a version bump or a `[no-publish]` commit marker (enforced by the pre-push release gate; procedure: `../docs/internal/npm-publishing.md`).
|
|
43
|
+
- The deleted `design-canvas/` prototypes live only in git history. `src/css/motion.css` preserves current runtime transitions and animations, while `src/js/chat-autoplay.js` is the single allowed runtime JS enhancer; never reconstruct the prototypes or add a second runtime JS surface.
|
package/CONTEXT.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Design Language
|
|
2
|
+
|
|
3
|
+
NadicodeAI's shared vocabulary for reusable visual decisions and interface structures. This context lets the design system, React UI package, website, and Portal describe the same visual ideas without inventing package-specific synonyms.
|
|
4
|
+
|
|
5
|
+
## Language
|
|
6
|
+
|
|
7
|
+
### Foundations
|
|
8
|
+
|
|
9
|
+
**Design contract**:
|
|
10
|
+
The normative specification for reusable design tokens, page grammar, component semantics, and visual-surface meanings. Implementations realize the contract; they do not redefine it.
|
|
11
|
+
|
|
12
|
+
**Design token**:
|
|
13
|
+
A named reusable visual value from the design contract, such as a color, spacing, radius, or typography value. A one-off component detail is not a token.
|
|
14
|
+
|
|
15
|
+
**Scale step**:
|
|
16
|
+
One numbered value in a functional color scale whose number carries the same interaction or contrast role across every scale.
|
|
17
|
+
_Avoid_: Shade, tint
|
|
18
|
+
|
|
19
|
+
**Brand tier**:
|
|
20
|
+
The full-strength campi used for identity, imagery, and section grounds. Brand-tier colors are planes, not interface states.
|
|
21
|
+
|
|
22
|
+
**Functional tier**:
|
|
23
|
+
The numeric color scales and semantic roles used by product UI, charts, and status. Functional-tier colors express interaction and meaning rather than brand fields.
|
|
24
|
+
|
|
25
|
+
**Campo**:
|
|
26
|
+
A named, full-strength brand color field from the design contract. A campo has no steps or hover variants.
|
|
27
|
+
_Avoid_: Swatch, theme color
|
|
28
|
+
|
|
29
|
+
**One campo per room**:
|
|
30
|
+
The composition rule that one section or image field owns one campo, with adjacent fields separated by a clear luminance change.
|
|
31
|
+
|
|
32
|
+
**Luminance jump**:
|
|
33
|
+
The perceptual brightness difference that makes the edge between adjacent campi, or between a campo and its text, read clearly.
|
|
34
|
+
|
|
35
|
+
### Structure and surfaces
|
|
36
|
+
|
|
37
|
+
**Page grammar**:
|
|
38
|
+
The shared structural system of frames, rows, lanes, fills, seams, markers, grids, and stages used to compose NadicodeAI pages.
|
|
39
|
+
|
|
40
|
+
**CSS primitive**:
|
|
41
|
+
A low-level, framework-agnostic CSS helper for geometry, type, seams, fills, or structural behavior. It carries no product-specific meaning.
|
|
42
|
+
|
|
43
|
+
**CSS component**:
|
|
44
|
+
A framework-agnostic visual component that remains useful on both static and interactive surfaces without owning an app feature.
|
|
45
|
+
|
|
46
|
+
**Run-state tag**:
|
|
47
|
+
The visual label for the state of agentic work, such as ready, running, review, blocked, or complete.
|
|
48
|
+
_Avoid_: Status badge
|
|
49
|
+
|
|
50
|
+
**Entity status tag**:
|
|
51
|
+
The visual label for an entity's lifecycle, health, or exception state. It does not represent the state of agentic work.
|
|
52
|
+
_Avoid_: Run-state tag
|
|
53
|
+
|
|
54
|
+
**Content surface**:
|
|
55
|
+
A visual family for presenting a concrete content type, such as an image or artifact, inside the page grammar.
|
|
56
|
+
|
|
57
|
+
**Agentic work surface**:
|
|
58
|
+
A NadicodeAI visual family for showing people and agents working together through conversations, artifacts, approvals, tools, handoffs, traces, and inspectable state.
|
|
59
|
+
|
|
60
|
+
**App-owned product feature**:
|
|
61
|
+
A product-specific route, screen, use case, or behavior owned by the consuming app rather than by the reusable design or UI packages.
|
|
62
|
+
|
|
63
|
+
### React composition
|
|
64
|
+
|
|
65
|
+
**React adapter**:
|
|
66
|
+
A thin typed React interface over approved design-system CSS grammar or assets. It exposes the shared implementation without taking ownership of it.
|
|
67
|
+
|
|
68
|
+
**Reusable composition**:
|
|
69
|
+
A React component that combines shared grammar, primitives, slots, variants, and responsive behavior into a repeatable product or marketing pattern.
|
|
70
|
+
|
|
71
|
+
**Reusable section**:
|
|
72
|
+
A reusable composition for one recurring content role, such as an introduction, proof area, media block, or call to action.
|
|
73
|
+
|
|
74
|
+
**Specimen**:
|
|
75
|
+
A runnable example that assembles shipped pieces for inspection without inventing new design rules.
|